@leatcom/portal-sessions 0.0.90 → 0.0.91-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(lt,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(lt=typeof globalThis<"u"?globalThis:lt||self,x(lt.PortalSessions={},lt.React,lt.ReactDOM))})(this,function(lt,x,vi){"use strict";var gk=Object.defineProperty;var mk=(lt,x,vi)=>x in lt?gk(lt,x,{enumerable:!0,configurable:!0,writable:!0,value:vi}):lt[x]=vi;var Qn=(lt,x,vi)=>mk(lt,typeof x!="symbol"?x+"":x,vi);try{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},x=new lt.Error().stack;x&&(lt._sentryDebugIds=lt._sentryDebugIds||{},lt._sentryDebugIds[x]="62ef4691-9c7f-4193-96ea-df9d25ccd8e8",lt._sentryDebugIdIdentifier="sentry-dbid-62ef4691-9c7f-4193-96ea-df9d25ccd8e8")}catch{}{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};lt._sentryModuleMetadata=lt._sentryModuleMetadata||{},lt._sentryModuleMetadata[new lt.Error().stack]=Object.assign({},lt._sentryModuleMetadata[new lt.Error().stack],{"_sentryBundlerPluginAppKey:portal-sessions-application-key":!0})}function Jy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function Zy(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ce=Jy(x);{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"e7581208155a8912e240d4ddb0fcb16bc77418d2"}}var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fu={exports:{}},ua={};/**
1
+ (function(lt,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(lt=typeof globalThis<"u"?globalThis:lt||self,x(lt.PortalSessions={},lt.React,lt.ReactDOM))})(this,function(lt,x,vi){"use strict";var gk=Object.defineProperty;var mk=(lt,x,vi)=>x in lt?gk(lt,x,{enumerable:!0,configurable:!0,writable:!0,value:vi}):lt[x]=vi;var Qn=(lt,x,vi)=>mk(lt,typeof x!="symbol"?x+"":x,vi);try{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},x=new lt.Error().stack;x&&(lt._sentryDebugIds=lt._sentryDebugIds||{},lt._sentryDebugIds[x]="3e650dab-2e5c-47c4-aa0b-030e9fd0d7d3",lt._sentryDebugIdIdentifier="sentry-dbid-3e650dab-2e5c-47c4-aa0b-030e9fd0d7d3")}catch{}{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};lt._sentryModuleMetadata=lt._sentryModuleMetadata||{},lt._sentryModuleMetadata[new lt.Error().stack]=Object.assign({},lt._sentryModuleMetadata[new lt.Error().stack],{"_sentryBundlerPluginAppKey:portal-sessions-application-key":!0})}function Jy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function Zy(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ce=Jy(x);{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"6d328b22821d8474642bfa07352a6b6a9cf74f75"}}var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Lu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Fu={exports:{}},ua={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -14,15 +14,15 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var ah;function tv(){return ah||(ah=1,process.env.NODE_ENV!=="production"&&function(){var t=x,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),l=Symbol.iterator,g="@@iterator";function m(Y){if(Y===null||typeof Y!="object")return null;var Ee=l&&Y[l]||Y[g];return typeof Ee=="function"?Ee:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(Y){{for(var Ee=arguments.length,xe=new Array(Ee>1?Ee-1:0),Ne=1;Ne<Ee;Ne++)xe[Ne-1]=arguments[Ne];b("error",Y,xe)}}function b(Y,Ee,xe){{var Ne=y.ReactDebugCurrentFrame,ut=Ne.getStackAddendum();ut!==""&&(Ee+="%s",xe=xe.concat([ut]));var At=xe.map(function(Je){return String(Je)});At.unshift("Warning: "+Ee),Function.prototype.apply.call(console[Y],console,At)}}var E=!1,C=!1,I=!1,T=!1,P=!1,N;N=Symbol.for("react.module.reference");function L(Y){return!!(typeof Y=="string"||typeof Y=="function"||Y===r||Y===i||P||Y===o||Y===u||Y===d||T||Y===p||E||C||I||typeof Y=="object"&&Y!==null&&(Y.$$typeof===f||Y.$$typeof===h||Y.$$typeof===a||Y.$$typeof===s||Y.$$typeof===c||Y.$$typeof===N||Y.getModuleId!==void 0))}function V(Y,Ee,xe){var Ne=Y.displayName;if(Ne)return Ne;var ut=Ee.displayName||Ee.name||"";return ut!==""?xe+"("+ut+")":xe}function j(Y){return Y.displayName||"Context"}function W(Y){if(Y==null)return null;if(typeof Y.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof Y=="function")return Y.displayName||Y.name||null;if(typeof Y=="string")return Y;switch(Y){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof Y=="object")switch(Y.$$typeof){case s:var Ee=Y;return j(Ee)+".Consumer";case a:var xe=Y;return j(xe._context)+".Provider";case c:return V(Y,Y.render,"ForwardRef");case h:var Ne=Y.displayName||null;return Ne!==null?Ne:W(Y.type)||"Memo";case f:{var ut=Y,At=ut._payload,Je=ut._init;try{return W(Je(At))}catch{return null}}}return null}var q=Object.assign,k=0,U,z,te,oe,ne,se,we;function le(){}le.__reactDisabledLog=!0;function _e(){{if(k===0){U=console.log,z=console.info,te=console.warn,oe=console.error,ne=console.group,se=console.groupCollapsed,we=console.groupEnd;var Y={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:Y,log:Y,warn:Y,error:Y,group:Y,groupCollapsed:Y,groupEnd:Y})}k++}}function ve(){{if(k--,k===0){var Y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},Y,{value:U}),info:q({},Y,{value:z}),warn:q({},Y,{value:te}),error:q({},Y,{value:oe}),group:q({},Y,{value:ne}),groupCollapsed:q({},Y,{value:se}),groupEnd:q({},Y,{value:we})})}k<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=y.ReactCurrentDispatcher,$;function J(Y,Ee,xe){{if($===void 0)try{throw Error()}catch(ut){var Ne=ut.stack.trim().match(/\n( *(at )?)/);$=Ne&&Ne[1]||""}return`
18
- `+$+Y}}var S=!1,M;{var F=typeof WeakMap=="function"?WeakMap:Map;M=new F}function B(Y,Ee){if(!Y||S)return"";{var xe=M.get(Y);if(xe!==void 0)return xe}var Ne;S=!0;var ut=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var At;At=H.current,H.current=null,_e();try{if(Ee){var Je=function(){throw Error()};if(Object.defineProperty(Je.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Je,[])}catch(Jt){Ne=Jt}Reflect.construct(Y,[],Je)}else{try{Je.call()}catch(Jt){Ne=Jt}Y.call(Je.prototype)}}else{try{throw Error()}catch(Jt){Ne=Jt}Y()}}catch(Jt){if(Jt&&Ne&&typeof Jt.stack=="string"){for(var Xe=Jt.stack.split(`
17
+ */var ah;function tv(){return ah||(ah=1,process.env.NODE_ENV!=="production"&&function(){var t=x,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),f=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),l=Symbol.iterator,g="@@iterator";function m(Y){if(Y===null||typeof Y!="object")return null;var Ee=l&&Y[l]||Y[g];return typeof Ee=="function"?Ee:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(Y){{for(var Ee=arguments.length,xe=new Array(Ee>1?Ee-1:0),Ne=1;Ne<Ee;Ne++)xe[Ne-1]=arguments[Ne];b("error",Y,xe)}}function b(Y,Ee,xe){{var Ne=y.ReactDebugCurrentFrame,ut=Ne.getStackAddendum();ut!==""&&(Ee+="%s",xe=xe.concat([ut]));var At=xe.map(function(Ze){return String(Ze)});At.unshift("Warning: "+Ee),Function.prototype.apply.call(console[Y],console,At)}}var E=!1,C=!1,I=!1,T=!1,P=!1,N;N=Symbol.for("react.module.reference");function L(Y){return!!(typeof Y=="string"||typeof Y=="function"||Y===r||Y===i||P||Y===o||Y===u||Y===d||T||Y===p||E||C||I||typeof Y=="object"&&Y!==null&&(Y.$$typeof===f||Y.$$typeof===h||Y.$$typeof===a||Y.$$typeof===s||Y.$$typeof===c||Y.$$typeof===N||Y.getModuleId!==void 0))}function V(Y,Ee,xe){var Ne=Y.displayName;if(Ne)return Ne;var ut=Ee.displayName||Ee.name||"";return ut!==""?xe+"("+ut+")":xe}function j(Y){return Y.displayName||"Context"}function W(Y){if(Y==null)return null;if(typeof Y.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof Y=="function")return Y.displayName||Y.name||null;if(typeof Y=="string")return Y;switch(Y){case r:return"Fragment";case n:return"Portal";case i:return"Profiler";case o:return"StrictMode";case u:return"Suspense";case d:return"SuspenseList"}if(typeof Y=="object")switch(Y.$$typeof){case s:var Ee=Y;return j(Ee)+".Consumer";case a:var xe=Y;return j(xe._context)+".Provider";case c:return V(Y,Y.render,"ForwardRef");case h:var Ne=Y.displayName||null;return Ne!==null?Ne:W(Y.type)||"Memo";case f:{var ut=Y,At=ut._payload,Ze=ut._init;try{return W(Ze(At))}catch{return null}}}return null}var q=Object.assign,k=0,U,z,te,oe,ne,se,we;function le(){}le.__reactDisabledLog=!0;function _e(){{if(k===0){U=console.log,z=console.info,te=console.warn,oe=console.error,ne=console.group,se=console.groupCollapsed,we=console.groupEnd;var Y={configurable:!0,enumerable:!0,value:le,writable:!0};Object.defineProperties(console,{info:Y,log:Y,warn:Y,error:Y,group:Y,groupCollapsed:Y,groupEnd:Y})}k++}}function ve(){{if(k--,k===0){var Y={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:q({},Y,{value:U}),info:q({},Y,{value:z}),warn:q({},Y,{value:te}),error:q({},Y,{value:oe}),group:q({},Y,{value:ne}),groupCollapsed:q({},Y,{value:se}),groupEnd:q({},Y,{value:we})})}k<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var H=y.ReactCurrentDispatcher,$;function J(Y,Ee,xe){{if($===void 0)try{throw Error()}catch(ut){var Ne=ut.stack.trim().match(/\n( *(at )?)/);$=Ne&&Ne[1]||""}return`
18
+ `+$+Y}}var S=!1,M;{var F=typeof WeakMap=="function"?WeakMap:Map;M=new F}function B(Y,Ee){if(!Y||S)return"";{var xe=M.get(Y);if(xe!==void 0)return xe}var Ne;S=!0;var ut=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var At;At=H.current,H.current=null,_e();try{if(Ee){var Ze=function(){throw Error()};if(Object.defineProperty(Ze.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ze,[])}catch(Jt){Ne=Jt}Reflect.construct(Y,[],Ze)}else{try{Ze.call()}catch(Jt){Ne=Jt}Y.call(Ze.prototype)}}else{try{throw Error()}catch(Jt){Ne=Jt}Y()}}catch(Jt){if(Jt&&Ne&&typeof Jt.stack=="string"){for(var Xe=Jt.stack.split(`
19
19
  `),yn=Ne.stack.split(`
20
20
  `),Ft=Xe.length-1,Gt=yn.length-1;Ft>=1&&Gt>=0&&Xe[Ft]!==yn[Gt];)Gt--;for(;Ft>=1&&Gt>=0;Ft--,Gt--)if(Xe[Ft]!==yn[Gt]){if(Ft!==1||Gt!==1)do if(Ft--,Gt--,Gt<0||Xe[Ft]!==yn[Gt]){var Xn=`
21
- `+Xe[Ft].replace(" at new "," at ");return Y.displayName&&Xn.includes("<anonymous>")&&(Xn=Xn.replace("<anonymous>",Y.displayName)),typeof Y=="function"&&M.set(Y,Xn),Xn}while(Ft>=1&&Gt>=0);break}}}finally{S=!1,H.current=At,ve(),Error.prepareStackTrace=ut}var kr=Y?Y.displayName||Y.name:"",so=kr?J(kr):"";return typeof Y=="function"&&M.set(Y,so),so}function Q(Y,Ee,xe){return B(Y,!1)}function Z(Y){var Ee=Y.prototype;return!!(Ee&&Ee.isReactComponent)}function ee(Y,Ee,xe){if(Y==null)return"";if(typeof Y=="function")return B(Y,Z(Y));if(typeof Y=="string")return J(Y);switch(Y){case u:return J("Suspense");case d:return J("SuspenseList")}if(typeof Y=="object")switch(Y.$$typeof){case c:return Q(Y.render);case h:return ee(Y.type,Ee,xe);case f:{var Ne=Y,ut=Ne._payload,At=Ne._init;try{return ee(At(ut),Ee,xe)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,ge={},be=y.ReactDebugCurrentFrame;function pe(Y){if(Y){var Ee=Y._owner,xe=ee(Y.type,Y._source,Ee?Ee.type:null);be.setExtraStackFrame(xe)}else be.setExtraStackFrame(null)}function fe(Y,Ee,xe,Ne,ut){{var At=Function.call.bind(K);for(var Je in Y)if(At(Y,Je)){var Xe=void 0;try{if(typeof Y[Je]!="function"){var yn=Error((Ne||"React class")+": "+xe+" type `"+Je+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof Y[Je]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw yn.name="Invariant Violation",yn}Xe=Y[Je](Ee,Je,Ne,xe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ft){Xe=Ft}Xe&&!(Xe instanceof Error)&&(pe(ut),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ne||"React class",xe,Je,typeof Xe),pe(null)),Xe instanceof Error&&!(Xe.message in ge)&&(ge[Xe.message]=!0,pe(ut),w("Failed %s type: %s",xe,Xe.message),pe(null))}}}var ye=Array.isArray;function ue(Y){return ye(Y)}function Oe(Y){{var Ee=typeof Symbol=="function"&&Symbol.toStringTag,xe=Ee&&Y[Symbol.toStringTag]||Y.constructor.name||"Object";return xe}}function ke(Y){try{return at(Y),!1}catch{return!0}}function at(Y){return""+Y}function ze(Y){if(ke(Y))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Oe(Y)),at(Y)}var It=y.ReactCurrentOwner,ht={key:!0,ref:!0,__self:!0,__source:!0},wr,pt,mn;mn={};function Ot(Y){if(K.call(Y,"ref")){var Ee=Object.getOwnPropertyDescriptor(Y,"ref").get;if(Ee&&Ee.isReactWarning)return!1}return Y.ref!==void 0}function De(Y){if(K.call(Y,"key")){var Ee=Object.getOwnPropertyDescriptor(Y,"key").get;if(Ee&&Ee.isReactWarning)return!1}return Y.key!==void 0}function Pr(Y,Ee){if(typeof Y.ref=="string"&&It.current&&Ee&&It.current.stateNode!==Ee){var xe=W(It.current.type);mn[xe]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(It.current.type),Y.ref),mn[xe]=!0)}}function ln(Y,Ee){{var xe=function(){wr||(wr=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ee))};xe.isReactWarning=!0,Object.defineProperty(Y,"key",{get:xe,configurable:!0})}}function Rn(Y,Ee){{var xe=function(){pt||(pt=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ee))};xe.isReactWarning=!0,Object.defineProperty(Y,"ref",{get:xe,configurable:!0})}}var Dn=function(Y,Ee,xe,Ne,ut,At,Je){var Xe={$$typeof:e,type:Y,key:Ee,ref:xe,props:Je,_owner:At};return Xe._store={},Object.defineProperty(Xe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Xe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ne}),Object.defineProperty(Xe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ut}),Object.freeze&&(Object.freeze(Xe.props),Object.freeze(Xe)),Xe};function Gr(Y,Ee,xe,Ne,ut){{var At,Je={},Xe=null,yn=null;xe!==void 0&&(ze(xe),Xe=""+xe),De(Ee)&&(ze(Ee.key),Xe=""+Ee.key),Ot(Ee)&&(yn=Ee.ref,Pr(Ee,ut));for(At in Ee)K.call(Ee,At)&&!ht.hasOwnProperty(At)&&(Je[At]=Ee[At]);if(Y&&Y.defaultProps){var Ft=Y.defaultProps;for(At in Ft)Je[At]===void 0&&(Je[At]=Ft[At])}if(Xe||yn){var Gt=typeof Y=="function"?Y.displayName||Y.name||"Unknown":Y;Xe&&ln(Je,Gt),yn&&Rn(Je,Gt)}return Dn(Y,Xe,yn,ut,Ne,It.current,Je)}}var An=y.ReactCurrentOwner,Mn=y.ReactDebugCurrentFrame;function dn(Y){if(Y){var Ee=Y._owner,xe=ee(Y.type,Y._source,Ee?Ee.type:null);Mn.setExtraStackFrame(xe)}else Mn.setExtraStackFrame(null)}var Xt;Xt=!1;function zn(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function qr(){{if(An.current){var Y=W(An.current.type);if(Y)return`
21
+ `+Xe[Ft].replace(" at new "," at ");return Y.displayName&&Xn.includes("<anonymous>")&&(Xn=Xn.replace("<anonymous>",Y.displayName)),typeof Y=="function"&&M.set(Y,Xn),Xn}while(Ft>=1&&Gt>=0);break}}}finally{S=!1,H.current=At,ve(),Error.prepareStackTrace=ut}var kr=Y?Y.displayName||Y.name:"",so=kr?J(kr):"";return typeof Y=="function"&&M.set(Y,so),so}function Q(Y,Ee,xe){return B(Y,!1)}function Z(Y){var Ee=Y.prototype;return!!(Ee&&Ee.isReactComponent)}function ee(Y,Ee,xe){if(Y==null)return"";if(typeof Y=="function")return B(Y,Z(Y));if(typeof Y=="string")return J(Y);switch(Y){case u:return J("Suspense");case d:return J("SuspenseList")}if(typeof Y=="object")switch(Y.$$typeof){case c:return Q(Y.render);case h:return ee(Y.type,Ee,xe);case f:{var Ne=Y,ut=Ne._payload,At=Ne._init;try{return ee(At(ut),Ee,xe)}catch{}}}return""}var K=Object.prototype.hasOwnProperty,ge={},be=y.ReactDebugCurrentFrame;function pe(Y){if(Y){var Ee=Y._owner,xe=ee(Y.type,Y._source,Ee?Ee.type:null);be.setExtraStackFrame(xe)}else be.setExtraStackFrame(null)}function fe(Y,Ee,xe,Ne,ut){{var At=Function.call.bind(K);for(var Ze in Y)if(At(Y,Ze)){var Xe=void 0;try{if(typeof Y[Ze]!="function"){var yn=Error((Ne||"React class")+": "+xe+" type `"+Ze+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof Y[Ze]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw yn.name="Invariant Violation",yn}Xe=Y[Ze](Ee,Ze,Ne,xe,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(Ft){Xe=Ft}Xe&&!(Xe instanceof Error)&&(pe(ut),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",Ne||"React class",xe,Ze,typeof Xe),pe(null)),Xe instanceof Error&&!(Xe.message in ge)&&(ge[Xe.message]=!0,pe(ut),w("Failed %s type: %s",xe,Xe.message),pe(null))}}}var ye=Array.isArray;function ue(Y){return ye(Y)}function Oe(Y){{var Ee=typeof Symbol=="function"&&Symbol.toStringTag,xe=Ee&&Y[Symbol.toStringTag]||Y.constructor.name||"Object";return xe}}function ke(Y){try{return at(Y),!1}catch{return!0}}function at(Y){return""+Y}function ze(Y){if(ke(Y))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Oe(Y)),at(Y)}var It=y.ReactCurrentOwner,ht={key:!0,ref:!0,__self:!0,__source:!0},wr,pt,mn;mn={};function Ot(Y){if(K.call(Y,"ref")){var Ee=Object.getOwnPropertyDescriptor(Y,"ref").get;if(Ee&&Ee.isReactWarning)return!1}return Y.ref!==void 0}function De(Y){if(K.call(Y,"key")){var Ee=Object.getOwnPropertyDescriptor(Y,"key").get;if(Ee&&Ee.isReactWarning)return!1}return Y.key!==void 0}function Pr(Y,Ee){if(typeof Y.ref=="string"&&It.current&&Ee&&It.current.stateNode!==Ee){var xe=W(It.current.type);mn[xe]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',W(It.current.type),Y.ref),mn[xe]=!0)}}function ln(Y,Ee){{var xe=function(){wr||(wr=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ee))};xe.isReactWarning=!0,Object.defineProperty(Y,"key",{get:xe,configurable:!0})}}function Rn(Y,Ee){{var xe=function(){pt||(pt=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",Ee))};xe.isReactWarning=!0,Object.defineProperty(Y,"ref",{get:xe,configurable:!0})}}var Dn=function(Y,Ee,xe,Ne,ut,At,Ze){var Xe={$$typeof:e,type:Y,key:Ee,ref:xe,props:Ze,_owner:At};return Xe._store={},Object.defineProperty(Xe._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(Xe,"_self",{configurable:!1,enumerable:!1,writable:!1,value:Ne}),Object.defineProperty(Xe,"_source",{configurable:!1,enumerable:!1,writable:!1,value:ut}),Object.freeze&&(Object.freeze(Xe.props),Object.freeze(Xe)),Xe};function Gr(Y,Ee,xe,Ne,ut){{var At,Ze={},Xe=null,yn=null;xe!==void 0&&(ze(xe),Xe=""+xe),De(Ee)&&(ze(Ee.key),Xe=""+Ee.key),Ot(Ee)&&(yn=Ee.ref,Pr(Ee,ut));for(At in Ee)K.call(Ee,At)&&!ht.hasOwnProperty(At)&&(Ze[At]=Ee[At]);if(Y&&Y.defaultProps){var Ft=Y.defaultProps;for(At in Ft)Ze[At]===void 0&&(Ze[At]=Ft[At])}if(Xe||yn){var Gt=typeof Y=="function"?Y.displayName||Y.name||"Unknown":Y;Xe&&ln(Ze,Gt),yn&&Rn(Ze,Gt)}return Dn(Y,Xe,yn,ut,Ne,It.current,Ze)}}var An=y.ReactCurrentOwner,Mn=y.ReactDebugCurrentFrame;function dn(Y){if(Y){var Ee=Y._owner,xe=ee(Y.type,Y._source,Ee?Ee.type:null);Mn.setExtraStackFrame(xe)}else Mn.setExtraStackFrame(null)}var Xt;Xt=!1;function zn(Y){return typeof Y=="object"&&Y!==null&&Y.$$typeof===e}function qr(){{if(An.current){var Y=W(An.current.type);if(Y)return`
22
22
 
23
23
  Check the render method of \``+Y+"`."}return""}}function Me(Y){return""}var Ge={};function qe(Y){{var Ee=qr();if(!Ee){var xe=typeof Y=="string"?Y:Y.displayName||Y.name;xe&&(Ee=`
24
24
 
25
- Check the top-level render call using <`+xe+">.")}return Ee}}function st(Y,Ee){{if(!Y._store||Y._store.validated||Y.key!=null)return;Y._store.validated=!0;var xe=qe(Ee);if(Ge[xe])return;Ge[xe]=!0;var Ne="";Y&&Y._owner&&Y._owner!==An.current&&(Ne=" It was passed a child from "+W(Y._owner.type)+"."),dn(Y),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',xe,Ne),dn(null)}}function Lt(Y,Ee){{if(typeof Y!="object")return;if(ue(Y))for(var xe=0;xe<Y.length;xe++){var Ne=Y[xe];zn(Ne)&&st(Ne,Ee)}else if(zn(Y))Y._store&&(Y._store.validated=!0);else if(Y){var ut=m(Y);if(typeof ut=="function"&&ut!==Y.entries)for(var At=ut.call(Y),Je;!(Je=At.next()).done;)zn(Je.value)&&st(Je.value,Ee)}}}function ca(Y){{var Ee=Y.type;if(Ee==null||typeof Ee=="string")return;var xe;if(typeof Ee=="function")xe=Ee.propTypes;else if(typeof Ee=="object"&&(Ee.$$typeof===c||Ee.$$typeof===h))xe=Ee.propTypes;else return;if(xe){var Ne=W(Ee);fe(xe,Y.props,"prop",Ne,Y)}else if(Ee.PropTypes!==void 0&&!Xt){Xt=!0;var ut=W(Ee);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ut||"Unknown")}typeof Ee.getDefaultProps=="function"&&!Ee.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mi(Y){{for(var Ee=Object.keys(Y.props),xe=0;xe<Ee.length;xe++){var Ne=Ee[xe];if(Ne!=="children"&&Ne!=="key"){dn(Y),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ne),dn(null);break}}Y.ref!==null&&(dn(Y),w("Invalid attribute `ref` supplied to `React.Fragment`."),dn(null))}}var Qt={};function ao(Y,Ee,xe,Ne,ut,At){{var Je=L(Y);if(!Je){var Xe="";(Y===void 0||typeof Y=="object"&&Y!==null&&Object.keys(Y).length===0)&&(Xe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var yn=Me();yn?Xe+=yn:Xe+=qr();var Ft;Y===null?Ft="null":ue(Y)?Ft="array":Y!==void 0&&Y.$$typeof===e?(Ft="<"+(W(Y.type)||"Unknown")+" />",Xe=" Did you accidentally export a JSX literal instead of a component?"):Ft=typeof Y,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ft,Xe)}var Gt=Gr(Y,Ee,xe,ut,At);if(Gt==null)return Gt;if(Je){var Xn=Ee.children;if(Xn!==void 0)if(Ne)if(ue(Xn)){for(var kr=0;kr<Xn.length;kr++)Lt(Xn[kr],Y);Object.freeze&&Object.freeze(Xn)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Lt(Xn,Y)}if(K.call(Ee,"key")){var so=W(Y),Jt=Object.keys(Ee).filter(function(xu){return xu!=="key"}),Vo=Jt.length>0?"{key: someKey, "+Jt.join(": ..., ")+": ...}":"{key: someKey}";if(!Qt[so+Vo]){var Wf=Jt.length>0?"{"+Jt.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+xe+">.")}return Ee}}function st(Y,Ee){{if(!Y._store||Y._store.validated||Y.key!=null)return;Y._store.validated=!0;var xe=qe(Ee);if(Ge[xe])return;Ge[xe]=!0;var Ne="";Y&&Y._owner&&Y._owner!==An.current&&(Ne=" It was passed a child from "+W(Y._owner.type)+"."),dn(Y),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',xe,Ne),dn(null)}}function Lt(Y,Ee){{if(typeof Y!="object")return;if(ue(Y))for(var xe=0;xe<Y.length;xe++){var Ne=Y[xe];zn(Ne)&&st(Ne,Ee)}else if(zn(Y))Y._store&&(Y._store.validated=!0);else if(Y){var ut=m(Y);if(typeof ut=="function"&&ut!==Y.entries)for(var At=ut.call(Y),Ze;!(Ze=At.next()).done;)zn(Ze.value)&&st(Ze.value,Ee)}}}function ca(Y){{var Ee=Y.type;if(Ee==null||typeof Ee=="string")return;var xe;if(typeof Ee=="function")xe=Ee.propTypes;else if(typeof Ee=="object"&&(Ee.$$typeof===c||Ee.$$typeof===h))xe=Ee.propTypes;else return;if(xe){var Ne=W(Ee);fe(xe,Y.props,"prop",Ne,Y)}else if(Ee.PropTypes!==void 0&&!Xt){Xt=!0;var ut=W(Ee);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",ut||"Unknown")}typeof Ee.getDefaultProps=="function"&&!Ee.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mi(Y){{for(var Ee=Object.keys(Y.props),xe=0;xe<Ee.length;xe++){var Ne=Ee[xe];if(Ne!=="children"&&Ne!=="key"){dn(Y),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",Ne),dn(null);break}}Y.ref!==null&&(dn(Y),w("Invalid attribute `ref` supplied to `React.Fragment`."),dn(null))}}var Qt={};function ao(Y,Ee,xe,Ne,ut,At){{var Ze=L(Y);if(!Ze){var Xe="";(Y===void 0||typeof Y=="object"&&Y!==null&&Object.keys(Y).length===0)&&(Xe+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var yn=Me();yn?Xe+=yn:Xe+=qr();var Ft;Y===null?Ft="null":ue(Y)?Ft="array":Y!==void 0&&Y.$$typeof===e?(Ft="<"+(W(Y.type)||"Unknown")+" />",Xe=" Did you accidentally export a JSX literal instead of a component?"):Ft=typeof Y,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",Ft,Xe)}var Gt=Gr(Y,Ee,xe,ut,At);if(Gt==null)return Gt;if(Ze){var Xn=Ee.children;if(Xn!==void 0)if(Ne)if(ue(Xn)){for(var kr=0;kr<Xn.length;kr++)Lt(Xn[kr],Y);Object.freeze&&Object.freeze(Xn)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Lt(Xn,Y)}if(K.call(Ee,"key")){var so=W(Y),Jt=Object.keys(Ee).filter(function(xu){return xu!=="key"}),Vo=Jt.length>0?"{key: someKey, "+Jt.join(": ..., ")+": ...}":"{key: someKey}";if(!Qt[so+Vo]){var Wf=Jt.length>0?"{"+Jt.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
@@ -81,7 +81,7 @@ React keys must be passed directly to JSX without using spread:
81
81
  * LICENSE.md file in the root directory of this source tree.
82
82
  *
83
83
  * @license MIT
84
- */function xi(){return xi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xi.apply(this,arguments)}function Nl(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}const rc="get",oc="application/x-www-form-urlencoded";function ic(t){return t!=null&&typeof t.tagName=="string"}function K3(t){return ic(t)&&t.tagName.toLowerCase()==="button"}function z3(t){return ic(t)&&t.tagName.toLowerCase()==="form"}function X3(t){return ic(t)&&t.tagName.toLowerCase()==="input"}function Q3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function J3(t,e){return t.button===0&&(!e||e==="_self")&&!Q3(t)}let ac=null;function Z3(){if(ac===null)try{new FormData(document.createElement("form"),0),ac=!1}catch{ac=!0}return ac}const eb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rl(t){return t!=null&&!eb.has(t)?(process.env.NODE_ENV!=="production"&&ur(!1,'"'+t+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):t}function tb(t,e){let n,r,o,i,a;if(z3(t)){let s=t.getAttribute("action");r=s?wo(s,e):null,n=t.getAttribute("method")||rc,o=Rl(t.getAttribute("enctype"))||oc,i=new FormData(t)}else if(K3(t)||X3(t)&&(t.type==="submit"||t.type==="image")){let s=t.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||s.getAttribute("action");if(r=c?wo(c,e):null,n=t.getAttribute("formmethod")||s.getAttribute("method")||rc,o=Rl(t.getAttribute("formenctype"))||Rl(s.getAttribute("enctype"))||oc,i=new FormData(s,t),!Z3()){let{name:u,type:d,value:h}=t;if(d==="image"){let f=u?u+".":"";i.append(f+"x","0"),i.append(f+"y","0")}else u&&i.append(u,h)}}else{if(ic(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=rc,r=null,o=oc,a=t}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}const nb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],rb=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ob=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],ib="6";try{window.__reactRouterVersion=ib}catch{}const K1=ce.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(K1.displayName="ViewTransition");const ab=ce.createContext(new Map);process.env.NODE_ENV!=="production"&&(ab.displayName="Fetchers"),process.env.NODE_ENV;const sb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z1=ce.forwardRef(function(e,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=Nl(e,nb),{basename:p}=ce.useContext(lr),l,g=!1;if(typeof u=="string"&&cb.test(u)&&(l=u,sb))try{let b=new URL(window.location.href),E=u.startsWith("//")?new URL(b.protocol+u):new URL(u),C=wo(E.pathname,p);E.origin===b.origin&&C!=null?u=C+E.search+E.hash:g=!0}catch{process.env.NODE_ENV!=="production"&&ur(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let m=P3(u,{relative:o}),y=db(u,{replace:a,state:s,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});function w(b){r&&r(b),b.defaultPrevented||y(b)}return ce.createElement("a",xi({},f,{href:l||m,onClick:g||i?r:w,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(z1.displayName="Link");const X1=ce.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:c,unstable_viewTransition:u,children:d}=e,h=Nl(e,rb),f=Ta(c,{relative:h.relative}),p=er(),l=ce.useContext(Ol),{navigator:g,basename:m}=ce.useContext(lr),y=l!=null&&yb(f)&&u===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=l&&l.navigation&&l.navigation.location?l.navigation.location.pathname:null;o||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&m&&(E=wo(E,m)||E);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let I=b===w||!a&&b.startsWith(w)&&b.charAt(C)==="/",T=E!=null&&(E===w||!a&&E.startsWith(w)&&E.charAt(w.length)==="/"),P={isActive:I,isPending:T,isTransitioning:y},N=I?r:void 0,L;typeof i=="function"?L=i(P):L=[i,I?"active":null,T?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let V=typeof s=="function"?s(P):s;return ce.createElement(z1,xi({},h,{"aria-current":N,className:L,ref:n,style:V,to:c,unstable_viewTransition:u}),typeof d=="function"?d(P):d)});process.env.NODE_ENV!=="production"&&(X1.displayName="NavLink");const ub=ce.forwardRef((t,e)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:i,state:a,method:s=rc,action:c,onSubmit:u,relative:d,preventScrollReset:h,unstable_viewTransition:f}=t,p=Nl(t,ob),l=gb(),g=mb(c,{relative:d}),m=s.toLowerCase()==="get"?"get":"post",y=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let b=w.nativeEvent.submitter,E=(b==null?void 0:b.getAttribute("formmethod"))||s;l(b||w.currentTarget,{fetcherKey:n,method:E,navigate:r,replace:i,state:a,relative:d,preventScrollReset:h,unstable_viewTransition:f})};return ce.createElement("form",xi({ref:e,method:m,action:g,onSubmit:o?u:y},p))});process.env.NODE_ENV!=="production"&&(ub.displayName="Form"),process.env.NODE_ENV;var sc;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sc||(sc={}));var Q1;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Q1||(Q1={}));function lb(t){return t+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function J1(t){let e=ce.useContext(Ia);return e||(process.env.NODE_ENV!=="production"?We(!1,lb(t)):We(!1)),e}function db(t,e){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s}=e===void 0?{}:e,c=zt(),u=er(),d=Ta(t,{relative:a});return ce.useCallback(h=>{if(J3(h,n)){h.preventDefault();let f=r!==void 0?r:tc(u)===tc(d);c(t,{replace:f,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s})}},[u,c,d,r,o,n,t,i,a,s])}function fb(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let hb=0,pb=()=>"__"+String(++hb)+"__";function gb(){let{router:t}=J1(sc.UseSubmit),{basename:e}=ce.useContext(lr),n=q3();return ce.useCallback(function(r,o){o===void 0&&(o={}),fb();let{action:i,method:a,encType:s,formData:c,body:u}=tb(r,e);if(o.navigate===!1){let d=o.fetcherKey||pb();t.fetch(d,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,unstable_flushSync:o.unstable_flushSync})}else t.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[t,e,n])}function mb(t,e){let{relative:n}=e===void 0?{}:e,{basename:r}=ce.useContext(lr),o=ce.useContext(Ar);o||(process.env.NODE_ENV!=="production"?We(!1,"useFormAction must be used inside a RouteContext"):We(!1));let[i]=o.matches.slice(-1),a=xi({},Ta(t||".",{relative:n})),s=er();if(t==null){a.search=s.search;let c=new URLSearchParams(a.search);c.has("index")&&c.get("index")===""&&(c.delete("index"),a.search=c.toString()?"?"+c.toString():"")}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:$r([r,a.pathname])),tc(a)}function yb(t,e){e===void 0&&(e={});let n=ce.useContext(K1);n==null&&(process.env.NODE_ENV!=="production"?We(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):We(!1));let{basename:r}=J1(sc.useViewTransitionState),o=Ta(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=wo(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Sl(o.pathname,a)!=null||Sl(o.pathname,i)!=null}function vb(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,r=parseInt(t.slice(5,7),16)/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=o-i,s=(o+i)/2;let c=0;a!==0&&(c=a/(1-Math.abs(2*s-1)));let u=0;return a!==0&&(o===e?u=((n-r)/a+(n<r?6:0))*60:o===n?u=((r-e)/a+2)*60:u=((e-n)/a+4)*60),{hue:u,saturation:c,lightness:s}}function cc(t,e,n){const r=(1-Math.abs(2*n-1))*e,o=r*(1-Math.abs(t/60%2-1)),i=n-r/2;let a=0,s=0,c=0;return t<60?(a=r,s=o,c=0):t<120?(a=o,s=r,c=0):t<180?(a=0,s=r,c=o):t<240?(a=0,s=o,c=r):t<300?(a=o,s=0,c=r):(a=r,s=0,c=o),a=Math.round((a+i)*255),s=Math.round((s+i)*255),c=Math.round((c+i)*255),`#${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function Z1(t){const{hue:e,saturation:n,lightness:r}=vb(t),o=.04,i=[{key:"50",min:97,max:99},{key:"100",min:92,max:96},{key:"200",min:85,max:91},{key:"300",min:74,max:84},{key:"400",min:58,max:73},{key:"500",min:51,max:61},{key:"600",min:36,max:50},{key:"700",min:29,max:40},{key:"800",min:24,max:33},{key:"900",min:20,max:28},{key:"950",min:0,max:19}],a={},s={},c={},u={};i.forEach(d=>{const h=(d.min+d.max)/2/100;a[d.key]=cc(e,n,h),c[d.key]=cc(0,n,h),u[d.key]=cc(120,n,h),s[d.key]=cc(e,o,h)});for(const d of i)if(r*100>=d.min&&r*100<=d.max){a[d.key]=t;break}return{primaryPalette:a,redPalette:c,greenPalette:u,grayPalette:s}}const wb=t=>{const e={primary:t.primary_color,secondary:t.secondary_color,tertiary:t.tertiary_color,quaternary:t.quaternary_color},n=document.querySelector(":root");for(const r in e)if(e[r]){const{primaryPalette:o}=Z1(e[r]);for(const i in o)n.style.setProperty(`--${r}-${i}`,o[i])}if(e.primary){const{grayPalette:r,redPalette:o,greenPalette:i}=Z1(e.primary);for(const a in r)n.style.setProperty(`--gray-${a}`,r[a]);for(const a in o)n.style.setProperty(`--red-${a}`,o[a]);for(const a in i)n.style.setProperty(`--green-${a}`,i[a])}};function bo({value:t,start:e=0,duration:n=1e3,currency:r="EUR",asCurrency:o=!1}){const[i,a]=x.useState(e),s=()=>{const c=e>t?e-t:t-e;return c<=1e3?1:c/1e3};return x.useEffect(()=>{const c=setInterval(()=>{e>t?a(u=>Math.max(u-s(),t)):a(u=>Math.min(u+s(),t)),i===t&&clearInterval(c)},n/t);return()=>clearInterval(c)},[i,n,e,t]),v.jsx("div",{"data-testid":"animated-counter",children:o?Si(i,r):i})}const bb=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((o,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Eb=({svgComponent:t,...e})=>v.jsx(t,{...e});function ep(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=ep(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Cb(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=ep(t))&&(r&&(r+=" "),r+=e);return r}const tp=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,np=Cb,Oi=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return np(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,a=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const f=tp(d)||tp(h);return o[u][f]}),s=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(l=>{let[g,m]=l;return Array.isArray(m)?m.includes({...i,...s}[g]):{...i,...s}[g]===m})?[...u,h,f]:u},[]);return np(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},_b=Oi("aspect-square",{variants:{size:{"2xs":"h-3 w-3",xs:"h-4 w-4",sm:"h-5 w-5",md:"h-6 w-6",lg:"h-7 w-7",xl:"h-8 w-8","2xl":"h-10 w-10"},variant:{primary:"fill-none stroke-core-white-900 stroke-[1.5]",secondary:"fill-none stroke-core-gray-400 stroke-[1.5] active:stroke-core-gray-900 ",discovery:"fill-none stroke-core-primary-500 stroke-[1.5] ",destructive:"fill-none stroke-core-red-700 stroke-[1.5] ",placeholder:"fill-none stroke-core-gray-300 stroke-[1.5]"},outline:{true:[],false:[]}},compoundVariants:[{variant:"placeholder",outline:!1,class:"fill-core-gray-300 stroke-width-0"}],defaultVariants:{variant:"placeholder",size:"md"}}),vn=({icon:t="user",size:e="md",variant:n="placeholder",outline:r=!0})=>{if(x.isValidElement(t))return"span";const o=Ab(t);return o?v.jsx(Eb,{svgComponent:o,className:_b({variant:n,size:e,outline:r})}):null};function Ab(t){const[e,n]=x.useState(null),r=async()=>{try{const o=(await bb(Object.assign({"../../assets/svg/calendar.svg":()=>Promise.resolve().then(()=>Xx),"../../assets/svg/camera-switch.svg":()=>Promise.resolve().then(()=>Qx),"../../assets/svg/caret-left.svg":()=>Promise.resolve().then(()=>Jx),"../../assets/svg/close.svg":()=>Promise.resolve().then(()=>Zx),"../../assets/svg/crossBlack.svg":()=>Promise.resolve().then(()=>eO),"../../assets/svg/dollar.svg":()=>Promise.resolve().then(()=>tO),"../../assets/svg/edit.svg":()=>Promise.resolve().then(()=>nO),"../../assets/svg/home.svg":()=>Promise.resolve().then(()=>rO),"../../assets/svg/information.svg":()=>Promise.resolve().then(()=>oO),"../../assets/svg/mail.svg":()=>Promise.resolve().then(()=>iO),"../../assets/svg/notificationErrorV2.svg":()=>Promise.resolve().then(()=>aO),"../../assets/svg/notificationSuccessV2.svg":()=>Promise.resolve().then(()=>sO),"../../assets/svg/notificationWarningV2.svg":()=>Promise.resolve().then(()=>cO),"../../assets/svg/settings.svg":()=>Promise.resolve().then(()=>uO),"../../assets/svg/shopping-bag.svg":()=>Promise.resolve().then(()=>lO),"../../assets/svg/star.svg":()=>Promise.resolve().then(()=>dO),"../../assets/svg/user.svg":()=>Promise.resolve().then(()=>fO)}),`../../assets/svg/${t}.svg`,5)).default;n(()=>o)}catch(o){console.error(`Failed to import icon: ${t}`,o),n(null)}};return x.useEffect(()=>{r()},[t]),e}const Sb=Oi("bg-core-primary-500 text-core-white-900 relative inline-flex aspect-square shrink-0 items-center antialiased rounded-full overflow-hidden uppercase",{variants:{size:{xs:"h-6 w-6 text-xs ",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-14 w-14 text-xl","2xl":"h-16 w-16 text-2xl"}},defaultVariants:{size:"sm"}}),Ib=({src:t,alt:e})=>v.jsx("img",{src:t,alt:e,className:"bg-core-white-900 aspect-square w-full grow rounded-full object-cover object-center"}),Tb=({initials:t})=>v.jsx("div",{className:"h-full w-full content-center text-center",children:t}),Dl=({src:t,alt:e,initials:n,size:r})=>v.jsxs("div",{className:Sb({size:r}),children:[t&&v.jsx(Ib,{src:t,alt:e}),t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(vn,{icon:"user",variant:"placeholder",outline:!1,size:r})}),!t&&n&&v.jsx(Tb,{initials:n}),!t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(vn,{icon:"user",variant:"placeholder",outline:!1,size:r})})]});Dl.displayName="Avatar";const xb=Oi("inline-flex items-center rounded-lg px-2 py-1 antialiased",{variants:{color:{primary:"text-core-primary-700 outline-core-primary-200 bg-core-primary-50",gray:"text-core-gray-700 outline-core-gray-200 bg-core-gray-50"},size:{sm:"text-xs leading-4 ",md:"text-sm leading-5 "},stroke:{true:"outline outline-1",false:""}},defaultVariants:{color:"primary",size:"sm",stroke:!1}}),Ml=({label:t,color:e="primary",size:n="sm",stroke:r=!1})=>v.jsx("span",{className:xb({color:e,size:n,stroke:r}),children:t});Ml.displayName="Badge";function Ob({body:t}){return v.jsxs("div",{className:"flex gap-3 rounded-r-lg border-l-2 border-core-primary-500 bg-core-gray-50 p-4 text-sm",children:[v.jsx(vn,{icon:"information",variant:"discovery"}),v.jsx("div",{children:t})]})}const Pb=Oi("group inline-flex shrink-0 select-none items-center justify-center font-medium transition-colors duration-100 antialiased rounded-lg hover:shadow-none focus:outline-0 focus:outline-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",{variants:{size:{sm:"h-8 gap-1 px-2 py-1 text-xs leading-4",md:"h-10 gap-1 px-3 py-2 text-sm leading-5",lg:"h-12 gap-1 px-3 py-3 text-base leading-6"},variant:{primary:"bg-core-primary-500 text-core-white-900 outline-primary hover:bg-core-primary-600 disabled:bg-core-primary-disabled",secondary:"box-border border border-core-gray-200 bg-core-white-900 shadow-xs hover:bg-core-gray-50 disabled:opacity-30",destructive:"bg-core-red-500 text-core-white-900 hover:bg-core-red-600 focus:outline-core-red-500 disabled:bg-core-red-200","destructive-outline":"box-border border border-core-red-200 text-core-red-700 shadow-xs hover:bg-core-red-50 focus:outline-core-red-500 disabled:opacity-40","link-gray":"bg-transparent hover:bg-surface hover:underline underline-offset-2 disabled:opacity-30"}},compoundVariants:[{variant:"link-gray",size:["md","lg"],class:"px-0 py-0"}],defaultVariants:{variant:"primary",size:"md"}}),rp={primary:"primary",secondary:"secondary",destructive:"primary","destructive-outline":"destructive","link-gray":"secondary"},op={md:"sm",lg:"md"},rt=({after:t,before:e,className:n,label:r="button",variant:o="primary",size:i="md",pending:a=!1,disabled:s=!1,onClick:c,...u})=>{const d=f=>{var p;return Sn("group-hover:opacity-70 ",(p=f.props)==null?void 0:p.className)},h=f=>{var p;return((p=f.props)==null?void 0:p.icon)??"user"};return v.jsxs("button",{className:Sn(Pb({variant:o,size:i}),n),disabled:s||a,onClick:c,...u,children:[v.jsxs("span",{className:`flex items-center gap-1 ${a&&"opacity-0"}`,children:[e&&v.jsx(vn,{className:d(e),icon:h(e),variant:rp[o],size:op[i]}),v.jsx("span",{children:r}),t&&v.jsx(vn,{className:Sn(d(t),`${a&&"opacity-0"}`),icon:h(t),variant:rp[o],size:op[i]})]}),a&&v.jsx(Al,{className:"absolute"})]})};rt.displayName="Button";function Mt({children:t,id:e=x.useId()}){return v.jsx("div",{id:e,className:"flex h-full max-h-full flex-col bg-white md:h-fit md:rounded-lg md:border md:shadow-md",children:t})}function kt({children:t}){return v.jsx("div",{className:"grow overflow-y-auto px-6 py-4",children:t})}function nn({children:t}){return v.jsx("div",{className:"border-t px-6 py-4",children:t})}function Bt({children:t}){return v.jsx("div",{className:"border-b px-6",children:t})}const ip=({children:t,className:e,description:n,disabled:r,required:o=!1,tooltip:i,htmlFor:a})=>!t&&!i&&!n?null:v.jsx("label",{htmlFor:a,className:"inline-flex shrink-0 items-center gap-1 text-core-gray-800 antialiased ",children:v.jsxs("div",{className:Sn("inline-flex cursor-pointer items-center gap-1 text-sm font-medium leading-6",e,r&&"pointer-events-none text-core-gray-300"),children:[t?v.jsx("span",{className:Sn(r&&"pointer-events-none text-core-gray-300"),children:t}):null,n?v.jsx("span",{className:Sn("font-normal text-core-gray-500",r&&"text-current"),children:n}):null,o?v.jsx("span",{className:"font-normal text-core-red-500",children:"*"}):null]})}),ap=({helperText:t,error:e,disabled:n})=>t?v.jsx("span",{className:Sn("text-start text-sm leading-6 text-core-gray-500 antialiased ",e&&"text-core-red-500",n&&"text-core-gray-300"),children:t}):null;ip.displayName="Label",ap.displayName="HelperText";const Pn=Object.assign(ip,{Helper:ap}),kb=({id:t,defaultChecked:e=!1,disabled:n,onChange:r})=>{const o=n,[i,a]=x.useState(e),s=c=>{o||a(!i),r&&r(c.target.checked)};return v.jsx("div",{className:"flex h-6 w-6 items-center justify-center",children:v.jsx("input",{className:"h-4 w-4 rounded border border-core-gray-200 bg-core-white-900 text-core-primary-500 shadow-xs hover:border-core-gray-300 hover:shadow-none checked:bg-core-primary-500focus:outline-0 focus:ring-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border disabled:border-core-gray-200 disabled:bg-core-gray-50 disabled:shadow-none disabled:checked:bg-core-gray-200",id:t,type:"checkbox",checked:i,onChange:s,disabled:o})})},sp=x.createContext(null);function cp(t=!1){const e=x.useContext(sp);if(!e&&!t)throw new Error("Checkbox.Item must be used within a CheckboxGroup or CheckboxGroup.Root");return e}const up=x.forwardRef(({children:t,description:e,disabled:n,helperText:r,id:o,label:i,required:a,tooltip:s},c)=>{const u=x.useId(),d=o??u,h=i??e??s??r?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(Pn,{className:"cursor-default",description:e,required:a,tooltip:s,htmlFor:d,disabled:n,children:i}),v.jsx(Pn.Helper,{disabled:n,helperText:r})]}):null;return v.jsx(sp.Provider,{value:{disabled:n},children:v.jsxs("div",{ref:c,"aria-describedby":r?`${d}__describer`:void 0,"aria-labelledby":i?`${d}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[i??r??e??s?v.jsx("div",{className:"flex flex-col",children:h}):null,t?v.jsx("div",{className:Sn("flex flex-col gap-2"),children:t}):null]})})});up.displayName="CheckboxGroup",Object.assign(up,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=cp(),{disabled:o}=r??{};return v.jsx(Ll,{disabled:t??o,label:e,defaultChecked:n})}});const Ll=({id:t,children:e,defaultChecked:n=!1,description:r,disabled:o,helperText:i,label:a,required:s=!1,tooltip:c,onChange:u})=>{const d=x.useId(),h=t??d,f=!!cp(!0),p=a??r??c??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(Pn,{className:Sn(f&&"font-normal"),description:r,required:s,tooltip:c,htmlFor:h,disabled:o,children:a}),v.jsx(Pn.Helper,{disabled:o,helperText:i})]}):null;return v.jsxs("div",{className:"flex gap-3",children:[v.jsx(kb,{id:h,defaultChecked:n,disabled:o,onChange:u}),e||p]})};Ll.displayName="Checkbox";function Oa(){return{subscribe:(r,o)=>{document.addEventListener(r,o)},unsubscribe:(r,o)=>{document.removeEventListener(r,o)},publish:(r,o)=>{const i=new CustomEvent(r,{detail:o});document.dispatchEvent(i)}}}function lp(t,e){x.useEffect(()=>{const n=o=>{t.current&&!t.current.contains(o.target)&&e(!1)},r=o=>{o.key==="Escape"&&e(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",r)}},[])}const Bb=typeof window<"u"?x.useLayoutEffect:()=>{},Nb=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight],Rb=()=>{const[t,e]=x.useState(),n=x.useCallback(()=>{const r=Nb();e(o=>o&&o[0]===r[0]&&o[1]===r[1]?o:r)},[]);return Bb(n,[n]),x.useEffect(()=>{var o;const r=()=>{n(),setTimeout(n,1e3)};return window.addEventListener("resize",r),window.addEventListener("orientationchange",r),(o=window.visualViewport)==null||o.addEventListener("resize",r),()=>{var i;window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r),(i=window.visualViewport)==null||i.removeEventListener("resize",r)}},[n]),t};var dp={exports:{}};/*!
84
+ */function xi(){return xi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xi.apply(this,arguments)}function Nl(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}const rc="get",oc="application/x-www-form-urlencoded";function ic(t){return t!=null&&typeof t.tagName=="string"}function K3(t){return ic(t)&&t.tagName.toLowerCase()==="button"}function z3(t){return ic(t)&&t.tagName.toLowerCase()==="form"}function X3(t){return ic(t)&&t.tagName.toLowerCase()==="input"}function Q3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function J3(t,e){return t.button===0&&(!e||e==="_self")&&!Q3(t)}let ac=null;function Z3(){if(ac===null)try{new FormData(document.createElement("form"),0),ac=!1}catch{ac=!0}return ac}const eb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Rl(t){return t!=null&&!eb.has(t)?(process.env.NODE_ENV!=="production"&&ur(!1,'"'+t+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):t}function tb(t,e){let n,r,o,i,a;if(z3(t)){let s=t.getAttribute("action");r=s?wo(s,e):null,n=t.getAttribute("method")||rc,o=Rl(t.getAttribute("enctype"))||oc,i=new FormData(t)}else if(K3(t)||X3(t)&&(t.type==="submit"||t.type==="image")){let s=t.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||s.getAttribute("action");if(r=c?wo(c,e):null,n=t.getAttribute("formmethod")||s.getAttribute("method")||rc,o=Rl(t.getAttribute("formenctype"))||Rl(s.getAttribute("enctype"))||oc,i=new FormData(s,t),!Z3()){let{name:u,type:d,value:h}=t;if(d==="image"){let f=u?u+".":"";i.append(f+"x","0"),i.append(f+"y","0")}else u&&i.append(u,h)}}else{if(ic(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=rc,r=null,o=oc,a=t}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}const nb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],rb=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ob=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],ib="6";try{window.__reactRouterVersion=ib}catch{}const K1=ce.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(K1.displayName="ViewTransition");const ab=ce.createContext(new Map);process.env.NODE_ENV!=="production"&&(ab.displayName="Fetchers"),process.env.NODE_ENV;const sb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z1=ce.forwardRef(function(e,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=Nl(e,nb),{basename:p}=ce.useContext(lr),l,g=!1;if(typeof u=="string"&&cb.test(u)&&(l=u,sb))try{let b=new URL(window.location.href),E=u.startsWith("//")?new URL(b.protocol+u):new URL(u),C=wo(E.pathname,p);E.origin===b.origin&&C!=null?u=C+E.search+E.hash:g=!0}catch{process.env.NODE_ENV!=="production"&&ur(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let m=P3(u,{relative:o}),y=db(u,{replace:a,state:s,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});function w(b){r&&r(b),b.defaultPrevented||y(b)}return ce.createElement("a",xi({},f,{href:l||m,onClick:g||i?r:w,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(z1.displayName="Link");const X1=ce.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:c,unstable_viewTransition:u,children:d}=e,h=Nl(e,rb),f=Ta(c,{relative:h.relative}),p=er(),l=ce.useContext(Ol),{navigator:g,basename:m}=ce.useContext(lr),y=l!=null&&yb(f)&&u===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=l&&l.navigation&&l.navigation.location?l.navigation.location.pathname:null;o||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&m&&(E=wo(E,m)||E);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let I=b===w||!a&&b.startsWith(w)&&b.charAt(C)==="/",T=E!=null&&(E===w||!a&&E.startsWith(w)&&E.charAt(w.length)==="/"),P={isActive:I,isPending:T,isTransitioning:y},N=I?r:void 0,L;typeof i=="function"?L=i(P):L=[i,I?"active":null,T?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let V=typeof s=="function"?s(P):s;return ce.createElement(z1,xi({},h,{"aria-current":N,className:L,ref:n,style:V,to:c,unstable_viewTransition:u}),typeof d=="function"?d(P):d)});process.env.NODE_ENV!=="production"&&(X1.displayName="NavLink");const ub=ce.forwardRef((t,e)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:i,state:a,method:s=rc,action:c,onSubmit:u,relative:d,preventScrollReset:h,unstable_viewTransition:f}=t,p=Nl(t,ob),l=gb(),g=mb(c,{relative:d}),m=s.toLowerCase()==="get"?"get":"post",y=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let b=w.nativeEvent.submitter,E=(b==null?void 0:b.getAttribute("formmethod"))||s;l(b||w.currentTarget,{fetcherKey:n,method:E,navigate:r,replace:i,state:a,relative:d,preventScrollReset:h,unstable_viewTransition:f})};return ce.createElement("form",xi({ref:e,method:m,action:g,onSubmit:o?u:y},p))});process.env.NODE_ENV!=="production"&&(ub.displayName="Form"),process.env.NODE_ENV;var sc;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sc||(sc={}));var Q1;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Q1||(Q1={}));function lb(t){return t+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function J1(t){let e=ce.useContext(Ia);return e||(process.env.NODE_ENV!=="production"?We(!1,lb(t)):We(!1)),e}function db(t,e){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s}=e===void 0?{}:e,c=zt(),u=er(),d=Ta(t,{relative:a});return ce.useCallback(h=>{if(J3(h,n)){h.preventDefault();let f=r!==void 0?r:tc(u)===tc(d);c(t,{replace:f,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s})}},[u,c,d,r,o,n,t,i,a,s])}function fb(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let hb=0,pb=()=>"__"+String(++hb)+"__";function gb(){let{router:t}=J1(sc.UseSubmit),{basename:e}=ce.useContext(lr),n=q3();return ce.useCallback(function(r,o){o===void 0&&(o={}),fb();let{action:i,method:a,encType:s,formData:c,body:u}=tb(r,e);if(o.navigate===!1){let d=o.fetcherKey||pb();t.fetch(d,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,unstable_flushSync:o.unstable_flushSync})}else t.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[t,e,n])}function mb(t,e){let{relative:n}=e===void 0?{}:e,{basename:r}=ce.useContext(lr),o=ce.useContext(Ar);o||(process.env.NODE_ENV!=="production"?We(!1,"useFormAction must be used inside a RouteContext"):We(!1));let[i]=o.matches.slice(-1),a=xi({},Ta(t||".",{relative:n})),s=er();if(t==null){a.search=s.search;let c=new URLSearchParams(a.search);c.has("index")&&c.get("index")===""&&(c.delete("index"),a.search=c.toString()?"?"+c.toString():"")}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:$r([r,a.pathname])),tc(a)}function yb(t,e){e===void 0&&(e={});let n=ce.useContext(K1);n==null&&(process.env.NODE_ENV!=="production"?We(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):We(!1));let{basename:r}=J1(sc.useViewTransitionState),o=Ta(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=wo(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Sl(o.pathname,a)!=null||Sl(o.pathname,i)!=null}function vb(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,r=parseInt(t.slice(5,7),16)/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=o-i,s=(o+i)/2;let c=0;a!==0&&(c=a/(1-Math.abs(2*s-1)));let u=0;return a!==0&&(o===e?u=((n-r)/a+(n<r?6:0))*60:o===n?u=((r-e)/a+2)*60:u=((e-n)/a+4)*60),{hue:u,saturation:c,lightness:s}}function cc(t,e,n){const r=(1-Math.abs(2*n-1))*e,o=r*(1-Math.abs(t/60%2-1)),i=n-r/2;let a=0,s=0,c=0;return t<60?(a=r,s=o,c=0):t<120?(a=o,s=r,c=0):t<180?(a=0,s=r,c=o):t<240?(a=0,s=o,c=r):t<300?(a=o,s=0,c=r):(a=r,s=0,c=o),a=Math.round((a+i)*255),s=Math.round((s+i)*255),c=Math.round((c+i)*255),`#${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function Z1(t){const{hue:e,saturation:n,lightness:r}=vb(t),o=.04,i=[{key:"50",min:97,max:99},{key:"100",min:92,max:96},{key:"200",min:85,max:91},{key:"300",min:74,max:84},{key:"400",min:58,max:73},{key:"500",min:51,max:61},{key:"600",min:36,max:50},{key:"700",min:29,max:40},{key:"800",min:24,max:33},{key:"900",min:20,max:28},{key:"950",min:0,max:19}],a={},s={},c={},u={};i.forEach(d=>{const h=(d.min+d.max)/2/100;a[d.key]=cc(e,n,h),c[d.key]=cc(0,n,h),u[d.key]=cc(120,n,h),s[d.key]=cc(e,o,h)});for(const d of i)if(r*100>=d.min&&r*100<=d.max){a[d.key]=t;break}return{primaryPalette:a,redPalette:c,greenPalette:u,grayPalette:s}}const wb=t=>{const e={primary:t.primary_color,secondary:t.secondary_color,tertiary:t.tertiary_color,quaternary:t.quaternary_color},n=document.querySelector(":root");for(const r in e)if(e[r]){const{primaryPalette:o}=Z1(e[r]);for(const i in o)n.style.setProperty(`--${r}-${i}`,o[i])}if(e.primary){const{grayPalette:r,redPalette:o,greenPalette:i}=Z1(e.primary);for(const a in r)n.style.setProperty(`--gray-${a}`,r[a]);for(const a in o)n.style.setProperty(`--red-${a}`,o[a]);for(const a in i)n.style.setProperty(`--green-${a}`,i[a])}};function bo({value:t,start:e=0,duration:n=1e3,currency:r="EUR",asCurrency:o=!1}){const[i,a]=x.useState(e),s=()=>{const c=e>t?e-t:t-e;return c<=1e3?1:c/1e3};return x.useEffect(()=>{const c=setInterval(()=>{e>t?a(u=>Math.max(u-s(),t)):a(u=>Math.min(u+s(),t)),i===t&&clearInterval(c)},n/t);return()=>clearInterval(c)},[i,n,e,t]),v.jsx("div",{"data-testid":"animated-counter",children:o?Si(i,r):i})}const bb=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((o,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Eb=({svgComponent:t,...e})=>v.jsx(t,{...e});function ep(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=ep(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Cb(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=ep(t))&&(r&&(r+=" "),r+=e);return r}const tp=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,np=Cb,Oi=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return np(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,a=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const f=tp(d)||tp(h);return o[u][f]}),s=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(l=>{let[g,m]=l;return Array.isArray(m)?m.includes({...i,...s}[g]):{...i,...s}[g]===m})?[...u,h,f]:u},[]);return np(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},_b=Oi("aspect-square",{variants:{size:{"2xs":"h-3 w-3",xs:"h-4 w-4",sm:"h-5 w-5",md:"h-6 w-6",lg:"h-7 w-7",xl:"h-8 w-8","2xl":"h-10 w-10"},variant:{primary:"fill-none stroke-core-white-900 stroke-[1.5]",secondary:"fill-none stroke-core-gray-400 stroke-[1.5] active:stroke-core-gray-900 ",discovery:"fill-none stroke-core-primary-500 stroke-[1.5] ",destructive:"fill-none stroke-core-red-700 stroke-[1.5] ",placeholder:"fill-none stroke-core-gray-300 stroke-[1.5]"},outline:{true:[],false:[]}},compoundVariants:[{variant:"placeholder",outline:!1,class:"fill-core-gray-300 stroke-width-0"}],defaultVariants:{variant:"placeholder",size:"md"}}),vn=({icon:t="user",size:e="md",variant:n="placeholder",outline:r=!0})=>{if(x.isValidElement(t))return"span";const o=Ab(t);return o?v.jsx(Eb,{svgComponent:o,className:_b({variant:n,size:e,outline:r})}):null};function Ab(t){const[e,n]=x.useState(null),r=async()=>{try{const o=(await bb(Object.assign({"../../assets/svg/calendar.svg":()=>Promise.resolve().then(()=>Xx),"../../assets/svg/camera-switch.svg":()=>Promise.resolve().then(()=>Qx),"../../assets/svg/caret-left.svg":()=>Promise.resolve().then(()=>Jx),"../../assets/svg/close.svg":()=>Promise.resolve().then(()=>Zx),"../../assets/svg/crossBlack.svg":()=>Promise.resolve().then(()=>eO),"../../assets/svg/dollar.svg":()=>Promise.resolve().then(()=>tO),"../../assets/svg/edit.svg":()=>Promise.resolve().then(()=>nO),"../../assets/svg/home.svg":()=>Promise.resolve().then(()=>rO),"../../assets/svg/information.svg":()=>Promise.resolve().then(()=>oO),"../../assets/svg/mail.svg":()=>Promise.resolve().then(()=>iO),"../../assets/svg/notificationErrorV2.svg":()=>Promise.resolve().then(()=>aO),"../../assets/svg/notificationSuccessV2.svg":()=>Promise.resolve().then(()=>sO),"../../assets/svg/notificationWarningV2.svg":()=>Promise.resolve().then(()=>cO),"../../assets/svg/settings.svg":()=>Promise.resolve().then(()=>uO),"../../assets/svg/shopping-bag.svg":()=>Promise.resolve().then(()=>lO),"../../assets/svg/star.svg":()=>Promise.resolve().then(()=>dO),"../../assets/svg/user.svg":()=>Promise.resolve().then(()=>fO)}),`../../assets/svg/${t}.svg`,5)).default;n(()=>o)}catch(o){console.error(`Failed to import icon: ${t}`,o),n(null)}};return x.useEffect(()=>{r()},[t]),e}const Sb=Oi("bg-core-primary-500 text-core-white-900 relative inline-flex aspect-square shrink-0 items-center antialiased rounded-full overflow-hidden uppercase",{variants:{size:{xs:"h-6 w-6 text-xs ",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-14 w-14 text-xl","2xl":"h-16 w-16 text-2xl"}},defaultVariants:{size:"sm"}}),Ib=({src:t,alt:e})=>v.jsx("img",{src:t,alt:e,className:"bg-core-white-900 aspect-square w-full grow rounded-full object-cover object-center"}),Tb=({initials:t})=>v.jsx("div",{className:"h-full w-full content-center text-center",children:t}),Dl=({src:t,alt:e,initials:n,size:r})=>v.jsxs("div",{className:Sb({size:r}),children:[t&&v.jsx(Ib,{src:t,alt:e}),t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(vn,{icon:"user",variant:"placeholder",outline:!1,size:r})}),!t&&n&&v.jsx(Tb,{initials:n}),!t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(vn,{icon:"user",variant:"placeholder",outline:!1,size:r})})]});Dl.displayName="Avatar";const xb=Oi("inline-flex items-center rounded-lg px-2 py-1 antialiased",{variants:{color:{primary:"text-core-primary-700 outline-core-primary-200 bg-core-primary-50",gray:"text-core-gray-700 outline-core-gray-200 bg-core-gray-50"},size:{sm:"text-xs leading-4 ",md:"text-sm leading-5 "},stroke:{true:"outline outline-1",false:""}},defaultVariants:{color:"primary",size:"sm",stroke:!1}}),Ml=({label:t,color:e="primary",size:n="sm",stroke:r=!1})=>v.jsx("span",{className:xb({color:e,size:n,stroke:r}),children:t});Ml.displayName="Badge";function Ob({body:t}){return v.jsxs("div",{className:"flex gap-3 rounded-r-lg border-l-2 border-core-primary-500 bg-core-gray-50 p-4 text-sm",children:[v.jsx(vn,{icon:"information",variant:"discovery"}),v.jsx("div",{children:t})]})}const Pb=Oi("group inline-flex shrink-0 select-none items-center justify-center font-medium transition-colors duration-100 antialiased rounded-lg hover:shadow-none focus:outline-0 focus:outline-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",{variants:{size:{sm:"h-8 gap-1 px-2 py-1 text-xs leading-4",md:"h-10 gap-1 px-3 py-2 text-sm leading-5",lg:"h-12 gap-1 px-3 py-3 text-base leading-6"},variant:{primary:"bg-core-primary-500 text-core-white-900 outline-primary hover:bg-core-primary-600 disabled:bg-core-primary-disabled",secondary:"box-border border border-core-gray-200 bg-core-white-900 shadow-xs hover:bg-core-gray-50 disabled:opacity-30",destructive:"bg-core-red-500 text-core-white-900 hover:bg-core-red-600 focus:outline-core-red-500 disabled:bg-core-red-200","destructive-outline":"box-border border border-core-red-200 text-core-red-700 shadow-xs hover:bg-core-red-50 focus:outline-core-red-500 disabled:opacity-40","link-gray":"bg-transparent hover:bg-surface hover:underline underline-offset-2 disabled:opacity-30"}},compoundVariants:[{variant:"link-gray",size:["md","lg"],class:"px-0 py-0"}],defaultVariants:{variant:"primary",size:"md"}}),rp={primary:"primary",secondary:"secondary",destructive:"primary","destructive-outline":"destructive","link-gray":"secondary"},op={md:"sm",lg:"md"},Je=({after:t,before:e,className:n,label:r="button",variant:o="primary",size:i="md",pending:a=!1,disabled:s=!1,onClick:c,...u})=>{const d=f=>{var p;return Sn("group-hover:opacity-70 ",(p=f.props)==null?void 0:p.className)},h=f=>{var p;return((p=f.props)==null?void 0:p.icon)??"user"};return v.jsxs("button",{className:Sn(Pb({variant:o,size:i}),n),disabled:s||a,onClick:c,...u,children:[v.jsxs("span",{className:`flex items-center gap-1 ${a&&"opacity-0"}`,children:[e&&v.jsx(vn,{className:d(e),icon:h(e),variant:rp[o],size:op[i]}),v.jsx("span",{children:r}),t&&v.jsx(vn,{className:Sn(d(t),`${a&&"opacity-0"}`),icon:h(t),variant:rp[o],size:op[i]})]}),a&&v.jsx(Al,{className:"absolute"})]})};Je.displayName="Button";function Mt({children:t,id:e=x.useId()}){return v.jsx("div",{id:e,className:"flex h-full max-h-full flex-col bg-white md:h-fit md:rounded-lg md:border md:shadow-md",children:t})}function kt({children:t}){return v.jsx("div",{className:"grow overflow-y-auto px-6 py-4",children:t})}function nn({children:t}){return v.jsx("div",{className:"border-t px-6 py-4",children:t})}function Bt({children:t}){return v.jsx("div",{className:"border-b px-6",children:t})}const ip=({children:t,className:e,description:n,disabled:r,required:o=!1,tooltip:i,htmlFor:a})=>!t&&!i&&!n?null:v.jsx("label",{htmlFor:a,className:"inline-flex shrink-0 items-center gap-1 text-core-gray-800 antialiased ",children:v.jsxs("div",{className:Sn("inline-flex cursor-pointer items-center gap-1 text-sm font-medium leading-6",e,r&&"pointer-events-none text-core-gray-300"),children:[t?v.jsx("span",{className:Sn(r&&"pointer-events-none text-core-gray-300"),children:t}):null,n?v.jsx("span",{className:Sn("font-normal text-core-gray-500",r&&"text-current"),children:n}):null,o?v.jsx("span",{className:"font-normal text-core-red-500",children:"*"}):null]})}),ap=({helperText:t,error:e,disabled:n})=>t?v.jsx("span",{className:Sn("text-start text-sm leading-6 text-core-gray-500 antialiased ",e&&"text-core-red-500",n&&"text-core-gray-300"),children:t}):null;ip.displayName="Label",ap.displayName="HelperText";const Pn=Object.assign(ip,{Helper:ap}),kb=({id:t,defaultChecked:e=!1,disabled:n,onChange:r})=>{const o=n,[i,a]=x.useState(e),s=c=>{o||a(!i),r&&r(c.target.checked)};return v.jsx("div",{className:"flex h-6 w-6 items-center justify-center",children:v.jsx("input",{className:"h-4 w-4 rounded border border-core-gray-200 bg-core-white-900 text-core-primary-500 shadow-xs hover:border-core-gray-300 hover:shadow-none checked:bg-core-primary-500focus:outline-0 focus:ring-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border disabled:border-core-gray-200 disabled:bg-core-gray-50 disabled:shadow-none disabled:checked:bg-core-gray-200",id:t,type:"checkbox",checked:i,onChange:s,disabled:o})})},sp=x.createContext(null);function cp(t=!1){const e=x.useContext(sp);if(!e&&!t)throw new Error("Checkbox.Item must be used within a CheckboxGroup or CheckboxGroup.Root");return e}const up=x.forwardRef(({children:t,description:e,disabled:n,helperText:r,id:o,label:i,required:a,tooltip:s},c)=>{const u=x.useId(),d=o??u,h=i??e??s??r?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(Pn,{className:"cursor-default",description:e,required:a,tooltip:s,htmlFor:d,disabled:n,children:i}),v.jsx(Pn.Helper,{disabled:n,helperText:r})]}):null;return v.jsx(sp.Provider,{value:{disabled:n},children:v.jsxs("div",{ref:c,"aria-describedby":r?`${d}__describer`:void 0,"aria-labelledby":i?`${d}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[i??r??e??s?v.jsx("div",{className:"flex flex-col",children:h}):null,t?v.jsx("div",{className:Sn("flex flex-col gap-2"),children:t}):null]})})});up.displayName="CheckboxGroup",Object.assign(up,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=cp(),{disabled:o}=r??{};return v.jsx(Ll,{disabled:t??o,label:e,defaultChecked:n})}});const Ll=({id:t,children:e,defaultChecked:n=!1,description:r,disabled:o,helperText:i,label:a,required:s=!1,tooltip:c,onChange:u})=>{const d=x.useId(),h=t??d,f=!!cp(!0),p=a??r??c??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(Pn,{className:Sn(f&&"font-normal"),description:r,required:s,tooltip:c,htmlFor:h,disabled:o,children:a}),v.jsx(Pn.Helper,{disabled:o,helperText:i})]}):null;return v.jsxs("div",{className:"flex gap-3",children:[v.jsx(kb,{id:h,defaultChecked:n,disabled:o,onChange:u}),e||p]})};Ll.displayName="Checkbox";function Oa(){return{subscribe:(r,o)=>{document.addEventListener(r,o)},unsubscribe:(r,o)=>{document.removeEventListener(r,o)},publish:(r,o)=>{const i=new CustomEvent(r,{detail:o});document.dispatchEvent(i)}}}function lp(t,e){x.useEffect(()=>{const n=o=>{t.current&&!t.current.contains(o.target)&&e(!1)},r=o=>{o.key==="Escape"&&e(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",r)}},[])}const Bb=typeof window<"u"?x.useLayoutEffect:()=>{},Nb=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight],Rb=()=>{const[t,e]=x.useState(),n=x.useCallback(()=>{const r=Nb();e(o=>o&&o[0]===r[0]&&o[1]===r[1]?o:r)},[]);return Bb(n,[n]),x.useEffect(()=>{var o;const r=()=>{n(),setTimeout(n,1e3)};return window.addEventListener("resize",r),window.addEventListener("orientationchange",r),(o=window.visualViewport)==null||o.addEventListener("resize",r),()=>{var i;window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r),(i=window.visualViewport)==null||i.removeEventListener("resize",r)}},[n]),t};var dp={exports:{}};/*!
85
85
  *
86
86
  * react-simple-keyboard v3.7.121
87
87
  * https://github.com/hodgef/react-simple-keyboard
@@ -98,7 +98,7 @@ React keys must be passed directly to JSX without using spread:
98
98
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function p(H,$){if(H){if(typeof H=="string")return l(H,$);var J=Object.prototype.toString.call(H).slice(8,-1);return J==="Object"&&H.constructor&&(J=H.constructor.name),J==="Map"||J==="Set"?Array.from(H):J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J)?l(H,$):void 0}}function l(H,$){($==null||$>H.length)&&($=H.length);for(var J=0,S=new Array($);J<$;J++)S[J]=H[J];return S}function g(H){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},g(H)}function m(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,w(S.key),S)}}function y(H,$,J){return($=w($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function w(H){var $=function(J,S){if(g(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S||"default");if(g(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(J)}(H,"string");return g($)=="symbol"?$:$+""}d.r(h),d.d(h,{SimpleKeyboard:function(){return _e},default:function(){return ve}}),d(5276),d(8598),d(4782),d(4554),d(2010),d(7427),d(6099),d(7495),d(8781),d(5440),d(744),d(2762),typeof Element>"u"||"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),typeof self<"u"&&"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(H){if("Element"in H){var $="classList",J="prototype",S=H.Element[J],M=Object,F=String[J].trim||function(){return this.replace(/^\s+|\s+$/g,"")},B=Array[J].indexOf||function(pe){for(var fe=0,ye=this.length;fe<ye;fe++)if(fe in this&&this[fe]===pe)return fe;return-1},Q=function(pe,fe){this.name=pe,this.code=DOMException[pe],this.message=fe},Z=function(pe,fe){if(fe==="")throw new Q("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(fe))throw new Q("INVALID_CHARACTER_ERR","The token must not contain space characters.");return B.call(pe,fe)},ee=function(pe){for(var fe=F.call(pe.getAttribute("class")||""),ye=fe?fe.split(/\s+/):[],ue=0,Oe=ye.length;ue<Oe;ue++)this.push(ye[ue]);this._updateClassName=function(){pe.setAttribute("class",this.toString())}},K=ee[J]=[],ge=function(){return new ee(this)};if(Q[J]=Error[J],K.item=function(pe){return this[pe]||null},K.contains=function(pe){return~Z(this,pe+"")},K.add=function(){var pe,fe=arguments,ye=0,ue=fe.length,Oe=!1;do~Z(this,pe=fe[ye]+"")||(this.push(pe),Oe=!0);while(++ye<ue);Oe&&this._updateClassName()},K.remove=function(){var pe,fe,ye=arguments,ue=0,Oe=ye.length,ke=!1;do for(fe=Z(this,pe=ye[ue]+"");~fe;)this.splice(fe,1),ke=!0,fe=Z(this,pe);while(++ue<Oe);ke&&this._updateClassName()},K.toggle=function(pe,fe){var ye=this.contains(pe),ue=ye?fe!==!0&&"remove":fe!==!1&&"add";return ue&&this[ue](pe),fe===!0||fe===!1?fe:!ye},K.replace=function(pe,fe){var ye=Z(pe+"");~ye&&(this.splice(ye,1,fe),this._updateClassName())},K.toString=function(){return this.join(" ")},M.defineProperty){var be={get:ge,enumerable:!0,configurable:!0};try{M.defineProperty(S,$,be)}catch(pe){pe.number!==void 0&&pe.number!==-2146823252||(be.enumerable=!1,M.defineProperty(S,$,be))}}else M[J].__defineGetter__&&S.__defineGetter__($,ge)}}(self),function(){var H=document.createElement("_");if(H.classList.add("c1","c2"),!H.classList.contains("c2")){var $=function(S){var M=DOMTokenList.prototype[S];DOMTokenList.prototype[S]=function(F){var B,Q=arguments.length;for(B=0;B<Q;B++)F=arguments[B],M.call(this,F)}};$("add"),$("remove")}if(H.classList.toggle("c3",!1),H.classList.contains("c3")){var J=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(S,M){return 1 in arguments&&!this.contains(S)==!M?M:J.call(this,S)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(S,M){var F=this.toString().split(" "),B=F.indexOf(S+"");~B&&(F=F.slice(B),this.remove.apply(this,F),this.add(M),this.add.apply(this,F.slice(1)))}),H=null}()),d(2675),d(9463),d(2259),d(5700),d(8706),d(2008),d(3418),d(4423),d(3792),d(2062),d(6910),d(739),d(9572),d(2892),d(9085),d(3851),d(1278),d(9432),d(4864),d(1699),d(7764),d(8344),d(3500),d(2953),d(2712),d(2637),d(1480),d(1761);var b=function(){return H=function S(M){var F=M.getOptions,B=M.getCaretPosition,Q=M.getCaretPositionEnd,Z=M.dispatch;(function(ee,K){if(!(ee instanceof K))throw new TypeError("Cannot call a class as a function")})(this,S),y(this,"getOptions",void 0),y(this,"getCaretPosition",void 0),y(this,"getCaretPositionEnd",void 0),y(this,"dispatch",void 0),y(this,"maxLengthReached",void 0),y(this,"isStandardButton",function(ee){return ee&&!(ee[0]==="{"&&ee[ee.length-1]==="}")}),this.getOptions=F,this.getCaretPosition=B,this.getCaretPositionEnd=Q,this.dispatch=Z,S.bindMethods(S,this)},$=[{key:"getButtonType",value:function(S){return S.includes("{")&&S.includes("}")&&S!=="{//}"?"functionBtn":"standardBtn"}},{key:"getButtonClass",value:function(S){var M=this.getButtonType(S),F=S.replace("{","").replace("}",""),B="";return M!=="standardBtn"&&(B=" hg-button-".concat(F)),"hg-".concat(M).concat(B)}},{key:"getDefaultDiplay",value:function(){return{"{bksp}":"backspace","{backspace}":"backspace","{enter}":"< enter","{shift}":"shift","{shiftleft}":"shift","{shiftright}":"shift","{alt}":"alt","{s}":"shift","{tab}":"tab","{lock}":"caps","{capslock}":"caps","{accept}":"Submit","{space}":" ","{//}":" ","{esc}":"esc","{escape}":"esc","{f1}":"f1","{f2}":"f2","{f3}":"f3","{f4}":"f4","{f5}":"f5","{f6}":"f6","{f7}":"f7","{f8}":"f8","{f9}":"f9","{f10}":"f10","{f11}":"f11","{f12}":"f12","{numpaddivide}":"/","{numlock}":"lock","{arrowup}":"↑","{arrowleft}":"←","{arrowdown}":"↓","{arrowright}":"→","{prtscr}":"print","{scrolllock}":"scroll","{pause}":"pause","{insert}":"ins","{home}":"home","{pageup}":"up","{delete}":"del","{forwarddelete}":"del","{end}":"end","{pagedown}":"down","{numpadmultiply}":"*","{numpadsubtract}":"-","{numpadadd}":"+","{numpadenter}":"enter","{period}":".","{numpaddecimal}":".","{numpad0}":"0","{numpad1}":"1","{numpad2}":"2","{numpad3}":"3","{numpad4}":"4","{numpad5}":"5","{numpad6}":"6","{numpad7}":"7","{numpad8}":"8","{numpad9}":"9"}}},{key:"getButtonDisplayName",value:function(S,M){return(M=arguments.length>2&&arguments[2]!==void 0&&arguments[2]?Object.assign({},this.getDefaultDiplay(),M):M||this.getDefaultDiplay())[S]||S}},{key:"getUpdatedInput",value:function(S,M,F){var B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:F,Q=arguments.length>4&&arguments[4]!==void 0&&arguments[4],Z=this.getOptions(),ee=[F,B,Q],K=M;return(S==="{bksp}"||S==="{backspace}")&&K.length>0?K=this.removeAt.apply(this,[K].concat(ee)):(S==="{delete}"||S==="{forwarddelete}")&&K.length>0?K=this.removeForwardsAt.apply(this,[K].concat(ee)):S==="{space}"?K=this.addStringAt.apply(this,[K," "].concat(ee)):S!=="{tab}"||typeof Z.tabCharOnTab=="boolean"&&Z.tabCharOnTab===!1?S!=="{enter}"&&S!=="{numpadenter}"||!Z.newLineOnEnter?S.includes("numpad")&&Number.isInteger(Number(S[S.length-2]))?K=this.addStringAt.apply(this,[K,S[S.length-2]].concat(ee)):S==="{numpaddivide}"?K=this.addStringAt.apply(this,[K,"/"].concat(ee)):S==="{numpadmultiply}"?K=this.addStringAt.apply(this,[K,"*"].concat(ee)):S==="{numpadsubtract}"?K=this.addStringAt.apply(this,[K,"-"].concat(ee)):S==="{numpadadd}"?K=this.addStringAt.apply(this,[K,"+"].concat(ee)):S==="{numpaddecimal}"?K=this.addStringAt.apply(this,[K,"."].concat(ee)):S==="{"||S==="}"?K=this.addStringAt.apply(this,[K,S].concat(ee)):S.includes("{")||S.includes("}")||(K=this.addStringAt.apply(this,[K,S].concat(ee))):K=this.addStringAt.apply(this,[K,`
99
99
  `].concat(ee)):K=this.addStringAt.apply(this,[K," "].concat(ee)),Z.debug&&console.log("Input will be: "+K),K}},{key:"updateCaretPos",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0&&arguments[1],F=this.updateCaretPosAction(S,M);this.dispatch(function(B){B.setCaretPosition(F)})}},{key:"updateCaretPosAction",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0&&arguments[1],F=this.getOptions(),B=this.getCaretPosition();return B!=null&&(M?B>0&&(B-=S):B+=S),F.debug&&console.log("Caret at:",B),B}},{key:"addStringAt",value:function(S,M){var F,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.length,Q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:S.length,Z=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return B||B===0?(F=[S.slice(0,B),M,S.slice(Q)].join(""),this.isMaxLengthReached()||Z&&this.updateCaretPos(M.length)):F=S+M,F}},{key:"removeAt",value:function(S){var M,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.length,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.length,Q=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(F===0&&B===0)return S;if(F===B){var Z=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;F&&F>=0?S.substring(F-2,F).match(Z)?(M=S.substr(0,F-2)+S.substr(F),Q&&this.updateCaretPos(2,!0)):(M=S.substr(0,F-1)+S.substr(F),Q&&this.updateCaretPos(1,!0)):S.slice(-2).match(Z)?(M=S.slice(0,-2),Q&&this.updateCaretPos(2,!0)):(M=S.slice(0,-1),Q&&this.updateCaretPos(1,!0))}else M=S.slice(0,F)+S.slice(B),Q&&this.dispatch(function(ee){ee.setCaretPosition(F)});return M}},{key:"removeForwardsAt",value:function(S){var M,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.length,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.length,Q=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return S!=null&&S.length&&F!==null?(F===B?M=S.substring(F,F+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?S.substr(0,F)+S.substr(F+2):S.substr(0,F)+S.substr(F+1):(M=S.slice(0,F)+S.slice(B),Q&&this.dispatch(function(Z){Z.setCaretPosition(F)})),M):S}},{key:"handleMaxLength",value:function(S,M){var F=this.getOptions(),B=F.maxLength,Q=S[F.inputName||"default"],Z=M.length-1>=B;if(M.length<=Q.length)return!1;if(Number.isInteger(B))return F.debug&&console.log("maxLength (num) reached:",Z),Z?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if(g(B)==="object"){var ee=M.length-1>=B[F.inputName||"default"];return F.debug&&console.log("maxLength (obj) reached:",ee),ee?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return!!this.maxLengthReached}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(S){return S?S.toLowerCase().trim().split(/[.\-_\s]/g).reduce(function(M,F){return F.length?M+F[0].toUpperCase()+F.slice(1):M}):""}},{key:"chunkArray",value:function(S,M){return f(Array(Math.ceil(S.length/M))).map(function(F,B){return S.slice(M*B,M+M*B)})}},{key:"escapeRegex",value:function(S){return S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"getRtlOffset",value:function(S,M){var F=S,B=M.indexOf("‫");return B<S&&B!=-1&&F--,M.indexOf("‬")<S&&B!=-1&&F--,F<0?0:F}}],J=[{key:"bindMethods",value:function(S,M){var F,B=function(Z,ee){var K=typeof Symbol<"u"&&Z[Symbol.iterator]||Z["@@iterator"];if(!K){if(Array.isArray(Z)||(K=p(Z))||ee){K&&(Z=K);var ge=0,be=function(){};return{s:be,n:function(){return ge>=Z.length?{done:!0}:{done:!1,value:Z[ge++]}},e:function(ue){throw ue},f:be}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
100
100
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var pe,fe=!0,ye=!1;return{s:function(){K=K.call(Z)},n:function(){var ue=K.next();return fe=ue.done,ue},e:function(ue){ye=!0,pe=ue},f:function(){try{fe||K.return==null||K.return()}finally{if(ye)throw pe}}}}(Object.getOwnPropertyNames(S.prototype));try{for(B.s();!(F=B.n()).done;){var Q=F.value;Q==="constructor"||Q==="bindMethods"||(M[Q]=M[Q].bind(M))}}catch(Z){B.e(Z)}finally{B.f()}}}],$&&m(H.prototype,$),J&&m(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}();y(b,"noop",function(){});var E=b;function C(H){return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},C(H)}function I(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,P(S.key),S)}}function T(H,$,J){return($=P($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function P(H){var $=function(J,S){if(C(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(C(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return C($)=="symbol"?$:$+""}var N=function(){return H=function S(M){var F=this,B=M.dispatch,Q=M.getOptions;(function(Z,ee){if(!(Z instanceof ee))throw new TypeError("Cannot call a class as a function")})(this,S),T(this,"getOptions",void 0),T(this,"dispatch",void 0),T(this,"isModifierKey",function(Z){return Z.altKey||Z.ctrlKey||Z.shiftKey||["Tab","CapsLock","Esc","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(Z.code||Z.key||F.keyCodeToKey(Z==null?void 0:Z.keyCode))}),this.dispatch=B,this.getOptions=Q,E.bindMethods(S,this)},($=[{key:"handleHighlightKeyDown",value:function(S){var M=this.getOptions();M.physicalKeyboardHighlightPreventDefault&&this.isModifierKey(S)&&(S.preventDefault(),S.stopImmediatePropagation());var F=this.getSimpleKeyboardLayoutKey(S);this.dispatch(function(B){var Q,Z,ee=B.getButtonElement(F),K=B.getButtonElement("{".concat(F,"}"));if(ee)Q=ee,Z=F;else{if(!K)return;Q=K,Z="{".concat(F,"}")}var ge,be,pe,fe,ye=function(Oe){Oe.style.background=M.physicalKeyboardHighlightBgColor||"#dadce4",Oe.style.color=M.physicalKeyboardHighlightTextColor||"black"};if(Q)if(Array.isArray(Q)){if(Q.forEach(function(Oe){return ye(Oe)}),M.physicalKeyboardHighlightPress)if(M.physicalKeyboardHighlightPressUsePointerEvents)(ge=Q[0])===null||ge===void 0||(be=ge.onpointerdown)===null||be===void 0||be.call(ge,S);else if(M.physicalKeyboardHighlightPressUseClick){var ue;(ue=Q[0])===null||ue===void 0||ue.click()}else B.handleButtonClicked(Z,S)}else ye(Q),M.physicalKeyboardHighlightPress&&(M.physicalKeyboardHighlightPressUsePointerEvents?(pe=Q)===null||pe===void 0||(fe=pe.onpointerdown)===null||fe===void 0||fe.call(pe,S):M.physicalKeyboardHighlightPressUseClick?Q.click():B.handleButtonClicked(Z,S))})}},{key:"handleHighlightKeyUp",value:function(S){var M=this.getOptions();M.physicalKeyboardHighlightPreventDefault&&this.isModifierKey(S)&&(S.preventDefault(),S.stopImmediatePropagation());var F=this.getSimpleKeyboardLayoutKey(S);this.dispatch(function(B){var Q,Z,ee,K=B.getButtonElement(F)||B.getButtonElement("{".concat(F,"}")),ge=function(be){be.removeAttribute&&be.removeAttribute("style")};K&&(Array.isArray(K)?(K.forEach(function(be){return ge(be)}),M.physicalKeyboardHighlightPressUsePointerEvents&&((Q=K[0])===null||Q===void 0||(Z=Q.onpointerup)===null||Z===void 0||Z.call(Q,S))):(ge(K),M.physicalKeyboardHighlightPressUsePointerEvents&&(K==null||(ee=K.onpointerup)===null||ee===void 0||ee.call(K,S))))})}},{key:"getSimpleKeyboardLayoutKey",value:function(S){var M,F="",B=S.code||S.key||this.keyCodeToKey(S==null?void 0:S.keyCode);return(F=B!=null&&B.includes("Numpad")||B!=null&&B.includes("Shift")||B!=null&&B.includes("Space")||B!=null&&B.includes("Backspace")||B!=null&&B.includes("Control")||B!=null&&B.includes("Alt")||B!=null&&B.includes("Meta")?S.code||"":S.key||this.keyCodeToKey(S==null?void 0:S.keyCode)||"").length>1?(M=F)===null||M===void 0?void 0:M.toLowerCase():F}},{key:"keyCodeToKey",value:function(S){return{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[S]||""}}])&&I(H.prototype,$),J&&I(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}();function L(H){return L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},L(H)}function V(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,W(S.key),S)}}function j(H,$,J){return($=W($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function W(H){var $=function(J,S){if(L(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(L(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return L($)=="symbol"?$:$+""}var q=function(){return H=function S(M){var F=M.utilities,B=M.options;(function(Q,Z){if(!(Q instanceof Z))throw new TypeError("Cannot call a class as a function")})(this,S),j(this,"utilities",void 0),j(this,"options",void 0),j(this,"candidateBoxElement",void 0),j(this,"pageIndex",0),j(this,"pageSize",void 0),this.utilities=F,this.options=B,E.bindMethods(S,this),this.pageSize=this.utilities.getOptions().layoutCandidatesPageSize||5},$=[{key:"destroy",value:function(){this.candidateBoxElement&&(this.candidateBoxElement.remove(),this.pageIndex=0)}},{key:"show",value:function(S){var M=this,F=S.candidateValue,B=S.targetElement,Q=S.onSelect;if(F&&F.length){var Z=this.utilities.chunkArray(F.split(" "),this.pageSize);this.renderPage({candidateListPages:Z,targetElement:B,pageIndex:this.pageIndex,nbPages:Z.length,onItemSelected:function(ee,K){Q(ee,K),M.destroy()}})}}},{key:"renderPage",value:function(S){var M,F=this,B=S.candidateListPages,Q=S.targetElement,Z=S.pageIndex,ee=S.nbPages,K=S.onItemSelected;(M=this.candidateBoxElement)===null||M===void 0||M.remove(),this.candidateBoxElement=document.createElement("div"),this.candidateBoxElement.className="hg-candidate-box";var ge=document.createElement("ul");ge.className="hg-candidate-box-list",B[Z].forEach(function(ke){var at,ze=document.createElement("li"),It=function(){var ht=new(F.options.useTouchEvents?TouchEvent:MouseEvent)("click");return Object.defineProperty(ht,"target",{value:ze}),ht};ze.className="hg-candidate-box-list-item",ze.innerHTML=((at=F.options.display)===null||at===void 0?void 0:at[ke])||ke,F.options.useTouchEvents?ze.ontouchstart=function(ht){return K(ke,ht||It())}:ze.onclick=function(){var ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:It();return K(ke,ht)},ge.appendChild(ze)});var be=Z>0,pe=document.createElement("div");pe.classList.add("hg-candidate-box-prev"),be&&pe.classList.add("hg-candidate-box-btn-active");var fe=function(){be&&F.renderPage({candidateListPages:B,targetElement:Q,pageIndex:Z-1,nbPages:ee,onItemSelected:K})};this.options.useTouchEvents?pe.ontouchstart=fe:pe.onclick=fe,this.candidateBoxElement.appendChild(pe),this.candidateBoxElement.appendChild(ge);var ye=Z<ee-1,ue=document.createElement("div");ue.classList.add("hg-candidate-box-next"),ye&&ue.classList.add("hg-candidate-box-btn-active");var Oe=function(){ye&&F.renderPage({candidateListPages:B,targetElement:Q,pageIndex:Z+1,nbPages:ee,onItemSelected:K})};this.options.useTouchEvents?ue.ontouchstart=Oe:ue.onclick=Oe,this.candidateBoxElement.appendChild(ue),Q.prepend(this.candidateBoxElement)}}],$&&V(H.prototype,$),J&&V(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}(),k=q;function U(H){return function($){if(Array.isArray($))return z($)}(H)||function($){if(typeof Symbol<"u"&&$[Symbol.iterator]!=null||$["@@iterator"]!=null)return Array.from($)}(H)||function($,J){if($){if(typeof $=="string")return z($,J);var S=Object.prototype.toString.call($).slice(8,-1);return S==="Object"&&$.constructor&&(S=$.constructor.name),S==="Map"||S==="Set"?Array.from($):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?z($,J):void 0}}(H)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
101
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(H,$){($==null||$>H.length)&&($=H.length);for(var J=0,S=new Array($);J<$;J++)S[J]=H[J];return S}function te(H){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},te(H)}function oe(H,$){var J=Object.keys(H);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(H);$&&(S=S.filter(function(M){return Object.getOwnPropertyDescriptor(H,M).enumerable})),J.push.apply(J,S)}return J}function ne(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,we(S.key),S)}}function se(H,$,J){return($=we($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function we(H){var $=function(J,S){if(te(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(te(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return te($)=="symbol"?$:$+""}var le=function(){return H=function S(M,F){var B=this;if(function(fe,ye){if(!(fe instanceof ye))throw new TypeError("Cannot call a class as a function")}(this,S),se(this,"input",void 0),se(this,"options",void 0),se(this,"utilities",void 0),se(this,"caretPosition",void 0),se(this,"caretPositionEnd",void 0),se(this,"keyboardDOM",void 0),se(this,"keyboardPluginClasses",void 0),se(this,"keyboardDOMClass",void 0),se(this,"buttonElements",void 0),se(this,"currentInstanceName",void 0),se(this,"allKeyboardInstances",void 0),se(this,"keyboardInstanceNames",void 0),se(this,"isFirstKeyboardInstance",void 0),se(this,"physicalKeyboard",void 0),se(this,"modules",void 0),se(this,"activeButtonClass",void 0),se(this,"holdInteractionTimeout",void 0),se(this,"holdTimeout",void 0),se(this,"isMouseHold",void 0),se(this,"initialized",void 0),se(this,"candidateBox",void 0),se(this,"keyboardRowsDOM",void 0),se(this,"defaultName","default"),se(this,"activeInputElement",null),se(this,"handleParams",function(fe,ye){var ue,Oe,ke;if(typeof fe=="string")ue=fe.split(".").join(""),Oe=document.querySelector(".".concat(ue)),ke=ye;else if(fe instanceof HTMLDivElement){if(!fe.className)throw console.warn("Any DOM element passed as parameter must have a class."),new Error("KEYBOARD_DOM_CLASS_ERROR");ue=fe.className.split(" ")[0],Oe=fe,ke=ye}else ue="simple-keyboard",Oe=document.querySelector(".".concat(ue)),ke=fe;return{keyboardDOMClass:ue,keyboardDOM:Oe,options:ke}}),se(this,"getOptions",function(){return B.options}),se(this,"getCaretPosition",function(){return B.caretPosition}),se(this,"getCaretPositionEnd",function(){return B.caretPositionEnd}),se(this,"registerModule",function(fe,ye){B.modules[fe]||(B.modules[fe]={}),ye(B.modules[fe])}),se(this,"getKeyboardClassString",function(){for(var fe=arguments.length,ye=new Array(fe),ue=0;ue<fe;ue++)ye[ue]=arguments[ue];return[B.keyboardDOMClass].concat(ye).filter(function(Oe){return!!Oe}).join(" ")}),typeof window<"u"){var Q=this.handleParams(M,F),Z=Q.keyboardDOMClass,ee=Q.keyboardDOM,K=Q.options,ge=K===void 0?{}:K;this.utilities=new E({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=ee,this.options=function(fe){for(var ye=1;ye<arguments.length;ye++){var ue=arguments[ye]!=null?arguments[ye]:{};ye%2?oe(Object(ue),!0).forEach(function(Oe){se(fe,Oe,ue[Oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(ue)):oe(Object(ue)).forEach(function(Oe){Object.defineProperty(fe,Oe,Object.getOwnPropertyDescriptor(ue,Oe))})}return fe}({layoutName:"default",theme:"hg-theme-default",inputName:"default",preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},ge),this.keyboardPluginClasses="",E.bindMethods(S,this);var be=this.options.inputName,pe=be===void 0?this.defaultName:be;if(this.input={},this.input[pe]="",this.keyboardDOMClass=Z,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new N({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new k({utilities:this.utilities,options:this.options}):null,!this.keyboardDOM)throw console.warn('".'.concat(Z,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}},$=[{key:"setCaretPosition",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;this.caretPosition=S,this.caretPositionEnd=M}},{key:"getInputCandidates",value:function(S){var M=this,F=this.options,B=F.layoutCandidates,Q=F.layoutCandidatesCaseSensitiveMatch;if(!B||te(B)!=="object")return{};var Z=Object.keys(B).filter(function(ge){var be=S.substring(0,M.getCaretPositionEnd()||0)||S,pe=new RegExp("".concat(M.utilities.escapeRegex(ge),"$"),Q?"g":"gi");return!!U(be.matchAll(pe)).length});if(Z.length>1){var ee=Z.sort(function(ge,be){return be.length-ge.length})[0];return{candidateKey:ee,candidateValue:B[ee]}}if(Z.length){var K=Z[0];return{candidateKey:K,candidateValue:B[K]}}return{}}},{key:"showCandidatesBox",value:function(S,M,F){var B=this;this.candidateBox&&this.candidateBox.show({candidateValue:M,targetElement:F,onSelect:function(Q,Z){var ee=B.options,K=ee.layoutCandidatesCaseSensitiveMatch,ge=ee.disableCandidateNormalization,be=ee.enableLayoutCandidatesKeyPress,pe=Q;ge||(pe=Q.normalize("NFD")),typeof B.options.beforeInputUpdate=="function"&&B.options.beforeInputUpdate(B);var fe=B.getInput(B.options.inputName,!0),ye=B.getCaretPositionEnd()||0,ue=fe.substring(0,ye||0)||fe,Oe=new RegExp("".concat(B.utilities.escapeRegex(S),"$"),K?"g":"gi"),ke=ue.replace(Oe,pe),at=fe.replace(ue,ke),ze=ke.length-ue.length,It=(ye||fe.length)+ze;It<0&&(It=0),B.setInput(at,B.options.inputName,!0),B.setCaretPosition(It),be&&typeof B.options.onKeyPress=="function"&&B.options.onKeyPress(Q,Z),typeof B.options.onChange=="function"&&B.options.onChange(B.getInput(B.options.inputName,!0),Z),typeof B.options.onChangeAll=="function"&&B.options.onChangeAll(B.getAllInputs(),Z)}})}},{key:"handleButtonClicked",value:function(S,M){var F=this.options,B=F.inputName,Q=B===void 0?this.defaultName:B,Z=F.debug;if(S!=="{//}"){this.input[Q]||(this.input[Q]=""),typeof this.options.beforeInputUpdate=="function"&&this.options.beforeInputUpdate(this);var ee=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(S)&&this.activeInputElement&&this.input[Q]&&this.input[Q]===ee&&this.caretPosition===0&&this.caretPositionEnd===ee.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(S,M);if(typeof this.options.onKeyPress=="function"&&this.options.onKeyPress(S,M),this.input[Q]!==ee&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(ee))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,ee))return;var K=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(K,this.options.inputName,!0),Z&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),M==null?void 0:M.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),typeof this.options.onChange=="function"&&this.options.onChange(this.getInput(this.options.inputName,!0),M),typeof this.options.onChangeAll=="function"&&this.options.onChangeAll(this.getAllInputs(),M),M!=null&&M.target&&this.options.enableLayoutCandidates){var ge,be=this.getInputCandidates(ee),pe=be.candidateKey,fe=be.candidateValue;pe&&fe?this.showCandidatesBox(pe,fe,this.keyboardDOM):(ge=this.candidateBox)===null||ge===void 0||ge.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),Z&&console.log("Key pressed:",S)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(S){this.options.syncInstanceInputs?this.dispatch(function(M){M.isMouseHold=S}):this.isMouseHold=S}},{key:"handleButtonMouseDown",value:function(S,M){var F=this;M&&(this.options.preventMouseDownDefault&&M.preventDefault(),this.options.stopMouseDownPropagation&&M.stopPropagation(),M.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout(function(){(F.getMouseHold()&&(!S.includes("{")&&!S.includes("}")||S==="{delete}"||S==="{backspace}"||S==="{bksp}"||S==="{space}"||S==="{tab}")||S==="{arrowright}"||S==="{arrowleft}"||S==="{arrowup}"||S==="{arrowdown}")&&(F.options.debug&&console.log("Button held:",S),F.handleButtonHold(S)),clearTimeout(F.holdTimeout)},500))}},{key:"handleButtonMouseUp",value:function(S,M){var F=this;M&&(this.options.preventMouseUpDefault&&M.preventDefault&&M.preventDefault(),this.options.stopMouseUpPropagation&&M.stopPropagation&&M.stopPropagation(),!(M.target===this.keyboardDOM||M.target&&this.keyboardDOM.contains(M.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(M.target===this.candidateBox.candidateBoxElement||M.target&&this.candidateBox.candidateBoxElement.contains(M.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons(function(B){B.classList.remove(F.activeButtonClass)}),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),S&&typeof this.options.onKeyReleased=="function"&&this.options.onKeyReleased(S,M)}},{key:"handleKeyboardContainerMouseDown",value:function(S){this.options.preventMouseDownDefault&&S.preventDefault()}},{key:"handleButtonHold",value:function(S){var M=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout(function(){M.getMouseHold()?(M.handleButtonClicked(S),M.handleButtonHold(S)):clearTimeout(M.holdInteractionTimeout)},100)}},{key:"syncInstanceInputs",value:function(){var S=this;this.dispatch(function(M){M.replaceInput(S.input),M.setCaretPosition(S.caretPosition,S.caretPositionEnd)})}},{key:"clearInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName;this.input[S]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName,M=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.options.syncInstanceInputs&&!M&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[S].replace("‫","").replace("‬","")+"‬":this.input[S]}},{key:"getAllInputs",value:function(){var S=this,M={};return Object.keys(this.input).forEach(function(F){M[F]=S.getInput(F,!0)}),M}},{key:"setInput",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.inputName||this.defaultName,F=arguments.length>2?arguments[2]:void 0;this.input[M]=S,!F&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(S){this.input=S}},{key:"setOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=this.changedOptions(S);this.options=Object.assign(this.options,S),M.length&&(this.options.debug&&console.log("changedOptions",M),this.onSetOptions(M),this.render())}},{key:"changedOptions",value:function(S){var M=this;return Object.keys(S).filter(function(F){return JSON.stringify(S[F])!==JSON.stringify(M.options[F])})}},{key:"onSetOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];S.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(S.includes("layoutCandidatesPageSize")||S.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new k({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(S){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach(function(M){S(window.SimpleKeyboardInstances[M],M)})}},{key:"addButtonTheme",value:function(S,M){var F=this;M&&S&&(S.split(" ").forEach(function(B){M.split(" ").forEach(function(Q){F.options.buttonTheme||(F.options.buttonTheme=[]);var Z=!1;F.options.buttonTheme.map(function(ee){if(ee!=null&&ee.class.split(" ").includes(Q)){Z=!0;var K=ee.buttons.split(" ");K.includes(B)||(Z=!0,K.push(B),ee.buttons=K.join(" "))}return ee}),Z||F.options.buttonTheme.push({class:Q,buttons:S})})}),this.render())}},{key:"removeButtonTheme",value:function(S,M){var F=this;if(!S&&!M)return this.options.buttonTheme=[],void this.render();S&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(S.split(" ").forEach(function(B){var Q;(Q=F.options)===null||Q===void 0||(Q=Q.buttonTheme)===null||Q===void 0||Q.map(function(Z,ee){if(Z&&M&&M.includes(Z.class)||!M){var K,ge,be=(K=Z)===null||K===void 0?void 0:K.buttons.split(" ").filter(function(pe){return pe!==B});Z&&be!=null&&be.length?Z.buttons=be.join(" "):((ge=F.options.buttonTheme)===null||ge===void 0||ge.splice(ee,1),Z=null)}return Z})}),this.render())}},{key:"getButtonElement",value:function(S){var M,F=this.buttonElements[S];return F&&(M=F.length>1?F:F[0]),M}},{key:"inputPatternIsValid",value:function(S){var M,F=this.options.inputPattern;if((M=F instanceof RegExp?F:F[this.options.inputName||this.defaultName])&&S){var B=M.test(S);return this.options.debug&&console.log('inputPattern ("'.concat(M,'"): ').concat(B?"passed":"did not pass!")),B}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.addEventListener("keyup",this.handleKeyUp,M),document.addEventListener("keydown",this.handleKeyDown,M),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(S){this.caretEventHandler(S),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(S)}},{key:"handleKeyDown",value:function(S){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(S)}},{key:"handleMouseUp",value:function(S){this.caretEventHandler(S)}},{key:"handleTouchEnd",value:function(S){this.caretEventHandler(S)}},{key:"handleSelect",value:function(S){this.caretEventHandler(S)}},{key:"handleSelectionChange",value:function(S){navigator.userAgent.includes("Firefox")||this.caretEventHandler(S)}},{key:"caretEventHandler",value:function(S){var M,F=this;S.target.tagName&&(M=S.target.tagName.toLowerCase()),this.dispatch(function(B){var Q=S.target===B.keyboardDOM||S.target&&B.keyboardDOM.contains(S.target);if(F.options.syncInstanceInputs&&Array.isArray(S.path)&&(Q=S.path.some(function(K){var ge;return K==null||(ge=K.hasAttribute)===null||ge===void 0?void 0:ge.call(K,"data-skInstance")})),(M==="textarea"||M==="input"&&["text","search","url","tel","password"].includes(S.target.type))&&!B.options.disableCaretPositioning){var Z=S.target.selectionStart,ee=S.target.selectionEnd;B.options.rtl&&(Z=B.utilities.getRtlOffset(Z,B.getInput()),ee=B.utilities.getRtlOffset(ee,B.getInput())),B.setCaretPosition(Z,ee),F.activeInputElement=S.target,B.options.debug&&console.log("Caret at: ",B.getCaretPosition(),B.getCaretPositionEnd(),S&&S.target.tagName.toLowerCase(),"(".concat(B.keyboardDOMClass,")"),S==null?void 0:S.type)}else!B.options.disableCaretPositioning&&Q||(S==null?void 0:S.type)==="selectionchange"||(B.setCaretPosition(null),F.activeInputElement=null,B.options.debug&&console.log('Caret position reset due to "'.concat(S==null?void 0:S.type,'" event'),S))})}},{key:"recurseButtons",value:function(S){var M=this;S&&Object.keys(this.buttonElements).forEach(function(F){return M.buttonElements[F].forEach(S)})}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.removeEventListener("keyup",this.handleKeyUp,M),document.removeEventListener("keydown",this.handleKeyDown,M),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons(function(F){F&&(F.onpointerdown=null,F.onpointerup=null,F.onpointercancel=null,F.ontouchstart=null,F.ontouchend=null,F.ontouchcancel=null,F.onclick=null,F.onmousedown=null,F.onmouseup=null,F.remove(),F=null)}),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(S){var M=this.options.buttonTheme,F=[];return Array.isArray(M)&&M.forEach(function(B){if(B&&B.class&&typeof B.class=="string"&&B.buttons&&typeof B.buttons=="string"){var Q=B.class.split(" ");B.buttons.split(" ").includes(S)&&(F=[].concat(U(F),U(Q)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',B)}),F}},{key:"setDOMButtonAttributes",value:function(S,M){var F=this.options.buttonAttributes;Array.isArray(F)&&F.forEach(function(B){B.attribute&&typeof B.attribute=="string"&&B.value&&typeof B.value=="string"&&B.buttons&&typeof B.buttons=="string"?B.buttons.split(" ").includes(S)&&M(B.attribute,B.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',B)})}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(S){if(S.target.classList.contains("hg-button"))return S.preventDefault(),S.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),typeof this.options.onInit=="function"&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),typeof this.options.beforeFirstRender=="function"&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){typeof this.options.beforeRender=="function"&&this.options.beforeRender(this)}},{key:"onRender",value:function(){typeof this.options.onRender=="function"&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){typeof this.options.onModulesLoaded=="function"&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var S=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach(function(M){var F=new M(S);F.init&&F.init(S)}),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(S,M){return!!this.modules[S]&&this.modules[S][M]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(S,M,F,B){var Q=this,Z=Array.from(S.children),ee=0;return Z.length&&F.forEach(function(K,ge){var be=B[ge];if(!(be&&be>K))return!1;var pe=K-ee,fe=be-ee,ye=document.createElement("div");ye.className+="hg-button-container";var ue="".concat(Q.options.layoutName,"-r").concat(M,"c").concat(ge);ye.setAttribute("data-skUID",ue);var Oe=Z.splice(pe,fe-pe+1);ee=fe-pe,Oe.forEach(function(ke){return ye.appendChild(ke)}),Z.splice(pe,0,ye),S.innerHTML="",Z.forEach(function(ke){return S.appendChild(ke)}),Q.options.debug&&console.log("rowDOMContainer",Oe,pe,fe,ee+1)}),S}},{key:"render",value:function(){var S=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var M="hg-layout-".concat(this.options.layoutName),F=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},B=this.options.useTouchEvents||!1,Q=B?"hg-touch-events":"",Z=this.options.useMouseEvents||!1,ee=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,M,this.keyboardPluginClasses,Q),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",F[this.options.layoutName||this.defaultName].forEach(function(K,ge){var be=K.split(" ");S.options.excludeFromLayout&&S.options.excludeFromLayout[S.options.layoutName||S.defaultName]&&(be=be.filter(function(ue){return S.options.excludeFromLayout&&!S.options.excludeFromLayout[S.options.layoutName||S.defaultName].includes(ue)}));var pe=document.createElement("div");pe.className+="hg-row";var fe=[],ye=[];be.forEach(function(ue,Oe){var ke,at=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("[")===0,ze=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("]")===ue.length-1;at&&(fe.push(Oe),ue=ue.replace(/\[/g,"")),ze&&(ye.push(Oe),ue=ue.replace(/\]/g,""));var It=S.utilities.getButtonClass(ue),ht=S.utilities.getButtonDisplayName(ue,S.options.display,S.options.mergeDisplay),wr=S.options.useButtonTag?"button":"div",pt=document.createElement(wr);pt.className+="hg-button ".concat(It),(ke=pt.classList).add.apply(ke,U(S.getButtonThemeClasses(ue))),S.setDOMButtonAttributes(ue,function(De,Pr){pt.setAttribute(De,Pr)}),S.activeButtonClass="hg-activeButton",!S.utilities.pointerEventsSupported()||B||Z?B?(pt.ontouchstart=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.ontouchend=function(De){S.handleButtonMouseUp(ue,De)},pt.ontouchcancel=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onclick=function(De){S.setMouseHold(!1),typeof S.options.onKeyReleased!="function"&&S.handleButtonClicked(ue,De)},pt.onmousedown=function(De){typeof S.options.onKeyReleased!="function"||S.isMouseHold||S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onmouseup=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onpointerdown=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onpointerup=function(De){S.handleButtonMouseUp(ue,De)},pt.onpointercancel=function(De){S.handleButtonMouseUp(ue,De)}),pt.setAttribute("data-skBtn",ue);var mn="".concat(S.options.layoutName,"-r").concat(ge,"b").concat(Oe);pt.setAttribute("data-skBtnUID",mn);var Ot=document.createElement("span");Ot.innerHTML=ht,pt.appendChild(Ot),S.buttonElements[ue]||(S.buttonElements[ue]=[]),S.buttonElements[ue].push(pt),pe.appendChild(pt)}),pe=S.parseRowDOMContainers(pe,ge,fe,ye),S.keyboardRowsDOM.appendChild(pe)}),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||B||Z?B?(document.ontouchend=function(K){return S.handleButtonMouseUp(void 0,K)},document.ontouchcancel=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.ontouchstart=function(K){return S.handleKeyboardContainerMouseDown(K)}):B||(document.onmouseup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onmousedown=function(K){return S.handleKeyboardContainerMouseDown(K)}):(document.onpointerup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onpointerdown=function(K){return S.handleKeyboardContainerMouseDown(K)}),this.onInit())}}],$&&ne(H.prototype,$),J&&ne(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}(),_e=le,ve=le}(),h}()},442:function(s){s.exports=n}},o={};function i(s){var c=o[s];if(c!==void 0)return c.exports;var u=o[s]={exports:{}};return r[s].call(u.exports,u,u.exports,i),u.exports}i.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(c,{a:c}),c},i.d=function(s,c){for(var u in c)i.o(c,u)&&!i.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:c[u]})},i.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var a={};return function(){i.r(a),i.d(a,{KeyboardReact:function(){return g},default:function(){return m}}),i(981);var s=i(442),c=i(548),u=i.n(c);function d(y){return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(y)}function h(y,w){var b=Object.keys(y);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(y);w&&(E=E.filter(function(C){return Object.getOwnPropertyDescriptor(y,C).enumerable})),b.push.apply(b,E)}return b}function f(y){for(var w=1;w<arguments.length;w++){var b=arguments[w]!=null?arguments[w]:{};w%2?h(Object(b),!0).forEach(function(E){p(y,E,b[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(b)):h(Object(b)).forEach(function(E){Object.defineProperty(y,E,Object.getOwnPropertyDescriptor(b,E))})}return y}function p(y,w,b){var E;return E=function(C,I){if(d(C)!="object"||!C)return C;var T=C[Symbol.toPrimitive];if(T!==void 0){var P=T.call(C,I||"default");if(d(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(C)}(w,"string"),(w=d(E)=="symbol"?E:E+"")in y?Object.defineProperty(y,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[w]=b,y}var l=function(y){return f(f({},y),{},{keyboardRef:null})},g=function(y){var w=y.baseClass||"react-simple-keyboard",b=s.useRef(null),E=s.useRef(null),C=s.useRef(null),I=s.useRef(y);return s.useEffect(function(){return function(){C.current&&C.current.destroy(),b.current=!1}},[]),s.useEffect(function(){var T=function(j){return f(f({},j),{},{theme:"simple-keyboard ".concat(j.theme||"hg-theme-default")})}(y);if(!b.current){b.current=!0,T.debug&&console.log("ReactSimpleKeyboard: Init");var P=E.current,N=".".concat(w);C.current=new(u())(P||N,T),T.keyboardRef&&T.keyboardRef(C.current)}var L=function(j,W){var q=l(W),k=l(j);return Object.keys(q).filter(function(U){return q[U]!==k[U]})}(I.current,T);if(L.length){var V=C.current;I.current=T,V==null||V.setOptions(T),T.debug&&console.log("ReactSimpleKeyboard - setOptions called due to updated props:",L)}},[b,w,I,y]),s.createElement("div",{className:w,ref:E})},m=g}(),a}()})})(dp);var Db=dp.exports;const Mb=Lu(Db);function fp({onChange:t,keyboardRef:e,layout:n,theme:r}){const[o,i]=x.useState("default"),a=s=>{(s==="{shift}"||s==="{lock}")&&i(o==="default"?"shift":"default")};return v.jsx(Mb,{keyboardRef:s=>e.current=s,layoutName:o,layout:n,theme:r,onChange:t,onKeyPress:a,preventMouseDownDefault:!0})}function hp(){const{subscribe:t,unsubscribe:e,publish:n}=Oa();return{initialize:(s,c)=>{t("openKeyboard",s),t("closeKeyboard",c)},terminate:(s,c)=>{e("openKeyboard",s),e("closeKeyboard",c)},open:s=>{n("openKeyboard",{inputId:s.target.id,inputValue:s.target.value})},close:()=>{n("closeKeyboard")}}}const fr="keyboard-custom-overlap-id";function Lb({enabled:t}){const[e,n]=x.useState(!1),r=x.useRef(null),o=x.useRef(null),i=x.useRef(null),[a,s]=x.useState(),[c,u]=x.useState(0),{initialize:d,terminate:h}=hp(),f=w=>{var b,E;o.current=document.getElementById(w.detail.inputId),(b=r.current)==null||b.setInput(w.detail.inputValue),(E=o.current)==null||E.addEventListener("input",C=>{var T;const I=C.target;(T=r.current)==null||T.setInput(I==null?void 0:I.value)}),u(y()),n(!0)},p=()=>{u(0),n(!1)};x.useEffect(()=>(d(f,p),()=>{h(f,p)}),[e]);const l=w=>{var b,E;if(o&&o.current){g(o.current,w);const C=(b=r.current)==null?void 0:b.getCaretPosition();C&&((E=o.current)==null||E.setSelectionRange(C,C))}},g=(w,b)=>{var I;const E=(I=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:I.set;E==null||E.call(w,b);const C=new Event("input",{bubbles:!0});w.dispatchEvent(C)},m=()=>{var w;if(!a){const b=(w=i.current)==null?void 0:w.getBoundingClientRect();return b&&b.x&&!a&&s(b),b}return a},y=()=>{var T;const w=document.querySelectorAll("#"+fr),b=m(),E=[...w].map(P=>P.getBoundingClientRect()),C=(T=o.current)==null?void 0:T.getBoundingClientRect();E.push(C),E.sort((P,N)=>P.bottom>N.bottom?-1:1);let I=0;return E.every(P=>{if(b&&b.top<P.bottom)return I=P.bottom-b.top+8,!1}),I};return t?v.jsx("div",{className:"relative",style:{height:c},children:v.jsx("div",{ref:i,className:`mobile:hidden absolute bottom-0 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!e&&a&&"hidden"} ${!e&&!a&&"pointer-events-none opacity-0"}`,children:v.jsx(fp,{keyboardRef:r,onChange:l})})}):v.jsx(v.Fragment,{})}const Yo=({id:t,name:e,label:n,description:r,required:o,type:i="text",value:a,placeholder:s,disabled:c,error:u=!1,helperText:d="",onChange:h,beforeIcon:f,afterIcon:p,autoFocus:l,onFocus:g,onBlur:m})=>{const[y,w]=x.useState(d),b=x.useRef(null),[E,C]=x.useState(!1),{open:I,close:T}=hp();x.useEffect(()=>()=>{T()},[]);const P=()=>{b.current&&w(b.current.validationMessage),C(!1),T(),m==null||m()},N=async W=>{C(!0),(async()=>I(W))().then(()=>{var k;return(k=b.current)==null?void 0:k.scrollIntoView({behavior:"smooth",block:"center"})}),g==null||g()},L=W=>{h==null||h(W)},V=x.useId(),j=t??V;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{description:r,disabled:c,htmlFor:j,required:o,children:n}),v.jsx("div",{className:Sn("flex-start box flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs",c?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",E&&!u&&"border-core-primary-500 ring-1 ring-core-primary-500",u&&"border-core-red-500",u&&E&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex flex-row gap-2 self-stretch p-2",children:[f&&v.jsx(vn,{icon:f}),v.jsx("input",{type:i,id:j,name:e,className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",value:a,onChange:L,onBlur:P,ref:b,placeholder:s,onFocus:N,disabled:c,autoFocus:l}),p&&v.jsx(vn,{icon:p})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${d||y?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(Pn.Helper,{error:u,helperText:d||y})})})]})};Yo.displayName="Input";const pp=({id:t,name:e,label:n,required:r,description:o,placeholder:i,value:a,disabled:s,error:c=!1,helperText:u,onChange:d,type:h="date"})=>{const[f,p]=x.useState(!1),l=x.useId(),g=t??l;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{description:o,disabled:s,htmlFor:g,required:r,children:n}),v.jsx("div",{className:Sn("flex-start box relative flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs ring-core-primary-500 ",s?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",f&&!c&&"border-core-primary-500 ring-1 ring-core-primary-500 selection:bg-core-primary-500",c&&"border-core-red-500",c&&f&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex w-full flex-row gap-2 self-stretch p-2",children:[v.jsx("input",{type:h,id:g,name:e,value:a,max:"2200-01-01",className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",placeholder:i,onChange:d,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:s}),v.jsx(vn,{icon:"calendar"})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${u?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-100"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(Pn.Helper,{error:c,helperText:u})})})]})};pp.displayName="Input";function In({children:t}){return v.jsx("div",{className:"h-screen w-screen md:p-6",children:v.jsx("div",{className:"flex h-full max-h-full items-center justify-center md:container [&>*]:grow",children:t})})}function Eo({title:t,isOpen:e,onClose:n,primaryAction:r,secondaryAction:o,children:i}){const[a,s]=x.useState(e),c=x.useRef(null);x.useEffect(()=>{s(e)},[e]),x.useEffect(()=>{const h=c.current;h&&(a?h.show():h.close())},[a]);const u=()=>{n&&n(),s(!1)},d=h=>{h.key==="Escape"&&u()};return v.jsx("div",{className:`fixed inset-0 z-40 min-h-screen items-center bg-gray-500 bg-opacity-25 ${a?"flex":"hidden"}`,children:v.jsx("dialog",{ref:c,onKeyDown:d,className:"scrollbar-hide absolute overflow-auto rounded-lg drop-shadow-md",children:v.jsxs("div",{className:"rounded-lg bg-white md:min-w-[420px]",children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:i}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[r&&v.jsx(rt,{label:r.label??"",onClick:r.action,disabled:r.disabled,pending:r.loading}),o&&v.jsx(rt,{label:o.label??"",onClick:o.action,disabled:o.disabled,pending:o.loading,variant:"secondary"})]})})]})})})}function Fb({option:{label:t},checked:e,onChange:n}){return v.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-sm hover:bg-core-gray-50",children:[v.jsx(Ll,{defaultChecked:e,onChange:n}),v.jsx("p",{children:t})]})}function jb(t){const{t:e}=Ue(),n=x.useRef(null),[r,o]=x.useState(!1);lp(n,o);const[i,a]=x.useState(""),[s,c]=x.useState(t.value.split(";")),{name:u,onChange:d}=t,h=(f,p)=>{let l=[];f?l=[...s,p]:l=s.filter(g=>g!==p),c(l),d&&d(u??"",l.join(";"))};return v.jsxs("div",{ref:n,className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:`flex h-10 items-center justify-between rounded border p-2 ${t.disabled?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!t.disabled&&o(!r),children:[v.jsx("div",{className:`flex gap-1 overflow-hidden text-sm ${t.disabled?"text-core-gray-300":"text-core-gray-800"}`,children:s.map(f=>{var l;const p=(l=t.options.find(g=>g.value===f))==null?void 0:l.label;return v.jsxs("div",{className:"pointer-events-none flex items-center overflow-hidden rounded bg-core-gray-100 px-1.5 py-0.5",children:[v.jsx("p",{className:"truncate",children:p}),v.jsx("span",{className:"pointer-events-auto cursor-pointer",onClick:()=>h(!1,f),children:v.jsx(vn,{icon:"close"})})]},f)})}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:r?"▴":"▾"})]}),v.jsxs("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!r&&"hidden"} py-2`,children:[t.options.length>6&&v.jsx("div",{className:"px-4",children:v.jsx(Yo,{placeholder:`${e("search")}...`,onChange:f=>a(f.target.value)})}),t.options.map(f=>{if(!(i&&!f.label.toLowerCase().includes(i.toLowerCase())))return v.jsx(Fb,{option:f,checked:s.includes(f.value),onChange:p=>h(p,f.value)},`${f.value}_${s.includes(f.value)?"checked":"unchecked"}`)})]})]})]})}function Vb({value:t,max:e,label:n}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-sm mb-1 text-right text-core-gray-500",children:n}),v.jsx("div",{className:"h-1 w-full rounded-full bg-core-gray-200",children:v.jsx("div",{className:"h-1 rounded-full bg-core-primary-500",style:{width:`${Math.min(t/e*100,100)}%`}})})]})}function Ub({value:t,placeholder:e,open:n,setOpen:r,disabled:o}){return v.jsxs("div",{className:`flex items-center justify-between rounded border p-2 ${o?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!o&&r(!n),children:[v.jsx("span",{className:`text-sm ${o?"text-core-gray-300":"text-core-gray-800"}`,children:t||e}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:n?"▴":"▾"})]})}function Gb({label:t,children:e}){return v.jsxs("div",{className:"[&:not(:last-child)]:mb-2",children:[v.jsx("p",{className:"mb-2 px-4 text-xs text-core-gray-500",children:t}),e]})}function Fl(t){return v.jsx("div",{className:"px-4 py-2 text-sm hover:bg-core-gray-50",children:t.label})}function qb(t){const e=x.useRef(null),[n,r]=x.useState(!1),[o,i]=x.useState(t.value??"");lp(e,r);const a=(c,u)=>{i(c),r(!1),t.onChange&&t.onChange(u)},s=x.Children.map(t.children,c=>{if(x.isValidElement(c)){if(c.type===Fl)return v.jsx("div",{onClick:()=>a(c.props.label,c.props.value),children:c});if(c.type===Gb){const u=x.Children.map(c.props.children,d=>{if(x.isValidElement(d)&&d.type===Fl)return v.jsx("div",{onClick:()=>a(d.props.label,d.props.value),children:d})});return x.cloneElement(c,{},...u)}}});return v.jsxs("div",{ref:e,className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{description:t.description,disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsx("div",{children:v.jsxs("div",{className:"relative",children:[v.jsx(Ub,{value:o,placeholder:t.placeholder,open:n,setOpen:r,disabled:t.disabled}),t.children&&v.jsx("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!n&&"hidden"} py-2`,children:s})]})}),v.jsx(Pn.Helper,{helperText:t.helperText})]})}var Hb=Object.defineProperty,$b=(t,e)=>{for(var n in e)Hb(t,n,{get:e[n],enumerable:!0})},Sr={};$b(Sr,{assign:()=>Kb,colors:()=>Ao,createStringInterpolator:()=>Wl,skipAnimation:()=>Ep,to:()=>bp,willAdvance:()=>Kl});var jl=ka(),He=t=>Pa(t,jl),Vl=ka();He.write=t=>Pa(t,Vl);var uc=ka();He.onStart=t=>Pa(t,uc);var Ul=ka();He.onFrame=t=>Pa(t,Ul);var Gl=ka();He.onFinish=t=>Pa(t,Gl);var Pi=[];He.setTimeout=(t,e)=>{const n=He.now()+e,r=()=>{const i=Pi.findIndex(a=>a.cancel==r);~i&&Pi.splice(i,1),_o-=~i?1:0},o={time:n,handler:t,cancel:r};return Pi.splice(gp(n),0,o),_o+=1,mp(),o};var gp=t=>~(~Pi.findIndex(e=>e.time>t)||~Pi.length);He.cancel=t=>{uc.delete(t),Ul.delete(t),Gl.delete(t),jl.delete(t),Vl.delete(t)},He.sync=t=>{Hl=!0,He.batchedUpdates(t),Hl=!1},He.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...o){e=o,He.onStart(n)}return r.handler=t,r.cancel=()=>{uc.delete(n),e=null},r};var ql=typeof window<"u"?window.requestAnimationFrame:()=>{};He.use=t=>ql=t,He.now=typeof performance<"u"?()=>performance.now():Date.now,He.batchedUpdates=t=>t(),He.catch=console.error,He.frameLoop="always",He.advance=()=>{He.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):vp()};var Co=-1,_o=0,Hl=!1;function Pa(t,e){Hl?(e.delete(t),t(0)):(e.add(t),mp())}function mp(){Co<0&&(Co=0,He.frameLoop!=="demand"&&ql(yp))}function Yb(){Co=-1}function yp(){~Co&&(ql(yp),He.batchedUpdates(vp))}function vp(){const t=Co;Co=He.now();const e=gp(Co);if(e&&(wp(Pi.splice(0,e),n=>n.handler()),_o-=e),!_o){Yb();return}uc.flush(),jl.flush(t?Math.min(64,Co-t):16.667),Ul.flush(),Vl.flush(),Gl.flush()}function ka(){let t=new Set,e=t;return{add(n){_o+=e==t&&!t.has(n)?1:0,t.add(n)},delete(n){return _o-=e==t&&t.has(n)?1:0,t.delete(n)},flush(n){e.size&&(t=new Set,_o-=e.size,wp(e,r=>r(n)&&t.add(r)),_o+=t.size,e=t)}}}function wp(t,e){t.forEach(n=>{try{e(n)}catch(r){He.catch(r)}})}function $l(){}var Wb=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),Ae={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function Kr(t,e){if(Ae.arr(t)){if(!Ae.arr(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var nt=(t,e)=>t.forEach(e);function Dr(t,e,n){if(Ae.arr(t)){for(let r=0;r<t.length;r++)e.call(n,t[r],`${r}`);return}for(const r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r)}var tr=t=>Ae.und(t)?[]:Ae.arr(t)?t:[t];function Ba(t,e){if(t.size){const n=Array.from(t);t.clear(),nt(n,e)}}var Na=(t,...e)=>Ba(t,n=>n(...e)),Yl=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Wl,bp,Ao=null,Ep=!1,Kl=$l,Kb=t=>{t.to&&(bp=t.to),t.now&&(He.now=t.now),t.colors!==void 0&&(Ao=t.colors),t.skipAnimation!=null&&(Ep=t.skipAnimation),t.createStringInterpolator&&(Wl=t.createStringInterpolator),t.requestAnimationFrame&&He.use(t.requestAnimationFrame),t.batchedUpdates&&(He.batchedUpdates=t.batchedUpdates),t.willAdvance&&(Kl=t.willAdvance),t.frameLoop&&(He.frameLoop=t.frameLoop)},Ra=new Set,hr=[],zl=[],lc=0,dc={get idle(){return!Ra.size&&!hr.length},start(t){lc>t.priority?(Ra.add(t),He.onStart(zb)):(Cp(t),He(Xl))},advance:Xl,sort(t){if(lc)He.onFrame(()=>dc.sort(t));else{const e=hr.indexOf(t);~e&&(hr.splice(e,1),_p(t))}},clear(){hr=[],Ra.clear()}};function zb(){Ra.forEach(Cp),Ra.clear(),He(Xl)}function Cp(t){hr.includes(t)||_p(t)}function _p(t){hr.splice(Xb(hr,e=>e.priority>t.priority),0,t)}function Xl(t){const e=zl;for(let n=0;n<hr.length;n++){const r=hr[n];lc=r.priority,r.idle||(Kl(r),r.advance(t),r.idle||e.push(r))}return lc=0,zl=hr,zl.length=0,hr=e,hr.length>0}function Xb(t,e){const n=t.findIndex(e);return n<0?t.length:n}var Qb=(t,e,n)=>Math.min(Math.max(n,t),e),Jb={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ir="[-+]?\\d*\\.?\\d+",fc=Ir+"%";function hc(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var Zb=new RegExp("rgb"+hc(Ir,Ir,Ir)),e6=new RegExp("rgba"+hc(Ir,Ir,Ir,Ir)),t6=new RegExp("hsl"+hc(Ir,fc,fc)),n6=new RegExp("hsla"+hc(Ir,fc,fc,Ir)),r6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,o6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,i6=/^#([0-9a-fA-F]{6})$/,a6=/^#([0-9a-fA-F]{8})$/;function s6(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=i6.exec(t))?parseInt(e[1]+"ff",16)>>>0:Ao&&Ao[t]!==void 0?Ao[t]:(e=Zb.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|255)>>>0:(e=e6.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|Ip(e[4]))>>>0:(e=r6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=a6.exec(t))?parseInt(e[1],16)>>>0:(e=o6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=t6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|255)>>>0:(e=n6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|Ip(e[4]))>>>0:null}function Ql(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ap(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,o=2*n-r,i=Ql(o,r,t+1/3),a=Ql(o,r,t),s=Ql(o,r,t-1/3);return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(s*255)<<8}function ki(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Sp(t){return(parseFloat(t)%360+360)%360/360}function Ip(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function pc(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Tp(t){let e=s6(t);if(e===null)return t;e=e||0;const n=(e&4278190080)>>>24,r=(e&16711680)>>>16,o=(e&65280)>>>8,i=(e&255)/255;return`rgba(${n}, ${r}, ${o}, ${i})`}var Da=(t,e,n)=>{if(Ae.fun(t))return t;if(Ae.arr(t))return Da({range:t,output:e,extrapolate:n});if(Ae.str(t.output[0]))return Wl(t);const r=t,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const d=u6(u,i);return c6(u,i[d],i[d+1],o[d],o[d+1],c,a,s,r.map)}};function c6(t,e,n,r,o,i,a,s,c){let u=c?c(t):t;if(u<e){if(a==="identity")return u;a==="clamp"&&(u=e)}if(u>n){if(s==="identity")return u;s==="clamp"&&(u=n)}return r===o?r:e===n?t<=e?r:o:(e===-1/0?u=-u:n===1/0?u=u-e:u=(u-e)/(n-e),u=i(u),r===-1/0?u=-u:o===1/0?u=u+r:u=u*(o-r)+r,u)}function u6(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}var l6=(t,e="end")=>n=>{n=e==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*t,o=e==="end"?Math.floor(r):Math.ceil(r);return Qb(0,1,o/t)},gc=1.70158,mc=gc*1.525,xp=gc+1,Op=2*Math.PI/3,Pp=2*Math.PI/4.5,yc=t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,d6={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:Math.pow(2,10*t-10),easeOutExpo:t=>t===1?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>xp*t*t*t-gc*t*t,easeOutBack:t=>1+xp*Math.pow(t-1,3)+gc*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*((mc+1)*2*t-mc)/2:(Math.pow(2*t-2,2)*((mc+1)*(t*2-2)+mc)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-Math.pow(2,10*t-10)*Math.sin((t*10-10.75)*Op),easeOutElastic:t=>t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*Op)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*Pp))/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*Pp)/2+1,easeInBounce:t=>1-yc(1-t),easeOutBounce:yc,easeInOutBounce:t=>t<.5?(1-yc(1-2*t))/2:(1+yc(2*t-1))/2,steps:l6},Ma=Symbol.for("FluidValue.get"),Bi=Symbol.for("FluidValue.observers"),pr=t=>!!(t&&t[Ma]),Un=t=>t&&t[Ma]?t[Ma]():t,kp=t=>t[Bi]||null;function f6(t,e){t.eventObserved?t.eventObserved(e):t(e)}function La(t,e){const n=t[Bi];n&&n.forEach(r=>{f6(r,e)})}var Bp=class{constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");h6(this,t)}},h6=(t,e)=>Np(t,Ma,e);function Ni(t,e){if(t[Ma]){let n=t[Bi];n||Np(t,Bi,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function Fa(t,e){const n=t[Bi];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[Bi]=null,t.observerRemoved&&t.observerRemoved(r,e)}}var Np=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),vc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,p6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Rp=new RegExp(`(${vc.source})(%|[a-z]+)`,"i"),g6=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,wc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Dp=t=>{const[e,n]=m6(t);if(!e||Yl())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){const o=window.getComputedStyle(document.documentElement).getPropertyValue(n);return o||t}else{if(n&&wc.test(n))return Dp(n);if(n)return n}return t},m6=t=>{const e=wc.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]},Jl,y6=(t,e,n,r,o)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,Mp=t=>{Jl||(Jl=Ao?new RegExp(`(${Object.keys(Ao).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(i=>Un(i).replace(wc,Dp).replace(p6,Tp).replace(Jl,Tp)),n=e.map(i=>i.match(vc).map(Number)),o=n[0].map((i,a)=>n.map(s=>{if(!(a in s))throw Error('The arity of each "output" value must be equal');return s[a]})).map(i=>Da({...t,output:i}));return i=>{var c;const a=!Rp.test(e[0])&&((c=e.find(u=>Rp.test(u)))==null?void 0:c.replace(vc,""));let s=0;return e[0].replace(vc,()=>`${o[s++](i)}${a||""}`).replace(g6,y6)}},Zl="react-spring: ",Lp=t=>{const e=t;let n=!1;if(typeof e!="function")throw new TypeError(`${Zl}once requires a function parameter`);return(...r)=>{n||(e(...r),n=!0)}},v6=Lp(console.warn);function w6(){v6(`${Zl}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var b6=Lp(console.warn);function E6(){b6(`${Zl}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function bc(t){return Ae.str(t)&&(t[0]=="#"||/\d/.test(t)||!Yl()&&wc.test(t)||t in(Ao||{}))}var ed=Yl()?x.useEffect:x.useLayoutEffect,C6=()=>{const t=x.useRef(!1);return ed(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function Fp(){const t=x.useState()[1],e=C6();return()=>{e.current&&t(Math.random())}}function _6(t,e){const[n]=x.useState(()=>({inputs:e,result:t()})),r=x.useRef(),o=r.current;let i=o;return i?e&&i.inputs&&A6(e,i.inputs)||(i={inputs:e,result:t()}):i=n,x.useEffect(()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)},[i]),i.result}function A6(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var jp=t=>x.useEffect(t,S6),S6=[];function Vp(t){const e=x.useRef();return x.useEffect(()=>{e.current=t}),e.current}var ja=Symbol.for("Animated:node"),I6=t=>!!t&&t[ja]===t,Mr=t=>t&&t[ja],td=(t,e)=>Wb(t,ja,e),Ec=t=>t&&t[ja]&&t[ja].getPayload(),Up=class{constructor(){td(this,this)}getPayload(){return this.payload||[]}},Va=class extends Up{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new Va(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return Ae.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Ua=class extends Va{constructor(t){super(0),this._string=null,this._toString=Da({output:[t,t]})}static create(t){return new Ua(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Da({output:[this.getValue(),t]})),this._value=0,super.reset()}},Cc={dependencies:null},_c=class extends Up{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Dr(this.source,(n,r)=>{I6(n)?e[r]=n.getValue(t):pr(n)?e[r]=Un(n):t||(e[r]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&nt(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Dr(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){Cc.dependencies&&pr(t)&&Cc.dependencies.add(t);const e=Ec(t);e&&nt(e,n=>this.add(n))}},Gp=class extends _c{constructor(t){super(t)}static create(t){return new Gp(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((n,r)=>n.setValue(t[r])).some(Boolean):(super.setValue(t.map(T6)),!0)}};function T6(t){return(bc(t)?Ua:Va).create(t)}function nd(t){const e=Mr(t);return e?e.constructor:Ae.arr(t)?Gp:bc(t)?Ua:Va}var qp=(t,e)=>{const n=!Ae.fun(t)||t.prototype&&t.prototype.isReactComponent;return x.forwardRef((r,o)=>{const i=x.useRef(null),a=n&&x.useCallback(l=>{i.current=P6(o,l)},[o]),[s,c]=O6(r,e),u=Fp(),d=()=>{const l=i.current;if(n&&!l)return;(l?e.applyAnimatedValues(l,s.getValue(!0)):!1)===!1&&u()},h=new x6(d,c),f=x.useRef();ed(()=>(f.current=h,nt(c,l=>Ni(l,h)),()=>{f.current&&(nt(f.current.deps,l=>Fa(l,f.current)),He.cancel(f.current.update))})),x.useEffect(d,[]),jp(()=>()=>{const l=f.current;nt(l.deps,g=>Fa(g,l))});const p=e.getComponentProps(s.getValue());return ce.createElement(t,{...p,ref:a})})},x6=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&He.write(this.update)}};function O6(t,e){const n=new Set;return Cc.dependencies=n,t.style&&(t={...t,style:e.createAnimatedStyle(t.style)}),t=new _c(t),Cc.dependencies=null,[t,n]}function P6(t,e){return t&&(Ae.fun(t)?t(e):t.current=e),e}var Hp=Symbol.for("AnimatedComponent"),k6=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:n=o=>new _c(o),getComponentProps:r=o=>o}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=a=>{const s=$p(a)||"Anonymous";return Ae.str(a)?a=i[a]||(i[a]=qp(a,o)):a=a[Hp]||(a[Hp]=qp(a,o)),a.displayName=`Animated(${s})`,a};return Dr(t,(a,s)=>{Ae.arr(t)&&(s=$p(a)),i[s]=i(a)}),{animated:i}},$p=t=>Ae.str(t)?t:t&&Ae.str(t.displayName)?t.displayName:Ae.fun(t)&&t.name||null;function Wo(t,...e){return Ae.fun(t)?t(...e):t}var Ga=(t,e)=>t===!0||!!(e&&t&&(Ae.fun(t)?t(e):tr(t).includes(e))),Yp=(t,e)=>Ae.obj(t)?e&&t[e]:t,Wp=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,B6=t=>t,rd=(t,e=B6)=>{let n=N6;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));const r={};for(const o of n){const i=e(t[o],o);Ae.und(i)||(r[o]=i)}return r},N6=["config","onProps","onStart","onChange","onPause","onResume","onRest"],R6={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function D6(t){const e={};let n=0;if(Dr(t,(r,o)=>{R6[o]||(e[o]=r,n++)}),n)return e}function Kp(t){const e=D6(t);if(e){const n={to:e};return Dr(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function qa(t){return t=Un(t),Ae.arr(t)?t.map(qa):bc(t)?Sr.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function M6(t){for(const e in t)return!0;return!1}function od(t){return Ae.fun(t)||Ae.arr(t)&&Ae.obj(t[0])}function L6(t,e){var n;(n=t.ref)==null||n.delete(t),e==null||e.delete(t)}function F6(t,e){var n;e&&t.ref!==e&&((n=t.ref)==null||n.delete(t),e.add(t),t.ref=e)}var j6={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},id={...j6.default,mass:1,damping:1,easing:d6.linear,clamp:!1},V6=class{constructor(){this.velocity=0,Object.assign(this,id)}};function U6(t,e,n){n&&(n={...n},zp(n,e),e={...n,...e}),zp(t,e),Object.assign(t,e);for(const a in id)t[a]==null&&(t[a]=id[a]);let{frequency:r,damping:o}=t;const{mass:i}=t;return Ae.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*i,t.friction=4*Math.PI*o*i/r),t}function zp(t,e){if(!Ae.und(e.decay))t.duration=void 0;else{const n=!Ae.und(e.tension)||!Ae.und(e.friction);(n||!Ae.und(e.frequency)||!Ae.und(e.damping)||!Ae.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var Xp=[],G6=class{constructor(){this.changed=!1,this.values=Xp,this.toValues=null,this.fromValues=Xp,this.config=new V6,this.immediate=!1}};function Qp(t,{key:e,props:n,defaultProps:r,state:o,actions:i}){return new Promise((a,s)=>{let c,u,d=Ga(n.cancel??(r==null?void 0:r.cancel),e);if(d)p();else{Ae.und(n.pause)||(o.paused=Ga(n.pause,e));let l=r==null?void 0:r.pause;l!==!0&&(l=o.paused||Ga(l,e)),c=Wo(n.delay||0,e),l?(o.resumeQueue.add(f),i.pause()):(i.resume(),f())}function h(){o.resumeQueue.add(f),o.timeouts.delete(u),u.cancel(),c=u.time-He.now()}function f(){c>0&&!Sr.skipAnimation?(o.delayed=!0,u=He.setTimeout(p,c),o.pauseQueue.add(h),o.timeouts.add(u)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(h),o.timeouts.delete(u),t<=(o.cancelId||0)&&(d=!0);try{i.start({...n,callId:t,cancel:d},a)}catch(l){s(l)}}})}var ad=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?Ri(t.get()):e.every(n=>n.noop)?Jp(t.get()):Tr(t.get(),e.every(n=>n.finished)),Jp=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Tr=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),Ri=t=>({value:t,cancelled:!0,finished:!1});function Zp(t,e,n,r){const{callId:o,parentId:i,onRest:a}=e,{asyncTo:s,promise:c}=n;return!i&&t===s&&!e.reset?c:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const u=rd(e,(m,y)=>y==="onRest"?void 0:m);let d,h;const f=new Promise((m,y)=>(d=m,h=y)),p=m=>{const y=o<=(n.cancelId||0)&&Ri(r)||o!==n.asyncId&&Tr(r,!1);if(y)throw m.result=y,h(m),m},l=(m,y)=>{const w=new e0,b=new t0;return(async()=>{if(Sr.skipAnimation)throw Ha(n),b.result=Tr(r,!1),h(b),b;p(w);const E=Ae.obj(m)?{...m}:{...y,to:m};E.parentId=o,Dr(u,(I,T)=>{Ae.und(E[T])&&(E[T]=I)});const C=await r.start(E);return p(w),n.paused&&await new Promise(I=>{n.resumeQueue.add(I)}),C})()};let g;if(Sr.skipAnimation)return Ha(n),Tr(r,!1);try{let m;Ae.arr(t)?m=(async y=>{for(const w of y)await l(w)})(t):m=Promise.resolve(t(l,r.stop.bind(r))),await Promise.all([m.then(d),f]),g=Tr(r.get(),!0,!1)}catch(m){if(m instanceof e0)g=m.result;else if(m instanceof t0)g=m.result;else throw m}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?c:void 0)}return Ae.fun(a)&&He.batchedUpdates(()=>{a(g,r,r.item)}),g})()}function Ha(t,e){Ba(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var e0=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},t0=class extends Error{constructor(){super("SkipAnimationSignal")}},sd=t=>t instanceof cd,q6=1,cd=class extends Bp{constructor(){super(...arguments),this.id=q6++,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Mr(this);return t&&t.getValue()}to(...t){return Sr.to(this,t)}interpolate(...t){return w6(),Sr.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){La(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||dc.sort(this),La(this,{type:"priority",parent:this,priority:t})}},Ko=Symbol.for("SpringPhase"),n0=1,ud=2,ld=4,dd=t=>(t[Ko]&n0)>0,So=t=>(t[Ko]&ud)>0,$a=t=>(t[Ko]&ld)>0,r0=(t,e)=>e?t[Ko]|=ud|n0:t[Ko]&=~ud,o0=(t,e)=>e?t[Ko]|=ld:t[Ko]&=~ld,H6=class extends cd{constructor(t,e){if(super(),this.animation=new G6,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ae.und(t)||!Ae.und(e)){const n=Ae.obj(t)?{...t}:{...e,from:t};Ae.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(So(this)||this._state.asyncTo)||$a(this)}get goal(){return Un(this.animation.to)}get velocity(){const t=Mr(this);return t instanceof Va?t.lastVelocity||0:t.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return dd(this)}get isAnimating(){return So(this)}get isPaused(){return $a(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const r=this.animation;let{toValues:o}=r;const{config:i}=r,a=Ec(r.to);!a&&pr(r.to)&&(o=tr(Un(r.to))),r.values.forEach((u,d)=>{if(u.done)return;const h=u.constructor==Ua?1:a?a[d].lastPosition:o[d];let f=r.immediate,p=h;if(!f){if(p=u.lastPosition,i.tension<=0){u.done=!0;return}let l=u.elapsedTime+=t;const g=r.fromValues[d],m=u.v0!=null?u.v0:u.v0=Ae.arr(i.velocity)?i.velocity[d]:i.velocity;let y;const w=i.precision||(g==h?.005:Math.min(1,Math.abs(h-g)*.001));if(Ae.und(i.duration))if(i.decay){const b=i.decay===!0?.998:i.decay,E=Math.exp(-(1-b)*l);p=g+m/(1-b)*(1-E),f=Math.abs(u.lastPosition-p)<=w,y=m*E}else{y=u.lastVelocity==null?m:u.lastVelocity;const b=i.restVelocity||w/10,E=i.clamp?0:i.bounce,C=!Ae.und(E),I=g==h?u.v0>0:g<h;let T,P=!1;const N=1,L=Math.ceil(t/N);for(let V=0;V<L&&(T=Math.abs(y)>b,!(!T&&(f=Math.abs(h-p)<=w,f)));++V){C&&(P=p==h||p>h==I,P&&(y=-y*E,p=h));const j=-i.tension*1e-6*(p-h),W=-i.friction*.001*y,q=(j+W)/i.mass;y=y+q*N,p=p+y*N}}else{let b=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,l=u.elapsedTime+=t)),b=(i.progress||0)+l/this._memoizedDuration,b=b>1?1:b<0?0:b,u.durationProgress=b),p=g+i.easing(b)*(h-g),y=(p-u.lastPosition)/t,f=b==1}u.lastVelocity=y,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[d].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const s=Mr(this),c=s.getValue();if(e){const u=Un(r.to);(c!==u||n)&&!i.decay?(s.setValue(u),this._onChange(u)):n&&i.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(t){return He.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(So(this)){const{to:t,config:e}=this.animation;He.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return Ae.und(t)?(n=this.queue||[],this.queue=[]):n=[Ae.obj(t)?t:{...e,to:t}],Promise.all(n.map(r=>this._update(r))).then(r=>ad(this,r))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),Ha(this._state,t&&this._lastCallId),He.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:r}=t;n=Ae.obj(n)?n[e]:n,(n==null||od(n))&&(n=void 0),r=Ae.obj(r)?r[e]:r,r==null&&(r=void 0);const o={to:n,from:r};return dd(this)||(t.reverse&&([n,r]=[r,n]),r=Un(r),Ae.und(r)?Mr(this)||this._set(n):this._set(r)),o}_update({...t},e){const{key:n,defaultProps:r}=this;t.default&&Object.assign(r,rd(t,(a,s)=>/^on/.test(s)?Yp(a,n):a)),s0(this,t,"onProps"),Ka(this,"onProps",t,this);const o=this._prepareNode(t);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Qp(++this._lastCallId,{key:n,props:t,defaultProps:r,state:i,actions:{pause:()=>{$a(this)||(o0(this,!0),Na(i.pauseQueue),Ka(this,"onPause",Tr(this,Ya(this,this.animation.to)),this))},resume:()=>{$a(this)&&(o0(this,!1),So(this)&&this._resume(),Na(i.resumeQueue),Ka(this,"onResume",Tr(this,Ya(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(a=>{if(t.loop&&a.finished&&!(e&&a.noop)){const s=i0(t);if(s)return this._update(s,!0)}return a})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Ri(this));const r=!Ae.und(t.to),o=!Ae.und(t.from);if(r||o)if(e.callId>this._lastToId)this._lastToId=e.callId;else return n(Ri(this));const{key:i,defaultProps:a,animation:s}=this,{to:c,from:u}=s;let{to:d=c,from:h=u}=t;o&&!r&&(!e.default||Ae.und(d))&&(d=h),e.reverse&&([d,h]=[h,d]);const f=!Kr(h,u);f&&(s.from=h),h=Un(h);const p=!Kr(d,c);p&&this._focus(d);const l=od(e.to),{config:g}=s,{decay:m,velocity:y}=g;(r||o)&&(g.velocity=0),e.config&&!l&&U6(g,Wo(e.config,i),e.config!==a.config?Wo(a.config,i):void 0);let w=Mr(this);if(!w||Ae.und(d))return n(Tr(this,!0));const b=Ae.und(e.reset)?o&&!e.default:!Ae.und(h)&&Ga(e.reset,i),E=b?h:this.get(),C=qa(d),I=Ae.num(C)||Ae.arr(C)||bc(C),T=!l&&(!I||Ga(a.immediate||e.immediate,i));if(p){const V=nd(d);if(V!==w.constructor)if(T)w=this._set(C);else throw Error(`Cannot animate between ${w.constructor.name} and ${V.name}, as the "to" prop suggests`)}const P=w.constructor;let N=pr(d),L=!1;if(!N){const V=b||!dd(this)&&f;(p||V)&&(L=Kr(qa(E),C),N=!L),(!Kr(s.immediate,T)&&!T||!Kr(g.decay,m)||!Kr(g.velocity,y))&&(N=!0)}if(L&&So(this)&&(s.changed&&!b?N=!0:N||this._stop(c)),!l&&((N||pr(c))&&(s.values=w.getPayload(),s.toValues=pr(d)?null:P==Ua?[1]:tr(C)),s.immediate!=T&&(s.immediate=T,!T&&!b&&this._set(c)),N)){const{onRest:V}=s;nt(Y6,W=>s0(this,e,W));const j=Tr(this,Ya(this,c));Na(this._pendingCalls,j),this._pendingCalls.add(n),s.changed&&He.batchedUpdates(()=>{var W;s.changed=!b,V==null||V(j,this),b?Wo(a.onRest,j):(W=s.onStart)==null||W.call(s,j,this)})}b&&this._set(E),l?n(Zp(e.to,e,this._state,this)):N?this._start():So(this)&&!p?this._pendingCalls.add(n):n(Jp(E))}_focus(t){const e=this.animation;t!==e.to&&(kp(this)&&this._detach(),e.to=t,kp(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;pr(e)&&(Ni(e,this),sd(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;pr(t)&&Fa(t,this)}_set(t,e=!0){const n=Un(t);if(!Ae.und(n)){const r=Mr(this);if(!r||!Kr(n,r.getValue())){const o=nd(n);!r||r.constructor!=o?td(this,o.create(n)):r.setValue(n),r&&He.batchedUpdates(()=>{this._onChange(n,e)})}}return Mr(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,Ka(this,"onStart",Tr(this,Ya(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),Wo(this.animation.onChange,t,this)),Wo(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Mr(this).reset(Un(t.to)),t.immediate||(t.fromValues=t.values.map(e=>e.lastPosition)),So(this)||(r0(this,!0),$a(this)||this._resume())}_resume(){Sr.skipAnimation?this.finish():dc.start(this)}_stop(t,e){if(So(this)){r0(this,!1);const n=this.animation;nt(n.values,o=>{o.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),La(this,{type:"idle",parent:this});const r=e?Ri(this.get()):Tr(this.get(),Ya(this,t??n.to));Na(this._pendingCalls,r),n.changed&&(n.changed=!1,Ka(this,"onRest",r,this))}}};function Ya(t,e){const n=qa(e),r=qa(t.get());return Kr(r,n)}function i0(t,e=t.loop,n=t.to){const r=Wo(e);if(r){const o=r!==!0&&Kp(r),i=(o||t).reverse,a=!o||o.reset;return Wa({...t,loop:e,default:!1,pause:void 0,to:!i||od(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function Wa(t){const{to:e,from:n}=t=Kp(t),r=new Set;return Ae.obj(e)&&a0(e,r),Ae.obj(n)&&a0(n,r),t.keys=r.size?Array.from(r):null,t}function $6(t){const e=Wa(t);return Ae.und(e.default)&&(e.default=rd(e)),e}function a0(t,e){Dr(t,(n,r)=>n!=null&&e.add(r))}var Y6=["onStart","onRest","onChange","onPause","onResume"];function s0(t,e,n){t.animation[n]=e[n]!==Wp(e,n)?Yp(e[n],t.key):void 0}function Ka(t,e,...n){var r,o,i,a;(o=(r=t.animation)[e])==null||o.call(r,...n),(a=(i=t.defaultProps)[e])==null||a.call(i,...n)}var W6=["onStart","onChange","onRest"],K6=1,z6=class{constructor(t,e){this.id=K6++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];Ae.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(Wa(t)),this}start(t){let{queue:e}=this;return t?e=tr(t).map(Wa):this.queue=[],this._flush?this._flush(this,e):(h0(this,e),fd(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;nt(tr(e),r=>n[r].stop(!!t))}else Ha(this._state,this._lastAsyncId),this.each(n=>n.stop(!!t));return this}pause(t){if(Ae.und(t))this.start({pause:!0});else{const e=this.springs;nt(tr(t),n=>e[n].pause())}return this}resume(t){if(Ae.und(t))this.start({pause:!1});else{const e=this.springs;nt(tr(t),n=>e[n].resume())}return this}each(t){Dr(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,Ba(t,([s,c])=>{c.value=this.get(),s(c,this,this._item)}));const i=!r&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Ba(e,([s,c])=>{c.value=a,s(c,this,this._item)}),i&&(this._started=!1,Ba(n,([s,c])=>{c.value=a,s(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;He.onFrame(this._onFrame)}};function fd(t,e){return Promise.all(e.map(n=>c0(t,n))).then(n=>ad(t,n))}async function c0(t,e,n){const{keys:r,to:o,from:i,loop:a,onRest:s,onResolve:c}=e,u=Ae.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),i===!1&&(e.from=null);const d=Ae.arr(o)||Ae.fun(o)?o:void 0;d?(e.to=void 0,e.onRest=void 0,u&&(u.onRest=void 0)):nt(W6,g=>{const m=e[g];if(Ae.fun(m)){const y=t._events[g];e[g]=({finished:w,cancelled:b})=>{const E=y.get(m);E?(w||(E.finished=!1),b&&(E.cancelled=!0)):y.set(m,{value:null,finished:w||!1,cancelled:b||!1})},u&&(u[g]=e[g])}});const h=t._state;e.pause===!h.paused?(h.paused=e.pause,Na(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const f=(r||Object.keys(t.springs)).map(g=>t.springs[g].start(e)),p=e.cancel===!0||Wp(e,"cancel")===!0;(d||p&&h.asyncId)&&f.push(Qp(++t._lastAsyncId,{props:e,state:h,actions:{pause:$l,resume:$l,start(g,m){p?(Ha(h,t._lastAsyncId),m(Ri(t))):(g.onRest=s,m(Zp(d,g,h,t)))}}})),h.paused&&await new Promise(g=>{h.resumeQueue.add(g)});const l=ad(t,await Promise.all(f));if(a&&l.finished&&!(n&&l.noop)){const g=i0(e,a,o);if(g)return h0(t,[g]),c0(t,g,!0)}return c&&He.batchedUpdates(()=>c(l,t,t.item)),l}function u0(t,e){const n={...t.springs};return e&&nt(tr(e),r=>{Ae.und(r.keys)&&(r=Wa(r)),Ae.obj(r.to)||(r={...r,to:void 0}),f0(n,r,o=>d0(o))}),l0(t,n),n}function l0(t,e){Dr(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Ni(n,t))})}function d0(t,e){const n=new H6;return n.key=t,e&&Ni(n,e),n}function f0(t,e,n){e.keys&&nt(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function h0(t,e){nt(e,n=>{f0(t.springs,n,r=>d0(r,t))})}var Ac=({children:t,...e})=>{const n=x.useContext(Sc),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=_6(()=>({pause:r,immediate:o}),[r,o]);const{Provider:i}=Sc;return ce.createElement(i,{value:e},t)},Sc=X6(Ac,{});Ac.Provider=Sc.Provider,Ac.Consumer=Sc.Consumer;function X6(t,e){return Object.assign(t,ce.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var Q6=()=>{const t=[],e=function(r){E6();const o=[];return nt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=n(r,i,a);s&&o.push(i.start(s))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){const o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return nt(t,r=>r.pause(...arguments)),this},e.resume=function(){return nt(t,r=>r.resume(...arguments)),this},e.set=function(r){nt(t,(o,i)=>{const a=Ae.fun(r)?r(i,o):r;a&&o.set(a)})},e.start=function(r){const o=[];return nt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=this._getProps(r,i,a);s&&o.push(i.start(s))}}),o},e.stop=function(){return nt(t,r=>r.stop(...arguments)),this},e.update=function(r){return nt(t,(o,i)=>o.update(this._getProps(r,o,i))),this};const n=function(r,o,i){return Ae.fun(r)?r(i,o):r};return e._getProps=n,e};function J6(t,e,n){const r=Ae.fun(e)&&e;r&&!n&&(n=[]);const o=x.useMemo(()=>r||arguments.length==3?Q6():void 0,[]),i=x.useRef(0),a=Fp(),s=x.useMemo(()=>({ctrls:[],queue:[],flush(y,w){const b=u0(y,w);return i.current>0&&!s.queue.length&&!Object.keys(b).some(C=>!y.springs[C])?fd(y,w):new Promise(C=>{l0(y,b),s.queue.push(()=>{C(fd(y,w))}),a()})}}),[]),c=x.useRef([...s.ctrls]),u=[],d=Vp(t)||0;x.useMemo(()=>{nt(c.current.slice(t,d),y=>{L6(y,o),y.stop(!0)}),c.current.length=t,h(d,t)},[t]),x.useMemo(()=>{h(0,Math.min(d,t))},n);function h(y,w){for(let b=y;b<w;b++){const E=c.current[b]||(c.current[b]=new z6(null,s.flush)),C=r?r(b,E):e[b];C&&(u[b]=$6(C))}}const f=c.current.map((y,w)=>u0(y,u[w])),p=x.useContext(Ac),l=Vp(p),g=p!==l&&M6(p);ed(()=>{i.current++,s.ctrls=c.current;const{queue:y}=s;y.length&&(s.queue=[],nt(y,w=>w())),nt(c.current,(w,b)=>{o==null||o.add(w),g&&w.start({default:p});const E=u[b];E&&(F6(w,E.ref),w.ref?w.queue.push(E):w.start(E))})}),jp(()=>()=>{nt(s.ctrls,y=>y.stop(!0))});const m=f.map(y=>({...y}));return o?[m,o]:m}function Z6(t,e){const n=Ae.fun(t),[[r],o]=J6(1,n?t:[t],n?[]:e);return n||arguments.length==2?[r,o]:r}var eE=class extends cd{constructor(t,e){super(),this.source=t,this.idle=!0,this._active=new Set,this.calc=Da(...e);const n=this._get(),r=nd(n);td(this,r.create(n))}advance(t){const e=this._get(),n=this.get();Kr(e,n)||(Mr(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&p0(this._active)&&hd(this)}_get(){const t=Ae.arr(this.source)?this.source.map(Un):tr(Un(this.source));return this.calc(...t)}_start(){this.idle&&!p0(this._active)&&(this.idle=!1,nt(Ec(this),t=>{t.done=!1}),Sr.skipAnimation?(He.batchedUpdates(()=>this.advance()),hd(this)):dc.start(this))}_attach(){let t=1;nt(tr(this.source),e=>{pr(e)&&Ni(e,this),sd(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){nt(tr(this.source),t=>{pr(t)&&Fa(t,this)}),this._active.clear(),hd(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=tr(this.source).reduce((e,n)=>Math.max(e,(sd(n)?n.priority:0)+1),0))}};function tE(t){return t.idle!==!1}function p0(t){return!t.size||Array.from(t).every(tE)}function hd(t){t.idle||(t.idle=!0,nt(Ec(t),e=>{e.done=!0}),La(t,{type:"idle",parent:t}))}Sr.assign({createStringInterpolator:Mp,to:(t,e)=>new eE(t,e)});var g0=/^--/;function nE(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!g0.test(t)&&!(za.hasOwnProperty(t)&&za[t])?e+"px":(""+e).trim()}var m0={};function rE(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:s,...c}=e,u=Object.values(c),d=Object.keys(c).map(h=>n||t.hasAttribute(h)?h:m0[h]||(m0[h]=h.replace(/([A-Z])/g,f=>"-"+f.toLowerCase())));o!==void 0&&(t.textContent=o);for(const h in r)if(r.hasOwnProperty(h)){const f=nE(h,r[h]);g0.test(h)?t.style.setProperty(h,f):t.style[h]=f}d.forEach((h,f)=>{t.setAttribute(h,u[f])}),i!==void 0&&(t.scrollTop=i),a!==void 0&&(t.scrollLeft=a),s!==void 0&&t.setAttribute("viewBox",s)}var za={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oE=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),iE=["Webkit","Ms","Moz","O"];za=Object.keys(za).reduce((t,e)=>(iE.forEach(n=>t[oE(n,e)]=t[e]),t),za);var aE=/^(matrix|translate|scale|rotate|skew)/,sE=/^(translate)/,cE=/^(rotate|skew)/,pd=(t,e)=>Ae.num(t)&&t!==0?t+e:t,Ic=(t,e)=>Ae.arr(t)?t.every(n=>Ic(n,e)):Ae.num(t)?t===e:parseFloat(t)===e,uE=class extends _c{constructor({x:t,y:e,z:n,...r}){const o=[],i=[];(t||e||n)&&(o.push([t||0,e||0,n||0]),i.push(a=>[`translate3d(${a.map(s=>pd(s,"px")).join(",")})`,Ic(a,0)])),Dr(r,(a,s)=>{if(s==="transform")o.push([a||""]),i.push(c=>[c,c===""]);else if(aE.test(s)){if(delete r[s],Ae.und(a))return;const c=sE.test(s)?"px":cE.test(s)?"deg":"";o.push(tr(a)),i.push(s==="rotate3d"?([u,d,h,f])=>[`rotate3d(${u},${d},${h},${pd(f,c)})`,Ic(f,0)]:u=>[`${s}(${u.map(d=>pd(d,c)).join(",")})`,Ic(u,s.startsWith("scale")?1:0)])}}),o.length&&(r.transform=new lE(o,i)),super(r)}},lE=class extends Bp{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return nt(this.inputs,(n,r)=>{const o=Un(n[0]),[i,a]=this.transforms[r](Ae.arr(o)?o:n.map(Un));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){t==1&&nt(this.inputs,e=>nt(e,n=>pr(n)&&Ni(n,this)))}observerRemoved(t){t==0&&nt(this.inputs,e=>nt(e,n=>pr(n)&&Fa(n,this)))}eventObserved(t){t.type=="change"&&(this._value=null),La(this,t)}},dE=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Sr.assign({batchedUpdates:vi.unstable_batchedUpdates,createStringInterpolator:Mp,colors:Jb});var fE=k6(dE,{applyAnimatedValues:rE,createAnimatedStyle:t=>new uE(t),getComponentProps:({scrollTop:t,scrollLeft:e,...n})=>n}),hE=fE.animated;function Tc(t){const{rows:e}=t,n=Z6({from:{opacity:0},to:{opacity:1}});return v.jsxs(hE.div,{style:n,className:"flex w-full animate-pulse flex-col items-start space-y-3",children:[[...Array(e)].map((r,o)=>v.jsx("div",{className:"h-10 w-full rounded-lg bg-gray-100 p-5"},`skeleton_rows_${o}`)),v.jsx("span",{className:"sr-only",children:"Loading..."})]})}function y0({children:t,offset:e,max:n=4,initialCollapsed:r=!0}){const o=x.useRef(null),[i,a]=x.useState(0),[s,c]=x.useState(r),u=s&&x.Children.count(t)>n?n:x.Children.count(t);x.useEffect(()=>{o.current&&(i?s?o.current.style.marginBottom=`-${i-(i/u+(u-1)*(e??i/u/7.5))}px`:o.current.style.marginBottom="unset":a(o.current.offsetHeight))},[s,i]);const d=f=>(100-(u-1-f))/100,h=f=>f*(i/u-(e??i/u/7.5));return v.jsx("div",{ref:o,className:"hover:cursor-pointer",onClick:()=>u>1&&c(!s),children:x.Children.map(x.Children.toArray(t).slice(-1*u),(f,p)=>v.jsx("div",{className:`${!s&&"[&:not(:last-child)]:mb-1"} h-full w-full transition-all duration-300 ease-in-out`,style:{transform:s&&u>1?`scaleX(${d(p)}) translateY(-${h(p)}px)`:void 0},children:f}))})}const pE=Oi("flex flex-shrink bg-white rounded-full transform transition-transform ease-out",{variants:{size:{md:"w-3 h-3",lg:"w-7 h-7"}}}),gE=Oi("",{variants:{size:{md:"pr-4",lg:"pr-6"}}}),mE=({id:t,disabled:e,onChange:n,defaultChecked:r=!1,size:o="md"})=>{const i=e,[a,s]=x.useState(r),[c,u]=x.useState(!1),d=()=>{i||(s(!a),n&&n())},h=()=>{e||u(!0)},f=()=>{u(!1)},p=Sn("relative py-0.5 pl-0.5 rounded-full",{"ring-2 ring-core-white-900 outline-core-primary-500 outline outline-2 outline-offset-2":c,"bg-core-primary-500 hover:bg-core-primary-600":a&&!e,"bg-core-gray-200 hover:bg-core-gray-300":!a&&!e,"bg-core-gray-100":e},gE({size:o})),l=o==="lg"?"translate-x-[1.375rem] ease-out":"translate-x-3.5 ease-out";return v.jsxs("div",{className:`inline-flex items-center py-1 ${i?"pointer-events-none":"cursor-pointer "}`,onClick:d,onFocus:h,children:[v.jsx("input",{className:"sr-only ",id:t,type:"checkbox",checked:a,disabled:i,onBlur:f,onChange:d,onFocus:h}),v.jsx("div",{className:p,children:v.jsx("div",{className:Sn(pE({size:o}),`${a?l:""} ${i?"shadow-none":"shadow-xs"}`)})})]})},gd=({id:t,children:e,size:n="md",description:r,toggleLeft:o=!0,disabled:i,helperText:a,defaultChecked:s=!1,label:c,required:u=!1,tooltip:d,onChange:h})=>{const f=x.useId(),p=t??f;return v.jsxs("div",{className:`flex ${o?"flex-row":"flex-row-reverse"} items-start gap-3`,children:[v.jsx(mE,{disabled:i,defaultChecked:s,id:p,size:n,onChange:h}),e||(c||r||d||a)&&v.jsxs("div",{className:"inline-flex w-full flex-col self-center",children:[v.jsx(Pn,{className:Sn("font-normal"),description:r,required:u,tooltip:d,htmlFor:p,disabled:i,children:c}),v.jsx(Pn.Helper,{disabled:i,helperText:a})]})]})};gd.displayName="Switch";const v0=x.createContext(null);function yE(t=!1){const e=x.useContext(v0);if(!e&&!t)throw new Error("Switch.Item must be used within a SwitchGroup or SwitchGroup.Root");return e}const w0=x.forwardRef(({toggleLeft:t=!1,size:e="md",children:n,description:r,disabled:o,helperText:i,id:a,label:s,required:c,tooltip:u},d)=>{const h=x.useId(),f=a??h,p=s??r??u??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(Pn,{className:"cursor-default",description:r,required:c,tooltip:u,htmlFor:f,disabled:o,children:s}),v.jsx(Pn.Helper,{disabled:o,helperText:i})]}):null;return v.jsx(v0.Provider,{value:{disabled:o,toggleLeft:t,size:e},children:v.jsxs("div",{ref:d,"aria-describedby":i?`${f}__describer`:void 0,"aria-labelledby":s?`${f}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[s??i??r??u?v.jsx("div",{className:"flex flex-col",children:p}):null,n?v.jsx("div",{className:Sn("flex flex-col gap-2"),children:n}):null]})})});w0.displayName="SwitchGroup",Object.assign(w0,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=yE(),{disabled:o,size:i,toggleLeft:a}=r??{};return v.jsx(gd,{toggleLeft:a,disabled:t??o,label:e,defaultChecked:n,size:i})}});const vE=({children:t})=>v.jsx("div",{className:"fixed bottom-0 z-10 flex h-[70px] w-full border-b-0 border-t border-gray-100 bg-white lg:bottom-auto lg:top-0 lg:h-[50px] lg:border-b lg:border-t-0",children:t}),wE=({id:t,label:e,icon:n,pathname:r,activeTab:o,setActiveTab:i})=>v.jsx(X1,{className:"flex flex-grow items-center",to:r??"",children:v.jsxs("button",{className:`flex h-full flex-grow flex-col items-center justify-center gap-1 border-b-0 border-t-2 px-3 py-3 text-xs focus:outline-none lg:flex-row lg:border-b-2 lg:border-t-0 lg:text-sm ${o===t?"border-core-primary-500 text-core-primary-500":"border-transparent text-core-gray-500 hover:text-core-gray-800"}`,onClick:()=>i(t),children:[v.jsx(vn,{icon:n,className:"mr-2",variant:o===t?"discovery":"secondary"}),e]})}),b0=Object.prototype.toString;function md(t){switch(b0.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Xr(t,Error)}}function Di(t,e){return b0.call(t)===`[object ${e}]`}function E0(t){return Di(t,"ErrorEvent")}function C0(t){return Di(t,"DOMError")}function bE(t){return Di(t,"DOMException")}function zr(t){return Di(t,"String")}function yd(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function vd(t){return t===null||yd(t)||typeof t!="object"&&typeof t!="function"}function Mi(t){return Di(t,"Object")}function xc(t){return typeof Event<"u"&&Xr(t,Event)}function EE(t){return typeof Element<"u"&&Xr(t,Element)}function CE(t){return Di(t,"RegExp")}function Oc(t){return!!(t&&t.then&&typeof t.then=="function")}function _E(t){return Mi(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Xr(t,e){try{return t instanceof e}catch{return!1}}function _0(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Li(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function A0(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const o=t[r];try{_0(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function AE(t,e,n=!1){return zr(t)?CE(e)?e.test(t):zr(e)?n?t===e:t.includes(e):!1:!1}function zo(t,e=[],n=!1){return e.some(r=>AE(t,r,n))}function SE(t,e,n=250,r,o,i,a){if(!i.exception||!i.exception.values||!a||!Xr(a.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=IE(wd(t,e,o,a.originalException,r,i.exception.values,s,0),n))}function wd(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let c=[...i];if(Xr(r[o],Error)){S0(a,s);const u=t(e,r[o]),d=c.length;I0(u,o,d,s),c=wd(t,e,n,r[o],o,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Xr(u,Error)){S0(a,s);const h=t(e,u),f=c.length;I0(h,`errors[${d}]`,f,s),c=wd(t,e,n,u,o,[h,...c],h,f)}}),c}function S0(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function I0(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function IE(t,e){return t.map(n=>(n.value&&(n.value=Li(n.value,e)),n))}function T0(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Xo="8.34.0",gt=globalThis;function Pc(t,e,n){const r=gt,o=r.__SENTRY__=r.__SENTRY__||{},i=o[Xo]=o[Xo]||{};return i[t]||(i[t]=e())}const Fi=gt,TE=80;function Qo(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,o=[];let i=0,a=0;const s=" > ",c=s.length;let u;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||TE;for(;n&&i++<r&&(u=xE(n,d),!(u==="html"||i>1&&a+o.length*c+u.length>=h));)o.push(u),a+=u.length,n=n.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function xE(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Fi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(o&&o.length)o.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&zr(a)){const s=a.split(/\s+/);for(const c of s)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const a of i){const s=n.getAttribute(a);s&&r.push(`[${a}="${s}"]`)}return r.join("")}function OE(){try{return Fi.document.location.href}catch{return""}}function PE(t){return Fi.document&&Fi.document.querySelector?Fi.document.querySelector(t):null}function x0(t){if(!Fi.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const ji=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kE="Sentry Logger ",bd=["debug","info","warn","error","log","assert","trace"],kc={};function Ed(t){if(!("console"in gt))return t();const e=gt.console,n={},r=Object.keys(kc);r.forEach(o=>{const i=kc[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function BE(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ji?bd.forEach(n=>{e[n]=(...r)=>{t&&Ed(()=>{gt.console[n](`${kE}[${n}]:`,...r)})}}):bd.forEach(n=>{e[n]=()=>{}}),e}const Ie=Pc("logger",BE),NE=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function RE(t){return t==="http"||t==="https"}function Xa(t,e=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function DE(t){const e=NE.exec(t);if(!e){Ed(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,o="",i="",a="",s=""]=e.slice(1);let c="",u=s;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const h=u.match(/^\d+/);h&&(u=h[0])}return O0({host:i,pass:o,path:c,projectId:u,port:a,protocol:n,publicKey:r})}function O0(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ME(t){if(!ji)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(Ie.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?RE(r)?e&&isNaN(parseInt(e,10))?(Ie.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(Ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function LE(t){const e=typeof t=="string"?DE(t):O0(t);if(!(!e||!ME(e)))return e}class Lr extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function nr(t,e,n){if(!(e in t))return;const r=t[e],o=n(r);typeof o=="function"&&P0(o,r),t[e]=o}function gr(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{ji&&Ie.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function P0(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,gr(t,"__sentry_original__",e)}catch{}}function Cd(t){return t.__sentry_original__}function FE(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function k0(t){if(md(t))return{message:t.message,name:t.name,stack:t.stack,...N0(t)};if(xc(t)){const e={type:t.type,target:B0(t.target),currentTarget:B0(t.currentTarget),...N0(t)};return typeof CustomEvent<"u"&&Xr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function B0(t){try{return EE(t)?Qo(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function N0(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function jE(t,e=40){const n=Object.keys(k0(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Li(r,e);for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(!(i.length>e))return o===n.length?i:Li(i,e)}return""}function Tn(t){return _d(t,new Map)}function _d(t,e){if(VE(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const o of Object.getOwnPropertyNames(t))typeof t[o]<"u"&&(r[o]=_d(t[o],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(o=>{r.push(_d(o,e))}),r}return t}function VE(t){if(!Mi(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const R0=50,Jo="?",D0=/\(error: (.*)\)/,M0=/captureMessage|captureException/;function UE(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const i=[],a=n.split(`
101
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(H,$){($==null||$>H.length)&&($=H.length);for(var J=0,S=new Array($);J<$;J++)S[J]=H[J];return S}function te(H){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},te(H)}function oe(H,$){var J=Object.keys(H);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(H);$&&(S=S.filter(function(M){return Object.getOwnPropertyDescriptor(H,M).enumerable})),J.push.apply(J,S)}return J}function ne(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,we(S.key),S)}}function se(H,$,J){return($=we($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function we(H){var $=function(J,S){if(te(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(te(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return te($)=="symbol"?$:$+""}var le=function(){return H=function S(M,F){var B=this;if(function(fe,ye){if(!(fe instanceof ye))throw new TypeError("Cannot call a class as a function")}(this,S),se(this,"input",void 0),se(this,"options",void 0),se(this,"utilities",void 0),se(this,"caretPosition",void 0),se(this,"caretPositionEnd",void 0),se(this,"keyboardDOM",void 0),se(this,"keyboardPluginClasses",void 0),se(this,"keyboardDOMClass",void 0),se(this,"buttonElements",void 0),se(this,"currentInstanceName",void 0),se(this,"allKeyboardInstances",void 0),se(this,"keyboardInstanceNames",void 0),se(this,"isFirstKeyboardInstance",void 0),se(this,"physicalKeyboard",void 0),se(this,"modules",void 0),se(this,"activeButtonClass",void 0),se(this,"holdInteractionTimeout",void 0),se(this,"holdTimeout",void 0),se(this,"isMouseHold",void 0),se(this,"initialized",void 0),se(this,"candidateBox",void 0),se(this,"keyboardRowsDOM",void 0),se(this,"defaultName","default"),se(this,"activeInputElement",null),se(this,"handleParams",function(fe,ye){var ue,Oe,ke;if(typeof fe=="string")ue=fe.split(".").join(""),Oe=document.querySelector(".".concat(ue)),ke=ye;else if(fe instanceof HTMLDivElement){if(!fe.className)throw console.warn("Any DOM element passed as parameter must have a class."),new Error("KEYBOARD_DOM_CLASS_ERROR");ue=fe.className.split(" ")[0],Oe=fe,ke=ye}else ue="simple-keyboard",Oe=document.querySelector(".".concat(ue)),ke=fe;return{keyboardDOMClass:ue,keyboardDOM:Oe,options:ke}}),se(this,"getOptions",function(){return B.options}),se(this,"getCaretPosition",function(){return B.caretPosition}),se(this,"getCaretPositionEnd",function(){return B.caretPositionEnd}),se(this,"registerModule",function(fe,ye){B.modules[fe]||(B.modules[fe]={}),ye(B.modules[fe])}),se(this,"getKeyboardClassString",function(){for(var fe=arguments.length,ye=new Array(fe),ue=0;ue<fe;ue++)ye[ue]=arguments[ue];return[B.keyboardDOMClass].concat(ye).filter(function(Oe){return!!Oe}).join(" ")}),typeof window<"u"){var Q=this.handleParams(M,F),Z=Q.keyboardDOMClass,ee=Q.keyboardDOM,K=Q.options,ge=K===void 0?{}:K;this.utilities=new E({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=ee,this.options=function(fe){for(var ye=1;ye<arguments.length;ye++){var ue=arguments[ye]!=null?arguments[ye]:{};ye%2?oe(Object(ue),!0).forEach(function(Oe){se(fe,Oe,ue[Oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(ue)):oe(Object(ue)).forEach(function(Oe){Object.defineProperty(fe,Oe,Object.getOwnPropertyDescriptor(ue,Oe))})}return fe}({layoutName:"default",theme:"hg-theme-default",inputName:"default",preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},ge),this.keyboardPluginClasses="",E.bindMethods(S,this);var be=this.options.inputName,pe=be===void 0?this.defaultName:be;if(this.input={},this.input[pe]="",this.keyboardDOMClass=Z,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new N({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new k({utilities:this.utilities,options:this.options}):null,!this.keyboardDOM)throw console.warn('".'.concat(Z,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}},$=[{key:"setCaretPosition",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;this.caretPosition=S,this.caretPositionEnd=M}},{key:"getInputCandidates",value:function(S){var M=this,F=this.options,B=F.layoutCandidates,Q=F.layoutCandidatesCaseSensitiveMatch;if(!B||te(B)!=="object")return{};var Z=Object.keys(B).filter(function(ge){var be=S.substring(0,M.getCaretPositionEnd()||0)||S,pe=new RegExp("".concat(M.utilities.escapeRegex(ge),"$"),Q?"g":"gi");return!!U(be.matchAll(pe)).length});if(Z.length>1){var ee=Z.sort(function(ge,be){return be.length-ge.length})[0];return{candidateKey:ee,candidateValue:B[ee]}}if(Z.length){var K=Z[0];return{candidateKey:K,candidateValue:B[K]}}return{}}},{key:"showCandidatesBox",value:function(S,M,F){var B=this;this.candidateBox&&this.candidateBox.show({candidateValue:M,targetElement:F,onSelect:function(Q,Z){var ee=B.options,K=ee.layoutCandidatesCaseSensitiveMatch,ge=ee.disableCandidateNormalization,be=ee.enableLayoutCandidatesKeyPress,pe=Q;ge||(pe=Q.normalize("NFD")),typeof B.options.beforeInputUpdate=="function"&&B.options.beforeInputUpdate(B);var fe=B.getInput(B.options.inputName,!0),ye=B.getCaretPositionEnd()||0,ue=fe.substring(0,ye||0)||fe,Oe=new RegExp("".concat(B.utilities.escapeRegex(S),"$"),K?"g":"gi"),ke=ue.replace(Oe,pe),at=fe.replace(ue,ke),ze=ke.length-ue.length,It=(ye||fe.length)+ze;It<0&&(It=0),B.setInput(at,B.options.inputName,!0),B.setCaretPosition(It),be&&typeof B.options.onKeyPress=="function"&&B.options.onKeyPress(Q,Z),typeof B.options.onChange=="function"&&B.options.onChange(B.getInput(B.options.inputName,!0),Z),typeof B.options.onChangeAll=="function"&&B.options.onChangeAll(B.getAllInputs(),Z)}})}},{key:"handleButtonClicked",value:function(S,M){var F=this.options,B=F.inputName,Q=B===void 0?this.defaultName:B,Z=F.debug;if(S!=="{//}"){this.input[Q]||(this.input[Q]=""),typeof this.options.beforeInputUpdate=="function"&&this.options.beforeInputUpdate(this);var ee=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(S)&&this.activeInputElement&&this.input[Q]&&this.input[Q]===ee&&this.caretPosition===0&&this.caretPositionEnd===ee.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(S,M);if(typeof this.options.onKeyPress=="function"&&this.options.onKeyPress(S,M),this.input[Q]!==ee&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(ee))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,ee))return;var K=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(K,this.options.inputName,!0),Z&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),M==null?void 0:M.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),typeof this.options.onChange=="function"&&this.options.onChange(this.getInput(this.options.inputName,!0),M),typeof this.options.onChangeAll=="function"&&this.options.onChangeAll(this.getAllInputs(),M),M!=null&&M.target&&this.options.enableLayoutCandidates){var ge,be=this.getInputCandidates(ee),pe=be.candidateKey,fe=be.candidateValue;pe&&fe?this.showCandidatesBox(pe,fe,this.keyboardDOM):(ge=this.candidateBox)===null||ge===void 0||ge.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),Z&&console.log("Key pressed:",S)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(S){this.options.syncInstanceInputs?this.dispatch(function(M){M.isMouseHold=S}):this.isMouseHold=S}},{key:"handleButtonMouseDown",value:function(S,M){var F=this;M&&(this.options.preventMouseDownDefault&&M.preventDefault(),this.options.stopMouseDownPropagation&&M.stopPropagation(),M.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout(function(){(F.getMouseHold()&&(!S.includes("{")&&!S.includes("}")||S==="{delete}"||S==="{backspace}"||S==="{bksp}"||S==="{space}"||S==="{tab}")||S==="{arrowright}"||S==="{arrowleft}"||S==="{arrowup}"||S==="{arrowdown}")&&(F.options.debug&&console.log("Button held:",S),F.handleButtonHold(S)),clearTimeout(F.holdTimeout)},500))}},{key:"handleButtonMouseUp",value:function(S,M){var F=this;M&&(this.options.preventMouseUpDefault&&M.preventDefault&&M.preventDefault(),this.options.stopMouseUpPropagation&&M.stopPropagation&&M.stopPropagation(),!(M.target===this.keyboardDOM||M.target&&this.keyboardDOM.contains(M.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(M.target===this.candidateBox.candidateBoxElement||M.target&&this.candidateBox.candidateBoxElement.contains(M.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons(function(B){B.classList.remove(F.activeButtonClass)}),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),S&&typeof this.options.onKeyReleased=="function"&&this.options.onKeyReleased(S,M)}},{key:"handleKeyboardContainerMouseDown",value:function(S){this.options.preventMouseDownDefault&&S.preventDefault()}},{key:"handleButtonHold",value:function(S){var M=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout(function(){M.getMouseHold()?(M.handleButtonClicked(S),M.handleButtonHold(S)):clearTimeout(M.holdInteractionTimeout)},100)}},{key:"syncInstanceInputs",value:function(){var S=this;this.dispatch(function(M){M.replaceInput(S.input),M.setCaretPosition(S.caretPosition,S.caretPositionEnd)})}},{key:"clearInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName;this.input[S]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName,M=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.options.syncInstanceInputs&&!M&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[S].replace("‫","").replace("‬","")+"‬":this.input[S]}},{key:"getAllInputs",value:function(){var S=this,M={};return Object.keys(this.input).forEach(function(F){M[F]=S.getInput(F,!0)}),M}},{key:"setInput",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.inputName||this.defaultName,F=arguments.length>2?arguments[2]:void 0;this.input[M]=S,!F&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(S){this.input=S}},{key:"setOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=this.changedOptions(S);this.options=Object.assign(this.options,S),M.length&&(this.options.debug&&console.log("changedOptions",M),this.onSetOptions(M),this.render())}},{key:"changedOptions",value:function(S){var M=this;return Object.keys(S).filter(function(F){return JSON.stringify(S[F])!==JSON.stringify(M.options[F])})}},{key:"onSetOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];S.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(S.includes("layoutCandidatesPageSize")||S.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new k({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(S){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach(function(M){S(window.SimpleKeyboardInstances[M],M)})}},{key:"addButtonTheme",value:function(S,M){var F=this;M&&S&&(S.split(" ").forEach(function(B){M.split(" ").forEach(function(Q){F.options.buttonTheme||(F.options.buttonTheme=[]);var Z=!1;F.options.buttonTheme.map(function(ee){if(ee!=null&&ee.class.split(" ").includes(Q)){Z=!0;var K=ee.buttons.split(" ");K.includes(B)||(Z=!0,K.push(B),ee.buttons=K.join(" "))}return ee}),Z||F.options.buttonTheme.push({class:Q,buttons:S})})}),this.render())}},{key:"removeButtonTheme",value:function(S,M){var F=this;if(!S&&!M)return this.options.buttonTheme=[],void this.render();S&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(S.split(" ").forEach(function(B){var Q;(Q=F.options)===null||Q===void 0||(Q=Q.buttonTheme)===null||Q===void 0||Q.map(function(Z,ee){if(Z&&M&&M.includes(Z.class)||!M){var K,ge,be=(K=Z)===null||K===void 0?void 0:K.buttons.split(" ").filter(function(pe){return pe!==B});Z&&be!=null&&be.length?Z.buttons=be.join(" "):((ge=F.options.buttonTheme)===null||ge===void 0||ge.splice(ee,1),Z=null)}return Z})}),this.render())}},{key:"getButtonElement",value:function(S){var M,F=this.buttonElements[S];return F&&(M=F.length>1?F:F[0]),M}},{key:"inputPatternIsValid",value:function(S){var M,F=this.options.inputPattern;if((M=F instanceof RegExp?F:F[this.options.inputName||this.defaultName])&&S){var B=M.test(S);return this.options.debug&&console.log('inputPattern ("'.concat(M,'"): ').concat(B?"passed":"did not pass!")),B}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.addEventListener("keyup",this.handleKeyUp,M),document.addEventListener("keydown",this.handleKeyDown,M),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(S){this.caretEventHandler(S),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(S)}},{key:"handleKeyDown",value:function(S){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(S)}},{key:"handleMouseUp",value:function(S){this.caretEventHandler(S)}},{key:"handleTouchEnd",value:function(S){this.caretEventHandler(S)}},{key:"handleSelect",value:function(S){this.caretEventHandler(S)}},{key:"handleSelectionChange",value:function(S){navigator.userAgent.includes("Firefox")||this.caretEventHandler(S)}},{key:"caretEventHandler",value:function(S){var M,F=this;S.target.tagName&&(M=S.target.tagName.toLowerCase()),this.dispatch(function(B){var Q=S.target===B.keyboardDOM||S.target&&B.keyboardDOM.contains(S.target);if(F.options.syncInstanceInputs&&Array.isArray(S.path)&&(Q=S.path.some(function(K){var ge;return K==null||(ge=K.hasAttribute)===null||ge===void 0?void 0:ge.call(K,"data-skInstance")})),(M==="textarea"||M==="input"&&["text","search","url","tel","password"].includes(S.target.type))&&!B.options.disableCaretPositioning){var Z=S.target.selectionStart,ee=S.target.selectionEnd;B.options.rtl&&(Z=B.utilities.getRtlOffset(Z,B.getInput()),ee=B.utilities.getRtlOffset(ee,B.getInput())),B.setCaretPosition(Z,ee),F.activeInputElement=S.target,B.options.debug&&console.log("Caret at: ",B.getCaretPosition(),B.getCaretPositionEnd(),S&&S.target.tagName.toLowerCase(),"(".concat(B.keyboardDOMClass,")"),S==null?void 0:S.type)}else!B.options.disableCaretPositioning&&Q||(S==null?void 0:S.type)==="selectionchange"||(B.setCaretPosition(null),F.activeInputElement=null,B.options.debug&&console.log('Caret position reset due to "'.concat(S==null?void 0:S.type,'" event'),S))})}},{key:"recurseButtons",value:function(S){var M=this;S&&Object.keys(this.buttonElements).forEach(function(F){return M.buttonElements[F].forEach(S)})}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.removeEventListener("keyup",this.handleKeyUp,M),document.removeEventListener("keydown",this.handleKeyDown,M),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons(function(F){F&&(F.onpointerdown=null,F.onpointerup=null,F.onpointercancel=null,F.ontouchstart=null,F.ontouchend=null,F.ontouchcancel=null,F.onclick=null,F.onmousedown=null,F.onmouseup=null,F.remove(),F=null)}),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(S){var M=this.options.buttonTheme,F=[];return Array.isArray(M)&&M.forEach(function(B){if(B&&B.class&&typeof B.class=="string"&&B.buttons&&typeof B.buttons=="string"){var Q=B.class.split(" ");B.buttons.split(" ").includes(S)&&(F=[].concat(U(F),U(Q)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',B)}),F}},{key:"setDOMButtonAttributes",value:function(S,M){var F=this.options.buttonAttributes;Array.isArray(F)&&F.forEach(function(B){B.attribute&&typeof B.attribute=="string"&&B.value&&typeof B.value=="string"&&B.buttons&&typeof B.buttons=="string"?B.buttons.split(" ").includes(S)&&M(B.attribute,B.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',B)})}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(S){if(S.target.classList.contains("hg-button"))return S.preventDefault(),S.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),typeof this.options.onInit=="function"&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),typeof this.options.beforeFirstRender=="function"&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){typeof this.options.beforeRender=="function"&&this.options.beforeRender(this)}},{key:"onRender",value:function(){typeof this.options.onRender=="function"&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){typeof this.options.onModulesLoaded=="function"&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var S=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach(function(M){var F=new M(S);F.init&&F.init(S)}),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(S,M){return!!this.modules[S]&&this.modules[S][M]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(S,M,F,B){var Q=this,Z=Array.from(S.children),ee=0;return Z.length&&F.forEach(function(K,ge){var be=B[ge];if(!(be&&be>K))return!1;var pe=K-ee,fe=be-ee,ye=document.createElement("div");ye.className+="hg-button-container";var ue="".concat(Q.options.layoutName,"-r").concat(M,"c").concat(ge);ye.setAttribute("data-skUID",ue);var Oe=Z.splice(pe,fe-pe+1);ee=fe-pe,Oe.forEach(function(ke){return ye.appendChild(ke)}),Z.splice(pe,0,ye),S.innerHTML="",Z.forEach(function(ke){return S.appendChild(ke)}),Q.options.debug&&console.log("rowDOMContainer",Oe,pe,fe,ee+1)}),S}},{key:"render",value:function(){var S=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var M="hg-layout-".concat(this.options.layoutName),F=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},B=this.options.useTouchEvents||!1,Q=B?"hg-touch-events":"",Z=this.options.useMouseEvents||!1,ee=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,M,this.keyboardPluginClasses,Q),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",F[this.options.layoutName||this.defaultName].forEach(function(K,ge){var be=K.split(" ");S.options.excludeFromLayout&&S.options.excludeFromLayout[S.options.layoutName||S.defaultName]&&(be=be.filter(function(ue){return S.options.excludeFromLayout&&!S.options.excludeFromLayout[S.options.layoutName||S.defaultName].includes(ue)}));var pe=document.createElement("div");pe.className+="hg-row";var fe=[],ye=[];be.forEach(function(ue,Oe){var ke,at=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("[")===0,ze=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("]")===ue.length-1;at&&(fe.push(Oe),ue=ue.replace(/\[/g,"")),ze&&(ye.push(Oe),ue=ue.replace(/\]/g,""));var It=S.utilities.getButtonClass(ue),ht=S.utilities.getButtonDisplayName(ue,S.options.display,S.options.mergeDisplay),wr=S.options.useButtonTag?"button":"div",pt=document.createElement(wr);pt.className+="hg-button ".concat(It),(ke=pt.classList).add.apply(ke,U(S.getButtonThemeClasses(ue))),S.setDOMButtonAttributes(ue,function(De,Pr){pt.setAttribute(De,Pr)}),S.activeButtonClass="hg-activeButton",!S.utilities.pointerEventsSupported()||B||Z?B?(pt.ontouchstart=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.ontouchend=function(De){S.handleButtonMouseUp(ue,De)},pt.ontouchcancel=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onclick=function(De){S.setMouseHold(!1),typeof S.options.onKeyReleased!="function"&&S.handleButtonClicked(ue,De)},pt.onmousedown=function(De){typeof S.options.onKeyReleased!="function"||S.isMouseHold||S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onmouseup=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onpointerdown=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onpointerup=function(De){S.handleButtonMouseUp(ue,De)},pt.onpointercancel=function(De){S.handleButtonMouseUp(ue,De)}),pt.setAttribute("data-skBtn",ue);var mn="".concat(S.options.layoutName,"-r").concat(ge,"b").concat(Oe);pt.setAttribute("data-skBtnUID",mn);var Ot=document.createElement("span");Ot.innerHTML=ht,pt.appendChild(Ot),S.buttonElements[ue]||(S.buttonElements[ue]=[]),S.buttonElements[ue].push(pt),pe.appendChild(pt)}),pe=S.parseRowDOMContainers(pe,ge,fe,ye),S.keyboardRowsDOM.appendChild(pe)}),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||B||Z?B?(document.ontouchend=function(K){return S.handleButtonMouseUp(void 0,K)},document.ontouchcancel=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.ontouchstart=function(K){return S.handleKeyboardContainerMouseDown(K)}):B||(document.onmouseup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onmousedown=function(K){return S.handleKeyboardContainerMouseDown(K)}):(document.onpointerup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onpointerdown=function(K){return S.handleKeyboardContainerMouseDown(K)}),this.onInit())}}],$&&ne(H.prototype,$),J&&ne(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}(),_e=le,ve=le}(),h}()},442:function(s){s.exports=n}},o={};function i(s){var c=o[s];if(c!==void 0)return c.exports;var u=o[s]={exports:{}};return r[s].call(u.exports,u,u.exports,i),u.exports}i.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(c,{a:c}),c},i.d=function(s,c){for(var u in c)i.o(c,u)&&!i.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:c[u]})},i.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var a={};return function(){i.r(a),i.d(a,{KeyboardReact:function(){return g},default:function(){return m}}),i(981);var s=i(442),c=i(548),u=i.n(c);function d(y){return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(y)}function h(y,w){var b=Object.keys(y);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(y);w&&(E=E.filter(function(C){return Object.getOwnPropertyDescriptor(y,C).enumerable})),b.push.apply(b,E)}return b}function f(y){for(var w=1;w<arguments.length;w++){var b=arguments[w]!=null?arguments[w]:{};w%2?h(Object(b),!0).forEach(function(E){p(y,E,b[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(b)):h(Object(b)).forEach(function(E){Object.defineProperty(y,E,Object.getOwnPropertyDescriptor(b,E))})}return y}function p(y,w,b){var E;return E=function(C,I){if(d(C)!="object"||!C)return C;var T=C[Symbol.toPrimitive];if(T!==void 0){var P=T.call(C,I||"default");if(d(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(C)}(w,"string"),(w=d(E)=="symbol"?E:E+"")in y?Object.defineProperty(y,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[w]=b,y}var l=function(y){return f(f({},y),{},{keyboardRef:null})},g=function(y){var w=y.baseClass||"react-simple-keyboard",b=s.useRef(null),E=s.useRef(null),C=s.useRef(null),I=s.useRef(y);return s.useEffect(function(){return function(){C.current&&C.current.destroy(),b.current=!1}},[]),s.useEffect(function(){var T=function(j){return f(f({},j),{},{theme:"simple-keyboard ".concat(j.theme||"hg-theme-default")})}(y);if(!b.current){b.current=!0,T.debug&&console.log("ReactSimpleKeyboard: Init");var P=E.current,N=".".concat(w);C.current=new(u())(P||N,T),T.keyboardRef&&T.keyboardRef(C.current)}var L=function(j,W){var q=l(W),k=l(j);return Object.keys(q).filter(function(U){return q[U]!==k[U]})}(I.current,T);if(L.length){var V=C.current;I.current=T,V==null||V.setOptions(T),T.debug&&console.log("ReactSimpleKeyboard - setOptions called due to updated props:",L)}},[b,w,I,y]),s.createElement("div",{className:w,ref:E})},m=g}(),a}()})})(dp);var Db=dp.exports;const Mb=Lu(Db);function fp({onChange:t,keyboardRef:e,layout:n,theme:r}){const[o,i]=x.useState("default"),a=s=>{(s==="{shift}"||s==="{lock}")&&i(o==="default"?"shift":"default")};return v.jsx(Mb,{keyboardRef:s=>e.current=s,layoutName:o,layout:n,theme:r,onChange:t,onKeyPress:a,preventMouseDownDefault:!0})}function hp(){const{subscribe:t,unsubscribe:e,publish:n}=Oa();return{initialize:(s,c)=>{t("openKeyboard",s),t("closeKeyboard",c)},terminate:(s,c)=>{e("openKeyboard",s),e("closeKeyboard",c)},open:s=>{n("openKeyboard",{inputId:s.target.id,inputValue:s.target.value})},close:()=>{n("closeKeyboard")}}}const fr="keyboard-custom-overlap-id";function Lb({enabled:t}){const[e,n]=x.useState(!1),r=x.useRef(null),o=x.useRef(null),i=x.useRef(null),[a,s]=x.useState(),[c,u]=x.useState(0),{initialize:d,terminate:h}=hp(),f=w=>{var b,E;o.current=document.getElementById(w.detail.inputId),(b=r.current)==null||b.setInput(w.detail.inputValue),(E=o.current)==null||E.addEventListener("input",C=>{var T;const I=C.target;(T=r.current)==null||T.setInput(I==null?void 0:I.value)}),u(y()),n(!0)},p=()=>{u(0),n(!1)};x.useEffect(()=>(d(f,p),()=>{h(f,p)}),[e]);const l=w=>{var b,E;if(o&&o.current){g(o.current,w);const C=(b=r.current)==null?void 0:b.getCaretPosition();C&&((E=o.current)==null||E.setSelectionRange(C,C))}},g=(w,b)=>{var I;const E=(I=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:I.set;E==null||E.call(w,b);const C=new Event("input",{bubbles:!0});w.dispatchEvent(C)},m=()=>{var w;if(!a){const b=(w=i.current)==null?void 0:w.getBoundingClientRect();return b&&b.x&&!a&&s(b),b}return a},y=()=>{var T;const w=document.querySelectorAll("#"+fr),b=m(),E=[...w].map(P=>P.getBoundingClientRect()),C=(T=o.current)==null?void 0:T.getBoundingClientRect();E.push(C),E.sort((P,N)=>P.bottom>N.bottom?-1:1);let I=0;return E.every(P=>{if(b&&b.top<P.bottom)return I=P.bottom-b.top+8,!1}),I};return t?v.jsx("div",{className:"relative",style:{height:c},children:v.jsx("div",{ref:i,className:`mobile:hidden absolute bottom-0 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!e&&a&&"hidden"} ${!e&&!a&&"pointer-events-none opacity-0"}`,children:v.jsx(fp,{keyboardRef:r,onChange:l})})}):v.jsx(v.Fragment,{})}const Yo=({id:t,name:e,label:n,description:r,required:o,type:i="text",value:a,placeholder:s,disabled:c,error:u=!1,helperText:d="",onChange:h,beforeIcon:f,afterIcon:p,autoFocus:l,onFocus:g,onBlur:m})=>{const[y,w]=x.useState(d),b=x.useRef(null),[E,C]=x.useState(!1),{open:I,close:T}=hp();x.useEffect(()=>()=>{T()},[]);const P=()=>{b.current&&w(b.current.validationMessage),C(!1),T(),m==null||m()},N=async W=>{C(!0),(async()=>I(W))().then(()=>{var k;return(k=b.current)==null?void 0:k.scrollIntoView({behavior:"smooth",block:"center"})}),g==null||g()},L=W=>{h==null||h(W)},V=x.useId(),j=t??V;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{description:r,disabled:c,htmlFor:j,required:o,children:n}),v.jsx("div",{className:Sn("flex-start box flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs",c?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",E&&!u&&"border-core-primary-500 ring-1 ring-core-primary-500",u&&"border-core-red-500",u&&E&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex flex-row gap-2 self-stretch p-2",children:[f&&v.jsx(vn,{icon:f}),v.jsx("input",{type:i,id:j,name:e,className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",value:a,onChange:L,onBlur:P,ref:b,placeholder:s,onFocus:N,disabled:c,autoFocus:l}),p&&v.jsx(vn,{icon:p})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${d||y?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(Pn.Helper,{error:u,helperText:d||y})})})]})};Yo.displayName="Input";const pp=({id:t,name:e,label:n,required:r,description:o,placeholder:i,value:a,disabled:s,error:c=!1,helperText:u,onChange:d,type:h="date"})=>{const[f,p]=x.useState(!1),l=x.useId(),g=t??l;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{description:o,disabled:s,htmlFor:g,required:r,children:n}),v.jsx("div",{className:Sn("flex-start box relative flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs ring-core-primary-500 ",s?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",f&&!c&&"border-core-primary-500 ring-1 ring-core-primary-500 selection:bg-core-primary-500",c&&"border-core-red-500",c&&f&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex w-full flex-row gap-2 self-stretch p-2",children:[v.jsx("input",{type:h,id:g,name:e,value:a,max:"2200-01-01",className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",placeholder:i,onChange:d,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:s}),v.jsx(vn,{icon:"calendar"})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${u?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-100"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(Pn.Helper,{error:c,helperText:u})})})]})};pp.displayName="Input";function In({children:t}){return v.jsx("div",{className:"h-screen w-screen md:p-6",children:v.jsx("div",{className:"flex h-full max-h-full items-center justify-center md:container [&>*]:grow",children:t})})}function Eo({title:t,isOpen:e,onClose:n,primaryAction:r,secondaryAction:o,children:i}){const[a,s]=x.useState(e),c=x.useRef(null);x.useEffect(()=>{s(e)},[e]),x.useEffect(()=>{const h=c.current;h&&(a?h.show():h.close())},[a]);const u=()=>{n&&n(),s(!1)},d=h=>{h.key==="Escape"&&u()};return v.jsx("div",{className:`fixed inset-0 z-40 min-h-screen items-center bg-gray-500 bg-opacity-25 ${a?"flex":"hidden"}`,children:v.jsx("dialog",{ref:c,onKeyDown:d,className:"scrollbar-hide absolute overflow-auto rounded-lg drop-shadow-md",children:v.jsxs("div",{className:"rounded-lg bg-white md:min-w-[420px]",children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:i}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[r&&v.jsx(Je,{label:r.label??"",onClick:r.action,disabled:r.disabled,pending:r.loading}),o&&v.jsx(Je,{label:o.label??"",onClick:o.action,disabled:o.disabled,pending:o.loading,variant:"secondary"})]})})]})})})}function Fb({option:{label:t},checked:e,onChange:n}){return v.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-sm hover:bg-core-gray-50",children:[v.jsx(Ll,{defaultChecked:e,onChange:n}),v.jsx("p",{children:t})]})}function jb(t){const{t:e}=Ue(),n=x.useRef(null),[r,o]=x.useState(!1);lp(n,o);const[i,a]=x.useState(""),[s,c]=x.useState(t.value.split(";")),{name:u,onChange:d}=t,h=(f,p)=>{let l=[];f?l=[...s,p]:l=s.filter(g=>g!==p),c(l),d&&d(u??"",l.join(";"))};return v.jsxs("div",{ref:n,className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:`flex h-10 items-center justify-between rounded border p-2 ${t.disabled?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!t.disabled&&o(!r),children:[v.jsx("div",{className:`flex gap-1 overflow-hidden text-sm ${t.disabled?"text-core-gray-300":"text-core-gray-800"}`,children:s.map(f=>{var l;const p=(l=t.options.find(g=>g.value===f))==null?void 0:l.label;return v.jsxs("div",{className:"pointer-events-none flex items-center overflow-hidden rounded bg-core-gray-100 px-1.5 py-0.5",children:[v.jsx("p",{className:"truncate",children:p}),v.jsx("span",{className:"pointer-events-auto cursor-pointer",onClick:()=>h(!1,f),children:v.jsx(vn,{icon:"close"})})]},f)})}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:r?"▴":"▾"})]}),v.jsxs("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!r&&"hidden"} py-2`,children:[t.options.length>6&&v.jsx("div",{className:"px-4",children:v.jsx(Yo,{placeholder:`${e("search")}...`,onChange:f=>a(f.target.value)})}),t.options.map(f=>{if(!(i&&!f.label.toLowerCase().includes(i.toLowerCase())))return v.jsx(Fb,{option:f,checked:s.includes(f.value),onChange:p=>h(p,f.value)},`${f.value}_${s.includes(f.value)?"checked":"unchecked"}`)})]})]})]})}function Vb({value:t,max:e,label:n}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-sm mb-1 text-right text-core-gray-500",children:n}),v.jsx("div",{className:"h-1 w-full rounded-full bg-core-gray-200",children:v.jsx("div",{className:"h-1 rounded-full bg-core-primary-500",style:{width:`${Math.min(t/e*100,100)}%`}})})]})}function Ub({value:t,placeholder:e,open:n,setOpen:r,disabled:o}){return v.jsxs("div",{className:`flex items-center justify-between rounded border p-2 ${o?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!o&&r(!n),children:[v.jsx("span",{className:`text-sm ${o?"text-core-gray-300":"text-core-gray-800"}`,children:t||e}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:n?"▴":"▾"})]})}function Gb({label:t,children:e}){return v.jsxs("div",{className:"[&:not(:last-child)]:mb-2",children:[v.jsx("p",{className:"mb-2 px-4 text-xs text-core-gray-500",children:t}),e]})}function Fl(t){return v.jsx("div",{className:"px-4 py-2 text-sm hover:bg-core-gray-50",children:t.label})}function qb(t){const e=x.useRef(null),[n,r]=x.useState(!1),[o,i]=x.useState(t.value??"");lp(e,r);const a=(c,u)=>{i(c),r(!1),t.onChange&&t.onChange(u)},s=x.Children.map(t.children,c=>{if(x.isValidElement(c)){if(c.type===Fl)return v.jsx("div",{onClick:()=>a(c.props.label,c.props.value),children:c});if(c.type===Gb){const u=x.Children.map(c.props.children,d=>{if(x.isValidElement(d)&&d.type===Fl)return v.jsx("div",{onClick:()=>a(d.props.label,d.props.value),children:d})});return x.cloneElement(c,{},...u)}}});return v.jsxs("div",{ref:e,className:"flex flex-col gap-2 antialiased",children:[v.jsx(Pn,{description:t.description,disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsx("div",{children:v.jsxs("div",{className:"relative",children:[v.jsx(Ub,{value:o,placeholder:t.placeholder,open:n,setOpen:r,disabled:t.disabled}),t.children&&v.jsx("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!n&&"hidden"} py-2`,children:s})]})}),v.jsx(Pn.Helper,{helperText:t.helperText})]})}var Hb=Object.defineProperty,$b=(t,e)=>{for(var n in e)Hb(t,n,{get:e[n],enumerable:!0})},Sr={};$b(Sr,{assign:()=>Kb,colors:()=>Ao,createStringInterpolator:()=>Wl,skipAnimation:()=>Ep,to:()=>bp,willAdvance:()=>Kl});var jl=ka(),He=t=>Pa(t,jl),Vl=ka();He.write=t=>Pa(t,Vl);var uc=ka();He.onStart=t=>Pa(t,uc);var Ul=ka();He.onFrame=t=>Pa(t,Ul);var Gl=ka();He.onFinish=t=>Pa(t,Gl);var Pi=[];He.setTimeout=(t,e)=>{const n=He.now()+e,r=()=>{const i=Pi.findIndex(a=>a.cancel==r);~i&&Pi.splice(i,1),_o-=~i?1:0},o={time:n,handler:t,cancel:r};return Pi.splice(gp(n),0,o),_o+=1,mp(),o};var gp=t=>~(~Pi.findIndex(e=>e.time>t)||~Pi.length);He.cancel=t=>{uc.delete(t),Ul.delete(t),Gl.delete(t),jl.delete(t),Vl.delete(t)},He.sync=t=>{Hl=!0,He.batchedUpdates(t),Hl=!1},He.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...o){e=o,He.onStart(n)}return r.handler=t,r.cancel=()=>{uc.delete(n),e=null},r};var ql=typeof window<"u"?window.requestAnimationFrame:()=>{};He.use=t=>ql=t,He.now=typeof performance<"u"?()=>performance.now():Date.now,He.batchedUpdates=t=>t(),He.catch=console.error,He.frameLoop="always",He.advance=()=>{He.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):vp()};var Co=-1,_o=0,Hl=!1;function Pa(t,e){Hl?(e.delete(t),t(0)):(e.add(t),mp())}function mp(){Co<0&&(Co=0,He.frameLoop!=="demand"&&ql(yp))}function Yb(){Co=-1}function yp(){~Co&&(ql(yp),He.batchedUpdates(vp))}function vp(){const t=Co;Co=He.now();const e=gp(Co);if(e&&(wp(Pi.splice(0,e),n=>n.handler()),_o-=e),!_o){Yb();return}uc.flush(),jl.flush(t?Math.min(64,Co-t):16.667),Ul.flush(),Vl.flush(),Gl.flush()}function ka(){let t=new Set,e=t;return{add(n){_o+=e==t&&!t.has(n)?1:0,t.add(n)},delete(n){return _o-=e==t&&t.has(n)?1:0,t.delete(n)},flush(n){e.size&&(t=new Set,_o-=e.size,wp(e,r=>r(n)&&t.add(r)),_o+=t.size,e=t)}}}function wp(t,e){t.forEach(n=>{try{e(n)}catch(r){He.catch(r)}})}function $l(){}var Wb=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),Ae={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function Kr(t,e){if(Ae.arr(t)){if(!Ae.arr(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var rt=(t,e)=>t.forEach(e);function Dr(t,e,n){if(Ae.arr(t)){for(let r=0;r<t.length;r++)e.call(n,t[r],`${r}`);return}for(const r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r)}var tr=t=>Ae.und(t)?[]:Ae.arr(t)?t:[t];function Ba(t,e){if(t.size){const n=Array.from(t);t.clear(),rt(n,e)}}var Na=(t,...e)=>Ba(t,n=>n(...e)),Yl=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Wl,bp,Ao=null,Ep=!1,Kl=$l,Kb=t=>{t.to&&(bp=t.to),t.now&&(He.now=t.now),t.colors!==void 0&&(Ao=t.colors),t.skipAnimation!=null&&(Ep=t.skipAnimation),t.createStringInterpolator&&(Wl=t.createStringInterpolator),t.requestAnimationFrame&&He.use(t.requestAnimationFrame),t.batchedUpdates&&(He.batchedUpdates=t.batchedUpdates),t.willAdvance&&(Kl=t.willAdvance),t.frameLoop&&(He.frameLoop=t.frameLoop)},Ra=new Set,hr=[],zl=[],lc=0,dc={get idle(){return!Ra.size&&!hr.length},start(t){lc>t.priority?(Ra.add(t),He.onStart(zb)):(Cp(t),He(Xl))},advance:Xl,sort(t){if(lc)He.onFrame(()=>dc.sort(t));else{const e=hr.indexOf(t);~e&&(hr.splice(e,1),_p(t))}},clear(){hr=[],Ra.clear()}};function zb(){Ra.forEach(Cp),Ra.clear(),He(Xl)}function Cp(t){hr.includes(t)||_p(t)}function _p(t){hr.splice(Xb(hr,e=>e.priority>t.priority),0,t)}function Xl(t){const e=zl;for(let n=0;n<hr.length;n++){const r=hr[n];lc=r.priority,r.idle||(Kl(r),r.advance(t),r.idle||e.push(r))}return lc=0,zl=hr,zl.length=0,hr=e,hr.length>0}function Xb(t,e){const n=t.findIndex(e);return n<0?t.length:n}var Qb=(t,e,n)=>Math.min(Math.max(n,t),e),Jb={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ir="[-+]?\\d*\\.?\\d+",fc=Ir+"%";function hc(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var Zb=new RegExp("rgb"+hc(Ir,Ir,Ir)),e6=new RegExp("rgba"+hc(Ir,Ir,Ir,Ir)),t6=new RegExp("hsl"+hc(Ir,fc,fc)),n6=new RegExp("hsla"+hc(Ir,fc,fc,Ir)),r6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,o6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,i6=/^#([0-9a-fA-F]{6})$/,a6=/^#([0-9a-fA-F]{8})$/;function s6(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=i6.exec(t))?parseInt(e[1]+"ff",16)>>>0:Ao&&Ao[t]!==void 0?Ao[t]:(e=Zb.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|255)>>>0:(e=e6.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|Ip(e[4]))>>>0:(e=r6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=a6.exec(t))?parseInt(e[1],16)>>>0:(e=o6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=t6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|255)>>>0:(e=n6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|Ip(e[4]))>>>0:null}function Ql(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ap(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,o=2*n-r,i=Ql(o,r,t+1/3),a=Ql(o,r,t),s=Ql(o,r,t-1/3);return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(s*255)<<8}function ki(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Sp(t){return(parseFloat(t)%360+360)%360/360}function Ip(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function pc(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Tp(t){let e=s6(t);if(e===null)return t;e=e||0;const n=(e&4278190080)>>>24,r=(e&16711680)>>>16,o=(e&65280)>>>8,i=(e&255)/255;return`rgba(${n}, ${r}, ${o}, ${i})`}var Da=(t,e,n)=>{if(Ae.fun(t))return t;if(Ae.arr(t))return Da({range:t,output:e,extrapolate:n});if(Ae.str(t.output[0]))return Wl(t);const r=t,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const d=u6(u,i);return c6(u,i[d],i[d+1],o[d],o[d+1],c,a,s,r.map)}};function c6(t,e,n,r,o,i,a,s,c){let u=c?c(t):t;if(u<e){if(a==="identity")return u;a==="clamp"&&(u=e)}if(u>n){if(s==="identity")return u;s==="clamp"&&(u=n)}return r===o?r:e===n?t<=e?r:o:(e===-1/0?u=-u:n===1/0?u=u-e:u=(u-e)/(n-e),u=i(u),r===-1/0?u=-u:o===1/0?u=u+r:u=u*(o-r)+r,u)}function u6(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}var l6=(t,e="end")=>n=>{n=e==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*t,o=e==="end"?Math.floor(r):Math.ceil(r);return Qb(0,1,o/t)},gc=1.70158,mc=gc*1.525,xp=gc+1,Op=2*Math.PI/3,Pp=2*Math.PI/4.5,yc=t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,d6={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:Math.pow(2,10*t-10),easeOutExpo:t=>t===1?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>xp*t*t*t-gc*t*t,easeOutBack:t=>1+xp*Math.pow(t-1,3)+gc*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*((mc+1)*2*t-mc)/2:(Math.pow(2*t-2,2)*((mc+1)*(t*2-2)+mc)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-Math.pow(2,10*t-10)*Math.sin((t*10-10.75)*Op),easeOutElastic:t=>t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*Op)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*Pp))/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*Pp)/2+1,easeInBounce:t=>1-yc(1-t),easeOutBounce:yc,easeInOutBounce:t=>t<.5?(1-yc(1-2*t))/2:(1+yc(2*t-1))/2,steps:l6},Ma=Symbol.for("FluidValue.get"),Bi=Symbol.for("FluidValue.observers"),pr=t=>!!(t&&t[Ma]),Un=t=>t&&t[Ma]?t[Ma]():t,kp=t=>t[Bi]||null;function f6(t,e){t.eventObserved?t.eventObserved(e):t(e)}function La(t,e){const n=t[Bi];n&&n.forEach(r=>{f6(r,e)})}var Bp=class{constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");h6(this,t)}},h6=(t,e)=>Np(t,Ma,e);function Ni(t,e){if(t[Ma]){let n=t[Bi];n||Np(t,Bi,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function Fa(t,e){const n=t[Bi];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[Bi]=null,t.observerRemoved&&t.observerRemoved(r,e)}}var Np=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),vc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,p6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Rp=new RegExp(`(${vc.source})(%|[a-z]+)`,"i"),g6=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,wc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Dp=t=>{const[e,n]=m6(t);if(!e||Yl())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){const o=window.getComputedStyle(document.documentElement).getPropertyValue(n);return o||t}else{if(n&&wc.test(n))return Dp(n);if(n)return n}return t},m6=t=>{const e=wc.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]},Jl,y6=(t,e,n,r,o)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,Mp=t=>{Jl||(Jl=Ao?new RegExp(`(${Object.keys(Ao).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(i=>Un(i).replace(wc,Dp).replace(p6,Tp).replace(Jl,Tp)),n=e.map(i=>i.match(vc).map(Number)),o=n[0].map((i,a)=>n.map(s=>{if(!(a in s))throw Error('The arity of each "output" value must be equal');return s[a]})).map(i=>Da({...t,output:i}));return i=>{var c;const a=!Rp.test(e[0])&&((c=e.find(u=>Rp.test(u)))==null?void 0:c.replace(vc,""));let s=0;return e[0].replace(vc,()=>`${o[s++](i)}${a||""}`).replace(g6,y6)}},Zl="react-spring: ",Lp=t=>{const e=t;let n=!1;if(typeof e!="function")throw new TypeError(`${Zl}once requires a function parameter`);return(...r)=>{n||(e(...r),n=!0)}},v6=Lp(console.warn);function w6(){v6(`${Zl}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var b6=Lp(console.warn);function E6(){b6(`${Zl}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function bc(t){return Ae.str(t)&&(t[0]=="#"||/\d/.test(t)||!Yl()&&wc.test(t)||t in(Ao||{}))}var ed=Yl()?x.useEffect:x.useLayoutEffect,C6=()=>{const t=x.useRef(!1);return ed(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function Fp(){const t=x.useState()[1],e=C6();return()=>{e.current&&t(Math.random())}}function _6(t,e){const[n]=x.useState(()=>({inputs:e,result:t()})),r=x.useRef(),o=r.current;let i=o;return i?e&&i.inputs&&A6(e,i.inputs)||(i={inputs:e,result:t()}):i=n,x.useEffect(()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)},[i]),i.result}function A6(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var jp=t=>x.useEffect(t,S6),S6=[];function Vp(t){const e=x.useRef();return x.useEffect(()=>{e.current=t}),e.current}var ja=Symbol.for("Animated:node"),I6=t=>!!t&&t[ja]===t,Mr=t=>t&&t[ja],td=(t,e)=>Wb(t,ja,e),Ec=t=>t&&t[ja]&&t[ja].getPayload(),Up=class{constructor(){td(this,this)}getPayload(){return this.payload||[]}},Va=class extends Up{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new Va(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return Ae.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Ua=class extends Va{constructor(t){super(0),this._string=null,this._toString=Da({output:[t,t]})}static create(t){return new Ua(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Da({output:[this.getValue(),t]})),this._value=0,super.reset()}},Cc={dependencies:null},_c=class extends Up{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Dr(this.source,(n,r)=>{I6(n)?e[r]=n.getValue(t):pr(n)?e[r]=Un(n):t||(e[r]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&rt(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Dr(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){Cc.dependencies&&pr(t)&&Cc.dependencies.add(t);const e=Ec(t);e&&rt(e,n=>this.add(n))}},Gp=class extends _c{constructor(t){super(t)}static create(t){return new Gp(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((n,r)=>n.setValue(t[r])).some(Boolean):(super.setValue(t.map(T6)),!0)}};function T6(t){return(bc(t)?Ua:Va).create(t)}function nd(t){const e=Mr(t);return e?e.constructor:Ae.arr(t)?Gp:bc(t)?Ua:Va}var qp=(t,e)=>{const n=!Ae.fun(t)||t.prototype&&t.prototype.isReactComponent;return x.forwardRef((r,o)=>{const i=x.useRef(null),a=n&&x.useCallback(l=>{i.current=P6(o,l)},[o]),[s,c]=O6(r,e),u=Fp(),d=()=>{const l=i.current;if(n&&!l)return;(l?e.applyAnimatedValues(l,s.getValue(!0)):!1)===!1&&u()},h=new x6(d,c),f=x.useRef();ed(()=>(f.current=h,rt(c,l=>Ni(l,h)),()=>{f.current&&(rt(f.current.deps,l=>Fa(l,f.current)),He.cancel(f.current.update))})),x.useEffect(d,[]),jp(()=>()=>{const l=f.current;rt(l.deps,g=>Fa(g,l))});const p=e.getComponentProps(s.getValue());return ce.createElement(t,{...p,ref:a})})},x6=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&He.write(this.update)}};function O6(t,e){const n=new Set;return Cc.dependencies=n,t.style&&(t={...t,style:e.createAnimatedStyle(t.style)}),t=new _c(t),Cc.dependencies=null,[t,n]}function P6(t,e){return t&&(Ae.fun(t)?t(e):t.current=e),e}var Hp=Symbol.for("AnimatedComponent"),k6=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:n=o=>new _c(o),getComponentProps:r=o=>o}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=a=>{const s=$p(a)||"Anonymous";return Ae.str(a)?a=i[a]||(i[a]=qp(a,o)):a=a[Hp]||(a[Hp]=qp(a,o)),a.displayName=`Animated(${s})`,a};return Dr(t,(a,s)=>{Ae.arr(t)&&(s=$p(a)),i[s]=i(a)}),{animated:i}},$p=t=>Ae.str(t)?t:t&&Ae.str(t.displayName)?t.displayName:Ae.fun(t)&&t.name||null;function Wo(t,...e){return Ae.fun(t)?t(...e):t}var Ga=(t,e)=>t===!0||!!(e&&t&&(Ae.fun(t)?t(e):tr(t).includes(e))),Yp=(t,e)=>Ae.obj(t)?e&&t[e]:t,Wp=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,B6=t=>t,rd=(t,e=B6)=>{let n=N6;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));const r={};for(const o of n){const i=e(t[o],o);Ae.und(i)||(r[o]=i)}return r},N6=["config","onProps","onStart","onChange","onPause","onResume","onRest"],R6={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function D6(t){const e={};let n=0;if(Dr(t,(r,o)=>{R6[o]||(e[o]=r,n++)}),n)return e}function Kp(t){const e=D6(t);if(e){const n={to:e};return Dr(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function qa(t){return t=Un(t),Ae.arr(t)?t.map(qa):bc(t)?Sr.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function M6(t){for(const e in t)return!0;return!1}function od(t){return Ae.fun(t)||Ae.arr(t)&&Ae.obj(t[0])}function L6(t,e){var n;(n=t.ref)==null||n.delete(t),e==null||e.delete(t)}function F6(t,e){var n;e&&t.ref!==e&&((n=t.ref)==null||n.delete(t),e.add(t),t.ref=e)}var j6={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},id={...j6.default,mass:1,damping:1,easing:d6.linear,clamp:!1},V6=class{constructor(){this.velocity=0,Object.assign(this,id)}};function U6(t,e,n){n&&(n={...n},zp(n,e),e={...n,...e}),zp(t,e),Object.assign(t,e);for(const a in id)t[a]==null&&(t[a]=id[a]);let{frequency:r,damping:o}=t;const{mass:i}=t;return Ae.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*i,t.friction=4*Math.PI*o*i/r),t}function zp(t,e){if(!Ae.und(e.decay))t.duration=void 0;else{const n=!Ae.und(e.tension)||!Ae.und(e.friction);(n||!Ae.und(e.frequency)||!Ae.und(e.damping)||!Ae.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var Xp=[],G6=class{constructor(){this.changed=!1,this.values=Xp,this.toValues=null,this.fromValues=Xp,this.config=new V6,this.immediate=!1}};function Qp(t,{key:e,props:n,defaultProps:r,state:o,actions:i}){return new Promise((a,s)=>{let c,u,d=Ga(n.cancel??(r==null?void 0:r.cancel),e);if(d)p();else{Ae.und(n.pause)||(o.paused=Ga(n.pause,e));let l=r==null?void 0:r.pause;l!==!0&&(l=o.paused||Ga(l,e)),c=Wo(n.delay||0,e),l?(o.resumeQueue.add(f),i.pause()):(i.resume(),f())}function h(){o.resumeQueue.add(f),o.timeouts.delete(u),u.cancel(),c=u.time-He.now()}function f(){c>0&&!Sr.skipAnimation?(o.delayed=!0,u=He.setTimeout(p,c),o.pauseQueue.add(h),o.timeouts.add(u)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(h),o.timeouts.delete(u),t<=(o.cancelId||0)&&(d=!0);try{i.start({...n,callId:t,cancel:d},a)}catch(l){s(l)}}})}var ad=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?Ri(t.get()):e.every(n=>n.noop)?Jp(t.get()):Tr(t.get(),e.every(n=>n.finished)),Jp=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Tr=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),Ri=t=>({value:t,cancelled:!0,finished:!1});function Zp(t,e,n,r){const{callId:o,parentId:i,onRest:a}=e,{asyncTo:s,promise:c}=n;return!i&&t===s&&!e.reset?c:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const u=rd(e,(m,y)=>y==="onRest"?void 0:m);let d,h;const f=new Promise((m,y)=>(d=m,h=y)),p=m=>{const y=o<=(n.cancelId||0)&&Ri(r)||o!==n.asyncId&&Tr(r,!1);if(y)throw m.result=y,h(m),m},l=(m,y)=>{const w=new e0,b=new t0;return(async()=>{if(Sr.skipAnimation)throw Ha(n),b.result=Tr(r,!1),h(b),b;p(w);const E=Ae.obj(m)?{...m}:{...y,to:m};E.parentId=o,Dr(u,(I,T)=>{Ae.und(E[T])&&(E[T]=I)});const C=await r.start(E);return p(w),n.paused&&await new Promise(I=>{n.resumeQueue.add(I)}),C})()};let g;if(Sr.skipAnimation)return Ha(n),Tr(r,!1);try{let m;Ae.arr(t)?m=(async y=>{for(const w of y)await l(w)})(t):m=Promise.resolve(t(l,r.stop.bind(r))),await Promise.all([m.then(d),f]),g=Tr(r.get(),!0,!1)}catch(m){if(m instanceof e0)g=m.result;else if(m instanceof t0)g=m.result;else throw m}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?c:void 0)}return Ae.fun(a)&&He.batchedUpdates(()=>{a(g,r,r.item)}),g})()}function Ha(t,e){Ba(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var e0=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},t0=class extends Error{constructor(){super("SkipAnimationSignal")}},sd=t=>t instanceof cd,q6=1,cd=class extends Bp{constructor(){super(...arguments),this.id=q6++,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Mr(this);return t&&t.getValue()}to(...t){return Sr.to(this,t)}interpolate(...t){return w6(),Sr.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){La(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||dc.sort(this),La(this,{type:"priority",parent:this,priority:t})}},Ko=Symbol.for("SpringPhase"),n0=1,ud=2,ld=4,dd=t=>(t[Ko]&n0)>0,So=t=>(t[Ko]&ud)>0,$a=t=>(t[Ko]&ld)>0,r0=(t,e)=>e?t[Ko]|=ud|n0:t[Ko]&=~ud,o0=(t,e)=>e?t[Ko]|=ld:t[Ko]&=~ld,H6=class extends cd{constructor(t,e){if(super(),this.animation=new G6,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ae.und(t)||!Ae.und(e)){const n=Ae.obj(t)?{...t}:{...e,from:t};Ae.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(So(this)||this._state.asyncTo)||$a(this)}get goal(){return Un(this.animation.to)}get velocity(){const t=Mr(this);return t instanceof Va?t.lastVelocity||0:t.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return dd(this)}get isAnimating(){return So(this)}get isPaused(){return $a(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const r=this.animation;let{toValues:o}=r;const{config:i}=r,a=Ec(r.to);!a&&pr(r.to)&&(o=tr(Un(r.to))),r.values.forEach((u,d)=>{if(u.done)return;const h=u.constructor==Ua?1:a?a[d].lastPosition:o[d];let f=r.immediate,p=h;if(!f){if(p=u.lastPosition,i.tension<=0){u.done=!0;return}let l=u.elapsedTime+=t;const g=r.fromValues[d],m=u.v0!=null?u.v0:u.v0=Ae.arr(i.velocity)?i.velocity[d]:i.velocity;let y;const w=i.precision||(g==h?.005:Math.min(1,Math.abs(h-g)*.001));if(Ae.und(i.duration))if(i.decay){const b=i.decay===!0?.998:i.decay,E=Math.exp(-(1-b)*l);p=g+m/(1-b)*(1-E),f=Math.abs(u.lastPosition-p)<=w,y=m*E}else{y=u.lastVelocity==null?m:u.lastVelocity;const b=i.restVelocity||w/10,E=i.clamp?0:i.bounce,C=!Ae.und(E),I=g==h?u.v0>0:g<h;let T,P=!1;const N=1,L=Math.ceil(t/N);for(let V=0;V<L&&(T=Math.abs(y)>b,!(!T&&(f=Math.abs(h-p)<=w,f)));++V){C&&(P=p==h||p>h==I,P&&(y=-y*E,p=h));const j=-i.tension*1e-6*(p-h),W=-i.friction*.001*y,q=(j+W)/i.mass;y=y+q*N,p=p+y*N}}else{let b=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,l=u.elapsedTime+=t)),b=(i.progress||0)+l/this._memoizedDuration,b=b>1?1:b<0?0:b,u.durationProgress=b),p=g+i.easing(b)*(h-g),y=(p-u.lastPosition)/t,f=b==1}u.lastVelocity=y,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[d].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const s=Mr(this),c=s.getValue();if(e){const u=Un(r.to);(c!==u||n)&&!i.decay?(s.setValue(u),this._onChange(u)):n&&i.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(t){return He.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(So(this)){const{to:t,config:e}=this.animation;He.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return Ae.und(t)?(n=this.queue||[],this.queue=[]):n=[Ae.obj(t)?t:{...e,to:t}],Promise.all(n.map(r=>this._update(r))).then(r=>ad(this,r))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),Ha(this._state,t&&this._lastCallId),He.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:r}=t;n=Ae.obj(n)?n[e]:n,(n==null||od(n))&&(n=void 0),r=Ae.obj(r)?r[e]:r,r==null&&(r=void 0);const o={to:n,from:r};return dd(this)||(t.reverse&&([n,r]=[r,n]),r=Un(r),Ae.und(r)?Mr(this)||this._set(n):this._set(r)),o}_update({...t},e){const{key:n,defaultProps:r}=this;t.default&&Object.assign(r,rd(t,(a,s)=>/^on/.test(s)?Yp(a,n):a)),s0(this,t,"onProps"),Ka(this,"onProps",t,this);const o=this._prepareNode(t);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Qp(++this._lastCallId,{key:n,props:t,defaultProps:r,state:i,actions:{pause:()=>{$a(this)||(o0(this,!0),Na(i.pauseQueue),Ka(this,"onPause",Tr(this,Ya(this,this.animation.to)),this))},resume:()=>{$a(this)&&(o0(this,!1),So(this)&&this._resume(),Na(i.resumeQueue),Ka(this,"onResume",Tr(this,Ya(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(a=>{if(t.loop&&a.finished&&!(e&&a.noop)){const s=i0(t);if(s)return this._update(s,!0)}return a})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Ri(this));const r=!Ae.und(t.to),o=!Ae.und(t.from);if(r||o)if(e.callId>this._lastToId)this._lastToId=e.callId;else return n(Ri(this));const{key:i,defaultProps:a,animation:s}=this,{to:c,from:u}=s;let{to:d=c,from:h=u}=t;o&&!r&&(!e.default||Ae.und(d))&&(d=h),e.reverse&&([d,h]=[h,d]);const f=!Kr(h,u);f&&(s.from=h),h=Un(h);const p=!Kr(d,c);p&&this._focus(d);const l=od(e.to),{config:g}=s,{decay:m,velocity:y}=g;(r||o)&&(g.velocity=0),e.config&&!l&&U6(g,Wo(e.config,i),e.config!==a.config?Wo(a.config,i):void 0);let w=Mr(this);if(!w||Ae.und(d))return n(Tr(this,!0));const b=Ae.und(e.reset)?o&&!e.default:!Ae.und(h)&&Ga(e.reset,i),E=b?h:this.get(),C=qa(d),I=Ae.num(C)||Ae.arr(C)||bc(C),T=!l&&(!I||Ga(a.immediate||e.immediate,i));if(p){const V=nd(d);if(V!==w.constructor)if(T)w=this._set(C);else throw Error(`Cannot animate between ${w.constructor.name} and ${V.name}, as the "to" prop suggests`)}const P=w.constructor;let N=pr(d),L=!1;if(!N){const V=b||!dd(this)&&f;(p||V)&&(L=Kr(qa(E),C),N=!L),(!Kr(s.immediate,T)&&!T||!Kr(g.decay,m)||!Kr(g.velocity,y))&&(N=!0)}if(L&&So(this)&&(s.changed&&!b?N=!0:N||this._stop(c)),!l&&((N||pr(c))&&(s.values=w.getPayload(),s.toValues=pr(d)?null:P==Ua?[1]:tr(C)),s.immediate!=T&&(s.immediate=T,!T&&!b&&this._set(c)),N)){const{onRest:V}=s;rt(Y6,W=>s0(this,e,W));const j=Tr(this,Ya(this,c));Na(this._pendingCalls,j),this._pendingCalls.add(n),s.changed&&He.batchedUpdates(()=>{var W;s.changed=!b,V==null||V(j,this),b?Wo(a.onRest,j):(W=s.onStart)==null||W.call(s,j,this)})}b&&this._set(E),l?n(Zp(e.to,e,this._state,this)):N?this._start():So(this)&&!p?this._pendingCalls.add(n):n(Jp(E))}_focus(t){const e=this.animation;t!==e.to&&(kp(this)&&this._detach(),e.to=t,kp(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;pr(e)&&(Ni(e,this),sd(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;pr(t)&&Fa(t,this)}_set(t,e=!0){const n=Un(t);if(!Ae.und(n)){const r=Mr(this);if(!r||!Kr(n,r.getValue())){const o=nd(n);!r||r.constructor!=o?td(this,o.create(n)):r.setValue(n),r&&He.batchedUpdates(()=>{this._onChange(n,e)})}}return Mr(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,Ka(this,"onStart",Tr(this,Ya(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),Wo(this.animation.onChange,t,this)),Wo(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Mr(this).reset(Un(t.to)),t.immediate||(t.fromValues=t.values.map(e=>e.lastPosition)),So(this)||(r0(this,!0),$a(this)||this._resume())}_resume(){Sr.skipAnimation?this.finish():dc.start(this)}_stop(t,e){if(So(this)){r0(this,!1);const n=this.animation;rt(n.values,o=>{o.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),La(this,{type:"idle",parent:this});const r=e?Ri(this.get()):Tr(this.get(),Ya(this,t??n.to));Na(this._pendingCalls,r),n.changed&&(n.changed=!1,Ka(this,"onRest",r,this))}}};function Ya(t,e){const n=qa(e),r=qa(t.get());return Kr(r,n)}function i0(t,e=t.loop,n=t.to){const r=Wo(e);if(r){const o=r!==!0&&Kp(r),i=(o||t).reverse,a=!o||o.reset;return Wa({...t,loop:e,default:!1,pause:void 0,to:!i||od(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function Wa(t){const{to:e,from:n}=t=Kp(t),r=new Set;return Ae.obj(e)&&a0(e,r),Ae.obj(n)&&a0(n,r),t.keys=r.size?Array.from(r):null,t}function $6(t){const e=Wa(t);return Ae.und(e.default)&&(e.default=rd(e)),e}function a0(t,e){Dr(t,(n,r)=>n!=null&&e.add(r))}var Y6=["onStart","onRest","onChange","onPause","onResume"];function s0(t,e,n){t.animation[n]=e[n]!==Wp(e,n)?Yp(e[n],t.key):void 0}function Ka(t,e,...n){var r,o,i,a;(o=(r=t.animation)[e])==null||o.call(r,...n),(a=(i=t.defaultProps)[e])==null||a.call(i,...n)}var W6=["onStart","onChange","onRest"],K6=1,z6=class{constructor(t,e){this.id=K6++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];Ae.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(Wa(t)),this}start(t){let{queue:e}=this;return t?e=tr(t).map(Wa):this.queue=[],this._flush?this._flush(this,e):(h0(this,e),fd(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;rt(tr(e),r=>n[r].stop(!!t))}else Ha(this._state,this._lastAsyncId),this.each(n=>n.stop(!!t));return this}pause(t){if(Ae.und(t))this.start({pause:!0});else{const e=this.springs;rt(tr(t),n=>e[n].pause())}return this}resume(t){if(Ae.und(t))this.start({pause:!1});else{const e=this.springs;rt(tr(t),n=>e[n].resume())}return this}each(t){Dr(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,Ba(t,([s,c])=>{c.value=this.get(),s(c,this,this._item)}));const i=!r&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Ba(e,([s,c])=>{c.value=a,s(c,this,this._item)}),i&&(this._started=!1,Ba(n,([s,c])=>{c.value=a,s(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;He.onFrame(this._onFrame)}};function fd(t,e){return Promise.all(e.map(n=>c0(t,n))).then(n=>ad(t,n))}async function c0(t,e,n){const{keys:r,to:o,from:i,loop:a,onRest:s,onResolve:c}=e,u=Ae.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),i===!1&&(e.from=null);const d=Ae.arr(o)||Ae.fun(o)?o:void 0;d?(e.to=void 0,e.onRest=void 0,u&&(u.onRest=void 0)):rt(W6,g=>{const m=e[g];if(Ae.fun(m)){const y=t._events[g];e[g]=({finished:w,cancelled:b})=>{const E=y.get(m);E?(w||(E.finished=!1),b&&(E.cancelled=!0)):y.set(m,{value:null,finished:w||!1,cancelled:b||!1})},u&&(u[g]=e[g])}});const h=t._state;e.pause===!h.paused?(h.paused=e.pause,Na(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const f=(r||Object.keys(t.springs)).map(g=>t.springs[g].start(e)),p=e.cancel===!0||Wp(e,"cancel")===!0;(d||p&&h.asyncId)&&f.push(Qp(++t._lastAsyncId,{props:e,state:h,actions:{pause:$l,resume:$l,start(g,m){p?(Ha(h,t._lastAsyncId),m(Ri(t))):(g.onRest=s,m(Zp(d,g,h,t)))}}})),h.paused&&await new Promise(g=>{h.resumeQueue.add(g)});const l=ad(t,await Promise.all(f));if(a&&l.finished&&!(n&&l.noop)){const g=i0(e,a,o);if(g)return h0(t,[g]),c0(t,g,!0)}return c&&He.batchedUpdates(()=>c(l,t,t.item)),l}function u0(t,e){const n={...t.springs};return e&&rt(tr(e),r=>{Ae.und(r.keys)&&(r=Wa(r)),Ae.obj(r.to)||(r={...r,to:void 0}),f0(n,r,o=>d0(o))}),l0(t,n),n}function l0(t,e){Dr(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Ni(n,t))})}function d0(t,e){const n=new H6;return n.key=t,e&&Ni(n,e),n}function f0(t,e,n){e.keys&&rt(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function h0(t,e){rt(e,n=>{f0(t.springs,n,r=>d0(r,t))})}var Ac=({children:t,...e})=>{const n=x.useContext(Sc),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=_6(()=>({pause:r,immediate:o}),[r,o]);const{Provider:i}=Sc;return ce.createElement(i,{value:e},t)},Sc=X6(Ac,{});Ac.Provider=Sc.Provider,Ac.Consumer=Sc.Consumer;function X6(t,e){return Object.assign(t,ce.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var Q6=()=>{const t=[],e=function(r){E6();const o=[];return rt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=n(r,i,a);s&&o.push(i.start(s))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){const o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return rt(t,r=>r.pause(...arguments)),this},e.resume=function(){return rt(t,r=>r.resume(...arguments)),this},e.set=function(r){rt(t,(o,i)=>{const a=Ae.fun(r)?r(i,o):r;a&&o.set(a)})},e.start=function(r){const o=[];return rt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=this._getProps(r,i,a);s&&o.push(i.start(s))}}),o},e.stop=function(){return rt(t,r=>r.stop(...arguments)),this},e.update=function(r){return rt(t,(o,i)=>o.update(this._getProps(r,o,i))),this};const n=function(r,o,i){return Ae.fun(r)?r(i,o):r};return e._getProps=n,e};function J6(t,e,n){const r=Ae.fun(e)&&e;r&&!n&&(n=[]);const o=x.useMemo(()=>r||arguments.length==3?Q6():void 0,[]),i=x.useRef(0),a=Fp(),s=x.useMemo(()=>({ctrls:[],queue:[],flush(y,w){const b=u0(y,w);return i.current>0&&!s.queue.length&&!Object.keys(b).some(C=>!y.springs[C])?fd(y,w):new Promise(C=>{l0(y,b),s.queue.push(()=>{C(fd(y,w))}),a()})}}),[]),c=x.useRef([...s.ctrls]),u=[],d=Vp(t)||0;x.useMemo(()=>{rt(c.current.slice(t,d),y=>{L6(y,o),y.stop(!0)}),c.current.length=t,h(d,t)},[t]),x.useMemo(()=>{h(0,Math.min(d,t))},n);function h(y,w){for(let b=y;b<w;b++){const E=c.current[b]||(c.current[b]=new z6(null,s.flush)),C=r?r(b,E):e[b];C&&(u[b]=$6(C))}}const f=c.current.map((y,w)=>u0(y,u[w])),p=x.useContext(Ac),l=Vp(p),g=p!==l&&M6(p);ed(()=>{i.current++,s.ctrls=c.current;const{queue:y}=s;y.length&&(s.queue=[],rt(y,w=>w())),rt(c.current,(w,b)=>{o==null||o.add(w),g&&w.start({default:p});const E=u[b];E&&(F6(w,E.ref),w.ref?w.queue.push(E):w.start(E))})}),jp(()=>()=>{rt(s.ctrls,y=>y.stop(!0))});const m=f.map(y=>({...y}));return o?[m,o]:m}function Z6(t,e){const n=Ae.fun(t),[[r],o]=J6(1,n?t:[t],n?[]:e);return n||arguments.length==2?[r,o]:r}var eE=class extends cd{constructor(t,e){super(),this.source=t,this.idle=!0,this._active=new Set,this.calc=Da(...e);const n=this._get(),r=nd(n);td(this,r.create(n))}advance(t){const e=this._get(),n=this.get();Kr(e,n)||(Mr(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&p0(this._active)&&hd(this)}_get(){const t=Ae.arr(this.source)?this.source.map(Un):tr(Un(this.source));return this.calc(...t)}_start(){this.idle&&!p0(this._active)&&(this.idle=!1,rt(Ec(this),t=>{t.done=!1}),Sr.skipAnimation?(He.batchedUpdates(()=>this.advance()),hd(this)):dc.start(this))}_attach(){let t=1;rt(tr(this.source),e=>{pr(e)&&Ni(e,this),sd(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){rt(tr(this.source),t=>{pr(t)&&Fa(t,this)}),this._active.clear(),hd(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=tr(this.source).reduce((e,n)=>Math.max(e,(sd(n)?n.priority:0)+1),0))}};function tE(t){return t.idle!==!1}function p0(t){return!t.size||Array.from(t).every(tE)}function hd(t){t.idle||(t.idle=!0,rt(Ec(t),e=>{e.done=!0}),La(t,{type:"idle",parent:t}))}Sr.assign({createStringInterpolator:Mp,to:(t,e)=>new eE(t,e)});var g0=/^--/;function nE(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!g0.test(t)&&!(za.hasOwnProperty(t)&&za[t])?e+"px":(""+e).trim()}var m0={};function rE(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:s,...c}=e,u=Object.values(c),d=Object.keys(c).map(h=>n||t.hasAttribute(h)?h:m0[h]||(m0[h]=h.replace(/([A-Z])/g,f=>"-"+f.toLowerCase())));o!==void 0&&(t.textContent=o);for(const h in r)if(r.hasOwnProperty(h)){const f=nE(h,r[h]);g0.test(h)?t.style.setProperty(h,f):t.style[h]=f}d.forEach((h,f)=>{t.setAttribute(h,u[f])}),i!==void 0&&(t.scrollTop=i),a!==void 0&&(t.scrollLeft=a),s!==void 0&&t.setAttribute("viewBox",s)}var za={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oE=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),iE=["Webkit","Ms","Moz","O"];za=Object.keys(za).reduce((t,e)=>(iE.forEach(n=>t[oE(n,e)]=t[e]),t),za);var aE=/^(matrix|translate|scale|rotate|skew)/,sE=/^(translate)/,cE=/^(rotate|skew)/,pd=(t,e)=>Ae.num(t)&&t!==0?t+e:t,Ic=(t,e)=>Ae.arr(t)?t.every(n=>Ic(n,e)):Ae.num(t)?t===e:parseFloat(t)===e,uE=class extends _c{constructor({x:t,y:e,z:n,...r}){const o=[],i=[];(t||e||n)&&(o.push([t||0,e||0,n||0]),i.push(a=>[`translate3d(${a.map(s=>pd(s,"px")).join(",")})`,Ic(a,0)])),Dr(r,(a,s)=>{if(s==="transform")o.push([a||""]),i.push(c=>[c,c===""]);else if(aE.test(s)){if(delete r[s],Ae.und(a))return;const c=sE.test(s)?"px":cE.test(s)?"deg":"";o.push(tr(a)),i.push(s==="rotate3d"?([u,d,h,f])=>[`rotate3d(${u},${d},${h},${pd(f,c)})`,Ic(f,0)]:u=>[`${s}(${u.map(d=>pd(d,c)).join(",")})`,Ic(u,s.startsWith("scale")?1:0)])}}),o.length&&(r.transform=new lE(o,i)),super(r)}},lE=class extends Bp{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return rt(this.inputs,(n,r)=>{const o=Un(n[0]),[i,a]=this.transforms[r](Ae.arr(o)?o:n.map(Un));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){t==1&&rt(this.inputs,e=>rt(e,n=>pr(n)&&Ni(n,this)))}observerRemoved(t){t==0&&rt(this.inputs,e=>rt(e,n=>pr(n)&&Fa(n,this)))}eventObserved(t){t.type=="change"&&(this._value=null),La(this,t)}},dE=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Sr.assign({batchedUpdates:vi.unstable_batchedUpdates,createStringInterpolator:Mp,colors:Jb});var fE=k6(dE,{applyAnimatedValues:rE,createAnimatedStyle:t=>new uE(t),getComponentProps:({scrollTop:t,scrollLeft:e,...n})=>n}),hE=fE.animated;function Tc(t){const{rows:e}=t,n=Z6({from:{opacity:0},to:{opacity:1}});return v.jsxs(hE.div,{style:n,className:"flex w-full animate-pulse flex-col items-start space-y-3",children:[[...Array(e)].map((r,o)=>v.jsx("div",{className:"h-10 w-full rounded-lg bg-gray-100 p-5"},`skeleton_rows_${o}`)),v.jsx("span",{className:"sr-only",children:"Loading..."})]})}function y0({children:t,offset:e,max:n=4,initialCollapsed:r=!0}){const o=x.useRef(null),[i,a]=x.useState(0),[s,c]=x.useState(r),u=s&&x.Children.count(t)>n?n:x.Children.count(t);x.useEffect(()=>{o.current&&(i?s?o.current.style.marginBottom=`-${i-(i/u+(u-1)*(e??i/u/7.5))}px`:o.current.style.marginBottom="unset":a(o.current.offsetHeight))},[s,i]);const d=f=>(100-(u-1-f))/100,h=f=>f*(i/u-(e??i/u/7.5));return v.jsx("div",{ref:o,className:"hover:cursor-pointer",onClick:()=>u>1&&c(!s),children:x.Children.map(x.Children.toArray(t).slice(-1*u),(f,p)=>v.jsx("div",{className:`${!s&&"[&:not(:last-child)]:mb-1"} h-full w-full transition-all duration-300 ease-in-out`,style:{transform:s&&u>1?`scaleX(${d(p)}) translateY(-${h(p)}px)`:void 0},children:f}))})}const pE=Oi("flex flex-shrink bg-white rounded-full transform transition-transform ease-out",{variants:{size:{md:"w-3 h-3",lg:"w-7 h-7"}}}),gE=Oi("",{variants:{size:{md:"pr-4",lg:"pr-6"}}}),mE=({id:t,disabled:e,onChange:n,defaultChecked:r=!1,size:o="md"})=>{const i=e,[a,s]=x.useState(r),[c,u]=x.useState(!1),d=()=>{i||(s(!a),n&&n())},h=()=>{e||u(!0)},f=()=>{u(!1)},p=Sn("relative py-0.5 pl-0.5 rounded-full",{"ring-2 ring-core-white-900 outline-core-primary-500 outline outline-2 outline-offset-2":c,"bg-core-primary-500 hover:bg-core-primary-600":a&&!e,"bg-core-gray-200 hover:bg-core-gray-300":!a&&!e,"bg-core-gray-100":e},gE({size:o})),l=o==="lg"?"translate-x-[1.375rem] ease-out":"translate-x-3.5 ease-out";return v.jsxs("div",{className:`inline-flex items-center py-1 ${i?"pointer-events-none":"cursor-pointer "}`,onClick:d,onFocus:h,children:[v.jsx("input",{className:"sr-only ",id:t,type:"checkbox",checked:a,disabled:i,onBlur:f,onChange:d,onFocus:h}),v.jsx("div",{className:p,children:v.jsx("div",{className:Sn(pE({size:o}),`${a?l:""} ${i?"shadow-none":"shadow-xs"}`)})})]})},gd=({id:t,children:e,size:n="md",description:r,toggleLeft:o=!0,disabled:i,helperText:a,defaultChecked:s=!1,label:c,required:u=!1,tooltip:d,onChange:h})=>{const f=x.useId(),p=t??f;return v.jsxs("div",{className:`flex ${o?"flex-row":"flex-row-reverse"} items-start gap-3`,children:[v.jsx(mE,{disabled:i,defaultChecked:s,id:p,size:n,onChange:h}),e||(c||r||d||a)&&v.jsxs("div",{className:"inline-flex w-full flex-col self-center",children:[v.jsx(Pn,{className:Sn("font-normal"),description:r,required:u,tooltip:d,htmlFor:p,disabled:i,children:c}),v.jsx(Pn.Helper,{disabled:i,helperText:a})]})]})};gd.displayName="Switch";const v0=x.createContext(null);function yE(t=!1){const e=x.useContext(v0);if(!e&&!t)throw new Error("Switch.Item must be used within a SwitchGroup or SwitchGroup.Root");return e}const w0=x.forwardRef(({toggleLeft:t=!1,size:e="md",children:n,description:r,disabled:o,helperText:i,id:a,label:s,required:c,tooltip:u},d)=>{const h=x.useId(),f=a??h,p=s??r??u??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(Pn,{className:"cursor-default",description:r,required:c,tooltip:u,htmlFor:f,disabled:o,children:s}),v.jsx(Pn.Helper,{disabled:o,helperText:i})]}):null;return v.jsx(v0.Provider,{value:{disabled:o,toggleLeft:t,size:e},children:v.jsxs("div",{ref:d,"aria-describedby":i?`${f}__describer`:void 0,"aria-labelledby":s?`${f}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[s??i??r??u?v.jsx("div",{className:"flex flex-col",children:p}):null,n?v.jsx("div",{className:Sn("flex flex-col gap-2"),children:n}):null]})})});w0.displayName="SwitchGroup",Object.assign(w0,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=yE(),{disabled:o,size:i,toggleLeft:a}=r??{};return v.jsx(gd,{toggleLeft:a,disabled:t??o,label:e,defaultChecked:n,size:i})}});const vE=({children:t})=>v.jsx("div",{className:"fixed bottom-0 z-10 flex h-[70px] w-full border-b-0 border-t border-gray-100 bg-white lg:bottom-auto lg:top-0 lg:h-[50px] lg:border-b lg:border-t-0",children:t}),wE=({id:t,label:e,icon:n,pathname:r,activeTab:o,setActiveTab:i})=>v.jsx(X1,{className:"flex flex-grow items-center",to:r??"",children:v.jsxs("button",{className:`flex h-full flex-grow flex-col items-center justify-center gap-1 border-b-0 border-t-2 px-3 py-3 text-xs focus:outline-none lg:flex-row lg:border-b-2 lg:border-t-0 lg:text-sm ${o===t?"border-core-primary-500 text-core-primary-500":"border-transparent text-core-gray-500 hover:text-core-gray-800"}`,onClick:()=>i(t),children:[v.jsx(vn,{icon:n,className:"mr-2",variant:o===t?"discovery":"secondary"}),e]})}),b0=Object.prototype.toString;function md(t){switch(b0.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Xr(t,Error)}}function Di(t,e){return b0.call(t)===`[object ${e}]`}function E0(t){return Di(t,"ErrorEvent")}function C0(t){return Di(t,"DOMError")}function bE(t){return Di(t,"DOMException")}function zr(t){return Di(t,"String")}function yd(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function vd(t){return t===null||yd(t)||typeof t!="object"&&typeof t!="function"}function Mi(t){return Di(t,"Object")}function xc(t){return typeof Event<"u"&&Xr(t,Event)}function EE(t){return typeof Element<"u"&&Xr(t,Element)}function CE(t){return Di(t,"RegExp")}function Oc(t){return!!(t&&t.then&&typeof t.then=="function")}function _E(t){return Mi(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Xr(t,e){try{return t instanceof e}catch{return!1}}function _0(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Li(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function A0(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const o=t[r];try{_0(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function AE(t,e,n=!1){return zr(t)?CE(e)?e.test(t):zr(e)?n?t===e:t.includes(e):!1:!1}function zo(t,e=[],n=!1){return e.some(r=>AE(t,r,n))}function SE(t,e,n=250,r,o,i,a){if(!i.exception||!i.exception.values||!a||!Xr(a.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=IE(wd(t,e,o,a.originalException,r,i.exception.values,s,0),n))}function wd(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let c=[...i];if(Xr(r[o],Error)){S0(a,s);const u=t(e,r[o]),d=c.length;I0(u,o,d,s),c=wd(t,e,n,r[o],o,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Xr(u,Error)){S0(a,s);const h=t(e,u),f=c.length;I0(h,`errors[${d}]`,f,s),c=wd(t,e,n,u,o,[h,...c],h,f)}}),c}function S0(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function I0(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function IE(t,e){return t.map(n=>(n.value&&(n.value=Li(n.value,e)),n))}function T0(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Xo="8.34.0",gt=globalThis;function Pc(t,e,n){const r=gt,o=r.__SENTRY__=r.__SENTRY__||{},i=o[Xo]=o[Xo]||{};return i[t]||(i[t]=e())}const Fi=gt,TE=80;function Qo(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,o=[];let i=0,a=0;const s=" > ",c=s.length;let u;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||TE;for(;n&&i++<r&&(u=xE(n,d),!(u==="html"||i>1&&a+o.length*c+u.length>=h));)o.push(u),a+=u.length,n=n.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function xE(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Fi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(o&&o.length)o.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&zr(a)){const s=a.split(/\s+/);for(const c of s)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const a of i){const s=n.getAttribute(a);s&&r.push(`[${a}="${s}"]`)}return r.join("")}function OE(){try{return Fi.document.location.href}catch{return""}}function PE(t){return Fi.document&&Fi.document.querySelector?Fi.document.querySelector(t):null}function x0(t){if(!Fi.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const ji=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kE="Sentry Logger ",bd=["debug","info","warn","error","log","assert","trace"],kc={};function Ed(t){if(!("console"in gt))return t();const e=gt.console,n={},r=Object.keys(kc);r.forEach(o=>{const i=kc[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function BE(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ji?bd.forEach(n=>{e[n]=(...r)=>{t&&Ed(()=>{gt.console[n](`${kE}[${n}]:`,...r)})}}):bd.forEach(n=>{e[n]=()=>{}}),e}const Ie=Pc("logger",BE),NE=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function RE(t){return t==="http"||t==="https"}function Xa(t,e=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function DE(t){const e=NE.exec(t);if(!e){Ed(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,o="",i="",a="",s=""]=e.slice(1);let c="",u=s;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const h=u.match(/^\d+/);h&&(u=h[0])}return O0({host:i,pass:o,path:c,projectId:u,port:a,protocol:n,publicKey:r})}function O0(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ME(t){if(!ji)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(Ie.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?RE(r)?e&&isNaN(parseInt(e,10))?(Ie.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(Ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function LE(t){const e=typeof t=="string"?DE(t):O0(t);if(!(!e||!ME(e)))return e}class Lr extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function nr(t,e,n){if(!(e in t))return;const r=t[e],o=n(r);typeof o=="function"&&P0(o,r),t[e]=o}function gr(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{ji&&Ie.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function P0(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,gr(t,"__sentry_original__",e)}catch{}}function Cd(t){return t.__sentry_original__}function FE(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function k0(t){if(md(t))return{message:t.message,name:t.name,stack:t.stack,...N0(t)};if(xc(t)){const e={type:t.type,target:B0(t.target),currentTarget:B0(t.currentTarget),...N0(t)};return typeof CustomEvent<"u"&&Xr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function B0(t){try{return EE(t)?Qo(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function N0(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function jE(t,e=40){const n=Object.keys(k0(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Li(r,e);for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(!(i.length>e))return o===n.length?i:Li(i,e)}return""}function Tn(t){return _d(t,new Map)}function _d(t,e){if(VE(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const o of Object.getOwnPropertyNames(t))typeof t[o]<"u"&&(r[o]=_d(t[o],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(o=>{r.push(_d(o,e))}),r}return t}function VE(t){if(!Mi(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const R0=50,Jo="?",D0=/\(error: (.*)\)/,M0=/captureMessage|captureException/;function UE(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const i=[],a=n.split(`
102
102
  `);for(let s=r;s<a.length;s++){const c=a[s];if(c.length>1024)continue;const u=D0.test(c)?c.replace(D0,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of e){const h=d(u);if(h){i.push(h);break}}if(i.length>=R0+o)break}}return GE(i.slice(o))}}function GE(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(Bc(e).function||"")&&e.pop(),e.reverse(),M0.test(Bc(e).function||"")&&(e.pop(),M0.test(Bc(e).function||"")&&e.pop()),e.slice(0,R0).map(n=>({...n,filename:n.filename||Bc(e).filename,function:n.function||Jo}))}function Bc(t){return t[t.length-1]||{}}const Ad="<anonymous>";function Qr(t){try{return!t||typeof t!="function"?Ad:t.name||Ad}catch{return Ad}}function L0(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const Nc={},F0={};function Io(t,e){Nc[t]=Nc[t]||[],Nc[t].push(e)}function To(t,e){F0[t]||(e(),F0[t]=!0)}function mr(t,e){const n=t&&Nc[t];if(n)for(const r of n)try{r(e)}catch(o){ji&&Ie.error(`Error while triggering instrumentation handler.
103
103
  Type: ${t}
104
104
  Name: ${Qr(r)}
@@ -115,10 +115,10 @@ Event: ${xo(t)}`),!0):XC(t,e.denyUrls)?(Ke&&Ie.warn(`Event dropped due to being
115
115
  Event: ${xo(t)}.
116
116
  Url: ${$c(t)}`),!0):QC(t,e.allowUrls)?!1:(Ke&&Ie.warn(`Event dropped due to not being matched by \`allowUrls\` option.
117
117
  Event: ${xo(t)}.
118
- Url: ${$c(t)}`),!0)}function KC(t,e){return t.type||!e||!e.length?!1:JC(t).some(n=>zo(n,e))}function zC(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?zo(n,e):!1}function XC(t,e){if(!e||!e.length)return!1;const n=$c(t);return n?zo(n,e):!1}function QC(t,e){if(!e||!e.length)return!0;const n=$c(t);return n?zo(n,e):!0}function JC(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function ZC(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function e5(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function $c(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?e5(e):null}catch{return Ke&&Ie.error(`Cannot extract url for event ${xo(t)}`),null}}function t5(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}const n5="Dedupe",r5=()=>{let t;return{name:n5,processEvent(e){if(e.type)return e;try{if(o5(e,t))return Ke&&Ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function o5(t,e){return e?!!(i5(t,e)||a5(t,e)):!1}function i5(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Gg(t,e)||!Ug(t,e))}function a5(t,e){const n=qg(e),r=qg(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Gg(t,e)||!Ug(t,e))}function Ug(t,e){let n=L0(t),r=L0(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Gg(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function qg(t){return t.exception&&t.exception.values&&t.exception.values[0]}function s5(t,e,n,r,o="auto.http.browser"){if(!t.fetchData)return;const i=to()&&e(t.fetchData.url);if(t.endTimestamp&&i){const l=t.fetchData.__span;if(!l)return;const g=r[l];g&&(l5(g,t),delete r[l]);return}const a=rn(),s=Tt(),{method:c,url:u}=t.fetchData,d=u5(u),h=d?ei(d).host:void 0,f=!!kn(),p=i&&f?Bo({name:`${c} ${u}`,attributes:{url:u,type:"fetch","http.method":c,"http.url":d,"server.address":h,[on]:o,[ko]:"http.client"}}):new Hi;if(t.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(t.fetchData.url)&&s){const l=t.args[0];t.args[1]=t.args[1]||{};const g=t.args[1];g.headers=c5(l,s,a,g,to()&&f?p:void 0)}return p}function c5(t,e,n,r,o){const i=qi(),{traceId:a,spanId:s,sampled:c,dsc:u}={...i.getPropagationContext(),...n.getPropagationContext()},d=o?sg(o):kd(a,s,c),h=X0(u||(o?oi(o):qc(a,e))),f=r.headers||(typeof Request<"u"&&Xr(t,Request)?t.headers:void 0);if(f)if(typeof Headers<"u"&&Xr(f,Headers)){const p=new Headers(f);return p.append("sentry-trace",d),h&&p.append(Pd,h),p}else if(Array.isArray(f)){const p=[...f,["sentry-trace",d]];return h&&p.push([Pd,h]),p}else{const p="baggage"in f?f.baggage:void 0,l=[];return Array.isArray(p)?l.push(...p):p&&l.push(p),h&&l.push(h),{...f,"sentry-trace":d,baggage:l.length>0?l.join(","):void 0}}else return{"sentry-trace":d,baggage:h}}function u5(t){try{return new URL(t).href}catch{return}}function l5(t,e){if(e.response){og(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:hn,message:"internal_error"});t.end()}const Ze=gt;let $d=0;function Hg(){return $d>0}function d5(){$d++,setTimeout(()=>{$d--})}function $i(t,e={},n){if(typeof t!="function")return t;try{const o=t.__sentry_wrapped__;if(o)return typeof o=="function"?o:t;if(Cd(t))return t}catch{return t}const r=function(){const o=Array.prototype.slice.call(arguments);try{const i=o.map(a=>$i(a,e));return t.apply(this,i)}catch(i){throw d5(),Ld(a=>{a.addEventProcessor(s=>(e.mechanism&&(xd(s,void 0),Ja(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Pg(i)}),i}};try{for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}P0(r,t),gr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const no=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Yd(t,e){const n=Kd(t,e),r={type:m5(e),value:y5(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function f5(t,e,n,r){const o=Tt(),i=o&&o.getOptions().normalizeDepth,a=C5(e),s={__serialized__:W0(e,i)};if(a)return{exception:{values:[Yd(t,a)]},extra:s};const c={exception:{values:[{type:xc(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:b5(e,{isUnhandledRejection:r})}]},extra:s};if(n){const u=Kd(t,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function Wd(t,e){return{exception:{values:[Yd(t,e)]}}}function Kd(t,e){const n=e.stacktrace||e.stack||"",r=p5(e),o=g5(e);try{return t(n,r,o)}catch{}return[]}const h5=/Minified React error #\d+;/i;function p5(t){return t&&h5.test(t.message)?1:0}function g5(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function $g(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function m5(t){const e=t&&t.name;return!e&&$g(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function y5(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:$g(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function v5(t,e,n,r){const o=n&&n.syntheticException||void 0,i=zd(t,e,o,r);return Ja(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Zo(i)}function w5(t,e,n="info",r,o){const i=r&&r.syntheticException||void 0,a=Xd(t,e,i,o);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Zo(a)}function zd(t,e,n,r,o){let i;if(E0(e)&&e.error)return Wd(t,e.error);if(C0(e)||bE(e)){const a=e;if("stack"in e)i=Wd(t,e);else{const s=a.name||(C0(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=Xd(t,c,n,r),xd(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return md(e)?Wd(t,e):Mi(e)||xc(e)?(i=f5(t,e,n,o),Ja(i,{synthetic:!0}),i):(i=Xd(t,e,n,r),xd(i,`${e}`),Ja(i,{synthetic:!0}),i)}function Xd(t,e,n,r){const o={};if(r&&n){const i=Kd(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}if(yd(e)){const{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function b5(t,{isUnhandledRejection:e}){const n=jE(t),r=e?"promise rejection":"exception";return E0(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xc(t)?`Event \`${E5(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function E5(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function C5(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}function _5(t,{metadata:e,tunnel:n,dsn:r}){const o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Xa(r)}},i=A5(t);return Vi(o,[i])}function A5(t){return[{type:"user_report"},t]}class S5 extends RC{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e},r=Ze.SENTRY_SDK_SOURCE||e8();jC(n,"browser",["browser"],r),super(n),n.sendClientReports&&Ze.document&&Ze.document.addEventListener("visibilitychange",()=>{Ze.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return v5(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return w5(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){no&&Ie.warn("SDK not enabled, will not capture user feedback.");return}const n=_5(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}}const rr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,I5=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",Yi=(t,e,n,r)=>{let o,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(o||0),(i||o===void 0)&&(o=e.value,e.delta=i,e.rating=I5(e.value,n),t(e)))}},Fe=gt,T5=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ns=()=>Fe.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],rs=()=>{const t=ns();return t&&t.activationStart||0},Wi=(t,e)=>{const n=ns();let r="navigate";return n&&(Fe.document&&Fe.document.prerendering||rs()>0?r="prerender":Fe.document&&Fe.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:T5(),navigationType:r}},ai=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},os=t=>{const e=n=>{(n.type==="pagehide"||Fe.document&&Fe.document.visibilityState==="hidden")&&t(n)};Fe.document&&(addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0))},Qd=t=>{let e=!1;return n=>{e||(t(n),e=!0)}};let is=-1;const x5=()=>{is=Fe.document.visibilityState==="hidden"&&!Fe.document.prerendering?0:1/0},Yc=t=>{Fe.document.visibilityState==="hidden"&&is>-1&&(is=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("visibilitychange",Yc,!0),removeEventListener("prerenderingchange",Yc,!0))},O5=()=>{addEventListener("visibilitychange",Yc,!0),addEventListener("prerenderingchange",Yc,!0)},Wc=()=>(Fe.document&&is<0&&(x5(),O5()),{get firstHiddenTime(){return is}}),as=t=>{Fe.document&&Fe.document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},P5=[1800,3e3],k5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FCP");let o;const a=ai("paint",s=>{s.forEach(c=>{c.name==="first-contentful-paint"&&(a.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries.push(c),o(!0)))})});a&&(o=Yi(t,r,P5,e.reportAllChanges))})},B5=[.1,.25],N5=(t,e={})=>{k5(Qd(()=>{const n=Wi("CLS",0);let r,o=0,i=[];const a=c=>{c.forEach(u=>{if(!u.hadRecentInput){const d=i[0],h=i[i.length-1];o&&d&&h&&u.startTime-h.startTime<1e3&&u.startTime-d.startTime<5e3?(o+=u.value,i.push(u)):(o=u.value,i=[u])}}),o>n.value&&(n.value=o,n.entries=i,r())},s=ai("layout-shift",a);s&&(r=Yi(t,n,B5,e.reportAllChanges),os(()=>{a(s.takeRecords()),r(!0)}),setTimeout(r,0))}))},R5=[100,300],D5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FID");let o;const i=c=>{c.startTime<n.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),o(!0))},a=c=>{c.forEach(i)},s=ai("first-input",a);o=Yi(t,r,R5,e.reportAllChanges),s&&os(Qd(()=>{a(s.takeRecords()),s.disconnect()}))})};let Yg=0,Jd=1/0,Kc=0;const M5=t=>{t.forEach(e=>{e.interactionId&&(Jd=Math.min(Jd,e.interactionId),Kc=Math.max(Kc,e.interactionId),Yg=Kc?(Kc-Jd)/7+1:0)})};let Zd;const L5=()=>Zd?Yg:performance.interactionCount||0,F5=()=>{"interactionCount"in performance||Zd||(Zd=ai("event",M5,{type:"event",buffered:!0,durationThreshold:0}))},j5=[200,500],V5=0,Wg=()=>L5()-V5,Kg=10,ro=[],ef={},zg=t=>{const e=ro[ro.length-1],n=ef[t.interactionId];if(n||ro.length<Kg||e&&t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};ef[r.id]=r,ro.push(r)}ro.sort((r,o)=>o.latency-r.latency),ro.splice(Kg).forEach(r=>{delete ef[r.id]})}},U5=()=>{const t=Math.min(ro.length-1,Math.floor(Wg()/50));return ro[t]},G5=(t,e={})=>{as(()=>{F5();const n=Wi("INP");let r;const o=a=>{a.forEach(c=>{c.interactionId&&zg(c),c.entryType==="first-input"&&!ro.some(d=>d.entries.some(h=>c.duration===h.duration&&c.startTime===h.startTime))&&zg(c)});const s=U5();s&&s.latency!==n.value&&(n.value=s.latency,n.entries=s.entries,r())},i=ai("event",o,{durationThreshold:e.durationThreshold!=null?e.durationThreshold:40});r=Yi(t,n,j5,e.reportAllChanges),i&&("PerformanceEventTiming"in Fe&&"interactionId"in PerformanceEventTiming.prototype&&i.observe({type:"first-input",buffered:!0}),os(()=>{o(i.takeRecords()),n.value<0&&Wg()>0&&(n.value=0,n.entries=[]),r(!0)}))})},q5=[2500,4e3],Xg={},H5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("LCP");let o;const i=s=>{const c=s[s.length-1];c&&c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries=[c],o())},a=ai("largest-contentful-paint",i);if(a){o=Yi(t,r,q5,e.reportAllChanges);const s=Qd(()=>{Xg[r.id]||(i(a.takeRecords()),a.disconnect(),Xg[r.id]=!0,o(!0))});["keydown","click"].forEach(c=>{Fe.document&&addEventListener(c,()=>setTimeout(s,0),!0)}),os(s)}})},$5=[800,1800],tf=t=>{Fe.document&&Fe.document.prerendering?as(()=>tf(t)):Fe.document&&Fe.document.readyState!=="complete"?addEventListener("load",()=>tf(t),!0):setTimeout(t,0)},Y5=(t,e={})=>{const n=Wi("TTFB"),r=Yi(t,n,$5,e.reportAllChanges);tf(()=>{const o=ns();if(o){const i=o.responseStart;if(i<=0||i>performance.now())return;n.value=Math.max(i-rs(),0),n.entries=[o],r(!0)}})},ss={},zc={};let Qg,Jg,Zg,em,tm;function nm(t,e=!1){return us("cls",t,Q5,Qg,e)}function W5(t,e=!1){return us("lcp",t,Z5,Zg,e)}function K5(t){return us("fid",t,J5,Jg)}function z5(t){return us("ttfb",t,e_,em)}function X5(t){return us("inp",t,t_,tm)}function cs(t,e){return rm(t,e),zc[t]||(n_(t),zc[t]=!0),om(t,e)}function Ki(t,e){const n=ss[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(o){rr&&Ie.error(`Error while triggering instrumentation handler.
118
+ Url: ${$c(t)}`),!0)}function KC(t,e){return t.type||!e||!e.length?!1:JC(t).some(n=>zo(n,e))}function zC(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?zo(n,e):!1}function XC(t,e){if(!e||!e.length)return!1;const n=$c(t);return n?zo(n,e):!1}function QC(t,e){if(!e||!e.length)return!0;const n=$c(t);return n?zo(n,e):!0}function JC(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function ZC(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function e5(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function $c(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?e5(e):null}catch{return Ke&&Ie.error(`Cannot extract url for event ${xo(t)}`),null}}function t5(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}const n5="Dedupe",r5=()=>{let t;return{name:n5,processEvent(e){if(e.type)return e;try{if(o5(e,t))return Ke&&Ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function o5(t,e){return e?!!(i5(t,e)||a5(t,e)):!1}function i5(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Gg(t,e)||!Ug(t,e))}function a5(t,e){const n=qg(e),r=qg(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Gg(t,e)||!Ug(t,e))}function Ug(t,e){let n=L0(t),r=L0(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Gg(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function qg(t){return t.exception&&t.exception.values&&t.exception.values[0]}function s5(t,e,n,r,o="auto.http.browser"){if(!t.fetchData)return;const i=to()&&e(t.fetchData.url);if(t.endTimestamp&&i){const l=t.fetchData.__span;if(!l)return;const g=r[l];g&&(l5(g,t),delete r[l]);return}const a=rn(),s=Tt(),{method:c,url:u}=t.fetchData,d=u5(u),h=d?ei(d).host:void 0,f=!!kn(),p=i&&f?Bo({name:`${c} ${u}`,attributes:{url:u,type:"fetch","http.method":c,"http.url":d,"server.address":h,[on]:o,[ko]:"http.client"}}):new Hi;if(t.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(t.fetchData.url)&&s){const l=t.args[0];t.args[1]=t.args[1]||{};const g=t.args[1];g.headers=c5(l,s,a,g,to()&&f?p:void 0)}return p}function c5(t,e,n,r,o){const i=qi(),{traceId:a,spanId:s,sampled:c,dsc:u}={...i.getPropagationContext(),...n.getPropagationContext()},d=o?sg(o):kd(a,s,c),h=X0(u||(o?oi(o):qc(a,e))),f=r.headers||(typeof Request<"u"&&Xr(t,Request)?t.headers:void 0);if(f)if(typeof Headers<"u"&&Xr(f,Headers)){const p=new Headers(f);return p.append("sentry-trace",d),h&&p.append(Pd,h),p}else if(Array.isArray(f)){const p=[...f,["sentry-trace",d]];return h&&p.push([Pd,h]),p}else{const p="baggage"in f?f.baggage:void 0,l=[];return Array.isArray(p)?l.push(...p):p&&l.push(p),h&&l.push(h),{...f,"sentry-trace":d,baggage:l.length>0?l.join(","):void 0}}else return{"sentry-trace":d,baggage:h}}function u5(t){try{return new URL(t).href}catch{return}}function l5(t,e){if(e.response){og(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:hn,message:"internal_error"});t.end()}const et=gt;let $d=0;function Hg(){return $d>0}function d5(){$d++,setTimeout(()=>{$d--})}function $i(t,e={},n){if(typeof t!="function")return t;try{const o=t.__sentry_wrapped__;if(o)return typeof o=="function"?o:t;if(Cd(t))return t}catch{return t}const r=function(){const o=Array.prototype.slice.call(arguments);try{const i=o.map(a=>$i(a,e));return t.apply(this,i)}catch(i){throw d5(),Ld(a=>{a.addEventProcessor(s=>(e.mechanism&&(xd(s,void 0),Ja(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Pg(i)}),i}};try{for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}P0(r,t),gr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const no=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Yd(t,e){const n=Kd(t,e),r={type:m5(e),value:y5(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function f5(t,e,n,r){const o=Tt(),i=o&&o.getOptions().normalizeDepth,a=C5(e),s={__serialized__:W0(e,i)};if(a)return{exception:{values:[Yd(t,a)]},extra:s};const c={exception:{values:[{type:xc(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:b5(e,{isUnhandledRejection:r})}]},extra:s};if(n){const u=Kd(t,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function Wd(t,e){return{exception:{values:[Yd(t,e)]}}}function Kd(t,e){const n=e.stacktrace||e.stack||"",r=p5(e),o=g5(e);try{return t(n,r,o)}catch{}return[]}const h5=/Minified React error #\d+;/i;function p5(t){return t&&h5.test(t.message)?1:0}function g5(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function $g(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function m5(t){const e=t&&t.name;return!e&&$g(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function y5(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:$g(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function v5(t,e,n,r){const o=n&&n.syntheticException||void 0,i=zd(t,e,o,r);return Ja(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Zo(i)}function w5(t,e,n="info",r,o){const i=r&&r.syntheticException||void 0,a=Xd(t,e,i,o);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Zo(a)}function zd(t,e,n,r,o){let i;if(E0(e)&&e.error)return Wd(t,e.error);if(C0(e)||bE(e)){const a=e;if("stack"in e)i=Wd(t,e);else{const s=a.name||(C0(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=Xd(t,c,n,r),xd(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return md(e)?Wd(t,e):Mi(e)||xc(e)?(i=f5(t,e,n,o),Ja(i,{synthetic:!0}),i):(i=Xd(t,e,n,r),xd(i,`${e}`),Ja(i,{synthetic:!0}),i)}function Xd(t,e,n,r){const o={};if(r&&n){const i=Kd(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}if(yd(e)){const{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function b5(t,{isUnhandledRejection:e}){const n=jE(t),r=e?"promise rejection":"exception";return E0(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xc(t)?`Event \`${E5(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function E5(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function C5(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}function _5(t,{metadata:e,tunnel:n,dsn:r}){const o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Xa(r)}},i=A5(t);return Vi(o,[i])}function A5(t){return[{type:"user_report"},t]}class S5 extends RC{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e},r=et.SENTRY_SDK_SOURCE||e8();jC(n,"browser",["browser"],r),super(n),n.sendClientReports&&et.document&&et.document.addEventListener("visibilitychange",()=>{et.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return v5(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return w5(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){no&&Ie.warn("SDK not enabled, will not capture user feedback.");return}const n=_5(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}}const rr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,I5=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",Yi=(t,e,n,r)=>{let o,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(o||0),(i||o===void 0)&&(o=e.value,e.delta=i,e.rating=I5(e.value,n),t(e)))}},Fe=gt,T5=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ns=()=>Fe.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],rs=()=>{const t=ns();return t&&t.activationStart||0},Wi=(t,e)=>{const n=ns();let r="navigate";return n&&(Fe.document&&Fe.document.prerendering||rs()>0?r="prerender":Fe.document&&Fe.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:T5(),navigationType:r}},ai=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},os=t=>{const e=n=>{(n.type==="pagehide"||Fe.document&&Fe.document.visibilityState==="hidden")&&t(n)};Fe.document&&(addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0))},Qd=t=>{let e=!1;return n=>{e||(t(n),e=!0)}};let is=-1;const x5=()=>{is=Fe.document.visibilityState==="hidden"&&!Fe.document.prerendering?0:1/0},Yc=t=>{Fe.document.visibilityState==="hidden"&&is>-1&&(is=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("visibilitychange",Yc,!0),removeEventListener("prerenderingchange",Yc,!0))},O5=()=>{addEventListener("visibilitychange",Yc,!0),addEventListener("prerenderingchange",Yc,!0)},Wc=()=>(Fe.document&&is<0&&(x5(),O5()),{get firstHiddenTime(){return is}}),as=t=>{Fe.document&&Fe.document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},P5=[1800,3e3],k5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FCP");let o;const a=ai("paint",s=>{s.forEach(c=>{c.name==="first-contentful-paint"&&(a.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries.push(c),o(!0)))})});a&&(o=Yi(t,r,P5,e.reportAllChanges))})},B5=[.1,.25],N5=(t,e={})=>{k5(Qd(()=>{const n=Wi("CLS",0);let r,o=0,i=[];const a=c=>{c.forEach(u=>{if(!u.hadRecentInput){const d=i[0],h=i[i.length-1];o&&d&&h&&u.startTime-h.startTime<1e3&&u.startTime-d.startTime<5e3?(o+=u.value,i.push(u)):(o=u.value,i=[u])}}),o>n.value&&(n.value=o,n.entries=i,r())},s=ai("layout-shift",a);s&&(r=Yi(t,n,B5,e.reportAllChanges),os(()=>{a(s.takeRecords()),r(!0)}),setTimeout(r,0))}))},R5=[100,300],D5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FID");let o;const i=c=>{c.startTime<n.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),o(!0))},a=c=>{c.forEach(i)},s=ai("first-input",a);o=Yi(t,r,R5,e.reportAllChanges),s&&os(Qd(()=>{a(s.takeRecords()),s.disconnect()}))})};let Yg=0,Jd=1/0,Kc=0;const M5=t=>{t.forEach(e=>{e.interactionId&&(Jd=Math.min(Jd,e.interactionId),Kc=Math.max(Kc,e.interactionId),Yg=Kc?(Kc-Jd)/7+1:0)})};let Zd;const L5=()=>Zd?Yg:performance.interactionCount||0,F5=()=>{"interactionCount"in performance||Zd||(Zd=ai("event",M5,{type:"event",buffered:!0,durationThreshold:0}))},j5=[200,500],V5=0,Wg=()=>L5()-V5,Kg=10,ro=[],ef={},zg=t=>{const e=ro[ro.length-1],n=ef[t.interactionId];if(n||ro.length<Kg||e&&t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};ef[r.id]=r,ro.push(r)}ro.sort((r,o)=>o.latency-r.latency),ro.splice(Kg).forEach(r=>{delete ef[r.id]})}},U5=()=>{const t=Math.min(ro.length-1,Math.floor(Wg()/50));return ro[t]},G5=(t,e={})=>{as(()=>{F5();const n=Wi("INP");let r;const o=a=>{a.forEach(c=>{c.interactionId&&zg(c),c.entryType==="first-input"&&!ro.some(d=>d.entries.some(h=>c.duration===h.duration&&c.startTime===h.startTime))&&zg(c)});const s=U5();s&&s.latency!==n.value&&(n.value=s.latency,n.entries=s.entries,r())},i=ai("event",o,{durationThreshold:e.durationThreshold!=null?e.durationThreshold:40});r=Yi(t,n,j5,e.reportAllChanges),i&&("PerformanceEventTiming"in Fe&&"interactionId"in PerformanceEventTiming.prototype&&i.observe({type:"first-input",buffered:!0}),os(()=>{o(i.takeRecords()),n.value<0&&Wg()>0&&(n.value=0,n.entries=[]),r(!0)}))})},q5=[2500,4e3],Xg={},H5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("LCP");let o;const i=s=>{const c=s[s.length-1];c&&c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries=[c],o())},a=ai("largest-contentful-paint",i);if(a){o=Yi(t,r,q5,e.reportAllChanges);const s=Qd(()=>{Xg[r.id]||(i(a.takeRecords()),a.disconnect(),Xg[r.id]=!0,o(!0))});["keydown","click"].forEach(c=>{Fe.document&&addEventListener(c,()=>setTimeout(s,0),!0)}),os(s)}})},$5=[800,1800],tf=t=>{Fe.document&&Fe.document.prerendering?as(()=>tf(t)):Fe.document&&Fe.document.readyState!=="complete"?addEventListener("load",()=>tf(t),!0):setTimeout(t,0)},Y5=(t,e={})=>{const n=Wi("TTFB"),r=Yi(t,n,$5,e.reportAllChanges);tf(()=>{const o=ns();if(o){const i=o.responseStart;if(i<=0||i>performance.now())return;n.value=Math.max(i-rs(),0),n.entries=[o],r(!0)}})},ss={},zc={};let Qg,Jg,Zg,em,tm;function nm(t,e=!1){return us("cls",t,Q5,Qg,e)}function W5(t,e=!1){return us("lcp",t,Z5,Zg,e)}function K5(t){return us("fid",t,J5,Jg)}function z5(t){return us("ttfb",t,e_,em)}function X5(t){return us("inp",t,t_,tm)}function cs(t,e){return rm(t,e),zc[t]||(n_(t),zc[t]=!0),om(t,e)}function Ki(t,e){const n=ss[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(o){rr&&Ie.error(`Error while triggering instrumentation handler.
119
119
  Type: ${t}
120
120
  Name: ${Qr(r)}
121
- Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllChanges:!0})}function J5(){return D5(t=>{Ki("fid",{metric:t}),Jg=t})}function Z5(){return H5(t=>{Ki("lcp",{metric:t}),Zg=t},{reportAllChanges:!0})}function e_(){return Y5(t=>{Ki("ttfb",{metric:t}),em=t})}function t_(){return G5(t=>{Ki("inp",{metric:t}),tm=t})}function us(t,e,n,r,o=!1){rm(t,e);let i;return zc[t]||(i=n(),zc[t]=!0),r&&e({metric:r}),om(t,e,o?i:void 0)}function n_(t){const e={};t==="event"&&(e.durationThreshold=0),ai(t,n=>{Ki(t,{entries:n})},e)}function rm(t,e){ss[t]=ss[t]||[],ss[t].push(e)}function om(t,e,n){return()=>{n&&n();const r=ss[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function r_(t){return"duration"in t}function nf(t){return typeof t=="number"&&isFinite(t)}function zi(t,e,n,{...r}){const o=mt(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Ag(t,()=>{const i=Bo({startTime:e,...r});return i&&i.end(n),i})}function im(t){const e=Tt();if(!e)return;const{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),c=e.getIntegrationByName("Replay"),u=c&&c.getReplayId(),d=rn(),h=d.getUser(),f=h!==void 0?h.email||h.id||h.ip_address:void 0;let p;try{p=d.getScopeData().contexts.profile.profile_id}catch{}const l={release:a,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":Fe.navigator&&Fe.navigator.userAgent,...o};return Bo({name:n,attributes:l,startTime:i,experimental:{standalone:!0}})}function rf(){return Fe&&Fe.addEventListener&&Fe.performance}function qt(t){return t/1e3}function o_(){let t=0,e,n;if(!a_())return;let r=!1;function o(){r||(r=!0,n&&i_(t,e,n),i())}const i=nm(({metric:a})=>{const s=a.entries[a.entries.length-1];s&&(t=a.value,e=s)},!0);os(()=>{o()}),setTimeout(()=>{const a=Tt(),s=Zr([a,"optionalAccess",h=>h.on,"call",h=>h("startNavigationSpan",()=>{o(),s&&s()})]),c=kn(),u=c&&xn(c),d=u&&mt(u);d&&d.op==="pageload"&&(n=u.spanContext().spanId)},0)}function i_(t,e,n){rr&&Ie.log(`Sending CLS span (${t})`);const r=qt((qn||0)+(Zr([e,"optionalAccess",c=>c.startTime])||0)),o=rn().getScopeData().transactionName,i=e?Qo(Zr([e,"access",c=>c.sources,"access",c=>c[0],"optionalAccess",c=>c.node])):"Layout shift",a=Tn({[on]:"auto.http.browser.cls",[ko]:"ui.webvital.cls",[Vd]:Zr([e,"optionalAccess",c=>c.duration])||0,"sentry.pageload.span_id":n}),s=im({name:i,transaction:o,attributes:a,startTime:r});Zr([s,"optionalAccess",c=>c.addEvent,"call",c=>c("cls",{[Vc]:"",[Uc]:t})]),Zr([s,"optionalAccess",c=>c.end,"call",c=>c(r)])}function a_(){try{return Zr([PerformanceObserver,"access",t=>t.supportedEntryTypes,"optionalAccess",t=>t.includes,"call",t=>t("layout-shift")])}catch{return!1}}const s_=2147483647;let am=0,wn={},Fr,ls;function c_({recordClsStandaloneSpans:t}){const e=rf();if(e&&qn){e.mark&&Fe.performance.mark("sentry-tracing-init");const n=p_(),r=h_(),o=g_(),i=t?o_():f_();return()=>{n(),r(),o(),i&&i()}}return()=>{}}function u_(){cs("longtask",({entries:t})=>{if(kn())for(const e of t){const n=qt(qn+e.startTime),r=qt(e.duration),o=Bo({name:"Main UI thread blocked",op:"ui.long-task",startTime:n,attributes:{[on]:"auto.ui.browser.metrics"}});o&&o.end(n+r)}})}function l_(){new PerformanceObserver(e=>{if(kn())for(const n of e.getEntries()){if(!n.scripts[0])continue;const r=qt(qn+n.startTime),o=qt(n.duration),i={[on]:"auto.ui.browser.metrics"},a=n.scripts[0],{invoker:s,invokerType:c,sourceURL:u,sourceFunctionName:d,sourceCharPosition:h}=a;i["browser.script.invoker"]=s,i["browser.script.invoker_type"]=c,u&&(i["code.filepath"]=u),d&&(i["code.function"]=d),h!==-1&&(i["browser.script.source_char_position"]=h);const f=Bo({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:r,attributes:i});f&&f.end(r+o)}}).observe({type:"long-animation-frame",buffered:!0})}function d_(){cs("event",({entries:t})=>{if(kn()){for(const e of t)if(e.name==="click"){const n=qt(qn+e.startTime),r=qt(e.duration),o={name:Qo(e.target),op:`ui.interaction.${e.name}`,startTime:n,attributes:{[on]:"auto.ui.browser.metrics"}},i=x0(e.target);i&&(o.attributes["ui.component_name"]=i);const a=Bo(o);a&&a.end(n+r)}}})}function f_(){return nm(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log(`[Measurements] Adding CLS ${t.value}`),wn.cls={value:t.value,unit:""},ls=e)},!0)}function h_(){return W5(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log("[Measurements] Adding LCP"),wn.lcp={value:t.value,unit:"millisecond"},Fr=e)},!0)}function p_(){return K5(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=qt(qn),r=qt(e.startTime);rr&&Ie.log("[Measurements] Adding FID"),wn.fid={value:t.value,unit:"millisecond"},wn["mark.fid"]={value:n+r,unit:"second"}})}function g_(){return z5(({metric:t})=>{t.entries[t.entries.length-1]&&(rr&&Ie.log("[Measurements] Adding TTFB"),wn.ttfb={value:t.value,unit:"millisecond"})})}function m_(t,e){const n=rf();if(!n||!Fe.performance.getEntries||!qn)return;rr&&Ie.log("[Tracing] Adding & adjusting spans using Performance API");const r=qt(qn),o=n.getEntries(),{op:i,start_timestamp:a}=mt(t);if(o.slice(am).forEach(s=>{const c=qt(s.startTime),u=qt(Math.max(0,s.duration));if(!(i==="navigation"&&a&&r+c<a))switch(s.entryType){case"navigation":{v_(t,s,r);break}case"mark":case"paint":case"measure":{y_(t,s,c,u,r);const d=Wc(),h=s.startTime<d.firstHiddenTime;s.name==="first-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FP"),wn.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FCP"),wn.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{b_(t,s,s.name,c,u,r);break}}}),am=Math.max(o.length-1,0),E_(t),i==="pageload"){__(wn);const s=wn["mark.fid"];s&&wn.fid&&(zi(t,s.value,s.value+qt(wn.fid.value),{name:"first input delay",op:"ui.action",attributes:{[on]:"auto.ui.browser.metrics"}}),delete wn["mark.fid"]),(!("fcp"in wn)||!e.recordClsOnPageloadSpan)&&delete wn.cls,Object.entries(wn).forEach(([c,u])=>{rC(c,u.value,u.unit)}),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",rs()),C_(t)}Fr=void 0,ls=void 0,wn={}}function y_(t,e,n,r,o){const i=ns(),a=qt(i?i.requestStart:0),s=o+Math.max(n,a),c=o+n,u=c+r,d={[on]:"auto.resource.browser.metrics"};return s!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=s),zi(t,s,u,{name:e.name,op:e.entryType,attributes:d}),s}function v_(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Xc(t,e,r,n)}),Xc(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Xc(t,e,"fetch",n,"cache","domainLookupStart"),Xc(t,e,"domainLookup",n,"DNS"),w_(t,e,n)}function Xc(t,e,n,r,o,i){const a=i?e[i]:e[`${n}End`],s=e[`${n}Start`];!s||!a||zi(t,r+qt(s),r+qt(a),{op:`browser.${o||n}`,name:e.name,attributes:{[on]:"auto.ui.browser.metrics"}})}function w_(t,e,n){const r=n+qt(e.requestStart),o=n+qt(e.responseEnd),i=n+qt(e.responseStart);e.responseEnd&&(zi(t,r,o,{op:"browser.request",name:e.name,attributes:{[on]:"auto.ui.browser.metrics"}}),zi(t,i,o,{op:"browser.response",name:e.name,attributes:{[on]:"auto.ui.browser.metrics"}}))}function b_(t,e,n,r,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=ei(n),s={[on]:"auto.resource.browser.metrics"};of(s,e,"transferSize","http.response_transfer_size"),of(s,e,"encodedBodySize","http.response_content_length"),of(s,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus),a.protocol&&(s["url.scheme"]=a.protocol.split(":").pop()),a.host&&(s["server.address"]=a.host),s["url.same_origin"]=n.includes(Fe.location.origin);const c=i+r,u=c+o;zi(t,c,u,{name:n.replace(Fe.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:s})}function E_(t){const e=Fe.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),nf(n.rtt)&&(wn["connection.rtt"]={value:n.rtt,unit:"millisecond"})),nf(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),nf(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function C_(t){Fr&&(rr&&Ie.log("[Measurements] Adding LCP Data"),Fr.element&&t.setAttribute("lcp.element",Qo(Fr.element)),Fr.id&&t.setAttribute("lcp.id",Fr.id),Fr.url&&t.setAttribute("lcp.url",Fr.url.trim().slice(0,200)),t.setAttribute("lcp.size",Fr.size)),ls&&ls.sources&&(rr&&Ie.log("[Measurements] Adding CLS Data"),ls.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,Qo(e.node))))}function of(t,e,n,r){const o=e[n];o!=null&&o<s_&&(t[r]=o)}function __(t){const e=ns();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(rr&&Ie.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const A_=1e3;let sm,af,sf;function S_(t){const e="dom";Io(e,t),To(e,I_)}function I_(){if(!Fe.document)return;const t=mr.bind(null,"dom"),e=cm(t,!0);Fe.document.addEventListener("click",e,!1),Fe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=Fe[n]&&Fe[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(nr(r,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const h=cm(t);d.handler=h,o.call(this,i,h,s)}d.refCount++}catch{}return o.call(this,i,a,s)}}),nr(r,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,s),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}function T_(t){if(t.type!==af)return!1;try{if(!t.target||t.target._sentryId!==sf)return!1}catch{}return!0}function x_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function cm(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=O_(n);if(x_(n.type,r))return;gr(n,"_sentryCaptured",!0),r&&!r._sentryId&&gr(r,"_sentryId",Ut());const o=n.type==="keypress"?"input":n.type;T_(n)||(t({event:n,name:o,global:e}),af=n.type,sf=r?r._sentryId:void 0),clearTimeout(sm),sm=Fe.setTimeout(()=>{sf=void 0,af=void 0},A_)}}function O_(t){try{return t.target}catch{return null}}let Qc;function um(t){const e="history";Io(e,t),To(e,P_)}function P_(){if(!P8())return;const t=Fe.onpopstate;Fe.onpopstate=function(...n){const r=Fe.location.href,o=Qc;if(Qc=r,mr("history",{from:o,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const o=r.length>2?r[2]:void 0;if(o){const i=Qc,a=String(o);Qc=a,mr("history",{from:i,to:a})}return n.apply(this,r)}}nr(Fe.history,"pushState",e),nr(Fe.history,"replaceState",e)}const Jc={};function k_(t){const e=Jc[t];if(e)return e;let n=Fe[t];if(Id(n))return Jc[t]=n.bind(Fe);const r=Fe.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const i=o.contentWindow;i&&i[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){rr&&Ie.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(Jc[t]=n.bind(Fe))}function lm(t){Jc[t]=void 0}const Xi="__sentry_xhr_v3__";function dm(t){const e="xhr";Io(e,t),To(e,B_)}function B_(){if(!Fe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const o=Gn()*1e3,i=zr(r[0])?r[0].toUpperCase():void 0,a=N_(r[1]);if(!i||!a)return e.apply(n,r);n[Xi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const s=()=>{const c=n[Xi];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:Gn()*1e3,startTimestamp:o,xhr:n};mr("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return s(),c.apply(u,d)}}):n.addEventListener("readystatechange",s),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[h,f]=d,p=u[Xi];return p&&zr(h)&&zr(f)&&(p.request_headers[h.toLowerCase()]=f),c.apply(u,d)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const o=n[Xi];if(!o)return e.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const i={startTimestamp:Gn()*1e3,xhr:n};return mr("xhr",i),e.apply(n,r)}})}function N_(t){if(zr(t))return t;try{return t.toString()}catch{}}const cf=[],Zc=new Map;function R_(){if(rf()&&qn){const e=D_();return()=>{e()}}return()=>{}}const fm={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function D_(){return X5(({metric:t})=>{if(t.value==null)return;const e=t.entries.find(l=>l.duration===t.value&&fm[l.name]);if(!e)return;const{interactionId:n}=e,r=fm[e.name],o=qt(qn+e.startTime),i=qt(t.value),a=kn(),s=a?xn(a):void 0,u=(n!=null?Zc.get(n):void 0)||s,d=u?mt(u).description:rn().getScopeData().transactionName,h=Qo(e.target),f=Tn({[on]:"auto.http.browser.inp",[ko]:`ui.interaction.${r}`,[Vd]:e.duration}),p=im({name:h,transaction:d,attributes:f,startTime:o});Zr([p,"optionalAccess",l=>l.addEvent,"call",l=>l("inp",{[Vc]:"millisecond",[Uc]:t.value})]),Zr([p,"optionalAccess",l=>l.end,"call",l=>l(o+i)])})}function M_(t){const e=({entries:n})=>{const r=kn(),o=r&&xn(r);n.forEach(i=>{if(!r_(i)||!o)return;const a=i.interactionId;if(a!=null&&!Zc.has(a)){if(cf.length>10){const s=cf.shift();Zc.delete(s)}cf.push(a),Zc.set(a,o)}})};cs("event",e),cs("first-input",e)}function L_(t,e=k_("fetch")){let n=0,r=0;function o(i){const a=i.body.length;n+=a,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return lm("fetch"),Mc("No fetch implementation available");try{return e(t.url,s).then(c=>(n-=a,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return lm("fetch"),n-=a,r--,Mc(c)}}return FC(t,o)}const F_=30,j_=50;function uf(t,e,n,r){const o={filename:t,function:e==="<anonymous>"?Jo:e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const V_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,U_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,G_=/\((\S*)(?::(\d+))(?::(\d+))\)/,q_=[F_,t=>{const e=V_.exec(t);if(e){const[,r,o,i]=e;return uf(r,Jo,+o,+i)}const n=U_.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=G_.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[o,i]=hm(n[1]||Jo,n[2]);return uf(i,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],H_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y_=UE(...[q_,[j_,t=>{const e=H_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=$_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],o=e[1]||Jo;return[o,r]=hm(o,r),uf(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),hm=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Jo,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},eu=1024,W_="Breadcrumbs",K_=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:W_,setup(n){e.console&&qE(Q_(n)),e.dom&&S_(X_(n,e.dom)),e.xhr&&dm(J_(n)),e.fetch&&V0(Z_(n)),e.history&&um(eA(n)),e.sentry&&n.on("beforeSendEvent",z_(n))}}};function z_(t){return function(n){Tt()===t&&ii({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:xo(n)},{event:n})}}function X_(t,e){return function(r){if(Tt()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>eu&&(no&&Ie.warn(`\`dom.maxStringLength\` cannot exceed ${eu}, but a value of ${s} was configured. Sentry will use ${eu} instead.`),s=eu),typeof a=="string"&&(a=[a]);try{const u=r.event,d=tA(u)?u.target:u;o=Qo(d,{keyAttrs:a,maxStringLength:s}),i=x0(d)}catch{o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),ii(c,{event:r.event,name:r.name,global:r.global})}}function Q_(t){return function(n){if(Tt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:u8(n.level),message:A0(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${A0(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ii(r,{input:n.args,level:n.level})}}function J_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[Xi];if(!r||!o||!i)return;const{method:a,url:s,status_code:c,body:u}=i,d={method:a,url:s,status_code:c},h={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f=T0(c);ii({category:"xhr",data:d,type:"http",level:f},h)}}function Z_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o};ii({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c=T0(a.status_code);ii({category:"fetch",data:a,type:"http",level:c},s)}}}function eA(t){return function(n){if(Tt()!==t)return;let r=n.from,o=n.to;const i=ei(Ze.location.href);let a=r?ei(r):void 0;const s=ei(o);(!a||!a.path)&&(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),ii({category:"navigation",data:{from:r,to:o}})}}function tA(t){return!!t&&!!t.target}const nA=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],rA="BrowserApiErrors",oA=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:rA,setupOnce(){e.setTimeout&&nr(Ze,"setTimeout",pm),e.setInterval&&nr(Ze,"setInterval",pm),e.requestAnimationFrame&&nr(Ze,"requestAnimationFrame",iA),e.XMLHttpRequest&&"XMLHttpRequest"in Ze&&nr(XMLHttpRequest.prototype,"send",aA);const n=e.eventTarget;n&&(Array.isArray(n)?n:nA).forEach(sA)}}};function pm(t){return function(...e){const n=e[0];return e[0]=$i(n,{mechanism:{data:{function:Qr(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function iA(t){return function(e){return t.apply(this,[$i(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Qr(t)},handled:!1,type:"instrument"}})])}}function aA(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&nr(n,o,function(i){const a={mechanism:{data:{function:o,handler:Qr(i)},handled:!1,type:"instrument"}},s=Cd(i);return s&&(a.mechanism.data.handler=Qr(s)),$i(i,a)})}),t.apply(this,e)}}function sA(t){const e=Ze,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(nr(n,"addEventListener",function(r){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=$i(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Qr(i),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[o,$i(i,{mechanism:{data:{function:"addEventListener",handler:Qr(i),target:t},handled:!1,type:"instrument"}}),a])}}),nr(n,"removeEventListener",function(r){return function(o,i,a){const s=i;try{const c=s&&s.__sentry_wrapped__;c&&r.call(this,o,c,a)}catch{}return r.call(this,o,s,a)}}))}const cA="GlobalHandlers",uA=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:cA,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(lA(n),gm("onerror")),e.onunhandledrejection&&(dA(n),gm("onunhandledrejection"))}}};function lA(t){q0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const{msg:o,url:i,line:a,column:s,error:c}=e,u=pA(zd(n,c||o,void 0,r,!1),i,a,s);u.level="error",kg(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function dA(t){H0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const o=fA(e),i=vd(o)?hA(o):zd(n,o,void 0,r,!0);i.level="error",kg(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function fA(t){if(vd(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function hA(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function pA(t,e,n,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],u=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,h=zr(e)&&e.length>0?e:OE();return c.length===0&&c.push({colno:u,filename:h,function:Jo,in_app:!0,lineno:d}),t}function gm(t){no&&Ie.log(`Global Handler attached: ${t}`)}function mm(){const t=Tt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const gA=()=>({name:"HttpContext",preprocessEvent(t){if(!Ze.navigator&&!Ze.location&&!Ze.document)return;const e=t.request&&t.request.url||Ze.location&&Ze.location.href,{referrer:n}=Ze.document||{},{userAgent:r}=Ze.navigator||{},o={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:o};t.request=i}}),mA="cause",yA=5,vA="LinkedErrors",wA=(t={})=>{const e=t.limit||yA,n=t.key||mA;return{name:vA,preprocessEvent(r,o,i){const a=i.getOptions();SE(Yd,a.stackParser,a.maxValueLength,n,e,r,o)}}};function bA(t){return[$C(),GC(),oA(),K_(),uA(),wA(),r5(),gA()]}const ym=new WeakMap,lf=new Map,df={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0};function EA(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a}={traceFetch:df.traceFetch,traceXHR:df.traceXHR,...e},s=typeof o=="function"?o:d=>!0,c=d=>SA(d,a),u={};n&&(t.addEventProcessor(d=>(d.type==="transaction"&&d.spans&&d.spans.forEach(h=>{if(h.op==="http.client"){const f=lf.get(h.span_id);f&&(h.timestamp=f/1e3,lf.delete(h.span_id))}}),d)),KE(d=>{if(d.response){const h=ym.get(d.response);h&&d.endTimestamp&&lf.set(h,d.endTimestamp)}}),V0(d=>{const h=s5(d,s,c,u);if(d.response&&d.fetchData.__span&&ym.set(d.response,d.fetchData.__span),h){const f=wm(d.fetchData.url),p=f?ei(f).host:void 0;h.setAttributes({"http.url":f,"server.address":p})}i&&h&&vm(h)})),r&&dm(d=>{const h=IA(d,s,c,u);i&&h&&vm(h)})}function CA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function vm(t){const{url:e}=mt(t).data||{};if(!e||typeof e!="string")return;const n=cs("resource",({entries:r})=>{r.forEach(o=>{CA(o)&&o.name.endsWith(e)&&(AA(o).forEach(a=>t.setAttribute(...a)),setTimeout(n))})})}function _A(t){let e="unknown",n="unknown",r="";for(const o of t){if(o==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(o))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=o}return r===t&&(e=r),{name:e,version:n}}function jr(t=0){return((qn||performance.timeOrigin)+t)/1e3}function AA(t){const{name:e,version:n}=_A(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),qn?[...r,["http.request.redirect_start",jr(t.redirectStart)],["http.request.fetch_start",jr(t.fetchStart)],["http.request.domain_lookup_start",jr(t.domainLookupStart)],["http.request.domain_lookup_end",jr(t.domainLookupEnd)],["http.request.connect_start",jr(t.connectStart)],["http.request.secure_connection_start",jr(t.secureConnectionStart)],["http.request.connection_end",jr(t.connectEnd)],["http.request.request_start",jr(t.requestStart)],["http.request.response_start",jr(t.responseStart)],["http.request.response_end",jr(t.responseEnd)]]:r}function SA(t,e){const n=Ze.location&&Ze.location.href;if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}const i=r.origin===o;return e?zo(r.toString(),e)||i&&zo(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?zo(t,e):r}}function IA(t,e,n,r){const o=t.xhr,i=o&&o[Xi];if(!o||o.__sentry_own_request__||!i)return;const a=to()&&e(i.url);if(t.endTimestamp&&a){const f=o.__sentry_xhr_span_id__;if(!f)return;const p=r[f];p&&i.status_code!==void 0&&(og(p,i.status_code),p.end(),delete r[f]);return}const s=wm(i.url),c=s?ei(s).host:void 0,u=!!kn(),d=a&&u?Bo({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":s,url:i.url,"server.address":c,[on]:"auto.http.browser",[ko]:"http.client"}}):new Hi;o.__sentry_xhr_span_id__=d.spanContext().spanId,r[o.__sentry_xhr_span_id__]=d;const h=Tt();return o.setRequestHeader&&n(i.url)&&h&&TA(o,h,to()&&u?d:void 0),d}function TA(t,e,n){const r=rn(),o=qi(),{traceId:i,spanId:a,sampled:s,dsc:c}={...o.getPropagationContext(),...r.getPropagationContext()},u=n&&to()?sg(n):kd(i,a,s),d=X0(c||(n?oi(n):qc(i,e)));xA(t,u,d)}function xA(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(Pd,n)}catch{}}function wm(t){try{return new URL(t,Ze.location.origin).href}catch{return}}function OA(){Ze&&Ze.document?Ze.document.addEventListener("visibilitychange",()=>{const t=kn();if(!t)return;const e=xn(t);if(Ze.document.hidden&&e){const n="cancelled",{op:r,status:o}=mt(e);no&&Ie.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:hn,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):no&&Ie.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const PA="BrowserTracing",kA={...Hc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...df},BA=(t={})=>{K8();const{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:o,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:s,finalTimeout:c,childSpanTimeout:u,markBackgroundSpan:d,traceFetch:h,traceXHR:f,shouldCreateSpanForRequest:p,enableHTTPTimings:l,instrumentPageLoad:g,instrumentNavigation:m}={...kA,...t},y=c_({recordClsStandaloneSpans:i||!1});e&&R_(),r&&gt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?l_():n&&u_(),o&&d_();const w={name:void 0,source:void 0};function b(E,C){const I=C.op==="pageload",T=a?a(C):C,P=T.attributes||{};C.name!==T.name&&(P[eo]="custom",T.attributes=P),w.name=T.name,w.source=P[eo];const N=Tg(T,{idleTimeout:s,finalTimeout:c,childSpanTimeout:u,disableAutoFinish:I,beforeSpanEnd:V=>{y(),m_(V,{recordClsOnPageloadSpan:!i})}});function L(){["interactive","complete"].includes(Ze.document.readyState)&&E.emit("idleSpanEnableAutoFinish",N)}return I&&Ze.document&&(Ze.document.addEventListener("readystatechange",()=>{L()}),L()),N}return{name:PA,afterAllSetup(E){let C,I=Ze.location&&Ze.location.href;E.on("startNavigationSpan",T=>{Tt()===E&&(C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end()),C=b(E,{op:"navigation",...T}))}),E.on("startPageLoadSpan",(T,P={})=>{if(Tt()!==E)return;C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end());const N=P.sentryTrace||Em("sentry-trace"),L=P.baggage||Em("baggage"),V=m8(N,L);rn().setPropagationContext(V),C=b(E,{op:"pageload",...T})}),E.on("spanEnd",T=>{const P=mt(T).op;if(T!==xn(T)||P!=="navigation"&&P!=="pageload")return;const N=rn(),L=N.getPropagationContext();N.setPropagationContext({...L,sampled:L.sampled!==void 0?L.sampled:ni(T),dsc:L.dsc||oi(T)})}),Ze.location&&(g&&bm(E,{name:Ze.location.pathname,startTime:qn?qn/1e3:void 0,attributes:{[eo]:"url",[on]:"auto.pageload.browser"}}),m&&um(({to:T,from:P})=>{if(P===void 0&&I&&I.indexOf(T)!==-1){I=void 0;return}P!==T&&(I=void 0,NA(E,{name:Ze.location.pathname,attributes:{[eo]:"url",[on]:"auto.navigation.browser"}}))})),d&&OA(),o&&RA(s,c,u,w),e&&M_(),EA(E,{traceFetch:h,traceXHR:f,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:p,enableHTTPTimings:l})}}};function bm(t,e,n){t.emit("startPageLoadSpan",e,n),rn().setTransactionName(e.name);const r=kn();return(r&&mt(r).op)==="pageload"?r:void 0}function NA(t,e){qi().setPropagationContext(Lc()),rn().setPropagationContext(Lc()),t.emit("startNavigationSpan",e),rn().setTransactionName(e.name);const n=kn();return(n&&mt(n).op)==="navigation"?n:void 0}function Em(t){const e=PE(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function RA(t,e,n,r){let o;const i=()=>{const a="ui.action.click",s=kn(),c=s&&xn(s);if(c){const u=mt(c).op;if(["navigation","pageload"].includes(u)){no&&Ie.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(jd,"interactionInterrupted"),o.end(),o=void 0),!r.name){no&&Ie.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Tg({name:r.name,op:a,attributes:{[eo]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};Ze.document&&addEventListener("click",i,{once:!1,capture:!0})}var ff={exports:{}},wt={};/** @license React v16.13.1
121
+ Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllChanges:!0})}function J5(){return D5(t=>{Ki("fid",{metric:t}),Jg=t})}function Z5(){return H5(t=>{Ki("lcp",{metric:t}),Zg=t},{reportAllChanges:!0})}function e_(){return Y5(t=>{Ki("ttfb",{metric:t}),em=t})}function t_(){return G5(t=>{Ki("inp",{metric:t}),tm=t})}function us(t,e,n,r,o=!1){rm(t,e);let i;return zc[t]||(i=n(),zc[t]=!0),r&&e({metric:r}),om(t,e,o?i:void 0)}function n_(t){const e={};t==="event"&&(e.durationThreshold=0),ai(t,n=>{Ki(t,{entries:n})},e)}function rm(t,e){ss[t]=ss[t]||[],ss[t].push(e)}function om(t,e,n){return()=>{n&&n();const r=ss[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function r_(t){return"duration"in t}function nf(t){return typeof t=="number"&&isFinite(t)}function zi(t,e,n,{...r}){const o=mt(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Ag(t,()=>{const i=Bo({startTime:e,...r});return i&&i.end(n),i})}function im(t){const e=Tt();if(!e)return;const{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),c=e.getIntegrationByName("Replay"),u=c&&c.getReplayId(),d=rn(),h=d.getUser(),f=h!==void 0?h.email||h.id||h.ip_address:void 0;let p;try{p=d.getScopeData().contexts.profile.profile_id}catch{}const l={release:a,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":Fe.navigator&&Fe.navigator.userAgent,...o};return Bo({name:n,attributes:l,startTime:i,experimental:{standalone:!0}})}function rf(){return Fe&&Fe.addEventListener&&Fe.performance}function qt(t){return t/1e3}function o_(){let t=0,e,n;if(!a_())return;let r=!1;function o(){r||(r=!0,n&&i_(t,e,n),i())}const i=nm(({metric:a})=>{const s=a.entries[a.entries.length-1];s&&(t=a.value,e=s)},!0);os(()=>{o()}),setTimeout(()=>{const a=Tt(),s=Zr([a,"optionalAccess",h=>h.on,"call",h=>h("startNavigationSpan",()=>{o(),s&&s()})]),c=kn(),u=c&&xn(c),d=u&&mt(u);d&&d.op==="pageload"&&(n=u.spanContext().spanId)},0)}function i_(t,e,n){rr&&Ie.log(`Sending CLS span (${t})`);const r=qt((qn||0)+(Zr([e,"optionalAccess",c=>c.startTime])||0)),o=rn().getScopeData().transactionName,i=e?Qo(Zr([e,"access",c=>c.sources,"access",c=>c[0],"optionalAccess",c=>c.node])):"Layout shift",a=Tn({[on]:"auto.http.browser.cls",[ko]:"ui.webvital.cls",[Vd]:Zr([e,"optionalAccess",c=>c.duration])||0,"sentry.pageload.span_id":n}),s=im({name:i,transaction:o,attributes:a,startTime:r});Zr([s,"optionalAccess",c=>c.addEvent,"call",c=>c("cls",{[Vc]:"",[Uc]:t})]),Zr([s,"optionalAccess",c=>c.end,"call",c=>c(r)])}function a_(){try{return Zr([PerformanceObserver,"access",t=>t.supportedEntryTypes,"optionalAccess",t=>t.includes,"call",t=>t("layout-shift")])}catch{return!1}}const s_=2147483647;let am=0,wn={},Fr,ls;function c_({recordClsStandaloneSpans:t}){const e=rf();if(e&&qn){e.mark&&Fe.performance.mark("sentry-tracing-init");const n=p_(),r=h_(),o=g_(),i=t?o_():f_();return()=>{n(),r(),o(),i&&i()}}return()=>{}}function u_(){cs("longtask",({entries:t})=>{if(kn())for(const e of t){const n=qt(qn+e.startTime),r=qt(e.duration),o=Bo({name:"Main UI thread blocked",op:"ui.long-task",startTime:n,attributes:{[on]:"auto.ui.browser.metrics"}});o&&o.end(n+r)}})}function l_(){new PerformanceObserver(e=>{if(kn())for(const n of e.getEntries()){if(!n.scripts[0])continue;const r=qt(qn+n.startTime),o=qt(n.duration),i={[on]:"auto.ui.browser.metrics"},a=n.scripts[0],{invoker:s,invokerType:c,sourceURL:u,sourceFunctionName:d,sourceCharPosition:h}=a;i["browser.script.invoker"]=s,i["browser.script.invoker_type"]=c,u&&(i["code.filepath"]=u),d&&(i["code.function"]=d),h!==-1&&(i["browser.script.source_char_position"]=h);const f=Bo({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:r,attributes:i});f&&f.end(r+o)}}).observe({type:"long-animation-frame",buffered:!0})}function d_(){cs("event",({entries:t})=>{if(kn()){for(const e of t)if(e.name==="click"){const n=qt(qn+e.startTime),r=qt(e.duration),o={name:Qo(e.target),op:`ui.interaction.${e.name}`,startTime:n,attributes:{[on]:"auto.ui.browser.metrics"}},i=x0(e.target);i&&(o.attributes["ui.component_name"]=i);const a=Bo(o);a&&a.end(n+r)}}})}function f_(){return nm(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log(`[Measurements] Adding CLS ${t.value}`),wn.cls={value:t.value,unit:""},ls=e)},!0)}function h_(){return W5(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log("[Measurements] Adding LCP"),wn.lcp={value:t.value,unit:"millisecond"},Fr=e)},!0)}function p_(){return K5(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=qt(qn),r=qt(e.startTime);rr&&Ie.log("[Measurements] Adding FID"),wn.fid={value:t.value,unit:"millisecond"},wn["mark.fid"]={value:n+r,unit:"second"}})}function g_(){return z5(({metric:t})=>{t.entries[t.entries.length-1]&&(rr&&Ie.log("[Measurements] Adding TTFB"),wn.ttfb={value:t.value,unit:"millisecond"})})}function m_(t,e){const n=rf();if(!n||!Fe.performance.getEntries||!qn)return;rr&&Ie.log("[Tracing] Adding & adjusting spans using Performance API");const r=qt(qn),o=n.getEntries(),{op:i,start_timestamp:a}=mt(t);if(o.slice(am).forEach(s=>{const c=qt(s.startTime),u=qt(Math.max(0,s.duration));if(!(i==="navigation"&&a&&r+c<a))switch(s.entryType){case"navigation":{v_(t,s,r);break}case"mark":case"paint":case"measure":{y_(t,s,c,u,r);const d=Wc(),h=s.startTime<d.firstHiddenTime;s.name==="first-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FP"),wn.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FCP"),wn.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{b_(t,s,s.name,c,u,r);break}}}),am=Math.max(o.length-1,0),E_(t),i==="pageload"){__(wn);const s=wn["mark.fid"];s&&wn.fid&&(zi(t,s.value,s.value+qt(wn.fid.value),{name:"first input delay",op:"ui.action",attributes:{[on]:"auto.ui.browser.metrics"}}),delete wn["mark.fid"]),(!("fcp"in wn)||!e.recordClsOnPageloadSpan)&&delete wn.cls,Object.entries(wn).forEach(([c,u])=>{rC(c,u.value,u.unit)}),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",rs()),C_(t)}Fr=void 0,ls=void 0,wn={}}function y_(t,e,n,r,o){const i=ns(),a=qt(i?i.requestStart:0),s=o+Math.max(n,a),c=o+n,u=c+r,d={[on]:"auto.resource.browser.metrics"};return s!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=s),zi(t,s,u,{name:e.name,op:e.entryType,attributes:d}),s}function v_(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Xc(t,e,r,n)}),Xc(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Xc(t,e,"fetch",n,"cache","domainLookupStart"),Xc(t,e,"domainLookup",n,"DNS"),w_(t,e,n)}function Xc(t,e,n,r,o,i){const a=i?e[i]:e[`${n}End`],s=e[`${n}Start`];!s||!a||zi(t,r+qt(s),r+qt(a),{op:`browser.${o||n}`,name:e.name,attributes:{[on]:"auto.ui.browser.metrics"}})}function w_(t,e,n){const r=n+qt(e.requestStart),o=n+qt(e.responseEnd),i=n+qt(e.responseStart);e.responseEnd&&(zi(t,r,o,{op:"browser.request",name:e.name,attributes:{[on]:"auto.ui.browser.metrics"}}),zi(t,i,o,{op:"browser.response",name:e.name,attributes:{[on]:"auto.ui.browser.metrics"}}))}function b_(t,e,n,r,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=ei(n),s={[on]:"auto.resource.browser.metrics"};of(s,e,"transferSize","http.response_transfer_size"),of(s,e,"encodedBodySize","http.response_content_length"),of(s,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus),a.protocol&&(s["url.scheme"]=a.protocol.split(":").pop()),a.host&&(s["server.address"]=a.host),s["url.same_origin"]=n.includes(Fe.location.origin);const c=i+r,u=c+o;zi(t,c,u,{name:n.replace(Fe.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:s})}function E_(t){const e=Fe.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),nf(n.rtt)&&(wn["connection.rtt"]={value:n.rtt,unit:"millisecond"})),nf(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),nf(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function C_(t){Fr&&(rr&&Ie.log("[Measurements] Adding LCP Data"),Fr.element&&t.setAttribute("lcp.element",Qo(Fr.element)),Fr.id&&t.setAttribute("lcp.id",Fr.id),Fr.url&&t.setAttribute("lcp.url",Fr.url.trim().slice(0,200)),t.setAttribute("lcp.size",Fr.size)),ls&&ls.sources&&(rr&&Ie.log("[Measurements] Adding CLS Data"),ls.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,Qo(e.node))))}function of(t,e,n,r){const o=e[n];o!=null&&o<s_&&(t[r]=o)}function __(t){const e=ns();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(rr&&Ie.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const A_=1e3;let sm,af,sf;function S_(t){const e="dom";Io(e,t),To(e,I_)}function I_(){if(!Fe.document)return;const t=mr.bind(null,"dom"),e=cm(t,!0);Fe.document.addEventListener("click",e,!1),Fe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=Fe[n]&&Fe[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(nr(r,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const h=cm(t);d.handler=h,o.call(this,i,h,s)}d.refCount++}catch{}return o.call(this,i,a,s)}}),nr(r,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,s),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}function T_(t){if(t.type!==af)return!1;try{if(!t.target||t.target._sentryId!==sf)return!1}catch{}return!0}function x_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function cm(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=O_(n);if(x_(n.type,r))return;gr(n,"_sentryCaptured",!0),r&&!r._sentryId&&gr(r,"_sentryId",Ut());const o=n.type==="keypress"?"input":n.type;T_(n)||(t({event:n,name:o,global:e}),af=n.type,sf=r?r._sentryId:void 0),clearTimeout(sm),sm=Fe.setTimeout(()=>{sf=void 0,af=void 0},A_)}}function O_(t){try{return t.target}catch{return null}}let Qc;function um(t){const e="history";Io(e,t),To(e,P_)}function P_(){if(!P8())return;const t=Fe.onpopstate;Fe.onpopstate=function(...n){const r=Fe.location.href,o=Qc;if(Qc=r,mr("history",{from:o,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const o=r.length>2?r[2]:void 0;if(o){const i=Qc,a=String(o);Qc=a,mr("history",{from:i,to:a})}return n.apply(this,r)}}nr(Fe.history,"pushState",e),nr(Fe.history,"replaceState",e)}const Jc={};function k_(t){const e=Jc[t];if(e)return e;let n=Fe[t];if(Id(n))return Jc[t]=n.bind(Fe);const r=Fe.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const i=o.contentWindow;i&&i[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){rr&&Ie.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(Jc[t]=n.bind(Fe))}function lm(t){Jc[t]=void 0}const Xi="__sentry_xhr_v3__";function dm(t){const e="xhr";Io(e,t),To(e,B_)}function B_(){if(!Fe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const o=Gn()*1e3,i=zr(r[0])?r[0].toUpperCase():void 0,a=N_(r[1]);if(!i||!a)return e.apply(n,r);n[Xi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const s=()=>{const c=n[Xi];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:Gn()*1e3,startTimestamp:o,xhr:n};mr("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return s(),c.apply(u,d)}}):n.addEventListener("readystatechange",s),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[h,f]=d,p=u[Xi];return p&&zr(h)&&zr(f)&&(p.request_headers[h.toLowerCase()]=f),c.apply(u,d)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const o=n[Xi];if(!o)return e.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const i={startTimestamp:Gn()*1e3,xhr:n};return mr("xhr",i),e.apply(n,r)}})}function N_(t){if(zr(t))return t;try{return t.toString()}catch{}}const cf=[],Zc=new Map;function R_(){if(rf()&&qn){const e=D_();return()=>{e()}}return()=>{}}const fm={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function D_(){return X5(({metric:t})=>{if(t.value==null)return;const e=t.entries.find(l=>l.duration===t.value&&fm[l.name]);if(!e)return;const{interactionId:n}=e,r=fm[e.name],o=qt(qn+e.startTime),i=qt(t.value),a=kn(),s=a?xn(a):void 0,u=(n!=null?Zc.get(n):void 0)||s,d=u?mt(u).description:rn().getScopeData().transactionName,h=Qo(e.target),f=Tn({[on]:"auto.http.browser.inp",[ko]:`ui.interaction.${r}`,[Vd]:e.duration}),p=im({name:h,transaction:d,attributes:f,startTime:o});Zr([p,"optionalAccess",l=>l.addEvent,"call",l=>l("inp",{[Vc]:"millisecond",[Uc]:t.value})]),Zr([p,"optionalAccess",l=>l.end,"call",l=>l(o+i)])})}function M_(t){const e=({entries:n})=>{const r=kn(),o=r&&xn(r);n.forEach(i=>{if(!r_(i)||!o)return;const a=i.interactionId;if(a!=null&&!Zc.has(a)){if(cf.length>10){const s=cf.shift();Zc.delete(s)}cf.push(a),Zc.set(a,o)}})};cs("event",e),cs("first-input",e)}function L_(t,e=k_("fetch")){let n=0,r=0;function o(i){const a=i.body.length;n+=a,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return lm("fetch"),Mc("No fetch implementation available");try{return e(t.url,s).then(c=>(n-=a,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return lm("fetch"),n-=a,r--,Mc(c)}}return FC(t,o)}const F_=30,j_=50;function uf(t,e,n,r){const o={filename:t,function:e==="<anonymous>"?Jo:e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const V_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,U_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,G_=/\((\S*)(?::(\d+))(?::(\d+))\)/,q_=[F_,t=>{const e=V_.exec(t);if(e){const[,r,o,i]=e;return uf(r,Jo,+o,+i)}const n=U_.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=G_.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[o,i]=hm(n[1]||Jo,n[2]);return uf(i,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],H_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y_=UE(...[q_,[j_,t=>{const e=H_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=$_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],o=e[1]||Jo;return[o,r]=hm(o,r),uf(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),hm=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Jo,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},eu=1024,W_="Breadcrumbs",K_=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:W_,setup(n){e.console&&qE(Q_(n)),e.dom&&S_(X_(n,e.dom)),e.xhr&&dm(J_(n)),e.fetch&&V0(Z_(n)),e.history&&um(eA(n)),e.sentry&&n.on("beforeSendEvent",z_(n))}}};function z_(t){return function(n){Tt()===t&&ii({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:xo(n)},{event:n})}}function X_(t,e){return function(r){if(Tt()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>eu&&(no&&Ie.warn(`\`dom.maxStringLength\` cannot exceed ${eu}, but a value of ${s} was configured. Sentry will use ${eu} instead.`),s=eu),typeof a=="string"&&(a=[a]);try{const u=r.event,d=tA(u)?u.target:u;o=Qo(d,{keyAttrs:a,maxStringLength:s}),i=x0(d)}catch{o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),ii(c,{event:r.event,name:r.name,global:r.global})}}function Q_(t){return function(n){if(Tt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:u8(n.level),message:A0(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${A0(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ii(r,{input:n.args,level:n.level})}}function J_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[Xi];if(!r||!o||!i)return;const{method:a,url:s,status_code:c,body:u}=i,d={method:a,url:s,status_code:c},h={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f=T0(c);ii({category:"xhr",data:d,type:"http",level:f},h)}}function Z_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o};ii({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c=T0(a.status_code);ii({category:"fetch",data:a,type:"http",level:c},s)}}}function eA(t){return function(n){if(Tt()!==t)return;let r=n.from,o=n.to;const i=ei(et.location.href);let a=r?ei(r):void 0;const s=ei(o);(!a||!a.path)&&(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),ii({category:"navigation",data:{from:r,to:o}})}}function tA(t){return!!t&&!!t.target}const nA=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],rA="BrowserApiErrors",oA=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:rA,setupOnce(){e.setTimeout&&nr(et,"setTimeout",pm),e.setInterval&&nr(et,"setInterval",pm),e.requestAnimationFrame&&nr(et,"requestAnimationFrame",iA),e.XMLHttpRequest&&"XMLHttpRequest"in et&&nr(XMLHttpRequest.prototype,"send",aA);const n=e.eventTarget;n&&(Array.isArray(n)?n:nA).forEach(sA)}}};function pm(t){return function(...e){const n=e[0];return e[0]=$i(n,{mechanism:{data:{function:Qr(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function iA(t){return function(e){return t.apply(this,[$i(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Qr(t)},handled:!1,type:"instrument"}})])}}function aA(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&nr(n,o,function(i){const a={mechanism:{data:{function:o,handler:Qr(i)},handled:!1,type:"instrument"}},s=Cd(i);return s&&(a.mechanism.data.handler=Qr(s)),$i(i,a)})}),t.apply(this,e)}}function sA(t){const e=et,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(nr(n,"addEventListener",function(r){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=$i(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Qr(i),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[o,$i(i,{mechanism:{data:{function:"addEventListener",handler:Qr(i),target:t},handled:!1,type:"instrument"}}),a])}}),nr(n,"removeEventListener",function(r){return function(o,i,a){const s=i;try{const c=s&&s.__sentry_wrapped__;c&&r.call(this,o,c,a)}catch{}return r.call(this,o,s,a)}}))}const cA="GlobalHandlers",uA=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:cA,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(lA(n),gm("onerror")),e.onunhandledrejection&&(dA(n),gm("onunhandledrejection"))}}};function lA(t){q0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const{msg:o,url:i,line:a,column:s,error:c}=e,u=pA(zd(n,c||o,void 0,r,!1),i,a,s);u.level="error",kg(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function dA(t){H0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const o=fA(e),i=vd(o)?hA(o):zd(n,o,void 0,r,!0);i.level="error",kg(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function fA(t){if(vd(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function hA(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function pA(t,e,n,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],u=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,h=zr(e)&&e.length>0?e:OE();return c.length===0&&c.push({colno:u,filename:h,function:Jo,in_app:!0,lineno:d}),t}function gm(t){no&&Ie.log(`Global Handler attached: ${t}`)}function mm(){const t=Tt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const gA=()=>({name:"HttpContext",preprocessEvent(t){if(!et.navigator&&!et.location&&!et.document)return;const e=t.request&&t.request.url||et.location&&et.location.href,{referrer:n}=et.document||{},{userAgent:r}=et.navigator||{},o={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:o};t.request=i}}),mA="cause",yA=5,vA="LinkedErrors",wA=(t={})=>{const e=t.limit||yA,n=t.key||mA;return{name:vA,preprocessEvent(r,o,i){const a=i.getOptions();SE(Yd,a.stackParser,a.maxValueLength,n,e,r,o)}}};function bA(t){return[$C(),GC(),oA(),K_(),uA(),wA(),r5(),gA()]}const ym=new WeakMap,lf=new Map,df={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0};function EA(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a}={traceFetch:df.traceFetch,traceXHR:df.traceXHR,...e},s=typeof o=="function"?o:d=>!0,c=d=>SA(d,a),u={};n&&(t.addEventProcessor(d=>(d.type==="transaction"&&d.spans&&d.spans.forEach(h=>{if(h.op==="http.client"){const f=lf.get(h.span_id);f&&(h.timestamp=f/1e3,lf.delete(h.span_id))}}),d)),KE(d=>{if(d.response){const h=ym.get(d.response);h&&d.endTimestamp&&lf.set(h,d.endTimestamp)}}),V0(d=>{const h=s5(d,s,c,u);if(d.response&&d.fetchData.__span&&ym.set(d.response,d.fetchData.__span),h){const f=wm(d.fetchData.url),p=f?ei(f).host:void 0;h.setAttributes({"http.url":f,"server.address":p})}i&&h&&vm(h)})),r&&dm(d=>{const h=IA(d,s,c,u);i&&h&&vm(h)})}function CA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function vm(t){const{url:e}=mt(t).data||{};if(!e||typeof e!="string")return;const n=cs("resource",({entries:r})=>{r.forEach(o=>{CA(o)&&o.name.endsWith(e)&&(AA(o).forEach(a=>t.setAttribute(...a)),setTimeout(n))})})}function _A(t){let e="unknown",n="unknown",r="";for(const o of t){if(o==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(o))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=o}return r===t&&(e=r),{name:e,version:n}}function jr(t=0){return((qn||performance.timeOrigin)+t)/1e3}function AA(t){const{name:e,version:n}=_A(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),qn?[...r,["http.request.redirect_start",jr(t.redirectStart)],["http.request.fetch_start",jr(t.fetchStart)],["http.request.domain_lookup_start",jr(t.domainLookupStart)],["http.request.domain_lookup_end",jr(t.domainLookupEnd)],["http.request.connect_start",jr(t.connectStart)],["http.request.secure_connection_start",jr(t.secureConnectionStart)],["http.request.connection_end",jr(t.connectEnd)],["http.request.request_start",jr(t.requestStart)],["http.request.response_start",jr(t.responseStart)],["http.request.response_end",jr(t.responseEnd)]]:r}function SA(t,e){const n=et.location&&et.location.href;if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}const i=r.origin===o;return e?zo(r.toString(),e)||i&&zo(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?zo(t,e):r}}function IA(t,e,n,r){const o=t.xhr,i=o&&o[Xi];if(!o||o.__sentry_own_request__||!i)return;const a=to()&&e(i.url);if(t.endTimestamp&&a){const f=o.__sentry_xhr_span_id__;if(!f)return;const p=r[f];p&&i.status_code!==void 0&&(og(p,i.status_code),p.end(),delete r[f]);return}const s=wm(i.url),c=s?ei(s).host:void 0,u=!!kn(),d=a&&u?Bo({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":s,url:i.url,"server.address":c,[on]:"auto.http.browser",[ko]:"http.client"}}):new Hi;o.__sentry_xhr_span_id__=d.spanContext().spanId,r[o.__sentry_xhr_span_id__]=d;const h=Tt();return o.setRequestHeader&&n(i.url)&&h&&TA(o,h,to()&&u?d:void 0),d}function TA(t,e,n){const r=rn(),o=qi(),{traceId:i,spanId:a,sampled:s,dsc:c}={...o.getPropagationContext(),...r.getPropagationContext()},u=n&&to()?sg(n):kd(i,a,s),d=X0(c||(n?oi(n):qc(i,e)));xA(t,u,d)}function xA(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(Pd,n)}catch{}}function wm(t){try{return new URL(t,et.location.origin).href}catch{return}}function OA(){et&&et.document?et.document.addEventListener("visibilitychange",()=>{const t=kn();if(!t)return;const e=xn(t);if(et.document.hidden&&e){const n="cancelled",{op:r,status:o}=mt(e);no&&Ie.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:hn,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):no&&Ie.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const PA="BrowserTracing",kA={...Hc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...df},BA=(t={})=>{K8();const{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:o,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:s,finalTimeout:c,childSpanTimeout:u,markBackgroundSpan:d,traceFetch:h,traceXHR:f,shouldCreateSpanForRequest:p,enableHTTPTimings:l,instrumentPageLoad:g,instrumentNavigation:m}={...kA,...t},y=c_({recordClsStandaloneSpans:i||!1});e&&R_(),r&&gt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?l_():n&&u_(),o&&d_();const w={name:void 0,source:void 0};function b(E,C){const I=C.op==="pageload",T=a?a(C):C,P=T.attributes||{};C.name!==T.name&&(P[eo]="custom",T.attributes=P),w.name=T.name,w.source=P[eo];const N=Tg(T,{idleTimeout:s,finalTimeout:c,childSpanTimeout:u,disableAutoFinish:I,beforeSpanEnd:V=>{y(),m_(V,{recordClsOnPageloadSpan:!i})}});function L(){["interactive","complete"].includes(et.document.readyState)&&E.emit("idleSpanEnableAutoFinish",N)}return I&&et.document&&(et.document.addEventListener("readystatechange",()=>{L()}),L()),N}return{name:PA,afterAllSetup(E){let C,I=et.location&&et.location.href;E.on("startNavigationSpan",T=>{Tt()===E&&(C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end()),C=b(E,{op:"navigation",...T}))}),E.on("startPageLoadSpan",(T,P={})=>{if(Tt()!==E)return;C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end());const N=P.sentryTrace||Em("sentry-trace"),L=P.baggage||Em("baggage"),V=m8(N,L);rn().setPropagationContext(V),C=b(E,{op:"pageload",...T})}),E.on("spanEnd",T=>{const P=mt(T).op;if(T!==xn(T)||P!=="navigation"&&P!=="pageload")return;const N=rn(),L=N.getPropagationContext();N.setPropagationContext({...L,sampled:L.sampled!==void 0?L.sampled:ni(T),dsc:L.dsc||oi(T)})}),et.location&&(g&&bm(E,{name:et.location.pathname,startTime:qn?qn/1e3:void 0,attributes:{[eo]:"url",[on]:"auto.pageload.browser"}}),m&&um(({to:T,from:P})=>{if(P===void 0&&I&&I.indexOf(T)!==-1){I=void 0;return}P!==T&&(I=void 0,NA(E,{name:et.location.pathname,attributes:{[eo]:"url",[on]:"auto.navigation.browser"}}))})),d&&OA(),o&&RA(s,c,u,w),e&&M_(),EA(E,{traceFetch:h,traceXHR:f,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:p,enableHTTPTimings:l})}}};function bm(t,e,n){t.emit("startPageLoadSpan",e,n),rn().setTransactionName(e.name);const r=kn();return(r&&mt(r).op)==="pageload"?r:void 0}function NA(t,e){qi().setPropagationContext(Lc()),rn().setPropagationContext(Lc()),t.emit("startNavigationSpan",e),rn().setTransactionName(e.name);const n=kn();return(n&&mt(n).op)==="navigation"?n:void 0}function Em(t){const e=PE(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function RA(t,e,n,r){let o;const i=()=>{const a="ui.action.click",s=kn(),c=s&&xn(s);if(c){const u=mt(c).op;if(["navigation","pageload"].includes(u)){no&&Ie.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(jd,"interactionInterrupted"),o.end(),o=void 0),!r.name){no&&Ie.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Tg({name:r.name,op:a,attributes:{[eo]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};et.document&&addEventListener("click",i,{once:!1,capture:!0})}var ff={exports:{}},wt={};/** @license React v16.13.1
122
122
  * react-is.production.min.js
123
123
  *
124
124
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -132,15 +132,15 @@ Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllCha
132
132
  *
133
133
  * This source code is licensed under the MIT license found in the
134
134
  * LICENSE file in the root directory of this source tree.
135
- */var _m;function MA(){return _m||(_m=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,l=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function b(B){return typeof B=="string"||typeof B=="function"||B===r||B===u||B===i||B===o||B===h||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===l||B.$$typeof===p||B.$$typeof===a||B.$$typeof===s||B.$$typeof===d||B.$$typeof===m||B.$$typeof===y||B.$$typeof===w||B.$$typeof===g)}function E(B){if(typeof B=="object"&&B!==null){var Q=B.$$typeof;switch(Q){case e:var Z=B.type;switch(Z){case c:case u:case r:case i:case o:case h:return Z;default:var ee=Z&&Z.$$typeof;switch(ee){case s:case d:case l:case p:case a:return ee;default:return Q}}case n:return Q}}}var C=c,I=u,T=s,P=a,N=e,L=d,V=r,j=l,W=p,q=n,k=i,U=o,z=h,te=!1;function oe(B){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ne(B)||E(B)===c}function ne(B){return E(B)===u}function se(B){return E(B)===s}function we(B){return E(B)===a}function le(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function _e(B){return E(B)===d}function ve(B){return E(B)===r}function H(B){return E(B)===l}function $(B){return E(B)===p}function J(B){return E(B)===n}function S(B){return E(B)===i}function M(B){return E(B)===o}function F(B){return E(B)===h}bt.AsyncMode=C,bt.ConcurrentMode=I,bt.ContextConsumer=T,bt.ContextProvider=P,bt.Element=N,bt.ForwardRef=L,bt.Fragment=V,bt.Lazy=j,bt.Memo=W,bt.Portal=q,bt.Profiler=k,bt.StrictMode=U,bt.Suspense=z,bt.isAsyncMode=oe,bt.isConcurrentMode=ne,bt.isContextConsumer=se,bt.isContextProvider=we,bt.isElement=le,bt.isForwardRef=_e,bt.isFragment=ve,bt.isLazy=H,bt.isMemo=$,bt.isPortal=J,bt.isProfiler=S,bt.isStrictMode=M,bt.isSuspense=F,bt.isValidElementType=b,bt.typeOf=E}()),bt}process.env.NODE_ENV==="production"?ff.exports=DA():ff.exports=MA();var LA=ff.exports,Am=LA,FA={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sm={};Sm[Am.ForwardRef]=FA,Sm[Am.Memo]=jA;const VA=new WeakSet;function UA(t){const e=BA({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:o,createRoutesFromChildren:i,matchRoutes:a,stripBasename:s,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=t;return{...e,setup(){},afterAllSetup(d){e.afterAllSetup(d);const h=Ze&&Ze.location&&Ze.location.pathname;c&&h&&bm(d,{name:h,attributes:{[eo]:"url",[ko]:"pageload",[on]:"auto.pageload.react.reactrouter_v6"}}),u&&VA.add(d)}}}function GA(){const{t}=Ue(),[e,n]=x.useState(!1);return v.jsx("div",{className:"default-bg-colors flex h-screen items-center justify-center",children:v.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-300 bg-white shadow-lg",children:[v.jsx("div",{className:"border-b border-gray-200 bg-gray-50 px-6 pb-3 pt-4 shadow",children:v.jsx("h2",{className:"text-3xl",children:"Oops!"})}),v.jsx("p",{className:"mt-4 px-6 text-gray-900",children:t("sorrySomethingWentWrong")}),v.jsx("div",{className:"mt-10 p-6",children:v.jsx(rt,{onClick:()=>{n(!0),window.location.replace("/")},pending:e,label:t("back")})})]})})}class qA extends x.Component{constructor(e){super(e),this.state={hasError:!1,scope:void 0}}componentDidMount(){const e=bA().filter(o=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(o.name)),n=new S5({dsn:"https://5b16c396f6e8f6e4b0b87455bea7e96b@o80526.ingest.us.sentry.io/4507345428283392",transport:L_,stackParser:Y_,integrations:[...e,UA({useEffect:x.useEffect,useLocation:er,useNavigationType:k3,createRoutesFromChildren:nc,matchRoutes:L1})]}),r=new Po;r.setClient(n),n.init(),this.setState({...this.state,scope:r})}componentDidCatch(e,n){console.error("ErrorBoundary: ",e,n),this.state.scope.captureException(e),this.setState({...this.state,hasError:!0})}render(){return this.state.hasError?v.jsx(GA,{}):this.props.children}}function je(){const t=x.useContext(sh);if(!t)throw new Error("Only use 'usePortalSessionContext' within a PortalSessionProvider");return t}const HA={[Kt.GENERIC]:Le.GENERIC,[Kt.PORTAL]:Le.PORTAL,[Kt.POINTS_TRANSACTION]:Le.POINTS_TRANSACTION,[Kt.PREPAID]:Le.PREPAID,[Kt.PAY_PREPAID]:Le.PREPAID,[Kt.TOP_UP_PREPAID]:Le.PREPAID,[Kt.VOUCHER]:Le.VOUCHER,[Kt.GIFTCARD]:Le.GIFTCARD,[Kt.REDEEM_GIFTCARD]:Le.GIFTCARD,[Kt.TOP_UP_GIFTCARD]:Le.GIFTCARD};function $A(){const{portalSession:t}=je();return v.jsx(dr,{to:HA[t.type]})}function si({onSubmit:t,children:e}){const n=r=>{r.preventDefault(),t&&t(r)};return v.jsx("form",{onSubmit:n,children:e})}var Im={},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.compactObject=Pm,Hn.deprecated=e7;var YA=Hn.detectBrowser=t7;Hn.disableLog=QA,Hn.disableWarnings=JA,Hn.extractVersion=tu,Hn.filterStats=n7,Hn.log=ZA,Hn.walkStats=nu,Hn.wrapPeerConnectionEvent=XA;function WA(t,e,n){return e=KA(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KA(t){var e=zA(t,"string");return No(e)=="symbol"?e:e+""}function zA(t,e){if(No(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(No(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function No(t){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(t)}var Tm=!0,xm=!0;function tu(t,e,n){var r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function XA(t,e,n){if(t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(a,s){if(a!==e)return o.apply(this,arguments);var c=function(d){var h=n(d);h&&(s.handleEvent?s.handleEvent(h):s(h))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(s,c),o.apply(this,[a,c])};var i=r.removeEventListener;r.removeEventListener=function(a,s){if(a!==e||!this._eventMap||!this._eventMap[e])return i.apply(this,arguments);if(!this._eventMap[e].has(s))return i.apply(this,arguments);var c=this._eventMap[e].get(s);return this._eventMap[e].delete(s),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,i.apply(this,[a,c])},Object.defineProperty(r,"on"+e,{get:function(){return this["_on"+e]},set:function(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}}function QA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(Tm=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function JA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(xm=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function ZA(){if((typeof window>"u"?"undefined":No(window))==="object"){if(Tm)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function e7(t,e){xm&&console.warn(t+" is deprecated, please use "+e+" instead.")}function t7(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var n=t.navigator;if(n.userAgentData&&n.userAgentData.brands){var r=n.userAgentData.brands.find(function(o){return o.brand==="Chromium"});if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(n.mozGetUserMedia)e.browser="firefox",e.version=tu(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=tu(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=tu(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Om(t){return Object.prototype.toString.call(t)==="[object Object]"}function Pm(t){return Om(t)?Object.keys(t).reduce(function(e,n){var r=Om(t[n]),o=r?Pm(t[n]):t[n],i=r&&!Object.keys(o).length;return o===void 0||i?e:Object.assign(e,WA({},n,o))},{}):t}function nu(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(function(r){r.endsWith("Id")?nu(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(function(o){nu(t,t.get(o),n)})}))}function n7(t,e,n){var r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(e===null)return o;var i=[];return t.forEach(function(a){a.type==="track"&&a.trackIdentifier===e.id&&i.push(a)}),i.forEach(function(a){t.forEach(function(s){s.type===r&&s.trackId===a.id&&nu(t,s,o)})}),o}Object.defineProperty(Im,"__esModule",{value:!0});var r7=Im.shimGetUserMedia=a7,o7=i7(Hn);function km(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(km=function(o){return o?n:e})(t)}function i7(t,e){if(t&&t.__esModule)return t;if(t===null||Ro(t)!="object"&&typeof t!="function")return{default:t};var n=km(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Ro(t){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(t)}var Bm=o7.log;function a7(t,e){var n=t&&t.navigator;if(n.mediaDevices){var r=function(u){if(Ro(u)!=="object"||u.mandatory||u.optional)return u;var d={};return Object.keys(u).forEach(function(h){if(!(h==="require"||h==="advanced"||h==="mediaSource")){var f=Ro(u[h])==="object"?u[h]:{ideal:u[h]};f.exact!==void 0&&typeof f.exact=="number"&&(f.min=f.max=f.exact);var p=function(m,y){return m?m+y.charAt(0).toUpperCase()+y.slice(1):y==="deviceId"?"sourceId":y};if(f.ideal!==void 0){d.optional=d.optional||[];var l={};typeof f.ideal=="number"?(l[p("min",h)]=f.ideal,d.optional.push(l),l={},l[p("max",h)]=f.ideal,d.optional.push(l)):(l[p("",h)]=f.ideal,d.optional.push(l))}f.exact!==void 0&&typeof f.exact!="number"?(d.mandatory=d.mandatory||{},d.mandatory[p("",h)]=f.exact):["min","max"].forEach(function(g){f[g]!==void 0&&(d.mandatory=d.mandatory||{},d.mandatory[p(g,h)]=f[g])})}}),u.advanced&&(d.optional=(d.optional||[]).concat(u.advanced)),d},o=function(u,d){if(e.version>=61)return d(u);if(u=JSON.parse(JSON.stringify(u)),u&&Ro(u.audio)==="object"){var h=function(m,y,w){y in m&&!(w in m)&&(m[w]=m[y],delete m[y])};u=JSON.parse(JSON.stringify(u)),h(u.audio,"autoGainControl","googAutoGainControl"),h(u.audio,"noiseSuppression","googNoiseSuppression"),u.audio=r(u.audio)}if(u&&Ro(u.video)==="object"){var f=u.video.facingMode;f=f&&(Ro(f)==="object"?f:{ideal:f});var p=e.version<66;if(f&&(f.exact==="user"||f.exact==="environment"||f.ideal==="user"||f.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!p)){delete u.video.facingMode;var l;if(f.exact==="environment"||f.ideal==="environment"?l=["back","rear"]:(f.exact==="user"||f.ideal==="user")&&(l=["front"]),l)return n.mediaDevices.enumerateDevices().then(function(g){g=g.filter(function(y){return y.kind==="videoinput"});var m=g.find(function(y){return l.some(function(w){return y.label.toLowerCase().includes(w)})});return!m&&g.length&&l.includes("back")&&(m=g[g.length-1]),m&&(u.video.deviceId=f.exact?{exact:m.deviceId}:{ideal:m.deviceId}),u.video=r(u.video),Bm("chrome: "+JSON.stringify(u)),d(u)})}u.video=r(u.video)}return Bm("chrome: "+JSON.stringify(u)),d(u)},i=function(u){return e.version>=64?u:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[u.name]||u.name,message:u.message,constraint:u.constraint||u.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},a=function(u,d,h){o(u,function(f){n.webkitGetUserMedia(f,d,function(p){h&&h(i(p))})})};if(n.getUserMedia=a.bind(n),n.mediaDevices.getUserMedia){var s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return o(c,function(u){return s(u).then(function(d){if(u.audio&&!d.getAudioTracks().length||u.video&&!d.getVideoTracks().length)throw d.getTracks().forEach(function(h){h.stop()}),new DOMException("","NotFoundError");return d},function(d){return Promise.reject(i(d))})})}}}}var Nm={};Object.defineProperty(Nm,"__esModule",{value:!0});var s7=Nm.shimGetUserMedia=l7,c7=u7(Hn);function Rm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Rm=function(o){return o?n:e})(t)}function u7(t,e){if(t&&t.__esModule)return t;if(t===null||Qi(t)!="object"&&typeof t!="function")return{default:t};var n=Rm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Qi(t){"@babel/helpers - typeof";return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(t)}function l7(t,e){var n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(c,u,d){c7.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(c).then(u,d)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var o=function(u,d,h){d in u&&!(h in u)&&(u[h]=u[d],delete u[d])},i=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(c){return Qi(c)==="object"&&Qi(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c.audio,"autoGainControl","mozAutoGainControl"),o(c.audio,"noiseSuppression","mozNoiseSuppression")),i(c)},r&&r.prototype.getSettings){var a=r.prototype.getSettings;r.prototype.getSettings=function(){var c=a.apply(this,arguments);return o(c,"mozAutoGainControl","autoGainControl"),o(c,"mozNoiseSuppression","noiseSuppression"),c}}if(r&&r.prototype.applyConstraints){var s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(c){return this.kind==="audio"&&Qi(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c,"autoGainControl","mozAutoGainControl"),o(c,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[c])}}}}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.shimAudioContext=b7,Vr.shimCallbacksAPI=g7,Vr.shimConstraints=Lm,Vr.shimCreateOfferLegacy=w7;var d7=Vr.shimGetUserMedia=m7;Vr.shimLocalStreamsAPI=h7,Vr.shimRTCIceServerUrls=y7,Vr.shimRemoteStreamsAPI=p7,Vr.shimTrackEventTransceiver=v7;var Dm=f7(Hn);function Mm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Mm=function(o){return o?n:e})(t)}function f7(t,e){if(t&&t.__esModule)return t;if(t===null||Do(t)!="object"&&typeof t!="function")return{default:t};var n=Mm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Do(t){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Do(t)}function h7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){var o=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(function(i){return e.call(o,i,r)}),r.getVideoTracks().forEach(function(i){return e.call(o,i,r)})},t.RTCPeerConnection.prototype.addTrack=function(r){for(var o=this,i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return a&&a.forEach(function(c){o._localStreams?o._localStreams.includes(c)||o._localStreams.push(c):o._localStreams=[c]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(r){var o=this;this._localStreams||(this._localStreams=[]);var i=this._localStreams.indexOf(r);if(i!==-1){this._localStreams.splice(i,1);var a=r.getTracks();this.getSenders().forEach(function(s){a.includes(s.track)&&o.removeTrack(s)})}})}}function p7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(r){var o=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=r),this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(function(a){if(o._remoteStreams||(o._remoteStreams=[]),!o._remoteStreams.includes(a)){o._remoteStreams.push(a);var s=new Event("addstream");s.stream=a,o.dispatchEvent(s)}})})}});var e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(o){o.streams.forEach(function(i){if(r._remoteStreams||(r._remoteStreams=[]),!(r._remoteStreams.indexOf(i)>=0)){r._remoteStreams.push(i);var a=new Event("addstream");a.stream=i,r.dispatchEvent(a)}})}),e.apply(r,arguments)}}}function g7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,o=e.setLocalDescription,i=e.setRemoteDescription,a=e.addIceCandidate;e.createOffer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=n.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f},e.createAnswer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=r.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f};var s=function(u,d,h){var f=o.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f};e.setLocalDescription=s,s=function(u,d,h){var f=i.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.setRemoteDescription=s,s=function(u,d,h){var f=a.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.addIceCandidate=s}}function m7(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=function(o){return r(Lm(o))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(i,a,s){e.mediaDevices.getUserMedia(i).then(a,s)}).bind(e))}function Lm(t){return t&&t.video!==void 0?Object.assign({},t,{video:Dm.compactObject(t.video)}):t}function y7(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,o){if(r&&r.iceServers){for(var i=[],a=0;a<r.iceServers.length;a++){var s=r.iceServers[a];s.urls===void 0&&s.url?(Dm.deprecated("RTCIceServer.url","RTCIceServer.urls"),s=JSON.parse(JSON.stringify(s)),s.urls=s.url,delete s.url,i.push(s)):i.push(r.iceServers[a])}r.iceServers=i}return new e(r,o)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:function(){return e.generateCertificate}})}}function v7(t){Do(t)==="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function w7(t){var e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);var o=this.getTransceivers().find(function(a){return a.receiver.track.kind==="audio"});r.offerToReceiveAudio===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveAudio===!0&&!o&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);var i=this.getTransceivers().find(function(a){return a.receiver.track.kind==="video"});r.offerToReceiveVideo===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveVideo===!0&&!i&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function b7(t){Do(t)!=="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Fm=t=>{throw TypeError(t)},jm=(t,e,n)=>e.has(t)||Fm("Cannot "+n),E7=(t,e,n)=>(jm(t,e,"read from private field"),n?n.call(t):e.get(t)),C7=(t,e,n)=>e.has(t)?Fm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),_7=(t,e,n,r)=>(jm(t,e,"write to private field"),e.set(t,n),n);const Vm=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function A7(t){return t.join("|")}function S7(t){const e=Um(t);let n=0,r=Vm.length-1;for(;n<=r;){const o=Math.floor((n+r)/2),i=Vm[o],a=Um(i);if(a===e)return i;a<e?n=o+1:r=o-1}return"None"}function Um(t){return t.toLowerCase().replace(/_-\[\]/g,"")}function I7(t,e){return t.Binarizer[e]}function T7(t,e){return t.CharacterSet[e]}const x7=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function O7(t){return x7[t.value]}function P7(t,e){return t.EanAddOnSymbol[e]}function k7(t,e){return t.TextMode[e]}const Ji={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function Gm(t,e){return{...e,formats:A7(e.formats),binarizer:I7(t,e.binarizer),eanAddOnSymbol:P7(t,e.eanAddOnSymbol),textMode:k7(t,e.textMode),characterSet:T7(t,e.characterSet)}}function qm(t){return{...t,format:S7(t.format),eccLevel:t.eccLevel,contentType:O7(t.contentType)}}const B7={locateFile:(t,e)=>{const n=t.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${n[1]}/${t}`:e+t}};let Hm=new WeakMap;function hf(t,e){var n;const r=Hm.get(t);if(r!=null&&r.modulePromise&&e===void 0)return r.modulePromise;const o=(n=r==null?void 0:r.moduleOverrides)!=null?n:B7,i=t({...o});return Hm.set(t,{moduleOverrides:o,modulePromise:i}),i}async function N7(t,e,n=Ji){const r={...Ji,...n},o=await hf(t),{size:i}=e,a=new Uint8Array(await e.arrayBuffer()),s=o._malloc(i);o.HEAPU8.set(a,s);const c=o.readBarcodesFromImage(s,i,Gm(o,r));o._free(s);const u=[];for(let d=0;d<c.size();++d)u.push(qm(c.get(d)));return u}async function R7(t,e,n=Ji){const r={...Ji,...n},o=await hf(t),{data:i,width:a,height:s,data:{byteLength:c}}=e,u=o._malloc(c);o.HEAPU8.set(i,u);const d=o.readBarcodesFromPixmap(u,a,s,Gm(o,r));o._free(u);const h=[];for(let f=0;f<d.size();++f)h.push(qm(d.get(f)));return h}({...Ji,formats:[...Ji.formats]});var pf=(()=>{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(n={}){var r,o=n,i,a,s=new Promise((_,A)=>{i=_,a=A}),c=typeof window=="object",u=typeof Bun<"u",d=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var h=Object.assign({},o),f="./this.program",p="";function l(_){return o.locateFile?o.locateFile(_,p):p+_}var g,m;if(c||d||u){var y;d?p=self.location.href:typeof document<"u"&&((y=document.currentScript)===null||y===void 0?void 0:y.tagName.toUpperCase())==="SCRIPT"&&(p=document.currentScript.src),e&&(p=e),p.startsWith("blob:")?p="":p=p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),d&&(m=_=>{var A=new XMLHttpRequest;return A.open("GET",_,!1),A.responseType="arraybuffer",A.send(null),new Uint8Array(A.response)}),g=_=>fetch(_,{credentials:"same-origin"}).then(A=>A.ok?A.arrayBuffer():Promise.reject(new Error(A.status+" : "+A.url)))}var w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,h),h=null,o.arguments&&o.arguments,o.thisProgram&&(f=o.thisProgram);var E=o.wasmBinary,C,I=!1,T,P,N,L,V,j,W,q;function k(){var _=C.buffer;o.HEAP8=T=new Int8Array(_),o.HEAP16=N=new Int16Array(_),o.HEAPU8=P=new Uint8Array(_),o.HEAPU16=L=new Uint16Array(_),o.HEAP32=V=new Int32Array(_),o.HEAPU32=j=new Uint32Array(_),o.HEAPF32=W=new Float32Array(_),o.HEAPF64=q=new Float64Array(_)}var U=[],z=[],te=[];function oe(){var _=o.preRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(we)),fe(U)}function ne(){fe(z)}function se(){var _=o.postRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(_e)),fe(te)}function we(_){U.unshift(_)}function le(_){z.unshift(_)}function _e(_){te.unshift(_)}var ve=0,H=null;function $(_){var A;ve++,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve)}function J(_){var A;if(ve--,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve),ve==0&&H){var O=H;H=null,O()}}function S(_){var A;(A=o.onAbort)===null||A===void 0||A.call(o,_),_="Aborted("+_+")",b(_),I=!0,_+=". Build with -sASSERTIONS for more info.";var O=new WebAssembly.RuntimeError(_);throw a(O),O}var M="data:application/octet-stream;base64,",F=_=>_.startsWith(M);function B(){var _="zxing_reader.wasm";return F(_)?_:l(_)}var Q;function Z(_){if(_==Q&&E)return new Uint8Array(E);if(m)return m(_);throw"both async and sync fetching of the wasm failed"}function ee(_){return E?Promise.resolve().then(()=>Z(_)):g(_).then(A=>new Uint8Array(A),()=>Z(_))}function K(_,A,O){return ee(_).then(R=>WebAssembly.instantiate(R,A)).then(O,R=>{b(`failed to asynchronously prepare wasm: ${R}`),S(R)})}function ge(_,A,O,R){return!_&&typeof WebAssembly.instantiateStreaming=="function"&&!F(A)&&typeof fetch=="function"?fetch(A,{credentials:"same-origin"}).then(G=>{var X=WebAssembly.instantiateStreaming(G,O);return X.then(R,function(ae){return b(`wasm streaming compile failed: ${ae}`),b("falling back to ArrayBuffer instantiation"),K(A,O,R)})}):K(A,O,R)}function be(){return{a:NP}}function pe(){var _,A=be();function O(G,X){return jt=G.exports,C=jt.za,k(),Ty=jt.Da,le(jt.Aa),J(),jt}$();function R(G){O(G.instance)}if(o.instantiateWasm)try{return o.instantiateWasm(A,O)}catch(G){b(`Module.instantiateWasm callback failed with error: ${G}`),a(G)}return(_=Q)!==null&&_!==void 0||(Q=B()),ge(E,Q,A,R).catch(a),{}}var fe=_=>{_.forEach(A=>A(o))};o.noExitRuntime;var ye=_=>jy(_),ue=()=>Vy(),Oe=[],ke=0,at=_=>{var A=new ht(_);return A.get_caught()||(A.set_caught(!0),ke--),A.set_rethrown(!1),Oe.push(A),Gy(_),Ly(_)},ze=0,It=()=>{et(0,0);var _=Oe.pop();Uy(_.excPtr),ze=0};class ht{constructor(A){this.excPtr=A,this.ptr=A-24}set_type(A){j[this.ptr+4>>2]=A}get_type(){return j[this.ptr+4>>2]}set_destructor(A){j[this.ptr+8>>2]=A}get_destructor(){return j[this.ptr+8>>2]}set_caught(A){A=A?1:0,T[this.ptr+12]=A}get_caught(){return T[this.ptr+12]!=0}set_rethrown(A){A=A?1:0,T[this.ptr+13]=A}get_rethrown(){return T[this.ptr+13]!=0}init(A,O){this.set_adjusted_ptr(0),this.set_type(A),this.set_destructor(O)}set_adjusted_ptr(A){j[this.ptr+16>>2]=A}get_adjusted_ptr(){return j[this.ptr+16>>2]}}var wr=_=>{throw ze||(ze=_),ze},pt=_=>Fy(_),mn=_=>{var A=ze;if(!A)return pt(0),0;var O=new ht(A);O.set_adjusted_ptr(A);var R=O.get_type();if(!R)return pt(0),A;for(var G of _){if(G===0||G===R)break;var X=O.ptr+16;if(qy(G,R,X))return pt(G),A}return pt(R),A},Ot=()=>mn([]),De=_=>mn([_]),Pr=(_,A)=>mn([_,A]),ln=()=>{var _=Oe.pop();_||S("no exception to throw");var A=_.excPtr;throw _.get_rethrown()||(Oe.push(_),_.set_rethrown(!0),_.set_caught(!1),ke++),ze=A,ze},Rn=(_,A,O)=>{var R=new ht(_);throw R.init(A,O),ze=_,ke++,ze},Dn=()=>ke,Gr=()=>{S("")},An={},Mn=_=>{for(;_.length;){var A=_.pop(),O=_.pop();O(A)}};function dn(_){return this.fromWireType(j[_>>2])}var Xt={},zn={},qr={},Me,Ge=_=>{throw new Me(_)},qe=(_,A,O)=>{_.forEach(re=>qr[re]=A);function R(re){var me=O(re);me.length!==_.length&&Ge("Mismatched type converter count");for(var Ce=0;Ce<_.length;++Ce)sr(_[Ce],me[Ce])}var G=new Array(A.length),X=[],ae=0;A.forEach((re,me)=>{zn.hasOwnProperty(re)?G[me]=zn[re]:(X.push(re),Xt.hasOwnProperty(re)||(Xt[re]=[]),Xt[re].push(()=>{G[me]=zn[re],++ae,ae===X.length&&R(G)}))}),X.length===0&&R(G)},st=_=>{var A=An[_];delete An[_];var O=A.rawConstructor,R=A.rawDestructor,G=A.fields,X=G.map(ae=>ae.getterReturnType).concat(G.map(ae=>ae.setterArgumentType));qe([_],X,ae=>{var re={};return G.forEach((me,Ce)=>{var Te=me.fieldName,Be=ae[Ce],tt=me.getter,vt=me.getterContext,Rt=ae[Ce+G.length],fn=me.setter,Zt=me.setterContext;re[Te]={read:en=>Be.fromWireType(tt(vt,en)),write:(en,yi)=>{var Ln=[];fn(Zt,en,Rt.toWireType(Ln,yi)),Mn(Ln)}}}),[{name:A.name,fromWireType:me=>{var Ce={};for(var Te in re)Ce[Te]=re[Te].read(me);return R(me),Ce},toWireType:(me,Ce)=>{for(var Te in re)if(!(Te in Ce))throw new TypeError(`Missing field: "${Te}"`);var Be=O();for(Te in re)re[Te].write(Be,Ce[Te]);return me!==null&&me.push(R,Be),Be},argPackAdvance:br,readValueFromPointer:dn,destructorFunction:R}]})},Lt=(_,A,O,R,G)=>{},ca=()=>{for(var _=new Array(256),A=0;A<256;++A)_[A]=String.fromCharCode(A);mi=_},mi,Qt=_=>{for(var A="",O=_;P[O];)A+=mi[P[O++]];return A},ao,ct=_=>{throw new ao(_)};function Yf(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var R=A.name;if(_||ct(`type "${R}" must have a positive integer typeid pointer`),zn.hasOwnProperty(_)){if(O.ignoreDuplicateRegistrations)return;ct(`Cannot register type '${R}' twice`)}if(zn[_]=A,delete qr[_],Xt.hasOwnProperty(_)){var G=Xt[_];delete Xt[_],G.forEach(X=>X())}}function sr(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Yf(_,A,O)}var br=8,Y=(_,A,O,R)=>{A=Qt(A),sr(_,{name:A,fromWireType:function(G){return!!G},toWireType:function(G,X){return X?O:R},argPackAdvance:br,readValueFromPointer:function(G){return this.fromWireType(P[G])},destructorFunction:null})},Ee=_=>({count:_.count,deleteScheduled:_.deleteScheduled,preservePointerOnDelete:_.preservePointerOnDelete,ptr:_.ptr,ptrType:_.ptrType,smartPtr:_.smartPtr,smartPtrType:_.smartPtrType}),xe=_=>{function A(O){return O.$$.ptrType.registeredClass.name}ct(A(_)+" instance already deleted")},Ne=!1,ut=_=>{},At=_=>{_.smartPtr?_.smartPtrType.rawDestructor(_.smartPtr):_.ptrType.registeredClass.rawDestructor(_.ptr)},Je=_=>{_.count.value-=1;var A=_.count.value===0;A&&At(_)},Xe=(_,A,O)=>{if(A===O)return _;if(O.baseClass===void 0)return null;var R=Xe(_,A,O.baseClass);return R===null?null:O.downcast(R)},yn={},Ft={},Gt=(_,A)=>{for(A===void 0&&ct("ptr should not be undefined");_.baseClass;)A=_.upcast(A),_=_.baseClass;return A},Xn=(_,A)=>(A=Gt(_,A),Ft[A]),kr=(_,A)=>{(!A.ptrType||!A.ptr)&&Ge("makeClassHandle requires ptr and ptrType");var O=!!A.smartPtrType,R=!!A.smartPtr;return O!==R&&Ge("Both smartPtrType and smartPtr must be specified"),A.count={value:1},Jt(Object.create(_,{$$:{value:A,writable:!0}}))};function so(_){var A=this.getPointee(_);if(!A)return this.destructor(_),null;var O=Xn(this.registeredClass,A);if(O!==void 0){if(O.$$.count.value===0)return O.$$.ptr=A,O.$$.smartPtr=_,O.clone();var R=O.clone();return this.destructor(_),R}function G(){return this.isSmartPointer?kr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:A,smartPtrType:this,smartPtr:_}):kr(this.registeredClass.instancePrototype,{ptrType:this,ptr:_})}var X=this.registeredClass.getActualType(A),ae=yn[X];if(!ae)return G.call(this);var re;this.isConst?re=ae.constPointerType:re=ae.pointerType;var me=Xe(A,this.registeredClass,re.registeredClass);return me===null?G.call(this):this.isSmartPointer?kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me,smartPtrType:this,smartPtr:_}):kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me})}var Jt=_=>typeof FinalizationRegistry>"u"?(Jt=A=>A,_):(Ne=new FinalizationRegistry(A=>{Je(A.$$)}),Jt=A=>{var O=A.$$,R=!!O.smartPtr;if(R){var G={$$:O};Ne.register(A,G,A)}return A},ut=A=>Ne.unregister(A),Jt(_)),Vo=[],Wf=()=>{for(;Vo.length;){var _=Vo.pop();_.$$.deleteScheduled=!1,_.delete()}},xu,pO=()=>{Object.assign(Ou.prototype,{isAliasOf(_){if(!(this instanceof Ou)||!(_ instanceof Ou))return!1;var A=this.$$.ptrType.registeredClass,O=this.$$.ptr;_.$$=_.$$;for(var R=_.$$.ptrType.registeredClass,G=_.$$.ptr;A.baseClass;)O=A.upcast(O),A=A.baseClass;for(;R.baseClass;)G=R.upcast(G),R=R.baseClass;return A===R&&O===G},clone(){if(this.$$.ptr||xe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var _=Jt(Object.create(Object.getPrototypeOf(this),{$$:{value:Ee(this.$$)}}));return _.$$.count.value+=1,_.$$.deleteScheduled=!1,_},delete(){this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),ut(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),Vo.push(this),Vo.length===1&&xu&&xu(Wf),this.$$.deleteScheduled=!0,this}})};function Ou(){}var Ss=(_,A)=>Object.defineProperty(A,"name",{value:_}),Sy=(_,A,O)=>{if(_[A].overloadTable===void 0){var R=_[A];_[A]=function(){for(var G=arguments.length,X=new Array(G),ae=0;ae<G;ae++)X[ae]=arguments[ae];return _[A].overloadTable.hasOwnProperty(X.length)||ct(`Function '${O}' called with an invalid number of arguments (${X.length}) - expects one of (${_[A].overloadTable})!`),_[A].overloadTable[X.length].apply(this,X)},_[A].overloadTable=[],_[A].overloadTable[R.argCount]=R}},Kf=(_,A,O)=>{o.hasOwnProperty(_)?((O===void 0||o[_].overloadTable!==void 0&&o[_].overloadTable[O]!==void 0)&&ct(`Cannot register public name '${_}' twice`),Sy(o,_,_),o.hasOwnProperty(O)&&ct(`Cannot register multiple overloads of a function with the same number of arguments (${O})!`),o[_].overloadTable[O]=A):(o[_]=A,O!==void 0&&(o[_].numArguments=O))},gO=48,mO=57,yO=_=>{_=_.replace(/[^a-zA-Z0-9_]/g,"$");var A=_.charCodeAt(0);return A>=gO&&A<=mO?`_${_}`:_};function vO(_,A,O,R,G,X,ae,re){this.name=_,this.constructor=A,this.instancePrototype=O,this.rawDestructor=R,this.baseClass=G,this.getActualType=X,this.upcast=ae,this.downcast=re,this.pureVirtualFunctions=[]}var zf=(_,A,O)=>{for(;A!==O;)A.upcast||ct(`Expected null or instance of ${O.name}, got an instance of ${A.name}`),_=A.upcast(_),A=A.baseClass;return _};function wO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}function bO(_,A){var O;if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),this.isSmartPointer?(O=this.rawConstructor(),_!==null&&_.push(this.rawDestructor,O),O):0;(!A||!A.$$)&&ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);var R=A.$$.ptrType.registeredClass;if(O=zf(A.$$.ptr,R,this.registeredClass),this.isSmartPointer)switch(A.$$.smartPtr===void 0&&ct("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:A.$$.smartPtrType===this?O=A.$$.smartPtr:ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:O=A.$$.smartPtr;break;case 2:if(A.$$.smartPtrType===this)O=A.$$.smartPtr;else{var G=A.clone();O=this.rawShare(O,uo.toHandle(()=>G.delete())),_!==null&&_.push(this.rawDestructor,O)}break;default:ct("Unsupporting sharing policy")}return O}function EO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.ptrType.name} to parameter type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}var CO=()=>{Object.assign(Pu.prototype,{getPointee(_){return this.rawGetPointee&&(_=this.rawGetPointee(_)),_},destructor(_){var A;(A=this.rawDestructor)===null||A===void 0||A.call(this,_)},argPackAdvance:br,readValueFromPointer:dn,fromWireType:so})};function Pu(_,A,O,R,G,X,ae,re,me,Ce,Te){this.name=_,this.registeredClass=A,this.isReference=O,this.isConst=R,this.isSmartPointer=G,this.pointeeType=X,this.sharingPolicy=ae,this.rawGetPointee=re,this.rawConstructor=me,this.rawShare=Ce,this.rawDestructor=Te,!G&&A.baseClass===void 0?R?(this.toWireType=wO,this.destructorFunction=null):(this.toWireType=EO,this.destructorFunction=null):this.toWireType=bO}var Iy=(_,A,O)=>{o.hasOwnProperty(_)||Ge("Replacing nonexistent public symbol"),o[_].overloadTable!==void 0&&O!==void 0?o[_].overloadTable[O]=A:(o[_]=A,o[_].argCount=O)},_O=(_,A,O)=>{_=_.replace(/p/g,"i");var R=o["dynCall_"+_];return R(A,...O)},ku=[],Ty,ot=_=>{var A=ku[_];return A||(_>=ku.length&&(ku.length=_+1),ku[_]=A=Ty.get(_)),A},AO=function(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(_.includes("j"))return _O(_,A,O);var R=ot(A)(...O);return R},SO=(_,A)=>function(){for(var O=arguments.length,R=new Array(O),G=0;G<O;G++)R[G]=arguments[G];return AO(_,A,R)},Br=(_,A)=>{_=Qt(_);function O(){return _.includes("j")?SO(_,A):ot(A)}var R=O();return typeof R!="function"&&ct(`unknown function pointer with signature ${_}: ${A}`),R},IO=(_,A)=>{var O=Ss(A,function(R){this.name=A,this.message=R;var G=new Error(R).stack;G!==void 0&&(this.stack=this.toString()+`
136
- `+G.replace(/^Error(:[^\n]*)?\n/,""))});return O.prototype=Object.create(_.prototype),O.prototype.constructor=O,O.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},O},xy,Oy=_=>{var A=My(_),O=Qt(A);return lo(A),O},Bu=(_,A)=>{var O=[],R={};function G(X){if(!R[X]&&!zn[X]){if(qr[X]){qr[X].forEach(G);return}O.push(X),R[X]=!0}}throw A.forEach(G),new xy(`${_}: `+O.map(Oy).join([", "]))},TO=(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,tt)=>{Te=Qt(Te),X=Br(G,X),re&&(re=Br(ae,re)),Ce&&(Ce=Br(me,Ce)),tt=Br(Be,tt);var vt=yO(Te);Kf(vt,function(){Bu(`Cannot construct ${Te} due to unbound types`,[R])}),qe([_,A,O],R?[R]:[],Rt=>{Rt=Rt[0];var fn,Zt;R?(fn=Rt.registeredClass,Zt=fn.instancePrototype):Zt=Ou.prototype;var en=Ss(Te,function(){if(Object.getPrototypeOf(this)!==yi)throw new ao("Use 'new' to construct "+Te);if(Ln.constructor_body===void 0)throw new ao(Te+" has no accessible constructor");for(var Xy=arguments.length,Du=new Array(Xy),Mu=0;Mu<Xy;Mu++)Du[Mu]=arguments[Mu];var Qy=Ln.constructor_body[Du.length];if(Qy===void 0)throw new ao(`Tried to invoke ctor of ${Te} with invalid number of parameters (${Du.length}) - expected (${Object.keys(Ln.constructor_body).toString()}) parameters instead!`);return Qy.apply(this,Du)}),yi=Object.create(Zt,{constructor:{value:en}});en.prototype=yi;var Ln=new vO(Te,en,yi,tt,fn,X,re,Ce);if(Ln.baseClass){var fo,Ru;(Ru=(fo=Ln.baseClass).__derivedClasses)!==null&&Ru!==void 0||(fo.__derivedClasses=[]),Ln.baseClass.__derivedClasses.push(Ln)}var pk=new Pu(Te,Ln,!0,!1,!1),Ky=new Pu(Te+"*",Ln,!1,!1,!1),zy=new Pu(Te+" const*",Ln,!1,!0,!1);return yn[_]={pointerType:Ky,constPointerType:zy},Iy(vt,en),[pk,Ky,zy]})},Xf=(_,A)=>{for(var O=[],R=0;R<_;R++)O.push(j[A+R*4>>2]);return O};function xO(_){for(var A=1;A<_.length;++A)if(_[A]!==null&&_[A].destructorFunction===void 0)return!0;return!1}function Qf(_,A,O,R,G,X){var ae=A.length;ae<2&&ct("argTypes array size mismatch! Must at least get return value and 'this' types!");var re=A[1]!==null&&O!==null,me=xO(A),Ce=A[0].name!=="void",Te=ae-2,Be=new Array(Te),tt=[],vt=[],Rt=function(){vt.length=0;var fn;tt.length=re?2:1,tt[0]=G,re&&(fn=A[1].toWireType(vt,this),tt[1]=fn);for(var Zt=0;Zt<Te;++Zt)Be[Zt]=A[Zt+2].toWireType(vt,Zt<0||arguments.length<=Zt?void 0:arguments[Zt]),tt.push(Be[Zt]);var en=R(...tt);function yi(Ln){if(me)Mn(vt);else for(var fo=re?1:2;fo<A.length;fo++){var Ru=fo===1?fn:Be[fo-2];A[fo].destructorFunction!==null&&A[fo].destructorFunction(Ru)}if(Ce)return A[0].fromWireType(Ln)}return yi(en)};return Ss(_,Rt)}var OO=(_,A,O,R,G,X)=>{var ae=Xf(A,O);G=Br(R,G),qe([],[_],re=>{re=re[0];var me=`constructor ${re.name}`;if(re.registeredClass.constructor_body===void 0&&(re.registeredClass.constructor_body=[]),re.registeredClass.constructor_body[A-1]!==void 0)throw new ao(`Cannot register multiple constructors with identical number of parameters (${A-1}) for class '${re.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return re.registeredClass.constructor_body[A-1]=()=>{Bu(`Cannot construct ${re.name} due to unbound types`,ae)},qe([],ae,Ce=>(Ce.splice(1,0,null),re.registeredClass.constructor_body[A-1]=Qf(me,Ce,null,G,X),[])),[]})},Py=_=>{_=_.trim();const A=_.indexOf("(");return A!==-1?_.substr(0,A):_},PO=(_,A,O,R,G,X,ae,re,me,Ce)=>{var Te=Xf(O,R);A=Qt(A),A=Py(A),X=Br(G,X),qe([],[_],Be=>{Be=Be[0];var tt=`${Be.name}.${A}`;A.startsWith("@@")&&(A=Symbol[A.substring(2)]),re&&Be.registeredClass.pureVirtualFunctions.push(A);function vt(){Bu(`Cannot call ${tt} due to unbound types`,Te)}var Rt=Be.registeredClass.instancePrototype,fn=Rt[A];return fn===void 0||fn.overloadTable===void 0&&fn.className!==Be.name&&fn.argCount===O-2?(vt.argCount=O-2,vt.className=Be.name,Rt[A]=vt):(Sy(Rt,A,tt),Rt[A].overloadTable[O-2]=vt),qe([],Te,Zt=>{var en=Qf(tt,Zt,Be,X,ae);return Rt[A].overloadTable===void 0?(en.argCount=O-2,Rt[A]=en):Rt[A].overloadTable[O-2]=en,[]}),[]})},Jf=[],co=[],Zf=_=>{_>9&&--co[_+1]===0&&(co[_]=void 0,Jf.push(_))},kO=()=>co.length/2-5-Jf.length,BO=()=>{co.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=kO},uo={toValue:_=>(_||ct("Cannot use deleted val. handle = "+_),co[_]),toHandle:_=>{switch(_){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const A=Jf.pop()||co.length;return co[A]=_,co[A+1]=1,A}}}},ky={name:"emscripten::val",fromWireType:_=>{var A=uo.toValue(_);return Zf(_),A},toWireType:(_,A)=>uo.toHandle(A),argPackAdvance:br,readValueFromPointer:dn,destructorFunction:null},NO=_=>sr(_,ky),RO=(_,A,O)=>{switch(A){case 1:return O?function(R){return this.fromWireType(T[R])}:function(R){return this.fromWireType(P[R])};case 2:return O?function(R){return this.fromWireType(N[R>>1])}:function(R){return this.fromWireType(L[R>>1])};case 4:return O?function(R){return this.fromWireType(V[R>>2])}:function(R){return this.fromWireType(j[R>>2])};default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},DO=(_,A,O,R)=>{A=Qt(A);function G(){}G.values={},sr(_,{name:A,constructor:G,fromWireType:function(X){return this.constructor.values[X]},toWireType:(X,ae)=>ae.value,argPackAdvance:br,readValueFromPointer:RO(A,O,R),destructorFunction:null}),Kf(A,G)},eh=(_,A)=>{var O=zn[_];return O===void 0&&ct(`${A} has unknown type ${Oy(_)}`),O},MO=(_,A,O)=>{var R=eh(_,"enum");A=Qt(A);var G=R.constructor,X=Object.create(R.constructor.prototype,{value:{value:O},constructor:{value:Ss(`${R.name}_${A}`,function(){})}});G.values[O]=X,G[A]=X},th=_=>{if(_===null)return"null";var A=typeof _;return A==="object"||A==="array"||A==="function"?_.toString():""+_},LO=(_,A)=>{switch(A){case 4:return function(O){return this.fromWireType(W[O>>2])};case 8:return function(O){return this.fromWireType(q[O>>3])};default:throw new TypeError(`invalid float width (${A}): ${_}`)}},FO=(_,A,O)=>{A=Qt(A),sr(_,{name:A,fromWireType:R=>R,toWireType:(R,G)=>G,argPackAdvance:br,readValueFromPointer:LO(A,O),destructorFunction:null})},jO=(_,A,O,R,G,X,ae,re)=>{var me=Xf(A,O);_=Qt(_),_=Py(_),G=Br(R,G),Kf(_,function(){Bu(`Cannot call ${_} due to unbound types`,me)},A-1),qe([],me,Ce=>{var Te=[Ce[0],null].concat(Ce.slice(1));return Iy(_,Qf(_,Te,null,G,X),A-1),[]})},VO=(_,A,O)=>{switch(A){case 1:return O?R=>T[R]:R=>P[R];case 2:return O?R=>N[R>>1]:R=>L[R>>1];case 4:return O?R=>V[R>>2]:R=>j[R>>2];default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},UO=(_,A,O,R,G)=>{A=Qt(A);var X=Te=>Te;if(R===0){var ae=32-8*O;X=Te=>Te<<ae>>>ae}var re=A.includes("unsigned"),me=(Te,Be)=>{},Ce;re?Ce=function(Te,Be){return me(Be,this.name),Be>>>0}:Ce=function(Te,Be){return me(Be,this.name),Be},sr(_,{name:A,fromWireType:X,toWireType:Ce,argPackAdvance:br,readValueFromPointer:VO(A,O,R!==0),destructorFunction:null})},GO=(_,A,O)=>{var R=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=R[A];function X(ae){var re=j[ae>>2],me=j[ae+4>>2];return new G(T.buffer,me,re)}O=Qt(O),sr(_,{name:O,fromWireType:X,argPackAdvance:br,readValueFromPointer:X},{ignoreDuplicateRegistrations:!0})},qO=Object.assign({optional:!0},ky),HO=(_,A)=>{sr(_,qO)},$O=(_,A,O,R)=>{if(!(R>0))return 0;for(var G=O,X=O+R-1,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(re<=127){if(O>=X)break;A[O++]=re}else if(re<=2047){if(O+1>=X)break;A[O++]=192|re>>6,A[O++]=128|re&63}else if(re<=65535){if(O+2>=X)break;A[O++]=224|re>>12,A[O++]=128|re>>6&63,A[O++]=128|re&63}else{if(O+3>=X)break;A[O++]=240|re>>18,A[O++]=128|re>>12&63,A[O++]=128|re>>6&63,A[O++]=128|re&63}}return A[O]=0,O-G},Is=(_,A,O)=>$O(_,P,A,O),YO=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R<=127?A++:R<=2047?A+=2:R>=55296&&R<=57343?(A+=4,++O):A+=3}return A},By=typeof TextDecoder<"u"?new TextDecoder:void 0,Ny=function(_){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var R=A+O,G=A;_[G]&&!(G>=R);)++G;if(G-A>16&&_.buffer&&By)return By.decode(_.subarray(A,G));for(var X="";A<G;){var ae=_[A++];if(!(ae&128)){X+=String.fromCharCode(ae);continue}var re=_[A++]&63;if((ae&224)==192){X+=String.fromCharCode((ae&31)<<6|re);continue}var me=_[A++]&63;if((ae&240)==224?ae=(ae&15)<<12|re<<6|me:ae=(ae&7)<<18|re<<12|me<<6|_[A++]&63,ae<65536)X+=String.fromCharCode(ae);else{var Ce=ae-65536;X+=String.fromCharCode(55296|Ce>>10,56320|Ce&1023)}}return X},WO=(_,A)=>_?Ny(P,_,A):"",KO=(_,A)=>{A=Qt(A);var O=A==="std::string";sr(_,{name:A,fromWireType(R){var G=j[R>>2],X=R+4,ae;if(O)for(var re=X,me=0;me<=G;++me){var Ce=X+me;if(me==G||P[Ce]==0){var Te=Ce-re,Be=WO(re,Te);ae===void 0?ae=Be:(ae+="\0",ae+=Be),re=Ce+1}}else{for(var tt=new Array(G),me=0;me<G;++me)tt[me]=String.fromCharCode(P[X+me]);ae=tt.join("")}return lo(R),ae},toWireType(R,G){G instanceof ArrayBuffer&&(G=new Uint8Array(G));var X,ae=typeof G=="string";ae||G instanceof Uint8Array||G instanceof Uint8ClampedArray||G instanceof Int8Array||ct("Cannot pass non-string to std::string"),O&&ae?X=YO(G):X=G.length;var re=oh(4+X+1),me=re+4;if(j[re>>2]=X,O&&ae)Is(G,me,X+1);else if(ae)for(var Ce=0;Ce<X;++Ce){var Te=G.charCodeAt(Ce);Te>255&&(lo(me),ct("String has UTF-16 code units that do not fit in 8 bits")),P[me+Ce]=Te}else for(var Ce=0;Ce<X;++Ce)P[me+Ce]=G[Ce];return R!==null&&R.push(lo,re),re},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(R){lo(R)}})},Ry=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,zO=(_,A)=>{for(var O=_,R=O>>1,G=R+A/2;!(R>=G)&&L[R];)++R;if(O=R<<1,O-_>32&&Ry)return Ry.decode(P.subarray(_,O));for(var X="",ae=0;!(ae>=A/2);++ae){var re=N[_+ae*2>>1];if(re==0)break;X+=String.fromCharCode(re)}return X},XO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<2)return 0;O-=2;for(var G=A,X=O<_.length*2?O/2:_.length,ae=0;ae<X;++ae){var re=_.charCodeAt(ae);N[A>>1]=re,A+=2}return N[A>>1]=0,A-G},QO=_=>_.length*2,JO=(_,A)=>{for(var O=0,R="";!(O>=A/4);){var G=V[_+O*4>>2];if(G==0)break;if(++O,G>=65536){var X=G-65536;R+=String.fromCharCode(55296|X>>10,56320|X&1023)}else R+=String.fromCharCode(G)}return R},ZO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<4)return 0;for(var G=A,X=G+O-4,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(V[A>>2]=re,A+=4,A+4>X)break}return V[A>>2]=0,A-G},eP=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R>=55296&&R<=57343&&++O,A+=4}return A},tP=(_,A,O)=>{O=Qt(O);var R,G,X,ae;A===2?(R=zO,G=XO,ae=QO,X=re=>L[re>>1]):A===4&&(R=JO,G=ZO,ae=eP,X=re=>j[re>>2]),sr(_,{name:O,fromWireType:re=>{for(var me=j[re>>2],Ce,Te=re+4,Be=0;Be<=me;++Be){var tt=re+4+Be*A;if(Be==me||X(tt)==0){var vt=tt-Te,Rt=R(Te,vt);Ce===void 0?Ce=Rt:(Ce+="\0",Ce+=Rt),Te=tt+A}}return lo(re),Ce},toWireType:(re,me)=>{typeof me!="string"&&ct(`Cannot pass non-string to C++ string type ${O}`);var Ce=ae(me),Te=oh(4+Ce+A);return j[Te>>2]=Ce/A,G(me,Te+4,Ce+A),re!==null&&re.push(lo,Te),Te},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(re){lo(re)}})},nP=(_,A,O,R,G,X)=>{An[_]={name:Qt(A),rawConstructor:Br(O,R),rawDestructor:Br(G,X),fields:[]}},rP=(_,A,O,R,G,X,ae,re,me,Ce)=>{An[_].fields.push({fieldName:Qt(A),getterReturnType:O,getter:Br(R,G),getterContext:X,setterArgumentType:ae,setter:Br(re,me),setterContext:Ce})},oP=(_,A)=>{A=Qt(A),sr(_,{isVoid:!0,name:A,argPackAdvance:0,fromWireType:()=>{},toWireType:(O,R)=>{}})},iP=(_,A,O)=>P.copyWithin(_,A,A+O),nh=[],aP=(_,A,O,R)=>(_=nh[_],A=uo.toValue(A),_(null,A,O,R)),sP={},cP=_=>{var A=sP[_];return A===void 0?Qt(_):A},Dy=()=>{if(typeof globalThis=="object")return globalThis;function _(A){A.$$$embind_global$$$=A;var O=typeof $$$embind_global$$$=="object"&&A.$$$embind_global$$$==A;return O||delete A.$$$embind_global$$$,O}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&_(global)?$$$embind_global$$$=global:typeof self=="object"&&_(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},uP=_=>_===0?uo.toHandle(Dy()):(_=cP(_),uo.toHandle(Dy()[_])),lP=_=>{var A=nh.length;return nh.push(_),A},dP=(_,A)=>{for(var O=new Array(_),R=0;R<_;++R)O[R]=eh(j[A+R*4>>2],"parameter "+R);return O},fP=Reflect.construct,hP=(_,A,O)=>{var R=[],G=_.toWireType(R,O);return R.length&&(j[A>>2]=uo.toHandle(R)),G},pP=(_,A,O)=>{var R=dP(_,A),G=R.shift();_--;var X=new Array(_),ae=(me,Ce,Te,Be)=>{for(var tt=0,vt=0;vt<_;++vt)X[vt]=R[vt].readValueFromPointer(Be+tt),tt+=R[vt].argPackAdvance;var Rt=O===1?fP(Ce,X):Ce.apply(me,X);return hP(G,Te,Rt)},re=`methodCaller<(${R.map(me=>me.name).join(", ")}) => ${G.name}>`;return lP(Ss(re,ae))},gP=_=>{_>9&&(co[_+1]+=1)},mP=_=>{var A=uo.toValue(_);Mn(A),Zf(_)},yP=(_,A)=>{_=eh(_,"_emval_take_value");var O=_.readValueFromPointer(A);return uo.toHandle(O)},vP=(_,A,O,R)=>{var G=new Date().getFullYear(),X=new Date(G,0,1),ae=new Date(G,6,1),re=X.getTimezoneOffset(),me=ae.getTimezoneOffset(),Ce=Math.max(re,me);j[_>>2]=Ce*60,V[A>>2]=+(re!=me);var Te=vt=>{var Rt=vt>=0?"-":"+",fn=Math.abs(vt),Zt=String(Math.floor(fn/60)).padStart(2,"0"),en=String(fn%60).padStart(2,"0");return`UTC${Rt}${Zt}${en}`},Be=Te(re),tt=Te(me);me<re?(Is(Be,O,17),Is(tt,R,17)):(Is(Be,R,17),Is(tt,O,17))},wP=()=>2147483648,bP=(_,A)=>Math.ceil(_/A)*A,EP=_=>{var A=C.buffer,O=(_-A.byteLength+65535)/65536|0;try{return C.grow(O),k(),1}catch{}},CP=_=>{var A=P.length;_>>>=0;var O=wP();if(_>O)return!1;for(var R=1;R<=4;R*=2){var G=A*(1+.2/R);G=Math.min(G,_+100663296);var X=Math.min(O,bP(Math.max(_,G),65536)),ae=EP(X);if(ae)return!0}return!1},rh={},_P=()=>f||"./this.program",Ts=()=>{if(!Ts.strings){var _=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:_,_:_P()};for(var O in rh)rh[O]===void 0?delete A[O]:A[O]=rh[O];var R=[];for(var O in A)R.push(`${O}=${A[O]}`);Ts.strings=R}return Ts.strings},AP=(_,A)=>{for(var O=0;O<_.length;++O)T[A++]=_.charCodeAt(O);T[A]=0},SP=(_,A)=>{var O=0;return Ts().forEach((R,G)=>{var X=A+O;j[_+G*4>>2]=X,AP(R,X),O+=R.length+1}),0},IP=(_,A)=>{var O=Ts();j[_>>2]=O.length;var R=0;return O.forEach(G=>R+=G.length+1),j[A>>2]=R,0},TP=_=>52;function xP(_,A,O,R,G){return 70}var OP=[null,[],[]],PP=(_,A)=>{var O=OP[_];A===0||A===10?((_===1?w:b)(Ny(O)),O.length=0):O.push(A)},kP=(_,A,O,R)=>{for(var G=0,X=0;X<O;X++){var ae=j[A>>2],re=j[A+4>>2];A+=8;for(var me=0;me<re;me++)PP(_,P[ae+me]);G+=re}return j[R>>2]=G,0},BP=_=>_;Me=o.InternalError=class extends Error{constructor(_){super(_),this.name="InternalError"}},ca(),ao=o.BindingError=class extends Error{constructor(_){super(_),this.name="BindingError"}},pO(),CO(),xy=o.UnboundTypeError=IO(Error,"UnboundTypeError"),BO();var NP={t:at,x:It,a:Ot,j:De,k:Pr,O:ln,q:Rn,ga:Dn,d:wr,ca:Gr,va:st,ba:Lt,pa:Y,ta:TO,sa:OO,E:PO,oa:NO,F:DO,n:MO,W:FO,X:jO,y:UO,u:GO,ua:HO,V:KO,P:tP,L:nP,wa:rP,qa:oP,ja:iP,T:aP,xa:Zf,ya:uP,U:pP,Y:gP,Z:mP,ra:yP,da:vP,ha:CP,ea:SP,fa:IP,ia:TP,$:xP,S:kP,J:ek,C:nk,Q:FP,R:uk,r:XP,b:RP,D:ZP,la:ok,c:VP,ka:ik,h:LP,i:HP,s:$P,N:JP,w:WP,I:sk,K:QP,z:rk,H:lk,aa:fk,_:hk,l:UP,f:jP,e:MP,g:DP,M:ck,m:qP,ma:tk,p:YP,v:KP,na:zP,B:ak,o:GP,G:dk,A:BP},jt=pe(),My=_=>(My=jt.Ba)(_),lo=o._free=_=>(lo=o._free=jt.Ca)(_),oh=o._malloc=_=>(oh=o._malloc=jt.Ea)(_),Ly=_=>(Ly=jt.Fa)(_),et=(_,A)=>(et=jt.Ga)(_,A),Fy=_=>(Fy=jt.Ha)(_),jy=_=>(jy=jt.Ia)(_),Vy=()=>(Vy=jt.Ja)(),Uy=_=>(Uy=jt.Ka)(_),Gy=_=>(Gy=jt.La)(_),qy=(_,A,O)=>(qy=jt.Ma)(_,A,O);o.dynCall_viijii=(_,A,O,R,G,X,ae)=>(o.dynCall_viijii=jt.Na)(_,A,O,R,G,X,ae);var Hy=o.dynCall_jiii=(_,A,O,R)=>(Hy=o.dynCall_jiii=jt.Oa)(_,A,O,R);o.dynCall_jiji=(_,A,O,R,G)=>(o.dynCall_jiji=jt.Pa)(_,A,O,R,G);var $y=o.dynCall_jiiii=(_,A,O,R,G)=>($y=o.dynCall_jiiii=jt.Qa)(_,A,O,R,G);o.dynCall_iiiiij=(_,A,O,R,G,X,ae)=>(o.dynCall_iiiiij=jt.Ra)(_,A,O,R,G,X,ae),o.dynCall_iiiiijj=(_,A,O,R,G,X,ae,re,me)=>(o.dynCall_iiiiijj=jt.Sa)(_,A,O,R,G,X,ae,re,me),o.dynCall_iiiiiijj=(_,A,O,R,G,X,ae,re,me,Ce)=>(o.dynCall_iiiiiijj=jt.Ta)(_,A,O,R,G,X,ae,re,me,Ce);function RP(_,A){var O=ue();try{return ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;et(1,0)}}function DP(_,A,O,R){var G=ue();try{ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function MP(_,A,O){var R=ue();try{ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;et(1,0)}}function LP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function FP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function jP(_,A){var O=ue();try{ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;et(1,0)}}function VP(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;et(1,0)}}function UP(_){var A=ue();try{ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;et(1,0)}}function GP(_,A,O,R,G,X,ae,re,me,Ce,Te){var Be=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te)}catch(tt){if(ye(Be),tt!==tt+0)throw tt;et(1,0)}}function qP(_,A,O,R,G){var X=ue();try{ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function HP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function $P(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;et(1,0)}}function YP(_,A,O,R,G,X){var ae=ue();try{ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;et(1,0)}}function WP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;et(1,0)}}function KP(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;et(1,0)}}function zP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;et(1,0)}}function XP(_){var A=ue();try{return ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;et(1,0)}}function QP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{return ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;et(1,0)}}function JP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;et(1,0)}}function ZP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function ek(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function tk(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;et(1,0)}}function nk(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;et(1,0)}}function rk(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;et(1,0)}}function ok(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;et(1,0)}}function ik(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function ak(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;et(1,0)}}function sk(_,A,O,R,G,X,ae,re){var me=ue();try{return ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;et(1,0)}}function ck(_,A,O,R,G,X,ae){var re=ue();try{ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;et(1,0)}}function uk(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function lk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be){var tt=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be)}catch(vt){if(ye(tt),vt!==vt+0)throw vt;et(1,0)}}function dk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,tt,vt,Rt,fn){var Zt=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be,tt,vt,Rt,fn)}catch(en){if(ye(Zt),en!==en+0)throw en;et(1,0)}}function fk(_,A,O,R){var G=ue();try{return Hy(_,A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function hk(_,A,O,R,G){var X=ue();try{return $y(_,A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}var Nu,Yy;H=function _(){Nu||Wy(),Nu||(H=_)};function Wy(){if(ve>0||!Yy&&(Yy=1,oe(),ve>0))return;function _(){var A;Nu||(Nu=1,o.calledRun=1,!I&&(ne(),i(o),(A=o.onRuntimeInitialized)===null||A===void 0||A.call(o),se()))}o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),_()},1)):_()}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Wy(),r=s,r}})();function D7(t){return hf(pf,t)}async function M7(t,e){return N7(pf,t,e)}async function L7(t,e){return R7(pf,t,e)}const $m=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],F7=[...$m,["unknown"]].map(t=>t[0]),gf=new Map($m);function j7(t){for(const[e,n]of gf)if(t===n)return e;return"unknown"}function V7(t){if(Ym(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Wm(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(Km(t))return{width:t.videoWidth,height:t.videoHeight};if(Xm(t))return{width:t.width,height:t.height};if(Jm(t))return{width:t.displayWidth,height:t.displayHeight};if(zm(t))return{width:t.width,height:t.height};if(Qm(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Ym(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLImageElement)}catch{return!1}}function Wm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.SVGImageElement)}catch{return!1}}function Km(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLVideoElement)}catch{return!1}}function zm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLCanvasElement)}catch{return!1}}function Xm(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function Qm(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function Jm(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function Zm(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function U7(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function G7(t,e){try{const n=new OffscreenCanvas(t,e);if(n.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{const n=document.createElement("canvas");return n.width=t,n.height=e,n}}async function e2(t){if(Ym(t)&&!await Y7(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Wm(t)&&!await W7(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Jm(t)&&K7(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(Km(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Xm(t)&&X7(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:n}=V7(t);if(e===0||n===0)return null;const r=G7(e,n).getContext("2d");r.drawImage(t,0,0);try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function q7(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let n="";try{n=URL.createObjectURL(t),e.src=n,await e.decode()}finally{URL.revokeObjectURL(n)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await e2(e)}function H7(t){const{width:e,height:n}=t;if(e===0||n===0)return null;const r=t.getContext("2d");try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function $7(t){if(Zm(t))return await q7(t);if(U7(t)){if(z7(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return zm(t)||Qm(t)?H7(t):await e2(t)}async function Y7(t){try{return await t.decode(),!0}catch{return!1}}async function W7(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function K7(t){return t.format===null}function z7(t){return t.data.buffer.byteLength===0}function X7(t){return t.width===0&&t.height===0}function t2(t,e){return Q7(t)?new DOMException(`${e}: ${t.message}`,t.name):J7(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function Q7(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function J7(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var ru;let mf=class extends EventTarget{constructor(e={}){var n;super(),C7(this,ru);try{const r=(n=e==null?void 0:e.formats)==null?void 0:n.filter(o=>o!=="unknown");if((r==null?void 0:r.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const o of r??[])if(!gf.has(o))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${o}' is not a valid enum value of type BarcodeFormat.`);_7(this,ru,r??[]),D7().then(o=>{this.dispatchEvent(new CustomEvent("load",{detail:o}))}).catch(o=>{this.dispatchEvent(new CustomEvent("error",{detail:o}))})}catch(r){throw t2(r,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return F7.filter(e=>e!=="unknown")}async detect(e){try{const n=await $7(e);if(n===null)return[];let r;const o={tryHarder:!0,returnCodabarStartEnd:!0,formats:E7(this,ru).map(i=>gf.get(i))};try{Zm(n)?r=await M7(n,o):r=await L7(n,o)}catch(i){throw console.error(i),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return r.map(i=>{const{topLeft:{x:a,y:s},topRight:{x:c,y:u},bottomLeft:{x:d,y:h},bottomRight:{x:f,y:p}}=i.position,l=Math.min(a,c,d,f),g=Math.min(s,u,h,p),m=Math.max(a,c,d,f),y=Math.max(s,u,h,p);return{boundingBox:new DOMRectReadOnly(l,g,m-l,y-g),rawValue:i.text,format:j7(i.format),cornerPoints:[{x:a,y:s},{x:c,y:u},{x:f,y:p},{x:d,y:h}]}})}catch(n){throw t2(n,"Failed to execute 'detect' on 'BarcodeDetector'")}}};ru=new WeakMap,globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=mf);function Z7(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function eS(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),x.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function tS(t){const{scanning:e,startScanning:n,stopScanning:r}=t,[o,i]=x.useState(!1);function a(){i(!0),e?r():n(),setTimeout(()=>i(!1),1e3)}return x.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:o?"default":"pointer"}},e?x.createElement(Z7,{disabled:o,onClick:a}):x.createElement(eS,{disabled:o,onClick:a}))}function nS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function rS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function oS(t){const{status:e,scanning:n,torchToggle:r}=t;function o(i){r(i)}return n&&r?x.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?x.createElement(rS,{onClick:()=>o(!1)}):x.createElement(nS,{onClick:()=>o(!0)})):null}function iS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function aS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function sS(t){const{scanning:e,capabilities:n,onZoom:r,value:o}=t;if(!e||!r)return null;const i=(n.max-n.min)/3;return x.createElement(x.Fragment,null,x.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(aS,{disabled:o<=n.min,onClick:function(){r(Math.max(o-i,n.min))}})),x.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(iS,{disabled:o>=n.max,onClick:function(){r(Math.min(o+i,n.max))}})))}function cS(t){const{scanning:e,loading:n,capabilities:r,border:o=35,onOff:i,torch:a,zoom:s,startScanning:c,stopScanning:u}=t,d="rgba(255, 0, 0, 0.5)";return x.createElement("div",{style:{position:"relative"}},x.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${o>=35?o:35}px solid rgba(0, 0, 0, 0.2)`}},n&&x.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",x.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),x.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:d,strokeWidth:3})),i&&x.createElement(tS,{scanning:e,startScanning:c,stopScanning:u}),a&&r.torch&&x.createElement(oS,{scanning:e,status:a.status,torchToggle:a.toggle}),s&&r.zoom&&x.createElement(sS,{scanning:e,capabilities:r.zoom,value:s.value,onZoom:s.onChange}))}const uS={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},lS={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},dS={width:"100%",height:"100%",position:"relative"},fS={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var hS=function(t){let e,n=!1;return(...r)=>(n||(e=t(r),n=!0),e)}(()=>{const t=YA(window);switch(t.browser){case"chrome":r7(window,t);break;case"firefox":s7(window,t);break;case"safari":d7(window,t);break;default:throw new Error("Unsupported browser")}});const pS="data:audio/mp3;base64,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";var ds=t=>t instanceof Date,n2=t=>t==null;const r2=t=>typeof t=="object";var o2=t=>!n2(t)&&!Array.isArray(t)&&r2(t)&&!ds(t),i2=t=>n2(t)||!r2(t);function a2(t,e){if(i2(t)||i2(e))return t===e;if(ds(t)&&ds(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const i=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=e[o];if(ds(i)&&ds(a)||o2(i)&&o2(a)||Array.isArray(i)&&Array.isArray(a)?!a2(i,a):i!==a)return!1}}return!0}function ou(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function gS(t){var e;const{onScan:n,constraints:r,formats:o=["qr_code"],paused:i=!1,components:a,children:s,styles:c,classNames:u,allowMultiple:d,scanDelay:h,onError:f}=t,p=x.useRef(null),l=x.useRef(null),g=x.useRef(null),m=x.useMemo(()=>({...uS,...r}),[r]),y=x.useMemo(()=>({...lS,...a}),[a]),[w,b]=x.useState(!1),[E,C]=x.useState(!0),[I,T]=x.useState(m),P=function(){const q=x.useRef(Promise.resolve({type:"stop",data:{}})),k=x.useRef(null),U=x.useRef(null),[z,te]=x.useState({}),[oe,ne]=x.useState({}),se=x.useCallback(async(H,$)=>{var J,S,M;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((J=navigator==null?void 0:navigator.mediaDevices)===null||J===void 0?void 0:J.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");hS();const F=await navigator.mediaDevices.getUserMedia({audio:!1,video:$});H.srcObject!==void 0?H.srcObject=F:H.mozSrcObject!==void 0?H.mozSrcObject=F:window.URL.createObjectURL?H.src=window.URL.createObjectURL(F):window.webkitURL?H.src=window.webkitURL.createObjectURL(F):H.src=F.id,await Promise.race([H.play(),new Promise(Q=>setTimeout(Q,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Q=>setTimeout(Q,500));const[B]=F.getVideoTracks();return ne(B.getSettings()),te((M=(S=B==null?void 0:B.getCapabilities)===null||S===void 0?void 0:S.call(B))!==null&&M!==void 0?M:{}),k.current=F,U.current=B,{type:"start",data:{videoEl:H,stream:F,constraints:$}}},[]),we=x.useCallback(async(H,$)=>{H.src="",H.srcObject=null,H.load();for(const J of $.getTracks())$.removeTrack(J),J.stop();return k.current=null,U.current=null,ne({}),{type:"stop",data:{}}},[]),le=x.useCallback(async(H,{constraints:$,restart:J=!1})=>{if(q.current=q.current.then(S=>{if(S.type==="start"){const{data:{videoEl:M,stream:F,constraints:B}}=S;return J||H!==M||$!==B?we(M,F).then(()=>se(H,$)):S}return se(H,$)}),(await q.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[se,we]),_e=x.useCallback(async()=>{if(q.current=q.current.then(H=>{if(H.type==="stop")return H;const{data:{videoEl:$,stream:J}}=H;return we($,J)}),(await q.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[we]),ve=x.useCallback(async H=>{const $=U.current;if(!$)throw new Error("No active video track found.");{H.advanced&&H.advanced[0].zoom&&$.getCapabilities().torch&&await $.applyConstraints({advanced:[{torch:!1}]}),await $.applyConstraints(H);const J=$.getCapabilities(),S=$.getSettings();te(J),ne(S)}},[]);return x.useEffect(()=>()=>{(async()=>await _e())()},[_e]),{capabilities:z,settings:oe,startCamera:le,stopCamera:_e,updateConstraints:ve}}(),{startScanning:N,stopScanning:L}=function(q){const{videoElementRef:k,onScan:U,onFound:z,retryDelay:te=100,scanDelay:oe=0,formats:ne=[],audio:se=!0,allowMultiple:we=!1}=q,le=x.useRef(new mf({formats:ne})),_e=x.useRef(null),ve=x.useRef(null);x.useEffect(()=>{le.current=new mf({formats:ne})},[ne]),x.useEffect(()=>{typeof window<"u"&&se&&(_e.current=new Audio(pS))},[se]);const H=x.useCallback($=>async J=>{if(k.current!==null&&k.current.readyState>1){const{lastScan:S,contentBefore:M,lastScanHadContent:F}=$;if(J-S<te)ve.current=window.requestAnimationFrame(H($));else{const B=await le.current.detect(k.current),Q=B.some(ge=>!M.includes(ge.rawValue)),Z=B.length>0;let ee=$.lastOnScan;(Q||we&&Z&&J-ee>=oe)&&(se&&_e.current&&_e.current.paused&&_e.current.play().catch(ge=>console.error("Error playing the sound",ge)),ee=J,U(B)),Z&&z(B),!Z&&F&&z(B);const K={lastScan:J,lastOnScan:ee,lastScanHadContent:Z,contentBefore:Q?B.map(ge=>ge.rawValue):M};ve.current=window.requestAnimationFrame(H(K))}}},[k.current,U,z,te]);return{startScanning:x.useCallback(()=>{const $=performance.now(),J={lastScan:$,lastOnScan:$,contentBefore:[],lastScanHadContent:!1};ve.current=window.requestAnimationFrame(H(J))},[H]),stopScanning:x.useCallback(()=>{ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null)},[])}}({videoElementRef:p,onScan:n,onFound:q=>function(k,U,z,te){const oe=z;if(oe==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const ne=U;if(ne==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(k.length===0||te===void 0)ou(oe);else{const se=ne.offsetWidth,we=ne.offsetHeight,le=ne.videoWidth,_e=ne.videoHeight,ve=Math.max(se/le,we/_e),H=le*ve,$=_e*ve,J=H/le,S=$/_e,M=(se-H)/2,F=(we-$)/2,B=({x:K,y:ge})=>({x:Math.floor(K*J),y:Math.floor(ge*S)}),Q=({x:K,y:ge})=>({x:Math.floor(K+M),y:Math.floor(ge+F)}),Z=k.map(K=>{const{boundingBox:ge,cornerPoints:be}=K,{x:pe,y:fe}=Q(B({x:ge.x,y:ge.y})),{x:ye,y:ue}=B({x:ge.width,y:ge.height});return{...K,cornerPoints:be.map(Oe=>Q(B(Oe))),boundingBox:DOMRectReadOnly.fromRect({x:pe,y:fe,width:ye,height:ue})}});oe.width=ne.offsetWidth,oe.height=ne.offsetHeight;const ee=oe.getContext("2d");if(ee===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");te(Z,ee)}}(q,p.current,g.current,y.tracker),formats:o,audio:y.audio,allowMultiple:d,retryDelay:y.tracker===void 0?500:10,scanDelay:h});x.useEffect(()=>(b(!0),()=>{b(!1)}),[]),x.useEffect(()=>{w&&(L(),N())},[a==null?void 0:a.tracker]),x.useEffect(()=>{if(!a2(m,I)){const q=m;r!=null&&r.deviceId&&delete q.facingMode,T(q)}},[r]);const V=x.useMemo(()=>({constraints:I,shouldStream:w&&!i}),[I,w,i]),j=async()=>{const q=p.current;if(q==null)throw new Error("Video should be defined when component is mounted.");const k=l.current;if(k==null)throw new Error("Canvas should be defined when component is mounted.");const U=k.getContext("2d");if(U==null)throw new Error("Canvas should be defined when component is mounted.");if(V.shouldStream){await P.stopCamera(),C(!1);try{await P.startCamera(q,V),q?C(!0):await P.stopCamera()}catch(z){f==null||f(z),console.error("error",z)}}else k.width=q.videoWidth,k.height=q.videoHeight,U.drawImage(q,0,0,q.videoWidth,q.videoHeight),await P.stopCamera(),C(!1)};x.useEffect(()=>{(async()=>await j())()},[V]);const W=x.useMemo(()=>V.shouldStream&&E,[V.shouldStream,E]);return x.useEffect(()=>{if(W){if(l.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(ou(l.current),g.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(ou(g.current),p.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");N()}},[W]),x.createElement("div",{style:{...dS,...c==null?void 0:c.container},className:u==null?void 0:u.container},x.createElement("video",{ref:p,style:{...fS,...c==null?void 0:c.video,visibility:i?"hidden":"visible"},className:u==null?void 0:u.video,autoPlay:!0,muted:!0,playsInline:!0}),x.createElement("canvas",{ref:l,style:{display:i?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),x.createElement("canvas",{ref:g,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),x.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},y.finder&&x.createElement(cS,{scanning:E,capabilities:P.capabilities,loading:!1,onOff:y.onOff,zoom:y.zoom&&P.settings.zoom?{value:P.settings.zoom,onChange:async q=>{const k={...I,advanced:[{zoom:q}]};await P.updateConstraints(k)}}:void 0,torch:y.torch?{status:(e=P.settings.torch)!==null&&e!==void 0&&e,toggle:async q=>{const k={...I,advanced:[{torch:q}]};await P.updateConstraints(k)}}:void 0,startScanning:async()=>await j(),stopScanning:async()=>{await P.stopCamera(),ou(g.current),C(!1)},border:c==null?void 0:c.finderBorder}),s))}function mS(){const[t,e]=x.useState([]);return x.useEffect(()=>{(async()=>e(await async function(){return(await navigator.mediaDevices.enumerateDevices()).filter(({kind:n})=>n==="videoinput")}()))()},[]),t}const s2=x.createContext({cameraService:1,cameraFacingMode:Vn.USER,primaryIdentificationMethod:Ci.IDENTIFIER});function an(){const t=x.useContext(s2);if(!t)throw new Error("Only use 'useConfigurationContext' within a ConfigurationContext Provider");return t}const yf="data:image/svg+xml,%3csvg%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m21.25%207.5c.3796958%200%20.693491.28215388.7431534.64822944l.0068466.10177056v8.5c0%201.7330315-1.3564548%203.1492459-3.0655761%203.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555%200-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932%201.06066018%200%20.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734%200%201.6711923-.7071103%201.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815%202%202c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554%200%20.03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2%202c-.2928932.29289321-.767767.29289321-1.0606602%200-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734%200-1.67119234.70711027-1.7441988%201.60647279l-.0058012.14352721v8.5c0%20.4142136-.33578644.75-.75.75-.37969577%200-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146%201.35645477-3.14924593%203.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117%205.85294824c2.209139%200%204%201.790861%204%204s-1.790861%204-4%204-4-1.790861-4-4%201.790861-4%204-4zm0%201.5c-1.3807119%200-2.5%201.1192881-2.5%202.5s1.1192881%202.5%202.5%202.5%202.5-1.1192881%202.5-2.5-1.1192881-2.5-2.5-2.5z'%20fill='%23212121'/%3e%3c/svg%3e";function c2({onScan:t}){const{cameraFacingMode:e}=an(),[n,r]=x.useState(e??Vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx("div",{className:"scale-x-[-1]",children:v.jsx(gS,{components:{finder:!1},onScan:o=>t(o[0].rawValue),constraints:{facingMode:n},allowMultiple:!0,classNames:{video:"rounded",container:"max-h-[calc(100vh-381px)] min-h-[267px] overflow-hidden rounded"},onError:o=>{console.log(o),Pg(o)}})}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===Vn.USER?r(Vn.ENVIRONMENT):r(Vn.USER),children:v.jsx("img",{src:yf,alt:"camera-switch"})})]})}var iu,vf,yS=(iu=function(t,e){return iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},iu(t,e)},function(t,e){function n(){this.constructor=t}iu(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}),vS=function(t){function e(n){var r,o,i,a=this.constructor,s=t.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(c,u){u===void 0&&(u=c.constructor);var d=Error.captureStackTrace;d&&d(c,u)}(s),s}return yS(e,t),e}(Error),wS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function e(n){n===void 0&&(n=void 0);var r=t.call(this,n)||this;return r.message=n,r}return wS(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(vS),bS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return bS(e,t),e.kind="ArgumentException",e}($n),ES=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ve=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return ES(e,t),e.kind="IllegalArgumentException",e}($n),u2=function(){function t(e){if(this.binarizer=e,e===null)throw new Ve("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(e,n){return this.binarizer.getBlackRow(e,n)},t.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,n,r,o){var i=this.binarizer.getLuminanceSource().crop(e,n,r,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},t}(),CS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sn=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return CS(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}($n),_S=function(){function t(e){this.source=e}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Nt=function(){function t(){}return t.arraycopy=function(e,n,r,o,i){for(;i--;)r[o++]=e[n++]},t.currentTimeMillis=function(){return Date.now()},t}(),AS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wf=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return AS(e,t),e.kind="IndexOutOfBoundsException",e}($n),SS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),l2=function(t){function e(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=t.call(this,r)||this;return o.index=n,o.message=r,o}return SS(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(wf),IS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function t(){}return t.fill=function(e,n){for(var r=0,o=e.length;r<o;r++)e[r]=n},t.fillWithin=function(e,n,r,o){t.rangeCheck(e.length,n,r);for(var i=n;i<r;i++)e[i]=o},t.rangeCheck=function(e,n,r){if(n>r)throw new Ve("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new l2(n);if(r>e)throw new l2(r)},t.asList=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e},t.create=function(e,n,r){return Array.from({length:e}).map(function(o){return Array.from({length:n}).fill(r)})},t.createInt32Array=function(e,n,r){return Array.from({length:e}).map(function(o){return Int32Array.from({length:n}).fill(r)})},t.equals=function(e,n){if(!e||!n||!e.length||!n.length||e.length!==n.length)return!1;for(var r=0,o=e.length;r<o;r++)if(e[r]!==n[r])return!1;return!0},t.hashCode=function(e){var n,r;if(e===null)return 0;var o=1;try{for(var i=IS(e),a=i.next();!a.done;a=i.next())o=31*o+a.value}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},t.fillUint8Array=function(e,n){for(var r=0;r!==e.length;r++)e[r]=n},t.copyOf=function(e,n){return e.slice(0,n)},t.copyOfUint8Array=function(e,n){if(e.length<=n){var r=new Uint8Array(n);return r.set(e),r}return e.slice(0,n)},t.copyOfRange=function(e,n,r){var o=r-n,i=new Int32Array(o);return Nt.arraycopy(e,n,i,0,o),i},t.binarySearch=function(e,n,r){r===void 0&&(r=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=r(n,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(e,n){return e-n},t}(),bn=function(){function t(){}return t.numberOfTrailingZeros=function(e){var n;if(e===0)return 32;var r=31;return(n=e<<16)!==0&&(r-=16,e=n),(n=e<<8)!==0&&(r-=8,e=n),(n=e<<4)!==0&&(r-=4,e=n),(n=e<<2)!==0&&(r-=2,e=n),r-(e<<1>>>31)},t.numberOfLeadingZeros=function(e){if(e===0)return 32;var n=1;return!(e>>>16)&&(n+=16,e<<=16),!(e>>>24)&&(n+=8,e<<=8),!(e>>>28)&&(n+=4,e<<=4),!(e>>>30)&&(n+=2,e<<=2),n-=e>>>31},t.toHexString=function(e){return e.toString(16)},t.toBinaryString=function(e){return String(parseInt(String(e),2))},t.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},t.truncDivision=function(e,n){return Math.trunc(e/n)},t.parseInt=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Ur=function(){function t(e,n){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=n??t.makeArray(e))}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var n=t.makeArray(e);Nt.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},t.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(31&e))!=0},t.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},t.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},t.prototype.getNextSet=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+bn.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.getNextUnset=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=~r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+bn.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.setBulk=function(e,n){this.bits[Math.floor(e/32)]=n},t.prototype.setRange=function(e,n){if(n<e||e<0||n>this.size)throw new Ve;if(n!==e){n--;for(var r=Math.floor(e/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(a<o?31:31&n))-(1<<(a>r?0:31&e));i[a]|=s}}},t.prototype.clear=function(){for(var e=this.bits.length,n=this.bits,r=0;r<e;r++)n[r]=0},t.prototype.isRange=function(e,n,r){if(n<e||e<0||n>this.size)throw new Ve;if(n===e)return!0;n--;for(var o=Math.floor(e/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var c=(2<<(s<i?31:31&n))-(1<<(s>o?0:31&e))&4294967295;if((a[s]&c)!==(r?c:0))return!1}return!0},t.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(e,n){if(n<0||n>32)throw new Ve("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((e>>r-1&1)==1)},t.prototype.appendBitArray=function(e){var n=e.size;this.ensureCapacity(this.size+n);for(var r=0;r<n;r++)this.appendBit(e.get(r))},t.prototype.xor=function(e){if(this.size!==e.size)throw new Ve("Sizes don't match");for(var n=this.bits,r=0,o=n.length;r<o;r++)n[r]^=e.bits[r]},t.prototype.toBytes=function(e,n,r,o){for(var i=0;i<o;i++){for(var a=0,s=0;s<8;s++)this.get(e)&&(a|=1<<7-s),e++;n[r+i]=a}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),n=Math.floor((this.size-1)/32),r=n+1,o=this.bits,i=0;i<r;i++){var a=o[i];a=(a=(a=(a=(a=a>>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,e[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,c=e[0]>>>s;for(i=1;i<r;i++){var u=e[i];c|=u<<32-s,e[i-1]=c,c=u>>>s}e[r-1]=c}this.bits=e},t.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.size===n.size&&or.equals(this.bits,n.bits)},t.prototype.hashCode=function(){return 31*this.size+or.hashCode(this.bits)},t.prototype.toString=function(){for(var e="",n=0,r=this.size;n<r;n++)!(7&n)&&(e+=" "),e+=this.get(n)?"X":".";return e},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(vf||(vf={}));var _t,Pt=vf,TS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return TS(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}($n),xS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"})(_t||(_t={}));var bf,Yn=function(){function t(e,n,r){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=r,this.values=typeof n=="number"?Int32Array.from([n]):n,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(r,this);for(var c=this.values,u=0,d=c.length;u!==d;u++){var h=c[u];t.VALUES_TO_ECI.set(h,this)}try{for(var f=xS(a),p=f.next();!p.done;p=f.next()){var l=p.value;t.NAME_TO_ECI.set(l,this)}}catch(g){o={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Se("incorect value");var n=t.VALUES_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.getCharacterSetECIByName=function(e){var n=t.NAME_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.getName()===n.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(_t.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(_t.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(_t.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(_t.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(_t.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(_t.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(_t.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(_t.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(_t.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(_t.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(_t.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(_t.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(_t.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(_t.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(_t.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(_t.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(_t.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(_t.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(_t.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(_t.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(_t.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(_t.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(_t.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(_t.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(_t.Big5,28,"Big5"),t.GB18030=new t(_t.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(_t.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),OS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),au=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return OS(e,t),e.kind="UnsupportedOperationException",e}($n),ci=function(){function t(){}return t.decode=function(e,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(e,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&e==="ISO-8859-1"},t.encode=function(e,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(e,r):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},t.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},t.encodingName=function(e){return typeof e=="string"?e:e.getName()},t.encodingCharacterSet=function(e){return e instanceof Yn?e:Yn.getCharacterSetECIByName(e)},t.decodeFallback=function(e,n){var r=this.encodingCharacterSet(n);if(t.isDecodeFallbackSupported(r)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(r.equals(Yn.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new au("Encoding "+this.encodingName(n)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(e){return e.equals(Yn.UTF8)||e.equals(Yn.ISO8859_1)||e.equals(Yn.ASCII)},t.encodeFallback=function(e){for(var n=btoa(unescape(encodeURIComponent(e))).split(""),r=[],o=0;o<n.length;o++)r.push(n[o].charCodeAt(0));return new Uint8Array(r)},t}(),pn=function(){function t(){}return t.castAsNonUtf8Char=function(e,n){n===void 0&&(n=null);var r=n?n.getName():this.ISO88591;return ci.decode(new Uint8Array([e]),r)},t.guessEncoding=function(e,n){if(n!=null&&n.get(Pt.CHARACTER_SET)!==void 0)return n.get(Pt.CHARACTER_SET).toString();for(var r=e.length,o=!0,i=!0,a=!0,s=0,c=0,u=0,d=0,h=0,f=0,p=0,l=0,g=0,m=0,y=0,w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,b=0;b<r&&(o||i||a);b++){var E=255&e[b];a&&(s>0?128&E?s--:a=!1:128&E&&(64&E?(s++,32&E?(s++,16&E?(s++,8&E?a=!1:d++):u++):c++):a=!1)),o&&(E>127&&E<160?o=!1:E>159&&(E<192||E===215||E===247)&&y++),i&&(h>0?E<64||E===127||E>252?i=!1:h--:E===128||E===160||E>239?i=!1:E>160&&E<224?(f++,l=0,++p>g&&(g=p)):E>127?(h++,p=0,++l>m&&(m=l)):(p=0,l=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(w||c+u+d>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?g===2&&f===2||10*y>=r?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=-1;function i(s,c,u,d,h,f){if(s==="%%")return"%";if(n[++o]!==void 0){s=d?parseInt(d.substr(1)):void 0;var p,l=h?parseInt(h.substr(1)):void 0;switch(f){case"s":p=n[o];break;case"c":p=n[o][0];break;case"f":p=parseFloat(n[o]).toFixed(s);break;case"p":p=parseFloat(n[o]).toPrecision(s);break;case"e":p=parseFloat(n[o]).toExponential(s);break;case"x":p=parseInt(n[o]).toString(l||16);break;case"d":p=parseFloat(parseInt(n[o],l||10).toPrecision(s)).toFixed(0)}p=typeof p=="object"?JSON.stringify(p):(+p).toString(l);for(var g=parseInt(u),m=u&&u[0]+""=="0"?"0":" ";p.length<g;)p=c!==void 0?p+m:m+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(a,i)},t.getBytes=function(e,n){return ci.encode(e,n)},t.getCharCode=function(e,n){return n===void 0&&(n=0),e.charCodeAt(n)},t.getCharAt=function(e){return String.fromCharCode(e)},t.SHIFT_JIS=Yn.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Yn.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Yn.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),xt=function(){function t(e){e===void 0&&(e=""),this.value=e}return t.prototype.enableDecoding=function(e){return this.encoding=e,this},t.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=pn.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},t.prototype.appendChars=function(e,n,r){for(var o=n;n<n+r;o++)this.append(e[o]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(e){return this.value.charAt(e)},t.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},t.prototype.setCharAt=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+1)},t.prototype.substring=function(e,n){return this.value.substring(e,n)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+n.length)},t}(),oo=function(){function t(e,n,r,o){if(this.width=e,this.height=n,this.rowSize=r,this.bits=o,n==null&&(n=e),this.height=n,e<1||n<1)throw new Ve("Both dimensions must be greater than 0");r==null&&(r=Math.floor((e+31)/32)),this.rowSize=r,o==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var n=e.length,r=e[0].length,o=new t(r,n),i=0;i<n;i++)for(var a=e[i],s=0;s<r;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,n,r){if(e===null)throw new Ve("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,c=0,u=0;u<e.length;)if(e.charAt(u)===`
135
+ */var _m;function MA(){return _m||(_m=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,l=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function b(B){return typeof B=="string"||typeof B=="function"||B===r||B===u||B===i||B===o||B===h||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===l||B.$$typeof===p||B.$$typeof===a||B.$$typeof===s||B.$$typeof===d||B.$$typeof===m||B.$$typeof===y||B.$$typeof===w||B.$$typeof===g)}function E(B){if(typeof B=="object"&&B!==null){var Q=B.$$typeof;switch(Q){case e:var Z=B.type;switch(Z){case c:case u:case r:case i:case o:case h:return Z;default:var ee=Z&&Z.$$typeof;switch(ee){case s:case d:case l:case p:case a:return ee;default:return Q}}case n:return Q}}}var C=c,I=u,T=s,P=a,N=e,L=d,V=r,j=l,W=p,q=n,k=i,U=o,z=h,te=!1;function oe(B){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ne(B)||E(B)===c}function ne(B){return E(B)===u}function se(B){return E(B)===s}function we(B){return E(B)===a}function le(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function _e(B){return E(B)===d}function ve(B){return E(B)===r}function H(B){return E(B)===l}function $(B){return E(B)===p}function J(B){return E(B)===n}function S(B){return E(B)===i}function M(B){return E(B)===o}function F(B){return E(B)===h}bt.AsyncMode=C,bt.ConcurrentMode=I,bt.ContextConsumer=T,bt.ContextProvider=P,bt.Element=N,bt.ForwardRef=L,bt.Fragment=V,bt.Lazy=j,bt.Memo=W,bt.Portal=q,bt.Profiler=k,bt.StrictMode=U,bt.Suspense=z,bt.isAsyncMode=oe,bt.isConcurrentMode=ne,bt.isContextConsumer=se,bt.isContextProvider=we,bt.isElement=le,bt.isForwardRef=_e,bt.isFragment=ve,bt.isLazy=H,bt.isMemo=$,bt.isPortal=J,bt.isProfiler=S,bt.isStrictMode=M,bt.isSuspense=F,bt.isValidElementType=b,bt.typeOf=E}()),bt}process.env.NODE_ENV==="production"?ff.exports=DA():ff.exports=MA();var LA=ff.exports,Am=LA,FA={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sm={};Sm[Am.ForwardRef]=FA,Sm[Am.Memo]=jA;const VA=new WeakSet;function UA(t){const e=BA({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:o,createRoutesFromChildren:i,matchRoutes:a,stripBasename:s,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=t;return{...e,setup(){},afterAllSetup(d){e.afterAllSetup(d);const h=et&&et.location&&et.location.pathname;c&&h&&bm(d,{name:h,attributes:{[eo]:"url",[ko]:"pageload",[on]:"auto.pageload.react.reactrouter_v6"}}),u&&VA.add(d)}}}function GA(){const{t}=Ue(),[e,n]=x.useState(!1);return v.jsx("div",{className:"default-bg-colors flex h-screen items-center justify-center",children:v.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-300 bg-white shadow-lg",children:[v.jsx("div",{className:"border-b border-gray-200 bg-gray-50 px-6 pb-3 pt-4 shadow",children:v.jsx("h2",{className:"text-3xl",children:"Oops!"})}),v.jsx("p",{className:"mt-4 px-6 text-gray-900",children:t("sorrySomethingWentWrong")}),v.jsx("div",{className:"mt-10 p-6",children:v.jsx(Je,{onClick:()=>{n(!0),window.location.replace("/")},pending:e,label:t("back")})})]})})}class qA extends x.Component{constructor(e){super(e),this.state={hasError:!1,scope:void 0}}componentDidMount(){const e=bA().filter(o=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(o.name)),n=new S5({dsn:"https://5b16c396f6e8f6e4b0b87455bea7e96b@o80526.ingest.us.sentry.io/4507345428283392",transport:L_,stackParser:Y_,integrations:[...e,UA({useEffect:x.useEffect,useLocation:er,useNavigationType:k3,createRoutesFromChildren:nc,matchRoutes:L1})]}),r=new Po;r.setClient(n),n.init(),this.setState({...this.state,scope:r})}componentDidCatch(e,n){console.error("ErrorBoundary: ",e,n),this.state.scope.captureException(e),this.setState({...this.state,hasError:!0})}render(){return this.state.hasError?v.jsx(GA,{}):this.props.children}}function je(){const t=x.useContext(sh);if(!t)throw new Error("Only use 'usePortalSessionContext' within a PortalSessionProvider");return t}const HA={[Kt.GENERIC]:Le.GENERIC,[Kt.PORTAL]:Le.PORTAL,[Kt.POINTS_TRANSACTION]:Le.POINTS_TRANSACTION,[Kt.PREPAID]:Le.PREPAID,[Kt.PAY_PREPAID]:Le.PREPAID,[Kt.TOP_UP_PREPAID]:Le.PREPAID,[Kt.VOUCHER]:Le.VOUCHER,[Kt.GIFTCARD]:Le.GIFTCARD,[Kt.REDEEM_GIFTCARD]:Le.GIFTCARD,[Kt.TOP_UP_GIFTCARD]:Le.GIFTCARD};function $A(){const{portalSession:t}=je();return v.jsx(dr,{to:HA[t.type]})}function si({onSubmit:t,children:e}){const n=r=>{r.preventDefault(),t&&t(r)};return v.jsx("form",{onSubmit:n,children:e})}const Im=x.createContext({cameraService:1,cameraFacingMode:Vn.USER,primaryIdentificationMethod:Ci.IDENTIFIER});function an(){const t=x.useContext(Im);if(!t)throw new Error("Only use 'useConfigurationContext' within a ConfigurationContext Provider");return t}var Tm={},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.compactObject=km,Hn.deprecated=e7;var YA=Hn.detectBrowser=t7;Hn.disableLog=QA,Hn.disableWarnings=JA,Hn.extractVersion=tu,Hn.filterStats=n7,Hn.log=ZA,Hn.walkStats=nu,Hn.wrapPeerConnectionEvent=XA;function WA(t,e,n){return e=KA(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KA(t){var e=zA(t,"string");return No(e)=="symbol"?e:e+""}function zA(t,e){if(No(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(No(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function No(t){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(t)}var xm=!0,Om=!0;function tu(t,e,n){var r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function XA(t,e,n){if(t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(a,s){if(a!==e)return o.apply(this,arguments);var c=function(d){var h=n(d);h&&(s.handleEvent?s.handleEvent(h):s(h))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(s,c),o.apply(this,[a,c])};var i=r.removeEventListener;r.removeEventListener=function(a,s){if(a!==e||!this._eventMap||!this._eventMap[e])return i.apply(this,arguments);if(!this._eventMap[e].has(s))return i.apply(this,arguments);var c=this._eventMap[e].get(s);return this._eventMap[e].delete(s),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,i.apply(this,[a,c])},Object.defineProperty(r,"on"+e,{get:function(){return this["_on"+e]},set:function(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}}function QA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(xm=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function JA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(Om=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function ZA(){if((typeof window>"u"?"undefined":No(window))==="object"){if(xm)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function e7(t,e){Om&&console.warn(t+" is deprecated, please use "+e+" instead.")}function t7(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var n=t.navigator;if(n.userAgentData&&n.userAgentData.brands){var r=n.userAgentData.brands.find(function(o){return o.brand==="Chromium"});if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(n.mozGetUserMedia)e.browser="firefox",e.version=tu(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=tu(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=tu(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Pm(t){return Object.prototype.toString.call(t)==="[object Object]"}function km(t){return Pm(t)?Object.keys(t).reduce(function(e,n){var r=Pm(t[n]),o=r?km(t[n]):t[n],i=r&&!Object.keys(o).length;return o===void 0||i?e:Object.assign(e,WA({},n,o))},{}):t}function nu(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(function(r){r.endsWith("Id")?nu(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(function(o){nu(t,t.get(o),n)})}))}function n7(t,e,n){var r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(e===null)return o;var i=[];return t.forEach(function(a){a.type==="track"&&a.trackIdentifier===e.id&&i.push(a)}),i.forEach(function(a){t.forEach(function(s){s.type===r&&s.trackId===a.id&&nu(t,s,o)})}),o}Object.defineProperty(Tm,"__esModule",{value:!0});var r7=Tm.shimGetUserMedia=a7,o7=i7(Hn);function Bm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Bm=function(o){return o?n:e})(t)}function i7(t,e){if(t&&t.__esModule)return t;if(t===null||Ro(t)!="object"&&typeof t!="function")return{default:t};var n=Bm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Ro(t){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(t)}var Nm=o7.log;function a7(t,e){var n=t&&t.navigator;if(n.mediaDevices){var r=function(u){if(Ro(u)!=="object"||u.mandatory||u.optional)return u;var d={};return Object.keys(u).forEach(function(h){if(!(h==="require"||h==="advanced"||h==="mediaSource")){var f=Ro(u[h])==="object"?u[h]:{ideal:u[h]};f.exact!==void 0&&typeof f.exact=="number"&&(f.min=f.max=f.exact);var p=function(m,y){return m?m+y.charAt(0).toUpperCase()+y.slice(1):y==="deviceId"?"sourceId":y};if(f.ideal!==void 0){d.optional=d.optional||[];var l={};typeof f.ideal=="number"?(l[p("min",h)]=f.ideal,d.optional.push(l),l={},l[p("max",h)]=f.ideal,d.optional.push(l)):(l[p("",h)]=f.ideal,d.optional.push(l))}f.exact!==void 0&&typeof f.exact!="number"?(d.mandatory=d.mandatory||{},d.mandatory[p("",h)]=f.exact):["min","max"].forEach(function(g){f[g]!==void 0&&(d.mandatory=d.mandatory||{},d.mandatory[p(g,h)]=f[g])})}}),u.advanced&&(d.optional=(d.optional||[]).concat(u.advanced)),d},o=function(u,d){if(e.version>=61)return d(u);if(u=JSON.parse(JSON.stringify(u)),u&&Ro(u.audio)==="object"){var h=function(m,y,w){y in m&&!(w in m)&&(m[w]=m[y],delete m[y])};u=JSON.parse(JSON.stringify(u)),h(u.audio,"autoGainControl","googAutoGainControl"),h(u.audio,"noiseSuppression","googNoiseSuppression"),u.audio=r(u.audio)}if(u&&Ro(u.video)==="object"){var f=u.video.facingMode;f=f&&(Ro(f)==="object"?f:{ideal:f});var p=e.version<66;if(f&&(f.exact==="user"||f.exact==="environment"||f.ideal==="user"||f.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!p)){delete u.video.facingMode;var l;if(f.exact==="environment"||f.ideal==="environment"?l=["back","rear"]:(f.exact==="user"||f.ideal==="user")&&(l=["front"]),l)return n.mediaDevices.enumerateDevices().then(function(g){g=g.filter(function(y){return y.kind==="videoinput"});var m=g.find(function(y){return l.some(function(w){return y.label.toLowerCase().includes(w)})});return!m&&g.length&&l.includes("back")&&(m=g[g.length-1]),m&&(u.video.deviceId=f.exact?{exact:m.deviceId}:{ideal:m.deviceId}),u.video=r(u.video),Nm("chrome: "+JSON.stringify(u)),d(u)})}u.video=r(u.video)}return Nm("chrome: "+JSON.stringify(u)),d(u)},i=function(u){return e.version>=64?u:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[u.name]||u.name,message:u.message,constraint:u.constraint||u.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},a=function(u,d,h){o(u,function(f){n.webkitGetUserMedia(f,d,function(p){h&&h(i(p))})})};if(n.getUserMedia=a.bind(n),n.mediaDevices.getUserMedia){var s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return o(c,function(u){return s(u).then(function(d){if(u.audio&&!d.getAudioTracks().length||u.video&&!d.getVideoTracks().length)throw d.getTracks().forEach(function(h){h.stop()}),new DOMException("","NotFoundError");return d},function(d){return Promise.reject(i(d))})})}}}}var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0});var s7=Rm.shimGetUserMedia=l7,c7=u7(Hn);function Dm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Dm=function(o){return o?n:e})(t)}function u7(t,e){if(t&&t.__esModule)return t;if(t===null||Qi(t)!="object"&&typeof t!="function")return{default:t};var n=Dm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Qi(t){"@babel/helpers - typeof";return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(t)}function l7(t,e){var n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(c,u,d){c7.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(c).then(u,d)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var o=function(u,d,h){d in u&&!(h in u)&&(u[h]=u[d],delete u[d])},i=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(c){return Qi(c)==="object"&&Qi(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c.audio,"autoGainControl","mozAutoGainControl"),o(c.audio,"noiseSuppression","mozNoiseSuppression")),i(c)},r&&r.prototype.getSettings){var a=r.prototype.getSettings;r.prototype.getSettings=function(){var c=a.apply(this,arguments);return o(c,"mozAutoGainControl","autoGainControl"),o(c,"mozNoiseSuppression","noiseSuppression"),c}}if(r&&r.prototype.applyConstraints){var s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(c){return this.kind==="audio"&&Qi(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c,"autoGainControl","mozAutoGainControl"),o(c,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[c])}}}}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.shimAudioContext=b7,Vr.shimCallbacksAPI=g7,Vr.shimConstraints=Fm,Vr.shimCreateOfferLegacy=w7;var d7=Vr.shimGetUserMedia=m7;Vr.shimLocalStreamsAPI=h7,Vr.shimRTCIceServerUrls=y7,Vr.shimRemoteStreamsAPI=p7,Vr.shimTrackEventTransceiver=v7;var Mm=f7(Hn);function Lm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Lm=function(o){return o?n:e})(t)}function f7(t,e){if(t&&t.__esModule)return t;if(t===null||Do(t)!="object"&&typeof t!="function")return{default:t};var n=Lm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Do(t){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Do(t)}function h7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){var o=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(function(i){return e.call(o,i,r)}),r.getVideoTracks().forEach(function(i){return e.call(o,i,r)})},t.RTCPeerConnection.prototype.addTrack=function(r){for(var o=this,i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return a&&a.forEach(function(c){o._localStreams?o._localStreams.includes(c)||o._localStreams.push(c):o._localStreams=[c]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(r){var o=this;this._localStreams||(this._localStreams=[]);var i=this._localStreams.indexOf(r);if(i!==-1){this._localStreams.splice(i,1);var a=r.getTracks();this.getSenders().forEach(function(s){a.includes(s.track)&&o.removeTrack(s)})}})}}function p7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(r){var o=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=r),this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(function(a){if(o._remoteStreams||(o._remoteStreams=[]),!o._remoteStreams.includes(a)){o._remoteStreams.push(a);var s=new Event("addstream");s.stream=a,o.dispatchEvent(s)}})})}});var e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(o){o.streams.forEach(function(i){if(r._remoteStreams||(r._remoteStreams=[]),!(r._remoteStreams.indexOf(i)>=0)){r._remoteStreams.push(i);var a=new Event("addstream");a.stream=i,r.dispatchEvent(a)}})}),e.apply(r,arguments)}}}function g7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,o=e.setLocalDescription,i=e.setRemoteDescription,a=e.addIceCandidate;e.createOffer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=n.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f},e.createAnswer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=r.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f};var s=function(u,d,h){var f=o.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f};e.setLocalDescription=s,s=function(u,d,h){var f=i.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.setRemoteDescription=s,s=function(u,d,h){var f=a.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.addIceCandidate=s}}function m7(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=function(o){return r(Fm(o))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(i,a,s){e.mediaDevices.getUserMedia(i).then(a,s)}).bind(e))}function Fm(t){return t&&t.video!==void 0?Object.assign({},t,{video:Mm.compactObject(t.video)}):t}function y7(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,o){if(r&&r.iceServers){for(var i=[],a=0;a<r.iceServers.length;a++){var s=r.iceServers[a];s.urls===void 0&&s.url?(Mm.deprecated("RTCIceServer.url","RTCIceServer.urls"),s=JSON.parse(JSON.stringify(s)),s.urls=s.url,delete s.url,i.push(s)):i.push(r.iceServers[a])}r.iceServers=i}return new e(r,o)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:function(){return e.generateCertificate}})}}function v7(t){Do(t)==="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function w7(t){var e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);var o=this.getTransceivers().find(function(a){return a.receiver.track.kind==="audio"});r.offerToReceiveAudio===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveAudio===!0&&!o&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);var i=this.getTransceivers().find(function(a){return a.receiver.track.kind==="video"});r.offerToReceiveVideo===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveVideo===!0&&!i&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function b7(t){Do(t)!=="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var jm=t=>{throw TypeError(t)},Vm=(t,e,n)=>e.has(t)||jm("Cannot "+n),E7=(t,e,n)=>(Vm(t,e,"read from private field"),n?n.call(t):e.get(t)),C7=(t,e,n)=>e.has(t)?jm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),_7=(t,e,n,r)=>(Vm(t,e,"write to private field"),e.set(t,n),n);const Um=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function A7(t){return t.join("|")}function S7(t){const e=Gm(t);let n=0,r=Um.length-1;for(;n<=r;){const o=Math.floor((n+r)/2),i=Um[o],a=Gm(i);if(a===e)return i;a<e?n=o+1:r=o-1}return"None"}function Gm(t){return t.toLowerCase().replace(/_-\[\]/g,"")}function I7(t,e){return t.Binarizer[e]}function T7(t,e){return t.CharacterSet[e]}const x7=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function O7(t){return x7[t.value]}function P7(t,e){return t.EanAddOnSymbol[e]}function k7(t,e){return t.TextMode[e]}const Ji={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function qm(t,e){return{...e,formats:A7(e.formats),binarizer:I7(t,e.binarizer),eanAddOnSymbol:P7(t,e.eanAddOnSymbol),textMode:k7(t,e.textMode),characterSet:T7(t,e.characterSet)}}function Hm(t){return{...t,format:S7(t.format),eccLevel:t.eccLevel,contentType:O7(t.contentType)}}const B7={locateFile:(t,e)=>{const n=t.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${n[1]}/${t}`:e+t}};let $m=new WeakMap;function hf(t,e){var n;const r=$m.get(t);if(r!=null&&r.modulePromise&&e===void 0)return r.modulePromise;const o=(n=r==null?void 0:r.moduleOverrides)!=null?n:B7,i=t({...o});return $m.set(t,{moduleOverrides:o,modulePromise:i}),i}async function N7(t,e,n=Ji){const r={...Ji,...n},o=await hf(t),{size:i}=e,a=new Uint8Array(await e.arrayBuffer()),s=o._malloc(i);o.HEAPU8.set(a,s);const c=o.readBarcodesFromImage(s,i,qm(o,r));o._free(s);const u=[];for(let d=0;d<c.size();++d)u.push(Hm(c.get(d)));return u}async function R7(t,e,n=Ji){const r={...Ji,...n},o=await hf(t),{data:i,width:a,height:s,data:{byteLength:c}}=e,u=o._malloc(c);o.HEAPU8.set(i,u);const d=o.readBarcodesFromPixmap(u,a,s,qm(o,r));o._free(u);const h=[];for(let f=0;f<d.size();++f)h.push(Hm(d.get(f)));return h}({...Ji,formats:[...Ji.formats]});var pf=(()=>{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(n={}){var r,o=n,i,a,s=new Promise((_,A)=>{i=_,a=A}),c=typeof window=="object",u=typeof Bun<"u",d=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var h=Object.assign({},o),f="./this.program",p="";function l(_){return o.locateFile?o.locateFile(_,p):p+_}var g,m;if(c||d||u){var y;d?p=self.location.href:typeof document<"u"&&((y=document.currentScript)===null||y===void 0?void 0:y.tagName.toUpperCase())==="SCRIPT"&&(p=document.currentScript.src),e&&(p=e),p.startsWith("blob:")?p="":p=p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),d&&(m=_=>{var A=new XMLHttpRequest;return A.open("GET",_,!1),A.responseType="arraybuffer",A.send(null),new Uint8Array(A.response)}),g=_=>fetch(_,{credentials:"same-origin"}).then(A=>A.ok?A.arrayBuffer():Promise.reject(new Error(A.status+" : "+A.url)))}var w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,h),h=null,o.arguments&&o.arguments,o.thisProgram&&(f=o.thisProgram);var E=o.wasmBinary,C,I=!1,T,P,N,L,V,j,W,q;function k(){var _=C.buffer;o.HEAP8=T=new Int8Array(_),o.HEAP16=N=new Int16Array(_),o.HEAPU8=P=new Uint8Array(_),o.HEAPU16=L=new Uint16Array(_),o.HEAP32=V=new Int32Array(_),o.HEAPU32=j=new Uint32Array(_),o.HEAPF32=W=new Float32Array(_),o.HEAPF64=q=new Float64Array(_)}var U=[],z=[],te=[];function oe(){var _=o.preRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(we)),fe(U)}function ne(){fe(z)}function se(){var _=o.postRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(_e)),fe(te)}function we(_){U.unshift(_)}function le(_){z.unshift(_)}function _e(_){te.unshift(_)}var ve=0,H=null;function $(_){var A;ve++,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve)}function J(_){var A;if(ve--,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve),ve==0&&H){var O=H;H=null,O()}}function S(_){var A;(A=o.onAbort)===null||A===void 0||A.call(o,_),_="Aborted("+_+")",b(_),I=!0,_+=". Build with -sASSERTIONS for more info.";var O=new WebAssembly.RuntimeError(_);throw a(O),O}var M="data:application/octet-stream;base64,",F=_=>_.startsWith(M);function B(){var _="zxing_reader.wasm";return F(_)?_:l(_)}var Q;function Z(_){if(_==Q&&E)return new Uint8Array(E);if(m)return m(_);throw"both async and sync fetching of the wasm failed"}function ee(_){return E?Promise.resolve().then(()=>Z(_)):g(_).then(A=>new Uint8Array(A),()=>Z(_))}function K(_,A,O){return ee(_).then(R=>WebAssembly.instantiate(R,A)).then(O,R=>{b(`failed to asynchronously prepare wasm: ${R}`),S(R)})}function ge(_,A,O,R){return!_&&typeof WebAssembly.instantiateStreaming=="function"&&!F(A)&&typeof fetch=="function"?fetch(A,{credentials:"same-origin"}).then(G=>{var X=WebAssembly.instantiateStreaming(G,O);return X.then(R,function(ae){return b(`wasm streaming compile failed: ${ae}`),b("falling back to ArrayBuffer instantiation"),K(A,O,R)})}):K(A,O,R)}function be(){return{a:NP}}function pe(){var _,A=be();function O(G,X){return jt=G.exports,C=jt.za,k(),Ty=jt.Da,le(jt.Aa),J(),jt}$();function R(G){O(G.instance)}if(o.instantiateWasm)try{return o.instantiateWasm(A,O)}catch(G){b(`Module.instantiateWasm callback failed with error: ${G}`),a(G)}return(_=Q)!==null&&_!==void 0||(Q=B()),ge(E,Q,A,R).catch(a),{}}var fe=_=>{_.forEach(A=>A(o))};o.noExitRuntime;var ye=_=>jy(_),ue=()=>Vy(),Oe=[],ke=0,at=_=>{var A=new ht(_);return A.get_caught()||(A.set_caught(!0),ke--),A.set_rethrown(!1),Oe.push(A),Gy(_),Ly(_)},ze=0,It=()=>{tt(0,0);var _=Oe.pop();Uy(_.excPtr),ze=0};class ht{constructor(A){this.excPtr=A,this.ptr=A-24}set_type(A){j[this.ptr+4>>2]=A}get_type(){return j[this.ptr+4>>2]}set_destructor(A){j[this.ptr+8>>2]=A}get_destructor(){return j[this.ptr+8>>2]}set_caught(A){A=A?1:0,T[this.ptr+12]=A}get_caught(){return T[this.ptr+12]!=0}set_rethrown(A){A=A?1:0,T[this.ptr+13]=A}get_rethrown(){return T[this.ptr+13]!=0}init(A,O){this.set_adjusted_ptr(0),this.set_type(A),this.set_destructor(O)}set_adjusted_ptr(A){j[this.ptr+16>>2]=A}get_adjusted_ptr(){return j[this.ptr+16>>2]}}var wr=_=>{throw ze||(ze=_),ze},pt=_=>Fy(_),mn=_=>{var A=ze;if(!A)return pt(0),0;var O=new ht(A);O.set_adjusted_ptr(A);var R=O.get_type();if(!R)return pt(0),A;for(var G of _){if(G===0||G===R)break;var X=O.ptr+16;if(qy(G,R,X))return pt(G),A}return pt(R),A},Ot=()=>mn([]),De=_=>mn([_]),Pr=(_,A)=>mn([_,A]),ln=()=>{var _=Oe.pop();_||S("no exception to throw");var A=_.excPtr;throw _.get_rethrown()||(Oe.push(_),_.set_rethrown(!0),_.set_caught(!1),ke++),ze=A,ze},Rn=(_,A,O)=>{var R=new ht(_);throw R.init(A,O),ze=_,ke++,ze},Dn=()=>ke,Gr=()=>{S("")},An={},Mn=_=>{for(;_.length;){var A=_.pop(),O=_.pop();O(A)}};function dn(_){return this.fromWireType(j[_>>2])}var Xt={},zn={},qr={},Me,Ge=_=>{throw new Me(_)},qe=(_,A,O)=>{_.forEach(re=>qr[re]=A);function R(re){var me=O(re);me.length!==_.length&&Ge("Mismatched type converter count");for(var Ce=0;Ce<_.length;++Ce)sr(_[Ce],me[Ce])}var G=new Array(A.length),X=[],ae=0;A.forEach((re,me)=>{zn.hasOwnProperty(re)?G[me]=zn[re]:(X.push(re),Xt.hasOwnProperty(re)||(Xt[re]=[]),Xt[re].push(()=>{G[me]=zn[re],++ae,ae===X.length&&R(G)}))}),X.length===0&&R(G)},st=_=>{var A=An[_];delete An[_];var O=A.rawConstructor,R=A.rawDestructor,G=A.fields,X=G.map(ae=>ae.getterReturnType).concat(G.map(ae=>ae.setterArgumentType));qe([_],X,ae=>{var re={};return G.forEach((me,Ce)=>{var Te=me.fieldName,Be=ae[Ce],nt=me.getter,vt=me.getterContext,Rt=ae[Ce+G.length],fn=me.setter,Zt=me.setterContext;re[Te]={read:en=>Be.fromWireType(nt(vt,en)),write:(en,yi)=>{var Ln=[];fn(Zt,en,Rt.toWireType(Ln,yi)),Mn(Ln)}}}),[{name:A.name,fromWireType:me=>{var Ce={};for(var Te in re)Ce[Te]=re[Te].read(me);return R(me),Ce},toWireType:(me,Ce)=>{for(var Te in re)if(!(Te in Ce))throw new TypeError(`Missing field: "${Te}"`);var Be=O();for(Te in re)re[Te].write(Be,Ce[Te]);return me!==null&&me.push(R,Be),Be},argPackAdvance:br,readValueFromPointer:dn,destructorFunction:R}]})},Lt=(_,A,O,R,G)=>{},ca=()=>{for(var _=new Array(256),A=0;A<256;++A)_[A]=String.fromCharCode(A);mi=_},mi,Qt=_=>{for(var A="",O=_;P[O];)A+=mi[P[O++]];return A},ao,ct=_=>{throw new ao(_)};function Yf(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var R=A.name;if(_||ct(`type "${R}" must have a positive integer typeid pointer`),zn.hasOwnProperty(_)){if(O.ignoreDuplicateRegistrations)return;ct(`Cannot register type '${R}' twice`)}if(zn[_]=A,delete qr[_],Xt.hasOwnProperty(_)){var G=Xt[_];delete Xt[_],G.forEach(X=>X())}}function sr(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Yf(_,A,O)}var br=8,Y=(_,A,O,R)=>{A=Qt(A),sr(_,{name:A,fromWireType:function(G){return!!G},toWireType:function(G,X){return X?O:R},argPackAdvance:br,readValueFromPointer:function(G){return this.fromWireType(P[G])},destructorFunction:null})},Ee=_=>({count:_.count,deleteScheduled:_.deleteScheduled,preservePointerOnDelete:_.preservePointerOnDelete,ptr:_.ptr,ptrType:_.ptrType,smartPtr:_.smartPtr,smartPtrType:_.smartPtrType}),xe=_=>{function A(O){return O.$$.ptrType.registeredClass.name}ct(A(_)+" instance already deleted")},Ne=!1,ut=_=>{},At=_=>{_.smartPtr?_.smartPtrType.rawDestructor(_.smartPtr):_.ptrType.registeredClass.rawDestructor(_.ptr)},Ze=_=>{_.count.value-=1;var A=_.count.value===0;A&&At(_)},Xe=(_,A,O)=>{if(A===O)return _;if(O.baseClass===void 0)return null;var R=Xe(_,A,O.baseClass);return R===null?null:O.downcast(R)},yn={},Ft={},Gt=(_,A)=>{for(A===void 0&&ct("ptr should not be undefined");_.baseClass;)A=_.upcast(A),_=_.baseClass;return A},Xn=(_,A)=>(A=Gt(_,A),Ft[A]),kr=(_,A)=>{(!A.ptrType||!A.ptr)&&Ge("makeClassHandle requires ptr and ptrType");var O=!!A.smartPtrType,R=!!A.smartPtr;return O!==R&&Ge("Both smartPtrType and smartPtr must be specified"),A.count={value:1},Jt(Object.create(_,{$$:{value:A,writable:!0}}))};function so(_){var A=this.getPointee(_);if(!A)return this.destructor(_),null;var O=Xn(this.registeredClass,A);if(O!==void 0){if(O.$$.count.value===0)return O.$$.ptr=A,O.$$.smartPtr=_,O.clone();var R=O.clone();return this.destructor(_),R}function G(){return this.isSmartPointer?kr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:A,smartPtrType:this,smartPtr:_}):kr(this.registeredClass.instancePrototype,{ptrType:this,ptr:_})}var X=this.registeredClass.getActualType(A),ae=yn[X];if(!ae)return G.call(this);var re;this.isConst?re=ae.constPointerType:re=ae.pointerType;var me=Xe(A,this.registeredClass,re.registeredClass);return me===null?G.call(this):this.isSmartPointer?kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me,smartPtrType:this,smartPtr:_}):kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me})}var Jt=_=>typeof FinalizationRegistry>"u"?(Jt=A=>A,_):(Ne=new FinalizationRegistry(A=>{Ze(A.$$)}),Jt=A=>{var O=A.$$,R=!!O.smartPtr;if(R){var G={$$:O};Ne.register(A,G,A)}return A},ut=A=>Ne.unregister(A),Jt(_)),Vo=[],Wf=()=>{for(;Vo.length;){var _=Vo.pop();_.$$.deleteScheduled=!1,_.delete()}},xu,pO=()=>{Object.assign(Ou.prototype,{isAliasOf(_){if(!(this instanceof Ou)||!(_ instanceof Ou))return!1;var A=this.$$.ptrType.registeredClass,O=this.$$.ptr;_.$$=_.$$;for(var R=_.$$.ptrType.registeredClass,G=_.$$.ptr;A.baseClass;)O=A.upcast(O),A=A.baseClass;for(;R.baseClass;)G=R.upcast(G),R=R.baseClass;return A===R&&O===G},clone(){if(this.$$.ptr||xe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var _=Jt(Object.create(Object.getPrototypeOf(this),{$$:{value:Ee(this.$$)}}));return _.$$.count.value+=1,_.$$.deleteScheduled=!1,_},delete(){this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),ut(this),Ze(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),Vo.push(this),Vo.length===1&&xu&&xu(Wf),this.$$.deleteScheduled=!0,this}})};function Ou(){}var Ss=(_,A)=>Object.defineProperty(A,"name",{value:_}),Sy=(_,A,O)=>{if(_[A].overloadTable===void 0){var R=_[A];_[A]=function(){for(var G=arguments.length,X=new Array(G),ae=0;ae<G;ae++)X[ae]=arguments[ae];return _[A].overloadTable.hasOwnProperty(X.length)||ct(`Function '${O}' called with an invalid number of arguments (${X.length}) - expects one of (${_[A].overloadTable})!`),_[A].overloadTable[X.length].apply(this,X)},_[A].overloadTable=[],_[A].overloadTable[R.argCount]=R}},Kf=(_,A,O)=>{o.hasOwnProperty(_)?((O===void 0||o[_].overloadTable!==void 0&&o[_].overloadTable[O]!==void 0)&&ct(`Cannot register public name '${_}' twice`),Sy(o,_,_),o.hasOwnProperty(O)&&ct(`Cannot register multiple overloads of a function with the same number of arguments (${O})!`),o[_].overloadTable[O]=A):(o[_]=A,O!==void 0&&(o[_].numArguments=O))},gO=48,mO=57,yO=_=>{_=_.replace(/[^a-zA-Z0-9_]/g,"$");var A=_.charCodeAt(0);return A>=gO&&A<=mO?`_${_}`:_};function vO(_,A,O,R,G,X,ae,re){this.name=_,this.constructor=A,this.instancePrototype=O,this.rawDestructor=R,this.baseClass=G,this.getActualType=X,this.upcast=ae,this.downcast=re,this.pureVirtualFunctions=[]}var zf=(_,A,O)=>{for(;A!==O;)A.upcast||ct(`Expected null or instance of ${O.name}, got an instance of ${A.name}`),_=A.upcast(_),A=A.baseClass;return _};function wO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}function bO(_,A){var O;if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),this.isSmartPointer?(O=this.rawConstructor(),_!==null&&_.push(this.rawDestructor,O),O):0;(!A||!A.$$)&&ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);var R=A.$$.ptrType.registeredClass;if(O=zf(A.$$.ptr,R,this.registeredClass),this.isSmartPointer)switch(A.$$.smartPtr===void 0&&ct("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:A.$$.smartPtrType===this?O=A.$$.smartPtr:ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:O=A.$$.smartPtr;break;case 2:if(A.$$.smartPtrType===this)O=A.$$.smartPtr;else{var G=A.clone();O=this.rawShare(O,uo.toHandle(()=>G.delete())),_!==null&&_.push(this.rawDestructor,O)}break;default:ct("Unsupporting sharing policy")}return O}function EO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.ptrType.name} to parameter type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}var CO=()=>{Object.assign(Pu.prototype,{getPointee(_){return this.rawGetPointee&&(_=this.rawGetPointee(_)),_},destructor(_){var A;(A=this.rawDestructor)===null||A===void 0||A.call(this,_)},argPackAdvance:br,readValueFromPointer:dn,fromWireType:so})};function Pu(_,A,O,R,G,X,ae,re,me,Ce,Te){this.name=_,this.registeredClass=A,this.isReference=O,this.isConst=R,this.isSmartPointer=G,this.pointeeType=X,this.sharingPolicy=ae,this.rawGetPointee=re,this.rawConstructor=me,this.rawShare=Ce,this.rawDestructor=Te,!G&&A.baseClass===void 0?R?(this.toWireType=wO,this.destructorFunction=null):(this.toWireType=EO,this.destructorFunction=null):this.toWireType=bO}var Iy=(_,A,O)=>{o.hasOwnProperty(_)||Ge("Replacing nonexistent public symbol"),o[_].overloadTable!==void 0&&O!==void 0?o[_].overloadTable[O]=A:(o[_]=A,o[_].argCount=O)},_O=(_,A,O)=>{_=_.replace(/p/g,"i");var R=o["dynCall_"+_];return R(A,...O)},ku=[],Ty,ot=_=>{var A=ku[_];return A||(_>=ku.length&&(ku.length=_+1),ku[_]=A=Ty.get(_)),A},AO=function(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(_.includes("j"))return _O(_,A,O);var R=ot(A)(...O);return R},SO=(_,A)=>function(){for(var O=arguments.length,R=new Array(O),G=0;G<O;G++)R[G]=arguments[G];return AO(_,A,R)},Br=(_,A)=>{_=Qt(_);function O(){return _.includes("j")?SO(_,A):ot(A)}var R=O();return typeof R!="function"&&ct(`unknown function pointer with signature ${_}: ${A}`),R},IO=(_,A)=>{var O=Ss(A,function(R){this.name=A,this.message=R;var G=new Error(R).stack;G!==void 0&&(this.stack=this.toString()+`
136
+ `+G.replace(/^Error(:[^\n]*)?\n/,""))});return O.prototype=Object.create(_.prototype),O.prototype.constructor=O,O.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},O},xy,Oy=_=>{var A=My(_),O=Qt(A);return lo(A),O},Bu=(_,A)=>{var O=[],R={};function G(X){if(!R[X]&&!zn[X]){if(qr[X]){qr[X].forEach(G);return}O.push(X),R[X]=!0}}throw A.forEach(G),new xy(`${_}: `+O.map(Oy).join([", "]))},TO=(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,nt)=>{Te=Qt(Te),X=Br(G,X),re&&(re=Br(ae,re)),Ce&&(Ce=Br(me,Ce)),nt=Br(Be,nt);var vt=yO(Te);Kf(vt,function(){Bu(`Cannot construct ${Te} due to unbound types`,[R])}),qe([_,A,O],R?[R]:[],Rt=>{Rt=Rt[0];var fn,Zt;R?(fn=Rt.registeredClass,Zt=fn.instancePrototype):Zt=Ou.prototype;var en=Ss(Te,function(){if(Object.getPrototypeOf(this)!==yi)throw new ao("Use 'new' to construct "+Te);if(Ln.constructor_body===void 0)throw new ao(Te+" has no accessible constructor");for(var Xy=arguments.length,Du=new Array(Xy),Mu=0;Mu<Xy;Mu++)Du[Mu]=arguments[Mu];var Qy=Ln.constructor_body[Du.length];if(Qy===void 0)throw new ao(`Tried to invoke ctor of ${Te} with invalid number of parameters (${Du.length}) - expected (${Object.keys(Ln.constructor_body).toString()}) parameters instead!`);return Qy.apply(this,Du)}),yi=Object.create(Zt,{constructor:{value:en}});en.prototype=yi;var Ln=new vO(Te,en,yi,nt,fn,X,re,Ce);if(Ln.baseClass){var fo,Ru;(Ru=(fo=Ln.baseClass).__derivedClasses)!==null&&Ru!==void 0||(fo.__derivedClasses=[]),Ln.baseClass.__derivedClasses.push(Ln)}var pk=new Pu(Te,Ln,!0,!1,!1),Ky=new Pu(Te+"*",Ln,!1,!1,!1),zy=new Pu(Te+" const*",Ln,!1,!0,!1);return yn[_]={pointerType:Ky,constPointerType:zy},Iy(vt,en),[pk,Ky,zy]})},Xf=(_,A)=>{for(var O=[],R=0;R<_;R++)O.push(j[A+R*4>>2]);return O};function xO(_){for(var A=1;A<_.length;++A)if(_[A]!==null&&_[A].destructorFunction===void 0)return!0;return!1}function Qf(_,A,O,R,G,X){var ae=A.length;ae<2&&ct("argTypes array size mismatch! Must at least get return value and 'this' types!");var re=A[1]!==null&&O!==null,me=xO(A),Ce=A[0].name!=="void",Te=ae-2,Be=new Array(Te),nt=[],vt=[],Rt=function(){vt.length=0;var fn;nt.length=re?2:1,nt[0]=G,re&&(fn=A[1].toWireType(vt,this),nt[1]=fn);for(var Zt=0;Zt<Te;++Zt)Be[Zt]=A[Zt+2].toWireType(vt,Zt<0||arguments.length<=Zt?void 0:arguments[Zt]),nt.push(Be[Zt]);var en=R(...nt);function yi(Ln){if(me)Mn(vt);else for(var fo=re?1:2;fo<A.length;fo++){var Ru=fo===1?fn:Be[fo-2];A[fo].destructorFunction!==null&&A[fo].destructorFunction(Ru)}if(Ce)return A[0].fromWireType(Ln)}return yi(en)};return Ss(_,Rt)}var OO=(_,A,O,R,G,X)=>{var ae=Xf(A,O);G=Br(R,G),qe([],[_],re=>{re=re[0];var me=`constructor ${re.name}`;if(re.registeredClass.constructor_body===void 0&&(re.registeredClass.constructor_body=[]),re.registeredClass.constructor_body[A-1]!==void 0)throw new ao(`Cannot register multiple constructors with identical number of parameters (${A-1}) for class '${re.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return re.registeredClass.constructor_body[A-1]=()=>{Bu(`Cannot construct ${re.name} due to unbound types`,ae)},qe([],ae,Ce=>(Ce.splice(1,0,null),re.registeredClass.constructor_body[A-1]=Qf(me,Ce,null,G,X),[])),[]})},Py=_=>{_=_.trim();const A=_.indexOf("(");return A!==-1?_.substr(0,A):_},PO=(_,A,O,R,G,X,ae,re,me,Ce)=>{var Te=Xf(O,R);A=Qt(A),A=Py(A),X=Br(G,X),qe([],[_],Be=>{Be=Be[0];var nt=`${Be.name}.${A}`;A.startsWith("@@")&&(A=Symbol[A.substring(2)]),re&&Be.registeredClass.pureVirtualFunctions.push(A);function vt(){Bu(`Cannot call ${nt} due to unbound types`,Te)}var Rt=Be.registeredClass.instancePrototype,fn=Rt[A];return fn===void 0||fn.overloadTable===void 0&&fn.className!==Be.name&&fn.argCount===O-2?(vt.argCount=O-2,vt.className=Be.name,Rt[A]=vt):(Sy(Rt,A,nt),Rt[A].overloadTable[O-2]=vt),qe([],Te,Zt=>{var en=Qf(nt,Zt,Be,X,ae);return Rt[A].overloadTable===void 0?(en.argCount=O-2,Rt[A]=en):Rt[A].overloadTable[O-2]=en,[]}),[]})},Jf=[],co=[],Zf=_=>{_>9&&--co[_+1]===0&&(co[_]=void 0,Jf.push(_))},kO=()=>co.length/2-5-Jf.length,BO=()=>{co.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=kO},uo={toValue:_=>(_||ct("Cannot use deleted val. handle = "+_),co[_]),toHandle:_=>{switch(_){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const A=Jf.pop()||co.length;return co[A]=_,co[A+1]=1,A}}}},ky={name:"emscripten::val",fromWireType:_=>{var A=uo.toValue(_);return Zf(_),A},toWireType:(_,A)=>uo.toHandle(A),argPackAdvance:br,readValueFromPointer:dn,destructorFunction:null},NO=_=>sr(_,ky),RO=(_,A,O)=>{switch(A){case 1:return O?function(R){return this.fromWireType(T[R])}:function(R){return this.fromWireType(P[R])};case 2:return O?function(R){return this.fromWireType(N[R>>1])}:function(R){return this.fromWireType(L[R>>1])};case 4:return O?function(R){return this.fromWireType(V[R>>2])}:function(R){return this.fromWireType(j[R>>2])};default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},DO=(_,A,O,R)=>{A=Qt(A);function G(){}G.values={},sr(_,{name:A,constructor:G,fromWireType:function(X){return this.constructor.values[X]},toWireType:(X,ae)=>ae.value,argPackAdvance:br,readValueFromPointer:RO(A,O,R),destructorFunction:null}),Kf(A,G)},eh=(_,A)=>{var O=zn[_];return O===void 0&&ct(`${A} has unknown type ${Oy(_)}`),O},MO=(_,A,O)=>{var R=eh(_,"enum");A=Qt(A);var G=R.constructor,X=Object.create(R.constructor.prototype,{value:{value:O},constructor:{value:Ss(`${R.name}_${A}`,function(){})}});G.values[O]=X,G[A]=X},th=_=>{if(_===null)return"null";var A=typeof _;return A==="object"||A==="array"||A==="function"?_.toString():""+_},LO=(_,A)=>{switch(A){case 4:return function(O){return this.fromWireType(W[O>>2])};case 8:return function(O){return this.fromWireType(q[O>>3])};default:throw new TypeError(`invalid float width (${A}): ${_}`)}},FO=(_,A,O)=>{A=Qt(A),sr(_,{name:A,fromWireType:R=>R,toWireType:(R,G)=>G,argPackAdvance:br,readValueFromPointer:LO(A,O),destructorFunction:null})},jO=(_,A,O,R,G,X,ae,re)=>{var me=Xf(A,O);_=Qt(_),_=Py(_),G=Br(R,G),Kf(_,function(){Bu(`Cannot call ${_} due to unbound types`,me)},A-1),qe([],me,Ce=>{var Te=[Ce[0],null].concat(Ce.slice(1));return Iy(_,Qf(_,Te,null,G,X),A-1),[]})},VO=(_,A,O)=>{switch(A){case 1:return O?R=>T[R]:R=>P[R];case 2:return O?R=>N[R>>1]:R=>L[R>>1];case 4:return O?R=>V[R>>2]:R=>j[R>>2];default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},UO=(_,A,O,R,G)=>{A=Qt(A);var X=Te=>Te;if(R===0){var ae=32-8*O;X=Te=>Te<<ae>>>ae}var re=A.includes("unsigned"),me=(Te,Be)=>{},Ce;re?Ce=function(Te,Be){return me(Be,this.name),Be>>>0}:Ce=function(Te,Be){return me(Be,this.name),Be},sr(_,{name:A,fromWireType:X,toWireType:Ce,argPackAdvance:br,readValueFromPointer:VO(A,O,R!==0),destructorFunction:null})},GO=(_,A,O)=>{var R=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=R[A];function X(ae){var re=j[ae>>2],me=j[ae+4>>2];return new G(T.buffer,me,re)}O=Qt(O),sr(_,{name:O,fromWireType:X,argPackAdvance:br,readValueFromPointer:X},{ignoreDuplicateRegistrations:!0})},qO=Object.assign({optional:!0},ky),HO=(_,A)=>{sr(_,qO)},$O=(_,A,O,R)=>{if(!(R>0))return 0;for(var G=O,X=O+R-1,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(re<=127){if(O>=X)break;A[O++]=re}else if(re<=2047){if(O+1>=X)break;A[O++]=192|re>>6,A[O++]=128|re&63}else if(re<=65535){if(O+2>=X)break;A[O++]=224|re>>12,A[O++]=128|re>>6&63,A[O++]=128|re&63}else{if(O+3>=X)break;A[O++]=240|re>>18,A[O++]=128|re>>12&63,A[O++]=128|re>>6&63,A[O++]=128|re&63}}return A[O]=0,O-G},Is=(_,A,O)=>$O(_,P,A,O),YO=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R<=127?A++:R<=2047?A+=2:R>=55296&&R<=57343?(A+=4,++O):A+=3}return A},By=typeof TextDecoder<"u"?new TextDecoder:void 0,Ny=function(_){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var R=A+O,G=A;_[G]&&!(G>=R);)++G;if(G-A>16&&_.buffer&&By)return By.decode(_.subarray(A,G));for(var X="";A<G;){var ae=_[A++];if(!(ae&128)){X+=String.fromCharCode(ae);continue}var re=_[A++]&63;if((ae&224)==192){X+=String.fromCharCode((ae&31)<<6|re);continue}var me=_[A++]&63;if((ae&240)==224?ae=(ae&15)<<12|re<<6|me:ae=(ae&7)<<18|re<<12|me<<6|_[A++]&63,ae<65536)X+=String.fromCharCode(ae);else{var Ce=ae-65536;X+=String.fromCharCode(55296|Ce>>10,56320|Ce&1023)}}return X},WO=(_,A)=>_?Ny(P,_,A):"",KO=(_,A)=>{A=Qt(A);var O=A==="std::string";sr(_,{name:A,fromWireType(R){var G=j[R>>2],X=R+4,ae;if(O)for(var re=X,me=0;me<=G;++me){var Ce=X+me;if(me==G||P[Ce]==0){var Te=Ce-re,Be=WO(re,Te);ae===void 0?ae=Be:(ae+="\0",ae+=Be),re=Ce+1}}else{for(var nt=new Array(G),me=0;me<G;++me)nt[me]=String.fromCharCode(P[X+me]);ae=nt.join("")}return lo(R),ae},toWireType(R,G){G instanceof ArrayBuffer&&(G=new Uint8Array(G));var X,ae=typeof G=="string";ae||G instanceof Uint8Array||G instanceof Uint8ClampedArray||G instanceof Int8Array||ct("Cannot pass non-string to std::string"),O&&ae?X=YO(G):X=G.length;var re=oh(4+X+1),me=re+4;if(j[re>>2]=X,O&&ae)Is(G,me,X+1);else if(ae)for(var Ce=0;Ce<X;++Ce){var Te=G.charCodeAt(Ce);Te>255&&(lo(me),ct("String has UTF-16 code units that do not fit in 8 bits")),P[me+Ce]=Te}else for(var Ce=0;Ce<X;++Ce)P[me+Ce]=G[Ce];return R!==null&&R.push(lo,re),re},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(R){lo(R)}})},Ry=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,zO=(_,A)=>{for(var O=_,R=O>>1,G=R+A/2;!(R>=G)&&L[R];)++R;if(O=R<<1,O-_>32&&Ry)return Ry.decode(P.subarray(_,O));for(var X="",ae=0;!(ae>=A/2);++ae){var re=N[_+ae*2>>1];if(re==0)break;X+=String.fromCharCode(re)}return X},XO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<2)return 0;O-=2;for(var G=A,X=O<_.length*2?O/2:_.length,ae=0;ae<X;++ae){var re=_.charCodeAt(ae);N[A>>1]=re,A+=2}return N[A>>1]=0,A-G},QO=_=>_.length*2,JO=(_,A)=>{for(var O=0,R="";!(O>=A/4);){var G=V[_+O*4>>2];if(G==0)break;if(++O,G>=65536){var X=G-65536;R+=String.fromCharCode(55296|X>>10,56320|X&1023)}else R+=String.fromCharCode(G)}return R},ZO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<4)return 0;for(var G=A,X=G+O-4,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(V[A>>2]=re,A+=4,A+4>X)break}return V[A>>2]=0,A-G},eP=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R>=55296&&R<=57343&&++O,A+=4}return A},tP=(_,A,O)=>{O=Qt(O);var R,G,X,ae;A===2?(R=zO,G=XO,ae=QO,X=re=>L[re>>1]):A===4&&(R=JO,G=ZO,ae=eP,X=re=>j[re>>2]),sr(_,{name:O,fromWireType:re=>{for(var me=j[re>>2],Ce,Te=re+4,Be=0;Be<=me;++Be){var nt=re+4+Be*A;if(Be==me||X(nt)==0){var vt=nt-Te,Rt=R(Te,vt);Ce===void 0?Ce=Rt:(Ce+="\0",Ce+=Rt),Te=nt+A}}return lo(re),Ce},toWireType:(re,me)=>{typeof me!="string"&&ct(`Cannot pass non-string to C++ string type ${O}`);var Ce=ae(me),Te=oh(4+Ce+A);return j[Te>>2]=Ce/A,G(me,Te+4,Ce+A),re!==null&&re.push(lo,Te),Te},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(re){lo(re)}})},nP=(_,A,O,R,G,X)=>{An[_]={name:Qt(A),rawConstructor:Br(O,R),rawDestructor:Br(G,X),fields:[]}},rP=(_,A,O,R,G,X,ae,re,me,Ce)=>{An[_].fields.push({fieldName:Qt(A),getterReturnType:O,getter:Br(R,G),getterContext:X,setterArgumentType:ae,setter:Br(re,me),setterContext:Ce})},oP=(_,A)=>{A=Qt(A),sr(_,{isVoid:!0,name:A,argPackAdvance:0,fromWireType:()=>{},toWireType:(O,R)=>{}})},iP=(_,A,O)=>P.copyWithin(_,A,A+O),nh=[],aP=(_,A,O,R)=>(_=nh[_],A=uo.toValue(A),_(null,A,O,R)),sP={},cP=_=>{var A=sP[_];return A===void 0?Qt(_):A},Dy=()=>{if(typeof globalThis=="object")return globalThis;function _(A){A.$$$embind_global$$$=A;var O=typeof $$$embind_global$$$=="object"&&A.$$$embind_global$$$==A;return O||delete A.$$$embind_global$$$,O}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&_(global)?$$$embind_global$$$=global:typeof self=="object"&&_(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},uP=_=>_===0?uo.toHandle(Dy()):(_=cP(_),uo.toHandle(Dy()[_])),lP=_=>{var A=nh.length;return nh.push(_),A},dP=(_,A)=>{for(var O=new Array(_),R=0;R<_;++R)O[R]=eh(j[A+R*4>>2],"parameter "+R);return O},fP=Reflect.construct,hP=(_,A,O)=>{var R=[],G=_.toWireType(R,O);return R.length&&(j[A>>2]=uo.toHandle(R)),G},pP=(_,A,O)=>{var R=dP(_,A),G=R.shift();_--;var X=new Array(_),ae=(me,Ce,Te,Be)=>{for(var nt=0,vt=0;vt<_;++vt)X[vt]=R[vt].readValueFromPointer(Be+nt),nt+=R[vt].argPackAdvance;var Rt=O===1?fP(Ce,X):Ce.apply(me,X);return hP(G,Te,Rt)},re=`methodCaller<(${R.map(me=>me.name).join(", ")}) => ${G.name}>`;return lP(Ss(re,ae))},gP=_=>{_>9&&(co[_+1]+=1)},mP=_=>{var A=uo.toValue(_);Mn(A),Zf(_)},yP=(_,A)=>{_=eh(_,"_emval_take_value");var O=_.readValueFromPointer(A);return uo.toHandle(O)},vP=(_,A,O,R)=>{var G=new Date().getFullYear(),X=new Date(G,0,1),ae=new Date(G,6,1),re=X.getTimezoneOffset(),me=ae.getTimezoneOffset(),Ce=Math.max(re,me);j[_>>2]=Ce*60,V[A>>2]=+(re!=me);var Te=vt=>{var Rt=vt>=0?"-":"+",fn=Math.abs(vt),Zt=String(Math.floor(fn/60)).padStart(2,"0"),en=String(fn%60).padStart(2,"0");return`UTC${Rt}${Zt}${en}`},Be=Te(re),nt=Te(me);me<re?(Is(Be,O,17),Is(nt,R,17)):(Is(Be,R,17),Is(nt,O,17))},wP=()=>2147483648,bP=(_,A)=>Math.ceil(_/A)*A,EP=_=>{var A=C.buffer,O=(_-A.byteLength+65535)/65536|0;try{return C.grow(O),k(),1}catch{}},CP=_=>{var A=P.length;_>>>=0;var O=wP();if(_>O)return!1;for(var R=1;R<=4;R*=2){var G=A*(1+.2/R);G=Math.min(G,_+100663296);var X=Math.min(O,bP(Math.max(_,G),65536)),ae=EP(X);if(ae)return!0}return!1},rh={},_P=()=>f||"./this.program",Ts=()=>{if(!Ts.strings){var _=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:_,_:_P()};for(var O in rh)rh[O]===void 0?delete A[O]:A[O]=rh[O];var R=[];for(var O in A)R.push(`${O}=${A[O]}`);Ts.strings=R}return Ts.strings},AP=(_,A)=>{for(var O=0;O<_.length;++O)T[A++]=_.charCodeAt(O);T[A]=0},SP=(_,A)=>{var O=0;return Ts().forEach((R,G)=>{var X=A+O;j[_+G*4>>2]=X,AP(R,X),O+=R.length+1}),0},IP=(_,A)=>{var O=Ts();j[_>>2]=O.length;var R=0;return O.forEach(G=>R+=G.length+1),j[A>>2]=R,0},TP=_=>52;function xP(_,A,O,R,G){return 70}var OP=[null,[],[]],PP=(_,A)=>{var O=OP[_];A===0||A===10?((_===1?w:b)(Ny(O)),O.length=0):O.push(A)},kP=(_,A,O,R)=>{for(var G=0,X=0;X<O;X++){var ae=j[A>>2],re=j[A+4>>2];A+=8;for(var me=0;me<re;me++)PP(_,P[ae+me]);G+=re}return j[R>>2]=G,0},BP=_=>_;Me=o.InternalError=class extends Error{constructor(_){super(_),this.name="InternalError"}},ca(),ao=o.BindingError=class extends Error{constructor(_){super(_),this.name="BindingError"}},pO(),CO(),xy=o.UnboundTypeError=IO(Error,"UnboundTypeError"),BO();var NP={t:at,x:It,a:Ot,j:De,k:Pr,O:ln,q:Rn,ga:Dn,d:wr,ca:Gr,va:st,ba:Lt,pa:Y,ta:TO,sa:OO,E:PO,oa:NO,F:DO,n:MO,W:FO,X:jO,y:UO,u:GO,ua:HO,V:KO,P:tP,L:nP,wa:rP,qa:oP,ja:iP,T:aP,xa:Zf,ya:uP,U:pP,Y:gP,Z:mP,ra:yP,da:vP,ha:CP,ea:SP,fa:IP,ia:TP,$:xP,S:kP,J:ek,C:nk,Q:FP,R:uk,r:XP,b:RP,D:ZP,la:ok,c:VP,ka:ik,h:LP,i:HP,s:$P,N:JP,w:WP,I:sk,K:QP,z:rk,H:lk,aa:fk,_:hk,l:UP,f:jP,e:MP,g:DP,M:ck,m:qP,ma:tk,p:YP,v:KP,na:zP,B:ak,o:GP,G:dk,A:BP},jt=pe(),My=_=>(My=jt.Ba)(_),lo=o._free=_=>(lo=o._free=jt.Ca)(_),oh=o._malloc=_=>(oh=o._malloc=jt.Ea)(_),Ly=_=>(Ly=jt.Fa)(_),tt=(_,A)=>(tt=jt.Ga)(_,A),Fy=_=>(Fy=jt.Ha)(_),jy=_=>(jy=jt.Ia)(_),Vy=()=>(Vy=jt.Ja)(),Uy=_=>(Uy=jt.Ka)(_),Gy=_=>(Gy=jt.La)(_),qy=(_,A,O)=>(qy=jt.Ma)(_,A,O);o.dynCall_viijii=(_,A,O,R,G,X,ae)=>(o.dynCall_viijii=jt.Na)(_,A,O,R,G,X,ae);var Hy=o.dynCall_jiii=(_,A,O,R)=>(Hy=o.dynCall_jiii=jt.Oa)(_,A,O,R);o.dynCall_jiji=(_,A,O,R,G)=>(o.dynCall_jiji=jt.Pa)(_,A,O,R,G);var $y=o.dynCall_jiiii=(_,A,O,R,G)=>($y=o.dynCall_jiiii=jt.Qa)(_,A,O,R,G);o.dynCall_iiiiij=(_,A,O,R,G,X,ae)=>(o.dynCall_iiiiij=jt.Ra)(_,A,O,R,G,X,ae),o.dynCall_iiiiijj=(_,A,O,R,G,X,ae,re,me)=>(o.dynCall_iiiiijj=jt.Sa)(_,A,O,R,G,X,ae,re,me),o.dynCall_iiiiiijj=(_,A,O,R,G,X,ae,re,me,Ce)=>(o.dynCall_iiiiiijj=jt.Ta)(_,A,O,R,G,X,ae,re,me,Ce);function RP(_,A){var O=ue();try{return ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;tt(1,0)}}function DP(_,A,O,R){var G=ue();try{ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function MP(_,A,O){var R=ue();try{ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;tt(1,0)}}function LP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function FP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function jP(_,A){var O=ue();try{ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;tt(1,0)}}function VP(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;tt(1,0)}}function UP(_){var A=ue();try{ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;tt(1,0)}}function GP(_,A,O,R,G,X,ae,re,me,Ce,Te){var Be=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te)}catch(nt){if(ye(Be),nt!==nt+0)throw nt;tt(1,0)}}function qP(_,A,O,R,G){var X=ue();try{ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function HP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function $P(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;tt(1,0)}}function YP(_,A,O,R,G,X){var ae=ue();try{ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;tt(1,0)}}function WP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;tt(1,0)}}function KP(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;tt(1,0)}}function zP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;tt(1,0)}}function XP(_){var A=ue();try{return ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;tt(1,0)}}function QP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{return ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;tt(1,0)}}function JP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;tt(1,0)}}function ZP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function ek(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function tk(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;tt(1,0)}}function nk(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;tt(1,0)}}function rk(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;tt(1,0)}}function ok(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;tt(1,0)}}function ik(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function ak(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;tt(1,0)}}function sk(_,A,O,R,G,X,ae,re){var me=ue();try{return ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;tt(1,0)}}function ck(_,A,O,R,G,X,ae){var re=ue();try{ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;tt(1,0)}}function uk(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function lk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be){var nt=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be)}catch(vt){if(ye(nt),vt!==vt+0)throw vt;tt(1,0)}}function dk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,nt,vt,Rt,fn){var Zt=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be,nt,vt,Rt,fn)}catch(en){if(ye(Zt),en!==en+0)throw en;tt(1,0)}}function fk(_,A,O,R){var G=ue();try{return Hy(_,A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function hk(_,A,O,R,G){var X=ue();try{return $y(_,A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}var Nu,Yy;H=function _(){Nu||Wy(),Nu||(H=_)};function Wy(){if(ve>0||!Yy&&(Yy=1,oe(),ve>0))return;function _(){var A;Nu||(Nu=1,o.calledRun=1,!I&&(ne(),i(o),(A=o.onRuntimeInitialized)===null||A===void 0||A.call(o),se()))}o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),_()},1)):_()}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Wy(),r=s,r}})();function D7(t){return hf(pf,t)}async function M7(t,e){return N7(pf,t,e)}async function L7(t,e){return R7(pf,t,e)}const Ym=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],F7=[...Ym,["unknown"]].map(t=>t[0]),gf=new Map(Ym);function j7(t){for(const[e,n]of gf)if(t===n)return e;return"unknown"}function V7(t){if(Wm(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Km(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(zm(t))return{width:t.videoWidth,height:t.videoHeight};if(Qm(t))return{width:t.width,height:t.height};if(Zm(t))return{width:t.displayWidth,height:t.displayHeight};if(Xm(t))return{width:t.width,height:t.height};if(Jm(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Wm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLImageElement)}catch{return!1}}function Km(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.SVGImageElement)}catch{return!1}}function zm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLVideoElement)}catch{return!1}}function Xm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLCanvasElement)}catch{return!1}}function Qm(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function Jm(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function Zm(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function e2(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function U7(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function G7(t,e){try{const n=new OffscreenCanvas(t,e);if(n.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{const n=document.createElement("canvas");return n.width=t,n.height=e,n}}async function t2(t){if(Wm(t)&&!await Y7(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Km(t)&&!await W7(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Zm(t)&&K7(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(zm(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Qm(t)&&X7(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:n}=V7(t);if(e===0||n===0)return null;const r=G7(e,n).getContext("2d");r.drawImage(t,0,0);try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function q7(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let n="";try{n=URL.createObjectURL(t),e.src=n,await e.decode()}finally{URL.revokeObjectURL(n)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await t2(e)}function H7(t){const{width:e,height:n}=t;if(e===0||n===0)return null;const r=t.getContext("2d");try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function $7(t){if(e2(t))return await q7(t);if(U7(t)){if(z7(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return Xm(t)||Jm(t)?H7(t):await t2(t)}async function Y7(t){try{return await t.decode(),!0}catch{return!1}}async function W7(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function K7(t){return t.format===null}function z7(t){return t.data.buffer.byteLength===0}function X7(t){return t.width===0&&t.height===0}function n2(t,e){return Q7(t)?new DOMException(`${e}: ${t.message}`,t.name):J7(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function Q7(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function J7(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var ru;let mf=class extends EventTarget{constructor(e={}){var n;super(),C7(this,ru);try{const r=(n=e==null?void 0:e.formats)==null?void 0:n.filter(o=>o!=="unknown");if((r==null?void 0:r.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const o of r??[])if(!gf.has(o))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${o}' is not a valid enum value of type BarcodeFormat.`);_7(this,ru,r??[]),D7().then(o=>{this.dispatchEvent(new CustomEvent("load",{detail:o}))}).catch(o=>{this.dispatchEvent(new CustomEvent("error",{detail:o}))})}catch(r){throw n2(r,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return F7.filter(e=>e!=="unknown")}async detect(e){try{const n=await $7(e);if(n===null)return[];let r;const o={tryHarder:!0,returnCodabarStartEnd:!0,formats:E7(this,ru).map(i=>gf.get(i))};try{e2(n)?r=await M7(n,o):r=await L7(n,o)}catch(i){throw console.error(i),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return r.map(i=>{const{topLeft:{x:a,y:s},topRight:{x:c,y:u},bottomLeft:{x:d,y:h},bottomRight:{x:f,y:p}}=i.position,l=Math.min(a,c,d,f),g=Math.min(s,u,h,p),m=Math.max(a,c,d,f),y=Math.max(s,u,h,p);return{boundingBox:new DOMRectReadOnly(l,g,m-l,y-g),rawValue:i.text,format:j7(i.format),cornerPoints:[{x:a,y:s},{x:c,y:u},{x:f,y:p},{x:d,y:h}]}})}catch(n){throw n2(n,"Failed to execute 'detect' on 'BarcodeDetector'")}}};ru=new WeakMap,globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=mf);function Z7(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function eS(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),x.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function tS(t){const{scanning:e,startScanning:n,stopScanning:r}=t,[o,i]=x.useState(!1);function a(){i(!0),e?r():n(),setTimeout(()=>i(!1),1e3)}return x.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:o?"default":"pointer"}},e?x.createElement(Z7,{disabled:o,onClick:a}):x.createElement(eS,{disabled:o,onClick:a}))}function nS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function rS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function oS(t){const{status:e,scanning:n,torchToggle:r}=t;function o(i){r(i)}return n&&r?x.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?x.createElement(rS,{onClick:()=>o(!1)}):x.createElement(nS,{onClick:()=>o(!0)})):null}function iS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function aS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function sS(t){const{scanning:e,capabilities:n,onZoom:r,value:o}=t;if(!e||!r)return null;const i=(n.max-n.min)/3;return x.createElement(x.Fragment,null,x.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(aS,{disabled:o<=n.min,onClick:function(){r(Math.max(o-i,n.min))}})),x.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(iS,{disabled:o>=n.max,onClick:function(){r(Math.min(o+i,n.max))}})))}function cS(t){const{scanning:e,loading:n,capabilities:r,border:o=35,onOff:i,torch:a,zoom:s,startScanning:c,stopScanning:u}=t,d="rgba(255, 0, 0, 0.5)";return x.createElement("div",{style:{position:"relative"}},x.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${o>=35?o:35}px solid rgba(0, 0, 0, 0.2)`}},n&&x.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",x.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),x.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:d,strokeWidth:3})),i&&x.createElement(tS,{scanning:e,startScanning:c,stopScanning:u}),a&&r.torch&&x.createElement(oS,{scanning:e,status:a.status,torchToggle:a.toggle}),s&&r.zoom&&x.createElement(sS,{scanning:e,capabilities:r.zoom,value:s.value,onZoom:s.onChange}))}const uS={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},lS={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},dS={width:"100%",height:"100%",position:"relative"},fS={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var hS=function(t){let e,n=!1;return(...r)=>(n||(e=t(r),n=!0),e)}(()=>{const t=YA(window);switch(t.browser){case"chrome":r7(window,t);break;case"firefox":s7(window,t);break;case"safari":d7(window,t);break;default:throw new Error("Unsupported browser")}});const pS="data:audio/mp3;base64,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";var ds=t=>t instanceof Date,r2=t=>t==null;const o2=t=>typeof t=="object";var i2=t=>!r2(t)&&!Array.isArray(t)&&o2(t)&&!ds(t),a2=t=>r2(t)||!o2(t);function s2(t,e){if(a2(t)||a2(e))return t===e;if(ds(t)&&ds(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const i=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=e[o];if(ds(i)&&ds(a)||i2(i)&&i2(a)||Array.isArray(i)&&Array.isArray(a)?!s2(i,a):i!==a)return!1}}return!0}function ou(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function gS(t){var e;const{onScan:n,constraints:r,formats:o=["qr_code"],paused:i=!1,components:a,children:s,styles:c,classNames:u,allowMultiple:d,scanDelay:h,onError:f}=t,p=x.useRef(null),l=x.useRef(null),g=x.useRef(null),m=x.useMemo(()=>({...uS,...r}),[r]),y=x.useMemo(()=>({...lS,...a}),[a]),[w,b]=x.useState(!1),[E,C]=x.useState(!0),[I,T]=x.useState(m),P=function(){const q=x.useRef(Promise.resolve({type:"stop",data:{}})),k=x.useRef(null),U=x.useRef(null),[z,te]=x.useState({}),[oe,ne]=x.useState({}),se=x.useCallback(async(H,$)=>{var J,S,M;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((J=navigator==null?void 0:navigator.mediaDevices)===null||J===void 0?void 0:J.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");hS();const F=await navigator.mediaDevices.getUserMedia({audio:!1,video:$});H.srcObject!==void 0?H.srcObject=F:H.mozSrcObject!==void 0?H.mozSrcObject=F:window.URL.createObjectURL?H.src=window.URL.createObjectURL(F):window.webkitURL?H.src=window.webkitURL.createObjectURL(F):H.src=F.id,await Promise.race([H.play(),new Promise(Q=>setTimeout(Q,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Q=>setTimeout(Q,500));const[B]=F.getVideoTracks();return ne(B.getSettings()),te((M=(S=B==null?void 0:B.getCapabilities)===null||S===void 0?void 0:S.call(B))!==null&&M!==void 0?M:{}),k.current=F,U.current=B,{type:"start",data:{videoEl:H,stream:F,constraints:$}}},[]),we=x.useCallback(async(H,$)=>{H.src="",H.srcObject=null,H.load();for(const J of $.getTracks())$.removeTrack(J),J.stop();return k.current=null,U.current=null,ne({}),{type:"stop",data:{}}},[]),le=x.useCallback(async(H,{constraints:$,restart:J=!1})=>{if(q.current=q.current.then(S=>{if(S.type==="start"){const{data:{videoEl:M,stream:F,constraints:B}}=S;return J||H!==M||$!==B?we(M,F).then(()=>se(H,$)):S}return se(H,$)}),(await q.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[se,we]),_e=x.useCallback(async()=>{if(q.current=q.current.then(H=>{if(H.type==="stop")return H;const{data:{videoEl:$,stream:J}}=H;return we($,J)}),(await q.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[we]),ve=x.useCallback(async H=>{const $=U.current;if(!$)throw new Error("No active video track found.");{H.advanced&&H.advanced[0].zoom&&$.getCapabilities().torch&&await $.applyConstraints({advanced:[{torch:!1}]}),await $.applyConstraints(H);const J=$.getCapabilities(),S=$.getSettings();te(J),ne(S)}},[]);return x.useEffect(()=>()=>{(async()=>await _e())()},[_e]),{capabilities:z,settings:oe,startCamera:le,stopCamera:_e,updateConstraints:ve}}(),{startScanning:N,stopScanning:L}=function(q){const{videoElementRef:k,onScan:U,onFound:z,retryDelay:te=100,scanDelay:oe=0,formats:ne=[],audio:se=!0,allowMultiple:we=!1}=q,le=x.useRef(new mf({formats:ne})),_e=x.useRef(null),ve=x.useRef(null);x.useEffect(()=>{le.current=new mf({formats:ne})},[ne]),x.useEffect(()=>{typeof window<"u"&&se&&(_e.current=new Audio(pS))},[se]);const H=x.useCallback($=>async J=>{if(k.current!==null&&k.current.readyState>1){const{lastScan:S,contentBefore:M,lastScanHadContent:F}=$;if(J-S<te)ve.current=window.requestAnimationFrame(H($));else{const B=await le.current.detect(k.current),Q=B.some(ge=>!M.includes(ge.rawValue)),Z=B.length>0;let ee=$.lastOnScan;(Q||we&&Z&&J-ee>=oe)&&(se&&_e.current&&_e.current.paused&&_e.current.play().catch(ge=>console.error("Error playing the sound",ge)),ee=J,U(B)),Z&&z(B),!Z&&F&&z(B);const K={lastScan:J,lastOnScan:ee,lastScanHadContent:Z,contentBefore:Q?B.map(ge=>ge.rawValue):M};ve.current=window.requestAnimationFrame(H(K))}}},[k.current,U,z,te]);return{startScanning:x.useCallback(()=>{const $=performance.now(),J={lastScan:$,lastOnScan:$,contentBefore:[],lastScanHadContent:!1};ve.current=window.requestAnimationFrame(H(J))},[H]),stopScanning:x.useCallback(()=>{ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null)},[])}}({videoElementRef:p,onScan:n,onFound:q=>function(k,U,z,te){const oe=z;if(oe==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const ne=U;if(ne==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(k.length===0||te===void 0)ou(oe);else{const se=ne.offsetWidth,we=ne.offsetHeight,le=ne.videoWidth,_e=ne.videoHeight,ve=Math.max(se/le,we/_e),H=le*ve,$=_e*ve,J=H/le,S=$/_e,M=(se-H)/2,F=(we-$)/2,B=({x:K,y:ge})=>({x:Math.floor(K*J),y:Math.floor(ge*S)}),Q=({x:K,y:ge})=>({x:Math.floor(K+M),y:Math.floor(ge+F)}),Z=k.map(K=>{const{boundingBox:ge,cornerPoints:be}=K,{x:pe,y:fe}=Q(B({x:ge.x,y:ge.y})),{x:ye,y:ue}=B({x:ge.width,y:ge.height});return{...K,cornerPoints:be.map(Oe=>Q(B(Oe))),boundingBox:DOMRectReadOnly.fromRect({x:pe,y:fe,width:ye,height:ue})}});oe.width=ne.offsetWidth,oe.height=ne.offsetHeight;const ee=oe.getContext("2d");if(ee===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");te(Z,ee)}}(q,p.current,g.current,y.tracker),formats:o,audio:y.audio,allowMultiple:d,retryDelay:y.tracker===void 0?500:10,scanDelay:h});x.useEffect(()=>(b(!0),()=>{b(!1)}),[]),x.useEffect(()=>{w&&(L(),N())},[a==null?void 0:a.tracker]),x.useEffect(()=>{if(!s2(m,I)){const q=m;r!=null&&r.deviceId&&delete q.facingMode,T(q)}},[r]);const V=x.useMemo(()=>({constraints:I,shouldStream:w&&!i}),[I,w,i]),j=async()=>{const q=p.current;if(q==null)throw new Error("Video should be defined when component is mounted.");const k=l.current;if(k==null)throw new Error("Canvas should be defined when component is mounted.");const U=k.getContext("2d");if(U==null)throw new Error("Canvas should be defined when component is mounted.");if(V.shouldStream){await P.stopCamera(),C(!1);try{await P.startCamera(q,V),q?C(!0):await P.stopCamera()}catch(z){f==null||f(z),console.error("error",z)}}else k.width=q.videoWidth,k.height=q.videoHeight,U.drawImage(q,0,0,q.videoWidth,q.videoHeight),await P.stopCamera(),C(!1)};x.useEffect(()=>{(async()=>await j())()},[V]);const W=x.useMemo(()=>V.shouldStream&&E,[V.shouldStream,E]);return x.useEffect(()=>{if(W){if(l.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(ou(l.current),g.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(ou(g.current),p.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");N()}},[W]),x.createElement("div",{style:{...dS,...c==null?void 0:c.container},className:u==null?void 0:u.container},x.createElement("video",{ref:p,style:{...fS,...c==null?void 0:c.video,visibility:i?"hidden":"visible"},className:u==null?void 0:u.video,autoPlay:!0,muted:!0,playsInline:!0}),x.createElement("canvas",{ref:l,style:{display:i?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),x.createElement("canvas",{ref:g,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),x.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},y.finder&&x.createElement(cS,{scanning:E,capabilities:P.capabilities,loading:!1,onOff:y.onOff,zoom:y.zoom&&P.settings.zoom?{value:P.settings.zoom,onChange:async q=>{const k={...I,advanced:[{zoom:q}]};await P.updateConstraints(k)}}:void 0,torch:y.torch?{status:(e=P.settings.torch)!==null&&e!==void 0&&e,toggle:async q=>{const k={...I,advanced:[{torch:q}]};await P.updateConstraints(k)}}:void 0,startScanning:async()=>await j(),stopScanning:async()=>{await P.stopCamera(),ou(g.current),C(!1)},border:c==null?void 0:c.finderBorder}),s))}const yf="data:image/svg+xml,%3csvg%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m21.25%207.5c.3796958%200%20.693491.28215388.7431534.64822944l.0068466.10177056v8.5c0%201.7330315-1.3564548%203.1492459-3.0655761%203.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555%200-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932%201.06066018%200%20.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734%200%201.6711923-.7071103%201.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815%202%202c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554%200%20.03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2%202c-.2928932.29289321-.767767.29289321-1.0606602%200-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734%200-1.67119234.70711027-1.7441988%201.60647279l-.0058012.14352721v8.5c0%20.4142136-.33578644.75-.75.75-.37969577%200-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146%201.35645477-3.14924593%203.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117%205.85294824c2.209139%200%204%201.790861%204%204s-1.790861%204-4%204-4-1.790861-4-4%201.790861-4%204-4zm0%201.5c-1.3807119%200-2.5%201.1192881-2.5%202.5s1.1192881%202.5%202.5%202.5%202.5-1.1192881%202.5-2.5-1.1192881-2.5-2.5-2.5z'%20fill='%23212121'/%3e%3c/svg%3e";function c2({onScan:t}){const{cameraFacingMode:e}=an(),[n,r]=x.useState(e??Vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx("div",{className:"scale-x-[-1]",children:v.jsx(gS,{components:{finder:!1},onScan:o=>t(o[0].rawValue),constraints:{facingMode:n},allowMultiple:!0,classNames:{video:"rounded",container:"max-h-[calc(100vh-381px)] min-h-[267px] overflow-hidden rounded"},onError:o=>{console.log(o),Pg(o)}})}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===Vn.USER?r(Vn.ENVIRONMENT):r(Vn.USER),children:v.jsx("img",{src:yf,alt:"camera-switch"})})]})}var iu,vf,mS=(iu=function(t,e){return iu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},iu(t,e)},function(t,e){function n(){this.constructor=t}iu(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}),yS=function(t){function e(n){var r,o,i,a=this.constructor,s=t.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(c,u){u===void 0&&(u=c.constructor);var d=Error.captureStackTrace;d&&d(c,u)}(s),s}return mS(e,t),e}(Error),vS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function e(n){n===void 0&&(n=void 0);var r=t.call(this,n)||this;return r.message=n,r}return vS(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(yS),wS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return wS(e,t),e.kind="ArgumentException",e}($n),bS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ve=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return bS(e,t),e.kind="IllegalArgumentException",e}($n),u2=function(){function t(e){if(this.binarizer=e,e===null)throw new Ve("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(e,n){return this.binarizer.getBlackRow(e,n)},t.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,n,r,o){var i=this.binarizer.getLuminanceSource().crop(e,n,r,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},t}(),ES=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sn=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return ES(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}($n),CS=function(){function t(e){this.source=e}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Nt=function(){function t(){}return t.arraycopy=function(e,n,r,o,i){for(;i--;)r[o++]=e[n++]},t.currentTimeMillis=function(){return Date.now()},t}(),_S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wf=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return _S(e,t),e.kind="IndexOutOfBoundsException",e}($n),AS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),l2=function(t){function e(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=t.call(this,r)||this;return o.index=n,o.message=r,o}return AS(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(wf),SS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function t(){}return t.fill=function(e,n){for(var r=0,o=e.length;r<o;r++)e[r]=n},t.fillWithin=function(e,n,r,o){t.rangeCheck(e.length,n,r);for(var i=n;i<r;i++)e[i]=o},t.rangeCheck=function(e,n,r){if(n>r)throw new Ve("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new l2(n);if(r>e)throw new l2(r)},t.asList=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e},t.create=function(e,n,r){return Array.from({length:e}).map(function(o){return Array.from({length:n}).fill(r)})},t.createInt32Array=function(e,n,r){return Array.from({length:e}).map(function(o){return Int32Array.from({length:n}).fill(r)})},t.equals=function(e,n){if(!e||!n||!e.length||!n.length||e.length!==n.length)return!1;for(var r=0,o=e.length;r<o;r++)if(e[r]!==n[r])return!1;return!0},t.hashCode=function(e){var n,r;if(e===null)return 0;var o=1;try{for(var i=SS(e),a=i.next();!a.done;a=i.next())o=31*o+a.value}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},t.fillUint8Array=function(e,n){for(var r=0;r!==e.length;r++)e[r]=n},t.copyOf=function(e,n){return e.slice(0,n)},t.copyOfUint8Array=function(e,n){if(e.length<=n){var r=new Uint8Array(n);return r.set(e),r}return e.slice(0,n)},t.copyOfRange=function(e,n,r){var o=r-n,i=new Int32Array(o);return Nt.arraycopy(e,n,i,0,o),i},t.binarySearch=function(e,n,r){r===void 0&&(r=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=r(n,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(e,n){return e-n},t}(),bn=function(){function t(){}return t.numberOfTrailingZeros=function(e){var n;if(e===0)return 32;var r=31;return(n=e<<16)!==0&&(r-=16,e=n),(n=e<<8)!==0&&(r-=8,e=n),(n=e<<4)!==0&&(r-=4,e=n),(n=e<<2)!==0&&(r-=2,e=n),r-(e<<1>>>31)},t.numberOfLeadingZeros=function(e){if(e===0)return 32;var n=1;return!(e>>>16)&&(n+=16,e<<=16),!(e>>>24)&&(n+=8,e<<=8),!(e>>>28)&&(n+=4,e<<=4),!(e>>>30)&&(n+=2,e<<=2),n-=e>>>31},t.toHexString=function(e){return e.toString(16)},t.toBinaryString=function(e){return String(parseInt(String(e),2))},t.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},t.truncDivision=function(e,n){return Math.trunc(e/n)},t.parseInt=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Ur=function(){function t(e,n){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=n??t.makeArray(e))}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var n=t.makeArray(e);Nt.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},t.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(31&e))!=0},t.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},t.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},t.prototype.getNextSet=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+bn.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.getNextUnset=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=~r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+bn.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.setBulk=function(e,n){this.bits[Math.floor(e/32)]=n},t.prototype.setRange=function(e,n){if(n<e||e<0||n>this.size)throw new Ve;if(n!==e){n--;for(var r=Math.floor(e/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(a<o?31:31&n))-(1<<(a>r?0:31&e));i[a]|=s}}},t.prototype.clear=function(){for(var e=this.bits.length,n=this.bits,r=0;r<e;r++)n[r]=0},t.prototype.isRange=function(e,n,r){if(n<e||e<0||n>this.size)throw new Ve;if(n===e)return!0;n--;for(var o=Math.floor(e/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var c=(2<<(s<i?31:31&n))-(1<<(s>o?0:31&e))&4294967295;if((a[s]&c)!==(r?c:0))return!1}return!0},t.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(e,n){if(n<0||n>32)throw new Ve("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((e>>r-1&1)==1)},t.prototype.appendBitArray=function(e){var n=e.size;this.ensureCapacity(this.size+n);for(var r=0;r<n;r++)this.appendBit(e.get(r))},t.prototype.xor=function(e){if(this.size!==e.size)throw new Ve("Sizes don't match");for(var n=this.bits,r=0,o=n.length;r<o;r++)n[r]^=e.bits[r]},t.prototype.toBytes=function(e,n,r,o){for(var i=0;i<o;i++){for(var a=0,s=0;s<8;s++)this.get(e)&&(a|=1<<7-s),e++;n[r+i]=a}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),n=Math.floor((this.size-1)/32),r=n+1,o=this.bits,i=0;i<r;i++){var a=o[i];a=(a=(a=(a=(a=a>>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,e[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,c=e[0]>>>s;for(i=1;i<r;i++){var u=e[i];c|=u<<32-s,e[i-1]=c,c=u>>>s}e[r-1]=c}this.bits=e},t.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.size===n.size&&or.equals(this.bits,n.bits)},t.prototype.hashCode=function(){return 31*this.size+or.hashCode(this.bits)},t.prototype.toString=function(){for(var e="",n=0,r=this.size;n<r;n++)!(7&n)&&(e+=" "),e+=this.get(n)?"X":".";return e},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(vf||(vf={}));var _t,Pt=vf,IS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return IS(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}($n),TS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"})(_t||(_t={}));var bf,Yn=function(){function t(e,n,r){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=r,this.values=typeof n=="number"?Int32Array.from([n]):n,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(r,this);for(var c=this.values,u=0,d=c.length;u!==d;u++){var h=c[u];t.VALUES_TO_ECI.set(h,this)}try{for(var f=TS(a),p=f.next();!p.done;p=f.next()){var l=p.value;t.NAME_TO_ECI.set(l,this)}}catch(g){o={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Se("incorect value");var n=t.VALUES_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.getCharacterSetECIByName=function(e){var n=t.NAME_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.getName()===n.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(_t.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(_t.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(_t.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(_t.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(_t.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(_t.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(_t.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(_t.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(_t.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(_t.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(_t.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(_t.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(_t.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(_t.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(_t.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(_t.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(_t.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(_t.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(_t.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(_t.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(_t.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(_t.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(_t.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(_t.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(_t.Big5,28,"Big5"),t.GB18030=new t(_t.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(_t.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),xS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),au=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return xS(e,t),e.kind="UnsupportedOperationException",e}($n),ci=function(){function t(){}return t.decode=function(e,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(e,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&e==="ISO-8859-1"},t.encode=function(e,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(e,r):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},t.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},t.encodingName=function(e){return typeof e=="string"?e:e.getName()},t.encodingCharacterSet=function(e){return e instanceof Yn?e:Yn.getCharacterSetECIByName(e)},t.decodeFallback=function(e,n){var r=this.encodingCharacterSet(n);if(t.isDecodeFallbackSupported(r)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(r.equals(Yn.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new au("Encoding "+this.encodingName(n)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(e){return e.equals(Yn.UTF8)||e.equals(Yn.ISO8859_1)||e.equals(Yn.ASCII)},t.encodeFallback=function(e){for(var n=btoa(unescape(encodeURIComponent(e))).split(""),r=[],o=0;o<n.length;o++)r.push(n[o].charCodeAt(0));return new Uint8Array(r)},t}(),pn=function(){function t(){}return t.castAsNonUtf8Char=function(e,n){n===void 0&&(n=null);var r=n?n.getName():this.ISO88591;return ci.decode(new Uint8Array([e]),r)},t.guessEncoding=function(e,n){if(n!=null&&n.get(Pt.CHARACTER_SET)!==void 0)return n.get(Pt.CHARACTER_SET).toString();for(var r=e.length,o=!0,i=!0,a=!0,s=0,c=0,u=0,d=0,h=0,f=0,p=0,l=0,g=0,m=0,y=0,w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,b=0;b<r&&(o||i||a);b++){var E=255&e[b];a&&(s>0?128&E?s--:a=!1:128&E&&(64&E?(s++,32&E?(s++,16&E?(s++,8&E?a=!1:d++):u++):c++):a=!1)),o&&(E>127&&E<160?o=!1:E>159&&(E<192||E===215||E===247)&&y++),i&&(h>0?E<64||E===127||E>252?i=!1:h--:E===128||E===160||E>239?i=!1:E>160&&E<224?(f++,l=0,++p>g&&(g=p)):E>127?(h++,p=0,++l>m&&(m=l)):(p=0,l=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(w||c+u+d>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?g===2&&f===2||10*y>=r?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=-1;function i(s,c,u,d,h,f){if(s==="%%")return"%";if(n[++o]!==void 0){s=d?parseInt(d.substr(1)):void 0;var p,l=h?parseInt(h.substr(1)):void 0;switch(f){case"s":p=n[o];break;case"c":p=n[o][0];break;case"f":p=parseFloat(n[o]).toFixed(s);break;case"p":p=parseFloat(n[o]).toPrecision(s);break;case"e":p=parseFloat(n[o]).toExponential(s);break;case"x":p=parseInt(n[o]).toString(l||16);break;case"d":p=parseFloat(parseInt(n[o],l||10).toPrecision(s)).toFixed(0)}p=typeof p=="object"?JSON.stringify(p):(+p).toString(l);for(var g=parseInt(u),m=u&&u[0]+""=="0"?"0":" ";p.length<g;)p=c!==void 0?p+m:m+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(a,i)},t.getBytes=function(e,n){return ci.encode(e,n)},t.getCharCode=function(e,n){return n===void 0&&(n=0),e.charCodeAt(n)},t.getCharAt=function(e){return String.fromCharCode(e)},t.SHIFT_JIS=Yn.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Yn.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Yn.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),xt=function(){function t(e){e===void 0&&(e=""),this.value=e}return t.prototype.enableDecoding=function(e){return this.encoding=e,this},t.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=pn.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},t.prototype.appendChars=function(e,n,r){for(var o=n;n<n+r;o++)this.append(e[o]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(e){return this.value.charAt(e)},t.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},t.prototype.setCharAt=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+1)},t.prototype.substring=function(e,n){return this.value.substring(e,n)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+n.length)},t}(),oo=function(){function t(e,n,r,o){if(this.width=e,this.height=n,this.rowSize=r,this.bits=o,n==null&&(n=e),this.height=n,e<1||n<1)throw new Ve("Both dimensions must be greater than 0");r==null&&(r=Math.floor((e+31)/32)),this.rowSize=r,o==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var n=e.length,r=e[0].length,o=new t(r,n),i=0;i<n;i++)for(var a=e[i],s=0;s<r;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,n,r){if(e===null)throw new Ve("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,c=0,u=0;u<e.length;)if(e.charAt(u)===`
137
137
  `||e.charAt(u)==="\r"){if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Ve("row lengths do not match");a=i,c++}u++}else if(e.substring(u,u+n.length)===n)u+=n.length,o[i]=!0,i++;else{if(e.substring(u,u+r.length)!==r)throw new Ve("illegal character encountered: "+e.substring(u));u+=r.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Ve("row lengths do not match");c++}for(var d=new t(s,c),h=0;h<i;h++)o[h]&&d.set(Math.floor(h%s),Math.floor(h/s));return d},t.prototype.get=function(e,n){var r=n*this.rowSize+Math.floor(e/32);return(this.bits[r]>>>(31&e)&1)!=0},t.prototype.set=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]|=1<<(31&e)&4294967295},t.prototype.unset=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]&=~(1<<(31&e)&4294967295)},t.prototype.flip=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]^=1<<(31&e)&4294967295},t.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new Ve("input matrix dimensions do not match");for(var n=new Ur(Math.floor(this.width/32)+1),r=this.rowSize,o=this.bits,i=0,a=this.height;i<a;i++)for(var s=i*r,c=e.getRow(i,n).getBitArray(),u=0;u<r;u++)o[s+u]^=c[u]},t.prototype.clear=function(){for(var e=this.bits,n=e.length,r=0;r<n;r++)e[r]=0},t.prototype.setRegion=function(e,n,r,o){if(n<0||e<0)throw new Ve("Left and top must be nonnegative");if(o<1||r<1)throw new Ve("Height and width must be at least 1");var i=e+r,a=n+o;if(a>this.height||i>this.width)throw new Ve("The region must fit inside the matrix");for(var s=this.rowSize,c=this.bits,u=n;u<a;u++)for(var d=u*s,h=e;h<i;h++)c[d+Math.floor(h/32)]|=1<<(31&h)&4294967295},t.prototype.getRow=function(e,n){n==null||n.getSize()<this.width?n=new Ur(this.width):n.clear();for(var r=this.rowSize,o=this.bits,i=e*r,a=0;a<r;a++)n.setBulk(32*a,o[i+a]);return n},t.prototype.setRow=function(e,n){Nt.arraycopy(n.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var e=this.getWidth(),n=this.getHeight(),r=new Ur(e),o=new Ur(e),i=0,a=Math.floor((n+1)/2);i<a;i++)r=this.getRow(i,r),o=this.getRow(n-1-i,o),r.reverse(),o.reverse(),this.setRow(i,o),this.setRow(n-1-i,r)},t.prototype.getEnclosingRectangle=function(){for(var e=this.width,n=this.height,r=this.rowSize,o=this.bits,i=e,a=n,s=-1,c=-1,u=0;u<n;u++)for(var d=0;d<r;d++){var h=o[u*r+d];if(h!==0){if(u<a&&(a=u),u>c&&(c=u),32*d<i){for(var f=0;!(h<<31-f&4294967295);)f++;32*d+f<i&&(i=32*d+f)}if(32*d+31>s){for(f=31;!(h>>>f);)f--;32*d+f>s&&(s=32*d+f)}}}return s<i||c<a?null:Int32Array.from([i,a,s-i+1,c-a+1])},t.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,n=this.bits,r=0;r<n.length&&n[r]===0;)r++;if(r===n.length)return null;for(var o=r/e,i=r%e*32,a=n[r],s=0;!(a<<31-s&4294967295);)s++;return i+=s,Int32Array.from([i,o])},t.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,n=this.bits,r=n.length-1;r>=0&&n[r]===0;)r--;if(r<0)return null;for(var o=Math.floor(r/e),i=32*Math.floor(r%e),a=n[r],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&or.equals(this.bits,n.bits)},t.prototype.hashCode=function(){var e=this.width;return e=31*(e=31*(e=31*(e=31*e+this.width)+this.height)+this.rowSize)+or.hashCode(this.bits)},t.prototype.toString=function(e,n,r){return e===void 0&&(e="X "),n===void 0&&(n=" "),r===void 0&&(r=`
138
- `),this.buildToString(e,n,r)},t.prototype.buildToString=function(e,n,r){for(var o=new xt,i=0,a=this.height;i<a;i++){for(var s=0,c=this.width;s<c;s++)o.append(this.get(s,i)?e:n);o.append(r)}return o.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),PS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return PS(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}($n),kS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),BS=function(t){function e(n){var r=t.call(this,n)||this;return r.luminances=e.EMPTY,r.buckets=new Int32Array(e.LUMINANCE_BUCKETS),r}return kS(e,t),e.prototype.getBlackRow=function(n,r){var o=this.getLuminanceSource(),i=o.getWidth();r==null||r.getSize()<i?r=new Ur(i):r.clear(),this.initArrays(i);for(var a=o.getRow(n,this.luminances),s=this.buckets,c=0;c<i;c++)s[(255&a[c])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(s);if(i<3)for(c=0;c<i;c++)(255&a[c])<u&&r.set(c);else{var d=255&a[0],h=255&a[1];for(c=1;c<i-1;c++){var f=255&a[c+1];(4*h-d-f)/2<u&&r.set(c),d=h,h=f}}return r},e.prototype.getBlackMatrix=function(){var n=this.getLuminanceSource(),r=n.getWidth(),o=n.getHeight(),i=new oo(r,o);this.initArrays(r);for(var a=this.buckets,s=1;s<5;s++)for(var c=Math.floor(o*s/5),u=n.getRow(c,this.luminances),d=Math.floor(4*r/5),h=Math.floor(r/5);h<d;h++)a[(255&u[h])>>e.LUMINANCE_SHIFT]++;var f=e.estimateBlackPoint(a),p=n.getMatrix();for(s=0;s<o;s++){var l=s*r;for(h=0;h<r;h++)(255&p[l+h])<f&&i.set(h,s)}return i},e.prototype.createBinarizer=function(n){return new e(n)},e.prototype.initArrays=function(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));for(var r=this.buckets,o=0;o<e.LUMINANCE_BUCKETS;o++)r[o]=0},e.estimateBlackPoint=function(n){for(var r=n.length,o=0,i=0,a=0,s=0;s<r;s++)n[s]>a&&(i=s,a=n[s]),n[s]>o&&(o=n[s]);var c=0,u=0;for(s=0;s<r;s++){var d=s-i;(l=n[s]*d*d)>u&&(c=s,u=l)}if(i>c){var h=i;i=c,c=h}if(c-i<=r/16)throw new he;var f=c-1,p=-1;for(s=c-1;s>i;s--){var l,g=s-i;(l=g*g*(c-s)*(o-n[s]))>p&&(f=s,p=l)}return f<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(_S),NS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d2=function(t){function e(n){var r=t.call(this,n)||this;return r.matrix=null,r}return NS(e,t),e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),o=n.getHeight();if(r>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=n.getMatrix(),a=r>>e.BLOCK_SIZE_POWER;r&e.BLOCK_SIZE_MASK&&a++;var s=o>>e.BLOCK_SIZE_POWER;o&e.BLOCK_SIZE_MASK&&s++;var c=e.calculateBlackPoints(i,a,s,r,o),u=new oo(r,o);e.calculateThresholdForBlock(i,a,s,r,o,c,u),this.matrix=u}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(n){return new e(n)},e.calculateThresholdForBlock=function(n,r,o,i,a,s,c){for(var u=a-e.BLOCK_SIZE,d=i-e.BLOCK_SIZE,h=0;h<o;h++){var f=h<<e.BLOCK_SIZE_POWER;f>u&&(f=u);for(var p=e.cap(h,2,o-3),l=0;l<r;l++){var g=l<<e.BLOCK_SIZE_POWER;g>d&&(g=d);for(var m=e.cap(l,2,r-3),y=0,w=-2;w<=2;w++){var b=s[p+w];y+=b[m-2]+b[m-1]+b[m]+b[m+1]+b[m+2]}var E=y/25;e.thresholdBlock(n,g,f,E,i,c)}}},e.cap=function(n,r,o){return n<r?r:n>o?o:n},e.thresholdBlock=function(n,r,o,i,a,s){for(var c=0,u=o*a+r;c<e.BLOCK_SIZE;c++,u+=a)for(var d=0;d<e.BLOCK_SIZE;d++)(255&n[u+d])<=i&&s.set(r+d,o+c)},e.calculateBlackPoints=function(n,r,o,i,a){for(var s=a-e.BLOCK_SIZE,c=i-e.BLOCK_SIZE,u=new Array(o),d=0;d<o;d++){u[d]=new Int32Array(r);var h=d<<e.BLOCK_SIZE_POWER;h>s&&(h=s);for(var f=0;f<r;f++){var p=f<<e.BLOCK_SIZE_POWER;p>c&&(p=c);for(var l=0,g=255,m=0,y=0,w=h*i+p;y<e.BLOCK_SIZE;y++,w+=i){for(var b=0;b<e.BLOCK_SIZE;b++){var E=255&n[w+b];l+=E,E<g&&(g=E),E>m&&(m=E)}if(m-g>e.MIN_DYNAMIC_RANGE)for(y++,w+=i;y<e.BLOCK_SIZE;y++,w+=i)for(b=0;b<e.BLOCK_SIZE;b++)l+=255&n[w+b]}var C=l>>2*e.BLOCK_SIZE_POWER;if(m-g<=e.MIN_DYNAMIC_RANGE&&(C=g/2,d>0&&f>0)){var I=(u[d-1][f]+2*u[d][f-1]+u[d-1][f-1])/4;g<I&&(C=I)}u[d][f]=C}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(BS),fs=function(){function t(e,n){this.width=e,this.height=n}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(e,n,r,o){throw new au("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new au("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new au("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),n=new xt,r=0;r<this.height;r++){for(var o=this.getRow(r,e),i=0;i<this.width;i++){var a=255&o[i],s=void 0;s=a<64?"#":a<128?"+":a<192?".":" ",n.append(s)}n.append(`
139
- `)}return n.toString()},t}(),RS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),su=function(t){function e(n){var r=t.call(this,n.getWidth(),n.getHeight())||this;return r.delegate=n,r}return RS(e,t),e.prototype.getRow=function(n,r){for(var o=this.delegate.getRow(n,r),i=this.getWidth(),a=0;a<i;a++)o[a]=255-(255&o[a]);return o},e.prototype.getMatrix=function(){for(var n=this.delegate.getMatrix(),r=this.getWidth()*this.getHeight(),o=new Uint8ClampedArray(r),i=0;i<r;i++)o[i]=255-(255&n[i]);return o},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(n,r,o,i){return new e(this.delegate.crop(n,r,o,i))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(fs),DS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),MS=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.tempCanvasElement=null,r.buffer=e.makeBufferFromCanvasImageData(n),r}return DS(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d").getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(r.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement(),o=r.getContext("2d"),i=n*e.DEGREE_TO_RADIANS,a=this.canvas.width,s=this.canvas.height,c=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*s),u=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*s);return r.width=c,r.height=u,o.translate(c/2,u/2),o.rotate(i),o.drawImage(this.canvas,a/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new su(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs),LS=function(){function t(e,n,r){this.deviceId=e,this.label=n,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),Bn=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Nn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},FS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zi=function(){function t(e,n,r){n===void 0&&(n=500),this.reader=e,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return Bn(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Nn(this,function(p){switch(p.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=FS(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.prototype.getVideoInputDevices=function(){return Bn(this,void 0,void 0,function(){return Nn(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map(function(n){return new LS(n.deviceId,n.label)})]}})})},t.prototype.findDeviceById=function(e){return Bn(this,void 0,void 0,function(){var n;return Nn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(e,n){return Bn(this,void 0,void 0,function(){return Nn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return this.reset(),r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(e,n,r){return Bn(this,void 0,void 0,function(){return Nn(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(e,n,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return Bn(this,void 0,void 0,function(){var o;return Nn(this,function(i){switch(i.label){case 0:return o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return Bn(this,void 0,void 0,function(){var o;return Nn(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,n,r)];case 2:return[2,i.sent()]}})})},t.prototype.decodeFromStream=function(e,n,r){return Bn(this,void 0,void 0,function(){var o;return Nn(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,r)];case 2:return[2,i.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return o.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(e){var n=this;return new Promise(function(r,o){return n.playVideoOnLoad(e,function(){return r()})})},t.prototype.playVideoOnLoad=function(e,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",n),this.tryPlayVideo(e)},t.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},t.prototype.tryPlayVideo=function(e){return Bn(this,void 0,void 0,function(){return Nn(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.prototype.decodeFromImage=function(e,n){if(!e&&!n)throw new Ht("either imageElement with a src set or an url must be provided");return n&&!e?this.decodeFromImageUrl(n):this.decodeFromImageElement(e)},t.prototype.decodeFromVideo=function(e,n){if(!e&&!n)throw new Ht("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(e)},t.prototype.decodeFromVideoContinuously=function(e,n,r){if(e===void 0&&n===void 0)throw new Ht("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(e,r)},t.prototype.decodeFromImageElement=function(e){if(!e)throw new Ht("An image element must be provided.");this.reset();var n=this.prepareImageElement(e);return this.imageElement=n,this.isImageLoaded(n)?this.decodeOnce(n,!1,!0):this._decodeOnLoadImage(n)},t.prototype.decodeFromVideoElement=function(e){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(n)},t.prototype.decodeFromVideoElementContinuously=function(e,n){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,n)},t.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new Ht("A video element must be provided.");this.reset();var n=this.prepareVideoElement(e);return this.videoElement=n,n},t.prototype.decodeFromImageUrl=function(e){if(!e)throw new Ht("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=e,r},t.prototype.decodeFromVideoUrl=function(e){if(!e)throw new Ht("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=e,r},t.prototype.decodeFromVideoUrlContinuously=function(e,n){if(!e)throw new Ht("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(r,n);return r.src=e,o},t.prototype._decodeOnLoadImage=function(e){var n=this;return new Promise(function(r,o){n.imageLoadedListener=function(){return n.decodeOnce(e,!1,!0).then(r,o)},e.addEventListener("load",n.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(e){return Bn(this,void 0,void 0,function(){return Nn(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),[4,this.decodeOnce(e)];case 2:return[2,n.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(e,n){return Bn(this,void 0,void 0,function(){return Nn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,n),[2]}})})},t.prototype.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.prototype.prepareImageElement=function(e){var n;return e===void 0&&((n=document.createElement("img")).width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(n=e),n},t.prototype.prepareVideoElement=function(e){var n;return e||typeof document>"u"||((n=document.createElement("video")).width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(n=e),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.prototype.decodeOnce=function(e,n,r){var o=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new he("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(e))}catch(c){if(n&&c instanceof he||(c instanceof sn||c instanceof Se)&&r)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(c)}};return new Promise(function(a,s){return i(a,s)})},t.prototype.decodeContinuously=function(e,n){var r=this;this._stopContinuousDecode=!1;var o=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(e);n(i,null),setTimeout(o,r.timeBetweenScansMillis)}catch(a){n(null,a),(a instanceof sn||a instanceof Se||a instanceof he)&&setTimeout(o,r._timeBetweenDecodingAttempts)}};o()},t.prototype.decode=function(e){var n=this.createBinaryBitmap(e);return this.decodeBitmap(n)},t.prototype.createBinaryBitmap=function(e){var n=this.getCaptureCanvasContext(e);this.drawImageOnCanvas(n,e);var r=this.getCaptureCanvas(e),o=new MS(r),i=new d2(o);return new u2(i)},t.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(e).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var n=this.createCaptureCanvas(e);this.captureCanvas=n}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},t.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n,r,o=document.createElement("canvas");return e!==void 0&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),o.style.width=n+"px",o.style.height=r+"px",o.width=n,o.height=r,o},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},t}(),Wn=function(){function t(e,n,r,o,i,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=Nt.currentTimeMillis()),this.text=e,this.rawBytes=n,this.numBits=r,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=e,this.rawBytes=n,this.numBits=r??(n==null?0:8*n.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??Nt.currentTimeMillis()}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(e,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,n)},t.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},t.prototype.addResultPoints=function(e){var n=this.resultPoints;if(n===null)this.resultPoints=e;else if(e!==null&&e.length>0){var r=new Array(n.length+e.length);Nt.arraycopy(n,0,r,0,n.length),Nt.arraycopy(e,0,r,n.length,e.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();(function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(bf||(bf={}));var Ef,Re=bf;(function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ef||(Ef={}));var En,Cn=Ef,cu=function(){function t(e,n,r,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=n,this.byteSegments=r,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(e){this.numBits=e},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(e){this.erasures=e},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(e){this.other=e},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),hs=function(){function t(){}return t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Ve;return this.logTable[e]},t.addOrSubtract=function(e,n){return e^n},t}(),ps=function(){function t(e,n){if(n.length===0)throw new Ve;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var o=1;o<r&&n[o]===0;)o++;o===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-o),Nt.arraycopy(n,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var n,r=this.coefficients;if(e===1){n=0;for(var o=0,i=r.length;o!==i;o++){var a=r[o];n=hs.addOrSubtract(n,a)}return n}n=r[0];var s=r.length,c=this.field;for(o=1;o<s;o++)n=hs.addOrSubtract(c.multiply(e,n),r[o]);return n},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;Nt.arraycopy(r,0,i,0,a);for(var s=a;s<r.length;s++)i[s]=hs.addOrSubtract(n[s-a],r[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,o=e.coefficients,i=o.length,a=new Int32Array(r+i-1),s=this.field,c=0;c<r;c++)for(var u=n[c],d=0;d<i;d++)a[c+d]=hs.addOrSubtract(a[c+d],s.multiply(u,o[d]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var n=this.coefficients.length,r=this.field,o=new Int32Array(n),i=this.coefficients,a=0;a<n;a++)o[a]=r.multiply(i[a],e);return new t(r,o)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Ve;if(n===0)return this.field.getZero();for(var r=this.coefficients,o=r.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(r[s],n);return new t(a,i)},t.prototype.divide=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new Ve("Divide by 0");for(var n=this.field,r=n.getZero(),o=this,i=e.getCoefficient(e.getDegree()),a=n.inverse(i);o.getDegree()>=e.getDegree()&&!o.isZero();){var s=o.getDegree()-e.getDegree(),c=n.multiply(o.getCoefficient(o.getDegree()),a),u=e.multiplyByMonomial(s,c),d=n.buildMonomial(s,c);r=r.addOrSubtract(d),o=o.addOrSubtract(u)}return[r,o]},t.prototype.toString=function(){for(var e="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),n===0||r!==1){var o=this.field.log(r);o===0?e+="1":o===1?e+="a":(e+="a^",e+=o)}n!==0&&(n===1?e+="x":(e+="x^",e+=n))}}return e},t}(),jS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),f2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return jS(e,t),e.kind="ArithmeticException",e}($n),VS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mo=function(t){function e(n,r,o){var i=t.call(this)||this;i.primitive=n,i.size=r,i.generatorBase=o;for(var a=new Int32Array(r),s=1,c=0;c<r;c++)a[c]=s,(s*=2)>=r&&(s^=n,s&=r-1);i.expTable=a;var u=new Int32Array(r);for(c=0;c<r-1;c++)u[a[c]]=c;return i.logTable=u,i.zero=new ps(i,Int32Array.from([0])),i.one=new ps(i,Int32Array.from([1])),i}return VS(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Ve;if(r===0)return this.zero;var o=new Int32Array(n+1);return o[0]=r,new ps(this,o)},e.prototype.inverse=function(n){if(n===0)throw new f2;return this.expTable[this.size-this.logTable[n]-1]},e.prototype.multiply=function(n,r){return n===0||r===0?0:this.expTable[(this.logTable[n]+this.logTable[r])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+bn.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(n){return n===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(hs),US=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uu=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return US(e,t),e.kind="ReedSolomonException",e}($n),GS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gs=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return GS(e,t),e.kind="IllegalStateException",e}($n),lu=function(){function t(e){this.field=e}return t.prototype.decode=function(e,n){for(var r=this.field,o=new ps(r,e),i=new Int32Array(n),a=!0,s=0;s<n;s++){var c=o.evaluateAt(r.exp(s+r.getGeneratorBase()));i[i.length-1-s]=c,c!==0&&(a=!1)}if(!a){var u=new ps(r,i),d=this.runEuclideanAlgorithm(r.buildMonomial(n,1),u,n),h=d[0],f=d[1],p=this.findErrorLocations(h),l=this.findErrorMagnitudes(f,p);for(s=0;s<p.length;s++){var g=e.length-1-r.log(p[s]);if(g<0)throw new uu("Bad error location");e[g]=Mo.addOrSubtract(e[g],l[s])}}},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var o=e;e=n,n=o}for(var i=this.field,a=e,s=n,c=i.getZero(),u=i.getOne();s.getDegree()>=(r/2|0);){var d=a,h=c;if(c=u,(a=s).isZero())throw new uu("r_{i-1} was zero");s=d;for(var f=i.getZero(),p=a.getCoefficient(a.getDegree()),l=i.inverse(p);s.getDegree()>=a.getDegree()&&!s.isZero();){var g=s.getDegree()-a.getDegree(),m=i.multiply(s.getCoefficient(s.getDegree()),l);f=f.addOrSubtract(i.buildMonomial(g,m)),s=s.addOrSubtract(a.multiplyByMonomial(g,m))}if(u=f.multiply(c).addOrSubtract(h),s.getDegree()>=a.getDegree())throw new gs("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(y===0)throw new uu("sigmaTilde(0) was zero");var w=i.inverse(y);return[u.multiplyScalar(w),s.multiplyScalar(w)]},t.prototype.findErrorLocations=function(e){var n=e.getDegree();if(n===1)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(n),o=0,i=this.field,a=1;a<i.getSize()&&o<n;a++)e.evaluateAt(a)===0&&(r[o]=i.inverse(a),o++);if(o!==n)throw new uu("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(e,n){for(var r=n.length,o=new Int32Array(r),i=this.field,a=0;a<r;a++){for(var s=i.inverse(n[a]),c=1,u=0;u<r;u++)if(a!==u){var d=i.multiply(n[u],s),h=1&d?-2&d:1|d;c=i.multiply(c,h)}o[a]=i.multiply(e.evaluateAt(s),i.inverse(c)),i.getGeneratorBase()!==0&&(o[a]=i.multiply(o[a],s))}return o},t}();(function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"})(En||(En={}));var h2=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var n=e.getBits(),r=this.extractBits(n),o=this.correctBits(r),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new cu(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(e){return this.getEncodedData(e)},t.getEncodedData=function(e){for(var n=e.length,r=En.UPPER,o=En.UPPER,i="",a=0;a<n;)if(o===En.BINARY){if(n-a<5)break;var s=t.readCode(e,a,5);if(a+=5,s===0){if(n-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var c=0;c<s;c++){if(n-a<8){a=n;break}var u=t.readCode(e,a,8);i+=pn.castAsNonUtf8Char(u),a+=8}o=r}else{var d=o===En.DIGIT?4:5;if(n-a<d)break;u=t.readCode(e,a,d),a+=d;var h=t.getCharacter(o,u);h.startsWith("CTRL_")?(r=o,o=t.getTable(h.charAt(5)),h.charAt(6)==="L"&&(r=o)):(i+=h,o=r)}return i},t.getTable=function(e){switch(e){case"L":return En.LOWER;case"P":return En.PUNCT;case"M":return En.MIXED;case"D":return En.DIGIT;case"B":return En.BINARY;default:return En.UPPER}},t.getCharacter=function(e,n){switch(e){case En.UPPER:return t.UPPER_TABLE[n];case En.LOWER:return t.LOWER_TABLE[n];case En.MIXED:return t.MIXED_TABLE[n];case En.PUNCT:return t.PUNCT_TABLE[n];case En.DIGIT:return t.DIGIT_TABLE[n];default:throw new gs("Bad table")}},t.prototype.correctBits=function(e){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=Mo.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=Mo.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=Mo.AZTEC_DATA_10):(r=12,n=Mo.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/r;if(i<o)throw new Se;for(var a=e.length%r,s=new Int32Array(i),c=0;c<i;c++,a+=r)s[c]=t.readCode(e,a,r);try{new lu(n).decode(s,i-o)}catch(g){throw new Se(g)}var u=(1<<r)-1,d=0;for(c=0;c<o;c++){if((p=s[c])===0||p===u)throw new Se;p!==1&&p!==u-1||d++}var h=new Array(o*r-d),f=0;for(c=0;c<o;c++){var p;if((p=s[c])===1||p===u-1)h.fill(p>1,f,f+r-1),f+=r-1;else for(var l=r-1;l>=0;--l)h[f++]=(p&1<<l)!=0}return h},t.prototype.extractBits=function(e){var n=this.ddata.isCompact(),r=this.ddata.getNbLayers(),o=(n?11:14)+4*r,i=new Int32Array(o),a=new Array(this.totalBitsInLayer(r,n));if(n)for(var s=0;s<i.length;s++)i[s]=s;else{var c=o+1+2*bn.truncDivision(bn.truncDivision(o,2)-1,15),u=o/2,d=bn.truncDivision(c,2);for(s=0;s<u;s++){var h=s+bn.truncDivision(s,15);i[u-s-1]=d-h-1,i[u+s]=d+h+1}}s=0;for(var f=0;s<r;s++){for(var p=4*(r-s)+(n?9:12),l=2*s,g=o-1-l,m=0;m<p;m++)for(var y=2*m,w=0;w<2;w++)a[f+y+w]=e.get(i[l+w],i[l+m]),a[f+2*p+y+w]=e.get(i[l+m],i[g-w]),a[f+4*p+y+w]=e.get(i[g-w],i[g-m]),a[f+6*p+y+w]=e.get(i[g-m],i[l+w]);f+=8*p}return a},t.readCode=function(e,n,r){for(var o=0,i=n;i<n+r;i++)o<<=1,e[i]&&(o|=1);return o},t.readByte=function(e,n){var r=e.length-n;return r>=8?t.readCode(e,n,8):t.readCode(e,n,r)<<8-r},t.convertBoolArrayToByteArray=function(e){for(var n=new Uint8Array((e.length+7)/8),r=0;r<n.length;r++)n[r]=t.readByte(e,8*r);return n},t.prototype.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
138
+ `),this.buildToString(e,n,r)},t.prototype.buildToString=function(e,n,r){for(var o=new xt,i=0,a=this.height;i<a;i++){for(var s=0,c=this.width;s<c;s++)o.append(this.get(s,i)?e:n);o.append(r)}return o.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),OS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return OS(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}($n),PS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kS=function(t){function e(n){var r=t.call(this,n)||this;return r.luminances=e.EMPTY,r.buckets=new Int32Array(e.LUMINANCE_BUCKETS),r}return PS(e,t),e.prototype.getBlackRow=function(n,r){var o=this.getLuminanceSource(),i=o.getWidth();r==null||r.getSize()<i?r=new Ur(i):r.clear(),this.initArrays(i);for(var a=o.getRow(n,this.luminances),s=this.buckets,c=0;c<i;c++)s[(255&a[c])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(s);if(i<3)for(c=0;c<i;c++)(255&a[c])<u&&r.set(c);else{var d=255&a[0],h=255&a[1];for(c=1;c<i-1;c++){var f=255&a[c+1];(4*h-d-f)/2<u&&r.set(c),d=h,h=f}}return r},e.prototype.getBlackMatrix=function(){var n=this.getLuminanceSource(),r=n.getWidth(),o=n.getHeight(),i=new oo(r,o);this.initArrays(r);for(var a=this.buckets,s=1;s<5;s++)for(var c=Math.floor(o*s/5),u=n.getRow(c,this.luminances),d=Math.floor(4*r/5),h=Math.floor(r/5);h<d;h++)a[(255&u[h])>>e.LUMINANCE_SHIFT]++;var f=e.estimateBlackPoint(a),p=n.getMatrix();for(s=0;s<o;s++){var l=s*r;for(h=0;h<r;h++)(255&p[l+h])<f&&i.set(h,s)}return i},e.prototype.createBinarizer=function(n){return new e(n)},e.prototype.initArrays=function(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));for(var r=this.buckets,o=0;o<e.LUMINANCE_BUCKETS;o++)r[o]=0},e.estimateBlackPoint=function(n){for(var r=n.length,o=0,i=0,a=0,s=0;s<r;s++)n[s]>a&&(i=s,a=n[s]),n[s]>o&&(o=n[s]);var c=0,u=0;for(s=0;s<r;s++){var d=s-i;(l=n[s]*d*d)>u&&(c=s,u=l)}if(i>c){var h=i;i=c,c=h}if(c-i<=r/16)throw new he;var f=c-1,p=-1;for(s=c-1;s>i;s--){var l,g=s-i;(l=g*g*(c-s)*(o-n[s]))>p&&(f=s,p=l)}return f<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(CS),BS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d2=function(t){function e(n){var r=t.call(this,n)||this;return r.matrix=null,r}return BS(e,t),e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),o=n.getHeight();if(r>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=n.getMatrix(),a=r>>e.BLOCK_SIZE_POWER;r&e.BLOCK_SIZE_MASK&&a++;var s=o>>e.BLOCK_SIZE_POWER;o&e.BLOCK_SIZE_MASK&&s++;var c=e.calculateBlackPoints(i,a,s,r,o),u=new oo(r,o);e.calculateThresholdForBlock(i,a,s,r,o,c,u),this.matrix=u}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(n){return new e(n)},e.calculateThresholdForBlock=function(n,r,o,i,a,s,c){for(var u=a-e.BLOCK_SIZE,d=i-e.BLOCK_SIZE,h=0;h<o;h++){var f=h<<e.BLOCK_SIZE_POWER;f>u&&(f=u);for(var p=e.cap(h,2,o-3),l=0;l<r;l++){var g=l<<e.BLOCK_SIZE_POWER;g>d&&(g=d);for(var m=e.cap(l,2,r-3),y=0,w=-2;w<=2;w++){var b=s[p+w];y+=b[m-2]+b[m-1]+b[m]+b[m+1]+b[m+2]}var E=y/25;e.thresholdBlock(n,g,f,E,i,c)}}},e.cap=function(n,r,o){return n<r?r:n>o?o:n},e.thresholdBlock=function(n,r,o,i,a,s){for(var c=0,u=o*a+r;c<e.BLOCK_SIZE;c++,u+=a)for(var d=0;d<e.BLOCK_SIZE;d++)(255&n[u+d])<=i&&s.set(r+d,o+c)},e.calculateBlackPoints=function(n,r,o,i,a){for(var s=a-e.BLOCK_SIZE,c=i-e.BLOCK_SIZE,u=new Array(o),d=0;d<o;d++){u[d]=new Int32Array(r);var h=d<<e.BLOCK_SIZE_POWER;h>s&&(h=s);for(var f=0;f<r;f++){var p=f<<e.BLOCK_SIZE_POWER;p>c&&(p=c);for(var l=0,g=255,m=0,y=0,w=h*i+p;y<e.BLOCK_SIZE;y++,w+=i){for(var b=0;b<e.BLOCK_SIZE;b++){var E=255&n[w+b];l+=E,E<g&&(g=E),E>m&&(m=E)}if(m-g>e.MIN_DYNAMIC_RANGE)for(y++,w+=i;y<e.BLOCK_SIZE;y++,w+=i)for(b=0;b<e.BLOCK_SIZE;b++)l+=255&n[w+b]}var C=l>>2*e.BLOCK_SIZE_POWER;if(m-g<=e.MIN_DYNAMIC_RANGE&&(C=g/2,d>0&&f>0)){var I=(u[d-1][f]+2*u[d][f-1]+u[d-1][f-1])/4;g<I&&(C=I)}u[d][f]=C}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(kS),fs=function(){function t(e,n){this.width=e,this.height=n}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(e,n,r,o){throw new au("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new au("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new au("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),n=new xt,r=0;r<this.height;r++){for(var o=this.getRow(r,e),i=0;i<this.width;i++){var a=255&o[i],s=void 0;s=a<64?"#":a<128?"+":a<192?".":" ",n.append(s)}n.append(`
139
+ `)}return n.toString()},t}(),NS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),su=function(t){function e(n){var r=t.call(this,n.getWidth(),n.getHeight())||this;return r.delegate=n,r}return NS(e,t),e.prototype.getRow=function(n,r){for(var o=this.delegate.getRow(n,r),i=this.getWidth(),a=0;a<i;a++)o[a]=255-(255&o[a]);return o},e.prototype.getMatrix=function(){for(var n=this.delegate.getMatrix(),r=this.getWidth()*this.getHeight(),o=new Uint8ClampedArray(r),i=0;i<r;i++)o[i]=255-(255&n[i]);return o},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(n,r,o,i){return new e(this.delegate.crop(n,r,o,i))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(fs),RS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),DS=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.tempCanvasElement=null,r.buffer=e.makeBufferFromCanvasImageData(n),r}return RS(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d").getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(r.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement(),o=r.getContext("2d"),i=n*e.DEGREE_TO_RADIANS,a=this.canvas.width,s=this.canvas.height,c=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*s),u=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*s);return r.width=c,r.height=u,o.translate(c/2,u/2),o.rotate(i),o.drawImage(this.canvas,a/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new su(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs),MS=function(){function t(e,n,r){this.deviceId=e,this.label=n,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),Bn=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Nn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},LS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zi=function(){function t(e,n,r){n===void 0&&(n=500),this.reader=e,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return Bn(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Nn(this,function(p){switch(p.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=LS(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.prototype.getVideoInputDevices=function(){return Bn(this,void 0,void 0,function(){return Nn(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map(function(n){return new MS(n.deviceId,n.label)})]}})})},t.prototype.findDeviceById=function(e){return Bn(this,void 0,void 0,function(){var n;return Nn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(e,n){return Bn(this,void 0,void 0,function(){return Nn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return this.reset(),r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(e,n,r){return Bn(this,void 0,void 0,function(){return Nn(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(e,n,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return Bn(this,void 0,void 0,function(){var o;return Nn(this,function(i){switch(i.label){case 0:return o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return Bn(this,void 0,void 0,function(){var o;return Nn(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,n,r)];case 2:return[2,i.sent()]}})})},t.prototype.decodeFromStream=function(e,n,r){return Bn(this,void 0,void 0,function(){var o;return Nn(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,r)];case 2:return[2,i.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(e,n){return Bn(this,void 0,void 0,function(){var r;return Nn(this,function(o){switch(o.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return o.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(e){var n=this;return new Promise(function(r,o){return n.playVideoOnLoad(e,function(){return r()})})},t.prototype.playVideoOnLoad=function(e,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",n),this.tryPlayVideo(e)},t.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},t.prototype.tryPlayVideo=function(e){return Bn(this,void 0,void 0,function(){return Nn(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.prototype.decodeFromImage=function(e,n){if(!e&&!n)throw new Ht("either imageElement with a src set or an url must be provided");return n&&!e?this.decodeFromImageUrl(n):this.decodeFromImageElement(e)},t.prototype.decodeFromVideo=function(e,n){if(!e&&!n)throw new Ht("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(e)},t.prototype.decodeFromVideoContinuously=function(e,n,r){if(e===void 0&&n===void 0)throw new Ht("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(e,r)},t.prototype.decodeFromImageElement=function(e){if(!e)throw new Ht("An image element must be provided.");this.reset();var n=this.prepareImageElement(e);return this.imageElement=n,this.isImageLoaded(n)?this.decodeOnce(n,!1,!0):this._decodeOnLoadImage(n)},t.prototype.decodeFromVideoElement=function(e){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(n)},t.prototype.decodeFromVideoElementContinuously=function(e,n){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,n)},t.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new Ht("A video element must be provided.");this.reset();var n=this.prepareVideoElement(e);return this.videoElement=n,n},t.prototype.decodeFromImageUrl=function(e){if(!e)throw new Ht("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=e,r},t.prototype.decodeFromVideoUrl=function(e){if(!e)throw new Ht("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=e,r},t.prototype.decodeFromVideoUrlContinuously=function(e,n){if(!e)throw new Ht("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(r,n);return r.src=e,o},t.prototype._decodeOnLoadImage=function(e){var n=this;return new Promise(function(r,o){n.imageLoadedListener=function(){return n.decodeOnce(e,!1,!0).then(r,o)},e.addEventListener("load",n.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(e){return Bn(this,void 0,void 0,function(){return Nn(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),[4,this.decodeOnce(e)];case 2:return[2,n.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(e,n){return Bn(this,void 0,void 0,function(){return Nn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,n),[2]}})})},t.prototype.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.prototype.prepareImageElement=function(e){var n;return e===void 0&&((n=document.createElement("img")).width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(n=e),n},t.prototype.prepareVideoElement=function(e){var n;return e||typeof document>"u"||((n=document.createElement("video")).width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(n=e),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.prototype.decodeOnce=function(e,n,r){var o=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new he("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(e))}catch(c){if(n&&c instanceof he||(c instanceof sn||c instanceof Se)&&r)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(c)}};return new Promise(function(a,s){return i(a,s)})},t.prototype.decodeContinuously=function(e,n){var r=this;this._stopContinuousDecode=!1;var o=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(e);n(i,null),setTimeout(o,r.timeBetweenScansMillis)}catch(a){n(null,a),(a instanceof sn||a instanceof Se||a instanceof he)&&setTimeout(o,r._timeBetweenDecodingAttempts)}};o()},t.prototype.decode=function(e){var n=this.createBinaryBitmap(e);return this.decodeBitmap(n)},t.prototype.createBinaryBitmap=function(e){var n=this.getCaptureCanvasContext(e);this.drawImageOnCanvas(n,e);var r=this.getCaptureCanvas(e),o=new DS(r),i=new d2(o);return new u2(i)},t.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(e).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var n=this.createCaptureCanvas(e);this.captureCanvas=n}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},t.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n,r,o=document.createElement("canvas");return e!==void 0&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),o.style.width=n+"px",o.style.height=r+"px",o.width=n,o.height=r,o},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},t}(),Wn=function(){function t(e,n,r,o,i,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=Nt.currentTimeMillis()),this.text=e,this.rawBytes=n,this.numBits=r,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=e,this.rawBytes=n,this.numBits=r??(n==null?0:8*n.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??Nt.currentTimeMillis()}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(e,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,n)},t.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},t.prototype.addResultPoints=function(e){var n=this.resultPoints;if(n===null)this.resultPoints=e;else if(e!==null&&e.length>0){var r=new Array(n.length+e.length);Nt.arraycopy(n,0,r,0,n.length),Nt.arraycopy(e,0,r,n.length,e.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();(function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(bf||(bf={}));var Ef,Re=bf;(function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ef||(Ef={}));var En,Cn=Ef,cu=function(){function t(e,n,r,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=n,this.byteSegments=r,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(e){this.numBits=e},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(e){this.erasures=e},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(e){this.other=e},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),hs=function(){function t(){}return t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Ve;return this.logTable[e]},t.addOrSubtract=function(e,n){return e^n},t}(),ps=function(){function t(e,n){if(n.length===0)throw new Ve;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var o=1;o<r&&n[o]===0;)o++;o===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-o),Nt.arraycopy(n,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var n,r=this.coefficients;if(e===1){n=0;for(var o=0,i=r.length;o!==i;o++){var a=r[o];n=hs.addOrSubtract(n,a)}return n}n=r[0];var s=r.length,c=this.field;for(o=1;o<s;o++)n=hs.addOrSubtract(c.multiply(e,n),r[o]);return n},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;Nt.arraycopy(r,0,i,0,a);for(var s=a;s<r.length;s++)i[s]=hs.addOrSubtract(n[s-a],r[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,o=e.coefficients,i=o.length,a=new Int32Array(r+i-1),s=this.field,c=0;c<r;c++)for(var u=n[c],d=0;d<i;d++)a[c+d]=hs.addOrSubtract(a[c+d],s.multiply(u,o[d]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var n=this.coefficients.length,r=this.field,o=new Int32Array(n),i=this.coefficients,a=0;a<n;a++)o[a]=r.multiply(i[a],e);return new t(r,o)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Ve;if(n===0)return this.field.getZero();for(var r=this.coefficients,o=r.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(r[s],n);return new t(a,i)},t.prototype.divide=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new Ve("Divide by 0");for(var n=this.field,r=n.getZero(),o=this,i=e.getCoefficient(e.getDegree()),a=n.inverse(i);o.getDegree()>=e.getDegree()&&!o.isZero();){var s=o.getDegree()-e.getDegree(),c=n.multiply(o.getCoefficient(o.getDegree()),a),u=e.multiplyByMonomial(s,c),d=n.buildMonomial(s,c);r=r.addOrSubtract(d),o=o.addOrSubtract(u)}return[r,o]},t.prototype.toString=function(){for(var e="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),n===0||r!==1){var o=this.field.log(r);o===0?e+="1":o===1?e+="a":(e+="a^",e+=o)}n!==0&&(n===1?e+="x":(e+="x^",e+=n))}}return e},t}(),FS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),f2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return FS(e,t),e.kind="ArithmeticException",e}($n),jS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mo=function(t){function e(n,r,o){var i=t.call(this)||this;i.primitive=n,i.size=r,i.generatorBase=o;for(var a=new Int32Array(r),s=1,c=0;c<r;c++)a[c]=s,(s*=2)>=r&&(s^=n,s&=r-1);i.expTable=a;var u=new Int32Array(r);for(c=0;c<r-1;c++)u[a[c]]=c;return i.logTable=u,i.zero=new ps(i,Int32Array.from([0])),i.one=new ps(i,Int32Array.from([1])),i}return jS(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Ve;if(r===0)return this.zero;var o=new Int32Array(n+1);return o[0]=r,new ps(this,o)},e.prototype.inverse=function(n){if(n===0)throw new f2;return this.expTable[this.size-this.logTable[n]-1]},e.prototype.multiply=function(n,r){return n===0||r===0?0:this.expTable[(this.logTable[n]+this.logTable[r])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+bn.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(n){return n===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(hs),VS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),uu=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return VS(e,t),e.kind="ReedSolomonException",e}($n),US=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gs=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return US(e,t),e.kind="IllegalStateException",e}($n),lu=function(){function t(e){this.field=e}return t.prototype.decode=function(e,n){for(var r=this.field,o=new ps(r,e),i=new Int32Array(n),a=!0,s=0;s<n;s++){var c=o.evaluateAt(r.exp(s+r.getGeneratorBase()));i[i.length-1-s]=c,c!==0&&(a=!1)}if(!a){var u=new ps(r,i),d=this.runEuclideanAlgorithm(r.buildMonomial(n,1),u,n),h=d[0],f=d[1],p=this.findErrorLocations(h),l=this.findErrorMagnitudes(f,p);for(s=0;s<p.length;s++){var g=e.length-1-r.log(p[s]);if(g<0)throw new uu("Bad error location");e[g]=Mo.addOrSubtract(e[g],l[s])}}},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var o=e;e=n,n=o}for(var i=this.field,a=e,s=n,c=i.getZero(),u=i.getOne();s.getDegree()>=(r/2|0);){var d=a,h=c;if(c=u,(a=s).isZero())throw new uu("r_{i-1} was zero");s=d;for(var f=i.getZero(),p=a.getCoefficient(a.getDegree()),l=i.inverse(p);s.getDegree()>=a.getDegree()&&!s.isZero();){var g=s.getDegree()-a.getDegree(),m=i.multiply(s.getCoefficient(s.getDegree()),l);f=f.addOrSubtract(i.buildMonomial(g,m)),s=s.addOrSubtract(a.multiplyByMonomial(g,m))}if(u=f.multiply(c).addOrSubtract(h),s.getDegree()>=a.getDegree())throw new gs("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(y===0)throw new uu("sigmaTilde(0) was zero");var w=i.inverse(y);return[u.multiplyScalar(w),s.multiplyScalar(w)]},t.prototype.findErrorLocations=function(e){var n=e.getDegree();if(n===1)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(n),o=0,i=this.field,a=1;a<i.getSize()&&o<n;a++)e.evaluateAt(a)===0&&(r[o]=i.inverse(a),o++);if(o!==n)throw new uu("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(e,n){for(var r=n.length,o=new Int32Array(r),i=this.field,a=0;a<r;a++){for(var s=i.inverse(n[a]),c=1,u=0;u<r;u++)if(a!==u){var d=i.multiply(n[u],s),h=1&d?-2&d:1|d;c=i.multiply(c,h)}o[a]=i.multiply(e.evaluateAt(s),i.inverse(c)),i.getGeneratorBase()!==0&&(o[a]=i.multiply(o[a],s))}return o},t}();(function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"})(En||(En={}));var h2=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var n=e.getBits(),r=this.extractBits(n),o=this.correctBits(r),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new cu(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(e){return this.getEncodedData(e)},t.getEncodedData=function(e){for(var n=e.length,r=En.UPPER,o=En.UPPER,i="",a=0;a<n;)if(o===En.BINARY){if(n-a<5)break;var s=t.readCode(e,a,5);if(a+=5,s===0){if(n-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var c=0;c<s;c++){if(n-a<8){a=n;break}var u=t.readCode(e,a,8);i+=pn.castAsNonUtf8Char(u),a+=8}o=r}else{var d=o===En.DIGIT?4:5;if(n-a<d)break;u=t.readCode(e,a,d),a+=d;var h=t.getCharacter(o,u);h.startsWith("CTRL_")?(r=o,o=t.getTable(h.charAt(5)),h.charAt(6)==="L"&&(r=o)):(i+=h,o=r)}return i},t.getTable=function(e){switch(e){case"L":return En.LOWER;case"P":return En.PUNCT;case"M":return En.MIXED;case"D":return En.DIGIT;case"B":return En.BINARY;default:return En.UPPER}},t.getCharacter=function(e,n){switch(e){case En.UPPER:return t.UPPER_TABLE[n];case En.LOWER:return t.LOWER_TABLE[n];case En.MIXED:return t.MIXED_TABLE[n];case En.PUNCT:return t.PUNCT_TABLE[n];case En.DIGIT:return t.DIGIT_TABLE[n];default:throw new gs("Bad table")}},t.prototype.correctBits=function(e){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=Mo.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=Mo.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=Mo.AZTEC_DATA_10):(r=12,n=Mo.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/r;if(i<o)throw new Se;for(var a=e.length%r,s=new Int32Array(i),c=0;c<i;c++,a+=r)s[c]=t.readCode(e,a,r);try{new lu(n).decode(s,i-o)}catch(g){throw new Se(g)}var u=(1<<r)-1,d=0;for(c=0;c<o;c++){if((p=s[c])===0||p===u)throw new Se;p!==1&&p!==u-1||d++}var h=new Array(o*r-d),f=0;for(c=0;c<o;c++){var p;if((p=s[c])===1||p===u-1)h.fill(p>1,f,f+r-1),f+=r-1;else for(var l=r-1;l>=0;--l)h[f++]=(p&1<<l)!=0}return h},t.prototype.extractBits=function(e){var n=this.ddata.isCompact(),r=this.ddata.getNbLayers(),o=(n?11:14)+4*r,i=new Int32Array(o),a=new Array(this.totalBitsInLayer(r,n));if(n)for(var s=0;s<i.length;s++)i[s]=s;else{var c=o+1+2*bn.truncDivision(bn.truncDivision(o,2)-1,15),u=o/2,d=bn.truncDivision(c,2);for(s=0;s<u;s++){var h=s+bn.truncDivision(s,15);i[u-s-1]=d-h-1,i[u+s]=d+h+1}}s=0;for(var f=0;s<r;s++){for(var p=4*(r-s)+(n?9:12),l=2*s,g=o-1-l,m=0;m<p;m++)for(var y=2*m,w=0;w<2;w++)a[f+y+w]=e.get(i[l+w],i[l+m]),a[f+2*p+y+w]=e.get(i[l+m],i[g-w]),a[f+4*p+y+w]=e.get(i[g-w],i[g-m]),a[f+6*p+y+w]=e.get(i[g-m],i[l+w]);f+=8*p}return a},t.readCode=function(e,n,r){for(var o=0,i=n;i<n+r;i++)o<<=1,e[i]&&(o|=1);return o},t.readByte=function(e,n){var r=e.length-n;return r>=8?t.readCode(e,n,8):t.readCode(e,n,r)<<8-r},t.convertBoolArrayToByteArray=function(e){for(var n=new Uint8Array((e.length+7)/8),r=0;r<n.length;r++)n[r]=t.readByte(e,8*r);return n},t.prototype.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
140
140
  `,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],t.PUNCT_TABLE=["","\r",`\r
141
- `,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),ft=function(){function t(){}return t.round=function(e){return e===NaN?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},t.distance=function(e,n,r,o){var i=e-r,a=n-o;return Math.sqrt(i*i+a*a)},t.sum=function(e){for(var n=0,r=0,o=e.length;r!==o;r++)n+=e[r];return n},t}(),Cf=function(){function t(){}return t.floatToIntBits=function(e){return e},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Pe=function(){function t(e,n){this.x=e,this.y=n}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var n=e;return this.x===n.x&&this.y===n.y}return!1},t.prototype.hashCode=function(){return 31*Cf.floatToIntBits(this.x)+Cf.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(e){var n,r,o,i=this.distance(e[0],e[1]),a=this.distance(e[1],e[2]),s=this.distance(e[0],e[2]);if(a>=i&&a>=s?(r=e[0],n=e[1],o=e[2]):s>=a&&s>=i?(r=e[1],n=e[0],o=e[2]):(r=e[2],n=e[0],o=e[1]),this.crossProductZ(n,r,o)<0){var c=n;n=o,o=c}e[0]=n,e[1]=r,e[2]=o},t.distance=function(e,n){return ft.distance(e.x,e.y,n.x,n.y)},t.crossProductZ=function(e,n,r){var o=n.x,i=n.y;return(r.x-o)*(e.y-i)-(r.y-i)*(e.x-o)},t}(),_f=function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),qS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),HS=function(t){function e(n,r,o,i,a){var s=t.call(this,n,r)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return qS(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(_f),Af=function(){function t(e,n,r,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),n==null&&(n=t.INIT_SIZE),r==null&&(r=e.getWidth()/2|0),o==null&&(o=e.getHeight()/2|0);var i=n/2|0;if(this.leftInit=r-i,this.rightInit=r+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new he}return t.prototype.detect=function(){for(var e=this.leftInit,n=this.rightInit,r=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,c=!1,u=!1,d=!1,h=!1,f=this.width,p=this.height;a;){a=!1;for(var l=!0;(l||!c)&&n<f;)(l=this.containsBlackPoint(r,o,n,!1))?(n++,a=!0,c=!0):c||n++;if(n>=f){i=!0;break}for(var g=!0;(g||!u)&&o<p;)(g=this.containsBlackPoint(e,n,o,!0))?(o++,a=!0,u=!0):u||o++;if(o>=p){i=!0;break}for(var m=!0;(m||!d)&&e>=0;)(m=this.containsBlackPoint(r,o,e,!1))?(e--,a=!0,d=!0):d||e--;if(e<0){i=!0;break}for(var y=!0;(y||!h)&&r>=0;)(y=this.containsBlackPoint(e,n,r,!0))?(r--,a=!0,h=!0):h||r--;if(r<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var w=n-e,b=null,E=1;b===null&&E<w;E++)b=this.getBlackPointOnSegment(e,o-E,e+E,o);if(b==null)throw new he;var C=null;for(E=1;C===null&&E<w;E++)C=this.getBlackPointOnSegment(e,r+E,e+E,r);if(C==null)throw new he;var I=null;for(E=1;I===null&&E<w;E++)I=this.getBlackPointOnSegment(n,r+E,n-E,r);if(I==null)throw new he;var T=null;for(E=1;T===null&&E<w;E++)T=this.getBlackPointOnSegment(n,o-E,n-E,o);if(T==null)throw new he;return this.centerEdges(T,b,I,C)}throw new he},t.prototype.getBlackPointOnSegment=function(e,n,r,o){for(var i=ft.round(ft.distance(e,n,r,o)),a=(r-e)/i,s=(o-n)/i,c=this.image,u=0;u<i;u++){var d=ft.round(e+u*a),h=ft.round(n+u*s);if(c.get(d,h))return new Pe(d,h)}return null},t.prototype.centerEdges=function(e,n,r,o){var i=e.getX(),a=e.getY(),s=n.getX(),c=n.getY(),u=r.getX(),d=r.getY(),h=o.getX(),f=o.getY(),p=t.CORR;return i<this.width/2?[new Pe(h-p,f+p),new Pe(s+p,c+p),new Pe(u-p,d-p),new Pe(i+p,a-p)]:[new Pe(h+p,f+p),new Pe(s+p,c-p),new Pe(u-p,d+p),new Pe(i-p,a-p)]},t.prototype.containsBlackPoint=function(e,n,r,o){var i=this.image;if(o){for(var a=e;a<=n;a++)if(i.get(a,r))return!0}else for(var s=e;s<=n;s++)if(i.get(r,s))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),p2=function(){function t(){}return t.checkAndNudgePoints=function(e,n){for(var r=e.getWidth(),o=e.getHeight(),i=!0,a=0;a<n.length&&i;a+=2){var s=Math.floor(n[a]),c=Math.floor(n[a+1]);if(s<-1||s>r||c<-1||c>o)throw new he;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),c===-1?(n[a+1]=0,i=!0):c===o&&(n[a+1]=o-1,i=!0)}for(i=!0,a=n.length-2;a>=0&&i;a-=2){if(s=Math.floor(n[a]),c=Math.floor(n[a+1]),s<-1||s>r||c<-1||c>o)throw new he;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),c===-1?(n[a+1]=0,i=!0):c===o&&(n[a+1]=o-1,i=!0)}},t}(),g2=function(){function t(e,n,r,o,i,a,s,c,u){this.a11=e,this.a21=n,this.a31=r,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=c,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,n,r,o,i,a,s,c,u,d,h,f,p,l,g,m){var y=t.quadrilateralToSquare(e,n,r,o,i,a,s,c);return t.squareToQuadrilateral(u,d,h,f,p,l,g,m).times(y)},t.prototype.transformPoints=function(e){for(var n=e.length,r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,c=this.a23,u=this.a31,d=this.a32,h=this.a33,f=0;f<n;f+=2){var p=e[f],l=e[f+1],g=i*p+c*l+h;e[f]=(r*p+a*l+u)/g,e[f+1]=(o*p+s*l+d)/g}},t.prototype.transformPointsWithValues=function(e,n){for(var r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,c=this.a23,u=this.a31,d=this.a32,h=this.a33,f=e.length,p=0;p<f;p++){var l=e[p],g=n[p],m=i*l+c*g+h;e[p]=(r*l+a*g+u)/m,n[p]=(o*l+s*g+d)/m}},t.squareToQuadrilateral=function(e,n,r,o,i,a,s,c){var u=e-r+i-s,d=n-o+a-c;if(u===0&&d===0)return new t(r-e,i-r,e,o-n,a-o,n,0,0,1);var h=r-i,f=s-i,p=o-a,l=c-a,g=h*l-f*p,m=(u*l-f*d)/g,y=(h*d-u*p)/g;return new t(r-e+m*r,s-e+y*s,e,o-n+m*o,c-n+y*c,n,m,y,1)},t.quadrilateralToSquare=function(e,n,r,o,i,a,s,c){return t.squareToQuadrilateral(e,n,r,o,i,a,s,c).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t}(),$S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),YS=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return $S(e,t),e.prototype.sampleGrid=function(n,r,o,i,a,s,c,u,d,h,f,p,l,g,m,y,w,b,E){var C=g2.quadrilateralToQuadrilateral(i,a,s,c,u,d,h,f,p,l,g,m,y,w,b,E);return this.sampleGridWithTransform(n,r,o,C)},e.prototype.sampleGridWithTransform=function(n,r,o,i){if(r<=0||o<=0)throw new he;for(var a=new oo(r,o),s=new Float32Array(2*r),c=0;c<o;c++){for(var u=s.length,d=c+.5,h=0;h<u;h+=2)s[h]=h/2+.5,s[h+1]=d;i.transformPoints(s),p2.checkAndNudgePoints(n,s);try{for(h=0;h<u;h+=2)n.get(Math.floor(s[h]),Math.floor(s[h+1]))&&a.set(h/2,c)}catch{throw new he}}return a},e}(p2),Sf=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new YS,t}(),Kn=function(){function t(e,n){this.x=e,this.y=n}return t.prototype.toResultPoint=function(){return new Pe(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),WS=function(){function t(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(e){var n=this.getMatrixCenter(),r=this.getBullsEyeCorners(n);if(e){var o=r[0];r[0]=r[2],r[2]=o}this.extractParameters(r);var i=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),a=this.getMatrixCornerPoints(r);return new HS(i,a,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(e){if(!(this.isValidPoint(e[0])&&this.isValidPoint(e[1])&&this.isValidPoint(e[2])&&this.isValidPoint(e[3])))throw new he;var n=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(e[0],e[1],n),this.sampleLine(e[1],e[2],n),this.sampleLine(e[2],e[3],n),this.sampleLine(e[3],e[0],n)]);this.shift=this.getRotation(r,n);for(var o=0,i=0;i<4;i++){var a=r[(this.shift+i)%4];this.compact?(o<<=7,o+=a>>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},t.prototype.getRotation=function(e,n){var r=0;e.forEach(function(i,a,s){r=(r<<3)+((i>>n-2<<1)+(1&i))}),r=((1&r)<<11)+(r>>1);for(var o=0;o<4;o++)if(bn.bitCount(r^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new he},t.prototype.getCorrectedParameterData=function(e,n){var r,o;n?(r=7,o=2):(r=10,o=4);for(var i=r-o,a=new Int32Array(r),s=r-1;s>=0;--s)a[s]=15&e,e>>=4;try{new lu(Mo.AZTEC_PARAM).decode(a,i)}catch{throw new he}var c=0;for(s=0;s<o;s++)c=(c<<4)+a[s];return c},t.prototype.getBullsEyeCorners=function(e){var n=e,r=e,o=e,i=e,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(n,a,1,-1),c=this.getFirstDifferent(r,a,1,1),u=this.getFirstDifferent(o,a,-1,1),d=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var h=this.distancePoint(d,s)*this.nbCenterLayers/(this.distancePoint(i,n)*(this.nbCenterLayers+2));if(h<.75||h>1.25||!this.isWhiteOrBlackRectangle(s,c,u,d))break}n=s,r=c,o=u,i=d,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new he;this.compact=this.nbCenterLayers===5;var f=new Pe(n.getX()+.5,n.getY()-.5),p=new Pe(r.getX()+.5,r.getY()+.5),l=new Pe(o.getX()-.5,o.getY()+.5),g=new Pe(i.getX()-.5,i.getY()-.5);return this.expandSquare([f,p,l,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var e,n,r,o;try{e=(u=new Af(this.image).detect())[0],n=u[1],r=u[2],o=u[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;e=this.getFirstDifferent(new Kn(i+7,a-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new Kn(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Kn(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new Kn(i-7,a-7),!1,-1,-1).toResultPoint()}var s=ft.round((e.getX()+o.getX()+n.getX()+r.getX())/4),c=ft.round((e.getY()+o.getY()+n.getY()+r.getY())/4);try{var u;e=(u=new Af(this.image,15,s,c).detect())[0],n=u[1],r=u[2],o=u[3]}catch{e=this.getFirstDifferent(new Kn(s+7,c-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new Kn(s+7,c+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Kn(s-7,c+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new Kn(s-7,c-7),!1,-1,-1).toResultPoint()}return s=ft.round((e.getX()+o.getX()+n.getX()+r.getX())/4),c=ft.round((e.getY()+o.getY()+n.getY()+r.getY())/4),new Kn(s,c)},t.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(e,n,r,o,i){var a=Sf.getInstance(),s=this.getDimension(),c=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return a.sampleGrid(e,s,s,c,c,u,c,u,u,c,u,n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY(),i.getX(),i.getY())},t.prototype.sampleLine=function(e,n,r){for(var o=0,i=this.distanceResultPoint(e,n),a=i/r,s=e.getX(),c=e.getY(),u=a*(n.getX()-e.getX())/i,d=a*(n.getY()-e.getY())/i,h=0;h<r;h++)this.image.get(ft.round(s+h*u),ft.round(c+h*d))&&(o|=1<<r-h-1);return o},t.prototype.isWhiteOrBlackRectangle=function(e,n,r,o){e=new Kn(e.getX()-3,e.getY()+3),n=new Kn(n.getX()-3,n.getY()-3),r=new Kn(r.getX()+3,r.getY()-3),o=new Kn(o.getX()+3,o.getY()+3);var i=this.getColor(o,e);if(i===0)return!1;var a=this.getColor(e,n);return a===i&&(a=this.getColor(n,r))===i&&(a=this.getColor(r,o))===i},t.prototype.getColor=function(e,n){for(var r=this.distancePoint(e,n),o=(n.getX()-e.getX())/r,i=(n.getY()-e.getY())/r,a=0,s=e.getX(),c=e.getY(),u=this.image.get(e.getX(),e.getY()),d=Math.ceil(r),h=0;h<d;h++)s+=o,c+=i,this.image.get(ft.round(s),ft.round(c))!==u&&a++;var f=a/r;return f>.1&&f<.9?0:f<=.1===u?1:-1},t.prototype.getFirstDifferent=function(e,n,r,o){for(var i=e.getX()+r,a=e.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r,a+=o;for(i-=r,a-=o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r;for(i-=r;this.isValid(i,a)&&this.image.get(i,a)===n;)a+=o;return new Kn(i,a-=o)},t.prototype.expandSquare=function(e,n,r){var o=r/(2*n),i=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,c=(e[0].getY()+e[2].getY())/2,u=new Pe(s+o*i,c+o*a),d=new Pe(s-o*i,c-o*a);return i=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,c=(e[1].getY()+e[3].getY())/2,[u,new Pe(s+o*i,c+o*a),d,new Pe(s-o*i,c-o*a)]},t.prototype.isValid=function(e,n){return e>=0&&e<this.image.getWidth()&&n>0&&n<this.image.getHeight()},t.prototype.isValidPoint=function(e){var n=ft.round(e.getX()),r=ft.round(e.getY());return this.isValid(n,r)},t.prototype.distancePoint=function(e,n){return ft.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.distanceResultPoint=function(e,n){return ft.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(bn.truncDivision(this.nbLayers-4,8)+1)+15},t}(),du=function(){function t(){}return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=null,o=new WS(e.getBlackMatrix()),i=null,a=null;try{i=(s=o.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(n,i),a=new h2().decode(s)}catch(h){r=h}if(a==null)try{var s;i=(s=o.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(n,i),a=new h2().decode(s)}catch(h){throw r??h}var c=new Wn(a.getText(),a.getRawBytes(),a.getNumBits(),i,Re.AZTEC,Nt.currentTimeMillis()),u=a.getByteSegments();u!=null&&c.putMetadata(Cn.BYTE_SEGMENTS,u);var d=a.getECLevel();return d!=null&&c.putMetadata(Cn.ERROR_CORRECTION_LEVEL,d),c},t.prototype.reportFoundResultPoints=function(e,n){if(e!=null){var r=e.get(Pt.NEED_RESULT_POINT_CALLBACK);r!=null&&n.forEach(function(o,i,a){r.foundPossibleResultPoint(o)})}},t.prototype.reset=function(){},t}(),KS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new du,n)||this}KS(e,t)})(Zi);var _n=function(){function t(){}return t.prototype.decode=function(e,n){try{return this.doDecode(e,n)}catch{if(n&&n.get(Pt.TRY_HARDER)===!0&&e.isRotateSupported()){var r=e.rotateCounterClockwise(),o=this.doDecode(r,n),i=o.getResultMetadata(),a=270;i!==null&&i.get(Cn.ORIENTATION)===!0&&(a+=i.get(Cn.ORIENTATION)%360),o.putMetadata(Cn.ORIENTATION,a);var s=o.getResultPoints();if(s!==null)for(var c=r.getHeight(),u=0;u<s.length;u++)s[u]=new Pe(c-s[u].getY()-1,s[u].getX());return o}throw new he}},t.prototype.reset=function(){},t.prototype.doDecode=function(e,n){var r,o=e.getWidth(),i=e.getHeight(),a=new Ur(o),s=n&&n.get(Pt.TRY_HARDER)===!0,c=Math.max(1,i>>(s?8:5));r=s?i:15;for(var u=Math.trunc(i/2),d=0;d<r;d++){var h=Math.trunc((d+1)/2),f=u+c*(1&d?-h:h);if(f<0||f>=i)break;try{a=e.getBlackRow(f,a)}catch{continue}for(var p=function(y){if(y===1&&(a.reverse(),n&&n.get(Pt.NEED_RESULT_POINT_CALLBACK)===!0)){var w=new Map;n.forEach(function(C,I){return w.set(I,C)}),w.delete(Pt.NEED_RESULT_POINT_CALLBACK),n=w}try{var b=l.decodeRow(f,a,n);if(y===1){b.putMetadata(Cn.ORIENTATION,180);var E=b.getResultPoints();E!==null&&(E[0]=new Pe(o-E[0].getX()-1,E[0].getY()),E[1]=new Pe(o-E[1].getX()-1,E[1].getY()))}return{value:b}}catch{}},l=this,g=0;g<2;g++){var m=p(g);if(typeof m=="object")return m.value}}throw new he},t.recordPattern=function(e,n,r){for(var o=r.length,i=0;i<o;i++)r[i]=0;var a=e.getSize();if(n>=a)throw new he;for(var s=!e.get(n),c=0,u=n;u<a;){if(e.get(u)!==s)r[c]++;else{if(++c===o)break;r[c]=1,s=!s}u++}if(c!==o&&(c!==o-1||u!==a))throw new he},t.recordPatternInReverse=function(e,n,r){for(var o=r.length,i=e.get(n);n>0&&o>=0;)e.get(--n)!==i&&(o--,i=!i);if(o>=0)throw new he;t.recordPattern(e,n+1,r)},t.patternMatchVariance=function(e,n,r){for(var o=e.length,i=0,a=0,s=0;s<o;s++)i+=e[s],a+=n[s];if(i<a)return Number.POSITIVE_INFINITY;var c=i/a;r*=c;for(var u=0,d=0;d<o;d++){var h=e[d],f=n[d]*c,p=h>f?h-f:f-h;if(p>r)return Number.POSITIVE_INFINITY;u+=p}return u/i},t}(),zS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return zS(e,t),e.findStartPattern=function(n){for(var r=n.getSize(),o=n.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,c=!1,u=o;u<r;u++)if(n.get(u)!==c)a[i]++;else{if(i===5){for(var d=e.MAX_AVG_VARIANCE,h=-1,f=e.CODE_START_A;f<=e.CODE_START_C;f++){var p=_n.patternMatchVariance(a,e.CODE_PATTERNS[f],e.MAX_INDIVIDUAL_VARIANCE);p<d&&(d=p,h=f)}if(h>=0&&n.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,h]);s+=a[0]+a[1],(a=a.slice(2,a.length-1))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,c=!c}throw new he},e.decodeCode=function(n,r,o){_n.recordPattern(n,o,r);for(var i=e.MAX_AVG_VARIANCE,a=-1,s=0;s<e.CODE_PATTERNS.length;s++){var c=e.CODE_PATTERNS[s],u=this.patternMatchVariance(r,c,e.MAX_INDIVIDUAL_VARIANCE);u<i&&(i=u,a=s)}if(a>=0)return a;throw new he},e.prototype.decodeRow=function(n,r,o){var i,a=o&&o.get(Pt.ASSUME_GS1)===!0,s=e.findStartPattern(r),c=s[2],u=0,d=new Uint8Array(20);switch(d[u++]=c,c){case e.CODE_START_A:i=e.CODE_CODE_A;break;case e.CODE_START_B:i=e.CODE_CODE_B;break;case e.CODE_START_C:i=e.CODE_CODE_C;break;default:throw new Se}for(var h=!1,f=!1,p="",l=s[0],g=s[1],m=Int32Array.from([0,0,0,0,0,0]),y=0,w=0,b=c,E=0,C=!0,I=!1,T=!1;!h;){var P=f;switch(f=!1,y=w,w=e.decodeCode(r,m,g),d[u++]=w,w!==e.CODE_STOP&&(C=!0),w!==e.CODE_STOP&&(b+=++E*w),l=g,g+=m.reduce(function(z,te){return z+te},0),w){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Se}switch(i){case e.CODE_CODE_A:if(w<64)p+=T===I?String.fromCharCode(32+w):String.fromCharCode(32+w+128),T=!1;else if(w<96)p+=T===I?String.fromCharCode(w-64):String.fromCharCode(w+64),T=!1;else switch(w!==e.CODE_STOP&&(C=!1),w){case e.CODE_FNC_1:a&&(p.length===0?p+="]C1":p+="");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!I&&T?(I=!0,T=!1):I&&T?(I=!1,T=!1):T=!0;break;case e.CODE_SHIFT:f=!0,i=e.CODE_CODE_B;break;case e.CODE_CODE_B:i=e.CODE_CODE_B;break;case e.CODE_CODE_C:i=e.CODE_CODE_C;break;case e.CODE_STOP:h=!0}break;case e.CODE_CODE_B:if(w<96)p+=T===I?String.fromCharCode(32+w):String.fromCharCode(32+w+128),T=!1;else switch(w!==e.CODE_STOP&&(C=!1),w){case e.CODE_FNC_1:a&&(p.length===0?p+="]C1":p+="");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!I&&T?(I=!0,T=!1):I&&T?(I=!1,T=!1):T=!0;break;case e.CODE_SHIFT:f=!0,i=e.CODE_CODE_A;break;case e.CODE_CODE_A:i=e.CODE_CODE_A;break;case e.CODE_CODE_C:i=e.CODE_CODE_C;break;case e.CODE_STOP:h=!0}break;case e.CODE_CODE_C:if(w<100)w<10&&(p+="0"),p+=w;else switch(w!==e.CODE_STOP&&(C=!1),w){case e.CODE_FNC_1:a&&(p.length===0?p+="]C1":p+="");break;case e.CODE_CODE_A:i=e.CODE_CODE_A;break;case e.CODE_CODE_B:i=e.CODE_CODE_B;break;case e.CODE_STOP:h=!0}}P&&(i=i===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var N=g-l;if(g=r.getNextUnset(g),!r.isRange(g,Math.min(r.getSize(),g+(g-l)/2),!1))throw new he;if((b-=E*y)%103!==y)throw new sn;var L=p.length;if(L===0)throw new he;L>0&&C&&(p=i===e.CODE_CODE_C?p.substring(0,L-2):p.substring(0,L-1));for(var V=(s[1]+s[0])/2,j=l+N/2,W=d.length,q=new Uint8Array(W),k=0;k<W;k++)q[k]=d[k];var U=[new Pe(V,n),new Pe(j,n)];return new Wn(p,q,0,U,Re.CODE_128,new Date().getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIANCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(_n),XS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),If=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},y2=function(t){function e(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var o=t.call(this)||this;return o.usingCheckDigit=n,o.extendedMode=r,o.decodeRowResult="",o.counters=new Int32Array(9),o}return XS(e,t),e.prototype.decodeRow=function(n,r,o){var i,a,s,c,u=this.counters;u.fill(0),this.decodeRowResult="";var d,h,f=e.findAsteriskPattern(r,u),p=r.getNextSet(f[1]),l=r.getSize();do{e.recordPattern(r,p,u);var g=e.toNarrowWidePattern(u);if(g<0)throw new he;d=e.patternToChar(g),this.decodeRowResult+=d,h=p;try{for(var m=(i=void 0,If(u)),y=m.next();!y.done;y=m.next())p+=y.value}catch(V){i={error:V}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}p=r.getNextSet(p)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w,b=0;try{for(var E=If(u),C=E.next();!C.done;C=E.next())b+=C.value}catch(V){s={error:V}}finally{try{C&&!C.done&&(c=E.return)&&c.call(E)}finally{if(s)throw s.error}}if(p!==l&&2*(p-h-b)<b)throw new he;if(this.usingCheckDigit){for(var I=this.decodeRowResult.length-1,T=0,P=0;P<I;P++)T+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(P));if(this.decodeRowResult.charAt(I)!==e.ALPHABET_STRING.charAt(T%43))throw new sn;this.decodeRowResult=this.decodeRowResult.substring(0,I)}if(this.decodeRowResult.length===0)throw new he;w=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var N=(f[1]+f[0])/2,L=h+b/2;return new Wn(w,null,0,[new Pe(N,n),new Pe(L,n)],Re.CODE_39,new Date().getTime())},e.findAsteriskPattern=function(n,r){for(var o=n.getSize(),i=n.getNextSet(0),a=0,s=i,c=!1,u=r.length,d=i;d<o;d++)if(n.get(d)!==c)r[a]++;else{if(a===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&n.isRange(Math.max(0,s-Math.floor((d-s)/2)),s,!1))return[s,d];s+=r[0]+r[1],r.copyWithin(0,2,2+a-1),r[a-1]=0,r[a]=0,a--}else a++;r[a]=1,c=!c}throw new he},e.toNarrowWidePattern=function(n){var r,o,i,a=n.length,s=0;do{var c=2147483647;try{for(var u=(r=void 0,If(n)),d=u.next();!d.done;d=u.next())(l=d.value)<c&&l>s&&(c=l)}catch(g){r={error:g}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}s=c,i=0;for(var h=0,f=0,p=0;p<a;p++)(l=n[p])>s&&(f|=1<<a-1-p,i++,h+=l);if(i===3){for(p=0;p<a&&i>0;p++){var l;if((l=n[p])>s&&(i--,2*l>=h))return-1}return f}}while(i>3);return-1},e.patternToChar=function(n){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===n)return e.ALPHABET_STRING.charAt(r);if(n===e.ASTERISK_ENCODING)return"*";throw new he},e.decodeExtended=function(n){for(var r=n.length,o="",i=0;i<r;i++){var a=n.charAt(i);if(a==="+"||a==="$"||a==="%"||a==="/"){var s=n.charAt(i+1),c="\0";switch(a){case"+":if(!(s>="A"&&s<="Z"))throw new Se;c=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new Se;c=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")c=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")c=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")c=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")c="\0";else if(s==="V")c="@";else if(s==="W")c="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new Se;c=""}break;case"/":if(s>="A"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new Se;c=":"}}o+=c,i++}else o+=a}return o},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(_n),QS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),JS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},v2=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.narrowLineWidth=-1,n}return QS(e,t),e.prototype.decodeRow=function(n,r,o){var i,a,s=this.decodeStart(r),c=this.decodeEnd(r),u=new xt;e.decodeMiddle(r,s[1],c[0],u);var d=u.toString(),h=null;o!=null&&(h=o.get(Pt.ALLOWED_LENGTHS)),h==null&&(h=e.DEFAULT_ALLOWED_LENGTHS);var f=d.length,p=!1,l=0;try{for(var g=JS(h),m=g.next();!m.done;m=g.next()){var y=m.value;if(f===y){p=!0;break}y>l&&(l=y)}}catch(b){i={error:b}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}if(!p&&f>l&&(p=!0),!p)throw new Se;var w=[new Pe(s[1],n),new Pe(c[0],n)];return new Wn(d,null,0,w,Re.ITF,new Date().getTime())},e.decodeMiddle=function(n,r,o,i){var a=new Int32Array(10),s=new Int32Array(5),c=new Int32Array(5);for(a.fill(0),s.fill(0),c.fill(0);r<o;){_n.recordPattern(n,r,a);for(var u=0;u<5;u++){var d=2*u;s[u]=a[d],c[u]=a[d+1]}var h=e.decodeDigit(s);i.append(h.toString()),h=this.decodeDigit(c),i.append(h.toString()),a.forEach(function(f){r+=f})}},e.prototype.decodeStart=function(n){var r=e.skipWhiteSpace(n),o=e.findGuardPattern(n,r,e.START_PATTERN);return this.narrowLineWidth=(o[1]-o[0])/4,this.validateQuietZone(n,o[0]),o},e.prototype.validateQuietZone=function(n,r){var o=10*this.narrowLineWidth;o=o<r?o:r;for(var i=r-1;o>0&&i>=0&&!n.get(i);i--)o--;if(o!==0)throw new he},e.skipWhiteSpace=function(n){var r=n.getSize(),o=n.getNextSet(0);if(o===r)throw new he;return o},e.prototype.decodeEnd=function(n){n.reverse();try{var r=e.skipWhiteSpace(n),o=void 0;try{o=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[0])}catch(a){a instanceof he&&(o=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,o[0]);var i=o[0];return o[0]=n.getSize()-o[1],o[1]=n.getSize()-i,o}finally{n.reverse()}},e.findGuardPattern=function(n,r,o){var i=o.length,a=new Int32Array(i),s=n.getSize(),c=!1,u=0,d=r;a.fill(0);for(var h=r;h<s;h++)if(n.get(h)!==c)a[u]++;else{if(u===i-1){if(_n.patternMatchVariance(a,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[d,h];d+=a[0]+a[1],Nt.arraycopy(a,2,a,0,u-1),a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,c=!c}throw new he},e.decodeDigit=function(n){for(var r=e.MAX_AVG_VARIANCE,o=-1,i=e.PATTERNS.length,a=0;a<i;a++){var s=e.PATTERNS[a],c=_n.patternMatchVariance(n,s,e.MAX_INDIVIDUAL_VARIANCE);c<r?(r=c,o=a):c===r&&(o=-1)}if(o>=0)return o%10;throw new he},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(_n),ZS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ea=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.decodeRowStringBuffer="",n}return ZS(e,t),e.findStartGuardPattern=function(n){for(var r,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(r=e.findGuardPattern(n,i,!1,this.START_END_PATTERN,a))[0],c=s-((i=r[1])-s);c>=0&&(o=n.isRange(c,s,!1))}return r},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===o},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}return(1e3-o)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(n,r,o,i){return this.findGuardPattern(n,r,o,i,new Int32Array(i.length))},e.findGuardPattern=function(n,r,o,i,a){for(var s=n.getSize(),c=0,u=r=o?n.getNextUnset(r):n.getNextSet(r),d=i.length,h=o,f=r;f<s;f++)if(n.get(f)!==h)a[c]++;else{if(c===d-1){if(_n.patternMatchVariance(a,i,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,f]);u+=a[0]+a[1];for(var p=a.slice(2,a.length-1),l=0;l<c-1;l++)a[l]=p[l];a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,h=!h}throw new he},e.decodeDigit=function(n,r,o,i){this.recordPattern(n,o,r);for(var a=this.MAX_AVG_VARIANCE,s=-1,c=i.length,u=0;u<c;u++){var d=i[u],h=_n.patternMatchVariance(r,d,e.MAX_INDIVIDUAL_VARIANCE);h<a&&(a=h,s=u)}if(s>=0)return s;throw new he},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(_n),e9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},t9=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=t.parseExtensionString(a),c=[new Pe((r[0]+r[1])/2,e),new Pe(i,e)],u=new Wn(a,null,0,c,Re.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),c=n[1],u=0,d=0;d<5&&c<s;d++){var h=ea.decodeDigit(e,a,c,ea.L_AND_G_PATTERNS);r+=String.fromCharCode(48+h%10);try{for(var f=(o=void 0,e9(a)),p=f.next();!p.done;p=f.next())c+=p.value}catch(g){o={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(u|=1<<4-d),d!==4&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(r.length!==5)throw new he;var l=this.determineCheckDigit(u);if(t.extensionChecksum(r.toString())!==l)throw new he;return c},t.extensionChecksum=function(e){for(var n=e.length,r=0,o=n-2;o>=0;o-=2)r+=e.charAt(o).charCodeAt(0)-48;for(r*=3,o=n-1;o>=0;o-=2)r+=e.charAt(o).charCodeAt(0)-48;return(r*=3)%10},t.prototype.determineCheckDigit=function(e){for(var n=0;n<10;n++)if(e===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new he},t.parseExtensionString=function(e){if(e.length!==5)return null;var n=t.parseExtension5String(e);return n==null?null:new Map([[Cn.SUGGESTED_PRICE,n]])},t.parseExtension5String=function(e){var n;switch(e.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n=""}var r=parseInt(e.substring(1)),o=r%100;return n+(r/100).toString()+"."+(o<10?"0"+o:o.toString())},t}(),n9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},r9=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=t.parseExtensionString(a),c=[new Pe((r[0]+r[1])/2,e),new Pe(i,e)],u=new Wn(a,null,0,c,Re.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),c=n[1],u=0,d=0;d<2&&c<s;d++){var h=ea.decodeDigit(e,a,c,ea.L_AND_G_PATTERNS);r+=String.fromCharCode(48+h%10);try{for(var f=(o=void 0,n9(a)),p=f.next();!p.done;p=f.next())c+=p.value}catch(l){o={error:l}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(u|=1<<1-d),d!==1&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(r.length!==2)throw new he;if(parseInt(r.toString())%4!==u)throw new he;return c},t.parseExtensionString=function(e){return e.length!==2?null:new Map([[Cn.ISSUE_NUMBER,parseInt(e)]])},t}(),o9=function(){function t(){}return t.decodeRow=function(e,n,r){var o=ea.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new t9().decodeRow(e,n,o)}catch{return new r9().decodeRow(e,n,o)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),i9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cn=function(t){function e(){var n=t.call(this)||this;n.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var o=e.L_PATTERNS[r-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[r]=i}return n}return i9(e,t),e.prototype.decodeRow=function(n,r,o){var i=e.findStartGuardPattern(r),a=o==null?null:o.get(Pt.NEED_RESULT_POINT_CALLBACK);if(a!=null){var s=new Pe((i[0]+i[1])/2,n);a.foundPossibleResultPoint(s)}var c=this.decodeMiddle(r,i,this.decodeRowStringBuffer),u=c.rowOffset,d=c.resultString;if(a!=null){var h=new Pe(u,n);a.foundPossibleResultPoint(h)}var f=e.decodeEnd(r,u);if(a!=null){var p=new Pe((f[0]+f[1])/2,n);a.foundPossibleResultPoint(p)}var l=f[1],g=l+(l-f[0]);if(g>=r.getSize()||!r.isRange(l,g,!1))throw new he;var m=d.toString();if(m.length<8)throw new Se;if(!e.checkChecksum(m))throw new sn;var y=(i[1]+i[0])/2,w=(f[1]+f[0])/2,b=this.getBarcodeFormat(),E=[new Pe(y,n),new Pe(w,n)],C=new Wn(m,null,0,E,b,new Date().getTime()),I=0;try{var T=o9.decodeRow(n,r,f[1]);C.putMetadata(Cn.UPC_EAN_EXTENSION,T.getText()),C.putAllMetadata(T.getResultMetadata()),C.addResultPoints(T.getResultPoints()),I=T.getText().length}catch{}var P=o==null?null:o.get(Pt.ALLOWED_EAN_EXTENSIONS);if(P!=null){var N=!1;for(var L in P)if(I.toString()===L){N=!0;break}if(!N)throw new he}return b===Re.EAN_13||Re.UPC_A,C},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===o},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}return(1e3-o)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(ea),a9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tf=function(t){function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return a9(e,t),e.prototype.decodeMiddle=function(n,r,o){var i,a,s,c,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var d=n.getSize(),h=r[1],f=0,p=0;p<6&&h<d;p++){var l=cn.decodeDigit(n,u,h,cn.L_AND_G_PATTERNS);o+=String.fromCharCode(48+l%10);try{for(var g=(i=void 0,w2(u)),m=g.next();!m.done;m=g.next())h+=m.value}catch(b){i={error:b}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}l>=10&&(f|=1<<5-p)}for(o=e.determineFirstDigit(o,f),h=cn.findGuardPattern(n,h,!0,cn.MIDDLE_PATTERN,new Int32Array(cn.MIDDLE_PATTERN.length).fill(0))[1],p=0;p<6&&h<d;p++){l=cn.decodeDigit(n,u,h,cn.L_PATTERNS),o+=String.fromCharCode(48+l);try{for(var y=(s=void 0,w2(u)),w=y.next();!w.done;w=y.next())h+=w.value}catch(b){s={error:b}}finally{try{w&&!w.done&&(c=y.return)&&c.call(y)}finally{if(s)throw s.error}}}return{rowOffset:h,resultString:o}},e.prototype.getBarcodeFormat=function(){return Re.EAN_13},e.determineFirstDigit=function(n,r){for(var o=0;o<10;o++)if(r===this.FIRST_DIGIT_ENCODINGS[o])return n=String.fromCharCode(48+o)+n;throw new he},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(cn),s9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),b2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},E2=function(t){function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return s9(e,t),e.prototype.decodeMiddle=function(n,r,o){var i,a,s,c,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var d=n.getSize(),h=r[1],f=0;f<4&&h<d;f++){var p=cn.decodeDigit(n,u,h,cn.L_PATTERNS);o+=String.fromCharCode(48+p);try{for(var l=(i=void 0,b2(u)),g=l.next();!g.done;g=l.next())h+=g.value}catch(w){i={error:w}}finally{try{g&&!g.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}}for(h=cn.findGuardPattern(n,h,!0,cn.MIDDLE_PATTERN,new Int32Array(cn.MIDDLE_PATTERN.length).fill(0))[1],f=0;f<4&&h<d;f++){p=cn.decodeDigit(n,u,h,cn.L_PATTERNS),o+=String.fromCharCode(48+p);try{for(var m=(s=void 0,b2(u)),y=m.next();!y.done;y=m.next())h+=y.value}catch(w){s={error:w}}finally{try{y&&!y.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}}return{rowOffset:h,resultString:o}},e.prototype.getBarcodeFormat=function(){return Re.EAN_8},e}(cn),c9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),u9=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.ean13Reader=new Tf,n}return c9(e,t),e.prototype.getBarcodeFormat=function(){return Re.UPC_A},e.prototype.decode=function(n,r){return this.maybeReturnResult(this.ean13Reader.decode(n))},e.prototype.decodeRow=function(n,r,o){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,r,o))},e.prototype.decodeMiddle=function(n,r,o){return this.ean13Reader.decodeMiddle(n,r,o)},e.prototype.maybeReturnResult=function(n){var r=n.getText();if(r.charAt(0)==="0"){var o=new Wn(r.substring(1),null,null,n.getResultPoints(),Re.UPC_A);return n.getResultMetadata()!=null&&o.putAllMetadata(n.getResultMetadata()),o}throw new he},e.prototype.reset=function(){this.ean13Reader.reset()},e}(cn),l9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},C2=function(t){function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return l9(e,t),e.prototype.decodeMiddle=function(n,r,o){var i,a,s=this.decodeMiddleCounters.map(function(g){return g});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=n.getSize(),u=r[1],d=0,h=0;h<6&&u<c;h++){var f=e.decodeDigit(n,s,u,e.L_AND_G_PATTERNS);o+=String.fromCharCode(48+f%10);try{for(var p=(i=void 0,d9(s)),l=p.next();!l.done;l=p.next())u+=l.value}catch(g){i={error:g}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}f>=10&&(d|=1<<5-h)}return e.determineNumSysAndCheckDigit(new xt(o),d),u},e.prototype.decodeEnd=function(n,r){return e.findGuardPatternWithoutCounters(n,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(n){return cn.checkChecksum(e.convertUPCEtoUPCA(n))},e.determineNumSysAndCheckDigit=function(n,r){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return n.insert(0,"0"+o),void n.append("0"+i);throw he.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return Re.UPC_E},e.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new xt;o.append(n.charAt(0));var i=r[5];switch(i){case 0:case 1:case 2:o.appendChars(r,0,2),o.append(i),o.append("0000"),o.appendChars(r,2,3);break;case 3:o.appendChars(r,0,3),o.append("00000"),o.appendChars(r,3,2);break;case 4:o.appendChars(r,0,4),o.append("00000"),o.append(r[4]);break;default:o.appendChars(r,0,5),o.append("0000"),o.append(i)}return n.length>=8&&o.append(n.charAt(7)),o.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(cn),f9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xf=function(t){function e(n){var r=t.call(this)||this,o=n==null?null:n.get(Pt.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(Re.EAN_13)>-1?i.push(new Tf):o.indexOf(Re.UPC_A)>-1&&i.push(new u9),o.indexOf(Re.EAN_8)>-1&&i.push(new E2),o.indexOf(Re.UPC_E)>-1&&i.push(new C2)),i.length===0&&(i.push(new Tf),i.push(new E2),i.push(new C2)),r.readers=i,r}return f9(e,t),e.prototype.decodeRow=function(n,r,o){var i,a;try{for(var s=_2(this.readers),c=s.next();!c.done;c=s.next()){var u=c.value;try{var d=u.decodeRow(n,r,o),h=d.getBarcodeFormat()===Re.EAN_13&&d.getText().charAt(0)==="0",f=o==null?null:o.get(Pt.POSSIBLE_FORMATS),p=f==null||f.includes(Re.UPC_A);if(h&&p){var l=d.getRawBytes(),g=new Wn(d.getText().substring(1),l,l.length,d.getResultPoints(),Re.UPC_A);return g.putAllMetadata(d.getResultMetadata()),g}return d}catch{}}}catch(m){i={error:m}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new he},e.prototype.reset=function(){var n,r;try{for(var o=_2(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e}(_n),h9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),p9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ui=function(t){function e(){var n=t.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(n.dataCharacterCounters.length/2),n.evenCounts=new Array(n.dataCharacterCounters.length/2),n}return h9(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(n,r){for(var o=0;o<r.length;o++)if(_n.patternMatchVariance(n,r[o],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return o;throw new he},e.count=function(n){return ft.sum(new Int32Array(n))},e.increment=function(n,r){for(var o=0,i=r[0],a=1;a<n.length;a++)r[a]>i&&(i=r[a],o=a);n[o]++},e.decrement=function(n,r){for(var o=0,i=r[0],a=1;a<n.length;a++)r[a]<i&&(i=r[a],o=a);n[o]--},e.isFinderPattern=function(n){var r,o,i=n[0]+n[1],a=i/(i+n[2]+n[3]);if(a>=e.MIN_FINDER_PATTERN_RATIO&&a<=e.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER;try{for(var u=p9(n),d=u.next();!d.done;d=u.next()){var h=d.value;h>c&&(c=h),h<s&&(s=h)}}catch(f){r={error:f}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return c<10*s}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(_n),fu=function(){function t(e,n){this.value=e,this.checksumPortion=n}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value&&this.checksumPortion===n.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),A2=function(){function t(e,n,r,o,i){this.value=e,this.startEnd=n,this.value=e,this.startEnd=n,this.resultPoints=new Array,this.resultPoints.push(new Pe(r,i)),this.resultPoints.push(new Pe(o,i))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.hashCode=function(){return this.value},t}(),g9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ta=function(){function t(){}return t.getRSSvalue=function(e,n,r){var o,i,a=0;try{for(var s=g9(e),c=s.next();!c.done;c=s.next())a+=c.value}catch(y){o={error:y}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,d=0,h=e.length,f=0;f<h-1;f++){var p=void 0;for(p=1,d|=1<<f;p<e[f];p++,d&=~(1<<f)){var l=t.combins(a-p-1,h-f-2);if(r&&d===0&&a-p-(h-f-1)>=h-f-1&&(l-=t.combins(a-p-(h-f),h-f-2)),h-f-1>1){for(var g=0,m=a-p-(h-f-2);m>n;m--)g+=t.combins(a-p-m-1,h-f-3);l-=g*(h-1-f)}else a-p>n&&l--;u+=l}a-=p}return u},t.combins=function(e,n){var r,o;e-n>n?(o=n,r=e-n):(o=e-n,r=n);for(var i=1,a=1,s=e;s>r;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},t}(),m9=function(){function t(){}return t.buildBitArray=function(e){var n=2*e.length-1;e[e.length-1].getRightChar()==null&&(n-=1);for(var r=new Ur(12*n),o=0,i=e[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<<a&&r.set(o),o++;for(a=1;a<e.length;++a){for(var s=e[a],c=s.getLeftChar().getValue(),u=11;u>=0;--u)c&1<<u&&r.set(o),o++;if(s.getRightChar()!=null){var d=s.getRightChar().getValue();for(u=11;u>=0;--u)d&1<<u&&r.set(o),o++}}return r},t}(),li=function(){function t(e,n){n?this.decodedInformation=null:(this.finished=e,this.decodedInformation=n)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),Of=function(){function t(e){this.newPosition=e}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),y9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xr=function(t){function e(n,r){var o=t.call(this,n)||this;return o.value=r,o}return y9(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(Of),v9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),di=function(t){function e(n,r,o){var i=t.call(this,n)||this;return o?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=r,i}return v9(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(Of),w9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hu=function(t){function e(n,r,o){var i=t.call(this,n)||this;if(r<0||r>10||o<0||o>10)throw new Se;return i.firstDigit=r,i.secondDigit=o,i}return w9(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(Of),pu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},b9=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var n,r,o,i,a,s,c,u;if(!e)return null;if(e.length<2)throw new he;var d=e.substring(0,2);try{for(var h=pu(t.TWO_DIGIT_DATA_LENGTH),f=h.next();!f.done;f=h.next())if((C=f.value)[0]===d)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,C[2],e):t.processFixedAI(2,C[1],e)}catch(I){n={error:I}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}if(e.length<3)throw new he;var p=e.substring(0,3);try{for(var l=pu(t.THREE_DIGIT_DATA_LENGTH),g=l.next();!g.done;g=l.next())if((C=g.value)[0]===p)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,C[2],e):t.processFixedAI(3,C[1],e)}catch(I){o={error:I}}finally{try{g&&!g.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}try{for(var m=pu(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),y=m.next();!y.done;y=m.next())if((C=y.value)[0]===p)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,C[2],e):t.processFixedAI(4,C[1],e)}catch(I){a={error:I}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(e.length<4)throw new he;var w=e.substring(0,4);try{for(var b=pu(t.FOUR_DIGIT_DATA_LENGTH),E=b.next();!E.done;E=b.next()){var C;if((C=E.value)[0]===w)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,C[2],e):t.processFixedAI(4,C[1],e)}}catch(I){c={error:I}}finally{try{E&&!E.done&&(u=b.return)&&u.call(b)}finally{if(c)throw c.error}}throw new he},t.processFixedAI=function(e,n,r){if(r.length<e)throw new he;var o=r.substring(0,e);if(r.length<e+n)throw new he;var i=r.substring(e,e+n),a=r.substring(e+n),s="("+o+")"+i,c=t.parseFieldsInGeneralPurpose(a);return c==null?s:s+c},t.processVariableAI=function(e,n,r){var o,i=r.substring(0,e);o=r.length<e+n?r.length:e+n;var a=r.substring(e,o),s=r.substring(o),c="("+i+")"+a,u=t.parseFieldsInGeneralPurpose(s);return u==null?c:c+u},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t}(),gu=function(){function t(e){this.buffer=new xt,this.information=e}return t.prototype.decodeAllCodes=function(e,n){for(var r=n,o=null;;){var i=this.decodeGeneralPurposeField(r,o),a=b9.parseFieldsInGeneralPurpose(i.getNewString());if(a!=null&&e.append(a),o=i.isRemaining()?""+i.getRemainingValue():null,r===i.getNewPosition())break;r=i.getNewPosition()}return e.toString()},t.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var n=e;n<e+3;++n)if(this.information.get(n))return!0;return this.information.get(e+3)},t.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var n=this.extractNumericValueFromBitArray(e,4);return new hu(this.information.getSize(),n===0?hu.FNC1:n-1,hu.FNC1)}var r=this.extractNumericValueFromBitArray(e,7);return new hu(e+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,n){return t.extractNumericValueFromBitArray(this.information,e,n)},t.extractNumericValueFromBitArray=function(e,n,r){for(var o=0,i=0;i<r;++i)e.get(n+i)&&(o|=1<<r-i-1);return o},t.prototype.decodeGeneralPurposeField=function(e,n){this.buffer.setLengthToZero(),n!=null&&this.buffer.append(n),this.current.setPosition(e);var r=this.parseBlocks();return r!=null&&r.isRemaining()?new di(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new di(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var e,n;do{var r=this.current.getPosition();if(e=this.current.isAlpha()?(n=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(n=this.parseIsoIec646Block()).isFinished():(n=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!e)break}while(!e);return n.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var n=void 0;return n=e.isSecondDigitFNC1()?new di(this.current.getPosition(),this.buffer.toString()):new di(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new li(!0,n)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1())return n=new di(this.current.getPosition(),this.buffer.toString()),new li(!0,n);this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new li(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new di(this.current.getPosition(),this.buffer.toString());return new li(!0,n)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new li(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new di(this.current.getPosition(),this.buffer.toString());return new li(!0,n)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new li(!1)},t.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;if(e+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(e,8);return o>=232&&o<253},t.prototype.decodeIsoIec646=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new xr(e+5,xr.FNC1);if(n>=5&&n<15)return new xr(e+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(e,7);if(o>=64&&o<90)return new xr(e+7,""+(o+1));if(o>=90&&o<116)return new xr(e+7,""+(o+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Se}return new xr(e+8,r)},t.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;if(e+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new xr(e+5,xr.FNC1);if(n>=5&&n<15)return new xr(e+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(e,6);if(o>=32&&o<58)return new xr(e+6,""+(o+33));switch(o){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new gs("Decoding invalid alphanumeric value: "+o)}return new xr(e+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<5&&n+e<this.information.getSize();++n)if(n===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+n))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var n=e;n<e+3;++n)if(this.information.get(n))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<4&&n+e<this.information.getSize();++n)if(this.information.get(e+n))return!1;return!0},t}(),S2=function(){function t(e){this.information=e,this.generalDecoder=new gu(e)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),E9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Or=function(t){function e(n){return t.call(this,n)||this}return E9(e,t),e.prototype.encodeCompressedGtin=function(n,r){n.append("(01)");var o=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,r,o)},e.prototype.encodeCompressedGtinWithoutAI=function(n,r,o){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*i,10);a/100==0&&n.append("0"),a/10==0&&n.append("0"),n.append(a)}e.appendCheckDigit(n,o)},e.appendCheckDigit=function(n,r){for(var o=0,i=0;i<13;i++){var a=n.charAt(i+r).charCodeAt(0)-48;o+=1&i?a:3*a}(o=10-o%10)===10&&(o=0),n.append(o)},e.GTIN_SIZE=40,e}(S2),C9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_9=function(t){function e(n){return t.call(this,n)||this}return C9(e,t),e.prototype.parseInformation=function(){var n=new xt;n.append("(01)");var r=n.length(),o=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return n.append(o),this.encodeCompressedGtinWithoutAI(n,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Or),A9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),S9=function(t){function e(n){return t.call(this,n)||this}return A9(e,t),e.prototype.parseInformation=function(){var n=new xt;return this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(S2),I9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mu=function(t){function e(n){return t.call(this,n)||this}return I9(e,t),e.prototype.encodeCompressedWeight=function(n,r,o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r,o);this.addWeightCode(n,i);for(var a=this.checkWeight(i),s=1e5,c=0;c<5;++c)a/s==0&&n.append("0"),s/=10;n.append(a)},e}(Or),T9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),I2=function(t){function e(n){return t.call(this,n)||this}return T9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+mu.GTIN_SIZE+e.WEIGHT_SIZE)throw new he;var n=new xt;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+mu.GTIN_SIZE,e.WEIGHT_SIZE),n.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(mu),x9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),O9=function(t){function e(n){return t.call(this,n)||this}return x9(e,t),e.prototype.addWeightCode=function(n,r){n.append("(3103)")},e.prototype.checkWeight=function(n){return n},e}(I2),P9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),k9=function(t){function e(n){return t.call(this,n)||this}return P9(e,t),e.prototype.addWeightCode=function(n,r){r<1e4?n.append("(3202)"):n.append("(3203)")},e.prototype.checkWeight=function(n){return n<1e4?n:n-1e4},e}(I2),B9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),N9=function(t){function e(n){return t.call(this,n)||this}return B9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Or.GTIN_SIZE)throw new he;var n=new xt;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Or.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(392"),n.append(r),n.append(")");var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Or.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return n.append(o.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Or),R9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),D9=function(t){function e(n){return t.call(this,n)||this}return R9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Or.GTIN_SIZE)throw new he;var n=new xt;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Or.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(393"),n.append(r),n.append(")");var o=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Or.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);o/100==0&&n.append("0"),o/10==0&&n.append("0"),n.append(o);var i=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Or.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return n.append(i.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Or),M9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lo=function(t){function e(n,r,o){var i=t.call(this,n)||this;return i.dateCode=o,i.firstAIdigits=r,i}return M9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new he;var n=new xt;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(n,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),n.toString()},e.prototype.encodeCompressedDate=function(n,r){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(o!=38400){n.append("("),n.append(this.dateCode),n.append(")");var i=o%32,a=(o/=32)%12+1,s=o/=12;s/10==0&&n.append("0"),n.append(s),a/10==0&&n.append("0"),n.append(a),i/10==0&&n.append("0"),n.append(i)}},e.prototype.addWeightCode=function(n,r){n.append("("),n.append(this.firstAIdigits),n.append(r/1e5),n.append(")")},e.prototype.checkWeight=function(n){return n%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(mu),T2=function(){function t(e,n,r,o){this.leftchar=e,this.rightchar=n,this.finderpattern=r,this.maybeLast=o}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return this.rightchar==null},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,n){return e instanceof t&&t.equalsOrNull(e.leftchar,n.leftchar)&&t.equalsOrNull(e.rightchar,n.rightchar)&&t.equalsOrNull(e.finderpattern,n.finderpattern)},t.equalsOrNull=function(e,n){return e===null?n===null:t.equals(e,n)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),L9=function(){function t(e,n,r){this.pairs=e,this.rowNumber=n,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,n){return e instanceof t&&this.checkEqualitity(e,n)&&e.wasReversed===n.wasReversed},t.prototype.checkEqualitity=function(e,n){var r;if(e&&n)return e.forEach(function(o,i){n.forEach(function(a){o.getLeftChar().getValue()===a.getLeftChar().getValue()&&o.getRightChar().getValue()===a.getRightChar().getValue()&&o.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),F9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fo=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},j9=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.pairs=new Array(e.MAX_PAIRS),n.rows=new Array,n.startEnd=[2],n}return F9(e,t),e.prototype.decodeRow=function(n,r,o){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(n,r))}catch{}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(n,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(n,r){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof he){if(!this.pairs.length)throw new he;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(n,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new he},e.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());var r=null;try{r=this.checkRows(new Array,0)}catch(o){console.log(o)}return n&&(this.rows=this.rows.reverse()),r},e.prototype.checkRows=function(n,r){for(var o,i,a=r;a<this.rows.length;a++){var s=this.rows[a];this.pairs.length=0;try{for(var c=(o=void 0,Fo(n)),u=c.next();!u.done;u=c.next()){var d=u.value;this.pairs.push(d.getPairs())}}catch(f){o={error:f}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}if(this.pairs.push(s.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var h=new Array(n);h.push(s);try{return this.checkRows(h,a+1)}catch(f){console.log(f)}}}throw new he},e.isValidSequence=function(n){var r,o;try{for(var i=Fo(e.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var s=a.value;if(!(n.length>s.length)){for(var c=!0,u=0;u<n.length;u++)if(n[u].getFinderPattern().getValue()!=s[u]){c=!1;break}if(c)return!0}}}catch(d){r={error:d}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(n,r){for(var o=0,i=!1,a=!1;o<this.rows.length;){var s=this.rows[o];if(s.getRowNumber()>n){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new L9(this.pairs,n,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(n,r){var o,i,a,s,c,u;try{for(var d=Fo(r),h=d.next();!h.done;h=d.next()){var f=h.value;if(f.getPairs().length!==n.length)try{for(var p=(a=void 0,Fo(f.getPairs())),l=p.next();!l.done;l=p.next()){var g=l.value,m=!1;try{for(var y=(c=void 0,Fo(n)),w=y.next();!w.done;w=y.next()){var b=w.value;if(T2.equals(g,b)){m=!0;break}}}catch(E){c={error:E}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(c)throw c.error}}}}catch(E){a={error:E}}finally{try{l&&!l.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(E){o={error:E}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}},e.isPartialRow=function(n,r){var o,i,a,s,c,u;try{for(var d=Fo(r),h=d.next();!h.done;h=d.next()){var f=h.value,p=!0;try{for(var l=(a=void 0,Fo(n)),g=l.next();!g.done;g=l.next()){var m=g.value,y=!1;try{for(var w=(c=void 0,Fo(f.getPairs())),b=w.next();!b.done;b=w.next()){var E=b.value;if(m.equals(E)){y=!0;break}}}catch(C){c={error:C}}finally{try{b&&!b.done&&(u=w.return)&&u.call(w)}finally{if(c)throw c.error}}if(!y){p=!1;break}}}catch(C){a={error:C}}finally{try{g&&!g.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}if(p)return!0}}catch(C){o={error:C}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(n){var r=function(s){try{if(s.get(1))return new _9(s);if(!s.get(2))return new S9(s);switch(gu.extractNumericValueFromBitArray(s,1,4)){case 4:return new O9(s);case 5:return new k9(s)}switch(gu.extractNumericValueFromBitArray(s,1,5)){case 12:return new N9(s);case 13:return new D9(s)}switch(gu.extractNumericValueFromBitArray(s,1,7)){case 56:return new Lo(s,"310","11");case 57:return new Lo(s,"320","11");case 58:return new Lo(s,"310","13");case 59:return new Lo(s,"320","13");case 60:return new Lo(s,"310","15");case 61:return new Lo(s,"320","15");case 62:return new Lo(s,"310","17");case 63:return new Lo(s,"320","17")}}catch(c){throw console.log(c),new gs("unknown decoder: "+s)}}(m9.buildBitArray(n)).parseInformation(),o=n[0].getFinderPattern().getResultPoints(),i=n[n.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new Wn(r,null,null,a,Re.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var n=this.pairs.get(0),r=n.getLeftChar(),o=n.getRightChar();if(o==null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s<this.pairs.size();++s){var c=this.pairs.get(s);i+=c.getLeftChar().getChecksumPortion(),a++;var u=c.getRightChar();u!=null&&(i+=u.getChecksumPortion(),a++)}return 211*(a-4)+(i%=211)==r.getValue()},e.getNextSecondBar=function(n,r){var o;return n.get(r)?(o=n.getNextUnset(r),o=n.getNextSet(o)):(o=n.getNextSet(r),o=n.getNextUnset(o)),o},e.prototype.retrieveNextPair=function(n,r,o){var i,a=r.length%2==0;this.startFromEven&&(a=!a);var s=!0,c=-1;do this.findNextPair(n,r,c),(i=this.parseFoundFinderPattern(n,o,a))==null?c=e.getNextSecondBar(n,this.startEnd[0]):s=!1;while(s);var u,d=this.decodeDataCharacter(n,i,a,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new he;try{u=this.decodeDataCharacter(n,i,a,!1)}catch(h){u=null,console.log(h)}return new T2(d,u,i,!0)},e.prototype.isEmptyPair=function(n){return n.length===0},e.prototype.findNextPair=function(n,r,o){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a,s=n.getSize();o>=0?a=o:this.isEmptyPair(r)?a=0:a=r[r.length-1].getFinderPattern().getStartEnd()[1];var c=r.length%2!=0;this.startFromEven&&(c=!c);for(var u=!1;a<s&&(u=!n.get(a));)a++;for(var d=0,h=a,f=a;f<s;f++)if(n.get(f)!=u)i[d]++;else{if(d==3){if(c&&e.reverseCounters(i),e.isFinderPattern(i))return this.startEnd[0]=h,void(this.startEnd[1]=f);c&&e.reverseCounters(i),h+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,d--}else d++;i[d]=1,u=!u}throw new he},e.reverseCounters=function(n){for(var r=n.length,o=0;o<r/2;++o){var i=n[o];n[o]=n[r-o-1],n[r-o-1]=i}},e.prototype.parseFoundFinderPattern=function(n,r,o){var i,a,s;if(o){for(var c=this.startEnd[0]-1;c>=0&&!n.get(c);)c--;c++,i=this.startEnd[0]-c,a=c,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=n.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,d=this.getDecodeFinderCounters();Nt.arraycopy(d,0,d,1,d.length-1),d[0]=i;try{u=this.parseFinderValue(d,e.FINDER_PATTERNS)}catch{return null}return new A2(u,[a,s],a,s,r)},e.prototype.decodeDataCharacter=function(n,r,o,i){for(var a=this.getDataCharacterCounters(),s=0;s<a.length;s++)a[s]=0;if(i)e.recordPatternInReverse(n,r.getStartEnd()[0],a);else{e.recordPattern(n,r.getStartEnd()[1],a);for(var c=0,u=a.length-1;c<u;c++,u--){var d=a[c];a[c]=a[u],a[u]=d}}var h=ft.sum(new Int32Array(a))/17,f=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(h-f)/f>.3)throw new he;var p=this.getOddCounts(),l=this.getEvenCounts(),g=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors();for(c=0;c<a.length;c++){var y=1*a[c]/h,w=y+.5;if(w<1){if(y<.3)throw new he;w=1}else if(w>8){if(y>8.7)throw new he;w=8}var b=c/2;1&c?(l[b]=w,m[b]=y-w):(p[b]=w,g[b]=y-w)}this.adjustOddEvenCounts(17);var E=4*r.getValue()+(o?0:2)+(i?0:1)-1,C=0,I=0;for(c=p.length-1;c>=0;c--){if(e.isNotA1left(r,o,i)){var T=e.WEIGHTS[E][2*c];I+=p[c]*T}C+=p[c]}var P=0;for(c=l.length-1;c>=0;c--)e.isNotA1left(r,o,i)&&(T=e.WEIGHTS[E][2*c+1],P+=l[c]*T);var N=I+P;if(1&C||C>13||C<4)throw new he;var L=(13-C)/2,V=e.SYMBOL_WIDEST[L],j=9-V,W=ta.getRSSvalue(p,V,!0),q=ta.getRSSvalue(l,j,!1),k=e.EVEN_TOTAL_SUBSET[L],U=e.GSUM[L];return new fu(W*k+q+U,N)},e.isNotA1left=function(n,r,o){return!(n.getValue()==0&&r&&o)},e.prototype.adjustOddEvenCounts=function(n){var r=ft.sum(new Int32Array(this.getOddCounts())),o=ft.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;r>13?a=!0:r<4&&(i=!0);var s=!1,c=!1;o>13?c=!0:o<4&&(s=!0);var u=r+o-n,d=(1&r)==1,h=(1&o)==0;if(u==1)if(d){if(h)throw new he;a=!0}else{if(!h)throw new he;c=!0}else if(u==-1)if(d){if(h)throw new he;i=!0}else{if(!h)throw new he;s=!0}else{if(u!=0)throw new he;if(d){if(!h)throw new he;r<o?(i=!0,c=!0):(a=!0,s=!0)}else if(h)throw new he}if(i){if(a)throw new he;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(c)throw new he;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(ui),V9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),U9=function(t){function e(n,r,o){var i=t.call(this,n,r)||this;return i.count=0,i.finderPattern=o,i}return V9(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(fu),G9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},x2=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return G9(e,t),e.prototype.decodeRow=function(n,r,o){var i,a,s,c,u=this.decodePair(r,!1,n,o);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var d=this.decodePair(r,!0,n,o);e.addOrTally(this.possibleRightPairs,d),r.reverse();try{for(var h=Pf(this.possibleLeftPairs),f=h.next();!f.done;f=h.next()){var p=f.value;if(p.getCount()>1)try{for(var l=(s=void 0,Pf(this.possibleRightPairs)),g=l.next();!g.done;g=l.next()){var m=g.value;if(m.getCount()>1&&e.checkChecksum(p,m))return e.constructResult(p,m)}}catch(y){s={error:y}}finally{try{g&&!g.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}}}catch(y){i={error:y}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}throw new he},e.addOrTally=function(n,r){var o,i;if(r!=null){var a=!1;try{for(var s=Pf(n),c=s.next();!c.done;c=s.next()){var u=c.value;if(u.getValue()===r.getValue()){u.incrementCount(),a=!0;break}}}catch(d){o={error:d}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||n.push(r)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(n,r){for(var o=4537077*n.getValue()+r.getValue(),i=new String(o).toString(),a=new xt,s=13-i.length;s>0;s--)a.append("0");a.append(i);var c=0;for(s=0;s<13;s++){var u=a.charAt(s).charCodeAt(0)-48;c+=1&s?u:3*u}(c=10-c%10)===10&&(c=0),a.append(c.toString());var d=n.getFinderPattern().getResultPoints(),h=r.getFinderPattern().getResultPoints();return new Wn(a.toString(),null,0,[d[0],d[1],h[0],h[1]],Re.RSS_14,new Date().getTime())},e.checkChecksum=function(n,r){var o=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,i=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},e.prototype.decodePair=function(n,r,o,i){try{var a=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,o,r,a),c=i==null?null:i.get(Pt.NEED_RESULT_POINT_CALLBACK);if(c!=null){var u=(a[0]+a[1])/2;r&&(u=n.getSize()-1-u),c.foundPossibleResultPoint(new Pe(u,o))}var d=this.decodeDataCharacter(n,s,!0),h=this.decodeDataCharacter(n,s,!1);return new U9(1597*d.getValue()+h.getValue(),d.getChecksumPortion()+4*h.getChecksumPortion(),s)}catch{return null}},e.prototype.decodeDataCharacter=function(n,r,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)_n.recordPatternInReverse(n,r.getStartEnd()[0],i);else{_n.recordPattern(n,r.getStartEnd()[1]+1,i);for(var s=0,c=i.length-1;s<c;s++,c--){var u=i[s];i[s]=i[c],i[c]=u}}var d=o?16:15,h=ft.sum(new Int32Array(i))/d,f=this.getOddCounts(),p=this.getEvenCounts(),l=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var m=i[s]/h,y=Math.floor(m+.5);y<1?y=1:y>8&&(y=8);var w=Math.floor(s/2);1&s?(p[w]=y,g[w]=m-y):(f[w]=y,l[w]=m-y)}this.adjustOddEvenCounts(o,d);var b=0,E=0;for(s=f.length-1;s>=0;s--)E*=9,E+=f[s],b+=f[s];var C=0,I=0;for(s=p.length-1;s>=0;s--)C*=9,C+=p[s],I+=p[s];var T=E+3*C;if(o){if(1&b||b>12||b<4)throw new he;var P=(12-b)/2,N=9-(q=e.OUTSIDE_ODD_WIDEST[P]),L=ta.getRSSvalue(f,q,!1),V=ta.getRSSvalue(p,N,!0),j=e.OUTSIDE_EVEN_TOTAL_SUBSET[P],W=e.OUTSIDE_GSUM[P];return new fu(L*j+V+W,T)}if(1&I||I>10||I<4)throw new he;P=(10-I)/2,N=9-(q=e.INSIDE_ODD_WIDEST[P]),L=ta.getRSSvalue(f,q,!0),V=ta.getRSSvalue(p,N,!1);var q,k=e.INSIDE_ODD_TOTAL_SUBSET[P];return W=e.INSIDE_GSUM[P],new fu(V*k+L+W,T)},e.prototype.findFinderPattern=function(n,r){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=n.getSize(),a=!1,s=0;s<i&&r!==(a=!n.get(s));)s++;for(var c=0,u=s,d=s;d<i;d++)if(n.get(d)!==a)o[c]++;else{if(c===3){if(ui.isFinderPattern(o))return[u,d];u+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,c--}else c++;o[c]=1,a=!a}throw new he},e.prototype.parseFoundFinderPattern=function(n,r,o,i){for(var a=n.get(i[0]),s=i[0]-1;s>=0&&a!==n.get(s);)s--;s++;var c=i[0]-s,u=this.getDecodeFinderCounters(),d=new Int32Array(u.length);Nt.arraycopy(u,0,d,1,u.length-1),d[0]=c;var h=this.parseFinderValue(d,e.FINDER_PATTERNS),f=s,p=i[1];return o&&(f=n.getSize()-1-f,p=n.getSize()-1-p),new A2(h,[s,i[1]],f,p,r)},e.prototype.adjustOddEvenCounts=function(n,r){var o=ft.sum(new Int32Array(this.getOddCounts())),i=ft.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,c=!1,u=!1;n?(o>12?s=!0:o<4&&(a=!0),i>12?u=!0:i<4&&(c=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?u=!0:i<4&&(c=!0));var d=o+i-r,h=(1&o)==(n?1:0),f=(1&i)==1;if(d===1)if(h){if(f)throw new he;s=!0}else{if(!f)throw new he;u=!0}else if(d===-1)if(h){if(f)throw new he;a=!0}else{if(!f)throw new he;c=!0}else{if(d!==0)throw new he;if(h){if(!f)throw new he;o<i?(a=!0,u=!0):(s=!0,c=!0)}else if(f)throw new he}if(a){if(s)throw new he;ui.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&ui.decrement(this.getOddCounts(),this.getOddRoundingErrors()),c){if(u)throw new he;ui.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&ui.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(ui),q9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),na=function(t){function e(n){var r=t.call(this)||this;r.readers=[];var o=n?n.get(Pt.POSSIBLE_FORMATS):null,i=n&&n.get(Pt.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;return o&&((o.includes(Re.EAN_13)||o.includes(Re.UPC_A)||o.includes(Re.EAN_8)||o.includes(Re.UPC_E))&&r.readers.push(new xf(n)),o.includes(Re.CODE_39)&&r.readers.push(new y2(i)),o.includes(Re.CODE_128)&&r.readers.push(new m2),o.includes(Re.ITF)&&r.readers.push(new v2),o.includes(Re.RSS_14)&&r.readers.push(new x2),o.includes(Re.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new j9))),r.readers.length===0&&(r.readers.push(new xf(n)),r.readers.push(new y2),r.readers.push(new xf(n)),r.readers.push(new m2),r.readers.push(new v2),r.readers.push(new x2)),r}return q9(e,t),e.prototype.decodeRow=function(n,r,o){for(var i=0;i<this.readers.length;i++)try{return this.readers[i].decodeRow(n,r,o)}catch{}throw new he},e.prototype.reset=function(){this.readers.forEach(function(n){return n.reset()})},e}(_n),H9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return n===void 0&&(n=500),t.call(this,new na(r),n,r)||this}H9(e,t)})(Zi);var un,O2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Et=function(){function t(e,n,r){this.ecCodewords=e,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),yt=function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),$9=function(){function t(e,n,r,o,i,a){var s,c;this.versionNumber=e,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var u=0,d=a.getECCodewords(),h=a.getECBlocks();try{for(var f=O2(h),p=f.next();!p.done;p=f.next()){var l=p.value;u+=l.getCount()*(l.getDataCodewords()+d)}}catch(g){s={error:g}}finally{try{p&&!p.done&&(c=f.return)&&c.call(f)}finally{if(s)throw s.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,n){var r,o;if(1&e||1&n)throw new Se;try{for(var i=O2(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===n)return s}}catch(c){r={error:c}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}throw new Se},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new Et(5,new yt(1,3))),new t(2,12,12,10,10,new Et(7,new yt(1,5))),new t(3,14,14,12,12,new Et(10,new yt(1,8))),new t(4,16,16,14,14,new Et(12,new yt(1,12))),new t(5,18,18,16,16,new Et(14,new yt(1,18))),new t(6,20,20,18,18,new Et(18,new yt(1,22))),new t(7,22,22,20,20,new Et(20,new yt(1,30))),new t(8,24,24,22,22,new Et(24,new yt(1,36))),new t(9,26,26,24,24,new Et(28,new yt(1,44))),new t(10,32,32,14,14,new Et(36,new yt(1,62))),new t(11,36,36,16,16,new Et(42,new yt(1,86))),new t(12,40,40,18,18,new Et(48,new yt(1,114))),new t(13,44,44,20,20,new Et(56,new yt(1,144))),new t(14,48,48,22,22,new Et(68,new yt(1,174))),new t(15,52,52,24,24,new Et(42,new yt(2,102))),new t(16,64,64,14,14,new Et(56,new yt(2,140))),new t(17,72,72,16,16,new Et(36,new yt(4,92))),new t(18,80,80,18,18,new Et(48,new yt(4,114))),new t(19,88,88,20,20,new Et(56,new yt(4,144))),new t(20,96,96,22,22,new Et(68,new yt(4,174))),new t(21,104,104,24,24,new Et(56,new yt(6,136))),new t(22,120,120,18,18,new Et(68,new yt(6,175))),new t(23,132,132,20,20,new Et(62,new yt(8,163))),new t(24,144,144,22,22,new Et(62,new yt(8,156),new yt(2,155))),new t(25,8,18,6,16,new Et(7,new yt(1,5))),new t(26,8,32,6,14,new Et(11,new yt(1,10))),new t(27,12,26,10,24,new Et(14,new yt(1,16))),new t(28,12,36,10,16,new Et(18,new yt(1,22))),new t(29,16,36,14,16,new Et(24,new yt(1,32))),new t(30,16,48,14,22,new Et(28,new yt(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),Y9=function(){function t(e){var n=e.getHeight();if(n<8||n>144||1&n)throw new Se;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new oo(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(e){var n=e.getHeight(),r=e.getWidth();return $9.getVersionForDimensions(n,r)},t.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,c=!1,u=!1,d=!1;do if(r!==i||o!==0||s)if(r!==i-2||o!==0||!(3&a)||c)if(r!==i+4||o!==2||7&a||u)if(r!==i-2||o!==0||(7&a)!=4||d){do r<i&&o>=0&&!this.readMappingMatrix.get(o,r)&&(e[n++]=255&this.readUtah(r,o,i,a)),r-=2,o+=2;while(r>=0&&o<a);r+=1,o+=3;do r>=0&&o<a&&!this.readMappingMatrix.get(o,r)&&(e[n++]=255&this.readUtah(r,o,i,a)),r+=2,o-=2;while(r<i&&o>=0);r+=3,o+=1}else e[n++]=255&this.readCorner4(i,a),r-=2,o+=2,d=!0;else e[n++]=255&this.readCorner3(i,a),r-=2,o+=2,u=!0;else e[n++]=255&this.readCorner2(i,a),r-=2,o+=2,c=!0;else e[n++]=255&this.readCorner1(i,a),r-=2,o+=2,s=!0;while(r<i||o<a);if(n!==this.version.getTotalCodewords())throw new Se;return e},t.prototype.readModule=function(e,n,r,o){return e<0&&(e+=r,n+=4-(r+4&7)),n<0&&(n+=o,e+=4-(o+4&7)),this.readMappingMatrix.set(n,e),this.mappingBitMatrix.get(n,e)},t.prototype.readUtah=function(e,n,r,o){var i=0;return this.readModule(e-2,n-2,r,o)&&(i|=1),i<<=1,this.readModule(e-2,n-1,r,o)&&(i|=1),i<<=1,this.readModule(e-1,n-2,r,o)&&(i|=1),i<<=1,this.readModule(e-1,n-1,r,o)&&(i|=1),i<<=1,this.readModule(e-1,n,r,o)&&(i|=1),i<<=1,this.readModule(e,n-2,r,o)&&(i|=1),i<<=1,this.readModule(e,n-1,r,o)&&(i|=1),i<<=1,this.readModule(e,n,r,o)&&(i|=1),i},t.prototype.readCorner1=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,1,e,n)&&(r|=1),r<<=1,this.readModule(e-1,2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.readCorner2=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-4,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner3=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-3,e,n)&&(r|=1),r<<=1,this.readModule(1,n-2,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner4=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.extractDataRegion=function(e){var n=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==n)throw new Ve("Dimension of bitMatrix must match the version size");for(var o=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=n/o|0,s=r/i|0,c=new oo(s*i,a*o),u=0;u<a;++u)for(var d=u*o,h=0;h<s;++h)for(var f=h*i,p=0;p<o;++p)for(var l=u*(o+2)+1+p,g=d+p,m=0;m<i;++m){var y=h*(i+2)+1+m;if(e.get(y,l)){var w=f+m;c.set(w,g)}}return c},t}(),P2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},W9=function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n){var r,o,i,a,s=n.getECBlocks(),c=0,u=s.getECBlocks();try{for(var d=P2(u),h=d.next();!h.done;h=d.next())c+=(m=h.value).getCount()}catch(W){r={error:W}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}var f=new Array(c),p=0;try{for(var l=P2(u),g=l.next();!g.done;g=l.next())for(var m=g.value,y=0;y<m.getCount();y++){var w=m.getDataCodewords(),b=s.getECCodewords()+w;f[p++]=new t(w,new Uint8Array(b))}}catch(W){i={error:W}}finally{try{g&&!g.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var E=f[0].codewords.length-s.getECCodewords(),C=E-1,I=0;for(y=0;y<C;y++)for(var T=0;T<p;T++)f[T].codewords[y]=e[I++];var P=n.getVersionNumber()===24,N=P?8:p;for(T=0;T<N;T++)f[T].codewords[E-1]=e[I++];var L=f[0].codewords.length;for(y=E;y<L;y++)for(T=0;T<p;T++){var V=P?(T+8)%p:T,j=P&&V>7?y-1:y;f[V].codewords[j]=e[I++]}if(I!==e.length)throw new Ve;return f},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),k2=function(){function t(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Ve(""+e);var n=0,r=this.bitOffset,o=this.byteOffset,i=this.bytes;if(r>0){var a=8-r,s=e<a?e:a,c=255>>8-s<<(u=a-s);n=(i[o]&c)>>u,e-=s,(r+=s)===8&&(r=0,o++)}if(e>0){for(;e>=8;)n=n<<8|255&i[o],o++,e-=8;if(e>0){var u;c=255>>(u=8-e)<<u,n=n<<e|(i[o]&c)>>u,r+=e}}return this.bitOffset=r,this.byteOffset=o,n},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();(function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"})(un||(un={}));var ra,K9=function(){function t(){}return t.decode=function(e){var n=new k2(e),r=new xt,o=new xt,i=new Array,a=un.ASCII_ENCODE;do if(a===un.ASCII_ENCODE)a=this.decodeAsciiSegment(n,r,o);else{switch(a){case un.C40_ENCODE:this.decodeC40Segment(n,r);break;case un.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case un.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case un.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case un.BASE256_ENCODE:this.decodeBase256Segment(n,r,i);break;default:throw new Se}a=un.ASCII_ENCODE}while(a!==un.PAD_ENCODE&&n.available()>0);return o.length()>0&&r.append(o.toString()),new cu(e,r.toString(),i.length===0?null:i,null)},t.decodeAsciiSegment=function(e,n,r){var o=!1;do{var i=e.readBits(8);if(i===0)throw new Se;if(i<=128)return o&&(i+=128),n.append(String.fromCharCode(i-1)),un.ASCII_ENCODE;if(i===129)return un.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&n.append("0"),n.append(""+a)}else switch(i){case 230:return un.C40_ENCODE;case 231:return un.BASE256_ENCODE;case 232:n.append("");break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:n.append("[)>05"),r.insert(0,"");break;case 237:n.append("[)>06"),r.insert(0,"");break;case 238:return un.ANSIX12_ENCODE;case 239:return un.TEXT_ENCODE;case 240:return un.EDIFACT_ENCODE;default:if(i!==254||e.available()!==0)throw new Se}}while(e.available()>0);return un.ASCII_ENCODE},t.decodeC40Segment=function(e,n){var r=!1,o=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),o);for(var s=0;s<3;s++){var c=o[s];switch(i){case 0:if(c<3)i=c+1;else{if(!(c<this.C40_BASIC_SET_CHARS.length))throw new Se;var u=this.C40_BASIC_SET_CHARS[c];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}break;case 1:r?(n.append(String.fromCharCode(c+128)),r=!1):n.append(String.fromCharCode(c)),i=0;break;case 2:if(c<this.C40_SHIFT2_SET_CHARS.length)u=this.C40_SHIFT2_SET_CHARS[c],r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u);else switch(c){case 27:n.append("");break;case 30:r=!0;break;default:throw new Se}i=0;break;case 3:r?(n.append(String.fromCharCode(c+224)),r=!1):n.append(String.fromCharCode(c+96)),i=0;break;default:throw new Se}}}while(e.available()>0)},t.decodeTextSegment=function(e,n){var r=!1,o=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),o);for(var s=0;s<3;s++){var c=o[s];switch(i){case 0:if(c<3)i=c+1;else{if(!(c<this.TEXT_BASIC_SET_CHARS.length))throw new Se;var u=this.TEXT_BASIC_SET_CHARS[c];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}break;case 1:r?(n.append(String.fromCharCode(c+128)),r=!1):n.append(String.fromCharCode(c)),i=0;break;case 2:if(c<this.TEXT_SHIFT2_SET_CHARS.length)u=this.TEXT_SHIFT2_SET_CHARS[c],r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u);else switch(c){case 27:n.append("");break;case 30:r=!0;break;default:throw new Se}i=0;break;case 3:if(!(c<this.TEXT_SHIFT3_SET_CHARS.length))throw new Se;u=this.TEXT_SHIFT3_SET_CHARS[c],r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u),i=0;break;default:throw new Se}}}while(e.available()>0)},t.decodeAnsiX12Segment=function(e,n){var r=[];do{if(e.available()===8)return;var o=e.readBits(8);if(o===254)return;this.parseTwoBytes(o,e.readBits(8),r);for(var i=0;i<3;i++){var a=r[i];switch(a){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(a<14)n.append(String.fromCharCode(a+44));else{if(!(a<40))throw new Se;n.append(String.fromCharCode(a+51))}}}}while(e.available()>0)},t.parseTwoBytes=function(e,n,r){var o=(e<<8)+n-1,i=Math.floor(o/1600);r[0]=i,o-=1600*i,i=Math.floor(o/40),r[1]=i,r[2]=o-40*i},t.decodeEdifactSegment=function(e,n){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var o=e.readBits(6);if(o===31){var i=8-e.getBitOffset();return void(i!==8&&e.readBits(i))}!(32&o)&&(o|=64),n.append(String.fromCharCode(o))}}while(e.available()>0)},t.decodeBase256Segment=function(e,n,r){var o,i=1+e.getByteOffset(),a=this.unrandomize255State(e.readBits(8),i++);if((o=a===0?e.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(e.readBits(8),i++))<0)throw new Se;for(var s=new Uint8Array(o),c=0;c<o;c++){if(e.available()<8)throw new Se;s[c]=this.unrandomize255State(e.readBits(8),i++)}r.push(s);try{n.append(ci.decode(s,pn.ISO88591))}catch(u){throw new gs("Platform does not support required encoding: "+u.message)}},t.unrandomize255State=function(e,n){var r=e-(149*n%255+1);return r>=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""],t}(),z9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},X9=function(){function t(){this.rsDecoder=new lu(Mo.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(e){var n,r,o=new Y9(e),i=o.getVersion(),a=o.readCodewords(),s=W9.getDataBlocks(a,i),c=0;try{for(var u=z9(s),d=u.next();!d.done;d=u.next())c+=d.value.getNumDataCodewords()}catch(w){n={error:w}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}for(var h=new Uint8Array(c),f=s.length,p=0;p<f;p++){var l=s[p],g=l.getCodewords(),m=l.getNumDataCodewords();this.correctErrors(g,m);for(var y=0;y<m;y++)h[y*f+p]=g[y]}return K9.decode(h)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new sn}for(var o=0;o<n;o++)e[o]=r[o]},t}(),Q9=function(){function t(e){this.image=e,this.rectangleDetector=new Af(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),n=this.detectSolid1(e);if((n=this.detectSolid2(n))[3]=this.correctTopRight(n),!n[3])throw new he;var r=(n=this.shiftToModuleCenter(n))[0],o=n[1],i=n[2],a=n[3],s=this.transitionsBetween(r,a)+1,c=this.transitionsBetween(i,a)+1;(1&s)==1&&(s+=1),(1&c)==1&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c));var u=t.sampleGrid(this.image,r,o,i,a,s,c);return new _f(u,[r,o,i,a])},t.shiftPoint=function(e,n,r){var o=(n.getX()-e.getX())/(r+1),i=(n.getY()-e.getY())/(r+1);return new Pe(e.getX()+o,e.getY()+i)},t.moveAway=function(e,n,r){var o=e.getX(),i=e.getY();return o<n?o-=1:o+=1,i<r?i-=1:i+=1,new Pe(o,i)},t.prototype.detectSolid1=function(e){var n=e[0],r=e[1],o=e[3],i=e[2],a=this.transitionsBetween(n,r),s=this.transitionsBetween(r,o),c=this.transitionsBetween(o,i),u=this.transitionsBetween(i,n),d=a,h=[i,n,r,o];return d>s&&(d=s,h[0]=n,h[1]=r,h[2]=o,h[3]=i),d>c&&(d=c,h[0]=r,h[1]=o,h[2]=i,h[3]=n),d>u&&(h[0]=o,h[1]=i,h[2]=n,h[3]=r),h},t.prototype.detectSolid2=function(e){var n=e[0],r=e[1],o=e[2],i=e[3],a=this.transitionsBetween(n,i),s=t.shiftPoint(r,o,4*(a+1)),c=t.shiftPoint(o,r,4*(a+1));return this.transitionsBetween(s,n)<this.transitionsBetween(c,i)?(e[0]=n,e[1]=r,e[2]=o,e[3]=i):(e[0]=r,e[1]=o,e[2]=i,e[3]=n),e},t.prototype.correctTopRight=function(e){var n=e[0],r=e[1],o=e[2],i=e[3],a=this.transitionsBetween(n,i),s=this.transitionsBetween(r,i),c=t.shiftPoint(n,r,4*(s+1)),u=t.shiftPoint(o,r,4*(a+1));a=this.transitionsBetween(c,i),s=this.transitionsBetween(u,i);var d=new Pe(i.getX()+(o.getX()-r.getX())/(a+1),i.getY()+(o.getY()-r.getY())/(a+1)),h=new Pe(i.getX()+(n.getX()-r.getX())/(s+1),i.getY()+(n.getY()-r.getY())/(s+1));return this.isValid(d)?this.isValid(h)?this.transitionsBetween(c,d)+this.transitionsBetween(u,d)>this.transitionsBetween(c,h)+this.transitionsBetween(u,h)?d:h:d:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var n=e[0],r=e[1],o=e[2],i=e[3],a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1,c=t.shiftPoint(n,r,4*s),u=t.shiftPoint(o,r,4*a);(1&(a=this.transitionsBetween(c,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(u,i)+1))==1&&(s+=1);var d,h,f=(n.getX()+r.getX()+o.getX()+i.getX())/4,p=(n.getY()+r.getY()+o.getY()+i.getY())/4;return n=t.moveAway(n,f,p),r=t.moveAway(r,f,p),o=t.moveAway(o,f,p),i=t.moveAway(i,f,p),c=t.shiftPoint(n,r,4*s),c=t.shiftPoint(c,i,4*a),d=t.shiftPoint(r,n,4*s),d=t.shiftPoint(d,o,4*a),u=t.shiftPoint(o,i,4*s),u=t.shiftPoint(u,r,4*a),h=t.shiftPoint(i,o,4*s),[c,d,u,h=t.shiftPoint(h,n,4*a)]},t.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},t.sampleGrid=function(e,n,r,o,i,a,s){return Sf.getInstance().sampleGrid(e,a,s,.5,.5,a-.5,.5,a-.5,s-.5,.5,s-.5,n.getX(),n.getY(),i.getX(),i.getY(),o.getX(),o.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(e,n){var r=Math.trunc(e.getX()),o=Math.trunc(e.getY()),i=Math.trunc(n.getX()),a=Math.trunc(n.getY()),s=Math.abs(a-o)>Math.abs(i-r);if(s){var c=r;r=o,o=c,c=i,i=a,a=c}for(var u=Math.abs(i-r),d=Math.abs(a-o),h=-u/2,f=o<a?1:-1,p=r<i?1:-1,l=0,g=this.image.get(s?o:r,s?r:o),m=r,y=o;m!==i;m+=p){var w=this.image.get(s?y:m,s?m:y);if(w!==g&&(l++,g=w),(h+=d)>0){if(y===a)break;y+=f,h-=u}}return l},t}(),yu=function(){function t(){this.decoder=new X9}return t.prototype.decode=function(e,n){var r,o;if(n===void 0&&(n=null),n!=null&&n.has(Pt.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new Q9(e.getBlackMatrix()).detect();r=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=r.getRawBytes(),c=new Wn(r.getText(),s,8*s.length,o,Re.DATA_MATRIX,Nt.currentTimeMillis()),u=r.getByteSegments();u!=null&&c.putMetadata(Cn.BYTE_SEGMENTS,u);var d=r.getECLevel();return d!=null&&c.putMetadata(Cn.ERROR_CORRECTION_LEVEL,d),c},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n==null||r==null)throw new he;var o=this.moduleSize(n,e),i=n[1],a=r[1],s=n[0],c=(r[0]-s+1)/o,u=(a-i+1)/o;if(c<=0||u<=0)throw new he;var d=o/2;i+=d,s+=d;for(var h=new oo(c,u),f=0;f<u;f++)for(var p=i+f*o,l=0;l<c;l++)e.get(s+l*o,p)&&h.set(l,f);return h},t.moduleSize=function(e,n){for(var r=n.getWidth(),o=e[0],i=e[1];o<r&&n.get(o,i);)o++;if(o===r)throw new he;var a=o-e[0];if(a===0)throw new he;return a},t.NO_POINTS=[],t}(),J9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new yu,n)||this}J9(e,t)})(Zi),function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(ra||(ra={}));var gn,Z9=function(){function t(e,n,r){this.value=e,this.stringValue=n,this.bits=r,t.FOR_BITS.set(r,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Ht(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new Ve;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(ra.L,"L",1),t.M=new t(ra.M,"M",0),t.Q=new t(ra.Q,"Q",3),t.H=new t(ra.H,"H",2),t}(),eI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},B2=function(){function t(e){this.errorCorrectionLevel=Z9.forBits(e>>3&3),this.dataMask=7&e}return t.numBitsDiffering=function(e,n){return bn.bitCount(e^n)},t.decodeFormatInformation=function(e,n){var r=t.doDecodeFormatInformation(e,n);return r!==null?r:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,n^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,n){var r,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=eI(t.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var u=c.value,d=u[0];if(d===e||d===n)return new t(u[1]);var h=t.numBitsDiffering(e,d);h<i&&(a=u[1],i=h),e!==n&&(h=t.numBitsDiffering(n,d))<i&&(a=u[1],i=h)}}catch(f){r={error:f}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t}(),tI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ie=function(){function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=n}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var e,n,r=0,o=this.ecBlocks;try{for(var i=tI(o),a=i.next();!a.done;a=i.next())r+=a.value.getCount()}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),D=function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),nI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vu=function(){function t(e,n){for(var r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=e,this.alignmentPatternCenters=n,this.ecBlocks=i;var s=0,c=i[0].getECCodewordsPerBlock(),u=i[0].getECBlocks();try{for(var d=nI(u),h=d.next();!h.done;h=d.next()){var f=h.value;s+=f.getCount()*(f.getDataCodewords()+c)}}catch(p){r={error:p}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}this.totalCodewords=s}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},t.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new Se;try{return this.getVersionForNumber((e-17)/4)}catch{throw new Se}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new Ve;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var n=Number.MAX_SAFE_INTEGER,r=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=B2.numBitsDiffering(e,i);a<n&&(r=o+7,n=a)}return n<=3?t.getVersionForNumber(r):null},t.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),n=new oo(e);n.setRegion(0,0,9,9),n.setRegion(e-8,0,8,9),n.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,o=0;o<r;o++)for(var i=this.alignmentPatternCenters[o]-2,a=0;a<r;a++)o===0&&(a===0||a===r-1)||o===r-1&&a===0||n.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return n.setRegion(6,9,1,e-17),n.setRegion(9,6,e-17,1),this.versionNumber>6&&(n.setRegion(e-11,0,3,6),n.setRegion(0,e-11,6,3)),n},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new ie(7,new D(1,19)),new ie(10,new D(1,16)),new ie(13,new D(1,13)),new ie(17,new D(1,9))),new t(2,Int32Array.from([6,18]),new ie(10,new D(1,34)),new ie(16,new D(1,28)),new ie(22,new D(1,22)),new ie(28,new D(1,16))),new t(3,Int32Array.from([6,22]),new ie(15,new D(1,55)),new ie(26,new D(1,44)),new ie(18,new D(2,17)),new ie(22,new D(2,13))),new t(4,Int32Array.from([6,26]),new ie(20,new D(1,80)),new ie(18,new D(2,32)),new ie(26,new D(2,24)),new ie(16,new D(4,9))),new t(5,Int32Array.from([6,30]),new ie(26,new D(1,108)),new ie(24,new D(2,43)),new ie(18,new D(2,15),new D(2,16)),new ie(22,new D(2,11),new D(2,12))),new t(6,Int32Array.from([6,34]),new ie(18,new D(2,68)),new ie(16,new D(4,27)),new ie(24,new D(4,19)),new ie(28,new D(4,15))),new t(7,Int32Array.from([6,22,38]),new ie(20,new D(2,78)),new ie(18,new D(4,31)),new ie(18,new D(2,14),new D(4,15)),new ie(26,new D(4,13),new D(1,14))),new t(8,Int32Array.from([6,24,42]),new ie(24,new D(2,97)),new ie(22,new D(2,38),new D(2,39)),new ie(22,new D(4,18),new D(2,19)),new ie(26,new D(4,14),new D(2,15))),new t(9,Int32Array.from([6,26,46]),new ie(30,new D(2,116)),new ie(22,new D(3,36),new D(2,37)),new ie(20,new D(4,16),new D(4,17)),new ie(24,new D(4,12),new D(4,13))),new t(10,Int32Array.from([6,28,50]),new ie(18,new D(2,68),new D(2,69)),new ie(26,new D(4,43),new D(1,44)),new ie(24,new D(6,19),new D(2,20)),new ie(28,new D(6,15),new D(2,16))),new t(11,Int32Array.from([6,30,54]),new ie(20,new D(4,81)),new ie(30,new D(1,50),new D(4,51)),new ie(28,new D(4,22),new D(4,23)),new ie(24,new D(3,12),new D(8,13))),new t(12,Int32Array.from([6,32,58]),new ie(24,new D(2,92),new D(2,93)),new ie(22,new D(6,36),new D(2,37)),new ie(26,new D(4,20),new D(6,21)),new ie(28,new D(7,14),new D(4,15))),new t(13,Int32Array.from([6,34,62]),new ie(26,new D(4,107)),new ie(22,new D(8,37),new D(1,38)),new ie(24,new D(8,20),new D(4,21)),new ie(22,new D(12,11),new D(4,12))),new t(14,Int32Array.from([6,26,46,66]),new ie(30,new D(3,115),new D(1,116)),new ie(24,new D(4,40),new D(5,41)),new ie(20,new D(11,16),new D(5,17)),new ie(24,new D(11,12),new D(5,13))),new t(15,Int32Array.from([6,26,48,70]),new ie(22,new D(5,87),new D(1,88)),new ie(24,new D(5,41),new D(5,42)),new ie(30,new D(5,24),new D(7,25)),new ie(24,new D(11,12),new D(7,13))),new t(16,Int32Array.from([6,26,50,74]),new ie(24,new D(5,98),new D(1,99)),new ie(28,new D(7,45),new D(3,46)),new ie(24,new D(15,19),new D(2,20)),new ie(30,new D(3,15),new D(13,16))),new t(17,Int32Array.from([6,30,54,78]),new ie(28,new D(1,107),new D(5,108)),new ie(28,new D(10,46),new D(1,47)),new ie(28,new D(1,22),new D(15,23)),new ie(28,new D(2,14),new D(17,15))),new t(18,Int32Array.from([6,30,56,82]),new ie(30,new D(5,120),new D(1,121)),new ie(26,new D(9,43),new D(4,44)),new ie(28,new D(17,22),new D(1,23)),new ie(28,new D(2,14),new D(19,15))),new t(19,Int32Array.from([6,30,58,86]),new ie(28,new D(3,113),new D(4,114)),new ie(26,new D(3,44),new D(11,45)),new ie(26,new D(17,21),new D(4,22)),new ie(26,new D(9,13),new D(16,14))),new t(20,Int32Array.from([6,34,62,90]),new ie(28,new D(3,107),new D(5,108)),new ie(26,new D(3,41),new D(13,42)),new ie(30,new D(15,24),new D(5,25)),new ie(28,new D(15,15),new D(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new ie(28,new D(4,116),new D(4,117)),new ie(26,new D(17,42)),new ie(28,new D(17,22),new D(6,23)),new ie(30,new D(19,16),new D(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new ie(28,new D(2,111),new D(7,112)),new ie(28,new D(17,46)),new ie(30,new D(7,24),new D(16,25)),new ie(24,new D(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new ie(30,new D(4,121),new D(5,122)),new ie(28,new D(4,47),new D(14,48)),new ie(30,new D(11,24),new D(14,25)),new ie(30,new D(16,15),new D(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new ie(30,new D(6,117),new D(4,118)),new ie(28,new D(6,45),new D(14,46)),new ie(30,new D(11,24),new D(16,25)),new ie(30,new D(30,16),new D(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new ie(26,new D(8,106),new D(4,107)),new ie(28,new D(8,47),new D(13,48)),new ie(30,new D(7,24),new D(22,25)),new ie(30,new D(22,15),new D(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new ie(28,new D(10,114),new D(2,115)),new ie(28,new D(19,46),new D(4,47)),new ie(28,new D(28,22),new D(6,23)),new ie(30,new D(33,16),new D(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new ie(30,new D(8,122),new D(4,123)),new ie(28,new D(22,45),new D(3,46)),new ie(30,new D(8,23),new D(26,24)),new ie(30,new D(12,15),new D(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new ie(30,new D(3,117),new D(10,118)),new ie(28,new D(3,45),new D(23,46)),new ie(30,new D(4,24),new D(31,25)),new ie(30,new D(11,15),new D(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new ie(30,new D(7,116),new D(7,117)),new ie(28,new D(21,45),new D(7,46)),new ie(30,new D(1,23),new D(37,24)),new ie(30,new D(19,15),new D(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new ie(30,new D(5,115),new D(10,116)),new ie(28,new D(19,47),new D(10,48)),new ie(30,new D(15,24),new D(25,25)),new ie(30,new D(23,15),new D(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new ie(30,new D(13,115),new D(3,116)),new ie(28,new D(2,46),new D(29,47)),new ie(30,new D(42,24),new D(1,25)),new ie(30,new D(23,15),new D(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new ie(30,new D(17,115)),new ie(28,new D(10,46),new D(23,47)),new ie(30,new D(10,24),new D(35,25)),new ie(30,new D(19,15),new D(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new ie(30,new D(17,115),new D(1,116)),new ie(28,new D(14,46),new D(21,47)),new ie(30,new D(29,24),new D(19,25)),new ie(30,new D(11,15),new D(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new ie(30,new D(13,115),new D(6,116)),new ie(28,new D(14,46),new D(23,47)),new ie(30,new D(44,24),new D(7,25)),new ie(30,new D(59,16),new D(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new ie(30,new D(12,121),new D(7,122)),new ie(28,new D(12,47),new D(26,48)),new ie(30,new D(39,24),new D(14,25)),new ie(30,new D(22,15),new D(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new ie(30,new D(6,121),new D(14,122)),new ie(28,new D(6,47),new D(34,48)),new ie(30,new D(46,24),new D(10,25)),new ie(30,new D(2,15),new D(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new ie(30,new D(17,122),new D(4,123)),new ie(28,new D(29,46),new D(14,47)),new ie(30,new D(49,24),new D(10,25)),new ie(30,new D(24,15),new D(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new ie(30,new D(4,122),new D(18,123)),new ie(28,new D(13,46),new D(32,47)),new ie(30,new D(48,24),new D(14,25)),new ie(30,new D(42,15),new D(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new ie(30,new D(20,117),new D(4,118)),new ie(28,new D(40,47),new D(7,48)),new ie(30,new D(43,24),new D(22,25)),new ie(30,new D(10,15),new D(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new ie(30,new D(19,118),new D(6,119)),new ie(28,new D(18,47),new D(31,48)),new ie(30,new D(34,24),new D(34,25)),new ie(30,new D(20,15),new D(61,16)))],t}();(function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"})(gn||(gn={}));var vr,N2=function(){function t(e,n){this.value=e,this.isMasked=n}return t.prototype.unmaskBitMatrix=function(e,n){for(var r=0;r<n;r++)for(var o=0;o<n;o++)this.isMasked(r,o)&&e.flip(o,r)},t.values=new Map([[gn.DATA_MASK_000,new t(gn.DATA_MASK_000,function(e,n){return(e+n&1)==0})],[gn.DATA_MASK_001,new t(gn.DATA_MASK_001,function(e,n){return(1&e)==0})],[gn.DATA_MASK_010,new t(gn.DATA_MASK_010,function(e,n){return n%3==0})],[gn.DATA_MASK_011,new t(gn.DATA_MASK_011,function(e,n){return(e+n)%3==0})],[gn.DATA_MASK_100,new t(gn.DATA_MASK_100,function(e,n){return(Math.floor(e/2)+Math.floor(n/3)&1)==0})],[gn.DATA_MASK_101,new t(gn.DATA_MASK_101,function(e,n){return e*n%6==0})],[gn.DATA_MASK_110,new t(gn.DATA_MASK_110,function(e,n){return e*n%6<3})],[gn.DATA_MASK_111,new t(gn.DATA_MASK_111,function(e,n){return(e+n+e*n%3&1)==0})]]),t}(),rI=function(){function t(e){var n=e.getHeight();if(n<21||(3&n)!=1)throw new Se;this.bitMatrix=e}return t.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,n=0;n<6;n++)e=this.copyBit(n,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var r=5;r>=0;r--)e=this.copyBit(8,r,e);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(r=o-1;r>=a;r--)i=this.copyBit(8,r,i);for(n=o-8;n<o;n++)i=this.copyBit(n,8,i);if(this.parsedFormatInfo=B2.decodeFormatInformation(e,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new Se},t.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),n=Math.floor((e-17)/4);if(n<=6)return vu.getVersionForNumber(n);for(var r=0,o=e-11,i=5;i>=0;i--)for(var a=e-9;a>=o;a--)r=this.copyBit(a,i,r);var s=vu.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;for(r=0,a=5;a>=0;a--)for(i=e-9;i>=o;i--)r=this.copyBit(a,i,r);if((s=vu.decodeVersionInformation(r))!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;throw new Se},t.prototype.copyBit=function(e,n,r){return(this.isMirror?this.bitMatrix.get(n,e):this.bitMatrix.get(e,n))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var e=this.readFormatInformation(),n=this.readVersion(),r=N2.values.get(e.getDataMask()),o=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,o);for(var i=n.buildFunctionPattern(),a=!0,s=new Uint8Array(n.getTotalCodewords()),c=0,u=0,d=0,h=o-1;h>0;h-=2){h===6&&h--;for(var f=0;f<o;f++)for(var p=a?o-1-f:f,l=0;l<2;l++)i.get(h-l,p)||(d++,u<<=1,this.bitMatrix.get(h-l,p)&&(u|=1),d===8&&(s[c++]=u,d=0,u=0));a=!a}if(c!==n.getTotalCodewords())throw new Se;return s},t.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=N2.values[this.parsedFormatInfo.getDataMask()],n=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,n)}},t.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},t.prototype.mirror=function(){for(var e=this.bitMatrix,n=0,r=e.getWidth();n<r;n++)for(var o=n+1,i=e.getHeight();o<i;o++)e.get(n,o)!==e.get(o,n)&&(e.flip(o,n),e.flip(n,o))},t}(),R2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},oI=function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n,r){var o,i,a,s;if(e.length!==n.getTotalCodewords())throw new Ve;var c=n.getECBlocksForLevel(r),u=0,d=c.getECBlocks();try{for(var h=R2(d),f=h.next();!f.done;f=h.next())u+=(y=f.value).getCount()}catch(j){o={error:j}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var p=new Array(u),l=0;try{for(var g=R2(d),m=g.next();!m.done;m=g.next())for(var y=m.value,w=0;w<y.getCount();w++){var b=y.getDataCodewords(),E=c.getECCodewordsPerBlock()+b;p[l++]=new t(b,new Uint8Array(E))}}catch(j){a={error:j}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var C=p[0].codewords.length,I=p.length-1;I>=0&&p[I].codewords.length!==C;)I--;I++;var T=C-c.getECCodewordsPerBlock(),P=0;for(w=0;w<T;w++)for(var N=0;N<l;N++)p[N].codewords[w]=e[P++];for(N=I;N<l;N++)p[N].codewords[T]=e[P++];var L=p[0].codewords.length;for(w=T;w<L;w++)for(N=0;N<l;N++){var V=N<I?w:w+1;p[N].codewords[V]=e[P++]}return p},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();(function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"})(vr||(vr={}));var St,wu,ir=function(){function t(e,n,r,o){this.value=e,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var n=t.FOR_BITS.get(e);if(n===void 0)throw new Ve;return n},t.prototype.getCharacterCountBits=function(e){var n,r=e.getVersionNumber();return n=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[n]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(vr.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(vr.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(vr.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(vr.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(vr.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(vr.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(vr.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(vr.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(vr.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(vr.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),iI=function(){function t(){}return t.decode=function(e,n,r,o){var i=new k2(e),a=new xt,s=new Array,c=-1,u=-1;try{var d=null,h=!1,f=void 0;do{if(i.available()<4)f=ir.TERMINATOR;else{var p=i.readBits(4);f=ir.forBits(p)}switch(f){case ir.TERMINATOR:break;case ir.FNC1_FIRST_POSITION:case ir.FNC1_SECOND_POSITION:h=!0;break;case ir.STRUCTURED_APPEND:if(i.available()<16)throw new Se;c=i.readBits(8),u=i.readBits(8);break;case ir.ECI:var l=t.parseECIValue(i);if((d=Yn.getCharacterSetECIByValue(l))===null)throw new Se;break;case ir.HANZI:var g=i.readBits(4),m=i.readBits(f.getCharacterCountBits(n));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,m);break;default:var y=i.readBits(f.getCharacterCountBits(n));switch(f){case ir.NUMERIC:t.decodeNumericSegment(i,a,y);break;case ir.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,y,h);break;case ir.BYTE:t.decodeByteSegment(i,a,y,d,s,o);break;case ir.KANJI:t.decodeKanjiSegment(i,a,y);break;default:throw new Se}}}while(f!==ir.TERMINATOR)}catch{throw new Se}return new cu(e,a.toString(),s.length===0?null:s,r===null?null:r.toString(),c,u)},t.decodeHanziSegment=function(e,n,r){if(13*r>e.available())throw new Se;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=e.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,r--}try{n.append(ci.decode(o,pn.GB2312))}catch(c){throw new Se(c)}},t.decodeKanjiSegment=function(e,n,r){if(13*r>e.available())throw new Se;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=e.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,r--}try{n.append(ci.decode(o,pn.SHIFT_JIS))}catch(c){throw new Se(c)}},t.decodeByteSegment=function(e,n,r,o,i,a){if(8*r>e.available())throw new Se;for(var s,c=new Uint8Array(r),u=0;u<r;u++)c[u]=e.readBits(8);s=o===null?pn.guessEncoding(c,a):o.getName();try{n.append(ci.decode(c,s))}catch(d){throw new Se(d)}i.push(c)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new Se;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,n,r,o){for(var i=n.length();r>1;){if(e.available()<11)throw new Se;var a=e.readBits(11);n.append(t.toAlphaNumericChar(Math.floor(a/45))),n.append(t.toAlphaNumericChar(a%45)),r-=2}if(r===1){if(e.available()<6)throw new Se;n.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<n.length();s++)n.charAt(s)==="%"&&(s<n.length()-1&&n.charAt(s+1)==="%"?n.deleteCharAt(s+1):n.setCharAt(s,""))},t.decodeNumericSegment=function(e,n,r){for(;r>=3;){if(e.available()<10)throw new Se;var o=e.readBits(10);if(o>=1e3)throw new Se;n.append(t.toAlphaNumericChar(Math.floor(o/100))),n.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),n.append(t.toAlphaNumericChar(o%10)),r-=3}if(r===2){if(e.available()<7)throw new Se;var i=e.readBits(7);if(i>=100)throw new Se;n.append(t.toAlphaNumericChar(Math.floor(i/10))),n.append(t.toAlphaNumericChar(i%10))}else if(r===1){if(e.available()<4)throw new Se;var a=e.readBits(4);if(a>=10)throw new Se;n.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(e){var n=e.readBits(8);if(!(128&n))return 127&n;if((192&n)==128)return(63&n)<<8&4294967295|e.readBits(8);if((224&n)==192)return(31&n)<<16&4294967295|e.readBits(16);throw new Se},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),D2=function(){function t(e){this.mirrored=e}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(e){if(this.mirrored&&e!==null&&!(e.length<3)){var n=e[0];e[0]=e[2],e[2]=n}},t}(),M2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},aI=function(){function t(){this.rsDecoder=new lu(Mo.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(e,n){return this.decodeBitMatrix(oo.parseFromBooleanArray(e),n)},t.prototype.decodeBitMatrix=function(e,n){var r=new rI(e),o=null;try{return this.decodeBitMatrixParser(r,n)}catch(a){o=a}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,n);return i.setOther(new D2(!0)),i}catch(a){throw o!==null?o:a}},t.prototype.decodeBitMatrixParser=function(e,n){var r,o,i,a,s=e.readVersion(),c=e.readFormatInformation().getErrorCorrectionLevel(),u=e.readCodewords(),d=oI.getDataBlocks(u,s,c),h=0;try{for(var f=M2(d),p=f.next();!p.done;p=f.next())h+=(w=p.value).getNumDataCodewords()}catch(I){r={error:I}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}var l=new Uint8Array(h),g=0;try{for(var m=M2(d),y=m.next();!y.done;y=m.next()){var w,b=(w=y.value).getCodewords(),E=w.getNumDataCodewords();this.correctErrors(b,E);for(var C=0;C<E;C++)l[g++]=b[C]}}catch(I){i={error:I}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}return iI.decode(l,s,c,n)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new sn}for(var o=0;o<n;o++)e[o]=r[o]},t}(),sI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cI=function(t){function e(n,r,o){var i=t.call(this,n,r)||this;return i.estimatedModuleSize=o,i}return sI(e,t),e.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,o){return new e((this.getX()+r)/2,(this.getY()+n)/2,(this.estimatedModuleSize+o)/2)},e}(Pe),uI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},lI=function(){function t(e,n,r,o,i,a,s){this.image=e,this.startX=n,this.startY=r,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var e=this.startX,n=this.height,r=e+this.width,o=this.startY+n/2,i=new Int32Array(3),a=this.image,s=0;s<n;s++){var c=o+(1&s?-Math.floor((s+1)/2):Math.floor((s+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var u=e;u<r&&!a.get(u,c);)u++;for(var d=0;u<r;){if(a.get(u,c))if(d===1)i[1]++;else if(d===2){var h;if(this.foundPatternCross(i)&&(h=this.handlePossibleCenter(i,c,u))!==null)return h;i[0]=i[2],i[1]=1,i[2]=0,d=1}else i[++d]++;else d===1&&d++,i[d]++;u++}if(this.foundPatternCross(i)&&(h=this.handlePossibleCenter(i,c,r))!==null)return h}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new he},t.centerFromEnd=function(e,n){return n-e[2]-e[1]/2},t.prototype.foundPatternCross=function(e){for(var n=this.moduleSize,r=n/2,o=0;o<3;o++)if(Math.abs(n-e[o])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,n,r,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=e;c>=0&&i.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&!i.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<a&&i.get(n,c)&&s[1]<=r;)s[1]++,c++;if(c===a||s[1]>r)return NaN;for(;c<a&&!i.get(n,c)&&s[2]<=r;)s[2]++,c++;if(s[2]>r)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,n,r){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,r),c=this.crossCheckVertical(n,s,2*e[1],a);if(!isNaN(c)){var u=(e[0]+e[1]+e[2])/3;try{for(var d=uI(this.possibleCenters),h=d.next();!h.done;h=d.next()){var f=h.value;if(f.aboutEquals(u,c,s))return f.combineEstimate(c,s,u)}}catch(l){o={error:l}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}var p=new cI(s,c,u);this.possibleCenters.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return null},t}(),dI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),fI=function(t){function e(n,r,o,i){var a=t.call(this,n,r)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return dI(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,o){var i=this.count+1;return new e((this.count*this.getX()+r)/i,(this.count*this.getY()+n)/i,(this.count*this.estimatedModuleSize+o)/i,i)},e}(Pe),hI=function(){function t(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),ms=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},pI=function(){function t(e,n){this.image=e,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var n=e!=null&&e.get(Pt.TRY_HARDER)!==void 0,r=e!=null&&e.get(Pt.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||n)&&(s=t.MIN_SKIP);for(var c=!1,u=new Int32Array(5),d=s-1;d<i&&!c;d+=s){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var h=0,f=0;f<a;f++)if(o.get(f,d))(1&h)==1&&h++,u[h]++;else if(1&h)u[h]++;else if(h===4)if(t.foundPatternCross(u)){if(this.handlePossibleCenter(u,d,f,r)!==!0){u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,h=3;continue}if(s=2,this.hasSkipped===!0)c=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>u[2]&&(d+=p-u[2]-s,f=a-1)}h=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,h=3;else u[++h]++;t.foundPatternCross(u)&&this.handlePossibleCenter(u,d,a,r)===!0&&(s=u[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}var l=this.selectBestPatterns();return Pe.orderBestPatterns(l),new hI(l)},t.centerFromEnd=function(e,n){return n-e[4]-e[3]-e[2]/2},t.foundPatternCross=function(e){for(var n=0,r=0;r<5;r++){var o=e[r];if(o===0)return!1;n+=o}if(n<7)return!1;var i=n/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},t.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},t.prototype.crossCheckDiagonal=function(e,n,r,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&n>=a&&s.get(n-a,e-a);)i[2]++,a++;if(e<a||n<a)return!1;for(;e>=a&&n>=a&&!s.get(n-a,e-a)&&i[1]<=r;)i[1]++,a++;if(e<a||n<a||i[1]>r)return!1;for(;e>=a&&n>=a&&s.get(n-a,e-a)&&i[0]<=r;)i[0]++,a++;if(i[0]>r)return!1;var c=s.getHeight(),u=s.getWidth();for(a=1;e+a<c&&n+a<u&&s.get(n+a,e+a);)i[2]++,a++;if(e+a>=c||n+a>=u)return!1;for(;e+a<c&&n+a<u&&!s.get(n+a,e+a)&&i[3]<r;)i[3]++,a++;if(e+a>=c||n+a>=u||i[3]>=r)return!1;for(;e+a<c&&n+a<u&&s.get(n+a,e+a)&&i[4]<r;)i[4]++,a++;if(i[4]>=r)return!1;var d=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(d-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,n,r,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),c=e;c>=0&&i.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&i.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<a&&i.get(n,c);)s[2]++,c++;if(c===a)return NaN;for(;c<a&&!i.get(n,c)&&s[3]<r;)s[3]++,c++;if(c===a||s[3]>=r)return NaN;for(;c<a&&i.get(n,c)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.crossCheckHorizontal=function(e,n,r,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),c=e;c>=0&&i.get(c,n);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(c,n)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&i.get(c,n)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<a&&i.get(c,n);)s[2]++,c++;if(c===a)return NaN;for(;c<a&&!i.get(c,n)&&s[3]<r;)s[3]++,c++;if(c===a||s[3]>=r)return NaN;for(;c<a&&i.get(c,n)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,n,r,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,r),s=this.crossCheckVertical(n,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var c=i/7,u=!1,d=this.possibleCenters,h=0,f=d.length;h<f;h++){var p=d[h];if(p.aboutEquals(c,s,a)){d[h]=p.combineEstimate(s,a,c),u=!0;break}}if(!u){var l=new fI(a,s,c);d.push(l),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(l)}return!0}return!1},t.prototype.findRowSkip=function(){var e,n;if(this.possibleCenters.length<=1)return 0;var r=null;try{for(var o=ms(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM){if(r!=null)return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-a.getX())-Math.abs(r.getY()-a.getY()))/2);r=a}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,n,r,o,i=0,a=0,s=this.possibleCenters.length;try{for(var c=ms(this.possibleCenters),u=c.next();!u.done;u=c.next())(l=u.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=l.getEstimatedModuleSize())}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(i<3)return!1;var d=a/s,h=0;try{for(var f=ms(this.possibleCenters),p=f.next();!p.done;p=f.next()){var l=p.value;h+=Math.abs(l.getEstimatedModuleSize()-d)}}catch(g){r={error:g}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}return h<=.05*a},t.prototype.selectBestPatterns=function(){var e,n,r,o,i=this.possibleCenters.length;if(i<3)throw new he;var a,s=this.possibleCenters;if(i>3){var c=0,u=0;try{for(var d=ms(this.possibleCenters),h=d.next();!h.done;h=d.next()){var f=h.value.getEstimatedModuleSize();c+=f,u+=f*f}}catch(b){e={error:b}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}a=c/i;var p=Math.sqrt(u/i-a*a);s.sort(function(b,E){var C=Math.abs(E.getEstimatedModuleSize()-a),I=Math.abs(b.getEstimatedModuleSize()-a);return C<I?-1:C>I?1:0});for(var l=Math.max(.2*a,p),g=0;g<s.length&&s.length>3;g++){var m=s[g];Math.abs(m.getEstimatedModuleSize()-a)>l&&(s.splice(g,1),g--)}}if(s.length>3){c=0;try{for(var y=ms(s),w=y.next();!w.done;w=y.next())c+=w.value.getEstimatedModuleSize()}catch(b){r={error:b}}finally{try{w&&!w.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}a=c/s.length,s.sort(function(b,E){if(E.getCount()===b.getCount()){var C=Math.abs(E.getEstimatedModuleSize()-a),I=Math.abs(b.getEstimatedModuleSize()-a);return C<I?1:C>I?-1:0}return E.getCount()-b.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),gI=function(){function t(e){this.image=e}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(Pt.NEED_RESULT_POINT_CALLBACK);var n=new pI(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(n)},t.prototype.processFinderPatternInfo=function(e){var n=e.getTopLeft(),r=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(n,r,o);if(i<1)throw new he("No pattern found in proccess finder.");var a=t.computeDimension(n,r,o,i),s=vu.getProvisionalVersionForDimension(a),c=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var d=r.getX()-n.getX()+o.getX(),h=r.getY()-n.getY()+o.getY(),f=1-3/c,p=Math.floor(n.getX()+f*(d-n.getX())),l=Math.floor(n.getY()+f*(h-n.getY())),g=4;g<=16;g<<=1)try{u=this.findAlignmentInRegion(i,p,l,g);break}catch(w){if(!(w instanceof he))throw w}var m=t.createTransform(n,r,o,u,a),y=t.sampleGrid(this.image,m,a);return new _f(y,u===null?[o,n,r]:[o,n,r,u])},t.createTransform=function(e,n,r,o,i){var a,s,c,u,d=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),u=c=d-3):(a=n.getX()-e.getX()+r.getX(),s=n.getY()-e.getY()+r.getY(),c=d,u=d),g2.quadrilateralToQuadrilateral(3.5,3.5,d,3.5,c,u,3.5,d,e.getX(),e.getY(),n.getX(),n.getY(),a,s,r.getX(),r.getY())},t.sampleGrid=function(e,n,r){return Sf.getInstance().sampleGridWithTransform(e,r,r,n)},t.computeDimension=function(e,n,r,o){var i=ft.round(Pe.distance(e,n)/o),a=ft.round(Pe.distance(e,r)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new he("Dimensions could be not found.")}return s},t.prototype.calculateModuleSize=function(e,n,r){return(this.calculateModuleSizeOneWay(e,n)+this.calculateModuleSizeOneWay(e,r))/2},t.prototype.calculateModuleSizeOneWay=function(e,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(n.getX()),Math.floor(n.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?o/7:isNaN(o)?r/7:(r+o)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,n,r,o){var i=this.sizeOfBlackWhiteBlackRun(e,n,r,o),a=1,s=e-(r-e);s<0?(a=e/(e-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);var c=Math.floor(n-(o-n)*a);return a=1,c<0?(a=n/(n-c),c=0):c>=this.image.getHeight()&&(a=(this.image.getHeight()-1-n)/(c-n),c=this.image.getHeight()-1),s=Math.floor(e+(s-e)*a),(i+=this.sizeOfBlackWhiteBlackRun(e,n,s,c))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(e,n,r,o){var i=Math.abs(o-n)>Math.abs(r-e);if(i){var a=e;e=n,n=a,a=r,r=o,o=a}for(var s=Math.abs(r-e),c=Math.abs(o-n),u=-s/2,d=e<r?1:-1,h=n<o?1:-1,f=0,p=r+d,l=e,g=n;l!==p;l+=d){var m=i?g:l,y=i?l:g;if(f===1===this.image.get(m,y)){if(f===2)return ft.distance(l,g,e,n);f++}if((u+=c)>0){if(g===o)break;g+=h,u-=s}}return f===2?ft.distance(r+d,o,e,n):NaN},t.prototype.findAlignmentInRegion=function(e,n,r,o){var i=Math.floor(o*e),a=Math.max(0,n-i),s=Math.min(this.image.getWidth()-1,n+i);if(s-a<3*e)throw new he("Alignment top exceeds estimated module size.");var c=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-c<3*e)throw new he("Alignment bottom exceeds estimated module size.");return new lI(this.image,a,c,s-a,u-c,e,this.resultPointCallback).find()},t}(),bu=function(){function t(){this.decoder=new aI}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,n){var r,o;if(n!=null&&n.get(Pt.PURE_BARCODE)!==void 0){var i=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decodeBitMatrix(i,n),o=t.NO_POINTS}else{var a=new gI(e.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(a.getBits(),n),o=a.getPoints()}r.getOther()instanceof D2&&r.getOther().applyMirroredCorrection(o);var s=new Wn(r.getText(),r.getRawBytes(),void 0,o,Re.QR_CODE,void 0),c=r.getByteSegments();c!==null&&s.putMetadata(Cn.BYTE_SEGMENTS,c);var u=r.getECLevel();return u!==null&&s.putMetadata(Cn.ERROR_CORRECTION_LEVEL,u),r.hasStructuredAppend()&&(s.putMetadata(Cn.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(Cn.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n===null||r===null)throw new he;var o=this.moduleSize(n,e),i=n[1],a=r[1],s=n[0],c=r[0];if(s>=c||i>=a)throw new he;if(a-i!=c-s&&(c=s+(a-i))>=e.getWidth())throw new he;var u=Math.round((c-s+1)/o),d=Math.round((a-i+1)/o);if(u<=0||d<=0)throw new he;if(d!==u)throw new he;var h=Math.floor(o/2);i+=h;var f=(s+=h)+Math.floor((u-1)*o)-c;if(f>0){if(f>h)throw new he;s-=f}var p=i+Math.floor((d-1)*o)-a;if(p>0){if(p>h)throw new he;i-=p}for(var l=new oo(u,d),g=0;g<d;g++)for(var m=i+Math.floor(g*o),y=0;y<u;y++)e.get(s+Math.floor(y*o),m)&&l.set(y,g);return l},t.moduleSize=function(e,n){for(var r=n.getHeight(),o=n.getWidth(),i=e[0],a=e[1],s=!0,c=0;i<o&&a<r;){if(s!==n.get(i,a)){if(++c==5)break;s=!s}i++,a++}if(i===o||a===r)throw new he;return(i-e[0])/7},t.NO_POINTS=new Array,t}(),mI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},it=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(e){return ft.sum(e)},t.toIntArray=function(e){var n,r;if(e==null||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=mI(e),s=a.next();!s.done;s=a.next()){var c=s.value;o[i++]=c}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},t.getCodeword=function(e){var n=or.binarySearch(t.SYMBOL_TABLE,262143&e);return n<0?-1:(t.CODEWORD_TABLE[n]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),yI=function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),vI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},wI=function(){function t(){}return t.detectMultiple=function(e,n,r){var o=e.getBlackMatrix(),i=t.detect(r,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(r,o)),new yI(o,i)},t.detect=function(e,n){for(var r,o,i=new Array,a=0,s=0,c=!1;a<n.getHeight();){var u=t.findVertices(n,a,s);if(u[0]!=null||u[3]!=null){if(c=!0,i.push(u),!e)break;u[2]!=null?(s=Math.trunc(u[2].getX()),a=Math.trunc(u[2].getY())):(s=Math.trunc(u[4].getX()),a=Math.trunc(u[4].getY()))}else{if(!c)break;c=!1,s=0;try{for(var d=(r=void 0,vI(i)),h=d.next();!h.done;h=d.next()){var f=h.value;f[1]!=null&&(a=Math.trunc(Math.max(a,f[1].getY()))),f[3]!=null&&(a=Math.max(a,Math.trunc(f[3].getY())))}}catch(p){r={error:p}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}a+=t.ROW_STEP}}return i},t.findVertices=function(e,n,r){var o=e.getHeight(),i=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,o,i,n,r,t.START_PATTERN),t.INDEXES_START_PATTERN),a[4]!=null&&(r=Math.trunc(a[4].getX()),n=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,o,i,n,r,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(e,n,r){for(var o=0;o<r.length;o++)e[r[o]]=n[o]},t.findRowsWithPattern=function(e,n,r,o,i,a){for(var s=new Array(4),c=!1,u=new Int32Array(a.length);o<n;o+=t.ROW_STEP)if((p=t.findGuardPattern(e,i,o,r,!1,a,u))!=null){for(;o>0;){if((f=t.findGuardPattern(e,i,--o,r,!1,a,u))==null){o++;break}p=f}s[0]=new Pe(p[0],o),s[1]=new Pe(p[1],o),c=!0;break}var d=o+1;if(c){for(var h=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);d<n;d++){var p;if((p=t.findGuardPattern(e,f[0],d,r,!1,a,u))!=null&&Math.abs(f[0]-p[0])<t.MAX_PATTERN_DRIFT&&Math.abs(f[1]-p[1])<t.MAX_PATTERN_DRIFT)f=p,h=0;else{if(h>t.SKIPPED_ROW_COUNT_MAX)break;h++}}d-=h+1,s[2]=new Pe(f[0],d),s[3]=new Pe(f[1],d)}return d-o<t.BARCODE_MIN_HEIGHT&&or.fill(s,null),s},t.findGuardPattern=function(e,n,r,o,i,a,s){or.fillWithin(s,0,s.length,0);for(var c=n,u=0;e.get(c,r)&&c>0&&u++<t.MAX_PIXEL_DRIFT;)c--;for(var d=c,h=0,f=a.length,p=i;d<o;d++)if(e.get(d,r)!==p)s[h]++;else{if(h===f-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([c,d]);c+=s[0]+s[1],Nt.arraycopy(s,2,s,0,h-1),s[h-1]=0,s[h]=0,h--}else h++;s[h]=1,p=!p}return h===f-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([c,d-1]):null},t.patternMatchVariance=function(e,n,r){for(var o=e.length,i=0,a=0,s=0;s<o;s++)i+=e[s],a+=n[s];if(i<a)return 1/0;var c=i/a;r*=c;for(var u=0,d=0;d<o;d++){var h=e[d],f=n[d]*c,p=h>f?h-f:f-h;if(p>r)return 1/0;u+=p}return u/i},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),bI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fi=function(){function t(e,n){if(n.length===0)throw new Ve;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var o=1;o<r&&n[o]===0;)o++;o===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-o),Nt.arraycopy(n,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){var n,r;if(e===0)return this.getCoefficient(0);if(e===1){var o=0;try{for(var i=bI(this.coefficients),a=i.next();!a.done;a=i.next()){var s=a.value;o=this.field.add(o,s)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}for(var c=this.coefficients[0],u=this.coefficients.length,d=1;d<u;d++)c=this.field.add(this.field.multiply(e,c),this.coefficients[d]);return c},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new Ve("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;Nt.arraycopy(r,0,i,0,a);for(var s=a;s<r.length;s++)i[s]=this.field.add(n[s-a],r[s]);return new t(this.field,i)},t.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new Ve("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new Ve("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,o=e.coefficients,i=o.length,a=new Int32Array(r+i-1),s=0;s<r;s++)for(var c=n[s],u=0;u<i;u++)a[s+u]=this.field.add(a[s+u],this.field.multiply(c,o[u]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,n=new Int32Array(e),r=0;r<e;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new t(this.field,n)},t.prototype.multiplyScalar=function(e){if(e===0)return new t(this.field,new Int32Array([0]));if(e===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),o=0;o<n;o++)r[o]=this.field.multiply(this.coefficients[o],e);return new t(this.field,r)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Ve;if(n===0)return new t(this.field,new Int32Array([0]));for(var r=this.coefficients.length,o=new Int32Array(r+e),i=0;i<r;i++)o[i]=this.field.multiply(this.coefficients[i],n);return new t(this.field,o)},t.prototype.toString=function(){for(var e=new xt,n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),n!==0&&r===1||e.append(r),n!==0&&(n===1?e.append("x"):(e.append("x^"),e.append(n))))}return e.toString()},t}(),EI=function(){function t(){}return t.prototype.add=function(e,n){return(e+n)%this.modulus},t.prototype.subtract=function(e,n){return(this.modulus+e-n)%this.modulus},t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Ve;return this.logTable[e]},t.prototype.inverse=function(e){if(e===0)throw new f2;return this.expTable[this.modulus-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(e){return e===this},t}(),CI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_I=function(t){function e(n,r){var o=t.call(this)||this;o.modulus=n,o.expTable=new Int32Array(n),o.logTable=new Int32Array(n);for(var i=1,a=0;a<n;a++)o.expTable[a]=i,i=i*r%n;for(a=0;a<n-1;a++)o.logTable[o.expTable[a]]=a;return o.zero=new fi(o,new Int32Array([0])),o.one=new fi(o,new Int32Array([1])),o}return CI(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Ve;if(r===0)return this.zero;var o=new Int32Array(n+1);return o[0]=r,new fi(this,o)},e.PDF417_GF=new e(it.NUMBER_OF_CODEWORDS,3),e}(EI),AI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},SI=function(){function t(){this.field=_I.PDF417_GF}return t.prototype.decode=function(e,n,r){for(var o,i,a=new fi(this.field,e),s=new Int32Array(n),c=!1,u=n;u>0;u--){var d=a.evaluateAt(this.field.exp(u));s[n-u]=d,d!==0&&(c=!0)}if(!c)return 0;var h=this.field.getOne();if(r!=null)try{for(var f=AI(r),p=f.next();!p.done;p=f.next()){var l=p.value,g=this.field.exp(e.length-1-l),m=new fi(this.field,new Int32Array([this.field.subtract(0,g),1]));h=h.multiply(m)}}catch(P){o={error:P}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var y=new fi(this.field,s),w=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),y,n),b=w[0],E=w[1],C=this.findErrorLocations(b),I=this.findErrorMagnitudes(E,b,C);for(u=0;u<C.length;u++){var T=e.length-1-this.field.log(C[u]);if(T<0)throw sn.getChecksumInstance();e[T]=this.field.subtract(e[T],I[u])}return C.length},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var o=e;e=n,n=o}for(var i=e,a=n,s=this.field.getZero(),c=this.field.getOne();a.getDegree()>=Math.round(r/2);){var u=i,d=s;if(s=c,(i=a).isZero())throw sn.getChecksumInstance();a=u;for(var h=this.field.getZero(),f=i.getCoefficient(i.getDegree()),p=this.field.inverse(f);a.getDegree()>=i.getDegree()&&!a.isZero();){var l=a.getDegree()-i.getDegree(),g=this.field.multiply(a.getCoefficient(a.getDegree()),p);h=h.add(this.field.buildMonomial(l,g)),a=a.subtract(i.multiplyByMonomial(l,g))}c=h.multiply(s).subtract(d).negative()}var m=c.getCoefficient(0);if(m===0)throw sn.getChecksumInstance();var y=this.field.inverse(m);return[c.multiply(y),a.multiply(y)]},t.prototype.findErrorLocations=function(e){for(var n=e.getDegree(),r=new Int32Array(n),o=0,i=1;i<this.field.getSize()&&o<n;i++)e.evaluateAt(i)===0&&(r[o]=this.field.inverse(i),o++);if(o!==n)throw sn.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(e,n,r){for(var o=n.getDegree(),i=new Int32Array(o),a=1;a<=o;a++)i[o-a]=this.field.multiply(a,n.getCoefficient(a));var s=new fi(this.field,i),c=r.length,u=new Int32Array(c);for(a=0;a<c;a++){var d=this.field.inverse(r[a]),h=this.field.subtract(0,e.evaluateAt(d)),f=this.field.inverse(s.evaluateAt(d));u[a]=this.field.multiply(h,f)}return u},t}(),kf=function(){function t(e,n,r,o,i){e instanceof t?this.constructor_2(e):this.constructor_1(e,n,r,o,i)}return t.prototype.constructor_1=function(e,n,r,o,i){var a=n==null||r==null,s=o==null||i==null;if(a&&s)throw new he;a?(n=new Pe(0,o.getY()),r=new Pe(0,i.getY())):s&&(o=new Pe(e.getWidth()-1,n.getY()),i=new Pe(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=n,this.bottomLeft=r,this.topRight=o,this.bottomRight=i,this.minX=Math.trunc(Math.min(n.getX(),r.getX())),this.maxX=Math.trunc(Math.max(o.getX(),i.getX())),this.minY=Math.trunc(Math.min(n.getY(),o.getY())),this.maxY=Math.trunc(Math.max(r.getY(),i.getY()))},t.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},t.merge=function(e,n){return e==null?n:n==null?e:new t(e.image,e.topLeft,e.bottomLeft,n.topRight,n.bottomRight)},t.prototype.addMissingRows=function(e,n,r){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var c=r?this.topLeft:this.topRight,u=Math.trunc(c.getY()-e);u<0&&(u=0);var d=new Pe(c.getX(),u);r?o=d:a=d}if(n>0){var h=r?this.bottomLeft:this.bottomRight,f=Math.trunc(h.getY()+n);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var p=new Pe(h.getX(),f);r?i=p:s=p}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),II=function(){function t(e,n,r,o){this.columnCount=e,this.errorCorrectionLevel=o,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),Bf=function(){function t(){this.buffer=""}return t.form=function(e,n){var r=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,c,u){if(o==="%%")return"%";if(n[++r]!==void 0){o=s?parseInt(s.substr(1)):void 0;var d,h=c?parseInt(c.substr(1)):void 0;switch(u){case"s":d=n[r];break;case"c":d=n[r][0];break;case"f":d=parseFloat(n[r]).toFixed(o);break;case"p":d=parseFloat(n[r]).toPrecision(o);break;case"e":d=parseFloat(n[r]).toExponential(o);break;case"x":d=parseInt(n[r]).toString(h||16);break;case"d":d=parseFloat(parseInt(n[r],h||10).toPrecision(o)).toFixed(0)}d=typeof d=="object"?JSON.stringify(d):(+d).toString(h);for(var f=parseInt(a),p=a&&a[0]+""=="0"?"0":" ";d.length<f;)d=i!==void 0?d+p:p+d;return d}})},t.prototype.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.buffer+=t.form(e,n)},t.prototype.toString=function(){return this.buffer},t}(),TI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},L2=function(){function t(e){this.boundingBox=new kf(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var n=this.getCodeword(e);if(n!=null)return n;for(var r=1;r<t.MAX_NEARBY_DISTANCE;r++){var o=this.imageRowToCodewordIndex(e)-r;if(o>=0&&(n=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(e)+r)<this.codewords.length&&(n=this.codewords[o])!=null)return n}return null},t.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},t.prototype.setCodeword=function(e,n){this.codewords[this.imageRowToCodewordIndex(e)]=n},t.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var e,n,r=new Bf,o=0;try{for(var i=TI(this.codewords),a=i.next();!a.done;a=i.next()){var s=a.value;s!=null?r.format("%3d: %3d|%3d%n",o++,s.getRowNumber(),s.getValue()):r.format("%3d: | %n",o++)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t}(),xI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},OI=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ys=function(){function t(){this.values=new Map}return t.prototype.setValue=function(e){e=Math.trunc(e);var n=this.values.get(e);n==null&&(n=0),n++,this.values.set(e,n)},t.prototype.getValue=function(){var e,n,r=-1,o=new Array,i=function(u,d){var h=function(){return u},f=function(){return d};f()>r?(r=f(),(o=[]).push(h())):f()===r&&o.push(h())};try{for(var a=xI(this.values.entries()),s=a.next();!s.done;s=a.next()){var c=OI(s.value,2);i(c[0],c[1])}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return it.toIntArray(o)},t.prototype.getConfidence=function(e){return this.values.get(e)},t}(),PI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},F2=function(t){function e(n,r){var o=t.call(this,n)||this;return o._isLeft=r,o}return PI(e,t),e.prototype.setRowNumbers=function(){var n,r;try{for(var o=Nf(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a!=null&&a.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),c=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,d=1,h=0,f=s;f<c;f++)if(r[f]!=null){var p=r[f],l=p.getRowNumber()-u;if(l===0)h++;else if(l===1)d=Math.max(d,h),h=1,u=p.getRowNumber();else if(l<0||p.getRowNumber()>=n.getRowCount()||l>f)r[f]=null;else{for(var g=void 0,m=(g=d>2?(d-2)*l:l)>=f,y=1;y<=g&&!m;y++)m=r[f-y]!=null;m?r[f]=null:(u=p.getRowNumber(),h=1)}}},e.prototype.getRowHeights=function(){var n,r,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=Nf(this.getCodewords()),s=a.next();!s.done;s=a.next()){var c=s.value;if(c!=null){var u=c.getRowNumber();if(u>=i.length)continue;i[u]++}}}catch(d){n={error:d}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),o=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),c=this.getCodewords(),u=-1,d=a;d<s;d++)if(c[d]!=null){var h=c[d];h.setRowNumberAsRowIndicatorColumn();var f=h.getRowNumber()-u;f===0||(f===1?u=h.getRowNumber():h.getRowNumber()>=n.getRowCount()?c[d]=null:u=h.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var n,r,o=this.getCodewords(),i=new ys,a=new ys,s=new ys,c=new ys;try{for(var u=Nf(o),d=u.next();!d.done;d=u.next()){var h=d.value;if(h!=null){h.setRowNumberAsRowIndicatorColumn();var f=h.getValue()%30,p=h.getRowNumber();switch(this._isLeft||(p+=2),p%3){case 0:a.setValue(3*f+1);break;case 1:c.setValue(f/3),s.setValue(f%3);break;case 2:i.setValue(f+1)}}}}catch(g){n={error:g}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||c.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]<it.MIN_ROWS_IN_BARCODE||a.getValue()[0]+s.getValue()[0]>it.MAX_ROWS_IN_BARCODE)return null;var l=new II(i.getValue()[0],a.getValue()[0],s.getValue()[0],c.getValue()[0]);return this.removeIncorrectCodewords(o,l),l},e.prototype.removeIncorrectCodewords=function(n,r){for(var o=0;o<n.length;o++){var i=n[o];if(n[o]!=null){var a=i.getValue()%30,s=i.getRowNumber();if(s>r.getRowCount())n[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==r.getRowCountUpperPart()&&(n[o]=null);break;case 1:Math.trunc(a/3)===r.getErrorCorrectionLevel()&&a%3===r.getRowCountLowerPart()||(n[o]=null);break;case 2:a+1!==r.getColumnCount()&&(n[o]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
142
- `+t.prototype.toString.call(this)},e}(L2),kI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},BI=function(){function t(e,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e,n=it.MAX_CODEWORDS_IN_BARCODE;do e=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n<e);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(e){e!=null&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var n=1;n<this.barcodeColumnCount+1;n++)for(var r=this.detectionResultColumns[n].getCodewords(),o=0;o<r.length;o++)r[o]!=null&&(r[o].hasValidRowNumber()||this.adjustRowNumbers(n,o,r));return e},t.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]!=null&&this.detectionResultColumns[this.barcodeColumnCount+1]!=null){for(var e=this.detectionResultColumns[0].getCodewords(),n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(e[r]!=null&&n[r]!=null&&e[r].getRowNumber()===n[r].getRowNumber())for(var o=1;o<=this.barcodeColumnCount;o++){var i=this.detectionResultColumns[o].getCodewords()[r];i!=null&&(i.setRowNumber(e[r].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[o].getCodewords()[r]=null))}}},t.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var e=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var o=n[r].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[r];s!=null&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var e=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var o=n[r].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[r];s!=null&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(e,n,r){return r==null||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),n=0):++n),n},t.prototype.adjustRowNumbers=function(e,n,r){var o,i,a=r[n],s=this.detectionResultColumns[e-1].getCodewords(),c=s;this.detectionResultColumns[e+1]!=null&&(c=this.detectionResultColumns[e+1].getCodewords());var u=new Array(14);u[2]=s[n],u[3]=c[n],n>0&&(u[0]=r[n-1],u[4]=s[n-1],u[5]=c[n-1]),n>1&&(u[8]=r[n-2],u[10]=s[n-2],u[11]=c[n-2]),n<r.length-1&&(u[1]=r[n+1],u[6]=s[n+1],u[7]=c[n+1]),n<r.length-2&&(u[9]=r[n+2],u[12]=s[n+2],u[13]=c[n+2]);try{for(var d=kI(u),h=d.next();!h.done;h=d.next()){var f=h.value;if(t.adjustRowNumber(a,f))return}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}},t.adjustRowNumber=function(e,n){return n!=null&&!(!n.hasValidRowNumber()||n.getBucket()!==e.getBucket())&&(e.setRowNumber(n.getRowNumber()),!0)},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(e){this.boundingBox=e},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(e,n){this.detectionResultColumns[e]=n},t.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},t.prototype.toString=function(){var e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var n=new Bf,r=0;r<e.getCodewords().length;r++){n.format("CW %3d:",r);for(var o=0;o<this.barcodeColumnCount+2;o++)if(this.detectionResultColumns[o]!=null){var i=this.detectionResultColumns[o].getCodewords()[r];i!=null?n.format(" %3d|%3d",i.getRowNumber(),i.getValue()):n.format(" | ")}else n.format(" | ");n.format("%n")}return n.toString()},t}(),NI=function(){function t(e,n,r,o){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(o)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(e){this.rowNumber=e},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t}(),RI=function(){function t(){}return t.initialize=function(){for(var e=0;e<it.SYMBOL_TABLE.length;e++)for(var n=it.SYMBOL_TABLE[e],r=1&n,o=0;o<it.BARS_IN_MODULE;o++){for(var i=0;(1&n)===r;)i+=1,n>>=1;r=1&n,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(it.BARS_IN_MODULE)),t.RATIOS_TABLE[e][it.BARS_IN_MODULE-o-1]=Math.fround(i/it.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var n=t.getDecodedCodewordValue(t.sampleBitCounts(e));return n!==-1?n:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(e){for(var n=ft.sum(e),r=new Int32Array(it.BARS_IN_MODULE),o=0,i=0,a=0;a<it.MODULES_IN_CODEWORD;a++){var s=n/(2*it.MODULES_IN_CODEWORD)+a*n/it.MODULES_IN_CODEWORD;i+e[o]<=s&&(i+=e[o],o++),r[o]++}return r},t.getDecodedCodewordValue=function(e){var n=t.getBitValue(e);return it.getCodeword(n)===-1?-1:n},t.getBitValue=function(e){for(var n=0,r=0;r<e.length;r++)for(var o=0;o<e[r];o++)n=n<<1|(r%2==0?1:0);return Math.trunc(n)},t.getClosestDecodedValue=function(e){var n=ft.sum(e),r=new Array(it.BARS_IN_MODULE);if(n>1)for(var o=0;o<r.length;o++)r[o]=Math.fround(e[o]/n);var i=Cf.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var c=0,u=t.RATIOS_TABLE[s],d=0;d<it.BARS_IN_MODULE;d++){var h=Math.fround(u[d]-r[d]);if((c+=Math.fround(h*h))>=i)break}c<i&&(i=c,a=it.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(it.SYMBOL_TABLE.length).map(function(e){return new Array(it.BARS_IN_MODULE)}),t}(),DI=function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(e){this.segmentIndex=e},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(e){this.fileId=e},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(e){this.optionalData=e},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(e){this.lastSegment=e},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(e){this.segmentCount=e},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(e){this.sender=e},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(e){this.addressee=e},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(e){this.fileName=e},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(e){this.fileSize=e},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(e){this.checksum=e},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(e){this.timestamp=e},t}(),j2=function(){function t(){}return t.parseLong=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t}(),MI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),LI=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return MI(e,t),e.kind="NullPointerException",e}($n),FI=function(){function t(){}return t.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},t.prototype.writeBytesOffset=function(e,n,r){if(e==null)throw new LI;if(n<0||n>e.length||r<0||n+r>e.length||n+r<0)throw new wf;if(r!==0)for(var o=0;o<r;o++)this.write(e[n+o])},t.prototype.flush=function(){},t.prototype.close=function(){},t}(),jI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),VI=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return jI(e,t),e}($n),UI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),GI=function(t){function e(n){n===void 0&&(n=32);var r=t.call(this)||this;if(r.count=0,n<0)throw new Ve("Negative initial size: "+n);return r.buf=new Uint8Array(n),r}return UI(e,t),e.prototype.ensureCapacity=function(n){n-this.buf.length>0&&this.grow(n)},e.prototype.grow=function(n){var r=this.buf.length<<1;if(r-n<0&&(r=n),r<0){if(n<0)throw new VI;r=bn.MAX_VALUE}this.buf=or.copyOfUint8Array(this.buf,r)},e.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},e.prototype.writeBytesOffset=function(n,r,o){if(r<0||r>n.length||o<0||r+o-n.length>0)throw new wf;this.ensureCapacity(this.count+o),Nt.arraycopy(n,r,this.buf,this.count,o),this.count+=o},e.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return or.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(n){return new String(this.buf).toString()},e.prototype.toString_number=function(n){return new String(this.buf).toString()},e.prototype.close=function(){},e}(FI);function V2(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function jo(t){if(wu===void 0&&(wu=V2()),wu===null)throw new Error("BigInt is not supported!");return wu(t)}(function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(St||(St={}));var qI=function(){function t(){}return t.decode=function(e,n){var r=new xt(""),o=Yn.ISO8859_1;r.enableDecoding(o);for(var i=1,a=e[i++],s=new DI;i<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:i=t.textCompaction(e,i,r);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:i=t.byteCompaction(a,e,o,i,r);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[i++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:i=t.numericCompaction(e,i,r);break;case t.ECI_CHARSET:Yn.getCharacterSetECIByValue(e[i++]);break;case t.ECI_GENERAL_PURPOSE:i+=2;break;case t.ECI_USER_DEFINED:i++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=t.decodeMacroBlock(e,i,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new Se;default:i--,i=t.textCompaction(e,i,r)}if(!(i<e.length))throw Se.getFormatInstance();a=e[i++]}if(r.length()===0)throw Se.getFormatInstance();var c=new cu(null,r.toString(),null,n);return c.setOther(s),c},t.decodeMacroBlock=function(e,n,r){if(n+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw Se.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<t.NUMBER_OF_SEQUENCE_CODEWORDS;i++,n++)o[i]=e[n];r.setSegmentIndex(bn.parseInt(t.decodeBase900toBase10(o,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new xt;n=t.textCompaction(e,n,a),r.setFileId(a.toString());var s=-1;for(e[n]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<e[0];)switch(e[n]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++n]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new xt;n=t.textCompaction(e,n+1,c),r.setFileName(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new xt;n=t.textCompaction(e,n+1,u),r.setSender(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var d=new xt;n=t.textCompaction(e,n+1,d),r.setAddressee(d.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new xt;n=t.numericCompaction(e,n+1,h),r.setSegmentCount(bn.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new xt;n=t.numericCompaction(e,n+1,f),r.setTimestamp(j2.parseLong(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var p=new xt;n=t.numericCompaction(e,n+1,p),r.setChecksum(bn.parseInt(p.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var l=new xt;n=t.numericCompaction(e,n+1,l),r.setFileSize(j2.parseLong(l.toString()));break;default:throw Se.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw Se.getFormatInstance()}if(s!==-1){var g=n-s;r.isLastSegment()&&g--,r.setOptionalData(or.copyOfRange(e,s,s+g))}return n},t.textCompaction=function(e,n,r){for(var o=new Int32Array(2*(e[0]-n)),i=new Int32Array(2*(e[0]-n)),a=0,s=!1;n<e[0]&&!s;){var c=e[n++];if(c<t.TEXT_COMPACTION_MODE_LATCH)o[a]=c/30,o[a+1]=c%30,a+=2;else switch(c){case t.TEXT_COMPACTION_MODE_LATCH:o[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=e[n++],i[a]=c,a++}}return t.decodeTextCompaction(o,i,a,r),n},t.decodeTextCompaction=function(e,n,r,o){for(var i=St.ALPHA,a=St.ALPHA,s=0;s<r;){var c=e[s],u="";switch(i){case St.ALPHA:if(c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case t.LL:i=St.LOWER;break;case t.ML:i=St.MIXED;break;case t.PS:a=i,i=St.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.LOWER:if(c<26)u=String.fromCharCode(97+c);else switch(c){case 26:u=" ";break;case t.AS:a=i,i=St.ALPHA_SHIFT;break;case t.ML:i=St.MIXED;break;case t.PS:a=i,i=St.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.MIXED:if(c<t.PL)u=t.MIXED_CHARS[c];else switch(c){case t.PL:i=St.PUNCT;break;case 26:u=" ";break;case t.LL:i=St.LOWER;break;case t.AL:i=St.ALPHA;break;case t.PS:a=i,i=St.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.PUNCT:if(c<t.PAL)u=t.PUNCT_CHARS[c];else switch(c){case t.PAL:i=St.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.ALPHA_SHIFT:if(i=a,c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.PUNCT_SHIFT:if(i=a,c<t.PAL)u=t.PUNCT_CHARS[c];else switch(c){case t.PAL:i=St.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}}u!==""&&o.append(u),s++}},t.byteCompaction=function(e,n,r,o,i){var a=new GI,s=0,c=0,u=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var d=new Int32Array(6),h=n[o++];o<n[0]&&!u;)switch(d[s++]=h,c=900*c+h,h=n[o++]){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,u=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)a.write(Number(jo(c)>>jo(8*(5-f))));c=0,s=0}}o===n[0]&&h<t.TEXT_COMPACTION_MODE_LATCH&&(d[s++]=h);for(var p=0;p<s;p++)a.write(d[p]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;o<n[0]&&!u;){var l=n[o++];if(l<t.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+l;else switch(l){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,u=!0}if(s%5==0&&s>0){for(f=0;f<6;++f)a.write(Number(jo(c)>>jo(8*(5-f))));c=0,s=0}}}return i.append(ci.decode(a.toByteArray(),r)),o},t.numericCompaction=function(e,n,r){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);n<e[0]&&!i;){var s=e[n++];if(n===e[0]&&(i=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,i=!0}(o%t.MAX_NUMERIC_CODEWORDS==0||s===t.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(r.append(t.decodeBase900toBase10(a,o)),o=0)}return n},t.decodeBase900toBase10=function(e,n){for(var r=jo(0),o=0;o<n;o++)r+=t.EXP900[n-o-1]*jo(e[o]);var i=r.toString();if(i.charAt(0)!=="1")throw new Se;return i.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
143
- -.$/"|*()?{}'`,t.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",t.EXP900=V2()?function(){var e=[];e[0]=jo(1);var n=jo(900);e[1]=n;for(var r=2;r<16;r++)e[r]=e[r-1]*n;return e}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),vs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},HI=function(){function t(){}return t.decode=function(e,n,r,o,i,a,s){for(var c,u=new kf(e,n,r,o,i),d=null,h=null,f=!0;;f=!1){if(n!=null&&(d=t.getRowIndicatorColumn(e,u,n,!0,a,s)),o!=null&&(h=t.getRowIndicatorColumn(e,u,o,!1,a,s)),(c=t.merge(d,h))==null)throw he.getNotFoundInstance();var p=c.getBoundingBox();if(!f||p==null||!(p.getMinY()<u.getMinY()||p.getMaxY()>u.getMaxY()))break;u=p}c.setBoundingBox(u);var l=c.getBarcodeColumnCount()+1;c.setDetectionResultColumn(0,d),c.setDetectionResultColumn(l,h);for(var g=d!=null,m=1;m<=l;m++){var y=g?m:l-m;if(c.getDetectionResultColumn(y)===void 0){var w=void 0;w=y===0||y===l?new F2(u,y===0):new L2(u),c.setDetectionResultColumn(y,w);for(var b=-1,E=b,C=u.getMinY();C<=u.getMaxY();C++){if((b=t.getStartColumn(c,y,C,g))<0||b>u.getMaxX()){if(E===-1)continue;b=E}var I=t.detectCodeword(e,u.getMinX(),u.getMaxX(),g,b,C,a,s);I!=null&&(w.setCodeword(C,I),E=b,a=Math.min(a,I.getWidth()),s=Math.max(s,I.getWidth()))}}}return t.createDecoderResult(c)},t.merge=function(e,n){if(e==null&&n==null)return null;var r=t.getBarcodeMetadata(e,n);if(r==null)return null;var o=kf.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(n));return new BI(r,o)},t.adjustBoundingBox=function(e){var n,r;if(e==null)return null;var o=e.getRowHeights();if(o==null)return null;var i=t.getMax(o),a=0;try{for(var s=vs(o),c=s.next();!c.done;c=s.next()){var u=c.value;if(a+=i-u,u>0)break}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var d=e.getCodewords(),h=0;a>0&&d[h]==null;h++)a--;var f=0;for(h=o.length-1;h>=0&&(f+=i-o[h],!(o[h]>0));h--);for(h=d.length-1;f>0&&d[h]==null;h--)f--;return e.getBoundingBox().addMissingRows(a,f,e.isLeft())},t.getMax=function(e){var n,r,o=-1;try{for(var i=vs(e),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},t.getBarcodeMetadata=function(e,n){var r,o;return e==null||(r=e.getBarcodeMetadata())==null?n==null?null:n.getBarcodeMetadata():n==null||(o=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==o.getColumnCount()&&r.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&r.getRowCount()!==o.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,n,r,o,i,a){for(var s=new F2(n,o),c=0;c<2;c++)for(var u=c===0?1:-1,d=Math.trunc(Math.trunc(r.getX())),h=Math.trunc(Math.trunc(r.getY()));h<=n.getMaxY()&&h>=n.getMinY();h+=u){var f=t.detectCodeword(e,0,e.getWidth(),o,d,h,i,a);f!=null&&(s.setCodeword(h,f),d=o?f.getStartX():f.getEndX())}return s},t.adjustCodewordCount=function(e,n){var r=n[0][1],o=r.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(o.length===0){if(i<1||i>it.MAX_CODEWORDS_IN_BARCODE)throw he.getNotFoundInstance();r.setValue(i)}else o[0]!==i&&r.setValue(i)},t.createDecoderResult=function(e){var n=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,n);for(var r=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var c=0;c<e.getBarcodeColumnCount();c++){var u=n[s][c+1].getValue(),d=s*e.getBarcodeColumnCount()+c;u.length===0?r.push(d):u.length===1?o[d]=u[0]:(a.push(d),i.push(u))}for(var h=new Array(i.length),f=0;f<h.length;f++)h[f]=i[f];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),o,it.toIntArray(r),it.toIntArray(a),h)},t.createDecoderResultFromAmbiguousValues=function(e,n,r,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var c=0;c<a.length;c++)n[o[c]]=i[c][a[c]];try{return t.decodeCodewords(n,e,r)}catch(u){if(!(u instanceof sn))throw u}if(a.length===0)throw sn.getChecksumInstance();for(c=0;c<a.length;c++){if(a[c]<i[c].length-1){a[c]++;break}if(a[c]=0,c===a.length-1)throw sn.getChecksumInstance()}}throw sn.getChecksumInstance()},t.createBarcodeMatrix=function(e){for(var n,r,o,i,a=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),s=0;s<a.length;s++)for(var c=0;c<a[s].length;c++)a[s][c]=new ys;var u=0;try{for(var d=vs(e.getDetectionResultColumns()),h=d.next();!h.done;h=d.next()){var f=h.value;if(f!=null)try{for(var p=(o=void 0,vs(f.getCodewords())),l=p.next();!l.done;l=p.next()){var g=l.value;if(g!=null){var m=g.getRowNumber();if(m>=0){if(m>=a.length)continue;a[m][u].setValue(g.getValue())}}}}catch(y){o={error:y}}finally{try{l&&!l.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}u++}}catch(y){n={error:y}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return a},t.isValidBarcodeColumn=function(e,n){return n>=0&&n<=e.getBarcodeColumnCount()+1},t.getStartColumn=function(e,n,r,o){var i,a,s=o?1:-1,c=null;if(t.isValidBarcodeColumn(e,n-s)&&(c=e.getDetectionResultColumn(n-s).getCodeword(r)),c!=null)return o?c.getEndX():c.getStartX();if((c=e.getDetectionResultColumn(n).getCodewordNearby(r))!=null)return o?c.getStartX():c.getEndX();if(t.isValidBarcodeColumn(e,n-s)&&(c=e.getDetectionResultColumn(n-s).getCodewordNearby(r)),c!=null)return o?c.getEndX():c.getStartX();for(var u=0;t.isValidBarcodeColumn(e,n-s);){n-=s;try{for(var d=(i=void 0,vs(e.getDetectionResultColumn(n).getCodewords())),h=d.next();!h.done;h=d.next()){var f=h.value;if(f!=null)return(o?f.getEndX():f.getStartX())+s*u*(f.getEndX()-f.getStartX())}}catch(p){i={error:p}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}u++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,n,r,o,i,a,s,c){i=t.adjustCodewordStartColumn(e,n,r,o,i,a);var u,d=t.getModuleBitCount(e,n,r,o,i,a);if(d==null)return null;var h=ft.sum(d);if(o)u=i+h;else{for(var f=0;f<d.length/2;f++){var p=d[f];d[f]=d[d.length-1-f],d[d.length-1-f]=p}i=(u=i)-h}if(!t.checkCodewordSkew(h,s,c))return null;var l=RI.getDecodedValue(d),g=it.getCodeword(l);return g===-1?null:new NI(i,u,t.getCodewordBucketNumber(l),g)},t.getModuleBitCount=function(e,n,r,o,i,a){for(var s=i,c=new Int32Array(8),u=0,d=o?1:-1,h=o;(o?s<r:s>=n)&&u<c.length;)e.get(s,a)===h?(c[u]++,s+=d):(u++,h=!h);return u===c.length||s===(o?r:n)&&u===c.length-1?c:null},t.getNumberOfECCodeWords=function(e){return 2<<e},t.adjustCodewordStartColumn=function(e,n,r,o,i,a){for(var s=i,c=o?-1:1,u=0;u<2;u++){for(;(o?s>=n:s<r)&&o===e.get(s,a);){if(Math.abs(i-s)>t.CODEWORD_SKEW_SIZE)return i;s+=c}c=-c,o=!o}return s},t.checkCodewordSkew=function(e,n,r){return n-t.CODEWORD_SKEW_SIZE<=e&&e<=r+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,n,r){if(e.length===0)throw Se.getFormatInstance();var o=1<<n+1,i=t.correctErrors(e,r,o);t.verifyCodewordCount(e,o);var a=qI.decode(e,""+n);return a.setErrorsCorrected(i),a.setErasures(r.length),a},t.correctErrors=function(e,n,r){if(n!=null&&n.length>r/2+t.MAX_ERRORS||r<0||r>t.MAX_EC_CODEWORDS)throw sn.getChecksumInstance();return t.errorCorrection.decode(e,r,n)},t.verifyCodewordCount=function(e,n){if(e.length<4)throw Se.getFormatInstance();var r=e[0];if(r>e.length)throw Se.getFormatInstance();if(r===0){if(!(n<e.length))throw Se.getFormatInstance();e[0]=e.length-n}},t.getBitCountForCodeword=function(e){for(var n=new Int32Array(8),r=0,o=n.length-1;!((1&e)!==r&&(r=1&e,--o<0));)n[o]++,e>>=1;return n},t.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},t.toString=function(e){for(var n=new Bf,r=0;r<e.length;r++){n.format("Row %2d: ",r);for(var o=0;o<e[r].length;o++){var i=e[r][o];i.getValue().length===0?n.format(" ",null):n.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}n.format("%n")}return n.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new SI,t}(),$I=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Eu=function(){function t(){}return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=t.decode(e,n,!1);if(r==null||r.length===0||r[0]==null)throw he.getNotFoundInstance();return r[0]},t.prototype.decodeMultiple=function(e,n){n===void 0&&(n=null);try{return t.decode(e,n,!0)}catch(r){throw r instanceof Se||r instanceof sn?he.getNotFoundInstance():r}},t.decode=function(e,n,r){var o,i,a=new Array,s=wI.detectMultiple(e,n,r);try{for(var c=$I(s.getPoints()),u=c.next();!u.done;u=c.next()){var d=u.value,h=HI.decode(s.getBits(),d[4],d[5],d[6],d[7],t.getMinCodewordWidth(d),t.getMaxCodewordWidth(d)),f=new Wn(h.getText(),h.getRawBytes(),void 0,d,Re.PDF_417);f.putMetadata(Cn.ERROR_CORRECTION_LEVEL,h.getECLevel());var p=h.getOther();p!=null&&f.putMetadata(Cn.PDF417_EXTRA_METADATA,p),a.push(f)}}catch(l){o={error:l}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return a.map(function(l){return l})},t.getMaxWidth=function(e,n){return e==null||n==null?0:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMinWidth=function(e,n){return e==null||n==null?bn.MAX_VALUE:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),YI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),U2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return YI(e,t),e.kind="ReaderException",e}($n),G2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},q2=function(){function t(){}return t.prototype.decode=function(e,n){return this.setHints(n),this.decodeInternal(e)},t.prototype.decodeWithState=function(e){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(e)},t.prototype.setHints=function(e){this.hints=e;var n=e!=null&&e.get(Pt.TRY_HARDER)!==void 0,r=e==null?null:e.get(Pt.POSSIBLE_FORMATS),o=new Array;if(r!=null){var i=r.some(function(a){return a===Re.UPC_A||a===Re.UPC_E||a===Re.EAN_13||a===Re.EAN_8||a===Re.CODABAR||a===Re.CODE_39||a===Re.CODE_93||a===Re.CODE_128||a===Re.ITF||a===Re.RSS_14||a===Re.RSS_EXPANDED});i&&!n&&o.push(new na(e)),r.includes(Re.QR_CODE)&&o.push(new bu),r.includes(Re.DATA_MATRIX)&&o.push(new yu),r.includes(Re.AZTEC)&&o.push(new du),r.includes(Re.PDF_417)&&o.push(new Eu),i&&n&&o.push(new na(e))}o.length===0&&(n||o.push(new na(e)),o.push(new bu),o.push(new yu),o.push(new du),o.push(new Eu),n&&o.push(new na(e))),this.readers=o},t.prototype.reset=function(){var e,n;if(this.readers!==null)try{for(var r=G2(this.readers),o=r.next();!o.done;o=r.next())o.value.reset()}catch(i){e={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.decodeInternal=function(e){var n,r;if(this.readers===null)throw new U2("No readers where selected, nothing can be read.");try{for(var o=G2(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(e,this.hints)}catch(s){if(s instanceof U2)continue}}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new he("No MultiFormat Readers were able to detect the code.")},t}(),WI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var o=new q2;return o.setHints(n),t.call(this,o,r)||this}WI(e,t),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)}})(Zi);var KI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new Eu,n)||this}KI(e,t)})(Zi);var H2,zI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new bu,n)||this}zI(e,t)})(Zi),function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(H2||(H2={}));var XI=function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var n=0,r=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i-1;a++)for(var s=r[a],c=0;c<o-1;c++){var u=s[c];u===s[c+1]&&u===r[a+1][c]&&u===r[a+1][c+1]&&n++}return t.N2*n},t.applyMaskPenaltyRule3=function(e){for(var n=0,r=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var c=r[a];s+6<o&&c[s]===1&&c[s+1]===0&&c[s+2]===1&&c[s+3]===1&&c[s+4]===1&&c[s+5]===0&&c[s+6]===1&&(t.isWhiteHorizontal(c,s-4,s)||t.isWhiteHorizontal(c,s+7,s+11))&&n++,a+6<i&&r[a][s]===1&&r[a+1][s]===0&&r[a+2][s]===1&&r[a+3][s]===1&&r[a+4][s]===1&&r[a+5][s]===0&&r[a+6][s]===1&&(t.isWhiteVertical(r,s,a-4,a)||t.isWhiteVertical(r,s,a+7,a+11))&&n++}return n*t.N3},t.isWhiteHorizontal=function(e,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var o=n;o<r;o++)if(e[o]===1)return!1;return!0},t.isWhiteVertical=function(e,n,r,o){r=Math.max(r,0),o=Math.min(o,e.length);for(var i=r;i<o;i++)if(e[i][n]===1)return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var n=0,r=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=r[a],c=0;c<o;c++)s[c]===1&&n++;var u=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*n-u)/u)*t.N4},t.getDataMaskBit=function(e,n,r){var o,i;switch(e){case 0:o=r+n&1;break;case 1:o=1&r;break;case 2:o=n%3;break;case 3:o=(r+n)%3;break;case 4:o=Math.floor(r/2)+Math.floor(n/3)&1;break;case 5:o=(1&(i=r*n))+i%3;break;case 6:o=(1&(i=r*n))+i%3&1;break;case 7:o=(i=r*n)%3+(r+n&1)&1;break;default:throw new Ve("Invalid mask pattern: "+e)}return o===0},t.applyMaskPenaltyRule1Internal=function(e,n){for(var r=0,o=n?e.getHeight():e.getWidth(),i=n?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<o;s++){for(var c=0,u=-1,d=0;d<i;d++){var h=n?a[s][d]:a[d][s];h===u?c++:(c>=5&&(r+=t.N1+(c-5)),c=1,u=h)}c>=5&&(r+=t.N1+(c-5))}return r},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),QI=function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var e=new xt;return e.append(`<<
141
+ `,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],t.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"],t}(),ft=function(){function t(){}return t.round=function(e){return e===NaN?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0},t.distance=function(e,n,r,o){var i=e-r,a=n-o;return Math.sqrt(i*i+a*a)},t.sum=function(e){for(var n=0,r=0,o=e.length;r!==o;r++)n+=e[r];return n},t}(),Cf=function(){function t(){}return t.floatToIntBits=function(e){return e},t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Pe=function(){function t(e,n){this.x=e,this.y=n}return t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t.prototype.equals=function(e){if(e instanceof t){var n=e;return this.x===n.x&&this.y===n.y}return!1},t.prototype.hashCode=function(){return 31*Cf.floatToIntBits(this.x)+Cf.floatToIntBits(this.y)},t.prototype.toString=function(){return"("+this.x+","+this.y+")"},t.orderBestPatterns=function(e){var n,r,o,i=this.distance(e[0],e[1]),a=this.distance(e[1],e[2]),s=this.distance(e[0],e[2]);if(a>=i&&a>=s?(r=e[0],n=e[1],o=e[2]):s>=a&&s>=i?(r=e[1],n=e[0],o=e[2]):(r=e[2],n=e[0],o=e[1]),this.crossProductZ(n,r,o)<0){var c=n;n=o,o=c}e[0]=n,e[1]=r,e[2]=o},t.distance=function(e,n){return ft.distance(e.x,e.y,n.x,n.y)},t.crossProductZ=function(e,n,r){var o=n.x,i=n.y;return(r.x-o)*(e.y-i)-(r.y-i)*(e.x-o)},t}(),_f=function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),GS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),qS=function(t){function e(n,r,o,i,a){var s=t.call(this,n,r)||this;return s.compact=o,s.nbDatablocks=i,s.nbLayers=a,s}return GS(e,t),e.prototype.getNbLayers=function(){return this.nbLayers},e.prototype.getNbDatablocks=function(){return this.nbDatablocks},e.prototype.isCompact=function(){return this.compact},e}(_f),Af=function(){function t(e,n,r,o){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),n==null&&(n=t.INIT_SIZE),r==null&&(r=e.getWidth()/2|0),o==null&&(o=e.getHeight()/2|0);var i=n/2|0;if(this.leftInit=r-i,this.rightInit=r+i,this.upInit=o-i,this.downInit=o+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new he}return t.prototype.detect=function(){for(var e=this.leftInit,n=this.rightInit,r=this.upInit,o=this.downInit,i=!1,a=!0,s=!1,c=!1,u=!1,d=!1,h=!1,f=this.width,p=this.height;a;){a=!1;for(var l=!0;(l||!c)&&n<f;)(l=this.containsBlackPoint(r,o,n,!1))?(n++,a=!0,c=!0):c||n++;if(n>=f){i=!0;break}for(var g=!0;(g||!u)&&o<p;)(g=this.containsBlackPoint(e,n,o,!0))?(o++,a=!0,u=!0):u||o++;if(o>=p){i=!0;break}for(var m=!0;(m||!d)&&e>=0;)(m=this.containsBlackPoint(r,o,e,!1))?(e--,a=!0,d=!0):d||e--;if(e<0){i=!0;break}for(var y=!0;(y||!h)&&r>=0;)(y=this.containsBlackPoint(e,n,r,!0))?(r--,a=!0,h=!0):h||r--;if(r<0){i=!0;break}a&&(s=!0)}if(!i&&s){for(var w=n-e,b=null,E=1;b===null&&E<w;E++)b=this.getBlackPointOnSegment(e,o-E,e+E,o);if(b==null)throw new he;var C=null;for(E=1;C===null&&E<w;E++)C=this.getBlackPointOnSegment(e,r+E,e+E,r);if(C==null)throw new he;var I=null;for(E=1;I===null&&E<w;E++)I=this.getBlackPointOnSegment(n,r+E,n-E,r);if(I==null)throw new he;var T=null;for(E=1;T===null&&E<w;E++)T=this.getBlackPointOnSegment(n,o-E,n-E,o);if(T==null)throw new he;return this.centerEdges(T,b,I,C)}throw new he},t.prototype.getBlackPointOnSegment=function(e,n,r,o){for(var i=ft.round(ft.distance(e,n,r,o)),a=(r-e)/i,s=(o-n)/i,c=this.image,u=0;u<i;u++){var d=ft.round(e+u*a),h=ft.round(n+u*s);if(c.get(d,h))return new Pe(d,h)}return null},t.prototype.centerEdges=function(e,n,r,o){var i=e.getX(),a=e.getY(),s=n.getX(),c=n.getY(),u=r.getX(),d=r.getY(),h=o.getX(),f=o.getY(),p=t.CORR;return i<this.width/2?[new Pe(h-p,f+p),new Pe(s+p,c+p),new Pe(u-p,d-p),new Pe(i+p,a-p)]:[new Pe(h+p,f+p),new Pe(s+p,c-p),new Pe(u-p,d+p),new Pe(i-p,a-p)]},t.prototype.containsBlackPoint=function(e,n,r,o){var i=this.image;if(o){for(var a=e;a<=n;a++)if(i.get(a,r))return!0}else for(var s=e;s<=n;s++)if(i.get(r,s))return!0;return!1},t.INIT_SIZE=10,t.CORR=1,t}(),p2=function(){function t(){}return t.checkAndNudgePoints=function(e,n){for(var r=e.getWidth(),o=e.getHeight(),i=!0,a=0;a<n.length&&i;a+=2){var s=Math.floor(n[a]),c=Math.floor(n[a+1]);if(s<-1||s>r||c<-1||c>o)throw new he;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),c===-1?(n[a+1]=0,i=!0):c===o&&(n[a+1]=o-1,i=!0)}for(i=!0,a=n.length-2;a>=0&&i;a-=2){if(s=Math.floor(n[a]),c=Math.floor(n[a+1]),s<-1||s>r||c<-1||c>o)throw new he;i=!1,s===-1?(n[a]=0,i=!0):s===r&&(n[a]=r-1,i=!0),c===-1?(n[a+1]=0,i=!0):c===o&&(n[a+1]=o-1,i=!0)}},t}(),g2=function(){function t(e,n,r,o,i,a,s,c,u){this.a11=e,this.a21=n,this.a31=r,this.a12=o,this.a22=i,this.a32=a,this.a13=s,this.a23=c,this.a33=u}return t.quadrilateralToQuadrilateral=function(e,n,r,o,i,a,s,c,u,d,h,f,p,l,g,m){var y=t.quadrilateralToSquare(e,n,r,o,i,a,s,c);return t.squareToQuadrilateral(u,d,h,f,p,l,g,m).times(y)},t.prototype.transformPoints=function(e){for(var n=e.length,r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,c=this.a23,u=this.a31,d=this.a32,h=this.a33,f=0;f<n;f+=2){var p=e[f],l=e[f+1],g=i*p+c*l+h;e[f]=(r*p+a*l+u)/g,e[f+1]=(o*p+s*l+d)/g}},t.prototype.transformPointsWithValues=function(e,n){for(var r=this.a11,o=this.a12,i=this.a13,a=this.a21,s=this.a22,c=this.a23,u=this.a31,d=this.a32,h=this.a33,f=e.length,p=0;p<f;p++){var l=e[p],g=n[p],m=i*l+c*g+h;e[p]=(r*l+a*g+u)/m,n[p]=(o*l+s*g+d)/m}},t.squareToQuadrilateral=function(e,n,r,o,i,a,s,c){var u=e-r+i-s,d=n-o+a-c;if(u===0&&d===0)return new t(r-e,i-r,e,o-n,a-o,n,0,0,1);var h=r-i,f=s-i,p=o-a,l=c-a,g=h*l-f*p,m=(u*l-f*d)/g,y=(h*d-u*p)/g;return new t(r-e+m*r,s-e+y*s,e,o-n+m*o,c-n+y*c,n,m,y,1)},t.quadrilateralToSquare=function(e,n,r,o,i,a,s,c){return t.squareToQuadrilateral(e,n,r,o,i,a,s,c).buildAdjoint()},t.prototype.buildAdjoint=function(){return new t(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)},t.prototype.times=function(e){return new t(this.a11*e.a11+this.a21*e.a12+this.a31*e.a13,this.a11*e.a21+this.a21*e.a22+this.a31*e.a23,this.a11*e.a31+this.a21*e.a32+this.a31*e.a33,this.a12*e.a11+this.a22*e.a12+this.a32*e.a13,this.a12*e.a21+this.a22*e.a22+this.a32*e.a23,this.a12*e.a31+this.a22*e.a32+this.a32*e.a33,this.a13*e.a11+this.a23*e.a12+this.a33*e.a13,this.a13*e.a21+this.a23*e.a22+this.a33*e.a23,this.a13*e.a31+this.a23*e.a32+this.a33*e.a33)},t}(),HS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$S=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return HS(e,t),e.prototype.sampleGrid=function(n,r,o,i,a,s,c,u,d,h,f,p,l,g,m,y,w,b,E){var C=g2.quadrilateralToQuadrilateral(i,a,s,c,u,d,h,f,p,l,g,m,y,w,b,E);return this.sampleGridWithTransform(n,r,o,C)},e.prototype.sampleGridWithTransform=function(n,r,o,i){if(r<=0||o<=0)throw new he;for(var a=new oo(r,o),s=new Float32Array(2*r),c=0;c<o;c++){for(var u=s.length,d=c+.5,h=0;h<u;h+=2)s[h]=h/2+.5,s[h+1]=d;i.transformPoints(s),p2.checkAndNudgePoints(n,s);try{for(h=0;h<u;h+=2)n.get(Math.floor(s[h]),Math.floor(s[h+1]))&&a.set(h/2,c)}catch{throw new he}}return a},e}(p2),Sf=function(){function t(){}return t.setGridSampler=function(e){t.gridSampler=e},t.getInstance=function(){return t.gridSampler},t.gridSampler=new $S,t}(),Kn=function(){function t(e,n){this.x=e,this.y=n}return t.prototype.toResultPoint=function(){return new Pe(this.getX(),this.getY())},t.prototype.getX=function(){return this.x},t.prototype.getY=function(){return this.y},t}(),YS=function(){function t(e){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=e}return t.prototype.detect=function(){return this.detectMirror(!1)},t.prototype.detectMirror=function(e){var n=this.getMatrixCenter(),r=this.getBullsEyeCorners(n);if(e){var o=r[0];r[0]=r[2],r[2]=o}this.extractParameters(r);var i=this.sampleGrid(this.image,r[this.shift%4],r[(this.shift+1)%4],r[(this.shift+2)%4],r[(this.shift+3)%4]),a=this.getMatrixCornerPoints(r);return new qS(i,a,this.compact,this.nbDataBlocks,this.nbLayers)},t.prototype.extractParameters=function(e){if(!(this.isValidPoint(e[0])&&this.isValidPoint(e[1])&&this.isValidPoint(e[2])&&this.isValidPoint(e[3])))throw new he;var n=2*this.nbCenterLayers,r=new Int32Array([this.sampleLine(e[0],e[1],n),this.sampleLine(e[1],e[2],n),this.sampleLine(e[2],e[3],n),this.sampleLine(e[3],e[0],n)]);this.shift=this.getRotation(r,n);for(var o=0,i=0;i<4;i++){var a=r[(this.shift+i)%4];this.compact?(o<<=7,o+=a>>1&127):(o<<=10,o+=(a>>2&992)+(a>>1&31))}var s=this.getCorrectedParameterData(o,this.compact);this.compact?(this.nbLayers=1+(s>>6),this.nbDataBlocks=1+(63&s)):(this.nbLayers=1+(s>>11),this.nbDataBlocks=1+(2047&s))},t.prototype.getRotation=function(e,n){var r=0;e.forEach(function(i,a,s){r=(r<<3)+((i>>n-2<<1)+(1&i))}),r=((1&r)<<11)+(r>>1);for(var o=0;o<4;o++)if(bn.bitCount(r^this.EXPECTED_CORNER_BITS[o])<=2)return o;throw new he},t.prototype.getCorrectedParameterData=function(e,n){var r,o;n?(r=7,o=2):(r=10,o=4);for(var i=r-o,a=new Int32Array(r),s=r-1;s>=0;--s)a[s]=15&e,e>>=4;try{new lu(Mo.AZTEC_PARAM).decode(a,i)}catch{throw new he}var c=0;for(s=0;s<o;s++)c=(c<<4)+a[s];return c},t.prototype.getBullsEyeCorners=function(e){var n=e,r=e,o=e,i=e,a=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){var s=this.getFirstDifferent(n,a,1,-1),c=this.getFirstDifferent(r,a,1,1),u=this.getFirstDifferent(o,a,-1,1),d=this.getFirstDifferent(i,a,-1,-1);if(this.nbCenterLayers>2){var h=this.distancePoint(d,s)*this.nbCenterLayers/(this.distancePoint(i,n)*(this.nbCenterLayers+2));if(h<.75||h>1.25||!this.isWhiteOrBlackRectangle(s,c,u,d))break}n=s,r=c,o=u,i=d,a=!a}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new he;this.compact=this.nbCenterLayers===5;var f=new Pe(n.getX()+.5,n.getY()-.5),p=new Pe(r.getX()+.5,r.getY()+.5),l=new Pe(o.getX()-.5,o.getY()+.5),g=new Pe(i.getX()-.5,i.getY()-.5);return this.expandSquare([f,p,l,g],2*this.nbCenterLayers-3,2*this.nbCenterLayers)},t.prototype.getMatrixCenter=function(){var e,n,r,o;try{e=(u=new Af(this.image).detect())[0],n=u[1],r=u[2],o=u[3]}catch{var i=this.image.getWidth()/2,a=this.image.getHeight()/2;e=this.getFirstDifferent(new Kn(i+7,a-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new Kn(i+7,a+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Kn(i-7,a+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new Kn(i-7,a-7),!1,-1,-1).toResultPoint()}var s=ft.round((e.getX()+o.getX()+n.getX()+r.getX())/4),c=ft.round((e.getY()+o.getY()+n.getY()+r.getY())/4);try{var u;e=(u=new Af(this.image,15,s,c).detect())[0],n=u[1],r=u[2],o=u[3]}catch{e=this.getFirstDifferent(new Kn(s+7,c-7),!1,1,-1).toResultPoint(),n=this.getFirstDifferent(new Kn(s+7,c+7),!1,1,1).toResultPoint(),r=this.getFirstDifferent(new Kn(s-7,c+7),!1,-1,1).toResultPoint(),o=this.getFirstDifferent(new Kn(s-7,c-7),!1,-1,-1).toResultPoint()}return s=ft.round((e.getX()+o.getX()+n.getX()+r.getX())/4),c=ft.round((e.getY()+o.getY()+n.getY()+r.getY())/4),new Kn(s,c)},t.prototype.getMatrixCornerPoints=function(e){return this.expandSquare(e,2*this.nbCenterLayers,this.getDimension())},t.prototype.sampleGrid=function(e,n,r,o,i){var a=Sf.getInstance(),s=this.getDimension(),c=s/2-this.nbCenterLayers,u=s/2+this.nbCenterLayers;return a.sampleGrid(e,s,s,c,c,u,c,u,u,c,u,n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY(),i.getX(),i.getY())},t.prototype.sampleLine=function(e,n,r){for(var o=0,i=this.distanceResultPoint(e,n),a=i/r,s=e.getX(),c=e.getY(),u=a*(n.getX()-e.getX())/i,d=a*(n.getY()-e.getY())/i,h=0;h<r;h++)this.image.get(ft.round(s+h*u),ft.round(c+h*d))&&(o|=1<<r-h-1);return o},t.prototype.isWhiteOrBlackRectangle=function(e,n,r,o){e=new Kn(e.getX()-3,e.getY()+3),n=new Kn(n.getX()-3,n.getY()-3),r=new Kn(r.getX()+3,r.getY()-3),o=new Kn(o.getX()+3,o.getY()+3);var i=this.getColor(o,e);if(i===0)return!1;var a=this.getColor(e,n);return a===i&&(a=this.getColor(n,r))===i&&(a=this.getColor(r,o))===i},t.prototype.getColor=function(e,n){for(var r=this.distancePoint(e,n),o=(n.getX()-e.getX())/r,i=(n.getY()-e.getY())/r,a=0,s=e.getX(),c=e.getY(),u=this.image.get(e.getX(),e.getY()),d=Math.ceil(r),h=0;h<d;h++)s+=o,c+=i,this.image.get(ft.round(s),ft.round(c))!==u&&a++;var f=a/r;return f>.1&&f<.9?0:f<=.1===u?1:-1},t.prototype.getFirstDifferent=function(e,n,r,o){for(var i=e.getX()+r,a=e.getY()+o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r,a+=o;for(i-=r,a-=o;this.isValid(i,a)&&this.image.get(i,a)===n;)i+=r;for(i-=r;this.isValid(i,a)&&this.image.get(i,a)===n;)a+=o;return new Kn(i,a-=o)},t.prototype.expandSquare=function(e,n,r){var o=r/(2*n),i=e[0].getX()-e[2].getX(),a=e[0].getY()-e[2].getY(),s=(e[0].getX()+e[2].getX())/2,c=(e[0].getY()+e[2].getY())/2,u=new Pe(s+o*i,c+o*a),d=new Pe(s-o*i,c-o*a);return i=e[1].getX()-e[3].getX(),a=e[1].getY()-e[3].getY(),s=(e[1].getX()+e[3].getX())/2,c=(e[1].getY()+e[3].getY())/2,[u,new Pe(s+o*i,c+o*a),d,new Pe(s-o*i,c-o*a)]},t.prototype.isValid=function(e,n){return e>=0&&e<this.image.getWidth()&&n>0&&n<this.image.getHeight()},t.prototype.isValidPoint=function(e){var n=ft.round(e.getX()),r=ft.round(e.getY());return this.isValid(n,r)},t.prototype.distancePoint=function(e,n){return ft.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.distanceResultPoint=function(e,n){return ft.distance(e.getX(),e.getY(),n.getX(),n.getY())},t.prototype.getDimension=function(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(bn.truncDivision(this.nbLayers-4,8)+1)+15},t}(),du=function(){function t(){}return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=null,o=new YS(e.getBlackMatrix()),i=null,a=null;try{i=(s=o.detectMirror(!1)).getPoints(),this.reportFoundResultPoints(n,i),a=new h2().decode(s)}catch(h){r=h}if(a==null)try{var s;i=(s=o.detectMirror(!0)).getPoints(),this.reportFoundResultPoints(n,i),a=new h2().decode(s)}catch(h){throw r??h}var c=new Wn(a.getText(),a.getRawBytes(),a.getNumBits(),i,Re.AZTEC,Nt.currentTimeMillis()),u=a.getByteSegments();u!=null&&c.putMetadata(Cn.BYTE_SEGMENTS,u);var d=a.getECLevel();return d!=null&&c.putMetadata(Cn.ERROR_CORRECTION_LEVEL,d),c},t.prototype.reportFoundResultPoints=function(e,n){if(e!=null){var r=e.get(Pt.NEED_RESULT_POINT_CALLBACK);r!=null&&n.forEach(function(o,i,a){r.foundPossibleResultPoint(o)})}},t.prototype.reset=function(){},t}(),WS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new du,n)||this}WS(e,t)})(Zi);var _n=function(){function t(){}return t.prototype.decode=function(e,n){try{return this.doDecode(e,n)}catch{if(n&&n.get(Pt.TRY_HARDER)===!0&&e.isRotateSupported()){var r=e.rotateCounterClockwise(),o=this.doDecode(r,n),i=o.getResultMetadata(),a=270;i!==null&&i.get(Cn.ORIENTATION)===!0&&(a+=i.get(Cn.ORIENTATION)%360),o.putMetadata(Cn.ORIENTATION,a);var s=o.getResultPoints();if(s!==null)for(var c=r.getHeight(),u=0;u<s.length;u++)s[u]=new Pe(c-s[u].getY()-1,s[u].getX());return o}throw new he}},t.prototype.reset=function(){},t.prototype.doDecode=function(e,n){var r,o=e.getWidth(),i=e.getHeight(),a=new Ur(o),s=n&&n.get(Pt.TRY_HARDER)===!0,c=Math.max(1,i>>(s?8:5));r=s?i:15;for(var u=Math.trunc(i/2),d=0;d<r;d++){var h=Math.trunc((d+1)/2),f=u+c*(1&d?-h:h);if(f<0||f>=i)break;try{a=e.getBlackRow(f,a)}catch{continue}for(var p=function(y){if(y===1&&(a.reverse(),n&&n.get(Pt.NEED_RESULT_POINT_CALLBACK)===!0)){var w=new Map;n.forEach(function(C,I){return w.set(I,C)}),w.delete(Pt.NEED_RESULT_POINT_CALLBACK),n=w}try{var b=l.decodeRow(f,a,n);if(y===1){b.putMetadata(Cn.ORIENTATION,180);var E=b.getResultPoints();E!==null&&(E[0]=new Pe(o-E[0].getX()-1,E[0].getY()),E[1]=new Pe(o-E[1].getX()-1,E[1].getY()))}return{value:b}}catch{}},l=this,g=0;g<2;g++){var m=p(g);if(typeof m=="object")return m.value}}throw new he},t.recordPattern=function(e,n,r){for(var o=r.length,i=0;i<o;i++)r[i]=0;var a=e.getSize();if(n>=a)throw new he;for(var s=!e.get(n),c=0,u=n;u<a;){if(e.get(u)!==s)r[c]++;else{if(++c===o)break;r[c]=1,s=!s}u++}if(c!==o&&(c!==o-1||u!==a))throw new he},t.recordPatternInReverse=function(e,n,r){for(var o=r.length,i=e.get(n);n>0&&o>=0;)e.get(--n)!==i&&(o--,i=!i);if(o>=0)throw new he;t.recordPattern(e,n+1,r)},t.patternMatchVariance=function(e,n,r){for(var o=e.length,i=0,a=0,s=0;s<o;s++)i+=e[s],a+=n[s];if(i<a)return Number.POSITIVE_INFINITY;var c=i/a;r*=c;for(var u=0,d=0;d<o;d++){var h=e[d],f=n[d]*c,p=h>f?h-f:f-h;if(p>r)return Number.POSITIVE_INFINITY;u+=p}return u/i},t}(),KS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),m2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return KS(e,t),e.findStartPattern=function(n){for(var r=n.getSize(),o=n.getNextSet(0),i=0,a=Int32Array.from([0,0,0,0,0,0]),s=o,c=!1,u=o;u<r;u++)if(n.get(u)!==c)a[i]++;else{if(i===5){for(var d=e.MAX_AVG_VARIANCE,h=-1,f=e.CODE_START_A;f<=e.CODE_START_C;f++){var p=_n.patternMatchVariance(a,e.CODE_PATTERNS[f],e.MAX_INDIVIDUAL_VARIANCE);p<d&&(d=p,h=f)}if(h>=0&&n.isRange(Math.max(0,s-(u-s)/2),s,!1))return Int32Array.from([s,u,h]);s+=a[0]+a[1],(a=a.slice(2,a.length-1))[i-1]=0,a[i]=0,i--}else i++;a[i]=1,c=!c}throw new he},e.decodeCode=function(n,r,o){_n.recordPattern(n,o,r);for(var i=e.MAX_AVG_VARIANCE,a=-1,s=0;s<e.CODE_PATTERNS.length;s++){var c=e.CODE_PATTERNS[s],u=this.patternMatchVariance(r,c,e.MAX_INDIVIDUAL_VARIANCE);u<i&&(i=u,a=s)}if(a>=0)return a;throw new he},e.prototype.decodeRow=function(n,r,o){var i,a=o&&o.get(Pt.ASSUME_GS1)===!0,s=e.findStartPattern(r),c=s[2],u=0,d=new Uint8Array(20);switch(d[u++]=c,c){case e.CODE_START_A:i=e.CODE_CODE_A;break;case e.CODE_START_B:i=e.CODE_CODE_B;break;case e.CODE_START_C:i=e.CODE_CODE_C;break;default:throw new Se}for(var h=!1,f=!1,p="",l=s[0],g=s[1],m=Int32Array.from([0,0,0,0,0,0]),y=0,w=0,b=c,E=0,C=!0,I=!1,T=!1;!h;){var P=f;switch(f=!1,y=w,w=e.decodeCode(r,m,g),d[u++]=w,w!==e.CODE_STOP&&(C=!0),w!==e.CODE_STOP&&(b+=++E*w),l=g,g+=m.reduce(function(z,te){return z+te},0),w){case e.CODE_START_A:case e.CODE_START_B:case e.CODE_START_C:throw new Se}switch(i){case e.CODE_CODE_A:if(w<64)p+=T===I?String.fromCharCode(32+w):String.fromCharCode(32+w+128),T=!1;else if(w<96)p+=T===I?String.fromCharCode(w-64):String.fromCharCode(w+64),T=!1;else switch(w!==e.CODE_STOP&&(C=!1),w){case e.CODE_FNC_1:a&&(p.length===0?p+="]C1":p+="");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_A:!I&&T?(I=!0,T=!1):I&&T?(I=!1,T=!1):T=!0;break;case e.CODE_SHIFT:f=!0,i=e.CODE_CODE_B;break;case e.CODE_CODE_B:i=e.CODE_CODE_B;break;case e.CODE_CODE_C:i=e.CODE_CODE_C;break;case e.CODE_STOP:h=!0}break;case e.CODE_CODE_B:if(w<96)p+=T===I?String.fromCharCode(32+w):String.fromCharCode(32+w+128),T=!1;else switch(w!==e.CODE_STOP&&(C=!1),w){case e.CODE_FNC_1:a&&(p.length===0?p+="]C1":p+="");break;case e.CODE_FNC_2:case e.CODE_FNC_3:break;case e.CODE_FNC_4_B:!I&&T?(I=!0,T=!1):I&&T?(I=!1,T=!1):T=!0;break;case e.CODE_SHIFT:f=!0,i=e.CODE_CODE_A;break;case e.CODE_CODE_A:i=e.CODE_CODE_A;break;case e.CODE_CODE_C:i=e.CODE_CODE_C;break;case e.CODE_STOP:h=!0}break;case e.CODE_CODE_C:if(w<100)w<10&&(p+="0"),p+=w;else switch(w!==e.CODE_STOP&&(C=!1),w){case e.CODE_FNC_1:a&&(p.length===0?p+="]C1":p+="");break;case e.CODE_CODE_A:i=e.CODE_CODE_A;break;case e.CODE_CODE_B:i=e.CODE_CODE_B;break;case e.CODE_STOP:h=!0}}P&&(i=i===e.CODE_CODE_A?e.CODE_CODE_B:e.CODE_CODE_A)}var N=g-l;if(g=r.getNextUnset(g),!r.isRange(g,Math.min(r.getSize(),g+(g-l)/2),!1))throw new he;if((b-=E*y)%103!==y)throw new sn;var L=p.length;if(L===0)throw new he;L>0&&C&&(p=i===e.CODE_CODE_C?p.substring(0,L-2):p.substring(0,L-1));for(var V=(s[1]+s[0])/2,j=l+N/2,W=d.length,q=new Uint8Array(W),k=0;k<W;k++)q[k]=d[k];var U=[new Pe(V,n),new Pe(j,n)];return new Wn(p,q,0,U,Re.CODE_128,new Date().getTime())},e.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],e.MAX_AVG_VARIANCE=.25,e.MAX_INDIVIDUAL_VARIANCE=.7,e.CODE_SHIFT=98,e.CODE_CODE_C=99,e.CODE_CODE_B=100,e.CODE_CODE_A=101,e.CODE_FNC_1=102,e.CODE_FNC_2=97,e.CODE_FNC_3=96,e.CODE_FNC_4_A=101,e.CODE_FNC_4_B=100,e.CODE_START_A=103,e.CODE_START_B=104,e.CODE_START_C=105,e.CODE_STOP=106,e}(_n),zS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),If=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},y2=function(t){function e(n,r){n===void 0&&(n=!1),r===void 0&&(r=!1);var o=t.call(this)||this;return o.usingCheckDigit=n,o.extendedMode=r,o.decodeRowResult="",o.counters=new Int32Array(9),o}return zS(e,t),e.prototype.decodeRow=function(n,r,o){var i,a,s,c,u=this.counters;u.fill(0),this.decodeRowResult="";var d,h,f=e.findAsteriskPattern(r,u),p=r.getNextSet(f[1]),l=r.getSize();do{e.recordPattern(r,p,u);var g=e.toNarrowWidePattern(u);if(g<0)throw new he;d=e.patternToChar(g),this.decodeRowResult+=d,h=p;try{for(var m=(i=void 0,If(u)),y=m.next();!y.done;y=m.next())p+=y.value}catch(V){i={error:V}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}p=r.getNextSet(p)}while(d!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);var w,b=0;try{for(var E=If(u),C=E.next();!C.done;C=E.next())b+=C.value}catch(V){s={error:V}}finally{try{C&&!C.done&&(c=E.return)&&c.call(E)}finally{if(s)throw s.error}}if(p!==l&&2*(p-h-b)<b)throw new he;if(this.usingCheckDigit){for(var I=this.decodeRowResult.length-1,T=0,P=0;P<I;P++)T+=e.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(P));if(this.decodeRowResult.charAt(I)!==e.ALPHABET_STRING.charAt(T%43))throw new sn;this.decodeRowResult=this.decodeRowResult.substring(0,I)}if(this.decodeRowResult.length===0)throw new he;w=this.extendedMode?e.decodeExtended(this.decodeRowResult):this.decodeRowResult;var N=(f[1]+f[0])/2,L=h+b/2;return new Wn(w,null,0,[new Pe(N,n),new Pe(L,n)],Re.CODE_39,new Date().getTime())},e.findAsteriskPattern=function(n,r){for(var o=n.getSize(),i=n.getNextSet(0),a=0,s=i,c=!1,u=r.length,d=i;d<o;d++)if(n.get(d)!==c)r[a]++;else{if(a===u-1){if(this.toNarrowWidePattern(r)===e.ASTERISK_ENCODING&&n.isRange(Math.max(0,s-Math.floor((d-s)/2)),s,!1))return[s,d];s+=r[0]+r[1],r.copyWithin(0,2,2+a-1),r[a-1]=0,r[a]=0,a--}else a++;r[a]=1,c=!c}throw new he},e.toNarrowWidePattern=function(n){var r,o,i,a=n.length,s=0;do{var c=2147483647;try{for(var u=(r=void 0,If(n)),d=u.next();!d.done;d=u.next())(l=d.value)<c&&l>s&&(c=l)}catch(g){r={error:g}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}s=c,i=0;for(var h=0,f=0,p=0;p<a;p++)(l=n[p])>s&&(f|=1<<a-1-p,i++,h+=l);if(i===3){for(p=0;p<a&&i>0;p++){var l;if((l=n[p])>s&&(i--,2*l>=h))return-1}return f}}while(i>3);return-1},e.patternToChar=function(n){for(var r=0;r<e.CHARACTER_ENCODINGS.length;r++)if(e.CHARACTER_ENCODINGS[r]===n)return e.ALPHABET_STRING.charAt(r);if(n===e.ASTERISK_ENCODING)return"*";throw new he},e.decodeExtended=function(n){for(var r=n.length,o="",i=0;i<r;i++){var a=n.charAt(i);if(a==="+"||a==="$"||a==="%"||a==="/"){var s=n.charAt(i+1),c="\0";switch(a){case"+":if(!(s>="A"&&s<="Z"))throw new Se;c=String.fromCharCode(s.charCodeAt(0)+32);break;case"$":if(!(s>="A"&&s<="Z"))throw new Se;c=String.fromCharCode(s.charCodeAt(0)-64);break;case"%":if(s>="A"&&s<="E")c=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")c=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")c=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")c="\0";else if(s==="V")c="@";else if(s==="W")c="`";else{if(s!=="X"&&s!=="Y"&&s!=="Z")throw new Se;c=""}break;case"/":if(s>="A"&&s<="O")c=String.fromCharCode(s.charCodeAt(0)-32);else{if(s!=="Z")throw new Se;c=":"}}o+=c,i++}else o+=a}return o},e.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",e.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],e.ASTERISK_ENCODING=148,e}(_n),XS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),QS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},v2=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.narrowLineWidth=-1,n}return XS(e,t),e.prototype.decodeRow=function(n,r,o){var i,a,s=this.decodeStart(r),c=this.decodeEnd(r),u=new xt;e.decodeMiddle(r,s[1],c[0],u);var d=u.toString(),h=null;o!=null&&(h=o.get(Pt.ALLOWED_LENGTHS)),h==null&&(h=e.DEFAULT_ALLOWED_LENGTHS);var f=d.length,p=!1,l=0;try{for(var g=QS(h),m=g.next();!m.done;m=g.next()){var y=m.value;if(f===y){p=!0;break}y>l&&(l=y)}}catch(b){i={error:b}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}if(!p&&f>l&&(p=!0),!p)throw new Se;var w=[new Pe(s[1],n),new Pe(c[0],n)];return new Wn(d,null,0,w,Re.ITF,new Date().getTime())},e.decodeMiddle=function(n,r,o,i){var a=new Int32Array(10),s=new Int32Array(5),c=new Int32Array(5);for(a.fill(0),s.fill(0),c.fill(0);r<o;){_n.recordPattern(n,r,a);for(var u=0;u<5;u++){var d=2*u;s[u]=a[d],c[u]=a[d+1]}var h=e.decodeDigit(s);i.append(h.toString()),h=this.decodeDigit(c),i.append(h.toString()),a.forEach(function(f){r+=f})}},e.prototype.decodeStart=function(n){var r=e.skipWhiteSpace(n),o=e.findGuardPattern(n,r,e.START_PATTERN);return this.narrowLineWidth=(o[1]-o[0])/4,this.validateQuietZone(n,o[0]),o},e.prototype.validateQuietZone=function(n,r){var o=10*this.narrowLineWidth;o=o<r?o:r;for(var i=r-1;o>0&&i>=0&&!n.get(i);i--)o--;if(o!==0)throw new he},e.skipWhiteSpace=function(n){var r=n.getSize(),o=n.getNextSet(0);if(o===r)throw new he;return o},e.prototype.decodeEnd=function(n){n.reverse();try{var r=e.skipWhiteSpace(n),o=void 0;try{o=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[0])}catch(a){a instanceof he&&(o=e.findGuardPattern(n,r,e.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,o[0]);var i=o[0];return o[0]=n.getSize()-o[1],o[1]=n.getSize()-i,o}finally{n.reverse()}},e.findGuardPattern=function(n,r,o){var i=o.length,a=new Int32Array(i),s=n.getSize(),c=!1,u=0,d=r;a.fill(0);for(var h=r;h<s;h++)if(n.get(h)!==c)a[u]++;else{if(u===i-1){if(_n.patternMatchVariance(a,o,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return[d,h];d+=a[0]+a[1],Nt.arraycopy(a,2,a,0,u-1),a[u-1]=0,a[u]=0,u--}else u++;a[u]=1,c=!c}throw new he},e.decodeDigit=function(n){for(var r=e.MAX_AVG_VARIANCE,o=-1,i=e.PATTERNS.length,a=0;a<i;a++){var s=e.PATTERNS[a],c=_n.patternMatchVariance(n,s,e.MAX_INDIVIDUAL_VARIANCE);c<r?(r=c,o=a):c===r&&(o=-1)}if(o>=0)return o%10;throw new he},e.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],e.MAX_AVG_VARIANCE=.38,e.MAX_INDIVIDUAL_VARIANCE=.5,e.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],e.START_PATTERN=Int32Array.from([1,1,1,1]),e.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])],e}(_n),JS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),ea=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.decodeRowStringBuffer="",n}return JS(e,t),e.findStartGuardPattern=function(n){for(var r,o=!1,i=0,a=Int32Array.from([0,0,0]);!o;){a=Int32Array.from([0,0,0]);var s=(r=e.findGuardPattern(n,i,!1,this.START_END_PATTERN,a))[0],c=s-((i=r[1])-s);c>=0&&(o=n.isRange(c,s,!1))}return r},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===o},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}return(1e3-o)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e.findGuardPatternWithoutCounters=function(n,r,o,i){return this.findGuardPattern(n,r,o,i,new Int32Array(i.length))},e.findGuardPattern=function(n,r,o,i,a){for(var s=n.getSize(),c=0,u=r=o?n.getNextUnset(r):n.getNextSet(r),d=i.length,h=o,f=r;f<s;f++)if(n.get(f)!==h)a[c]++;else{if(c===d-1){if(_n.patternMatchVariance(a,i,e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return Int32Array.from([u,f]);u+=a[0]+a[1];for(var p=a.slice(2,a.length-1),l=0;l<c-1;l++)a[l]=p[l];a[c-1]=0,a[c]=0,c--}else c++;a[c]=1,h=!h}throw new he},e.decodeDigit=function(n,r,o,i){this.recordPattern(n,o,r);for(var a=this.MAX_AVG_VARIANCE,s=-1,c=i.length,u=0;u<c;u++){var d=i[u],h=_n.patternMatchVariance(r,d,e.MAX_INDIVIDUAL_VARIANCE);h<a&&(a=h,s=u)}if(s>=0)return s;throw new he},e.MAX_AVG_VARIANCE=.48,e.MAX_INDIVIDUAL_VARIANCE=.7,e.START_END_PATTERN=Int32Array.from([1,1,1]),e.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),e.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])],e}(_n),ZS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},e9=function(){function t(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=t.parseExtensionString(a),c=[new Pe((r[0]+r[1])/2,e),new Pe(i,e)],u=new Wn(a,null,0,c,Re.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),c=n[1],u=0,d=0;d<5&&c<s;d++){var h=ea.decodeDigit(e,a,c,ea.L_AND_G_PATTERNS);r+=String.fromCharCode(48+h%10);try{for(var f=(o=void 0,ZS(a)),p=f.next();!p.done;p=f.next())c+=p.value}catch(g){o={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(u|=1<<4-d),d!==4&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(r.length!==5)throw new he;var l=this.determineCheckDigit(u);if(t.extensionChecksum(r.toString())!==l)throw new he;return c},t.extensionChecksum=function(e){for(var n=e.length,r=0,o=n-2;o>=0;o-=2)r+=e.charAt(o).charCodeAt(0)-48;for(r*=3,o=n-1;o>=0;o-=2)r+=e.charAt(o).charCodeAt(0)-48;return(r*=3)%10},t.prototype.determineCheckDigit=function(e){for(var n=0;n<10;n++)if(e===this.CHECK_DIGIT_ENCODINGS[n])return n;throw new he},t.parseExtensionString=function(e){if(e.length!==5)return null;var n=t.parseExtension5String(e);return n==null?null:new Map([[Cn.SUGGESTED_PRICE,n]])},t.parseExtension5String=function(e){var n;switch(e.charAt(0)){case"0":n="£";break;case"5":n="$";break;case"9":switch(e){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}n="";break;default:n=""}var r=parseInt(e.substring(1)),o=r%100;return n+(r/100).toString()+"."+(o<10?"0"+o:o.toString())},t}(),t9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},n9=function(){function t(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}return t.prototype.decodeRow=function(e,n,r){var o=this.decodeRowStringBuffer,i=this.decodeMiddle(n,r,o),a=o.toString(),s=t.parseExtensionString(a),c=[new Pe((r[0]+r[1])/2,e),new Pe(i,e)],u=new Wn(a,null,0,c,Re.UPC_EAN_EXTENSION,new Date().getTime());return s!=null&&u.putAllMetadata(s),u},t.prototype.decodeMiddle=function(e,n,r){var o,i,a=this.decodeMiddleCounters;a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var s=e.getSize(),c=n[1],u=0,d=0;d<2&&c<s;d++){var h=ea.decodeDigit(e,a,c,ea.L_AND_G_PATTERNS);r+=String.fromCharCode(48+h%10);try{for(var f=(o=void 0,t9(a)),p=f.next();!p.done;p=f.next())c+=p.value}catch(l){o={error:l}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}h>=10&&(u|=1<<1-d),d!==1&&(c=e.getNextSet(c),c=e.getNextUnset(c))}if(r.length!==2)throw new he;if(parseInt(r.toString())%4!==u)throw new he;return c},t.parseExtensionString=function(e){return e.length!==2?null:new Map([[Cn.ISSUE_NUMBER,parseInt(e)]])},t}(),r9=function(){function t(){}return t.decodeRow=function(e,n,r){var o=ea.findGuardPattern(n,r,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new e9().decodeRow(e,n,o)}catch{return new n9().decodeRow(e,n,o)}},t.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]),t}(),o9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cn=function(t){function e(){var n=t.call(this)||this;n.decodeRowStringBuffer="",e.L_AND_G_PATTERNS=e.L_PATTERNS.map(function(s){return Int32Array.from(s)});for(var r=10;r<20;r++){for(var o=e.L_PATTERNS[r-10],i=new Int32Array(o.length),a=0;a<o.length;a++)i[a]=o[o.length-a-1];e.L_AND_G_PATTERNS[r]=i}return n}return o9(e,t),e.prototype.decodeRow=function(n,r,o){var i=e.findStartGuardPattern(r),a=o==null?null:o.get(Pt.NEED_RESULT_POINT_CALLBACK);if(a!=null){var s=new Pe((i[0]+i[1])/2,n);a.foundPossibleResultPoint(s)}var c=this.decodeMiddle(r,i,this.decodeRowStringBuffer),u=c.rowOffset,d=c.resultString;if(a!=null){var h=new Pe(u,n);a.foundPossibleResultPoint(h)}var f=e.decodeEnd(r,u);if(a!=null){var p=new Pe((f[0]+f[1])/2,n);a.foundPossibleResultPoint(p)}var l=f[1],g=l+(l-f[0]);if(g>=r.getSize()||!r.isRange(l,g,!1))throw new he;var m=d.toString();if(m.length<8)throw new Se;if(!e.checkChecksum(m))throw new sn;var y=(i[1]+i[0])/2,w=(f[1]+f[0])/2,b=this.getBarcodeFormat(),E=[new Pe(y,n),new Pe(w,n)],C=new Wn(m,null,0,E,b,new Date().getTime()),I=0;try{var T=r9.decodeRow(n,r,f[1]);C.putMetadata(Cn.UPC_EAN_EXTENSION,T.getText()),C.putAllMetadata(T.getResultMetadata()),C.addResultPoints(T.getResultPoints()),I=T.getText().length}catch{}var P=o==null?null:o.get(Pt.ALLOWED_EAN_EXTENSIONS);if(P!=null){var N=!1;for(var L in P)if(I.toString()===L){N=!0;break}if(!N)throw new he}return b===Re.EAN_13||Re.UPC_A,C},e.checkChecksum=function(n){return e.checkStandardUPCEANChecksum(n)},e.checkStandardUPCEANChecksum=function(n){var r=n.length;if(r===0)return!1;var o=parseInt(n.charAt(r-1),10);return e.getStandardUPCEANChecksum(n.substring(0,r-1))===o},e.getStandardUPCEANChecksum=function(n){for(var r=n.length,o=0,i=r-1;i>=0;i-=2){if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}for(o*=3,i=r-2;i>=0;i-=2){var a;if((a=n.charAt(i).charCodeAt(0)-48)<0||a>9)throw new Se;o+=a}return(1e3-o)%10},e.decodeEnd=function(n,r){return e.findGuardPattern(n,r,!1,e.START_END_PATTERN,new Int32Array(e.START_END_PATTERN.length).fill(0))},e}(ea),i9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),w2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Tf=function(t){function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return i9(e,t),e.prototype.decodeMiddle=function(n,r,o){var i,a,s,c,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var d=n.getSize(),h=r[1],f=0,p=0;p<6&&h<d;p++){var l=cn.decodeDigit(n,u,h,cn.L_AND_G_PATTERNS);o+=String.fromCharCode(48+l%10);try{for(var g=(i=void 0,w2(u)),m=g.next();!m.done;m=g.next())h+=m.value}catch(b){i={error:b}}finally{try{m&&!m.done&&(a=g.return)&&a.call(g)}finally{if(i)throw i.error}}l>=10&&(f|=1<<5-p)}for(o=e.determineFirstDigit(o,f),h=cn.findGuardPattern(n,h,!0,cn.MIDDLE_PATTERN,new Int32Array(cn.MIDDLE_PATTERN.length).fill(0))[1],p=0;p<6&&h<d;p++){l=cn.decodeDigit(n,u,h,cn.L_PATTERNS),o+=String.fromCharCode(48+l);try{for(var y=(s=void 0,w2(u)),w=y.next();!w.done;w=y.next())h+=w.value}catch(b){s={error:b}}finally{try{w&&!w.done&&(c=y.return)&&c.call(y)}finally{if(s)throw s.error}}}return{rowOffset:h,resultString:o}},e.prototype.getBarcodeFormat=function(){return Re.EAN_13},e.determineFirstDigit=function(n,r){for(var o=0;o<10;o++)if(r===this.FIRST_DIGIT_ENCODINGS[o])return n=String.fromCharCode(48+o)+n;throw new he},e.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26],e}(cn),a9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),b2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},E2=function(t){function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=Int32Array.from([0,0,0,0]),n}return a9(e,t),e.prototype.decodeMiddle=function(n,r,o){var i,a,s,c,u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;for(var d=n.getSize(),h=r[1],f=0;f<4&&h<d;f++){var p=cn.decodeDigit(n,u,h,cn.L_PATTERNS);o+=String.fromCharCode(48+p);try{for(var l=(i=void 0,b2(u)),g=l.next();!g.done;g=l.next())h+=g.value}catch(w){i={error:w}}finally{try{g&&!g.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}}for(h=cn.findGuardPattern(n,h,!0,cn.MIDDLE_PATTERN,new Int32Array(cn.MIDDLE_PATTERN.length).fill(0))[1],f=0;f<4&&h<d;f++){p=cn.decodeDigit(n,u,h,cn.L_PATTERNS),o+=String.fromCharCode(48+p);try{for(var m=(s=void 0,b2(u)),y=m.next();!y.done;y=m.next())h+=y.value}catch(w){s={error:w}}finally{try{y&&!y.done&&(c=m.return)&&c.call(m)}finally{if(s)throw s.error}}}return{rowOffset:h,resultString:o}},e.prototype.getBarcodeFormat=function(){return Re.EAN_8},e}(cn),s9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),c9=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.ean13Reader=new Tf,n}return s9(e,t),e.prototype.getBarcodeFormat=function(){return Re.UPC_A},e.prototype.decode=function(n,r){return this.maybeReturnResult(this.ean13Reader.decode(n))},e.prototype.decodeRow=function(n,r,o){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,r,o))},e.prototype.decodeMiddle=function(n,r,o){return this.ean13Reader.decodeMiddle(n,r,o)},e.prototype.maybeReturnResult=function(n){var r=n.getText();if(r.charAt(0)==="0"){var o=new Wn(r.substring(1),null,null,n.getResultPoints(),Re.UPC_A);return n.getResultMetadata()!=null&&o.putAllMetadata(n.getResultMetadata()),o}throw new he},e.prototype.reset=function(){this.ean13Reader.reset()},e}(cn),u9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),l9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},C2=function(t){function e(){var n=t.call(this)||this;return n.decodeMiddleCounters=new Int32Array(4),n}return u9(e,t),e.prototype.decodeMiddle=function(n,r,o){var i,a,s=this.decodeMiddleCounters.map(function(g){return g});s[0]=0,s[1]=0,s[2]=0,s[3]=0;for(var c=n.getSize(),u=r[1],d=0,h=0;h<6&&u<c;h++){var f=e.decodeDigit(n,s,u,e.L_AND_G_PATTERNS);o+=String.fromCharCode(48+f%10);try{for(var p=(i=void 0,l9(s)),l=p.next();!l.done;l=p.next())u+=l.value}catch(g){i={error:g}}finally{try{l&&!l.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}f>=10&&(d|=1<<5-h)}return e.determineNumSysAndCheckDigit(new xt(o),d),u},e.prototype.decodeEnd=function(n,r){return e.findGuardPatternWithoutCounters(n,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(n){return cn.checkChecksum(e.convertUPCEtoUPCA(n))},e.determineNumSysAndCheckDigit=function(n,r){for(var o=0;o<=1;o++)for(var i=0;i<10;i++)if(r===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[o][i])return n.insert(0,"0"+o),void n.append("0"+i);throw he.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return Re.UPC_E},e.convertUPCEtoUPCA=function(n){var r=n.slice(1,7).split("").map(function(a){return a.charCodeAt(0)}),o=new xt;o.append(n.charAt(0));var i=r[5];switch(i){case 0:case 1:case 2:o.appendChars(r,0,2),o.append(i),o.append("0000"),o.appendChars(r,2,3);break;case 3:o.appendChars(r,0,3),o.append("00000"),o.appendChars(r,3,2);break;case 4:o.appendChars(r,0,4),o.append("00000"),o.append(r[4]);break;default:o.appendChars(r,0,5),o.append("0000"),o.append(i)}return n.length>=8&&o.append(n.charAt(7)),o.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(cn),d9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),_2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xf=function(t){function e(n){var r=t.call(this)||this,o=n==null?null:n.get(Pt.POSSIBLE_FORMATS),i=[];return o!=null&&(o.indexOf(Re.EAN_13)>-1?i.push(new Tf):o.indexOf(Re.UPC_A)>-1&&i.push(new c9),o.indexOf(Re.EAN_8)>-1&&i.push(new E2),o.indexOf(Re.UPC_E)>-1&&i.push(new C2)),i.length===0&&(i.push(new Tf),i.push(new E2),i.push(new C2)),r.readers=i,r}return d9(e,t),e.prototype.decodeRow=function(n,r,o){var i,a;try{for(var s=_2(this.readers),c=s.next();!c.done;c=s.next()){var u=c.value;try{var d=u.decodeRow(n,r,o),h=d.getBarcodeFormat()===Re.EAN_13&&d.getText().charAt(0)==="0",f=o==null?null:o.get(Pt.POSSIBLE_FORMATS),p=f==null||f.includes(Re.UPC_A);if(h&&p){var l=d.getRawBytes(),g=new Wn(d.getText().substring(1),l,l.length,d.getResultPoints(),Re.UPC_A);return g.putAllMetadata(d.getResultMetadata()),g}return d}catch{}}}catch(m){i={error:m}}finally{try{c&&!c.done&&(a=s.return)&&a.call(s)}finally{if(i)throw i.error}}throw new he},e.prototype.reset=function(){var n,r;try{for(var o=_2(this.readers),i=o.next();!i.done;i=o.next())i.value.reset()}catch(a){n={error:a}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e}(_n),f9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),h9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ui=function(t){function e(){var n=t.call(this)||this;return n.decodeFinderCounters=new Int32Array(4),n.dataCharacterCounters=new Int32Array(8),n.oddRoundingErrors=new Array(4),n.evenRoundingErrors=new Array(4),n.oddCounts=new Array(n.dataCharacterCounters.length/2),n.evenCounts=new Array(n.dataCharacterCounters.length/2),n}return f9(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(n,r){for(var o=0;o<r.length;o++)if(_n.patternMatchVariance(n,r[o],e.MAX_INDIVIDUAL_VARIANCE)<e.MAX_AVG_VARIANCE)return o;throw new he},e.count=function(n){return ft.sum(new Int32Array(n))},e.increment=function(n,r){for(var o=0,i=r[0],a=1;a<n.length;a++)r[a]>i&&(i=r[a],o=a);n[o]++},e.decrement=function(n,r){for(var o=0,i=r[0],a=1;a<n.length;a++)r[a]<i&&(i=r[a],o=a);n[o]--},e.isFinderPattern=function(n){var r,o,i=n[0]+n[1],a=i/(i+n[2]+n[3]);if(a>=e.MIN_FINDER_PATTERN_RATIO&&a<=e.MAX_FINDER_PATTERN_RATIO){var s=Number.MAX_SAFE_INTEGER,c=Number.MIN_SAFE_INTEGER;try{for(var u=h9(n),d=u.next();!d.done;d=u.next()){var h=d.value;h>c&&(c=h),h<s&&(s=h)}}catch(f){r={error:f}}finally{try{d&&!d.done&&(o=u.return)&&o.call(u)}finally{if(r)throw r.error}}return c<10*s}return!1},e.MAX_AVG_VARIANCE=.2,e.MAX_INDIVIDUAL_VARIANCE=.45,e.MIN_FINDER_PATTERN_RATIO=9.5/12,e.MAX_FINDER_PATTERN_RATIO=12.5/14,e}(_n),fu=function(){function t(e,n){this.value=e,this.checksumPortion=n}return t.prototype.getValue=function(){return this.value},t.prototype.getChecksumPortion=function(){return this.checksumPortion},t.prototype.toString=function(){return this.value+"("+this.checksumPortion+")"},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value&&this.checksumPortion===n.checksumPortion},t.prototype.hashCode=function(){return this.value^this.checksumPortion},t}(),A2=function(){function t(e,n,r,o,i){this.value=e,this.startEnd=n,this.value=e,this.startEnd=n,this.resultPoints=new Array,this.resultPoints.push(new Pe(r,i)),this.resultPoints.push(new Pe(o,i))}return t.prototype.getValue=function(){return this.value},t.prototype.getStartEnd=function(){return this.startEnd},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.hashCode=function(){return this.value},t}(),p9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ta=function(){function t(){}return t.getRSSvalue=function(e,n,r){var o,i,a=0;try{for(var s=p9(e),c=s.next();!c.done;c=s.next())a+=c.value}catch(y){o={error:y}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}for(var u=0,d=0,h=e.length,f=0;f<h-1;f++){var p=void 0;for(p=1,d|=1<<f;p<e[f];p++,d&=~(1<<f)){var l=t.combins(a-p-1,h-f-2);if(r&&d===0&&a-p-(h-f-1)>=h-f-1&&(l-=t.combins(a-p-(h-f),h-f-2)),h-f-1>1){for(var g=0,m=a-p-(h-f-2);m>n;m--)g+=t.combins(a-p-m-1,h-f-3);l-=g*(h-1-f)}else a-p>n&&l--;u+=l}a-=p}return u},t.combins=function(e,n){var r,o;e-n>n?(o=n,r=e-n):(o=e-n,r=n);for(var i=1,a=1,s=e;s>r;s--)i*=s,a<=o&&(i/=a,a++);for(;a<=o;)i/=a,a++;return i},t}(),g9=function(){function t(){}return t.buildBitArray=function(e){var n=2*e.length-1;e[e.length-1].getRightChar()==null&&(n-=1);for(var r=new Ur(12*n),o=0,i=e[0].getRightChar().getValue(),a=11;a>=0;--a)i&1<<a&&r.set(o),o++;for(a=1;a<e.length;++a){for(var s=e[a],c=s.getLeftChar().getValue(),u=11;u>=0;--u)c&1<<u&&r.set(o),o++;if(s.getRightChar()!=null){var d=s.getRightChar().getValue();for(u=11;u>=0;--u)d&1<<u&&r.set(o),o++}}return r},t}(),li=function(){function t(e,n){n?this.decodedInformation=null:(this.finished=e,this.decodedInformation=n)}return t.prototype.getDecodedInformation=function(){return this.decodedInformation},t.prototype.isFinished=function(){return this.finished},t}(),Of=function(){function t(e){this.newPosition=e}return t.prototype.getNewPosition=function(){return this.newPosition},t}(),m9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),xr=function(t){function e(n,r){var o=t.call(this,n)||this;return o.value=r,o}return m9(e,t),e.prototype.getValue=function(){return this.value},e.prototype.isFNC1=function(){return this.value===e.FNC1},e.FNC1="$",e}(Of),y9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),di=function(t){function e(n,r,o){var i=t.call(this,n)||this;return o?(i.remaining=!0,i.remainingValue=i.remainingValue):(i.remaining=!1,i.remainingValue=0),i.newString=r,i}return y9(e,t),e.prototype.getNewString=function(){return this.newString},e.prototype.isRemaining=function(){return this.remaining},e.prototype.getRemainingValue=function(){return this.remainingValue},e}(Of),v9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hu=function(t){function e(n,r,o){var i=t.call(this,n)||this;if(r<0||r>10||o<0||o>10)throw new Se;return i.firstDigit=r,i.secondDigit=o,i}return v9(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(Of),pu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},w9=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var n,r,o,i,a,s,c,u;if(!e)return null;if(e.length<2)throw new he;var d=e.substring(0,2);try{for(var h=pu(t.TWO_DIGIT_DATA_LENGTH),f=h.next();!f.done;f=h.next())if((C=f.value)[0]===d)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,C[2],e):t.processFixedAI(2,C[1],e)}catch(I){n={error:I}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}if(e.length<3)throw new he;var p=e.substring(0,3);try{for(var l=pu(t.THREE_DIGIT_DATA_LENGTH),g=l.next();!g.done;g=l.next())if((C=g.value)[0]===p)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,C[2],e):t.processFixedAI(3,C[1],e)}catch(I){o={error:I}}finally{try{g&&!g.done&&(i=l.return)&&i.call(l)}finally{if(o)throw o.error}}try{for(var m=pu(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),y=m.next();!y.done;y=m.next())if((C=y.value)[0]===p)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,C[2],e):t.processFixedAI(4,C[1],e)}catch(I){a={error:I}}finally{try{y&&!y.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}if(e.length<4)throw new he;var w=e.substring(0,4);try{for(var b=pu(t.FOUR_DIGIT_DATA_LENGTH),E=b.next();!E.done;E=b.next()){var C;if((C=E.value)[0]===w)return C[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,C[2],e):t.processFixedAI(4,C[1],e)}}catch(I){c={error:I}}finally{try{E&&!E.done&&(u=b.return)&&u.call(b)}finally{if(c)throw c.error}}throw new he},t.processFixedAI=function(e,n,r){if(r.length<e)throw new he;var o=r.substring(0,e);if(r.length<e+n)throw new he;var i=r.substring(e,e+n),a=r.substring(e+n),s="("+o+")"+i,c=t.parseFieldsInGeneralPurpose(a);return c==null?s:s+c},t.processVariableAI=function(e,n,r){var o,i=r.substring(0,e);o=r.length<e+n?r.length:e+n;var a=r.substring(e,o),s=r.substring(o),c="("+i+")"+a,u=t.parseFieldsInGeneralPurpose(s);return u==null?c:c+u},t.VARIABLE_LENGTH=[],t.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",t.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",t.VARIABLE_LENGTH,20],["22",t.VARIABLE_LENGTH,29],["30",t.VARIABLE_LENGTH,8],["37",t.VARIABLE_LENGTH,8],["90",t.VARIABLE_LENGTH,30],["91",t.VARIABLE_LENGTH,30],["92",t.VARIABLE_LENGTH,30],["93",t.VARIABLE_LENGTH,30],["94",t.VARIABLE_LENGTH,30],["95",t.VARIABLE_LENGTH,30],["96",t.VARIABLE_LENGTH,30],["97",t.VARIABLE_LENGTH,3],["98",t.VARIABLE_LENGTH,30],["99",t.VARIABLE_LENGTH,30]],t.THREE_DIGIT_DATA_LENGTH=[["240",t.VARIABLE_LENGTH,30],["241",t.VARIABLE_LENGTH,30],["242",t.VARIABLE_LENGTH,6],["250",t.VARIABLE_LENGTH,30],["251",t.VARIABLE_LENGTH,30],["253",t.VARIABLE_LENGTH,17],["254",t.VARIABLE_LENGTH,20],["400",t.VARIABLE_LENGTH,30],["401",t.VARIABLE_LENGTH,30],["402",17],["403",t.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",t.VARIABLE_LENGTH,20],["421",t.VARIABLE_LENGTH,15],["422",3],["423",t.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",t.VARIABLE_LENGTH,15],["391",t.VARIABLE_LENGTH,18],["392",t.VARIABLE_LENGTH,15],["393",t.VARIABLE_LENGTH,18],["703",t.VARIABLE_LENGTH,30]],t.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",t.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",t.VARIABLE_LENGTH,20],["8003",t.VARIABLE_LENGTH,30],["8004",t.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",t.VARIABLE_LENGTH,30],["8008",t.VARIABLE_LENGTH,12],["8018",18],["8020",t.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",t.VARIABLE_LENGTH,70],["8200",t.VARIABLE_LENGTH,70]],t}(),gu=function(){function t(e){this.buffer=new xt,this.information=e}return t.prototype.decodeAllCodes=function(e,n){for(var r=n,o=null;;){var i=this.decodeGeneralPurposeField(r,o),a=w9.parseFieldsInGeneralPurpose(i.getNewString());if(a!=null&&e.append(a),o=i.isRemaining()?""+i.getRemainingValue():null,r===i.getNewPosition())break;r=i.getNewPosition()}return e.toString()},t.prototype.isStillNumeric=function(e){if(e+7>this.information.getSize())return e+4<=this.information.getSize();for(var n=e;n<e+3;++n)if(this.information.get(n))return!0;return this.information.get(e+3)},t.prototype.decodeNumeric=function(e){if(e+7>this.information.getSize()){var n=this.extractNumericValueFromBitArray(e,4);return new hu(this.information.getSize(),n===0?hu.FNC1:n-1,hu.FNC1)}var r=this.extractNumericValueFromBitArray(e,7);return new hu(e+7,(r-8)/11,(r-8)%11)},t.prototype.extractNumericValueFromBitArray=function(e,n){return t.extractNumericValueFromBitArray(this.information,e,n)},t.extractNumericValueFromBitArray=function(e,n,r){for(var o=0,i=0;i<r;++i)e.get(n+i)&&(o|=1<<r-i-1);return o},t.prototype.decodeGeneralPurposeField=function(e,n){this.buffer.setLengthToZero(),n!=null&&this.buffer.append(n),this.current.setPosition(e);var r=this.parseBlocks();return r!=null&&r.isRemaining()?new di(this.current.getPosition(),this.buffer.toString(),r.getRemainingValue()):new di(this.current.getPosition(),this.buffer.toString())},t.prototype.parseBlocks=function(){var e,n;do{var r=this.current.getPosition();if(e=this.current.isAlpha()?(n=this.parseAlphaBlock()).isFinished():this.current.isIsoIec646()?(n=this.parseIsoIec646Block()).isFinished():(n=this.parseNumericBlock()).isFinished(),r===this.current.getPosition()&&!e)break}while(!e);return n.getDecodedInformation()},t.prototype.parseNumericBlock=function(){for(;this.isStillNumeric(this.current.getPosition());){var e=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFirstDigitFNC1()){var n=void 0;return n=e.isSecondDigitFNC1()?new di(this.current.getPosition(),this.buffer.toString()):new di(this.current.getPosition(),this.buffer.toString(),e.getSecondDigit()),new li(!0,n)}if(this.buffer.append(e.getFirstDigit()),e.isSecondDigitFNC1())return n=new di(this.current.getPosition(),this.buffer.toString()),new li(!0,n);this.buffer.append(e.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new li(!1)},t.prototype.parseIsoIec646Block=function(){for(;this.isStillIsoIec646(this.current.getPosition());){var e=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new di(this.current.getPosition(),this.buffer.toString());return new li(!0,n)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new li(!1)},t.prototype.parseAlphaBlock=function(){for(;this.isStillAlpha(this.current.getPosition());){var e=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(e.getNewPosition()),e.isFNC1()){var n=new di(this.current.getPosition(),this.buffer.toString());return new li(!0,n)}this.buffer.append(e.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new li(!1)},t.prototype.isStillIsoIec646=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;if(e+7>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,7);if(r>=64&&r<116)return!0;if(e+8>this.information.getSize())return!1;var o=this.extractNumericValueFromBitArray(e,8);return o>=232&&o<253},t.prototype.decodeIsoIec646=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new xr(e+5,xr.FNC1);if(n>=5&&n<15)return new xr(e+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(e,7);if(o>=64&&o<90)return new xr(e+7,""+(o+1));if(o>=90&&o<116)return new xr(e+7,""+(o+7));switch(this.extractNumericValueFromBitArray(e,8)){case 232:r="!";break;case 233:r='"';break;case 234:r="%";break;case 235:r="&";break;case 236:r="'";break;case 237:r="(";break;case 238:r=")";break;case 239:r="*";break;case 240:r="+";break;case 241:r=",";break;case 242:r="-";break;case 243:r=".";break;case 244:r="/";break;case 245:r=":";break;case 246:r=";";break;case 247:r="<";break;case 248:r="=";break;case 249:r=">";break;case 250:r="?";break;case 251:r="_";break;case 252:r=" ";break;default:throw new Se}return new xr(e+8,r)},t.prototype.isStillAlpha=function(e){if(e+5>this.information.getSize())return!1;var n=this.extractNumericValueFromBitArray(e,5);if(n>=5&&n<16)return!0;if(e+6>this.information.getSize())return!1;var r=this.extractNumericValueFromBitArray(e,6);return r>=16&&r<63},t.prototype.decodeAlphanumeric=function(e){var n=this.extractNumericValueFromBitArray(e,5);if(n===15)return new xr(e+5,xr.FNC1);if(n>=5&&n<15)return new xr(e+5,"0"+(n-5));var r,o=this.extractNumericValueFromBitArray(e,6);if(o>=32&&o<58)return new xr(e+6,""+(o+33));switch(o){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new gs("Decoding invalid alphanumeric value: "+o)}return new xr(e+6,r)},t.prototype.isAlphaTo646ToAlphaLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<5&&n+e<this.information.getSize();++n)if(n===2){if(!this.information.get(e+2))return!1}else if(this.information.get(e+n))return!1;return!0},t.prototype.isAlphaOr646ToNumericLatch=function(e){if(e+3>this.information.getSize())return!1;for(var n=e;n<e+3;++n)if(this.information.get(n))return!1;return!0},t.prototype.isNumericToAlphaNumericLatch=function(e){if(e+1>this.information.getSize())return!1;for(var n=0;n<4&&n+e<this.information.getSize();++n)if(this.information.get(e+n))return!1;return!0},t}(),S2=function(){function t(e){this.information=e,this.generalDecoder=new gu(e)}return t.prototype.getInformation=function(){return this.information},t.prototype.getGeneralDecoder=function(){return this.generalDecoder},t}(),b9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Or=function(t){function e(n){return t.call(this,n)||this}return b9(e,t),e.prototype.encodeCompressedGtin=function(n,r){n.append("(01)");var o=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,r,o)},e.prototype.encodeCompressedGtinWithoutAI=function(n,r,o){for(var i=0;i<4;++i){var a=this.getGeneralDecoder().extractNumericValueFromBitArray(r+10*i,10);a/100==0&&n.append("0"),a/10==0&&n.append("0"),n.append(a)}e.appendCheckDigit(n,o)},e.appendCheckDigit=function(n,r){for(var o=0,i=0;i<13;i++){var a=n.charAt(i+r).charCodeAt(0)-48;o+=1&i?a:3*a}(o=10-o%10)===10&&(o=0),n.append(o)},e.GTIN_SIZE=40,e}(S2),E9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),C9=function(t){function e(n){return t.call(this,n)||this}return E9(e,t),e.prototype.parseInformation=function(){var n=new xt;n.append("(01)");var r=n.length(),o=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE,4);return n.append(o),this.encodeCompressedGtinWithoutAI(n,e.HEADER_SIZE+4,r),this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE+44)},e.HEADER_SIZE=4,e}(Or),_9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),A9=function(t){function e(n){return t.call(this,n)||this}return _9(e,t),e.prototype.parseInformation=function(){var n=new xt;return this.getGeneralDecoder().decodeAllCodes(n,e.HEADER_SIZE)},e.HEADER_SIZE=5,e}(S2),S9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mu=function(t){function e(n){return t.call(this,n)||this}return S9(e,t),e.prototype.encodeCompressedWeight=function(n,r,o){var i=this.getGeneralDecoder().extractNumericValueFromBitArray(r,o);this.addWeightCode(n,i);for(var a=this.checkWeight(i),s=1e5,c=0;c<5;++c)a/s==0&&n.append("0"),s/=10;n.append(a)},e}(Or),I9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),I2=function(t){function e(n){return t.call(this,n)||this}return I9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+mu.GTIN_SIZE+e.WEIGHT_SIZE)throw new he;var n=new xt;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+mu.GTIN_SIZE,e.WEIGHT_SIZE),n.toString()},e.HEADER_SIZE=5,e.WEIGHT_SIZE=15,e}(mu),T9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),x9=function(t){function e(n){return t.call(this,n)||this}return T9(e,t),e.prototype.addWeightCode=function(n,r){n.append("(3103)")},e.prototype.checkWeight=function(n){return n},e}(I2),O9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),P9=function(t){function e(n){return t.call(this,n)||this}return O9(e,t),e.prototype.addWeightCode=function(n,r){r<1e4?n.append("(3202)"):n.append("(3203)")},e.prototype.checkWeight=function(n){return n<1e4?n:n-1e4},e}(I2),k9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),B9=function(t){function e(n){return t.call(this,n)||this}return k9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Or.GTIN_SIZE)throw new he;var n=new xt;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Or.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(392"),n.append(r),n.append(")");var o=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Or.GTIN_SIZE+e.LAST_DIGIT_SIZE,null);return n.append(o.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e}(Or),N9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),R9=function(t){function e(n){return t.call(this,n)||this}return N9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()<e.HEADER_SIZE+Or.GTIN_SIZE)throw new he;var n=new xt;this.encodeCompressedGtin(n,e.HEADER_SIZE);var r=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Or.GTIN_SIZE,e.LAST_DIGIT_SIZE);n.append("(393"),n.append(r),n.append(")");var o=this.getGeneralDecoder().extractNumericValueFromBitArray(e.HEADER_SIZE+Or.GTIN_SIZE+e.LAST_DIGIT_SIZE,e.FIRST_THREE_DIGITS_SIZE);o/100==0&&n.append("0"),o/10==0&&n.append("0"),n.append(o);var i=this.getGeneralDecoder().decodeGeneralPurposeField(e.HEADER_SIZE+Or.GTIN_SIZE+e.LAST_DIGIT_SIZE+e.FIRST_THREE_DIGITS_SIZE,null);return n.append(i.getNewString()),n.toString()},e.HEADER_SIZE=8,e.LAST_DIGIT_SIZE=2,e.FIRST_THREE_DIGITS_SIZE=10,e}(Or),D9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Lo=function(t){function e(n,r,o){var i=t.call(this,n)||this;return i.dateCode=o,i.firstAIdigits=r,i}return D9(e,t),e.prototype.parseInformation=function(){if(this.getInformation().getSize()!=e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE+e.DATE_SIZE)throw new he;var n=new xt;return this.encodeCompressedGtin(n,e.HEADER_SIZE),this.encodeCompressedWeight(n,e.HEADER_SIZE+e.GTIN_SIZE,e.WEIGHT_SIZE),this.encodeCompressedDate(n,e.HEADER_SIZE+e.GTIN_SIZE+e.WEIGHT_SIZE),n.toString()},e.prototype.encodeCompressedDate=function(n,r){var o=this.getGeneralDecoder().extractNumericValueFromBitArray(r,e.DATE_SIZE);if(o!=38400){n.append("("),n.append(this.dateCode),n.append(")");var i=o%32,a=(o/=32)%12+1,s=o/=12;s/10==0&&n.append("0"),n.append(s),a/10==0&&n.append("0"),n.append(a),i/10==0&&n.append("0"),n.append(i)}},e.prototype.addWeightCode=function(n,r){n.append("("),n.append(this.firstAIdigits),n.append(r/1e5),n.append(")")},e.prototype.checkWeight=function(n){return n%1e5},e.HEADER_SIZE=8,e.WEIGHT_SIZE=20,e.DATE_SIZE=16,e}(mu),T2=function(){function t(e,n,r,o){this.leftchar=e,this.rightchar=n,this.finderpattern=r,this.maybeLast=o}return t.prototype.mayBeLast=function(){return this.maybeLast},t.prototype.getLeftChar=function(){return this.leftchar},t.prototype.getRightChar=function(){return this.rightchar},t.prototype.getFinderPattern=function(){return this.finderpattern},t.prototype.mustBeLast=function(){return this.rightchar==null},t.prototype.toString=function(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"},t.equals=function(e,n){return e instanceof t&&t.equalsOrNull(e.leftchar,n.leftchar)&&t.equalsOrNull(e.rightchar,n.rightchar)&&t.equalsOrNull(e.finderpattern,n.finderpattern)},t.equalsOrNull=function(e,n){return e===null?n===null:t.equals(e,n)},t.prototype.hashCode=function(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()},t}(),M9=function(){function t(e,n,r){this.pairs=e,this.rowNumber=n,this.wasReversed=r}return t.prototype.getPairs=function(){return this.pairs},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.isReversed=function(){return this.wasReversed},t.prototype.isEquivalent=function(e){return this.checkEqualitity(this,e)},t.prototype.toString=function(){return"{ "+this.pairs+" }"},t.prototype.equals=function(e,n){return e instanceof t&&this.checkEqualitity(e,n)&&e.wasReversed===n.wasReversed},t.prototype.checkEqualitity=function(e,n){var r;if(e&&n)return e.forEach(function(o,i){n.forEach(function(a){o.getLeftChar().getValue()===a.getLeftChar().getValue()&&o.getRightChar().getValue()===a.getRightChar().getValue()&&o.getFinderPatter().getValue()===a.getFinderPatter().getValue()&&(r=!0)})}),r},t}(),L9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Fo=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},F9=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.pairs=new Array(e.MAX_PAIRS),n.rows=new Array,n.startEnd=[2],n}return L9(e,t),e.prototype.decodeRow=function(n,r,o){this.pairs.length=0,this.startFromEven=!1;try{return e.constructResult(this.decodeRow2pairs(n,r))}catch{}return this.pairs.length=0,this.startFromEven=!0,e.constructResult(this.decodeRow2pairs(n,r))},e.prototype.reset=function(){this.pairs.length=0,this.rows.length=0},e.prototype.decodeRow2pairs=function(n,r){for(var o,i=!1;!i;)try{this.pairs.push(this.retrieveNextPair(r,this.pairs,n))}catch(s){if(s instanceof he){if(!this.pairs.length)throw new he;i=!0}}if(this.checkChecksum())return this.pairs;if(o=!!this.rows.length,this.storeRow(n,!1),o){var a=this.checkRowsBoolean(!1);if(a!=null||(a=this.checkRowsBoolean(!0))!=null)return a}throw new he},e.prototype.checkRowsBoolean=function(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());var r=null;try{r=this.checkRows(new Array,0)}catch(o){console.log(o)}return n&&(this.rows=this.rows.reverse()),r},e.prototype.checkRows=function(n,r){for(var o,i,a=r;a<this.rows.length;a++){var s=this.rows[a];this.pairs.length=0;try{for(var c=(o=void 0,Fo(n)),u=c.next();!u.done;u=c.next()){var d=u.value;this.pairs.push(d.getPairs())}}catch(f){o={error:f}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}if(this.pairs.push(s.getPairs()),e.isValidSequence(this.pairs)){if(this.checkChecksum())return this.pairs;var h=new Array(n);h.push(s);try{return this.checkRows(h,a+1)}catch(f){console.log(f)}}}throw new he},e.isValidSequence=function(n){var r,o;try{for(var i=Fo(e.FINDER_PATTERN_SEQUENCES),a=i.next();!a.done;a=i.next()){var s=a.value;if(!(n.length>s.length)){for(var c=!0,u=0;u<n.length;u++)if(n[u].getFinderPattern().getValue()!=s[u]){c=!1;break}if(c)return!0}}}catch(d){r={error:d}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}return!1},e.prototype.storeRow=function(n,r){for(var o=0,i=!1,a=!1;o<this.rows.length;){var s=this.rows[o];if(s.getRowNumber()>n){a=s.isEquivalent(this.pairs);break}i=s.isEquivalent(this.pairs),o++}a||i||e.isPartialRow(this.pairs,this.rows)||(this.rows.push(o,new M9(this.pairs,n,r)),this.removePartialRows(this.pairs,this.rows))},e.prototype.removePartialRows=function(n,r){var o,i,a,s,c,u;try{for(var d=Fo(r),h=d.next();!h.done;h=d.next()){var f=h.value;if(f.getPairs().length!==n.length)try{for(var p=(a=void 0,Fo(f.getPairs())),l=p.next();!l.done;l=p.next()){var g=l.value,m=!1;try{for(var y=(c=void 0,Fo(n)),w=y.next();!w.done;w=y.next()){var b=w.value;if(T2.equals(g,b)){m=!0;break}}}catch(E){c={error:E}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(c)throw c.error}}}}catch(E){a={error:E}}finally{try{l&&!l.done&&(s=p.return)&&s.call(p)}finally{if(a)throw a.error}}}}catch(E){o={error:E}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}},e.isPartialRow=function(n,r){var o,i,a,s,c,u;try{for(var d=Fo(r),h=d.next();!h.done;h=d.next()){var f=h.value,p=!0;try{for(var l=(a=void 0,Fo(n)),g=l.next();!g.done;g=l.next()){var m=g.value,y=!1;try{for(var w=(c=void 0,Fo(f.getPairs())),b=w.next();!b.done;b=w.next()){var E=b.value;if(m.equals(E)){y=!0;break}}}catch(C){c={error:C}}finally{try{b&&!b.done&&(u=w.return)&&u.call(w)}finally{if(c)throw c.error}}if(!y){p=!1;break}}}catch(C){a={error:C}}finally{try{g&&!g.done&&(s=l.return)&&s.call(l)}finally{if(a)throw a.error}}if(p)return!0}}catch(C){o={error:C}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}return!1},e.prototype.getRows=function(){return this.rows},e.constructResult=function(n){var r=function(s){try{if(s.get(1))return new C9(s);if(!s.get(2))return new A9(s);switch(gu.extractNumericValueFromBitArray(s,1,4)){case 4:return new x9(s);case 5:return new P9(s)}switch(gu.extractNumericValueFromBitArray(s,1,5)){case 12:return new B9(s);case 13:return new R9(s)}switch(gu.extractNumericValueFromBitArray(s,1,7)){case 56:return new Lo(s,"310","11");case 57:return new Lo(s,"320","11");case 58:return new Lo(s,"310","13");case 59:return new Lo(s,"320","13");case 60:return new Lo(s,"310","15");case 61:return new Lo(s,"320","15");case 62:return new Lo(s,"310","17");case 63:return new Lo(s,"320","17")}}catch(c){throw console.log(c),new gs("unknown decoder: "+s)}}(g9.buildBitArray(n)).parseInformation(),o=n[0].getFinderPattern().getResultPoints(),i=n[n.length-1].getFinderPattern().getResultPoints(),a=[o[0],o[1],i[0],i[1]];return new Wn(r,null,null,a,Re.RSS_EXPANDED,null)},e.prototype.checkChecksum=function(){var n=this.pairs.get(0),r=n.getLeftChar(),o=n.getRightChar();if(o==null)return!1;for(var i=o.getChecksumPortion(),a=2,s=1;s<this.pairs.size();++s){var c=this.pairs.get(s);i+=c.getLeftChar().getChecksumPortion(),a++;var u=c.getRightChar();u!=null&&(i+=u.getChecksumPortion(),a++)}return 211*(a-4)+(i%=211)==r.getValue()},e.getNextSecondBar=function(n,r){var o;return n.get(r)?(o=n.getNextUnset(r),o=n.getNextSet(o)):(o=n.getNextSet(r),o=n.getNextUnset(o)),o},e.prototype.retrieveNextPair=function(n,r,o){var i,a=r.length%2==0;this.startFromEven&&(a=!a);var s=!0,c=-1;do this.findNextPair(n,r,c),(i=this.parseFoundFinderPattern(n,o,a))==null?c=e.getNextSecondBar(n,this.startEnd[0]):s=!1;while(s);var u,d=this.decodeDataCharacter(n,i,a,!0);if(!this.isEmptyPair(r)&&r[r.length-1].mustBeLast())throw new he;try{u=this.decodeDataCharacter(n,i,a,!1)}catch(h){u=null,console.log(h)}return new T2(d,u,i,!0)},e.prototype.isEmptyPair=function(n){return n.length===0},e.prototype.findNextPair=function(n,r,o){var i=this.getDecodeFinderCounters();i[0]=0,i[1]=0,i[2]=0,i[3]=0;var a,s=n.getSize();o>=0?a=o:this.isEmptyPair(r)?a=0:a=r[r.length-1].getFinderPattern().getStartEnd()[1];var c=r.length%2!=0;this.startFromEven&&(c=!c);for(var u=!1;a<s&&(u=!n.get(a));)a++;for(var d=0,h=a,f=a;f<s;f++)if(n.get(f)!=u)i[d]++;else{if(d==3){if(c&&e.reverseCounters(i),e.isFinderPattern(i))return this.startEnd[0]=h,void(this.startEnd[1]=f);c&&e.reverseCounters(i),h+=i[0]+i[1],i[0]=i[2],i[1]=i[3],i[2]=0,i[3]=0,d--}else d++;i[d]=1,u=!u}throw new he},e.reverseCounters=function(n){for(var r=n.length,o=0;o<r/2;++o){var i=n[o];n[o]=n[r-o-1],n[r-o-1]=i}},e.prototype.parseFoundFinderPattern=function(n,r,o){var i,a,s;if(o){for(var c=this.startEnd[0]-1;c>=0&&!n.get(c);)c--;c++,i=this.startEnd[0]-c,a=c,s=this.startEnd[1]}else a=this.startEnd[0],i=(s=n.getNextUnset(this.startEnd[1]+1))-this.startEnd[1];var u,d=this.getDecodeFinderCounters();Nt.arraycopy(d,0,d,1,d.length-1),d[0]=i;try{u=this.parseFinderValue(d,e.FINDER_PATTERNS)}catch{return null}return new A2(u,[a,s],a,s,r)},e.prototype.decodeDataCharacter=function(n,r,o,i){for(var a=this.getDataCharacterCounters(),s=0;s<a.length;s++)a[s]=0;if(i)e.recordPatternInReverse(n,r.getStartEnd()[0],a);else{e.recordPattern(n,r.getStartEnd()[1],a);for(var c=0,u=a.length-1;c<u;c++,u--){var d=a[c];a[c]=a[u],a[u]=d}}var h=ft.sum(new Int32Array(a))/17,f=(r.getStartEnd()[1]-r.getStartEnd()[0])/15;if(Math.abs(h-f)/f>.3)throw new he;var p=this.getOddCounts(),l=this.getEvenCounts(),g=this.getOddRoundingErrors(),m=this.getEvenRoundingErrors();for(c=0;c<a.length;c++){var y=1*a[c]/h,w=y+.5;if(w<1){if(y<.3)throw new he;w=1}else if(w>8){if(y>8.7)throw new he;w=8}var b=c/2;1&c?(l[b]=w,m[b]=y-w):(p[b]=w,g[b]=y-w)}this.adjustOddEvenCounts(17);var E=4*r.getValue()+(o?0:2)+(i?0:1)-1,C=0,I=0;for(c=p.length-1;c>=0;c--){if(e.isNotA1left(r,o,i)){var T=e.WEIGHTS[E][2*c];I+=p[c]*T}C+=p[c]}var P=0;for(c=l.length-1;c>=0;c--)e.isNotA1left(r,o,i)&&(T=e.WEIGHTS[E][2*c+1],P+=l[c]*T);var N=I+P;if(1&C||C>13||C<4)throw new he;var L=(13-C)/2,V=e.SYMBOL_WIDEST[L],j=9-V,W=ta.getRSSvalue(p,V,!0),q=ta.getRSSvalue(l,j,!1),k=e.EVEN_TOTAL_SUBSET[L],U=e.GSUM[L];return new fu(W*k+q+U,N)},e.isNotA1left=function(n,r,o){return!(n.getValue()==0&&r&&o)},e.prototype.adjustOddEvenCounts=function(n){var r=ft.sum(new Int32Array(this.getOddCounts())),o=ft.sum(new Int32Array(this.getEvenCounts())),i=!1,a=!1;r>13?a=!0:r<4&&(i=!0);var s=!1,c=!1;o>13?c=!0:o<4&&(s=!0);var u=r+o-n,d=(1&r)==1,h=(1&o)==0;if(u==1)if(d){if(h)throw new he;a=!0}else{if(!h)throw new he;c=!0}else if(u==-1)if(d){if(h)throw new he;i=!0}else{if(!h)throw new he;s=!0}else{if(u!=0)throw new he;if(d){if(!h)throw new he;r<o?(i=!0,c=!0):(a=!0,s=!0)}else if(h)throw new he}if(i){if(a)throw new he;e.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(a&&e.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(c)throw new he;e.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&e.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.SYMBOL_WIDEST=[7,5,4,3,1],e.EVEN_TOTAL_SUBSET=[4,20,52,104,204],e.GSUM=[0,348,1388,2948,3988],e.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],e.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],e.FINDER_PAT_A=0,e.FINDER_PAT_B=1,e.FINDER_PAT_C=2,e.FINDER_PAT_D=3,e.FINDER_PAT_E=4,e.FINDER_PAT_F=5,e.FINDER_PATTERN_SEQUENCES=[[e.FINDER_PAT_A,e.FINDER_PAT_A],[e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B],[e.FINDER_PAT_A,e.FINDER_PAT_C,e.FINDER_PAT_B,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_C],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_E,e.FINDER_PAT_B,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F],[e.FINDER_PAT_A,e.FINDER_PAT_A,e.FINDER_PAT_B,e.FINDER_PAT_B,e.FINDER_PAT_C,e.FINDER_PAT_D,e.FINDER_PAT_D,e.FINDER_PAT_E,e.FINDER_PAT_E,e.FINDER_PAT_F,e.FINDER_PAT_F]],e.MAX_PAIRS=11,e}(ui),j9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),V9=function(t){function e(n,r,o){var i=t.call(this,n,r)||this;return i.count=0,i.finderPattern=o,i}return j9(e,t),e.prototype.getFinderPattern=function(){return this.finderPattern},e.prototype.getCount=function(){return this.count},e.prototype.incrementCount=function(){this.count++},e}(fu),U9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Pf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},x2=function(t){function e(){var n=t!==null&&t.apply(this,arguments)||this;return n.possibleLeftPairs=[],n.possibleRightPairs=[],n}return U9(e,t),e.prototype.decodeRow=function(n,r,o){var i,a,s,c,u=this.decodePair(r,!1,n,o);e.addOrTally(this.possibleLeftPairs,u),r.reverse();var d=this.decodePair(r,!0,n,o);e.addOrTally(this.possibleRightPairs,d),r.reverse();try{for(var h=Pf(this.possibleLeftPairs),f=h.next();!f.done;f=h.next()){var p=f.value;if(p.getCount()>1)try{for(var l=(s=void 0,Pf(this.possibleRightPairs)),g=l.next();!g.done;g=l.next()){var m=g.value;if(m.getCount()>1&&e.checkChecksum(p,m))return e.constructResult(p,m)}}catch(y){s={error:y}}finally{try{g&&!g.done&&(c=l.return)&&c.call(l)}finally{if(s)throw s.error}}}}catch(y){i={error:y}}finally{try{f&&!f.done&&(a=h.return)&&a.call(h)}finally{if(i)throw i.error}}throw new he},e.addOrTally=function(n,r){var o,i;if(r!=null){var a=!1;try{for(var s=Pf(n),c=s.next();!c.done;c=s.next()){var u=c.value;if(u.getValue()===r.getValue()){u.incrementCount(),a=!0;break}}}catch(d){o={error:d}}finally{try{c&&!c.done&&(i=s.return)&&i.call(s)}finally{if(o)throw o.error}}a||n.push(r)}},e.prototype.reset=function(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0},e.constructResult=function(n,r){for(var o=4537077*n.getValue()+r.getValue(),i=new String(o).toString(),a=new xt,s=13-i.length;s>0;s--)a.append("0");a.append(i);var c=0;for(s=0;s<13;s++){var u=a.charAt(s).charCodeAt(0)-48;c+=1&s?u:3*u}(c=10-c%10)===10&&(c=0),a.append(c.toString());var d=n.getFinderPattern().getResultPoints(),h=r.getFinderPattern().getResultPoints();return new Wn(a.toString(),null,0,[d[0],d[1],h[0],h[1]],Re.RSS_14,new Date().getTime())},e.checkChecksum=function(n,r){var o=(n.getChecksumPortion()+16*r.getChecksumPortion())%79,i=9*n.getFinderPattern().getValue()+r.getFinderPattern().getValue();return i>72&&i--,i>8&&i--,o===i},e.prototype.decodePair=function(n,r,o,i){try{var a=this.findFinderPattern(n,r),s=this.parseFoundFinderPattern(n,o,r,a),c=i==null?null:i.get(Pt.NEED_RESULT_POINT_CALLBACK);if(c!=null){var u=(a[0]+a[1])/2;r&&(u=n.getSize()-1-u),c.foundPossibleResultPoint(new Pe(u,o))}var d=this.decodeDataCharacter(n,s,!0),h=this.decodeDataCharacter(n,s,!1);return new V9(1597*d.getValue()+h.getValue(),d.getChecksumPortion()+4*h.getChecksumPortion(),s)}catch{return null}},e.prototype.decodeDataCharacter=function(n,r,o){for(var i=this.getDataCharacterCounters(),a=0;a<i.length;a++)i[a]=0;if(o)_n.recordPatternInReverse(n,r.getStartEnd()[0],i);else{_n.recordPattern(n,r.getStartEnd()[1]+1,i);for(var s=0,c=i.length-1;s<c;s++,c--){var u=i[s];i[s]=i[c],i[c]=u}}var d=o?16:15,h=ft.sum(new Int32Array(i))/d,f=this.getOddCounts(),p=this.getEvenCounts(),l=this.getOddRoundingErrors(),g=this.getEvenRoundingErrors();for(s=0;s<i.length;s++){var m=i[s]/h,y=Math.floor(m+.5);y<1?y=1:y>8&&(y=8);var w=Math.floor(s/2);1&s?(p[w]=y,g[w]=m-y):(f[w]=y,l[w]=m-y)}this.adjustOddEvenCounts(o,d);var b=0,E=0;for(s=f.length-1;s>=0;s--)E*=9,E+=f[s],b+=f[s];var C=0,I=0;for(s=p.length-1;s>=0;s--)C*=9,C+=p[s],I+=p[s];var T=E+3*C;if(o){if(1&b||b>12||b<4)throw new he;var P=(12-b)/2,N=9-(q=e.OUTSIDE_ODD_WIDEST[P]),L=ta.getRSSvalue(f,q,!1),V=ta.getRSSvalue(p,N,!0),j=e.OUTSIDE_EVEN_TOTAL_SUBSET[P],W=e.OUTSIDE_GSUM[P];return new fu(L*j+V+W,T)}if(1&I||I>10||I<4)throw new he;P=(10-I)/2,N=9-(q=e.INSIDE_ODD_WIDEST[P]),L=ta.getRSSvalue(f,q,!0),V=ta.getRSSvalue(p,N,!1);var q,k=e.INSIDE_ODD_TOTAL_SUBSET[P];return W=e.INSIDE_GSUM[P],new fu(V*k+L+W,T)},e.prototype.findFinderPattern=function(n,r){var o=this.getDecodeFinderCounters();o[0]=0,o[1]=0,o[2]=0,o[3]=0;for(var i=n.getSize(),a=!1,s=0;s<i&&r!==(a=!n.get(s));)s++;for(var c=0,u=s,d=s;d<i;d++)if(n.get(d)!==a)o[c]++;else{if(c===3){if(ui.isFinderPattern(o))return[u,d];u+=o[0]+o[1],o[0]=o[2],o[1]=o[3],o[2]=0,o[3]=0,c--}else c++;o[c]=1,a=!a}throw new he},e.prototype.parseFoundFinderPattern=function(n,r,o,i){for(var a=n.get(i[0]),s=i[0]-1;s>=0&&a!==n.get(s);)s--;s++;var c=i[0]-s,u=this.getDecodeFinderCounters(),d=new Int32Array(u.length);Nt.arraycopy(u,0,d,1,u.length-1),d[0]=c;var h=this.parseFinderValue(d,e.FINDER_PATTERNS),f=s,p=i[1];return o&&(f=n.getSize()-1-f,p=n.getSize()-1-p),new A2(h,[s,i[1]],f,p,r)},e.prototype.adjustOddEvenCounts=function(n,r){var o=ft.sum(new Int32Array(this.getOddCounts())),i=ft.sum(new Int32Array(this.getEvenCounts())),a=!1,s=!1,c=!1,u=!1;n?(o>12?s=!0:o<4&&(a=!0),i>12?u=!0:i<4&&(c=!0)):(o>11?s=!0:o<5&&(a=!0),i>10?u=!0:i<4&&(c=!0));var d=o+i-r,h=(1&o)==(n?1:0),f=(1&i)==1;if(d===1)if(h){if(f)throw new he;s=!0}else{if(!f)throw new he;u=!0}else if(d===-1)if(h){if(f)throw new he;a=!0}else{if(!f)throw new he;c=!0}else{if(d!==0)throw new he;if(h){if(!f)throw new he;o<i?(a=!0,u=!0):(s=!0,c=!0)}else if(f)throw new he}if(a){if(s)throw new he;ui.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&ui.decrement(this.getOddCounts(),this.getOddRoundingErrors()),c){if(u)throw new he;ui.increment(this.getEvenCounts(),this.getOddRoundingErrors())}u&&ui.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())},e.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],e.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],e.OUTSIDE_GSUM=[0,161,961,2015,2715],e.INSIDE_GSUM=[0,336,1036,1516],e.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],e.INSIDE_ODD_WIDEST=[2,4,6,8],e.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])],e}(ui),G9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),na=function(t){function e(n){var r=t.call(this)||this;r.readers=[];var o=n?n.get(Pt.POSSIBLE_FORMATS):null,i=n&&n.get(Pt.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;return o&&((o.includes(Re.EAN_13)||o.includes(Re.UPC_A)||o.includes(Re.EAN_8)||o.includes(Re.UPC_E))&&r.readers.push(new xf(n)),o.includes(Re.CODE_39)&&r.readers.push(new y2(i)),o.includes(Re.CODE_128)&&r.readers.push(new m2),o.includes(Re.ITF)&&r.readers.push(new v2),o.includes(Re.RSS_14)&&r.readers.push(new x2),o.includes(Re.RSS_EXPANDED)&&(console.warn("RSS Expanded reader IS NOT ready for production yet! use at your own risk."),r.readers.push(new F9))),r.readers.length===0&&(r.readers.push(new xf(n)),r.readers.push(new y2),r.readers.push(new xf(n)),r.readers.push(new m2),r.readers.push(new v2),r.readers.push(new x2)),r}return G9(e,t),e.prototype.decodeRow=function(n,r,o){for(var i=0;i<this.readers.length;i++)try{return this.readers[i].decodeRow(n,r,o)}catch{}throw new he},e.prototype.reset=function(){this.readers.forEach(function(n){return n.reset()})},e}(_n),q9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return n===void 0&&(n=500),t.call(this,new na(r),n,r)||this}q9(e,t)})(Zi);var un,O2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Et=function(){function t(e,n,r){this.ecCodewords=e,this.ecBlocks=[n],r&&this.ecBlocks.push(r)}return t.prototype.getECCodewords=function(){return this.ecCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),yt=function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),H9=function(){function t(e,n,r,o,i,a){var s,c;this.versionNumber=e,this.symbolSizeRows=n,this.symbolSizeColumns=r,this.dataRegionSizeRows=o,this.dataRegionSizeColumns=i,this.ecBlocks=a;var u=0,d=a.getECCodewords(),h=a.getECBlocks();try{for(var f=O2(h),p=f.next();!p.done;p=f.next()){var l=p.value;u+=l.getCount()*(l.getDataCodewords()+d)}}catch(g){s={error:g}}finally{try{p&&!p.done&&(c=f.return)&&c.call(f)}finally{if(s)throw s.error}}this.totalCodewords=u}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getSymbolSizeRows=function(){return this.symbolSizeRows},t.prototype.getSymbolSizeColumns=function(){return this.symbolSizeColumns},t.prototype.getDataRegionSizeRows=function(){return this.dataRegionSizeRows},t.prototype.getDataRegionSizeColumns=function(){return this.dataRegionSizeColumns},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getECBlocks=function(){return this.ecBlocks},t.getVersionForDimensions=function(e,n){var r,o;if(1&e||1&n)throw new Se;try{for(var i=O2(t.VERSIONS),a=i.next();!a.done;a=i.next()){var s=a.value;if(s.symbolSizeRows===e&&s.symbolSizeColumns===n)return s}}catch(c){r={error:c}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(r)throw r.error}}throw new Se},t.prototype.toString=function(){return""+this.versionNumber},t.buildVersions=function(){return[new t(1,10,10,8,8,new Et(5,new yt(1,3))),new t(2,12,12,10,10,new Et(7,new yt(1,5))),new t(3,14,14,12,12,new Et(10,new yt(1,8))),new t(4,16,16,14,14,new Et(12,new yt(1,12))),new t(5,18,18,16,16,new Et(14,new yt(1,18))),new t(6,20,20,18,18,new Et(18,new yt(1,22))),new t(7,22,22,20,20,new Et(20,new yt(1,30))),new t(8,24,24,22,22,new Et(24,new yt(1,36))),new t(9,26,26,24,24,new Et(28,new yt(1,44))),new t(10,32,32,14,14,new Et(36,new yt(1,62))),new t(11,36,36,16,16,new Et(42,new yt(1,86))),new t(12,40,40,18,18,new Et(48,new yt(1,114))),new t(13,44,44,20,20,new Et(56,new yt(1,144))),new t(14,48,48,22,22,new Et(68,new yt(1,174))),new t(15,52,52,24,24,new Et(42,new yt(2,102))),new t(16,64,64,14,14,new Et(56,new yt(2,140))),new t(17,72,72,16,16,new Et(36,new yt(4,92))),new t(18,80,80,18,18,new Et(48,new yt(4,114))),new t(19,88,88,20,20,new Et(56,new yt(4,144))),new t(20,96,96,22,22,new Et(68,new yt(4,174))),new t(21,104,104,24,24,new Et(56,new yt(6,136))),new t(22,120,120,18,18,new Et(68,new yt(6,175))),new t(23,132,132,20,20,new Et(62,new yt(8,163))),new t(24,144,144,22,22,new Et(62,new yt(8,156),new yt(2,155))),new t(25,8,18,6,16,new Et(7,new yt(1,5))),new t(26,8,32,6,14,new Et(11,new yt(1,10))),new t(27,12,26,10,24,new Et(14,new yt(1,16))),new t(28,12,36,10,16,new Et(18,new yt(1,22))),new t(29,16,36,14,16,new Et(24,new yt(1,32))),new t(30,16,48,14,22,new Et(28,new yt(1,49)))]},t.VERSIONS=t.buildVersions(),t}(),$9=function(){function t(e){var n=e.getHeight();if(n<8||n>144||1&n)throw new Se;this.version=t.readVersion(e),this.mappingBitMatrix=this.extractDataRegion(e),this.readMappingMatrix=new oo(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}return t.prototype.getVersion=function(){return this.version},t.readVersion=function(e){var n=e.getHeight(),r=e.getWidth();return H9.getVersionForDimensions(n,r)},t.prototype.readCodewords=function(){var e=new Int8Array(this.version.getTotalCodewords()),n=0,r=4,o=0,i=this.mappingBitMatrix.getHeight(),a=this.mappingBitMatrix.getWidth(),s=!1,c=!1,u=!1,d=!1;do if(r!==i||o!==0||s)if(r!==i-2||o!==0||!(3&a)||c)if(r!==i+4||o!==2||7&a||u)if(r!==i-2||o!==0||(7&a)!=4||d){do r<i&&o>=0&&!this.readMappingMatrix.get(o,r)&&(e[n++]=255&this.readUtah(r,o,i,a)),r-=2,o+=2;while(r>=0&&o<a);r+=1,o+=3;do r>=0&&o<a&&!this.readMappingMatrix.get(o,r)&&(e[n++]=255&this.readUtah(r,o,i,a)),r+=2,o-=2;while(r<i&&o>=0);r+=3,o+=1}else e[n++]=255&this.readCorner4(i,a),r-=2,o+=2,d=!0;else e[n++]=255&this.readCorner3(i,a),r-=2,o+=2,u=!0;else e[n++]=255&this.readCorner2(i,a),r-=2,o+=2,c=!0;else e[n++]=255&this.readCorner1(i,a),r-=2,o+=2,s=!0;while(r<i||o<a);if(n!==this.version.getTotalCodewords())throw new Se;return e},t.prototype.readModule=function(e,n,r,o){return e<0&&(e+=r,n+=4-(r+4&7)),n<0&&(n+=o,e+=4-(o+4&7)),this.readMappingMatrix.set(n,e),this.mappingBitMatrix.get(n,e)},t.prototype.readUtah=function(e,n,r,o){var i=0;return this.readModule(e-2,n-2,r,o)&&(i|=1),i<<=1,this.readModule(e-2,n-1,r,o)&&(i|=1),i<<=1,this.readModule(e-1,n-2,r,o)&&(i|=1),i<<=1,this.readModule(e-1,n-1,r,o)&&(i|=1),i<<=1,this.readModule(e-1,n,r,o)&&(i|=1),i<<=1,this.readModule(e,n-2,r,o)&&(i|=1),i<<=1,this.readModule(e,n-1,r,o)&&(i|=1),i<<=1,this.readModule(e,n,r,o)&&(i|=1),i},t.prototype.readCorner1=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,1,e,n)&&(r|=1),r<<=1,this.readModule(e-1,2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.readCorner2=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-4,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner3=function(e,n){var r=0;return this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(0,n-3,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-3,e,n)&&(r|=1),r<<=1,this.readModule(1,n-2,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r},t.prototype.readCorner4=function(e,n){var r=0;return this.readModule(e-3,0,e,n)&&(r|=1),r<<=1,this.readModule(e-2,0,e,n)&&(r|=1),r<<=1,this.readModule(e-1,0,e,n)&&(r|=1),r<<=1,this.readModule(0,n-2,e,n)&&(r|=1),r<<=1,this.readModule(0,n-1,e,n)&&(r|=1),r<<=1,this.readModule(1,n-1,e,n)&&(r|=1),r<<=1,this.readModule(2,n-1,e,n)&&(r|=1),r<<=1,this.readModule(3,n-1,e,n)&&(r|=1),r},t.prototype.extractDataRegion=function(e){var n=this.version.getSymbolSizeRows(),r=this.version.getSymbolSizeColumns();if(e.getHeight()!==n)throw new Ve("Dimension of bitMatrix must match the version size");for(var o=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),a=n/o|0,s=r/i|0,c=new oo(s*i,a*o),u=0;u<a;++u)for(var d=u*o,h=0;h<s;++h)for(var f=h*i,p=0;p<o;++p)for(var l=u*(o+2)+1+p,g=d+p,m=0;m<i;++m){var y=h*(i+2)+1+m;if(e.get(y,l)){var w=f+m;c.set(w,g)}}return c},t}(),P2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Y9=function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n){var r,o,i,a,s=n.getECBlocks(),c=0,u=s.getECBlocks();try{for(var d=P2(u),h=d.next();!h.done;h=d.next())c+=(m=h.value).getCount()}catch(W){r={error:W}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}var f=new Array(c),p=0;try{for(var l=P2(u),g=l.next();!g.done;g=l.next())for(var m=g.value,y=0;y<m.getCount();y++){var w=m.getDataCodewords(),b=s.getECCodewords()+w;f[p++]=new t(w,new Uint8Array(b))}}catch(W){i={error:W}}finally{try{g&&!g.done&&(a=l.return)&&a.call(l)}finally{if(i)throw i.error}}var E=f[0].codewords.length-s.getECCodewords(),C=E-1,I=0;for(y=0;y<C;y++)for(var T=0;T<p;T++)f[T].codewords[y]=e[I++];var P=n.getVersionNumber()===24,N=P?8:p;for(T=0;T<N;T++)f[T].codewords[E-1]=e[I++];var L=f[0].codewords.length;for(y=E;y<L;y++)for(T=0;T<p;T++){var V=P?(T+8)%p:T,j=P&&V>7?y-1:y;f[V].codewords[j]=e[I++]}if(I!==e.length)throw new Ve;return f},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}(),k2=function(){function t(e){this.bytes=e,this.byteOffset=0,this.bitOffset=0}return t.prototype.getBitOffset=function(){return this.bitOffset},t.prototype.getByteOffset=function(){return this.byteOffset},t.prototype.readBits=function(e){if(e<1||e>32||e>this.available())throw new Ve(""+e);var n=0,r=this.bitOffset,o=this.byteOffset,i=this.bytes;if(r>0){var a=8-r,s=e<a?e:a,c=255>>8-s<<(u=a-s);n=(i[o]&c)>>u,e-=s,(r+=s)===8&&(r=0,o++)}if(e>0){for(;e>=8;)n=n<<8|255&i[o],o++,e-=8;if(e>0){var u;c=255>>(u=8-e)<<u,n=n<<e|(i[o]&c)>>u,r+=e}}return this.bitOffset=r,this.byteOffset=o,n},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();(function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"})(un||(un={}));var ra,W9=function(){function t(){}return t.decode=function(e){var n=new k2(e),r=new xt,o=new xt,i=new Array,a=un.ASCII_ENCODE;do if(a===un.ASCII_ENCODE)a=this.decodeAsciiSegment(n,r,o);else{switch(a){case un.C40_ENCODE:this.decodeC40Segment(n,r);break;case un.TEXT_ENCODE:this.decodeTextSegment(n,r);break;case un.ANSIX12_ENCODE:this.decodeAnsiX12Segment(n,r);break;case un.EDIFACT_ENCODE:this.decodeEdifactSegment(n,r);break;case un.BASE256_ENCODE:this.decodeBase256Segment(n,r,i);break;default:throw new Se}a=un.ASCII_ENCODE}while(a!==un.PAD_ENCODE&&n.available()>0);return o.length()>0&&r.append(o.toString()),new cu(e,r.toString(),i.length===0?null:i,null)},t.decodeAsciiSegment=function(e,n,r){var o=!1;do{var i=e.readBits(8);if(i===0)throw new Se;if(i<=128)return o&&(i+=128),n.append(String.fromCharCode(i-1)),un.ASCII_ENCODE;if(i===129)return un.PAD_ENCODE;if(i<=229){var a=i-130;a<10&&n.append("0"),n.append(""+a)}else switch(i){case 230:return un.C40_ENCODE;case 231:return un.BASE256_ENCODE;case 232:n.append("");break;case 233:case 234:case 241:break;case 235:o=!0;break;case 236:n.append("[)>05"),r.insert(0,"");break;case 237:n.append("[)>06"),r.insert(0,"");break;case 238:return un.ANSIX12_ENCODE;case 239:return un.TEXT_ENCODE;case 240:return un.EDIFACT_ENCODE;default:if(i!==254||e.available()!==0)throw new Se}}while(e.available()>0);return un.ASCII_ENCODE},t.decodeC40Segment=function(e,n){var r=!1,o=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),o);for(var s=0;s<3;s++){var c=o[s];switch(i){case 0:if(c<3)i=c+1;else{if(!(c<this.C40_BASIC_SET_CHARS.length))throw new Se;var u=this.C40_BASIC_SET_CHARS[c];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}break;case 1:r?(n.append(String.fromCharCode(c+128)),r=!1):n.append(String.fromCharCode(c)),i=0;break;case 2:if(c<this.C40_SHIFT2_SET_CHARS.length)u=this.C40_SHIFT2_SET_CHARS[c],r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u);else switch(c){case 27:n.append("");break;case 30:r=!0;break;default:throw new Se}i=0;break;case 3:r?(n.append(String.fromCharCode(c+224)),r=!1):n.append(String.fromCharCode(c+96)),i=0;break;default:throw new Se}}}while(e.available()>0)},t.decodeTextSegment=function(e,n){var r=!1,o=[],i=0;do{if(e.available()===8)return;var a=e.readBits(8);if(a===254)return;this.parseTwoBytes(a,e.readBits(8),o);for(var s=0;s<3;s++){var c=o[s];switch(i){case 0:if(c<3)i=c+1;else{if(!(c<this.TEXT_BASIC_SET_CHARS.length))throw new Se;var u=this.TEXT_BASIC_SET_CHARS[c];r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u)}break;case 1:r?(n.append(String.fromCharCode(c+128)),r=!1):n.append(String.fromCharCode(c)),i=0;break;case 2:if(c<this.TEXT_SHIFT2_SET_CHARS.length)u=this.TEXT_SHIFT2_SET_CHARS[c],r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u);else switch(c){case 27:n.append("");break;case 30:r=!0;break;default:throw new Se}i=0;break;case 3:if(!(c<this.TEXT_SHIFT3_SET_CHARS.length))throw new Se;u=this.TEXT_SHIFT3_SET_CHARS[c],r?(n.append(String.fromCharCode(u.charCodeAt(0)+128)),r=!1):n.append(u),i=0;break;default:throw new Se}}}while(e.available()>0)},t.decodeAnsiX12Segment=function(e,n){var r=[];do{if(e.available()===8)return;var o=e.readBits(8);if(o===254)return;this.parseTwoBytes(o,e.readBits(8),r);for(var i=0;i<3;i++){var a=r[i];switch(a){case 0:n.append("\r");break;case 1:n.append("*");break;case 2:n.append(">");break;case 3:n.append(" ");break;default:if(a<14)n.append(String.fromCharCode(a+44));else{if(!(a<40))throw new Se;n.append(String.fromCharCode(a+51))}}}}while(e.available()>0)},t.parseTwoBytes=function(e,n,r){var o=(e<<8)+n-1,i=Math.floor(o/1600);r[0]=i,o-=1600*i,i=Math.floor(o/40),r[1]=i,r[2]=o-40*i},t.decodeEdifactSegment=function(e,n){do{if(e.available()<=16)return;for(var r=0;r<4;r++){var o=e.readBits(6);if(o===31){var i=8-e.getBitOffset();return void(i!==8&&e.readBits(i))}!(32&o)&&(o|=64),n.append(String.fromCharCode(o))}}while(e.available()>0)},t.decodeBase256Segment=function(e,n,r){var o,i=1+e.getByteOffset(),a=this.unrandomize255State(e.readBits(8),i++);if((o=a===0?e.available()/8|0:a<250?a:250*(a-249)+this.unrandomize255State(e.readBits(8),i++))<0)throw new Se;for(var s=new Uint8Array(o),c=0;c<o;c++){if(e.available()<8)throw new Se;s[c]=this.unrandomize255State(e.readBits(8),i++)}r.push(s);try{n.append(ci.decode(s,pn.ISO88591))}catch(u){throw new gs("Platform does not support required encoding: "+u.message)}},t.unrandomize255State=function(e,n){var r=e-(149*n%255+1);return r>=0?r:r+256},t.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],t.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],t.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],t.TEXT_SHIFT2_SET_CHARS=t.C40_SHIFT2_SET_CHARS,t.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",""],t}(),K9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},z9=function(){function t(){this.rsDecoder=new lu(Mo.DATA_MATRIX_FIELD_256)}return t.prototype.decode=function(e){var n,r,o=new $9(e),i=o.getVersion(),a=o.readCodewords(),s=Y9.getDataBlocks(a,i),c=0;try{for(var u=K9(s),d=u.next();!d.done;d=u.next())c+=d.value.getNumDataCodewords()}catch(w){n={error:w}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}for(var h=new Uint8Array(c),f=s.length,p=0;p<f;p++){var l=s[p],g=l.getCodewords(),m=l.getNumDataCodewords();this.correctErrors(g,m);for(var y=0;y<m;y++)h[y*f+p]=g[y]}return W9.decode(h)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new sn}for(var o=0;o<n;o++)e[o]=r[o]},t}(),X9=function(){function t(e){this.image=e,this.rectangleDetector=new Af(this.image)}return t.prototype.detect=function(){var e=this.rectangleDetector.detect(),n=this.detectSolid1(e);if((n=this.detectSolid2(n))[3]=this.correctTopRight(n),!n[3])throw new he;var r=(n=this.shiftToModuleCenter(n))[0],o=n[1],i=n[2],a=n[3],s=this.transitionsBetween(r,a)+1,c=this.transitionsBetween(i,a)+1;(1&s)==1&&(s+=1),(1&c)==1&&(c+=1),4*s<7*c&&4*c<7*s&&(s=c=Math.max(s,c));var u=t.sampleGrid(this.image,r,o,i,a,s,c);return new _f(u,[r,o,i,a])},t.shiftPoint=function(e,n,r){var o=(n.getX()-e.getX())/(r+1),i=(n.getY()-e.getY())/(r+1);return new Pe(e.getX()+o,e.getY()+i)},t.moveAway=function(e,n,r){var o=e.getX(),i=e.getY();return o<n?o-=1:o+=1,i<r?i-=1:i+=1,new Pe(o,i)},t.prototype.detectSolid1=function(e){var n=e[0],r=e[1],o=e[3],i=e[2],a=this.transitionsBetween(n,r),s=this.transitionsBetween(r,o),c=this.transitionsBetween(o,i),u=this.transitionsBetween(i,n),d=a,h=[i,n,r,o];return d>s&&(d=s,h[0]=n,h[1]=r,h[2]=o,h[3]=i),d>c&&(d=c,h[0]=r,h[1]=o,h[2]=i,h[3]=n),d>u&&(h[0]=o,h[1]=i,h[2]=n,h[3]=r),h},t.prototype.detectSolid2=function(e){var n=e[0],r=e[1],o=e[2],i=e[3],a=this.transitionsBetween(n,i),s=t.shiftPoint(r,o,4*(a+1)),c=t.shiftPoint(o,r,4*(a+1));return this.transitionsBetween(s,n)<this.transitionsBetween(c,i)?(e[0]=n,e[1]=r,e[2]=o,e[3]=i):(e[0]=r,e[1]=o,e[2]=i,e[3]=n),e},t.prototype.correctTopRight=function(e){var n=e[0],r=e[1],o=e[2],i=e[3],a=this.transitionsBetween(n,i),s=this.transitionsBetween(r,i),c=t.shiftPoint(n,r,4*(s+1)),u=t.shiftPoint(o,r,4*(a+1));a=this.transitionsBetween(c,i),s=this.transitionsBetween(u,i);var d=new Pe(i.getX()+(o.getX()-r.getX())/(a+1),i.getY()+(o.getY()-r.getY())/(a+1)),h=new Pe(i.getX()+(n.getX()-r.getX())/(s+1),i.getY()+(n.getY()-r.getY())/(s+1));return this.isValid(d)?this.isValid(h)?this.transitionsBetween(c,d)+this.transitionsBetween(u,d)>this.transitionsBetween(c,h)+this.transitionsBetween(u,h)?d:h:d:this.isValid(h)?h:null},t.prototype.shiftToModuleCenter=function(e){var n=e[0],r=e[1],o=e[2],i=e[3],a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1,c=t.shiftPoint(n,r,4*s),u=t.shiftPoint(o,r,4*a);(1&(a=this.transitionsBetween(c,i)+1))==1&&(a+=1),(1&(s=this.transitionsBetween(u,i)+1))==1&&(s+=1);var d,h,f=(n.getX()+r.getX()+o.getX()+i.getX())/4,p=(n.getY()+r.getY()+o.getY()+i.getY())/4;return n=t.moveAway(n,f,p),r=t.moveAway(r,f,p),o=t.moveAway(o,f,p),i=t.moveAway(i,f,p),c=t.shiftPoint(n,r,4*s),c=t.shiftPoint(c,i,4*a),d=t.shiftPoint(r,n,4*s),d=t.shiftPoint(d,o,4*a),u=t.shiftPoint(o,i,4*s),u=t.shiftPoint(u,r,4*a),h=t.shiftPoint(i,o,4*s),[c,d,u,h=t.shiftPoint(h,n,4*a)]},t.prototype.isValid=function(e){return e.getX()>=0&&e.getX()<this.image.getWidth()&&e.getY()>0&&e.getY()<this.image.getHeight()},t.sampleGrid=function(e,n,r,o,i,a,s){return Sf.getInstance().sampleGrid(e,a,s,.5,.5,a-.5,.5,a-.5,s-.5,.5,s-.5,n.getX(),n.getY(),i.getX(),i.getY(),o.getX(),o.getY(),r.getX(),r.getY())},t.prototype.transitionsBetween=function(e,n){var r=Math.trunc(e.getX()),o=Math.trunc(e.getY()),i=Math.trunc(n.getX()),a=Math.trunc(n.getY()),s=Math.abs(a-o)>Math.abs(i-r);if(s){var c=r;r=o,o=c,c=i,i=a,a=c}for(var u=Math.abs(i-r),d=Math.abs(a-o),h=-u/2,f=o<a?1:-1,p=r<i?1:-1,l=0,g=this.image.get(s?o:r,s?r:o),m=r,y=o;m!==i;m+=p){var w=this.image.get(s?y:m,s?m:y);if(w!==g&&(l++,g=w),(h+=d)>0){if(y===a)break;y+=f,h-=u}}return l},t}(),yu=function(){function t(){this.decoder=new z9}return t.prototype.decode=function(e,n){var r,o;if(n===void 0&&(n=null),n!=null&&n.has(Pt.PURE_BARCODE)){var i=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decode(i),o=t.NO_POINTS}else{var a=new X9(e.getBlackMatrix()).detect();r=this.decoder.decode(a.getBits()),o=a.getPoints()}var s=r.getRawBytes(),c=new Wn(r.getText(),s,8*s.length,o,Re.DATA_MATRIX,Nt.currentTimeMillis()),u=r.getByteSegments();u!=null&&c.putMetadata(Cn.BYTE_SEGMENTS,u);var d=r.getECLevel();return d!=null&&c.putMetadata(Cn.ERROR_CORRECTION_LEVEL,d),c},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n==null||r==null)throw new he;var o=this.moduleSize(n,e),i=n[1],a=r[1],s=n[0],c=(r[0]-s+1)/o,u=(a-i+1)/o;if(c<=0||u<=0)throw new he;var d=o/2;i+=d,s+=d;for(var h=new oo(c,u),f=0;f<u;f++)for(var p=i+f*o,l=0;l<c;l++)e.get(s+l*o,p)&&h.set(l,f);return h},t.moduleSize=function(e,n){for(var r=n.getWidth(),o=e[0],i=e[1];o<r&&n.get(o,i);)o++;if(o===r)throw new he;var a=o-e[0];if(a===0)throw new he;return a},t.NO_POINTS=[],t}(),Q9=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new yu,n)||this}Q9(e,t)})(Zi),function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(ra||(ra={}));var gn,J9=function(){function t(e,n,r){this.value=e,this.stringValue=n,this.bits=r,t.FOR_BITS.set(r,this),t.FOR_VALUE.set(e,this)}return t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.fromString=function(e){switch(e){case"L":return t.L;case"M":return t.M;case"Q":return t.Q;case"H":return t.H;default:throw new Ht(e+"not available")}},t.prototype.toString=function(){return this.stringValue},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.forBits=function(e){if(e<0||e>=t.FOR_BITS.size)throw new Ve;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(ra.L,"L",1),t.M=new t(ra.M,"M",0),t.Q=new t(ra.Q,"Q",3),t.H=new t(ra.H,"H",2),t}(),Z9=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},B2=function(){function t(e){this.errorCorrectionLevel=J9.forBits(e>>3&3),this.dataMask=7&e}return t.numBitsDiffering=function(e,n){return bn.bitCount(e^n)},t.decodeFormatInformation=function(e,n){var r=t.doDecodeFormatInformation(e,n);return r!==null?r:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,n^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,n){var r,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var s=Z9(t.FORMAT_INFO_DECODE_LOOKUP),c=s.next();!c.done;c=s.next()){var u=c.value,d=u[0];if(d===e||d===n)return new t(u[1]);var h=t.numBitsDiffering(e,d);h<i&&(a=u[1],i=h),e!==n&&(h=t.numBitsDiffering(n,d))<i&&(a=u[1],i=h)}}catch(f){r={error:f}}finally{try{c&&!c.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}return i<=3?new t(a):null},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getDataMask=function(){return this.dataMask},t.prototype.hashCode=function(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.errorCorrectionLevel===n.errorCorrectionLevel&&this.dataMask===n.dataMask},t.FORMAT_INFO_MASK_QR=21522,t.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])],t}(),eI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},ie=function(){function t(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.ecCodewordsPerBlock=e,this.ecBlocks=n}return t.prototype.getECCodewordsPerBlock=function(){return this.ecCodewordsPerBlock},t.prototype.getNumBlocks=function(){var e,n,r=0,o=this.ecBlocks;try{for(var i=eI(o),a=i.next();!a.done;a=i.next())r+=a.value.getCount()}catch(s){e={error:s}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r},t.prototype.getTotalECCodewords=function(){return this.ecCodewordsPerBlock*this.getNumBlocks()},t.prototype.getECBlocks=function(){return this.ecBlocks},t}(),D=function(){function t(e,n){this.count=e,this.dataCodewords=n}return t.prototype.getCount=function(){return this.count},t.prototype.getDataCodewords=function(){return this.dataCodewords},t}(),tI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vu=function(){function t(e,n){for(var r,o,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];this.versionNumber=e,this.alignmentPatternCenters=n,this.ecBlocks=i;var s=0,c=i[0].getECCodewordsPerBlock(),u=i[0].getECBlocks();try{for(var d=tI(u),h=d.next();!h.done;h=d.next()){var f=h.value;s+=f.getCount()*(f.getDataCodewords()+c)}}catch(p){r={error:p}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}this.totalCodewords=s}return t.prototype.getVersionNumber=function(){return this.versionNumber},t.prototype.getAlignmentPatternCenters=function(){return this.alignmentPatternCenters},t.prototype.getTotalCodewords=function(){return this.totalCodewords},t.prototype.getDimensionForVersion=function(){return 17+4*this.versionNumber},t.prototype.getECBlocksForLevel=function(e){return this.ecBlocks[e.getValue()]},t.getProvisionalVersionForDimension=function(e){if(e%4!=1)throw new Se;try{return this.getVersionForNumber((e-17)/4)}catch{throw new Se}},t.getVersionForNumber=function(e){if(e<1||e>40)throw new Ve;return t.VERSIONS[e-1]},t.decodeVersionInformation=function(e){for(var n=Number.MAX_SAFE_INTEGER,r=0,o=0;o<t.VERSION_DECODE_INFO.length;o++){var i=t.VERSION_DECODE_INFO[o];if(i===e)return t.getVersionForNumber(o+7);var a=B2.numBitsDiffering(e,i);a<n&&(r=o+7,n=a)}return n<=3?t.getVersionForNumber(r):null},t.prototype.buildFunctionPattern=function(){var e=this.getDimensionForVersion(),n=new oo(e);n.setRegion(0,0,9,9),n.setRegion(e-8,0,8,9),n.setRegion(0,e-8,9,8);for(var r=this.alignmentPatternCenters.length,o=0;o<r;o++)for(var i=this.alignmentPatternCenters[o]-2,a=0;a<r;a++)o===0&&(a===0||a===r-1)||o===r-1&&a===0||n.setRegion(this.alignmentPatternCenters[a]-2,i,5,5);return n.setRegion(6,9,1,e-17),n.setRegion(9,6,e-17,1),this.versionNumber>6&&(n.setRegion(e-11,0,3,6),n.setRegion(0,e-11,6,3)),n},t.prototype.toString=function(){return""+this.versionNumber},t.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),t.VERSIONS=[new t(1,new Int32Array(0),new ie(7,new D(1,19)),new ie(10,new D(1,16)),new ie(13,new D(1,13)),new ie(17,new D(1,9))),new t(2,Int32Array.from([6,18]),new ie(10,new D(1,34)),new ie(16,new D(1,28)),new ie(22,new D(1,22)),new ie(28,new D(1,16))),new t(3,Int32Array.from([6,22]),new ie(15,new D(1,55)),new ie(26,new D(1,44)),new ie(18,new D(2,17)),new ie(22,new D(2,13))),new t(4,Int32Array.from([6,26]),new ie(20,new D(1,80)),new ie(18,new D(2,32)),new ie(26,new D(2,24)),new ie(16,new D(4,9))),new t(5,Int32Array.from([6,30]),new ie(26,new D(1,108)),new ie(24,new D(2,43)),new ie(18,new D(2,15),new D(2,16)),new ie(22,new D(2,11),new D(2,12))),new t(6,Int32Array.from([6,34]),new ie(18,new D(2,68)),new ie(16,new D(4,27)),new ie(24,new D(4,19)),new ie(28,new D(4,15))),new t(7,Int32Array.from([6,22,38]),new ie(20,new D(2,78)),new ie(18,new D(4,31)),new ie(18,new D(2,14),new D(4,15)),new ie(26,new D(4,13),new D(1,14))),new t(8,Int32Array.from([6,24,42]),new ie(24,new D(2,97)),new ie(22,new D(2,38),new D(2,39)),new ie(22,new D(4,18),new D(2,19)),new ie(26,new D(4,14),new D(2,15))),new t(9,Int32Array.from([6,26,46]),new ie(30,new D(2,116)),new ie(22,new D(3,36),new D(2,37)),new ie(20,new D(4,16),new D(4,17)),new ie(24,new D(4,12),new D(4,13))),new t(10,Int32Array.from([6,28,50]),new ie(18,new D(2,68),new D(2,69)),new ie(26,new D(4,43),new D(1,44)),new ie(24,new D(6,19),new D(2,20)),new ie(28,new D(6,15),new D(2,16))),new t(11,Int32Array.from([6,30,54]),new ie(20,new D(4,81)),new ie(30,new D(1,50),new D(4,51)),new ie(28,new D(4,22),new D(4,23)),new ie(24,new D(3,12),new D(8,13))),new t(12,Int32Array.from([6,32,58]),new ie(24,new D(2,92),new D(2,93)),new ie(22,new D(6,36),new D(2,37)),new ie(26,new D(4,20),new D(6,21)),new ie(28,new D(7,14),new D(4,15))),new t(13,Int32Array.from([6,34,62]),new ie(26,new D(4,107)),new ie(22,new D(8,37),new D(1,38)),new ie(24,new D(8,20),new D(4,21)),new ie(22,new D(12,11),new D(4,12))),new t(14,Int32Array.from([6,26,46,66]),new ie(30,new D(3,115),new D(1,116)),new ie(24,new D(4,40),new D(5,41)),new ie(20,new D(11,16),new D(5,17)),new ie(24,new D(11,12),new D(5,13))),new t(15,Int32Array.from([6,26,48,70]),new ie(22,new D(5,87),new D(1,88)),new ie(24,new D(5,41),new D(5,42)),new ie(30,new D(5,24),new D(7,25)),new ie(24,new D(11,12),new D(7,13))),new t(16,Int32Array.from([6,26,50,74]),new ie(24,new D(5,98),new D(1,99)),new ie(28,new D(7,45),new D(3,46)),new ie(24,new D(15,19),new D(2,20)),new ie(30,new D(3,15),new D(13,16))),new t(17,Int32Array.from([6,30,54,78]),new ie(28,new D(1,107),new D(5,108)),new ie(28,new D(10,46),new D(1,47)),new ie(28,new D(1,22),new D(15,23)),new ie(28,new D(2,14),new D(17,15))),new t(18,Int32Array.from([6,30,56,82]),new ie(30,new D(5,120),new D(1,121)),new ie(26,new D(9,43),new D(4,44)),new ie(28,new D(17,22),new D(1,23)),new ie(28,new D(2,14),new D(19,15))),new t(19,Int32Array.from([6,30,58,86]),new ie(28,new D(3,113),new D(4,114)),new ie(26,new D(3,44),new D(11,45)),new ie(26,new D(17,21),new D(4,22)),new ie(26,new D(9,13),new D(16,14))),new t(20,Int32Array.from([6,34,62,90]),new ie(28,new D(3,107),new D(5,108)),new ie(26,new D(3,41),new D(13,42)),new ie(30,new D(15,24),new D(5,25)),new ie(28,new D(15,15),new D(10,16))),new t(21,Int32Array.from([6,28,50,72,94]),new ie(28,new D(4,116),new D(4,117)),new ie(26,new D(17,42)),new ie(28,new D(17,22),new D(6,23)),new ie(30,new D(19,16),new D(6,17))),new t(22,Int32Array.from([6,26,50,74,98]),new ie(28,new D(2,111),new D(7,112)),new ie(28,new D(17,46)),new ie(30,new D(7,24),new D(16,25)),new ie(24,new D(34,13))),new t(23,Int32Array.from([6,30,54,78,102]),new ie(30,new D(4,121),new D(5,122)),new ie(28,new D(4,47),new D(14,48)),new ie(30,new D(11,24),new D(14,25)),new ie(30,new D(16,15),new D(14,16))),new t(24,Int32Array.from([6,28,54,80,106]),new ie(30,new D(6,117),new D(4,118)),new ie(28,new D(6,45),new D(14,46)),new ie(30,new D(11,24),new D(16,25)),new ie(30,new D(30,16),new D(2,17))),new t(25,Int32Array.from([6,32,58,84,110]),new ie(26,new D(8,106),new D(4,107)),new ie(28,new D(8,47),new D(13,48)),new ie(30,new D(7,24),new D(22,25)),new ie(30,new D(22,15),new D(13,16))),new t(26,Int32Array.from([6,30,58,86,114]),new ie(28,new D(10,114),new D(2,115)),new ie(28,new D(19,46),new D(4,47)),new ie(28,new D(28,22),new D(6,23)),new ie(30,new D(33,16),new D(4,17))),new t(27,Int32Array.from([6,34,62,90,118]),new ie(30,new D(8,122),new D(4,123)),new ie(28,new D(22,45),new D(3,46)),new ie(30,new D(8,23),new D(26,24)),new ie(30,new D(12,15),new D(28,16))),new t(28,Int32Array.from([6,26,50,74,98,122]),new ie(30,new D(3,117),new D(10,118)),new ie(28,new D(3,45),new D(23,46)),new ie(30,new D(4,24),new D(31,25)),new ie(30,new D(11,15),new D(31,16))),new t(29,Int32Array.from([6,30,54,78,102,126]),new ie(30,new D(7,116),new D(7,117)),new ie(28,new D(21,45),new D(7,46)),new ie(30,new D(1,23),new D(37,24)),new ie(30,new D(19,15),new D(26,16))),new t(30,Int32Array.from([6,26,52,78,104,130]),new ie(30,new D(5,115),new D(10,116)),new ie(28,new D(19,47),new D(10,48)),new ie(30,new D(15,24),new D(25,25)),new ie(30,new D(23,15),new D(25,16))),new t(31,Int32Array.from([6,30,56,82,108,134]),new ie(30,new D(13,115),new D(3,116)),new ie(28,new D(2,46),new D(29,47)),new ie(30,new D(42,24),new D(1,25)),new ie(30,new D(23,15),new D(28,16))),new t(32,Int32Array.from([6,34,60,86,112,138]),new ie(30,new D(17,115)),new ie(28,new D(10,46),new D(23,47)),new ie(30,new D(10,24),new D(35,25)),new ie(30,new D(19,15),new D(35,16))),new t(33,Int32Array.from([6,30,58,86,114,142]),new ie(30,new D(17,115),new D(1,116)),new ie(28,new D(14,46),new D(21,47)),new ie(30,new D(29,24),new D(19,25)),new ie(30,new D(11,15),new D(46,16))),new t(34,Int32Array.from([6,34,62,90,118,146]),new ie(30,new D(13,115),new D(6,116)),new ie(28,new D(14,46),new D(23,47)),new ie(30,new D(44,24),new D(7,25)),new ie(30,new D(59,16),new D(1,17))),new t(35,Int32Array.from([6,30,54,78,102,126,150]),new ie(30,new D(12,121),new D(7,122)),new ie(28,new D(12,47),new D(26,48)),new ie(30,new D(39,24),new D(14,25)),new ie(30,new D(22,15),new D(41,16))),new t(36,Int32Array.from([6,24,50,76,102,128,154]),new ie(30,new D(6,121),new D(14,122)),new ie(28,new D(6,47),new D(34,48)),new ie(30,new D(46,24),new D(10,25)),new ie(30,new D(2,15),new D(64,16))),new t(37,Int32Array.from([6,28,54,80,106,132,158]),new ie(30,new D(17,122),new D(4,123)),new ie(28,new D(29,46),new D(14,47)),new ie(30,new D(49,24),new D(10,25)),new ie(30,new D(24,15),new D(46,16))),new t(38,Int32Array.from([6,32,58,84,110,136,162]),new ie(30,new D(4,122),new D(18,123)),new ie(28,new D(13,46),new D(32,47)),new ie(30,new D(48,24),new D(14,25)),new ie(30,new D(42,15),new D(32,16))),new t(39,Int32Array.from([6,26,54,82,110,138,166]),new ie(30,new D(20,117),new D(4,118)),new ie(28,new D(40,47),new D(7,48)),new ie(30,new D(43,24),new D(22,25)),new ie(30,new D(10,15),new D(67,16))),new t(40,Int32Array.from([6,30,58,86,114,142,170]),new ie(30,new D(19,118),new D(6,119)),new ie(28,new D(18,47),new D(31,48)),new ie(30,new D(34,24),new D(34,25)),new ie(30,new D(20,15),new D(61,16)))],t}();(function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"})(gn||(gn={}));var vr,N2=function(){function t(e,n){this.value=e,this.isMasked=n}return t.prototype.unmaskBitMatrix=function(e,n){for(var r=0;r<n;r++)for(var o=0;o<n;o++)this.isMasked(r,o)&&e.flip(o,r)},t.values=new Map([[gn.DATA_MASK_000,new t(gn.DATA_MASK_000,function(e,n){return(e+n&1)==0})],[gn.DATA_MASK_001,new t(gn.DATA_MASK_001,function(e,n){return(1&e)==0})],[gn.DATA_MASK_010,new t(gn.DATA_MASK_010,function(e,n){return n%3==0})],[gn.DATA_MASK_011,new t(gn.DATA_MASK_011,function(e,n){return(e+n)%3==0})],[gn.DATA_MASK_100,new t(gn.DATA_MASK_100,function(e,n){return(Math.floor(e/2)+Math.floor(n/3)&1)==0})],[gn.DATA_MASK_101,new t(gn.DATA_MASK_101,function(e,n){return e*n%6==0})],[gn.DATA_MASK_110,new t(gn.DATA_MASK_110,function(e,n){return e*n%6<3})],[gn.DATA_MASK_111,new t(gn.DATA_MASK_111,function(e,n){return(e+n+e*n%3&1)==0})]]),t}(),nI=function(){function t(e){var n=e.getHeight();if(n<21||(3&n)!=1)throw new Se;this.bitMatrix=e}return t.prototype.readFormatInformation=function(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;for(var e=0,n=0;n<6;n++)e=this.copyBit(n,8,e);e=this.copyBit(7,8,e),e=this.copyBit(8,8,e),e=this.copyBit(8,7,e);for(var r=5;r>=0;r--)e=this.copyBit(8,r,e);var o=this.bitMatrix.getHeight(),i=0,a=o-7;for(r=o-1;r>=a;r--)i=this.copyBit(8,r,i);for(n=o-8;n<o;n++)i=this.copyBit(n,8,i);if(this.parsedFormatInfo=B2.decodeFormatInformation(e,i),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new Se},t.prototype.readVersion=function(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;var e=this.bitMatrix.getHeight(),n=Math.floor((e-17)/4);if(n<=6)return vu.getVersionForNumber(n);for(var r=0,o=e-11,i=5;i>=0;i--)for(var a=e-9;a>=o;a--)r=this.copyBit(a,i,r);var s=vu.decodeVersionInformation(r);if(s!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;for(r=0,a=5;a>=0;a--)for(i=e-9;i>=o;i--)r=this.copyBit(a,i,r);if((s=vu.decodeVersionInformation(r))!==null&&s.getDimensionForVersion()===e)return this.parsedVersion=s,s;throw new Se},t.prototype.copyBit=function(e,n,r){return(this.isMirror?this.bitMatrix.get(n,e):this.bitMatrix.get(e,n))?r<<1|1:r<<1},t.prototype.readCodewords=function(){var e=this.readFormatInformation(),n=this.readVersion(),r=N2.values.get(e.getDataMask()),o=this.bitMatrix.getHeight();r.unmaskBitMatrix(this.bitMatrix,o);for(var i=n.buildFunctionPattern(),a=!0,s=new Uint8Array(n.getTotalCodewords()),c=0,u=0,d=0,h=o-1;h>0;h-=2){h===6&&h--;for(var f=0;f<o;f++)for(var p=a?o-1-f:f,l=0;l<2;l++)i.get(h-l,p)||(d++,u<<=1,this.bitMatrix.get(h-l,p)&&(u|=1),d===8&&(s[c++]=u,d=0,u=0));a=!a}if(c!==n.getTotalCodewords())throw new Se;return s},t.prototype.remask=function(){if(this.parsedFormatInfo!==null){var e=N2.values[this.parsedFormatInfo.getDataMask()],n=this.bitMatrix.getHeight();e.unmaskBitMatrix(this.bitMatrix,n)}},t.prototype.setMirror=function(e){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=e},t.prototype.mirror=function(){for(var e=this.bitMatrix,n=0,r=e.getWidth();n<r;n++)for(var o=n+1,i=e.getHeight();o<i;o++)e.get(n,o)!==e.get(o,n)&&(e.flip(o,n),e.flip(n,o))},t}(),R2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},rI=function(){function t(e,n){this.numDataCodewords=e,this.codewords=n}return t.getDataBlocks=function(e,n,r){var o,i,a,s;if(e.length!==n.getTotalCodewords())throw new Ve;var c=n.getECBlocksForLevel(r),u=0,d=c.getECBlocks();try{for(var h=R2(d),f=h.next();!f.done;f=h.next())u+=(y=f.value).getCount()}catch(j){o={error:j}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(o)throw o.error}}var p=new Array(u),l=0;try{for(var g=R2(d),m=g.next();!m.done;m=g.next())for(var y=m.value,w=0;w<y.getCount();w++){var b=y.getDataCodewords(),E=c.getECCodewordsPerBlock()+b;p[l++]=new t(b,new Uint8Array(E))}}catch(j){a={error:j}}finally{try{m&&!m.done&&(s=g.return)&&s.call(g)}finally{if(a)throw a.error}}for(var C=p[0].codewords.length,I=p.length-1;I>=0&&p[I].codewords.length!==C;)I--;I++;var T=C-c.getECCodewordsPerBlock(),P=0;for(w=0;w<T;w++)for(var N=0;N<l;N++)p[N].codewords[w]=e[P++];for(N=I;N<l;N++)p[N].codewords[T]=e[P++];var L=p[0].codewords.length;for(w=T;w<L;w++)for(N=0;N<l;N++){var V=N<I?w:w+1;p[N].codewords[V]=e[P++]}return p},t.prototype.getNumDataCodewords=function(){return this.numDataCodewords},t.prototype.getCodewords=function(){return this.codewords},t}();(function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"})(vr||(vr={}));var St,wu,ir=function(){function t(e,n,r,o){this.value=e,this.stringValue=n,this.characterCountBitsForVersions=r,this.bits=o,t.FOR_BITS.set(o,this),t.FOR_VALUE.set(e,this)}return t.forBits=function(e){var n=t.FOR_BITS.get(e);if(n===void 0)throw new Ve;return n},t.prototype.getCharacterCountBits=function(e){var n,r=e.getVersionNumber();return n=r<=9?0:r<=26?1:2,this.characterCountBitsForVersions[n]},t.prototype.getValue=function(){return this.value},t.prototype.getBits=function(){return this.bits},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.value===n.value},t.prototype.toString=function(){return this.stringValue},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.TERMINATOR=new t(vr.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),t.NUMERIC=new t(vr.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),t.ALPHANUMERIC=new t(vr.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),t.STRUCTURED_APPEND=new t(vr.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),t.BYTE=new t(vr.BYTE,"BYTE",Int32Array.from([8,16,16]),4),t.ECI=new t(vr.ECI,"ECI",Int32Array.from([0,0,0]),7),t.KANJI=new t(vr.KANJI,"KANJI",Int32Array.from([8,10,12]),8),t.FNC1_FIRST_POSITION=new t(vr.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),t.FNC1_SECOND_POSITION=new t(vr.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),t.HANZI=new t(vr.HANZI,"HANZI",Int32Array.from([8,10,12]),13),t}(),oI=function(){function t(){}return t.decode=function(e,n,r,o){var i=new k2(e),a=new xt,s=new Array,c=-1,u=-1;try{var d=null,h=!1,f=void 0;do{if(i.available()<4)f=ir.TERMINATOR;else{var p=i.readBits(4);f=ir.forBits(p)}switch(f){case ir.TERMINATOR:break;case ir.FNC1_FIRST_POSITION:case ir.FNC1_SECOND_POSITION:h=!0;break;case ir.STRUCTURED_APPEND:if(i.available()<16)throw new Se;c=i.readBits(8),u=i.readBits(8);break;case ir.ECI:var l=t.parseECIValue(i);if((d=Yn.getCharacterSetECIByValue(l))===null)throw new Se;break;case ir.HANZI:var g=i.readBits(4),m=i.readBits(f.getCharacterCountBits(n));g===t.GB2312_SUBSET&&t.decodeHanziSegment(i,a,m);break;default:var y=i.readBits(f.getCharacterCountBits(n));switch(f){case ir.NUMERIC:t.decodeNumericSegment(i,a,y);break;case ir.ALPHANUMERIC:t.decodeAlphanumericSegment(i,a,y,h);break;case ir.BYTE:t.decodeByteSegment(i,a,y,d,s,o);break;case ir.KANJI:t.decodeKanjiSegment(i,a,y);break;default:throw new Se}}}while(f!==ir.TERMINATOR)}catch{throw new Se}return new cu(e,a.toString(),s.length===0?null:s,r===null?null:r.toString(),c,u)},t.decodeHanziSegment=function(e,n,r){if(13*r>e.available())throw new Se;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=e.readBits(13),s=a/96<<8&4294967295|a%96;s+=s<959?41377:42657,o[i]=s>>8&255,o[i+1]=255&s,i+=2,r--}try{n.append(ci.decode(o,pn.GB2312))}catch(c){throw new Se(c)}},t.decodeKanjiSegment=function(e,n,r){if(13*r>e.available())throw new Se;for(var o=new Uint8Array(2*r),i=0;r>0;){var a=e.readBits(13),s=a/192<<8&4294967295|a%192;s+=s<7936?33088:49472,o[i]=s>>8,o[i+1]=s,i+=2,r--}try{n.append(ci.decode(o,pn.SHIFT_JIS))}catch(c){throw new Se(c)}},t.decodeByteSegment=function(e,n,r,o,i,a){if(8*r>e.available())throw new Se;for(var s,c=new Uint8Array(r),u=0;u<r;u++)c[u]=e.readBits(8);s=o===null?pn.guessEncoding(c,a):o.getName();try{n.append(ci.decode(c,s))}catch(d){throw new Se(d)}i.push(c)},t.toAlphaNumericChar=function(e){if(e>=t.ALPHANUMERIC_CHARS.length)throw new Se;return t.ALPHANUMERIC_CHARS[e]},t.decodeAlphanumericSegment=function(e,n,r,o){for(var i=n.length();r>1;){if(e.available()<11)throw new Se;var a=e.readBits(11);n.append(t.toAlphaNumericChar(Math.floor(a/45))),n.append(t.toAlphaNumericChar(a%45)),r-=2}if(r===1){if(e.available()<6)throw new Se;n.append(t.toAlphaNumericChar(e.readBits(6)))}if(o)for(var s=i;s<n.length();s++)n.charAt(s)==="%"&&(s<n.length()-1&&n.charAt(s+1)==="%"?n.deleteCharAt(s+1):n.setCharAt(s,""))},t.decodeNumericSegment=function(e,n,r){for(;r>=3;){if(e.available()<10)throw new Se;var o=e.readBits(10);if(o>=1e3)throw new Se;n.append(t.toAlphaNumericChar(Math.floor(o/100))),n.append(t.toAlphaNumericChar(Math.floor(o/10)%10)),n.append(t.toAlphaNumericChar(o%10)),r-=3}if(r===2){if(e.available()<7)throw new Se;var i=e.readBits(7);if(i>=100)throw new Se;n.append(t.toAlphaNumericChar(Math.floor(i/10))),n.append(t.toAlphaNumericChar(i%10))}else if(r===1){if(e.available()<4)throw new Se;var a=e.readBits(4);if(a>=10)throw new Se;n.append(t.toAlphaNumericChar(a))}},t.parseECIValue=function(e){var n=e.readBits(8);if(!(128&n))return 127&n;if((192&n)==128)return(63&n)<<8&4294967295|e.readBits(8);if((224&n)==192)return(31&n)<<16&4294967295|e.readBits(16);throw new Se},t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",t.GB2312_SUBSET=1,t}(),D2=function(){function t(e){this.mirrored=e}return t.prototype.isMirrored=function(){return this.mirrored},t.prototype.applyMirroredCorrection=function(e){if(this.mirrored&&e!==null&&!(e.length<3)){var n=e[0];e[0]=e[2],e[2]=n}},t}(),M2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},iI=function(){function t(){this.rsDecoder=new lu(Mo.QR_CODE_FIELD_256)}return t.prototype.decodeBooleanArray=function(e,n){return this.decodeBitMatrix(oo.parseFromBooleanArray(e),n)},t.prototype.decodeBitMatrix=function(e,n){var r=new nI(e),o=null;try{return this.decodeBitMatrixParser(r,n)}catch(a){o=a}try{r.remask(),r.setMirror(!0),r.readVersion(),r.readFormatInformation(),r.mirror();var i=this.decodeBitMatrixParser(r,n);return i.setOther(new D2(!0)),i}catch(a){throw o!==null?o:a}},t.prototype.decodeBitMatrixParser=function(e,n){var r,o,i,a,s=e.readVersion(),c=e.readFormatInformation().getErrorCorrectionLevel(),u=e.readCodewords(),d=rI.getDataBlocks(u,s,c),h=0;try{for(var f=M2(d),p=f.next();!p.done;p=f.next())h+=(w=p.value).getNumDataCodewords()}catch(I){r={error:I}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}var l=new Uint8Array(h),g=0;try{for(var m=M2(d),y=m.next();!y.done;y=m.next()){var w,b=(w=y.value).getCodewords(),E=w.getNumDataCodewords();this.correctErrors(b,E);for(var C=0;C<E;C++)l[g++]=b[C]}}catch(I){i={error:I}}finally{try{y&&!y.done&&(a=m.return)&&a.call(m)}finally{if(i)throw i.error}}return oI.decode(l,s,c,n)},t.prototype.correctErrors=function(e,n){var r=new Int32Array(e);try{this.rsDecoder.decode(r,e.length-n)}catch{throw new sn}for(var o=0;o<n;o++)e[o]=r[o]},t}(),aI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sI=function(t){function e(n,r,o){var i=t.call(this,n,r)||this;return i.estimatedModuleSize=o,i}return aI(e,t),e.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,o){return new e((this.getX()+r)/2,(this.getY()+n)/2,(this.estimatedModuleSize+o)/2)},e}(Pe),cI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},uI=function(){function t(e,n,r,o,i,a,s){this.image=e,this.startX=n,this.startY=r,this.width=o,this.height=i,this.moduleSize=a,this.resultPointCallback=s,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}return t.prototype.find=function(){for(var e=this.startX,n=this.height,r=e+this.width,o=this.startY+n/2,i=new Int32Array(3),a=this.image,s=0;s<n;s++){var c=o+(1&s?-Math.floor((s+1)/2):Math.floor((s+1)/2));i[0]=0,i[1]=0,i[2]=0;for(var u=e;u<r&&!a.get(u,c);)u++;for(var d=0;u<r;){if(a.get(u,c))if(d===1)i[1]++;else if(d===2){var h;if(this.foundPatternCross(i)&&(h=this.handlePossibleCenter(i,c,u))!==null)return h;i[0]=i[2],i[1]=1,i[2]=0,d=1}else i[++d]++;else d===1&&d++,i[d]++;u++}if(this.foundPatternCross(i)&&(h=this.handlePossibleCenter(i,c,r))!==null)return h}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new he},t.centerFromEnd=function(e,n){return n-e[2]-e[1]/2},t.prototype.foundPatternCross=function(e){for(var n=this.moduleSize,r=n/2,o=0;o<3;o++)if(Math.abs(n-e[o])>=r)return!1;return!0},t.prototype.crossCheckVertical=function(e,n,r,o){var i=this.image,a=i.getHeight(),s=this.crossCheckStateCount;s[0]=0,s[1]=0,s[2]=0;for(var c=e;c>=0&&i.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&!i.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<a&&i.get(n,c)&&s[1]<=r;)s[1]++,c++;if(c===a||s[1]>r)return NaN;for(;c<a&&!i.get(n,c)&&s[2]<=r;)s[2]++,c++;if(s[2]>r)return NaN;var u=s[0]+s[1]+s[2];return 5*Math.abs(u-o)>=2*o?NaN:this.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,n,r){var o,i,a=e[0]+e[1]+e[2],s=t.centerFromEnd(e,r),c=this.crossCheckVertical(n,s,2*e[1],a);if(!isNaN(c)){var u=(e[0]+e[1]+e[2])/3;try{for(var d=cI(this.possibleCenters),h=d.next();!h.done;h=d.next()){var f=h.value;if(f.aboutEquals(u,c,s))return f.combineEstimate(c,s,u)}}catch(l){o={error:l}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}var p=new sI(s,c,u);this.possibleCenters.push(p),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(p)}return null},t}(),lI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),dI=function(t){function e(n,r,o,i){var a=t.call(this,n,r)||this;return a.estimatedModuleSize=o,a.count=i,i===void 0&&(a.count=1),a}return lI(e,t),e.prototype.getEstimatedModuleSize=function(){return this.estimatedModuleSize},e.prototype.getCount=function(){return this.count},e.prototype.aboutEquals=function(n,r,o){if(Math.abs(r-this.getY())<=n&&Math.abs(o-this.getX())<=n){var i=Math.abs(n-this.estimatedModuleSize);return i<=1||i<=this.estimatedModuleSize}return!1},e.prototype.combineEstimate=function(n,r,o){var i=this.count+1;return new e((this.count*this.getX()+r)/i,(this.count*this.getY()+n)/i,(this.count*this.estimatedModuleSize+o)/i,i)},e}(Pe),fI=function(){function t(e){this.bottomLeft=e[0],this.topLeft=e[1],this.topRight=e[2]}return t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t}(),ms=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},hI=function(){function t(e,n){this.image=e,this.resultPointCallback=n,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=n}return t.prototype.getImage=function(){return this.image},t.prototype.getPossibleCenters=function(){return this.possibleCenters},t.prototype.find=function(e){var n=e!=null&&e.get(Pt.TRY_HARDER)!==void 0,r=e!=null&&e.get(Pt.PURE_BARCODE)!==void 0,o=this.image,i=o.getHeight(),a=o.getWidth(),s=Math.floor(3*i/(4*t.MAX_MODULES));(s<t.MIN_SKIP||n)&&(s=t.MIN_SKIP);for(var c=!1,u=new Int32Array(5),d=s-1;d<i&&!c;d+=s){u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0;for(var h=0,f=0;f<a;f++)if(o.get(f,d))(1&h)==1&&h++,u[h]++;else if(1&h)u[h]++;else if(h===4)if(t.foundPatternCross(u)){if(this.handlePossibleCenter(u,d,f,r)!==!0){u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,h=3;continue}if(s=2,this.hasSkipped===!0)c=this.haveMultiplyConfirmedCenters();else{var p=this.findRowSkip();p>u[2]&&(d+=p-u[2]-s,f=a-1)}h=0,u[0]=0,u[1]=0,u[2]=0,u[3]=0,u[4]=0}else u[0]=u[2],u[1]=u[3],u[2]=u[4],u[3]=1,u[4]=0,h=3;else u[++h]++;t.foundPatternCross(u)&&this.handlePossibleCenter(u,d,a,r)===!0&&(s=u[0],this.hasSkipped&&(c=this.haveMultiplyConfirmedCenters()))}var l=this.selectBestPatterns();return Pe.orderBestPatterns(l),new fI(l)},t.centerFromEnd=function(e,n){return n-e[4]-e[3]-e[2]/2},t.foundPatternCross=function(e){for(var n=0,r=0;r<5;r++){var o=e[r];if(o===0)return!1;n+=o}if(n<7)return!1;var i=n/7,a=i/2;return Math.abs(i-e[0])<a&&Math.abs(i-e[1])<a&&Math.abs(3*i-e[2])<3*a&&Math.abs(i-e[3])<a&&Math.abs(i-e[4])<a},t.prototype.getCrossCheckStateCount=function(){var e=this.crossCheckStateCount;return e[0]=0,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e},t.prototype.crossCheckDiagonal=function(e,n,r,o){for(var i=this.getCrossCheckStateCount(),a=0,s=this.image;e>=a&&n>=a&&s.get(n-a,e-a);)i[2]++,a++;if(e<a||n<a)return!1;for(;e>=a&&n>=a&&!s.get(n-a,e-a)&&i[1]<=r;)i[1]++,a++;if(e<a||n<a||i[1]>r)return!1;for(;e>=a&&n>=a&&s.get(n-a,e-a)&&i[0]<=r;)i[0]++,a++;if(i[0]>r)return!1;var c=s.getHeight(),u=s.getWidth();for(a=1;e+a<c&&n+a<u&&s.get(n+a,e+a);)i[2]++,a++;if(e+a>=c||n+a>=u)return!1;for(;e+a<c&&n+a<u&&!s.get(n+a,e+a)&&i[3]<r;)i[3]++,a++;if(e+a>=c||n+a>=u||i[3]>=r)return!1;for(;e+a<c&&n+a<u&&s.get(n+a,e+a)&&i[4]<r;)i[4]++,a++;if(i[4]>=r)return!1;var d=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(d-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,n,r,o){for(var i=this.image,a=i.getHeight(),s=this.getCrossCheckStateCount(),c=e;c>=0&&i.get(n,c);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(n,c)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&i.get(n,c)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<a&&i.get(n,c);)s[2]++,c++;if(c===a)return NaN;for(;c<a&&!i.get(n,c)&&s[3]<r;)s[3]++,c++;if(c===a||s[3]>=r)return NaN;for(;c<a&&i.get(n,c)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=2*o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.crossCheckHorizontal=function(e,n,r,o){for(var i=this.image,a=i.getWidth(),s=this.getCrossCheckStateCount(),c=e;c>=0&&i.get(c,n);)s[2]++,c--;if(c<0)return NaN;for(;c>=0&&!i.get(c,n)&&s[1]<=r;)s[1]++,c--;if(c<0||s[1]>r)return NaN;for(;c>=0&&i.get(c,n)&&s[0]<=r;)s[0]++,c--;if(s[0]>r)return NaN;for(c=e+1;c<a&&i.get(c,n);)s[2]++,c++;if(c===a)return NaN;for(;c<a&&!i.get(c,n)&&s[3]<r;)s[3]++,c++;if(c===a||s[3]>=r)return NaN;for(;c<a&&i.get(c,n)&&s[4]<r;)s[4]++,c++;if(s[4]>=r)return NaN;var u=s[0]+s[1]+s[2]+s[3]+s[4];return 5*Math.abs(u-o)>=o?NaN:t.foundPatternCross(s)?t.centerFromEnd(s,c):NaN},t.prototype.handlePossibleCenter=function(e,n,r,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,r),s=this.crossCheckVertical(n,Math.floor(a),e[2],i);if(!isNaN(s)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(s),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(s),Math.floor(a),e[2],i)))){for(var c=i/7,u=!1,d=this.possibleCenters,h=0,f=d.length;h<f;h++){var p=d[h];if(p.aboutEquals(c,s,a)){d[h]=p.combineEstimate(s,a,c),u=!0;break}}if(!u){var l=new dI(a,s,c);d.push(l),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(l)}return!0}return!1},t.prototype.findRowSkip=function(){var e,n;if(this.possibleCenters.length<=1)return 0;var r=null;try{for(var o=ms(this.possibleCenters),i=o.next();!i.done;i=o.next()){var a=i.value;if(a.getCount()>=t.CENTER_QUORUM){if(r!=null)return this.hasSkipped=!0,Math.floor((Math.abs(r.getX()-a.getX())-Math.abs(r.getY()-a.getY()))/2);r=a}}}catch(s){e={error:s}}finally{try{i&&!i.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}return 0},t.prototype.haveMultiplyConfirmedCenters=function(){var e,n,r,o,i=0,a=0,s=this.possibleCenters.length;try{for(var c=ms(this.possibleCenters),u=c.next();!u.done;u=c.next())(l=u.value).getCount()>=t.CENTER_QUORUM&&(i++,a+=l.getEstimatedModuleSize())}catch(g){e={error:g}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}if(i<3)return!1;var d=a/s,h=0;try{for(var f=ms(this.possibleCenters),p=f.next();!p.done;p=f.next()){var l=p.value;h+=Math.abs(l.getEstimatedModuleSize()-d)}}catch(g){r={error:g}}finally{try{p&&!p.done&&(o=f.return)&&o.call(f)}finally{if(r)throw r.error}}return h<=.05*a},t.prototype.selectBestPatterns=function(){var e,n,r,o,i=this.possibleCenters.length;if(i<3)throw new he;var a,s=this.possibleCenters;if(i>3){var c=0,u=0;try{for(var d=ms(this.possibleCenters),h=d.next();!h.done;h=d.next()){var f=h.value.getEstimatedModuleSize();c+=f,u+=f*f}}catch(b){e={error:b}}finally{try{h&&!h.done&&(n=d.return)&&n.call(d)}finally{if(e)throw e.error}}a=c/i;var p=Math.sqrt(u/i-a*a);s.sort(function(b,E){var C=Math.abs(E.getEstimatedModuleSize()-a),I=Math.abs(b.getEstimatedModuleSize()-a);return C<I?-1:C>I?1:0});for(var l=Math.max(.2*a,p),g=0;g<s.length&&s.length>3;g++){var m=s[g];Math.abs(m.getEstimatedModuleSize()-a)>l&&(s.splice(g,1),g--)}}if(s.length>3){c=0;try{for(var y=ms(s),w=y.next();!w.done;w=y.next())c+=w.value.getEstimatedModuleSize()}catch(b){r={error:b}}finally{try{w&&!w.done&&(o=y.return)&&o.call(y)}finally{if(r)throw r.error}}a=c/s.length,s.sort(function(b,E){if(E.getCount()===b.getCount()){var C=Math.abs(E.getEstimatedModuleSize()-a),I=Math.abs(b.getEstimatedModuleSize()-a);return C<I?1:C>I?-1:0}return E.getCount()-b.getCount()}),s.splice(3)}return[s[0],s[1],s[2]]},t.CENTER_QUORUM=2,t.MIN_SKIP=3,t.MAX_MODULES=57,t}(),pI=function(){function t(e){this.image=e}return t.prototype.getImage=function(){return this.image},t.prototype.getResultPointCallback=function(){return this.resultPointCallback},t.prototype.detect=function(e){this.resultPointCallback=e==null?null:e.get(Pt.NEED_RESULT_POINT_CALLBACK);var n=new hI(this.image,this.resultPointCallback).find(e);return this.processFinderPatternInfo(n)},t.prototype.processFinderPatternInfo=function(e){var n=e.getTopLeft(),r=e.getTopRight(),o=e.getBottomLeft(),i=this.calculateModuleSize(n,r,o);if(i<1)throw new he("No pattern found in proccess finder.");var a=t.computeDimension(n,r,o,i),s=vu.getProvisionalVersionForDimension(a),c=s.getDimensionForVersion()-7,u=null;if(s.getAlignmentPatternCenters().length>0)for(var d=r.getX()-n.getX()+o.getX(),h=r.getY()-n.getY()+o.getY(),f=1-3/c,p=Math.floor(n.getX()+f*(d-n.getX())),l=Math.floor(n.getY()+f*(h-n.getY())),g=4;g<=16;g<<=1)try{u=this.findAlignmentInRegion(i,p,l,g);break}catch(w){if(!(w instanceof he))throw w}var m=t.createTransform(n,r,o,u,a),y=t.sampleGrid(this.image,m,a);return new _f(y,u===null?[o,n,r]:[o,n,r,u])},t.createTransform=function(e,n,r,o,i){var a,s,c,u,d=i-3.5;return o!==null?(a=o.getX(),s=o.getY(),u=c=d-3):(a=n.getX()-e.getX()+r.getX(),s=n.getY()-e.getY()+r.getY(),c=d,u=d),g2.quadrilateralToQuadrilateral(3.5,3.5,d,3.5,c,u,3.5,d,e.getX(),e.getY(),n.getX(),n.getY(),a,s,r.getX(),r.getY())},t.sampleGrid=function(e,n,r){return Sf.getInstance().sampleGridWithTransform(e,r,r,n)},t.computeDimension=function(e,n,r,o){var i=ft.round(Pe.distance(e,n)/o),a=ft.round(Pe.distance(e,r)/o),s=Math.floor((i+a)/2)+7;switch(3&s){case 0:s++;break;case 2:s--;break;case 3:throw new he("Dimensions could be not found.")}return s},t.prototype.calculateModuleSize=function(e,n,r){return(this.calculateModuleSizeOneWay(e,n)+this.calculateModuleSizeOneWay(e,r))/2},t.prototype.calculateModuleSizeOneWay=function(e,n){var r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(n.getX()),Math.floor(n.getY())),o=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(e.getX()),Math.floor(e.getY()));return isNaN(r)?o/7:isNaN(o)?r/7:(r+o)/14},t.prototype.sizeOfBlackWhiteBlackRunBothWays=function(e,n,r,o){var i=this.sizeOfBlackWhiteBlackRun(e,n,r,o),a=1,s=e-(r-e);s<0?(a=e/(e-s),s=0):s>=this.image.getWidth()&&(a=(this.image.getWidth()-1-e)/(s-e),s=this.image.getWidth()-1);var c=Math.floor(n-(o-n)*a);return a=1,c<0?(a=n/(n-c),c=0):c>=this.image.getHeight()&&(a=(this.image.getHeight()-1-n)/(c-n),c=this.image.getHeight()-1),s=Math.floor(e+(s-e)*a),(i+=this.sizeOfBlackWhiteBlackRun(e,n,s,c))-1},t.prototype.sizeOfBlackWhiteBlackRun=function(e,n,r,o){var i=Math.abs(o-n)>Math.abs(r-e);if(i){var a=e;e=n,n=a,a=r,r=o,o=a}for(var s=Math.abs(r-e),c=Math.abs(o-n),u=-s/2,d=e<r?1:-1,h=n<o?1:-1,f=0,p=r+d,l=e,g=n;l!==p;l+=d){var m=i?g:l,y=i?l:g;if(f===1===this.image.get(m,y)){if(f===2)return ft.distance(l,g,e,n);f++}if((u+=c)>0){if(g===o)break;g+=h,u-=s}}return f===2?ft.distance(r+d,o,e,n):NaN},t.prototype.findAlignmentInRegion=function(e,n,r,o){var i=Math.floor(o*e),a=Math.max(0,n-i),s=Math.min(this.image.getWidth()-1,n+i);if(s-a<3*e)throw new he("Alignment top exceeds estimated module size.");var c=Math.max(0,r-i),u=Math.min(this.image.getHeight()-1,r+i);if(u-c<3*e)throw new he("Alignment bottom exceeds estimated module size.");return new uI(this.image,a,c,s-a,u-c,e,this.resultPointCallback).find()},t}(),bu=function(){function t(){this.decoder=new iI}return t.prototype.getDecoder=function(){return this.decoder},t.prototype.decode=function(e,n){var r,o;if(n!=null&&n.get(Pt.PURE_BARCODE)!==void 0){var i=t.extractPureBits(e.getBlackMatrix());r=this.decoder.decodeBitMatrix(i,n),o=t.NO_POINTS}else{var a=new pI(e.getBlackMatrix()).detect(n);r=this.decoder.decodeBitMatrix(a.getBits(),n),o=a.getPoints()}r.getOther()instanceof D2&&r.getOther().applyMirroredCorrection(o);var s=new Wn(r.getText(),r.getRawBytes(),void 0,o,Re.QR_CODE,void 0),c=r.getByteSegments();c!==null&&s.putMetadata(Cn.BYTE_SEGMENTS,c);var u=r.getECLevel();return u!==null&&s.putMetadata(Cn.ERROR_CORRECTION_LEVEL,u),r.hasStructuredAppend()&&(s.putMetadata(Cn.STRUCTURED_APPEND_SEQUENCE,r.getStructuredAppendSequenceNumber()),s.putMetadata(Cn.STRUCTURED_APPEND_PARITY,r.getStructuredAppendParity())),s},t.prototype.reset=function(){},t.extractPureBits=function(e){var n=e.getTopLeftOnBit(),r=e.getBottomRightOnBit();if(n===null||r===null)throw new he;var o=this.moduleSize(n,e),i=n[1],a=r[1],s=n[0],c=r[0];if(s>=c||i>=a)throw new he;if(a-i!=c-s&&(c=s+(a-i))>=e.getWidth())throw new he;var u=Math.round((c-s+1)/o),d=Math.round((a-i+1)/o);if(u<=0||d<=0)throw new he;if(d!==u)throw new he;var h=Math.floor(o/2);i+=h;var f=(s+=h)+Math.floor((u-1)*o)-c;if(f>0){if(f>h)throw new he;s-=f}var p=i+Math.floor((d-1)*o)-a;if(p>0){if(p>h)throw new he;i-=p}for(var l=new oo(u,d),g=0;g<d;g++)for(var m=i+Math.floor(g*o),y=0;y<u;y++)e.get(s+Math.floor(y*o),m)&&l.set(y,g);return l},t.moduleSize=function(e,n){for(var r=n.getHeight(),o=n.getWidth(),i=e[0],a=e[1],s=!0,c=0;i<o&&a<r;){if(s!==n.get(i,a)){if(++c==5)break;s=!s}i++,a++}if(i===o||a===r)throw new he;return(i-e[0])/7},t.NO_POINTS=new Array,t}(),gI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},it=function(){function t(){}return t.prototype.PDF417Common=function(){},t.getBitCountSum=function(e){return ft.sum(e)},t.toIntArray=function(e){var n,r;if(e==null||!e.length)return t.EMPTY_INT_ARRAY;var o=new Int32Array(e.length),i=0;try{for(var a=gI(e),s=a.next();!s.done;s=a.next()){var c=s.value;o[i++]=c}}catch(u){n={error:u}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o},t.getCodeword=function(e){var n=or.binarySearch(t.SYMBOL_TABLE,262143&e);return n<0?-1:(t.CODEWORD_TABLE[n]-1)%t.NUMBER_OF_CODEWORDS},t.NUMBER_OF_CODEWORDS=929,t.MAX_CODEWORDS_IN_BARCODE=t.NUMBER_OF_CODEWORDS-1,t.MIN_ROWS_IN_BARCODE=3,t.MAX_ROWS_IN_BARCODE=90,t.MODULES_IN_CODEWORD=17,t.MODULES_IN_STOP_PATTERN=18,t.BARS_IN_MODULE=8,t.EMPTY_INT_ARRAY=new Int32Array([]),t.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),t.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]),t}(),mI=function(){function t(e,n){this.bits=e,this.points=n}return t.prototype.getBits=function(){return this.bits},t.prototype.getPoints=function(){return this.points},t}(),yI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},vI=function(){function t(){}return t.detectMultiple=function(e,n,r){var o=e.getBlackMatrix(),i=t.detect(r,o);return i.length||((o=o.clone()).rotate180(),i=t.detect(r,o)),new mI(o,i)},t.detect=function(e,n){for(var r,o,i=new Array,a=0,s=0,c=!1;a<n.getHeight();){var u=t.findVertices(n,a,s);if(u[0]!=null||u[3]!=null){if(c=!0,i.push(u),!e)break;u[2]!=null?(s=Math.trunc(u[2].getX()),a=Math.trunc(u[2].getY())):(s=Math.trunc(u[4].getX()),a=Math.trunc(u[4].getY()))}else{if(!c)break;c=!1,s=0;try{for(var d=(r=void 0,yI(i)),h=d.next();!h.done;h=d.next()){var f=h.value;f[1]!=null&&(a=Math.trunc(Math.max(a,f[1].getY()))),f[3]!=null&&(a=Math.max(a,Math.trunc(f[3].getY())))}}catch(p){r={error:p}}finally{try{h&&!h.done&&(o=d.return)&&o.call(d)}finally{if(r)throw r.error}}a+=t.ROW_STEP}}return i},t.findVertices=function(e,n,r){var o=e.getHeight(),i=e.getWidth(),a=new Array(8);return t.copyToResult(a,t.findRowsWithPattern(e,o,i,n,r,t.START_PATTERN),t.INDEXES_START_PATTERN),a[4]!=null&&(r=Math.trunc(a[4].getX()),n=Math.trunc(a[4].getY())),t.copyToResult(a,t.findRowsWithPattern(e,o,i,n,r,t.STOP_PATTERN),t.INDEXES_STOP_PATTERN),a},t.copyToResult=function(e,n,r){for(var o=0;o<r.length;o++)e[r[o]]=n[o]},t.findRowsWithPattern=function(e,n,r,o,i,a){for(var s=new Array(4),c=!1,u=new Int32Array(a.length);o<n;o+=t.ROW_STEP)if((p=t.findGuardPattern(e,i,o,r,!1,a,u))!=null){for(;o>0;){if((f=t.findGuardPattern(e,i,--o,r,!1,a,u))==null){o++;break}p=f}s[0]=new Pe(p[0],o),s[1]=new Pe(p[1],o),c=!0;break}var d=o+1;if(c){for(var h=0,f=Int32Array.from([Math.trunc(s[0].getX()),Math.trunc(s[1].getX())]);d<n;d++){var p;if((p=t.findGuardPattern(e,f[0],d,r,!1,a,u))!=null&&Math.abs(f[0]-p[0])<t.MAX_PATTERN_DRIFT&&Math.abs(f[1]-p[1])<t.MAX_PATTERN_DRIFT)f=p,h=0;else{if(h>t.SKIPPED_ROW_COUNT_MAX)break;h++}}d-=h+1,s[2]=new Pe(f[0],d),s[3]=new Pe(f[1],d)}return d-o<t.BARCODE_MIN_HEIGHT&&or.fill(s,null),s},t.findGuardPattern=function(e,n,r,o,i,a,s){or.fillWithin(s,0,s.length,0);for(var c=n,u=0;e.get(c,r)&&c>0&&u++<t.MAX_PIXEL_DRIFT;)c--;for(var d=c,h=0,f=a.length,p=i;d<o;d++)if(e.get(d,r)!==p)s[h]++;else{if(h===f-1){if(t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE)return new Int32Array([c,d]);c+=s[0]+s[1],Nt.arraycopy(s,2,s,0,h-1),s[h-1]=0,s[h]=0,h--}else h++;s[h]=1,p=!p}return h===f-1&&t.patternMatchVariance(s,a,t.MAX_INDIVIDUAL_VARIANCE)<t.MAX_AVG_VARIANCE?new Int32Array([c,d-1]):null},t.patternMatchVariance=function(e,n,r){for(var o=e.length,i=0,a=0,s=0;s<o;s++)i+=e[s],a+=n[s];if(i<a)return 1/0;var c=i/a;r*=c;for(var u=0,d=0;d<o;d++){var h=e[d],f=n[d]*c,p=h>f?h-f:f-h;if(p>r)return 1/0;u+=p}return u/i},t.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),t.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),t.MAX_AVG_VARIANCE=.42,t.MAX_INDIVIDUAL_VARIANCE=.8,t.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),t.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),t.MAX_PIXEL_DRIFT=3,t.MAX_PATTERN_DRIFT=5,t.SKIPPED_ROW_COUNT_MAX=25,t.ROW_STEP=5,t.BARCODE_MIN_HEIGHT=10,t}(),wI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},fi=function(){function t(e,n){if(n.length===0)throw new Ve;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var o=1;o<r&&n[o]===0;)o++;o===r?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(r-o),Nt.arraycopy(n,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){var n,r;if(e===0)return this.getCoefficient(0);if(e===1){var o=0;try{for(var i=wI(this.coefficients),a=i.next();!a.done;a=i.next()){var s=a.value;o=this.field.add(o,s)}}catch(h){n={error:h}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o}for(var c=this.coefficients[0],u=this.coefficients.length,d=1;d<u;d++)c=this.field.add(this.field.multiply(e,c),this.coefficients[d]);return c},t.prototype.add=function(e){if(!this.field.equals(e.field))throw new Ve("ModulusPolys do not have same ModulusGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;Nt.arraycopy(r,0,i,0,a);for(var s=a;s<r.length;s++)i[s]=this.field.add(n[s-a],r[s]);return new t(this.field,i)},t.prototype.subtract=function(e){if(!this.field.equals(e.field))throw new Ve("ModulusPolys do not have same ModulusGF field");return e.isZero()?this:this.add(e.negative())},t.prototype.multiply=function(e){return e instanceof t?this.multiplyOther(e):this.multiplyScalar(e)},t.prototype.multiplyOther=function(e){if(!this.field.equals(e.field))throw new Ve("ModulusPolys do not have same ModulusGF field");if(this.isZero()||e.isZero())return new t(this.field,new Int32Array([0]));for(var n=this.coefficients,r=n.length,o=e.coefficients,i=o.length,a=new Int32Array(r+i-1),s=0;s<r;s++)for(var c=n[s],u=0;u<i;u++)a[s+u]=this.field.add(a[s+u],this.field.multiply(c,o[u]));return new t(this.field,a)},t.prototype.negative=function(){for(var e=this.coefficients.length,n=new Int32Array(e),r=0;r<e;r++)n[r]=this.field.subtract(0,this.coefficients[r]);return new t(this.field,n)},t.prototype.multiplyScalar=function(e){if(e===0)return new t(this.field,new Int32Array([0]));if(e===1)return this;for(var n=this.coefficients.length,r=new Int32Array(n),o=0;o<n;o++)r[o]=this.field.multiply(this.coefficients[o],e);return new t(this.field,r)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Ve;if(n===0)return new t(this.field,new Int32Array([0]));for(var r=this.coefficients.length,o=new Int32Array(r+e),i=0;i<r;i++)o[i]=this.field.multiply(this.coefficients[i],n);return new t(this.field,o)},t.prototype.toString=function(){for(var e=new xt,n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);r!==0&&(r<0?(e.append(" - "),r=-r):e.length()>0&&e.append(" + "),n!==0&&r===1||e.append(r),n!==0&&(n===1?e.append("x"):(e.append("x^"),e.append(n))))}return e.toString()},t}(),bI=function(){function t(){}return t.prototype.add=function(e,n){return(e+n)%this.modulus},t.prototype.subtract=function(e,n){return(this.modulus+e-n)%this.modulus},t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Ve;return this.logTable[e]},t.prototype.inverse=function(e){if(e===0)throw new f2;return this.expTable[this.modulus-this.logTable[e]-1]},t.prototype.multiply=function(e,n){return e===0||n===0?0:this.expTable[(this.logTable[e]+this.logTable[n])%(this.modulus-1)]},t.prototype.getSize=function(){return this.modulus},t.prototype.equals=function(e){return e===this},t}(),EI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),CI=function(t){function e(n,r){var o=t.call(this)||this;o.modulus=n,o.expTable=new Int32Array(n),o.logTable=new Int32Array(n);for(var i=1,a=0;a<n;a++)o.expTable[a]=i,i=i*r%n;for(a=0;a<n-1;a++)o.logTable[o.expTable[a]]=a;return o.zero=new fi(o,new Int32Array([0])),o.one=new fi(o,new Int32Array([1])),o}return EI(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Ve;if(r===0)return this.zero;var o=new Int32Array(n+1);return o[0]=r,new fi(this,o)},e.PDF417_GF=new e(it.NUMBER_OF_CODEWORDS,3),e}(bI),_I=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},AI=function(){function t(){this.field=CI.PDF417_GF}return t.prototype.decode=function(e,n,r){for(var o,i,a=new fi(this.field,e),s=new Int32Array(n),c=!1,u=n;u>0;u--){var d=a.evaluateAt(this.field.exp(u));s[n-u]=d,d!==0&&(c=!0)}if(!c)return 0;var h=this.field.getOne();if(r!=null)try{for(var f=_I(r),p=f.next();!p.done;p=f.next()){var l=p.value,g=this.field.exp(e.length-1-l),m=new fi(this.field,new Int32Array([this.field.subtract(0,g),1]));h=h.multiply(m)}}catch(P){o={error:P}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}var y=new fi(this.field,s),w=this.runEuclideanAlgorithm(this.field.buildMonomial(n,1),y,n),b=w[0],E=w[1],C=this.findErrorLocations(b),I=this.findErrorMagnitudes(E,b,C);for(u=0;u<C.length;u++){var T=e.length-1-this.field.log(C[u]);if(T<0)throw sn.getChecksumInstance();e[T]=this.field.subtract(e[T],I[u])}return C.length},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var o=e;e=n,n=o}for(var i=e,a=n,s=this.field.getZero(),c=this.field.getOne();a.getDegree()>=Math.round(r/2);){var u=i,d=s;if(s=c,(i=a).isZero())throw sn.getChecksumInstance();a=u;for(var h=this.field.getZero(),f=i.getCoefficient(i.getDegree()),p=this.field.inverse(f);a.getDegree()>=i.getDegree()&&!a.isZero();){var l=a.getDegree()-i.getDegree(),g=this.field.multiply(a.getCoefficient(a.getDegree()),p);h=h.add(this.field.buildMonomial(l,g)),a=a.subtract(i.multiplyByMonomial(l,g))}c=h.multiply(s).subtract(d).negative()}var m=c.getCoefficient(0);if(m===0)throw sn.getChecksumInstance();var y=this.field.inverse(m);return[c.multiply(y),a.multiply(y)]},t.prototype.findErrorLocations=function(e){for(var n=e.getDegree(),r=new Int32Array(n),o=0,i=1;i<this.field.getSize()&&o<n;i++)e.evaluateAt(i)===0&&(r[o]=this.field.inverse(i),o++);if(o!==n)throw sn.getChecksumInstance();return r},t.prototype.findErrorMagnitudes=function(e,n,r){for(var o=n.getDegree(),i=new Int32Array(o),a=1;a<=o;a++)i[o-a]=this.field.multiply(a,n.getCoefficient(a));var s=new fi(this.field,i),c=r.length,u=new Int32Array(c);for(a=0;a<c;a++){var d=this.field.inverse(r[a]),h=this.field.subtract(0,e.evaluateAt(d)),f=this.field.inverse(s.evaluateAt(d));u[a]=this.field.multiply(h,f)}return u},t}(),kf=function(){function t(e,n,r,o,i){e instanceof t?this.constructor_2(e):this.constructor_1(e,n,r,o,i)}return t.prototype.constructor_1=function(e,n,r,o,i){var a=n==null||r==null,s=o==null||i==null;if(a&&s)throw new he;a?(n=new Pe(0,o.getY()),r=new Pe(0,i.getY())):s&&(o=new Pe(e.getWidth()-1,n.getY()),i=new Pe(e.getWidth()-1,r.getY())),this.image=e,this.topLeft=n,this.bottomLeft=r,this.topRight=o,this.bottomRight=i,this.minX=Math.trunc(Math.min(n.getX(),r.getX())),this.maxX=Math.trunc(Math.max(o.getX(),i.getX())),this.minY=Math.trunc(Math.min(n.getY(),o.getY())),this.maxY=Math.trunc(Math.max(r.getY(),i.getY()))},t.prototype.constructor_2=function(e){this.image=e.image,this.topLeft=e.getTopLeft(),this.bottomLeft=e.getBottomLeft(),this.topRight=e.getTopRight(),this.bottomRight=e.getBottomRight(),this.minX=e.getMinX(),this.maxX=e.getMaxX(),this.minY=e.getMinY(),this.maxY=e.getMaxY()},t.merge=function(e,n){return e==null?n:n==null?e:new t(e.image,e.topLeft,e.bottomLeft,n.topRight,n.bottomRight)},t.prototype.addMissingRows=function(e,n,r){var o=this.topLeft,i=this.bottomLeft,a=this.topRight,s=this.bottomRight;if(e>0){var c=r?this.topLeft:this.topRight,u=Math.trunc(c.getY()-e);u<0&&(u=0);var d=new Pe(c.getX(),u);r?o=d:a=d}if(n>0){var h=r?this.bottomLeft:this.bottomRight,f=Math.trunc(h.getY()+n);f>=this.image.getHeight()&&(f=this.image.getHeight()-1);var p=new Pe(h.getX(),f);r?i=p:s=p}return new t(this.image,o,i,a,s)},t.prototype.getMinX=function(){return this.minX},t.prototype.getMaxX=function(){return this.maxX},t.prototype.getMinY=function(){return this.minY},t.prototype.getMaxY=function(){return this.maxY},t.prototype.getTopLeft=function(){return this.topLeft},t.prototype.getTopRight=function(){return this.topRight},t.prototype.getBottomLeft=function(){return this.bottomLeft},t.prototype.getBottomRight=function(){return this.bottomRight},t}(),SI=function(){function t(e,n,r,o){this.columnCount=e,this.errorCorrectionLevel=o,this.rowCountUpperPart=n,this.rowCountLowerPart=r,this.rowCount=n+r}return t.prototype.getColumnCount=function(){return this.columnCount},t.prototype.getErrorCorrectionLevel=function(){return this.errorCorrectionLevel},t.prototype.getRowCount=function(){return this.rowCount},t.prototype.getRowCountUpperPart=function(){return this.rowCountUpperPart},t.prototype.getRowCountLowerPart=function(){return this.rowCountLowerPart},t}(),Bf=function(){function t(){this.buffer=""}return t.form=function(e,n){var r=-1;return e.replace(/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g,function(o,i,a,s,c,u){if(o==="%%")return"%";if(n[++r]!==void 0){o=s?parseInt(s.substr(1)):void 0;var d,h=c?parseInt(c.substr(1)):void 0;switch(u){case"s":d=n[r];break;case"c":d=n[r][0];break;case"f":d=parseFloat(n[r]).toFixed(o);break;case"p":d=parseFloat(n[r]).toPrecision(o);break;case"e":d=parseFloat(n[r]).toExponential(o);break;case"x":d=parseInt(n[r]).toString(h||16);break;case"d":d=parseFloat(parseInt(n[r],h||10).toPrecision(o)).toFixed(0)}d=typeof d=="object"?JSON.stringify(d):(+d).toString(h);for(var f=parseInt(a),p=a&&a[0]+""=="0"?"0":" ";d.length<f;)d=i!==void 0?d+p:p+d;return d}})},t.prototype.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];this.buffer+=t.form(e,n)},t.prototype.toString=function(){return this.buffer},t}(),II=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},L2=function(){function t(e){this.boundingBox=new kf(e),this.codewords=new Array(e.getMaxY()-e.getMinY()+1)}return t.prototype.getCodewordNearby=function(e){var n=this.getCodeword(e);if(n!=null)return n;for(var r=1;r<t.MAX_NEARBY_DISTANCE;r++){var o=this.imageRowToCodewordIndex(e)-r;if(o>=0&&(n=this.codewords[o])!=null||(o=this.imageRowToCodewordIndex(e)+r)<this.codewords.length&&(n=this.codewords[o])!=null)return n}return null},t.prototype.imageRowToCodewordIndex=function(e){return e-this.boundingBox.getMinY()},t.prototype.setCodeword=function(e,n){this.codewords[this.imageRowToCodewordIndex(e)]=n},t.prototype.getCodeword=function(e){return this.codewords[this.imageRowToCodewordIndex(e)]},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.getCodewords=function(){return this.codewords},t.prototype.toString=function(){var e,n,r=new Bf,o=0;try{for(var i=II(this.codewords),a=i.next();!a.done;a=i.next()){var s=a.value;s!=null?r.format("%3d: %3d|%3d%n",o++,s.getRowNumber(),s.getValue()):r.format("%3d: | %n",o++)}}catch(c){e={error:c}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(e)throw e.error}}return r.toString()},t.MAX_NEARBY_DISTANCE=5,t}(),TI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},xI=function(t,e){var n=typeof Symbol=="function"&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),a=[];try{for(;(e===void 0||e-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(s){o={error:s}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},ys=function(){function t(){this.values=new Map}return t.prototype.setValue=function(e){e=Math.trunc(e);var n=this.values.get(e);n==null&&(n=0),n++,this.values.set(e,n)},t.prototype.getValue=function(){var e,n,r=-1,o=new Array,i=function(u,d){var h=function(){return u},f=function(){return d};f()>r?(r=f(),(o=[]).push(h())):f()===r&&o.push(h())};try{for(var a=TI(this.values.entries()),s=a.next();!s.done;s=a.next()){var c=xI(s.value,2);i(c[0],c[1])}}catch(u){e={error:u}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}return it.toIntArray(o)},t.prototype.getConfidence=function(e){return this.values.get(e)},t}(),OI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Nf=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},F2=function(t){function e(n,r){var o=t.call(this,n)||this;return o._isLeft=r,o}return OI(e,t),e.prototype.setRowNumbers=function(){var n,r;try{for(var o=Nf(this.getCodewords()),i=o.next();!i.done;i=o.next()){var a=i.value;a!=null&&a.setRowNumberAsRowIndicatorColumn()}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},e.prototype.adjustCompleteIndicatorColumnRowNumbers=function(n){var r=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(r,n);for(var o=this.getBoundingBox(),i=this._isLeft?o.getTopLeft():o.getTopRight(),a=this._isLeft?o.getBottomLeft():o.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),c=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=-1,d=1,h=0,f=s;f<c;f++)if(r[f]!=null){var p=r[f],l=p.getRowNumber()-u;if(l===0)h++;else if(l===1)d=Math.max(d,h),h=1,u=p.getRowNumber();else if(l<0||p.getRowNumber()>=n.getRowCount()||l>f)r[f]=null;else{for(var g=void 0,m=(g=d>2?(d-2)*l:l)>=f,y=1;y<=g&&!m;y++)m=r[f-y]!=null;m?r[f]=null:(u=p.getRowNumber(),h=1)}}},e.prototype.getRowHeights=function(){var n,r,o=this.getBarcodeMetadata();if(o==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(o);var i=new Int32Array(o.getRowCount());try{for(var a=Nf(this.getCodewords()),s=a.next();!s.done;s=a.next()){var c=s.value;if(c!=null){var u=c.getRowNumber();if(u>=i.length)continue;i[u]++}}}catch(d){n={error:d}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return i},e.prototype.adjustIncompleteIndicatorColumnRowNumbers=function(n){for(var r=this.getBoundingBox(),o=this._isLeft?r.getTopLeft():r.getTopRight(),i=this._isLeft?r.getBottomLeft():r.getBottomRight(),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=this.imageRowToCodewordIndex(Math.trunc(i.getY())),c=this.getCodewords(),u=-1,d=a;d<s;d++)if(c[d]!=null){var h=c[d];h.setRowNumberAsRowIndicatorColumn();var f=h.getRowNumber()-u;f===0||(f===1?u=h.getRowNumber():h.getRowNumber()>=n.getRowCount()?c[d]=null:u=h.getRowNumber())}},e.prototype.getBarcodeMetadata=function(){var n,r,o=this.getCodewords(),i=new ys,a=new ys,s=new ys,c=new ys;try{for(var u=Nf(o),d=u.next();!d.done;d=u.next()){var h=d.value;if(h!=null){h.setRowNumberAsRowIndicatorColumn();var f=h.getValue()%30,p=h.getRowNumber();switch(this._isLeft||(p+=2),p%3){case 0:a.setValue(3*f+1);break;case 1:c.setValue(f/3),s.setValue(f%3);break;case 2:i.setValue(f+1)}}}}catch(g){n={error:g}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}if(i.getValue().length===0||a.getValue().length===0||s.getValue().length===0||c.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+s.getValue()[0]<it.MIN_ROWS_IN_BARCODE||a.getValue()[0]+s.getValue()[0]>it.MAX_ROWS_IN_BARCODE)return null;var l=new SI(i.getValue()[0],a.getValue()[0],s.getValue()[0],c.getValue()[0]);return this.removeIncorrectCodewords(o,l),l},e.prototype.removeIncorrectCodewords=function(n,r){for(var o=0;o<n.length;o++){var i=n[o];if(n[o]!=null){var a=i.getValue()%30,s=i.getRowNumber();if(s>r.getRowCount())n[o]=null;else switch(this._isLeft||(s+=2),s%3){case 0:3*a+1!==r.getRowCountUpperPart()&&(n[o]=null);break;case 1:Math.trunc(a/3)===r.getErrorCorrectionLevel()&&a%3===r.getRowCountLowerPart()||(n[o]=null);break;case 2:a+1!==r.getColumnCount()&&(n[o]=null)}}}},e.prototype.isLeft=function(){return this._isLeft},e.prototype.toString=function(){return"IsLeft: "+this._isLeft+`
142
+ `+t.prototype.toString.call(this)},e}(L2),PI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},kI=function(){function t(e,n){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=n,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}return t.prototype.getDetectionResultColumns=function(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);var e,n=it.MAX_CODEWORDS_IN_BARCODE;do e=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n<e);return this.detectionResultColumns},t.prototype.adjustIndicatorColumnRowNumbers=function(e){e!=null&&e.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)},t.prototype.adjustRowNumbersAndGetCount=function(){var e=this.adjustRowNumbersByRow();if(e===0)return 0;for(var n=1;n<this.barcodeColumnCount+1;n++)for(var r=this.detectionResultColumns[n].getCodewords(),o=0;o<r.length;o++)r[o]!=null&&(r[o].hasValidRowNumber()||this.adjustRowNumbers(n,o,r));return e},t.prototype.adjustRowNumbersByRow=function(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()},t.prototype.adjustRowNumbersFromBothRI=function(){if(this.detectionResultColumns[0]!=null&&this.detectionResultColumns[this.barcodeColumnCount+1]!=null){for(var e=this.detectionResultColumns[0].getCodewords(),n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<e.length;r++)if(e[r]!=null&&n[r]!=null&&e[r].getRowNumber()===n[r].getRowNumber())for(var o=1;o<=this.barcodeColumnCount;o++){var i=this.detectionResultColumns[o].getCodewords()[r];i!=null&&(i.setRowNumber(e[r].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[o].getCodewords()[r]=null))}}},t.prototype.adjustRowNumbersFromRRI=function(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;for(var e=0,n=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var o=n[r].getRowNumber(),i=0,a=this.barcodeColumnCount+1;a>0&&i<this.ADJUST_ROW_NUMBER_SKIP;a--){var s=this.detectionResultColumns[a].getCodewords()[r];s!=null&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.prototype.adjustRowNumbersFromLRI=function(){if(this.detectionResultColumns[0]==null)return 0;for(var e=0,n=this.detectionResultColumns[0].getCodewords(),r=0;r<n.length;r++)if(n[r]!=null)for(var o=n[r].getRowNumber(),i=0,a=1;a<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;a++){var s=this.detectionResultColumns[a].getCodewords()[r];s!=null&&(i=t.adjustRowNumberIfValid(o,i,s),s.hasValidRowNumber()||e++)}return e},t.adjustRowNumberIfValid=function(e,n,r){return r==null||r.hasValidRowNumber()||(r.isValidRowNumber(e)?(r.setRowNumber(e),n=0):++n),n},t.prototype.adjustRowNumbers=function(e,n,r){var o,i,a=r[n],s=this.detectionResultColumns[e-1].getCodewords(),c=s;this.detectionResultColumns[e+1]!=null&&(c=this.detectionResultColumns[e+1].getCodewords());var u=new Array(14);u[2]=s[n],u[3]=c[n],n>0&&(u[0]=r[n-1],u[4]=s[n-1],u[5]=c[n-1]),n>1&&(u[8]=r[n-2],u[10]=s[n-2],u[11]=c[n-2]),n<r.length-1&&(u[1]=r[n+1],u[6]=s[n+1],u[7]=c[n+1]),n<r.length-2&&(u[9]=r[n+2],u[12]=s[n+2],u[13]=c[n+2]);try{for(var d=PI(u),h=d.next();!h.done;h=d.next()){var f=h.value;if(t.adjustRowNumber(a,f))return}}catch(p){o={error:p}}finally{try{h&&!h.done&&(i=d.return)&&i.call(d)}finally{if(o)throw o.error}}},t.adjustRowNumber=function(e,n){return n!=null&&!(!n.hasValidRowNumber()||n.getBucket()!==e.getBucket())&&(e.setRowNumber(n.getRowNumber()),!0)},t.prototype.getBarcodeColumnCount=function(){return this.barcodeColumnCount},t.prototype.getBarcodeRowCount=function(){return this.barcodeMetadata.getRowCount()},t.prototype.getBarcodeECLevel=function(){return this.barcodeMetadata.getErrorCorrectionLevel()},t.prototype.setBoundingBox=function(e){this.boundingBox=e},t.prototype.getBoundingBox=function(){return this.boundingBox},t.prototype.setDetectionResultColumn=function(e,n){this.detectionResultColumns[e]=n},t.prototype.getDetectionResultColumn=function(e){return this.detectionResultColumns[e]},t.prototype.toString=function(){var e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);for(var n=new Bf,r=0;r<e.getCodewords().length;r++){n.format("CW %3d:",r);for(var o=0;o<this.barcodeColumnCount+2;o++)if(this.detectionResultColumns[o]!=null){var i=this.detectionResultColumns[o].getCodewords()[r];i!=null?n.format(" %3d|%3d",i.getRowNumber(),i.getValue()):n.format(" | ")}else n.format(" | ");n.format("%n")}return n.toString()},t}(),BI=function(){function t(e,n,r,o){this.rowNumber=t.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(e),this.endX=Math.trunc(n),this.bucket=Math.trunc(r),this.value=Math.trunc(o)}return t.prototype.hasValidRowNumber=function(){return this.isValidRowNumber(this.rowNumber)},t.prototype.isValidRowNumber=function(e){return e!==t.BARCODE_ROW_UNKNOWN&&this.bucket===e%3*3},t.prototype.setRowNumberAsRowIndicatorColumn=function(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))},t.prototype.getWidth=function(){return this.endX-this.startX},t.prototype.getStartX=function(){return this.startX},t.prototype.getEndX=function(){return this.endX},t.prototype.getBucket=function(){return this.bucket},t.prototype.getValue=function(){return this.value},t.prototype.getRowNumber=function(){return this.rowNumber},t.prototype.setRowNumber=function(e){this.rowNumber=e},t.prototype.toString=function(){return this.rowNumber+"|"+this.value},t.BARCODE_ROW_UNKNOWN=-1,t}(),NI=function(){function t(){}return t.initialize=function(){for(var e=0;e<it.SYMBOL_TABLE.length;e++)for(var n=it.SYMBOL_TABLE[e],r=1&n,o=0;o<it.BARS_IN_MODULE;o++){for(var i=0;(1&n)===r;)i+=1,n>>=1;r=1&n,t.RATIOS_TABLE[e]||(t.RATIOS_TABLE[e]=new Array(it.BARS_IN_MODULE)),t.RATIOS_TABLE[e][it.BARS_IN_MODULE-o-1]=Math.fround(i/it.MODULES_IN_CODEWORD)}this.bSymbolTableReady=!0},t.getDecodedValue=function(e){var n=t.getDecodedCodewordValue(t.sampleBitCounts(e));return n!==-1?n:t.getClosestDecodedValue(e)},t.sampleBitCounts=function(e){for(var n=ft.sum(e),r=new Int32Array(it.BARS_IN_MODULE),o=0,i=0,a=0;a<it.MODULES_IN_CODEWORD;a++){var s=n/(2*it.MODULES_IN_CODEWORD)+a*n/it.MODULES_IN_CODEWORD;i+e[o]<=s&&(i+=e[o],o++),r[o]++}return r},t.getDecodedCodewordValue=function(e){var n=t.getBitValue(e);return it.getCodeword(n)===-1?-1:n},t.getBitValue=function(e){for(var n=0,r=0;r<e.length;r++)for(var o=0;o<e[r];o++)n=n<<1|(r%2==0?1:0);return Math.trunc(n)},t.getClosestDecodedValue=function(e){var n=ft.sum(e),r=new Array(it.BARS_IN_MODULE);if(n>1)for(var o=0;o<r.length;o++)r[o]=Math.fround(e[o]/n);var i=Cf.MAX_VALUE,a=-1;this.bSymbolTableReady||t.initialize();for(var s=0;s<t.RATIOS_TABLE.length;s++){for(var c=0,u=t.RATIOS_TABLE[s],d=0;d<it.BARS_IN_MODULE;d++){var h=Math.fround(u[d]-r[d]);if((c+=Math.fround(h*h))>=i)break}c<i&&(i=c,a=it.SYMBOL_TABLE[s])}return a},t.bSymbolTableReady=!1,t.RATIOS_TABLE=new Array(it.SYMBOL_TABLE.length).map(function(e){return new Array(it.BARS_IN_MODULE)}),t}(),RI=function(){function t(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}return t.prototype.getSegmentIndex=function(){return this.segmentIndex},t.prototype.setSegmentIndex=function(e){this.segmentIndex=e},t.prototype.getFileId=function(){return this.fileId},t.prototype.setFileId=function(e){this.fileId=e},t.prototype.getOptionalData=function(){return this.optionalData},t.prototype.setOptionalData=function(e){this.optionalData=e},t.prototype.isLastSegment=function(){return this.lastSegment},t.prototype.setLastSegment=function(e){this.lastSegment=e},t.prototype.getSegmentCount=function(){return this.segmentCount},t.prototype.setSegmentCount=function(e){this.segmentCount=e},t.prototype.getSender=function(){return this.sender||null},t.prototype.setSender=function(e){this.sender=e},t.prototype.getAddressee=function(){return this.addressee||null},t.prototype.setAddressee=function(e){this.addressee=e},t.prototype.getFileName=function(){return this.fileName},t.prototype.setFileName=function(e){this.fileName=e},t.prototype.getFileSize=function(){return this.fileSize},t.prototype.setFileSize=function(e){this.fileSize=e},t.prototype.getChecksum=function(){return this.checksum},t.prototype.setChecksum=function(e){this.checksum=e},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.setTimestamp=function(e){this.timestamp=e},t}(),j2=function(){function t(){}return t.parseLong=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t}(),DI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),MI=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return DI(e,t),e.kind="NullPointerException",e}($n),LI=function(){function t(){}return t.prototype.writeBytes=function(e){this.writeBytesOffset(e,0,e.length)},t.prototype.writeBytesOffset=function(e,n,r){if(e==null)throw new MI;if(n<0||n>e.length||r<0||n+r>e.length||n+r<0)throw new wf;if(r!==0)for(var o=0;o<r;o++)this.write(e[n+o])},t.prototype.flush=function(){},t.prototype.close=function(){},t}(),FI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),jI=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return FI(e,t),e}($n),VI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),UI=function(t){function e(n){n===void 0&&(n=32);var r=t.call(this)||this;if(r.count=0,n<0)throw new Ve("Negative initial size: "+n);return r.buf=new Uint8Array(n),r}return VI(e,t),e.prototype.ensureCapacity=function(n){n-this.buf.length>0&&this.grow(n)},e.prototype.grow=function(n){var r=this.buf.length<<1;if(r-n<0&&(r=n),r<0){if(n<0)throw new jI;r=bn.MAX_VALUE}this.buf=or.copyOfUint8Array(this.buf,r)},e.prototype.write=function(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1},e.prototype.writeBytesOffset=function(n,r,o){if(r<0||r>n.length||o<0||r+o-n.length>0)throw new wf;this.ensureCapacity(this.count+o),Nt.arraycopy(n,r,this.buf,this.count,o),this.count+=o},e.prototype.writeTo=function(n){n.writeBytesOffset(this.buf,0,this.count)},e.prototype.reset=function(){this.count=0},e.prototype.toByteArray=function(){return or.copyOfUint8Array(this.buf,this.count)},e.prototype.size=function(){return this.count},e.prototype.toString=function(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()},e.prototype.toString_void=function(){return new String(this.buf).toString()},e.prototype.toString_string=function(n){return new String(this.buf).toString()},e.prototype.toString_number=function(n){return new String(this.buf).toString()},e.prototype.close=function(){},e}(LI);function V2(){if(typeof window<"u")return window.BigInt||null;if(typeof global<"u")return global.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}function jo(t){if(wu===void 0&&(wu=V2()),wu===null)throw new Error("BigInt is not supported!");return wu(t)}(function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(St||(St={}));var GI=function(){function t(){}return t.decode=function(e,n){var r=new xt(""),o=Yn.ISO8859_1;r.enableDecoding(o);for(var i=1,a=e[i++],s=new RI;i<e[0];){switch(a){case t.TEXT_COMPACTION_MODE_LATCH:i=t.textCompaction(e,i,r);break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:i=t.byteCompaction(a,e,o,i,r);break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[i++]);break;case t.NUMERIC_COMPACTION_MODE_LATCH:i=t.numericCompaction(e,i,r);break;case t.ECI_CHARSET:Yn.getCharacterSetECIByValue(e[i++]);break;case t.ECI_GENERAL_PURPOSE:i+=2;break;case t.ECI_USER_DEFINED:i++;break;case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=t.decodeMacroBlock(e,i,s);break;case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:throw new Se;default:i--,i=t.textCompaction(e,i,r)}if(!(i<e.length))throw Se.getFormatInstance();a=e[i++]}if(r.length()===0)throw Se.getFormatInstance();var c=new cu(null,r.toString(),null,n);return c.setOther(s),c},t.decodeMacroBlock=function(e,n,r){if(n+t.NUMBER_OF_SEQUENCE_CODEWORDS>e[0])throw Se.getFormatInstance();for(var o=new Int32Array(t.NUMBER_OF_SEQUENCE_CODEWORDS),i=0;i<t.NUMBER_OF_SEQUENCE_CODEWORDS;i++,n++)o[i]=e[n];r.setSegmentIndex(bn.parseInt(t.decodeBase900toBase10(o,t.NUMBER_OF_SEQUENCE_CODEWORDS)));var a=new xt;n=t.textCompaction(e,n,a),r.setFileId(a.toString());var s=-1;for(e[n]===t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=n+1);n<e[0];)switch(e[n]){case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e[++n]){case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:var c=new xt;n=t.textCompaction(e,n+1,c),r.setFileName(c.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SENDER:var u=new xt;n=t.textCompaction(e,n+1,u),r.setSender(u.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:var d=new xt;n=t.textCompaction(e,n+1,d),r.setAddressee(d.toString());break;case t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:var h=new xt;n=t.numericCompaction(e,n+1,h),r.setSegmentCount(bn.parseInt(h.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:var f=new xt;n=t.numericCompaction(e,n+1,f),r.setTimestamp(j2.parseLong(f.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:var p=new xt;n=t.numericCompaction(e,n+1,p),r.setChecksum(bn.parseInt(p.toString()));break;case t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:var l=new xt;n=t.numericCompaction(e,n+1,l),r.setFileSize(j2.parseLong(l.toString()));break;default:throw Se.getFormatInstance()}break;case t.MACRO_PDF417_TERMINATOR:n++,r.setLastSegment(!0);break;default:throw Se.getFormatInstance()}if(s!==-1){var g=n-s;r.isLastSegment()&&g--,r.setOptionalData(or.copyOfRange(e,s,s+g))}return n},t.textCompaction=function(e,n,r){for(var o=new Int32Array(2*(e[0]-n)),i=new Int32Array(2*(e[0]-n)),a=0,s=!1;n<e[0]&&!s;){var c=e[n++];if(c<t.TEXT_COMPACTION_MODE_LATCH)o[a]=c/30,o[a+1]=c%30,a+=2;else switch(c){case t.TEXT_COMPACTION_MODE_LATCH:o[a++]=t.TEXT_COMPACTION_MODE_LATCH;break;case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,s=!0;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o[a]=t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,c=e[n++],i[a]=c,a++}}return t.decodeTextCompaction(o,i,a,r),n},t.decodeTextCompaction=function(e,n,r,o){for(var i=St.ALPHA,a=St.ALPHA,s=0;s<r;){var c=e[s],u="";switch(i){case St.ALPHA:if(c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case t.LL:i=St.LOWER;break;case t.ML:i=St.MIXED;break;case t.PS:a=i,i=St.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.LOWER:if(c<26)u=String.fromCharCode(97+c);else switch(c){case 26:u=" ";break;case t.AS:a=i,i=St.ALPHA_SHIFT;break;case t.ML:i=St.MIXED;break;case t.PS:a=i,i=St.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.MIXED:if(c<t.PL)u=t.MIXED_CHARS[c];else switch(c){case t.PL:i=St.PUNCT;break;case 26:u=" ";break;case t.LL:i=St.LOWER;break;case t.AL:i=St.ALPHA;break;case t.PS:a=i,i=St.PUNCT_SHIFT;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.PUNCT:if(c<t.PAL)u=t.PUNCT_CHARS[c];else switch(c){case t.PAL:i=St.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.ALPHA_SHIFT:if(i=a,c<26)u=String.fromCharCode(65+c);else switch(c){case 26:u=" ";break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}break;case St.PUNCT_SHIFT:if(i=a,c<t.PAL)u=t.PUNCT_CHARS[c];else switch(c){case t.PAL:i=St.ALPHA;break;case t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:o.append(n[s]);break;case t.TEXT_COMPACTION_MODE_LATCH:i=St.ALPHA}}u!==""&&o.append(u),s++}},t.byteCompaction=function(e,n,r,o,i){var a=new UI,s=0,c=0,u=!1;switch(e){case t.BYTE_COMPACTION_MODE_LATCH:for(var d=new Int32Array(6),h=n[o++];o<n[0]&&!u;)switch(d[s++]=h,c=900*c+h,h=n[o++]){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,u=!0;break;default:if(s%5==0&&s>0){for(var f=0;f<6;++f)a.write(Number(jo(c)>>jo(8*(5-f))));c=0,s=0}}o===n[0]&&h<t.TEXT_COMPACTION_MODE_LATCH&&(d[s++]=h);for(var p=0;p<s;p++)a.write(d[p]);break;case t.BYTE_COMPACTION_MODE_LATCH_6:for(;o<n[0]&&!u;){var l=n[o++];if(l<t.TEXT_COMPACTION_MODE_LATCH)s++,c=900*c+l;else switch(l){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.NUMERIC_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:o--,u=!0}if(s%5==0&&s>0){for(f=0;f<6;++f)a.write(Number(jo(c)>>jo(8*(5-f))));c=0,s=0}}}return i.append(ci.decode(a.toByteArray(),r)),o},t.numericCompaction=function(e,n,r){for(var o=0,i=!1,a=new Int32Array(t.MAX_NUMERIC_CODEWORDS);n<e[0]&&!i;){var s=e[n++];if(n===e[0]&&(i=!0),s<t.TEXT_COMPACTION_MODE_LATCH)a[o]=s,o++;else switch(s){case t.TEXT_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH:case t.BYTE_COMPACTION_MODE_LATCH_6:case t.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case t.MACRO_PDF417_TERMINATOR:n--,i=!0}(o%t.MAX_NUMERIC_CODEWORDS==0||s===t.NUMERIC_COMPACTION_MODE_LATCH||i)&&o>0&&(r.append(t.decodeBase900toBase10(a,o)),o=0)}return n},t.decodeBase900toBase10=function(e,n){for(var r=jo(0),o=0;o<n;o++)r+=t.EXP900[n-o-1]*jo(e[o]);var i=r.toString();if(i.charAt(0)!=="1")throw new Se;return i.substring(1)},t.TEXT_COMPACTION_MODE_LATCH=900,t.BYTE_COMPACTION_MODE_LATCH=901,t.NUMERIC_COMPACTION_MODE_LATCH=902,t.BYTE_COMPACTION_MODE_LATCH_6=924,t.ECI_USER_DEFINED=925,t.ECI_GENERAL_PURPOSE=926,t.ECI_CHARSET=927,t.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,t.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,t.MACRO_PDF417_TERMINATOR=922,t.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,t.MAX_NUMERIC_CODEWORDS=15,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,t.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,t.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,t.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,t.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,t.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,t.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,t.PL=25,t.LL=27,t.AS=27,t.ML=28,t.AL=28,t.PS=29,t.PAL=29,t.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
143
+ -.$/"|*()?{}'`,t.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",t.EXP900=V2()?function(){var e=[];e[0]=jo(1);var n=jo(900);e[1]=n;for(var r=2;r<16;r++)e[r]=e[r-1]*n;return e}():[],t.NUMBER_OF_SEQUENCE_CODEWORDS=2,t}(),vs=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},qI=function(){function t(){}return t.decode=function(e,n,r,o,i,a,s){for(var c,u=new kf(e,n,r,o,i),d=null,h=null,f=!0;;f=!1){if(n!=null&&(d=t.getRowIndicatorColumn(e,u,n,!0,a,s)),o!=null&&(h=t.getRowIndicatorColumn(e,u,o,!1,a,s)),(c=t.merge(d,h))==null)throw he.getNotFoundInstance();var p=c.getBoundingBox();if(!f||p==null||!(p.getMinY()<u.getMinY()||p.getMaxY()>u.getMaxY()))break;u=p}c.setBoundingBox(u);var l=c.getBarcodeColumnCount()+1;c.setDetectionResultColumn(0,d),c.setDetectionResultColumn(l,h);for(var g=d!=null,m=1;m<=l;m++){var y=g?m:l-m;if(c.getDetectionResultColumn(y)===void 0){var w=void 0;w=y===0||y===l?new F2(u,y===0):new L2(u),c.setDetectionResultColumn(y,w);for(var b=-1,E=b,C=u.getMinY();C<=u.getMaxY();C++){if((b=t.getStartColumn(c,y,C,g))<0||b>u.getMaxX()){if(E===-1)continue;b=E}var I=t.detectCodeword(e,u.getMinX(),u.getMaxX(),g,b,C,a,s);I!=null&&(w.setCodeword(C,I),E=b,a=Math.min(a,I.getWidth()),s=Math.max(s,I.getWidth()))}}}return t.createDecoderResult(c)},t.merge=function(e,n){if(e==null&&n==null)return null;var r=t.getBarcodeMetadata(e,n);if(r==null)return null;var o=kf.merge(t.adjustBoundingBox(e),t.adjustBoundingBox(n));return new kI(r,o)},t.adjustBoundingBox=function(e){var n,r;if(e==null)return null;var o=e.getRowHeights();if(o==null)return null;var i=t.getMax(o),a=0;try{for(var s=vs(o),c=s.next();!c.done;c=s.next()){var u=c.value;if(a+=i-u,u>0)break}}catch(p){n={error:p}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}for(var d=e.getCodewords(),h=0;a>0&&d[h]==null;h++)a--;var f=0;for(h=o.length-1;h>=0&&(f+=i-o[h],!(o[h]>0));h--);for(h=d.length-1;f>0&&d[h]==null;h--)f--;return e.getBoundingBox().addMissingRows(a,f,e.isLeft())},t.getMax=function(e){var n,r,o=-1;try{for(var i=vs(e),a=i.next();!a.done;a=i.next()){var s=a.value;o=Math.max(o,s)}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},t.getBarcodeMetadata=function(e,n){var r,o;return e==null||(r=e.getBarcodeMetadata())==null?n==null?null:n.getBarcodeMetadata():n==null||(o=n.getBarcodeMetadata())==null?r:r.getColumnCount()!==o.getColumnCount()&&r.getErrorCorrectionLevel()!==o.getErrorCorrectionLevel()&&r.getRowCount()!==o.getRowCount()?null:r},t.getRowIndicatorColumn=function(e,n,r,o,i,a){for(var s=new F2(n,o),c=0;c<2;c++)for(var u=c===0?1:-1,d=Math.trunc(Math.trunc(r.getX())),h=Math.trunc(Math.trunc(r.getY()));h<=n.getMaxY()&&h>=n.getMinY();h+=u){var f=t.detectCodeword(e,0,e.getWidth(),o,d,h,i,a);f!=null&&(s.setCodeword(h,f),d=o?f.getStartX():f.getEndX())}return s},t.adjustCodewordCount=function(e,n){var r=n[0][1],o=r.getValue(),i=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-t.getNumberOfECCodeWords(e.getBarcodeECLevel());if(o.length===0){if(i<1||i>it.MAX_CODEWORDS_IN_BARCODE)throw he.getNotFoundInstance();r.setValue(i)}else o[0]!==i&&r.setValue(i)},t.createDecoderResult=function(e){var n=t.createBarcodeMatrix(e);t.adjustCodewordCount(e,n);for(var r=new Array,o=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),i=[],a=new Array,s=0;s<e.getBarcodeRowCount();s++)for(var c=0;c<e.getBarcodeColumnCount();c++){var u=n[s][c+1].getValue(),d=s*e.getBarcodeColumnCount()+c;u.length===0?r.push(d):u.length===1?o[d]=u[0]:(a.push(d),i.push(u))}for(var h=new Array(i.length),f=0;f<h.length;f++)h[f]=i[f];return t.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),o,it.toIntArray(r),it.toIntArray(a),h)},t.createDecoderResultFromAmbiguousValues=function(e,n,r,o,i){for(var a=new Int32Array(o.length),s=100;s-- >0;){for(var c=0;c<a.length;c++)n[o[c]]=i[c][a[c]];try{return t.decodeCodewords(n,e,r)}catch(u){if(!(u instanceof sn))throw u}if(a.length===0)throw sn.getChecksumInstance();for(c=0;c<a.length;c++){if(a[c]<i[c].length-1){a[c]++;break}if(a[c]=0,c===a.length-1)throw sn.getChecksumInstance()}}throw sn.getChecksumInstance()},t.createBarcodeMatrix=function(e){for(var n,r,o,i,a=Array.from({length:e.getBarcodeRowCount()},function(){return new Array(e.getBarcodeColumnCount()+2)}),s=0;s<a.length;s++)for(var c=0;c<a[s].length;c++)a[s][c]=new ys;var u=0;try{for(var d=vs(e.getDetectionResultColumns()),h=d.next();!h.done;h=d.next()){var f=h.value;if(f!=null)try{for(var p=(o=void 0,vs(f.getCodewords())),l=p.next();!l.done;l=p.next()){var g=l.value;if(g!=null){var m=g.getRowNumber();if(m>=0){if(m>=a.length)continue;a[m][u].setValue(g.getValue())}}}}catch(y){o={error:y}}finally{try{l&&!l.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}u++}}catch(y){n={error:y}}finally{try{h&&!h.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return a},t.isValidBarcodeColumn=function(e,n){return n>=0&&n<=e.getBarcodeColumnCount()+1},t.getStartColumn=function(e,n,r,o){var i,a,s=o?1:-1,c=null;if(t.isValidBarcodeColumn(e,n-s)&&(c=e.getDetectionResultColumn(n-s).getCodeword(r)),c!=null)return o?c.getEndX():c.getStartX();if((c=e.getDetectionResultColumn(n).getCodewordNearby(r))!=null)return o?c.getStartX():c.getEndX();if(t.isValidBarcodeColumn(e,n-s)&&(c=e.getDetectionResultColumn(n-s).getCodewordNearby(r)),c!=null)return o?c.getEndX():c.getStartX();for(var u=0;t.isValidBarcodeColumn(e,n-s);){n-=s;try{for(var d=(i=void 0,vs(e.getDetectionResultColumn(n).getCodewords())),h=d.next();!h.done;h=d.next()){var f=h.value;if(f!=null)return(o?f.getEndX():f.getStartX())+s*u*(f.getEndX()-f.getStartX())}}catch(p){i={error:p}}finally{try{h&&!h.done&&(a=d.return)&&a.call(d)}finally{if(i)throw i.error}}u++}return o?e.getBoundingBox().getMinX():e.getBoundingBox().getMaxX()},t.detectCodeword=function(e,n,r,o,i,a,s,c){i=t.adjustCodewordStartColumn(e,n,r,o,i,a);var u,d=t.getModuleBitCount(e,n,r,o,i,a);if(d==null)return null;var h=ft.sum(d);if(o)u=i+h;else{for(var f=0;f<d.length/2;f++){var p=d[f];d[f]=d[d.length-1-f],d[d.length-1-f]=p}i=(u=i)-h}if(!t.checkCodewordSkew(h,s,c))return null;var l=NI.getDecodedValue(d),g=it.getCodeword(l);return g===-1?null:new BI(i,u,t.getCodewordBucketNumber(l),g)},t.getModuleBitCount=function(e,n,r,o,i,a){for(var s=i,c=new Int32Array(8),u=0,d=o?1:-1,h=o;(o?s<r:s>=n)&&u<c.length;)e.get(s,a)===h?(c[u]++,s+=d):(u++,h=!h);return u===c.length||s===(o?r:n)&&u===c.length-1?c:null},t.getNumberOfECCodeWords=function(e){return 2<<e},t.adjustCodewordStartColumn=function(e,n,r,o,i,a){for(var s=i,c=o?-1:1,u=0;u<2;u++){for(;(o?s>=n:s<r)&&o===e.get(s,a);){if(Math.abs(i-s)>t.CODEWORD_SKEW_SIZE)return i;s+=c}c=-c,o=!o}return s},t.checkCodewordSkew=function(e,n,r){return n-t.CODEWORD_SKEW_SIZE<=e&&e<=r+t.CODEWORD_SKEW_SIZE},t.decodeCodewords=function(e,n,r){if(e.length===0)throw Se.getFormatInstance();var o=1<<n+1,i=t.correctErrors(e,r,o);t.verifyCodewordCount(e,o);var a=GI.decode(e,""+n);return a.setErrorsCorrected(i),a.setErasures(r.length),a},t.correctErrors=function(e,n,r){if(n!=null&&n.length>r/2+t.MAX_ERRORS||r<0||r>t.MAX_EC_CODEWORDS)throw sn.getChecksumInstance();return t.errorCorrection.decode(e,r,n)},t.verifyCodewordCount=function(e,n){if(e.length<4)throw Se.getFormatInstance();var r=e[0];if(r>e.length)throw Se.getFormatInstance();if(r===0){if(!(n<e.length))throw Se.getFormatInstance();e[0]=e.length-n}},t.getBitCountForCodeword=function(e){for(var n=new Int32Array(8),r=0,o=n.length-1;!((1&e)!==r&&(r=1&e,--o<0));)n[o]++,e>>=1;return n},t.getCodewordBucketNumber=function(e){return e instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(e):this.getCodewordBucketNumber_number(e)},t.getCodewordBucketNumber_number=function(e){return t.getCodewordBucketNumber(t.getBitCountForCodeword(e))},t.getCodewordBucketNumber_Int32Array=function(e){return(e[0]-e[2]+e[4]-e[6]+9)%9},t.toString=function(e){for(var n=new Bf,r=0;r<e.length;r++){n.format("Row %2d: ",r);for(var o=0;o<e[r].length;o++){var i=e[r][o];i.getValue().length===0?n.format(" ",null):n.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}n.format("%n")}return n.toString()},t.CODEWORD_SKEW_SIZE=2,t.MAX_ERRORS=3,t.MAX_EC_CODEWORDS=512,t.errorCorrection=new AI,t}(),HI=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Eu=function(){function t(){}return t.prototype.decode=function(e,n){n===void 0&&(n=null);var r=t.decode(e,n,!1);if(r==null||r.length===0||r[0]==null)throw he.getNotFoundInstance();return r[0]},t.prototype.decodeMultiple=function(e,n){n===void 0&&(n=null);try{return t.decode(e,n,!0)}catch(r){throw r instanceof Se||r instanceof sn?he.getNotFoundInstance():r}},t.decode=function(e,n,r){var o,i,a=new Array,s=vI.detectMultiple(e,n,r);try{for(var c=HI(s.getPoints()),u=c.next();!u.done;u=c.next()){var d=u.value,h=qI.decode(s.getBits(),d[4],d[5],d[6],d[7],t.getMinCodewordWidth(d),t.getMaxCodewordWidth(d)),f=new Wn(h.getText(),h.getRawBytes(),void 0,d,Re.PDF_417);f.putMetadata(Cn.ERROR_CORRECTION_LEVEL,h.getECLevel());var p=h.getOther();p!=null&&f.putMetadata(Cn.PDF417_EXTRA_METADATA,p),a.push(f)}}catch(l){o={error:l}}finally{try{u&&!u.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return a.map(function(l){return l})},t.getMaxWidth=function(e,n){return e==null||n==null?0:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMinWidth=function(e,n){return e==null||n==null?bn.MAX_VALUE:Math.trunc(Math.abs(e.getX()-n.getX()))},t.getMaxCodewordWidth=function(e){return Math.floor(Math.max(Math.max(t.getMaxWidth(e[0],e[4]),t.getMaxWidth(e[6],e[2])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN),Math.max(t.getMaxWidth(e[1],e[5]),t.getMaxWidth(e[7],e[3])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN)))},t.getMinCodewordWidth=function(e){return Math.floor(Math.min(Math.min(t.getMinWidth(e[0],e[4]),t.getMinWidth(e[6],e[2])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN),Math.min(t.getMinWidth(e[1],e[5]),t.getMinWidth(e[7],e[3])*it.MODULES_IN_CODEWORD/it.MODULES_IN_STOP_PATTERN)))},t.prototype.reset=function(){},t}(),$I=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),U2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return $I(e,t),e.kind="ReaderException",e}($n),G2=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},q2=function(){function t(){}return t.prototype.decode=function(e,n){return this.setHints(n),this.decodeInternal(e)},t.prototype.decodeWithState=function(e){return this.readers!==null&&this.readers!==void 0||this.setHints(null),this.decodeInternal(e)},t.prototype.setHints=function(e){this.hints=e;var n=e!=null&&e.get(Pt.TRY_HARDER)!==void 0,r=e==null?null:e.get(Pt.POSSIBLE_FORMATS),o=new Array;if(r!=null){var i=r.some(function(a){return a===Re.UPC_A||a===Re.UPC_E||a===Re.EAN_13||a===Re.EAN_8||a===Re.CODABAR||a===Re.CODE_39||a===Re.CODE_93||a===Re.CODE_128||a===Re.ITF||a===Re.RSS_14||a===Re.RSS_EXPANDED});i&&!n&&o.push(new na(e)),r.includes(Re.QR_CODE)&&o.push(new bu),r.includes(Re.DATA_MATRIX)&&o.push(new yu),r.includes(Re.AZTEC)&&o.push(new du),r.includes(Re.PDF_417)&&o.push(new Eu),i&&n&&o.push(new na(e))}o.length===0&&(n||o.push(new na(e)),o.push(new bu),o.push(new yu),o.push(new du),o.push(new Eu),n&&o.push(new na(e))),this.readers=o},t.prototype.reset=function(){var e,n;if(this.readers!==null)try{for(var r=G2(this.readers),o=r.next();!o.done;o=r.next())o.value.reset()}catch(i){e={error:i}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}},t.prototype.decodeInternal=function(e){var n,r;if(this.readers===null)throw new U2("No readers where selected, nothing can be read.");try{for(var o=G2(this.readers),i=o.next();!i.done;i=o.next()){var a=i.value;try{return a.decode(e,this.hints)}catch(s){if(s instanceof U2)continue}}}catch(s){n={error:s}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}throw new he("No MultiFormat Readers were able to detect the code.")},t}(),YI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){n===void 0&&(n=null),r===void 0&&(r=500);var o=new q2;return o.setHints(n),t.call(this,o,r)||this}YI(e,t),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)}})(Zi);var WI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new Eu,n)||this}WI(e,t)})(Zi);var H2,KI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n){return n===void 0&&(n=500),t.call(this,new bu,n)||this}KI(e,t)})(Zi),function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(H2||(H2={}));var zI=function(){function t(){}return t.applyMaskPenaltyRule1=function(e){return t.applyMaskPenaltyRule1Internal(e,!0)+t.applyMaskPenaltyRule1Internal(e,!1)},t.applyMaskPenaltyRule2=function(e){for(var n=0,r=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i-1;a++)for(var s=r[a],c=0;c<o-1;c++){var u=s[c];u===s[c+1]&&u===r[a+1][c]&&u===r[a+1][c+1]&&n++}return t.N2*n},t.applyMaskPenaltyRule3=function(e){for(var n=0,r=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=0;s<o;s++){var c=r[a];s+6<o&&c[s]===1&&c[s+1]===0&&c[s+2]===1&&c[s+3]===1&&c[s+4]===1&&c[s+5]===0&&c[s+6]===1&&(t.isWhiteHorizontal(c,s-4,s)||t.isWhiteHorizontal(c,s+7,s+11))&&n++,a+6<i&&r[a][s]===1&&r[a+1][s]===0&&r[a+2][s]===1&&r[a+3][s]===1&&r[a+4][s]===1&&r[a+5][s]===0&&r[a+6][s]===1&&(t.isWhiteVertical(r,s,a-4,a)||t.isWhiteVertical(r,s,a+7,a+11))&&n++}return n*t.N3},t.isWhiteHorizontal=function(e,n,r){n=Math.max(n,0),r=Math.min(r,e.length);for(var o=n;o<r;o++)if(e[o]===1)return!1;return!0},t.isWhiteVertical=function(e,n,r,o){r=Math.max(r,0),o=Math.min(o,e.length);for(var i=r;i<o;i++)if(e[i][n]===1)return!1;return!0},t.applyMaskPenaltyRule4=function(e){for(var n=0,r=e.getArray(),o=e.getWidth(),i=e.getHeight(),a=0;a<i;a++)for(var s=r[a],c=0;c<o;c++)s[c]===1&&n++;var u=e.getHeight()*e.getWidth();return Math.floor(10*Math.abs(2*n-u)/u)*t.N4},t.getDataMaskBit=function(e,n,r){var o,i;switch(e){case 0:o=r+n&1;break;case 1:o=1&r;break;case 2:o=n%3;break;case 3:o=(r+n)%3;break;case 4:o=Math.floor(r/2)+Math.floor(n/3)&1;break;case 5:o=(1&(i=r*n))+i%3;break;case 6:o=(1&(i=r*n))+i%3&1;break;case 7:o=(i=r*n)%3+(r+n&1)&1;break;default:throw new Ve("Invalid mask pattern: "+e)}return o===0},t.applyMaskPenaltyRule1Internal=function(e,n){for(var r=0,o=n?e.getHeight():e.getWidth(),i=n?e.getWidth():e.getHeight(),a=e.getArray(),s=0;s<o;s++){for(var c=0,u=-1,d=0;d<i;d++){var h=n?a[s][d]:a[d][s];h===u?c++:(c>=5&&(r+=t.N1+(c-5)),c=1,u=h)}c>=5&&(r+=t.N1+(c-5))}return r},t.N1=3,t.N2=3,t.N3=40,t.N4=10,t}(),XI=function(){function t(){this.maskPattern=-1}return t.prototype.getMode=function(){return this.mode},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getVersion=function(){return this.version},t.prototype.getMaskPattern=function(){return this.maskPattern},t.prototype.getMatrix=function(){return this.matrix},t.prototype.toString=function(){var e=new xt;return e.append(`<<
144
144
  `),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append(`
145
145
  ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append(`
146
146
  version: `),e.append(this.version?this.version.toString():"null"),e.append(`
@@ -149,9 +149,9 @@ Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllCha
149
149
  `),e.append(this.matrix.toString())):e.append(`
150
150
  matrix: null
151
151
  `),e.append(`>>
152
- `),e.toString()},t.prototype.setMode=function(e){this.mode=e},t.prototype.setECLevel=function(e){this.ecLevel=e},t.prototype.setVersion=function(e){this.version=e},t.prototype.setMaskPattern=function(e){this.maskPattern=e},t.prototype.setMatrix=function(e){this.matrix=e},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),JI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hi=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return JI(e,t),e.kind="WriterException",e}($n);(function(){function t(){}return t.clearMatrix=function(e){e.clear(255)},t.buildMatrix=function(e,n,r,o,i){t.clearMatrix(i),t.embedBasicPatterns(r,i),t.embedTypeInfo(n,o,i),t.maybeEmbedVersionInfo(r,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,n){t.embedPositionDetectionPatternsAndSeparators(n),t.embedDarkDotAtLeftBottomCorner(n),t.maybeEmbedPositionAdjustmentPatterns(e,n),t.embedTimingPatterns(n)},t.embedTypeInfo=function(e,n,r){var o=new Ur;t.makeTypeInfoBits(e,n,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),c=t.TYPE_INFO_COORDINATES[i],u=c[0],d=c[1];if(r.setBoolean(u,d,s),i<8){var h=r.getWidth()-i-1,f=8;r.setBoolean(h,f,s)}else h=8,f=r.getHeight()-7+(i-8),r.setBoolean(h,f,s)}},t.maybeEmbedVersionInfo=function(e,n){if(!(e.getVersionNumber()<7)){var r=new Ur;t.makeVersionInfoBits(e,r);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=r.get(o);o--,n.setBoolean(i,n.getHeight()-11+a,s),n.setBoolean(n.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,n,r){for(var o=0,i=-1,a=r.getWidth()-1,s=r.getHeight()-1;a>0;){for(a===6&&(a-=1);s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var u=a-c;if(t.isEmpty(r.get(u,s))){var d=void 0;o<e.getSize()?(d=e.get(o),++o):d=!1,n!==255&&XI.getDataMaskBit(n,u,s)&&(d=!d),r.setBoolean(u,s,d)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new hi("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(e){return 32-bn.numberOfLeadingZeros(e)},t.calculateBCHCode=function(e,n){if(n===0)throw new Ve("0 polynomial");var r=t.findMSBSet(n);for(e<<=r-1;t.findMSBSet(e)>=r;)e^=n<<t.findMSBSet(e)-r;return e},t.makeTypeInfoBits=function(e,n,r){if(!QI.isValidMaskPattern(n))throw new hi("Invalid mask pattern");var o=e.getBits()<<3|n;r.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);r.appendBits(i,10);var a=new Ur;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),r.xor(a),r.getSize()!==15)throw new hi("should not happen but we got: "+r.getSize())},t.makeVersionInfoBits=function(e,n){n.appendBits(e.getVersionNumber(),6);var r=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new hi("should not happen but we got: "+n.getSize())},t.isEmpty=function(e){return e===255},t.embedTimingPatterns=function(e){for(var n=8;n<e.getWidth()-8;++n){var r=(n+1)%2;t.isEmpty(e.get(n,6))&&e.setNumber(n,6,r),t.isEmpty(e.get(6,n))&&e.setNumber(6,n,r)}},t.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new hi;e.setNumber(8,e.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,n,r){for(var o=0;o<8;++o){if(!t.isEmpty(r.get(e+o,n)))throw new hi;r.setNumber(e+o,n,0)}},t.embedVerticalSeparationPattern=function(e,n,r){for(var o=0;o<7;++o){if(!t.isEmpty(r.get(e,n+o)))throw new hi;r.setNumber(e,n+o,0)}},t.embedPositionAdjustmentPattern=function(e,n,r){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)r.setNumber(e+a,n+o,i[a])},t.embedPositionDetectionPattern=function(e,n,r){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)r.setNumber(e+a,n+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var n=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-n,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-n,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,n){if(!(e.getVersionNumber()<2))for(var r=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var c=0;c!==a;c++){var u=o[c];u>=0&&t.isEmpty(n.get(u,s))&&t.embedPositionAdjustmentPattern(u-2,s-2,n)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522,t})(),function(){Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Yn.UTF8.getName()}();var ZI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o,i,a,s,c,u){var d=t.call(this,s,c)||this;if(d.yuvData=n,d.dataWidth=r,d.dataHeight=o,d.left=i,d.top=a,i+s>r||a+c>o)throw new Ve("Crop rectangle does not fit within image data.");return u&&d.reverseHorizontal(s,c),d}ZI(e,t),e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length<o)&&(r=new Uint8ClampedArray(o));var i=(n+this.top)*this.dataWidth+this.left;return Nt.arraycopy(this.yuvData,i,r,0,o),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.yuvData;var o=n*r,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Nt.arraycopy(this.yuvData,a,i,0,o),i;for(var s=0;s<r;s++){var c=s*n;Nt.arraycopy(this.yuvData,a,i,c,n),a+=this.dataWidth}return i},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+r,o,i,!1)},e.prototype.renderThumbnail=function(){for(var n=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,o=new Int32Array(n*r),i=this.yuvData,a=this.top*this.dataWidth+this.left,s=0;s<r;s++){for(var c=s*n,u=0;u<n;u++){var d=255&i[a+u*e.THUMBNAIL_SCALE_FACTOR];o[c+u]=4278190080|65793*d}a+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return o},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(n,r){for(var o=this.yuvData,i=0,a=this.top*this.dataWidth+this.left;i<r;i++,a+=this.dataWidth)for(var s=a+n/2,c=a,u=a+n-1;c<s;c++,u--){var d=o[c];o[c]=o[u],o[u]=d}},e.prototype.invert=function(){return new su(this)},e.THUMBNAIL_SCALE_FACTOR=2})(fs);var eT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o,i,a,s,c){var u=t.call(this,r,o)||this;if(u.dataWidth=i,u.dataHeight=a,u.left=s,u.top=c,n.BYTES_PER_ELEMENT===4){for(var d=r*o,h=new Uint8ClampedArray(d),f=0;f<d;f++){var p=n[f],l=p>>16&255,g=p>>7&510,m=255&p;h[f]=(l+g+m)/4&255}u.luminances=h}else u.luminances=n;if(i===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=o),s===void 0&&(u.left=0),c===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+o>u.dataHeight)throw new Ve("Crop rectangle does not fit within image data.");return u}eT(e,t),e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length<o)&&(r=new Uint8ClampedArray(o));var i=(n+this.top)*this.dataWidth+this.left;return Nt.arraycopy(this.luminances,i,r,0,o),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.luminances;var o=n*r,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Nt.arraycopy(this.luminances,a,i,0,o),i;for(var s=0;s<r;s++){var c=s*n;Nt.arraycopy(this.luminances,a,i,c,n),a+=this.dataWidth}return i},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return new e(this.luminances,o,i,this.dataWidth,this.dataHeight,this.left+n,this.top+r)},e.prototype.invert=function(){return new su(this)}})(fs);var tT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(){return t!==null&&t.apply(this,arguments)||this}tT(e,t),e.forName=function(n){return this.getCharacterSetECIByName(n)}})(Yn);var nT=function(){function t(e){this.previous=e}return t.prototype.getPrevious=function(){return this.previous},t}(),rT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$2=function(t){function e(n,r,o){var i=t.call(this,n)||this;return i.value=r,i.bitCount=o,i}return rT(e,t),e.prototype.appendTo=function(n,r){n.appendBits(this.value,this.bitCount)},e.prototype.add=function(n,r){return new e(this,n,r)},e.prototype.addBinaryShift=function(n,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,n,r)},e.prototype.toString=function(){var n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+bn.toBinaryString(n|1<<this.bitCount).substring(1)+">"},e}(nT),oT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o){var i=t.call(this,n,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=o,i}oT(e,t),e.prototype.appendTo=function(n,r){for(var o=0;o<this.binaryShiftByteCount;o++)(o===0||o===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):o===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+o],8)},e.prototype.addBinaryShift=function(n,r){return new e(this,n,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}})($2),new $2(null,0,0);var iT=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){var e,n;try{for(var r=iT(t),o=r.next();!o.done;o=r.next()){var i=o.value;or.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15})(or.createInt32Array(6,6)),function(t){var e=pn.getCharCode(" "),n=pn.getCharCode("."),r=pn.getCharCode(",");t[0][e]=1;for(var o=pn.getCharCode("Z"),i=pn.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=pn.getCharCode("z"),c=pn.getCharCode("a");for(a=c;a<=s;a++)t[1][a]=a-c+2;t[2][e]=1;var u=pn.getCharCode("9"),d=pn.getCharCode("0");for(a=d;a<=u;a++)t[2][a]=a-d+2;t[2][r]=12,t[2][n]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",`
153
- `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][pn.getCharCode(h[f])]=f;var p=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<p.length;f++)pn.getCharCode(p[f])>0&&(t[4][pn.getCharCode(p[f])]=f)}(or.createInt32Array(5,256));var aT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sT=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=e.makeBufferFromCanvasImageData(n),r}return aT(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(o.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new su(this)},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var o=n*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),c=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);r.width=s,r.height=c;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(s/2,c/2),u.rotate(o),u.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs);function Y2(){return typeof navigator<"u"}function cT(){return!!(Y2()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var oa=function(){return oa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},oa.apply(this,arguments)},$t=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Yt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},Cu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},uT={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ia=function(){function t(e,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=e,this.hints=n,this.options=oa(oa({},uT),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Pt.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),t.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.mediaStreamSetTorch=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var n,r,o=e.getVideoTracks();try{for(var i=Cu(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(e){try{return"torch"in e.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},t.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return t.getMediaElement(e,"video");if(!e&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return t.getMediaElement(e,"img");if(e===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var n=t.createVideoElement(e);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.createBinaryBitmapFromCanvas=function(e){var n=new sT(e),r=new d2(n);return new u2(r)},t.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Ht("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=t.getMediaElementDimensions(e),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},t.tryPlayVideo=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(e!=null&&e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var n=t.createCaptureCanvas(e),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(r,e),n},t.createBinaryBitmapFromMediaElem=function(e){var n=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(n)},t.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},t.listVideoInputDevices=function(){return $t(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Yt(this,function(p){switch(p.label){case 0:if(!Y2())throw new Error("Can't enumerate devices, navigator is not present.");if(!cT())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=Cu(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.findDeviceById=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){t.isVideoPlaying(e)||(i(!1),e.removeEventListener("canplay",s))},n),s=function(){t.tryPlayVideo(e).then(function(c){clearTimeout(a),e.removeEventListener("canplay",s),o(c)})};e.addEventListener("canplay",s)})]}})})},t.attachStreamToVideo=function(e,n,r){return r===void 0&&(r=5e3),$t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(n),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(n,r){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),n()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(e){if(!e)throw new Ht("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(n){return n.stop()}),e=void 0},t.prototype.decode=function(e){var n=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(n)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},t.prototype.decodeFromCanvas=function(e){var n=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(n)},t.prototype.decodeFromImageElement=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An image element must be provided.");return n=t.prepareImageElement(e),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareImageElement()).src=e,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return t.destroyImageElement(n),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i;return Yt(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i,a,s,c,u,d,h,f,p,l=this;return Yt(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,n,o)];case 1:return i=g.sent(),a=function(){var m,y;try{for(var w=Cu(e.getVideoTracks()),b=w.next();!b.done;b=w.next())b.value.stop()}catch(E){m={error:E}}finally{try{b&&!b.done&&(y=w.return)&&y.call(w)}finally{if(m)throw m.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},c=this.scan(i,r,s),u=e.getVideoTracks(),d=oa(oa({},c),{stop:function(){c.stop()},streamVideoConstraintsApply:function(m,y){return $t(this,void 0,void 0,function(){var w,b,E,C,I,T;return Yt(this,function(P){switch(P.label){case 0:w=y?u.filter(y):u,P.label=1;case 1:P.trys.push([1,6,7,8]),b=Cu(w),E=b.next(),P.label=2;case 2:return E.done?[3,5]:[4,E.value.applyConstraints(m)];case 3:P.sent(),P.label=4;case 4:return E=b.next(),[3,2];case 5:return[3,8];case 6:return C=P.sent(),I={error:C},[3,8];case 7:try{E&&!E.done&&(T=b.return)&&T.call(b)}finally{if(I)throw I.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(m){return u.find(m).getConstraints()},streamVideoSettingsGet:function(m){return u.find(m).getSettings()},streamVideoCapabilitiesGet:function(m){return u.find(m).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=u==null?void 0:u.find(function(m){return t.mediaStreamIsTorchCompatibleTrack(m)}),f=function(m){return $t(l,void 0,void 0,function(){return Yt(this,function(y){switch(y.label){case 0:return[4,t.mediaStreamSetTorch(h,m)];case 1:return y.sent(),[2]}})})},d.switchTorch=f,p=function(){c.stop(),f(!1)},d.stop=p),[2,d]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return $t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(r),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("A video element must be provided.");return r=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},t.prototype.decodeFromVideoUrl=function(e,n){return $t(this,void 0,void 0,function(){var r,o,i;return Yt(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("An URL must be provided.");return(r=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:return r=!!n,[4,t.attachStreamToVideo(e,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("A video element must be provided.");return n=t.prepareVideoElement(e),r=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareVideoElement()).src=e,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(n),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(e,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(e,function(c,u,d){if(c)return a(c),void d.stop();if(u){if(u instanceof he&&n||u instanceof sn&&r||u instanceof Se&&o)return;d.stop(),s(u)}})})},t.prototype.scan=function(e,n,r){var o=this;t.checkCallbackFnOrThrow(n);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,c=function(){a=void 0,i=void 0},u=!1,d={stop:function(){u=!0,clearTimeout(s),c(),r&&r()}},h=function(){if(!u)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);n(f,void 0,d),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(p){if(n(void 0,p,d),p instanceof sn||p instanceof Se||p instanceof he)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));c(),r&&r(p)}};return h(),d},t.prototype._decodeOnLoadImage=function(e){return $t(this,void 0,void 0,function(){return Yt(this,function(n){switch(n.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(e)]}})})},t}(),lT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new du,n,r)||this}lT(e,t)})(ia);var dT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new na(n),n,r)||this}dT(e,t)})(ia);var fT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new yu,n,r)||this}fT(e,t)})(ia);var hT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){var o=this,i=new q2;return i.setHints(n),(o=t.call(this,i,n,r)||this).reader=i,o}hT(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(n){this.hints.set(Pt.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},e.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(ia);var pT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new Eu,n,r)||this}pT(e,t)})(ia);var gT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),mT=function(t){function e(n,r){return t.call(this,new bu,n,r)||this}return gT(e,t),e}(ia),_u=function(t,e,n){var r=typeof t===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(n,'".')),r},yT=function(t){var e=t.scanDelay,n=t.constraints,r=t.onResult,o=t.videoId,i=x.useRef(null);x.useEffect(function(){var a=new mT(null,{delayBetweenScanAttempts:e});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&_u(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),_u(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,c){_u(r,"onResult","function")&&r(s,c,a)}).then(function(s){return i.current=s}).catch(function(s){_u(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},pi=function(){return pi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pi.apply(this,arguments)},W2={container:{width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},video:{top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0}},Rf=function(t){var e=t.videoContainerStyle,n=t.containerStyle,r=t.videoStyle,o=t.constraints,i=t.ViewFinder,a=t.scanDelay,s=t.className,c=t.onResult,u=t.videoId;return yT({constraints:o,scanDelay:a,onResult:c,videoId:u}),ce.createElement("section",{className:s,style:n},ce.createElement("div",{style:pi(pi({},W2.container),e)},!!i&&ce.createElement(i,null),ce.createElement("video",{muted:!0,id:u,style:pi(pi(pi({},W2.video),r),{transform:(o==null?void 0:o.facingMode)==="user"&&"scaleX(-1)"})})))};Rf.displayName="QrReader",Rf.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};function vT({onScan:t}){const{cameraFacingMode:e}=an(),[n,r]=x.useState(e??Vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx(Rf,{onResult:o=>{o&&t(o.getText())},constraints:{facingMode:n},videoStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem",objectFit:"cover"},videoContainerStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem"}}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===Vn.USER?r(Vn.ENVIRONMENT):r(Vn.USER),children:v.jsx("img",{src:yf,alt:"camera-switch"})})]})}class Qe{constructor(e,n,r,o,i){this._legacyCanvasSize=Qe.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=e,this.$canvas=document.createElement("canvas"),r&&typeof r=="object"?this._onDecode=n:(console.warn(r||o||i?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof r=="object"?r:{},this._onDecodeError=n.onDecodeError||(typeof r=="function"?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||i||this._preferredCamera,this._legacyCanvasSize=typeof r=="number"?r:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;if(e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),r=e.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(o=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),i=this.$overlay.style,i.position="absolute",i.display="none",i.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(e),requestAnimationFrame(()=>{let s=window.getComputedStyle(e);s.display==="none"&&(e.style.setProperty("display","block","important"),a=!0),s.visibility!=="visible"&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity="0",e.style.width="0",e.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=Qe.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await Qe.listCameras(!1)).length}catch{return!1}}static async listCameras(e=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),r;try{e&&(await n()).every(o=>!o.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((o,i)=>({id:o.deviceId,label:o.label||(i===0?"Default Camera":`Camera ${i+1}`)}))}finally{r&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),Qe._stopVideoStream(r))}}async hasFlash(){let e;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;e=this.$video.srcObject}else e=(await this._getCameraStream()).stream;return"torch"in e.getVideoTracks()[0].getSettings()}catch{return!1}finally{e&&e!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),Qe._stopVideoStream(e))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),Qe._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:e,facingMode:n}=await this._getCameraStream();!this._active||this._paused?Qe._stopVideoStream(e):(this._setVideoMirror(n),this.$video.srcObject=e,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(e=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(Qe._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return e?(n(),!0):(await new Promise(r=>setTimeout(r,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(e,n,r,o,i=!1,a=!1){let s,c=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(s=n.scanRegion,r=n.qrEngine,o=n.canvas,i=n.disallowCanvasResizing||!1,a=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||o||i||a?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!r;try{let u,d;[r,u]=await Promise.all([r||Qe.createQrEngine(),Qe._loadImage(e)]),[o,d]=Qe._drawToCanvas(u,s,o,i);let h;if(r instanceof Worker){let f=r;n||Qe._postWorkerMessageSync(f,"inversionMode","both"),h=await new Promise((p,l)=>{let g,m,y,w=-1;m=E=>{E.data.id===w&&(f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),E.data.data!==null?p({data:E.data.data,cornerPoints:Qe._convertPoints(E.data.cornerPoints,s)}):l(Qe.NO_QR_CODE_FOUND))},y=E=>{f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),l("Scanner error: "+(E?E.message||E:"Unknown Error"))},f.addEventListener("message",m),f.addEventListener("error",y),g=setTimeout(()=>y("timeout"),1e4);let b=d.getImageData(0,0,o.width,o.height);w=Qe._postWorkerMessageSync(f,"decode",b,[b.data.buffer])})}else h=await Promise.race([new Promise((f,p)=>window.setTimeout(()=>p("Scanner error: timeout"),1e4)),(async()=>{try{var[f]=await r.detect(o);if(!f)throw Qe.NO_QR_CODE_FOUND;return{data:f.rawValue,cornerPoints:Qe._convertPoints(f.cornerPoints,s)}}catch(p){if(f=p.message||p,/not implemented|service unavailable/.test(f))return Qe._disableBarcodeDetector=!0,Qe.scanImage(e,{scanRegion:s,canvas:o,disallowCanvasResizing:i,alsoTryWithoutScanRegion:a});throw`Scanner error: ${f}`}})()]);return c?h:h.data}catch(u){if(!s||!a)throw u;let d=await Qe.scanImage(e,{qrEngine:r,canvas:o,disallowCanvasResizing:i});return c?d:d.data}finally{n||Qe._postWorkerMessage(r,"close")}}setGrayscaleWeights(e,n,r,o=!0){Qe._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:n,blue:r,useIntegerApproximation:o})}setInversionMode(e){Qe._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static async createQrEngine(e){if(e&&console.warn("Specifying a worker path is not required and not supported anymore."),e=()=>Promise.resolve().then(()=>hO).then(r=>r.createWorker()),!(!Qe._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return e();let n=navigator.userAgentData;return n&&n.brands.some(({brand:r})=>/Chromium/i.test(r))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:r,platformVersion:o})=>/arm/i.test(r||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?e():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let n=Math.round(.6666666666666666*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-n)/2),y:Math.round((e.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,n=e.videoWidth,r=e.videoHeight,o=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,s=e.offsetTop,c=window.getComputedStyle(e),u=c.objectFit,d=n/r,h=o/i;switch(u){case"none":var f=n,p=r;break;case"fill":f=o,p=i;break;default:(u==="cover"?d>h:d<h)?(p=i,f=p*d):(f=o,p=f/d),u==="scale-down"&&(f=Math.min(f,n),p=Math.min(p,r))}var[l,g]=c.objectPosition.split(" ").map((y,w)=>{const b=parseFloat(y);return y.endsWith("%")?(w?i-p:o-f)*b/100:b});c=this._scanRegion.width||n,h=this._scanRegion.height||r,u=this._scanRegion.x||0;var m=this._scanRegion.y||0;d=this.$overlay.style,d.width=`${c/n*f}px`,d.height=`${h/r*p}px`,d.top=`${s+g+m/r*p}px`,r=/scaleX\(-1\)/.test(e.style.transform),d.left=`${a+(r?o-l-f:l)+(r?n-u-c:u)/n*f}px`,d.transform=e.style.transform}})}static _convertPoints(e,n){if(!n)return e;let r=n.x||0,o=n.y||0,i=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let a of e)a.x=a.x*i+r,a.y=a.y*n+o;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var e=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;e<n&&await new Promise(o=>setTimeout(o,n-e)),this._lastScanTimestamp=Date.now();try{var r=await Qe.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!Qe._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=Qe.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",r.cornerPoints.map(({x:o,y:i})=>`${o},${i}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(e){e!==Qe.NO_QR_CODE_FOUND&&console.log(e)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],r=n.map(o=>Object.assign({},o,{[e]:{exact:this._preferredCamera}}));for(let o of[...r,...n])try{let i=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),a=this._getFacingMode(i)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:i,facingMode:a}}catch{}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let n of e.getTracks())n.stop(),e.removeTrack(n)}_setVideoMirror(e){this.$video.style.transform="scaleX("+(e==="user"?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,n,r,o=!1){r=r||document.createElement("canvas");let i=n&&n.x?n.x:0,a=n&&n.y?n.y:0,s=n&&n.width?n.width:e.videoWidth||e.width,c=n&&n.height?n.height:e.videoHeight||e.height;return o||(o=n&&n.downScaledWidth?n.downScaledWidth:s,n=n&&n.downScaledHeight?n.downScaledHeight:c,r.width!==o&&(r.width=o),r.height!==n&&(r.height=n)),n=r.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(e,i,a,s,c,0,0,r.width,r.height),[r,n]}static async _loadImage(e){if(e instanceof Image)return await Qe._awaitImageLoad(e),e;if(e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGImageElement||"OffscreenCanvas"in window&&e instanceof OffscreenCanvas||"ImageBitmap"in window&&e instanceof ImageBitmap)return e;if(e instanceof File||e instanceof Blob||e instanceof URL||typeof e=="string"){let n=new Image;n.src=e instanceof File||e instanceof Blob?URL.createObjectURL(e):e.toString();try{return await Qe._awaitImageLoad(n),n}finally{(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((n,r)=>{let o=i=>{e.removeEventListener("load",o),e.removeEventListener("error",o),i instanceof ErrorEvent?r("Image load error"):n()};e.addEventListener("load",o),e.addEventListener("error",o)})}static async _postWorkerMessage(e,n,r,o){return Qe._postWorkerMessageSync(await e,n,r,o)}static _postWorkerMessageSync(e,n,r,o){if(!(e instanceof Worker))return-1;let i=Qe._workerMessageId++;return e.postMessage({id:i,type:n,data:r},o),i}}Qe.DEFAULT_CANVAS_SIZE=400,Qe.NO_QR_CODE_FOUND="No QR code found",Qe._disableBarcodeDetector=!1,Qe._workerMessageId=0;function wT({onScan:t}){const{cameraFacingMode:e}=an(),[n,r]=x.useState(e),o=x.useRef(),i=x.useRef(null),[a,s]=x.useState(!0),c=d=>{t(d==null?void 0:d.data)},u=d=>{};return x.useEffect(()=>{var d;return i!=null&&i.current&&!o.current&&(o.current=new Qe(i==null?void 0:i.current,c,{onDecodeError:u,preferredCamera:n}),(d=o==null?void 0:o.current)==null||d.start().then(()=>s(!0)).catch(h=>{h&&s(!1)})),()=>{var h;i!=null&&i.current||(h=o==null?void 0:o.current)==null||h.stop()}},[]),x.useEffect(()=>{a||alert("Camera is blocked or not accessible. Please allow camera in your browser permissions and reload.")},[a]),v.jsxs("div",{className:"relative",children:[v.jsx("video",{className:"max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover",ref:i}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>{var h;const d=n===Vn.USER?Vn.ENVIRONMENT:Vn.USER;r(d),(h=o==null?void 0:o.current)==null||h.setCamera(d)},children:v.jsx("img",{src:yf,alt:"camera-switch"})})]})}function aa({data:t,dataSetter:e,setDefer:n,label:r=""}){const o=x.useRef(null),i=mS(),[a,s]=Rb()??[0,0],{subscribe:c,unsubscribe:u}=Oa(),{cameraService:d}=an(),h=p=>{e(p)};x.useEffect(()=>{s&&s<=332&&o.current&&o.current.scrollIntoView({behavior:"smooth",block:"end"});const p=l=>{e(l.detail.code)};return c("onCodeScan",p),()=>{u("onCodeScan",p)}},[s]);const f=()=>{switch(+d){case 1:return v.jsx(c2,{onScan:h});case 2:return v.jsx(wT,{onScan:h});case 3:return v.jsx(vT,{onScan:h});default:return v.jsx(c2,{onScan:h})}};return v.jsxs("div",{ref:o,children:[!!i.length&&v.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[f(),v.jsx("hr",{})]}),v.jsx(Yo,{label:r,value:t,autoFocus:!0,placeholder:"CDE2341S",onChange:p=>{n&&n(!0),e(p.target.value)}})]})}function bT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=()=>{u(!0),h.get(`${n}/check-code/${o}`).then(p=>{if(p.data.identifier)return d(`identifier/${p.data.identifier.value}`);if(p.data.voucher)return d(`voucher/${p.data.voucher.code}`);if(p.data.giftcard)return d(`giftcard/${p.data.giftcard.hash}`);e(t("unknownCode",{code:o}))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{o&&!a&&f()},[o]),v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"code"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:f,children:v.jsx(aa,{data:o,dataSetter:i,setDefer:s,label:t("contactIdentifier")})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(rt,{label:t("continue"),onClick:f,pending:c}),r.inputData.enable_email_identification&&v.jsx(rt,{label:t("useEmail"),variant:"secondary",onClick:()=>d("email")})]})})]})})}function ET(){const{hash:t}=Yr();return v.jsx(dr,{to:`${Le.GIFTCARD}/select/${t}`})}function CT(){const{identifierValue:t}=Yr(),{errorToast:e}=Vt(),{uuid:n,mutate:r}=je(),{onContactLink:o}=an(),[i,a]=x.useState(!1),s=Dt(),c=d=>s.get(`${n}/contacts`,{contact_uuid:d}),u=()=>{s.put(n,{contact_identifier_value:t}).then(d=>{o&&c(d.data.data.contact.uuid).then(h=>{o==null||o(h.data.data)}),r().then(()=>a(!0))}).catch(e)};return x.useEffect(()=>{u()},[]),i?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):v.jsx(_r,{})}function K2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/vouchers/${t}`,onData:r});return{voucher:n,isLoading:o,pending:i,mutate:a}}function _T(){const{t}=Ue(),{code:e}=Yr(),{voucher:n}=K2(e),{portalSession:r}=je(),[o,i]=x.useState(!1),[a,s]=x.useState(!1),c=zt(),u=()=>{n!=null&&n.contact||r.contact?i(!0):s(!0)};return x.useEffect(()=>{n&&u()},[n]),n?v.jsxs(v.Fragment,{children:[o?v.jsx(dr,{to:`${Le.VOUCHER}/${n.code}/redeem`}):v.jsx(_r,{}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:a,onClose:()=>s(!1),primaryAction:{label:t("linkToContact"),action:()=>c(`${Le.VOUCHER}/${n.code}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>s(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:n.code})})})]}):v.jsx(_r,{})}function Au({redirectRoute:t}){const{state:e}=er(),{t:n}=Ue(),{errorToast:r}=Vt(),{onContactLink:o}=an(),{portalSession:i,mutate:a}=je(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt(),m=b=>g.get(`${i.uuid}/contacts`,{contact_uuid:b}),y=()=>{h(!0),g.put(i.uuid,{email:c}).then(b=>{o&&m(b.data.data.contact.uuid).then(E=>{o==null||o(E.data.data)}),a().then(()=>l(t))}).catch(b=>{b.response.data.code===Ws.CONTACT_NOT_FOUND&&p(!0)}).finally(()=>h(!1))},w=()=>{h(!0),g.post(`${i.uuid}/contacts`,{email:c}).then(y).catch(r).finally(()=>h(!1))};return x.useEffect(()=>{s("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n("fillInXBelow",{x:n("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>c&&!d&&y(),children:v.jsx(Yo,{id:"via-email-address-input",label:n("emailAddress"),autoFocus:!0,onChange:b=>u(b.target.value),beforeIcon:"mail"})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(rt,{label:n("continue"),className:"w-full",onClick:y,disabled:!c,pending:d}),v.jsx(rt,{label:n("useIdentifier"),variant:"secondary",onClick:()=>l("../identifier",{state:e})})]})})]})}),v.jsx(Eo,{title:`${n("new")} ${n("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:n("confirm"),action:w,disabled:d},secondaryAction:{label:n("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:n("continueWithEmail",{email:c})})})]})}function AT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/*",element:v.jsx(bT,{})}),v.jsx(Ye,{path:"/giftcard/:hash",element:v.jsx(ET,{})}),v.jsx(Ye,{path:"/identifier/:identifierValue",element:v.jsx(CT,{})}),v.jsx(Ye,{path:"/voucher/:code",element:v.jsx(_T,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.PORTAL})})]})}const ST={[Kt.GIFTCARD]:`${Le.GIFTCARD}/select`,[Kt.REDEEM_GIFTCARD]:`${Le.GIFTCARD}/redeem`,[Kt.TOP_UP_GIFTCARD]:`${Le.GIFTCARD}/top-up`};function IT(){const{t}=Ue(),{portalSession:e}=je(),{errorToast:n}=Vt(),[r,o]=x.useState(""),[i,a]=x.useState(!1),[s,c]=x.useState(!1),u=Dt(),d=zt(),h=()=>{a(!0),u.get(`${e.uuid}/giftcards/${r}`).then(f=>{const p=e.type;d(`${ST[p]}/${f.data.data.hash}`)}).catch(f=>{n(f),o("")}).finally(()=>a(!1))};return x.useEffect(()=>{!s&&r&&h()},[r]),v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanGiftcard")})})}),v.jsx(kt,{children:v.jsx(aa,{data:r,dataSetter:o,setDefer:c,label:t("hash")})}),v.jsx(nn,{children:v.jsx(rt,{label:t("submit"),className:"w-full",onClick:h,disabled:!r,pending:i})})]})})}function TT(){const{t}=Ue(),{hash:e}=Yr(),n=zt();return v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("chooseType")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(rt,{className:"grow",label:t("redeem"),onClick:()=>n(`${Le.GIFTCARD}/redeem/${e}`)}),v.jsx(rt,{className:"grow",label:t("topUp"),onClick:()=>n(`${Le.GIFTCARD}/top-up/${e}`)})]})})]})})}function z2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/giftcards/${t}`,onData:r});return{giftcard:n,isLoading:o,pending:i,mutate:a}}function ws(){const{mutate:t}=je();return{get:()=>t().then(r=>r.data.data.events),post:()=>{t().then(r=>{r3(r.data.data.events)})}}}function xT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{onUseGiftcard:s}=an(),{post:c}=ws(),[u]=x.useState(i.results.remaining_amount?+i.results.remaining_amount:+i.inputData.amount_in_cents),[d,h]=x.useState(!1),f=i.inputData.allow_multiple_giftcards??!0,p=zt(),l=Dt(),g=()=>{h(!0),l.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:-m()}).then(E=>{o(),a(),c(),s==null||s(E.data.data)}).catch(e).finally(()=>h(!1))},m=()=>Math.min(y(),r.amount_in_cents),y=()=>i.results.remaining_amount??i.inputData.amount_in_cents,w=()=>{let E=0;return i.events.filter(I=>I.type===yo.GIFTCARD_TRANSACTION).forEach(I=>{I.data.giftcard.uuid===r.uuid&&(E+=I.data.amount_in_cents)}),E},b=()=>{if(m())return{label:t("confirmAndPay",{amount:Si(m(),i.currency)}),onClick:g};if(f&&y())return{label:t("useAnotherGiftcard"),onClick:()=>p(Le.GIFTCARD),variant:"secondary"}};return r?v.jsx(In,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:`${t("giftcard")} ${r.hash}`})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("balance")}),v.jsx(bo,{value:r.amount_in_cents,start:r.amount_in_cents-w(),currency:i.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u+w(),start:u,currency:i.currency,asCurrency:!0})})]})})]})}),b()&&v.jsx(nn,{children:v.jsx(rt,{label:"",className:"w-full",...b(),pending:d})})]})}):v.jsx(_r,{})}function OT({value:t,valueSetter:e,enabled:n}){const[r,o]=x.useState(!1),i=x.useRef(null),a=x.useRef(null);x.useEffect(()=>{u(t?t.toString():"")},[]);const s=d=>{e(d?parseInt(d):0),u(d)},c=d=>{const{key:h}=d;if(t===0&&!/^[1-9]$/.test(h)||t!==0&&!/^[0-9]$/.test(h)&&h!=="Backspace")return;let f;if(h!=="Backspace")f=parseInt(t===0?h:`${t}${h}`);else{const p=t.toString().slice(0,-1);f=p.length?parseInt(p,10):0}e(f),u(f?f.toString():"")},u=d=>{a&&a.current&&(d?a.current.style.width=`${Math.max(d.length,3)*3}rem`:a.current.style.width="calc(3rem + 14px)")};return v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:a,className:"h-full w-[65px] rounded border-gray-200 border-transparent text-5xl [appearance:textfield] focus:border-transparent focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",type:"number",pattern:"[0-9]*",inputMode:"numeric",placeholder:"0",autoFocus:!0,value:t?(t/100).toFixed(2):"",onKeyDown:c,onChange:()=>{},onFocus:()=>o(!0),onBlur:()=>o(!1)}),n&&v.jsx("div",{className:`mobile:hidden bottom-2 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!r&&"hidden"} absolute`,children:v.jsx(fp,{keyboardRef:i,layout:{default:["1 2 3","4 5 6","7 8 9","00 0 {bksp}"]},theme:"hg-theme-default hg-layout-numeric numeric-theme",onChange:s})})]})}function X2({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),[a,s]=x.useState(0),{portalSession:c}=je(),u=()=>{let d=0;return c.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d};return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e??0,start:e??0,currency:c.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsx("div",{className:"flex items-center justify-center gap-1 p-4 text-5xl font-bold",children:u()?v.jsx(bo,{value:0,start:a,currency:c.currency,asCurrency:!0}):v.jsxs("div",{className:"flex items-center justify-center gap-1 ",children:[v.jsx("p",{children:n3(c.currency)}),v.jsx(OT,{value:a,valueSetter:s,enabled:c.inputData.enable_on_screen_keyboard})]})})})]})}),v.jsx(nn,{children:v.jsx(rt,{label:i("confirmAndPay",{amount:Si(a,c.currency)}),className:"w-full",onClick:r&&(()=>r(a)),disabled:!a||!!u(),pending:o})})]})}function PT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{post:s}=ws(),{onUseGiftcard:c}=an(),[u,d]=x.useState(!1),h=Dt(),f=p=>{d(!0),h.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:p}).then(l=>{o(),a(),s(),c==null||c(l.data.data),Ct.success(`${t("transactionSuccessful")}! ${t("totalUpgradedAmount")}: ${Si(l.data.data.amount_in_cents,i.currency)}`)}).catch(e).finally(()=>d(!1))};return r?v.jsx(In,{children:v.jsx(X2,{title:`${t("giftcard")} ${r.hash}`,balance:r.amount_in_cents,transaction:f,pending:u})}):v.jsx(_r,{})}function kT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(IT,{})}),v.jsx(Ye,{path:"/select/:hash",element:v.jsx(TT,{})}),v.jsx(Ye,{path:"/redeem/:hash",element:v.jsx(xT,{})}),v.jsx(Ye,{path:"/top-up/:hash",element:v.jsx(PT,{})})]})}class Df{constructor(){Qn(this,"uuid");Qn(this,"email");Qn(this,"credit_balance");Qn(this,"prepaid_balance");Qn(this,"current_display_values")}getDisplayName(){return this.current_display_values.firstname||this.current_display_values.lastname?`${this.current_display_values.firstname} ${this.current_display_values.lastname}`:this.current_display_values.email}}const Q2=x.createContext({contact:new Df,mutate:async()=>{}});function Mf({children:t}){const{uuid:e}=je(),[n,r]=x.useState(new Df),{mutate:o}=cr({url:`${e}/contacts`,onData:a=>{const s=new Df;s.uuid=a.uuid,s.email=a.email,s.credit_balance=a.credit_balance,s.prepaid_balance=a.prepaid_balance,s.current_display_values=a.current_display_values,r(s)}}),i=x.useMemo(()=>({contact:n,mutate:o}),[n,o]);return n.uuid?v.jsx(Q2.Provider,{value:i,children:t}):v.jsx(_r,{})}function ar(){const t=x.useContext(Q2);if(!t)throw new Error("Only use 'useContactContext' within a ContactProvider");return t}function Su({message:t=""}){return v.jsxs("div",{className:"flex items-center justify-center gap-4 text-core-primary-500",children:[v.jsx(Al,{className:"h-[32px] w-[32px]"}),t&&v.jsx("p",{className:"text-sm",children:t})]})}function BT(){const{t}=Ue(),{errorToast:e}=Vt(),{contact:n,mutate:r}=ar(),{uuid:o,portalSession:i,mutate:a}=je(),s=Dt(),c=()=>{s.post(`${o}/credit-receptions/create`,{unit_value:i.inputData.amount_in_cents/100}).then(()=>{r(),a()}).catch(e)},u=()=>{const d=i.events.filter(h=>h.type===yo.CREDIT_RECEPTION);return d.length?d[0]:null};return x.useEffect(()=>{u()||c()},[]),v.jsx(In,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n.getDisplayName()})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsx("div",{className:"flex h-full flex-col items-center gap-2 p-6",children:i.inputData.amount_in_cents?v.jsx("div",{className:"flex h-full items-center justify-center gap-1 text-4xl font-bold",children:u()?v.jsxs(v.Fragment,{children:["+",v.jsx(bo,{value:u().data.credits,start:0})]}):v.jsx(Su,{})}):v.jsx("p",{className:"text-core-red-500",children:t("xIsRequired",{x:"Amount in cents"})+"."})}),v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:`${t("new")} ${t("balance").toLowerCase()}`}),v.jsx(bo,{value:n.credit_balance.balance??0,start:n.credit_balance.balance-(u()?u().data.credits:0)})]})})]})})]})})}function NT(){const{portalSession:t}=je();return t.contact?v.jsx(Mf,{children:v.jsx(BT,{})}):t.inputData.primary_identification_method&&t.inputData.primary_identification_method===Ci.EMAIL?v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/email`}):v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/identifier`})}function Lf({redirectRoute:t}){const{t:e}=Ue(),{state:n}=er(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=an(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt();x.useEffect(()=>{!d&&a&&l()},[a]);const l=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&g(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(t,{state:{contactIdentifier:a}}))}).catch(()=>f("link",{state:{contactIdentifier:a}})).finally(()=>u(!1))},g=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m});return v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>a&&l(),children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:e("contactIdentifier")})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(rt,{label:e("continue"),onClick:l,disabled:!a,pending:c}),r.inputData.enable_email_identification&&v.jsx(rt,{label:e("useEmail"),variant:"secondary",onClick:()=>f("../email",{state:n})})]})})]})})}function Ff({redirectRoute:t}){const{t:e}=Ue(),{errorToast:n}=Vt(),{uuid:r,mutate:o}=je(),{onContactLink:i}=an(),{state:a}=er(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt();if(!a||!a.contactIdentifier)return v.jsx(dr,{to:"../"});const m=()=>{h(!0),g.post(`${r}/contacts/link-identifier`,{contact_identifier_value:a.contactIdentifier,email:c}).then(w).catch(E=>{E.response.data.code===Ws.CONTACT_NOT_FOUND?p(!0):n(E)}).finally(()=>h(!1))},y=()=>{h(!0),g.post(`${r}/contacts`,{email:c}).then(m).catch(n).finally(()=>h(!1))},w=()=>{g.put(r,{email:c}).then(E=>{i&&b(E.data.data.contact.uuid).then(C=>{i==null||i(C.data.data)}),o().then(()=>l(t))}).catch(n).finally(()=>h(!1))},b=E=>g.get(`${r}/contacts`,{contact_uuid:E});return x.useEffect(()=>{s("openKeyboard",{inputId:"new-contact-identifier-input",inputValue:""})},[]),v.jsxs(In,{children:[v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:e("linkContact")})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Ob,{body:e("noEmailAddressLinkedToIdentifier")}),v.jsx(si,{onSubmit:m,children:v.jsx(Yo,{id:"new-contact-identifier-input",label:e("emailAddress"),autoFocus:!0,onChange:E=>u(E.target.value),beforeIcon:"mail"})})]})}),v.jsx(nn,{children:v.jsx(rt,{label:e("continue"),className:"w-full",onClick:m,disabled:!c||d})})]}),v.jsx(Eo,{title:`${e("new")} ${e("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:e("confirm"),action:y,loading:d},secondaryAction:{label:e("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:e("continueWithEmail",{email:c})})})]})}function RT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(NT,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.POINTS_TRANSACTION})})]})}function DT(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=an();return t.contact?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PORTAL}/email`}):v.jsx(dr,{to:`${Le.PORTAL}/identifier`})}function MT({children:t}){return v.jsx("div",{className:"h-screen w-screen pb-[70px] md:px-4 md:pb-[86px] md:pt-4 lg:pb-4 lg:pt-[66px]",children:v.jsx("div",{className:"h-full max-h-full",children:t})})}function LT({contact:t}){const{t:e}=Ue(),n=zt();return v.jsxs("div",{className:"inline-grid w-full items-center gap-4 py-4 lg:grid-cols-2",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Dl,{src:t.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsx("p",{className:"text-lg",children:t.getDisplayName()}),t.current_display_values.tier&&v.jsx(Ml,{label:t.current_display_values.tier,size:"sm",stroke:!0})]}),v.jsx("p",{className:"text-sm text-core-gray-500 ",children:e("joinedAtDate",{date:new Date(t.current_display_values.created_at).toLocaleDateString(tn.language,{month:"long",year:"numeric"})})})]})]}),v.jsxs("div",{className:"inline-grid gap-2 lg:grid-cols-2",children:[v.jsx(rt,{label:e("goToX",{x:"identifiers"}),variant:"secondary",size:"md",onClick:()=>n("contact-identifiers")}),v.jsx(rt,{before:v.jsx(vn,{icon:"edit"}),label:e("editProfile"),variant:"secondary",size:"md",onClick:()=>n("contact-attributes")})]})]})}function bs({children:t}){return v.jsx("div",{className:"flex-grow rounded-lg border p-4",children:t})}function FT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex gap-2 lg:flex-col",children:[v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:e.current_display_values.loyalty_balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})}),v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:Si(e.prepaid_balance.balance_in_cents,n.currency)}),v.jsx("p",{className:"text-sm text-core-gray-500",children:t("prepaidCredit")})]})})]})}function jT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je(),r=(o,i)=>R1(o,i)?`${R1(o,i)} ${t("yearsAgo")}`:N1(o,i)?`${N1(o,i)} ${t("weeksAgo")}`:B1(o,i)?`${B1(o,i)} ${t("daysAgo")}`:t("today");return v.jsx(bs,{children:v.jsxs("div",{className:"h-full justify-between",children:[v.jsx("p",{className:"mb-4 text-lg font-semibold leading-7",children:t("stats")}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vn,{icon:"calendar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:r(new Date,new Date(e.current_display_values.loyalty_last_transaction_date))}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("lastVisit")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vn,{icon:"shopping-bag"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_number_of_transactions} ${t("visits")}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalVisits")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vn,{icon:"dollar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_total_credits_received} ${n.loyaltyProgram.custom_credit_name}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalCredits")})]})]})]})]})})}function J2(){const{uuid:t}=je(),[e,n]=x.useState([]),{data:r,isLoading:o,pending:i,mutate:a}=cr({url:`${t}/loyalty-transactions`});return x.useEffect(()=>{r&&n(r.data)},[r]),{loyaltyTransactions:e,isLoading:o,pending:i,mutate:a}}function Z2({loyaltyTransaction:t}){const{t:e}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs text-core-gray-500",children:t.type===v1.CREDIT_RECEPTION?e("transaction"):`${e("isRedeemed")} '${t.loyalty_transaction_data.title}'`}),v.jsx("p",{className:"text-xs font-semibold",children:t.credits>0?"+"+t.credits:t.credits})]})}function VT(){const{t}=Ue(),e=zt(),{loyaltyTransactions:n}=J2();return n?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("activities")}),n&&n.length?v.jsx("div",{children:n.slice(0,5).map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))}):v.jsx("p",{className:"text-sm text-core-gray-500",children:t("noActivity")})]}),v.jsx(rt,{label:`${t("all")} ${t("activities").toLowerCase()}`,variant:"secondary",onClick:()=>e("activity")})]})}):v.jsx(Su,{})}function ey(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/subscriptions/contact`,onData:n});return{subscriptions:e,isLoading:r,pending:o,mutate:i}}function ty({subscription:t,onChange:e,editable:n=!1}){const{t:r}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs font-semibold",children:t.subscription_type.name}),n?v.jsx(gd,{defaultChecked:t.is_subscribed,disabled:t.subscription_type.strategy===w1.FUNCTIONAL,onChange:e&&(()=>e(t.subscription_type.name))}):v.jsx(Ml,{label:r(t.status.toLowerCase()),size:"sm",color:t.is_subscribed?"primary":"gray"})]})}function UT(){const{t}=Ue(),{subscriptions:e}=ey(),n=zt();return e?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("subscriptions")}),v.jsx("div",{children:e.map(r=>v.jsx(ty,{subscription:r},r.subscription_type.uuid))})]}),v.jsx(rt,{label:t("change"),before:v.jsx(vn,{icon:"edit"}),variant:"secondary",onClick:()=>n("subscriptions")})]})}):v.jsx(Su,{})}function GT(){const{contact:t}=ar();return v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(LT,{contact:t})}),v.jsx(kt,{children:v.jsxs("div",{className:"grid grid-cols-1 gap-x-2 gap-y-2 lg:grid-cols-4",children:[v.jsx(FT,{}),v.jsx(jT,{}),v.jsx(VT,{}),v.jsx(UT,{})]})})]})}function Es({label:t,path:e}){const n=zt();return v.jsx("div",{className:"flex h-16 items-center text-base text-core-gray-900",children:v.jsx(rt,{label:t,variant:"link-gray",before:v.jsx(vn,{icon:"caret-left",size:"md"}),onClick:()=>n(e)})})}function qT(){const{t}=Ue(),{loyaltyTransactions:e}=J2(),{contact:n}=ar();return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsx("p",{className:"text-sm font-medium",children:t("allActivities")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("checkOutAllActivitiesOfName",{name:n.getDisplayName()})}),v.jsx("div",{className:"overflow-auto",children:e==null?void 0:e.map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))})]})})]})})}function HT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{subscriptions:r,mutate:o}=ey(),[i,a]=x.useState({}),[s,c]=x.useState(!1),u=Dt();x.useEffect(()=>{if(r&&!Object.keys(i).length){const p=r.reduce((l,g)=>({...l,[g.subscription_type.name]:g.is_subscribed}),{});a(p)}},[]);const d=p=>{Object.hasOwn(i,p)?a({...i,[p]:!i[p]}):a({...i,[p]:!0})},h=()=>{c(!0),u.put(`${n}/subscriptions`,{values:i}).then(()=>o()).catch(e).finally(()=>c(!1))},f=()=>r&&r.some(p=>i[p.subscription_type.name]!==p.is_subscribed);return r?v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("subscriptions")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("manageEmailPreferences")}),r.map(p=>v.jsx(ty,{subscription:p,onChange:d,editable:!0},p.subscription_type.uuid))]})})}),v.jsx(nn,{children:v.jsx(rt,{label:t("saveChanges"),className:"w-full",onClick:h,pending:s,disabled:!f()||s})})]})}):v.jsx(Su,{})}function $T(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r,mutate:o}=ar(),[i,a]=x.useState(),[s,c]=x.useState(!1),[u,d]=x.useState(),h=Dt();cr({url:`${n}/contact-attributes`,onData:g=>a(g.elements)});const f=g=>{d({...u,[g.target.name]:g.target.value})},p=(g,m)=>{d({...u,[g]:m})},l=async()=>{c(!0),h.put(`${n}/contact-attributes`,u).then(()=>{o(),d(void 0)}).catch(e).finally(()=>c(!1))};return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsxs("div",{className:"mb-4 flex flex-row items-center gap-4 border-b border-b-core-gray-200 px-1 pb-4",children:[v.jsx(Dl,{src:r.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{children:[v.jsx("div",{className:"flex flex-row items-center gap-2 ",children:v.jsxs("h1",{className:"text-lg text-core-gray-900",children:[r.current_display_values.firstname," ",r.current_display_values.lastname]})}),v.jsx("p",{className:"text-sm text-core-gray-500",children:r.current_display_values.email})]})]}),i?i.map(g=>{if(!(g.type==="media_upload"||g.type==="email"))return g.type==="select"?v.jsx(qb,{name:g.name,label:g.label,value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],onChange:m=>p(g.name,m),disabled:g.disabled,children:g.options.map(m=>v.jsx(Fl,{label:m.label,value:m.value},m.value))},g.id):g.type==="multi_select"?v.jsx(jb,{name:g.name,value:u&&u[g.name]?u[g.name]:g.defaultValue,label:g.label,onChange:p,disabled:g.disabled,options:g.options},g.id):g.type==="birth_date"||g.type==="date_time"?v.jsx(pp,{id:g.id,name:g.name,label:g.label,type:g.type==="date_time"?"date_time":"date",value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],disabled:g.disabled,onChange:f},g.id):v.jsx(Yo,{disabled:g.disabled,label:g.label,name:g.name,value:u&&u[g.name]!=="undefined"?u[g.name]:r.current_display_values[g.name],onChange:f},g.id)}):v.jsx(Tc,{rows:10})]})}),v.jsx(nn,{children:v.jsx(rt,{label:t("saveChanges"),className:"w-full",onClick:l,disabled:!u,pending:s})})]})})}function ny(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/contact-identifiers`,onData:n});return{contactIdentifiers:e,isLoading:r,pending:o,mutate:i}}function YT({identifier:t,onClear:e}){const{t:n}=Ue();return v.jsxs("div",{className:"flex items-center justify-between rounded-lg border text-xs",children:[v.jsxs("div",{className:"flex-col pl-4",children:[v.jsx("p",{className:"font-semibold",children:t.value}),v.jsx("p",{className:"text-core-gray-500",children:n("contactIdentifier")})]}),v.jsx("div",{className:"h-full border-l p-4 hover:cursor-pointer hover:bg-core-gray-50",onClick:()=>e&&e(t.value),children:v.jsx(vn,{className:"h-full",icon:"close"})})]})}function WT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contactIdentifiers:r,isLoading:o,mutate:i}=ny(),[a,s]=x.useState(""),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=l=>{s(l),u(!0)},p=async()=>{h.destroy(`${n}/contact-identifiers`,{value:a}).then(()=>i()).catch(e).finally(()=>u(!1))};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("contactIdentifiers")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("contactIdentifierDescription")})]}),o?v.jsx(Tc,{rows:10}):r==null?void 0:r.map(l=>v.jsx(YT,{identifier:l,onClear:f},l.value))]})})}),v.jsx(nn,{children:v.jsx(rt,{label:t("addIdentifier"),className:"w-full",variant:"secondary",onClick:()=>d("create")})})]}),v.jsx(Eo,{title:t("confirmClearContactIdentifier"),isOpen:c,primaryAction:{label:t("confirm"),action:p},secondaryAction:{label:t("cancel"),action:()=>u(!1)},onClose:()=>u(!1),children:v.jsx("p",{children:t("clearContactIdentifier",{value:a})})})]})}function KT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r}=ar(),{mutate:o}=ny(),[i,a]=x.useState(""),[s,c]=x.useState(!1),[u,d]=x.useState(!1),h=zt(),f=Dt(),p=()=>{c(!0),f.post(`${n}/contacts/link-identifier`,{contact_identifier_value:i,email:r.email}).then(()=>{o(),h("../profile/contact-identifiers")}).catch(e).finally(()=>{a(""),c(!1)})};return x.useEffect(()=>{!u&&i&&p()},[i]),v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile/contact-identifiers"})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>i&&p(),children:v.jsx(aa,{data:i,dataSetter:a,setDefer:d,label:t("contactIdentifier")})})}),v.jsx(nn,{children:v.jsx(rt,{label:t("addIdentifier"),className:"w-full",onClick:p,pending:s,disabled:!i})})]})})}function zT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/profile",element:v.jsx(GT,{})}),v.jsx(Ye,{path:"/profile/activity",element:v.jsx(qT,{})}),v.jsx(Ye,{path:"/profile/subscriptions",element:v.jsx(HT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers",element:v.jsx(WT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers/create",element:v.jsx(KT,{})}),v.jsx(Ye,{path:"/profile/contact-attributes",element:v.jsx($T,{})})]})}function XT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex h-16 items-center justify-between",children:[v.jsx("h1",{children:t("rewards")}),v.jsxs("div",{className:"flex flex-col items-center",children:[v.jsx("p",{children:e.credit_balance.balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})]})}function ry(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/rewards`,onData:n});return{rewards:e,isLoading:r,pending:o,mutate:i}}function jf({reward:t,selected:e,setSelected:n,disabled:r,readOnly:o}){const{portalSession:i}=je(),{contact:a}=ar();return v.jsxs("div",{className:`max-h-[48px] rounded-lg border ${r?"pointer-events-none opacity-40":!o&&"cursor-pointer"}`,children:[v.jsxs("div",{className:`flex items-center justify-between rounded-lg text-xs ${r?"px-2 pt-2":"p-2"}`,onClick:o?void 0:()=>(e==null?void 0:e.uuid)===t.uuid?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.media&&t.media.value?t.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:t.title??t.description})]}),v.jsxs("p",{className:"whitespace-nowrap text-core-primary-500",children:[t.required_credits," ",i.loyaltyProgram.custom_credit_name]})]}),t.required_credits-a.credit_balance.balance>0&&v.jsx(Vb,{value:a.credit_balance.balance,max:t.required_credits})]})}function QT({selected:t,setSelected:e}){const{t:n}=Ue(),{contact:r}=ar(),{rewards:o,isLoading:i}=ry(),a=o==null?void 0:o.filter(c=>c.required_credits<=r.credit_balance.balance),s=o==null?void 0:o.filter(c=>c.required_credits>r.credit_balance.balance);return v.jsx(v.Fragment,{children:i?v.jsx(Tc,{rows:1}):v.jsxs("div",{className:"flex flex-col gap-3 md:max-h-[528px]",children:[v.jsx("div",{className:"flex flex-col gap-1",children:(a==null?void 0:a.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("redeemableRewards")}),a.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e},c.uuid))]})}),v.jsx("div",{className:"flex flex-col gap-1",children:(s==null?void 0:s.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("saveABitMore")}),s.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e,disabled:!0},c.uuid))]})})]})})}function JT(){const{portalSession:t}=je(),{rewards:e}=ry(),n=()=>t.events.filter(r=>r.type===yo.REWARD_RECEPTION).map(r=>e.find(o=>o.uuid===r.data.reward.uuid)).filter(r=>r);return e?v.jsx("div",{children:v.jsx(y0,{children:n().map((r,o)=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-core-primary-100 bg-core-primary-50 p-2 text-xs",children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:r.media&&r.media.value?r.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-8 w-8 rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:r.title??r.description})]}),v.jsxs("p",{className:"text-core-primary-500",children:[r.required_credits," ",t.loyaltyProgram.custom_credit_name]})]},`${o}-${r.uuid}`))},n().length)}):v.jsx(v.Fragment,{})}function ZT(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{portalSession:r,mutate:o}=je(),{mutate:i}=ar(),{onClaimReward:a}=an(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),{post:p}=ws(),l=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const g=y=>{o().then(w=>{const E=w.data.data.events.filter(C=>C.type===yo.REWARD_RECEPTION&&C.data.reward.uuid===s.uuid).reduce((C,I)=>new Date(C.created_at)>new Date(I.created_at)?C:I);a==null||a(y,E.data.uuid)})},m=()=>{d(!0),l.post(`${r.uuid}/rewards/claim`,{uuid:s.uuid}).then(y=>{p(),i(),g(y.data.data),n(t("rewardClaimed",{name:y.data.data.title}))}).catch(e).finally(()=>{f(!1),c(void 0),d(!1)})};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(XT,{})}),v.jsx(kt,{children:v.jsx(QT,{selected:s,setSelected:c})}),v.jsx(nn,{children:v.jsx(JT,{})})]}),v.jsx(Eo,{title:t("confirmRewardRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:m,loading:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},onClose:()=>f(!1),children:v.jsx("div",{className:"flex flex-col gap-4",children:s&&v.jsx(jf,{reward:s,selected:s,setSelected:c,readOnly:!0})})})]})}function Vf(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/vouchers`,onData:n});return{vouchers:e,isLoading:r,pending:o,mutate:i}}function ex(){const{t}=Ue();return v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("vouchers")})})}function Uf({voucher:t,selected:e,setSelected:n}){const{t:r}=Ue();return v.jsxs("div",{className:`flex cursor-pointer items-center justify-between gap-4 rounded-lg ${t.status===Ea.REDEEMED?"border border-core-primary-100 bg-core-primary-50":"border bg-white"} p-2 text-xs`,onClick:()=>(e==null?void 0:e.code)===t.code?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.promotion.image?t.promotion.image.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsxs("div",{className:"overflow-hidden overflow-ellipsis ",children:[v.jsx("p",{className:"font-semibold",children:t.name}),t.status===Ea.REDEEMED?v.jsx("p",{className:"text-core-gray-500",children:r("redeemed")}):v.jsx("p",{className:"text-core-primary-500",children:t.expiration_date?`Valid until ${new Date(t.expiration_date).toLocaleDateString()}`:r("nonExpiring")})]})]}),v.jsx("p",{className:`text-core-${t.status===Ea.REDEEMED?"gray":"primary"}-500`,children:t.code})]})}function tx({selected:t,setSelected:e}){const{t:n}=Ue(),{vouchers:r,isLoading:o}=Vf();return v.jsx(v.Fragment,{children:o?v.jsx(Tc,{rows:1}):v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:r&&r.length?r.map(i=>v.jsx(Uf,{voucher:i,selected:t,setSelected:e},i.code)):v.jsx("p",{className:"text-center text-sm text-core-gray-500",children:n("vouchersEmptyState")})})})})}function nx(){const{t}=Ue(),{portalSession:e}=je(),{vouchers:n}=Vf(),r=()=>e.events.filter(o=>o.type===yo.VOUCHER_REDEEMED);return n?v.jsx("div",{children:v.jsx(y0,{children:r().map((o,i)=>v.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-core-primary-100 bg-core-primary-50 p-2",children:v.jsx("div",{className:"flex h-full flex-col justify-between text-xs",children:v.jsxs("div",{className:"overflow-hidden",children:[v.jsx("p",{className:"font-semibold",children:o.data.name}),v.jsxs("p",{className:"overflow-ellipsis text-core-gray-500",children:[o.data.code," - ",t("applied")]})]})})},`${i}-${o.data.uuid}`))},r().length)}):v.jsx(v.Fragment,{})}function rx(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{uuid:r}=je(),{onRedeemVoucher:o}=an(),{post:i}=ws(),{mutate:a}=Vf(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const l=()=>{d(!0),p.post(`${r}/vouchers/redeem`,{code:s.code}).then(m=>{i(),o&&o(m.data.data),n(t("voucherSuccessfullyRedeemed")),a()}).catch(e).finally(()=>{g(),d(!1)})},g=()=>{f(!1),c(void 0)};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(ex,{})}),v.jsx(kt,{children:v.jsx(tx,{selected:s,setSelected:c})}),v.jsx(nn,{children:v.jsx(nx,{})})]}),v.jsx(Eo,{title:t("confirmVoucherRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:l,loading:u},secondaryAction:{label:t("cancel"),action:g},onClose:g,children:v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{children:t("redeemTitle",{title:s==null?void 0:s.name})}),s&&v.jsx(Uf,{voucher:s,setSelected:c})]})})]})}function ox(){const{t}=Ue(),[e,n]=x.useState(1),r=zt(),o=[{id:0,label:t("profile"),icon:"user",pathname:"profile"},{id:1,label:t("rewards"),icon:"edit",pathname:"rewards"},{id:2,label:t("vouchers"),icon:"mail",pathname:"vouchers"}];return x.useEffect(()=>{r(o[e].pathname)},[]),v.jsx(Mf,{children:v.jsxs("div",{className:"relative h-full w-full select-none overflow-auto",children:[v.jsx(vE,{children:o.map(i=>v.jsx(wE,{id:i.id,label:i.label,icon:i.icon,activeTab:e,setActiveTab:n,pathname:i.pathname},i.id))}),v.jsxs(MT,{children:[v.jsx(zT,{}),v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/rewards",element:v.jsx(ZT,{})}),v.jsx(Ye,{path:"/vouchers",element:v.jsx(rx,{})})]})]})]})})}function ix(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(DT,{})}),v.jsx(Ye,{path:"/overview/*",element:v.jsx(ox,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PORTAL})})]})}function oy(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/prepaid`,onData:n});return{prepaidBalance:e,isLoading:r,pending:o,mutate:i}}function ax(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=an(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(In,{children:v.jsx(X2,{title:a.getDisplayName(),balance:(c==null?void 0:c.balance_in_cents)??0,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function sx({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),{portalSession:a}=je(),s=a.inputData.amount_in_cents??0,c=()=>{let d=0;return a.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d},u=()=>Math.min(s+c(),e);return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e,start:e+c(),currency:a.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"text-sm font-light text-gray-500",children:i("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u(),start:s,currency:a.currency,asCurrency:!0})})]})})]})}),v.jsx(nn,{children:v.jsx(rt,{label:i("confirmAndPay",{amount:Si(u(),a.currency)}),className:"w-full",onClick:()=>r==null?void 0:r(-u()),disabled:!s||!!c(),pending:o})})]})}function cx(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=an(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(In,{children:v.jsx(sx,{title:a.getDisplayName(),balance:c.balance_in_cents,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function ux({setType:t}){const{t:e}=Ue();return v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("Choose type")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(rt,{className:"grow",label:e("pay"),onClick:()=>t(Kt.PAY_PREPAID)}),v.jsx(rt,{className:"grow",label:e("topUp"),onClick:()=>t(Kt.TOP_UP_PREPAID)})]})})]})})}function lx(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=an(),[n,r]=x.useState(t.type);if(!t.contact)return e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PREPAID}/email`}):v.jsx(dr,{to:`${Le.PREPAID}/identifier`});const o=()=>n===Kt.TOP_UP_PREPAID?v.jsx(ax,{}):n===Kt.PAY_PREPAID?v.jsx(cx,{}):v.jsx(ux,{setType:r});return v.jsx(Mf,{children:o()})}function dx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(lx,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PREPAID})})]})}function fx(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=()=>{s(!0),p.get(`${n}/vouchers/check/${o}`).then(g=>{g.data.data.contact||r.contact?f(`${o}/redeem`):h(!0)}).catch(e).finally(()=>s(!1))};return x.useEffect(()=>{!c&&o&&l()},[o]),v.jsxs(v.Fragment,{children:[v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:t("voucherCode").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(aa,{data:o,dataSetter:i,setDefer:u,label:t("code")})}),v.jsx(nn,{children:v.jsx(rt,{label:t("submit"),className:"w-full",onClick:l,pending:a})})]})}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:d,onClose:()=>h(!1),primaryAction:{label:t("linkToContact"),action:()=>f(`${o}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>h(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:o})})})]})}function hx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{uuid:r}=je(),{onRedeemVoucher:o}=an(),{post:i}=ws(),{voucher:a,mutate:s}=K2(n),[c,u]=x.useState(!1),d=Dt(),h=()=>{u(!0),d.post(`${r}/vouchers/redeem`,{code:n}).then(f=>{o==null||o(f.data.data),i(),s()}).catch(e).finally(()=>u(!1))};return a?v.jsx(In,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:"Voucher"})})}),v.jsx(kt,{children:v.jsx("div",{children:v.jsx(Uf,{voucher:a,setSelected:()=>{}})})}),v.jsx(nn,{children:v.jsx(rt,{label:t("redeemVoucher"),className:"w-full",onClick:h,disabled:a.status!==Ea.ACTIVE||c,pending:c})})]})}):v.jsx(_r,{})}function px(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=an(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m}),g=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&l(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(`${Le.VOUCHER}/${n}/redeem`))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{!d&&a&&g()},[a]),v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:g,children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:t("contactIdentifier")})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(rt,{label:t("continue"),onClick:g,pending:c}),r.inputData.enable_email_identification&&v.jsx(rt,{label:t("useEmail"),variant:"secondary",onClick:()=>f(`../${n}/email`)})]})})]})})}function gx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{onContactLink:r}=an(),{portalSession:o,mutate:i}=je(),{publish:a}=Oa(),[s,c]=x.useState(""),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=zt(),l=Dt(),g=w=>l.get(`${o.uuid}/contacts`,{contact_uuid:w}),m=()=>{d(!0),l.put(o.uuid,{email:s}).then(w=>{r&&g(w.data.data.contact.uuid).then(b=>{r==null||r(b.data.data)}),i().then(()=>p(`${Le.VOUCHER}/${n}/redeem`))}).catch(w=>{w.response.data.code===Ws.CONTACT_NOT_FOUND&&f(!0)}).finally(()=>d(!1))},y=()=>{d(!0),l.post(`${o.uuid}/contacts`,{email:s}).then(m).catch(e).finally(()=>d(!1))};return x.useEffect(()=>{a("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("fillInXBelow",{x:t("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>s&&!u&&m(),children:v.jsx(Yo,{id:"via-email-address-input",label:t("emailAddress"),autoFocus:!0,onChange:w=>c(w.target.value),beforeIcon:"mail"})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(rt,{label:t("continue"),className:"w-full",onClick:m,pending:u,disabled:!s||u}),v.jsx(rt,{label:t("useIdentifier"),variant:"secondary",onClick:()=>p(`../${n}/identifier`)})]})})]})}),v.jsx(Eo,{title:`${t("new")} ${t("emailAddress").toLowerCase()}`,isOpen:h,onClose:()=>f(!1),primaryAction:{label:t("confirm"),action:y,disabled:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},children:v.jsx("p",{children:t("continueWithEmail",{email:s})})})]})}function mx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(fx,{})}),v.jsx(Ye,{path:":code/redeem",element:v.jsx(hx,{})}),v.jsx(Ye,{path:":code/email",element:v.jsx(gx,{})}),v.jsx(Ye,{path:":code/identifier",element:v.jsx(px,{})})]})}function yx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx($A,{})}),v.jsx(Ye,{path:`${Le.GENERIC}/*`,element:v.jsx(AT,{})}),v.jsx(Ye,{path:`${Le.GIFTCARD}/*`,element:v.jsx(kT,{})}),v.jsx(Ye,{path:`${Le.POINTS_TRANSACTION}/*`,element:v.jsx(RT,{})}),v.jsx(Ye,{path:`${Le.PORTAL}/*`,element:v.jsx(ix,{})}),v.jsx(Ye,{path:`${Le.PREPAID}/*`,element:v.jsx(dx,{})}),v.jsx(Ye,{path:`${Le.VOUCHER}/*`,element:v.jsx(mx,{})})]})}function Gf(t){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(t)}function iy(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Gf(XMLHttpRequest))==="object"}function vx(t){return!!t&&typeof t.then=="function"}function wx(t){return vx(t)?t:Promise.resolve(t)}function bx(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qf={exports:{}},Iu={exports:{}},ay;function Ex(){return ay||(ay=1,function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wi<"u"&&wi,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s=typeof i<"u"&&i||typeof self<"u"&&self||typeof s<"u"&&s,c={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(k){return k&&d.indexOf(Object.prototype.toString.call(k))>-1};function f(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function p(k){return typeof k!="string"&&(k=String(k)),k}function l(k){var U={next:function(){var z=k.shift();return{done:z===void 0,value:z}}};return c.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(k){this.map={},k instanceof g?k.forEach(function(U,z){this.append(z,U)},this):Array.isArray(k)?k.forEach(function(U){this.append(U[0],U[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(U){this.append(U,k[U])},this)}g.prototype.append=function(k,U){k=f(k),U=p(U);var z=this.map[k];this.map[k]=z?z+", "+U:U},g.prototype.delete=function(k){delete this.map[f(k)]},g.prototype.get=function(k){return k=f(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(f(k))},g.prototype.set=function(k,U){this.map[f(k)]=p(U)},g.prototype.forEach=function(k,U){for(var z in this.map)this.map.hasOwnProperty(z)&&k.call(U,this.map[z],z,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(U,z){k.push(z)}),l(k)},g.prototype.values=function(){var k=[];return this.forEach(function(U){k.push(U)}),l(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(U,z){k.push([z,U])}),l(k)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function m(k){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}function y(k){return new Promise(function(U,z){k.onload=function(){U(k.result)},k.onerror=function(){z(k.error)}})}function w(k){var U=new FileReader,z=y(U);return U.readAsArrayBuffer(k),z}function b(k){var U=new FileReader,z=y(U);return U.readAsText(k),z}function E(k){for(var U=new Uint8Array(k),z=new Array(U.length),te=0;te<U.length;te++)z[te]=String.fromCharCode(U[te]);return z.join("")}function C(k){if(k.slice)return k.slice(0);var U=new Uint8Array(k.byteLength);return U.set(new Uint8Array(k)),U.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&u(k)?(this._bodyArrayBuffer=C(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||h(k))?this._bodyArrayBuffer=C(k):this._bodyText=k=Object.prototype.toString.call(k):this._bodyText="",this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=m(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(w)}),this.text=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(L)}),this.json=function(){return this.text().then(JSON.parse)},this}var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(k){var U=k.toUpperCase();return T.indexOf(U)>-1?U:k}function N(k,U){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var z=U.body;if(k instanceof N){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,U.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!z&&k._bodyInit!=null&&(z=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=P(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&z)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(z),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var te=/([?&])_=[^&]*/;if(te.test(this.url))this.url=this.url.replace(te,"$1_="+new Date().getTime());else{var oe=/\?/;this.url+=(oe.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function L(k){var U=new FormData;return k.trim().split("&").forEach(function(z){if(z){var te=z.split("="),oe=te.shift().replace(/\+/g," "),ne=te.join("=").replace(/\+/g," ");U.append(decodeURIComponent(oe),decodeURIComponent(ne))}}),U}function V(k){var U=new g,z=k.replace(/\r?\n[\t ]+/g," ");return z.split("\r").map(function(te){return te.indexOf(`
154
- `)===0?te.substr(1,te.length):te}).forEach(function(te){var oe=te.split(":"),ne=oe.shift().trim();if(ne){var se=oe.join(":").trim();U.append(ne,se)}}),U}I.call(N.prototype);function j(k,U){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText=U.statusText===void 0?"":""+U.statusText,this.headers=new g(U.headers),this.url=U.url||"",this._initBody(k)}I.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},j.error=function(){var k=new j(null,{status:0,statusText:""});return k.type="error",k};var W=[301,302,303,307,308];j.redirect=function(k,U){if(W.indexOf(U)===-1)throw new RangeError("Invalid status code");return new j(null,{status:U,headers:{location:k}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(U,z){this.message=U,this.name=z;var te=Error(U);this.stack=te.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function q(k,U){return new Promise(function(z,te){var oe=new N(k,U);if(oe.signal&&oe.signal.aborted)return te(new a.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function se(){ne.abort()}ne.onload=function(){var le={status:ne.status,statusText:ne.statusText,headers:V(ne.getAllResponseHeaders()||"")};le.url="responseURL"in ne?ne.responseURL:le.headers.get("X-Request-URL");var _e="response"in ne?ne.response:ne.responseText;setTimeout(function(){z(new j(_e,le))},0)},ne.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},ne.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},ne.onabort=function(){setTimeout(function(){te(new a.DOMException("Aborted","AbortError"))},0)};function we(le){try{return le===""&&s.location.href?s.location.href:le}catch{return le}}ne.open(oe.method,we(oe.url),!0),oe.credentials==="include"?ne.withCredentials=!0:oe.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&(c.blob?ne.responseType="blob":c.arrayBuffer&&oe.headers.get("Content-Type")&&oe.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(ne.responseType="arraybuffer")),U&&typeof U.headers=="object"&&!(U.headers instanceof g)?Object.getOwnPropertyNames(U.headers).forEach(function(le){ne.setRequestHeader(le,p(U.headers[le]))}):oe.headers.forEach(function(le,_e){ne.setRequestHeader(_e,le)}),oe.signal&&(oe.signal.addEventListener("abort",se),ne.onreadystatechange=function(){ne.readyState===4&&oe.signal.removeEventListener("abort",se)}),ne.send(typeof oe._bodyInit>"u"?null:oe._bodyInit)})}return q.polyfill=!0,s.fetch||(s.fetch=q,s.Headers=g,s.Request=N,s.Response=j),a.Headers=g,a.Request=N,a.Response=j,a.fetch=q,a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e}(Iu,Iu.exports)),Iu.exports}(function(t,e){var n;if(typeof fetch=="function"&&(typeof wi<"u"&&wi.fetch?n=wi.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof bx<"u"&&typeof window>"u"){var r=n||Ex();r.default&&(r=r.default),e.default=r,t.exports=e.default}})(qf,qf.exports);var sy=qf.exports;const cy=Lu(sy),uy=Zy({__proto__:null,default:cy},[sy]);function ly(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function dy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ly(Object(n),!0).forEach(function(r){Cx(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cx(t,e,n){return e=_x(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _x(t){var e=Ax(t,"string");return gi(e)=="symbol"?e:e+""}function Ax(t,e){if(gi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(gi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gi(t){"@babel/helpers - typeof";return gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gi(t)}var io;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?io=global.fetch:typeof window<"u"&&window.fetch?io=window.fetch:io=fetch);var Cs;iy()&&(typeof global<"u"&&global.XMLHttpRequest?Cs=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Cs=window.XMLHttpRequest));var Tu;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Tu=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Tu=window.ActiveXObject)),!io&&uy&&!Cs&&!Tu&&(io=cy||uy),typeof io!="function"&&(io=void 0);var Hf=function(e,n){if(n&&gi(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},fy=function(e,n,r,o){var i=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(u){r(null,{status:c.status,data:u})}).catch(r)};if(o){var a=o(e,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(i).catch(r):io(e,n).then(i).catch(r)},hy=!1,Sx=function(e,n,r,o){e.queryStringParams&&(n=Hf(n,e.queryStringParams));var i=dy({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,s=dy({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:i},hy?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{fy(n,s,o,c)}catch(u){if(!a||Object.keys(a).length===0||!u.message||u.message.indexOf("not implemented")<0)return o(u);try{Object.keys(a).forEach(function(d){delete s[d]}),fy(n,s,o,c),hy=!0}catch(d){o(d)}}},Ix=function(e,n,r,o){r&&gi(r)==="object"&&(r=Hf("",r).slice(1)),e.queryStringParams&&(n=Hf(n,e.queryStringParams));try{var i;Cs?i=new Cs:i=new Tu("MSXML2.XMLHTTP.3.0"),i.open(r?"POST":"GET",n,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(c){console&&console.log(c)}},Tx=function(e,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},io&&n.indexOf("file:")!==0)return Sx(e,n,r,o);if(iy()||typeof ActiveXObject=="function")return Ix(e,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function sa(t){"@babel/helpers - typeof";return sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(t)}function py(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function $f(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?py(Object(n),!0).forEach(function(r){gy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):py(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xx(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ox(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,my(r.key),r)}}function Px(t,e,n){return e&&Ox(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function gy(t,e,n){return e=my(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function my(t){var e=kx(t,"string");return sa(e)=="symbol"?e:e+""}function kx(t,e){if(sa(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bx=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return gy({},r,o||"")},parseLoadPayload:function(n,r){},request:Tx,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},yy=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};xx(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return Px(t,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=$f($f($f({},Bx()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);sa(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,o)),c=wx(c),c.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(d,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,c=typeof i=="string"?[i]:i,u=this.options.parseLoadPayload(s,c);this.options.request(this.options,n,u,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+n+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+n+"; status code: "+h.status,!1);if(!h&&d&&d.message&&d.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+d.message,!0);if(d)return r(d,!1);var f,p;try{typeof h.data=="string"?f=a.options.parse(h.data,o,i):f=h.data}catch{p="failed parsing "+n+" to json"}if(p)return r(p,!1);r(null,f)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,o,i),u=0,d=[],h=[];n.forEach(function(f){var p=s.options.addPath;typeof s.options.addPath=="function"&&(p=s.options.addPath(f,r));var l=s.services.interpolator.interpolate(p,{lng:f,ns:r});s.options.request(s.options,l,c,function(g,m){u+=1,d.push(g),h.push(m),u===n.length&&typeof a=="function"&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var c=[],u=function(h){var f=i.toResolveHierarchy(h);f.forEach(function(p){c.indexOf(p)<0&&c.push(p)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),c.forEach(function(d){n.allOptions.ns.forEach(function(h){o.read(d,h,"read",null,null,function(f,p){f&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),f),!f&&p&&a.log("loaded namespace ".concat(h," for language ").concat(d),p),o.loaded("".concat(d,"|").concat(h),f,p)})})})}}}])}();yy.type="backend";const{slice:Nx,forEach:Rx}=[];function Dx(t){return Rx.call(Nx.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const vy=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Mx=(t,e,n)=>{const r=n||{};r.path=r.path||"/";const o=encodeURIComponent(e);let i=`${t}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!vy.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!vy.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},wy={create(t,e,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=Mx(t,encodeURIComponent(e),o)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(e)===0)return o.substring(e.length,o.length)}return null},remove(t){this.create(t,"",-1)}};var Lx={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return wy.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=e;n&&typeof document<"u"&&wy.create(n,t,r,o,i)}},Fx={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const c=a[s].indexOf("=");c>0&&a[s].substring(0,c)===e&&(n=a[s].substring(c+1))}}return n}};let _s=null;const by=()=>{if(_s!==null)return _s;try{_s=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{_s=!1}return _s};var jx={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&by())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&by()&&window.localStorage.setItem(n,t)}};let As=null;const Ey=()=>{if(As!==null)return As;try{As=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{As=!1}return As};var Vx={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&Ey())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&Ey()&&window.sessionStorage.setItem(n,t)}},Ux={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)e.push(n[i]);r&&e.push(r),o&&e.push(o)}return e.length>0?e:void 0}},Gx={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},qx={name:"path",lookup(t){var o;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof e=="number"?e:0])==null?void 0:o.replace("/",""):void 0}},Hx={name:"subdomain",lookup(t){var o,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function $x(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class Cy{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=Dx(n,this.options||{},$x()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Lx),this.addDetector(Fx),this.addDetector(jx),this.addDetector(Vx),this.addDetector(Ux),this.addDetector(Gx),this.addDetector(qx),this.addDetector(Hx)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}Cy.type="languageDetector",tn.use(yy).use(Cy).use(x4).init({fallbackLng:"en",lng:navigator.language&&navigator.language.substring(0,2),interpolation:{escapeValue:!1},backend:{loadPath:"https://translations.piggy.eu/portal-sessions/{{lng}}.json"}});function _y(){const{uuid:t,portalSession:e}=je(),[n,r]=x.useState();return cr({url:`${t}/brand-kit`,onData:r}),x.useEffect(()=>{n&&wb(n)},[n]),v.jsx(x.StrictMode,{children:v.jsxs(qA,{children:[v.jsx(Y3,{children:v.jsx(yx,{})}),v.jsx(Lb,{enabled:e.inputData.enable_on_screen_keyboard}),v.jsx(p4,{className:"lg:top-14"})]},t)})}function Ay(t){const{uuid:e,portalSession:n,error:r}=je();return n.uuid?v.jsx(s2.Provider,{value:{...t,cameraService:n.inputData.camera_service,cameraFacingMode:n.inputData.facing_mode,primaryIdentificationMethod:n.inputData.primary_identification_method},children:t.children}):v.jsx(_r,{message:r&&`No portal session found with uuid: ${e}.`})}function Yx(t){const{portalSession:e}=o3(t);return e?v.jsx(ju.Provider,{value:{apiKey:t.apiKey,host:t.host},children:v.jsx(b1,{uuid:e.uuid,children:v.jsx(Ay,{...t,children:v.jsx(_y,{})})})}):v.jsx(_r,{})}const Wx="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.37482%209.55838C0.802045%2011.696%200.887351%2013.9567%201.61959%2016.045C2.35183%2018.1334%203.69695%2019.9524%205.47921%2021.2642C7.26146%2022.5761%209.39798%2023.3199%2011.6096%2023.3985C13.8212%2023.477%2016.0051%2022.8866%2017.876%2021.7045C19.7468%2020.5223%2021.2175%2018.8034%2022.0961%2016.7722C22.9746%2014.7411%2023.2201%2012.4921%2022.8004%2010.3193C22.3807%208.1464%2021.3154%206.15066%2019.7436%204.59277C18.1718%203.03489%2016.1667%201.98732%2013.9902%201.58693M7.14096%202.53681C5.21049%203.48732%203.60119%204.98315%202.51232%206.8391M10.7049%201.48193C10.452%201.51191%2010.2003%201.55066%209.95012%201.59811M18.1995%2015.656C18.757%2014.5927%2019.0317%2013.4039%2018.9971%2012.2038C18.9625%2011.0037%2018.6198%209.83263%2018.002%208.8032C17.3842%207.77377%2016.512%206.92055%2015.4692%206.32553C14.4264%205.73051%2013.2481%205.4137%2012.0476%205.40554C10.847%205.39739%209.66449%205.69816%208.61372%206.27895C7.56295%206.85974%206.67923%207.70104%206.04747%208.72198C5.41572%209.74292%205.05717%2010.9092%205.00628%2012.1087C4.9554%2013.3082%205.21389%2014.5007%205.75691%2015.5714M9.15764%2013.3648C9.00624%2012.9162%208.96314%2012.4382%209.03189%2011.9698C9.10064%2011.5014%209.27926%2011.0559%209.55317%2010.6697C9.82708%2010.2836%2010.1885%209.96774%2010.6079%209.74803C11.0272%209.52832%2011.4926%209.41098%2011.966%209.4056C12.4394%209.40023%2012.9074%209.50697%2013.3316%209.71709C13.7559%209.92722%2014.1244%2010.2348%2014.407%2010.6146C14.6896%2010.9944%2014.8783%2011.4358%2014.9576%2011.9025C15.037%2012.3692%2015.0048%2012.8481%2014.8636%2013.3M14.0993%2010.2622C14.0043%2010.1691%2013.9032%2010.0825%2013.7967%2010.0028M8.2478%2018.3147C9.32147%2018.9965%2010.5606%2019.3728%2011.832%2019.4033C13.1035%2019.4339%2014.3592%2019.1174%2015.4644%2018.488'%20stroke='%233430FF'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";function Kx({message:t}){return v.jsxs("div",{className:"flex h-screen flex-col justify-center gap-12 text-center",children:[v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx("img",{alt:"logo",src:Wx,className:"z-10 h-16 w-16 hover:animate-spin"}),v.jsxs("p",{className:"z-10 text-7xl font-semibold tracking-wide text-gray-600",children:["Welcome to ",v.jsx("span",{className:"italic",children:"PortalSessions"})]})]}),v.jsx("p",{className:"text-core-red-500",children:t})]})}function zx({uuid:t,host:e}){return t?v.jsx(ju.Provider,{value:{host:e},children:v.jsx(b1,{uuid:t,children:v.jsx(Ay,{children:v.jsx(_y,{})})})}):v.jsx(Kx,{message:"No uuid provided."})}const Xx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M8 4.75V8.25M16 4.75V8.25M7.75 10.75H16.25M6.75 19.25H17.25C18.3546 19.25 19.25 18.3546 19.25 17.25V8.75C19.25 7.64543 18.3546 6.75 17.25 6.75H6.75C5.64543 6.75 4.75 7.64543 4.75 8.75V17.25C4.75 18.3546 5.64543 19.25 6.75 19.25Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),Qx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("path",{d:"m21.25 7.5c.3796958 0 .693491.28215388.7431534.64822944l.0068466.10177056v8.5c0 1.7330315-1.3564548 3.1492459-3.0655761 3.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555 0-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932 1.06066018 0 .26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734 0 1.6711923-.7071103 1.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815 2 2c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554 0 .03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2 2c-.2928932.29289321-.767767.29289321-1.0606602 0-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734 0-1.67119234.70711027-1.7441988 1.60647279l-.0058012.14352721v8.5c0 .4142136-.33578644.75-.75.75-.37969577 0-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146 1.35645477-3.14924593 3.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117 5.85294824c2.209139 0 4 1.790861 4 4s-1.790861 4-4 4-4-1.790861-4-4 1.790861-4 4-4zm0 1.5c-1.3807119 0-2.5 1.1192881-2.5 2.5s1.1192881 2.5 2.5 2.5 2.5-1.1192881 2.5-2.5-1.1192881-2.5-2.5-2.5z",fill:"#212121"}))},Symbol.toStringTag,{value:"Module"})),Jx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M13.25 8.75L9.75 12L13.25 15.25",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),Zx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M17.25 6.75L6.75 17.25M6.75 6.75L17.25 17.25",strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),eO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("path",{d:"M4.7002 4.70016L11.2999 11.2998",stroke:"#000",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M11.2998 4.70016L4.70014 11.2998",stroke:"#000",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),tO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("circle",{cx:12,cy:12,r:7.25,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M14.25 8.75H11.375C10.4775 8.75 9.75 9.47754 9.75 10.375V10.375C9.75 11.2725 10.4775 12 11.375 12H12.625C13.5225 12 14.25 12.7275 14.25 13.625V13.625C14.25 14.5225 13.5225 15.25 12.625 15.25H9.75"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 7.75V8.25"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15.75V16.25"}))},Symbol.toStringTag,{value:"Module"})),nO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M19.25 19.25H13.75M9 18.25L4.75 19.25L5.75 15L15.0429 5.70711C15.4334 5.31658 16.0666 5.31658 16.4571 5.70711L18.2929 7.54289C18.6834 7.93342 18.6834 8.56658 18.2929 8.95711L9 18.25Z",strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),rO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M6.75024 19.2502H17.2502C18.3548 19.2502 19.2502 18.3548 19.2502 17.2502V9.75025L12.0002 4.75024L4.75024 9.75025V17.2502C4.75024 18.3548 5.64568 19.2502 6.75024 19.2502Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M9.74963 15.7493C9.74963 14.6447 10.6451 13.7493 11.7496 13.7493H12.2496C13.3542 13.7493 14.2496 14.6447 14.2496 15.7493V19.2493H9.74963V15.7493Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),oO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 13V15"}),ce.createElement("circle",{cx:12,cy:9,r:.5}),ce.createElement("circle",{cx:12,cy:12,r:7.25,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}))},Symbol.toStringTag,{value:"Module"})),iO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M5.5 6.5L12 12.25L18.5 6.5M6.75 18.25H17.25C18.3546 18.25 19.25 17.3546 19.25 16.25V7.75C19.25 6.64543 18.3546 5.75 17.25 5.75H6.75C5.64543 5.75 4.75 6.64543 4.75 7.75V16.25C4.75 17.3546 5.64543 18.25 6.75 18.25Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),aO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_17_95)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#FEF3F2"}),ce.createElement("path",{d:"M12.0003 12L20.0003 20M12.0003 20L20.0003 12",stroke:"#E02731",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_17_95"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),sO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_15_20)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#E7FBF4"}),ce.createElement("path",{d:"M10.6668 17.3333L14.6668 20L21.3335 12",stroke:"#039855",strokeWidth:1.6875,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_15_20"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),cO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_17_99)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#FFFAEB"}),ce.createElement("path",{d:"M16.0002 17.3333V13.3333M16.0002 20V20.0067M23.0353 19.3333L17.942 10.456C17.0833 8.95867 14.9167 8.95867 14.058 10.456L8.96533 19.3333C8.11266 20.8187 9.18933 22.6667 10.9073 22.6667H21.0933C22.8107 22.6667 23.8873 20.8187 23.0353 19.3333Z",stroke:"#CFAA25",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_17_99"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),uO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M13.1191 5.61336C13.0508 5.11856 12.6279 4.75 12.1285 4.75H11.8715C11.3721 4.75 10.9492 5.11856 10.8809 5.61336L10.7938 6.24511C10.7382 6.64815 10.4403 6.96897 10.0622 7.11922C10.006 7.14156 9.95021 7.16484 9.89497 7.18905C9.52217 7.3524 9.08438 7.3384 8.75876 7.09419L8.45119 6.86351C8.05307 6.56492 7.49597 6.60451 7.14408 6.9564L6.95641 7.14408C6.60452 7.49597 6.56492 8.05306 6.86351 8.45118L7.09419 8.75876C7.33841 9.08437 7.3524 9.52216 7.18905 9.89497C7.16484 9.95021 7.14156 10.006 7.11922 10.0622C6.96897 10.4403 6.64815 10.7382 6.24511 10.7938L5.61336 10.8809C5.11856 10.9492 4.75 11.372 4.75 11.8715V12.1285C4.75 12.6279 5.11856 13.0508 5.61336 13.1191L6.24511 13.2062C6.64815 13.2618 6.96897 13.5597 7.11922 13.9378C7.14156 13.994 7.16484 14.0498 7.18905 14.105C7.3524 14.4778 7.3384 14.9156 7.09419 15.2412L6.86351 15.5488C6.56492 15.9469 6.60451 16.504 6.9564 16.8559L7.14408 17.0436C7.49597 17.3955 8.05306 17.4351 8.45118 17.1365L8.75876 16.9058C9.08437 16.6616 9.52216 16.6476 9.89496 16.811C9.95021 16.8352 10.006 16.8584 10.0622 16.8808C10.4403 17.031 10.7382 17.3519 10.7938 17.7549L10.8809 18.3866C10.9492 18.8814 11.3721 19.25 11.8715 19.25H12.1285C12.6279 19.25 13.0508 18.8814 13.1191 18.3866L13.2062 17.7549C13.2618 17.3519 13.5597 17.031 13.9378 16.8808C13.994 16.8584 14.0498 16.8352 14.105 16.8109C14.4778 16.6476 14.9156 16.6616 15.2412 16.9058L15.5488 17.1365C15.9469 17.4351 16.504 17.3955 16.8559 17.0436L17.0436 16.8559C17.3955 16.504 17.4351 15.9469 17.1365 15.5488L16.9058 15.2412C16.6616 14.9156 16.6476 14.4778 16.811 14.105C16.8352 14.0498 16.8584 13.994 16.8808 13.9378C17.031 13.5597 17.3519 13.2618 17.7549 13.2062L18.3866 13.1191C18.8814 13.0508 19.25 12.6279 19.25 12.1285V11.8715C19.25 11.3721 18.8814 10.9492 18.3866 10.8809L17.7549 10.7938C17.3519 10.7382 17.031 10.4403 16.8808 10.0622C16.8584 10.006 16.8352 9.95021 16.8109 9.89496C16.6476 9.52216 16.6616 9.08437 16.9058 8.75875L17.1365 8.4512C17.4351 8.05308 17.3955 7.49599 17.0436 7.1441L16.8559 6.95642C16.504 6.60453 15.9469 6.56494 15.5488 6.86353L15.2412 7.09419C14.9156 7.33841 14.4778 7.3524 14.105 7.18905C14.0498 7.16484 13.994 7.14156 13.9378 7.11922C13.5597 6.96897 13.2618 6.64815 13.2062 6.24511L13.1191 5.61336Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M13.25 12C13.25 12.6904 12.6904 13.25 12 13.25C11.3096 13.25 10.75 12.6904 10.75 12C10.75 11.3096 11.3096 10.75 12 10.75C12.6904 10.75 13.25 11.3096 13.25 12Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),lO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.25 7.75H5.75V16.75L4.75 19.25H19.25L18.25 16.75V7.75Z"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.25 7.75L16.25 4.75H7.75L5.75 7.75"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 10.75V11.75C9.75 12.9926 10.7574 14 12 14V14C13.2426 14 14.25 12.9926 14.25 11.75V10.75"}))},Symbol.toStringTag,{value:"Module"})),dO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 4.75L13.75 10.25H19.25L14.75 13.75L16.25 19.25L12 15.75L7.75 19.25L9.25 13.75L4.75 10.25H10.25L12 4.75Z"}))},Symbol.toStringTag,{value:"Module"})),fO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M15.25 8C15.25 9.79493 13.7949 11.25 12 11.25C10.205 11.25 8.74997 9.79493 8.74997 8C8.74997 6.20507 10.205 4.75 12 4.75C13.7949 4.75 15.25 6.20507 15.25 8Z"}),ce.createElement("path",{d:"M6.84748 19.25H17.1525C18.2944 19.25 19.174 18.2681 18.6407 17.2584C17.8563 15.7731 16.068 14 12 14C7.93198 14 6.14364 15.7731 5.35921 17.2584C4.82594 18.2681 5.70556 19.25 6.84748 19.25Z"}))},Symbol.toStringTag,{value:"Module"})),hO=Object.freeze(Object.defineProperty({__proto__:null,createWorker:()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
152
+ `),e.toString()},t.prototype.setMode=function(e){this.mode=e},t.prototype.setECLevel=function(e){this.ecLevel=e},t.prototype.setVersion=function(e){this.version=e},t.prototype.setMaskPattern=function(e){this.maskPattern=e},t.prototype.setMatrix=function(e){this.matrix=e},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),QI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hi=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return QI(e,t),e.kind="WriterException",e}($n);(function(){function t(){}return t.clearMatrix=function(e){e.clear(255)},t.buildMatrix=function(e,n,r,o,i){t.clearMatrix(i),t.embedBasicPatterns(r,i),t.embedTypeInfo(n,o,i),t.maybeEmbedVersionInfo(r,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,n){t.embedPositionDetectionPatternsAndSeparators(n),t.embedDarkDotAtLeftBottomCorner(n),t.maybeEmbedPositionAdjustmentPatterns(e,n),t.embedTimingPatterns(n)},t.embedTypeInfo=function(e,n,r){var o=new Ur;t.makeTypeInfoBits(e,n,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),c=t.TYPE_INFO_COORDINATES[i],u=c[0],d=c[1];if(r.setBoolean(u,d,s),i<8){var h=r.getWidth()-i-1,f=8;r.setBoolean(h,f,s)}else h=8,f=r.getHeight()-7+(i-8),r.setBoolean(h,f,s)}},t.maybeEmbedVersionInfo=function(e,n){if(!(e.getVersionNumber()<7)){var r=new Ur;t.makeVersionInfoBits(e,r);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=r.get(o);o--,n.setBoolean(i,n.getHeight()-11+a,s),n.setBoolean(n.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,n,r){for(var o=0,i=-1,a=r.getWidth()-1,s=r.getHeight()-1;a>0;){for(a===6&&(a-=1);s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var u=a-c;if(t.isEmpty(r.get(u,s))){var d=void 0;o<e.getSize()?(d=e.get(o),++o):d=!1,n!==255&&zI.getDataMaskBit(n,u,s)&&(d=!d),r.setBoolean(u,s,d)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new hi("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(e){return 32-bn.numberOfLeadingZeros(e)},t.calculateBCHCode=function(e,n){if(n===0)throw new Ve("0 polynomial");var r=t.findMSBSet(n);for(e<<=r-1;t.findMSBSet(e)>=r;)e^=n<<t.findMSBSet(e)-r;return e},t.makeTypeInfoBits=function(e,n,r){if(!XI.isValidMaskPattern(n))throw new hi("Invalid mask pattern");var o=e.getBits()<<3|n;r.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);r.appendBits(i,10);var a=new Ur;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),r.xor(a),r.getSize()!==15)throw new hi("should not happen but we got: "+r.getSize())},t.makeVersionInfoBits=function(e,n){n.appendBits(e.getVersionNumber(),6);var r=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new hi("should not happen but we got: "+n.getSize())},t.isEmpty=function(e){return e===255},t.embedTimingPatterns=function(e){for(var n=8;n<e.getWidth()-8;++n){var r=(n+1)%2;t.isEmpty(e.get(n,6))&&e.setNumber(n,6,r),t.isEmpty(e.get(6,n))&&e.setNumber(6,n,r)}},t.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new hi;e.setNumber(8,e.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,n,r){for(var o=0;o<8;++o){if(!t.isEmpty(r.get(e+o,n)))throw new hi;r.setNumber(e+o,n,0)}},t.embedVerticalSeparationPattern=function(e,n,r){for(var o=0;o<7;++o){if(!t.isEmpty(r.get(e,n+o)))throw new hi;r.setNumber(e,n+o,0)}},t.embedPositionAdjustmentPattern=function(e,n,r){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)r.setNumber(e+a,n+o,i[a])},t.embedPositionDetectionPattern=function(e,n,r){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)r.setNumber(e+a,n+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var n=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-n,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-n,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,n){if(!(e.getVersionNumber()<2))for(var r=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var c=0;c!==a;c++){var u=o[c];u>=0&&t.isEmpty(n.get(u,s))&&t.embedPositionAdjustmentPattern(u-2,s-2,n)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522,t})(),function(){Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Yn.UTF8.getName()}();var JI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o,i,a,s,c,u){var d=t.call(this,s,c)||this;if(d.yuvData=n,d.dataWidth=r,d.dataHeight=o,d.left=i,d.top=a,i+s>r||a+c>o)throw new Ve("Crop rectangle does not fit within image data.");return u&&d.reverseHorizontal(s,c),d}JI(e,t),e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length<o)&&(r=new Uint8ClampedArray(o));var i=(n+this.top)*this.dataWidth+this.left;return Nt.arraycopy(this.yuvData,i,r,0,o),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.yuvData;var o=n*r,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Nt.arraycopy(this.yuvData,a,i,0,o),i;for(var s=0;s<r;s++){var c=s*n;Nt.arraycopy(this.yuvData,a,i,c,n),a+=this.dataWidth}return i},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+r,o,i,!1)},e.prototype.renderThumbnail=function(){for(var n=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,o=new Int32Array(n*r),i=this.yuvData,a=this.top*this.dataWidth+this.left,s=0;s<r;s++){for(var c=s*n,u=0;u<n;u++){var d=255&i[a+u*e.THUMBNAIL_SCALE_FACTOR];o[c+u]=4278190080|65793*d}a+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return o},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(n,r){for(var o=this.yuvData,i=0,a=this.top*this.dataWidth+this.left;i<r;i++,a+=this.dataWidth)for(var s=a+n/2,c=a,u=a+n-1;c<s;c++,u--){var d=o[c];o[c]=o[u],o[u]=d}},e.prototype.invert=function(){return new su(this)},e.THUMBNAIL_SCALE_FACTOR=2})(fs);var ZI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o,i,a,s,c){var u=t.call(this,r,o)||this;if(u.dataWidth=i,u.dataHeight=a,u.left=s,u.top=c,n.BYTES_PER_ELEMENT===4){for(var d=r*o,h=new Uint8ClampedArray(d),f=0;f<d;f++){var p=n[f],l=p>>16&255,g=p>>7&510,m=255&p;h[f]=(l+g+m)/4&255}u.luminances=h}else u.luminances=n;if(i===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=o),s===void 0&&(u.left=0),c===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+o>u.dataHeight)throw new Ve("Crop rectangle does not fit within image data.");return u}ZI(e,t),e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length<o)&&(r=new Uint8ClampedArray(o));var i=(n+this.top)*this.dataWidth+this.left;return Nt.arraycopy(this.luminances,i,r,0,o),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.luminances;var o=n*r,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Nt.arraycopy(this.luminances,a,i,0,o),i;for(var s=0;s<r;s++){var c=s*n;Nt.arraycopy(this.luminances,a,i,c,n),a+=this.dataWidth}return i},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return new e(this.luminances,o,i,this.dataWidth,this.dataHeight,this.left+n,this.top+r)},e.prototype.invert=function(){return new su(this)}})(fs);var eT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(){return t!==null&&t.apply(this,arguments)||this}eT(e,t),e.forName=function(n){return this.getCharacterSetECIByName(n)}})(Yn);var tT=function(){function t(e){this.previous=e}return t.prototype.getPrevious=function(){return this.previous},t}(),nT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$2=function(t){function e(n,r,o){var i=t.call(this,n)||this;return i.value=r,i.bitCount=o,i}return nT(e,t),e.prototype.appendTo=function(n,r){n.appendBits(this.value,this.bitCount)},e.prototype.add=function(n,r){return new e(this,n,r)},e.prototype.addBinaryShift=function(n,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,n,r)},e.prototype.toString=function(){var n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+bn.toBinaryString(n|1<<this.bitCount).substring(1)+">"},e}(tT),rT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o){var i=t.call(this,n,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=o,i}rT(e,t),e.prototype.appendTo=function(n,r){for(var o=0;o<this.binaryShiftByteCount;o++)(o===0||o===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):o===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+o],8)},e.prototype.addBinaryShift=function(n,r){return new e(this,n,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}})($2),new $2(null,0,0);var oT=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){var e,n;try{for(var r=oT(t),o=r.next();!o.done;o=r.next()){var i=o.value;or.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15})(or.createInt32Array(6,6)),function(t){var e=pn.getCharCode(" "),n=pn.getCharCode("."),r=pn.getCharCode(",");t[0][e]=1;for(var o=pn.getCharCode("Z"),i=pn.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=pn.getCharCode("z"),c=pn.getCharCode("a");for(a=c;a<=s;a++)t[1][a]=a-c+2;t[2][e]=1;var u=pn.getCharCode("9"),d=pn.getCharCode("0");for(a=d;a<=u;a++)t[2][a]=a-d+2;t[2][r]=12,t[2][n]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",`
153
+ `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][pn.getCharCode(h[f])]=f;var p=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<p.length;f++)pn.getCharCode(p[f])>0&&(t[4][pn.getCharCode(p[f])]=f)}(or.createInt32Array(5,256));var iT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aT=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=e.makeBufferFromCanvasImageData(n),r}return iT(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(o.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new su(this)},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var o=n*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),c=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);r.width=s,r.height=c;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(s/2,c/2),u.rotate(o),u.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs);function Y2(){return typeof navigator<"u"}function sT(){return!!(Y2()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var oa=function(){return oa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},oa.apply(this,arguments)},$t=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Yt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},Cu=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cT={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ia=function(){function t(e,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=e,this.hints=n,this.options=oa(oa({},cT),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Pt.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),t.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.mediaStreamSetTorch=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var n,r,o=e.getVideoTracks();try{for(var i=Cu(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(e){try{return"torch"in e.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},t.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return t.getMediaElement(e,"video");if(!e&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return t.getMediaElement(e,"img");if(e===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var n=t.createVideoElement(e);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.createBinaryBitmapFromCanvas=function(e){var n=new aT(e),r=new d2(n);return new u2(r)},t.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Ht("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=t.getMediaElementDimensions(e),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},t.tryPlayVideo=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(e!=null&&e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var n=t.createCaptureCanvas(e),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(r,e),n},t.createBinaryBitmapFromMediaElem=function(e){var n=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(n)},t.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},t.listVideoInputDevices=function(){return $t(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Yt(this,function(p){switch(p.label){case 0:if(!Y2())throw new Error("Can't enumerate devices, navigator is not present.");if(!sT())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=Cu(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.findDeviceById=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){t.isVideoPlaying(e)||(i(!1),e.removeEventListener("canplay",s))},n),s=function(){t.tryPlayVideo(e).then(function(c){clearTimeout(a),e.removeEventListener("canplay",s),o(c)})};e.addEventListener("canplay",s)})]}})})},t.attachStreamToVideo=function(e,n,r){return r===void 0&&(r=5e3),$t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(n),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(n,r){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),n()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(e){if(!e)throw new Ht("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(n){return n.stop()}),e=void 0},t.prototype.decode=function(e){var n=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(n)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},t.prototype.decodeFromCanvas=function(e){var n=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(n)},t.prototype.decodeFromImageElement=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An image element must be provided.");return n=t.prepareImageElement(e),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareImageElement()).src=e,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return t.destroyImageElement(n),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i;return Yt(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i,a,s,c,u,d,h,f,p,l=this;return Yt(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,n,o)];case 1:return i=g.sent(),a=function(){var m,y;try{for(var w=Cu(e.getVideoTracks()),b=w.next();!b.done;b=w.next())b.value.stop()}catch(E){m={error:E}}finally{try{b&&!b.done&&(y=w.return)&&y.call(w)}finally{if(m)throw m.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},c=this.scan(i,r,s),u=e.getVideoTracks(),d=oa(oa({},c),{stop:function(){c.stop()},streamVideoConstraintsApply:function(m,y){return $t(this,void 0,void 0,function(){var w,b,E,C,I,T;return Yt(this,function(P){switch(P.label){case 0:w=y?u.filter(y):u,P.label=1;case 1:P.trys.push([1,6,7,8]),b=Cu(w),E=b.next(),P.label=2;case 2:return E.done?[3,5]:[4,E.value.applyConstraints(m)];case 3:P.sent(),P.label=4;case 4:return E=b.next(),[3,2];case 5:return[3,8];case 6:return C=P.sent(),I={error:C},[3,8];case 7:try{E&&!E.done&&(T=b.return)&&T.call(b)}finally{if(I)throw I.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(m){return u.find(m).getConstraints()},streamVideoSettingsGet:function(m){return u.find(m).getSettings()},streamVideoCapabilitiesGet:function(m){return u.find(m).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=u==null?void 0:u.find(function(m){return t.mediaStreamIsTorchCompatibleTrack(m)}),f=function(m){return $t(l,void 0,void 0,function(){return Yt(this,function(y){switch(y.label){case 0:return[4,t.mediaStreamSetTorch(h,m)];case 1:return y.sent(),[2]}})})},d.switchTorch=f,p=function(){c.stop(),f(!1)},d.stop=p),[2,d]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return $t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(r),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("A video element must be provided.");return r=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},t.prototype.decodeFromVideoUrl=function(e,n){return $t(this,void 0,void 0,function(){var r,o,i;return Yt(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("An URL must be provided.");return(r=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:return r=!!n,[4,t.attachStreamToVideo(e,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("A video element must be provided.");return n=t.prepareVideoElement(e),r=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareVideoElement()).src=e,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(n),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(e,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(e,function(c,u,d){if(c)return a(c),void d.stop();if(u){if(u instanceof he&&n||u instanceof sn&&r||u instanceof Se&&o)return;d.stop(),s(u)}})})},t.prototype.scan=function(e,n,r){var o=this;t.checkCallbackFnOrThrow(n);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,c=function(){a=void 0,i=void 0},u=!1,d={stop:function(){u=!0,clearTimeout(s),c(),r&&r()}},h=function(){if(!u)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);n(f,void 0,d),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(p){if(n(void 0,p,d),p instanceof sn||p instanceof Se||p instanceof he)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));c(),r&&r(p)}};return h(),d},t.prototype._decodeOnLoadImage=function(e){return $t(this,void 0,void 0,function(){return Yt(this,function(n){switch(n.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(e)]}})})},t}(),uT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new du,n,r)||this}uT(e,t)})(ia);var lT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new na(n),n,r)||this}lT(e,t)})(ia);var dT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new yu,n,r)||this}dT(e,t)})(ia);var fT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){var o=this,i=new q2;return i.setHints(n),(o=t.call(this,i,n,r)||this).reader=i,o}fT(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(n){this.hints.set(Pt.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},e.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(ia);var hT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new Eu,n,r)||this}hT(e,t)})(ia);var pT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gT=function(t){function e(n,r){return t.call(this,new bu,n,r)||this}return pT(e,t),e}(ia),_u=function(t,e,n){var r=typeof t===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(n,'".')),r},mT=function(t){var e=t.scanDelay,n=t.constraints,r=t.onResult,o=t.videoId,i=x.useRef(null);x.useEffect(function(){var a=new gT(null,{delayBetweenScanAttempts:e});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&_u(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),_u(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,c){_u(r,"onResult","function")&&r(s,c,a)}).then(function(s){return i.current=s}).catch(function(s){_u(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},pi=function(){return pi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pi.apply(this,arguments)},W2={container:{width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},video:{top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0}},Rf=function(t){var e=t.videoContainerStyle,n=t.containerStyle,r=t.videoStyle,o=t.constraints,i=t.ViewFinder,a=t.scanDelay,s=t.className,c=t.onResult,u=t.videoId;return mT({constraints:o,scanDelay:a,onResult:c,videoId:u}),ce.createElement("section",{className:s,style:n},ce.createElement("div",{style:pi(pi({},W2.container),e)},!!i&&ce.createElement(i,null),ce.createElement("video",{muted:!0,id:u,style:pi(pi(pi({},W2.video),r),{transform:(o==null?void 0:o.facingMode)==="user"&&"scaleX(-1)"})})))};Rf.displayName="QrReader",Rf.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};function yT({onScan:t}){const{cameraFacingMode:e}=an(),[n,r]=x.useState(e??Vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx(Rf,{onResult:o=>{o&&t(o.getText())},constraints:{facingMode:n},videoStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem",objectFit:"cover"},videoContainerStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem"}}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===Vn.USER?r(Vn.ENVIRONMENT):r(Vn.USER),children:v.jsx("img",{src:yf,alt:"camera-switch"})})]})}class Qe{constructor(e,n,r,o,i){this._legacyCanvasSize=Qe.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=e,this.$canvas=document.createElement("canvas"),r&&typeof r=="object"?this._onDecode=n:(console.warn(r||o||i?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof r=="object"?r:{},this._onDecodeError=n.onDecodeError||(typeof r=="function"?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||i||this._preferredCamera,this._legacyCanvasSize=typeof r=="number"?r:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;if(e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),r=e.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(o=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),i=this.$overlay.style,i.position="absolute",i.display="none",i.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(e),requestAnimationFrame(()=>{let s=window.getComputedStyle(e);s.display==="none"&&(e.style.setProperty("display","block","important"),a=!0),s.visibility!=="visible"&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity="0",e.style.width="0",e.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=Qe.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await Qe.listCameras(!1)).length}catch{return!1}}static async listCameras(e=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),r;try{e&&(await n()).every(o=>!o.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((o,i)=>({id:o.deviceId,label:o.label||(i===0?"Default Camera":`Camera ${i+1}`)}))}finally{r&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),Qe._stopVideoStream(r))}}async hasFlash(){let e;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;e=this.$video.srcObject}else e=(await this._getCameraStream()).stream;return"torch"in e.getVideoTracks()[0].getSettings()}catch{return!1}finally{e&&e!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),Qe._stopVideoStream(e))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),Qe._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:e,facingMode:n}=await this._getCameraStream();!this._active||this._paused?Qe._stopVideoStream(e):(this._setVideoMirror(n),this.$video.srcObject=e,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(e=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(Qe._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return e?(n(),!0):(await new Promise(r=>setTimeout(r,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(e,n,r,o,i=!1,a=!1){let s,c=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(s=n.scanRegion,r=n.qrEngine,o=n.canvas,i=n.disallowCanvasResizing||!1,a=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||o||i||a?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!r;try{let u,d;[r,u]=await Promise.all([r||Qe.createQrEngine(),Qe._loadImage(e)]),[o,d]=Qe._drawToCanvas(u,s,o,i);let h;if(r instanceof Worker){let f=r;n||Qe._postWorkerMessageSync(f,"inversionMode","both"),h=await new Promise((p,l)=>{let g,m,y,w=-1;m=E=>{E.data.id===w&&(f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),E.data.data!==null?p({data:E.data.data,cornerPoints:Qe._convertPoints(E.data.cornerPoints,s)}):l(Qe.NO_QR_CODE_FOUND))},y=E=>{f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),l("Scanner error: "+(E?E.message||E:"Unknown Error"))},f.addEventListener("message",m),f.addEventListener("error",y),g=setTimeout(()=>y("timeout"),1e4);let b=d.getImageData(0,0,o.width,o.height);w=Qe._postWorkerMessageSync(f,"decode",b,[b.data.buffer])})}else h=await Promise.race([new Promise((f,p)=>window.setTimeout(()=>p("Scanner error: timeout"),1e4)),(async()=>{try{var[f]=await r.detect(o);if(!f)throw Qe.NO_QR_CODE_FOUND;return{data:f.rawValue,cornerPoints:Qe._convertPoints(f.cornerPoints,s)}}catch(p){if(f=p.message||p,/not implemented|service unavailable/.test(f))return Qe._disableBarcodeDetector=!0,Qe.scanImage(e,{scanRegion:s,canvas:o,disallowCanvasResizing:i,alsoTryWithoutScanRegion:a});throw`Scanner error: ${f}`}})()]);return c?h:h.data}catch(u){if(!s||!a)throw u;let d=await Qe.scanImage(e,{qrEngine:r,canvas:o,disallowCanvasResizing:i});return c?d:d.data}finally{n||Qe._postWorkerMessage(r,"close")}}setGrayscaleWeights(e,n,r,o=!0){Qe._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:n,blue:r,useIntegerApproximation:o})}setInversionMode(e){Qe._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static async createQrEngine(e){if(e&&console.warn("Specifying a worker path is not required and not supported anymore."),e=()=>Promise.resolve().then(()=>hO).then(r=>r.createWorker()),!(!Qe._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return e();let n=navigator.userAgentData;return n&&n.brands.some(({brand:r})=>/Chromium/i.test(r))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:r,platformVersion:o})=>/arm/i.test(r||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?e():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let n=Math.round(.6666666666666666*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-n)/2),y:Math.round((e.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,n=e.videoWidth,r=e.videoHeight,o=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,s=e.offsetTop,c=window.getComputedStyle(e),u=c.objectFit,d=n/r,h=o/i;switch(u){case"none":var f=n,p=r;break;case"fill":f=o,p=i;break;default:(u==="cover"?d>h:d<h)?(p=i,f=p*d):(f=o,p=f/d),u==="scale-down"&&(f=Math.min(f,n),p=Math.min(p,r))}var[l,g]=c.objectPosition.split(" ").map((y,w)=>{const b=parseFloat(y);return y.endsWith("%")?(w?i-p:o-f)*b/100:b});c=this._scanRegion.width||n,h=this._scanRegion.height||r,u=this._scanRegion.x||0;var m=this._scanRegion.y||0;d=this.$overlay.style,d.width=`${c/n*f}px`,d.height=`${h/r*p}px`,d.top=`${s+g+m/r*p}px`,r=/scaleX\(-1\)/.test(e.style.transform),d.left=`${a+(r?o-l-f:l)+(r?n-u-c:u)/n*f}px`,d.transform=e.style.transform}})}static _convertPoints(e,n){if(!n)return e;let r=n.x||0,o=n.y||0,i=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let a of e)a.x=a.x*i+r,a.y=a.y*n+o;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var e=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;e<n&&await new Promise(o=>setTimeout(o,n-e)),this._lastScanTimestamp=Date.now();try{var r=await Qe.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!Qe._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=Qe.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",r.cornerPoints.map(({x:o,y:i})=>`${o},${i}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(e){e!==Qe.NO_QR_CODE_FOUND&&console.log(e)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],r=n.map(o=>Object.assign({},o,{[e]:{exact:this._preferredCamera}}));for(let o of[...r,...n])try{let i=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),a=this._getFacingMode(i)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:i,facingMode:a}}catch{}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let n of e.getTracks())n.stop(),e.removeTrack(n)}_setVideoMirror(e){this.$video.style.transform="scaleX("+(e==="user"?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,n,r,o=!1){r=r||document.createElement("canvas");let i=n&&n.x?n.x:0,a=n&&n.y?n.y:0,s=n&&n.width?n.width:e.videoWidth||e.width,c=n&&n.height?n.height:e.videoHeight||e.height;return o||(o=n&&n.downScaledWidth?n.downScaledWidth:s,n=n&&n.downScaledHeight?n.downScaledHeight:c,r.width!==o&&(r.width=o),r.height!==n&&(r.height=n)),n=r.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(e,i,a,s,c,0,0,r.width,r.height),[r,n]}static async _loadImage(e){if(e instanceof Image)return await Qe._awaitImageLoad(e),e;if(e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGImageElement||"OffscreenCanvas"in window&&e instanceof OffscreenCanvas||"ImageBitmap"in window&&e instanceof ImageBitmap)return e;if(e instanceof File||e instanceof Blob||e instanceof URL||typeof e=="string"){let n=new Image;n.src=e instanceof File||e instanceof Blob?URL.createObjectURL(e):e.toString();try{return await Qe._awaitImageLoad(n),n}finally{(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((n,r)=>{let o=i=>{e.removeEventListener("load",o),e.removeEventListener("error",o),i instanceof ErrorEvent?r("Image load error"):n()};e.addEventListener("load",o),e.addEventListener("error",o)})}static async _postWorkerMessage(e,n,r,o){return Qe._postWorkerMessageSync(await e,n,r,o)}static _postWorkerMessageSync(e,n,r,o){if(!(e instanceof Worker))return-1;let i=Qe._workerMessageId++;return e.postMessage({id:i,type:n,data:r},o),i}}Qe.DEFAULT_CANVAS_SIZE=400,Qe.NO_QR_CODE_FOUND="No QR code found",Qe._disableBarcodeDetector=!1,Qe._workerMessageId=0;function vT({onScan:t}){const{cameraFacingMode:e}=an(),[n,r]=x.useState(e),o=x.useRef(),i=x.useRef(null),[a,s]=x.useState(!0),c=d=>{t(d==null?void 0:d.data)},u=d=>{};return x.useEffect(()=>{var d;return i!=null&&i.current&&!o.current&&(o.current=new Qe(i==null?void 0:i.current,c,{onDecodeError:u,preferredCamera:n}),(d=o==null?void 0:o.current)==null||d.start().then(()=>s(!0)).catch(h=>{h&&s(!1)})),()=>{var h;i!=null&&i.current||(h=o==null?void 0:o.current)==null||h.stop()}},[]),x.useEffect(()=>{a||alert("Camera is blocked or not accessible. Please allow camera in your browser permissions and reload.")},[a]),v.jsxs("div",{className:"relative",children:[v.jsx("video",{className:"max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover",ref:i}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>{var h;const d=n===Vn.USER?Vn.ENVIRONMENT:Vn.USER;r(d),(h=o==null?void 0:o.current)==null||h.setCamera(d)},children:v.jsx("img",{src:yf,alt:"camera-switch"})})]})}function wT(){const[t,e]=x.useState(),n=()=>{console.log("ENABLE");const o={video:!0,audio:!1};navigator.mediaDevices.getUserMedia(o).then(i=>{console.log(".then?",i),e(i);const a=document.getElementById("video");a.srcObject=i,a.style.display="block",document.getElementById("offButton").disabled=!1,document.getElementById("onButton").disabled=!0}).catch(i=>{console.error("Error accessing camera:",i),alert("Error accessing camera. Please make sure you have granted the necessary permissions.")})},r=()=>{if(console.log("DISABLE"),t){console.log(t),t.getTracks().forEach(a=>a.stop());const i=document.getElementById("video");i.srcObject=null,i.style.display="none",document.getElementById("onButton").disabled=!1,document.getElementById("offButton").disabled=!0}};return v.jsxs("div",{children:[v.jsx("h1",{children:"Cam working with buttons"}),v.jsx("video",{id:"video",autoPlay:!0,playsInline:!0}),v.jsxs("div",{children:[v.jsx(Je,{label:"Turn On Camera",id:"onButton",onClick:n}),v.jsx(Je,{label:"Turn Off Camera",id:"offButton",onClick:r,disabled:!0}),v.jsx(Je,{label:"Log stream",id:"streamButton",onClick:()=>console.log(t)})]})]})}function aa({data:t,dataSetter:e,setDefer:n,label:r=""}){const o=x.useRef(null),[i,a]=Rb()??[0,0],{subscribe:s,unsubscribe:c}=Oa(),{cameraService:u}=an(),d=f=>{e(f)};x.useEffect(()=>{a&&a<=332&&o.current&&o.current.scrollIntoView({behavior:"smooth",block:"end"});const f=p=>{e(p.detail.code)};return s("onCodeScan",f),()=>{c("onCodeScan",f)}},[a]);const h=()=>{switch(+u){case 1:return v.jsx(c2,{onScan:d});case 2:return v.jsx(vT,{onScan:d});case 3:return v.jsx(yT,{onScan:d});case 4:return v.jsx(wT,{});default:return v.jsx(c2,{onScan:d})}};return v.jsxs("div",{ref:o,children:[v.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[h(),v.jsx("hr",{})]}),v.jsx(Yo,{label:r,value:t,autoFocus:!0,placeholder:"CDE2341S",onChange:f=>{n&&n(!0),e(f.target.value)}})]})}function bT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=()=>{u(!0),h.get(`${n}/check-code/${o}`).then(p=>{if(p.data.identifier)return d(`identifier/${p.data.identifier.value}`);if(p.data.voucher)return d(`voucher/${p.data.voucher.code}`);if(p.data.giftcard)return d(`giftcard/${p.data.giftcard.hash}`);e(t("unknownCode",{code:o}))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{o&&!a&&f()},[o]),v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"code"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:f,children:v.jsx(aa,{data:o,dataSetter:i,setDefer:s,label:t("contactIdentifier")})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{label:t("continue"),onClick:f,pending:c}),r.inputData.enable_email_identification&&v.jsx(Je,{label:t("useEmail"),variant:"secondary",onClick:()=>d("email")})]})})]})})}function ET(){const{hash:t}=Yr();return v.jsx(dr,{to:`${Le.GIFTCARD}/select/${t}`})}function CT(){const{identifierValue:t}=Yr(),{errorToast:e}=Vt(),{uuid:n,mutate:r}=je(),{onContactLink:o}=an(),[i,a]=x.useState(!1),s=Dt(),c=d=>s.get(`${n}/contacts`,{contact_uuid:d}),u=()=>{s.put(n,{contact_identifier_value:t}).then(d=>{o&&c(d.data.data.contact.uuid).then(h=>{o==null||o(h.data.data)}),r().then(()=>a(!0))}).catch(e)};return x.useEffect(()=>{u()},[]),i?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):v.jsx(_r,{})}function K2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/vouchers/${t}`,onData:r});return{voucher:n,isLoading:o,pending:i,mutate:a}}function _T(){const{t}=Ue(),{code:e}=Yr(),{voucher:n}=K2(e),{portalSession:r}=je(),[o,i]=x.useState(!1),[a,s]=x.useState(!1),c=zt(),u=()=>{n!=null&&n.contact||r.contact?i(!0):s(!0)};return x.useEffect(()=>{n&&u()},[n]),n?v.jsxs(v.Fragment,{children:[o?v.jsx(dr,{to:`${Le.VOUCHER}/${n.code}/redeem`}):v.jsx(_r,{}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:a,onClose:()=>s(!1),primaryAction:{label:t("linkToContact"),action:()=>c(`${Le.VOUCHER}/${n.code}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>s(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:n.code})})})]}):v.jsx(_r,{})}function Au({redirectRoute:t}){const{state:e}=er(),{t:n}=Ue(),{errorToast:r}=Vt(),{onContactLink:o}=an(),{portalSession:i,mutate:a}=je(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt(),m=b=>g.get(`${i.uuid}/contacts`,{contact_uuid:b}),y=()=>{h(!0),g.put(i.uuid,{email:c}).then(b=>{o&&m(b.data.data.contact.uuid).then(E=>{o==null||o(E.data.data)}),a().then(()=>l(t))}).catch(b=>{b.response.data.code===Ws.CONTACT_NOT_FOUND&&p(!0)}).finally(()=>h(!1))},w=()=>{h(!0),g.post(`${i.uuid}/contacts`,{email:c}).then(y).catch(r).finally(()=>h(!1))};return x.useEffect(()=>{s("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n("fillInXBelow",{x:n("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>c&&!d&&y(),children:v.jsx(Yo,{id:"via-email-address-input",label:n("emailAddress"),autoFocus:!0,onChange:b=>u(b.target.value),beforeIcon:"mail"})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{label:n("continue"),className:"w-full",onClick:y,disabled:!c,pending:d}),v.jsx(Je,{label:n("useIdentifier"),variant:"secondary",onClick:()=>l("../identifier",{state:e})})]})})]})}),v.jsx(Eo,{title:`${n("new")} ${n("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:n("confirm"),action:w,disabled:d},secondaryAction:{label:n("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:n("continueWithEmail",{email:c})})})]})}function AT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/*",element:v.jsx(bT,{})}),v.jsx(Ye,{path:"/giftcard/:hash",element:v.jsx(ET,{})}),v.jsx(Ye,{path:"/identifier/:identifierValue",element:v.jsx(CT,{})}),v.jsx(Ye,{path:"/voucher/:code",element:v.jsx(_T,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.PORTAL})})]})}const ST={[Kt.GIFTCARD]:`${Le.GIFTCARD}/select`,[Kt.REDEEM_GIFTCARD]:`${Le.GIFTCARD}/redeem`,[Kt.TOP_UP_GIFTCARD]:`${Le.GIFTCARD}/top-up`};function IT(){const{t}=Ue(),{portalSession:e}=je(),{errorToast:n}=Vt(),[r,o]=x.useState(""),[i,a]=x.useState(!1),[s,c]=x.useState(!1),u=Dt(),d=zt(),h=()=>{a(!0),u.get(`${e.uuid}/giftcards/${r}`).then(f=>{const p=e.type;d(`${ST[p]}/${f.data.data.hash}`)}).catch(f=>{n(f),o("")}).finally(()=>a(!1))};return x.useEffect(()=>{!s&&r&&h()},[r]),v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanGiftcard")})})}),v.jsx(kt,{children:v.jsx(aa,{data:r,dataSetter:o,setDefer:c,label:t("hash")})}),v.jsx(nn,{children:v.jsx(Je,{label:t("submit"),className:"w-full",onClick:h,disabled:!r,pending:i})})]})})}function TT(){const{t}=Ue(),{hash:e}=Yr(),n=zt();return v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("chooseType")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Je,{className:"grow",label:t("redeem"),onClick:()=>n(`${Le.GIFTCARD}/redeem/${e}`)}),v.jsx(Je,{className:"grow",label:t("topUp"),onClick:()=>n(`${Le.GIFTCARD}/top-up/${e}`)})]})})]})})}function z2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/giftcards/${t}`,onData:r});return{giftcard:n,isLoading:o,pending:i,mutate:a}}function ws(){const{mutate:t}=je();return{get:()=>t().then(r=>r.data.data.events),post:()=>{t().then(r=>{r3(r.data.data.events)})}}}function xT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{onUseGiftcard:s}=an(),{post:c}=ws(),[u]=x.useState(i.results.remaining_amount?+i.results.remaining_amount:+i.inputData.amount_in_cents),[d,h]=x.useState(!1),f=i.inputData.allow_multiple_giftcards??!0,p=zt(),l=Dt(),g=()=>{h(!0),l.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:-m()}).then(E=>{o(),a(),c(),s==null||s(E.data.data)}).catch(e).finally(()=>h(!1))},m=()=>Math.min(y(),r.amount_in_cents),y=()=>i.results.remaining_amount??i.inputData.amount_in_cents,w=()=>{let E=0;return i.events.filter(I=>I.type===yo.GIFTCARD_TRANSACTION).forEach(I=>{I.data.giftcard.uuid===r.uuid&&(E+=I.data.amount_in_cents)}),E},b=()=>{if(m())return{label:t("confirmAndPay",{amount:Si(m(),i.currency)}),onClick:g};if(f&&y())return{label:t("useAnotherGiftcard"),onClick:()=>p(Le.GIFTCARD),variant:"secondary"}};return r?v.jsx(In,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:`${t("giftcard")} ${r.hash}`})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("balance")}),v.jsx(bo,{value:r.amount_in_cents,start:r.amount_in_cents-w(),currency:i.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u+w(),start:u,currency:i.currency,asCurrency:!0})})]})})]})}),b()&&v.jsx(nn,{children:v.jsx(Je,{label:"",className:"w-full",...b(),pending:d})})]})}):v.jsx(_r,{})}function OT({value:t,valueSetter:e,enabled:n}){const[r,o]=x.useState(!1),i=x.useRef(null),a=x.useRef(null);x.useEffect(()=>{u(t?t.toString():"")},[]);const s=d=>{e(d?parseInt(d):0),u(d)},c=d=>{const{key:h}=d;if(t===0&&!/^[1-9]$/.test(h)||t!==0&&!/^[0-9]$/.test(h)&&h!=="Backspace")return;let f;if(h!=="Backspace")f=parseInt(t===0?h:`${t}${h}`);else{const p=t.toString().slice(0,-1);f=p.length?parseInt(p,10):0}e(f),u(f?f.toString():"")},u=d=>{a&&a.current&&(d?a.current.style.width=`${Math.max(d.length,3)*3}rem`:a.current.style.width="calc(3rem + 14px)")};return v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:a,className:"h-full w-[65px] rounded border-gray-200 border-transparent text-5xl [appearance:textfield] focus:border-transparent focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",type:"number",pattern:"[0-9]*",inputMode:"numeric",placeholder:"0",autoFocus:!0,value:t?(t/100).toFixed(2):"",onKeyDown:c,onChange:()=>{},onFocus:()=>o(!0),onBlur:()=>o(!1)}),n&&v.jsx("div",{className:`mobile:hidden bottom-2 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!r&&"hidden"} absolute`,children:v.jsx(fp,{keyboardRef:i,layout:{default:["1 2 3","4 5 6","7 8 9","00 0 {bksp}"]},theme:"hg-theme-default hg-layout-numeric numeric-theme",onChange:s})})]})}function X2({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),[a,s]=x.useState(0),{portalSession:c}=je(),u=()=>{let d=0;return c.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d};return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e??0,start:e??0,currency:c.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsx("div",{className:"flex items-center justify-center gap-1 p-4 text-5xl font-bold",children:u()?v.jsx(bo,{value:0,start:a,currency:c.currency,asCurrency:!0}):v.jsxs("div",{className:"flex items-center justify-center gap-1 ",children:[v.jsx("p",{children:n3(c.currency)}),v.jsx(OT,{value:a,valueSetter:s,enabled:c.inputData.enable_on_screen_keyboard})]})})})]})}),v.jsx(nn,{children:v.jsx(Je,{label:i("confirmAndPay",{amount:Si(a,c.currency)}),className:"w-full",onClick:r&&(()=>r(a)),disabled:!a||!!u(),pending:o})})]})}function PT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{post:s}=ws(),{onUseGiftcard:c}=an(),[u,d]=x.useState(!1),h=Dt(),f=p=>{d(!0),h.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:p}).then(l=>{o(),a(),s(),c==null||c(l.data.data),Ct.success(`${t("transactionSuccessful")}! ${t("totalUpgradedAmount")}: ${Si(l.data.data.amount_in_cents,i.currency)}`)}).catch(e).finally(()=>d(!1))};return r?v.jsx(In,{children:v.jsx(X2,{title:`${t("giftcard")} ${r.hash}`,balance:r.amount_in_cents,transaction:f,pending:u})}):v.jsx(_r,{})}function kT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(IT,{})}),v.jsx(Ye,{path:"/select/:hash",element:v.jsx(TT,{})}),v.jsx(Ye,{path:"/redeem/:hash",element:v.jsx(xT,{})}),v.jsx(Ye,{path:"/top-up/:hash",element:v.jsx(PT,{})})]})}class Df{constructor(){Qn(this,"uuid");Qn(this,"email");Qn(this,"credit_balance");Qn(this,"prepaid_balance");Qn(this,"current_display_values")}getDisplayName(){return this.current_display_values.firstname||this.current_display_values.lastname?`${this.current_display_values.firstname} ${this.current_display_values.lastname}`:this.current_display_values.email}}const Q2=x.createContext({contact:new Df,mutate:async()=>{}});function Mf({children:t}){const{uuid:e}=je(),[n,r]=x.useState(new Df),{mutate:o}=cr({url:`${e}/contacts`,onData:a=>{const s=new Df;s.uuid=a.uuid,s.email=a.email,s.credit_balance=a.credit_balance,s.prepaid_balance=a.prepaid_balance,s.current_display_values=a.current_display_values,r(s)}}),i=x.useMemo(()=>({contact:n,mutate:o}),[n,o]);return n.uuid?v.jsx(Q2.Provider,{value:i,children:t}):v.jsx(_r,{})}function ar(){const t=x.useContext(Q2);if(!t)throw new Error("Only use 'useContactContext' within a ContactProvider");return t}function Su({message:t=""}){return v.jsxs("div",{className:"flex items-center justify-center gap-4 text-core-primary-500",children:[v.jsx(Al,{className:"h-[32px] w-[32px]"}),t&&v.jsx("p",{className:"text-sm",children:t})]})}function BT(){const{t}=Ue(),{errorToast:e}=Vt(),{contact:n,mutate:r}=ar(),{uuid:o,portalSession:i,mutate:a}=je(),s=Dt(),c=()=>{s.post(`${o}/credit-receptions/create`,{unit_value:i.inputData.amount_in_cents/100}).then(()=>{r(),a()}).catch(e)},u=()=>{const d=i.events.filter(h=>h.type===yo.CREDIT_RECEPTION);return d.length?d[0]:null};return x.useEffect(()=>{u()||c()},[]),v.jsx(In,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n.getDisplayName()})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsx("div",{className:"flex h-full flex-col items-center gap-2 p-6",children:i.inputData.amount_in_cents?v.jsx("div",{className:"flex h-full items-center justify-center gap-1 text-4xl font-bold",children:u()?v.jsxs(v.Fragment,{children:["+",v.jsx(bo,{value:u().data.credits,start:0})]}):v.jsx(Su,{})}):v.jsx("p",{className:"text-core-red-500",children:t("xIsRequired",{x:"Amount in cents"})+"."})}),v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:`${t("new")} ${t("balance").toLowerCase()}`}),v.jsx(bo,{value:n.credit_balance.balance??0,start:n.credit_balance.balance-(u()?u().data.credits:0)})]})})]})})]})})}function NT(){const{portalSession:t}=je();return t.contact?v.jsx(Mf,{children:v.jsx(BT,{})}):t.inputData.primary_identification_method&&t.inputData.primary_identification_method===Ci.EMAIL?v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/email`}):v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/identifier`})}function Lf({redirectRoute:t}){const{t:e}=Ue(),{state:n}=er(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=an(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt();x.useEffect(()=>{!d&&a&&l()},[a]);const l=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&g(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(t,{state:{contactIdentifier:a}}))}).catch(()=>f("link",{state:{contactIdentifier:a}})).finally(()=>u(!1))},g=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m});return v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>a&&l(),children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:e("contactIdentifier")})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{label:e("continue"),onClick:l,disabled:!a,pending:c}),r.inputData.enable_email_identification&&v.jsx(Je,{label:e("useEmail"),variant:"secondary",onClick:()=>f("../email",{state:n})})]})})]})})}function Ff({redirectRoute:t}){const{t:e}=Ue(),{errorToast:n}=Vt(),{uuid:r,mutate:o}=je(),{onContactLink:i}=an(),{state:a}=er(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt();if(!a||!a.contactIdentifier)return v.jsx(dr,{to:"../"});const m=()=>{h(!0),g.post(`${r}/contacts/link-identifier`,{contact_identifier_value:a.contactIdentifier,email:c}).then(w).catch(E=>{E.response.data.code===Ws.CONTACT_NOT_FOUND?p(!0):n(E)}).finally(()=>h(!1))},y=()=>{h(!0),g.post(`${r}/contacts`,{email:c}).then(m).catch(n).finally(()=>h(!1))},w=()=>{g.put(r,{email:c}).then(E=>{i&&b(E.data.data.contact.uuid).then(C=>{i==null||i(C.data.data)}),o().then(()=>l(t))}).catch(n).finally(()=>h(!1))},b=E=>g.get(`${r}/contacts`,{contact_uuid:E});return x.useEffect(()=>{s("openKeyboard",{inputId:"new-contact-identifier-input",inputValue:""})},[]),v.jsxs(In,{children:[v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:e("linkContact")})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Ob,{body:e("noEmailAddressLinkedToIdentifier")}),v.jsx(si,{onSubmit:m,children:v.jsx(Yo,{id:"new-contact-identifier-input",label:e("emailAddress"),autoFocus:!0,onChange:E=>u(E.target.value),beforeIcon:"mail"})})]})}),v.jsx(nn,{children:v.jsx(Je,{label:e("continue"),className:"w-full",onClick:m,disabled:!c||d})})]}),v.jsx(Eo,{title:`${e("new")} ${e("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:e("confirm"),action:y,loading:d},secondaryAction:{label:e("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:e("continueWithEmail",{email:c})})})]})}function RT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(NT,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.POINTS_TRANSACTION})})]})}function DT(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=an();return t.contact?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PORTAL}/email`}):v.jsx(dr,{to:`${Le.PORTAL}/identifier`})}function MT({children:t}){return v.jsx("div",{className:"h-screen w-screen pb-[70px] md:px-4 md:pb-[86px] md:pt-4 lg:pb-4 lg:pt-[66px]",children:v.jsx("div",{className:"h-full max-h-full",children:t})})}function LT({contact:t}){const{t:e}=Ue(),n=zt();return v.jsxs("div",{className:"inline-grid w-full items-center gap-4 py-4 lg:grid-cols-2",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Dl,{src:t.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsx("p",{className:"text-lg",children:t.getDisplayName()}),t.current_display_values.tier&&v.jsx(Ml,{label:t.current_display_values.tier,size:"sm",stroke:!0})]}),v.jsx("p",{className:"text-sm text-core-gray-500 ",children:e("joinedAtDate",{date:new Date(t.current_display_values.created_at).toLocaleDateString(tn.language,{month:"long",year:"numeric"})})})]})]}),v.jsxs("div",{className:"inline-grid gap-2 lg:grid-cols-2",children:[v.jsx(Je,{label:e("goToX",{x:"identifiers"}),variant:"secondary",size:"md",onClick:()=>n("contact-identifiers")}),v.jsx(Je,{before:v.jsx(vn,{icon:"edit"}),label:e("editProfile"),variant:"secondary",size:"md",onClick:()=>n("contact-attributes")})]})]})}function bs({children:t}){return v.jsx("div",{className:"flex-grow rounded-lg border p-4",children:t})}function FT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex gap-2 lg:flex-col",children:[v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:e.current_display_values.loyalty_balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})}),v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:Si(e.prepaid_balance.balance_in_cents,n.currency)}),v.jsx("p",{className:"text-sm text-core-gray-500",children:t("prepaidCredit")})]})})]})}function jT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je(),r=(o,i)=>R1(o,i)?`${R1(o,i)} ${t("yearsAgo")}`:N1(o,i)?`${N1(o,i)} ${t("weeksAgo")}`:B1(o,i)?`${B1(o,i)} ${t("daysAgo")}`:t("today");return v.jsx(bs,{children:v.jsxs("div",{className:"h-full justify-between",children:[v.jsx("p",{className:"mb-4 text-lg font-semibold leading-7",children:t("stats")}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vn,{icon:"calendar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:r(new Date,new Date(e.current_display_values.loyalty_last_transaction_date))}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("lastVisit")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vn,{icon:"shopping-bag"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_number_of_transactions} ${t("visits")}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalVisits")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(vn,{icon:"dollar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_total_credits_received} ${n.loyaltyProgram.custom_credit_name}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalCredits")})]})]})]})]})})}function J2(){const{uuid:t}=je(),[e,n]=x.useState([]),{data:r,isLoading:o,pending:i,mutate:a}=cr({url:`${t}/loyalty-transactions`});return x.useEffect(()=>{r&&n(r.data)},[r]),{loyaltyTransactions:e,isLoading:o,pending:i,mutate:a}}function Z2({loyaltyTransaction:t}){const{t:e}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs text-core-gray-500",children:t.type===v1.CREDIT_RECEPTION?e("transaction"):`${e("isRedeemed")} '${t.loyalty_transaction_data.title}'`}),v.jsx("p",{className:"text-xs font-semibold",children:t.credits>0?"+"+t.credits:t.credits})]})}function VT(){const{t}=Ue(),e=zt(),{loyaltyTransactions:n}=J2();return n?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("activities")}),n&&n.length?v.jsx("div",{children:n.slice(0,5).map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))}):v.jsx("p",{className:"text-sm text-core-gray-500",children:t("noActivity")})]}),v.jsx(Je,{label:`${t("all")} ${t("activities").toLowerCase()}`,variant:"secondary",onClick:()=>e("activity")})]})}):v.jsx(Su,{})}function ey(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/subscriptions/contact`,onData:n});return{subscriptions:e,isLoading:r,pending:o,mutate:i}}function ty({subscription:t,onChange:e,editable:n=!1}){const{t:r}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs font-semibold",children:t.subscription_type.name}),n?v.jsx(gd,{defaultChecked:t.is_subscribed,disabled:t.subscription_type.strategy===w1.FUNCTIONAL,onChange:e&&(()=>e(t.subscription_type.name))}):v.jsx(Ml,{label:r(t.status.toLowerCase()),size:"sm",color:t.is_subscribed?"primary":"gray"})]})}function UT(){const{t}=Ue(),{subscriptions:e}=ey(),n=zt();return e?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("subscriptions")}),v.jsx("div",{children:e.map(r=>v.jsx(ty,{subscription:r},r.subscription_type.uuid))})]}),v.jsx(Je,{label:t("change"),before:v.jsx(vn,{icon:"edit"}),variant:"secondary",onClick:()=>n("subscriptions")})]})}):v.jsx(Su,{})}function GT(){const{contact:t}=ar();return v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(LT,{contact:t})}),v.jsx(kt,{children:v.jsxs("div",{className:"grid grid-cols-1 gap-x-2 gap-y-2 lg:grid-cols-4",children:[v.jsx(FT,{}),v.jsx(jT,{}),v.jsx(VT,{}),v.jsx(UT,{})]})})]})}function Es({label:t,path:e}){const n=zt();return v.jsx("div",{className:"flex h-16 items-center text-base text-core-gray-900",children:v.jsx(Je,{label:t,variant:"link-gray",before:v.jsx(vn,{icon:"caret-left",size:"md"}),onClick:()=>n(e)})})}function qT(){const{t}=Ue(),{loyaltyTransactions:e}=J2(),{contact:n}=ar();return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsx("p",{className:"text-sm font-medium",children:t("allActivities")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("checkOutAllActivitiesOfName",{name:n.getDisplayName()})}),v.jsx("div",{className:"overflow-auto",children:e==null?void 0:e.map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))})]})})]})})}function HT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{subscriptions:r,mutate:o}=ey(),[i,a]=x.useState({}),[s,c]=x.useState(!1),u=Dt();x.useEffect(()=>{if(r&&!Object.keys(i).length){const p=r.reduce((l,g)=>({...l,[g.subscription_type.name]:g.is_subscribed}),{});a(p)}},[]);const d=p=>{Object.hasOwn(i,p)?a({...i,[p]:!i[p]}):a({...i,[p]:!0})},h=()=>{c(!0),u.put(`${n}/subscriptions`,{values:i}).then(()=>o()).catch(e).finally(()=>c(!1))},f=()=>r&&r.some(p=>i[p.subscription_type.name]!==p.is_subscribed);return r?v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("subscriptions")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("manageEmailPreferences")}),r.map(p=>v.jsx(ty,{subscription:p,onChange:d,editable:!0},p.subscription_type.uuid))]})})}),v.jsx(nn,{children:v.jsx(Je,{label:t("saveChanges"),className:"w-full",onClick:h,pending:s,disabled:!f()||s})})]})}):v.jsx(Su,{})}function $T(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r,mutate:o}=ar(),[i,a]=x.useState(),[s,c]=x.useState(!1),[u,d]=x.useState(),h=Dt();cr({url:`${n}/contact-attributes`,onData:g=>a(g.elements)});const f=g=>{d({...u,[g.target.name]:g.target.value})},p=(g,m)=>{d({...u,[g]:m})},l=async()=>{c(!0),h.put(`${n}/contact-attributes`,u).then(()=>{o(),d(void 0)}).catch(e).finally(()=>c(!1))};return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsxs("div",{className:"mb-4 flex flex-row items-center gap-4 border-b border-b-core-gray-200 px-1 pb-4",children:[v.jsx(Dl,{src:r.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{children:[v.jsx("div",{className:"flex flex-row items-center gap-2 ",children:v.jsxs("h1",{className:"text-lg text-core-gray-900",children:[r.current_display_values.firstname," ",r.current_display_values.lastname]})}),v.jsx("p",{className:"text-sm text-core-gray-500",children:r.current_display_values.email})]})]}),i?i.map(g=>{if(!(g.type==="media_upload"||g.type==="email"))return g.type==="select"?v.jsx(qb,{name:g.name,label:g.label,value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],onChange:m=>p(g.name,m),disabled:g.disabled,children:g.options.map(m=>v.jsx(Fl,{label:m.label,value:m.value},m.value))},g.id):g.type==="multi_select"?v.jsx(jb,{name:g.name,value:u&&u[g.name]?u[g.name]:g.defaultValue,label:g.label,onChange:p,disabled:g.disabled,options:g.options},g.id):g.type==="birth_date"||g.type==="date_time"?v.jsx(pp,{id:g.id,name:g.name,label:g.label,type:g.type==="date_time"?"date_time":"date",value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],disabled:g.disabled,onChange:f},g.id):v.jsx(Yo,{disabled:g.disabled,label:g.label,name:g.name,value:u&&u[g.name]!=="undefined"?u[g.name]:r.current_display_values[g.name],onChange:f},g.id)}):v.jsx(Tc,{rows:10})]})}),v.jsx(nn,{children:v.jsx(Je,{label:t("saveChanges"),className:"w-full",onClick:l,disabled:!u,pending:s})})]})})}function ny(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/contact-identifiers`,onData:n});return{contactIdentifiers:e,isLoading:r,pending:o,mutate:i}}function YT({identifier:t,onClear:e}){const{t:n}=Ue();return v.jsxs("div",{className:"flex items-center justify-between rounded-lg border text-xs",children:[v.jsxs("div",{className:"flex-col pl-4",children:[v.jsx("p",{className:"font-semibold",children:t.value}),v.jsx("p",{className:"text-core-gray-500",children:n("contactIdentifier")})]}),v.jsx("div",{className:"h-full border-l p-4 hover:cursor-pointer hover:bg-core-gray-50",onClick:()=>e&&e(t.value),children:v.jsx(vn,{className:"h-full",icon:"close"})})]})}function WT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contactIdentifiers:r,isLoading:o,mutate:i}=ny(),[a,s]=x.useState(""),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=l=>{s(l),u(!0)},p=async()=>{h.destroy(`${n}/contact-identifiers`,{value:a}).then(()=>i()).catch(e).finally(()=>u(!1))};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("contactIdentifiers")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("contactIdentifierDescription")})]}),o?v.jsx(Tc,{rows:10}):r==null?void 0:r.map(l=>v.jsx(YT,{identifier:l,onClear:f},l.value))]})})}),v.jsx(nn,{children:v.jsx(Je,{label:t("addIdentifier"),className:"w-full",variant:"secondary",onClick:()=>d("create")})})]}),v.jsx(Eo,{title:t("confirmClearContactIdentifier"),isOpen:c,primaryAction:{label:t("confirm"),action:p},secondaryAction:{label:t("cancel"),action:()=>u(!1)},onClose:()=>u(!1),children:v.jsx("p",{children:t("clearContactIdentifier",{value:a})})})]})}function KT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r}=ar(),{mutate:o}=ny(),[i,a]=x.useState(""),[s,c]=x.useState(!1),[u,d]=x.useState(!1),h=zt(),f=Dt(),p=()=>{c(!0),f.post(`${n}/contacts/link-identifier`,{contact_identifier_value:i,email:r.email}).then(()=>{o(),h("../profile/contact-identifiers")}).catch(e).finally(()=>{a(""),c(!1)})};return x.useEffect(()=>{!u&&i&&p()},[i]),v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile/contact-identifiers"})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>i&&p(),children:v.jsx(aa,{data:i,dataSetter:a,setDefer:d,label:t("contactIdentifier")})})}),v.jsx(nn,{children:v.jsx(Je,{label:t("addIdentifier"),className:"w-full",onClick:p,pending:s,disabled:!i})})]})})}function zT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/profile",element:v.jsx(GT,{})}),v.jsx(Ye,{path:"/profile/activity",element:v.jsx(qT,{})}),v.jsx(Ye,{path:"/profile/subscriptions",element:v.jsx(HT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers",element:v.jsx(WT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers/create",element:v.jsx(KT,{})}),v.jsx(Ye,{path:"/profile/contact-attributes",element:v.jsx($T,{})})]})}function XT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex h-16 items-center justify-between",children:[v.jsx("h1",{children:t("rewards")}),v.jsxs("div",{className:"flex flex-col items-center",children:[v.jsx("p",{children:e.credit_balance.balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})]})}function ry(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/rewards`,onData:n});return{rewards:e,isLoading:r,pending:o,mutate:i}}function jf({reward:t,selected:e,setSelected:n,disabled:r,readOnly:o}){const{portalSession:i}=je(),{contact:a}=ar();return v.jsxs("div",{className:`max-h-[48px] rounded-lg border ${r?"pointer-events-none opacity-40":!o&&"cursor-pointer"}`,children:[v.jsxs("div",{className:`flex items-center justify-between rounded-lg text-xs ${r?"px-2 pt-2":"p-2"}`,onClick:o?void 0:()=>(e==null?void 0:e.uuid)===t.uuid?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.media&&t.media.value?t.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:t.title??t.description})]}),v.jsxs("p",{className:"whitespace-nowrap text-core-primary-500",children:[t.required_credits," ",i.loyaltyProgram.custom_credit_name]})]}),t.required_credits-a.credit_balance.balance>0&&v.jsx(Vb,{value:a.credit_balance.balance,max:t.required_credits})]})}function QT({selected:t,setSelected:e}){const{t:n}=Ue(),{contact:r}=ar(),{rewards:o,isLoading:i}=ry(),a=o==null?void 0:o.filter(c=>c.required_credits<=r.credit_balance.balance),s=o==null?void 0:o.filter(c=>c.required_credits>r.credit_balance.balance);return v.jsx(v.Fragment,{children:i?v.jsx(Tc,{rows:1}):v.jsxs("div",{className:"flex flex-col gap-3 md:max-h-[528px]",children:[v.jsx("div",{className:"flex flex-col gap-1",children:(a==null?void 0:a.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("redeemableRewards")}),a.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e},c.uuid))]})}),v.jsx("div",{className:"flex flex-col gap-1",children:(s==null?void 0:s.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("saveABitMore")}),s.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e,disabled:!0},c.uuid))]})})]})})}function JT(){const{portalSession:t}=je(),{rewards:e}=ry(),n=()=>t.events.filter(r=>r.type===yo.REWARD_RECEPTION).map(r=>e.find(o=>o.uuid===r.data.reward.uuid)).filter(r=>r);return e?v.jsx("div",{children:v.jsx(y0,{children:n().map((r,o)=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-core-primary-100 bg-core-primary-50 p-2 text-xs",children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:r.media&&r.media.value?r.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-8 w-8 rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:r.title??r.description})]}),v.jsxs("p",{className:"text-core-primary-500",children:[r.required_credits," ",t.loyaltyProgram.custom_credit_name]})]},`${o}-${r.uuid}`))},n().length)}):v.jsx(v.Fragment,{})}function ZT(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{portalSession:r,mutate:o}=je(),{mutate:i}=ar(),{onClaimReward:a}=an(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),{post:p}=ws(),l=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const g=y=>{o().then(w=>{const E=w.data.data.events.filter(C=>C.type===yo.REWARD_RECEPTION&&C.data.reward.uuid===s.uuid).reduce((C,I)=>new Date(C.created_at)>new Date(I.created_at)?C:I);a==null||a(y,E.data.uuid)})},m=()=>{d(!0),l.post(`${r.uuid}/rewards/claim`,{uuid:s.uuid}).then(y=>{p(),i(),g(y.data.data),n(t("rewardClaimed",{name:y.data.data.title}))}).catch(e).finally(()=>{f(!1),c(void 0),d(!1)})};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(XT,{})}),v.jsx(kt,{children:v.jsx(QT,{selected:s,setSelected:c})}),v.jsx(nn,{children:v.jsx(JT,{})})]}),v.jsx(Eo,{title:t("confirmRewardRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:m,loading:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},onClose:()=>f(!1),children:v.jsx("div",{className:"flex flex-col gap-4",children:s&&v.jsx(jf,{reward:s,selected:s,setSelected:c,readOnly:!0})})})]})}function Vf(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/vouchers`,onData:n});return{vouchers:e,isLoading:r,pending:o,mutate:i}}function ex(){const{t}=Ue();return v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("vouchers")})})}function Uf({voucher:t,selected:e,setSelected:n}){const{t:r}=Ue();return v.jsxs("div",{className:`flex cursor-pointer items-center justify-between gap-4 rounded-lg ${t.status===Ea.REDEEMED?"border border-core-primary-100 bg-core-primary-50":"border bg-white"} p-2 text-xs`,onClick:()=>(e==null?void 0:e.code)===t.code?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.promotion.image?t.promotion.image.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsxs("div",{className:"overflow-hidden overflow-ellipsis ",children:[v.jsx("p",{className:"font-semibold",children:t.name}),t.status===Ea.REDEEMED?v.jsx("p",{className:"text-core-gray-500",children:r("redeemed")}):v.jsx("p",{className:"text-core-primary-500",children:t.expiration_date?`Valid until ${new Date(t.expiration_date).toLocaleDateString()}`:r("nonExpiring")})]})]}),v.jsx("p",{className:`text-core-${t.status===Ea.REDEEMED?"gray":"primary"}-500`,children:t.code})]})}function tx({selected:t,setSelected:e}){const{t:n}=Ue(),{vouchers:r,isLoading:o}=Vf();return v.jsx(v.Fragment,{children:o?v.jsx(Tc,{rows:1}):v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:r&&r.length?r.map(i=>v.jsx(Uf,{voucher:i,selected:t,setSelected:e},i.code)):v.jsx("p",{className:"text-center text-sm text-core-gray-500",children:n("vouchersEmptyState")})})})})}function nx(){const{t}=Ue(),{portalSession:e}=je(),{vouchers:n}=Vf(),r=()=>e.events.filter(o=>o.type===yo.VOUCHER_REDEEMED);return n?v.jsx("div",{children:v.jsx(y0,{children:r().map((o,i)=>v.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-core-primary-100 bg-core-primary-50 p-2",children:v.jsx("div",{className:"flex h-full flex-col justify-between text-xs",children:v.jsxs("div",{className:"overflow-hidden",children:[v.jsx("p",{className:"font-semibold",children:o.data.name}),v.jsxs("p",{className:"overflow-ellipsis text-core-gray-500",children:[o.data.code," - ",t("applied")]})]})})},`${i}-${o.data.uuid}`))},r().length)}):v.jsx(v.Fragment,{})}function rx(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{uuid:r}=je(),{onRedeemVoucher:o}=an(),{post:i}=ws(),{mutate:a}=Vf(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const l=()=>{d(!0),p.post(`${r}/vouchers/redeem`,{code:s.code}).then(m=>{i(),o&&o(m.data.data),n(t("voucherSuccessfullyRedeemed")),a()}).catch(e).finally(()=>{g(),d(!1)})},g=()=>{f(!1),c(void 0)};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(ex,{})}),v.jsx(kt,{children:v.jsx(tx,{selected:s,setSelected:c})}),v.jsx(nn,{children:v.jsx(nx,{})})]}),v.jsx(Eo,{title:t("confirmVoucherRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:l,loading:u},secondaryAction:{label:t("cancel"),action:g},onClose:g,children:v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{children:t("redeemTitle",{title:s==null?void 0:s.name})}),s&&v.jsx(Uf,{voucher:s,setSelected:c})]})})]})}function ox(){const{t}=Ue(),[e,n]=x.useState(1),r=zt(),o=[{id:0,label:t("profile"),icon:"user",pathname:"profile"},{id:1,label:t("rewards"),icon:"edit",pathname:"rewards"},{id:2,label:t("vouchers"),icon:"mail",pathname:"vouchers"}];return x.useEffect(()=>{r(o[e].pathname)},[]),v.jsx(Mf,{children:v.jsxs("div",{className:"relative h-full w-full select-none overflow-auto",children:[v.jsx(vE,{children:o.map(i=>v.jsx(wE,{id:i.id,label:i.label,icon:i.icon,activeTab:e,setActiveTab:n,pathname:i.pathname},i.id))}),v.jsxs(MT,{children:[v.jsx(zT,{}),v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/rewards",element:v.jsx(ZT,{})}),v.jsx(Ye,{path:"/vouchers",element:v.jsx(rx,{})})]})]})]})})}function ix(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(DT,{})}),v.jsx(Ye,{path:"/overview/*",element:v.jsx(ox,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PORTAL})})]})}function oy(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/prepaid`,onData:n});return{prepaidBalance:e,isLoading:r,pending:o,mutate:i}}function ax(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=an(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(In,{children:v.jsx(X2,{title:a.getDisplayName(),balance:(c==null?void 0:c.balance_in_cents)??0,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function sx({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),{portalSession:a}=je(),s=a.inputData.amount_in_cents??0,c=()=>{let d=0;return a.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d},u=()=>Math.min(s+c(),e);return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e,start:e+c(),currency:a.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"text-sm font-light text-gray-500",children:i("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u(),start:s,currency:a.currency,asCurrency:!0})})]})})]})}),v.jsx(nn,{children:v.jsx(Je,{label:i("confirmAndPay",{amount:Si(u(),a.currency)}),className:"w-full",onClick:()=>r==null?void 0:r(-u()),disabled:!s||!!c(),pending:o})})]})}function cx(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=an(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(In,{children:v.jsx(sx,{title:a.getDisplayName(),balance:c.balance_in_cents,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function ux({setType:t}){const{t:e}=Ue();return v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("Choose type")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Je,{className:"grow",label:e("pay"),onClick:()=>t(Kt.PAY_PREPAID)}),v.jsx(Je,{className:"grow",label:e("topUp"),onClick:()=>t(Kt.TOP_UP_PREPAID)})]})})]})})}function lx(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=an(),[n,r]=x.useState(t.type);if(!t.contact)return e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PREPAID}/email`}):v.jsx(dr,{to:`${Le.PREPAID}/identifier`});const o=()=>n===Kt.TOP_UP_PREPAID?v.jsx(ax,{}):n===Kt.PAY_PREPAID?v.jsx(cx,{}):v.jsx(ux,{setType:r});return v.jsx(Mf,{children:o()})}function dx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(lx,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Au,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PREPAID})})]})}function fx(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=()=>{s(!0),p.get(`${n}/vouchers/check/${o}`).then(g=>{g.data.data.contact||r.contact?f(`${o}/redeem`):h(!0)}).catch(e).finally(()=>s(!1))};return x.useEffect(()=>{!c&&o&&l()},[o]),v.jsxs(v.Fragment,{children:[v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:t("voucherCode").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(aa,{data:o,dataSetter:i,setDefer:u,label:t("code")})}),v.jsx(nn,{children:v.jsx(Je,{label:t("submit"),className:"w-full",onClick:l,pending:a})})]})}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:d,onClose:()=>h(!1),primaryAction:{label:t("linkToContact"),action:()=>f(`${o}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>h(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:o})})})]})}function hx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{uuid:r}=je(),{onRedeemVoucher:o}=an(),{post:i}=ws(),{voucher:a,mutate:s}=K2(n),[c,u]=x.useState(!1),d=Dt(),h=()=>{u(!0),d.post(`${r}/vouchers/redeem`,{code:n}).then(f=>{o==null||o(f.data.data),i(),s()}).catch(e).finally(()=>u(!1))};return a?v.jsx(In,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:"Voucher"})})}),v.jsx(kt,{children:v.jsx("div",{children:v.jsx(Uf,{voucher:a,setSelected:()=>{}})})}),v.jsx(nn,{children:v.jsx(Je,{label:t("redeemVoucher"),className:"w-full",onClick:h,disabled:a.status!==Ea.ACTIVE||c,pending:c})})]})}):v.jsx(_r,{})}function px(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=an(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m}),g=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&l(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(`${Le.VOUCHER}/${n}/redeem`))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{!d&&a&&g()},[a]),v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:g,children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:t("contactIdentifier")})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{label:t("continue"),onClick:g,pending:c}),r.inputData.enable_email_identification&&v.jsx(Je,{label:t("useEmail"),variant:"secondary",onClick:()=>f(`../${n}/email`)})]})})]})})}function gx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{onContactLink:r}=an(),{portalSession:o,mutate:i}=je(),{publish:a}=Oa(),[s,c]=x.useState(""),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=zt(),l=Dt(),g=w=>l.get(`${o.uuid}/contacts`,{contact_uuid:w}),m=()=>{d(!0),l.put(o.uuid,{email:s}).then(w=>{r&&g(w.data.data.contact.uuid).then(b=>{r==null||r(b.data.data)}),i().then(()=>p(`${Le.VOUCHER}/${n}/redeem`))}).catch(w=>{w.response.data.code===Ws.CONTACT_NOT_FOUND&&f(!0)}).finally(()=>d(!1))},y=()=>{d(!0),l.post(`${o.uuid}/contacts`,{email:s}).then(m).catch(e).finally(()=>d(!1))};return x.useEffect(()=>{a("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(In,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("fillInXBelow",{x:t("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>s&&!u&&m(),children:v.jsx(Yo,{id:"via-email-address-input",label:t("emailAddress"),autoFocus:!0,onChange:w=>c(w.target.value),beforeIcon:"mail"})})}),v.jsx(nn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Je,{label:t("continue"),className:"w-full",onClick:m,pending:u,disabled:!s||u}),v.jsx(Je,{label:t("useIdentifier"),variant:"secondary",onClick:()=>p(`../${n}/identifier`)})]})})]})}),v.jsx(Eo,{title:`${t("new")} ${t("emailAddress").toLowerCase()}`,isOpen:h,onClose:()=>f(!1),primaryAction:{label:t("confirm"),action:y,disabled:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},children:v.jsx("p",{children:t("continueWithEmail",{email:s})})})]})}function mx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(fx,{})}),v.jsx(Ye,{path:":code/redeem",element:v.jsx(hx,{})}),v.jsx(Ye,{path:":code/email",element:v.jsx(gx,{})}),v.jsx(Ye,{path:":code/identifier",element:v.jsx(px,{})})]})}function yx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx($A,{})}),v.jsx(Ye,{path:`${Le.GENERIC}/*`,element:v.jsx(AT,{})}),v.jsx(Ye,{path:`${Le.GIFTCARD}/*`,element:v.jsx(kT,{})}),v.jsx(Ye,{path:`${Le.POINTS_TRANSACTION}/*`,element:v.jsx(RT,{})}),v.jsx(Ye,{path:`${Le.PORTAL}/*`,element:v.jsx(ix,{})}),v.jsx(Ye,{path:`${Le.PREPAID}/*`,element:v.jsx(dx,{})}),v.jsx(Ye,{path:`${Le.VOUCHER}/*`,element:v.jsx(mx,{})})]})}function Gf(t){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(t)}function iy(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Gf(XMLHttpRequest))==="object"}function vx(t){return!!t&&typeof t.then=="function"}function wx(t){return vx(t)?t:Promise.resolve(t)}function bx(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qf={exports:{}},Iu={exports:{}},ay;function Ex(){return ay||(ay=1,function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wi<"u"&&wi,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s=typeof i<"u"&&i||typeof self<"u"&&self||typeof s<"u"&&s,c={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(k){return k&&d.indexOf(Object.prototype.toString.call(k))>-1};function f(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function p(k){return typeof k!="string"&&(k=String(k)),k}function l(k){var U={next:function(){var z=k.shift();return{done:z===void 0,value:z}}};return c.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(k){this.map={},k instanceof g?k.forEach(function(U,z){this.append(z,U)},this):Array.isArray(k)?k.forEach(function(U){this.append(U[0],U[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(U){this.append(U,k[U])},this)}g.prototype.append=function(k,U){k=f(k),U=p(U);var z=this.map[k];this.map[k]=z?z+", "+U:U},g.prototype.delete=function(k){delete this.map[f(k)]},g.prototype.get=function(k){return k=f(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(f(k))},g.prototype.set=function(k,U){this.map[f(k)]=p(U)},g.prototype.forEach=function(k,U){for(var z in this.map)this.map.hasOwnProperty(z)&&k.call(U,this.map[z],z,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(U,z){k.push(z)}),l(k)},g.prototype.values=function(){var k=[];return this.forEach(function(U){k.push(U)}),l(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(U,z){k.push([z,U])}),l(k)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function m(k){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}function y(k){return new Promise(function(U,z){k.onload=function(){U(k.result)},k.onerror=function(){z(k.error)}})}function w(k){var U=new FileReader,z=y(U);return U.readAsArrayBuffer(k),z}function b(k){var U=new FileReader,z=y(U);return U.readAsText(k),z}function E(k){for(var U=new Uint8Array(k),z=new Array(U.length),te=0;te<U.length;te++)z[te]=String.fromCharCode(U[te]);return z.join("")}function C(k){if(k.slice)return k.slice(0);var U=new Uint8Array(k.byteLength);return U.set(new Uint8Array(k)),U.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&u(k)?(this._bodyArrayBuffer=C(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||h(k))?this._bodyArrayBuffer=C(k):this._bodyText=k=Object.prototype.toString.call(k):this._bodyText="",this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=m(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(w)}),this.text=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(L)}),this.json=function(){return this.text().then(JSON.parse)},this}var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(k){var U=k.toUpperCase();return T.indexOf(U)>-1?U:k}function N(k,U){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var z=U.body;if(k instanceof N){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,U.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!z&&k._bodyInit!=null&&(z=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=P(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&z)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(z),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var te=/([?&])_=[^&]*/;if(te.test(this.url))this.url=this.url.replace(te,"$1_="+new Date().getTime());else{var oe=/\?/;this.url+=(oe.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function L(k){var U=new FormData;return k.trim().split("&").forEach(function(z){if(z){var te=z.split("="),oe=te.shift().replace(/\+/g," "),ne=te.join("=").replace(/\+/g," ");U.append(decodeURIComponent(oe),decodeURIComponent(ne))}}),U}function V(k){var U=new g,z=k.replace(/\r?\n[\t ]+/g," ");return z.split("\r").map(function(te){return te.indexOf(`
154
+ `)===0?te.substr(1,te.length):te}).forEach(function(te){var oe=te.split(":"),ne=oe.shift().trim();if(ne){var se=oe.join(":").trim();U.append(ne,se)}}),U}I.call(N.prototype);function j(k,U){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText=U.statusText===void 0?"":""+U.statusText,this.headers=new g(U.headers),this.url=U.url||"",this._initBody(k)}I.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},j.error=function(){var k=new j(null,{status:0,statusText:""});return k.type="error",k};var W=[301,302,303,307,308];j.redirect=function(k,U){if(W.indexOf(U)===-1)throw new RangeError("Invalid status code");return new j(null,{status:U,headers:{location:k}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(U,z){this.message=U,this.name=z;var te=Error(U);this.stack=te.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function q(k,U){return new Promise(function(z,te){var oe=new N(k,U);if(oe.signal&&oe.signal.aborted)return te(new a.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function se(){ne.abort()}ne.onload=function(){var le={status:ne.status,statusText:ne.statusText,headers:V(ne.getAllResponseHeaders()||"")};le.url="responseURL"in ne?ne.responseURL:le.headers.get("X-Request-URL");var _e="response"in ne?ne.response:ne.responseText;setTimeout(function(){z(new j(_e,le))},0)},ne.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},ne.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},ne.onabort=function(){setTimeout(function(){te(new a.DOMException("Aborted","AbortError"))},0)};function we(le){try{return le===""&&s.location.href?s.location.href:le}catch{return le}}ne.open(oe.method,we(oe.url),!0),oe.credentials==="include"?ne.withCredentials=!0:oe.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&(c.blob?ne.responseType="blob":c.arrayBuffer&&oe.headers.get("Content-Type")&&oe.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(ne.responseType="arraybuffer")),U&&typeof U.headers=="object"&&!(U.headers instanceof g)?Object.getOwnPropertyNames(U.headers).forEach(function(le){ne.setRequestHeader(le,p(U.headers[le]))}):oe.headers.forEach(function(le,_e){ne.setRequestHeader(_e,le)}),oe.signal&&(oe.signal.addEventListener("abort",se),ne.onreadystatechange=function(){ne.readyState===4&&oe.signal.removeEventListener("abort",se)}),ne.send(typeof oe._bodyInit>"u"?null:oe._bodyInit)})}return q.polyfill=!0,s.fetch||(s.fetch=q,s.Headers=g,s.Request=N,s.Response=j),a.Headers=g,a.Request=N,a.Response=j,a.fetch=q,a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e}(Iu,Iu.exports)),Iu.exports}(function(t,e){var n;if(typeof fetch=="function"&&(typeof wi<"u"&&wi.fetch?n=wi.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof bx<"u"&&typeof window>"u"){var r=n||Ex();r.default&&(r=r.default),e.default=r,t.exports=e.default}})(qf,qf.exports);var sy=qf.exports;const cy=Lu(sy),uy=Zy({__proto__:null,default:cy},[sy]);function ly(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function dy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ly(Object(n),!0).forEach(function(r){Cx(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cx(t,e,n){return e=_x(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _x(t){var e=Ax(t,"string");return gi(e)=="symbol"?e:e+""}function Ax(t,e){if(gi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(gi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gi(t){"@babel/helpers - typeof";return gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gi(t)}var io;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?io=global.fetch:typeof window<"u"&&window.fetch?io=window.fetch:io=fetch);var Cs;iy()&&(typeof global<"u"&&global.XMLHttpRequest?Cs=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Cs=window.XMLHttpRequest));var Tu;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?Tu=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(Tu=window.ActiveXObject)),!io&&uy&&!Cs&&!Tu&&(io=cy||uy),typeof io!="function"&&(io=void 0);var Hf=function(e,n){if(n&&gi(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},fy=function(e,n,r,o){var i=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(u){r(null,{status:c.status,data:u})}).catch(r)};if(o){var a=o(e,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(i).catch(r):io(e,n).then(i).catch(r)},hy=!1,Sx=function(e,n,r,o){e.queryStringParams&&(n=Hf(n,e.queryStringParams));var i=dy({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,s=dy({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:i},hy?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{fy(n,s,o,c)}catch(u){if(!a||Object.keys(a).length===0||!u.message||u.message.indexOf("not implemented")<0)return o(u);try{Object.keys(a).forEach(function(d){delete s[d]}),fy(n,s,o,c),hy=!0}catch(d){o(d)}}},Ix=function(e,n,r,o){r&&gi(r)==="object"&&(r=Hf("",r).slice(1)),e.queryStringParams&&(n=Hf(n,e.queryStringParams));try{var i;Cs?i=new Cs:i=new Tu("MSXML2.XMLHTTP.3.0"),i.open(r?"POST":"GET",n,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(c){console&&console.log(c)}},Tx=function(e,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},io&&n.indexOf("file:")!==0)return Sx(e,n,r,o);if(iy()||typeof ActiveXObject=="function")return Ix(e,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function sa(t){"@babel/helpers - typeof";return sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(t)}function py(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function $f(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?py(Object(n),!0).forEach(function(r){gy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):py(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xx(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ox(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,my(r.key),r)}}function Px(t,e,n){return e&&Ox(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function gy(t,e,n){return e=my(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function my(t){var e=kx(t,"string");return sa(e)=="symbol"?e:e+""}function kx(t,e){if(sa(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bx=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return gy({},r,o||"")},parseLoadPayload:function(n,r){},request:Tx,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},yy=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};xx(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return Px(t,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=$f($f($f({},Bx()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);sa(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,o)),c=wx(c),c.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(d,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,c=typeof i=="string"?[i]:i,u=this.options.parseLoadPayload(s,c);this.options.request(this.options,n,u,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+n+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+n+"; status code: "+h.status,!1);if(!h&&d&&d.message&&d.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+d.message,!0);if(d)return r(d,!1);var f,p;try{typeof h.data=="string"?f=a.options.parse(h.data,o,i):f=h.data}catch{p="failed parsing "+n+" to json"}if(p)return r(p,!1);r(null,f)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,o,i),u=0,d=[],h=[];n.forEach(function(f){var p=s.options.addPath;typeof s.options.addPath=="function"&&(p=s.options.addPath(f,r));var l=s.services.interpolator.interpolate(p,{lng:f,ns:r});s.options.request(s.options,l,c,function(g,m){u+=1,d.push(g),h.push(m),u===n.length&&typeof a=="function"&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var c=[],u=function(h){var f=i.toResolveHierarchy(h);f.forEach(function(p){c.indexOf(p)<0&&c.push(p)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),c.forEach(function(d){n.allOptions.ns.forEach(function(h){o.read(d,h,"read",null,null,function(f,p){f&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),f),!f&&p&&a.log("loaded namespace ".concat(h," for language ").concat(d),p),o.loaded("".concat(d,"|").concat(h),f,p)})})})}}}])}();yy.type="backend";const{slice:Nx,forEach:Rx}=[];function Dx(t){return Rx.call(Nx.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const vy=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Mx=(t,e,n)=>{const r=n||{};r.path=r.path||"/";const o=encodeURIComponent(e);let i=`${t}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!vy.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!vy.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},wy={create(t,e,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=Mx(t,encodeURIComponent(e),o)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(e)===0)return o.substring(e.length,o.length)}return null},remove(t){this.create(t,"",-1)}};var Lx={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return wy.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=e;n&&typeof document<"u"&&wy.create(n,t,r,o,i)}},Fx={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const c=a[s].indexOf("=");c>0&&a[s].substring(0,c)===e&&(n=a[s].substring(c+1))}}return n}};let _s=null;const by=()=>{if(_s!==null)return _s;try{_s=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{_s=!1}return _s};var jx={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&by())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&by()&&window.localStorage.setItem(n,t)}};let As=null;const Ey=()=>{if(As!==null)return As;try{As=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{As=!1}return As};var Vx={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&Ey())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&Ey()&&window.sessionStorage.setItem(n,t)}},Ux={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)e.push(n[i]);r&&e.push(r),o&&e.push(o)}return e.length>0?e:void 0}},Gx={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},qx={name:"path",lookup(t){var o;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof e=="number"?e:0])==null?void 0:o.replace("/",""):void 0}},Hx={name:"subdomain",lookup(t){var o,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function $x(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class Cy{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=Dx(n,this.options||{},$x()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Lx),this.addDetector(Fx),this.addDetector(jx),this.addDetector(Vx),this.addDetector(Ux),this.addDetector(Gx),this.addDetector(qx),this.addDetector(Hx)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}Cy.type="languageDetector",tn.use(yy).use(Cy).use(x4).init({fallbackLng:"en",lng:navigator.language&&navigator.language.substring(0,2),interpolation:{escapeValue:!1},backend:{loadPath:"https://translations.piggy.eu/portal-sessions/{{lng}}.json"}});function _y(){const{uuid:t,portalSession:e}=je(),[n,r]=x.useState();return cr({url:`${t}/brand-kit`,onData:r}),x.useEffect(()=>{n&&wb(n)},[n]),v.jsx(x.StrictMode,{children:v.jsxs(qA,{children:[v.jsx(Y3,{children:v.jsx(yx,{})}),v.jsx(Lb,{enabled:e.inputData.enable_on_screen_keyboard}),v.jsx(p4,{className:"lg:top-14"})]},t)})}function Ay(t){const{uuid:e,portalSession:n,error:r}=je();return n.uuid?v.jsx(Im.Provider,{value:{...t,cameraService:n.inputData.camera_service,cameraFacingMode:n.inputData.facing_mode,primaryIdentificationMethod:n.inputData.primary_identification_method},children:t.children}):v.jsx(_r,{message:r&&`No portal session found with uuid: ${e}.`})}function Yx(t){const{portalSession:e}=o3(t);return e?v.jsx(ju.Provider,{value:{apiKey:t.apiKey,host:t.host},children:v.jsx(b1,{uuid:e.uuid,children:v.jsx(Ay,{...t,children:v.jsx(_y,{})})})}):v.jsx(_r,{})}const Wx="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.37482%209.55838C0.802045%2011.696%200.887351%2013.9567%201.61959%2016.045C2.35183%2018.1334%203.69695%2019.9524%205.47921%2021.2642C7.26146%2022.5761%209.39798%2023.3199%2011.6096%2023.3985C13.8212%2023.477%2016.0051%2022.8866%2017.876%2021.7045C19.7468%2020.5223%2021.2175%2018.8034%2022.0961%2016.7722C22.9746%2014.7411%2023.2201%2012.4921%2022.8004%2010.3193C22.3807%208.1464%2021.3154%206.15066%2019.7436%204.59277C18.1718%203.03489%2016.1667%201.98732%2013.9902%201.58693M7.14096%202.53681C5.21049%203.48732%203.60119%204.98315%202.51232%206.8391M10.7049%201.48193C10.452%201.51191%2010.2003%201.55066%209.95012%201.59811M18.1995%2015.656C18.757%2014.5927%2019.0317%2013.4039%2018.9971%2012.2038C18.9625%2011.0037%2018.6198%209.83263%2018.002%208.8032C17.3842%207.77377%2016.512%206.92055%2015.4692%206.32553C14.4264%205.73051%2013.2481%205.4137%2012.0476%205.40554C10.847%205.39739%209.66449%205.69816%208.61372%206.27895C7.56295%206.85974%206.67923%207.70104%206.04747%208.72198C5.41572%209.74292%205.05717%2010.9092%205.00628%2012.1087C4.9554%2013.3082%205.21389%2014.5007%205.75691%2015.5714M9.15764%2013.3648C9.00624%2012.9162%208.96314%2012.4382%209.03189%2011.9698C9.10064%2011.5014%209.27926%2011.0559%209.55317%2010.6697C9.82708%2010.2836%2010.1885%209.96774%2010.6079%209.74803C11.0272%209.52832%2011.4926%209.41098%2011.966%209.4056C12.4394%209.40023%2012.9074%209.50697%2013.3316%209.71709C13.7559%209.92722%2014.1244%2010.2348%2014.407%2010.6146C14.6896%2010.9944%2014.8783%2011.4358%2014.9576%2011.9025C15.037%2012.3692%2015.0048%2012.8481%2014.8636%2013.3M14.0993%2010.2622C14.0043%2010.1691%2013.9032%2010.0825%2013.7967%2010.0028M8.2478%2018.3147C9.32147%2018.9965%2010.5606%2019.3728%2011.832%2019.4033C13.1035%2019.4339%2014.3592%2019.1174%2015.4644%2018.488'%20stroke='%233430FF'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";function Kx({message:t}){return v.jsxs("div",{className:"flex h-screen flex-col justify-center gap-12 text-center",children:[v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx("img",{alt:"logo",src:Wx,className:"z-10 h-16 w-16 hover:animate-spin"}),v.jsxs("p",{className:"z-10 text-7xl font-semibold tracking-wide text-gray-600",children:["Welcome to ",v.jsx("span",{className:"italic",children:"PortalSessions"})]})]}),v.jsx("p",{className:"text-core-red-500",children:t})]})}function zx({uuid:t,host:e}){return t?v.jsx(ju.Provider,{value:{host:e},children:v.jsx(b1,{uuid:t,children:v.jsx(Ay,{children:v.jsx(_y,{})})})}):v.jsx(Kx,{message:"No uuid provided."})}const Xx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M8 4.75V8.25M16 4.75V8.25M7.75 10.75H16.25M6.75 19.25H17.25C18.3546 19.25 19.25 18.3546 19.25 17.25V8.75C19.25 7.64543 18.3546 6.75 17.25 6.75H6.75C5.64543 6.75 4.75 7.64543 4.75 8.75V17.25C4.75 18.3546 5.64543 19.25 6.75 19.25Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),Qx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("path",{d:"m21.25 7.5c.3796958 0 .693491.28215388.7431534.64822944l.0068466.10177056v8.5c0 1.7330315-1.3564548 3.1492459-3.0655761 3.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555 0-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932 1.06066018 0 .26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734 0 1.6711923-.7071103 1.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815 2 2c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554 0 .03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2 2c-.2928932.29289321-.767767.29289321-1.0606602 0-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734 0-1.67119234.70711027-1.7441988 1.60647279l-.0058012.14352721v8.5c0 .4142136-.33578644.75-.75.75-.37969577 0-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146 1.35645477-3.14924593 3.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117 5.85294824c2.209139 0 4 1.790861 4 4s-1.790861 4-4 4-4-1.790861-4-4 1.790861-4 4-4zm0 1.5c-1.3807119 0-2.5 1.1192881-2.5 2.5s1.1192881 2.5 2.5 2.5 2.5-1.1192881 2.5-2.5-1.1192881-2.5-2.5-2.5z",fill:"#212121"}))},Symbol.toStringTag,{value:"Module"})),Jx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M13.25 8.75L9.75 12L13.25 15.25",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),Zx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M17.25 6.75L6.75 17.25M6.75 6.75L17.25 17.25",strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),eO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("path",{d:"M4.7002 4.70016L11.2999 11.2998",stroke:"#000",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M11.2998 4.70016L4.70014 11.2998",stroke:"#000",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),tO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("circle",{cx:12,cy:12,r:7.25,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M14.25 8.75H11.375C10.4775 8.75 9.75 9.47754 9.75 10.375V10.375C9.75 11.2725 10.4775 12 11.375 12H12.625C13.5225 12 14.25 12.7275 14.25 13.625V13.625C14.25 14.5225 13.5225 15.25 12.625 15.25H9.75"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 7.75V8.25"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15.75V16.25"}))},Symbol.toStringTag,{value:"Module"})),nO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M19.25 19.25H13.75M9 18.25L4.75 19.25L5.75 15L15.0429 5.70711C15.4334 5.31658 16.0666 5.31658 16.4571 5.70711L18.2929 7.54289C18.6834 7.93342 18.6834 8.56658 18.2929 8.95711L9 18.25Z",strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),rO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M6.75024 19.2502H17.2502C18.3548 19.2502 19.2502 18.3548 19.2502 17.2502V9.75025L12.0002 4.75024L4.75024 9.75025V17.2502C4.75024 18.3548 5.64568 19.2502 6.75024 19.2502Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M9.74963 15.7493C9.74963 14.6447 10.6451 13.7493 11.7496 13.7493H12.2496C13.3542 13.7493 14.2496 14.6447 14.2496 15.7493V19.2493H9.74963V15.7493Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),oO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 13V15"}),ce.createElement("circle",{cx:12,cy:9,r:.5}),ce.createElement("circle",{cx:12,cy:12,r:7.25,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}))},Symbol.toStringTag,{value:"Module"})),iO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M5.5 6.5L12 12.25L18.5 6.5M6.75 18.25H17.25C18.3546 18.25 19.25 17.3546 19.25 16.25V7.75C19.25 6.64543 18.3546 5.75 17.25 5.75H6.75C5.64543 5.75 4.75 6.64543 4.75 7.75V16.25C4.75 17.3546 5.64543 18.25 6.75 18.25Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),aO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_17_95)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#FEF3F2"}),ce.createElement("path",{d:"M12.0003 12L20.0003 20M12.0003 20L20.0003 12",stroke:"#E02731",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_17_95"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),sO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_15_20)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#E7FBF4"}),ce.createElement("path",{d:"M10.6668 17.3333L14.6668 20L21.3335 12",stroke:"#039855",strokeWidth:1.6875,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_15_20"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),cO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_17_99)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#FFFAEB"}),ce.createElement("path",{d:"M16.0002 17.3333V13.3333M16.0002 20V20.0067M23.0353 19.3333L17.942 10.456C17.0833 8.95867 14.9167 8.95867 14.058 10.456L8.96533 19.3333C8.11266 20.8187 9.18933 22.6667 10.9073 22.6667H21.0933C22.8107 22.6667 23.8873 20.8187 23.0353 19.3333Z",stroke:"#CFAA25",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_17_99"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),uO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M13.1191 5.61336C13.0508 5.11856 12.6279 4.75 12.1285 4.75H11.8715C11.3721 4.75 10.9492 5.11856 10.8809 5.61336L10.7938 6.24511C10.7382 6.64815 10.4403 6.96897 10.0622 7.11922C10.006 7.14156 9.95021 7.16484 9.89497 7.18905C9.52217 7.3524 9.08438 7.3384 8.75876 7.09419L8.45119 6.86351C8.05307 6.56492 7.49597 6.60451 7.14408 6.9564L6.95641 7.14408C6.60452 7.49597 6.56492 8.05306 6.86351 8.45118L7.09419 8.75876C7.33841 9.08437 7.3524 9.52216 7.18905 9.89497C7.16484 9.95021 7.14156 10.006 7.11922 10.0622C6.96897 10.4403 6.64815 10.7382 6.24511 10.7938L5.61336 10.8809C5.11856 10.9492 4.75 11.372 4.75 11.8715V12.1285C4.75 12.6279 5.11856 13.0508 5.61336 13.1191L6.24511 13.2062C6.64815 13.2618 6.96897 13.5597 7.11922 13.9378C7.14156 13.994 7.16484 14.0498 7.18905 14.105C7.3524 14.4778 7.3384 14.9156 7.09419 15.2412L6.86351 15.5488C6.56492 15.9469 6.60451 16.504 6.9564 16.8559L7.14408 17.0436C7.49597 17.3955 8.05306 17.4351 8.45118 17.1365L8.75876 16.9058C9.08437 16.6616 9.52216 16.6476 9.89496 16.811C9.95021 16.8352 10.006 16.8584 10.0622 16.8808C10.4403 17.031 10.7382 17.3519 10.7938 17.7549L10.8809 18.3866C10.9492 18.8814 11.3721 19.25 11.8715 19.25H12.1285C12.6279 19.25 13.0508 18.8814 13.1191 18.3866L13.2062 17.7549C13.2618 17.3519 13.5597 17.031 13.9378 16.8808C13.994 16.8584 14.0498 16.8352 14.105 16.8109C14.4778 16.6476 14.9156 16.6616 15.2412 16.9058L15.5488 17.1365C15.9469 17.4351 16.504 17.3955 16.8559 17.0436L17.0436 16.8559C17.3955 16.504 17.4351 15.9469 17.1365 15.5488L16.9058 15.2412C16.6616 14.9156 16.6476 14.4778 16.811 14.105C16.8352 14.0498 16.8584 13.994 16.8808 13.9378C17.031 13.5597 17.3519 13.2618 17.7549 13.2062L18.3866 13.1191C18.8814 13.0508 19.25 12.6279 19.25 12.1285V11.8715C19.25 11.3721 18.8814 10.9492 18.3866 10.8809L17.7549 10.7938C17.3519 10.7382 17.031 10.4403 16.8808 10.0622C16.8584 10.006 16.8352 9.95021 16.8109 9.89496C16.6476 9.52216 16.6616 9.08437 16.9058 8.75875L17.1365 8.4512C17.4351 8.05308 17.3955 7.49599 17.0436 7.1441L16.8559 6.95642C16.504 6.60453 15.9469 6.56494 15.5488 6.86353L15.2412 7.09419C14.9156 7.33841 14.4778 7.3524 14.105 7.18905C14.0498 7.16484 13.994 7.14156 13.9378 7.11922C13.5597 6.96897 13.2618 6.64815 13.2062 6.24511L13.1191 5.61336Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M13.25 12C13.25 12.6904 12.6904 13.25 12 13.25C11.3096 13.25 10.75 12.6904 10.75 12C10.75 11.3096 11.3096 10.75 12 10.75C12.6904 10.75 13.25 11.3096 13.25 12Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),lO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.25 7.75H5.75V16.75L4.75 19.25H19.25L18.25 16.75V7.75Z"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.25 7.75L16.25 4.75H7.75L5.75 7.75"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 10.75V11.75C9.75 12.9926 10.7574 14 12 14V14C13.2426 14 14.25 12.9926 14.25 11.75V10.75"}))},Symbol.toStringTag,{value:"Module"})),dO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 4.75L13.75 10.25H19.25L14.75 13.75L16.25 19.25L12 15.75L7.75 19.25L9.25 13.75L4.75 10.25H10.25L12 4.75Z"}))},Symbol.toStringTag,{value:"Module"})),fO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M15.25 8C15.25 9.79493 13.7949 11.25 12 11.25C10.205 11.25 8.74997 9.79493 8.74997 8C8.74997 6.20507 10.205 4.75 12 4.75C13.7949 4.75 15.25 6.20507 15.25 8Z"}),ce.createElement("path",{d:"M6.84748 19.25H17.1525C18.2944 19.25 19.174 18.2681 18.6407 17.2584C17.8563 15.7731 16.068 14 12 14C7.93198 14 6.14364 15.7731 5.35921 17.2584C4.82594 18.2681 5.70556 19.25 6.84748 19.25Z"}))},Symbol.toStringTag,{value:"Module"})),hO=Object.freeze(Object.defineProperty({__proto__:null,createWorker:()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
155
155
  class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
156
156
  class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,
157
157
  this.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric="numeric";C.Alphanumeric="alphanumeric";C.Byte="byte";C.Kanji="kanji";C.ECI="eci";C.StructuredAppend="structuredappend";var D,E=D||(D={});E[E.Terminator=0]="Terminator";E[E.Numeric=1]="Numeric";E[E.Alphanumeric=2]="Alphanumeric";E[E.Byte=4]="Byte";E[E.Kanji=8]="Kanji";E[E.ECI=7]="ECI";E[E.StructuredAppend=3]="StructuredAppend";let F="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".split("");