31 lines
625 KiB
JavaScript
31 lines
625 KiB
JavaScript
function mg(f,g){for(var d=0;d<g.length;d++){const y=g[d];if(typeof y!="string"&&!Array.isArray(y)){for(const C in y)if(C!=="default"&&!(C in f)){const E=Object.getOwnPropertyDescriptor(y,C);E&&Object.defineProperty(f,C,E.get?E:{enumerable:!0,get:()=>y[C]})}}}return Object.freeze(Object.defineProperty(f,Symbol.toStringTag,{value:"Module"}))}(function(){const g=document.createElement("link").relList;if(g&&g.supports&&g.supports("modulepreload"))return;for(const C of document.querySelectorAll('link[rel="modulepreload"]'))y(C);new MutationObserver(C=>{for(const E of C)if(E.type==="childList")for(const O of E.addedNodes)O.tagName==="LINK"&&O.rel==="modulepreload"&&y(O)}).observe(document,{childList:!0,subtree:!0});function d(C){const E={};return C.integrity&&(E.integrity=C.integrity),C.referrerPolicy&&(E.referrerPolicy=C.referrerPolicy),C.crossOrigin==="use-credentials"?E.credentials="include":C.crossOrigin==="anonymous"?E.credentials="omit":E.credentials="same-origin",E}function y(C){if(C.ep)return;C.ep=!0;const E=d(C);fetch(C.href,E)}})();var $o=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function dd(f){return f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f.default:f}var r1={exports:{}},Ts={};var Dh;function yg(){if(Dh)return Ts;Dh=1;var f=Symbol.for("react.transitional.element"),g=Symbol.for("react.fragment");function d(y,C,E){var O=null;if(E!==void 0&&(O=""+E),C.key!==void 0&&(O=""+C.key),"key"in C){E={};for(var R in C)R!=="key"&&(E[R]=C[R])}else E=C;return C=E.ref,{$$typeof:f,type:y,key:O,ref:C!==void 0?C:null,props:E}}return Ts.Fragment=g,Ts.jsx=d,Ts.jsxs=d,Ts}var Bh;function pg(){return Bh||(Bh=1,r1.exports=yg()),r1.exports}var G=pg(),l1={exports:{}},vs={},s1={exports:{}},o1={};var Lh;function Ag(){return Lh||(Lh=1,(function(f){function g(J,oe){var Oe=J.length;J.push(oe);e:for(;0<Oe;){var Qe=Oe-1>>>1,Ke=J[Qe];if(0<C(Ke,oe))J[Qe]=oe,J[Oe]=Ke,Oe=Qe;else break e}}function d(J){return J.length===0?null:J[0]}function y(J){if(J.length===0)return null;var oe=J[0],Oe=J.pop();if(Oe!==oe){J[0]=Oe;e:for(var Qe=0,Ke=J.length,F=Ke>>>1;Qe<F;){var re=2*(Qe+1)-1,Ee=J[re],Ce=re+1,ke=J[Ce];if(0>C(Ee,Oe))Ce<Ke&&0>C(ke,Ee)?(J[Qe]=ke,J[Ce]=Oe,Qe=Ce):(J[Qe]=Ee,J[re]=Oe,Qe=re);else if(Ce<Ke&&0>C(ke,Oe))J[Qe]=ke,J[Ce]=Oe,Qe=Ce;else break e}}return oe}function C(J,oe){var Oe=J.sortIndex-oe.sortIndex;return Oe!==0?Oe:J.id-oe.id}if(f.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var E=performance;f.unstable_now=function(){return E.now()}}else{var O=Date,R=O.now();f.unstable_now=function(){return O.now()-R}}var b=[],A=[],N=1,M=null,H=3,Z=!1,ee=!1,ie=!1,ae=!1,pe=typeof setTimeout=="function"?setTimeout:null,de=typeof clearTimeout=="function"?clearTimeout:null,ne=typeof setImmediate<"u"?setImmediate:null;function we(J){for(var oe=d(A);oe!==null;){if(oe.callback===null)y(A);else if(oe.startTime<=J)y(A),oe.sortIndex=oe.expirationTime,g(b,oe);else break;oe=d(A)}}function Pe(J){if(ie=!1,we(J),!ee)if(d(b)!==null)ee=!0,Be||(Be=!0,Ne());else{var oe=d(A);oe!==null&&q(Pe,oe.startTime-J)}}var Be=!1,le=-1,Re=5,fe=-1;function Gt(){return ae?!0:!(f.unstable_now()-fe<Re)}function Ze(){if(ae=!1,Be){var J=f.unstable_now();fe=J;var oe=!0;try{e:{ee=!1,ie&&(ie=!1,de(le),le=-1),Z=!0;var Oe=H;try{t:{for(we(J),M=d(b);M!==null&&!(M.expirationTime>J&&Gt());){var Qe=M.callback;if(typeof Qe=="function"){M.callback=null,H=M.priorityLevel;var Ke=Qe(M.expirationTime<=J);if(J=f.unstable_now(),typeof Ke=="function"){M.callback=Ke,we(J),oe=!0;break t}M===d(b)&&y(b),we(J)}else y(b);M=d(b)}if(M!==null)oe=!0;else{var F=d(A);F!==null&&q(Pe,F.startTime-J),oe=!1}}break e}finally{M=null,H=Oe,Z=!1}oe=void 0}}finally{oe?Ne():Be=!1}}}var Ne;if(typeof ne=="function")Ne=function(){ne(Ze)};else if(typeof MessageChannel<"u"){var We=new MessageChannel,at=We.port2;We.port1.onmessage=Ze,Ne=function(){at.postMessage(null)}}else Ne=function(){pe(Ze,0)};function q(J,oe){le=pe(function(){J(f.unstable_now())},oe)}f.unstable_IdlePriority=5,f.unstable_ImmediatePriority=1,f.unstable_LowPriority=4,f.unstable_NormalPriority=3,f.unstable_Profiling=null,f.unstable_UserBlockingPriority=2,f.unstable_cancelCallback=function(J){J.callback=null},f.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Re=0<J?Math.floor(1e3/J):5},f.unstable_getCurrentPriorityLevel=function(){return H},f.unstable_next=function(J){switch(H){case 1:case 2:case 3:var oe=3;break;default:oe=H}var Oe=H;H=oe;try{return J()}finally{H=Oe}},f.unstable_requestPaint=function(){ae=!0},f.unstable_runWithPriority=function(J,oe){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var Oe=H;H=J;try{return oe()}finally{H=Oe}},f.unstable_scheduleCallback=function(J,oe,Oe){var Qe=f.unstable_now();switch(typeof Oe=="object"&&Oe!==null?(Oe=Oe.delay,Oe=typeof Oe=="number"&&0<Oe?Qe+Oe:Qe):Oe=Qe,J){case 1:var Ke=-1;break;case 2:Ke=250;break;case 5:Ke=1073741823;break;case 4:Ke=1e4;break;default:Ke=5e3}return Ke=Oe+Ke,J={id:N++,callback:oe,priorityLevel:J,startTime:Oe,expirationTime:Ke,sortIndex:-1},Oe>Qe?(J.sortIndex=Oe,g(A,J),d(b)===null&&J===d(A)&&(ie?(de(le),le=-1):ie=!0,q(Pe,Oe-Qe))):(J.sortIndex=Ke,g(b,J),ee||Z||(ee=!0,Be||(Be=!0,Ne()))),J},f.unstable_shouldYield=Gt,f.unstable_wrapCallback=function(J){var oe=H;return function(){var Oe=H;H=oe;try{return J.apply(this,arguments)}finally{H=Oe}}}})(o1)),o1}var Uh;function Eg(){return Uh||(Uh=1,s1.exports=Ag()),s1.exports}var u1={exports:{}},je={};var zh;function Cg(){if(zh)return je;zh=1;var f=Symbol.for("react.transitional.element"),g=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),y=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),O=Symbol.for("react.context"),R=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),A=Symbol.for("react.memo"),N=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),H=Symbol.iterator;function Z(F){return F===null||typeof F!="object"?null:(F=H&&F[H]||F["@@iterator"],typeof F=="function"?F:null)}var ee={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ie=Object.assign,ae={};function pe(F,re,Ee){this.props=F,this.context=re,this.refs=ae,this.updater=Ee||ee}pe.prototype.isReactComponent={},pe.prototype.setState=function(F,re){if(typeof F!="object"&&typeof F!="function"&&F!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,F,re,"setState")},pe.prototype.forceUpdate=function(F){this.updater.enqueueForceUpdate(this,F,"forceUpdate")};function de(){}de.prototype=pe.prototype;function ne(F,re,Ee){this.props=F,this.context=re,this.refs=ae,this.updater=Ee||ee}var we=ne.prototype=new de;we.constructor=ne,ie(we,pe.prototype),we.isPureReactComponent=!0;var Pe=Array.isArray;function Be(){}var le={H:null,A:null,T:null,S:null},Re=Object.prototype.hasOwnProperty;function fe(F,re,Ee){var Ce=Ee.ref;return{$$typeof:f,type:F,key:re,ref:Ce!==void 0?Ce:null,props:Ee}}function Gt(F,re){return fe(F.type,re,F.props)}function Ze(F){return typeof F=="object"&&F!==null&&F.$$typeof===f}function Ne(F){var re={"=":"=0",":":"=2"};return"$"+F.replace(/[=:]/g,function(Ee){return re[Ee]})}var We=/\/+/g;function at(F,re){return typeof F=="object"&&F!==null&&F.key!=null?Ne(""+F.key):re.toString(36)}function q(F){switch(F.status){case"fulfilled":return F.value;case"rejected":throw F.reason;default:switch(typeof F.status=="string"?F.then(Be,Be):(F.status="pending",F.then(function(re){F.status==="pending"&&(F.status="fulfilled",F.value=re)},function(re){F.status==="pending"&&(F.status="rejected",F.reason=re)})),F.status){case"fulfilled":return F.value;case"rejected":throw F.reason}}throw F}function J(F,re,Ee,Ce,ke){var Ae=typeof F;(Ae==="undefined"||Ae==="boolean")&&(F=null);var ct=!1;if(F===null)ct=!0;else switch(Ae){case"bigint":case"string":case"number":ct=!0;break;case"object":switch(F.$$typeof){case f:case g:ct=!0;break;case N:return ct=F._init,J(ct(F._payload),re,Ee,Ce,ke)}}if(ct)return ke=ke(F),ct=Ce===""?"."+at(F,0):Ce,Pe(ke)?(Ee="",ct!=null&&(Ee=ct.replace(We,"$&/")+"/"),J(ke,re,Ee,"",function(Ii){return Ii})):ke!=null&&(Ze(ke)&&(ke=Gt(ke,Ee+(ke.key==null||F&&F.key===ke.key?"":(""+ke.key).replace(We,"$&/")+"/")+ct)),re.push(ke)),1;ct=0;var ft=Ce===""?".":Ce+":";if(Pe(F))for(var Dt=0;Dt<F.length;Dt++)Ce=F[Dt],Ae=ft+at(Ce,Dt),ct+=J(Ce,re,Ee,Ae,ke);else if(Dt=Z(F),typeof Dt=="function")for(F=Dt.call(F),Dt=0;!(Ce=F.next()).done;)Ce=Ce.value,Ae=ft+at(Ce,Dt++),ct+=J(Ce,re,Ee,Ae,ke);else if(Ae==="object"){if(typeof F.then=="function")return J(q(F),re,Ee,Ce,ke);throw re=String(F),Error("Objects are not valid as a React child (found: "+(re==="[object Object]"?"object with keys {"+Object.keys(F).join(", ")+"}":re)+"). If you meant to render a collection of children, use an array instead.")}return ct}function oe(F,re,Ee){if(F==null)return F;var Ce=[],ke=0;return J(F,Ce,"","",function(Ae){return re.call(Ee,Ae,ke++)}),Ce}function Oe(F){if(F._status===-1){var re=F._result;re=re(),re.then(function(Ee){(F._status===0||F._status===-1)&&(F._status=1,F._result=Ee)},function(Ee){(F._status===0||F._status===-1)&&(F._status=2,F._result=Ee)}),F._status===-1&&(F._status=0,F._result=re)}if(F._status===1)return F._result.default;throw F._result}var Qe=typeof reportError=="function"?reportError:function(F){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var re=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof F=="object"&&F!==null&&typeof F.message=="string"?String(F.message):String(F),error:F});if(!window.dispatchEvent(re))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",F);return}console.error(F)},Ke={map:oe,forEach:function(F,re,Ee){oe(F,function(){re.apply(this,arguments)},Ee)},count:function(F){var re=0;return oe(F,function(){re++}),re},toArray:function(F){return oe(F,function(re){return re})||[]},only:function(F){if(!Ze(F))throw Error("React.Children.only expected to receive a single React element child.");return F}};return je.Activity=M,je.Children=Ke,je.Component=pe,je.Fragment=d,je.Profiler=C,je.PureComponent=ne,je.StrictMode=y,je.Suspense=b,je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=le,je.__COMPILER_RUNTIME={__proto__:null,c:function(F){return le.H.useMemoCache(F)}},je.cache=function(F){return function(){return F.apply(null,arguments)}},je.cacheSignal=function(){return null},je.cloneElement=function(F,re,Ee){if(F==null)throw Error("The argument must be a React element, but you passed "+F+".");var Ce=ie({},F.props),ke=F.key;if(re!=null)for(Ae in re.key!==void 0&&(ke=""+re.key),re)!Re.call(re,Ae)||Ae==="key"||Ae==="__self"||Ae==="__source"||Ae==="ref"&&re.ref===void 0||(Ce[Ae]=re[Ae]);var Ae=arguments.length-2;if(Ae===1)Ce.children=Ee;else if(1<Ae){for(var ct=Array(Ae),ft=0;ft<Ae;ft++)ct[ft]=arguments[ft+2];Ce.children=ct}return fe(F.type,ke,Ce)},je.createContext=function(F){return F={$$typeof:O,_currentValue:F,_currentValue2:F,_threadCount:0,Provider:null,Consumer:null},F.Provider=F,F.Consumer={$$typeof:E,_context:F},F},je.createElement=function(F,re,Ee){var Ce,ke={},Ae=null;if(re!=null)for(Ce in re.key!==void 0&&(Ae=""+re.key),re)Re.call(re,Ce)&&Ce!=="key"&&Ce!=="__self"&&Ce!=="__source"&&(ke[Ce]=re[Ce]);var ct=arguments.length-2;if(ct===1)ke.children=Ee;else if(1<ct){for(var ft=Array(ct),Dt=0;Dt<ct;Dt++)ft[Dt]=arguments[Dt+2];ke.children=ft}if(F&&F.defaultProps)for(Ce in ct=F.defaultProps,ct)ke[Ce]===void 0&&(ke[Ce]=ct[Ce]);return fe(F,Ae,ke)},je.createRef=function(){return{current:null}},je.forwardRef=function(F){return{$$typeof:R,render:F}},je.isValidElement=Ze,je.lazy=function(F){return{$$typeof:N,_payload:{_status:-1,_result:F},_init:Oe}},je.memo=function(F,re){return{$$typeof:A,type:F,compare:re===void 0?null:re}},je.startTransition=function(F){var re=le.T,Ee={};le.T=Ee;try{var Ce=F(),ke=le.S;ke!==null&&ke(Ee,Ce),typeof Ce=="object"&&Ce!==null&&typeof Ce.then=="function"&&Ce.then(Be,Qe)}catch(Ae){Qe(Ae)}finally{re!==null&&Ee.types!==null&&(re.types=Ee.types),le.T=re}},je.unstable_useCacheRefresh=function(){return le.H.useCacheRefresh()},je.use=function(F){return le.H.use(F)},je.useActionState=function(F,re,Ee){return le.H.useActionState(F,re,Ee)},je.useCallback=function(F,re){return le.H.useCallback(F,re)},je.useContext=function(F){return le.H.useContext(F)},je.useDebugValue=function(){},je.useDeferredValue=function(F,re){return le.H.useDeferredValue(F,re)},je.useEffect=function(F,re){return le.H.useEffect(F,re)},je.useEffectEvent=function(F){return le.H.useEffectEvent(F)},je.useId=function(){return le.H.useId()},je.useImperativeHandle=function(F,re,Ee){return le.H.useImperativeHandle(F,re,Ee)},je.useInsertionEffect=function(F,re){return le.H.useInsertionEffect(F,re)},je.useLayoutEffect=function(F,re){return le.H.useLayoutEffect(F,re)},je.useMemo=function(F,re){return le.H.useMemo(F,re)},je.useOptimistic=function(F,re){return le.H.useOptimistic(F,re)},je.useReducer=function(F,re,Ee){return le.H.useReducer(F,re,Ee)},je.useRef=function(F){return le.H.useRef(F)},je.useState=function(F){return le.H.useState(F)},je.useSyncExternalStore=function(F,re,Ee){return le.H.useSyncExternalStore(F,re,Ee)},je.useTransition=function(){return le.H.useTransition()},je.version="19.2.0",je}var kh;function p1(){return kh||(kh=1,u1.exports=Cg()),u1.exports}var c1={exports:{}},Rn={};var Fh;function wg(){if(Fh)return Rn;Fh=1;var f=p1();function g(b){var A="https://react.dev/errors/"+b;if(1<arguments.length){A+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)A+="&args[]="+encodeURIComponent(arguments[N])}return"Minified React error #"+b+"; visit "+A+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(){}var y={d:{f:d,r:function(){throw Error(g(522))},D:d,C:d,L:d,m:d,X:d,S:d,M:d},p:0,findDOMNode:null},C=Symbol.for("react.portal");function E(b,A,N){var M=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:C,key:M==null?null:""+M,children:b,containerInfo:A,implementation:N}}var O=f.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function R(b,A){if(b==="font")return"";if(typeof A=="string")return A==="use-credentials"?A:""}return Rn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,Rn.createPortal=function(b,A){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!A||A.nodeType!==1&&A.nodeType!==9&&A.nodeType!==11)throw Error(g(299));return E(b,A,null,N)},Rn.flushSync=function(b){var A=O.T,N=y.p;try{if(O.T=null,y.p=2,b)return b()}finally{O.T=A,y.p=N,y.d.f()}},Rn.preconnect=function(b,A){typeof b=="string"&&(A?(A=A.crossOrigin,A=typeof A=="string"?A==="use-credentials"?A:"":void 0):A=null,y.d.C(b,A))},Rn.prefetchDNS=function(b){typeof b=="string"&&y.d.D(b)},Rn.preinit=function(b,A){if(typeof b=="string"&&A&&typeof A.as=="string"){var N=A.as,M=R(N,A.crossOrigin),H=typeof A.integrity=="string"?A.integrity:void 0,Z=typeof A.fetchPriority=="string"?A.fetchPriority:void 0;N==="style"?y.d.S(b,typeof A.precedence=="string"?A.precedence:void 0,{crossOrigin:M,integrity:H,fetchPriority:Z}):N==="script"&&y.d.X(b,{crossOrigin:M,integrity:H,fetchPriority:Z,nonce:typeof A.nonce=="string"?A.nonce:void 0})}},Rn.preinitModule=function(b,A){if(typeof b=="string")if(typeof A=="object"&&A!==null){if(A.as==null||A.as==="script"){var N=R(A.as,A.crossOrigin);y.d.M(b,{crossOrigin:N,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0})}}else A==null&&y.d.M(b)},Rn.preload=function(b,A){if(typeof b=="string"&&typeof A=="object"&&A!==null&&typeof A.as=="string"){var N=A.as,M=R(N,A.crossOrigin);y.d.L(b,N,{crossOrigin:M,integrity:typeof A.integrity=="string"?A.integrity:void 0,nonce:typeof A.nonce=="string"?A.nonce:void 0,type:typeof A.type=="string"?A.type:void 0,fetchPriority:typeof A.fetchPriority=="string"?A.fetchPriority:void 0,referrerPolicy:typeof A.referrerPolicy=="string"?A.referrerPolicy:void 0,imageSrcSet:typeof A.imageSrcSet=="string"?A.imageSrcSet:void 0,imageSizes:typeof A.imageSizes=="string"?A.imageSizes:void 0,media:typeof A.media=="string"?A.media:void 0})}},Rn.preloadModule=function(b,A){if(typeof b=="string")if(A){var N=R(A.as,A.crossOrigin);y.d.m(b,{as:typeof A.as=="string"&&A.as!=="script"?A.as:void 0,crossOrigin:N,integrity:typeof A.integrity=="string"?A.integrity:void 0})}else y.d.m(b)},Rn.requestFormReset=function(b){y.d.r(b)},Rn.unstable_batchedUpdates=function(b,A){return b(A)},Rn.useFormState=function(b,A,N){return O.H.useFormState(b,A,N)},Rn.useFormStatus=function(){return O.H.useHostTransitionStatus()},Rn.version="19.2.0",Rn}var Hh;function Sg(){if(Hh)return c1.exports;Hh=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(g){console.error(g)}}return f(),c1.exports=wg(),c1.exports}var jh;function bg(){if(jh)return vs;jh=1;var f=Eg(),g=p1(),d=Sg();function y(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var r=2;r<arguments.length;r++)n+="&args[]="+encodeURIComponent(arguments[r])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function C(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function E(e){var n=e,r=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(r=n.return),e=n.return;while(e)}return n.tag===3?r:null}function O(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function R(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function b(e){if(E(e)!==e)throw Error(y(188))}function A(e){var n=e.alternate;if(!n){if(n=E(e),n===null)throw Error(y(188));return n!==e?null:e}for(var r=e,o=n;;){var h=r.return;if(h===null)break;var m=h.alternate;if(m===null){if(o=h.return,o!==null){r=o;continue}break}if(h.child===m.child){for(m=h.child;m;){if(m===r)return b(h),e;if(m===o)return b(h),n;m=m.sibling}throw Error(y(188))}if(r.return!==o.return)r=h,o=m;else{for(var S=!1,_=h.child;_;){if(_===r){S=!0,r=h,o=m;break}if(_===o){S=!0,o=h,r=m;break}_=_.sibling}if(!S){for(_=m.child;_;){if(_===r){S=!0,r=m,o=h;break}if(_===o){S=!0,o=m,r=h;break}_=_.sibling}if(!S)throw Error(y(189))}}if(r.alternate!==o)throw Error(y(190))}if(r.tag!==3)throw Error(y(188));return r.stateNode.current===r?e:n}function N(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=N(e),n!==null)return n;e=e.sibling}return null}var M=Object.assign,H=Symbol.for("react.element"),Z=Symbol.for("react.transitional.element"),ee=Symbol.for("react.portal"),ie=Symbol.for("react.fragment"),ae=Symbol.for("react.strict_mode"),pe=Symbol.for("react.profiler"),de=Symbol.for("react.consumer"),ne=Symbol.for("react.context"),we=Symbol.for("react.forward_ref"),Pe=Symbol.for("react.suspense"),Be=Symbol.for("react.suspense_list"),le=Symbol.for("react.memo"),Re=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),Gt=Symbol.for("react.memo_cache_sentinel"),Ze=Symbol.iterator;function Ne(e){return e===null||typeof e!="object"?null:(e=Ze&&e[Ze]||e["@@iterator"],typeof e=="function"?e:null)}var We=Symbol.for("react.client.reference");function at(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===We?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ie:return"Fragment";case pe:return"Profiler";case ae:return"StrictMode";case Pe:return"Suspense";case Be:return"SuspenseList";case fe:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case ee:return"Portal";case ne:return e.displayName||"Context";case de:return(e._context.displayName||"Context")+".Consumer";case we:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case le:return n=e.displayName||null,n!==null?n:at(e.type)||"Memo";case Re:n=e._payload,e=e._init;try{return at(e(n))}catch{}}return null}var q=Array.isArray,J=g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,oe=d.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Oe={pending:!1,data:null,method:null,action:null},Qe=[],Ke=-1;function F(e){return{current:e}}function re(e){0>Ke||(e.current=Qe[Ke],Qe[Ke]=null,Ke--)}function Ee(e,n){Ke++,Qe[Ke]=e.current,e.current=n}var Ce=F(null),ke=F(null),Ae=F(null),ct=F(null);function ft(e,n){switch(Ee(Ae,n),Ee(ke,e),Ee(Ce,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?nh(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=nh(n),e=ih(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}re(Ce),Ee(Ce,e)}function Dt(){re(Ce),re(ke),re(Ae)}function Ii(e){e.memoizedState!==null&&Ee(ct,e);var n=Ce.current,r=ih(n,e.type);n!==r&&(Ee(ke,e),Ee(Ce,r))}function xn(e){ke.current===e&&(re(Ce),re(ke)),ct.current===e&&(re(ct),Cs._currentValue=Oe)}var Ma,ht;function Hn(e){if(Ma===void 0)try{throw Error()}catch(r){var n=r.stack.trim().match(/\n( *(at )?)/);Ma=n&&n[1]||"",ht=-1<r.stack.indexOf(`
|
||
at`)?" (<anonymous>)":-1<r.stack.indexOf("@")?"@unknown:0:0":""}return`
|
||
`+Ma+e+ht}var jn=!1;function ta(e,n){if(!e||jn)return"";jn=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch($){var Q=$}Reflect.construct(e,[],ce)}else{try{ce.call()}catch($){Q=$}e.call(ce.prototype)}}else{try{throw Error()}catch($){Q=$}(ce=e())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch($){if($&&Q&&typeof $.stack=="string")return[$.stack,Q.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=o.DetermineComponentFrameRoot(),S=m[0],_=m[1];if(S&&_){var L=S.split(`
|
||
`),X=_.split(`
|
||
`);for(h=o=0;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;for(;h<X.length&&!X[h].includes("DetermineComponentFrameRoot");)h++;if(o===L.length||h===X.length)for(o=L.length-1,h=X.length-1;1<=o&&0<=h&&L[o]!==X[h];)h--;for(;1<=o&&0<=h;o--,h--)if(L[o]!==X[h]){if(o!==1||h!==1)do if(o--,h--,0>h||L[o]!==X[h]){var se=`
|
||
`+L[o].replace(" at new "," at ");return e.displayName&&se.includes("<anonymous>")&&(se=se.replace("<anonymous>",e.displayName)),se}while(1<=o&&0<=h);break}}}finally{jn=!1,Error.prepareStackTrace=r}return(r=e?e.displayName||e.name:"")?Hn(r):""}function mn(e,n){switch(e.tag){case 26:case 27:case 5:return Hn(e.type);case 16:return Hn("Lazy");case 13:return e.child!==n&&n!==null?Hn("Suspense Fallback"):Hn("Suspense");case 19:return Hn("SuspenseList");case 0:case 15:return ta(e.type,!1);case 11:return ta(e.type.render,!1);case 1:return ta(e.type,!0);case 31:return Hn("Activity");default:return""}}function bt(e){try{var n="",r=null;do n+=mn(e,r),r=e,e=e.return;while(e);return n}catch(o){return`
|
||
Error generating stack: `+o.message+`
|
||
`+o.stack}}var $e=Object.prototype.hasOwnProperty,Ia=f.unstable_scheduleCallback,Te=f.unstable_cancelCallback,Pr=f.unstable_shouldYield,Bs=f.unstable_requestPaint,qt=f.unstable_now,Rl=f.unstable_getCurrentPriorityLevel,Pn=f.unstable_ImmediatePriority,Dl=f.unstable_UserBlockingPriority,Jn=f.unstable_NormalPriority,Tn=f.unstable_LowPriority,Bl=f.unstable_IdlePriority,Yr=f.log,cu=f.unstable_setDisableYieldValue,kt=null,ye=null;function It(e){if(typeof Yr=="function"&&cu(e),ye&&typeof ye.setStrictMode=="function")try{ye.setStrictMode(kt,e)}catch{}}var Ge=Math.clz32?Math.clz32:Ll,Vt=Math.log,gr=Math.LN2;function Ll(e){return e>>>=0,e===0?32:31-(Vt(e)/gr|0)|0}var xr=256,rt=262144,xi=4194304;function Pi(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mr(e,n,r){var o=e.pendingLanes;if(o===0)return 0;var h=0,m=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var _=o&134217727;return _!==0?(o=_&~m,o!==0?h=Pi(o):(S&=_,S!==0?h=Pi(S):r||(r=_&~e,r!==0&&(h=Pi(r))))):(_=o&~m,_!==0?h=Pi(_):S!==0?h=Pi(S):r||(r=o&~e,r!==0&&(h=Pi(r)))),h===0?0:n!==0&&n!==h&&(n&m)===0&&(m=h&-h,r=n&-n,m>=r||m===32&&(r&4194048)!==0)?n:h}function vn(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Ul(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yn(){var e=xi;return xi<<=1,(xi&62914560)===0&&(xi=4194304),e}function Yi(e){for(var n=[],r=0;31>r;r++)n.push(e);return n}function Gi(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mi(e,n,r,o,h,m){var S=e.pendingLanes;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=r,e.entangledLanes&=r,e.errorRecoveryDisabledLanes&=r,e.shellSuspendCounter=0;var _=e.entanglements,L=e.expirationTimes,X=e.hiddenUpdates;for(r=S&~r;0<r;){var se=31-Ge(r),ce=1<<se;_[se]=0,L[se]=-1;var Q=X[se];if(Q!==null)for(X[se]=null,se=0;se<Q.length;se++){var $=Q[se];$!==null&&($.lane&=-536870913)}r&=~ce}o!==0&&Ls(e,o,0),m!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=m&~(S&~n))}function Ls(e,n,r){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Ge(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|r&261930}function Vi(e,n){var r=e.entangledLanes|=n;for(e=e.entanglements;r;){var o=31-Ge(r),h=1<<o;h&n|e[o]&n&&(e[o]|=n),r&=~h}}function Gr(e,n){var r=n&-n;return r=(r&42)!==0?1:Sn(r),(r&(e.suspendedLanes|n))!==0?0:r}function Sn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Oi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Dn(){var e=oe.p;return e!==0?e:(e=window.event,e===void 0?32:vh(e.type))}function Se(e,n){var r=oe.p;try{return oe.p=e,n()}finally{oe.p=r}}var Bn=Math.random().toString(36).slice(2),an="__reactFiber$"+Bn,Tt="__reactProps$"+Bn,$n="__reactContainer$"+Bn,Oa="__reactEvents$"+Bn,Vr="__reactListeners$"+Bn,yi="__reactHandles$"+Bn,Us="__reactResources$"+Bn,yr="__reactMarker$"+Bn;function Yn(e){delete e[an],delete e[Tt],delete e[Oa],delete e[Vr],delete e[yi]}function Wt(e){var n=e[an];if(n)return n;for(var r=e.parentNode;r;){if(n=r[$n]||r[an]){if(r=n.alternate,n.child!==null||r!==null&&r.child!==null)for(e=ch(e);e!==null;){if(r=e[an])return r;e=ch(e)}return n}e=r,r=e.parentNode}return null}function pt(e){if(e=e[an]||e[$n]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function _a(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(y(33))}function Ln(e){var n=e[Us];return n||(n=e[Us]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Kt(e){e[yr]=!0}var he=new Set,zs={};function Ct(e,n){ei(e,n),ei(e+"Capture",n)}function ei(e,n){for(zs[e]=n,e=0;e<n.length;e++)he.add(n[e])}var fu=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),gt={},dt={};function et(e){return $e.call(dt,e)?!0:$e.call(gt,e)?!1:fu.test(e)?dt[e]=!0:(gt[e]=!0,!1)}function Ra(e,n,r){if(et(n))if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+r)}}function Da(e,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+r)}}function ti(e,n,r,o){if(o===null)e.removeAttribute(r);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(r);return}e.setAttributeNS(n,r,""+o)}}function xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function _i(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function hu(e,n,r){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,m=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return h.call(this)},set:function(S){r=""+S,m.call(this,S)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return r},setValue:function(S){r=""+S},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Ft(e){if(!e._valueTracker){var n=_i(e)?"checked":"value";e._valueTracker=hu(e,n,""+e[n])}}function Ri(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var r=n.getValue(),o="";return e&&(o=_i(e)?e.checked?"true":"false":e.value),e=o,e!==r?(n.setValue(e),!0):!1}function Xr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ba=/[\n"\\]/g;function Je(e){return e.replace(Ba,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function un(e,n,r,o,h,m,S,_){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),n!=null?S==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+xt(n)):e.value!==""+xt(n)&&(e.value=""+xt(n)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),n!=null?D(e,S,xt(n)):r!=null?D(e,S,xt(r)):o!=null&&e.removeAttribute("value"),h==null&&m!=null&&(e.defaultChecked=!!m),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+xt(_):e.removeAttribute("name")}function Y(e,n,r,o,h,m,S,_){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(e.type=m),n!=null||r!=null){if(!(m!=="submit"&&m!=="reset"||n!=null)){Ft(e);return}r=r!=null?""+xt(r):"",n=n!=null?""+xt(n):r,_||n===e.value||(e.value=n),e.defaultValue=n}o=o??h,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=_?e.checked:!!o,e.defaultChecked=!!o,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),Ft(e)}function D(e,n,r){n==="number"&&Xr(e.ownerDocument)===e||e.defaultValue===""+r||(e.defaultValue=""+r)}function Me(e,n,r,o){if(e=e.options,n){n={};for(var h=0;h<r.length;h++)n["$"+r[h]]=!0;for(r=0;r<e.length;r++)h=n.hasOwnProperty("$"+e[r].value),e[r].selected!==h&&(e[r].selected=h),h&&o&&(e[r].defaultSelected=!0)}else{for(r=""+xt(r),n=null,h=0;h<e.length;h++){if(e[h].value===r){e[h].selected=!0,o&&(e[h].defaultSelected=!0);return}n!==null||e[h].disabled||(n=e[h])}n!==null&&(n.selected=!0)}}function rn(e,n,r){if(n!=null&&(n=""+xt(n),n!==e.value&&(e.value=n),r==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=r!=null?""+xt(r):""}function Un(e,n,r,o){if(n==null){if(o!=null){if(r!=null)throw Error(y(92));if(q(o)){if(1<o.length)throw Error(y(93));o=o[0]}r=o}r==null&&(r=""),n=r}r=xt(n),e.defaultValue=r,o=e.textContent,o===r&&o!==""&&o!==null&&(e.value=o),Ft(e)}function La(e,n){if(n){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=n;return}}e.textContent=n}var zl=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function zn(e,n,r){var o=n.indexOf("--")===0;r==null||typeof r=="boolean"||r===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,r):typeof r!="number"||r===0||zl.has(n)?n==="float"?e.cssFloat=r:e[n]=(""+r).trim():e[n]=r+"px"}function _e(e,n,r){if(n!=null&&typeof n!="object")throw Error(y(62));if(e=e.style,r!=null){for(var o in r)!r.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var h in n)o=n[h],n.hasOwnProperty(h)&&r[h]!==o&&zn(e,h,o)}else for(var m in n)n.hasOwnProperty(m)&&zn(e,m,n[m])}function Bt(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ks=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),du=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Ua(e){return du.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Gn(){}var pr=null;function kl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ht=null,pi=null;function Di(e){var n=pt(e);if(n&&(e=n.stateNode)){var r=e[Tt]||null;e:switch(e=n.stateNode,n.type){case"input":if(un(e,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name),n=r.name,r.type==="radio"&&n!=null){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll('input[name="'+Je(""+n)+'"][type="radio"]'),n=0;n<r.length;n++){var o=r[n];if(o!==e&&o.form===e.form){var h=o[Tt]||null;if(!h)throw Error(y(90));un(o,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(n=0;n<r.length;n++)o=r[n],o.form===e.form&&Ri(o)}break e;case"textarea":rn(e,r.value,r.defaultValue);break e;case"select":n=r.value,n!=null&&Me(e,!!r.multiple,n,!1)}}}var Le=!1;function Fs(e,n,r){if(Le)return e(n,r);Le=!0;try{var o=e(n);return o}finally{if(Le=!1,(Ht!==null||pi!==null)&&(_o(),Ht&&(n=Ht,e=pi,pi=Ht=null,Di(n),e)))for(n=0;n<e.length;n++)Di(e[n])}}function Fe(e,n){var r=e.stateNode;if(r===null)return null;var o=r[Tt]||null;if(o===null)return null;r=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(r&&typeof r!="function")throw Error(y(231,n,typeof r));return r}var Lt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fl=!1;if(Lt)try{var na={};Object.defineProperty(na,"passive",{get:function(){Fl=!0}}),window.addEventListener("test",na,na),window.removeEventListener("test",na,na)}catch{Fl=!1}var Bi=null,Li=null,Zr=null;function za(){if(Zr)return Zr;var e,n=Li,r=n.length,o,h="value"in Bi?Bi.value:Bi.textContent,m=h.length;for(e=0;e<r&&n[e]===h[e];e++);var S=r-e;for(o=1;o<=S&&n[r-o]===h[m-o];o++);return Zr=h.slice(e,1<o?1-o:void 0)}function Xi(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Zi(){return!0}function Hl(){return!1}function cn(e){function n(r,o,h,m,S){this._reactName=r,this._targetInst=h,this.type=o,this.nativeEvent=m,this.target=S,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(r=e[_],this[_]=r?r(m):m[_]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Zi:Hl,this.isPropagationStopped=Hl,this}return M(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Zi)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Zi)},persist:function(){},isPersistent:Zi}),n}var ni={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pn=cn(ni),ka=M({},ni,{view:0,detail:0}),Hs=cn(ka),Qr,jl,Ar,qr=M({},ka,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ar&&(Ar&&e.type==="mousemove"?(Qr=e.screenX-Ar.screenX,jl=e.screenY-Ar.screenY):jl=Qr=0,Ar=e),Qr)},movementY:function(e){return"movementY"in e?e.movementY:jl}}),At=cn(qr),js=M({},qr,{dataTransfer:0}),Wr=cn(js),Qi=M({},ka,{relatedTarget:0}),Pl=cn(Qi),K=M({},ni,{animationName:0,elapsedTime:0,pseudoElement:0}),Ve=cn(K),An=M({},ni,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Kr=cn(An),Ps=M({},ni,{data:0}),Ys=cn(Ps),gu={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},xu={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",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",224:"Meta"},Yl={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ln(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=Yl[e])?!!n[e]:!1}function Er(){return ln}var Xt=M({},ka,{key:function(e){if(e.key){var n=gu[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Xi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?xu[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(e){return e.type==="keypress"?Xi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Jr=cn(Xt),ia=M({},qr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),wt=cn(ia),Ue=M({},ka,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er}),mu=cn(Ue),Ut=M({},ni,{propertyName:0,elapsedTime:0,pseudoElement:0}),aa=cn(Ut),Fa=M({},qr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),yu=cn(Fa),Ai=M({},ni,{newState:0,oldState:0}),Gl=cn(Ai),Gs=[9,13,27,32],Cr=Lt&&"CompositionEvent"in window,Ha=null;Lt&&"documentMode"in document&&(Ha=document.documentMode);var Vs=Lt&&"TextEvent"in window&&!Ha,Xs=Lt&&(!Cr||Ha&&8<Ha&&11>=Ha),ra=" ",$r=!1;function Zs(e,n){switch(e){case"keyup":return Gs.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ja(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Pa=!1;function qi(e,n){switch(e){case"compositionend":return ja(n);case"keypress":return n.which!==32?null:($r=!0,ra);case"textInput":return e=n.data,e===ra&&$r?null:e;default:return null}}function el(e,n){if(Pa)return e==="compositionend"||!Cr&&Zs(e,n)?(e=za(),Zr=Li=Bi=null,Pa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Xs&&n.locale!=="ko"?null:n.data;default:return null}}var Vn={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Vl(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Vn[e.type]:n==="textarea"}function ii(e,n,r,o){Ht?pi?pi.push(o):pi=[o]:Ht=o,n=ko(n,"onChange"),0<n.length&&(r=new pn("onChange","change",null,r,o),e.push({event:r,listeners:n}))}var wr=null,la=null;function pu(e){W0(e,0)}function Sr(e){var n=_a(e);if(Ri(n))return e}function ai(e,n){if(e==="change")return n}var Qs=!1;if(Lt){var br;if(Lt){var sa="oninput"in document;if(!sa){var lt=document.createElement("div");lt.setAttribute("oninput","return;"),sa=typeof lt.oninput=="function"}br=sa}else br=!1;Qs=br&&(!document.documentMode||9<document.documentMode)}function Tr(){wr&&(wr.detachEvent("onpropertychange",T),la=wr=null)}function T(e){if(e.propertyName==="value"&&Sr(la)){var n=[];ii(n,la,e,kl(e)),Fs(pu,n)}}function t(e,n,r){e==="focusin"?(Tr(),wr=n,la=r,wr.attachEvent("onpropertychange",T)):e==="focusout"&&Tr()}function i(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sr(la)}function a(e,n){if(e==="click")return Sr(n)}function l(e,n){if(e==="input"||e==="change")return Sr(n)}function s(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var u=typeof Object.is=="function"?Object.is:s;function c(e,n){if(u(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var r=Object.keys(e),o=Object.keys(n);if(r.length!==o.length)return!1;for(o=0;o<r.length;o++){var h=r[o];if(!$e.call(n,h)||!u(e[h],n[h]))return!1}return!0}function x(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function p(e,n){var r=x(e);e=0;for(var o;r;){if(r.nodeType===3){if(o=e+r.textContent.length,e<=n&&o>=n)return{node:r,offset:n-e};e=o}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=x(r)}}function w(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?w(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function v(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Xr(e.document);n instanceof e.HTMLIFrameElement;){try{var r=typeof n.contentWindow.location.href=="string"}catch{r=!1}if(r)e=n.contentWindow;else break;n=Xr(e.document)}return n}function I(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var B=Lt&&"documentMode"in document&&11>=document.documentMode,U=null,z=null,P=null,W=!1;function me(e,n,r){var o=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;W||U==null||U!==Xr(o)||(o=U,"selectionStart"in o&&I(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),P&&c(P,o)||(P=o,o=ko(z,"onSelect"),0<o.length&&(n=new pn("onSelect","select",null,n,r),e.push({event:n,listeners:o}),n.target=U)))}function xe(e,n){var r={};return r[e.toLowerCase()]=n.toLowerCase(),r["Webkit"+e]="webkit"+n,r["Moz"+e]="moz"+n,r}var ge={animationend:xe("Animation","AnimationEnd"),animationiteration:xe("Animation","AnimationIteration"),animationstart:xe("Animation","AnimationStart"),transitionrun:xe("Transition","TransitionRun"),transitionstart:xe("Transition","TransitionStart"),transitioncancel:xe("Transition","TransitionCancel"),transitionend:xe("Transition","TransitionEnd")},qe={},He={};Lt&&(He=document.createElement("div").style,"AnimationEvent"in window||(delete ge.animationend.animation,delete ge.animationiteration.animation,delete ge.animationstart.animation),"TransitionEvent"in window||delete ge.transitionend.transition);function Jt(e){if(qe[e])return qe[e];if(!ge[e])return e;var n=ge[e],r;for(r in n)if(n.hasOwnProperty(r)&&r in He)return qe[e]=n[r];return e}var Xn=Jt("animationend"),Nn=Jt("animationiteration"),St=Jt("animationstart"),En=Jt("transitionrun"),kn=Jt("transitionstart"),Ya=Jt("transitioncancel"),oa=Jt("transitionend"),qs=new Map,Xl="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Xl.push("scrollEnd");function Ui(e,n){qs.set(e,n),Ct(n,[e])}var Ws=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ei=[],tl=0,Au=0;function Ks(){for(var e=tl,n=Au=tl=0;n<e;){var r=Ei[n];Ei[n++]=null;var o=Ei[n];Ei[n++]=null;var h=Ei[n];Ei[n++]=null;var m=Ei[n];if(Ei[n++]=null,o!==null&&h!==null){var S=o.pending;S===null?h.next=h:(h.next=S.next,S.next=h),o.pending=h}m!==0&&O1(r,h,m)}}function Js(e,n,r,o){Ei[tl++]=e,Ei[tl++]=n,Ei[tl++]=r,Ei[tl++]=o,Au|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Eu(e,n,r,o){return Js(e,n,r,o),$s(e)}function vr(e,n){return Js(e,null,null,n),$s(e)}function O1(e,n,r){e.lanes|=r;var o=e.alternate;o!==null&&(o.lanes|=r);for(var h=!1,m=e.return;m!==null;)m.childLanes|=r,o=m.alternate,o!==null&&(o.childLanes|=r),m.tag===22&&(e=m.stateNode,e===null||e._visibility&1||(h=!0)),e=m,m=m.return;return e.tag===3?(m=e.stateNode,h&&n!==null&&(h=31-Ge(r),e=m.hiddenUpdates,o=e[h],o===null?e[h]=[n]:o.push(n),n.lane=r|536870912),m):null}function $s(e){if(50<gs)throw gs=0,Ic=null,Error(y(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var nl={};function $d(e,n,r,o){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ri(e,n,r,o){return new $d(e,n,r,o)}function Cu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ua(e,n){var r=e.alternate;return r===null?(r=ri(e.tag,n,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=n,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&65011712,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,n=e.dependencies,r.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r.refCleanup=e.refCleanup,r}function _1(e,n){e.flags&=65011714;var r=e.alternate;return r===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=r.childLanes,e.lanes=r.lanes,e.child=r.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=r.memoizedProps,e.memoizedState=r.memoizedState,e.updateQueue=r.updateQueue,e.type=r.type,n=r.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function eo(e,n,r,o,h,m){var S=0;if(o=e,typeof e=="function")Cu(e)&&(S=1);else if(typeof e=="string")S=ag(e,r,Ce.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case fe:return e=ri(31,r,n,h),e.elementType=fe,e.lanes=m,e;case ie:return Nr(r.children,h,m,n);case ae:S=8,h|=24;break;case pe:return e=ri(12,r,n,h|2),e.elementType=pe,e.lanes=m,e;case Pe:return e=ri(13,r,n,h),e.elementType=Pe,e.lanes=m,e;case Be:return e=ri(19,r,n,h),e.elementType=Be,e.lanes=m,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ne:S=10;break e;case de:S=9;break e;case we:S=11;break e;case le:S=14;break e;case Re:S=16,o=null;break e}S=29,r=Error(y(130,e===null?"null":typeof e,"")),o=null}return n=ri(S,r,n,h),n.elementType=e,n.type=o,n.lanes=m,n}function Nr(e,n,r,o){return e=ri(7,e,o,n),e.lanes=r,e}function wu(e,n,r){return e=ri(6,e,null,n),e.lanes=r,e}function R1(e){var n=ri(18,null,null,0);return n.stateNode=e,n}function Su(e,n,r){return n=ri(4,e.children!==null?e.children:[],e.key,n),n.lanes=r,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var D1=new WeakMap;function Ci(e,n){if(typeof e=="object"&&e!==null){var r=D1.get(e);return r!==void 0?r:(n={value:e,source:n,stack:bt(n)},D1.set(e,n),n)}return{value:e,source:n,stack:bt(n)}}var il=[],al=0,to=null,Zl=0,wi=[],Si=0,Ga=null,Wi=1,Ki="";function ca(e,n){il[al++]=Zl,il[al++]=to,to=e,Zl=n}function B1(e,n,r){wi[Si++]=Wi,wi[Si++]=Ki,wi[Si++]=Ga,Ga=e;var o=Wi;e=Ki;var h=32-Ge(o)-1;o&=~(1<<h),r+=1;var m=32-Ge(n)+h;if(30<m){var S=h-h%5;m=(o&(1<<S)-1).toString(32),o>>=S,h-=S,Wi=1<<32-Ge(n)+h|r<<h|o,Ki=m+e}else Wi=1<<m|r<<h|o,Ki=e}function bu(e){e.return!==null&&(ca(e,1),B1(e,1,0))}function Tu(e){for(;e===to;)to=il[--al],il[al]=null,Zl=il[--al],il[al]=null;for(;e===Ga;)Ga=wi[--Si],wi[Si]=null,Ki=wi[--Si],wi[Si]=null,Wi=wi[--Si],wi[Si]=null}function L1(e,n){wi[Si++]=Wi,wi[Si++]=Ki,wi[Si++]=Ga,Wi=n.id,Ki=n.overflow,Ga=e}var Mn=null,jt=null,ut=!1,Va=null,bi=!1,vu=Error(y(519));function Xa(e){var n=Error(y(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ql(Ci(n,e)),vu}function U1(e){var n=e.stateNode,r=e.type,o=e.memoizedProps;switch(n[an]=e,n[Tt]=o,r){case"dialog":nt("cancel",n),nt("close",n);break;case"iframe":case"object":case"embed":nt("load",n);break;case"video":case"audio":for(r=0;r<ms.length;r++)nt(ms[r],n);break;case"source":nt("error",n);break;case"img":case"image":case"link":nt("error",n),nt("load",n);break;case"details":nt("toggle",n);break;case"input":nt("invalid",n),Y(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":nt("invalid",n);break;case"textarea":nt("invalid",n),Un(n,o.value,o.defaultValue,o.children)}r=o.children,typeof r!="string"&&typeof r!="number"&&typeof r!="bigint"||n.textContent===""+r||o.suppressHydrationWarning===!0||eh(n.textContent,r)?(o.popover!=null&&(nt("beforetoggle",n),nt("toggle",n)),o.onScroll!=null&&nt("scroll",n),o.onScrollEnd!=null&&nt("scrollend",n),o.onClick!=null&&(n.onclick=Gn),n=!0):n=!1,n||Xa(e,!0)}function z1(e){for(Mn=e.return;Mn;)switch(Mn.tag){case 5:case 31:case 13:bi=!1;return;case 27:case 3:bi=!0;return;default:Mn=Mn.return}}function rl(e){if(e!==Mn)return!1;if(!ut)return z1(e),ut=!0,!1;var n=e.tag,r;if((r=n!==3&&n!==27)&&((r=n===5)&&(r=e.type,r=!(r!=="form"&&r!=="button")||Gc(e.type,e.memoizedProps)),r=!r),r&&jt&&Xa(e),z1(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(y(317));jt=uh(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(y(317));jt=uh(e)}else n===27?(n=jt,lr(e.type)?(e=qc,qc=null,jt=e):jt=n):jt=Mn?vi(e.stateNode.nextSibling):null;return!0}function Mr(){jt=Mn=null,ut=!1}function Nu(){var e=Va;return e!==null&&(Wn===null?Wn=e:Wn.push.apply(Wn,e),Va=null),e}function Ql(e){Va===null?Va=[e]:Va.push(e)}var Mu=F(null),Ir=null,fa=null;function Za(e,n,r){Ee(Mu,n._currentValue),n._currentValue=r}function ha(e){e._currentValue=Mu.current,re(Mu)}function Iu(e,n,r){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===r)break;e=e.return}}function Ou(e,n,r,o){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var m=h.dependencies;if(m!==null){var S=h.child;m=m.firstContext;e:for(;m!==null;){var _=m;m=h;for(var L=0;L<n.length;L++)if(_.context===n[L]){m.lanes|=r,_=m.alternate,_!==null&&(_.lanes|=r),Iu(m.return,r,e),o||(S=null);break e}m=_.next}}else if(h.tag===18){if(S=h.return,S===null)throw Error(y(341));S.lanes|=r,m=S.alternate,m!==null&&(m.lanes|=r),Iu(S,r,e),S=null}else S=h.child;if(S!==null)S.return=h;else for(S=h;S!==null;){if(S===e){S=null;break}if(h=S.sibling,h!==null){h.return=S.return,S=h;break}S=S.return}h=S}}function ll(e,n,r,o){e=null;for(var h=n,m=!1;h!==null;){if(!m){if((h.flags&524288)!==0)m=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var S=h.alternate;if(S===null)throw Error(y(387));if(S=S.memoizedProps,S!==null){var _=h.type;u(h.pendingProps.value,S.value)||(e!==null?e.push(_):e=[_])}}else if(h===ct.current){if(S=h.alternate,S===null)throw Error(y(387));S.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Cs):e=[Cs])}h=h.return}e!==null&&Ou(n,e,r,o),n.flags|=262144}function no(e){for(e=e.firstContext;e!==null;){if(!u(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Or(e){Ir=e,fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function In(e){return k1(Ir,e)}function io(e,n){return Ir===null&&Or(e),k1(e,n)}function k1(e,n){var r=n._currentValue;if(n={context:n,memoizedValue:r,next:null},fa===null){if(e===null)throw Error(y(308));fa=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else fa=fa.next=n;return r}var e2=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(r,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(r){return r()})}},t2=f.unstable_scheduleCallback,n2=f.unstable_NormalPriority,fn={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _u(){return{controller:new e2,data:new Map,refCount:0}}function ql(e){e.refCount--,e.refCount===0&&t2(n2,function(){e.controller.abort()})}var Wl=null,Ru=0,sl=0,ol=null;function i2(e,n){if(Wl===null){var r=Wl=[];Ru=0,sl=Lc(),ol={status:"pending",value:void 0,then:function(o){r.push(o)}}}return Ru++,n.then(F1,F1),n}function F1(){if(--Ru===0&&Wl!==null){ol!==null&&(ol.status="fulfilled");var e=Wl;Wl=null,sl=0,ol=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function a2(e,n){var r=[],o={status:"pending",value:null,reason:null,then:function(h){r.push(h)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var h=0;h<r.length;h++)(0,r[h])(n)},function(h){for(o.status="rejected",o.reason=h,h=0;h<r.length;h++)(0,r[h])(void 0)}),o}var H1=J.S;J.S=function(e,n){b0=qt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&i2(e,n),H1!==null&&H1(e,n)};var _r=F(null);function Du(){var e=_r.current;return e!==null?e:zt.pooledCache}function ao(e,n){n===null?Ee(_r,_r.current):Ee(_r,n.pool)}function j1(){var e=Du();return e===null?null:{parent:fn._currentValue,pool:e}}var ul=Error(y(460)),Bu=Error(y(474)),ro=Error(y(542)),lo={then:function(){}};function P1(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Y1(e,n,r){switch(r=e[r],r===void 0?e.push(n):r!==n&&(n.then(Gn,Gn),n=r),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,V1(e),e;default:if(typeof n.status=="string")n.then(Gn,Gn);else{if(e=zt,e!==null&&100<e.shellSuspendCounter)throw Error(y(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var h=n;h.status="fulfilled",h.value=o}},function(o){if(n.status==="pending"){var h=n;h.status="rejected",h.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,V1(e),e}throw Dr=n,ul}}function Rr(e){try{var n=e._init;return n(e._payload)}catch(r){throw r!==null&&typeof r=="object"&&typeof r.then=="function"?(Dr=r,ul):r}}var Dr=null;function G1(){if(Dr===null)throw Error(y(459));var e=Dr;return Dr=null,e}function V1(e){if(e===ul||e===ro)throw Error(y(483))}var cl=null,Kl=0;function so(e){var n=Kl;return Kl+=1,cl===null&&(cl=[]),Y1(cl,e,n)}function Jl(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function oo(e,n){throw n.$$typeof===H?Error(y(525)):(e=Object.prototype.toString.call(n),Error(y(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function X1(e){function n(j,k){if(e){var V=j.deletions;V===null?(j.deletions=[k],j.flags|=16):V.push(k)}}function r(j,k){if(!e)return null;for(;k!==null;)n(j,k),k=k.sibling;return null}function o(j){for(var k=new Map;j!==null;)j.key!==null?k.set(j.key,j):k.set(j.index,j),j=j.sibling;return k}function h(j,k){return j=ua(j,k),j.index=0,j.sibling=null,j}function m(j,k,V){return j.index=V,e?(V=j.alternate,V!==null?(V=V.index,V<k?(j.flags|=67108866,k):V):(j.flags|=67108866,k)):(j.flags|=1048576,k)}function S(j){return e&&j.alternate===null&&(j.flags|=67108866),j}function _(j,k,V,ue){return k===null||k.tag!==6?(k=wu(V,j.mode,ue),k.return=j,k):(k=h(k,V),k.return=j,k)}function L(j,k,V,ue){var De=V.type;return De===ie?se(j,k,V.props.children,ue,V.key):k!==null&&(k.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Re&&Rr(De)===k.type)?(k=h(k,V.props),Jl(k,V),k.return=j,k):(k=eo(V.type,V.key,V.props,null,j.mode,ue),Jl(k,V),k.return=j,k)}function X(j,k,V,ue){return k===null||k.tag!==4||k.stateNode.containerInfo!==V.containerInfo||k.stateNode.implementation!==V.implementation?(k=Su(V,j.mode,ue),k.return=j,k):(k=h(k,V.children||[]),k.return=j,k)}function se(j,k,V,ue,De){return k===null||k.tag!==7?(k=Nr(V,j.mode,ue,De),k.return=j,k):(k=h(k,V),k.return=j,k)}function ce(j,k,V){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=wu(""+k,j.mode,V),k.return=j,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case Z:return V=eo(k.type,k.key,k.props,null,j.mode,V),Jl(V,k),V.return=j,V;case ee:return k=Su(k,j.mode,V),k.return=j,k;case Re:return k=Rr(k),ce(j,k,V)}if(q(k)||Ne(k))return k=Nr(k,j.mode,V,null),k.return=j,k;if(typeof k.then=="function")return ce(j,so(k),V);if(k.$$typeof===ne)return ce(j,io(j,k),V);oo(j,k)}return null}function Q(j,k,V,ue){var De=k!==null?k.key:null;if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return De!==null?null:_(j,k,""+V,ue);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case Z:return V.key===De?L(j,k,V,ue):null;case ee:return V.key===De?X(j,k,V,ue):null;case Re:return V=Rr(V),Q(j,k,V,ue)}if(q(V)||Ne(V))return De!==null?null:se(j,k,V,ue,null);if(typeof V.then=="function")return Q(j,k,so(V),ue);if(V.$$typeof===ne)return Q(j,k,io(j,V),ue);oo(j,V)}return null}function $(j,k,V,ue,De){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return j=j.get(V)||null,_(k,j,""+ue,De);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case Z:return j=j.get(ue.key===null?V:ue.key)||null,L(k,j,ue,De);case ee:return j=j.get(ue.key===null?V:ue.key)||null,X(k,j,ue,De);case Re:return ue=Rr(ue),$(j,k,V,ue,De)}if(q(ue)||Ne(ue))return j=j.get(V)||null,se(k,j,ue,De,null);if(typeof ue.then=="function")return $(j,k,V,so(ue),De);if(ue.$$typeof===ne)return $(j,k,V,io(k,ue),De);oo(k,ue)}return null}function ve(j,k,V,ue){for(var De=null,mt=null,Ie=k,Xe=k=0,ot=null;Ie!==null&&Xe<V.length;Xe++){Ie.index>Xe?(ot=Ie,Ie=null):ot=Ie.sibling;var yt=Q(j,Ie,V[Xe],ue);if(yt===null){Ie===null&&(Ie=ot);break}e&&Ie&&yt.alternate===null&&n(j,Ie),k=m(yt,k,Xe),mt===null?De=yt:mt.sibling=yt,mt=yt,Ie=ot}if(Xe===V.length)return r(j,Ie),ut&&ca(j,Xe),De;if(Ie===null){for(;Xe<V.length;Xe++)Ie=ce(j,V[Xe],ue),Ie!==null&&(k=m(Ie,k,Xe),mt===null?De=Ie:mt.sibling=Ie,mt=Ie);return ut&&ca(j,Xe),De}for(Ie=o(Ie);Xe<V.length;Xe++)ot=$(Ie,j,Xe,V[Xe],ue),ot!==null&&(e&&ot.alternate!==null&&Ie.delete(ot.key===null?Xe:ot.key),k=m(ot,k,Xe),mt===null?De=ot:mt.sibling=ot,mt=ot);return e&&Ie.forEach(function(fr){return n(j,fr)}),ut&&ca(j,Xe),De}function ze(j,k,V,ue){if(V==null)throw Error(y(151));for(var De=null,mt=null,Ie=k,Xe=k=0,ot=null,yt=V.next();Ie!==null&&!yt.done;Xe++,yt=V.next()){Ie.index>Xe?(ot=Ie,Ie=null):ot=Ie.sibling;var fr=Q(j,Ie,yt.value,ue);if(fr===null){Ie===null&&(Ie=ot);break}e&&Ie&&fr.alternate===null&&n(j,Ie),k=m(fr,k,Xe),mt===null?De=fr:mt.sibling=fr,mt=fr,Ie=ot}if(yt.done)return r(j,Ie),ut&&ca(j,Xe),De;if(Ie===null){for(;!yt.done;Xe++,yt=V.next())yt=ce(j,yt.value,ue),yt!==null&&(k=m(yt,k,Xe),mt===null?De=yt:mt.sibling=yt,mt=yt);return ut&&ca(j,Xe),De}for(Ie=o(Ie);!yt.done;Xe++,yt=V.next())yt=$(Ie,j,Xe,yt.value,ue),yt!==null&&(e&&yt.alternate!==null&&Ie.delete(yt.key===null?Xe:yt.key),k=m(yt,k,Xe),mt===null?De=yt:mt.sibling=yt,mt=yt);return e&&Ie.forEach(function(xg){return n(j,xg)}),ut&&ca(j,Xe),De}function Rt(j,k,V,ue){if(typeof V=="object"&&V!==null&&V.type===ie&&V.key===null&&(V=V.props.children),typeof V=="object"&&V!==null){switch(V.$$typeof){case Z:e:{for(var De=V.key;k!==null;){if(k.key===De){if(De=V.type,De===ie){if(k.tag===7){r(j,k.sibling),ue=h(k,V.props.children),ue.return=j,j=ue;break e}}else if(k.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Re&&Rr(De)===k.type){r(j,k.sibling),ue=h(k,V.props),Jl(ue,V),ue.return=j,j=ue;break e}r(j,k);break}else n(j,k);k=k.sibling}V.type===ie?(ue=Nr(V.props.children,j.mode,ue,V.key),ue.return=j,j=ue):(ue=eo(V.type,V.key,V.props,null,j.mode,ue),Jl(ue,V),ue.return=j,j=ue)}return S(j);case ee:e:{for(De=V.key;k!==null;){if(k.key===De)if(k.tag===4&&k.stateNode.containerInfo===V.containerInfo&&k.stateNode.implementation===V.implementation){r(j,k.sibling),ue=h(k,V.children||[]),ue.return=j,j=ue;break e}else{r(j,k);break}else n(j,k);k=k.sibling}ue=Su(V,j.mode,ue),ue.return=j,j=ue}return S(j);case Re:return V=Rr(V),Rt(j,k,V,ue)}if(q(V))return ve(j,k,V,ue);if(Ne(V)){if(De=Ne(V),typeof De!="function")throw Error(y(150));return V=De.call(V),ze(j,k,V,ue)}if(typeof V.then=="function")return Rt(j,k,so(V),ue);if(V.$$typeof===ne)return Rt(j,k,io(j,V),ue);oo(j,V)}return typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint"?(V=""+V,k!==null&&k.tag===6?(r(j,k.sibling),ue=h(k,V),ue.return=j,j=ue):(r(j,k),ue=wu(V,j.mode,ue),ue.return=j,j=ue),S(j)):r(j,k)}return function(j,k,V,ue){try{Kl=0;var De=Rt(j,k,V,ue);return cl=null,De}catch(Ie){if(Ie===ul||Ie===ro)throw Ie;var mt=ri(29,Ie,null,j.mode);return mt.lanes=ue,mt.return=j,mt}finally{}}}var Br=X1(!0),Z1=X1(!1),Qa=!1;function Lu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uu(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function qa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,n,r){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Et&2)!==0){var h=o.pending;return h===null?n.next=n:(n.next=h.next,h.next=n),o.pending=n,n=$s(e),O1(e,null,r),n}return Js(e,o,n,r),$s(e)}function $l(e,n,r){if(n=n.updateQueue,n!==null&&(n=n.shared,(r&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,r|=o,n.lanes=r,Vi(e,r)}}function zu(e,n){var r=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,r===o)){var h=null,m=null;if(r=r.firstBaseUpdate,r!==null){do{var S={lane:r.lane,tag:r.tag,payload:r.payload,callback:null,next:null};m===null?h=m=S:m=m.next=S,r=r.next}while(r!==null);m===null?h=m=n:m=m.next=n}else h=m=n;r={baseState:o.baseState,firstBaseUpdate:h,lastBaseUpdate:m,shared:o.shared,callbacks:o.callbacks},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=n:e.next=n,r.lastBaseUpdate=n}var ku=!1;function es(){if(ku){var e=ol;if(e!==null)throw e}}function ts(e,n,r,o){ku=!1;var h=e.updateQueue;Qa=!1;var m=h.firstBaseUpdate,S=h.lastBaseUpdate,_=h.shared.pending;if(_!==null){h.shared.pending=null;var L=_,X=L.next;L.next=null,S===null?m=X:S.next=X,S=L;var se=e.alternate;se!==null&&(se=se.updateQueue,_=se.lastBaseUpdate,_!==S&&(_===null?se.firstBaseUpdate=X:_.next=X,se.lastBaseUpdate=L))}if(m!==null){var ce=h.baseState;S=0,se=X=L=null,_=m;do{var Q=_.lane&-536870913,$=Q!==_.lane;if($?(st&Q)===Q:(o&Q)===Q){Q!==0&&Q===sl&&(ku=!0),se!==null&&(se=se.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var ve=e,ze=_;Q=n;var Rt=r;switch(ze.tag){case 1:if(ve=ze.payload,typeof ve=="function"){ce=ve.call(Rt,ce,Q);break e}ce=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=ze.payload,Q=typeof ve=="function"?ve.call(Rt,ce,Q):ve,Q==null)break e;ce=M({},ce,Q);break e;case 2:Qa=!0}}Q=_.callback,Q!==null&&(e.flags|=64,$&&(e.flags|=8192),$=h.callbacks,$===null?h.callbacks=[Q]:$.push(Q))}else $={lane:Q,tag:_.tag,payload:_.payload,callback:_.callback,next:null},se===null?(X=se=$,L=ce):se=se.next=$,S|=Q;if(_=_.next,_===null){if(_=h.shared.pending,_===null)break;$=_,_=$.next,$.next=null,h.lastBaseUpdate=$,h.shared.pending=null}}while(!0);se===null&&(L=ce),h.baseState=L,h.firstBaseUpdate=X,h.lastBaseUpdate=se,m===null&&(h.shared.lanes=0),tr|=S,e.lanes=S,e.memoizedState=ce}}function Q1(e,n){if(typeof e!="function")throw Error(y(191,e));e.call(n)}function q1(e,n){var r=e.callbacks;if(r!==null)for(e.callbacks=null,e=0;e<r.length;e++)Q1(r[e],n)}var fl=F(null),uo=F(0);function W1(e,n){e=Ca,Ee(uo,e),Ee(fl,n),Ca=e|n.baseLanes}function Fu(){Ee(uo,Ca),Ee(fl,fl.current)}function Hu(){Ca=uo.current,re(fl),re(uo)}var li=F(null),Ti=null;function Ka(e){var n=e.alternate;Ee(sn,sn.current&1),Ee(li,e),Ti===null&&(n===null||fl.current!==null||n.memoizedState!==null)&&(Ti=e)}function ju(e){Ee(sn,sn.current),Ee(li,e),Ti===null&&(Ti=e)}function K1(e){e.tag===22?(Ee(sn,sn.current),Ee(li,e),Ti===null&&(Ti=e)):Ja()}function Ja(){Ee(sn,sn.current),Ee(li,li.current)}function si(e){re(li),Ti===e&&(Ti=null),re(sn)}var sn=F(0);function co(e){for(var n=e;n!==null;){if(n.tag===13){var r=n.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||Zc(r)||Qc(r)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var da=0,Ye=null,Ot=null,hn=null,fo=!1,hl=!1,Lr=!1,ho=0,ns=0,dl=null,r2=0;function $t(){throw Error(y(321))}function Pu(e,n){if(n===null)return!1;for(var r=0;r<n.length&&r<e.length;r++)if(!u(e[r],n[r]))return!1;return!0}function Yu(e,n,r,o,h,m){return da=m,Ye=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,J.H=e===null||e.memoizedState===null?Lf:ac,Lr=!1,m=r(o,h),Lr=!1,hl&&(m=$1(n,r,o,h)),J1(e),m}function J1(e){J.H=rs;var n=Ot!==null&&Ot.next!==null;if(da=0,hn=Ot=Ye=null,fo=!1,ns=0,dl=null,n)throw Error(y(300));e===null||dn||(e=e.dependencies,e!==null&&no(e)&&(dn=!0))}function $1(e,n,r,o){Ye=e;var h=0;do{if(hl&&(dl=null),ns=0,hl=!1,25<=h)throw Error(y(301));if(h+=1,hn=Ot=null,e.updateQueue!=null){var m=e.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}J.H=Uf,m=n(r,o)}while(hl);return m}function l2(){var e=J.H,n=e.useState()[0];return n=typeof n.then=="function"?is(n):n,e=e.useState()[0],(Ot!==null?Ot.memoizedState:null)!==e&&(Ye.flags|=1024),n}function Gu(){var e=ho!==0;return ho=0,e}function Vu(e,n,r){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~r}function Xu(e){if(fo){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}fo=!1}da=0,hn=Ot=Ye=null,hl=!1,ns=ho=0,dl=null}function Fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return hn===null?Ye.memoizedState=hn=e:hn=hn.next=e,hn}function on(){if(Ot===null){var e=Ye.alternate;e=e!==null?e.memoizedState:null}else e=Ot.next;var n=hn===null?Ye.memoizedState:hn.next;if(n!==null)hn=n,Ot=e;else{if(e===null)throw Ye.alternate===null?Error(y(467)):Error(y(310));Ot=e,e={memoizedState:Ot.memoizedState,baseState:Ot.baseState,baseQueue:Ot.baseQueue,queue:Ot.queue,next:null},hn===null?Ye.memoizedState=hn=e:hn=hn.next=e}return hn}function go(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function is(e){var n=ns;return ns+=1,dl===null&&(dl=[]),e=Y1(dl,e,n),n=Ye,(hn===null?n.memoizedState:hn.next)===null&&(n=n.alternate,J.H=n===null||n.memoizedState===null?Lf:ac),e}function xo(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return is(e);if(e.$$typeof===ne)return In(e)}throw Error(y(438,String(e)))}function Zu(e){var n=null,r=Ye.updateQueue;if(r!==null&&(n=r.memoCache),n==null){var o=Ye.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(h){return h.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),r===null&&(r=go(),Ye.updateQueue=r),r.memoCache=n,r=n.data[n.index],r===void 0)for(r=n.data[n.index]=Array(e),o=0;o<e;o++)r[o]=Gt;return n.index++,r}function ga(e,n){return typeof n=="function"?n(e):n}function mo(e){var n=on();return Qu(n,Ot,e)}function Qu(e,n,r){var o=e.queue;if(o===null)throw Error(y(311));o.lastRenderedReducer=r;var h=e.baseQueue,m=o.pending;if(m!==null){if(h!==null){var S=h.next;h.next=m.next,m.next=S}n.baseQueue=h=m,o.pending=null}if(m=e.baseState,h===null)e.memoizedState=m;else{n=h.next;var _=S=null,L=null,X=n,se=!1;do{var ce=X.lane&-536870913;if(ce!==X.lane?(st&ce)===ce:(da&ce)===ce){var Q=X.revertLane;if(Q===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),ce===sl&&(se=!0);else if((da&Q)===Q){X=X.next,Q===sl&&(se=!0);continue}else ce={lane:0,revertLane:X.revertLane,gesture:null,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(_=L=ce,S=m):L=L.next=ce,Ye.lanes|=Q,tr|=Q;ce=X.action,Lr&&r(m,ce),m=X.hasEagerState?X.eagerState:r(m,ce)}else Q={lane:ce,revertLane:X.revertLane,gesture:X.gesture,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null},L===null?(_=L=Q,S=m):L=L.next=Q,Ye.lanes|=ce,tr|=ce;X=X.next}while(X!==null&&X!==n);if(L===null?S=m:L.next=_,!u(m,e.memoizedState)&&(dn=!0,se&&(r=ol,r!==null)))throw r;e.memoizedState=m,e.baseState=S,e.baseQueue=L,o.lastRenderedState=m}return h===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function qu(e){var n=on(),r=n.queue;if(r===null)throw Error(y(311));r.lastRenderedReducer=e;var o=r.dispatch,h=r.pending,m=n.memoizedState;if(h!==null){r.pending=null;var S=h=h.next;do m=e(m,S.action),S=S.next;while(S!==h);u(m,n.memoizedState)||(dn=!0),n.memoizedState=m,n.baseQueue===null&&(n.baseState=m),r.lastRenderedState=m}return[m,o]}function ef(e,n,r){var o=Ye,h=on(),m=ut;if(m){if(r===void 0)throw Error(y(407));r=r()}else r=n();var S=!u((Ot||h).memoizedState,r);if(S&&(h.memoizedState=r,dn=!0),h=h.queue,Ju(af.bind(null,o,h,e),[e]),h.getSnapshot!==n||S||hn!==null&&hn.memoizedState.tag&1){if(o.flags|=2048,gl(9,{destroy:void 0},nf.bind(null,o,h,r,n),null),zt===null)throw Error(y(349));m||(da&127)!==0||tf(o,n,r)}return r}function tf(e,n,r){e.flags|=16384,e={getSnapshot:n,value:r},n=Ye.updateQueue,n===null?(n=go(),Ye.updateQueue=n,n.stores=[e]):(r=n.stores,r===null?n.stores=[e]:r.push(e))}function nf(e,n,r,o){n.value=r,n.getSnapshot=o,rf(n)&&lf(e)}function af(e,n,r){return r(function(){rf(n)&&lf(e)})}function rf(e){var n=e.getSnapshot;e=e.value;try{var r=n();return!u(e,r)}catch{return!0}}function lf(e){var n=vr(e,2);n!==null&&Kn(n,e,2)}function Wu(e){var n=Fn();if(typeof e=="function"){var r=e;if(e=r(),Lr){It(!0);try{r()}finally{It(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:e},n}function sf(e,n,r,o){return e.baseState=r,Qu(e,Ot,typeof o=="function"?o:ga)}function s2(e,n,r,o,h){if(Ao(e))throw Error(y(485));if(e=n.action,e!==null){var m={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){m.listeners.push(S)}};J.T!==null?r(!0):m.isTransition=!1,o(m),r=n.pending,r===null?(m.next=n.pending=m,of(n,m)):(m.next=r.next,n.pending=r.next=m)}}function of(e,n){var r=n.action,o=n.payload,h=e.state;if(n.isTransition){var m=J.T,S={};J.T=S;try{var _=r(h,o),L=J.S;L!==null&&L(S,_),uf(e,n,_)}catch(X){Ku(e,n,X)}finally{m!==null&&S.types!==null&&(m.types=S.types),J.T=m}}else try{m=r(h,o),uf(e,n,m)}catch(X){Ku(e,n,X)}}function uf(e,n,r){r!==null&&typeof r=="object"&&typeof r.then=="function"?r.then(function(o){cf(e,n,o)},function(o){return Ku(e,n,o)}):cf(e,n,r)}function cf(e,n,r){n.status="fulfilled",n.value=r,ff(n),e.state=r,n=e.pending,n!==null&&(r=n.next,r===n?e.pending=null:(r=r.next,n.next=r,of(e,r)))}function Ku(e,n,r){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=r,ff(n),n=n.next;while(n!==o)}e.action=null}function ff(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function hf(e,n){return n}function df(e,n){if(ut){var r=zt.formState;if(r!==null){e:{var o=Ye;if(ut){if(jt){t:{for(var h=jt,m=bi;h.nodeType!==8;){if(!m){h=null;break t}if(h=vi(h.nextSibling),h===null){h=null;break t}}m=h.data,h=m==="F!"||m==="F"?h:null}if(h){jt=vi(h.nextSibling),o=h.data==="F!";break e}}Xa(o)}o=!1}o&&(n=r[0])}}return r=Fn(),r.memoizedState=r.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hf,lastRenderedState:n},r.queue=o,r=Rf.bind(null,Ye,o),o.dispatch=r,o=Wu(!1),m=ic.bind(null,Ye,!1,o.queue),o=Fn(),h={state:n,dispatch:null,action:e,pending:null},o.queue=h,r=s2.bind(null,Ye,h,m,r),h.dispatch=r,o.memoizedState=e,[n,r,!1]}function gf(e){var n=on();return xf(n,Ot,e)}function xf(e,n,r){if(n=Qu(e,n,hf)[0],e=mo(ga)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=is(n)}catch(S){throw S===ul?ro:S}else o=n;n=on();var h=n.queue,m=h.dispatch;return r!==n.memoizedState&&(Ye.flags|=2048,gl(9,{destroy:void 0},o2.bind(null,h,r),null)),[o,m,e]}function o2(e,n){e.action=n}function mf(e){var n=on(),r=Ot;if(r!==null)return xf(n,r,e);on(),n=n.memoizedState,r=on();var o=r.queue.dispatch;return r.memoizedState=e,[n,o,!1]}function gl(e,n,r,o){return e={tag:e,create:r,deps:o,inst:n,next:null},n=Ye.updateQueue,n===null&&(n=go(),Ye.updateQueue=n),r=n.lastEffect,r===null?n.lastEffect=e.next=e:(o=r.next,r.next=e,e.next=o,n.lastEffect=e),e}function yf(){return on().memoizedState}function yo(e,n,r,o){var h=Fn();Ye.flags|=e,h.memoizedState=gl(1|n,{destroy:void 0},r,o===void 0?null:o)}function po(e,n,r,o){var h=on();o=o===void 0?null:o;var m=h.memoizedState.inst;Ot!==null&&o!==null&&Pu(o,Ot.memoizedState.deps)?h.memoizedState=gl(n,m,r,o):(Ye.flags|=e,h.memoizedState=gl(1|n,m,r,o))}function pf(e,n){yo(8390656,8,e,n)}function Ju(e,n){po(2048,8,e,n)}function u2(e){Ye.flags|=4;var n=Ye.updateQueue;if(n===null)n=go(),Ye.updateQueue=n,n.events=[e];else{var r=n.events;r===null?n.events=[e]:r.push(e)}}function Af(e){var n=on().memoizedState;return u2({ref:n,nextImpl:e}),function(){if((Et&2)!==0)throw Error(y(440));return n.impl.apply(void 0,arguments)}}function Ef(e,n){return po(4,2,e,n)}function Cf(e,n){return po(4,4,e,n)}function wf(e,n){if(typeof n=="function"){e=e();var r=n(e);return function(){typeof r=="function"?r():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function Sf(e,n,r){r=r!=null?r.concat([e]):null,po(4,4,wf.bind(null,n,e),r)}function $u(){}function bf(e,n){var r=on();n=n===void 0?null:n;var o=r.memoizedState;return n!==null&&Pu(n,o[1])?o[0]:(r.memoizedState=[e,n],e)}function Tf(e,n){var r=on();n=n===void 0?null:n;var o=r.memoizedState;if(n!==null&&Pu(n,o[1]))return o[0];if(o=e(),Lr){It(!0);try{e()}finally{It(!1)}}return r.memoizedState=[o,n],o}function ec(e,n,r){return r===void 0||(da&1073741824)!==0&&(st&261930)===0?e.memoizedState=n:(e.memoizedState=r,e=v0(),Ye.lanes|=e,tr|=e,r)}function vf(e,n,r,o){return u(r,n)?r:fl.current!==null?(e=ec(e,r,o),u(e,n)||(dn=!0),e):(da&42)===0||(da&1073741824)!==0&&(st&261930)===0?(dn=!0,e.memoizedState=r):(e=v0(),Ye.lanes|=e,tr|=e,n)}function Nf(e,n,r,o,h){var m=oe.p;oe.p=m!==0&&8>m?m:8;var S=J.T,_={};J.T=_,ic(e,!1,n,r);try{var L=h(),X=J.S;if(X!==null&&X(_,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var se=a2(L,o);as(e,n,se,ci(e))}else as(e,n,o,ci(e))}catch(ce){as(e,n,{then:function(){},status:"rejected",reason:ce},ci())}finally{oe.p=m,S!==null&&_.types!==null&&(S.types=_.types),J.T=S}}function c2(){}function tc(e,n,r,o){if(e.tag!==5)throw Error(y(476));var h=Mf(e).queue;Nf(e,h,n,Oe,r===null?c2:function(){return If(e),r(o)})}function Mf(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:Oe,baseState:Oe,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:Oe},next:null};var r={};return n.next={memoizedState:r,baseState:r,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ga,lastRenderedState:r},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function If(e){var n=Mf(e);n.next===null&&(n=e.alternate.memoizedState),as(e,n.next.queue,{},ci())}function nc(){return In(Cs)}function Of(){return on().memoizedState}function _f(){return on().memoizedState}function f2(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var r=ci();e=qa(r);var o=Wa(n,e,r);o!==null&&(Kn(o,n,r),$l(o,n,r)),n={cache:_u()},e.payload=n;return}n=n.return}}function h2(e,n,r){var o=ci();r={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ao(e)?Df(n,r):(r=Eu(e,n,r,o),r!==null&&(Kn(r,e,o),Bf(r,n,o)))}function Rf(e,n,r){var o=ci();as(e,n,r,o)}function as(e,n,r,o){var h={lane:o,revertLane:0,gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null};if(Ao(e))Df(n,h);else{var m=e.alternate;if(e.lanes===0&&(m===null||m.lanes===0)&&(m=n.lastRenderedReducer,m!==null))try{var S=n.lastRenderedState,_=m(S,r);if(h.hasEagerState=!0,h.eagerState=_,u(_,S))return Js(e,n,h,0),zt===null&&Ks(),!1}catch{}finally{}if(r=Eu(e,n,h,o),r!==null)return Kn(r,e,o),Bf(r,n,o),!0}return!1}function ic(e,n,r,o){if(o={lane:2,revertLane:Lc(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Ao(e)){if(n)throw Error(y(479))}else n=Eu(e,r,o,2),n!==null&&Kn(n,e,2)}function Ao(e){var n=e.alternate;return e===Ye||n!==null&&n===Ye}function Df(e,n){hl=fo=!0;var r=e.pending;r===null?n.next=n:(n.next=r.next,r.next=n),e.pending=n}function Bf(e,n,r){if((r&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,r|=o,n.lanes=r,Vi(e,r)}}var rs={readContext:In,use:xo,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};rs.useEffectEvent=$t;var Lf={readContext:In,use:xo,useCallback:function(e,n){return Fn().memoizedState=[e,n===void 0?null:n],e},useContext:In,useEffect:pf,useImperativeHandle:function(e,n,r){r=r!=null?r.concat([e]):null,yo(4194308,4,wf.bind(null,n,e),r)},useLayoutEffect:function(e,n){return yo(4194308,4,e,n)},useInsertionEffect:function(e,n){yo(4,2,e,n)},useMemo:function(e,n){var r=Fn();n=n===void 0?null:n;var o=e();if(Lr){It(!0);try{e()}finally{It(!1)}}return r.memoizedState=[o,n],o},useReducer:function(e,n,r){var o=Fn();if(r!==void 0){var h=r(n);if(Lr){It(!0);try{r(n)}finally{It(!1)}}}else h=n;return o.memoizedState=o.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},o.queue=e,e=e.dispatch=h2.bind(null,Ye,e),[o.memoizedState,e]},useRef:function(e){var n=Fn();return e={current:e},n.memoizedState=e},useState:function(e){e=Wu(e);var n=e.queue,r=Rf.bind(null,Ye,n);return n.dispatch=r,[e.memoizedState,r]},useDebugValue:$u,useDeferredValue:function(e,n){var r=Fn();return ec(r,e,n)},useTransition:function(){var e=Wu(!1);return e=Nf.bind(null,Ye,e.queue,!0,!1),Fn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,r){var o=Ye,h=Fn();if(ut){if(r===void 0)throw Error(y(407));r=r()}else{if(r=n(),zt===null)throw Error(y(349));(st&127)!==0||tf(o,n,r)}h.memoizedState=r;var m={value:r,getSnapshot:n};return h.queue=m,pf(af.bind(null,o,m,e),[e]),o.flags|=2048,gl(9,{destroy:void 0},nf.bind(null,o,m,r,n),null),r},useId:function(){var e=Fn(),n=zt.identifierPrefix;if(ut){var r=Ki,o=Wi;r=(o&~(1<<32-Ge(o)-1)).toString(32)+r,n="_"+n+"R_"+r,r=ho++,0<r&&(n+="H"+r.toString(32)),n+="_"}else r=r2++,n="_"+n+"r_"+r.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:nc,useFormState:df,useActionState:df,useOptimistic:function(e){var n=Fn();n.memoizedState=n.baseState=e;var r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=r,n=ic.bind(null,Ye,!0,r),r.dispatch=n,[e,n]},useMemoCache:Zu,useCacheRefresh:function(){return Fn().memoizedState=f2.bind(null,Ye)},useEffectEvent:function(e){var n=Fn(),r={impl:e};return n.memoizedState=r,function(){if((Et&2)!==0)throw Error(y(440));return r.impl.apply(void 0,arguments)}}},ac={readContext:In,use:xo,useCallback:bf,useContext:In,useEffect:Ju,useImperativeHandle:Sf,useInsertionEffect:Ef,useLayoutEffect:Cf,useMemo:Tf,useReducer:mo,useRef:yf,useState:function(){return mo(ga)},useDebugValue:$u,useDeferredValue:function(e,n){var r=on();return vf(r,Ot.memoizedState,e,n)},useTransition:function(){var e=mo(ga)[0],n=on().memoizedState;return[typeof e=="boolean"?e:is(e),n]},useSyncExternalStore:ef,useId:Of,useHostTransitionStatus:nc,useFormState:gf,useActionState:gf,useOptimistic:function(e,n){var r=on();return sf(r,Ot,e,n)},useMemoCache:Zu,useCacheRefresh:_f};ac.useEffectEvent=Af;var Uf={readContext:In,use:xo,useCallback:bf,useContext:In,useEffect:Ju,useImperativeHandle:Sf,useInsertionEffect:Ef,useLayoutEffect:Cf,useMemo:Tf,useReducer:qu,useRef:yf,useState:function(){return qu(ga)},useDebugValue:$u,useDeferredValue:function(e,n){var r=on();return Ot===null?ec(r,e,n):vf(r,Ot.memoizedState,e,n)},useTransition:function(){var e=qu(ga)[0],n=on().memoizedState;return[typeof e=="boolean"?e:is(e),n]},useSyncExternalStore:ef,useId:Of,useHostTransitionStatus:nc,useFormState:mf,useActionState:mf,useOptimistic:function(e,n){var r=on();return Ot!==null?sf(r,Ot,e,n):(r.baseState=e,[e,r.queue.dispatch])},useMemoCache:Zu,useCacheRefresh:_f};Uf.useEffectEvent=Af;function rc(e,n,r,o){n=e.memoizedState,r=r(o,n),r=r==null?n:M({},n,r),e.memoizedState=r,e.lanes===0&&(e.updateQueue.baseState=r)}var lc={enqueueSetState:function(e,n,r){e=e._reactInternals;var o=ci(),h=qa(o);h.payload=n,r!=null&&(h.callback=r),n=Wa(e,h,o),n!==null&&(Kn(n,e,o),$l(n,e,o))},enqueueReplaceState:function(e,n,r){e=e._reactInternals;var o=ci(),h=qa(o);h.tag=1,h.payload=n,r!=null&&(h.callback=r),n=Wa(e,h,o),n!==null&&(Kn(n,e,o),$l(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var r=ci(),o=qa(r);o.tag=2,n!=null&&(o.callback=n),n=Wa(e,o,r),n!==null&&(Kn(n,e,r),$l(n,e,r))}};function zf(e,n,r,o,h,m,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,m,S):n.prototype&&n.prototype.isPureReactComponent?!c(r,o)||!c(h,m):!0}function kf(e,n,r,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(r,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(r,o),n.state!==e&&lc.enqueueReplaceState(n,n.state,null)}function Ur(e,n){var r=n;if("ref"in n){r={};for(var o in n)o!=="ref"&&(r[o]=n[o])}if(e=e.defaultProps){r===n&&(r=M({},r));for(var h in e)r[h]===void 0&&(r[h]=e[h])}return r}function Ff(e){Ws(e)}function Hf(e){console.error(e)}function jf(e){Ws(e)}function Eo(e,n){try{var r=e.onUncaughtError;r(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Pf(e,n,r){try{var o=e.onCaughtError;o(r.value,{componentStack:r.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function sc(e,n,r){return r=qa(r),r.tag=3,r.payload={element:null},r.callback=function(){Eo(e,n)},r}function Yf(e){return e=qa(e),e.tag=3,e}function Gf(e,n,r,o){var h=r.type.getDerivedStateFromError;if(typeof h=="function"){var m=o.value;e.payload=function(){return h(m)},e.callback=function(){Pf(n,r,o)}}var S=r.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){Pf(n,r,o),typeof h!="function"&&(nr===null?nr=new Set([this]):nr.add(this));var _=o.stack;this.componentDidCatch(o.value,{componentStack:_!==null?_:""})})}function d2(e,n,r,o,h){if(r.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=r.alternate,n!==null&&ll(n,r,h,!0),r=li.current,r!==null){switch(r.tag){case 31:case 13:return Ti===null?Ro():r.alternate===null&&en===0&&(en=3),r.flags&=-257,r.flags|=65536,r.lanes=h,o===lo?r.flags|=16384:(n=r.updateQueue,n===null?r.updateQueue=new Set([o]):n.add(o),Rc(e,o,h)),!1;case 22:return r.flags|=65536,o===lo?r.flags|=16384:(n=r.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},r.updateQueue=n):(r=n.retryQueue,r===null?n.retryQueue=new Set([o]):r.add(o)),Rc(e,o,h)),!1}throw Error(y(435,r.tag))}return Rc(e,o,h),Ro(),!1}if(ut)return n=li.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=h,o!==vu&&(e=Error(y(422),{cause:o}),Ql(Ci(e,r)))):(o!==vu&&(n=Error(y(423),{cause:o}),Ql(Ci(n,r))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,o=Ci(o,r),h=sc(e.stateNode,o,h),zu(e,h),en!==4&&(en=2)),!1;var m=Error(y(520),{cause:o});if(m=Ci(m,r),ds===null?ds=[m]:ds.push(m),en!==4&&(en=2),n===null)return!0;o=Ci(o,r),r=n;do{switch(r.tag){case 3:return r.flags|=65536,e=h&-h,r.lanes|=e,e=sc(r.stateNode,o,e),zu(r,e),!1;case 1:if(n=r.type,m=r.stateNode,(r.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(nr===null||!nr.has(m))))return r.flags|=65536,h&=-h,r.lanes|=h,h=Yf(h),Gf(h,e,r,o),zu(r,h),!1}r=r.return}while(r!==null);return!1}var oc=Error(y(461)),dn=!1;function On(e,n,r,o){n.child=e===null?Z1(n,null,r,o):Br(n,e.child,r,o)}function Vf(e,n,r,o,h){r=r.render;var m=n.ref;if("ref"in o){var S={};for(var _ in o)_!=="ref"&&(S[_]=o[_])}else S=o;return Or(n),o=Yu(e,n,r,S,m,h),_=Gu(),e!==null&&!dn?(Vu(e,n,h),xa(e,n,h)):(ut&&_&&bu(n),n.flags|=1,On(e,n,o,h),n.child)}function Xf(e,n,r,o,h){if(e===null){var m=r.type;return typeof m=="function"&&!Cu(m)&&m.defaultProps===void 0&&r.compare===null?(n.tag=15,n.type=m,Zf(e,n,m,o,h)):(e=eo(r.type,null,o,n,n.mode,h),e.ref=n.ref,e.return=n,n.child=e)}if(m=e.child,!mc(e,h)){var S=m.memoizedProps;if(r=r.compare,r=r!==null?r:c,r(S,o)&&e.ref===n.ref)return xa(e,n,h)}return n.flags|=1,e=ua(m,o),e.ref=n.ref,e.return=n,n.child=e}function Zf(e,n,r,o,h){if(e!==null){var m=e.memoizedProps;if(c(m,o)&&e.ref===n.ref)if(dn=!1,n.pendingProps=o=m,mc(e,h))(e.flags&131072)!==0&&(dn=!0);else return n.lanes=e.lanes,xa(e,n,h)}return uc(e,n,r,o,h)}function Qf(e,n,r,o){var h=o.children,m=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(m=m!==null?m.baseLanes|r:r,e!==null){for(o=n.child=e.child,h=0;o!==null;)h=h|o.lanes|o.childLanes,o=o.sibling;o=h&~m}else o=0,n.child=null;return qf(e,n,m,r,o)}if((r&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ao(n,m!==null?m.cachePool:null),m!==null?W1(n,m):Fu(),K1(n);else return o=n.lanes=536870912,qf(e,n,m!==null?m.baseLanes|r:r,r,o)}else m!==null?(ao(n,m.cachePool),W1(n,m),Ja(),n.memoizedState=null):(e!==null&&ao(n,null),Fu(),Ja());return On(e,n,h,r),n.child}function ls(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function qf(e,n,r,o,h){var m=Du();return m=m===null?null:{parent:fn._currentValue,pool:m},n.memoizedState={baseLanes:r,cachePool:m},e!==null&&ao(n,null),Fu(),K1(n),e!==null&&ll(e,n,o,!0),n.childLanes=h,null}function Co(e,n){return n=So({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Wf(e,n,r){return Br(n,e.child,null,r),e=Co(n,n.pendingProps),e.flags|=2,si(n),n.memoizedState=null,e}function g2(e,n,r){var o=n.pendingProps,h=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(ut){if(o.mode==="hidden")return e=Co(n,o),n.lanes=536870912,ls(null,e);if(ju(n),(e=jt)?(e=oh(e,bi),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:Wi,overflow:Ki}:null,retryLane:536870912,hydrationErrors:null},r=R1(e),r.return=n,n.child=r,Mn=n,jt=null)):e=null,e===null)throw Xa(n);return n.lanes=536870912,null}return Co(n,o)}var m=e.memoizedState;if(m!==null){var S=m.dehydrated;if(ju(n),h)if(n.flags&256)n.flags&=-257,n=Wf(e,n,r);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(y(558));else if(dn||ll(e,n,r,!1),h=(r&e.childLanes)!==0,dn||h){if(o=zt,o!==null&&(S=Gr(o,r),S!==0&&S!==m.retryLane))throw m.retryLane=S,vr(e,S),Kn(o,e,S),oc;Ro(),n=Wf(e,n,r)}else e=m.treeContext,jt=vi(S.nextSibling),Mn=n,ut=!0,Va=null,bi=!1,e!==null&&L1(n,e),n=Co(n,o),n.flags|=4096;return n}return e=ua(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function wo(e,n){var r=n.ref;if(r===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof r!="function"&&typeof r!="object")throw Error(y(284));(e===null||e.ref!==r)&&(n.flags|=4194816)}}function uc(e,n,r,o,h){return Or(n),r=Yu(e,n,r,o,void 0,h),o=Gu(),e!==null&&!dn?(Vu(e,n,h),xa(e,n,h)):(ut&&o&&bu(n),n.flags|=1,On(e,n,r,h),n.child)}function Kf(e,n,r,o,h,m){return Or(n),n.updateQueue=null,r=$1(n,o,r,h),J1(e),o=Gu(),e!==null&&!dn?(Vu(e,n,m),xa(e,n,m)):(ut&&o&&bu(n),n.flags|=1,On(e,n,r,m),n.child)}function Jf(e,n,r,o,h){if(Or(n),n.stateNode===null){var m=nl,S=r.contextType;typeof S=="object"&&S!==null&&(m=In(S)),m=new r(o,m),n.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=lc,n.stateNode=m,m._reactInternals=n,m=n.stateNode,m.props=o,m.state=n.memoizedState,m.refs={},Lu(n),S=r.contextType,m.context=typeof S=="object"&&S!==null?In(S):nl,m.state=n.memoizedState,S=r.getDerivedStateFromProps,typeof S=="function"&&(rc(n,r,S,o),m.state=n.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(S=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),S!==m.state&&lc.enqueueReplaceState(m,m.state,null),ts(n,o,m,h),es(),m.state=n.memoizedState),typeof m.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){m=n.stateNode;var _=n.memoizedProps,L=Ur(r,_);m.props=L;var X=m.context,se=r.contextType;S=nl,typeof se=="object"&&se!==null&&(S=In(se));var ce=r.getDerivedStateFromProps;se=typeof ce=="function"||typeof m.getSnapshotBeforeUpdate=="function",_=n.pendingProps!==_,se||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(_||X!==S)&&kf(n,m,o,S),Qa=!1;var Q=n.memoizedState;m.state=Q,ts(n,o,m,h),es(),X=n.memoizedState,_||Q!==X||Qa?(typeof ce=="function"&&(rc(n,r,ce,o),X=n.memoizedState),(L=Qa||zf(n,r,L,o,Q,X,S))?(se||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(n.flags|=4194308)):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=X),m.props=o,m.state=X,m.context=S,o=L):(typeof m.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{m=n.stateNode,Uu(e,n),S=n.memoizedProps,se=Ur(r,S),m.props=se,ce=n.pendingProps,Q=m.context,X=r.contextType,L=nl,typeof X=="object"&&X!==null&&(L=In(X)),_=r.getDerivedStateFromProps,(X=typeof _=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S!==ce||Q!==L)&&kf(n,m,o,L),Qa=!1,Q=n.memoizedState,m.state=Q,ts(n,o,m,h),es();var $=n.memoizedState;S!==ce||Q!==$||Qa||e!==null&&e.dependencies!==null&&no(e.dependencies)?(typeof _=="function"&&(rc(n,r,_,o),$=n.memoizedState),(se=Qa||zf(n,r,se,o,Q,$,L)||e!==null&&e.dependencies!==null&&no(e.dependencies))?(X||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(o,$,L),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(o,$,L)),typeof m.componentDidUpdate=="function"&&(n.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof m.componentDidUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=$),m.props=o,m.state=$,m.context=L,o=se):(typeof m.componentDidUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(n.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&Q===e.memoizedState||(n.flags|=1024),o=!1)}return m=o,wo(e,n),o=(n.flags&128)!==0,m||o?(m=n.stateNode,r=o&&typeof r.getDerivedStateFromError!="function"?null:m.render(),n.flags|=1,e!==null&&o?(n.child=Br(n,e.child,null,h),n.child=Br(n,null,r,h)):On(e,n,r,h),n.memoizedState=m.state,e=n.child):e=xa(e,n,h),e}function $f(e,n,r,o){return Mr(),n.flags|=256,On(e,n,r,o),n.child}var cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fc(e){return{baseLanes:e,cachePool:j1()}}function hc(e,n,r){return e=e!==null?e.childLanes&~r:0,n&&(e|=ui),e}function e0(e,n,r){var o=n.pendingProps,h=!1,m=(n.flags&128)!==0,S;if((S=m)||(S=e!==null&&e.memoizedState===null?!1:(sn.current&2)!==0),S&&(h=!0,n.flags&=-129),S=(n.flags&32)!==0,n.flags&=-33,e===null){if(ut){if(h?Ka(n):Ja(),(e=jt)?(e=oh(e,bi),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:Ga!==null?{id:Wi,overflow:Ki}:null,retryLane:536870912,hydrationErrors:null},r=R1(e),r.return=n,n.child=r,Mn=n,jt=null)):e=null,e===null)throw Xa(n);return Qc(e)?n.lanes=32:n.lanes=536870912,null}var _=o.children;return o=o.fallback,h?(Ja(),h=n.mode,_=So({mode:"hidden",children:_},h),o=Nr(o,h,r,null),_.return=n,o.return=n,_.sibling=o,n.child=_,o=n.child,o.memoizedState=fc(r),o.childLanes=hc(e,S,r),n.memoizedState=cc,ls(null,o)):(Ka(n),dc(n,_))}var L=e.memoizedState;if(L!==null&&(_=L.dehydrated,_!==null)){if(m)n.flags&256?(Ka(n),n.flags&=-257,n=gc(e,n,r)):n.memoizedState!==null?(Ja(),n.child=e.child,n.flags|=128,n=null):(Ja(),_=o.fallback,h=n.mode,o=So({mode:"visible",children:o.children},h),_=Nr(_,h,r,null),_.flags|=2,o.return=n,_.return=n,o.sibling=_,n.child=o,Br(n,e.child,null,r),o=n.child,o.memoizedState=fc(r),o.childLanes=hc(e,S,r),n.memoizedState=cc,n=ls(null,o));else if(Ka(n),Qc(_)){if(S=_.nextSibling&&_.nextSibling.dataset,S)var X=S.dgst;S=X,o=Error(y(419)),o.stack="",o.digest=S,Ql({value:o,source:null,stack:null}),n=gc(e,n,r)}else if(dn||ll(e,n,r,!1),S=(r&e.childLanes)!==0,dn||S){if(S=zt,S!==null&&(o=Gr(S,r),o!==0&&o!==L.retryLane))throw L.retryLane=o,vr(e,o),Kn(S,e,o),oc;Zc(_)||Ro(),n=gc(e,n,r)}else Zc(_)?(n.flags|=192,n.child=e.child,n=null):(e=L.treeContext,jt=vi(_.nextSibling),Mn=n,ut=!0,Va=null,bi=!1,e!==null&&L1(n,e),n=dc(n,o.children),n.flags|=4096);return n}return h?(Ja(),_=o.fallback,h=n.mode,L=e.child,X=L.sibling,o=ua(L,{mode:"hidden",children:o.children}),o.subtreeFlags=L.subtreeFlags&65011712,X!==null?_=ua(X,_):(_=Nr(_,h,r,null),_.flags|=2),_.return=n,o.return=n,o.sibling=_,n.child=o,ls(null,o),o=n.child,_=e.child.memoizedState,_===null?_=fc(r):(h=_.cachePool,h!==null?(L=fn._currentValue,h=h.parent!==L?{parent:L,pool:L}:h):h=j1(),_={baseLanes:_.baseLanes|r,cachePool:h}),o.memoizedState=_,o.childLanes=hc(e,S,r),n.memoizedState=cc,ls(e.child,o)):(Ka(n),r=e.child,e=r.sibling,r=ua(r,{mode:"visible",children:o.children}),r.return=n,r.sibling=null,e!==null&&(S=n.deletions,S===null?(n.deletions=[e],n.flags|=16):S.push(e)),n.child=r,n.memoizedState=null,r)}function dc(e,n){return n=So({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function So(e,n){return e=ri(22,e,null,n),e.lanes=0,e}function gc(e,n,r){return Br(n,e.child,null,r),e=dc(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function t0(e,n,r){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Iu(e.return,n,r)}function xc(e,n,r,o,h,m){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:r,tailMode:h,treeForkCount:m}:(S.isBackwards=n,S.rendering=null,S.renderingStartTime=0,S.last=o,S.tail=r,S.tailMode=h,S.treeForkCount=m)}function n0(e,n,r){var o=n.pendingProps,h=o.revealOrder,m=o.tail;o=o.children;var S=sn.current,_=(S&2)!==0;if(_?(S=S&1|2,n.flags|=128):S&=1,Ee(sn,S),On(e,n,o,r),o=ut?Zl:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&t0(e,r,n);else if(e.tag===19)t0(e,r,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(h){case"forwards":for(r=n.child,h=null;r!==null;)e=r.alternate,e!==null&&co(e)===null&&(h=r),r=r.sibling;r=h,r===null?(h=n.child,n.child=null):(h=r.sibling,r.sibling=null),xc(n,!1,h,r,m,o);break;case"backwards":case"unstable_legacy-backwards":for(r=null,h=n.child,n.child=null;h!==null;){if(e=h.alternate,e!==null&&co(e)===null){n.child=h;break}e=h.sibling,h.sibling=r,r=h,h=e}xc(n,!0,r,null,m,o);break;case"together":xc(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function xa(e,n,r){if(e!==null&&(n.dependencies=e.dependencies),tr|=n.lanes,(r&n.childLanes)===0)if(e!==null){if(ll(e,n,r,!1),(r&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(y(153));if(n.child!==null){for(e=n.child,r=ua(e,e.pendingProps),n.child=r,r.return=n;e.sibling!==null;)e=e.sibling,r=r.sibling=ua(e,e.pendingProps),r.return=n;r.sibling=null}return n.child}function mc(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&no(e)))}function x2(e,n,r){switch(n.tag){case 3:ft(n,n.stateNode.containerInfo),Za(n,fn,e.memoizedState.cache),Mr();break;case 27:case 5:Ii(n);break;case 4:ft(n,n.stateNode.containerInfo);break;case 10:Za(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,ju(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ka(n),n.flags|=128,null):(r&n.child.childLanes)!==0?e0(e,n,r):(Ka(n),e=xa(e,n,r),e!==null?e.sibling:null);Ka(n);break;case 19:var h=(e.flags&128)!==0;if(o=(r&n.childLanes)!==0,o||(ll(e,n,r,!1),o=(r&n.childLanes)!==0),h){if(o)return n0(e,n,r);n.flags|=128}if(h=n.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Ee(sn,sn.current),o)break;return null;case 22:return n.lanes=0,Qf(e,n,r,n.pendingProps);case 24:Za(n,fn,e.memoizedState.cache)}return xa(e,n,r)}function i0(e,n,r){if(e!==null)if(e.memoizedProps!==n.pendingProps)dn=!0;else{if(!mc(e,r)&&(n.flags&128)===0)return dn=!1,x2(e,n,r);dn=(e.flags&131072)!==0}else dn=!1,ut&&(n.flags&1048576)!==0&&B1(n,Zl,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=Rr(n.elementType),n.type=e,typeof e=="function")Cu(e)?(o=Ur(e,o),n.tag=1,n=Jf(null,n,e,o,r)):(n.tag=0,n=uc(null,n,e,o,r));else{if(e!=null){var h=e.$$typeof;if(h===we){n.tag=11,n=Vf(null,n,e,o,r);break e}else if(h===le){n.tag=14,n=Xf(null,n,e,o,r);break e}}throw n=at(e)||e,Error(y(306,n,""))}}return n;case 0:return uc(e,n,n.type,n.pendingProps,r);case 1:return o=n.type,h=Ur(o,n.pendingProps),Jf(e,n,o,h,r);case 3:e:{if(ft(n,n.stateNode.containerInfo),e===null)throw Error(y(387));o=n.pendingProps;var m=n.memoizedState;h=m.element,Uu(e,n),ts(n,o,null,r);var S=n.memoizedState;if(o=S.cache,Za(n,fn,o),o!==m.cache&&Ou(n,[fn],r,!0),es(),o=S.element,m.isDehydrated)if(m={element:o,isDehydrated:!1,cache:S.cache},n.updateQueue.baseState=m,n.memoizedState=m,n.flags&256){n=$f(e,n,o,r);break e}else if(o!==h){h=Ci(Error(y(424)),n),Ql(h),n=$f(e,n,o,r);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(jt=vi(e.firstChild),Mn=n,ut=!0,Va=null,bi=!0,r=Z1(n,null,o,r),n.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling}else{if(Mr(),o===h){n=xa(e,n,r);break e}On(e,n,o,r)}n=n.child}return n;case 26:return wo(e,n),e===null?(r=gh(n.type,null,n.pendingProps,null))?n.memoizedState=r:ut||(r=n.type,e=n.pendingProps,o=Fo(Ae.current).createElement(r),o[an]=n,o[Tt]=e,_n(o,r,e),Kt(o),n.stateNode=o):n.memoizedState=gh(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Ii(n),e===null&&ut&&(o=n.stateNode=fh(n.type,n.pendingProps,Ae.current),Mn=n,bi=!0,h=jt,lr(n.type)?(qc=h,jt=vi(o.firstChild)):jt=h),On(e,n,n.pendingProps.children,r),wo(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&ut&&((h=o=jt)&&(o=V2(o,n.type,n.pendingProps,bi),o!==null?(n.stateNode=o,Mn=n,jt=vi(o.firstChild),bi=!1,h=!0):h=!1),h||Xa(n)),Ii(n),h=n.type,m=n.pendingProps,S=e!==null?e.memoizedProps:null,o=m.children,Gc(h,m)?o=null:S!==null&&Gc(h,S)&&(n.flags|=32),n.memoizedState!==null&&(h=Yu(e,n,l2,null,null,r),Cs._currentValue=h),wo(e,n),On(e,n,o,r),n.child;case 6:return e===null&&ut&&((e=r=jt)&&(r=X2(r,n.pendingProps,bi),r!==null?(n.stateNode=r,Mn=n,jt=null,e=!0):e=!1),e||Xa(n)),null;case 13:return e0(e,n,r);case 4:return ft(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=Br(n,null,o,r):On(e,n,o,r),n.child;case 11:return Vf(e,n,n.type,n.pendingProps,r);case 7:return On(e,n,n.pendingProps,r),n.child;case 8:return On(e,n,n.pendingProps.children,r),n.child;case 12:return On(e,n,n.pendingProps.children,r),n.child;case 10:return o=n.pendingProps,Za(n,n.type,o.value),On(e,n,o.children,r),n.child;case 9:return h=n.type._context,o=n.pendingProps.children,Or(n),h=In(h),o=o(h),n.flags|=1,On(e,n,o,r),n.child;case 14:return Xf(e,n,n.type,n.pendingProps,r);case 15:return Zf(e,n,n.type,n.pendingProps,r);case 19:return n0(e,n,r);case 31:return g2(e,n,r);case 22:return Qf(e,n,r,n.pendingProps);case 24:return Or(n),o=In(fn),e===null?(h=Du(),h===null&&(h=zt,m=_u(),h.pooledCache=m,m.refCount++,m!==null&&(h.pooledCacheLanes|=r),h=m),n.memoizedState={parent:o,cache:h},Lu(n),Za(n,fn,h)):((e.lanes&r)!==0&&(Uu(e,n),ts(n,null,null,r),es()),h=e.memoizedState,m=n.memoizedState,h.parent!==o?(h={parent:o,cache:o},n.memoizedState=h,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=h),Za(n,fn,o)):(o=m.cache,Za(n,fn,o),o!==h.cache&&Ou(n,[fn],r,!0))),On(e,n,n.pendingProps.children,r),n.child;case 29:throw n.pendingProps}throw Error(y(156,n.tag))}function ma(e){e.flags|=4}function yc(e,n,r,o,h){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(h&335544128)===h)if(e.stateNode.complete)e.flags|=8192;else if(O0())e.flags|=8192;else throw Dr=lo,Bu}else e.flags&=-16777217}function a0(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ah(n))if(O0())e.flags|=8192;else throw Dr=lo,Bu}function bo(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?yn():536870912,e.lanes|=n,pl|=n)}function ss(e,n){if(!ut)switch(e.tailMode){case"hidden":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var o=null;r!==null;)r.alternate!==null&&(o=r),r=r.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Pt(e){var n=e.alternate!==null&&e.alternate.child===e.child,r=0,o=0;if(n)for(var h=e.child;h!==null;)r|=h.lanes|h.childLanes,o|=h.subtreeFlags&65011712,o|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)r|=h.lanes|h.childLanes,o|=h.subtreeFlags,o|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=o,e.childLanes=r,n}function m2(e,n,r){var o=n.pendingProps;switch(Tu(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(n),null;case 1:return Pt(n),null;case 3:return r=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),ha(fn),Dt(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(rl(n)?ma(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nu())),Pt(n),null;case 26:var h=n.type,m=n.memoizedState;return e===null?(ma(n),m!==null?(Pt(n),a0(n,m)):(Pt(n),yc(n,h,null,o,r))):m?m!==e.memoizedState?(ma(n),Pt(n),a0(n,m)):(Pt(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&ma(n),Pt(n),yc(n,h,e,o,r)),null;case 27:if(xn(n),r=Ae.current,h=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ma(n);else{if(!o){if(n.stateNode===null)throw Error(y(166));return Pt(n),null}e=Ce.current,rl(n)?U1(n):(e=fh(h,o,r),n.stateNode=e,ma(n))}return Pt(n),null;case 5:if(xn(n),h=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&ma(n);else{if(!o){if(n.stateNode===null)throw Error(y(166));return Pt(n),null}if(m=Ce.current,rl(n))U1(n);else{var S=Fo(Ae.current);switch(m){case 1:m=S.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:m=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":m=S.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":m=S.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":m=S.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof o.is=="string"?S.createElement("select",{is:o.is}):S.createElement("select"),o.multiple?m.multiple=!0:o.size&&(m.size=o.size);break;default:m=typeof o.is=="string"?S.createElement(h,{is:o.is}):S.createElement(h)}}m[an]=n,m[Tt]=o;e:for(S=n.child;S!==null;){if(S.tag===5||S.tag===6)m.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===n)break e;for(;S.sibling===null;){if(S.return===null||S.return===n)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}n.stateNode=m;e:switch(_n(m,h,o),h){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ma(n)}}return Pt(n),yc(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,r),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&ma(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(y(166));if(e=Ae.current,rl(n)){if(e=n.stateNode,r=n.memoizedProps,o=null,h=Mn,h!==null)switch(h.tag){case 27:case 5:o=h.memoizedProps}e[an]=n,e=!!(e.nodeValue===r||o!==null&&o.suppressHydrationWarning===!0||eh(e.nodeValue,r)),e||Xa(n,!0)}else e=Fo(e).createTextNode(o),e[an]=n,n.stateNode=e}return Pt(n),null;case 31:if(r=n.memoizedState,e===null||e.memoizedState!==null){if(o=rl(n),r!==null){if(e===null){if(!o)throw Error(y(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(y(557));e[an]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Pt(n),e=!1}else r=Nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=r),e=!0;if(!e)return n.flags&256?(si(n),n):(si(n),null);if((n.flags&128)!==0)throw Error(y(558))}return Pt(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=rl(n),o!==null&&o.dehydrated!==null){if(e===null){if(!h)throw Error(y(318));if(h=n.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(y(317));h[an]=n}else Mr(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Pt(n),h=!1}else h=Nu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return n.flags&256?(si(n),n):(si(n),null)}return si(n),(n.flags&128)!==0?(n.lanes=r,n):(r=o!==null,e=e!==null&&e.memoizedState!==null,r&&(o=n.child,h=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(h=o.alternate.memoizedState.cachePool.pool),m=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(m=o.memoizedState.cachePool.pool),m!==h&&(o.flags|=2048)),r!==e&&r&&(n.child.flags|=8192),bo(n,n.updateQueue),Pt(n),null);case 4:return Dt(),e===null&&Fc(n.stateNode.containerInfo),Pt(n),null;case 10:return ha(n.type),Pt(n),null;case 19:if(re(sn),o=n.memoizedState,o===null)return Pt(n),null;if(h=(n.flags&128)!==0,m=o.rendering,m===null)if(h)ss(o,!1);else{if(en!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(m=co(e),m!==null){for(n.flags|=128,ss(o,!1),e=m.updateQueue,n.updateQueue=e,bo(n,e),n.subtreeFlags=0,e=r,r=n.child;r!==null;)_1(r,e),r=r.sibling;return Ee(sn,sn.current&1|2),ut&&ca(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&qt()>Io&&(n.flags|=128,h=!0,ss(o,!1),n.lanes=4194304)}else{if(!h)if(e=co(m),e!==null){if(n.flags|=128,h=!0,e=e.updateQueue,n.updateQueue=e,bo(n,e),ss(o,!0),o.tail===null&&o.tailMode==="hidden"&&!m.alternate&&!ut)return Pt(n),null}else 2*qt()-o.renderingStartTime>Io&&r!==536870912&&(n.flags|=128,h=!0,ss(o,!1),n.lanes=4194304);o.isBackwards?(m.sibling=n.child,n.child=m):(e=o.last,e!==null?e.sibling=m:n.child=m,o.last=m)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=qt(),e.sibling=null,r=sn.current,Ee(sn,h?r&1|2:r&1),ut&&ca(n,o.treeForkCount),e):(Pt(n),null);case 22:case 23:return si(n),Hu(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(r&536870912)!==0&&(n.flags&128)===0&&(Pt(n),n.subtreeFlags&6&&(n.flags|=8192)):Pt(n),r=n.updateQueue,r!==null&&bo(n,r.retryQueue),r=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==r&&(n.flags|=2048),e!==null&&re(_r),null;case 24:return r=null,e!==null&&(r=e.memoizedState.cache),n.memoizedState.cache!==r&&(n.flags|=2048),ha(fn),Pt(n),null;case 25:return null;case 30:return null}throw Error(y(156,n.tag))}function y2(e,n){switch(Tu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return ha(fn),Dt(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return xn(n),null;case 31:if(n.memoizedState!==null){if(si(n),n.alternate===null)throw Error(y(340));Mr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(si(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(y(340));Mr()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return re(sn),null;case 4:return Dt(),null;case 10:return ha(n.type),null;case 22:case 23:return si(n),Hu(),e!==null&&re(_r),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return ha(fn),null;case 25:return null;default:return null}}function r0(e,n){switch(Tu(n),n.tag){case 3:ha(fn),Dt();break;case 26:case 27:case 5:xn(n);break;case 4:Dt();break;case 31:n.memoizedState!==null&&si(n);break;case 13:si(n);break;case 19:re(sn);break;case 10:ha(n.type);break;case 22:case 23:si(n),Hu(),e!==null&&re(_r);break;case 24:ha(fn)}}function os(e,n){try{var r=n.updateQueue,o=r!==null?r.lastEffect:null;if(o!==null){var h=o.next;r=h;do{if((r.tag&e)===e){o=void 0;var m=r.create,S=r.inst;o=m(),S.destroy=o}r=r.next}while(r!==h)}}catch(_){Nt(n,n.return,_)}}function $a(e,n,r){try{var o=n.updateQueue,h=o!==null?o.lastEffect:null;if(h!==null){var m=h.next;o=m;do{if((o.tag&e)===e){var S=o.inst,_=S.destroy;if(_!==void 0){S.destroy=void 0,h=n;var L=r,X=_;try{X()}catch(se){Nt(h,L,se)}}}o=o.next}while(o!==m)}}catch(se){Nt(n,n.return,se)}}function l0(e){var n=e.updateQueue;if(n!==null){var r=e.stateNode;try{q1(n,r)}catch(o){Nt(e,e.return,o)}}}function s0(e,n,r){r.props=Ur(e.type,e.memoizedProps),r.state=e.memoizedState;try{r.componentWillUnmount()}catch(o){Nt(e,n,o)}}function us(e,n){try{var r=e.ref;if(r!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof r=="function"?e.refCleanup=r(o):r.current=o}}catch(h){Nt(e,n,h)}}function Ji(e,n){var r=e.ref,o=e.refCleanup;if(r!==null)if(typeof o=="function")try{o()}catch(h){Nt(e,n,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof r=="function")try{r(null)}catch(h){Nt(e,n,h)}else r.current=null}function o0(e){var n=e.type,r=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":r.autoFocus&&o.focus();break e;case"img":r.src?o.src=r.src:r.srcSet&&(o.srcset=r.srcSet)}}catch(h){Nt(e,e.return,h)}}function pc(e,n,r){try{var o=e.stateNode;F2(o,e.type,r,n),o[Tt]=n}catch(h){Nt(e,e.return,h)}}function u0(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&lr(e.type)||e.tag===4}function Ac(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||u0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&lr(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Ec(e,n,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r).insertBefore(e,n):(n=r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,n.appendChild(e),r=r._reactRootContainer,r!=null||n.onclick!==null||(n.onclick=Gn));else if(o!==4&&(o===27&&lr(e.type)&&(r=e.stateNode,n=null),e=e.child,e!==null))for(Ec(e,n,r),e=e.sibling;e!==null;)Ec(e,n,r),e=e.sibling}function To(e,n,r){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?r.insertBefore(e,n):r.appendChild(e);else if(o!==4&&(o===27&&lr(e.type)&&(r=e.stateNode),e=e.child,e!==null))for(To(e,n,r),e=e.sibling;e!==null;)To(e,n,r),e=e.sibling}function c0(e){var n=e.stateNode,r=e.memoizedProps;try{for(var o=e.type,h=n.attributes;h.length;)n.removeAttributeNode(h[0]);_n(n,o,r),n[an]=e,n[Tt]=r}catch(m){Nt(e,e.return,m)}}var ya=!1,gn=!1,Cc=!1,f0=typeof WeakSet=="function"?WeakSet:Set,bn=null;function p2(e,n){if(e=e.containerInfo,Pc=Xo,e=v(e),I(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var o=r.getSelection&&r.getSelection();if(o&&o.rangeCount!==0){r=o.anchorNode;var h=o.anchorOffset,m=o.focusNode;o=o.focusOffset;try{r.nodeType,m.nodeType}catch{r=null;break e}var S=0,_=-1,L=-1,X=0,se=0,ce=e,Q=null;t:for(;;){for(var $;ce!==r||h!==0&&ce.nodeType!==3||(_=S+h),ce!==m||o!==0&&ce.nodeType!==3||(L=S+o),ce.nodeType===3&&(S+=ce.nodeValue.length),($=ce.firstChild)!==null;)Q=ce,ce=$;for(;;){if(ce===e)break t;if(Q===r&&++X===h&&(_=S),Q===m&&++se===o&&(L=S),($=ce.nextSibling)!==null)break;ce=Q,Q=ce.parentNode}ce=$}r=_===-1||L===-1?null:{start:_,end:L}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yc={focusedElem:e,selectionRange:r},Xo=!1,bn=n;bn!==null;)if(n=bn,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,bn=e;else for(;bn!==null;){switch(n=bn,m=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(r=0;r<e.length;r++)h=e[r],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&m!==null){e=void 0,r=n,h=m.memoizedProps,m=m.memoizedState,o=r.stateNode;try{var ve=Ur(r.type,h);e=o.getSnapshotBeforeUpdate(ve,m),o.__reactInternalSnapshotBeforeUpdate=e}catch(ze){Nt(r,r.return,ze)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,r=e.nodeType,r===9)Xc(e);else if(r===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Xc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(y(163))}if(e=n.sibling,e!==null){e.return=n.return,bn=e;break}bn=n.return}}function h0(e,n,r){var o=r.flags;switch(r.tag){case 0:case 11:case 15:Aa(e,r),o&4&&os(5,r);break;case 1:if(Aa(e,r),o&4)if(e=r.stateNode,n===null)try{e.componentDidMount()}catch(S){Nt(r,r.return,S)}else{var h=Ur(r.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(h,n,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Nt(r,r.return,S)}}o&64&&l0(r),o&512&&us(r,r.return);break;case 3:if(Aa(e,r),o&64&&(e=r.updateQueue,e!==null)){if(n=null,r.child!==null)switch(r.child.tag){case 27:case 5:n=r.child.stateNode;break;case 1:n=r.child.stateNode}try{q1(e,n)}catch(S){Nt(r,r.return,S)}}break;case 27:n===null&&o&4&&c0(r);case 26:case 5:Aa(e,r),n===null&&o&4&&o0(r),o&512&&us(r,r.return);break;case 12:Aa(e,r);break;case 31:Aa(e,r),o&4&&x0(e,r);break;case 13:Aa(e,r),o&4&&m0(e,r),o&64&&(e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(r=N2.bind(null,r),Z2(e,r))));break;case 22:if(o=r.memoizedState!==null||ya,!o){n=n!==null&&n.memoizedState!==null||gn,h=ya;var m=gn;ya=o,(gn=n)&&!m?Ea(e,r,(r.subtreeFlags&8772)!==0):Aa(e,r),ya=h,gn=m}break;case 30:break;default:Aa(e,r)}}function d0(e){var n=e.alternate;n!==null&&(e.alternate=null,d0(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Yn(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Zt=null,Zn=!1;function pa(e,n,r){for(r=r.child;r!==null;)g0(e,n,r),r=r.sibling}function g0(e,n,r){if(ye&&typeof ye.onCommitFiberUnmount=="function")try{ye.onCommitFiberUnmount(kt,r)}catch{}switch(r.tag){case 26:gn||Ji(r,n),pa(e,n,r),r.memoizedState?r.memoizedState.count--:r.stateNode&&(r=r.stateNode,r.parentNode.removeChild(r));break;case 27:gn||Ji(r,n);var o=Zt,h=Zn;lr(r.type)&&(Zt=r.stateNode,Zn=!1),pa(e,n,r),ps(r.stateNode),Zt=o,Zn=h;break;case 5:gn||Ji(r,n);case 6:if(o=Zt,h=Zn,Zt=null,pa(e,n,r),Zt=o,Zn=h,Zt!==null)if(Zn)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(r.stateNode)}catch(m){Nt(r,n,m)}else try{Zt.removeChild(r.stateNode)}catch(m){Nt(r,n,m)}break;case 18:Zt!==null&&(Zn?(e=Zt,lh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,r.stateNode),vl(e)):lh(Zt,r.stateNode));break;case 4:o=Zt,h=Zn,Zt=r.stateNode.containerInfo,Zn=!0,pa(e,n,r),Zt=o,Zn=h;break;case 0:case 11:case 14:case 15:$a(2,r,n),gn||$a(4,r,n),pa(e,n,r);break;case 1:gn||(Ji(r,n),o=r.stateNode,typeof o.componentWillUnmount=="function"&&s0(r,n,o)),pa(e,n,r);break;case 21:pa(e,n,r);break;case 22:gn=(o=gn)||r.memoizedState!==null,pa(e,n,r),gn=o;break;default:pa(e,n,r)}}function x0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{vl(e)}catch(r){Nt(n,n.return,r)}}}function m0(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{vl(e)}catch(r){Nt(n,n.return,r)}}function A2(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new f0),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new f0),n;default:throw Error(y(435,e.tag))}}function vo(e,n){var r=A2(e);n.forEach(function(o){if(!r.has(o)){r.add(o);var h=M2.bind(null,e,o);o.then(h,h)}})}function Qn(e,n){var r=n.deletions;if(r!==null)for(var o=0;o<r.length;o++){var h=r[o],m=e,S=n,_=S;e:for(;_!==null;){switch(_.tag){case 27:if(lr(_.type)){Zt=_.stateNode,Zn=!1;break e}break;case 5:Zt=_.stateNode,Zn=!1;break e;case 3:case 4:Zt=_.stateNode.containerInfo,Zn=!0;break e}_=_.return}if(Zt===null)throw Error(y(160));g0(m,S,h),Zt=null,Zn=!1,m=h.alternate,m!==null&&(m.return=null),h.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)y0(n,e),n=n.sibling}var zi=null;function y0(e,n){var r=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Qn(n,e),qn(e),o&4&&($a(3,e,e.return),os(3,e),$a(5,e,e.return));break;case 1:Qn(n,e),qn(e),o&512&&(gn||r===null||Ji(r,r.return)),o&64&&ya&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(r=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=r===null?o:r.concat(o))));break;case 26:var h=zi;if(Qn(n,e),qn(e),o&512&&(gn||r===null||Ji(r,r.return)),o&4){var m=r!==null?r.memoizedState:null;if(o=e.memoizedState,r===null)if(o===null)if(e.stateNode===null){e:{o=e.type,r=e.memoizedProps,h=h.ownerDocument||h;t:switch(o){case"title":m=h.getElementsByTagName("title")[0],(!m||m[yr]||m[an]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=h.createElement(o),h.head.insertBefore(m,h.querySelector("head > title"))),_n(m,o,r),m[an]=e,Kt(m),o=m;break e;case"link":var S=yh("link","href",h).get(o+(r.href||""));if(S){for(var _=0;_<S.length;_++)if(m=S[_],m.getAttribute("href")===(r.href==null||r.href===""?null:r.href)&&m.getAttribute("rel")===(r.rel==null?null:r.rel)&&m.getAttribute("title")===(r.title==null?null:r.title)&&m.getAttribute("crossorigin")===(r.crossOrigin==null?null:r.crossOrigin)){S.splice(_,1);break t}}m=h.createElement(o),_n(m,o,r),h.head.appendChild(m);break;case"meta":if(S=yh("meta","content",h).get(o+(r.content||""))){for(_=0;_<S.length;_++)if(m=S[_],m.getAttribute("content")===(r.content==null?null:""+r.content)&&m.getAttribute("name")===(r.name==null?null:r.name)&&m.getAttribute("property")===(r.property==null?null:r.property)&&m.getAttribute("http-equiv")===(r.httpEquiv==null?null:r.httpEquiv)&&m.getAttribute("charset")===(r.charSet==null?null:r.charSet)){S.splice(_,1);break t}}m=h.createElement(o),_n(m,o,r),h.head.appendChild(m);break;default:throw Error(y(468,o))}m[an]=e,Kt(m),o=m}e.stateNode=o}else ph(h,e.type,e.stateNode);else e.stateNode=mh(h,o,e.memoizedProps);else m!==o?(m===null?r.stateNode!==null&&(r=r.stateNode,r.parentNode.removeChild(r)):m.count--,o===null?ph(h,e.type,e.stateNode):mh(h,o,e.memoizedProps)):o===null&&e.stateNode!==null&&pc(e,e.memoizedProps,r.memoizedProps)}break;case 27:Qn(n,e),qn(e),o&512&&(gn||r===null||Ji(r,r.return)),r!==null&&o&4&&pc(e,e.memoizedProps,r.memoizedProps);break;case 5:if(Qn(n,e),qn(e),o&512&&(gn||r===null||Ji(r,r.return)),e.flags&32){h=e.stateNode;try{La(h,"")}catch(ve){Nt(e,e.return,ve)}}o&4&&e.stateNode!=null&&(h=e.memoizedProps,pc(e,h,r!==null?r.memoizedProps:h)),o&1024&&(Cc=!0);break;case 6:if(Qn(n,e),qn(e),o&4){if(e.stateNode===null)throw Error(y(162));o=e.memoizedProps,r=e.stateNode;try{r.nodeValue=o}catch(ve){Nt(e,e.return,ve)}}break;case 3:if(Po=null,h=zi,zi=Ho(n.containerInfo),Qn(n,e),zi=h,qn(e),o&4&&r!==null&&r.memoizedState.isDehydrated)try{vl(n.containerInfo)}catch(ve){Nt(e,e.return,ve)}Cc&&(Cc=!1,p0(e));break;case 4:o=zi,zi=Ho(e.stateNode.containerInfo),Qn(n,e),qn(e),zi=o;break;case 12:Qn(n,e),qn(e);break;case 31:Qn(n,e),qn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vo(e,o)));break;case 13:Qn(n,e),qn(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Mo=qt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vo(e,o)));break;case 22:h=e.memoizedState!==null;var L=r!==null&&r.memoizedState!==null,X=ya,se=gn;if(ya=X||h,gn=se||L,Qn(n,e),gn=se,ya=X,qn(e),o&8192)e:for(n=e.stateNode,n._visibility=h?n._visibility&-2:n._visibility|1,h&&(r===null||L||ya||gn||zr(e)),r=null,n=e;;){if(n.tag===5||n.tag===26){if(r===null){L=r=n;try{if(m=L.stateNode,h)S=m.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{_=L.stateNode;var ce=L.memoizedProps.style,Q=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;_.style.display=Q==null||typeof Q=="boolean"?"":(""+Q).trim()}}catch(ve){Nt(L,L.return,ve)}}}else if(n.tag===6){if(r===null){L=n;try{L.stateNode.nodeValue=h?"":L.memoizedProps}catch(ve){Nt(L,L.return,ve)}}}else if(n.tag===18){if(r===null){L=n;try{var $=L.stateNode;h?sh($,!0):sh(L.stateNode,!1)}catch(ve){Nt(L,L.return,ve)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;r===n&&(r=null),n=n.return}r===n&&(r=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(r=o.retryQueue,r!==null&&(o.retryQueue=null,vo(e,r))));break;case 19:Qn(n,e),qn(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,vo(e,o)));break;case 30:break;case 21:break;default:Qn(n,e),qn(e)}}function qn(e){var n=e.flags;if(n&2){try{for(var r,o=e.return;o!==null;){if(u0(o)){r=o;break}o=o.return}if(r==null)throw Error(y(160));switch(r.tag){case 27:var h=r.stateNode,m=Ac(e);To(e,m,h);break;case 5:var S=r.stateNode;r.flags&32&&(La(S,""),r.flags&=-33);var _=Ac(e);To(e,_,S);break;case 3:case 4:var L=r.stateNode.containerInfo,X=Ac(e);Ec(e,X,L);break;default:throw Error(y(161))}}catch(se){Nt(e,e.return,se)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function p0(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;p0(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Aa(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)h0(e,n.alternate,n),n=n.sibling}function zr(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:$a(4,n,n.return),zr(n);break;case 1:Ji(n,n.return);var r=n.stateNode;typeof r.componentWillUnmount=="function"&&s0(n,n.return,r),zr(n);break;case 27:ps(n.stateNode);case 26:case 5:Ji(n,n.return),zr(n);break;case 22:n.memoizedState===null&&zr(n);break;case 30:zr(n);break;default:zr(n)}e=e.sibling}}function Ea(e,n,r){for(r=r&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,h=e,m=n,S=m.flags;switch(m.tag){case 0:case 11:case 15:Ea(h,m,r),os(4,m);break;case 1:if(Ea(h,m,r),o=m,h=o.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(X){Nt(o,o.return,X)}if(o=m,h=o.updateQueue,h!==null){var _=o.stateNode;try{var L=h.shared.hiddenCallbacks;if(L!==null)for(h.shared.hiddenCallbacks=null,h=0;h<L.length;h++)Q1(L[h],_)}catch(X){Nt(o,o.return,X)}}r&&S&64&&l0(m),us(m,m.return);break;case 27:c0(m);case 26:case 5:Ea(h,m,r),r&&o===null&&S&4&&o0(m),us(m,m.return);break;case 12:Ea(h,m,r);break;case 31:Ea(h,m,r),r&&S&4&&x0(h,m);break;case 13:Ea(h,m,r),r&&S&4&&m0(h,m);break;case 22:m.memoizedState===null&&Ea(h,m,r),us(m,m.return);break;case 30:break;default:Ea(h,m,r)}n=n.sibling}}function wc(e,n){var r=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(r=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==r&&(e!=null&&e.refCount++,r!=null&&ql(r))}function Sc(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ql(e))}function ki(e,n,r,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)A0(e,n,r,o),n=n.sibling}function A0(e,n,r,o){var h=n.flags;switch(n.tag){case 0:case 11:case 15:ki(e,n,r,o),h&2048&&os(9,n);break;case 1:ki(e,n,r,o);break;case 3:ki(e,n,r,o),h&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&ql(e)));break;case 12:if(h&2048){ki(e,n,r,o),e=n.stateNode;try{var m=n.memoizedProps,S=m.id,_=m.onPostCommit;typeof _=="function"&&_(S,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(L){Nt(n,n.return,L)}}else ki(e,n,r,o);break;case 31:ki(e,n,r,o);break;case 13:ki(e,n,r,o);break;case 23:break;case 22:m=n.stateNode,S=n.alternate,n.memoizedState!==null?m._visibility&2?ki(e,n,r,o):cs(e,n):m._visibility&2?ki(e,n,r,o):(m._visibility|=2,xl(e,n,r,o,(n.subtreeFlags&10256)!==0||!1)),h&2048&&wc(S,n);break;case 24:ki(e,n,r,o),h&2048&&Sc(n.alternate,n);break;default:ki(e,n,r,o)}}function xl(e,n,r,o,h){for(h=h&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var m=e,S=n,_=r,L=o,X=S.flags;switch(S.tag){case 0:case 11:case 15:xl(m,S,_,L,h),os(8,S);break;case 23:break;case 22:var se=S.stateNode;S.memoizedState!==null?se._visibility&2?xl(m,S,_,L,h):cs(m,S):(se._visibility|=2,xl(m,S,_,L,h)),h&&X&2048&&wc(S.alternate,S);break;case 24:xl(m,S,_,L,h),h&&X&2048&&Sc(S.alternate,S);break;default:xl(m,S,_,L,h)}n=n.sibling}}function cs(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var r=e,o=n,h=o.flags;switch(o.tag){case 22:cs(r,o),h&2048&&wc(o.alternate,o);break;case 24:cs(r,o),h&2048&&Sc(o.alternate,o);break;default:cs(r,o)}n=n.sibling}}var fs=8192;function ml(e,n,r){if(e.subtreeFlags&fs)for(e=e.child;e!==null;)E0(e,n,r),e=e.sibling}function E0(e,n,r){switch(e.tag){case 26:ml(e,n,r),e.flags&fs&&e.memoizedState!==null&&rg(r,zi,e.memoizedState,e.memoizedProps);break;case 5:ml(e,n,r);break;case 3:case 4:var o=zi;zi=Ho(e.stateNode.containerInfo),ml(e,n,r),zi=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=fs,fs=16777216,ml(e,n,r),fs=o):ml(e,n,r));break;default:ml(e,n,r)}}function C0(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function hs(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];bn=o,S0(o,e)}C0(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)w0(e),e=e.sibling}function w0(e){switch(e.tag){case 0:case 11:case 15:hs(e),e.flags&2048&&$a(9,e,e.return);break;case 3:hs(e);break;case 12:hs(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,No(e)):hs(e);break;default:hs(e)}}function No(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];bn=o,S0(o,e)}C0(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:$a(8,n,n.return),No(n);break;case 22:r=n.stateNode,r._visibility&2&&(r._visibility&=-3,No(n));break;default:No(n)}e=e.sibling}}function S0(e,n){for(;bn!==null;){var r=bn;switch(r.tag){case 0:case 11:case 15:$a(8,r,n);break;case 23:case 22:if(r.memoizedState!==null&&r.memoizedState.cachePool!==null){var o=r.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:ql(r.memoizedState.cache)}if(o=r.child,o!==null)o.return=r,bn=o;else e:for(r=e;bn!==null;){o=bn;var h=o.sibling,m=o.return;if(d0(o),o===r){bn=null;break e}if(h!==null){h.return=m,bn=h;break e}bn=m}}}var E2={getCacheForType:function(e){var n=In(fn),r=n.data.get(e);return r===void 0&&(r=e(),n.data.set(e,r)),r},cacheSignal:function(){return In(fn).controller.signal}},C2=typeof WeakMap=="function"?WeakMap:Map,Et=0,zt=null,tt=null,st=0,vt=0,oi=null,er=!1,yl=!1,bc=!1,Ca=0,en=0,tr=0,kr=0,Tc=0,ui=0,pl=0,ds=null,Wn=null,vc=!1,Mo=0,b0=0,Io=1/0,Oo=null,nr=null,Cn=0,ir=null,Al=null,wa=0,Nc=0,Mc=null,T0=null,gs=0,Ic=null;function ci(){return(Et&2)!==0&&st!==0?st&-st:J.T!==null?Lc():Dn()}function v0(){if(ui===0)if((st&536870912)===0||ut){var e=rt;rt<<=1,(rt&3932160)===0&&(rt=262144),ui=e}else ui=536870912;return e=li.current,e!==null&&(e.flags|=32),ui}function Kn(e,n,r){(e===zt&&(vt===2||vt===9)||e.cancelPendingCommit!==null)&&(El(e,0),ar(e,st,ui,!1)),Gi(e,r),((Et&2)===0||e!==zt)&&(e===zt&&((Et&2)===0&&(kr|=r),en===4&&ar(e,st,ui,!1)),$i(e))}function N0(e,n,r){if((Et&6)!==0)throw Error(y(327));var o=!r&&(n&127)===0&&(n&e.expiredLanes)===0||vn(e,n),h=o?b2(e,n):_c(e,n,!0),m=o;do{if(h===0){yl&&!o&&ar(e,n,0,!1);break}else{if(r=e.current.alternate,m&&!w2(r)){h=_c(e,n,!1),m=!1;continue}if(h===2){if(m=n,e.errorRecoveryDisabledLanes&m)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){n=S;e:{var _=e;h=ds;var L=_.current.memoizedState.isDehydrated;if(L&&(El(_,S).flags|=256),S=_c(_,S,!1),S!==2){if(bc&&!L){_.errorRecoveryDisabledLanes|=m,kr|=m,h=4;break e}m=Wn,Wn=h,m!==null&&(Wn===null?Wn=m:Wn.push.apply(Wn,m))}h=S}if(m=!1,h!==2)continue}}if(h===1){El(e,0),ar(e,n,0,!0);break}e:{switch(o=e,m=h,m){case 0:case 1:throw Error(y(345));case 4:if((n&4194048)!==n)break;case 6:ar(o,n,ui,!er);break e;case 2:Wn=null;break;case 3:case 5:break;default:throw Error(y(329))}if((n&62914560)===n&&(h=Mo+300-qt(),10<h)){if(ar(o,n,ui,!er),mr(o,0,!0)!==0)break e;wa=n,o.timeoutHandle=ah(M0.bind(null,o,r,Wn,Oo,vc,n,ui,kr,pl,er,m,"Throttled",-0,0),h);break e}M0(o,r,Wn,Oo,vc,n,ui,kr,pl,er,m,null,-0,0)}}break}while(!0);$i(e)}function M0(e,n,r,o,h,m,S,_,L,X,se,ce,Q,$){if(e.timeoutHandle=-1,ce=n.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Gn},E0(n,m,ce);var ve=(m&62914560)===m?Mo-qt():(m&4194048)===m?b0-qt():0;if(ve=lg(ce,ve),ve!==null){wa=m,e.cancelPendingCommit=ve(U0.bind(null,e,n,m,r,o,h,S,_,L,se,ce,null,Q,$)),ar(e,m,S,!X);return}}U0(e,n,m,r,o,h,S,_,L)}function w2(e){for(var n=e;;){var r=n.tag;if((r===0||r===11||r===15)&&n.flags&16384&&(r=n.updateQueue,r!==null&&(r=r.stores,r!==null)))for(var o=0;o<r.length;o++){var h=r[o],m=h.getSnapshot;h=h.value;try{if(!u(m(),h))return!1}catch{return!1}}if(r=n.child,n.subtreeFlags&16384&&r!==null)r.return=n,n=r;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ar(e,n,r,o){n&=~Tc,n&=~kr,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var h=n;0<h;){var m=31-Ge(h),S=1<<m;o[m]=-1,h&=~S}r!==0&&Ls(e,r,n)}function _o(){return(Et&6)===0?(xs(0),!1):!0}function Oc(){if(tt!==null){if(vt===0)var e=tt.return;else e=tt,fa=Ir=null,Xu(e),cl=null,Kl=0,e=tt;for(;e!==null;)r0(e.alternate,e),e=e.return;tt=null}}function El(e,n){var r=e.timeoutHandle;r!==-1&&(e.timeoutHandle=-1,P2(r)),r=e.cancelPendingCommit,r!==null&&(e.cancelPendingCommit=null,r()),wa=0,Oc(),zt=e,tt=r=ua(e.current,null),st=n,vt=0,oi=null,er=!1,yl=vn(e,n),bc=!1,pl=ui=Tc=kr=tr=en=0,Wn=ds=null,vc=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var h=31-Ge(o),m=1<<h;n|=e[h],o&=~m}return Ca=n,Ks(),r}function I0(e,n){Ye=null,J.H=rs,n===ul||n===ro?(n=G1(),vt=3):n===Bu?(n=G1(),vt=4):vt=n===oc?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,oi=n,tt===null&&(en=1,Eo(e,Ci(n,e.current)))}function O0(){var e=li.current;return e===null?!0:(st&4194048)===st?Ti===null:(st&62914560)===st||(st&536870912)!==0?e===Ti:!1}function _0(){var e=J.H;return J.H=rs,e===null?rs:e}function R0(){var e=J.A;return J.A=E2,e}function Ro(){en=4,er||(st&4194048)!==st&&li.current!==null||(yl=!0),(tr&134217727)===0&&(kr&134217727)===0||zt===null||ar(zt,st,ui,!1)}function _c(e,n,r){var o=Et;Et|=2;var h=_0(),m=R0();(zt!==e||st!==n)&&(Oo=null,El(e,n)),n=!1;var S=en;e:do try{if(vt!==0&&tt!==null){var _=tt,L=oi;switch(vt){case 8:Oc(),S=6;break e;case 3:case 2:case 9:case 6:li.current===null&&(n=!0);var X=vt;if(vt=0,oi=null,Cl(e,_,L,X),r&&yl){S=0;break e}break;default:X=vt,vt=0,oi=null,Cl(e,_,L,X)}}S2(),S=en;break}catch(se){I0(e,se)}while(!0);return n&&e.shellSuspendCounter++,fa=Ir=null,Et=o,J.H=h,J.A=m,tt===null&&(zt=null,st=0,Ks()),S}function S2(){for(;tt!==null;)D0(tt)}function b2(e,n){var r=Et;Et|=2;var o=_0(),h=R0();zt!==e||st!==n?(Oo=null,Io=qt()+500,El(e,n)):yl=vn(e,n);e:do try{if(vt!==0&&tt!==null){n=tt;var m=oi;t:switch(vt){case 1:vt=0,oi=null,Cl(e,n,m,1);break;case 2:case 9:if(P1(m)){vt=0,oi=null,B0(n);break}n=function(){vt!==2&&vt!==9||zt!==e||(vt=7),$i(e)},m.then(n,n);break e;case 3:vt=7;break e;case 4:vt=5;break e;case 7:P1(m)?(vt=0,oi=null,B0(n)):(vt=0,oi=null,Cl(e,n,m,7));break;case 5:var S=null;switch(tt.tag){case 26:S=tt.memoizedState;case 5:case 27:var _=tt;if(S?Ah(S):_.stateNode.complete){vt=0,oi=null;var L=_.sibling;if(L!==null)tt=L;else{var X=_.return;X!==null?(tt=X,Do(X)):tt=null}break t}}vt=0,oi=null,Cl(e,n,m,5);break;case 6:vt=0,oi=null,Cl(e,n,m,6);break;case 8:Oc(),en=6;break e;default:throw Error(y(462))}}T2();break}catch(se){I0(e,se)}while(!0);return fa=Ir=null,J.H=o,J.A=h,Et=r,tt!==null?0:(zt=null,st=0,Ks(),en)}function T2(){for(;tt!==null&&!Pr();)D0(tt)}function D0(e){var n=i0(e.alternate,e,Ca);e.memoizedProps=e.pendingProps,n===null?Do(e):tt=n}function B0(e){var n=e,r=n.alternate;switch(n.tag){case 15:case 0:n=Kf(r,n,n.pendingProps,n.type,void 0,st);break;case 11:n=Kf(r,n,n.pendingProps,n.type.render,n.ref,st);break;case 5:Xu(n);default:r0(r,n),n=tt=_1(n,Ca),n=i0(r,n,Ca)}e.memoizedProps=e.pendingProps,n===null?Do(e):tt=n}function Cl(e,n,r,o){fa=Ir=null,Xu(n),cl=null,Kl=0;var h=n.return;try{if(d2(e,h,n,r,st)){en=1,Eo(e,Ci(r,e.current)),tt=null;return}}catch(m){if(h!==null)throw tt=h,m;en=1,Eo(e,Ci(r,e.current)),tt=null;return}n.flags&32768?(ut||o===1?e=!0:yl||(st&536870912)!==0?e=!1:(er=e=!0,(o===2||o===9||o===3||o===6)&&(o=li.current,o!==null&&o.tag===13&&(o.flags|=16384))),L0(n,e)):Do(n)}function Do(e){var n=e;do{if((n.flags&32768)!==0){L0(n,er);return}e=n.return;var r=m2(n.alternate,n,Ca);if(r!==null){tt=r;return}if(n=n.sibling,n!==null){tt=n;return}tt=n=e}while(n!==null);en===0&&(en=5)}function L0(e,n){do{var r=y2(e.alternate,e);if(r!==null){r.flags&=32767,tt=r;return}if(r=e.return,r!==null&&(r.flags|=32768,r.subtreeFlags=0,r.deletions=null),!n&&(e=e.sibling,e!==null)){tt=e;return}tt=e=r}while(e!==null);en=6,tt=null}function U0(e,n,r,o,h,m,S,_,L){e.cancelPendingCommit=null;do Bo();while(Cn!==0);if((Et&6)!==0)throw Error(y(327));if(n!==null){if(n===e.current)throw Error(y(177));if(m=n.lanes|n.childLanes,m|=Au,mi(e,r,m,S,_,L),e===zt&&(tt=zt=null,st=0),Al=n,ir=e,wa=r,Nc=m,Mc=h,T0=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,I2(Jn,function(){return j0(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=J.T,J.T=null,h=oe.p,oe.p=2,S=Et,Et|=4;try{p2(e,n,r)}finally{Et=S,oe.p=h,J.T=o}}Cn=1,z0(),k0(),F0()}}function z0(){if(Cn===1){Cn=0;var e=ir,n=Al,r=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||r){r=J.T,J.T=null;var o=oe.p;oe.p=2;var h=Et;Et|=4;try{y0(n,e);var m=Yc,S=v(e.containerInfo),_=m.focusedElem,L=m.selectionRange;if(S!==_&&_&&_.ownerDocument&&w(_.ownerDocument.documentElement,_)){if(L!==null&&I(_)){var X=L.start,se=L.end;if(se===void 0&&(se=X),"selectionStart"in _)_.selectionStart=X,_.selectionEnd=Math.min(se,_.value.length);else{var ce=_.ownerDocument||document,Q=ce&&ce.defaultView||window;if(Q.getSelection){var $=Q.getSelection(),ve=_.textContent.length,ze=Math.min(L.start,ve),Rt=L.end===void 0?ze:Math.min(L.end,ve);!$.extend&&ze>Rt&&(S=Rt,Rt=ze,ze=S);var j=p(_,ze),k=p(_,Rt);if(j&&k&&($.rangeCount!==1||$.anchorNode!==j.node||$.anchorOffset!==j.offset||$.focusNode!==k.node||$.focusOffset!==k.offset)){var V=ce.createRange();V.setStart(j.node,j.offset),$.removeAllRanges(),ze>Rt?($.addRange(V),$.extend(k.node,k.offset)):(V.setEnd(k.node,k.offset),$.addRange(V))}}}}for(ce=[],$=_;$=$.parentNode;)$.nodeType===1&&ce.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<ce.length;_++){var ue=ce[_];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}Xo=!!Pc,Yc=Pc=null}finally{Et=h,oe.p=o,J.T=r}}e.current=n,Cn=2}}function k0(){if(Cn===2){Cn=0;var e=ir,n=Al,r=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||r){r=J.T,J.T=null;var o=oe.p;oe.p=2;var h=Et;Et|=4;try{h0(e,n.alternate,n)}finally{Et=h,oe.p=o,J.T=r}}Cn=3}}function F0(){if(Cn===4||Cn===3){Cn=0,Bs();var e=ir,n=Al,r=wa,o=T0;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Cn=5:(Cn=0,Al=ir=null,H0(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(nr=null),Oi(r),n=n.stateNode,ye&&typeof ye.onCommitFiberRoot=="function")try{ye.onCommitFiberRoot(kt,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=J.T,h=oe.p,oe.p=2,J.T=null;try{for(var m=e.onRecoverableError,S=0;S<o.length;S++){var _=o[S];m(_.value,{componentStack:_.stack})}}finally{J.T=n,oe.p=h}}(wa&3)!==0&&Bo(),$i(e),h=e.pendingLanes,(r&261930)!==0&&(h&42)!==0?e===Ic?gs++:(gs=0,Ic=e):gs=0,xs(0)}}function H0(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,ql(n)))}function Bo(){return z0(),k0(),F0(),j0()}function j0(){if(Cn!==5)return!1;var e=ir,n=Nc;Nc=0;var r=Oi(wa),o=J.T,h=oe.p;try{oe.p=32>r?32:r,J.T=null,r=Mc,Mc=null;var m=ir,S=wa;if(Cn=0,Al=ir=null,wa=0,(Et&6)!==0)throw Error(y(331));var _=Et;if(Et|=4,w0(m.current),A0(m,m.current,S,r),Et=_,xs(0,!1),ye&&typeof ye.onPostCommitFiberRoot=="function")try{ye.onPostCommitFiberRoot(kt,m)}catch{}return!0}finally{oe.p=h,J.T=o,H0(e,n)}}function P0(e,n,r){n=Ci(r,n),n=sc(e.stateNode,n,2),e=Wa(e,n,2),e!==null&&(Gi(e,2),$i(e))}function Nt(e,n,r){if(e.tag===3)P0(e,e,r);else for(;n!==null;){if(n.tag===3){P0(n,e,r);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(nr===null||!nr.has(o))){e=Ci(r,e),r=Yf(2),o=Wa(n,r,2),o!==null&&(Gf(r,o,n,e),Gi(o,2),$i(o));break}}n=n.return}}function Rc(e,n,r){var o=e.pingCache;if(o===null){o=e.pingCache=new C2;var h=new Set;o.set(n,h)}else h=o.get(n),h===void 0&&(h=new Set,o.set(n,h));h.has(r)||(bc=!0,h.add(r),e=v2.bind(null,e,n,r),n.then(e,e))}function v2(e,n,r){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&r,e.warmLanes&=~r,zt===e&&(st&r)===r&&(en===4||en===3&&(st&62914560)===st&&300>qt()-Mo?(Et&2)===0&&El(e,0):Tc|=r,pl===st&&(pl=0)),$i(e)}function Y0(e,n){n===0&&(n=yn()),e=vr(e,n),e!==null&&(Gi(e,n),$i(e))}function N2(e){var n=e.memoizedState,r=0;n!==null&&(r=n.retryLane),Y0(e,r)}function M2(e,n){var r=0;switch(e.tag){case 31:case 13:var o=e.stateNode,h=e.memoizedState;h!==null&&(r=h.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(y(314))}o!==null&&o.delete(n),Y0(e,r)}function I2(e,n){return Ia(e,n)}var Lo=null,wl=null,Dc=!1,Uo=!1,Bc=!1,rr=0;function $i(e){e!==wl&&e.next===null&&(wl===null?Lo=wl=e:wl=wl.next=e),Uo=!0,Dc||(Dc=!0,_2())}function xs(e,n){if(!Bc&&Uo){Bc=!0;do for(var r=!1,o=Lo;o!==null;){if(e!==0){var h=o.pendingLanes;if(h===0)var m=0;else{var S=o.suspendedLanes,_=o.pingedLanes;m=(1<<31-Ge(42|e)+1)-1,m&=h&~(S&~_),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(r=!0,Z0(o,m))}else m=st,m=mr(o,o===zt?m:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(m&3)===0||vn(o,m)||(r=!0,Z0(o,m));o=o.next}while(r);Bc=!1}}function O2(){G0()}function G0(){Uo=Dc=!1;var e=0;rr!==0&&j2()&&(e=rr);for(var n=qt(),r=null,o=Lo;o!==null;){var h=o.next,m=V0(o,n);m===0?(o.next=null,r===null?Lo=h:r.next=h,h===null&&(wl=r)):(r=o,(e!==0||(m&3)!==0)&&(Uo=!0)),o=h}Cn!==0&&Cn!==5||xs(e),rr!==0&&(rr=0)}function V0(e,n){for(var r=e.suspendedLanes,o=e.pingedLanes,h=e.expirationTimes,m=e.pendingLanes&-62914561;0<m;){var S=31-Ge(m),_=1<<S,L=h[S];L===-1?((_&r)===0||(_&o)!==0)&&(h[S]=Ul(_,n)):L<=n&&(e.expiredLanes|=_),m&=~_}if(n=zt,r=st,r=mr(e,e===n?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,r===0||e===n&&(vt===2||vt===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Te(o),e.callbackNode=null,e.callbackPriority=0;if((r&3)===0||vn(e,r)){if(n=r&-r,n===e.callbackPriority)return n;switch(o!==null&&Te(o),Oi(r)){case 2:case 8:r=Dl;break;case 32:r=Jn;break;case 268435456:r=Bl;break;default:r=Jn}return o=X0.bind(null,e),r=Ia(r,o),e.callbackPriority=n,e.callbackNode=r,n}return o!==null&&o!==null&&Te(o),e.callbackPriority=2,e.callbackNode=null,2}function X0(e,n){if(Cn!==0&&Cn!==5)return e.callbackNode=null,e.callbackPriority=0,null;var r=e.callbackNode;if(Bo()&&e.callbackNode!==r)return null;var o=st;return o=mr(e,e===zt?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(N0(e,o,n),V0(e,qt()),e.callbackNode!=null&&e.callbackNode===r?X0.bind(null,e):null)}function Z0(e,n){if(Bo())return null;N0(e,n,!0)}function _2(){Y2(function(){(Et&6)!==0?Ia(Pn,O2):G0()})}function Lc(){if(rr===0){var e=sl;e===0&&(e=xr,xr<<=1,(xr&261888)===0&&(xr=256)),rr=e}return rr}function Q0(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ua(""+e)}function q0(e,n){var r=n.ownerDocument.createElement("input");return r.name=n.name,r.value=n.value,e.id&&r.setAttribute("form",e.id),n.parentNode.insertBefore(r,n),e=new FormData(e),r.parentNode.removeChild(r),e}function R2(e,n,r,o,h){if(n==="submit"&&r&&r.stateNode===h){var m=Q0((h[Tt]||null).action),S=o.submitter;S&&(n=(n=S[Tt]||null)?Q0(n.formAction):S.getAttribute("formAction"),n!==null&&(m=n,S=null));var _=new pn("action","action",null,o,h);e.push({event:_,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(rr!==0){var L=S?q0(h,S):new FormData(h);tc(r,{pending:!0,data:L,method:h.method,action:m},null,L)}}else typeof m=="function"&&(_.preventDefault(),L=S?q0(h,S):new FormData(h),tc(r,{pending:!0,data:L,method:h.method,action:m},m,L))},currentTarget:h}]})}}for(var Uc=0;Uc<Xl.length;Uc++){var zc=Xl[Uc],D2=zc.toLowerCase(),B2=zc[0].toUpperCase()+zc.slice(1);Ui(D2,"on"+B2)}Ui(Xn,"onAnimationEnd"),Ui(Nn,"onAnimationIteration"),Ui(St,"onAnimationStart"),Ui("dblclick","onDoubleClick"),Ui("focusin","onFocus"),Ui("focusout","onBlur"),Ui(En,"onTransitionRun"),Ui(kn,"onTransitionStart"),Ui(Ya,"onTransitionCancel"),Ui(oa,"onTransitionEnd"),ei("onMouseEnter",["mouseout","mouseover"]),ei("onMouseLeave",["mouseout","mouseover"]),ei("onPointerEnter",["pointerout","pointerover"]),ei("onPointerLeave",["pointerout","pointerover"]),Ct("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ct("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ct("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ct("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ct("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ct("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ms="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),L2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ms));function W0(e,n){n=(n&4)!==0;for(var r=0;r<e.length;r++){var o=e[r],h=o.event;o=o.listeners;e:{var m=void 0;if(n)for(var S=o.length-1;0<=S;S--){var _=o[S],L=_.instance,X=_.currentTarget;if(_=_.listener,L!==m&&h.isPropagationStopped())break e;m=_,h.currentTarget=X;try{m(h)}catch(se){Ws(se)}h.currentTarget=null,m=L}else for(S=0;S<o.length;S++){if(_=o[S],L=_.instance,X=_.currentTarget,_=_.listener,L!==m&&h.isPropagationStopped())break e;m=_,h.currentTarget=X;try{m(h)}catch(se){Ws(se)}h.currentTarget=null,m=L}}}}function nt(e,n){var r=n[Oa];r===void 0&&(r=n[Oa]=new Set);var o=e+"__bubble";r.has(o)||(K0(n,e,2,!1),r.add(o))}function kc(e,n,r){var o=0;n&&(o|=4),K0(r,e,o,n)}var zo="_reactListening"+Math.random().toString(36).slice(2);function Fc(e){if(!e[zo]){e[zo]=!0,he.forEach(function(r){r!=="selectionchange"&&(L2.has(r)||kc(r,!1,e),kc(r,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[zo]||(n[zo]=!0,kc("selectionchange",!1,n))}}function K0(e,n,r,o){switch(vh(n)){case 2:var h=ug;break;case 8:h=cg;break;default:h=e1}r=h.bind(null,n,r,e),h=void 0,!Fl||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(h=!0),o?h!==void 0?e.addEventListener(n,r,{capture:!0,passive:h}):e.addEventListener(n,r,!0):h!==void 0?e.addEventListener(n,r,{passive:h}):e.addEventListener(n,r,!1)}function Hc(e,n,r,o,h){var m=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var S=o.tag;if(S===3||S===4){var _=o.stateNode.containerInfo;if(_===h)break;if(S===4)for(S=o.return;S!==null;){var L=S.tag;if((L===3||L===4)&&S.stateNode.containerInfo===h)return;S=S.return}for(;_!==null;){if(S=Wt(_),S===null)return;if(L=S.tag,L===5||L===6||L===26||L===27){o=m=S;continue e}_=_.parentNode}}o=o.return}Fs(function(){var X=m,se=kl(r),ce=[];e:{var Q=qs.get(e);if(Q!==void 0){var $=pn,ve=e;switch(e){case"keypress":if(Xi(r)===0)break e;case"keydown":case"keyup":$=Jr;break;case"focusin":ve="focus",$=Pl;break;case"focusout":ve="blur",$=Pl;break;case"beforeblur":case"afterblur":$=Pl;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=At;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=Wr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=mu;break;case Xn:case Nn:case St:$=Ve;break;case oa:$=aa;break;case"scroll":case"scrollend":$=Hs;break;case"wheel":$=yu;break;case"copy":case"cut":case"paste":$=Kr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=wt;break;case"toggle":case"beforetoggle":$=Gl}var ze=(n&4)!==0,Rt=!ze&&(e==="scroll"||e==="scrollend"),j=ze?Q!==null?Q+"Capture":null:Q;ze=[];for(var k=X,V;k!==null;){var ue=k;if(V=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||V===null||j===null||(ue=Fe(k,j),ue!=null&&ze.push(ys(k,ue,V))),Rt)break;k=k.return}0<ze.length&&(Q=new $(Q,ve,null,r,se),ce.push({event:Q,listeners:ze}))}}if((n&7)===0){e:{if(Q=e==="mouseover"||e==="pointerover",$=e==="mouseout"||e==="pointerout",Q&&r!==pr&&(ve=r.relatedTarget||r.fromElement)&&(Wt(ve)||ve[$n]))break e;if(($||Q)&&(Q=se.window===se?se:(Q=se.ownerDocument)?Q.defaultView||Q.parentWindow:window,$?(ve=r.relatedTarget||r.toElement,$=X,ve=ve?Wt(ve):null,ve!==null&&(Rt=E(ve),ze=ve.tag,ve!==Rt||ze!==5&&ze!==27&&ze!==6)&&(ve=null)):($=null,ve=X),$!==ve)){if(ze=At,ue="onMouseLeave",j="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(ze=wt,ue="onPointerLeave",j="onPointerEnter",k="pointer"),Rt=$==null?Q:_a($),V=ve==null?Q:_a(ve),Q=new ze(ue,k+"leave",$,r,se),Q.target=Rt,Q.relatedTarget=V,ue=null,Wt(se)===X&&(ze=new ze(j,k+"enter",ve,r,se),ze.target=V,ze.relatedTarget=Rt,ue=ze),Rt=ue,$&&ve)t:{for(ze=U2,j=$,k=ve,V=0,ue=j;ue;ue=ze(ue))V++;ue=0;for(var De=k;De;De=ze(De))ue++;for(;0<V-ue;)j=ze(j),V--;for(;0<ue-V;)k=ze(k),ue--;for(;V--;){if(j===k||k!==null&&j===k.alternate){ze=j;break t}j=ze(j),k=ze(k)}ze=null}else ze=null;$!==null&&J0(ce,Q,$,ze,!1),ve!==null&&Rt!==null&&J0(ce,Rt,ve,ze,!0)}}e:{if(Q=X?_a(X):window,$=Q.nodeName&&Q.nodeName.toLowerCase(),$==="select"||$==="input"&&Q.type==="file")var mt=ai;else if(Vl(Q))if(Qs)mt=l;else{mt=i;var Ie=t}else $=Q.nodeName,!$||$.toLowerCase()!=="input"||Q.type!=="checkbox"&&Q.type!=="radio"?X&&Bt(X.elementType)&&(mt=ai):mt=a;if(mt&&(mt=mt(e,X))){ii(ce,mt,r,se);break e}Ie&&Ie(e,Q,X),e==="focusout"&&X&&Q.type==="number"&&X.memoizedProps.value!=null&&D(Q,"number",Q.value)}switch(Ie=X?_a(X):window,e){case"focusin":(Vl(Ie)||Ie.contentEditable==="true")&&(U=Ie,z=X,P=null);break;case"focusout":P=z=U=null;break;case"mousedown":W=!0;break;case"contextmenu":case"mouseup":case"dragend":W=!1,me(ce,r,se);break;case"selectionchange":if(B)break;case"keydown":case"keyup":me(ce,r,se)}var Xe;if(Cr)e:{switch(e){case"compositionstart":var ot="onCompositionStart";break e;case"compositionend":ot="onCompositionEnd";break e;case"compositionupdate":ot="onCompositionUpdate";break e}ot=void 0}else Pa?Zs(e,r)&&(ot="onCompositionEnd"):e==="keydown"&&r.keyCode===229&&(ot="onCompositionStart");ot&&(Xs&&r.locale!=="ko"&&(Pa||ot!=="onCompositionStart"?ot==="onCompositionEnd"&&Pa&&(Xe=za()):(Bi=se,Li="value"in Bi?Bi.value:Bi.textContent,Pa=!0)),Ie=ko(X,ot),0<Ie.length&&(ot=new Ys(ot,e,null,r,se),ce.push({event:ot,listeners:Ie}),Xe?ot.data=Xe:(Xe=ja(r),Xe!==null&&(ot.data=Xe)))),(Xe=Vs?qi(e,r):el(e,r))&&(ot=ko(X,"onBeforeInput"),0<ot.length&&(Ie=new Ys("onBeforeInput","beforeinput",null,r,se),ce.push({event:Ie,listeners:ot}),Ie.data=Xe)),R2(ce,e,X,r,se)}W0(ce,n)})}function ys(e,n,r){return{instance:e,listener:n,currentTarget:r}}function ko(e,n){for(var r=n+"Capture",o=[];e!==null;){var h=e,m=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||m===null||(h=Fe(e,r),h!=null&&o.unshift(ys(e,h,m)),h=Fe(e,n),h!=null&&o.push(ys(e,h,m))),e.tag===3)return o;e=e.return}return[]}function U2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function J0(e,n,r,o,h){for(var m=n._reactName,S=[];r!==null&&r!==o;){var _=r,L=_.alternate,X=_.stateNode;if(_=_.tag,L!==null&&L===o)break;_!==5&&_!==26&&_!==27||X===null||(L=X,h?(X=Fe(r,m),X!=null&&S.unshift(ys(r,X,L))):h||(X=Fe(r,m),X!=null&&S.push(ys(r,X,L)))),r=r.return}S.length!==0&&e.push({event:n,listeners:S})}var z2=/\r\n?/g,k2=/\u0000|\uFFFD/g;function $0(e){return(typeof e=="string"?e:""+e).replace(z2,`
|
||
`).replace(k2,"")}function eh(e,n){return n=$0(n),$0(e)===n}function _t(e,n,r,o,h,m){switch(r){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||La(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&La(e,""+o);break;case"className":Da(e,"class",o);break;case"tabIndex":Da(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Da(e,r,o);break;case"style":_e(e,o,m);break;case"data":if(n!=="object"){Da(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||r!=="href")){e.removeAttribute(r);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=Ua(""+o),e.setAttribute(r,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(r,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof m=="function"&&(r==="formAction"?(n!=="input"&&_t(e,n,"name",h.name,h,null),_t(e,n,"formEncType",h.formEncType,h,null),_t(e,n,"formMethod",h.formMethod,h,null),_t(e,n,"formTarget",h.formTarget,h,null)):(_t(e,n,"encType",h.encType,h,null),_t(e,n,"method",h.method,h,null),_t(e,n,"target",h.target,h,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(r);break}o=Ua(""+o),e.setAttribute(r,o);break;case"onClick":o!=null&&(e.onclick=Gn);break;case"onScroll":o!=null&&nt("scroll",e);break;case"onScrollEnd":o!=null&&nt("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(y(61));if(r=o.__html,r!=null){if(h.children!=null)throw Error(y(60));e.innerHTML=r}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}r=Ua(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",r);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""+o):e.removeAttribute(r);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,""):e.removeAttribute(r);break;case"capture":case"download":o===!0?e.setAttribute(r,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(r,o):e.removeAttribute(r);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(r,o):e.removeAttribute(r);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(r):e.setAttribute(r,o);break;case"popover":nt("beforetoggle",e),nt("toggle",e),Ra(e,"popover",o);break;case"xlinkActuate":ti(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":ti(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":ti(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":ti(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":ti(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":ti(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":ti(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":ti(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":ti(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Ra(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(r=ks.get(r)||r,Ra(e,r,o))}}function jc(e,n,r,o,h,m){switch(r){case"style":_e(e,o,m);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(y(61));if(r=o.__html,r!=null){if(h.children!=null)throw Error(y(60));e.innerHTML=r}}break;case"children":typeof o=="string"?La(e,o):(typeof o=="number"||typeof o=="bigint")&&La(e,""+o);break;case"onScroll":o!=null&&nt("scroll",e);break;case"onScrollEnd":o!=null&&nt("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Gn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!zs.hasOwnProperty(r))e:{if(r[0]==="o"&&r[1]==="n"&&(h=r.endsWith("Capture"),n=r.slice(2,h?r.length-7:void 0),m=e[Tt]||null,m=m!=null?m[r]:null,typeof m=="function"&&e.removeEventListener(n,m,h),typeof o=="function")){typeof m!="function"&&m!==null&&(r in e?e[r]=null:e.hasAttribute(r)&&e.removeAttribute(r)),e.addEventListener(n,o,h);break e}r in e?e[r]=o:o===!0?e.setAttribute(r,""):Ra(e,r,o)}}}function _n(e,n,r){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":nt("error",e),nt("load",e);var o=!1,h=!1,m;for(m in r)if(r.hasOwnProperty(m)){var S=r[m];if(S!=null)switch(m){case"src":o=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(y(137,n));default:_t(e,n,m,S,r,null)}}h&&_t(e,n,"srcSet",r.srcSet,r,null),o&&_t(e,n,"src",r.src,r,null);return;case"input":nt("invalid",e);var _=m=S=h=null,L=null,X=null;for(o in r)if(r.hasOwnProperty(o)){var se=r[o];if(se!=null)switch(o){case"name":h=se;break;case"type":S=se;break;case"checked":L=se;break;case"defaultChecked":X=se;break;case"value":m=se;break;case"defaultValue":_=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(y(137,n));break;default:_t(e,n,o,se,r,null)}}Y(e,m,_,L,X,S,h,!1);return;case"select":nt("invalid",e),o=S=m=null;for(h in r)if(r.hasOwnProperty(h)&&(_=r[h],_!=null))switch(h){case"value":m=_;break;case"defaultValue":S=_;break;case"multiple":o=_;default:_t(e,n,h,_,r,null)}n=m,r=S,e.multiple=!!o,n!=null?Me(e,!!o,n,!1):r!=null&&Me(e,!!o,r,!0);return;case"textarea":nt("invalid",e),m=h=o=null;for(S in r)if(r.hasOwnProperty(S)&&(_=r[S],_!=null))switch(S){case"value":o=_;break;case"defaultValue":h=_;break;case"children":m=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(y(91));break;default:_t(e,n,S,_,r,null)}Un(e,o,h,m);return;case"option":for(L in r)if(r.hasOwnProperty(L)&&(o=r[L],o!=null))switch(L){case"selected":e.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:_t(e,n,L,o,r,null)}return;case"dialog":nt("beforetoggle",e),nt("toggle",e),nt("cancel",e),nt("close",e);break;case"iframe":case"object":nt("load",e);break;case"video":case"audio":for(o=0;o<ms.length;o++)nt(ms[o],e);break;case"image":nt("error",e),nt("load",e);break;case"details":nt("toggle",e);break;case"embed":case"source":case"link":nt("error",e),nt("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(X in r)if(r.hasOwnProperty(X)&&(o=r[X],o!=null))switch(X){case"children":case"dangerouslySetInnerHTML":throw Error(y(137,n));default:_t(e,n,X,o,r,null)}return;default:if(Bt(n)){for(se in r)r.hasOwnProperty(se)&&(o=r[se],o!==void 0&&jc(e,n,se,o,r,void 0));return}}for(_ in r)r.hasOwnProperty(_)&&(o=r[_],o!=null&&_t(e,n,_,o,r,null))}function F2(e,n,r,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,m=null,S=null,_=null,L=null,X=null,se=null;for($ in r){var ce=r[$];if(r.hasOwnProperty($)&&ce!=null)switch($){case"checked":break;case"value":break;case"defaultValue":L=ce;default:o.hasOwnProperty($)||_t(e,n,$,null,o,ce)}}for(var Q in o){var $=o[Q];if(ce=r[Q],o.hasOwnProperty(Q)&&($!=null||ce!=null))switch(Q){case"type":m=$;break;case"name":h=$;break;case"checked":X=$;break;case"defaultChecked":se=$;break;case"value":S=$;break;case"defaultValue":_=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(y(137,n));break;default:$!==ce&&_t(e,n,Q,$,o,ce)}}un(e,S,_,L,X,se,m,h);return;case"select":$=S=_=Q=null;for(m in r)if(L=r[m],r.hasOwnProperty(m)&&L!=null)switch(m){case"value":break;case"multiple":$=L;default:o.hasOwnProperty(m)||_t(e,n,m,null,o,L)}for(h in o)if(m=o[h],L=r[h],o.hasOwnProperty(h)&&(m!=null||L!=null))switch(h){case"value":Q=m;break;case"defaultValue":_=m;break;case"multiple":S=m;default:m!==L&&_t(e,n,h,m,o,L)}n=_,r=S,o=$,Q!=null?Me(e,!!r,Q,!1):!!o!=!!r&&(n!=null?Me(e,!!r,n,!0):Me(e,!!r,r?[]:"",!1));return;case"textarea":$=Q=null;for(_ in r)if(h=r[_],r.hasOwnProperty(_)&&h!=null&&!o.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:_t(e,n,_,null,o,h)}for(S in o)if(h=o[S],m=r[S],o.hasOwnProperty(S)&&(h!=null||m!=null))switch(S){case"value":Q=h;break;case"defaultValue":$=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(y(91));break;default:h!==m&&_t(e,n,S,h,o,m)}rn(e,Q,$);return;case"option":for(var ve in r)if(Q=r[ve],r.hasOwnProperty(ve)&&Q!=null&&!o.hasOwnProperty(ve))switch(ve){case"selected":e.selected=!1;break;default:_t(e,n,ve,null,o,Q)}for(L in o)if(Q=o[L],$=r[L],o.hasOwnProperty(L)&&Q!==$&&(Q!=null||$!=null))switch(L){case"selected":e.selected=Q&&typeof Q!="function"&&typeof Q!="symbol";break;default:_t(e,n,L,Q,o,$)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in r)Q=r[ze],r.hasOwnProperty(ze)&&Q!=null&&!o.hasOwnProperty(ze)&&_t(e,n,ze,null,o,Q);for(X in o)if(Q=o[X],$=r[X],o.hasOwnProperty(X)&&Q!==$&&(Q!=null||$!=null))switch(X){case"children":case"dangerouslySetInnerHTML":if(Q!=null)throw Error(y(137,n));break;default:_t(e,n,X,Q,o,$)}return;default:if(Bt(n)){for(var Rt in r)Q=r[Rt],r.hasOwnProperty(Rt)&&Q!==void 0&&!o.hasOwnProperty(Rt)&&jc(e,n,Rt,void 0,o,Q);for(se in o)Q=o[se],$=r[se],!o.hasOwnProperty(se)||Q===$||Q===void 0&&$===void 0||jc(e,n,se,Q,o,$);return}}for(var j in r)Q=r[j],r.hasOwnProperty(j)&&Q!=null&&!o.hasOwnProperty(j)&&_t(e,n,j,null,o,Q);for(ce in o)Q=o[ce],$=r[ce],!o.hasOwnProperty(ce)||Q===$||Q==null&&$==null||_t(e,n,ce,Q,o,$)}function th(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function H2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,r=performance.getEntriesByType("resource"),o=0;o<r.length;o++){var h=r[o],m=h.transferSize,S=h.initiatorType,_=h.duration;if(m&&_&&th(S)){for(S=0,_=h.responseEnd,o+=1;o<r.length;o++){var L=r[o],X=L.startTime;if(X>_)break;var se=L.transferSize,ce=L.initiatorType;se&&th(ce)&&(L=L.responseEnd,S+=se*(L<_?1:(_-X)/(L-X)))}if(--o,n+=8*(m+S)/(h.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Pc=null,Yc=null;function Fo(e){return e.nodeType===9?e:e.ownerDocument}function nh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ih(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Gc(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Vc=null;function j2(){var e=window.event;return e&&e.type==="popstate"?e===Vc?!1:(Vc=e,!0):(Vc=null,!1)}var ah=typeof setTimeout=="function"?setTimeout:void 0,P2=typeof clearTimeout=="function"?clearTimeout:void 0,rh=typeof Promise=="function"?Promise:void 0,Y2=typeof queueMicrotask=="function"?queueMicrotask:typeof rh<"u"?function(e){return rh.resolve(null).then(e).catch(G2)}:ah;function G2(e){setTimeout(function(){throw e})}function lr(e){return e==="head"}function lh(e,n){var r=n,o=0;do{var h=r.nextSibling;if(e.removeChild(r),h&&h.nodeType===8)if(r=h.data,r==="/$"||r==="/&"){if(o===0){e.removeChild(h),vl(n);return}o--}else if(r==="$"||r==="$?"||r==="$~"||r==="$!"||r==="&")o++;else if(r==="html")ps(e.ownerDocument.documentElement);else if(r==="head"){r=e.ownerDocument.head,ps(r);for(var m=r.firstChild;m;){var S=m.nextSibling,_=m.nodeName;m[yr]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&m.rel.toLowerCase()==="stylesheet"||r.removeChild(m),m=S}}else r==="body"&&ps(e.ownerDocument.body);r=h}while(r);vl(n)}function sh(e,n){var r=e;e=0;do{var o=r.nextSibling;if(r.nodeType===1?n?(r._stashedDisplay=r.style.display,r.style.display="none"):(r.style.display=r._stashedDisplay||"",r.getAttribute("style")===""&&r.removeAttribute("style")):r.nodeType===3&&(n?(r._stashedText=r.nodeValue,r.nodeValue=""):r.nodeValue=r._stashedText||""),o&&o.nodeType===8)if(r=o.data,r==="/$"){if(e===0)break;e--}else r!=="$"&&r!=="$?"&&r!=="$~"&&r!=="$!"||e++;r=o}while(r)}function Xc(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var r=n;switch(n=n.nextSibling,r.nodeName){case"HTML":case"HEAD":case"BODY":Xc(r),Yn(r);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(r.rel.toLowerCase()==="stylesheet")continue}e.removeChild(r)}}function V2(e,n,r,o){for(;e.nodeType===1;){var h=r;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[yr])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(m=e.getAttribute("rel"),m==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(m!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(m=e.getAttribute("src"),(m!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&m&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var m=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===m)return e}else return e;if(e=vi(e.nextSibling),e===null)break}return null}function X2(e,n,r){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!r||(e=vi(e.nextSibling),e===null))return null;return e}function oh(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=vi(e.nextSibling),e===null))return null;return e}function Zc(e){return e.data==="$?"||e.data==="$~"}function Qc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Z2(e,n){var r=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||r.readyState!=="loading")n();else{var o=function(){n(),r.removeEventListener("DOMContentLoaded",o)};r.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function vi(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var qc=null;function uh(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="/$"||r==="/&"){if(n===0)return vi(e.nextSibling);n--}else r!=="$"&&r!=="$!"&&r!=="$?"&&r!=="$~"&&r!=="&"||n++}e=e.nextSibling}return null}function ch(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var r=e.data;if(r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"){if(n===0)return e;n--}else r!=="/$"&&r!=="/&"||n++}e=e.previousSibling}return null}function fh(e,n,r){switch(n=Fo(r),e){case"html":if(e=n.documentElement,!e)throw Error(y(452));return e;case"head":if(e=n.head,!e)throw Error(y(453));return e;case"body":if(e=n.body,!e)throw Error(y(454));return e;default:throw Error(y(451))}}function ps(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Yn(e)}var Ni=new Map,hh=new Set;function Ho(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Sa=oe.d;oe.d={f:Q2,r:q2,D:W2,C:K2,L:J2,m:$2,X:tg,S:eg,M:ng};function Q2(){var e=Sa.f(),n=_o();return e||n}function q2(e){var n=pt(e);n!==null&&n.tag===5&&n.type==="form"?If(n):Sa.r(e)}var Sl=typeof document>"u"?null:document;function dh(e,n,r){var o=Sl;if(o&&typeof n=="string"&&n){var h=Je(n);h='link[rel="'+e+'"][href="'+h+'"]',typeof r=="string"&&(h+='[crossorigin="'+r+'"]'),hh.has(h)||(hh.add(h),e={rel:e,crossOrigin:r,href:n},o.querySelector(h)===null&&(n=o.createElement("link"),_n(n,"link",e),Kt(n),o.head.appendChild(n)))}}function W2(e){Sa.D(e),dh("dns-prefetch",e,null)}function K2(e,n){Sa.C(e,n),dh("preconnect",e,n)}function J2(e,n,r){Sa.L(e,n,r);var o=Sl;if(o&&e&&n){var h='link[rel="preload"][as="'+Je(n)+'"]';n==="image"&&r&&r.imageSrcSet?(h+='[imagesrcset="'+Je(r.imageSrcSet)+'"]',typeof r.imageSizes=="string"&&(h+='[imagesizes="'+Je(r.imageSizes)+'"]')):h+='[href="'+Je(e)+'"]';var m=h;switch(n){case"style":m=bl(e);break;case"script":m=Tl(e)}Ni.has(m)||(e=M({rel:"preload",href:n==="image"&&r&&r.imageSrcSet?void 0:e,as:n},r),Ni.set(m,e),o.querySelector(h)!==null||n==="style"&&o.querySelector(As(m))||n==="script"&&o.querySelector(Es(m))||(n=o.createElement("link"),_n(n,"link",e),Kt(n),o.head.appendChild(n)))}}function $2(e,n){Sa.m(e,n);var r=Sl;if(r&&e){var o=n&&typeof n.as=="string"?n.as:"script",h='link[rel="modulepreload"][as="'+Je(o)+'"][href="'+Je(e)+'"]',m=h;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Tl(e)}if(!Ni.has(m)&&(e=M({rel:"modulepreload",href:e},n),Ni.set(m,e),r.querySelector(h)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(r.querySelector(Es(m)))return}o=r.createElement("link"),_n(o,"link",e),Kt(o),r.head.appendChild(o)}}}function eg(e,n,r){Sa.S(e,n,r);var o=Sl;if(o&&e){var h=Ln(o).hoistableStyles,m=bl(e);n=n||"default";var S=h.get(m);if(!S){var _={loading:0,preload:null};if(S=o.querySelector(As(m)))_.loading=5;else{e=M({rel:"stylesheet",href:e,"data-precedence":n},r),(r=Ni.get(m))&&Wc(e,r);var L=S=o.createElement("link");Kt(L),_n(L,"link",e),L._p=new Promise(function(X,se){L.onload=X,L.onerror=se}),L.addEventListener("load",function(){_.loading|=1}),L.addEventListener("error",function(){_.loading|=2}),_.loading|=4,jo(S,n,o)}S={type:"stylesheet",instance:S,count:1,state:_},h.set(m,S)}}}function tg(e,n){Sa.X(e,n);var r=Sl;if(r&&e){var o=Ln(r).hoistableScripts,h=Tl(e),m=o.get(h);m||(m=r.querySelector(Es(h)),m||(e=M({src:e,async:!0},n),(n=Ni.get(h))&&Kc(e,n),m=r.createElement("script"),Kt(m),_n(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(h,m))}}function ng(e,n){Sa.M(e,n);var r=Sl;if(r&&e){var o=Ln(r).hoistableScripts,h=Tl(e),m=o.get(h);m||(m=r.querySelector(Es(h)),m||(e=M({src:e,async:!0,type:"module"},n),(n=Ni.get(h))&&Kc(e,n),m=r.createElement("script"),Kt(m),_n(m,"link",e),r.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},o.set(h,m))}}function gh(e,n,r,o){var h=(h=Ae.current)?Ho(h):null;if(!h)throw Error(y(446));switch(e){case"meta":case"title":return null;case"style":return typeof r.precedence=="string"&&typeof r.href=="string"?(n=bl(r.href),r=Ln(h).hoistableStyles,o=r.get(n),o||(o={type:"style",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(r.rel==="stylesheet"&&typeof r.href=="string"&&typeof r.precedence=="string"){e=bl(r.href);var m=Ln(h).hoistableStyles,S=m.get(e);if(S||(h=h.ownerDocument||h,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(e,S),(m=h.querySelector(As(e)))&&!m._p&&(S.instance=m,S.state.loading=5),Ni.has(e)||(r={rel:"preload",as:"style",href:r.href,crossOrigin:r.crossOrigin,integrity:r.integrity,media:r.media,hrefLang:r.hrefLang,referrerPolicy:r.referrerPolicy},Ni.set(e,r),m||ig(h,e,r,S.state))),n&&o===null)throw Error(y(528,""));return S}if(n&&o!==null)throw Error(y(529,""));return null;case"script":return n=r.async,r=r.src,typeof r=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Tl(r),r=Ln(h).hoistableScripts,o=r.get(n),o||(o={type:"script",instance:null,count:0,state:null},r.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(y(444,e))}}function bl(e){return'href="'+Je(e)+'"'}function As(e){return'link[rel="stylesheet"]['+e+"]"}function xh(e){return M({},e,{"data-precedence":e.precedence,precedence:null})}function ig(e,n,r,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),_n(n,"link",r),Kt(n),e.head.appendChild(n))}function Tl(e){return'[src="'+Je(e)+'"]'}function Es(e){return"script[async]"+e}function mh(e,n,r){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+Je(r.href)+'"]');if(o)return n.instance=o,Kt(o),o;var h=M({},r,{"data-href":r.href,"data-precedence":r.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),Kt(o),_n(o,"style",h),jo(o,r.precedence,e),n.instance=o;case"stylesheet":h=bl(r.href);var m=e.querySelector(As(h));if(m)return n.state.loading|=4,n.instance=m,Kt(m),m;o=xh(r),(h=Ni.get(h))&&Wc(o,h),m=(e.ownerDocument||e).createElement("link"),Kt(m);var S=m;return S._p=new Promise(function(_,L){S.onload=_,S.onerror=L}),_n(m,"link",o),n.state.loading|=4,jo(m,r.precedence,e),n.instance=m;case"script":return m=Tl(r.src),(h=e.querySelector(Es(m)))?(n.instance=h,Kt(h),h):(o=r,(h=Ni.get(m))&&(o=M({},r),Kc(o,h)),e=e.ownerDocument||e,h=e.createElement("script"),Kt(h),_n(h,"link",o),e.head.appendChild(h),n.instance=h);case"void":return null;default:throw Error(y(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,jo(o,r.precedence,e));return n.instance}function jo(e,n,r){for(var o=r.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=o.length?o[o.length-1]:null,m=h,S=0;S<o.length;S++){var _=o[S];if(_.dataset.precedence===n)m=_;else if(m!==h)break}m?m.parentNode.insertBefore(e,m.nextSibling):(n=r.nodeType===9?r.head:r,n.insertBefore(e,n.firstChild))}function Wc(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Kc(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Po=null;function yh(e,n,r){if(Po===null){var o=new Map,h=Po=new Map;h.set(r,o)}else h=Po,o=h.get(r),o||(o=new Map,h.set(r,o));if(o.has(e))return o;for(o.set(e,null),r=r.getElementsByTagName(e),h=0;h<r.length;h++){var m=r[h];if(!(m[yr]||m[an]||e==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var S=m.getAttribute(n)||"";S=e+S;var _=o.get(S);_?_.push(m):o.set(S,[m])}}return o}function ph(e,n,r){e=e.ownerDocument||e,e.head.insertBefore(r,n==="title"?e.querySelector("head > title"):null)}function ag(e,n,r){if(r===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Ah(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function rg(e,n,r,o){if(r.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var h=bl(o.href),m=n.querySelector(As(h));if(m){n=m._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Yo.bind(e),n.then(e,e)),r.state.loading|=4,r.instance=m,Kt(m);return}m=n.ownerDocument||n,o=xh(o),(h=Ni.get(h))&&Wc(o,h),m=m.createElement("link"),Kt(m);var S=m;S._p=new Promise(function(_,L){S.onload=_,S.onerror=L}),_n(m,"link",o),r.instance=m}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(r,n),(n=r.state.preload)&&(r.state.loading&3)===0&&(e.count++,r=Yo.bind(e),n.addEventListener("load",r),n.addEventListener("error",r))}}var Jc=0;function lg(e,n){return e.stylesheets&&e.count===0&&Vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(r){var o=setTimeout(function(){if(e.stylesheets&&Vo(e,e.stylesheets),e.unsuspend){var m=e.unsuspend;e.unsuspend=null,m()}},6e4+n);0<e.imgBytes&&Jc===0&&(Jc=62500*H2());var h=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vo(e,e.stylesheets),e.unsuspend)){var m=e.unsuspend;e.unsuspend=null,m()}},(e.imgBytes>Jc?50:800)+n);return e.unsuspend=r,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(h)}}:null}function Yo(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Go=null;function Vo(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Go=new Map,n.forEach(sg,e),Go=null,Yo.call(e))}function sg(e,n){if(!(n.state.loading&4)){var r=Go.get(e);if(r)var o=r.get(null);else{r=new Map,Go.set(e,r);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<h.length;m++){var S=h[m];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(r.set(S.dataset.precedence,S),o=S)}o&&r.set(null,o)}h=n.instance,S=h.getAttribute("data-precedence"),m=r.get(S)||o,m===o&&r.set(null,h),r.set(S,h),this.count++,o=Yo.bind(this),h.addEventListener("load",o),h.addEventListener("error",o),m?m.parentNode.insertBefore(h,m.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),n.state.loading|=4}}var Cs={$$typeof:ne,Provider:null,Consumer:null,_currentValue:Oe,_currentValue2:Oe,_threadCount:0};function og(e,n,r,o,h,m,S,_,L){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Yi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Yi(0),this.hiddenUpdates=Yi(null),this.identifierPrefix=o,this.onUncaughtError=h,this.onCaughtError=m,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function Eh(e,n,r,o,h,m,S,_,L,X,se,ce){return e=new og(e,n,r,S,L,X,se,ce,_),n=1,m===!0&&(n|=24),m=ri(3,null,null,n),e.current=m,m.stateNode=e,n=_u(),n.refCount++,e.pooledCache=n,n.refCount++,m.memoizedState={element:o,isDehydrated:r,cache:n},Lu(m),e}function Ch(e){return e?(e=nl,e):nl}function wh(e,n,r,o,h,m){h=Ch(h),o.context===null?o.context=h:o.pendingContext=h,o=qa(n),o.payload={element:r},m=m===void 0?null:m,m!==null&&(o.callback=m),r=Wa(e,o,n),r!==null&&(Kn(r,e,n),$l(r,e,n))}function Sh(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var r=e.retryLane;e.retryLane=r!==0&&r<n?r:n}}function $c(e,n){Sh(e,n),(e=e.alternate)&&Sh(e,n)}function bh(e){if(e.tag===13||e.tag===31){var n=vr(e,67108864);n!==null&&Kn(n,e,67108864),$c(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var n=ci();n=Sn(n);var r=vr(e,n);r!==null&&Kn(r,e,n),$c(e,n)}}var Xo=!0;function ug(e,n,r,o){var h=J.T;J.T=null;var m=oe.p;try{oe.p=2,e1(e,n,r,o)}finally{oe.p=m,J.T=h}}function cg(e,n,r,o){var h=J.T;J.T=null;var m=oe.p;try{oe.p=8,e1(e,n,r,o)}finally{oe.p=m,J.T=h}}function e1(e,n,r,o){if(Xo){var h=t1(o);if(h===null)Hc(e,n,o,Zo,r),Nh(e,o);else if(hg(h,e,n,r,o))o.stopPropagation();else if(Nh(e,o),n&4&&-1<fg.indexOf(e)){for(;h!==null;){var m=pt(h);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var S=Pi(m.pendingLanes);if(S!==0){var _=m;for(_.pendingLanes|=2,_.entangledLanes|=2;S;){var L=1<<31-Ge(S);_.entanglements[1]|=L,S&=~L}$i(m),(Et&6)===0&&(Io=qt()+500,xs(0))}}break;case 31:case 13:_=vr(m,2),_!==null&&Kn(_,m,2),_o(),$c(m,2)}if(m=t1(o),m===null&&Hc(e,n,o,Zo,r),m===h)break;h=m}h!==null&&o.stopPropagation()}else Hc(e,n,o,null,r)}}function t1(e){return e=kl(e),n1(e)}var Zo=null;function n1(e){if(Zo=null,e=Wt(e),e!==null){var n=E(e);if(n===null)e=null;else{var r=n.tag;if(r===13){if(e=O(n),e!==null)return e;e=null}else if(r===31){if(e=R(n),e!==null)return e;e=null}else if(r===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Zo=e,null}function vh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Rl()){case Pn:return 2;case Dl:return 8;case Jn:case Tn:return 32;case Bl:return 268435456;default:return 32}default:return 32}}var i1=!1,sr=null,or=null,ur=null,ws=new Map,Ss=new Map,cr=[],fg="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Nh(e,n){switch(e){case"focusin":case"focusout":sr=null;break;case"dragenter":case"dragleave":or=null;break;case"mouseover":case"mouseout":ur=null;break;case"pointerover":case"pointerout":ws.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ss.delete(n.pointerId)}}function bs(e,n,r,o,h,m){return e===null||e.nativeEvent!==m?(e={blockedOn:n,domEventName:r,eventSystemFlags:o,nativeEvent:m,targetContainers:[h]},n!==null&&(n=pt(n),n!==null&&bh(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,h!==null&&n.indexOf(h)===-1&&n.push(h),e)}function hg(e,n,r,o,h){switch(n){case"focusin":return sr=bs(sr,e,n,r,o,h),!0;case"dragenter":return or=bs(or,e,n,r,o,h),!0;case"mouseover":return ur=bs(ur,e,n,r,o,h),!0;case"pointerover":var m=h.pointerId;return ws.set(m,bs(ws.get(m)||null,e,n,r,o,h)),!0;case"gotpointercapture":return m=h.pointerId,Ss.set(m,bs(Ss.get(m)||null,e,n,r,o,h)),!0}return!1}function Mh(e){var n=Wt(e.target);if(n!==null){var r=E(n);if(r!==null){if(n=r.tag,n===13){if(n=O(r),n!==null){e.blockedOn=n,Se(e.priority,function(){Th(r)});return}}else if(n===31){if(n=R(r),n!==null){e.blockedOn=n,Se(e.priority,function(){Th(r)});return}}else if(n===3&&r.stateNode.current.memoizedState.isDehydrated){e.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qo(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var r=t1(e.nativeEvent);if(r===null){r=e.nativeEvent;var o=new r.constructor(r.type,r);pr=o,r.target.dispatchEvent(o),pr=null}else return n=pt(r),n!==null&&bh(n),e.blockedOn=r,!1;n.shift()}return!0}function Ih(e,n,r){Qo(e)&&r.delete(n)}function dg(){i1=!1,sr!==null&&Qo(sr)&&(sr=null),or!==null&&Qo(or)&&(or=null),ur!==null&&Qo(ur)&&(ur=null),ws.forEach(Ih),Ss.forEach(Ih)}function qo(e,n){e.blockedOn===n&&(e.blockedOn=null,i1||(i1=!0,f.unstable_scheduleCallback(f.unstable_NormalPriority,dg)))}var Wo=null;function Oh(e){Wo!==e&&(Wo=e,f.unstable_scheduleCallback(f.unstable_NormalPriority,function(){Wo===e&&(Wo=null);for(var n=0;n<e.length;n+=3){var r=e[n],o=e[n+1],h=e[n+2];if(typeof o!="function"){if(n1(o||r)===null)continue;break}var m=pt(r);m!==null&&(e.splice(n,3),n-=3,tc(m,{pending:!0,data:h,method:r.method,action:o},o,h))}}))}function vl(e){function n(L){return qo(L,e)}sr!==null&&qo(sr,e),or!==null&&qo(or,e),ur!==null&&qo(ur,e),ws.forEach(n),Ss.forEach(n);for(var r=0;r<cr.length;r++){var o=cr[r];o.blockedOn===e&&(o.blockedOn=null)}for(;0<cr.length&&(r=cr[0],r.blockedOn===null);)Mh(r),r.blockedOn===null&&cr.shift();if(r=(e.ownerDocument||e).$$reactFormReplay,r!=null)for(o=0;o<r.length;o+=3){var h=r[o],m=r[o+1],S=h[Tt]||null;if(typeof m=="function")S||Oh(r);else if(S){var _=null;if(m&&m.hasAttribute("formAction")){if(h=m,S=m[Tt]||null)_=S.formAction;else if(n1(h)!==null)continue}else _=S.action;typeof _=="function"?r[o+1]=_:(r.splice(o,3),o-=3),Oh(r)}}}function _h(){function e(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(S){return h=S})},focusReset:"manual",scroll:"manual"})}function n(){h!==null&&(h(),h=null),o||setTimeout(r,20)}function r(){if(!o&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,h=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(r,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),h!==null&&(h(),h=null)}}}function a1(e){this._internalRoot=e}Ko.prototype.render=a1.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(y(409));var r=n.current,o=ci();wh(r,o,e,n,null,null)},Ko.prototype.unmount=a1.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;wh(e.current,2,null,e,null,null),_o(),n[$n]=null}};function Ko(e){this._internalRoot=e}Ko.prototype.unstable_scheduleHydration=function(e){if(e){var n=Dn();e={blockedOn:null,target:e,priority:n};for(var r=0;r<cr.length&&n!==0&&n<cr[r].priority;r++);cr.splice(r,0,e),r===0&&Mh(e)}};var Rh=g.version;if(Rh!=="19.2.0")throw Error(y(527,Rh,"19.2.0"));oe.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(y(188)):(e=Object.keys(e).join(","),Error(y(268,e)));return e=A(n),e=e!==null?N(e):null,e=e===null?null:e.stateNode,e};var gg={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Jo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Jo.isDisabled&&Jo.supportsFiber)try{kt=Jo.inject(gg),ye=Jo}catch{}}return vs.createRoot=function(e,n){if(!C(e))throw Error(y(299));var r=!1,o="",h=Ff,m=Hf,S=jf;return n!=null&&(n.unstable_strictMode===!0&&(r=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(h=n.onUncaughtError),n.onCaughtError!==void 0&&(m=n.onCaughtError),n.onRecoverableError!==void 0&&(S=n.onRecoverableError)),n=Eh(e,1,!1,null,null,r,o,null,h,m,S,_h),e[$n]=n.current,Fc(e),new a1(n)},vs.hydrateRoot=function(e,n,r){if(!C(e))throw Error(y(299));var o=!1,h="",m=Ff,S=Hf,_=jf,L=null;return r!=null&&(r.unstable_strictMode===!0&&(o=!0),r.identifierPrefix!==void 0&&(h=r.identifierPrefix),r.onUncaughtError!==void 0&&(m=r.onUncaughtError),r.onCaughtError!==void 0&&(S=r.onCaughtError),r.onRecoverableError!==void 0&&(_=r.onRecoverableError),r.formState!==void 0&&(L=r.formState)),n=Eh(e,1,!0,n,r??null,o,h,L,m,S,_,_h),n.context=Ch(null),r=n.current,o=ci(),o=Sn(o),h=qa(o),h.callback=null,Wa(r,h,o),r=o,n.current.lanes=r,Gi(n,r),$i(n),e[$n]=n.current,Fc(e),new Ko(n)},vs.version="19.2.0",vs}var Ph;function Tg(){if(Ph)return l1.exports;Ph=1;function f(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(f)}catch(g){console.error(g)}}return f(),l1.exports=bg(),l1.exports}var vg=Tg(),te=p1();const wn=dd(te);var Yh="popstate";function Ng(f={}){function g(y,C){let{pathname:E,search:O,hash:R}=y.location;return d1("",{pathname:E,search:O,hash:R},C.state&&C.state.usr||null,C.state&&C.state.key||"default")}function d(y,C){return typeof C=="string"?C:Is(C)}return Ig(g,d,null,f)}function Qt(f,g){if(f===!1||f===null||typeof f>"u")throw new Error(g)}function Mi(f,g){if(!f){typeof console<"u"&&console.warn(g);try{throw new Error(g)}catch{}}}function Mg(){return Math.random().toString(36).substring(2,10)}function Gh(f,g){return{usr:f.state,key:f.key,idx:g}}function d1(f,g,d=null,y){return{pathname:typeof f=="string"?f:f.pathname,search:"",hash:"",...typeof g=="string"?Il(g):g,state:d,key:g&&g.key||y||Mg()}}function Is({pathname:f="/",search:g="",hash:d=""}){return g&&g!=="?"&&(f+=g.charAt(0)==="?"?g:"?"+g),d&&d!=="#"&&(f+=d.charAt(0)==="#"?d:"#"+d),f}function Il(f){let g={};if(f){let d=f.indexOf("#");d>=0&&(g.hash=f.substring(d),f=f.substring(0,d));let y=f.indexOf("?");y>=0&&(g.search=f.substring(y),f=f.substring(0,y)),f&&(g.pathname=f)}return g}function Ig(f,g,d,y={}){let{window:C=document.defaultView,v5Compat:E=!1}=y,O=C.history,R="POP",b=null,A=N();A==null&&(A=0,O.replaceState({...O.state,idx:A},""));function N(){return(O.state||{idx:null}).idx}function M(){R="POP";let ae=N(),pe=ae==null?null:ae-A;A=ae,b&&b({action:R,location:ie.location,delta:pe})}function H(ae,pe){R="PUSH";let de=d1(ie.location,ae,pe);A=N()+1;let ne=Gh(de,A),we=ie.createHref(de);try{O.pushState(ne,"",we)}catch(Pe){if(Pe instanceof DOMException&&Pe.name==="DataCloneError")throw Pe;C.location.assign(we)}E&&b&&b({action:R,location:ie.location,delta:1})}function Z(ae,pe){R="REPLACE";let de=d1(ie.location,ae,pe);A=N();let ne=Gh(de,A),we=ie.createHref(de);O.replaceState(ne,"",we),E&&b&&b({action:R,location:ie.location,delta:0})}function ee(ae){return Og(ae)}let ie={get action(){return R},get location(){return f(C,O)},listen(ae){if(b)throw new Error("A history only accepts one active listener");return C.addEventListener(Yh,M),b=ae,()=>{C.removeEventListener(Yh,M),b=null}},createHref(ae){return g(C,ae)},createURL:ee,encodeLocation(ae){let pe=ee(ae);return{pathname:pe.pathname,search:pe.search,hash:pe.hash}},push:H,replace:Z,go(ae){return O.go(ae)}};return ie}function Og(f,g=!1){let d="http://localhost";typeof window<"u"&&(d=window.location.origin!=="null"?window.location.origin:window.location.href),Qt(d,"No window.location.(origin|href) available to create URL");let y=typeof f=="string"?f:Is(f);return y=y.replace(/ $/,"%20"),!g&&y.startsWith("//")&&(y=d+y),new URL(y,d)}function gd(f,g,d="/"){return _g(f,g,d,!1)}function _g(f,g,d,y){let C=typeof g=="string"?Il(g):g,E=va(C.pathname||"/",d);if(E==null)return null;let O=xd(f);Rg(O);let R=null;for(let b=0;R==null&&b<O.length;++b){let A=Yg(E);R=jg(O[b],A,y)}return R}function xd(f,g=[],d=[],y="",C=!1){let E=(O,R,b=C,A)=>{let N={relativePath:A===void 0?O.path||"":A,caseSensitive:O.caseSensitive===!0,childrenIndex:R,route:O};if(N.relativePath.startsWith("/")){if(!N.relativePath.startsWith(y)&&b)return;Qt(N.relativePath.startsWith(y),`Absolute route path "${N.relativePath}" nested under path "${y}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),N.relativePath=N.relativePath.slice(y.length)}let M=Ta([y,N.relativePath]),H=d.concat(N);O.children&&O.children.length>0&&(Qt(O.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${M}".`),xd(O.children,g,H,M,b)),!(O.path==null&&!O.index)&&g.push({path:M,score:Fg(M,O.index),routesMeta:H})};return f.forEach((O,R)=>{if(O.path===""||!O.path?.includes("?"))E(O,R);else for(let b of md(O.path))E(O,R,!0,b)}),g}function md(f){let g=f.split("/");if(g.length===0)return[];let[d,...y]=g,C=d.endsWith("?"),E=d.replace(/\?$/,"");if(y.length===0)return C?[E,""]:[E];let O=md(y.join("/")),R=[];return R.push(...O.map(b=>b===""?E:[E,b].join("/"))),C&&R.push(...O),R.map(b=>f.startsWith("/")&&b===""?"/":b)}function Rg(f){f.sort((g,d)=>g.score!==d.score?d.score-g.score:Hg(g.routesMeta.map(y=>y.childrenIndex),d.routesMeta.map(y=>y.childrenIndex)))}var Dg=/^:[\w-]+$/,Bg=3,Lg=2,Ug=1,zg=10,kg=-2,Vh=f=>f==="*";function Fg(f,g){let d=f.split("/"),y=d.length;return d.some(Vh)&&(y+=kg),g&&(y+=Lg),d.filter(C=>!Vh(C)).reduce((C,E)=>C+(Dg.test(E)?Bg:E===""?Ug:zg),y)}function Hg(f,g){return f.length===g.length&&f.slice(0,-1).every((y,C)=>y===g[C])?f[f.length-1]-g[g.length-1]:0}function jg(f,g,d=!1){let{routesMeta:y}=f,C={},E="/",O=[];for(let R=0;R<y.length;++R){let b=y[R],A=R===y.length-1,N=E==="/"?g:g.slice(E.length)||"/",M=iu({path:b.relativePath,caseSensitive:b.caseSensitive,end:A},N),H=b.route;if(!M&&A&&d&&!y[y.length-1].route.index&&(M=iu({path:b.relativePath,caseSensitive:b.caseSensitive,end:!1},N)),!M)return null;Object.assign(C,M.params),O.push({params:C,pathname:Ta([E,M.pathname]),pathnameBase:Qg(Ta([E,M.pathnameBase])),route:H}),M.pathnameBase!=="/"&&(E=Ta([E,M.pathnameBase]))}return O}function iu(f,g){typeof f=="string"&&(f={path:f,caseSensitive:!1,end:!0});let[d,y]=Pg(f.path,f.caseSensitive,f.end),C=g.match(d);if(!C)return null;let E=C[0],O=E.replace(/(.)\/+$/,"$1"),R=C.slice(1);return{params:y.reduce((A,{paramName:N,isOptional:M},H)=>{if(N==="*"){let ee=R[H]||"";O=E.slice(0,E.length-ee.length).replace(/(.)\/+$/,"$1")}const Z=R[H];return M&&!Z?A[N]=void 0:A[N]=(Z||"").replace(/%2F/g,"/"),A},{}),pathname:E,pathnameBase:O,pattern:f}}function Pg(f,g=!1,d=!0){Mi(f==="*"||!f.endsWith("*")||f.endsWith("/*"),`Route path "${f}" will be treated as if it were "${f.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${f.replace(/\*$/,"/*")}".`);let y=[],C="^"+f.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(O,R,b)=>(y.push({paramName:R,isOptional:b!=null}),b?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return f.endsWith("*")?(y.push({paramName:"*"}),C+=f==="*"||f==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):d?C+="\\/*$":f!==""&&f!=="/"&&(C+="(?:(?=\\/|$))"),[new RegExp(C,g?void 0:"i"),y]}function Yg(f){try{return f.split("/").map(g=>decodeURIComponent(g).replace(/\//g,"%2F")).join("/")}catch(g){return Mi(!1,`The URL path "${f}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${g}).`),f}}function va(f,g){if(g==="/")return f;if(!f.toLowerCase().startsWith(g.toLowerCase()))return null;let d=g.endsWith("/")?g.length-1:g.length,y=f.charAt(d);return y&&y!=="/"?null:f.slice(d)||"/"}var Gg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Vg=f=>Gg.test(f);function Xg(f,g="/"){let{pathname:d,search:y="",hash:C=""}=typeof f=="string"?Il(f):f,E;if(d)if(Vg(d))E=d;else{if(d.includes("//")){let O=d;d=d.replace(/\/\/+/g,"/"),Mi(!1,`Pathnames cannot have embedded double slashes - normalizing ${O} -> ${d}`)}d.startsWith("/")?E=Xh(d.substring(1),"/"):E=Xh(d,g)}else E=g;return{pathname:E,search:qg(y),hash:Wg(C)}}function Xh(f,g){let d=g.replace(/\/+$/,"").split("/");return f.split("/").forEach(C=>{C===".."?d.length>1&&d.pop():C!=="."&&d.push(C)}),d.length>1?d.join("/"):"/"}function f1(f,g,d,y){return`Cannot include a '${f}' character in a manually specified \`to.${g}\` field [${JSON.stringify(y)}]. Please separate it out to the \`to.${d}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Zg(f){return f.filter((g,d)=>d===0||g.route.path&&g.route.path.length>0)}function A1(f){let g=Zg(f);return g.map((d,y)=>y===g.length-1?d.pathname:d.pathnameBase)}function E1(f,g,d,y=!1){let C;typeof f=="string"?C=Il(f):(C={...f},Qt(!C.pathname||!C.pathname.includes("?"),f1("?","pathname","search",C)),Qt(!C.pathname||!C.pathname.includes("#"),f1("#","pathname","hash",C)),Qt(!C.search||!C.search.includes("#"),f1("#","search","hash",C)));let E=f===""||C.pathname==="",O=E?"/":C.pathname,R;if(O==null)R=d;else{let M=g.length-1;if(!y&&O.startsWith("..")){let H=O.split("/");for(;H[0]==="..";)H.shift(),M-=1;C.pathname=H.join("/")}R=M>=0?g[M]:"/"}let b=Xg(C,R),A=O&&O!=="/"&&O.endsWith("/"),N=(E||O===".")&&d.endsWith("/");return!b.pathname.endsWith("/")&&(A||N)&&(b.pathname+="/"),b}var Ta=f=>f.join("/").replace(/\/\/+/g,"/"),Qg=f=>f.replace(/\/+$/,"").replace(/^\/*/,"/"),qg=f=>!f||f==="?"?"":f.startsWith("?")?f:"?"+f,Wg=f=>!f||f==="#"?"":f.startsWith("#")?f:"#"+f;function Kg(f){return f!=null&&typeof f.status=="number"&&typeof f.statusText=="string"&&typeof f.internal=="boolean"&&"data"in f}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var yd=["POST","PUT","PATCH","DELETE"];new Set(yd);var Jg=["GET",...yd];new Set(Jg);var Ol=te.createContext(null);Ol.displayName="DataRouter";var su=te.createContext(null);su.displayName="DataRouterState";te.createContext(!1);var pd=te.createContext({isTransitioning:!1});pd.displayName="ViewTransition";var $g=te.createContext(new Map);$g.displayName="Fetchers";var ex=te.createContext(null);ex.displayName="Await";var Hi=te.createContext(null);Hi.displayName="Navigation";var Os=te.createContext(null);Os.displayName="Location";var ji=te.createContext({outlet:null,matches:[],isDataRoute:!1});ji.displayName="Route";var C1=te.createContext(null);C1.displayName="RouteError";function tx(f,{relative:g}={}){Qt(_l(),"useHref() may be used only in the context of a <Router> component.");let{basename:d,navigator:y}=te.useContext(Hi),{hash:C,pathname:E,search:O}=_s(f,{relative:g}),R=E;return d!=="/"&&(R=E==="/"?d:Ta([d,E])),y.createHref({pathname:R,search:O,hash:C})}function _l(){return te.useContext(Os)!=null}function Na(){return Qt(_l(),"useLocation() may be used only in the context of a <Router> component."),te.useContext(Os).location}var Ad="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Ed(f){te.useContext(Hi).static||te.useLayoutEffect(f)}function ou(){let{isDataRoute:f}=te.useContext(ji);return f?mx():nx()}function nx(){Qt(_l(),"useNavigate() may be used only in the context of a <Router> component.");let f=te.useContext(Ol),{basename:g,navigator:d}=te.useContext(Hi),{matches:y}=te.useContext(ji),{pathname:C}=Na(),E=JSON.stringify(A1(y)),O=te.useRef(!1);return Ed(()=>{O.current=!0}),te.useCallback((b,A={})=>{if(Mi(O.current,Ad),!O.current)return;if(typeof b=="number"){d.go(b);return}let N=E1(b,JSON.parse(E),C,A.relative==="path");f==null&&g!=="/"&&(N.pathname=N.pathname==="/"?g:Ta([g,N.pathname])),(A.replace?d.replace:d.push)(N,A.state,A)},[g,d,E,C,f])}var ix=te.createContext(null);function ax(f){let g=te.useContext(ji).outlet;return te.useMemo(()=>g&&te.createElement(ix.Provider,{value:f},g),[g,f])}function _s(f,{relative:g}={}){let{matches:d}=te.useContext(ji),{pathname:y}=Na(),C=JSON.stringify(A1(d));return te.useMemo(()=>E1(f,JSON.parse(C),y,g==="path"),[f,C,y,g])}function rx(f,g){return Cd(f,g)}function Cd(f,g,d,y,C){Qt(_l(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:E}=te.useContext(Hi),{matches:O}=te.useContext(ji),R=O[O.length-1],b=R?R.params:{},A=R?R.pathname:"/",N=R?R.pathnameBase:"/",M=R&&R.route;{let de=M&&M.path||"";wd(A,!M||de.endsWith("*")||de.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${A}" (under <Route path="${de}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
||
|
||
Please change the parent <Route path="${de}"> to <Route path="${de==="/"?"*":`${de}/*`}">.`)}let H=Na(),Z;if(g){let de=typeof g=="string"?Il(g):g;Qt(N==="/"||de.pathname?.startsWith(N),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${N}" but pathname "${de.pathname}" was given in the \`location\` prop.`),Z=de}else Z=H;let ee=Z.pathname||"/",ie=ee;if(N!=="/"){let de=N.replace(/^\//,"").split("/");ie="/"+ee.replace(/^\//,"").split("/").slice(de.length).join("/")}let ae=gd(f,{pathname:ie});Mi(M||ae!=null,`No routes matched location "${Z.pathname}${Z.search}${Z.hash}" `),Mi(ae==null||ae[ae.length-1].route.element!==void 0||ae[ae.length-1].route.Component!==void 0||ae[ae.length-1].route.lazy!==void 0,`Matched leaf route at location "${Z.pathname}${Z.search}${Z.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let pe=cx(ae&&ae.map(de=>Object.assign({},de,{params:Object.assign({},b,de.params),pathname:Ta([N,E.encodeLocation?E.encodeLocation(de.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:de.pathname]),pathnameBase:de.pathnameBase==="/"?N:Ta([N,E.encodeLocation?E.encodeLocation(de.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:de.pathnameBase])})),O,d,y,C);return g&&pe?te.createElement(Os.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...Z},navigationType:"POP"}},pe):pe}function lx(){let f=xx(),g=Kg(f)?`${f.status} ${f.statusText}`:f instanceof Error?f.message:JSON.stringify(f),d=f instanceof Error?f.stack:null,y="rgba(200,200,200, 0.5)",C={padding:"0.5rem",backgroundColor:y},E={padding:"2px 4px",backgroundColor:y},O=null;return console.error("Error handled by React Router default ErrorBoundary:",f),O=te.createElement(te.Fragment,null,te.createElement("p",null,"💿 Hey developer 👋"),te.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",te.createElement("code",{style:E},"ErrorBoundary")," or"," ",te.createElement("code",{style:E},"errorElement")," prop on your route.")),te.createElement(te.Fragment,null,te.createElement("h2",null,"Unexpected Application Error!"),te.createElement("h3",{style:{fontStyle:"italic"}},g),d?te.createElement("pre",{style:C},d):null,O)}var sx=te.createElement(lx,null),ox=class extends te.Component{constructor(f){super(f),this.state={location:f.location,revalidation:f.revalidation,error:f.error}}static getDerivedStateFromError(f){return{error:f}}static getDerivedStateFromProps(f,g){return g.location!==f.location||g.revalidation!=="idle"&&f.revalidation==="idle"?{error:f.error,location:f.location,revalidation:f.revalidation}:{error:f.error!==void 0?f.error:g.error,location:g.location,revalidation:f.revalidation||g.revalidation}}componentDidCatch(f,g){this.props.onError?this.props.onError(f,g):console.error("React Router caught the following error during render",f)}render(){return this.state.error!==void 0?te.createElement(ji.Provider,{value:this.props.routeContext},te.createElement(C1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ux({routeContext:f,match:g,children:d}){let y=te.useContext(Ol);return y&&y.static&&y.staticContext&&(g.route.errorElement||g.route.ErrorBoundary)&&(y.staticContext._deepestRenderedBoundaryId=g.route.id),te.createElement(ji.Provider,{value:f},d)}function cx(f,g=[],d=null,y=null,C=null){if(f==null){if(!d)return null;if(d.errors)f=d.matches;else if(g.length===0&&!d.initialized&&d.matches.length>0)f=d.matches;else return null}let E=f,O=d?.errors;if(O!=null){let N=E.findIndex(M=>M.route.id&&O?.[M.route.id]!==void 0);Qt(N>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(O).join(",")}`),E=E.slice(0,Math.min(E.length,N+1))}let R=!1,b=-1;if(d)for(let N=0;N<E.length;N++){let M=E[N];if((M.route.HydrateFallback||M.route.hydrateFallbackElement)&&(b=N),M.route.id){let{loaderData:H,errors:Z}=d,ee=M.route.loader&&!H.hasOwnProperty(M.route.id)&&(!Z||Z[M.route.id]===void 0);if(M.route.lazy||ee){R=!0,b>=0?E=E.slice(0,b+1):E=[E[0]];break}}}let A=d&&y?(N,M)=>{y(N,{location:d.location,params:d.matches?.[0]?.params??{},errorInfo:M})}:void 0;return E.reduceRight((N,M,H)=>{let Z,ee=!1,ie=null,ae=null;d&&(Z=O&&M.route.id?O[M.route.id]:void 0,ie=M.route.errorElement||sx,R&&(b<0&&H===0?(wd("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),ee=!0,ae=null):b===H&&(ee=!0,ae=M.route.hydrateFallbackElement||null)));let pe=g.concat(E.slice(0,H+1)),de=()=>{let ne;return Z?ne=ie:ee?ne=ae:M.route.Component?ne=te.createElement(M.route.Component,null):M.route.element?ne=M.route.element:ne=N,te.createElement(ux,{match:M,routeContext:{outlet:N,matches:pe,isDataRoute:d!=null},children:ne})};return d&&(M.route.ErrorBoundary||M.route.errorElement||H===0)?te.createElement(ox,{location:d.location,revalidation:d.revalidation,component:ie,error:Z,children:de(),routeContext:{outlet:null,matches:pe,isDataRoute:!0},onError:A}):de()},null)}function w1(f){return`${f} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fx(f){let g=te.useContext(Ol);return Qt(g,w1(f)),g}function hx(f){let g=te.useContext(su);return Qt(g,w1(f)),g}function dx(f){let g=te.useContext(ji);return Qt(g,w1(f)),g}function S1(f){let g=dx(f),d=g.matches[g.matches.length-1];return Qt(d.route.id,`${f} can only be used on routes that contain a unique "id"`),d.route.id}function gx(){return S1("useRouteId")}function xx(){let f=te.useContext(C1),g=hx("useRouteError"),d=S1("useRouteError");return f!==void 0?f:g.errors?.[d]}function mx(){let{router:f}=fx("useNavigate"),g=S1("useNavigate"),d=te.useRef(!1);return Ed(()=>{d.current=!0}),te.useCallback(async(C,E={})=>{Mi(d.current,Ad),d.current&&(typeof C=="number"?f.navigate(C):await f.navigate(C,{fromRouteId:g,...E}))},[f,g])}var Zh={};function wd(f,g,d){!g&&!Zh[f]&&(Zh[f]=!0,Mi(!1,d))}te.memo(yx);function yx({routes:f,future:g,state:d,unstable_onError:y}){return Cd(f,void 0,d,y,g)}function px({to:f,replace:g,state:d,relative:y}){Qt(_l(),"<Navigate> may be used only in the context of a <Router> component.");let{static:C}=te.useContext(Hi);Mi(!C,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:E}=te.useContext(ji),{pathname:O}=Na(),R=ou(),b=E1(f,A1(E),O,y==="path"),A=JSON.stringify(b);return te.useEffect(()=>{R(JSON.parse(A),{replace:g,state:d,relative:y})},[R,A,y,g,d]),null}function Sd(f){return ax(f.context)}function Fr(f){Qt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ax({basename:f="/",children:g=null,location:d,navigationType:y="POP",navigator:C,static:E=!1}){Qt(!_l(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let O=f.replace(/^\/*/,"/"),R=te.useMemo(()=>({basename:O,navigator:C,static:E,future:{}}),[O,C,E]);typeof d=="string"&&(d=Il(d));let{pathname:b="/",search:A="",hash:N="",state:M=null,key:H="default"}=d,Z=te.useMemo(()=>{let ee=va(b,O);return ee==null?null:{location:{pathname:ee,search:A,hash:N,state:M,key:H},navigationType:y}},[O,b,A,N,M,H,y]);return Mi(Z!=null,`<Router basename="${O}"> is not able to match the URL "${b}${A}${N}" because it does not start with the basename, so the <Router> won't render anything.`),Z==null?null:te.createElement(Hi.Provider,{value:R},te.createElement(Os.Provider,{children:g,value:Z}))}function Ex({children:f,location:g}){return rx(g1(f),g)}function g1(f,g=[]){let d=[];return te.Children.forEach(f,(y,C)=>{if(!te.isValidElement(y))return;let E=[...g,C];if(y.type===te.Fragment){d.push.apply(d,g1(y.props.children,E));return}Qt(y.type===Fr,`[${typeof y.type=="string"?y.type:y.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Qt(!y.props.index||!y.props.children,"An index route cannot have child routes.");let O={id:y.props.id||E.join("-"),caseSensitive:y.props.caseSensitive,element:y.props.element,Component:y.props.Component,index:y.props.index,path:y.props.path,middleware:y.props.middleware,loader:y.props.loader,action:y.props.action,hydrateFallbackElement:y.props.hydrateFallbackElement,HydrateFallback:y.props.HydrateFallback,errorElement:y.props.errorElement,ErrorBoundary:y.props.ErrorBoundary,hasErrorBoundary:y.props.hasErrorBoundary===!0||y.props.ErrorBoundary!=null||y.props.errorElement!=null,shouldRevalidate:y.props.shouldRevalidate,handle:y.props.handle,lazy:y.props.lazy};y.props.children&&(O.children=g1(y.props.children,E)),d.push(O)}),d}var tu="get",nu="application/x-www-form-urlencoded";function uu(f){return f!=null&&typeof f.tagName=="string"}function Cx(f){return uu(f)&&f.tagName.toLowerCase()==="button"}function wx(f){return uu(f)&&f.tagName.toLowerCase()==="form"}function Sx(f){return uu(f)&&f.tagName.toLowerCase()==="input"}function bx(f){return!!(f.metaKey||f.altKey||f.ctrlKey||f.shiftKey)}function Tx(f,g){return f.button===0&&(!g||g==="_self")&&!bx(f)}var eu=null;function vx(){if(eu===null)try{new FormData(document.createElement("form"),0),eu=!1}catch{eu=!0}return eu}var Nx=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function h1(f){return f!=null&&!Nx.has(f)?(Mi(!1,`"${f}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nu}"`),null):f}function Mx(f,g){let d,y,C,E,O;if(wx(f)){let R=f.getAttribute("action");y=R?va(R,g):null,d=f.getAttribute("method")||tu,C=h1(f.getAttribute("enctype"))||nu,E=new FormData(f)}else if(Cx(f)||Sx(f)&&(f.type==="submit"||f.type==="image")){let R=f.form;if(R==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let b=f.getAttribute("formaction")||R.getAttribute("action");if(y=b?va(b,g):null,d=f.getAttribute("formmethod")||R.getAttribute("method")||tu,C=h1(f.getAttribute("formenctype"))||h1(R.getAttribute("enctype"))||nu,E=new FormData(R,f),!vx()){let{name:A,type:N,value:M}=f;if(N==="image"){let H=A?`${A}.`:"";E.append(`${H}x`,"0"),E.append(`${H}y`,"0")}else A&&E.append(A,M)}}else{if(uu(f))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');d=tu,y=null,C=nu,O=f}return E&&C==="text/plain"&&(O=E,E=void 0),{action:y,method:d.toLowerCase(),encType:C,formData:E,body:O}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function b1(f,g){if(f===!1||f===null||typeof f>"u")throw new Error(g)}function Ix(f,g,d){let y=typeof f=="string"?new URL(f,typeof window>"u"?"server://singlefetch/":window.location.origin):f;return y.pathname==="/"?y.pathname=`_root.${d}`:g&&va(y.pathname,g)==="/"?y.pathname=`${g.replace(/\/$/,"")}/_root.${d}`:y.pathname=`${y.pathname.replace(/\/$/,"")}.${d}`,y}async function Ox(f,g){if(f.id in g)return g[f.id];try{let d=await import(f.module);return g[f.id]=d,d}catch(d){return console.error(`Error loading route module \`${f.module}\`, reloading page...`),console.error(d),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function _x(f){return f==null?!1:f.href==null?f.rel==="preload"&&typeof f.imageSrcSet=="string"&&typeof f.imageSizes=="string":typeof f.rel=="string"&&typeof f.href=="string"}async function Rx(f,g,d){let y=await Promise.all(f.map(async C=>{let E=g.routes[C.route.id];if(E){let O=await Ox(E,d);return O.links?O.links():[]}return[]}));return Ux(y.flat(1).filter(_x).filter(C=>C.rel==="stylesheet"||C.rel==="preload").map(C=>C.rel==="stylesheet"?{...C,rel:"prefetch",as:"style"}:{...C,rel:"prefetch"}))}function Qh(f,g,d,y,C,E){let O=(b,A)=>d[A]?b.route.id!==d[A].route.id:!0,R=(b,A)=>d[A].pathname!==b.pathname||d[A].route.path?.endsWith("*")&&d[A].params["*"]!==b.params["*"];return E==="assets"?g.filter((b,A)=>O(b,A)||R(b,A)):E==="data"?g.filter((b,A)=>{let N=y.routes[b.route.id];if(!N||!N.hasLoader)return!1;if(O(b,A)||R(b,A))return!0;if(b.route.shouldRevalidate){let M=b.route.shouldRevalidate({currentUrl:new URL(C.pathname+C.search+C.hash,window.origin),currentParams:d[0]?.params||{},nextUrl:new URL(f,window.origin),nextParams:b.params,defaultShouldRevalidate:!0});if(typeof M=="boolean")return M}return!0}):[]}function Dx(f,g,{includeHydrateFallback:d}={}){return Bx(f.map(y=>{let C=g.routes[y.route.id];if(!C)return[];let E=[C.module];return C.clientActionModule&&(E=E.concat(C.clientActionModule)),C.clientLoaderModule&&(E=E.concat(C.clientLoaderModule)),d&&C.hydrateFallbackModule&&(E=E.concat(C.hydrateFallbackModule)),C.imports&&(E=E.concat(C.imports)),E}).flat(1))}function Bx(f){return[...new Set(f)]}function Lx(f){let g={},d=Object.keys(f).sort();for(let y of d)g[y]=f[y];return g}function Ux(f,g){let d=new Set;return new Set(g),f.reduce((y,C)=>{let E=JSON.stringify(Lx(C));return d.has(E)||(d.add(E),y.push({key:E,link:C})),y},[])}function bd(){let f=te.useContext(Ol);return b1(f,"You must render this element inside a <DataRouterContext.Provider> element"),f}function zx(){let f=te.useContext(su);return b1(f,"You must render this element inside a <DataRouterStateContext.Provider> element"),f}var T1=te.createContext(void 0);T1.displayName="FrameworkContext";function Td(){let f=te.useContext(T1);return b1(f,"You must render this element inside a <HydratedRouter> element"),f}function kx(f,g){let d=te.useContext(T1),[y,C]=te.useState(!1),[E,O]=te.useState(!1),{onFocus:R,onBlur:b,onMouseEnter:A,onMouseLeave:N,onTouchStart:M}=g,H=te.useRef(null);te.useEffect(()=>{if(f==="render"&&O(!0),f==="viewport"){let ie=pe=>{pe.forEach(de=>{O(de.isIntersecting)})},ae=new IntersectionObserver(ie,{threshold:.5});return H.current&&ae.observe(H.current),()=>{ae.disconnect()}}},[f]),te.useEffect(()=>{if(y){let ie=setTimeout(()=>{O(!0)},100);return()=>{clearTimeout(ie)}}},[y]);let Z=()=>{C(!0)},ee=()=>{C(!1),O(!1)};return d?f!=="intent"?[E,H,{}]:[E,H,{onFocus:Ns(R,Z),onBlur:Ns(b,ee),onMouseEnter:Ns(A,Z),onMouseLeave:Ns(N,ee),onTouchStart:Ns(M,Z)}]:[!1,H,{}]}function Ns(f,g){return d=>{f&&f(d),d.defaultPrevented||g(d)}}function Fx({page:f,...g}){let{router:d}=bd(),y=te.useMemo(()=>gd(d.routes,f,d.basename),[d.routes,f,d.basename]);return y?te.createElement(jx,{page:f,matches:y,...g}):null}function Hx(f){let{manifest:g,routeModules:d}=Td(),[y,C]=te.useState([]);return te.useEffect(()=>{let E=!1;return Rx(f,g,d).then(O=>{E||C(O)}),()=>{E=!0}},[f,g,d]),y}function jx({page:f,matches:g,...d}){let y=Na(),{manifest:C,routeModules:E}=Td(),{basename:O}=bd(),{loaderData:R,matches:b}=zx(),A=te.useMemo(()=>Qh(f,g,b,C,y,"data"),[f,g,b,C,y]),N=te.useMemo(()=>Qh(f,g,b,C,y,"assets"),[f,g,b,C,y]),M=te.useMemo(()=>{if(f===y.pathname+y.search+y.hash)return[];let ee=new Set,ie=!1;if(g.forEach(pe=>{let de=C.routes[pe.route.id];!de||!de.hasLoader||(!A.some(ne=>ne.route.id===pe.route.id)&&pe.route.id in R&&E[pe.route.id]?.shouldRevalidate||de.hasClientLoader?ie=!0:ee.add(pe.route.id))}),ee.size===0)return[];let ae=Ix(f,O,"data");return ie&&ee.size>0&&ae.searchParams.set("_routes",g.filter(pe=>ee.has(pe.route.id)).map(pe=>pe.route.id).join(",")),[ae.pathname+ae.search]},[O,R,y,C,A,g,f,E]),H=te.useMemo(()=>Dx(N,C),[N,C]),Z=Hx(N);return te.createElement(te.Fragment,null,M.map(ee=>te.createElement("link",{key:ee,rel:"prefetch",as:"fetch",href:ee,...d})),H.map(ee=>te.createElement("link",{key:ee,rel:"modulepreload",href:ee,...d})),Z.map(({key:ee,link:ie})=>te.createElement("link",{key:ee,nonce:d.nonce,...ie})))}function Px(...f){return g=>{f.forEach(d=>{typeof d=="function"?d(g):d!=null&&(d.current=g)})}}var vd=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{vd&&(window.__reactRouterVersion="7.9.6")}catch{}function Yx({basename:f,children:g,window:d}){let y=te.useRef();y.current==null&&(y.current=Ng({window:d,v5Compat:!0}));let C=y.current,[E,O]=te.useState({action:C.action,location:C.location}),R=te.useCallback(b=>{te.startTransition(()=>O(b))},[O]);return te.useLayoutEffect(()=>C.listen(R),[C,R]),te.createElement(Ax,{basename:f,children:g,location:E.location,navigationType:E.action,navigator:C})}var Nd=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hr=te.forwardRef(function({onClick:g,discover:d="render",prefetch:y="none",relative:C,reloadDocument:E,replace:O,state:R,target:b,to:A,preventScrollReset:N,viewTransition:M,...H},Z){let{basename:ee}=te.useContext(Hi),ie=typeof A=="string"&&Nd.test(A),ae,pe=!1;if(typeof A=="string"&&ie&&(ae=A,vd))try{let fe=new URL(window.location.href),Gt=A.startsWith("//")?new URL(fe.protocol+A):new URL(A),Ze=va(Gt.pathname,ee);Gt.origin===fe.origin&&Ze!=null?A=Ze+Gt.search+Gt.hash:pe=!0}catch{Mi(!1,`<Link to="${A}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let de=tx(A,{relative:C}),[ne,we,Pe]=kx(y,H),Be=Zx(A,{replace:O,state:R,target:b,preventScrollReset:N,relative:C,viewTransition:M});function le(fe){g&&g(fe),fe.defaultPrevented||Be(fe)}let Re=te.createElement("a",{...H,...Pe,href:ae||de,onClick:pe||E?g:le,ref:Px(Z,we),target:b,"data-discover":!ie&&d==="render"?"true":void 0});return ne&&!ie?te.createElement(te.Fragment,null,Re,te.createElement(Fx,{page:de})):Re});Hr.displayName="Link";var Gx=te.forwardRef(function({"aria-current":g="page",caseSensitive:d=!1,className:y="",end:C=!1,style:E,to:O,viewTransition:R,children:b,...A},N){let M=_s(O,{relative:A.relative}),H=Na(),Z=te.useContext(su),{navigator:ee,basename:ie}=te.useContext(Hi),ae=Z!=null&&Jx(M)&&R===!0,pe=ee.encodeLocation?ee.encodeLocation(M).pathname:M.pathname,de=H.pathname,ne=Z&&Z.navigation&&Z.navigation.location?Z.navigation.location.pathname:null;d||(de=de.toLowerCase(),ne=ne?ne.toLowerCase():null,pe=pe.toLowerCase()),ne&&ie&&(ne=va(ne,ie)||ne);const we=pe!=="/"&&pe.endsWith("/")?pe.length-1:pe.length;let Pe=de===pe||!C&&de.startsWith(pe)&&de.charAt(we)==="/",Be=ne!=null&&(ne===pe||!C&&ne.startsWith(pe)&&ne.charAt(pe.length)==="/"),le={isActive:Pe,isPending:Be,isTransitioning:ae},Re=Pe?g:void 0,fe;typeof y=="function"?fe=y(le):fe=[y,Pe?"active":null,Be?"pending":null,ae?"transitioning":null].filter(Boolean).join(" ");let Gt=typeof E=="function"?E(le):E;return te.createElement(Hr,{...A,"aria-current":Re,className:fe,ref:N,style:Gt,to:O,viewTransition:R},typeof b=="function"?b(le):b)});Gx.displayName="NavLink";var Vx=te.forwardRef(({discover:f="render",fetcherKey:g,navigate:d,reloadDocument:y,replace:C,state:E,method:O=tu,action:R,onSubmit:b,relative:A,preventScrollReset:N,viewTransition:M,...H},Z)=>{let ee=Wx(),ie=Kx(R,{relative:A}),ae=O.toLowerCase()==="get"?"get":"post",pe=typeof R=="string"&&Nd.test(R),de=ne=>{if(b&&b(ne),ne.defaultPrevented)return;ne.preventDefault();let we=ne.nativeEvent.submitter,Pe=we?.getAttribute("formmethod")||O;ee(we||ne.currentTarget,{fetcherKey:g,method:Pe,navigate:d,replace:C,state:E,relative:A,preventScrollReset:N,viewTransition:M})};return te.createElement("form",{ref:Z,method:ae,action:ie,onSubmit:y?b:de,...H,"data-discover":!pe&&f==="render"?"true":void 0})});Vx.displayName="Form";function Xx(f){return`${f} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Md(f){let g=te.useContext(Ol);return Qt(g,Xx(f)),g}function Zx(f,{target:g,replace:d,state:y,preventScrollReset:C,relative:E,viewTransition:O}={}){let R=ou(),b=Na(),A=_s(f,{relative:E});return te.useCallback(N=>{if(Tx(N,g)){N.preventDefault();let M=d!==void 0?d:Is(b)===Is(A);R(f,{replace:M,state:y,preventScrollReset:C,relative:E,viewTransition:O})}},[b,R,A,d,y,g,f,C,E,O])}var Qx=0,qx=()=>`__${String(++Qx)}__`;function Wx(){let{router:f}=Md("useSubmit"),{basename:g}=te.useContext(Hi),d=gx();return te.useCallback(async(y,C={})=>{let{action:E,method:O,encType:R,formData:b,body:A}=Mx(y,g);if(C.navigate===!1){let N=C.fetcherKey||qx();await f.fetch(N,d,C.action||E,{preventScrollReset:C.preventScrollReset,formData:b,body:A,formMethod:C.method||O,formEncType:C.encType||R,flushSync:C.flushSync})}else await f.navigate(C.action||E,{preventScrollReset:C.preventScrollReset,formData:b,body:A,formMethod:C.method||O,formEncType:C.encType||R,replace:C.replace,state:C.state,fromRouteId:d,flushSync:C.flushSync,viewTransition:C.viewTransition})},[f,g,d])}function Kx(f,{relative:g}={}){let{basename:d}=te.useContext(Hi),y=te.useContext(ji);Qt(y,"useFormAction must be used inside a RouteContext");let[C]=y.matches.slice(-1),E={..._s(f||".",{relative:g})},O=Na();if(f==null){E.search=O.search;let R=new URLSearchParams(E.search),b=R.getAll("index");if(b.some(N=>N==="")){R.delete("index"),b.filter(M=>M).forEach(M=>R.append("index",M));let N=R.toString();E.search=N?`?${N}`:""}}return(!f||f===".")&&C.route.index&&(E.search=E.search?E.search.replace(/^\?/,"?index&"):"?index"),d!=="/"&&(E.pathname=E.pathname==="/"?d:Ta([d,E.pathname])),Is(E)}function Jx(f,{relative:g}={}){let d=te.useContext(pd);Qt(d!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:y}=Md("useViewTransitionState"),C=_s(f,{relative:g});if(!d.isTransitioning)return!1;let E=va(d.currentLocation.pathname,y)||d.currentLocation.pathname,O=va(d.nextLocation.pathname,y)||d.nextLocation.pathname;return iu(C.pathname,O)!=null||iu(C.pathname,E)!=null}const $x=f=>f.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),em=f=>f.replace(/^([A-Z])|[\s-_]+(\w)/g,(g,d,y)=>y?y.toUpperCase():d.toLowerCase()),qh=f=>{const g=em(f);return g.charAt(0).toUpperCase()+g.slice(1)},Id=(...f)=>f.filter((g,d,y)=>!!g&&g.trim()!==""&&y.indexOf(g)===d).join(" ").trim(),tm=f=>{for(const g in f)if(g.startsWith("aria-")||g==="role"||g==="title")return!0};var nm={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const im=te.forwardRef(({color:f="currentColor",size:g=24,strokeWidth:d=2,absoluteStrokeWidth:y,className:C="",children:E,iconNode:O,...R},b)=>te.createElement("svg",{ref:b,...nm,width:g,height:g,stroke:f,strokeWidth:y?Number(d)*24/Number(g):d,className:Id("lucide",C),...!E&&!tm(R)&&{"aria-hidden":"true"},...R},[...O.map(([A,N])=>te.createElement(A,N)),...Array.isArray(E)?E:[E]]));const gi=(f,g)=>{const d=te.forwardRef(({className:y,...C},E)=>te.createElement(im,{ref:E,iconNode:g,className:Id(`lucide-${$x(qh(f))}`,`lucide-${f}`,y),...C}));return d.displayName=qh(f),d};const am=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],rm=gi("calendar",am);const lm=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],sm=gi("circle-check-big",lm);const om=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],um=gi("circle-x",om);const cm=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],fm=gi("lock",cm);const hm=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],dm=gi("log-out",hm);const gm=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Od=gi("mail",gm);const xm=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],mm=gi("plus",xm);const ym=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],v1=gi("qr-code",ym);const pm=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],_d=gi("refresh-cw",pm);const Am=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Em=gi("save",Am);const Cm=[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]],wm=gi("scan",Cm);const Sm=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],bm=gi("trash-2",Sm);const Tm=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],vm=gi("users",Tm),Rd=te.createContext(null),Nm=({children:f})=>{const[g,d]=te.useState(!1),[y,C]=te.useState(!0);te.useEffect(()=>{sessionStorage.getItem("eventqr_token")&&d(!0),C(!1)},[]);const E=async R=>{try{const b=await fetch("/api/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:R})});if(b.ok){const A=await b.json();if(A.accessToken)return sessionStorage.setItem("eventqr_token",A.accessToken),d(!0),!0}return!1}catch(b){return console.error("Login failed:",b),!1}},O=()=>{sessionStorage.removeItem("eventqr_token"),d(!1),fetch("/api/logout",{method:"POST"})};return y?null:G.jsx(Rd.Provider,{value:{isAuthenticated:g,login:E,logout:O},children:f})},N1=()=>{const f=te.useContext(Rd);if(!f)throw new Error("useAuth must be used within an AuthProvider");return f},Mm=()=>{const f=Na(),g=ou(),{logout:d}=N1(),y=E=>f.pathname===E,C=()=>{d(),g("/login")};return G.jsxs("div",{className:"min-h-screen flex flex-col",children:[G.jsx("nav",{className:"glass-panel sticky top-0 z-50 border-x-0 border-t-0 rounded-none",children:G.jsxs("div",{className:"container py-4 flex justify-between items-center",children:[G.jsxs(Hr,{to:"/",className:"text-2xl font-bold bg-clip-text text-transparent bg-gradient-to-r from-indigo-400 to-purple-400 flex items-center gap-2",children:[G.jsx(v1,{className:"text-indigo-400"}),"EventQR"]}),G.jsxs("div",{className:"flex gap-6 items-center",children:[G.jsxs(Hr,{to:"/",className:`flex items-center gap-2 hover:text-indigo-400 transition-colors ${y("/")?"text-indigo-400":"text-slate-400"}`,children:[G.jsx(rm,{size:20}),G.jsx("span",{className:"hidden sm:inline",children:"Events"})]}),G.jsxs(Hr,{to:"/generate",className:`flex items-center gap-2 hover:text-indigo-400 transition-colors ${y("/generate")?"text-indigo-400":"text-slate-400"}`,children:[G.jsx(Od,{size:20}),G.jsx("span",{className:"hidden sm:inline",children:"Generate"})]}),G.jsxs(Hr,{to:"/scan",className:`flex items-center gap-2 hover:text-indigo-400 transition-colors ${y("/scan")?"text-indigo-400":"text-slate-400"}`,children:[G.jsx(wm,{size:20}),G.jsx("span",{className:"hidden sm:inline",children:"Scan"})]}),G.jsx("div",{className:"w-px h-6 bg-slate-700 mx-2"}),G.jsx("button",{onClick:C,className:"flex items-center gap-2 text-slate-400 hover:text-red-400 transition-colors",title:"Logout",children:G.jsx(dm,{size:20})})]})]})}),G.jsx("main",{className:"flex-1 container py-8 page-transition",children:G.jsx(Sd,{})}),G.jsx("footer",{className:"py-6 text-center text-slate-600 text-sm",children:G.jsx("p",{children:"© 2024 EventQR Tool. Built for seamless event management."})})]})},Rs="/api",Ds=()=>{const f=sessionStorage.getItem("eventqr_token");return{"Content-Type":"application/json",...f?{Authorization:`Bearer ${f}`}:{}}},Dd=async f=>{const g=await fetch(`${Rs}/tickets?eventId=${f}`,{headers:Ds()});if(!g.ok)throw new Error("Failed to fetch tickets");return g.json()},Im=async f=>{const g=await fetch(`${Rs}/tickets`,{method:"POST",headers:Ds(),body:JSON.stringify(f)});if(!g.ok)throw new Error("Failed to save ticket");return g.json()},Om=async f=>{if(!(await fetch(`${Rs}/tickets/${f}/resend`,{method:"POST",headers:Ds()})).ok)throw new Error("Failed to resend ticket email")},_m=async(f,g)=>{const d=await fetch(`${Rs}/tickets/${f}/status`,{method:"PUT",headers:Ds(),body:JSON.stringify({status:g})});if(!d.ok)throw new Error("Failed to update ticket status");return d.json()},Rm=async f=>{if(!(await fetch(`${Rs}/tickets/${f}`,{method:"DELETE",headers:Ds()})).ok)throw new Error("Failed to delete ticket")},Dm=()=>{const[f,g]=te.useState([]),[d,y]=te.useState(!0),[C,E]=te.useState(null);te.useEffect(()=>{(async()=>{try{y(!0);const b=await Dd("default-event");g(b)}catch(b){E("Failed to load tickets."),console.error(b)}finally{y(!1)}})()},[]);const O=async R=>{if(window.confirm("Are you sure you want to delete this ticket?"))try{await Rm(R),g(f.filter(b=>b.id!==R))}catch(b){alert("Failed to delete ticket."),console.error(b)}};return G.jsxs("div",{className:"space-y-8",children:[G.jsxs("header",{className:"flex justify-between items-end",children:[G.jsxs("div",{children:[G.jsx("h1",{className:"text-4xl font-bold mb-2",children:"Dashboard"}),G.jsx("p",{className:"text-slate-400",children:"Manage your events and attendees"})]}),G.jsxs(Hr,{to:"/generate",className:"btn-primary",children:[G.jsx(mm,{size:20}),"New Ticket"]})]}),G.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[G.jsx("div",{className:"glass-panel p-6",children:G.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[G.jsx("div",{className:"p-3 bg-indigo-500/20 rounded-lg text-indigo-400",children:G.jsx(vm,{size:24})}),G.jsxs("div",{children:[G.jsx("p",{className:"text-sm text-slate-400",children:"Total Attendees"}),G.jsx("p",{className:"text-2xl font-bold",children:f.length})]})]})}),G.jsx("div",{className:"glass-panel p-6",children:G.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[G.jsx("div",{className:"p-3 bg-purple-500/20 rounded-lg text-purple-400",children:G.jsx(v1,{size:24})}),G.jsxs("div",{children:[G.jsx("p",{className:"text-sm text-slate-400",children:"Scanned Tickets"}),G.jsx("p",{className:"text-2xl font-bold",children:f.filter(R=>R.status==="used").length})]})]})})]}),G.jsxs("div",{className:"glass-panel p-6",children:[G.jsx("h2",{className:"text-xl font-bold mb-4",children:"Recent Tickets"}),d?G.jsx("div",{className:"text-center py-8 text-slate-500",children:"Loading tickets..."}):C?G.jsx("div",{className:"text-center py-8 text-red-500",children:C}):f.length===0?G.jsx("div",{className:"text-center py-8 text-slate-500",children:"No tickets generated yet."}):G.jsx("div",{className:"overflow-x-auto",children:G.jsxs("table",{className:"w-full text-left border-collapse",children:[G.jsx("thead",{children:G.jsxs("tr",{className:"text-slate-400 border-b border-slate-700",children:[G.jsx("th",{className:"p-4",children:"Name"}),G.jsx("th",{className:"p-4",children:"Email"}),G.jsx("th",{className:"p-4",children:"Type"}),G.jsx("th",{className:"p-4",children:"Status"}),G.jsx("th",{className:"p-4 text-right",children:"Actions"})]})}),G.jsx("tbody",{children:f.slice().reverse().map(R=>G.jsxs("tr",{className:"border-b border-slate-800 hover:bg-slate-800/50",children:[G.jsx("td",{className:"p-4 font-medium",children:R.attendeeName}),G.jsx("td",{className:"p-4 text-slate-400",children:R.attendeeEmail}),G.jsx("td",{className:"p-4",children:G.jsx("span",{className:`px-2 py-1 rounded-full text-xs ${R.ticketType==="Partyborner"?"bg-amber-500/20 text-amber-400":"bg-blue-500/20 text-blue-400"}`,children:R.ticketType})}),G.jsx("td",{className:"p-4",children:G.jsx("span",{className:`px-2 py-1 rounded-full text-xs ${R.status==="valid"?"bg-green-500/20 text-green-400":"bg-slate-500/20 text-slate-400"}`,children:R.status})}),G.jsx("td",{className:"p-4 text-right",children:G.jsx("button",{onClick:()=>O(R.id),className:"text-slate-500 hover:text-red-400 transition-colors p-2",title:"Delete Ticket",children:G.jsx(bm,{size:18})})})]},R.id))})]})})]})]})};var Bm=Object.defineProperty,au=Object.getOwnPropertySymbols,Bd=Object.prototype.hasOwnProperty,Ld=Object.prototype.propertyIsEnumerable,Wh=(f,g,d)=>g in f?Bm(f,g,{enumerable:!0,configurable:!0,writable:!0,value:d}):f[g]=d,x1=(f,g)=>{for(var d in g||(g={}))Bd.call(g,d)&&Wh(f,d,g[d]);if(au)for(var d of au(g))Ld.call(g,d)&&Wh(f,d,g[d]);return f},m1=(f,g)=>{var d={};for(var y in f)Bd.call(f,y)&&g.indexOf(y)<0&&(d[y]=f[y]);if(f!=null&&au)for(var y of au(f))g.indexOf(y)<0&&Ld.call(f,y)&&(d[y]=f[y]);return d};var jr;(f=>{const g=class it{constructor(b,A,N,M){if(this.version=b,this.errorCorrectionLevel=A,this.modules=[],this.isFunction=[],b<it.MIN_VERSION||b>it.MAX_VERSION)throw new RangeError("Version value out of range");if(M<-1||M>7)throw new RangeError("Mask value out of range");this.size=b*4+17;let H=[];for(let ee=0;ee<this.size;ee++)H.push(!1);for(let ee=0;ee<this.size;ee++)this.modules.push(H.slice()),this.isFunction.push(H.slice());this.drawFunctionPatterns();const Z=this.addEccAndInterleave(N);if(this.drawCodewords(Z),M==-1){let ee=1e9;for(let ie=0;ie<8;ie++){this.applyMask(ie),this.drawFormatBits(ie);const ae=this.getPenaltyScore();ae<ee&&(M=ie,ee=ae),this.applyMask(ie)}}C(0<=M&&M<=7),this.mask=M,this.applyMask(M),this.drawFormatBits(M),this.isFunction=[]}static encodeText(b,A){const N=f.QrSegment.makeSegments(b);return it.encodeSegments(N,A)}static encodeBinary(b,A){const N=f.QrSegment.makeBytes(b);return it.encodeSegments([N],A)}static encodeSegments(b,A,N=1,M=40,H=-1,Z=!0){if(!(it.MIN_VERSION<=N&&N<=M&&M<=it.MAX_VERSION)||H<-1||H>7)throw new RangeError("Invalid value");let ee,ie;for(ee=N;;ee++){const ne=it.getNumDataCodewords(ee,A)*8,we=O.getTotalBits(b,ee);if(we<=ne){ie=we;break}if(ee>=M)throw new RangeError("Data too long")}for(const ne of[it.Ecc.MEDIUM,it.Ecc.QUARTILE,it.Ecc.HIGH])Z&&ie<=it.getNumDataCodewords(ee,ne)*8&&(A=ne);let ae=[];for(const ne of b){d(ne.mode.modeBits,4,ae),d(ne.numChars,ne.mode.numCharCountBits(ee),ae);for(const we of ne.getData())ae.push(we)}C(ae.length==ie);const pe=it.getNumDataCodewords(ee,A)*8;C(ae.length<=pe),d(0,Math.min(4,pe-ae.length),ae),d(0,(8-ae.length%8)%8,ae),C(ae.length%8==0);for(let ne=236;ae.length<pe;ne^=253)d(ne,8,ae);let de=[];for(;de.length*8<ae.length;)de.push(0);return ae.forEach((ne,we)=>de[we>>>3]|=ne<<7-(we&7)),new it(ee,A,de,H)}getModule(b,A){return 0<=b&&b<this.size&&0<=A&&A<this.size&&this.modules[A][b]}getModules(){return this.modules}drawFunctionPatterns(){for(let N=0;N<this.size;N++)this.setFunctionModule(6,N,N%2==0),this.setFunctionModule(N,6,N%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const b=this.getAlignmentPatternPositions(),A=b.length;for(let N=0;N<A;N++)for(let M=0;M<A;M++)N==0&&M==0||N==0&&M==A-1||N==A-1&&M==0||this.drawAlignmentPattern(b[N],b[M]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(b){const A=this.errorCorrectionLevel.formatBits<<3|b;let N=A;for(let H=0;H<10;H++)N=N<<1^(N>>>9)*1335;const M=(A<<10|N)^21522;C(M>>>15==0);for(let H=0;H<=5;H++)this.setFunctionModule(8,H,y(M,H));this.setFunctionModule(8,7,y(M,6)),this.setFunctionModule(8,8,y(M,7)),this.setFunctionModule(7,8,y(M,8));for(let H=9;H<15;H++)this.setFunctionModule(14-H,8,y(M,H));for(let H=0;H<8;H++)this.setFunctionModule(this.size-1-H,8,y(M,H));for(let H=8;H<15;H++)this.setFunctionModule(8,this.size-15+H,y(M,H));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let b=this.version;for(let N=0;N<12;N++)b=b<<1^(b>>>11)*7973;const A=this.version<<12|b;C(A>>>18==0);for(let N=0;N<18;N++){const M=y(A,N),H=this.size-11+N%3,Z=Math.floor(N/3);this.setFunctionModule(H,Z,M),this.setFunctionModule(Z,H,M)}}drawFinderPattern(b,A){for(let N=-4;N<=4;N++)for(let M=-4;M<=4;M++){const H=Math.max(Math.abs(M),Math.abs(N)),Z=b+M,ee=A+N;0<=Z&&Z<this.size&&0<=ee&&ee<this.size&&this.setFunctionModule(Z,ee,H!=2&&H!=4)}}drawAlignmentPattern(b,A){for(let N=-2;N<=2;N++)for(let M=-2;M<=2;M++)this.setFunctionModule(b+M,A+N,Math.max(Math.abs(M),Math.abs(N))!=1)}setFunctionModule(b,A,N){this.modules[A][b]=N,this.isFunction[A][b]=!0}addEccAndInterleave(b){const A=this.version,N=this.errorCorrectionLevel;if(b.length!=it.getNumDataCodewords(A,N))throw new RangeError("Invalid argument");const M=it.NUM_ERROR_CORRECTION_BLOCKS[N.ordinal][A],H=it.ECC_CODEWORDS_PER_BLOCK[N.ordinal][A],Z=Math.floor(it.getNumRawDataModules(A)/8),ee=M-Z%M,ie=Math.floor(Z/M);let ae=[];const pe=it.reedSolomonComputeDivisor(H);for(let ne=0,we=0;ne<M;ne++){let Pe=b.slice(we,we+ie-H+(ne<ee?0:1));we+=Pe.length;const Be=it.reedSolomonComputeRemainder(Pe,pe);ne<ee&&Pe.push(0),ae.push(Pe.concat(Be))}let de=[];for(let ne=0;ne<ae[0].length;ne++)ae.forEach((we,Pe)=>{(ne!=ie-H||Pe>=ee)&&de.push(we[ne])});return C(de.length==Z),de}drawCodewords(b){if(b.length!=Math.floor(it.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let A=0;for(let N=this.size-1;N>=1;N-=2){N==6&&(N=5);for(let M=0;M<this.size;M++)for(let H=0;H<2;H++){const Z=N-H,ie=(N+1&2)==0?this.size-1-M:M;!this.isFunction[ie][Z]&&A<b.length*8&&(this.modules[ie][Z]=y(b[A>>>3],7-(A&7)),A++)}}C(A==b.length*8)}applyMask(b){if(b<0||b>7)throw new RangeError("Mask value out of range");for(let A=0;A<this.size;A++)for(let N=0;N<this.size;N++){let M;switch(b){case 0:M=(N+A)%2==0;break;case 1:M=A%2==0;break;case 2:M=N%3==0;break;case 3:M=(N+A)%3==0;break;case 4:M=(Math.floor(N/3)+Math.floor(A/2))%2==0;break;case 5:M=N*A%2+N*A%3==0;break;case 6:M=(N*A%2+N*A%3)%2==0;break;case 7:M=((N+A)%2+N*A%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[A][N]&&M&&(this.modules[A][N]=!this.modules[A][N])}}getPenaltyScore(){let b=0;for(let H=0;H<this.size;H++){let Z=!1,ee=0,ie=[0,0,0,0,0,0,0];for(let ae=0;ae<this.size;ae++)this.modules[H][ae]==Z?(ee++,ee==5?b+=it.PENALTY_N1:ee>5&&b++):(this.finderPenaltyAddHistory(ee,ie),Z||(b+=this.finderPenaltyCountPatterns(ie)*it.PENALTY_N3),Z=this.modules[H][ae],ee=1);b+=this.finderPenaltyTerminateAndCount(Z,ee,ie)*it.PENALTY_N3}for(let H=0;H<this.size;H++){let Z=!1,ee=0,ie=[0,0,0,0,0,0,0];for(let ae=0;ae<this.size;ae++)this.modules[ae][H]==Z?(ee++,ee==5?b+=it.PENALTY_N1:ee>5&&b++):(this.finderPenaltyAddHistory(ee,ie),Z||(b+=this.finderPenaltyCountPatterns(ie)*it.PENALTY_N3),Z=this.modules[ae][H],ee=1);b+=this.finderPenaltyTerminateAndCount(Z,ee,ie)*it.PENALTY_N3}for(let H=0;H<this.size-1;H++)for(let Z=0;Z<this.size-1;Z++){const ee=this.modules[H][Z];ee==this.modules[H][Z+1]&&ee==this.modules[H+1][Z]&&ee==this.modules[H+1][Z+1]&&(b+=it.PENALTY_N2)}let A=0;for(const H of this.modules)A=H.reduce((Z,ee)=>Z+(ee?1:0),A);const N=this.size*this.size,M=Math.ceil(Math.abs(A*20-N*10)/N)-1;return C(0<=M&&M<=9),b+=M*it.PENALTY_N4,C(0<=b&&b<=2568888),b}getAlignmentPatternPositions(){if(this.version==1)return[];{const b=Math.floor(this.version/7)+2,A=this.version==32?26:Math.ceil((this.version*4+4)/(b*2-2))*2;let N=[6];for(let M=this.size-7;N.length<b;M-=A)N.splice(1,0,M);return N}}static getNumRawDataModules(b){if(b<it.MIN_VERSION||b>it.MAX_VERSION)throw new RangeError("Version number out of range");let A=(16*b+128)*b+64;if(b>=2){const N=Math.floor(b/7)+2;A-=(25*N-10)*N-55,b>=7&&(A-=36)}return C(208<=A&&A<=29648),A}static getNumDataCodewords(b,A){return Math.floor(it.getNumRawDataModules(b)/8)-it.ECC_CODEWORDS_PER_BLOCK[A.ordinal][b]*it.NUM_ERROR_CORRECTION_BLOCKS[A.ordinal][b]}static reedSolomonComputeDivisor(b){if(b<1||b>255)throw new RangeError("Degree out of range");let A=[];for(let M=0;M<b-1;M++)A.push(0);A.push(1);let N=1;for(let M=0;M<b;M++){for(let H=0;H<A.length;H++)A[H]=it.reedSolomonMultiply(A[H],N),H+1<A.length&&(A[H]^=A[H+1]);N=it.reedSolomonMultiply(N,2)}return A}static reedSolomonComputeRemainder(b,A){let N=A.map(M=>0);for(const M of b){const H=M^N.shift();N.push(0),A.forEach((Z,ee)=>N[ee]^=it.reedSolomonMultiply(Z,H))}return N}static reedSolomonMultiply(b,A){if(b>>>8||A>>>8)throw new RangeError("Byte out of range");let N=0;for(let M=7;M>=0;M--)N=N<<1^(N>>>7)*285,N^=(A>>>M&1)*b;return C(N>>>8==0),N}finderPenaltyCountPatterns(b){const A=b[1];C(A<=this.size*3);const N=A>0&&b[2]==A&&b[3]==A*3&&b[4]==A&&b[5]==A;return(N&&b[0]>=A*4&&b[6]>=A?1:0)+(N&&b[6]>=A*4&&b[0]>=A?1:0)}finderPenaltyTerminateAndCount(b,A,N){return b&&(this.finderPenaltyAddHistory(A,N),A=0),A+=this.size,this.finderPenaltyAddHistory(A,N),this.finderPenaltyCountPatterns(N)}finderPenaltyAddHistory(b,A){A[0]==0&&(b+=this.size),A.pop(),A.unshift(b)}};g.MIN_VERSION=1,g.MAX_VERSION=40,g.PENALTY_N1=3,g.PENALTY_N2=3,g.PENALTY_N3=40,g.PENALTY_N4=10,g.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],g.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],f.QrCode=g;function d(R,b,A){if(b<0||b>31||R>>>b)throw new RangeError("Value out of range");for(let N=b-1;N>=0;N--)A.push(R>>>N&1)}function y(R,b){return(R>>>b&1)!=0}function C(R){if(!R)throw new Error("Assertion error")}const E=class tn{constructor(b,A,N){if(this.mode=b,this.numChars=A,this.bitData=N,A<0)throw new RangeError("Invalid argument");this.bitData=N.slice()}static makeBytes(b){let A=[];for(const N of b)d(N,8,A);return new tn(tn.Mode.BYTE,b.length,A)}static makeNumeric(b){if(!tn.isNumeric(b))throw new RangeError("String contains non-numeric characters");let A=[];for(let N=0;N<b.length;){const M=Math.min(b.length-N,3);d(parseInt(b.substring(N,N+M),10),M*3+1,A),N+=M}return new tn(tn.Mode.NUMERIC,b.length,A)}static makeAlphanumeric(b){if(!tn.isAlphanumeric(b))throw new RangeError("String contains unencodable characters in alphanumeric mode");let A=[],N;for(N=0;N+2<=b.length;N+=2){let M=tn.ALPHANUMERIC_CHARSET.indexOf(b.charAt(N))*45;M+=tn.ALPHANUMERIC_CHARSET.indexOf(b.charAt(N+1)),d(M,11,A)}return N<b.length&&d(tn.ALPHANUMERIC_CHARSET.indexOf(b.charAt(N)),6,A),new tn(tn.Mode.ALPHANUMERIC,b.length,A)}static makeSegments(b){return b==""?[]:tn.isNumeric(b)?[tn.makeNumeric(b)]:tn.isAlphanumeric(b)?[tn.makeAlphanumeric(b)]:[tn.makeBytes(tn.toUtf8ByteArray(b))]}static makeEci(b){let A=[];if(b<0)throw new RangeError("ECI assignment value out of range");if(b<128)d(b,8,A);else if(b<16384)d(2,2,A),d(b,14,A);else if(b<1e6)d(6,3,A),d(b,21,A);else throw new RangeError("ECI assignment value out of range");return new tn(tn.Mode.ECI,0,A)}static isNumeric(b){return tn.NUMERIC_REGEX.test(b)}static isAlphanumeric(b){return tn.ALPHANUMERIC_REGEX.test(b)}getData(){return this.bitData.slice()}static getTotalBits(b,A){let N=0;for(const M of b){const H=M.mode.numCharCountBits(A);if(M.numChars>=1<<H)return 1/0;N+=4+H+M.bitData.length}return N}static toUtf8ByteArray(b){b=encodeURI(b);let A=[];for(let N=0;N<b.length;N++)b.charAt(N)!="%"?A.push(b.charCodeAt(N)):(A.push(parseInt(b.substring(N+1,N+3),16)),N+=2);return A}};E.NUMERIC_REGEX=/^[0-9]*$/,E.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,E.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let O=E;f.QrSegment=E})(jr||(jr={}));(f=>{(g=>{const d=class{constructor(C,E){this.ordinal=C,this.formatBits=E}};d.LOW=new d(0,1),d.MEDIUM=new d(1,0),d.QUARTILE=new d(2,3),d.HIGH=new d(3,2),g.Ecc=d})(f.QrCode||(f.QrCode={}))})(jr||(jr={}));(f=>{(g=>{const d=class{constructor(C,E){this.modeBits=C,this.numBitsCharCount=E}numCharCountBits(C){return this.numBitsCharCount[Math.floor((C+7)/17)]}};d.NUMERIC=new d(1,[10,12,14]),d.ALPHANUMERIC=new d(2,[9,11,13]),d.BYTE=new d(4,[8,16,16]),d.KANJI=new d(8,[8,10,12]),d.ECI=new d(7,[0,0,0]),g.Mode=d})(f.QrSegment||(f.QrSegment={}))})(jr||(jr={}));var Nl=jr;var Lm={L:Nl.QrCode.Ecc.LOW,M:Nl.QrCode.Ecc.MEDIUM,Q:Nl.QrCode.Ecc.QUARTILE,H:Nl.QrCode.Ecc.HIGH},Ud=128,zd="L",kd="#FFFFFF",Fd="#000000",Hd=!1,jd=1,Um=4,zm=0,km=.1;function Pd(f,g=0){const d=[];return f.forEach(function(y,C){let E=null;y.forEach(function(O,R){if(!O&&E!==null){d.push(`M${E+g} ${C+g}h${R-E}v1H${E+g}z`),E=null;return}if(R===y.length-1){if(!O)return;E===null?d.push(`M${R+g},${C+g} h1v1H${R+g}z`):d.push(`M${E+g},${C+g} h${R+1-E}v1H${E+g}z`);return}O&&E===null&&(E=R)})}),d.join("")}function Yd(f,g){return f.slice().map((d,y)=>y<g.y||y>=g.y+g.h?d:d.map((C,E)=>E<g.x||E>=g.x+g.w?C:!1))}function Fm(f,g,d,y){if(y==null)return null;const C=f.length+d*2,E=Math.floor(g*km),O=C/g,R=(y.width||E)*O,b=(y.height||E)*O,A=y.x==null?f.length/2-R/2:y.x*O,N=y.y==null?f.length/2-b/2:y.y*O,M=y.opacity==null?1:y.opacity;let H=null;if(y.excavate){let ee=Math.floor(A),ie=Math.floor(N),ae=Math.ceil(R+A-ee),pe=Math.ceil(b+N-ie);H={x:ee,y:ie,w:ae,h:pe}}const Z=y.crossOrigin;return{x:A,y:N,h:b,w:R,excavation:H,opacity:M,crossOrigin:Z}}function Hm(f,g){return g!=null?Math.max(Math.floor(g),0):f?Um:zm}function Gd({value:f,level:g,minVersion:d,includeMargin:y,marginSize:C,imageSettings:E,size:O,boostLevel:R}){let b=wn.useMemo(()=>{const ee=(Array.isArray(f)?f:[f]).reduce((ie,ae)=>(ie.push(...Nl.QrSegment.makeSegments(ae)),ie),[]);return Nl.QrCode.encodeSegments(ee,Lm[g],d,void 0,void 0,R)},[f,g,d,R]);const{cells:A,margin:N,numCells:M,calculatedImageSettings:H}=wn.useMemo(()=>{let Z=b.getModules();const ee=Hm(y,C),ie=Z.length+ee*2,ae=Fm(Z,O,ee,E);return{cells:Z,margin:ee,numCells:ie,calculatedImageSettings:ae}},[b,O,E,y,C]);return{qrcode:b,margin:N,cells:A,numCells:M,calculatedImageSettings:H}}var jm=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),Pm=wn.forwardRef(function(g,d){const y=g,{value:C,size:E=Ud,level:O=zd,bgColor:R=kd,fgColor:b=Fd,includeMargin:A=Hd,minVersion:N=jd,boostLevel:M,marginSize:H,imageSettings:Z}=y,ie=m1(y,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:ae}=ie,pe=m1(ie,["style"]),de=Z?.src,ne=wn.useRef(null),we=wn.useRef(null),Pe=wn.useCallback(at=>{ne.current=at,typeof d=="function"?d(at):d&&(d.current=at)},[d]),[Be,le]=wn.useState(!1),{margin:Re,cells:fe,numCells:Gt,calculatedImageSettings:Ze}=Gd({value:C,level:O,minVersion:N,boostLevel:M,includeMargin:A,marginSize:H,imageSettings:Z,size:E});wn.useEffect(()=>{if(ne.current!=null){const at=ne.current,q=at.getContext("2d");if(!q)return;let J=fe;const oe=we.current,Oe=Ze!=null&&oe!==null&&oe.complete&&oe.naturalHeight!==0&&oe.naturalWidth!==0;Oe&&Ze.excavation!=null&&(J=Yd(fe,Ze.excavation));const Qe=window.devicePixelRatio||1;at.height=at.width=E*Qe;const Ke=E/Gt*Qe;q.scale(Ke,Ke),q.fillStyle=R,q.fillRect(0,0,Gt,Gt),q.fillStyle=b,jm?q.fill(new Path2D(Pd(J,Re))):fe.forEach(function(F,re){F.forEach(function(Ee,Ce){Ee&&q.fillRect(Ce+Re,re+Re,1,1)})}),Ze&&(q.globalAlpha=Ze.opacity),Oe&&q.drawImage(oe,Ze.x+Re,Ze.y+Re,Ze.w,Ze.h)}}),wn.useEffect(()=>{le(!1)},[de]);const Ne=x1({height:E,width:E},ae);let We=null;return de!=null&&(We=wn.createElement("img",{src:de,key:de,style:{display:"none"},onLoad:()=>{le(!0)},ref:we,crossOrigin:Ze?.crossOrigin})),wn.createElement(wn.Fragment,null,wn.createElement("canvas",x1({style:Ne,height:E,width:E,ref:Pe,role:"img"},pe)),We)});Pm.displayName="QRCodeCanvas";var Vd=wn.forwardRef(function(g,d){const y=g,{value:C,size:E=Ud,level:O=zd,bgColor:R=kd,fgColor:b=Fd,includeMargin:A=Hd,minVersion:N=jd,boostLevel:M,title:H,marginSize:Z,imageSettings:ee}=y,ie=m1(y,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:ae,cells:pe,numCells:de,calculatedImageSettings:ne}=Gd({value:C,level:O,minVersion:N,boostLevel:M,includeMargin:A,marginSize:Z,imageSettings:ee,size:E});let we=pe,Pe=null;ee!=null&&ne!=null&&(ne.excavation!=null&&(we=Yd(pe,ne.excavation)),Pe=wn.createElement("image",{href:ee.src,height:ne.h,width:ne.w,x:ne.x+ae,y:ne.y+ae,preserveAspectRatio:"none",opacity:ne.opacity,crossOrigin:ne.crossOrigin}));const Be=Pd(we,ae);return wn.createElement("svg",x1({height:E,width:E,viewBox:`0 0 ${de} ${de}`,ref:d,role:"img"},ie),!!H&&wn.createElement("title",null,H),wn.createElement("path",{fill:R,d:`M0,0 h${de}v${de}H0z`,shapeRendering:"crispEdges"}),wn.createElement("path",{fill:b,d:Be,shapeRendering:"crispEdges"}),Pe)});Vd.displayName="QRCodeSVG";const Ym=()=>{const[f,g]=te.useState({name:"",email:"",type:"Klassenbester"}),[d,y]=te.useState(null),[C,E]=te.useState(!1),[O,R]=te.useState("idle"),b=async M=>{M.preventDefault(),E(!0);try{const H={eventId:"default-event",attendeeName:f.name,attendeeEmail:f.email,ticketType:f.type},Z=await Im(H);y(Z),R("idle")}catch(H){console.error(H),alert("Failed to generate ticket. Please try again.")}finally{E(!1)}},A=async()=>{if(d){R("sending");try{await Om(d.id),R("sent"),setTimeout(()=>R("idle"),3e3)}catch(M){console.error(M),R("error")}}},N=()=>{y(null),g({name:"",email:"",type:"Klassenbester"}),R("idle")};return G.jsxs("div",{className:"max-w-4xl mx-auto grid grid-cols-1 md:grid-cols-2 gap-8",children:[G.jsxs("div",{className:"space-y-6",children:[G.jsxs("div",{children:[G.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Generate Ticket"}),G.jsx("p",{className:"text-slate-400",children:"Create a new QR code ticket for an attendee."})]}),G.jsxs("form",{onSubmit:b,className:"glass-panel p-6 space-y-4",children:[G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium mb-2 text-slate-300",children:"Attendee Name"}),G.jsx("input",{required:!0,type:"text",value:f.name,onChange:M=>g({...f,name:M.target.value}),placeholder:"John Doe"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium mb-2 text-slate-300",children:"Email Address"}),G.jsx("input",{required:!0,type:"email",value:f.email,onChange:M=>g({...f,email:M.target.value}),placeholder:"john@example.com"})]}),G.jsxs("div",{children:[G.jsx("label",{className:"block text-sm font-medium mb-2 text-slate-300",children:"Ticket Type"}),G.jsxs("select",{value:f.type,onChange:M=>g({...f,type:M.target.value}),children:[G.jsx("option",{value:"Klassenbester",children:"Klassenbester"}),G.jsx("option",{value:"1er Schüler",children:"1er Schüler"}),G.jsx("option",{value:"Partyborner",children:"Partyborner"})]})]}),G.jsx("button",{type:"submit",className:"btn-primary w-full justify-center mt-4",disabled:C,children:C?"Generating...":G.jsxs(G.Fragment,{children:[G.jsx(Em,{size:18}),"Generate Ticket"]})})]})]}),G.jsx("div",{className:"flex flex-col items-center justify-center",children:d?G.jsxs("div",{className:"glass-panel p-8 text-center w-full max-w-sm animate-in fade-in zoom-in duration-300",children:[G.jsx("div",{className:"bg-green-500/10 text-green-400 p-3 rounded-lg mb-6 text-sm font-medium",children:"Ticket generated successfully!"}),G.jsx("div",{className:"bg-white p-4 rounded-lg inline-block mb-6",children:G.jsx(Vd,{value:JSON.stringify({id:d.id,type:d.ticketType}),size:200,level:"H"})}),G.jsx("h3",{className:"text-xl font-bold mb-1",children:d.attendeeName}),G.jsxs("p",{className:"text-slate-400 text-sm mb-6",children:[d.ticketType," Ticket"]}),G.jsxs("div",{className:"space-y-3",children:[G.jsx("button",{onClick:A,disabled:O==="sending"||O==="sent",className:`w-full justify-center flex items-center gap-2 py-2 rounded-lg transition-colors font-medium ${O==="sent"?"bg-green-500/20 text-green-400 cursor-default":"bg-slate-700 hover:bg-slate-600 text-white"}`,children:O==="sending"?"Sending...":O==="sent"?"Email Sent!":G.jsxs(G.Fragment,{children:[G.jsx(Od,{size:18}),"Resend Email"]})}),G.jsxs("button",{onClick:N,className:"btn-secondary w-full justify-center",children:[G.jsx(_d,{size:18}),"Create Another"]})]})]}):G.jsxs("div",{className:"text-center text-slate-500 p-12 border-2 border-dashed border-slate-700 rounded-xl",children:[G.jsx(v1,{size:48,className:"mx-auto mb-4 opacity-50"}),G.jsx("p",{children:"Fill out the form to generate a ticket preview here."})]})})]})};var be;(function(f){f[f.QR_CODE=0]="QR_CODE",f[f.AZTEC=1]="AZTEC",f[f.CODABAR=2]="CODABAR",f[f.CODE_39=3]="CODE_39",f[f.CODE_93=4]="CODE_93",f[f.CODE_128=5]="CODE_128",f[f.DATA_MATRIX=6]="DATA_MATRIX",f[f.MAXICODE=7]="MAXICODE",f[f.ITF=8]="ITF",f[f.EAN_13=9]="EAN_13",f[f.EAN_8=10]="EAN_8",f[f.PDF_417=11]="PDF_417",f[f.RSS_14=12]="RSS_14",f[f.RSS_EXPANDED=13]="RSS_EXPANDED",f[f.UPC_A=14]="UPC_A",f[f.UPC_E=15]="UPC_E",f[f.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(be||(be={}));var Kh=new Map([[be.QR_CODE,"QR_CODE"],[be.AZTEC,"AZTEC"],[be.CODABAR,"CODABAR"],[be.CODE_39,"CODE_39"],[be.CODE_93,"CODE_93"],[be.CODE_128,"CODE_128"],[be.DATA_MATRIX,"DATA_MATRIX"],[be.MAXICODE,"MAXICODE"],[be.ITF,"ITF"],[be.EAN_13,"EAN_13"],[be.EAN_8,"EAN_8"],[be.PDF_417,"PDF_417"],[be.RSS_14,"RSS_14"],[be.RSS_EXPANDED,"RSS_EXPANDED"],[be.UPC_A,"UPC_A"],[be.UPC_E,"UPC_E"],[be.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Jh;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.URL=1]="URL"})(Jh||(Jh={}));function Gm(f){return Object.values(be).includes(f)}var dr;(function(f){f[f.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",f[f.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(dr||(dr={}));var Fi=(function(){function f(){}return f.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",f.SCAN_DEFAULT_FPS=2,f.DEFAULT_DISABLE_FLIP=!1,f.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,f.DEFAULT_SUPPORTED_SCAN_TYPE=[dr.SCAN_TYPE_CAMERA,dr.SCAN_TYPE_FILE],f})(),Xd=(function(){function f(g,d){this.format=g,this.formatName=d}return f.prototype.toString=function(){return this.formatName},f.create=function(g){if(!Kh.has(g))throw"".concat(g," not in html5QrcodeSupportedFormatsTextMap");return new f(g,Kh.get(g))},f})(),$h=(function(){function f(){}return f.createFromText=function(g){var d={text:g};return{decodedText:g,result:d}},f.createFromQrcodeResult=function(g){return{decodedText:g.text,result:g}},f})(),y1;(function(f){f[f.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",f[f.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",f[f.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(y1||(y1={}));var Zd=(function(){function f(){}return f.createFrom=function(g){return{errorMessage:g,type:y1.UNKWOWN_ERROR}},f})(),Qd=(function(){function f(g){this.verbose=g}return f.prototype.log=function(g){this.verbose&&console.log(g)},f.prototype.warn=function(g){this.verbose&&console.warn(g)},f.prototype.logError=function(g,d){(this.verbose||d===!0)&&console.error(g)},f.prototype.logErrors=function(g){if(g.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(g)},f})();function ea(f){return typeof f>"u"||f===null}function Vm(f,g,d){return f>d?d:f<g?g:f}var Ml=(function(){function f(){}return f.codeParseError=function(g){return"QR code parse error, error = ".concat(g)},f.errorGettingUserMedia=function(g){return"Error getting userMedia, error = ".concat(g)},f.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},f.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},f.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},f.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},f.scannerPaused=function(){return"Scanner paused"},f})(),Mt=(function(){function f(){}return f.scanningStatus=function(){return"Scanning"},f.idleStatus=function(){return"Idle"},f.errorStatus=function(){return"Error"},f.permissionStatus=function(){return"Permission"},f.noCameraFoundErrorStatus=function(){return"No Cameras"},f.lastMatch=function(g){return"Last Match: ".concat(g)},f.codeScannerTitle=function(){return"Code Scanner"},f.cameraPermissionTitle=function(){return"Request Camera Permissions"},f.cameraPermissionRequesting=function(){return"Requesting camera permissions..."},f.noCameraFound=function(){return"No camera found"},f.scanButtonStopScanningText=function(){return"Stop Scanning"},f.scanButtonStartScanningText=function(){return"Start Scanning"},f.torchOnButton=function(){return"Switch On Torch"},f.torchOffButton=function(){return"Switch Off Torch"},f.torchOnFailedMessage=function(){return"Failed to turn on torch"},f.torchOffFailedMessage=function(){return"Failed to turn off torch"},f.scanButtonScanningStarting=function(){return"Launching Camera..."},f.textIfCameraScanSelected=function(){return"Scan an Image File"},f.textIfFileScanSelected=function(){return"Scan using camera directly"},f.selectCamera=function(){return"Select Camera"},f.fileSelectionChooseImage=function(){return"Choose Image"},f.fileSelectionChooseAnother=function(){return"Choose Another"},f.fileSelectionNoImageSelected=function(){return"No image choosen"},f.anonymousCameraPrefix=function(){return"Anonymous Camera"},f.dragAndDropMessage=function(){return"Or drop an image to scan"},f.dragAndDropMessageOnlyImages=function(){return"Or drop an image to scan (other files not supported)"},f.zoom=function(){return"zoom"},f.loadingImage=function(){return"Loading image..."},f.cameraScanAltText=function(){return"Camera based scan"},f.fileScanAltText=function(){return"Fule based scan"},f})(),ed=(function(){function f(){}return f.poweredBy=function(){return"Powered by "},f.reportIssues=function(){return"Report issues"},f})(),qd=(function(){function f(){}return f.isMediaStreamConstraintsValid=function(g,d){if(typeof g!="object"){var y=typeof g;return d.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(y,"."),!0),!1}for(var C=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],E=new Set(C),O=Object.keys(g),R=0,b=O;R<b.length;R++){var A=b[R];if(E.has(A))return d.logError("".concat(A," is not supported videoConstaints."),!0),!1}return!0},f})(),Ms={exports:{}},Xm=Ms.exports,td;function Zm(){return td||(td=1,(function(f,g){(function(d,y){y(g)})(Xm,(function(d){function y(T){return T==null}var C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,t){T.__proto__=t}||function(T,t){for(var i in t)t.hasOwnProperty(i)&&(T[i]=t[i])};function E(T,t){C(T,t);function i(){this.constructor=T}T.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function O(T,t){var i=Object.setPrototypeOf;i?i(T,t):T.__proto__=t}function R(T,t){t===void 0&&(t=T.constructor);var i=Error.captureStackTrace;i&&i(T,t)}var b=(function(T){E(t,T);function t(i){var a=this.constructor,l=T.call(this,i)||this;return Object.defineProperty(l,"name",{value:a.name,enumerable:!1}),O(l,a.prototype),R(l),l}return t})(Error);class A extends b{constructor(t=void 0){super(t),this.message=t}getKind(){return this.constructor.kind}}A.kind="Exception";class N extends A{}N.kind="ArgumentException";class M extends A{}M.kind="IllegalArgumentException";class H{constructor(t){if(this.binarizer=t,t===null)throw new M("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(t,i){return this.binarizer.getBlackRow(t,i)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(t,i,a,l){const s=this.binarizer.getLuminanceSource().crop(t,i,a,l);return new H(this.binarizer.createBinarizer(s))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new H(this.binarizer.createBinarizer(t))}rotateCounterClockwise45(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new H(this.binarizer.createBinarizer(t))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class Z extends A{static getChecksumInstance(){return new Z}}Z.kind="ChecksumException";class ee{constructor(t){this.source=t}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class ie{static arraycopy(t,i,a,l,s){for(;s--;)a[l++]=t[i++]}static currentTimeMillis(){return Date.now()}}class ae extends A{}ae.kind="IndexOutOfBoundsException";class pe extends ae{constructor(t=void 0,i=void 0){super(i),this.index=t,this.message=i}}pe.kind="ArrayIndexOutOfBoundsException";class de{static fill(t,i){for(let a=0,l=t.length;a<l;a++)t[a]=i}static fillWithin(t,i,a,l){de.rangeCheck(t.length,i,a);for(let s=i;s<a;s++)t[s]=l}static rangeCheck(t,i,a){if(i>a)throw new M("fromIndex("+i+") > toIndex("+a+")");if(i<0)throw new pe(i);if(a>t)throw new pe(a)}static asList(...t){return t}static create(t,i,a){return Array.from({length:t}).map(s=>Array.from({length:i}).fill(a))}static createInt32Array(t,i,a){return Array.from({length:t}).map(s=>Int32Array.from({length:i}).fill(a))}static equals(t,i){if(!t||!i||!t.length||!i.length||t.length!==i.length)return!1;for(let a=0,l=t.length;a<l;a++)if(t[a]!==i[a])return!1;return!0}static hashCode(t){if(t===null)return 0;let i=1;for(const a of t)i=31*i+a;return i}static fillUint8Array(t,i){for(let a=0;a!==t.length;a++)t[a]=i}static copyOf(t,i){return t.slice(0,i)}static copyOfUint8Array(t,i){if(t.length<=i){const a=new Uint8Array(i);return a.set(t),a}return t.slice(0,i)}static copyOfRange(t,i,a){const l=a-i,s=new Int32Array(l);return ie.arraycopy(t,i,s,0,l),s}static binarySearch(t,i,a){a===void 0&&(a=de.numberComparator);let l=0,s=t.length-1;for(;l<=s;){const u=s+l>>1,c=a(i,t[u]);if(c>0)l=u+1;else if(c<0)s=u-1;else return u}return-l-1}static numberComparator(t,i){return t-i}}class ne{static numberOfTrailingZeros(t){let i;if(t===0)return 32;let a=31;return i=t<<16,i!==0&&(a-=16,t=i),i=t<<8,i!==0&&(a-=8,t=i),i=t<<4,i!==0&&(a-=4,t=i),i=t<<2,i!==0&&(a-=2,t=i),a-(t<<1>>>31)}static numberOfLeadingZeros(t){if(t===0)return 32;let i=1;return t>>>16||(i+=16,t<<=16),t>>>24||(i+=8,t<<=8),t>>>28||(i+=4,t<<=4),t>>>30||(i+=2,t<<=2),i-=t>>>31,i}static toHexString(t){return t.toString(16)}static toBinaryString(t){return String(parseInt(String(t),2))}static bitCount(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63}static truncDivision(t,i){return Math.trunc(t/i)}static parseInt(t,i=void 0){return parseInt(t,i)}}ne.MIN_VALUE_32_BITS=-2147483648,ne.MAX_VALUE=Number.MAX_SAFE_INTEGER;class we{constructor(t,i){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,i==null?this.bits=we.makeArray(t):this.bits=i)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(t){if(t>this.bits.length*32){const i=we.makeArray(t);ie.arraycopy(this.bits,0,i,0,this.bits.length),this.bits=i}}get(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0}set(t){this.bits[Math.floor(t/32)]|=1<<(t&31)}flip(t){this.bits[Math.floor(t/32)]^=1<<(t&31)}getNextSet(t){const i=this.size;if(t>=i)return i;const a=this.bits;let l=Math.floor(t/32),s=a[l];s&=~((1<<(t&31))-1);const u=a.length;for(;s===0;){if(++l===u)return i;s=a[l]}const c=l*32+ne.numberOfTrailingZeros(s);return c>i?i:c}getNextUnset(t){const i=this.size;if(t>=i)return i;const a=this.bits;let l=Math.floor(t/32),s=~a[l];s&=~((1<<(t&31))-1);const u=a.length;for(;s===0;){if(++l===u)return i;s=~a[l]}const c=l*32+ne.numberOfTrailingZeros(s);return c>i?i:c}setBulk(t,i){this.bits[Math.floor(t/32)]=i}setRange(t,i){if(i<t||t<0||i>this.size)throw new M;if(i===t)return;i--;const a=Math.floor(t/32),l=Math.floor(i/32),s=this.bits;for(let u=a;u<=l;u++){const c=u>a?0:t&31,p=(2<<(u<l?31:i&31))-(1<<c);s[u]|=p}}clear(){const t=this.bits.length,i=this.bits;for(let a=0;a<t;a++)i[a]=0}isRange(t,i,a){if(i<t||t<0||i>this.size)throw new M;if(i===t)return!0;i--;const l=Math.floor(t/32),s=Math.floor(i/32),u=this.bits;for(let c=l;c<=s;c++){const x=c>l?0:t&31,w=(2<<(c<s?31:i&31))-(1<<x)&4294967295;if((u[c]&w)!==(a?w:0))return!1}return!0}appendBit(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(t,i){if(i<0||i>32)throw new M("Num bits must be between 0 and 32");this.ensureCapacity(this.size+i);for(let a=i;a>0;a--)this.appendBit((t>>a-1&1)===1)}appendBitArray(t){const i=t.size;this.ensureCapacity(this.size+i);for(let a=0;a<i;a++)this.appendBit(t.get(a))}xor(t){if(this.size!==t.size)throw new M("Sizes don't match");const i=this.bits;for(let a=0,l=i.length;a<l;a++)i[a]^=t.bits[a]}toBytes(t,i,a,l){for(let s=0;s<l;s++){let u=0;for(let c=0;c<8;c++)this.get(t)&&(u|=1<<7-c),t++;i[a+s]=u}}getBitArray(){return this.bits}reverse(){const t=new Int32Array(this.bits.length),i=Math.floor((this.size-1)/32),a=i+1,l=this.bits;for(let s=0;s<a;s++){let u=l[s];u=u>>1&1431655765|(u&1431655765)<<1,u=u>>2&858993459|(u&858993459)<<2,u=u>>4&252645135|(u&252645135)<<4,u=u>>8&16711935|(u&16711935)<<8,u=u>>16&65535|(u&65535)<<16,t[i-s]=u}if(this.size!==a*32){const s=a*32-this.size;let u=t[0]>>>s;for(let c=1;c<a;c++){const x=t[c];u|=x<<32-s,t[c-1]=u,u=x>>>s}t[a-1]=u}this.bits=t}static makeArray(t){return new Int32Array(Math.floor((t+31)/32))}equals(t){if(!(t instanceof we))return!1;const i=t;return this.size===i.size&&de.equals(this.bits,i.bits)}hashCode(){return 31*this.size+de.hashCode(this.bits)}toString(){let t="";for(let i=0,a=this.size;i<a;i++)(i&7)===0&&(t+=" "),t+=this.get(i)?"X":".";return t}clone(){return new we(this.size,this.bits.slice())}}var Pe;(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"})(Pe||(Pe={}));var Be=Pe;class le extends A{static getFormatInstance(){return new le}}le.kind="FormatException";var Re;(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"})(Re||(Re={}));class fe{constructor(t,i,a,...l){this.valueIdentifier=t,this.name=a,typeof i=="number"?this.values=Int32Array.from([i]):this.values=i,this.otherEncodingNames=l,fe.VALUE_IDENTIFIER_TO_ECI.set(t,this),fe.NAME_TO_ECI.set(a,this);const s=this.values;for(let u=0,c=s.length;u!==c;u++){const x=s[u];fe.VALUES_TO_ECI.set(x,this)}for(const u of l)fe.NAME_TO_ECI.set(u,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(t){if(t<0||t>=900)throw new le("incorect value");const i=fe.VALUES_TO_ECI.get(t);if(i===void 0)throw new le("incorect value");return i}static getCharacterSetECIByName(t){const i=fe.NAME_TO_ECI.get(t);if(i===void 0)throw new le("incorect value");return i}equals(t){if(!(t instanceof fe))return!1;const i=t;return this.getName()===i.getName()}}fe.VALUE_IDENTIFIER_TO_ECI=new Map,fe.VALUES_TO_ECI=new Map,fe.NAME_TO_ECI=new Map,fe.Cp437=new fe(Re.Cp437,Int32Array.from([0,2]),"Cp437"),fe.ISO8859_1=new fe(Re.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),fe.ISO8859_2=new fe(Re.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),fe.ISO8859_3=new fe(Re.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),fe.ISO8859_4=new fe(Re.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),fe.ISO8859_5=new fe(Re.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),fe.ISO8859_6=new fe(Re.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),fe.ISO8859_7=new fe(Re.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),fe.ISO8859_8=new fe(Re.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),fe.ISO8859_9=new fe(Re.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),fe.ISO8859_10=new fe(Re.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),fe.ISO8859_11=new fe(Re.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),fe.ISO8859_13=new fe(Re.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),fe.ISO8859_14=new fe(Re.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),fe.ISO8859_15=new fe(Re.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),fe.ISO8859_16=new fe(Re.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),fe.SJIS=new fe(Re.SJIS,20,"SJIS","Shift_JIS"),fe.Cp1250=new fe(Re.Cp1250,21,"Cp1250","windows-1250"),fe.Cp1251=new fe(Re.Cp1251,22,"Cp1251","windows-1251"),fe.Cp1252=new fe(Re.Cp1252,23,"Cp1252","windows-1252"),fe.Cp1256=new fe(Re.Cp1256,24,"Cp1256","windows-1256"),fe.UnicodeBigUnmarked=new fe(Re.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),fe.UTF8=new fe(Re.UTF8,26,"UTF8","UTF-8"),fe.ASCII=new fe(Re.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),fe.Big5=new fe(Re.Big5,28,"Big5"),fe.GB18030=new fe(Re.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),fe.EUC_KR=new fe(Re.EUC_KR,30,"EUC_KR","EUC-KR");class Gt extends A{}Gt.kind="UnsupportedOperationException";class Ze{static decode(t,i){const a=this.encodingName(i);return this.customDecoder?this.customDecoder(t,a):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(a)?this.decodeFallback(t,a):new TextDecoder(a).decode(t)}static shouldDecodeOnFallback(t){return!Ze.isBrowser()&&t==="ISO-8859-1"}static encode(t,i){const a=this.encodingName(i);return this.customEncoder?this.customEncoder(t,a):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(t){return typeof t=="string"?t:t.getName()}static encodingCharacterSet(t){return t instanceof fe?t:fe.getCharacterSetECIByName(t)}static decodeFallback(t,i){const a=this.encodingCharacterSet(i);if(Ze.isDecodeFallbackSupported(a)){let l="";for(let s=0,u=t.length;s<u;s++){let c=t[s].toString(16);c.length<2&&(c="0"+c),l+="%"+c}return decodeURIComponent(l)}if(a.equals(fe.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new Gt(`Encoding ${this.encodingName(i)} not supported by fallback.`)}static isDecodeFallbackSupported(t){return t.equals(fe.UTF8)||t.equals(fe.ISO8859_1)||t.equals(fe.ASCII)}static encodeFallback(t){const a=btoa(unescape(encodeURIComponent(t))).split(""),l=[];for(let s=0;s<a.length;s++)l.push(a[s].charCodeAt(0));return new Uint8Array(l)}}class Ne{static castAsNonUtf8Char(t,i=null){const a=i?i.getName():this.ISO88591;return Ze.decode(new Uint8Array([t]),a)}static guessEncoding(t,i){if(i!=null&&i.get(Be.CHARACTER_SET)!==void 0)return i.get(Be.CHARACTER_SET).toString();const a=t.length;let l=!0,s=!0,u=!0,c=0,x=0,p=0,w=0,v=0,I=0,B=0,U=0,z=0,P=0,W=0;const me=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191;for(let xe=0;xe<a&&(l||s||u);xe++){const ge=t[xe]&255;u&&(c>0?(ge&128)===0?u=!1:c--:(ge&128)!==0&&((ge&64)===0?u=!1:(c++,(ge&32)===0?x++:(c++,(ge&16)===0?p++:(c++,(ge&8)===0?w++:u=!1))))),l&&(ge>127&&ge<160?l=!1:ge>159&&(ge<192||ge===215||ge===247)&&W++),s&&(v>0?ge<64||ge===127||ge>252?s=!1:v--:ge===128||ge===160||ge>239?s=!1:ge>160&&ge<224?(I++,U=0,B++,B>z&&(z=B)):ge>127?(v++,B=0,U++,U>P&&(P=U)):(B=0,U=0))}return u&&c>0&&(u=!1),s&&v>0&&(s=!1),u&&(me||x+p+w>0)?Ne.UTF8:s&&(Ne.ASSUME_SHIFT_JIS||z>=3||P>=3)?Ne.SHIFT_JIS:l&&s?z===2&&I===2||W*10>=a?Ne.SHIFT_JIS:Ne.ISO88591:l?Ne.ISO88591:s?Ne.SHIFT_JIS:u?Ne.UTF8:Ne.PLATFORM_DEFAULT_ENCODING}static format(t,...i){let a=-1;function l(u,c,x,p,w,v){if(u==="%%")return"%";if(i[++a]===void 0)return;u=p?parseInt(p.substr(1)):void 0;let I=w?parseInt(w.substr(1)):void 0,B;switch(v){case"s":B=i[a];break;case"c":B=i[a][0];break;case"f":B=parseFloat(i[a]).toFixed(u);break;case"p":B=parseFloat(i[a]).toPrecision(u);break;case"e":B=parseFloat(i[a]).toExponential(u);break;case"x":B=parseInt(i[a]).toString(I||16);break;case"d":B=parseFloat(parseInt(i[a],I||10).toPrecision(u)).toFixed(0);break}B=typeof B=="object"?JSON.stringify(B):(+B).toString(I);let U=parseInt(x),z=x&&x[0]+""=="0"?"0":" ";for(;B.length<U;)B=c!==void 0?B+z:z+B;return B}let s=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(s,l)}static getBytes(t,i){return Ze.encode(t,i)}static getCharCode(t,i=0){return t.charCodeAt(i)}static getCharAt(t){return String.fromCharCode(t)}}Ne.SHIFT_JIS=fe.SJIS.getName(),Ne.GB2312="GB2312",Ne.ISO88591=fe.ISO8859_1.getName(),Ne.EUC_JP="EUC_JP",Ne.UTF8=fe.UTF8.getName(),Ne.PLATFORM_DEFAULT_ENCODING=Ne.UTF8,Ne.ASSUME_SHIFT_JIS=!1;class We{constructor(t=""){this.value=t}enableDecoding(t){return this.encoding=t,this}append(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=Ne.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this}appendChars(t,i,a){for(let l=i;i<i+a;l++)this.append(t[l]);return this}length(){return this.value.length}charAt(t){return this.value.charAt(t)}deleteCharAt(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)}setCharAt(t,i){this.value=this.value.substr(0,t)+i+this.value.substr(t+1)}substring(t,i){return this.value.substring(t,i)}setLengthToZero(){this.value=""}toString(){return this.value}insert(t,i){this.value=this.value.substr(0,t)+i+this.value.substr(t+i.length)}}class at{constructor(t,i,a,l){if(this.width=t,this.height=i,this.rowSize=a,this.bits=l,i==null&&(i=t),this.height=i,t<1||i<1)throw new M("Both dimensions must be greater than 0");a==null&&(a=Math.floor((t+31)/32)),this.rowSize=a,l==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(t){const i=t.length,a=t[0].length,l=new at(a,i);for(let s=0;s<i;s++){const u=t[s];for(let c=0;c<a;c++)u[c]&&l.set(c,s)}return l}static parseFromString(t,i,a){if(t===null)throw new M("stringRepresentation cannot be null");const l=new Array(t.length);let s=0,u=0,c=-1,x=0,p=0;for(;p<t.length;)if(t.charAt(p)===`
|
||
`||t.charAt(p)==="\r"){if(s>u){if(c===-1)c=s-u;else if(s-u!==c)throw new M("row lengths do not match");u=s,x++}p++}else if(t.substring(p,p+i.length)===i)p+=i.length,l[s]=!0,s++;else if(t.substring(p,p+a.length)===a)p+=a.length,l[s]=!1,s++;else throw new M("illegal character encountered: "+t.substring(p));if(s>u){if(c===-1)c=s-u;else if(s-u!==c)throw new M("row lengths do not match");x++}const w=new at(c,x);for(let v=0;v<s;v++)l[v]&&w.set(Math.floor(v%c),Math.floor(v/c));return w}get(t,i){const a=i*this.rowSize+Math.floor(t/32);return(this.bits[a]>>>(t&31)&1)!==0}set(t,i){const a=i*this.rowSize+Math.floor(t/32);this.bits[a]|=1<<(t&31)&4294967295}unset(t,i){const a=i*this.rowSize+Math.floor(t/32);this.bits[a]&=~(1<<(t&31)&4294967295)}flip(t,i){const a=i*this.rowSize+Math.floor(t/32);this.bits[a]^=1<<(t&31)&4294967295}xor(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new M("input matrix dimensions do not match");const i=new we(Math.floor(this.width/32)+1),a=this.rowSize,l=this.bits;for(let s=0,u=this.height;s<u;s++){const c=s*a,x=t.getRow(s,i).getBitArray();for(let p=0;p<a;p++)l[c+p]^=x[p]}}clear(){const t=this.bits,i=t.length;for(let a=0;a<i;a++)t[a]=0}setRegion(t,i,a,l){if(i<0||t<0)throw new M("Left and top must be nonnegative");if(l<1||a<1)throw new M("Height and width must be at least 1");const s=t+a,u=i+l;if(u>this.height||s>this.width)throw new M("The region must fit inside the matrix");const c=this.rowSize,x=this.bits;for(let p=i;p<u;p++){const w=p*c;for(let v=t;v<s;v++)x[w+Math.floor(v/32)]|=1<<(v&31)&4294967295}}getRow(t,i){i==null||i.getSize()<this.width?i=new we(this.width):i.clear();const a=this.rowSize,l=this.bits,s=t*a;for(let u=0;u<a;u++)i.setBulk(u*32,l[s+u]);return i}setRow(t,i){ie.arraycopy(i.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)}rotate180(){const t=this.getWidth(),i=this.getHeight();let a=new we(t),l=new we(t);for(let s=0,u=Math.floor((i+1)/2);s<u;s++)a=this.getRow(s,a),l=this.getRow(i-1-s,l),a.reverse(),l.reverse(),this.setRow(s,l),this.setRow(i-1-s,a)}getEnclosingRectangle(){const t=this.width,i=this.height,a=this.rowSize,l=this.bits;let s=t,u=i,c=-1,x=-1;for(let p=0;p<i;p++)for(let w=0;w<a;w++){const v=l[p*a+w];if(v!==0){if(p<u&&(u=p),p>x&&(x=p),w*32<s){let I=0;for(;(v<<31-I&4294967295)===0;)I++;w*32+I<s&&(s=w*32+I)}if(w*32+31>c){let I=31;for(;!(v>>>I);)I--;w*32+I>c&&(c=w*32+I)}}}return c<s||x<u?null:Int32Array.from([s,u,c-s+1,x-u+1])}getTopLeftOnBit(){const t=this.rowSize,i=this.bits;let a=0;for(;a<i.length&&i[a]===0;)a++;if(a===i.length)return null;const l=a/t;let s=a%t*32;const u=i[a];let c=0;for(;(u<<31-c&4294967295)===0;)c++;return s+=c,Int32Array.from([s,l])}getBottomRightOnBit(){const t=this.rowSize,i=this.bits;let a=i.length-1;for(;a>=0&&i[a]===0;)a--;if(a<0)return null;const l=Math.floor(a/t);let s=Math.floor(a%t)*32;const u=i[a];let c=31;for(;!(u>>>c);)c--;return s+=c,Int32Array.from([s,l])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(t){if(!(t instanceof at))return!1;const i=t;return this.width===i.width&&this.height===i.height&&this.rowSize===i.rowSize&&de.equals(this.bits,i.bits)}hashCode(){let t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+de.hashCode(this.bits),t}toString(t="X ",i=" ",a=`
|
||
`){return this.buildToString(t,i,a)}buildToString(t,i,a){let l=new We;for(let s=0,u=this.height;s<u;s++){for(let c=0,x=this.width;c<x;c++)l.append(this.get(c,s)?t:i);l.append(a)}return l.toString()}clone(){return new at(this.width,this.height,this.rowSize,this.bits.slice())}}class q extends A{static getNotFoundInstance(){return new q}}q.kind="NotFoundException";class J extends ee{constructor(t){super(t),this.luminances=J.EMPTY,this.buckets=new Int32Array(J.LUMINANCE_BUCKETS)}getBlackRow(t,i){const a=this.getLuminanceSource(),l=a.getWidth();i==null||i.getSize()<l?i=new we(l):i.clear(),this.initArrays(l);const s=a.getRow(t,this.luminances),u=this.buckets;for(let x=0;x<l;x++)u[(s[x]&255)>>J.LUMINANCE_SHIFT]++;const c=J.estimateBlackPoint(u);if(l<3)for(let x=0;x<l;x++)(s[x]&255)<c&&i.set(x);else{let x=s[0]&255,p=s[1]&255;for(let w=1;w<l-1;w++){const v=s[w+1]&255;(p*4-x-v)/2<c&&i.set(w),x=p,p=v}}return i}getBlackMatrix(){const t=this.getLuminanceSource(),i=t.getWidth(),a=t.getHeight(),l=new at(i,a);this.initArrays(i);const s=this.buckets;for(let x=1;x<5;x++){const p=Math.floor(a*x/5),w=t.getRow(p,this.luminances),v=Math.floor(i*4/5);for(let I=Math.floor(i/5);I<v;I++){const B=w[I]&255;s[B>>J.LUMINANCE_SHIFT]++}}const u=J.estimateBlackPoint(s),c=t.getMatrix();for(let x=0;x<a;x++){const p=x*i;for(let w=0;w<i;w++)(c[p+w]&255)<u&&l.set(w,x)}return l}createBinarizer(t){return new J(t)}initArrays(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));const i=this.buckets;for(let a=0;a<J.LUMINANCE_BUCKETS;a++)i[a]=0}static estimateBlackPoint(t){const i=t.length;let a=0,l=0,s=0;for(let w=0;w<i;w++)t[w]>s&&(l=w,s=t[w]),t[w]>a&&(a=t[w]);let u=0,c=0;for(let w=0;w<i;w++){const v=w-l,I=t[w]*v*v;I>c&&(u=w,c=I)}if(l>u){const w=l;l=u,u=w}if(u-l<=i/16)throw new q;let x=u-1,p=-1;for(let w=u-1;w>l;w--){const v=w-l,I=v*v*(u-w)*(a-t[w]);I>p&&(x=w,p=I)}return x<<J.LUMINANCE_SHIFT}}J.LUMINANCE_BITS=5,J.LUMINANCE_SHIFT=8-J.LUMINANCE_BITS,J.LUMINANCE_BUCKETS=1<<J.LUMINANCE_BITS,J.EMPTY=Uint8ClampedArray.from([0]);class oe extends J{constructor(t){super(t),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const t=this.getLuminanceSource(),i=t.getWidth(),a=t.getHeight();if(i>=oe.MINIMUM_DIMENSION&&a>=oe.MINIMUM_DIMENSION){const l=t.getMatrix();let s=i>>oe.BLOCK_SIZE_POWER;(i&oe.BLOCK_SIZE_MASK)!==0&&s++;let u=a>>oe.BLOCK_SIZE_POWER;(a&oe.BLOCK_SIZE_MASK)!==0&&u++;const c=oe.calculateBlackPoints(l,s,u,i,a),x=new at(i,a);oe.calculateThresholdForBlock(l,s,u,i,a,c,x),this.matrix=x}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(t){return new oe(t)}static calculateThresholdForBlock(t,i,a,l,s,u,c){const x=s-oe.BLOCK_SIZE,p=l-oe.BLOCK_SIZE;for(let w=0;w<a;w++){let v=w<<oe.BLOCK_SIZE_POWER;v>x&&(v=x);const I=oe.cap(w,2,a-3);for(let B=0;B<i;B++){let U=B<<oe.BLOCK_SIZE_POWER;U>p&&(U=p);const z=oe.cap(B,2,i-3);let P=0;for(let me=-2;me<=2;me++){const xe=u[I+me];P+=xe[z-2]+xe[z-1]+xe[z]+xe[z+1]+xe[z+2]}const W=P/25;oe.thresholdBlock(t,U,v,W,l,c)}}}static cap(t,i,a){return t<i?i:t>a?a:t}static thresholdBlock(t,i,a,l,s,u){for(let c=0,x=a*s+i;c<oe.BLOCK_SIZE;c++,x+=s)for(let p=0;p<oe.BLOCK_SIZE;p++)(t[x+p]&255)<=l&&u.set(i+p,a+c)}static calculateBlackPoints(t,i,a,l,s){const u=s-oe.BLOCK_SIZE,c=l-oe.BLOCK_SIZE,x=new Array(a);for(let p=0;p<a;p++){x[p]=new Int32Array(i);let w=p<<oe.BLOCK_SIZE_POWER;w>u&&(w=u);for(let v=0;v<i;v++){let I=v<<oe.BLOCK_SIZE_POWER;I>c&&(I=c);let B=0,U=255,z=0;for(let W=0,me=w*l+I;W<oe.BLOCK_SIZE;W++,me+=l){for(let xe=0;xe<oe.BLOCK_SIZE;xe++){const ge=t[me+xe]&255;B+=ge,ge<U&&(U=ge),ge>z&&(z=ge)}if(z-U>oe.MIN_DYNAMIC_RANGE)for(W++,me+=l;W<oe.BLOCK_SIZE;W++,me+=l)for(let xe=0;xe<oe.BLOCK_SIZE;xe++)B+=t[me+xe]&255}let P=B>>oe.BLOCK_SIZE_POWER*2;if(z-U<=oe.MIN_DYNAMIC_RANGE&&(P=U/2,p>0&&v>0)){const W=(x[p-1][v]+2*x[p][v-1]+x[p-1][v-1])/4;U<W&&(P=W)}x[p][v]=P}}return x}}oe.BLOCK_SIZE_POWER=3,oe.BLOCK_SIZE=1<<oe.BLOCK_SIZE_POWER,oe.BLOCK_SIZE_MASK=oe.BLOCK_SIZE-1,oe.MINIMUM_DIMENSION=oe.BLOCK_SIZE*5,oe.MIN_DYNAMIC_RANGE=24;class Oe{constructor(t,i){this.width=t,this.height=i}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(t,i,a,l){throw new Gt("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new Gt("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new Gt("This luminance source does not support rotation by 45 degrees.")}toString(){const t=new Uint8ClampedArray(this.width);let i=new We;for(let a=0;a<this.height;a++){const l=this.getRow(a,t);for(let s=0;s<this.width;s++){const u=l[s]&255;let c;u<64?c="#":u<128?c="+":u<192?c=".":c=" ",i.append(c)}i.append(`
|
||
`)}return i.toString()}}class Qe extends Oe{constructor(t){super(t.getWidth(),t.getHeight()),this.delegate=t}getRow(t,i){const a=this.delegate.getRow(t,i),l=this.getWidth();for(let s=0;s<l;s++)a[s]=255-(a[s]&255);return a}getMatrix(){const t=this.delegate.getMatrix(),i=this.getWidth()*this.getHeight(),a=new Uint8ClampedArray(i);for(let l=0;l<i;l++)a[l]=255-(t[l]&255);return a}isCropSupported(){return this.delegate.isCropSupported()}crop(t,i,a,l){return new Qe(this.delegate.crop(t,i,a,l))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new Qe(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new Qe(this.delegate.rotateCounterClockwise45())}}class Ke extends Oe{constructor(t){super(t.width,t.height),this.canvas=t,this.tempCanvasElement=null,this.buffer=Ke.makeBufferFromCanvasImageData(t)}static makeBufferFromCanvasImageData(t){const i=t.getContext("2d").getImageData(0,0,t.width,t.height);return Ke.toGrayscaleBuffer(i.data,t.width,t.height)}static toGrayscaleBuffer(t,i,a){const l=new Uint8ClampedArray(i*a);for(let s=0,u=0,c=t.length;s<c;s+=4,u++){let x;if(t[s+3]===0)x=255;else{const w=t[s],v=t[s+1],I=t[s+2];x=306*w+601*v+117*I+512>>10}l[u]=x}return l}getRow(t,i){if(t<0||t>=this.getHeight())throw new M("Requested row is outside the image: "+t);const a=this.getWidth(),l=t*a;return i===null?i=this.buffer.slice(l,l+a):(i.length<a&&(i=new Uint8ClampedArray(a)),i.set(this.buffer.slice(l,l+a))),i}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(t,i,a,l){return super.crop(t,i,a,l),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement}rotate(t){const i=this.getTempCanvasElement(),a=i.getContext("2d"),l=t*Ke.DEGREE_TO_RADIANS,s=this.canvas.width,u=this.canvas.height,c=Math.ceil(Math.abs(Math.cos(l))*s+Math.abs(Math.sin(l))*u),x=Math.ceil(Math.abs(Math.sin(l))*s+Math.abs(Math.cos(l))*u);return i.width=c,i.height=x,a.translate(c/2,x/2),a.rotate(l),a.drawImage(this.canvas,s/-2,u/-2),this.buffer=Ke.makeBufferFromCanvasImageData(i),this}invert(){return new Qe(this)}}Ke.DEGREE_TO_RADIANS=Math.PI/180;class F{constructor(t,i,a){this.deviceId=t,this.label=i,this.kind="videoinput",this.groupId=a||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var re=(globalThis||$o||self||window||void 0)&&(globalThis||$o||self||window||void 0).__awaiter||function(T,t,i,a){function l(s){return s instanceof i?s:new i(function(u){u(s)})}return new(i||(i=Promise))(function(s,u){function c(w){try{p(a.next(w))}catch(v){u(v)}}function x(w){try{p(a.throw(w))}catch(v){u(v)}}function p(w){w.done?s(w.value):l(w.value).then(c,x)}p((a=a.apply(T,t||[])).next())})};class Ee{constructor(t,i=500,a){this.reader=t,this.timeBetweenScansMillis=i,this._hints=a,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(t){this._timeBetweenDecodingAttempts=t<0?0:t}set hints(t){this._hints=t||null}get hints(){return this._hints}listVideoInputDevices(){return re(this,void 0,void 0,function*(){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.");const t=yield navigator.mediaDevices.enumerateDevices(),i=[];for(const a of t){const l=a.kind==="video"?"videoinput":a.kind;if(l!=="videoinput")continue;const s=a.deviceId||a.id,u=a.label||`Video device ${i.length+1}`,c=a.groupId,x={deviceId:s,label:u,kind:l,groupId:c};i.push(x)}return i})}getVideoInputDevices(){return re(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(i=>new F(i.deviceId,i.label))})}findDeviceById(t){return re(this,void 0,void 0,function*(){const i=yield this.listVideoInputDevices();return i?i.find(a=>a.deviceId===t):null})}decodeFromInputVideoDevice(t,i){return re(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(t,i)})}decodeOnceFromVideoDevice(t,i){return re(this,void 0,void 0,function*(){this.reset();let a;t?a={deviceId:{exact:t}}:a={facingMode:"environment"};const l={video:a};return yield this.decodeOnceFromConstraints(l,i)})}decodeOnceFromConstraints(t,i){return re(this,void 0,void 0,function*(){const a=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeOnceFromStream(a,i)})}decodeOnceFromStream(t,i){return re(this,void 0,void 0,function*(){this.reset();const a=yield this.attachStreamToVideo(t,i);return yield this.decodeOnce(a)})}decodeFromInputVideoDeviceContinuously(t,i,a){return re(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(t,i,a)})}decodeFromVideoDevice(t,i,a){return re(this,void 0,void 0,function*(){let l;t?l={deviceId:{exact:t}}:l={facingMode:"environment"};const s={video:l};return yield this.decodeFromConstraints(s,i,a)})}decodeFromConstraints(t,i,a){return re(this,void 0,void 0,function*(){const l=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeFromStream(l,i,a)})}decodeFromStream(t,i,a){return re(this,void 0,void 0,function*(){this.reset();const l=yield this.attachStreamToVideo(t,i);return yield this.decodeContinuously(l,a)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(t,i){return re(this,void 0,void 0,function*(){const a=this.prepareVideoElement(i);return this.addVideoSource(a,t),this.videoElement=a,this.stream=t,yield this.playVideoOnLoadAsync(a),a})}playVideoOnLoadAsync(t){return new Promise((i,a)=>this.playVideoOnLoad(t,()=>i()))}playVideoOnLoad(t,i){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(t),t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",i),this.tryPlayVideo(t)}isVideoPlaying(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2}tryPlayVideo(t){return re(this,void 0,void 0,function*(){if(this.isVideoPlaying(t)){console.warn("Trying to play video that is already playing.");return}try{yield t.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(t,i){const a=document.getElementById(t);if(!a)throw new N(`element with id '${t}' not found`);if(a.nodeName.toLowerCase()!==i.toLowerCase())throw new N(`element with id '${t}' must be an ${i} element`);return a}decodeFromImage(t,i){if(!t&&!i)throw new N("either imageElement with a src set or an url must be provided");return i&&!t?this.decodeFromImageUrl(i):this.decodeFromImageElement(t)}decodeFromVideo(t,i){if(!t&&!i)throw new N("Either an element with a src set or an URL must be provided");return i&&!t?this.decodeFromVideoUrl(i):this.decodeFromVideoElement(t)}decodeFromVideoContinuously(t,i,a){if(t===void 0&&i===void 0)throw new N("Either an element with a src set or an URL must be provided");return i&&!t?this.decodeFromVideoUrlContinuously(i,a):this.decodeFromVideoElementContinuously(t,a)}decodeFromImageElement(t){if(!t)throw new N("An image element must be provided.");this.reset();const i=this.prepareImageElement(t);this.imageElement=i;let a;return this.isImageLoaded(i)?a=this.decodeOnce(i,!1,!0):a=this._decodeOnLoadImage(i),a}decodeFromVideoElement(t){const i=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(i)}decodeFromVideoElementContinuously(t,i){const a=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(a,i)}_decodeFromVideoElementSetup(t){if(!t)throw new N("A video element must be provided.");this.reset();const i=this.prepareVideoElement(t);return this.videoElement=i,i}decodeFromImageUrl(t){if(!t)throw new N("An URL must be provided.");this.reset();const i=this.prepareImageElement();this.imageElement=i;const a=this._decodeOnLoadImage(i);return i.src=t,a}decodeFromVideoUrl(t){if(!t)throw new N("An URL must be provided.");this.reset();const i=this.prepareVideoElement(),a=this.decodeFromVideoElement(i);return i.src=t,a}decodeFromVideoUrlContinuously(t,i){if(!t)throw new N("An URL must be provided.");this.reset();const a=this.prepareVideoElement(),l=this.decodeFromVideoElementContinuously(a,i);return a.src=t,l}_decodeOnLoadImage(t){return new Promise((i,a)=>{this.imageLoadedListener=()=>this.decodeOnce(t,!1,!0).then(i,a),t.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(t){return re(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(t),yield this.decodeOnce(t)})}_decodeOnLoadVideoContinuously(t,i){return re(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(t),this.decodeContinuously(t,i)})}isImageLoaded(t){return!(!t.complete||t.naturalWidth===0)}prepareImageElement(t){let i;return typeof t>"u"&&(i=document.createElement("img"),i.width=200,i.height=200),typeof t=="string"&&(i=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(i=t),i}prepareVideoElement(t){let i;return!t&&typeof document<"u"&&(i=document.createElement("video"),i.width=200,i.height=200),typeof t=="string"&&(i=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(i=t),i.setAttribute("autoplay","true"),i.setAttribute("muted","true"),i.setAttribute("playsinline","true"),i}decodeOnce(t,i=!0,a=!0){this._stopAsyncDecode=!1;const l=(s,u)=>{if(this._stopAsyncDecode){u(new q("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const c=this.decode(t);s(c)}catch(c){const x=i&&c instanceof q,w=(c instanceof Z||c instanceof le)&&a;if(x||w)return setTimeout(l,this._timeBetweenDecodingAttempts,s,u);u(c)}};return new Promise((s,u)=>l(s,u))}decodeContinuously(t,i){this._stopContinuousDecode=!1;const a=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const l=this.decode(t);i(l,null),setTimeout(a,this.timeBetweenScansMillis)}catch(l){i(null,l);const s=l instanceof Z||l instanceof le,u=l instanceof q;(s||u)&&setTimeout(a,this._timeBetweenDecodingAttempts)}};a()}decode(t){const i=this.createBinaryBitmap(t);return this.decodeBitmap(i)}_isHTMLVideoElement(t){return t.videoWidth!==0}drawFrameOnCanvas(t,i,a){i||(i={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),a||(a=this.captureCanvasContext),a.drawImage(t,i.sx,i.sy,i.sWidth,i.sHeight,i.dx,i.dy,i.dWidth,i.dHeight)}drawImageOnCanvas(t,i,a=this.captureCanvasContext){i||(i={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),a||(a=this.captureCanvasContext),a.drawImage(t,i.sx,i.sy,i.sWidth,i.sHeight,i.dx,i.dy,i.dWidth,i.dHeight)}createBinaryBitmap(t){this.getCaptureCanvasContext(t),this._isHTMLVideoElement(t)?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);const i=this.getCaptureCanvas(t),a=new Ke(i),l=new oe(a);return new H(l)}getCaptureCanvasContext(t){if(!this.captureCanvasContext){const a=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=a}return this.captureCanvasContext}getCaptureCanvas(t){if(!this.captureCanvas){const i=this.createCaptureCanvas(t);this.captureCanvas=i}return this.captureCanvas}decodeBitmap(t){return this.reader.decode(t,this._hints)}createCaptureCanvas(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const i=document.createElement("canvas");let a,l;return typeof t<"u"&&(t instanceof HTMLVideoElement?(a=t.videoWidth,l=t.videoHeight):t instanceof HTMLImageElement&&(a=t.naturalWidth||t.width,l=t.naturalHeight||t.height)),i.style.width=a+"px",i.style.height=l+"px",i.width=a,i.height=l,i}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(t=>t.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){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)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(t,i){try{t.srcObject=i}catch{t.src=URL.createObjectURL(i)}}cleanVideoSource(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")}}class Ce{constructor(t,i,a=i==null?0:8*i.length,l,s,u=ie.currentTimeMillis()){this.text=t,this.rawBytes=i,this.numBits=a,this.resultPoints=l,this.format=s,this.timestamp=u,this.text=t,this.rawBytes=i,a==null?this.numBits=i==null?0:8*i.length:this.numBits=a,this.resultPoints=l,this.format=s,this.resultMetadata=null,u==null?this.timestamp=ie.currentTimeMillis():this.timestamp=u}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(t,i){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,i)}putAllMetadata(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))}addResultPoints(t){const i=this.resultPoints;if(i===null)this.resultPoints=t;else if(t!==null&&t.length>0){const a=new Array(i.length+t.length);ie.arraycopy(i,0,a,0,i.length),ie.arraycopy(t,0,a,i.length,t.length),this.resultPoints=a}}getTimestamp(){return this.timestamp}toString(){return this.text}}var ke;(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"})(ke||(ke={}));var Ae=ke,ct;(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"})(ct||(ct={}));var ft=ct;class Dt{constructor(t,i,a,l,s=-1,u=-1){this.rawBytes=t,this.text=i,this.byteSegments=a,this.ecLevel=l,this.structuredAppendSequenceNumber=s,this.structuredAppendParity=u,this.numBits=t==null?0:8*t.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(t){this.numBits=t}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(t){this.errorsCorrected=t}getErasures(){return this.erasures}setErasures(t){this.erasures=t}getOther(){return this.other}setOther(t){this.other=t}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Ii{exp(t){return this.expTable[t]}log(t){if(t===0)throw new M;return this.logTable[t]}static addOrSubtract(t,i){return t^i}}class xn{constructor(t,i){if(i.length===0)throw new M;this.field=t;const a=i.length;if(a>1&&i[0]===0){let l=1;for(;l<a&&i[l]===0;)l++;l===a?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(a-l),ie.arraycopy(i,l,this.coefficients,0,this.coefficients.length))}else this.coefficients=i}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(t===0)return this.getCoefficient(0);const i=this.coefficients;let a;if(t===1){a=0;for(let u=0,c=i.length;u!==c;u++){const x=i[u];a=Ii.addOrSubtract(a,x)}return a}a=i[0];const l=i.length,s=this.field;for(let u=1;u<l;u++)a=Ii.addOrSubtract(s.multiply(t,a),i[u]);return a}addOrSubtract(t){if(!this.field.equals(t.field))throw new M("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;let i=this.coefficients,a=t.coefficients;if(i.length>a.length){const u=i;i=a,a=u}let l=new Int32Array(a.length);const s=a.length-i.length;ie.arraycopy(a,0,l,0,s);for(let u=s;u<a.length;u++)l[u]=Ii.addOrSubtract(i[u-s],a[u]);return new xn(this.field,l)}multiply(t){if(!this.field.equals(t.field))throw new M("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();const i=this.coefficients,a=i.length,l=t.coefficients,s=l.length,u=new Int32Array(a+s-1),c=this.field;for(let x=0;x<a;x++){const p=i[x];for(let w=0;w<s;w++)u[x+w]=Ii.addOrSubtract(u[x+w],c.multiply(p,l[w]))}return new xn(c,u)}multiplyScalar(t){if(t===0)return this.field.getZero();if(t===1)return this;const i=this.coefficients.length,a=this.field,l=new Int32Array(i),s=this.coefficients;for(let u=0;u<i;u++)l[u]=a.multiply(s[u],t);return new xn(a,l)}multiplyByMonomial(t,i){if(t<0)throw new M;if(i===0)return this.field.getZero();const a=this.coefficients,l=a.length,s=new Int32Array(l+t),u=this.field;for(let c=0;c<l;c++)s[c]=u.multiply(a[c],i);return new xn(u,s)}divide(t){if(!this.field.equals(t.field))throw new M("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new M("Divide by 0");const i=this.field;let a=i.getZero(),l=this;const s=t.getCoefficient(t.getDegree()),u=i.inverse(s);for(;l.getDegree()>=t.getDegree()&&!l.isZero();){const c=l.getDegree()-t.getDegree(),x=i.multiply(l.getCoefficient(l.getDegree()),u),p=t.multiplyByMonomial(c,x),w=i.buildMonomial(c,x);a=a.addOrSubtract(w),l=l.addOrSubtract(p)}return[a,l]}toString(){let t="";for(let i=this.getDegree();i>=0;i--){let a=this.getCoefficient(i);if(a!==0){if(a<0?(t+=" - ",a=-a):t.length>0&&(t+=" + "),i===0||a!==1){const l=this.field.log(a);l===0?t+="1":l===1?t+="a":(t+="a^",t+=l)}i!==0&&(i===1?t+="x":(t+="x^",t+=i))}}return t}}class Ma extends A{}Ma.kind="ArithmeticException";class ht extends Ii{constructor(t,i,a){super(),this.primitive=t,this.size=i,this.generatorBase=a;const l=new Int32Array(i);let s=1;for(let c=0;c<i;c++)l[c]=s,s*=2,s>=i&&(s^=t,s&=i-1);this.expTable=l;const u=new Int32Array(i);for(let c=0;c<i-1;c++)u[l[c]]=c;this.logTable=u,this.zero=new xn(this,Int32Array.from([0])),this.one=new xn(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,i){if(t<0)throw new M;if(i===0)return this.zero;const a=new Int32Array(t+1);return a[0]=i,new xn(this,a)}inverse(t){if(t===0)throw new Ma;return this.expTable[this.size-this.logTable[t]-1]}multiply(t,i){return t===0||i===0?0:this.expTable[(this.logTable[t]+this.logTable[i])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+ne.toHexString(this.primitive)+","+this.size+")"}equals(t){return t===this}}ht.AZTEC_DATA_12=new ht(4201,4096,1),ht.AZTEC_DATA_10=new ht(1033,1024,1),ht.AZTEC_DATA_6=new ht(67,64,1),ht.AZTEC_PARAM=new ht(19,16,1),ht.QR_CODE_FIELD_256=new ht(285,256,0),ht.DATA_MATRIX_FIELD_256=new ht(301,256,1),ht.AZTEC_DATA_8=ht.DATA_MATRIX_FIELD_256,ht.MAXICODE_FIELD_64=ht.AZTEC_DATA_6;class Hn extends A{}Hn.kind="ReedSolomonException";class jn extends A{}jn.kind="IllegalStateException";class ta{constructor(t){this.field=t}decode(t,i){const a=this.field,l=new xn(a,t),s=new Int32Array(i);let u=!0;for(let B=0;B<i;B++){const U=l.evaluateAt(a.exp(B+a.getGeneratorBase()));s[s.length-1-B]=U,U!==0&&(u=!1)}if(u)return;const c=new xn(a,s),x=this.runEuclideanAlgorithm(a.buildMonomial(i,1),c,i),p=x[0],w=x[1],v=this.findErrorLocations(p),I=this.findErrorMagnitudes(w,v);for(let B=0;B<v.length;B++){const U=t.length-1-a.log(v[B]);if(U<0)throw new Hn("Bad error location");t[U]=ht.addOrSubtract(t[U],I[B])}}runEuclideanAlgorithm(t,i,a){if(t.getDegree()<i.getDegree()){const B=t;t=i,i=B}const l=this.field;let s=t,u=i,c=l.getZero(),x=l.getOne();for(;u.getDegree()>=(a/2|0);){let B=s,U=c;if(s=u,c=x,s.isZero())throw new Hn("r_{i-1} was zero");u=B;let z=l.getZero();const P=s.getCoefficient(s.getDegree()),W=l.inverse(P);for(;u.getDegree()>=s.getDegree()&&!u.isZero();){const me=u.getDegree()-s.getDegree(),xe=l.multiply(u.getCoefficient(u.getDegree()),W);z=z.addOrSubtract(l.buildMonomial(me,xe)),u=u.addOrSubtract(s.multiplyByMonomial(me,xe))}if(x=z.multiply(c).addOrSubtract(U),u.getDegree()>=s.getDegree())throw new jn("Division algorithm failed to reduce polynomial?")}const p=x.getCoefficient(0);if(p===0)throw new Hn("sigmaTilde(0) was zero");const w=l.inverse(p),v=x.multiplyScalar(w),I=u.multiplyScalar(w);return[v,I]}findErrorLocations(t){const i=t.getDegree();if(i===1)return Int32Array.from([t.getCoefficient(1)]);const a=new Int32Array(i);let l=0;const s=this.field;for(let u=1;u<s.getSize()&&l<i;u++)t.evaluateAt(u)===0&&(a[l]=s.inverse(u),l++);if(l!==i)throw new Hn("Error locator degree does not match number of roots");return a}findErrorMagnitudes(t,i){const a=i.length,l=new Int32Array(a),s=this.field;for(let u=0;u<a;u++){const c=s.inverse(i[u]);let x=1;for(let p=0;p<a;p++)if(u!==p){const w=s.multiply(i[p],c),v=(w&1)===0?w|1:w&-2;x=s.multiply(x,v)}l[u]=s.multiply(t.evaluateAt(c),s.inverse(x)),s.getGeneratorBase()!==0&&(l[u]=s.multiply(l[u],c))}return l}}var mn;(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"})(mn||(mn={}));class bt{decode(t){this.ddata=t;let i=t.getBits(),a=this.extractBits(i),l=this.correctBits(a),s=bt.convertBoolArrayToByteArray(l),u=bt.getEncodedData(l),c=new Dt(s,u,null,null);return c.setNumBits(l.length),c}static highLevelDecode(t){return this.getEncodedData(t)}static getEncodedData(t){let i=t.length,a=mn.UPPER,l=mn.UPPER,s="",u=0;for(;u<i;)if(l===mn.BINARY){if(i-u<5)break;let c=bt.readCode(t,u,5);if(u+=5,c===0){if(i-u<11)break;c=bt.readCode(t,u,11)+31,u+=11}for(let x=0;x<c;x++){if(i-u<8){u=i;break}const p=bt.readCode(t,u,8);s+=Ne.castAsNonUtf8Char(p),u+=8}l=a}else{let c=l===mn.DIGIT?4:5;if(i-u<c)break;let x=bt.readCode(t,u,c);u+=c;let p=bt.getCharacter(l,x);p.startsWith("CTRL_")?(a=l,l=bt.getTable(p.charAt(5)),p.charAt(6)==="L"&&(a=l)):(s+=p,l=a)}return s}static getTable(t){switch(t){case"L":return mn.LOWER;case"P":return mn.PUNCT;case"M":return mn.MIXED;case"D":return mn.DIGIT;case"B":return mn.BINARY;case"U":default:return mn.UPPER}}static getCharacter(t,i){switch(t){case mn.UPPER:return bt.UPPER_TABLE[i];case mn.LOWER:return bt.LOWER_TABLE[i];case mn.MIXED:return bt.MIXED_TABLE[i];case mn.PUNCT:return bt.PUNCT_TABLE[i];case mn.DIGIT:return bt.DIGIT_TABLE[i];default:throw new jn("Bad table")}}correctBits(t){let i,a;this.ddata.getNbLayers()<=2?(a=6,i=ht.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(a=8,i=ht.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(a=10,i=ht.AZTEC_DATA_10):(a=12,i=ht.AZTEC_DATA_12);let l=this.ddata.getNbDatablocks(),s=t.length/a;if(s<l)throw new le;let u=t.length%a,c=new Int32Array(s);for(let I=0;I<s;I++,u+=a)c[I]=bt.readCode(t,u,a);try{new ta(i).decode(c,s-l)}catch(I){throw new le(I)}let x=(1<<a)-1,p=0;for(let I=0;I<l;I++){let B=c[I];if(B===0||B===x)throw new le;(B===1||B===x-1)&&p++}let w=new Array(l*a-p),v=0;for(let I=0;I<l;I++){let B=c[I];if(B===1||B===x-1)w.fill(B>1,v,v+a-1),v+=a-1;else for(let U=a-1;U>=0;--U)w[v++]=(B&1<<U)!==0}return w}extractBits(t){let i=this.ddata.isCompact(),a=this.ddata.getNbLayers(),l=(i?11:14)+a*4,s=new Int32Array(l),u=new Array(this.totalBitsInLayer(a,i));if(i)for(let c=0;c<s.length;c++)s[c]=c;else{let c=l+1+2*ne.truncDivision(ne.truncDivision(l,2)-1,15),x=l/2,p=ne.truncDivision(c,2);for(let w=0;w<x;w++){let v=w+ne.truncDivision(w,15);s[x-w-1]=p-v-1,s[x+w]=p+v+1}}for(let c=0,x=0;c<a;c++){let p=(a-c)*4+(i?9:12),w=c*2,v=l-1-w;for(let I=0;I<p;I++){let B=I*2;for(let U=0;U<2;U++)u[x+B+U]=t.get(s[w+U],s[w+I]),u[x+2*p+B+U]=t.get(s[w+I],s[v-U]),u[x+4*p+B+U]=t.get(s[v-U],s[v-I]),u[x+6*p+B+U]=t.get(s[v-I],s[w+U])}x+=p*8}return u}static readCode(t,i,a){let l=0;for(let s=i;s<i+a;s++)l<<=1,t[s]&&(l|=1);return l}static readByte(t,i){let a=t.length-i;return a>=8?bt.readCode(t,i,8):bt.readCode(t,i,a)<<8-a}static convertBoolArrayToByteArray(t){let i=new Uint8Array((t.length+7)/8);for(let a=0;a<i.length;a++)i[a]=bt.readByte(t,8*a);return i}totalBitsInLayer(t,i){return((i?88:112)+16*t)*t}}bt.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"],bt.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"],bt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
|
||
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],bt.PUNCT_TABLE=["","\r",`\r
|
||
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],bt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class $e{constructor(){}static round(t){return t===NaN?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0}static distance(t,i,a,l){const s=t-a,u=i-l;return Math.sqrt(s*s+u*u)}static sum(t){let i=0;for(let a=0,l=t.length;a!==l;a++){const s=t[a];i+=s}return i}}class Ia{static floatToIntBits(t){return t}}Ia.MAX_VALUE=Number.MAX_SAFE_INTEGER;class Te{constructor(t,i){this.x=t,this.y=i}getX(){return this.x}getY(){return this.y}equals(t){if(t instanceof Te){const i=t;return this.x===i.x&&this.y===i.y}return!1}hashCode(){return 31*Ia.floatToIntBits(this.x)+Ia.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(t){const i=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),l=this.distance(t[0],t[2]);let s,u,c;if(a>=i&&a>=l?(u=t[0],s=t[1],c=t[2]):l>=a&&l>=i?(u=t[1],s=t[0],c=t[2]):(u=t[2],s=t[0],c=t[1]),this.crossProductZ(s,u,c)<0){const x=s;s=c,c=x}t[0]=s,t[1]=u,t[2]=c}static distance(t,i){return $e.distance(t.x,t.y,i.x,i.y)}static crossProductZ(t,i,a){const l=i.x,s=i.y;return(a.x-l)*(t.y-s)-(a.y-s)*(t.x-l)}}class Pr{constructor(t,i){this.bits=t,this.points=i}getBits(){return this.bits}getPoints(){return this.points}}class Bs extends Pr{constructor(t,i,a,l,s){super(t,i),this.compact=a,this.nbDatablocks=l,this.nbLayers=s}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class qt{constructor(t,i,a,l){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),i==null&&(i=qt.INIT_SIZE),a==null&&(a=t.getWidth()/2|0),l==null&&(l=t.getHeight()/2|0);const s=i/2|0;if(this.leftInit=a-s,this.rightInit=a+s,this.upInit=l-s,this.downInit=l+s,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new q}detect(){let t=this.leftInit,i=this.rightInit,a=this.upInit,l=this.downInit,s=!1,u=!0,c=!1,x=!1,p=!1,w=!1,v=!1;const I=this.width,B=this.height;for(;u;){u=!1;let U=!0;for(;(U||!x)&&i<I;)U=this.containsBlackPoint(a,l,i,!1),U?(i++,u=!0,x=!0):x||i++;if(i>=I){s=!0;break}let z=!0;for(;(z||!p)&&l<B;)z=this.containsBlackPoint(t,i,l,!0),z?(l++,u=!0,p=!0):p||l++;if(l>=B){s=!0;break}let P=!0;for(;(P||!w)&&t>=0;)P=this.containsBlackPoint(a,l,t,!1),P?(t--,u=!0,w=!0):w||t--;if(t<0){s=!0;break}let W=!0;for(;(W||!v)&&a>=0;)W=this.containsBlackPoint(t,i,a,!0),W?(a--,u=!0,v=!0):v||a--;if(a<0){s=!0;break}u&&(c=!0)}if(!s&&c){const U=i-t;let z=null;for(let xe=1;z===null&&xe<U;xe++)z=this.getBlackPointOnSegment(t,l-xe,t+xe,l);if(z==null)throw new q;let P=null;for(let xe=1;P===null&&xe<U;xe++)P=this.getBlackPointOnSegment(t,a+xe,t+xe,a);if(P==null)throw new q;let W=null;for(let xe=1;W===null&&xe<U;xe++)W=this.getBlackPointOnSegment(i,a+xe,i-xe,a);if(W==null)throw new q;let me=null;for(let xe=1;me===null&&xe<U;xe++)me=this.getBlackPointOnSegment(i,l-xe,i-xe,l);if(me==null)throw new q;return this.centerEdges(me,z,W,P)}else throw new q}getBlackPointOnSegment(t,i,a,l){const s=$e.round($e.distance(t,i,a,l)),u=(a-t)/s,c=(l-i)/s,x=this.image;for(let p=0;p<s;p++){const w=$e.round(t+p*u),v=$e.round(i+p*c);if(x.get(w,v))return new Te(w,v)}return null}centerEdges(t,i,a,l){const s=t.getX(),u=t.getY(),c=i.getX(),x=i.getY(),p=a.getX(),w=a.getY(),v=l.getX(),I=l.getY(),B=qt.CORR;return s<this.width/2?[new Te(v-B,I+B),new Te(c+B,x+B),new Te(p-B,w-B),new Te(s+B,u-B)]:[new Te(v+B,I+B),new Te(c+B,x-B),new Te(p-B,w+B),new Te(s-B,u-B)]}containsBlackPoint(t,i,a,l){const s=this.image;if(l){for(let u=t;u<=i;u++)if(s.get(u,a))return!0}else for(let u=t;u<=i;u++)if(s.get(a,u))return!0;return!1}}qt.INIT_SIZE=10,qt.CORR=1;class Rl{static checkAndNudgePoints(t,i){const a=t.getWidth(),l=t.getHeight();let s=!0;for(let u=0;u<i.length&&s;u+=2){const c=Math.floor(i[u]),x=Math.floor(i[u+1]);if(c<-1||c>a||x<-1||x>l)throw new q;s=!1,c===-1?(i[u]=0,s=!0):c===a&&(i[u]=a-1,s=!0),x===-1?(i[u+1]=0,s=!0):x===l&&(i[u+1]=l-1,s=!0)}s=!0;for(let u=i.length-2;u>=0&&s;u-=2){const c=Math.floor(i[u]),x=Math.floor(i[u+1]);if(c<-1||c>a||x<-1||x>l)throw new q;s=!1,c===-1?(i[u]=0,s=!0):c===a&&(i[u]=a-1,s=!0),x===-1?(i[u+1]=0,s=!0):x===l&&(i[u+1]=l-1,s=!0)}}}class Pn{constructor(t,i,a,l,s,u,c,x,p){this.a11=t,this.a21=i,this.a31=a,this.a12=l,this.a22=s,this.a32=u,this.a13=c,this.a23=x,this.a33=p}static quadrilateralToQuadrilateral(t,i,a,l,s,u,c,x,p,w,v,I,B,U,z,P){const W=Pn.quadrilateralToSquare(t,i,a,l,s,u,c,x);return Pn.squareToQuadrilateral(p,w,v,I,B,U,z,P).times(W)}transformPoints(t){const i=t.length,a=this.a11,l=this.a12,s=this.a13,u=this.a21,c=this.a22,x=this.a23,p=this.a31,w=this.a32,v=this.a33;for(let I=0;I<i;I+=2){const B=t[I],U=t[I+1],z=s*B+x*U+v;t[I]=(a*B+u*U+p)/z,t[I+1]=(l*B+c*U+w)/z}}transformPointsWithValues(t,i){const a=this.a11,l=this.a12,s=this.a13,u=this.a21,c=this.a22,x=this.a23,p=this.a31,w=this.a32,v=this.a33,I=t.length;for(let B=0;B<I;B++){const U=t[B],z=i[B],P=s*U+x*z+v;t[B]=(a*U+u*z+p)/P,i[B]=(l*U+c*z+w)/P}}static squareToQuadrilateral(t,i,a,l,s,u,c,x){const p=t-a+s-c,w=i-l+u-x;if(p===0&&w===0)return new Pn(a-t,s-a,t,l-i,u-l,i,0,0,1);{const v=a-s,I=c-s,B=l-u,U=x-u,z=v*U-I*B,P=(p*U-I*w)/z,W=(v*w-p*B)/z;return new Pn(a-t+P*a,c-t+W*c,t,l-i+P*l,x-i+W*x,i,P,W,1)}}static quadrilateralToSquare(t,i,a,l,s,u,c,x){return Pn.squareToQuadrilateral(t,i,a,l,s,u,c,x).buildAdjoint()}buildAdjoint(){return new Pn(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)}times(t){return new Pn(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)}}class Dl extends Rl{sampleGrid(t,i,a,l,s,u,c,x,p,w,v,I,B,U,z,P,W,me,xe){const ge=Pn.quadrilateralToQuadrilateral(l,s,u,c,x,p,w,v,I,B,U,z,P,W,me,xe);return this.sampleGridWithTransform(t,i,a,ge)}sampleGridWithTransform(t,i,a,l){if(i<=0||a<=0)throw new q;const s=new at(i,a),u=new Float32Array(2*i);for(let c=0;c<a;c++){const x=u.length,p=c+.5;for(let w=0;w<x;w+=2)u[w]=w/2+.5,u[w+1]=p;l.transformPoints(u),Rl.checkAndNudgePoints(t,u);try{for(let w=0;w<x;w+=2)t.get(Math.floor(u[w]),Math.floor(u[w+1]))&&s.set(w/2,c)}catch{throw new q}}return s}}class Jn{static setGridSampler(t){Jn.gridSampler=t}static getInstance(){return Jn.gridSampler}}Jn.gridSampler=new Dl;class Tn{constructor(t,i){this.x=t,this.y=i}toResultPoint(){return new Te(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class Bl{constructor(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}detect(){return this.detectMirror(!1)}detectMirror(t){let i=this.getMatrixCenter(),a=this.getBullsEyeCorners(i);if(t){let u=a[0];a[0]=a[2],a[2]=u}this.extractParameters(a);let l=this.sampleGrid(this.image,a[this.shift%4],a[(this.shift+1)%4],a[(this.shift+2)%4],a[(this.shift+3)%4]),s=this.getMatrixCornerPoints(a);return new Bs(l,s,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(t){if(!this.isValidPoint(t[0])||!this.isValidPoint(t[1])||!this.isValidPoint(t[2])||!this.isValidPoint(t[3]))throw new q;let i=2*this.nbCenterLayers,a=new Int32Array([this.sampleLine(t[0],t[1],i),this.sampleLine(t[1],t[2],i),this.sampleLine(t[2],t[3],i),this.sampleLine(t[3],t[0],i)]);this.shift=this.getRotation(a,i);let l=0;for(let u=0;u<4;u++){let c=a[(this.shift+u)%4];this.compact?(l<<=7,l+=c>>1&127):(l<<=10,l+=(c>>2&992)+(c>>1&31))}let s=this.getCorrectedParameterData(l,this.compact);this.compact?(this.nbLayers=(s>>6)+1,this.nbDataBlocks=(s&63)+1):(this.nbLayers=(s>>11)+1,this.nbDataBlocks=(s&2047)+1)}getRotation(t,i){let a=0;t.forEach((l,s,u)=>{let c=(l>>i-2<<1)+(l&1);a=(a<<3)+c}),a=((a&1)<<11)+(a>>1);for(let l=0;l<4;l++)if(ne.bitCount(a^this.EXPECTED_CORNER_BITS[l])<=2)return l;throw new q}getCorrectedParameterData(t,i){let a,l;i?(a=7,l=2):(a=10,l=4);let s=a-l,u=new Int32Array(a);for(let x=a-1;x>=0;--x)u[x]=t&15,t>>=4;try{new ta(ht.AZTEC_PARAM).decode(u,s)}catch{throw new q}let c=0;for(let x=0;x<l;x++)c=(c<<4)+u[x];return c}getBullsEyeCorners(t){let i=t,a=t,l=t,s=t,u=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let v=this.getFirstDifferent(i,u,1,-1),I=this.getFirstDifferent(a,u,1,1),B=this.getFirstDifferent(l,u,-1,1),U=this.getFirstDifferent(s,u,-1,-1);if(this.nbCenterLayers>2){let z=this.distancePoint(U,v)*this.nbCenterLayers/(this.distancePoint(s,i)*(this.nbCenterLayers+2));if(z<.75||z>1.25||!this.isWhiteOrBlackRectangle(v,I,B,U))break}i=v,a=I,l=B,s=U,u=!u}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new q;this.compact=this.nbCenterLayers===5;let c=new Te(i.getX()+.5,i.getY()-.5),x=new Te(a.getX()+.5,a.getY()+.5),p=new Te(l.getX()-.5,l.getY()+.5),w=new Te(s.getX()-.5,s.getY()-.5);return this.expandSquare([c,x,p,w],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let t,i,a,l;try{let c=new qt(this.image).detect();t=c[0],i=c[1],a=c[2],l=c[3]}catch{let x=this.image.getWidth()/2,p=this.image.getHeight()/2;t=this.getFirstDifferent(new Tn(x+7,p-7),!1,1,-1).toResultPoint(),i=this.getFirstDifferent(new Tn(x+7,p+7),!1,1,1).toResultPoint(),a=this.getFirstDifferent(new Tn(x-7,p+7),!1,-1,1).toResultPoint(),l=this.getFirstDifferent(new Tn(x-7,p-7),!1,-1,-1).toResultPoint()}let s=$e.round((t.getX()+l.getX()+i.getX()+a.getX())/4),u=$e.round((t.getY()+l.getY()+i.getY()+a.getY())/4);try{let c=new qt(this.image,15,s,u).detect();t=c[0],i=c[1],a=c[2],l=c[3]}catch{t=this.getFirstDifferent(new Tn(s+7,u-7),!1,1,-1).toResultPoint(),i=this.getFirstDifferent(new Tn(s+7,u+7),!1,1,1).toResultPoint(),a=this.getFirstDifferent(new Tn(s-7,u+7),!1,-1,1).toResultPoint(),l=this.getFirstDifferent(new Tn(s-7,u-7),!1,-1,-1).toResultPoint()}return s=$e.round((t.getX()+l.getX()+i.getX()+a.getX())/4),u=$e.round((t.getY()+l.getY()+i.getY()+a.getY())/4),new Tn(s,u)}getMatrixCornerPoints(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())}sampleGrid(t,i,a,l,s){let u=Jn.getInstance(),c=this.getDimension(),x=c/2-this.nbCenterLayers,p=c/2+this.nbCenterLayers;return u.sampleGrid(t,c,c,x,x,p,x,p,p,x,p,i.getX(),i.getY(),a.getX(),a.getY(),l.getX(),l.getY(),s.getX(),s.getY())}sampleLine(t,i,a){let l=0,s=this.distanceResultPoint(t,i),u=s/a,c=t.getX(),x=t.getY(),p=u*(i.getX()-t.getX())/s,w=u*(i.getY()-t.getY())/s;for(let v=0;v<a;v++)this.image.get($e.round(c+v*p),$e.round(x+v*w))&&(l|=1<<a-v-1);return l}isWhiteOrBlackRectangle(t,i,a,l){let s=3;t=new Tn(t.getX()-s,t.getY()+s),i=new Tn(i.getX()-s,i.getY()-s),a=new Tn(a.getX()+s,a.getY()-s),l=new Tn(l.getX()+s,l.getY()+s);let u=this.getColor(l,t);if(u===0)return!1;let c=this.getColor(t,i);return c!==u||(c=this.getColor(i,a),c!==u)?!1:(c=this.getColor(a,l),c===u)}getColor(t,i){let a=this.distancePoint(t,i),l=(i.getX()-t.getX())/a,s=(i.getY()-t.getY())/a,u=0,c=t.getX(),x=t.getY(),p=this.image.get(t.getX(),t.getY()),w=Math.ceil(a);for(let I=0;I<w;I++)c+=l,x+=s,this.image.get($e.round(c),$e.round(x))!==p&&u++;let v=u/a;return v>.1&&v<.9?0:v<=.1===p?1:-1}getFirstDifferent(t,i,a,l){let s=t.getX()+a,u=t.getY()+l;for(;this.isValid(s,u)&&this.image.get(s,u)===i;)s+=a,u+=l;for(s-=a,u-=l;this.isValid(s,u)&&this.image.get(s,u)===i;)s+=a;for(s-=a;this.isValid(s,u)&&this.image.get(s,u)===i;)u+=l;return u-=l,new Tn(s,u)}expandSquare(t,i,a){let l=a/(2*i),s=t[0].getX()-t[2].getX(),u=t[0].getY()-t[2].getY(),c=(t[0].getX()+t[2].getX())/2,x=(t[0].getY()+t[2].getY())/2,p=new Te(c+l*s,x+l*u),w=new Te(c-l*s,x-l*u);s=t[1].getX()-t[3].getX(),u=t[1].getY()-t[3].getY(),c=(t[1].getX()+t[3].getX())/2,x=(t[1].getY()+t[3].getY())/2;let v=new Te(c+l*s,x+l*u),I=new Te(c-l*s,x-l*u);return[p,v,w,I]}isValid(t,i){return t>=0&&t<this.image.getWidth()&&i>0&&i<this.image.getHeight()}isValidPoint(t){let i=$e.round(t.getX()),a=$e.round(t.getY());return this.isValid(i,a)}distancePoint(t,i){return $e.distance(t.getX(),t.getY(),i.getX(),i.getY())}distanceResultPoint(t,i){return $e.distance(t.getX(),t.getY(),i.getX(),i.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(ne.truncDivision(this.nbLayers-4,8)+1)+15}}class Yr{decode(t,i=null){let a=null,l=new Bl(t.getBlackMatrix()),s=null,u=null;try{let w=l.detectMirror(!1);s=w.getPoints(),this.reportFoundResultPoints(i,s),u=new bt().decode(w)}catch(w){a=w}if(u==null)try{let w=l.detectMirror(!0);s=w.getPoints(),this.reportFoundResultPoints(i,s),u=new bt().decode(w)}catch(w){throw a??w}let c=new Ce(u.getText(),u.getRawBytes(),u.getNumBits(),s,Ae.AZTEC,ie.currentTimeMillis()),x=u.getByteSegments();x!=null&&c.putMetadata(ft.BYTE_SEGMENTS,x);let p=u.getECLevel();return p!=null&&c.putMetadata(ft.ERROR_CORRECTION_LEVEL,p),c}reportFoundResultPoints(t,i){if(t!=null){let a=t.get(Be.NEED_RESULT_POINT_CALLBACK);a!=null&&i.forEach((l,s,u)=>{a.foundPossibleResultPoint(l)})}}reset(){}}class cu extends Ee{constructor(t=500){super(new Yr,t)}}class kt{decode(t,i){try{return this.doDecode(t,i)}catch{if(i&&i.get(Be.TRY_HARDER)===!0&&t.isRotateSupported()){const s=t.rotateCounterClockwise(),u=this.doDecode(s,i),c=u.getResultMetadata();let x=270;c!==null&&c.get(ft.ORIENTATION)===!0&&(x=x+c.get(ft.ORIENTATION)%360),u.putMetadata(ft.ORIENTATION,x);const p=u.getResultPoints();if(p!==null){const w=s.getHeight();for(let v=0;v<p.length;v++)p[v]=new Te(w-p[v].getY()-1,p[v].getX())}return u}else throw new q}}reset(){}doDecode(t,i){const a=t.getWidth(),l=t.getHeight();let s=new we(a);const u=i&&i.get(Be.TRY_HARDER)===!0,c=Math.max(1,l>>(u?8:5));let x;u?x=l:x=15;const p=Math.trunc(l/2);for(let w=0;w<x;w++){const v=Math.trunc((w+1)/2),I=(w&1)===0,B=p+c*(I?v:-v);if(B<0||B>=l)break;try{s=t.getBlackRow(B,s)}catch{continue}for(let U=0;U<2;U++){if(U===1&&(s.reverse(),i&&i.get(Be.NEED_RESULT_POINT_CALLBACK)===!0)){const z=new Map;i.forEach((P,W)=>z.set(W,P)),z.delete(Be.NEED_RESULT_POINT_CALLBACK),i=z}try{const z=this.decodeRow(B,s,i);if(U===1){z.putMetadata(ft.ORIENTATION,180);const P=z.getResultPoints();P!==null&&(P[0]=new Te(a-P[0].getX()-1,P[0].getY()),P[1]=new Te(a-P[1].getX()-1,P[1].getY()))}return z}catch{}}}throw new q}static recordPattern(t,i,a){const l=a.length;for(let p=0;p<l;p++)a[p]=0;const s=t.getSize();if(i>=s)throw new q;let u=!t.get(i),c=0,x=i;for(;x<s;){if(t.get(x)!==u)a[c]++;else{if(++c===l)break;a[c]=1,u=!u}x++}if(!(c===l||c===l-1&&x===s))throw new q}static recordPatternInReverse(t,i,a){let l=a.length,s=t.get(i);for(;i>0&&l>=0;)t.get(--i)!==s&&(l--,s=!s);if(l>=0)throw new q;kt.recordPattern(t,i+1,a)}static patternMatchVariance(t,i,a){const l=t.length;let s=0,u=0;for(let p=0;p<l;p++)s+=t[p],u+=i[p];if(s<u)return Number.POSITIVE_INFINITY;const c=s/u;a*=c;let x=0;for(let p=0;p<l;p++){const w=t[p],v=i[p]*c,I=w>v?w-v:v-w;if(I>a)return Number.POSITIVE_INFINITY;x+=I}return x/s}}class ye extends kt{static findStartPattern(t){const i=t.getSize(),a=t.getNextSet(0);let l=0,s=Int32Array.from([0,0,0,0,0,0]),u=a,c=!1;const x=6;for(let p=a;p<i;p++)if(t.get(p)!==c)s[l]++;else{if(l===x-1){let w=ye.MAX_AVG_VARIANCE,v=-1;for(let I=ye.CODE_START_A;I<=ye.CODE_START_C;I++){const B=kt.patternMatchVariance(s,ye.CODE_PATTERNS[I],ye.MAX_INDIVIDUAL_VARIANCE);B<w&&(w=B,v=I)}if(v>=0&&t.isRange(Math.max(0,u-(p-u)/2),u,!1))return Int32Array.from([u,p,v]);u+=s[0]+s[1],s=s.slice(2,s.length-1),s[l-1]=0,s[l]=0,l--}else l++;s[l]=1,c=!c}throw new q}static decodeCode(t,i,a){kt.recordPattern(t,a,i);let l=ye.MAX_AVG_VARIANCE,s=-1;for(let u=0;u<ye.CODE_PATTERNS.length;u++){const c=ye.CODE_PATTERNS[u],x=this.patternMatchVariance(i,c,ye.MAX_INDIVIDUAL_VARIANCE);x<l&&(l=x,s=u)}if(s>=0)return s;throw new q}decodeRow(t,i,a){const l=a&&a.get(Be.ASSUME_GS1)===!0,s=ye.findStartPattern(i),u=s[2];let c=0;const x=new Uint8Array(20);x[c++]=u;let p;switch(u){case ye.CODE_START_A:p=ye.CODE_CODE_A;break;case ye.CODE_START_B:p=ye.CODE_CODE_B;break;case ye.CODE_START_C:p=ye.CODE_CODE_C;break;default:throw new le}let w=!1,v=!1,I="",B=s[0],U=s[1];const z=Int32Array.from([0,0,0,0,0,0]);let P=0,W=0,me=u,xe=0,ge=!0,qe=!1,He=!1;for(;!w;){const oa=v;switch(v=!1,P=W,W=ye.decodeCode(i,z,U),x[c++]=W,W!==ye.CODE_STOP&&(ge=!0),W!==ye.CODE_STOP&&(xe++,me+=xe*W),B=U,U+=z.reduce((qs,Xl)=>qs+Xl,0),W){case ye.CODE_START_A:case ye.CODE_START_B:case ye.CODE_START_C:throw new le}switch(p){case ye.CODE_CODE_A:if(W<64)He===qe?I+=String.fromCharCode(32+W):I+=String.fromCharCode(32+W+128),He=!1;else if(W<96)He===qe?I+=String.fromCharCode(W-64):I+=String.fromCharCode(W+64),He=!1;else switch(W!==ye.CODE_STOP&&(ge=!1),W){case ye.CODE_FNC_1:l&&(I.length===0?I+="]C1":I+="");break;case ye.CODE_FNC_2:case ye.CODE_FNC_3:break;case ye.CODE_FNC_4_A:!qe&&He?(qe=!0,He=!1):qe&&He?(qe=!1,He=!1):He=!0;break;case ye.CODE_SHIFT:v=!0,p=ye.CODE_CODE_B;break;case ye.CODE_CODE_B:p=ye.CODE_CODE_B;break;case ye.CODE_CODE_C:p=ye.CODE_CODE_C;break;case ye.CODE_STOP:w=!0;break}break;case ye.CODE_CODE_B:if(W<96)He===qe?I+=String.fromCharCode(32+W):I+=String.fromCharCode(32+W+128),He=!1;else switch(W!==ye.CODE_STOP&&(ge=!1),W){case ye.CODE_FNC_1:l&&(I.length===0?I+="]C1":I+="");break;case ye.CODE_FNC_2:case ye.CODE_FNC_3:break;case ye.CODE_FNC_4_B:!qe&&He?(qe=!0,He=!1):qe&&He?(qe=!1,He=!1):He=!0;break;case ye.CODE_SHIFT:v=!0,p=ye.CODE_CODE_A;break;case ye.CODE_CODE_A:p=ye.CODE_CODE_A;break;case ye.CODE_CODE_C:p=ye.CODE_CODE_C;break;case ye.CODE_STOP:w=!0;break}break;case ye.CODE_CODE_C:if(W<100)W<10&&(I+="0"),I+=W;else switch(W!==ye.CODE_STOP&&(ge=!1),W){case ye.CODE_FNC_1:l&&(I.length===0?I+="]C1":I+="");break;case ye.CODE_CODE_A:p=ye.CODE_CODE_A;break;case ye.CODE_CODE_B:p=ye.CODE_CODE_B;break;case ye.CODE_STOP:w=!0;break}break}oa&&(p=p===ye.CODE_CODE_A?ye.CODE_CODE_B:ye.CODE_CODE_A)}const Jt=U-B;if(U=i.getNextUnset(U),!i.isRange(U,Math.min(i.getSize(),U+(U-B)/2),!1))throw new q;if(me-=xe*P,me%103!==P)throw new Z;const Xn=I.length;if(Xn===0)throw new q;Xn>0&&ge&&(p===ye.CODE_CODE_C?I=I.substring(0,Xn-2):I=I.substring(0,Xn-1));const Nn=(s[1]+s[0])/2,St=B+Jt/2,En=x.length,kn=new Uint8Array(En);for(let oa=0;oa<En;oa++)kn[oa]=x[oa];const Ya=[new Te(Nn,t),new Te(St,t)];return new Ce(I,kn,0,Ya,Ae.CODE_128,new Date().getTime())}}ye.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])],ye.MAX_AVG_VARIANCE=.25,ye.MAX_INDIVIDUAL_VARIANCE=.7,ye.CODE_SHIFT=98,ye.CODE_CODE_C=99,ye.CODE_CODE_B=100,ye.CODE_CODE_A=101,ye.CODE_FNC_1=102,ye.CODE_FNC_2=97,ye.CODE_FNC_3=96,ye.CODE_FNC_4_A=101,ye.CODE_FNC_4_B=100,ye.CODE_START_A=103,ye.CODE_START_B=104,ye.CODE_START_C=105,ye.CODE_STOP=106;class It extends kt{constructor(t=!1,i=!1){super(),this.usingCheckDigit=t,this.extendedMode=i,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(t,i,a){let l=this.counters;l.fill(0),this.decodeRowResult="";let s=It.findAsteriskPattern(i,l),u=i.getNextSet(s[1]),c=i.getSize(),x,p;do{It.recordPattern(i,u,l);let z=It.toNarrowWidePattern(l);if(z<0)throw new q;x=It.patternToChar(z),this.decodeRowResult+=x,p=u;for(let P of l)u+=P;u=i.getNextSet(u)}while(x!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let w=0;for(let z of l)w+=z;let v=u-p-w;if(u!==c&&v*2<w)throw new q;if(this.usingCheckDigit){let z=this.decodeRowResult.length-1,P=0;for(let W=0;W<z;W++)P+=It.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(W));if(this.decodeRowResult.charAt(z)!==It.ALPHABET_STRING.charAt(P%43))throw new Z;this.decodeRowResult=this.decodeRowResult.substring(0,z)}if(this.decodeRowResult.length===0)throw new q;let I;this.extendedMode?I=It.decodeExtended(this.decodeRowResult):I=this.decodeRowResult;let B=(s[1]+s[0])/2,U=p+w/2;return new Ce(I,null,0,[new Te(B,t),new Te(U,t)],Ae.CODE_39,new Date().getTime())}static findAsteriskPattern(t,i){let a=t.getSize(),l=t.getNextSet(0),s=0,u=l,c=!1,x=i.length;for(let p=l;p<a;p++)if(t.get(p)!==c)i[s]++;else{if(s===x-1){if(this.toNarrowWidePattern(i)===It.ASTERISK_ENCODING&&t.isRange(Math.max(0,u-Math.floor((p-u)/2)),u,!1))return[u,p];u+=i[0]+i[1],i.copyWithin(0,2,2+s-1),i[s-1]=0,i[s]=0,s--}else s++;i[s]=1,c=!c}throw new q}static toNarrowWidePattern(t){let i=t.length,a=0,l;do{let s=2147483647;for(let x of t)x<s&&x>a&&(s=x);a=s,l=0;let u=0,c=0;for(let x=0;x<i;x++){let p=t[x];p>a&&(c|=1<<i-1-x,l++,u+=p)}if(l===3){for(let x=0;x<i&&l>0;x++){let p=t[x];if(p>a&&(l--,p*2>=u))return-1}return c}}while(l>3);return-1}static patternToChar(t){for(let i=0;i<It.CHARACTER_ENCODINGS.length;i++)if(It.CHARACTER_ENCODINGS[i]===t)return It.ALPHABET_STRING.charAt(i);if(t===It.ASTERISK_ENCODING)return"*";throw new q}static decodeExtended(t){let i=t.length,a="";for(let l=0;l<i;l++){let s=t.charAt(l);if(s==="+"||s==="$"||s==="%"||s==="/"){let u=t.charAt(l+1),c="\0";switch(s){case"+":if(u>="A"&&u<="Z")c=String.fromCharCode(u.charCodeAt(0)+32);else throw new le;break;case"$":if(u>="A"&&u<="Z")c=String.fromCharCode(u.charCodeAt(0)-64);else throw new le;break;case"%":if(u>="A"&&u<="E")c=String.fromCharCode(u.charCodeAt(0)-38);else if(u>="F"&&u<="J")c=String.fromCharCode(u.charCodeAt(0)-11);else if(u>="K"&&u<="O")c=String.fromCharCode(u.charCodeAt(0)+16);else if(u>="P"&&u<="T")c=String.fromCharCode(u.charCodeAt(0)+43);else if(u==="U")c="\0";else if(u==="V")c="@";else if(u==="W")c="`";else if(u==="X"||u==="Y"||u==="Z")c="";else throw new le;break;case"/":if(u>="A"&&u<="O")c=String.fromCharCode(u.charCodeAt(0)-32);else if(u==="Z")c=":";else throw new le;break}a+=c,l++}else a+=s}return a}}It.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",It.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],It.ASTERISK_ENCODING=148;class Ge extends kt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(t,i,a){let l=this.decodeStart(i),s=this.decodeEnd(i),u=new We;Ge.decodeMiddle(i,l[1],s[0],u);let c=u.toString(),x=null;a!=null&&(x=a.get(Be.ALLOWED_LENGTHS)),x==null&&(x=Ge.DEFAULT_ALLOWED_LENGTHS);let p=c.length,w=!1,v=0;for(let U of x){if(p===U){w=!0;break}U>v&&(v=U)}if(!w&&p>v&&(w=!0),!w)throw new le;const I=[new Te(l[1],t),new Te(s[0],t)];return new Ce(c,null,0,I,Ae.ITF,new Date().getTime())}static decodeMiddle(t,i,a,l){let s=new Int32Array(10),u=new Int32Array(5),c=new Int32Array(5);for(s.fill(0),u.fill(0),c.fill(0);i<a;){kt.recordPattern(t,i,s);for(let p=0;p<5;p++){let w=2*p;u[p]=s[w],c[p]=s[w+1]}let x=Ge.decodeDigit(u);l.append(x.toString()),x=this.decodeDigit(c),l.append(x.toString()),s.forEach(function(p){i+=p})}}decodeStart(t){let i=Ge.skipWhiteSpace(t),a=Ge.findGuardPattern(t,i,Ge.START_PATTERN);return this.narrowLineWidth=(a[1]-a[0])/4,this.validateQuietZone(t,a[0]),a}validateQuietZone(t,i){let a=this.narrowLineWidth*10;a=a<i?a:i;for(let l=i-1;a>0&&l>=0&&!t.get(l);l--)a--;if(a!==0)throw new q}static skipWhiteSpace(t){const i=t.getSize(),a=t.getNextSet(0);if(a===i)throw new q;return a}decodeEnd(t){t.reverse();try{let i=Ge.skipWhiteSpace(t),a;try{a=Ge.findGuardPattern(t,i,Ge.END_PATTERN_REVERSED[0])}catch(s){s instanceof q&&(a=Ge.findGuardPattern(t,i,Ge.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,a[0]);let l=a[0];return a[0]=t.getSize()-a[1],a[1]=t.getSize()-l,a}finally{t.reverse()}}static findGuardPattern(t,i,a){let l=a.length,s=new Int32Array(l),u=t.getSize(),c=!1,x=0,p=i;s.fill(0);for(let w=i;w<u;w++)if(t.get(w)!==c)s[x]++;else{if(x===l-1){if(kt.patternMatchVariance(s,a,Ge.MAX_INDIVIDUAL_VARIANCE)<Ge.MAX_AVG_VARIANCE)return[p,w];p+=s[0]+s[1],ie.arraycopy(s,2,s,0,x-1),s[x-1]=0,s[x]=0,x--}else x++;s[x]=1,c=!c}throw new q}static decodeDigit(t){let i=Ge.MAX_AVG_VARIANCE,a=-1,l=Ge.PATTERNS.length;for(let s=0;s<l;s++){let u=Ge.PATTERNS[s],c=kt.patternMatchVariance(t,u,Ge.MAX_INDIVIDUAL_VARIANCE);c<i?(i=c,a=s):c===i&&(a=-1)}if(a>=0)return a%10;throw new q}}Ge.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])],Ge.MAX_AVG_VARIANCE=.38,Ge.MAX_INDIVIDUAL_VARIANCE=.5,Ge.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Ge.START_PATTERN=Int32Array.from([1,1,1,1]),Ge.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class Vt extends kt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(t){let i=!1,a,l=0,s=Int32Array.from([0,0,0]);for(;!i;){s=Int32Array.from([0,0,0]),a=Vt.findGuardPattern(t,l,!1,this.START_END_PATTERN,s);let u=a[0];l=a[1];let c=u-(l-u);c>=0&&(i=t.isRange(c,u,!1))}return a}static checkChecksum(t){return Vt.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let i=t.length;if(i===0)return!1;let a=parseInt(t.charAt(i-1),10);return Vt.getStandardUPCEANChecksum(t.substring(0,i-1))===a}static getStandardUPCEANChecksum(t){let i=t.length,a=0;for(let l=i-1;l>=0;l-=2){let s=t.charAt(l).charCodeAt(0)-48;if(s<0||s>9)throw new le;a+=s}a*=3;for(let l=i-2;l>=0;l-=2){let s=t.charAt(l).charCodeAt(0)-48;if(s<0||s>9)throw new le;a+=s}return(1e3-a)%10}static decodeEnd(t,i){return Vt.findGuardPattern(t,i,!1,Vt.START_END_PATTERN,new Int32Array(Vt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(t,i,a,l){return this.findGuardPattern(t,i,a,l,new Int32Array(l.length))}static findGuardPattern(t,i,a,l,s){let u=t.getSize();i=a?t.getNextUnset(i):t.getNextSet(i);let c=0,x=i,p=l.length,w=a;for(let v=i;v<u;v++)if(t.get(v)!==w)s[c]++;else{if(c===p-1){if(kt.patternMatchVariance(s,l,Vt.MAX_INDIVIDUAL_VARIANCE)<Vt.MAX_AVG_VARIANCE)return Int32Array.from([x,v]);x+=s[0]+s[1];let I=s.slice(2,s.length-1);for(let B=0;B<c-1;B++)s[B]=I[B];s[c-1]=0,s[c]=0,c--}else c++;s[c]=1,w=!w}throw new q}static decodeDigit(t,i,a,l){this.recordPattern(t,a,i);let s=this.MAX_AVG_VARIANCE,u=-1,c=l.length;for(let x=0;x<c;x++){let p=l[x],w=kt.patternMatchVariance(i,p,Vt.MAX_INDIVIDUAL_VARIANCE);w<s&&(s=w,u=x)}if(u>=0)return u;throw new q}}Vt.MAX_AVG_VARIANCE=.48,Vt.MAX_INDIVIDUAL_VARIANCE=.7,Vt.START_END_PATTERN=Int32Array.from([1,1,1]),Vt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),Vt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Vt.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])];class gr{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,i,a){let l=this.decodeRowStringBuffer,s=this.decodeMiddle(i,a,l),u=l.toString(),c=gr.parseExtensionString(u),x=[new Te((a[0]+a[1])/2,t),new Te(s,t)],p=new Ce(u,null,0,x,Ae.UPC_EAN_EXTENSION,new Date().getTime());return c!=null&&p.putAllMetadata(c),p}decodeMiddle(t,i,a){let l=this.decodeMiddleCounters;l[0]=0,l[1]=0,l[2]=0,l[3]=0;let s=t.getSize(),u=i[1],c=0;for(let p=0;p<5&&u<s;p++){let w=Vt.decodeDigit(t,l,u,Vt.L_AND_G_PATTERNS);a+=String.fromCharCode(48+w%10);for(let v of l)u+=v;w>=10&&(c|=1<<4-p),p!==4&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(a.length!==5)throw new q;let x=this.determineCheckDigit(c);if(gr.extensionChecksum(a.toString())!==x)throw new q;return u}static extensionChecksum(t){let i=t.length,a=0;for(let l=i-2;l>=0;l-=2)a+=t.charAt(l).charCodeAt(0)-48;a*=3;for(let l=i-1;l>=0;l-=2)a+=t.charAt(l).charCodeAt(0)-48;return a*=3,a%10}determineCheckDigit(t){for(let i=0;i<10;i++)if(t===this.CHECK_DIGIT_ENCODINGS[i])return i;throw new q}static parseExtensionString(t){if(t.length!==5)return null;let i=gr.parseExtension5String(t);return i==null?null:new Map([[ft.SUGGESTED_PRICE,i]])}static parseExtension5String(t){let i;switch(t.charAt(0)){case"0":i="£";break;case"5":i="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}i="";break;default:i="";break}let a=parseInt(t.substring(1)),l=(a/100).toString(),s=a%100,u=s<10?"0"+s:s.toString();return i+l+"."+u}}class Ll{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,i,a){let l=this.decodeRowStringBuffer,s=this.decodeMiddle(i,a,l),u=l.toString(),c=Ll.parseExtensionString(u),x=[new Te((a[0]+a[1])/2,t),new Te(s,t)],p=new Ce(u,null,0,x,Ae.UPC_EAN_EXTENSION,new Date().getTime());return c!=null&&p.putAllMetadata(c),p}decodeMiddle(t,i,a){let l=this.decodeMiddleCounters;l[0]=0,l[1]=0,l[2]=0,l[3]=0;let s=t.getSize(),u=i[1],c=0;for(let x=0;x<2&&u<s;x++){let p=Vt.decodeDigit(t,l,u,Vt.L_AND_G_PATTERNS);a+=String.fromCharCode(48+p%10);for(let w of l)u+=w;p>=10&&(c|=1<<1-x),x!==1&&(u=t.getNextSet(u),u=t.getNextUnset(u))}if(a.length!==2)throw new q;if(parseInt(a.toString())%4!==c)throw new q;return u}static parseExtensionString(t){return t.length!==2?null:new Map([[ft.ISSUE_NUMBER,parseInt(t)]])}}class xr{static decodeRow(t,i,a){let l=Vt.findGuardPattern(i,a,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new gr().decodeRow(t,i,l)}catch{return new Ll().decodeRow(t,i,l)}}}xr.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class rt extends Vt{constructor(){super(),this.decodeRowStringBuffer="",rt.L_AND_G_PATTERNS=rt.L_PATTERNS.map(t=>Int32Array.from(t));for(let t=10;t<20;t++){let i=rt.L_PATTERNS[t-10],a=new Int32Array(i.length);for(let l=0;l<i.length;l++)a[l]=i[i.length-l-1];rt.L_AND_G_PATTERNS[t]=a}}decodeRow(t,i,a){let l=rt.findStartGuardPattern(i),s=a==null?null:a.get(Be.NEED_RESULT_POINT_CALLBACK);if(s!=null){const ge=new Te((l[0]+l[1])/2,t);s.foundPossibleResultPoint(ge)}let u=this.decodeMiddle(i,l,this.decodeRowStringBuffer),c=u.rowOffset,x=u.resultString;if(s!=null){const ge=new Te(c,t);s.foundPossibleResultPoint(ge)}let p=this.decodeEnd(i,c);if(s!=null){const ge=new Te((p[0]+p[1])/2,t);s.foundPossibleResultPoint(ge)}let w=p[1],v=w+(w-p[0]);if(v>=i.getSize()||!i.isRange(w,v,!1))throw new q;let I=x.toString();if(I.length<8)throw new le;if(!rt.checkChecksum(I))throw new Z;let B=(l[1]+l[0])/2,U=(p[1]+p[0])/2,z=this.getBarcodeFormat(),P=[new Te(B,t),new Te(U,t)],W=new Ce(I,null,0,P,z,new Date().getTime()),me=0;try{let ge=xr.decodeRow(t,i,p[1]);W.putMetadata(ft.UPC_EAN_EXTENSION,ge.getText()),W.putAllMetadata(ge.getResultMetadata()),W.addResultPoints(ge.getResultPoints()),me=ge.getText().length}catch{}let xe=a==null?null:a.get(Be.ALLOWED_EAN_EXTENSIONS);if(xe!=null){let ge=!1;for(let qe in xe)if(me.toString()===qe){ge=!0;break}if(!ge)throw new q}return W}decodeEnd(t,i){return rt.findGuardPattern(t,i,!1,rt.START_END_PATTERN,new Int32Array(rt.START_END_PATTERN.length).fill(0))}static checkChecksum(t){return rt.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let i=t.length;if(i===0)return!1;let a=parseInt(t.charAt(i-1),10);return rt.getStandardUPCEANChecksum(t.substring(0,i-1))===a}static getStandardUPCEANChecksum(t){let i=t.length,a=0;for(let l=i-1;l>=0;l-=2){let s=t.charAt(l).charCodeAt(0)-48;if(s<0||s>9)throw new le;a+=s}a*=3;for(let l=i-2;l>=0;l-=2){let s=t.charAt(l).charCodeAt(0)-48;if(s<0||s>9)throw new le;a+=s}return(1e3-a)%10}}class xi extends rt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,i,a){let l=this.decodeMiddleCounters;l[0]=0,l[1]=0,l[2]=0,l[3]=0;let s=t.getSize(),u=i[1],c=0;for(let p=0;p<6&&u<s;p++){let w=rt.decodeDigit(t,l,u,rt.L_AND_G_PATTERNS);a+=String.fromCharCode(48+w%10);for(let v of l)u+=v;w>=10&&(c|=1<<5-p)}a=xi.determineFirstDigit(a,c),u=rt.findGuardPattern(t,u,!0,rt.MIDDLE_PATTERN,new Int32Array(rt.MIDDLE_PATTERN.length).fill(0))[1];for(let p=0;p<6&&u<s;p++){let w=rt.decodeDigit(t,l,u,rt.L_PATTERNS);a+=String.fromCharCode(48+w);for(let v of l)u+=v}return{rowOffset:u,resultString:a}}getBarcodeFormat(){return Ae.EAN_13}static determineFirstDigit(t,i){for(let a=0;a<10;a++)if(i===this.FIRST_DIGIT_ENCODINGS[a])return t=String.fromCharCode(48+a)+t,t;throw new q}}xi.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class Pi extends rt{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,i,a){const l=this.decodeMiddleCounters;l[0]=0,l[1]=0,l[2]=0,l[3]=0;let s=t.getSize(),u=i[1];for(let x=0;x<4&&u<s;x++){let p=rt.decodeDigit(t,l,u,rt.L_PATTERNS);a+=String.fromCharCode(48+p);for(let w of l)u+=w}u=rt.findGuardPattern(t,u,!0,rt.MIDDLE_PATTERN,new Int32Array(rt.MIDDLE_PATTERN.length).fill(0))[1];for(let x=0;x<4&&u<s;x++){let p=rt.decodeDigit(t,l,u,rt.L_PATTERNS);a+=String.fromCharCode(48+p);for(let w of l)u+=w}return{rowOffset:u,resultString:a}}getBarcodeFormat(){return Ae.EAN_8}}class mr extends rt{constructor(){super(...arguments),this.ean13Reader=new xi}getBarcodeFormat(){return Ae.UPC_A}decode(t,i){return this.maybeReturnResult(this.ean13Reader.decode(t))}decodeRow(t,i,a){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,i,a))}decodeMiddle(t,i,a){return this.ean13Reader.decodeMiddle(t,i,a)}maybeReturnResult(t){let i=t.getText();if(i.charAt(0)==="0"){let a=new Ce(i.substring(1),null,null,t.getResultPoints(),Ae.UPC_A);return t.getResultMetadata()!=null&&a.putAllMetadata(t.getResultMetadata()),a}else throw new q}reset(){this.ean13Reader.reset()}}class vn extends rt{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(t,i,a){const l=this.decodeMiddleCounters.map(p=>p);l[0]=0,l[1]=0,l[2]=0,l[3]=0;const s=t.getSize();let u=i[1],c=0;for(let p=0;p<6&&u<s;p++){const w=vn.decodeDigit(t,l,u,vn.L_AND_G_PATTERNS);a+=String.fromCharCode(48+w%10);for(let v of l)u+=v;w>=10&&(c|=1<<5-p)}let x=vn.determineNumSysAndCheckDigit(a,c);return{rowOffset:u,resultString:x}}decodeEnd(t,i){return vn.findGuardPatternWithoutCounters(t,i,!0,vn.MIDDLE_END_PATTERN)}checkChecksum(t){return rt.checkChecksum(vn.convertUPCEtoUPCA(t))}static determineNumSysAndCheckDigit(t,i){for(let a=0;a<=1;a++)for(let l=0;l<10;l++)if(i===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[a][l]){let s=String.fromCharCode(48+a),u=String.fromCharCode(48+l);return s+t+u}throw q.getNotFoundInstance()}getBarcodeFormat(){return Ae.UPC_E}static convertUPCEtoUPCA(t){const i=t.slice(1,7).split("").map(s=>s.charCodeAt(0)),a=new We;a.append(t.charAt(0));let l=i[5];switch(l){case 0:case 1:case 2:a.appendChars(i,0,2),a.append(l),a.append("0000"),a.appendChars(i,2,3);break;case 3:a.appendChars(i,0,3),a.append("00000"),a.appendChars(i,3,2);break;case 4:a.appendChars(i,0,4),a.append("00000"),a.append(i[4]);break;default:a.appendChars(i,0,5),a.append("0000"),a.append(l);break}return t.length>=8&&a.append(t.charAt(7)),a.toString()}}vn.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),vn.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,26])];class Ul extends kt{constructor(t){super();let i=t==null?null:t.get(Be.POSSIBLE_FORMATS),a=[];y(i)?(a.push(new xi),a.push(new mr),a.push(new Pi),a.push(new vn)):(i.indexOf(Ae.EAN_13)>-1&&a.push(new xi),i.indexOf(Ae.UPC_A)>-1&&a.push(new mr),i.indexOf(Ae.EAN_8)>-1&&a.push(new Pi),i.indexOf(Ae.UPC_E)>-1&&a.push(new vn)),this.readers=a}decodeRow(t,i,a){for(let l of this.readers)try{const s=l.decodeRow(t,i,a),u=s.getBarcodeFormat()===Ae.EAN_13&&s.getText().charAt(0)==="0",c=a==null?null:a.get(Be.POSSIBLE_FORMATS),x=c==null||c.includes(Ae.UPC_A);if(u&&x){const p=s.getRawBytes(),w=new Ce(s.getText().substring(1),p,p?p.length:null,s.getResultPoints(),Ae.UPC_A);return w.putAllMetadata(s.getResultMetadata()),w}return s}catch{}throw new q}reset(){for(let t of this.readers)t.reset()}}class yn extends kt{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(t,i){for(let a=0;a<i.length;a++)if(kt.patternMatchVariance(t,i[a],yn.MAX_INDIVIDUAL_VARIANCE)<yn.MAX_AVG_VARIANCE)return a;throw new q}static count(t){return $e.sum(new Int32Array(t))}static increment(t,i){let a=0,l=i[0];for(let s=1;s<t.length;s++)i[s]>l&&(l=i[s],a=s);t[a]++}static decrement(t,i){let a=0,l=i[0];for(let s=1;s<t.length;s++)i[s]<l&&(l=i[s],a=s);t[a]--}static isFinderPattern(t){let i=t[0]+t[1],a=i+t[2]+t[3],l=i/a;if(l>=yn.MIN_FINDER_PATTERN_RATIO&&l<=yn.MAX_FINDER_PATTERN_RATIO){let s=Number.MAX_SAFE_INTEGER,u=Number.MIN_SAFE_INTEGER;for(let c of t)c>u&&(u=c),c<s&&(s=c);return u<10*s}return!1}}yn.MAX_AVG_VARIANCE=.2,yn.MAX_INDIVIDUAL_VARIANCE=.45,yn.MIN_FINDER_PATTERN_RATIO=9.5/12,yn.MAX_FINDER_PATTERN_RATIO=12.5/14;class Yi{constructor(t,i){this.value=t,this.checksumPortion=i}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(t){if(!(t instanceof Yi))return!1;const i=t;return this.value===i.value&&this.checksumPortion===i.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Gi{constructor(t,i,a,l,s){this.value=t,this.startEnd=i,this.value=t,this.startEnd=i,this.resultPoints=new Array,this.resultPoints.push(new Te(a,s)),this.resultPoints.push(new Te(l,s))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(t){if(!(t instanceof Gi))return!1;const i=t;return this.value===i.value}hashCode(){return this.value}}class mi{constructor(){}static getRSSvalue(t,i,a){let l=0;for(let x of t)l+=x;let s=0,u=0,c=t.length;for(let x=0;x<c-1;x++){let p;for(p=1,u|=1<<x;p<t[x];p++,u&=~(1<<x)){let w=mi.combins(l-p-1,c-x-2);if(a&&u===0&&l-p-(c-x-1)>=c-x-1&&(w-=mi.combins(l-p-(c-x),c-x-2)),c-x-1>1){let v=0;for(let I=l-p-(c-x-2);I>i;I--)v+=mi.combins(l-p-I-1,c-x-3);w-=v*(c-1-x)}else l-p>i&&w--;s+=w}l-=p}return s}static combins(t,i){let a,l;t-i>i?(l=i,a=t-i):(l=t-i,a=i);let s=1,u=1;for(let c=t;c>a;c--)s*=c,u<=l&&(s/=u,u++);for(;u<=l;)s/=u,u++;return s}}class Ls{static buildBitArray(t){let i=t.length*2-1;t[t.length-1].getRightChar()==null&&(i-=1);let a=12*i,l=new we(a),s=0,c=t[0].getRightChar().getValue();for(let x=11;x>=0;--x)(c&1<<x)!=0&&l.set(s),s++;for(let x=1;x<t.length;++x){let p=t[x],w=p.getLeftChar().getValue();for(let v=11;v>=0;--v)(w&1<<v)!=0&&l.set(s),s++;if(p.getRightChar()!=null){let v=p.getRightChar().getValue();for(let I=11;I>=0;--I)(v&1<<I)!=0&&l.set(s),s++}}return l}}class Vi{constructor(t,i){i?this.decodedInformation=null:(this.finished=t,this.decodedInformation=i)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Gr{constructor(t){this.newPosition=t}getNewPosition(){return this.newPosition}}class Sn extends Gr{constructor(t,i){super(t),this.value=i}getValue(){return this.value}isFNC1(){return this.value===Sn.FNC1}}Sn.FNC1="$";class Oi extends Gr{constructor(t,i,a){super(t),a?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=i}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Dn extends Gr{constructor(t,i,a){if(super(t),i<0||i>10||a<0||a>10)throw new le;this.firstDigit=i,this.secondDigit=a}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Dn.FNC1}isSecondDigitFNC1(){return this.secondDigit===Dn.FNC1}isAnyFNC1(){return this.firstDigit===Dn.FNC1||this.secondDigit===Dn.FNC1}}Dn.FNC1=10;class Se{constructor(){}static parseFieldsInGeneralPurpose(t){if(!t)return null;if(t.length<2)throw new q;let i=t.substring(0,2);for(let s of Se.TWO_DIGIT_DATA_LENGTH)if(s[0]===i)return s[1]===Se.VARIABLE_LENGTH?Se.processVariableAI(2,s[2],t):Se.processFixedAI(2,s[1],t);if(t.length<3)throw new q;let a=t.substring(0,3);for(let s of Se.THREE_DIGIT_DATA_LENGTH)if(s[0]===a)return s[1]===Se.VARIABLE_LENGTH?Se.processVariableAI(3,s[2],t):Se.processFixedAI(3,s[1],t);for(let s of Se.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(s[0]===a)return s[1]===Se.VARIABLE_LENGTH?Se.processVariableAI(4,s[2],t):Se.processFixedAI(4,s[1],t);if(t.length<4)throw new q;let l=t.substring(0,4);for(let s of Se.FOUR_DIGIT_DATA_LENGTH)if(s[0]===l)return s[1]===Se.VARIABLE_LENGTH?Se.processVariableAI(4,s[2],t):Se.processFixedAI(4,s[1],t);throw new q}static processFixedAI(t,i,a){if(a.length<t)throw new q;let l=a.substring(0,t);if(a.length<t+i)throw new q;let s=a.substring(t,t+i),u=a.substring(t+i),c="("+l+")"+s,x=Se.parseFieldsInGeneralPurpose(u);return x==null?c:c+x}static processVariableAI(t,i,a){let l=a.substring(0,t),s;a.length<t+i?s=a.length:s=t+i;let u=a.substring(t,s),c=a.substring(s),x="("+l+")"+u,p=Se.parseFieldsInGeneralPurpose(c);return p==null?x:x+p}}Se.VARIABLE_LENGTH=[],Se.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",Se.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",Se.VARIABLE_LENGTH,20],["22",Se.VARIABLE_LENGTH,29],["30",Se.VARIABLE_LENGTH,8],["37",Se.VARIABLE_LENGTH,8],["90",Se.VARIABLE_LENGTH,30],["91",Se.VARIABLE_LENGTH,30],["92",Se.VARIABLE_LENGTH,30],["93",Se.VARIABLE_LENGTH,30],["94",Se.VARIABLE_LENGTH,30],["95",Se.VARIABLE_LENGTH,30],["96",Se.VARIABLE_LENGTH,30],["97",Se.VARIABLE_LENGTH,3],["98",Se.VARIABLE_LENGTH,30],["99",Se.VARIABLE_LENGTH,30]],Se.THREE_DIGIT_DATA_LENGTH=[["240",Se.VARIABLE_LENGTH,30],["241",Se.VARIABLE_LENGTH,30],["242",Se.VARIABLE_LENGTH,6],["250",Se.VARIABLE_LENGTH,30],["251",Se.VARIABLE_LENGTH,30],["253",Se.VARIABLE_LENGTH,17],["254",Se.VARIABLE_LENGTH,20],["400",Se.VARIABLE_LENGTH,30],["401",Se.VARIABLE_LENGTH,30],["402",17],["403",Se.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",Se.VARIABLE_LENGTH,20],["421",Se.VARIABLE_LENGTH,15],["422",3],["423",Se.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],Se.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",Se.VARIABLE_LENGTH,15],["391",Se.VARIABLE_LENGTH,18],["392",Se.VARIABLE_LENGTH,15],["393",Se.VARIABLE_LENGTH,18],["703",Se.VARIABLE_LENGTH,30]],Se.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",Se.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",Se.VARIABLE_LENGTH,20],["8003",Se.VARIABLE_LENGTH,30],["8004",Se.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",Se.VARIABLE_LENGTH,30],["8008",Se.VARIABLE_LENGTH,12],["8018",18],["8020",Se.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",Se.VARIABLE_LENGTH,70],["8200",Se.VARIABLE_LENGTH,70]];class Bn{constructor(t){this.buffer=new We,this.information=t}decodeAllCodes(t,i){let a=i,l=null;do{let s=this.decodeGeneralPurposeField(a,l),u=Se.parseFieldsInGeneralPurpose(s.getNewString());if(u!=null&&t.append(u),s.isRemaining()?l=""+s.getRemainingValue():l=null,a===s.getNewPosition())break;a=s.getNewPosition()}while(!0);return t.toString()}isStillNumeric(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(let i=t;i<t+3;++i)if(this.information.get(i))return!0;return this.information.get(t+3)}decodeNumeric(t){if(t+7>this.information.getSize()){let s=this.extractNumericValueFromBitArray(t,4);return s===0?new Dn(this.information.getSize(),Dn.FNC1,Dn.FNC1):new Dn(this.information.getSize(),s-1,Dn.FNC1)}let i=this.extractNumericValueFromBitArray(t,7),a=(i-8)/11,l=(i-8)%11;return new Dn(t+7,a,l)}extractNumericValueFromBitArray(t,i){return Bn.extractNumericValueFromBitArray(this.information,t,i)}static extractNumericValueFromBitArray(t,i,a){let l=0;for(let s=0;s<a;++s)t.get(i+s)&&(l|=1<<a-s-1);return l}decodeGeneralPurposeField(t,i){this.buffer.setLengthToZero(),i!=null&&this.buffer.append(i),this.current.setPosition(t);let a=this.parseBlocks();return a!=null&&a.isRemaining()?new Oi(this.current.getPosition(),this.buffer.toString(),a.getRemainingValue()):new Oi(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let t,i;do{let a=this.current.getPosition();if(this.current.isAlpha()?(i=this.parseAlphaBlock(),t=i.isFinished()):this.current.isIsoIec646()?(i=this.parseIsoIec646Block(),t=i.isFinished()):(i=this.parseNumericBlock(),t=i.isFinished()),!(a!==this.current.getPosition())&&!t)break}while(!t);return i.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){let i;return t.isSecondDigitFNC1()?i=new Oi(this.current.getPosition(),this.buffer.toString()):i=new Oi(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new Vi(!0,i)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){let i=new Oi(this.current.getPosition(),this.buffer.toString());return new Vi(!0,i)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Vi(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let i=new Oi(this.current.getPosition(),this.buffer.toString());return new Vi(!0,i)}this.buffer.append(t.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 Vi(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let i=new Oi(this.current.getPosition(),this.buffer.toString());return new Vi(!0,i)}this.buffer.append(t.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 Vi(!1)}isStillIsoIec646(t){if(t+5>this.information.getSize())return!1;let i=this.extractNumericValueFromBitArray(t,5);if(i>=5&&i<16)return!0;if(t+7>this.information.getSize())return!1;let a=this.extractNumericValueFromBitArray(t,7);if(a>=64&&a<116)return!0;if(t+8>this.information.getSize())return!1;let l=this.extractNumericValueFromBitArray(t,8);return l>=232&&l<253}decodeIsoIec646(t){let i=this.extractNumericValueFromBitArray(t,5);if(i===15)return new Sn(t+5,Sn.FNC1);if(i>=5&&i<15)return new Sn(t+5,"0"+(i-5));let a=this.extractNumericValueFromBitArray(t,7);if(a>=64&&a<90)return new Sn(t+7,""+(a+1));if(a>=90&&a<116)return new Sn(t+7,""+(a+7));let l=this.extractNumericValueFromBitArray(t,8),s;switch(l){case 232:s="!";break;case 233:s='"';break;case 234:s="%";break;case 235:s="&";break;case 236:s="'";break;case 237:s="(";break;case 238:s=")";break;case 239:s="*";break;case 240:s="+";break;case 241:s=",";break;case 242:s="-";break;case 243:s=".";break;case 244:s="/";break;case 245:s=":";break;case 246:s=";";break;case 247:s="<";break;case 248:s="=";break;case 249:s=">";break;case 250:s="?";break;case 251:s="_";break;case 252:s=" ";break;default:throw new le}return new Sn(t+8,s)}isStillAlpha(t){if(t+5>this.information.getSize())return!1;let i=this.extractNumericValueFromBitArray(t,5);if(i>=5&&i<16)return!0;if(t+6>this.information.getSize())return!1;let a=this.extractNumericValueFromBitArray(t,6);return a>=16&&a<63}decodeAlphanumeric(t){let i=this.extractNumericValueFromBitArray(t,5);if(i===15)return new Sn(t+5,Sn.FNC1);if(i>=5&&i<15)return new Sn(t+5,"0"+(i-5));let a=this.extractNumericValueFromBitArray(t,6);if(a>=32&&a<58)return new Sn(t+6,""+(a+33));let l;switch(a){case 58:l="*";break;case 59:l=",";break;case 60:l="-";break;case 61:l=".";break;case 62:l="/";break;default:throw new jn("Decoding invalid alphanumeric value: "+a)}return new Sn(t+6,l)}isAlphaTo646ToAlphaLatch(t){if(t+1>this.information.getSize())return!1;for(let i=0;i<5&&i+t<this.information.getSize();++i)if(i===2){if(!this.information.get(t+2))return!1}else if(this.information.get(t+i))return!1;return!0}isAlphaOr646ToNumericLatch(t){if(t+3>this.information.getSize())return!1;for(let i=t;i<t+3;++i)if(this.information.get(i))return!1;return!0}isNumericToAlphaNumericLatch(t){if(t+1>this.information.getSize())return!1;for(let i=0;i<4&&i+t<this.information.getSize();++i)if(this.information.get(t+i))return!1;return!0}}class an{constructor(t){this.information=t,this.generalDecoder=new Bn(t)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Tt extends an{constructor(t){super(t)}encodeCompressedGtin(t,i){t.append("(01)");let a=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,i,a)}encodeCompressedGtinWithoutAI(t,i,a){for(let l=0;l<4;++l){let s=this.getGeneralDecoder().extractNumericValueFromBitArray(i+10*l,10);s/100===0&&t.append("0"),s/10===0&&t.append("0"),t.append(s)}Tt.appendCheckDigit(t,a)}static appendCheckDigit(t,i){let a=0;for(let l=0;l<13;l++){let s=t.charAt(l+i).charCodeAt(0)-48;a+=(l&1)===0?3*s:s}a=10-a%10,a===10&&(a=0),t.append(a)}}Tt.GTIN_SIZE=40;class $n extends Tt{constructor(t){super(t)}parseInformation(){let t=new We;t.append("(01)");let i=t.length(),a=this.getGeneralDecoder().extractNumericValueFromBitArray($n.HEADER_SIZE,4);return t.append(a),this.encodeCompressedGtinWithoutAI(t,$n.HEADER_SIZE+4,i),this.getGeneralDecoder().decodeAllCodes(t,$n.HEADER_SIZE+44)}}$n.HEADER_SIZE=4;class Oa extends an{constructor(t){super(t)}parseInformation(){let t=new We;return this.getGeneralDecoder().decodeAllCodes(t,Oa.HEADER_SIZE)}}Oa.HEADER_SIZE=5;class Vr extends Tt{constructor(t){super(t)}encodeCompressedWeight(t,i,a){let l=this.getGeneralDecoder().extractNumericValueFromBitArray(i,a);this.addWeightCode(t,l);let s=this.checkWeight(l),u=1e5;for(let c=0;c<5;++c)s/u===0&&t.append("0"),u/=10;t.append(s)}}class yi extends Vr{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()!=yi.HEADER_SIZE+Vr.GTIN_SIZE+yi.WEIGHT_SIZE)throw new q;let t=new We;return this.encodeCompressedGtin(t,yi.HEADER_SIZE),this.encodeCompressedWeight(t,yi.HEADER_SIZE+Vr.GTIN_SIZE,yi.WEIGHT_SIZE),t.toString()}}yi.HEADER_SIZE=5,yi.WEIGHT_SIZE=15;class Us extends yi{constructor(t){super(t)}addWeightCode(t,i){t.append("(3103)")}checkWeight(t){return t}}class yr extends yi{constructor(t){super(t)}addWeightCode(t,i){i<1e4?t.append("(3202)"):t.append("(3203)")}checkWeight(t){return t<1e4?t:t-1e4}}class Yn extends Tt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Yn.HEADER_SIZE+Tt.GTIN_SIZE)throw new q;let t=new We;this.encodeCompressedGtin(t,Yn.HEADER_SIZE);let i=this.getGeneralDecoder().extractNumericValueFromBitArray(Yn.HEADER_SIZE+Tt.GTIN_SIZE,Yn.LAST_DIGIT_SIZE);t.append("(392"),t.append(i),t.append(")");let a=this.getGeneralDecoder().decodeGeneralPurposeField(Yn.HEADER_SIZE+Tt.GTIN_SIZE+Yn.LAST_DIGIT_SIZE,null);return t.append(a.getNewString()),t.toString()}}Yn.HEADER_SIZE=8,Yn.LAST_DIGIT_SIZE=2;class Wt extends Tt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Wt.HEADER_SIZE+Tt.GTIN_SIZE)throw new q;let t=new We;this.encodeCompressedGtin(t,Wt.HEADER_SIZE);let i=this.getGeneralDecoder().extractNumericValueFromBitArray(Wt.HEADER_SIZE+Tt.GTIN_SIZE,Wt.LAST_DIGIT_SIZE);t.append("(393"),t.append(i),t.append(")");let a=this.getGeneralDecoder().extractNumericValueFromBitArray(Wt.HEADER_SIZE+Tt.GTIN_SIZE+Wt.LAST_DIGIT_SIZE,Wt.FIRST_THREE_DIGITS_SIZE);a/100==0&&t.append("0"),a/10==0&&t.append("0"),t.append(a);let l=this.getGeneralDecoder().decodeGeneralPurposeField(Wt.HEADER_SIZE+Tt.GTIN_SIZE+Wt.LAST_DIGIT_SIZE+Wt.FIRST_THREE_DIGITS_SIZE,null);return t.append(l.getNewString()),t.toString()}}Wt.HEADER_SIZE=8,Wt.LAST_DIGIT_SIZE=2,Wt.FIRST_THREE_DIGITS_SIZE=10;class pt extends Vr{constructor(t,i,a){super(t),this.dateCode=a,this.firstAIdigits=i}parseInformation(){if(this.getInformation().getSize()!=pt.HEADER_SIZE+pt.GTIN_SIZE+pt.WEIGHT_SIZE+pt.DATE_SIZE)throw new q;let t=new We;return this.encodeCompressedGtin(t,pt.HEADER_SIZE),this.encodeCompressedWeight(t,pt.HEADER_SIZE+pt.GTIN_SIZE,pt.WEIGHT_SIZE),this.encodeCompressedDate(t,pt.HEADER_SIZE+pt.GTIN_SIZE+pt.WEIGHT_SIZE),t.toString()}encodeCompressedDate(t,i){let a=this.getGeneralDecoder().extractNumericValueFromBitArray(i,pt.DATE_SIZE);if(a==38400)return;t.append("("),t.append(this.dateCode),t.append(")");let l=a%32;a/=32;let s=a%12+1;a/=12;let u=a;u/10==0&&t.append("0"),t.append(u),s/10==0&&t.append("0"),t.append(s),l/10==0&&t.append("0"),t.append(l)}addWeightCode(t,i){t.append("("),t.append(this.firstAIdigits),t.append(i/1e5),t.append(")")}checkWeight(t){return t%1e5}}pt.HEADER_SIZE=8,pt.WEIGHT_SIZE=20,pt.DATE_SIZE=16;function _a(T){try{if(T.get(1))return new $n(T);if(!T.get(2))return new Oa(T);switch(Bn.extractNumericValueFromBitArray(T,1,4)){case 4:return new Us(T);case 5:return new yr(T)}switch(Bn.extractNumericValueFromBitArray(T,1,5)){case 12:return new Yn(T);case 13:return new Wt(T)}switch(Bn.extractNumericValueFromBitArray(T,1,7)){case 56:return new pt(T,"310","11");case 57:return new pt(T,"320","11");case 58:return new pt(T,"310","13");case 59:return new pt(T,"320","13");case 60:return new pt(T,"310","15");case 61:return new pt(T,"320","15");case 62:return new pt(T,"310","17");case 63:return new pt(T,"320","17")}}catch(t){throw console.log(t),new jn("unknown decoder: "+T)}}class Ln{constructor(t,i,a,l){this.leftchar=t,this.rightchar=i,this.finderpattern=a,this.maybeLast=l}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(t,i){return t instanceof Ln?Ln.equalsOrNull(t.leftchar,i.leftchar)&&Ln.equalsOrNull(t.rightchar,i.rightchar)&&Ln.equalsOrNull(t.finderpattern,i.finderpattern):!1}static equalsOrNull(t,i){return t===null?i===null:Ln.equals(t,i)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class Kt{constructor(t,i,a){this.pairs=t,this.rowNumber=i,this.wasReversed=a}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(t){return this.checkEqualitity(this,t)}toString(){return"{ "+this.pairs+" }"}equals(t,i){return t instanceof Kt?this.checkEqualitity(t,i)&&t.wasReversed===i.wasReversed:!1}checkEqualitity(t,i){if(!t||!i)return;let a;return t.forEach((l,s)=>{i.forEach(u=>{l.getLeftChar().getValue()===u.getLeftChar().getValue()&&l.getRightChar().getValue()===u.getRightChar().getValue()&&l.getFinderPatter().getValue()===u.getFinderPatter().getValue()&&(a=!0)})}),a}}class he extends yn{constructor(t){super(...arguments),this.pairs=new Array(he.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=t===!0}decodeRow(t,i,a){this.pairs.length=0,this.startFromEven=!1;try{return he.constructResult(this.decodeRow2pairs(t,i))}catch(l){this.verbose&&console.log(l)}return this.pairs.length=0,this.startFromEven=!0,he.constructResult(this.decodeRow2pairs(t,i))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(t,i){let a=!1;for(;!a;)try{this.pairs.push(this.retrieveNextPair(i,this.pairs,t))}catch(s){if(s instanceof q){if(!this.pairs.length)throw new q;a=!0}}if(this.checkChecksum())return this.pairs;let l;if(this.rows.length?l=!0:l=!1,this.storeRow(t,!1),l){let s=this.checkRowsBoolean(!1);if(s!=null||(s=this.checkRowsBoolean(!0),s!=null))return s}throw new q}checkRowsBoolean(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());let i=null;try{i=this.checkRows(new Array,0)}catch(a){this.verbose&&console.log(a)}return t&&(this.rows=this.rows.reverse()),i}checkRows(t,i){for(let a=i;a<this.rows.length;a++){let l=this.rows[a];this.pairs.length=0;for(let u of t)this.pairs.push(u.getPairs());if(this.pairs.push(l.getPairs()),!he.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let s=new Array(t);s.push(l);try{return this.checkRows(s,a+1)}catch(u){this.verbose&&console.log(u)}}throw new q}static isValidSequence(t){for(let i of he.FINDER_PATTERN_SEQUENCES){if(t.length>i.length)continue;let a=!0;for(let l=0;l<t.length;l++)if(t[l].getFinderPattern().getValue()!=i[l]){a=!1;break}if(a)return!0}return!1}storeRow(t,i){let a=0,l=!1,s=!1;for(;a<this.rows.length;){let u=this.rows[a];if(u.getRowNumber()>t){s=u.isEquivalent(this.pairs);break}l=u.isEquivalent(this.pairs),a++}s||l||he.isPartialRow(this.pairs,this.rows)||(this.rows.push(a,new Kt(this.pairs,t,i)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(t,i){for(let a of i)if(a.getPairs().length!==t.length){for(let l of a.getPairs())for(let s of t)if(Ln.equals(l,s))break}}static isPartialRow(t,i){for(let a of i){let l=!0;for(let s of t){let u=!1;for(let c of a.getPairs())if(s.equals(c)){u=!0;break}if(!u){l=!1;break}}if(l)return!0}return!1}getRows(){return this.rows}static constructResult(t){let i=Ls.buildBitArray(t),l=_a(i).parseInformation(),s=t[0].getFinderPattern().getResultPoints(),u=t[t.length-1].getFinderPattern().getResultPoints(),c=[s[0],s[1],u[0],u[1]];return new Ce(l,null,null,c,Ae.RSS_EXPANDED,null)}checkChecksum(){let t=this.pairs.get(0),i=t.getLeftChar(),a=t.getRightChar();if(a==null)return!1;let l=a.getChecksumPortion(),s=2;for(let c=1;c<this.pairs.size();++c){let x=this.pairs.get(c);l+=x.getLeftChar().getChecksumPortion(),s++;let p=x.getRightChar();p!=null&&(l+=p.getChecksumPortion(),s++)}return l%=211,211*(s-4)+l==i.getValue()}static getNextSecondBar(t,i){let a;return t.get(i)?(a=t.getNextUnset(i),a=t.getNextSet(a)):(a=t.getNextSet(i),a=t.getNextUnset(a)),a}retrieveNextPair(t,i,a){let l=i.length%2==0;this.startFromEven&&(l=!l);let s,u=!0,c=-1;do this.findNextPair(t,i,c),s=this.parseFoundFinderPattern(t,a,l),s==null?c=he.getNextSecondBar(t,this.startEnd[0]):u=!1;while(u);let x=this.decodeDataCharacter(t,s,l,!0);if(!this.isEmptyPair(i)&&i[i.length-1].mustBeLast())throw new q;let p;try{p=this.decodeDataCharacter(t,s,l,!1)}catch(w){p=null,this.verbose&&console.log(w)}return new Ln(x,p,s,!0)}isEmptyPair(t){return t.length===0}findNextPair(t,i,a){let l=this.getDecodeFinderCounters();l[0]=0,l[1]=0,l[2]=0,l[3]=0;let s=t.getSize(),u;a>=0?u=a:this.isEmptyPair(i)?u=0:u=i[i.length-1].getFinderPattern().getStartEnd()[1];let c=i.length%2!=0;this.startFromEven&&(c=!c);let x=!1;for(;u<s&&(x=!t.get(u),!!x);)u++;let p=0,w=u;for(let v=u;v<s;v++)if(t.get(v)!=x)l[p]++;else{if(p==3){if(c&&he.reverseCounters(l),he.isFinderPattern(l)){this.startEnd[0]=w,this.startEnd[1]=v;return}c&&he.reverseCounters(l),w+=l[0]+l[1],l[0]=l[2],l[1]=l[3],l[2]=0,l[3]=0,p--}else p++;l[p]=1,x=!x}throw new q}static reverseCounters(t){let i=t.length;for(let a=0;a<i/2;++a){let l=t[a];t[a]=t[i-a-1],t[i-a-1]=l}}parseFoundFinderPattern(t,i,a){let l,s,u;if(a){let p=this.startEnd[0]-1;for(;p>=0&&!t.get(p);)p--;p++,l=this.startEnd[0]-p,s=p,u=this.startEnd[1]}else s=this.startEnd[0],u=t.getNextUnset(this.startEnd[1]+1),l=u-this.startEnd[1];let c=this.getDecodeFinderCounters();ie.arraycopy(c,0,c,1,c.length-1),c[0]=l;let x;try{x=this.parseFinderValue(c,he.FINDER_PATTERNS)}catch{return null}return new Gi(x,[s,u],s,u,i)}decodeDataCharacter(t,i,a,l){let s=this.getDataCharacterCounters();for(let St=0;St<s.length;St++)s[St]=0;if(l)he.recordPatternInReverse(t,i.getStartEnd()[0],s);else{he.recordPattern(t,i.getStartEnd()[1],s);for(let St=0,En=s.length-1;St<En;St++,En--){let kn=s[St];s[St]=s[En],s[En]=kn}}let u=17,c=$e.sum(new Int32Array(s))/u,x=(i.getStartEnd()[1]-i.getStartEnd()[0])/15;if(Math.abs(c-x)/x>.3)throw new q;let p=this.getOddCounts(),w=this.getEvenCounts(),v=this.getOddRoundingErrors(),I=this.getEvenRoundingErrors();for(let St=0;St<s.length;St++){let En=1*s[St]/c,kn=En+.5;if(kn<1){if(En<.3)throw new q;kn=1}else if(kn>8){if(En>8.7)throw new q;kn=8}let Ya=St/2;(St&1)==0?(p[Ya]=kn,v[Ya]=En-kn):(w[Ya]=kn,I[Ya]=En-kn)}this.adjustOddEvenCounts(u);let B=4*i.getValue()+(a?0:2)+(l?0:1)-1,U=0,z=0;for(let St=p.length-1;St>=0;St--){if(he.isNotA1left(i,a,l)){let En=he.WEIGHTS[B][2*St];z+=p[St]*En}U+=p[St]}let P=0;for(let St=w.length-1;St>=0;St--)if(he.isNotA1left(i,a,l)){let En=he.WEIGHTS[B][2*St+1];P+=w[St]*En}let W=z+P;if((U&1)!=0||U>13||U<4)throw new q;let me=(13-U)/2,xe=he.SYMBOL_WIDEST[me],ge=9-xe,qe=mi.getRSSvalue(p,xe,!0),He=mi.getRSSvalue(w,ge,!1),Jt=he.EVEN_TOTAL_SUBSET[me],Xn=he.GSUM[me],Nn=qe*Jt+He+Xn;return new Yi(Nn,W)}static isNotA1left(t,i,a){return!(t.getValue()==0&&i&&a)}adjustOddEvenCounts(t){let i=$e.sum(new Int32Array(this.getOddCounts())),a=$e.sum(new Int32Array(this.getEvenCounts())),l=!1,s=!1;i>13?s=!0:i<4&&(l=!0);let u=!1,c=!1;a>13?c=!0:a<4&&(u=!0);let x=i+a-t,p=(i&1)==1,w=(a&1)==0;if(x==1)if(p){if(w)throw new q;s=!0}else{if(!w)throw new q;c=!0}else if(x==-1)if(p){if(w)throw new q;l=!0}else{if(!w)throw new q;u=!0}else if(x==0){if(p){if(!w)throw new q;i<a?(l=!0,c=!0):(s=!0,u=!0)}else if(w)throw new q}else throw new q;if(l){if(s)throw new q;he.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&he.decrement(this.getOddCounts(),this.getOddRoundingErrors()),u){if(c)throw new q;he.increment(this.getEvenCounts(),this.getOddRoundingErrors())}c&&he.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}he.SYMBOL_WIDEST=[7,5,4,3,1],he.EVEN_TOTAL_SUBSET=[4,20,52,104,204],he.GSUM=[0,348,1388,2948,3988],he.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])],he.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]],he.FINDER_PAT_A=0,he.FINDER_PAT_B=1,he.FINDER_PAT_C=2,he.FINDER_PAT_D=3,he.FINDER_PAT_E=4,he.FINDER_PAT_F=5,he.FINDER_PATTERN_SEQUENCES=[[he.FINDER_PAT_A,he.FINDER_PAT_A],[he.FINDER_PAT_A,he.FINDER_PAT_B,he.FINDER_PAT_B],[he.FINDER_PAT_A,he.FINDER_PAT_C,he.FINDER_PAT_B,he.FINDER_PAT_D],[he.FINDER_PAT_A,he.FINDER_PAT_E,he.FINDER_PAT_B,he.FINDER_PAT_D,he.FINDER_PAT_C],[he.FINDER_PAT_A,he.FINDER_PAT_E,he.FINDER_PAT_B,he.FINDER_PAT_D,he.FINDER_PAT_D,he.FINDER_PAT_F],[he.FINDER_PAT_A,he.FINDER_PAT_E,he.FINDER_PAT_B,he.FINDER_PAT_D,he.FINDER_PAT_E,he.FINDER_PAT_F,he.FINDER_PAT_F],[he.FINDER_PAT_A,he.FINDER_PAT_A,he.FINDER_PAT_B,he.FINDER_PAT_B,he.FINDER_PAT_C,he.FINDER_PAT_C,he.FINDER_PAT_D,he.FINDER_PAT_D],[he.FINDER_PAT_A,he.FINDER_PAT_A,he.FINDER_PAT_B,he.FINDER_PAT_B,he.FINDER_PAT_C,he.FINDER_PAT_C,he.FINDER_PAT_D,he.FINDER_PAT_E,he.FINDER_PAT_E],[he.FINDER_PAT_A,he.FINDER_PAT_A,he.FINDER_PAT_B,he.FINDER_PAT_B,he.FINDER_PAT_C,he.FINDER_PAT_C,he.FINDER_PAT_D,he.FINDER_PAT_E,he.FINDER_PAT_F,he.FINDER_PAT_F],[he.FINDER_PAT_A,he.FINDER_PAT_A,he.FINDER_PAT_B,he.FINDER_PAT_B,he.FINDER_PAT_C,he.FINDER_PAT_D,he.FINDER_PAT_D,he.FINDER_PAT_E,he.FINDER_PAT_E,he.FINDER_PAT_F,he.FINDER_PAT_F]],he.MAX_PAIRS=11;class zs extends Yi{constructor(t,i,a){super(t,i),this.count=0,this.finderPattern=a}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class Ct extends yn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(t,i,a){const l=this.decodePair(i,!1,t,a);Ct.addOrTally(this.possibleLeftPairs,l),i.reverse();let s=this.decodePair(i,!0,t,a);Ct.addOrTally(this.possibleRightPairs,s),i.reverse();for(let u of this.possibleLeftPairs)if(u.getCount()>1){for(let c of this.possibleRightPairs)if(c.getCount()>1&&Ct.checkChecksum(u,c))return Ct.constructResult(u,c)}throw new q}static addOrTally(t,i){if(i==null)return;let a=!1;for(let l of t)if(l.getValue()===i.getValue()){l.incrementCount(),a=!0;break}a||t.push(i)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(t,i){let a=4537077*t.getValue()+i.getValue(),l=new String(a).toString(),s=new We;for(let p=13-l.length;p>0;p--)s.append("0");s.append(l);let u=0;for(let p=0;p<13;p++){let w=s.charAt(p).charCodeAt(0)-48;u+=(p&1)===0?3*w:w}u=10-u%10,u===10&&(u=0),s.append(u.toString());let c=t.getFinderPattern().getResultPoints(),x=i.getFinderPattern().getResultPoints();return new Ce(s.toString(),null,0,[c[0],c[1],x[0],x[1]],Ae.RSS_14,new Date().getTime())}static checkChecksum(t,i){let a=(t.getChecksumPortion()+16*i.getChecksumPortion())%79,l=9*t.getFinderPattern().getValue()+i.getFinderPattern().getValue();return l>72&&l--,l>8&&l--,a===l}decodePair(t,i,a,l){try{let s=this.findFinderPattern(t,i),u=this.parseFoundFinderPattern(t,a,i,s),c=l==null?null:l.get(Be.NEED_RESULT_POINT_CALLBACK);if(c!=null){let w=(s[0]+s[1])/2;i&&(w=t.getSize()-1-w),c.foundPossibleResultPoint(new Te(w,a))}let x=this.decodeDataCharacter(t,u,!0),p=this.decodeDataCharacter(t,u,!1);return new zs(1597*x.getValue()+p.getValue(),x.getChecksumPortion()+4*p.getChecksumPortion(),u)}catch{return null}}decodeDataCharacter(t,i,a){let l=this.getDataCharacterCounters();for(let P=0;P<l.length;P++)l[P]=0;if(a)kt.recordPatternInReverse(t,i.getStartEnd()[0],l);else{kt.recordPattern(t,i.getStartEnd()[1]+1,l);for(let P=0,W=l.length-1;P<W;P++,W--){let me=l[P];l[P]=l[W],l[W]=me}}let s=a?16:15,u=$e.sum(new Int32Array(l))/s,c=this.getOddCounts(),x=this.getEvenCounts(),p=this.getOddRoundingErrors(),w=this.getEvenRoundingErrors();for(let P=0;P<l.length;P++){let W=l[P]/u,me=Math.floor(W+.5);me<1?me=1:me>8&&(me=8);let xe=Math.floor(P/2);(P&1)===0?(c[xe]=me,p[xe]=W-me):(x[xe]=me,w[xe]=W-me)}this.adjustOddEvenCounts(a,s);let v=0,I=0;for(let P=c.length-1;P>=0;P--)I*=9,I+=c[P],v+=c[P];let B=0,U=0;for(let P=x.length-1;P>=0;P--)B*=9,B+=x[P],U+=x[P];let z=I+3*B;if(a){if((v&1)!==0||v>12||v<4)throw new q;let P=(12-v)/2,W=Ct.OUTSIDE_ODD_WIDEST[P],me=9-W,xe=mi.getRSSvalue(c,W,!1),ge=mi.getRSSvalue(x,me,!0),qe=Ct.OUTSIDE_EVEN_TOTAL_SUBSET[P],He=Ct.OUTSIDE_GSUM[P];return new Yi(xe*qe+ge+He,z)}else{if((U&1)!==0||U>10||U<4)throw new q;let P=(10-U)/2,W=Ct.INSIDE_ODD_WIDEST[P],me=9-W,xe=mi.getRSSvalue(c,W,!0),ge=mi.getRSSvalue(x,me,!1),qe=Ct.INSIDE_ODD_TOTAL_SUBSET[P],He=Ct.INSIDE_GSUM[P];return new Yi(ge*qe+xe+He,z)}}findFinderPattern(t,i){let a=this.getDecodeFinderCounters();a[0]=0,a[1]=0,a[2]=0,a[3]=0;let l=t.getSize(),s=!1,u=0;for(;u<l&&(s=!t.get(u),i!==s);)u++;let c=0,x=u;for(let p=u;p<l;p++)if(t.get(p)!==s)a[c]++;else{if(c===3){if(yn.isFinderPattern(a))return[x,p];x+=a[0]+a[1],a[0]=a[2],a[1]=a[3],a[2]=0,a[3]=0,c--}else c++;a[c]=1,s=!s}throw new q}parseFoundFinderPattern(t,i,a,l){let s=t.get(l[0]),u=l[0]-1;for(;u>=0&&s!==t.get(u);)u--;u++;const c=l[0]-u,x=this.getDecodeFinderCounters(),p=new Int32Array(x.length);ie.arraycopy(x,0,p,1,x.length-1),p[0]=c;const w=this.parseFinderValue(p,Ct.FINDER_PATTERNS);let v=u,I=l[1];return a&&(v=t.getSize()-1-v,I=t.getSize()-1-I),new Gi(w,[u,l[1]],v,I,i)}adjustOddEvenCounts(t,i){let a=$e.sum(new Int32Array(this.getOddCounts())),l=$e.sum(new Int32Array(this.getEvenCounts())),s=!1,u=!1,c=!1,x=!1;t?(a>12?u=!0:a<4&&(s=!0),l>12?x=!0:l<4&&(c=!0)):(a>11?u=!0:a<5&&(s=!0),l>10?x=!0:l<4&&(c=!0));let p=a+l-i,w=(a&1)===(t?1:0),v=(l&1)===1;if(p===1)if(w){if(v)throw new q;u=!0}else{if(!v)throw new q;x=!0}else if(p===-1)if(w){if(v)throw new q;s=!0}else{if(!v)throw new q;c=!0}else if(p===0){if(w){if(!v)throw new q;a<l?(s=!0,x=!0):(u=!0,c=!0)}else if(v)throw new q}else throw new q;if(s){if(u)throw new q;yn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(u&&yn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),c){if(x)throw new q;yn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}x&&yn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}Ct.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],Ct.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],Ct.OUTSIDE_GSUM=[0,161,961,2015,2715],Ct.INSIDE_GSUM=[0,336,1036,1516],Ct.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],Ct.INSIDE_ODD_WIDEST=[2,4,6,8],Ct.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])];class ei extends kt{constructor(t,i){super(),this.readers=[],this.verbose=i===!0;const a=t?t.get(Be.POSSIBLE_FORMATS):null,l=t&&t.get(Be.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;a?((a.includes(Ae.EAN_13)||a.includes(Ae.UPC_A)||a.includes(Ae.EAN_8)||a.includes(Ae.UPC_E))&&this.readers.push(new Ul(t)),a.includes(Ae.CODE_39)&&this.readers.push(new It(l)),a.includes(Ae.CODE_128)&&this.readers.push(new ye),a.includes(Ae.ITF)&&this.readers.push(new Ge),a.includes(Ae.RSS_14)&&this.readers.push(new Ct),a.includes(Ae.RSS_EXPANDED)&&this.readers.push(new he(this.verbose))):(this.readers.push(new Ul(t)),this.readers.push(new It),this.readers.push(new Ul(t)),this.readers.push(new ye),this.readers.push(new Ge),this.readers.push(new Ct),this.readers.push(new he(this.verbose)))}decodeRow(t,i,a){for(let l=0;l<this.readers.length;l++)try{return this.readers[l].decodeRow(t,i,a)}catch{}throw new q}reset(){this.readers.forEach(t=>t.reset())}}class fu extends Ee{constructor(t=500,i){super(new ei(i),t,i)}}class gt{constructor(t,i,a){this.ecCodewords=t,this.ecBlocks=[i],a&&this.ecBlocks.push(a)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class dt{constructor(t,i){this.count=t,this.dataCodewords=i}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class et{constructor(t,i,a,l,s,u){this.versionNumber=t,this.symbolSizeRows=i,this.symbolSizeColumns=a,this.dataRegionSizeRows=l,this.dataRegionSizeColumns=s,this.ecBlocks=u;let c=0;const x=u.getECCodewords(),p=u.getECBlocks();for(let w of p)c+=w.getCount()*(w.getDataCodewords()+x);this.totalCodewords=c}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(t,i){if((t&1)!==0||(i&1)!==0)throw new le;for(let a of et.VERSIONS)if(a.symbolSizeRows===t&&a.symbolSizeColumns===i)return a;throw new le}toString(){return""+this.versionNumber}static buildVersions(){return[new et(1,10,10,8,8,new gt(5,new dt(1,3))),new et(2,12,12,10,10,new gt(7,new dt(1,5))),new et(3,14,14,12,12,new gt(10,new dt(1,8))),new et(4,16,16,14,14,new gt(12,new dt(1,12))),new et(5,18,18,16,16,new gt(14,new dt(1,18))),new et(6,20,20,18,18,new gt(18,new dt(1,22))),new et(7,22,22,20,20,new gt(20,new dt(1,30))),new et(8,24,24,22,22,new gt(24,new dt(1,36))),new et(9,26,26,24,24,new gt(28,new dt(1,44))),new et(10,32,32,14,14,new gt(36,new dt(1,62))),new et(11,36,36,16,16,new gt(42,new dt(1,86))),new et(12,40,40,18,18,new gt(48,new dt(1,114))),new et(13,44,44,20,20,new gt(56,new dt(1,144))),new et(14,48,48,22,22,new gt(68,new dt(1,174))),new et(15,52,52,24,24,new gt(42,new dt(2,102))),new et(16,64,64,14,14,new gt(56,new dt(2,140))),new et(17,72,72,16,16,new gt(36,new dt(4,92))),new et(18,80,80,18,18,new gt(48,new dt(4,114))),new et(19,88,88,20,20,new gt(56,new dt(4,144))),new et(20,96,96,22,22,new gt(68,new dt(4,174))),new et(21,104,104,24,24,new gt(56,new dt(6,136))),new et(22,120,120,18,18,new gt(68,new dt(6,175))),new et(23,132,132,20,20,new gt(62,new dt(8,163))),new et(24,144,144,22,22,new gt(62,new dt(8,156),new dt(2,155))),new et(25,8,18,6,16,new gt(7,new dt(1,5))),new et(26,8,32,6,14,new gt(11,new dt(1,10))),new et(27,12,26,10,24,new gt(14,new dt(1,16))),new et(28,12,36,10,16,new gt(18,new dt(1,22))),new et(29,16,36,14,16,new gt(24,new dt(1,32))),new et(30,16,48,14,22,new gt(28,new dt(1,49)))]}}et.VERSIONS=et.buildVersions();class Ra{constructor(t){const i=t.getHeight();if(i<8||i>144||(i&1)!==0)throw new le;this.version=Ra.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new at(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(t){const i=t.getHeight(),a=t.getWidth();return et.getVersionForDimensions(i,a)}readCodewords(){const t=new Int8Array(this.version.getTotalCodewords());let i=0,a=4,l=0;const s=this.mappingBitMatrix.getHeight(),u=this.mappingBitMatrix.getWidth();let c=!1,x=!1,p=!1,w=!1;do if(a===s&&l===0&&!c)t[i++]=this.readCorner1(s,u)&255,a-=2,l+=2,c=!0;else if(a===s-2&&l===0&&(u&3)!==0&&!x)t[i++]=this.readCorner2(s,u)&255,a-=2,l+=2,x=!0;else if(a===s+4&&l===2&&(u&7)===0&&!p)t[i++]=this.readCorner3(s,u)&255,a-=2,l+=2,p=!0;else if(a===s-2&&l===0&&(u&7)===4&&!w)t[i++]=this.readCorner4(s,u)&255,a-=2,l+=2,w=!0;else{do a<s&&l>=0&&!this.readMappingMatrix.get(l,a)&&(t[i++]=this.readUtah(a,l,s,u)&255),a-=2,l+=2;while(a>=0&&l<u);a+=1,l+=3;do a>=0&&l<u&&!this.readMappingMatrix.get(l,a)&&(t[i++]=this.readUtah(a,l,s,u)&255),a+=2,l-=2;while(a<s&&l>=0);a+=3,l+=1}while(a<s||l<u);if(i!==this.version.getTotalCodewords())throw new le;return t}readModule(t,i,a,l){return t<0&&(t+=a,i+=4-(a+4&7)),i<0&&(i+=l,t+=4-(l+4&7)),this.readMappingMatrix.set(i,t),this.mappingBitMatrix.get(i,t)}readUtah(t,i,a,l){let s=0;return this.readModule(t-2,i-2,a,l)&&(s|=1),s<<=1,this.readModule(t-2,i-1,a,l)&&(s|=1),s<<=1,this.readModule(t-1,i-2,a,l)&&(s|=1),s<<=1,this.readModule(t-1,i-1,a,l)&&(s|=1),s<<=1,this.readModule(t-1,i,a,l)&&(s|=1),s<<=1,this.readModule(t,i-2,a,l)&&(s|=1),s<<=1,this.readModule(t,i-1,a,l)&&(s|=1),s<<=1,this.readModule(t,i,a,l)&&(s|=1),s}readCorner1(t,i){let a=0;return this.readModule(t-1,0,t,i)&&(a|=1),a<<=1,this.readModule(t-1,1,t,i)&&(a|=1),a<<=1,this.readModule(t-1,2,t,i)&&(a|=1),a<<=1,this.readModule(0,i-2,t,i)&&(a|=1),a<<=1,this.readModule(0,i-1,t,i)&&(a|=1),a<<=1,this.readModule(1,i-1,t,i)&&(a|=1),a<<=1,this.readModule(2,i-1,t,i)&&(a|=1),a<<=1,this.readModule(3,i-1,t,i)&&(a|=1),a}readCorner2(t,i){let a=0;return this.readModule(t-3,0,t,i)&&(a|=1),a<<=1,this.readModule(t-2,0,t,i)&&(a|=1),a<<=1,this.readModule(t-1,0,t,i)&&(a|=1),a<<=1,this.readModule(0,i-4,t,i)&&(a|=1),a<<=1,this.readModule(0,i-3,t,i)&&(a|=1),a<<=1,this.readModule(0,i-2,t,i)&&(a|=1),a<<=1,this.readModule(0,i-1,t,i)&&(a|=1),a<<=1,this.readModule(1,i-1,t,i)&&(a|=1),a}readCorner3(t,i){let a=0;return this.readModule(t-1,0,t,i)&&(a|=1),a<<=1,this.readModule(t-1,i-1,t,i)&&(a|=1),a<<=1,this.readModule(0,i-3,t,i)&&(a|=1),a<<=1,this.readModule(0,i-2,t,i)&&(a|=1),a<<=1,this.readModule(0,i-1,t,i)&&(a|=1),a<<=1,this.readModule(1,i-3,t,i)&&(a|=1),a<<=1,this.readModule(1,i-2,t,i)&&(a|=1),a<<=1,this.readModule(1,i-1,t,i)&&(a|=1),a}readCorner4(t,i){let a=0;return this.readModule(t-3,0,t,i)&&(a|=1),a<<=1,this.readModule(t-2,0,t,i)&&(a|=1),a<<=1,this.readModule(t-1,0,t,i)&&(a|=1),a<<=1,this.readModule(0,i-2,t,i)&&(a|=1),a<<=1,this.readModule(0,i-1,t,i)&&(a|=1),a<<=1,this.readModule(1,i-1,t,i)&&(a|=1),a<<=1,this.readModule(2,i-1,t,i)&&(a|=1),a<<=1,this.readModule(3,i-1,t,i)&&(a|=1),a}extractDataRegion(t){const i=this.version.getSymbolSizeRows(),a=this.version.getSymbolSizeColumns();if(t.getHeight()!==i)throw new M("Dimension of bitMatrix must match the version size");const l=this.version.getDataRegionSizeRows(),s=this.version.getDataRegionSizeColumns(),u=i/l|0,c=a/s|0,x=u*l,p=c*s,w=new at(p,x);for(let v=0;v<u;++v){const I=v*l;for(let B=0;B<c;++B){const U=B*s;for(let z=0;z<l;++z){const P=v*(l+2)+1+z,W=I+z;for(let me=0;me<s;++me){const xe=B*(s+2)+1+me;if(t.get(xe,P)){const ge=U+me;w.set(ge,W)}}}}}return w}}class Da{constructor(t,i){this.numDataCodewords=t,this.codewords=i}static getDataBlocks(t,i){const a=i.getECBlocks();let l=0;const s=a.getECBlocks();for(let z of s)l+=z.getCount();const u=new Array(l);let c=0;for(let z of s)for(let P=0;P<z.getCount();P++){const W=z.getDataCodewords(),me=a.getECCodewords()+W;u[c++]=new Da(W,new Uint8Array(me))}const p=u[0].codewords.length-a.getECCodewords(),w=p-1;let v=0;for(let z=0;z<w;z++)for(let P=0;P<c;P++)u[P].codewords[z]=t[v++];const I=i.getVersionNumber()===24,B=I?8:c;for(let z=0;z<B;z++)u[z].codewords[p-1]=t[v++];const U=u[0].codewords.length;for(let z=p;z<U;z++)for(let P=0;P<c;P++){const W=I?(P+8)%c:P,me=I&&W>7?z-1:z;u[W].codewords[me]=t[v++]}if(v!==t.length)throw new M;return u}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class ti{constructor(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(t){if(t<1||t>32||t>this.available())throw new M(""+t);let i=0,a=this.bitOffset,l=this.byteOffset;const s=this.bytes;if(a>0){const u=8-a,c=t<u?t:u,x=u-c,p=255>>8-c<<x;i=(s[l]&p)>>x,t-=c,a+=c,a===8&&(a=0,l++)}if(t>0){for(;t>=8;)i=i<<8|s[l]&255,l++,t-=8;if(t>0){const u=8-t,c=255>>u<<u;i=i<<t|(s[l]&c)>>u,a+=t}}return this.bitOffset=a,this.byteOffset=l,i}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var xt;(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"})(xt||(xt={}));class _i{static decode(t){const i=new ti(t),a=new We,l=new We,s=new Array;let u=xt.ASCII_ENCODE;do if(u===xt.ASCII_ENCODE)u=this.decodeAsciiSegment(i,a,l);else{switch(u){case xt.C40_ENCODE:this.decodeC40Segment(i,a);break;case xt.TEXT_ENCODE:this.decodeTextSegment(i,a);break;case xt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(i,a);break;case xt.EDIFACT_ENCODE:this.decodeEdifactSegment(i,a);break;case xt.BASE256_ENCODE:this.decodeBase256Segment(i,a,s);break;default:throw new le}u=xt.ASCII_ENCODE}while(u!==xt.PAD_ENCODE&&i.available()>0);return l.length()>0&&a.append(l.toString()),new Dt(t,a.toString(),s.length===0?null:s,null)}static decodeAsciiSegment(t,i,a){let l=!1;do{let s=t.readBits(8);if(s===0)throw new le;if(s<=128)return l&&(s+=128),i.append(String.fromCharCode(s-1)),xt.ASCII_ENCODE;if(s===129)return xt.PAD_ENCODE;if(s<=229){const u=s-130;u<10&&i.append("0"),i.append(""+u)}else switch(s){case 230:return xt.C40_ENCODE;case 231:return xt.BASE256_ENCODE;case 232:i.append("");break;case 233:case 234:break;case 235:l=!0;break;case 236:i.append("[)>05"),a.insert(0,"");break;case 237:i.append("[)>06"),a.insert(0,"");break;case 238:return xt.ANSIX12_ENCODE;case 239:return xt.TEXT_ENCODE;case 240:return xt.EDIFACT_ENCODE;case 241:break;default:if(s!==254||t.available()!==0)throw new le;break}}while(t.available()>0);return xt.ASCII_ENCODE}static decodeC40Segment(t,i){let a=!1;const l=[];let s=0;do{if(t.available()===8)return;const u=t.readBits(8);if(u===254)return;this.parseTwoBytes(u,t.readBits(8),l);for(let c=0;c<3;c++){const x=l[c];switch(s){case 0:if(x<3)s=x+1;else if(x<this.C40_BASIC_SET_CHARS.length){const p=this.C40_BASIC_SET_CHARS[x];a?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),a=!1):i.append(p)}else throw new le;break;case 1:a?(i.append(String.fromCharCode(x+128)),a=!1):i.append(String.fromCharCode(x)),s=0;break;case 2:if(x<this.C40_SHIFT2_SET_CHARS.length){const p=this.C40_SHIFT2_SET_CHARS[x];a?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),a=!1):i.append(p)}else switch(x){case 27:i.append("");break;case 30:a=!0;break;default:throw new le}s=0;break;case 3:a?(i.append(String.fromCharCode(x+224)),a=!1):i.append(String.fromCharCode(x+96)),s=0;break;default:throw new le}}}while(t.available()>0)}static decodeTextSegment(t,i){let a=!1,l=[],s=0;do{if(t.available()===8)return;const u=t.readBits(8);if(u===254)return;this.parseTwoBytes(u,t.readBits(8),l);for(let c=0;c<3;c++){const x=l[c];switch(s){case 0:if(x<3)s=x+1;else if(x<this.TEXT_BASIC_SET_CHARS.length){const p=this.TEXT_BASIC_SET_CHARS[x];a?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),a=!1):i.append(p)}else throw new le;break;case 1:a?(i.append(String.fromCharCode(x+128)),a=!1):i.append(String.fromCharCode(x)),s=0;break;case 2:if(x<this.TEXT_SHIFT2_SET_CHARS.length){const p=this.TEXT_SHIFT2_SET_CHARS[x];a?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),a=!1):i.append(p)}else switch(x){case 27:i.append("");break;case 30:a=!0;break;default:throw new le}s=0;break;case 3:if(x<this.TEXT_SHIFT3_SET_CHARS.length){const p=this.TEXT_SHIFT3_SET_CHARS[x];a?(i.append(String.fromCharCode(p.charCodeAt(0)+128)),a=!1):i.append(p),s=0}else throw new le;break;default:throw new le}}}while(t.available()>0)}static decodeAnsiX12Segment(t,i){const a=[];do{if(t.available()===8)return;const l=t.readBits(8);if(l===254)return;this.parseTwoBytes(l,t.readBits(8),a);for(let s=0;s<3;s++){const u=a[s];switch(u){case 0:i.append("\r");break;case 1:i.append("*");break;case 2:i.append(">");break;case 3:i.append(" ");break;default:if(u<14)i.append(String.fromCharCode(u+44));else if(u<40)i.append(String.fromCharCode(u+51));else throw new le;break}}}while(t.available()>0)}static parseTwoBytes(t,i,a){let l=(t<<8)+i-1,s=Math.floor(l/1600);a[0]=s,l-=s*1600,s=Math.floor(l/40),a[1]=s,a[2]=l-s*40}static decodeEdifactSegment(t,i){do{if(t.available()<=16)return;for(let a=0;a<4;a++){let l=t.readBits(6);if(l===31){const s=8-t.getBitOffset();s!==8&&t.readBits(s);return}(l&32)===0&&(l|=64),i.append(String.fromCharCode(l))}}while(t.available()>0)}static decodeBase256Segment(t,i,a){let l=1+t.getByteOffset();const s=this.unrandomize255State(t.readBits(8),l++);let u;if(s===0?u=t.available()/8|0:s<250?u=s:u=250*(s-249)+this.unrandomize255State(t.readBits(8),l++),u<0)throw new le;const c=new Uint8Array(u);for(let x=0;x<u;x++){if(t.available()<8)throw new le;c[x]=this.unrandomize255State(t.readBits(8),l++)}a.push(c);try{i.append(Ze.decode(c,Ne.ISO88591))}catch(x){throw new jn("Platform does not support required encoding: "+x.message)}}static unrandomize255State(t,i){const a=149*i%255+1,l=t-a;return l>=0?l:l+256}}_i.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"],_i.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],_i.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"],_i.TEXT_SHIFT2_SET_CHARS=_i.C40_SHIFT2_SET_CHARS,_i.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","{","|","}","~",""];class hu{constructor(){this.rsDecoder=new ta(ht.DATA_MATRIX_FIELD_256)}decode(t){const i=new Ra(t),a=i.getVersion(),l=i.readCodewords(),s=Da.getDataBlocks(l,a);let u=0;for(let p of s)u+=p.getNumDataCodewords();const c=new Uint8Array(u),x=s.length;for(let p=0;p<x;p++){const w=s[p],v=w.getCodewords(),I=w.getNumDataCodewords();this.correctErrors(v,I);for(let B=0;B<I;B++)c[B*x+p]=v[B]}return _i.decode(c)}correctErrors(t,i){const a=new Int32Array(t);try{this.rsDecoder.decode(a,t.length-i)}catch{throw new Z}for(let l=0;l<i;l++)t[l]=a[l]}}class Ft{constructor(t){this.image=t,this.rectangleDetector=new qt(this.image)}detect(){const t=this.rectangleDetector.detect();let i=this.detectSolid1(t);if(i=this.detectSolid2(i),i[3]=this.correctTopRight(i),!i[3])throw new q;i=this.shiftToModuleCenter(i);const a=i[0],l=i[1],s=i[2],u=i[3];let c=this.transitionsBetween(a,u)+1,x=this.transitionsBetween(s,u)+1;(c&1)===1&&(c+=1),(x&1)===1&&(x+=1),4*c<7*x&&4*x<7*c&&(c=x=Math.max(c,x));let p=Ft.sampleGrid(this.image,a,l,s,u,c,x);return new Pr(p,[a,l,s,u])}static shiftPoint(t,i,a){let l=(i.getX()-t.getX())/(a+1),s=(i.getY()-t.getY())/(a+1);return new Te(t.getX()+l,t.getY()+s)}static moveAway(t,i,a){let l=t.getX(),s=t.getY();return l<i?l-=1:l+=1,s<a?s-=1:s+=1,new Te(l,s)}detectSolid1(t){let i=t[0],a=t[1],l=t[3],s=t[2],u=this.transitionsBetween(i,a),c=this.transitionsBetween(a,l),x=this.transitionsBetween(l,s),p=this.transitionsBetween(s,i),w=u,v=[s,i,a,l];return w>c&&(w=c,v[0]=i,v[1]=a,v[2]=l,v[3]=s),w>x&&(w=x,v[0]=a,v[1]=l,v[2]=s,v[3]=i),w>p&&(v[0]=l,v[1]=s,v[2]=i,v[3]=a),v}detectSolid2(t){let i=t[0],a=t[1],l=t[2],s=t[3],u=this.transitionsBetween(i,s),c=Ft.shiftPoint(a,l,(u+1)*4),x=Ft.shiftPoint(l,a,(u+1)*4),p=this.transitionsBetween(c,i),w=this.transitionsBetween(x,s);return p<w?(t[0]=i,t[1]=a,t[2]=l,t[3]=s):(t[0]=a,t[1]=l,t[2]=s,t[3]=i),t}correctTopRight(t){let i=t[0],a=t[1],l=t[2],s=t[3],u=this.transitionsBetween(i,s),c=this.transitionsBetween(a,s),x=Ft.shiftPoint(i,a,(c+1)*4),p=Ft.shiftPoint(l,a,(u+1)*4);u=this.transitionsBetween(x,s),c=this.transitionsBetween(p,s);let w=new Te(s.getX()+(l.getX()-a.getX())/(u+1),s.getY()+(l.getY()-a.getY())/(u+1)),v=new Te(s.getX()+(i.getX()-a.getX())/(c+1),s.getY()+(i.getY()-a.getY())/(c+1));if(!this.isValid(w))return this.isValid(v)?v:null;if(!this.isValid(v))return w;let I=this.transitionsBetween(x,w)+this.transitionsBetween(p,w),B=this.transitionsBetween(x,v)+this.transitionsBetween(p,v);return I>B?w:v}shiftToModuleCenter(t){let i=t[0],a=t[1],l=t[2],s=t[3],u=this.transitionsBetween(i,s)+1,c=this.transitionsBetween(l,s)+1,x=Ft.shiftPoint(i,a,c*4),p=Ft.shiftPoint(l,a,u*4);u=this.transitionsBetween(x,s)+1,c=this.transitionsBetween(p,s)+1,(u&1)===1&&(u+=1),(c&1)===1&&(c+=1);let w=(i.getX()+a.getX()+l.getX()+s.getX())/4,v=(i.getY()+a.getY()+l.getY()+s.getY())/4;i=Ft.moveAway(i,w,v),a=Ft.moveAway(a,w,v),l=Ft.moveAway(l,w,v),s=Ft.moveAway(s,w,v);let I,B;return x=Ft.shiftPoint(i,a,c*4),x=Ft.shiftPoint(x,s,u*4),I=Ft.shiftPoint(a,i,c*4),I=Ft.shiftPoint(I,l,u*4),p=Ft.shiftPoint(l,s,c*4),p=Ft.shiftPoint(p,a,u*4),B=Ft.shiftPoint(s,l,c*4),B=Ft.shiftPoint(B,i,u*4),[x,I,p,B]}isValid(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()}static sampleGrid(t,i,a,l,s,u,c){return Jn.getInstance().sampleGrid(t,u,c,.5,.5,u-.5,.5,u-.5,c-.5,.5,c-.5,i.getX(),i.getY(),s.getX(),s.getY(),l.getX(),l.getY(),a.getX(),a.getY())}transitionsBetween(t,i){let a=Math.trunc(t.getX()),l=Math.trunc(t.getY()),s=Math.trunc(i.getX()),u=Math.trunc(i.getY()),c=Math.abs(u-l)>Math.abs(s-a);if(c){let z=a;a=l,l=z,z=s,s=u,u=z}let x=Math.abs(s-a),p=Math.abs(u-l),w=-x/2,v=l<u?1:-1,I=a<s?1:-1,B=0,U=this.image.get(c?l:a,c?a:l);for(let z=a,P=l;z!==s;z+=I){let W=this.image.get(c?P:z,c?z:P);if(W!==U&&(B++,U=W),w+=p,w>0){if(P===u)break;P+=v,w-=x}}return B}}class Ri{constructor(){this.decoder=new hu}decode(t,i=null){let a,l;if(i!=null&&i.has(Be.PURE_BARCODE)){const p=Ri.extractPureBits(t.getBlackMatrix());a=this.decoder.decode(p),l=Ri.NO_POINTS}else{const p=new Ft(t.getBlackMatrix()).detect();a=this.decoder.decode(p.getBits()),l=p.getPoints()}const s=a.getRawBytes(),u=new Ce(a.getText(),s,8*s.length,l,Ae.DATA_MATRIX,ie.currentTimeMillis()),c=a.getByteSegments();c!=null&&u.putMetadata(ft.BYTE_SEGMENTS,c);const x=a.getECLevel();return x!=null&&u.putMetadata(ft.ERROR_CORRECTION_LEVEL,x),u}reset(){}static extractPureBits(t){const i=t.getTopLeftOnBit(),a=t.getBottomRightOnBit();if(i==null||a==null)throw new q;const l=this.moduleSize(i,t);let s=i[1];const u=a[1];let c=i[0];const p=(a[0]-c+1)/l,w=(u-s+1)/l;if(p<=0||w<=0)throw new q;const v=l/2;s+=v,c+=v;const I=new at(p,w);for(let B=0;B<w;B++){const U=s+B*l;for(let z=0;z<p;z++)t.get(c+z*l,U)&&I.set(z,B)}return I}static moduleSize(t,i){const a=i.getWidth();let l=t[0];const s=t[1];for(;l<a&&i.get(l,s);)l++;if(l===a)throw new q;const u=l-t[0];if(u===0)throw new q;return u}}Ri.NO_POINTS=[];class Xr extends Ee{constructor(t=500){super(new Ri,t)}}var Ba;(function(T){T[T.L=0]="L",T[T.M=1]="M",T[T.Q=2]="Q",T[T.H=3]="H"})(Ba||(Ba={}));class Je{constructor(t,i,a){this.value=t,this.stringValue=i,this.bits=a,Je.FOR_BITS.set(a,this),Je.FOR_VALUE.set(t,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(t){switch(t){case"L":return Je.L;case"M":return Je.M;case"Q":return Je.Q;case"H":return Je.H;default:throw new N(t+"not available")}}toString(){return this.stringValue}equals(t){if(!(t instanceof Je))return!1;const i=t;return this.value===i.value}static forBits(t){if(t<0||t>=Je.FOR_BITS.size)throw new M;return Je.FOR_BITS.get(t)}}Je.FOR_BITS=new Map,Je.FOR_VALUE=new Map,Je.L=new Je(Ba.L,"L",1),Je.M=new Je(Ba.M,"M",0),Je.Q=new Je(Ba.Q,"Q",3),Je.H=new Je(Ba.H,"H",2);class un{constructor(t){this.errorCorrectionLevel=Je.forBits(t>>3&3),this.dataMask=t&7}static numBitsDiffering(t,i){return ne.bitCount(t^i)}static decodeFormatInformation(t,i){const a=un.doDecodeFormatInformation(t,i);return a!==null?a:un.doDecodeFormatInformation(t^un.FORMAT_INFO_MASK_QR,i^un.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(t,i){let a=Number.MAX_SAFE_INTEGER,l=0;for(const s of un.FORMAT_INFO_DECODE_LOOKUP){const u=s[0];if(u===t||u===i)return new un(s[1]);let c=un.numBitsDiffering(t,u);c<a&&(l=s[1],a=c),t!==i&&(c=un.numBitsDiffering(i,u),c<a&&(l=s[1],a=c))}return a<=3?new un(l):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(t){if(!(t instanceof un))return!1;const i=t;return this.errorCorrectionLevel===i.errorCorrectionLevel&&this.dataMask===i.dataMask}}un.FORMAT_INFO_MASK_QR=21522,un.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])];class Y{constructor(t,...i){this.ecCodewordsPerBlock=t,this.ecBlocks=i}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let t=0;const i=this.ecBlocks;for(const a of i)t+=a.getCount();return t}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class D{constructor(t,i){this.count=t,this.dataCodewords=i}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class Me{constructor(t,i,...a){this.versionNumber=t,this.alignmentPatternCenters=i,this.ecBlocks=a;let l=0;const s=a[0].getECCodewordsPerBlock(),u=a[0].getECBlocks();for(const c of u)l+=c.getCount()*(c.getDataCodewords()+s);this.totalCodewords=l}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(t){return this.ecBlocks[t.getValue()]}static getProvisionalVersionForDimension(t){if(t%4!==1)throw new le;try{return this.getVersionForNumber((t-17)/4)}catch{throw new le}}static getVersionForNumber(t){if(t<1||t>40)throw new M;return Me.VERSIONS[t-1]}static decodeVersionInformation(t){let i=Number.MAX_SAFE_INTEGER,a=0;for(let l=0;l<Me.VERSION_DECODE_INFO.length;l++){const s=Me.VERSION_DECODE_INFO[l];if(s===t)return Me.getVersionForNumber(l+7);const u=un.numBitsDiffering(t,s);u<i&&(a=l+7,i=u)}return i<=3?Me.getVersionForNumber(a):null}buildFunctionPattern(){const t=this.getDimensionForVersion(),i=new at(t);i.setRegion(0,0,9,9),i.setRegion(t-8,0,8,9),i.setRegion(0,t-8,9,8);const a=this.alignmentPatternCenters.length;for(let l=0;l<a;l++){const s=this.alignmentPatternCenters[l]-2;for(let u=0;u<a;u++)l===0&&(u===0||u===a-1)||l===a-1&&u===0||i.setRegion(this.alignmentPatternCenters[u]-2,s,5,5)}return i.setRegion(6,9,1,t-17),i.setRegion(9,6,t-17,1),this.versionNumber>6&&(i.setRegion(t-11,0,3,6),i.setRegion(0,t-11,6,3)),i}toString(){return""+this.versionNumber}}Me.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]),Me.VERSIONS=[new Me(1,new Int32Array(0),new Y(7,new D(1,19)),new Y(10,new D(1,16)),new Y(13,new D(1,13)),new Y(17,new D(1,9))),new Me(2,Int32Array.from([6,18]),new Y(10,new D(1,34)),new Y(16,new D(1,28)),new Y(22,new D(1,22)),new Y(28,new D(1,16))),new Me(3,Int32Array.from([6,22]),new Y(15,new D(1,55)),new Y(26,new D(1,44)),new Y(18,new D(2,17)),new Y(22,new D(2,13))),new Me(4,Int32Array.from([6,26]),new Y(20,new D(1,80)),new Y(18,new D(2,32)),new Y(26,new D(2,24)),new Y(16,new D(4,9))),new Me(5,Int32Array.from([6,30]),new Y(26,new D(1,108)),new Y(24,new D(2,43)),new Y(18,new D(2,15),new D(2,16)),new Y(22,new D(2,11),new D(2,12))),new Me(6,Int32Array.from([6,34]),new Y(18,new D(2,68)),new Y(16,new D(4,27)),new Y(24,new D(4,19)),new Y(28,new D(4,15))),new Me(7,Int32Array.from([6,22,38]),new Y(20,new D(2,78)),new Y(18,new D(4,31)),new Y(18,new D(2,14),new D(4,15)),new Y(26,new D(4,13),new D(1,14))),new Me(8,Int32Array.from([6,24,42]),new Y(24,new D(2,97)),new Y(22,new D(2,38),new D(2,39)),new Y(22,new D(4,18),new D(2,19)),new Y(26,new D(4,14),new D(2,15))),new Me(9,Int32Array.from([6,26,46]),new Y(30,new D(2,116)),new Y(22,new D(3,36),new D(2,37)),new Y(20,new D(4,16),new D(4,17)),new Y(24,new D(4,12),new D(4,13))),new Me(10,Int32Array.from([6,28,50]),new Y(18,new D(2,68),new D(2,69)),new Y(26,new D(4,43),new D(1,44)),new Y(24,new D(6,19),new D(2,20)),new Y(28,new D(6,15),new D(2,16))),new Me(11,Int32Array.from([6,30,54]),new Y(20,new D(4,81)),new Y(30,new D(1,50),new D(4,51)),new Y(28,new D(4,22),new D(4,23)),new Y(24,new D(3,12),new D(8,13))),new Me(12,Int32Array.from([6,32,58]),new Y(24,new D(2,92),new D(2,93)),new Y(22,new D(6,36),new D(2,37)),new Y(26,new D(4,20),new D(6,21)),new Y(28,new D(7,14),new D(4,15))),new Me(13,Int32Array.from([6,34,62]),new Y(26,new D(4,107)),new Y(22,new D(8,37),new D(1,38)),new Y(24,new D(8,20),new D(4,21)),new Y(22,new D(12,11),new D(4,12))),new Me(14,Int32Array.from([6,26,46,66]),new Y(30,new D(3,115),new D(1,116)),new Y(24,new D(4,40),new D(5,41)),new Y(20,new D(11,16),new D(5,17)),new Y(24,new D(11,12),new D(5,13))),new Me(15,Int32Array.from([6,26,48,70]),new Y(22,new D(5,87),new D(1,88)),new Y(24,new D(5,41),new D(5,42)),new Y(30,new D(5,24),new D(7,25)),new Y(24,new D(11,12),new D(7,13))),new Me(16,Int32Array.from([6,26,50,74]),new Y(24,new D(5,98),new D(1,99)),new Y(28,new D(7,45),new D(3,46)),new Y(24,new D(15,19),new D(2,20)),new Y(30,new D(3,15),new D(13,16))),new Me(17,Int32Array.from([6,30,54,78]),new Y(28,new D(1,107),new D(5,108)),new Y(28,new D(10,46),new D(1,47)),new Y(28,new D(1,22),new D(15,23)),new Y(28,new D(2,14),new D(17,15))),new Me(18,Int32Array.from([6,30,56,82]),new Y(30,new D(5,120),new D(1,121)),new Y(26,new D(9,43),new D(4,44)),new Y(28,new D(17,22),new D(1,23)),new Y(28,new D(2,14),new D(19,15))),new Me(19,Int32Array.from([6,30,58,86]),new Y(28,new D(3,113),new D(4,114)),new Y(26,new D(3,44),new D(11,45)),new Y(26,new D(17,21),new D(4,22)),new Y(26,new D(9,13),new D(16,14))),new Me(20,Int32Array.from([6,34,62,90]),new Y(28,new D(3,107),new D(5,108)),new Y(26,new D(3,41),new D(13,42)),new Y(30,new D(15,24),new D(5,25)),new Y(28,new D(15,15),new D(10,16))),new Me(21,Int32Array.from([6,28,50,72,94]),new Y(28,new D(4,116),new D(4,117)),new Y(26,new D(17,42)),new Y(28,new D(17,22),new D(6,23)),new Y(30,new D(19,16),new D(6,17))),new Me(22,Int32Array.from([6,26,50,74,98]),new Y(28,new D(2,111),new D(7,112)),new Y(28,new D(17,46)),new Y(30,new D(7,24),new D(16,25)),new Y(24,new D(34,13))),new Me(23,Int32Array.from([6,30,54,78,102]),new Y(30,new D(4,121),new D(5,122)),new Y(28,new D(4,47),new D(14,48)),new Y(30,new D(11,24),new D(14,25)),new Y(30,new D(16,15),new D(14,16))),new Me(24,Int32Array.from([6,28,54,80,106]),new Y(30,new D(6,117),new D(4,118)),new Y(28,new D(6,45),new D(14,46)),new Y(30,new D(11,24),new D(16,25)),new Y(30,new D(30,16),new D(2,17))),new Me(25,Int32Array.from([6,32,58,84,110]),new Y(26,new D(8,106),new D(4,107)),new Y(28,new D(8,47),new D(13,48)),new Y(30,new D(7,24),new D(22,25)),new Y(30,new D(22,15),new D(13,16))),new Me(26,Int32Array.from([6,30,58,86,114]),new Y(28,new D(10,114),new D(2,115)),new Y(28,new D(19,46),new D(4,47)),new Y(28,new D(28,22),new D(6,23)),new Y(30,new D(33,16),new D(4,17))),new Me(27,Int32Array.from([6,34,62,90,118]),new Y(30,new D(8,122),new D(4,123)),new Y(28,new D(22,45),new D(3,46)),new Y(30,new D(8,23),new D(26,24)),new Y(30,new D(12,15),new D(28,16))),new Me(28,Int32Array.from([6,26,50,74,98,122]),new Y(30,new D(3,117),new D(10,118)),new Y(28,new D(3,45),new D(23,46)),new Y(30,new D(4,24),new D(31,25)),new Y(30,new D(11,15),new D(31,16))),new Me(29,Int32Array.from([6,30,54,78,102,126]),new Y(30,new D(7,116),new D(7,117)),new Y(28,new D(21,45),new D(7,46)),new Y(30,new D(1,23),new D(37,24)),new Y(30,new D(19,15),new D(26,16))),new Me(30,Int32Array.from([6,26,52,78,104,130]),new Y(30,new D(5,115),new D(10,116)),new Y(28,new D(19,47),new D(10,48)),new Y(30,new D(15,24),new D(25,25)),new Y(30,new D(23,15),new D(25,16))),new Me(31,Int32Array.from([6,30,56,82,108,134]),new Y(30,new D(13,115),new D(3,116)),new Y(28,new D(2,46),new D(29,47)),new Y(30,new D(42,24),new D(1,25)),new Y(30,new D(23,15),new D(28,16))),new Me(32,Int32Array.from([6,34,60,86,112,138]),new Y(30,new D(17,115)),new Y(28,new D(10,46),new D(23,47)),new Y(30,new D(10,24),new D(35,25)),new Y(30,new D(19,15),new D(35,16))),new Me(33,Int32Array.from([6,30,58,86,114,142]),new Y(30,new D(17,115),new D(1,116)),new Y(28,new D(14,46),new D(21,47)),new Y(30,new D(29,24),new D(19,25)),new Y(30,new D(11,15),new D(46,16))),new Me(34,Int32Array.from([6,34,62,90,118,146]),new Y(30,new D(13,115),new D(6,116)),new Y(28,new D(14,46),new D(23,47)),new Y(30,new D(44,24),new D(7,25)),new Y(30,new D(59,16),new D(1,17))),new Me(35,Int32Array.from([6,30,54,78,102,126,150]),new Y(30,new D(12,121),new D(7,122)),new Y(28,new D(12,47),new D(26,48)),new Y(30,new D(39,24),new D(14,25)),new Y(30,new D(22,15),new D(41,16))),new Me(36,Int32Array.from([6,24,50,76,102,128,154]),new Y(30,new D(6,121),new D(14,122)),new Y(28,new D(6,47),new D(34,48)),new Y(30,new D(46,24),new D(10,25)),new Y(30,new D(2,15),new D(64,16))),new Me(37,Int32Array.from([6,28,54,80,106,132,158]),new Y(30,new D(17,122),new D(4,123)),new Y(28,new D(29,46),new D(14,47)),new Y(30,new D(49,24),new D(10,25)),new Y(30,new D(24,15),new D(46,16))),new Me(38,Int32Array.from([6,32,58,84,110,136,162]),new Y(30,new D(4,122),new D(18,123)),new Y(28,new D(13,46),new D(32,47)),new Y(30,new D(48,24),new D(14,25)),new Y(30,new D(42,15),new D(32,16))),new Me(39,Int32Array.from([6,26,54,82,110,138,166]),new Y(30,new D(20,117),new D(4,118)),new Y(28,new D(40,47),new D(7,48)),new Y(30,new D(43,24),new D(22,25)),new Y(30,new D(10,15),new D(67,16))),new Me(40,Int32Array.from([6,30,58,86,114,142,170]),new Y(30,new D(19,118),new D(6,119)),new Y(28,new D(18,47),new D(31,48)),new Y(30,new D(34,24),new D(34,25)),new Y(30,new D(20,15),new D(61,16)))];var rn;(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"})(rn||(rn={}));class Un{constructor(t,i){this.value=t,this.isMasked=i}unmaskBitMatrix(t,i){for(let a=0;a<i;a++)for(let l=0;l<i;l++)this.isMasked(a,l)&&t.flip(l,a)}}Un.values=new Map([[rn.DATA_MASK_000,new Un(rn.DATA_MASK_000,(T,t)=>(T+t&1)===0)],[rn.DATA_MASK_001,new Un(rn.DATA_MASK_001,(T,t)=>(T&1)===0)],[rn.DATA_MASK_010,new Un(rn.DATA_MASK_010,(T,t)=>t%3===0)],[rn.DATA_MASK_011,new Un(rn.DATA_MASK_011,(T,t)=>(T+t)%3===0)],[rn.DATA_MASK_100,new Un(rn.DATA_MASK_100,(T,t)=>(Math.floor(T/2)+Math.floor(t/3)&1)===0)],[rn.DATA_MASK_101,new Un(rn.DATA_MASK_101,(T,t)=>T*t%6===0)],[rn.DATA_MASK_110,new Un(rn.DATA_MASK_110,(T,t)=>T*t%6<3)],[rn.DATA_MASK_111,new Un(rn.DATA_MASK_111,(T,t)=>(T+t+T*t%3&1)===0)]]);class La{constructor(t){const i=t.getHeight();if(i<21||(i&3)!==1)throw new le;this.bitMatrix=t}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let t=0;for(let s=0;s<6;s++)t=this.copyBit(s,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(let s=5;s>=0;s--)t=this.copyBit(8,s,t);const i=this.bitMatrix.getHeight();let a=0;const l=i-7;for(let s=i-1;s>=l;s--)a=this.copyBit(8,s,a);for(let s=i-8;s<i;s++)a=this.copyBit(s,8,a);if(this.parsedFormatInfo=un.decodeFormatInformation(t,a),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new le}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const t=this.bitMatrix.getHeight(),i=Math.floor((t-17)/4);if(i<=6)return Me.getVersionForNumber(i);let a=0;const l=t-11;for(let u=5;u>=0;u--)for(let c=t-9;c>=l;c--)a=this.copyBit(c,u,a);let s=Me.decodeVersionInformation(a);if(s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;a=0;for(let u=5;u>=0;u--)for(let c=t-9;c>=l;c--)a=this.copyBit(u,c,a);if(s=Me.decodeVersionInformation(a),s!==null&&s.getDimensionForVersion()===t)return this.parsedVersion=s,s;throw new le}copyBit(t,i,a){return(this.isMirror?this.bitMatrix.get(i,t):this.bitMatrix.get(t,i))?a<<1|1:a<<1}readCodewords(){const t=this.readFormatInformation(),i=this.readVersion(),a=Un.values.get(t.getDataMask()),l=this.bitMatrix.getHeight();a.unmaskBitMatrix(this.bitMatrix,l);const s=i.buildFunctionPattern();let u=!0;const c=new Uint8Array(i.getTotalCodewords());let x=0,p=0,w=0;for(let v=l-1;v>0;v-=2){v===6&&v--;for(let I=0;I<l;I++){const B=u?l-1-I:I;for(let U=0;U<2;U++)s.get(v-U,B)||(w++,p<<=1,this.bitMatrix.get(v-U,B)&&(p|=1),w===8&&(c[x++]=p,w=0,p=0))}u=!u}if(x!==i.getTotalCodewords())throw new le;return c}remask(){if(this.parsedFormatInfo===null)return;const t=Un.values[this.parsedFormatInfo.getDataMask()],i=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,i)}setMirror(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t}mirror(){const t=this.bitMatrix;for(let i=0,a=t.getWidth();i<a;i++)for(let l=i+1,s=t.getHeight();l<s;l++)t.get(i,l)!==t.get(l,i)&&(t.flip(l,i),t.flip(i,l))}}class zl{constructor(t,i){this.numDataCodewords=t,this.codewords=i}static getDataBlocks(t,i,a){if(t.length!==i.getTotalCodewords())throw new M;const l=i.getECBlocksForLevel(a);let s=0;const u=l.getECBlocks();for(const U of u)s+=U.getCount();const c=new Array(s);let x=0;for(const U of u)for(let z=0;z<U.getCount();z++){const P=U.getDataCodewords(),W=l.getECCodewordsPerBlock()+P;c[x++]=new zl(P,new Uint8Array(W))}const p=c[0].codewords.length;let w=c.length-1;for(;w>=0&&c[w].codewords.length!==p;)w--;w++;const v=p-l.getECCodewordsPerBlock();let I=0;for(let U=0;U<v;U++)for(let z=0;z<x;z++)c[z].codewords[U]=t[I++];for(let U=w;U<x;U++)c[U].codewords[v]=t[I++];const B=c[0].codewords.length;for(let U=v;U<B;U++)for(let z=0;z<x;z++){const P=z<w?U:U+1;c[z].codewords[P]=t[I++]}return c}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var zn;(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"})(zn||(zn={}));class _e{constructor(t,i,a,l){this.value=t,this.stringValue=i,this.characterCountBitsForVersions=a,this.bits=l,_e.FOR_BITS.set(l,this),_e.FOR_VALUE.set(t,this)}static forBits(t){const i=_e.FOR_BITS.get(t);if(i===void 0)throw new M;return i}getCharacterCountBits(t){const i=t.getVersionNumber();let a;return i<=9?a=0:i<=26?a=1:a=2,this.characterCountBitsForVersions[a]}getValue(){return this.value}getBits(){return this.bits}equals(t){if(!(t instanceof _e))return!1;const i=t;return this.value===i.value}toString(){return this.stringValue}}_e.FOR_BITS=new Map,_e.FOR_VALUE=new Map,_e.TERMINATOR=new _e(zn.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),_e.NUMERIC=new _e(zn.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),_e.ALPHANUMERIC=new _e(zn.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),_e.STRUCTURED_APPEND=new _e(zn.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),_e.BYTE=new _e(zn.BYTE,"BYTE",Int32Array.from([8,16,16]),4),_e.ECI=new _e(zn.ECI,"ECI",Int32Array.from([0,0,0]),7),_e.KANJI=new _e(zn.KANJI,"KANJI",Int32Array.from([8,10,12]),8),_e.FNC1_FIRST_POSITION=new _e(zn.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),_e.FNC1_SECOND_POSITION=new _e(zn.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),_e.HANZI=new _e(zn.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class Bt{static decode(t,i,a,l){const s=new ti(t);let u=new We;const c=new Array;let x=-1,p=-1;try{let w=null,v=!1,I;do{if(s.available()<4)I=_e.TERMINATOR;else{const B=s.readBits(4);I=_e.forBits(B)}switch(I){case _e.TERMINATOR:break;case _e.FNC1_FIRST_POSITION:case _e.FNC1_SECOND_POSITION:v=!0;break;case _e.STRUCTURED_APPEND:if(s.available()<16)throw new le;x=s.readBits(8),p=s.readBits(8);break;case _e.ECI:const B=Bt.parseECIValue(s);if(w=fe.getCharacterSetECIByValue(B),w===null)throw new le;break;case _e.HANZI:const U=s.readBits(4),z=s.readBits(I.getCharacterCountBits(i));U===Bt.GB2312_SUBSET&&Bt.decodeHanziSegment(s,u,z);break;default:const P=s.readBits(I.getCharacterCountBits(i));switch(I){case _e.NUMERIC:Bt.decodeNumericSegment(s,u,P);break;case _e.ALPHANUMERIC:Bt.decodeAlphanumericSegment(s,u,P,v);break;case _e.BYTE:Bt.decodeByteSegment(s,u,P,w,c,l);break;case _e.KANJI:Bt.decodeKanjiSegment(s,u,P);break;default:throw new le}break}}while(I!==_e.TERMINATOR)}catch{throw new le}return new Dt(t,u.toString(),c.length===0?null:c,a===null?null:a.toString(),x,p)}static decodeHanziSegment(t,i,a){if(a*13>t.available())throw new le;const l=new Uint8Array(2*a);let s=0;for(;a>0;){const u=t.readBits(13);let c=u/96<<8&4294967295|u%96;c<959?c+=41377:c+=42657,l[s]=c>>8&255,l[s+1]=c&255,s+=2,a--}try{i.append(Ze.decode(l,Ne.GB2312))}catch(u){throw new le(u)}}static decodeKanjiSegment(t,i,a){if(a*13>t.available())throw new le;const l=new Uint8Array(2*a);let s=0;for(;a>0;){const u=t.readBits(13);let c=u/192<<8&4294967295|u%192;c<7936?c+=33088:c+=49472,l[s]=c>>8,l[s+1]=c,s+=2,a--}try{i.append(Ze.decode(l,Ne.SHIFT_JIS))}catch(u){throw new le(u)}}static decodeByteSegment(t,i,a,l,s,u){if(8*a>t.available())throw new le;const c=new Uint8Array(a);for(let p=0;p<a;p++)c[p]=t.readBits(8);let x;l===null?x=Ne.guessEncoding(c,u):x=l.getName();try{i.append(Ze.decode(c,x))}catch(p){throw new le(p)}s.push(c)}static toAlphaNumericChar(t){if(t>=Bt.ALPHANUMERIC_CHARS.length)throw new le;return Bt.ALPHANUMERIC_CHARS[t]}static decodeAlphanumericSegment(t,i,a,l){const s=i.length();for(;a>1;){if(t.available()<11)throw new le;const u=t.readBits(11);i.append(Bt.toAlphaNumericChar(Math.floor(u/45))),i.append(Bt.toAlphaNumericChar(u%45)),a-=2}if(a===1){if(t.available()<6)throw new le;i.append(Bt.toAlphaNumericChar(t.readBits(6)))}if(l)for(let u=s;u<i.length();u++)i.charAt(u)==="%"&&(u<i.length()-1&&i.charAt(u+1)==="%"?i.deleteCharAt(u+1):i.setCharAt(u,""))}static decodeNumericSegment(t,i,a){for(;a>=3;){if(t.available()<10)throw new le;const l=t.readBits(10);if(l>=1e3)throw new le;i.append(Bt.toAlphaNumericChar(Math.floor(l/100))),i.append(Bt.toAlphaNumericChar(Math.floor(l/10)%10)),i.append(Bt.toAlphaNumericChar(l%10)),a-=3}if(a===2){if(t.available()<7)throw new le;const l=t.readBits(7);if(l>=100)throw new le;i.append(Bt.toAlphaNumericChar(Math.floor(l/10))),i.append(Bt.toAlphaNumericChar(l%10))}else if(a===1){if(t.available()<4)throw new le;const l=t.readBits(4);if(l>=10)throw new le;i.append(Bt.toAlphaNumericChar(l))}}static parseECIValue(t){const i=t.readBits(8);if((i&128)===0)return i&127;if((i&192)===128){const a=t.readBits(8);return(i&63)<<8&4294967295|a}if((i&224)===192){const a=t.readBits(16);return(i&31)<<16&4294967295|a}throw new le}}Bt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Bt.GB2312_SUBSET=1;class ks{constructor(t){this.mirrored=t}isMirrored(){return this.mirrored}applyMirroredCorrection(t){if(!this.mirrored||t===null||t.length<3)return;const i=t[0];t[0]=t[2],t[2]=i}}class du{constructor(){this.rsDecoder=new ta(ht.QR_CODE_FIELD_256)}decodeBooleanArray(t,i){return this.decodeBitMatrix(at.parseFromBooleanArray(t),i)}decodeBitMatrix(t,i){const a=new La(t);let l=null;try{return this.decodeBitMatrixParser(a,i)}catch(s){l=s}try{a.remask(),a.setMirror(!0),a.readVersion(),a.readFormatInformation(),a.mirror();const s=this.decodeBitMatrixParser(a,i);return s.setOther(new ks(!0)),s}catch(s){throw l!==null?l:s}}decodeBitMatrixParser(t,i){const a=t.readVersion(),l=t.readFormatInformation().getErrorCorrectionLevel(),s=t.readCodewords(),u=zl.getDataBlocks(s,a,l);let c=0;for(const w of u)c+=w.getNumDataCodewords();const x=new Uint8Array(c);let p=0;for(const w of u){const v=w.getCodewords(),I=w.getNumDataCodewords();this.correctErrors(v,I);for(let B=0;B<I;B++)x[p++]=v[B]}return Bt.decode(x,a,l,i)}correctErrors(t,i){const a=new Int32Array(t);try{this.rsDecoder.decode(a,t.length-i)}catch{throw new Z}for(let l=0;l<i;l++)t[l]=a[l]}}class Ua extends Te{constructor(t,i,a){super(t,i),this.estimatedModuleSize=a}aboutEquals(t,i,a){if(Math.abs(i-this.getY())<=t&&Math.abs(a-this.getX())<=t){const l=Math.abs(t-this.estimatedModuleSize);return l<=1||l<=this.estimatedModuleSize}return!1}combineEstimate(t,i,a){const l=(this.getX()+i)/2,s=(this.getY()+t)/2,u=(this.estimatedModuleSize+a)/2;return new Ua(l,s,u)}}class Gn{constructor(t,i,a,l,s,u,c){this.image=t,this.startX=i,this.startY=a,this.width=l,this.height=s,this.moduleSize=u,this.resultPointCallback=c,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const t=this.startX,i=this.height,a=this.width,l=t+a,s=this.startY+i/2,u=new Int32Array(3),c=this.image;for(let x=0;x<i;x++){const p=s+((x&1)===0?Math.floor((x+1)/2):-Math.floor((x+1)/2));u[0]=0,u[1]=0,u[2]=0;let w=t;for(;w<l&&!c.get(w,p);)w++;let v=0;for(;w<l;){if(c.get(w,p))if(v===1)u[1]++;else if(v===2){if(this.foundPatternCross(u)){const I=this.handlePossibleCenter(u,p,w);if(I!==null)return I}u[0]=u[2],u[1]=1,u[2]=0,v=1}else u[++v]++;else v===1&&v++,u[v]++;w++}if(this.foundPatternCross(u)){const I=this.handlePossibleCenter(u,p,l);if(I!==null)return I}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new q}static centerFromEnd(t,i){return i-t[2]-t[1]/2}foundPatternCross(t){const i=this.moduleSize,a=i/2;for(let l=0;l<3;l++)if(Math.abs(i-t[l])>=a)return!1;return!0}crossCheckVertical(t,i,a,l){const s=this.image,u=s.getHeight(),c=this.crossCheckStateCount;c[0]=0,c[1]=0,c[2]=0;let x=t;for(;x>=0&&s.get(i,x)&&c[1]<=a;)c[1]++,x--;if(x<0||c[1]>a)return NaN;for(;x>=0&&!s.get(i,x)&&c[0]<=a;)c[0]++,x--;if(c[0]>a)return NaN;for(x=t+1;x<u&&s.get(i,x)&&c[1]<=a;)c[1]++,x++;if(x===u||c[1]>a)return NaN;for(;x<u&&!s.get(i,x)&&c[2]<=a;)c[2]++,x++;if(c[2]>a)return NaN;const p=c[0]+c[1]+c[2];return 5*Math.abs(p-l)>=2*l?NaN:this.foundPatternCross(c)?Gn.centerFromEnd(c,x):NaN}handlePossibleCenter(t,i,a){const l=t[0]+t[1]+t[2],s=Gn.centerFromEnd(t,a),u=this.crossCheckVertical(i,s,2*t[1],l);if(!isNaN(u)){const c=(t[0]+t[1]+t[2])/3;for(const p of this.possibleCenters)if(p.aboutEquals(c,u,s))return p.combineEstimate(u,s,c);const x=new Ua(s,u,c);this.possibleCenters.push(x),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(x)}return null}}class pr extends Te{constructor(t,i,a,l){super(t,i),this.estimatedModuleSize=a,this.count=l,l===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(t,i,a){if(Math.abs(i-this.getY())<=t&&Math.abs(a-this.getX())<=t){const l=Math.abs(t-this.estimatedModuleSize);return l<=1||l<=this.estimatedModuleSize}return!1}combineEstimate(t,i,a){const l=this.count+1,s=(this.count*this.getX()+i)/l,u=(this.count*this.getY()+t)/l,c=(this.count*this.estimatedModuleSize+a)/l;return new pr(s,u,c,l)}}class kl{constructor(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Ht{constructor(t,i){this.image=t,this.resultPointCallback=i,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=i}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(t){const i=t!=null&&t.get(Be.TRY_HARDER)!==void 0,a=t!=null&&t.get(Be.PURE_BARCODE)!==void 0,l=this.image,s=l.getHeight(),u=l.getWidth();let c=Math.floor(3*s/(4*Ht.MAX_MODULES));(c<Ht.MIN_SKIP||i)&&(c=Ht.MIN_SKIP);let x=!1;const p=new Int32Array(5);for(let v=c-1;v<s&&!x;v+=c){p[0]=0,p[1]=0,p[2]=0,p[3]=0,p[4]=0;let I=0;for(let B=0;B<u;B++)if(l.get(B,v))(I&1)===1&&I++,p[I]++;else if((I&1)===0)if(I===4)if(Ht.foundPatternCross(p)){if(this.handlePossibleCenter(p,v,B,a)===!0)if(c=2,this.hasSkipped===!0)x=this.haveMultiplyConfirmedCenters();else{const z=this.findRowSkip();z>p[2]&&(v+=z-p[2]-c,B=u-1)}else{p[0]=p[2],p[1]=p[3],p[2]=p[4],p[3]=1,p[4]=0,I=3;continue}I=0,p[0]=0,p[1]=0,p[2]=0,p[3]=0,p[4]=0}else p[0]=p[2],p[1]=p[3],p[2]=p[4],p[3]=1,p[4]=0,I=3;else p[++I]++;else p[I]++;Ht.foundPatternCross(p)&&this.handlePossibleCenter(p,v,u,a)===!0&&(c=p[0],this.hasSkipped&&(x=this.haveMultiplyConfirmedCenters()))}const w=this.selectBestPatterns();return Te.orderBestPatterns(w),new kl(w)}static centerFromEnd(t,i){return i-t[4]-t[3]-t[2]/2}static foundPatternCross(t){let i=0;for(let s=0;s<5;s++){const u=t[s];if(u===0)return!1;i+=u}if(i<7)return!1;const a=i/7,l=a/2;return Math.abs(a-t[0])<l&&Math.abs(a-t[1])<l&&Math.abs(3*a-t[2])<3*l&&Math.abs(a-t[3])<l&&Math.abs(a-t[4])<l}getCrossCheckStateCount(){const t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t}crossCheckDiagonal(t,i,a,l){const s=this.getCrossCheckStateCount();let u=0;const c=this.image;for(;t>=u&&i>=u&&c.get(i-u,t-u);)s[2]++,u++;if(t<u||i<u)return!1;for(;t>=u&&i>=u&&!c.get(i-u,t-u)&&s[1]<=a;)s[1]++,u++;if(t<u||i<u||s[1]>a)return!1;for(;t>=u&&i>=u&&c.get(i-u,t-u)&&s[0]<=a;)s[0]++,u++;if(s[0]>a)return!1;const x=c.getHeight(),p=c.getWidth();for(u=1;t+u<x&&i+u<p&&c.get(i+u,t+u);)s[2]++,u++;if(t+u>=x||i+u>=p)return!1;for(;t+u<x&&i+u<p&&!c.get(i+u,t+u)&&s[3]<a;)s[3]++,u++;if(t+u>=x||i+u>=p||s[3]>=a)return!1;for(;t+u<x&&i+u<p&&c.get(i+u,t+u)&&s[4]<a;)s[4]++,u++;if(s[4]>=a)return!1;const w=s[0]+s[1]+s[2]+s[3]+s[4];return Math.abs(w-l)<2*l&&Ht.foundPatternCross(s)}crossCheckVertical(t,i,a,l){const s=this.image,u=s.getHeight(),c=this.getCrossCheckStateCount();let x=t;for(;x>=0&&s.get(i,x);)c[2]++,x--;if(x<0)return NaN;for(;x>=0&&!s.get(i,x)&&c[1]<=a;)c[1]++,x--;if(x<0||c[1]>a)return NaN;for(;x>=0&&s.get(i,x)&&c[0]<=a;)c[0]++,x--;if(c[0]>a)return NaN;for(x=t+1;x<u&&s.get(i,x);)c[2]++,x++;if(x===u)return NaN;for(;x<u&&!s.get(i,x)&&c[3]<a;)c[3]++,x++;if(x===u||c[3]>=a)return NaN;for(;x<u&&s.get(i,x)&&c[4]<a;)c[4]++,x++;if(c[4]>=a)return NaN;const p=c[0]+c[1]+c[2]+c[3]+c[4];return 5*Math.abs(p-l)>=2*l?NaN:Ht.foundPatternCross(c)?Ht.centerFromEnd(c,x):NaN}crossCheckHorizontal(t,i,a,l){const s=this.image,u=s.getWidth(),c=this.getCrossCheckStateCount();let x=t;for(;x>=0&&s.get(x,i);)c[2]++,x--;if(x<0)return NaN;for(;x>=0&&!s.get(x,i)&&c[1]<=a;)c[1]++,x--;if(x<0||c[1]>a)return NaN;for(;x>=0&&s.get(x,i)&&c[0]<=a;)c[0]++,x--;if(c[0]>a)return NaN;for(x=t+1;x<u&&s.get(x,i);)c[2]++,x++;if(x===u)return NaN;for(;x<u&&!s.get(x,i)&&c[3]<a;)c[3]++,x++;if(x===u||c[3]>=a)return NaN;for(;x<u&&s.get(x,i)&&c[4]<a;)c[4]++,x++;if(c[4]>=a)return NaN;const p=c[0]+c[1]+c[2]+c[3]+c[4];return 5*Math.abs(p-l)>=l?NaN:Ht.foundPatternCross(c)?Ht.centerFromEnd(c,x):NaN}handlePossibleCenter(t,i,a,l){const s=t[0]+t[1]+t[2]+t[3]+t[4];let u=Ht.centerFromEnd(t,a),c=this.crossCheckVertical(i,Math.floor(u),t[2],s);if(!isNaN(c)&&(u=this.crossCheckHorizontal(Math.floor(u),Math.floor(c),t[2],s),!isNaN(u)&&(!l||this.crossCheckDiagonal(Math.floor(c),Math.floor(u),t[2],s)))){const x=s/7;let p=!1;const w=this.possibleCenters;for(let v=0,I=w.length;v<I;v++){const B=w[v];if(B.aboutEquals(x,c,u)){w[v]=B.combineEstimate(c,u,x),p=!0;break}}if(!p){const v=new pr(u,c,x);w.push(v),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(v)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let i=null;for(const a of this.possibleCenters)if(a.getCount()>=Ht.CENTER_QUORUM)if(i==null)i=a;else return this.hasSkipped=!0,Math.floor((Math.abs(i.getX()-a.getX())-Math.abs(i.getY()-a.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let t=0,i=0;const a=this.possibleCenters.length;for(const u of this.possibleCenters)u.getCount()>=Ht.CENTER_QUORUM&&(t++,i+=u.getEstimatedModuleSize());if(t<3)return!1;const l=i/a;let s=0;for(const u of this.possibleCenters)s+=Math.abs(u.getEstimatedModuleSize()-l);return s<=.05*i}selectBestPatterns(){const t=this.possibleCenters.length;if(t<3)throw new q;const i=this.possibleCenters;let a;if(t>3){let l=0,s=0;for(const x of this.possibleCenters){const p=x.getEstimatedModuleSize();l+=p,s+=p*p}a=l/t;let u=Math.sqrt(s/t-a*a);i.sort((x,p)=>{const w=Math.abs(p.getEstimatedModuleSize()-a),v=Math.abs(x.getEstimatedModuleSize()-a);return w<v?-1:w>v?1:0});const c=Math.max(.2*a,u);for(let x=0;x<i.length&&i.length>3;x++){const p=i[x];Math.abs(p.getEstimatedModuleSize()-a)>c&&(i.splice(x,1),x--)}}if(i.length>3){let l=0;for(const s of i)l+=s.getEstimatedModuleSize();a=l/i.length,i.sort((s,u)=>{if(u.getCount()===s.getCount()){const c=Math.abs(u.getEstimatedModuleSize()-a),x=Math.abs(s.getEstimatedModuleSize()-a);return c<x?1:c>x?-1:0}else return u.getCount()-s.getCount()}),i.splice(3)}return[i[0],i[1],i[2]]}}Ht.CENTER_QUORUM=2,Ht.MIN_SKIP=3,Ht.MAX_MODULES=57;class pi{constructor(t){this.image=t}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(t){this.resultPointCallback=t==null?null:t.get(Be.NEED_RESULT_POINT_CALLBACK);const a=new Ht(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(a)}processFinderPatternInfo(t){const i=t.getTopLeft(),a=t.getTopRight(),l=t.getBottomLeft(),s=this.calculateModuleSize(i,a,l);if(s<1)throw new q("No pattern found in proccess finder.");const u=pi.computeDimension(i,a,l,s),c=Me.getProvisionalVersionForDimension(u),x=c.getDimensionForVersion()-7;let p=null;if(c.getAlignmentPatternCenters().length>0){const B=a.getX()-i.getX()+l.getX(),U=a.getY()-i.getY()+l.getY(),z=1-3/x,P=Math.floor(i.getX()+z*(B-i.getX())),W=Math.floor(i.getY()+z*(U-i.getY()));for(let me=4;me<=16;me<<=1)try{p=this.findAlignmentInRegion(s,P,W,me);break}catch(xe){if(!(xe instanceof q))throw xe}}const w=pi.createTransform(i,a,l,p,u),v=pi.sampleGrid(this.image,w,u);let I;return p===null?I=[l,i,a]:I=[l,i,a,p],new Pr(v,I)}static createTransform(t,i,a,l,s){const u=s-3.5;let c,x,p,w;return l!==null?(c=l.getX(),x=l.getY(),p=u-3,w=p):(c=i.getX()-t.getX()+a.getX(),x=i.getY()-t.getY()+a.getY(),p=u,w=u),Pn.quadrilateralToQuadrilateral(3.5,3.5,u,3.5,p,w,3.5,u,t.getX(),t.getY(),i.getX(),i.getY(),c,x,a.getX(),a.getY())}static sampleGrid(t,i,a){return Jn.getInstance().sampleGridWithTransform(t,a,a,i)}static computeDimension(t,i,a,l){const s=$e.round(Te.distance(t,i)/l),u=$e.round(Te.distance(t,a)/l);let c=Math.floor((s+u)/2)+7;switch(c&3){case 0:c++;break;case 2:c--;break;case 3:throw new q("Dimensions could be not found.")}return c}calculateModuleSize(t,i,a){return(this.calculateModuleSizeOneWay(t,i)+this.calculateModuleSizeOneWay(t,a))/2}calculateModuleSizeOneWay(t,i){const a=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(i.getX()),Math.floor(i.getY())),l=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(i.getX()),Math.floor(i.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(a)?l/7:isNaN(l)?a/7:(a+l)/14}sizeOfBlackWhiteBlackRunBothWays(t,i,a,l){let s=this.sizeOfBlackWhiteBlackRun(t,i,a,l),u=1,c=t-(a-t);c<0?(u=t/(t-c),c=0):c>=this.image.getWidth()&&(u=(this.image.getWidth()-1-t)/(c-t),c=this.image.getWidth()-1);let x=Math.floor(i-(l-i)*u);return u=1,x<0?(u=i/(i-x),x=0):x>=this.image.getHeight()&&(u=(this.image.getHeight()-1-i)/(x-i),x=this.image.getHeight()-1),c=Math.floor(t+(c-t)*u),s+=this.sizeOfBlackWhiteBlackRun(t,i,c,x),s-1}sizeOfBlackWhiteBlackRun(t,i,a,l){const s=Math.abs(l-i)>Math.abs(a-t);if(s){let B=t;t=i,i=B,B=a,a=l,l=B}const u=Math.abs(a-t),c=Math.abs(l-i);let x=-u/2;const p=t<a?1:-1,w=i<l?1:-1;let v=0;const I=a+p;for(let B=t,U=i;B!==I;B+=p){const z=s?U:B,P=s?B:U;if(v===1===this.image.get(z,P)){if(v===2)return $e.distance(B,U,t,i);v++}if(x+=c,x>0){if(U===l)break;U+=w,x-=u}}return v===2?$e.distance(a+p,l,t,i):NaN}findAlignmentInRegion(t,i,a,l){const s=Math.floor(l*t),u=Math.max(0,i-s),c=Math.min(this.image.getWidth()-1,i+s);if(c-u<t*3)throw new q("Alignment top exceeds estimated module size.");const x=Math.max(0,a-s),p=Math.min(this.image.getHeight()-1,a+s);if(p-x<t*3)throw new q("Alignment bottom exceeds estimated module size.");return new Gn(this.image,u,x,c-u,p-x,t,this.resultPointCallback).find()}}class Di{constructor(){this.decoder=new du}getDecoder(){return this.decoder}decode(t,i){let a,l;if(i!=null&&i.get(Be.PURE_BARCODE)!==void 0){const x=Di.extractPureBits(t.getBlackMatrix());a=this.decoder.decodeBitMatrix(x,i),l=Di.NO_POINTS}else{const x=new pi(t.getBlackMatrix()).detect(i);a=this.decoder.decodeBitMatrix(x.getBits(),i),l=x.getPoints()}a.getOther()instanceof ks&&a.getOther().applyMirroredCorrection(l);const s=new Ce(a.getText(),a.getRawBytes(),void 0,l,Ae.QR_CODE,void 0),u=a.getByteSegments();u!==null&&s.putMetadata(ft.BYTE_SEGMENTS,u);const c=a.getECLevel();return c!==null&&s.putMetadata(ft.ERROR_CORRECTION_LEVEL,c),a.hasStructuredAppend()&&(s.putMetadata(ft.STRUCTURED_APPEND_SEQUENCE,a.getStructuredAppendSequenceNumber()),s.putMetadata(ft.STRUCTURED_APPEND_PARITY,a.getStructuredAppendParity())),s}reset(){}static extractPureBits(t){const i=t.getTopLeftOnBit(),a=t.getBottomRightOnBit();if(i===null||a===null)throw new q;const l=this.moduleSize(i,t);let s=i[1],u=a[1],c=i[0],x=a[0];if(c>=x||s>=u)throw new q;if(u-s!==x-c&&(x=c+(u-s),x>=t.getWidth()))throw new q;const p=Math.round((x-c+1)/l),w=Math.round((u-s+1)/l);if(p<=0||w<=0)throw new q;if(w!==p)throw new q;const v=Math.floor(l/2);s+=v,c+=v;const I=c+Math.floor((p-1)*l)-x;if(I>0){if(I>v)throw new q;c-=I}const B=s+Math.floor((w-1)*l)-u;if(B>0){if(B>v)throw new q;s-=B}const U=new at(p,w);for(let z=0;z<w;z++){const P=s+Math.floor(z*l);for(let W=0;W<p;W++)t.get(c+Math.floor(W*l),P)&&U.set(W,z)}return U}static moduleSize(t,i){const a=i.getHeight(),l=i.getWidth();let s=t[0],u=t[1],c=!0,x=0;for(;s<l&&u<a;){if(c!==i.get(s,u)){if(++x===5)break;c=!c}s++,u++}if(s===l||u===a)throw new q;return(s-t[0])/7}}Di.NO_POINTS=new Array;class Le{PDF417Common(){}static getBitCountSum(t){return $e.sum(t)}static toIntArray(t){if(t==null||!t.length)return Le.EMPTY_INT_ARRAY;const i=new Int32Array(t.length);let a=0;for(const l of t)i[a++]=l;return i}static getCodeword(t){const i=de.binarySearch(Le.SYMBOL_TABLE,t&262143);return i<0?-1:(Le.CODEWORD_TABLE[i]-1)%Le.NUMBER_OF_CODEWORDS}}Le.NUMBER_OF_CODEWORDS=929,Le.MAX_CODEWORDS_IN_BARCODE=Le.NUMBER_OF_CODEWORDS-1,Le.MIN_ROWS_IN_BARCODE=3,Le.MAX_ROWS_IN_BARCODE=90,Le.MODULES_IN_CODEWORD=17,Le.MODULES_IN_STOP_PATTERN=18,Le.BARS_IN_MODULE=8,Le.EMPTY_INT_ARRAY=new Int32Array([]),Le.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]),Le.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]);class Fs{constructor(t,i){this.bits=t,this.points=i}getBits(){return this.bits}getPoints(){return this.points}}class Fe{static detectMultiple(t,i,a){let l=t.getBlackMatrix(),s=Fe.detect(a,l);return s.length||(l=l.clone(),l.rotate180(),s=Fe.detect(a,l)),new Fs(l,s)}static detect(t,i){const a=new Array;let l=0,s=0,u=!1;for(;l<i.getHeight();){const c=Fe.findVertices(i,l,s);if(c[0]==null&&c[3]==null){if(!u)break;u=!1,s=0;for(const x of a)x[1]!=null&&(l=Math.trunc(Math.max(l,x[1].getY()))),x[3]!=null&&(l=Math.max(l,Math.trunc(x[3].getY())));l+=Fe.ROW_STEP;continue}if(u=!0,a.push(c),!t)break;c[2]!=null?(s=Math.trunc(c[2].getX()),l=Math.trunc(c[2].getY())):(s=Math.trunc(c[4].getX()),l=Math.trunc(c[4].getY()))}return a}static findVertices(t,i,a){const l=t.getHeight(),s=t.getWidth(),u=new Array(8);return Fe.copyToResult(u,Fe.findRowsWithPattern(t,l,s,i,a,Fe.START_PATTERN),Fe.INDEXES_START_PATTERN),u[4]!=null&&(a=Math.trunc(u[4].getX()),i=Math.trunc(u[4].getY())),Fe.copyToResult(u,Fe.findRowsWithPattern(t,l,s,i,a,Fe.STOP_PATTERN),Fe.INDEXES_STOP_PATTERN),u}static copyToResult(t,i,a){for(let l=0;l<a.length;l++)t[a[l]]=i[l]}static findRowsWithPattern(t,i,a,l,s,u){const c=new Array(4);let x=!1;const p=new Int32Array(u.length);for(;l<i;l+=Fe.ROW_STEP){let v=Fe.findGuardPattern(t,s,l,a,!1,u,p);if(v!=null){for(;l>0;){const I=Fe.findGuardPattern(t,s,--l,a,!1,u,p);if(I!=null)v=I;else{l++;break}}c[0]=new Te(v[0],l),c[1]=new Te(v[1],l),x=!0;break}}let w=l+1;if(x){let v=0,I=Int32Array.from([Math.trunc(c[0].getX()),Math.trunc(c[1].getX())]);for(;w<i;w++){const B=Fe.findGuardPattern(t,I[0],w,a,!1,u,p);if(B!=null&&Math.abs(I[0]-B[0])<Fe.MAX_PATTERN_DRIFT&&Math.abs(I[1]-B[1])<Fe.MAX_PATTERN_DRIFT)I=B,v=0;else{if(v>Fe.SKIPPED_ROW_COUNT_MAX)break;v++}}w-=v+1,c[2]=new Te(I[0],w),c[3]=new Te(I[1],w)}return w-l<Fe.BARCODE_MIN_HEIGHT&&de.fill(c,null),c}static findGuardPattern(t,i,a,l,s,u,c){de.fillWithin(c,0,c.length,0);let x=i,p=0;for(;t.get(x,a)&&x>0&&p++<Fe.MAX_PIXEL_DRIFT;)x--;let w=x,v=0,I=u.length;for(let B=s;w<l;w++)if(t.get(w,a)!==B)c[v]++;else{if(v===I-1){if(Fe.patternMatchVariance(c,u,Fe.MAX_INDIVIDUAL_VARIANCE)<Fe.MAX_AVG_VARIANCE)return new Int32Array([x,w]);x+=c[0]+c[1],ie.arraycopy(c,2,c,0,v-1),c[v-1]=0,c[v]=0,v--}else v++;c[v]=1,B=!B}return v===I-1&&Fe.patternMatchVariance(c,u,Fe.MAX_INDIVIDUAL_VARIANCE)<Fe.MAX_AVG_VARIANCE?new Int32Array([x,w-1]):null}static patternMatchVariance(t,i,a){let l=t.length,s=0,u=0;for(let p=0;p<l;p++)s+=t[p],u+=i[p];if(s<u)return 1/0;let c=s/u;a*=c;let x=0;for(let p=0;p<l;p++){let w=t[p],v=i[p]*c,I=w>v?w-v:v-w;if(I>a)return 1/0;x+=I}return x/s}}Fe.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Fe.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Fe.MAX_AVG_VARIANCE=.42,Fe.MAX_INDIVIDUAL_VARIANCE=.8,Fe.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Fe.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Fe.MAX_PIXEL_DRIFT=3,Fe.MAX_PATTERN_DRIFT=5,Fe.SKIPPED_ROW_COUNT_MAX=25,Fe.ROW_STEP=5,Fe.BARCODE_MIN_HEIGHT=10;class Lt{constructor(t,i){if(i.length===0)throw new M;this.field=t;let a=i.length;if(a>1&&i[0]===0){let l=1;for(;l<a&&i[l]===0;)l++;l===a?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(a-l),ie.arraycopy(i,l,this.coefficients,0,this.coefficients.length))}else this.coefficients=i}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(t===0)return this.getCoefficient(0);if(t===1){let l=0;for(let s of this.coefficients)l=this.field.add(l,s);return l}let i=this.coefficients[0],a=this.coefficients.length;for(let l=1;l<a;l++)i=this.field.add(this.field.multiply(t,i),this.coefficients[l]);return i}add(t){if(!this.field.equals(t.field))throw new M("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;let i=this.coefficients,a=t.coefficients;if(i.length>a.length){let u=i;i=a,a=u}let l=new Int32Array(a.length),s=a.length-i.length;ie.arraycopy(a,0,l,0,s);for(let u=s;u<a.length;u++)l[u]=this.field.add(i[u-s],a[u]);return new Lt(this.field,l)}subtract(t){if(!this.field.equals(t.field))throw new M("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())}multiply(t){return t instanceof Lt?this.multiplyOther(t):this.multiplyScalar(t)}multiplyOther(t){if(!this.field.equals(t.field))throw new M("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new Lt(this.field,new Int32Array([0]));let i=this.coefficients,a=i.length,l=t.coefficients,s=l.length,u=new Int32Array(a+s-1);for(let c=0;c<a;c++){let x=i[c];for(let p=0;p<s;p++)u[c+p]=this.field.add(u[c+p],this.field.multiply(x,l[p]))}return new Lt(this.field,u)}negative(){let t=this.coefficients.length,i=new Int32Array(t);for(let a=0;a<t;a++)i[a]=this.field.subtract(0,this.coefficients[a]);return new Lt(this.field,i)}multiplyScalar(t){if(t===0)return new Lt(this.field,new Int32Array([0]));if(t===1)return this;let i=this.coefficients.length,a=new Int32Array(i);for(let l=0;l<i;l++)a[l]=this.field.multiply(this.coefficients[l],t);return new Lt(this.field,a)}multiplyByMonomial(t,i){if(t<0)throw new M;if(i===0)return new Lt(this.field,new Int32Array([0]));let a=this.coefficients.length,l=new Int32Array(a+t);for(let s=0;s<a;s++)l[s]=this.field.multiply(this.coefficients[s],i);return new Lt(this.field,l)}toString(){let t=new We;for(let i=this.getDegree();i>=0;i--){let a=this.getCoefficient(i);a!==0&&(a<0?(t.append(" - "),a=-a):t.length()>0&&t.append(" + "),(i===0||a!==1)&&t.append(a),i!==0&&(i===1?t.append("x"):(t.append("x^"),t.append(i))))}return t.toString()}}class Fl{add(t,i){return(t+i)%this.modulus}subtract(t,i){return(this.modulus+t-i)%this.modulus}exp(t){return this.expTable[t]}log(t){if(t===0)throw new M;return this.logTable[t]}inverse(t){if(t===0)throw new Ma;return this.expTable[this.modulus-this.logTable[t]-1]}multiply(t,i){return t===0||i===0?0:this.expTable[(this.logTable[t]+this.logTable[i])%(this.modulus-1)]}getSize(){return this.modulus}equals(t){return t===this}}class na extends Fl{constructor(t,i){super(),this.modulus=t,this.expTable=new Int32Array(t),this.logTable=new Int32Array(t);let a=1;for(let l=0;l<t;l++)this.expTable[l]=a,a=a*i%t;for(let l=0;l<t-1;l++)this.logTable[this.expTable[l]]=l;this.zero=new Lt(this,new Int32Array([0])),this.one=new Lt(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,i){if(t<0)throw new M;if(i===0)return this.zero;let a=new Int32Array(t+1);return a[0]=i,new Lt(this,a)}}na.PDF417_GF=new na(Le.NUMBER_OF_CODEWORDS,3);class Bi{constructor(){this.field=na.PDF417_GF}decode(t,i,a){let l=new Lt(this.field,t),s=new Int32Array(i),u=!1;for(let U=i;U>0;U--){let z=l.evaluateAt(this.field.exp(U));s[i-U]=z,z!==0&&(u=!0)}if(!u)return 0;let c=this.field.getOne();if(a!=null)for(const U of a){let z=this.field.exp(t.length-1-U),P=new Lt(this.field,new Int32Array([this.field.subtract(0,z),1]));c=c.multiply(P)}let x=new Lt(this.field,s),p=this.runEuclideanAlgorithm(this.field.buildMonomial(i,1),x,i),w=p[0],v=p[1],I=this.findErrorLocations(w),B=this.findErrorMagnitudes(v,w,I);for(let U=0;U<I.length;U++){let z=t.length-1-this.field.log(I[U]);if(z<0)throw Z.getChecksumInstance();t[z]=this.field.subtract(t[z],B[U])}return I.length}runEuclideanAlgorithm(t,i,a){if(t.getDegree()<i.getDegree()){let I=t;t=i,i=I}let l=t,s=i,u=this.field.getZero(),c=this.field.getOne();for(;s.getDegree()>=Math.round(a/2);){let I=l,B=u;if(l=s,u=c,l.isZero())throw Z.getChecksumInstance();s=I;let U=this.field.getZero(),z=l.getCoefficient(l.getDegree()),P=this.field.inverse(z);for(;s.getDegree()>=l.getDegree()&&!s.isZero();){let W=s.getDegree()-l.getDegree(),me=this.field.multiply(s.getCoefficient(s.getDegree()),P);U=U.add(this.field.buildMonomial(W,me)),s=s.subtract(l.multiplyByMonomial(W,me))}c=U.multiply(u).subtract(B).negative()}let x=c.getCoefficient(0);if(x===0)throw Z.getChecksumInstance();let p=this.field.inverse(x),w=c.multiply(p),v=s.multiply(p);return[w,v]}findErrorLocations(t){let i=t.getDegree(),a=new Int32Array(i),l=0;for(let s=1;s<this.field.getSize()&&l<i;s++)t.evaluateAt(s)===0&&(a[l]=this.field.inverse(s),l++);if(l!==i)throw Z.getChecksumInstance();return a}findErrorMagnitudes(t,i,a){let l=i.getDegree(),s=new Int32Array(l);for(let p=1;p<=l;p++)s[l-p]=this.field.multiply(p,i.getCoefficient(p));let u=new Lt(this.field,s),c=a.length,x=new Int32Array(c);for(let p=0;p<c;p++){let w=this.field.inverse(a[p]),v=this.field.subtract(0,t.evaluateAt(w)),I=this.field.inverse(u.evaluateAt(w));x[p]=this.field.multiply(v,I)}return x}}class Li{constructor(t,i,a,l,s){t instanceof Li?this.constructor_2(t):this.constructor_1(t,i,a,l,s)}constructor_1(t,i,a,l,s){const u=i==null||a==null,c=l==null||s==null;if(u&&c)throw new q;u?(i=new Te(0,l.getY()),a=new Te(0,s.getY())):c&&(l=new Te(t.getWidth()-1,i.getY()),s=new Te(t.getWidth()-1,a.getY())),this.image=t,this.topLeft=i,this.bottomLeft=a,this.topRight=l,this.bottomRight=s,this.minX=Math.trunc(Math.min(i.getX(),a.getX())),this.maxX=Math.trunc(Math.max(l.getX(),s.getX())),this.minY=Math.trunc(Math.min(i.getY(),l.getY())),this.maxY=Math.trunc(Math.max(a.getY(),s.getY()))}constructor_2(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()}static merge(t,i){return t==null?i:i==null?t:new Li(t.image,t.topLeft,t.bottomLeft,i.topRight,i.bottomRight)}addMissingRows(t,i,a){let l=this.topLeft,s=this.bottomLeft,u=this.topRight,c=this.bottomRight;if(t>0){let x=a?this.topLeft:this.topRight,p=Math.trunc(x.getY()-t);p<0&&(p=0);let w=new Te(x.getX(),p);a?l=w:u=w}if(i>0){let x=a?this.bottomLeft:this.bottomRight,p=Math.trunc(x.getY()+i);p>=this.image.getHeight()&&(p=this.image.getHeight()-1);let w=new Te(x.getX(),p);a?s=w:c=w}return new Li(this.image,l,s,u,c)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Zr{constructor(t,i,a,l){this.columnCount=t,this.errorCorrectionLevel=l,this.rowCountUpperPart=i,this.rowCountLowerPart=a,this.rowCount=i+a}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class za{constructor(){this.buffer=""}static form(t,i){let a=-1;function l(u,c,x,p,w,v){if(u==="%%")return"%";if(i[++a]===void 0)return;u=p?parseInt(p.substr(1)):void 0;let I=w?parseInt(w.substr(1)):void 0,B;switch(v){case"s":B=i[a];break;case"c":B=i[a][0];break;case"f":B=parseFloat(i[a]).toFixed(u);break;case"p":B=parseFloat(i[a]).toPrecision(u);break;case"e":B=parseFloat(i[a]).toExponential(u);break;case"x":B=parseInt(i[a]).toString(I||16);break;case"d":B=parseFloat(parseInt(i[a],I||10).toPrecision(u)).toFixed(0);break}B=typeof B=="object"?JSON.stringify(B):(+B).toString(I);let U=parseInt(x),z=x&&x[0]+""=="0"?"0":" ";for(;B.length<U;)B=c!==void 0?B+z:z+B;return B}let s=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(s,l)}format(t,...i){this.buffer+=za.form(t,i)}toString(){return this.buffer}}class Xi{constructor(t){this.boundingBox=new Li(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}getCodewordNearby(t){let i=this.getCodeword(t);if(i!=null)return i;for(let a=1;a<Xi.MAX_NEARBY_DISTANCE;a++){let l=this.imageRowToCodewordIndex(t)-a;if(l>=0&&(i=this.codewords[l],i!=null)||(l=this.imageRowToCodewordIndex(t)+a,l<this.codewords.length&&(i=this.codewords[l],i!=null)))return i}return null}imageRowToCodewordIndex(t){return t-this.boundingBox.getMinY()}setCodeword(t,i){this.codewords[this.imageRowToCodewordIndex(t)]=i}getCodeword(t){return this.codewords[this.imageRowToCodewordIndex(t)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const t=new za;let i=0;for(const a of this.codewords){if(a==null){t.format("%3d: | %n",i++);continue}t.format("%3d: %3d|%3d%n",i++,a.getRowNumber(),a.getValue())}return t.toString()}}Xi.MAX_NEARBY_DISTANCE=5;class Zi{constructor(){this.values=new Map}setValue(t){t=Math.trunc(t);let i=this.values.get(t);i==null&&(i=0),i++,this.values.set(t,i)}getValue(){let t=-1,i=new Array;for(const[a,l]of this.values.entries()){const s={getKey:()=>a,getValue:()=>l};s.getValue()>t?(t=s.getValue(),i=[],i.push(s.getKey())):s.getValue()===t&&i.push(s.getKey())}return Le.toIntArray(i)}getConfidence(t){return this.values.get(t)}}class Hl extends Xi{constructor(t,i){super(t),this._isLeft=i}setRowNumbers(){for(let t of this.getCodewords())t?.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(t){let i=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(i,t);let a=this.getBoundingBox(),l=this._isLeft?a.getTopLeft():a.getTopRight(),s=this._isLeft?a.getBottomLeft():a.getBottomRight(),u=this.imageRowToCodewordIndex(Math.trunc(l.getY())),c=this.imageRowToCodewordIndex(Math.trunc(s.getY())),x=-1,p=1,w=0;for(let v=u;v<c;v++){if(i[v]==null)continue;let I=i[v],B=I.getRowNumber()-x;if(B===0)w++;else if(B===1)p=Math.max(p,w),w=1,x=I.getRowNumber();else if(B<0||I.getRowNumber()>=t.getRowCount()||B>v)i[v]=null;else{let U;p>2?U=(p-2)*B:U=B;let z=U>=v;for(let P=1;P<=U&&!z;P++)z=i[v-P]!=null;z?i[v]=null:(x=I.getRowNumber(),w=1)}}}getRowHeights(){let t=this.getBarcodeMetadata();if(t==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(t);let i=new Int32Array(t.getRowCount());for(let a of this.getCodewords())if(a!=null){let l=a.getRowNumber();if(l>=i.length)continue;i[l]++}return i}adjustIncompleteIndicatorColumnRowNumbers(t){let i=this.getBoundingBox(),a=this._isLeft?i.getTopLeft():i.getTopRight(),l=this._isLeft?i.getBottomLeft():i.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(a.getY())),u=this.imageRowToCodewordIndex(Math.trunc(l.getY())),c=this.getCodewords(),x=-1;for(let p=s;p<u;p++){if(c[p]==null)continue;let w=c[p];w.setRowNumberAsRowIndicatorColumn();let v=w.getRowNumber()-x;v===0||(v===1?x=w.getRowNumber():w.getRowNumber()>=t.getRowCount()?c[p]=null:x=w.getRowNumber())}}getBarcodeMetadata(){let t=this.getCodewords(),i=new Zi,a=new Zi,l=new Zi,s=new Zi;for(let c of t){if(c==null)continue;c.setRowNumberAsRowIndicatorColumn();let x=c.getValue()%30,p=c.getRowNumber();switch(this._isLeft||(p+=2),p%3){case 0:a.setValue(x*3+1);break;case 1:s.setValue(x/3),l.setValue(x%3);break;case 2:i.setValue(x+1);break}}if(i.getValue().length===0||a.getValue().length===0||l.getValue().length===0||s.getValue().length===0||i.getValue()[0]<1||a.getValue()[0]+l.getValue()[0]<Le.MIN_ROWS_IN_BARCODE||a.getValue()[0]+l.getValue()[0]>Le.MAX_ROWS_IN_BARCODE)return null;let u=new Zr(i.getValue()[0],a.getValue()[0],l.getValue()[0],s.getValue()[0]);return this.removeIncorrectCodewords(t,u),u}removeIncorrectCodewords(t,i){for(let a=0;a<t.length;a++){let l=t[a];if(t[a]==null)continue;let s=l.getValue()%30,u=l.getRowNumber();if(u>i.getRowCount()){t[a]=null;continue}switch(this._isLeft||(u+=2),u%3){case 0:s*3+1!==i.getRowCountUpperPart()&&(t[a]=null);break;case 1:(Math.trunc(s/3)!==i.getErrorCorrectionLevel()||s%3!==i.getRowCountLowerPart())&&(t[a]=null);break;case 2:s+1!==i.getColumnCount()&&(t[a]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
|
||
`+super.toString()}}class cn{constructor(t,i){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=i,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let t=Le.MAX_CODEWORDS_IN_BARCODE,i;do i=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t<i);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(t){t?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let t=this.adjustRowNumbersByRow();if(t===0)return 0;for(let i=1;i<this.barcodeColumnCount+1;i++){let a=this.detectionResultColumns[i].getCodewords();for(let l=0;l<a.length;l++)a[l]!=null&&(a[l].hasValidRowNumber()||this.adjustRowNumbers(i,l,a))}return t}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let t=this.detectionResultColumns[0].getCodewords(),i=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let a=0;a<t.length;a++)if(t[a]!=null&&i[a]!=null&&t[a].getRowNumber()===i[a].getRowNumber())for(let l=1;l<=this.barcodeColumnCount;l++){let s=this.detectionResultColumns[l].getCodewords()[a];s!=null&&(s.setRowNumber(t[a].getRowNumber()),s.hasValidRowNumber()||(this.detectionResultColumns[l].getCodewords()[a]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let t=0,i=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let a=0;a<i.length;a++){if(i[a]==null)continue;let l=i[a].getRowNumber(),s=0;for(let u=this.barcodeColumnCount+1;u>0&&s<this.ADJUST_ROW_NUMBER_SKIP;u--){let c=this.detectionResultColumns[u].getCodewords()[a];c!=null&&(s=cn.adjustRowNumberIfValid(l,s,c),c.hasValidRowNumber()||t++)}}return t}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let t=0,i=this.detectionResultColumns[0].getCodewords();for(let a=0;a<i.length;a++){if(i[a]==null)continue;let l=i[a].getRowNumber(),s=0;for(let u=1;u<this.barcodeColumnCount+1&&s<this.ADJUST_ROW_NUMBER_SKIP;u++){let c=this.detectionResultColumns[u].getCodewords()[a];c!=null&&(s=cn.adjustRowNumberIfValid(l,s,c),c.hasValidRowNumber()||t++)}}return t}static adjustRowNumberIfValid(t,i,a){return a==null||a.hasValidRowNumber()||(a.isValidRowNumber(t)?(a.setRowNumber(t),i=0):++i),i}adjustRowNumbers(t,i,a){if(!this.detectionResultColumns[t-1])return;let l=a[i],s=this.detectionResultColumns[t-1].getCodewords(),u=s;this.detectionResultColumns[t+1]!=null&&(u=this.detectionResultColumns[t+1].getCodewords());let c=new Array(14);c[2]=s[i],c[3]=u[i],i>0&&(c[0]=a[i-1],c[4]=s[i-1],c[5]=u[i-1]),i>1&&(c[8]=a[i-2],c[10]=s[i-2],c[11]=u[i-2]),i<a.length-1&&(c[1]=a[i+1],c[6]=s[i+1],c[7]=u[i+1]),i<a.length-2&&(c[9]=a[i+2],c[12]=s[i+2],c[13]=u[i+2]);for(let x of c)if(cn.adjustRowNumber(l,x))return}static adjustRowNumber(t,i){return i==null?!1:i.hasValidRowNumber()&&i.getBucket()===t.getBucket()?(t.setRowNumber(i.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(t){this.boundingBox=t}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(t,i){this.detectionResultColumns[t]=i}getDetectionResultColumn(t){return this.detectionResultColumns[t]}toString(){let t=this.detectionResultColumns[0];t==null&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);let i=new za;for(let a=0;a<t.getCodewords().length;a++){i.format("CW %3d:",a);for(let l=0;l<this.barcodeColumnCount+2;l++){if(this.detectionResultColumns[l]==null){i.format(" | ");continue}let s=this.detectionResultColumns[l].getCodewords()[a];if(s==null){i.format(" | ");continue}i.format(" %3d|%3d",s.getRowNumber(),s.getValue())}i.format("%n")}return i.toString()}}class ni{constructor(t,i,a,l){this.rowNumber=ni.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(i),this.bucket=Math.trunc(a),this.value=Math.trunc(l)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(t){return t!==ni.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(t){this.rowNumber=t}toString(){return this.rowNumber+"|"+this.value}}ni.BARCODE_ROW_UNKNOWN=-1;class pn{static initialize(){for(let t=0;t<Le.SYMBOL_TABLE.length;t++){let i=Le.SYMBOL_TABLE[t],a=i&1;for(let l=0;l<Le.BARS_IN_MODULE;l++){let s=0;for(;(i&1)===a;)s+=1,i>>=1;a=i&1,pn.RATIOS_TABLE[t]||(pn.RATIOS_TABLE[t]=new Array(Le.BARS_IN_MODULE)),pn.RATIOS_TABLE[t][Le.BARS_IN_MODULE-l-1]=Math.fround(s/Le.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(t){let i=pn.getDecodedCodewordValue(pn.sampleBitCounts(t));return i!==-1?i:pn.getClosestDecodedValue(t)}static sampleBitCounts(t){let i=$e.sum(t),a=new Int32Array(Le.BARS_IN_MODULE),l=0,s=0;for(let u=0;u<Le.MODULES_IN_CODEWORD;u++){let c=i/(2*Le.MODULES_IN_CODEWORD)+u*i/Le.MODULES_IN_CODEWORD;s+t[l]<=c&&(s+=t[l],l++),a[l]++}return a}static getDecodedCodewordValue(t){let i=pn.getBitValue(t);return Le.getCodeword(i)===-1?-1:i}static getBitValue(t){let i=0;for(let a=0;a<t.length;a++)for(let l=0;l<t[a];l++)i=i<<1|(a%2===0?1:0);return Math.trunc(i)}static getClosestDecodedValue(t){let i=$e.sum(t),a=new Array(Le.BARS_IN_MODULE);if(i>1)for(let u=0;u<a.length;u++)a[u]=Math.fround(t[u]/i);let l=Ia.MAX_VALUE,s=-1;this.bSymbolTableReady||pn.initialize();for(let u=0;u<pn.RATIOS_TABLE.length;u++){let c=0,x=pn.RATIOS_TABLE[u];for(let p=0;p<Le.BARS_IN_MODULE;p++){let w=Math.fround(x[p]-a[p]);if(c+=Math.fround(w*w),c>=l)break}c<l&&(l=c,s=Le.SYMBOL_TABLE[u])}return s}}pn.bSymbolTableReady=!1,pn.RATIOS_TABLE=new Array(Le.SYMBOL_TABLE.length).map(T=>new Array(Le.BARS_IN_MODULE));class ka{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(t){this.segmentIndex=t}getFileId(){return this.fileId}setFileId(t){this.fileId=t}getOptionalData(){return this.optionalData}setOptionalData(t){this.optionalData=t}isLastSegment(){return this.lastSegment}setLastSegment(t){this.lastSegment=t}getSegmentCount(){return this.segmentCount}setSegmentCount(t){this.segmentCount=t}getSender(){return this.sender||null}setSender(t){this.sender=t}getAddressee(){return this.addressee||null}setAddressee(t){this.addressee=t}getFileName(){return this.fileName}setFileName(t){this.fileName=t}getFileSize(){return this.fileSize}setFileSize(t){this.fileSize=t}getChecksum(){return this.checksum}setChecksum(t){this.checksum=t}getTimestamp(){return this.timestamp}setTimestamp(t){this.timestamp=t}}class Hs{static parseLong(t,i=void 0){return parseInt(t,i)}}class Qr extends A{}Qr.kind="NullPointerException";class jl{writeBytes(t){this.writeBytesOffset(t,0,t.length)}writeBytesOffset(t,i,a){if(t==null)throw new Qr;if(i<0||i>t.length||a<0||i+a>t.length||i+a<0)throw new ae;if(a===0)return;for(let l=0;l<a;l++)this.write(t[i+l])}flush(){}close(){}}class Ar extends A{}class qr extends jl{constructor(t=32){if(super(),this.count=0,t<0)throw new M("Negative initial size: "+t);this.buf=new Uint8Array(t)}ensureCapacity(t){t-this.buf.length>0&&this.grow(t)}grow(t){let a=this.buf.length<<1;if(a-t<0&&(a=t),a<0){if(t<0)throw new Ar;a=ne.MAX_VALUE}this.buf=de.copyOfUint8Array(this.buf,a)}write(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1}writeBytesOffset(t,i,a){if(i<0||i>t.length||a<0||i+a-t.length>0)throw new ae;this.ensureCapacity(this.count+a),ie.arraycopy(t,i,this.buf,this.count,a),this.count+=a}writeTo(t){t.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return de.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(t){return t?typeof t=="string"?this.toString_string(t):this.toString_number(t):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(t){return new String(this.buf).toString()}toString_number(t){return new String(this.buf).toString()}close(){}}var At;(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"})(At||(At={}));function js(){if(typeof window<"u")return window.BigInt||null;if(typeof $o<"u")return $o.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let Wr;function Qi(T){if(typeof Wr>"u"&&(Wr=js()),Wr===null)throw new Error("BigInt is not supported!");return Wr(T)}function Pl(){let T=[];T[0]=Qi(1);let t=Qi(900);T[1]=t;for(let i=2;i<16;i++)T[i]=T[i-1]*t;return T}class K{static decode(t,i){let a=new We(""),l=fe.ISO8859_1;a.enableDecoding(l);let s=1,u=t[s++],c=new ka;for(;s<t[0];){switch(u){case K.TEXT_COMPACTION_MODE_LATCH:s=K.textCompaction(t,s,a);break;case K.BYTE_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH_6:s=K.byteCompaction(u,t,l,s,a);break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:a.append(t[s++]);break;case K.NUMERIC_COMPACTION_MODE_LATCH:s=K.numericCompaction(t,s,a);break;case K.ECI_CHARSET:fe.getCharacterSetECIByValue(t[s++]);break;case K.ECI_GENERAL_PURPOSE:s+=2;break;case K.ECI_USER_DEFINED:s++;break;case K.BEGIN_MACRO_PDF417_CONTROL_BLOCK:s=K.decodeMacroBlock(t,s,c);break;case K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case K.MACRO_PDF417_TERMINATOR:throw new le;default:s--,s=K.textCompaction(t,s,a);break}if(s<t.length)u=t[s++];else throw le.getFormatInstance()}if(a.length()===0)throw le.getFormatInstance();let x=new Dt(null,a.toString(),null,i);return x.setOther(c),x}static decodeMacroBlock(t,i,a){if(i+K.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw le.getFormatInstance();let l=new Int32Array(K.NUMBER_OF_SEQUENCE_CODEWORDS);for(let c=0;c<K.NUMBER_OF_SEQUENCE_CODEWORDS;c++,i++)l[c]=t[i];a.setSegmentIndex(ne.parseInt(K.decodeBase900toBase10(l,K.NUMBER_OF_SEQUENCE_CODEWORDS)));let s=new We;i=K.textCompaction(t,i,s),a.setFileId(s.toString());let u=-1;for(t[i]===K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(u=i+1);i<t[0];)switch(t[i]){case K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(i++,t[i]){case K.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let c=new We;i=K.textCompaction(t,i+1,c),a.setFileName(c.toString());break;case K.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let x=new We;i=K.textCompaction(t,i+1,x),a.setSender(x.toString());break;case K.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let p=new We;i=K.textCompaction(t,i+1,p),a.setAddressee(p.toString());break;case K.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let w=new We;i=K.numericCompaction(t,i+1,w),a.setSegmentCount(ne.parseInt(w.toString()));break;case K.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let v=new We;i=K.numericCompaction(t,i+1,v),a.setTimestamp(Hs.parseLong(v.toString()));break;case K.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let I=new We;i=K.numericCompaction(t,i+1,I),a.setChecksum(ne.parseInt(I.toString()));break;case K.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let B=new We;i=K.numericCompaction(t,i+1,B),a.setFileSize(Hs.parseLong(B.toString()));break;default:throw le.getFormatInstance()}break;case K.MACRO_PDF417_TERMINATOR:i++,a.setLastSegment(!0);break;default:throw le.getFormatInstance()}if(u!==-1){let c=i-u;a.isLastSegment()&&c--,a.setOptionalData(de.copyOfRange(t,u,u+c))}return i}static textCompaction(t,i,a){let l=new Int32Array((t[0]-i)*2),s=new Int32Array((t[0]-i)*2),u=0,c=!1;for(;i<t[0]&&!c;){let x=t[i++];if(x<K.TEXT_COMPACTION_MODE_LATCH)l[u]=x/30,l[u+1]=x%30,u+=2;else switch(x){case K.TEXT_COMPACTION_MODE_LATCH:l[u++]=K.TEXT_COMPACTION_MODE_LATCH;break;case K.BYTE_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH_6:case K.NUMERIC_COMPACTION_MODE_LATCH:case K.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case K.MACRO_PDF417_TERMINATOR:i--,c=!0;break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l[u]=K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,x=t[i++],s[u]=x,u++;break}}return K.decodeTextCompaction(l,s,u,a),i}static decodeTextCompaction(t,i,a,l){let s=At.ALPHA,u=At.ALPHA,c=0;for(;c<a;){let x=t[c],p="";switch(s){case At.ALPHA:if(x<26)p=String.fromCharCode(65+x);else switch(x){case 26:p=" ";break;case K.LL:s=At.LOWER;break;case K.ML:s=At.MIXED;break;case K.PS:u=s,s=At.PUNCT_SHIFT;break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(i[c]);break;case K.TEXT_COMPACTION_MODE_LATCH:s=At.ALPHA;break}break;case At.LOWER:if(x<26)p=String.fromCharCode(97+x);else switch(x){case 26:p=" ";break;case K.AS:u=s,s=At.ALPHA_SHIFT;break;case K.ML:s=At.MIXED;break;case K.PS:u=s,s=At.PUNCT_SHIFT;break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(i[c]);break;case K.TEXT_COMPACTION_MODE_LATCH:s=At.ALPHA;break}break;case At.MIXED:if(x<K.PL)p=K.MIXED_CHARS[x];else switch(x){case K.PL:s=At.PUNCT;break;case 26:p=" ";break;case K.LL:s=At.LOWER;break;case K.AL:s=At.ALPHA;break;case K.PS:u=s,s=At.PUNCT_SHIFT;break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(i[c]);break;case K.TEXT_COMPACTION_MODE_LATCH:s=At.ALPHA;break}break;case At.PUNCT:if(x<K.PAL)p=K.PUNCT_CHARS[x];else switch(x){case K.PAL:s=At.ALPHA;break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(i[c]);break;case K.TEXT_COMPACTION_MODE_LATCH:s=At.ALPHA;break}break;case At.ALPHA_SHIFT:if(s=u,x<26)p=String.fromCharCode(65+x);else switch(x){case 26:p=" ";break;case K.TEXT_COMPACTION_MODE_LATCH:s=At.ALPHA;break}break;case At.PUNCT_SHIFT:if(s=u,x<K.PAL)p=K.PUNCT_CHARS[x];else switch(x){case K.PAL:s=At.ALPHA;break;case K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(i[c]);break;case K.TEXT_COMPACTION_MODE_LATCH:s=At.ALPHA;break}break}p!==""&&l.append(p),c++}}static byteCompaction(t,i,a,l,s){let u=new qr,c=0,x=0,p=!1;switch(t){case K.BYTE_COMPACTION_MODE_LATCH:let w=new Int32Array(6),v=i[l++];for(;l<i[0]&&!p;)switch(w[c++]=v,x=900*x+v,v=i[l++],v){case K.TEXT_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH:case K.NUMERIC_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH_6:case K.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case K.MACRO_PDF417_TERMINATOR:l--,p=!0;break;default:if(c%5===0&&c>0){for(let I=0;I<6;++I)u.write(Number(Qi(x)>>Qi(8*(5-I))));x=0,c=0}break}l===i[0]&&v<K.TEXT_COMPACTION_MODE_LATCH&&(w[c++]=v);for(let I=0;I<c;I++)u.write(w[I]);break;case K.BYTE_COMPACTION_MODE_LATCH_6:for(;l<i[0]&&!p;){let I=i[l++];if(I<K.TEXT_COMPACTION_MODE_LATCH)c++,x=900*x+I;else switch(I){case K.TEXT_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH:case K.NUMERIC_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH_6:case K.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case K.MACRO_PDF417_TERMINATOR:l--,p=!0;break}if(c%5===0&&c>0){for(let B=0;B<6;++B)u.write(Number(Qi(x)>>Qi(8*(5-B))));x=0,c=0}}break}return s.append(Ze.decode(u.toByteArray(),a)),l}static numericCompaction(t,i,a){let l=0,s=!1,u=new Int32Array(K.MAX_NUMERIC_CODEWORDS);for(;i<t[0]&&!s;){let c=t[i++];if(i===t[0]&&(s=!0),c<K.TEXT_COMPACTION_MODE_LATCH)u[l]=c,l++;else switch(c){case K.TEXT_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH:case K.BYTE_COMPACTION_MODE_LATCH_6:case K.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case K.MACRO_PDF417_TERMINATOR:i--,s=!0;break}(l%K.MAX_NUMERIC_CODEWORDS===0||c===K.NUMERIC_COMPACTION_MODE_LATCH||s)&&l>0&&(a.append(K.decodeBase900toBase10(u,l)),l=0)}return i}static decodeBase900toBase10(t,i){let a=Qi(0);for(let s=0;s<i;s++)a+=K.EXP900[i-s-1]*Qi(t[s]);let l=a.toString();if(l.charAt(0)!=="1")throw new le;return l.substring(1)}}K.TEXT_COMPACTION_MODE_LATCH=900,K.BYTE_COMPACTION_MODE_LATCH=901,K.NUMERIC_COMPACTION_MODE_LATCH=902,K.BYTE_COMPACTION_MODE_LATCH_6=924,K.ECI_USER_DEFINED=925,K.ECI_GENERAL_PURPOSE=926,K.ECI_CHARSET=927,K.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,K.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,K.MACRO_PDF417_TERMINATOR=922,K.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,K.MAX_NUMERIC_CODEWORDS=15,K.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,K.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,K.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,K.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,K.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,K.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,K.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,K.PL=25,K.LL=27,K.AS=27,K.ML=28,K.AL=28,K.PS=29,K.PAL=29,K.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
|
||
-.$/"|*()?{}'`,K.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",K.EXP900=js()?Pl():[],K.NUMBER_OF_SEQUENCE_CODEWORDS=2;class Ve{constructor(){}static decode(t,i,a,l,s,u,c){let x=new Li(t,i,a,l,s),p=null,w=null,v;for(let U=!0;;U=!1){if(i!=null&&(p=Ve.getRowIndicatorColumn(t,x,i,!0,u,c)),l!=null&&(w=Ve.getRowIndicatorColumn(t,x,l,!1,u,c)),v=Ve.merge(p,w),v==null)throw q.getNotFoundInstance();let z=v.getBoundingBox();if(U&&z!=null&&(z.getMinY()<x.getMinY()||z.getMaxY()>x.getMaxY()))x=z;else break}v.setBoundingBox(x);let I=v.getBarcodeColumnCount()+1;v.setDetectionResultColumn(0,p),v.setDetectionResultColumn(I,w);let B=p!=null;for(let U=1;U<=I;U++){let z=B?U:I-U;if(v.getDetectionResultColumn(z)!==void 0)continue;let P;z===0||z===I?P=new Hl(x,z===0):P=new Xi(x),v.setDetectionResultColumn(z,P);let W=-1,me=W;for(let xe=x.getMinY();xe<=x.getMaxY();xe++){if(W=Ve.getStartColumn(v,z,xe,B),W<0||W>x.getMaxX()){if(me===-1)continue;W=me}let ge=Ve.detectCodeword(t,x.getMinX(),x.getMaxX(),B,W,xe,u,c);ge!=null&&(P.setCodeword(xe,ge),me=W,u=Math.min(u,ge.getWidth()),c=Math.max(c,ge.getWidth()))}}return Ve.createDecoderResult(v)}static merge(t,i){if(t==null&&i==null)return null;let a=Ve.getBarcodeMetadata(t,i);if(a==null)return null;let l=Li.merge(Ve.adjustBoundingBox(t),Ve.adjustBoundingBox(i));return new cn(a,l)}static adjustBoundingBox(t){if(t==null)return null;let i=t.getRowHeights();if(i==null)return null;let a=Ve.getMax(i),l=0;for(let c of i)if(l+=a-c,c>0)break;let s=t.getCodewords();for(let c=0;l>0&&s[c]==null;c++)l--;let u=0;for(let c=i.length-1;c>=0&&(u+=a-i[c],!(i[c]>0));c--);for(let c=s.length-1;u>0&&s[c]==null;c--)u--;return t.getBoundingBox().addMissingRows(l,u,t.isLeft())}static getMax(t){let i=-1;for(let a of t)i=Math.max(i,a);return i}static getBarcodeMetadata(t,i){let a;if(t==null||(a=t.getBarcodeMetadata())==null)return i==null?null:i.getBarcodeMetadata();let l;return i==null||(l=i.getBarcodeMetadata())==null?a:a.getColumnCount()!==l.getColumnCount()&&a.getErrorCorrectionLevel()!==l.getErrorCorrectionLevel()&&a.getRowCount()!==l.getRowCount()?null:a}static getRowIndicatorColumn(t,i,a,l,s,u){let c=new Hl(i,l);for(let x=0;x<2;x++){let p=x===0?1:-1,w=Math.trunc(Math.trunc(a.getX()));for(let v=Math.trunc(Math.trunc(a.getY()));v<=i.getMaxY()&&v>=i.getMinY();v+=p){let I=Ve.detectCodeword(t,0,t.getWidth(),l,w,v,s,u);I!=null&&(c.setCodeword(v,I),l?w=I.getStartX():w=I.getEndX())}}return c}static adjustCodewordCount(t,i){let a=i[0][1],l=a.getValue(),s=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-Ve.getNumberOfECCodeWords(t.getBarcodeECLevel());if(l.length===0){if(s<1||s>Le.MAX_CODEWORDS_IN_BARCODE)throw q.getNotFoundInstance();a.setValue(s)}else l[0]!==s&&a.setValue(s)}static createDecoderResult(t){let i=Ve.createBarcodeMatrix(t);Ve.adjustCodewordCount(t,i);let a=new Array,l=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),s=[],u=new Array;for(let x=0;x<t.getBarcodeRowCount();x++)for(let p=0;p<t.getBarcodeColumnCount();p++){let w=i[x][p+1].getValue(),v=x*t.getBarcodeColumnCount()+p;w.length===0?a.push(v):w.length===1?l[v]=w[0]:(u.push(v),s.push(w))}let c=new Array(s.length);for(let x=0;x<c.length;x++)c[x]=s[x];return Ve.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),l,Le.toIntArray(a),Le.toIntArray(u),c)}static createDecoderResultFromAmbiguousValues(t,i,a,l,s){let u=new Int32Array(l.length),c=100;for(;c-- >0;){for(let x=0;x<u.length;x++)i[l[x]]=s[x][u[x]];try{return Ve.decodeCodewords(i,t,a)}catch(x){if(!(x instanceof Z))throw x}if(u.length===0)throw Z.getChecksumInstance();for(let x=0;x<u.length;x++)if(u[x]<s[x].length-1){u[x]++;break}else if(u[x]=0,x===u.length-1)throw Z.getChecksumInstance()}throw Z.getChecksumInstance()}static createBarcodeMatrix(t){let i=Array.from({length:t.getBarcodeRowCount()},()=>new Array(t.getBarcodeColumnCount()+2));for(let l=0;l<i.length;l++)for(let s=0;s<i[l].length;s++)i[l][s]=new Zi;let a=0;for(let l of t.getDetectionResultColumns()){if(l!=null){for(let s of l.getCodewords())if(s!=null){let u=s.getRowNumber();if(u>=0){if(u>=i.length)continue;i[u][a].setValue(s.getValue())}}}a++}return i}static isValidBarcodeColumn(t,i){return i>=0&&i<=t.getBarcodeColumnCount()+1}static getStartColumn(t,i,a,l){let s=l?1:-1,u=null;if(Ve.isValidBarcodeColumn(t,i-s)&&(u=t.getDetectionResultColumn(i-s).getCodeword(a)),u!=null)return l?u.getEndX():u.getStartX();if(u=t.getDetectionResultColumn(i).getCodewordNearby(a),u!=null)return l?u.getStartX():u.getEndX();if(Ve.isValidBarcodeColumn(t,i-s)&&(u=t.getDetectionResultColumn(i-s).getCodewordNearby(a)),u!=null)return l?u.getEndX():u.getStartX();let c=0;for(;Ve.isValidBarcodeColumn(t,i-s);){i-=s;for(let x of t.getDetectionResultColumn(i).getCodewords())if(x!=null)return(l?x.getEndX():x.getStartX())+s*c*(x.getEndX()-x.getStartX());c++}return l?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()}static detectCodeword(t,i,a,l,s,u,c,x){s=Ve.adjustCodewordStartColumn(t,i,a,l,s,u);let p=Ve.getModuleBitCount(t,i,a,l,s,u);if(p==null)return null;let w,v=$e.sum(p);if(l)w=s+v;else{for(let U=0;U<p.length/2;U++){let z=p[U];p[U]=p[p.length-1-U],p[p.length-1-U]=z}w=s,s=w-v}if(!Ve.checkCodewordSkew(v,c,x))return null;let I=pn.getDecodedValue(p),B=Le.getCodeword(I);return B===-1?null:new ni(s,w,Ve.getCodewordBucketNumber(I),B)}static getModuleBitCount(t,i,a,l,s,u){let c=s,x=new Int32Array(8),p=0,w=l?1:-1,v=l;for(;(l?c<a:c>=i)&&p<x.length;)t.get(c,u)===v?(x[p]++,c+=w):(p++,v=!v);return p===x.length||c===(l?a:i)&&p===x.length-1?x:null}static getNumberOfECCodeWords(t){return 2<<t}static adjustCodewordStartColumn(t,i,a,l,s,u){let c=s,x=l?-1:1;for(let p=0;p<2;p++){for(;(l?c>=i:c<a)&&l===t.get(c,u);){if(Math.abs(s-c)>Ve.CODEWORD_SKEW_SIZE)return s;c+=x}x=-x,l=!l}return c}static checkCodewordSkew(t,i,a){return i-Ve.CODEWORD_SKEW_SIZE<=t&&t<=a+Ve.CODEWORD_SKEW_SIZE}static decodeCodewords(t,i,a){if(t.length===0)throw le.getFormatInstance();let l=1<<i+1,s=Ve.correctErrors(t,a,l);Ve.verifyCodewordCount(t,l);let u=K.decode(t,""+i);return u.setErrorsCorrected(s),u.setErasures(a.length),u}static correctErrors(t,i,a){if(i!=null&&i.length>a/2+Ve.MAX_ERRORS||a<0||a>Ve.MAX_EC_CODEWORDS)throw Z.getChecksumInstance();return Ve.errorCorrection.decode(t,a,i)}static verifyCodewordCount(t,i){if(t.length<4)throw le.getFormatInstance();let a=t[0];if(a>t.length)throw le.getFormatInstance();if(a===0)if(i<t.length)t[0]=t.length-i;else throw le.getFormatInstance()}static getBitCountForCodeword(t){let i=new Int32Array(8),a=0,l=i.length-1;for(;!((t&1)!==a&&(a=t&1,l--,l<0));)i[l]++,t>>=1;return i}static getCodewordBucketNumber(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)}static getCodewordBucketNumber_number(t){return Ve.getCodewordBucketNumber(Ve.getBitCountForCodeword(t))}static getCodewordBucketNumber_Int32Array(t){return(t[0]-t[2]+t[4]-t[6]+9)%9}static toString(t){let i=new za;for(let a=0;a<t.length;a++){i.format("Row %2d: ",a);for(let l=0;l<t[a].length;l++){let s=t[a][l];s.getValue().length===0?i.format(" ",null):i.format("%4d(%2d)",s.getValue()[0],s.getConfidence(s.getValue()[0]))}i.format("%n")}return i.toString()}}Ve.CODEWORD_SKEW_SIZE=2,Ve.MAX_ERRORS=3,Ve.MAX_EC_CODEWORDS=512,Ve.errorCorrection=new Bi;class An{decode(t,i=null){let a=An.decode(t,i,!1);if(a==null||a.length===0||a[0]==null)throw q.getNotFoundInstance();return a[0]}decodeMultiple(t,i=null){try{return An.decode(t,i,!0)}catch(a){throw a instanceof le||a instanceof Z?q.getNotFoundInstance():a}}static decode(t,i,a){const l=new Array,s=Fe.detectMultiple(t,i,a);for(const u of s.getPoints()){const c=Ve.decode(s.getBits(),u[4],u[5],u[6],u[7],An.getMinCodewordWidth(u),An.getMaxCodewordWidth(u)),x=new Ce(c.getText(),c.getRawBytes(),void 0,u,Ae.PDF_417);x.putMetadata(ft.ERROR_CORRECTION_LEVEL,c.getECLevel());const p=c.getOther();p!=null&&x.putMetadata(ft.PDF417_EXTRA_METADATA,p),l.push(x)}return l.map(u=>u)}static getMaxWidth(t,i){return t==null||i==null?0:Math.trunc(Math.abs(t.getX()-i.getX()))}static getMinWidth(t,i){return t==null||i==null?ne.MAX_VALUE:Math.trunc(Math.abs(t.getX()-i.getX()))}static getMaxCodewordWidth(t){return Math.floor(Math.max(Math.max(An.getMaxWidth(t[0],t[4]),An.getMaxWidth(t[6],t[2])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN),Math.max(An.getMaxWidth(t[1],t[5]),An.getMaxWidth(t[7],t[3])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(t){return Math.floor(Math.min(Math.min(An.getMinWidth(t[0],t[4]),An.getMinWidth(t[6],t[2])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN),Math.min(An.getMinWidth(t[1],t[5]),An.getMinWidth(t[7],t[3])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN)))}reset(){}}class Kr extends A{}Kr.kind="ReaderException";class Ps{constructor(t,i){this.verbose=t===!0,i&&this.setHints(i)}decode(t,i){return i&&this.setHints(i),this.decodeInternal(t)}decodeWithState(t){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(t)}setHints(t){this.hints=t;const i=!y(t)&&t.get(Be.TRY_HARDER)===!0,a=y(t)?null:t.get(Be.POSSIBLE_FORMATS),l=new Array;if(!y(a)){const s=a.some(u=>u===Ae.UPC_A||u===Ae.UPC_E||u===Ae.EAN_13||u===Ae.EAN_8||u===Ae.CODABAR||u===Ae.CODE_39||u===Ae.CODE_93||u===Ae.CODE_128||u===Ae.ITF||u===Ae.RSS_14||u===Ae.RSS_EXPANDED);s&&!i&&l.push(new ei(t,this.verbose)),a.includes(Ae.QR_CODE)&&l.push(new Di),a.includes(Ae.DATA_MATRIX)&&l.push(new Ri),a.includes(Ae.AZTEC)&&l.push(new Yr),a.includes(Ae.PDF_417)&&l.push(new An),s&&i&&l.push(new ei(t,this.verbose))}l.length===0&&(i||l.push(new ei(t,this.verbose)),l.push(new Di),l.push(new Ri),l.push(new Yr),l.push(new An),i&&l.push(new ei(t,this.verbose))),this.readers=l}reset(){if(this.readers!==null)for(const t of this.readers)t.reset()}decodeInternal(t){if(this.readers===null)throw new Kr("No readers where selected, nothing can be read.");for(const i of this.readers)try{return i.decode(t,this.hints)}catch(a){if(a instanceof Kr)continue}throw new q("No MultiFormat Readers were able to detect the code.")}}class Ys extends Ee{constructor(t=null,i=500){const a=new Ps;a.setHints(t),super(a,i)}decodeBitmap(t){return this.reader.decodeWithState(t)}}class gu extends Ee{constructor(t=500){super(new An,t)}}class xu extends Ee{constructor(t=500){super(new Di,t)}}var Yl;(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"})(Yl||(Yl={}));var ln=Yl;class Er{constructor(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new xn(t,Int32Array.from([1])))}buildGenerator(t){const i=this.cachedGenerators;if(t>=i.length){let a=i[i.length-1];const l=this.field;for(let s=i.length;s<=t;s++){const u=a.multiply(new xn(l,Int32Array.from([1,l.exp(s-1+l.getGeneratorBase())])));i.push(u),a=u}}return i[t]}encode(t,i){if(i===0)throw new M("No error correction bytes");const a=t.length-i;if(a<=0)throw new M("No data bytes provided");const l=this.buildGenerator(i),s=new Int32Array(a);ie.arraycopy(t,0,s,0,a);let u=new xn(this.field,s);u=u.multiplyByMonomial(i,1);const x=u.divide(l)[1].getCoefficients(),p=i-x.length;for(let w=0;w<p;w++)t[a+w]=0;ie.arraycopy(x,0,t,a+p,x.length)}}class Xt{constructor(){}static applyMaskPenaltyRule1(t){return Xt.applyMaskPenaltyRule1Internal(t,!0)+Xt.applyMaskPenaltyRule1Internal(t,!1)}static applyMaskPenaltyRule2(t){let i=0;const a=t.getArray(),l=t.getWidth(),s=t.getHeight();for(let u=0;u<s-1;u++){const c=a[u];for(let x=0;x<l-1;x++){const p=c[x];p===c[x+1]&&p===a[u+1][x]&&p===a[u+1][x+1]&&i++}}return Xt.N2*i}static applyMaskPenaltyRule3(t){let i=0;const a=t.getArray(),l=t.getWidth(),s=t.getHeight();for(let u=0;u<s;u++)for(let c=0;c<l;c++){const x=a[u];c+6<l&&x[c]===1&&x[c+1]===0&&x[c+2]===1&&x[c+3]===1&&x[c+4]===1&&x[c+5]===0&&x[c+6]===1&&(Xt.isWhiteHorizontal(x,c-4,c)||Xt.isWhiteHorizontal(x,c+7,c+11))&&i++,u+6<s&&a[u][c]===1&&a[u+1][c]===0&&a[u+2][c]===1&&a[u+3][c]===1&&a[u+4][c]===1&&a[u+5][c]===0&&a[u+6][c]===1&&(Xt.isWhiteVertical(a,c,u-4,u)||Xt.isWhiteVertical(a,c,u+7,u+11))&&i++}return i*Xt.N3}static isWhiteHorizontal(t,i,a){i=Math.max(i,0),a=Math.min(a,t.length);for(let l=i;l<a;l++)if(t[l]===1)return!1;return!0}static isWhiteVertical(t,i,a,l){a=Math.max(a,0),l=Math.min(l,t.length);for(let s=a;s<l;s++)if(t[s][i]===1)return!1;return!0}static applyMaskPenaltyRule4(t){let i=0;const a=t.getArray(),l=t.getWidth(),s=t.getHeight();for(let x=0;x<s;x++){const p=a[x];for(let w=0;w<l;w++)p[w]===1&&i++}const u=t.getHeight()*t.getWidth();return Math.floor(Math.abs(i*2-u)*10/u)*Xt.N4}static getDataMaskBit(t,i,a){let l,s;switch(t){case 0:l=a+i&1;break;case 1:l=a&1;break;case 2:l=i%3;break;case 3:l=(a+i)%3;break;case 4:l=Math.floor(a/2)+Math.floor(i/3)&1;break;case 5:s=a*i,l=(s&1)+s%3;break;case 6:s=a*i,l=(s&1)+s%3&1;break;case 7:s=a*i,l=s%3+(a+i&1)&1;break;default:throw new M("Invalid mask pattern: "+t)}return l===0}static applyMaskPenaltyRule1Internal(t,i){let a=0;const l=i?t.getHeight():t.getWidth(),s=i?t.getWidth():t.getHeight(),u=t.getArray();for(let c=0;c<l;c++){let x=0,p=-1;for(let w=0;w<s;w++){const v=i?u[c][w]:u[w][c];v===p?x++:(x>=5&&(a+=Xt.N1+(x-5)),x=1,p=v)}x>=5&&(a+=Xt.N1+(x-5))}return a}}Xt.N1=3,Xt.N2=3,Xt.N3=40,Xt.N4=10;class Jr{constructor(t,i){this.width=t,this.height=i;const a=new Array(i);for(let l=0;l!==i;l++)a[l]=new Uint8Array(t);this.bytes=a}getHeight(){return this.height}getWidth(){return this.width}get(t,i){return this.bytes[i][t]}getArray(){return this.bytes}setNumber(t,i,a){this.bytes[i][t]=a}setBoolean(t,i,a){this.bytes[i][t]=a?1:0}clear(t){for(const i of this.bytes)de.fill(i,t)}equals(t){if(!(t instanceof Jr))return!1;const i=t;if(this.width!==i.width||this.height!==i.height)return!1;for(let a=0,l=this.height;a<l;++a){const s=this.bytes[a],u=i.bytes[a];for(let c=0,x=this.width;c<x;++c)if(s[c]!==u[c])return!1}return!0}toString(){const t=new We;for(let i=0,a=this.height;i<a;++i){const l=this.bytes[i];for(let s=0,u=this.width;s<u;++s)switch(l[s]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ");break}t.append(`
|
||
`)}return t.toString()}}class ia{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const t=new We;return t.append(`<<
|
||
`),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(`
|
||
ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(`
|
||
version: `),t.append(this.version?this.version.toString():"null"),t.append(`
|
||
maskPattern: `),t.append(this.maskPattern.toString()),this.matrix?(t.append(`
|
||
matrix:
|
||
`),t.append(this.matrix.toString())):t.append(`
|
||
matrix: null
|
||
`),t.append(`>>
|
||
`),t.toString()}setMode(t){this.mode=t}setECLevel(t){this.ecLevel=t}setVersion(t){this.version=t}setMaskPattern(t){this.maskPattern=t}setMatrix(t){this.matrix=t}static isValidMaskPattern(t){return t>=0&&t<ia.NUM_MASK_PATTERNS}}ia.NUM_MASK_PATTERNS=8;class wt extends A{}wt.kind="WriterException";class Ue{constructor(){}static clearMatrix(t){t.clear(255)}static buildMatrix(t,i,a,l,s){Ue.clearMatrix(s),Ue.embedBasicPatterns(a,s),Ue.embedTypeInfo(i,l,s),Ue.maybeEmbedVersionInfo(a,s),Ue.embedDataBits(t,l,s)}static embedBasicPatterns(t,i){Ue.embedPositionDetectionPatternsAndSeparators(i),Ue.embedDarkDotAtLeftBottomCorner(i),Ue.maybeEmbedPositionAdjustmentPatterns(t,i),Ue.embedTimingPatterns(i)}static embedTypeInfo(t,i,a){const l=new we;Ue.makeTypeInfoBits(t,i,l);for(let s=0,u=l.getSize();s<u;++s){const c=l.get(l.getSize()-1-s),x=Ue.TYPE_INFO_COORDINATES[s],p=x[0],w=x[1];if(a.setBoolean(p,w,c),s<8){const v=a.getWidth()-s-1;a.setBoolean(v,8,c)}else{const I=a.getHeight()-7+(s-8);a.setBoolean(8,I,c)}}}static maybeEmbedVersionInfo(t,i){if(t.getVersionNumber()<7)return;const a=new we;Ue.makeVersionInfoBits(t,a);let l=17;for(let s=0;s<6;++s)for(let u=0;u<3;++u){const c=a.get(l);l--,i.setBoolean(s,i.getHeight()-11+u,c),i.setBoolean(i.getHeight()-11+u,s,c)}}static embedDataBits(t,i,a){let l=0,s=-1,u=a.getWidth()-1,c=a.getHeight()-1;for(;u>0;){for(u===6&&(u-=1);c>=0&&c<a.getHeight();){for(let x=0;x<2;++x){const p=u-x;if(!Ue.isEmpty(a.get(p,c)))continue;let w;l<t.getSize()?(w=t.get(l),++l):w=!1,i!==255&&Xt.getDataMaskBit(i,p,c)&&(w=!w),a.setBoolean(p,c,w)}c+=s}s=-s,c+=s,u-=2}if(l!==t.getSize())throw new wt("Not all bits consumed: "+l+"/"+t.getSize())}static findMSBSet(t){return 32-ne.numberOfLeadingZeros(t)}static calculateBCHCode(t,i){if(i===0)throw new M("0 polynomial");const a=Ue.findMSBSet(i);for(t<<=a-1;Ue.findMSBSet(t)>=a;)t^=i<<Ue.findMSBSet(t)-a;return t}static makeTypeInfoBits(t,i,a){if(!ia.isValidMaskPattern(i))throw new wt("Invalid mask pattern");const l=t.getBits()<<3|i;a.appendBits(l,5);const s=Ue.calculateBCHCode(l,Ue.TYPE_INFO_POLY);a.appendBits(s,10);const u=new we;if(u.appendBits(Ue.TYPE_INFO_MASK_PATTERN,15),a.xor(u),a.getSize()!==15)throw new wt("should not happen but we got: "+a.getSize())}static makeVersionInfoBits(t,i){i.appendBits(t.getVersionNumber(),6);const a=Ue.calculateBCHCode(t.getVersionNumber(),Ue.VERSION_INFO_POLY);if(i.appendBits(a,12),i.getSize()!==18)throw new wt("should not happen but we got: "+i.getSize())}static isEmpty(t){return t===255}static embedTimingPatterns(t){for(let i=8;i<t.getWidth()-8;++i){const a=(i+1)%2;Ue.isEmpty(t.get(i,6))&&t.setNumber(i,6,a),Ue.isEmpty(t.get(6,i))&&t.setNumber(6,i,a)}}static embedDarkDotAtLeftBottomCorner(t){if(t.get(8,t.getHeight()-8)===0)throw new wt;t.setNumber(8,t.getHeight()-8,1)}static embedHorizontalSeparationPattern(t,i,a){for(let l=0;l<8;++l){if(!Ue.isEmpty(a.get(t+l,i)))throw new wt;a.setNumber(t+l,i,0)}}static embedVerticalSeparationPattern(t,i,a){for(let l=0;l<7;++l){if(!Ue.isEmpty(a.get(t,i+l)))throw new wt;a.setNumber(t,i+l,0)}}static embedPositionAdjustmentPattern(t,i,a){for(let l=0;l<5;++l){const s=Ue.POSITION_ADJUSTMENT_PATTERN[l];for(let u=0;u<5;++u)a.setNumber(t+u,i+l,s[u])}}static embedPositionDetectionPattern(t,i,a){for(let l=0;l<7;++l){const s=Ue.POSITION_DETECTION_PATTERN[l];for(let u=0;u<7;++u)a.setNumber(t+u,i+l,s[u])}}static embedPositionDetectionPatternsAndSeparators(t){const i=Ue.POSITION_DETECTION_PATTERN[0].length;Ue.embedPositionDetectionPattern(0,0,t),Ue.embedPositionDetectionPattern(t.getWidth()-i,0,t),Ue.embedPositionDetectionPattern(0,t.getWidth()-i,t);const a=8;Ue.embedHorizontalSeparationPattern(0,a-1,t),Ue.embedHorizontalSeparationPattern(t.getWidth()-a,a-1,t),Ue.embedHorizontalSeparationPattern(0,t.getWidth()-a,t);const l=7;Ue.embedVerticalSeparationPattern(l,0,t),Ue.embedVerticalSeparationPattern(t.getHeight()-l-1,0,t),Ue.embedVerticalSeparationPattern(l,t.getHeight()-l,t)}static maybeEmbedPositionAdjustmentPatterns(t,i){if(t.getVersionNumber()<2)return;const a=t.getVersionNumber()-1,l=Ue.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[a];for(let s=0,u=l.length;s!==u;s++){const c=l[s];if(c>=0)for(let x=0;x!==u;x++){const p=l[x];p>=0&&Ue.isEmpty(i.get(p,c))&&Ue.embedPositionAdjustmentPattern(p-2,c-2,i)}}}}Ue.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])]),Ue.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])]),Ue.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])]),Ue.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])]),Ue.VERSION_INFO_POLY=7973,Ue.TYPE_INFO_POLY=1335,Ue.TYPE_INFO_MASK_PATTERN=21522;class mu{constructor(t,i){this.dataBytes=t,this.errorCorrectionBytes=i}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Ut{constructor(){}static calculateMaskPenalty(t){return Xt.applyMaskPenaltyRule1(t)+Xt.applyMaskPenaltyRule2(t)+Xt.applyMaskPenaltyRule3(t)+Xt.applyMaskPenaltyRule4(t)}static encode(t,i,a=null){let l=Ut.DEFAULT_BYTE_MODE_ENCODING;const s=a!==null&&a.get(ln.CHARACTER_SET)!==void 0;s&&(l=a.get(ln.CHARACTER_SET).toString());const u=this.chooseMode(t,l),c=new we;if(u===_e.BYTE&&(s||Ut.DEFAULT_BYTE_MODE_ENCODING!==l)){const xe=fe.getCharacterSetECIByName(l);xe!==void 0&&this.appendECI(xe,c)}this.appendModeInfo(u,c);const x=new we;this.appendBytes(t,u,x,l);let p;if(a!==null&&a.get(ln.QR_VERSION)!==void 0){const xe=Number.parseInt(a.get(ln.QR_VERSION).toString(),10);p=Me.getVersionForNumber(xe);const ge=this.calculateBitsNeeded(u,c,x,p);if(!this.willFit(ge,p,i))throw new wt("Data too big for requested version")}else p=this.recommendVersion(i,u,c,x);const w=new we;w.appendBitArray(c);const v=u===_e.BYTE?x.getSizeInBytes():t.length;this.appendLengthInfo(v,p,u,w),w.appendBitArray(x);const I=p.getECBlocksForLevel(i),B=p.getTotalCodewords()-I.getTotalECCodewords();this.terminateBits(B,w);const U=this.interleaveWithECBytes(w,p.getTotalCodewords(),B,I.getNumBlocks()),z=new ia;z.setECLevel(i),z.setMode(u),z.setVersion(p);const P=p.getDimensionForVersion(),W=new Jr(P,P),me=this.chooseMaskPattern(U,i,p,W);return z.setMaskPattern(me),Ue.buildMatrix(U,i,p,me,W),z.setMatrix(W),z}static recommendVersion(t,i,a,l){const s=this.calculateBitsNeeded(i,a,l,Me.getVersionForNumber(1)),u=this.chooseVersion(s,t),c=this.calculateBitsNeeded(i,a,l,u);return this.chooseVersion(c,t)}static calculateBitsNeeded(t,i,a,l){return i.getSize()+t.getCharacterCountBits(l)+a.getSize()}static getAlphanumericCode(t){return t<Ut.ALPHANUMERIC_TABLE.length?Ut.ALPHANUMERIC_TABLE[t]:-1}static chooseMode(t,i=null){if(fe.SJIS.getName()===i&&this.isOnlyDoubleByteKanji(t))return _e.KANJI;let a=!1,l=!1;for(let s=0,u=t.length;s<u;++s){const c=t.charAt(s);if(Ut.isDigit(c))a=!0;else if(this.getAlphanumericCode(c.charCodeAt(0))!==-1)l=!0;else return _e.BYTE}return l?_e.ALPHANUMERIC:a?_e.NUMERIC:_e.BYTE}static isOnlyDoubleByteKanji(t){let i;try{i=Ze.encode(t,fe.SJIS)}catch{return!1}const a=i.length;if(a%2!==0)return!1;for(let l=0;l<a;l+=2){const s=i[l]&255;if((s<129||s>159)&&(s<224||s>235))return!1}return!0}static chooseMaskPattern(t,i,a,l){let s=Number.MAX_SAFE_INTEGER,u=-1;for(let c=0;c<ia.NUM_MASK_PATTERNS;c++){Ue.buildMatrix(t,i,a,c,l);let x=this.calculateMaskPenalty(l);x<s&&(s=x,u=c)}return u}static chooseVersion(t,i){for(let a=1;a<=40;a++){const l=Me.getVersionForNumber(a);if(Ut.willFit(t,l,i))return l}throw new wt("Data too big")}static willFit(t,i,a){const l=i.getTotalCodewords(),u=i.getECBlocksForLevel(a).getTotalECCodewords(),c=l-u,x=(t+7)/8;return c>=x}static terminateBits(t,i){const a=t*8;if(i.getSize()>a)throw new wt("data bits cannot fit in the QR Code"+i.getSize()+" > "+a);for(let u=0;u<4&&i.getSize()<a;++u)i.appendBit(!1);const l=i.getSize()&7;if(l>0)for(let u=l;u<8;u++)i.appendBit(!1);const s=t-i.getSizeInBytes();for(let u=0;u<s;++u)i.appendBits((u&1)===0?236:17,8);if(i.getSize()!==a)throw new wt("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(t,i,a,l,s,u){if(l>=a)throw new wt("Block ID too large");const c=t%a,x=a-c,p=Math.floor(t/a),w=p+1,v=Math.floor(i/a),I=v+1,B=p-v,U=w-I;if(B!==U)throw new wt("EC bytes mismatch");if(a!==x+c)throw new wt("RS blocks mismatch");if(t!==(v+B)*x+(I+U)*c)throw new wt("Total bytes mismatch");l<x?(s[0]=v,u[0]=B):(s[0]=I,u[0]=U)}static interleaveWithECBytes(t,i,a,l){if(t.getSizeInBytes()!==a)throw new wt("Number of bits and data bytes does not match");let s=0,u=0,c=0;const x=new Array;for(let w=0;w<l;++w){const v=new Int32Array(1),I=new Int32Array(1);Ut.getNumDataBytesAndNumECBytesForBlockID(i,a,l,w,v,I);const B=v[0],U=new Uint8Array(B);t.toBytes(8*s,U,0,B);const z=Ut.generateECBytes(U,I[0]);x.push(new mu(U,z)),u=Math.max(u,B),c=Math.max(c,z.length),s+=v[0]}if(a!==s)throw new wt("Data bytes does not match offset");const p=new we;for(let w=0;w<u;++w)for(const v of x){const I=v.getDataBytes();w<I.length&&p.appendBits(I[w],8)}for(let w=0;w<c;++w)for(const v of x){const I=v.getErrorCorrectionBytes();w<I.length&&p.appendBits(I[w],8)}if(i!==p.getSizeInBytes())throw new wt("Interleaving error: "+i+" and "+p.getSizeInBytes()+" differ.");return p}static generateECBytes(t,i){const a=t.length,l=new Int32Array(a+i);for(let u=0;u<a;u++)l[u]=t[u]&255;new Er(ht.QR_CODE_FIELD_256).encode(l,i);const s=new Uint8Array(i);for(let u=0;u<i;u++)s[u]=l[a+u];return s}static appendModeInfo(t,i){i.appendBits(t.getBits(),4)}static appendLengthInfo(t,i,a,l){const s=a.getCharacterCountBits(i);if(t>=1<<s)throw new wt(t+" is bigger than "+((1<<s)-1));l.appendBits(t,s)}static appendBytes(t,i,a,l){switch(i){case _e.NUMERIC:Ut.appendNumericBytes(t,a);break;case _e.ALPHANUMERIC:Ut.appendAlphanumericBytes(t,a);break;case _e.BYTE:Ut.append8BitBytes(t,a,l);break;case _e.KANJI:Ut.appendKanjiBytes(t,a);break;default:throw new wt("Invalid mode: "+i)}}static getDigit(t){return t.charCodeAt(0)-48}static isDigit(t){const i=Ut.getDigit(t);return i>=0&&i<=9}static appendNumericBytes(t,i){const a=t.length;let l=0;for(;l<a;){const s=Ut.getDigit(t.charAt(l));if(l+2<a){const u=Ut.getDigit(t.charAt(l+1)),c=Ut.getDigit(t.charAt(l+2));i.appendBits(s*100+u*10+c,10),l+=3}else if(l+1<a){const u=Ut.getDigit(t.charAt(l+1));i.appendBits(s*10+u,7),l+=2}else i.appendBits(s,4),l++}}static appendAlphanumericBytes(t,i){const a=t.length;let l=0;for(;l<a;){const s=Ut.getAlphanumericCode(t.charCodeAt(l));if(s===-1)throw new wt;if(l+1<a){const u=Ut.getAlphanumericCode(t.charCodeAt(l+1));if(u===-1)throw new wt;i.appendBits(s*45+u,11),l+=2}else i.appendBits(s,6),l++}}static append8BitBytes(t,i,a){let l;try{l=Ze.encode(t,a)}catch(s){throw new wt(s)}for(let s=0,u=l.length;s!==u;s++){const c=l[s];i.appendBits(c,8)}}static appendKanjiBytes(t,i){let a;try{a=Ze.encode(t,fe.SJIS)}catch(s){throw new wt(s)}const l=a.length;for(let s=0;s<l;s+=2){const u=a[s]&255,c=a[s+1]&255,x=u<<8&4294967295|c;let p=-1;if(x>=33088&&x<=40956?p=x-33088:x>=57408&&x<=60351&&(p=x-49472),p===-1)throw new wt("Invalid byte sequence");const w=(p>>8)*192+(p&255);i.appendBits(w,13)}}static appendECI(t,i){i.appendBits(_e.ECI.getBits(),4),i.appendBits(t.getValue(),8)}}Ut.ALPHANUMERIC_TABLE=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]),Ut.DEFAULT_BYTE_MODE_ENCODING=fe.UTF8.getName();class aa{write(t,i,a,l=null){if(t.length===0)throw new M("Found empty contents");if(i<0||a<0)throw new M("Requested dimensions are too small: "+i+"x"+a);let s=Je.L,u=aa.QUIET_ZONE_SIZE;l!==null&&(l.get(ln.ERROR_CORRECTION)!==void 0&&(s=Je.fromString(l.get(ln.ERROR_CORRECTION).toString())),l.get(ln.MARGIN)!==void 0&&(u=Number.parseInt(l.get(ln.MARGIN).toString(),10)));const c=Ut.encode(t,s,l);return this.renderResult(c,i,a,u)}writeToDom(t,i,a,l,s=null){typeof t=="string"&&(t=document.querySelector(t));const u=this.write(i,a,l,s);t&&t.appendChild(u)}renderResult(t,i,a,l){const s=t.getMatrix();if(s===null)throw new jn;const u=s.getWidth(),c=s.getHeight(),x=u+l*2,p=c+l*2,w=Math.max(i,x),v=Math.max(a,p),I=Math.min(Math.floor(w/x),Math.floor(v/p)),B=Math.floor((w-u*I)/2),U=Math.floor((v-c*I)/2),z=this.createSVGElement(w,v);for(let P=0,W=U;P<c;P++,W+=I)for(let me=0,xe=B;me<u;me++,xe+=I)if(s.get(me,P)===1){const ge=this.createSvgRectElement(xe,W,I,I);z.appendChild(ge)}return z}createSVGElement(t,i){const a=document.createElementNS(aa.SVG_NS,"svg");return a.setAttributeNS(null,"height",t.toString()),a.setAttributeNS(null,"width",i.toString()),a}createSvgRectElement(t,i,a,l){const s=document.createElementNS(aa.SVG_NS,"rect");return s.setAttributeNS(null,"x",t.toString()),s.setAttributeNS(null,"y",i.toString()),s.setAttributeNS(null,"height",a.toString()),s.setAttributeNS(null,"width",l.toString()),s.setAttributeNS(null,"fill","#000000"),s}}aa.QUIET_ZONE_SIZE=4,aa.SVG_NS="http://www.w3.org/2000/svg";class Fa{encode(t,i,a,l,s){if(t.length===0)throw new M("Found empty contents");if(i!==Ae.QR_CODE)throw new M("Can only encode QR_CODE, but got "+i);if(a<0||l<0)throw new M(`Requested dimensions are too small: ${a}x${l}`);let u=Je.L,c=Fa.QUIET_ZONE_SIZE;s!==null&&(s.get(ln.ERROR_CORRECTION)!==void 0&&(u=Je.fromString(s.get(ln.ERROR_CORRECTION).toString())),s.get(ln.MARGIN)!==void 0&&(c=Number.parseInt(s.get(ln.MARGIN).toString(),10)));const x=Ut.encode(t,u,s);return Fa.renderResult(x,a,l,c)}static renderResult(t,i,a,l){const s=t.getMatrix();if(s===null)throw new jn;const u=s.getWidth(),c=s.getHeight(),x=u+l*2,p=c+l*2,w=Math.max(i,x),v=Math.max(a,p),I=Math.min(Math.floor(w/x),Math.floor(v/p)),B=Math.floor((w-u*I)/2),U=Math.floor((v-c*I)/2),z=new at(w,v);for(let P=0,W=U;P<c;P++,W+=I)for(let me=0,xe=B;me<u;me++,xe+=I)s.get(me,P)===1&&z.setRegion(xe,W,I,I);return z}}Fa.QUIET_ZONE_SIZE=4;class yu{encode(t,i,a,l,s){let u;switch(i){case Ae.QR_CODE:u=new Fa;break;default:throw new M("No encoder available for format "+i)}return u.encode(t,i,a,l,s)}}class Ai extends Oe{constructor(t,i,a,l,s,u,c,x){if(super(u,c),this.yuvData=t,this.dataWidth=i,this.dataHeight=a,this.left=l,this.top=s,l+u>i||s+c>a)throw new M("Crop rectangle does not fit within image data.");x&&this.reverseHorizontal(u,c)}getRow(t,i){if(t<0||t>=this.getHeight())throw new M("Requested row is outside the image: "+t);const a=this.getWidth();(i==null||i.length<a)&&(i=new Uint8ClampedArray(a));const l=(t+this.top)*this.dataWidth+this.left;return ie.arraycopy(this.yuvData,l,i,0,a),i}getMatrix(){const t=this.getWidth(),i=this.getHeight();if(t===this.dataWidth&&i===this.dataHeight)return this.yuvData;const a=t*i,l=new Uint8ClampedArray(a);let s=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return ie.arraycopy(this.yuvData,s,l,0,a),l;for(let u=0;u<i;u++){const c=u*t;ie.arraycopy(this.yuvData,s,l,c,t),s+=this.dataWidth}return l}isCropSupported(){return!0}crop(t,i,a,l){return new Ai(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+i,a,l,!1)}renderThumbnail(){const t=this.getWidth()/Ai.THUMBNAIL_SCALE_FACTOR,i=this.getHeight()/Ai.THUMBNAIL_SCALE_FACTOR,a=new Int32Array(t*i),l=this.yuvData;let s=this.top*this.dataWidth+this.left;for(let u=0;u<i;u++){const c=u*t;for(let x=0;x<t;x++){const p=l[s+x*Ai.THUMBNAIL_SCALE_FACTOR]&255;a[c+x]=4278190080|p*65793}s+=this.dataWidth*Ai.THUMBNAIL_SCALE_FACTOR}return a}getThumbnailWidth(){return this.getWidth()/Ai.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Ai.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(t,i){const a=this.yuvData;for(let l=0,s=this.top*this.dataWidth+this.left;l<i;l++,s+=this.dataWidth){const u=s+t/2;for(let c=s,x=s+t-1;c<u;c++,x--){const p=a[c];a[c]=a[x],a[x]=p}}}invert(){return new Qe(this)}}Ai.THUMBNAIL_SCALE_FACTOR=2;class Gl extends Oe{constructor(t,i,a,l,s,u,c){if(super(i,a),this.dataWidth=l,this.dataHeight=s,this.left=u,this.top=c,t.BYTES_PER_ELEMENT===4){const x=i*a,p=new Uint8ClampedArray(x);for(let w=0;w<x;w++){const v=t[w],I=v>>16&255,B=v>>7&510,U=v&255;p[w]=(I+B+U)/4&255}this.luminances=p}else this.luminances=t;if(l===void 0&&(this.dataWidth=i),s===void 0&&(this.dataHeight=a),u===void 0&&(this.left=0),c===void 0&&(this.top=0),this.left+i>this.dataWidth||this.top+a>this.dataHeight)throw new M("Crop rectangle does not fit within image data.")}getRow(t,i){if(t<0||t>=this.getHeight())throw new M("Requested row is outside the image: "+t);const a=this.getWidth();(i==null||i.length<a)&&(i=new Uint8ClampedArray(a));const l=(t+this.top)*this.dataWidth+this.left;return ie.arraycopy(this.luminances,l,i,0,a),i}getMatrix(){const t=this.getWidth(),i=this.getHeight();if(t===this.dataWidth&&i===this.dataHeight)return this.luminances;const a=t*i,l=new Uint8ClampedArray(a);let s=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return ie.arraycopy(this.luminances,s,l,0,a),l;for(let u=0;u<i;u++){const c=u*t;ie.arraycopy(this.luminances,s,l,c,t),s+=this.dataWidth}return l}isCropSupported(){return!0}crop(t,i,a,l){return new Gl(this.luminances,a,l,this.dataWidth,this.dataHeight,this.left+t,this.top+i)}invert(){return new Qe(this)}}class Gs extends fe{static forName(t){return this.getCharacterSetECIByName(t)}}class Cr{}Cr.ISO_8859_1=fe.ISO8859_1;class Ha{isCompact(){return this.compact}setCompact(t){this.compact=t}getSize(){return this.size}setSize(t){this.size=t}getLayers(){return this.layers}setLayers(t){this.layers=t}getCodeWords(){return this.codeWords}setCodeWords(t){this.codeWords=t}getMatrix(){return this.matrix}setMatrix(t){this.matrix=t}}class Vs{static singletonList(t){return[t]}static min(t,i){return t.sort(i)[0]}}class Xs{constructor(t){this.previous=t}getPrevious(){return this.previous}}class ra extends Xs{constructor(t,i,a){super(t),this.value=i,this.bitCount=a}appendTo(t,i){t.appendBits(this.value,this.bitCount)}add(t,i){return new ra(this,t,i)}addBinaryShift(t,i){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new ra(this,t,i)}toString(){let t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+ne.toBinaryString(t|1<<this.bitCount).substring(1)+">"}}class $r extends ra{constructor(t,i,a){super(t,0,0),this.binaryShiftStart=i,this.binaryShiftByteCount=a}appendTo(t,i){for(let a=0;a<this.binaryShiftByteCount;a++)(a===0||a===31&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):a===0?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(i[this.binaryShiftStart+a],8)}addBinaryShift(t,i){return new $r(this,t,i)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function Zs(T,t,i){return new $r(T,t,i)}function ja(T,t,i){return new ra(T,t,i)}const Pa=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],qi=0,el=1,Vn=2,Vl=3,ii=4,wr=new ra(null,0,0),la=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function pu(T){for(let t of T)de.fill(t,-1);return T[qi][ii]=0,T[el][ii]=0,T[el][qi]=28,T[Vl][ii]=0,T[Vn][ii]=0,T[Vn][qi]=15,T}const Sr=pu(de.createInt32Array(6,6));class ai{constructor(t,i,a,l){this.token=t,this.mode=i,this.binaryShiftByteCount=a,this.bitCount=l}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(t,i){let a=this.bitCount,l=this.token;if(t!==this.mode){let u=la[this.mode][t];l=ja(l,u&65535,u>>16),a+=u>>16}let s=t===Vn?4:5;return l=ja(l,i,s),new ai(l,t,0,a+s)}shiftAndAppend(t,i){let a=this.token,l=this.mode===Vn?4:5;return a=ja(a,Sr[this.mode][t],l),a=ja(a,i,5),new ai(a,this.mode,0,this.bitCount+l+5)}addBinaryShiftChar(t){let i=this.token,a=this.mode,l=this.bitCount;if(this.mode===ii||this.mode===Vn){let c=la[a][qi];i=ja(i,c&65535,c>>16),l+=c>>16,a=qi}let s=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,u=new ai(i,a,this.binaryShiftByteCount+1,l+s);return u.binaryShiftByteCount===2078&&(u=u.endBinaryShift(t+1)),u}endBinaryShift(t){if(this.binaryShiftByteCount===0)return this;let i=this.token;return i=Zs(i,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new ai(i,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(t){let i=this.bitCount+(la[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?i+=ai.calculateBinaryShiftCost(t)-ai.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(i+=10),i<=t.bitCount}toBitArray(t){let i=[];for(let l=this.endBinaryShift(t.length).token;l!==null;l=l.getPrevious())i.unshift(l);let a=new we;for(const l of i)l.appendTo(a,t);return a}toString(){return Ne.format("%s bits=%d bytes=%d",Pa[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0}}ai.INITIAL_STATE=new ai(wr,qi,0,0);function Qs(T){const t=Ne.getCharCode(" "),i=Ne.getCharCode("."),a=Ne.getCharCode(",");T[qi][t]=1;const l=Ne.getCharCode("Z"),s=Ne.getCharCode("A");for(let I=s;I<=l;I++)T[qi][I]=I-s+2;T[el][t]=1;const u=Ne.getCharCode("z"),c=Ne.getCharCode("a");for(let I=c;I<=u;I++)T[el][I]=I-c+2;T[Vn][t]=1;const x=Ne.getCharCode("9"),p=Ne.getCharCode("0");for(let I=p;I<=x;I++)T[Vn][I]=I-p+2;T[Vn][a]=12,T[Vn][i]=13;const w=["\0"," ","","","","","","","\x07","\b"," ",`
|
||
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let I=0;I<w.length;I++)T[Vl][Ne.getCharCode(w[I])]=I;const v=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let I=0;I<v.length;I++)Ne.getCharCode(v[I])>0&&(T[ii][Ne.getCharCode(v[I])]=I);return T}const br=Qs(de.createInt32Array(5,256));class sa{constructor(t){this.text=t}encode(){const t=Ne.getCharCode(" "),i=Ne.getCharCode(`
|
||
`);let a=Vs.singletonList(ai.INITIAL_STATE);for(let s=0;s<this.text.length;s++){let u,c=s+1<this.text.length?this.text[s+1]:0;switch(this.text[s]){case Ne.getCharCode("\r"):u=c===i?2:0;break;case Ne.getCharCode("."):u=c===t?3:0;break;case Ne.getCharCode(","):u=c===t?4:0;break;case Ne.getCharCode(":"):u=c===t?5:0;break;default:u=0}u>0?(a=sa.updateStateListForPair(a,s,u),s++):a=this.updateStateListForChar(a,s)}return Vs.min(a,(s,u)=>s.getBitCount()-u.getBitCount()).toBitArray(this.text)}updateStateListForChar(t,i){const a=[];for(let l of t)this.updateStateForChar(l,i,a);return sa.simplifyStates(a)}updateStateForChar(t,i,a){let l=this.text[i]&255,s=br[t.getMode()][l]>0,u=null;for(let c=0;c<=ii;c++){let x=br[c][l];if(x>0){if(u==null&&(u=t.endBinaryShift(i)),!s||c===t.getMode()||c===Vn){const p=u.latchAndAppend(c,x);a.push(p)}if(!s&&Sr[t.getMode()][c]>=0){const p=u.shiftAndAppend(c,x);a.push(p)}}}if(t.getBinaryShiftByteCount()>0||br[t.getMode()][l]===0){let c=t.addBinaryShiftChar(i);a.push(c)}}static updateStateListForPair(t,i,a){const l=[];for(let s of t)this.updateStateForPair(s,i,a,l);return this.simplifyStates(l)}static updateStateForPair(t,i,a,l){let s=t.endBinaryShift(i);if(l.push(s.latchAndAppend(ii,a)),t.getMode()!==ii&&l.push(s.shiftAndAppend(ii,a)),a===3||a===4){let u=s.latchAndAppend(Vn,16-a).latchAndAppend(Vn,1);l.push(u)}if(t.getBinaryShiftByteCount()>0){let u=t.addBinaryShiftChar(i).addBinaryShiftChar(i+1);l.push(u)}}static simplifyStates(t){let i=[];for(const a of t){let l=!0;for(const s of i){if(s.isBetterThanOrEqualTo(a)){l=!1;break}a.isBetterThanOrEqualTo(s)&&(i=i.filter(u=>u!==s))}l&&i.push(a)}return i}}class lt{constructor(){}static encodeBytes(t){return lt.encode(t,lt.DEFAULT_EC_PERCENT,lt.DEFAULT_AZTEC_LAYERS)}static encode(t,i,a){let l=new sa(t).encode(),s=ne.truncDivision(l.getSize()*i,100)+11,u=l.getSize()+s,c,x,p,w,v;if(a!==lt.DEFAULT_AZTEC_LAYERS){if(c=a<0,x=Math.abs(a),x>(c?lt.MAX_NB_BITS_COMPACT:lt.MAX_NB_BITS))throw new M(Ne.format("Illegal value %s for layers",a));p=lt.totalBitsInLayer(x,c),w=lt.WORD_SIZE[x];let ge=p-p%w;if(v=lt.stuffBits(l,w),v.getSize()+s>ge)throw new M("Data to large for user specified layer");if(c&&v.getSize()>w*64)throw new M("Data to large for user specified layer")}else{w=0,v=null;for(let ge=0;;ge++){if(ge>lt.MAX_NB_BITS)throw new M("Data too large for an Aztec code");if(c=ge<=3,x=c?ge+1:ge,p=lt.totalBitsInLayer(x,c),u>p)continue;(v==null||w!==lt.WORD_SIZE[x])&&(w=lt.WORD_SIZE[x],v=lt.stuffBits(l,w));let qe=p-p%w;if(!(c&&v.getSize()>w*64)&&v.getSize()+s<=qe)break}}let I=lt.generateCheckWords(v,p,w),B=v.getSize()/w,U=lt.generateModeMessage(c,x,B),z=(c?11:14)+x*4,P=new Int32Array(z),W;if(c){W=z;for(let ge=0;ge<P.length;ge++)P[ge]=ge}else{W=z+1+2*ne.truncDivision(ne.truncDivision(z,2)-1,15);let ge=ne.truncDivision(z,2),qe=ne.truncDivision(W,2);for(let He=0;He<ge;He++){let Jt=He+ne.truncDivision(He,15);P[ge-He-1]=qe-Jt-1,P[ge+He]=qe+Jt+1}}let me=new at(W);for(let ge=0,qe=0;ge<x;ge++){let He=(x-ge)*4+(c?9:12);for(let Jt=0;Jt<He;Jt++){let Xn=Jt*2;for(let Nn=0;Nn<2;Nn++)I.get(qe+Xn+Nn)&&me.set(P[ge*2+Nn],P[ge*2+Jt]),I.get(qe+He*2+Xn+Nn)&&me.set(P[ge*2+Jt],P[z-1-ge*2-Nn]),I.get(qe+He*4+Xn+Nn)&&me.set(P[z-1-ge*2-Nn],P[z-1-ge*2-Jt]),I.get(qe+He*6+Xn+Nn)&&me.set(P[z-1-ge*2-Jt],P[ge*2+Nn])}qe+=He*8}if(lt.drawModeMessage(me,c,W,U),c)lt.drawBullsEye(me,ne.truncDivision(W,2),5);else{lt.drawBullsEye(me,ne.truncDivision(W,2),7);for(let ge=0,qe=0;ge<ne.truncDivision(z,2)-1;ge+=15,qe+=16)for(let He=ne.truncDivision(W,2)&1;He<W;He+=2)me.set(ne.truncDivision(W,2)-qe,He),me.set(ne.truncDivision(W,2)+qe,He),me.set(He,ne.truncDivision(W,2)-qe),me.set(He,ne.truncDivision(W,2)+qe)}let xe=new Ha;return xe.setCompact(c),xe.setSize(W),xe.setLayers(x),xe.setCodeWords(B),xe.setMatrix(me),xe}static drawBullsEye(t,i,a){for(let l=0;l<a;l+=2)for(let s=i-l;s<=i+l;s++)t.set(s,i-l),t.set(s,i+l),t.set(i-l,s),t.set(i+l,s);t.set(i-a,i-a),t.set(i-a+1,i-a),t.set(i-a,i-a+1),t.set(i+a,i-a),t.set(i+a,i-a+1),t.set(i+a,i+a-1)}static generateModeMessage(t,i,a){let l=new we;return t?(l.appendBits(i-1,2),l.appendBits(a-1,6),l=lt.generateCheckWords(l,28,4)):(l.appendBits(i-1,5),l.appendBits(a-1,11),l=lt.generateCheckWords(l,40,4)),l}static drawModeMessage(t,i,a,l){let s=ne.truncDivision(a,2);if(i)for(let u=0;u<7;u++){let c=s-3+u;l.get(u)&&t.set(c,s-5),l.get(u+7)&&t.set(s+5,c),l.get(20-u)&&t.set(c,s+5),l.get(27-u)&&t.set(s-5,c)}else for(let u=0;u<10;u++){let c=s-5+u+ne.truncDivision(u,5);l.get(u)&&t.set(c,s-7),l.get(u+10)&&t.set(s+7,c),l.get(29-u)&&t.set(c,s+7),l.get(39-u)&&t.set(s-7,c)}}static generateCheckWords(t,i,a){let l=t.getSize()/a,s=new Er(lt.getGF(a)),u=ne.truncDivision(i,a),c=lt.bitsToWords(t,a,u);s.encode(c,u-l);let x=i%a,p=new we;p.appendBits(0,x);for(const w of Array.from(c))p.appendBits(w,a);return p}static bitsToWords(t,i,a){let l=new Int32Array(a),s,u;for(s=0,u=t.getSize()/i;s<u;s++){let c=0;for(let x=0;x<i;x++)c|=t.get(s*i+x)?1<<i-x-1:0;l[s]=c}return l}static getGF(t){switch(t){case 4:return ht.AZTEC_PARAM;case 6:return ht.AZTEC_DATA_6;case 8:return ht.AZTEC_DATA_8;case 10:return ht.AZTEC_DATA_10;case 12:return ht.AZTEC_DATA_12;default:throw new M("Unsupported word size "+t)}}static stuffBits(t,i){let a=new we,l=t.getSize(),s=(1<<i)-2;for(let u=0;u<l;u+=i){let c=0;for(let x=0;x<i;x++)(u+x>=l||t.get(u+x))&&(c|=1<<i-1-x);(c&s)===s?(a.appendBits(c&s,i),u--):(c&s)===0?(a.appendBits(c|1,i),u--):a.appendBits(c,i)}return a}static totalBitsInLayer(t,i){return((i?88:112)+16*t)*t}}lt.DEFAULT_EC_PERCENT=33,lt.DEFAULT_AZTEC_LAYERS=0,lt.MAX_NB_BITS=32,lt.MAX_NB_BITS_COMPACT=4,lt.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class Tr{encode(t,i,a,l){return this.encodeWithHints(t,i,a,l,null)}encodeWithHints(t,i,a,l,s){let u=Cr.ISO_8859_1,c=lt.DEFAULT_EC_PERCENT,x=lt.DEFAULT_AZTEC_LAYERS;return s!=null&&(s.has(ln.CHARACTER_SET)&&(u=Gs.forName(s.get(ln.CHARACTER_SET).toString())),s.has(ln.ERROR_CORRECTION)&&(c=ne.parseInt(s.get(ln.ERROR_CORRECTION).toString())),s.has(ln.AZTEC_LAYERS)&&(x=ne.parseInt(s.get(ln.AZTEC_LAYERS).toString()))),Tr.encodeLayers(t,i,a,l,u,c,x)}static encodeLayers(t,i,a,l,s,u,c){if(i!==Ae.AZTEC)throw new M("Can only encode AZTEC, but got "+i);let x=lt.encode(Ne.getBytes(t,s),u,c);return Tr.renderResult(x,a,l)}static renderResult(t,i,a){let l=t.getMatrix();if(l==null)throw new jn;let s=l.getWidth(),u=l.getHeight(),c=Math.max(i,s),x=Math.max(a,u),p=Math.min(c/s,x/u),w=(c-s*p)/2,v=(x-u*p)/2,I=new at(c,x);for(let B=0,U=v;B<u;B++,U+=p)for(let z=0,P=w;z<s;z++,P+=p)l.get(z,B)&&I.setRegion(P,U,p,p);return I}}d.AbstractExpandedDecoder=an,d.ArgumentException=N,d.ArithmeticException=Ma,d.AztecCode=Ha,d.AztecCodeReader=Yr,d.AztecCodeWriter=Tr,d.AztecDecoder=bt,d.AztecDetector=Bl,d.AztecDetectorResult=Bs,d.AztecEncoder=lt,d.AztecHighLevelEncoder=sa,d.AztecPoint=Tn,d.BarcodeFormat=Ae,d.Binarizer=ee,d.BinaryBitmap=H,d.BitArray=we,d.BitMatrix=at,d.BitSource=ti,d.BrowserAztecCodeReader=cu,d.BrowserBarcodeReader=fu,d.BrowserCodeReader=Ee,d.BrowserDatamatrixCodeReader=Xr,d.BrowserMultiFormatReader=Ys,d.BrowserPDF417Reader=gu,d.BrowserQRCodeReader=xu,d.BrowserQRCodeSvgWriter=aa,d.CharacterSetECI=fe,d.ChecksumException=Z,d.Code128Reader=ye,d.Code39Reader=It,d.DataMatrixDecodedBitStreamParser=_i,d.DataMatrixReader=Ri,d.DecodeHintType=Be,d.DecoderResult=Dt,d.DefaultGridSampler=Dl,d.DetectorResult=Pr,d.EAN13Reader=xi,d.EncodeHintType=ln,d.Exception=A,d.FormatException=le,d.GenericGF=ht,d.GenericGFPoly=xn,d.GlobalHistogramBinarizer=J,d.GridSampler=Rl,d.GridSamplerInstance=Jn,d.HTMLCanvasElementLuminanceSource=Ke,d.HybridBinarizer=oe,d.ITFReader=Ge,d.IllegalArgumentException=M,d.IllegalStateException=jn,d.InvertedLuminanceSource=Qe,d.LuminanceSource=Oe,d.MathUtils=$e,d.MultiFormatOneDReader=ei,d.MultiFormatReader=Ps,d.MultiFormatWriter=yu,d.NotFoundException=q,d.OneDReader=kt,d.PDF417DecodedBitStreamParser=K,d.PDF417DecoderErrorCorrection=Bi,d.PDF417Reader=An,d.PDF417ResultMetadata=ka,d.PerspectiveTransform=Pn,d.PlanarYUVLuminanceSource=Ai,d.QRCodeByteMatrix=Jr,d.QRCodeDataMask=Un,d.QRCodeDecodedBitStreamParser=Bt,d.QRCodeDecoderErrorCorrectionLevel=Je,d.QRCodeDecoderFormatInformation=un,d.QRCodeEncoder=Ut,d.QRCodeEncoderQRCode=ia,d.QRCodeMaskUtil=Xt,d.QRCodeMatrixUtil=Ue,d.QRCodeMode=_e,d.QRCodeReader=Di,d.QRCodeVersion=Me,d.QRCodeWriter=Fa,d.RGBLuminanceSource=Gl,d.RSS14Reader=Ct,d.RSSExpandedReader=he,d.ReaderException=Kr,d.ReedSolomonDecoder=ta,d.ReedSolomonEncoder=Er,d.ReedSolomonException=Hn,d.Result=Ce,d.ResultMetadataType=ft,d.ResultPoint=Te,d.StringUtils=Ne,d.UnsupportedOperationException=Gt,d.VideoInputDevice=F,d.WhiteRectangleDetector=qt,d.WriterException=wt,d.ZXingArrays=de,d.ZXingCharset=Gs,d.ZXingInteger=ne,d.ZXingStandardCharsets=Cr,d.ZXingStringBuilder=We,d.ZXingStringEncoding=Ze,d.ZXingSystem=ie,d.createAbstractExpandedDecoder=_a,Object.defineProperty(d,"__esModule",{value:!0})}))})(Ms,Ms.exports)),Ms.exports}var Yt=Zm();const Qm=dd(Yt),qm=mg({__proto__:null,default:Qm},[Yt]);var nd=(function(){function f(g,d,y){if(this.formatMap=new Map([[be.QR_CODE,Yt.BarcodeFormat.QR_CODE],[be.AZTEC,Yt.BarcodeFormat.AZTEC],[be.CODABAR,Yt.BarcodeFormat.CODABAR],[be.CODE_39,Yt.BarcodeFormat.CODE_39],[be.CODE_93,Yt.BarcodeFormat.CODE_93],[be.CODE_128,Yt.BarcodeFormat.CODE_128],[be.DATA_MATRIX,Yt.BarcodeFormat.DATA_MATRIX],[be.MAXICODE,Yt.BarcodeFormat.MAXICODE],[be.ITF,Yt.BarcodeFormat.ITF],[be.EAN_13,Yt.BarcodeFormat.EAN_13],[be.EAN_8,Yt.BarcodeFormat.EAN_8],[be.PDF_417,Yt.BarcodeFormat.PDF_417],[be.RSS_14,Yt.BarcodeFormat.RSS_14],[be.RSS_EXPANDED,Yt.BarcodeFormat.RSS_EXPANDED],[be.UPC_A,Yt.BarcodeFormat.UPC_A],[be.UPC_E,Yt.BarcodeFormat.UPC_E],[be.UPC_EAN_EXTENSION,Yt.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!qm)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=d,this.logger=y;var C=this.createZXingFormats(g),E=new Map;E.set(Yt.DecodeHintType.POSSIBLE_FORMATS,C),E.set(Yt.DecodeHintType.TRY_HARDER,!1),this.hints=E}return f.prototype.decodeAsync=function(g){var d=this;return new Promise(function(y,C){try{y(d.decode(g))}catch(E){C(E)}})},f.prototype.decode=function(g){var d=new Yt.MultiFormatReader(this.verbose,this.hints),y=new Yt.HTMLCanvasElementLuminanceSource(g),C=new Yt.BinaryBitmap(new Yt.HybridBinarizer(y)),E=d.decode(C);return{text:E.text,format:Xd.create(this.toHtml5QrcodeSupportedFormats(E.format)),debugData:this.createDebugData()}},f.prototype.createReverseFormatMap=function(){var g=new Map;return this.formatMap.forEach(function(d,y,C){g.set(d,y)}),g},f.prototype.toHtml5QrcodeSupportedFormats=function(g){if(!this.reverseFormatMap.has(g))throw"reverseFormatMap doesn't have ".concat(g);return this.reverseFormatMap.get(g)},f.prototype.createZXingFormats=function(g){for(var d=[],y=0,C=g;y<C.length;y++){var E=C[y];this.formatMap.has(E)?d.push(this.formatMap.get(E)):this.logger.logError("".concat(E," is not supported by")+"ZXingHtml5QrcodeShim")}return d},f.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},f})(),Wm=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},Km=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},id=(function(){function f(g,d,y){if(this.formatMap=new Map([[be.QR_CODE,"qr_code"],[be.AZTEC,"aztec"],[be.CODABAR,"codabar"],[be.CODE_39,"code_39"],[be.CODE_93,"code_93"],[be.CODE_128,"code_128"],[be.DATA_MATRIX,"data_matrix"],[be.ITF,"itf"],[be.EAN_13,"ean_13"],[be.EAN_8,"ean_8"],[be.PDF_417,"pdf417"],[be.UPC_A,"upc_a"],[be.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!f.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=d,this.logger=y;var C=this.createBarcodeDetectorFormats(g);if(this.detector=new BarcodeDetector(C),!this.detector)throw"BarcodeDetector detector not supported"}return f.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var g=new BarcodeDetector({formats:["qr_code"]});return typeof g<"u"},f.prototype.decodeAsync=function(g){return Wm(this,void 0,void 0,function(){var d,y;return Km(this,function(C){switch(C.label){case 0:return[4,this.detector.detect(g)];case 1:if(d=C.sent(),!d||d.length===0)throw"No barcode or QR code detected.";return y=this.selectLargestBarcode(d),[2,{text:y.rawValue,format:Xd.create(this.toHtml5QrcodeSupportedFormats(y.format)),debugData:this.createDebugData()}]}})})},f.prototype.selectLargestBarcode=function(g){for(var d=null,y=0,C=0,E=g;C<E.length;C++){var O=E[C],R=O.boundingBox.width*O.boundingBox.height;R>y&&(y=R,d=O)}if(!d)throw"No largest barcode found";return d},f.prototype.createBarcodeDetectorFormats=function(g){for(var d=[],y=0,C=g;y<C.length;y++){var E=C[y];this.formatMap.has(E)?d.push(this.formatMap.get(E)):this.logger.warn("".concat(E," is not supported by")+"BarcodeDetectorDelegate")}return{formats:d}},f.prototype.toHtml5QrcodeSupportedFormats=function(g){if(!this.reverseFormatMap.has(g))throw"reverseFormatMap doesn't have ".concat(g);return this.reverseFormatMap.get(g)},f.prototype.createReverseFormatMap=function(){var g=new Map;return this.formatMap.forEach(function(d,y,C){g.set(d,y)}),g},f.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},f})(),ad=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},rd=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},Jm=(function(){function f(g,d,y,C){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=y,d&&id.isSupported()?(this.primaryDecoder=new id(g,y,C),this.secondaryDecoder=new nd(g,y,C)):this.primaryDecoder=new nd(g,y,C)}return f.prototype.decodeAsync=function(g){return ad(this,void 0,void 0,function(){var d;return rd(this,function(y){switch(y.label){case 0:d=performance.now(),y.label=1;case 1:return y.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(g)];case 2:return[2,y.sent()];case 3:return this.possiblyLogPerformance(d),[7];case 4:return[2]}})})},f.prototype.decodeRobustlyAsync=function(g){return ad(this,void 0,void 0,function(){var d,y;return rd(this,function(C){switch(C.label){case 0:d=performance.now(),C.label=1;case 1:return C.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(g)];case 2:return[2,C.sent()];case 3:if(y=C.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(g)];throw y;case 4:return this.possiblyLogPerformance(d),[7];case 5:return[2]}})})},f.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},f.prototype.possiblyLogPerformance=function(g){if(this.verbose){var d=performance.now()-g;this.executionResults.push(d),this.executions++,this.possiblyFlushPerformanceReport()}},f.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var g=0,d=0,y=this.executionResults;d<y.length;d++){var C=y[d];g+=C}var E=g/this.executionResults.length;console.log("".concat(E," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},f})(),M1=(function(){var f=function(g,d){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,C){y.__proto__=C}||function(y,C){for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(y[E]=C[E])},f(g,d)};return function(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");f(g,d);function y(){this.constructor=g}g.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}})(),ru=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},lu=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},Wd=(function(){function f(g,d){this.name=g,this.track=d}return f.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},f.prototype.apply=function(g){var d={};d[this.name]=g;var y={advanced:[d]};return this.track.applyConstraints(y)},f.prototype.value=function(){var g=this.track.getSettings();if(this.name in g){var d=g[this.name];return d}return null},f})(),$m=(function(f){M1(g,f);function g(d,y){return f.call(this,d,y)||this}return g.prototype.min=function(){return this.getCapabilities().min},g.prototype.max=function(){return this.getCapabilities().max},g.prototype.step=function(){return this.getCapabilities().step},g.prototype.apply=function(d){var y={};y[this.name]=d;var C={advanced:[y]};return this.track.applyConstraints(C)},g.prototype.getCapabilities=function(){this.failIfNotSupported();var d=this.track.getCapabilities(),y=d[this.name];return{min:y.min,max:y.max,step:y.step}},g.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},g})(Wd),e3=(function(f){M1(g,f);function g(d){return f.call(this,"zoom",d)||this}return g})($m),t3=(function(f){M1(g,f);function g(d){return f.call(this,"torch",d)||this}return g})(Wd),n3=(function(){function f(g){this.track=g}return f.prototype.zoomFeature=function(){return new e3(this.track)},f.prototype.torchFeature=function(){return new t3(this.track)},f})(),i3=(function(){function f(g,d,y){this.isClosed=!1,this.parentElement=g,this.mediaStream=d,this.callbacks=y,this.surface=this.createVideoElement(this.parentElement.clientWidth),g.append(this.surface)}return f.prototype.createVideoElement=function(g){var d=document.createElement("video");return d.style.width="".concat(g,"px"),d.style.display="block",d.muted=!0,d.setAttribute("muted","true"),d.playsInline=!0,d},f.prototype.setupSurface=function(){var g=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var d=function(){var y=g.surface.clientWidth,C=g.surface.clientHeight;g.callbacks.onRenderSurfaceReady(y,C),g.surface.removeEventListener("playing",d)};this.surface.addEventListener("playing",d),this.surface.srcObject=this.mediaStream,this.surface.play()},f.create=function(g,d,y,C){return ru(this,void 0,void 0,function(){var E,O;return lu(this,function(R){switch(R.label){case 0:return E=new f(g,d,C),y.aspectRatio?(O={aspectRatio:y.aspectRatio},[4,E.getFirstTrackOrFail().applyConstraints(O)]):[3,2];case 1:R.sent(),R.label=2;case 2:return E.setupSurface(),[2,E]}})})},f.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},f.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},f.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},f.prototype.resume=function(g){this.failIfClosed();var d=this,y=function(){setTimeout(g,200),d.surface.removeEventListener("playing",y)};this.surface.addEventListener("playing",y),this.surface.play()},f.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},f.prototype.getSurface=function(){return this.failIfClosed(),this.surface},f.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},f.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},f.prototype.applyVideoConstraints=function(g){return ru(this,void 0,void 0,function(){return lu(this,function(d){if("aspectRatio"in g)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(g)]})})},f.prototype.close=function(){if(this.isClosed)return Promise.resolve();var g=this;return new Promise(function(d,y){var C=g.mediaStream.getVideoTracks(),E=C.length,O=0;g.mediaStream.getVideoTracks().forEach(function(R){g.mediaStream.removeTrack(R),R.stop(),++O,O>=E&&(g.isClosed=!0,g.parentElement.removeChild(g.surface),d())})})},f.prototype.getCapabilities=function(){return new n3(this.getFirstTrackOrFail())},f})(),a3=(function(){function f(g){this.mediaStream=g}return f.prototype.render=function(g,d,y){return ru(this,void 0,void 0,function(){return lu(this,function(C){return[2,i3.create(g,this.mediaStream,d,y)]})})},f.create=function(g){return ru(this,void 0,void 0,function(){var d,y;return lu(this,function(C){switch(C.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return d={audio:!1,video:g},[4,navigator.mediaDevices.getUserMedia(d)];case 1:return y=C.sent(),[2,new f(y)]}})})},f})(),ld=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},sd=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},r3=(function(){function f(){}return f.failIfNotSupported=function(){return ld(this,void 0,void 0,function(){return sd(this,function(g){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new f]})})},f.prototype.create=function(g){return ld(this,void 0,void 0,function(){return sd(this,function(d){return[2,a3.create(g)]})})},f})(),l3=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},s3=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},o3=(function(){function f(){}return f.retrieve=function(){if(navigator.mediaDevices)return f.getCamerasFromMediaDevices();var g=MediaStreamTrack;return MediaStreamTrack&&g.getSources?f.getCamerasFromMediaStreamTrack():f.rejectWithError()},f.rejectWithError=function(){var g=Ml.unableToQuerySupportedDevices();return f.isHttpsOrLocalhost()||(g=Ml.insecureContextCameraQueryError()),Promise.reject(g)},f.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var g=location.host.split(":")[0];return g==="127.0.0.1"||g==="localhost"},f.getCamerasFromMediaDevices=function(){return l3(this,void 0,void 0,function(){var g,d,y,C,E,O,R;return s3(this,function(b){switch(b.label){case 0:return g=function(A){for(var N=A.getVideoTracks(),M=0,H=N;M<H.length;M++){var Z=H[M];Z.enabled=!1,Z.stop(),A.removeTrack(Z)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return d=b.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(y=b.sent(),C=[],E=0,O=y;E<O.length;E++)R=O[E],R.kind==="videoinput"&&C.push({id:R.deviceId,label:R.label});return g(d),[2,C]}})})},f.getCamerasFromMediaStreamTrack=function(){return new Promise(function(g,d){var y=function(E){for(var O=[],R=0,b=E;R<b.length;R++){var A=b[R];A.kind==="video"&&O.push({id:A.id,label:A.label})}g(O)},C=MediaStreamTrack;C.getSources(y)})},f})(),nn;(function(f){f[f.UNKNOWN=0]="UNKNOWN",f[f.NOT_STARTED=1]="NOT_STARTED",f[f.SCANNING=2]="SCANNING",f[f.PAUSED=3]="PAUSED"})(nn||(nn={}));var u3=(function(){function f(){this.state=nn.NOT_STARTED,this.onGoingTransactionNewState=nn.UNKNOWN}return f.prototype.directTransition=function(g){this.failIfTransitionOngoing(),this.validateTransition(g),this.state=g},f.prototype.startTransition=function(g){return this.failIfTransitionOngoing(),this.validateTransition(g),this.onGoingTransactionNewState=g,this},f.prototype.execute=function(){if(this.onGoingTransactionNewState===nn.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var g=this.onGoingTransactionNewState;this.onGoingTransactionNewState=nn.UNKNOWN,this.directTransition(g)},f.prototype.cancel=function(){if(this.onGoingTransactionNewState===nn.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=nn.UNKNOWN},f.prototype.getState=function(){return this.state},f.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==nn.UNKNOWN)throw"Cannot transition to a new state, already under transition"},f.prototype.validateTransition=function(g){switch(this.state){case nn.UNKNOWN:throw"Transition from unknown is not allowed";case nn.NOT_STARTED:this.failIfNewStateIs(g,[nn.PAUSED]);break;case nn.SCANNING:break;case nn.PAUSED:break}},f.prototype.failIfNewStateIs=function(g,d){for(var y=0,C=d;y<C.length;y++){var E=C[y];if(g===E)throw"Cannot transition from ".concat(this.state," to ").concat(g)}},f})(),c3=(function(){function f(g){this.stateManager=g}return f.prototype.startTransition=function(g){return this.stateManager.startTransition(g)},f.prototype.directTransition=function(g){this.stateManager.directTransition(g)},f.prototype.getState=function(){return this.stateManager.getState()},f.prototype.canScanFile=function(){return this.stateManager.getState()===nn.NOT_STARTED},f.prototype.isScanning=function(){return this.stateManager.getState()!==nn.NOT_STARTED},f.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===nn.SCANNING},f.prototype.isPaused=function(){return this.stateManager.getState()===nn.PAUSED},f})(),f3=(function(){function f(){}return f.create=function(){return new c3(new u3)},f})(),h3=(function(){var f=function(g,d){return f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,C){y.__proto__=C}||function(y,C){for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(y[E]=C[E])},f(g,d)};return function(g,d){if(typeof d!="function"&&d!==null)throw new TypeError("Class extends value "+String(d)+" is not a constructor or null");f(g,d);function y(){this.constructor=g}g.prototype=d===null?Object.create(d):(y.prototype=d.prototype,new y)}})(),fi=(function(f){h3(g,f);function g(){return f!==null&&f.apply(this,arguments)||this}return g.DEFAULT_WIDTH=300,g.DEFAULT_WIDTH_OFFSET=2,g.FILE_SCAN_MIN_HEIGHT=300,g.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,g.MIN_QR_BOX_SIZE=50,g.SHADED_LEFT=1,g.SHADED_RIGHT=2,g.SHADED_TOP=3,g.SHADED_BOTTOM=4,g.SHADED_REGION_ELEMENT_ID="qr-shaded-region",g.VERBOSE=!1,g.BORDER_SHADER_DEFAULT_COLOR="#ffffff",g.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",g})(Fi),d3=(function(){function f(g,d){this.logger=d,this.fps=fi.SCAN_DEFAULT_FPS,g?(g.fps&&(this.fps=g.fps),this.disableFlip=g.disableFlip===!0,this.qrbox=g.qrbox,this.aspectRatio=g.aspectRatio,this.videoConstraints=g.videoConstraints):this.disableFlip=fi.DEFAULT_DISABLE_FLIP}return f.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?qd.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},f.prototype.isShadedBoxEnabled=function(){return!ea(this.qrbox)},f.create=function(g,d){return new f(g,d)},f})(),od=(function(){function f(g,d){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(g))throw"HTML Element with id=".concat(g," not found");this.elementId=g,this.verbose=!1;var y;typeof d=="boolean"?this.verbose=d===!0:d&&(y=d,this.verbose=y.verbose===!0,y.experimentalFeatures),this.logger=new Qd(this.verbose),this.qrcode=new Jm(this.getSupportedFormats(d),this.getUseBarCodeDetectorIfSupported(y),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=f3.create()}return f.prototype.start=function(g,d,y,C){var E=this;if(!g)throw"cameraIdOrConfig is required";if(!y||typeof y!="function")throw"qrCodeSuccessCallback is required and should be a function.";var O;C?O=C:O=this.verbose?this.logger.log:function(){};var R=d3.create(d,this.logger);this.clearElement();var b=!1;R.videoConstraints&&(R.isMediaStreamConstraintsValid()?b=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var A=b,N=document.getElementById(this.elementId);N.clientWidth?N.clientWidth:fi.DEFAULT_WIDTH,N.style.position="relative",this.shouldScan=!0,this.element=N;var M=this,H=this.stateManagerProxy.startTransition(nn.SCANNING);return new Promise(function(Z,ee){var ie=A?R.videoConstraints:M.createVideoConstraints(g);if(!ie){H.cancel(),ee("videoConstraints should be defined");return}var ae={};(!A||R.aspectRatio)&&(ae.aspectRatio=R.aspectRatio);var pe={onRenderSurfaceReady:function(de,ne){M.setupUi(de,ne,R),M.isScanning=!0,M.foreverScan(R,y,O)}};r3.failIfNotSupported().then(function(de){de.create(ie).then(function(ne){return ne.render(E.element,ae,pe).then(function(we){M.renderedCamera=we,H.execute(),Z(null)}).catch(function(we){H.cancel(),ee(we)})}).catch(function(ne){H.cancel(),ee(Ml.errorGettingUserMedia(ne))})}).catch(function(de){H.cancel(),ee(Ml.cameraStreamingNotSupported())})})},f.prototype.pause=function(g){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(nn.PAUSED),this.showPausedState(),(ea(g)||g!==!0)&&(g=!1),g&&this.renderedCamera&&this.renderedCamera.pause()},f.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var g=this,d=function(){g.stateManagerProxy.directTransition(nn.SCANNING),g.hidePausedState()};if(!this.renderedCamera.isPaused()){d();return}this.renderedCamera.resume(function(){d()})},f.prototype.getState=function(){return this.stateManagerProxy.getState()},f.prototype.stop=function(){var g=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var d=this.stateManagerProxy.startTransition(nn.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var y=function(){if(g.element){var E=document.getElementById(fi.SHADED_REGION_ELEMENT_ID);E&&g.element.removeChild(E)}},C=this;return this.renderedCamera.close().then(function(){return C.renderedCamera=null,C.element&&(C.element.removeChild(C.canvasElement),C.canvasElement=null),y(),C.qrRegion&&(C.qrRegion=null),C.context&&(C.context=null),d.execute(),C.hidePausedState(),C.isScanning=!1,Promise.resolve()})},f.prototype.scanFile=function(g,d){return this.scanFileV2(g,d).then(function(y){return y.decodedText})},f.prototype.scanFileV2=function(g,d){var y=this;if(!g||!(g instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(ea(d)&&(d=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(C,E){y.possiblyCloseLastScanImageFile(),y.clearElement(),y.lastScanImageFile=URL.createObjectURL(g);var O=new Image;O.onload=function(){var R=O.width,b=O.height,A=document.getElementById(y.elementId),N=A.clientWidth?A.clientWidth:fi.DEFAULT_WIDTH,M=Math.max(A.clientHeight?A.clientHeight:b,fi.FILE_SCAN_MIN_HEIGHT),H=y.computeCanvasDrawConfig(R,b,N,M);if(d){var Z=y.createCanvasElement(N,M,"qr-canvas-visible");Z.style.display="inline-block",A.appendChild(Z);var ee=Z.getContext("2d");if(!ee)throw"Unable to get 2d context from canvas";ee.canvas.width=N,ee.canvas.height=M,ee.drawImage(O,0,0,R,b,H.x,H.y,H.width,H.height)}var ie=fi.FILE_SCAN_HIDDEN_CANVAS_PADDING,ae=Math.max(O.width,H.width),pe=Math.max(O.height,H.height),de=ae+2*ie,ne=pe+2*ie,we=y.createCanvasElement(de,ne);A.appendChild(we);var Pe=we.getContext("2d");if(!Pe)throw"Unable to get 2d context from canvas";Pe.canvas.width=de,Pe.canvas.height=ne,Pe.drawImage(O,0,0,R,b,ie,ie,ae,pe);try{y.qrcode.decodeRobustlyAsync(we).then(function(Be){C($h.createFromQrcodeResult(Be))}).catch(E)}catch(Be){E("QR code parse error, error = ".concat(Be))}},O.onerror=E,O.onabort=E,O.onstalled=E,O.onsuspend=E,O.src=URL.createObjectURL(g)})},f.prototype.clear=function(){this.clearElement()},f.getCameras=function(){return o3.retrieve()},f.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},f.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},f.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},f.prototype.applyVideoConstraints=function(g){if(g){if(!qd.isMediaStreamConstraintsValid(g,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(g)},f.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},f.prototype.getSupportedFormats=function(g){var d=[be.QR_CODE,be.AZTEC,be.CODABAR,be.CODE_39,be.CODE_93,be.CODE_128,be.DATA_MATRIX,be.MAXICODE,be.ITF,be.EAN_13,be.EAN_8,be.PDF_417,be.RSS_14,be.RSS_EXPANDED,be.UPC_A,be.UPC_E,be.UPC_EAN_EXTENSION];if(!g||typeof g=="boolean"||!g.formatsToSupport)return d;if(!Array.isArray(g.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(g.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var y=[],C=0,E=g.formatsToSupport;C<E.length;C++){var O=E[C];Gm(O)?y.push(O):this.logger.warn("Invalid format: ".concat(O," passed in config, ignoring."))}if(y.length===0)throw"None of formatsToSupport match supported values.";return y},f.prototype.getUseBarCodeDetectorIfSupported=function(g){if(ea(g))return!0;if(!ea(g.useBarCodeDetectorIfSupported))return g.useBarCodeDetectorIfSupported!==!1;if(ea(g.experimentalFeatures))return!0;var d=g.experimentalFeatures;return ea(d.useBarCodeDetectorIfSupported)?!0:d.useBarCodeDetectorIfSupported!==!1},f.prototype.validateQrboxSize=function(g,d,y){var C=this,E=y.qrbox;this.validateQrboxConfig(E);var O=this.toQrdimensions(g,d,E),R=function(A){if(A<fi.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(fi.MIN_QR_BOX_SIZE,"px.")},b=function(A){return A>g&&(C.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),A=g),A};R(O.width),R(O.height),O.width=b(O.width)},f.prototype.validateQrboxConfig=function(g){if(typeof g!="number"&&typeof g!="function"&&(g.width===void 0||g.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},f.prototype.toQrdimensions=function(g,d,y){if(typeof y=="number")return{width:y,height:y};if(typeof y=="function")try{return y(g,d)}catch(C){throw new Error("qrbox config was passed as a function but it failed with unknown error"+C)}return y},f.prototype.setupUi=function(g,d,y){y.isShadedBoxEnabled()&&this.validateQrboxSize(g,d,y);var C=ea(y.qrbox)?{width:g,height:d}:y.qrbox;this.validateQrboxConfig(C);var E=this.toQrdimensions(g,d,C);E.height>d&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var O=y.isShadedBoxEnabled()&&E.height<=d,R={x:0,y:0,width:g,height:d},b=O?this.getShadedRegionBounds(g,d,E):R,A=this.createCanvasElement(b.width,b.height),N={willReadFrequently:!0},M=A.getContext("2d",N);M.canvas.width=b.width,M.canvas.height=b.height,this.element.append(A),O&&this.possiblyInsertShadingElement(this.element,g,d,E),this.createScannerPausedUiElement(this.element),this.qrRegion=b,this.context=M,this.canvasElement=A},f.prototype.createScannerPausedUiElement=function(g){var d=document.createElement("div");d.innerText=Ml.scannerPaused(),d.style.display="none",d.style.position="absolute",d.style.top="0px",d.style.zIndex="1",d.style.background="rgba(9, 9, 9, 0.46)",d.style.color="#FFECEC",d.style.textAlign="center",d.style.width="100%",g.appendChild(d),this.scannerPausedUiElement=d},f.prototype.scanContext=function(g,d){var y=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(C){return g(C.text,$h.createFromQrcodeResult(C)),y.possiblyUpdateShaders(!0),!0}).catch(function(C){y.possiblyUpdateShaders(!1);var E=Ml.codeParseError(C);return d(E,Zd.createFrom(E)),!1})},f.prototype.foreverScan=function(g,d,y){var C=this;if(this.shouldScan&&this.renderedCamera){var E=this.renderedCamera.getSurface(),O=E.videoWidth/E.clientWidth,R=E.videoHeight/E.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var b=this.qrRegion.width*O,A=this.qrRegion.height*R,N=this.qrRegion.x*O,M=this.qrRegion.y*R;this.context.drawImage(E,N,M,b,A,0,0,this.qrRegion.width,this.qrRegion.height);var H=function(){C.foreverScanTimeout=setTimeout(function(){C.foreverScan(g,d,y)},C.getTimeoutFps(g.fps))};this.scanContext(d,y).then(function(Z){!Z&&g.disableFlip!==!0?(C.context.translate(C.context.canvas.width,0),C.context.scale(-1,1),C.scanContext(d,y).finally(function(){H()})):H()}).catch(function(Z){C.logger.logError("Error happend while scanning context",Z),H()})}},f.prototype.createVideoConstraints=function(g){if(typeof g=="string")return{deviceId:{exact:g}};if(typeof g=="object"){var d="facingMode",y="deviceId",C={user:!0,environment:!0},E="exact",O=function(ee){if(ee in C)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(ee,"'")},R=Object.keys(g);if(R.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(R.length," keys");var b=Object.keys(g)[0];if(b!==d&&b!==y)throw"Only '".concat(d,"' and '").concat(y,"' ")+" are supported for 'cameraIdOrConfig'";if(b===d){var A=g.facingMode;if(typeof A=="string"){if(O(A))return{facingMode:A}}else if(typeof A=="object")if(E in A){if(O(A["".concat(E)]))return{facingMode:{exact:A["".concat(E)]}}}else throw"'facingMode' should be string or object with"+" ".concat(E," as key.");else{var N=typeof A;throw"Invalid type of 'facingMode' = ".concat(N)}}else{var M=g.deviceId;if(typeof M=="string")return{deviceId:M};if(typeof M=="object"){if(E in M)return{deviceId:{exact:M["".concat(E)]}};throw"'deviceId' should be string or object with"+" ".concat(E," as key.")}else{var H=typeof M;throw"Invalid type of 'deviceId' = ".concat(H)}}}var Z=typeof g;throw"Invalid type of 'cameraIdOrConfig' = ".concat(Z)},f.prototype.computeCanvasDrawConfig=function(g,d,y,C){if(g<=y&&d<=C){var E=(y-g)/2,O=(C-d)/2;return{x:E,y:O,width:g,height:d}}else{var R=g,b=d;return g>y&&(d=y/g*d,g=y),d>C&&(g=C/d*g,d=C),this.logger.log("Image downsampled from "+"".concat(R,"X").concat(b)+" to ".concat(g,"X").concat(d,".")),this.computeCanvasDrawConfig(g,d,y,C)}},f.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var g=document.getElementById(this.elementId);g&&(g.innerHTML="")},f.prototype.possiblyUpdateShaders=function(g){this.qrMatch!==g&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(d){d.style.backgroundColor=g?fi.BORDER_SHADER_MATCH_COLOR:fi.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=g)},f.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},f.prototype.createCanvasElement=function(g,d,y){var C=g,E=d,O=document.createElement("canvas");return O.style.width="".concat(C,"px"),O.style.height="".concat(E,"px"),O.style.display="none",O.id=ea(y)?"qr-canvas":y,O},f.prototype.getShadedRegionBounds=function(g,d,y){if(y.width>g||y.height>d)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(g-y.width)/2,y:(d-y.height)/2,width:y.width,height:y.height}},f.prototype.possiblyInsertShadingElement=function(g,d,y,C){if(!(d-C.width<1||y-C.height<1)){var E=document.createElement("div");E.style.position="absolute";var O=(d-C.width)/2,R=(y-C.height)/2;if(E.style.borderLeft="".concat(O,"px solid rgba(0, 0, 0, 0.48)"),E.style.borderRight="".concat(O,"px solid rgba(0, 0, 0, 0.48)"),E.style.borderTop="".concat(R,"px solid rgba(0, 0, 0, 0.48)"),E.style.borderBottom="".concat(R,"px solid rgba(0, 0, 0, 0.48)"),E.style.boxSizing="border-box",E.style.top="0px",E.style.bottom="0px",E.style.left="0px",E.style.right="0px",E.id="".concat(fi.SHADED_REGION_ELEMENT_ID),d-C.width<11||y-C.height<11)this.hasBorderShaders=!1;else{var b=5,A=40;this.insertShaderBorders(E,A,b,-b,null,0,!0),this.insertShaderBorders(E,A,b,-b,null,0,!1),this.insertShaderBorders(E,A,b,null,-b,0,!0),this.insertShaderBorders(E,A,b,null,-b,0,!1),this.insertShaderBorders(E,b,A+b,-b,null,-b,!0),this.insertShaderBorders(E,b,A+b,null,-b,-b,!0),this.insertShaderBorders(E,b,A+b,-b,null,-b,!1),this.insertShaderBorders(E,b,A+b,null,-b,-b,!1),this.hasBorderShaders=!0}g.append(E)}},f.prototype.insertShaderBorders=function(g,d,y,C,E,O,R){var b=document.createElement("div");b.style.position="absolute",b.style.backgroundColor=fi.BORDER_SHADER_DEFAULT_COLOR,b.style.width="".concat(d,"px"),b.style.height="".concat(y,"px"),C!==null&&(b.style.top="".concat(C,"px")),E!==null&&(b.style.bottom="".concat(E,"px")),R?b.style.left="".concat(O,"px"):b.style.right="".concat(O,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(b),g.appendChild(b)},f.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},f.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},f.prototype.getTimeoutFps=function(g){return 1e3/g},f})(),I1="data:image/svg+xml;base64,",g3=I1+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAzNzEuNjQzIDM3MS42NDMiIHN0eWxlPSJlbmFibGUtYmFja2dyb3VuZDpuZXcgMCAwIDM3MS42NDMgMzcxLjY0MyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+PHBhdGggZD0iTTEwNS4wODQgMzguMjcxaDE2My43Njh2MjBIMTA1LjA4NHoiLz48cGF0aCBkPSJNMzExLjU5NiAxOTAuMTg5Yy03LjQ0MS05LjM0Ny0xOC40MDMtMTYuMjA2LTMyLjc0My0yMC41MjJWMzBjMC0xNi41NDItMTMuNDU4LTMwLTMwLTMwSDEyNS4wODRjLTE2LjU0MiAwLTMwIDEzLjQ1OC0zMCAzMHYxMjAuMTQzaC04LjI5NmMtMTYuNTQyIDAtMzAgMTMuNDU4LTMwIDMwdjEuMzMzYTI5LjgwNCAyOS44MDQgMCAwIDAgNC42MDMgMTUuOTM5Yy03LjM0IDUuNDc0LTEyLjEwMyAxNC4yMjEtMTIuMTAzIDI0LjA2MXYxLjMzM2MwIDkuODQgNC43NjMgMTguNTg3IDEyLjEwMyAyNC4wNjJhMjkuODEgMjkuODEgMCAwIDAtNC42MDMgMTUuOTM4djEuMzMzYzAgMTYuNTQyIDEzLjQ1OCAzMCAzMCAzMGg4LjMyNGMuNDI3IDExLjYzMSA3LjUwMyAyMS41ODcgMTcuNTM0IDI2LjE3Ny45MzEgMTAuNTAzIDQuMDg0IDMwLjE4NyAxNC43NjggNDUuNTM3YTkuOTg4IDkuOTg4IDAgMCAwIDguMjE2IDQuMjg4IDkuOTU4IDkuOTU4IDAgMCAwIDUuNzA0LTEuNzkzYzQuNTMzLTMuMTU1IDUuNjUtOS4zODggMi40OTUtMTMuOTIxLTYuNzk4LTkuNzY3LTkuNjAyLTIyLjYwOC0xMC43Ni0zMS40aDgyLjY4NWMuMjcyLjQxNC41NDUuODE4LjgxNSAxLjIxIDMuMTQyIDQuNTQxIDkuMzcyIDUuNjc5IDEzLjkxMyAyLjUzNCA0LjU0Mi0zLjE0MiA1LjY3Ny05LjM3MSAyLjUzNS0xMy45MTMtMTEuOTE5LTE3LjIyOS04Ljc4Ny0zNS44ODQgOS41ODEtNTcuMDEyIDMuMDY3LTIuNjUyIDEyLjMwNy0xMS43MzIgMTEuMjE3LTI0LjAzMy0uODI4LTkuMzQzLTcuMTA5LTE3LjE5NC0xOC42NjktMjMuMzM3YTkuODU3IDkuODU3IDAgMCAwLTEuMDYxLS40ODZjLS40NjYtLjE4Mi0xMS40MDMtNC41NzktOS43NDEtMTUuNzA2IDEuMDA3LTYuNzM3IDE0Ljc2OC04LjI3MyAyMy43NjYtNy42NjYgMjMuMTU2IDEuNTY5IDM5LjY5OCA3LjgwMyA0Ny44MzYgMTguMDI2IDUuNzUyIDcuMjI1IDcuNjA3IDE2LjYyMyA1LjY3MyAyOC43MzMtLjQxMyAyLjU4NS0uODI0IDUuMjQxLTEuMjQ1IDcuOTU5LTUuNzU2IDM3LjE5NC0xMi45MTkgODMuNDgzLTQ5Ljg3IDExNC42NjEtNC4yMjEgMy41NjEtNC43NTYgOS44Ny0xLjE5NCAxNC4wOTJhOS45OCA5Ljk4IDAgMCAwIDcuNjQ4IDMuNTUxIDkuOTU1IDkuOTU1IDAgMCAwIDYuNDQ0LTIuMzU4YzQyLjY3Mi0zNi4wMDUgNTAuODAyLTg4LjUzMyA1Ni43MzctMTI2Ljg4OC40MTUtMi42ODQuODIxLTUuMzA5IDEuMjI5LTcuODYzIDIuODM0LTE3LjcyMS0uNDU1LTMyLjY0MS05Ljc3Mi00NC4zNDV6bS0yMzIuMzA4IDQyLjYyYy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM2MwLTUuNTE0IDQuNDg2LTEwIDEwLTEwaDE1djIxLjMzM2gtMTV6bS0yLjUtNTIuNjY2YzAtNS41MTQgNC40ODYtMTAgMTAtMTBoNy41djIxLjMzM2gtNy41Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi0xLjMzM3ptMTcuNSA5My45OTloLTcuNWMtNS41MTQgMC0xMC00LjQ4Ni0xMC0xMHYtMS4zMzNjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGg3LjV2MjEuMzMzem0zMC43OTYgMjguODg3Yy01LjUxNCAwLTEwLTQuNDg2LTEwLTEwdi04LjI3MWg5MS40NTdjLS44NTEgNi42NjgtLjQzNyAxMi43ODcuNzMxIDE4LjI3MWgtODIuMTg4em03OS40ODItMTEzLjY5OGMtMy4xMjQgMjAuOTA2IDEyLjQyNyAzMy4xODQgMjEuNjI1IDM3LjA0IDUuNDQxIDIuOTY4IDcuNTUxIDUuNjQ3IDcuNzAxIDcuMTg4LjIxIDIuMTUtMi41NTMgNS42ODQtNC40NzcgNy4yNTEtLjQ4Mi4zNzgtLjkyOS44LTEuMzM1IDEuMjYxLTYuOTg3IDcuOTM2LTExLjk4MiAxNS41Mi0xNS40MzIgMjIuNjg4aC05Ny41NjRWMzBjMC01LjUxNCA0LjQ4Ni0xMCAxMC0xMGgxMjMuNzY5YzUuNTE0IDAgMTAgNC40ODYgMTAgMTB2MTM1LjU3OWMtMy4wMzItLjM4MS02LjE1LS42OTQtOS4zODktLjkxNC0yNS4xNTktMS42OTQtNDIuMzcgNy43NDgtNDQuODk4IDI0LjY2NnoiLz48cGF0aCBkPSJNMTc5LjEyOSA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXpNMTcyLjYyOSAxNDIuODZoLTEyLjU2VjEzMC44YTUgNSAwIDEgMC0xMCAwdjE3LjA2MWE1IDUgMCAwIDAgNSA1aDE3LjU2YTUgNSAwIDEgMCAwLTEwLjAwMXpNMjE2LjU2OCA4My4xNjdoLTI0LjA2YTUgNSAwIDAgMC01IDV2MjQuMDYxYTUgNSAwIDAgMCA1IDVoMjQuMDZhNSA1IDAgMCAwIDUtNVY4OC4xNjdhNSA1IDAgMCAwLTUtNXptLTUgMjQuMDYxaC0xNC4wNlY5My4xNjdoMTQuMDZ2MTQuMDYxek0yMTEuNjY5IDEyNS45MzZIMTk3LjQxYTUgNSAwIDAgMC01IDV2MTQuMjU3YTUgNSAwIDAgMCA1IDVoMTQuMjU5YTUgNSAwIDAgMCA1LTV2LTE0LjI1N2E1IDUgMCAwIDAtNS01eiIvPjwvc3ZnPg==",x3=I1+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA1OS4wMTggNTkuMDE4IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA1OS4wMTggNTkuMDE4IiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJtNTguNzQxIDU0LjgwOS01Ljk2OS02LjI0NGExMC43NCAxMC43NCAwIDAgMCAyLjgyLTcuMjVjMC01Ljk1My00Ljg0My0xMC43OTYtMTAuNzk2LTEwLjc5NlMzNCAzNS4zNjEgMzQgNDEuMzE0IDM4Ljg0MyA1Mi4xMSA0NC43OTYgNTIuMTFjMi40NDEgMCA0LjY4OC0uODI0IDYuNDk5LTIuMTk2bDYuMDAxIDYuMjc3YS45OTguOTk4IDAgMCAwIDEuNDE0LjAzMiAxIDEgMCAwIDAgLjAzMS0xLjQxNHpNMzYgNDEuMzE0YzAtNC44NSAzLjk0Ni04Ljc5NiA4Ljc5Ni04Ljc5NnM4Ljc5NiAzLjk0NiA4Ljc5NiA4Ljc5Ni0zLjk0NiA4Ljc5Ni04Ljc5NiA4Ljc5NlMzNiA0Ni4xNjQgMzYgNDEuMzE0ek0xMC40MzEgMTYuMDg4YzAgMy4wNyAyLjQ5OCA1LjU2OCA1LjU2OSA1LjU2OHM1LjU2OS0yLjQ5OCA1LjU2OS01LjU2OGMwLTMuMDcxLTIuNDk4LTUuNTY5LTUuNTY5LTUuNTY5cy01LjU2OSAyLjQ5OC01LjU2OSA1LjU2OXptOS4xMzggMGMwIDEuOTY4LTEuNjAyIDMuNTY4LTMuNTY5IDMuNTY4cy0zLjU2OS0xLjYwMS0zLjU2OS0zLjU2OCAxLjYwMi0zLjU2OSAzLjU2OS0zLjU2OSAzLjU2OSAxLjYwMSAzLjU2OSAzLjU2OXoiLz48cGF0aCBkPSJtMzAuODgyIDI4Ljk4NyA5LjE4LTEwLjA1NCAxMS4yNjIgMTAuMzIzYTEgMSAwIDAgMCAxLjM1MS0xLjQ3NWwtMTItMTFhMSAxIDAgMCAwLTEuNDE0LjA2M2wtOS43OTQgMTAuNzI3LTQuNzQzLTQuNzQzYTEuMDAzIDEuMDAzIDAgMCAwLTEuMzY4LS4wNDRMNi4zMzkgMzcuNzY4YTEgMSAwIDEgMCAxLjMyMiAxLjUwMWwxNi4zMTMtMTQuMzYyIDcuMzE5IDcuMzE4YS45OTkuOTk5IDAgMSAwIDEuNDE0LTEuNDE0bC0xLjgyNS0xLjgyNHoiLz48cGF0aCBkPSJNMzAgNDYuNTE4SDJ2LTQyaDU0djI4YTEgMSAwIDEgMCAyIDB2LTI5YTEgMSAwIDAgMC0xLTFIMWExIDEgMCAwIDAtMSAxdjQ0YTEgMSAwIDAgMCAxIDFoMjlhMSAxIDAgMSAwIDAtMnoiLz48L3N2Zz4=",ud=I1+"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA0NjAgNDYwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA0NjAgNDYwIiB4bWw6c3BhY2U9InByZXNlcnZlIj48cGF0aCBkPSJNMjMwIDBDMTAyLjk3NSAwIDAgMTAyLjk3NSAwIDIzMHMxMDIuOTc1IDIzMCAyMzAgMjMwIDIzMC0xMDIuOTc0IDIzMC0yMzBTMzU3LjAyNSAwIDIzMCAwem0zOC4zMzMgMzc3LjM2YzAgOC42NzYtNy4wMzQgMTUuNzEtMTUuNzEgMTUuNzFoLTQzLjEwMWMtOC42NzYgMC0xNS43MS03LjAzNC0xNS43MS0xNS43MVYyMDIuNDc3YzAtOC42NzYgNy4wMzMtMTUuNzEgMTUuNzEtMTUuNzFoNDMuMTAxYzguNjc2IDAgMTUuNzEgNy4wMzMgMTUuNzEgMTUuNzFWMzc3LjM2ek0yMzAgMTU3Yy0yMS41MzkgMC0zOS0xNy40NjEtMzktMzlzMTcuNDYxLTM5IDM5LTM5IDM5IDE3LjQ2MSAzOSAzOS0xNy40NjEgMzktMzkgMzl6Ii8+PC9zdmc+",m3="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAQgAAAEIBarqQRAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAE1SURBVDiNfdI7S0NBEAXgLya1otFgpbYSbISAgpXYi6CmiH9KCAiChaVga6OiWPgfRDQ+0itaGVNosXtluWwcuMzePfM4M3sq8lbHBubwg1dc4m1E/J/N4ghDPOIsfk/4xiEao5KX0McFljN4C9d4QTPXuY99jP3DsIoDPGM6BY5i5yI5R7O4q+ImFkJY2DCh3cAH2klyB+9J1xUMMAG7eCh1a+Mr+k48b5diXrFVwwLuS+BJ9MfR7+G0FHOHhTHhnXNWS87VDF4pcnfQK4Ep7XScNLmPTZgURNKKYENYWDpzW1BhscS1WHS8CDgURFJQrWcoF3c13KKbgg1BYQfy8xZWEzTTw1QZbAoKu8FqJnktdu5hcVSHmchiILzzuaDQvjBzV2m8yohCE1jHfPx/xhU+y4G/D75ELlRJsSYAAAAASUVORK5CYII=",cd=(function(){function f(){}return f.createDefault=function(){return{hasPermission:!1,lastUsedCameraId:null}},f})(),y3=(function(){function f(){this.data=cd.createDefault();var g=localStorage.getItem(f.LOCAL_STORAGE_KEY);g?this.data=JSON.parse(g):this.reset()}return f.prototype.hasCameraPermissions=function(){return this.data.hasPermission},f.prototype.getLastUsedCameraId=function(){return this.data.lastUsedCameraId},f.prototype.setHasPermission=function(g){this.data.hasPermission=g,this.flush()},f.prototype.setLastUsedCameraId=function(g){this.data.lastUsedCameraId=g,this.flush()},f.prototype.resetLastUsedCameraId=function(){this.data.lastUsedCameraId=null,this.flush()},f.prototype.reset=function(){this.data=cd.createDefault(),this.flush()},f.prototype.flush=function(){localStorage.setItem(f.LOCAL_STORAGE_KEY,JSON.stringify(this.data))},f.LOCAL_STORAGE_KEY="HTML5_QRCODE_DATA",f})(),p3=(function(){function f(){this.infoDiv=document.createElement("div")}return f.prototype.renderInto=function(g){this.infoDiv.style.position="absolute",this.infoDiv.style.top="10px",this.infoDiv.style.right="10px",this.infoDiv.style.zIndex="2",this.infoDiv.style.display="none",this.infoDiv.style.padding="5pt",this.infoDiv.style.border="1px solid #171717",this.infoDiv.style.fontSize="10pt",this.infoDiv.style.background="rgb(0 0 0 / 69%)",this.infoDiv.style.borderRadius="5px",this.infoDiv.style.textAlign="center",this.infoDiv.style.fontWeight="400",this.infoDiv.style.color="white",this.infoDiv.innerText=ed.poweredBy();var d=document.createElement("a");d.innerText="ScanApp",d.href="https://scanapp.org",d.target="new",d.style.color="white",this.infoDiv.appendChild(d);var y=document.createElement("br"),C=document.createElement("br");this.infoDiv.appendChild(y),this.infoDiv.appendChild(C);var E=document.createElement("a");E.innerText=ed.reportIssues(),E.href="https://github.com/mebjas/html5-qrcode/issues",E.target="new",E.style.color="white",this.infoDiv.appendChild(E),g.appendChild(this.infoDiv)},f.prototype.show=function(){this.infoDiv.style.display="block"},f.prototype.hide=function(){this.infoDiv.style.display="none"},f})(),A3=(function(){function f(g,d){this.isShowingInfoIcon=!0,this.onTapIn=g,this.onTapOut=d,this.infoIcon=document.createElement("img")}return f.prototype.renderInto=function(g){var d=this;this.infoIcon.alt="Info icon",this.infoIcon.src=ud,this.infoIcon.style.position="absolute",this.infoIcon.style.top="4px",this.infoIcon.style.right="4px",this.infoIcon.style.opacity="0.6",this.infoIcon.style.cursor="pointer",this.infoIcon.style.zIndex="2",this.infoIcon.style.width="16px",this.infoIcon.style.height="16px",this.infoIcon.onmouseover=function(y){return d.onHoverIn()},this.infoIcon.onmouseout=function(y){return d.onHoverOut()},this.infoIcon.onclick=function(y){return d.onClick()},g.appendChild(this.infoIcon)},f.prototype.onHoverIn=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="1")},f.prototype.onHoverOut=function(){this.isShowingInfoIcon&&(this.infoIcon.style.opacity="0.6")},f.prototype.onClick=function(){this.isShowingInfoIcon?(this.isShowingInfoIcon=!1,this.onTapIn(),this.infoIcon.src=m3,this.infoIcon.style.opacity="1"):(this.isShowingInfoIcon=!0,this.onTapOut(),this.infoIcon.src=ud,this.infoIcon.style.opacity="0.6")},f})(),E3=(function(){function f(){var g=this;this.infoDiv=new p3,this.infoIcon=new A3(function(){g.infoDiv.show()},function(){g.infoDiv.hide()})}return f.prototype.renderInto=function(g){this.infoDiv.renderInto(g),this.infoIcon.renderInto(g)},f})(),C3=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},w3=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},fd=(function(){function f(){}return f.hasPermissions=function(){return C3(this,void 0,void 0,function(){var g,d,y,C;return w3(this,function(E){switch(E.label){case 0:return[4,navigator.mediaDevices.enumerateDevices()];case 1:for(g=E.sent(),d=0,y=g;d<y.length;d++)if(C=y[d],C.kind==="videoinput"&&C.label)return[2,!0];return[2,!1]}})})},f})(),hr=(function(){function f(g){this.supportedScanTypes=this.validateAndReturnScanTypes(g)}return f.prototype.getDefaultScanType=function(){return this.supportedScanTypes[0]},f.prototype.hasMoreThanOneScanType=function(){return this.supportedScanTypes.length>1},f.prototype.isCameraScanRequired=function(){for(var g=0,d=this.supportedScanTypes;g<d.length;g++){var y=d[g];if(f.isCameraScanType(y))return!0}return!1},f.isCameraScanType=function(g){return g===dr.SCAN_TYPE_CAMERA},f.isFileScanType=function(g){return g===dr.SCAN_TYPE_FILE},f.prototype.validateAndReturnScanTypes=function(g){if(!g||g.length===0)return Fi.DEFAULT_SUPPORTED_SCAN_TYPE;var d=Fi.DEFAULT_SUPPORTED_SCAN_TYPE.length;if(g.length>d)throw"Max ".concat(d," values expected for ")+"supportedScanTypes";for(var y=0,C=g;y<C.length;y++){var E=C[y];if(!Fi.DEFAULT_SUPPORTED_SCAN_TYPE.includes(E))throw"Unsupported scan type ".concat(E)}return g},f})(),di=(function(){function f(){}return f.ALL_ELEMENT_CLASS="html5-qrcode-element",f.CAMERA_PERMISSION_BUTTON_ID="html5-qrcode-button-camera-permission",f.CAMERA_START_BUTTON_ID="html5-qrcode-button-camera-start",f.CAMERA_STOP_BUTTON_ID="html5-qrcode-button-camera-stop",f.TORCH_BUTTON_ID="html5-qrcode-button-torch",f.CAMERA_SELECTION_SELECT_ID="html5-qrcode-select-camera",f.FILE_SELECTION_BUTTON_ID="html5-qrcode-button-file-selection",f.ZOOM_SLIDER_ID="html5-qrcode-input-range-zoom",f.SCAN_TYPE_CHANGE_ANCHOR_ID="html5-qrcode-anchor-scan-type-change",f.TORCH_BUTTON_CLASS_TORCH_ON="html5-qrcode-button-torch-on",f.TORCH_BUTTON_CLASS_TORCH_OFF="html5-qrcode-button-torch-off",f})(),ba=(function(){function f(){}return f.createElement=function(g,d){var y=document.createElement(g);return y.id=d,y.classList.add(di.ALL_ELEMENT_CLASS),g==="button"&&y.setAttribute("type","button"),y},f})(),Kd=function(f,g,d,y){function C(E){return E instanceof d?E:new d(function(O){O(E)})}return new(d||(d=Promise))(function(E,O){function R(N){try{A(y.next(N))}catch(M){O(M)}}function b(N){try{A(y.throw(N))}catch(M){O(M)}}function A(N){N.done?E(N.value):C(N.value).then(R,b)}A((y=y.apply(f,g||[])).next())})},Jd=function(f,g){var d={label:0,sent:function(){if(E[0]&1)throw E[1];return E[1]},trys:[],ops:[]},y,C,E,O;return O={next:R(0),throw:R(1),return:R(2)},typeof Symbol=="function"&&(O[Symbol.iterator]=function(){return this}),O;function R(A){return function(N){return b([A,N])}}function b(A){if(y)throw new TypeError("Generator is already executing.");for(;O&&(O=0,A[0]&&(d=0)),d;)try{if(y=1,C&&(E=A[0]&2?C.return:A[0]?C.throw||((E=C.return)&&E.call(C),0):C.next)&&!(E=E.call(C,A[1])).done)return E;switch(C=0,E&&(A=[A[0]&2,E.value]),A[0]){case 0:case 1:E=A;break;case 4:return d.label++,{value:A[1],done:!1};case 5:d.label++,C=A[1],A=[0];continue;case 7:A=d.ops.pop(),d.trys.pop();continue;default:if(E=d.trys,!(E=E.length>0&&E[E.length-1])&&(A[0]===6||A[0]===2)){d=0;continue}if(A[0]===3&&(!E||A[1]>E[0]&&A[1]<E[3])){d.label=A[1];break}if(A[0]===6&&d.label<E[1]){d.label=E[1],E=A;break}if(E&&d.label<E[2]){d.label=E[2],d.ops.push(A);break}E[2]&&d.ops.pop(),d.trys.pop();continue}A=g.call(f,d)}catch(N){A=[6,N],C=0}finally{y=E=0}if(A[0]&5)throw A[1];return{value:A[0]?A[1]:void 0,done:!0}}},hd=(function(){function f(g,d,y){this.isTorchOn=!1,this.torchCapability=g,this.buttonController=d,this.onTorchActionFailureCallback=y}return f.prototype.isTorchEnabled=function(){return this.isTorchOn},f.prototype.flipState=function(){return Kd(this,void 0,void 0,function(){var g,d;return Jd(this,function(y){switch(y.label){case 0:this.buttonController.disable(),g=!this.isTorchOn,y.label=1;case 1:return y.trys.push([1,3,,4]),[4,this.torchCapability.apply(g)];case 2:return y.sent(),this.updateUiBasedOnLatestSettings(this.torchCapability.value(),g),[3,4];case 3:return d=y.sent(),this.propagateFailure(g,d),this.buttonController.enable(),[3,4];case 4:return[2]}})})},f.prototype.updateUiBasedOnLatestSettings=function(g,d){g===d?(this.buttonController.setText(d?Mt.torchOffButton():Mt.torchOnButton()),this.isTorchOn=d):this.propagateFailure(d),this.buttonController.enable()},f.prototype.propagateFailure=function(g,d){var y=g?Mt.torchOnFailedMessage():Mt.torchOffFailedMessage();d&&(y+="; Error = "+d),this.onTorchActionFailureCallback(y)},f.prototype.reset=function(){this.isTorchOn=!1},f})(),S3=(function(){function f(g,d){this.onTorchActionFailureCallback=d,this.torchButton=ba.createElement("button",di.TORCH_BUTTON_ID),this.torchController=new hd(g,this,d)}return f.prototype.render=function(g,d){var y=this;this.torchButton.innerText=Mt.torchOnButton(),this.torchButton.style.display=d.display,this.torchButton.style.marginLeft=d.marginLeft;var C=this;this.torchButton.addEventListener("click",function(E){return Kd(y,void 0,void 0,function(){return Jd(this,function(O){switch(O.label){case 0:return[4,C.torchController.flipState()];case 1:return O.sent(),C.torchController.isTorchEnabled()?(C.torchButton.classList.remove(di.TORCH_BUTTON_CLASS_TORCH_OFF),C.torchButton.classList.add(di.TORCH_BUTTON_CLASS_TORCH_ON)):(C.torchButton.classList.remove(di.TORCH_BUTTON_CLASS_TORCH_ON),C.torchButton.classList.add(di.TORCH_BUTTON_CLASS_TORCH_OFF)),[2]}})})}),g.appendChild(this.torchButton)},f.prototype.updateTorchCapability=function(g){this.torchController=new hd(g,this,this.onTorchActionFailureCallback)},f.prototype.getTorchButton=function(){return this.torchButton},f.prototype.hide=function(){this.torchButton.style.display="none"},f.prototype.show=function(){this.torchButton.style.display="inline-block"},f.prototype.disable=function(){this.torchButton.disabled=!0},f.prototype.enable=function(){this.torchButton.disabled=!1},f.prototype.setText=function(g){this.torchButton.innerText=g},f.prototype.reset=function(){this.torchButton.innerText=Mt.torchOnButton(),this.torchController.reset()},f.create=function(g,d,y,C){var E=new f(d,C);return E.render(g,y),E},f})(),b3=(function(){function f(g,d,y){this.fileBasedScanRegion=this.createFileBasedScanRegion(),this.fileBasedScanRegion.style.display=d?"block":"none",g.appendChild(this.fileBasedScanRegion);var C=document.createElement("label");C.setAttribute("for",this.getFileScanInputId()),C.style.display="inline-block",this.fileBasedScanRegion.appendChild(C),this.fileSelectionButton=ba.createElement("button",di.FILE_SELECTION_BUTTON_ID),this.setInitialValueToButton(),this.fileSelectionButton.addEventListener("click",function(R){C.click()}),C.append(this.fileSelectionButton),this.fileScanInput=ba.createElement("input",this.getFileScanInputId()),this.fileScanInput.type="file",this.fileScanInput.accept="image/*",this.fileScanInput.style.display="none",C.appendChild(this.fileScanInput);var E=this;this.fileScanInput.addEventListener("change",function(R){if(!(R==null||R.target==null)){var b=R.target;if(!(b.files&&b.files.length===0)){var A=b.files,N=A[0],M=N.name;E.setImageNameToButton(M),y(N)}}});var O=this.createDragAndDropMessage();this.fileBasedScanRegion.appendChild(O),this.fileBasedScanRegion.addEventListener("dragenter",function(R){E.fileBasedScanRegion.style.border=E.fileBasedScanRegionActiveBorder(),R.stopPropagation(),R.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragleave",function(R){E.fileBasedScanRegion.style.border=E.fileBasedScanRegionDefaultBorder(),R.stopPropagation(),R.preventDefault()}),this.fileBasedScanRegion.addEventListener("dragover",function(R){E.fileBasedScanRegion.style.border=E.fileBasedScanRegionActiveBorder(),R.stopPropagation(),R.preventDefault()}),this.fileBasedScanRegion.addEventListener("drop",function(R){R.stopPropagation(),R.preventDefault(),E.fileBasedScanRegion.style.border=E.fileBasedScanRegionDefaultBorder();var b=R.dataTransfer;if(b){var A=b.files;if(!A||A.length===0)return;for(var N=!1,M=0;M<A.length;++M){var H=A.item(M);if(H){var Z=/image.*/;if(H.type.match(Z)){N=!0;var ee=H.name;E.setImageNameToButton(ee),y(H),O.innerText=Mt.dragAndDropMessage();break}}}N||(O.innerText=Mt.dragAndDropMessageOnlyImages())}})}return f.prototype.hide=function(){this.fileBasedScanRegion.style.display="none",this.fileScanInput.disabled=!0},f.prototype.show=function(){this.fileBasedScanRegion.style.display="block",this.fileScanInput.disabled=!1},f.prototype.isShowing=function(){return this.fileBasedScanRegion.style.display==="block"},f.prototype.resetValue=function(){this.fileScanInput.value="",this.setInitialValueToButton()},f.prototype.createFileBasedScanRegion=function(){var g=document.createElement("div");return g.style.textAlign="center",g.style.margin="auto",g.style.width="80%",g.style.maxWidth="600px",g.style.border=this.fileBasedScanRegionDefaultBorder(),g.style.padding="10px",g.style.marginBottom="10px",g},f.prototype.fileBasedScanRegionDefaultBorder=function(){return"6px dashed #ebebeb"},f.prototype.fileBasedScanRegionActiveBorder=function(){return"6px dashed rgb(153 151 151)"},f.prototype.createDragAndDropMessage=function(){var g=document.createElement("div");return g.innerText=Mt.dragAndDropMessage(),g.style.fontWeight="400",g},f.prototype.setImageNameToButton=function(g){var d=20;if(g.length>d){var y=g.substring(0,8),C=g.length,E=g.substring(C-8,C);g="".concat(y,"....").concat(E)}var O=Mt.fileSelectionChooseAnother()+" - "+g;this.fileSelectionButton.innerText=O},f.prototype.setInitialValueToButton=function(){var g=Mt.fileSelectionChooseImage()+" - "+Mt.fileSelectionNoImageSelected();this.fileSelectionButton.innerText=g},f.prototype.getFileScanInputId=function(){return"html5-qrcode-private-filescan-input"},f.create=function(g,d,y){var C=new f(g,d,y);return C},f})(),T3=(function(){function f(g){this.selectElement=ba.createElement("select",di.CAMERA_SELECTION_SELECT_ID),this.cameras=g,this.options=[]}return f.prototype.render=function(g){var d=document.createElement("span");d.style.marginRight="10px";var y=this.cameras.length;if(y===0)throw new Error("No cameras found");if(y===1)d.style.display="none";else{var C=Mt.selectCamera();d.innerText="".concat(C," (").concat(this.cameras.length,") ")}for(var E=1,O=0,R=this.cameras;O<R.length;O++){var b=R[O],A=b.id,N=b.label==null?A:b.label;(!N||N==="")&&(N=[Mt.anonymousCameraPrefix(),E++].join(" "));var M=document.createElement("option");M.value=A,M.innerText=N,this.options.push(M),this.selectElement.appendChild(M)}d.appendChild(this.selectElement),g.appendChild(d)},f.prototype.disable=function(){this.selectElement.disabled=!0},f.prototype.isDisabled=function(){return this.selectElement.disabled===!0},f.prototype.enable=function(){this.selectElement.disabled=!1},f.prototype.getValue=function(){return this.selectElement.value},f.prototype.hasValue=function(g){for(var d=0,y=this.options;d<y.length;d++){var C=y[d];if(C.value===g)return!0}return!1},f.prototype.setValue=function(g){if(!this.hasValue(g))throw new Error("".concat(g," is not present in the camera list."));this.selectElement.value=g},f.prototype.hasSingleItem=function(){return this.cameras.length===1},f.prototype.numCameras=function(){return this.cameras.length},f.create=function(g,d){var y=new f(d);return y.render(g),y},f})(),v3=(function(){function f(){this.onChangeCallback=null,this.zoomElementContainer=document.createElement("div"),this.rangeInput=ba.createElement("input",di.ZOOM_SLIDER_ID),this.rangeInput.type="range",this.rangeText=document.createElement("span"),this.rangeInput.min="1",this.rangeInput.max="5",this.rangeInput.value="1",this.rangeInput.step="0.1"}return f.prototype.render=function(g,d){this.zoomElementContainer.style.display=d?"block":"none",this.zoomElementContainer.style.padding="5px 10px",this.zoomElementContainer.style.textAlign="center",g.appendChild(this.zoomElementContainer),this.rangeInput.style.display="inline-block",this.rangeInput.style.width="50%",this.rangeInput.style.height="5px",this.rangeInput.style.background="#d3d3d3",this.rangeInput.style.outline="none",this.rangeInput.style.opacity="0.7";var y=Mt.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(y),this.rangeText.style.marginRight="10px";var C=this;this.rangeInput.addEventListener("input",function(){return C.onValueChange()}),this.rangeInput.addEventListener("change",function(){return C.onValueChange()}),this.zoomElementContainer.appendChild(this.rangeInput),this.zoomElementContainer.appendChild(this.rangeText)},f.prototype.onValueChange=function(){var g=Mt.zoom();this.rangeText.innerText="".concat(this.rangeInput.value,"x ").concat(g),this.onChangeCallback&&this.onChangeCallback(parseFloat(this.rangeInput.value))},f.prototype.setValues=function(g,d,y,C){this.rangeInput.min=g.toString(),this.rangeInput.max=d.toString(),this.rangeInput.step=C.toString(),this.rangeInput.value=y.toString(),this.onValueChange()},f.prototype.show=function(){this.zoomElementContainer.style.display="block"},f.prototype.hide=function(){this.zoomElementContainer.style.display="none"},f.prototype.setOnCameraZoomValueChangeCallback=function(g){this.onChangeCallback=g},f.prototype.removeOnCameraZoomValueChangeCallback=function(){this.onChangeCallback=null},f.create=function(g,d){var y=new f;return y.render(g,d),y},f})(),hi;(function(f){f[f.STATUS_DEFAULT=0]="STATUS_DEFAULT",f[f.STATUS_SUCCESS=1]="STATUS_SUCCESS",f[f.STATUS_WARNING=2]="STATUS_WARNING",f[f.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(hi||(hi={}));function N3(f){return{fps:f.fps,qrbox:f.qrbox,aspectRatio:f.aspectRatio,disableFlip:f.disableFlip,videoConstraints:f.videoConstraints}}function M3(f,g){return{formatsToSupport:f.formatsToSupport,useBarCodeDetectorIfSupported:f.useBarCodeDetectorIfSupported,experimentalFeatures:f.experimentalFeatures,verbose:g}}var I3=(function(){function f(g,d,y){if(this.lastMatchFound=null,this.cameraScanImage=null,this.fileScanImage=null,this.fileSelectionUi=null,this.elementId=g,this.config=this.createConfig(d),this.verbose=y===!0,!document.getElementById(g))throw"HTML Element with id=".concat(g," not found");this.scanTypeSelector=new hr(this.config.supportedScanTypes),this.currentScanType=this.scanTypeSelector.getDefaultScanType(),this.sectionSwapAllowed=!0,this.logger=new Qd(this.verbose),this.persistedDataManager=new y3,d.rememberLastUsedCamera!==!0&&this.persistedDataManager.reset()}return f.prototype.render=function(g,d){var y=this;this.lastMatchFound=null,this.qrCodeSuccessCallback=function(E,O){if(g)g(E,O);else{if(y.lastMatchFound===E)return;y.lastMatchFound=E,y.setHeaderMessage(Mt.lastMatch(E),hi.STATUS_SUCCESS)}},this.qrCodeErrorCallback=function(E,O){d&&d(E,O)};var C=document.getElementById(this.elementId);if(!C)throw"HTML Element with id=".concat(this.elementId," not found");C.innerHTML="",this.createBasicLayout(C),this.html5Qrcode=new od(this.getScanRegionId(),M3(this.config,this.verbose))},f.prototype.pause=function(g){(ea(g)||g!==!0)&&(g=!1),this.getHtml5QrcodeOrFail().pause(g)},f.prototype.resume=function(){this.getHtml5QrcodeOrFail().resume()},f.prototype.getState=function(){return this.getHtml5QrcodeOrFail().getState()},f.prototype.clear=function(){var g=this,d=function(){var y=document.getElementById(g.elementId);y&&(y.innerHTML="",g.resetBasicLayout(y))};return this.html5Qrcode?new Promise(function(y,C){if(!g.html5Qrcode){y();return}g.html5Qrcode.isScanning?g.html5Qrcode.stop().then(function(E){if(!g.html5Qrcode){y();return}g.html5Qrcode.clear(),d(),y()}).catch(function(E){g.verbose&&g.logger.logError("Unable to stop qrcode scanner",E),C(E)}):(g.html5Qrcode.clear(),d(),y())}):Promise.resolve()},f.prototype.getRunningTrackCapabilities=function(){return this.getHtml5QrcodeOrFail().getRunningTrackCapabilities()},f.prototype.getRunningTrackSettings=function(){return this.getHtml5QrcodeOrFail().getRunningTrackSettings()},f.prototype.applyVideoConstraints=function(g){return this.getHtml5QrcodeOrFail().applyVideoConstraints(g)},f.prototype.getHtml5QrcodeOrFail=function(){if(!this.html5Qrcode)throw"Code scanner not initialized.";return this.html5Qrcode},f.prototype.createConfig=function(g){return g?(g.fps||(g.fps=Fi.SCAN_DEFAULT_FPS),g.rememberLastUsedCamera!==!Fi.DEFAULT_REMEMBER_LAST_CAMERA_USED&&(g.rememberLastUsedCamera=Fi.DEFAULT_REMEMBER_LAST_CAMERA_USED),g.supportedScanTypes||(g.supportedScanTypes=Fi.DEFAULT_SUPPORTED_SCAN_TYPE),g):{fps:Fi.SCAN_DEFAULT_FPS,rememberLastUsedCamera:Fi.DEFAULT_REMEMBER_LAST_CAMERA_USED,supportedScanTypes:Fi.DEFAULT_SUPPORTED_SCAN_TYPE}},f.prototype.createBasicLayout=function(g){g.style.position="relative",g.style.padding="0px",g.style.border="1px solid silver",this.createHeader(g);var d=document.createElement("div"),y=this.getScanRegionId();d.id=y,d.style.width="100%",d.style.minHeight="100px",d.style.textAlign="center",g.appendChild(d),hr.isCameraScanType(this.currentScanType)?this.insertCameraScanImageToScanRegion():this.insertFileScanImageToScanRegion();var C=document.createElement("div"),E=this.getDashboardId();C.id=E,C.style.width="100%",g.appendChild(C),this.setupInitialDashboard(C)},f.prototype.resetBasicLayout=function(g){g.style.border="none"},f.prototype.setupInitialDashboard=function(g){this.createSection(g),this.createSectionControlPanel(),this.scanTypeSelector.hasMoreThanOneScanType()&&this.createSectionSwap()},f.prototype.createHeader=function(g){var d=document.createElement("div");d.style.textAlign="left",d.style.margin="0px",g.appendChild(d);var y=new E3;y.renderInto(d);var C=document.createElement("div");C.id=this.getHeaderMessageContainerId(),C.style.display="none",C.style.textAlign="center",C.style.fontSize="14px",C.style.padding="2px 10px",C.style.margin="4px",C.style.borderTop="1px solid #f6f6f6",d.appendChild(C)},f.prototype.createSection=function(g){var d=document.createElement("div");d.id=this.getDashboardSectionId(),d.style.width="100%",d.style.padding="10px 0px 10px 0px",d.style.textAlign="left",g.appendChild(d)},f.prototype.createCameraListUi=function(g,d,y){var C=this;C.showHideScanTypeSwapLink(!1),C.setHeaderMessage(Mt.cameraPermissionRequesting());var E=function(){y||C.createPermissionButton(g,d)};od.getCameras().then(function(O){C.persistedDataManager.setHasPermission(!0),C.showHideScanTypeSwapLink(!0),C.resetHeaderMessage(),O&&O.length>0?(g.removeChild(d),C.renderCameraSelection(O)):(C.setHeaderMessage(Mt.noCameraFound(),hi.STATUS_WARNING),E())}).catch(function(O){C.persistedDataManager.setHasPermission(!1),y?y.disabled=!1:E(),C.setHeaderMessage(O,hi.STATUS_WARNING),C.showHideScanTypeSwapLink(!0)})},f.prototype.createPermissionButton=function(g,d){var y=this,C=ba.createElement("button",this.getCameraPermissionButtonId());C.innerText=Mt.cameraPermissionTitle(),C.addEventListener("click",function(){C.disabled=!0,y.createCameraListUi(g,d,C)}),d.appendChild(C)},f.prototype.createPermissionsUi=function(g,d){var y=this;if(hr.isCameraScanType(this.currentScanType)&&this.persistedDataManager.hasCameraPermissions()){fd.hasPermissions().then(function(C){C?y.createCameraListUi(g,d):(y.persistedDataManager.setHasPermission(!1),y.createPermissionButton(g,d))}).catch(function(C){y.persistedDataManager.setHasPermission(!1),y.createPermissionButton(g,d)});return}this.createPermissionButton(g,d)},f.prototype.createSectionControlPanel=function(){var g=document.getElementById(this.getDashboardSectionId()),d=document.createElement("div");g.appendChild(d);var y=document.createElement("div");y.id=this.getDashboardSectionCameraScanRegionId(),y.style.display=hr.isCameraScanType(this.currentScanType)?"block":"none",d.appendChild(y);var C=document.createElement("div");C.style.textAlign="center",y.appendChild(C),this.scanTypeSelector.isCameraScanRequired()&&this.createPermissionsUi(y,C),this.renderFileScanUi(d)},f.prototype.renderFileScanUi=function(g){var d=hr.isFileScanType(this.currentScanType),y=this,C=function(E){if(!y.html5Qrcode)throw"html5Qrcode not defined";hr.isFileScanType(y.currentScanType)&&(y.setHeaderMessage(Mt.loadingImage()),y.html5Qrcode.scanFileV2(E,!0).then(function(O){y.resetHeaderMessage(),y.qrCodeSuccessCallback(O.decodedText,O)}).catch(function(O){y.setHeaderMessage(O,hi.STATUS_WARNING),y.qrCodeErrorCallback(O,Zd.createFrom(O))}))};this.fileSelectionUi=b3.create(g,d,C)},f.prototype.renderCameraSelection=function(g){var d=this,y=this,C=document.getElementById(this.getDashboardSectionCameraScanRegionId());C.style.textAlign="center";var E=v3.create(C,!1),O=function(ie){var ae=ie.zoomFeature();if(ae.isSupported()){E.setOnCameraZoomValueChangeCallback(function(de){ae.apply(de)});var pe=1;d.config.defaultZoomValueIfSupported&&(pe=d.config.defaultZoomValueIfSupported),pe=Vm(pe,ae.min(),ae.max()),E.setValues(ae.min(),ae.max(),pe,ae.step()),E.show()}},R=T3.create(C,g),b=document.createElement("span"),A=ba.createElement("button",di.CAMERA_START_BUTTON_ID);A.innerText=Mt.scanButtonStartScanningText(),b.appendChild(A);var N=ba.createElement("button",di.CAMERA_STOP_BUTTON_ID);N.innerText=Mt.scanButtonStopScanningText(),N.style.display="none",N.disabled=!0,b.appendChild(N);var M,H=function(ie){if(!ie.torchFeature().isSupported()){M&&M.hide();return}M?M.updateTorchCapability(ie.torchFeature()):M=S3.create(b,ie.torchFeature(),{display:"none",marginLeft:"5px"},function(ae){y.setHeaderMessage(ae,hi.STATUS_WARNING)}),M.show()};C.appendChild(b);var Z=function(ie){ie||(A.style.display="none"),A.innerText=Mt.scanButtonStartScanningText(),A.style.opacity="1",A.disabled=!1,ie&&(A.style.display="inline-block")};if(A.addEventListener("click",function(ie){A.innerText=Mt.scanButtonScanningStarting(),R.disable(),A.disabled=!0,A.style.opacity="0.5",d.scanTypeSelector.hasMoreThanOneScanType()&&y.showHideScanTypeSwapLink(!1),y.resetHeaderMessage();var ae=R.getValue();y.persistedDataManager.setLastUsedCameraId(ae),y.html5Qrcode.start(ae,N3(y.config),y.qrCodeSuccessCallback,y.qrCodeErrorCallback).then(function(pe){N.disabled=!1,N.style.display="inline-block",Z(!1);var de=y.html5Qrcode.getRunningTrackCameraCapabilities();d.config.showTorchButtonIfSupported===!0&&H(de),d.config.showZoomSliderIfSupported===!0&&O(de)}).catch(function(pe){y.showHideScanTypeSwapLink(!0),R.enable(),Z(!0),y.setHeaderMessage(pe,hi.STATUS_WARNING)})}),R.hasSingleItem()&&A.click(),N.addEventListener("click",function(ie){if(!y.html5Qrcode)throw"html5Qrcode not defined";N.disabled=!0,y.html5Qrcode.stop().then(function(ae){d.scanTypeSelector.hasMoreThanOneScanType()&&y.showHideScanTypeSwapLink(!0),R.enable(),A.disabled=!1,N.style.display="none",A.style.display="inline-block",M&&(M.reset(),M.hide()),E.removeOnCameraZoomValueChangeCallback(),E.hide(),y.insertCameraScanImageToScanRegion()}).catch(function(ae){N.disabled=!1,y.setHeaderMessage(ae,hi.STATUS_WARNING)})}),y.persistedDataManager.getLastUsedCameraId()){var ee=y.persistedDataManager.getLastUsedCameraId();R.hasValue(ee)?(R.setValue(ee),A.click()):y.persistedDataManager.resetLastUsedCameraId()}},f.prototype.createSectionSwap=function(){var g=this,d=Mt.textIfCameraScanSelected(),y=Mt.textIfFileScanSelected(),C=document.getElementById(this.getDashboardSectionId()),E=document.createElement("div");E.style.textAlign="center";var O=ba.createElement("span",this.getDashboardSectionSwapLinkId());O.style.textDecoration="underline",O.style.cursor="pointer",O.innerText=hr.isCameraScanType(this.currentScanType)?d:y,O.addEventListener("click",function(){if(!g.sectionSwapAllowed){g.verbose&&g.logger.logError("Section swap called when not allowed");return}g.resetHeaderMessage(),g.fileSelectionUi.resetValue(),g.sectionSwapAllowed=!1,hr.isCameraScanType(g.currentScanType)?(g.clearScanRegion(),g.getCameraScanRegion().style.display="none",g.fileSelectionUi.show(),O.innerText=y,g.currentScanType=dr.SCAN_TYPE_FILE,g.insertFileScanImageToScanRegion()):(g.clearScanRegion(),g.getCameraScanRegion().style.display="block",g.fileSelectionUi.hide(),O.innerText=d,g.currentScanType=dr.SCAN_TYPE_CAMERA,g.insertCameraScanImageToScanRegion(),g.startCameraScanIfPermissionExistsOnSwap()),g.sectionSwapAllowed=!0}),E.appendChild(O),C.appendChild(E)},f.prototype.startCameraScanIfPermissionExistsOnSwap=function(){var g=this,d=this;if(this.persistedDataManager.hasCameraPermissions()){fd.hasPermissions().then(function(y){if(y){var C=document.getElementById(d.getCameraPermissionButtonId());if(!C)throw g.logger.logError("Permission button not found, fail;"),"Permission button not found";C.click()}else d.persistedDataManager.setHasPermission(!1)}).catch(function(y){d.persistedDataManager.setHasPermission(!1)});return}},f.prototype.resetHeaderMessage=function(){var g=document.getElementById(this.getHeaderMessageContainerId());g.style.display="none"},f.prototype.setHeaderMessage=function(g,d){d||(d=hi.STATUS_DEFAULT);var y=this.getHeaderMessageDiv();switch(y.innerText=g,y.style.display="block",d){case hi.STATUS_SUCCESS:y.style.background="rgba(106, 175, 80, 0.26)",y.style.color="#477735";break;case hi.STATUS_WARNING:y.style.background="rgba(203, 36, 49, 0.14)",y.style.color="#cb2431";break;case hi.STATUS_DEFAULT:default:y.style.background="rgba(0, 0, 0, 0)",y.style.color="rgb(17, 17, 17)";break}},f.prototype.showHideScanTypeSwapLink=function(g){this.scanTypeSelector.hasMoreThanOneScanType()&&(g!==!0&&(g=!1),this.sectionSwapAllowed=g,this.getDashboardSectionSwapLink().style.display=g?"inline-block":"none")},f.prototype.insertCameraScanImageToScanRegion=function(){var g=this,d=document.getElementById(this.getScanRegionId());if(this.cameraScanImage){d.innerHTML="<br>",d.appendChild(this.cameraScanImage);return}this.cameraScanImage=new Image,this.cameraScanImage.onload=function(y){d.innerHTML="<br>",d.appendChild(g.cameraScanImage)},this.cameraScanImage.width=64,this.cameraScanImage.style.opacity="0.8",this.cameraScanImage.src=g3,this.cameraScanImage.alt=Mt.cameraScanAltText()},f.prototype.insertFileScanImageToScanRegion=function(){var g=this,d=document.getElementById(this.getScanRegionId());if(this.fileScanImage){d.innerHTML="<br>",d.appendChild(this.fileScanImage);return}this.fileScanImage=new Image,this.fileScanImage.onload=function(y){d.innerHTML="<br>",d.appendChild(g.fileScanImage)},this.fileScanImage.width=64,this.fileScanImage.style.opacity="0.8",this.fileScanImage.src=x3,this.fileScanImage.alt=Mt.fileScanAltText()},f.prototype.clearScanRegion=function(){var g=document.getElementById(this.getScanRegionId());g.innerHTML=""},f.prototype.getDashboardSectionId=function(){return"".concat(this.elementId,"__dashboard_section")},f.prototype.getDashboardSectionCameraScanRegionId=function(){return"".concat(this.elementId,"__dashboard_section_csr")},f.prototype.getDashboardSectionSwapLinkId=function(){return di.SCAN_TYPE_CHANGE_ANCHOR_ID},f.prototype.getScanRegionId=function(){return"".concat(this.elementId,"__scan_region")},f.prototype.getDashboardId=function(){return"".concat(this.elementId,"__dashboard")},f.prototype.getHeaderMessageContainerId=function(){return"".concat(this.elementId,"__header_message")},f.prototype.getCameraPermissionButtonId=function(){return di.CAMERA_PERMISSION_BUTTON_ID},f.prototype.getCameraScanRegion=function(){return document.getElementById(this.getDashboardSectionCameraScanRegionId())},f.prototype.getDashboardSectionSwapLink=function(){return document.getElementById(this.getDashboardSectionSwapLinkId())},f.prototype.getHeaderMessageDiv=function(){return document.getElementById(this.getHeaderMessageContainerId())},f})();const O3=()=>{const[f,g]=te.useState(null);te.useEffect(()=>{if(f)return;const y=new I3("reader",{fps:10,qrbox:{width:250,height:250}},!1);return y.render(async C=>{try{y.clear();const E=JSON.parse(C),R=(await Dd("default-event")).find(b=>b.id===E.id);if(R)if(R.status==="valid"){const b=await _m(R.id,"used");g({success:!0,message:"Ticket Valid! Access Granted.",ticket:b})}else g({success:!1,message:"Ticket already used!",ticket:R});else g({success:!1,message:"Invalid Ticket ID"})}catch(E){console.error(E),g({success:!1,message:"Scan Error: Invalid QR code."})}},()=>{}),()=>{y.clear().catch(C=>{console.error("Failed to clear html5-qrcode scanner. ",C)})}},[f]);const d=()=>{g(null)};return G.jsxs("div",{className:"max-w-2xl mx-auto",children:[G.jsxs("div",{className:"text-center mb-8",children:[G.jsx("h1",{className:"text-3xl font-bold mb-2",children:"Scan Tickets"}),G.jsx("p",{className:"text-slate-400",children:"Use your camera to verify attendee tickets."})]}),G.jsx("div",{className:"glass-panel p-6 overflow-hidden",children:f?G.jsxs("div",{className:"text-center py-8 animate-in fade-in zoom-in duration-300",children:[f.success?G.jsx("div",{className:"text-green-500 mb-4 flex justify-center",children:G.jsx(sm,{size:64})}):G.jsx("div",{className:"text-red-500 mb-4 flex justify-center",children:G.jsx(um,{size:64})}),G.jsx("h2",{className:"text-2xl font-bold mb-2",children:f.message}),f.ticket&&G.jsxs("div",{className:"bg-slate-800/50 p-4 rounded-lg inline-block text-left mt-4 mb-6",children:[G.jsx("p",{className:"text-slate-400 text-sm",children:"Attendee"}),G.jsx("p",{className:"font-medium text-lg",children:f.ticket.attendeeName}),G.jsx("p",{className:"text-slate-400 text-sm mt-2",children:"Type"}),G.jsx("p",{className:"font-medium text-lg",children:f.ticket.ticketType})]}),G.jsx("div",{children:G.jsxs("button",{onClick:d,className:"btn-primary",children:[G.jsx(_d,{size:18}),"Scan Next"]})})]}):G.jsxs("div",{className:"relative",children:[G.jsx("div",{id:"reader",className:"w-full rounded-lg overflow-hidden"}),G.jsx("p",{className:"text-center text-sm text-slate-500 mt-4",children:"Point camera at the QR code"})]})})]})},_3=()=>{const[f,g]=te.useState(""),[d,y]=te.useState(""),[C,E]=te.useState(!1),{login:O}=N1(),R=ou(),b=async A=>{A.preventDefault(),y(""),E(!0);try{await O(f)?R("/"):y("Invalid password")}catch{y("An error occurred. Please try again.")}finally{E(!1)}};return G.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-900 p-4",children:G.jsxs("div",{className:"glass-panel p-8 w-full max-w-md",children:[G.jsxs("div",{className:"text-center mb-8",children:[G.jsx("div",{className:"inline-block p-4 rounded-full bg-indigo-500/20 text-indigo-400 mb-4",children:G.jsx(fm,{size:32})}),G.jsx("h1",{className:"text-2xl font-bold",children:"EventQR Login"}),G.jsx("p",{className:"text-slate-400",children:"Please enter password to continue"})]}),G.jsxs("form",{onSubmit:b,className:"space-y-4",children:[G.jsx("div",{children:G.jsx("input",{type:"password",value:f,onChange:A=>g(A.target.value),placeholder:"Enter password",className:"w-full bg-slate-800 border-slate-700 focus:border-indigo-500",autoFocus:!0})}),d&&G.jsx("p",{className:"text-red-400 text-sm text-center",children:d}),G.jsx("button",{type:"submit",className:"btn-primary w-full justify-center",disabled:C,children:C?"Logging in...":"Login"})]})]})})},R3=()=>{const{isAuthenticated:f}=N1();return f?G.jsx(Sd,{}):G.jsx(px,{to:"/login",replace:!0})};function D3(){return G.jsx(Nm,{children:G.jsx(Yx,{children:G.jsxs(Ex,{children:[G.jsx(Fr,{path:"/login",element:G.jsx(_3,{})}),G.jsx(Fr,{element:G.jsx(R3,{}),children:G.jsxs(Fr,{element:G.jsx(Mm,{}),children:[G.jsx(Fr,{path:"/",element:G.jsx(Dm,{})}),G.jsx(Fr,{path:"/generate",element:G.jsx(Ym,{})}),G.jsx(Fr,{path:"/scan",element:G.jsx(O3,{})})]})})]})})})}vg.createRoot(document.getElementById("root")).render(G.jsx(D3,{}));
|