create-airjam 0.1.8 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/dist/index.js +12 -4
  2. package/package.json +10 -8
  3. package/templates/pong/.env.example +7 -0
  4. package/templates/pong/{AI_INSTRUCTIONS.md → AGENTS.md} +9 -2
  5. package/templates/pong/README.md +38 -3
  6. package/templates/pong/airjam-docs/for-agents/page.md +27 -0
  7. package/templates/pong/airjam-docs/getting-started/architecture/page.md +4 -1
  8. package/templates/pong/airjam-docs/getting-started/quick-start/page.md +23 -2
  9. package/templates/pong/airjam-docs/sdk/networked-state/page.md +1 -1
  10. package/templates/pong/package.json +6 -3
  11. package/templates/pong/scripts/dev-secure.mjs +177 -0
  12. package/templates/pong/scripts/secure-init.mjs +134 -0
  13. package/templates/pong/src/App.tsx +2 -0
  14. package/templates/pong/src/vite-env.d.ts +1 -0
  15. package/templates/pong/vite.config.ts +9 -0
  16. package/templates/pong/dist/assets/index-BwJ4uU20.js +0 -269
  17. package/templates/pong/dist/assets/index-D42jDbB5.css +0 -1
  18. package/templates/pong/dist/index.html +0 -19
  19. package/templates/pong/node_modules/.bin/air-jam-server +0 -17
  20. package/templates/pong/node_modules/.bin/eslint +0 -17
  21. package/templates/pong/node_modules/.bin/eslint-config-prettier +0 -17
  22. package/templates/pong/node_modules/.bin/tsc +0 -17
  23. package/templates/pong/node_modules/.bin/tsserver +0 -17
  24. package/templates/pong/node_modules/.bin/vite +0 -17
  25. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-dialog.js +0 -1680
  26. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-dialog.js.map +0 -7
  27. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slider.js +0 -638
  28. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slider.js.map +0 -7
  29. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slot.js +0 -129
  30. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-slot.js.map +0 -7
  31. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-tabs.js +0 -434
  32. package/templates/pong/node_modules/.vite/deps/@radix-ui_react-tabs.js.map +0 -7
  33. package/templates/pong/node_modules/.vite/deps/_metadata.json +0 -163
  34. package/templates/pong/node_modules/.vite/deps/chunk-6G72RLJL.js +0 -1004
  35. package/templates/pong/node_modules/.vite/deps/chunk-6G72RLJL.js.map +0 -7
  36. package/templates/pong/node_modules/.vite/deps/chunk-BHOBIW4J.js +0 -99
  37. package/templates/pong/node_modules/.vite/deps/chunk-BHOBIW4J.js.map +0 -7
  38. package/templates/pong/node_modules/.vite/deps/chunk-E44IQKDY.js +0 -49
  39. package/templates/pong/node_modules/.vite/deps/chunk-E44IQKDY.js.map +0 -7
  40. package/templates/pong/node_modules/.vite/deps/chunk-E5X4SHYG.js +0 -21
  41. package/templates/pong/node_modules/.vite/deps/chunk-E5X4SHYG.js.map +0 -7
  42. package/templates/pong/node_modules/.vite/deps/chunk-G3PMV62Z.js +0 -35
  43. package/templates/pong/node_modules/.vite/deps/chunk-G3PMV62Z.js.map +0 -7
  44. package/templates/pong/node_modules/.vite/deps/chunk-LI6KBZ3D.js +0 -292
  45. package/templates/pong/node_modules/.vite/deps/chunk-LI6KBZ3D.js.map +0 -7
  46. package/templates/pong/node_modules/.vite/deps/chunk-MDNXVKSA.js +0 -337
  47. package/templates/pong/node_modules/.vite/deps/chunk-MDNXVKSA.js.map +0 -7
  48. package/templates/pong/node_modules/.vite/deps/chunk-METQ356G.js +0 -280
  49. package/templates/pong/node_modules/.vite/deps/chunk-METQ356G.js.map +0 -7
  50. package/templates/pong/node_modules/.vite/deps/chunk-NPTAWNEA.js +0 -171
  51. package/templates/pong/node_modules/.vite/deps/chunk-NPTAWNEA.js.map +0 -7
  52. package/templates/pong/node_modules/.vite/deps/class-variance-authority.js +0 -51
  53. package/templates/pong/node_modules/.vite/deps/class-variance-authority.js.map +0 -7
  54. package/templates/pong/node_modules/.vite/deps/clsx.js +0 -9
  55. package/templates/pong/node_modules/.vite/deps/clsx.js.map +0 -7
  56. package/templates/pong/node_modules/.vite/deps/howler.js +0 -2241
  57. package/templates/pong/node_modules/.vite/deps/howler.js.map +0 -7
  58. package/templates/pong/node_modules/.vite/deps/html5-qrcode.js +0 -29350
  59. package/templates/pong/node_modules/.vite/deps/html5-qrcode.js.map +0 -7
  60. package/templates/pong/node_modules/.vite/deps/lucide-react.js +0 -28662
  61. package/templates/pong/node_modules/.vite/deps/lucide-react.js.map +0 -7
  62. package/templates/pong/node_modules/.vite/deps/package.json +0 -3
  63. package/templates/pong/node_modules/.vite/deps/qrcode.js +0 -2083
  64. package/templates/pong/node_modules/.vite/deps/qrcode.js.map +0 -7
  65. package/templates/pong/node_modules/.vite/deps/react-dom.js +0 -6
  66. package/templates/pong/node_modules/.vite/deps/react-dom.js.map +0 -7
  67. package/templates/pong/node_modules/.vite/deps/react-dom_client.js +0 -20217
  68. package/templates/pong/node_modules/.vite/deps/react-dom_client.js.map +0 -7
  69. package/templates/pong/node_modules/.vite/deps/react-router-dom.js +0 -13900
  70. package/templates/pong/node_modules/.vite/deps/react-router-dom.js.map +0 -7
  71. package/templates/pong/node_modules/.vite/deps/react.js +0 -5
  72. package/templates/pong/node_modules/.vite/deps/react.js.map +0 -7
  73. package/templates/pong/node_modules/.vite/deps/react_jsx-dev-runtime.js +0 -278
  74. package/templates/pong/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +0 -7
  75. package/templates/pong/node_modules/.vite/deps/react_jsx-runtime.js +0 -6
  76. package/templates/pong/node_modules/.vite/deps/react_jsx-runtime.js.map +0 -7
  77. package/templates/pong/node_modules/.vite/deps/socket__io-client.js +0 -3422
  78. package/templates/pong/node_modules/.vite/deps/socket__io-client.js.map +0 -7
  79. package/templates/pong/node_modules/.vite/deps/tailwind-merge.js +0 -2534
  80. package/templates/pong/node_modules/.vite/deps/tailwind-merge.js.map +0 -7
  81. package/templates/pong/node_modules/.vite/deps/zod.js +0 -13810
  82. package/templates/pong/node_modules/.vite/deps/zod.js.map +0 -7
  83. package/templates/pong/node_modules/.vite/deps/zustand.js +0 -56
  84. package/templates/pong/node_modules/.vite/deps/zustand.js.map +0 -7
  85. package/templates/pong/node_modules/.vite/deps/zustand_react_shallow.js +0 -77
  86. package/templates/pong/node_modules/.vite/deps/zustand_react_shallow.js.map +0 -7
@@ -1,269 +0,0 @@
1
- var Db=Object.defineProperty;var Bb=(e,r,a)=>r in e?Db(e,r,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[r]=a;var Va=(e,r,a)=>Bb(e,typeof r!="symbol"?r+"":r,a);function mx(e,r){for(var a=0;a<r.length;a++){const s=r[a];if(typeof s!="string"&&!Array.isArray(s)){for(const f in s)if(f!=="default"&&!(f in e)){const g=Object.getOwnPropertyDescriptor(s,f);g&&Object.defineProperty(e,f,g.get?g:{enumerable:!0,get:()=>s[f]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))s(f);new MutationObserver(f=>{for(const g of f)if(g.type==="childList")for(const y of g.addedNodes)y.tagName==="LINK"&&y.rel==="modulepreload"&&s(y)}).observe(document,{childList:!0,subtree:!0});function a(f){const g={};return f.integrity&&(g.integrity=f.integrity),f.referrerPolicy&&(g.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?g.credentials="include":f.crossOrigin==="anonymous"?g.credentials="omit":g.credentials="same-origin",g}function s(f){if(f.ep)return;f.ep=!0;const g=a(f);fetch(f.href,g)}})();var ea=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var lh={exports:{}},Nl={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var dp;function kb(){if(dp)return Nl;dp=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.fragment");function a(s,f,g){var y=null;if(g!==void 0&&(y=""+g),f.key!==void 0&&(y=""+f.key),"key"in f){g={};for(var E in f)E!=="key"&&(g[E]=f[E])}else g=f;return f=g.ref,{$$typeof:e,type:s,key:y,ref:f!==void 0?f:null,props:g}}return Nl.Fragment=r,Nl.jsx=a,Nl.jsxs=a,Nl}var hp;function Lb(){return hp||(hp=1,lh.exports=kb()),lh.exports}var F=Lb(),ch={exports:{}},Je={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var gp;function Pb(){if(gp)return Je;gp=1;var e=Symbol.for("react.transitional.element"),r=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.consumer"),y=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),A=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),S=Symbol.iterator;function R(K){return K===null||typeof K!="object"?null:(K=S&&K[S]||K["@@iterator"],typeof K=="function"?K:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},B=Object.assign,P={};function k(K,oe,Re){this.props=K,this.context=oe,this.refs=P,this.updater=Re||I}k.prototype.isReactComponent={},k.prototype.setState=function(K,oe){if(typeof K!="object"&&typeof K!="function"&&K!=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,K,oe,"setState")},k.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function Z(){}Z.prototype=k.prototype;function j(K,oe,Re){this.props=K,this.context=oe,this.refs=P,this.updater=Re||I}var H=j.prototype=new Z;H.constructor=j,B(H,k.prototype),H.isPureReactComponent=!0;var ee=Array.isArray;function Q(){}var X={H:null,A:null,T:null,S:null},de=Object.prototype.hasOwnProperty;function Y(K,oe,Re){var Ie=Re.ref;return{$$typeof:e,type:K,key:oe,ref:Ie!==void 0?Ie:null,props:Re}}function we(K,oe){return Y(K.type,oe,K.props)}function le(K){return typeof K=="object"&&K!==null&&K.$$typeof===e}function te(K){var oe={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(Re){return oe[Re]})}var pe=/\/+/g;function Te(K,oe){return typeof K=="object"&&K!==null&&K.key!=null?te(""+K.key):oe.toString(36)}function ie(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(Q,Q):(K.status="pending",K.then(function(oe){K.status==="pending"&&(K.status="fulfilled",K.value=oe)},function(oe){K.status==="pending"&&(K.status="rejected",K.reason=oe)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function re(K,oe,Re,Ie,Ue){var Ce=typeof K;(Ce==="undefined"||Ce==="boolean")&&(K=null);var Ye=!1;if(K===null)Ye=!0;else switch(Ce){case"bigint":case"string":case"number":Ye=!0;break;case"object":switch(K.$$typeof){case e:case r:Ye=!0;break;case T:return Ye=K._init,re(Ye(K._payload),oe,Re,Ie,Ue)}}if(Ye)return Ue=Ue(K),Ye=Ie===""?"."+Te(K,0):Ie,ee(Ue)?(Re="",Ye!=null&&(Re=Ye.replace(pe,"$&/")+"/"),re(Ue,oe,Re,"",function(Wn){return Wn})):Ue!=null&&(le(Ue)&&(Ue=we(Ue,Re+(Ue.key==null||K&&K.key===Ue.key?"":(""+Ue.key).replace(pe,"$&/")+"/")+Ye)),oe.push(Ue)),1;Ye=0;var Qe=Ie===""?".":Ie+":";if(ee(K))for(var pt=0;pt<K.length;pt++)Ie=K[pt],Ce=Qe+Te(Ie,pt),Ye+=re(Ie,oe,Re,Ce,Ue);else if(pt=R(K),typeof pt=="function")for(K=pt.call(K),pt=0;!(Ie=K.next()).done;)Ie=Ie.value,Ce=Qe+Te(Ie,pt++),Ye+=re(Ie,oe,Re,Ce,Ue);else if(Ce==="object"){if(typeof K.then=="function")return re(ie(K),oe,Re,Ie,Ue);throw oe=String(K),Error("Objects are not valid as a React child (found: "+(oe==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":oe)+"). If you meant to render a collection of children, use an array instead.")}return Ye}function xe(K,oe,Re){if(K==null)return K;var Ie=[],Ue=0;return re(K,Ie,"","",function(Ce){return oe.call(Re,Ce,Ue++)}),Ie}function Me(K){if(K._status===-1){var oe=K._result;oe=oe(),oe.then(function(Re){(K._status===0||K._status===-1)&&(K._status=1,K._result=Re)},function(Re){(K._status===0||K._status===-1)&&(K._status=2,K._result=Re)}),K._status===-1&&(K._status=0,K._result=oe)}if(K._status===1)return K._result.default;throw K._result}var He=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var oe=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.message):String(K),error:K});if(!window.dispatchEvent(oe))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",K);return}console.error(K)},qe={map:xe,forEach:function(K,oe,Re){xe(K,function(){oe.apply(this,arguments)},Re)},count:function(K){var oe=0;return xe(K,function(){oe++}),oe},toArray:function(K){return xe(K,function(oe){return oe})||[]},only:function(K){if(!le(K))throw Error("React.Children.only expected to receive a single React element child.");return K}};return Je.Activity=x,Je.Children=qe,Je.Component=k,Je.Fragment=a,Je.Profiler=f,Je.PureComponent=j,Je.StrictMode=s,Je.Suspense=A,Je.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=X,Je.__COMPILER_RUNTIME={__proto__:null,c:function(K){return X.H.useMemoCache(K)}},Je.cache=function(K){return function(){return K.apply(null,arguments)}},Je.cacheSignal=function(){return null},Je.cloneElement=function(K,oe,Re){if(K==null)throw Error("The argument must be a React element, but you passed "+K+".");var Ie=B({},K.props),Ue=K.key;if(oe!=null)for(Ce in oe.key!==void 0&&(Ue=""+oe.key),oe)!de.call(oe,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&oe.ref===void 0||(Ie[Ce]=oe[Ce]);var Ce=arguments.length-2;if(Ce===1)Ie.children=Re;else if(1<Ce){for(var Ye=Array(Ce),Qe=0;Qe<Ce;Qe++)Ye[Qe]=arguments[Qe+2];Ie.children=Ye}return Y(K.type,Ue,Ie)},Je.createContext=function(K){return K={$$typeof:y,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null},K.Provider=K,K.Consumer={$$typeof:g,_context:K},K},Je.createElement=function(K,oe,Re){var Ie,Ue={},Ce=null;if(oe!=null)for(Ie in oe.key!==void 0&&(Ce=""+oe.key),oe)de.call(oe,Ie)&&Ie!=="key"&&Ie!=="__self"&&Ie!=="__source"&&(Ue[Ie]=oe[Ie]);var Ye=arguments.length-2;if(Ye===1)Ue.children=Re;else if(1<Ye){for(var Qe=Array(Ye),pt=0;pt<Ye;pt++)Qe[pt]=arguments[pt+2];Ue.children=Qe}if(K&&K.defaultProps)for(Ie in Ye=K.defaultProps,Ye)Ue[Ie]===void 0&&(Ue[Ie]=Ye[Ie]);return Y(K,Ce,Ue)},Je.createRef=function(){return{current:null}},Je.forwardRef=function(K){return{$$typeof:E,render:K}},Je.isValidElement=le,Je.lazy=function(K){return{$$typeof:T,_payload:{_status:-1,_result:K},_init:Me}},Je.memo=function(K,oe){return{$$typeof:b,type:K,compare:oe===void 0?null:oe}},Je.startTransition=function(K){var oe=X.T,Re={};X.T=Re;try{var Ie=K(),Ue=X.S;Ue!==null&&Ue(Re,Ie),typeof Ie=="object"&&Ie!==null&&typeof Ie.then=="function"&&Ie.then(Q,He)}catch(Ce){He(Ce)}finally{oe!==null&&Re.types!==null&&(oe.types=Re.types),X.T=oe}},Je.unstable_useCacheRefresh=function(){return X.H.useCacheRefresh()},Je.use=function(K){return X.H.use(K)},Je.useActionState=function(K,oe,Re){return X.H.useActionState(K,oe,Re)},Je.useCallback=function(K,oe){return X.H.useCallback(K,oe)},Je.useContext=function(K){return X.H.useContext(K)},Je.useDebugValue=function(){},Je.useDeferredValue=function(K,oe){return X.H.useDeferredValue(K,oe)},Je.useEffect=function(K,oe){return X.H.useEffect(K,oe)},Je.useEffectEvent=function(K){return X.H.useEffectEvent(K)},Je.useId=function(){return X.H.useId()},Je.useImperativeHandle=function(K,oe,Re){return X.H.useImperativeHandle(K,oe,Re)},Je.useInsertionEffect=function(K,oe){return X.H.useInsertionEffect(K,oe)},Je.useLayoutEffect=function(K,oe){return X.H.useLayoutEffect(K,oe)},Je.useMemo=function(K,oe){return X.H.useMemo(K,oe)},Je.useOptimistic=function(K,oe){return X.H.useOptimistic(K,oe)},Je.useReducer=function(K,oe,Re){return X.H.useReducer(K,oe,Re)},Je.useRef=function(K){return X.H.useRef(K)},Je.useState=function(K){return X.H.useState(K)},Je.useSyncExternalStore=function(K,oe,Re){return X.H.useSyncExternalStore(K,oe,Re)},Je.useTransition=function(){return X.H.useTransition()},Je.version="19.2.0",Je}var mp;function I0(){return mp||(mp=1,ch.exports=Pb()),ch.exports}var L=I0();const Dr=Qu(L),M0=mx({__proto__:null,default:Dr},[L]);var uh={exports:{}},Ol={},fh={exports:{}},dh={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var pp;function zb(){return pp||(pp=1,(function(e){function r(re,xe){var Me=re.length;re.push(xe);e:for(;0<Me;){var He=Me-1>>>1,qe=re[He];if(0<f(qe,xe))re[He]=xe,re[Me]=qe,Me=He;else break e}}function a(re){return re.length===0?null:re[0]}function s(re){if(re.length===0)return null;var xe=re[0],Me=re.pop();if(Me!==xe){re[0]=Me;e:for(var He=0,qe=re.length,K=qe>>>1;He<K;){var oe=2*(He+1)-1,Re=re[oe],Ie=oe+1,Ue=re[Ie];if(0>f(Re,Me))Ie<qe&&0>f(Ue,Re)?(re[He]=Ue,re[Ie]=Me,He=Ie):(re[He]=Re,re[oe]=Me,He=oe);else if(Ie<qe&&0>f(Ue,Me))re[He]=Ue,re[Ie]=Me,He=Ie;else break e}}return xe}function f(re,xe){var Me=re.sortIndex-xe.sortIndex;return Me!==0?Me:re.id-xe.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var g=performance;e.unstable_now=function(){return g.now()}}else{var y=Date,E=y.now();e.unstable_now=function(){return y.now()-E}}var A=[],b=[],T=1,x=null,S=3,R=!1,I=!1,B=!1,P=!1,k=typeof setTimeout=="function"?setTimeout:null,Z=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function H(re){for(var xe=a(b);xe!==null;){if(xe.callback===null)s(b);else if(xe.startTime<=re)s(b),xe.sortIndex=xe.expirationTime,r(A,xe);else break;xe=a(b)}}function ee(re){if(B=!1,H(re),!I)if(a(A)!==null)I=!0,Q||(Q=!0,te());else{var xe=a(b);xe!==null&&ie(ee,xe.startTime-re)}}var Q=!1,X=-1,de=5,Y=-1;function we(){return P?!0:!(e.unstable_now()-Y<de)}function le(){if(P=!1,Q){var re=e.unstable_now();Y=re;var xe=!0;try{e:{I=!1,B&&(B=!1,Z(X),X=-1),R=!0;var Me=S;try{t:{for(H(re),x=a(A);x!==null&&!(x.expirationTime>re&&we());){var He=x.callback;if(typeof He=="function"){x.callback=null,S=x.priorityLevel;var qe=He(x.expirationTime<=re);if(re=e.unstable_now(),typeof qe=="function"){x.callback=qe,H(re),xe=!0;break t}x===a(A)&&s(A),H(re)}else s(A);x=a(A)}if(x!==null)xe=!0;else{var K=a(b);K!==null&&ie(ee,K.startTime-re),xe=!1}}break e}finally{x=null,S=Me,R=!1}xe=void 0}}finally{xe?te():Q=!1}}}var te;if(typeof j=="function")te=function(){j(le)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Te=pe.port2;pe.port1.onmessage=le,te=function(){Te.postMessage(null)}}else te=function(){k(le,0)};function ie(re,xe){X=k(function(){re(e.unstable_now())},xe)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(re){re.callback=null},e.unstable_forceFrameRate=function(re){0>re||125<re?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):de=0<re?Math.floor(1e3/re):5},e.unstable_getCurrentPriorityLevel=function(){return S},e.unstable_next=function(re){switch(S){case 1:case 2:case 3:var xe=3;break;default:xe=S}var Me=S;S=xe;try{return re()}finally{S=Me}},e.unstable_requestPaint=function(){P=!0},e.unstable_runWithPriority=function(re,xe){switch(re){case 1:case 2:case 3:case 4:case 5:break;default:re=3}var Me=S;S=re;try{return xe()}finally{S=Me}},e.unstable_scheduleCallback=function(re,xe,Me){var He=e.unstable_now();switch(typeof Me=="object"&&Me!==null?(Me=Me.delay,Me=typeof Me=="number"&&0<Me?He+Me:He):Me=He,re){case 1:var qe=-1;break;case 2:qe=250;break;case 5:qe=1073741823;break;case 4:qe=1e4;break;default:qe=5e3}return qe=Me+qe,re={id:T++,callback:xe,priorityLevel:re,startTime:Me,expirationTime:qe,sortIndex:-1},Me>He?(re.sortIndex=Me,r(b,re),a(A)===null&&re===a(b)&&(B?(Z(X),X=-1):B=!0,ie(ee,Me-He))):(re.sortIndex=qe,r(A,re),I||R||(I=!0,Q||(Q=!0,te()))),re},e.unstable_shouldYield=we,e.unstable_wrapCallback=function(re){var xe=S;return function(){var Me=S;S=xe;try{return re.apply(this,arguments)}finally{S=Me}}}})(dh)),dh}var xp;function Ub(){return xp||(xp=1,fh.exports=zb()),fh.exports}var hh={exports:{}},Gn={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var yp;function Fb(){if(yp)return Gn;yp=1;var e=I0();function r(A){var b="https://react.dev/errors/"+A;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)b+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+A+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var s={d:{f:a,r:function(){throw Error(r(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},f=Symbol.for("react.portal");function g(A,b,T){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:x==null?null:""+x,children:A,containerInfo:b,implementation:T}}var y=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function E(A,b){if(A==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Gn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,Gn.createPortal=function(A,b){var T=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(r(299));return g(A,b,null,T)},Gn.flushSync=function(A){var b=y.T,T=s.p;try{if(y.T=null,s.p=2,A)return A()}finally{y.T=b,s.p=T,s.d.f()}},Gn.preconnect=function(A,b){typeof A=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,s.d.C(A,b))},Gn.prefetchDNS=function(A){typeof A=="string"&&s.d.D(A)},Gn.preinit=function(A,b){if(typeof A=="string"&&b&&typeof b.as=="string"){var T=b.as,x=E(T,b.crossOrigin),S=typeof b.integrity=="string"?b.integrity:void 0,R=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;T==="style"?s.d.S(A,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:x,integrity:S,fetchPriority:R}):T==="script"&&s.d.X(A,{crossOrigin:x,integrity:S,fetchPriority:R,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Gn.preinitModule=function(A,b){if(typeof A=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var T=E(b.as,b.crossOrigin);s.d.M(A,{crossOrigin:T,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&s.d.M(A)},Gn.preload=function(A,b){if(typeof A=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var T=b.as,x=E(T,b.crossOrigin);s.d.L(A,T,{crossOrigin:x,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Gn.preloadModule=function(A,b){if(typeof A=="string")if(b){var T=E(b.as,b.crossOrigin);s.d.m(A,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:T,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else s.d.m(A)},Gn.requestFormReset=function(A){s.d.r(A)},Gn.unstable_batchedUpdates=function(A,b){return A(b)},Gn.useFormState=function(A,b,T){return y.H.useFormState(A,b,T)},Gn.useFormStatus=function(){return y.H.useHostTransitionStatus()},Gn.version="19.2.0",Gn}var vp;function px(){if(vp)return hh.exports;vp=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),hh.exports=Fb(),hh.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var wp;function jb(){if(wp)return Ol;wp=1;var e=Ub(),r=I0(),a=px();function s(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)i+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function f(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function g(t){var i=t,c=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(c=i.return),t=i.return;while(t)}return i.tag===3?c:null}function y(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function E(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function A(t){if(g(t)!==t)throw Error(s(188))}function b(t){var i=t.alternate;if(!i){if(i=g(t),i===null)throw Error(s(188));return i!==t?null:t}for(var c=t,h=i;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(h=v.return,h!==null){c=h;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return A(v),t;if(_===h)return A(v),i;_=_.sibling}throw Error(s(188))}if(c.return!==h.return)c=v,h=_;else{for(var O=!1,U=v.child;U;){if(U===c){O=!0,c=v,h=_;break}if(U===h){O=!0,h=v,c=_;break}U=U.sibling}if(!O){for(U=_.child;U;){if(U===c){O=!0,c=_,h=v;break}if(U===h){O=!0,h=_,c=v;break}U=U.sibling}if(!O)throw Error(s(189))}}if(c.alternate!==h)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?t:i}function T(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=T(t),i!==null)return i;t=t.sibling}return null}var x=Object.assign,S=Symbol.for("react.element"),R=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),k=Symbol.for("react.profiler"),Z=Symbol.for("react.consumer"),j=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),X=Symbol.for("react.memo"),de=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),we=Symbol.for("react.memo_cache_sentinel"),le=Symbol.iterator;function te(t){return t===null||typeof t!="object"?null:(t=le&&t[le]||t["@@iterator"],typeof t=="function"?t:null)}var pe=Symbol.for("react.client.reference");function Te(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===pe?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case B:return"Fragment";case k:return"Profiler";case P:return"StrictMode";case ee:return"Suspense";case Q:return"SuspenseList";case Y:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case I:return"Portal";case j:return t.displayName||"Context";case Z:return(t._context.displayName||"Context")+".Consumer";case H:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case X:return i=t.displayName||null,i!==null?i:Te(t.type)||"Memo";case de:i=t._payload,t=t._init;try{return Te(t(i))}catch{}}return null}var ie=Array.isArray,re=r.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Me={pending:!1,data:null,method:null,action:null},He=[],qe=-1;function K(t){return{current:t}}function oe(t){0>qe||(t.current=He[qe],He[qe]=null,qe--)}function Re(t,i){qe++,He[qe]=t.current,t.current=i}var Ie=K(null),Ue=K(null),Ce=K(null),Ye=K(null);function Qe(t,i){switch(Re(Ce,i),Re(Ue,t),Re(Ie,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?km(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=km(i),t=Lm(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}oe(Ie),Re(Ie,t)}function pt(){oe(Ie),oe(Ue),oe(Ce)}function Wn(t){t.memoizedState!==null&&Re(Ye,t);var i=Ie.current,c=Lm(i,t.type);i!==c&&(Re(Ue,t),Re(Ie,c))}function Tn(t){Ue.current===t&&(oe(Ie),oe(Ue)),Ye.current===t&&(oe(Ye),Cl._currentValue=Me)}var ia,xt;function ar(t){if(ia===void 0)try{throw Error()}catch(c){var i=c.stack.trim().match(/\n( *(at )?)/);ia=i&&i[1]||"",xt=-1<c.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+ia+t+xt}var or=!1;function Ni(t,i){if(!t||or)return"";or=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(i){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(me){var fe=me}Reflect.construct(t,[],be)}else{try{be.call()}catch(me){fe=me}t.call(be.prototype)}}else{try{throw Error()}catch(me){fe=me}(be=t())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(me){if(me&&fe&&typeof me.stack=="string")return[me.stack,fe.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var _=h.DetermineComponentFrameRoot(),O=_[0],U=_[1];if(O&&U){var q=O.split(`
44
- `),ue=U.split(`
45
- `);for(v=h=0;h<q.length&&!q[h].includes("DetermineComponentFrameRoot");)h++;for(;v<ue.length&&!ue[v].includes("DetermineComponentFrameRoot");)v++;if(h===q.length||v===ue.length)for(h=q.length-1,v=ue.length-1;1<=h&&0<=v&&q[h]!==ue[v];)v--;for(;1<=h&&0<=v;h--,v--)if(q[h]!==ue[v]){if(h!==1||v!==1)do if(h--,v--,0>v||q[h]!==ue[v]){var ye=`
46
- `+q[h].replace(" at new "," at ");return t.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",t.displayName)),ye}while(1<=h&&0<=v);break}}}finally{or=!1,Error.prepareStackTrace=c}return(c=t?t.displayName||t.name:"")?ar(c):""}function Rn(t,i){switch(t.tag){case 26:case 27:case 5:return ar(t.type);case 16:return ar("Lazy");case 13:return t.child!==i&&i!==null?ar("Suspense Fallback"):ar("Suspense");case 19:return ar("SuspenseList");case 0:case 15:return Ni(t.type,!1);case 11:return Ni(t.type.render,!1);case 1:return Ni(t.type,!0);case 31:return ar("Activity");default:return""}}function Nt(t){try{var i="",c=null;do i+=Rn(t,c),c=t,t=t.return;while(t);return i}catch(h){return`
47
- Error generating stack: `+h.message+`
48
- `+h.stack}}var ot=Object.prototype.hasOwnProperty,aa=e.unstable_scheduleCallback,ke=e.unstable_cancelCallback,Mo=e.unstable_shouldYield,Jl=e.unstable_requestPaint,en=e.unstable_now,Ls=e.unstable_getCurrentPriorityLevel,sr=e.unstable_ImmediatePriority,Ps=e.unstable_UserBlockingPriority,vr=e.unstable_NormalPriority,Pn=e.unstable_LowPriority,zs=e.unstable_IdlePriority,Do=e.log,hf=e.unstable_setDisableYieldValue,jt=null,Oe=null;function Dt(t){if(typeof Do=="function"&&hf(t),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(jt,t)}catch{}}var et=Math.clz32?Math.clz32:Us,Kt=Math.log,Qa=Math.LN2;function Us(t){return t>>>=0,t===0?32:31-(Kt(t)/Qa|0)|0}var Ja=256,ut=262144,Lr=4194304;function di(t){var i=t&42;if(i!==0)return i;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function $a(t,i,c){var h=t.pendingLanes;if(h===0)return 0;var v=0,_=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var U=h&134217727;return U!==0?(h=U&~_,h!==0?v=di(h):(O&=U,O!==0?v=di(O):c||(c=U&~t,c!==0&&(v=di(c))))):(U=h&~_,U!==0?v=di(U):O!==0?v=di(O):c||(c=h&~t,c!==0&&(v=di(c)))),v===0?0:i!==0&&i!==v&&(i&_)===0&&(_=v&-v,c=i&-i,_>=c||_===32&&(c&4194048)!==0)?i:v}function zn(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function Fs(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 Nn(){var t=Lr;return Lr<<=1,(Lr&62914560)===0&&(Lr=4194304),t}function hi(t){for(var i=[],c=0;31>c;c++)i.push(t);return i}function gi(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Pr(t,i,c,h,v,_){var O=t.pendingLanes;t.pendingLanes=c,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=c,t.entangledLanes&=c,t.errorRecoveryDisabledLanes&=c,t.shellSuspendCounter=0;var U=t.entanglements,q=t.expirationTimes,ue=t.hiddenUpdates;for(c=O&~c;0<c;){var ye=31-et(c),be=1<<ye;U[ye]=0,q[ye]=-1;var fe=ue[ye];if(fe!==null)for(ue[ye]=null,ye=0;ye<fe.length;ye++){var me=fe[ye];me!==null&&(me.lane&=-536870913)}c&=~be}h!==0&&$l(t,h,0),_!==0&&v===0&&t.tag!==0&&(t.suspendedLanes|=_&~(O&~i))}function $l(t,i,c){t.pendingLanes|=i,t.suspendedLanes&=~i;var h=31-et(i);t.entangledLanes|=i,t.entanglements[h]=t.entanglements[h]|1073741824|c&261930}function mi(t,i){var c=t.entangledLanes|=i;for(t=t.entanglements;c;){var h=31-et(c),v=1<<h;v&i|t[h]&i&&(t[h]|=i),c&=~v}}function Bo(t,i){var c=i&-i;return c=(c&42)!==0?1:kn(c),(c&(t.suspendedLanes|i))!==0?0:c}function kn(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Jr(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Kn(){var t=xe.p;return t!==0?t:(t=window.event,t===void 0?32:ap(t.type))}function De(t,i){var c=xe.p;try{return xe.p=t,i()}finally{xe.p=c}}var Qn=Math.random().toString(36).slice(2),dn="__reactFiber$"+Qn,Ot="__reactProps$"+Qn,wr="__reactContainer$"+Qn,oa="__reactEvents$"+Qn,ko="__reactListeners$"+Qn,zr="__reactHandles$"+Qn,ec="__reactResources$"+Qn,eo="__reactMarker$"+Qn;function lr(t){delete t[dn],delete t[Ot],delete t[oa],delete t[ko],delete t[zr]}function an(t){var i=t[dn];if(i)return i;for(var c=t.parentNode;c;){if(i=c[wr]||c[dn]){if(c=i.alternate,i.child!==null||c!==null&&c.child!==null)for(t=Hm(t);t!==null;){if(c=t[dn])return c;t=Hm(t)}return i}t=c,c=t.parentNode}return null}function Et(t){if(t=t[dn]||t[wr]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function sa(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(s(33))}function Jn(t){var i=t[ec];return i||(i=t[ec]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function on(t){t[eo]=!0}var Ee=new Set,tc={};function St(t,i){br(t,i),br(t+"Capture",i)}function br(t,i){for(tc[t]=i,t=0;t<i.length;t++)Ee.add(i[t])}var gf=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]*$"),vt={},yt={};function st(t){return ot.call(yt,t)?!0:ot.call(vt,t)?!1:gf.test(t)?yt[t]=!0:(vt[t]=!0,!1)}function la(t,i,c){if(st(i))if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var h=i.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+c)}}function ca(t,i,c){if(c===null)t.removeAttribute(i);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+c)}}function _r(t,i,c,h){if(h===null)t.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(c);return}t.setAttributeNS(i,c,""+h)}}function wt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function $r(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function mf(t,i,c){var h=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,_=h.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return v.call(this)},set:function(O){c=""+O,_.call(this,O)}}),Object.defineProperty(t,i,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(O){c=""+O},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Ht(t){if(!t._valueTracker){var i=$r(t)?"checked":"value";t._valueTracker=mf(t,i,""+t[i])}}function ei(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var c=i.getValue(),h="";return t&&(h=$r(t)?t.checked?"true":"false":t.value),t=h,t!==c?(i.setValue(t),!0):!1}function Lo(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var ua=/[\n"\\]/g;function at(t){return t.replace(ua,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function yn(t,i,c,h,v,_,O,U){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),i!=null?O==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+wt(i)):t.value!==""+wt(i)&&(t.value=""+wt(i)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),i!=null?V(t,O,wt(i)):c!=null?V(t,O,wt(c)):h!=null&&t.removeAttribute("value"),v==null&&_!=null&&(t.defaultChecked=!!_),v!=null&&(t.checked=v&&typeof v!="function"&&typeof v!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?t.name=""+wt(U):t.removeAttribute("name")}function se(t,i,c,h,v,_,O,U){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(t.type=_),i!=null||c!=null){if(!(_!=="submit"&&_!=="reset"||i!=null)){Ht(t);return}c=c!=null?""+wt(c):"",i=i!=null?""+wt(i):c,U||i===t.value||(t.value=i),t.defaultValue=i}h=h??v,h=typeof h!="function"&&typeof h!="symbol"&&!!h,t.checked=U?t.checked:!!h,t.defaultChecked=!!h,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),Ht(t)}function V(t,i,c){i==="number"&&Lo(t.ownerDocument)===t||t.defaultValue===""+c||(t.defaultValue=""+c)}function Pe(t,i,c,h){if(t=t.options,i){i={};for(var v=0;v<c.length;v++)i["$"+c[v]]=!0;for(c=0;c<t.length;c++)v=i.hasOwnProperty("$"+t[c].value),t[c].selected!==v&&(t[c].selected=v),v&&h&&(t[c].defaultSelected=!0)}else{for(c=""+wt(c),i=null,v=0;v<t.length;v++){if(t[v].value===c){t[v].selected=!0,h&&(t[v].defaultSelected=!0);return}i!==null||t[v].disabled||(i=t[v])}i!==null&&(i.selected=!0)}}function hn(t,i,c){if(i!=null&&(i=""+wt(i),i!==t.value&&(t.value=i),c==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=c!=null?""+wt(c):""}function $n(t,i,c,h){if(i==null){if(h!=null){if(c!=null)throw Error(s(92));if(ie(h)){if(1<h.length)throw Error(s(93));h=h[0]}c=h}c==null&&(c=""),i=c}c=wt(i),t.defaultValue=c,h=t.textContent,h===c&&h!==""&&h!==null&&(t.value=h),Ht(t)}function fa(t,i){if(i){var c=t.firstChild;if(c&&c===t.lastChild&&c.nodeType===3){c.nodeValue=i;return}}t.textContent=i}var js=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 er(t,i,c){var h=i.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":h?t.setProperty(i,c):typeof c!="number"||c===0||js.has(i)?i==="float"?t.cssFloat=c:t[i]=(""+c).trim():t[i]=c+"px"}function Fe(t,i,c){if(i!=null&&typeof i!="object")throw Error(s(62));if(t=t.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||i!=null&&i.hasOwnProperty(h)||(h.indexOf("--")===0?t.setProperty(h,""):h==="float"?t.cssFloat="":t[h]="");for(var v in i)h=i[v],i.hasOwnProperty(v)&&c[v]!==h&&er(t,v,h)}else for(var _ in i)i.hasOwnProperty(_)&&er(t,_,i[_])}function Pt(t){if(t.indexOf("-")===-1)return!1;switch(t){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 nc=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"]]),pf=/^[\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 da(t){return pf.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function cr(){}var to=null;function Vs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Gt=null,Ur=null;function ti(t){var i=Et(t);if(i&&(t=i.stateNode)){var c=t[Ot]||null;e:switch(t=i.stateNode,i.type){case"input":if(yn(t,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),i=c.name,c.type==="radio"&&i!=null){for(c=t;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+at(""+i)+'"][type="radio"]'),i=0;i<c.length;i++){var h=c[i];if(h!==t&&h.form===t.form){var v=h[Ot]||null;if(!v)throw Error(s(90));yn(h,v.value,v.defaultValue,v.defaultValue,v.checked,v.defaultChecked,v.type,v.name)}}for(i=0;i<c.length;i++)h=c[i],h.form===t.form&&ei(h)}break e;case"textarea":hn(t,c.value,c.defaultValue);break e;case"select":i=c.value,i!=null&&Pe(t,!!c.multiple,i,!1)}}}var Ge=!1;function rc(t,i,c){if(Ge)return t(i,c);Ge=!0;try{var h=t(i);return h}finally{if(Ge=!1,(Gt!==null||Ur!==null)&&(qc(),Gt&&(i=Gt,t=Ur,Ur=Gt=null,ti(i),t)))for(i=0;i<t.length;i++)ti(t[i])}}function We(t,i){var c=t.stateNode;if(c===null)return null;var h=c[Ot]||null;if(h===null)return null;c=h[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(t=t.type,h=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!h;break e;default:t=!1}if(t)return null;if(c&&typeof c!="function")throw Error(s(231,i,typeof c));return c}var zt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Hs=!1;if(zt)try{var Oi={};Object.defineProperty(Oi,"passive",{get:function(){Hs=!0}}),window.addEventListener("test",Oi,Oi),window.removeEventListener("test",Oi,Oi)}catch{Hs=!1}var ni=null,ri=null,Po=null;function ha(){if(Po)return Po;var t,i=ri,c=i.length,h,v="value"in ni?ni.value:ni.textContent,_=v.length;for(t=0;t<c&&i[t]===v[t];t++);var O=c-t;for(h=1;h<=O&&i[c-h]===v[_-h];h++);return Po=v.slice(t,1<h?1-h:void 0)}function pi(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function xi(){return!0}function Gs(){return!1}function vn(t){function i(c,h,v,_,O){this._reactName=c,this._targetInst=v,this.type=h,this.nativeEvent=_,this.target=O,this.currentTarget=null;for(var U in t)t.hasOwnProperty(U)&&(c=t[U],this[U]=c?c(_):_[U]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?xi:Gs,this.isPropagationStopped=Gs,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=xi)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=xi)},persist:function(){},isPersistent:xi}),i}var Er={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},On=vn(Er),ga=x({},Er,{view:0,detail:0}),ic=vn(ga),zo,Zs,no,Uo=x({},ga,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ro,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==no&&(no&&t.type==="mousemove"?(zo=t.screenX-no.screenX,Zs=t.screenY-no.screenY):Zs=zo=0,no=t),zo)},movementY:function(t){return"movementY"in t?t.movementY:Zs}}),At=vn(Uo),ac=x({},Uo,{dataTransfer:0}),Fo=vn(ac),yi=x({},ga,{relatedTarget:0}),Xs=vn(yi),ge=x({},Er,{animationName:0,elapsedTime:0,pseudoElement:0}),tt=vn(ge),In=x({},Er,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),jo=vn(In),oc=x({},Er,{data:0}),sc=vn(oc),xf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},yf={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"},Ys={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gn(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Ys[t])?!!i[t]:!1}function ro(){return gn}var Qt=x({},ga,{key:function(t){if(t.key){var i=xf[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=pi(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?yf[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ro,charCode:function(t){return t.type==="keypress"?pi(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?pi(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Vo=vn(Qt),Ii=x({},Uo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tt=vn(Ii),Ze=x({},ga,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ro}),vf=vn(Ze),Ut=x({},Er,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mi=vn(Ut),ma=x({},Uo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),wf=vn(ma),Fr=x({},Er,{newState:0,oldState:0}),qs=vn(Fr),lc=[9,13,27,32],io=zt&&"CompositionEvent"in window,pa=null;zt&&"documentMode"in document&&(pa=document.documentMode);var cc=zt&&"TextEvent"in window&&!pa,uc=zt&&(!io||pa&&8<pa&&11>=pa),Di=" ",Ho=!1;function fc(t,i){switch(t){case"keyup":return lc.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xa(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ya=!1;function vi(t,i){switch(t){case"compositionend":return xa(i);case"keypress":return i.which!==32?null:(Ho=!0,Di);case"textInput":return t=i.data,t===Di&&Ho?null:t;default:return null}}function Go(t,i){if(ya)return t==="compositionend"||!io&&fc(t,i)?(t=ha(),Po=ri=ni=null,ya=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return uc&&i.locale!=="ko"?null:i.data;default:return null}}var ur={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 Ws(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!ur[t.type]:i==="textarea"}function Ar(t,i,c,h){Gt?Ur?Ur.push(h):Ur=[h]:Gt=h,i=tu(i,"onChange"),0<i.length&&(c=new On("onChange","change",null,c,h),t.push({event:c,listeners:i}))}var ao=null,Bi=null;function bf(t){Nm(t,0)}function oo(t){var i=sa(t);if(ei(i))return t}function Cr(t,i){if(t==="change")return i}var dc=!1;if(zt){var so;if(zt){var ki="oninput"in document;if(!ki){var ft=document.createElement("div");ft.setAttribute("oninput","return;"),ki=typeof ft.oninput=="function"}so=ki}else so=!1;dc=so&&(!document.documentMode||9<document.documentMode)}function lo(){ao&&(ao.detachEvent("onpropertychange",M),Bi=ao=null)}function M(t){if(t.propertyName==="value"&&oo(Bi)){var i=[];Ar(i,Bi,t,Vs(t)),rc(bf,i)}}function n(t,i,c){t==="focusin"?(lo(),ao=i,Bi=c,ao.attachEvent("onpropertychange",M)):t==="focusout"&&lo()}function o(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return oo(Bi)}function l(t,i){if(t==="click")return oo(i)}function u(t,i){if(t==="input"||t==="change")return oo(i)}function d(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var m=typeof Object.is=="function"?Object.is:d;function p(t,i){if(m(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var c=Object.keys(t),h=Object.keys(i);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var v=c[h];if(!ot.call(i,v)||!m(t[v],i[v]))return!1}return!0}function w(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function C(t,i){var c=w(t);t=0;for(var h;c;){if(c.nodeType===3){if(h=t+c.textContent.length,t<=i&&h>=i)return{node:c,offset:i-t};t=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=w(c)}}function N(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?N(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function D(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Lo(t.document);i instanceof t.HTMLIFrameElement;){try{var c=typeof i.contentWindow.location.href=="string"}catch{c=!1}if(c)t=i.contentWindow;else break;i=Lo(t.document)}return i}function z(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var G=zt&&"documentMode"in document&&11>=document.documentMode,W=null,J=null,ae=null,he=!1;function Ne(t,i,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;he||W==null||W!==Lo(h)||(h=W,"selectionStart"in h&&z(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),ae&&p(ae,h)||(ae=h,h=tu(J,"onSelect"),0<h.length&&(i=new On("onSelect","select",null,i,c),t.push({event:i,listeners:h}),i.target=W)))}function Se(t,i){var c={};return c[t.toLowerCase()]=i.toLowerCase(),c["Webkit"+t]="webkit"+i,c["Moz"+t]="moz"+i,c}var Ae={animationend:Se("Animation","AnimationEnd"),animationiteration:Se("Animation","AnimationIteration"),animationstart:Se("Animation","AnimationStart"),transitionrun:Se("Transition","TransitionRun"),transitionstart:Se("Transition","TransitionStart"),transitioncancel:Se("Transition","TransitionCancel"),transitionend:Se("Transition","TransitionEnd")},it={},Ke={};zt&&(Ke=document.createElement("div").style,"AnimationEvent"in window||(delete Ae.animationend.animation,delete Ae.animationiteration.animation,delete Ae.animationstart.animation),"TransitionEvent"in window||delete Ae.transitionend.transition);function sn(t){if(it[t])return it[t];if(!Ae[t])return t;var i=Ae[t],c;for(c in i)if(i.hasOwnProperty(c)&&c in Ke)return it[t]=i[c];return t}var fr=sn("animationend"),Un=sn("animationiteration"),Rt=sn("animationstart"),Mn=sn("transitionrun"),tr=sn("transitionstart"),va=sn("transitioncancel"),Li=sn("transitionend"),hc=new Map,Ks="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(" ");Ks.push("scrollEnd");function ii(t,i){hc.set(t,i),St(i,[t])}var gc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},jr=[],Zo=0,_f=0;function mc(){for(var t=Zo,i=_f=Zo=0;i<t;){var c=jr[i];jr[i++]=null;var h=jr[i];jr[i++]=null;var v=jr[i];jr[i++]=null;var _=jr[i];if(jr[i++]=null,h!==null&&v!==null){var O=h.pending;O===null?v.next=v:(v.next=O.next,O.next=v),h.pending=v}_!==0&&u1(c,v,_)}}function pc(t,i,c,h){jr[Zo++]=t,jr[Zo++]=i,jr[Zo++]=c,jr[Zo++]=h,_f|=h,t.lanes|=h,t=t.alternate,t!==null&&(t.lanes|=h)}function Ef(t,i,c,h){return pc(t,i,c,h),xc(t)}function co(t,i){return pc(t,null,null,i),xc(t)}function u1(t,i,c){t.lanes|=c;var h=t.alternate;h!==null&&(h.lanes|=c);for(var v=!1,_=t.return;_!==null;)_.childLanes|=c,h=_.alternate,h!==null&&(h.childLanes|=c),_.tag===22&&(t=_.stateNode,t===null||t._visibility&1||(v=!0)),t=_,_=_.return;return t.tag===3?(_=t.stateNode,v&&i!==null&&(v=31-et(c),t=_.hiddenUpdates,h=t[v],h===null?t[v]=[i]:h.push(i),i.lane=c|536870912),_):null}function xc(t){if(50<yl)throw yl=0,Md=null,Error(s(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Xo={};function pw(t,i,c,h){this.tag=t,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(t,i,c,h){return new pw(t,i,c,h)}function Af(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Pi(t,i){var c=t.alternate;return c===null?(c=Sr(t.tag,i,t.key,t.mode),c.elementType=t.elementType,c.type=t.type,c.stateNode=t.stateNode,c.alternate=t,t.alternate=c):(c.pendingProps=i,c.type=t.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=t.flags&65011712,c.childLanes=t.childLanes,c.lanes=t.lanes,c.child=t.child,c.memoizedProps=t.memoizedProps,c.memoizedState=t.memoizedState,c.updateQueue=t.updateQueue,i=t.dependencies,c.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},c.sibling=t.sibling,c.index=t.index,c.ref=t.ref,c.refCleanup=t.refCleanup,c}function f1(t,i){t.flags&=65011714;var c=t.alternate;return c===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=c.childLanes,t.lanes=c.lanes,t.child=c.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=c.memoizedProps,t.memoizedState=c.memoizedState,t.updateQueue=c.updateQueue,t.type=c.type,i=c.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function yc(t,i,c,h,v,_){var O=0;if(h=t,typeof t=="function")Af(t)&&(O=1);else if(typeof t=="string")O=bb(t,c,Ie.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Y:return t=Sr(31,c,i,v),t.elementType=Y,t.lanes=_,t;case B:return uo(c.children,v,_,i);case P:O=8,v|=24;break;case k:return t=Sr(12,c,i,v|2),t.elementType=k,t.lanes=_,t;case ee:return t=Sr(13,c,i,v),t.elementType=ee,t.lanes=_,t;case Q:return t=Sr(19,c,i,v),t.elementType=Q,t.lanes=_,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case j:O=10;break e;case Z:O=9;break e;case H:O=11;break e;case X:O=14;break e;case de:O=16,h=null;break e}O=29,c=Error(s(130,t===null?"null":typeof t,"")),h=null}return i=Sr(O,c,i,v),i.elementType=t,i.type=h,i.lanes=_,i}function uo(t,i,c,h){return t=Sr(7,t,h,i),t.lanes=c,t}function Cf(t,i,c){return t=Sr(6,t,null,i),t.lanes=c,t}function d1(t){var i=Sr(18,null,null,0);return i.stateNode=t,i}function Sf(t,i,c){return i=Sr(4,t.children!==null?t.children:[],t.key,i),i.lanes=c,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var h1=new WeakMap;function Vr(t,i){if(typeof t=="object"&&t!==null){var c=h1.get(t);return c!==void 0?c:(i={value:t,source:i,stack:Nt(i)},h1.set(t,i),i)}return{value:t,source:i,stack:Nt(i)}}var Yo=[],qo=0,vc=null,Qs=0,Hr=[],Gr=0,wa=null,wi=1,bi="";function zi(t,i){Yo[qo++]=Qs,Yo[qo++]=vc,vc=t,Qs=i}function g1(t,i,c){Hr[Gr++]=wi,Hr[Gr++]=bi,Hr[Gr++]=wa,wa=t;var h=wi;t=bi;var v=32-et(h)-1;h&=~(1<<v),c+=1;var _=32-et(i)+v;if(30<_){var O=v-v%5;_=(h&(1<<O)-1).toString(32),h>>=O,v-=O,wi=1<<32-et(i)+v|c<<v|h,bi=_+t}else wi=1<<_|c<<v|h,bi=t}function Tf(t){t.return!==null&&(zi(t,1),g1(t,1,0))}function Rf(t){for(;t===vc;)vc=Yo[--qo],Yo[qo]=null,Qs=Yo[--qo],Yo[qo]=null;for(;t===wa;)wa=Hr[--Gr],Hr[Gr]=null,bi=Hr[--Gr],Hr[Gr]=null,wi=Hr[--Gr],Hr[Gr]=null}function m1(t,i){Hr[Gr++]=wi,Hr[Gr++]=bi,Hr[Gr++]=wa,wi=i.id,bi=i.overflow,wa=t}var Fn=null,Zt=null,gt=!1,ba=null,Zr=!1,Nf=Error(s(519));function _a(t){var i=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Js(Vr(i,t)),Nf}function p1(t){var i=t.stateNode,c=t.type,h=t.memoizedProps;switch(i[dn]=t,i[Ot]=h,c){case"dialog":ct("cancel",i),ct("close",i);break;case"iframe":case"object":case"embed":ct("load",i);break;case"video":case"audio":for(c=0;c<wl.length;c++)ct(wl[c],i);break;case"source":ct("error",i);break;case"img":case"image":case"link":ct("error",i),ct("load",i);break;case"details":ct("toggle",i);break;case"input":ct("invalid",i),se(i,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ct("invalid",i);break;case"textarea":ct("invalid",i),$n(i,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||i.textContent===""+c||h.suppressHydrationWarning===!0||Dm(i.textContent,c)?(h.popover!=null&&(ct("beforetoggle",i),ct("toggle",i)),h.onScroll!=null&&ct("scroll",i),h.onScrollEnd!=null&&ct("scrollend",i),h.onClick!=null&&(i.onclick=cr),i=!0):i=!1,i||_a(t,!0)}function x1(t){for(Fn=t.return;Fn;)switch(Fn.tag){case 5:case 31:case 13:Zr=!1;return;case 27:case 3:Zr=!0;return;default:Fn=Fn.return}}function Wo(t){if(t!==Fn)return!1;if(!gt)return x1(t),gt=!0,!1;var i=t.tag,c;if((c=i!==3&&i!==27)&&((c=i===5)&&(c=t.type,c=!(c!=="form"&&c!=="button")||Yd(t.type,t.memoizedProps)),c=!c),c&&Zt&&_a(t),x1(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Zt=Vm(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(317));Zt=Vm(t)}else i===27?(i=Zt,La(t.type)?(t=Jd,Jd=null,Zt=t):Zt=i):Zt=Fn?Yr(t.stateNode.nextSibling):null;return!0}function fo(){Zt=Fn=null,gt=!1}function Of(){var t=ba;return t!==null&&(mr===null?mr=t:mr.push.apply(mr,t),ba=null),t}function Js(t){ba===null?ba=[t]:ba.push(t)}var If=K(null),ho=null,Ui=null;function Ea(t,i,c){Re(If,i._currentValue),i._currentValue=c}function Fi(t){t._currentValue=If.current,oe(If)}function Mf(t,i,c){for(;t!==null;){var h=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,h!==null&&(h.childLanes|=i)):h!==null&&(h.childLanes&i)!==i&&(h.childLanes|=i),t===c)break;t=t.return}}function Df(t,i,c,h){var v=t.child;for(v!==null&&(v.return=t);v!==null;){var _=v.dependencies;if(_!==null){var O=v.child;_=_.firstContext;e:for(;_!==null;){var U=_;_=v;for(var q=0;q<i.length;q++)if(U.context===i[q]){_.lanes|=c,U=_.alternate,U!==null&&(U.lanes|=c),Mf(_.return,c,t),h||(O=null);break e}_=U.next}}else if(v.tag===18){if(O=v.return,O===null)throw Error(s(341));O.lanes|=c,_=O.alternate,_!==null&&(_.lanes|=c),Mf(O,c,t),O=null}else O=v.child;if(O!==null)O.return=v;else for(O=v;O!==null;){if(O===t){O=null;break}if(v=O.sibling,v!==null){v.return=O.return,O=v;break}O=O.return}v=O}}function Ko(t,i,c,h){t=null;for(var v=i,_=!1;v!==null;){if(!_){if((v.flags&524288)!==0)_=!0;else if((v.flags&262144)!==0)break}if(v.tag===10){var O=v.alternate;if(O===null)throw Error(s(387));if(O=O.memoizedProps,O!==null){var U=v.type;m(v.pendingProps.value,O.value)||(t!==null?t.push(U):t=[U])}}else if(v===Ye.current){if(O=v.alternate,O===null)throw Error(s(387));O.memoizedState.memoizedState!==v.memoizedState.memoizedState&&(t!==null?t.push(Cl):t=[Cl])}v=v.return}t!==null&&Df(i,t,c,h),i.flags|=262144}function wc(t){for(t=t.firstContext;t!==null;){if(!m(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function go(t){ho=t,Ui=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function jn(t){return y1(ho,t)}function bc(t,i){return ho===null&&go(t),y1(t,i)}function y1(t,i){var c=i._currentValue;if(i={context:i,memoizedValue:c,next:null},Ui===null){if(t===null)throw Error(s(308));Ui=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else Ui=Ui.next=i;return c}var xw=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(c,h){t.push(h)}};this.abort=function(){i.aborted=!0,t.forEach(function(c){return c()})}},yw=e.unstable_scheduleCallback,vw=e.unstable_NormalPriority,wn={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Bf(){return{controller:new xw,data:new Map,refCount:0}}function $s(t){t.refCount--,t.refCount===0&&yw(vw,function(){t.controller.abort()})}var el=null,kf=0,Qo=0,Jo=null;function ww(t,i){if(el===null){var c=el=[];kf=0,Qo=zd(),Jo={status:"pending",value:void 0,then:function(h){c.push(h)}}}return kf++,i.then(v1,v1),i}function v1(){if(--kf===0&&el!==null){Jo!==null&&(Jo.status="fulfilled");var t=el;el=null,Qo=0,Jo=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function bw(t,i){var c=[],h={status:"pending",value:null,reason:null,then:function(v){c.push(v)}};return t.then(function(){h.status="fulfilled",h.value=i;for(var v=0;v<c.length;v++)(0,c[v])(i)},function(v){for(h.status="rejected",h.reason=v,v=0;v<c.length;v++)(0,c[v])(void 0)}),h}var w1=re.S;re.S=function(t,i){rm=en(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&ww(t,i),w1!==null&&w1(t,i)};var mo=K(null);function Lf(){var t=mo.current;return t!==null?t:Ft.pooledCache}function _c(t,i){i===null?Re(mo,mo.current):Re(mo,i.pool)}function b1(){var t=Lf();return t===null?null:{parent:wn._currentValue,pool:t}}var $o=Error(s(460)),Pf=Error(s(474)),Ec=Error(s(542)),Ac={then:function(){}};function _1(t){return t=t.status,t==="fulfilled"||t==="rejected"}function E1(t,i,c){switch(c=t[c],c===void 0?t.push(i):c!==i&&(i.then(cr,cr),i=c),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,C1(t),t;default:if(typeof i.status=="string")i.then(cr,cr);else{if(t=Ft,t!==null&&100<t.shellSuspendCounter)throw Error(s(482));t=i,t.status="pending",t.then(function(h){if(i.status==="pending"){var v=i;v.status="fulfilled",v.value=h}},function(h){if(i.status==="pending"){var v=i;v.status="rejected",v.reason=h}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,C1(t),t}throw xo=i,$o}}function po(t){try{var i=t._init;return i(t._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(xo=c,$o):c}}var xo=null;function A1(){if(xo===null)throw Error(s(459));var t=xo;return xo=null,t}function C1(t){if(t===$o||t===Ec)throw Error(s(483))}var es=null,tl=0;function Cc(t){var i=tl;return tl+=1,es===null&&(es=[]),E1(es,t,i)}function nl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Sc(t,i){throw i.$$typeof===S?Error(s(525)):(t=Object.prototype.toString.call(i),Error(s(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function S1(t){function i(ne,$){if(t){var ce=ne.deletions;ce===null?(ne.deletions=[$],ne.flags|=16):ce.push($)}}function c(ne,$){if(!t)return null;for(;$!==null;)i(ne,$),$=$.sibling;return null}function h(ne){for(var $=new Map;ne!==null;)ne.key!==null?$.set(ne.key,ne):$.set(ne.index,ne),ne=ne.sibling;return $}function v(ne,$){return ne=Pi(ne,$),ne.index=0,ne.sibling=null,ne}function _(ne,$,ce){return ne.index=ce,t?(ce=ne.alternate,ce!==null?(ce=ce.index,ce<$?(ne.flags|=67108866,$):ce):(ne.flags|=67108866,$)):(ne.flags|=1048576,$)}function O(ne){return t&&ne.alternate===null&&(ne.flags|=67108866),ne}function U(ne,$,ce,ve){return $===null||$.tag!==6?($=Cf(ce,ne.mode,ve),$.return=ne,$):($=v($,ce),$.return=ne,$)}function q(ne,$,ce,ve){var je=ce.type;return je===B?ye(ne,$,ce.props.children,ve,ce.key):$!==null&&($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===de&&po(je)===$.type)?($=v($,ce.props),nl($,ce),$.return=ne,$):($=yc(ce.type,ce.key,ce.props,null,ne.mode,ve),nl($,ce),$.return=ne,$)}function ue(ne,$,ce,ve){return $===null||$.tag!==4||$.stateNode.containerInfo!==ce.containerInfo||$.stateNode.implementation!==ce.implementation?($=Sf(ce,ne.mode,ve),$.return=ne,$):($=v($,ce.children||[]),$.return=ne,$)}function ye(ne,$,ce,ve,je){return $===null||$.tag!==7?($=uo(ce,ne.mode,ve,je),$.return=ne,$):($=v($,ce),$.return=ne,$)}function be(ne,$,ce){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Cf(""+$,ne.mode,ce),$.return=ne,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case R:return ce=yc($.type,$.key,$.props,null,ne.mode,ce),nl(ce,$),ce.return=ne,ce;case I:return $=Sf($,ne.mode,ce),$.return=ne,$;case de:return $=po($),be(ne,$,ce)}if(ie($)||te($))return $=uo($,ne.mode,ce,null),$.return=ne,$;if(typeof $.then=="function")return be(ne,Cc($),ce);if($.$$typeof===j)return be(ne,bc(ne,$),ce);Sc(ne,$)}return null}function fe(ne,$,ce,ve){var je=$!==null?$.key:null;if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return je!==null?null:U(ne,$,""+ce,ve);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case R:return ce.key===je?q(ne,$,ce,ve):null;case I:return ce.key===je?ue(ne,$,ce,ve):null;case de:return ce=po(ce),fe(ne,$,ce,ve)}if(ie(ce)||te(ce))return je!==null?null:ye(ne,$,ce,ve,null);if(typeof ce.then=="function")return fe(ne,$,Cc(ce),ve);if(ce.$$typeof===j)return fe(ne,$,bc(ne,ce),ve);Sc(ne,ce)}return null}function me(ne,$,ce,ve,je){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return ne=ne.get(ce)||null,U($,ne,""+ve,je);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case R:return ne=ne.get(ve.key===null?ce:ve.key)||null,q($,ne,ve,je);case I:return ne=ne.get(ve.key===null?ce:ve.key)||null,ue($,ne,ve,je);case de:return ve=po(ve),me(ne,$,ce,ve,je)}if(ie(ve)||te(ve))return ne=ne.get(ce)||null,ye($,ne,ve,je,null);if(typeof ve.then=="function")return me(ne,$,ce,Cc(ve),je);if(ve.$$typeof===j)return me(ne,$,ce,bc($,ve),je);Sc($,ve)}return null}function Le(ne,$,ce,ve){for(var je=null,bt=null,ze=$,nt=$=0,ht=null;ze!==null&&nt<ce.length;nt++){ze.index>nt?(ht=ze,ze=null):ht=ze.sibling;var _t=fe(ne,ze,ce[nt],ve);if(_t===null){ze===null&&(ze=ht);break}t&&ze&&_t.alternate===null&&i(ne,ze),$=_(_t,$,nt),bt===null?je=_t:bt.sibling=_t,bt=_t,ze=ht}if(nt===ce.length)return c(ne,ze),gt&&zi(ne,nt),je;if(ze===null){for(;nt<ce.length;nt++)ze=be(ne,ce[nt],ve),ze!==null&&($=_(ze,$,nt),bt===null?je=ze:bt.sibling=ze,bt=ze);return gt&&zi(ne,nt),je}for(ze=h(ze);nt<ce.length;nt++)ht=me(ze,ne,nt,ce[nt],ve),ht!==null&&(t&&ht.alternate!==null&&ze.delete(ht.key===null?nt:ht.key),$=_(ht,$,nt),bt===null?je=ht:bt.sibling=ht,bt=ht);return t&&ze.forEach(function(ja){return i(ne,ja)}),gt&&zi(ne,nt),je}function Xe(ne,$,ce,ve){if(ce==null)throw Error(s(151));for(var je=null,bt=null,ze=$,nt=$=0,ht=null,_t=ce.next();ze!==null&&!_t.done;nt++,_t=ce.next()){ze.index>nt?(ht=ze,ze=null):ht=ze.sibling;var ja=fe(ne,ze,_t.value,ve);if(ja===null){ze===null&&(ze=ht);break}t&&ze&&ja.alternate===null&&i(ne,ze),$=_(ja,$,nt),bt===null?je=ja:bt.sibling=ja,bt=ja,ze=ht}if(_t.done)return c(ne,ze),gt&&zi(ne,nt),je;if(ze===null){for(;!_t.done;nt++,_t=ce.next())_t=be(ne,_t.value,ve),_t!==null&&($=_(_t,$,nt),bt===null?je=_t:bt.sibling=_t,bt=_t);return gt&&zi(ne,nt),je}for(ze=h(ze);!_t.done;nt++,_t=ce.next())_t=me(ze,ne,nt,_t.value,ve),_t!==null&&(t&&_t.alternate!==null&&ze.delete(_t.key===null?nt:_t.key),$=_(_t,$,nt),bt===null?je=_t:bt.sibling=_t,bt=_t);return t&&ze.forEach(function(Mb){return i(ne,Mb)}),gt&&zi(ne,nt),je}function Lt(ne,$,ce,ve){if(typeof ce=="object"&&ce!==null&&ce.type===B&&ce.key===null&&(ce=ce.props.children),typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case R:e:{for(var je=ce.key;$!==null;){if($.key===je){if(je=ce.type,je===B){if($.tag===7){c(ne,$.sibling),ve=v($,ce.props.children),ve.return=ne,ne=ve;break e}}else if($.elementType===je||typeof je=="object"&&je!==null&&je.$$typeof===de&&po(je)===$.type){c(ne,$.sibling),ve=v($,ce.props),nl(ve,ce),ve.return=ne,ne=ve;break e}c(ne,$);break}else i(ne,$);$=$.sibling}ce.type===B?(ve=uo(ce.props.children,ne.mode,ve,ce.key),ve.return=ne,ne=ve):(ve=yc(ce.type,ce.key,ce.props,null,ne.mode,ve),nl(ve,ce),ve.return=ne,ne=ve)}return O(ne);case I:e:{for(je=ce.key;$!==null;){if($.key===je)if($.tag===4&&$.stateNode.containerInfo===ce.containerInfo&&$.stateNode.implementation===ce.implementation){c(ne,$.sibling),ve=v($,ce.children||[]),ve.return=ne,ne=ve;break e}else{c(ne,$);break}else i(ne,$);$=$.sibling}ve=Sf(ce,ne.mode,ve),ve.return=ne,ne=ve}return O(ne);case de:return ce=po(ce),Lt(ne,$,ce,ve)}if(ie(ce))return Le(ne,$,ce,ve);if(te(ce)){if(je=te(ce),typeof je!="function")throw Error(s(150));return ce=je.call(ce),Xe(ne,$,ce,ve)}if(typeof ce.then=="function")return Lt(ne,$,Cc(ce),ve);if(ce.$$typeof===j)return Lt(ne,$,bc(ne,ce),ve);Sc(ne,ce)}return typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint"?(ce=""+ce,$!==null&&$.tag===6?(c(ne,$.sibling),ve=v($,ce),ve.return=ne,ne=ve):(c(ne,$),ve=Cf(ce,ne.mode,ve),ve.return=ne,ne=ve),O(ne)):c(ne,$)}return function(ne,$,ce,ve){try{tl=0;var je=Lt(ne,$,ce,ve);return es=null,je}catch(ze){if(ze===$o||ze===Ec)throw ze;var bt=Sr(29,ze,null,ne.mode);return bt.lanes=ve,bt.return=ne,bt}finally{}}}var yo=S1(!0),T1=S1(!1),Aa=!1;function zf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Uf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ca(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Sa(t,i,c){var h=t.updateQueue;if(h===null)return null;if(h=h.shared,(Ct&2)!==0){var v=h.pending;return v===null?i.next=i:(i.next=v.next,v.next=i),h.pending=i,i=xc(t),u1(t,null,c),i}return pc(t,h,i,c),xc(t)}function rl(t,i,c){if(i=i.updateQueue,i!==null&&(i=i.shared,(c&4194048)!==0)){var h=i.lanes;h&=t.pendingLanes,c|=h,i.lanes=c,mi(t,c)}}function Ff(t,i){var c=t.updateQueue,h=t.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var v=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var O={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};_===null?v=_=O:_=_.next=O,c=c.next}while(c!==null);_===null?v=_=i:_=_.next=i}else v=_=i;c={baseState:h.baseState,firstBaseUpdate:v,lastBaseUpdate:_,shared:h.shared,callbacks:h.callbacks},t.updateQueue=c;return}t=c.lastBaseUpdate,t===null?c.firstBaseUpdate=i:t.next=i,c.lastBaseUpdate=i}var jf=!1;function il(){if(jf){var t=Jo;if(t!==null)throw t}}function al(t,i,c,h){jf=!1;var v=t.updateQueue;Aa=!1;var _=v.firstBaseUpdate,O=v.lastBaseUpdate,U=v.shared.pending;if(U!==null){v.shared.pending=null;var q=U,ue=q.next;q.next=null,O===null?_=ue:O.next=ue,O=q;var ye=t.alternate;ye!==null&&(ye=ye.updateQueue,U=ye.lastBaseUpdate,U!==O&&(U===null?ye.firstBaseUpdate=ue:U.next=ue,ye.lastBaseUpdate=q))}if(_!==null){var be=v.baseState;O=0,ye=ue=q=null,U=_;do{var fe=U.lane&-536870913,me=fe!==U.lane;if(me?(dt&fe)===fe:(h&fe)===fe){fe!==0&&fe===Qo&&(jf=!0),ye!==null&&(ye=ye.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var Le=t,Xe=U;fe=i;var Lt=c;switch(Xe.tag){case 1:if(Le=Xe.payload,typeof Le=="function"){be=Le.call(Lt,be,fe);break e}be=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=Xe.payload,fe=typeof Le=="function"?Le.call(Lt,be,fe):Le,fe==null)break e;be=x({},be,fe);break e;case 2:Aa=!0}}fe=U.callback,fe!==null&&(t.flags|=64,me&&(t.flags|=8192),me=v.callbacks,me===null?v.callbacks=[fe]:me.push(fe))}else me={lane:fe,tag:U.tag,payload:U.payload,callback:U.callback,next:null},ye===null?(ue=ye=me,q=be):ye=ye.next=me,O|=fe;if(U=U.next,U===null){if(U=v.shared.pending,U===null)break;me=U,U=me.next,me.next=null,v.lastBaseUpdate=me,v.shared.pending=null}}while(!0);ye===null&&(q=be),v.baseState=q,v.firstBaseUpdate=ue,v.lastBaseUpdate=ye,_===null&&(v.shared.lanes=0),Ia|=O,t.lanes=O,t.memoizedState=be}}function R1(t,i){if(typeof t!="function")throw Error(s(191,t));t.call(i)}function N1(t,i){var c=t.callbacks;if(c!==null)for(t.callbacks=null,t=0;t<c.length;t++)R1(c[t],i)}var ts=K(null),Tc=K(0);function O1(t,i){t=Wi,Re(Tc,t),Re(ts,i),Wi=t|i.baseLanes}function Vf(){Re(Tc,Wi),Re(ts,ts.current)}function Hf(){Wi=Tc.current,oe(ts),oe(Tc)}var Tr=K(null),Xr=null;function Ta(t){var i=t.alternate;Re(mn,mn.current&1),Re(Tr,t),Xr===null&&(i===null||ts.current!==null||i.memoizedState!==null)&&(Xr=t)}function Gf(t){Re(mn,mn.current),Re(Tr,t),Xr===null&&(Xr=t)}function I1(t){t.tag===22?(Re(mn,mn.current),Re(Tr,t),Xr===null&&(Xr=t)):Ra()}function Ra(){Re(mn,mn.current),Re(Tr,Tr.current)}function Rr(t){oe(Tr),Xr===t&&(Xr=null),oe(mn)}var mn=K(0);function Rc(t){for(var i=t;i!==null;){if(i.tag===13){var c=i.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Kd(c)||Qd(c)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var ji=0,$e=null,Bt=null,bn=null,Nc=!1,ns=!1,vo=!1,Oc=0,ol=0,rs=null,_w=0;function ln(){throw Error(s(321))}function Zf(t,i){if(i===null)return!1;for(var c=0;c<i.length&&c<t.length;c++)if(!m(t[c],i[c]))return!1;return!0}function Xf(t,i,c,h,v,_){return ji=_,$e=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,re.H=t===null||t.memoizedState===null?gg:sd,vo=!1,_=c(h,v),vo=!1,ns&&(_=D1(i,c,h,v)),M1(t),_}function M1(t){re.H=cl;var i=Bt!==null&&Bt.next!==null;if(ji=0,bn=Bt=$e=null,Nc=!1,ol=0,rs=null,i)throw Error(s(300));t===null||_n||(t=t.dependencies,t!==null&&wc(t)&&(_n=!0))}function D1(t,i,c,h){$e=t;var v=0;do{if(ns&&(rs=null),ol=0,ns=!1,25<=v)throw Error(s(301));if(v+=1,bn=Bt=null,t.updateQueue!=null){var _=t.updateQueue;_.lastEffect=null,_.events=null,_.stores=null,_.memoCache!=null&&(_.memoCache.index=0)}re.H=mg,_=i(c,h)}while(ns);return _}function Ew(){var t=re.H,i=t.useState()[0];return i=typeof i.then=="function"?sl(i):i,t=t.useState()[0],(Bt!==null?Bt.memoizedState:null)!==t&&($e.flags|=1024),i}function Yf(){var t=Oc!==0;return Oc=0,t}function qf(t,i,c){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~c}function Wf(t){if(Nc){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Nc=!1}ji=0,bn=Bt=$e=null,ns=!1,ol=Oc=0,rs=null}function nr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bn===null?$e.memoizedState=bn=t:bn=bn.next=t,bn}function pn(){if(Bt===null){var t=$e.alternate;t=t!==null?t.memoizedState:null}else t=Bt.next;var i=bn===null?$e.memoizedState:bn.next;if(i!==null)bn=i,Bt=t;else{if(t===null)throw $e.alternate===null?Error(s(467)):Error(s(310));Bt=t,t={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},bn===null?$e.memoizedState=bn=t:bn=bn.next=t}return bn}function Ic(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function sl(t){var i=ol;return ol+=1,rs===null&&(rs=[]),t=E1(rs,t,i),i=$e,(bn===null?i.memoizedState:bn.next)===null&&(i=i.alternate,re.H=i===null||i.memoizedState===null?gg:sd),t}function Mc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return sl(t);if(t.$$typeof===j)return jn(t)}throw Error(s(438,String(t)))}function Kf(t){var i=null,c=$e.updateQueue;if(c!==null&&(i=c.memoCache),i==null){var h=$e.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(i={data:h.data.map(function(v){return v.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),c===null&&(c=Ic(),$e.updateQueue=c),c.memoCache=i,c=i.data[i.index],c===void 0)for(c=i.data[i.index]=Array(t),h=0;h<t;h++)c[h]=we;return i.index++,c}function Vi(t,i){return typeof i=="function"?i(t):i}function Dc(t){var i=pn();return Qf(i,Bt,t)}function Qf(t,i,c){var h=t.queue;if(h===null)throw Error(s(311));h.lastRenderedReducer=c;var v=t.baseQueue,_=h.pending;if(_!==null){if(v!==null){var O=v.next;v.next=_.next,_.next=O}i.baseQueue=v=_,h.pending=null}if(_=t.baseState,v===null)t.memoizedState=_;else{i=v.next;var U=O=null,q=null,ue=i,ye=!1;do{var be=ue.lane&-536870913;if(be!==ue.lane?(dt&be)===be:(ji&be)===be){var fe=ue.revertLane;if(fe===0)q!==null&&(q=q.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),be===Qo&&(ye=!0);else if((ji&fe)===fe){ue=ue.next,fe===Qo&&(ye=!0);continue}else be={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},q===null?(U=q=be,O=_):q=q.next=be,$e.lanes|=fe,Ia|=fe;be=ue.action,vo&&c(_,be),_=ue.hasEagerState?ue.eagerState:c(_,be)}else fe={lane:be,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},q===null?(U=q=fe,O=_):q=q.next=fe,$e.lanes|=be,Ia|=be;ue=ue.next}while(ue!==null&&ue!==i);if(q===null?O=_:q.next=U,!m(_,t.memoizedState)&&(_n=!0,ye&&(c=Jo,c!==null)))throw c;t.memoizedState=_,t.baseState=O,t.baseQueue=q,h.lastRenderedState=_}return v===null&&(h.lanes=0),[t.memoizedState,h.dispatch]}function Jf(t){var i=pn(),c=i.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=t;var h=c.dispatch,v=c.pending,_=i.memoizedState;if(v!==null){c.pending=null;var O=v=v.next;do _=t(_,O.action),O=O.next;while(O!==v);m(_,i.memoizedState)||(_n=!0),i.memoizedState=_,i.baseQueue===null&&(i.baseState=_),c.lastRenderedState=_}return[_,h]}function B1(t,i,c){var h=$e,v=pn(),_=gt;if(_){if(c===void 0)throw Error(s(407));c=c()}else c=i();var O=!m((Bt||v).memoizedState,c);if(O&&(v.memoizedState=c,_n=!0),v=v.queue,td(P1.bind(null,h,v,t),[t]),v.getSnapshot!==i||O||bn!==null&&bn.memoizedState.tag&1){if(h.flags|=2048,is(9,{destroy:void 0},L1.bind(null,h,v,c,i),null),Ft===null)throw Error(s(349));_||(ji&127)!==0||k1(h,i,c)}return c}function k1(t,i,c){t.flags|=16384,t={getSnapshot:i,value:c},i=$e.updateQueue,i===null?(i=Ic(),$e.updateQueue=i,i.stores=[t]):(c=i.stores,c===null?i.stores=[t]:c.push(t))}function L1(t,i,c,h){i.value=c,i.getSnapshot=h,z1(i)&&U1(t)}function P1(t,i,c){return c(function(){z1(i)&&U1(t)})}function z1(t){var i=t.getSnapshot;t=t.value;try{var c=i();return!m(t,c)}catch{return!0}}function U1(t){var i=co(t,2);i!==null&&pr(i,t,2)}function $f(t){var i=nr();if(typeof t=="function"){var c=t;if(t=c(),vo){Dt(!0);try{c()}finally{Dt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:t},i}function F1(t,i,c,h){return t.baseState=c,Qf(t,Bt,typeof h=="function"?h:Vi)}function Aw(t,i,c,h,v){if(Lc(t))throw Error(s(485));if(t=i.action,t!==null){var _={payload:v,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){_.listeners.push(O)}};re.T!==null?c(!0):_.isTransition=!1,h(_),c=i.pending,c===null?(_.next=i.pending=_,j1(i,_)):(_.next=c.next,i.pending=c.next=_)}}function j1(t,i){var c=i.action,h=i.payload,v=t.state;if(i.isTransition){var _=re.T,O={};re.T=O;try{var U=c(v,h),q=re.S;q!==null&&q(O,U),V1(t,i,U)}catch(ue){ed(t,i,ue)}finally{_!==null&&O.types!==null&&(_.types=O.types),re.T=_}}else try{_=c(v,h),V1(t,i,_)}catch(ue){ed(t,i,ue)}}function V1(t,i,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){H1(t,i,h)},function(h){return ed(t,i,h)}):H1(t,i,c)}function H1(t,i,c){i.status="fulfilled",i.value=c,G1(i),t.state=c,i=t.pending,i!==null&&(c=i.next,c===i?t.pending=null:(c=c.next,i.next=c,j1(t,c)))}function ed(t,i,c){var h=t.pending;if(t.pending=null,h!==null){h=h.next;do i.status="rejected",i.reason=c,G1(i),i=i.next;while(i!==h)}t.action=null}function G1(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Z1(t,i){return i}function X1(t,i){if(gt){var c=Ft.formState;if(c!==null){e:{var h=$e;if(gt){if(Zt){t:{for(var v=Zt,_=Zr;v.nodeType!==8;){if(!_){v=null;break t}if(v=Yr(v.nextSibling),v===null){v=null;break t}}_=v.data,v=_==="F!"||_==="F"?v:null}if(v){Zt=Yr(v.nextSibling),h=v.data==="F!";break e}}_a(h)}h=!1}h&&(i=c[0])}}return c=nr(),c.memoizedState=c.baseState=i,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Z1,lastRenderedState:i},c.queue=h,c=fg.bind(null,$e,h),h.dispatch=c,h=$f(!1),_=od.bind(null,$e,!1,h.queue),h=nr(),v={state:i,dispatch:null,action:t,pending:null},h.queue=v,c=Aw.bind(null,$e,v,_,c),v.dispatch=c,h.memoizedState=t,[i,c,!1]}function Y1(t){var i=pn();return q1(i,Bt,t)}function q1(t,i,c){if(i=Qf(t,i,Z1)[0],t=Dc(Vi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var h=sl(i)}catch(O){throw O===$o?Ec:O}else h=i;i=pn();var v=i.queue,_=v.dispatch;return c!==i.memoizedState&&($e.flags|=2048,is(9,{destroy:void 0},Cw.bind(null,v,c),null)),[h,_,t]}function Cw(t,i){t.action=i}function W1(t){var i=pn(),c=Bt;if(c!==null)return q1(i,c,t);pn(),i=i.memoizedState,c=pn();var h=c.queue.dispatch;return c.memoizedState=t,[i,h,!1]}function is(t,i,c,h){return t={tag:t,create:c,deps:h,inst:i,next:null},i=$e.updateQueue,i===null&&(i=Ic(),$e.updateQueue=i),c=i.lastEffect,c===null?i.lastEffect=t.next=t:(h=c.next,c.next=t,t.next=h,i.lastEffect=t),t}function K1(){return pn().memoizedState}function Bc(t,i,c,h){var v=nr();$e.flags|=t,v.memoizedState=is(1|i,{destroy:void 0},c,h===void 0?null:h)}function kc(t,i,c,h){var v=pn();h=h===void 0?null:h;var _=v.memoizedState.inst;Bt!==null&&h!==null&&Zf(h,Bt.memoizedState.deps)?v.memoizedState=is(i,_,c,h):($e.flags|=t,v.memoizedState=is(1|i,_,c,h))}function Q1(t,i){Bc(8390656,8,t,i)}function td(t,i){kc(2048,8,t,i)}function Sw(t){$e.flags|=4;var i=$e.updateQueue;if(i===null)i=Ic(),$e.updateQueue=i,i.events=[t];else{var c=i.events;c===null?i.events=[t]:c.push(t)}}function J1(t){var i=pn().memoizedState;return Sw({ref:i,nextImpl:t}),function(){if((Ct&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}function $1(t,i){return kc(4,2,t,i)}function eg(t,i){return kc(4,4,t,i)}function tg(t,i){if(typeof i=="function"){t=t();var c=i(t);return function(){typeof c=="function"?c():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function ng(t,i,c){c=c!=null?c.concat([t]):null,kc(4,4,tg.bind(null,i,t),c)}function nd(){}function rg(t,i){var c=pn();i=i===void 0?null:i;var h=c.memoizedState;return i!==null&&Zf(i,h[1])?h[0]:(c.memoizedState=[t,i],t)}function ig(t,i){var c=pn();i=i===void 0?null:i;var h=c.memoizedState;if(i!==null&&Zf(i,h[1]))return h[0];if(h=t(),vo){Dt(!0);try{t()}finally{Dt(!1)}}return c.memoizedState=[h,i],h}function rd(t,i,c){return c===void 0||(ji&1073741824)!==0&&(dt&261930)===0?t.memoizedState=i:(t.memoizedState=c,t=am(),$e.lanes|=t,Ia|=t,c)}function ag(t,i,c,h){return m(c,i)?c:ts.current!==null?(t=rd(t,c,h),m(t,i)||(_n=!0),t):(ji&42)===0||(ji&1073741824)!==0&&(dt&261930)===0?(_n=!0,t.memoizedState=c):(t=am(),$e.lanes|=t,Ia|=t,i)}function og(t,i,c,h,v){var _=xe.p;xe.p=_!==0&&8>_?_:8;var O=re.T,U={};re.T=U,od(t,!1,i,c);try{var q=v(),ue=re.S;if(ue!==null&&ue(U,q),q!==null&&typeof q=="object"&&typeof q.then=="function"){var ye=bw(q,h);ll(t,i,ye,Ir(t))}else ll(t,i,h,Ir(t))}catch(be){ll(t,i,{then:function(){},status:"rejected",reason:be},Ir())}finally{xe.p=_,O!==null&&U.types!==null&&(O.types=U.types),re.T=O}}function Tw(){}function id(t,i,c,h){if(t.tag!==5)throw Error(s(476));var v=sg(t).queue;og(t,v,i,Me,c===null?Tw:function(){return lg(t),c(h)})}function sg(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Me,baseState:Me,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:Me},next:null};var c={};return i.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vi,lastRenderedState:c},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function lg(t){var i=sg(t);i.next===null&&(i=t.alternate.memoizedState),ll(t,i.next.queue,{},Ir())}function ad(){return jn(Cl)}function cg(){return pn().memoizedState}function ug(){return pn().memoizedState}function Rw(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var c=Ir();t=Ca(c);var h=Sa(i,t,c);h!==null&&(pr(h,i,c),rl(h,i,c)),i={cache:Bf()},t.payload=i;return}i=i.return}}function Nw(t,i,c){var h=Ir();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},Lc(t)?dg(i,c):(c=Ef(t,i,c,h),c!==null&&(pr(c,t,h),hg(c,i,h)))}function fg(t,i,c){var h=Ir();ll(t,i,c,h)}function ll(t,i,c,h){var v={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(Lc(t))dg(i,v);else{var _=t.alternate;if(t.lanes===0&&(_===null||_.lanes===0)&&(_=i.lastRenderedReducer,_!==null))try{var O=i.lastRenderedState,U=_(O,c);if(v.hasEagerState=!0,v.eagerState=U,m(U,O))return pc(t,i,v,0),Ft===null&&mc(),!1}catch{}finally{}if(c=Ef(t,i,v,h),c!==null)return pr(c,t,h),hg(c,i,h),!0}return!1}function od(t,i,c,h){if(h={lane:2,revertLane:zd(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},Lc(t)){if(i)throw Error(s(479))}else i=Ef(t,c,h,2),i!==null&&pr(i,t,2)}function Lc(t){var i=t.alternate;return t===$e||i!==null&&i===$e}function dg(t,i){ns=Nc=!0;var c=t.pending;c===null?i.next=i:(i.next=c.next,c.next=i),t.pending=i}function hg(t,i,c){if((c&4194048)!==0){var h=i.lanes;h&=t.pendingLanes,c|=h,i.lanes=c,mi(t,c)}}var cl={readContext:jn,use:Mc,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useLayoutEffect:ln,useInsertionEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useSyncExternalStore:ln,useId:ln,useHostTransitionStatus:ln,useFormState:ln,useActionState:ln,useOptimistic:ln,useMemoCache:ln,useCacheRefresh:ln};cl.useEffectEvent=ln;var gg={readContext:jn,use:Mc,useCallback:function(t,i){return nr().memoizedState=[t,i===void 0?null:i],t},useContext:jn,useEffect:Q1,useImperativeHandle:function(t,i,c){c=c!=null?c.concat([t]):null,Bc(4194308,4,tg.bind(null,i,t),c)},useLayoutEffect:function(t,i){return Bc(4194308,4,t,i)},useInsertionEffect:function(t,i){Bc(4,2,t,i)},useMemo:function(t,i){var c=nr();i=i===void 0?null:i;var h=t();if(vo){Dt(!0);try{t()}finally{Dt(!1)}}return c.memoizedState=[h,i],h},useReducer:function(t,i,c){var h=nr();if(c!==void 0){var v=c(i);if(vo){Dt(!0);try{c(i)}finally{Dt(!1)}}}else v=i;return h.memoizedState=h.baseState=v,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:v},h.queue=t,t=t.dispatch=Nw.bind(null,$e,t),[h.memoizedState,t]},useRef:function(t){var i=nr();return t={current:t},i.memoizedState=t},useState:function(t){t=$f(t);var i=t.queue,c=fg.bind(null,$e,i);return i.dispatch=c,[t.memoizedState,c]},useDebugValue:nd,useDeferredValue:function(t,i){var c=nr();return rd(c,t,i)},useTransition:function(){var t=$f(!1);return t=og.bind(null,$e,t.queue,!0,!1),nr().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,c){var h=$e,v=nr();if(gt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=i(),Ft===null)throw Error(s(349));(dt&127)!==0||k1(h,i,c)}v.memoizedState=c;var _={value:c,getSnapshot:i};return v.queue=_,Q1(P1.bind(null,h,_,t),[t]),h.flags|=2048,is(9,{destroy:void 0},L1.bind(null,h,_,c,i),null),c},useId:function(){var t=nr(),i=Ft.identifierPrefix;if(gt){var c=bi,h=wi;c=(h&~(1<<32-et(h)-1)).toString(32)+c,i="_"+i+"R_"+c,c=Oc++,0<c&&(i+="H"+c.toString(32)),i+="_"}else c=_w++,i="_"+i+"r_"+c.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:ad,useFormState:X1,useActionState:X1,useOptimistic:function(t){var i=nr();i.memoizedState=i.baseState=t;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=c,i=od.bind(null,$e,!0,c),c.dispatch=i,[t,i]},useMemoCache:Kf,useCacheRefresh:function(){return nr().memoizedState=Rw.bind(null,$e)},useEffectEvent:function(t){var i=nr(),c={impl:t};return i.memoizedState=c,function(){if((Ct&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},sd={readContext:jn,use:Mc,useCallback:rg,useContext:jn,useEffect:td,useImperativeHandle:ng,useInsertionEffect:$1,useLayoutEffect:eg,useMemo:ig,useReducer:Dc,useRef:K1,useState:function(){return Dc(Vi)},useDebugValue:nd,useDeferredValue:function(t,i){var c=pn();return ag(c,Bt.memoizedState,t,i)},useTransition:function(){var t=Dc(Vi)[0],i=pn().memoizedState;return[typeof t=="boolean"?t:sl(t),i]},useSyncExternalStore:B1,useId:cg,useHostTransitionStatus:ad,useFormState:Y1,useActionState:Y1,useOptimistic:function(t,i){var c=pn();return F1(c,Bt,t,i)},useMemoCache:Kf,useCacheRefresh:ug};sd.useEffectEvent=J1;var mg={readContext:jn,use:Mc,useCallback:rg,useContext:jn,useEffect:td,useImperativeHandle:ng,useInsertionEffect:$1,useLayoutEffect:eg,useMemo:ig,useReducer:Jf,useRef:K1,useState:function(){return Jf(Vi)},useDebugValue:nd,useDeferredValue:function(t,i){var c=pn();return Bt===null?rd(c,t,i):ag(c,Bt.memoizedState,t,i)},useTransition:function(){var t=Jf(Vi)[0],i=pn().memoizedState;return[typeof t=="boolean"?t:sl(t),i]},useSyncExternalStore:B1,useId:cg,useHostTransitionStatus:ad,useFormState:W1,useActionState:W1,useOptimistic:function(t,i){var c=pn();return Bt!==null?F1(c,Bt,t,i):(c.baseState=t,[t,c.queue.dispatch])},useMemoCache:Kf,useCacheRefresh:ug};mg.useEffectEvent=J1;function ld(t,i,c,h){i=t.memoizedState,c=c(h,i),c=c==null?i:x({},i,c),t.memoizedState=c,t.lanes===0&&(t.updateQueue.baseState=c)}var cd={enqueueSetState:function(t,i,c){t=t._reactInternals;var h=Ir(),v=Ca(h);v.payload=i,c!=null&&(v.callback=c),i=Sa(t,v,h),i!==null&&(pr(i,t,h),rl(i,t,h))},enqueueReplaceState:function(t,i,c){t=t._reactInternals;var h=Ir(),v=Ca(h);v.tag=1,v.payload=i,c!=null&&(v.callback=c),i=Sa(t,v,h),i!==null&&(pr(i,t,h),rl(i,t,h))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var c=Ir(),h=Ca(c);h.tag=2,i!=null&&(h.callback=i),i=Sa(t,h,c),i!==null&&(pr(i,t,c),rl(i,t,c))}};function pg(t,i,c,h,v,_,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(h,_,O):i.prototype&&i.prototype.isPureReactComponent?!p(c,h)||!p(v,_):!0}function xg(t,i,c,h){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(c,h),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(c,h),i.state!==t&&cd.enqueueReplaceState(i,i.state,null)}function wo(t,i){var c=i;if("ref"in i){c={};for(var h in i)h!=="ref"&&(c[h]=i[h])}if(t=t.defaultProps){c===i&&(c=x({},c));for(var v in t)c[v]===void 0&&(c[v]=t[v])}return c}function yg(t){gc(t)}function vg(t){console.error(t)}function wg(t){gc(t)}function Pc(t,i){try{var c=t.onUncaughtError;c(i.value,{componentStack:i.stack})}catch(h){setTimeout(function(){throw h})}}function bg(t,i,c){try{var h=t.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(v){setTimeout(function(){throw v})}}function ud(t,i,c){return c=Ca(c),c.tag=3,c.payload={element:null},c.callback=function(){Pc(t,i)},c}function _g(t){return t=Ca(t),t.tag=3,t}function Eg(t,i,c,h){var v=c.type.getDerivedStateFromError;if(typeof v=="function"){var _=h.value;t.payload=function(){return v(_)},t.callback=function(){bg(i,c,h)}}var O=c.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){bg(i,c,h),typeof v!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var U=h.stack;this.componentDidCatch(h.value,{componentStack:U!==null?U:""})})}function Ow(t,i,c,h,v){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(i=c.alternate,i!==null&&Ko(i,c,v,!0),c=Tr.current,c!==null){switch(c.tag){case 31:case 13:return Xr===null?Wc():c.alternate===null&&cn===0&&(cn=3),c.flags&=-257,c.flags|=65536,c.lanes=v,h===Ac?c.flags|=16384:(i=c.updateQueue,i===null?c.updateQueue=new Set([h]):i.add(h),kd(t,h,v)),!1;case 22:return c.flags|=65536,h===Ac?c.flags|=16384:(i=c.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=i):(c=i.retryQueue,c===null?i.retryQueue=new Set([h]):c.add(h)),kd(t,h,v)),!1}throw Error(s(435,c.tag))}return kd(t,h,v),Wc(),!1}if(gt)return i=Tr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=v,h!==Nf&&(t=Error(s(422),{cause:h}),Js(Vr(t,c)))):(h!==Nf&&(i=Error(s(423),{cause:h}),Js(Vr(i,c))),t=t.current.alternate,t.flags|=65536,v&=-v,t.lanes|=v,h=Vr(h,c),v=ud(t.stateNode,h,v),Ff(t,v),cn!==4&&(cn=2)),!1;var _=Error(s(520),{cause:h});if(_=Vr(_,c),xl===null?xl=[_]:xl.push(_),cn!==4&&(cn=2),i===null)return!0;h=Vr(h,c),c=i;do{switch(c.tag){case 3:return c.flags|=65536,t=v&-v,c.lanes|=t,t=ud(c.stateNode,h,t),Ff(c,t),!1;case 1:if(i=c.type,_=c.stateNode,(c.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||_!==null&&typeof _.componentDidCatch=="function"&&(Ma===null||!Ma.has(_))))return c.flags|=65536,v&=-v,c.lanes|=v,v=_g(v),Eg(v,t,c,h),Ff(c,v),!1}c=c.return}while(c!==null);return!1}var fd=Error(s(461)),_n=!1;function Vn(t,i,c,h){i.child=t===null?T1(i,null,c,h):yo(i,t.child,c,h)}function Ag(t,i,c,h,v){c=c.render;var _=i.ref;if("ref"in h){var O={};for(var U in h)U!=="ref"&&(O[U]=h[U])}else O=h;return go(i),h=Xf(t,i,c,O,_,v),U=Yf(),t!==null&&!_n?(qf(t,i,v),Hi(t,i,v)):(gt&&U&&Tf(i),i.flags|=1,Vn(t,i,h,v),i.child)}function Cg(t,i,c,h,v){if(t===null){var _=c.type;return typeof _=="function"&&!Af(_)&&_.defaultProps===void 0&&c.compare===null?(i.tag=15,i.type=_,Sg(t,i,_,h,v)):(t=yc(c.type,null,h,i,i.mode,v),t.ref=i.ref,t.return=i,i.child=t)}if(_=t.child,!vd(t,v)){var O=_.memoizedProps;if(c=c.compare,c=c!==null?c:p,c(O,h)&&t.ref===i.ref)return Hi(t,i,v)}return i.flags|=1,t=Pi(_,h),t.ref=i.ref,t.return=i,i.child=t}function Sg(t,i,c,h,v){if(t!==null){var _=t.memoizedProps;if(p(_,h)&&t.ref===i.ref)if(_n=!1,i.pendingProps=h=_,vd(t,v))(t.flags&131072)!==0&&(_n=!0);else return i.lanes=t.lanes,Hi(t,i,v)}return dd(t,i,c,h,v)}function Tg(t,i,c,h){var v=h.children,_=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((i.flags&128)!==0){if(_=_!==null?_.baseLanes|c:c,t!==null){for(h=i.child=t.child,v=0;h!==null;)v=v|h.lanes|h.childLanes,h=h.sibling;h=v&~_}else h=0,i.child=null;return Rg(t,i,_,c,h)}if((c&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&_c(i,_!==null?_.cachePool:null),_!==null?O1(i,_):Vf(),I1(i);else return h=i.lanes=536870912,Rg(t,i,_!==null?_.baseLanes|c:c,c,h)}else _!==null?(_c(i,_.cachePool),O1(i,_),Ra(),i.memoizedState=null):(t!==null&&_c(i,null),Vf(),Ra());return Vn(t,i,v,c),i.child}function ul(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Rg(t,i,c,h,v){var _=Lf();return _=_===null?null:{parent:wn._currentValue,pool:_},i.memoizedState={baseLanes:c,cachePool:_},t!==null&&_c(i,null),Vf(),I1(i),t!==null&&Ko(t,i,h,!0),i.childLanes=v,null}function zc(t,i){return i=Fc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function Ng(t,i,c){return yo(i,t.child,null,c),t=zc(i,i.pendingProps),t.flags|=2,Rr(i),i.memoizedState=null,t}function Iw(t,i,c){var h=i.pendingProps,v=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(gt){if(h.mode==="hidden")return t=zc(i,h),i.lanes=536870912,ul(null,t);if(Gf(i),(t=Zt)?(t=jm(t,Zr),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:wa!==null?{id:wi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},c=d1(t),c.return=i,i.child=c,Fn=i,Zt=null)):t=null,t===null)throw _a(i);return i.lanes=536870912,null}return zc(i,h)}var _=t.memoizedState;if(_!==null){var O=_.dehydrated;if(Gf(i),v)if(i.flags&256)i.flags&=-257,i=Ng(t,i,c);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(s(558));else if(_n||Ko(t,i,c,!1),v=(c&t.childLanes)!==0,_n||v){if(h=Ft,h!==null&&(O=Bo(h,c),O!==0&&O!==_.retryLane))throw _.retryLane=O,co(t,O),pr(h,t,O),fd;Wc(),i=Ng(t,i,c)}else t=_.treeContext,Zt=Yr(O.nextSibling),Fn=i,gt=!0,ba=null,Zr=!1,t!==null&&m1(i,t),i=zc(i,h),i.flags|=4096;return i}return t=Pi(t.child,{mode:h.mode,children:h.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Uc(t,i){var c=i.ref;if(c===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(t===null||t.ref!==c)&&(i.flags|=4194816)}}function dd(t,i,c,h,v){return go(i),c=Xf(t,i,c,h,void 0,v),h=Yf(),t!==null&&!_n?(qf(t,i,v),Hi(t,i,v)):(gt&&h&&Tf(i),i.flags|=1,Vn(t,i,c,v),i.child)}function Og(t,i,c,h,v,_){return go(i),i.updateQueue=null,c=D1(i,h,c,v),M1(t),h=Yf(),t!==null&&!_n?(qf(t,i,_),Hi(t,i,_)):(gt&&h&&Tf(i),i.flags|=1,Vn(t,i,c,_),i.child)}function Ig(t,i,c,h,v){if(go(i),i.stateNode===null){var _=Xo,O=c.contextType;typeof O=="object"&&O!==null&&(_=jn(O)),_=new c(h,_),i.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=cd,i.stateNode=_,_._reactInternals=i,_=i.stateNode,_.props=h,_.state=i.memoizedState,_.refs={},zf(i),O=c.contextType,_.context=typeof O=="object"&&O!==null?jn(O):Xo,_.state=i.memoizedState,O=c.getDerivedStateFromProps,typeof O=="function"&&(ld(i,c,O,h),_.state=i.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof _.getSnapshotBeforeUpdate=="function"||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(O=_.state,typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount(),O!==_.state&&cd.enqueueReplaceState(_,_.state,null),al(i,h,_,v),il(),_.state=i.memoizedState),typeof _.componentDidMount=="function"&&(i.flags|=4194308),h=!0}else if(t===null){_=i.stateNode;var U=i.memoizedProps,q=wo(c,U);_.props=q;var ue=_.context,ye=c.contextType;O=Xo,typeof ye=="object"&&ye!==null&&(O=jn(ye));var be=c.getDerivedStateFromProps;ye=typeof be=="function"||typeof _.getSnapshotBeforeUpdate=="function",U=i.pendingProps!==U,ye||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(U||ue!==O)&&xg(i,_,h,O),Aa=!1;var fe=i.memoizedState;_.state=fe,al(i,h,_,v),il(),ue=i.memoizedState,U||fe!==ue||Aa?(typeof be=="function"&&(ld(i,c,be,h),ue=i.memoizedState),(q=Aa||pg(i,c,q,h,fe,ue,O))?(ye||typeof _.UNSAFE_componentWillMount!="function"&&typeof _.componentWillMount!="function"||(typeof _.componentWillMount=="function"&&_.componentWillMount(),typeof _.UNSAFE_componentWillMount=="function"&&_.UNSAFE_componentWillMount()),typeof _.componentDidMount=="function"&&(i.flags|=4194308)):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=h,i.memoizedState=ue),_.props=h,_.state=ue,_.context=O,h=q):(typeof _.componentDidMount=="function"&&(i.flags|=4194308),h=!1)}else{_=i.stateNode,Uf(t,i),O=i.memoizedProps,ye=wo(c,O),_.props=ye,be=i.pendingProps,fe=_.context,ue=c.contextType,q=Xo,typeof ue=="object"&&ue!==null&&(q=jn(ue)),U=c.getDerivedStateFromProps,(ue=typeof U=="function"||typeof _.getSnapshotBeforeUpdate=="function")||typeof _.UNSAFE_componentWillReceiveProps!="function"&&typeof _.componentWillReceiveProps!="function"||(O!==be||fe!==q)&&xg(i,_,h,q),Aa=!1,fe=i.memoizedState,_.state=fe,al(i,h,_,v),il();var me=i.memoizedState;O!==be||fe!==me||Aa||t!==null&&t.dependencies!==null&&wc(t.dependencies)?(typeof U=="function"&&(ld(i,c,U,h),me=i.memoizedState),(ye=Aa||pg(i,c,ye,h,fe,me,q)||t!==null&&t.dependencies!==null&&wc(t.dependencies))?(ue||typeof _.UNSAFE_componentWillUpdate!="function"&&typeof _.componentWillUpdate!="function"||(typeof _.componentWillUpdate=="function"&&_.componentWillUpdate(h,me,q),typeof _.UNSAFE_componentWillUpdate=="function"&&_.UNSAFE_componentWillUpdate(h,me,q)),typeof _.componentDidUpdate=="function"&&(i.flags|=4),typeof _.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof _.componentDidUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=1024),i.memoizedProps=h,i.memoizedState=me),_.props=h,_.state=me,_.context=q,h=ye):(typeof _.componentDidUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=4),typeof _.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&fe===t.memoizedState||(i.flags|=1024),h=!1)}return _=h,Uc(t,i),h=(i.flags&128)!==0,_||h?(_=i.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:_.render(),i.flags|=1,t!==null&&h?(i.child=yo(i,t.child,null,v),i.child=yo(i,null,c,v)):Vn(t,i,c,v),i.memoizedState=_.state,t=i.child):t=Hi(t,i,v),t}function Mg(t,i,c,h){return fo(),i.flags|=256,Vn(t,i,c,h),i.child}var hd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function gd(t){return{baseLanes:t,cachePool:b1()}}function md(t,i,c){return t=t!==null?t.childLanes&~c:0,i&&(t|=Or),t}function Dg(t,i,c){var h=i.pendingProps,v=!1,_=(i.flags&128)!==0,O;if((O=_)||(O=t!==null&&t.memoizedState===null?!1:(mn.current&2)!==0),O&&(v=!0,i.flags&=-129),O=(i.flags&32)!==0,i.flags&=-33,t===null){if(gt){if(v?Ta(i):Ra(),(t=Zt)?(t=jm(t,Zr),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:wa!==null?{id:wi,overflow:bi}:null,retryLane:536870912,hydrationErrors:null},c=d1(t),c.return=i,i.child=c,Fn=i,Zt=null)):t=null,t===null)throw _a(i);return Qd(t)?i.lanes=32:i.lanes=536870912,null}var U=h.children;return h=h.fallback,v?(Ra(),v=i.mode,U=Fc({mode:"hidden",children:U},v),h=uo(h,v,c,null),U.return=i,h.return=i,U.sibling=h,i.child=U,h=i.child,h.memoizedState=gd(c),h.childLanes=md(t,O,c),i.memoizedState=hd,ul(null,h)):(Ta(i),pd(i,U))}var q=t.memoizedState;if(q!==null&&(U=q.dehydrated,U!==null)){if(_)i.flags&256?(Ta(i),i.flags&=-257,i=xd(t,i,c)):i.memoizedState!==null?(Ra(),i.child=t.child,i.flags|=128,i=null):(Ra(),U=h.fallback,v=i.mode,h=Fc({mode:"visible",children:h.children},v),U=uo(U,v,c,null),U.flags|=2,h.return=i,U.return=i,h.sibling=U,i.child=h,yo(i,t.child,null,c),h=i.child,h.memoizedState=gd(c),h.childLanes=md(t,O,c),i.memoizedState=hd,i=ul(null,h));else if(Ta(i),Qd(U)){if(O=U.nextSibling&&U.nextSibling.dataset,O)var ue=O.dgst;O=ue,h=Error(s(419)),h.stack="",h.digest=O,Js({value:h,source:null,stack:null}),i=xd(t,i,c)}else if(_n||Ko(t,i,c,!1),O=(c&t.childLanes)!==0,_n||O){if(O=Ft,O!==null&&(h=Bo(O,c),h!==0&&h!==q.retryLane))throw q.retryLane=h,co(t,h),pr(O,t,h),fd;Kd(U)||Wc(),i=xd(t,i,c)}else Kd(U)?(i.flags|=192,i.child=t.child,i=null):(t=q.treeContext,Zt=Yr(U.nextSibling),Fn=i,gt=!0,ba=null,Zr=!1,t!==null&&m1(i,t),i=pd(i,h.children),i.flags|=4096);return i}return v?(Ra(),U=h.fallback,v=i.mode,q=t.child,ue=q.sibling,h=Pi(q,{mode:"hidden",children:h.children}),h.subtreeFlags=q.subtreeFlags&65011712,ue!==null?U=Pi(ue,U):(U=uo(U,v,c,null),U.flags|=2),U.return=i,h.return=i,h.sibling=U,i.child=h,ul(null,h),h=i.child,U=t.child.memoizedState,U===null?U=gd(c):(v=U.cachePool,v!==null?(q=wn._currentValue,v=v.parent!==q?{parent:q,pool:q}:v):v=b1(),U={baseLanes:U.baseLanes|c,cachePool:v}),h.memoizedState=U,h.childLanes=md(t,O,c),i.memoizedState=hd,ul(t.child,h)):(Ta(i),c=t.child,t=c.sibling,c=Pi(c,{mode:"visible",children:h.children}),c.return=i,c.sibling=null,t!==null&&(O=i.deletions,O===null?(i.deletions=[t],i.flags|=16):O.push(t)),i.child=c,i.memoizedState=null,c)}function pd(t,i){return i=Fc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Fc(t,i){return t=Sr(22,t,null,i),t.lanes=0,t}function xd(t,i,c){return yo(i,t.child,null,c),t=pd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Bg(t,i,c){t.lanes|=i;var h=t.alternate;h!==null&&(h.lanes|=i),Mf(t.return,i,c)}function yd(t,i,c,h,v,_){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:v,treeForkCount:_}:(O.isBackwards=i,O.rendering=null,O.renderingStartTime=0,O.last=h,O.tail=c,O.tailMode=v,O.treeForkCount=_)}function kg(t,i,c){var h=i.pendingProps,v=h.revealOrder,_=h.tail;h=h.children;var O=mn.current,U=(O&2)!==0;if(U?(O=O&1|2,i.flags|=128):O&=1,Re(mn,O),Vn(t,i,h,c),h=gt?Qs:0,!U&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Bg(t,c,i);else if(t.tag===19)Bg(t,c,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(v){case"forwards":for(c=i.child,v=null;c!==null;)t=c.alternate,t!==null&&Rc(t)===null&&(v=c),c=c.sibling;c=v,c===null?(v=i.child,i.child=null):(v=c.sibling,c.sibling=null),yd(i,!1,v,c,_,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,v=i.child,i.child=null;v!==null;){if(t=v.alternate,t!==null&&Rc(t)===null){i.child=v;break}t=v.sibling,v.sibling=c,c=v,v=t}yd(i,!0,c,null,_,h);break;case"together":yd(i,!1,null,null,void 0,h);break;default:i.memoizedState=null}return i.child}function Hi(t,i,c){if(t!==null&&(i.dependencies=t.dependencies),Ia|=i.lanes,(c&i.childLanes)===0)if(t!==null){if(Ko(t,i,c,!1),(c&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(s(153));if(i.child!==null){for(t=i.child,c=Pi(t,t.pendingProps),i.child=c,c.return=i;t.sibling!==null;)t=t.sibling,c=c.sibling=Pi(t,t.pendingProps),c.return=i;c.sibling=null}return i.child}function vd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&wc(t)))}function Mw(t,i,c){switch(i.tag){case 3:Qe(i,i.stateNode.containerInfo),Ea(i,wn,t.memoizedState.cache),fo();break;case 27:case 5:Wn(i);break;case 4:Qe(i,i.stateNode.containerInfo);break;case 10:Ea(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Gf(i),null;break;case 13:var h=i.memoizedState;if(h!==null)return h.dehydrated!==null?(Ta(i),i.flags|=128,null):(c&i.child.childLanes)!==0?Dg(t,i,c):(Ta(i),t=Hi(t,i,c),t!==null?t.sibling:null);Ta(i);break;case 19:var v=(t.flags&128)!==0;if(h=(c&i.childLanes)!==0,h||(Ko(t,i,c,!1),h=(c&i.childLanes)!==0),v){if(h)return kg(t,i,c);i.flags|=128}if(v=i.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),Re(mn,mn.current),h)break;return null;case 22:return i.lanes=0,Tg(t,i,c,i.pendingProps);case 24:Ea(i,wn,t.memoizedState.cache)}return Hi(t,i,c)}function Lg(t,i,c){if(t!==null)if(t.memoizedProps!==i.pendingProps)_n=!0;else{if(!vd(t,c)&&(i.flags&128)===0)return _n=!1,Mw(t,i,c);_n=(t.flags&131072)!==0}else _n=!1,gt&&(i.flags&1048576)!==0&&g1(i,Qs,i.index);switch(i.lanes=0,i.tag){case 16:e:{var h=i.pendingProps;if(t=po(i.elementType),i.type=t,typeof t=="function")Af(t)?(h=wo(t,h),i.tag=1,i=Ig(null,i,t,h,c)):(i.tag=0,i=dd(null,i,t,h,c));else{if(t!=null){var v=t.$$typeof;if(v===H){i.tag=11,i=Ag(null,i,t,h,c);break e}else if(v===X){i.tag=14,i=Cg(null,i,t,h,c);break e}}throw i=Te(t)||t,Error(s(306,i,""))}}return i;case 0:return dd(t,i,i.type,i.pendingProps,c);case 1:return h=i.type,v=wo(h,i.pendingProps),Ig(t,i,h,v,c);case 3:e:{if(Qe(i,i.stateNode.containerInfo),t===null)throw Error(s(387));h=i.pendingProps;var _=i.memoizedState;v=_.element,Uf(t,i),al(i,h,null,c);var O=i.memoizedState;if(h=O.cache,Ea(i,wn,h),h!==_.cache&&Df(i,[wn],c,!0),il(),h=O.element,_.isDehydrated)if(_={element:h,isDehydrated:!1,cache:O.cache},i.updateQueue.baseState=_,i.memoizedState=_,i.flags&256){i=Mg(t,i,h,c);break e}else if(h!==v){v=Vr(Error(s(424)),i),Js(v),i=Mg(t,i,h,c);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(Zt=Yr(t.firstChild),Fn=i,gt=!0,ba=null,Zr=!0,c=T1(i,null,h,c),i.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(fo(),h===v){i=Hi(t,i,c);break e}Vn(t,i,h,c)}i=i.child}return i;case 26:return Uc(t,i),t===null?(c=Ym(i.type,null,i.pendingProps,null))?i.memoizedState=c:gt||(c=i.type,t=i.pendingProps,h=nu(Ce.current).createElement(c),h[dn]=i,h[Ot]=t,Hn(h,c,t),on(h),i.stateNode=h):i.memoizedState=Ym(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Wn(i),t===null&&gt&&(h=i.stateNode=Gm(i.type,i.pendingProps,Ce.current),Fn=i,Zr=!0,v=Zt,La(i.type)?(Jd=v,Zt=Yr(h.firstChild)):Zt=v),Vn(t,i,i.pendingProps.children,c),Uc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&gt&&((v=h=Zt)&&(h=lb(h,i.type,i.pendingProps,Zr),h!==null?(i.stateNode=h,Fn=i,Zt=Yr(h.firstChild),Zr=!1,v=!0):v=!1),v||_a(i)),Wn(i),v=i.type,_=i.pendingProps,O=t!==null?t.memoizedProps:null,h=_.children,Yd(v,_)?h=null:O!==null&&Yd(v,O)&&(i.flags|=32),i.memoizedState!==null&&(v=Xf(t,i,Ew,null,null,c),Cl._currentValue=v),Uc(t,i),Vn(t,i,h,c),i.child;case 6:return t===null&&gt&&((t=c=Zt)&&(c=cb(c,i.pendingProps,Zr),c!==null?(i.stateNode=c,Fn=i,Zt=null,t=!0):t=!1),t||_a(i)),null;case 13:return Dg(t,i,c);case 4:return Qe(i,i.stateNode.containerInfo),h=i.pendingProps,t===null?i.child=yo(i,null,h,c):Vn(t,i,h,c),i.child;case 11:return Ag(t,i,i.type,i.pendingProps,c);case 7:return Vn(t,i,i.pendingProps,c),i.child;case 8:return Vn(t,i,i.pendingProps.children,c),i.child;case 12:return Vn(t,i,i.pendingProps.children,c),i.child;case 10:return h=i.pendingProps,Ea(i,i.type,h.value),Vn(t,i,h.children,c),i.child;case 9:return v=i.type._context,h=i.pendingProps.children,go(i),v=jn(v),h=h(v),i.flags|=1,Vn(t,i,h,c),i.child;case 14:return Cg(t,i,i.type,i.pendingProps,c);case 15:return Sg(t,i,i.type,i.pendingProps,c);case 19:return kg(t,i,c);case 31:return Iw(t,i,c);case 22:return Tg(t,i,c,i.pendingProps);case 24:return go(i),h=jn(wn),t===null?(v=Lf(),v===null&&(v=Ft,_=Bf(),v.pooledCache=_,_.refCount++,_!==null&&(v.pooledCacheLanes|=c),v=_),i.memoizedState={parent:h,cache:v},zf(i),Ea(i,wn,v)):((t.lanes&c)!==0&&(Uf(t,i),al(i,null,null,c),il()),v=t.memoizedState,_=i.memoizedState,v.parent!==h?(v={parent:h,cache:h},i.memoizedState=v,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=v),Ea(i,wn,h)):(h=_.cache,Ea(i,wn,h),h!==v.cache&&Df(i,[wn],c,!0))),Vn(t,i,i.pendingProps.children,c),i.child;case 29:throw i.pendingProps}throw Error(s(156,i.tag))}function Gi(t){t.flags|=4}function wd(t,i,c,h,v){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(v&335544128)===v)if(t.stateNode.complete)t.flags|=8192;else if(cm())t.flags|=8192;else throw xo=Ac,Pf}else t.flags&=-16777217}function Pg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Jm(i))if(cm())t.flags|=8192;else throw xo=Ac,Pf}function jc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Nn():536870912,t.lanes|=i,ls|=i)}function fl(t,i){if(!gt)switch(t.tailMode){case"hidden":i=t.tail;for(var c=null;i!==null;)i.alternate!==null&&(c=i),i=i.sibling;c===null?t.tail=null:c.sibling=null;break;case"collapsed":c=t.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:h.sibling=null}}function Xt(t){var i=t.alternate!==null&&t.alternate.child===t.child,c=0,h=0;if(i)for(var v=t.child;v!==null;)c|=v.lanes|v.childLanes,h|=v.subtreeFlags&65011712,h|=v.flags&65011712,v.return=t,v=v.sibling;else for(v=t.child;v!==null;)c|=v.lanes|v.childLanes,h|=v.subtreeFlags,h|=v.flags,v.return=t,v=v.sibling;return t.subtreeFlags|=h,t.childLanes=c,i}function Dw(t,i,c){var h=i.pendingProps;switch(Rf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(i),null;case 1:return Xt(i),null;case 3:return c=i.stateNode,h=null,t!==null&&(h=t.memoizedState.cache),i.memoizedState.cache!==h&&(i.flags|=2048),Fi(wn),pt(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(t===null||t.child===null)&&(Wo(i)?Gi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Of())),Xt(i),null;case 26:var v=i.type,_=i.memoizedState;return t===null?(Gi(i),_!==null?(Xt(i),Pg(i,_)):(Xt(i),wd(i,v,null,h,c))):_?_!==t.memoizedState?(Gi(i),Xt(i),Pg(i,_)):(Xt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==h&&Gi(i),Xt(i),wd(i,v,t,h,c)),null;case 27:if(Tn(i),c=Ce.current,v=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==h&&Gi(i);else{if(!h){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}t=Ie.current,Wo(i)?p1(i):(t=Gm(v,h,c),i.stateNode=t,Gi(i))}return Xt(i),null;case 5:if(Tn(i),v=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==h&&Gi(i);else{if(!h){if(i.stateNode===null)throw Error(s(166));return Xt(i),null}if(_=Ie.current,Wo(i))p1(i);else{var O=nu(Ce.current);switch(_){case 1:_=O.createElementNS("http://www.w3.org/2000/svg",v);break;case 2:_=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;default:switch(v){case"svg":_=O.createElementNS("http://www.w3.org/2000/svg",v);break;case"math":_=O.createElementNS("http://www.w3.org/1998/Math/MathML",v);break;case"script":_=O.createElement("div"),_.innerHTML="<script><\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof h.is=="string"?O.createElement("select",{is:h.is}):O.createElement("select"),h.multiple?_.multiple=!0:h.size&&(_.size=h.size);break;default:_=typeof h.is=="string"?O.createElement(v,{is:h.is}):O.createElement(v)}}_[dn]=i,_[Ot]=h;e:for(O=i.child;O!==null;){if(O.tag===5||O.tag===6)_.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===i)break e;for(;O.sibling===null;){if(O.return===null||O.return===i)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}i.stateNode=_;e:switch(Hn(_,v,h),v){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&Gi(i)}}return Xt(i),wd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,c),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==h&&Gi(i);else{if(typeof h!="string"&&i.stateNode===null)throw Error(s(166));if(t=Ce.current,Wo(i)){if(t=i.stateNode,c=i.memoizedProps,h=null,v=Fn,v!==null)switch(v.tag){case 27:case 5:h=v.memoizedProps}t[dn]=i,t=!!(t.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||Dm(t.nodeValue,c)),t||_a(i,!0)}else t=nu(t).createTextNode(h),t[dn]=i,i.stateNode=t}return Xt(i),null;case 31:if(c=i.memoizedState,t===null||t.memoizedState!==null){if(h=Wo(i),c!==null){if(t===null){if(!h)throw Error(s(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(s(557));t[dn]=i}else fo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),t=!1}else c=Of(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=c),t=!0;if(!t)return i.flags&256?(Rr(i),i):(Rr(i),null);if((i.flags&128)!==0)throw Error(s(558))}return Xt(i),null;case 13:if(h=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(v=Wo(i),h!==null&&h.dehydrated!==null){if(t===null){if(!v)throw Error(s(318));if(v=i.memoizedState,v=v!==null?v.dehydrated:null,!v)throw Error(s(317));v[dn]=i}else fo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Xt(i),v=!1}else v=Of(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=v),v=!0;if(!v)return i.flags&256?(Rr(i),i):(Rr(i),null)}return Rr(i),(i.flags&128)!==0?(i.lanes=c,i):(c=h!==null,t=t!==null&&t.memoizedState!==null,c&&(h=i.child,v=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(v=h.alternate.memoizedState.cachePool.pool),_=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(_=h.memoizedState.cachePool.pool),_!==v&&(h.flags|=2048)),c!==t&&c&&(i.child.flags|=8192),jc(i,i.updateQueue),Xt(i),null);case 4:return pt(),t===null&&Vd(i.stateNode.containerInfo),Xt(i),null;case 10:return Fi(i.type),Xt(i),null;case 19:if(oe(mn),h=i.memoizedState,h===null)return Xt(i),null;if(v=(i.flags&128)!==0,_=h.rendering,_===null)if(v)fl(h,!1);else{if(cn!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(_=Rc(t),_!==null){for(i.flags|=128,fl(h,!1),t=_.updateQueue,i.updateQueue=t,jc(i,t),i.subtreeFlags=0,t=c,c=i.child;c!==null;)f1(c,t),c=c.sibling;return Re(mn,mn.current&1|2),gt&&zi(i,h.treeForkCount),i.child}t=t.sibling}h.tail!==null&&en()>Xc&&(i.flags|=128,v=!0,fl(h,!1),i.lanes=4194304)}else{if(!v)if(t=Rc(_),t!==null){if(i.flags|=128,v=!0,t=t.updateQueue,i.updateQueue=t,jc(i,t),fl(h,!0),h.tail===null&&h.tailMode==="hidden"&&!_.alternate&&!gt)return Xt(i),null}else 2*en()-h.renderingStartTime>Xc&&c!==536870912&&(i.flags|=128,v=!0,fl(h,!1),i.lanes=4194304);h.isBackwards?(_.sibling=i.child,i.child=_):(t=h.last,t!==null?t.sibling=_:i.child=_,h.last=_)}return h.tail!==null?(t=h.tail,h.rendering=t,h.tail=t.sibling,h.renderingStartTime=en(),t.sibling=null,c=mn.current,Re(mn,v?c&1|2:c&1),gt&&zi(i,h.treeForkCount),t):(Xt(i),null);case 22:case 23:return Rr(i),Hf(),h=i.memoizedState!==null,t!==null?t.memoizedState!==null!==h&&(i.flags|=8192):h&&(i.flags|=8192),h?(c&536870912)!==0&&(i.flags&128)===0&&(Xt(i),i.subtreeFlags&6&&(i.flags|=8192)):Xt(i),c=i.updateQueue,c!==null&&jc(i,c.retryQueue),c=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),h=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(h=i.memoizedState.cachePool.pool),h!==c&&(i.flags|=2048),t!==null&&oe(mo),null;case 24:return c=null,t!==null&&(c=t.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Fi(wn),Xt(i),null;case 25:return null;case 30:return null}throw Error(s(156,i.tag))}function Bw(t,i){switch(Rf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Fi(wn),pt(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Tn(i),null;case 31:if(i.memoizedState!==null){if(Rr(i),i.alternate===null)throw Error(s(340));fo()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(Rr(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(s(340));fo()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return oe(mn),null;case 4:return pt(),null;case 10:return Fi(i.type),null;case 22:case 23:return Rr(i),Hf(),t!==null&&oe(mo),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Fi(wn),null;case 25:return null;default:return null}}function zg(t,i){switch(Rf(i),i.tag){case 3:Fi(wn),pt();break;case 26:case 27:case 5:Tn(i);break;case 4:pt();break;case 31:i.memoizedState!==null&&Rr(i);break;case 13:Rr(i);break;case 19:oe(mn);break;case 10:Fi(i.type);break;case 22:case 23:Rr(i),Hf(),t!==null&&oe(mo);break;case 24:Fi(wn)}}function dl(t,i){try{var c=i.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next;c=v;do{if((c.tag&t)===t){h=void 0;var _=c.create,O=c.inst;h=_(),O.destroy=h}c=c.next}while(c!==v)}}catch(U){Mt(i,i.return,U)}}function Na(t,i,c){try{var h=i.updateQueue,v=h!==null?h.lastEffect:null;if(v!==null){var _=v.next;h=_;do{if((h.tag&t)===t){var O=h.inst,U=O.destroy;if(U!==void 0){O.destroy=void 0,v=i;var q=c,ue=U;try{ue()}catch(ye){Mt(v,q,ye)}}}h=h.next}while(h!==_)}}catch(ye){Mt(i,i.return,ye)}}function Ug(t){var i=t.updateQueue;if(i!==null){var c=t.stateNode;try{N1(i,c)}catch(h){Mt(t,t.return,h)}}}function Fg(t,i,c){c.props=wo(t.type,t.memoizedProps),c.state=t.memoizedState;try{c.componentWillUnmount()}catch(h){Mt(t,i,h)}}function hl(t,i){try{var c=t.ref;if(c!==null){switch(t.tag){case 26:case 27:case 5:var h=t.stateNode;break;case 30:h=t.stateNode;break;default:h=t.stateNode}typeof c=="function"?t.refCleanup=c(h):c.current=h}}catch(v){Mt(t,i,v)}}function _i(t,i){var c=t.ref,h=t.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(v){Mt(t,i,v)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(v){Mt(t,i,v)}else c.current=null}function jg(t){var i=t.type,c=t.memoizedProps,h=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(v){Mt(t,t.return,v)}}function bd(t,i,c){try{var h=t.stateNode;nb(h,t.type,c,i),h[Ot]=i}catch(v){Mt(t,t.return,v)}}function Vg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&La(t.type)||t.tag===4}function _d(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Vg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&La(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Ed(t,i,c){var h=t.tag;if(h===5||h===6)t=t.stateNode,i?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(t,i):(i=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,i.appendChild(t),c=c._reactRootContainer,c!=null||i.onclick!==null||(i.onclick=cr));else if(h!==4&&(h===27&&La(t.type)&&(c=t.stateNode,i=null),t=t.child,t!==null))for(Ed(t,i,c),t=t.sibling;t!==null;)Ed(t,i,c),t=t.sibling}function Vc(t,i,c){var h=t.tag;if(h===5||h===6)t=t.stateNode,i?c.insertBefore(t,i):c.appendChild(t);else if(h!==4&&(h===27&&La(t.type)&&(c=t.stateNode),t=t.child,t!==null))for(Vc(t,i,c),t=t.sibling;t!==null;)Vc(t,i,c),t=t.sibling}function Hg(t){var i=t.stateNode,c=t.memoizedProps;try{for(var h=t.type,v=i.attributes;v.length;)i.removeAttributeNode(v[0]);Hn(i,h,c),i[dn]=t,i[Ot]=c}catch(_){Mt(t,t.return,_)}}var Zi=!1,En=!1,Ad=!1,Gg=typeof WeakSet=="function"?WeakSet:Set,Ln=null;function kw(t,i){if(t=t.containerInfo,Zd=cu,t=D(t),z(t)){if("selectionStart"in t)var c={start:t.selectionStart,end:t.selectionEnd};else e:{c=(c=t.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var v=h.anchorOffset,_=h.focusNode;h=h.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var O=0,U=-1,q=-1,ue=0,ye=0,be=t,fe=null;t:for(;;){for(var me;be!==c||v!==0&&be.nodeType!==3||(U=O+v),be!==_||h!==0&&be.nodeType!==3||(q=O+h),be.nodeType===3&&(O+=be.nodeValue.length),(me=be.firstChild)!==null;)fe=be,be=me;for(;;){if(be===t)break t;if(fe===c&&++ue===v&&(U=O),fe===_&&++ye===h&&(q=O),(me=be.nextSibling)!==null)break;be=fe,fe=be.parentNode}be=me}c=U===-1||q===-1?null:{start:U,end:q}}else c=null}c=c||{start:0,end:0}}else c=null;for(Xd={focusedElem:t,selectionRange:c},cu=!1,Ln=i;Ln!==null;)if(i=Ln,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Ln=t;else for(;Ln!==null;){switch(i=Ln,_=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(c=0;c<t.length;c++)v=t[c],v.ref.impl=v.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&_!==null){t=void 0,c=i,v=_.memoizedProps,_=_.memoizedState,h=c.stateNode;try{var Le=wo(c.type,v);t=h.getSnapshotBeforeUpdate(Le,_),h.__reactInternalSnapshotBeforeUpdate=t}catch(Xe){Mt(c,c.return,Xe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,c=t.nodeType,c===9)Wd(t);else if(c===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Wd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(s(163))}if(t=i.sibling,t!==null){t.return=i.return,Ln=t;break}Ln=i.return}}function Zg(t,i,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:Yi(t,c),h&4&&dl(5,c);break;case 1:if(Yi(t,c),h&4)if(t=c.stateNode,i===null)try{t.componentDidMount()}catch(O){Mt(c,c.return,O)}else{var v=wo(c.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(v,i,t.__reactInternalSnapshotBeforeUpdate)}catch(O){Mt(c,c.return,O)}}h&64&&Ug(c),h&512&&hl(c,c.return);break;case 3:if(Yi(t,c),h&64&&(t=c.updateQueue,t!==null)){if(i=null,c.child!==null)switch(c.child.tag){case 27:case 5:i=c.child.stateNode;break;case 1:i=c.child.stateNode}try{N1(t,i)}catch(O){Mt(c,c.return,O)}}break;case 27:i===null&&h&4&&Hg(c);case 26:case 5:Yi(t,c),i===null&&h&4&&jg(c),h&512&&hl(c,c.return);break;case 12:Yi(t,c);break;case 31:Yi(t,c),h&4&&qg(t,c);break;case 13:Yi(t,c),h&4&&Wg(t,c),h&64&&(t=c.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(c=Gw.bind(null,c),ub(t,c))));break;case 22:if(h=c.memoizedState!==null||Zi,!h){i=i!==null&&i.memoizedState!==null||En,v=Zi;var _=En;Zi=h,(En=i)&&!_?qi(t,c,(c.subtreeFlags&8772)!==0):Yi(t,c),Zi=v,En=_}break;case 30:break;default:Yi(t,c)}}function Xg(t){var i=t.alternate;i!==null&&(t.alternate=null,Xg(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&lr(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Jt=null,dr=!1;function Xi(t,i,c){for(c=c.child;c!==null;)Yg(t,i,c),c=c.sibling}function Yg(t,i,c){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(jt,c)}catch{}switch(c.tag){case 26:En||_i(c,i),Xi(t,i,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:En||_i(c,i);var h=Jt,v=dr;La(c.type)&&(Jt=c.stateNode,dr=!1),Xi(t,i,c),_l(c.stateNode),Jt=h,dr=v;break;case 5:En||_i(c,i);case 6:if(h=Jt,v=dr,Jt=null,Xi(t,i,c),Jt=h,dr=v,Jt!==null)if(dr)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(c.stateNode)}catch(_){Mt(c,i,_)}else try{Jt.removeChild(c.stateNode)}catch(_){Mt(c,i,_)}break;case 18:Jt!==null&&(dr?(t=Jt,Um(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,c.stateNode),ps(t)):Um(Jt,c.stateNode));break;case 4:h=Jt,v=dr,Jt=c.stateNode.containerInfo,dr=!0,Xi(t,i,c),Jt=h,dr=v;break;case 0:case 11:case 14:case 15:Na(2,c,i),En||Na(4,c,i),Xi(t,i,c);break;case 1:En||(_i(c,i),h=c.stateNode,typeof h.componentWillUnmount=="function"&&Fg(c,i,h)),Xi(t,i,c);break;case 21:Xi(t,i,c);break;case 22:En=(h=En)||c.memoizedState!==null,Xi(t,i,c),En=h;break;default:Xi(t,i,c)}}function qg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{ps(t)}catch(c){Mt(i,i.return,c)}}}function Wg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{ps(t)}catch(c){Mt(i,i.return,c)}}function Lw(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Gg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Gg),i;default:throw Error(s(435,t.tag))}}function Hc(t,i){var c=Lw(t);i.forEach(function(h){if(!c.has(h)){c.add(h);var v=Zw.bind(null,t,h);h.then(v,v)}})}function hr(t,i){var c=i.deletions;if(c!==null)for(var h=0;h<c.length;h++){var v=c[h],_=t,O=i,U=O;e:for(;U!==null;){switch(U.tag){case 27:if(La(U.type)){Jt=U.stateNode,dr=!1;break e}break;case 5:Jt=U.stateNode,dr=!1;break e;case 3:case 4:Jt=U.stateNode.containerInfo,dr=!0;break e}U=U.return}if(Jt===null)throw Error(s(160));Yg(_,O,v),Jt=null,dr=!1,_=v.alternate,_!==null&&(_.return=null),v.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Kg(i,t),i=i.sibling}var ai=null;function Kg(t,i){var c=t.alternate,h=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:hr(i,t),gr(t),h&4&&(Na(3,t,t.return),dl(3,t),Na(5,t,t.return));break;case 1:hr(i,t),gr(t),h&512&&(En||c===null||_i(c,c.return)),h&64&&Zi&&(t=t.updateQueue,t!==null&&(h=t.callbacks,h!==null&&(c=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var v=ai;if(hr(i,t),gr(t),h&512&&(En||c===null||_i(c,c.return)),h&4){var _=c!==null?c.memoizedState:null;if(h=t.memoizedState,c===null)if(h===null)if(t.stateNode===null){e:{h=t.type,c=t.memoizedProps,v=v.ownerDocument||v;t:switch(h){case"title":_=v.getElementsByTagName("title")[0],(!_||_[eo]||_[dn]||_.namespaceURI==="http://www.w3.org/2000/svg"||_.hasAttribute("itemprop"))&&(_=v.createElement(h),v.head.insertBefore(_,v.querySelector("head > title"))),Hn(_,h,c),_[dn]=t,on(_),h=_;break e;case"link":var O=Km("link","href",v).get(h+(c.href||""));if(O){for(var U=0;U<O.length;U++)if(_=O[U],_.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&_.getAttribute("rel")===(c.rel==null?null:c.rel)&&_.getAttribute("title")===(c.title==null?null:c.title)&&_.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){O.splice(U,1);break t}}_=v.createElement(h),Hn(_,h,c),v.head.appendChild(_);break;case"meta":if(O=Km("meta","content",v).get(h+(c.content||""))){for(U=0;U<O.length;U++)if(_=O[U],_.getAttribute("content")===(c.content==null?null:""+c.content)&&_.getAttribute("name")===(c.name==null?null:c.name)&&_.getAttribute("property")===(c.property==null?null:c.property)&&_.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&_.getAttribute("charset")===(c.charSet==null?null:c.charSet)){O.splice(U,1);break t}}_=v.createElement(h),Hn(_,h,c),v.head.appendChild(_);break;default:throw Error(s(468,h))}_[dn]=t,on(_),h=_}t.stateNode=h}else Qm(v,t.type,t.stateNode);else t.stateNode=Wm(v,h,t.memoizedProps);else _!==h?(_===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):_.count--,h===null?Qm(v,t.type,t.stateNode):Wm(v,h,t.memoizedProps)):h===null&&t.stateNode!==null&&bd(t,t.memoizedProps,c.memoizedProps)}break;case 27:hr(i,t),gr(t),h&512&&(En||c===null||_i(c,c.return)),c!==null&&h&4&&bd(t,t.memoizedProps,c.memoizedProps);break;case 5:if(hr(i,t),gr(t),h&512&&(En||c===null||_i(c,c.return)),t.flags&32){v=t.stateNode;try{fa(v,"")}catch(Le){Mt(t,t.return,Le)}}h&4&&t.stateNode!=null&&(v=t.memoizedProps,bd(t,v,c!==null?c.memoizedProps:v)),h&1024&&(Ad=!0);break;case 6:if(hr(i,t),gr(t),h&4){if(t.stateNode===null)throw Error(s(162));h=t.memoizedProps,c=t.stateNode;try{c.nodeValue=h}catch(Le){Mt(t,t.return,Le)}}break;case 3:if(au=null,v=ai,ai=ru(i.containerInfo),hr(i,t),ai=v,gr(t),h&4&&c!==null&&c.memoizedState.isDehydrated)try{ps(i.containerInfo)}catch(Le){Mt(t,t.return,Le)}Ad&&(Ad=!1,Qg(t));break;case 4:h=ai,ai=ru(t.stateNode.containerInfo),hr(i,t),gr(t),ai=h;break;case 12:hr(i,t),gr(t);break;case 31:hr(i,t),gr(t),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,Hc(t,h)));break;case 13:hr(i,t),gr(t),t.child.flags&8192&&t.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Zc=en()),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,Hc(t,h)));break;case 22:v=t.memoizedState!==null;var q=c!==null&&c.memoizedState!==null,ue=Zi,ye=En;if(Zi=ue||v,En=ye||q,hr(i,t),En=ye,Zi=ue,gr(t),h&8192)e:for(i=t.stateNode,i._visibility=v?i._visibility&-2:i._visibility|1,v&&(c===null||q||Zi||En||bo(t)),c=null,i=t;;){if(i.tag===5||i.tag===26){if(c===null){q=c=i;try{if(_=q.stateNode,v)O=_.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{U=q.stateNode;var be=q.memoizedProps.style,fe=be!=null&&be.hasOwnProperty("display")?be.display:null;U.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Le){Mt(q,q.return,Le)}}}else if(i.tag===6){if(c===null){q=i;try{q.stateNode.nodeValue=v?"":q.memoizedProps}catch(Le){Mt(q,q.return,Le)}}}else if(i.tag===18){if(c===null){q=i;try{var me=q.stateNode;v?Fm(me,!0):Fm(q.stateNode,!1)}catch(Le){Mt(q,q.return,Le)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;c===i&&(c=null),i=i.return}c===i&&(c=null),i.sibling.return=i.return,i=i.sibling}h&4&&(h=t.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,Hc(t,c))));break;case 19:hr(i,t),gr(t),h&4&&(h=t.updateQueue,h!==null&&(t.updateQueue=null,Hc(t,h)));break;case 30:break;case 21:break;default:hr(i,t),gr(t)}}function gr(t){var i=t.flags;if(i&2){try{for(var c,h=t.return;h!==null;){if(Vg(h)){c=h;break}h=h.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var v=c.stateNode,_=_d(t);Vc(t,_,v);break;case 5:var O=c.stateNode;c.flags&32&&(fa(O,""),c.flags&=-33);var U=_d(t);Vc(t,U,O);break;case 3:case 4:var q=c.stateNode.containerInfo,ue=_d(t);Ed(t,ue,q);break;default:throw Error(s(161))}}catch(ye){Mt(t,t.return,ye)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Qg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Qg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Yi(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Zg(t,i.alternate,i),i=i.sibling}function bo(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Na(4,i,i.return),bo(i);break;case 1:_i(i,i.return);var c=i.stateNode;typeof c.componentWillUnmount=="function"&&Fg(i,i.return,c),bo(i);break;case 27:_l(i.stateNode);case 26:case 5:_i(i,i.return),bo(i);break;case 22:i.memoizedState===null&&bo(i);break;case 30:bo(i);break;default:bo(i)}t=t.sibling}}function qi(t,i,c){for(c=c&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var h=i.alternate,v=t,_=i,O=_.flags;switch(_.tag){case 0:case 11:case 15:qi(v,_,c),dl(4,_);break;case 1:if(qi(v,_,c),h=_,v=h.stateNode,typeof v.componentDidMount=="function")try{v.componentDidMount()}catch(ue){Mt(h,h.return,ue)}if(h=_,v=h.updateQueue,v!==null){var U=h.stateNode;try{var q=v.shared.hiddenCallbacks;if(q!==null)for(v.shared.hiddenCallbacks=null,v=0;v<q.length;v++)R1(q[v],U)}catch(ue){Mt(h,h.return,ue)}}c&&O&64&&Ug(_),hl(_,_.return);break;case 27:Hg(_);case 26:case 5:qi(v,_,c),c&&h===null&&O&4&&jg(_),hl(_,_.return);break;case 12:qi(v,_,c);break;case 31:qi(v,_,c),c&&O&4&&qg(v,_);break;case 13:qi(v,_,c),c&&O&4&&Wg(v,_);break;case 22:_.memoizedState===null&&qi(v,_,c),hl(_,_.return);break;case 30:break;default:qi(v,_,c)}i=i.sibling}}function Cd(t,i){var c=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(c=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==c&&(t!=null&&t.refCount++,c!=null&&$s(c))}function Sd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&$s(t))}function oi(t,i,c,h){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Jg(t,i,c,h),i=i.sibling}function Jg(t,i,c,h){var v=i.flags;switch(i.tag){case 0:case 11:case 15:oi(t,i,c,h),v&2048&&dl(9,i);break;case 1:oi(t,i,c,h);break;case 3:oi(t,i,c,h),v&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&$s(t)));break;case 12:if(v&2048){oi(t,i,c,h),t=i.stateNode;try{var _=i.memoizedProps,O=_.id,U=_.onPostCommit;typeof U=="function"&&U(O,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(q){Mt(i,i.return,q)}}else oi(t,i,c,h);break;case 31:oi(t,i,c,h);break;case 13:oi(t,i,c,h);break;case 23:break;case 22:_=i.stateNode,O=i.alternate,i.memoizedState!==null?_._visibility&2?oi(t,i,c,h):gl(t,i):_._visibility&2?oi(t,i,c,h):(_._visibility|=2,as(t,i,c,h,(i.subtreeFlags&10256)!==0||!1)),v&2048&&Cd(O,i);break;case 24:oi(t,i,c,h),v&2048&&Sd(i.alternate,i);break;default:oi(t,i,c,h)}}function as(t,i,c,h,v){for(v=v&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var _=t,O=i,U=c,q=h,ue=O.flags;switch(O.tag){case 0:case 11:case 15:as(_,O,U,q,v),dl(8,O);break;case 23:break;case 22:var ye=O.stateNode;O.memoizedState!==null?ye._visibility&2?as(_,O,U,q,v):gl(_,O):(ye._visibility|=2,as(_,O,U,q,v)),v&&ue&2048&&Cd(O.alternate,O);break;case 24:as(_,O,U,q,v),v&&ue&2048&&Sd(O.alternate,O);break;default:as(_,O,U,q,v)}i=i.sibling}}function gl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var c=t,h=i,v=h.flags;switch(h.tag){case 22:gl(c,h),v&2048&&Cd(h.alternate,h);break;case 24:gl(c,h),v&2048&&Sd(h.alternate,h);break;default:gl(c,h)}i=i.sibling}}var ml=8192;function os(t,i,c){if(t.subtreeFlags&ml)for(t=t.child;t!==null;)$g(t,i,c),t=t.sibling}function $g(t,i,c){switch(t.tag){case 26:os(t,i,c),t.flags&ml&&t.memoizedState!==null&&_b(c,ai,t.memoizedState,t.memoizedProps);break;case 5:os(t,i,c);break;case 3:case 4:var h=ai;ai=ru(t.stateNode.containerInfo),os(t,i,c),ai=h;break;case 22:t.memoizedState===null&&(h=t.alternate,h!==null&&h.memoizedState!==null?(h=ml,ml=16777216,os(t,i,c),ml=h):os(t,i,c));break;default:os(t,i,c)}}function em(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function pl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var h=i[c];Ln=h,nm(h,t)}em(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)tm(t),t=t.sibling}function tm(t){switch(t.tag){case 0:case 11:case 15:pl(t),t.flags&2048&&Na(9,t,t.return);break;case 3:pl(t);break;case 12:pl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Gc(t)):pl(t);break;default:pl(t)}}function Gc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var c=0;c<i.length;c++){var h=i[c];Ln=h,nm(h,t)}em(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Na(8,i,i.return),Gc(i);break;case 22:c=i.stateNode,c._visibility&2&&(c._visibility&=-3,Gc(i));break;default:Gc(i)}t=t.sibling}}function nm(t,i){for(;Ln!==null;){var c=Ln;switch(c.tag){case 0:case 11:case 15:Na(8,c,i);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:$s(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Ln=h;else e:for(c=t;Ln!==null;){h=Ln;var v=h.sibling,_=h.return;if(Xg(h),h===c){Ln=null;break e}if(v!==null){v.return=_,Ln=v;break e}Ln=_}}}var Pw={getCacheForType:function(t){var i=jn(wn),c=i.data.get(t);return c===void 0&&(c=t(),i.data.set(t,c)),c},cacheSignal:function(){return jn(wn).controller.signal}},zw=typeof WeakMap=="function"?WeakMap:Map,Ct=0,Ft=null,lt=null,dt=0,It=0,Nr=null,Oa=!1,ss=!1,Td=!1,Wi=0,cn=0,Ia=0,_o=0,Rd=0,Or=0,ls=0,xl=null,mr=null,Nd=!1,Zc=0,rm=0,Xc=1/0,Yc=null,Ma=null,Dn=0,Da=null,cs=null,Ki=0,Od=0,Id=null,im=null,yl=0,Md=null;function Ir(){return(Ct&2)!==0&&dt!==0?dt&-dt:re.T!==null?zd():Kn()}function am(){if(Or===0)if((dt&536870912)===0||gt){var t=ut;ut<<=1,(ut&3932160)===0&&(ut=262144),Or=t}else Or=536870912;return t=Tr.current,t!==null&&(t.flags|=32),Or}function pr(t,i,c){(t===Ft&&(It===2||It===9)||t.cancelPendingCommit!==null)&&(us(t,0),Ba(t,dt,Or,!1)),gi(t,c),((Ct&2)===0||t!==Ft)&&(t===Ft&&((Ct&2)===0&&(_o|=c),cn===4&&Ba(t,dt,Or,!1)),Ei(t))}function om(t,i,c){if((Ct&6)!==0)throw Error(s(327));var h=!c&&(i&127)===0&&(i&t.expiredLanes)===0||zn(t,i),v=h?jw(t,i):Bd(t,i,!0),_=h;do{if(v===0){ss&&!h&&Ba(t,i,0,!1);break}else{if(c=t.current.alternate,_&&!Uw(c)){v=Bd(t,i,!1),_=!1;continue}if(v===2){if(_=i,t.errorRecoveryDisabledLanes&_)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){i=O;e:{var U=t;v=xl;var q=U.current.memoizedState.isDehydrated;if(q&&(us(U,O).flags|=256),O=Bd(U,O,!1),O!==2){if(Td&&!q){U.errorRecoveryDisabledLanes|=_,_o|=_,v=4;break e}_=mr,mr=v,_!==null&&(mr===null?mr=_:mr.push.apply(mr,_))}v=O}if(_=!1,v!==2)continue}}if(v===1){us(t,0),Ba(t,i,0,!0);break}e:{switch(h=t,_=v,_){case 0:case 1:throw Error(s(345));case 4:if((i&4194048)!==i)break;case 6:Ba(h,i,Or,!Oa);break e;case 2:mr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((i&62914560)===i&&(v=Zc+300-en(),10<v)){if(Ba(h,i,Or,!Oa),$a(h,0,!0)!==0)break e;Ki=i,h.timeoutHandle=Pm(sm.bind(null,h,c,mr,Yc,Nd,i,Or,_o,ls,Oa,_,"Throttled",-0,0),v);break e}sm(h,c,mr,Yc,Nd,i,Or,_o,ls,Oa,_,null,-0,0)}}break}while(!0);Ei(t)}function sm(t,i,c,h,v,_,O,U,q,ue,ye,be,fe,me){if(t.timeoutHandle=-1,be=i.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:cr},$g(i,_,be);var Le=(_&62914560)===_?Zc-en():(_&4194048)===_?rm-en():0;if(Le=Eb(be,Le),Le!==null){Ki=_,t.cancelPendingCommit=Le(mm.bind(null,t,i,_,c,h,v,O,U,q,ye,be,null,fe,me)),Ba(t,_,O,!ue);return}}mm(t,i,_,c,h,v,O,U,q)}function Uw(t){for(var i=t;;){var c=i.tag;if((c===0||c===11||c===15)&&i.flags&16384&&(c=i.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var v=c[h],_=v.getSnapshot;v=v.value;try{if(!m(_(),v))return!1}catch{return!1}}if(c=i.child,i.subtreeFlags&16384&&c!==null)c.return=i,i=c;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Ba(t,i,c,h){i&=~Rd,i&=~_o,t.suspendedLanes|=i,t.pingedLanes&=~i,h&&(t.warmLanes|=i),h=t.expirationTimes;for(var v=i;0<v;){var _=31-et(v),O=1<<_;h[_]=-1,v&=~O}c!==0&&$l(t,c,i)}function qc(){return(Ct&6)===0?(vl(0),!1):!0}function Dd(){if(lt!==null){if(It===0)var t=lt.return;else t=lt,Ui=ho=null,Wf(t),es=null,tl=0,t=lt;for(;t!==null;)zg(t.alternate,t),t=t.return;lt=null}}function us(t,i){var c=t.timeoutHandle;c!==-1&&(t.timeoutHandle=-1,ab(c)),c=t.cancelPendingCommit,c!==null&&(t.cancelPendingCommit=null,c()),Ki=0,Dd(),Ft=t,lt=c=Pi(t.current,null),dt=i,It=0,Nr=null,Oa=!1,ss=zn(t,i),Td=!1,ls=Or=Rd=_o=Ia=cn=0,mr=xl=null,Nd=!1,(i&8)!==0&&(i|=i&32);var h=t.entangledLanes;if(h!==0)for(t=t.entanglements,h&=i;0<h;){var v=31-et(h),_=1<<v;i|=t[v],h&=~_}return Wi=i,mc(),c}function lm(t,i){$e=null,re.H=cl,i===$o||i===Ec?(i=A1(),It=3):i===Pf?(i=A1(),It=4):It=i===fd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Nr=i,lt===null&&(cn=1,Pc(t,Vr(i,t.current)))}function cm(){var t=Tr.current;return t===null?!0:(dt&4194048)===dt?Xr===null:(dt&62914560)===dt||(dt&536870912)!==0?t===Xr:!1}function um(){var t=re.H;return re.H=cl,t===null?cl:t}function fm(){var t=re.A;return re.A=Pw,t}function Wc(){cn=4,Oa||(dt&4194048)!==dt&&Tr.current!==null||(ss=!0),(Ia&134217727)===0&&(_o&134217727)===0||Ft===null||Ba(Ft,dt,Or,!1)}function Bd(t,i,c){var h=Ct;Ct|=2;var v=um(),_=fm();(Ft!==t||dt!==i)&&(Yc=null,us(t,i)),i=!1;var O=cn;e:do try{if(It!==0&&lt!==null){var U=lt,q=Nr;switch(It){case 8:Dd(),O=6;break e;case 3:case 2:case 9:case 6:Tr.current===null&&(i=!0);var ue=It;if(It=0,Nr=null,fs(t,U,q,ue),c&&ss){O=0;break e}break;default:ue=It,It=0,Nr=null,fs(t,U,q,ue)}}Fw(),O=cn;break}catch(ye){lm(t,ye)}while(!0);return i&&t.shellSuspendCounter++,Ui=ho=null,Ct=h,re.H=v,re.A=_,lt===null&&(Ft=null,dt=0,mc()),O}function Fw(){for(;lt!==null;)dm(lt)}function jw(t,i){var c=Ct;Ct|=2;var h=um(),v=fm();Ft!==t||dt!==i?(Yc=null,Xc=en()+500,us(t,i)):ss=zn(t,i);e:do try{if(It!==0&&lt!==null){i=lt;var _=Nr;t:switch(It){case 1:It=0,Nr=null,fs(t,i,_,1);break;case 2:case 9:if(_1(_)){It=0,Nr=null,hm(i);break}i=function(){It!==2&&It!==9||Ft!==t||(It=7),Ei(t)},_.then(i,i);break e;case 3:It=7;break e;case 4:It=5;break e;case 7:_1(_)?(It=0,Nr=null,hm(i)):(It=0,Nr=null,fs(t,i,_,7));break;case 5:var O=null;switch(lt.tag){case 26:O=lt.memoizedState;case 5:case 27:var U=lt;if(O?Jm(O):U.stateNode.complete){It=0,Nr=null;var q=U.sibling;if(q!==null)lt=q;else{var ue=U.return;ue!==null?(lt=ue,Kc(ue)):lt=null}break t}}It=0,Nr=null,fs(t,i,_,5);break;case 6:It=0,Nr=null,fs(t,i,_,6);break;case 8:Dd(),cn=6;break e;default:throw Error(s(462))}}Vw();break}catch(ye){lm(t,ye)}while(!0);return Ui=ho=null,re.H=h,re.A=v,Ct=c,lt!==null?0:(Ft=null,dt=0,mc(),cn)}function Vw(){for(;lt!==null&&!Mo();)dm(lt)}function dm(t){var i=Lg(t.alternate,t,Wi);t.memoizedProps=t.pendingProps,i===null?Kc(t):lt=i}function hm(t){var i=t,c=i.alternate;switch(i.tag){case 15:case 0:i=Og(c,i,i.pendingProps,i.type,void 0,dt);break;case 11:i=Og(c,i,i.pendingProps,i.type.render,i.ref,dt);break;case 5:Wf(i);default:zg(c,i),i=lt=f1(i,Wi),i=Lg(c,i,Wi)}t.memoizedProps=t.pendingProps,i===null?Kc(t):lt=i}function fs(t,i,c,h){Ui=ho=null,Wf(i),es=null,tl=0;var v=i.return;try{if(Ow(t,v,i,c,dt)){cn=1,Pc(t,Vr(c,t.current)),lt=null;return}}catch(_){if(v!==null)throw lt=v,_;cn=1,Pc(t,Vr(c,t.current)),lt=null;return}i.flags&32768?(gt||h===1?t=!0:ss||(dt&536870912)!==0?t=!1:(Oa=t=!0,(h===2||h===9||h===3||h===6)&&(h=Tr.current,h!==null&&h.tag===13&&(h.flags|=16384))),gm(i,t)):Kc(i)}function Kc(t){var i=t;do{if((i.flags&32768)!==0){gm(i,Oa);return}t=i.return;var c=Dw(i.alternate,i,Wi);if(c!==null){lt=c;return}if(i=i.sibling,i!==null){lt=i;return}lt=i=t}while(i!==null);cn===0&&(cn=5)}function gm(t,i){do{var c=Bw(t.alternate,t);if(c!==null){c.flags&=32767,lt=c;return}if(c=t.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!i&&(t=t.sibling,t!==null)){lt=t;return}lt=t=c}while(t!==null);cn=6,lt=null}function mm(t,i,c,h,v,_,O,U,q){t.cancelPendingCommit=null;do Qc();while(Dn!==0);if((Ct&6)!==0)throw Error(s(327));if(i!==null){if(i===t.current)throw Error(s(177));if(_=i.lanes|i.childLanes,_|=_f,Pr(t,c,_,O,U,q),t===Ft&&(lt=Ft=null,dt=0),cs=i,Da=t,Ki=c,Od=_,Id=v,im=h,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Xw(vr,function(){return wm(),null})):(t.callbackNode=null,t.callbackPriority=0),h=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||h){h=re.T,re.T=null,v=xe.p,xe.p=2,O=Ct,Ct|=4;try{kw(t,i,c)}finally{Ct=O,xe.p=v,re.T=h}}Dn=1,pm(),xm(),ym()}}function pm(){if(Dn===1){Dn=0;var t=Da,i=cs,c=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||c){c=re.T,re.T=null;var h=xe.p;xe.p=2;var v=Ct;Ct|=4;try{Kg(i,t);var _=Xd,O=D(t.containerInfo),U=_.focusedElem,q=_.selectionRange;if(O!==U&&U&&U.ownerDocument&&N(U.ownerDocument.documentElement,U)){if(q!==null&&z(U)){var ue=q.start,ye=q.end;if(ye===void 0&&(ye=ue),"selectionStart"in U)U.selectionStart=ue,U.selectionEnd=Math.min(ye,U.value.length);else{var be=U.ownerDocument||document,fe=be&&be.defaultView||window;if(fe.getSelection){var me=fe.getSelection(),Le=U.textContent.length,Xe=Math.min(q.start,Le),Lt=q.end===void 0?Xe:Math.min(q.end,Le);!me.extend&&Xe>Lt&&(O=Lt,Lt=Xe,Xe=O);var ne=C(U,Xe),$=C(U,Lt);if(ne&&$&&(me.rangeCount!==1||me.anchorNode!==ne.node||me.anchorOffset!==ne.offset||me.focusNode!==$.node||me.focusOffset!==$.offset)){var ce=be.createRange();ce.setStart(ne.node,ne.offset),me.removeAllRanges(),Xe>Lt?(me.addRange(ce),me.extend($.node,$.offset)):(ce.setEnd($.node,$.offset),me.addRange(ce))}}}}for(be=[],me=U;me=me.parentNode;)me.nodeType===1&&be.push({element:me,left:me.scrollLeft,top:me.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<be.length;U++){var ve=be[U];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}cu=!!Zd,Xd=Zd=null}finally{Ct=v,xe.p=h,re.T=c}}t.current=i,Dn=2}}function xm(){if(Dn===2){Dn=0;var t=Da,i=cs,c=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||c){c=re.T,re.T=null;var h=xe.p;xe.p=2;var v=Ct;Ct|=4;try{Zg(t,i.alternate,i)}finally{Ct=v,xe.p=h,re.T=c}}Dn=3}}function ym(){if(Dn===4||Dn===3){Dn=0,Jl();var t=Da,i=cs,c=Ki,h=im;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Dn=5:(Dn=0,cs=Da=null,vm(t,t.pendingLanes));var v=t.pendingLanes;if(v===0&&(Ma=null),Jr(c),i=i.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(jt,i,void 0,(i.current.flags&128)===128)}catch{}if(h!==null){i=re.T,v=xe.p,xe.p=2,re.T=null;try{for(var _=t.onRecoverableError,O=0;O<h.length;O++){var U=h[O];_(U.value,{componentStack:U.stack})}}finally{re.T=i,xe.p=v}}(Ki&3)!==0&&Qc(),Ei(t),v=t.pendingLanes,(c&261930)!==0&&(v&42)!==0?t===Md?yl++:(yl=0,Md=t):yl=0,vl(0)}}function vm(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,$s(i)))}function Qc(){return pm(),xm(),ym(),wm()}function wm(){if(Dn!==5)return!1;var t=Da,i=Od;Od=0;var c=Jr(Ki),h=re.T,v=xe.p;try{xe.p=32>c?32:c,re.T=null,c=Id,Id=null;var _=Da,O=Ki;if(Dn=0,cs=Da=null,Ki=0,(Ct&6)!==0)throw Error(s(331));var U=Ct;if(Ct|=4,tm(_.current),Jg(_,_.current,O,c),Ct=U,vl(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(jt,_)}catch{}return!0}finally{xe.p=v,re.T=h,vm(t,i)}}function bm(t,i,c){i=Vr(c,i),i=ud(t.stateNode,i,2),t=Sa(t,i,2),t!==null&&(gi(t,2),Ei(t))}function Mt(t,i,c){if(t.tag===3)bm(t,t,c);else for(;i!==null;){if(i.tag===3){bm(i,t,c);break}else if(i.tag===1){var h=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ma===null||!Ma.has(h))){t=Vr(c,t),c=_g(2),h=Sa(i,c,2),h!==null&&(Eg(c,h,i,t),gi(h,2),Ei(h));break}}i=i.return}}function kd(t,i,c){var h=t.pingCache;if(h===null){h=t.pingCache=new zw;var v=new Set;h.set(i,v)}else v=h.get(i),v===void 0&&(v=new Set,h.set(i,v));v.has(c)||(Td=!0,v.add(c),t=Hw.bind(null,t,i,c),i.then(t,t))}function Hw(t,i,c){var h=t.pingCache;h!==null&&h.delete(i),t.pingedLanes|=t.suspendedLanes&c,t.warmLanes&=~c,Ft===t&&(dt&c)===c&&(cn===4||cn===3&&(dt&62914560)===dt&&300>en()-Zc?(Ct&2)===0&&us(t,0):Rd|=c,ls===dt&&(ls=0)),Ei(t)}function _m(t,i){i===0&&(i=Nn()),t=co(t,i),t!==null&&(gi(t,i),Ei(t))}function Gw(t){var i=t.memoizedState,c=0;i!==null&&(c=i.retryLane),_m(t,c)}function Zw(t,i){var c=0;switch(t.tag){case 31:case 13:var h=t.stateNode,v=t.memoizedState;v!==null&&(c=v.retryLane);break;case 19:h=t.stateNode;break;case 22:h=t.stateNode._retryCache;break;default:throw Error(s(314))}h!==null&&h.delete(i),_m(t,c)}function Xw(t,i){return aa(t,i)}var Jc=null,ds=null,Ld=!1,$c=!1,Pd=!1,ka=0;function Ei(t){t!==ds&&t.next===null&&(ds===null?Jc=ds=t:ds=ds.next=t),$c=!0,Ld||(Ld=!0,qw())}function vl(t,i){if(!Pd&&$c){Pd=!0;do for(var c=!1,h=Jc;h!==null;){if(t!==0){var v=h.pendingLanes;if(v===0)var _=0;else{var O=h.suspendedLanes,U=h.pingedLanes;_=(1<<31-et(42|t)+1)-1,_&=v&~(O&~U),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(c=!0,Sm(h,_))}else _=dt,_=$a(h,h===Ft?_:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(_&3)===0||zn(h,_)||(c=!0,Sm(h,_));h=h.next}while(c);Pd=!1}}function Yw(){Em()}function Em(){$c=Ld=!1;var t=0;ka!==0&&ib()&&(t=ka);for(var i=en(),c=null,h=Jc;h!==null;){var v=h.next,_=Am(h,i);_===0?(h.next=null,c===null?Jc=v:c.next=v,v===null&&(ds=c)):(c=h,(t!==0||(_&3)!==0)&&($c=!0)),h=v}Dn!==0&&Dn!==5||vl(t),ka!==0&&(ka=0)}function Am(t,i){for(var c=t.suspendedLanes,h=t.pingedLanes,v=t.expirationTimes,_=t.pendingLanes&-62914561;0<_;){var O=31-et(_),U=1<<O,q=v[O];q===-1?((U&c)===0||(U&h)!==0)&&(v[O]=Fs(U,i)):q<=i&&(t.expiredLanes|=U),_&=~U}if(i=Ft,c=dt,c=$a(t,t===i?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h=t.callbackNode,c===0||t===i&&(It===2||It===9)||t.cancelPendingCommit!==null)return h!==null&&h!==null&&ke(h),t.callbackNode=null,t.callbackPriority=0;if((c&3)===0||zn(t,c)){if(i=c&-c,i===t.callbackPriority)return i;switch(h!==null&&ke(h),Jr(c)){case 2:case 8:c=Ps;break;case 32:c=vr;break;case 268435456:c=zs;break;default:c=vr}return h=Cm.bind(null,t),c=aa(c,h),t.callbackPriority=i,t.callbackNode=c,i}return h!==null&&h!==null&&ke(h),t.callbackPriority=2,t.callbackNode=null,2}function Cm(t,i){if(Dn!==0&&Dn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var c=t.callbackNode;if(Qc()&&t.callbackNode!==c)return null;var h=dt;return h=$a(t,t===Ft?h:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),h===0?null:(om(t,h,i),Am(t,en()),t.callbackNode!=null&&t.callbackNode===c?Cm.bind(null,t):null)}function Sm(t,i){if(Qc())return null;om(t,i,!0)}function qw(){ob(function(){(Ct&6)!==0?aa(sr,Yw):Em()})}function zd(){if(ka===0){var t=Qo;t===0&&(t=Ja,Ja<<=1,(Ja&261888)===0&&(Ja=256)),ka=t}return ka}function Tm(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:da(""+t)}function Rm(t,i){var c=i.ownerDocument.createElement("input");return c.name=i.name,c.value=i.value,t.id&&c.setAttribute("form",t.id),i.parentNode.insertBefore(c,i),t=new FormData(t),c.parentNode.removeChild(c),t}function Ww(t,i,c,h,v){if(i==="submit"&&c&&c.stateNode===v){var _=Tm((v[Ot]||null).action),O=h.submitter;O&&(i=(i=O[Ot]||null)?Tm(i.formAction):O.getAttribute("formAction"),i!==null&&(_=i,O=null));var U=new On("action","action",null,h,v);t.push({event:U,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(ka!==0){var q=O?Rm(v,O):new FormData(v);id(c,{pending:!0,data:q,method:v.method,action:_},null,q)}}else typeof _=="function"&&(U.preventDefault(),q=O?Rm(v,O):new FormData(v),id(c,{pending:!0,data:q,method:v.method,action:_},_,q))},currentTarget:v}]})}}for(var Ud=0;Ud<Ks.length;Ud++){var Fd=Ks[Ud],Kw=Fd.toLowerCase(),Qw=Fd[0].toUpperCase()+Fd.slice(1);ii(Kw,"on"+Qw)}ii(fr,"onAnimationEnd"),ii(Un,"onAnimationIteration"),ii(Rt,"onAnimationStart"),ii("dblclick","onDoubleClick"),ii("focusin","onFocus"),ii("focusout","onBlur"),ii(Mn,"onTransitionRun"),ii(tr,"onTransitionStart"),ii(va,"onTransitionCancel"),ii(Li,"onTransitionEnd"),br("onMouseEnter",["mouseout","mouseover"]),br("onMouseLeave",["mouseout","mouseover"]),br("onPointerEnter",["pointerout","pointerover"]),br("onPointerLeave",["pointerout","pointerover"]),St("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),St("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),St("onBeforeInput",["compositionend","keypress","textInput","paste"]),St("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),St("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),St("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wl="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(" "),Jw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wl));function Nm(t,i){i=(i&4)!==0;for(var c=0;c<t.length;c++){var h=t[c],v=h.event;h=h.listeners;e:{var _=void 0;if(i)for(var O=h.length-1;0<=O;O--){var U=h[O],q=U.instance,ue=U.currentTarget;if(U=U.listener,q!==_&&v.isPropagationStopped())break e;_=U,v.currentTarget=ue;try{_(v)}catch(ye){gc(ye)}v.currentTarget=null,_=q}else for(O=0;O<h.length;O++){if(U=h[O],q=U.instance,ue=U.currentTarget,U=U.listener,q!==_&&v.isPropagationStopped())break e;_=U,v.currentTarget=ue;try{_(v)}catch(ye){gc(ye)}v.currentTarget=null,_=q}}}}function ct(t,i){var c=i[oa];c===void 0&&(c=i[oa]=new Set);var h=t+"__bubble";c.has(h)||(Om(i,t,2,!1),c.add(h))}function jd(t,i,c){var h=0;i&&(h|=4),Om(c,t,h,i)}var eu="_reactListening"+Math.random().toString(36).slice(2);function Vd(t){if(!t[eu]){t[eu]=!0,Ee.forEach(function(c){c!=="selectionchange"&&(Jw.has(c)||jd(c,!1,t),jd(c,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[eu]||(i[eu]=!0,jd("selectionchange",!1,i))}}function Om(t,i,c,h){switch(ap(i)){case 2:var v=Sb;break;case 8:v=Tb;break;default:v=rh}c=v.bind(null,i,c,t),v=void 0,!Hs||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(v=!0),h?v!==void 0?t.addEventListener(i,c,{capture:!0,passive:v}):t.addEventListener(i,c,!0):v!==void 0?t.addEventListener(i,c,{passive:v}):t.addEventListener(i,c,!1)}function Hd(t,i,c,h,v){var _=h;if((i&1)===0&&(i&2)===0&&h!==null)e:for(;;){if(h===null)return;var O=h.tag;if(O===3||O===4){var U=h.stateNode.containerInfo;if(U===v)break;if(O===4)for(O=h.return;O!==null;){var q=O.tag;if((q===3||q===4)&&O.stateNode.containerInfo===v)return;O=O.return}for(;U!==null;){if(O=an(U),O===null)return;if(q=O.tag,q===5||q===6||q===26||q===27){h=_=O;continue e}U=U.parentNode}}h=h.return}rc(function(){var ue=_,ye=Vs(c),be=[];e:{var fe=hc.get(t);if(fe!==void 0){var me=On,Le=t;switch(t){case"keypress":if(pi(c)===0)break e;case"keydown":case"keyup":me=Vo;break;case"focusin":Le="focus",me=Xs;break;case"focusout":Le="blur",me=Xs;break;case"beforeblur":case"afterblur":me=Xs;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":me=At;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":me=Fo;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":me=vf;break;case fr:case Un:case Rt:me=tt;break;case Li:me=Mi;break;case"scroll":case"scrollend":me=ic;break;case"wheel":me=wf;break;case"copy":case"cut":case"paste":me=jo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":me=Tt;break;case"toggle":case"beforetoggle":me=qs}var Xe=(i&4)!==0,Lt=!Xe&&(t==="scroll"||t==="scrollend"),ne=Xe?fe!==null?fe+"Capture":null:fe;Xe=[];for(var $=ue,ce;$!==null;){var ve=$;if(ce=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ce===null||ne===null||(ve=We($,ne),ve!=null&&Xe.push(bl($,ve,ce))),Lt)break;$=$.return}0<Xe.length&&(fe=new me(fe,Le,null,c,ye),be.push({event:fe,listeners:Xe}))}}if((i&7)===0){e:{if(fe=t==="mouseover"||t==="pointerover",me=t==="mouseout"||t==="pointerout",fe&&c!==to&&(Le=c.relatedTarget||c.fromElement)&&(an(Le)||Le[wr]))break e;if((me||fe)&&(fe=ye.window===ye?ye:(fe=ye.ownerDocument)?fe.defaultView||fe.parentWindow:window,me?(Le=c.relatedTarget||c.toElement,me=ue,Le=Le?an(Le):null,Le!==null&&(Lt=g(Le),Xe=Le.tag,Le!==Lt||Xe!==5&&Xe!==27&&Xe!==6)&&(Le=null)):(me=null,Le=ue),me!==Le)){if(Xe=At,ve="onMouseLeave",ne="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(Xe=Tt,ve="onPointerLeave",ne="onPointerEnter",$="pointer"),Lt=me==null?fe:sa(me),ce=Le==null?fe:sa(Le),fe=new Xe(ve,$+"leave",me,c,ye),fe.target=Lt,fe.relatedTarget=ce,ve=null,an(ye)===ue&&(Xe=new Xe(ne,$+"enter",Le,c,ye),Xe.target=ce,Xe.relatedTarget=Lt,ve=Xe),Lt=ve,me&&Le)t:{for(Xe=$w,ne=me,$=Le,ce=0,ve=ne;ve;ve=Xe(ve))ce++;ve=0;for(var je=$;je;je=Xe(je))ve++;for(;0<ce-ve;)ne=Xe(ne),ce--;for(;0<ve-ce;)$=Xe($),ve--;for(;ce--;){if(ne===$||$!==null&&ne===$.alternate){Xe=ne;break t}ne=Xe(ne),$=Xe($)}Xe=null}else Xe=null;me!==null&&Im(be,fe,me,Xe,!1),Le!==null&&Lt!==null&&Im(be,Lt,Le,Xe,!0)}}e:{if(fe=ue?sa(ue):window,me=fe.nodeName&&fe.nodeName.toLowerCase(),me==="select"||me==="input"&&fe.type==="file")var bt=Cr;else if(Ws(fe))if(dc)bt=u;else{bt=o;var ze=n}else me=fe.nodeName,!me||me.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ue&&Pt(ue.elementType)&&(bt=Cr):bt=l;if(bt&&(bt=bt(t,ue))){Ar(be,bt,c,ye);break e}ze&&ze(t,fe,ue),t==="focusout"&&ue&&fe.type==="number"&&ue.memoizedProps.value!=null&&V(fe,"number",fe.value)}switch(ze=ue?sa(ue):window,t){case"focusin":(Ws(ze)||ze.contentEditable==="true")&&(W=ze,J=ue,ae=null);break;case"focusout":ae=J=W=null;break;case"mousedown":he=!0;break;case"contextmenu":case"mouseup":case"dragend":he=!1,Ne(be,c,ye);break;case"selectionchange":if(G)break;case"keydown":case"keyup":Ne(be,c,ye)}var nt;if(io)e:{switch(t){case"compositionstart":var ht="onCompositionStart";break e;case"compositionend":ht="onCompositionEnd";break e;case"compositionupdate":ht="onCompositionUpdate";break e}ht=void 0}else ya?fc(t,c)&&(ht="onCompositionEnd"):t==="keydown"&&c.keyCode===229&&(ht="onCompositionStart");ht&&(uc&&c.locale!=="ko"&&(ya||ht!=="onCompositionStart"?ht==="onCompositionEnd"&&ya&&(nt=ha()):(ni=ye,ri="value"in ni?ni.value:ni.textContent,ya=!0)),ze=tu(ue,ht),0<ze.length&&(ht=new sc(ht,t,null,c,ye),be.push({event:ht,listeners:ze}),nt?ht.data=nt:(nt=xa(c),nt!==null&&(ht.data=nt)))),(nt=cc?vi(t,c):Go(t,c))&&(ht=tu(ue,"onBeforeInput"),0<ht.length&&(ze=new sc("onBeforeInput","beforeinput",null,c,ye),be.push({event:ze,listeners:ht}),ze.data=nt)),Ww(be,t,ue,c,ye)}Nm(be,i)})}function bl(t,i,c){return{instance:t,listener:i,currentTarget:c}}function tu(t,i){for(var c=i+"Capture",h=[];t!==null;){var v=t,_=v.stateNode;if(v=v.tag,v!==5&&v!==26&&v!==27||_===null||(v=We(t,c),v!=null&&h.unshift(bl(t,v,_)),v=We(t,i),v!=null&&h.push(bl(t,v,_))),t.tag===3)return h;t=t.return}return[]}function $w(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Im(t,i,c,h,v){for(var _=i._reactName,O=[];c!==null&&c!==h;){var U=c,q=U.alternate,ue=U.stateNode;if(U=U.tag,q!==null&&q===h)break;U!==5&&U!==26&&U!==27||ue===null||(q=ue,v?(ue=We(c,_),ue!=null&&O.unshift(bl(c,ue,q))):v||(ue=We(c,_),ue!=null&&O.push(bl(c,ue,q)))),c=c.return}O.length!==0&&t.push({event:i,listeners:O})}var eb=/\r\n?/g,tb=/\u0000|\uFFFD/g;function Mm(t){return(typeof t=="string"?t:""+t).replace(eb,`
49
- `).replace(tb,"")}function Dm(t,i){return i=Mm(i),Mm(t)===i}function kt(t,i,c,h,v,_){switch(c){case"children":typeof h=="string"?i==="body"||i==="textarea"&&h===""||fa(t,h):(typeof h=="number"||typeof h=="bigint")&&i!=="body"&&fa(t,""+h);break;case"className":ca(t,"class",h);break;case"tabIndex":ca(t,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":ca(t,c,h);break;case"style":Fe(t,h,_);break;case"data":if(i!=="object"){ca(t,"data",h);break}case"src":case"href":if(h===""&&(i!=="a"||c!=="href")){t.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(c);break}h=da(""+h),t.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){t.setAttribute(c,"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 _=="function"&&(c==="formAction"?(i!=="input"&&kt(t,i,"name",v.name,v,null),kt(t,i,"formEncType",v.formEncType,v,null),kt(t,i,"formMethod",v.formMethod,v,null),kt(t,i,"formTarget",v.formTarget,v,null)):(kt(t,i,"encType",v.encType,v,null),kt(t,i,"method",v.method,v,null),kt(t,i,"target",v.target,v,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){t.removeAttribute(c);break}h=da(""+h),t.setAttribute(c,h);break;case"onClick":h!=null&&(t.onclick=cr);break;case"onScroll":h!=null&&ct("scroll",t);break;case"onScrollEnd":h!=null&&ct("scrollend",t);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(c=h.__html,c!=null){if(v.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"multiple":t.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":t.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){t.removeAttribute("xlink:href");break}c=da(""+h),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(c,""+h):t.removeAttribute(c);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":h&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(c,""):t.removeAttribute(c);break;case"capture":case"download":h===!0?t.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?t.setAttribute(c,h):t.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?t.setAttribute(c,h):t.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?t.removeAttribute(c):t.setAttribute(c,h);break;case"popover":ct("beforetoggle",t),ct("toggle",t),la(t,"popover",h);break;case"xlinkActuate":_r(t,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":_r(t,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":_r(t,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":_r(t,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":_r(t,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":_r(t,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":_r(t,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":_r(t,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":_r(t,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":la(t,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=nc.get(c)||c,la(t,c,h))}}function Gd(t,i,c,h,v,_){switch(c){case"style":Fe(t,h,_);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(s(61));if(c=h.__html,c!=null){if(v.children!=null)throw Error(s(60));t.innerHTML=c}}break;case"children":typeof h=="string"?fa(t,h):(typeof h=="number"||typeof h=="bigint")&&fa(t,""+h);break;case"onScroll":h!=null&&ct("scroll",t);break;case"onScrollEnd":h!=null&&ct("scrollend",t);break;case"onClick":h!=null&&(t.onclick=cr);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!tc.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(v=c.endsWith("Capture"),i=c.slice(2,v?c.length-7:void 0),_=t[Ot]||null,_=_!=null?_[c]:null,typeof _=="function"&&t.removeEventListener(i,_,v),typeof h=="function")){typeof _!="function"&&_!==null&&(c in t?t[c]=null:t.hasAttribute(c)&&t.removeAttribute(c)),t.addEventListener(i,h,v);break e}c in t?t[c]=h:h===!0?t.setAttribute(c,""):la(t,c,h)}}}function Hn(t,i,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ct("error",t),ct("load",t);var h=!1,v=!1,_;for(_ in c)if(c.hasOwnProperty(_)){var O=c[_];if(O!=null)switch(_){case"src":h=!0;break;case"srcSet":v=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:kt(t,i,_,O,c,null)}}v&&kt(t,i,"srcSet",c.srcSet,c,null),h&&kt(t,i,"src",c.src,c,null);return;case"input":ct("invalid",t);var U=_=O=v=null,q=null,ue=null;for(h in c)if(c.hasOwnProperty(h)){var ye=c[h];if(ye!=null)switch(h){case"name":v=ye;break;case"type":O=ye;break;case"checked":q=ye;break;case"defaultChecked":ue=ye;break;case"value":_=ye;break;case"defaultValue":U=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,i));break;default:kt(t,i,h,ye,c,null)}}se(t,_,U,q,ue,O,v,!1);return;case"select":ct("invalid",t),h=O=_=null;for(v in c)if(c.hasOwnProperty(v)&&(U=c[v],U!=null))switch(v){case"value":_=U;break;case"defaultValue":O=U;break;case"multiple":h=U;default:kt(t,i,v,U,c,null)}i=_,c=O,t.multiple=!!h,i!=null?Pe(t,!!h,i,!1):c!=null&&Pe(t,!!h,c,!0);return;case"textarea":ct("invalid",t),_=v=h=null;for(O in c)if(c.hasOwnProperty(O)&&(U=c[O],U!=null))switch(O){case"value":h=U;break;case"defaultValue":v=U;break;case"children":_=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(s(91));break;default:kt(t,i,O,U,c,null)}$n(t,h,v,_);return;case"option":for(q in c)if(c.hasOwnProperty(q)&&(h=c[q],h!=null))switch(q){case"selected":t.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:kt(t,i,q,h,c,null)}return;case"dialog":ct("beforetoggle",t),ct("toggle",t),ct("cancel",t),ct("close",t);break;case"iframe":case"object":ct("load",t);break;case"video":case"audio":for(h=0;h<wl.length;h++)ct(wl[h],t);break;case"image":ct("error",t),ct("load",t);break;case"details":ct("toggle",t);break;case"embed":case"source":case"link":ct("error",t),ct("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in c)if(c.hasOwnProperty(ue)&&(h=c[ue],h!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,i));default:kt(t,i,ue,h,c,null)}return;default:if(Pt(i)){for(ye in c)c.hasOwnProperty(ye)&&(h=c[ye],h!==void 0&&Gd(t,i,ye,h,c,void 0));return}}for(U in c)c.hasOwnProperty(U)&&(h=c[U],h!=null&&kt(t,i,U,h,c,null))}function nb(t,i,c,h){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var v=null,_=null,O=null,U=null,q=null,ue=null,ye=null;for(me in c){var be=c[me];if(c.hasOwnProperty(me)&&be!=null)switch(me){case"checked":break;case"value":break;case"defaultValue":q=be;default:h.hasOwnProperty(me)||kt(t,i,me,null,h,be)}}for(var fe in h){var me=h[fe];if(be=c[fe],h.hasOwnProperty(fe)&&(me!=null||be!=null))switch(fe){case"type":_=me;break;case"name":v=me;break;case"checked":ue=me;break;case"defaultChecked":ye=me;break;case"value":O=me;break;case"defaultValue":U=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(s(137,i));break;default:me!==be&&kt(t,i,fe,me,h,be)}}yn(t,O,U,q,ue,ye,_,v);return;case"select":me=O=U=fe=null;for(_ in c)if(q=c[_],c.hasOwnProperty(_)&&q!=null)switch(_){case"value":break;case"multiple":me=q;default:h.hasOwnProperty(_)||kt(t,i,_,null,h,q)}for(v in h)if(_=h[v],q=c[v],h.hasOwnProperty(v)&&(_!=null||q!=null))switch(v){case"value":fe=_;break;case"defaultValue":U=_;break;case"multiple":O=_;default:_!==q&&kt(t,i,v,_,h,q)}i=U,c=O,h=me,fe!=null?Pe(t,!!c,fe,!1):!!h!=!!c&&(i!=null?Pe(t,!!c,i,!0):Pe(t,!!c,c?[]:"",!1));return;case"textarea":me=fe=null;for(U in c)if(v=c[U],c.hasOwnProperty(U)&&v!=null&&!h.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:kt(t,i,U,null,h,v)}for(O in h)if(v=h[O],_=c[O],h.hasOwnProperty(O)&&(v!=null||_!=null))switch(O){case"value":fe=v;break;case"defaultValue":me=v;break;case"children":break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:v!==_&&kt(t,i,O,v,h,_)}hn(t,fe,me);return;case"option":for(var Le in c)if(fe=c[Le],c.hasOwnProperty(Le)&&fe!=null&&!h.hasOwnProperty(Le))switch(Le){case"selected":t.selected=!1;break;default:kt(t,i,Le,null,h,fe)}for(q in h)if(fe=h[q],me=c[q],h.hasOwnProperty(q)&&fe!==me&&(fe!=null||me!=null))switch(q){case"selected":t.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:kt(t,i,q,fe,h,me)}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 Xe in c)fe=c[Xe],c.hasOwnProperty(Xe)&&fe!=null&&!h.hasOwnProperty(Xe)&&kt(t,i,Xe,null,h,fe);for(ue in h)if(fe=h[ue],me=c[ue],h.hasOwnProperty(ue)&&fe!==me&&(fe!=null||me!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,i));break;default:kt(t,i,ue,fe,h,me)}return;default:if(Pt(i)){for(var Lt in c)fe=c[Lt],c.hasOwnProperty(Lt)&&fe!==void 0&&!h.hasOwnProperty(Lt)&&Gd(t,i,Lt,void 0,h,fe);for(ye in h)fe=h[ye],me=c[ye],!h.hasOwnProperty(ye)||fe===me||fe===void 0&&me===void 0||Gd(t,i,ye,fe,h,me);return}}for(var ne in c)fe=c[ne],c.hasOwnProperty(ne)&&fe!=null&&!h.hasOwnProperty(ne)&&kt(t,i,ne,null,h,fe);for(be in h)fe=h[be],me=c[be],!h.hasOwnProperty(be)||fe===me||fe==null&&me==null||kt(t,i,be,fe,h,me)}function Bm(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rb(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var v=c[h],_=v.transferSize,O=v.initiatorType,U=v.duration;if(_&&U&&Bm(O)){for(O=0,U=v.responseEnd,h+=1;h<c.length;h++){var q=c[h],ue=q.startTime;if(ue>U)break;var ye=q.transferSize,be=q.initiatorType;ye&&Bm(be)&&(q=q.responseEnd,O+=ye*(q<U?1:(U-ue)/(q-ue)))}if(--h,i+=8*(_+O)/(v.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Zd=null,Xd=null;function nu(t){return t.nodeType===9?t:t.ownerDocument}function km(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Lm(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function Yd(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var qd=null;function ib(){var t=window.event;return t&&t.type==="popstate"?t===qd?!1:(qd=t,!0):(qd=null,!1)}var Pm=typeof setTimeout=="function"?setTimeout:void 0,ab=typeof clearTimeout=="function"?clearTimeout:void 0,zm=typeof Promise=="function"?Promise:void 0,ob=typeof queueMicrotask=="function"?queueMicrotask:typeof zm<"u"?function(t){return zm.resolve(null).then(t).catch(sb)}:Pm;function sb(t){setTimeout(function(){throw t})}function La(t){return t==="head"}function Um(t,i){var c=i,h=0;do{var v=c.nextSibling;if(t.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"||c==="/&"){if(h===0){t.removeChild(v),ps(i);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")_l(t.ownerDocument.documentElement);else if(c==="head"){c=t.ownerDocument.head,_l(c);for(var _=c.firstChild;_;){var O=_.nextSibling,U=_.nodeName;_[eo]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&_.rel.toLowerCase()==="stylesheet"||c.removeChild(_),_=O}}else c==="body"&&_l(t.ownerDocument.body);c=v}while(c);ps(i)}function Fm(t,i){var c=t;t=0;do{var h=c.nextSibling;if(c.nodeType===1?i?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(i?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(t===0)break;t--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||t++;c=h}while(c)}function Wd(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var c=i;switch(i=i.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Wd(c),lr(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}t.removeChild(c)}}function lb(t,i,c,h){for(;t.nodeType===1;){var v=c;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!h&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(h){if(!t[eo])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(_=t.getAttribute("rel"),_==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(_!==v.rel||t.getAttribute("href")!==(v.href==null||v.href===""?null:v.href)||t.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin)||t.getAttribute("title")!==(v.title==null?null:v.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(_=t.getAttribute("src"),(_!==(v.src==null?null:v.src)||t.getAttribute("type")!==(v.type==null?null:v.type)||t.getAttribute("crossorigin")!==(v.crossOrigin==null?null:v.crossOrigin))&&_&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var _=v.name==null?null:""+v.name;if(v.type==="hidden"&&t.getAttribute("name")===_)return t}else return t;if(t=Yr(t.nextSibling),t===null)break}return null}function cb(t,i,c){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!c||(t=Yr(t.nextSibling),t===null))return null;return t}function jm(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Yr(t.nextSibling),t===null))return null;return t}function Kd(t){return t.data==="$?"||t.data==="$~"}function Qd(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function ub(t,i){var c=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||c.readyState!=="loading")i();else{var h=function(){i(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),t._reactRetry=h}}function Yr(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Jd=null;function Vm(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="/$"||c==="/&"){if(i===0)return Yr(t.nextSibling);i--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||i++}t=t.nextSibling}return null}function Hm(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var c=t.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(i===0)return t;i--}else c!=="/$"&&c!=="/&"||i++}t=t.previousSibling}return null}function Gm(t,i,c){switch(i=nu(c),t){case"html":if(t=i.documentElement,!t)throw Error(s(452));return t;case"head":if(t=i.head,!t)throw Error(s(453));return t;case"body":if(t=i.body,!t)throw Error(s(454));return t;default:throw Error(s(451))}}function _l(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);lr(t)}var qr=new Map,Zm=new Set;function ru(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Qi=xe.d;xe.d={f:fb,r:db,D:hb,C:gb,L:mb,m:pb,X:yb,S:xb,M:vb};function fb(){var t=Qi.f(),i=qc();return t||i}function db(t){var i=Et(t);i!==null&&i.tag===5&&i.type==="form"?lg(i):Qi.r(t)}var hs=typeof document>"u"?null:document;function Xm(t,i,c){var h=hs;if(h&&typeof i=="string"&&i){var v=at(i);v='link[rel="'+t+'"][href="'+v+'"]',typeof c=="string"&&(v+='[crossorigin="'+c+'"]'),Zm.has(v)||(Zm.add(v),t={rel:t,crossOrigin:c,href:i},h.querySelector(v)===null&&(i=h.createElement("link"),Hn(i,"link",t),on(i),h.head.appendChild(i)))}}function hb(t){Qi.D(t),Xm("dns-prefetch",t,null)}function gb(t,i){Qi.C(t,i),Xm("preconnect",t,i)}function mb(t,i,c){Qi.L(t,i,c);var h=hs;if(h&&t&&i){var v='link[rel="preload"][as="'+at(i)+'"]';i==="image"&&c&&c.imageSrcSet?(v+='[imagesrcset="'+at(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(v+='[imagesizes="'+at(c.imageSizes)+'"]')):v+='[href="'+at(t)+'"]';var _=v;switch(i){case"style":_=gs(t);break;case"script":_=ms(t)}qr.has(_)||(t=x({rel:"preload",href:i==="image"&&c&&c.imageSrcSet?void 0:t,as:i},c),qr.set(_,t),h.querySelector(v)!==null||i==="style"&&h.querySelector(El(_))||i==="script"&&h.querySelector(Al(_))||(i=h.createElement("link"),Hn(i,"link",t),on(i),h.head.appendChild(i)))}}function pb(t,i){Qi.m(t,i);var c=hs;if(c&&t){var h=i&&typeof i.as=="string"?i.as:"script",v='link[rel="modulepreload"][as="'+at(h)+'"][href="'+at(t)+'"]',_=v;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=ms(t)}if(!qr.has(_)&&(t=x({rel:"modulepreload",href:t},i),qr.set(_,t),c.querySelector(v)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Al(_)))return}h=c.createElement("link"),Hn(h,"link",t),on(h),c.head.appendChild(h)}}}function xb(t,i,c){Qi.S(t,i,c);var h=hs;if(h&&t){var v=Jn(h).hoistableStyles,_=gs(t);i=i||"default";var O=v.get(_);if(!O){var U={loading:0,preload:null};if(O=h.querySelector(El(_)))U.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":i},c),(c=qr.get(_))&&$d(t,c);var q=O=h.createElement("link");on(q),Hn(q,"link",t),q._p=new Promise(function(ue,ye){q.onload=ue,q.onerror=ye}),q.addEventListener("load",function(){U.loading|=1}),q.addEventListener("error",function(){U.loading|=2}),U.loading|=4,iu(O,i,h)}O={type:"stylesheet",instance:O,count:1,state:U},v.set(_,O)}}}function yb(t,i){Qi.X(t,i);var c=hs;if(c&&t){var h=Jn(c).hoistableScripts,v=ms(t),_=h.get(v);_||(_=c.querySelector(Al(v)),_||(t=x({src:t,async:!0},i),(i=qr.get(v))&&eh(t,i),_=c.createElement("script"),on(_),Hn(_,"link",t),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(v,_))}}function vb(t,i){Qi.M(t,i);var c=hs;if(c&&t){var h=Jn(c).hoistableScripts,v=ms(t),_=h.get(v);_||(_=c.querySelector(Al(v)),_||(t=x({src:t,async:!0,type:"module"},i),(i=qr.get(v))&&eh(t,i),_=c.createElement("script"),on(_),Hn(_,"link",t),c.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},h.set(v,_))}}function Ym(t,i,c,h){var v=(v=Ce.current)?ru(v):null;if(!v)throw Error(s(446));switch(t){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(i=gs(c.href),c=Jn(v).hoistableStyles,h=c.get(i),h||(h={type:"style",instance:null,count:0,state:null},c.set(i,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){t=gs(c.href);var _=Jn(v).hoistableStyles,O=_.get(t);if(O||(v=v.ownerDocument||v,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(t,O),(_=v.querySelector(El(t)))&&!_._p&&(O.instance=_,O.state.loading=5),qr.has(t)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},qr.set(t,c),_||wb(v,t,c,O.state))),i&&h===null)throw Error(s(528,""));return O}if(i&&h!==null)throw Error(s(529,""));return null;case"script":return i=c.async,c=c.src,typeof c=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ms(c),c=Jn(v).hoistableScripts,h=c.get(i),h||(h={type:"script",instance:null,count:0,state:null},c.set(i,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,t))}}function gs(t){return'href="'+at(t)+'"'}function El(t){return'link[rel="stylesheet"]['+t+"]"}function qm(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function wb(t,i,c,h){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?h.loading=1:(i=t.createElement("link"),h.preload=i,i.addEventListener("load",function(){return h.loading|=1}),i.addEventListener("error",function(){return h.loading|=2}),Hn(i,"link",c),on(i),t.head.appendChild(i))}function ms(t){return'[src="'+at(t)+'"]'}function Al(t){return"script[async]"+t}function Wm(t,i,c){if(i.count++,i.instance===null)switch(i.type){case"style":var h=t.querySelector('style[data-href~="'+at(c.href)+'"]');if(h)return i.instance=h,on(h),h;var v=x({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(t.ownerDocument||t).createElement("style"),on(h),Hn(h,"style",v),iu(h,c.precedence,t),i.instance=h;case"stylesheet":v=gs(c.href);var _=t.querySelector(El(v));if(_)return i.state.loading|=4,i.instance=_,on(_),_;h=qm(c),(v=qr.get(v))&&$d(h,v),_=(t.ownerDocument||t).createElement("link"),on(_);var O=_;return O._p=new Promise(function(U,q){O.onload=U,O.onerror=q}),Hn(_,"link",h),i.state.loading|=4,iu(_,c.precedence,t),i.instance=_;case"script":return _=ms(c.src),(v=t.querySelector(Al(_)))?(i.instance=v,on(v),v):(h=c,(v=qr.get(_))&&(h=x({},c),eh(h,v)),t=t.ownerDocument||t,v=t.createElement("script"),on(v),Hn(v,"link",h),t.head.appendChild(v),i.instance=v);case"void":return null;default:throw Error(s(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(h=i.instance,i.state.loading|=4,iu(h,c.precedence,t));return i.instance}function iu(t,i,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),v=h.length?h[h.length-1]:null,_=v,O=0;O<h.length;O++){var U=h[O];if(U.dataset.precedence===i)_=U;else if(_!==v)break}_?_.parentNode.insertBefore(t,_.nextSibling):(i=c.nodeType===9?c.head:c,i.insertBefore(t,i.firstChild))}function $d(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function eh(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var au=null;function Km(t,i,c){if(au===null){var h=new Map,v=au=new Map;v.set(c,h)}else v=au,h=v.get(c),h||(h=new Map,v.set(c,h));if(h.has(t))return h;for(h.set(t,null),c=c.getElementsByTagName(t),v=0;v<c.length;v++){var _=c[v];if(!(_[eo]||_[dn]||t==="link"&&_.getAttribute("rel")==="stylesheet")&&_.namespaceURI!=="http://www.w3.org/2000/svg"){var O=_.getAttribute(i)||"";O=t+O;var U=h.get(O);U?U.push(_):h.set(O,[_])}}return h}function Qm(t,i,c){t=t.ownerDocument||t,t.head.insertBefore(c,i==="title"?t.querySelector("head > title"):null)}function bb(t,i,c){if(c===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Jm(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function _b(t,i,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var v=gs(h.href),_=i.querySelector(El(v));if(_){i=_._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=ou.bind(t),i.then(t,t)),c.state.loading|=4,c.instance=_,on(_);return}_=i.ownerDocument||i,h=qm(h),(v=qr.get(v))&&$d(h,v),_=_.createElement("link"),on(_);var O=_;O._p=new Promise(function(U,q){O.onload=U,O.onerror=q}),Hn(_,"link",h),c.instance=_}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(c,i),(i=c.state.preload)&&(c.state.loading&3)===0&&(t.count++,c=ou.bind(t),i.addEventListener("load",c),i.addEventListener("error",c))}}var th=0;function Eb(t,i){return t.stylesheets&&t.count===0&&lu(t,t.stylesheets),0<t.count||0<t.imgCount?function(c){var h=setTimeout(function(){if(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend){var _=t.unsuspend;t.unsuspend=null,_()}},6e4+i);0<t.imgBytes&&th===0&&(th=62500*rb());var v=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&lu(t,t.stylesheets),t.unsuspend)){var _=t.unsuspend;t.unsuspend=null,_()}},(t.imgBytes>th?50:800)+i);return t.unsuspend=c,function(){t.unsuspend=null,clearTimeout(h),clearTimeout(v)}}:null}function ou(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)lu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var su=null;function lu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,su=new Map,i.forEach(Ab,t),su=null,ou.call(t))}function Ab(t,i){if(!(i.state.loading&4)){var c=su.get(t);if(c)var h=c.get(null);else{c=new Map,su.set(t,c);for(var v=t.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_<v.length;_++){var O=v[_];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(c.set(O.dataset.precedence,O),h=O)}h&&c.set(null,h)}v=i.instance,O=v.getAttribute("data-precedence"),_=c.get(O)||h,_===h&&c.set(null,v),c.set(O,v),this.count++,h=ou.bind(this),v.addEventListener("load",h),v.addEventListener("error",h),_?_.parentNode.insertBefore(v,_.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(v,t.firstChild)),i.state.loading|=4}}var Cl={$$typeof:j,Provider:null,Consumer:null,_currentValue:Me,_currentValue2:Me,_threadCount:0};function Cb(t,i,c,h,v,_,O,U,q){this.tag=1,this.containerInfo=t,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=hi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hi(0),this.hiddenUpdates=hi(null),this.identifierPrefix=h,this.onUncaughtError=v,this.onCaughtError=_,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=q,this.incompleteTransitions=new Map}function $m(t,i,c,h,v,_,O,U,q,ue,ye,be){return t=new Cb(t,i,c,O,q,ue,ye,be,U),i=1,_===!0&&(i|=24),_=Sr(3,null,null,i),t.current=_,_.stateNode=t,i=Bf(),i.refCount++,t.pooledCache=i,i.refCount++,_.memoizedState={element:h,isDehydrated:c,cache:i},zf(_),t}function ep(t){return t?(t=Xo,t):Xo}function tp(t,i,c,h,v,_){v=ep(v),h.context===null?h.context=v:h.pendingContext=v,h=Ca(i),h.payload={element:c},_=_===void 0?null:_,_!==null&&(h.callback=_),c=Sa(t,h,i),c!==null&&(pr(c,t,i),rl(c,t,i))}function np(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var c=t.retryLane;t.retryLane=c!==0&&c<i?c:i}}function nh(t,i){np(t,i),(t=t.alternate)&&np(t,i)}function rp(t){if(t.tag===13||t.tag===31){var i=co(t,67108864);i!==null&&pr(i,t,67108864),nh(t,67108864)}}function ip(t){if(t.tag===13||t.tag===31){var i=Ir();i=kn(i);var c=co(t,i);c!==null&&pr(c,t,i),nh(t,i)}}var cu=!0;function Sb(t,i,c,h){var v=re.T;re.T=null;var _=xe.p;try{xe.p=2,rh(t,i,c,h)}finally{xe.p=_,re.T=v}}function Tb(t,i,c,h){var v=re.T;re.T=null;var _=xe.p;try{xe.p=8,rh(t,i,c,h)}finally{xe.p=_,re.T=v}}function rh(t,i,c,h){if(cu){var v=ih(h);if(v===null)Hd(t,i,h,uu,c),op(t,h);else if(Nb(v,t,i,c,h))h.stopPropagation();else if(op(t,h),i&4&&-1<Rb.indexOf(t)){for(;v!==null;){var _=Et(v);if(_!==null)switch(_.tag){case 3:if(_=_.stateNode,_.current.memoizedState.isDehydrated){var O=di(_.pendingLanes);if(O!==0){var U=_;for(U.pendingLanes|=2,U.entangledLanes|=2;O;){var q=1<<31-et(O);U.entanglements[1]|=q,O&=~q}Ei(_),(Ct&6)===0&&(Xc=en()+500,vl(0))}}break;case 31:case 13:U=co(_,2),U!==null&&pr(U,_,2),qc(),nh(_,2)}if(_=ih(h),_===null&&Hd(t,i,h,uu,c),_===v)break;v=_}v!==null&&h.stopPropagation()}else Hd(t,i,h,null,c)}}function ih(t){return t=Vs(t),ah(t)}var uu=null;function ah(t){if(uu=null,t=an(t),t!==null){var i=g(t);if(i===null)t=null;else{var c=i.tag;if(c===13){if(t=y(i),t!==null)return t;t=null}else if(c===31){if(t=E(i),t!==null)return t;t=null}else if(c===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return uu=t,null}function ap(t){switch(t){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(Ls()){case sr:return 2;case Ps:return 8;case vr:case Pn:return 32;case zs:return 268435456;default:return 32}default:return 32}}var oh=!1,Pa=null,za=null,Ua=null,Sl=new Map,Tl=new Map,Fa=[],Rb="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 op(t,i){switch(t){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Ua=null;break;case"pointerover":case"pointerout":Sl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tl.delete(i.pointerId)}}function Rl(t,i,c,h,v,_){return t===null||t.nativeEvent!==_?(t={blockedOn:i,domEventName:c,eventSystemFlags:h,nativeEvent:_,targetContainers:[v]},i!==null&&(i=Et(i),i!==null&&rp(i)),t):(t.eventSystemFlags|=h,i=t.targetContainers,v!==null&&i.indexOf(v)===-1&&i.push(v),t)}function Nb(t,i,c,h,v){switch(i){case"focusin":return Pa=Rl(Pa,t,i,c,h,v),!0;case"dragenter":return za=Rl(za,t,i,c,h,v),!0;case"mouseover":return Ua=Rl(Ua,t,i,c,h,v),!0;case"pointerover":var _=v.pointerId;return Sl.set(_,Rl(Sl.get(_)||null,t,i,c,h,v)),!0;case"gotpointercapture":return _=v.pointerId,Tl.set(_,Rl(Tl.get(_)||null,t,i,c,h,v)),!0}return!1}function sp(t){var i=an(t.target);if(i!==null){var c=g(i);if(c!==null){if(i=c.tag,i===13){if(i=y(c),i!==null){t.blockedOn=i,De(t.priority,function(){ip(c)});return}}else if(i===31){if(i=E(c),i!==null){t.blockedOn=i,De(t.priority,function(){ip(c)});return}}else if(i===3&&c.stateNode.current.memoizedState.isDehydrated){t.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}t.blockedOn=null}function fu(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var c=ih(t.nativeEvent);if(c===null){c=t.nativeEvent;var h=new c.constructor(c.type,c);to=h,c.target.dispatchEvent(h),to=null}else return i=Et(c),i!==null&&rp(i),t.blockedOn=c,!1;i.shift()}return!0}function lp(t,i,c){fu(t)&&c.delete(i)}function Ob(){oh=!1,Pa!==null&&fu(Pa)&&(Pa=null),za!==null&&fu(za)&&(za=null),Ua!==null&&fu(Ua)&&(Ua=null),Sl.forEach(lp),Tl.forEach(lp)}function du(t,i){t.blockedOn===i&&(t.blockedOn=null,oh||(oh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Ob)))}var hu=null;function cp(t){hu!==t&&(hu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){hu===t&&(hu=null);for(var i=0;i<t.length;i+=3){var c=t[i],h=t[i+1],v=t[i+2];if(typeof h!="function"){if(ah(h||c)===null)continue;break}var _=Et(c);_!==null&&(t.splice(i,3),i-=3,id(_,{pending:!0,data:v,method:c.method,action:h},h,v))}}))}function ps(t){function i(q){return du(q,t)}Pa!==null&&du(Pa,t),za!==null&&du(za,t),Ua!==null&&du(Ua,t),Sl.forEach(i),Tl.forEach(i);for(var c=0;c<Fa.length;c++){var h=Fa[c];h.blockedOn===t&&(h.blockedOn=null)}for(;0<Fa.length&&(c=Fa[0],c.blockedOn===null);)sp(c),c.blockedOn===null&&Fa.shift();if(c=(t.ownerDocument||t).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var v=c[h],_=c[h+1],O=v[Ot]||null;if(typeof _=="function")O||cp(c);else if(O){var U=null;if(_&&_.hasAttribute("formAction")){if(v=_,O=_[Ot]||null)U=O.formAction;else if(ah(v)!==null)continue}else U=O.action;typeof U=="function"?c[h+1]=U:(c.splice(h,3),h-=3),cp(c)}}}function up(){function t(_){_.canIntercept&&_.info==="react-transition"&&_.intercept({handler:function(){return new Promise(function(O){return v=O})},focusReset:"manual",scroll:"manual"})}function i(){v!==null&&(v(),v=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var _=navigation.currentEntry;_&&_.url!=null&&navigation.navigate(_.url,{state:_.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,v=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),v!==null&&(v(),v=null)}}}function sh(t){this._internalRoot=t}gu.prototype.render=sh.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(s(409));var c=i.current,h=Ir();tp(c,h,t,i,null,null)},gu.prototype.unmount=sh.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;tp(t.current,2,null,t,null,null),qc(),i[wr]=null}};function gu(t){this._internalRoot=t}gu.prototype.unstable_scheduleHydration=function(t){if(t){var i=Kn();t={blockedOn:null,target:t,priority:i};for(var c=0;c<Fa.length&&i!==0&&i<Fa[c].priority;c++);Fa.splice(c,0,t),c===0&&sp(t)}};var fp=r.version;if(fp!=="19.2.0")throw Error(s(527,fp,"19.2.0"));xe.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(s(188)):(t=Object.keys(t).join(","),Error(s(268,t)));return t=b(i),t=t!==null?T(t):null,t=t===null?null:t.stateNode,t};var Ib={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:re,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mu.isDisabled&&mu.supportsFiber)try{jt=mu.inject(Ib),Oe=mu}catch{}}return Ol.createRoot=function(t,i){if(!f(t))throw Error(s(299));var c=!1,h="",v=yg,_=vg,O=wg;return i!=null&&(i.unstable_strictMode===!0&&(c=!0),i.identifierPrefix!==void 0&&(h=i.identifierPrefix),i.onUncaughtError!==void 0&&(v=i.onUncaughtError),i.onCaughtError!==void 0&&(_=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError)),i=$m(t,1,!1,null,null,c,h,null,v,_,O,up),t[wr]=i.current,Vd(t),new sh(i)},Ol.hydrateRoot=function(t,i,c){if(!f(t))throw Error(s(299));var h=!1,v="",_=yg,O=vg,U=wg,q=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(v=c.identifierPrefix),c.onUncaughtError!==void 0&&(_=c.onUncaughtError),c.onCaughtError!==void 0&&(O=c.onCaughtError),c.onRecoverableError!==void 0&&(U=c.onRecoverableError),c.formState!==void 0&&(q=c.formState)),i=$m(t,1,!0,i,c??null,h,v,q,_,O,U,up),i.context=ep(null),c=i.current,h=Ir(),h=kn(h),v=Ca(h),v.callback=null,Sa(c,v,h),c=h,i.current.lanes=c,gi(i,c),Ei(i),t[wr]=i.current,Vd(t),new gu(i)},Ol.version="19.2.0",Ol}var bp;function Vb(){if(bp)return uh.exports;bp=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(r){console.error(r)}}return e(),uh.exports=jb(),uh.exports}var Hb=Vb();/**
50
- * react-router v7.11.0
51
- *
52
- * Copyright (c) Remix Software Inc.
53
- *
54
- * This source code is licensed under the MIT license found in the
55
- * LICENSE.md file in the root directory of this source tree.
56
- *
57
- * @license MIT
58
- */var _p="popstate";function Gb(e={}){function r(s,f){let{pathname:g,search:y,hash:E}=s.location;return u0("",{pathname:g,search:y,hash:E},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function a(s,f){return typeof f=="string"?f:Vl(f)}return Xb(r,a,null,e)}function nn(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function ui(e,r){if(!e){typeof console<"u"&&console.warn(r);try{throw new Error(r)}catch{}}}function Zb(){return Math.random().toString(36).substring(2,10)}function Ep(e,r){return{usr:e.state,key:e.key,idx:r}}function u0(e,r,a=null,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof r=="string"?Os(r):r,state:a,key:r&&r.key||s||Zb()}}function Vl({pathname:e="/",search:r="",hash:a=""}){return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function Os(e){let r={};if(e){let a=e.indexOf("#");a>=0&&(r.hash=e.substring(a),e=e.substring(0,a));let s=e.indexOf("?");s>=0&&(r.search=e.substring(s),e=e.substring(0,s)),e&&(r.pathname=e)}return r}function Xb(e,r,a,s={}){let{window:f=document.defaultView,v5Compat:g=!1}=s,y=f.history,E="POP",A=null,b=T();b==null&&(b=0,y.replaceState({...y.state,idx:b},""));function T(){return(y.state||{idx:null}).idx}function x(){E="POP";let P=T(),k=P==null?null:P-b;b=P,A&&A({action:E,location:B.location,delta:k})}function S(P,k){E="PUSH";let Z=u0(B.location,P,k);b=T()+1;let j=Ep(Z,b),H=B.createHref(Z);try{y.pushState(j,"",H)}catch(ee){if(ee instanceof DOMException&&ee.name==="DataCloneError")throw ee;f.location.assign(H)}g&&A&&A({action:E,location:B.location,delta:1})}function R(P,k){E="REPLACE";let Z=u0(B.location,P,k);b=T();let j=Ep(Z,b),H=B.createHref(Z);y.replaceState(j,"",H),g&&A&&A({action:E,location:B.location,delta:0})}function I(P){return Yb(P)}let B={get action(){return E},get location(){return e(f,y)},listen(P){if(A)throw new Error("A history only accepts one active listener");return f.addEventListener(_p,x),A=P,()=>{f.removeEventListener(_p,x),A=null}},createHref(P){return r(f,P)},createURL:I,encodeLocation(P){let k=I(P);return{pathname:k.pathname,search:k.search,hash:k.hash}},push:S,replace:R,go(P){return y.go(P)}};return B}function Yb(e,r=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),nn(a,"No window.location.(origin|href) available to create URL");let s=typeof e=="string"?e:Vl(e);return s=s.replace(/ $/,"%20"),!r&&s.startsWith("//")&&(s=a+s),new URL(s,a)}function xx(e,r,a="/"){return qb(e,r,a,!1)}function qb(e,r,a,s){let f=typeof r=="string"?Os(r):r,g=na(f.pathname||"/",a);if(g==null)return null;let y=yx(e);Wb(y);let E=null;for(let A=0;E==null&&A<y.length;++A){let b=o_(g);E=i_(y[A],b,s)}return E}function yx(e,r=[],a=[],s="",f=!1){let g=(y,E,A=f,b)=>{let T={relativePath:b===void 0?y.path||"":b,caseSensitive:y.caseSensitive===!0,childrenIndex:E,route:y};if(T.relativePath.startsWith("/")){if(!T.relativePath.startsWith(s)&&A)return;nn(T.relativePath.startsWith(s),`Absolute route path "${T.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),T.relativePath=T.relativePath.slice(s.length)}let x=ta([s,T.relativePath]),S=a.concat(T);y.children&&y.children.length>0&&(nn(y.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${x}".`),yx(y.children,r,S,x,A)),!(y.path==null&&!y.index)&&r.push({path:x,score:n_(x,y.index),routesMeta:S})};return e.forEach((y,E)=>{var A;if(y.path===""||!((A=y.path)!=null&&A.includes("?")))g(y,E);else for(let b of vx(y.path))g(y,E,!0,b)}),r}function vx(e){let r=e.split("/");if(r.length===0)return[];let[a,...s]=r,f=a.endsWith("?"),g=a.replace(/\?$/,"");if(s.length===0)return f?[g,""]:[g];let y=vx(s.join("/")),E=[];return E.push(...y.map(A=>A===""?g:[g,A].join("/"))),f&&E.push(...y),E.map(A=>e.startsWith("/")&&A===""?"/":A)}function Wb(e){e.sort((r,a)=>r.score!==a.score?a.score-r.score:r_(r.routesMeta.map(s=>s.childrenIndex),a.routesMeta.map(s=>s.childrenIndex)))}var Kb=/^:[\w-]+$/,Qb=3,Jb=2,$b=1,e_=10,t_=-2,Ap=e=>e==="*";function n_(e,r){let a=e.split("/"),s=a.length;return a.some(Ap)&&(s+=t_),r&&(s+=Jb),a.filter(f=>!Ap(f)).reduce((f,g)=>f+(Kb.test(g)?Qb:g===""?$b:e_),s)}function r_(e,r){return e.length===r.length&&e.slice(0,-1).every((s,f)=>s===r[f])?e[e.length-1]-r[r.length-1]:0}function i_(e,r,a=!1){let{routesMeta:s}=e,f={},g="/",y=[];for(let E=0;E<s.length;++E){let A=s[E],b=E===s.length-1,T=g==="/"?r:r.slice(g.length)||"/",x=Uu({path:A.relativePath,caseSensitive:A.caseSensitive,end:b},T),S=A.route;if(!x&&b&&a&&!s[s.length-1].route.index&&(x=Uu({path:A.relativePath,caseSensitive:A.caseSensitive,end:!1},T)),!x)return null;Object.assign(f,x.params),y.push({params:f,pathname:ta([g,x.pathname]),pathnameBase:u_(ta([g,x.pathnameBase])),route:S}),x.pathnameBase!=="/"&&(g=ta([g,x.pathnameBase]))}return y}function Uu(e,r){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,s]=a_(e.path,e.caseSensitive,e.end),f=r.match(a);if(!f)return null;let g=f[0],y=g.replace(/(.)\/+$/,"$1"),E=f.slice(1);return{params:s.reduce((b,{paramName:T,isOptional:x},S)=>{if(T==="*"){let I=E[S]||"";y=g.slice(0,g.length-I.length).replace(/(.)\/+$/,"$1")}const R=E[S];return x&&!R?b[T]=void 0:b[T]=(R||"").replace(/%2F/g,"/"),b},{}),pathname:g,pathnameBase:y,pattern:e}}function a_(e,r=!1,a=!0){ui(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let s=[],f="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(y,E,A)=>(s.push({paramName:E,isOptional:A!=null}),A?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(s.push({paramName:"*"}),f+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?f+="\\/*$":e!==""&&e!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,r?void 0:"i"),s]}function o_(e){try{return e.split("/").map(r=>decodeURIComponent(r).replace(/\//g,"%2F")).join("/")}catch(r){return ui(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${r}).`),e}}function na(e,r){if(r==="/")return e;if(!e.toLowerCase().startsWith(r.toLowerCase()))return null;let a=r.endsWith("/")?r.length-1:r.length,s=e.charAt(a);return s&&s!=="/"?null:e.slice(a)||"/"}var wx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,s_=e=>wx.test(e);function l_(e,r="/"){let{pathname:a,search:s="",hash:f=""}=typeof e=="string"?Os(e):e,g;if(a)if(s_(a))g=a;else{if(a.includes("//")){let y=a;a=a.replace(/\/\/+/g,"/"),ui(!1,`Pathnames cannot have embedded double slashes - normalizing ${y} -> ${a}`)}a.startsWith("/")?g=Cp(a.substring(1),"/"):g=Cp(a,r)}else g=r;return{pathname:g,search:f_(s),hash:d_(f)}}function Cp(e,r){let a=r.replace(/\/+$/,"").split("/");return e.split("/").forEach(f=>{f===".."?a.length>1&&a.pop():f!=="."&&a.push(f)}),a.length>1?a.join("/"):"/"}function gh(e,r,a,s){return`Cannot include a '${e}' character in a manually specified \`to.${r}\` field [${JSON.stringify(s)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function c_(e){return e.filter((r,a)=>a===0||r.route.path&&r.route.path.length>0)}function bx(e){let r=c_(e);return r.map((a,s)=>s===r.length-1?a.pathname:a.pathnameBase)}function _x(e,r,a,s=!1){let f;typeof e=="string"?f=Os(e):(f={...e},nn(!f.pathname||!f.pathname.includes("?"),gh("?","pathname","search",f)),nn(!f.pathname||!f.pathname.includes("#"),gh("#","pathname","hash",f)),nn(!f.search||!f.search.includes("#"),gh("#","search","hash",f)));let g=e===""||f.pathname==="",y=g?"/":f.pathname,E;if(y==null)E=a;else{let x=r.length-1;if(!s&&y.startsWith("..")){let S=y.split("/");for(;S[0]==="..";)S.shift(),x-=1;f.pathname=S.join("/")}E=x>=0?r[x]:"/"}let A=l_(f,E),b=y&&y!=="/"&&y.endsWith("/"),T=(g||y===".")&&a.endsWith("/");return!A.pathname.endsWith("/")&&(b||T)&&(A.pathname+="/"),A}var ta=e=>e.join("/").replace(/\/\/+/g,"/"),u_=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),f_=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,d_=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,h_=class{constructor(e,r,a,s=!1){this.status=e,this.statusText=r||"",this.internal=s,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function g_(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function m_(e){return e.map(r=>r.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Ex=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Ax(e,r){let a=e;if(typeof a!="string"||!wx.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let s=a,f=!1;if(Ex)try{let g=new URL(window.location.href),y=a.startsWith("//")?new URL(g.protocol+a):new URL(a),E=na(y.pathname,r);y.origin===g.origin&&E!=null?a=E+y.search+y.hash:f=!0}catch{ui(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:f,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Cx=["POST","PUT","PATCH","DELETE"];new Set(Cx);var p_=["GET",...Cx];new Set(p_);var Is=L.createContext(null);Is.displayName="DataRouter";var Ju=L.createContext(null);Ju.displayName="DataRouterState";var x_=L.createContext(!1),Sx=L.createContext({isTransitioning:!1});Sx.displayName="ViewTransition";var y_=L.createContext(new Map);y_.displayName="Fetchers";var v_=L.createContext(null);v_.displayName="Await";var Kr=L.createContext(null);Kr.displayName="Navigation";var Zl=L.createContext(null);Zl.displayName="Location";var ra=L.createContext({outlet:null,matches:[],isDataRoute:!1});ra.displayName="Route";var D0=L.createContext(null);D0.displayName="RouteError";var Tx="REACT_ROUTER_ERROR",w_="REDIRECT",b_="ROUTE_ERROR_RESPONSE";function __(e){if(e.startsWith(`${Tx}:${w_}:{`))try{let r=JSON.parse(e.slice(28));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string"&&typeof r.location=="string"&&typeof r.reloadDocument=="boolean"&&typeof r.replace=="boolean")return r}catch{}}function E_(e){if(e.startsWith(`${Tx}:${b_}:{`))try{let r=JSON.parse(e.slice(40));if(typeof r=="object"&&r&&typeof r.status=="number"&&typeof r.statusText=="string")return new h_(r.status,r.statusText,r.data)}catch{}}function A_(e,{relative:r}={}){nn(Xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:s}=L.useContext(Kr),{hash:f,pathname:g,search:y}=Yl(e,{relative:r}),E=g;return a!=="/"&&(E=g==="/"?a:ta([a,g])),s.createHref({pathname:E,search:y,hash:f})}function Xl(){return L.useContext(Zl)!=null}function To(){return nn(Xl(),"useLocation() may be used only in the context of a <Router> component."),L.useContext(Zl).location}var Rx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Nx(e){L.useContext(Kr).static||L.useLayoutEffect(e)}function C_(){let{isDataRoute:e}=L.useContext(ra);return e?z_():S_()}function S_(){nn(Xl(),"useNavigate() may be used only in the context of a <Router> component.");let e=L.useContext(Is),{basename:r,navigator:a}=L.useContext(Kr),{matches:s}=L.useContext(ra),{pathname:f}=To(),g=JSON.stringify(bx(s)),y=L.useRef(!1);return Nx(()=>{y.current=!0}),L.useCallback((A,b={})=>{if(ui(y.current,Rx),!y.current)return;if(typeof A=="number"){a.go(A);return}let T=_x(A,JSON.parse(g),f,b.relative==="path");e==null&&r!=="/"&&(T.pathname=T.pathname==="/"?r:ta([r,T.pathname])),(b.replace?a.replace:a.push)(T,b.state,b)},[r,a,g,f,e])}L.createContext(null);function Yl(e,{relative:r}={}){let{matches:a}=L.useContext(ra),{pathname:s}=To(),f=JSON.stringify(bx(a));return L.useMemo(()=>_x(e,JSON.parse(f),s,r==="path"),[e,f,s,r])}function T_(e,r){return Ox(e,r)}function Ox(e,r,a,s,f){var Z;nn(Xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:g}=L.useContext(Kr),{matches:y}=L.useContext(ra),E=y[y.length-1],A=E?E.params:{},b=E?E.pathname:"/",T=E?E.pathnameBase:"/",x=E&&E.route;{let j=x&&x.path||"";Mx(b,!x||j.endsWith("*")||j.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${j}">) 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.
59
-
60
- Please change the parent <Route path="${j}"> to <Route path="${j==="/"?"*":`${j}/*`}">.`)}let S=To(),R;if(r){let j=typeof r=="string"?Os(r):r;nn(T==="/"||((Z=j.pathname)==null?void 0:Z.startsWith(T)),`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 "${T}" but pathname "${j.pathname}" was given in the \`location\` prop.`),R=j}else R=S;let I=R.pathname||"/",B=I;if(T!=="/"){let j=T.replace(/^\//,"").split("/");B="/"+I.replace(/^\//,"").split("/").slice(j.length).join("/")}let P=xx(e,{pathname:B});ui(x||P!=null,`No routes matched location "${R.pathname}${R.search}${R.hash}" `),ui(P==null||P[P.length-1].route.element!==void 0||P[P.length-1].route.Component!==void 0||P[P.length-1].route.lazy!==void 0,`Matched leaf route at location "${R.pathname}${R.search}${R.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 k=M_(P&&P.map(j=>Object.assign({},j,{params:Object.assign({},A,j.params),pathname:ta([T,g.encodeLocation?g.encodeLocation(j.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathname]),pathnameBase:j.pathnameBase==="/"?T:ta([T,g.encodeLocation?g.encodeLocation(j.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:j.pathnameBase])})),y,a,s,f);return r&&k?L.createElement(Zl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...R},navigationType:"POP"}},k):k}function R_(){let e=P_(),r=g_(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,s="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:s},g={padding:"2px 4px",backgroundColor:s},y=null;return console.error("Error handled by React Router default ErrorBoundary:",e),y=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:g},"ErrorBoundary")," or"," ",L.createElement("code",{style:g},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},r),a?L.createElement("pre",{style:f},a):null,y)}var N_=L.createElement(R_,null),Ix=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){this.props.onError?this.props.onError(e,r):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=E_(e.digest);a&&(e=a)}let r=e!==void 0?L.createElement(ra.Provider,{value:this.props.routeContext},L.createElement(D0.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?L.createElement(O_,{error:e},r):r}};Ix.contextType=x_;var mh=new WeakMap;function O_({children:e,error:r}){let{basename:a}=L.useContext(Kr);if(typeof r=="object"&&r&&"digest"in r&&typeof r.digest=="string"){let s=__(r.digest);if(s){let f=mh.get(r);if(f)throw f;let g=Ax(s.location,a);if(Ex&&!mh.get(r))if(g.isExternal||s.reloadDocument)window.location.href=g.absoluteURL||g.to;else{const y=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(g.to,{replace:s.replace}));throw mh.set(r,y),y}return L.createElement("meta",{httpEquiv:"refresh",content:`0;url=${g.absoluteURL||g.to}`})}}return e}function I_({routeContext:e,match:r,children:a}){let s=L.useContext(Is);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),L.createElement(ra.Provider,{value:e},a)}function M_(e,r=[],a=null,s=null,f=null){if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(r.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let g=e,y=a==null?void 0:a.errors;if(y!=null){let T=g.findIndex(x=>x.route.id&&(y==null?void 0:y[x.route.id])!==void 0);nn(T>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(y).join(",")}`),g=g.slice(0,Math.min(g.length,T+1))}let E=!1,A=-1;if(a)for(let T=0;T<g.length;T++){let x=g[T];if((x.route.HydrateFallback||x.route.hydrateFallbackElement)&&(A=T),x.route.id){let{loaderData:S,errors:R}=a,I=x.route.loader&&!S.hasOwnProperty(x.route.id)&&(!R||R[x.route.id]===void 0);if(x.route.lazy||I){E=!0,A>=0?g=g.slice(0,A+1):g=[g[0]];break}}}let b=a&&s?(T,x)=>{var S,R;s(T,{location:a.location,params:((R=(S=a.matches)==null?void 0:S[0])==null?void 0:R.params)??{},unstable_pattern:m_(a.matches),errorInfo:x})}:void 0;return g.reduceRight((T,x,S)=>{let R,I=!1,B=null,P=null;a&&(R=y&&x.route.id?y[x.route.id]:void 0,B=x.route.errorElement||N_,E&&(A<0&&S===0?(Mx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),I=!0,P=null):A===S&&(I=!0,P=x.route.hydrateFallbackElement||null)));let k=r.concat(g.slice(0,S+1)),Z=()=>{let j;return R?j=B:I?j=P:x.route.Component?j=L.createElement(x.route.Component,null):x.route.element?j=x.route.element:j=T,L.createElement(I_,{match:x,routeContext:{outlet:T,matches:k,isDataRoute:a!=null},children:j})};return a&&(x.route.ErrorBoundary||x.route.errorElement||S===0)?L.createElement(Ix,{location:a.location,revalidation:a.revalidation,component:B,error:R,children:Z(),routeContext:{outlet:null,matches:k,isDataRoute:!0},onError:b}):Z()},null)}function B0(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function D_(e){let r=L.useContext(Is);return nn(r,B0(e)),r}function B_(e){let r=L.useContext(Ju);return nn(r,B0(e)),r}function k_(e){let r=L.useContext(ra);return nn(r,B0(e)),r}function k0(e){let r=k_(e),a=r.matches[r.matches.length-1];return nn(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function L_(){return k0("useRouteId")}function P_(){var s;let e=L.useContext(D0),r=B_("useRouteError"),a=k0("useRouteError");return e!==void 0?e:(s=r.errors)==null?void 0:s[a]}function z_(){let{router:e}=D_("useNavigate"),r=k0("useNavigate"),a=L.useRef(!1);return Nx(()=>{a.current=!0}),L.useCallback(async(f,g={})=>{ui(a.current,Rx),a.current&&(typeof f=="number"?await e.navigate(f):await e.navigate(f,{fromRouteId:r,...g}))},[e,r])}var Sp={};function Mx(e,r,a){!r&&!Sp[e]&&(Sp[e]=!0,ui(!1,a))}L.memo(U_);function U_({routes:e,future:r,state:a,onError:s}){return Ox(e,void 0,a,s,r)}function f0(e){nn(!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 F_({basename:e="/",children:r=null,location:a,navigationType:s="POP",navigator:f,static:g=!1,unstable_useTransitions:y}){nn(!Xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let E=e.replace(/^\/*/,"/"),A=L.useMemo(()=>({basename:E,navigator:f,static:g,unstable_useTransitions:y,future:{}}),[E,f,g,y]);typeof a=="string"&&(a=Os(a));let{pathname:b="/",search:T="",hash:x="",state:S=null,key:R="default"}=a,I=L.useMemo(()=>{let B=na(b,E);return B==null?null:{location:{pathname:B,search:T,hash:x,state:S,key:R},navigationType:s}},[E,b,T,x,S,R,s]);return ui(I!=null,`<Router basename="${E}"> is not able to match the URL "${b}${T}${x}" because it does not start with the basename, so the <Router> won't render anything.`),I==null?null:L.createElement(Kr.Provider,{value:A},L.createElement(Zl.Provider,{children:r,value:I}))}function j_({children:e,location:r}){return T_(d0(e),r)}function d0(e,r=[]){let a=[];return L.Children.forEach(e,(s,f)=>{if(!L.isValidElement(s))return;let g=[...r,f];if(s.type===L.Fragment){a.push.apply(a,d0(s.props.children,g));return}nn(s.type===f0,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),nn(!s.props.index||!s.props.children,"An index route cannot have child routes.");let y={id:s.props.id||g.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(y.children=d0(s.props.children,g)),a.push(y)}),a}var Ou="get",Iu="application/x-www-form-urlencoded";function $u(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function V_(e){return $u(e)&&e.tagName.toLowerCase()==="button"}function H_(e){return $u(e)&&e.tagName.toLowerCase()==="form"}function G_(e){return $u(e)&&e.tagName.toLowerCase()==="input"}function Z_(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function X_(e,r){return e.button===0&&(!r||r==="_self")&&!Z_(e)}var pu=null;function Y_(){if(pu===null)try{new FormData(document.createElement("form"),0),pu=!1}catch{pu=!0}return pu}var q_=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function ph(e){return e!=null&&!q_.has(e)?(ui(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Iu}"`),null):e}function W_(e,r){let a,s,f,g,y;if(H_(e)){let E=e.getAttribute("action");s=E?na(E,r):null,a=e.getAttribute("method")||Ou,f=ph(e.getAttribute("enctype"))||Iu,g=new FormData(e)}else if(V_(e)||G_(e)&&(e.type==="submit"||e.type==="image")){let E=e.form;if(E==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let A=e.getAttribute("formaction")||E.getAttribute("action");if(s=A?na(A,r):null,a=e.getAttribute("formmethod")||E.getAttribute("method")||Ou,f=ph(e.getAttribute("formenctype"))||ph(E.getAttribute("enctype"))||Iu,g=new FormData(E,e),!Y_()){let{name:b,type:T,value:x}=e;if(T==="image"){let S=b?`${b}.`:"";g.append(`${S}x`,"0"),g.append(`${S}y`,"0")}else b&&g.append(b,x)}}else{if($u(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Ou,s=null,f=Iu,y=e}return g&&f==="text/plain"&&(y=g,g=void 0),{action:s,method:a.toLowerCase(),encType:f,formData:g,body:y}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function L0(e,r){if(e===!1||e===null||typeof e>"u")throw new Error(r)}function K_(e,r,a){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return s.pathname==="/"?s.pathname=`_root.${a}`:r&&na(s.pathname,r)==="/"?s.pathname=`${r.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function Q_(e,r){if(e.id in r)return r[e.id];try{let a=await import(e.module);return r[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function J_(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function $_(e,r,a){let s=await Promise.all(e.map(async f=>{let g=r.routes[f.route.id];if(g){let y=await Q_(g,a);return y.links?y.links():[]}return[]}));return r3(s.flat(1).filter(J_).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function Tp(e,r,a,s,f,g){let y=(A,b)=>a[b]?A.route.id!==a[b].route.id:!0,E=(A,b)=>{var T;return a[b].pathname!==A.pathname||((T=a[b].route.path)==null?void 0:T.endsWith("*"))&&a[b].params["*"]!==A.params["*"]};return g==="assets"?r.filter((A,b)=>y(A,b)||E(A,b)):g==="data"?r.filter((A,b)=>{var x;let T=s.routes[A.route.id];if(!T||!T.hasLoader)return!1;if(y(A,b)||E(A,b))return!0;if(A.route.shouldRevalidate){let S=A.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:((x=a[0])==null?void 0:x.params)||{},nextUrl:new URL(e,window.origin),nextParams:A.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function e3(e,r,{includeHydrateFallback:a}={}){return t3(e.map(s=>{let f=r.routes[s.route.id];if(!f)return[];let g=[f.module];return f.clientActionModule&&(g=g.concat(f.clientActionModule)),f.clientLoaderModule&&(g=g.concat(f.clientLoaderModule)),a&&f.hydrateFallbackModule&&(g=g.concat(f.hydrateFallbackModule)),f.imports&&(g=g.concat(f.imports)),g}).flat(1))}function t3(e){return[...new Set(e)]}function n3(e){let r={},a=Object.keys(e).sort();for(let s of a)r[s]=e[s];return r}function r3(e,r){let a=new Set;return new Set(r),e.reduce((s,f)=>{let g=JSON.stringify(n3(f));return a.has(g)||(a.add(g),s.push({key:g,link:f})),s},[])}function Dx(){let e=L.useContext(Is);return L0(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function i3(){let e=L.useContext(Ju);return L0(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var P0=L.createContext(void 0);P0.displayName="FrameworkContext";function Bx(){let e=L.useContext(P0);return L0(e,"You must render this element inside a <HydratedRouter> element"),e}function a3(e,r){let a=L.useContext(P0),[s,f]=L.useState(!1),[g,y]=L.useState(!1),{onFocus:E,onBlur:A,onMouseEnter:b,onMouseLeave:T,onTouchStart:x}=r,S=L.useRef(null);L.useEffect(()=>{if(e==="render"&&y(!0),e==="viewport"){let B=k=>{k.forEach(Z=>{y(Z.isIntersecting)})},P=new IntersectionObserver(B,{threshold:.5});return S.current&&P.observe(S.current),()=>{P.disconnect()}}},[e]),L.useEffect(()=>{if(s){let B=setTimeout(()=>{y(!0)},100);return()=>{clearTimeout(B)}}},[s]);let R=()=>{f(!0)},I=()=>{f(!1),y(!1)};return a?e!=="intent"?[g,S,{}]:[g,S,{onFocus:Il(E,R),onBlur:Il(A,I),onMouseEnter:Il(b,R),onMouseLeave:Il(T,I),onTouchStart:Il(x,R)}]:[!1,S,{}]}function Il(e,r){return a=>{e&&e(a),a.defaultPrevented||r(a)}}function o3({page:e,...r}){let{router:a}=Dx(),s=L.useMemo(()=>xx(a.routes,e,a.basename),[a.routes,e,a.basename]);return s?L.createElement(l3,{page:e,matches:s,...r}):null}function s3(e){let{manifest:r,routeModules:a}=Bx(),[s,f]=L.useState([]);return L.useEffect(()=>{let g=!1;return $_(e,r,a).then(y=>{g||f(y)}),()=>{g=!0}},[e,r,a]),s}function l3({page:e,matches:r,...a}){let s=To(),{manifest:f,routeModules:g}=Bx(),{basename:y}=Dx(),{loaderData:E,matches:A}=i3(),b=L.useMemo(()=>Tp(e,r,A,f,s,"data"),[e,r,A,f,s]),T=L.useMemo(()=>Tp(e,r,A,f,s,"assets"),[e,r,A,f,s]),x=L.useMemo(()=>{if(e===s.pathname+s.search+s.hash)return[];let I=new Set,B=!1;if(r.forEach(k=>{var j;let Z=f.routes[k.route.id];!Z||!Z.hasLoader||(!b.some(H=>H.route.id===k.route.id)&&k.route.id in E&&((j=g[k.route.id])!=null&&j.shouldRevalidate)||Z.hasClientLoader?B=!0:I.add(k.route.id))}),I.size===0)return[];let P=K_(e,y,"data");return B&&I.size>0&&P.searchParams.set("_routes",r.filter(k=>I.has(k.route.id)).map(k=>k.route.id).join(",")),[P.pathname+P.search]},[y,E,s,f,b,r,e,g]),S=L.useMemo(()=>e3(T,f),[T,f]),R=s3(T);return L.createElement(L.Fragment,null,x.map(I=>L.createElement("link",{key:I,rel:"prefetch",as:"fetch",href:I,...a})),S.map(I=>L.createElement("link",{key:I,rel:"modulepreload",href:I,...a})),R.map(({key:I,link:B})=>L.createElement("link",{key:I,nonce:a.nonce,...B})))}function c3(...e){return r=>{e.forEach(a=>{typeof a=="function"?a(r):a!=null&&(a.current=r)})}}var u3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{u3&&(window.__reactRouterVersion="7.11.0")}catch{}function f3({basename:e,children:r,unstable_useTransitions:a,window:s}){let f=L.useRef();f.current==null&&(f.current=Gb({window:s,v5Compat:!0}));let g=f.current,[y,E]=L.useState({action:g.action,location:g.location}),A=L.useCallback(b=>{a===!1?E(b):L.startTransition(()=>E(b))},[a]);return L.useLayoutEffect(()=>g.listen(A),[g,A]),L.createElement(F_,{basename:e,children:r,location:y.location,navigationType:y.action,navigator:g,unstable_useTransitions:a})}var kx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Lx=L.forwardRef(function({onClick:r,discover:a="render",prefetch:s="none",relative:f,reloadDocument:g,replace:y,state:E,target:A,to:b,preventScrollReset:T,viewTransition:x,unstable_defaultShouldRevalidate:S,...R},I){let{basename:B,unstable_useTransitions:P}=L.useContext(Kr),k=typeof b=="string"&&kx.test(b),Z=Ax(b,B);b=Z.to;let j=A_(b,{relative:f}),[H,ee,Q]=a3(s,R),X=m3(b,{replace:y,state:E,target:A,preventScrollReset:T,relative:f,viewTransition:x,unstable_defaultShouldRevalidate:S,unstable_useTransitions:P});function de(we){r&&r(we),we.defaultPrevented||X(we)}let Y=L.createElement("a",{...R,...Q,href:Z.absoluteURL||j,onClick:Z.isExternal||g?r:de,ref:c3(I,ee),target:A,"data-discover":!k&&a==="render"?"true":void 0});return H&&!k?L.createElement(L.Fragment,null,Y,L.createElement(o3,{page:j})):Y});Lx.displayName="Link";var d3=L.forwardRef(function({"aria-current":r="page",caseSensitive:a=!1,className:s="",end:f=!1,style:g,to:y,viewTransition:E,children:A,...b},T){let x=Yl(y,{relative:b.relative}),S=To(),R=L.useContext(Ju),{navigator:I,basename:B}=L.useContext(Kr),P=R!=null&&w3(x)&&E===!0,k=I.encodeLocation?I.encodeLocation(x).pathname:x.pathname,Z=S.pathname,j=R&&R.navigation&&R.navigation.location?R.navigation.location.pathname:null;a||(Z=Z.toLowerCase(),j=j?j.toLowerCase():null,k=k.toLowerCase()),j&&B&&(j=na(j,B)||j);const H=k!=="/"&&k.endsWith("/")?k.length-1:k.length;let ee=Z===k||!f&&Z.startsWith(k)&&Z.charAt(H)==="/",Q=j!=null&&(j===k||!f&&j.startsWith(k)&&j.charAt(k.length)==="/"),X={isActive:ee,isPending:Q,isTransitioning:P},de=ee?r:void 0,Y;typeof s=="function"?Y=s(X):Y=[s,ee?"active":null,Q?"pending":null,P?"transitioning":null].filter(Boolean).join(" ");let we=typeof g=="function"?g(X):g;return L.createElement(Lx,{...b,"aria-current":de,className:Y,ref:T,style:we,to:y,viewTransition:E},typeof A=="function"?A(X):A)});d3.displayName="NavLink";var h3=L.forwardRef(({discover:e="render",fetcherKey:r,navigate:a,reloadDocument:s,replace:f,state:g,method:y=Ou,action:E,onSubmit:A,relative:b,preventScrollReset:T,viewTransition:x,unstable_defaultShouldRevalidate:S,...R},I)=>{let{unstable_useTransitions:B}=L.useContext(Kr),P=y3(),k=v3(E,{relative:b}),Z=y.toLowerCase()==="get"?"get":"post",j=typeof E=="string"&&kx.test(E),H=ee=>{if(A&&A(ee),ee.defaultPrevented)return;ee.preventDefault();let Q=ee.nativeEvent.submitter,X=(Q==null?void 0:Q.getAttribute("formmethod"))||y,de=()=>P(Q||ee.currentTarget,{fetcherKey:r,method:X,navigate:a,replace:f,state:g,relative:b,preventScrollReset:T,viewTransition:x,unstable_defaultShouldRevalidate:S});B&&a!==!1?L.startTransition(()=>de()):de()};return L.createElement("form",{ref:I,method:Z,action:k,onSubmit:s?A:H,...R,"data-discover":!j&&e==="render"?"true":void 0})});h3.displayName="Form";function g3(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Px(e){let r=L.useContext(Is);return nn(r,g3(e)),r}function m3(e,{target:r,replace:a,state:s,preventScrollReset:f,relative:g,viewTransition:y,unstable_defaultShouldRevalidate:E,unstable_useTransitions:A}={}){let b=C_(),T=To(),x=Yl(e,{relative:g});return L.useCallback(S=>{if(X_(S,r)){S.preventDefault();let R=a!==void 0?a:Vl(T)===Vl(x),I=()=>b(e,{replace:R,state:s,preventScrollReset:f,relative:g,viewTransition:y,unstable_defaultShouldRevalidate:E});A?L.startTransition(()=>I()):I()}},[T,b,x,a,s,r,e,f,g,y,E,A])}var p3=0,x3=()=>`__${String(++p3)}__`;function y3(){let{router:e}=Px("useSubmit"),{basename:r}=L.useContext(Kr),a=L_(),s=e.fetch,f=e.navigate;return L.useCallback(async(g,y={})=>{let{action:E,method:A,encType:b,formData:T,body:x}=W_(g,r);if(y.navigate===!1){let S=y.fetcherKey||x3();await s(S,a,y.action||E,{unstable_defaultShouldRevalidate:y.unstable_defaultShouldRevalidate,preventScrollReset:y.preventScrollReset,formData:T,body:x,formMethod:y.method||A,formEncType:y.encType||b,flushSync:y.flushSync})}else await f(y.action||E,{unstable_defaultShouldRevalidate:y.unstable_defaultShouldRevalidate,preventScrollReset:y.preventScrollReset,formData:T,body:x,formMethod:y.method||A,formEncType:y.encType||b,replace:y.replace,state:y.state,fromRouteId:a,flushSync:y.flushSync,viewTransition:y.viewTransition})},[s,f,r,a])}function v3(e,{relative:r}={}){let{basename:a}=L.useContext(Kr),s=L.useContext(ra);nn(s,"useFormAction must be used inside a RouteContext");let[f]=s.matches.slice(-1),g={...Yl(e||".",{relative:r})},y=To();if(e==null){g.search=y.search;let E=new URLSearchParams(g.search),A=E.getAll("index");if(A.some(T=>T==="")){E.delete("index"),A.filter(x=>x).forEach(x=>E.append("index",x));let T=E.toString();g.search=T?`?${T}`:""}}return(!e||e===".")&&f.route.index&&(g.search=g.search?g.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(g.pathname=g.pathname==="/"?a:ta([a,g.pathname])),Vl(g)}function w3(e,{relative:r}={}){let a=L.useContext(Sx);nn(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=Px("useViewTransitionState"),f=Yl(e,{relative:r});if(!a.isTransitioning)return!1;let g=na(a.currentLocation.pathname,s)||a.currentLocation.pathname,y=na(a.nextLocation.pathname,s)||a.nextLocation.pathname;return Uu(f.pathname,y)!=null||Uu(f.pathname,g)!=null}var zx=px();const b3=Qu(zx),Rp=e=>{let r;const a=new Set,s=(b,T)=>{const x=typeof b=="function"?b(r):b;if(!Object.is(x,r)){const S=r;r=T??(typeof x!="object"||x===null)?x:Object.assign({},r,x),a.forEach(R=>R(r,S))}},f=()=>r,E={setState:s,getState:f,getInitialState:()=>A,subscribe:b=>(a.add(b),()=>a.delete(b))},A=r=e(s,f,E);return E},_3=(e=>e?Rp(e):Rp),E3=e=>e;function Ao(e,r=E3){const a=Dr.useSyncExternalStore(e.subscribe,Dr.useCallback(()=>r(e.getState()),[e,r]),Dr.useCallback(()=>r(e.getInitialState()),[e,r]));return Dr.useDebugValue(a),a}const Np=e=>{const r=_3(e),a=s=>Ao(r,s);return Object.assign(a,r),a},z0=(e=>e?Np(e):Np),Op=e=>Symbol.iterator in e,Ip=e=>"entries"in e,Mp=(e,r)=>{const a=e instanceof Map?e:new Map(e.entries()),s=r instanceof Map?r:new Map(r.entries());if(a.size!==s.size)return!1;for(const[f,g]of a)if(!s.has(f)||!Object.is(g,s.get(f)))return!1;return!0},A3=(e,r)=>{const a=e[Symbol.iterator](),s=r[Symbol.iterator]();let f=a.next(),g=s.next();for(;!f.done&&!g.done;){if(!Object.is(f.value,g.value))return!1;f=a.next(),g=s.next()}return!!f.done&&!!g.done};function C3(e,r){return Object.is(e,r)?!0:typeof e!="object"||e===null||typeof r!="object"||r===null||Object.getPrototypeOf(e)!==Object.getPrototypeOf(r)?!1:Op(e)&&Op(r)?Ip(e)&&Ip(r)?Mp(e,r):A3(e,r):Mp({entries:()=>Object.entries(e)},{entries:()=>Object.entries(r)})}function ef(e){const r=Dr.useRef(void 0);return a=>{const s=e(a);return C3(r.current,s)?r.current:r.current=s}}const Fl=4e3,S3="/controller",T3=300,R3=8;class N3{constructor(r={}){Va(this,"inputBuffer",new Map);Va(this,"latchState",new Map);Va(this,"config");this.config=r}handleInput(r){this.inputBuffer.set(r.controllerId,r.input);const a=r==null?void 0:r.input;a&&(a.action===!0||typeof a.vector=="object"&&a.vector!==null&&(Math.abs(a.vector.x??0)>.01||Math.abs(a.vector.y??0)>.01))}getInput(r){const a=this.inputBuffer.get(r);if(!a)return;let s=a;if(this.config.schema){const f=this.config.schema.safeParse(a);if(!f.success){console.warn(`[InputManager] Invalid input for controller ${r}:`,f.error);return}s=f.data}return this.config.latch?this.getLatched(r,s):s}clearInput(r){this.inputBuffer.delete(r),this.latchState.delete(r)}getLatched(r,a){const{booleanFields:s=[],vectorFields:f=[]}=this.config.latch,g=this.latchState.get(r),y=JSON.stringify(a);if(!(y!==(g==null?void 0:g.lastRawHash))&&g){const R={...a},I=R,B=a;for(const P of s){const k=B[P];I[P]=k??!1}for(const P of f){const k=B[P];if(k&&typeof k=="object"&&!Array.isArray(k)){const Z=k;typeof Z.x=="number"&&typeof Z.y=="number"?I[P]=Z:I[P]={x:0,y:0}}else I[P]={x:0,y:0}}return this.latchState.set(r,{raw:a,latched:R,lastRawHash:y}),R}const A=(g==null?void 0:g.latched)??{},b={...a},T=b,x=a,S=A;for(const R of s){const I=x[R],B=S[R];typeof I=="boolean"&&(T[R]=I||B===!0)}for(const R of f){const I=x[R],B=S[R];if(I&&typeof I=="object"&&!Array.isArray(I)){const P=I,k=B;if(typeof P.x=="number"&&typeof P.y=="number"){const Z=P.x!==0||P.y!==0,j=k&&typeof k.x=="number"&&typeof k.y=="number"&&(k.x!==0||k.y!==0);Z?T[R]=P:j?T[R]=k:T[R]={x:0,y:0}}}}return this.latchState.set(r,{raw:a,latched:b,lastRawHash:y}),b}}const O3=()=>z0(e=>({role:null,roomId:null,controllerId:null,connectionStatus:"idle",mode:"standalone",gameState:"paused",stateMessage:void 0,players:[],lastError:void 0,registeredRoomId:null,setRole:r=>e({role:r}),setRoomId:r=>e({roomId:r}),setControllerId:r=>e({controllerId:r}),setStatus:r=>e({connectionStatus:r}),setMode:r=>e({mode:r}),setGameState:r=>e({gameState:r}),setStateMessage:r=>e({stateMessage:r}),toggleGameState:()=>e(r=>({gameState:r.gameState==="paused"?"playing":"paused"})),setError:r=>e({lastError:r}),upsertPlayer:r=>e(a=>{const s=a.players.findIndex(f=>f.id===r.id);if(s>=0){const f=[...a.players];return f[s]=r,{players:f}}return{players:[...a.players,r]}}),removePlayer:r=>e(a=>({players:a.players.filter(s=>s.id!==r)})),resetPlayers:()=>e({players:[]}),resetGameState:()=>e({gameState:"paused",stateMessage:void 0}),setRegisteredRoomId:r=>e({registeredRoomId:r})})),Ri=Object.create(null);Ri.open="0";Ri.close="1";Ri.ping="2";Ri.pong="3";Ri.message="4";Ri.upgrade="5";Ri.noop="6";const Mu=Object.create(null);Object.keys(Ri).forEach(e=>{Mu[Ri[e]]=e});const h0={type:"error",data:"parser error"},Ux=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Fx=typeof ArrayBuffer=="function",jx=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,U0=({type:e,data:r},a,s)=>Ux&&r instanceof Blob?a?s(r):Dp(r,s):Fx&&(r instanceof ArrayBuffer||jx(r))?a?s(r):Dp(new Blob([r]),s):s(Ri[e]+(r||"")),Dp=(e,r)=>{const a=new FileReader;return a.onload=function(){const s=a.result.split(",")[1];r("b"+(s||""))},a.readAsDataURL(e)};function Bp(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let xh;function I3(e,r){if(Ux&&e.data instanceof Blob)return e.data.arrayBuffer().then(Bp).then(r);if(Fx&&(e.data instanceof ArrayBuffer||jx(e.data)))return r(Bp(e.data));U0(e,!1,a=>{xh||(xh=new TextEncoder),r(xh.encode(a))})}const kp="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Pl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<kp.length;e++)Pl[kp.charCodeAt(e)]=e;const M3=e=>{let r=e.length*.75,a=e.length,s,f=0,g,y,E,A;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);const b=new ArrayBuffer(r),T=new Uint8Array(b);for(s=0;s<a;s+=4)g=Pl[e.charCodeAt(s)],y=Pl[e.charCodeAt(s+1)],E=Pl[e.charCodeAt(s+2)],A=Pl[e.charCodeAt(s+3)],T[f++]=g<<2|y>>4,T[f++]=(y&15)<<4|E>>2,T[f++]=(E&3)<<6|A&63;return b},D3=typeof ArrayBuffer=="function",F0=(e,r)=>{if(typeof e!="string")return{type:"message",data:Vx(e,r)};const a=e.charAt(0);return a==="b"?{type:"message",data:B3(e.substring(1),r)}:Mu[a]?e.length>1?{type:Mu[a],data:e.substring(1)}:{type:Mu[a]}:h0},B3=(e,r)=>{if(D3){const a=M3(e);return Vx(a,r)}else return{base64:!0,data:e}},Vx=(e,r)=>{switch(r){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},Hx="",k3=(e,r)=>{const a=e.length,s=new Array(a);let f=0;e.forEach((g,y)=>{U0(g,!1,E=>{s[y]=E,++f===a&&r(s.join(Hx))})})},L3=(e,r)=>{const a=e.split(Hx),s=[];for(let f=0;f<a.length;f++){const g=F0(a[f],r);if(s.push(g),g.type==="error")break}return s};function P3(){return new TransformStream({transform(e,r){I3(e,a=>{const s=a.length;let f;if(s<126)f=new Uint8Array(1),new DataView(f.buffer).setUint8(0,s);else if(s<65536){f=new Uint8Array(3);const g=new DataView(f.buffer);g.setUint8(0,126),g.setUint16(1,s)}else{f=new Uint8Array(9);const g=new DataView(f.buffer);g.setUint8(0,127),g.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(f[0]|=128),r.enqueue(f),r.enqueue(a)})}})}let yh;function xu(e){return e.reduce((r,a)=>r+a.length,0)}function yu(e,r){if(e[0].length===r)return e.shift();const a=new Uint8Array(r);let s=0;for(let f=0;f<r;f++)a[f]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),a}function z3(e,r){yh||(yh=new TextDecoder);const a=[];let s=0,f=-1,g=!1;return new TransformStream({transform(y,E){for(a.push(y);;){if(s===0){if(xu(a)<1)break;const A=yu(a,1);g=(A[0]&128)===128,f=A[0]&127,f<126?s=3:f===126?s=1:s=2}else if(s===1){if(xu(a)<2)break;const A=yu(a,2);f=new DataView(A.buffer,A.byteOffset,A.length).getUint16(0),s=3}else if(s===2){if(xu(a)<8)break;const A=yu(a,8),b=new DataView(A.buffer,A.byteOffset,A.length),T=b.getUint32(0);if(T>Math.pow(2,21)-1){E.enqueue(h0);break}f=T*Math.pow(2,32)+b.getUint32(4),s=3}else{if(xu(a)<f)break;const A=yu(a,f);E.enqueue(F0(g?A:yh.decode(A),r)),s=0}if(f===0||f>e){E.enqueue(h0);break}}}})}const Gx=4;function Cn(e){if(e)return U3(e)}function U3(e){for(var r in Cn.prototype)e[r]=Cn.prototype[r];return e}Cn.prototype.on=Cn.prototype.addEventListener=function(e,r){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(r),this};Cn.prototype.once=function(e,r){function a(){this.off(e,a),r.apply(this,arguments)}return a.fn=r,this.on(e,a),this};Cn.prototype.off=Cn.prototype.removeListener=Cn.prototype.removeAllListeners=Cn.prototype.removeEventListener=function(e,r){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var a=this._callbacks["$"+e];if(!a)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,f=0;f<a.length;f++)if(s=a[f],s===r||s.fn===r){a.splice(f,1);break}return a.length===0&&delete this._callbacks["$"+e],this};Cn.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var r=new Array(arguments.length-1),a=this._callbacks["$"+e],s=1;s<arguments.length;s++)r[s-1]=arguments[s];if(a){a=a.slice(0);for(var s=0,f=a.length;s<f;++s)a[s].apply(this,r)}return this};Cn.prototype.emitReserved=Cn.prototype.emit;Cn.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};Cn.prototype.hasListeners=function(e){return!!this.listeners(e).length};const tf=typeof Promise=="function"&&typeof Promise.resolve=="function"?r=>Promise.resolve().then(r):(r,a)=>a(r,0),Wr=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),F3="arraybuffer";function Zx(e,...r){return r.reduce((a,s)=>(e.hasOwnProperty(s)&&(a[s]=e[s]),a),{})}const j3=Wr.setTimeout,V3=Wr.clearTimeout;function nf(e,r){r.useNativeTimers?(e.setTimeoutFn=j3.bind(Wr),e.clearTimeoutFn=V3.bind(Wr)):(e.setTimeoutFn=Wr.setTimeout.bind(Wr),e.clearTimeoutFn=Wr.clearTimeout.bind(Wr))}const H3=1.33;function G3(e){return typeof e=="string"?Z3(e):Math.ceil((e.byteLength||e.size)*H3)}function Z3(e){let r=0,a=0;for(let s=0,f=e.length;s<f;s++)r=e.charCodeAt(s),r<128?a+=1:r<2048?a+=2:r<55296||r>=57344?a+=3:(s++,a+=4);return a}function Xx(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function X3(e){let r="";for(let a in e)e.hasOwnProperty(a)&&(r.length&&(r+="&"),r+=encodeURIComponent(a)+"="+encodeURIComponent(e[a]));return r}function Y3(e){let r={},a=e.split("&");for(let s=0,f=a.length;s<f;s++){let g=a[s].split("=");r[decodeURIComponent(g[0])]=decodeURIComponent(g[1])}return r}class q3 extends Error{constructor(r,a,s){super(r),this.description=a,this.context=s,this.type="TransportError"}}class j0 extends Cn{constructor(r){super(),this.writable=!1,nf(this,r),this.opts=r,this.query=r.query,this.socket=r.socket,this.supportsBinary=!r.forceBase64}onError(r,a,s){return super.emitReserved("error",new q3(r,a,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(r){this.readyState==="open"&&this.write(r)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(r){const a=F0(r,this.socket.binaryType);this.onPacket(a)}onPacket(r){super.emitReserved("packet",r)}onClose(r){this.readyState="closed",super.emitReserved("close",r)}pause(r){}createUri(r,a={}){return r+"://"+this._hostname()+this._port()+this.opts.path+this._query(a)}_hostname(){const r=this.opts.hostname;return r.indexOf(":")===-1?r:"["+r+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(r){const a=X3(r);return a.length?"?"+a:""}}class W3 extends j0{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(r){this.readyState="pausing";const a=()=>{this.readyState="paused",r()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||a()})),this.writable||(s++,this.once("drain",function(){--s||a()}))}else a()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(r){const a=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};L3(r,this.socket.binaryType).forEach(a),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const r=()=>{this.write([{type:"close"}])};this.readyState==="open"?r():this.once("open",r)}write(r){this.writable=!1,k3(r,a=>{this.doWrite(a,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const r=this.opts.secure?"https":"http",a=this.query||{};return this.opts.timestampRequests!==!1&&(a[this.opts.timestampParam]=Xx()),!this.supportsBinary&&!a.sid&&(a.b64=1),this.createUri(r,a)}}let Yx=!1;try{Yx=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const K3=Yx;function Q3(){}class J3 extends W3{constructor(r){if(super(r),typeof location<"u"){const a=location.protocol==="https:";let s=location.port;s||(s=a?"443":"80"),this.xd=typeof location<"u"&&r.hostname!==location.hostname||s!==r.port}}doWrite(r,a){const s=this.request({method:"POST",data:r});s.on("success",a),s.on("error",(f,g)=>{this.onError("xhr post error",f,g)})}doPoll(){const r=this.request();r.on("data",this.onData.bind(this)),r.on("error",(a,s)=>{this.onError("xhr poll error",a,s)}),this.pollXhr=r}}class Ti extends Cn{constructor(r,a,s){super(),this.createRequest=r,nf(this,s),this._opts=s,this._method=s.method||"GET",this._uri=a,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var r;const a=Zx(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");a.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(a);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let f in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(f)&&s.setRequestHeader(f,this._opts.extraHeaders[f])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(r=this._opts.cookieJar)===null||r===void 0||r.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var f;s.readyState===3&&((f=this._opts.cookieJar)===null||f===void 0||f.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(f){this.setTimeoutFn(()=>{this._onError(f)},0);return}typeof document<"u"&&(this._index=Ti.requestsCount++,Ti.requests[this._index]=this)}_onError(r){this.emitReserved("error",r,this._xhr),this._cleanup(!0)}_cleanup(r){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=Q3,r)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Ti.requests[this._index],this._xhr=null}}_onLoad(){const r=this._xhr.responseText;r!==null&&(this.emitReserved("data",r),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}Ti.requestsCount=0;Ti.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",Lp);else if(typeof addEventListener=="function"){const e="onpagehide"in Wr?"pagehide":"unload";addEventListener(e,Lp,!1)}}function Lp(){for(let e in Ti.requests)Ti.requests.hasOwnProperty(e)&&Ti.requests[e].abort()}const $3=(function(){const e=qx({xdomain:!1});return e&&e.responseType!==null})();class eE extends J3{constructor(r){super(r);const a=r&&r.forceBase64;this.supportsBinary=$3&&!a}request(r={}){return Object.assign(r,{xd:this.xd},this.opts),new Ti(qx,this.uri(),r)}}function qx(e){const r=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!r||K3))return new XMLHttpRequest}catch{}if(!r)try{return new Wr[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Wx=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class tE extends j0{get name(){return"websocket"}doOpen(){const r=this.uri(),a=this.opts.protocols,s=Wx?{}:Zx(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(r,a,s)}catch(f){return this.emitReserved("error",f)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=r=>this.onClose({description:"websocket connection closed",context:r}),this.ws.onmessage=r=>this.onData(r.data),this.ws.onerror=r=>this.onError("websocket error",r)}write(r){this.writable=!1;for(let a=0;a<r.length;a++){const s=r[a],f=a===r.length-1;U0(s,this.supportsBinary,g=>{try{this.doWrite(s,g)}catch{}f&&tf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const r=this.opts.secure?"wss":"ws",a=this.query||{};return this.opts.timestampRequests&&(a[this.opts.timestampParam]=Xx()),this.supportsBinary||(a.b64=1),this.createUri(r,a)}}const vh=Wr.WebSocket||Wr.MozWebSocket;class nE extends tE{createSocket(r,a,s){return Wx?new vh(r,a,s):a?new vh(r,a):new vh(r)}doWrite(r,a){this.ws.send(a)}}class rE extends j0{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(r){return this.emitReserved("error",r)}this._transport.closed.then(()=>{this.onClose()}).catch(r=>{this.onError("webtransport error",r)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(r=>{const a=z3(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=r.readable.pipeThrough(a).getReader(),f=P3();f.readable.pipeTo(r.writable),this._writer=f.writable.getWriter();const g=()=>{s.read().then(({done:E,value:A})=>{E||(this.onPacket(A),g())}).catch(E=>{})};g();const y={type:"open"};this.query.sid&&(y.data=`{"sid":"${this.query.sid}"}`),this._writer.write(y).then(()=>this.onOpen())})})}write(r){this.writable=!1;for(let a=0;a<r.length;a++){const s=r[a],f=a===r.length-1;this._writer.write(s).then(()=>{f&&tf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var r;(r=this._transport)===null||r===void 0||r.close()}}const iE={websocket:nE,webtransport:rE,polling:eE},aE=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,oE=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function g0(e){if(e.length>8e3)throw"URI too long";const r=e,a=e.indexOf("["),s=e.indexOf("]");a!=-1&&s!=-1&&(e=e.substring(0,a)+e.substring(a,s).replace(/:/g,";")+e.substring(s,e.length));let f=aE.exec(e||""),g={},y=14;for(;y--;)g[oE[y]]=f[y]||"";return a!=-1&&s!=-1&&(g.source=r,g.host=g.host.substring(1,g.host.length-1).replace(/;/g,":"),g.authority=g.authority.replace("[","").replace("]","").replace(/;/g,":"),g.ipv6uri=!0),g.pathNames=sE(g,g.path),g.queryKey=lE(g,g.query),g}function sE(e,r){const a=/\/{2,9}/g,s=r.replace(a,"/").split("/");return(r.slice(0,1)=="/"||r.length===0)&&s.splice(0,1),r.slice(-1)=="/"&&s.splice(s.length-1,1),s}function lE(e,r){const a={};return r.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,f,g){f&&(a[f]=g)}),a}const m0=typeof addEventListener=="function"&&typeof removeEventListener=="function",Du=[];m0&&addEventListener("offline",()=>{Du.forEach(e=>e())},!1);class Ya extends Cn{constructor(r,a){if(super(),this.binaryType=F3,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,r&&typeof r=="object"&&(a=r,r=null),r){const s=g0(r);a.hostname=s.host,a.secure=s.protocol==="https"||s.protocol==="wss",a.port=s.port,s.query&&(a.query=s.query)}else a.host&&(a.hostname=g0(a.host).host);nf(this,a),this.secure=a.secure!=null?a.secure:typeof location<"u"&&location.protocol==="https:",a.hostname&&!a.port&&(a.port=this.secure?"443":"80"),this.hostname=a.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=a.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},a.transports.forEach(s=>{const f=s.prototype.name;this.transports.push(f),this._transportsByName[f]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},a),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=Y3(this.opts.query)),m0&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Du.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(r){const a=Object.assign({},this.opts.query);a.EIO=Gx,a.transport=r,this.id&&(a.sid=this.id);const s=Object.assign({},this.opts,{query:a,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[r]);return new this._transportsByName[r](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const r=this.opts.rememberUpgrade&&Ya.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const a=this.createTransport(r);a.open(),this.setTransport(a)}setTransport(r){this.transport&&this.transport.removeAllListeners(),this.transport=r,r.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",a=>this._onClose("transport close",a))}onOpen(){this.readyState="open",Ya.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(r){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",r),this.emitReserved("heartbeat"),r.type){case"open":this.onHandshake(JSON.parse(r.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const a=new Error("server error");a.code=r.data,this._onError(a);break;case"message":this.emitReserved("data",r.data),this.emitReserved("message",r.data);break}}onHandshake(r){this.emitReserved("handshake",r),this.id=r.sid,this.transport.query.sid=r.sid,this._pingInterval=r.pingInterval,this._pingTimeout=r.pingTimeout,this._maxPayload=r.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const r=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+r,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},r),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const r=this._getWritablePackets();this.transport.send(r),this._prevBufferLen=r.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let a=1;for(let s=0;s<this.writeBuffer.length;s++){const f=this.writeBuffer[s].data;if(f&&(a+=G3(f)),s>0&&a>this._maxPayload)return this.writeBuffer.slice(0,s);a+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const r=Date.now()>this._pingTimeoutTime;return r&&(this._pingTimeoutTime=0,tf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),r}write(r,a,s){return this._sendPacket("message",r,a,s),this}send(r,a,s){return this._sendPacket("message",r,a,s),this}_sendPacket(r,a,s,f){if(typeof a=="function"&&(f=a,a=void 0),typeof s=="function"&&(f=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const g={type:r,data:a,options:s};this.emitReserved("packetCreate",g),this.writeBuffer.push(g),f&&this.once("flush",f),this.flush()}close(){const r=()=>{this._onClose("forced close"),this.transport.close()},a=()=>{this.off("upgrade",a),this.off("upgradeError",a),r()},s=()=>{this.once("upgrade",a),this.once("upgradeError",a)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():r()}):this.upgrading?s():r()),this}_onError(r){if(Ya.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",r),this._onClose("transport error",r)}_onClose(r,a){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),m0&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=Du.indexOf(this._offlineEventListener);s!==-1&&Du.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",r,a),this.writeBuffer=[],this._prevBufferLen=0}}}Ya.protocol=Gx;class cE extends Ya{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let r=0;r<this._upgrades.length;r++)this._probe(this._upgrades[r])}_probe(r){let a=this.createTransport(r),s=!1;Ya.priorWebsocketSuccess=!1;const f=()=>{s||(a.send([{type:"ping",data:"probe"}]),a.once("packet",x=>{if(!s)if(x.type==="pong"&&x.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",a),!a)return;Ya.priorWebsocketSuccess=a.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(T(),this.setTransport(a),a.send([{type:"upgrade"}]),this.emitReserved("upgrade",a),a=null,this.upgrading=!1,this.flush())})}else{const S=new Error("probe error");S.transport=a.name,this.emitReserved("upgradeError",S)}}))};function g(){s||(s=!0,T(),a.close(),a=null)}const y=x=>{const S=new Error("probe error: "+x);S.transport=a.name,g(),this.emitReserved("upgradeError",S)};function E(){y("transport closed")}function A(){y("socket closed")}function b(x){a&&x.name!==a.name&&g()}const T=()=>{a.removeListener("open",f),a.removeListener("error",y),a.removeListener("close",E),this.off("close",A),this.off("upgrading",b)};a.once("open",f),a.once("error",y),a.once("close",E),this.once("close",A),this.once("upgrading",b),this._upgrades.indexOf("webtransport")!==-1&&r!=="webtransport"?this.setTimeoutFn(()=>{s||a.open()},200):a.open()}onHandshake(r){this._upgrades=this._filterUpgrades(r.upgrades),super.onHandshake(r)}_filterUpgrades(r){const a=[];for(let s=0;s<r.length;s++)~this.transports.indexOf(r[s])&&a.push(r[s]);return a}}let uE=class extends cE{constructor(r,a={}){const s=typeof r=="object"?r:a;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(f=>iE[f]).filter(f=>!!f)),super(r,s)}};function fE(e,r="",a){let s=e;a=a||typeof location<"u"&&location,e==null&&(e=a.protocol+"//"+a.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=a.protocol+e:e=a.host+e),/^(https?|wss?):\/\//.test(e)||(typeof a<"u"?e=a.protocol+"//"+e:e="https://"+e),s=g0(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const g=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+g+":"+s.port+r,s.href=s.protocol+"://"+g+(a&&a.port===s.port?"":":"+s.port),s}const dE=typeof ArrayBuffer=="function",hE=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,Kx=Object.prototype.toString,gE=typeof Blob=="function"||typeof Blob<"u"&&Kx.call(Blob)==="[object BlobConstructor]",mE=typeof File=="function"||typeof File<"u"&&Kx.call(File)==="[object FileConstructor]";function V0(e){return dE&&(e instanceof ArrayBuffer||hE(e))||gE&&e instanceof Blob||mE&&e instanceof File}function Bu(e,r){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let a=0,s=e.length;a<s;a++)if(Bu(e[a]))return!0;return!1}if(V0(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Bu(e.toJSON(),!0);for(const a in e)if(Object.prototype.hasOwnProperty.call(e,a)&&Bu(e[a]))return!0;return!1}function pE(e){const r=[],a=e.data,s=e;return s.data=p0(a,r),s.attachments=r.length,{packet:s,buffers:r}}function p0(e,r){if(!e)return e;if(V0(e)){const a={_placeholder:!0,num:r.length};return r.push(e),a}else if(Array.isArray(e)){const a=new Array(e.length);for(let s=0;s<e.length;s++)a[s]=p0(e[s],r);return a}else if(typeof e=="object"&&!(e instanceof Date)){const a={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(a[s]=p0(e[s],r));return a}return e}function xE(e,r){return e.data=x0(e.data,r),delete e.attachments,e}function x0(e,r){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<r.length)return r[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let a=0;a<e.length;a++)e[a]=x0(e[a],r);else if(typeof e=="object")for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(e[a]=x0(e[a],r));return e}const yE=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],vE=5;var mt;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(mt||(mt={}));class wE{constructor(r){this.replacer=r}encode(r){return(r.type===mt.EVENT||r.type===mt.ACK)&&Bu(r)?this.encodeAsBinary({type:r.type===mt.EVENT?mt.BINARY_EVENT:mt.BINARY_ACK,nsp:r.nsp,data:r.data,id:r.id}):[this.encodeAsString(r)]}encodeAsString(r){let a=""+r.type;return(r.type===mt.BINARY_EVENT||r.type===mt.BINARY_ACK)&&(a+=r.attachments+"-"),r.nsp&&r.nsp!=="/"&&(a+=r.nsp+","),r.id!=null&&(a+=r.id),r.data!=null&&(a+=JSON.stringify(r.data,this.replacer)),a}encodeAsBinary(r){const a=pE(r),s=this.encodeAsString(a.packet),f=a.buffers;return f.unshift(s),f}}function Pp(e){return Object.prototype.toString.call(e)==="[object Object]"}class H0 extends Cn{constructor(r){super(),this.reviver=r}add(r){let a;if(typeof r=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");a=this.decodeString(r);const s=a.type===mt.BINARY_EVENT;s||a.type===mt.BINARY_ACK?(a.type=s?mt.EVENT:mt.ACK,this.reconstructor=new bE(a),a.attachments===0&&super.emitReserved("decoded",a)):super.emitReserved("decoded",a)}else if(V0(r)||r.base64)if(this.reconstructor)a=this.reconstructor.takeBinaryData(r),a&&(this.reconstructor=null,super.emitReserved("decoded",a));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+r)}decodeString(r){let a=0;const s={type:Number(r.charAt(0))};if(mt[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===mt.BINARY_EVENT||s.type===mt.BINARY_ACK){const g=a+1;for(;r.charAt(++a)!=="-"&&a!=r.length;);const y=r.substring(g,a);if(y!=Number(y)||r.charAt(a)!=="-")throw new Error("Illegal attachments");s.attachments=Number(y)}if(r.charAt(a+1)==="/"){const g=a+1;for(;++a&&!(r.charAt(a)===","||a===r.length););s.nsp=r.substring(g,a)}else s.nsp="/";const f=r.charAt(a+1);if(f!==""&&Number(f)==f){const g=a+1;for(;++a;){const y=r.charAt(a);if(y==null||Number(y)!=y){--a;break}if(a===r.length)break}s.id=Number(r.substring(g,a+1))}if(r.charAt(++a)){const g=this.tryParse(r.substr(a));if(H0.isPayloadValid(s.type,g))s.data=g;else throw new Error("invalid payload")}return s}tryParse(r){try{return JSON.parse(r,this.reviver)}catch{return!1}}static isPayloadValid(r,a){switch(r){case mt.CONNECT:return Pp(a);case mt.DISCONNECT:return a===void 0;case mt.CONNECT_ERROR:return typeof a=="string"||Pp(a);case mt.EVENT:case mt.BINARY_EVENT:return Array.isArray(a)&&(typeof a[0]=="number"||typeof a[0]=="string"&&yE.indexOf(a[0])===-1);case mt.ACK:case mt.BINARY_ACK:return Array.isArray(a)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class bE{constructor(r){this.packet=r,this.buffers=[],this.reconPack=r}takeBinaryData(r){if(this.buffers.push(r),this.buffers.length===this.reconPack.attachments){const a=xE(this.reconPack,this.buffers);return this.finishedReconstruction(),a}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const _E=Object.freeze(Object.defineProperty({__proto__:null,Decoder:H0,Encoder:wE,get PacketType(){return mt},protocol:vE},Symbol.toStringTag,{value:"Module"}));function ci(e,r,a){return e.on(r,a),function(){e.off(r,a)}}const EE=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class Qx extends Cn{constructor(r,a,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=r,this.nsp=a,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const r=this.io;this.subs=[ci(r,"open",this.onopen.bind(this)),ci(r,"packet",this.onpacket.bind(this)),ci(r,"error",this.onerror.bind(this)),ci(r,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...r){return r.unshift("message"),this.emit.apply(this,r),this}emit(r,...a){var s,f,g;if(EE.hasOwnProperty(r))throw new Error('"'+r.toString()+'" is a reserved event name');if(a.unshift(r),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(a),this;const y={type:mt.EVENT,data:a};if(y.options={},y.options.compress=this.flags.compress!==!1,typeof a[a.length-1]=="function"){const T=this.ids++,x=a.pop();this._registerAckCallback(T,x),y.id=T}const E=(f=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||f===void 0?void 0:f.writable,A=this.connected&&!(!((g=this.io.engine)===null||g===void 0)&&g._hasPingExpired());return this.flags.volatile&&!E||(A?(this.notifyOutgoingListeners(y),this.packet(y)):this.sendBuffer.push(y)),this.flags={},this}_registerAckCallback(r,a){var s;const f=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(f===void 0){this.acks[r]=a;return}const g=this.io.setTimeoutFn(()=>{delete this.acks[r];for(let E=0;E<this.sendBuffer.length;E++)this.sendBuffer[E].id===r&&this.sendBuffer.splice(E,1);a.call(this,new Error("operation has timed out"))},f),y=(...E)=>{this.io.clearTimeoutFn(g),a.apply(this,E)};y.withError=!0,this.acks[r]=y}emitWithAck(r,...a){return new Promise((s,f)=>{const g=(y,E)=>y?f(y):s(E);g.withError=!0,a.push(g),this.emit(r,...a)})}_addToQueue(r){let a;typeof r[r.length-1]=="function"&&(a=r.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:r,flags:Object.assign({fromQueue:!0},this.flags)};r.push((f,...g)=>s!==this._queue[0]?void 0:(f!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),a&&a(f)):(this._queue.shift(),a&&a(null,...g)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(r=!1){if(!this.connected||this._queue.length===0)return;const a=this._queue[0];a.pending&&!r||(a.pending=!0,a.tryCount++,this.flags=a.flags,this.emit.apply(this,a.args))}packet(r){r.nsp=this.nsp,this.io._packet(r)}onopen(){typeof this.auth=="function"?this.auth(r=>{this._sendConnectPacket(r)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(r){this.packet({type:mt.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},r):r})}onerror(r){this.connected||this.emitReserved("connect_error",r)}onclose(r,a){this.connected=!1,delete this.id,this.emitReserved("disconnect",r,a),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(r=>{if(!this.sendBuffer.some(s=>String(s.id)===r)){const s=this.acks[r];delete this.acks[r],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(r){if(r.nsp===this.nsp)switch(r.type){case mt.CONNECT:r.data&&r.data.sid?this.onconnect(r.data.sid,r.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case mt.EVENT:case mt.BINARY_EVENT:this.onevent(r);break;case mt.ACK:case mt.BINARY_ACK:this.onack(r);break;case mt.DISCONNECT:this.ondisconnect();break;case mt.CONNECT_ERROR:this.destroy();const s=new Error(r.data.message);s.data=r.data.data,this.emitReserved("connect_error",s);break}}onevent(r){const a=r.data||[];r.id!=null&&a.push(this.ack(r.id)),this.connected?this.emitEvent(a):this.receiveBuffer.push(Object.freeze(a))}emitEvent(r){if(this._anyListeners&&this._anyListeners.length){const a=this._anyListeners.slice();for(const s of a)s.apply(this,r)}super.emit.apply(this,r),this._pid&&r.length&&typeof r[r.length-1]=="string"&&(this._lastOffset=r[r.length-1])}ack(r){const a=this;let s=!1;return function(...f){s||(s=!0,a.packet({type:mt.ACK,id:r,data:f}))}}onack(r){const a=this.acks[r.id];typeof a=="function"&&(delete this.acks[r.id],a.withError&&r.data.unshift(null),a.apply(this,r.data))}onconnect(r,a){this.id=r,this.recovered=a&&this._pid===a,this._pid=a,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(r=>this.emitEvent(r)),this.receiveBuffer=[],this.sendBuffer.forEach(r=>{this.notifyOutgoingListeners(r),this.packet(r)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(r=>r()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:mt.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(r){return this.flags.compress=r,this}get volatile(){return this.flags.volatile=!0,this}timeout(r){return this.flags.timeout=r,this}onAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(r),this}prependAny(r){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(r),this}offAny(r){if(!this._anyListeners)return this;if(r){const a=this._anyListeners;for(let s=0;s<a.length;s++)if(r===a[s])return a.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(r),this}prependAnyOutgoing(r){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(r),this}offAnyOutgoing(r){if(!this._anyOutgoingListeners)return this;if(r){const a=this._anyOutgoingListeners;for(let s=0;s<a.length;s++)if(r===a[s])return a.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(r){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const a=this._anyOutgoingListeners.slice();for(const s of a)s.apply(this,r.data)}}}function Ms(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Ms.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var r=Math.random(),a=Math.floor(r*this.jitter*e);e=(Math.floor(r*10)&1)==0?e-a:e+a}return Math.min(e,this.max)|0};Ms.prototype.reset=function(){this.attempts=0};Ms.prototype.setMin=function(e){this.ms=e};Ms.prototype.setMax=function(e){this.max=e};Ms.prototype.setJitter=function(e){this.jitter=e};class y0 extends Cn{constructor(r,a){var s;super(),this.nsps={},this.subs=[],r&&typeof r=="object"&&(a=r,r=void 0),a=a||{},a.path=a.path||"/socket.io",this.opts=a,nf(this,a),this.reconnection(a.reconnection!==!1),this.reconnectionAttempts(a.reconnectionAttempts||1/0),this.reconnectionDelay(a.reconnectionDelay||1e3),this.reconnectionDelayMax(a.reconnectionDelayMax||5e3),this.randomizationFactor((s=a.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Ms({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(a.timeout==null?2e4:a.timeout),this._readyState="closed",this.uri=r;const f=a.parser||_E;this.encoder=new f.Encoder,this.decoder=new f.Decoder,this._autoConnect=a.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(r){return arguments.length?(this._reconnection=!!r,r||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(r){return r===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=r,this)}reconnectionDelay(r){var a;return r===void 0?this._reconnectionDelay:(this._reconnectionDelay=r,(a=this.backoff)===null||a===void 0||a.setMin(r),this)}randomizationFactor(r){var a;return r===void 0?this._randomizationFactor:(this._randomizationFactor=r,(a=this.backoff)===null||a===void 0||a.setJitter(r),this)}reconnectionDelayMax(r){var a;return r===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=r,(a=this.backoff)===null||a===void 0||a.setMax(r),this)}timeout(r){return arguments.length?(this._timeout=r,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(r){if(~this._readyState.indexOf("open"))return this;this.engine=new uE(this.uri,this.opts);const a=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const f=ci(a,"open",function(){s.onopen(),r&&r()}),g=E=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",E),r?r(E):this.maybeReconnectOnOpen()},y=ci(a,"error",g);if(this._timeout!==!1){const E=this._timeout,A=this.setTimeoutFn(()=>{f(),g(new Error("timeout")),a.close()},E);this.opts.autoUnref&&A.unref(),this.subs.push(()=>{this.clearTimeoutFn(A)})}return this.subs.push(f),this.subs.push(y),this}connect(r){return this.open(r)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const r=this.engine;this.subs.push(ci(r,"ping",this.onping.bind(this)),ci(r,"data",this.ondata.bind(this)),ci(r,"error",this.onerror.bind(this)),ci(r,"close",this.onclose.bind(this)),ci(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(r){try{this.decoder.add(r)}catch(a){this.onclose("parse error",a)}}ondecoded(r){tf(()=>{this.emitReserved("packet",r)},this.setTimeoutFn)}onerror(r){this.emitReserved("error",r)}socket(r,a){let s=this.nsps[r];return s?this._autoConnect&&!s.active&&s.connect():(s=new Qx(this,r,a),this.nsps[r]=s),s}_destroy(r){const a=Object.keys(this.nsps);for(const s of a)if(this.nsps[s].active)return;this._close()}_packet(r){const a=this.encoder.encode(r);for(let s=0;s<a.length;s++)this.engine.write(a[s],r.options)}cleanup(){this.subs.forEach(r=>r()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(r,a){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",r,a),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const r=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const a=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{r.skipReconnect||(this.emitReserved("reconnect_attempt",r.backoff.attempts),!r.skipReconnect&&r.open(f=>{f?(r._reconnecting=!1,r.reconnect(),this.emitReserved("reconnect_error",f)):r.onreconnect()}))},a);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const r=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",r)}}const Ml={};function ku(e,r){typeof e=="object"&&(r=e,e=void 0),r=r||{};const a=fE(e,r.path||"/socket.io"),s=a.source,f=a.id,g=a.path,y=Ml[f]&&g in Ml[f].nsps,E=r.forceNew||r["force new connection"]||r.multiplex===!1||y;let A;return E?A=new y0(s,r):(Ml[f]||(Ml[f]=new y0(s,r)),A=Ml[f]),a.query&&!r.query&&(r.query=a.queryKey),A.socket(a.path,r)}Object.assign(ku,{Manager:y0,Socket:Qx,io:ku,connect:ku});class AE{constructor(r){Va(this,"sockets",{});Va(this,"serverUrl");this.serverUrl=this.resolveServerUrl(r)}getSocket(r){const a=this.sockets[r];if(a)return a;const s=ku(this.serverUrl,{autoConnect:!1,transports:["websocket"],query:{role:r}});return this.sockets[r]=s,s}disconnect(r){const a=this.sockets[r];a&&a.disconnect()}disconnectAll(){for(const r of Object.keys(this.sockets))this.disconnect(r)}getServerUrl(){return this.serverUrl}resolveServerUrl(r){if(r)return this.normalizeOrigin(r);if(typeof window<"u"){const a=new URL(window.location.href);return a.port=String(Fl),a.origin}return`http://localhost:${Fl}`}normalizeOrigin(r){return r.includes("://")?r:`http://${r}`}}var Fu={};const Jx=L.createContext(null),$x=()=>{try{const e=import.meta;if(e&&typeof e.env=="object")return e.env}catch{}},CE=()=>{const e=$x();if(e!=null&&e.VITE_AIR_JAM_SERVER_URL)return e.VITE_AIR_JAM_SERVER_URL;if(typeof process<"u"&&Fu){const r=Fu.NEXT_PUBLIC_AIR_JAM_SERVER_URL;if(r)return r}},SE=()=>{const e=$x();if(e!=null&&e.VITE_AIR_JAM_API_KEY)return e.VITE_AIR_JAM_API_KEY;if(typeof process<"u"&&Fu){const r=Fu.NEXT_PUBLIC_AIR_JAM_API_KEY;if(r)return r}},TE=({children:e,serverUrl:r,apiKey:a,maxPlayers:s=R3,publicHost:f,input:g})=>{const y=L.useMemo(()=>({serverUrl:r??CE(),apiKey:a??SE(),maxPlayers:s,publicHost:f}),[r,a,s,f]),E=L.useMemo(()=>g?new N3(g):null,[g]),A=L.useMemo(()=>O3(),[]),b=L.useMemo(()=>new AE(y.serverUrl),[y.serverUrl]);L.useEffect(()=>()=>{b.disconnectAll()},[b]);const T=L.useCallback(R=>b.getSocket(R),[b]),x=L.useCallback(R=>b.disconnect(R),[b]),S=L.useMemo(()=>({config:y,store:A,socketManager:b,getSocket:T,disconnectSocket:x,inputManager:E}),[y,A,b,T,x,E]);return F.jsx(Jx.Provider,{value:S,children:e})},ql=()=>{const e=L.useContext(Jx);if(!e)throw new Error("useAirJamContext must be used within an AirJamProvider. Wrap your app or component tree with <AirJamProvider>.");return e},wh=e=>{const{store:r}=ql();return Ao(r,ef(e))};var bh={};/*!
61
- * howler.js v2.2.4
62
- * howlerjs.com
63
- *
64
- * (c) 2013-2020, James Simpson of GoldFire Studios
65
- * goldfirestudios.com
66
- *
67
- * MIT License
68
- */var zp;function RE(){return zp||(zp=1,(function(e){(function(){var r=function(){this.init()};r.prototype={init:function(){var x=this||a;return x._counter=1e3,x._html5AudioPool=[],x.html5PoolSize=10,x._codecs={},x._howls=[],x._muted=!1,x._volume=1,x._canPlayEvent="canplaythrough",x._navigator=typeof window<"u"&&window.navigator?window.navigator:null,x.masterGain=null,x.noAudio=!1,x.usingWebAudio=!0,x.autoSuspend=!0,x.ctx=null,x.autoUnlock=!0,x._setup(),x},volume:function(x){var S=this||a;if(x=parseFloat(x),S.ctx||T(),typeof x<"u"&&x>=0&&x<=1){if(S._volume=x,S._muted)return S;S.usingWebAudio&&S.masterGain.gain.setValueAtTime(x,a.ctx.currentTime);for(var R=0;R<S._howls.length;R++)if(!S._howls[R]._webAudio)for(var I=S._howls[R]._getSoundIds(),B=0;B<I.length;B++){var P=S._howls[R]._soundById(I[B]);P&&P._node&&(P._node.volume=P._volume*x)}return S}return S._volume},mute:function(x){var S=this||a;S.ctx||T(),S._muted=x,S.usingWebAudio&&S.masterGain.gain.setValueAtTime(x?0:S._volume,a.ctx.currentTime);for(var R=0;R<S._howls.length;R++)if(!S._howls[R]._webAudio)for(var I=S._howls[R]._getSoundIds(),B=0;B<I.length;B++){var P=S._howls[R]._soundById(I[B]);P&&P._node&&(P._node.muted=x?!0:P._muted)}return S},stop:function(){for(var x=this||a,S=0;S<x._howls.length;S++)x._howls[S].stop();return x},unload:function(){for(var x=this||a,S=x._howls.length-1;S>=0;S--)x._howls[S].unload();return x.usingWebAudio&&x.ctx&&typeof x.ctx.close<"u"&&(x.ctx.close(),x.ctx=null,T()),x},codecs:function(x){return(this||a)._codecs[x.replace(/^x-/,"")]},_setup:function(){var x=this||a;if(x.state=x.ctx&&x.ctx.state||"suspended",x._autoSuspend(),!x.usingWebAudio)if(typeof Audio<"u")try{var S=new Audio;typeof S.oncanplaythrough>"u"&&(x._canPlayEvent="canplay")}catch{x.noAudio=!0}else x.noAudio=!0;try{var S=new Audio;S.muted&&(x.noAudio=!0)}catch{}return x.noAudio||x._setupCodecs(),x},_setupCodecs:function(){var x=this||a,S=null;try{S=typeof Audio<"u"?new Audio:null}catch{return x}if(!S||typeof S.canPlayType!="function")return x;var R=S.canPlayType("audio/mpeg;").replace(/^no$/,""),I=x._navigator?x._navigator.userAgent:"",B=I.match(/OPR\/(\d+)/g),P=B&&parseInt(B[0].split("/")[1],10)<33,k=I.indexOf("Safari")!==-1&&I.indexOf("Chrome")===-1,Z=I.match(/Version\/(.*?) /),j=k&&Z&&parseInt(Z[1],10)<15;return x._codecs={mp3:!!(!P&&(R||S.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!R,opus:!!S.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!S.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!S.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(S.canPlayType('audio/wav; codecs="1"')||S.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!S.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!S.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(S.canPlayType("audio/x-m4a;")||S.canPlayType("audio/m4a;")||S.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(S.canPlayType("audio/x-m4b;")||S.canPlayType("audio/m4b;")||S.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(S.canPlayType("audio/x-mp4;")||S.canPlayType("audio/mp4;")||S.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!j&&S.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!j&&S.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!S.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(S.canPlayType("audio/x-flac;")||S.canPlayType("audio/flac;")).replace(/^no$/,"")},x},_unlockAudio:function(){var x=this||a;if(!(x._audioUnlocked||!x.ctx)){x._audioUnlocked=!1,x.autoUnlock=!1,!x._mobileUnloaded&&x.ctx.sampleRate!==44100&&(x._mobileUnloaded=!0,x.unload()),x._scratchBuffer=x.ctx.createBuffer(1,1,22050);var S=function(R){for(;x._html5AudioPool.length<x.html5PoolSize;)try{var I=new Audio;I._unlocked=!0,x._releaseHtml5Audio(I)}catch{x.noAudio=!0;break}for(var B=0;B<x._howls.length;B++)if(!x._howls[B]._webAudio)for(var P=x._howls[B]._getSoundIds(),k=0;k<P.length;k++){var Z=x._howls[B]._soundById(P[k]);Z&&Z._node&&!Z._node._unlocked&&(Z._node._unlocked=!0,Z._node.load())}x._autoResume();var j=x.ctx.createBufferSource();j.buffer=x._scratchBuffer,j.connect(x.ctx.destination),typeof j.start>"u"?j.noteOn(0):j.start(0),typeof x.ctx.resume=="function"&&x.ctx.resume(),j.onended=function(){j.disconnect(0),x._audioUnlocked=!0,document.removeEventListener("touchstart",S,!0),document.removeEventListener("touchend",S,!0),document.removeEventListener("click",S,!0),document.removeEventListener("keydown",S,!0);for(var H=0;H<x._howls.length;H++)x._howls[H]._emit("unlock")}};return document.addEventListener("touchstart",S,!0),document.addEventListener("touchend",S,!0),document.addEventListener("click",S,!0),document.addEventListener("keydown",S,!0),x}},_obtainHtml5Audio:function(){var x=this||a;if(x._html5AudioPool.length)return x._html5AudioPool.pop();var S=new Audio().play();return S&&typeof Promise<"u"&&(S instanceof Promise||typeof S.then=="function")&&S.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(x){var S=this||a;return x._unlocked&&S._html5AudioPool.push(x),S},_autoSuspend:function(){var x=this;if(!(!x.autoSuspend||!x.ctx||typeof x.ctx.suspend>"u"||!a.usingWebAudio)){for(var S=0;S<x._howls.length;S++)if(x._howls[S]._webAudio){for(var R=0;R<x._howls[S]._sounds.length;R++)if(!x._howls[S]._sounds[R]._paused)return x}return x._suspendTimer&&clearTimeout(x._suspendTimer),x._suspendTimer=setTimeout(function(){if(x.autoSuspend){x._suspendTimer=null,x.state="suspending";var I=function(){x.state="suspended",x._resumeAfterSuspend&&(delete x._resumeAfterSuspend,x._autoResume())};x.ctx.suspend().then(I,I)}},3e4),x}},_autoResume:function(){var x=this;if(!(!x.ctx||typeof x.ctx.resume>"u"||!a.usingWebAudio))return x.state==="running"&&x.ctx.state!=="interrupted"&&x._suspendTimer?(clearTimeout(x._suspendTimer),x._suspendTimer=null):x.state==="suspended"||x.state==="running"&&x.ctx.state==="interrupted"?(x.ctx.resume().then(function(){x.state="running";for(var S=0;S<x._howls.length;S++)x._howls[S]._emit("resume")}),x._suspendTimer&&(clearTimeout(x._suspendTimer),x._suspendTimer=null)):x.state==="suspending"&&(x._resumeAfterSuspend=!0),x}};var a=new r,s=function(x){var S=this;if(!x.src||x.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}S.init(x)};s.prototype={init:function(x){var S=this;return a.ctx||T(),S._autoplay=x.autoplay||!1,S._format=typeof x.format!="string"?x.format:[x.format],S._html5=x.html5||!1,S._muted=x.mute||!1,S._loop=x.loop||!1,S._pool=x.pool||5,S._preload=typeof x.preload=="boolean"||x.preload==="metadata"?x.preload:!0,S._rate=x.rate||1,S._sprite=x.sprite||{},S._src=typeof x.src!="string"?x.src:[x.src],S._volume=x.volume!==void 0?x.volume:1,S._xhr={method:x.xhr&&x.xhr.method?x.xhr.method:"GET",headers:x.xhr&&x.xhr.headers?x.xhr.headers:null,withCredentials:x.xhr&&x.xhr.withCredentials?x.xhr.withCredentials:!1},S._duration=0,S._state="unloaded",S._sounds=[],S._endTimers={},S._queue=[],S._playLock=!1,S._onend=x.onend?[{fn:x.onend}]:[],S._onfade=x.onfade?[{fn:x.onfade}]:[],S._onload=x.onload?[{fn:x.onload}]:[],S._onloaderror=x.onloaderror?[{fn:x.onloaderror}]:[],S._onplayerror=x.onplayerror?[{fn:x.onplayerror}]:[],S._onpause=x.onpause?[{fn:x.onpause}]:[],S._onplay=x.onplay?[{fn:x.onplay}]:[],S._onstop=x.onstop?[{fn:x.onstop}]:[],S._onmute=x.onmute?[{fn:x.onmute}]:[],S._onvolume=x.onvolume?[{fn:x.onvolume}]:[],S._onrate=x.onrate?[{fn:x.onrate}]:[],S._onseek=x.onseek?[{fn:x.onseek}]:[],S._onunlock=x.onunlock?[{fn:x.onunlock}]:[],S._onresume=[],S._webAudio=a.usingWebAudio&&!S._html5,typeof a.ctx<"u"&&a.ctx&&a.autoUnlock&&a._unlockAudio(),a._howls.push(S),S._autoplay&&S._queue.push({event:"play",action:function(){S.play()}}),S._preload&&S._preload!=="none"&&S.load(),S},load:function(){var x=this,S=null;if(a.noAudio){x._emit("loaderror",null,"No audio support.");return}typeof x._src=="string"&&(x._src=[x._src]);for(var R=0;R<x._src.length;R++){var I,B;if(x._format&&x._format[R])I=x._format[R];else{if(B=x._src[R],typeof B!="string"){x._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}I=/^data:audio\/([^;,]+);/i.exec(B),I||(I=/\.([^.]+)$/.exec(B.split("?",1)[0])),I&&(I=I[1].toLowerCase())}if(I||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),I&&a.codecs(I)){S=x._src[R];break}}if(!S){x._emit("loaderror",null,"No codec support for selected audio sources.");return}return x._src=S,x._state="loading",window.location.protocol==="https:"&&S.slice(0,5)==="http:"&&(x._html5=!0,x._webAudio=!1),new f(x),x._webAudio&&y(x),x},play:function(x,S){var R=this,I=null;if(typeof x=="number")I=x,x=null;else{if(typeof x=="string"&&R._state==="loaded"&&!R._sprite[x])return null;if(typeof x>"u"&&(x="__default",!R._playLock)){for(var B=0,P=0;P<R._sounds.length;P++)R._sounds[P]._paused&&!R._sounds[P]._ended&&(B++,I=R._sounds[P]._id);B===1?x=null:I=null}}var k=I?R._soundById(I):R._inactiveSound();if(!k)return null;if(I&&!x&&(x=k._sprite||"__default"),R._state!=="loaded"){k._sprite=x,k._ended=!1;var Z=k._id;return R._queue.push({event:"play",action:function(){R.play(Z)}}),Z}if(I&&!k._paused)return S||R._loadQueue("play"),k._id;R._webAudio&&a._autoResume();var j=Math.max(0,k._seek>0?k._seek:R._sprite[x][0]/1e3),H=Math.max(0,(R._sprite[x][0]+R._sprite[x][1])/1e3-j),ee=H*1e3/Math.abs(k._rate),Q=R._sprite[x][0]/1e3,X=(R._sprite[x][0]+R._sprite[x][1])/1e3;k._sprite=x,k._ended=!1;var de=function(){k._paused=!1,k._seek=j,k._start=Q,k._stop=X,k._loop=!!(k._loop||R._sprite[x][2])};if(j>=X){R._ended(k);return}var Y=k._node;if(R._webAudio){var we=function(){R._playLock=!1,de(),R._refreshBuffer(k);var Te=k._muted||R._muted?0:k._volume;Y.gain.setValueAtTime(Te,a.ctx.currentTime),k._playStart=a.ctx.currentTime,typeof Y.bufferSource.start>"u"?k._loop?Y.bufferSource.noteGrainOn(0,j,86400):Y.bufferSource.noteGrainOn(0,j,H):k._loop?Y.bufferSource.start(0,j,86400):Y.bufferSource.start(0,j,H),ee!==1/0&&(R._endTimers[k._id]=setTimeout(R._ended.bind(R,k),ee)),S||setTimeout(function(){R._emit("play",k._id),R._loadQueue()},0)};a.state==="running"&&a.ctx.state!=="interrupted"?we():(R._playLock=!0,R.once("resume",we),R._clearTimer(k._id))}else{var le=function(){Y.currentTime=j,Y.muted=k._muted||R._muted||a._muted||Y.muted,Y.volume=k._volume*a.volume(),Y.playbackRate=k._rate;try{var Te=Y.play();if(Te&&typeof Promise<"u"&&(Te instanceof Promise||typeof Te.then=="function")?(R._playLock=!0,de(),Te.then(function(){R._playLock=!1,Y._unlocked=!0,S?R._loadQueue():R._emit("play",k._id)}).catch(function(){R._playLock=!1,R._emit("playerror",k._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),k._ended=!0,k._paused=!0})):S||(R._playLock=!1,de(),R._emit("play",k._id)),Y.playbackRate=k._rate,Y.paused){R._emit("playerror",k._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}x!=="__default"||k._loop?R._endTimers[k._id]=setTimeout(R._ended.bind(R,k),ee):(R._endTimers[k._id]=function(){R._ended(k),Y.removeEventListener("ended",R._endTimers[k._id],!1)},Y.addEventListener("ended",R._endTimers[k._id],!1))}catch(ie){R._emit("playerror",k._id,ie)}};Y.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(Y.src=R._src,Y.load());var te=window&&window.ejecta||!Y.readyState&&a._navigator.isCocoonJS;if(Y.readyState>=3||te)le();else{R._playLock=!0,R._state="loading";var pe=function(){R._state="loaded",le(),Y.removeEventListener(a._canPlayEvent,pe,!1)};Y.addEventListener(a._canPlayEvent,pe,!1),R._clearTimer(k._id)}}return k._id},pause:function(x){var S=this;if(S._state!=="loaded"||S._playLock)return S._queue.push({event:"pause",action:function(){S.pause(x)}}),S;for(var R=S._getSoundIds(x),I=0;I<R.length;I++){S._clearTimer(R[I]);var B=S._soundById(R[I]);if(B&&!B._paused&&(B._seek=S.seek(R[I]),B._rateSeek=0,B._paused=!0,S._stopFade(R[I]),B._node))if(S._webAudio){if(!B._node.bufferSource)continue;typeof B._node.bufferSource.stop>"u"?B._node.bufferSource.noteOff(0):B._node.bufferSource.stop(0),S._cleanBuffer(B._node)}else(!isNaN(B._node.duration)||B._node.duration===1/0)&&B._node.pause();arguments[1]||S._emit("pause",B?B._id:null)}return S},stop:function(x,S){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"stop",action:function(){R.stop(x)}}),R;for(var I=R._getSoundIds(x),B=0;B<I.length;B++){R._clearTimer(I[B]);var P=R._soundById(I[B]);P&&(P._seek=P._start||0,P._rateSeek=0,P._paused=!0,P._ended=!0,R._stopFade(I[B]),P._node&&(R._webAudio?P._node.bufferSource&&(typeof P._node.bufferSource.stop>"u"?P._node.bufferSource.noteOff(0):P._node.bufferSource.stop(0),R._cleanBuffer(P._node)):(!isNaN(P._node.duration)||P._node.duration===1/0)&&(P._node.currentTime=P._start||0,P._node.pause(),P._node.duration===1/0&&R._clearSound(P._node))),S||R._emit("stop",P._id))}return R},mute:function(x,S){var R=this;if(R._state!=="loaded"||R._playLock)return R._queue.push({event:"mute",action:function(){R.mute(x,S)}}),R;if(typeof S>"u")if(typeof x=="boolean")R._muted=x;else return R._muted;for(var I=R._getSoundIds(S),B=0;B<I.length;B++){var P=R._soundById(I[B]);P&&(P._muted=x,P._interval&&R._stopFade(P._id),R._webAudio&&P._node?P._node.gain.setValueAtTime(x?0:P._volume,a.ctx.currentTime):P._node&&(P._node.muted=a._muted?!0:x),R._emit("mute",P._id))}return R},volume:function(){var x=this,S=arguments,R,I;if(S.length===0)return x._volume;if(S.length===1||S.length===2&&typeof S[1]>"u"){var B=x._getSoundIds(),P=B.indexOf(S[0]);P>=0?I=parseInt(S[0],10):R=parseFloat(S[0])}else S.length>=2&&(R=parseFloat(S[0]),I=parseInt(S[1],10));var k;if(typeof R<"u"&&R>=0&&R<=1){if(x._state!=="loaded"||x._playLock)return x._queue.push({event:"volume",action:function(){x.volume.apply(x,S)}}),x;typeof I>"u"&&(x._volume=R),I=x._getSoundIds(I);for(var Z=0;Z<I.length;Z++)k=x._soundById(I[Z]),k&&(k._volume=R,S[2]||x._stopFade(I[Z]),x._webAudio&&k._node&&!k._muted?k._node.gain.setValueAtTime(R,a.ctx.currentTime):k._node&&!k._muted&&(k._node.volume=R*a.volume()),x._emit("volume",k._id))}else return k=I?x._soundById(I):x._sounds[0],k?k._volume:0;return x},fade:function(x,S,R,I){var B=this;if(B._state!=="loaded"||B._playLock)return B._queue.push({event:"fade",action:function(){B.fade(x,S,R,I)}}),B;x=Math.min(Math.max(0,parseFloat(x)),1),S=Math.min(Math.max(0,parseFloat(S)),1),R=parseFloat(R),B.volume(x,I);for(var P=B._getSoundIds(I),k=0;k<P.length;k++){var Z=B._soundById(P[k]);if(Z){if(I||B._stopFade(P[k]),B._webAudio&&!Z._muted){var j=a.ctx.currentTime,H=j+R/1e3;Z._volume=x,Z._node.gain.setValueAtTime(x,j),Z._node.gain.linearRampToValueAtTime(S,H)}B._startFadeInterval(Z,x,S,R,P[k],typeof I>"u")}}return B},_startFadeInterval:function(x,S,R,I,B,P){var k=this,Z=S,j=R-S,H=Math.abs(j/.01),ee=Math.max(4,H>0?I/H:I),Q=Date.now();x._fadeTo=R,x._interval=setInterval(function(){var X=(Date.now()-Q)/I;Q=Date.now(),Z+=j*X,Z=Math.round(Z*100)/100,j<0?Z=Math.max(R,Z):Z=Math.min(R,Z),k._webAudio?x._volume=Z:k.volume(Z,x._id,!0),P&&(k._volume=Z),(R<S&&Z<=R||R>S&&Z>=R)&&(clearInterval(x._interval),x._interval=null,x._fadeTo=null,k.volume(R,x._id),k._emit("fade",x._id))},ee)},_stopFade:function(x){var S=this,R=S._soundById(x);return R&&R._interval&&(S._webAudio&&R._node.gain.cancelScheduledValues(a.ctx.currentTime),clearInterval(R._interval),R._interval=null,S.volume(R._fadeTo,x),R._fadeTo=null,S._emit("fade",x)),S},loop:function(){var x=this,S=arguments,R,I,B;if(S.length===0)return x._loop;if(S.length===1)if(typeof S[0]=="boolean")R=S[0],x._loop=R;else return B=x._soundById(parseInt(S[0],10)),B?B._loop:!1;else S.length===2&&(R=S[0],I=parseInt(S[1],10));for(var P=x._getSoundIds(I),k=0;k<P.length;k++)B=x._soundById(P[k]),B&&(B._loop=R,x._webAudio&&B._node&&B._node.bufferSource&&(B._node.bufferSource.loop=R,R&&(B._node.bufferSource.loopStart=B._start||0,B._node.bufferSource.loopEnd=B._stop,x.playing(P[k])&&(x.pause(P[k],!0),x.play(P[k],!0)))));return x},rate:function(){var x=this,S=arguments,R,I;if(S.length===0)I=x._sounds[0]._id;else if(S.length===1){var B=x._getSoundIds(),P=B.indexOf(S[0]);P>=0?I=parseInt(S[0],10):R=parseFloat(S[0])}else S.length===2&&(R=parseFloat(S[0]),I=parseInt(S[1],10));var k;if(typeof R=="number"){if(x._state!=="loaded"||x._playLock)return x._queue.push({event:"rate",action:function(){x.rate.apply(x,S)}}),x;typeof I>"u"&&(x._rate=R),I=x._getSoundIds(I);for(var Z=0;Z<I.length;Z++)if(k=x._soundById(I[Z]),k){x.playing(I[Z])&&(k._rateSeek=x.seek(I[Z]),k._playStart=x._webAudio?a.ctx.currentTime:k._playStart),k._rate=R,x._webAudio&&k._node&&k._node.bufferSource?k._node.bufferSource.playbackRate.setValueAtTime(R,a.ctx.currentTime):k._node&&(k._node.playbackRate=R);var j=x.seek(I[Z]),H=(x._sprite[k._sprite][0]+x._sprite[k._sprite][1])/1e3-j,ee=H*1e3/Math.abs(k._rate);(x._endTimers[I[Z]]||!k._paused)&&(x._clearTimer(I[Z]),x._endTimers[I[Z]]=setTimeout(x._ended.bind(x,k),ee)),x._emit("rate",k._id)}}else return k=x._soundById(I),k?k._rate:x._rate;return x},seek:function(){var x=this,S=arguments,R,I;if(S.length===0)x._sounds.length&&(I=x._sounds[0]._id);else if(S.length===1){var B=x._getSoundIds(),P=B.indexOf(S[0]);P>=0?I=parseInt(S[0],10):x._sounds.length&&(I=x._sounds[0]._id,R=parseFloat(S[0]))}else S.length===2&&(R=parseFloat(S[0]),I=parseInt(S[1],10));if(typeof I>"u")return 0;if(typeof R=="number"&&(x._state!=="loaded"||x._playLock))return x._queue.push({event:"seek",action:function(){x.seek.apply(x,S)}}),x;var k=x._soundById(I);if(k)if(typeof R=="number"&&R>=0){var Z=x.playing(I);Z&&x.pause(I,!0),k._seek=R,k._ended=!1,x._clearTimer(I),!x._webAudio&&k._node&&!isNaN(k._node.duration)&&(k._node.currentTime=R);var j=function(){Z&&x.play(I,!0),x._emit("seek",I)};if(Z&&!x._webAudio){var H=function(){x._playLock?setTimeout(H,0):j()};setTimeout(H,0)}else j()}else if(x._webAudio){var ee=x.playing(I)?a.ctx.currentTime-k._playStart:0,Q=k._rateSeek?k._rateSeek-k._seek:0;return k._seek+(Q+ee*Math.abs(k._rate))}else return k._node.currentTime;return x},playing:function(x){var S=this;if(typeof x=="number"){var R=S._soundById(x);return R?!R._paused:!1}for(var I=0;I<S._sounds.length;I++)if(!S._sounds[I]._paused)return!0;return!1},duration:function(x){var S=this,R=S._duration,I=S._soundById(x);return I&&(R=S._sprite[I._sprite][1]/1e3),R},state:function(){return this._state},unload:function(){for(var x=this,S=x._sounds,R=0;R<S.length;R++)S[R]._paused||x.stop(S[R]._id),x._webAudio||(x._clearSound(S[R]._node),S[R]._node.removeEventListener("error",S[R]._errorFn,!1),S[R]._node.removeEventListener(a._canPlayEvent,S[R]._loadFn,!1),S[R]._node.removeEventListener("ended",S[R]._endFn,!1),a._releaseHtml5Audio(S[R]._node)),delete S[R]._node,x._clearTimer(S[R]._id);var I=a._howls.indexOf(x);I>=0&&a._howls.splice(I,1);var B=!0;for(R=0;R<a._howls.length;R++)if(a._howls[R]._src===x._src||x._src.indexOf(a._howls[R]._src)>=0){B=!1;break}return g&&B&&delete g[x._src],a.noAudio=!1,x._state="unloaded",x._sounds=[],x=null,null},on:function(x,S,R,I){var B=this,P=B["_on"+x];return typeof S=="function"&&P.push(I?{id:R,fn:S,once:I}:{id:R,fn:S}),B},off:function(x,S,R){var I=this,B=I["_on"+x],P=0;if(typeof S=="number"&&(R=S,S=null),S||R)for(P=0;P<B.length;P++){var k=R===B[P].id;if(S===B[P].fn&&k||!S&&k){B.splice(P,1);break}}else if(x)I["_on"+x]=[];else{var Z=Object.keys(I);for(P=0;P<Z.length;P++)Z[P].indexOf("_on")===0&&Array.isArray(I[Z[P]])&&(I[Z[P]]=[])}return I},once:function(x,S,R){var I=this;return I.on(x,S,R,1),I},_emit:function(x,S,R){for(var I=this,B=I["_on"+x],P=B.length-1;P>=0;P--)(!B[P].id||B[P].id===S||x==="load")&&(setTimeout((function(k){k.call(this,S,R)}).bind(I,B[P].fn),0),B[P].once&&I.off(x,B[P].fn,B[P].id));return I._loadQueue(x),I},_loadQueue:function(x){var S=this;if(S._queue.length>0){var R=S._queue[0];R.event===x&&(S._queue.shift(),S._loadQueue()),x||R.action()}return S},_ended:function(x){var S=this,R=x._sprite;if(!S._webAudio&&x._node&&!x._node.paused&&!x._node.ended&&x._node.currentTime<x._stop)return setTimeout(S._ended.bind(S,x),100),S;var I=!!(x._loop||S._sprite[R][2]);if(S._emit("end",x._id),!S._webAudio&&I&&S.stop(x._id,!0).play(x._id),S._webAudio&&I){S._emit("play",x._id),x._seek=x._start||0,x._rateSeek=0,x._playStart=a.ctx.currentTime;var B=(x._stop-x._start)*1e3/Math.abs(x._rate);S._endTimers[x._id]=setTimeout(S._ended.bind(S,x),B)}return S._webAudio&&!I&&(x._paused=!0,x._ended=!0,x._seek=x._start||0,x._rateSeek=0,S._clearTimer(x._id),S._cleanBuffer(x._node),a._autoSuspend()),!S._webAudio&&!I&&S.stop(x._id,!0),S},_clearTimer:function(x){var S=this;if(S._endTimers[x]){if(typeof S._endTimers[x]!="function")clearTimeout(S._endTimers[x]);else{var R=S._soundById(x);R&&R._node&&R._node.removeEventListener("ended",S._endTimers[x],!1)}delete S._endTimers[x]}return S},_soundById:function(x){for(var S=this,R=0;R<S._sounds.length;R++)if(x===S._sounds[R]._id)return S._sounds[R];return null},_inactiveSound:function(){var x=this;x._drain();for(var S=0;S<x._sounds.length;S++)if(x._sounds[S]._ended)return x._sounds[S].reset();return new f(x)},_drain:function(){var x=this,S=x._pool,R=0,I=0;if(!(x._sounds.length<S)){for(I=0;I<x._sounds.length;I++)x._sounds[I]._ended&&R++;for(I=x._sounds.length-1;I>=0;I--){if(R<=S)return;x._sounds[I]._ended&&(x._webAudio&&x._sounds[I]._node&&x._sounds[I]._node.disconnect(0),x._sounds.splice(I,1),R--)}}},_getSoundIds:function(x){var S=this;if(typeof x>"u"){for(var R=[],I=0;I<S._sounds.length;I++)R.push(S._sounds[I]._id);return R}else return[x]},_refreshBuffer:function(x){var S=this;return x._node.bufferSource=a.ctx.createBufferSource(),x._node.bufferSource.buffer=g[S._src],x._panner?x._node.bufferSource.connect(x._panner):x._node.bufferSource.connect(x._node),x._node.bufferSource.loop=x._loop,x._loop&&(x._node.bufferSource.loopStart=x._start||0,x._node.bufferSource.loopEnd=x._stop||0),x._node.bufferSource.playbackRate.setValueAtTime(x._rate,a.ctx.currentTime),S},_cleanBuffer:function(x){var S=this,R=a._navigator&&a._navigator.vendor.indexOf("Apple")>=0;if(!x.bufferSource)return S;if(a._scratchBuffer&&x.bufferSource&&(x.bufferSource.onended=null,x.bufferSource.disconnect(0),R))try{x.bufferSource.buffer=a._scratchBuffer}catch{}return x.bufferSource=null,S},_clearSound:function(x){var S=/MSIE |Trident\//.test(a._navigator&&a._navigator.userAgent);S||(x.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var f=function(x){this._parent=x,this.init()};f.prototype={init:function(){var x=this,S=x._parent;return x._muted=S._muted,x._loop=S._loop,x._volume=S._volume,x._rate=S._rate,x._seek=0,x._paused=!0,x._ended=!0,x._sprite="__default",x._id=++a._counter,S._sounds.push(x),x.create(),x},create:function(){var x=this,S=x._parent,R=a._muted||x._muted||x._parent._muted?0:x._volume;return S._webAudio?(x._node=typeof a.ctx.createGain>"u"?a.ctx.createGainNode():a.ctx.createGain(),x._node.gain.setValueAtTime(R,a.ctx.currentTime),x._node.paused=!0,x._node.connect(a.masterGain)):a.noAudio||(x._node=a._obtainHtml5Audio(),x._errorFn=x._errorListener.bind(x),x._node.addEventListener("error",x._errorFn,!1),x._loadFn=x._loadListener.bind(x),x._node.addEventListener(a._canPlayEvent,x._loadFn,!1),x._endFn=x._endListener.bind(x),x._node.addEventListener("ended",x._endFn,!1),x._node.src=S._src,x._node.preload=S._preload===!0?"auto":S._preload,x._node.volume=R*a.volume(),x._node.load()),x},reset:function(){var x=this,S=x._parent;return x._muted=S._muted,x._loop=S._loop,x._volume=S._volume,x._rate=S._rate,x._seek=0,x._rateSeek=0,x._paused=!0,x._ended=!0,x._sprite="__default",x._id=++a._counter,x},_errorListener:function(){var x=this;x._parent._emit("loaderror",x._id,x._node.error?x._node.error.code:0),x._node.removeEventListener("error",x._errorFn,!1)},_loadListener:function(){var x=this,S=x._parent;S._duration=Math.ceil(x._node.duration*10)/10,Object.keys(S._sprite).length===0&&(S._sprite={__default:[0,S._duration*1e3]}),S._state!=="loaded"&&(S._state="loaded",S._emit("load"),S._loadQueue()),x._node.removeEventListener(a._canPlayEvent,x._loadFn,!1)},_endListener:function(){var x=this,S=x._parent;S._duration===1/0&&(S._duration=Math.ceil(x._node.duration*10)/10,S._sprite.__default[1]===1/0&&(S._sprite.__default[1]=S._duration*1e3),S._ended(x)),x._node.removeEventListener("ended",x._endFn,!1)}};var g={},y=function(x){var S=x._src;if(g[S]){x._duration=g[S].duration,b(x);return}if(/^data:[^;]+;base64,/.test(S)){for(var R=atob(S.split(",")[1]),I=new Uint8Array(R.length),B=0;B<R.length;++B)I[B]=R.charCodeAt(B);A(I.buffer,x)}else{var P=new XMLHttpRequest;P.open(x._xhr.method,S,!0),P.withCredentials=x._xhr.withCredentials,P.responseType="arraybuffer",x._xhr.headers&&Object.keys(x._xhr.headers).forEach(function(k){P.setRequestHeader(k,x._xhr.headers[k])}),P.onload=function(){var k=(P.status+"")[0];if(k!=="0"&&k!=="2"&&k!=="3"){x._emit("loaderror",null,"Failed loading audio file with status: "+P.status+".");return}A(P.response,x)},P.onerror=function(){x._webAudio&&(x._html5=!0,x._webAudio=!1,x._sounds=[],delete g[S],x.load())},E(P)}},E=function(x){try{x.send()}catch{x.onerror()}},A=function(x,S){var R=function(){S._emit("loaderror",null,"Decoding audio data failed.")},I=function(B){B&&S._sounds.length>0?(g[S._src]=B,b(S,B)):R()};typeof Promise<"u"&&a.ctx.decodeAudioData.length===1?a.ctx.decodeAudioData(x).then(I).catch(R):a.ctx.decodeAudioData(x,I,R)},b=function(x,S){S&&!x._duration&&(x._duration=S.duration),Object.keys(x._sprite).length===0&&(x._sprite={__default:[0,x._duration*1e3]}),x._state!=="loaded"&&(x._state="loaded",x._emit("load"),x._loadQueue())},T=function(){if(a.usingWebAudio){try{typeof AudioContext<"u"?a.ctx=new AudioContext:typeof webkitAudioContext<"u"?a.ctx=new webkitAudioContext:a.usingWebAudio=!1}catch{a.usingWebAudio=!1}a.ctx||(a.usingWebAudio=!1);var x=/iP(hone|od|ad)/.test(a._navigator&&a._navigator.platform),S=a._navigator&&a._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),R=S?parseInt(S[1],10):null;if(x&&R&&R<9){var I=/safari/.test(a._navigator&&a._navigator.userAgent.toLowerCase());a._navigator&&!I&&(a.usingWebAudio=!1)}a.usingWebAudio&&(a.masterGain=typeof a.ctx.createGain>"u"?a.ctx.createGainNode():a.ctx.createGain(),a.masterGain.gain.setValueAtTime(a._muted?0:a._volume,a.ctx.currentTime),a.masterGain.connect(a.ctx.destination)),a._setup()}};e.Howler=a,e.Howl=s,typeof ea<"u"?(ea.HowlerGlobal=r,ea.Howler=a,ea.Howl=s,ea.Sound=f):typeof window<"u"&&(window.HowlerGlobal=r,window.Howler=a,window.Howl=s,window.Sound=f)})();/*!
69
- * Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
70
- *
71
- * howler.js v2.2.4
72
- * howlerjs.com
73
- *
74
- * (c) 2013-2020, James Simpson of GoldFire Studios
75
- * goldfirestudios.com
76
- *
77
- * MIT License
78
- */(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(a){var s=this;if(!s.ctx||!s.ctx.listener)return s;for(var f=s._howls.length-1;f>=0;f--)s._howls[f].stereo(a);return s},HowlerGlobal.prototype.pos=function(a,s,f){var g=this;if(!g.ctx||!g.ctx.listener)return g;if(s=typeof s!="number"?g._pos[1]:s,f=typeof f!="number"?g._pos[2]:f,typeof a=="number")g._pos=[a,s,f],typeof g.ctx.listener.positionX<"u"?(g.ctx.listener.positionX.setTargetAtTime(g._pos[0],Howler.ctx.currentTime,.1),g.ctx.listener.positionY.setTargetAtTime(g._pos[1],Howler.ctx.currentTime,.1),g.ctx.listener.positionZ.setTargetAtTime(g._pos[2],Howler.ctx.currentTime,.1)):g.ctx.listener.setPosition(g._pos[0],g._pos[1],g._pos[2]);else return g._pos;return g},HowlerGlobal.prototype.orientation=function(a,s,f,g,y,E){var A=this;if(!A.ctx||!A.ctx.listener)return A;var b=A._orientation;if(s=typeof s!="number"?b[1]:s,f=typeof f!="number"?b[2]:f,g=typeof g!="number"?b[3]:g,y=typeof y!="number"?b[4]:y,E=typeof E!="number"?b[5]:E,typeof a=="number")A._orientation=[a,s,f,g,y,E],typeof A.ctx.listener.forwardX<"u"?(A.ctx.listener.forwardX.setTargetAtTime(a,Howler.ctx.currentTime,.1),A.ctx.listener.forwardY.setTargetAtTime(s,Howler.ctx.currentTime,.1),A.ctx.listener.forwardZ.setTargetAtTime(f,Howler.ctx.currentTime,.1),A.ctx.listener.upX.setTargetAtTime(g,Howler.ctx.currentTime,.1),A.ctx.listener.upY.setTargetAtTime(y,Howler.ctx.currentTime,.1),A.ctx.listener.upZ.setTargetAtTime(E,Howler.ctx.currentTime,.1)):A.ctx.listener.setOrientation(a,s,f,g,y,E);else return b;return A},Howl.prototype.init=(function(a){return function(s){var f=this;return f._orientation=s.orientation||[1,0,0],f._stereo=s.stereo||null,f._pos=s.pos||null,f._pannerAttr={coneInnerAngle:typeof s.coneInnerAngle<"u"?s.coneInnerAngle:360,coneOuterAngle:typeof s.coneOuterAngle<"u"?s.coneOuterAngle:360,coneOuterGain:typeof s.coneOuterGain<"u"?s.coneOuterGain:0,distanceModel:typeof s.distanceModel<"u"?s.distanceModel:"inverse",maxDistance:typeof s.maxDistance<"u"?s.maxDistance:1e4,panningModel:typeof s.panningModel<"u"?s.panningModel:"HRTF",refDistance:typeof s.refDistance<"u"?s.refDistance:1,rolloffFactor:typeof s.rolloffFactor<"u"?s.rolloffFactor:1},f._onstereo=s.onstereo?[{fn:s.onstereo}]:[],f._onpos=s.onpos?[{fn:s.onpos}]:[],f._onorientation=s.onorientation?[{fn:s.onorientation}]:[],a.call(this,s)}})(Howl.prototype.init),Howl.prototype.stereo=function(a,s){var f=this;if(!f._webAudio)return f;if(f._state!=="loaded")return f._queue.push({event:"stereo",action:function(){f.stereo(a,s)}}),f;var g=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof s>"u")if(typeof a=="number")f._stereo=a,f._pos=[a,0,0];else return f._stereo;for(var y=f._getSoundIds(s),E=0;E<y.length;E++){var A=f._soundById(y[E]);if(A)if(typeof a=="number")A._stereo=a,A._pos=[a,0,0],A._node&&(A._pannerAttr.panningModel="equalpower",(!A._panner||!A._panner.pan)&&r(A,g),g==="spatial"?typeof A._panner.positionX<"u"?(A._panner.positionX.setValueAtTime(a,Howler.ctx.currentTime),A._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),A._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):A._panner.setPosition(a,0,0):A._panner.pan.setValueAtTime(a,Howler.ctx.currentTime)),f._emit("stereo",A._id);else return A._stereo}return f},Howl.prototype.pos=function(a,s,f,g){var y=this;if(!y._webAudio)return y;if(y._state!=="loaded")return y._queue.push({event:"pos",action:function(){y.pos(a,s,f,g)}}),y;if(s=typeof s!="number"?0:s,f=typeof f!="number"?-.5:f,typeof g>"u")if(typeof a=="number")y._pos=[a,s,f];else return y._pos;for(var E=y._getSoundIds(g),A=0;A<E.length;A++){var b=y._soundById(E[A]);if(b)if(typeof a=="number")b._pos=[a,s,f],b._node&&((!b._panner||b._panner.pan)&&r(b,"spatial"),typeof b._panner.positionX<"u"?(b._panner.positionX.setValueAtTime(a,Howler.ctx.currentTime),b._panner.positionY.setValueAtTime(s,Howler.ctx.currentTime),b._panner.positionZ.setValueAtTime(f,Howler.ctx.currentTime)):b._panner.setPosition(a,s,f)),y._emit("pos",b._id);else return b._pos}return y},Howl.prototype.orientation=function(a,s,f,g){var y=this;if(!y._webAudio)return y;if(y._state!=="loaded")return y._queue.push({event:"orientation",action:function(){y.orientation(a,s,f,g)}}),y;if(s=typeof s!="number"?y._orientation[1]:s,f=typeof f!="number"?y._orientation[2]:f,typeof g>"u")if(typeof a=="number")y._orientation=[a,s,f];else return y._orientation;for(var E=y._getSoundIds(g),A=0;A<E.length;A++){var b=y._soundById(E[A]);if(b)if(typeof a=="number")b._orientation=[a,s,f],b._node&&(b._panner||(b._pos||(b._pos=y._pos||[0,0,-.5]),r(b,"spatial")),typeof b._panner.orientationX<"u"?(b._panner.orientationX.setValueAtTime(a,Howler.ctx.currentTime),b._panner.orientationY.setValueAtTime(s,Howler.ctx.currentTime),b._panner.orientationZ.setValueAtTime(f,Howler.ctx.currentTime)):b._panner.setOrientation(a,s,f)),y._emit("orientation",b._id);else return b._orientation}return y},Howl.prototype.pannerAttr=function(){var a=this,s=arguments,f,g,y;if(!a._webAudio)return a;if(s.length===0)return a._pannerAttr;if(s.length===1)if(typeof s[0]=="object")f=s[0],typeof g>"u"&&(f.pannerAttr||(f.pannerAttr={coneInnerAngle:f.coneInnerAngle,coneOuterAngle:f.coneOuterAngle,coneOuterGain:f.coneOuterGain,distanceModel:f.distanceModel,maxDistance:f.maxDistance,refDistance:f.refDistance,rolloffFactor:f.rolloffFactor,panningModel:f.panningModel}),a._pannerAttr={coneInnerAngle:typeof f.pannerAttr.coneInnerAngle<"u"?f.pannerAttr.coneInnerAngle:a._coneInnerAngle,coneOuterAngle:typeof f.pannerAttr.coneOuterAngle<"u"?f.pannerAttr.coneOuterAngle:a._coneOuterAngle,coneOuterGain:typeof f.pannerAttr.coneOuterGain<"u"?f.pannerAttr.coneOuterGain:a._coneOuterGain,distanceModel:typeof f.pannerAttr.distanceModel<"u"?f.pannerAttr.distanceModel:a._distanceModel,maxDistance:typeof f.pannerAttr.maxDistance<"u"?f.pannerAttr.maxDistance:a._maxDistance,refDistance:typeof f.pannerAttr.refDistance<"u"?f.pannerAttr.refDistance:a._refDistance,rolloffFactor:typeof f.pannerAttr.rolloffFactor<"u"?f.pannerAttr.rolloffFactor:a._rolloffFactor,panningModel:typeof f.pannerAttr.panningModel<"u"?f.pannerAttr.panningModel:a._panningModel});else return y=a._soundById(parseInt(s[0],10)),y?y._pannerAttr:a._pannerAttr;else s.length===2&&(f=s[0],g=parseInt(s[1],10));for(var E=a._getSoundIds(g),A=0;A<E.length;A++)if(y=a._soundById(E[A]),y){var b=y._pannerAttr;b={coneInnerAngle:typeof f.coneInnerAngle<"u"?f.coneInnerAngle:b.coneInnerAngle,coneOuterAngle:typeof f.coneOuterAngle<"u"?f.coneOuterAngle:b.coneOuterAngle,coneOuterGain:typeof f.coneOuterGain<"u"?f.coneOuterGain:b.coneOuterGain,distanceModel:typeof f.distanceModel<"u"?f.distanceModel:b.distanceModel,maxDistance:typeof f.maxDistance<"u"?f.maxDistance:b.maxDistance,refDistance:typeof f.refDistance<"u"?f.refDistance:b.refDistance,rolloffFactor:typeof f.rolloffFactor<"u"?f.rolloffFactor:b.rolloffFactor,panningModel:typeof f.panningModel<"u"?f.panningModel:b.panningModel};var T=y._panner;T||(y._pos||(y._pos=a._pos||[0,0,-.5]),r(y,"spatial"),T=y._panner),T.coneInnerAngle=b.coneInnerAngle,T.coneOuterAngle=b.coneOuterAngle,T.coneOuterGain=b.coneOuterGain,T.distanceModel=b.distanceModel,T.maxDistance=b.maxDistance,T.refDistance=b.refDistance,T.rolloffFactor=b.rolloffFactor,T.panningModel=b.panningModel}return a},Sound.prototype.init=(function(a){return function(){var s=this,f=s._parent;s._orientation=f._orientation,s._stereo=f._stereo,s._pos=f._pos,s._pannerAttr=f._pannerAttr,a.call(this),s._stereo?f.stereo(s._stereo):s._pos&&f.pos(s._pos[0],s._pos[1],s._pos[2],s._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(a){return function(){var s=this,f=s._parent;return s._orientation=f._orientation,s._stereo=f._stereo,s._pos=f._pos,s._pannerAttr=f._pannerAttr,s._stereo?f.stereo(s._stereo):s._pos?f.pos(s._pos[0],s._pos[1],s._pos[2],s._id):s._panner&&(s._panner.disconnect(0),s._panner=void 0,f._refreshBuffer(s)),a.call(this)}})(Sound.prototype.reset);var r=function(a,s){s=s||"spatial",s==="spatial"?(a._panner=Howler.ctx.createPanner(),a._panner.coneInnerAngle=a._pannerAttr.coneInnerAngle,a._panner.coneOuterAngle=a._pannerAttr.coneOuterAngle,a._panner.coneOuterGain=a._pannerAttr.coneOuterGain,a._panner.distanceModel=a._pannerAttr.distanceModel,a._panner.maxDistance=a._pannerAttr.maxDistance,a._panner.refDistance=a._pannerAttr.refDistance,a._panner.rolloffFactor=a._pannerAttr.rolloffFactor,a._panner.panningModel=a._pannerAttr.panningModel,typeof a._panner.positionX<"u"?(a._panner.positionX.setValueAtTime(a._pos[0],Howler.ctx.currentTime),a._panner.positionY.setValueAtTime(a._pos[1],Howler.ctx.currentTime),a._panner.positionZ.setValueAtTime(a._pos[2],Howler.ctx.currentTime)):a._panner.setPosition(a._pos[0],a._pos[1],a._pos[2]),typeof a._panner.orientationX<"u"?(a._panner.orientationX.setValueAtTime(a._orientation[0],Howler.ctx.currentTime),a._panner.orientationY.setValueAtTime(a._orientation[1],Howler.ctx.currentTime),a._panner.orientationZ.setValueAtTime(a._orientation[2],Howler.ctx.currentTime)):a._panner.setOrientation(a._orientation[0],a._orientation[1],a._orientation[2])):(a._panner=Howler.ctx.createStereoPanner(),a._panner.pan.setValueAtTime(a._stereo,Howler.ctx.currentTime)),a._panner.connect(a._node),a._paused||a._parent.pause(a._id,!0).play(a._id,!0)}})()})(bh)),bh}RE();const ey="air-jam-volume-settings",NE=()=>{if(typeof window>"u")return{};try{const e=localStorage.getItem(ey);if(e){const r=JSON.parse(e);return{masterVolume:r.masterVolume??1,musicVolume:r.musicVolume??.8,sfxVolume:r.sfxVolume??1}}}catch{}return{}},_h=e=>{if(!(typeof window>"u"))try{localStorage.setItem(ey,JSON.stringify({masterVolume:e.masterVolume,musicVolume:e.musicVolume,sfxVolume:e.sfxVolume}))}catch{}},Eh=NE(),ty=z0((e,r)=>({masterVolume:Eh.masterVolume??1,musicVolume:Eh.musicVolume??.8,sfxVolume:Eh.sfxVolume??1,setMasterVolume:a=>{const s=Math.max(0,Math.min(1,a));e({masterVolume:s}),_h({...r(),masterVolume:s})},setMusicVolume:a=>{const s=Math.max(0,Math.min(1,a));e({musicVolume:s}),_h({...r(),musicVolume:s})},setSfxVolume:a=>{const s=Math.max(0,Math.min(1,a));e({sfxVolume:s}),_h({...r(),sfxVolume:s})},getEffectiveVolume:a=>{const{masterVolume:s,musicVolume:f,sfxVolume:g}=r();return s*(a==="music"?f:g)}})),OE=()=>{if(typeof window>"u"||!(window.parent!==window))return;const r=a=>{var E;if(a.source!==window.parent||((E=a.data)==null?void 0:E.type)!=="AIRJAM_SETTINGS_SYNC")return;const{masterVolume:s,musicVolume:f,sfxVolume:g}=a.data.payload,y=ty.getState();typeof s=="number"&&y.setMasterVolume(s),typeof f=="number"&&y.setMusicVolume(f),typeof g=="number"&&y.setSfxVolume(g)};window.addEventListener("message",r)};OE();L.createContext(null);/**
79
- * @license lucide-react v0.554.0 - ISC
80
- *
81
- * This source code is licensed under the ISC license.
82
- * See the LICENSE file in the root directory of this source tree.
83
- */const IE=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ME=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(r,a,s)=>s?s.toUpperCase():a.toLowerCase()),Up=e=>{const r=ME(e);return r.charAt(0).toUpperCase()+r.slice(1)},ny=(...e)=>e.filter((r,a,s)=>!!r&&r.trim()!==""&&s.indexOf(r)===a).join(" ").trim(),DE=e=>{for(const r in e)if(r.startsWith("aria-")||r==="role"||r==="title")return!0};/**
84
- * @license lucide-react v0.554.0 - ISC
85
- *
86
- * This source code is licensed under the ISC license.
87
- * See the LICENSE file in the root directory of this source tree.
88
- */var BE={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"};/**
89
- * @license lucide-react v0.554.0 - ISC
90
- *
91
- * This source code is licensed under the ISC license.
92
- * See the LICENSE file in the root directory of this source tree.
93
- */const kE=L.forwardRef(({color:e="currentColor",size:r=24,strokeWidth:a=2,absoluteStrokeWidth:s,className:f="",children:g,iconNode:y,...E},A)=>L.createElement("svg",{ref:A,...BE,width:r,height:r,stroke:e,strokeWidth:s?Number(a)*24/Number(r):a,className:ny("lucide",f),...!g&&!DE(E)&&{"aria-hidden":"true"},...E},[...y.map(([b,T])=>L.createElement(b,T)),...Array.isArray(g)?g:[g]]));/**
94
- * @license lucide-react v0.554.0 - ISC
95
- *
96
- * This source code is licensed under the ISC license.
97
- * See the LICENSE file in the root directory of this source tree.
98
- */const qn=(e,r)=>{const a=L.forwardRef(({className:s,...f},g)=>L.createElement(kE,{ref:g,iconNode:r,className:ny(`lucide-${IE(Up(e))}`,`lucide-${e}`,s),...f}));return a.displayName=Up(e),a};/**
99
- * @license lucide-react v0.554.0 - ISC
100
- *
101
- * This source code is licensed under the ISC license.
102
- * See the LICENSE file in the root directory of this source tree.
103
- */const LE=[["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M14 7a4 4 0 0 1 4 4v3a6 6 0 0 1-12 0v-3a4 4 0 0 1 4-4z",key:"uouzyp"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M21 21a4 4 0 0 0-3.81-4",key:"1b0z45"}],["path",{d:"M21 5a4 4 0 0 1-3.55 3.97",key:"5cxbf6"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M3 21a4 4 0 0 1 3.81-4",key:"1fjd4g"}],["path",{d:"M3 5a4 4 0 0 0 3.55 3.97",key:"1d7oge"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M9 7.13V6a3 3 0 1 1 6 0v1.13",key:"1vgav8"}]],PE=qn("bug",LE);/**
104
- * @license lucide-react v0.554.0 - ISC
105
- *
106
- * This source code is licensed under the ISC license.
107
- * See the LICENSE file in the root directory of this source tree.
108
- */const zE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ry=qn("check",zE);/**
109
- * @license lucide-react v0.554.0 - ISC
110
- *
111
- * This source code is licensed under the ISC license.
112
- * See the LICENSE file in the root directory of this source tree.
113
- */const UE=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],iy=qn("copy",UE);/**
114
- * @license lucide-react v0.554.0 - ISC
115
- *
116
- * This source code is licensed under the ISC license.
117
- * See the LICENSE file in the root directory of this source tree.
118
- */const FE=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],jE=qn("external-link",FE);/**
119
- * @license lucide-react v0.554.0 - ISC
120
- *
121
- * This source code is licensed under the ISC license.
122
- * See the LICENSE file in the root directory of this source tree.
123
- */const VE=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],HE=qn("headphones",VE);/**
124
- * @license lucide-react v0.554.0 - ISC
125
- *
126
- * This source code is licensed under the ISC license.
127
- * See the LICENSE file in the root directory of this source tree.
128
- */const GE=[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]],ZE=qn("maximize",GE);/**
129
- * @license lucide-react v0.554.0 - ISC
130
- *
131
- * This source code is licensed under the ISC license.
132
- * See the LICENSE file in the root directory of this source tree.
133
- */const XE=[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]],YE=qn("minimize",XE);/**
134
- * @license lucide-react v0.554.0 - ISC
135
- *
136
- * This source code is licensed under the ISC license.
137
- * See the LICENSE file in the root directory of this source tree.
138
- */const qE=[["path",{d:"M18 8V6a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h8",key:"10dyio"}],["path",{d:"M10 19v-3.96 3.15",key:"1irgej"}],["path",{d:"M7 19h5",key:"qswx4l"}],["rect",{width:"6",height:"10",x:"16",y:"12",rx:"2",key:"1egngj"}]],WE=qn("monitor-smartphone",qE);/**
139
- * @license lucide-react v0.554.0 - ISC
140
- *
141
- * This source code is licensed under the ISC license.
142
- * See the LICENSE file in the root directory of this source tree.
143
- */const KE=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],QE=qn("music",KE);/**
144
- * @license lucide-react v0.554.0 - ISC
145
- *
146
- * This source code is licensed under the ISC license.
147
- * See the LICENSE file in the root directory of this source tree.
148
- */const JE=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],ay=qn("pause",JE);/**
149
- * @license lucide-react v0.554.0 - ISC
150
- *
151
- * This source code is licensed under the ISC license.
152
- * See the LICENSE file in the root directory of this source tree.
153
- */const $E=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Lu=qn("play",$E);/**
154
- * @license lucide-react v0.554.0 - ISC
155
- *
156
- * This source code is licensed under the ISC license.
157
- * See the LICENSE file in the root directory of this source tree.
158
- */const eA=[["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"}]],oy=qn("qr-code",eA);/**
159
- * @license lucide-react v0.554.0 - ISC
160
- *
161
- * This source code is licensed under the ISC license.
162
- * See the LICENSE file in the root directory of this source tree.
163
- */const tA=[["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"}]],nA=qn("refresh-cw",tA);/**
164
- * @license lucide-react v0.554.0 - ISC
165
- *
166
- * This source code is licensed under the ISC license.
167
- * See the LICENSE file in the root directory of this source tree.
168
- */const rA=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],iA=qn("settings",rA);/**
169
- * @license lucide-react v0.554.0 - ISC
170
- *
171
- * This source code is licensed under the ISC license.
172
- * See the LICENSE file in the root directory of this source tree.
173
- */const aA=[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]],oA=qn("volume-2",aA);/**
174
- * @license lucide-react v0.554.0 - ISC
175
- *
176
- * This source code is licensed under the ISC license.
177
- * See the LICENSE file in the root directory of this source tree.
178
- */const sA=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],lA=qn("x",sA);function Fp(e,r){if(typeof e=="function")return e(r);e!=null&&(e.current=r)}function G0(...e){return r=>{let a=!1;const s=e.map(f=>{const g=Fp(f,r);return!a&&typeof g=="function"&&(a=!0),g});if(a)return()=>{for(let f=0;f<s.length;f++){const g=s[f];typeof g=="function"?g():Fp(e[f],null)}}}}function Yn(...e){return L.useCallback(G0(...e),e)}var cA=Symbol.for("react.lazy"),ju=M0[" use ".trim().toString()];function uA(e){return typeof e=="object"&&e!==null&&"then"in e}function sy(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===cA&&"_payload"in e&&uA(e._payload)}function fA(e){const r=dA(e),a=L.forwardRef((s,f)=>{let{children:g,...y}=s;sy(g)&&typeof ju=="function"&&(g=ju(g._payload));const E=L.Children.toArray(g),A=E.find(gA);if(A){const b=A.props.children,T=E.map(x=>x===A?L.Children.count(b)>1?L.Children.only(null):L.isValidElement(b)?b.props.children:null:x);return F.jsx(r,{...y,ref:f,children:L.isValidElement(b)?L.cloneElement(b,void 0,T):null})}return F.jsx(r,{...y,ref:f,children:g})});return a.displayName=`${e}.Slot`,a}var ly=fA("Slot");function dA(e){const r=L.forwardRef((a,s)=>{let{children:f,...g}=a;if(sy(f)&&typeof ju=="function"&&(f=ju(f._payload)),L.isValidElement(f)){const y=pA(f),E=mA(g,f.props);return f.type!==L.Fragment&&(E.ref=s?G0(s,y):y),L.cloneElement(f,E)}return L.Children.count(f)>1?L.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var hA=Symbol("radix.slottable");function gA(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===hA}function mA(e,r){const a={...r};for(const s in r){const f=e[s],g=r[s];/^on[A-Z]/.test(s)?f&&g?a[s]=(...E)=>{const A=g(...E);return f(...E),A}:f&&(a[s]=f):s==="style"?a[s]={...f,...g}:s==="className"&&(a[s]=[f,g].filter(Boolean).join(" "))}return{...e,...a}}function pA(e){var s,f;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}function cy(e){var r,a,s="";if(typeof e=="string"||typeof e=="number")s+=e;else if(typeof e=="object")if(Array.isArray(e)){var f=e.length;for(r=0;r<f;r++)e[r]&&(a=cy(e[r]))&&(s&&(s+=" "),s+=a)}else for(a in e)e[a]&&(s&&(s+=" "),s+=a);return s}function uy(){for(var e,r,a=0,s="",f=arguments.length;a<f;a++)(e=arguments[a])&&(r=cy(e))&&(s&&(s+=" "),s+=r);return s}const jp=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Vp=uy,Z0=(e,r)=>a=>{var s;if((r==null?void 0:r.variants)==null)return Vp(e,a==null?void 0:a.class,a==null?void 0:a.className);const{variants:f,defaultVariants:g}=r,y=Object.keys(f).map(b=>{const T=a==null?void 0:a[b],x=g==null?void 0:g[b];if(T===null)return null;const S=jp(T)||jp(x);return f[b][S]}),E=a&&Object.entries(a).reduce((b,T)=>{let[x,S]=T;return S===void 0||(b[x]=S),b},{}),A=r==null||(s=r.compoundVariants)===null||s===void 0?void 0:s.reduce((b,T)=>{let{class:x,className:S,...R}=T;return Object.entries(R).every(I=>{let[B,P]=I;return Array.isArray(P)?P.includes({...g,...E}[B]):{...g,...E}[B]===P})?[...b,x,S]:b},[]);return Vp(e,y,A,a==null?void 0:a.class,a==null?void 0:a.className)},X0="-",xA=e=>{const r=vA(e),{conflictingClassGroups:a,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:y=>{const E=y.split(X0);return E[0]===""&&E.length!==1&&E.shift(),fy(E,r)||yA(y)},getConflictingClassGroupIds:(y,E)=>{const A=a[y]||[];return E&&s[y]?[...A,...s[y]]:A}}},fy=(e,r)=>{var y;if(e.length===0)return r.classGroupId;const a=e[0],s=r.nextPart.get(a),f=s?fy(e.slice(1),s):void 0;if(f)return f;if(r.validators.length===0)return;const g=e.join(X0);return(y=r.validators.find(({validator:E})=>E(g)))==null?void 0:y.classGroupId},Hp=/^\[(.+)\]$/,yA=e=>{if(Hp.test(e)){const r=Hp.exec(e)[1],a=r==null?void 0:r.substring(0,r.indexOf(":"));if(a)return"arbitrary.."+a}},vA=e=>{const{theme:r,prefix:a}=e,s={nextPart:new Map,validators:[]};return bA(Object.entries(e.classGroups),a).forEach(([g,y])=>{v0(y,s,g,r)}),s},v0=(e,r,a,s)=>{e.forEach(f=>{if(typeof f=="string"){const g=f===""?r:Gp(r,f);g.classGroupId=a;return}if(typeof f=="function"){if(wA(f)){v0(f(s),r,a,s);return}r.validators.push({validator:f,classGroupId:a});return}Object.entries(f).forEach(([g,y])=>{v0(y,Gp(r,g),a,s)})})},Gp=(e,r)=>{let a=e;return r.split(X0).forEach(s=>{a.nextPart.has(s)||a.nextPart.set(s,{nextPart:new Map,validators:[]}),a=a.nextPart.get(s)}),a},wA=e=>e.isThemeGetter,bA=(e,r)=>r?e.map(([a,s])=>{const f=s.map(g=>typeof g=="string"?r+g:typeof g=="object"?Object.fromEntries(Object.entries(g).map(([y,E])=>[r+y,E])):g);return[a,f]}):e,_A=e=>{if(e<1)return{get:()=>{},set:()=>{}};let r=0,a=new Map,s=new Map;const f=(g,y)=>{a.set(g,y),r++,r>e&&(r=0,s=a,a=new Map)};return{get(g){let y=a.get(g);if(y!==void 0)return y;if((y=s.get(g))!==void 0)return f(g,y),y},set(g,y){a.has(g)?a.set(g,y):f(g,y)}}},dy="!",EA=e=>{const{separator:r,experimentalParseClassName:a}=e,s=r.length===1,f=r[0],g=r.length,y=E=>{const A=[];let b=0,T=0,x;for(let P=0;P<E.length;P++){let k=E[P];if(b===0){if(k===f&&(s||E.slice(P,P+g)===r)){A.push(E.slice(T,P)),T=P+g;continue}if(k==="/"){x=P;continue}}k==="["?b++:k==="]"&&b--}const S=A.length===0?E:E.substring(T),R=S.startsWith(dy),I=R?S.substring(1):S,B=x&&x>T?x-T:void 0;return{modifiers:A,hasImportantModifier:R,baseClassName:I,maybePostfixModifierPosition:B}};return a?E=>a({className:E,parseClassName:y}):y},AA=e=>{if(e.length<=1)return e;const r=[];let a=[];return e.forEach(s=>{s[0]==="["?(r.push(...a.sort(),s),a=[]):a.push(s)}),r.push(...a.sort()),r},CA=e=>({cache:_A(e.cacheSize),parseClassName:EA(e),...xA(e)}),SA=/\s+/,TA=(e,r)=>{const{parseClassName:a,getClassGroupId:s,getConflictingClassGroupIds:f}=r,g=[],y=e.trim().split(SA);let E="";for(let A=y.length-1;A>=0;A-=1){const b=y[A],{modifiers:T,hasImportantModifier:x,baseClassName:S,maybePostfixModifierPosition:R}=a(b);let I=!!R,B=s(I?S.substring(0,R):S);if(!B){if(!I){E=b+(E.length>0?" "+E:E);continue}if(B=s(S),!B){E=b+(E.length>0?" "+E:E);continue}I=!1}const P=AA(T).join(":"),k=x?P+dy:P,Z=k+B;if(g.includes(Z))continue;g.push(Z);const j=f(B,I);for(let H=0;H<j.length;++H){const ee=j[H];g.push(k+ee)}E=b+(E.length>0?" "+E:E)}return E};function RA(){let e=0,r,a,s="";for(;e<arguments.length;)(r=arguments[e++])&&(a=hy(r))&&(s&&(s+=" "),s+=a);return s}const hy=e=>{if(typeof e=="string")return e;let r,a="";for(let s=0;s<e.length;s++)e[s]&&(r=hy(e[s]))&&(a&&(a+=" "),a+=r);return a};function NA(e,...r){let a,s,f,g=y;function y(A){const b=r.reduce((T,x)=>x(T),e());return a=CA(b),s=a.cache.get,f=a.cache.set,g=E,E(A)}function E(A){const b=s(A);if(b)return b;const T=TA(A,a);return f(A,T),T}return function(){return g(RA.apply(null,arguments))}}const Yt=e=>{const r=a=>a[e]||[];return r.isThemeGetter=!0,r},gy=/^\[(?:([a-z-]+):)?(.+)\]$/i,OA=/^\d+\/\d+$/,IA=new Set(["px","full","screen"]),MA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,DA=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,BA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,kA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,LA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ji=e=>As(e)||IA.has(e)||OA.test(e),Ha=e=>Ds(e,"length",GA),As=e=>!!e&&!Number.isNaN(Number(e)),Ah=e=>Ds(e,"number",As),Dl=e=>!!e&&Number.isInteger(Number(e)),PA=e=>e.endsWith("%")&&As(e.slice(0,-1)),rt=e=>gy.test(e),Ga=e=>MA.test(e),zA=new Set(["length","size","percentage"]),UA=e=>Ds(e,zA,my),FA=e=>Ds(e,"position",my),jA=new Set(["image","url"]),VA=e=>Ds(e,jA,XA),HA=e=>Ds(e,"",ZA),Bl=()=>!0,Ds=(e,r,a)=>{const s=gy.exec(e);return s?s[1]?typeof r=="string"?s[1]===r:r.has(s[1]):a(s[2]):!1},GA=e=>DA.test(e)&&!BA.test(e),my=()=>!1,ZA=e=>kA.test(e),XA=e=>LA.test(e),YA=()=>{const e=Yt("colors"),r=Yt("spacing"),a=Yt("blur"),s=Yt("brightness"),f=Yt("borderColor"),g=Yt("borderRadius"),y=Yt("borderSpacing"),E=Yt("borderWidth"),A=Yt("contrast"),b=Yt("grayscale"),T=Yt("hueRotate"),x=Yt("invert"),S=Yt("gap"),R=Yt("gradientColorStops"),I=Yt("gradientColorStopPositions"),B=Yt("inset"),P=Yt("margin"),k=Yt("opacity"),Z=Yt("padding"),j=Yt("saturate"),H=Yt("scale"),ee=Yt("sepia"),Q=Yt("skew"),X=Yt("space"),de=Yt("translate"),Y=()=>["auto","contain","none"],we=()=>["auto","hidden","clip","visible","scroll"],le=()=>["auto",rt,r],te=()=>[rt,r],pe=()=>["",Ji,Ha],Te=()=>["auto",As,rt],ie=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],re=()=>["solid","dashed","dotted","double","none"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Me=()=>["start","end","center","between","around","evenly","stretch"],He=()=>["","0",rt],qe=()=>["auto","avoid","all","avoid-page","page","left","right","column"],K=()=>[As,rt];return{cacheSize:500,separator:":",theme:{colors:[Bl],spacing:[Ji,Ha],blur:["none","",Ga,rt],brightness:K(),borderColor:[e],borderRadius:["none","","full",Ga,rt],borderSpacing:te(),borderWidth:pe(),contrast:K(),grayscale:He(),hueRotate:K(),invert:He(),gap:te(),gradientColorStops:[e],gradientColorStopPositions:[PA,Ha],inset:le(),margin:le(),opacity:K(),padding:te(),saturate:K(),scale:K(),sepia:He(),skew:K(),space:te(),translate:te()},classGroups:{aspect:[{aspect:["auto","square","video",rt]}],container:["container"],columns:[{columns:[Ga]}],"break-after":[{"break-after":qe()}],"break-before":[{"break-before":qe()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...ie(),rt]}],overflow:[{overflow:we()}],"overflow-x":[{"overflow-x":we()}],"overflow-y":[{"overflow-y":we()}],overscroll:[{overscroll:Y()}],"overscroll-x":[{"overscroll-x":Y()}],"overscroll-y":[{"overscroll-y":Y()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[B]}],"inset-x":[{"inset-x":[B]}],"inset-y":[{"inset-y":[B]}],start:[{start:[B]}],end:[{end:[B]}],top:[{top:[B]}],right:[{right:[B]}],bottom:[{bottom:[B]}],left:[{left:[B]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Dl,rt]}],basis:[{basis:le()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",rt]}],grow:[{grow:He()}],shrink:[{shrink:He()}],order:[{order:["first","last","none",Dl,rt]}],"grid-cols":[{"grid-cols":[Bl]}],"col-start-end":[{col:["auto",{span:["full",Dl,rt]},rt]}],"col-start":[{"col-start":Te()}],"col-end":[{"col-end":Te()}],"grid-rows":[{"grid-rows":[Bl]}],"row-start-end":[{row:["auto",{span:[Dl,rt]},rt]}],"row-start":[{"row-start":Te()}],"row-end":[{"row-end":Te()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",rt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",rt]}],gap:[{gap:[S]}],"gap-x":[{"gap-x":[S]}],"gap-y":[{"gap-y":[S]}],"justify-content":[{justify:["normal",...Me()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Me(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Me(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[Z]}],px:[{px:[Z]}],py:[{py:[Z]}],ps:[{ps:[Z]}],pe:[{pe:[Z]}],pt:[{pt:[Z]}],pr:[{pr:[Z]}],pb:[{pb:[Z]}],pl:[{pl:[Z]}],m:[{m:[P]}],mx:[{mx:[P]}],my:[{my:[P]}],ms:[{ms:[P]}],me:[{me:[P]}],mt:[{mt:[P]}],mr:[{mr:[P]}],mb:[{mb:[P]}],ml:[{ml:[P]}],"space-x":[{"space-x":[X]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[X]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",rt,r]}],"min-w":[{"min-w":[rt,r,"min","max","fit"]}],"max-w":[{"max-w":[rt,r,"none","full","min","max","fit","prose",{screen:[Ga]},Ga]}],h:[{h:[rt,r,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[rt,r,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[rt,r,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[rt,r,"auto","min","max","fit"]}],"font-size":[{text:["base",Ga,Ha]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Ah]}],"font-family":[{font:[Bl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",rt]}],"line-clamp":[{"line-clamp":["none",As,Ah]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ji,rt]}],"list-image":[{"list-image":["none",rt]}],"list-style-type":[{list:["none","disc","decimal",rt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[k]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[k]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ji,Ha]}],"underline-offset":[{"underline-offset":["auto",Ji,rt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:te()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",rt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",rt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[k]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...ie(),FA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",UA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},VA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[I]}],"gradient-via-pos":[{via:[I]}],"gradient-to-pos":[{to:[I]}],"gradient-from":[{from:[R]}],"gradient-via":[{via:[R]}],"gradient-to":[{to:[R]}],rounded:[{rounded:[g]}],"rounded-s":[{"rounded-s":[g]}],"rounded-e":[{"rounded-e":[g]}],"rounded-t":[{"rounded-t":[g]}],"rounded-r":[{"rounded-r":[g]}],"rounded-b":[{"rounded-b":[g]}],"rounded-l":[{"rounded-l":[g]}],"rounded-ss":[{"rounded-ss":[g]}],"rounded-se":[{"rounded-se":[g]}],"rounded-ee":[{"rounded-ee":[g]}],"rounded-es":[{"rounded-es":[g]}],"rounded-tl":[{"rounded-tl":[g]}],"rounded-tr":[{"rounded-tr":[g]}],"rounded-br":[{"rounded-br":[g]}],"rounded-bl":[{"rounded-bl":[g]}],"border-w":[{border:[E]}],"border-w-x":[{"border-x":[E]}],"border-w-y":[{"border-y":[E]}],"border-w-s":[{"border-s":[E]}],"border-w-e":[{"border-e":[E]}],"border-w-t":[{"border-t":[E]}],"border-w-r":[{"border-r":[E]}],"border-w-b":[{"border-b":[E]}],"border-w-l":[{"border-l":[E]}],"border-opacity":[{"border-opacity":[k]}],"border-style":[{border:[...re(),"hidden"]}],"divide-x":[{"divide-x":[E]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[E]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[k]}],"divide-style":[{divide:re()}],"border-color":[{border:[f]}],"border-color-x":[{"border-x":[f]}],"border-color-y":[{"border-y":[f]}],"border-color-s":[{"border-s":[f]}],"border-color-e":[{"border-e":[f]}],"border-color-t":[{"border-t":[f]}],"border-color-r":[{"border-r":[f]}],"border-color-b":[{"border-b":[f]}],"border-color-l":[{"border-l":[f]}],"divide-color":[{divide:[f]}],"outline-style":[{outline:["",...re()]}],"outline-offset":[{"outline-offset":[Ji,rt]}],"outline-w":[{outline:[Ji,Ha]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:pe()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[k]}],"ring-offset-w":[{"ring-offset":[Ji,Ha]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ga,HA]}],"shadow-color":[{shadow:[Bl]}],opacity:[{opacity:[k]}],"mix-blend":[{"mix-blend":[...xe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":xe()}],filter:[{filter:["","none"]}],blur:[{blur:[a]}],brightness:[{brightness:[s]}],contrast:[{contrast:[A]}],"drop-shadow":[{"drop-shadow":["","none",Ga,rt]}],grayscale:[{grayscale:[b]}],"hue-rotate":[{"hue-rotate":[T]}],invert:[{invert:[x]}],saturate:[{saturate:[j]}],sepia:[{sepia:[ee]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[a]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[A]}],"backdrop-grayscale":[{"backdrop-grayscale":[b]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[T]}],"backdrop-invert":[{"backdrop-invert":[x]}],"backdrop-opacity":[{"backdrop-opacity":[k]}],"backdrop-saturate":[{"backdrop-saturate":[j]}],"backdrop-sepia":[{"backdrop-sepia":[ee]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[y]}],"border-spacing-x":[{"border-spacing-x":[y]}],"border-spacing-y":[{"border-spacing-y":[y]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",rt]}],duration:[{duration:K()}],ease:[{ease:["linear","in","out","in-out",rt]}],delay:[{delay:K()}],animate:[{animate:["none","spin","ping","pulse","bounce",rt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[H]}],"scale-x":[{"scale-x":[H]}],"scale-y":[{"scale-y":[H]}],rotate:[{rotate:[Dl,rt]}],"translate-x":[{"translate-x":[de]}],"translate-y":[{"translate-y":[de]}],"skew-x":[{"skew-x":[Q]}],"skew-y":[{"skew-y":[Q]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",rt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",rt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":te()}],"scroll-mx":[{"scroll-mx":te()}],"scroll-my":[{"scroll-my":te()}],"scroll-ms":[{"scroll-ms":te()}],"scroll-me":[{"scroll-me":te()}],"scroll-mt":[{"scroll-mt":te()}],"scroll-mr":[{"scroll-mr":te()}],"scroll-mb":[{"scroll-mb":te()}],"scroll-ml":[{"scroll-ml":te()}],"scroll-p":[{"scroll-p":te()}],"scroll-px":[{"scroll-px":te()}],"scroll-py":[{"scroll-py":te()}],"scroll-ps":[{"scroll-ps":te()}],"scroll-pe":[{"scroll-pe":te()}],"scroll-pt":[{"scroll-pt":te()}],"scroll-pr":[{"scroll-pr":te()}],"scroll-pb":[{"scroll-pb":te()}],"scroll-pl":[{"scroll-pl":te()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",rt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ji,Ha,Ah]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},qA=NA(YA),Wt=(...e)=>qA(uy(e)),WA=Z0("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"text-foreground hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function Br({className:e,variant:r,size:a,asChild:s=!1,...f}){const g=s?ly:"button";return F.jsx(g,{"data-slot":"button",className:Wt(WA({variant:r,size:a,className:e})),...f})}function tn(e,r,{checkForDefaultPrevented:a=!0}={}){return function(f){if(e==null||e(f),a===!1||!f.defaultPrevented)return r==null?void 0:r(f)}}function KA(e,r){const a=L.createContext(r),s=g=>{const{children:y,...E}=g,A=L.useMemo(()=>E,Object.values(E));return F.jsx(a.Provider,{value:A,children:y})};s.displayName=e+"Provider";function f(g){const y=L.useContext(a);if(y)return y;if(r!==void 0)return r;throw new Error(`\`${g}\` must be used within \`${e}\``)}return[s,f]}function Wl(e,r=[]){let a=[];function s(g,y){const E=L.createContext(y),A=a.length;a=[...a,y];const b=x=>{var k;const{scope:S,children:R,...I}=x,B=((k=S==null?void 0:S[e])==null?void 0:k[A])||E,P=L.useMemo(()=>I,Object.values(I));return F.jsx(B.Provider,{value:P,children:R})};b.displayName=g+"Provider";function T(x,S){var B;const R=((B=S==null?void 0:S[e])==null?void 0:B[A])||E,I=L.useContext(R);if(I)return I;if(y!==void 0)return y;throw new Error(`\`${x}\` must be used within \`${g}\``)}return[b,T]}const f=()=>{const g=a.map(y=>L.createContext(y));return function(E){const A=(E==null?void 0:E[e])||g;return L.useMemo(()=>({[`__scope${e}`]:{...E,[e]:A}}),[E,A])}};return f.scopeName=e,[s,QA(f,...r)]}function QA(...e){const r=e[0];if(e.length===1)return r;const a=()=>{const s=e.map(f=>({useScope:f(),scopeName:f.scopeName}));return function(g){const y=s.reduce((E,{useScope:A,scopeName:b})=>{const x=A(g)[`__scope${b}`];return{...E,...x}},{});return L.useMemo(()=>({[`__scope${r.scopeName}`]:y}),[y])}};return a.scopeName=r.scopeName,a}var Ts=globalThis!=null&&globalThis.document?L.useLayoutEffect:()=>{},JA=M0[" useId ".trim().toString()]||(()=>{}),$A=0;function jl(e){const[r,a]=L.useState(JA());return Ts(()=>{a(s=>s??String($A++))},[e]),e||(r?`radix-${r}`:"")}var eC=M0[" useInsertionEffect ".trim().toString()]||Ts;function rf({prop:e,defaultProp:r,onChange:a=()=>{},caller:s}){const[f,g,y]=tC({defaultProp:r,onChange:a}),E=e!==void 0,A=E?e:f;{const T=L.useRef(e!==void 0);L.useEffect(()=>{const x=T.current;x!==E&&console.warn(`${s} is changing from ${x?"controlled":"uncontrolled"} to ${E?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),T.current=E},[E,s])}const b=L.useCallback(T=>{var x;if(E){const S=nC(T)?T(e):T;S!==e&&((x=y.current)==null||x.call(y,S))}else g(T)},[E,e,g,y]);return[A,b]}function tC({defaultProp:e,onChange:r}){const[a,s]=L.useState(e),f=L.useRef(a),g=L.useRef(r);return eC(()=>{g.current=r},[r]),L.useEffect(()=>{var y;f.current!==a&&((y=g.current)==null||y.call(g,a),f.current=a)},[a,f]),[a,s,g]}function nC(e){return typeof e=="function"}function Vu(e){const r=rC(e),a=L.forwardRef((s,f)=>{const{children:g,...y}=s,E=L.Children.toArray(g),A=E.find(aC);if(A){const b=A.props.children,T=E.map(x=>x===A?L.Children.count(b)>1?L.Children.only(null):L.isValidElement(b)?b.props.children:null:x);return F.jsx(r,{...y,ref:f,children:L.isValidElement(b)?L.cloneElement(b,void 0,T):null})}return F.jsx(r,{...y,ref:f,children:g})});return a.displayName=`${e}.Slot`,a}function rC(e){const r=L.forwardRef((a,s)=>{const{children:f,...g}=a;if(L.isValidElement(f)){const y=sC(f),E=oC(g,f.props);return f.type!==L.Fragment&&(E.ref=s?G0(s,y):y),L.cloneElement(f,E)}return L.Children.count(f)>1?L.Children.only(null):null});return r.displayName=`${e}.SlotClone`,r}var iC=Symbol("radix.slottable");function aC(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===iC}function oC(e,r){const a={...r};for(const s in r){const f=e[s],g=r[s];/^on[A-Z]/.test(s)?f&&g?a[s]=(...E)=>{const A=g(...E);return f(...E),A}:f&&(a[s]=f):s==="style"?a[s]={...f,...g}:s==="className"&&(a[s]=[f,g].filter(Boolean).join(" "))}return{...e,...a}}function sC(e){var s,f;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var lC=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Sn=lC.reduce((e,r)=>{const a=Vu(`Primitive.${r}`),s=L.forwardRef((f,g)=>{const{asChild:y,...E}=f,A=y?a:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),F.jsx(A,{...E,ref:g})});return s.displayName=`Primitive.${r}`,{...e,[r]:s}},{});function cC(e,r){e&&zx.flushSync(()=>e.dispatchEvent(r))}function Rs(e){const r=L.useRef(e);return L.useEffect(()=>{r.current=e}),L.useMemo(()=>(...a)=>{var s;return(s=r.current)==null?void 0:s.call(r,...a)},[])}function uC(e,r=globalThis==null?void 0:globalThis.document){const a=Rs(e);L.useEffect(()=>{const s=f=>{f.key==="Escape"&&a(f)};return r.addEventListener("keydown",s,{capture:!0}),()=>r.removeEventListener("keydown",s,{capture:!0})},[a,r])}var fC="DismissableLayer",w0="dismissableLayer.update",dC="dismissableLayer.pointerDownOutside",hC="dismissableLayer.focusOutside",Zp,py=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),xy=L.forwardRef((e,r)=>{const{disableOutsidePointerEvents:a=!1,onEscapeKeyDown:s,onPointerDownOutside:f,onFocusOutside:g,onInteractOutside:y,onDismiss:E,...A}=e,b=L.useContext(py),[T,x]=L.useState(null),S=(T==null?void 0:T.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,R]=L.useState({}),I=Yn(r,X=>x(X)),B=Array.from(b.layers),[P]=[...b.layersWithOutsidePointerEventsDisabled].slice(-1),k=B.indexOf(P),Z=T?B.indexOf(T):-1,j=b.layersWithOutsidePointerEventsDisabled.size>0,H=Z>=k,ee=pC(X=>{const de=X.target,Y=[...b.branches].some(we=>we.contains(de));!H||Y||(f==null||f(X),y==null||y(X),X.defaultPrevented||E==null||E())},S),Q=xC(X=>{const de=X.target;[...b.branches].some(we=>we.contains(de))||(g==null||g(X),y==null||y(X),X.defaultPrevented||E==null||E())},S);return uC(X=>{Z===b.layers.size-1&&(s==null||s(X),!X.defaultPrevented&&E&&(X.preventDefault(),E()))},S),L.useEffect(()=>{if(T)return a&&(b.layersWithOutsidePointerEventsDisabled.size===0&&(Zp=S.body.style.pointerEvents,S.body.style.pointerEvents="none"),b.layersWithOutsidePointerEventsDisabled.add(T)),b.layers.add(T),Xp(),()=>{a&&b.layersWithOutsidePointerEventsDisabled.size===1&&(S.body.style.pointerEvents=Zp)}},[T,S,a,b]),L.useEffect(()=>()=>{T&&(b.layers.delete(T),b.layersWithOutsidePointerEventsDisabled.delete(T),Xp())},[T,b]),L.useEffect(()=>{const X=()=>R({});return document.addEventListener(w0,X),()=>document.removeEventListener(w0,X)},[]),F.jsx(Sn.div,{...A,ref:I,style:{pointerEvents:j?H?"auto":"none":void 0,...e.style},onFocusCapture:tn(e.onFocusCapture,Q.onFocusCapture),onBlurCapture:tn(e.onBlurCapture,Q.onBlurCapture),onPointerDownCapture:tn(e.onPointerDownCapture,ee.onPointerDownCapture)})});xy.displayName=fC;var gC="DismissableLayerBranch",mC=L.forwardRef((e,r)=>{const a=L.useContext(py),s=L.useRef(null),f=Yn(r,s);return L.useEffect(()=>{const g=s.current;if(g)return a.branches.add(g),()=>{a.branches.delete(g)}},[a.branches]),F.jsx(Sn.div,{...e,ref:f})});mC.displayName=gC;function pC(e,r=globalThis==null?void 0:globalThis.document){const a=Rs(e),s=L.useRef(!1),f=L.useRef(()=>{});return L.useEffect(()=>{const g=E=>{if(E.target&&!s.current){let A=function(){yy(dC,a,b,{discrete:!0})};const b={originalEvent:E};E.pointerType==="touch"?(r.removeEventListener("click",f.current),f.current=A,r.addEventListener("click",f.current,{once:!0})):A()}else r.removeEventListener("click",f.current);s.current=!1},y=window.setTimeout(()=>{r.addEventListener("pointerdown",g)},0);return()=>{window.clearTimeout(y),r.removeEventListener("pointerdown",g),r.removeEventListener("click",f.current)}},[r,a]),{onPointerDownCapture:()=>s.current=!0}}function xC(e,r=globalThis==null?void 0:globalThis.document){const a=Rs(e),s=L.useRef(!1);return L.useEffect(()=>{const f=g=>{g.target&&!s.current&&yy(hC,a,{originalEvent:g},{discrete:!1})};return r.addEventListener("focusin",f),()=>r.removeEventListener("focusin",f)},[r,a]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function Xp(){const e=new CustomEvent(w0);document.dispatchEvent(e)}function yy(e,r,a,{discrete:s}){const f=a.originalEvent.target,g=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:a});r&&f.addEventListener(e,r,{once:!0}),s?cC(f,g):f.dispatchEvent(g)}var Ch="focusScope.autoFocusOnMount",Sh="focusScope.autoFocusOnUnmount",Yp={bubbles:!1,cancelable:!0},yC="FocusScope",vy=L.forwardRef((e,r)=>{const{loop:a=!1,trapped:s=!1,onMountAutoFocus:f,onUnmountAutoFocus:g,...y}=e,[E,A]=L.useState(null),b=Rs(f),T=Rs(g),x=L.useRef(null),S=Yn(r,B=>A(B)),R=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(s){let B=function(j){if(R.paused||!E)return;const H=j.target;E.contains(H)?x.current=H:Xa(x.current,{select:!0})},P=function(j){if(R.paused||!E)return;const H=j.relatedTarget;H!==null&&(E.contains(H)||Xa(x.current,{select:!0}))},k=function(j){if(document.activeElement===document.body)for(const ee of j)ee.removedNodes.length>0&&Xa(E)};document.addEventListener("focusin",B),document.addEventListener("focusout",P);const Z=new MutationObserver(k);return E&&Z.observe(E,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",B),document.removeEventListener("focusout",P),Z.disconnect()}}},[s,E,R.paused]),L.useEffect(()=>{if(E){Wp.add(R);const B=document.activeElement;if(!E.contains(B)){const k=new CustomEvent(Ch,Yp);E.addEventListener(Ch,b),E.dispatchEvent(k),k.defaultPrevented||(vC(AC(wy(E)),{select:!0}),document.activeElement===B&&Xa(E))}return()=>{E.removeEventListener(Ch,b),setTimeout(()=>{const k=new CustomEvent(Sh,Yp);E.addEventListener(Sh,T),E.dispatchEvent(k),k.defaultPrevented||Xa(B??document.body,{select:!0}),E.removeEventListener(Sh,T),Wp.remove(R)},0)}}},[E,b,T,R]);const I=L.useCallback(B=>{if(!a&&!s||R.paused)return;const P=B.key==="Tab"&&!B.altKey&&!B.ctrlKey&&!B.metaKey,k=document.activeElement;if(P&&k){const Z=B.currentTarget,[j,H]=wC(Z);j&&H?!B.shiftKey&&k===H?(B.preventDefault(),a&&Xa(j,{select:!0})):B.shiftKey&&k===j&&(B.preventDefault(),a&&Xa(H,{select:!0})):k===Z&&B.preventDefault()}},[a,s,R.paused]);return F.jsx(Sn.div,{tabIndex:-1,...y,ref:S,onKeyDown:I})});vy.displayName=yC;function vC(e,{select:r=!1}={}){const a=document.activeElement;for(const s of e)if(Xa(s,{select:r}),document.activeElement!==a)return}function wC(e){const r=wy(e),a=qp(r,e),s=qp(r.reverse(),e);return[a,s]}function wy(e){const r=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const f=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||f?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;a.nextNode();)r.push(a.currentNode);return r}function qp(e,r){for(const a of e)if(!bC(a,{upTo:r}))return a}function bC(e,{upTo:r}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r!==void 0&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function _C(e){return e instanceof HTMLInputElement&&"select"in e}function Xa(e,{select:r=!1}={}){if(e&&e.focus){const a=document.activeElement;e.focus({preventScroll:!0}),e!==a&&_C(e)&&r&&e.select()}}var Wp=EC();function EC(){let e=[];return{add(r){const a=e[0];r!==a&&(a==null||a.pause()),e=Kp(e,r),e.unshift(r)},remove(r){var a;e=Kp(e,r),(a=e[0])==null||a.resume()}}}function Kp(e,r){const a=[...e],s=a.indexOf(r);return s!==-1&&a.splice(s,1),a}function AC(e){return e.filter(r=>r.tagName!=="A")}var CC="Portal",by=L.forwardRef((e,r)=>{var E;const{container:a,...s}=e,[f,g]=L.useState(!1);Ts(()=>g(!0),[]);const y=a||f&&((E=globalThis==null?void 0:globalThis.document)==null?void 0:E.body);return y?b3.createPortal(F.jsx(Sn.div,{...s,ref:r}),y):null});by.displayName=CC;function SC(e,r){return L.useReducer((a,s)=>r[a][s]??a,e)}var Kl=e=>{const{present:r,children:a}=e,s=TC(r),f=typeof a=="function"?a({present:s.isPresent}):L.Children.only(a),g=Yn(s.ref,RC(f));return typeof a=="function"||s.isPresent?L.cloneElement(f,{ref:g}):null};Kl.displayName="Presence";function TC(e){const[r,a]=L.useState(),s=L.useRef(null),f=L.useRef(e),g=L.useRef("none"),y=e?"mounted":"unmounted",[E,A]=SC(y,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return L.useEffect(()=>{const b=vu(s.current);g.current=E==="mounted"?b:"none"},[E]),Ts(()=>{const b=s.current,T=f.current;if(T!==e){const S=g.current,R=vu(b);e?A("MOUNT"):R==="none"||(b==null?void 0:b.display)==="none"?A("UNMOUNT"):A(T&&S!==R?"ANIMATION_OUT":"UNMOUNT"),f.current=e}},[e,A]),Ts(()=>{if(r){let b;const T=r.ownerDocument.defaultView??window,x=R=>{const B=vu(s.current).includes(CSS.escape(R.animationName));if(R.target===r&&B&&(A("ANIMATION_END"),!f.current)){const P=r.style.animationFillMode;r.style.animationFillMode="forwards",b=T.setTimeout(()=>{r.style.animationFillMode==="forwards"&&(r.style.animationFillMode=P)})}},S=R=>{R.target===r&&(g.current=vu(s.current))};return r.addEventListener("animationstart",S),r.addEventListener("animationcancel",x),r.addEventListener("animationend",x),()=>{T.clearTimeout(b),r.removeEventListener("animationstart",S),r.removeEventListener("animationcancel",x),r.removeEventListener("animationend",x)}}else A("ANIMATION_END")},[r,A]),{isPresent:["mounted","unmountSuspended"].includes(E),ref:L.useCallback(b=>{s.current=b?getComputedStyle(b):null,a(b)},[])}}function vu(e){return(e==null?void 0:e.animationName)||"none"}function RC(e){var s,f;let r=(s=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:s.get,a=r&&"isReactWarning"in r&&r.isReactWarning;return a?e.ref:(r=(f=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:f.get,a=r&&"isReactWarning"in r&&r.isReactWarning,a?e.props.ref:e.props.ref||e.ref)}var Th=0;function NC(){L.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Qp()),document.body.insertAdjacentElement("beforeend",e[1]??Qp()),Th++,()=>{Th===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(r=>r.remove()),Th--}},[])}function Qp(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Si=function(){return Si=Object.assign||function(r){for(var a,s=1,f=arguments.length;s<f;s++){a=arguments[s];for(var g in a)Object.prototype.hasOwnProperty.call(a,g)&&(r[g]=a[g])}return r},Si.apply(this,arguments)};function _y(e,r){var a={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&r.indexOf(s)<0&&(a[s]=e[s]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var f=0,s=Object.getOwnPropertySymbols(e);f<s.length;f++)r.indexOf(s[f])<0&&Object.prototype.propertyIsEnumerable.call(e,s[f])&&(a[s[f]]=e[s[f]]);return a}function OC(e,r,a){if(a||arguments.length===2)for(var s=0,f=r.length,g;s<f;s++)(g||!(s in r))&&(g||(g=Array.prototype.slice.call(r,0,s)),g[s]=r[s]);return e.concat(g||Array.prototype.slice.call(r))}var Pu="right-scroll-bar-position",zu="width-before-scroll-bar",IC="with-scroll-bars-hidden",MC="--removed-body-scroll-bar-size";function Rh(e,r){return typeof e=="function"?e(r):e&&(e.current=r),e}function DC(e,r){var a=L.useState(function(){return{value:e,callback:r,facade:{get current(){return a.value},set current(s){var f=a.value;f!==s&&(a.value=s,a.callback(s,f))}}}})[0];return a.callback=r,a.facade}var BC=typeof window<"u"?L.useLayoutEffect:L.useEffect,Jp=new WeakMap;function kC(e,r){var a=DC(null,function(s){return e.forEach(function(f){return Rh(f,s)})});return BC(function(){var s=Jp.get(a);if(s){var f=new Set(s),g=new Set(e),y=a.current;f.forEach(function(E){g.has(E)||Rh(E,null)}),g.forEach(function(E){f.has(E)||Rh(E,y)})}Jp.set(a,e)},[e]),a}function LC(e){return e}function PC(e,r){r===void 0&&(r=LC);var a=[],s=!1,f={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:e},useMedium:function(g){var y=r(g,s);return a.push(y),function(){a=a.filter(function(E){return E!==y})}},assignSyncMedium:function(g){for(s=!0;a.length;){var y=a;a=[],y.forEach(g)}a={push:function(E){return g(E)},filter:function(){return a}}},assignMedium:function(g){s=!0;var y=[];if(a.length){var E=a;a=[],E.forEach(g),y=a}var A=function(){var T=y;y=[],T.forEach(g)},b=function(){return Promise.resolve().then(A)};b(),a={push:function(T){y.push(T),b()},filter:function(T){return y=y.filter(T),a}}}};return f}function zC(e){e===void 0&&(e={});var r=PC(null);return r.options=Si({async:!0,ssr:!1},e),r}var Ey=function(e){var r=e.sideCar,a=_y(e,["sideCar"]);if(!r)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=r.read();if(!s)throw new Error("Sidecar medium not found");return L.createElement(s,Si({},a))};Ey.isSideCarExport=!0;function UC(e,r){return e.useMedium(r),Ey}var Ay=zC(),Nh=function(){},af=L.forwardRef(function(e,r){var a=L.useRef(null),s=L.useState({onScrollCapture:Nh,onWheelCapture:Nh,onTouchMoveCapture:Nh}),f=s[0],g=s[1],y=e.forwardProps,E=e.children,A=e.className,b=e.removeScrollBar,T=e.enabled,x=e.shards,S=e.sideCar,R=e.noRelative,I=e.noIsolation,B=e.inert,P=e.allowPinchZoom,k=e.as,Z=k===void 0?"div":k,j=e.gapMode,H=_y(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),ee=S,Q=kC([a,r]),X=Si(Si({},H),f);return L.createElement(L.Fragment,null,T&&L.createElement(ee,{sideCar:Ay,removeScrollBar:b,shards:x,noRelative:R,noIsolation:I,inert:B,setCallbacks:g,allowPinchZoom:!!P,lockRef:a,gapMode:j}),y?L.cloneElement(L.Children.only(E),Si(Si({},X),{ref:Q})):L.createElement(Z,Si({},X,{className:A,ref:Q}),E))});af.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};af.classNames={fullWidth:zu,zeroRight:Pu};var FC=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function jC(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var r=FC();return r&&e.setAttribute("nonce",r),e}function VC(e,r){e.styleSheet?e.styleSheet.cssText=r:e.appendChild(document.createTextNode(r))}function HC(e){var r=document.head||document.getElementsByTagName("head")[0];r.appendChild(e)}var GC=function(){var e=0,r=null;return{add:function(a){e==0&&(r=jC())&&(VC(r,a),HC(r)),e++},remove:function(){e--,!e&&r&&(r.parentNode&&r.parentNode.removeChild(r),r=null)}}},ZC=function(){var e=GC();return function(r,a){L.useEffect(function(){return e.add(r),function(){e.remove()}},[r&&a])}},Cy=function(){var e=ZC(),r=function(a){var s=a.styles,f=a.dynamic;return e(s,f),null};return r},XC={left:0,top:0,right:0,gap:0},Oh=function(e){return parseInt(e||"",10)||0},YC=function(e){var r=window.getComputedStyle(document.body),a=r[e==="padding"?"paddingLeft":"marginLeft"],s=r[e==="padding"?"paddingTop":"marginTop"],f=r[e==="padding"?"paddingRight":"marginRight"];return[Oh(a),Oh(s),Oh(f)]},qC=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return XC;var r=YC(e),a=document.documentElement.clientWidth,s=window.innerWidth;return{left:r[0],top:r[1],right:r[2],gap:Math.max(0,s-a+r[2]-r[0])}},WC=Cy(),Cs="data-scroll-locked",KC=function(e,r,a,s){var f=e.left,g=e.top,y=e.right,E=e.gap;return a===void 0&&(a="margin"),`
179
- .`.concat(IC,` {
180
- overflow: hidden `).concat(s,`;
181
- padding-right: `).concat(E,"px ").concat(s,`;
182
- }
183
- body[`).concat(Cs,`] {
184
- overflow: hidden `).concat(s,`;
185
- overscroll-behavior: contain;
186
- `).concat([r&&"position: relative ".concat(s,";"),a==="margin"&&`
187
- padding-left: `.concat(f,`px;
188
- padding-top: `).concat(g,`px;
189
- padding-right: `).concat(y,`px;
190
- margin-left:0;
191
- margin-top:0;
192
- margin-right: `).concat(E,"px ").concat(s,`;
193
- `),a==="padding"&&"padding-right: ".concat(E,"px ").concat(s,";")].filter(Boolean).join(""),`
194
- }
195
-
196
- .`).concat(Pu,` {
197
- right: `).concat(E,"px ").concat(s,`;
198
- }
199
-
200
- .`).concat(zu,` {
201
- margin-right: `).concat(E,"px ").concat(s,`;
202
- }
203
-
204
- .`).concat(Pu," .").concat(Pu,` {
205
- right: 0 `).concat(s,`;
206
- }
207
-
208
- .`).concat(zu," .").concat(zu,` {
209
- margin-right: 0 `).concat(s,`;
210
- }
211
-
212
- body[`).concat(Cs,`] {
213
- `).concat(MC,": ").concat(E,`px;
214
- }
215
- `)},$p=function(){var e=parseInt(document.body.getAttribute(Cs)||"0",10);return isFinite(e)?e:0},QC=function(){L.useEffect(function(){return document.body.setAttribute(Cs,($p()+1).toString()),function(){var e=$p()-1;e<=0?document.body.removeAttribute(Cs):document.body.setAttribute(Cs,e.toString())}},[])},JC=function(e){var r=e.noRelative,a=e.noImportant,s=e.gapMode,f=s===void 0?"margin":s;QC();var g=L.useMemo(function(){return qC(f)},[f]);return L.createElement(WC,{styles:KC(g,!r,f,a?"":"!important")})},b0=!1;if(typeof window<"u")try{var wu=Object.defineProperty({},"passive",{get:function(){return b0=!0,!0}});window.addEventListener("test",wu,wu),window.removeEventListener("test",wu,wu)}catch{b0=!1}var xs=b0?{passive:!1}:!1,$C=function(e){return e.tagName==="TEXTAREA"},Sy=function(e,r){if(!(e instanceof Element))return!1;var a=window.getComputedStyle(e);return a[r]!=="hidden"&&!(a.overflowY===a.overflowX&&!$C(e)&&a[r]==="visible")},eS=function(e){return Sy(e,"overflowY")},tS=function(e){return Sy(e,"overflowX")},e2=function(e,r){var a=r.ownerDocument,s=r;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var f=Ty(e,s);if(f){var g=Ry(e,s),y=g[1],E=g[2];if(y>E)return!0}s=s.parentNode}while(s&&s!==a.body);return!1},nS=function(e){var r=e.scrollTop,a=e.scrollHeight,s=e.clientHeight;return[r,a,s]},rS=function(e){var r=e.scrollLeft,a=e.scrollWidth,s=e.clientWidth;return[r,a,s]},Ty=function(e,r){return e==="v"?eS(r):tS(r)},Ry=function(e,r){return e==="v"?nS(r):rS(r)},iS=function(e,r){return e==="h"&&r==="rtl"?-1:1},aS=function(e,r,a,s,f){var g=iS(e,window.getComputedStyle(r).direction),y=g*s,E=a.target,A=r.contains(E),b=!1,T=y>0,x=0,S=0;do{if(!E)break;var R=Ry(e,E),I=R[0],B=R[1],P=R[2],k=B-P-g*I;(I||k)&&Ty(e,E)&&(x+=k,S+=I);var Z=E.parentNode;E=Z&&Z.nodeType===Node.DOCUMENT_FRAGMENT_NODE?Z.host:Z}while(!A&&E!==document.body||A&&(r.contains(E)||r===E));return(T&&Math.abs(x)<1||!T&&Math.abs(S)<1)&&(b=!0),b},bu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},t2=function(e){return[e.deltaX,e.deltaY]},n2=function(e){return e&&"current"in e?e.current:e},oS=function(e,r){return e[0]===r[0]&&e[1]===r[1]},sS=function(e){return`
216
- .block-interactivity-`.concat(e,` {pointer-events: none;}
217
- .allow-interactivity-`).concat(e,` {pointer-events: all;}
218
- `)},lS=0,ys=[];function cS(e){var r=L.useRef([]),a=L.useRef([0,0]),s=L.useRef(),f=L.useState(lS++)[0],g=L.useState(Cy)[0],y=L.useRef(e);L.useEffect(function(){y.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(f));var B=OC([e.lockRef.current],(e.shards||[]).map(n2),!0).filter(Boolean);return B.forEach(function(P){return P.classList.add("allow-interactivity-".concat(f))}),function(){document.body.classList.remove("block-interactivity-".concat(f)),B.forEach(function(P){return P.classList.remove("allow-interactivity-".concat(f))})}}},[e.inert,e.lockRef.current,e.shards]);var E=L.useCallback(function(B,P){if("touches"in B&&B.touches.length===2||B.type==="wheel"&&B.ctrlKey)return!y.current.allowPinchZoom;var k=bu(B),Z=a.current,j="deltaX"in B?B.deltaX:Z[0]-k[0],H="deltaY"in B?B.deltaY:Z[1]-k[1],ee,Q=B.target,X=Math.abs(j)>Math.abs(H)?"h":"v";if("touches"in B&&X==="h"&&Q.type==="range")return!1;var de=e2(X,Q);if(!de)return!0;if(de?ee=X:(ee=X==="v"?"h":"v",de=e2(X,Q)),!de)return!1;if(!s.current&&"changedTouches"in B&&(j||H)&&(s.current=ee),!ee)return!0;var Y=s.current||ee;return aS(Y,P,B,Y==="h"?j:H)},[]),A=L.useCallback(function(B){var P=B;if(!(!ys.length||ys[ys.length-1]!==g)){var k="deltaY"in P?t2(P):bu(P),Z=r.current.filter(function(ee){return ee.name===P.type&&(ee.target===P.target||P.target===ee.shadowParent)&&oS(ee.delta,k)})[0];if(Z&&Z.should){P.cancelable&&P.preventDefault();return}if(!Z){var j=(y.current.shards||[]).map(n2).filter(Boolean).filter(function(ee){return ee.contains(P.target)}),H=j.length>0?E(P,j[0]):!y.current.noIsolation;H&&P.cancelable&&P.preventDefault()}}},[]),b=L.useCallback(function(B,P,k,Z){var j={name:B,delta:P,target:k,should:Z,shadowParent:uS(k)};r.current.push(j),setTimeout(function(){r.current=r.current.filter(function(H){return H!==j})},1)},[]),T=L.useCallback(function(B){a.current=bu(B),s.current=void 0},[]),x=L.useCallback(function(B){b(B.type,t2(B),B.target,E(B,e.lockRef.current))},[]),S=L.useCallback(function(B){b(B.type,bu(B),B.target,E(B,e.lockRef.current))},[]);L.useEffect(function(){return ys.push(g),e.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:S}),document.addEventListener("wheel",A,xs),document.addEventListener("touchmove",A,xs),document.addEventListener("touchstart",T,xs),function(){ys=ys.filter(function(B){return B!==g}),document.removeEventListener("wheel",A,xs),document.removeEventListener("touchmove",A,xs),document.removeEventListener("touchstart",T,xs)}},[]);var R=e.removeScrollBar,I=e.inert;return L.createElement(L.Fragment,null,I?L.createElement(g,{styles:sS(f)}):null,R?L.createElement(JC,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function uS(e){for(var r=null;e!==null;)e instanceof ShadowRoot&&(r=e.host,e=e.host),e=e.parentNode;return r}const fS=UC(Ay,cS);var Ny=L.forwardRef(function(e,r){return L.createElement(af,Si({},e,{ref:r,sideCar:fS}))});Ny.classNames=af.classNames;var dS=function(e){if(typeof document>"u")return null;var r=Array.isArray(e)?e[0]:e;return r.ownerDocument.body},vs=new WeakMap,_u=new WeakMap,Eu={},Ih=0,Oy=function(e){return e&&(e.host||Oy(e.parentNode))},hS=function(e,r){return r.map(function(a){if(e.contains(a))return a;var s=Oy(a);return s&&e.contains(s)?s:(console.error("aria-hidden",a,"in not contained inside",e,". Doing nothing"),null)}).filter(function(a){return!!a})},gS=function(e,r,a,s){var f=hS(r,Array.isArray(e)?e:[e]);Eu[a]||(Eu[a]=new WeakMap);var g=Eu[a],y=[],E=new Set,A=new Set(f),b=function(x){!x||E.has(x)||(E.add(x),b(x.parentNode))};f.forEach(b);var T=function(x){!x||A.has(x)||Array.prototype.forEach.call(x.children,function(S){if(E.has(S))T(S);else try{var R=S.getAttribute(s),I=R!==null&&R!=="false",B=(vs.get(S)||0)+1,P=(g.get(S)||0)+1;vs.set(S,B),g.set(S,P),y.push(S),B===1&&I&&_u.set(S,!0),P===1&&S.setAttribute(a,"true"),I||S.setAttribute(s,"true")}catch(k){console.error("aria-hidden: cannot operate on ",S,k)}})};return T(r),E.clear(),Ih++,function(){y.forEach(function(x){var S=vs.get(x)-1,R=g.get(x)-1;vs.set(x,S),g.set(x,R),S||(_u.has(x)||x.removeAttribute(s),_u.delete(x)),R||x.removeAttribute(a)}),Ih--,Ih||(vs=new WeakMap,vs=new WeakMap,_u=new WeakMap,Eu={})}},mS=function(e,r,a){a===void 0&&(a="data-aria-hidden");var s=Array.from(Array.isArray(e)?e:[e]),f=dS(e);return f?(s.push.apply(s,Array.from(f.querySelectorAll("[aria-live], script"))),gS(s,f,a,"aria-hidden")):function(){return null}},of="Dialog",[Iy]=Wl(of),[pS,fi]=Iy(of),My=e=>{const{__scopeDialog:r,children:a,open:s,defaultOpen:f,onOpenChange:g,modal:y=!0}=e,E=L.useRef(null),A=L.useRef(null),[b,T]=rf({prop:s,defaultProp:f??!1,onChange:g,caller:of});return F.jsx(pS,{scope:r,triggerRef:E,contentRef:A,contentId:jl(),titleId:jl(),descriptionId:jl(),open:b,onOpenChange:T,onOpenToggle:L.useCallback(()=>T(x=>!x),[T]),modal:y,children:a})};My.displayName=of;var Dy="DialogTrigger",xS=L.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=fi(Dy,a),g=Yn(r,f.triggerRef);return F.jsx(Sn.button,{type:"button","aria-haspopup":"dialog","aria-expanded":f.open,"aria-controls":f.contentId,"data-state":W0(f.open),...s,ref:g,onClick:tn(e.onClick,f.onOpenToggle)})});xS.displayName=Dy;var Y0="DialogPortal",[yS,By]=Iy(Y0,{forceMount:void 0}),ky=e=>{const{__scopeDialog:r,forceMount:a,children:s,container:f}=e,g=fi(Y0,r);return F.jsx(yS,{scope:r,forceMount:a,children:L.Children.map(s,y=>F.jsx(Kl,{present:a||g.open,children:F.jsx(by,{asChild:!0,container:f,children:y})}))})};ky.displayName=Y0;var Hu="DialogOverlay",Ly=L.forwardRef((e,r)=>{const a=By(Hu,e.__scopeDialog),{forceMount:s=a.forceMount,...f}=e,g=fi(Hu,e.__scopeDialog);return g.modal?F.jsx(Kl,{present:s||g.open,children:F.jsx(wS,{...f,ref:r})}):null});Ly.displayName=Hu;var vS=Vu("DialogOverlay.RemoveScroll"),wS=L.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=fi(Hu,a);return F.jsx(Ny,{as:vS,allowPinchZoom:!0,shards:[f.contentRef],children:F.jsx(Sn.div,{"data-state":W0(f.open),...s,ref:r,style:{pointerEvents:"auto",...s.style}})})}),So="DialogContent",Py=L.forwardRef((e,r)=>{const a=By(So,e.__scopeDialog),{forceMount:s=a.forceMount,...f}=e,g=fi(So,e.__scopeDialog);return F.jsx(Kl,{present:s||g.open,children:g.modal?F.jsx(bS,{...f,ref:r}):F.jsx(_S,{...f,ref:r})})});Py.displayName=So;var bS=L.forwardRef((e,r)=>{const a=fi(So,e.__scopeDialog),s=L.useRef(null),f=Yn(r,a.contentRef,s);return L.useEffect(()=>{const g=s.current;if(g)return mS(g)},[]),F.jsx(zy,{...e,ref:f,trapFocus:a.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:tn(e.onCloseAutoFocus,g=>{var y;g.preventDefault(),(y=a.triggerRef.current)==null||y.focus()}),onPointerDownOutside:tn(e.onPointerDownOutside,g=>{const y=g.detail.originalEvent,E=y.button===0&&y.ctrlKey===!0;(y.button===2||E)&&g.preventDefault()}),onFocusOutside:tn(e.onFocusOutside,g=>g.preventDefault())})}),_S=L.forwardRef((e,r)=>{const a=fi(So,e.__scopeDialog),s=L.useRef(!1),f=L.useRef(!1);return F.jsx(zy,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:g=>{var y,E;(y=e.onCloseAutoFocus)==null||y.call(e,g),g.defaultPrevented||(s.current||(E=a.triggerRef.current)==null||E.focus(),g.preventDefault()),s.current=!1,f.current=!1},onInteractOutside:g=>{var A,b;(A=e.onInteractOutside)==null||A.call(e,g),g.defaultPrevented||(s.current=!0,g.detail.originalEvent.type==="pointerdown"&&(f.current=!0));const y=g.target;((b=a.triggerRef.current)==null?void 0:b.contains(y))&&g.preventDefault(),g.detail.originalEvent.type==="focusin"&&f.current&&g.preventDefault()}})}),zy=L.forwardRef((e,r)=>{const{__scopeDialog:a,trapFocus:s,onOpenAutoFocus:f,onCloseAutoFocus:g,...y}=e,E=fi(So,a),A=L.useRef(null),b=Yn(r,A);return NC(),F.jsxs(F.Fragment,{children:[F.jsx(vy,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:f,onUnmountAutoFocus:g,children:F.jsx(xy,{role:"dialog",id:E.contentId,"aria-describedby":E.descriptionId,"aria-labelledby":E.titleId,"data-state":W0(E.open),...y,ref:b,onDismiss:()=>E.onOpenChange(!1)})}),F.jsxs(F.Fragment,{children:[F.jsx(ES,{titleId:E.titleId}),F.jsx(CS,{contentRef:A,descriptionId:E.descriptionId})]})]})}),q0="DialogTitle",Uy=L.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=fi(q0,a);return F.jsx(Sn.h2,{id:f.titleId,...s,ref:r})});Uy.displayName=q0;var Fy="DialogDescription",jy=L.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=fi(Fy,a);return F.jsx(Sn.p,{id:f.descriptionId,...s,ref:r})});jy.displayName=Fy;var Vy="DialogClose",Hy=L.forwardRef((e,r)=>{const{__scopeDialog:a,...s}=e,f=fi(Vy,a);return F.jsx(Sn.button,{type:"button",...s,ref:r,onClick:tn(e.onClick,()=>f.onOpenChange(!1))})});Hy.displayName=Vy;function W0(e){return e?"open":"closed"}var Gy="DialogTitleWarning",[D5,Zy]=KA(Gy,{contentName:So,titleName:q0,docsSlug:"dialog"}),ES=({titleId:e})=>{const r=Zy(Gy),a=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.
219
-
220
- If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.
221
-
222
- For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return L.useEffect(()=>{e&&(document.getElementById(e)||console.error(a))},[a,e]),null},AS="DialogDescriptionWarning",CS=({contentRef:e,descriptionId:r})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Zy(AS).contentName}}.`;return L.useEffect(()=>{var g;const f=(g=e.current)==null?void 0:g.getAttribute("aria-describedby");r&&f&&(document.getElementById(r)||console.warn(s))},[s,e,r]),null},SS=My,TS=ky,Xy=Ly,Yy=Py,qy=Uy,Wy=jy,RS=Hy;const NS=SS,OS=TS,Ky=L.forwardRef(({className:e,...r},a)=>F.jsx(Xy,{ref:a,className:Wt("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-99999 bg-black/80",e),...r}));Ky.displayName=Xy.displayName;const Qy=L.forwardRef(({className:e,children:r,...a},s)=>F.jsx(OS,{children:F.jsxs("div",{className:"dark",children:[F.jsx(Ky,{}),F.jsxs(Yy,{ref:s,className:Wt("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] fixed top-[50%] left-[50%] z-99999 w-full translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl border border-white p-6 shadow-lg duration-200",e),...a,children:[r,F.jsxs(RS,{className:"text-foreground ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[F.jsx(lA,{className:"h-4 w-4"}),F.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}));Qy.displayName=Yy.displayName;const Jy=({className:e,...r})=>F.jsx("div",{className:Wt("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Jy.displayName="DialogHeader";const $y=L.forwardRef(({className:e,...r},a)=>F.jsx(qy,{ref:a,className:Wt("text-lg leading-none font-semibold tracking-tight",e),...r}));$y.displayName=qy.displayName;const IS=L.forwardRef(({className:e,...r},a)=>F.jsx(Wy,{ref:a,className:Wt("text-muted-foreground text-sm",e),...r}));IS.displayName=Wy.displayName;const MS=({isOpen:e,onClose:r,getState:a,title:s="Debug State",updateInterval:f=100})=>{const[g,y]=L.useState(()=>a()),[E,A]=L.useState(!1);L.useEffect(()=>{if(!e)return;const x=setInterval(()=>{y(a())},f),S=setTimeout(()=>{y(a())},0);return()=>{clearInterval(x),clearTimeout(S)}},[e,a,f]);const b=JSON.stringify(g,null,2),T=async()=>{try{await navigator.clipboard.writeText(b),A(!0),setTimeout(()=>A(!1),2e3)}catch(x){console.error("Failed to copy:",x)}};return F.jsx(NS,{open:e,onOpenChange:r,children:F.jsxs(Qy,{className:"dark max-h-[90vh] max-w-2xl flex-col",children:[F.jsx(Jy,{children:F.jsx($y,{className:"text-foreground",children:s})}),F.jsxs("div",{className:"relative flex-1 overflow-auto pt-4",children:[F.jsx(Br,{variant:"ghost",size:"icon-sm",onClick:T,className:"text-muted-foreground hover:text-foreground absolute top-6 right-2 z-10","aria-label":"Copy state",children:E?F.jsx(ry,{className:"h-4 w-4"}):F.jsx(iy,{className:"h-4 w-4"})}),F.jsx("pre",{className:"bg-muted text-muted-foreground overflow-auto rounded-lg border p-4 font-mono text-xs",children:b})]})]})})},ev=({state:e,title:r="Debug State",updateInterval:a=100,className:s})=>{const[f,g]=L.useState(!1),[y,E]=L.useState(e);return L.useEffect(()=>{if(!f)return;const A=setInterval(()=>{E(e)},a);return E(e),()=>clearInterval(A)},[f,e,a]),F.jsxs(F.Fragment,{children:[F.jsx(Br,{type:"button",variant:"ghost",size:"icon",onClick:()=>g(!0),"aria-label":"Debug state",title:r,className:`text-white hover:bg-white/20 hover:text-white ${s||""}`,children:F.jsx(PE,{className:"h-4 w-4"})}),F.jsx(MS,{isOpen:f,onClose:()=>g(!1),getState:()=>y,title:r,updateInterval:a})]})};var ws={},Mh,r2;function DS(){return r2||(r2=1,Mh=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Mh}var Dh={},Za={},i2;function Ro(){if(i2)return Za;i2=1;let e;const r=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];return Za.getSymbolSize=function(s){if(!s)throw new Error('"version" cannot be null or undefined');if(s<1||s>40)throw new Error('"version" should be in range from 1 to 40');return s*4+17},Za.getSymbolTotalCodewords=function(s){return r[s]},Za.getBCHDigit=function(a){let s=0;for(;a!==0;)s++,a>>>=1;return s},Za.setToSJISFunction=function(s){if(typeof s!="function")throw new Error('"toSJISFunc" is not a valid function.');e=s},Za.isKanjiModeEnabled=function(){return typeof e<"u"},Za.toSJIS=function(s){return e(s)},Za}var Bh={},a2;function K0(){return a2||(a2=1,(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function r(a){if(typeof a!="string")throw new Error("Param is not a string");switch(a.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+a)}}e.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},e.from=function(s,f){if(e.isValid(s))return s;try{return r(s)}catch{return f}}})(Bh)),Bh}var kh,o2;function BS(){if(o2)return kh;o2=1;function e(){this.buffer=[],this.length=0}return e.prototype={get:function(r){const a=Math.floor(r/8);return(this.buffer[a]>>>7-r%8&1)===1},put:function(r,a){for(let s=0;s<a;s++)this.putBit((r>>>a-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){const a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),r&&(this.buffer[a]|=128>>>this.length%8),this.length++}},kh=e,kh}var Lh,s2;function kS(){if(s2)return Lh;s2=1;function e(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}return e.prototype.set=function(r,a,s,f){const g=r*this.size+a;this.data[g]=s,f&&(this.reservedBit[g]=!0)},e.prototype.get=function(r,a){return this.data[r*this.size+a]},e.prototype.xor=function(r,a,s){this.data[r*this.size+a]^=s},e.prototype.isReserved=function(r,a){return this.reservedBit[r*this.size+a]},Lh=e,Lh}var Ph={},l2;function LS(){return l2||(l2=1,(function(e){const r=Ro().getSymbolSize;e.getRowColCoords=function(s){if(s===1)return[];const f=Math.floor(s/7)+2,g=r(s),y=g===145?26:Math.ceil((g-13)/(2*f-2))*2,E=[g-7];for(let A=1;A<f-1;A++)E[A]=E[A-1]-y;return E.push(6),E.reverse()},e.getPositions=function(s){const f=[],g=e.getRowColCoords(s),y=g.length;for(let E=0;E<y;E++)for(let A=0;A<y;A++)E===0&&A===0||E===0&&A===y-1||E===y-1&&A===0||f.push([g[E],g[A]]);return f}})(Ph)),Ph}var zh={},c2;function PS(){if(c2)return zh;c2=1;const e=Ro().getSymbolSize,r=7;return zh.getPositions=function(s){const f=e(s);return[[0,0],[f-r,0],[0,f-r]]},zh}var Uh={},u2;function zS(){return u2||(u2=1,(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const r={N1:3,N2:3,N3:40,N4:10};e.isValid=function(f){return f!=null&&f!==""&&!isNaN(f)&&f>=0&&f<=7},e.from=function(f){return e.isValid(f)?parseInt(f,10):void 0},e.getPenaltyN1=function(f){const g=f.size;let y=0,E=0,A=0,b=null,T=null;for(let x=0;x<g;x++){E=A=0,b=T=null;for(let S=0;S<g;S++){let R=f.get(x,S);R===b?E++:(E>=5&&(y+=r.N1+(E-5)),b=R,E=1),R=f.get(S,x),R===T?A++:(A>=5&&(y+=r.N1+(A-5)),T=R,A=1)}E>=5&&(y+=r.N1+(E-5)),A>=5&&(y+=r.N1+(A-5))}return y},e.getPenaltyN2=function(f){const g=f.size;let y=0;for(let E=0;E<g-1;E++)for(let A=0;A<g-1;A++){const b=f.get(E,A)+f.get(E,A+1)+f.get(E+1,A)+f.get(E+1,A+1);(b===4||b===0)&&y++}return y*r.N2},e.getPenaltyN3=function(f){const g=f.size;let y=0,E=0,A=0;for(let b=0;b<g;b++){E=A=0;for(let T=0;T<g;T++)E=E<<1&2047|f.get(b,T),T>=10&&(E===1488||E===93)&&y++,A=A<<1&2047|f.get(T,b),T>=10&&(A===1488||A===93)&&y++}return y*r.N3},e.getPenaltyN4=function(f){let g=0;const y=f.data.length;for(let A=0;A<y;A++)g+=f.data[A];return Math.abs(Math.ceil(g*100/y/5)-10)*r.N4};function a(s,f,g){switch(s){case e.Patterns.PATTERN000:return(f+g)%2===0;case e.Patterns.PATTERN001:return f%2===0;case e.Patterns.PATTERN010:return g%3===0;case e.Patterns.PATTERN011:return(f+g)%3===0;case e.Patterns.PATTERN100:return(Math.floor(f/2)+Math.floor(g/3))%2===0;case e.Patterns.PATTERN101:return f*g%2+f*g%3===0;case e.Patterns.PATTERN110:return(f*g%2+f*g%3)%2===0;case e.Patterns.PATTERN111:return(f*g%3+(f+g)%2)%2===0;default:throw new Error("bad maskPattern:"+s)}}e.applyMask=function(f,g){const y=g.size;for(let E=0;E<y;E++)for(let A=0;A<y;A++)g.isReserved(A,E)||g.xor(A,E,a(f,A,E))},e.getBestMask=function(f,g){const y=Object.keys(e.Patterns).length;let E=0,A=1/0;for(let b=0;b<y;b++){g(b),e.applyMask(b,f);const T=e.getPenaltyN1(f)+e.getPenaltyN2(f)+e.getPenaltyN3(f)+e.getPenaltyN4(f);e.applyMask(b,f),T<A&&(A=T,E=b)}return E}})(Uh)),Uh}var Au={},f2;function tv(){if(f2)return Au;f2=1;const e=K0(),r=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],a=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Au.getBlocksCount=function(f,g){switch(g){case e.L:return r[(f-1)*4+0];case e.M:return r[(f-1)*4+1];case e.Q:return r[(f-1)*4+2];case e.H:return r[(f-1)*4+3];default:return}},Au.getTotalCodewordsCount=function(f,g){switch(g){case e.L:return a[(f-1)*4+0];case e.M:return a[(f-1)*4+1];case e.Q:return a[(f-1)*4+2];case e.H:return a[(f-1)*4+3];default:return}},Au}var Fh={},kl={},d2;function US(){if(d2)return kl;d2=1;const e=new Uint8Array(512),r=new Uint8Array(256);return(function(){let s=1;for(let f=0;f<255;f++)e[f]=s,r[s]=f,s<<=1,s&256&&(s^=285);for(let f=255;f<512;f++)e[f]=e[f-255]})(),kl.log=function(s){if(s<1)throw new Error("log("+s+")");return r[s]},kl.exp=function(s){return e[s]},kl.mul=function(s,f){return s===0||f===0?0:e[r[s]+r[f]]},kl}var h2;function FS(){return h2||(h2=1,(function(e){const r=US();e.mul=function(s,f){const g=new Uint8Array(s.length+f.length-1);for(let y=0;y<s.length;y++)for(let E=0;E<f.length;E++)g[y+E]^=r.mul(s[y],f[E]);return g},e.mod=function(s,f){let g=new Uint8Array(s);for(;g.length-f.length>=0;){const y=g[0];for(let A=0;A<f.length;A++)g[A]^=r.mul(f[A],y);let E=0;for(;E<g.length&&g[E]===0;)E++;g=g.slice(E)}return g},e.generateECPolynomial=function(s){let f=new Uint8Array([1]);for(let g=0;g<s;g++)f=e.mul(f,new Uint8Array([1,r.exp(g)]));return f}})(Fh)),Fh}var jh,g2;function jS(){if(g2)return jh;g2=1;const e=FS();function r(a){this.genPoly=void 0,this.degree=a,this.degree&&this.initialize(this.degree)}return r.prototype.initialize=function(s){this.degree=s,this.genPoly=e.generateECPolynomial(this.degree)},r.prototype.encode=function(s){if(!this.genPoly)throw new Error("Encoder not initialized");const f=new Uint8Array(s.length+this.degree);f.set(s);const g=e.mod(f,this.genPoly),y=this.degree-g.length;if(y>0){const E=new Uint8Array(this.degree);return E.set(g,y),E}return g},jh=r,jh}var Vh={},Hh={},Gh={},m2;function nv(){return m2||(m2=1,Gh.isValid=function(r){return!isNaN(r)&&r>=1&&r<=40}),Gh}var Ai={},p2;function rv(){if(p2)return Ai;p2=1;const e="[0-9]+",r="[A-Z $%*+\\-./:]+";let a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";a=a.replace(/u/g,"\\u");const s="(?:(?![A-Z0-9 $%*+\\-./:]|"+a+`)(?:.|[\r
223
- ]))+`;Ai.KANJI=new RegExp(a,"g"),Ai.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),Ai.BYTE=new RegExp(s,"g"),Ai.NUMERIC=new RegExp(e,"g"),Ai.ALPHANUMERIC=new RegExp(r,"g");const f=new RegExp("^"+a+"$"),g=new RegExp("^"+e+"$"),y=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return Ai.testKanji=function(A){return f.test(A)},Ai.testNumeric=function(A){return g.test(A)},Ai.testAlphanumeric=function(A){return y.test(A)},Ai}var x2;function No(){return x2||(x2=1,(function(e){const r=nv(),a=rv();e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(g,y){if(!g.ccBits)throw new Error("Invalid mode: "+g);if(!r.isValid(y))throw new Error("Invalid version: "+y);return y>=1&&y<10?g.ccBits[0]:y<27?g.ccBits[1]:g.ccBits[2]},e.getBestModeForData=function(g){return a.testNumeric(g)?e.NUMERIC:a.testAlphanumeric(g)?e.ALPHANUMERIC:a.testKanji(g)?e.KANJI:e.BYTE},e.toString=function(g){if(g&&g.id)return g.id;throw new Error("Invalid mode")},e.isValid=function(g){return g&&g.bit&&g.ccBits};function s(f){if(typeof f!="string")throw new Error("Param is not a string");switch(f.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+f)}}e.from=function(g,y){if(e.isValid(g))return g;try{return s(g)}catch{return y}}})(Hh)),Hh}var y2;function VS(){return y2||(y2=1,(function(e){const r=Ro(),a=tv(),s=K0(),f=No(),g=nv(),y=7973,E=r.getBCHDigit(y);function A(S,R,I){for(let B=1;B<=40;B++)if(R<=e.getCapacity(B,I,S))return B}function b(S,R){return f.getCharCountIndicator(S,R)+4}function T(S,R){let I=0;return S.forEach(function(B){const P=b(B.mode,R);I+=P+B.getBitsLength()}),I}function x(S,R){for(let I=1;I<=40;I++)if(T(S,I)<=e.getCapacity(I,R,f.MIXED))return I}e.from=function(R,I){return g.isValid(R)?parseInt(R,10):I},e.getCapacity=function(R,I,B){if(!g.isValid(R))throw new Error("Invalid QR Code version");typeof B>"u"&&(B=f.BYTE);const P=r.getSymbolTotalCodewords(R),k=a.getTotalCodewordsCount(R,I),Z=(P-k)*8;if(B===f.MIXED)return Z;const j=Z-b(B,R);switch(B){case f.NUMERIC:return Math.floor(j/10*3);case f.ALPHANUMERIC:return Math.floor(j/11*2);case f.KANJI:return Math.floor(j/13);case f.BYTE:default:return Math.floor(j/8)}},e.getBestVersionForData=function(R,I){let B;const P=s.from(I,s.M);if(Array.isArray(R)){if(R.length>1)return x(R,P);if(R.length===0)return 1;B=R[0]}else B=R;return A(B.mode,B.getLength(),P)},e.getEncodedBits=function(R){if(!g.isValid(R)||R<7)throw new Error("Invalid QR Code version");let I=R<<12;for(;r.getBCHDigit(I)-E>=0;)I^=y<<r.getBCHDigit(I)-E;return R<<12|I}})(Vh)),Vh}var Zh={},v2;function HS(){if(v2)return Zh;v2=1;const e=Ro(),r=1335,a=21522,s=e.getBCHDigit(r);return Zh.getEncodedBits=function(g,y){const E=g.bit<<3|y;let A=E<<10;for(;e.getBCHDigit(A)-s>=0;)A^=r<<e.getBCHDigit(A)-s;return(E<<10|A)^a},Zh}var Xh={},Yh,w2;function GS(){if(w2)return Yh;w2=1;const e=No();function r(a){this.mode=e.NUMERIC,this.data=a.toString()}return r.getBitsLength=function(s){return 10*Math.floor(s/3)+(s%3?s%3*3+1:0)},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(s){let f,g,y;for(f=0;f+3<=this.data.length;f+=3)g=this.data.substr(f,3),y=parseInt(g,10),s.put(y,10);const E=this.data.length-f;E>0&&(g=this.data.substr(f),y=parseInt(g,10),s.put(y,E*3+1))},Yh=r,Yh}var qh,b2;function ZS(){if(b2)return qh;b2=1;const e=No(),r=["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"," ","$","%","*","+","-",".","/",":"];function a(s){this.mode=e.ALPHANUMERIC,this.data=s}return a.getBitsLength=function(f){return 11*Math.floor(f/2)+6*(f%2)},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(f){let g;for(g=0;g+2<=this.data.length;g+=2){let y=r.indexOf(this.data[g])*45;y+=r.indexOf(this.data[g+1]),f.put(y,11)}this.data.length%2&&f.put(r.indexOf(this.data[g]),6)},qh=a,qh}var Wh,_2;function XS(){if(_2)return Wh;_2=1;const e=No();function r(a){this.mode=e.BYTE,typeof a=="string"?this.data=new TextEncoder().encode(a):this.data=new Uint8Array(a)}return r.getBitsLength=function(s){return s*8},r.prototype.getLength=function(){return this.data.length},r.prototype.getBitsLength=function(){return r.getBitsLength(this.data.length)},r.prototype.write=function(a){for(let s=0,f=this.data.length;s<f;s++)a.put(this.data[s],8)},Wh=r,Wh}var Kh,E2;function YS(){if(E2)return Kh;E2=1;const e=No(),r=Ro();function a(s){this.mode=e.KANJI,this.data=s}return a.getBitsLength=function(f){return f*13},a.prototype.getLength=function(){return this.data.length},a.prototype.getBitsLength=function(){return a.getBitsLength(this.data.length)},a.prototype.write=function(s){let f;for(f=0;f<this.data.length;f++){let g=r.toSJIS(this.data[f]);if(g>=33088&&g<=40956)g-=33088;else if(g>=57408&&g<=60351)g-=49472;else throw new Error("Invalid SJIS character: "+this.data[f]+`
224
- Make sure your charset is UTF-8`);g=(g>>>8&255)*192+(g&255),s.put(g,13)}},Kh=a,Kh}var Qh={exports:{}},A2;function qS(){return A2||(A2=1,(function(e){var r={single_source_shortest_paths:function(a,s,f){var g={},y={};y[s]=0;var E=r.PriorityQueue.make();E.push(s,0);for(var A,b,T,x,S,R,I,B,P;!E.empty();){A=E.pop(),b=A.value,x=A.cost,S=a[b]||{};for(T in S)S.hasOwnProperty(T)&&(R=S[T],I=x+R,B=y[T],P=typeof y[T]>"u",(P||B>I)&&(y[T]=I,E.push(T,I),g[T]=b))}if(typeof f<"u"&&typeof y[f]>"u"){var k=["Could not find a path from ",s," to ",f,"."].join("");throw new Error(k)}return g},extract_shortest_path_from_predecessor_list:function(a,s){for(var f=[],g=s;g;)f.push(g),a[g],g=a[g];return f.reverse(),f},find_path:function(a,s,f){var g=r.single_source_shortest_paths(a,s,f);return r.extract_shortest_path_from_predecessor_list(g,f)},PriorityQueue:{make:function(a){var s=r.PriorityQueue,f={},g;a=a||{};for(g in s)s.hasOwnProperty(g)&&(f[g]=s[g]);return f.queue=[],f.sorter=a.sorter||s.default_sorter,f},default_sorter:function(a,s){return a.cost-s.cost},push:function(a,s){var f={value:a,cost:s};this.queue.push(f),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=r})(Qh)),Qh.exports}var C2;function WS(){return C2||(C2=1,(function(e){const r=No(),a=GS(),s=ZS(),f=XS(),g=YS(),y=rv(),E=Ro(),A=qS();function b(k){return unescape(encodeURIComponent(k)).length}function T(k,Z,j){const H=[];let ee;for(;(ee=k.exec(j))!==null;)H.push({data:ee[0],index:ee.index,mode:Z,length:ee[0].length});return H}function x(k){const Z=T(y.NUMERIC,r.NUMERIC,k),j=T(y.ALPHANUMERIC,r.ALPHANUMERIC,k);let H,ee;return E.isKanjiModeEnabled()?(H=T(y.BYTE,r.BYTE,k),ee=T(y.KANJI,r.KANJI,k)):(H=T(y.BYTE_KANJI,r.BYTE,k),ee=[]),Z.concat(j,H,ee).sort(function(X,de){return X.index-de.index}).map(function(X){return{data:X.data,mode:X.mode,length:X.length}})}function S(k,Z){switch(Z){case r.NUMERIC:return a.getBitsLength(k);case r.ALPHANUMERIC:return s.getBitsLength(k);case r.KANJI:return g.getBitsLength(k);case r.BYTE:return f.getBitsLength(k)}}function R(k){return k.reduce(function(Z,j){const H=Z.length-1>=0?Z[Z.length-1]:null;return H&&H.mode===j.mode?(Z[Z.length-1].data+=j.data,Z):(Z.push(j),Z)},[])}function I(k){const Z=[];for(let j=0;j<k.length;j++){const H=k[j];switch(H.mode){case r.NUMERIC:Z.push([H,{data:H.data,mode:r.ALPHANUMERIC,length:H.length},{data:H.data,mode:r.BYTE,length:H.length}]);break;case r.ALPHANUMERIC:Z.push([H,{data:H.data,mode:r.BYTE,length:H.length}]);break;case r.KANJI:Z.push([H,{data:H.data,mode:r.BYTE,length:b(H.data)}]);break;case r.BYTE:Z.push([{data:H.data,mode:r.BYTE,length:b(H.data)}])}}return Z}function B(k,Z){const j={},H={start:{}};let ee=["start"];for(let Q=0;Q<k.length;Q++){const X=k[Q],de=[];for(let Y=0;Y<X.length;Y++){const we=X[Y],le=""+Q+Y;de.push(le),j[le]={node:we,lastCount:0},H[le]={};for(let te=0;te<ee.length;te++){const pe=ee[te];j[pe]&&j[pe].node.mode===we.mode?(H[pe][le]=S(j[pe].lastCount+we.length,we.mode)-S(j[pe].lastCount,we.mode),j[pe].lastCount+=we.length):(j[pe]&&(j[pe].lastCount=we.length),H[pe][le]=S(we.length,we.mode)+4+r.getCharCountIndicator(we.mode,Z))}}ee=de}for(let Q=0;Q<ee.length;Q++)H[ee[Q]].end=0;return{map:H,table:j}}function P(k,Z){let j;const H=r.getBestModeForData(k);if(j=r.from(Z,H),j!==r.BYTE&&j.bit<H.bit)throw new Error('"'+k+'" cannot be encoded with mode '+r.toString(j)+`.
225
- Suggested mode is: `+r.toString(H));switch(j===r.KANJI&&!E.isKanjiModeEnabled()&&(j=r.BYTE),j){case r.NUMERIC:return new a(k);case r.ALPHANUMERIC:return new s(k);case r.KANJI:return new g(k);case r.BYTE:return new f(k)}}e.fromArray=function(Z){return Z.reduce(function(j,H){return typeof H=="string"?j.push(P(H,null)):H.data&&j.push(P(H.data,H.mode)),j},[])},e.fromString=function(Z,j){const H=x(Z,E.isKanjiModeEnabled()),ee=I(H),Q=B(ee,j),X=A.find_path(Q.map,"start","end"),de=[];for(let Y=1;Y<X.length-1;Y++)de.push(Q.table[X[Y]].node);return e.fromArray(R(de))},e.rawSplit=function(Z){return e.fromArray(x(Z,E.isKanjiModeEnabled()))}})(Xh)),Xh}var S2;function KS(){if(S2)return Dh;S2=1;const e=Ro(),r=K0(),a=BS(),s=kS(),f=LS(),g=PS(),y=zS(),E=tv(),A=jS(),b=VS(),T=HS(),x=No(),S=WS();function R(Q,X){const de=Q.size,Y=g.getPositions(X);for(let we=0;we<Y.length;we++){const le=Y[we][0],te=Y[we][1];for(let pe=-1;pe<=7;pe++)if(!(le+pe<=-1||de<=le+pe))for(let Te=-1;Te<=7;Te++)te+Te<=-1||de<=te+Te||(pe>=0&&pe<=6&&(Te===0||Te===6)||Te>=0&&Te<=6&&(pe===0||pe===6)||pe>=2&&pe<=4&&Te>=2&&Te<=4?Q.set(le+pe,te+Te,!0,!0):Q.set(le+pe,te+Te,!1,!0))}}function I(Q){const X=Q.size;for(let de=8;de<X-8;de++){const Y=de%2===0;Q.set(de,6,Y,!0),Q.set(6,de,Y,!0)}}function B(Q,X){const de=f.getPositions(X);for(let Y=0;Y<de.length;Y++){const we=de[Y][0],le=de[Y][1];for(let te=-2;te<=2;te++)for(let pe=-2;pe<=2;pe++)te===-2||te===2||pe===-2||pe===2||te===0&&pe===0?Q.set(we+te,le+pe,!0,!0):Q.set(we+te,le+pe,!1,!0)}}function P(Q,X){const de=Q.size,Y=b.getEncodedBits(X);let we,le,te;for(let pe=0;pe<18;pe++)we=Math.floor(pe/3),le=pe%3+de-8-3,te=(Y>>pe&1)===1,Q.set(we,le,te,!0),Q.set(le,we,te,!0)}function k(Q,X,de){const Y=Q.size,we=T.getEncodedBits(X,de);let le,te;for(le=0;le<15;le++)te=(we>>le&1)===1,le<6?Q.set(le,8,te,!0):le<8?Q.set(le+1,8,te,!0):Q.set(Y-15+le,8,te,!0),le<8?Q.set(8,Y-le-1,te,!0):le<9?Q.set(8,15-le-1+1,te,!0):Q.set(8,15-le-1,te,!0);Q.set(Y-8,8,1,!0)}function Z(Q,X){const de=Q.size;let Y=-1,we=de-1,le=7,te=0;for(let pe=de-1;pe>0;pe-=2)for(pe===6&&pe--;;){for(let Te=0;Te<2;Te++)if(!Q.isReserved(we,pe-Te)){let ie=!1;te<X.length&&(ie=(X[te]>>>le&1)===1),Q.set(we,pe-Te,ie),le--,le===-1&&(te++,le=7)}if(we+=Y,we<0||de<=we){we-=Y,Y=-Y;break}}}function j(Q,X,de){const Y=new a;de.forEach(function(Te){Y.put(Te.mode.bit,4),Y.put(Te.getLength(),x.getCharCountIndicator(Te.mode,Q)),Te.write(Y)});const we=e.getSymbolTotalCodewords(Q),le=E.getTotalCodewordsCount(Q,X),te=(we-le)*8;for(Y.getLengthInBits()+4<=te&&Y.put(0,4);Y.getLengthInBits()%8!==0;)Y.putBit(0);const pe=(te-Y.getLengthInBits())/8;for(let Te=0;Te<pe;Te++)Y.put(Te%2?17:236,8);return H(Y,Q,X)}function H(Q,X,de){const Y=e.getSymbolTotalCodewords(X),we=E.getTotalCodewordsCount(X,de),le=Y-we,te=E.getBlocksCount(X,de),pe=Y%te,Te=te-pe,ie=Math.floor(Y/te),re=Math.floor(le/te),xe=re+1,Me=ie-re,He=new A(Me);let qe=0;const K=new Array(te),oe=new Array(te);let Re=0;const Ie=new Uint8Array(Q.buffer);for(let pt=0;pt<te;pt++){const Wn=pt<Te?re:xe;K[pt]=Ie.slice(qe,qe+Wn),oe[pt]=He.encode(K[pt]),qe+=Wn,Re=Math.max(Re,Wn)}const Ue=new Uint8Array(Y);let Ce=0,Ye,Qe;for(Ye=0;Ye<Re;Ye++)for(Qe=0;Qe<te;Qe++)Ye<K[Qe].length&&(Ue[Ce++]=K[Qe][Ye]);for(Ye=0;Ye<Me;Ye++)for(Qe=0;Qe<te;Qe++)Ue[Ce++]=oe[Qe][Ye];return Ue}function ee(Q,X,de,Y){let we;if(Array.isArray(Q))we=S.fromArray(Q);else if(typeof Q=="string"){let ie=X;if(!ie){const re=S.rawSplit(Q);ie=b.getBestVersionForData(re,de)}we=S.fromString(Q,ie||40)}else throw new Error("Invalid data");const le=b.getBestVersionForData(we,de);if(!le)throw new Error("The amount of data is too big to be stored in a QR Code");if(!X)X=le;else if(X<le)throw new Error(`
226
- The chosen QR Code version cannot contain this amount of data.
227
- Minimum version required to store current data is: `+le+`.
228
- `);const te=j(X,de,we),pe=e.getSymbolSize(X),Te=new s(pe);return R(Te,X),I(Te),B(Te,X),k(Te,de,0),X>=7&&P(Te,X),Z(Te,te),isNaN(Y)&&(Y=y.getBestMask(Te,k.bind(null,Te,de))),y.applyMask(Y,Te),k(Te,de,Y),{modules:Te,version:X,errorCorrectionLevel:de,maskPattern:Y,segments:we}}return Dh.create=function(X,de){if(typeof X>"u"||X==="")throw new Error("No input text");let Y=r.M,we,le;return typeof de<"u"&&(Y=r.from(de.errorCorrectionLevel,r.M),we=b.from(de.version),le=y.from(de.maskPattern),de.toSJISFunc&&e.setToSJISFunction(de.toSJISFunc)),ee(X,we,Y,le)},Dh}var Jh={},$h={},T2;function iv(){return T2||(T2=1,(function(e){function r(a){if(typeof a=="number"&&(a=a.toString()),typeof a!="string")throw new Error("Color should be defined as hex string");let s=a.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+a);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(g){return[g,g]}))),s.length===6&&s.push("F","F");const f=parseInt(s.join(""),16);return{r:f>>24&255,g:f>>16&255,b:f>>8&255,a:f&255,hex:"#"+s.slice(0,6).join("")}}e.getOptions=function(s){s||(s={}),s.color||(s.color={});const f=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,g=s.width&&s.width>=21?s.width:void 0,y=s.scale||4;return{width:g,scale:g?4:y,margin:f,color:{dark:r(s.color.dark||"#000000ff"),light:r(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},e.getScale=function(s,f){return f.width&&f.width>=s+f.margin*2?f.width/(s+f.margin*2):f.scale},e.getImageWidth=function(s,f){const g=e.getScale(s,f);return Math.floor((s+f.margin*2)*g)},e.qrToImageData=function(s,f,g){const y=f.modules.size,E=f.modules.data,A=e.getScale(y,g),b=Math.floor((y+g.margin*2)*A),T=g.margin*A,x=[g.color.light,g.color.dark];for(let S=0;S<b;S++)for(let R=0;R<b;R++){let I=(S*b+R)*4,B=g.color.light;if(S>=T&&R>=T&&S<b-T&&R<b-T){const P=Math.floor((S-T)/A),k=Math.floor((R-T)/A);B=x[E[P*y+k]?1:0]}s[I++]=B.r,s[I++]=B.g,s[I++]=B.b,s[I]=B.a}}})($h)),$h}var R2;function QS(){return R2||(R2=1,(function(e){const r=iv();function a(f,g,y){f.clearRect(0,0,g.width,g.height),g.style||(g.style={}),g.height=y,g.width=y,g.style.height=y+"px",g.style.width=y+"px"}function s(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(g,y,E){let A=E,b=y;typeof A>"u"&&(!y||!y.getContext)&&(A=y,y=void 0),y||(b=s()),A=r.getOptions(A);const T=r.getImageWidth(g.modules.size,A),x=b.getContext("2d"),S=x.createImageData(T,T);return r.qrToImageData(S.data,g,A),a(x,b,T),x.putImageData(S,0,0),b},e.renderToDataURL=function(g,y,E){let A=E;typeof A>"u"&&(!y||!y.getContext)&&(A=y,y=void 0),A||(A={});const b=e.render(g,y,A),T=A.type||"image/png",x=A.rendererOpts||{};return b.toDataURL(T,x.quality)}})(Jh)),Jh}var e0={},N2;function JS(){if(N2)return e0;N2=1;const e=iv();function r(f,g){const y=f.a/255,E=g+'="'+f.hex+'"';return y<1?E+" "+g+'-opacity="'+y.toFixed(2).slice(1)+'"':E}function a(f,g,y){let E=f+g;return typeof y<"u"&&(E+=" "+y),E}function s(f,g,y){let E="",A=0,b=!1,T=0;for(let x=0;x<f.length;x++){const S=Math.floor(x%g),R=Math.floor(x/g);!S&&!b&&(b=!0),f[x]?(T++,x>0&&S>0&&f[x-1]||(E+=b?a("M",S+y,.5+R+y):a("m",A,0),A=0,b=!1),S+1<g&&f[x+1]||(E+=a("h",T),T=0)):A++}return E}return e0.render=function(g,y,E){const A=e.getOptions(y),b=g.modules.size,T=g.modules.data,x=b+A.margin*2,S=A.color.light.a?"<path "+r(A.color.light,"fill")+' d="M0 0h'+x+"v"+x+'H0z"/>':"",R="<path "+r(A.color.dark,"stroke")+' d="'+s(T,b,A.margin)+'"/>',I='viewBox="0 0 '+x+" "+x+'"',P='<svg xmlns="http://www.w3.org/2000/svg" '+(A.width?'width="'+A.width+'" height="'+A.width+'" ':"")+I+' shape-rendering="crispEdges">'+S+R+`</svg>
229
- `;return typeof E=="function"&&E(null,P),P},e0}var O2;function $S(){if(O2)return ws;O2=1;const e=DS(),r=KS(),a=QS(),s=JS();function f(g,y,E,A,b){const T=[].slice.call(arguments,1),x=T.length,S=typeof T[x-1]=="function";if(!S&&!e())throw new Error("Callback required as last argument");if(S){if(x<2)throw new Error("Too few arguments provided");x===2?(b=E,E=y,y=A=void 0):x===3&&(y.getContext&&typeof b>"u"?(b=A,A=void 0):(b=A,A=E,E=y,y=void 0))}else{if(x<1)throw new Error("Too few arguments provided");return x===1?(E=y,y=A=void 0):x===2&&!y.getContext&&(A=E,E=y,y=void 0),new Promise(function(R,I){try{const B=r.create(E,A);R(g(B,y,A))}catch(B){I(B)}})}try{const R=r.create(E,A);b(null,g(R,y,A))}catch(R){b(R)}}return ws.create=r.create,ws.toCanvas=f.bind(null,a.render),ws.toDataURL=f.bind(null,a.renderToDataURL),ws.toString=f.bind(null,function(g,y,E){return s.render(g,E)}),ws}var e4=$S();const t4=Qu(e4);function _e(e,r,a){function s(E,A){if(E._zod||Object.defineProperty(E,"_zod",{value:{def:A,constr:y,traits:new Set},enumerable:!1}),E._zod.traits.has(e))return;E._zod.traits.add(e),r(E,A);const b=y.prototype,T=Object.keys(b);for(let x=0;x<T.length;x++){const S=T[x];S in E||(E[S]=b[S].bind(E))}}const f=(a==null?void 0:a.Parent)??Object;class g extends f{}Object.defineProperty(g,"name",{value:e});function y(E){var A;const b=a!=null&&a.Parent?new g:this;s(b,E),(A=b._zod).deferred??(A.deferred=[]);for(const T of b._zod.deferred)T();return b}return Object.defineProperty(y,"init",{value:s}),Object.defineProperty(y,Symbol.hasInstance,{value:E=>{var A,b;return a!=null&&a.Parent&&E instanceof a.Parent?!0:(b=(A=E==null?void 0:E._zod)==null?void 0:A.traits)==null?void 0:b.has(e)}}),Object.defineProperty(y,"name",{value:e}),y}class Ss extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class av extends Error{constructor(r){super(`Encountered unidirectional transform during encode: ${r}`),this.name="ZodEncodeError"}}const ov={};function qa(e){return ov}function sv(e){const r=Object.values(e).filter(s=>typeof s=="number");return Object.entries(e).filter(([s,f])=>r.indexOf(+s)===-1).map(([s,f])=>f)}function _0(e,r){return typeof r=="bigint"?r.toString():r}function Q0(e){return{get value(){{const r=e();return Object.defineProperty(this,"value",{value:r}),r}}}}function J0(e){return e==null}function $0(e){const r=e.startsWith("^")?1:0,a=e.endsWith("$")?e.length-1:e.length;return e.slice(r,a)}function n4(e,r){const a=(e.toString().split(".")[1]||"").length,s=r.toString();let f=(s.split(".")[1]||"").length;if(f===0&&/\d?e-\d?/.test(s)){const A=s.match(/\d?e-(\d?)/);A!=null&&A[1]&&(f=Number.parseInt(A[1]))}const g=a>f?a:f,y=Number.parseInt(e.toFixed(g).replace(".","")),E=Number.parseInt(r.toFixed(g).replace(".",""));return y%E/10**g}const I2=Symbol("evaluating");function Vt(e,r,a){let s;Object.defineProperty(e,r,{get(){if(s!==I2)return s===void 0&&(s=I2,s=a()),s},set(f){Object.defineProperty(e,r,{value:f})},configurable:!0})}function Oo(e,r,a){Object.defineProperty(e,r,{value:a,writable:!0,enumerable:!0,configurable:!0})}function Io(...e){const r={};for(const a of e){const s=Object.getOwnPropertyDescriptors(a);Object.assign(r,s)}return Object.defineProperties({},r)}function M2(e){return JSON.stringify(e)}function r4(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}const lv="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Gu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const i4=Q0(()=>{var e;if(typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)!=null&&e.includes("Cloudflare")))return!1;try{const r=Function;return new r(""),!0}catch{return!1}});function Ns(e){if(Gu(e)===!1)return!1;const r=e.constructor;if(r===void 0||typeof r!="function")return!0;const a=r.prototype;return!(Gu(a)===!1||Object.prototype.hasOwnProperty.call(a,"isPrototypeOf")===!1)}function cv(e){return Ns(e)?{...e}:Array.isArray(e)?[...e]:e}const a4=new Set(["string","number","symbol"]);function sf(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ka(e,r,a){const s=new e._zod.constr(r??e._zod.def);return(!r||a!=null&&a.parent)&&(s._zod.parent=e),s}function Ve(e){const r=e;if(!r)return{};if(typeof r=="string")return{error:()=>r};if((r==null?void 0:r.message)!==void 0){if((r==null?void 0:r.error)!==void 0)throw new Error("Cannot specify both `message` and `error` params");r.error=r.message}return delete r.message,typeof r.error=="string"?{...r,error:()=>r.error}:r}function o4(e){return Object.keys(e).filter(r=>e[r]._zod.optin==="optional"&&e[r]._zod.optout==="optional")}const s4={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function l4(e,r){const a=e._zod.def,s=Io(e._zod.def,{get shape(){const f={};for(const g in r){if(!(g in a.shape))throw new Error(`Unrecognized key: "${g}"`);r[g]&&(f[g]=a.shape[g])}return Oo(this,"shape",f),f},checks:[]});return Ka(e,s)}function c4(e,r){const a=e._zod.def,s=Io(e._zod.def,{get shape(){const f={...e._zod.def.shape};for(const g in r){if(!(g in a.shape))throw new Error(`Unrecognized key: "${g}"`);r[g]&&delete f[g]}return Oo(this,"shape",f),f},checks:[]});return Ka(e,s)}function u4(e,r){if(!Ns(r))throw new Error("Invalid input to extend: expected a plain object");const a=e._zod.def.checks;if(a&&a.length>0)throw new Error("Object schemas containing refinements cannot be extended. Use `.safeExtend()` instead.");const f=Io(e._zod.def,{get shape(){const g={...e._zod.def.shape,...r};return Oo(this,"shape",g),g},checks:[]});return Ka(e,f)}function f4(e,r){if(!Ns(r))throw new Error("Invalid input to safeExtend: expected a plain object");const a={...e._zod.def,get shape(){const s={...e._zod.def.shape,...r};return Oo(this,"shape",s),s},checks:e._zod.def.checks};return Ka(e,a)}function d4(e,r){const a=Io(e._zod.def,{get shape(){const s={...e._zod.def.shape,...r._zod.def.shape};return Oo(this,"shape",s),s},get catchall(){return r._zod.def.catchall},checks:[]});return Ka(e,a)}function h4(e,r,a){const s=Io(r._zod.def,{get shape(){const f=r._zod.def.shape,g={...f};if(a)for(const y in a){if(!(y in f))throw new Error(`Unrecognized key: "${y}"`);a[y]&&(g[y]=e?new e({type:"optional",innerType:f[y]}):f[y])}else for(const y in f)g[y]=e?new e({type:"optional",innerType:f[y]}):f[y];return Oo(this,"shape",g),g},checks:[]});return Ka(r,s)}function g4(e,r,a){const s=Io(r._zod.def,{get shape(){const f=r._zod.def.shape,g={...f};if(a)for(const y in a){if(!(y in g))throw new Error(`Unrecognized key: "${y}"`);a[y]&&(g[y]=new e({type:"nonoptional",innerType:f[y]}))}else for(const y in f)g[y]=new e({type:"nonoptional",innerType:f[y]});return Oo(this,"shape",g),g},checks:[]});return Ka(r,s)}function bs(e,r=0){var a;if(e.aborted===!0)return!0;for(let s=r;s<e.issues.length;s++)if(((a=e.issues[s])==null?void 0:a.continue)!==!0)return!0;return!1}function _s(e,r){return r.map(a=>{var s;return(s=a).path??(s.path=[]),a.path.unshift(e),a})}function Cu(e){return typeof e=="string"?e:e==null?void 0:e.message}function Wa(e,r,a){var f,g,y,E,A,b;const s={...e,path:e.path??[]};if(!e.message){const T=Cu((y=(g=(f=e.inst)==null?void 0:f._zod.def)==null?void 0:g.error)==null?void 0:y.call(g,e))??Cu((E=r==null?void 0:r.error)==null?void 0:E.call(r,e))??Cu((A=a.customError)==null?void 0:A.call(a,e))??Cu((b=a.localeError)==null?void 0:b.call(a,e))??"Invalid input";s.message=T}return delete s.inst,delete s.continue,r!=null&&r.reportInput||delete s.input,s}function e1(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function Hl(...e){const[r,a,s]=e;return typeof r=="string"?{message:r,code:"custom",input:a,inst:s}:{...r}}const uv=(e,r)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:r,enumerable:!1}),e.message=JSON.stringify(r,_0,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},fv=_e("$ZodError",uv),dv=_e("$ZodError",uv,{Parent:Error});function m4(e,r=a=>a.message){const a={},s=[];for(const f of e.issues)f.path.length>0?(a[f.path[0]]=a[f.path[0]]||[],a[f.path[0]].push(r(f))):s.push(r(f));return{formErrors:s,fieldErrors:a}}function p4(e,r=a=>a.message){const a={_errors:[]},s=f=>{for(const g of f.issues)if(g.code==="invalid_union"&&g.errors.length)g.errors.map(y=>s({issues:y}));else if(g.code==="invalid_key")s({issues:g.issues});else if(g.code==="invalid_element")s({issues:g.issues});else if(g.path.length===0)a._errors.push(r(g));else{let y=a,E=0;for(;E<g.path.length;){const A=g.path[E];E===g.path.length-1?(y[A]=y[A]||{_errors:[]},y[A]._errors.push(r(g))):y[A]=y[A]||{_errors:[]},y=y[A],E++}}};return s(e),a}const t1=e=>(r,a,s,f)=>{const g=s?Object.assign(s,{async:!1}):{async:!1},y=r._zod.run({value:a,issues:[]},g);if(y instanceof Promise)throw new Ss;if(y.issues.length){const E=new((f==null?void 0:f.Err)??e)(y.issues.map(A=>Wa(A,g,qa())));throw lv(E,f==null?void 0:f.callee),E}return y.value},n1=e=>async(r,a,s,f)=>{const g=s?Object.assign(s,{async:!0}):{async:!0};let y=r._zod.run({value:a,issues:[]},g);if(y instanceof Promise&&(y=await y),y.issues.length){const E=new((f==null?void 0:f.Err)??e)(y.issues.map(A=>Wa(A,g,qa())));throw lv(E,f==null?void 0:f.callee),E}return y.value},lf=e=>(r,a,s)=>{const f=s?{...s,async:!1}:{async:!1},g=r._zod.run({value:a,issues:[]},f);if(g instanceof Promise)throw new Ss;return g.issues.length?{success:!1,error:new(e??fv)(g.issues.map(y=>Wa(y,f,qa())))}:{success:!0,data:g.value}},x4=lf(dv),cf=e=>async(r,a,s)=>{const f=s?Object.assign(s,{async:!0}):{async:!0};let g=r._zod.run({value:a,issues:[]},f);return g instanceof Promise&&(g=await g),g.issues.length?{success:!1,error:new e(g.issues.map(y=>Wa(y,f,qa())))}:{success:!0,data:g.value}},y4=cf(dv),v4=e=>(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return t1(e)(r,a,f)},w4=e=>(r,a,s)=>t1(e)(r,a,s),b4=e=>async(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return n1(e)(r,a,f)},_4=e=>async(r,a,s)=>n1(e)(r,a,s),E4=e=>(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return lf(e)(r,a,f)},A4=e=>(r,a,s)=>lf(e)(r,a,s),C4=e=>async(r,a,s)=>{const f=s?Object.assign(s,{direction:"backward"}):{direction:"backward"};return cf(e)(r,a,f)},S4=e=>async(r,a,s)=>cf(e)(r,a,s),T4=/^[cC][^\s-]{8,}$/,R4=/^[0-9a-z]+$/,N4=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,O4=/^[0-9a-vA-V]{20}$/,I4=/^[A-Za-z0-9]{27}$/,M4=/^[a-zA-Z0-9_-]{21}$/,D4=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,B4=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,D2=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,k4=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,L4="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function P4(){return new RegExp(L4,"u")}const z4=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,U4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,F4=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,j4=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,V4=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,hv=/^[A-Za-z0-9_-]*$/,H4=/^\+(?:[0-9]){6,14}[0-9]$/,gv="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",G4=new RegExp(`^${gv}$`);function mv(e){const r="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${r}`:e.precision===0?`${r}:[0-5]\\d`:`${r}:[0-5]\\d\\.\\d{${e.precision}}`:`${r}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Z4(e){return new RegExp(`^${mv(e)}$`)}function X4(e){const r=mv({precision:e.precision}),a=["Z"];e.local&&a.push(""),e.offset&&a.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");const s=`${r}(?:${a.join("|")})`;return new RegExp(`^${gv}T(?:${s})$`)}const Y4=e=>{const r=e?`[\\s\\S]{${(e==null?void 0:e.minimum)??0},${(e==null?void 0:e.maximum)??""}}`:"[\\s\\S]*";return new RegExp(`^${r}$`)},q4=/^-?\d+$/,W4=/^-?\d+(?:\.\d+)?/,K4=/^(?:true|false)$/i,Q4=/^[^A-Z]*$/,J4=/^[^a-z]*$/,yr=_e("$ZodCheck",(e,r)=>{var a;e._zod??(e._zod={}),e._zod.def=r,(a=e._zod).onattach??(a.onattach=[])}),pv={number:"number",bigint:"bigint",object:"date"},xv=_e("$ZodCheckLessThan",(e,r)=>{yr.init(e,r);const a=pv[typeof r.value];e._zod.onattach.push(s=>{const f=s._zod.bag,g=(r.inclusive?f.maximum:f.exclusiveMaximum)??Number.POSITIVE_INFINITY;r.value<g&&(r.inclusive?f.maximum=r.value:f.exclusiveMaximum=r.value)}),e._zod.check=s=>{(r.inclusive?s.value<=r.value:s.value<r.value)||s.issues.push({origin:a,code:"too_big",maximum:r.value,input:s.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),yv=_e("$ZodCheckGreaterThan",(e,r)=>{yr.init(e,r);const a=pv[typeof r.value];e._zod.onattach.push(s=>{const f=s._zod.bag,g=(r.inclusive?f.minimum:f.exclusiveMinimum)??Number.NEGATIVE_INFINITY;r.value>g&&(r.inclusive?f.minimum=r.value:f.exclusiveMinimum=r.value)}),e._zod.check=s=>{(r.inclusive?s.value>=r.value:s.value>r.value)||s.issues.push({origin:a,code:"too_small",minimum:r.value,input:s.value,inclusive:r.inclusive,inst:e,continue:!r.abort})}}),$4=_e("$ZodCheckMultipleOf",(e,r)=>{yr.init(e,r),e._zod.onattach.push(a=>{var s;(s=a._zod.bag).multipleOf??(s.multipleOf=r.value)}),e._zod.check=a=>{if(typeof a.value!=typeof r.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof a.value=="bigint"?a.value%r.value===BigInt(0):n4(a.value,r.value)===0)||a.issues.push({origin:typeof a.value,code:"not_multiple_of",divisor:r.value,input:a.value,inst:e,continue:!r.abort})}}),e8=_e("$ZodCheckNumberFormat",(e,r)=>{var y;yr.init(e,r),r.format=r.format||"float64";const a=(y=r.format)==null?void 0:y.includes("int"),s=a?"int":"number",[f,g]=s4[r.format];e._zod.onattach.push(E=>{const A=E._zod.bag;A.format=r.format,A.minimum=f,A.maximum=g,a&&(A.pattern=q4)}),e._zod.check=E=>{const A=E.value;if(a){if(!Number.isInteger(A)){E.issues.push({expected:s,format:r.format,code:"invalid_type",continue:!1,input:A,inst:e});return}if(!Number.isSafeInteger(A)){A>0?E.issues.push({input:A,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!r.abort}):E.issues.push({input:A,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:s,continue:!r.abort});return}}A<f&&E.issues.push({origin:"number",input:A,code:"too_small",minimum:f,inclusive:!0,inst:e,continue:!r.abort}),A>g&&E.issues.push({origin:"number",input:A,code:"too_big",maximum:g,inst:e})}}),t8=_e("$ZodCheckMaxLength",(e,r)=>{var a;yr.init(e,r),(a=e._zod.def).when??(a.when=s=>{const f=s.value;return!J0(f)&&f.length!==void 0}),e._zod.onattach.push(s=>{const f=s._zod.bag.maximum??Number.POSITIVE_INFINITY;r.maximum<f&&(s._zod.bag.maximum=r.maximum)}),e._zod.check=s=>{const f=s.value;if(f.length<=r.maximum)return;const y=e1(f);s.issues.push({origin:y,code:"too_big",maximum:r.maximum,inclusive:!0,input:f,inst:e,continue:!r.abort})}}),n8=_e("$ZodCheckMinLength",(e,r)=>{var a;yr.init(e,r),(a=e._zod.def).when??(a.when=s=>{const f=s.value;return!J0(f)&&f.length!==void 0}),e._zod.onattach.push(s=>{const f=s._zod.bag.minimum??Number.NEGATIVE_INFINITY;r.minimum>f&&(s._zod.bag.minimum=r.minimum)}),e._zod.check=s=>{const f=s.value;if(f.length>=r.minimum)return;const y=e1(f);s.issues.push({origin:y,code:"too_small",minimum:r.minimum,inclusive:!0,input:f,inst:e,continue:!r.abort})}}),r8=_e("$ZodCheckLengthEquals",(e,r)=>{var a;yr.init(e,r),(a=e._zod.def).when??(a.when=s=>{const f=s.value;return!J0(f)&&f.length!==void 0}),e._zod.onattach.push(s=>{const f=s._zod.bag;f.minimum=r.length,f.maximum=r.length,f.length=r.length}),e._zod.check=s=>{const f=s.value,g=f.length;if(g===r.length)return;const y=e1(f),E=g>r.length;s.issues.push({origin:y,...E?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},inclusive:!0,exact:!0,input:s.value,inst:e,continue:!r.abort})}}),uf=_e("$ZodCheckStringFormat",(e,r)=>{var a,s;yr.init(e,r),e._zod.onattach.push(f=>{const g=f._zod.bag;g.format=r.format,r.pattern&&(g.patterns??(g.patterns=new Set),g.patterns.add(r.pattern))}),r.pattern?(a=e._zod).check??(a.check=f=>{r.pattern.lastIndex=0,!r.pattern.test(f.value)&&f.issues.push({origin:"string",code:"invalid_format",format:r.format,input:f.value,...r.pattern?{pattern:r.pattern.toString()}:{},inst:e,continue:!r.abort})}):(s=e._zod).check??(s.check=()=>{})}),i8=_e("$ZodCheckRegex",(e,r)=>{uf.init(e,r),e._zod.check=a=>{r.pattern.lastIndex=0,!r.pattern.test(a.value)&&a.issues.push({origin:"string",code:"invalid_format",format:"regex",input:a.value,pattern:r.pattern.toString(),inst:e,continue:!r.abort})}}),a8=_e("$ZodCheckLowerCase",(e,r)=>{r.pattern??(r.pattern=Q4),uf.init(e,r)}),o8=_e("$ZodCheckUpperCase",(e,r)=>{r.pattern??(r.pattern=J4),uf.init(e,r)}),s8=_e("$ZodCheckIncludes",(e,r)=>{yr.init(e,r);const a=sf(r.includes),s=new RegExp(typeof r.position=="number"?`^.{${r.position}}${a}`:a);r.pattern=s,e._zod.onattach.push(f=>{const g=f._zod.bag;g.patterns??(g.patterns=new Set),g.patterns.add(s)}),e._zod.check=f=>{f.value.includes(r.includes,r.position)||f.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:r.includes,input:f.value,inst:e,continue:!r.abort})}}),l8=_e("$ZodCheckStartsWith",(e,r)=>{yr.init(e,r);const a=new RegExp(`^${sf(r.prefix)}.*`);r.pattern??(r.pattern=a),e._zod.onattach.push(s=>{const f=s._zod.bag;f.patterns??(f.patterns=new Set),f.patterns.add(a)}),e._zod.check=s=>{s.value.startsWith(r.prefix)||s.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:r.prefix,input:s.value,inst:e,continue:!r.abort})}}),c8=_e("$ZodCheckEndsWith",(e,r)=>{yr.init(e,r);const a=new RegExp(`.*${sf(r.suffix)}$`);r.pattern??(r.pattern=a),e._zod.onattach.push(s=>{const f=s._zod.bag;f.patterns??(f.patterns=new Set),f.patterns.add(a)}),e._zod.check=s=>{s.value.endsWith(r.suffix)||s.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:r.suffix,input:s.value,inst:e,continue:!r.abort})}}),u8=_e("$ZodCheckOverwrite",(e,r)=>{yr.init(e,r),e._zod.check=a=>{a.value=r.tx(a.value)}});class f8{constructor(r=[]){this.content=[],this.indent=0,this&&(this.args=r)}indented(r){this.indent+=1,r(this),this.indent-=1}write(r){if(typeof r=="function"){r(this,{execution:"sync"}),r(this,{execution:"async"});return}const s=r.split(`
230
- `).filter(y=>y),f=Math.min(...s.map(y=>y.length-y.trimStart().length)),g=s.map(y=>y.slice(f)).map(y=>" ".repeat(this.indent*2)+y);for(const y of g)this.content.push(y)}compile(){const r=Function,a=this==null?void 0:this.args,f=[...((this==null?void 0:this.content)??[""]).map(g=>` ${g}`)];return new r(...a,f.join(`
231
- `))}}const d8={major:4,minor:2,patch:1},fn=_e("$ZodType",(e,r)=>{var f;var a;e??(e={}),e._zod.def=r,e._zod.bag=e._zod.bag||{},e._zod.version=d8;const s=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&s.unshift(e);for(const g of s)for(const y of g._zod.onattach)y(e);if(s.length===0)(a=e._zod).deferred??(a.deferred=[]),(f=e._zod.deferred)==null||f.push(()=>{e._zod.run=e._zod.parse});else{const g=(E,A,b)=>{let T=bs(E),x;for(const S of A){if(S._zod.def.when){if(!S._zod.def.when(E))continue}else if(T)continue;const R=E.issues.length,I=S._zod.check(E);if(I instanceof Promise&&(b==null?void 0:b.async)===!1)throw new Ss;if(x||I instanceof Promise)x=(x??Promise.resolve()).then(async()=>{await I,E.issues.length!==R&&(T||(T=bs(E,R)))});else{if(E.issues.length===R)continue;T||(T=bs(E,R))}}return x?x.then(()=>E):E},y=(E,A,b)=>{if(bs(E))return E.aborted=!0,E;const T=g(A,s,b);if(T instanceof Promise){if(b.async===!1)throw new Ss;return T.then(x=>e._zod.parse(x,b))}return e._zod.parse(T,b)};e._zod.run=(E,A)=>{if(A.skipChecks)return e._zod.parse(E,A);if(A.direction==="backward"){const T=e._zod.parse({value:E.value,issues:[]},{...A,skipChecks:!0});return T instanceof Promise?T.then(x=>y(x,E,A)):y(T,E,A)}const b=e._zod.parse(E,A);if(b instanceof Promise){if(A.async===!1)throw new Ss;return b.then(T=>g(T,s,A))}return g(b,s,A)}}e["~standard"]={validate:g=>{var y;try{const E=x4(e,g);return E.success?{value:E.data}:{issues:(y=E.error)==null?void 0:y.issues}}catch{return y4(e,g).then(A=>{var b;return A.success?{value:A.data}:{issues:(b=A.error)==null?void 0:b.issues}})}},vendor:"zod",version:1}}),r1=_e("$ZodString",(e,r)=>{var a;fn.init(e,r),e._zod.pattern=[...((a=e==null?void 0:e._zod.bag)==null?void 0:a.patterns)??[]].pop()??Y4(e._zod.bag),e._zod.parse=(s,f)=>{if(r.coerce)try{s.value=String(s.value)}catch{}return typeof s.value=="string"||s.issues.push({expected:"string",code:"invalid_type",input:s.value,inst:e}),s}}),$t=_e("$ZodStringFormat",(e,r)=>{uf.init(e,r),r1.init(e,r)}),h8=_e("$ZodGUID",(e,r)=>{r.pattern??(r.pattern=B4),$t.init(e,r)}),g8=_e("$ZodUUID",(e,r)=>{if(r.version){const s={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[r.version];if(s===void 0)throw new Error(`Invalid UUID version: "${r.version}"`);r.pattern??(r.pattern=D2(s))}else r.pattern??(r.pattern=D2());$t.init(e,r)}),m8=_e("$ZodEmail",(e,r)=>{r.pattern??(r.pattern=k4),$t.init(e,r)}),p8=_e("$ZodURL",(e,r)=>{$t.init(e,r),e._zod.check=a=>{try{const s=a.value.trim(),f=new URL(s);r.hostname&&(r.hostname.lastIndex=0,r.hostname.test(f.hostname)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:r.hostname.source,input:a.value,inst:e,continue:!r.abort})),r.protocol&&(r.protocol.lastIndex=0,r.protocol.test(f.protocol.endsWith(":")?f.protocol.slice(0,-1):f.protocol)||a.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:r.protocol.source,input:a.value,inst:e,continue:!r.abort})),r.normalize?a.value=f.href:a.value=s;return}catch{a.issues.push({code:"invalid_format",format:"url",input:a.value,inst:e,continue:!r.abort})}}}),x8=_e("$ZodEmoji",(e,r)=>{r.pattern??(r.pattern=P4()),$t.init(e,r)}),y8=_e("$ZodNanoID",(e,r)=>{r.pattern??(r.pattern=M4),$t.init(e,r)}),v8=_e("$ZodCUID",(e,r)=>{r.pattern??(r.pattern=T4),$t.init(e,r)}),w8=_e("$ZodCUID2",(e,r)=>{r.pattern??(r.pattern=R4),$t.init(e,r)}),b8=_e("$ZodULID",(e,r)=>{r.pattern??(r.pattern=N4),$t.init(e,r)}),_8=_e("$ZodXID",(e,r)=>{r.pattern??(r.pattern=O4),$t.init(e,r)}),E8=_e("$ZodKSUID",(e,r)=>{r.pattern??(r.pattern=I4),$t.init(e,r)}),A8=_e("$ZodISODateTime",(e,r)=>{r.pattern??(r.pattern=X4(r)),$t.init(e,r)}),C8=_e("$ZodISODate",(e,r)=>{r.pattern??(r.pattern=G4),$t.init(e,r)}),S8=_e("$ZodISOTime",(e,r)=>{r.pattern??(r.pattern=Z4(r)),$t.init(e,r)}),T8=_e("$ZodISODuration",(e,r)=>{r.pattern??(r.pattern=D4),$t.init(e,r)}),R8=_e("$ZodIPv4",(e,r)=>{r.pattern??(r.pattern=z4),$t.init(e,r),e._zod.bag.format="ipv4"}),N8=_e("$ZodIPv6",(e,r)=>{r.pattern??(r.pattern=U4),$t.init(e,r),e._zod.bag.format="ipv6",e._zod.check=a=>{try{new URL(`http://[${a.value}]`)}catch{a.issues.push({code:"invalid_format",format:"ipv6",input:a.value,inst:e,continue:!r.abort})}}}),O8=_e("$ZodCIDRv4",(e,r)=>{r.pattern??(r.pattern=F4),$t.init(e,r)}),I8=_e("$ZodCIDRv6",(e,r)=>{r.pattern??(r.pattern=j4),$t.init(e,r),e._zod.check=a=>{const s=a.value.split("/");try{if(s.length!==2)throw new Error;const[f,g]=s;if(!g)throw new Error;const y=Number(g);if(`${y}`!==g)throw new Error;if(y<0||y>128)throw new Error;new URL(`http://[${f}]`)}catch{a.issues.push({code:"invalid_format",format:"cidrv6",input:a.value,inst:e,continue:!r.abort})}}});function vv(e){if(e==="")return!0;if(e.length%4!==0)return!1;try{return atob(e),!0}catch{return!1}}const M8=_e("$ZodBase64",(e,r)=>{r.pattern??(r.pattern=V4),$t.init(e,r),e._zod.bag.contentEncoding="base64",e._zod.check=a=>{vv(a.value)||a.issues.push({code:"invalid_format",format:"base64",input:a.value,inst:e,continue:!r.abort})}});function D8(e){if(!hv.test(e))return!1;const r=e.replace(/[-_]/g,s=>s==="-"?"+":"/"),a=r.padEnd(Math.ceil(r.length/4)*4,"=");return vv(a)}const B8=_e("$ZodBase64URL",(e,r)=>{r.pattern??(r.pattern=hv),$t.init(e,r),e._zod.bag.contentEncoding="base64url",e._zod.check=a=>{D8(a.value)||a.issues.push({code:"invalid_format",format:"base64url",input:a.value,inst:e,continue:!r.abort})}}),k8=_e("$ZodE164",(e,r)=>{r.pattern??(r.pattern=H4),$t.init(e,r)});function L8(e,r=null){try{const a=e.split(".");if(a.length!==3)return!1;const[s]=a;if(!s)return!1;const f=JSON.parse(atob(s));return!("typ"in f&&(f==null?void 0:f.typ)!=="JWT"||!f.alg||r&&(!("alg"in f)||f.alg!==r))}catch{return!1}}const P8=_e("$ZodJWT",(e,r)=>{$t.init(e,r),e._zod.check=a=>{L8(a.value,r.alg)||a.issues.push({code:"invalid_format",format:"jwt",input:a.value,inst:e,continue:!r.abort})}}),wv=_e("$ZodNumber",(e,r)=>{fn.init(e,r),e._zod.pattern=e._zod.bag.pattern??W4,e._zod.parse=(a,s)=>{if(r.coerce)try{a.value=Number(a.value)}catch{}const f=a.value;if(typeof f=="number"&&!Number.isNaN(f)&&Number.isFinite(f))return a;const g=typeof f=="number"?Number.isNaN(f)?"NaN":Number.isFinite(f)?void 0:"Infinity":void 0;return a.issues.push({expected:"number",code:"invalid_type",input:f,inst:e,...g?{received:g}:{}}),a}}),z8=_e("$ZodNumberFormat",(e,r)=>{e8.init(e,r),wv.init(e,r)}),U8=_e("$ZodBoolean",(e,r)=>{fn.init(e,r),e._zod.pattern=K4,e._zod.parse=(a,s)=>{if(r.coerce)try{a.value=!!a.value}catch{}const f=a.value;return typeof f=="boolean"||a.issues.push({expected:"boolean",code:"invalid_type",input:f,inst:e}),a}}),F8=_e("$ZodUnknown",(e,r)=>{fn.init(e,r),e._zod.parse=a=>a}),j8=_e("$ZodNever",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>(a.issues.push({expected:"never",code:"invalid_type",input:a.value,inst:e}),a)});function B2(e,r,a){e.issues.length&&r.issues.push(..._s(a,e.issues)),r.value[a]=e.value}const V8=_e("$ZodArray",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{const f=a.value;if(!Array.isArray(f))return a.issues.push({expected:"array",code:"invalid_type",input:f,inst:e}),a;a.value=Array(f.length);const g=[];for(let y=0;y<f.length;y++){const E=f[y],A=r.element._zod.run({value:E,issues:[]},s);A instanceof Promise?g.push(A.then(b=>B2(b,a,y))):B2(A,a,y)}return g.length?Promise.all(g).then(()=>a):a}});function Zu(e,r,a,s){e.issues.length&&r.issues.push(..._s(a,e.issues)),e.value===void 0?a in s&&(r.value[a]=void 0):r.value[a]=e.value}function bv(e){var s,f,g,y;const r=Object.keys(e.shape);for(const E of r)if(!((y=(g=(f=(s=e.shape)==null?void 0:s[E])==null?void 0:f._zod)==null?void 0:g.traits)!=null&&y.has("$ZodType")))throw new Error(`Invalid element at key "${E}": expected a Zod schema`);const a=o4(e.shape);return{...e,keys:r,keySet:new Set(r),numKeys:r.length,optionalKeys:new Set(a)}}function _v(e,r,a,s,f,g){const y=[],E=f.keySet,A=f.catchall._zod,b=A.def.type;for(const T in r){if(E.has(T))continue;if(b==="never"){y.push(T);continue}const x=A.run({value:r[T],issues:[]},s);x instanceof Promise?e.push(x.then(S=>Zu(S,a,T,r))):Zu(x,a,T,r)}return y.length&&a.issues.push({code:"unrecognized_keys",keys:y,input:r,inst:g}),e.length?Promise.all(e).then(()=>a):a}const H8=_e("$ZodObject",(e,r)=>{fn.init(e,r);const a=Object.getOwnPropertyDescriptor(r,"shape");if(!(a!=null&&a.get)){const E=r.shape;Object.defineProperty(r,"shape",{get:()=>{const A={...E};return Object.defineProperty(r,"shape",{value:A}),A}})}const s=Q0(()=>bv(r));Vt(e._zod,"propValues",()=>{const E=r.shape,A={};for(const b in E){const T=E[b]._zod;if(T.values){A[b]??(A[b]=new Set);for(const x of T.values)A[b].add(x)}}return A});const f=Gu,g=r.catchall;let y;e._zod.parse=(E,A)=>{y??(y=s.value);const b=E.value;if(!f(b))return E.issues.push({expected:"object",code:"invalid_type",input:b,inst:e}),E;E.value={};const T=[],x=y.shape;for(const S of y.keys){const I=x[S]._zod.run({value:b[S],issues:[]},A);I instanceof Promise?T.push(I.then(B=>Zu(B,E,S,b))):Zu(I,E,S,b)}return g?_v(T,b,E,A,s.value,e):T.length?Promise.all(T).then(()=>E):E}}),G8=_e("$ZodObjectJIT",(e,r)=>{H8.init(e,r);const a=e._zod.parse,s=Q0(()=>bv(r)),f=S=>{const R=new f8(["shape","payload","ctx"]),I=s.value,B=j=>{const H=M2(j);return`shape[${H}]._zod.run({ value: input[${H}], issues: [] }, ctx)`};R.write("const input = payload.value;");const P=Object.create(null);let k=0;for(const j of I.keys)P[j]=`key_${k++}`;R.write("const newResult = {};");for(const j of I.keys){const H=P[j],ee=M2(j);R.write(`const ${H} = ${B(j)};`),R.write(`
232
- if (${H}.issues.length) {
233
- payload.issues = payload.issues.concat(${H}.issues.map(iss => ({
234
- ...iss,
235
- path: iss.path ? [${ee}, ...iss.path] : [${ee}]
236
- })));
237
- }
238
-
239
-
240
- if (${H}.value === undefined) {
241
- if (${ee} in input) {
242
- newResult[${ee}] = undefined;
243
- }
244
- } else {
245
- newResult[${ee}] = ${H}.value;
246
- }
247
-
248
- `)}R.write("payload.value = newResult;"),R.write("return payload;");const Z=R.compile();return(j,H)=>Z(S,j,H)};let g;const y=Gu,E=!ov.jitless,b=E&&i4.value,T=r.catchall;let x;e._zod.parse=(S,R)=>{x??(x=s.value);const I=S.value;return y(I)?E&&b&&(R==null?void 0:R.async)===!1&&R.jitless!==!0?(g||(g=f(r.shape)),S=g(S,R),T?_v([],I,S,R,x,e):S):a(S,R):(S.issues.push({expected:"object",code:"invalid_type",input:I,inst:e}),S)}});function k2(e,r,a,s){for(const g of e)if(g.issues.length===0)return r.value=g.value,r;const f=e.filter(g=>!bs(g));return f.length===1?(r.value=f[0].value,f[0]):(r.issues.push({code:"invalid_union",input:r.value,inst:a,errors:e.map(g=>g.issues.map(y=>Wa(y,s,qa())))}),r)}const Z8=_e("$ZodUnion",(e,r)=>{fn.init(e,r),Vt(e._zod,"optin",()=>r.options.some(f=>f._zod.optin==="optional")?"optional":void 0),Vt(e._zod,"optout",()=>r.options.some(f=>f._zod.optout==="optional")?"optional":void 0),Vt(e._zod,"values",()=>{if(r.options.every(f=>f._zod.values))return new Set(r.options.flatMap(f=>Array.from(f._zod.values)))}),Vt(e._zod,"pattern",()=>{if(r.options.every(f=>f._zod.pattern)){const f=r.options.map(g=>g._zod.pattern);return new RegExp(`^(${f.map(g=>$0(g.source)).join("|")})$`)}});const a=r.options.length===1,s=r.options[0]._zod.run;e._zod.parse=(f,g)=>{if(a)return s(f,g);let y=!1;const E=[];for(const A of r.options){const b=A._zod.run({value:f.value,issues:[]},g);if(b instanceof Promise)E.push(b),y=!0;else{if(b.issues.length===0)return b;E.push(b)}}return y?Promise.all(E).then(A=>k2(A,f,e,g)):k2(E,f,e,g)}}),X8=_e("$ZodIntersection",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{const f=a.value,g=r.left._zod.run({value:f,issues:[]},s),y=r.right._zod.run({value:f,issues:[]},s);return g instanceof Promise||y instanceof Promise?Promise.all([g,y]).then(([A,b])=>L2(a,A,b)):L2(a,g,y)}});function E0(e,r){if(e===r)return{valid:!0,data:e};if(e instanceof Date&&r instanceof Date&&+e==+r)return{valid:!0,data:e};if(Ns(e)&&Ns(r)){const a=Object.keys(r),s=Object.keys(e).filter(g=>a.indexOf(g)!==-1),f={...e,...r};for(const g of s){const y=E0(e[g],r[g]);if(!y.valid)return{valid:!1,mergeErrorPath:[g,...y.mergeErrorPath]};f[g]=y.data}return{valid:!0,data:f}}if(Array.isArray(e)&&Array.isArray(r)){if(e.length!==r.length)return{valid:!1,mergeErrorPath:[]};const a=[];for(let s=0;s<e.length;s++){const f=e[s],g=r[s],y=E0(f,g);if(!y.valid)return{valid:!1,mergeErrorPath:[s,...y.mergeErrorPath]};a.push(y.data)}return{valid:!0,data:a}}return{valid:!1,mergeErrorPath:[]}}function L2(e,r,a){if(r.issues.length&&e.issues.push(...r.issues),a.issues.length&&e.issues.push(...a.issues),bs(e))return e;const s=E0(r.value,a.value);if(!s.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}const Y8=_e("$ZodRecord",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{const f=a.value;if(!Ns(f))return a.issues.push({expected:"record",code:"invalid_type",input:f,inst:e}),a;const g=[],y=r.keyType._zod.values;if(y){a.value={};const E=new Set;for(const b of y)if(typeof b=="string"||typeof b=="number"||typeof b=="symbol"){E.add(typeof b=="number"?b.toString():b);const T=r.valueType._zod.run({value:f[b],issues:[]},s);T instanceof Promise?g.push(T.then(x=>{x.issues.length&&a.issues.push(..._s(b,x.issues)),a.value[b]=x.value})):(T.issues.length&&a.issues.push(..._s(b,T.issues)),a.value[b]=T.value)}let A;for(const b in f)E.has(b)||(A=A??[],A.push(b));A&&A.length>0&&a.issues.push({code:"unrecognized_keys",input:f,inst:e,keys:A})}else{a.value={};for(const E of Reflect.ownKeys(f)){if(E==="__proto__")continue;const A=r.keyType._zod.run({value:E,issues:[]},s);if(A instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(A.issues.length){r.mode==="loose"?a.value[E]=f[E]:a.issues.push({code:"invalid_key",origin:"record",issues:A.issues.map(T=>Wa(T,s,qa())),input:E,path:[E],inst:e});continue}const b=r.valueType._zod.run({value:f[E],issues:[]},s);b instanceof Promise?g.push(b.then(T=>{T.issues.length&&a.issues.push(..._s(E,T.issues)),a.value[A.value]=T.value})):(b.issues.length&&a.issues.push(..._s(E,b.issues)),a.value[A.value]=b.value)}}return g.length?Promise.all(g).then(()=>a):a}}),q8=_e("$ZodEnum",(e,r)=>{fn.init(e,r);const a=sv(r.entries),s=new Set(a);e._zod.values=s,e._zod.pattern=new RegExp(`^(${a.filter(f=>a4.has(typeof f)).map(f=>typeof f=="string"?sf(f):f.toString()).join("|")})$`),e._zod.parse=(f,g)=>{const y=f.value;return s.has(y)||f.issues.push({code:"invalid_value",values:a,input:y,inst:e}),f}}),W8=_e("$ZodTransform",(e,r)=>{fn.init(e,r),e._zod.parse=(a,s)=>{if(s.direction==="backward")throw new av(e.constructor.name);const f=r.transform(a.value,a);if(s.async)return(f instanceof Promise?f:Promise.resolve(f)).then(y=>(a.value=y,a));if(f instanceof Promise)throw new Ss;return a.value=f,a}});function P2(e,r){return e.issues.length&&r===void 0?{issues:[],value:void 0}:e}const K8=_e("$ZodOptional",(e,r)=>{fn.init(e,r),e._zod.optin="optional",e._zod.optout="optional",Vt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,void 0]):void 0),Vt(e._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${$0(a.source)})?$`):void 0}),e._zod.parse=(a,s)=>{if(r.innerType._zod.optin==="optional"){const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>P2(g,a.value)):P2(f,a.value)}return a.value===void 0?a:r.innerType._zod.run(a,s)}}),Q8=_e("$ZodNullable",(e,r)=>{fn.init(e,r),Vt(e._zod,"optin",()=>r.innerType._zod.optin),Vt(e._zod,"optout",()=>r.innerType._zod.optout),Vt(e._zod,"pattern",()=>{const a=r.innerType._zod.pattern;return a?new RegExp(`^(${$0(a.source)}|null)$`):void 0}),Vt(e._zod,"values",()=>r.innerType._zod.values?new Set([...r.innerType._zod.values,null]):void 0),e._zod.parse=(a,s)=>a.value===null?a:r.innerType._zod.run(a,s)}),J8=_e("$ZodDefault",(e,r)=>{fn.init(e,r),e._zod.optin="optional",Vt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(a,s)=>{if(s.direction==="backward")return r.innerType._zod.run(a,s);if(a.value===void 0)return a.value=r.defaultValue,a;const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>z2(g,r)):z2(f,r)}});function z2(e,r){return e.value===void 0&&(e.value=r.defaultValue),e}const $8=_e("$ZodPrefault",(e,r)=>{fn.init(e,r),e._zod.optin="optional",Vt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(a,s)=>(s.direction==="backward"||a.value===void 0&&(a.value=r.defaultValue),r.innerType._zod.run(a,s))}),eT=_e("$ZodNonOptional",(e,r)=>{fn.init(e,r),Vt(e._zod,"values",()=>{const a=r.innerType._zod.values;return a?new Set([...a].filter(s=>s!==void 0)):void 0}),e._zod.parse=(a,s)=>{const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>U2(g,e)):U2(f,e)}});function U2(e,r){return!e.issues.length&&e.value===void 0&&e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:r}),e}const tT=_e("$ZodCatch",(e,r)=>{fn.init(e,r),Vt(e._zod,"optin",()=>r.innerType._zod.optin),Vt(e._zod,"optout",()=>r.innerType._zod.optout),Vt(e._zod,"values",()=>r.innerType._zod.values),e._zod.parse=(a,s)=>{if(s.direction==="backward")return r.innerType._zod.run(a,s);const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(g=>(a.value=g.value,g.issues.length&&(a.value=r.catchValue({...a,error:{issues:g.issues.map(y=>Wa(y,s,qa()))},input:a.value}),a.issues=[]),a)):(a.value=f.value,f.issues.length&&(a.value=r.catchValue({...a,error:{issues:f.issues.map(g=>Wa(g,s,qa()))},input:a.value}),a.issues=[]),a)}}),nT=_e("$ZodPipe",(e,r)=>{fn.init(e,r),Vt(e._zod,"values",()=>r.in._zod.values),Vt(e._zod,"optin",()=>r.in._zod.optin),Vt(e._zod,"optout",()=>r.out._zod.optout),Vt(e._zod,"propValues",()=>r.in._zod.propValues),e._zod.parse=(a,s)=>{if(s.direction==="backward"){const g=r.out._zod.run(a,s);return g instanceof Promise?g.then(y=>Su(y,r.in,s)):Su(g,r.in,s)}const f=r.in._zod.run(a,s);return f instanceof Promise?f.then(g=>Su(g,r.out,s)):Su(f,r.out,s)}});function Su(e,r,a){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:e.value,issues:e.issues},a)}const rT=_e("$ZodReadonly",(e,r)=>{fn.init(e,r),Vt(e._zod,"propValues",()=>r.innerType._zod.propValues),Vt(e._zod,"values",()=>r.innerType._zod.values),Vt(e._zod,"optin",()=>{var a,s;return(s=(a=r.innerType)==null?void 0:a._zod)==null?void 0:s.optin}),Vt(e._zod,"optout",()=>{var a,s;return(s=(a=r.innerType)==null?void 0:a._zod)==null?void 0:s.optout}),e._zod.parse=(a,s)=>{if(s.direction==="backward")return r.innerType._zod.run(a,s);const f=r.innerType._zod.run(a,s);return f instanceof Promise?f.then(F2):F2(f)}});function F2(e){return e.value=Object.freeze(e.value),e}const iT=_e("$ZodCustom",(e,r)=>{yr.init(e,r),fn.init(e,r),e._zod.parse=(a,s)=>a,e._zod.check=a=>{const s=a.value,f=r.fn(s);if(f instanceof Promise)return f.then(g=>j2(g,a,s,e));j2(f,a,s,e)}});function j2(e,r,a,s){if(!e){const f={code:"custom",input:a,inst:s,path:[...s._zod.def.path??[]],continue:!s._zod.def.abort};s._zod.def.params&&(f.params=s._zod.def.params),r.issues.push(Hl(f))}}var V2;class aT{constructor(){this._map=new WeakMap,this._idmap=new Map}add(r,...a){const s=a[0];if(this._map.set(r,s),s&&typeof s=="object"&&"id"in s){if(this._idmap.has(s.id))throw new Error(`ID ${s.id} already exists in the registry`);this._idmap.set(s.id,r)}return this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(r){const a=this._map.get(r);return a&&typeof a=="object"&&"id"in a&&this._idmap.delete(a.id),this._map.delete(r),this}get(r){const a=r._zod.parent;if(a){const s={...this.get(a)??{}};delete s.id;const f={...s,...this._map.get(r)};return Object.keys(f).length?f:void 0}return this._map.get(r)}has(r){return this._map.has(r)}}function oT(){return new aT}(V2=globalThis).__zod_globalRegistry??(V2.__zod_globalRegistry=oT());const zl=globalThis.__zod_globalRegistry;function sT(e,r){return new e({type:"string",...Ve(r)})}function lT(e,r){return new e({type:"string",format:"email",check:"string_format",abort:!1,...Ve(r)})}function H2(e,r){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...Ve(r)})}function cT(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...Ve(r)})}function uT(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ve(r)})}function fT(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ve(r)})}function dT(e,r){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ve(r)})}function hT(e,r){return new e({type:"string",format:"url",check:"string_format",abort:!1,...Ve(r)})}function gT(e,r){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...Ve(r)})}function mT(e,r){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ve(r)})}function pT(e,r){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...Ve(r)})}function xT(e,r){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ve(r)})}function yT(e,r){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...Ve(r)})}function vT(e,r){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...Ve(r)})}function wT(e,r){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ve(r)})}function bT(e,r){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ve(r)})}function _T(e,r){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ve(r)})}function ET(e,r){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ve(r)})}function AT(e,r){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ve(r)})}function CT(e,r){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...Ve(r)})}function ST(e,r){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...Ve(r)})}function TT(e,r){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...Ve(r)})}function RT(e,r){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...Ve(r)})}function NT(e,r){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ve(r)})}function OT(e,r){return new e({type:"string",format:"date",check:"string_format",...Ve(r)})}function IT(e,r){return new e({type:"string",format:"time",check:"string_format",precision:null,...Ve(r)})}function MT(e,r){return new e({type:"string",format:"duration",check:"string_format",...Ve(r)})}function DT(e,r){return new e({type:"number",checks:[],...Ve(r)})}function BT(e,r){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...Ve(r)})}function kT(e,r){return new e({type:"boolean",...Ve(r)})}function LT(e){return new e({type:"unknown"})}function PT(e,r){return new e({type:"never",...Ve(r)})}function G2(e,r){return new xv({check:"less_than",...Ve(r),value:e,inclusive:!1})}function t0(e,r){return new xv({check:"less_than",...Ve(r),value:e,inclusive:!0})}function Z2(e,r){return new yv({check:"greater_than",...Ve(r),value:e,inclusive:!1})}function n0(e,r){return new yv({check:"greater_than",...Ve(r),value:e,inclusive:!0})}function X2(e,r){return new $4({check:"multiple_of",...Ve(r),value:e})}function Ev(e,r){return new t8({check:"max_length",...Ve(r),maximum:e})}function Xu(e,r){return new n8({check:"min_length",...Ve(r),minimum:e})}function Av(e,r){return new r8({check:"length_equals",...Ve(r),length:e})}function zT(e,r){return new i8({check:"string_format",format:"regex",...Ve(r),pattern:e})}function UT(e){return new a8({check:"string_format",format:"lowercase",...Ve(e)})}function FT(e){return new o8({check:"string_format",format:"uppercase",...Ve(e)})}function jT(e,r){return new s8({check:"string_format",format:"includes",...Ve(r),includes:e})}function VT(e,r){return new l8({check:"string_format",format:"starts_with",...Ve(r),prefix:e})}function HT(e,r){return new c8({check:"string_format",format:"ends_with",...Ve(r),suffix:e})}function Bs(e){return new u8({check:"overwrite",tx:e})}function GT(e){return Bs(r=>r.normalize(e))}function ZT(){return Bs(e=>e.trim())}function XT(){return Bs(e=>e.toLowerCase())}function YT(){return Bs(e=>e.toUpperCase())}function qT(){return Bs(e=>r4(e))}function WT(e,r,a){return new e({type:"array",element:r,...Ve(a)})}function KT(e,r,a){return new e({type:"custom",check:"custom",fn:r,...Ve(a)})}function QT(e){const r=JT(a=>(a.addIssue=s=>{if(typeof s=="string")a.issues.push(Hl(s,a.value,r._zod.def));else{const f=s;f.fatal&&(f.continue=!1),f.code??(f.code="custom"),f.input??(f.input=a.value),f.inst??(f.inst=r),f.continue??(f.continue=!r._zod.def.abort),a.issues.push(Hl(f))}},e(a.value,a)));return r}function JT(e,r){const a=new yr({check:"custom",...Ve(r)});return a._zod.check=e,a}function Cv(e){let r=(e==null?void 0:e.target)??"draft-2020-12";return r==="draft-4"&&(r="draft-04"),r==="draft-7"&&(r="draft-07"),{processors:e.processors??{},metadataRegistry:(e==null?void 0:e.metadata)??zl,target:r,unrepresentable:(e==null?void 0:e.unrepresentable)??"throw",override:(e==null?void 0:e.override)??(()=>{}),io:(e==null?void 0:e.io)??"output",counter:0,seen:new Map,cycles:(e==null?void 0:e.cycles)??"ref",reused:(e==null?void 0:e.reused)??"inline",external:(e==null?void 0:e.external)??void 0}}function Bn(e,r,a={path:[],schemaPath:[]}){var T,x;var s;const f=e._zod.def,g=r.seen.get(e);if(g)return g.count++,a.schemaPath.includes(e)&&(g.cycle=a.path),g.schema;const y={schema:{},count:1,cycle:void 0,path:a.path};r.seen.set(e,y);const E=(x=(T=e._zod).toJSONSchema)==null?void 0:x.call(T);if(E)y.schema=E;else{const S={...a,schemaPath:[...a.schemaPath,e],path:a.path},R=e._zod.parent;if(R)y.ref=R,Bn(R,r,S),r.seen.get(R).isParent=!0;else if(e._zod.processJSONSchema)e._zod.processJSONSchema(r,y.schema,S);else{const I=y.schema,B=r.processors[f.type];if(!B)throw new Error(`[toJSONSchema]: Non-representable type encountered: ${f.type}`);B(e,r,I,S)}}const A=r.metadataRegistry.get(e);return A&&Object.assign(y.schema,A),r.io==="input"&&rr(e)&&(delete y.schema.examples,delete y.schema.default),r.io==="input"&&y.schema._prefault&&((s=y.schema).default??(s.default=y.schema._prefault)),delete y.schema._prefault,r.seen.get(e).schema}function Sv(e,r){var g,y,E;const a=e.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=A=>{var R;const b=e.target==="draft-2020-12"?"$defs":"definitions";if(e.external){const I=(R=e.external.registry.get(A[0]))==null?void 0:R.id,B=e.external.uri??(k=>k);if(I)return{ref:B(I)};const P=A[1].defId??A[1].schema.id??`schema${e.counter++}`;return A[1].defId=P,{defId:P,ref:`${B("__shared")}#/${b}/${P}`}}if(A[1]===a)return{ref:"#"};const x=`#/${b}/`,S=A[1].schema.id??`__schema${e.counter++}`;return{defId:S,ref:x+S}},f=A=>{if(A[1].schema.$ref)return;const b=A[1],{ref:T,defId:x}=s(A);b.def={...b.schema},x&&(b.defId=x);const S=b.schema;for(const R in S)delete S[R];S.$ref=T};if(e.cycles==="throw")for(const A of e.seen.entries()){const b=A[1];if(b.cycle)throw new Error(`Cycle detected: #/${(g=b.cycle)==null?void 0:g.join("/")}/<root>
249
-
250
- Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(const A of e.seen.entries()){const b=A[1];if(r===A[0]){f(A);continue}if(e.external){const x=(y=e.external.registry.get(A[0]))==null?void 0:y.id;if(r!==A[0]&&x){f(A);continue}}if((E=e.metadataRegistry.get(A[0]))==null?void 0:E.id){f(A);continue}if(b.cycle){f(A);continue}if(b.count>1&&e.reused==="ref"){f(A);continue}}}function Tv(e,r){var y,E,A;const a=e.seen.get(r);if(!a)throw new Error("Unprocessed schema. This is a bug in Zod.");const s=b=>{const T=e.seen.get(b),x=T.def??T.schema,S={...x};if(T.ref===null)return;const R=T.ref;if(T.ref=null,R){s(R);const I=e.seen.get(R).schema;I.$ref&&(e.target==="draft-07"||e.target==="draft-04"||e.target==="openapi-3.0")?(x.allOf=x.allOf??[],x.allOf.push(I)):(Object.assign(x,I),Object.assign(x,S))}T.isParent||e.override({zodSchema:b,jsonSchema:x,path:T.path??[]})};for(const b of[...e.seen.entries()].reverse())s(b[0]);const f={};if(e.target==="draft-2020-12"?f.$schema="https://json-schema.org/draft/2020-12/schema":e.target==="draft-07"?f.$schema="http://json-schema.org/draft-07/schema#":e.target==="draft-04"?f.$schema="http://json-schema.org/draft-04/schema#":e.target,(y=e.external)!=null&&y.uri){const b=(E=e.external.registry.get(r))==null?void 0:E.id;if(!b)throw new Error("Schema is missing an `id` property");f.$id=e.external.uri(b)}Object.assign(f,a.def??a.schema);const g=((A=e.external)==null?void 0:A.defs)??{};for(const b of e.seen.entries()){const T=b[1];T.def&&T.defId&&(g[T.defId]=T.def)}e.external||Object.keys(g).length>0&&(e.target==="draft-2020-12"?f.$defs=g:f.definitions=g);try{const b=JSON.parse(JSON.stringify(f));return Object.defineProperty(b,"~standard",{value:{...r["~standard"],jsonSchema:{input:Yu(r,"input"),output:Yu(r,"output")}},enumerable:!1,writable:!1}),b}catch{throw new Error("Error converting schema to JSON.")}}function rr(e,r){const a=r??{seen:new Set};if(a.seen.has(e))return!1;a.seen.add(e);const s=e._zod.def;if(s.type==="transform")return!0;if(s.type==="array")return rr(s.element,a);if(s.type==="set")return rr(s.valueType,a);if(s.type==="lazy")return rr(s.getter(),a);if(s.type==="promise"||s.type==="optional"||s.type==="nonoptional"||s.type==="nullable"||s.type==="readonly"||s.type==="default"||s.type==="prefault")return rr(s.innerType,a);if(s.type==="intersection")return rr(s.left,a)||rr(s.right,a);if(s.type==="record"||s.type==="map")return rr(s.keyType,a)||rr(s.valueType,a);if(s.type==="pipe")return rr(s.in,a)||rr(s.out,a);if(s.type==="object"){for(const f in s.shape)if(rr(s.shape[f],a))return!0;return!1}if(s.type==="union"){for(const f of s.options)if(rr(f,a))return!0;return!1}if(s.type==="tuple"){for(const f of s.items)if(rr(f,a))return!0;return!!(s.rest&&rr(s.rest,a))}return!1}const $T=(e,r={})=>a=>{const s=Cv({...a,processors:r});return Bn(e,s),Sv(s,e),Tv(s,e)},Yu=(e,r)=>a=>{const{libraryOptions:s,target:f}=a??{},g=Cv({...s??{},target:f,io:r,processors:{}});return Bn(e,g),Sv(g,e),Tv(g,e)},e6={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},t6=(e,r,a,s)=>{const f=a;f.type="string";const{minimum:g,maximum:y,format:E,patterns:A,contentEncoding:b}=e._zod.bag;if(typeof g=="number"&&(f.minLength=g),typeof y=="number"&&(f.maxLength=y),E&&(f.format=e6[E]??E,f.format===""&&delete f.format),b&&(f.contentEncoding=b),A&&A.size>0){const T=[...A];T.length===1?f.pattern=T[0].source:T.length>1&&(f.allOf=[...T.map(x=>({...r.target==="draft-07"||r.target==="draft-04"||r.target==="openapi-3.0"?{type:"string"}:{},pattern:x.source}))])}},n6=(e,r,a,s)=>{const f=a,{minimum:g,maximum:y,format:E,multipleOf:A,exclusiveMaximum:b,exclusiveMinimum:T}=e._zod.bag;typeof E=="string"&&E.includes("int")?f.type="integer":f.type="number",typeof T=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(f.minimum=T,f.exclusiveMinimum=!0):f.exclusiveMinimum=T),typeof g=="number"&&(f.minimum=g,typeof T=="number"&&r.target!=="draft-04"&&(T>=g?delete f.minimum:delete f.exclusiveMinimum)),typeof b=="number"&&(r.target==="draft-04"||r.target==="openapi-3.0"?(f.maximum=b,f.exclusiveMaximum=!0):f.exclusiveMaximum=b),typeof y=="number"&&(f.maximum=y,typeof b=="number"&&r.target!=="draft-04"&&(b<=y?delete f.maximum:delete f.exclusiveMaximum)),typeof A=="number"&&(f.multipleOf=A)},r6=(e,r,a,s)=>{a.type="boolean"},i6=(e,r,a,s)=>{a.not={}},a6=(e,r,a,s)=>{},o6=(e,r,a,s)=>{const f=e._zod.def,g=sv(f.entries);g.every(y=>typeof y=="number")&&(a.type="number"),g.every(y=>typeof y=="string")&&(a.type="string"),a.enum=g},s6=(e,r,a,s)=>{if(r.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema")},l6=(e,r,a,s)=>{if(r.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema")},c6=(e,r,a,s)=>{const f=a,g=e._zod.def,{minimum:y,maximum:E}=e._zod.bag;typeof y=="number"&&(f.minItems=y),typeof E=="number"&&(f.maxItems=E),f.type="array",f.items=Bn(g.element,r,{...s,path:[...s.path,"items"]})},u6=(e,r,a,s)=>{var b;const f=a,g=e._zod.def;f.type="object",f.properties={};const y=g.shape;for(const T in y)f.properties[T]=Bn(y[T],r,{...s,path:[...s.path,"properties",T]});const E=new Set(Object.keys(y)),A=new Set([...E].filter(T=>{const x=g.shape[T]._zod;return r.io==="input"?x.optin===void 0:x.optout===void 0}));A.size>0&&(f.required=Array.from(A)),((b=g.catchall)==null?void 0:b._zod.def.type)==="never"?f.additionalProperties=!1:g.catchall?g.catchall&&(f.additionalProperties=Bn(g.catchall,r,{...s,path:[...s.path,"additionalProperties"]})):r.io==="output"&&(f.additionalProperties=!1)},f6=(e,r,a,s)=>{const f=e._zod.def,g=f.inclusive===!1,y=f.options.map((E,A)=>Bn(E,r,{...s,path:[...s.path,g?"oneOf":"anyOf",A]}));g?a.oneOf=y:a.anyOf=y},d6=(e,r,a,s)=>{const f=e._zod.def,g=Bn(f.left,r,{...s,path:[...s.path,"allOf",0]}),y=Bn(f.right,r,{...s,path:[...s.path,"allOf",1]}),E=b=>"allOf"in b&&Object.keys(b).length===1,A=[...E(g)?g.allOf:[g],...E(y)?y.allOf:[y]];a.allOf=A},h6=(e,r,a,s)=>{const f=a,g=e._zod.def;f.type="object",(r.target==="draft-07"||r.target==="draft-2020-12")&&(f.propertyNames=Bn(g.keyType,r,{...s,path:[...s.path,"propertyNames"]})),f.additionalProperties=Bn(g.valueType,r,{...s,path:[...s.path,"additionalProperties"]})},g6=(e,r,a,s)=>{const f=e._zod.def,g=Bn(f.innerType,r,s),y=r.seen.get(e);r.target==="openapi-3.0"?(y.ref=f.innerType,a.nullable=!0):a.anyOf=[g,{type:"null"}]},m6=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType},p6=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType,a.default=JSON.parse(JSON.stringify(f.defaultValue))},x6=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType,r.io==="input"&&(a._prefault=JSON.parse(JSON.stringify(f.defaultValue)))},y6=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType;let y;try{y=f.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}a.default=y},v6=(e,r,a,s)=>{const f=e._zod.def,g=r.io==="input"?f.in._zod.def.type==="transform"?f.out:f.in:f.out;Bn(g,r,s);const y=r.seen.get(e);y.ref=g},w6=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType,a.readOnly=!0},b6=(e,r,a,s)=>{const f=e._zod.def;Bn(f.innerType,r,s);const g=r.seen.get(e);g.ref=f.innerType},_6=_e("ZodISODateTime",(e,r)=>{A8.init(e,r),rn.init(e,r)});function E6(e){return NT(_6,e)}const A6=_e("ZodISODate",(e,r)=>{C8.init(e,r),rn.init(e,r)});function C6(e){return OT(A6,e)}const S6=_e("ZodISOTime",(e,r)=>{S8.init(e,r),rn.init(e,r)});function T6(e){return IT(S6,e)}const R6=_e("ZodISODuration",(e,r)=>{T8.init(e,r),rn.init(e,r)});function N6(e){return MT(R6,e)}const O6=(e,r)=>{fv.init(e,r),e.name="ZodError",Object.defineProperties(e,{format:{value:a=>p4(e,a)},flatten:{value:a=>m4(e,a)},addIssue:{value:a=>{e.issues.push(a),e.message=JSON.stringify(e.issues,_0,2)}},addIssues:{value:a=>{e.issues.push(...a),e.message=JSON.stringify(e.issues,_0,2)}},isEmpty:{get(){return e.issues.length===0}}})},Qr=_e("ZodError",O6,{Parent:Error}),I6=t1(Qr),M6=n1(Qr),D6=lf(Qr),B6=cf(Qr),k6=v4(Qr),L6=w4(Qr),P6=b4(Qr),z6=_4(Qr),U6=E4(Qr),F6=A4(Qr),j6=C4(Qr),V6=S4(Qr),xn=_e("ZodType",(e,r)=>(fn.init(e,r),Object.assign(e["~standard"],{jsonSchema:{input:Yu(e,"input"),output:Yu(e,"output")}}),e.toJSONSchema=$T(e,{}),e.def=r,e.type=r.type,Object.defineProperty(e,"_def",{value:r}),e.check=(...a)=>e.clone(Io(r,{checks:[...r.checks??[],...a.map(s=>typeof s=="function"?{_zod:{check:s,def:{check:"custom"},onattach:[]}}:s)]})),e.clone=(a,s)=>Ka(e,a,s),e.brand=()=>e,e.register=((a,s)=>(a.add(e,s),e)),e.parse=(a,s)=>I6(e,a,s,{callee:e.parse}),e.safeParse=(a,s)=>D6(e,a,s),e.parseAsync=async(a,s)=>M6(e,a,s,{callee:e.parseAsync}),e.safeParseAsync=async(a,s)=>B6(e,a,s),e.spa=e.safeParseAsync,e.encode=(a,s)=>k6(e,a,s),e.decode=(a,s)=>L6(e,a,s),e.encodeAsync=async(a,s)=>P6(e,a,s),e.decodeAsync=async(a,s)=>z6(e,a,s),e.safeEncode=(a,s)=>U6(e,a,s),e.safeDecode=(a,s)=>F6(e,a,s),e.safeEncodeAsync=async(a,s)=>j6(e,a,s),e.safeDecodeAsync=async(a,s)=>V6(e,a,s),e.refine=(a,s)=>e.check(LR(a,s)),e.superRefine=a=>e.check(PR(a)),e.overwrite=a=>e.check(Bs(a)),e.optional=()=>W2(e),e.nullable=()=>K2(e),e.nullish=()=>W2(K2(e)),e.nonoptional=a=>NR(e,a),e.array=()=>gR(e),e.or=a=>xR([e,a]),e.and=a=>vR(e,a),e.transform=a=>Q2(e,ER(a)),e.default=a=>SR(e,a),e.prefault=a=>RR(e,a),e.catch=a=>IR(e,a),e.pipe=a=>Q2(e,a),e.readonly=()=>BR(e),e.describe=a=>{const s=e.clone();return zl.add(s,{description:a}),s},Object.defineProperty(e,"description",{get(){var a;return(a=zl.get(e))==null?void 0:a.description},configurable:!0}),e.meta=(...a)=>{if(a.length===0)return zl.get(e);const s=e.clone();return zl.add(s,a[0]),s},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e)),Rv=_e("_ZodString",(e,r)=>{r1.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(s,f,g)=>t6(e,s,f);const a=e._zod.bag;e.format=a.format??null,e.minLength=a.minimum??null,e.maxLength=a.maximum??null,e.regex=(...s)=>e.check(zT(...s)),e.includes=(...s)=>e.check(jT(...s)),e.startsWith=(...s)=>e.check(VT(...s)),e.endsWith=(...s)=>e.check(HT(...s)),e.min=(...s)=>e.check(Xu(...s)),e.max=(...s)=>e.check(Ev(...s)),e.length=(...s)=>e.check(Av(...s)),e.nonempty=(...s)=>e.check(Xu(1,...s)),e.lowercase=s=>e.check(UT(s)),e.uppercase=s=>e.check(FT(s)),e.trim=()=>e.check(ZT()),e.normalize=(...s)=>e.check(GT(...s)),e.toLowerCase=()=>e.check(XT()),e.toUpperCase=()=>e.check(YT()),e.slugify=()=>e.check(qT())}),H6=_e("ZodString",(e,r)=>{r1.init(e,r),Rv.init(e,r),e.email=a=>e.check(lT(G6,a)),e.url=a=>e.check(hT(Z6,a)),e.jwt=a=>e.check(RT(oR,a)),e.emoji=a=>e.check(gT(X6,a)),e.guid=a=>e.check(H2(Y2,a)),e.uuid=a=>e.check(cT(Tu,a)),e.uuidv4=a=>e.check(uT(Tu,a)),e.uuidv6=a=>e.check(fT(Tu,a)),e.uuidv7=a=>e.check(dT(Tu,a)),e.nanoid=a=>e.check(mT(Y6,a)),e.guid=a=>e.check(H2(Y2,a)),e.cuid=a=>e.check(pT(q6,a)),e.cuid2=a=>e.check(xT(W6,a)),e.ulid=a=>e.check(yT(K6,a)),e.base64=a=>e.check(CT(rR,a)),e.base64url=a=>e.check(ST(iR,a)),e.xid=a=>e.check(vT(Q6,a)),e.ksuid=a=>e.check(wT(J6,a)),e.ipv4=a=>e.check(bT($6,a)),e.ipv6=a=>e.check(_T(eR,a)),e.cidrv4=a=>e.check(ET(tR,a)),e.cidrv6=a=>e.check(AT(nR,a)),e.e164=a=>e.check(TT(aR,a)),e.datetime=a=>e.check(E6(a)),e.date=a=>e.check(C6(a)),e.time=a=>e.check(T6(a)),e.duration=a=>e.check(N6(a))});function ir(e){return sT(H6,e)}const rn=_e("ZodStringFormat",(e,r)=>{$t.init(e,r),Rv.init(e,r)}),G6=_e("ZodEmail",(e,r)=>{m8.init(e,r),rn.init(e,r)}),Y2=_e("ZodGUID",(e,r)=>{h8.init(e,r),rn.init(e,r)}),Tu=_e("ZodUUID",(e,r)=>{g8.init(e,r),rn.init(e,r)}),Z6=_e("ZodURL",(e,r)=>{p8.init(e,r),rn.init(e,r)}),X6=_e("ZodEmoji",(e,r)=>{x8.init(e,r),rn.init(e,r)}),Y6=_e("ZodNanoID",(e,r)=>{y8.init(e,r),rn.init(e,r)}),q6=_e("ZodCUID",(e,r)=>{v8.init(e,r),rn.init(e,r)}),W6=_e("ZodCUID2",(e,r)=>{w8.init(e,r),rn.init(e,r)}),K6=_e("ZodULID",(e,r)=>{b8.init(e,r),rn.init(e,r)}),Q6=_e("ZodXID",(e,r)=>{_8.init(e,r),rn.init(e,r)}),J6=_e("ZodKSUID",(e,r)=>{E8.init(e,r),rn.init(e,r)}),$6=_e("ZodIPv4",(e,r)=>{R8.init(e,r),rn.init(e,r)}),eR=_e("ZodIPv6",(e,r)=>{N8.init(e,r),rn.init(e,r)}),tR=_e("ZodCIDRv4",(e,r)=>{O8.init(e,r),rn.init(e,r)}),nR=_e("ZodCIDRv6",(e,r)=>{I8.init(e,r),rn.init(e,r)}),rR=_e("ZodBase64",(e,r)=>{M8.init(e,r),rn.init(e,r)}),iR=_e("ZodBase64URL",(e,r)=>{B8.init(e,r),rn.init(e,r)}),aR=_e("ZodE164",(e,r)=>{k8.init(e,r),rn.init(e,r)}),oR=_e("ZodJWT",(e,r)=>{P8.init(e,r),rn.init(e,r)}),Nv=_e("ZodNumber",(e,r)=>{wv.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(s,f,g)=>n6(e,s,f),e.gt=(s,f)=>e.check(Z2(s,f)),e.gte=(s,f)=>e.check(n0(s,f)),e.min=(s,f)=>e.check(n0(s,f)),e.lt=(s,f)=>e.check(G2(s,f)),e.lte=(s,f)=>e.check(t0(s,f)),e.max=(s,f)=>e.check(t0(s,f)),e.int=s=>e.check(q2(s)),e.safe=s=>e.check(q2(s)),e.positive=s=>e.check(Z2(0,s)),e.nonnegative=s=>e.check(n0(0,s)),e.negative=s=>e.check(G2(0,s)),e.nonpositive=s=>e.check(t0(0,s)),e.multipleOf=(s,f)=>e.check(X2(s,f)),e.step=(s,f)=>e.check(X2(s,f)),e.finite=()=>e;const a=e._zod.bag;e.minValue=Math.max(a.minimum??Number.NEGATIVE_INFINITY,a.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(a.maximum??Number.POSITIVE_INFINITY,a.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(a.format??"").includes("int")||Number.isSafeInteger(a.multipleOf??.5),e.isFinite=!0,e.format=a.format??null});function i1(e){return DT(Nv,e)}const sR=_e("ZodNumberFormat",(e,r)=>{z8.init(e,r),Nv.init(e,r)});function q2(e){return BT(sR,e)}const lR=_e("ZodBoolean",(e,r)=>{U8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>r6(e,a,s)});function cR(e){return kT(lR,e)}const uR=_e("ZodUnknown",(e,r)=>{F8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>a6()});function A0(){return LT(uR)}const fR=_e("ZodNever",(e,r)=>{j8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>i6(e,a,s)});function dR(e){return PT(fR,e)}const hR=_e("ZodArray",(e,r)=>{V8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>c6(e,a,s,f),e.element=r.element,e.min=(a,s)=>e.check(Xu(a,s)),e.nonempty=a=>e.check(Xu(1,a)),e.max=(a,s)=>e.check(Ev(a,s)),e.length=(a,s)=>e.check(Av(a,s)),e.unwrap=()=>e.element});function gR(e,r){return WT(hR,e,r)}const mR=_e("ZodObject",(e,r)=>{G8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>u6(e,a,s,f),Vt(e,"shape",()=>r.shape),e.keyof=()=>Gl(Object.keys(e._zod.def.shape)),e.catchall=a=>e.clone({...e._zod.def,catchall:a}),e.passthrough=()=>e.clone({...e._zod.def,catchall:A0()}),e.loose=()=>e.clone({...e._zod.def,catchall:A0()}),e.strict=()=>e.clone({...e._zod.def,catchall:dR()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=a=>u4(e,a),e.safeExtend=a=>f4(e,a),e.merge=a=>d4(e,a),e.pick=a=>l4(e,a),e.omit=a=>c4(e,a),e.partial=(...a)=>h4(Ov,e,a[0]),e.required=(...a)=>g4(Iv,e,a[0])});function kr(e,r){const a={type:"object",shape:e??{},...Ve(r)};return new mR(a)}const pR=_e("ZodUnion",(e,r)=>{Z8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>f6(e,a,s,f),e.options=r.options});function xR(e,r){return new pR({type:"union",options:e,...Ve(r)})}const yR=_e("ZodIntersection",(e,r)=>{X8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>d6(e,a,s,f)});function vR(e,r){return new yR({type:"intersection",left:e,right:r})}const wR=_e("ZodRecord",(e,r)=>{Y8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>h6(e,a,s,f),e.keyType=r.keyType,e.valueType=r.valueType});function bR(e,r,a){return new wR({type:"record",keyType:e,valueType:r,...Ve(a)})}const C0=_e("ZodEnum",(e,r)=>{q8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(s,f,g)=>o6(e,s,f),e.enum=r.entries,e.options=Object.values(r.entries);const a=new Set(Object.keys(r.entries));e.extract=(s,f)=>{const g={};for(const y of s)if(a.has(y))g[y]=r.entries[y];else throw new Error(`Key ${y} not found in enum`);return new C0({...r,checks:[],...Ve(f),entries:g})},e.exclude=(s,f)=>{const g={...r.entries};for(const y of s)if(a.has(y))delete g[y];else throw new Error(`Key ${y} not found in enum`);return new C0({...r,checks:[],...Ve(f),entries:g})}});function Gl(e,r){const a=Array.isArray(e)?Object.fromEntries(e.map(s=>[s,s])):e;return new C0({type:"enum",entries:a,...Ve(r)})}const _R=_e("ZodTransform",(e,r)=>{W8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>l6(e,a),e._zod.parse=(a,s)=>{if(s.direction==="backward")throw new av(e.constructor.name);a.addIssue=g=>{if(typeof g=="string")a.issues.push(Hl(g,a.value,r));else{const y=g;y.fatal&&(y.continue=!1),y.code??(y.code="custom"),y.input??(y.input=a.value),y.inst??(y.inst=e),a.issues.push(Hl(y))}};const f=r.transform(a.value,a);return f instanceof Promise?f.then(g=>(a.value=g,a)):(a.value=f,a)}});function ER(e){return new _R({type:"transform",transform:e})}const Ov=_e("ZodOptional",(e,r)=>{K8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>b6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function W2(e){return new Ov({type:"optional",innerType:e})}const AR=_e("ZodNullable",(e,r)=>{Q8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>g6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function K2(e){return new AR({type:"nullable",innerType:e})}const CR=_e("ZodDefault",(e,r)=>{J8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>p6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function SR(e,r){return new CR({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():cv(r)}})}const TR=_e("ZodPrefault",(e,r)=>{$8.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>x6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function RR(e,r){return new TR({type:"prefault",innerType:e,get defaultValue(){return typeof r=="function"?r():cv(r)}})}const Iv=_e("ZodNonOptional",(e,r)=>{eT.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>m6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function NR(e,r){return new Iv({type:"nonoptional",innerType:e,...Ve(r)})}const OR=_e("ZodCatch",(e,r)=>{tT.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>y6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function IR(e,r){return new OR({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}const MR=_e("ZodPipe",(e,r)=>{nT.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>v6(e,a,s,f),e.in=r.in,e.out=r.out});function Q2(e,r){return new MR({type:"pipe",in:e,out:r})}const DR=_e("ZodReadonly",(e,r)=>{rT.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>w6(e,a,s,f),e.unwrap=()=>e._zod.def.innerType});function BR(e){return new DR({type:"readonly",innerType:e})}const kR=_e("ZodCustom",(e,r)=>{iT.init(e,r),xn.init(e,r),e._zod.processJSONSchema=(a,s,f)=>s6(e,a)});function LR(e,r={}){return KT(kR,e,r)}function PR(e){return QT(e)}const An=ir().trim().min(4).max(8).regex(/^[A-Z0-9]+$/,{message:"room code must contain only A-Z or 0-9"}),zR=kr({roomId:An,controllerId:ir().min(3),input:bR(ir(),A0())}),UR=kr({roomId:An,state:kr({orientation:Gl(["portrait","landscape"]).optional(),message:ir().optional(),gameState:Gl(["paused","playing"]).optional()})});kr({roomId:An,maxPlayers:i1().int().min(1).max(16).default(8),apiKey:ir().optional(),mode:Gl(["master","child"]).default("child"),controllerUrl:ir().url().optional()});const FR=kr({roomId:An,controllerId:ir().min(3),nickname:ir().trim().min(1).max(24).optional()});kr({roomId:An,controllerId:ir().min(3)});const Mv=kr({roomId:An,command:Gl(["exit","ready","toggle_pause"])});kr({roomId:An,apiKey:ir().optional()});kr({roomId:An,gameId:ir(),gameUrl:ir().url()});kr({roomId:An,joinToken:ir()});const jR=kr({maxPlayers:i1().int().min(1).max(16).default(8),apiKey:ir().optional()}),VR=kr({roomId:An,apiKey:ir().optional()}),a1=()=>{if(typeof window>"u")return"standalone";try{return window.self!==window.top?"platform":"standalone"}catch{return"platform"}},HR=e=>!!(e.startsWith("192.168.64.")||e.startsWith("192.168.65.")||e.startsWith("172.17.")||e.startsWith("172.18.")||e.startsWith("172.19.")||e.startsWith("169.254.")),GR=e=>{if(e.startsWith("192.168.")){const r=e.split("."),a=parseInt(r[2]||"0",10);return a<64?100-a:10}return e.startsWith("10.")?50:/^172\.(1[6-9]|2[0-9]|3[01])\./.test(e)?30:0},ZR=()=>new Promise(e=>{if(typeof window>"u"||typeof RTCPeerConnection>"u"){e(null);return}const r=new RTCPeerConnection({iceServers:[{urls:"stun:stun.l.google.com:19302"}]}),a=[];let s=!1;const f=E=>{r.close(),e(E)},g=setTimeout(()=>{s?y():setTimeout(()=>{y()},500)},3e3),y=()=>{if(a.length===0){f(null);return}a.sort((A,b)=>b.score-A.score);const E=a[0];clearTimeout(g),f(E.ip)};r.onicecandidate=E=>{if(E.candidate){const b=E.candidate.candidate.match(/([0-9]{1,3}(\.[0-9]{1,3}){3})/);if(b){const T=b[1];if(T==="127.0.0.1")return;if((T.startsWith("192.168.")||T.startsWith("10.")||/^172\.(1[6-9]|2[0-9]|3[01])\./.test(T))&&!HR(T)){const S=GR(T);a.push({ip:T,score:S})}}}else s=!0,setTimeout(()=>{y()},200)},r.createDataChannel(""),r.createOffer().then(E=>r.setLocalDescription(E)).catch(()=>{clearTimeout(g),f(null)})});class XR{constructor(){Va(this,"cachedLocalIp",null);Va(this,"ipDetectionPromise",null)}async getLocalIp(){return this.cachedLocalIp!==null?this.cachedLocalIp:this.ipDetectionPromise!==null?this.ipDetectionPromise:(this.ipDetectionPromise=ZR().then(r=>(this.cachedLocalIp=r,this.ipDetectionPromise=null,r)),this.ipDetectionPromise)}clearCache(){this.cachedLocalIp=null,this.ipDetectionPromise=null}async normalizeForMobile(r){if(typeof window>"u")return r;try{const a=new URL(r);if(a.hostname==="localhost"||a.hostname==="127.0.0.1"){const s=await this.getLocalIp();return s?(a.hostname=s,a.toString()):(a.hostname=window.location.hostname,a.toString())}return r}catch{return r}}async buildControllerUrl(r,a){const s=S3;if(a!=null&&a.host){const y=new URL(s,this.normalizeOrigin(a.host));return y.searchParams.set("room",r),y.toString()}let f;if(typeof window>"u")f=`http://localhost:${Fl}`;else{const y=new URL(window.location.href);if(!this.isLocalhost(y.hostname))f=y.origin;else{const E=await this.getLocalIp();if(E){const A=y.port;f=A?`http://${E}:${A}`:`http://${E}`}else f=y.origin}}const g=new URL(s,f);return g.searchParams.set("room",r),g.toString()}resolveServerUrl(r){if(r)return this.normalizeOrigin(r);if(typeof window<"u"){const a=new URL(window.location.href);return a.port=String(Fl),a.origin}return`http://localhost:${Fl}`}isLocalhost(r){return r==="localhost"||r==="127.0.0.1"||r==="[::1]"}normalizeOrigin(r){return r.includes("://")?r:`http://${r}`}}const Dv=new XR,Bv=(e={})=>{const{config:r,store:a,getSocket:s,disconnectSocket:f,inputManager:g}=ql(),y=L.useMemo(()=>{if(typeof window>"u")return null;const le=new URLSearchParams(window.location.search),te=le.get("aj_room"),pe=le.get("aj_token");return te&&pe?{room:te,token:pe}:null},[]),E=!!y,A=!0,b=Ao(a,le=>le.roomId),T=L.useMemo(()=>{if(y)return An.parse(y.room.toUpperCase());if(b)return An.parse(b.toUpperCase());if(typeof window<"u"){const te=new URLSearchParams(window.location.search).get("room");if(te){const pe=An.safeParse(te.toUpperCase());if(pe.success)return pe.data}}return e.roomId?An.parse(e.roomId.toUpperCase()):null},[e.roomId,b,y]),[x,S]=L.useState(""),R=L.useRef(e.onPlayerJoin),I=L.useRef(e.onPlayerLeave),B=L.useRef(e.onChildClose);L.useEffect(()=>{R.current=e.onPlayerJoin,I.current=e.onPlayerLeave,B.current=e.onChildClose},[e.onPlayerJoin,e.onPlayerLeave,e.onChildClose]);const P=Ao(a,ef(le=>({connectionStatus:le.connectionStatus,lastError:le.lastError,players:le.players,gameState:le.gameState,mode:le.mode,roomId:le.roomId}))),k=L.useMemo(()=>s("host"),[A,s]),[Z,j]=L.useState(0),H=L.useCallback(()=>{const le=Date.now();if(le-Z<T3||(j(le),!k||!k.connected)||!T)return;const te=Mv.safeParse({roomId:T,command:"toggle_pause"});te.success&&k.emit("host:system",te.data)},[k,T,Z]),ee=L.useCallback(le=>{if(!k||!k.connected||!T)return!1;const te=UR.safeParse({roomId:T,state:le});return te.success?(k.emit("host:state",te.data),!0):!1},[k,T]),Q=L.useCallback((le,te,pe)=>{if(!k||!k.connected)return;const Te={targetId:pe,type:le,payload:te};k.emit("host:signal",Te)},[k]),X=L.useCallback(()=>{f("host"),k&&k.connect()},[k,f]);L.useEffect(()=>{T&&(async()=>{const le=await Dv.buildControllerUrl(T,{host:r.publicHost});S(le)})()},[T,r.publicHost,e.roomId]);const de=Ao(a,le=>le.setRegisteredRoomId);L.useEffect(()=>{const le=a.getState();if(le.setMode(a1()),le.setRole("host"),T&&le.setRoomId(T),le.setStatus("connecting"),le.setError(void 0),!k){le.setStatus("idle");return}const te=async()=>{const oe=a.getState();if(!(a.getState().registeredRoomId&&k.connected))if(y){const Ie=An.parse(y.room.toUpperCase()),Ue={roomId:Ie,joinToken:y.token};k.emit("host:joinAsChild",Ue,Ce=>{if(!Ce.ok){oe.setError(Ce.message??"Failed to join as child"),oe.setStatus("disconnected"),de(null);return}oe.setStatus("connected"),oe.setRoomId(Ie),de(Ie)})}else{const Ie=()=>{const Ue=jR.parse({maxPlayers:e.maxPlayers??r.maxPlayers,apiKey:e.apiKey??r.apiKey});k.emit("host:createRoom",Ue,Ce=>{if(!Ce.ok){oe.setError(Ce.message??"Failed to create room"),oe.setStatus("disconnected"),de(null);return}Ce.roomId?(oe.setStatus("connected"),oe.setRoomId(Ce.roomId),de(Ce.roomId),typeof window<"u"&&sessionStorage.setItem("airjam_room_id",Ce.roomId)):(oe.setError("Server did not return room ID"),oe.setStatus("disconnected"))})};if(typeof window<"u"){const Ue=sessionStorage.getItem("airjam_room_id");if(Ue){const Ce=VR.parse({roomId:Ue,apiKey:e.apiKey??r.apiKey});k.emit("host:reconnect",Ce,Ye=>{Ye.ok&&Ye.roomId?(oe.setStatus("connected"),oe.setRoomId(Ye.roomId),de(Ye.roomId)):(typeof window<"u"&&sessionStorage.removeItem("airjam_room_id"),Ie())})}else Ie()}else Ie()}},pe=()=>{a.getState().setStatus("connected"),te()},Te=()=>{a.getState().setStatus("disconnected")},ie=oe=>{oe.player&&(a.getState().upsertPlayer(oe.player),setTimeout(()=>{var Re;(Re=R.current)==null||Re.call(R,oe.player)},0))},re=oe=>{var Re;a.getState().removePlayer(oe.controllerId),(Re=I.current)==null||Re.call(I,oe.controllerId)},xe=oe=>{g&&g.handleInput(oe)},Me=()=>{var oe;(oe=B.current)==null||oe.call(B)},He=oe=>{if(!T||oe.roomId!==T)return;const Re=a.getState();oe.state.gameState&&Re.setGameState(oe.state.gameState),oe.state.message!==void 0&&Re.setStateMessage(oe.state.message)},qe=oe=>{a.getState().setError(oe.message)};k.on("connect",pe),k.on("disconnect",Te),k.on("server:controllerJoined",ie),k.on("server:controllerLeft",re),k.on("server:input",xe),k.on("server:error",qe),k.on("server:closeChild",Me),k.on("server:state",He),k.connect();const K=a.getState().registeredRoomId;return k.connected&&!K&&te(),()=>{k.off("connect",pe),k.off("disconnect",Te),k.off("server:controllerJoined",ie),k.off("server:controllerLeft",re),k.off("server:input",xe),k.off("server:error",qe),k.off("server:closeChild",Me),k.off("server:state",He)}},[r.maxPlayers,r.apiKey,e.maxPlayers,e.apiKey,y,T,A,k,a,g,de]);const Y=k??s("host"),we=L.useCallback(le=>{if(g)return g.getInput(le)},[g]);return{roomId:T??"",joinUrl:x,connectionStatus:P.connectionStatus,players:P.players,lastError:P.lastError,mode:P.mode,gameState:P.gameState,toggleGameState:H,sendState:ee,sendSignal:Q,reconnect:X,socket:Y,isChildMode:E,getInput:we}},YR=e=>`https://api.dicebear.com/9.x/adventurer-neutral/svg?seed=${encodeURIComponent(e)}`,Ll=(e,r)=>{const a=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);if(!a)return`rgba(0, 0, 0, ${r})`;const s=parseInt(a[1],16),f=parseInt(a[2],16),g=parseInt(a[3],16);return`rgba(${s}, ${f}, ${g}, ${r})`},Co=({player:e,size:r="md",className:a=""})=>{const s={sm:"h-8 w-8 border-2",md:"h-12 w-12 border-4",lg:"h-16 w-16 border-4"},f={sm:e.color?`inset 0 0 4px rgba(0, 0, 0, 0.2), 0 0 8px ${Ll(e.color,.4)}`:"inset 0 0 4px rgba(0, 0, 0, 0.2)",md:e.color?`inset 0 0 10px rgba(0, 0, 0, 0.4), 0 0 20px ${Ll(e.color,.6)}, 0 0 10px ${Ll(e.color,.8)}`:"inset 0 0 10px rgba(0, 0, 0, 0.4), 0 0 20px hsl(var(--border) / 0.5)",lg:e.color?`inset 0 0 12px rgba(0, 0, 0, 0.4), 0 0 24px ${Ll(e.color,.6)}, 0 0 12px ${Ll(e.color,.8)}`:"inset 0 0 12px rgba(0, 0, 0, 0.4), 0 0 24px hsl(var(--border) / 0.5)"};return F.jsx("img",{src:YR(e.id),alt:e.label,className:`bg-secondary/30 shrink-0 rounded-full shadow-lg ${s[r]} ${a}`,style:{borderColor:e.color||"hsl(var(--border))",boxShadow:f[r]}})},qR=Z0("relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90"}},defaultVariants:{variant:"default"}});function WR({className:e,variant:r,...a}){return F.jsx("div",{"data-slot":"alert",role:"alert",className:Wt(qR({variant:r}),e),...a})}function KR({className:e,...r}){return F.jsx("div",{"data-slot":"alert-description",className:Wt("text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed",e),...r})}const QR=Z0("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function r0({className:e,variant:r,asChild:a=!1,...s}){const f=a?ly:"span";return F.jsx(f,{"data-slot":"badge",className:Wt(QR({variant:r}),e),...s})}function JR({className:e,...r}){return F.jsx("div",{"data-slot":"card",className:Wt("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",e),...r})}function J2({className:e,...r}){return F.jsx("div",{"data-slot":"card-title",className:Wt("leading-none font-semibold",e),...r})}function $2({className:e,...r}){return F.jsx("div",{"data-slot":"card-description",className:Wt("text-muted-foreground text-sm",e),...r})}function $R({className:e,...r}){return F.jsx("div",{"data-slot":"card-content",className:Wt("px-6",e),...r})}function kv(e){const r=e+"CollectionProvider",[a,s]=Wl(r),[f,g]=a(r,{collectionRef:{current:null},itemMap:new Map}),y=B=>{const{scope:P,children:k}=B,Z=Dr.useRef(null),j=Dr.useRef(new Map).current;return F.jsx(f,{scope:P,itemMap:j,collectionRef:Z,children:k})};y.displayName=r;const E=e+"CollectionSlot",A=Vu(E),b=Dr.forwardRef((B,P)=>{const{scope:k,children:Z}=B,j=g(E,k),H=Yn(P,j.collectionRef);return F.jsx(A,{ref:H,children:Z})});b.displayName=E;const T=e+"CollectionItemSlot",x="data-radix-collection-item",S=Vu(T),R=Dr.forwardRef((B,P)=>{const{scope:k,children:Z,...j}=B,H=Dr.useRef(null),ee=Yn(P,H),Q=g(T,k);return Dr.useEffect(()=>(Q.itemMap.set(H,{ref:H,...j}),()=>void Q.itemMap.delete(H))),F.jsx(S,{[x]:"",ref:ee,children:Z})});R.displayName=T;function I(B){const P=g(e+"CollectionConsumer",B);return Dr.useCallback(()=>{const Z=P.collectionRef.current;if(!Z)return[];const j=Array.from(Z.querySelectorAll(`[${x}]`));return Array.from(P.itemMap.values()).sort((Q,X)=>j.indexOf(Q.ref.current)-j.indexOf(X.ref.current))},[P.collectionRef,P.itemMap])}return[{Provider:y,Slot:b,ItemSlot:R},I,s]}var eN=L.createContext(void 0);function o1(e){const r=L.useContext(eN);return e||r||"ltr"}var i0="rovingFocusGroup.onEntryFocus",tN={bubbles:!1,cancelable:!0},Ql="RovingFocusGroup",[S0,Lv,nN]=kv(Ql),[rN,Pv]=Wl(Ql,[nN]),[iN,aN]=rN(Ql),zv=L.forwardRef((e,r)=>F.jsx(S0.Provider,{scope:e.__scopeRovingFocusGroup,children:F.jsx(S0.Slot,{scope:e.__scopeRovingFocusGroup,children:F.jsx(oN,{...e,ref:r})})}));zv.displayName=Ql;var oN=L.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,orientation:s,loop:f=!1,dir:g,currentTabStopId:y,defaultCurrentTabStopId:E,onCurrentTabStopIdChange:A,onEntryFocus:b,preventScrollOnEntryFocus:T=!1,...x}=e,S=L.useRef(null),R=Yn(r,S),I=o1(g),[B,P]=rf({prop:y,defaultProp:E??null,onChange:A,caller:Ql}),[k,Z]=L.useState(!1),j=Rs(b),H=Lv(a),ee=L.useRef(!1),[Q,X]=L.useState(0);return L.useEffect(()=>{const de=S.current;if(de)return de.addEventListener(i0,j),()=>de.removeEventListener(i0,j)},[j]),F.jsx(iN,{scope:a,orientation:s,dir:I,loop:f,currentTabStopId:B,onItemFocus:L.useCallback(de=>P(de),[P]),onItemShiftTab:L.useCallback(()=>Z(!0),[]),onFocusableItemAdd:L.useCallback(()=>X(de=>de+1),[]),onFocusableItemRemove:L.useCallback(()=>X(de=>de-1),[]),children:F.jsx(Sn.div,{tabIndex:k||Q===0?-1:0,"data-orientation":s,...x,ref:R,style:{outline:"none",...e.style},onMouseDown:tn(e.onMouseDown,()=>{ee.current=!0}),onFocus:tn(e.onFocus,de=>{const Y=!ee.current;if(de.target===de.currentTarget&&Y&&!k){const we=new CustomEvent(i0,tN);if(de.currentTarget.dispatchEvent(we),!we.defaultPrevented){const le=H().filter(re=>re.focusable),te=le.find(re=>re.active),pe=le.find(re=>re.id===B),ie=[te,pe,...le].filter(Boolean).map(re=>re.ref.current);jv(ie,T)}}ee.current=!1}),onBlur:tn(e.onBlur,()=>Z(!1))})})}),Uv="RovingFocusGroupItem",Fv=L.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:a,focusable:s=!0,active:f=!1,tabStopId:g,children:y,...E}=e,A=jl(),b=g||A,T=aN(Uv,a),x=T.currentTabStopId===b,S=Lv(a),{onFocusableItemAdd:R,onFocusableItemRemove:I,currentTabStopId:B}=T;return L.useEffect(()=>{if(s)return R(),()=>I()},[s,R,I]),F.jsx(S0.ItemSlot,{scope:a,id:b,focusable:s,active:f,children:F.jsx(Sn.span,{tabIndex:x?0:-1,"data-orientation":T.orientation,...E,ref:r,onMouseDown:tn(e.onMouseDown,P=>{s?T.onItemFocus(b):P.preventDefault()}),onFocus:tn(e.onFocus,()=>T.onItemFocus(b)),onKeyDown:tn(e.onKeyDown,P=>{if(P.key==="Tab"&&P.shiftKey){T.onItemShiftTab();return}if(P.target!==P.currentTarget)return;const k=cN(P,T.orientation,T.dir);if(k!==void 0){if(P.metaKey||P.ctrlKey||P.altKey||P.shiftKey)return;P.preventDefault();let j=S().filter(H=>H.focusable).map(H=>H.ref.current);if(k==="last")j.reverse();else if(k==="prev"||k==="next"){k==="prev"&&j.reverse();const H=j.indexOf(P.currentTarget);j=T.loop?uN(j,H+1):j.slice(H+1)}setTimeout(()=>jv(j))}}),children:typeof y=="function"?y({isCurrentTabStop:x,hasTabStop:B!=null}):y})})});Fv.displayName=Uv;var sN={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function lN(e,r){return r!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function cN(e,r,a){const s=lN(e.key,a);if(!(r==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(r==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return sN[s]}function jv(e,r=!1){const a=document.activeElement;for(const s of e)if(s===a||(s.focus({preventScroll:r}),document.activeElement!==a))return}function uN(e,r){return e.map((a,s)=>e[(r+s)%e.length])}var fN=zv,dN=Fv,ff="Tabs",[hN]=Wl(ff,[Pv]),Vv=Pv(),[gN,s1]=hN(ff),Hv=L.forwardRef((e,r)=>{const{__scopeTabs:a,value:s,onValueChange:f,defaultValue:g,orientation:y="horizontal",dir:E,activationMode:A="automatic",...b}=e,T=o1(E),[x,S]=rf({prop:s,onChange:f,defaultProp:g??"",caller:ff});return F.jsx(gN,{scope:a,baseId:jl(),value:x,onValueChange:S,orientation:y,dir:T,activationMode:A,children:F.jsx(Sn.div,{dir:T,"data-orientation":y,...b,ref:r})})});Hv.displayName=ff;var Gv="TabsList",Zv=L.forwardRef((e,r)=>{const{__scopeTabs:a,loop:s=!0,...f}=e,g=s1(Gv,a),y=Vv(a);return F.jsx(fN,{asChild:!0,...y,orientation:g.orientation,dir:g.dir,loop:s,children:F.jsx(Sn.div,{role:"tablist","aria-orientation":g.orientation,...f,ref:r})})});Zv.displayName=Gv;var Xv="TabsTrigger",Yv=L.forwardRef((e,r)=>{const{__scopeTabs:a,value:s,disabled:f=!1,...g}=e,y=s1(Xv,a),E=Vv(a),A=Kv(y.baseId,s),b=Qv(y.baseId,s),T=s===y.value;return F.jsx(dN,{asChild:!0,...E,focusable:!f,active:T,children:F.jsx(Sn.button,{type:"button",role:"tab","aria-selected":T,"aria-controls":b,"data-state":T?"active":"inactive","data-disabled":f?"":void 0,disabled:f,id:A,...g,ref:r,onMouseDown:tn(e.onMouseDown,x=>{!f&&x.button===0&&x.ctrlKey===!1?y.onValueChange(s):x.preventDefault()}),onKeyDown:tn(e.onKeyDown,x=>{[" ","Enter"].includes(x.key)&&y.onValueChange(s)}),onFocus:tn(e.onFocus,()=>{const x=y.activationMode!=="manual";!T&&!f&&x&&y.onValueChange(s)})})})});Yv.displayName=Xv;var qv="TabsContent",Wv=L.forwardRef((e,r)=>{const{__scopeTabs:a,value:s,forceMount:f,children:g,...y}=e,E=s1(qv,a),A=Kv(E.baseId,s),b=Qv(E.baseId,s),T=s===E.value,x=L.useRef(T);return L.useEffect(()=>{const S=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(S)},[]),F.jsx(Kl,{present:f||T,children:({present:S})=>F.jsx(Sn.div,{"data-state":T?"active":"inactive","data-orientation":E.orientation,role:"tabpanel","aria-labelledby":A,hidden:!S,id:b,tabIndex:0,...y,ref:r,style:{...e.style,animationDuration:x.current?"0s":void 0},children:S&&g})})});Wv.displayName=qv;function Kv(e,r){return`${e}-trigger-${r}`}function Qv(e,r){return`${e}-content-${r}`}var mN=Hv,pN=Zv,xN=Yv,yN=Wv;function vN({className:e,...r}){return F.jsx(mN,{"data-slot":"tabs",className:Wt("flex flex-col gap-2",e),...r})}function wN({className:e,...r}){return F.jsx(pN,{"data-slot":"tabs-list",className:Wt("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...r})}function a0({className:e,...r}){return F.jsx(xN,{"data-slot":"tabs-trigger",className:Wt("data-[state=active]:bg-background dark:data-[state=active]:text-foreground focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 text-foreground dark:text-muted-foreground inline-flex h-[calc(100%-1px)] flex-1 cursor-pointer items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...r})}function o0({className:e,...r}){return F.jsx(yN,{"data-slot":"tabs-content",className:Wt("flex-1 outline-none",e),...r})}function Jv(e,[r,a]){return Math.min(a,Math.max(r,e))}function bN(e){const r=L.useRef({value:e,previous:e});return L.useMemo(()=>(r.current.value!==e&&(r.current.previous=r.current.value,r.current.value=e),r.current.previous),[e])}function _N(e){const[r,a]=L.useState(void 0);return Ts(()=>{if(e){a({width:e.offsetWidth,height:e.offsetHeight});const s=new ResizeObserver(f=>{if(!Array.isArray(f)||!f.length)return;const g=f[0];let y,E;if("borderBoxSize"in g){const A=g.borderBoxSize,b=Array.isArray(A)?A[0]:A;y=b.inlineSize,E=b.blockSize}else y=e.offsetWidth,E=e.offsetHeight;a({width:y,height:E})});return s.observe(e,{box:"border-box"}),()=>s.unobserve(e)}else a(void 0)},[e]),r}var $v=["PageUp","PageDown"],ew=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],tw={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},ks="Slider",[T0,EN,AN]=kv(ks),[nw]=Wl(ks,[AN]),[CN,df]=nw(ks),rw=L.forwardRef((e,r)=>{const{name:a,min:s=0,max:f=100,step:g=1,orientation:y="horizontal",disabled:E=!1,minStepsBetweenThumbs:A=0,defaultValue:b=[s],value:T,onValueChange:x=()=>{},onValueCommit:S=()=>{},inverted:R=!1,form:I,...B}=e,P=L.useRef(new Set),k=L.useRef(0),j=y==="horizontal"?SN:TN,[H=[],ee]=rf({prop:T,defaultProp:b,onChange:le=>{var pe;(pe=[...P.current][k.current])==null||pe.focus(),x(le)}}),Q=L.useRef(H);function X(le){const te=MN(H,le);we(le,te)}function de(le){we(le,k.current)}function Y(){const le=Q.current[k.current];H[k.current]!==le&&S(H)}function we(le,te,{commit:pe}={commit:!1}){const Te=LN(g),ie=PN(Math.round((le-s)/g)*g+s,Te),re=Jv(ie,[s,f]);ee((xe=[])=>{const Me=ON(xe,re,te);if(kN(Me,A*g)){k.current=Me.indexOf(re);const He=String(Me)!==String(xe);return He&&pe&&S(Me),He?Me:xe}else return xe})}return F.jsx(CN,{scope:e.__scopeSlider,name:a,disabled:E,min:s,max:f,valueIndexToChangeRef:k,thumbs:P.current,values:H,orientation:y,form:I,children:F.jsx(T0.Provider,{scope:e.__scopeSlider,children:F.jsx(T0.Slot,{scope:e.__scopeSlider,children:F.jsx(j,{"aria-disabled":E,"data-disabled":E?"":void 0,...B,ref:r,onPointerDown:tn(B.onPointerDown,()=>{E||(Q.current=H)}),min:s,max:f,inverted:R,onSlideStart:E?void 0:X,onSlideMove:E?void 0:de,onSlideEnd:E?void 0:Y,onHomeKeyDown:()=>!E&&we(s,0,{commit:!0}),onEndKeyDown:()=>!E&&we(f,H.length-1,{commit:!0}),onStepKeyDown:({event:le,direction:te})=>{if(!E){const ie=$v.includes(le.key)||le.shiftKey&&ew.includes(le.key)?10:1,re=k.current,xe=H[re],Me=g*ie*te;we(xe+Me,re,{commit:!0})}}})})})})});rw.displayName=ks;var[iw,aw]=nw(ks,{startEdge:"left",endEdge:"right",size:"width",direction:1}),SN=L.forwardRef((e,r)=>{const{min:a,max:s,dir:f,inverted:g,onSlideStart:y,onSlideMove:E,onSlideEnd:A,onStepKeyDown:b,...T}=e,[x,S]=L.useState(null),R=Yn(r,j=>S(j)),I=L.useRef(void 0),B=o1(f),P=B==="ltr",k=P&&!g||!P&&g;function Z(j){const H=I.current||x.getBoundingClientRect(),ee=[0,H.width],X=l1(ee,k?[a,s]:[s,a]);return I.current=H,X(j-H.left)}return F.jsx(iw,{scope:e.__scopeSlider,startEdge:k?"left":"right",endEdge:k?"right":"left",direction:k?1:-1,size:"width",children:F.jsx(ow,{dir:B,"data-orientation":"horizontal",...T,ref:R,style:{...T.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:j=>{const H=Z(j.clientX);y==null||y(H)},onSlideMove:j=>{const H=Z(j.clientX);E==null||E(H)},onSlideEnd:()=>{I.current=void 0,A==null||A()},onStepKeyDown:j=>{const ee=tw[k?"from-left":"from-right"].includes(j.key);b==null||b({event:j,direction:ee?-1:1})}})})}),TN=L.forwardRef((e,r)=>{const{min:a,max:s,inverted:f,onSlideStart:g,onSlideMove:y,onSlideEnd:E,onStepKeyDown:A,...b}=e,T=L.useRef(null),x=Yn(r,T),S=L.useRef(void 0),R=!f;function I(B){const P=S.current||T.current.getBoundingClientRect(),k=[0,P.height],j=l1(k,R?[s,a]:[a,s]);return S.current=P,j(B-P.top)}return F.jsx(iw,{scope:e.__scopeSlider,startEdge:R?"bottom":"top",endEdge:R?"top":"bottom",size:"height",direction:R?1:-1,children:F.jsx(ow,{"data-orientation":"vertical",...b,ref:x,style:{...b.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:B=>{const P=I(B.clientY);g==null||g(P)},onSlideMove:B=>{const P=I(B.clientY);y==null||y(P)},onSlideEnd:()=>{S.current=void 0,E==null||E()},onStepKeyDown:B=>{const k=tw[R?"from-bottom":"from-top"].includes(B.key);A==null||A({event:B,direction:k?-1:1})}})})}),ow=L.forwardRef((e,r)=>{const{__scopeSlider:a,onSlideStart:s,onSlideMove:f,onSlideEnd:g,onHomeKeyDown:y,onEndKeyDown:E,onStepKeyDown:A,...b}=e,T=df(ks,a);return F.jsx(Sn.span,{...b,ref:r,onKeyDown:tn(e.onKeyDown,x=>{x.key==="Home"?(y(x),x.preventDefault()):x.key==="End"?(E(x),x.preventDefault()):$v.concat(ew).includes(x.key)&&(A(x),x.preventDefault())}),onPointerDown:tn(e.onPointerDown,x=>{const S=x.target;S.setPointerCapture(x.pointerId),x.preventDefault(),T.thumbs.has(S)?S.focus():s(x)}),onPointerMove:tn(e.onPointerMove,x=>{x.target.hasPointerCapture(x.pointerId)&&f(x)}),onPointerUp:tn(e.onPointerUp,x=>{const S=x.target;S.hasPointerCapture(x.pointerId)&&(S.releasePointerCapture(x.pointerId),g(x))})})}),sw="SliderTrack",lw=L.forwardRef((e,r)=>{const{__scopeSlider:a,...s}=e,f=df(sw,a);return F.jsx(Sn.span,{"data-disabled":f.disabled?"":void 0,"data-orientation":f.orientation,...s,ref:r})});lw.displayName=sw;var R0="SliderRange",cw=L.forwardRef((e,r)=>{const{__scopeSlider:a,...s}=e,f=df(R0,a),g=aw(R0,a),y=L.useRef(null),E=Yn(r,y),A=f.values.length,b=f.values.map(S=>dw(S,f.min,f.max)),T=A>1?Math.min(...b):0,x=100-Math.max(...b);return F.jsx(Sn.span,{"data-orientation":f.orientation,"data-disabled":f.disabled?"":void 0,...s,ref:E,style:{...e.style,[g.startEdge]:T+"%",[g.endEdge]:x+"%"}})});cw.displayName=R0;var N0="SliderThumb",uw=L.forwardRef((e,r)=>{const a=EN(e.__scopeSlider),[s,f]=L.useState(null),g=Yn(r,E=>f(E)),y=L.useMemo(()=>s?a().findIndex(E=>E.ref.current===s):-1,[a,s]);return F.jsx(RN,{...e,ref:g,index:y})}),RN=L.forwardRef((e,r)=>{const{__scopeSlider:a,index:s,name:f,...g}=e,y=df(N0,a),E=aw(N0,a),[A,b]=L.useState(null),T=Yn(r,Z=>b(Z)),x=A?y.form||!!A.closest("form"):!0,S=_N(A),R=y.values[s],I=R===void 0?0:dw(R,y.min,y.max),B=IN(s,y.values.length),P=S==null?void 0:S[E.size],k=P?DN(P,I,E.direction):0;return L.useEffect(()=>{if(A)return y.thumbs.add(A),()=>{y.thumbs.delete(A)}},[A,y.thumbs]),F.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[E.startEdge]:`calc(${I}% + ${k}px)`},children:[F.jsx(T0.ItemSlot,{scope:e.__scopeSlider,children:F.jsx(Sn.span,{role:"slider","aria-label":e["aria-label"]||B,"aria-valuemin":y.min,"aria-valuenow":R,"aria-valuemax":y.max,"aria-orientation":y.orientation,"data-orientation":y.orientation,"data-disabled":y.disabled?"":void 0,tabIndex:y.disabled?void 0:0,...g,ref:T,style:R===void 0?{display:"none"}:e.style,onFocus:tn(e.onFocus,()=>{y.valueIndexToChangeRef.current=s})})}),x&&F.jsx(fw,{name:f??(y.name?y.name+(y.values.length>1?"[]":""):void 0),form:y.form,value:R},s)]})});uw.displayName=N0;var NN="RadioBubbleInput",fw=L.forwardRef(({__scopeSlider:e,value:r,...a},s)=>{const f=L.useRef(null),g=Yn(f,s),y=bN(r);return L.useEffect(()=>{const E=f.current;if(!E)return;const A=window.HTMLInputElement.prototype,T=Object.getOwnPropertyDescriptor(A,"value").set;if(y!==r&&T){const x=new Event("input",{bubbles:!0});T.call(E,r),E.dispatchEvent(x)}},[y,r]),F.jsx(Sn.input,{style:{display:"none"},...a,ref:g,defaultValue:r})});fw.displayName=NN;function ON(e=[],r,a){const s=[...e];return s[a]=r,s.sort((f,g)=>f-g)}function dw(e,r,a){const g=100/(a-r)*(e-r);return Jv(g,[0,100])}function IN(e,r){return r>2?`Value ${e+1} of ${r}`:r===2?["Minimum","Maximum"][e]:void 0}function MN(e,r){if(e.length===1)return 0;const a=e.map(f=>Math.abs(f-r)),s=Math.min(...a);return a.indexOf(s)}function DN(e,r,a){const s=e/2,g=l1([0,50],[0,s]);return(s-g(r)*a)*a}function BN(e){return e.slice(0,-1).map((r,a)=>e[a+1]-r)}function kN(e,r){if(r>0){const a=BN(e);return Math.min(...a)>=r}return!0}function l1(e,r){return a=>{if(e[0]===e[1]||r[0]===r[1])return r[0];const s=(r[1]-r[0])/(e[1]-e[0]);return r[0]+s*(a-e[0])}}function LN(e){return(String(e).split(".")[1]||"").length}function PN(e,r){const a=Math.pow(10,r);return Math.round(e*a)/a}var zN=rw,UN=lw,FN=cw,jN=uw;function s0({className:e,defaultValue:r,value:a,min:s=0,max:f=100,...g}){const y=L.useMemo(()=>Array.isArray(a)?a:Array.isArray(r)?r:[s,f],[a,r,s,f]);return F.jsxs(zN,{"data-slot":"slider",defaultValue:r,value:a,min:s,max:f,className:Wt("relative flex w-full cursor-pointer touch-none items-center select-none data-disabled:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",e),...g,children:[F.jsx(UN,{"data-slot":"slider-track",className:Wt("bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"),children:F.jsx(FN,{"data-slot":"slider-range",className:Wt("bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full")})}),Array.from({length:y.length},(E,A)=>F.jsx(jN,{"data-slot":"slider-thumb",className:"border-primary ring-ring/50 block size-4 shrink-0 cursor-pointer rounded-full border bg-white shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"},A))]})}function VN({className:e,compact:r}){const{masterVolume:a,musicVolume:s,sfxVolume:f,setMasterVolume:g,setMusicVolume:y,setSfxVolume:E}=ty();return F.jsxs("div",{className:Wt("flex flex-col gap-3",r&&"gap-1",e),children:[F.jsxs("div",{className:"flex items-center gap-2",children:[F.jsx(oA,{className:"text-muted-foreground h-4 w-4"}),F.jsx("span",{className:"text-sm font-medium",children:"Volume"})]}),F.jsxs("div",{className:"space-y-1.5",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("label",{className:"text-muted-foreground text-xs",children:"Master"}),F.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[Math.round(a*100),"%"]})]}),F.jsx(s0,{value:[a*100],onValueChange:A=>g(A[0]/100),min:0,max:100,step:1,className:"w-full","aria-label":"Master volume"})]}),F.jsxs("div",{className:"space-y-1.5",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsxs("div",{className:"flex items-center gap-1.5",children:[F.jsx(QE,{className:"text-muted-foreground h-3 w-3"}),F.jsx("label",{className:"text-muted-foreground text-xs",children:"Music"})]}),F.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[Math.round(s*100),"%"]})]}),F.jsx(s0,{value:[s*100],onValueChange:A=>y(A[0]/100),min:0,max:100,step:1,className:"w-full","aria-label":"Music volume"})]}),F.jsxs("div",{className:"space-y-1.5",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsxs("div",{className:"flex items-center gap-1.5",children:[F.jsx(HE,{className:"text-muted-foreground h-3 w-3"}),F.jsx("label",{className:"text-muted-foreground text-xs",children:"SFX"})]}),F.jsxs("span",{className:"text-muted-foreground font-mono text-xs",children:[Math.round(f*100),"%"]})]}),F.jsx(s0,{value:[f*100],onValueChange:A=>E(A[0]/100),min:0,max:100,step:1,className:"w-full","aria-label":"SFX volume"})]})]})}const ex={idle:"Idle",connecting:"Waiting for server…",connected:"Ready for controllers",disconnected:"Disconnected",reconnecting:"Reconnecting…"},HN=()=>{const e=Bv(),{roomId:r,joinUrl:a,connectionStatus:s,players:f,lastError:g,gameState:y,toggleGameState:E,isChildMode:A}=e,[b,T]=L.useState(null),[x,S]=L.useState(null),[R,I]=L.useState(!1),[B,P]=L.useState(null);L.useEffect(()=>{if(A)return;let ee=!0;return t4.toDataURL(a,{margin:1,color:{dark:"#0f172a",light:"#ffffff"},width:320}).then(Q=>{ee&&(T(Q),S(null))}).catch(Q=>{ee&&S(Q.message)}),()=>{ee=!1}},[a,A]);const k=async()=>{if(a)try{await navigator.clipboard.writeText(a),I(!0),setTimeout(()=>I(!1),2e3)}catch{const ee=document.createElement("textarea");ee.value=a,ee.style.position="fixed",ee.style.opacity="0",document.body.appendChild(ee),ee.select();try{document.execCommand("copy"),I(!0),setTimeout(()=>I(!1),2e3)}catch{}document.body.removeChild(ee)}},Z=()=>{a&&window.open(a,"_blank","noopener,noreferrer")},j=async ee=>{try{await navigator.clipboard.writeText(ee),console.log(`Copied player ID: ${ee}`),P(ee),setTimeout(()=>P(null),1e3)}catch{const Q=document.createElement("textarea");Q.value=ee,Q.style.position="fixed",Q.style.opacity="0",document.body.appendChild(Q),Q.select();try{document.execCommand("copy"),console.log(`Copied player ID: ${ee}`),P(ee),setTimeout(()=>P(null),1e3)}catch{}document.body.removeChild(Q)}},H=L.useMemo(()=>{switch(s){case"connected":return"default";case"connecting":case"reconnecting":return"secondary";default:return"destructive"}},[s]);return A?null:F.jsxs("div",{className:"dark",children:[!A&&F.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-99999",children:F.jsx("div",{className:"mx-auto w-full",children:F.jsxs("div",{className:"flex items-center justify-between px-4 py-2",children:[F.jsx("div",{className:"flex items-center gap-3",children:F.jsxs("div",{children:[F.jsx("p",{className:"text-muted-foreground text-xs tracking-[0.18em] uppercase",children:"Room"}),F.jsx("p",{className:"text-foreground text-lg font-semibold",children:r})]})}),F.jsxs("div",{className:"pointer-events-auto flex items-center gap-3",children:[f.length>0&&F.jsxs("div",{className:"flex items-center -space-x-2",children:[f.slice(0,4).map(ee=>F.jsx(Co,{player:ee,size:"sm"},ee.id)),f.length>4&&F.jsxs("div",{className:"border-background bg-muted flex h-8 w-8 items-center justify-center rounded-full border-2 text-xs font-medium",children:["+",f.length-4]})]}),F.jsx(Br,{type:"button",variant:"ghost",size:"icon",onClick:E,"aria-label":y==="playing"?"Pause":"Play",className:"h-8 w-8",children:y==="playing"?F.jsx(ay,{className:"h-4 w-4"}):F.jsx(Lu,{className:"h-4 w-4"})})]})]})})}),y==="paused"&&F.jsx("div",{className:"pointer-events-none fixed inset-0 z-99998 flex items-center justify-center p-4",children:F.jsx("div",{className:"pointer-events-auto w-full max-w-2xl",children:F.jsx(JR,{className:"bg-card/20 flex max-h-[85vh] flex-col overflow-hidden border py-0 shadow-lg backdrop-blur-sm",children:F.jsxs(vN,{defaultValue:A?"settings":"room-code",className:"flex h-full w-full flex-col gap-0",children:[F.jsxs(wN,{className:"border-border grid w-full shrink-0 grid-cols-2 rounded-none border-b bg-transparent p-0",children:[!A&&F.jsxs(a0,{value:"room-code",className:"hover:bg-background/50 data-[state=active]:bg-background/50 flex items-center gap-2 rounded-none border-none bg-transparent",children:[F.jsx(oy,{className:"h-4 w-4"}),"Room Code"]}),A&&F.jsxs(a0,{value:"info",className:"hover:bg-background/50 data-[state=active]:bg-background/50 flex items-center gap-2 rounded-none border-none bg-transparent",children:[F.jsx(WE,{className:"h-4 w-4"}),"Platform"]}),F.jsxs(a0,{value:"settings",className:"hover:bg-background/50 data-[state=active]:bg-background/50 flex items-center gap-2 rounded-none border-none bg-transparent",children:[F.jsx(iA,{className:"h-4 w-4"}),"Settings"]})]}),!A&&F.jsx(o0,{value:"room-code",className:"mt-0 min-h-0 flex-1 overflow-y-auto",children:F.jsx("div",{className:"p-6",children:F.jsxs("div",{className:"grid grid-cols-1 gap-6 md:grid-cols-[auto_1fr]",children:[F.jsxs("div",{className:"flex flex-col items-start gap-4",children:[F.jsxs("div",{className:"space-y-2",children:[F.jsx(J2,{className:"text-3xl font-bold tracking-wider",children:r}),F.jsx(r0,{variant:H,className:"w-fit",children:ex[s]})]}),F.jsx("div",{className:"border-border bg-card w-48 shrink-0 overflow-hidden rounded-lg border-2 shadow-md",children:b?F.jsx("img",{src:b,alt:`Join room ${r}`,className:"w-full rounded bg-white"}):F.jsx("div",{className:"text-muted-foreground flex h-48 items-center justify-center text-sm",children:x?`QR failed: ${x}`:"Generating QR code…"})})]}),F.jsxs("div",{className:"flex flex-col gap-6",children:[F.jsxs("div",{className:"space-y-3",children:[F.jsx($2,{className:"text-xs tracking-[0.18em] uppercase",children:"Join URL"}),F.jsxs("div",{className:"flex gap-2",children:[F.jsx("input",{type:"text",readOnly:!0,value:a,className:"bg-background border-input text-foreground focus:ring-ring flex h-10 w-full rounded-md border px-3 py-2 font-mono text-xs focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50"}),F.jsx(Br,{type:"button",variant:"outline",size:"icon",onClick:k,className:"h-10 shrink-0","aria-label":"Copy join URL",children:R?F.jsx(ry,{className:"h-4 w-4"}):F.jsx(iy,{className:"h-4 w-4"})}),F.jsx(Br,{type:"button",variant:"outline",size:"icon",onClick:Z,className:"h-10 shrink-0","aria-label":"Open join URL in new tab",children:F.jsx(jE,{className:"h-4 w-4"})})]})]}),F.jsx("div",{className:"space-y-3",children:f.length===0?F.jsx("p",{className:"text-sm text-white",children:"Waiting for controllers to join…"}):F.jsxs(F.Fragment,{children:[F.jsxs("p",{className:"text-foreground text-sm font-medium",children:["Connected Players (",f.length,")"]}),F.jsx("ul",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:f.map(ee=>F.jsx("li",{className:"flex min-w-0 flex-col items-start gap-2",children:F.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[F.jsx(Co,{player:ee,size:"md"}),F.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-hidden",children:[F.jsx("span",{className:"text-card-foreground truncate text-sm font-medium",children:ee.label}),F.jsx("div",{onClick:()=>j(ee.id),className:"text-muted-foreground m-0 inline min-w-0 cursor-pointer truncate border-0 font-mono text-xs transition-colors hover:text-white",title:"Click to copy player ID",children:B===ee.id?"Copied!":ee.id.slice(0,8)})]})]})},ee.id))})]})}),g&&F.jsx(WR,{variant:"destructive",className:"w-full",children:F.jsx(KR,{children:g})}),F.jsx("div",{className:"mt-auto flex justify-end",children:F.jsxs(Br,{type:"button",onClick:E,size:"lg",children:[F.jsx(Lu,{className:"mr-2 h-5 w-5"}),"Play"]})})]})]})})}),A&&F.jsx(o0,{value:"info",className:"mt-0 min-h-0 flex-1 overflow-y-auto",children:F.jsx("div",{className:"p-6",children:F.jsxs("div",{className:"space-y-6",children:[F.jsxs("div",{className:"space-y-2",children:[F.jsx(J2,{className:"text-2xl font-bold tracking-wider",children:"Connected to Platform"}),F.jsx($2,{children:"This game is running inside the Air Jam Platform."})]}),F.jsxs("div",{className:"space-y-3",children:[F.jsxs("p",{className:"text-foreground text-sm font-medium",children:["Connected Players (",f.length,")"]}),F.jsx("ul",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:f.map(ee=>F.jsx("li",{className:"flex min-w-0 flex-col items-start gap-2",children:F.jsxs("div",{className:"flex w-full min-w-0 items-center gap-2",children:[F.jsx(Co,{player:ee,size:"md"}),F.jsx("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5 overflow-hidden",children:F.jsx("span",{className:"text-card-foreground truncate text-sm font-medium",children:ee.label})})]})},ee.id))})]}),F.jsx("div",{className:"pt-2",children:F.jsxs(Br,{type:"button",onClick:E,size:"lg",children:[F.jsx(Lu,{className:"mr-2 h-5 w-5"}),"Resume Game"]})})]})})}),F.jsx(o0,{value:"settings",className:"mt-0 min-h-0 flex-1 overflow-y-auto",children:F.jsx($R,{className:"pt-6 pb-6",children:F.jsxs("div",{className:"space-y-6",children:[F.jsx("div",{className:"space-y-4",children:F.jsx(VN,{})}),F.jsxs("div",{className:"space-y-4 border-t pt-4",children:[F.jsx("h3",{className:"text-sm font-semibold",children:"Connection"}),F.jsxs("div",{className:"space-y-2",children:[F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Status"}),F.jsx(r0,{variant:H,children:ex[s]})]}),F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Room ID"}),F.jsx("span",{className:"font-mono text-sm",children:r})]}),F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Players"}),F.jsx("span",{className:"text-sm font-medium",children:f.length})]})]})]}),F.jsxs("div",{className:"space-y-4 border-t pt-4",children:[F.jsx("h3",{className:"text-sm font-semibold",children:"Display"}),F.jsx("div",{className:"space-y-2",children:F.jsxs("div",{className:"flex items-center justify-between",children:[F.jsx("span",{className:"text-muted-foreground text-sm",children:"Game State"}),F.jsx(r0,{variant:"outline",className:"capitalize",children:y})]})})]})]})})})]})})})})]})},GN=()=>{const[e,r]=L.useState(!1);L.useEffect(()=>{const g=()=>{const y=document;r(!!(document.fullscreenElement||y.webkitFullscreenElement||y.mozFullScreenElement||y.msFullscreenElement))};return document.addEventListener("fullscreenchange",g),document.addEventListener("webkitfullscreenchange",g),document.addEventListener("mozfullscreenchange",g),document.addEventListener("msfullscreenchange",g),()=>{document.removeEventListener("fullscreenchange",g),document.removeEventListener("webkitfullscreenchange",g),document.removeEventListener("mozfullscreenchange",g),document.removeEventListener("msfullscreenchange",g)}},[]);const a=L.useCallback(async()=>{try{const g=document;(document.fullscreenElement||g.webkitFullscreenElement||g.mozFullScreenElement||g.msFullscreenElement)&&(document.exitFullscreen?await document.exitFullscreen():g.webkitExitFullscreen?await g.webkitExitFullscreen():g.mozCancelFullScreen?await g.mozCancelFullScreen():g.msExitFullscreen&&await g.msExitFullscreen())}catch(g){console.error("Error exiting fullscreen:",g)}},[]),s=L.useCallback(async g=>{try{const y=g||document.documentElement;y.requestFullscreen?await y.requestFullscreen():y.webkitRequestFullscreen?await y.webkitRequestFullscreen():y.mozRequestFullScreen?await y.mozRequestFullScreen():y.msRequestFullscreen&&await y.msRequestFullscreen()}catch(y){console.error("Error entering fullscreen:",y)}},[]),f=L.useCallback(async g=>{e?await a():await s(g)},[e,a,s]);return{isFullscreen:e,enterFullscreen:s,exitFullscreen:a,toggleFullscreen:f}};var Be;(function(e){e[e.QR_CODE=0]="QR_CODE",e[e.AZTEC=1]="AZTEC",e[e.CODABAR=2]="CODABAR",e[e.CODE_39=3]="CODE_39",e[e.CODE_93=4]="CODE_93",e[e.CODE_128=5]="CODE_128",e[e.DATA_MATRIX=6]="DATA_MATRIX",e[e.MAXICODE=7]="MAXICODE",e[e.ITF=8]="ITF",e[e.EAN_13=9]="EAN_13",e[e.EAN_8=10]="EAN_8",e[e.PDF_417=11]="PDF_417",e[e.RSS_14=12]="RSS_14",e[e.RSS_EXPANDED=13]="RSS_EXPANDED",e[e.UPC_A=14]="UPC_A",e[e.UPC_E=15]="UPC_E",e[e.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Be||(Be={}));var tx=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"]]),nx;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.URL=1]="URL"})(nx||(nx={}));function ZN(e){return Object.values(Be).includes(e)}var qu;(function(e){e[e.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",e[e.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(qu||(qu={}));var XN=(function(){function e(){}return e.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",e.SCAN_DEFAULT_FPS=2,e.DEFAULT_DISABLE_FLIP=!1,e.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,e.DEFAULT_SUPPORTED_SCAN_TYPE=[qu.SCAN_TYPE_CAMERA,qu.SCAN_TYPE_FILE],e})(),hw=(function(){function e(r,a){this.format=r,this.formatName=a}return e.prototype.toString=function(){return this.formatName},e.create=function(r){if(!tx.has(r))throw"".concat(r," not in html5QrcodeSupportedFormatsTextMap");return new e(r,tx.get(r))},e})(),rx=(function(){function e(){}return e.createFromText=function(r){var a={text:r};return{decodedText:r,result:a}},e.createFromQrcodeResult=function(r){return{decodedText:r.text,result:r}},e})(),O0;(function(e){e[e.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",e[e.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",e[e.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(O0||(O0={}));var YN=(function(){function e(){}return e.createFrom=function(r){return{errorMessage:r,type:O0.UNKWOWN_ERROR}},e})(),qN=(function(){function e(r){this.verbose=r}return e.prototype.log=function(r){this.verbose&&console.log(r)},e.prototype.warn=function(r){this.verbose&&console.warn(r)},e.prototype.logError=function(r,a){(this.verbose||a===!0)&&console.error(r)},e.prototype.logErrors=function(r){if(r.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(r)},e})();function $i(e){return typeof e>"u"||e===null}var Es=(function(){function e(){}return e.codeParseError=function(r){return"QR code parse error, error = ".concat(r)},e.errorGettingUserMedia=function(r){return"Error getting userMedia, error = ".concat(r)},e.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},e.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},e.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},e.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},e.scannerPaused=function(){return"Scanner paused"},e})(),gw=(function(){function e(){}return e.isMediaStreamConstraintsValid=function(r,a){if(typeof r!="object"){var s=typeof r;return a.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(s,"."),!0),!1}for(var f=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],g=new Set(f),y=Object.keys(r),E=0,A=y;E<A.length;E++){var b=A[E];if(g.has(b))return a.logError("".concat(b," is not supported videoConstaints."),!0),!1}return!0},e})(),Ul={exports:{}},WN=Ul.exports,ix;function KN(){return ix||(ix=1,(function(e,r){(function(a,s){s(r)})(WN,(function(a){function s(M){return M==null}var f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,n){M.__proto__=n}||function(M,n){for(var o in n)n.hasOwnProperty(o)&&(M[o]=n[o])};function g(M,n){f(M,n);function o(){this.constructor=M}M.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}function y(M,n){var o=Object.setPrototypeOf;o?o(M,n):M.__proto__=n}function E(M,n){n===void 0&&(n=M.constructor);var o=Error.captureStackTrace;o&&o(M,n)}var A=(function(M){g(n,M);function n(o){var l=this.constructor,u=M.call(this,o)||this;return Object.defineProperty(u,"name",{value:l.name,enumerable:!1}),y(u,l.prototype),E(u),u}return n})(Error);class b extends A{constructor(n=void 0){super(n),this.message=n}getKind(){return this.constructor.kind}}b.kind="Exception";class T extends b{}T.kind="ArgumentException";class x extends b{}x.kind="IllegalArgumentException";class S{constructor(n){if(this.binarizer=n,n===null)throw new x("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(n,o){return this.binarizer.getBlackRow(n,o)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(n,o,l,u){const d=this.binarizer.getLuminanceSource().crop(n,o,l,u);return new S(this.binarizer.createBinarizer(d))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const n=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new S(this.binarizer.createBinarizer(n))}rotateCounterClockwise45(){const n=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new S(this.binarizer.createBinarizer(n))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class R extends b{static getChecksumInstance(){return new R}}R.kind="ChecksumException";class I{constructor(n){this.source=n}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class B{static arraycopy(n,o,l,u,d){for(;d--;)l[u++]=n[o++]}static currentTimeMillis(){return Date.now()}}class P extends b{}P.kind="IndexOutOfBoundsException";class k extends P{constructor(n=void 0,o=void 0){super(o),this.index=n,this.message=o}}k.kind="ArrayIndexOutOfBoundsException";class Z{static fill(n,o){for(let l=0,u=n.length;l<u;l++)n[l]=o}static fillWithin(n,o,l,u){Z.rangeCheck(n.length,o,l);for(let d=o;d<l;d++)n[d]=u}static rangeCheck(n,o,l){if(o>l)throw new x("fromIndex("+o+") > toIndex("+l+")");if(o<0)throw new k(o);if(l>n)throw new k(l)}static asList(...n){return n}static create(n,o,l){return Array.from({length:n}).map(d=>Array.from({length:o}).fill(l))}static createInt32Array(n,o,l){return Array.from({length:n}).map(d=>Int32Array.from({length:o}).fill(l))}static equals(n,o){if(!n||!o||!n.length||!o.length||n.length!==o.length)return!1;for(let l=0,u=n.length;l<u;l++)if(n[l]!==o[l])return!1;return!0}static hashCode(n){if(n===null)return 0;let o=1;for(const l of n)o=31*o+l;return o}static fillUint8Array(n,o){for(let l=0;l!==n.length;l++)n[l]=o}static copyOf(n,o){return n.slice(0,o)}static copyOfUint8Array(n,o){if(n.length<=o){const l=new Uint8Array(o);return l.set(n),l}return n.slice(0,o)}static copyOfRange(n,o,l){const u=l-o,d=new Int32Array(u);return B.arraycopy(n,o,d,0,u),d}static binarySearch(n,o,l){l===void 0&&(l=Z.numberComparator);let u=0,d=n.length-1;for(;u<=d;){const m=d+u>>1,p=l(o,n[m]);if(p>0)u=m+1;else if(p<0)d=m-1;else return m}return-u-1}static numberComparator(n,o){return n-o}}class j{static numberOfTrailingZeros(n){let o;if(n===0)return 32;let l=31;return o=n<<16,o!==0&&(l-=16,n=o),o=n<<8,o!==0&&(l-=8,n=o),o=n<<4,o!==0&&(l-=4,n=o),o=n<<2,o!==0&&(l-=2,n=o),l-(n<<1>>>31)}static numberOfLeadingZeros(n){if(n===0)return 32;let o=1;return n>>>16||(o+=16,n<<=16),n>>>24||(o+=8,n<<=8),n>>>28||(o+=4,n<<=4),n>>>30||(o+=2,n<<=2),o-=n>>>31,o}static toHexString(n){return n.toString(16)}static toBinaryString(n){return String(parseInt(String(n),2))}static bitCount(n){return n=n-(n>>>1&1431655765),n=(n&858993459)+(n>>>2&858993459),n=n+(n>>>4)&252645135,n=n+(n>>>8),n=n+(n>>>16),n&63}static truncDivision(n,o){return Math.trunc(n/o)}static parseInt(n,o=void 0){return parseInt(n,o)}}j.MIN_VALUE_32_BITS=-2147483648,j.MAX_VALUE=Number.MAX_SAFE_INTEGER;class H{constructor(n,o){n===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=n,o==null?this.bits=H.makeArray(n):this.bits=o)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(n){if(n>this.bits.length*32){const o=H.makeArray(n);B.arraycopy(this.bits,0,o,0,this.bits.length),this.bits=o}}get(n){return(this.bits[Math.floor(n/32)]&1<<(n&31))!==0}set(n){this.bits[Math.floor(n/32)]|=1<<(n&31)}flip(n){this.bits[Math.floor(n/32)]^=1<<(n&31)}getNextSet(n){const o=this.size;if(n>=o)return o;const l=this.bits;let u=Math.floor(n/32),d=l[u];d&=~((1<<(n&31))-1);const m=l.length;for(;d===0;){if(++u===m)return o;d=l[u]}const p=u*32+j.numberOfTrailingZeros(d);return p>o?o:p}getNextUnset(n){const o=this.size;if(n>=o)return o;const l=this.bits;let u=Math.floor(n/32),d=~l[u];d&=~((1<<(n&31))-1);const m=l.length;for(;d===0;){if(++u===m)return o;d=~l[u]}const p=u*32+j.numberOfTrailingZeros(d);return p>o?o:p}setBulk(n,o){this.bits[Math.floor(n/32)]=o}setRange(n,o){if(o<n||n<0||o>this.size)throw new x;if(o===n)return;o--;const l=Math.floor(n/32),u=Math.floor(o/32),d=this.bits;for(let m=l;m<=u;m++){const p=m>l?0:n&31,C=(2<<(m<u?31:o&31))-(1<<p);d[m]|=C}}clear(){const n=this.bits.length,o=this.bits;for(let l=0;l<n;l++)o[l]=0}isRange(n,o,l){if(o<n||n<0||o>this.size)throw new x;if(o===n)return!0;o--;const u=Math.floor(n/32),d=Math.floor(o/32),m=this.bits;for(let p=u;p<=d;p++){const w=p>u?0:n&31,N=(2<<(p<d?31:o&31))-(1<<w)&4294967295;if((m[p]&N)!==(l?N:0))return!1}return!0}appendBit(n){this.ensureCapacity(this.size+1),n&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(n,o){if(o<0||o>32)throw new x("Num bits must be between 0 and 32");this.ensureCapacity(this.size+o);for(let l=o;l>0;l--)this.appendBit((n>>l-1&1)===1)}appendBitArray(n){const o=n.size;this.ensureCapacity(this.size+o);for(let l=0;l<o;l++)this.appendBit(n.get(l))}xor(n){if(this.size!==n.size)throw new x("Sizes don't match");const o=this.bits;for(let l=0,u=o.length;l<u;l++)o[l]^=n.bits[l]}toBytes(n,o,l,u){for(let d=0;d<u;d++){let m=0;for(let p=0;p<8;p++)this.get(n)&&(m|=1<<7-p),n++;o[l+d]=m}}getBitArray(){return this.bits}reverse(){const n=new Int32Array(this.bits.length),o=Math.floor((this.size-1)/32),l=o+1,u=this.bits;for(let d=0;d<l;d++){let m=u[d];m=m>>1&1431655765|(m&1431655765)<<1,m=m>>2&858993459|(m&858993459)<<2,m=m>>4&252645135|(m&252645135)<<4,m=m>>8&16711935|(m&16711935)<<8,m=m>>16&65535|(m&65535)<<16,n[o-d]=m}if(this.size!==l*32){const d=l*32-this.size;let m=n[0]>>>d;for(let p=1;p<l;p++){const w=n[p];m|=w<<32-d,n[p-1]=m,m=w>>>d}n[l-1]=m}this.bits=n}static makeArray(n){return new Int32Array(Math.floor((n+31)/32))}equals(n){if(!(n instanceof H))return!1;const o=n;return this.size===o.size&&Z.equals(this.bits,o.bits)}hashCode(){return 31*this.size+Z.hashCode(this.bits)}toString(){let n="";for(let o=0,l=this.size;o<l;o++)(o&7)===0&&(n+=" "),n+=this.get(o)?"X":".";return n}clone(){return new H(this.size,this.bits.slice())}}var ee;(function(M){M[M.OTHER=0]="OTHER",M[M.PURE_BARCODE=1]="PURE_BARCODE",M[M.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",M[M.TRY_HARDER=3]="TRY_HARDER",M[M.CHARACTER_SET=4]="CHARACTER_SET",M[M.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",M[M.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",M[M.ASSUME_GS1=7]="ASSUME_GS1",M[M.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",M[M.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",M[M.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(ee||(ee={}));var Q=ee;class X extends b{static getFormatInstance(){return new X}}X.kind="FormatException";var de;(function(M){M[M.Cp437=0]="Cp437",M[M.ISO8859_1=1]="ISO8859_1",M[M.ISO8859_2=2]="ISO8859_2",M[M.ISO8859_3=3]="ISO8859_3",M[M.ISO8859_4=4]="ISO8859_4",M[M.ISO8859_5=5]="ISO8859_5",M[M.ISO8859_6=6]="ISO8859_6",M[M.ISO8859_7=7]="ISO8859_7",M[M.ISO8859_8=8]="ISO8859_8",M[M.ISO8859_9=9]="ISO8859_9",M[M.ISO8859_10=10]="ISO8859_10",M[M.ISO8859_11=11]="ISO8859_11",M[M.ISO8859_13=12]="ISO8859_13",M[M.ISO8859_14=13]="ISO8859_14",M[M.ISO8859_15=14]="ISO8859_15",M[M.ISO8859_16=15]="ISO8859_16",M[M.SJIS=16]="SJIS",M[M.Cp1250=17]="Cp1250",M[M.Cp1251=18]="Cp1251",M[M.Cp1252=19]="Cp1252",M[M.Cp1256=20]="Cp1256",M[M.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",M[M.UTF8=22]="UTF8",M[M.ASCII=23]="ASCII",M[M.Big5=24]="Big5",M[M.GB18030=25]="GB18030",M[M.EUC_KR=26]="EUC_KR"})(de||(de={}));class Y{constructor(n,o,l,...u){this.valueIdentifier=n,this.name=l,typeof o=="number"?this.values=Int32Array.from([o]):this.values=o,this.otherEncodingNames=u,Y.VALUE_IDENTIFIER_TO_ECI.set(n,this),Y.NAME_TO_ECI.set(l,this);const d=this.values;for(let m=0,p=d.length;m!==p;m++){const w=d[m];Y.VALUES_TO_ECI.set(w,this)}for(const m of u)Y.NAME_TO_ECI.set(m,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(n){if(n<0||n>=900)throw new X("incorect value");const o=Y.VALUES_TO_ECI.get(n);if(o===void 0)throw new X("incorect value");return o}static getCharacterSetECIByName(n){const o=Y.NAME_TO_ECI.get(n);if(o===void 0)throw new X("incorect value");return o}equals(n){if(!(n instanceof Y))return!1;const o=n;return this.getName()===o.getName()}}Y.VALUE_IDENTIFIER_TO_ECI=new Map,Y.VALUES_TO_ECI=new Map,Y.NAME_TO_ECI=new Map,Y.Cp437=new Y(de.Cp437,Int32Array.from([0,2]),"Cp437"),Y.ISO8859_1=new Y(de.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),Y.ISO8859_2=new Y(de.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),Y.ISO8859_3=new Y(de.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),Y.ISO8859_4=new Y(de.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),Y.ISO8859_5=new Y(de.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),Y.ISO8859_6=new Y(de.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),Y.ISO8859_7=new Y(de.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),Y.ISO8859_8=new Y(de.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),Y.ISO8859_9=new Y(de.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),Y.ISO8859_10=new Y(de.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),Y.ISO8859_11=new Y(de.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),Y.ISO8859_13=new Y(de.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),Y.ISO8859_14=new Y(de.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),Y.ISO8859_15=new Y(de.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),Y.ISO8859_16=new Y(de.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),Y.SJIS=new Y(de.SJIS,20,"SJIS","Shift_JIS"),Y.Cp1250=new Y(de.Cp1250,21,"Cp1250","windows-1250"),Y.Cp1251=new Y(de.Cp1251,22,"Cp1251","windows-1251"),Y.Cp1252=new Y(de.Cp1252,23,"Cp1252","windows-1252"),Y.Cp1256=new Y(de.Cp1256,24,"Cp1256","windows-1256"),Y.UnicodeBigUnmarked=new Y(de.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),Y.UTF8=new Y(de.UTF8,26,"UTF8","UTF-8"),Y.ASCII=new Y(de.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),Y.Big5=new Y(de.Big5,28,"Big5"),Y.GB18030=new Y(de.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),Y.EUC_KR=new Y(de.EUC_KR,30,"EUC_KR","EUC-KR");class we extends b{}we.kind="UnsupportedOperationException";class le{static decode(n,o){const l=this.encodingName(o);return this.customDecoder?this.customDecoder(n,l):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(l)?this.decodeFallback(n,l):new TextDecoder(l).decode(n)}static shouldDecodeOnFallback(n){return!le.isBrowser()&&n==="ISO-8859-1"}static encode(n,o){const l=this.encodingName(o);return this.customEncoder?this.customEncoder(n,l):typeof TextEncoder>"u"?this.encodeFallback(n):new TextEncoder().encode(n)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(n){return typeof n=="string"?n:n.getName()}static encodingCharacterSet(n){return n instanceof Y?n:Y.getCharacterSetECIByName(n)}static decodeFallback(n,o){const l=this.encodingCharacterSet(o);if(le.isDecodeFallbackSupported(l)){let u="";for(let d=0,m=n.length;d<m;d++){let p=n[d].toString(16);p.length<2&&(p="0"+p),u+="%"+p}return decodeURIComponent(u)}if(l.equals(Y.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(n.buffer));throw new we(`Encoding ${this.encodingName(o)} not supported by fallback.`)}static isDecodeFallbackSupported(n){return n.equals(Y.UTF8)||n.equals(Y.ISO8859_1)||n.equals(Y.ASCII)}static encodeFallback(n){const l=btoa(unescape(encodeURIComponent(n))).split(""),u=[];for(let d=0;d<l.length;d++)u.push(l[d].charCodeAt(0));return new Uint8Array(u)}}class te{static castAsNonUtf8Char(n,o=null){const l=o?o.getName():this.ISO88591;return le.decode(new Uint8Array([n]),l)}static guessEncoding(n,o){if(o!=null&&o.get(Q.CHARACTER_SET)!==void 0)return o.get(Q.CHARACTER_SET).toString();const l=n.length;let u=!0,d=!0,m=!0,p=0,w=0,C=0,N=0,D=0,z=0,G=0,W=0,J=0,ae=0,he=0;const Ne=n.length>3&&n[0]===239&&n[1]===187&&n[2]===191;for(let Se=0;Se<l&&(u||d||m);Se++){const Ae=n[Se]&255;m&&(p>0?(Ae&128)===0?m=!1:p--:(Ae&128)!==0&&((Ae&64)===0?m=!1:(p++,(Ae&32)===0?w++:(p++,(Ae&16)===0?C++:(p++,(Ae&8)===0?N++:m=!1))))),u&&(Ae>127&&Ae<160?u=!1:Ae>159&&(Ae<192||Ae===215||Ae===247)&&he++),d&&(D>0?Ae<64||Ae===127||Ae>252?d=!1:D--:Ae===128||Ae===160||Ae>239?d=!1:Ae>160&&Ae<224?(z++,W=0,G++,G>J&&(J=G)):Ae>127?(D++,G=0,W++,W>ae&&(ae=W)):(G=0,W=0))}return m&&p>0&&(m=!1),d&&D>0&&(d=!1),m&&(Ne||w+C+N>0)?te.UTF8:d&&(te.ASSUME_SHIFT_JIS||J>=3||ae>=3)?te.SHIFT_JIS:u&&d?J===2&&z===2||he*10>=l?te.SHIFT_JIS:te.ISO88591:u?te.ISO88591:d?te.SHIFT_JIS:m?te.UTF8:te.PLATFORM_DEFAULT_ENCODING}static format(n,...o){let l=-1;function u(m,p,w,C,N,D){if(m==="%%")return"%";if(o[++l]===void 0)return;m=C?parseInt(C.substr(1)):void 0;let z=N?parseInt(N.substr(1)):void 0,G;switch(D){case"s":G=o[l];break;case"c":G=o[l][0];break;case"f":G=parseFloat(o[l]).toFixed(m);break;case"p":G=parseFloat(o[l]).toPrecision(m);break;case"e":G=parseFloat(o[l]).toExponential(m);break;case"x":G=parseInt(o[l]).toString(z||16);break;case"d":G=parseFloat(parseInt(o[l],z||10).toPrecision(m)).toFixed(0);break}G=typeof G=="object"?JSON.stringify(G):(+G).toString(z);let W=parseInt(w),J=w&&w[0]+""=="0"?"0":" ";for(;G.length<W;)G=p!==void 0?G+J:J+G;return G}let d=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return n.replace(d,u)}static getBytes(n,o){return le.encode(n,o)}static getCharCode(n,o=0){return n.charCodeAt(o)}static getCharAt(n){return String.fromCharCode(n)}}te.SHIFT_JIS=Y.SJIS.getName(),te.GB2312="GB2312",te.ISO88591=Y.ISO8859_1.getName(),te.EUC_JP="EUC_JP",te.UTF8=Y.UTF8.getName(),te.PLATFORM_DEFAULT_ENCODING=te.UTF8,te.ASSUME_SHIFT_JIS=!1;class pe{constructor(n=""){this.value=n}enableDecoding(n){return this.encoding=n,this}append(n){return typeof n=="string"?this.value+=n.toString():this.encoding?this.value+=te.castAsNonUtf8Char(n,this.encoding):this.value+=String.fromCharCode(n),this}appendChars(n,o,l){for(let u=o;o<o+l;u++)this.append(n[u]);return this}length(){return this.value.length}charAt(n){return this.value.charAt(n)}deleteCharAt(n){this.value=this.value.substr(0,n)+this.value.substring(n+1)}setCharAt(n,o){this.value=this.value.substr(0,n)+o+this.value.substr(n+1)}substring(n,o){return this.value.substring(n,o)}setLengthToZero(){this.value=""}toString(){return this.value}insert(n,o){this.value=this.value.substr(0,n)+o+this.value.substr(n+o.length)}}class Te{constructor(n,o,l,u){if(this.width=n,this.height=o,this.rowSize=l,this.bits=u,o==null&&(o=n),this.height=o,n<1||o<1)throw new x("Both dimensions must be greater than 0");l==null&&(l=Math.floor((n+31)/32)),this.rowSize=l,u==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(n){const o=n.length,l=n[0].length,u=new Te(l,o);for(let d=0;d<o;d++){const m=n[d];for(let p=0;p<l;p++)m[p]&&u.set(p,d)}return u}static parseFromString(n,o,l){if(n===null)throw new x("stringRepresentation cannot be null");const u=new Array(n.length);let d=0,m=0,p=-1,w=0,C=0;for(;C<n.length;)if(n.charAt(C)===`
251
- `||n.charAt(C)==="\r"){if(d>m){if(p===-1)p=d-m;else if(d-m!==p)throw new x("row lengths do not match");m=d,w++}C++}else if(n.substring(C,C+o.length)===o)C+=o.length,u[d]=!0,d++;else if(n.substring(C,C+l.length)===l)C+=l.length,u[d]=!1,d++;else throw new x("illegal character encountered: "+n.substring(C));if(d>m){if(p===-1)p=d-m;else if(d-m!==p)throw new x("row lengths do not match");w++}const N=new Te(p,w);for(let D=0;D<d;D++)u[D]&&N.set(Math.floor(D%p),Math.floor(D/p));return N}get(n,o){const l=o*this.rowSize+Math.floor(n/32);return(this.bits[l]>>>(n&31)&1)!==0}set(n,o){const l=o*this.rowSize+Math.floor(n/32);this.bits[l]|=1<<(n&31)&4294967295}unset(n,o){const l=o*this.rowSize+Math.floor(n/32);this.bits[l]&=~(1<<(n&31)&4294967295)}flip(n,o){const l=o*this.rowSize+Math.floor(n/32);this.bits[l]^=1<<(n&31)&4294967295}xor(n){if(this.width!==n.getWidth()||this.height!==n.getHeight()||this.rowSize!==n.getRowSize())throw new x("input matrix dimensions do not match");const o=new H(Math.floor(this.width/32)+1),l=this.rowSize,u=this.bits;for(let d=0,m=this.height;d<m;d++){const p=d*l,w=n.getRow(d,o).getBitArray();for(let C=0;C<l;C++)u[p+C]^=w[C]}}clear(){const n=this.bits,o=n.length;for(let l=0;l<o;l++)n[l]=0}setRegion(n,o,l,u){if(o<0||n<0)throw new x("Left and top must be nonnegative");if(u<1||l<1)throw new x("Height and width must be at least 1");const d=n+l,m=o+u;if(m>this.height||d>this.width)throw new x("The region must fit inside the matrix");const p=this.rowSize,w=this.bits;for(let C=o;C<m;C++){const N=C*p;for(let D=n;D<d;D++)w[N+Math.floor(D/32)]|=1<<(D&31)&4294967295}}getRow(n,o){o==null||o.getSize()<this.width?o=new H(this.width):o.clear();const l=this.rowSize,u=this.bits,d=n*l;for(let m=0;m<l;m++)o.setBulk(m*32,u[d+m]);return o}setRow(n,o){B.arraycopy(o.getBitArray(),0,this.bits,n*this.rowSize,this.rowSize)}rotate180(){const n=this.getWidth(),o=this.getHeight();let l=new H(n),u=new H(n);for(let d=0,m=Math.floor((o+1)/2);d<m;d++)l=this.getRow(d,l),u=this.getRow(o-1-d,u),l.reverse(),u.reverse(),this.setRow(d,u),this.setRow(o-1-d,l)}getEnclosingRectangle(){const n=this.width,o=this.height,l=this.rowSize,u=this.bits;let d=n,m=o,p=-1,w=-1;for(let C=0;C<o;C++)for(let N=0;N<l;N++){const D=u[C*l+N];if(D!==0){if(C<m&&(m=C),C>w&&(w=C),N*32<d){let z=0;for(;(D<<31-z&4294967295)===0;)z++;N*32+z<d&&(d=N*32+z)}if(N*32+31>p){let z=31;for(;!(D>>>z);)z--;N*32+z>p&&(p=N*32+z)}}}return p<d||w<m?null:Int32Array.from([d,m,p-d+1,w-m+1])}getTopLeftOnBit(){const n=this.rowSize,o=this.bits;let l=0;for(;l<o.length&&o[l]===0;)l++;if(l===o.length)return null;const u=l/n;let d=l%n*32;const m=o[l];let p=0;for(;(m<<31-p&4294967295)===0;)p++;return d+=p,Int32Array.from([d,u])}getBottomRightOnBit(){const n=this.rowSize,o=this.bits;let l=o.length-1;for(;l>=0&&o[l]===0;)l--;if(l<0)return null;const u=Math.floor(l/n);let d=Math.floor(l%n)*32;const m=o[l];let p=31;for(;!(m>>>p);)p--;return d+=p,Int32Array.from([d,u])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(n){if(!(n instanceof Te))return!1;const o=n;return this.width===o.width&&this.height===o.height&&this.rowSize===o.rowSize&&Z.equals(this.bits,o.bits)}hashCode(){let n=this.width;return n=31*n+this.width,n=31*n+this.height,n=31*n+this.rowSize,n=31*n+Z.hashCode(this.bits),n}toString(n="X ",o=" ",l=`
252
- `){return this.buildToString(n,o,l)}buildToString(n,o,l){let u=new pe;for(let d=0,m=this.height;d<m;d++){for(let p=0,w=this.width;p<w;p++)u.append(this.get(p,d)?n:o);u.append(l)}return u.toString()}clone(){return new Te(this.width,this.height,this.rowSize,this.bits.slice())}}class ie extends b{static getNotFoundInstance(){return new ie}}ie.kind="NotFoundException";class re extends I{constructor(n){super(n),this.luminances=re.EMPTY,this.buckets=new Int32Array(re.LUMINANCE_BUCKETS)}getBlackRow(n,o){const l=this.getLuminanceSource(),u=l.getWidth();o==null||o.getSize()<u?o=new H(u):o.clear(),this.initArrays(u);const d=l.getRow(n,this.luminances),m=this.buckets;for(let w=0;w<u;w++)m[(d[w]&255)>>re.LUMINANCE_SHIFT]++;const p=re.estimateBlackPoint(m);if(u<3)for(let w=0;w<u;w++)(d[w]&255)<p&&o.set(w);else{let w=d[0]&255,C=d[1]&255;for(let N=1;N<u-1;N++){const D=d[N+1]&255;(C*4-w-D)/2<p&&o.set(N),w=C,C=D}}return o}getBlackMatrix(){const n=this.getLuminanceSource(),o=n.getWidth(),l=n.getHeight(),u=new Te(o,l);this.initArrays(o);const d=this.buckets;for(let w=1;w<5;w++){const C=Math.floor(l*w/5),N=n.getRow(C,this.luminances),D=Math.floor(o*4/5);for(let z=Math.floor(o/5);z<D;z++){const G=N[z]&255;d[G>>re.LUMINANCE_SHIFT]++}}const m=re.estimateBlackPoint(d),p=n.getMatrix();for(let w=0;w<l;w++){const C=w*o;for(let N=0;N<o;N++)(p[C+N]&255)<m&&u.set(N,w)}return u}createBinarizer(n){return new re(n)}initArrays(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));const o=this.buckets;for(let l=0;l<re.LUMINANCE_BUCKETS;l++)o[l]=0}static estimateBlackPoint(n){const o=n.length;let l=0,u=0,d=0;for(let N=0;N<o;N++)n[N]>d&&(u=N,d=n[N]),n[N]>l&&(l=n[N]);let m=0,p=0;for(let N=0;N<o;N++){const D=N-u,z=n[N]*D*D;z>p&&(m=N,p=z)}if(u>m){const N=u;u=m,m=N}if(m-u<=o/16)throw new ie;let w=m-1,C=-1;for(let N=m-1;N>u;N--){const D=N-u,z=D*D*(m-N)*(l-n[N]);z>C&&(w=N,C=z)}return w<<re.LUMINANCE_SHIFT}}re.LUMINANCE_BITS=5,re.LUMINANCE_SHIFT=8-re.LUMINANCE_BITS,re.LUMINANCE_BUCKETS=1<<re.LUMINANCE_BITS,re.EMPTY=Uint8ClampedArray.from([0]);class xe extends re{constructor(n){super(n),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const n=this.getLuminanceSource(),o=n.getWidth(),l=n.getHeight();if(o>=xe.MINIMUM_DIMENSION&&l>=xe.MINIMUM_DIMENSION){const u=n.getMatrix();let d=o>>xe.BLOCK_SIZE_POWER;(o&xe.BLOCK_SIZE_MASK)!==0&&d++;let m=l>>xe.BLOCK_SIZE_POWER;(l&xe.BLOCK_SIZE_MASK)!==0&&m++;const p=xe.calculateBlackPoints(u,d,m,o,l),w=new Te(o,l);xe.calculateThresholdForBlock(u,d,m,o,l,p,w),this.matrix=w}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(n){return new xe(n)}static calculateThresholdForBlock(n,o,l,u,d,m,p){const w=d-xe.BLOCK_SIZE,C=u-xe.BLOCK_SIZE;for(let N=0;N<l;N++){let D=N<<xe.BLOCK_SIZE_POWER;D>w&&(D=w);const z=xe.cap(N,2,l-3);for(let G=0;G<o;G++){let W=G<<xe.BLOCK_SIZE_POWER;W>C&&(W=C);const J=xe.cap(G,2,o-3);let ae=0;for(let Ne=-2;Ne<=2;Ne++){const Se=m[z+Ne];ae+=Se[J-2]+Se[J-1]+Se[J]+Se[J+1]+Se[J+2]}const he=ae/25;xe.thresholdBlock(n,W,D,he,u,p)}}}static cap(n,o,l){return n<o?o:n>l?l:n}static thresholdBlock(n,o,l,u,d,m){for(let p=0,w=l*d+o;p<xe.BLOCK_SIZE;p++,w+=d)for(let C=0;C<xe.BLOCK_SIZE;C++)(n[w+C]&255)<=u&&m.set(o+C,l+p)}static calculateBlackPoints(n,o,l,u,d){const m=d-xe.BLOCK_SIZE,p=u-xe.BLOCK_SIZE,w=new Array(l);for(let C=0;C<l;C++){w[C]=new Int32Array(o);let N=C<<xe.BLOCK_SIZE_POWER;N>m&&(N=m);for(let D=0;D<o;D++){let z=D<<xe.BLOCK_SIZE_POWER;z>p&&(z=p);let G=0,W=255,J=0;for(let he=0,Ne=N*u+z;he<xe.BLOCK_SIZE;he++,Ne+=u){for(let Se=0;Se<xe.BLOCK_SIZE;Se++){const Ae=n[Ne+Se]&255;G+=Ae,Ae<W&&(W=Ae),Ae>J&&(J=Ae)}if(J-W>xe.MIN_DYNAMIC_RANGE)for(he++,Ne+=u;he<xe.BLOCK_SIZE;he++,Ne+=u)for(let Se=0;Se<xe.BLOCK_SIZE;Se++)G+=n[Ne+Se]&255}let ae=G>>xe.BLOCK_SIZE_POWER*2;if(J-W<=xe.MIN_DYNAMIC_RANGE&&(ae=W/2,C>0&&D>0)){const he=(w[C-1][D]+2*w[C][D-1]+w[C-1][D-1])/4;W<he&&(ae=he)}w[C][D]=ae}}return w}}xe.BLOCK_SIZE_POWER=3,xe.BLOCK_SIZE=1<<xe.BLOCK_SIZE_POWER,xe.BLOCK_SIZE_MASK=xe.BLOCK_SIZE-1,xe.MINIMUM_DIMENSION=xe.BLOCK_SIZE*5,xe.MIN_DYNAMIC_RANGE=24;class Me{constructor(n,o){this.width=n,this.height=o}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(n,o,l,u){throw new we("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new we("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new we("This luminance source does not support rotation by 45 degrees.")}toString(){const n=new Uint8ClampedArray(this.width);let o=new pe;for(let l=0;l<this.height;l++){const u=this.getRow(l,n);for(let d=0;d<this.width;d++){const m=u[d]&255;let p;m<64?p="#":m<128?p="+":m<192?p=".":p=" ",o.append(p)}o.append(`
253
- `)}return o.toString()}}class He extends Me{constructor(n){super(n.getWidth(),n.getHeight()),this.delegate=n}getRow(n,o){const l=this.delegate.getRow(n,o),u=this.getWidth();for(let d=0;d<u;d++)l[d]=255-(l[d]&255);return l}getMatrix(){const n=this.delegate.getMatrix(),o=this.getWidth()*this.getHeight(),l=new Uint8ClampedArray(o);for(let u=0;u<o;u++)l[u]=255-(n[u]&255);return l}isCropSupported(){return this.delegate.isCropSupported()}crop(n,o,l,u){return new He(this.delegate.crop(n,o,l,u))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new He(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new He(this.delegate.rotateCounterClockwise45())}}class qe extends Me{constructor(n){super(n.width,n.height),this.canvas=n,this.tempCanvasElement=null,this.buffer=qe.makeBufferFromCanvasImageData(n)}static makeBufferFromCanvasImageData(n){const o=n.getContext("2d").getImageData(0,0,n.width,n.height);return qe.toGrayscaleBuffer(o.data,n.width,n.height)}static toGrayscaleBuffer(n,o,l){const u=new Uint8ClampedArray(o*l);for(let d=0,m=0,p=n.length;d<p;d+=4,m++){let w;if(n[d+3]===0)w=255;else{const N=n[d],D=n[d+1],z=n[d+2];w=306*N+601*D+117*z+512>>10}u[m]=w}return u}getRow(n,o){if(n<0||n>=this.getHeight())throw new x("Requested row is outside the image: "+n);const l=this.getWidth(),u=n*l;return o===null?o=this.buffer.slice(u,u+l):(o.length<l&&(o=new Uint8ClampedArray(l)),o.set(this.buffer.slice(u,u+l))),o}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(n,o,l,u){return super.crop(n,o,l,u),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement}rotate(n){const o=this.getTempCanvasElement(),l=o.getContext("2d"),u=n*qe.DEGREE_TO_RADIANS,d=this.canvas.width,m=this.canvas.height,p=Math.ceil(Math.abs(Math.cos(u))*d+Math.abs(Math.sin(u))*m),w=Math.ceil(Math.abs(Math.sin(u))*d+Math.abs(Math.cos(u))*m);return o.width=p,o.height=w,l.translate(p/2,w/2),l.rotate(u),l.drawImage(this.canvas,d/-2,m/-2),this.buffer=qe.makeBufferFromCanvasImageData(o),this}invert(){return new He(this)}}qe.DEGREE_TO_RADIANS=Math.PI/180;class K{constructor(n,o,l){this.deviceId=n,this.label=o,this.kind="videoinput",this.groupId=l||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var oe=(globalThis||ea||self||window||void 0)&&(globalThis||ea||self||window||void 0).__awaiter||function(M,n,o,l){function u(d){return d instanceof o?d:new o(function(m){m(d)})}return new(o||(o=Promise))(function(d,m){function p(N){try{C(l.next(N))}catch(D){m(D)}}function w(N){try{C(l.throw(N))}catch(D){m(D)}}function C(N){N.done?d(N.value):u(N.value).then(p,w)}C((l=l.apply(M,n||[])).next())})};class Re{constructor(n,o=500,l){this.reader=n,this.timeBetweenScansMillis=o,this._hints=l,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(n){this._timeBetweenDecodingAttempts=n<0?0:n}set hints(n){this._hints=n||null}get hints(){return this._hints}listVideoInputDevices(){return oe(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 n=yield navigator.mediaDevices.enumerateDevices(),o=[];for(const l of n){const u=l.kind==="video"?"videoinput":l.kind;if(u!=="videoinput")continue;const d=l.deviceId||l.id,m=l.label||`Video device ${o.length+1}`,p=l.groupId,w={deviceId:d,label:m,kind:u,groupId:p};o.push(w)}return o})}getVideoInputDevices(){return oe(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(o=>new K(o.deviceId,o.label))})}findDeviceById(n){return oe(this,void 0,void 0,function*(){const o=yield this.listVideoInputDevices();return o?o.find(l=>l.deviceId===n):null})}decodeFromInputVideoDevice(n,o){return oe(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(n,o)})}decodeOnceFromVideoDevice(n,o){return oe(this,void 0,void 0,function*(){this.reset();let l;n?l={deviceId:{exact:n}}:l={facingMode:"environment"};const u={video:l};return yield this.decodeOnceFromConstraints(u,o)})}decodeOnceFromConstraints(n,o){return oe(this,void 0,void 0,function*(){const l=yield navigator.mediaDevices.getUserMedia(n);return yield this.decodeOnceFromStream(l,o)})}decodeOnceFromStream(n,o){return oe(this,void 0,void 0,function*(){this.reset();const l=yield this.attachStreamToVideo(n,o);return yield this.decodeOnce(l)})}decodeFromInputVideoDeviceContinuously(n,o,l){return oe(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(n,o,l)})}decodeFromVideoDevice(n,o,l){return oe(this,void 0,void 0,function*(){let u;n?u={deviceId:{exact:n}}:u={facingMode:"environment"};const d={video:u};return yield this.decodeFromConstraints(d,o,l)})}decodeFromConstraints(n,o,l){return oe(this,void 0,void 0,function*(){const u=yield navigator.mediaDevices.getUserMedia(n);return yield this.decodeFromStream(u,o,l)})}decodeFromStream(n,o,l){return oe(this,void 0,void 0,function*(){this.reset();const u=yield this.attachStreamToVideo(n,o);return yield this.decodeContinuously(u,l)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(n,o){return oe(this,void 0,void 0,function*(){const l=this.prepareVideoElement(o);return this.addVideoSource(l,n),this.videoElement=l,this.stream=n,yield this.playVideoOnLoadAsync(l),l})}playVideoOnLoadAsync(n){return new Promise((o,l)=>this.playVideoOnLoad(n,()=>o()))}playVideoOnLoad(n,o){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(n),n.addEventListener("ended",this.videoEndedListener),n.addEventListener("canplay",this.videoCanPlayListener),n.addEventListener("playing",o),this.tryPlayVideo(n)}isVideoPlaying(n){return n.currentTime>0&&!n.paused&&!n.ended&&n.readyState>2}tryPlayVideo(n){return oe(this,void 0,void 0,function*(){if(this.isVideoPlaying(n)){console.warn("Trying to play video that is already playing.");return}try{yield n.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(n,o){const l=document.getElementById(n);if(!l)throw new T(`element with id '${n}' not found`);if(l.nodeName.toLowerCase()!==o.toLowerCase())throw new T(`element with id '${n}' must be an ${o} element`);return l}decodeFromImage(n,o){if(!n&&!o)throw new T("either imageElement with a src set or an url must be provided");return o&&!n?this.decodeFromImageUrl(o):this.decodeFromImageElement(n)}decodeFromVideo(n,o){if(!n&&!o)throw new T("Either an element with a src set or an URL must be provided");return o&&!n?this.decodeFromVideoUrl(o):this.decodeFromVideoElement(n)}decodeFromVideoContinuously(n,o,l){if(n===void 0&&o===void 0)throw new T("Either an element with a src set or an URL must be provided");return o&&!n?this.decodeFromVideoUrlContinuously(o,l):this.decodeFromVideoElementContinuously(n,l)}decodeFromImageElement(n){if(!n)throw new T("An image element must be provided.");this.reset();const o=this.prepareImageElement(n);this.imageElement=o;let l;return this.isImageLoaded(o)?l=this.decodeOnce(o,!1,!0):l=this._decodeOnLoadImage(o),l}decodeFromVideoElement(n){const o=this._decodeFromVideoElementSetup(n);return this._decodeOnLoadVideo(o)}decodeFromVideoElementContinuously(n,o){const l=this._decodeFromVideoElementSetup(n);return this._decodeOnLoadVideoContinuously(l,o)}_decodeFromVideoElementSetup(n){if(!n)throw new T("A video element must be provided.");this.reset();const o=this.prepareVideoElement(n);return this.videoElement=o,o}decodeFromImageUrl(n){if(!n)throw new T("An URL must be provided.");this.reset();const o=this.prepareImageElement();this.imageElement=o;const l=this._decodeOnLoadImage(o);return o.src=n,l}decodeFromVideoUrl(n){if(!n)throw new T("An URL must be provided.");this.reset();const o=this.prepareVideoElement(),l=this.decodeFromVideoElement(o);return o.src=n,l}decodeFromVideoUrlContinuously(n,o){if(!n)throw new T("An URL must be provided.");this.reset();const l=this.prepareVideoElement(),u=this.decodeFromVideoElementContinuously(l,o);return l.src=n,u}_decodeOnLoadImage(n){return new Promise((o,l)=>{this.imageLoadedListener=()=>this.decodeOnce(n,!1,!0).then(o,l),n.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(n){return oe(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(n),yield this.decodeOnce(n)})}_decodeOnLoadVideoContinuously(n,o){return oe(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(n),this.decodeContinuously(n,o)})}isImageLoaded(n){return!(!n.complete||n.naturalWidth===0)}prepareImageElement(n){let o;return typeof n>"u"&&(o=document.createElement("img"),o.width=200,o.height=200),typeof n=="string"&&(o=this.getMediaElement(n,"img")),n instanceof HTMLImageElement&&(o=n),o}prepareVideoElement(n){let o;return!n&&typeof document<"u"&&(o=document.createElement("video"),o.width=200,o.height=200),typeof n=="string"&&(o=this.getMediaElement(n,"video")),n instanceof HTMLVideoElement&&(o=n),o.setAttribute("autoplay","true"),o.setAttribute("muted","true"),o.setAttribute("playsinline","true"),o}decodeOnce(n,o=!0,l=!0){this._stopAsyncDecode=!1;const u=(d,m)=>{if(this._stopAsyncDecode){m(new ie("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const p=this.decode(n);d(p)}catch(p){const w=o&&p instanceof ie,N=(p instanceof R||p instanceof X)&&l;if(w||N)return setTimeout(u,this._timeBetweenDecodingAttempts,d,m);m(p)}};return new Promise((d,m)=>u(d,m))}decodeContinuously(n,o){this._stopContinuousDecode=!1;const l=()=>{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const u=this.decode(n);o(u,null),setTimeout(l,this.timeBetweenScansMillis)}catch(u){o(null,u);const d=u instanceof R||u instanceof X,m=u instanceof ie;(d||m)&&setTimeout(l,this._timeBetweenDecodingAttempts)}};l()}decode(n){const o=this.createBinaryBitmap(n);return this.decodeBitmap(o)}_isHTMLVideoElement(n){return n.videoWidth!==0}drawFrameOnCanvas(n,o,l){o||(o={sx:0,sy:0,sWidth:n.videoWidth,sHeight:n.videoHeight,dx:0,dy:0,dWidth:n.videoWidth,dHeight:n.videoHeight}),l||(l=this.captureCanvasContext),l.drawImage(n,o.sx,o.sy,o.sWidth,o.sHeight,o.dx,o.dy,o.dWidth,o.dHeight)}drawImageOnCanvas(n,o,l=this.captureCanvasContext){o||(o={sx:0,sy:0,sWidth:n.naturalWidth,sHeight:n.naturalHeight,dx:0,dy:0,dWidth:n.naturalWidth,dHeight:n.naturalHeight}),l||(l=this.captureCanvasContext),l.drawImage(n,o.sx,o.sy,o.sWidth,o.sHeight,o.dx,o.dy,o.dWidth,o.dHeight)}createBinaryBitmap(n){this.getCaptureCanvasContext(n),this._isHTMLVideoElement(n)?this.drawFrameOnCanvas(n):this.drawImageOnCanvas(n);const o=this.getCaptureCanvas(n),l=new qe(o),u=new xe(l);return new S(u)}getCaptureCanvasContext(n){if(!this.captureCanvasContext){const l=this.getCaptureCanvas(n).getContext("2d");this.captureCanvasContext=l}return this.captureCanvasContext}getCaptureCanvas(n){if(!this.captureCanvas){const o=this.createCaptureCanvas(n);this.captureCanvas=o}return this.captureCanvas}decodeBitmap(n){return this.reader.decode(n,this._hints)}createCaptureCanvas(n){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const o=document.createElement("canvas");let l,u;return typeof n<"u"&&(n instanceof HTMLVideoElement?(l=n.videoWidth,u=n.videoHeight):n instanceof HTMLImageElement&&(l=n.naturalWidth||n.width,u=n.naturalHeight||n.height)),o.style.width=l+"px",o.style.height=u+"px",o.width=l,o.height=u,o}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(n=>n.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(n,o){try{n.srcObject=o}catch{n.src=URL.createObjectURL(o)}}cleanVideoSource(n){try{n.srcObject=null}catch{n.src=""}this.videoElement.removeAttribute("src")}}class Ie{constructor(n,o,l=o==null?0:8*o.length,u,d,m=B.currentTimeMillis()){this.text=n,this.rawBytes=o,this.numBits=l,this.resultPoints=u,this.format=d,this.timestamp=m,this.text=n,this.rawBytes=o,l==null?this.numBits=o==null?0:8*o.length:this.numBits=l,this.resultPoints=u,this.format=d,this.resultMetadata=null,m==null?this.timestamp=B.currentTimeMillis():this.timestamp=m}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(n,o){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(n,o)}putAllMetadata(n){n!==null&&(this.resultMetadata===null?this.resultMetadata=n:this.resultMetadata=new Map(n))}addResultPoints(n){const o=this.resultPoints;if(o===null)this.resultPoints=n;else if(n!==null&&n.length>0){const l=new Array(o.length+n.length);B.arraycopy(o,0,l,0,o.length),B.arraycopy(n,0,l,o.length,n.length),this.resultPoints=l}}getTimestamp(){return this.timestamp}toString(){return this.text}}var Ue;(function(M){M[M.AZTEC=0]="AZTEC",M[M.CODABAR=1]="CODABAR",M[M.CODE_39=2]="CODE_39",M[M.CODE_93=3]="CODE_93",M[M.CODE_128=4]="CODE_128",M[M.DATA_MATRIX=5]="DATA_MATRIX",M[M.EAN_8=6]="EAN_8",M[M.EAN_13=7]="EAN_13",M[M.ITF=8]="ITF",M[M.MAXICODE=9]="MAXICODE",M[M.PDF_417=10]="PDF_417",M[M.QR_CODE=11]="QR_CODE",M[M.RSS_14=12]="RSS_14",M[M.RSS_EXPANDED=13]="RSS_EXPANDED",M[M.UPC_A=14]="UPC_A",M[M.UPC_E=15]="UPC_E",M[M.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Ue||(Ue={}));var Ce=Ue,Ye;(function(M){M[M.OTHER=0]="OTHER",M[M.ORIENTATION=1]="ORIENTATION",M[M.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",M[M.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",M[M.ISSUE_NUMBER=4]="ISSUE_NUMBER",M[M.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",M[M.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",M[M.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",M[M.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",M[M.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",M[M.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ye||(Ye={}));var Qe=Ye;class pt{constructor(n,o,l,u,d=-1,m=-1){this.rawBytes=n,this.text=o,this.byteSegments=l,this.ecLevel=u,this.structuredAppendSequenceNumber=d,this.structuredAppendParity=m,this.numBits=n==null?0:8*n.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(n){this.numBits=n}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(n){this.errorsCorrected=n}getErasures(){return this.erasures}setErasures(n){this.erasures=n}getOther(){return this.other}setOther(n){this.other=n}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Wn{exp(n){return this.expTable[n]}log(n){if(n===0)throw new x;return this.logTable[n]}static addOrSubtract(n,o){return n^o}}class Tn{constructor(n,o){if(o.length===0)throw new x;this.field=n;const l=o.length;if(l>1&&o[0]===0){let u=1;for(;u<l&&o[u]===0;)u++;u===l?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(l-u),B.arraycopy(o,u,this.coefficients,0,this.coefficients.length))}else this.coefficients=o}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(n){return this.coefficients[this.coefficients.length-1-n]}evaluateAt(n){if(n===0)return this.getCoefficient(0);const o=this.coefficients;let l;if(n===1){l=0;for(let m=0,p=o.length;m!==p;m++){const w=o[m];l=Wn.addOrSubtract(l,w)}return l}l=o[0];const u=o.length,d=this.field;for(let m=1;m<u;m++)l=Wn.addOrSubtract(d.multiply(n,l),o[m]);return l}addOrSubtract(n){if(!this.field.equals(n.field))throw new x("GenericGFPolys do not have same GenericGF field");if(this.isZero())return n;if(n.isZero())return this;let o=this.coefficients,l=n.coefficients;if(o.length>l.length){const m=o;o=l,l=m}let u=new Int32Array(l.length);const d=l.length-o.length;B.arraycopy(l,0,u,0,d);for(let m=d;m<l.length;m++)u[m]=Wn.addOrSubtract(o[m-d],l[m]);return new Tn(this.field,u)}multiply(n){if(!this.field.equals(n.field))throw new x("GenericGFPolys do not have same GenericGF field");if(this.isZero()||n.isZero())return this.field.getZero();const o=this.coefficients,l=o.length,u=n.coefficients,d=u.length,m=new Int32Array(l+d-1),p=this.field;for(let w=0;w<l;w++){const C=o[w];for(let N=0;N<d;N++)m[w+N]=Wn.addOrSubtract(m[w+N],p.multiply(C,u[N]))}return new Tn(p,m)}multiplyScalar(n){if(n===0)return this.field.getZero();if(n===1)return this;const o=this.coefficients.length,l=this.field,u=new Int32Array(o),d=this.coefficients;for(let m=0;m<o;m++)u[m]=l.multiply(d[m],n);return new Tn(l,u)}multiplyByMonomial(n,o){if(n<0)throw new x;if(o===0)return this.field.getZero();const l=this.coefficients,u=l.length,d=new Int32Array(u+n),m=this.field;for(let p=0;p<u;p++)d[p]=m.multiply(l[p],o);return new Tn(m,d)}divide(n){if(!this.field.equals(n.field))throw new x("GenericGFPolys do not have same GenericGF field");if(n.isZero())throw new x("Divide by 0");const o=this.field;let l=o.getZero(),u=this;const d=n.getCoefficient(n.getDegree()),m=o.inverse(d);for(;u.getDegree()>=n.getDegree()&&!u.isZero();){const p=u.getDegree()-n.getDegree(),w=o.multiply(u.getCoefficient(u.getDegree()),m),C=n.multiplyByMonomial(p,w),N=o.buildMonomial(p,w);l=l.addOrSubtract(N),u=u.addOrSubtract(C)}return[l,u]}toString(){let n="";for(let o=this.getDegree();o>=0;o--){let l=this.getCoefficient(o);if(l!==0){if(l<0?(n+=" - ",l=-l):n.length>0&&(n+=" + "),o===0||l!==1){const u=this.field.log(l);u===0?n+="1":u===1?n+="a":(n+="a^",n+=u)}o!==0&&(o===1?n+="x":(n+="x^",n+=o))}}return n}}class ia extends b{}ia.kind="ArithmeticException";class xt extends Wn{constructor(n,o,l){super(),this.primitive=n,this.size=o,this.generatorBase=l;const u=new Int32Array(o);let d=1;for(let p=0;p<o;p++)u[p]=d,d*=2,d>=o&&(d^=n,d&=o-1);this.expTable=u;const m=new Int32Array(o);for(let p=0;p<o-1;p++)m[u[p]]=p;this.logTable=m,this.zero=new Tn(this,Int32Array.from([0])),this.one=new Tn(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(n,o){if(n<0)throw new x;if(o===0)return this.zero;const l=new Int32Array(n+1);return l[0]=o,new Tn(this,l)}inverse(n){if(n===0)throw new ia;return this.expTable[this.size-this.logTable[n]-1]}multiply(n,o){return n===0||o===0?0:this.expTable[(this.logTable[n]+this.logTable[o])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+j.toHexString(this.primitive)+","+this.size+")"}equals(n){return n===this}}xt.AZTEC_DATA_12=new xt(4201,4096,1),xt.AZTEC_DATA_10=new xt(1033,1024,1),xt.AZTEC_DATA_6=new xt(67,64,1),xt.AZTEC_PARAM=new xt(19,16,1),xt.QR_CODE_FIELD_256=new xt(285,256,0),xt.DATA_MATRIX_FIELD_256=new xt(301,256,1),xt.AZTEC_DATA_8=xt.DATA_MATRIX_FIELD_256,xt.MAXICODE_FIELD_64=xt.AZTEC_DATA_6;class ar extends b{}ar.kind="ReedSolomonException";class or extends b{}or.kind="IllegalStateException";class Ni{constructor(n){this.field=n}decode(n,o){const l=this.field,u=new Tn(l,n),d=new Int32Array(o);let m=!0;for(let G=0;G<o;G++){const W=u.evaluateAt(l.exp(G+l.getGeneratorBase()));d[d.length-1-G]=W,W!==0&&(m=!1)}if(m)return;const p=new Tn(l,d),w=this.runEuclideanAlgorithm(l.buildMonomial(o,1),p,o),C=w[0],N=w[1],D=this.findErrorLocations(C),z=this.findErrorMagnitudes(N,D);for(let G=0;G<D.length;G++){const W=n.length-1-l.log(D[G]);if(W<0)throw new ar("Bad error location");n[W]=xt.addOrSubtract(n[W],z[G])}}runEuclideanAlgorithm(n,o,l){if(n.getDegree()<o.getDegree()){const G=n;n=o,o=G}const u=this.field;let d=n,m=o,p=u.getZero(),w=u.getOne();for(;m.getDegree()>=(l/2|0);){let G=d,W=p;if(d=m,p=w,d.isZero())throw new ar("r_{i-1} was zero");m=G;let J=u.getZero();const ae=d.getCoefficient(d.getDegree()),he=u.inverse(ae);for(;m.getDegree()>=d.getDegree()&&!m.isZero();){const Ne=m.getDegree()-d.getDegree(),Se=u.multiply(m.getCoefficient(m.getDegree()),he);J=J.addOrSubtract(u.buildMonomial(Ne,Se)),m=m.addOrSubtract(d.multiplyByMonomial(Ne,Se))}if(w=J.multiply(p).addOrSubtract(W),m.getDegree()>=d.getDegree())throw new or("Division algorithm failed to reduce polynomial?")}const C=w.getCoefficient(0);if(C===0)throw new ar("sigmaTilde(0) was zero");const N=u.inverse(C),D=w.multiplyScalar(N),z=m.multiplyScalar(N);return[D,z]}findErrorLocations(n){const o=n.getDegree();if(o===1)return Int32Array.from([n.getCoefficient(1)]);const l=new Int32Array(o);let u=0;const d=this.field;for(let m=1;m<d.getSize()&&u<o;m++)n.evaluateAt(m)===0&&(l[u]=d.inverse(m),u++);if(u!==o)throw new ar("Error locator degree does not match number of roots");return l}findErrorMagnitudes(n,o){const l=o.length,u=new Int32Array(l),d=this.field;for(let m=0;m<l;m++){const p=d.inverse(o[m]);let w=1;for(let C=0;C<l;C++)if(m!==C){const N=d.multiply(o[C],p),D=(N&1)===0?N|1:N&-2;w=d.multiply(w,D)}u[m]=d.multiply(n.evaluateAt(p),d.inverse(w)),d.getGeneratorBase()!==0&&(u[m]=d.multiply(u[m],p))}return u}}var Rn;(function(M){M[M.UPPER=0]="UPPER",M[M.LOWER=1]="LOWER",M[M.MIXED=2]="MIXED",M[M.DIGIT=3]="DIGIT",M[M.PUNCT=4]="PUNCT",M[M.BINARY=5]="BINARY"})(Rn||(Rn={}));class Nt{decode(n){this.ddata=n;let o=n.getBits(),l=this.extractBits(o),u=this.correctBits(l),d=Nt.convertBoolArrayToByteArray(u),m=Nt.getEncodedData(u),p=new pt(d,m,null,null);return p.setNumBits(u.length),p}static highLevelDecode(n){return this.getEncodedData(n)}static getEncodedData(n){let o=n.length,l=Rn.UPPER,u=Rn.UPPER,d="",m=0;for(;m<o;)if(u===Rn.BINARY){if(o-m<5)break;let p=Nt.readCode(n,m,5);if(m+=5,p===0){if(o-m<11)break;p=Nt.readCode(n,m,11)+31,m+=11}for(let w=0;w<p;w++){if(o-m<8){m=o;break}const C=Nt.readCode(n,m,8);d+=te.castAsNonUtf8Char(C),m+=8}u=l}else{let p=u===Rn.DIGIT?4:5;if(o-m<p)break;let w=Nt.readCode(n,m,p);m+=p;let C=Nt.getCharacter(u,w);C.startsWith("CTRL_")?(l=u,u=Nt.getTable(C.charAt(5)),C.charAt(6)==="L"&&(l=u)):(d+=C,u=l)}return d}static getTable(n){switch(n){case"L":return Rn.LOWER;case"P":return Rn.PUNCT;case"M":return Rn.MIXED;case"D":return Rn.DIGIT;case"B":return Rn.BINARY;case"U":default:return Rn.UPPER}}static getCharacter(n,o){switch(n){case Rn.UPPER:return Nt.UPPER_TABLE[o];case Rn.LOWER:return Nt.LOWER_TABLE[o];case Rn.MIXED:return Nt.MIXED_TABLE[o];case Rn.PUNCT:return Nt.PUNCT_TABLE[o];case Rn.DIGIT:return Nt.DIGIT_TABLE[o];default:throw new or("Bad table")}}correctBits(n){let o,l;this.ddata.getNbLayers()<=2?(l=6,o=xt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(l=8,o=xt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(l=10,o=xt.AZTEC_DATA_10):(l=12,o=xt.AZTEC_DATA_12);let u=this.ddata.getNbDatablocks(),d=n.length/l;if(d<u)throw new X;let m=n.length%l,p=new Int32Array(d);for(let z=0;z<d;z++,m+=l)p[z]=Nt.readCode(n,m,l);try{new Ni(o).decode(p,d-u)}catch(z){throw new X(z)}let w=(1<<l)-1,C=0;for(let z=0;z<u;z++){let G=p[z];if(G===0||G===w)throw new X;(G===1||G===w-1)&&C++}let N=new Array(u*l-C),D=0;for(let z=0;z<u;z++){let G=p[z];if(G===1||G===w-1)N.fill(G>1,D,D+l-1),D+=l-1;else for(let W=l-1;W>=0;--W)N[D++]=(G&1<<W)!==0}return N}extractBits(n){let o=this.ddata.isCompact(),l=this.ddata.getNbLayers(),u=(o?11:14)+l*4,d=new Int32Array(u),m=new Array(this.totalBitsInLayer(l,o));if(o)for(let p=0;p<d.length;p++)d[p]=p;else{let p=u+1+2*j.truncDivision(j.truncDivision(u,2)-1,15),w=u/2,C=j.truncDivision(p,2);for(let N=0;N<w;N++){let D=N+j.truncDivision(N,15);d[w-N-1]=C-D-1,d[w+N]=C+D+1}}for(let p=0,w=0;p<l;p++){let C=(l-p)*4+(o?9:12),N=p*2,D=u-1-N;for(let z=0;z<C;z++){let G=z*2;for(let W=0;W<2;W++)m[w+G+W]=n.get(d[N+W],d[N+z]),m[w+2*C+G+W]=n.get(d[N+z],d[D-W]),m[w+4*C+G+W]=n.get(d[D-W],d[D-z]),m[w+6*C+G+W]=n.get(d[D-z],d[N+W])}w+=C*8}return m}static readCode(n,o,l){let u=0;for(let d=o;d<o+l;d++)u<<=1,n[d]&&(u|=1);return u}static readByte(n,o){let l=n.length-o;return l>=8?Nt.readCode(n,o,8):Nt.readCode(n,o,l)<<8-l}static convertBoolArrayToByteArray(n){let o=new Uint8Array((n.length+7)/8);for(let l=0;l<o.length;l++)o[l]=Nt.readByte(n,8*l);return o}totalBitsInLayer(n,o){return((o?88:112)+16*n)*n}}Nt.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"],Nt.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"],Nt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
254
- `,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],Nt.PUNCT_TABLE=["","\r",`\r
255
- `,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],Nt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class ot{constructor(){}static round(n){return n===NaN?0:n<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:n>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:n+(n<0?-.5:.5)|0}static distance(n,o,l,u){const d=n-l,m=o-u;return Math.sqrt(d*d+m*m)}static sum(n){let o=0;for(let l=0,u=n.length;l!==u;l++){const d=n[l];o+=d}return o}}class aa{static floatToIntBits(n){return n}}aa.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ke{constructor(n,o){this.x=n,this.y=o}getX(){return this.x}getY(){return this.y}equals(n){if(n instanceof ke){const o=n;return this.x===o.x&&this.y===o.y}return!1}hashCode(){return 31*aa.floatToIntBits(this.x)+aa.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(n){const o=this.distance(n[0],n[1]),l=this.distance(n[1],n[2]),u=this.distance(n[0],n[2]);let d,m,p;if(l>=o&&l>=u?(m=n[0],d=n[1],p=n[2]):u>=l&&u>=o?(m=n[1],d=n[0],p=n[2]):(m=n[2],d=n[0],p=n[1]),this.crossProductZ(d,m,p)<0){const w=d;d=p,p=w}n[0]=d,n[1]=m,n[2]=p}static distance(n,o){return ot.distance(n.x,n.y,o.x,o.y)}static crossProductZ(n,o,l){const u=o.x,d=o.y;return(l.x-u)*(n.y-d)-(l.y-d)*(n.x-u)}}class Mo{constructor(n,o){this.bits=n,this.points=o}getBits(){return this.bits}getPoints(){return this.points}}class Jl extends Mo{constructor(n,o,l,u,d){super(n,o),this.compact=l,this.nbDatablocks=u,this.nbLayers=d}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class en{constructor(n,o,l,u){this.image=n,this.height=n.getHeight(),this.width=n.getWidth(),o==null&&(o=en.INIT_SIZE),l==null&&(l=n.getWidth()/2|0),u==null&&(u=n.getHeight()/2|0);const d=o/2|0;if(this.leftInit=l-d,this.rightInit=l+d,this.upInit=u-d,this.downInit=u+d,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new ie}detect(){let n=this.leftInit,o=this.rightInit,l=this.upInit,u=this.downInit,d=!1,m=!0,p=!1,w=!1,C=!1,N=!1,D=!1;const z=this.width,G=this.height;for(;m;){m=!1;let W=!0;for(;(W||!w)&&o<z;)W=this.containsBlackPoint(l,u,o,!1),W?(o++,m=!0,w=!0):w||o++;if(o>=z){d=!0;break}let J=!0;for(;(J||!C)&&u<G;)J=this.containsBlackPoint(n,o,u,!0),J?(u++,m=!0,C=!0):C||u++;if(u>=G){d=!0;break}let ae=!0;for(;(ae||!N)&&n>=0;)ae=this.containsBlackPoint(l,u,n,!1),ae?(n--,m=!0,N=!0):N||n--;if(n<0){d=!0;break}let he=!0;for(;(he||!D)&&l>=0;)he=this.containsBlackPoint(n,o,l,!0),he?(l--,m=!0,D=!0):D||l--;if(l<0){d=!0;break}m&&(p=!0)}if(!d&&p){const W=o-n;let J=null;for(let Se=1;J===null&&Se<W;Se++)J=this.getBlackPointOnSegment(n,u-Se,n+Se,u);if(J==null)throw new ie;let ae=null;for(let Se=1;ae===null&&Se<W;Se++)ae=this.getBlackPointOnSegment(n,l+Se,n+Se,l);if(ae==null)throw new ie;let he=null;for(let Se=1;he===null&&Se<W;Se++)he=this.getBlackPointOnSegment(o,l+Se,o-Se,l);if(he==null)throw new ie;let Ne=null;for(let Se=1;Ne===null&&Se<W;Se++)Ne=this.getBlackPointOnSegment(o,u-Se,o-Se,u);if(Ne==null)throw new ie;return this.centerEdges(Ne,J,he,ae)}else throw new ie}getBlackPointOnSegment(n,o,l,u){const d=ot.round(ot.distance(n,o,l,u)),m=(l-n)/d,p=(u-o)/d,w=this.image;for(let C=0;C<d;C++){const N=ot.round(n+C*m),D=ot.round(o+C*p);if(w.get(N,D))return new ke(N,D)}return null}centerEdges(n,o,l,u){const d=n.getX(),m=n.getY(),p=o.getX(),w=o.getY(),C=l.getX(),N=l.getY(),D=u.getX(),z=u.getY(),G=en.CORR;return d<this.width/2?[new ke(D-G,z+G),new ke(p+G,w+G),new ke(C-G,N-G),new ke(d+G,m-G)]:[new ke(D+G,z+G),new ke(p+G,w-G),new ke(C-G,N+G),new ke(d-G,m-G)]}containsBlackPoint(n,o,l,u){const d=this.image;if(u){for(let m=n;m<=o;m++)if(d.get(m,l))return!0}else for(let m=n;m<=o;m++)if(d.get(l,m))return!0;return!1}}en.INIT_SIZE=10,en.CORR=1;class Ls{static checkAndNudgePoints(n,o){const l=n.getWidth(),u=n.getHeight();let d=!0;for(let m=0;m<o.length&&d;m+=2){const p=Math.floor(o[m]),w=Math.floor(o[m+1]);if(p<-1||p>l||w<-1||w>u)throw new ie;d=!1,p===-1?(o[m]=0,d=!0):p===l&&(o[m]=l-1,d=!0),w===-1?(o[m+1]=0,d=!0):w===u&&(o[m+1]=u-1,d=!0)}d=!0;for(let m=o.length-2;m>=0&&d;m-=2){const p=Math.floor(o[m]),w=Math.floor(o[m+1]);if(p<-1||p>l||w<-1||w>u)throw new ie;d=!1,p===-1?(o[m]=0,d=!0):p===l&&(o[m]=l-1,d=!0),w===-1?(o[m+1]=0,d=!0):w===u&&(o[m+1]=u-1,d=!0)}}}class sr{constructor(n,o,l,u,d,m,p,w,C){this.a11=n,this.a21=o,this.a31=l,this.a12=u,this.a22=d,this.a32=m,this.a13=p,this.a23=w,this.a33=C}static quadrilateralToQuadrilateral(n,o,l,u,d,m,p,w,C,N,D,z,G,W,J,ae){const he=sr.quadrilateralToSquare(n,o,l,u,d,m,p,w);return sr.squareToQuadrilateral(C,N,D,z,G,W,J,ae).times(he)}transformPoints(n){const o=n.length,l=this.a11,u=this.a12,d=this.a13,m=this.a21,p=this.a22,w=this.a23,C=this.a31,N=this.a32,D=this.a33;for(let z=0;z<o;z+=2){const G=n[z],W=n[z+1],J=d*G+w*W+D;n[z]=(l*G+m*W+C)/J,n[z+1]=(u*G+p*W+N)/J}}transformPointsWithValues(n,o){const l=this.a11,u=this.a12,d=this.a13,m=this.a21,p=this.a22,w=this.a23,C=this.a31,N=this.a32,D=this.a33,z=n.length;for(let G=0;G<z;G++){const W=n[G],J=o[G],ae=d*W+w*J+D;n[G]=(l*W+m*J+C)/ae,o[G]=(u*W+p*J+N)/ae}}static squareToQuadrilateral(n,o,l,u,d,m,p,w){const C=n-l+d-p,N=o-u+m-w;if(C===0&&N===0)return new sr(l-n,d-l,n,u-o,m-u,o,0,0,1);{const D=l-d,z=p-d,G=u-m,W=w-m,J=D*W-z*G,ae=(C*W-z*N)/J,he=(D*N-C*G)/J;return new sr(l-n+ae*l,p-n+he*p,n,u-o+ae*u,w-o+he*w,o,ae,he,1)}}static quadrilateralToSquare(n,o,l,u,d,m,p,w){return sr.squareToQuadrilateral(n,o,l,u,d,m,p,w).buildAdjoint()}buildAdjoint(){return new sr(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(n){return new sr(this.a11*n.a11+this.a21*n.a12+this.a31*n.a13,this.a11*n.a21+this.a21*n.a22+this.a31*n.a23,this.a11*n.a31+this.a21*n.a32+this.a31*n.a33,this.a12*n.a11+this.a22*n.a12+this.a32*n.a13,this.a12*n.a21+this.a22*n.a22+this.a32*n.a23,this.a12*n.a31+this.a22*n.a32+this.a32*n.a33,this.a13*n.a11+this.a23*n.a12+this.a33*n.a13,this.a13*n.a21+this.a23*n.a22+this.a33*n.a23,this.a13*n.a31+this.a23*n.a32+this.a33*n.a33)}}class Ps extends Ls{sampleGrid(n,o,l,u,d,m,p,w,C,N,D,z,G,W,J,ae,he,Ne,Se){const Ae=sr.quadrilateralToQuadrilateral(u,d,m,p,w,C,N,D,z,G,W,J,ae,he,Ne,Se);return this.sampleGridWithTransform(n,o,l,Ae)}sampleGridWithTransform(n,o,l,u){if(o<=0||l<=0)throw new ie;const d=new Te(o,l),m=new Float32Array(2*o);for(let p=0;p<l;p++){const w=m.length,C=p+.5;for(let N=0;N<w;N+=2)m[N]=N/2+.5,m[N+1]=C;u.transformPoints(m),Ls.checkAndNudgePoints(n,m);try{for(let N=0;N<w;N+=2)n.get(Math.floor(m[N]),Math.floor(m[N+1]))&&d.set(N/2,p)}catch{throw new ie}}return d}}class vr{static setGridSampler(n){vr.gridSampler=n}static getInstance(){return vr.gridSampler}}vr.gridSampler=new Ps;class Pn{constructor(n,o){this.x=n,this.y=o}toResultPoint(){return new ke(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class zs{constructor(n){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=n}detect(){return this.detectMirror(!1)}detectMirror(n){let o=this.getMatrixCenter(),l=this.getBullsEyeCorners(o);if(n){let m=l[0];l[0]=l[2],l[2]=m}this.extractParameters(l);let u=this.sampleGrid(this.image,l[this.shift%4],l[(this.shift+1)%4],l[(this.shift+2)%4],l[(this.shift+3)%4]),d=this.getMatrixCornerPoints(l);return new Jl(u,d,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(n){if(!this.isValidPoint(n[0])||!this.isValidPoint(n[1])||!this.isValidPoint(n[2])||!this.isValidPoint(n[3]))throw new ie;let o=2*this.nbCenterLayers,l=new Int32Array([this.sampleLine(n[0],n[1],o),this.sampleLine(n[1],n[2],o),this.sampleLine(n[2],n[3],o),this.sampleLine(n[3],n[0],o)]);this.shift=this.getRotation(l,o);let u=0;for(let m=0;m<4;m++){let p=l[(this.shift+m)%4];this.compact?(u<<=7,u+=p>>1&127):(u<<=10,u+=(p>>2&992)+(p>>1&31))}let d=this.getCorrectedParameterData(u,this.compact);this.compact?(this.nbLayers=(d>>6)+1,this.nbDataBlocks=(d&63)+1):(this.nbLayers=(d>>11)+1,this.nbDataBlocks=(d&2047)+1)}getRotation(n,o){let l=0;n.forEach((u,d,m)=>{let p=(u>>o-2<<1)+(u&1);l=(l<<3)+p}),l=((l&1)<<11)+(l>>1);for(let u=0;u<4;u++)if(j.bitCount(l^this.EXPECTED_CORNER_BITS[u])<=2)return u;throw new ie}getCorrectedParameterData(n,o){let l,u;o?(l=7,u=2):(l=10,u=4);let d=l-u,m=new Int32Array(l);for(let w=l-1;w>=0;--w)m[w]=n&15,n>>=4;try{new Ni(xt.AZTEC_PARAM).decode(m,d)}catch{throw new ie}let p=0;for(let w=0;w<u;w++)p=(p<<4)+m[w];return p}getBullsEyeCorners(n){let o=n,l=n,u=n,d=n,m=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let D=this.getFirstDifferent(o,m,1,-1),z=this.getFirstDifferent(l,m,1,1),G=this.getFirstDifferent(u,m,-1,1),W=this.getFirstDifferent(d,m,-1,-1);if(this.nbCenterLayers>2){let J=this.distancePoint(W,D)*this.nbCenterLayers/(this.distancePoint(d,o)*(this.nbCenterLayers+2));if(J<.75||J>1.25||!this.isWhiteOrBlackRectangle(D,z,G,W))break}o=D,l=z,u=G,d=W,m=!m}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new ie;this.compact=this.nbCenterLayers===5;let p=new ke(o.getX()+.5,o.getY()-.5),w=new ke(l.getX()+.5,l.getY()+.5),C=new ke(u.getX()-.5,u.getY()+.5),N=new ke(d.getX()-.5,d.getY()-.5);return this.expandSquare([p,w,C,N],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let n,o,l,u;try{let p=new en(this.image).detect();n=p[0],o=p[1],l=p[2],u=p[3]}catch{let w=this.image.getWidth()/2,C=this.image.getHeight()/2;n=this.getFirstDifferent(new Pn(w+7,C-7),!1,1,-1).toResultPoint(),o=this.getFirstDifferent(new Pn(w+7,C+7),!1,1,1).toResultPoint(),l=this.getFirstDifferent(new Pn(w-7,C+7),!1,-1,1).toResultPoint(),u=this.getFirstDifferent(new Pn(w-7,C-7),!1,-1,-1).toResultPoint()}let d=ot.round((n.getX()+u.getX()+o.getX()+l.getX())/4),m=ot.round((n.getY()+u.getY()+o.getY()+l.getY())/4);try{let p=new en(this.image,15,d,m).detect();n=p[0],o=p[1],l=p[2],u=p[3]}catch{n=this.getFirstDifferent(new Pn(d+7,m-7),!1,1,-1).toResultPoint(),o=this.getFirstDifferent(new Pn(d+7,m+7),!1,1,1).toResultPoint(),l=this.getFirstDifferent(new Pn(d-7,m+7),!1,-1,1).toResultPoint(),u=this.getFirstDifferent(new Pn(d-7,m-7),!1,-1,-1).toResultPoint()}return d=ot.round((n.getX()+u.getX()+o.getX()+l.getX())/4),m=ot.round((n.getY()+u.getY()+o.getY()+l.getY())/4),new Pn(d,m)}getMatrixCornerPoints(n){return this.expandSquare(n,2*this.nbCenterLayers,this.getDimension())}sampleGrid(n,o,l,u,d){let m=vr.getInstance(),p=this.getDimension(),w=p/2-this.nbCenterLayers,C=p/2+this.nbCenterLayers;return m.sampleGrid(n,p,p,w,w,C,w,C,C,w,C,o.getX(),o.getY(),l.getX(),l.getY(),u.getX(),u.getY(),d.getX(),d.getY())}sampleLine(n,o,l){let u=0,d=this.distanceResultPoint(n,o),m=d/l,p=n.getX(),w=n.getY(),C=m*(o.getX()-n.getX())/d,N=m*(o.getY()-n.getY())/d;for(let D=0;D<l;D++)this.image.get(ot.round(p+D*C),ot.round(w+D*N))&&(u|=1<<l-D-1);return u}isWhiteOrBlackRectangle(n,o,l,u){let d=3;n=new Pn(n.getX()-d,n.getY()+d),o=new Pn(o.getX()-d,o.getY()-d),l=new Pn(l.getX()+d,l.getY()-d),u=new Pn(u.getX()+d,u.getY()+d);let m=this.getColor(u,n);if(m===0)return!1;let p=this.getColor(n,o);return p!==m||(p=this.getColor(o,l),p!==m)?!1:(p=this.getColor(l,u),p===m)}getColor(n,o){let l=this.distancePoint(n,o),u=(o.getX()-n.getX())/l,d=(o.getY()-n.getY())/l,m=0,p=n.getX(),w=n.getY(),C=this.image.get(n.getX(),n.getY()),N=Math.ceil(l);for(let z=0;z<N;z++)p+=u,w+=d,this.image.get(ot.round(p),ot.round(w))!==C&&m++;let D=m/l;return D>.1&&D<.9?0:D<=.1===C?1:-1}getFirstDifferent(n,o,l,u){let d=n.getX()+l,m=n.getY()+u;for(;this.isValid(d,m)&&this.image.get(d,m)===o;)d+=l,m+=u;for(d-=l,m-=u;this.isValid(d,m)&&this.image.get(d,m)===o;)d+=l;for(d-=l;this.isValid(d,m)&&this.image.get(d,m)===o;)m+=u;return m-=u,new Pn(d,m)}expandSquare(n,o,l){let u=l/(2*o),d=n[0].getX()-n[2].getX(),m=n[0].getY()-n[2].getY(),p=(n[0].getX()+n[2].getX())/2,w=(n[0].getY()+n[2].getY())/2,C=new ke(p+u*d,w+u*m),N=new ke(p-u*d,w-u*m);d=n[1].getX()-n[3].getX(),m=n[1].getY()-n[3].getY(),p=(n[1].getX()+n[3].getX())/2,w=(n[1].getY()+n[3].getY())/2;let D=new ke(p+u*d,w+u*m),z=new ke(p-u*d,w-u*m);return[C,D,N,z]}isValid(n,o){return n>=0&&n<this.image.getWidth()&&o>0&&o<this.image.getHeight()}isValidPoint(n){let o=ot.round(n.getX()),l=ot.round(n.getY());return this.isValid(o,l)}distancePoint(n,o){return ot.distance(n.getX(),n.getY(),o.getX(),o.getY())}distanceResultPoint(n,o){return ot.distance(n.getX(),n.getY(),o.getX(),o.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(j.truncDivision(this.nbLayers-4,8)+1)+15}}class Do{decode(n,o=null){let l=null,u=new zs(n.getBlackMatrix()),d=null,m=null;try{let N=u.detectMirror(!1);d=N.getPoints(),this.reportFoundResultPoints(o,d),m=new Nt().decode(N)}catch(N){l=N}if(m==null)try{let N=u.detectMirror(!0);d=N.getPoints(),this.reportFoundResultPoints(o,d),m=new Nt().decode(N)}catch(N){throw l??N}let p=new Ie(m.getText(),m.getRawBytes(),m.getNumBits(),d,Ce.AZTEC,B.currentTimeMillis()),w=m.getByteSegments();w!=null&&p.putMetadata(Qe.BYTE_SEGMENTS,w);let C=m.getECLevel();return C!=null&&p.putMetadata(Qe.ERROR_CORRECTION_LEVEL,C),p}reportFoundResultPoints(n,o){if(n!=null){let l=n.get(Q.NEED_RESULT_POINT_CALLBACK);l!=null&&o.forEach((u,d,m)=>{l.foundPossibleResultPoint(u)})}}reset(){}}class hf extends Re{constructor(n=500){super(new Do,n)}}class jt{decode(n,o){try{return this.doDecode(n,o)}catch{if(o&&o.get(Q.TRY_HARDER)===!0&&n.isRotateSupported()){const d=n.rotateCounterClockwise(),m=this.doDecode(d,o),p=m.getResultMetadata();let w=270;p!==null&&p.get(Qe.ORIENTATION)===!0&&(w=w+p.get(Qe.ORIENTATION)%360),m.putMetadata(Qe.ORIENTATION,w);const C=m.getResultPoints();if(C!==null){const N=d.getHeight();for(let D=0;D<C.length;D++)C[D]=new ke(N-C[D].getY()-1,C[D].getX())}return m}else throw new ie}}reset(){}doDecode(n,o){const l=n.getWidth(),u=n.getHeight();let d=new H(l);const m=o&&o.get(Q.TRY_HARDER)===!0,p=Math.max(1,u>>(m?8:5));let w;m?w=u:w=15;const C=Math.trunc(u/2);for(let N=0;N<w;N++){const D=Math.trunc((N+1)/2),z=(N&1)===0,G=C+p*(z?D:-D);if(G<0||G>=u)break;try{d=n.getBlackRow(G,d)}catch{continue}for(let W=0;W<2;W++){if(W===1&&(d.reverse(),o&&o.get(Q.NEED_RESULT_POINT_CALLBACK)===!0)){const J=new Map;o.forEach((ae,he)=>J.set(he,ae)),J.delete(Q.NEED_RESULT_POINT_CALLBACK),o=J}try{const J=this.decodeRow(G,d,o);if(W===1){J.putMetadata(Qe.ORIENTATION,180);const ae=J.getResultPoints();ae!==null&&(ae[0]=new ke(l-ae[0].getX()-1,ae[0].getY()),ae[1]=new ke(l-ae[1].getX()-1,ae[1].getY()))}return J}catch{}}}throw new ie}static recordPattern(n,o,l){const u=l.length;for(let C=0;C<u;C++)l[C]=0;const d=n.getSize();if(o>=d)throw new ie;let m=!n.get(o),p=0,w=o;for(;w<d;){if(n.get(w)!==m)l[p]++;else{if(++p===u)break;l[p]=1,m=!m}w++}if(!(p===u||p===u-1&&w===d))throw new ie}static recordPatternInReverse(n,o,l){let u=l.length,d=n.get(o);for(;o>0&&u>=0;)n.get(--o)!==d&&(u--,d=!d);if(u>=0)throw new ie;jt.recordPattern(n,o+1,l)}static patternMatchVariance(n,o,l){const u=n.length;let d=0,m=0;for(let C=0;C<u;C++)d+=n[C],m+=o[C];if(d<m)return Number.POSITIVE_INFINITY;const p=d/m;l*=p;let w=0;for(let C=0;C<u;C++){const N=n[C],D=o[C]*p,z=N>D?N-D:D-N;if(z>l)return Number.POSITIVE_INFINITY;w+=z}return w/d}}class Oe extends jt{static findStartPattern(n){const o=n.getSize(),l=n.getNextSet(0);let u=0,d=Int32Array.from([0,0,0,0,0,0]),m=l,p=!1;const w=6;for(let C=l;C<o;C++)if(n.get(C)!==p)d[u]++;else{if(u===w-1){let N=Oe.MAX_AVG_VARIANCE,D=-1;for(let z=Oe.CODE_START_A;z<=Oe.CODE_START_C;z++){const G=jt.patternMatchVariance(d,Oe.CODE_PATTERNS[z],Oe.MAX_INDIVIDUAL_VARIANCE);G<N&&(N=G,D=z)}if(D>=0&&n.isRange(Math.max(0,m-(C-m)/2),m,!1))return Int32Array.from([m,C,D]);m+=d[0]+d[1],d=d.slice(2,d.length-1),d[u-1]=0,d[u]=0,u--}else u++;d[u]=1,p=!p}throw new ie}static decodeCode(n,o,l){jt.recordPattern(n,l,o);let u=Oe.MAX_AVG_VARIANCE,d=-1;for(let m=0;m<Oe.CODE_PATTERNS.length;m++){const p=Oe.CODE_PATTERNS[m],w=this.patternMatchVariance(o,p,Oe.MAX_INDIVIDUAL_VARIANCE);w<u&&(u=w,d=m)}if(d>=0)return d;throw new ie}decodeRow(n,o,l){const u=l&&l.get(Q.ASSUME_GS1)===!0,d=Oe.findStartPattern(o),m=d[2];let p=0;const w=new Uint8Array(20);w[p++]=m;let C;switch(m){case Oe.CODE_START_A:C=Oe.CODE_CODE_A;break;case Oe.CODE_START_B:C=Oe.CODE_CODE_B;break;case Oe.CODE_START_C:C=Oe.CODE_CODE_C;break;default:throw new X}let N=!1,D=!1,z="",G=d[0],W=d[1];const J=Int32Array.from([0,0,0,0,0,0]);let ae=0,he=0,Ne=m,Se=0,Ae=!0,it=!1,Ke=!1;for(;!N;){const Li=D;switch(D=!1,ae=he,he=Oe.decodeCode(o,J,W),w[p++]=he,he!==Oe.CODE_STOP&&(Ae=!0),he!==Oe.CODE_STOP&&(Se++,Ne+=Se*he),G=W,W+=J.reduce((hc,Ks)=>hc+Ks,0),he){case Oe.CODE_START_A:case Oe.CODE_START_B:case Oe.CODE_START_C:throw new X}switch(C){case Oe.CODE_CODE_A:if(he<64)Ke===it?z+=String.fromCharCode(32+he):z+=String.fromCharCode(32+he+128),Ke=!1;else if(he<96)Ke===it?z+=String.fromCharCode(he-64):z+=String.fromCharCode(he+64),Ke=!1;else switch(he!==Oe.CODE_STOP&&(Ae=!1),he){case Oe.CODE_FNC_1:u&&(z.length===0?z+="]C1":z+="");break;case Oe.CODE_FNC_2:case Oe.CODE_FNC_3:break;case Oe.CODE_FNC_4_A:!it&&Ke?(it=!0,Ke=!1):it&&Ke?(it=!1,Ke=!1):Ke=!0;break;case Oe.CODE_SHIFT:D=!0,C=Oe.CODE_CODE_B;break;case Oe.CODE_CODE_B:C=Oe.CODE_CODE_B;break;case Oe.CODE_CODE_C:C=Oe.CODE_CODE_C;break;case Oe.CODE_STOP:N=!0;break}break;case Oe.CODE_CODE_B:if(he<96)Ke===it?z+=String.fromCharCode(32+he):z+=String.fromCharCode(32+he+128),Ke=!1;else switch(he!==Oe.CODE_STOP&&(Ae=!1),he){case Oe.CODE_FNC_1:u&&(z.length===0?z+="]C1":z+="");break;case Oe.CODE_FNC_2:case Oe.CODE_FNC_3:break;case Oe.CODE_FNC_4_B:!it&&Ke?(it=!0,Ke=!1):it&&Ke?(it=!1,Ke=!1):Ke=!0;break;case Oe.CODE_SHIFT:D=!0,C=Oe.CODE_CODE_A;break;case Oe.CODE_CODE_A:C=Oe.CODE_CODE_A;break;case Oe.CODE_CODE_C:C=Oe.CODE_CODE_C;break;case Oe.CODE_STOP:N=!0;break}break;case Oe.CODE_CODE_C:if(he<100)he<10&&(z+="0"),z+=he;else switch(he!==Oe.CODE_STOP&&(Ae=!1),he){case Oe.CODE_FNC_1:u&&(z.length===0?z+="]C1":z+="");break;case Oe.CODE_CODE_A:C=Oe.CODE_CODE_A;break;case Oe.CODE_CODE_B:C=Oe.CODE_CODE_B;break;case Oe.CODE_STOP:N=!0;break}break}Li&&(C=C===Oe.CODE_CODE_A?Oe.CODE_CODE_B:Oe.CODE_CODE_A)}const sn=W-G;if(W=o.getNextUnset(W),!o.isRange(W,Math.min(o.getSize(),W+(W-G)/2),!1))throw new ie;if(Ne-=Se*ae,Ne%103!==ae)throw new R;const fr=z.length;if(fr===0)throw new ie;fr>0&&Ae&&(C===Oe.CODE_CODE_C?z=z.substring(0,fr-2):z=z.substring(0,fr-1));const Un=(d[1]+d[0])/2,Rt=G+sn/2,Mn=w.length,tr=new Uint8Array(Mn);for(let Li=0;Li<Mn;Li++)tr[Li]=w[Li];const va=[new ke(Un,n),new ke(Rt,n)];return new Ie(z,tr,0,va,Ce.CODE_128,new Date().getTime())}}Oe.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])],Oe.MAX_AVG_VARIANCE=.25,Oe.MAX_INDIVIDUAL_VARIANCE=.7,Oe.CODE_SHIFT=98,Oe.CODE_CODE_C=99,Oe.CODE_CODE_B=100,Oe.CODE_CODE_A=101,Oe.CODE_FNC_1=102,Oe.CODE_FNC_2=97,Oe.CODE_FNC_3=96,Oe.CODE_FNC_4_A=101,Oe.CODE_FNC_4_B=100,Oe.CODE_START_A=103,Oe.CODE_START_B=104,Oe.CODE_START_C=105,Oe.CODE_STOP=106;class Dt extends jt{constructor(n=!1,o=!1){super(),this.usingCheckDigit=n,this.extendedMode=o,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(n,o,l){let u=this.counters;u.fill(0),this.decodeRowResult="";let d=Dt.findAsteriskPattern(o,u),m=o.getNextSet(d[1]),p=o.getSize(),w,C;do{Dt.recordPattern(o,m,u);let J=Dt.toNarrowWidePattern(u);if(J<0)throw new ie;w=Dt.patternToChar(J),this.decodeRowResult+=w,C=m;for(let ae of u)m+=ae;m=o.getNextSet(m)}while(w!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let N=0;for(let J of u)N+=J;let D=m-C-N;if(m!==p&&D*2<N)throw new ie;if(this.usingCheckDigit){let J=this.decodeRowResult.length-1,ae=0;for(let he=0;he<J;he++)ae+=Dt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(he));if(this.decodeRowResult.charAt(J)!==Dt.ALPHABET_STRING.charAt(ae%43))throw new R;this.decodeRowResult=this.decodeRowResult.substring(0,J)}if(this.decodeRowResult.length===0)throw new ie;let z;this.extendedMode?z=Dt.decodeExtended(this.decodeRowResult):z=this.decodeRowResult;let G=(d[1]+d[0])/2,W=C+N/2;return new Ie(z,null,0,[new ke(G,n),new ke(W,n)],Ce.CODE_39,new Date().getTime())}static findAsteriskPattern(n,o){let l=n.getSize(),u=n.getNextSet(0),d=0,m=u,p=!1,w=o.length;for(let C=u;C<l;C++)if(n.get(C)!==p)o[d]++;else{if(d===w-1){if(this.toNarrowWidePattern(o)===Dt.ASTERISK_ENCODING&&n.isRange(Math.max(0,m-Math.floor((C-m)/2)),m,!1))return[m,C];m+=o[0]+o[1],o.copyWithin(0,2,2+d-1),o[d-1]=0,o[d]=0,d--}else d++;o[d]=1,p=!p}throw new ie}static toNarrowWidePattern(n){let o=n.length,l=0,u;do{let d=2147483647;for(let w of n)w<d&&w>l&&(d=w);l=d,u=0;let m=0,p=0;for(let w=0;w<o;w++){let C=n[w];C>l&&(p|=1<<o-1-w,u++,m+=C)}if(u===3){for(let w=0;w<o&&u>0;w++){let C=n[w];if(C>l&&(u--,C*2>=m))return-1}return p}}while(u>3);return-1}static patternToChar(n){for(let o=0;o<Dt.CHARACTER_ENCODINGS.length;o++)if(Dt.CHARACTER_ENCODINGS[o]===n)return Dt.ALPHABET_STRING.charAt(o);if(n===Dt.ASTERISK_ENCODING)return"*";throw new ie}static decodeExtended(n){let o=n.length,l="";for(let u=0;u<o;u++){let d=n.charAt(u);if(d==="+"||d==="$"||d==="%"||d==="/"){let m=n.charAt(u+1),p="\0";switch(d){case"+":if(m>="A"&&m<="Z")p=String.fromCharCode(m.charCodeAt(0)+32);else throw new X;break;case"$":if(m>="A"&&m<="Z")p=String.fromCharCode(m.charCodeAt(0)-64);else throw new X;break;case"%":if(m>="A"&&m<="E")p=String.fromCharCode(m.charCodeAt(0)-38);else if(m>="F"&&m<="J")p=String.fromCharCode(m.charCodeAt(0)-11);else if(m>="K"&&m<="O")p=String.fromCharCode(m.charCodeAt(0)+16);else if(m>="P"&&m<="T")p=String.fromCharCode(m.charCodeAt(0)+43);else if(m==="U")p="\0";else if(m==="V")p="@";else if(m==="W")p="`";else if(m==="X"||m==="Y"||m==="Z")p="";else throw new X;break;case"/":if(m>="A"&&m<="O")p=String.fromCharCode(m.charCodeAt(0)-32);else if(m==="Z")p=":";else throw new X;break}l+=p,u++}else l+=d}return l}}Dt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Dt.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],Dt.ASTERISK_ENCODING=148;class et extends jt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(n,o,l){let u=this.decodeStart(o),d=this.decodeEnd(o),m=new pe;et.decodeMiddle(o,u[1],d[0],m);let p=m.toString(),w=null;l!=null&&(w=l.get(Q.ALLOWED_LENGTHS)),w==null&&(w=et.DEFAULT_ALLOWED_LENGTHS);let C=p.length,N=!1,D=0;for(let W of w){if(C===W){N=!0;break}W>D&&(D=W)}if(!N&&C>D&&(N=!0),!N)throw new X;const z=[new ke(u[1],n),new ke(d[0],n)];return new Ie(p,null,0,z,Ce.ITF,new Date().getTime())}static decodeMiddle(n,o,l,u){let d=new Int32Array(10),m=new Int32Array(5),p=new Int32Array(5);for(d.fill(0),m.fill(0),p.fill(0);o<l;){jt.recordPattern(n,o,d);for(let C=0;C<5;C++){let N=2*C;m[C]=d[N],p[C]=d[N+1]}let w=et.decodeDigit(m);u.append(w.toString()),w=this.decodeDigit(p),u.append(w.toString()),d.forEach(function(C){o+=C})}}decodeStart(n){let o=et.skipWhiteSpace(n),l=et.findGuardPattern(n,o,et.START_PATTERN);return this.narrowLineWidth=(l[1]-l[0])/4,this.validateQuietZone(n,l[0]),l}validateQuietZone(n,o){let l=this.narrowLineWidth*10;l=l<o?l:o;for(let u=o-1;l>0&&u>=0&&!n.get(u);u--)l--;if(l!==0)throw new ie}static skipWhiteSpace(n){const o=n.getSize(),l=n.getNextSet(0);if(l===o)throw new ie;return l}decodeEnd(n){n.reverse();try{let o=et.skipWhiteSpace(n),l;try{l=et.findGuardPattern(n,o,et.END_PATTERN_REVERSED[0])}catch(d){d instanceof ie&&(l=et.findGuardPattern(n,o,et.END_PATTERN_REVERSED[1]))}this.validateQuietZone(n,l[0]);let u=l[0];return l[0]=n.getSize()-l[1],l[1]=n.getSize()-u,l}finally{n.reverse()}}static findGuardPattern(n,o,l){let u=l.length,d=new Int32Array(u),m=n.getSize(),p=!1,w=0,C=o;d.fill(0);for(let N=o;N<m;N++)if(n.get(N)!==p)d[w]++;else{if(w===u-1){if(jt.patternMatchVariance(d,l,et.MAX_INDIVIDUAL_VARIANCE)<et.MAX_AVG_VARIANCE)return[C,N];C+=d[0]+d[1],B.arraycopy(d,2,d,0,w-1),d[w-1]=0,d[w]=0,w--}else w++;d[w]=1,p=!p}throw new ie}static decodeDigit(n){let o=et.MAX_AVG_VARIANCE,l=-1,u=et.PATTERNS.length;for(let d=0;d<u;d++){let m=et.PATTERNS[d],p=jt.patternMatchVariance(n,m,et.MAX_INDIVIDUAL_VARIANCE);p<o?(o=p,l=d):p===o&&(l=-1)}if(l>=0)return l%10;throw new ie}}et.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])],et.MAX_AVG_VARIANCE=.38,et.MAX_INDIVIDUAL_VARIANCE=.5,et.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],et.START_PATTERN=Int32Array.from([1,1,1,1]),et.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class Kt extends jt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(n){let o=!1,l,u=0,d=Int32Array.from([0,0,0]);for(;!o;){d=Int32Array.from([0,0,0]),l=Kt.findGuardPattern(n,u,!1,this.START_END_PATTERN,d);let m=l[0];u=l[1];let p=m-(u-m);p>=0&&(o=n.isRange(p,m,!1))}return l}static checkChecksum(n){return Kt.checkStandardUPCEANChecksum(n)}static checkStandardUPCEANChecksum(n){let o=n.length;if(o===0)return!1;let l=parseInt(n.charAt(o-1),10);return Kt.getStandardUPCEANChecksum(n.substring(0,o-1))===l}static getStandardUPCEANChecksum(n){let o=n.length,l=0;for(let u=o-1;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}l*=3;for(let u=o-2;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}return(1e3-l)%10}static decodeEnd(n,o){return Kt.findGuardPattern(n,o,!1,Kt.START_END_PATTERN,new Int32Array(Kt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(n,o,l,u){return this.findGuardPattern(n,o,l,u,new Int32Array(u.length))}static findGuardPattern(n,o,l,u,d){let m=n.getSize();o=l?n.getNextUnset(o):n.getNextSet(o);let p=0,w=o,C=u.length,N=l;for(let D=o;D<m;D++)if(n.get(D)!==N)d[p]++;else{if(p===C-1){if(jt.patternMatchVariance(d,u,Kt.MAX_INDIVIDUAL_VARIANCE)<Kt.MAX_AVG_VARIANCE)return Int32Array.from([w,D]);w+=d[0]+d[1];let z=d.slice(2,d.length-1);for(let G=0;G<p-1;G++)d[G]=z[G];d[p-1]=0,d[p]=0,p--}else p++;d[p]=1,N=!N}throw new ie}static decodeDigit(n,o,l,u){this.recordPattern(n,l,o);let d=this.MAX_AVG_VARIANCE,m=-1,p=u.length;for(let w=0;w<p;w++){let C=u[w],N=jt.patternMatchVariance(o,C,Kt.MAX_INDIVIDUAL_VARIANCE);N<d&&(d=N,m=w)}if(m>=0)return m;throw new ie}}Kt.MAX_AVG_VARIANCE=.48,Kt.MAX_INDIVIDUAL_VARIANCE=.7,Kt.START_END_PATTERN=Int32Array.from([1,1,1]),Kt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),Kt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Kt.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 Qa{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(n,o,l){let u=this.decodeRowStringBuffer,d=this.decodeMiddle(o,l,u),m=u.toString(),p=Qa.parseExtensionString(m),w=[new ke((l[0]+l[1])/2,n),new ke(d,n)],C=new Ie(m,null,0,w,Ce.UPC_EAN_EXTENSION,new Date().getTime());return p!=null&&C.putAllMetadata(p),C}decodeMiddle(n,o,l){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1],p=0;for(let C=0;C<5&&m<d;C++){let N=Kt.decodeDigit(n,u,m,Kt.L_AND_G_PATTERNS);l+=String.fromCharCode(48+N%10);for(let D of u)m+=D;N>=10&&(p|=1<<4-C),C!==4&&(m=n.getNextSet(m),m=n.getNextUnset(m))}if(l.length!==5)throw new ie;let w=this.determineCheckDigit(p);if(Qa.extensionChecksum(l.toString())!==w)throw new ie;return m}static extensionChecksum(n){let o=n.length,l=0;for(let u=o-2;u>=0;u-=2)l+=n.charAt(u).charCodeAt(0)-48;l*=3;for(let u=o-1;u>=0;u-=2)l+=n.charAt(u).charCodeAt(0)-48;return l*=3,l%10}determineCheckDigit(n){for(let o=0;o<10;o++)if(n===this.CHECK_DIGIT_ENCODINGS[o])return o;throw new ie}static parseExtensionString(n){if(n.length!==5)return null;let o=Qa.parseExtension5String(n);return o==null?null:new Map([[Qe.SUGGESTED_PRICE,o]])}static parseExtension5String(n){let o;switch(n.charAt(0)){case"0":o="£";break;case"5":o="$";break;case"9":switch(n){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}o="";break;default:o="";break}let l=parseInt(n.substring(1)),u=(l/100).toString(),d=l%100,m=d<10?"0"+d:d.toString();return o+u+"."+m}}class Us{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(n,o,l){let u=this.decodeRowStringBuffer,d=this.decodeMiddle(o,l,u),m=u.toString(),p=Us.parseExtensionString(m),w=[new ke((l[0]+l[1])/2,n),new ke(d,n)],C=new Ie(m,null,0,w,Ce.UPC_EAN_EXTENSION,new Date().getTime());return p!=null&&C.putAllMetadata(p),C}decodeMiddle(n,o,l){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1],p=0;for(let w=0;w<2&&m<d;w++){let C=Kt.decodeDigit(n,u,m,Kt.L_AND_G_PATTERNS);l+=String.fromCharCode(48+C%10);for(let N of u)m+=N;C>=10&&(p|=1<<1-w),w!==1&&(m=n.getNextSet(m),m=n.getNextUnset(m))}if(l.length!==2)throw new ie;if(parseInt(l.toString())%4!==p)throw new ie;return m}static parseExtensionString(n){return n.length!==2?null:new Map([[Qe.ISSUE_NUMBER,parseInt(n)]])}}class Ja{static decodeRow(n,o,l){let u=Kt.findGuardPattern(o,l,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new Qa().decodeRow(n,o,u)}catch{return new Us().decodeRow(n,o,u)}}}Ja.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class ut extends Kt{constructor(){super(),this.decodeRowStringBuffer="",ut.L_AND_G_PATTERNS=ut.L_PATTERNS.map(n=>Int32Array.from(n));for(let n=10;n<20;n++){let o=ut.L_PATTERNS[n-10],l=new Int32Array(o.length);for(let u=0;u<o.length;u++)l[u]=o[o.length-u-1];ut.L_AND_G_PATTERNS[n]=l}}decodeRow(n,o,l){let u=ut.findStartGuardPattern(o),d=l==null?null:l.get(Q.NEED_RESULT_POINT_CALLBACK);if(d!=null){const Ae=new ke((u[0]+u[1])/2,n);d.foundPossibleResultPoint(Ae)}let m=this.decodeMiddle(o,u,this.decodeRowStringBuffer),p=m.rowOffset,w=m.resultString;if(d!=null){const Ae=new ke(p,n);d.foundPossibleResultPoint(Ae)}let C=this.decodeEnd(o,p);if(d!=null){const Ae=new ke((C[0]+C[1])/2,n);d.foundPossibleResultPoint(Ae)}let N=C[1],D=N+(N-C[0]);if(D>=o.getSize()||!o.isRange(N,D,!1))throw new ie;let z=w.toString();if(z.length<8)throw new X;if(!ut.checkChecksum(z))throw new R;let G=(u[1]+u[0])/2,W=(C[1]+C[0])/2,J=this.getBarcodeFormat(),ae=[new ke(G,n),new ke(W,n)],he=new Ie(z,null,0,ae,J,new Date().getTime()),Ne=0;try{let Ae=Ja.decodeRow(n,o,C[1]);he.putMetadata(Qe.UPC_EAN_EXTENSION,Ae.getText()),he.putAllMetadata(Ae.getResultMetadata()),he.addResultPoints(Ae.getResultPoints()),Ne=Ae.getText().length}catch{}let Se=l==null?null:l.get(Q.ALLOWED_EAN_EXTENSIONS);if(Se!=null){let Ae=!1;for(let it in Se)if(Ne.toString()===it){Ae=!0;break}if(!Ae)throw new ie}return he}decodeEnd(n,o){return ut.findGuardPattern(n,o,!1,ut.START_END_PATTERN,new Int32Array(ut.START_END_PATTERN.length).fill(0))}static checkChecksum(n){return ut.checkStandardUPCEANChecksum(n)}static checkStandardUPCEANChecksum(n){let o=n.length;if(o===0)return!1;let l=parseInt(n.charAt(o-1),10);return ut.getStandardUPCEANChecksum(n.substring(0,o-1))===l}static getStandardUPCEANChecksum(n){let o=n.length,l=0;for(let u=o-1;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}l*=3;for(let u=o-2;u>=0;u-=2){let d=n.charAt(u).charCodeAt(0)-48;if(d<0||d>9)throw new X;l+=d}return(1e3-l)%10}}class Lr extends ut{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(n,o,l){let u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1],p=0;for(let C=0;C<6&&m<d;C++){let N=ut.decodeDigit(n,u,m,ut.L_AND_G_PATTERNS);l+=String.fromCharCode(48+N%10);for(let D of u)m+=D;N>=10&&(p|=1<<5-C)}l=Lr.determineFirstDigit(l,p),m=ut.findGuardPattern(n,m,!0,ut.MIDDLE_PATTERN,new Int32Array(ut.MIDDLE_PATTERN.length).fill(0))[1];for(let C=0;C<6&&m<d;C++){let N=ut.decodeDigit(n,u,m,ut.L_PATTERNS);l+=String.fromCharCode(48+N);for(let D of u)m+=D}return{rowOffset:m,resultString:l}}getBarcodeFormat(){return Ce.EAN_13}static determineFirstDigit(n,o){for(let l=0;l<10;l++)if(o===this.FIRST_DIGIT_ENCODINGS[l])return n=String.fromCharCode(48+l)+n,n;throw new ie}}Lr.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class di extends ut{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(n,o,l){const u=this.decodeMiddleCounters;u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m=o[1];for(let w=0;w<4&&m<d;w++){let C=ut.decodeDigit(n,u,m,ut.L_PATTERNS);l+=String.fromCharCode(48+C);for(let N of u)m+=N}m=ut.findGuardPattern(n,m,!0,ut.MIDDLE_PATTERN,new Int32Array(ut.MIDDLE_PATTERN.length).fill(0))[1];for(let w=0;w<4&&m<d;w++){let C=ut.decodeDigit(n,u,m,ut.L_PATTERNS);l+=String.fromCharCode(48+C);for(let N of u)m+=N}return{rowOffset:m,resultString:l}}getBarcodeFormat(){return Ce.EAN_8}}class $a extends ut{constructor(){super(...arguments),this.ean13Reader=new Lr}getBarcodeFormat(){return Ce.UPC_A}decode(n,o){return this.maybeReturnResult(this.ean13Reader.decode(n))}decodeRow(n,o,l){return this.maybeReturnResult(this.ean13Reader.decodeRow(n,o,l))}decodeMiddle(n,o,l){return this.ean13Reader.decodeMiddle(n,o,l)}maybeReturnResult(n){let o=n.getText();if(o.charAt(0)==="0"){let l=new Ie(o.substring(1),null,null,n.getResultPoints(),Ce.UPC_A);return n.getResultMetadata()!=null&&l.putAllMetadata(n.getResultMetadata()),l}else throw new ie}reset(){this.ean13Reader.reset()}}class zn extends ut{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(n,o,l){const u=this.decodeMiddleCounters.map(C=>C);u[0]=0,u[1]=0,u[2]=0,u[3]=0;const d=n.getSize();let m=o[1],p=0;for(let C=0;C<6&&m<d;C++){const N=zn.decodeDigit(n,u,m,zn.L_AND_G_PATTERNS);l+=String.fromCharCode(48+N%10);for(let D of u)m+=D;N>=10&&(p|=1<<5-C)}let w=zn.determineNumSysAndCheckDigit(l,p);return{rowOffset:m,resultString:w}}decodeEnd(n,o){return zn.findGuardPatternWithoutCounters(n,o,!0,zn.MIDDLE_END_PATTERN)}checkChecksum(n){return ut.checkChecksum(zn.convertUPCEtoUPCA(n))}static determineNumSysAndCheckDigit(n,o){for(let l=0;l<=1;l++)for(let u=0;u<10;u++)if(o===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[l][u]){let d=String.fromCharCode(48+l),m=String.fromCharCode(48+u);return d+n+m}throw ie.getNotFoundInstance()}getBarcodeFormat(){return Ce.UPC_E}static convertUPCEtoUPCA(n){const o=n.slice(1,7).split("").map(d=>d.charCodeAt(0)),l=new pe;l.append(n.charAt(0));let u=o[5];switch(u){case 0:case 1:case 2:l.appendChars(o,0,2),l.append(u),l.append("0000"),l.appendChars(o,2,3);break;case 3:l.appendChars(o,0,3),l.append("00000"),l.appendChars(o,3,2);break;case 4:l.appendChars(o,0,4),l.append("00000"),l.append(o[4]);break;default:l.appendChars(o,0,5),l.append("0000"),l.append(u);break}return n.length>=8&&l.append(n.charAt(7)),l.toString()}}zn.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),zn.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 Fs extends jt{constructor(n){super();let o=n==null?null:n.get(Q.POSSIBLE_FORMATS),l=[];s(o)?(l.push(new Lr),l.push(new $a),l.push(new di),l.push(new zn)):(o.indexOf(Ce.EAN_13)>-1&&l.push(new Lr),o.indexOf(Ce.UPC_A)>-1&&l.push(new $a),o.indexOf(Ce.EAN_8)>-1&&l.push(new di),o.indexOf(Ce.UPC_E)>-1&&l.push(new zn)),this.readers=l}decodeRow(n,o,l){for(let u of this.readers)try{const d=u.decodeRow(n,o,l),m=d.getBarcodeFormat()===Ce.EAN_13&&d.getText().charAt(0)==="0",p=l==null?null:l.get(Q.POSSIBLE_FORMATS),w=p==null||p.includes(Ce.UPC_A);if(m&&w){const C=d.getRawBytes(),N=new Ie(d.getText().substring(1),C,C?C.length:null,d.getResultPoints(),Ce.UPC_A);return N.putAllMetadata(d.getResultMetadata()),N}return d}catch{}throw new ie}reset(){for(let n of this.readers)n.reset()}}class Nn extends jt{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(n,o){for(let l=0;l<o.length;l++)if(jt.patternMatchVariance(n,o[l],Nn.MAX_INDIVIDUAL_VARIANCE)<Nn.MAX_AVG_VARIANCE)return l;throw new ie}static count(n){return ot.sum(new Int32Array(n))}static increment(n,o){let l=0,u=o[0];for(let d=1;d<n.length;d++)o[d]>u&&(u=o[d],l=d);n[l]++}static decrement(n,o){let l=0,u=o[0];for(let d=1;d<n.length;d++)o[d]<u&&(u=o[d],l=d);n[l]--}static isFinderPattern(n){let o=n[0]+n[1],l=o+n[2]+n[3],u=o/l;if(u>=Nn.MIN_FINDER_PATTERN_RATIO&&u<=Nn.MAX_FINDER_PATTERN_RATIO){let d=Number.MAX_SAFE_INTEGER,m=Number.MIN_SAFE_INTEGER;for(let p of n)p>m&&(m=p),p<d&&(d=p);return m<10*d}return!1}}Nn.MAX_AVG_VARIANCE=.2,Nn.MAX_INDIVIDUAL_VARIANCE=.45,Nn.MIN_FINDER_PATTERN_RATIO=9.5/12,Nn.MAX_FINDER_PATTERN_RATIO=12.5/14;class hi{constructor(n,o){this.value=n,this.checksumPortion=o}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(n){if(!(n instanceof hi))return!1;const o=n;return this.value===o.value&&this.checksumPortion===o.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class gi{constructor(n,o,l,u,d){this.value=n,this.startEnd=o,this.value=n,this.startEnd=o,this.resultPoints=new Array,this.resultPoints.push(new ke(l,d)),this.resultPoints.push(new ke(u,d))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(n){if(!(n instanceof gi))return!1;const o=n;return this.value===o.value}hashCode(){return this.value}}class Pr{constructor(){}static getRSSvalue(n,o,l){let u=0;for(let w of n)u+=w;let d=0,m=0,p=n.length;for(let w=0;w<p-1;w++){let C;for(C=1,m|=1<<w;C<n[w];C++,m&=~(1<<w)){let N=Pr.combins(u-C-1,p-w-2);if(l&&m===0&&u-C-(p-w-1)>=p-w-1&&(N-=Pr.combins(u-C-(p-w),p-w-2)),p-w-1>1){let D=0;for(let z=u-C-(p-w-2);z>o;z--)D+=Pr.combins(u-C-z-1,p-w-3);N-=D*(p-1-w)}else u-C>o&&N--;d+=N}u-=C}return d}static combins(n,o){let l,u;n-o>o?(u=o,l=n-o):(u=n-o,l=o);let d=1,m=1;for(let p=n;p>l;p--)d*=p,m<=u&&(d/=m,m++);for(;m<=u;)d/=m,m++;return d}}class $l{static buildBitArray(n){let o=n.length*2-1;n[n.length-1].getRightChar()==null&&(o-=1);let l=12*o,u=new H(l),d=0,p=n[0].getRightChar().getValue();for(let w=11;w>=0;--w)(p&1<<w)!=0&&u.set(d),d++;for(let w=1;w<n.length;++w){let C=n[w],N=C.getLeftChar().getValue();for(let D=11;D>=0;--D)(N&1<<D)!=0&&u.set(d),d++;if(C.getRightChar()!=null){let D=C.getRightChar().getValue();for(let z=11;z>=0;--z)(D&1<<z)!=0&&u.set(d),d++}}return u}}class mi{constructor(n,o){o?this.decodedInformation=null:(this.finished=n,this.decodedInformation=o)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Bo{constructor(n){this.newPosition=n}getNewPosition(){return this.newPosition}}class kn extends Bo{constructor(n,o){super(n),this.value=o}getValue(){return this.value}isFNC1(){return this.value===kn.FNC1}}kn.FNC1="$";class Jr extends Bo{constructor(n,o,l){super(n),l?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=o}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Kn extends Bo{constructor(n,o,l){if(super(n),o<0||o>10||l<0||l>10)throw new X;this.firstDigit=o,this.secondDigit=l}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Kn.FNC1}isSecondDigitFNC1(){return this.secondDigit===Kn.FNC1}isAnyFNC1(){return this.firstDigit===Kn.FNC1||this.secondDigit===Kn.FNC1}}Kn.FNC1=10;class De{constructor(){}static parseFieldsInGeneralPurpose(n){if(!n)return null;if(n.length<2)throw new ie;let o=n.substring(0,2);for(let d of De.TWO_DIGIT_DATA_LENGTH)if(d[0]===o)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(2,d[2],n):De.processFixedAI(2,d[1],n);if(n.length<3)throw new ie;let l=n.substring(0,3);for(let d of De.THREE_DIGIT_DATA_LENGTH)if(d[0]===l)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(3,d[2],n):De.processFixedAI(3,d[1],n);for(let d of De.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(d[0]===l)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(4,d[2],n):De.processFixedAI(4,d[1],n);if(n.length<4)throw new ie;let u=n.substring(0,4);for(let d of De.FOUR_DIGIT_DATA_LENGTH)if(d[0]===u)return d[1]===De.VARIABLE_LENGTH?De.processVariableAI(4,d[2],n):De.processFixedAI(4,d[1],n);throw new ie}static processFixedAI(n,o,l){if(l.length<n)throw new ie;let u=l.substring(0,n);if(l.length<n+o)throw new ie;let d=l.substring(n,n+o),m=l.substring(n+o),p="("+u+")"+d,w=De.parseFieldsInGeneralPurpose(m);return w==null?p:p+w}static processVariableAI(n,o,l){let u=l.substring(0,n),d;l.length<n+o?d=l.length:d=n+o;let m=l.substring(n,d),p=l.substring(d),w="("+u+")"+m,C=De.parseFieldsInGeneralPurpose(p);return C==null?w:w+C}}De.VARIABLE_LENGTH=[],De.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",De.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",De.VARIABLE_LENGTH,20],["22",De.VARIABLE_LENGTH,29],["30",De.VARIABLE_LENGTH,8],["37",De.VARIABLE_LENGTH,8],["90",De.VARIABLE_LENGTH,30],["91",De.VARIABLE_LENGTH,30],["92",De.VARIABLE_LENGTH,30],["93",De.VARIABLE_LENGTH,30],["94",De.VARIABLE_LENGTH,30],["95",De.VARIABLE_LENGTH,30],["96",De.VARIABLE_LENGTH,30],["97",De.VARIABLE_LENGTH,3],["98",De.VARIABLE_LENGTH,30],["99",De.VARIABLE_LENGTH,30]],De.THREE_DIGIT_DATA_LENGTH=[["240",De.VARIABLE_LENGTH,30],["241",De.VARIABLE_LENGTH,30],["242",De.VARIABLE_LENGTH,6],["250",De.VARIABLE_LENGTH,30],["251",De.VARIABLE_LENGTH,30],["253",De.VARIABLE_LENGTH,17],["254",De.VARIABLE_LENGTH,20],["400",De.VARIABLE_LENGTH,30],["401",De.VARIABLE_LENGTH,30],["402",17],["403",De.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",De.VARIABLE_LENGTH,20],["421",De.VARIABLE_LENGTH,15],["422",3],["423",De.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],De.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",De.VARIABLE_LENGTH,15],["391",De.VARIABLE_LENGTH,18],["392",De.VARIABLE_LENGTH,15],["393",De.VARIABLE_LENGTH,18],["703",De.VARIABLE_LENGTH,30]],De.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",De.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",De.VARIABLE_LENGTH,20],["8003",De.VARIABLE_LENGTH,30],["8004",De.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",De.VARIABLE_LENGTH,30],["8008",De.VARIABLE_LENGTH,12],["8018",18],["8020",De.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",De.VARIABLE_LENGTH,70],["8200",De.VARIABLE_LENGTH,70]];class Qn{constructor(n){this.buffer=new pe,this.information=n}decodeAllCodes(n,o){let l=o,u=null;do{let d=this.decodeGeneralPurposeField(l,u),m=De.parseFieldsInGeneralPurpose(d.getNewString());if(m!=null&&n.append(m),d.isRemaining()?u=""+d.getRemainingValue():u=null,l===d.getNewPosition())break;l=d.getNewPosition()}while(!0);return n.toString()}isStillNumeric(n){if(n+7>this.information.getSize())return n+4<=this.information.getSize();for(let o=n;o<n+3;++o)if(this.information.get(o))return!0;return this.information.get(n+3)}decodeNumeric(n){if(n+7>this.information.getSize()){let d=this.extractNumericValueFromBitArray(n,4);return d===0?new Kn(this.information.getSize(),Kn.FNC1,Kn.FNC1):new Kn(this.information.getSize(),d-1,Kn.FNC1)}let o=this.extractNumericValueFromBitArray(n,7),l=(o-8)/11,u=(o-8)%11;return new Kn(n+7,l,u)}extractNumericValueFromBitArray(n,o){return Qn.extractNumericValueFromBitArray(this.information,n,o)}static extractNumericValueFromBitArray(n,o,l){let u=0;for(let d=0;d<l;++d)n.get(o+d)&&(u|=1<<l-d-1);return u}decodeGeneralPurposeField(n,o){this.buffer.setLengthToZero(),o!=null&&this.buffer.append(o),this.current.setPosition(n);let l=this.parseBlocks();return l!=null&&l.isRemaining()?new Jr(this.current.getPosition(),this.buffer.toString(),l.getRemainingValue()):new Jr(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let n,o;do{let l=this.current.getPosition();if(this.current.isAlpha()?(o=this.parseAlphaBlock(),n=o.isFinished()):this.current.isIsoIec646()?(o=this.parseIsoIec646Block(),n=o.isFinished()):(o=this.parseNumericBlock(),n=o.isFinished()),!(l!==this.current.getPosition())&&!n)break}while(!n);return o.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let n=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFirstDigitFNC1()){let o;return n.isSecondDigitFNC1()?o=new Jr(this.current.getPosition(),this.buffer.toString()):o=new Jr(this.current.getPosition(),this.buffer.toString(),n.getSecondDigit()),new mi(!0,o)}if(this.buffer.append(n.getFirstDigit()),n.isSecondDigitFNC1()){let o=new Jr(this.current.getPosition(),this.buffer.toString());return new mi(!0,o)}this.buffer.append(n.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new mi(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let n=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFNC1()){let o=new Jr(this.current.getPosition(),this.buffer.toString());return new mi(!0,o)}this.buffer.append(n.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 mi(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let n=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(n.getNewPosition()),n.isFNC1()){let o=new Jr(this.current.getPosition(),this.buffer.toString());return new mi(!0,o)}this.buffer.append(n.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 mi(!1)}isStillIsoIec646(n){if(n+5>this.information.getSize())return!1;let o=this.extractNumericValueFromBitArray(n,5);if(o>=5&&o<16)return!0;if(n+7>this.information.getSize())return!1;let l=this.extractNumericValueFromBitArray(n,7);if(l>=64&&l<116)return!0;if(n+8>this.information.getSize())return!1;let u=this.extractNumericValueFromBitArray(n,8);return u>=232&&u<253}decodeIsoIec646(n){let o=this.extractNumericValueFromBitArray(n,5);if(o===15)return new kn(n+5,kn.FNC1);if(o>=5&&o<15)return new kn(n+5,"0"+(o-5));let l=this.extractNumericValueFromBitArray(n,7);if(l>=64&&l<90)return new kn(n+7,""+(l+1));if(l>=90&&l<116)return new kn(n+7,""+(l+7));let u=this.extractNumericValueFromBitArray(n,8),d;switch(u){case 232:d="!";break;case 233:d='"';break;case 234:d="%";break;case 235:d="&";break;case 236:d="'";break;case 237:d="(";break;case 238:d=")";break;case 239:d="*";break;case 240:d="+";break;case 241:d=",";break;case 242:d="-";break;case 243:d=".";break;case 244:d="/";break;case 245:d=":";break;case 246:d=";";break;case 247:d="<";break;case 248:d="=";break;case 249:d=">";break;case 250:d="?";break;case 251:d="_";break;case 252:d=" ";break;default:throw new X}return new kn(n+8,d)}isStillAlpha(n){if(n+5>this.information.getSize())return!1;let o=this.extractNumericValueFromBitArray(n,5);if(o>=5&&o<16)return!0;if(n+6>this.information.getSize())return!1;let l=this.extractNumericValueFromBitArray(n,6);return l>=16&&l<63}decodeAlphanumeric(n){let o=this.extractNumericValueFromBitArray(n,5);if(o===15)return new kn(n+5,kn.FNC1);if(o>=5&&o<15)return new kn(n+5,"0"+(o-5));let l=this.extractNumericValueFromBitArray(n,6);if(l>=32&&l<58)return new kn(n+6,""+(l+33));let u;switch(l){case 58:u="*";break;case 59:u=",";break;case 60:u="-";break;case 61:u=".";break;case 62:u="/";break;default:throw new or("Decoding invalid alphanumeric value: "+l)}return new kn(n+6,u)}isAlphaTo646ToAlphaLatch(n){if(n+1>this.information.getSize())return!1;for(let o=0;o<5&&o+n<this.information.getSize();++o)if(o===2){if(!this.information.get(n+2))return!1}else if(this.information.get(n+o))return!1;return!0}isAlphaOr646ToNumericLatch(n){if(n+3>this.information.getSize())return!1;for(let o=n;o<n+3;++o)if(this.information.get(o))return!1;return!0}isNumericToAlphaNumericLatch(n){if(n+1>this.information.getSize())return!1;for(let o=0;o<4&&o+n<this.information.getSize();++o)if(this.information.get(n+o))return!1;return!0}}class dn{constructor(n){this.information=n,this.generalDecoder=new Qn(n)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Ot extends dn{constructor(n){super(n)}encodeCompressedGtin(n,o){n.append("(01)");let l=n.length();n.append("9"),this.encodeCompressedGtinWithoutAI(n,o,l)}encodeCompressedGtinWithoutAI(n,o,l){for(let u=0;u<4;++u){let d=this.getGeneralDecoder().extractNumericValueFromBitArray(o+10*u,10);d/100===0&&n.append("0"),d/10===0&&n.append("0"),n.append(d)}Ot.appendCheckDigit(n,l)}static appendCheckDigit(n,o){let l=0;for(let u=0;u<13;u++){let d=n.charAt(u+o).charCodeAt(0)-48;l+=(u&1)===0?3*d:d}l=10-l%10,l===10&&(l=0),n.append(l)}}Ot.GTIN_SIZE=40;class wr extends Ot{constructor(n){super(n)}parseInformation(){let n=new pe;n.append("(01)");let o=n.length(),l=this.getGeneralDecoder().extractNumericValueFromBitArray(wr.HEADER_SIZE,4);return n.append(l),this.encodeCompressedGtinWithoutAI(n,wr.HEADER_SIZE+4,o),this.getGeneralDecoder().decodeAllCodes(n,wr.HEADER_SIZE+44)}}wr.HEADER_SIZE=4;class oa extends dn{constructor(n){super(n)}parseInformation(){let n=new pe;return this.getGeneralDecoder().decodeAllCodes(n,oa.HEADER_SIZE)}}oa.HEADER_SIZE=5;class ko extends Ot{constructor(n){super(n)}encodeCompressedWeight(n,o,l){let u=this.getGeneralDecoder().extractNumericValueFromBitArray(o,l);this.addWeightCode(n,u);let d=this.checkWeight(u),m=1e5;for(let p=0;p<5;++p)d/m===0&&n.append("0"),m/=10;n.append(d)}}class zr extends ko{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()!=zr.HEADER_SIZE+ko.GTIN_SIZE+zr.WEIGHT_SIZE)throw new ie;let n=new pe;return this.encodeCompressedGtin(n,zr.HEADER_SIZE),this.encodeCompressedWeight(n,zr.HEADER_SIZE+ko.GTIN_SIZE,zr.WEIGHT_SIZE),n.toString()}}zr.HEADER_SIZE=5,zr.WEIGHT_SIZE=15;class ec extends zr{constructor(n){super(n)}addWeightCode(n,o){n.append("(3103)")}checkWeight(n){return n}}class eo extends zr{constructor(n){super(n)}addWeightCode(n,o){o<1e4?n.append("(3202)"):n.append("(3203)")}checkWeight(n){return n<1e4?n:n-1e4}}class lr extends Ot{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()<lr.HEADER_SIZE+Ot.GTIN_SIZE)throw new ie;let n=new pe;this.encodeCompressedGtin(n,lr.HEADER_SIZE);let o=this.getGeneralDecoder().extractNumericValueFromBitArray(lr.HEADER_SIZE+Ot.GTIN_SIZE,lr.LAST_DIGIT_SIZE);n.append("(392"),n.append(o),n.append(")");let l=this.getGeneralDecoder().decodeGeneralPurposeField(lr.HEADER_SIZE+Ot.GTIN_SIZE+lr.LAST_DIGIT_SIZE,null);return n.append(l.getNewString()),n.toString()}}lr.HEADER_SIZE=8,lr.LAST_DIGIT_SIZE=2;class an extends Ot{constructor(n){super(n)}parseInformation(){if(this.getInformation().getSize()<an.HEADER_SIZE+Ot.GTIN_SIZE)throw new ie;let n=new pe;this.encodeCompressedGtin(n,an.HEADER_SIZE);let o=this.getGeneralDecoder().extractNumericValueFromBitArray(an.HEADER_SIZE+Ot.GTIN_SIZE,an.LAST_DIGIT_SIZE);n.append("(393"),n.append(o),n.append(")");let l=this.getGeneralDecoder().extractNumericValueFromBitArray(an.HEADER_SIZE+Ot.GTIN_SIZE+an.LAST_DIGIT_SIZE,an.FIRST_THREE_DIGITS_SIZE);l/100==0&&n.append("0"),l/10==0&&n.append("0"),n.append(l);let u=this.getGeneralDecoder().decodeGeneralPurposeField(an.HEADER_SIZE+Ot.GTIN_SIZE+an.LAST_DIGIT_SIZE+an.FIRST_THREE_DIGITS_SIZE,null);return n.append(u.getNewString()),n.toString()}}an.HEADER_SIZE=8,an.LAST_DIGIT_SIZE=2,an.FIRST_THREE_DIGITS_SIZE=10;class Et extends ko{constructor(n,o,l){super(n),this.dateCode=l,this.firstAIdigits=o}parseInformation(){if(this.getInformation().getSize()!=Et.HEADER_SIZE+Et.GTIN_SIZE+Et.WEIGHT_SIZE+Et.DATE_SIZE)throw new ie;let n=new pe;return this.encodeCompressedGtin(n,Et.HEADER_SIZE),this.encodeCompressedWeight(n,Et.HEADER_SIZE+Et.GTIN_SIZE,Et.WEIGHT_SIZE),this.encodeCompressedDate(n,Et.HEADER_SIZE+Et.GTIN_SIZE+Et.WEIGHT_SIZE),n.toString()}encodeCompressedDate(n,o){let l=this.getGeneralDecoder().extractNumericValueFromBitArray(o,Et.DATE_SIZE);if(l==38400)return;n.append("("),n.append(this.dateCode),n.append(")");let u=l%32;l/=32;let d=l%12+1;l/=12;let m=l;m/10==0&&n.append("0"),n.append(m),d/10==0&&n.append("0"),n.append(d),u/10==0&&n.append("0"),n.append(u)}addWeightCode(n,o){n.append("("),n.append(this.firstAIdigits),n.append(o/1e5),n.append(")")}checkWeight(n){return n%1e5}}Et.HEADER_SIZE=8,Et.WEIGHT_SIZE=20,Et.DATE_SIZE=16;function sa(M){try{if(M.get(1))return new wr(M);if(!M.get(2))return new oa(M);switch(Qn.extractNumericValueFromBitArray(M,1,4)){case 4:return new ec(M);case 5:return new eo(M)}switch(Qn.extractNumericValueFromBitArray(M,1,5)){case 12:return new lr(M);case 13:return new an(M)}switch(Qn.extractNumericValueFromBitArray(M,1,7)){case 56:return new Et(M,"310","11");case 57:return new Et(M,"320","11");case 58:return new Et(M,"310","13");case 59:return new Et(M,"320","13");case 60:return new Et(M,"310","15");case 61:return new Et(M,"320","15");case 62:return new Et(M,"310","17");case 63:return new Et(M,"320","17")}}catch(n){throw console.log(n),new or("unknown decoder: "+M)}}class Jn{constructor(n,o,l,u){this.leftchar=n,this.rightchar=o,this.finderpattern=l,this.maybeLast=u}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(n,o){return n instanceof Jn?Jn.equalsOrNull(n.leftchar,o.leftchar)&&Jn.equalsOrNull(n.rightchar,o.rightchar)&&Jn.equalsOrNull(n.finderpattern,o.finderpattern):!1}static equalsOrNull(n,o){return n===null?o===null:Jn.equals(n,o)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class on{constructor(n,o,l){this.pairs=n,this.rowNumber=o,this.wasReversed=l}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(n){return this.checkEqualitity(this,n)}toString(){return"{ "+this.pairs+" }"}equals(n,o){return n instanceof on?this.checkEqualitity(n,o)&&n.wasReversed===o.wasReversed:!1}checkEqualitity(n,o){if(!n||!o)return;let l;return n.forEach((u,d)=>{o.forEach(m=>{u.getLeftChar().getValue()===m.getLeftChar().getValue()&&u.getRightChar().getValue()===m.getRightChar().getValue()&&u.getFinderPatter().getValue()===m.getFinderPatter().getValue()&&(l=!0)})}),l}}class Ee extends Nn{constructor(n){super(...arguments),this.pairs=new Array(Ee.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=n===!0}decodeRow(n,o,l){this.pairs.length=0,this.startFromEven=!1;try{return Ee.constructResult(this.decodeRow2pairs(n,o))}catch(u){this.verbose&&console.log(u)}return this.pairs.length=0,this.startFromEven=!0,Ee.constructResult(this.decodeRow2pairs(n,o))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(n,o){let l=!1;for(;!l;)try{this.pairs.push(this.retrieveNextPair(o,this.pairs,n))}catch(d){if(d instanceof ie){if(!this.pairs.length)throw new ie;l=!0}}if(this.checkChecksum())return this.pairs;let u;if(this.rows.length?u=!0:u=!1,this.storeRow(n,!1),u){let d=this.checkRowsBoolean(!1);if(d!=null||(d=this.checkRowsBoolean(!0),d!=null))return d}throw new ie}checkRowsBoolean(n){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,n&&(this.rows=this.rows.reverse());let o=null;try{o=this.checkRows(new Array,0)}catch(l){this.verbose&&console.log(l)}return n&&(this.rows=this.rows.reverse()),o}checkRows(n,o){for(let l=o;l<this.rows.length;l++){let u=this.rows[l];this.pairs.length=0;for(let m of n)this.pairs.push(m.getPairs());if(this.pairs.push(u.getPairs()),!Ee.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let d=new Array(n);d.push(u);try{return this.checkRows(d,l+1)}catch(m){this.verbose&&console.log(m)}}throw new ie}static isValidSequence(n){for(let o of Ee.FINDER_PATTERN_SEQUENCES){if(n.length>o.length)continue;let l=!0;for(let u=0;u<n.length;u++)if(n[u].getFinderPattern().getValue()!=o[u]){l=!1;break}if(l)return!0}return!1}storeRow(n,o){let l=0,u=!1,d=!1;for(;l<this.rows.length;){let m=this.rows[l];if(m.getRowNumber()>n){d=m.isEquivalent(this.pairs);break}u=m.isEquivalent(this.pairs),l++}d||u||Ee.isPartialRow(this.pairs,this.rows)||(this.rows.push(l,new on(this.pairs,n,o)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(n,o){for(let l of o)if(l.getPairs().length!==n.length){for(let u of l.getPairs())for(let d of n)if(Jn.equals(u,d))break}}static isPartialRow(n,o){for(let l of o){let u=!0;for(let d of n){let m=!1;for(let p of l.getPairs())if(d.equals(p)){m=!0;break}if(!m){u=!1;break}}if(u)return!0}return!1}getRows(){return this.rows}static constructResult(n){let o=$l.buildBitArray(n),u=sa(o).parseInformation(),d=n[0].getFinderPattern().getResultPoints(),m=n[n.length-1].getFinderPattern().getResultPoints(),p=[d[0],d[1],m[0],m[1]];return new Ie(u,null,null,p,Ce.RSS_EXPANDED,null)}checkChecksum(){let n=this.pairs.get(0),o=n.getLeftChar(),l=n.getRightChar();if(l==null)return!1;let u=l.getChecksumPortion(),d=2;for(let p=1;p<this.pairs.size();++p){let w=this.pairs.get(p);u+=w.getLeftChar().getChecksumPortion(),d++;let C=w.getRightChar();C!=null&&(u+=C.getChecksumPortion(),d++)}return u%=211,211*(d-4)+u==o.getValue()}static getNextSecondBar(n,o){let l;return n.get(o)?(l=n.getNextUnset(o),l=n.getNextSet(l)):(l=n.getNextSet(o),l=n.getNextUnset(l)),l}retrieveNextPair(n,o,l){let u=o.length%2==0;this.startFromEven&&(u=!u);let d,m=!0,p=-1;do this.findNextPair(n,o,p),d=this.parseFoundFinderPattern(n,l,u),d==null?p=Ee.getNextSecondBar(n,this.startEnd[0]):m=!1;while(m);let w=this.decodeDataCharacter(n,d,u,!0);if(!this.isEmptyPair(o)&&o[o.length-1].mustBeLast())throw new ie;let C;try{C=this.decodeDataCharacter(n,d,u,!1)}catch(N){C=null,this.verbose&&console.log(N)}return new Jn(w,C,d,!0)}isEmptyPair(n){return n.length===0}findNextPair(n,o,l){let u=this.getDecodeFinderCounters();u[0]=0,u[1]=0,u[2]=0,u[3]=0;let d=n.getSize(),m;l>=0?m=l:this.isEmptyPair(o)?m=0:m=o[o.length-1].getFinderPattern().getStartEnd()[1];let p=o.length%2!=0;this.startFromEven&&(p=!p);let w=!1;for(;m<d&&(w=!n.get(m),!!w);)m++;let C=0,N=m;for(let D=m;D<d;D++)if(n.get(D)!=w)u[C]++;else{if(C==3){if(p&&Ee.reverseCounters(u),Ee.isFinderPattern(u)){this.startEnd[0]=N,this.startEnd[1]=D;return}p&&Ee.reverseCounters(u),N+=u[0]+u[1],u[0]=u[2],u[1]=u[3],u[2]=0,u[3]=0,C--}else C++;u[C]=1,w=!w}throw new ie}static reverseCounters(n){let o=n.length;for(let l=0;l<o/2;++l){let u=n[l];n[l]=n[o-l-1],n[o-l-1]=u}}parseFoundFinderPattern(n,o,l){let u,d,m;if(l){let C=this.startEnd[0]-1;for(;C>=0&&!n.get(C);)C--;C++,u=this.startEnd[0]-C,d=C,m=this.startEnd[1]}else d=this.startEnd[0],m=n.getNextUnset(this.startEnd[1]+1),u=m-this.startEnd[1];let p=this.getDecodeFinderCounters();B.arraycopy(p,0,p,1,p.length-1),p[0]=u;let w;try{w=this.parseFinderValue(p,Ee.FINDER_PATTERNS)}catch{return null}return new gi(w,[d,m],d,m,o)}decodeDataCharacter(n,o,l,u){let d=this.getDataCharacterCounters();for(let Rt=0;Rt<d.length;Rt++)d[Rt]=0;if(u)Ee.recordPatternInReverse(n,o.getStartEnd()[0],d);else{Ee.recordPattern(n,o.getStartEnd()[1],d);for(let Rt=0,Mn=d.length-1;Rt<Mn;Rt++,Mn--){let tr=d[Rt];d[Rt]=d[Mn],d[Mn]=tr}}let m=17,p=ot.sum(new Int32Array(d))/m,w=(o.getStartEnd()[1]-o.getStartEnd()[0])/15;if(Math.abs(p-w)/w>.3)throw new ie;let C=this.getOddCounts(),N=this.getEvenCounts(),D=this.getOddRoundingErrors(),z=this.getEvenRoundingErrors();for(let Rt=0;Rt<d.length;Rt++){let Mn=1*d[Rt]/p,tr=Mn+.5;if(tr<1){if(Mn<.3)throw new ie;tr=1}else if(tr>8){if(Mn>8.7)throw new ie;tr=8}let va=Rt/2;(Rt&1)==0?(C[va]=tr,D[va]=Mn-tr):(N[va]=tr,z[va]=Mn-tr)}this.adjustOddEvenCounts(m);let G=4*o.getValue()+(l?0:2)+(u?0:1)-1,W=0,J=0;for(let Rt=C.length-1;Rt>=0;Rt--){if(Ee.isNotA1left(o,l,u)){let Mn=Ee.WEIGHTS[G][2*Rt];J+=C[Rt]*Mn}W+=C[Rt]}let ae=0;for(let Rt=N.length-1;Rt>=0;Rt--)if(Ee.isNotA1left(o,l,u)){let Mn=Ee.WEIGHTS[G][2*Rt+1];ae+=N[Rt]*Mn}let he=J+ae;if((W&1)!=0||W>13||W<4)throw new ie;let Ne=(13-W)/2,Se=Ee.SYMBOL_WIDEST[Ne],Ae=9-Se,it=Pr.getRSSvalue(C,Se,!0),Ke=Pr.getRSSvalue(N,Ae,!1),sn=Ee.EVEN_TOTAL_SUBSET[Ne],fr=Ee.GSUM[Ne],Un=it*sn+Ke+fr;return new hi(Un,he)}static isNotA1left(n,o,l){return!(n.getValue()==0&&o&&l)}adjustOddEvenCounts(n){let o=ot.sum(new Int32Array(this.getOddCounts())),l=ot.sum(new Int32Array(this.getEvenCounts())),u=!1,d=!1;o>13?d=!0:o<4&&(u=!0);let m=!1,p=!1;l>13?p=!0:l<4&&(m=!0);let w=o+l-n,C=(o&1)==1,N=(l&1)==0;if(w==1)if(C){if(N)throw new ie;d=!0}else{if(!N)throw new ie;p=!0}else if(w==-1)if(C){if(N)throw new ie;u=!0}else{if(!N)throw new ie;m=!0}else if(w==0){if(C){if(!N)throw new ie;o<l?(u=!0,p=!0):(d=!0,m=!0)}else if(N)throw new ie}else throw new ie;if(u){if(d)throw new ie;Ee.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(d&&Ee.decrement(this.getOddCounts(),this.getOddRoundingErrors()),m){if(p)throw new ie;Ee.increment(this.getEvenCounts(),this.getOddRoundingErrors())}p&&Ee.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}Ee.SYMBOL_WIDEST=[7,5,4,3,1],Ee.EVEN_TOTAL_SUBSET=[4,20,52,104,204],Ee.GSUM=[0,348,1388,2948,3988],Ee.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])],Ee.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]],Ee.FINDER_PAT_A=0,Ee.FINDER_PAT_B=1,Ee.FINDER_PAT_C=2,Ee.FINDER_PAT_D=3,Ee.FINDER_PAT_E=4,Ee.FINDER_PAT_F=5,Ee.FINDER_PATTERN_SEQUENCES=[[Ee.FINDER_PAT_A,Ee.FINDER_PAT_A],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_B,Ee.FINDER_PAT_B],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_C,Ee.FINDER_PAT_B,Ee.FINDER_PAT_D],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_E,Ee.FINDER_PAT_B,Ee.FINDER_PAT_D,Ee.FINDER_PAT_C],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_E,Ee.FINDER_PAT_B,Ee.FINDER_PAT_D,Ee.FINDER_PAT_D,Ee.FINDER_PAT_F],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_E,Ee.FINDER_PAT_B,Ee.FINDER_PAT_D,Ee.FINDER_PAT_E,Ee.FINDER_PAT_F,Ee.FINDER_PAT_F],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_A,Ee.FINDER_PAT_B,Ee.FINDER_PAT_B,Ee.FINDER_PAT_C,Ee.FINDER_PAT_C,Ee.FINDER_PAT_D,Ee.FINDER_PAT_D],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_A,Ee.FINDER_PAT_B,Ee.FINDER_PAT_B,Ee.FINDER_PAT_C,Ee.FINDER_PAT_C,Ee.FINDER_PAT_D,Ee.FINDER_PAT_E,Ee.FINDER_PAT_E],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_A,Ee.FINDER_PAT_B,Ee.FINDER_PAT_B,Ee.FINDER_PAT_C,Ee.FINDER_PAT_C,Ee.FINDER_PAT_D,Ee.FINDER_PAT_E,Ee.FINDER_PAT_F,Ee.FINDER_PAT_F],[Ee.FINDER_PAT_A,Ee.FINDER_PAT_A,Ee.FINDER_PAT_B,Ee.FINDER_PAT_B,Ee.FINDER_PAT_C,Ee.FINDER_PAT_D,Ee.FINDER_PAT_D,Ee.FINDER_PAT_E,Ee.FINDER_PAT_E,Ee.FINDER_PAT_F,Ee.FINDER_PAT_F]],Ee.MAX_PAIRS=11;class tc extends hi{constructor(n,o,l){super(n,o),this.count=0,this.finderPattern=l}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class St extends Nn{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(n,o,l){const u=this.decodePair(o,!1,n,l);St.addOrTally(this.possibleLeftPairs,u),o.reverse();let d=this.decodePair(o,!0,n,l);St.addOrTally(this.possibleRightPairs,d),o.reverse();for(let m of this.possibleLeftPairs)if(m.getCount()>1){for(let p of this.possibleRightPairs)if(p.getCount()>1&&St.checkChecksum(m,p))return St.constructResult(m,p)}throw new ie}static addOrTally(n,o){if(o==null)return;let l=!1;for(let u of n)if(u.getValue()===o.getValue()){u.incrementCount(),l=!0;break}l||n.push(o)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(n,o){let l=4537077*n.getValue()+o.getValue(),u=new String(l).toString(),d=new pe;for(let C=13-u.length;C>0;C--)d.append("0");d.append(u);let m=0;for(let C=0;C<13;C++){let N=d.charAt(C).charCodeAt(0)-48;m+=(C&1)===0?3*N:N}m=10-m%10,m===10&&(m=0),d.append(m.toString());let p=n.getFinderPattern().getResultPoints(),w=o.getFinderPattern().getResultPoints();return new Ie(d.toString(),null,0,[p[0],p[1],w[0],w[1]],Ce.RSS_14,new Date().getTime())}static checkChecksum(n,o){let l=(n.getChecksumPortion()+16*o.getChecksumPortion())%79,u=9*n.getFinderPattern().getValue()+o.getFinderPattern().getValue();return u>72&&u--,u>8&&u--,l===u}decodePair(n,o,l,u){try{let d=this.findFinderPattern(n,o),m=this.parseFoundFinderPattern(n,l,o,d),p=u==null?null:u.get(Q.NEED_RESULT_POINT_CALLBACK);if(p!=null){let N=(d[0]+d[1])/2;o&&(N=n.getSize()-1-N),p.foundPossibleResultPoint(new ke(N,l))}let w=this.decodeDataCharacter(n,m,!0),C=this.decodeDataCharacter(n,m,!1);return new tc(1597*w.getValue()+C.getValue(),w.getChecksumPortion()+4*C.getChecksumPortion(),m)}catch{return null}}decodeDataCharacter(n,o,l){let u=this.getDataCharacterCounters();for(let ae=0;ae<u.length;ae++)u[ae]=0;if(l)jt.recordPatternInReverse(n,o.getStartEnd()[0],u);else{jt.recordPattern(n,o.getStartEnd()[1]+1,u);for(let ae=0,he=u.length-1;ae<he;ae++,he--){let Ne=u[ae];u[ae]=u[he],u[he]=Ne}}let d=l?16:15,m=ot.sum(new Int32Array(u))/d,p=this.getOddCounts(),w=this.getEvenCounts(),C=this.getOddRoundingErrors(),N=this.getEvenRoundingErrors();for(let ae=0;ae<u.length;ae++){let he=u[ae]/m,Ne=Math.floor(he+.5);Ne<1?Ne=1:Ne>8&&(Ne=8);let Se=Math.floor(ae/2);(ae&1)===0?(p[Se]=Ne,C[Se]=he-Ne):(w[Se]=Ne,N[Se]=he-Ne)}this.adjustOddEvenCounts(l,d);let D=0,z=0;for(let ae=p.length-1;ae>=0;ae--)z*=9,z+=p[ae],D+=p[ae];let G=0,W=0;for(let ae=w.length-1;ae>=0;ae--)G*=9,G+=w[ae],W+=w[ae];let J=z+3*G;if(l){if((D&1)!==0||D>12||D<4)throw new ie;let ae=(12-D)/2,he=St.OUTSIDE_ODD_WIDEST[ae],Ne=9-he,Se=Pr.getRSSvalue(p,he,!1),Ae=Pr.getRSSvalue(w,Ne,!0),it=St.OUTSIDE_EVEN_TOTAL_SUBSET[ae],Ke=St.OUTSIDE_GSUM[ae];return new hi(Se*it+Ae+Ke,J)}else{if((W&1)!==0||W>10||W<4)throw new ie;let ae=(10-W)/2,he=St.INSIDE_ODD_WIDEST[ae],Ne=9-he,Se=Pr.getRSSvalue(p,he,!0),Ae=Pr.getRSSvalue(w,Ne,!1),it=St.INSIDE_ODD_TOTAL_SUBSET[ae],Ke=St.INSIDE_GSUM[ae];return new hi(Ae*it+Se+Ke,J)}}findFinderPattern(n,o){let l=this.getDecodeFinderCounters();l[0]=0,l[1]=0,l[2]=0,l[3]=0;let u=n.getSize(),d=!1,m=0;for(;m<u&&(d=!n.get(m),o!==d);)m++;let p=0,w=m;for(let C=m;C<u;C++)if(n.get(C)!==d)l[p]++;else{if(p===3){if(Nn.isFinderPattern(l))return[w,C];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,d=!d}throw new ie}parseFoundFinderPattern(n,o,l,u){let d=n.get(u[0]),m=u[0]-1;for(;m>=0&&d!==n.get(m);)m--;m++;const p=u[0]-m,w=this.getDecodeFinderCounters(),C=new Int32Array(w.length);B.arraycopy(w,0,C,1,w.length-1),C[0]=p;const N=this.parseFinderValue(C,St.FINDER_PATTERNS);let D=m,z=u[1];return l&&(D=n.getSize()-1-D,z=n.getSize()-1-z),new gi(N,[m,u[1]],D,z,o)}adjustOddEvenCounts(n,o){let l=ot.sum(new Int32Array(this.getOddCounts())),u=ot.sum(new Int32Array(this.getEvenCounts())),d=!1,m=!1,p=!1,w=!1;n?(l>12?m=!0:l<4&&(d=!0),u>12?w=!0:u<4&&(p=!0)):(l>11?m=!0:l<5&&(d=!0),u>10?w=!0:u<4&&(p=!0));let C=l+u-o,N=(l&1)===(n?1:0),D=(u&1)===1;if(C===1)if(N){if(D)throw new ie;m=!0}else{if(!D)throw new ie;w=!0}else if(C===-1)if(N){if(D)throw new ie;d=!0}else{if(!D)throw new ie;p=!0}else if(C===0){if(N){if(!D)throw new ie;l<u?(d=!0,w=!0):(m=!0,p=!0)}else if(D)throw new ie}else throw new ie;if(d){if(m)throw new ie;Nn.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(m&&Nn.decrement(this.getOddCounts(),this.getOddRoundingErrors()),p){if(w)throw new ie;Nn.increment(this.getEvenCounts(),this.getOddRoundingErrors())}w&&Nn.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}St.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],St.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],St.OUTSIDE_GSUM=[0,161,961,2015,2715],St.INSIDE_GSUM=[0,336,1036,1516],St.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],St.INSIDE_ODD_WIDEST=[2,4,6,8],St.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 br extends jt{constructor(n,o){super(),this.readers=[],this.verbose=o===!0;const l=n?n.get(Q.POSSIBLE_FORMATS):null,u=n&&n.get(Q.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;l?((l.includes(Ce.EAN_13)||l.includes(Ce.UPC_A)||l.includes(Ce.EAN_8)||l.includes(Ce.UPC_E))&&this.readers.push(new Fs(n)),l.includes(Ce.CODE_39)&&this.readers.push(new Dt(u)),l.includes(Ce.CODE_128)&&this.readers.push(new Oe),l.includes(Ce.ITF)&&this.readers.push(new et),l.includes(Ce.RSS_14)&&this.readers.push(new St),l.includes(Ce.RSS_EXPANDED)&&this.readers.push(new Ee(this.verbose))):(this.readers.push(new Fs(n)),this.readers.push(new Dt),this.readers.push(new Fs(n)),this.readers.push(new Oe),this.readers.push(new et),this.readers.push(new St),this.readers.push(new Ee(this.verbose)))}decodeRow(n,o,l){for(let u=0;u<this.readers.length;u++)try{return this.readers[u].decodeRow(n,o,l)}catch{}throw new ie}reset(){this.readers.forEach(n=>n.reset())}}class gf extends Re{constructor(n=500,o){super(new br(o),n,o)}}class vt{constructor(n,o,l){this.ecCodewords=n,this.ecBlocks=[o],l&&this.ecBlocks.push(l)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class yt{constructor(n,o){this.count=n,this.dataCodewords=o}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class st{constructor(n,o,l,u,d,m){this.versionNumber=n,this.symbolSizeRows=o,this.symbolSizeColumns=l,this.dataRegionSizeRows=u,this.dataRegionSizeColumns=d,this.ecBlocks=m;let p=0;const w=m.getECCodewords(),C=m.getECBlocks();for(let N of C)p+=N.getCount()*(N.getDataCodewords()+w);this.totalCodewords=p}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(n,o){if((n&1)!==0||(o&1)!==0)throw new X;for(let l of st.VERSIONS)if(l.symbolSizeRows===n&&l.symbolSizeColumns===o)return l;throw new X}toString(){return""+this.versionNumber}static buildVersions(){return[new st(1,10,10,8,8,new vt(5,new yt(1,3))),new st(2,12,12,10,10,new vt(7,new yt(1,5))),new st(3,14,14,12,12,new vt(10,new yt(1,8))),new st(4,16,16,14,14,new vt(12,new yt(1,12))),new st(5,18,18,16,16,new vt(14,new yt(1,18))),new st(6,20,20,18,18,new vt(18,new yt(1,22))),new st(7,22,22,20,20,new vt(20,new yt(1,30))),new st(8,24,24,22,22,new vt(24,new yt(1,36))),new st(9,26,26,24,24,new vt(28,new yt(1,44))),new st(10,32,32,14,14,new vt(36,new yt(1,62))),new st(11,36,36,16,16,new vt(42,new yt(1,86))),new st(12,40,40,18,18,new vt(48,new yt(1,114))),new st(13,44,44,20,20,new vt(56,new yt(1,144))),new st(14,48,48,22,22,new vt(68,new yt(1,174))),new st(15,52,52,24,24,new vt(42,new yt(2,102))),new st(16,64,64,14,14,new vt(56,new yt(2,140))),new st(17,72,72,16,16,new vt(36,new yt(4,92))),new st(18,80,80,18,18,new vt(48,new yt(4,114))),new st(19,88,88,20,20,new vt(56,new yt(4,144))),new st(20,96,96,22,22,new vt(68,new yt(4,174))),new st(21,104,104,24,24,new vt(56,new yt(6,136))),new st(22,120,120,18,18,new vt(68,new yt(6,175))),new st(23,132,132,20,20,new vt(62,new yt(8,163))),new st(24,144,144,22,22,new vt(62,new yt(8,156),new yt(2,155))),new st(25,8,18,6,16,new vt(7,new yt(1,5))),new st(26,8,32,6,14,new vt(11,new yt(1,10))),new st(27,12,26,10,24,new vt(14,new yt(1,16))),new st(28,12,36,10,16,new vt(18,new yt(1,22))),new st(29,16,36,14,16,new vt(24,new yt(1,32))),new st(30,16,48,14,22,new vt(28,new yt(1,49)))]}}st.VERSIONS=st.buildVersions();class la{constructor(n){const o=n.getHeight();if(o<8||o>144||(o&1)!==0)throw new X;this.version=la.readVersion(n),this.mappingBitMatrix=this.extractDataRegion(n),this.readMappingMatrix=new Te(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(n){const o=n.getHeight(),l=n.getWidth();return st.getVersionForDimensions(o,l)}readCodewords(){const n=new Int8Array(this.version.getTotalCodewords());let o=0,l=4,u=0;const d=this.mappingBitMatrix.getHeight(),m=this.mappingBitMatrix.getWidth();let p=!1,w=!1,C=!1,N=!1;do if(l===d&&u===0&&!p)n[o++]=this.readCorner1(d,m)&255,l-=2,u+=2,p=!0;else if(l===d-2&&u===0&&(m&3)!==0&&!w)n[o++]=this.readCorner2(d,m)&255,l-=2,u+=2,w=!0;else if(l===d+4&&u===2&&(m&7)===0&&!C)n[o++]=this.readCorner3(d,m)&255,l-=2,u+=2,C=!0;else if(l===d-2&&u===0&&(m&7)===4&&!N)n[o++]=this.readCorner4(d,m)&255,l-=2,u+=2,N=!0;else{do l<d&&u>=0&&!this.readMappingMatrix.get(u,l)&&(n[o++]=this.readUtah(l,u,d,m)&255),l-=2,u+=2;while(l>=0&&u<m);l+=1,u+=3;do l>=0&&u<m&&!this.readMappingMatrix.get(u,l)&&(n[o++]=this.readUtah(l,u,d,m)&255),l+=2,u-=2;while(l<d&&u>=0);l+=3,u+=1}while(l<d||u<m);if(o!==this.version.getTotalCodewords())throw new X;return n}readModule(n,o,l,u){return n<0&&(n+=l,o+=4-(l+4&7)),o<0&&(o+=u,n+=4-(u+4&7)),this.readMappingMatrix.set(o,n),this.mappingBitMatrix.get(o,n)}readUtah(n,o,l,u){let d=0;return this.readModule(n-2,o-2,l,u)&&(d|=1),d<<=1,this.readModule(n-2,o-1,l,u)&&(d|=1),d<<=1,this.readModule(n-1,o-2,l,u)&&(d|=1),d<<=1,this.readModule(n-1,o-1,l,u)&&(d|=1),d<<=1,this.readModule(n-1,o,l,u)&&(d|=1),d<<=1,this.readModule(n,o-2,l,u)&&(d|=1),d<<=1,this.readModule(n,o-1,l,u)&&(d|=1),d<<=1,this.readModule(n,o,l,u)&&(d|=1),d}readCorner1(n,o){let l=0;return this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,1,n,o)&&(l|=1),l<<=1,this.readModule(n-1,2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l<<=1,this.readModule(2,o-1,n,o)&&(l|=1),l<<=1,this.readModule(3,o-1,n,o)&&(l|=1),l}readCorner2(n,o){let l=0;return this.readModule(n-3,0,n,o)&&(l|=1),l<<=1,this.readModule(n-2,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(0,o-4,n,o)&&(l|=1),l<<=1,this.readModule(0,o-3,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l}readCorner3(n,o){let l=0;return this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,o-1,n,o)&&(l|=1),l<<=1,this.readModule(0,o-3,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-3,n,o)&&(l|=1),l<<=1,this.readModule(1,o-2,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l}readCorner4(n,o){let l=0;return this.readModule(n-3,0,n,o)&&(l|=1),l<<=1,this.readModule(n-2,0,n,o)&&(l|=1),l<<=1,this.readModule(n-1,0,n,o)&&(l|=1),l<<=1,this.readModule(0,o-2,n,o)&&(l|=1),l<<=1,this.readModule(0,o-1,n,o)&&(l|=1),l<<=1,this.readModule(1,o-1,n,o)&&(l|=1),l<<=1,this.readModule(2,o-1,n,o)&&(l|=1),l<<=1,this.readModule(3,o-1,n,o)&&(l|=1),l}extractDataRegion(n){const o=this.version.getSymbolSizeRows(),l=this.version.getSymbolSizeColumns();if(n.getHeight()!==o)throw new x("Dimension of bitMatrix must match the version size");const u=this.version.getDataRegionSizeRows(),d=this.version.getDataRegionSizeColumns(),m=o/u|0,p=l/d|0,w=m*u,C=p*d,N=new Te(C,w);for(let D=0;D<m;++D){const z=D*u;for(let G=0;G<p;++G){const W=G*d;for(let J=0;J<u;++J){const ae=D*(u+2)+1+J,he=z+J;for(let Ne=0;Ne<d;++Ne){const Se=G*(d+2)+1+Ne;if(n.get(Se,ae)){const Ae=W+Ne;N.set(Ae,he)}}}}}return N}}class ca{constructor(n,o){this.numDataCodewords=n,this.codewords=o}static getDataBlocks(n,o){const l=o.getECBlocks();let u=0;const d=l.getECBlocks();for(let J of d)u+=J.getCount();const m=new Array(u);let p=0;for(let J of d)for(let ae=0;ae<J.getCount();ae++){const he=J.getDataCodewords(),Ne=l.getECCodewords()+he;m[p++]=new ca(he,new Uint8Array(Ne))}const C=m[0].codewords.length-l.getECCodewords(),N=C-1;let D=0;for(let J=0;J<N;J++)for(let ae=0;ae<p;ae++)m[ae].codewords[J]=n[D++];const z=o.getVersionNumber()===24,G=z?8:p;for(let J=0;J<G;J++)m[J].codewords[C-1]=n[D++];const W=m[0].codewords.length;for(let J=C;J<W;J++)for(let ae=0;ae<p;ae++){const he=z?(ae+8)%p:ae,Ne=z&&he>7?J-1:J;m[he].codewords[Ne]=n[D++]}if(D!==n.length)throw new x;return m}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class _r{constructor(n){this.bytes=n,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(n){if(n<1||n>32||n>this.available())throw new x(""+n);let o=0,l=this.bitOffset,u=this.byteOffset;const d=this.bytes;if(l>0){const m=8-l,p=n<m?n:m,w=m-p,C=255>>8-p<<w;o=(d[u]&C)>>w,n-=p,l+=p,l===8&&(l=0,u++)}if(n>0){for(;n>=8;)o=o<<8|d[u]&255,u++,n-=8;if(n>0){const m=8-n,p=255>>m<<m;o=o<<n|(d[u]&p)>>m,l+=n}}return this.bitOffset=l,this.byteOffset=u,o}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var wt;(function(M){M[M.PAD_ENCODE=0]="PAD_ENCODE",M[M.ASCII_ENCODE=1]="ASCII_ENCODE",M[M.C40_ENCODE=2]="C40_ENCODE",M[M.TEXT_ENCODE=3]="TEXT_ENCODE",M[M.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",M[M.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",M[M.BASE256_ENCODE=6]="BASE256_ENCODE"})(wt||(wt={}));class $r{static decode(n){const o=new _r(n),l=new pe,u=new pe,d=new Array;let m=wt.ASCII_ENCODE;do if(m===wt.ASCII_ENCODE)m=this.decodeAsciiSegment(o,l,u);else{switch(m){case wt.C40_ENCODE:this.decodeC40Segment(o,l);break;case wt.TEXT_ENCODE:this.decodeTextSegment(o,l);break;case wt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(o,l);break;case wt.EDIFACT_ENCODE:this.decodeEdifactSegment(o,l);break;case wt.BASE256_ENCODE:this.decodeBase256Segment(o,l,d);break;default:throw new X}m=wt.ASCII_ENCODE}while(m!==wt.PAD_ENCODE&&o.available()>0);return u.length()>0&&l.append(u.toString()),new pt(n,l.toString(),d.length===0?null:d,null)}static decodeAsciiSegment(n,o,l){let u=!1;do{let d=n.readBits(8);if(d===0)throw new X;if(d<=128)return u&&(d+=128),o.append(String.fromCharCode(d-1)),wt.ASCII_ENCODE;if(d===129)return wt.PAD_ENCODE;if(d<=229){const m=d-130;m<10&&o.append("0"),o.append(""+m)}else switch(d){case 230:return wt.C40_ENCODE;case 231:return wt.BASE256_ENCODE;case 232:o.append("");break;case 233:case 234:break;case 235:u=!0;break;case 236:o.append("[)>05"),l.insert(0,"");break;case 237:o.append("[)>06"),l.insert(0,"");break;case 238:return wt.ANSIX12_ENCODE;case 239:return wt.TEXT_ENCODE;case 240:return wt.EDIFACT_ENCODE;case 241:break;default:if(d!==254||n.available()!==0)throw new X;break}}while(n.available()>0);return wt.ASCII_ENCODE}static decodeC40Segment(n,o){let l=!1;const u=[];let d=0;do{if(n.available()===8)return;const m=n.readBits(8);if(m===254)return;this.parseTwoBytes(m,n.readBits(8),u);for(let p=0;p<3;p++){const w=u[p];switch(d){case 0:if(w<3)d=w+1;else if(w<this.C40_BASIC_SET_CHARS.length){const C=this.C40_BASIC_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else throw new X;break;case 1:l?(o.append(String.fromCharCode(w+128)),l=!1):o.append(String.fromCharCode(w)),d=0;break;case 2:if(w<this.C40_SHIFT2_SET_CHARS.length){const C=this.C40_SHIFT2_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else switch(w){case 27:o.append("");break;case 30:l=!0;break;default:throw new X}d=0;break;case 3:l?(o.append(String.fromCharCode(w+224)),l=!1):o.append(String.fromCharCode(w+96)),d=0;break;default:throw new X}}}while(n.available()>0)}static decodeTextSegment(n,o){let l=!1,u=[],d=0;do{if(n.available()===8)return;const m=n.readBits(8);if(m===254)return;this.parseTwoBytes(m,n.readBits(8),u);for(let p=0;p<3;p++){const w=u[p];switch(d){case 0:if(w<3)d=w+1;else if(w<this.TEXT_BASIC_SET_CHARS.length){const C=this.TEXT_BASIC_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else throw new X;break;case 1:l?(o.append(String.fromCharCode(w+128)),l=!1):o.append(String.fromCharCode(w)),d=0;break;case 2:if(w<this.TEXT_SHIFT2_SET_CHARS.length){const C=this.TEXT_SHIFT2_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C)}else switch(w){case 27:o.append("");break;case 30:l=!0;break;default:throw new X}d=0;break;case 3:if(w<this.TEXT_SHIFT3_SET_CHARS.length){const C=this.TEXT_SHIFT3_SET_CHARS[w];l?(o.append(String.fromCharCode(C.charCodeAt(0)+128)),l=!1):o.append(C),d=0}else throw new X;break;default:throw new X}}}while(n.available()>0)}static decodeAnsiX12Segment(n,o){const l=[];do{if(n.available()===8)return;const u=n.readBits(8);if(u===254)return;this.parseTwoBytes(u,n.readBits(8),l);for(let d=0;d<3;d++){const m=l[d];switch(m){case 0:o.append("\r");break;case 1:o.append("*");break;case 2:o.append(">");break;case 3:o.append(" ");break;default:if(m<14)o.append(String.fromCharCode(m+44));else if(m<40)o.append(String.fromCharCode(m+51));else throw new X;break}}}while(n.available()>0)}static parseTwoBytes(n,o,l){let u=(n<<8)+o-1,d=Math.floor(u/1600);l[0]=d,u-=d*1600,d=Math.floor(u/40),l[1]=d,l[2]=u-d*40}static decodeEdifactSegment(n,o){do{if(n.available()<=16)return;for(let l=0;l<4;l++){let u=n.readBits(6);if(u===31){const d=8-n.getBitOffset();d!==8&&n.readBits(d);return}(u&32)===0&&(u|=64),o.append(String.fromCharCode(u))}}while(n.available()>0)}static decodeBase256Segment(n,o,l){let u=1+n.getByteOffset();const d=this.unrandomize255State(n.readBits(8),u++);let m;if(d===0?m=n.available()/8|0:d<250?m=d:m=250*(d-249)+this.unrandomize255State(n.readBits(8),u++),m<0)throw new X;const p=new Uint8Array(m);for(let w=0;w<m;w++){if(n.available()<8)throw new X;p[w]=this.unrandomize255State(n.readBits(8),u++)}l.push(p);try{o.append(le.decode(p,te.ISO88591))}catch(w){throw new or("Platform does not support required encoding: "+w.message)}}static unrandomize255State(n,o){const l=149*o%255+1,u=n-l;return u>=0?u:u+256}}$r.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"],$r.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],$r.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"],$r.TEXT_SHIFT2_SET_CHARS=$r.C40_SHIFT2_SET_CHARS,$r.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 mf{constructor(){this.rsDecoder=new Ni(xt.DATA_MATRIX_FIELD_256)}decode(n){const o=new la(n),l=o.getVersion(),u=o.readCodewords(),d=ca.getDataBlocks(u,l);let m=0;for(let C of d)m+=C.getNumDataCodewords();const p=new Uint8Array(m),w=d.length;for(let C=0;C<w;C++){const N=d[C],D=N.getCodewords(),z=N.getNumDataCodewords();this.correctErrors(D,z);for(let G=0;G<z;G++)p[G*w+C]=D[G]}return $r.decode(p)}correctErrors(n,o){const l=new Int32Array(n);try{this.rsDecoder.decode(l,n.length-o)}catch{throw new R}for(let u=0;u<o;u++)n[u]=l[u]}}class Ht{constructor(n){this.image=n,this.rectangleDetector=new en(this.image)}detect(){const n=this.rectangleDetector.detect();let o=this.detectSolid1(n);if(o=this.detectSolid2(o),o[3]=this.correctTopRight(o),!o[3])throw new ie;o=this.shiftToModuleCenter(o);const l=o[0],u=o[1],d=o[2],m=o[3];let p=this.transitionsBetween(l,m)+1,w=this.transitionsBetween(d,m)+1;(p&1)===1&&(p+=1),(w&1)===1&&(w+=1),4*p<7*w&&4*w<7*p&&(p=w=Math.max(p,w));let C=Ht.sampleGrid(this.image,l,u,d,m,p,w);return new Mo(C,[l,u,d,m])}static shiftPoint(n,o,l){let u=(o.getX()-n.getX())/(l+1),d=(o.getY()-n.getY())/(l+1);return new ke(n.getX()+u,n.getY()+d)}static moveAway(n,o,l){let u=n.getX(),d=n.getY();return u<o?u-=1:u+=1,d<l?d-=1:d+=1,new ke(u,d)}detectSolid1(n){let o=n[0],l=n[1],u=n[3],d=n[2],m=this.transitionsBetween(o,l),p=this.transitionsBetween(l,u),w=this.transitionsBetween(u,d),C=this.transitionsBetween(d,o),N=m,D=[d,o,l,u];return N>p&&(N=p,D[0]=o,D[1]=l,D[2]=u,D[3]=d),N>w&&(N=w,D[0]=l,D[1]=u,D[2]=d,D[3]=o),N>C&&(D[0]=u,D[1]=d,D[2]=o,D[3]=l),D}detectSolid2(n){let o=n[0],l=n[1],u=n[2],d=n[3],m=this.transitionsBetween(o,d),p=Ht.shiftPoint(l,u,(m+1)*4),w=Ht.shiftPoint(u,l,(m+1)*4),C=this.transitionsBetween(p,o),N=this.transitionsBetween(w,d);return C<N?(n[0]=o,n[1]=l,n[2]=u,n[3]=d):(n[0]=l,n[1]=u,n[2]=d,n[3]=o),n}correctTopRight(n){let o=n[0],l=n[1],u=n[2],d=n[3],m=this.transitionsBetween(o,d),p=this.transitionsBetween(l,d),w=Ht.shiftPoint(o,l,(p+1)*4),C=Ht.shiftPoint(u,l,(m+1)*4);m=this.transitionsBetween(w,d),p=this.transitionsBetween(C,d);let N=new ke(d.getX()+(u.getX()-l.getX())/(m+1),d.getY()+(u.getY()-l.getY())/(m+1)),D=new ke(d.getX()+(o.getX()-l.getX())/(p+1),d.getY()+(o.getY()-l.getY())/(p+1));if(!this.isValid(N))return this.isValid(D)?D:null;if(!this.isValid(D))return N;let z=this.transitionsBetween(w,N)+this.transitionsBetween(C,N),G=this.transitionsBetween(w,D)+this.transitionsBetween(C,D);return z>G?N:D}shiftToModuleCenter(n){let o=n[0],l=n[1],u=n[2],d=n[3],m=this.transitionsBetween(o,d)+1,p=this.transitionsBetween(u,d)+1,w=Ht.shiftPoint(o,l,p*4),C=Ht.shiftPoint(u,l,m*4);m=this.transitionsBetween(w,d)+1,p=this.transitionsBetween(C,d)+1,(m&1)===1&&(m+=1),(p&1)===1&&(p+=1);let N=(o.getX()+l.getX()+u.getX()+d.getX())/4,D=(o.getY()+l.getY()+u.getY()+d.getY())/4;o=Ht.moveAway(o,N,D),l=Ht.moveAway(l,N,D),u=Ht.moveAway(u,N,D),d=Ht.moveAway(d,N,D);let z,G;return w=Ht.shiftPoint(o,l,p*4),w=Ht.shiftPoint(w,d,m*4),z=Ht.shiftPoint(l,o,p*4),z=Ht.shiftPoint(z,u,m*4),C=Ht.shiftPoint(u,d,p*4),C=Ht.shiftPoint(C,l,m*4),G=Ht.shiftPoint(d,u,p*4),G=Ht.shiftPoint(G,o,m*4),[w,z,C,G]}isValid(n){return n.getX()>=0&&n.getX()<this.image.getWidth()&&n.getY()>0&&n.getY()<this.image.getHeight()}static sampleGrid(n,o,l,u,d,m,p){return vr.getInstance().sampleGrid(n,m,p,.5,.5,m-.5,.5,m-.5,p-.5,.5,p-.5,o.getX(),o.getY(),d.getX(),d.getY(),u.getX(),u.getY(),l.getX(),l.getY())}transitionsBetween(n,o){let l=Math.trunc(n.getX()),u=Math.trunc(n.getY()),d=Math.trunc(o.getX()),m=Math.trunc(o.getY()),p=Math.abs(m-u)>Math.abs(d-l);if(p){let J=l;l=u,u=J,J=d,d=m,m=J}let w=Math.abs(d-l),C=Math.abs(m-u),N=-w/2,D=u<m?1:-1,z=l<d?1:-1,G=0,W=this.image.get(p?u:l,p?l:u);for(let J=l,ae=u;J!==d;J+=z){let he=this.image.get(p?ae:J,p?J:ae);if(he!==W&&(G++,W=he),N+=C,N>0){if(ae===m)break;ae+=D,N-=w}}return G}}class ei{constructor(){this.decoder=new mf}decode(n,o=null){let l,u;if(o!=null&&o.has(Q.PURE_BARCODE)){const C=ei.extractPureBits(n.getBlackMatrix());l=this.decoder.decode(C),u=ei.NO_POINTS}else{const C=new Ht(n.getBlackMatrix()).detect();l=this.decoder.decode(C.getBits()),u=C.getPoints()}const d=l.getRawBytes(),m=new Ie(l.getText(),d,8*d.length,u,Ce.DATA_MATRIX,B.currentTimeMillis()),p=l.getByteSegments();p!=null&&m.putMetadata(Qe.BYTE_SEGMENTS,p);const w=l.getECLevel();return w!=null&&m.putMetadata(Qe.ERROR_CORRECTION_LEVEL,w),m}reset(){}static extractPureBits(n){const o=n.getTopLeftOnBit(),l=n.getBottomRightOnBit();if(o==null||l==null)throw new ie;const u=this.moduleSize(o,n);let d=o[1];const m=l[1];let p=o[0];const C=(l[0]-p+1)/u,N=(m-d+1)/u;if(C<=0||N<=0)throw new ie;const D=u/2;d+=D,p+=D;const z=new Te(C,N);for(let G=0;G<N;G++){const W=d+G*u;for(let J=0;J<C;J++)n.get(p+J*u,W)&&z.set(J,G)}return z}static moduleSize(n,o){const l=o.getWidth();let u=n[0];const d=n[1];for(;u<l&&o.get(u,d);)u++;if(u===l)throw new ie;const m=u-n[0];if(m===0)throw new ie;return m}}ei.NO_POINTS=[];class Lo extends Re{constructor(n=500){super(new ei,n)}}var ua;(function(M){M[M.L=0]="L",M[M.M=1]="M",M[M.Q=2]="Q",M[M.H=3]="H"})(ua||(ua={}));class at{constructor(n,o,l){this.value=n,this.stringValue=o,this.bits=l,at.FOR_BITS.set(l,this),at.FOR_VALUE.set(n,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(n){switch(n){case"L":return at.L;case"M":return at.M;case"Q":return at.Q;case"H":return at.H;default:throw new T(n+"not available")}}toString(){return this.stringValue}equals(n){if(!(n instanceof at))return!1;const o=n;return this.value===o.value}static forBits(n){if(n<0||n>=at.FOR_BITS.size)throw new x;return at.FOR_BITS.get(n)}}at.FOR_BITS=new Map,at.FOR_VALUE=new Map,at.L=new at(ua.L,"L",1),at.M=new at(ua.M,"M",0),at.Q=new at(ua.Q,"Q",3),at.H=new at(ua.H,"H",2);class yn{constructor(n){this.errorCorrectionLevel=at.forBits(n>>3&3),this.dataMask=n&7}static numBitsDiffering(n,o){return j.bitCount(n^o)}static decodeFormatInformation(n,o){const l=yn.doDecodeFormatInformation(n,o);return l!==null?l:yn.doDecodeFormatInformation(n^yn.FORMAT_INFO_MASK_QR,o^yn.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(n,o){let l=Number.MAX_SAFE_INTEGER,u=0;for(const d of yn.FORMAT_INFO_DECODE_LOOKUP){const m=d[0];if(m===n||m===o)return new yn(d[1]);let p=yn.numBitsDiffering(n,m);p<l&&(u=d[1],l=p),n!==o&&(p=yn.numBitsDiffering(o,m),p<l&&(u=d[1],l=p))}return l<=3?new yn(u):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(n){if(!(n instanceof yn))return!1;const o=n;return this.errorCorrectionLevel===o.errorCorrectionLevel&&this.dataMask===o.dataMask}}yn.FORMAT_INFO_MASK_QR=21522,yn.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 se{constructor(n,...o){this.ecCodewordsPerBlock=n,this.ecBlocks=o}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let n=0;const o=this.ecBlocks;for(const l of o)n+=l.getCount();return n}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class V{constructor(n,o){this.count=n,this.dataCodewords=o}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class Pe{constructor(n,o,...l){this.versionNumber=n,this.alignmentPatternCenters=o,this.ecBlocks=l;let u=0;const d=l[0].getECCodewordsPerBlock(),m=l[0].getECBlocks();for(const p of m)u+=p.getCount()*(p.getDataCodewords()+d);this.totalCodewords=u}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(n){return this.ecBlocks[n.getValue()]}static getProvisionalVersionForDimension(n){if(n%4!==1)throw new X;try{return this.getVersionForNumber((n-17)/4)}catch{throw new X}}static getVersionForNumber(n){if(n<1||n>40)throw new x;return Pe.VERSIONS[n-1]}static decodeVersionInformation(n){let o=Number.MAX_SAFE_INTEGER,l=0;for(let u=0;u<Pe.VERSION_DECODE_INFO.length;u++){const d=Pe.VERSION_DECODE_INFO[u];if(d===n)return Pe.getVersionForNumber(u+7);const m=yn.numBitsDiffering(n,d);m<o&&(l=u+7,o=m)}return o<=3?Pe.getVersionForNumber(l):null}buildFunctionPattern(){const n=this.getDimensionForVersion(),o=new Te(n);o.setRegion(0,0,9,9),o.setRegion(n-8,0,8,9),o.setRegion(0,n-8,9,8);const l=this.alignmentPatternCenters.length;for(let u=0;u<l;u++){const d=this.alignmentPatternCenters[u]-2;for(let m=0;m<l;m++)u===0&&(m===0||m===l-1)||u===l-1&&m===0||o.setRegion(this.alignmentPatternCenters[m]-2,d,5,5)}return o.setRegion(6,9,1,n-17),o.setRegion(9,6,n-17,1),this.versionNumber>6&&(o.setRegion(n-11,0,3,6),o.setRegion(0,n-11,6,3)),o}toString(){return""+this.versionNumber}}Pe.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]),Pe.VERSIONS=[new Pe(1,new Int32Array(0),new se(7,new V(1,19)),new se(10,new V(1,16)),new se(13,new V(1,13)),new se(17,new V(1,9))),new Pe(2,Int32Array.from([6,18]),new se(10,new V(1,34)),new se(16,new V(1,28)),new se(22,new V(1,22)),new se(28,new V(1,16))),new Pe(3,Int32Array.from([6,22]),new se(15,new V(1,55)),new se(26,new V(1,44)),new se(18,new V(2,17)),new se(22,new V(2,13))),new Pe(4,Int32Array.from([6,26]),new se(20,new V(1,80)),new se(18,new V(2,32)),new se(26,new V(2,24)),new se(16,new V(4,9))),new Pe(5,Int32Array.from([6,30]),new se(26,new V(1,108)),new se(24,new V(2,43)),new se(18,new V(2,15),new V(2,16)),new se(22,new V(2,11),new V(2,12))),new Pe(6,Int32Array.from([6,34]),new se(18,new V(2,68)),new se(16,new V(4,27)),new se(24,new V(4,19)),new se(28,new V(4,15))),new Pe(7,Int32Array.from([6,22,38]),new se(20,new V(2,78)),new se(18,new V(4,31)),new se(18,new V(2,14),new V(4,15)),new se(26,new V(4,13),new V(1,14))),new Pe(8,Int32Array.from([6,24,42]),new se(24,new V(2,97)),new se(22,new V(2,38),new V(2,39)),new se(22,new V(4,18),new V(2,19)),new se(26,new V(4,14),new V(2,15))),new Pe(9,Int32Array.from([6,26,46]),new se(30,new V(2,116)),new se(22,new V(3,36),new V(2,37)),new se(20,new V(4,16),new V(4,17)),new se(24,new V(4,12),new V(4,13))),new Pe(10,Int32Array.from([6,28,50]),new se(18,new V(2,68),new V(2,69)),new se(26,new V(4,43),new V(1,44)),new se(24,new V(6,19),new V(2,20)),new se(28,new V(6,15),new V(2,16))),new Pe(11,Int32Array.from([6,30,54]),new se(20,new V(4,81)),new se(30,new V(1,50),new V(4,51)),new se(28,new V(4,22),new V(4,23)),new se(24,new V(3,12),new V(8,13))),new Pe(12,Int32Array.from([6,32,58]),new se(24,new V(2,92),new V(2,93)),new se(22,new V(6,36),new V(2,37)),new se(26,new V(4,20),new V(6,21)),new se(28,new V(7,14),new V(4,15))),new Pe(13,Int32Array.from([6,34,62]),new se(26,new V(4,107)),new se(22,new V(8,37),new V(1,38)),new se(24,new V(8,20),new V(4,21)),new se(22,new V(12,11),new V(4,12))),new Pe(14,Int32Array.from([6,26,46,66]),new se(30,new V(3,115),new V(1,116)),new se(24,new V(4,40),new V(5,41)),new se(20,new V(11,16),new V(5,17)),new se(24,new V(11,12),new V(5,13))),new Pe(15,Int32Array.from([6,26,48,70]),new se(22,new V(5,87),new V(1,88)),new se(24,new V(5,41),new V(5,42)),new se(30,new V(5,24),new V(7,25)),new se(24,new V(11,12),new V(7,13))),new Pe(16,Int32Array.from([6,26,50,74]),new se(24,new V(5,98),new V(1,99)),new se(28,new V(7,45),new V(3,46)),new se(24,new V(15,19),new V(2,20)),new se(30,new V(3,15),new V(13,16))),new Pe(17,Int32Array.from([6,30,54,78]),new se(28,new V(1,107),new V(5,108)),new se(28,new V(10,46),new V(1,47)),new se(28,new V(1,22),new V(15,23)),new se(28,new V(2,14),new V(17,15))),new Pe(18,Int32Array.from([6,30,56,82]),new se(30,new V(5,120),new V(1,121)),new se(26,new V(9,43),new V(4,44)),new se(28,new V(17,22),new V(1,23)),new se(28,new V(2,14),new V(19,15))),new Pe(19,Int32Array.from([6,30,58,86]),new se(28,new V(3,113),new V(4,114)),new se(26,new V(3,44),new V(11,45)),new se(26,new V(17,21),new V(4,22)),new se(26,new V(9,13),new V(16,14))),new Pe(20,Int32Array.from([6,34,62,90]),new se(28,new V(3,107),new V(5,108)),new se(26,new V(3,41),new V(13,42)),new se(30,new V(15,24),new V(5,25)),new se(28,new V(15,15),new V(10,16))),new Pe(21,Int32Array.from([6,28,50,72,94]),new se(28,new V(4,116),new V(4,117)),new se(26,new V(17,42)),new se(28,new V(17,22),new V(6,23)),new se(30,new V(19,16),new V(6,17))),new Pe(22,Int32Array.from([6,26,50,74,98]),new se(28,new V(2,111),new V(7,112)),new se(28,new V(17,46)),new se(30,new V(7,24),new V(16,25)),new se(24,new V(34,13))),new Pe(23,Int32Array.from([6,30,54,78,102]),new se(30,new V(4,121),new V(5,122)),new se(28,new V(4,47),new V(14,48)),new se(30,new V(11,24),new V(14,25)),new se(30,new V(16,15),new V(14,16))),new Pe(24,Int32Array.from([6,28,54,80,106]),new se(30,new V(6,117),new V(4,118)),new se(28,new V(6,45),new V(14,46)),new se(30,new V(11,24),new V(16,25)),new se(30,new V(30,16),new V(2,17))),new Pe(25,Int32Array.from([6,32,58,84,110]),new se(26,new V(8,106),new V(4,107)),new se(28,new V(8,47),new V(13,48)),new se(30,new V(7,24),new V(22,25)),new se(30,new V(22,15),new V(13,16))),new Pe(26,Int32Array.from([6,30,58,86,114]),new se(28,new V(10,114),new V(2,115)),new se(28,new V(19,46),new V(4,47)),new se(28,new V(28,22),new V(6,23)),new se(30,new V(33,16),new V(4,17))),new Pe(27,Int32Array.from([6,34,62,90,118]),new se(30,new V(8,122),new V(4,123)),new se(28,new V(22,45),new V(3,46)),new se(30,new V(8,23),new V(26,24)),new se(30,new V(12,15),new V(28,16))),new Pe(28,Int32Array.from([6,26,50,74,98,122]),new se(30,new V(3,117),new V(10,118)),new se(28,new V(3,45),new V(23,46)),new se(30,new V(4,24),new V(31,25)),new se(30,new V(11,15),new V(31,16))),new Pe(29,Int32Array.from([6,30,54,78,102,126]),new se(30,new V(7,116),new V(7,117)),new se(28,new V(21,45),new V(7,46)),new se(30,new V(1,23),new V(37,24)),new se(30,new V(19,15),new V(26,16))),new Pe(30,Int32Array.from([6,26,52,78,104,130]),new se(30,new V(5,115),new V(10,116)),new se(28,new V(19,47),new V(10,48)),new se(30,new V(15,24),new V(25,25)),new se(30,new V(23,15),new V(25,16))),new Pe(31,Int32Array.from([6,30,56,82,108,134]),new se(30,new V(13,115),new V(3,116)),new se(28,new V(2,46),new V(29,47)),new se(30,new V(42,24),new V(1,25)),new se(30,new V(23,15),new V(28,16))),new Pe(32,Int32Array.from([6,34,60,86,112,138]),new se(30,new V(17,115)),new se(28,new V(10,46),new V(23,47)),new se(30,new V(10,24),new V(35,25)),new se(30,new V(19,15),new V(35,16))),new Pe(33,Int32Array.from([6,30,58,86,114,142]),new se(30,new V(17,115),new V(1,116)),new se(28,new V(14,46),new V(21,47)),new se(30,new V(29,24),new V(19,25)),new se(30,new V(11,15),new V(46,16))),new Pe(34,Int32Array.from([6,34,62,90,118,146]),new se(30,new V(13,115),new V(6,116)),new se(28,new V(14,46),new V(23,47)),new se(30,new V(44,24),new V(7,25)),new se(30,new V(59,16),new V(1,17))),new Pe(35,Int32Array.from([6,30,54,78,102,126,150]),new se(30,new V(12,121),new V(7,122)),new se(28,new V(12,47),new V(26,48)),new se(30,new V(39,24),new V(14,25)),new se(30,new V(22,15),new V(41,16))),new Pe(36,Int32Array.from([6,24,50,76,102,128,154]),new se(30,new V(6,121),new V(14,122)),new se(28,new V(6,47),new V(34,48)),new se(30,new V(46,24),new V(10,25)),new se(30,new V(2,15),new V(64,16))),new Pe(37,Int32Array.from([6,28,54,80,106,132,158]),new se(30,new V(17,122),new V(4,123)),new se(28,new V(29,46),new V(14,47)),new se(30,new V(49,24),new V(10,25)),new se(30,new V(24,15),new V(46,16))),new Pe(38,Int32Array.from([6,32,58,84,110,136,162]),new se(30,new V(4,122),new V(18,123)),new se(28,new V(13,46),new V(32,47)),new se(30,new V(48,24),new V(14,25)),new se(30,new V(42,15),new V(32,16))),new Pe(39,Int32Array.from([6,26,54,82,110,138,166]),new se(30,new V(20,117),new V(4,118)),new se(28,new V(40,47),new V(7,48)),new se(30,new V(43,24),new V(22,25)),new se(30,new V(10,15),new V(67,16))),new Pe(40,Int32Array.from([6,30,58,86,114,142,170]),new se(30,new V(19,118),new V(6,119)),new se(28,new V(18,47),new V(31,48)),new se(30,new V(34,24),new V(34,25)),new se(30,new V(20,15),new V(61,16)))];var hn;(function(M){M[M.DATA_MASK_000=0]="DATA_MASK_000",M[M.DATA_MASK_001=1]="DATA_MASK_001",M[M.DATA_MASK_010=2]="DATA_MASK_010",M[M.DATA_MASK_011=3]="DATA_MASK_011",M[M.DATA_MASK_100=4]="DATA_MASK_100",M[M.DATA_MASK_101=5]="DATA_MASK_101",M[M.DATA_MASK_110=6]="DATA_MASK_110",M[M.DATA_MASK_111=7]="DATA_MASK_111"})(hn||(hn={}));class $n{constructor(n,o){this.value=n,this.isMasked=o}unmaskBitMatrix(n,o){for(let l=0;l<o;l++)for(let u=0;u<o;u++)this.isMasked(l,u)&&n.flip(u,l)}}$n.values=new Map([[hn.DATA_MASK_000,new $n(hn.DATA_MASK_000,(M,n)=>(M+n&1)===0)],[hn.DATA_MASK_001,new $n(hn.DATA_MASK_001,(M,n)=>(M&1)===0)],[hn.DATA_MASK_010,new $n(hn.DATA_MASK_010,(M,n)=>n%3===0)],[hn.DATA_MASK_011,new $n(hn.DATA_MASK_011,(M,n)=>(M+n)%3===0)],[hn.DATA_MASK_100,new $n(hn.DATA_MASK_100,(M,n)=>(Math.floor(M/2)+Math.floor(n/3)&1)===0)],[hn.DATA_MASK_101,new $n(hn.DATA_MASK_101,(M,n)=>M*n%6===0)],[hn.DATA_MASK_110,new $n(hn.DATA_MASK_110,(M,n)=>M*n%6<3)],[hn.DATA_MASK_111,new $n(hn.DATA_MASK_111,(M,n)=>(M+n+M*n%3&1)===0)]]);class fa{constructor(n){const o=n.getHeight();if(o<21||(o&3)!==1)throw new X;this.bitMatrix=n}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let n=0;for(let d=0;d<6;d++)n=this.copyBit(d,8,n);n=this.copyBit(7,8,n),n=this.copyBit(8,8,n),n=this.copyBit(8,7,n);for(let d=5;d>=0;d--)n=this.copyBit(8,d,n);const o=this.bitMatrix.getHeight();let l=0;const u=o-7;for(let d=o-1;d>=u;d--)l=this.copyBit(8,d,l);for(let d=o-8;d<o;d++)l=this.copyBit(d,8,l);if(this.parsedFormatInfo=yn.decodeFormatInformation(n,l),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new X}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const n=this.bitMatrix.getHeight(),o=Math.floor((n-17)/4);if(o<=6)return Pe.getVersionForNumber(o);let l=0;const u=n-11;for(let m=5;m>=0;m--)for(let p=n-9;p>=u;p--)l=this.copyBit(p,m,l);let d=Pe.decodeVersionInformation(l);if(d!==null&&d.getDimensionForVersion()===n)return this.parsedVersion=d,d;l=0;for(let m=5;m>=0;m--)for(let p=n-9;p>=u;p--)l=this.copyBit(m,p,l);if(d=Pe.decodeVersionInformation(l),d!==null&&d.getDimensionForVersion()===n)return this.parsedVersion=d,d;throw new X}copyBit(n,o,l){return(this.isMirror?this.bitMatrix.get(o,n):this.bitMatrix.get(n,o))?l<<1|1:l<<1}readCodewords(){const n=this.readFormatInformation(),o=this.readVersion(),l=$n.values.get(n.getDataMask()),u=this.bitMatrix.getHeight();l.unmaskBitMatrix(this.bitMatrix,u);const d=o.buildFunctionPattern();let m=!0;const p=new Uint8Array(o.getTotalCodewords());let w=0,C=0,N=0;for(let D=u-1;D>0;D-=2){D===6&&D--;for(let z=0;z<u;z++){const G=m?u-1-z:z;for(let W=0;W<2;W++)d.get(D-W,G)||(N++,C<<=1,this.bitMatrix.get(D-W,G)&&(C|=1),N===8&&(p[w++]=C,N=0,C=0))}m=!m}if(w!==o.getTotalCodewords())throw new X;return p}remask(){if(this.parsedFormatInfo===null)return;const n=$n.values[this.parsedFormatInfo.getDataMask()],o=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,o)}setMirror(n){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=n}mirror(){const n=this.bitMatrix;for(let o=0,l=n.getWidth();o<l;o++)for(let u=o+1,d=n.getHeight();u<d;u++)n.get(o,u)!==n.get(u,o)&&(n.flip(u,o),n.flip(o,u))}}class js{constructor(n,o){this.numDataCodewords=n,this.codewords=o}static getDataBlocks(n,o,l){if(n.length!==o.getTotalCodewords())throw new x;const u=o.getECBlocksForLevel(l);let d=0;const m=u.getECBlocks();for(const W of m)d+=W.getCount();const p=new Array(d);let w=0;for(const W of m)for(let J=0;J<W.getCount();J++){const ae=W.getDataCodewords(),he=u.getECCodewordsPerBlock()+ae;p[w++]=new js(ae,new Uint8Array(he))}const C=p[0].codewords.length;let N=p.length-1;for(;N>=0&&p[N].codewords.length!==C;)N--;N++;const D=C-u.getECCodewordsPerBlock();let z=0;for(let W=0;W<D;W++)for(let J=0;J<w;J++)p[J].codewords[W]=n[z++];for(let W=N;W<w;W++)p[W].codewords[D]=n[z++];const G=p[0].codewords.length;for(let W=D;W<G;W++)for(let J=0;J<w;J++){const ae=J<N?W:W+1;p[J].codewords[ae]=n[z++]}return p}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var er;(function(M){M[M.TERMINATOR=0]="TERMINATOR",M[M.NUMERIC=1]="NUMERIC",M[M.ALPHANUMERIC=2]="ALPHANUMERIC",M[M.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",M[M.BYTE=4]="BYTE",M[M.ECI=5]="ECI",M[M.KANJI=6]="KANJI",M[M.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",M[M.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",M[M.HANZI=9]="HANZI"})(er||(er={}));class Fe{constructor(n,o,l,u){this.value=n,this.stringValue=o,this.characterCountBitsForVersions=l,this.bits=u,Fe.FOR_BITS.set(u,this),Fe.FOR_VALUE.set(n,this)}static forBits(n){const o=Fe.FOR_BITS.get(n);if(o===void 0)throw new x;return o}getCharacterCountBits(n){const o=n.getVersionNumber();let l;return o<=9?l=0:o<=26?l=1:l=2,this.characterCountBitsForVersions[l]}getValue(){return this.value}getBits(){return this.bits}equals(n){if(!(n instanceof Fe))return!1;const o=n;return this.value===o.value}toString(){return this.stringValue}}Fe.FOR_BITS=new Map,Fe.FOR_VALUE=new Map,Fe.TERMINATOR=new Fe(er.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),Fe.NUMERIC=new Fe(er.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),Fe.ALPHANUMERIC=new Fe(er.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),Fe.STRUCTURED_APPEND=new Fe(er.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),Fe.BYTE=new Fe(er.BYTE,"BYTE",Int32Array.from([8,16,16]),4),Fe.ECI=new Fe(er.ECI,"ECI",Int32Array.from([0,0,0]),7),Fe.KANJI=new Fe(er.KANJI,"KANJI",Int32Array.from([8,10,12]),8),Fe.FNC1_FIRST_POSITION=new Fe(er.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),Fe.FNC1_SECOND_POSITION=new Fe(er.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),Fe.HANZI=new Fe(er.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class Pt{static decode(n,o,l,u){const d=new _r(n);let m=new pe;const p=new Array;let w=-1,C=-1;try{let N=null,D=!1,z;do{if(d.available()<4)z=Fe.TERMINATOR;else{const G=d.readBits(4);z=Fe.forBits(G)}switch(z){case Fe.TERMINATOR:break;case Fe.FNC1_FIRST_POSITION:case Fe.FNC1_SECOND_POSITION:D=!0;break;case Fe.STRUCTURED_APPEND:if(d.available()<16)throw new X;w=d.readBits(8),C=d.readBits(8);break;case Fe.ECI:const G=Pt.parseECIValue(d);if(N=Y.getCharacterSetECIByValue(G),N===null)throw new X;break;case Fe.HANZI:const W=d.readBits(4),J=d.readBits(z.getCharacterCountBits(o));W===Pt.GB2312_SUBSET&&Pt.decodeHanziSegment(d,m,J);break;default:const ae=d.readBits(z.getCharacterCountBits(o));switch(z){case Fe.NUMERIC:Pt.decodeNumericSegment(d,m,ae);break;case Fe.ALPHANUMERIC:Pt.decodeAlphanumericSegment(d,m,ae,D);break;case Fe.BYTE:Pt.decodeByteSegment(d,m,ae,N,p,u);break;case Fe.KANJI:Pt.decodeKanjiSegment(d,m,ae);break;default:throw new X}break}}while(z!==Fe.TERMINATOR)}catch{throw new X}return new pt(n,m.toString(),p.length===0?null:p,l===null?null:l.toString(),w,C)}static decodeHanziSegment(n,o,l){if(l*13>n.available())throw new X;const u=new Uint8Array(2*l);let d=0;for(;l>0;){const m=n.readBits(13);let p=m/96<<8&4294967295|m%96;p<959?p+=41377:p+=42657,u[d]=p>>8&255,u[d+1]=p&255,d+=2,l--}try{o.append(le.decode(u,te.GB2312))}catch(m){throw new X(m)}}static decodeKanjiSegment(n,o,l){if(l*13>n.available())throw new X;const u=new Uint8Array(2*l);let d=0;for(;l>0;){const m=n.readBits(13);let p=m/192<<8&4294967295|m%192;p<7936?p+=33088:p+=49472,u[d]=p>>8,u[d+1]=p,d+=2,l--}try{o.append(le.decode(u,te.SHIFT_JIS))}catch(m){throw new X(m)}}static decodeByteSegment(n,o,l,u,d,m){if(8*l>n.available())throw new X;const p=new Uint8Array(l);for(let C=0;C<l;C++)p[C]=n.readBits(8);let w;u===null?w=te.guessEncoding(p,m):w=u.getName();try{o.append(le.decode(p,w))}catch(C){throw new X(C)}d.push(p)}static toAlphaNumericChar(n){if(n>=Pt.ALPHANUMERIC_CHARS.length)throw new X;return Pt.ALPHANUMERIC_CHARS[n]}static decodeAlphanumericSegment(n,o,l,u){const d=o.length();for(;l>1;){if(n.available()<11)throw new X;const m=n.readBits(11);o.append(Pt.toAlphaNumericChar(Math.floor(m/45))),o.append(Pt.toAlphaNumericChar(m%45)),l-=2}if(l===1){if(n.available()<6)throw new X;o.append(Pt.toAlphaNumericChar(n.readBits(6)))}if(u)for(let m=d;m<o.length();m++)o.charAt(m)==="%"&&(m<o.length()-1&&o.charAt(m+1)==="%"?o.deleteCharAt(m+1):o.setCharAt(m,""))}static decodeNumericSegment(n,o,l){for(;l>=3;){if(n.available()<10)throw new X;const u=n.readBits(10);if(u>=1e3)throw new X;o.append(Pt.toAlphaNumericChar(Math.floor(u/100))),o.append(Pt.toAlphaNumericChar(Math.floor(u/10)%10)),o.append(Pt.toAlphaNumericChar(u%10)),l-=3}if(l===2){if(n.available()<7)throw new X;const u=n.readBits(7);if(u>=100)throw new X;o.append(Pt.toAlphaNumericChar(Math.floor(u/10))),o.append(Pt.toAlphaNumericChar(u%10))}else if(l===1){if(n.available()<4)throw new X;const u=n.readBits(4);if(u>=10)throw new X;o.append(Pt.toAlphaNumericChar(u))}}static parseECIValue(n){const o=n.readBits(8);if((o&128)===0)return o&127;if((o&192)===128){const l=n.readBits(8);return(o&63)<<8&4294967295|l}if((o&224)===192){const l=n.readBits(16);return(o&31)<<16&4294967295|l}throw new X}}Pt.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Pt.GB2312_SUBSET=1;class nc{constructor(n){this.mirrored=n}isMirrored(){return this.mirrored}applyMirroredCorrection(n){if(!this.mirrored||n===null||n.length<3)return;const o=n[0];n[0]=n[2],n[2]=o}}class pf{constructor(){this.rsDecoder=new Ni(xt.QR_CODE_FIELD_256)}decodeBooleanArray(n,o){return this.decodeBitMatrix(Te.parseFromBooleanArray(n),o)}decodeBitMatrix(n,o){const l=new fa(n);let u=null;try{return this.decodeBitMatrixParser(l,o)}catch(d){u=d}try{l.remask(),l.setMirror(!0),l.readVersion(),l.readFormatInformation(),l.mirror();const d=this.decodeBitMatrixParser(l,o);return d.setOther(new nc(!0)),d}catch(d){throw u!==null?u:d}}decodeBitMatrixParser(n,o){const l=n.readVersion(),u=n.readFormatInformation().getErrorCorrectionLevel(),d=n.readCodewords(),m=js.getDataBlocks(d,l,u);let p=0;for(const N of m)p+=N.getNumDataCodewords();const w=new Uint8Array(p);let C=0;for(const N of m){const D=N.getCodewords(),z=N.getNumDataCodewords();this.correctErrors(D,z);for(let G=0;G<z;G++)w[C++]=D[G]}return Pt.decode(w,l,u,o)}correctErrors(n,o){const l=new Int32Array(n);try{this.rsDecoder.decode(l,n.length-o)}catch{throw new R}for(let u=0;u<o;u++)n[u]=l[u]}}class da extends ke{constructor(n,o,l){super(n,o),this.estimatedModuleSize=l}aboutEquals(n,o,l){if(Math.abs(o-this.getY())<=n&&Math.abs(l-this.getX())<=n){const u=Math.abs(n-this.estimatedModuleSize);return u<=1||u<=this.estimatedModuleSize}return!1}combineEstimate(n,o,l){const u=(this.getX()+o)/2,d=(this.getY()+n)/2,m=(this.estimatedModuleSize+l)/2;return new da(u,d,m)}}class cr{constructor(n,o,l,u,d,m,p){this.image=n,this.startX=o,this.startY=l,this.width=u,this.height=d,this.moduleSize=m,this.resultPointCallback=p,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const n=this.startX,o=this.height,l=this.width,u=n+l,d=this.startY+o/2,m=new Int32Array(3),p=this.image;for(let w=0;w<o;w++){const C=d+((w&1)===0?Math.floor((w+1)/2):-Math.floor((w+1)/2));m[0]=0,m[1]=0,m[2]=0;let N=n;for(;N<u&&!p.get(N,C);)N++;let D=0;for(;N<u;){if(p.get(N,C))if(D===1)m[1]++;else if(D===2){if(this.foundPatternCross(m)){const z=this.handlePossibleCenter(m,C,N);if(z!==null)return z}m[0]=m[2],m[1]=1,m[2]=0,D=1}else m[++D]++;else D===1&&D++,m[D]++;N++}if(this.foundPatternCross(m)){const z=this.handlePossibleCenter(m,C,u);if(z!==null)return z}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new ie}static centerFromEnd(n,o){return o-n[2]-n[1]/2}foundPatternCross(n){const o=this.moduleSize,l=o/2;for(let u=0;u<3;u++)if(Math.abs(o-n[u])>=l)return!1;return!0}crossCheckVertical(n,o,l,u){const d=this.image,m=d.getHeight(),p=this.crossCheckStateCount;p[0]=0,p[1]=0,p[2]=0;let w=n;for(;w>=0&&d.get(o,w)&&p[1]<=l;)p[1]++,w--;if(w<0||p[1]>l)return NaN;for(;w>=0&&!d.get(o,w)&&p[0]<=l;)p[0]++,w--;if(p[0]>l)return NaN;for(w=n+1;w<m&&d.get(o,w)&&p[1]<=l;)p[1]++,w++;if(w===m||p[1]>l)return NaN;for(;w<m&&!d.get(o,w)&&p[2]<=l;)p[2]++,w++;if(p[2]>l)return NaN;const C=p[0]+p[1]+p[2];return 5*Math.abs(C-u)>=2*u?NaN:this.foundPatternCross(p)?cr.centerFromEnd(p,w):NaN}handlePossibleCenter(n,o,l){const u=n[0]+n[1]+n[2],d=cr.centerFromEnd(n,l),m=this.crossCheckVertical(o,d,2*n[1],u);if(!isNaN(m)){const p=(n[0]+n[1]+n[2])/3;for(const C of this.possibleCenters)if(C.aboutEquals(p,m,d))return C.combineEstimate(m,d,p);const w=new da(d,m,p);this.possibleCenters.push(w),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(w)}return null}}class to extends ke{constructor(n,o,l,u){super(n,o),this.estimatedModuleSize=l,this.count=u,u===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(n,o,l){if(Math.abs(o-this.getY())<=n&&Math.abs(l-this.getX())<=n){const u=Math.abs(n-this.estimatedModuleSize);return u<=1||u<=this.estimatedModuleSize}return!1}combineEstimate(n,o,l){const u=this.count+1,d=(this.count*this.getX()+o)/u,m=(this.count*this.getY()+n)/u,p=(this.count*this.estimatedModuleSize+l)/u;return new to(d,m,p,u)}}class Vs{constructor(n){this.bottomLeft=n[0],this.topLeft=n[1],this.topRight=n[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Gt{constructor(n,o){this.image=n,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=o}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(n){const o=n!=null&&n.get(Q.TRY_HARDER)!==void 0,l=n!=null&&n.get(Q.PURE_BARCODE)!==void 0,u=this.image,d=u.getHeight(),m=u.getWidth();let p=Math.floor(3*d/(4*Gt.MAX_MODULES));(p<Gt.MIN_SKIP||o)&&(p=Gt.MIN_SKIP);let w=!1;const C=new Int32Array(5);for(let D=p-1;D<d&&!w;D+=p){C[0]=0,C[1]=0,C[2]=0,C[3]=0,C[4]=0;let z=0;for(let G=0;G<m;G++)if(u.get(G,D))(z&1)===1&&z++,C[z]++;else if((z&1)===0)if(z===4)if(Gt.foundPatternCross(C)){if(this.handlePossibleCenter(C,D,G,l)===!0)if(p=2,this.hasSkipped===!0)w=this.haveMultiplyConfirmedCenters();else{const J=this.findRowSkip();J>C[2]&&(D+=J-C[2]-p,G=m-1)}else{C[0]=C[2],C[1]=C[3],C[2]=C[4],C[3]=1,C[4]=0,z=3;continue}z=0,C[0]=0,C[1]=0,C[2]=0,C[3]=0,C[4]=0}else C[0]=C[2],C[1]=C[3],C[2]=C[4],C[3]=1,C[4]=0,z=3;else C[++z]++;else C[z]++;Gt.foundPatternCross(C)&&this.handlePossibleCenter(C,D,m,l)===!0&&(p=C[0],this.hasSkipped&&(w=this.haveMultiplyConfirmedCenters()))}const N=this.selectBestPatterns();return ke.orderBestPatterns(N),new Vs(N)}static centerFromEnd(n,o){return o-n[4]-n[3]-n[2]/2}static foundPatternCross(n){let o=0;for(let d=0;d<5;d++){const m=n[d];if(m===0)return!1;o+=m}if(o<7)return!1;const l=o/7,u=l/2;return Math.abs(l-n[0])<u&&Math.abs(l-n[1])<u&&Math.abs(3*l-n[2])<3*u&&Math.abs(l-n[3])<u&&Math.abs(l-n[4])<u}getCrossCheckStateCount(){const n=this.crossCheckStateCount;return n[0]=0,n[1]=0,n[2]=0,n[3]=0,n[4]=0,n}crossCheckDiagonal(n,o,l,u){const d=this.getCrossCheckStateCount();let m=0;const p=this.image;for(;n>=m&&o>=m&&p.get(o-m,n-m);)d[2]++,m++;if(n<m||o<m)return!1;for(;n>=m&&o>=m&&!p.get(o-m,n-m)&&d[1]<=l;)d[1]++,m++;if(n<m||o<m||d[1]>l)return!1;for(;n>=m&&o>=m&&p.get(o-m,n-m)&&d[0]<=l;)d[0]++,m++;if(d[0]>l)return!1;const w=p.getHeight(),C=p.getWidth();for(m=1;n+m<w&&o+m<C&&p.get(o+m,n+m);)d[2]++,m++;if(n+m>=w||o+m>=C)return!1;for(;n+m<w&&o+m<C&&!p.get(o+m,n+m)&&d[3]<l;)d[3]++,m++;if(n+m>=w||o+m>=C||d[3]>=l)return!1;for(;n+m<w&&o+m<C&&p.get(o+m,n+m)&&d[4]<l;)d[4]++,m++;if(d[4]>=l)return!1;const N=d[0]+d[1]+d[2]+d[3]+d[4];return Math.abs(N-u)<2*u&&Gt.foundPatternCross(d)}crossCheckVertical(n,o,l,u){const d=this.image,m=d.getHeight(),p=this.getCrossCheckStateCount();let w=n;for(;w>=0&&d.get(o,w);)p[2]++,w--;if(w<0)return NaN;for(;w>=0&&!d.get(o,w)&&p[1]<=l;)p[1]++,w--;if(w<0||p[1]>l)return NaN;for(;w>=0&&d.get(o,w)&&p[0]<=l;)p[0]++,w--;if(p[0]>l)return NaN;for(w=n+1;w<m&&d.get(o,w);)p[2]++,w++;if(w===m)return NaN;for(;w<m&&!d.get(o,w)&&p[3]<l;)p[3]++,w++;if(w===m||p[3]>=l)return NaN;for(;w<m&&d.get(o,w)&&p[4]<l;)p[4]++,w++;if(p[4]>=l)return NaN;const C=p[0]+p[1]+p[2]+p[3]+p[4];return 5*Math.abs(C-u)>=2*u?NaN:Gt.foundPatternCross(p)?Gt.centerFromEnd(p,w):NaN}crossCheckHorizontal(n,o,l,u){const d=this.image,m=d.getWidth(),p=this.getCrossCheckStateCount();let w=n;for(;w>=0&&d.get(w,o);)p[2]++,w--;if(w<0)return NaN;for(;w>=0&&!d.get(w,o)&&p[1]<=l;)p[1]++,w--;if(w<0||p[1]>l)return NaN;for(;w>=0&&d.get(w,o)&&p[0]<=l;)p[0]++,w--;if(p[0]>l)return NaN;for(w=n+1;w<m&&d.get(w,o);)p[2]++,w++;if(w===m)return NaN;for(;w<m&&!d.get(w,o)&&p[3]<l;)p[3]++,w++;if(w===m||p[3]>=l)return NaN;for(;w<m&&d.get(w,o)&&p[4]<l;)p[4]++,w++;if(p[4]>=l)return NaN;const C=p[0]+p[1]+p[2]+p[3]+p[4];return 5*Math.abs(C-u)>=u?NaN:Gt.foundPatternCross(p)?Gt.centerFromEnd(p,w):NaN}handlePossibleCenter(n,o,l,u){const d=n[0]+n[1]+n[2]+n[3]+n[4];let m=Gt.centerFromEnd(n,l),p=this.crossCheckVertical(o,Math.floor(m),n[2],d);if(!isNaN(p)&&(m=this.crossCheckHorizontal(Math.floor(m),Math.floor(p),n[2],d),!isNaN(m)&&(!u||this.crossCheckDiagonal(Math.floor(p),Math.floor(m),n[2],d)))){const w=d/7;let C=!1;const N=this.possibleCenters;for(let D=0,z=N.length;D<z;D++){const G=N[D];if(G.aboutEquals(w,p,m)){N[D]=G.combineEstimate(p,m,w),C=!0;break}}if(!C){const D=new to(m,p,w);N.push(D),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(D)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let o=null;for(const l of this.possibleCenters)if(l.getCount()>=Gt.CENTER_QUORUM)if(o==null)o=l;else return this.hasSkipped=!0,Math.floor((Math.abs(o.getX()-l.getX())-Math.abs(o.getY()-l.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let n=0,o=0;const l=this.possibleCenters.length;for(const m of this.possibleCenters)m.getCount()>=Gt.CENTER_QUORUM&&(n++,o+=m.getEstimatedModuleSize());if(n<3)return!1;const u=o/l;let d=0;for(const m of this.possibleCenters)d+=Math.abs(m.getEstimatedModuleSize()-u);return d<=.05*o}selectBestPatterns(){const n=this.possibleCenters.length;if(n<3)throw new ie;const o=this.possibleCenters;let l;if(n>3){let u=0,d=0;for(const w of this.possibleCenters){const C=w.getEstimatedModuleSize();u+=C,d+=C*C}l=u/n;let m=Math.sqrt(d/n-l*l);o.sort((w,C)=>{const N=Math.abs(C.getEstimatedModuleSize()-l),D=Math.abs(w.getEstimatedModuleSize()-l);return N<D?-1:N>D?1:0});const p=Math.max(.2*l,m);for(let w=0;w<o.length&&o.length>3;w++){const C=o[w];Math.abs(C.getEstimatedModuleSize()-l)>p&&(o.splice(w,1),w--)}}if(o.length>3){let u=0;for(const d of o)u+=d.getEstimatedModuleSize();l=u/o.length,o.sort((d,m)=>{if(m.getCount()===d.getCount()){const p=Math.abs(m.getEstimatedModuleSize()-l),w=Math.abs(d.getEstimatedModuleSize()-l);return p<w?1:p>w?-1:0}else return m.getCount()-d.getCount()}),o.splice(3)}return[o[0],o[1],o[2]]}}Gt.CENTER_QUORUM=2,Gt.MIN_SKIP=3,Gt.MAX_MODULES=57;class Ur{constructor(n){this.image=n}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(n){this.resultPointCallback=n==null?null:n.get(Q.NEED_RESULT_POINT_CALLBACK);const l=new Gt(this.image,this.resultPointCallback).find(n);return this.processFinderPatternInfo(l)}processFinderPatternInfo(n){const o=n.getTopLeft(),l=n.getTopRight(),u=n.getBottomLeft(),d=this.calculateModuleSize(o,l,u);if(d<1)throw new ie("No pattern found in proccess finder.");const m=Ur.computeDimension(o,l,u,d),p=Pe.getProvisionalVersionForDimension(m),w=p.getDimensionForVersion()-7;let C=null;if(p.getAlignmentPatternCenters().length>0){const G=l.getX()-o.getX()+u.getX(),W=l.getY()-o.getY()+u.getY(),J=1-3/w,ae=Math.floor(o.getX()+J*(G-o.getX())),he=Math.floor(o.getY()+J*(W-o.getY()));for(let Ne=4;Ne<=16;Ne<<=1)try{C=this.findAlignmentInRegion(d,ae,he,Ne);break}catch(Se){if(!(Se instanceof ie))throw Se}}const N=Ur.createTransform(o,l,u,C,m),D=Ur.sampleGrid(this.image,N,m);let z;return C===null?z=[u,o,l]:z=[u,o,l,C],new Mo(D,z)}static createTransform(n,o,l,u,d){const m=d-3.5;let p,w,C,N;return u!==null?(p=u.getX(),w=u.getY(),C=m-3,N=C):(p=o.getX()-n.getX()+l.getX(),w=o.getY()-n.getY()+l.getY(),C=m,N=m),sr.quadrilateralToQuadrilateral(3.5,3.5,m,3.5,C,N,3.5,m,n.getX(),n.getY(),o.getX(),o.getY(),p,w,l.getX(),l.getY())}static sampleGrid(n,o,l){return vr.getInstance().sampleGridWithTransform(n,l,l,o)}static computeDimension(n,o,l,u){const d=ot.round(ke.distance(n,o)/u),m=ot.round(ke.distance(n,l)/u);let p=Math.floor((d+m)/2)+7;switch(p&3){case 0:p++;break;case 2:p--;break;case 3:throw new ie("Dimensions could be not found.")}return p}calculateModuleSize(n,o,l){return(this.calculateModuleSizeOneWay(n,o)+this.calculateModuleSizeOneWay(n,l))/2}calculateModuleSizeOneWay(n,o){const l=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(n.getX()),Math.floor(n.getY()),Math.floor(o.getX()),Math.floor(o.getY())),u=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(o.getX()),Math.floor(o.getY()),Math.floor(n.getX()),Math.floor(n.getY()));return isNaN(l)?u/7:isNaN(u)?l/7:(l+u)/14}sizeOfBlackWhiteBlackRunBothWays(n,o,l,u){let d=this.sizeOfBlackWhiteBlackRun(n,o,l,u),m=1,p=n-(l-n);p<0?(m=n/(n-p),p=0):p>=this.image.getWidth()&&(m=(this.image.getWidth()-1-n)/(p-n),p=this.image.getWidth()-1);let w=Math.floor(o-(u-o)*m);return m=1,w<0?(m=o/(o-w),w=0):w>=this.image.getHeight()&&(m=(this.image.getHeight()-1-o)/(w-o),w=this.image.getHeight()-1),p=Math.floor(n+(p-n)*m),d+=this.sizeOfBlackWhiteBlackRun(n,o,p,w),d-1}sizeOfBlackWhiteBlackRun(n,o,l,u){const d=Math.abs(u-o)>Math.abs(l-n);if(d){let G=n;n=o,o=G,G=l,l=u,u=G}const m=Math.abs(l-n),p=Math.abs(u-o);let w=-m/2;const C=n<l?1:-1,N=o<u?1:-1;let D=0;const z=l+C;for(let G=n,W=o;G!==z;G+=C){const J=d?W:G,ae=d?G:W;if(D===1===this.image.get(J,ae)){if(D===2)return ot.distance(G,W,n,o);D++}if(w+=p,w>0){if(W===u)break;W+=N,w-=m}}return D===2?ot.distance(l+C,u,n,o):NaN}findAlignmentInRegion(n,o,l,u){const d=Math.floor(u*n),m=Math.max(0,o-d),p=Math.min(this.image.getWidth()-1,o+d);if(p-m<n*3)throw new ie("Alignment top exceeds estimated module size.");const w=Math.max(0,l-d),C=Math.min(this.image.getHeight()-1,l+d);if(C-w<n*3)throw new ie("Alignment bottom exceeds estimated module size.");return new cr(this.image,m,w,p-m,C-w,n,this.resultPointCallback).find()}}class ti{constructor(){this.decoder=new pf}getDecoder(){return this.decoder}decode(n,o){let l,u;if(o!=null&&o.get(Q.PURE_BARCODE)!==void 0){const w=ti.extractPureBits(n.getBlackMatrix());l=this.decoder.decodeBitMatrix(w,o),u=ti.NO_POINTS}else{const w=new Ur(n.getBlackMatrix()).detect(o);l=this.decoder.decodeBitMatrix(w.getBits(),o),u=w.getPoints()}l.getOther()instanceof nc&&l.getOther().applyMirroredCorrection(u);const d=new Ie(l.getText(),l.getRawBytes(),void 0,u,Ce.QR_CODE,void 0),m=l.getByteSegments();m!==null&&d.putMetadata(Qe.BYTE_SEGMENTS,m);const p=l.getECLevel();return p!==null&&d.putMetadata(Qe.ERROR_CORRECTION_LEVEL,p),l.hasStructuredAppend()&&(d.putMetadata(Qe.STRUCTURED_APPEND_SEQUENCE,l.getStructuredAppendSequenceNumber()),d.putMetadata(Qe.STRUCTURED_APPEND_PARITY,l.getStructuredAppendParity())),d}reset(){}static extractPureBits(n){const o=n.getTopLeftOnBit(),l=n.getBottomRightOnBit();if(o===null||l===null)throw new ie;const u=this.moduleSize(o,n);let d=o[1],m=l[1],p=o[0],w=l[0];if(p>=w||d>=m)throw new ie;if(m-d!==w-p&&(w=p+(m-d),w>=n.getWidth()))throw new ie;const C=Math.round((w-p+1)/u),N=Math.round((m-d+1)/u);if(C<=0||N<=0)throw new ie;if(N!==C)throw new ie;const D=Math.floor(u/2);d+=D,p+=D;const z=p+Math.floor((C-1)*u)-w;if(z>0){if(z>D)throw new ie;p-=z}const G=d+Math.floor((N-1)*u)-m;if(G>0){if(G>D)throw new ie;d-=G}const W=new Te(C,N);for(let J=0;J<N;J++){const ae=d+Math.floor(J*u);for(let he=0;he<C;he++)n.get(p+Math.floor(he*u),ae)&&W.set(he,J)}return W}static moduleSize(n,o){const l=o.getHeight(),u=o.getWidth();let d=n[0],m=n[1],p=!0,w=0;for(;d<u&&m<l;){if(p!==o.get(d,m)){if(++w===5)break;p=!p}d++,m++}if(d===u||m===l)throw new ie;return(d-n[0])/7}}ti.NO_POINTS=new Array;class Ge{PDF417Common(){}static getBitCountSum(n){return ot.sum(n)}static toIntArray(n){if(n==null||!n.length)return Ge.EMPTY_INT_ARRAY;const o=new Int32Array(n.length);let l=0;for(const u of n)o[l++]=u;return o}static getCodeword(n){const o=Z.binarySearch(Ge.SYMBOL_TABLE,n&262143);return o<0?-1:(Ge.CODEWORD_TABLE[o]-1)%Ge.NUMBER_OF_CODEWORDS}}Ge.NUMBER_OF_CODEWORDS=929,Ge.MAX_CODEWORDS_IN_BARCODE=Ge.NUMBER_OF_CODEWORDS-1,Ge.MIN_ROWS_IN_BARCODE=3,Ge.MAX_ROWS_IN_BARCODE=90,Ge.MODULES_IN_CODEWORD=17,Ge.MODULES_IN_STOP_PATTERN=18,Ge.BARS_IN_MODULE=8,Ge.EMPTY_INT_ARRAY=new Int32Array([]),Ge.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]),Ge.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 rc{constructor(n,o){this.bits=n,this.points=o}getBits(){return this.bits}getPoints(){return this.points}}class We{static detectMultiple(n,o,l){let u=n.getBlackMatrix(),d=We.detect(l,u);return d.length||(u=u.clone(),u.rotate180(),d=We.detect(l,u)),new rc(u,d)}static detect(n,o){const l=new Array;let u=0,d=0,m=!1;for(;u<o.getHeight();){const p=We.findVertices(o,u,d);if(p[0]==null&&p[3]==null){if(!m)break;m=!1,d=0;for(const w of l)w[1]!=null&&(u=Math.trunc(Math.max(u,w[1].getY()))),w[3]!=null&&(u=Math.max(u,Math.trunc(w[3].getY())));u+=We.ROW_STEP;continue}if(m=!0,l.push(p),!n)break;p[2]!=null?(d=Math.trunc(p[2].getX()),u=Math.trunc(p[2].getY())):(d=Math.trunc(p[4].getX()),u=Math.trunc(p[4].getY()))}return l}static findVertices(n,o,l){const u=n.getHeight(),d=n.getWidth(),m=new Array(8);return We.copyToResult(m,We.findRowsWithPattern(n,u,d,o,l,We.START_PATTERN),We.INDEXES_START_PATTERN),m[4]!=null&&(l=Math.trunc(m[4].getX()),o=Math.trunc(m[4].getY())),We.copyToResult(m,We.findRowsWithPattern(n,u,d,o,l,We.STOP_PATTERN),We.INDEXES_STOP_PATTERN),m}static copyToResult(n,o,l){for(let u=0;u<l.length;u++)n[l[u]]=o[u]}static findRowsWithPattern(n,o,l,u,d,m){const p=new Array(4);let w=!1;const C=new Int32Array(m.length);for(;u<o;u+=We.ROW_STEP){let D=We.findGuardPattern(n,d,u,l,!1,m,C);if(D!=null){for(;u>0;){const z=We.findGuardPattern(n,d,--u,l,!1,m,C);if(z!=null)D=z;else{u++;break}}p[0]=new ke(D[0],u),p[1]=new ke(D[1],u),w=!0;break}}let N=u+1;if(w){let D=0,z=Int32Array.from([Math.trunc(p[0].getX()),Math.trunc(p[1].getX())]);for(;N<o;N++){const G=We.findGuardPattern(n,z[0],N,l,!1,m,C);if(G!=null&&Math.abs(z[0]-G[0])<We.MAX_PATTERN_DRIFT&&Math.abs(z[1]-G[1])<We.MAX_PATTERN_DRIFT)z=G,D=0;else{if(D>We.SKIPPED_ROW_COUNT_MAX)break;D++}}N-=D+1,p[2]=new ke(z[0],N),p[3]=new ke(z[1],N)}return N-u<We.BARCODE_MIN_HEIGHT&&Z.fill(p,null),p}static findGuardPattern(n,o,l,u,d,m,p){Z.fillWithin(p,0,p.length,0);let w=o,C=0;for(;n.get(w,l)&&w>0&&C++<We.MAX_PIXEL_DRIFT;)w--;let N=w,D=0,z=m.length;for(let G=d;N<u;N++)if(n.get(N,l)!==G)p[D]++;else{if(D===z-1){if(We.patternMatchVariance(p,m,We.MAX_INDIVIDUAL_VARIANCE)<We.MAX_AVG_VARIANCE)return new Int32Array([w,N]);w+=p[0]+p[1],B.arraycopy(p,2,p,0,D-1),p[D-1]=0,p[D]=0,D--}else D++;p[D]=1,G=!G}return D===z-1&&We.patternMatchVariance(p,m,We.MAX_INDIVIDUAL_VARIANCE)<We.MAX_AVG_VARIANCE?new Int32Array([w,N-1]):null}static patternMatchVariance(n,o,l){let u=n.length,d=0,m=0;for(let C=0;C<u;C++)d+=n[C],m+=o[C];if(d<m)return 1/0;let p=d/m;l*=p;let w=0;for(let C=0;C<u;C++){let N=n[C],D=o[C]*p,z=N>D?N-D:D-N;if(z>l)return 1/0;w+=z}return w/d}}We.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),We.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),We.MAX_AVG_VARIANCE=.42,We.MAX_INDIVIDUAL_VARIANCE=.8,We.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),We.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),We.MAX_PIXEL_DRIFT=3,We.MAX_PATTERN_DRIFT=5,We.SKIPPED_ROW_COUNT_MAX=25,We.ROW_STEP=5,We.BARCODE_MIN_HEIGHT=10;class zt{constructor(n,o){if(o.length===0)throw new x;this.field=n;let l=o.length;if(l>1&&o[0]===0){let u=1;for(;u<l&&o[u]===0;)u++;u===l?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(l-u),B.arraycopy(o,u,this.coefficients,0,this.coefficients.length))}else this.coefficients=o}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(n){return this.coefficients[this.coefficients.length-1-n]}evaluateAt(n){if(n===0)return this.getCoefficient(0);if(n===1){let u=0;for(let d of this.coefficients)u=this.field.add(u,d);return u}let o=this.coefficients[0],l=this.coefficients.length;for(let u=1;u<l;u++)o=this.field.add(this.field.multiply(n,o),this.coefficients[u]);return o}add(n){if(!this.field.equals(n.field))throw new x("ModulusPolys do not have same ModulusGF field");if(this.isZero())return n;if(n.isZero())return this;let o=this.coefficients,l=n.coefficients;if(o.length>l.length){let m=o;o=l,l=m}let u=new Int32Array(l.length),d=l.length-o.length;B.arraycopy(l,0,u,0,d);for(let m=d;m<l.length;m++)u[m]=this.field.add(o[m-d],l[m]);return new zt(this.field,u)}subtract(n){if(!this.field.equals(n.field))throw new x("ModulusPolys do not have same ModulusGF field");return n.isZero()?this:this.add(n.negative())}multiply(n){return n instanceof zt?this.multiplyOther(n):this.multiplyScalar(n)}multiplyOther(n){if(!this.field.equals(n.field))throw new x("ModulusPolys do not have same ModulusGF field");if(this.isZero()||n.isZero())return new zt(this.field,new Int32Array([0]));let o=this.coefficients,l=o.length,u=n.coefficients,d=u.length,m=new Int32Array(l+d-1);for(let p=0;p<l;p++){let w=o[p];for(let C=0;C<d;C++)m[p+C]=this.field.add(m[p+C],this.field.multiply(w,u[C]))}return new zt(this.field,m)}negative(){let n=this.coefficients.length,o=new Int32Array(n);for(let l=0;l<n;l++)o[l]=this.field.subtract(0,this.coefficients[l]);return new zt(this.field,o)}multiplyScalar(n){if(n===0)return new zt(this.field,new Int32Array([0]));if(n===1)return this;let o=this.coefficients.length,l=new Int32Array(o);for(let u=0;u<o;u++)l[u]=this.field.multiply(this.coefficients[u],n);return new zt(this.field,l)}multiplyByMonomial(n,o){if(n<0)throw new x;if(o===0)return new zt(this.field,new Int32Array([0]));let l=this.coefficients.length,u=new Int32Array(l+n);for(let d=0;d<l;d++)u[d]=this.field.multiply(this.coefficients[d],o);return new zt(this.field,u)}toString(){let n=new pe;for(let o=this.getDegree();o>=0;o--){let l=this.getCoefficient(o);l!==0&&(l<0?(n.append(" - "),l=-l):n.length()>0&&n.append(" + "),(o===0||l!==1)&&n.append(l),o!==0&&(o===1?n.append("x"):(n.append("x^"),n.append(o))))}return n.toString()}}class Hs{add(n,o){return(n+o)%this.modulus}subtract(n,o){return(this.modulus+n-o)%this.modulus}exp(n){return this.expTable[n]}log(n){if(n===0)throw new x;return this.logTable[n]}inverse(n){if(n===0)throw new ia;return this.expTable[this.modulus-this.logTable[n]-1]}multiply(n,o){return n===0||o===0?0:this.expTable[(this.logTable[n]+this.logTable[o])%(this.modulus-1)]}getSize(){return this.modulus}equals(n){return n===this}}class Oi extends Hs{constructor(n,o){super(),this.modulus=n,this.expTable=new Int32Array(n),this.logTable=new Int32Array(n);let l=1;for(let u=0;u<n;u++)this.expTable[u]=l,l=l*o%n;for(let u=0;u<n-1;u++)this.logTable[this.expTable[u]]=u;this.zero=new zt(this,new Int32Array([0])),this.one=new zt(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(n,o){if(n<0)throw new x;if(o===0)return this.zero;let l=new Int32Array(n+1);return l[0]=o,new zt(this,l)}}Oi.PDF417_GF=new Oi(Ge.NUMBER_OF_CODEWORDS,3);class ni{constructor(){this.field=Oi.PDF417_GF}decode(n,o,l){let u=new zt(this.field,n),d=new Int32Array(o),m=!1;for(let W=o;W>0;W--){let J=u.evaluateAt(this.field.exp(W));d[o-W]=J,J!==0&&(m=!0)}if(!m)return 0;let p=this.field.getOne();if(l!=null)for(const W of l){let J=this.field.exp(n.length-1-W),ae=new zt(this.field,new Int32Array([this.field.subtract(0,J),1]));p=p.multiply(ae)}let w=new zt(this.field,d),C=this.runEuclideanAlgorithm(this.field.buildMonomial(o,1),w,o),N=C[0],D=C[1],z=this.findErrorLocations(N),G=this.findErrorMagnitudes(D,N,z);for(let W=0;W<z.length;W++){let J=n.length-1-this.field.log(z[W]);if(J<0)throw R.getChecksumInstance();n[J]=this.field.subtract(n[J],G[W])}return z.length}runEuclideanAlgorithm(n,o,l){if(n.getDegree()<o.getDegree()){let z=n;n=o,o=z}let u=n,d=o,m=this.field.getZero(),p=this.field.getOne();for(;d.getDegree()>=Math.round(l/2);){let z=u,G=m;if(u=d,m=p,u.isZero())throw R.getChecksumInstance();d=z;let W=this.field.getZero(),J=u.getCoefficient(u.getDegree()),ae=this.field.inverse(J);for(;d.getDegree()>=u.getDegree()&&!d.isZero();){let he=d.getDegree()-u.getDegree(),Ne=this.field.multiply(d.getCoefficient(d.getDegree()),ae);W=W.add(this.field.buildMonomial(he,Ne)),d=d.subtract(u.multiplyByMonomial(he,Ne))}p=W.multiply(m).subtract(G).negative()}let w=p.getCoefficient(0);if(w===0)throw R.getChecksumInstance();let C=this.field.inverse(w),N=p.multiply(C),D=d.multiply(C);return[N,D]}findErrorLocations(n){let o=n.getDegree(),l=new Int32Array(o),u=0;for(let d=1;d<this.field.getSize()&&u<o;d++)n.evaluateAt(d)===0&&(l[u]=this.field.inverse(d),u++);if(u!==o)throw R.getChecksumInstance();return l}findErrorMagnitudes(n,o,l){let u=o.getDegree(),d=new Int32Array(u);for(let C=1;C<=u;C++)d[u-C]=this.field.multiply(C,o.getCoefficient(C));let m=new zt(this.field,d),p=l.length,w=new Int32Array(p);for(let C=0;C<p;C++){let N=this.field.inverse(l[C]),D=this.field.subtract(0,n.evaluateAt(N)),z=this.field.inverse(m.evaluateAt(N));w[C]=this.field.multiply(D,z)}return w}}class ri{constructor(n,o,l,u,d){n instanceof ri?this.constructor_2(n):this.constructor_1(n,o,l,u,d)}constructor_1(n,o,l,u,d){const m=o==null||l==null,p=u==null||d==null;if(m&&p)throw new ie;m?(o=new ke(0,u.getY()),l=new ke(0,d.getY())):p&&(u=new ke(n.getWidth()-1,o.getY()),d=new ke(n.getWidth()-1,l.getY())),this.image=n,this.topLeft=o,this.bottomLeft=l,this.topRight=u,this.bottomRight=d,this.minX=Math.trunc(Math.min(o.getX(),l.getX())),this.maxX=Math.trunc(Math.max(u.getX(),d.getX())),this.minY=Math.trunc(Math.min(o.getY(),u.getY())),this.maxY=Math.trunc(Math.max(l.getY(),d.getY()))}constructor_2(n){this.image=n.image,this.topLeft=n.getTopLeft(),this.bottomLeft=n.getBottomLeft(),this.topRight=n.getTopRight(),this.bottomRight=n.getBottomRight(),this.minX=n.getMinX(),this.maxX=n.getMaxX(),this.minY=n.getMinY(),this.maxY=n.getMaxY()}static merge(n,o){return n==null?o:o==null?n:new ri(n.image,n.topLeft,n.bottomLeft,o.topRight,o.bottomRight)}addMissingRows(n,o,l){let u=this.topLeft,d=this.bottomLeft,m=this.topRight,p=this.bottomRight;if(n>0){let w=l?this.topLeft:this.topRight,C=Math.trunc(w.getY()-n);C<0&&(C=0);let N=new ke(w.getX(),C);l?u=N:m=N}if(o>0){let w=l?this.bottomLeft:this.bottomRight,C=Math.trunc(w.getY()+o);C>=this.image.getHeight()&&(C=this.image.getHeight()-1);let N=new ke(w.getX(),C);l?d=N:p=N}return new ri(this.image,u,d,m,p)}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 Po{constructor(n,o,l,u){this.columnCount=n,this.errorCorrectionLevel=u,this.rowCountUpperPart=o,this.rowCountLowerPart=l,this.rowCount=o+l}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class ha{constructor(){this.buffer=""}static form(n,o){let l=-1;function u(m,p,w,C,N,D){if(m==="%%")return"%";if(o[++l]===void 0)return;m=C?parseInt(C.substr(1)):void 0;let z=N?parseInt(N.substr(1)):void 0,G;switch(D){case"s":G=o[l];break;case"c":G=o[l][0];break;case"f":G=parseFloat(o[l]).toFixed(m);break;case"p":G=parseFloat(o[l]).toPrecision(m);break;case"e":G=parseFloat(o[l]).toExponential(m);break;case"x":G=parseInt(o[l]).toString(z||16);break;case"d":G=parseFloat(parseInt(o[l],z||10).toPrecision(m)).toFixed(0);break}G=typeof G=="object"?JSON.stringify(G):(+G).toString(z);let W=parseInt(w),J=w&&w[0]+""=="0"?"0":" ";for(;G.length<W;)G=p!==void 0?G+J:J+G;return G}let d=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return n.replace(d,u)}format(n,...o){this.buffer+=ha.form(n,o)}toString(){return this.buffer}}class pi{constructor(n){this.boundingBox=new ri(n),this.codewords=new Array(n.getMaxY()-n.getMinY()+1)}getCodewordNearby(n){let o=this.getCodeword(n);if(o!=null)return o;for(let l=1;l<pi.MAX_NEARBY_DISTANCE;l++){let u=this.imageRowToCodewordIndex(n)-l;if(u>=0&&(o=this.codewords[u],o!=null)||(u=this.imageRowToCodewordIndex(n)+l,u<this.codewords.length&&(o=this.codewords[u],o!=null)))return o}return null}imageRowToCodewordIndex(n){return n-this.boundingBox.getMinY()}setCodeword(n,o){this.codewords[this.imageRowToCodewordIndex(n)]=o}getCodeword(n){return this.codewords[this.imageRowToCodewordIndex(n)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const n=new ha;let o=0;for(const l of this.codewords){if(l==null){n.format("%3d: | %n",o++);continue}n.format("%3d: %3d|%3d%n",o++,l.getRowNumber(),l.getValue())}return n.toString()}}pi.MAX_NEARBY_DISTANCE=5;class xi{constructor(){this.values=new Map}setValue(n){n=Math.trunc(n);let o=this.values.get(n);o==null&&(o=0),o++,this.values.set(n,o)}getValue(){let n=-1,o=new Array;for(const[l,u]of this.values.entries()){const d={getKey:()=>l,getValue:()=>u};d.getValue()>n?(n=d.getValue(),o=[],o.push(d.getKey())):d.getValue()===n&&o.push(d.getKey())}return Ge.toIntArray(o)}getConfidence(n){return this.values.get(n)}}class Gs extends pi{constructor(n,o){super(n),this._isLeft=o}setRowNumbers(){for(let n of this.getCodewords())n!=null&&n.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(n){let o=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(o,n);let l=this.getBoundingBox(),u=this._isLeft?l.getTopLeft():l.getTopRight(),d=this._isLeft?l.getBottomLeft():l.getBottomRight(),m=this.imageRowToCodewordIndex(Math.trunc(u.getY())),p=this.imageRowToCodewordIndex(Math.trunc(d.getY())),w=-1,C=1,N=0;for(let D=m;D<p;D++){if(o[D]==null)continue;let z=o[D],G=z.getRowNumber()-w;if(G===0)N++;else if(G===1)C=Math.max(C,N),N=1,w=z.getRowNumber();else if(G<0||z.getRowNumber()>=n.getRowCount()||G>D)o[D]=null;else{let W;C>2?W=(C-2)*G:W=G;let J=W>=D;for(let ae=1;ae<=W&&!J;ae++)J=o[D-ae]!=null;J?o[D]=null:(w=z.getRowNumber(),N=1)}}}getRowHeights(){let n=this.getBarcodeMetadata();if(n==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(n);let o=new Int32Array(n.getRowCount());for(let l of this.getCodewords())if(l!=null){let u=l.getRowNumber();if(u>=o.length)continue;o[u]++}return o}adjustIncompleteIndicatorColumnRowNumbers(n){let o=this.getBoundingBox(),l=this._isLeft?o.getTopLeft():o.getTopRight(),u=this._isLeft?o.getBottomLeft():o.getBottomRight(),d=this.imageRowToCodewordIndex(Math.trunc(l.getY())),m=this.imageRowToCodewordIndex(Math.trunc(u.getY())),p=this.getCodewords(),w=-1;for(let C=d;C<m;C++){if(p[C]==null)continue;let N=p[C];N.setRowNumberAsRowIndicatorColumn();let D=N.getRowNumber()-w;D===0||(D===1?w=N.getRowNumber():N.getRowNumber()>=n.getRowCount()?p[C]=null:w=N.getRowNumber())}}getBarcodeMetadata(){let n=this.getCodewords(),o=new xi,l=new xi,u=new xi,d=new xi;for(let p of n){if(p==null)continue;p.setRowNumberAsRowIndicatorColumn();let w=p.getValue()%30,C=p.getRowNumber();switch(this._isLeft||(C+=2),C%3){case 0:l.setValue(w*3+1);break;case 1:d.setValue(w/3),u.setValue(w%3);break;case 2:o.setValue(w+1);break}}if(o.getValue().length===0||l.getValue().length===0||u.getValue().length===0||d.getValue().length===0||o.getValue()[0]<1||l.getValue()[0]+u.getValue()[0]<Ge.MIN_ROWS_IN_BARCODE||l.getValue()[0]+u.getValue()[0]>Ge.MAX_ROWS_IN_BARCODE)return null;let m=new Po(o.getValue()[0],l.getValue()[0],u.getValue()[0],d.getValue()[0]);return this.removeIncorrectCodewords(n,m),m}removeIncorrectCodewords(n,o){for(let l=0;l<n.length;l++){let u=n[l];if(n[l]==null)continue;let d=u.getValue()%30,m=u.getRowNumber();if(m>o.getRowCount()){n[l]=null;continue}switch(this._isLeft||(m+=2),m%3){case 0:d*3+1!==o.getRowCountUpperPart()&&(n[l]=null);break;case 1:(Math.trunc(d/3)!==o.getErrorCorrectionLevel()||d%3!==o.getRowCountLowerPart())&&(n[l]=null);break;case 2:d+1!==o.getColumnCount()&&(n[l]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+`
256
- `+super.toString()}}class vn{constructor(n,o){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=n,this.barcodeColumnCount=n.getColumnCount(),this.boundingBox=o,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let n=Ge.MAX_CODEWORDS_IN_BARCODE,o;do o=n,n=this.adjustRowNumbersAndGetCount();while(n>0&&n<o);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(n){n!=null&&n.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let n=this.adjustRowNumbersByRow();if(n===0)return 0;for(let o=1;o<this.barcodeColumnCount+1;o++){let l=this.detectionResultColumns[o].getCodewords();for(let u=0;u<l.length;u++)l[u]!=null&&(l[u].hasValidRowNumber()||this.adjustRowNumbers(o,u,l))}return n}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let n=this.detectionResultColumns[0].getCodewords(),o=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let l=0;l<n.length;l++)if(n[l]!=null&&o[l]!=null&&n[l].getRowNumber()===o[l].getRowNumber())for(let u=1;u<=this.barcodeColumnCount;u++){let d=this.detectionResultColumns[u].getCodewords()[l];d!=null&&(d.setRowNumber(n[l].getRowNumber()),d.hasValidRowNumber()||(this.detectionResultColumns[u].getCodewords()[l]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let n=0,o=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let l=0;l<o.length;l++){if(o[l]==null)continue;let u=o[l].getRowNumber(),d=0;for(let m=this.barcodeColumnCount+1;m>0&&d<this.ADJUST_ROW_NUMBER_SKIP;m--){let p=this.detectionResultColumns[m].getCodewords()[l];p!=null&&(d=vn.adjustRowNumberIfValid(u,d,p),p.hasValidRowNumber()||n++)}}return n}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let n=0,o=this.detectionResultColumns[0].getCodewords();for(let l=0;l<o.length;l++){if(o[l]==null)continue;let u=o[l].getRowNumber(),d=0;for(let m=1;m<this.barcodeColumnCount+1&&d<this.ADJUST_ROW_NUMBER_SKIP;m++){let p=this.detectionResultColumns[m].getCodewords()[l];p!=null&&(d=vn.adjustRowNumberIfValid(u,d,p),p.hasValidRowNumber()||n++)}}return n}static adjustRowNumberIfValid(n,o,l){return l==null||l.hasValidRowNumber()||(l.isValidRowNumber(n)?(l.setRowNumber(n),o=0):++o),o}adjustRowNumbers(n,o,l){if(!this.detectionResultColumns[n-1])return;let u=l[o],d=this.detectionResultColumns[n-1].getCodewords(),m=d;this.detectionResultColumns[n+1]!=null&&(m=this.detectionResultColumns[n+1].getCodewords());let p=new Array(14);p[2]=d[o],p[3]=m[o],o>0&&(p[0]=l[o-1],p[4]=d[o-1],p[5]=m[o-1]),o>1&&(p[8]=l[o-2],p[10]=d[o-2],p[11]=m[o-2]),o<l.length-1&&(p[1]=l[o+1],p[6]=d[o+1],p[7]=m[o+1]),o<l.length-2&&(p[9]=l[o+2],p[12]=d[o+2],p[13]=m[o+2]);for(let w of p)if(vn.adjustRowNumber(u,w))return}static adjustRowNumber(n,o){return o==null?!1:o.hasValidRowNumber()&&o.getBucket()===n.getBucket()?(n.setRowNumber(o.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(n){this.boundingBox=n}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(n,o){this.detectionResultColumns[n]=o}getDetectionResultColumn(n){return this.detectionResultColumns[n]}toString(){let n=this.detectionResultColumns[0];n==null&&(n=this.detectionResultColumns[this.barcodeColumnCount+1]);let o=new ha;for(let l=0;l<n.getCodewords().length;l++){o.format("CW %3d:",l);for(let u=0;u<this.barcodeColumnCount+2;u++){if(this.detectionResultColumns[u]==null){o.format(" | ");continue}let d=this.detectionResultColumns[u].getCodewords()[l];if(d==null){o.format(" | ");continue}o.format(" %3d|%3d",d.getRowNumber(),d.getValue())}o.format("%n")}return o.toString()}}class Er{constructor(n,o,l,u){this.rowNumber=Er.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(n),this.endX=Math.trunc(o),this.bucket=Math.trunc(l),this.value=Math.trunc(u)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(n){return n!==Er.BARCODE_ROW_UNKNOWN&&this.bucket===n%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(n){this.rowNumber=n}toString(){return this.rowNumber+"|"+this.value}}Er.BARCODE_ROW_UNKNOWN=-1;class On{static initialize(){for(let n=0;n<Ge.SYMBOL_TABLE.length;n++){let o=Ge.SYMBOL_TABLE[n],l=o&1;for(let u=0;u<Ge.BARS_IN_MODULE;u++){let d=0;for(;(o&1)===l;)d+=1,o>>=1;l=o&1,On.RATIOS_TABLE[n]||(On.RATIOS_TABLE[n]=new Array(Ge.BARS_IN_MODULE)),On.RATIOS_TABLE[n][Ge.BARS_IN_MODULE-u-1]=Math.fround(d/Ge.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(n){let o=On.getDecodedCodewordValue(On.sampleBitCounts(n));return o!==-1?o:On.getClosestDecodedValue(n)}static sampleBitCounts(n){let o=ot.sum(n),l=new Int32Array(Ge.BARS_IN_MODULE),u=0,d=0;for(let m=0;m<Ge.MODULES_IN_CODEWORD;m++){let p=o/(2*Ge.MODULES_IN_CODEWORD)+m*o/Ge.MODULES_IN_CODEWORD;d+n[u]<=p&&(d+=n[u],u++),l[u]++}return l}static getDecodedCodewordValue(n){let o=On.getBitValue(n);return Ge.getCodeword(o)===-1?-1:o}static getBitValue(n){let o=0;for(let l=0;l<n.length;l++)for(let u=0;u<n[l];u++)o=o<<1|(l%2===0?1:0);return Math.trunc(o)}static getClosestDecodedValue(n){let o=ot.sum(n),l=new Array(Ge.BARS_IN_MODULE);if(o>1)for(let m=0;m<l.length;m++)l[m]=Math.fround(n[m]/o);let u=aa.MAX_VALUE,d=-1;this.bSymbolTableReady||On.initialize();for(let m=0;m<On.RATIOS_TABLE.length;m++){let p=0,w=On.RATIOS_TABLE[m];for(let C=0;C<Ge.BARS_IN_MODULE;C++){let N=Math.fround(w[C]-l[C]);if(p+=Math.fround(N*N),p>=u)break}p<u&&(u=p,d=Ge.SYMBOL_TABLE[m])}return d}}On.bSymbolTableReady=!1,On.RATIOS_TABLE=new Array(Ge.SYMBOL_TABLE.length).map(M=>new Array(Ge.BARS_IN_MODULE));class ga{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(n){this.segmentIndex=n}getFileId(){return this.fileId}setFileId(n){this.fileId=n}getOptionalData(){return this.optionalData}setOptionalData(n){this.optionalData=n}isLastSegment(){return this.lastSegment}setLastSegment(n){this.lastSegment=n}getSegmentCount(){return this.segmentCount}setSegmentCount(n){this.segmentCount=n}getSender(){return this.sender||null}setSender(n){this.sender=n}getAddressee(){return this.addressee||null}setAddressee(n){this.addressee=n}getFileName(){return this.fileName}setFileName(n){this.fileName=n}getFileSize(){return this.fileSize}setFileSize(n){this.fileSize=n}getChecksum(){return this.checksum}setChecksum(n){this.checksum=n}getTimestamp(){return this.timestamp}setTimestamp(n){this.timestamp=n}}class ic{static parseLong(n,o=void 0){return parseInt(n,o)}}class zo extends b{}zo.kind="NullPointerException";class Zs{writeBytes(n){this.writeBytesOffset(n,0,n.length)}writeBytesOffset(n,o,l){if(n==null)throw new zo;if(o<0||o>n.length||l<0||o+l>n.length||o+l<0)throw new P;if(l===0)return;for(let u=0;u<l;u++)this.write(n[o+u])}flush(){}close(){}}class no extends b{}class Uo extends Zs{constructor(n=32){if(super(),this.count=0,n<0)throw new x("Negative initial size: "+n);this.buf=new Uint8Array(n)}ensureCapacity(n){n-this.buf.length>0&&this.grow(n)}grow(n){let l=this.buf.length<<1;if(l-n<0&&(l=n),l<0){if(n<0)throw new no;l=j.MAX_VALUE}this.buf=Z.copyOfUint8Array(this.buf,l)}write(n){this.ensureCapacity(this.count+1),this.buf[this.count]=n,this.count+=1}writeBytesOffset(n,o,l){if(o<0||o>n.length||l<0||o+l-n.length>0)throw new P;this.ensureCapacity(this.count+l),B.arraycopy(n,o,this.buf,this.count,l),this.count+=l}writeTo(n){n.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return Z.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(n){return n?typeof n=="string"?this.toString_string(n):this.toString_number(n):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(n){return new String(this.buf).toString()}toString_number(n){return new String(this.buf).toString()}close(){}}var At;(function(M){M[M.ALPHA=0]="ALPHA",M[M.LOWER=1]="LOWER",M[M.MIXED=2]="MIXED",M[M.PUNCT=3]="PUNCT",M[M.ALPHA_SHIFT=4]="ALPHA_SHIFT",M[M.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(At||(At={}));function ac(){if(typeof window<"u")return window.BigInt||null;if(typeof ea<"u")return ea.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let Fo;function yi(M){if(typeof Fo>"u"&&(Fo=ac()),Fo===null)throw new Error("BigInt is not supported!");return Fo(M)}function Xs(){let M=[];M[0]=yi(1);let n=yi(900);M[1]=n;for(let o=2;o<16;o++)M[o]=M[o-1]*n;return M}class ge{static decode(n,o){let l=new pe(""),u=Y.ISO8859_1;l.enableDecoding(u);let d=1,m=n[d++],p=new ga;for(;d<n[0];){switch(m){case ge.TEXT_COMPACTION_MODE_LATCH:d=ge.textCompaction(n,d,l);break;case ge.BYTE_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:d=ge.byteCompaction(m,n,u,d,l);break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:l.append(n[d++]);break;case ge.NUMERIC_COMPACTION_MODE_LATCH:d=ge.numericCompaction(n,d,l);break;case ge.ECI_CHARSET:Y.getCharacterSetECIByValue(n[d++]);break;case ge.ECI_GENERAL_PURPOSE:d+=2;break;case ge.ECI_USER_DEFINED:d++;break;case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:d=ge.decodeMacroBlock(n,d,p);break;case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:throw new X;default:d--,d=ge.textCompaction(n,d,l);break}if(d<n.length)m=n[d++];else throw X.getFormatInstance()}if(l.length()===0)throw X.getFormatInstance();let w=new pt(null,l.toString(),null,o);return w.setOther(p),w}static decodeMacroBlock(n,o,l){if(o+ge.NUMBER_OF_SEQUENCE_CODEWORDS>n[0])throw X.getFormatInstance();let u=new Int32Array(ge.NUMBER_OF_SEQUENCE_CODEWORDS);for(let p=0;p<ge.NUMBER_OF_SEQUENCE_CODEWORDS;p++,o++)u[p]=n[o];l.setSegmentIndex(j.parseInt(ge.decodeBase900toBase10(u,ge.NUMBER_OF_SEQUENCE_CODEWORDS)));let d=new pe;o=ge.textCompaction(n,o,d),l.setFileId(d.toString());let m=-1;for(n[o]===ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(m=o+1);o<n[0];)switch(n[o]){case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(o++,n[o]){case ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let p=new pe;o=ge.textCompaction(n,o+1,p),l.setFileName(p.toString());break;case ge.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let w=new pe;o=ge.textCompaction(n,o+1,w),l.setSender(w.toString());break;case ge.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let C=new pe;o=ge.textCompaction(n,o+1,C),l.setAddressee(C.toString());break;case ge.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let N=new pe;o=ge.numericCompaction(n,o+1,N),l.setSegmentCount(j.parseInt(N.toString()));break;case ge.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let D=new pe;o=ge.numericCompaction(n,o+1,D),l.setTimestamp(ic.parseLong(D.toString()));break;case ge.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let z=new pe;o=ge.numericCompaction(n,o+1,z),l.setChecksum(j.parseInt(z.toString()));break;case ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let G=new pe;o=ge.numericCompaction(n,o+1,G),l.setFileSize(ic.parseLong(G.toString()));break;default:throw X.getFormatInstance()}break;case ge.MACRO_PDF417_TERMINATOR:o++,l.setLastSegment(!0);break;default:throw X.getFormatInstance()}if(m!==-1){let p=o-m;l.isLastSegment()&&p--,l.setOptionalData(Z.copyOfRange(n,m,m+p))}return o}static textCompaction(n,o,l){let u=new Int32Array((n[0]-o)*2),d=new Int32Array((n[0]-o)*2),m=0,p=!1;for(;o<n[0]&&!p;){let w=n[o++];if(w<ge.TEXT_COMPACTION_MODE_LATCH)u[m]=w/30,u[m+1]=w%30,m+=2;else switch(w){case ge.TEXT_COMPACTION_MODE_LATCH:u[m++]=ge.TEXT_COMPACTION_MODE_LATCH;break;case ge.BYTE_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.NUMERIC_COMPACTION_MODE_LATCH:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:o--,p=!0;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u[m]=ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,w=n[o++],d[m]=w,m++;break}}return ge.decodeTextCompaction(u,d,m,l),o}static decodeTextCompaction(n,o,l,u){let d=At.ALPHA,m=At.ALPHA,p=0;for(;p<l;){let w=n[p],C="";switch(d){case At.ALPHA:if(w<26)C=String.fromCharCode(65+w);else switch(w){case 26:C=" ";break;case ge.LL:d=At.LOWER;break;case ge.ML:d=At.MIXED;break;case ge.PS:m=d,d=At.PUNCT_SHIFT;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.LOWER:if(w<26)C=String.fromCharCode(97+w);else switch(w){case 26:C=" ";break;case ge.AS:m=d,d=At.ALPHA_SHIFT;break;case ge.ML:d=At.MIXED;break;case ge.PS:m=d,d=At.PUNCT_SHIFT;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.MIXED:if(w<ge.PL)C=ge.MIXED_CHARS[w];else switch(w){case ge.PL:d=At.PUNCT;break;case 26:C=" ";break;case ge.LL:d=At.LOWER;break;case ge.AL:d=At.ALPHA;break;case ge.PS:m=d,d=At.PUNCT_SHIFT;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.PUNCT:if(w<ge.PAL)C=ge.PUNCT_CHARS[w];else switch(w){case ge.PAL:d=At.ALPHA;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.ALPHA_SHIFT:if(d=m,w<26)C=String.fromCharCode(65+w);else switch(w){case 26:C=" ";break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break;case At.PUNCT_SHIFT:if(d=m,w<ge.PAL)C=ge.PUNCT_CHARS[w];else switch(w){case ge.PAL:d=At.ALPHA;break;case ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:u.append(o[p]);break;case ge.TEXT_COMPACTION_MODE_LATCH:d=At.ALPHA;break}break}C!==""&&u.append(C),p++}}static byteCompaction(n,o,l,u,d){let m=new Uo,p=0,w=0,C=!1;switch(n){case ge.BYTE_COMPACTION_MODE_LATCH:let N=new Int32Array(6),D=o[u++];for(;u<o[0]&&!C;)switch(N[p++]=D,w=900*w+D,D=o[u++],D){case ge.TEXT_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH:case ge.NUMERIC_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:u--,C=!0;break;default:if(p%5===0&&p>0){for(let z=0;z<6;++z)m.write(Number(yi(w)>>yi(8*(5-z))));w=0,p=0}break}u===o[0]&&D<ge.TEXT_COMPACTION_MODE_LATCH&&(N[p++]=D);for(let z=0;z<p;z++)m.write(N[z]);break;case ge.BYTE_COMPACTION_MODE_LATCH_6:for(;u<o[0]&&!C;){let z=o[u++];if(z<ge.TEXT_COMPACTION_MODE_LATCH)p++,w=900*w+z;else switch(z){case ge.TEXT_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH:case ge.NUMERIC_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:u--,C=!0;break}if(p%5===0&&p>0){for(let G=0;G<6;++G)m.write(Number(yi(w)>>yi(8*(5-G))));w=0,p=0}}break}return d.append(le.decode(m.toByteArray(),l)),u}static numericCompaction(n,o,l){let u=0,d=!1,m=new Int32Array(ge.MAX_NUMERIC_CODEWORDS);for(;o<n[0]&&!d;){let p=n[o++];if(o===n[0]&&(d=!0),p<ge.TEXT_COMPACTION_MODE_LATCH)m[u]=p,u++;else switch(p){case ge.TEXT_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH:case ge.BYTE_COMPACTION_MODE_LATCH_6:case ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case ge.MACRO_PDF417_TERMINATOR:o--,d=!0;break}(u%ge.MAX_NUMERIC_CODEWORDS===0||p===ge.NUMERIC_COMPACTION_MODE_LATCH||d)&&u>0&&(l.append(ge.decodeBase900toBase10(m,u)),u=0)}return o}static decodeBase900toBase10(n,o){let l=yi(0);for(let d=0;d<o;d++)l+=ge.EXP900[o-d-1]*yi(n[d]);let u=l.toString();if(u.charAt(0)!=="1")throw new X;return u.substring(1)}}ge.TEXT_COMPACTION_MODE_LATCH=900,ge.BYTE_COMPACTION_MODE_LATCH=901,ge.NUMERIC_COMPACTION_MODE_LATCH=902,ge.BYTE_COMPACTION_MODE_LATCH_6=924,ge.ECI_USER_DEFINED=925,ge.ECI_GENERAL_PURPOSE=926,ge.ECI_CHARSET=927,ge.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,ge.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,ge.MACRO_PDF417_TERMINATOR=922,ge.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,ge.MAX_NUMERIC_CODEWORDS=15,ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,ge.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,ge.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,ge.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,ge.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,ge.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,ge.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,ge.PL=25,ge.LL=27,ge.AS=27,ge.ML=28,ge.AL=28,ge.PS=29,ge.PAL=29,ge.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,:
257
- -.$/"|*()?{}'`,ge.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",ge.EXP900=ac()?Xs():[],ge.NUMBER_OF_SEQUENCE_CODEWORDS=2;class tt{constructor(){}static decode(n,o,l,u,d,m,p){let w=new ri(n,o,l,u,d),C=null,N=null,D;for(let W=!0;;W=!1){if(o!=null&&(C=tt.getRowIndicatorColumn(n,w,o,!0,m,p)),u!=null&&(N=tt.getRowIndicatorColumn(n,w,u,!1,m,p)),D=tt.merge(C,N),D==null)throw ie.getNotFoundInstance();let J=D.getBoundingBox();if(W&&J!=null&&(J.getMinY()<w.getMinY()||J.getMaxY()>w.getMaxY()))w=J;else break}D.setBoundingBox(w);let z=D.getBarcodeColumnCount()+1;D.setDetectionResultColumn(0,C),D.setDetectionResultColumn(z,N);let G=C!=null;for(let W=1;W<=z;W++){let J=G?W:z-W;if(D.getDetectionResultColumn(J)!==void 0)continue;let ae;J===0||J===z?ae=new Gs(w,J===0):ae=new pi(w),D.setDetectionResultColumn(J,ae);let he=-1,Ne=he;for(let Se=w.getMinY();Se<=w.getMaxY();Se++){if(he=tt.getStartColumn(D,J,Se,G),he<0||he>w.getMaxX()){if(Ne===-1)continue;he=Ne}let Ae=tt.detectCodeword(n,w.getMinX(),w.getMaxX(),G,he,Se,m,p);Ae!=null&&(ae.setCodeword(Se,Ae),Ne=he,m=Math.min(m,Ae.getWidth()),p=Math.max(p,Ae.getWidth()))}}return tt.createDecoderResult(D)}static merge(n,o){if(n==null&&o==null)return null;let l=tt.getBarcodeMetadata(n,o);if(l==null)return null;let u=ri.merge(tt.adjustBoundingBox(n),tt.adjustBoundingBox(o));return new vn(l,u)}static adjustBoundingBox(n){if(n==null)return null;let o=n.getRowHeights();if(o==null)return null;let l=tt.getMax(o),u=0;for(let p of o)if(u+=l-p,p>0)break;let d=n.getCodewords();for(let p=0;u>0&&d[p]==null;p++)u--;let m=0;for(let p=o.length-1;p>=0&&(m+=l-o[p],!(o[p]>0));p--);for(let p=d.length-1;m>0&&d[p]==null;p--)m--;return n.getBoundingBox().addMissingRows(u,m,n.isLeft())}static getMax(n){let o=-1;for(let l of n)o=Math.max(o,l);return o}static getBarcodeMetadata(n,o){let l;if(n==null||(l=n.getBarcodeMetadata())==null)return o==null?null:o.getBarcodeMetadata();let u;return o==null||(u=o.getBarcodeMetadata())==null?l:l.getColumnCount()!==u.getColumnCount()&&l.getErrorCorrectionLevel()!==u.getErrorCorrectionLevel()&&l.getRowCount()!==u.getRowCount()?null:l}static getRowIndicatorColumn(n,o,l,u,d,m){let p=new Gs(o,u);for(let w=0;w<2;w++){let C=w===0?1:-1,N=Math.trunc(Math.trunc(l.getX()));for(let D=Math.trunc(Math.trunc(l.getY()));D<=o.getMaxY()&&D>=o.getMinY();D+=C){let z=tt.detectCodeword(n,0,n.getWidth(),u,N,D,d,m);z!=null&&(p.setCodeword(D,z),u?N=z.getStartX():N=z.getEndX())}}return p}static adjustCodewordCount(n,o){let l=o[0][1],u=l.getValue(),d=n.getBarcodeColumnCount()*n.getBarcodeRowCount()-tt.getNumberOfECCodeWords(n.getBarcodeECLevel());if(u.length===0){if(d<1||d>Ge.MAX_CODEWORDS_IN_BARCODE)throw ie.getNotFoundInstance();l.setValue(d)}else u[0]!==d&&l.setValue(d)}static createDecoderResult(n){let o=tt.createBarcodeMatrix(n);tt.adjustCodewordCount(n,o);let l=new Array,u=new Int32Array(n.getBarcodeRowCount()*n.getBarcodeColumnCount()),d=[],m=new Array;for(let w=0;w<n.getBarcodeRowCount();w++)for(let C=0;C<n.getBarcodeColumnCount();C++){let N=o[w][C+1].getValue(),D=w*n.getBarcodeColumnCount()+C;N.length===0?l.push(D):N.length===1?u[D]=N[0]:(m.push(D),d.push(N))}let p=new Array(d.length);for(let w=0;w<p.length;w++)p[w]=d[w];return tt.createDecoderResultFromAmbiguousValues(n.getBarcodeECLevel(),u,Ge.toIntArray(l),Ge.toIntArray(m),p)}static createDecoderResultFromAmbiguousValues(n,o,l,u,d){let m=new Int32Array(u.length),p=100;for(;p-- >0;){for(let w=0;w<m.length;w++)o[u[w]]=d[w][m[w]];try{return tt.decodeCodewords(o,n,l)}catch(w){if(!(w instanceof R))throw w}if(m.length===0)throw R.getChecksumInstance();for(let w=0;w<m.length;w++)if(m[w]<d[w].length-1){m[w]++;break}else if(m[w]=0,w===m.length-1)throw R.getChecksumInstance()}throw R.getChecksumInstance()}static createBarcodeMatrix(n){let o=Array.from({length:n.getBarcodeRowCount()},()=>new Array(n.getBarcodeColumnCount()+2));for(let u=0;u<o.length;u++)for(let d=0;d<o[u].length;d++)o[u][d]=new xi;let l=0;for(let u of n.getDetectionResultColumns()){if(u!=null){for(let d of u.getCodewords())if(d!=null){let m=d.getRowNumber();if(m>=0){if(m>=o.length)continue;o[m][l].setValue(d.getValue())}}}l++}return o}static isValidBarcodeColumn(n,o){return o>=0&&o<=n.getBarcodeColumnCount()+1}static getStartColumn(n,o,l,u){let d=u?1:-1,m=null;if(tt.isValidBarcodeColumn(n,o-d)&&(m=n.getDetectionResultColumn(o-d).getCodeword(l)),m!=null)return u?m.getEndX():m.getStartX();if(m=n.getDetectionResultColumn(o).getCodewordNearby(l),m!=null)return u?m.getStartX():m.getEndX();if(tt.isValidBarcodeColumn(n,o-d)&&(m=n.getDetectionResultColumn(o-d).getCodewordNearby(l)),m!=null)return u?m.getEndX():m.getStartX();let p=0;for(;tt.isValidBarcodeColumn(n,o-d);){o-=d;for(let w of n.getDetectionResultColumn(o).getCodewords())if(w!=null)return(u?w.getEndX():w.getStartX())+d*p*(w.getEndX()-w.getStartX());p++}return u?n.getBoundingBox().getMinX():n.getBoundingBox().getMaxX()}static detectCodeword(n,o,l,u,d,m,p,w){d=tt.adjustCodewordStartColumn(n,o,l,u,d,m);let C=tt.getModuleBitCount(n,o,l,u,d,m);if(C==null)return null;let N,D=ot.sum(C);if(u)N=d+D;else{for(let W=0;W<C.length/2;W++){let J=C[W];C[W]=C[C.length-1-W],C[C.length-1-W]=J}N=d,d=N-D}if(!tt.checkCodewordSkew(D,p,w))return null;let z=On.getDecodedValue(C),G=Ge.getCodeword(z);return G===-1?null:new Er(d,N,tt.getCodewordBucketNumber(z),G)}static getModuleBitCount(n,o,l,u,d,m){let p=d,w=new Int32Array(8),C=0,N=u?1:-1,D=u;for(;(u?p<l:p>=o)&&C<w.length;)n.get(p,m)===D?(w[C]++,p+=N):(C++,D=!D);return C===w.length||p===(u?l:o)&&C===w.length-1?w:null}static getNumberOfECCodeWords(n){return 2<<n}static adjustCodewordStartColumn(n,o,l,u,d,m){let p=d,w=u?-1:1;for(let C=0;C<2;C++){for(;(u?p>=o:p<l)&&u===n.get(p,m);){if(Math.abs(d-p)>tt.CODEWORD_SKEW_SIZE)return d;p+=w}w=-w,u=!u}return p}static checkCodewordSkew(n,o,l){return o-tt.CODEWORD_SKEW_SIZE<=n&&n<=l+tt.CODEWORD_SKEW_SIZE}static decodeCodewords(n,o,l){if(n.length===0)throw X.getFormatInstance();let u=1<<o+1,d=tt.correctErrors(n,l,u);tt.verifyCodewordCount(n,u);let m=ge.decode(n,""+o);return m.setErrorsCorrected(d),m.setErasures(l.length),m}static correctErrors(n,o,l){if(o!=null&&o.length>l/2+tt.MAX_ERRORS||l<0||l>tt.MAX_EC_CODEWORDS)throw R.getChecksumInstance();return tt.errorCorrection.decode(n,l,o)}static verifyCodewordCount(n,o){if(n.length<4)throw X.getFormatInstance();let l=n[0];if(l>n.length)throw X.getFormatInstance();if(l===0)if(o<n.length)n[0]=n.length-o;else throw X.getFormatInstance()}static getBitCountForCodeword(n){let o=new Int32Array(8),l=0,u=o.length-1;for(;!((n&1)!==l&&(l=n&1,u--,u<0));)o[u]++,n>>=1;return o}static getCodewordBucketNumber(n){return n instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(n):this.getCodewordBucketNumber_number(n)}static getCodewordBucketNumber_number(n){return tt.getCodewordBucketNumber(tt.getBitCountForCodeword(n))}static getCodewordBucketNumber_Int32Array(n){return(n[0]-n[2]+n[4]-n[6]+9)%9}static toString(n){let o=new ha;for(let l=0;l<n.length;l++){o.format("Row %2d: ",l);for(let u=0;u<n[l].length;u++){let d=n[l][u];d.getValue().length===0?o.format(" ",null):o.format("%4d(%2d)",d.getValue()[0],d.getConfidence(d.getValue()[0]))}o.format("%n")}return o.toString()}}tt.CODEWORD_SKEW_SIZE=2,tt.MAX_ERRORS=3,tt.MAX_EC_CODEWORDS=512,tt.errorCorrection=new ni;class In{decode(n,o=null){let l=In.decode(n,o,!1);if(l==null||l.length===0||l[0]==null)throw ie.getNotFoundInstance();return l[0]}decodeMultiple(n,o=null){try{return In.decode(n,o,!0)}catch(l){throw l instanceof X||l instanceof R?ie.getNotFoundInstance():l}}static decode(n,o,l){const u=new Array,d=We.detectMultiple(n,o,l);for(const m of d.getPoints()){const p=tt.decode(d.getBits(),m[4],m[5],m[6],m[7],In.getMinCodewordWidth(m),In.getMaxCodewordWidth(m)),w=new Ie(p.getText(),p.getRawBytes(),void 0,m,Ce.PDF_417);w.putMetadata(Qe.ERROR_CORRECTION_LEVEL,p.getECLevel());const C=p.getOther();C!=null&&w.putMetadata(Qe.PDF417_EXTRA_METADATA,C),u.push(w)}return u.map(m=>m)}static getMaxWidth(n,o){return n==null||o==null?0:Math.trunc(Math.abs(n.getX()-o.getX()))}static getMinWidth(n,o){return n==null||o==null?j.MAX_VALUE:Math.trunc(Math.abs(n.getX()-o.getX()))}static getMaxCodewordWidth(n){return Math.floor(Math.max(Math.max(In.getMaxWidth(n[0],n[4]),In.getMaxWidth(n[6],n[2])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN),Math.max(In.getMaxWidth(n[1],n[5]),In.getMaxWidth(n[7],n[3])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(n){return Math.floor(Math.min(Math.min(In.getMinWidth(n[0],n[4]),In.getMinWidth(n[6],n[2])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN),Math.min(In.getMinWidth(n[1],n[5]),In.getMinWidth(n[7],n[3])*Ge.MODULES_IN_CODEWORD/Ge.MODULES_IN_STOP_PATTERN)))}reset(){}}class jo extends b{}jo.kind="ReaderException";class oc{constructor(n,o){this.verbose=n===!0,o&&this.setHints(o)}decode(n,o){return o&&this.setHints(o),this.decodeInternal(n)}decodeWithState(n){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(n)}setHints(n){this.hints=n;const o=!s(n)&&n.get(Q.TRY_HARDER)===!0,l=s(n)?null:n.get(Q.POSSIBLE_FORMATS),u=new Array;if(!s(l)){const d=l.some(m=>m===Ce.UPC_A||m===Ce.UPC_E||m===Ce.EAN_13||m===Ce.EAN_8||m===Ce.CODABAR||m===Ce.CODE_39||m===Ce.CODE_93||m===Ce.CODE_128||m===Ce.ITF||m===Ce.RSS_14||m===Ce.RSS_EXPANDED);d&&!o&&u.push(new br(n,this.verbose)),l.includes(Ce.QR_CODE)&&u.push(new ti),l.includes(Ce.DATA_MATRIX)&&u.push(new ei),l.includes(Ce.AZTEC)&&u.push(new Do),l.includes(Ce.PDF_417)&&u.push(new In),d&&o&&u.push(new br(n,this.verbose))}u.length===0&&(o||u.push(new br(n,this.verbose)),u.push(new ti),u.push(new ei),u.push(new Do),u.push(new In),o&&u.push(new br(n,this.verbose))),this.readers=u}reset(){if(this.readers!==null)for(const n of this.readers)n.reset()}decodeInternal(n){if(this.readers===null)throw new jo("No readers where selected, nothing can be read.");for(const o of this.readers)try{return o.decode(n,this.hints)}catch(l){if(l instanceof jo)continue}throw new ie("No MultiFormat Readers were able to detect the code.")}}class sc extends Re{constructor(n=null,o=500){const l=new oc;l.setHints(n),super(l,o)}decodeBitmap(n){return this.reader.decodeWithState(n)}}class xf extends Re{constructor(n=500){super(new In,n)}}class yf extends Re{constructor(n=500){super(new ti,n)}}var Ys;(function(M){M[M.ERROR_CORRECTION=0]="ERROR_CORRECTION",M[M.CHARACTER_SET=1]="CHARACTER_SET",M[M.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",M[M.MIN_SIZE=3]="MIN_SIZE",M[M.MAX_SIZE=4]="MAX_SIZE",M[M.MARGIN=5]="MARGIN",M[M.PDF417_COMPACT=6]="PDF417_COMPACT",M[M.PDF417_COMPACTION=7]="PDF417_COMPACTION",M[M.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",M[M.AZTEC_LAYERS=9]="AZTEC_LAYERS",M[M.QR_VERSION=10]="QR_VERSION"})(Ys||(Ys={}));var gn=Ys;class ro{constructor(n){this.field=n,this.cachedGenerators=[],this.cachedGenerators.push(new Tn(n,Int32Array.from([1])))}buildGenerator(n){const o=this.cachedGenerators;if(n>=o.length){let l=o[o.length-1];const u=this.field;for(let d=o.length;d<=n;d++){const m=l.multiply(new Tn(u,Int32Array.from([1,u.exp(d-1+u.getGeneratorBase())])));o.push(m),l=m}}return o[n]}encode(n,o){if(o===0)throw new x("No error correction bytes");const l=n.length-o;if(l<=0)throw new x("No data bytes provided");const u=this.buildGenerator(o),d=new Int32Array(l);B.arraycopy(n,0,d,0,l);let m=new Tn(this.field,d);m=m.multiplyByMonomial(o,1);const w=m.divide(u)[1].getCoefficients(),C=o-w.length;for(let N=0;N<C;N++)n[l+N]=0;B.arraycopy(w,0,n,l+C,w.length)}}class Qt{constructor(){}static applyMaskPenaltyRule1(n){return Qt.applyMaskPenaltyRule1Internal(n,!0)+Qt.applyMaskPenaltyRule1Internal(n,!1)}static applyMaskPenaltyRule2(n){let o=0;const l=n.getArray(),u=n.getWidth(),d=n.getHeight();for(let m=0;m<d-1;m++){const p=l[m];for(let w=0;w<u-1;w++){const C=p[w];C===p[w+1]&&C===l[m+1][w]&&C===l[m+1][w+1]&&o++}}return Qt.N2*o}static applyMaskPenaltyRule3(n){let o=0;const l=n.getArray(),u=n.getWidth(),d=n.getHeight();for(let m=0;m<d;m++)for(let p=0;p<u;p++){const w=l[m];p+6<u&&w[p]===1&&w[p+1]===0&&w[p+2]===1&&w[p+3]===1&&w[p+4]===1&&w[p+5]===0&&w[p+6]===1&&(Qt.isWhiteHorizontal(w,p-4,p)||Qt.isWhiteHorizontal(w,p+7,p+11))&&o++,m+6<d&&l[m][p]===1&&l[m+1][p]===0&&l[m+2][p]===1&&l[m+3][p]===1&&l[m+4][p]===1&&l[m+5][p]===0&&l[m+6][p]===1&&(Qt.isWhiteVertical(l,p,m-4,m)||Qt.isWhiteVertical(l,p,m+7,m+11))&&o++}return o*Qt.N3}static isWhiteHorizontal(n,o,l){o=Math.max(o,0),l=Math.min(l,n.length);for(let u=o;u<l;u++)if(n[u]===1)return!1;return!0}static isWhiteVertical(n,o,l,u){l=Math.max(l,0),u=Math.min(u,n.length);for(let d=l;d<u;d++)if(n[d][o]===1)return!1;return!0}static applyMaskPenaltyRule4(n){let o=0;const l=n.getArray(),u=n.getWidth(),d=n.getHeight();for(let w=0;w<d;w++){const C=l[w];for(let N=0;N<u;N++)C[N]===1&&o++}const m=n.getHeight()*n.getWidth();return Math.floor(Math.abs(o*2-m)*10/m)*Qt.N4}static getDataMaskBit(n,o,l){let u,d;switch(n){case 0:u=l+o&1;break;case 1:u=l&1;break;case 2:u=o%3;break;case 3:u=(l+o)%3;break;case 4:u=Math.floor(l/2)+Math.floor(o/3)&1;break;case 5:d=l*o,u=(d&1)+d%3;break;case 6:d=l*o,u=(d&1)+d%3&1;break;case 7:d=l*o,u=d%3+(l+o&1)&1;break;default:throw new x("Invalid mask pattern: "+n)}return u===0}static applyMaskPenaltyRule1Internal(n,o){let l=0;const u=o?n.getHeight():n.getWidth(),d=o?n.getWidth():n.getHeight(),m=n.getArray();for(let p=0;p<u;p++){let w=0,C=-1;for(let N=0;N<d;N++){const D=o?m[p][N]:m[N][p];D===C?w++:(w>=5&&(l+=Qt.N1+(w-5)),w=1,C=D)}w>=5&&(l+=Qt.N1+(w-5))}return l}}Qt.N1=3,Qt.N2=3,Qt.N3=40,Qt.N4=10;class Vo{constructor(n,o){this.width=n,this.height=o;const l=new Array(o);for(let u=0;u!==o;u++)l[u]=new Uint8Array(n);this.bytes=l}getHeight(){return this.height}getWidth(){return this.width}get(n,o){return this.bytes[o][n]}getArray(){return this.bytes}setNumber(n,o,l){this.bytes[o][n]=l}setBoolean(n,o,l){this.bytes[o][n]=l?1:0}clear(n){for(const o of this.bytes)Z.fill(o,n)}equals(n){if(!(n instanceof Vo))return!1;const o=n;if(this.width!==o.width||this.height!==o.height)return!1;for(let l=0,u=this.height;l<u;++l){const d=this.bytes[l],m=o.bytes[l];for(let p=0,w=this.width;p<w;++p)if(d[p]!==m[p])return!1}return!0}toString(){const n=new pe;for(let o=0,l=this.height;o<l;++o){const u=this.bytes[o];for(let d=0,m=this.width;d<m;++d)switch(u[d]){case 0:n.append(" 0");break;case 1:n.append(" 1");break;default:n.append(" ");break}n.append(`
258
- `)}return n.toString()}}class Ii{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 n=new pe;return n.append(`<<
259
- `),n.append(" mode: "),n.append(this.mode?this.mode.toString():"null"),n.append(`
260
- ecLevel: `),n.append(this.ecLevel?this.ecLevel.toString():"null"),n.append(`
261
- version: `),n.append(this.version?this.version.toString():"null"),n.append(`
262
- maskPattern: `),n.append(this.maskPattern.toString()),this.matrix?(n.append(`
263
- matrix:
264
- `),n.append(this.matrix.toString())):n.append(`
265
- matrix: null
266
- `),n.append(`>>
267
- `),n.toString()}setMode(n){this.mode=n}setECLevel(n){this.ecLevel=n}setVersion(n){this.version=n}setMaskPattern(n){this.maskPattern=n}setMatrix(n){this.matrix=n}static isValidMaskPattern(n){return n>=0&&n<Ii.NUM_MASK_PATTERNS}}Ii.NUM_MASK_PATTERNS=8;class Tt extends b{}Tt.kind="WriterException";class Ze{constructor(){}static clearMatrix(n){n.clear(255)}static buildMatrix(n,o,l,u,d){Ze.clearMatrix(d),Ze.embedBasicPatterns(l,d),Ze.embedTypeInfo(o,u,d),Ze.maybeEmbedVersionInfo(l,d),Ze.embedDataBits(n,u,d)}static embedBasicPatterns(n,o){Ze.embedPositionDetectionPatternsAndSeparators(o),Ze.embedDarkDotAtLeftBottomCorner(o),Ze.maybeEmbedPositionAdjustmentPatterns(n,o),Ze.embedTimingPatterns(o)}static embedTypeInfo(n,o,l){const u=new H;Ze.makeTypeInfoBits(n,o,u);for(let d=0,m=u.getSize();d<m;++d){const p=u.get(u.getSize()-1-d),w=Ze.TYPE_INFO_COORDINATES[d],C=w[0],N=w[1];if(l.setBoolean(C,N,p),d<8){const D=l.getWidth()-d-1;l.setBoolean(D,8,p)}else{const z=l.getHeight()-7+(d-8);l.setBoolean(8,z,p)}}}static maybeEmbedVersionInfo(n,o){if(n.getVersionNumber()<7)return;const l=new H;Ze.makeVersionInfoBits(n,l);let u=17;for(let d=0;d<6;++d)for(let m=0;m<3;++m){const p=l.get(u);u--,o.setBoolean(d,o.getHeight()-11+m,p),o.setBoolean(o.getHeight()-11+m,d,p)}}static embedDataBits(n,o,l){let u=0,d=-1,m=l.getWidth()-1,p=l.getHeight()-1;for(;m>0;){for(m===6&&(m-=1);p>=0&&p<l.getHeight();){for(let w=0;w<2;++w){const C=m-w;if(!Ze.isEmpty(l.get(C,p)))continue;let N;u<n.getSize()?(N=n.get(u),++u):N=!1,o!==255&&Qt.getDataMaskBit(o,C,p)&&(N=!N),l.setBoolean(C,p,N)}p+=d}d=-d,p+=d,m-=2}if(u!==n.getSize())throw new Tt("Not all bits consumed: "+u+"/"+n.getSize())}static findMSBSet(n){return 32-j.numberOfLeadingZeros(n)}static calculateBCHCode(n,o){if(o===0)throw new x("0 polynomial");const l=Ze.findMSBSet(o);for(n<<=l-1;Ze.findMSBSet(n)>=l;)n^=o<<Ze.findMSBSet(n)-l;return n}static makeTypeInfoBits(n,o,l){if(!Ii.isValidMaskPattern(o))throw new Tt("Invalid mask pattern");const u=n.getBits()<<3|o;l.appendBits(u,5);const d=Ze.calculateBCHCode(u,Ze.TYPE_INFO_POLY);l.appendBits(d,10);const m=new H;if(m.appendBits(Ze.TYPE_INFO_MASK_PATTERN,15),l.xor(m),l.getSize()!==15)throw new Tt("should not happen but we got: "+l.getSize())}static makeVersionInfoBits(n,o){o.appendBits(n.getVersionNumber(),6);const l=Ze.calculateBCHCode(n.getVersionNumber(),Ze.VERSION_INFO_POLY);if(o.appendBits(l,12),o.getSize()!==18)throw new Tt("should not happen but we got: "+o.getSize())}static isEmpty(n){return n===255}static embedTimingPatterns(n){for(let o=8;o<n.getWidth()-8;++o){const l=(o+1)%2;Ze.isEmpty(n.get(o,6))&&n.setNumber(o,6,l),Ze.isEmpty(n.get(6,o))&&n.setNumber(6,o,l)}}static embedDarkDotAtLeftBottomCorner(n){if(n.get(8,n.getHeight()-8)===0)throw new Tt;n.setNumber(8,n.getHeight()-8,1)}static embedHorizontalSeparationPattern(n,o,l){for(let u=0;u<8;++u){if(!Ze.isEmpty(l.get(n+u,o)))throw new Tt;l.setNumber(n+u,o,0)}}static embedVerticalSeparationPattern(n,o,l){for(let u=0;u<7;++u){if(!Ze.isEmpty(l.get(n,o+u)))throw new Tt;l.setNumber(n,o+u,0)}}static embedPositionAdjustmentPattern(n,o,l){for(let u=0;u<5;++u){const d=Ze.POSITION_ADJUSTMENT_PATTERN[u];for(let m=0;m<5;++m)l.setNumber(n+m,o+u,d[m])}}static embedPositionDetectionPattern(n,o,l){for(let u=0;u<7;++u){const d=Ze.POSITION_DETECTION_PATTERN[u];for(let m=0;m<7;++m)l.setNumber(n+m,o+u,d[m])}}static embedPositionDetectionPatternsAndSeparators(n){const o=Ze.POSITION_DETECTION_PATTERN[0].length;Ze.embedPositionDetectionPattern(0,0,n),Ze.embedPositionDetectionPattern(n.getWidth()-o,0,n),Ze.embedPositionDetectionPattern(0,n.getWidth()-o,n);const l=8;Ze.embedHorizontalSeparationPattern(0,l-1,n),Ze.embedHorizontalSeparationPattern(n.getWidth()-l,l-1,n),Ze.embedHorizontalSeparationPattern(0,n.getWidth()-l,n);const u=7;Ze.embedVerticalSeparationPattern(u,0,n),Ze.embedVerticalSeparationPattern(n.getHeight()-u-1,0,n),Ze.embedVerticalSeparationPattern(u,n.getHeight()-u,n)}static maybeEmbedPositionAdjustmentPatterns(n,o){if(n.getVersionNumber()<2)return;const l=n.getVersionNumber()-1,u=Ze.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[l];for(let d=0,m=u.length;d!==m;d++){const p=u[d];if(p>=0)for(let w=0;w!==m;w++){const C=u[w];C>=0&&Ze.isEmpty(o.get(C,p))&&Ze.embedPositionAdjustmentPattern(C-2,p-2,o)}}}}Ze.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])]),Ze.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])]),Ze.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])]),Ze.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])]),Ze.VERSION_INFO_POLY=7973,Ze.TYPE_INFO_POLY=1335,Ze.TYPE_INFO_MASK_PATTERN=21522;class vf{constructor(n,o){this.dataBytes=n,this.errorCorrectionBytes=o}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Ut{constructor(){}static calculateMaskPenalty(n){return Qt.applyMaskPenaltyRule1(n)+Qt.applyMaskPenaltyRule2(n)+Qt.applyMaskPenaltyRule3(n)+Qt.applyMaskPenaltyRule4(n)}static encode(n,o,l=null){let u=Ut.DEFAULT_BYTE_MODE_ENCODING;const d=l!==null&&l.get(gn.CHARACTER_SET)!==void 0;d&&(u=l.get(gn.CHARACTER_SET).toString());const m=this.chooseMode(n,u),p=new H;if(m===Fe.BYTE&&(d||Ut.DEFAULT_BYTE_MODE_ENCODING!==u)){const Se=Y.getCharacterSetECIByName(u);Se!==void 0&&this.appendECI(Se,p)}this.appendModeInfo(m,p);const w=new H;this.appendBytes(n,m,w,u);let C;if(l!==null&&l.get(gn.QR_VERSION)!==void 0){const Se=Number.parseInt(l.get(gn.QR_VERSION).toString(),10);C=Pe.getVersionForNumber(Se);const Ae=this.calculateBitsNeeded(m,p,w,C);if(!this.willFit(Ae,C,o))throw new Tt("Data too big for requested version")}else C=this.recommendVersion(o,m,p,w);const N=new H;N.appendBitArray(p);const D=m===Fe.BYTE?w.getSizeInBytes():n.length;this.appendLengthInfo(D,C,m,N),N.appendBitArray(w);const z=C.getECBlocksForLevel(o),G=C.getTotalCodewords()-z.getTotalECCodewords();this.terminateBits(G,N);const W=this.interleaveWithECBytes(N,C.getTotalCodewords(),G,z.getNumBlocks()),J=new Ii;J.setECLevel(o),J.setMode(m),J.setVersion(C);const ae=C.getDimensionForVersion(),he=new Vo(ae,ae),Ne=this.chooseMaskPattern(W,o,C,he);return J.setMaskPattern(Ne),Ze.buildMatrix(W,o,C,Ne,he),J.setMatrix(he),J}static recommendVersion(n,o,l,u){const d=this.calculateBitsNeeded(o,l,u,Pe.getVersionForNumber(1)),m=this.chooseVersion(d,n),p=this.calculateBitsNeeded(o,l,u,m);return this.chooseVersion(p,n)}static calculateBitsNeeded(n,o,l,u){return o.getSize()+n.getCharacterCountBits(u)+l.getSize()}static getAlphanumericCode(n){return n<Ut.ALPHANUMERIC_TABLE.length?Ut.ALPHANUMERIC_TABLE[n]:-1}static chooseMode(n,o=null){if(Y.SJIS.getName()===o&&this.isOnlyDoubleByteKanji(n))return Fe.KANJI;let l=!1,u=!1;for(let d=0,m=n.length;d<m;++d){const p=n.charAt(d);if(Ut.isDigit(p))l=!0;else if(this.getAlphanumericCode(p.charCodeAt(0))!==-1)u=!0;else return Fe.BYTE}return u?Fe.ALPHANUMERIC:l?Fe.NUMERIC:Fe.BYTE}static isOnlyDoubleByteKanji(n){let o;try{o=le.encode(n,Y.SJIS)}catch{return!1}const l=o.length;if(l%2!==0)return!1;for(let u=0;u<l;u+=2){const d=o[u]&255;if((d<129||d>159)&&(d<224||d>235))return!1}return!0}static chooseMaskPattern(n,o,l,u){let d=Number.MAX_SAFE_INTEGER,m=-1;for(let p=0;p<Ii.NUM_MASK_PATTERNS;p++){Ze.buildMatrix(n,o,l,p,u);let w=this.calculateMaskPenalty(u);w<d&&(d=w,m=p)}return m}static chooseVersion(n,o){for(let l=1;l<=40;l++){const u=Pe.getVersionForNumber(l);if(Ut.willFit(n,u,o))return u}throw new Tt("Data too big")}static willFit(n,o,l){const u=o.getTotalCodewords(),m=o.getECBlocksForLevel(l).getTotalECCodewords(),p=u-m,w=(n+7)/8;return p>=w}static terminateBits(n,o){const l=n*8;if(o.getSize()>l)throw new Tt("data bits cannot fit in the QR Code"+o.getSize()+" > "+l);for(let m=0;m<4&&o.getSize()<l;++m)o.appendBit(!1);const u=o.getSize()&7;if(u>0)for(let m=u;m<8;m++)o.appendBit(!1);const d=n-o.getSizeInBytes();for(let m=0;m<d;++m)o.appendBits((m&1)===0?236:17,8);if(o.getSize()!==l)throw new Tt("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(n,o,l,u,d,m){if(u>=l)throw new Tt("Block ID too large");const p=n%l,w=l-p,C=Math.floor(n/l),N=C+1,D=Math.floor(o/l),z=D+1,G=C-D,W=N-z;if(G!==W)throw new Tt("EC bytes mismatch");if(l!==w+p)throw new Tt("RS blocks mismatch");if(n!==(D+G)*w+(z+W)*p)throw new Tt("Total bytes mismatch");u<w?(d[0]=D,m[0]=G):(d[0]=z,m[0]=W)}static interleaveWithECBytes(n,o,l,u){if(n.getSizeInBytes()!==l)throw new Tt("Number of bits and data bytes does not match");let d=0,m=0,p=0;const w=new Array;for(let N=0;N<u;++N){const D=new Int32Array(1),z=new Int32Array(1);Ut.getNumDataBytesAndNumECBytesForBlockID(o,l,u,N,D,z);const G=D[0],W=new Uint8Array(G);n.toBytes(8*d,W,0,G);const J=Ut.generateECBytes(W,z[0]);w.push(new vf(W,J)),m=Math.max(m,G),p=Math.max(p,J.length),d+=D[0]}if(l!==d)throw new Tt("Data bytes does not match offset");const C=new H;for(let N=0;N<m;++N)for(const D of w){const z=D.getDataBytes();N<z.length&&C.appendBits(z[N],8)}for(let N=0;N<p;++N)for(const D of w){const z=D.getErrorCorrectionBytes();N<z.length&&C.appendBits(z[N],8)}if(o!==C.getSizeInBytes())throw new Tt("Interleaving error: "+o+" and "+C.getSizeInBytes()+" differ.");return C}static generateECBytes(n,o){const l=n.length,u=new Int32Array(l+o);for(let m=0;m<l;m++)u[m]=n[m]&255;new ro(xt.QR_CODE_FIELD_256).encode(u,o);const d=new Uint8Array(o);for(let m=0;m<o;m++)d[m]=u[l+m];return d}static appendModeInfo(n,o){o.appendBits(n.getBits(),4)}static appendLengthInfo(n,o,l,u){const d=l.getCharacterCountBits(o);if(n>=1<<d)throw new Tt(n+" is bigger than "+((1<<d)-1));u.appendBits(n,d)}static appendBytes(n,o,l,u){switch(o){case Fe.NUMERIC:Ut.appendNumericBytes(n,l);break;case Fe.ALPHANUMERIC:Ut.appendAlphanumericBytes(n,l);break;case Fe.BYTE:Ut.append8BitBytes(n,l,u);break;case Fe.KANJI:Ut.appendKanjiBytes(n,l);break;default:throw new Tt("Invalid mode: "+o)}}static getDigit(n){return n.charCodeAt(0)-48}static isDigit(n){const o=Ut.getDigit(n);return o>=0&&o<=9}static appendNumericBytes(n,o){const l=n.length;let u=0;for(;u<l;){const d=Ut.getDigit(n.charAt(u));if(u+2<l){const m=Ut.getDigit(n.charAt(u+1)),p=Ut.getDigit(n.charAt(u+2));o.appendBits(d*100+m*10+p,10),u+=3}else if(u+1<l){const m=Ut.getDigit(n.charAt(u+1));o.appendBits(d*10+m,7),u+=2}else o.appendBits(d,4),u++}}static appendAlphanumericBytes(n,o){const l=n.length;let u=0;for(;u<l;){const d=Ut.getAlphanumericCode(n.charCodeAt(u));if(d===-1)throw new Tt;if(u+1<l){const m=Ut.getAlphanumericCode(n.charCodeAt(u+1));if(m===-1)throw new Tt;o.appendBits(d*45+m,11),u+=2}else o.appendBits(d,6),u++}}static append8BitBytes(n,o,l){let u;try{u=le.encode(n,l)}catch(d){throw new Tt(d)}for(let d=0,m=u.length;d!==m;d++){const p=u[d];o.appendBits(p,8)}}static appendKanjiBytes(n,o){let l;try{l=le.encode(n,Y.SJIS)}catch(d){throw new Tt(d)}const u=l.length;for(let d=0;d<u;d+=2){const m=l[d]&255,p=l[d+1]&255,w=m<<8&4294967295|p;let C=-1;if(w>=33088&&w<=40956?C=w-33088:w>=57408&&w<=60351&&(C=w-49472),C===-1)throw new Tt("Invalid byte sequence");const N=(C>>8)*192+(C&255);o.appendBits(N,13)}}static appendECI(n,o){o.appendBits(Fe.ECI.getBits(),4),o.appendBits(n.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=Y.UTF8.getName();class Mi{write(n,o,l,u=null){if(n.length===0)throw new x("Found empty contents");if(o<0||l<0)throw new x("Requested dimensions are too small: "+o+"x"+l);let d=at.L,m=Mi.QUIET_ZONE_SIZE;u!==null&&(u.get(gn.ERROR_CORRECTION)!==void 0&&(d=at.fromString(u.get(gn.ERROR_CORRECTION).toString())),u.get(gn.MARGIN)!==void 0&&(m=Number.parseInt(u.get(gn.MARGIN).toString(),10)));const p=Ut.encode(n,d,u);return this.renderResult(p,o,l,m)}writeToDom(n,o,l,u,d=null){typeof n=="string"&&(n=document.querySelector(n));const m=this.write(o,l,u,d);n&&n.appendChild(m)}renderResult(n,o,l,u){const d=n.getMatrix();if(d===null)throw new or;const m=d.getWidth(),p=d.getHeight(),w=m+u*2,C=p+u*2,N=Math.max(o,w),D=Math.max(l,C),z=Math.min(Math.floor(N/w),Math.floor(D/C)),G=Math.floor((N-m*z)/2),W=Math.floor((D-p*z)/2),J=this.createSVGElement(N,D);for(let ae=0,he=W;ae<p;ae++,he+=z)for(let Ne=0,Se=G;Ne<m;Ne++,Se+=z)if(d.get(Ne,ae)===1){const Ae=this.createSvgRectElement(Se,he,z,z);J.appendChild(Ae)}return J}createSVGElement(n,o){const l=document.createElementNS(Mi.SVG_NS,"svg");return l.setAttributeNS(null,"height",n.toString()),l.setAttributeNS(null,"width",o.toString()),l}createSvgRectElement(n,o,l,u){const d=document.createElementNS(Mi.SVG_NS,"rect");return d.setAttributeNS(null,"x",n.toString()),d.setAttributeNS(null,"y",o.toString()),d.setAttributeNS(null,"height",l.toString()),d.setAttributeNS(null,"width",u.toString()),d.setAttributeNS(null,"fill","#000000"),d}}Mi.QUIET_ZONE_SIZE=4,Mi.SVG_NS="http://www.w3.org/2000/svg";class ma{encode(n,o,l,u,d){if(n.length===0)throw new x("Found empty contents");if(o!==Ce.QR_CODE)throw new x("Can only encode QR_CODE, but got "+o);if(l<0||u<0)throw new x(`Requested dimensions are too small: ${l}x${u}`);let m=at.L,p=ma.QUIET_ZONE_SIZE;d!==null&&(d.get(gn.ERROR_CORRECTION)!==void 0&&(m=at.fromString(d.get(gn.ERROR_CORRECTION).toString())),d.get(gn.MARGIN)!==void 0&&(p=Number.parseInt(d.get(gn.MARGIN).toString(),10)));const w=Ut.encode(n,m,d);return ma.renderResult(w,l,u,p)}static renderResult(n,o,l,u){const d=n.getMatrix();if(d===null)throw new or;const m=d.getWidth(),p=d.getHeight(),w=m+u*2,C=p+u*2,N=Math.max(o,w),D=Math.max(l,C),z=Math.min(Math.floor(N/w),Math.floor(D/C)),G=Math.floor((N-m*z)/2),W=Math.floor((D-p*z)/2),J=new Te(N,D);for(let ae=0,he=W;ae<p;ae++,he+=z)for(let Ne=0,Se=G;Ne<m;Ne++,Se+=z)d.get(Ne,ae)===1&&J.setRegion(Se,he,z,z);return J}}ma.QUIET_ZONE_SIZE=4;class wf{encode(n,o,l,u,d){let m;switch(o){case Ce.QR_CODE:m=new ma;break;default:throw new x("No encoder available for format "+o)}return m.encode(n,o,l,u,d)}}class Fr extends Me{constructor(n,o,l,u,d,m,p,w){if(super(m,p),this.yuvData=n,this.dataWidth=o,this.dataHeight=l,this.left=u,this.top=d,u+m>o||d+p>l)throw new x("Crop rectangle does not fit within image data.");w&&this.reverseHorizontal(m,p)}getRow(n,o){if(n<0||n>=this.getHeight())throw new x("Requested row is outside the image: "+n);const l=this.getWidth();(o==null||o.length<l)&&(o=new Uint8ClampedArray(l));const u=(n+this.top)*this.dataWidth+this.left;return B.arraycopy(this.yuvData,u,o,0,l),o}getMatrix(){const n=this.getWidth(),o=this.getHeight();if(n===this.dataWidth&&o===this.dataHeight)return this.yuvData;const l=n*o,u=new Uint8ClampedArray(l);let d=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return B.arraycopy(this.yuvData,d,u,0,l),u;for(let m=0;m<o;m++){const p=m*n;B.arraycopy(this.yuvData,d,u,p,n),d+=this.dataWidth}return u}isCropSupported(){return!0}crop(n,o,l,u){return new Fr(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+o,l,u,!1)}renderThumbnail(){const n=this.getWidth()/Fr.THUMBNAIL_SCALE_FACTOR,o=this.getHeight()/Fr.THUMBNAIL_SCALE_FACTOR,l=new Int32Array(n*o),u=this.yuvData;let d=this.top*this.dataWidth+this.left;for(let m=0;m<o;m++){const p=m*n;for(let w=0;w<n;w++){const C=u[d+w*Fr.THUMBNAIL_SCALE_FACTOR]&255;l[p+w]=4278190080|C*65793}d+=this.dataWidth*Fr.THUMBNAIL_SCALE_FACTOR}return l}getThumbnailWidth(){return this.getWidth()/Fr.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/Fr.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(n,o){const l=this.yuvData;for(let u=0,d=this.top*this.dataWidth+this.left;u<o;u++,d+=this.dataWidth){const m=d+n/2;for(let p=d,w=d+n-1;p<m;p++,w--){const C=l[p];l[p]=l[w],l[w]=C}}}invert(){return new He(this)}}Fr.THUMBNAIL_SCALE_FACTOR=2;class qs extends Me{constructor(n,o,l,u,d,m,p){if(super(o,l),this.dataWidth=u,this.dataHeight=d,this.left=m,this.top=p,n.BYTES_PER_ELEMENT===4){const w=o*l,C=new Uint8ClampedArray(w);for(let N=0;N<w;N++){const D=n[N],z=D>>16&255,G=D>>7&510,W=D&255;C[N]=(z+G+W)/4&255}this.luminances=C}else this.luminances=n;if(u===void 0&&(this.dataWidth=o),d===void 0&&(this.dataHeight=l),m===void 0&&(this.left=0),p===void 0&&(this.top=0),this.left+o>this.dataWidth||this.top+l>this.dataHeight)throw new x("Crop rectangle does not fit within image data.")}getRow(n,o){if(n<0||n>=this.getHeight())throw new x("Requested row is outside the image: "+n);const l=this.getWidth();(o==null||o.length<l)&&(o=new Uint8ClampedArray(l));const u=(n+this.top)*this.dataWidth+this.left;return B.arraycopy(this.luminances,u,o,0,l),o}getMatrix(){const n=this.getWidth(),o=this.getHeight();if(n===this.dataWidth&&o===this.dataHeight)return this.luminances;const l=n*o,u=new Uint8ClampedArray(l);let d=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return B.arraycopy(this.luminances,d,u,0,l),u;for(let m=0;m<o;m++){const p=m*n;B.arraycopy(this.luminances,d,u,p,n),d+=this.dataWidth}return u}isCropSupported(){return!0}crop(n,o,l,u){return new qs(this.luminances,l,u,this.dataWidth,this.dataHeight,this.left+n,this.top+o)}invert(){return new He(this)}}class lc extends Y{static forName(n){return this.getCharacterSetECIByName(n)}}class io{}io.ISO_8859_1=Y.ISO8859_1;class pa{isCompact(){return this.compact}setCompact(n){this.compact=n}getSize(){return this.size}setSize(n){this.size=n}getLayers(){return this.layers}setLayers(n){this.layers=n}getCodeWords(){return this.codeWords}setCodeWords(n){this.codeWords=n}getMatrix(){return this.matrix}setMatrix(n){this.matrix=n}}class cc{static singletonList(n){return[n]}static min(n,o){return n.sort(o)[0]}}class uc{constructor(n){this.previous=n}getPrevious(){return this.previous}}class Di extends uc{constructor(n,o,l){super(n),this.value=o,this.bitCount=l}appendTo(n,o){n.appendBits(this.value,this.bitCount)}add(n,o){return new Di(this,n,o)}addBinaryShift(n,o){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new Di(this,n,o)}toString(){let n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+j.toBinaryString(n|1<<this.bitCount).substring(1)+">"}}class Ho extends Di{constructor(n,o,l){super(n,0,0),this.binaryShiftStart=o,this.binaryShiftByteCount=l}appendTo(n,o){for(let l=0;l<this.binaryShiftByteCount;l++)(l===0||l===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):l===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(o[this.binaryShiftStart+l],8)}addBinaryShift(n,o){return new Ho(this,n,o)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function fc(M,n,o){return new Ho(M,n,o)}function xa(M,n,o){return new Di(M,n,o)}const ya=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],vi=0,Go=1,ur=2,Ws=3,Ar=4,ao=new Di(null,0,0),Bi=[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 bf(M){for(let n of M)Z.fill(n,-1);return M[vi][Ar]=0,M[Go][Ar]=0,M[Go][vi]=28,M[Ws][Ar]=0,M[ur][Ar]=0,M[ur][vi]=15,M}const oo=bf(Z.createInt32Array(6,6));class Cr{constructor(n,o,l,u){this.token=n,this.mode=o,this.binaryShiftByteCount=l,this.bitCount=u}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(n,o){let l=this.bitCount,u=this.token;if(n!==this.mode){let m=Bi[this.mode][n];u=xa(u,m&65535,m>>16),l+=m>>16}let d=n===ur?4:5;return u=xa(u,o,d),new Cr(u,n,0,l+d)}shiftAndAppend(n,o){let l=this.token,u=this.mode===ur?4:5;return l=xa(l,oo[this.mode][n],u),l=xa(l,o,5),new Cr(l,this.mode,0,this.bitCount+u+5)}addBinaryShiftChar(n){let o=this.token,l=this.mode,u=this.bitCount;if(this.mode===Ar||this.mode===ur){let p=Bi[l][vi];o=xa(o,p&65535,p>>16),u+=p>>16,l=vi}let d=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,m=new Cr(o,l,this.binaryShiftByteCount+1,u+d);return m.binaryShiftByteCount===2078&&(m=m.endBinaryShift(n+1)),m}endBinaryShift(n){if(this.binaryShiftByteCount===0)return this;let o=this.token;return o=fc(o,n-this.binaryShiftByteCount,this.binaryShiftByteCount),new Cr(o,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(n){let o=this.bitCount+(Bi[this.mode][n.mode]>>16);return this.binaryShiftByteCount<n.binaryShiftByteCount?o+=Cr.calculateBinaryShiftCost(n)-Cr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>n.binaryShiftByteCount&&n.binaryShiftByteCount>0&&(o+=10),o<=n.bitCount}toBitArray(n){let o=[];for(let u=this.endBinaryShift(n.length).token;u!==null;u=u.getPrevious())o.unshift(u);let l=new H;for(const u of o)u.appendTo(l,n);return l}toString(){return te.format("%s bits=%d bytes=%d",ya[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(n){return n.binaryShiftByteCount>62?21:n.binaryShiftByteCount>31?20:n.binaryShiftByteCount>0?10:0}}Cr.INITIAL_STATE=new Cr(ao,vi,0,0);function dc(M){const n=te.getCharCode(" "),o=te.getCharCode("."),l=te.getCharCode(",");M[vi][n]=1;const u=te.getCharCode("Z"),d=te.getCharCode("A");for(let z=d;z<=u;z++)M[vi][z]=z-d+2;M[Go][n]=1;const m=te.getCharCode("z"),p=te.getCharCode("a");for(let z=p;z<=m;z++)M[Go][z]=z-p+2;M[ur][n]=1;const w=te.getCharCode("9"),C=te.getCharCode("0");for(let z=C;z<=w;z++)M[ur][z]=z-C+2;M[ur][l]=12,M[ur][o]=13;const N=["\0"," ","","","","","","","\x07","\b"," ",`
268
- `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""];for(let z=0;z<N.length;z++)M[Ws][te.getCharCode(N[z])]=z;const D=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let z=0;z<D.length;z++)te.getCharCode(D[z])>0&&(M[Ar][te.getCharCode(D[z])]=z);return M}const so=dc(Z.createInt32Array(5,256));class ki{constructor(n){this.text=n}encode(){const n=te.getCharCode(" "),o=te.getCharCode(`
269
- `);let l=cc.singletonList(Cr.INITIAL_STATE);for(let d=0;d<this.text.length;d++){let m,p=d+1<this.text.length?this.text[d+1]:0;switch(this.text[d]){case te.getCharCode("\r"):m=p===o?2:0;break;case te.getCharCode("."):m=p===n?3:0;break;case te.getCharCode(","):m=p===n?4:0;break;case te.getCharCode(":"):m=p===n?5:0;break;default:m=0}m>0?(l=ki.updateStateListForPair(l,d,m),d++):l=this.updateStateListForChar(l,d)}return cc.min(l,(d,m)=>d.getBitCount()-m.getBitCount()).toBitArray(this.text)}updateStateListForChar(n,o){const l=[];for(let u of n)this.updateStateForChar(u,o,l);return ki.simplifyStates(l)}updateStateForChar(n,o,l){let u=this.text[o]&255,d=so[n.getMode()][u]>0,m=null;for(let p=0;p<=Ar;p++){let w=so[p][u];if(w>0){if(m==null&&(m=n.endBinaryShift(o)),!d||p===n.getMode()||p===ur){const C=m.latchAndAppend(p,w);l.push(C)}if(!d&&oo[n.getMode()][p]>=0){const C=m.shiftAndAppend(p,w);l.push(C)}}}if(n.getBinaryShiftByteCount()>0||so[n.getMode()][u]===0){let p=n.addBinaryShiftChar(o);l.push(p)}}static updateStateListForPair(n,o,l){const u=[];for(let d of n)this.updateStateForPair(d,o,l,u);return this.simplifyStates(u)}static updateStateForPair(n,o,l,u){let d=n.endBinaryShift(o);if(u.push(d.latchAndAppend(Ar,l)),n.getMode()!==Ar&&u.push(d.shiftAndAppend(Ar,l)),l===3||l===4){let m=d.latchAndAppend(ur,16-l).latchAndAppend(ur,1);u.push(m)}if(n.getBinaryShiftByteCount()>0){let m=n.addBinaryShiftChar(o).addBinaryShiftChar(o+1);u.push(m)}}static simplifyStates(n){let o=[];for(const l of n){let u=!0;for(const d of o){if(d.isBetterThanOrEqualTo(l)){u=!1;break}l.isBetterThanOrEqualTo(d)&&(o=o.filter(m=>m!==d))}u&&o.push(l)}return o}}class ft{constructor(){}static encodeBytes(n){return ft.encode(n,ft.DEFAULT_EC_PERCENT,ft.DEFAULT_AZTEC_LAYERS)}static encode(n,o,l){let u=new ki(n).encode(),d=j.truncDivision(u.getSize()*o,100)+11,m=u.getSize()+d,p,w,C,N,D;if(l!==ft.DEFAULT_AZTEC_LAYERS){if(p=l<0,w=Math.abs(l),w>(p?ft.MAX_NB_BITS_COMPACT:ft.MAX_NB_BITS))throw new x(te.format("Illegal value %s for layers",l));C=ft.totalBitsInLayer(w,p),N=ft.WORD_SIZE[w];let Ae=C-C%N;if(D=ft.stuffBits(u,N),D.getSize()+d>Ae)throw new x("Data to large for user specified layer");if(p&&D.getSize()>N*64)throw new x("Data to large for user specified layer")}else{N=0,D=null;for(let Ae=0;;Ae++){if(Ae>ft.MAX_NB_BITS)throw new x("Data too large for an Aztec code");if(p=Ae<=3,w=p?Ae+1:Ae,C=ft.totalBitsInLayer(w,p),m>C)continue;(D==null||N!==ft.WORD_SIZE[w])&&(N=ft.WORD_SIZE[w],D=ft.stuffBits(u,N));let it=C-C%N;if(!(p&&D.getSize()>N*64)&&D.getSize()+d<=it)break}}let z=ft.generateCheckWords(D,C,N),G=D.getSize()/N,W=ft.generateModeMessage(p,w,G),J=(p?11:14)+w*4,ae=new Int32Array(J),he;if(p){he=J;for(let Ae=0;Ae<ae.length;Ae++)ae[Ae]=Ae}else{he=J+1+2*j.truncDivision(j.truncDivision(J,2)-1,15);let Ae=j.truncDivision(J,2),it=j.truncDivision(he,2);for(let Ke=0;Ke<Ae;Ke++){let sn=Ke+j.truncDivision(Ke,15);ae[Ae-Ke-1]=it-sn-1,ae[Ae+Ke]=it+sn+1}}let Ne=new Te(he);for(let Ae=0,it=0;Ae<w;Ae++){let Ke=(w-Ae)*4+(p?9:12);for(let sn=0;sn<Ke;sn++){let fr=sn*2;for(let Un=0;Un<2;Un++)z.get(it+fr+Un)&&Ne.set(ae[Ae*2+Un],ae[Ae*2+sn]),z.get(it+Ke*2+fr+Un)&&Ne.set(ae[Ae*2+sn],ae[J-1-Ae*2-Un]),z.get(it+Ke*4+fr+Un)&&Ne.set(ae[J-1-Ae*2-Un],ae[J-1-Ae*2-sn]),z.get(it+Ke*6+fr+Un)&&Ne.set(ae[J-1-Ae*2-sn],ae[Ae*2+Un])}it+=Ke*8}if(ft.drawModeMessage(Ne,p,he,W),p)ft.drawBullsEye(Ne,j.truncDivision(he,2),5);else{ft.drawBullsEye(Ne,j.truncDivision(he,2),7);for(let Ae=0,it=0;Ae<j.truncDivision(J,2)-1;Ae+=15,it+=16)for(let Ke=j.truncDivision(he,2)&1;Ke<he;Ke+=2)Ne.set(j.truncDivision(he,2)-it,Ke),Ne.set(j.truncDivision(he,2)+it,Ke),Ne.set(Ke,j.truncDivision(he,2)-it),Ne.set(Ke,j.truncDivision(he,2)+it)}let Se=new pa;return Se.setCompact(p),Se.setSize(he),Se.setLayers(w),Se.setCodeWords(G),Se.setMatrix(Ne),Se}static drawBullsEye(n,o,l){for(let u=0;u<l;u+=2)for(let d=o-u;d<=o+u;d++)n.set(d,o-u),n.set(d,o+u),n.set(o-u,d),n.set(o+u,d);n.set(o-l,o-l),n.set(o-l+1,o-l),n.set(o-l,o-l+1),n.set(o+l,o-l),n.set(o+l,o-l+1),n.set(o+l,o+l-1)}static generateModeMessage(n,o,l){let u=new H;return n?(u.appendBits(o-1,2),u.appendBits(l-1,6),u=ft.generateCheckWords(u,28,4)):(u.appendBits(o-1,5),u.appendBits(l-1,11),u=ft.generateCheckWords(u,40,4)),u}static drawModeMessage(n,o,l,u){let d=j.truncDivision(l,2);if(o)for(let m=0;m<7;m++){let p=d-3+m;u.get(m)&&n.set(p,d-5),u.get(m+7)&&n.set(d+5,p),u.get(20-m)&&n.set(p,d+5),u.get(27-m)&&n.set(d-5,p)}else for(let m=0;m<10;m++){let p=d-5+m+j.truncDivision(m,5);u.get(m)&&n.set(p,d-7),u.get(m+10)&&n.set(d+7,p),u.get(29-m)&&n.set(p,d+7),u.get(39-m)&&n.set(d-7,p)}}static generateCheckWords(n,o,l){let u=n.getSize()/l,d=new ro(ft.getGF(l)),m=j.truncDivision(o,l),p=ft.bitsToWords(n,l,m);d.encode(p,m-u);let w=o%l,C=new H;C.appendBits(0,w);for(const N of Array.from(p))C.appendBits(N,l);return C}static bitsToWords(n,o,l){let u=new Int32Array(l),d,m;for(d=0,m=n.getSize()/o;d<m;d++){let p=0;for(let w=0;w<o;w++)p|=n.get(d*o+w)?1<<o-w-1:0;u[d]=p}return u}static getGF(n){switch(n){case 4:return xt.AZTEC_PARAM;case 6:return xt.AZTEC_DATA_6;case 8:return xt.AZTEC_DATA_8;case 10:return xt.AZTEC_DATA_10;case 12:return xt.AZTEC_DATA_12;default:throw new x("Unsupported word size "+n)}}static stuffBits(n,o){let l=new H,u=n.getSize(),d=(1<<o)-2;for(let m=0;m<u;m+=o){let p=0;for(let w=0;w<o;w++)(m+w>=u||n.get(m+w))&&(p|=1<<o-1-w);(p&d)===d?(l.appendBits(p&d,o),m--):(p&d)===0?(l.appendBits(p|1,o),m--):l.appendBits(p,o)}return l}static totalBitsInLayer(n,o){return((o?88:112)+16*n)*n}}ft.DEFAULT_EC_PERCENT=33,ft.DEFAULT_AZTEC_LAYERS=0,ft.MAX_NB_BITS=32,ft.MAX_NB_BITS_COMPACT=4,ft.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 lo{encode(n,o,l,u){return this.encodeWithHints(n,o,l,u,null)}encodeWithHints(n,o,l,u,d){let m=io.ISO_8859_1,p=ft.DEFAULT_EC_PERCENT,w=ft.DEFAULT_AZTEC_LAYERS;return d!=null&&(d.has(gn.CHARACTER_SET)&&(m=lc.forName(d.get(gn.CHARACTER_SET).toString())),d.has(gn.ERROR_CORRECTION)&&(p=j.parseInt(d.get(gn.ERROR_CORRECTION).toString())),d.has(gn.AZTEC_LAYERS)&&(w=j.parseInt(d.get(gn.AZTEC_LAYERS).toString()))),lo.encodeLayers(n,o,l,u,m,p,w)}static encodeLayers(n,o,l,u,d,m,p){if(o!==Ce.AZTEC)throw new x("Can only encode AZTEC, but got "+o);let w=ft.encode(te.getBytes(n,d),m,p);return lo.renderResult(w,l,u)}static renderResult(n,o,l){let u=n.getMatrix();if(u==null)throw new or;let d=u.getWidth(),m=u.getHeight(),p=Math.max(o,d),w=Math.max(l,m),C=Math.min(p/d,w/m),N=(p-d*C)/2,D=(w-m*C)/2,z=new Te(p,w);for(let G=0,W=D;G<m;G++,W+=C)for(let J=0,ae=N;J<d;J++,ae+=C)u.get(J,G)&&z.setRegion(ae,W,C,C);return z}}a.AbstractExpandedDecoder=dn,a.ArgumentException=T,a.ArithmeticException=ia,a.AztecCode=pa,a.AztecCodeReader=Do,a.AztecCodeWriter=lo,a.AztecDecoder=Nt,a.AztecDetector=zs,a.AztecDetectorResult=Jl,a.AztecEncoder=ft,a.AztecHighLevelEncoder=ki,a.AztecPoint=Pn,a.BarcodeFormat=Ce,a.Binarizer=I,a.BinaryBitmap=S,a.BitArray=H,a.BitMatrix=Te,a.BitSource=_r,a.BrowserAztecCodeReader=hf,a.BrowserBarcodeReader=gf,a.BrowserCodeReader=Re,a.BrowserDatamatrixCodeReader=Lo,a.BrowserMultiFormatReader=sc,a.BrowserPDF417Reader=xf,a.BrowserQRCodeReader=yf,a.BrowserQRCodeSvgWriter=Mi,a.CharacterSetECI=Y,a.ChecksumException=R,a.Code128Reader=Oe,a.Code39Reader=Dt,a.DataMatrixDecodedBitStreamParser=$r,a.DataMatrixReader=ei,a.DecodeHintType=Q,a.DecoderResult=pt,a.DefaultGridSampler=Ps,a.DetectorResult=Mo,a.EAN13Reader=Lr,a.EncodeHintType=gn,a.Exception=b,a.FormatException=X,a.GenericGF=xt,a.GenericGFPoly=Tn,a.GlobalHistogramBinarizer=re,a.GridSampler=Ls,a.GridSamplerInstance=vr,a.HTMLCanvasElementLuminanceSource=qe,a.HybridBinarizer=xe,a.ITFReader=et,a.IllegalArgumentException=x,a.IllegalStateException=or,a.InvertedLuminanceSource=He,a.LuminanceSource=Me,a.MathUtils=ot,a.MultiFormatOneDReader=br,a.MultiFormatReader=oc,a.MultiFormatWriter=wf,a.NotFoundException=ie,a.OneDReader=jt,a.PDF417DecodedBitStreamParser=ge,a.PDF417DecoderErrorCorrection=ni,a.PDF417Reader=In,a.PDF417ResultMetadata=ga,a.PerspectiveTransform=sr,a.PlanarYUVLuminanceSource=Fr,a.QRCodeByteMatrix=Vo,a.QRCodeDataMask=$n,a.QRCodeDecodedBitStreamParser=Pt,a.QRCodeDecoderErrorCorrectionLevel=at,a.QRCodeDecoderFormatInformation=yn,a.QRCodeEncoder=Ut,a.QRCodeEncoderQRCode=Ii,a.QRCodeMaskUtil=Qt,a.QRCodeMatrixUtil=Ze,a.QRCodeMode=Fe,a.QRCodeReader=ti,a.QRCodeVersion=Pe,a.QRCodeWriter=ma,a.RGBLuminanceSource=qs,a.RSS14Reader=St,a.RSSExpandedReader=Ee,a.ReaderException=jo,a.ReedSolomonDecoder=Ni,a.ReedSolomonEncoder=ro,a.ReedSolomonException=ar,a.Result=Ie,a.ResultMetadataType=Qe,a.ResultPoint=ke,a.StringUtils=te,a.UnsupportedOperationException=we,a.VideoInputDevice=K,a.WhiteRectangleDetector=en,a.WriterException=Tt,a.ZXingArrays=Z,a.ZXingCharset=lc,a.ZXingInteger=j,a.ZXingStandardCharsets=io,a.ZXingStringBuilder=pe,a.ZXingStringEncoding=le,a.ZXingSystem=B,a.createAbstractExpandedDecoder=sa,Object.defineProperty(a,"__esModule",{value:!0})}))})(Ul,Ul.exports)),Ul.exports}var qt=KN();const QN=Qu(qt),JN=mx({__proto__:null,default:QN},[qt]);var ax=(function(){function e(r,a,s){if(this.formatMap=new Map([[Be.QR_CODE,qt.BarcodeFormat.QR_CODE],[Be.AZTEC,qt.BarcodeFormat.AZTEC],[Be.CODABAR,qt.BarcodeFormat.CODABAR],[Be.CODE_39,qt.BarcodeFormat.CODE_39],[Be.CODE_93,qt.BarcodeFormat.CODE_93],[Be.CODE_128,qt.BarcodeFormat.CODE_128],[Be.DATA_MATRIX,qt.BarcodeFormat.DATA_MATRIX],[Be.MAXICODE,qt.BarcodeFormat.MAXICODE],[Be.ITF,qt.BarcodeFormat.ITF],[Be.EAN_13,qt.BarcodeFormat.EAN_13],[Be.EAN_8,qt.BarcodeFormat.EAN_8],[Be.PDF_417,qt.BarcodeFormat.PDF_417],[Be.RSS_14,qt.BarcodeFormat.RSS_14],[Be.RSS_EXPANDED,qt.BarcodeFormat.RSS_EXPANDED],[Be.UPC_A,qt.BarcodeFormat.UPC_A],[Be.UPC_E,qt.BarcodeFormat.UPC_E],[Be.UPC_EAN_EXTENSION,qt.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!JN)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=a,this.logger=s;var f=this.createZXingFormats(r),g=new Map;g.set(qt.DecodeHintType.POSSIBLE_FORMATS,f),g.set(qt.DecodeHintType.TRY_HARDER,!1),this.hints=g}return e.prototype.decodeAsync=function(r){var a=this;return new Promise(function(s,f){try{s(a.decode(r))}catch(g){f(g)}})},e.prototype.decode=function(r){var a=new qt.MultiFormatReader(this.verbose,this.hints),s=new qt.HTMLCanvasElementLuminanceSource(r),f=new qt.BinaryBitmap(new qt.HybridBinarizer(s)),g=a.decode(f);return{text:g.text,format:hw.create(this.toHtml5QrcodeSupportedFormats(g.format)),debugData:this.createDebugData()}},e.prototype.createReverseFormatMap=function(){var r=new Map;return this.formatMap.forEach(function(a,s,f){r.set(a,s)}),r},e.prototype.toHtml5QrcodeSupportedFormats=function(r){if(!this.reverseFormatMap.has(r))throw"reverseFormatMap doesn't have ".concat(r);return this.reverseFormatMap.get(r)},e.prototype.createZXingFormats=function(r){for(var a=[],s=0,f=r;s<f.length;s++){var g=f[s];this.formatMap.has(g)?a.push(this.formatMap.get(g)):this.logger.logError("".concat(g," is not supported by")+"ZXingHtml5QrcodeShim")}return a},e.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},e})(),$N=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},e5=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},ox=(function(){function e(r,a,s){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(),!e.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=a,this.logger=s;var f=this.createBarcodeDetectorFormats(r);if(this.detector=new BarcodeDetector(f),!this.detector)throw"BarcodeDetector detector not supported"}return e.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var r=new BarcodeDetector({formats:["qr_code"]});return typeof r<"u"},e.prototype.decodeAsync=function(r){return $N(this,void 0,void 0,function(){var a,s;return e5(this,function(f){switch(f.label){case 0:return[4,this.detector.detect(r)];case 1:if(a=f.sent(),!a||a.length===0)throw"No barcode or QR code detected.";return s=this.selectLargestBarcode(a),[2,{text:s.rawValue,format:hw.create(this.toHtml5QrcodeSupportedFormats(s.format)),debugData:this.createDebugData()}]}})})},e.prototype.selectLargestBarcode=function(r){for(var a=null,s=0,f=0,g=r;f<g.length;f++){var y=g[f],E=y.boundingBox.width*y.boundingBox.height;E>s&&(s=E,a=y)}if(!a)throw"No largest barcode found";return a},e.prototype.createBarcodeDetectorFormats=function(r){for(var a=[],s=0,f=r;s<f.length;s++){var g=f[s];this.formatMap.has(g)?a.push(this.formatMap.get(g)):this.logger.warn("".concat(g," is not supported by")+"BarcodeDetectorDelegate")}return{formats:a}},e.prototype.toHtml5QrcodeSupportedFormats=function(r){if(!this.reverseFormatMap.has(r))throw"reverseFormatMap doesn't have ".concat(r);return this.reverseFormatMap.get(r)},e.prototype.createReverseFormatMap=function(){var r=new Map;return this.formatMap.forEach(function(a,s,f){r.set(a,s)}),r},e.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},e})(),sx=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},lx=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},t5=(function(){function e(r,a,s,f){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=s,a&&ox.isSupported()?(this.primaryDecoder=new ox(r,s,f),this.secondaryDecoder=new ax(r,s,f)):this.primaryDecoder=new ax(r,s,f)}return e.prototype.decodeAsync=function(r){return sx(this,void 0,void 0,function(){var a;return lx(this,function(s){switch(s.label){case 0:a=performance.now(),s.label=1;case 1:return s.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(r)];case 2:return[2,s.sent()];case 3:return this.possiblyLogPerformance(a),[7];case 4:return[2]}})})},e.prototype.decodeRobustlyAsync=function(r){return sx(this,void 0,void 0,function(){var a,s;return lx(this,function(f){switch(f.label){case 0:a=performance.now(),f.label=1;case 1:return f.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(r)];case 2:return[2,f.sent()];case 3:if(s=f.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(r)];throw s;case 4:return this.possiblyLogPerformance(a),[7];case 5:return[2]}})})},e.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},e.prototype.possiblyLogPerformance=function(r){if(this.verbose){var a=performance.now()-r;this.executionResults.push(a),this.executions++,this.possiblyFlushPerformanceReport()}},e.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var r=0,a=0,s=this.executionResults;a<s.length;a++){var f=s[a];r+=f}var g=r/this.executionResults.length;console.log("".concat(g," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},e})(),c1=(function(){var e=function(r,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(s[g]=f[g])},e(r,a)};return function(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(r,a);function s(){this.constructor=r}r.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),Wu=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},Ku=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},mw=(function(){function e(r,a){this.name=r,this.track=a}return e.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},e.prototype.apply=function(r){var a={};a[this.name]=r;var s={advanced:[a]};return this.track.applyConstraints(s)},e.prototype.value=function(){var r=this.track.getSettings();if(this.name in r){var a=r[this.name];return a}return null},e})(),n5=(function(e){c1(r,e);function r(a,s){return e.call(this,a,s)||this}return r.prototype.min=function(){return this.getCapabilities().min},r.prototype.max=function(){return this.getCapabilities().max},r.prototype.step=function(){return this.getCapabilities().step},r.prototype.apply=function(a){var s={};s[this.name]=a;var f={advanced:[s]};return this.track.applyConstraints(f)},r.prototype.getCapabilities=function(){this.failIfNotSupported();var a=this.track.getCapabilities(),s=a[this.name];return{min:s.min,max:s.max,step:s.step}},r.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},r})(mw),r5=(function(e){c1(r,e);function r(a){return e.call(this,"zoom",a)||this}return r})(n5),i5=(function(e){c1(r,e);function r(a){return e.call(this,"torch",a)||this}return r})(mw),a5=(function(){function e(r){this.track=r}return e.prototype.zoomFeature=function(){return new r5(this.track)},e.prototype.torchFeature=function(){return new i5(this.track)},e})(),o5=(function(){function e(r,a,s){this.isClosed=!1,this.parentElement=r,this.mediaStream=a,this.callbacks=s,this.surface=this.createVideoElement(this.parentElement.clientWidth),r.append(this.surface)}return e.prototype.createVideoElement=function(r){var a=document.createElement("video");return a.style.width="".concat(r,"px"),a.style.display="block",a.muted=!0,a.setAttribute("muted","true"),a.playsInline=!0,a},e.prototype.setupSurface=function(){var r=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var a=function(){var s=r.surface.clientWidth,f=r.surface.clientHeight;r.callbacks.onRenderSurfaceReady(s,f),r.surface.removeEventListener("playing",a)};this.surface.addEventListener("playing",a),this.surface.srcObject=this.mediaStream,this.surface.play()},e.create=function(r,a,s,f){return Wu(this,void 0,void 0,function(){var g,y;return Ku(this,function(E){switch(E.label){case 0:return g=new e(r,a,f),s.aspectRatio?(y={aspectRatio:s.aspectRatio},[4,g.getFirstTrackOrFail().applyConstraints(y)]):[3,2];case 1:E.sent(),E.label=2;case 2:return g.setupSurface(),[2,g]}})})},e.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},e.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},e.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},e.prototype.resume=function(r){this.failIfClosed();var a=this,s=function(){setTimeout(r,200),a.surface.removeEventListener("playing",s)};this.surface.addEventListener("playing",s),this.surface.play()},e.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},e.prototype.getSurface=function(){return this.failIfClosed(),this.surface},e.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},e.prototype.applyVideoConstraints=function(r){return Wu(this,void 0,void 0,function(){return Ku(this,function(a){if("aspectRatio"in r)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(r)]})})},e.prototype.close=function(){if(this.isClosed)return Promise.resolve();var r=this;return new Promise(function(a,s){var f=r.mediaStream.getVideoTracks(),g=f.length,y=0;r.mediaStream.getVideoTracks().forEach(function(E){r.mediaStream.removeTrack(E),E.stop(),++y,y>=g&&(r.isClosed=!0,r.parentElement.removeChild(r.surface),a())})})},e.prototype.getCapabilities=function(){return new a5(this.getFirstTrackOrFail())},e})(),s5=(function(){function e(r){this.mediaStream=r}return e.prototype.render=function(r,a,s){return Wu(this,void 0,void 0,function(){return Ku(this,function(f){return[2,o5.create(r,this.mediaStream,a,s)]})})},e.create=function(r){return Wu(this,void 0,void 0,function(){var a,s;return Ku(this,function(f){switch(f.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return a={audio:!1,video:r},[4,navigator.mediaDevices.getUserMedia(a)];case 1:return s=f.sent(),[2,new e(s)]}})})},e})(),cx=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},ux=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},l5=(function(){function e(){}return e.failIfNotSupported=function(){return cx(this,void 0,void 0,function(){return ux(this,function(r){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new e]})})},e.prototype.create=function(r){return cx(this,void 0,void 0,function(){return ux(this,function(a){return[2,s5.create(r)]})})},e})(),c5=function(e,r,a,s){function f(g){return g instanceof a?g:new a(function(y){y(g)})}return new(a||(a=Promise))(function(g,y){function E(T){try{b(s.next(T))}catch(x){y(x)}}function A(T){try{b(s.throw(T))}catch(x){y(x)}}function b(T){T.done?g(T.value):f(T.value).then(E,A)}b((s=s.apply(e,r||[])).next())})},u5=function(e,r){var a={label:0,sent:function(){if(g[0]&1)throw g[1];return g[1]},trys:[],ops:[]},s,f,g,y;return y={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function E(b){return function(T){return A([b,T])}}function A(b){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,b[0]&&(a=0)),a;)try{if(s=1,f&&(g=b[0]&2?f.return:b[0]?f.throw||((g=f.return)&&g.call(f),0):f.next)&&!(g=g.call(f,b[1])).done)return g;switch(f=0,g&&(b=[b[0]&2,g.value]),b[0]){case 0:case 1:g=b;break;case 4:return a.label++,{value:b[1],done:!1};case 5:a.label++,f=b[1],b=[0];continue;case 7:b=a.ops.pop(),a.trys.pop();continue;default:if(g=a.trys,!(g=g.length>0&&g[g.length-1])&&(b[0]===6||b[0]===2)){a=0;continue}if(b[0]===3&&(!g||b[1]>g[0]&&b[1]<g[3])){a.label=b[1];break}if(b[0]===6&&a.label<g[1]){a.label=g[1],g=b;break}if(g&&a.label<g[2]){a.label=g[2],a.ops.push(b);break}g[2]&&a.ops.pop(),a.trys.pop();continue}b=r.call(e,a)}catch(T){b=[6,T],f=0}finally{s=g=0}if(b[0]&5)throw b[1];return{value:b[0]?b[1]:void 0,done:!0}}},f5=(function(){function e(){}return e.retrieve=function(){if(navigator.mediaDevices)return e.getCamerasFromMediaDevices();var r=MediaStreamTrack;return MediaStreamTrack&&r.getSources?e.getCamerasFromMediaStreamTrack():e.rejectWithError()},e.rejectWithError=function(){var r=Es.unableToQuerySupportedDevices();return e.isHttpsOrLocalhost()||(r=Es.insecureContextCameraQueryError()),Promise.reject(r)},e.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var r=location.host.split(":")[0];return r==="127.0.0.1"||r==="localhost"},e.getCamerasFromMediaDevices=function(){return c5(this,void 0,void 0,function(){var r,a,s,f,g,y,E;return u5(this,function(A){switch(A.label){case 0:return r=function(b){for(var T=b.getVideoTracks(),x=0,S=T;x<S.length;x++){var R=S[x];R.enabled=!1,R.stop(),b.removeTrack(R)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return a=A.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(s=A.sent(),f=[],g=0,y=s;g<y.length;g++)E=y[g],E.kind==="videoinput"&&f.push({id:E.deviceId,label:E.label});return r(a),[2,f]}})})},e.getCamerasFromMediaStreamTrack=function(){return new Promise(function(r,a){var s=function(g){for(var y=[],E=0,A=g;E<A.length;E++){var b=A[E];b.kind==="video"&&y.push({id:b.id,label:b.label})}r(y)},f=MediaStreamTrack;f.getSources(s)})},e})(),un;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.NOT_STARTED=1]="NOT_STARTED",e[e.SCANNING=2]="SCANNING",e[e.PAUSED=3]="PAUSED"})(un||(un={}));var d5=(function(){function e(){this.state=un.NOT_STARTED,this.onGoingTransactionNewState=un.UNKNOWN}return e.prototype.directTransition=function(r){this.failIfTransitionOngoing(),this.validateTransition(r),this.state=r},e.prototype.startTransition=function(r){return this.failIfTransitionOngoing(),this.validateTransition(r),this.onGoingTransactionNewState=r,this},e.prototype.execute=function(){if(this.onGoingTransactionNewState===un.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var r=this.onGoingTransactionNewState;this.onGoingTransactionNewState=un.UNKNOWN,this.directTransition(r)},e.prototype.cancel=function(){if(this.onGoingTransactionNewState===un.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=un.UNKNOWN},e.prototype.getState=function(){return this.state},e.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==un.UNKNOWN)throw"Cannot transition to a new state, already under transition"},e.prototype.validateTransition=function(r){switch(this.state){case un.UNKNOWN:throw"Transition from unknown is not allowed";case un.NOT_STARTED:this.failIfNewStateIs(r,[un.PAUSED]);break;case un.SCANNING:break;case un.PAUSED:break}},e.prototype.failIfNewStateIs=function(r,a){for(var s=0,f=a;s<f.length;s++){var g=f[s];if(r===g)throw"Cannot transition from ".concat(this.state," to ").concat(r)}},e})(),h5=(function(){function e(r){this.stateManager=r}return e.prototype.startTransition=function(r){return this.stateManager.startTransition(r)},e.prototype.directTransition=function(r){this.stateManager.directTransition(r)},e.prototype.getState=function(){return this.stateManager.getState()},e.prototype.canScanFile=function(){return this.stateManager.getState()===un.NOT_STARTED},e.prototype.isScanning=function(){return this.stateManager.getState()!==un.NOT_STARTED},e.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===un.SCANNING},e.prototype.isPaused=function(){return this.stateManager.getState()===un.PAUSED},e})(),g5=(function(){function e(){}return e.create=function(){return new h5(new d5)},e})(),m5=(function(){var e=function(r,a){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,f){s.__proto__=f}||function(s,f){for(var g in f)Object.prototype.hasOwnProperty.call(f,g)&&(s[g]=f[g])},e(r,a)};return function(r,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");e(r,a);function s(){this.constructor=r}r.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)}})(),Mr=(function(e){m5(r,e);function r(){return e!==null&&e.apply(this,arguments)||this}return r.DEFAULT_WIDTH=300,r.DEFAULT_WIDTH_OFFSET=2,r.FILE_SCAN_MIN_HEIGHT=300,r.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,r.MIN_QR_BOX_SIZE=50,r.SHADED_LEFT=1,r.SHADED_RIGHT=2,r.SHADED_TOP=3,r.SHADED_BOTTOM=4,r.SHADED_REGION_ELEMENT_ID="qr-shaded-region",r.VERBOSE=!1,r.BORDER_SHADER_DEFAULT_COLOR="#ffffff",r.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",r})(XN),p5=(function(){function e(r,a){this.logger=a,this.fps=Mr.SCAN_DEFAULT_FPS,r?(r.fps&&(this.fps=r.fps),this.disableFlip=r.disableFlip===!0,this.qrbox=r.qrbox,this.aspectRatio=r.aspectRatio,this.videoConstraints=r.videoConstraints):this.disableFlip=Mr.DEFAULT_DISABLE_FLIP}return e.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?gw.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},e.prototype.isShadedBoxEnabled=function(){return!$i(this.qrbox)},e.create=function(r,a){return new e(r,a)},e})(),fx=(function(){function e(r,a){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(r))throw"HTML Element with id=".concat(r," not found");this.elementId=r,this.verbose=!1;var s;typeof a=="boolean"?this.verbose=a===!0:a&&(s=a,this.verbose=s.verbose===!0,s.experimentalFeatures),this.logger=new qN(this.verbose),this.qrcode=new t5(this.getSupportedFormats(a),this.getUseBarCodeDetectorIfSupported(s),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=g5.create()}return e.prototype.start=function(r,a,s,f){var g=this;if(!r)throw"cameraIdOrConfig is required";if(!s||typeof s!="function")throw"qrCodeSuccessCallback is required and should be a function.";var y;f?y=f:y=this.verbose?this.logger.log:function(){};var E=p5.create(a,this.logger);this.clearElement();var A=!1;E.videoConstraints&&(E.isMediaStreamConstraintsValid()?A=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var b=A,T=document.getElementById(this.elementId);T.clientWidth?T.clientWidth:Mr.DEFAULT_WIDTH,T.style.position="relative",this.shouldScan=!0,this.element=T;var x=this,S=this.stateManagerProxy.startTransition(un.SCANNING);return new Promise(function(R,I){var B=b?E.videoConstraints:x.createVideoConstraints(r);if(!B){S.cancel(),I("videoConstraints should be defined");return}var P={};(!b||E.aspectRatio)&&(P.aspectRatio=E.aspectRatio);var k={onRenderSurfaceReady:function(Z,j){x.setupUi(Z,j,E),x.isScanning=!0,x.foreverScan(E,s,y)}};l5.failIfNotSupported().then(function(Z){Z.create(B).then(function(j){return j.render(g.element,P,k).then(function(H){x.renderedCamera=H,S.execute(),R(null)}).catch(function(H){S.cancel(),I(H)})}).catch(function(j){S.cancel(),I(Es.errorGettingUserMedia(j))})}).catch(function(Z){S.cancel(),I(Es.cameraStreamingNotSupported())})})},e.prototype.pause=function(r){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(un.PAUSED),this.showPausedState(),($i(r)||r!==!0)&&(r=!1),r&&this.renderedCamera&&this.renderedCamera.pause()},e.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 r=this,a=function(){r.stateManagerProxy.directTransition(un.SCANNING),r.hidePausedState()};if(!this.renderedCamera.isPaused()){a();return}this.renderedCamera.resume(function(){a()})},e.prototype.getState=function(){return this.stateManagerProxy.getState()},e.prototype.stop=function(){var r=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var a=this.stateManagerProxy.startTransition(un.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var s=function(){if(r.element){var g=document.getElementById(Mr.SHADED_REGION_ELEMENT_ID);g&&r.element.removeChild(g)}},f=this;return this.renderedCamera.close().then(function(){return f.renderedCamera=null,f.element&&(f.element.removeChild(f.canvasElement),f.canvasElement=null),s(),f.qrRegion&&(f.qrRegion=null),f.context&&(f.context=null),a.execute(),f.hidePausedState(),f.isScanning=!1,Promise.resolve()})},e.prototype.scanFile=function(r,a){return this.scanFileV2(r,a).then(function(s){return s.decodedText})},e.prototype.scanFileV2=function(r,a){var s=this;if(!r||!(r instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if($i(a)&&(a=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(f,g){s.possiblyCloseLastScanImageFile(),s.clearElement(),s.lastScanImageFile=URL.createObjectURL(r);var y=new Image;y.onload=function(){var E=y.width,A=y.height,b=document.getElementById(s.elementId),T=b.clientWidth?b.clientWidth:Mr.DEFAULT_WIDTH,x=Math.max(b.clientHeight?b.clientHeight:A,Mr.FILE_SCAN_MIN_HEIGHT),S=s.computeCanvasDrawConfig(E,A,T,x);if(a){var R=s.createCanvasElement(T,x,"qr-canvas-visible");R.style.display="inline-block",b.appendChild(R);var I=R.getContext("2d");if(!I)throw"Unable to get 2d context from canvas";I.canvas.width=T,I.canvas.height=x,I.drawImage(y,0,0,E,A,S.x,S.y,S.width,S.height)}var B=Mr.FILE_SCAN_HIDDEN_CANVAS_PADDING,P=Math.max(y.width,S.width),k=Math.max(y.height,S.height),Z=P+2*B,j=k+2*B,H=s.createCanvasElement(Z,j);b.appendChild(H);var ee=H.getContext("2d");if(!ee)throw"Unable to get 2d context from canvas";ee.canvas.width=Z,ee.canvas.height=j,ee.drawImage(y,0,0,E,A,B,B,P,k);try{s.qrcode.decodeRobustlyAsync(H).then(function(Q){f(rx.createFromQrcodeResult(Q))}).catch(g)}catch(Q){g("QR code parse error, error = ".concat(Q))}},y.onerror=g,y.onabort=g,y.onstalled=g,y.onsuspend=g,y.src=URL.createObjectURL(r)})},e.prototype.clear=function(){this.clearElement()},e.getCameras=function(){return f5.retrieve()},e.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},e.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},e.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},e.prototype.applyVideoConstraints=function(r){if(r){if(!gw.isMediaStreamConstraintsValid(r,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(r)},e.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},e.prototype.getSupportedFormats=function(r){var a=[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(!r||typeof r=="boolean"||!r.formatsToSupport)return a;if(!Array.isArray(r.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(r.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var s=[],f=0,g=r.formatsToSupport;f<g.length;f++){var y=g[f];ZN(y)?s.push(y):this.logger.warn("Invalid format: ".concat(y," passed in config, ignoring."))}if(s.length===0)throw"None of formatsToSupport match supported values.";return s},e.prototype.getUseBarCodeDetectorIfSupported=function(r){if($i(r))return!0;if(!$i(r.useBarCodeDetectorIfSupported))return r.useBarCodeDetectorIfSupported!==!1;if($i(r.experimentalFeatures))return!0;var a=r.experimentalFeatures;return $i(a.useBarCodeDetectorIfSupported)?!0:a.useBarCodeDetectorIfSupported!==!1},e.prototype.validateQrboxSize=function(r,a,s){var f=this,g=s.qrbox;this.validateQrboxConfig(g);var y=this.toQrdimensions(r,a,g),E=function(b){if(b<Mr.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Mr.MIN_QR_BOX_SIZE,"px.")},A=function(b){return b>r&&(f.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."),b=r),b};E(y.width),E(y.height),y.width=A(y.width)},e.prototype.validateQrboxConfig=function(r){if(typeof r!="number"&&typeof r!="function"&&(r.width===void 0||r.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},e.prototype.toQrdimensions=function(r,a,s){if(typeof s=="number")return{width:s,height:s};if(typeof s=="function")try{return s(r,a)}catch(f){throw new Error("qrbox config was passed as a function but it failed with unknown error"+f)}return s},e.prototype.setupUi=function(r,a,s){s.isShadedBoxEnabled()&&this.validateQrboxSize(r,a,s);var f=$i(s.qrbox)?{width:r,height:a}:s.qrbox;this.validateQrboxConfig(f);var g=this.toQrdimensions(r,a,f);g.height>a&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var y=s.isShadedBoxEnabled()&&g.height<=a,E={x:0,y:0,width:r,height:a},A=y?this.getShadedRegionBounds(r,a,g):E,b=this.createCanvasElement(A.width,A.height),T={willReadFrequently:!0},x=b.getContext("2d",T);x.canvas.width=A.width,x.canvas.height=A.height,this.element.append(b),y&&this.possiblyInsertShadingElement(this.element,r,a,g),this.createScannerPausedUiElement(this.element),this.qrRegion=A,this.context=x,this.canvasElement=b},e.prototype.createScannerPausedUiElement=function(r){var a=document.createElement("div");a.innerText=Es.scannerPaused(),a.style.display="none",a.style.position="absolute",a.style.top="0px",a.style.zIndex="1",a.style.background="rgba(9, 9, 9, 0.46)",a.style.color="#FFECEC",a.style.textAlign="center",a.style.width="100%",r.appendChild(a),this.scannerPausedUiElement=a},e.prototype.scanContext=function(r,a){var s=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(f){return r(f.text,rx.createFromQrcodeResult(f)),s.possiblyUpdateShaders(!0),!0}).catch(function(f){s.possiblyUpdateShaders(!1);var g=Es.codeParseError(f);return a(g,YN.createFrom(g)),!1})},e.prototype.foreverScan=function(r,a,s){var f=this;if(this.shouldScan&&this.renderedCamera){var g=this.renderedCamera.getSurface(),y=g.videoWidth/g.clientWidth,E=g.videoHeight/g.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var A=this.qrRegion.width*y,b=this.qrRegion.height*E,T=this.qrRegion.x*y,x=this.qrRegion.y*E;this.context.drawImage(g,T,x,A,b,0,0,this.qrRegion.width,this.qrRegion.height);var S=function(){f.foreverScanTimeout=setTimeout(function(){f.foreverScan(r,a,s)},f.getTimeoutFps(r.fps))};this.scanContext(a,s).then(function(R){!R&&r.disableFlip!==!0?(f.context.translate(f.context.canvas.width,0),f.context.scale(-1,1),f.scanContext(a,s).finally(function(){S()})):S()}).catch(function(R){f.logger.logError("Error happend while scanning context",R),S()})}},e.prototype.createVideoConstraints=function(r){if(typeof r=="string")return{deviceId:{exact:r}};if(typeof r=="object"){var a="facingMode",s="deviceId",f={user:!0,environment:!0},g="exact",y=function(I){if(I in f)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(I,"'")},E=Object.keys(r);if(E.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(E.length," keys");var A=Object.keys(r)[0];if(A!==a&&A!==s)throw"Only '".concat(a,"' and '").concat(s,"' ")+" are supported for 'cameraIdOrConfig'";if(A===a){var b=r.facingMode;if(typeof b=="string"){if(y(b))return{facingMode:b}}else if(typeof b=="object")if(g in b){if(y(b["".concat(g)]))return{facingMode:{exact:b["".concat(g)]}}}else throw"'facingMode' should be string or object with"+" ".concat(g," as key.");else{var T=typeof b;throw"Invalid type of 'facingMode' = ".concat(T)}}else{var x=r.deviceId;if(typeof x=="string")return{deviceId:x};if(typeof x=="object"){if(g in x)return{deviceId:{exact:x["".concat(g)]}};throw"'deviceId' should be string or object with"+" ".concat(g," as key.")}else{var S=typeof x;throw"Invalid type of 'deviceId' = ".concat(S)}}}var R=typeof r;throw"Invalid type of 'cameraIdOrConfig' = ".concat(R)},e.prototype.computeCanvasDrawConfig=function(r,a,s,f){if(r<=s&&a<=f){var g=(s-r)/2,y=(f-a)/2;return{x:g,y,width:r,height:a}}else{var E=r,A=a;return r>s&&(a=s/r*a,r=s),a>f&&(r=f/a*r,a=f),this.logger.log("Image downsampled from "+"".concat(E,"X").concat(A)+" to ".concat(r,"X").concat(a,".")),this.computeCanvasDrawConfig(r,a,s,f)}},e.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var r=document.getElementById(this.elementId);r&&(r.innerHTML="")},e.prototype.possiblyUpdateShaders=function(r){this.qrMatch!==r&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(a){a.style.backgroundColor=r?Mr.BORDER_SHADER_MATCH_COLOR:Mr.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=r)},e.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},e.prototype.createCanvasElement=function(r,a,s){var f=r,g=a,y=document.createElement("canvas");return y.style.width="".concat(f,"px"),y.style.height="".concat(g,"px"),y.style.display="none",y.id=$i(s)?"qr-canvas":s,y},e.prototype.getShadedRegionBounds=function(r,a,s){if(s.width>r||s.height>a)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(r-s.width)/2,y:(a-s.height)/2,width:s.width,height:s.height}},e.prototype.possiblyInsertShadingElement=function(r,a,s,f){if(!(a-f.width<1||s-f.height<1)){var g=document.createElement("div");g.style.position="absolute";var y=(a-f.width)/2,E=(s-f.height)/2;if(g.style.borderLeft="".concat(y,"px solid rgba(0, 0, 0, 0.48)"),g.style.borderRight="".concat(y,"px solid rgba(0, 0, 0, 0.48)"),g.style.borderTop="".concat(E,"px solid rgba(0, 0, 0, 0.48)"),g.style.borderBottom="".concat(E,"px solid rgba(0, 0, 0, 0.48)"),g.style.boxSizing="border-box",g.style.top="0px",g.style.bottom="0px",g.style.left="0px",g.style.right="0px",g.id="".concat(Mr.SHADED_REGION_ELEMENT_ID),a-f.width<11||s-f.height<11)this.hasBorderShaders=!1;else{var A=5,b=40;this.insertShaderBorders(g,b,A,-A,null,0,!0),this.insertShaderBorders(g,b,A,-A,null,0,!1),this.insertShaderBorders(g,b,A,null,-A,0,!0),this.insertShaderBorders(g,b,A,null,-A,0,!1),this.insertShaderBorders(g,A,b+A,-A,null,-A,!0),this.insertShaderBorders(g,A,b+A,null,-A,-A,!0),this.insertShaderBorders(g,A,b+A,-A,null,-A,!1),this.insertShaderBorders(g,A,b+A,null,-A,-A,!1),this.hasBorderShaders=!0}r.append(g)}},e.prototype.insertShaderBorders=function(r,a,s,f,g,y,E){var A=document.createElement("div");A.style.position="absolute",A.style.backgroundColor=Mr.BORDER_SHADER_DEFAULT_COLOR,A.style.width="".concat(a,"px"),A.style.height="".concat(s,"px"),f!==null&&(A.style.top="".concat(f,"px")),g!==null&&(A.style.bottom="".concat(g,"px")),E?A.style.left="".concat(y,"px"):A.style.right="".concat(y,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(A),r.appendChild(A)},e.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},e.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},e.prototype.getTimeoutFps=function(r){return 1e3/r},e})(),dx;(function(e){e[e.STATUS_DEFAULT=0]="STATUS_DEFAULT",e[e.STATUS_SUCCESS=1]="STATUS_SUCCESS",e[e.STATUS_WARNING=2]="STATUS_WARNING",e[e.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(dx||(dx={}));const x5=e=>{try{const s=new URL(e).searchParams.get("room");if(s){const f=An.safeParse(s.toUpperCase());if(f.success)return f.data}}catch{}const r=An.safeParse(e.trim().toUpperCase());return r.success?r.data:null},y5=({isOpen:e,onClose:r,onScan:a,currentRoomId:s})=>{const[f,g]=L.useState(""),[y,E]=L.useState(!1),[A,b]=L.useState(""),[T,x]=L.useState(!1),S=L.useRef(null),R=L.useRef(null),I=L.useRef(!1);L.useEffect(()=>{if(e&&!I.current){const H=s||"";setTimeout(()=>{var ee,Q;E(!1),g(H),(ee=R.current)==null||ee.focus(),(Q=R.current)==null||Q.select()},0)}I.current=e},[e,s]),L.useEffect(()=>{(async()=>{const ee=f.trim().toUpperCase(),Q=An.safeParse(ee);if(Q.success)try{const X=await Dv.buildControllerUrl(Q.data);b(X)}catch{b("")}else b("")})()},[f]),L.useEffect(()=>{if(!e&&(setTimeout(()=>{E(!1)},0),S.current)){const H=S.current;H.stop().catch(()=>{}).finally(()=>{try{H.clear()}catch{}}),S.current=null}},[e]),L.useEffect(()=>{if(!e)return;const H="qr-reader";let ee=null,Q=!1,X=!0;const de=async()=>{var we;try{const le=document.getElementById(H);if(!le)return;const te=le.getBoundingClientRect();if(te.width===0||te.height===0)return;ee=new fx(H),S.current=ee;let pe=null;try{const ie=await fx.getCameras();if(ie&&ie.length>0){const re=ie.find(Me=>Me.label.toLowerCase().includes("back")||Me.label.toLowerCase().includes("rear"));pe=((we=ie.find(Me=>{const He=Me.label.toLowerCase();return He.includes("environment")||He.includes("facing back")})||re||ie[0])==null?void 0:we.id)||null}}catch{}const Te=pe?{deviceId:{exact:pe}}:{facingMode:"environment"};await ee.start(Te,{fps:10,qrbox:(ie,re)=>{const xe=Math.min(ie,re),Me=Math.min(250,xe*.8);return{width:Me,height:Me}},aspectRatio:1},ie=>{if(!X)return;const re=x5(ie);re&&(g(re),Q=!1,ee==null||ee.stop().catch(()=>{}).finally(()=>{X&&E(!1)}))},()=>{}),Q=!0,X&&E(!0)}catch{if(X&&E(!1),ee)try{ee.clear()}catch{}S.current=null}},Y=setTimeout(()=>{de()},200);return()=>{if(X=!1,clearTimeout(Y),ee&&Q)ee.stop().catch(()=>{}).finally(()=>{try{ee==null||ee.clear()}catch{}});else if(ee)try{ee.clear()}catch{}S.current=null}},[e]);const B=()=>{const H=f.trim().toUpperCase(),ee=An.safeParse(H);ee.success&&(a(ee.data),r())},P=H=>{H.target.select()},k=H=>{g(H.target.value.toUpperCase()),x(!1)},Z=async()=>{if(A)try{await navigator.clipboard.writeText(A),x(!0),setTimeout(()=>x(!1),2e3)}catch{const H=document.createElement("textarea");H.value=A,H.style.position="fixed",H.style.opacity="0",document.body.appendChild(H),H.select();try{document.execCommand("copy"),x(!0),setTimeout(()=>x(!1),2e3)}catch{}document.body.removeChild(H)}};if(!e)return null;const j=f.trim().length>0;return F.jsxs("div",{className:"bg-background fixed inset-0 z-50 flex flex-col items-center justify-center",children:[F.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center",children:[y&&F.jsx("div",{className:"relative flex aspect-square w-full items-center justify-center overflow-hidden p-6",children:F.jsx("div",{id:"qr-reader",className:"h-full w-full overflow-hidden rounded-lg bg-black"})}),F.jsx("div",{className:"w-full max-w-md px-6",children:F.jsx("input",{ref:R,type:"text",value:f,onChange:k,onFocus:P,onKeyDown:H=>{H.key==="Enter"&&j&&B()},placeholder:"Enter room code",className:"border-border bg-background focus:ring-primary focus:border-primary w-full rounded-lg border-2 px-6 py-4 text-center font-mono text-2xl focus:ring-2 focus:outline-none",autoComplete:"off",autoCapitalize:"characters"})}),A&&F.jsx("div",{className:"mt-4 w-full max-w-md px-6 pb-2",children:F.jsx("button",{type:"button",onClick:Z,className:"text-muted-foreground hover:text-foreground bg-muted/50 hover:bg-muted w-full rounded-lg px-4 py-3 text-center font-mono text-xs break-all transition-colors",children:T?"✓ Copied!":A})})]}),F.jsxs("div",{className:"flex w-full max-w-md gap-4 px-6 pb-6",children:[F.jsx(Br,{type:"button",variant:"outline",onClick:r,className:"flex-1 py-6",children:"Cancel"}),F.jsx(Br,{type:"button",onClick:B,disabled:!j,className:"flex-1 py-6",children:"Connect"})]})]})},hx=e=>{switch(e){case"connected":return"Connected to host";case"connecting":return"Connecting…";case"reconnecting":return"Trying to reconnect…";case"disconnected":return"Disconnected";case"idle":default:return"Idle"}},v5=e=>!e||typeof window>"u"||!window.matchMedia?!0:window.matchMedia(`(orientation: ${e})`).matches,w5=({roomId:e,connectionStatus:r,forceOrientation:a,children:s,gameState:f="paused",onTogglePlayPause:g,onReconnect:y,onRefresh:E,customActions:A})=>{const b=L.useMemo(()=>a1()==="platform",[]),[T,x]=L.useState(()=>v5(a)),[S,R]=L.useState(!1),{isFullscreen:I,toggleFullscreen:B}=GN(),{store:P}=ql(),{controllerId:k,players:Z}=Ao(P,ef(Q=>({controllerId:Q.controllerId,players:Q.players}))),j=L.useMemo(()=>{if(!k)return null;const Q=Z.find(X=>X.id===k);return!Q&&r==="connected"&&Z.length>0,Q||null},[k,Z,r]);L.useEffect(()=>{if(!a){x(!0);return}const Q=window.matchMedia(`(orientation: ${a})`),X=()=>x(Q.matches);return X(),Q.addEventListener("change",X),()=>Q.removeEventListener("change",X)},[a]);const H=a?T:!0,ee=L.useMemo(()=>{switch(r){case"connected":return"bg-green-500";case"connecting":case"reconnecting":return"bg-yellow-500";case"disconnected":default:return"bg-red-500"}},[r]);return b?F.jsx("div",{className:"dark",children:F.jsx("div",{className:"text-foreground relative flex h-dvh w-dvw touch-none flex-col overflow-hidden bg-transparent select-none",children:F.jsxs("main",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden p-2 select-none sm:p-4",children:[!H&&F.jsxs("div",{className:"bg-background/95 absolute inset-0 z-50 flex flex-col items-center justify-center p-6 text-center shadow-lg backdrop-blur-sm",children:[F.jsx("p",{className:"text-card-foreground text-xl font-semibold",children:"Rotate your device"}),F.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["This game is best experienced in ",a," ","orientation."]})]}),F.jsx("div",{className:Wt("h-full w-full select-none",!H&&"pointer-events-none opacity-30"),children:s})]})})}):F.jsx("div",{className:"dark",children:F.jsxs("div",{className:"bg-background text-foreground relative flex h-dvh w-dvw touch-none flex-col overflow-hidden select-none",children:[F.jsxs("header",{className:"pointer-events-none sticky top-0 z-50 flex items-center justify-between border-b px-6 py-2",children:[F.jsxs("div",{className:"pointer-events-auto flex items-center gap-3",children:[typeof window<"u"&&(j||k)&&F.jsxs("div",{className:"relative",title:hx(r),children:[j?F.jsx(Co,{player:j,size:"sm"}):k?F.jsx(Co,{player:{id:k,label:"Player"},size:"sm"}):null,F.jsx("span",{className:"absolute right-0 bottom-0 h-3 w-3 rounded-full bg-black","aria-hidden":"true"}),F.jsx("span",{className:Wt("absolute right-0.5 bottom-0.5 h-2 w-2 rounded-full",ee,r==="connected"&&"animate-pulse"),"aria-label":hx(r)})]}),F.jsxs("div",{children:[F.jsx("p",{className:"text-muted-foreground text-xs tracking-[0.24em] uppercase",children:"Room"}),F.jsx("p",{className:"text-foreground text-lg font-semibold",children:typeof window<"u"?e??"N/A":"N/A"})]})]}),F.jsxs("div",{className:"pointer-events-auto flex items-center gap-3",children:[A,E&&e&&F.jsx(Br,{type:"button",variant:"outline",size:"icon",onClick:E,disabled:r==="connecting"||r==="reconnecting","aria-label":"Reconnect",title:"Reconnect to room",children:F.jsx(nA,{className:Wt("h-5 w-5",(r==="connecting"||r==="reconnecting")&&"animate-spin")})}),y&&F.jsx(Br,{type:"button",variant:"outline",size:"icon",onClick:()=>R(!0),"aria-label":"Scan QR code to reconnect",title:"Scan QR code to reconnect",children:F.jsx(oy,{className:"h-5 w-5"})}),g&&F.jsx(Br,{type:"button",variant:"outline",size:"icon",onClick:g,"aria-label":f==="playing"?"Pause":"Play",title:f==="playing"?"Pause":"Play",children:f==="playing"?F.jsx(ay,{className:"h-5 w-5"}):F.jsx(Lu,{className:"h-5 w-5"})}),F.jsx(Br,{type:"button",variant:"outline",size:"icon",onClick:()=>B(),"aria-label":I?"Exit fullscreen":"Enter fullscreen",title:I?"Exit fullscreen":"Enter fullscreen",children:I?F.jsx(YE,{className:"h-5 w-5"}):F.jsx(ZE,{className:"h-5 w-5"})})]})]}),F.jsx("main",{className:"relative flex min-h-0 flex-1 items-center justify-center overflow-hidden p-2 select-none sm:p-4",children:F.jsxs("div",{className:"bg-card/95 absolute inset-0 z-10 flex flex-col items-center justify-center p-6 text-center shadow-lg backdrop-blur-sm",children:[!H&&a&&F.jsxs("div",{className:"bg-background/95 absolute inset-0 z-10 flex flex-col items-center justify-center p-6 text-center shadow-lg backdrop-blur-sm",children:[F.jsx("p",{className:"text-card-foreground text-xl font-semibold",children:"Rotate your device"}),F.jsxs("p",{className:"text-muted-foreground mt-2 text-sm",children:["This game is best experienced in ",a," ","orientation."]})]}),F.jsx("div",{className:Wt("h-full w-full select-none",!H&&"pointer-events-none opacity-30"),children:s})]})}),y&&F.jsx(y5,{isOpen:S,onClose:()=>R(!1),onScan:Q=>{y(Q),R(!1)},currentRoomId:e})]})})},gx="ABCDEFGHJKLMNPQRSTUVWXYZ23456789",b5=()=>{const e=Math.floor(Date.now()%1e5).toString().padStart(5,"0");return`C${gx[Math.floor(Math.random()*gx.length)]}${e}`},_5=()=>{if(typeof window>"u")return null;const r=new URLSearchParams(window.location.search).get("room");return r?r.toUpperCase():null},E5=(e={})=>{const{store:r,getSocket:a,disconnectSocket:s}=ql(),f=L.useRef(e.nickname??""),g=L.useMemo(()=>{if(typeof window>"u")return null;const H=new URLSearchParams(window.location.search),ee=H.get("aj_room"),Q=H.get("aj_controller_id");return ee&&Q?{room:ee,controllerId:Q}:null},[]),y=L.useMemo(()=>{const H=(g==null?void 0:g.room)??e.roomId??_5();if(!H)return null;try{return An.parse(H.toUpperCase())}catch{return null}},[e.roomId,g]),E=L.useMemo(()=>{if(g!=null&&g.controllerId)return g.controllerId;if(e.controllerId)return e.controllerId;if(typeof window<"u"){const ee=new URLSearchParams(window.location.search).get("controllerId");if(ee)return ee}return b5()},[e.controllerId,g]),A=L.useRef(e.onState);L.useEffect(()=>{A.current=e.onState},[e.onState]);const b=Ao(r,ef(H=>({connectionStatus:H.connectionStatus,lastError:H.lastError,controllerId:H.controllerId,players:H.players,gameState:H.gameState,stateMessage:H.stateMessage}))),[T,x]=L.useState(0),S=L.useCallback(()=>{y&&(s("controller"),x(H=>H+1))},[y,s]),R=L.useMemo(()=>typeof window>"u"?!1:new URLSearchParams(window.location.search).get("airjam_mode")==="child",[]),I=L.useMemo(()=>e.forceConnect||g?!0:typeof window<"u"?new URLSearchParams(window.location.search).get("airjam_force_connect")==="true":!1,[e.forceConnect,g]),B=L.useMemo(()=>!R||I,[R,I]),P=L.useMemo(()=>B&&y?a("controller"):null,[B,y,a]);L.useEffect(()=>{if(!P)return;const H=ee=>{if(ee.type!=="HAPTIC"||typeof navigator>"u"||!navigator.vibrate)return;const Q=ee.payload;switch(Q.pattern){case"light":navigator.vibrate(10);break;case"medium":navigator.vibrate(30);break;case"heavy":navigator.vibrate([50,20,50]);break;case"success":navigator.vibrate([10,30,10]);break;case"failure":navigator.vibrate([50,50,50,50]);break;case"custom":(Array.isArray(Q.sequence)||typeof Q.sequence=="number")&&navigator.vibrate(Q.sequence);break}};return P.on("server:signal",H),()=>{P.off("server:signal",H)}},[P]),L.useEffect(()=>{const H=r.getState();if(H.setMode(a1()),H.setRole("controller"),H.setRoomId(y),H.setStatus(y?"connecting":"idle"),H.setError(void 0),!B){H.setStatus("connected");const le=te=>{var Te;if(te.source!==window.parent)return;const pe=te.data;if((pe==null?void 0:pe.type)==="AIRJAM_STATE"){const ie=pe.payload;ie.gameState&&H.setGameState(ie.gameState),ie.message!==void 0&&H.setStateMessage(ie.message),(Te=A.current)==null||Te.call(A,ie)}};return window.addEventListener("message",le),window.parent.postMessage({type:"AIRJAM_READY"},"*"),()=>{window.removeEventListener("message",le),H.setStatus("disconnected")}}if(!y||!P||!E){H.setStatus("idle");return}H.setControllerId(E);const ee=()=>{if(r.getState().setStatus("connected"),g)return;const le=FR.parse({roomId:y,controllerId:E,nickname:f.current||void 0});P.emit("controller:join",le,te=>{const pe=r.getState();if(!te.ok){pe.setError(te.message??"Unable to join room"),pe.setStatus("disconnected");return}te.controllerId&&pe.setControllerId(te.controllerId),pe.setStatus("connected")})},Q=()=>{r.getState().setStatus("disconnected")},X=le=>{const te=r.getState(),pe=te.roomId;if(!(pe&&le.roomId.toUpperCase()!==pe.toUpperCase())){if(!pe&&le.roomId&&te.setRoomId(le.roomId),!le.player){te.setError("Welcome message received but no player profile included.");return}te.upsertPlayer(le.player)}},de=le=>{var pe;if(le.roomId!==y)return;const te=r.getState();le.state.gameState&&te.setGameState(le.state.gameState),le.state.message!==void 0&&te.setStateMessage(le.state.message),(pe=A.current)==null||pe.call(A,le.state)},Y=le=>{const te=r.getState();te.setError(le.reason),te.setStatus("disconnected"),te.resetGameState(),setTimeout(()=>{s("controller"),x(pe=>pe+1)},1e3)},we=le=>{r.getState().setError(le.message)};return P.on("connect",ee),P.on("disconnect",Q),P.on("server:welcome",X),P.on("server:state",de),P.on("server:hostLeft",Y),P.on("server:error",we),P.connect(),()=>{P.off("connect",ee),P.off("disconnect",Q),P.off("server:welcome",X),P.off("server:state",de),P.off("server:hostLeft",Y),P.off("server:error",we)}},[y,T,B,P,E,g,r,s]);const k=L.useCallback(H=>{f.current=H},[]),Z=L.useCallback(H=>{const ee=r.getState();if(!B)return typeof window<"u"&&window.parent.postMessage({type:"AIRJAM_INPUT",payload:H},"*"),!0;if(!y||!ee.controllerId||!P)return ee.setError("Not connected to a room"),!1;if(!P.connected)return!1;if(typeof H!="object"||H===null||Array.isArray(H))return ee.setError("Input must be an object"),!1;const Q=zR.safeParse({roomId:y,controllerId:ee.controllerId,input:H});return Q.success?(P.emit("controller:input",Q.data),!0):(ee.setError(Q.error.message),!1)},[y,B,P,r]),j=L.useCallback(H=>{const ee=r.getState();if(!B||!y||!ee.controllerId||!P||!P.connected)return;const Q=Mv.safeParse({roomId:y,command:H});Q.success&&P.emit("controller:system",Q.data)},[y,B,P,r]);return{roomId:y,controllerId:b.controllerId,connectionStatus:b.connectionStatus,lastError:b.lastError,gameState:b.gameState,stateMessage:b.stateMessage,sendInput:Z,sendSystemCommand:j,setNickname:k,reconnect:S,players:b.players,socket:P}};function A5(e){const r=z0((f,g,y)=>{const E=e(f,g,y);return{...E,actions:{...E.actions,_syncState:A=>{f(A)}}}}),a={current:!1};return(f=g=>g)=>{const g=r(f),{getSocket:y}=ql(),E=wh(S=>S.role),A=wh(S=>S.roomId),b=wh(S=>S.controllerId),T=y(E==="host"?"host":"controller"),x=L.useRef(T);if(L.useEffect(()=>{x.current=T},[T]),L.useEffect(()=>{if(!(!T||!A||!E)){if(E==="host"){const S=r.subscribe(I=>{const{actions:B,...P}=I;T.emit("host:state_sync",{roomId:A,data:P})}),R=I=>{const{actionName:B,args:P,controllerId:k}=I,Z=r.getState().actions[B];Z&&Z(...P,k)};return T.on("airjam:action_rpc",R),()=>{S(),T.off("airjam:action_rpc",R)}}if(E==="controller"){a.current=!1;const S=P=>{const{data:k}=P,j=r.getState().actions;j._syncState?j._syncState(k):r.setState(k)};T.on("airjam:state_sync",S);const R=()=>{a.current=!0,T.off("airjam:state_sync",S)},I=()=>{a.current=!1};T.on("client:loadUi",I);const B=()=>{a.current=!0};return T.on("disconnect",B),T.on("client:unloadUi",R),()=>{T.off("airjam:state_sync",S),T.off("client:loadUi",I),T.off("client:unloadUi",R),T.off("disconnect",B)}}}},[T,E,A,T==null?void 0:T.id]),E==="controller"&&T&&A){let S=null;if(typeof g=="object"&&g!==null&&"actions"in g)S=g.actions;else if(typeof g=="object"&&g!==null){const R=r.getState();if(R.actions){const I=Object.keys(g),B=Object.keys(R.actions);I.length>0&&I.every(P=>typeof g[P]=="function"&&B.includes(P))&&(S=g)}}if(S){const R={};return Object.keys(S).forEach(I=>{R[I]=(...B)=>{if(a.current){console.warn(`[AirJamStore] Action "${I}" blocked: Game UI unloaded.`);return}const P=x.current;if(!P||!P.connected){console.warn(`[AirJamStore] Action "${I}" blocked: Socket disconnected.`);return}if(!b){console.warn("[AirJamStore] Cannot send action RPC: controllerId not set");return}P.emit("controller:action_rpc",{roomId:A,actionName:I,args:B,controllerId:b})}}),typeof g=="object"&&g!==null&&"actions"in g?{...g,actions:R}:R}}return g}}const Eo=A5(e=>({scores:{team1:0,team2:0},teamAssignments:{},actions:{joinTeam:(r,a)=>{a&&e(s=>{const f={...s.teamAssignments},g=f[a];if(g&&g.team===r)return s;g&&g.team!==r&&delete f[a];const y=Object.values(f).filter(A=>A.team===r);if(y.length>=2)return s;const E=y.length===0?"front":"back";return f[a]={team:r,position:E},{teamAssignments:f}})},resetGame:()=>e({scores:{team1:0,team2:0},teamAssignments:{}}),scorePoint:r=>e(a=>({scores:{...a.scores,[r]:a.scores[r]+1}}))}})),C5="#f97316",S5="#38bdf8";function T5(){const e=E5(),r=L.useRef(0),a=Eo(y=>y.teamAssignments),s=Eo(y=>y.actions),f=e.controllerId?a[e.controllerId]:null,g=(f==null?void 0:f.team)??null;return L.useEffect(()=>{if(e.connectionStatus!=="connected"||e.gameState!=="playing")return;let y;const E=()=>{e.sendInput({direction:r.current,action:!1}),console.log("directionRef.current",r.current),y=requestAnimationFrame(E)};return E(),()=>cancelAnimationFrame(y)},[e.connectionStatus,e.gameState,e]),F.jsx("div",{className:"relative bg-black",children:F.jsxs(w5,{connectionStatus:e.connectionStatus,roomId:e.roomId,forceOrientation:"portrait",gameState:e.gameState,onTogglePlayPause:()=>e.sendSystemCommand("toggle_pause"),onReconnect:()=>e.reconnect(),onRefresh:()=>window.location.reload(),children:[F.jsx("div",{className:"absolute top-5 right-5 z-50",children:F.jsx(ev,{state:Eo(y=>y),title:"Pong Game State"})}),e.gameState==="paused"?F.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-2",children:[F.jsx("button",{type:"button",className:`flex-1 touch-none rounded-xl text-4xl font-bold text-white shadow-lg select-none hover:opacity-90 active:scale-95 ${g==="team1"?"ring-4 ring-white ring-offset-2 ring-offset-zinc-900":"opacity-70"}`,style:{backgroundColor:g==="team1"?C5:"#3f3f46",willChange:"transform",transition:"none"},onTouchStart:()=>s.joinTeam("team1"),onMouseDown:()=>s.joinTeam("team1"),children:"SOLARIS"}),F.jsx("button",{type:"button",className:`flex-1 touch-none rounded-xl text-4xl font-bold text-white shadow-lg select-none hover:opacity-90 active:scale-95 ${g==="team2"?"ring-4 ring-white ring-offset-2 ring-offset-zinc-900":"opacity-70"}`,style:{backgroundColor:g==="team2"?S5:"#3f3f46",willChange:"transform",transition:"none"},onTouchStart:()=>s.joinTeam("team2"),onMouseDown:()=>s.joinTeam("team2"),children:"NEBULON"})]}):F.jsxs("div",{className:"flex h-full w-full flex-col gap-2 p-2",children:[F.jsx("button",{type:"button",className:"flex-1 touch-none rounded-xl bg-zinc-800 text-4xl font-bold text-white shadow-lg select-none hover:bg-zinc-700 active:scale-95 active:bg-zinc-700",style:{willChange:"transform",transition:"none"},onTouchStart:()=>r.current=-1,onTouchEnd:()=>r.current=0,onMouseDown:()=>r.current=-1,onMouseUp:()=>r.current=0,children:"▲ UP"}),F.jsx("button",{type:"button",className:"flex-1 touch-none rounded-xl bg-zinc-800 text-4xl font-bold text-white shadow-lg select-none hover:bg-zinc-700 active:scale-95 active:bg-zinc-700",style:{willChange:"transform",transition:"none"},onTouchStart:()=>r.current=1,onTouchEnd:()=>r.current=0,onMouseDown:()=>r.current=1,onMouseUp:()=>r.current=0,children:"▼ DOWN"})]})]})})}const xr=1e3,Zn=600,Xn=100,si=15,Ci=30,li=15,Ru=6,Nu=3,l0="#f97316",c0="#38bdf8";function R5(){const e=Bv(),r=L.useRef(null),[a,s]=L.useState(null),f=Eo(b=>b.scores),g=Eo(b=>b.teamAssignments),y=Eo(b=>b.actions),E=L.useRef({paddle1FrontY:Zn/2-Xn/2,paddle1BackY:Zn/2-Xn/2,paddle2FrontY:Zn/2-Xn/2,paddle2BackY:Zn/2-Xn/2,ballX:xr/2,ballY:Zn/2,ballVX:Nu,ballVY:Nu,lastTouchedTeam:null}),A=L.useCallback(()=>{const b=E.current;b.ballX=xr/2,b.ballY=Zn/2,b.ballVX=Nu*(Math.random()>.5?1:-1),b.ballVY=Nu*(Math.random()>.5?1:-1),b.lastTouchedTeam=null},[]);return L.useEffect(()=>{if(a===null||e.gameState!=="playing")return;if(a===0){A(),setTimeout(()=>{s(null)},0);return}const b=setTimeout(()=>{s(a-1)},1e3);return()=>clearTimeout(b)},[a,e.gameState,A]),L.useEffect(()=>{const b=r.current;if(!b)return;const T=b.getContext("2d");if(!T)return;const x=window.devicePixelRatio||1;b.width=xr*x,b.height=Zn*x,b.style.width=`${xr}px`,b.style.height=`${Zn}px`,T.scale(x,x);let S;const R=()=>{const I=E.current,B=e.players;if(e.gameState==="playing"){B.forEach(Y=>{const we=e.getInput(Y.id),le=g[Y.id];if(we&&le){const{team:te,position:pe}=le;te==="team1"&&(pe==="front"?(I.paddle1FrontY+=we.direction*Ru,I.paddle1FrontY=Math.max(0,Math.min(Zn-Xn,I.paddle1FrontY))):(I.paddle1BackY+=we.direction*Ru,I.paddle1BackY=Math.max(0,Math.min(Zn-Xn,I.paddle1BackY)))),te==="team2"&&(pe==="front"?(I.paddle2FrontY+=we.direction*Ru,I.paddle2FrontY=Math.max(0,Math.min(Zn-Xn,I.paddle2FrontY))):(I.paddle2BackY+=we.direction*Ru,I.paddle2BackY=Math.max(0,Math.min(Zn-Xn,I.paddle2BackY))))}}),a===null&&(I.ballX+=I.ballVX,I.ballY+=I.ballVY),(I.ballY<=0||I.ballY>=Zn-li)&&(I.ballVY*=-1);const j=B.filter(Y=>{var we;return((we=g[Y.id])==null?void 0:we.team)==="team1"});if(j.find(Y=>{var we;return((we=g[Y.id])==null?void 0:we.position)==="front"})&&I.ballX<=Ci+si&&I.ballX>=Ci&&I.ballY+li>=I.paddle1FrontY&&I.ballY<=I.paddle1FrontY+Xn&&(I.ballVX=Math.abs(I.ballVX),I.lastTouchedTeam="team1"),j.find(Y=>{var we;return((we=g[Y.id])==null?void 0:we.position)==="back"})){const Y=Ci/2;I.ballX<=Y+si&&I.ballX>=Y&&I.ballY+li>=I.paddle1BackY&&I.ballY<=I.paddle1BackY+Xn&&(I.ballVX=Math.abs(I.ballVX),I.lastTouchedTeam="team1")}const Q=B.filter(Y=>{var we;return((we=g[Y.id])==null?void 0:we.team)==="team2"});if(Q.find(Y=>{var we;return((we=g[Y.id])==null?void 0:we.position)==="front"})&&I.ballX>=xr-Ci-si-li&&I.ballX<=xr-Ci&&I.ballY+li>=I.paddle2FrontY&&I.ballY<=I.paddle2FrontY+Xn&&(I.ballVX=-Math.abs(I.ballVX),I.lastTouchedTeam="team2"),Q.find(Y=>{var we;return((we=g[Y.id])==null?void 0:we.position)==="back"})){const Y=xr-Ci/2-si;I.ballX>=Y-li&&I.ballX<=Y+si&&I.ballY+li>=I.paddle2BackY&&I.ballY<=I.paddle2BackY+Xn&&(I.ballVX=-Math.abs(I.ballVX),I.lastTouchedTeam="team2")}a===null&&(I.ballX<=0&&(y.scorePoint("team2"),s(3)),I.ballX>=xr-li&&(y.scorePoint("team1"),s(3)))}T.fillStyle="#000",T.fillRect(0,0,xr,Zn);const k=B.filter(j=>{var H;return((H=g[j.id])==null?void 0:H.team)==="team1"});k.length>0&&(T.fillStyle=l0,k.find(ee=>{var Q;return((Q=g[ee.id])==null?void 0:Q.position)==="front"})&&T.fillRect(Ci,I.paddle1FrontY,si,Xn),k.find(ee=>{var Q;return((Q=g[ee.id])==null?void 0:Q.position)==="back"})&&T.fillRect(Ci/2,I.paddle1BackY,si,Xn));const Z=B.filter(j=>{var H;return((H=g[j.id])==null?void 0:H.team)==="team2"});Z.length>0&&(T.fillStyle=c0,Z.find(ee=>{var Q;return((Q=g[ee.id])==null?void 0:Q.position)==="front"})&&T.fillRect(xr-Ci-si,I.paddle2FrontY,si,Xn),Z.find(ee=>{var Q;return((Q=g[ee.id])==null?void 0:Q.position)==="back"})&&T.fillRect(xr-Ci/2-si,I.paddle2BackY,si,Xn)),T.fillStyle=I.lastTouchedTeam==="team1"?l0:I.lastTouchedTeam==="team2"?c0:"#fff",T.beginPath(),T.arc(I.ballX+li/2,I.ballY+li/2,li/2,0,Math.PI*2),T.fill(),T.setLineDash([5,15]),T.beginPath(),T.moveTo(xr/2,0),T.lineTo(xr/2,Zn),T.strokeStyle="#333",T.stroke(),a!==null&&(T.fillStyle="#fff",T.font="bold 120px Arial",T.textAlign="center",T.textBaseline="middle",T.fillText(a.toString(),xr/2,Zn/2)),S=requestAnimationFrame(R)};return R(),()=>cancelAnimationFrame(S)},[e,A,a,g,y]),F.jsxs(F.Fragment,{children:[F.jsx(HN,{}),F.jsx("div",{className:"fixed top-20 right-4 z-50",children:F.jsx(ev,{state:Eo(b=>b),title:"Pong Game State"})}),F.jsxs("div",{className:"relative flex min-h-screen flex-col items-center justify-center bg-zinc-900 p-4",children:[F.jsxs("div",{className:"mb-4 flex w-full max-w-4xl items-center gap-4",children:[F.jsx("div",{className:"flex-1"}),F.jsx("div",{className:"flex w-20 items-center justify-end gap-2",children:e.players.filter(b=>{var T;return((T=g[b.id])==null?void 0:T.team)==="team1"}).map(b=>F.jsx(Co,{player:b,size:"sm"},b.id))}),F.jsxs("div",{className:"flex items-center gap-2 text-2xl font-bold",children:[F.jsx("span",{style:{color:l0},children:f.team1}),F.jsx("span",{className:"text-white",children:"-"}),F.jsx("span",{style:{color:c0},children:f.team2})]}),F.jsx("div",{className:"flex w-20 items-center gap-2",children:e.players.filter(b=>{var T;return((T=g[b.id])==null?void 0:T.team)==="team2"}).map(b=>F.jsx(Co,{player:b,size:"sm"},b.id))}),F.jsx("div",{className:"flex-1"})]}),F.jsx("canvas",{ref:r,className:"rounded-lg border-2 border-white"})]})]})}const N5=kr({direction:i1().min(-1).max(1),action:cR()});function O5(){return F.jsx(TE,{input:{schema:N5,latch:{booleanFields:["action"]}},children:F.jsxs(j_,{children:[F.jsx(f0,{path:"/",element:F.jsx(R5,{})}),F.jsx(f0,{path:"/controller",element:F.jsx(T5,{})})]})})}Hb.createRoot(document.getElementById("root")).render(F.jsx(L.StrictMode,{children:F.jsx(f3,{children:F.jsx(O5,{})})}));