@leatcom/portal-sessions 0.0.92 → 0.0.93

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(lt,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(lt=typeof globalThis<"u"?globalThis:lt||self,x(lt.PortalSessions={},lt.React,lt.ReactDOM))})(this,function(lt,x,vi){"use strict";var gk=Object.defineProperty;var mk=(lt,x,vi)=>x in lt?gk(lt,x,{enumerable:!0,configurable:!0,writable:!0,value:vi}):lt[x]=vi;var Qn=(lt,x,vi)=>mk(lt,typeof x!="symbol"?x+"":x,vi);try{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},x=new lt.Error().stack;x&&(lt._sentryDebugIds=lt._sentryDebugIds||{},lt._sentryDebugIds[x]="3cc2b0a0-1799-49d2-9776-e0952aa0480e",lt._sentryDebugIdIdentifier="sentry-dbid-3cc2b0a0-1799-49d2-9776-e0952aa0480e")}catch{}{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};lt._sentryModuleMetadata=lt._sentryModuleMetadata||{},lt._sentryModuleMetadata[new lt.Error().stack]=Object.assign({},lt._sentryModuleMetadata[new lt.Error().stack],{"_sentryBundlerPluginAppKey:portal-sessions-application-key":!0})}function Jy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function Zy(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ce=Jy(x);{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"2e700dca94a3e1961c6d5666dafcd49f105f15bb"}}var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ju={exports:{}},ua={};/**
1
+ (function(lt,x){typeof exports=="object"&&typeof module<"u"?x(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],x):(lt=typeof globalThis<"u"?globalThis:lt||self,x(lt.PortalSessions={},lt.React,lt.ReactDOM))})(this,function(lt,x,vi){"use strict";var gk=Object.defineProperty;var mk=(lt,x,vi)=>x in lt?gk(lt,x,{enumerable:!0,configurable:!0,writable:!0,value:vi}):lt[x]=vi;var Qn=(lt,x,vi)=>mk(lt,typeof x!="symbol"?x+"":x,vi);try{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},x=new lt.Error().stack;x&&(lt._sentryDebugIds=lt._sentryDebugIds||{},lt._sentryDebugIds[x]="ca1f8da2-3eec-4b9d-a9a6-8e7829351d57",lt._sentryDebugIdIdentifier="sentry-dbid-ca1f8da2-3eec-4b9d-a9a6-8e7829351d57")}catch{}{let lt=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};lt._sentryModuleMetadata=lt._sentryModuleMetadata||{},lt._sentryModuleMetadata[new lt.Error().stack]=Object.assign({},lt._sentryModuleMetadata[new lt.Error().stack],{"_sentryBundlerPluginAppKey:portal-sessions-application-key":!0})}function Jy(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}function Zy(t,e){for(var n=0;n<e.length;n++){const r=e[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in t)){const i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:()=>r[o]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}const ce=Jy(x);{let t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};t.SENTRY_RELEASE={id:"6f35a76474b5d09b37971f0f6a28b16a00c606ec"}}var wi=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ju={exports:{}},ua={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -81,7 +81,7 @@ React keys must be passed directly to JSX without using spread:
81
81
  * LICENSE.md file in the root directory of this source tree.
82
82
  *
83
83
  * @license MIT
84
- */function xi(){return xi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xi.apply(this,arguments)}function Rl(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}const rc="get",oc="application/x-www-form-urlencoded";function ic(t){return t!=null&&typeof t.tagName=="string"}function K3(t){return ic(t)&&t.tagName.toLowerCase()==="button"}function z3(t){return ic(t)&&t.tagName.toLowerCase()==="form"}function X3(t){return ic(t)&&t.tagName.toLowerCase()==="input"}function Q3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function J3(t,e){return t.button===0&&(!e||e==="_self")&&!Q3(t)}let ac=null;function Z3(){if(ac===null)try{new FormData(document.createElement("form"),0),ac=!1}catch{ac=!0}return ac}const eb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dl(t){return t!=null&&!eb.has(t)?(process.env.NODE_ENV!=="production"&&ur(!1,'"'+t+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):t}function tb(t,e){let n,r,o,i,a;if(z3(t)){let s=t.getAttribute("action");r=s?wo(s,e):null,n=t.getAttribute("method")||rc,o=Dl(t.getAttribute("enctype"))||oc,i=new FormData(t)}else if(K3(t)||X3(t)&&(t.type==="submit"||t.type==="image")){let s=t.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||s.getAttribute("action");if(r=c?wo(c,e):null,n=t.getAttribute("formmethod")||s.getAttribute("method")||rc,o=Dl(t.getAttribute("formenctype"))||Dl(s.getAttribute("enctype"))||oc,i=new FormData(s,t),!Z3()){let{name:u,type:d,value:h}=t;if(d==="image"){let f=u?u+".":"";i.append(f+"x","0"),i.append(f+"y","0")}else u&&i.append(u,h)}}else{if(ic(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=rc,r=null,o=oc,a=t}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}const nb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],rb=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ob=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],ib="6";try{window.__reactRouterVersion=ib}catch{}const K1=ce.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(K1.displayName="ViewTransition");const ab=ce.createContext(new Map);process.env.NODE_ENV!=="production"&&(ab.displayName="Fetchers"),process.env.NODE_ENV;const sb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z1=ce.forwardRef(function(e,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=Rl(e,nb),{basename:p}=ce.useContext(lr),l,g=!1;if(typeof u=="string"&&cb.test(u)&&(l=u,sb))try{let b=new URL(window.location.href),E=u.startsWith("//")?new URL(b.protocol+u):new URL(u),C=wo(E.pathname,p);E.origin===b.origin&&C!=null?u=C+E.search+E.hash:g=!0}catch{process.env.NODE_ENV!=="production"&&ur(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let m=P3(u,{relative:o}),y=db(u,{replace:a,state:s,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});function w(b){r&&r(b),b.defaultPrevented||y(b)}return ce.createElement("a",xi({},f,{href:l||m,onClick:g||i?r:w,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(z1.displayName="Link");const X1=ce.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:c,unstable_viewTransition:u,children:d}=e,h=Rl(e,rb),f=Ta(c,{relative:h.relative}),p=er(),l=ce.useContext(Pl),{navigator:g,basename:m}=ce.useContext(lr),y=l!=null&&yb(f)&&u===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=l&&l.navigation&&l.navigation.location?l.navigation.location.pathname:null;o||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&m&&(E=wo(E,m)||E);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let I=b===w||!a&&b.startsWith(w)&&b.charAt(C)==="/",T=E!=null&&(E===w||!a&&E.startsWith(w)&&E.charAt(w.length)==="/"),P={isActive:I,isPending:T,isTransitioning:y},N=I?r:void 0,L;typeof i=="function"?L=i(P):L=[i,I?"active":null,T?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let V=typeof s=="function"?s(P):s;return ce.createElement(z1,xi({},h,{"aria-current":N,className:L,ref:n,style:V,to:c,unstable_viewTransition:u}),typeof d=="function"?d(P):d)});process.env.NODE_ENV!=="production"&&(X1.displayName="NavLink");const ub=ce.forwardRef((t,e)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:i,state:a,method:s=rc,action:c,onSubmit:u,relative:d,preventScrollReset:h,unstable_viewTransition:f}=t,p=Rl(t,ob),l=gb(),g=mb(c,{relative:d}),m=s.toLowerCase()==="get"?"get":"post",y=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let b=w.nativeEvent.submitter,E=(b==null?void 0:b.getAttribute("formmethod"))||s;l(b||w.currentTarget,{fetcherKey:n,method:E,navigate:r,replace:i,state:a,relative:d,preventScrollReset:h,unstable_viewTransition:f})};return ce.createElement("form",xi({ref:e,method:m,action:g,onSubmit:o?u:y},p))});process.env.NODE_ENV!=="production"&&(ub.displayName="Form"),process.env.NODE_ENV;var sc;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sc||(sc={}));var Q1;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Q1||(Q1={}));function lb(t){return t+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function J1(t){let e=ce.useContext(Ia);return e||(process.env.NODE_ENV!=="production"?We(!1,lb(t)):We(!1)),e}function db(t,e){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s}=e===void 0?{}:e,c=zt(),u=er(),d=Ta(t,{relative:a});return ce.useCallback(h=>{if(J3(h,n)){h.preventDefault();let f=r!==void 0?r:tc(u)===tc(d);c(t,{replace:f,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s})}},[u,c,d,r,o,n,t,i,a,s])}function fb(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let hb=0,pb=()=>"__"+String(++hb)+"__";function gb(){let{router:t}=J1(sc.UseSubmit),{basename:e}=ce.useContext(lr),n=q3();return ce.useCallback(function(r,o){o===void 0&&(o={}),fb();let{action:i,method:a,encType:s,formData:c,body:u}=tb(r,e);if(o.navigate===!1){let d=o.fetcherKey||pb();t.fetch(d,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,unstable_flushSync:o.unstable_flushSync})}else t.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[t,e,n])}function mb(t,e){let{relative:n}=e===void 0?{}:e,{basename:r}=ce.useContext(lr),o=ce.useContext(Ar);o||(process.env.NODE_ENV!=="production"?We(!1,"useFormAction must be used inside a RouteContext"):We(!1));let[i]=o.matches.slice(-1),a=xi({},Ta(t||".",{relative:n})),s=er();if(t==null){a.search=s.search;let c=new URLSearchParams(a.search);c.has("index")&&c.get("index")===""&&(c.delete("index"),a.search=c.toString()?"?"+c.toString():"")}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:$r([r,a.pathname])),tc(a)}function yb(t,e){e===void 0&&(e={});let n=ce.useContext(K1);n==null&&(process.env.NODE_ENV!=="production"?We(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):We(!1));let{basename:r}=J1(sc.useViewTransitionState),o=Ta(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=wo(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Il(o.pathname,a)!=null||Il(o.pathname,i)!=null}function vb(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,r=parseInt(t.slice(5,7),16)/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=o-i,s=(o+i)/2;let c=0;a!==0&&(c=a/(1-Math.abs(2*s-1)));let u=0;return a!==0&&(o===e?u=((n-r)/a+(n<r?6:0))*60:o===n?u=((r-e)/a+2)*60:u=((e-n)/a+4)*60),{hue:u,saturation:c,lightness:s}}function cc(t,e,n){const r=(1-Math.abs(2*n-1))*e,o=r*(1-Math.abs(t/60%2-1)),i=n-r/2;let a=0,s=0,c=0;return t<60?(a=r,s=o,c=0):t<120?(a=o,s=r,c=0):t<180?(a=0,s=r,c=o):t<240?(a=0,s=o,c=r):t<300?(a=o,s=0,c=r):(a=r,s=0,c=o),a=Math.round((a+i)*255),s=Math.round((s+i)*255),c=Math.round((c+i)*255),`#${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function Z1(t){const{hue:e,saturation:n,lightness:r}=vb(t),o=.04,i=[{key:"50",min:97,max:99},{key:"100",min:92,max:96},{key:"200",min:85,max:91},{key:"300",min:74,max:84},{key:"400",min:58,max:73},{key:"500",min:51,max:61},{key:"600",min:36,max:50},{key:"700",min:29,max:40},{key:"800",min:24,max:33},{key:"900",min:20,max:28},{key:"950",min:0,max:19}],a={},s={},c={},u={};i.forEach(d=>{const h=(d.min+d.max)/2/100;a[d.key]=cc(e,n,h),c[d.key]=cc(0,n,h),u[d.key]=cc(120,n,h),s[d.key]=cc(e,o,h)});for(const d of i)if(r*100>=d.min&&r*100<=d.max){a[d.key]=t;break}return{primaryPalette:a,redPalette:c,greenPalette:u,grayPalette:s}}const wb=t=>{const e={primary:t.primary_color,secondary:t.secondary_color,tertiary:t.tertiary_color,quaternary:t.quaternary_color},n=document.querySelector(":root");for(const r in e)if(e[r]){const{primaryPalette:o}=Z1(e[r]);for(const i in o)n.style.setProperty(`--${r}-${i}`,o[i])}if(e.primary){const{grayPalette:r,redPalette:o,greenPalette:i}=Z1(e.primary);for(const a in r)n.style.setProperty(`--gray-${a}`,r[a]);for(const a in o)n.style.setProperty(`--red-${a}`,o[a]);for(const a in i)n.style.setProperty(`--green-${a}`,i[a])}};function bo({value:t,start:e=0,duration:n=1e3,currency:r="EUR",asCurrency:o=!1}){const[i,a]=x.useState(e),s=()=>{const c=e>t?e-t:t-e;return c<=1e3?1:c/1e3};return x.useEffect(()=>{const c=setInterval(()=>{e>t?a(u=>Math.max(u-s(),t)):a(u=>Math.min(u+s(),t)),i===t&&clearInterval(c)},n/t);return()=>clearInterval(c)},[i,n,e,t]),v.jsx("div",{"data-testid":"animated-counter",children:o?Si(i,r):i})}const bb=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((o,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Eb=({svgComponent:t,...e})=>v.jsx(t,{...e});function ep(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=ep(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Cb(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=ep(t))&&(r&&(r+=" "),r+=e);return r}const tp=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,np=Cb,Oi=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return np(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,a=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const f=tp(d)||tp(h);return o[u][f]}),s=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(l=>{let[g,m]=l;return Array.isArray(m)?m.includes({...i,...s}[g]):{...i,...s}[g]===m})?[...u,h,f]:u},[]);return np(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},_b=Oi("aspect-square",{variants:{size:{"2xs":"h-3 w-3",xs:"h-4 w-4",sm:"h-5 w-5",md:"h-6 w-6",lg:"h-7 w-7",xl:"h-8 w-8","2xl":"h-10 w-10"},variant:{primary:"fill-none stroke-core-white-900 stroke-[1.5]",secondary:"fill-none stroke-core-gray-400 stroke-[1.5] active:stroke-core-gray-900 ",discovery:"fill-none stroke-core-primary-500 stroke-[1.5] ",destructive:"fill-none stroke-core-red-700 stroke-[1.5] ",placeholder:"fill-none stroke-core-gray-300 stroke-[1.5]"},outline:{true:[],false:[]}},compoundVariants:[{variant:"placeholder",outline:!1,class:"fill-core-gray-300 stroke-width-0"}],defaultVariants:{variant:"placeholder",size:"md"}}),wn=({icon:t="user",size:e="md",variant:n="placeholder",outline:r=!0})=>{if(x.isValidElement(t))return"span";const o=Ab(t);return o?v.jsx(Eb,{svgComponent:o,className:_b({variant:n,size:e,outline:r})}):null};function Ab(t){const[e,n]=x.useState(null),r=async()=>{try{const o=(await bb(Object.assign({"../../assets/svg/calendar.svg":()=>Promise.resolve().then(()=>Xx),"../../assets/svg/camera-switch.svg":()=>Promise.resolve().then(()=>Qx),"../../assets/svg/caret-left.svg":()=>Promise.resolve().then(()=>Jx),"../../assets/svg/close.svg":()=>Promise.resolve().then(()=>Zx),"../../assets/svg/crossBlack.svg":()=>Promise.resolve().then(()=>eO),"../../assets/svg/dollar.svg":()=>Promise.resolve().then(()=>tO),"../../assets/svg/edit.svg":()=>Promise.resolve().then(()=>nO),"../../assets/svg/home.svg":()=>Promise.resolve().then(()=>rO),"../../assets/svg/information.svg":()=>Promise.resolve().then(()=>oO),"../../assets/svg/mail.svg":()=>Promise.resolve().then(()=>iO),"../../assets/svg/notificationErrorV2.svg":()=>Promise.resolve().then(()=>aO),"../../assets/svg/notificationSuccessV2.svg":()=>Promise.resolve().then(()=>sO),"../../assets/svg/notificationWarningV2.svg":()=>Promise.resolve().then(()=>cO),"../../assets/svg/settings.svg":()=>Promise.resolve().then(()=>uO),"../../assets/svg/shopping-bag.svg":()=>Promise.resolve().then(()=>lO),"../../assets/svg/star.svg":()=>Promise.resolve().then(()=>dO),"../../assets/svg/user.svg":()=>Promise.resolve().then(()=>fO)}),`../../assets/svg/${t}.svg`,5)).default;n(()=>o)}catch(o){console.error(`Failed to import icon: ${t}`,o),n(null)}};return x.useEffect(()=>{r()},[t]),e}const Sb=Oi("bg-core-primary-500 text-core-white-900 relative inline-flex aspect-square shrink-0 items-center antialiased rounded-full overflow-hidden uppercase",{variants:{size:{xs:"h-6 w-6 text-xs ",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-14 w-14 text-xl","2xl":"h-16 w-16 text-2xl"}},defaultVariants:{size:"sm"}}),Ib=({src:t,alt:e})=>v.jsx("img",{src:t,alt:e,className:"bg-core-white-900 aspect-square w-full grow rounded-full object-cover object-center"}),Tb=({initials:t})=>v.jsx("div",{className:"h-full w-full content-center text-center",children:t}),Ml=({src:t,alt:e,initials:n,size:r})=>v.jsxs("div",{className:Sb({size:r}),children:[t&&v.jsx(Ib,{src:t,alt:e}),t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(wn,{icon:"user",variant:"placeholder",outline:!1,size:r})}),!t&&n&&v.jsx(Tb,{initials:n}),!t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(wn,{icon:"user",variant:"placeholder",outline:!1,size:r})})]});Ml.displayName="Avatar";const xb=Oi("inline-flex items-center rounded-lg px-2 py-1 antialiased",{variants:{color:{primary:"text-core-primary-700 outline-core-primary-200 bg-core-primary-50",gray:"text-core-gray-700 outline-core-gray-200 bg-core-gray-50"},size:{sm:"text-xs leading-4 ",md:"text-sm leading-5 "},stroke:{true:"outline outline-1",false:""}},defaultVariants:{color:"primary",size:"sm",stroke:!1}}),Ll=({label:t,color:e="primary",size:n="sm",stroke:r=!1})=>v.jsx("span",{className:xb({color:e,size:n,stroke:r}),children:t});Ll.displayName="Badge";function Ob({body:t}){return v.jsxs("div",{className:"flex gap-3 rounded-r-lg border-l-2 border-core-primary-500 bg-core-gray-50 p-4 text-sm",children:[v.jsx(wn,{icon:"information",variant:"discovery"}),v.jsx("div",{children:t})]})}const Pb=Oi("group inline-flex shrink-0 select-none items-center justify-center font-medium transition-colors duration-100 antialiased rounded-lg hover:shadow-none focus:outline-0 focus:outline-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",{variants:{size:{sm:"h-8 gap-1 px-2 py-1 text-xs leading-4",md:"h-10 gap-1 px-3 py-2 text-sm leading-5",lg:"h-12 gap-1 px-3 py-3 text-base leading-6"},variant:{primary:"bg-core-primary-500 text-core-white-900 outline-primary hover:bg-core-primary-600 disabled:bg-core-primary-disabled",secondary:"box-border border border-core-gray-200 bg-core-white-900 shadow-xs hover:bg-core-gray-50 disabled:opacity-30",destructive:"bg-core-red-500 text-core-white-900 hover:bg-core-red-600 focus:outline-core-red-500 disabled:bg-core-red-200","destructive-outline":"box-border border border-core-red-200 text-core-red-700 shadow-xs hover:bg-core-red-50 focus:outline-core-red-500 disabled:opacity-40","link-gray":"bg-transparent hover:bg-surface hover:underline underline-offset-2 disabled:opacity-30"}},compoundVariants:[{variant:"link-gray",size:["md","lg"],class:"px-0 py-0"}],defaultVariants:{variant:"primary",size:"md"}}),rp={primary:"primary",secondary:"secondary",destructive:"primary","destructive-outline":"destructive","link-gray":"secondary"},op={md:"sm",lg:"md"},Ze=({after:t,before:e,className:n,label:r="button",variant:o="primary",size:i="md",pending:a=!1,disabled:s=!1,onClick:c,...u})=>{const d=f=>{var p;return In("group-hover:opacity-70 ",(p=f.props)==null?void 0:p.className)},h=f=>{var p;return((p=f.props)==null?void 0:p.icon)??"user"};return v.jsxs("button",{className:In(Pb({variant:o,size:i}),n),disabled:s||a,onClick:c,...u,children:[v.jsxs("span",{className:`flex items-center gap-1 ${a&&"opacity-0"}`,children:[e&&v.jsx(wn,{className:d(e),icon:h(e),variant:rp[o],size:op[i]}),v.jsx("span",{children:r}),t&&v.jsx(wn,{className:In(d(t),`${a&&"opacity-0"}`),icon:h(t),variant:rp[o],size:op[i]})]}),a&&v.jsx(Sl,{className:"absolute"})]})};Ze.displayName="Button";function Mt({children:t,id:e=x.useId()}){return v.jsx("div",{id:e,className:"flex h-full max-h-full flex-col bg-white md:h-fit md:rounded-lg md:border md:shadow-md",children:t})}function kt({children:t}){return v.jsx("div",{className:"grow overflow-y-auto px-6 py-4",children:t})}function rn({children:t}){return v.jsx("div",{className:"border-t px-6 py-4",children:t})}function Bt({children:t}){return v.jsx("div",{className:"border-b px-6",children:t})}const ip=({children:t,className:e,description:n,disabled:r,required:o=!1,tooltip:i,htmlFor:a})=>!t&&!i&&!n?null:v.jsx("label",{htmlFor:a,className:"inline-flex shrink-0 items-center gap-1 text-core-gray-800 antialiased ",children:v.jsxs("div",{className:In("inline-flex cursor-pointer items-center gap-1 text-sm font-medium leading-6",e,r&&"pointer-events-none text-core-gray-300"),children:[t?v.jsx("span",{className:In(r&&"pointer-events-none text-core-gray-300"),children:t}):null,n?v.jsx("span",{className:In("font-normal text-core-gray-500",r&&"text-current"),children:n}):null,o?v.jsx("span",{className:"font-normal text-core-red-500",children:"*"}):null]})}),ap=({helperText:t,error:e,disabled:n})=>t?v.jsx("span",{className:In("text-start text-sm leading-6 text-core-gray-500 antialiased ",e&&"text-core-red-500",n&&"text-core-gray-300"),children:t}):null;ip.displayName="Label",ap.displayName="HelperText";const kn=Object.assign(ip,{Helper:ap}),kb=({id:t,defaultChecked:e=!1,disabled:n,onChange:r})=>{const o=n,[i,a]=x.useState(e),s=c=>{o||a(!i),r&&r(c.target.checked)};return v.jsx("div",{className:"flex h-6 w-6 items-center justify-center",children:v.jsx("input",{className:"h-4 w-4 rounded border border-core-gray-200 bg-core-white-900 text-core-primary-500 shadow-xs hover:border-core-gray-300 hover:shadow-none checked:bg-core-primary-500focus:outline-0 focus:ring-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border disabled:border-core-gray-200 disabled:bg-core-gray-50 disabled:shadow-none disabled:checked:bg-core-gray-200",id:t,type:"checkbox",checked:i,onChange:s,disabled:o})})},sp=x.createContext(null);function cp(t=!1){const e=x.useContext(sp);if(!e&&!t)throw new Error("Checkbox.Item must be used within a CheckboxGroup or CheckboxGroup.Root");return e}const up=x.forwardRef(({children:t,description:e,disabled:n,helperText:r,id:o,label:i,required:a,tooltip:s},c)=>{const u=x.useId(),d=o??u,h=i??e??s??r?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(kn,{className:"cursor-default",description:e,required:a,tooltip:s,htmlFor:d,disabled:n,children:i}),v.jsx(kn.Helper,{disabled:n,helperText:r})]}):null;return v.jsx(sp.Provider,{value:{disabled:n},children:v.jsxs("div",{ref:c,"aria-describedby":r?`${d}__describer`:void 0,"aria-labelledby":i?`${d}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[i??r??e??s?v.jsx("div",{className:"flex flex-col",children:h}):null,t?v.jsx("div",{className:In("flex flex-col gap-2"),children:t}):null]})})});up.displayName="CheckboxGroup",Object.assign(up,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=cp(),{disabled:o}=r??{};return v.jsx(Fl,{disabled:t??o,label:e,defaultChecked:n})}});const Fl=({id:t,children:e,defaultChecked:n=!1,description:r,disabled:o,helperText:i,label:a,required:s=!1,tooltip:c,onChange:u})=>{const d=x.useId(),h=t??d,f=!!cp(!0),p=a??r??c??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(kn,{className:In(f&&"font-normal"),description:r,required:s,tooltip:c,htmlFor:h,disabled:o,children:a}),v.jsx(kn.Helper,{disabled:o,helperText:i})]}):null;return v.jsxs("div",{className:"flex gap-3",children:[v.jsx(kb,{id:h,defaultChecked:n,disabled:o,onChange:u}),e||p]})};Fl.displayName="Checkbox";function Oa(){return{subscribe:(r,o)=>{document.addEventListener(r,o)},unsubscribe:(r,o)=>{document.removeEventListener(r,o)},publish:(r,o)=>{const i=new CustomEvent(r,{detail:o});document.dispatchEvent(i)}}}function lp(t,e){x.useEffect(()=>{const n=o=>{t.current&&!t.current.contains(o.target)&&e(!1)},r=o=>{o.key==="Escape"&&e(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",r)}},[])}const Bb=typeof window<"u"?x.useLayoutEffect:()=>{},Nb=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight],Rb=()=>{const[t,e]=x.useState(),n=x.useCallback(()=>{const r=Nb();e(o=>o&&o[0]===r[0]&&o[1]===r[1]?o:r)},[]);return Bb(n,[n]),x.useEffect(()=>{var o;const r=()=>{n(),setTimeout(n,1e3)};return window.addEventListener("resize",r),window.addEventListener("orientationchange",r),(o=window.visualViewport)==null||o.addEventListener("resize",r),()=>{var i;window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r),(i=window.visualViewport)==null||i.removeEventListener("resize",r)}},[n]),t};var dp={exports:{}};/*!
84
+ */function xi(){return xi=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},xi.apply(this,arguments)}function Rl(t,e){if(t==null)return{};var n={},r=Object.keys(t),o,i;for(i=0;i<r.length;i++)o=r[i],!(e.indexOf(o)>=0)&&(n[o]=t[o]);return n}const rc="get",oc="application/x-www-form-urlencoded";function ic(t){return t!=null&&typeof t.tagName=="string"}function K3(t){return ic(t)&&t.tagName.toLowerCase()==="button"}function z3(t){return ic(t)&&t.tagName.toLowerCase()==="form"}function X3(t){return ic(t)&&t.tagName.toLowerCase()==="input"}function Q3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function J3(t,e){return t.button===0&&(!e||e==="_self")&&!Q3(t)}let ac=null;function Z3(){if(ac===null)try{new FormData(document.createElement("form"),0),ac=!1}catch{ac=!0}return ac}const eb=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Dl(t){return t!=null&&!eb.has(t)?(process.env.NODE_ENV!=="production"&&ur(!1,'"'+t+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):t}function tb(t,e){let n,r,o,i,a;if(z3(t)){let s=t.getAttribute("action");r=s?wo(s,e):null,n=t.getAttribute("method")||rc,o=Dl(t.getAttribute("enctype"))||oc,i=new FormData(t)}else if(K3(t)||X3(t)&&(t.type==="submit"||t.type==="image")){let s=t.form;if(s==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||s.getAttribute("action");if(r=c?wo(c,e):null,n=t.getAttribute("formmethod")||s.getAttribute("method")||rc,o=Dl(t.getAttribute("formenctype"))||Dl(s.getAttribute("enctype"))||oc,i=new FormData(s,t),!Z3()){let{name:u,type:d,value:h}=t;if(d==="image"){let f=u?u+".":"";i.append(f+"x","0"),i.append(f+"y","0")}else u&&i.append(u,h)}}else{if(ic(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=rc,r=null,o=oc,a=t}return i&&o==="text/plain"&&(a=i,i=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:i,body:a}}const nb=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],rb=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],ob=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],ib="6";try{window.__reactRouterVersion=ib}catch{}const K1=ce.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(K1.displayName="ViewTransition");const ab=ce.createContext(new Map);process.env.NODE_ENV!=="production"&&(ab.displayName="Fetchers"),process.env.NODE_ENV;const sb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,z1=ce.forwardRef(function(e,n){let{onClick:r,relative:o,reloadDocument:i,replace:a,state:s,target:c,to:u,preventScrollReset:d,unstable_viewTransition:h}=e,f=Rl(e,nb),{basename:p}=ce.useContext(lr),l,g=!1;if(typeof u=="string"&&cb.test(u)&&(l=u,sb))try{let b=new URL(window.location.href),E=u.startsWith("//")?new URL(b.protocol+u):new URL(u),C=wo(E.pathname,p);E.origin===b.origin&&C!=null?u=C+E.search+E.hash:g=!0}catch{process.env.NODE_ENV!=="production"&&ur(!1,'<Link to="'+u+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let m=P3(u,{relative:o}),y=db(u,{replace:a,state:s,target:c,preventScrollReset:d,relative:o,unstable_viewTransition:h});function w(b){r&&r(b),b.defaultPrevented||y(b)}return ce.createElement("a",xi({},f,{href:l||m,onClick:g||i?r:w,ref:n,target:c}))});process.env.NODE_ENV!=="production"&&(z1.displayName="Link");const X1=ce.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:o=!1,className:i="",end:a=!1,style:s,to:c,unstable_viewTransition:u,children:d}=e,h=Rl(e,rb),f=Ta(c,{relative:h.relative}),p=er(),l=ce.useContext(Pl),{navigator:g,basename:m}=ce.useContext(lr),y=l!=null&&yb(f)&&u===!0,w=g.encodeLocation?g.encodeLocation(f).pathname:f.pathname,b=p.pathname,E=l&&l.navigation&&l.navigation.location?l.navigation.location.pathname:null;o||(b=b.toLowerCase(),E=E?E.toLowerCase():null,w=w.toLowerCase()),E&&m&&(E=wo(E,m)||E);const C=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let I=b===w||!a&&b.startsWith(w)&&b.charAt(C)==="/",T=E!=null&&(E===w||!a&&E.startsWith(w)&&E.charAt(w.length)==="/"),P={isActive:I,isPending:T,isTransitioning:y},N=I?r:void 0,L;typeof i=="function"?L=i(P):L=[i,I?"active":null,T?"pending":null,y?"transitioning":null].filter(Boolean).join(" ");let V=typeof s=="function"?s(P):s;return ce.createElement(z1,xi({},h,{"aria-current":N,className:L,ref:n,style:V,to:c,unstable_viewTransition:u}),typeof d=="function"?d(P):d)});process.env.NODE_ENV!=="production"&&(X1.displayName="NavLink");const ub=ce.forwardRef((t,e)=>{let{fetcherKey:n,navigate:r,reloadDocument:o,replace:i,state:a,method:s=rc,action:c,onSubmit:u,relative:d,preventScrollReset:h,unstable_viewTransition:f}=t,p=Rl(t,ob),l=gb(),g=mb(c,{relative:d}),m=s.toLowerCase()==="get"?"get":"post",y=w=>{if(u&&u(w),w.defaultPrevented)return;w.preventDefault();let b=w.nativeEvent.submitter,E=(b==null?void 0:b.getAttribute("formmethod"))||s;l(b||w.currentTarget,{fetcherKey:n,method:E,navigate:r,replace:i,state:a,relative:d,preventScrollReset:h,unstable_viewTransition:f})};return ce.createElement("form",xi({ref:e,method:m,action:g,onSubmit:o?u:y},p))});process.env.NODE_ENV!=="production"&&(ub.displayName="Form"),process.env.NODE_ENV;var sc;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(sc||(sc={}));var Q1;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Q1||(Q1={}));function lb(t){return t+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function J1(t){let e=ce.useContext(Ia);return e||(process.env.NODE_ENV!=="production"?We(!1,lb(t)):We(!1)),e}function db(t,e){let{target:n,replace:r,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s}=e===void 0?{}:e,c=zt(),u=er(),d=Ta(t,{relative:a});return ce.useCallback(h=>{if(J3(h,n)){h.preventDefault();let f=r!==void 0?r:tc(u)===tc(d);c(t,{replace:f,state:o,preventScrollReset:i,relative:a,unstable_viewTransition:s})}},[u,c,d,r,o,n,t,i,a,s])}function fb(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let hb=0,pb=()=>"__"+String(++hb)+"__";function gb(){let{router:t}=J1(sc.UseSubmit),{basename:e}=ce.useContext(lr),n=q3();return ce.useCallback(function(r,o){o===void 0&&(o={}),fb();let{action:i,method:a,encType:s,formData:c,body:u}=tb(r,e);if(o.navigate===!1){let d=o.fetcherKey||pb();t.fetch(d,n,o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,unstable_flushSync:o.unstable_flushSync})}else t.navigate(o.action||i,{preventScrollReset:o.preventScrollReset,formData:c,body:u,formMethod:o.method||a,formEncType:o.encType||s,replace:o.replace,state:o.state,fromRouteId:n,unstable_flushSync:o.unstable_flushSync,unstable_viewTransition:o.unstable_viewTransition})},[t,e,n])}function mb(t,e){let{relative:n}=e===void 0?{}:e,{basename:r}=ce.useContext(lr),o=ce.useContext(Ar);o||(process.env.NODE_ENV!=="production"?We(!1,"useFormAction must be used inside a RouteContext"):We(!1));let[i]=o.matches.slice(-1),a=xi({},Ta(t||".",{relative:n})),s=er();if(t==null){a.search=s.search;let c=new URLSearchParams(a.search);c.has("index")&&c.get("index")===""&&(c.delete("index"),a.search=c.toString()?"?"+c.toString():"")}return(!t||t===".")&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(a.pathname=a.pathname==="/"?r:$r([r,a.pathname])),tc(a)}function yb(t,e){e===void 0&&(e={});let n=ce.useContext(K1);n==null&&(process.env.NODE_ENV!=="production"?We(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):We(!1));let{basename:r}=J1(sc.useViewTransitionState),o=Ta(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=wo(n.currentLocation.pathname,r)||n.currentLocation.pathname,a=wo(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Il(o.pathname,a)!=null||Il(o.pathname,i)!=null}function vb(t){const e=parseInt(t.slice(1,3),16)/255,n=parseInt(t.slice(3,5),16)/255,r=parseInt(t.slice(5,7),16)/255,o=Math.max(e,n,r),i=Math.min(e,n,r),a=o-i,s=(o+i)/2;let c=0;a!==0&&(c=a/(1-Math.abs(2*s-1)));let u=0;return a!==0&&(o===e?u=((n-r)/a+(n<r?6:0))*60:o===n?u=((r-e)/a+2)*60:u=((e-n)/a+4)*60),{hue:u,saturation:c,lightness:s}}function cc(t,e,n){const r=(1-Math.abs(2*n-1))*e,o=r*(1-Math.abs(t/60%2-1)),i=n-r/2;let a=0,s=0,c=0;return t<60?(a=r,s=o,c=0):t<120?(a=o,s=r,c=0):t<180?(a=0,s=r,c=o):t<240?(a=0,s=o,c=r):t<300?(a=o,s=0,c=r):(a=r,s=0,c=o),a=Math.round((a+i)*255),s=Math.round((s+i)*255),c=Math.round((c+i)*255),`#${a.toString(16).padStart(2,"0")}${s.toString(16).padStart(2,"0")}${c.toString(16).padStart(2,"0")}`}function Z1(t){const{hue:e,saturation:n,lightness:r}=vb(t),o=.04,i=[{key:"50",min:97,max:99},{key:"100",min:92,max:96},{key:"200",min:85,max:91},{key:"300",min:74,max:84},{key:"400",min:58,max:73},{key:"500",min:51,max:61},{key:"600",min:36,max:50},{key:"700",min:29,max:40},{key:"800",min:24,max:33},{key:"900",min:20,max:28},{key:"950",min:0,max:19}],a={},s={},c={},u={};i.forEach(d=>{const h=(d.min+d.max)/2/100;a[d.key]=cc(e,n,h),c[d.key]=cc(0,n,h),u[d.key]=cc(120,n,h),s[d.key]=cc(e,o,h)});for(const d of i)if(r*100>=d.min&&r*100<=d.max){a[d.key]=t;break}return{primaryPalette:a,redPalette:c,greenPalette:u,grayPalette:s}}const wb=t=>{const e={primary:t.primary_color,secondary:t.secondary_color,tertiary:t.tertiary_color,quaternary:t.quaternary_color},n=document.querySelector(":root");for(const r in e)if(e[r]){const{primaryPalette:o}=Z1(e[r]);for(const i in o)n.style.setProperty(`--${r}-${i}`,o[i])}if(e.primary){const{grayPalette:r,redPalette:o,greenPalette:i}=Z1(e.primary);for(const a in r)n.style.setProperty(`--gray-${a}`,r[a]);for(const a in o)n.style.setProperty(`--red-${a}`,o[a]);for(const a in i)n.style.setProperty(`--green-${a}`,i[a])}};function bo({value:t,start:e=0,duration:n=1e3,currency:r="EUR",asCurrency:o=!1}){const[i,a]=x.useState(e),s=()=>{const c=e>t?e-t:t-e;return c<=1e3?1:c/1e3};return x.useEffect(()=>{const c=setInterval(()=>{e>t?a(u=>Math.max(u-s(),t)):a(u=>Math.min(u+s(),t)),i===t&&clearInterval(c)},n/t);return()=>clearInterval(c)},[i,n,e,t]),v.jsx("div",{"data-testid":"animated-counter",children:o?Si(i,r):i})}const bb=(t,e,n)=>{const r=t[e];return r?typeof r=="function"?r():Promise.resolve(r):new Promise((o,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})},Eb=({svgComponent:t,...e})=>v.jsx(t,{...e});function ep(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=ep(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Cb(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=ep(t))&&(r&&(r+=" "),r+=e);return r}const tp=t=>typeof t=="boolean"?"".concat(t):t===0?"0":t,np=Cb,Oi=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return np(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=e,a=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const f=tp(d)||tp(h);return o[u][f]}),s=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),c=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(l=>{let[g,m]=l;return Array.isArray(m)?m.includes({...i,...s}[g]):{...i,...s}[g]===m})?[...u,h,f]:u},[]);return np(t,a,c,n==null?void 0:n.class,n==null?void 0:n.className)},_b=Oi("aspect-square",{variants:{size:{"2xs":"h-3 w-3",xs:"h-4 w-4",sm:"h-5 w-5",md:"h-6 w-6",lg:"h-7 w-7",xl:"h-8 w-8","2xl":"h-10 w-10"},variant:{primary:"fill-none stroke-core-white-900 stroke-[1.5]",secondary:"fill-none stroke-core-gray-400 stroke-[1.5] active:stroke-core-gray-900 ",discovery:"fill-none stroke-core-primary-500 stroke-[1.5] ",destructive:"fill-none stroke-core-red-700 stroke-[1.5] ",placeholder:"fill-none stroke-core-gray-300 stroke-[1.5]"},outline:{true:[],false:[]}},compoundVariants:[{variant:"placeholder",outline:!1,class:"fill-core-gray-300 stroke-width-0"}],defaultVariants:{variant:"placeholder",size:"md"}}),wn=({icon:t="user",size:e="md",variant:n="placeholder",outline:r=!0})=>{if(x.isValidElement(t))return"span";const o=Ab(t);return o?v.jsx(Eb,{svgComponent:o,className:_b({variant:n,size:e,outline:r})}):null};function Ab(t){const[e,n]=x.useState(null),r=async()=>{try{const o=(await bb(Object.assign({"../../assets/svg/calendar.svg":()=>Promise.resolve().then(()=>Xx),"../../assets/svg/camera-switch.svg":()=>Promise.resolve().then(()=>Qx),"../../assets/svg/caret-left.svg":()=>Promise.resolve().then(()=>Jx),"../../assets/svg/close.svg":()=>Promise.resolve().then(()=>Zx),"../../assets/svg/crossBlack.svg":()=>Promise.resolve().then(()=>eO),"../../assets/svg/dollar.svg":()=>Promise.resolve().then(()=>tO),"../../assets/svg/edit.svg":()=>Promise.resolve().then(()=>nO),"../../assets/svg/home.svg":()=>Promise.resolve().then(()=>rO),"../../assets/svg/information.svg":()=>Promise.resolve().then(()=>oO),"../../assets/svg/mail.svg":()=>Promise.resolve().then(()=>iO),"../../assets/svg/notificationErrorV2.svg":()=>Promise.resolve().then(()=>aO),"../../assets/svg/notificationSuccessV2.svg":()=>Promise.resolve().then(()=>sO),"../../assets/svg/notificationWarningV2.svg":()=>Promise.resolve().then(()=>cO),"../../assets/svg/settings.svg":()=>Promise.resolve().then(()=>uO),"../../assets/svg/shopping-bag.svg":()=>Promise.resolve().then(()=>lO),"../../assets/svg/star.svg":()=>Promise.resolve().then(()=>dO),"../../assets/svg/user.svg":()=>Promise.resolve().then(()=>fO)}),`../../assets/svg/${t}.svg`,5)).default;n(()=>o)}catch(o){console.error(`Failed to import icon: ${t}`,o),n(null)}};return x.useEffect(()=>{r()},[t]),e}const Sb=Oi("bg-core-primary-500 text-core-white-900 relative inline-flex aspect-square shrink-0 items-center antialiased rounded-full overflow-hidden uppercase",{variants:{size:{xs:"h-6 w-6 text-xs ",sm:"h-8 w-8 text-sm",md:"h-10 w-10 text-base",lg:"h-12 w-12 text-lg",xl:"h-14 w-14 text-xl","2xl":"h-16 w-16 text-2xl"}},defaultVariants:{size:"sm"}}),Ib=({src:t,alt:e})=>v.jsx("img",{src:t,alt:e,className:"bg-core-white-900 aspect-square w-full grow rounded-full object-cover object-center"}),Tb=({initials:t})=>v.jsx("div",{className:"h-full w-full content-center text-center",children:t}),Ml=({src:t,alt:e,initials:n,size:r})=>v.jsxs("div",{className:Sb({size:r}),children:[t&&v.jsx(Ib,{src:t,alt:e}),t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(wn,{icon:"user",variant:"placeholder",outline:!1,size:r})}),!t&&n&&v.jsx(Tb,{initials:n}),!t&&!n&&v.jsx("div",{className:"flex grow h-full w-full bg-core-gray-100 justify-center items-center",children:v.jsx(wn,{icon:"user",variant:"placeholder",outline:!1,size:r})})]});Ml.displayName="Avatar";const xb=Oi("inline-flex items-center rounded-lg px-2 py-1 antialiased",{variants:{color:{primary:"text-core-primary-700 outline-core-primary-200 bg-core-primary-50",gray:"text-core-gray-700 outline-core-gray-200 bg-core-gray-50"},size:{sm:"text-xs leading-4 ",md:"text-sm leading-5 "},stroke:{true:"outline outline-1",false:""}},defaultVariants:{color:"primary",size:"sm",stroke:!1}}),Ll=({label:t,color:e="primary",size:n="sm",stroke:r=!1})=>v.jsx("span",{className:xb({color:e,size:n,stroke:r}),children:t});Ll.displayName="Badge";function Ob({body:t}){return v.jsxs("div",{className:"flex gap-3 rounded-r-lg border-l-2 border-core-primary-500 bg-core-gray-50 p-4 text-sm",children:[v.jsx(wn,{icon:"information",variant:"discovery"}),v.jsx("div",{children:t})]})}const Pb=Oi("group inline-flex shrink-0 select-none items-center justify-center font-medium transition-colors duration-100 antialiased rounded-lg hover:shadow-none focus:outline-0 focus:outline-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:pointer-events-none",{variants:{size:{sm:"h-8 gap-1 px-2 py-1 text-xs leading-4",md:"h-10 gap-1 px-3 py-2 text-sm leading-5",lg:"h-12 gap-1 px-3 py-3 text-base leading-6"},variant:{primary:"bg-core-primary-500 text-core-white-900 outline-primary hover:bg-core-primary-600 disabled:bg-core-primary-disabled",secondary:"box-border border border-core-gray-200 bg-core-white-900 shadow-xs hover:bg-core-gray-50 disabled:opacity-30",destructive:"bg-core-red-500 text-core-white-900 hover:bg-core-red-600 focus:outline-core-red-500 disabled:bg-core-red-200","destructive-outline":"box-border border border-core-red-200 text-core-red-700 shadow-xs hover:bg-core-red-50 focus:outline-core-red-500 disabled:opacity-40","link-gray":"bg-transparent hover:bg-surface hover:underline underline-offset-2 disabled:opacity-30"}},compoundVariants:[{variant:"link-gray",size:["md","lg"],class:"px-0 py-0"}],defaultVariants:{variant:"primary",size:"md"}}),rp={primary:"primary",secondary:"secondary",destructive:"primary","destructive-outline":"destructive","link-gray":"secondary"},op={md:"sm",lg:"md"},nt=({after:t,before:e,className:n,label:r="button",variant:o="primary",size:i="md",pending:a=!1,disabled:s=!1,onClick:c,...u})=>{const d=f=>{var p;return In("group-hover:opacity-70 ",(p=f.props)==null?void 0:p.className)},h=f=>{var p;return((p=f.props)==null?void 0:p.icon)??"user"};return v.jsxs("button",{className:In(Pb({variant:o,size:i}),n),disabled:s||a,onClick:c,...u,children:[v.jsxs("span",{className:`flex items-center gap-1 ${a&&"opacity-0"}`,children:[e&&v.jsx(wn,{className:d(e),icon:h(e),variant:rp[o],size:op[i]}),v.jsx("span",{children:r}),t&&v.jsx(wn,{className:In(d(t),`${a&&"opacity-0"}`),icon:h(t),variant:rp[o],size:op[i]})]}),a&&v.jsx(Sl,{className:"absolute"})]})};nt.displayName="Button";function Mt({children:t,id:e=x.useId()}){return v.jsx("div",{id:e,className:"flex h-full max-h-full flex-col bg-white md:h-fit md:rounded-lg md:border md:shadow-md",children:t})}function kt({children:t}){return v.jsx("div",{className:"grow overflow-y-auto px-6 py-4",children:t})}function rn({children:t}){return v.jsx("div",{className:"border-t px-6 py-4",children:t})}function Bt({children:t}){return v.jsx("div",{className:"border-b px-6",children:t})}const ip=({children:t,className:e,description:n,disabled:r,required:o=!1,tooltip:i,htmlFor:a})=>!t&&!i&&!n?null:v.jsx("label",{htmlFor:a,className:"inline-flex shrink-0 items-center gap-1 text-core-gray-800 antialiased ",children:v.jsxs("div",{className:In("inline-flex cursor-pointer items-center gap-1 text-sm font-medium leading-6",e,r&&"pointer-events-none text-core-gray-300"),children:[t?v.jsx("span",{className:In(r&&"pointer-events-none text-core-gray-300"),children:t}):null,n?v.jsx("span",{className:In("font-normal text-core-gray-500",r&&"text-current"),children:n}):null,o?v.jsx("span",{className:"font-normal text-core-red-500",children:"*"}):null]})}),ap=({helperText:t,error:e,disabled:n})=>t?v.jsx("span",{className:In("text-start text-sm leading-6 text-core-gray-500 antialiased ",e&&"text-core-red-500",n&&"text-core-gray-300"),children:t}):null;ip.displayName="Label",ap.displayName="HelperText";const kn=Object.assign(ip,{Helper:ap}),kb=({id:t,defaultChecked:e=!1,disabled:n,onChange:r})=>{const o=n,[i,a]=x.useState(e),s=c=>{o||a(!i),r&&r(c.target.checked)};return v.jsx("div",{className:"flex h-6 w-6 items-center justify-center",children:v.jsx("input",{className:"h-4 w-4 rounded border border-core-gray-200 bg-core-white-900 text-core-primary-500 shadow-xs hover:border-core-gray-300 hover:shadow-none checked:bg-core-primary-500focus:outline-0 focus:ring-core-primary-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 disabled:border disabled:border-core-gray-200 disabled:bg-core-gray-50 disabled:shadow-none disabled:checked:bg-core-gray-200",id:t,type:"checkbox",checked:i,onChange:s,disabled:o})})},sp=x.createContext(null);function cp(t=!1){const e=x.useContext(sp);if(!e&&!t)throw new Error("Checkbox.Item must be used within a CheckboxGroup or CheckboxGroup.Root");return e}const up=x.forwardRef(({children:t,description:e,disabled:n,helperText:r,id:o,label:i,required:a,tooltip:s},c)=>{const u=x.useId(),d=o??u,h=i??e??s??r?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(kn,{className:"cursor-default",description:e,required:a,tooltip:s,htmlFor:d,disabled:n,children:i}),v.jsx(kn.Helper,{disabled:n,helperText:r})]}):null;return v.jsx(sp.Provider,{value:{disabled:n},children:v.jsxs("div",{ref:c,"aria-describedby":r?`${d}__describer`:void 0,"aria-labelledby":i?`${d}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[i??r??e??s?v.jsx("div",{className:"flex flex-col",children:h}):null,t?v.jsx("div",{className:In("flex flex-col gap-2"),children:t}):null]})})});up.displayName="CheckboxGroup",Object.assign(up,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=cp(),{disabled:o}=r??{};return v.jsx(Fl,{disabled:t??o,label:e,defaultChecked:n})}});const Fl=({id:t,children:e,defaultChecked:n=!1,description:r,disabled:o,helperText:i,label:a,required:s=!1,tooltip:c,onChange:u})=>{const d=x.useId(),h=t??d,f=!!cp(!0),p=a??r??c??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(kn,{className:In(f&&"font-normal"),description:r,required:s,tooltip:c,htmlFor:h,disabled:o,children:a}),v.jsx(kn.Helper,{disabled:o,helperText:i})]}):null;return v.jsxs("div",{className:"flex gap-3",children:[v.jsx(kb,{id:h,defaultChecked:n,disabled:o,onChange:u}),e||p]})};Fl.displayName="Checkbox";function Oa(){return{subscribe:(r,o)=>{document.addEventListener(r,o)},unsubscribe:(r,o)=>{document.removeEventListener(r,o)},publish:(r,o)=>{const i=new CustomEvent(r,{detail:o});document.dispatchEvent(i)}}}function lp(t,e){x.useEffect(()=>{const n=o=>{t.current&&!t.current.contains(o.target)&&e(!1)},r=o=>{o.key==="Escape"&&e(!1)};return document.addEventListener("mousedown",n),document.addEventListener("keydown",r),()=>{document.removeEventListener("mousedown",n),document.removeEventListener("keydown",r)}},[])}const Bb=typeof window<"u"?x.useLayoutEffect:()=>{},Nb=()=>window.visualViewport?[window.visualViewport.width,window.visualViewport.height]:[window.innerWidth,window.innerHeight],Rb=()=>{const[t,e]=x.useState(),n=x.useCallback(()=>{const r=Nb();e(o=>o&&o[0]===r[0]&&o[1]===r[1]?o:r)},[]);return Bb(n,[n]),x.useEffect(()=>{var o;const r=()=>{n(),setTimeout(n,1e3)};return window.addEventListener("resize",r),window.addEventListener("orientationchange",r),(o=window.visualViewport)==null||o.addEventListener("resize",r),()=>{var i;window.removeEventListener("resize",r),window.removeEventListener("orientationchange",r),(i=window.visualViewport)==null||i.removeEventListener("resize",r)}},[n]),t};var dp={exports:{}};/*!
85
85
  *
86
86
  * react-simple-keyboard v3.7.121
87
87
  * https://github.com/hodgef/react-simple-keyboard
@@ -98,7 +98,7 @@ React keys must be passed directly to JSX without using spread:
98
98
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function p(H,$){if(H){if(typeof H=="string")return l(H,$);var J=Object.prototype.toString.call(H).slice(8,-1);return J==="Object"&&H.constructor&&(J=H.constructor.name),J==="Map"||J==="Set"?Array.from(H):J==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(J)?l(H,$):void 0}}function l(H,$){($==null||$>H.length)&&($=H.length);for(var J=0,S=new Array($);J<$;J++)S[J]=H[J];return S}function g(H){return g=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},g(H)}function m(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,w(S.key),S)}}function y(H,$,J){return($=w($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function w(H){var $=function(J,S){if(g(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S||"default");if(g(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(J)}(H,"string");return g($)=="symbol"?$:$+""}d.r(h),d.d(h,{SimpleKeyboard:function(){return _e},default:function(){return ve}}),d(5276),d(8598),d(4782),d(4554),d(2010),d(7427),d(6099),d(7495),d(8781),d(5440),d(744),d(2762),typeof Element>"u"||"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),typeof self<"u"&&"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(H){if("Element"in H){var $="classList",J="prototype",S=H.Element[J],M=Object,F=String[J].trim||function(){return this.replace(/^\s+|\s+$/g,"")},B=Array[J].indexOf||function(pe){for(var fe=0,ye=this.length;fe<ye;fe++)if(fe in this&&this[fe]===pe)return fe;return-1},Q=function(pe,fe){this.name=pe,this.code=DOMException[pe],this.message=fe},Z=function(pe,fe){if(fe==="")throw new Q("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(fe))throw new Q("INVALID_CHARACTER_ERR","The token must not contain space characters.");return B.call(pe,fe)},ee=function(pe){for(var fe=F.call(pe.getAttribute("class")||""),ye=fe?fe.split(/\s+/):[],ue=0,Oe=ye.length;ue<Oe;ue++)this.push(ye[ue]);this._updateClassName=function(){pe.setAttribute("class",this.toString())}},K=ee[J]=[],ge=function(){return new ee(this)};if(Q[J]=Error[J],K.item=function(pe){return this[pe]||null},K.contains=function(pe){return~Z(this,pe+"")},K.add=function(){var pe,fe=arguments,ye=0,ue=fe.length,Oe=!1;do~Z(this,pe=fe[ye]+"")||(this.push(pe),Oe=!0);while(++ye<ue);Oe&&this._updateClassName()},K.remove=function(){var pe,fe,ye=arguments,ue=0,Oe=ye.length,ke=!1;do for(fe=Z(this,pe=ye[ue]+"");~fe;)this.splice(fe,1),ke=!0,fe=Z(this,pe);while(++ue<Oe);ke&&this._updateClassName()},K.toggle=function(pe,fe){var ye=this.contains(pe),ue=ye?fe!==!0&&"remove":fe!==!1&&"add";return ue&&this[ue](pe),fe===!0||fe===!1?fe:!ye},K.replace=function(pe,fe){var ye=Z(pe+"");~ye&&(this.splice(ye,1,fe),this._updateClassName())},K.toString=function(){return this.join(" ")},M.defineProperty){var be={get:ge,enumerable:!0,configurable:!0};try{M.defineProperty(S,$,be)}catch(pe){pe.number!==void 0&&pe.number!==-2146823252||(be.enumerable=!1,M.defineProperty(S,$,be))}}else M[J].__defineGetter__&&S.__defineGetter__($,ge)}}(self),function(){var H=document.createElement("_");if(H.classList.add("c1","c2"),!H.classList.contains("c2")){var $=function(S){var M=DOMTokenList.prototype[S];DOMTokenList.prototype[S]=function(F){var B,Q=arguments.length;for(B=0;B<Q;B++)F=arguments[B],M.call(this,F)}};$("add"),$("remove")}if(H.classList.toggle("c3",!1),H.classList.contains("c3")){var J=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(S,M){return 1 in arguments&&!this.contains(S)==!M?M:J.call(this,S)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(S,M){var F=this.toString().split(" "),B=F.indexOf(S+"");~B&&(F=F.slice(B),this.remove.apply(this,F),this.add(M),this.add.apply(this,F.slice(1)))}),H=null}()),d(2675),d(9463),d(2259),d(5700),d(8706),d(2008),d(3418),d(4423),d(3792),d(2062),d(6910),d(739),d(9572),d(2892),d(9085),d(3851),d(1278),d(9432),d(4864),d(1699),d(7764),d(8344),d(3500),d(2953),d(2712),d(2637),d(1480),d(1761);var b=function(){return H=function S(M){var F=M.getOptions,B=M.getCaretPosition,Q=M.getCaretPositionEnd,Z=M.dispatch;(function(ee,K){if(!(ee instanceof K))throw new TypeError("Cannot call a class as a function")})(this,S),y(this,"getOptions",void 0),y(this,"getCaretPosition",void 0),y(this,"getCaretPositionEnd",void 0),y(this,"dispatch",void 0),y(this,"maxLengthReached",void 0),y(this,"isStandardButton",function(ee){return ee&&!(ee[0]==="{"&&ee[ee.length-1]==="}")}),this.getOptions=F,this.getCaretPosition=B,this.getCaretPositionEnd=Q,this.dispatch=Z,S.bindMethods(S,this)},$=[{key:"getButtonType",value:function(S){return S.includes("{")&&S.includes("}")&&S!=="{//}"?"functionBtn":"standardBtn"}},{key:"getButtonClass",value:function(S){var M=this.getButtonType(S),F=S.replace("{","").replace("}",""),B="";return M!=="standardBtn"&&(B=" hg-button-".concat(F)),"hg-".concat(M).concat(B)}},{key:"getDefaultDiplay",value:function(){return{"{bksp}":"backspace","{backspace}":"backspace","{enter}":"< enter","{shift}":"shift","{shiftleft}":"shift","{shiftright}":"shift","{alt}":"alt","{s}":"shift","{tab}":"tab","{lock}":"caps","{capslock}":"caps","{accept}":"Submit","{space}":" ","{//}":" ","{esc}":"esc","{escape}":"esc","{f1}":"f1","{f2}":"f2","{f3}":"f3","{f4}":"f4","{f5}":"f5","{f6}":"f6","{f7}":"f7","{f8}":"f8","{f9}":"f9","{f10}":"f10","{f11}":"f11","{f12}":"f12","{numpaddivide}":"/","{numlock}":"lock","{arrowup}":"↑","{arrowleft}":"←","{arrowdown}":"↓","{arrowright}":"→","{prtscr}":"print","{scrolllock}":"scroll","{pause}":"pause","{insert}":"ins","{home}":"home","{pageup}":"up","{delete}":"del","{forwarddelete}":"del","{end}":"end","{pagedown}":"down","{numpadmultiply}":"*","{numpadsubtract}":"-","{numpadadd}":"+","{numpadenter}":"enter","{period}":".","{numpaddecimal}":".","{numpad0}":"0","{numpad1}":"1","{numpad2}":"2","{numpad3}":"3","{numpad4}":"4","{numpad5}":"5","{numpad6}":"6","{numpad7}":"7","{numpad8}":"8","{numpad9}":"9"}}},{key:"getButtonDisplayName",value:function(S,M){return(M=arguments.length>2&&arguments[2]!==void 0&&arguments[2]?Object.assign({},this.getDefaultDiplay(),M):M||this.getDefaultDiplay())[S]||S}},{key:"getUpdatedInput",value:function(S,M,F){var B=arguments.length>3&&arguments[3]!==void 0?arguments[3]:F,Q=arguments.length>4&&arguments[4]!==void 0&&arguments[4],Z=this.getOptions(),ee=[F,B,Q],K=M;return(S==="{bksp}"||S==="{backspace}")&&K.length>0?K=this.removeAt.apply(this,[K].concat(ee)):(S==="{delete}"||S==="{forwarddelete}")&&K.length>0?K=this.removeForwardsAt.apply(this,[K].concat(ee)):S==="{space}"?K=this.addStringAt.apply(this,[K," "].concat(ee)):S!=="{tab}"||typeof Z.tabCharOnTab=="boolean"&&Z.tabCharOnTab===!1?S!=="{enter}"&&S!=="{numpadenter}"||!Z.newLineOnEnter?S.includes("numpad")&&Number.isInteger(Number(S[S.length-2]))?K=this.addStringAt.apply(this,[K,S[S.length-2]].concat(ee)):S==="{numpaddivide}"?K=this.addStringAt.apply(this,[K,"/"].concat(ee)):S==="{numpadmultiply}"?K=this.addStringAt.apply(this,[K,"*"].concat(ee)):S==="{numpadsubtract}"?K=this.addStringAt.apply(this,[K,"-"].concat(ee)):S==="{numpadadd}"?K=this.addStringAt.apply(this,[K,"+"].concat(ee)):S==="{numpaddecimal}"?K=this.addStringAt.apply(this,[K,"."].concat(ee)):S==="{"||S==="}"?K=this.addStringAt.apply(this,[K,S].concat(ee)):S.includes("{")||S.includes("}")||(K=this.addStringAt.apply(this,[K,S].concat(ee))):K=this.addStringAt.apply(this,[K,`
99
99
  `].concat(ee)):K=this.addStringAt.apply(this,[K," "].concat(ee)),Z.debug&&console.log("Input will be: "+K),K}},{key:"updateCaretPos",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0&&arguments[1],F=this.updateCaretPosAction(S,M);this.dispatch(function(B){B.setCaretPosition(F)})}},{key:"updateCaretPosAction",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0&&arguments[1],F=this.getOptions(),B=this.getCaretPosition();return B!=null&&(M?B>0&&(B-=S):B+=S),F.debug&&console.log("Caret at:",B),B}},{key:"addStringAt",value:function(S,M){var F,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.length,Q=arguments.length>3&&arguments[3]!==void 0?arguments[3]:S.length,Z=arguments.length>4&&arguments[4]!==void 0&&arguments[4];return B||B===0?(F=[S.slice(0,B),M,S.slice(Q)].join(""),this.isMaxLengthReached()||Z&&this.updateCaretPos(M.length)):F=S+M,F}},{key:"removeAt",value:function(S){var M,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.length,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.length,Q=arguments.length>3&&arguments[3]!==void 0&&arguments[3];if(F===0&&B===0)return S;if(F===B){var Z=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;F&&F>=0?S.substring(F-2,F).match(Z)?(M=S.substr(0,F-2)+S.substr(F),Q&&this.updateCaretPos(2,!0)):(M=S.substr(0,F-1)+S.substr(F),Q&&this.updateCaretPos(1,!0)):S.slice(-2).match(Z)?(M=S.slice(0,-2),Q&&this.updateCaretPos(2,!0)):(M=S.slice(0,-1),Q&&this.updateCaretPos(1,!0))}else M=S.slice(0,F)+S.slice(B),Q&&this.dispatch(function(ee){ee.setCaretPosition(F)});return M}},{key:"removeForwardsAt",value:function(S){var M,F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S.length,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:S.length,Q=arguments.length>3&&arguments[3]!==void 0&&arguments[3];return S!=null&&S.length&&F!==null?(F===B?M=S.substring(F,F+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?S.substr(0,F)+S.substr(F+2):S.substr(0,F)+S.substr(F+1):(M=S.slice(0,F)+S.slice(B),Q&&this.dispatch(function(Z){Z.setCaretPosition(F)})),M):S}},{key:"handleMaxLength",value:function(S,M){var F=this.getOptions(),B=F.maxLength,Q=S[F.inputName||"default"],Z=M.length-1>=B;if(M.length<=Q.length)return!1;if(Number.isInteger(B))return F.debug&&console.log("maxLength (num) reached:",Z),Z?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if(g(B)==="object"){var ee=M.length-1>=B[F.inputName||"default"];return F.debug&&console.log("maxLength (obj) reached:",ee),ee?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return!!this.maxLengthReached}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(S){return S?S.toLowerCase().trim().split(/[.\-_\s]/g).reduce(function(M,F){return F.length?M+F[0].toUpperCase()+F.slice(1):M}):""}},{key:"chunkArray",value:function(S,M){return f(Array(Math.ceil(S.length/M))).map(function(F,B){return S.slice(M*B,M+M*B)})}},{key:"escapeRegex",value:function(S){return S.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}},{key:"getRtlOffset",value:function(S,M){var F=S,B=M.indexOf("‫");return B<S&&B!=-1&&F--,M.indexOf("‬")<S&&B!=-1&&F--,F<0?0:F}}],J=[{key:"bindMethods",value:function(S,M){var F,B=function(Z,ee){var K=typeof Symbol<"u"&&Z[Symbol.iterator]||Z["@@iterator"];if(!K){if(Array.isArray(Z)||(K=p(Z))||ee){K&&(Z=K);var ge=0,be=function(){};return{s:be,n:function(){return ge>=Z.length?{done:!0}:{done:!1,value:Z[ge++]}},e:function(ue){throw ue},f:be}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
100
100
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var pe,fe=!0,ye=!1;return{s:function(){K=K.call(Z)},n:function(){var ue=K.next();return fe=ue.done,ue},e:function(ue){ye=!0,pe=ue},f:function(){try{fe||K.return==null||K.return()}finally{if(ye)throw pe}}}}(Object.getOwnPropertyNames(S.prototype));try{for(B.s();!(F=B.n()).done;){var Q=F.value;Q==="constructor"||Q==="bindMethods"||(M[Q]=M[Q].bind(M))}}catch(Z){B.e(Z)}finally{B.f()}}}],$&&m(H.prototype,$),J&&m(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}();y(b,"noop",function(){});var E=b;function C(H){return C=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},C(H)}function I(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,P(S.key),S)}}function T(H,$,J){return($=P($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function P(H){var $=function(J,S){if(C(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(C(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return C($)=="symbol"?$:$+""}var N=function(){return H=function S(M){var F=this,B=M.dispatch,Q=M.getOptions;(function(Z,ee){if(!(Z instanceof ee))throw new TypeError("Cannot call a class as a function")})(this,S),T(this,"getOptions",void 0),T(this,"dispatch",void 0),T(this,"isModifierKey",function(Z){return Z.altKey||Z.ctrlKey||Z.shiftKey||["Tab","CapsLock","Esc","ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(Z.code||Z.key||F.keyCodeToKey(Z==null?void 0:Z.keyCode))}),this.dispatch=B,this.getOptions=Q,E.bindMethods(S,this)},($=[{key:"handleHighlightKeyDown",value:function(S){var M=this.getOptions();M.physicalKeyboardHighlightPreventDefault&&this.isModifierKey(S)&&(S.preventDefault(),S.stopImmediatePropagation());var F=this.getSimpleKeyboardLayoutKey(S);this.dispatch(function(B){var Q,Z,ee=B.getButtonElement(F),K=B.getButtonElement("{".concat(F,"}"));if(ee)Q=ee,Z=F;else{if(!K)return;Q=K,Z="{".concat(F,"}")}var ge,be,pe,fe,ye=function(Oe){Oe.style.background=M.physicalKeyboardHighlightBgColor||"#dadce4",Oe.style.color=M.physicalKeyboardHighlightTextColor||"black"};if(Q)if(Array.isArray(Q)){if(Q.forEach(function(Oe){return ye(Oe)}),M.physicalKeyboardHighlightPress)if(M.physicalKeyboardHighlightPressUsePointerEvents)(ge=Q[0])===null||ge===void 0||(be=ge.onpointerdown)===null||be===void 0||be.call(ge,S);else if(M.physicalKeyboardHighlightPressUseClick){var ue;(ue=Q[0])===null||ue===void 0||ue.click()}else B.handleButtonClicked(Z,S)}else ye(Q),M.physicalKeyboardHighlightPress&&(M.physicalKeyboardHighlightPressUsePointerEvents?(pe=Q)===null||pe===void 0||(fe=pe.onpointerdown)===null||fe===void 0||fe.call(pe,S):M.physicalKeyboardHighlightPressUseClick?Q.click():B.handleButtonClicked(Z,S))})}},{key:"handleHighlightKeyUp",value:function(S){var M=this.getOptions();M.physicalKeyboardHighlightPreventDefault&&this.isModifierKey(S)&&(S.preventDefault(),S.stopImmediatePropagation());var F=this.getSimpleKeyboardLayoutKey(S);this.dispatch(function(B){var Q,Z,ee,K=B.getButtonElement(F)||B.getButtonElement("{".concat(F,"}")),ge=function(be){be.removeAttribute&&be.removeAttribute("style")};K&&(Array.isArray(K)?(K.forEach(function(be){return ge(be)}),M.physicalKeyboardHighlightPressUsePointerEvents&&((Q=K[0])===null||Q===void 0||(Z=Q.onpointerup)===null||Z===void 0||Z.call(Q,S))):(ge(K),M.physicalKeyboardHighlightPressUsePointerEvents&&(K==null||(ee=K.onpointerup)===null||ee===void 0||ee.call(K,S))))})}},{key:"getSimpleKeyboardLayoutKey",value:function(S){var M,F="",B=S.code||S.key||this.keyCodeToKey(S==null?void 0:S.keyCode);return(F=B!=null&&B.includes("Numpad")||B!=null&&B.includes("Shift")||B!=null&&B.includes("Space")||B!=null&&B.includes("Backspace")||B!=null&&B.includes("Control")||B!=null&&B.includes("Alt")||B!=null&&B.includes("Meta")?S.code||"":S.key||this.keyCodeToKey(S==null?void 0:S.keyCode)||"").length>1?(M=F)===null||M===void 0?void 0:M.toLowerCase():F}},{key:"keyCodeToKey",value:function(S){return{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[S]||""}}])&&I(H.prototype,$),J&&I(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}();function L(H){return L=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},L(H)}function V(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,W(S.key),S)}}function j(H,$,J){return($=W($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function W(H){var $=function(J,S){if(L(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(L(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return L($)=="symbol"?$:$+""}var q=function(){return H=function S(M){var F=M.utilities,B=M.options;(function(Q,Z){if(!(Q instanceof Z))throw new TypeError("Cannot call a class as a function")})(this,S),j(this,"utilities",void 0),j(this,"options",void 0),j(this,"candidateBoxElement",void 0),j(this,"pageIndex",0),j(this,"pageSize",void 0),this.utilities=F,this.options=B,E.bindMethods(S,this),this.pageSize=this.utilities.getOptions().layoutCandidatesPageSize||5},$=[{key:"destroy",value:function(){this.candidateBoxElement&&(this.candidateBoxElement.remove(),this.pageIndex=0)}},{key:"show",value:function(S){var M=this,F=S.candidateValue,B=S.targetElement,Q=S.onSelect;if(F&&F.length){var Z=this.utilities.chunkArray(F.split(" "),this.pageSize);this.renderPage({candidateListPages:Z,targetElement:B,pageIndex:this.pageIndex,nbPages:Z.length,onItemSelected:function(ee,K){Q(ee,K),M.destroy()}})}}},{key:"renderPage",value:function(S){var M,F=this,B=S.candidateListPages,Q=S.targetElement,Z=S.pageIndex,ee=S.nbPages,K=S.onItemSelected;(M=this.candidateBoxElement)===null||M===void 0||M.remove(),this.candidateBoxElement=document.createElement("div"),this.candidateBoxElement.className="hg-candidate-box";var ge=document.createElement("ul");ge.className="hg-candidate-box-list",B[Z].forEach(function(ke){var at,ze=document.createElement("li"),It=function(){var ht=new(F.options.useTouchEvents?TouchEvent:MouseEvent)("click");return Object.defineProperty(ht,"target",{value:ze}),ht};ze.className="hg-candidate-box-list-item",ze.innerHTML=((at=F.options.display)===null||at===void 0?void 0:at[ke])||ke,F.options.useTouchEvents?ze.ontouchstart=function(ht){return K(ke,ht||It())}:ze.onclick=function(){var ht=arguments.length>0&&arguments[0]!==void 0?arguments[0]:It();return K(ke,ht)},ge.appendChild(ze)});var be=Z>0,pe=document.createElement("div");pe.classList.add("hg-candidate-box-prev"),be&&pe.classList.add("hg-candidate-box-btn-active");var fe=function(){be&&F.renderPage({candidateListPages:B,targetElement:Q,pageIndex:Z-1,nbPages:ee,onItemSelected:K})};this.options.useTouchEvents?pe.ontouchstart=fe:pe.onclick=fe,this.candidateBoxElement.appendChild(pe),this.candidateBoxElement.appendChild(ge);var ye=Z<ee-1,ue=document.createElement("div");ue.classList.add("hg-candidate-box-next"),ye&&ue.classList.add("hg-candidate-box-btn-active");var Oe=function(){ye&&F.renderPage({candidateListPages:B,targetElement:Q,pageIndex:Z+1,nbPages:ee,onItemSelected:K})};this.options.useTouchEvents?ue.ontouchstart=Oe:ue.onclick=Oe,this.candidateBoxElement.appendChild(ue),Q.prepend(this.candidateBoxElement)}}],$&&V(H.prototype,$),J&&V(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}(),k=q;function U(H){return function($){if(Array.isArray($))return z($)}(H)||function($){if(typeof Symbol<"u"&&$[Symbol.iterator]!=null||$["@@iterator"]!=null)return Array.from($)}(H)||function($,J){if($){if(typeof $=="string")return z($,J);var S=Object.prototype.toString.call($).slice(8,-1);return S==="Object"&&$.constructor&&(S=$.constructor.name),S==="Map"||S==="Set"?Array.from($):S==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(S)?z($,J):void 0}}(H)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
101
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(H,$){($==null||$>H.length)&&($=H.length);for(var J=0,S=new Array($);J<$;J++)S[J]=H[J];return S}function te(H){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},te(H)}function oe(H,$){var J=Object.keys(H);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(H);$&&(S=S.filter(function(M){return Object.getOwnPropertyDescriptor(H,M).enumerable})),J.push.apply(J,S)}return J}function ne(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,we(S.key),S)}}function se(H,$,J){return($=we($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function we(H){var $=function(J,S){if(te(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(te(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return te($)=="symbol"?$:$+""}var le=function(){return H=function S(M,F){var B=this;if(function(fe,ye){if(!(fe instanceof ye))throw new TypeError("Cannot call a class as a function")}(this,S),se(this,"input",void 0),se(this,"options",void 0),se(this,"utilities",void 0),se(this,"caretPosition",void 0),se(this,"caretPositionEnd",void 0),se(this,"keyboardDOM",void 0),se(this,"keyboardPluginClasses",void 0),se(this,"keyboardDOMClass",void 0),se(this,"buttonElements",void 0),se(this,"currentInstanceName",void 0),se(this,"allKeyboardInstances",void 0),se(this,"keyboardInstanceNames",void 0),se(this,"isFirstKeyboardInstance",void 0),se(this,"physicalKeyboard",void 0),se(this,"modules",void 0),se(this,"activeButtonClass",void 0),se(this,"holdInteractionTimeout",void 0),se(this,"holdTimeout",void 0),se(this,"isMouseHold",void 0),se(this,"initialized",void 0),se(this,"candidateBox",void 0),se(this,"keyboardRowsDOM",void 0),se(this,"defaultName","default"),se(this,"activeInputElement",null),se(this,"handleParams",function(fe,ye){var ue,Oe,ke;if(typeof fe=="string")ue=fe.split(".").join(""),Oe=document.querySelector(".".concat(ue)),ke=ye;else if(fe instanceof HTMLDivElement){if(!fe.className)throw console.warn("Any DOM element passed as parameter must have a class."),new Error("KEYBOARD_DOM_CLASS_ERROR");ue=fe.className.split(" ")[0],Oe=fe,ke=ye}else ue="simple-keyboard",Oe=document.querySelector(".".concat(ue)),ke=fe;return{keyboardDOMClass:ue,keyboardDOM:Oe,options:ke}}),se(this,"getOptions",function(){return B.options}),se(this,"getCaretPosition",function(){return B.caretPosition}),se(this,"getCaretPositionEnd",function(){return B.caretPositionEnd}),se(this,"registerModule",function(fe,ye){B.modules[fe]||(B.modules[fe]={}),ye(B.modules[fe])}),se(this,"getKeyboardClassString",function(){for(var fe=arguments.length,ye=new Array(fe),ue=0;ue<fe;ue++)ye[ue]=arguments[ue];return[B.keyboardDOMClass].concat(ye).filter(function(Oe){return!!Oe}).join(" ")}),typeof window<"u"){var Q=this.handleParams(M,F),Z=Q.keyboardDOMClass,ee=Q.keyboardDOM,K=Q.options,ge=K===void 0?{}:K;this.utilities=new E({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=ee,this.options=function(fe){for(var ye=1;ye<arguments.length;ye++){var ue=arguments[ye]!=null?arguments[ye]:{};ye%2?oe(Object(ue),!0).forEach(function(Oe){se(fe,Oe,ue[Oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(ue)):oe(Object(ue)).forEach(function(Oe){Object.defineProperty(fe,Oe,Object.getOwnPropertyDescriptor(ue,Oe))})}return fe}({layoutName:"default",theme:"hg-theme-default",inputName:"default",preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},ge),this.keyboardPluginClasses="",E.bindMethods(S,this);var be=this.options.inputName,pe=be===void 0?this.defaultName:be;if(this.input={},this.input[pe]="",this.keyboardDOMClass=Z,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new N({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new k({utilities:this.utilities,options:this.options}):null,!this.keyboardDOM)throw console.warn('".'.concat(Z,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}},$=[{key:"setCaretPosition",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;this.caretPosition=S,this.caretPositionEnd=M}},{key:"getInputCandidates",value:function(S){var M=this,F=this.options,B=F.layoutCandidates,Q=F.layoutCandidatesCaseSensitiveMatch;if(!B||te(B)!=="object")return{};var Z=Object.keys(B).filter(function(ge){var be=S.substring(0,M.getCaretPositionEnd()||0)||S,pe=new RegExp("".concat(M.utilities.escapeRegex(ge),"$"),Q?"g":"gi");return!!U(be.matchAll(pe)).length});if(Z.length>1){var ee=Z.sort(function(ge,be){return be.length-ge.length})[0];return{candidateKey:ee,candidateValue:B[ee]}}if(Z.length){var K=Z[0];return{candidateKey:K,candidateValue:B[K]}}return{}}},{key:"showCandidatesBox",value:function(S,M,F){var B=this;this.candidateBox&&this.candidateBox.show({candidateValue:M,targetElement:F,onSelect:function(Q,Z){var ee=B.options,K=ee.layoutCandidatesCaseSensitiveMatch,ge=ee.disableCandidateNormalization,be=ee.enableLayoutCandidatesKeyPress,pe=Q;ge||(pe=Q.normalize("NFD")),typeof B.options.beforeInputUpdate=="function"&&B.options.beforeInputUpdate(B);var fe=B.getInput(B.options.inputName,!0),ye=B.getCaretPositionEnd()||0,ue=fe.substring(0,ye||0)||fe,Oe=new RegExp("".concat(B.utilities.escapeRegex(S),"$"),K?"g":"gi"),ke=ue.replace(Oe,pe),at=fe.replace(ue,ke),ze=ke.length-ue.length,It=(ye||fe.length)+ze;It<0&&(It=0),B.setInput(at,B.options.inputName,!0),B.setCaretPosition(It),be&&typeof B.options.onKeyPress=="function"&&B.options.onKeyPress(Q,Z),typeof B.options.onChange=="function"&&B.options.onChange(B.getInput(B.options.inputName,!0),Z),typeof B.options.onChangeAll=="function"&&B.options.onChangeAll(B.getAllInputs(),Z)}})}},{key:"handleButtonClicked",value:function(S,M){var F=this.options,B=F.inputName,Q=B===void 0?this.defaultName:B,Z=F.debug;if(S!=="{//}"){this.input[Q]||(this.input[Q]=""),typeof this.options.beforeInputUpdate=="function"&&this.options.beforeInputUpdate(this);var ee=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(S)&&this.activeInputElement&&this.input[Q]&&this.input[Q]===ee&&this.caretPosition===0&&this.caretPositionEnd===ee.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(S,M);if(typeof this.options.onKeyPress=="function"&&this.options.onKeyPress(S,M),this.input[Q]!==ee&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(ee))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,ee))return;var K=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(K,this.options.inputName,!0),Z&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),M==null?void 0:M.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),typeof this.options.onChange=="function"&&this.options.onChange(this.getInput(this.options.inputName,!0),M),typeof this.options.onChangeAll=="function"&&this.options.onChangeAll(this.getAllInputs(),M),M!=null&&M.target&&this.options.enableLayoutCandidates){var ge,be=this.getInputCandidates(ee),pe=be.candidateKey,fe=be.candidateValue;pe&&fe?this.showCandidatesBox(pe,fe,this.keyboardDOM):(ge=this.candidateBox)===null||ge===void 0||ge.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),Z&&console.log("Key pressed:",S)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(S){this.options.syncInstanceInputs?this.dispatch(function(M){M.isMouseHold=S}):this.isMouseHold=S}},{key:"handleButtonMouseDown",value:function(S,M){var F=this;M&&(this.options.preventMouseDownDefault&&M.preventDefault(),this.options.stopMouseDownPropagation&&M.stopPropagation(),M.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout(function(){(F.getMouseHold()&&(!S.includes("{")&&!S.includes("}")||S==="{delete}"||S==="{backspace}"||S==="{bksp}"||S==="{space}"||S==="{tab}")||S==="{arrowright}"||S==="{arrowleft}"||S==="{arrowup}"||S==="{arrowdown}")&&(F.options.debug&&console.log("Button held:",S),F.handleButtonHold(S)),clearTimeout(F.holdTimeout)},500))}},{key:"handleButtonMouseUp",value:function(S,M){var F=this;M&&(this.options.preventMouseUpDefault&&M.preventDefault&&M.preventDefault(),this.options.stopMouseUpPropagation&&M.stopPropagation&&M.stopPropagation(),!(M.target===this.keyboardDOM||M.target&&this.keyboardDOM.contains(M.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(M.target===this.candidateBox.candidateBoxElement||M.target&&this.candidateBox.candidateBoxElement.contains(M.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons(function(B){B.classList.remove(F.activeButtonClass)}),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),S&&typeof this.options.onKeyReleased=="function"&&this.options.onKeyReleased(S,M)}},{key:"handleKeyboardContainerMouseDown",value:function(S){this.options.preventMouseDownDefault&&S.preventDefault()}},{key:"handleButtonHold",value:function(S){var M=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout(function(){M.getMouseHold()?(M.handleButtonClicked(S),M.handleButtonHold(S)):clearTimeout(M.holdInteractionTimeout)},100)}},{key:"syncInstanceInputs",value:function(){var S=this;this.dispatch(function(M){M.replaceInput(S.input),M.setCaretPosition(S.caretPosition,S.caretPositionEnd)})}},{key:"clearInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName;this.input[S]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName,M=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.options.syncInstanceInputs&&!M&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[S].replace("‫","").replace("‬","")+"‬":this.input[S]}},{key:"getAllInputs",value:function(){var S=this,M={};return Object.keys(this.input).forEach(function(F){M[F]=S.getInput(F,!0)}),M}},{key:"setInput",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.inputName||this.defaultName,F=arguments.length>2?arguments[2]:void 0;this.input[M]=S,!F&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(S){this.input=S}},{key:"setOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=this.changedOptions(S);this.options=Object.assign(this.options,S),M.length&&(this.options.debug&&console.log("changedOptions",M),this.onSetOptions(M),this.render())}},{key:"changedOptions",value:function(S){var M=this;return Object.keys(S).filter(function(F){return JSON.stringify(S[F])!==JSON.stringify(M.options[F])})}},{key:"onSetOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];S.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(S.includes("layoutCandidatesPageSize")||S.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new k({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(S){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach(function(M){S(window.SimpleKeyboardInstances[M],M)})}},{key:"addButtonTheme",value:function(S,M){var F=this;M&&S&&(S.split(" ").forEach(function(B){M.split(" ").forEach(function(Q){F.options.buttonTheme||(F.options.buttonTheme=[]);var Z=!1;F.options.buttonTheme.map(function(ee){if(ee!=null&&ee.class.split(" ").includes(Q)){Z=!0;var K=ee.buttons.split(" ");K.includes(B)||(Z=!0,K.push(B),ee.buttons=K.join(" "))}return ee}),Z||F.options.buttonTheme.push({class:Q,buttons:S})})}),this.render())}},{key:"removeButtonTheme",value:function(S,M){var F=this;if(!S&&!M)return this.options.buttonTheme=[],void this.render();S&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(S.split(" ").forEach(function(B){var Q;(Q=F.options)===null||Q===void 0||(Q=Q.buttonTheme)===null||Q===void 0||Q.map(function(Z,ee){if(Z&&M&&M.includes(Z.class)||!M){var K,ge,be=(K=Z)===null||K===void 0?void 0:K.buttons.split(" ").filter(function(pe){return pe!==B});Z&&be!=null&&be.length?Z.buttons=be.join(" "):((ge=F.options.buttonTheme)===null||ge===void 0||ge.splice(ee,1),Z=null)}return Z})}),this.render())}},{key:"getButtonElement",value:function(S){var M,F=this.buttonElements[S];return F&&(M=F.length>1?F:F[0]),M}},{key:"inputPatternIsValid",value:function(S){var M,F=this.options.inputPattern;if((M=F instanceof RegExp?F:F[this.options.inputName||this.defaultName])&&S){var B=M.test(S);return this.options.debug&&console.log('inputPattern ("'.concat(M,'"): ').concat(B?"passed":"did not pass!")),B}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.addEventListener("keyup",this.handleKeyUp,M),document.addEventListener("keydown",this.handleKeyDown,M),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(S){this.caretEventHandler(S),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(S)}},{key:"handleKeyDown",value:function(S){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(S)}},{key:"handleMouseUp",value:function(S){this.caretEventHandler(S)}},{key:"handleTouchEnd",value:function(S){this.caretEventHandler(S)}},{key:"handleSelect",value:function(S){this.caretEventHandler(S)}},{key:"handleSelectionChange",value:function(S){navigator.userAgent.includes("Firefox")||this.caretEventHandler(S)}},{key:"caretEventHandler",value:function(S){var M,F=this;S.target.tagName&&(M=S.target.tagName.toLowerCase()),this.dispatch(function(B){var Q=S.target===B.keyboardDOM||S.target&&B.keyboardDOM.contains(S.target);if(F.options.syncInstanceInputs&&Array.isArray(S.path)&&(Q=S.path.some(function(K){var ge;return K==null||(ge=K.hasAttribute)===null||ge===void 0?void 0:ge.call(K,"data-skInstance")})),(M==="textarea"||M==="input"&&["text","search","url","tel","password"].includes(S.target.type))&&!B.options.disableCaretPositioning){var Z=S.target.selectionStart,ee=S.target.selectionEnd;B.options.rtl&&(Z=B.utilities.getRtlOffset(Z,B.getInput()),ee=B.utilities.getRtlOffset(ee,B.getInput())),B.setCaretPosition(Z,ee),F.activeInputElement=S.target,B.options.debug&&console.log("Caret at: ",B.getCaretPosition(),B.getCaretPositionEnd(),S&&S.target.tagName.toLowerCase(),"(".concat(B.keyboardDOMClass,")"),S==null?void 0:S.type)}else!B.options.disableCaretPositioning&&Q||(S==null?void 0:S.type)==="selectionchange"||(B.setCaretPosition(null),F.activeInputElement=null,B.options.debug&&console.log('Caret position reset due to "'.concat(S==null?void 0:S.type,'" event'),S))})}},{key:"recurseButtons",value:function(S){var M=this;S&&Object.keys(this.buttonElements).forEach(function(F){return M.buttonElements[F].forEach(S)})}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.removeEventListener("keyup",this.handleKeyUp,M),document.removeEventListener("keydown",this.handleKeyDown,M),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons(function(F){F&&(F.onpointerdown=null,F.onpointerup=null,F.onpointercancel=null,F.ontouchstart=null,F.ontouchend=null,F.ontouchcancel=null,F.onclick=null,F.onmousedown=null,F.onmouseup=null,F.remove(),F=null)}),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(S){var M=this.options.buttonTheme,F=[];return Array.isArray(M)&&M.forEach(function(B){if(B&&B.class&&typeof B.class=="string"&&B.buttons&&typeof B.buttons=="string"){var Q=B.class.split(" ");B.buttons.split(" ").includes(S)&&(F=[].concat(U(F),U(Q)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',B)}),F}},{key:"setDOMButtonAttributes",value:function(S,M){var F=this.options.buttonAttributes;Array.isArray(F)&&F.forEach(function(B){B.attribute&&typeof B.attribute=="string"&&B.value&&typeof B.value=="string"&&B.buttons&&typeof B.buttons=="string"?B.buttons.split(" ").includes(S)&&M(B.attribute,B.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',B)})}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(S){if(S.target.classList.contains("hg-button"))return S.preventDefault(),S.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),typeof this.options.onInit=="function"&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),typeof this.options.beforeFirstRender=="function"&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){typeof this.options.beforeRender=="function"&&this.options.beforeRender(this)}},{key:"onRender",value:function(){typeof this.options.onRender=="function"&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){typeof this.options.onModulesLoaded=="function"&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var S=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach(function(M){var F=new M(S);F.init&&F.init(S)}),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(S,M){return!!this.modules[S]&&this.modules[S][M]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(S,M,F,B){var Q=this,Z=Array.from(S.children),ee=0;return Z.length&&F.forEach(function(K,ge){var be=B[ge];if(!(be&&be>K))return!1;var pe=K-ee,fe=be-ee,ye=document.createElement("div");ye.className+="hg-button-container";var ue="".concat(Q.options.layoutName,"-r").concat(M,"c").concat(ge);ye.setAttribute("data-skUID",ue);var Oe=Z.splice(pe,fe-pe+1);ee=fe-pe,Oe.forEach(function(ke){return ye.appendChild(ke)}),Z.splice(pe,0,ye),S.innerHTML="",Z.forEach(function(ke){return S.appendChild(ke)}),Q.options.debug&&console.log("rowDOMContainer",Oe,pe,fe,ee+1)}),S}},{key:"render",value:function(){var S=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var M="hg-layout-".concat(this.options.layoutName),F=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},B=this.options.useTouchEvents||!1,Q=B?"hg-touch-events":"",Z=this.options.useMouseEvents||!1,ee=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,M,this.keyboardPluginClasses,Q),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",F[this.options.layoutName||this.defaultName].forEach(function(K,ge){var be=K.split(" ");S.options.excludeFromLayout&&S.options.excludeFromLayout[S.options.layoutName||S.defaultName]&&(be=be.filter(function(ue){return S.options.excludeFromLayout&&!S.options.excludeFromLayout[S.options.layoutName||S.defaultName].includes(ue)}));var pe=document.createElement("div");pe.className+="hg-row";var fe=[],ye=[];be.forEach(function(ue,Oe){var ke,at=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("[")===0,ze=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("]")===ue.length-1;at&&(fe.push(Oe),ue=ue.replace(/\[/g,"")),ze&&(ye.push(Oe),ue=ue.replace(/\]/g,""));var It=S.utilities.getButtonClass(ue),ht=S.utilities.getButtonDisplayName(ue,S.options.display,S.options.mergeDisplay),wr=S.options.useButtonTag?"button":"div",pt=document.createElement(wr);pt.className+="hg-button ".concat(It),(ke=pt.classList).add.apply(ke,U(S.getButtonThemeClasses(ue))),S.setDOMButtonAttributes(ue,function(De,Pr){pt.setAttribute(De,Pr)}),S.activeButtonClass="hg-activeButton",!S.utilities.pointerEventsSupported()||B||Z?B?(pt.ontouchstart=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.ontouchend=function(De){S.handleButtonMouseUp(ue,De)},pt.ontouchcancel=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onclick=function(De){S.setMouseHold(!1),typeof S.options.onKeyReleased!="function"&&S.handleButtonClicked(ue,De)},pt.onmousedown=function(De){typeof S.options.onKeyReleased!="function"||S.isMouseHold||S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onmouseup=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onpointerdown=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onpointerup=function(De){S.handleButtonMouseUp(ue,De)},pt.onpointercancel=function(De){S.handleButtonMouseUp(ue,De)}),pt.setAttribute("data-skBtn",ue);var mn="".concat(S.options.layoutName,"-r").concat(ge,"b").concat(Oe);pt.setAttribute("data-skBtnUID",mn);var Ot=document.createElement("span");Ot.innerHTML=ht,pt.appendChild(Ot),S.buttonElements[ue]||(S.buttonElements[ue]=[]),S.buttonElements[ue].push(pt),pe.appendChild(pt)}),pe=S.parseRowDOMContainers(pe,ge,fe,ye),S.keyboardRowsDOM.appendChild(pe)}),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||B||Z?B?(document.ontouchend=function(K){return S.handleButtonMouseUp(void 0,K)},document.ontouchcancel=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.ontouchstart=function(K){return S.handleKeyboardContainerMouseDown(K)}):B||(document.onmouseup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onmousedown=function(K){return S.handleKeyboardContainerMouseDown(K)}):(document.onpointerup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onpointerdown=function(K){return S.handleKeyboardContainerMouseDown(K)}),this.onInit())}}],$&&ne(H.prototype,$),J&&ne(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}(),_e=le,ve=le}(),h}()},442:function(s){s.exports=n}},o={};function i(s){var c=o[s];if(c!==void 0)return c.exports;var u=o[s]={exports:{}};return r[s].call(u.exports,u,u.exports,i),u.exports}i.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(c,{a:c}),c},i.d=function(s,c){for(var u in c)i.o(c,u)&&!i.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:c[u]})},i.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var a={};return function(){i.r(a),i.d(a,{KeyboardReact:function(){return g},default:function(){return m}}),i(981);var s=i(442),c=i(548),u=i.n(c);function d(y){return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(y)}function h(y,w){var b=Object.keys(y);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(y);w&&(E=E.filter(function(C){return Object.getOwnPropertyDescriptor(y,C).enumerable})),b.push.apply(b,E)}return b}function f(y){for(var w=1;w<arguments.length;w++){var b=arguments[w]!=null?arguments[w]:{};w%2?h(Object(b),!0).forEach(function(E){p(y,E,b[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(b)):h(Object(b)).forEach(function(E){Object.defineProperty(y,E,Object.getOwnPropertyDescriptor(b,E))})}return y}function p(y,w,b){var E;return E=function(C,I){if(d(C)!="object"||!C)return C;var T=C[Symbol.toPrimitive];if(T!==void 0){var P=T.call(C,I||"default");if(d(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(C)}(w,"string"),(w=d(E)=="symbol"?E:E+"")in y?Object.defineProperty(y,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[w]=b,y}var l=function(y){return f(f({},y),{},{keyboardRef:null})},g=function(y){var w=y.baseClass||"react-simple-keyboard",b=s.useRef(null),E=s.useRef(null),C=s.useRef(null),I=s.useRef(y);return s.useEffect(function(){return function(){C.current&&C.current.destroy(),b.current=!1}},[]),s.useEffect(function(){var T=function(j){return f(f({},j),{},{theme:"simple-keyboard ".concat(j.theme||"hg-theme-default")})}(y);if(!b.current){b.current=!0,T.debug&&console.log("ReactSimpleKeyboard: Init");var P=E.current,N=".".concat(w);C.current=new(u())(P||N,T),T.keyboardRef&&T.keyboardRef(C.current)}var L=function(j,W){var q=l(W),k=l(j);return Object.keys(q).filter(function(U){return q[U]!==k[U]})}(I.current,T);if(L.length){var V=C.current;I.current=T,V==null||V.setOptions(T),T.debug&&console.log("ReactSimpleKeyboard - setOptions called due to updated props:",L)}},[b,w,I,y]),s.createElement("div",{className:w,ref:E})},m=g}(),a}()})})(dp);var Db=dp.exports;const Mb=Fu(Db);function fp({onChange:t,keyboardRef:e,layout:n,theme:r}){const[o,i]=x.useState("default"),a=s=>{(s==="{shift}"||s==="{lock}")&&i(o==="default"?"shift":"default")};return v.jsx(Mb,{keyboardRef:s=>e.current=s,layoutName:o,layout:n,theme:r,onChange:t,onKeyPress:a,preventMouseDownDefault:!0})}function hp(){const{subscribe:t,unsubscribe:e,publish:n}=Oa();return{initialize:(s,c)=>{t("openKeyboard",s),t("closeKeyboard",c)},terminate:(s,c)=>{e("openKeyboard",s),e("closeKeyboard",c)},open:s=>{n("openKeyboard",{inputId:s.target.id,inputValue:s.target.value})},close:()=>{n("closeKeyboard")}}}const fr="keyboard-custom-overlap-id";function Lb({enabled:t}){const[e,n]=x.useState(!1),r=x.useRef(null),o=x.useRef(null),i=x.useRef(null),[a,s]=x.useState(),[c,u]=x.useState(0),{initialize:d,terminate:h}=hp(),f=w=>{var b,E;o.current=document.getElementById(w.detail.inputId),(b=r.current)==null||b.setInput(w.detail.inputValue),(E=o.current)==null||E.addEventListener("input",C=>{var T;const I=C.target;(T=r.current)==null||T.setInput(I==null?void 0:I.value)}),u(y()),n(!0)},p=()=>{u(0),n(!1)};x.useEffect(()=>(d(f,p),()=>{h(f,p)}),[e]);const l=w=>{var b,E;if(o&&o.current){g(o.current,w);const C=(b=r.current)==null?void 0:b.getCaretPosition();C&&((E=o.current)==null||E.setSelectionRange(C,C))}},g=(w,b)=>{var I;const E=(I=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:I.set;E==null||E.call(w,b);const C=new Event("input",{bubbles:!0});w.dispatchEvent(C)},m=()=>{var w;if(!a){const b=(w=i.current)==null?void 0:w.getBoundingClientRect();return b&&b.x&&!a&&s(b),b}return a},y=()=>{var T;const w=document.querySelectorAll("#"+fr),b=m(),E=[...w].map(P=>P.getBoundingClientRect()),C=(T=o.current)==null?void 0:T.getBoundingClientRect();E.push(C),E.sort((P,N)=>P.bottom>N.bottom?-1:1);let I=0;return E.every(P=>{if(b&&b.top<P.bottom)return I=P.bottom-b.top+8,!1}),I};return t?v.jsx("div",{className:"relative",style:{height:c},children:v.jsx("div",{ref:i,className:`mobile:hidden absolute bottom-0 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!e&&a&&"hidden"} ${!e&&!a&&"pointer-events-none opacity-0"}`,children:v.jsx(fp,{keyboardRef:r,onChange:l})})}):v.jsx(v.Fragment,{})}const Yo=({id:t,name:e,label:n,description:r,required:o,type:i="text",value:a,placeholder:s,disabled:c,error:u=!1,helperText:d="",onChange:h,beforeIcon:f,afterIcon:p,autoFocus:l,onFocus:g,onBlur:m})=>{const[y,w]=x.useState(d),b=x.useRef(null),[E,C]=x.useState(!1),{open:I,close:T}=hp();x.useEffect(()=>()=>{T()},[]);const P=()=>{b.current&&w(b.current.validationMessage),C(!1),T(),m==null||m()},N=async W=>{C(!0),(async()=>I(W))().then(()=>{var k;return(k=b.current)==null?void 0:k.scrollIntoView({behavior:"smooth",block:"center"})}),g==null||g()},L=W=>{h==null||h(W)},V=x.useId(),j=t??V;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{description:r,disabled:c,htmlFor:j,required:o,children:n}),v.jsx("div",{className:In("flex-start box flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs",c?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",E&&!u&&"border-core-primary-500 ring-1 ring-core-primary-500",u&&"border-core-red-500",u&&E&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex flex-row gap-2 self-stretch p-2",children:[f&&v.jsx(wn,{icon:f}),v.jsx("input",{type:i,id:j,name:e,className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",value:a,onChange:L,onBlur:P,ref:b,placeholder:s,onFocus:N,disabled:c,autoFocus:l}),p&&v.jsx(wn,{icon:p})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${d||y?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(kn.Helper,{error:u,helperText:d||y})})})]})};Yo.displayName="Input";const pp=({id:t,name:e,label:n,required:r,description:o,placeholder:i,value:a,disabled:s,error:c=!1,helperText:u,onChange:d,type:h="date"})=>{const[f,p]=x.useState(!1),l=x.useId(),g=t??l;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{description:o,disabled:s,htmlFor:g,required:r,children:n}),v.jsx("div",{className:In("flex-start box relative flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs ring-core-primary-500 ",s?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",f&&!c&&"border-core-primary-500 ring-1 ring-core-primary-500 selection:bg-core-primary-500",c&&"border-core-red-500",c&&f&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex w-full flex-row gap-2 self-stretch p-2",children:[v.jsx("input",{type:h,id:g,name:e,value:a,max:"2200-01-01",className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",placeholder:i,onChange:d,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:s}),v.jsx(wn,{icon:"calendar"})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${u?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-100"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(kn.Helper,{error:c,helperText:u})})})]})};pp.displayName="Input";function Tn({children:t}){return v.jsx("div",{className:"h-screen w-screen md:p-6",children:v.jsx("div",{className:"flex h-full max-h-full items-center justify-center md:container [&>*]:grow",children:t})})}function Eo({title:t,isOpen:e,onClose:n,primaryAction:r,secondaryAction:o,children:i}){const[a,s]=x.useState(e),c=x.useRef(null);x.useEffect(()=>{s(e)},[e]),x.useEffect(()=>{const h=c.current;h&&(a?h.show():h.close())},[a]);const u=()=>{n&&n(),s(!1)},d=h=>{h.key==="Escape"&&u()};return v.jsx("div",{className:`fixed inset-0 z-40 min-h-screen items-center bg-gray-500 bg-opacity-25 ${a?"flex":"hidden"}`,children:v.jsx("dialog",{ref:c,onKeyDown:d,className:"scrollbar-hide absolute overflow-auto rounded-lg drop-shadow-md",children:v.jsxs("div",{className:"rounded-lg bg-white md:min-w-[420px]",children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:i}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[r&&v.jsx(Ze,{label:r.label??"",onClick:r.action,disabled:r.disabled,pending:r.loading}),o&&v.jsx(Ze,{label:o.label??"",onClick:o.action,disabled:o.disabled,pending:o.loading,variant:"secondary"})]})})]})})})}function Fb({option:{label:t},checked:e,onChange:n}){return v.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-sm hover:bg-core-gray-50",children:[v.jsx(Fl,{defaultChecked:e,onChange:n}),v.jsx("p",{children:t})]})}function jb(t){const{t:e}=Ue(),n=x.useRef(null),[r,o]=x.useState(!1);lp(n,o);const[i,a]=x.useState(""),[s,c]=x.useState(t.value.split(";")),{name:u,onChange:d}=t,h=(f,p)=>{let l=[];f?l=[...s,p]:l=s.filter(g=>g!==p),c(l),d&&d(u??"",l.join(";"))};return v.jsxs("div",{ref:n,className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:`flex h-10 items-center justify-between rounded border p-2 ${t.disabled?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!t.disabled&&o(!r),children:[v.jsx("div",{className:`flex gap-1 overflow-hidden text-sm ${t.disabled?"text-core-gray-300":"text-core-gray-800"}`,children:s.map(f=>{var l;const p=(l=t.options.find(g=>g.value===f))==null?void 0:l.label;return v.jsxs("div",{className:"pointer-events-none flex items-center overflow-hidden rounded bg-core-gray-100 px-1.5 py-0.5",children:[v.jsx("p",{className:"truncate",children:p}),v.jsx("span",{className:"pointer-events-auto cursor-pointer",onClick:()=>h(!1,f),children:v.jsx(wn,{icon:"close"})})]},f)})}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:r?"▴":"▾"})]}),v.jsxs("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!r&&"hidden"} py-2`,children:[t.options.length>6&&v.jsx("div",{className:"px-4",children:v.jsx(Yo,{placeholder:`${e("search")}...`,onChange:f=>a(f.target.value)})}),t.options.map(f=>{if(!(i&&!f.label.toLowerCase().includes(i.toLowerCase())))return v.jsx(Fb,{option:f,checked:s.includes(f.value),onChange:p=>h(p,f.value)},`${f.value}_${s.includes(f.value)?"checked":"unchecked"}`)})]})]})]})}function Vb({value:t,max:e,label:n}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-sm mb-1 text-right text-core-gray-500",children:n}),v.jsx("div",{className:"h-1 w-full rounded-full bg-core-gray-200",children:v.jsx("div",{className:"h-1 rounded-full bg-core-primary-500",style:{width:`${Math.min(t/e*100,100)}%`}})})]})}function Ub({value:t,placeholder:e,open:n,setOpen:r,disabled:o}){return v.jsxs("div",{className:`flex items-center justify-between rounded border p-2 ${o?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!o&&r(!n),children:[v.jsx("span",{className:`text-sm ${o?"text-core-gray-300":"text-core-gray-800"}`,children:t||e}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:n?"▴":"▾"})]})}function Gb({label:t,children:e}){return v.jsxs("div",{className:"[&:not(:last-child)]:mb-2",children:[v.jsx("p",{className:"mb-2 px-4 text-xs text-core-gray-500",children:t}),e]})}function jl(t){return v.jsx("div",{className:"px-4 py-2 text-sm hover:bg-core-gray-50",children:t.label})}function qb(t){const e=x.useRef(null),[n,r]=x.useState(!1),[o,i]=x.useState(t.value??"");lp(e,r);const a=(c,u)=>{i(c),r(!1),t.onChange&&t.onChange(u)},s=x.Children.map(t.children,c=>{if(x.isValidElement(c)){if(c.type===jl)return v.jsx("div",{onClick:()=>a(c.props.label,c.props.value),children:c});if(c.type===Gb){const u=x.Children.map(c.props.children,d=>{if(x.isValidElement(d)&&d.type===jl)return v.jsx("div",{onClick:()=>a(d.props.label,d.props.value),children:d})});return x.cloneElement(c,{},...u)}}});return v.jsxs("div",{ref:e,className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{description:t.description,disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsx("div",{children:v.jsxs("div",{className:"relative",children:[v.jsx(Ub,{value:o,placeholder:t.placeholder,open:n,setOpen:r,disabled:t.disabled}),t.children&&v.jsx("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!n&&"hidden"} py-2`,children:s})]})}),v.jsx(kn.Helper,{helperText:t.helperText})]})}var Hb=Object.defineProperty,$b=(t,e)=>{for(var n in e)Hb(t,n,{get:e[n],enumerable:!0})},Sr={};$b(Sr,{assign:()=>Kb,colors:()=>Ao,createStringInterpolator:()=>Kl,skipAnimation:()=>Ep,to:()=>bp,willAdvance:()=>zl});var Vl=ka(),He=t=>Pa(t,Vl),Ul=ka();He.write=t=>Pa(t,Ul);var uc=ka();He.onStart=t=>Pa(t,uc);var Gl=ka();He.onFrame=t=>Pa(t,Gl);var ql=ka();He.onFinish=t=>Pa(t,ql);var Pi=[];He.setTimeout=(t,e)=>{const n=He.now()+e,r=()=>{const i=Pi.findIndex(a=>a.cancel==r);~i&&Pi.splice(i,1),_o-=~i?1:0},o={time:n,handler:t,cancel:r};return Pi.splice(gp(n),0,o),_o+=1,mp(),o};var gp=t=>~(~Pi.findIndex(e=>e.time>t)||~Pi.length);He.cancel=t=>{uc.delete(t),Gl.delete(t),ql.delete(t),Vl.delete(t),Ul.delete(t)},He.sync=t=>{$l=!0,He.batchedUpdates(t),$l=!1},He.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...o){e=o,He.onStart(n)}return r.handler=t,r.cancel=()=>{uc.delete(n),e=null},r};var Hl=typeof window<"u"?window.requestAnimationFrame:()=>{};He.use=t=>Hl=t,He.now=typeof performance<"u"?()=>performance.now():Date.now,He.batchedUpdates=t=>t(),He.catch=console.error,He.frameLoop="always",He.advance=()=>{He.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):vp()};var Co=-1,_o=0,$l=!1;function Pa(t,e){$l?(e.delete(t),t(0)):(e.add(t),mp())}function mp(){Co<0&&(Co=0,He.frameLoop!=="demand"&&Hl(yp))}function Yb(){Co=-1}function yp(){~Co&&(Hl(yp),He.batchedUpdates(vp))}function vp(){const t=Co;Co=He.now();const e=gp(Co);if(e&&(wp(Pi.splice(0,e),n=>n.handler()),_o-=e),!_o){Yb();return}uc.flush(),Vl.flush(t?Math.min(64,Co-t):16.667),Gl.flush(),Ul.flush(),ql.flush()}function ka(){let t=new Set,e=t;return{add(n){_o+=e==t&&!t.has(n)?1:0,t.add(n)},delete(n){return _o-=e==t&&t.has(n)?1:0,t.delete(n)},flush(n){e.size&&(t=new Set,_o-=e.size,wp(e,r=>r(n)&&t.add(r)),_o+=t.size,e=t)}}}function wp(t,e){t.forEach(n=>{try{e(n)}catch(r){He.catch(r)}})}function Yl(){}var Wb=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),Ae={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function Kr(t,e){if(Ae.arr(t)){if(!Ae.arr(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var rt=(t,e)=>t.forEach(e);function Dr(t,e,n){if(Ae.arr(t)){for(let r=0;r<t.length;r++)e.call(n,t[r],`${r}`);return}for(const r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r)}var tr=t=>Ae.und(t)?[]:Ae.arr(t)?t:[t];function Ba(t,e){if(t.size){const n=Array.from(t);t.clear(),rt(n,e)}}var Na=(t,...e)=>Ba(t,n=>n(...e)),Wl=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Kl,bp,Ao=null,Ep=!1,zl=Yl,Kb=t=>{t.to&&(bp=t.to),t.now&&(He.now=t.now),t.colors!==void 0&&(Ao=t.colors),t.skipAnimation!=null&&(Ep=t.skipAnimation),t.createStringInterpolator&&(Kl=t.createStringInterpolator),t.requestAnimationFrame&&He.use(t.requestAnimationFrame),t.batchedUpdates&&(He.batchedUpdates=t.batchedUpdates),t.willAdvance&&(zl=t.willAdvance),t.frameLoop&&(He.frameLoop=t.frameLoop)},Ra=new Set,hr=[],Xl=[],lc=0,dc={get idle(){return!Ra.size&&!hr.length},start(t){lc>t.priority?(Ra.add(t),He.onStart(zb)):(Cp(t),He(Ql))},advance:Ql,sort(t){if(lc)He.onFrame(()=>dc.sort(t));else{const e=hr.indexOf(t);~e&&(hr.splice(e,1),_p(t))}},clear(){hr=[],Ra.clear()}};function zb(){Ra.forEach(Cp),Ra.clear(),He(Ql)}function Cp(t){hr.includes(t)||_p(t)}function _p(t){hr.splice(Xb(hr,e=>e.priority>t.priority),0,t)}function Ql(t){const e=Xl;for(let n=0;n<hr.length;n++){const r=hr[n];lc=r.priority,r.idle||(zl(r),r.advance(t),r.idle||e.push(r))}return lc=0,Xl=hr,Xl.length=0,hr=e,hr.length>0}function Xb(t,e){const n=t.findIndex(e);return n<0?t.length:n}var Qb=(t,e,n)=>Math.min(Math.max(n,t),e),Jb={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ir="[-+]?\\d*\\.?\\d+",fc=Ir+"%";function hc(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var Zb=new RegExp("rgb"+hc(Ir,Ir,Ir)),e6=new RegExp("rgba"+hc(Ir,Ir,Ir,Ir)),t6=new RegExp("hsl"+hc(Ir,fc,fc)),n6=new RegExp("hsla"+hc(Ir,fc,fc,Ir)),r6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,o6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,i6=/^#([0-9a-fA-F]{6})$/,a6=/^#([0-9a-fA-F]{8})$/;function s6(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=i6.exec(t))?parseInt(e[1]+"ff",16)>>>0:Ao&&Ao[t]!==void 0?Ao[t]:(e=Zb.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|255)>>>0:(e=e6.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|Ip(e[4]))>>>0:(e=r6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=a6.exec(t))?parseInt(e[1],16)>>>0:(e=o6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=t6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|255)>>>0:(e=n6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|Ip(e[4]))>>>0:null}function Jl(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ap(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,o=2*n-r,i=Jl(o,r,t+1/3),a=Jl(o,r,t),s=Jl(o,r,t-1/3);return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(s*255)<<8}function ki(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Sp(t){return(parseFloat(t)%360+360)%360/360}function Ip(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function pc(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Tp(t){let e=s6(t);if(e===null)return t;e=e||0;const n=(e&4278190080)>>>24,r=(e&16711680)>>>16,o=(e&65280)>>>8,i=(e&255)/255;return`rgba(${n}, ${r}, ${o}, ${i})`}var Da=(t,e,n)=>{if(Ae.fun(t))return t;if(Ae.arr(t))return Da({range:t,output:e,extrapolate:n});if(Ae.str(t.output[0]))return Kl(t);const r=t,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const d=u6(u,i);return c6(u,i[d],i[d+1],o[d],o[d+1],c,a,s,r.map)}};function c6(t,e,n,r,o,i,a,s,c){let u=c?c(t):t;if(u<e){if(a==="identity")return u;a==="clamp"&&(u=e)}if(u>n){if(s==="identity")return u;s==="clamp"&&(u=n)}return r===o?r:e===n?t<=e?r:o:(e===-1/0?u=-u:n===1/0?u=u-e:u=(u-e)/(n-e),u=i(u),r===-1/0?u=-u:o===1/0?u=u+r:u=u*(o-r)+r,u)}function u6(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}var l6=(t,e="end")=>n=>{n=e==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*t,o=e==="end"?Math.floor(r):Math.ceil(r);return Qb(0,1,o/t)},gc=1.70158,mc=gc*1.525,xp=gc+1,Op=2*Math.PI/3,Pp=2*Math.PI/4.5,yc=t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,d6={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:Math.pow(2,10*t-10),easeOutExpo:t=>t===1?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>xp*t*t*t-gc*t*t,easeOutBack:t=>1+xp*Math.pow(t-1,3)+gc*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*((mc+1)*2*t-mc)/2:(Math.pow(2*t-2,2)*((mc+1)*(t*2-2)+mc)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-Math.pow(2,10*t-10)*Math.sin((t*10-10.75)*Op),easeOutElastic:t=>t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*Op)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*Pp))/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*Pp)/2+1,easeInBounce:t=>1-yc(1-t),easeOutBounce:yc,easeInOutBounce:t=>t<.5?(1-yc(1-2*t))/2:(1+yc(2*t-1))/2,steps:l6},Ma=Symbol.for("FluidValue.get"),Bi=Symbol.for("FluidValue.observers"),pr=t=>!!(t&&t[Ma]),Un=t=>t&&t[Ma]?t[Ma]():t,kp=t=>t[Bi]||null;function f6(t,e){t.eventObserved?t.eventObserved(e):t(e)}function La(t,e){const n=t[Bi];n&&n.forEach(r=>{f6(r,e)})}var Bp=class{constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");h6(this,t)}},h6=(t,e)=>Np(t,Ma,e);function Ni(t,e){if(t[Ma]){let n=t[Bi];n||Np(t,Bi,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function Fa(t,e){const n=t[Bi];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[Bi]=null,t.observerRemoved&&t.observerRemoved(r,e)}}var Np=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),vc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,p6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Rp=new RegExp(`(${vc.source})(%|[a-z]+)`,"i"),g6=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,wc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Dp=t=>{const[e,n]=m6(t);if(!e||Wl())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){const o=window.getComputedStyle(document.documentElement).getPropertyValue(n);return o||t}else{if(n&&wc.test(n))return Dp(n);if(n)return n}return t},m6=t=>{const e=wc.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]},Zl,y6=(t,e,n,r,o)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,Mp=t=>{Zl||(Zl=Ao?new RegExp(`(${Object.keys(Ao).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(i=>Un(i).replace(wc,Dp).replace(p6,Tp).replace(Zl,Tp)),n=e.map(i=>i.match(vc).map(Number)),o=n[0].map((i,a)=>n.map(s=>{if(!(a in s))throw Error('The arity of each "output" value must be equal');return s[a]})).map(i=>Da({...t,output:i}));return i=>{var c;const a=!Rp.test(e[0])&&((c=e.find(u=>Rp.test(u)))==null?void 0:c.replace(vc,""));let s=0;return e[0].replace(vc,()=>`${o[s++](i)}${a||""}`).replace(g6,y6)}},ed="react-spring: ",Lp=t=>{const e=t;let n=!1;if(typeof e!="function")throw new TypeError(`${ed}once requires a function parameter`);return(...r)=>{n||(e(...r),n=!0)}},v6=Lp(console.warn);function w6(){v6(`${ed}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var b6=Lp(console.warn);function E6(){b6(`${ed}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function bc(t){return Ae.str(t)&&(t[0]=="#"||/\d/.test(t)||!Wl()&&wc.test(t)||t in(Ao||{}))}var td=Wl()?x.useEffect:x.useLayoutEffect,C6=()=>{const t=x.useRef(!1);return td(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function Fp(){const t=x.useState()[1],e=C6();return()=>{e.current&&t(Math.random())}}function _6(t,e){const[n]=x.useState(()=>({inputs:e,result:t()})),r=x.useRef(),o=r.current;let i=o;return i?e&&i.inputs&&A6(e,i.inputs)||(i={inputs:e,result:t()}):i=n,x.useEffect(()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)},[i]),i.result}function A6(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var jp=t=>x.useEffect(t,S6),S6=[];function Vp(t){const e=x.useRef();return x.useEffect(()=>{e.current=t}),e.current}var ja=Symbol.for("Animated:node"),I6=t=>!!t&&t[ja]===t,Mr=t=>t&&t[ja],nd=(t,e)=>Wb(t,ja,e),Ec=t=>t&&t[ja]&&t[ja].getPayload(),Up=class{constructor(){nd(this,this)}getPayload(){return this.payload||[]}},Va=class extends Up{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new Va(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return Ae.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Ua=class extends Va{constructor(t){super(0),this._string=null,this._toString=Da({output:[t,t]})}static create(t){return new Ua(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Da({output:[this.getValue(),t]})),this._value=0,super.reset()}},Cc={dependencies:null},_c=class extends Up{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Dr(this.source,(n,r)=>{I6(n)?e[r]=n.getValue(t):pr(n)?e[r]=Un(n):t||(e[r]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&rt(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Dr(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){Cc.dependencies&&pr(t)&&Cc.dependencies.add(t);const e=Ec(t);e&&rt(e,n=>this.add(n))}},Gp=class extends _c{constructor(t){super(t)}static create(t){return new Gp(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((n,r)=>n.setValue(t[r])).some(Boolean):(super.setValue(t.map(T6)),!0)}};function T6(t){return(bc(t)?Ua:Va).create(t)}function rd(t){const e=Mr(t);return e?e.constructor:Ae.arr(t)?Gp:bc(t)?Ua:Va}var qp=(t,e)=>{const n=!Ae.fun(t)||t.prototype&&t.prototype.isReactComponent;return x.forwardRef((r,o)=>{const i=x.useRef(null),a=n&&x.useCallback(l=>{i.current=P6(o,l)},[o]),[s,c]=O6(r,e),u=Fp(),d=()=>{const l=i.current;if(n&&!l)return;(l?e.applyAnimatedValues(l,s.getValue(!0)):!1)===!1&&u()},h=new x6(d,c),f=x.useRef();td(()=>(f.current=h,rt(c,l=>Ni(l,h)),()=>{f.current&&(rt(f.current.deps,l=>Fa(l,f.current)),He.cancel(f.current.update))})),x.useEffect(d,[]),jp(()=>()=>{const l=f.current;rt(l.deps,g=>Fa(g,l))});const p=e.getComponentProps(s.getValue());return ce.createElement(t,{...p,ref:a})})},x6=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&He.write(this.update)}};function O6(t,e){const n=new Set;return Cc.dependencies=n,t.style&&(t={...t,style:e.createAnimatedStyle(t.style)}),t=new _c(t),Cc.dependencies=null,[t,n]}function P6(t,e){return t&&(Ae.fun(t)?t(e):t.current=e),e}var Hp=Symbol.for("AnimatedComponent"),k6=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:n=o=>new _c(o),getComponentProps:r=o=>o}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=a=>{const s=$p(a)||"Anonymous";return Ae.str(a)?a=i[a]||(i[a]=qp(a,o)):a=a[Hp]||(a[Hp]=qp(a,o)),a.displayName=`Animated(${s})`,a};return Dr(t,(a,s)=>{Ae.arr(t)&&(s=$p(a)),i[s]=i(a)}),{animated:i}},$p=t=>Ae.str(t)?t:t&&Ae.str(t.displayName)?t.displayName:Ae.fun(t)&&t.name||null;function Wo(t,...e){return Ae.fun(t)?t(...e):t}var Ga=(t,e)=>t===!0||!!(e&&t&&(Ae.fun(t)?t(e):tr(t).includes(e))),Yp=(t,e)=>Ae.obj(t)?e&&t[e]:t,Wp=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,B6=t=>t,od=(t,e=B6)=>{let n=N6;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));const r={};for(const o of n){const i=e(t[o],o);Ae.und(i)||(r[o]=i)}return r},N6=["config","onProps","onStart","onChange","onPause","onResume","onRest"],R6={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function D6(t){const e={};let n=0;if(Dr(t,(r,o)=>{R6[o]||(e[o]=r,n++)}),n)return e}function Kp(t){const e=D6(t);if(e){const n={to:e};return Dr(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function qa(t){return t=Un(t),Ae.arr(t)?t.map(qa):bc(t)?Sr.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function M6(t){for(const e in t)return!0;return!1}function id(t){return Ae.fun(t)||Ae.arr(t)&&Ae.obj(t[0])}function L6(t,e){var n;(n=t.ref)==null||n.delete(t),e==null||e.delete(t)}function F6(t,e){var n;e&&t.ref!==e&&((n=t.ref)==null||n.delete(t),e.add(t),t.ref=e)}var j6={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},ad={...j6.default,mass:1,damping:1,easing:d6.linear,clamp:!1},V6=class{constructor(){this.velocity=0,Object.assign(this,ad)}};function U6(t,e,n){n&&(n={...n},zp(n,e),e={...n,...e}),zp(t,e),Object.assign(t,e);for(const a in ad)t[a]==null&&(t[a]=ad[a]);let{frequency:r,damping:o}=t;const{mass:i}=t;return Ae.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*i,t.friction=4*Math.PI*o*i/r),t}function zp(t,e){if(!Ae.und(e.decay))t.duration=void 0;else{const n=!Ae.und(e.tension)||!Ae.und(e.friction);(n||!Ae.und(e.frequency)||!Ae.und(e.damping)||!Ae.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var Xp=[],G6=class{constructor(){this.changed=!1,this.values=Xp,this.toValues=null,this.fromValues=Xp,this.config=new V6,this.immediate=!1}};function Qp(t,{key:e,props:n,defaultProps:r,state:o,actions:i}){return new Promise((a,s)=>{let c,u,d=Ga(n.cancel??(r==null?void 0:r.cancel),e);if(d)p();else{Ae.und(n.pause)||(o.paused=Ga(n.pause,e));let l=r==null?void 0:r.pause;l!==!0&&(l=o.paused||Ga(l,e)),c=Wo(n.delay||0,e),l?(o.resumeQueue.add(f),i.pause()):(i.resume(),f())}function h(){o.resumeQueue.add(f),o.timeouts.delete(u),u.cancel(),c=u.time-He.now()}function f(){c>0&&!Sr.skipAnimation?(o.delayed=!0,u=He.setTimeout(p,c),o.pauseQueue.add(h),o.timeouts.add(u)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(h),o.timeouts.delete(u),t<=(o.cancelId||0)&&(d=!0);try{i.start({...n,callId:t,cancel:d},a)}catch(l){s(l)}}})}var sd=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?Ri(t.get()):e.every(n=>n.noop)?Jp(t.get()):Tr(t.get(),e.every(n=>n.finished)),Jp=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Tr=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),Ri=t=>({value:t,cancelled:!0,finished:!1});function Zp(t,e,n,r){const{callId:o,parentId:i,onRest:a}=e,{asyncTo:s,promise:c}=n;return!i&&t===s&&!e.reset?c:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const u=od(e,(m,y)=>y==="onRest"?void 0:m);let d,h;const f=new Promise((m,y)=>(d=m,h=y)),p=m=>{const y=o<=(n.cancelId||0)&&Ri(r)||o!==n.asyncId&&Tr(r,!1);if(y)throw m.result=y,h(m),m},l=(m,y)=>{const w=new e0,b=new t0;return(async()=>{if(Sr.skipAnimation)throw Ha(n),b.result=Tr(r,!1),h(b),b;p(w);const E=Ae.obj(m)?{...m}:{...y,to:m};E.parentId=o,Dr(u,(I,T)=>{Ae.und(E[T])&&(E[T]=I)});const C=await r.start(E);return p(w),n.paused&&await new Promise(I=>{n.resumeQueue.add(I)}),C})()};let g;if(Sr.skipAnimation)return Ha(n),Tr(r,!1);try{let m;Ae.arr(t)?m=(async y=>{for(const w of y)await l(w)})(t):m=Promise.resolve(t(l,r.stop.bind(r))),await Promise.all([m.then(d),f]),g=Tr(r.get(),!0,!1)}catch(m){if(m instanceof e0)g=m.result;else if(m instanceof t0)g=m.result;else throw m}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?c:void 0)}return Ae.fun(a)&&He.batchedUpdates(()=>{a(g,r,r.item)}),g})()}function Ha(t,e){Ba(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var e0=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},t0=class extends Error{constructor(){super("SkipAnimationSignal")}},cd=t=>t instanceof ud,q6=1,ud=class extends Bp{constructor(){super(...arguments),this.id=q6++,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Mr(this);return t&&t.getValue()}to(...t){return Sr.to(this,t)}interpolate(...t){return w6(),Sr.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){La(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||dc.sort(this),La(this,{type:"priority",parent:this,priority:t})}},Ko=Symbol.for("SpringPhase"),n0=1,ld=2,dd=4,fd=t=>(t[Ko]&n0)>0,So=t=>(t[Ko]&ld)>0,$a=t=>(t[Ko]&dd)>0,r0=(t,e)=>e?t[Ko]|=ld|n0:t[Ko]&=~ld,o0=(t,e)=>e?t[Ko]|=dd:t[Ko]&=~dd,H6=class extends ud{constructor(t,e){if(super(),this.animation=new G6,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ae.und(t)||!Ae.und(e)){const n=Ae.obj(t)?{...t}:{...e,from:t};Ae.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(So(this)||this._state.asyncTo)||$a(this)}get goal(){return Un(this.animation.to)}get velocity(){const t=Mr(this);return t instanceof Va?t.lastVelocity||0:t.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return fd(this)}get isAnimating(){return So(this)}get isPaused(){return $a(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const r=this.animation;let{toValues:o}=r;const{config:i}=r,a=Ec(r.to);!a&&pr(r.to)&&(o=tr(Un(r.to))),r.values.forEach((u,d)=>{if(u.done)return;const h=u.constructor==Ua?1:a?a[d].lastPosition:o[d];let f=r.immediate,p=h;if(!f){if(p=u.lastPosition,i.tension<=0){u.done=!0;return}let l=u.elapsedTime+=t;const g=r.fromValues[d],m=u.v0!=null?u.v0:u.v0=Ae.arr(i.velocity)?i.velocity[d]:i.velocity;let y;const w=i.precision||(g==h?.005:Math.min(1,Math.abs(h-g)*.001));if(Ae.und(i.duration))if(i.decay){const b=i.decay===!0?.998:i.decay,E=Math.exp(-(1-b)*l);p=g+m/(1-b)*(1-E),f=Math.abs(u.lastPosition-p)<=w,y=m*E}else{y=u.lastVelocity==null?m:u.lastVelocity;const b=i.restVelocity||w/10,E=i.clamp?0:i.bounce,C=!Ae.und(E),I=g==h?u.v0>0:g<h;let T,P=!1;const N=1,L=Math.ceil(t/N);for(let V=0;V<L&&(T=Math.abs(y)>b,!(!T&&(f=Math.abs(h-p)<=w,f)));++V){C&&(P=p==h||p>h==I,P&&(y=-y*E,p=h));const j=-i.tension*1e-6*(p-h),W=-i.friction*.001*y,q=(j+W)/i.mass;y=y+q*N,p=p+y*N}}else{let b=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,l=u.elapsedTime+=t)),b=(i.progress||0)+l/this._memoizedDuration,b=b>1?1:b<0?0:b,u.durationProgress=b),p=g+i.easing(b)*(h-g),y=(p-u.lastPosition)/t,f=b==1}u.lastVelocity=y,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[d].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const s=Mr(this),c=s.getValue();if(e){const u=Un(r.to);(c!==u||n)&&!i.decay?(s.setValue(u),this._onChange(u)):n&&i.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(t){return He.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(So(this)){const{to:t,config:e}=this.animation;He.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return Ae.und(t)?(n=this.queue||[],this.queue=[]):n=[Ae.obj(t)?t:{...e,to:t}],Promise.all(n.map(r=>this._update(r))).then(r=>sd(this,r))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),Ha(this._state,t&&this._lastCallId),He.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:r}=t;n=Ae.obj(n)?n[e]:n,(n==null||id(n))&&(n=void 0),r=Ae.obj(r)?r[e]:r,r==null&&(r=void 0);const o={to:n,from:r};return fd(this)||(t.reverse&&([n,r]=[r,n]),r=Un(r),Ae.und(r)?Mr(this)||this._set(n):this._set(r)),o}_update({...t},e){const{key:n,defaultProps:r}=this;t.default&&Object.assign(r,od(t,(a,s)=>/^on/.test(s)?Yp(a,n):a)),s0(this,t,"onProps"),Ka(this,"onProps",t,this);const o=this._prepareNode(t);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Qp(++this._lastCallId,{key:n,props:t,defaultProps:r,state:i,actions:{pause:()=>{$a(this)||(o0(this,!0),Na(i.pauseQueue),Ka(this,"onPause",Tr(this,Ya(this,this.animation.to)),this))},resume:()=>{$a(this)&&(o0(this,!1),So(this)&&this._resume(),Na(i.resumeQueue),Ka(this,"onResume",Tr(this,Ya(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(a=>{if(t.loop&&a.finished&&!(e&&a.noop)){const s=i0(t);if(s)return this._update(s,!0)}return a})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Ri(this));const r=!Ae.und(t.to),o=!Ae.und(t.from);if(r||o)if(e.callId>this._lastToId)this._lastToId=e.callId;else return n(Ri(this));const{key:i,defaultProps:a,animation:s}=this,{to:c,from:u}=s;let{to:d=c,from:h=u}=t;o&&!r&&(!e.default||Ae.und(d))&&(d=h),e.reverse&&([d,h]=[h,d]);const f=!Kr(h,u);f&&(s.from=h),h=Un(h);const p=!Kr(d,c);p&&this._focus(d);const l=id(e.to),{config:g}=s,{decay:m,velocity:y}=g;(r||o)&&(g.velocity=0),e.config&&!l&&U6(g,Wo(e.config,i),e.config!==a.config?Wo(a.config,i):void 0);let w=Mr(this);if(!w||Ae.und(d))return n(Tr(this,!0));const b=Ae.und(e.reset)?o&&!e.default:!Ae.und(h)&&Ga(e.reset,i),E=b?h:this.get(),C=qa(d),I=Ae.num(C)||Ae.arr(C)||bc(C),T=!l&&(!I||Ga(a.immediate||e.immediate,i));if(p){const V=rd(d);if(V!==w.constructor)if(T)w=this._set(C);else throw Error(`Cannot animate between ${w.constructor.name} and ${V.name}, as the "to" prop suggests`)}const P=w.constructor;let N=pr(d),L=!1;if(!N){const V=b||!fd(this)&&f;(p||V)&&(L=Kr(qa(E),C),N=!L),(!Kr(s.immediate,T)&&!T||!Kr(g.decay,m)||!Kr(g.velocity,y))&&(N=!0)}if(L&&So(this)&&(s.changed&&!b?N=!0:N||this._stop(c)),!l&&((N||pr(c))&&(s.values=w.getPayload(),s.toValues=pr(d)?null:P==Ua?[1]:tr(C)),s.immediate!=T&&(s.immediate=T,!T&&!b&&this._set(c)),N)){const{onRest:V}=s;rt(Y6,W=>s0(this,e,W));const j=Tr(this,Ya(this,c));Na(this._pendingCalls,j),this._pendingCalls.add(n),s.changed&&He.batchedUpdates(()=>{var W;s.changed=!b,V==null||V(j,this),b?Wo(a.onRest,j):(W=s.onStart)==null||W.call(s,j,this)})}b&&this._set(E),l?n(Zp(e.to,e,this._state,this)):N?this._start():So(this)&&!p?this._pendingCalls.add(n):n(Jp(E))}_focus(t){const e=this.animation;t!==e.to&&(kp(this)&&this._detach(),e.to=t,kp(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;pr(e)&&(Ni(e,this),cd(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;pr(t)&&Fa(t,this)}_set(t,e=!0){const n=Un(t);if(!Ae.und(n)){const r=Mr(this);if(!r||!Kr(n,r.getValue())){const o=rd(n);!r||r.constructor!=o?nd(this,o.create(n)):r.setValue(n),r&&He.batchedUpdates(()=>{this._onChange(n,e)})}}return Mr(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,Ka(this,"onStart",Tr(this,Ya(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),Wo(this.animation.onChange,t,this)),Wo(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Mr(this).reset(Un(t.to)),t.immediate||(t.fromValues=t.values.map(e=>e.lastPosition)),So(this)||(r0(this,!0),$a(this)||this._resume())}_resume(){Sr.skipAnimation?this.finish():dc.start(this)}_stop(t,e){if(So(this)){r0(this,!1);const n=this.animation;rt(n.values,o=>{o.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),La(this,{type:"idle",parent:this});const r=e?Ri(this.get()):Tr(this.get(),Ya(this,t??n.to));Na(this._pendingCalls,r),n.changed&&(n.changed=!1,Ka(this,"onRest",r,this))}}};function Ya(t,e){const n=qa(e),r=qa(t.get());return Kr(r,n)}function i0(t,e=t.loop,n=t.to){const r=Wo(e);if(r){const o=r!==!0&&Kp(r),i=(o||t).reverse,a=!o||o.reset;return Wa({...t,loop:e,default:!1,pause:void 0,to:!i||id(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function Wa(t){const{to:e,from:n}=t=Kp(t),r=new Set;return Ae.obj(e)&&a0(e,r),Ae.obj(n)&&a0(n,r),t.keys=r.size?Array.from(r):null,t}function $6(t){const e=Wa(t);return Ae.und(e.default)&&(e.default=od(e)),e}function a0(t,e){Dr(t,(n,r)=>n!=null&&e.add(r))}var Y6=["onStart","onRest","onChange","onPause","onResume"];function s0(t,e,n){t.animation[n]=e[n]!==Wp(e,n)?Yp(e[n],t.key):void 0}function Ka(t,e,...n){var r,o,i,a;(o=(r=t.animation)[e])==null||o.call(r,...n),(a=(i=t.defaultProps)[e])==null||a.call(i,...n)}var W6=["onStart","onChange","onRest"],K6=1,z6=class{constructor(t,e){this.id=K6++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];Ae.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(Wa(t)),this}start(t){let{queue:e}=this;return t?e=tr(t).map(Wa):this.queue=[],this._flush?this._flush(this,e):(h0(this,e),hd(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;rt(tr(e),r=>n[r].stop(!!t))}else Ha(this._state,this._lastAsyncId),this.each(n=>n.stop(!!t));return this}pause(t){if(Ae.und(t))this.start({pause:!0});else{const e=this.springs;rt(tr(t),n=>e[n].pause())}return this}resume(t){if(Ae.und(t))this.start({pause:!1});else{const e=this.springs;rt(tr(t),n=>e[n].resume())}return this}each(t){Dr(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,Ba(t,([s,c])=>{c.value=this.get(),s(c,this,this._item)}));const i=!r&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Ba(e,([s,c])=>{c.value=a,s(c,this,this._item)}),i&&(this._started=!1,Ba(n,([s,c])=>{c.value=a,s(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;He.onFrame(this._onFrame)}};function hd(t,e){return Promise.all(e.map(n=>c0(t,n))).then(n=>sd(t,n))}async function c0(t,e,n){const{keys:r,to:o,from:i,loop:a,onRest:s,onResolve:c}=e,u=Ae.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),i===!1&&(e.from=null);const d=Ae.arr(o)||Ae.fun(o)?o:void 0;d?(e.to=void 0,e.onRest=void 0,u&&(u.onRest=void 0)):rt(W6,g=>{const m=e[g];if(Ae.fun(m)){const y=t._events[g];e[g]=({finished:w,cancelled:b})=>{const E=y.get(m);E?(w||(E.finished=!1),b&&(E.cancelled=!0)):y.set(m,{value:null,finished:w||!1,cancelled:b||!1})},u&&(u[g]=e[g])}});const h=t._state;e.pause===!h.paused?(h.paused=e.pause,Na(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const f=(r||Object.keys(t.springs)).map(g=>t.springs[g].start(e)),p=e.cancel===!0||Wp(e,"cancel")===!0;(d||p&&h.asyncId)&&f.push(Qp(++t._lastAsyncId,{props:e,state:h,actions:{pause:Yl,resume:Yl,start(g,m){p?(Ha(h,t._lastAsyncId),m(Ri(t))):(g.onRest=s,m(Zp(d,g,h,t)))}}})),h.paused&&await new Promise(g=>{h.resumeQueue.add(g)});const l=sd(t,await Promise.all(f));if(a&&l.finished&&!(n&&l.noop)){const g=i0(e,a,o);if(g)return h0(t,[g]),c0(t,g,!0)}return c&&He.batchedUpdates(()=>c(l,t,t.item)),l}function u0(t,e){const n={...t.springs};return e&&rt(tr(e),r=>{Ae.und(r.keys)&&(r=Wa(r)),Ae.obj(r.to)||(r={...r,to:void 0}),f0(n,r,o=>d0(o))}),l0(t,n),n}function l0(t,e){Dr(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Ni(n,t))})}function d0(t,e){const n=new H6;return n.key=t,e&&Ni(n,e),n}function f0(t,e,n){e.keys&&rt(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function h0(t,e){rt(e,n=>{f0(t.springs,n,r=>d0(r,t))})}var Ac=({children:t,...e})=>{const n=x.useContext(Sc),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=_6(()=>({pause:r,immediate:o}),[r,o]);const{Provider:i}=Sc;return ce.createElement(i,{value:e},t)},Sc=X6(Ac,{});Ac.Provider=Sc.Provider,Ac.Consumer=Sc.Consumer;function X6(t,e){return Object.assign(t,ce.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var Q6=()=>{const t=[],e=function(r){E6();const o=[];return rt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=n(r,i,a);s&&o.push(i.start(s))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){const o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return rt(t,r=>r.pause(...arguments)),this},e.resume=function(){return rt(t,r=>r.resume(...arguments)),this},e.set=function(r){rt(t,(o,i)=>{const a=Ae.fun(r)?r(i,o):r;a&&o.set(a)})},e.start=function(r){const o=[];return rt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=this._getProps(r,i,a);s&&o.push(i.start(s))}}),o},e.stop=function(){return rt(t,r=>r.stop(...arguments)),this},e.update=function(r){return rt(t,(o,i)=>o.update(this._getProps(r,o,i))),this};const n=function(r,o,i){return Ae.fun(r)?r(i,o):r};return e._getProps=n,e};function J6(t,e,n){const r=Ae.fun(e)&&e;r&&!n&&(n=[]);const o=x.useMemo(()=>r||arguments.length==3?Q6():void 0,[]),i=x.useRef(0),a=Fp(),s=x.useMemo(()=>({ctrls:[],queue:[],flush(y,w){const b=u0(y,w);return i.current>0&&!s.queue.length&&!Object.keys(b).some(C=>!y.springs[C])?hd(y,w):new Promise(C=>{l0(y,b),s.queue.push(()=>{C(hd(y,w))}),a()})}}),[]),c=x.useRef([...s.ctrls]),u=[],d=Vp(t)||0;x.useMemo(()=>{rt(c.current.slice(t,d),y=>{L6(y,o),y.stop(!0)}),c.current.length=t,h(d,t)},[t]),x.useMemo(()=>{h(0,Math.min(d,t))},n);function h(y,w){for(let b=y;b<w;b++){const E=c.current[b]||(c.current[b]=new z6(null,s.flush)),C=r?r(b,E):e[b];C&&(u[b]=$6(C))}}const f=c.current.map((y,w)=>u0(y,u[w])),p=x.useContext(Ac),l=Vp(p),g=p!==l&&M6(p);td(()=>{i.current++,s.ctrls=c.current;const{queue:y}=s;y.length&&(s.queue=[],rt(y,w=>w())),rt(c.current,(w,b)=>{o==null||o.add(w),g&&w.start({default:p});const E=u[b];E&&(F6(w,E.ref),w.ref?w.queue.push(E):w.start(E))})}),jp(()=>()=>{rt(s.ctrls,y=>y.stop(!0))});const m=f.map(y=>({...y}));return o?[m,o]:m}function Z6(t,e){const n=Ae.fun(t),[[r],o]=J6(1,n?t:[t],n?[]:e);return n||arguments.length==2?[r,o]:r}var eE=class extends ud{constructor(t,e){super(),this.source=t,this.idle=!0,this._active=new Set,this.calc=Da(...e);const n=this._get(),r=rd(n);nd(this,r.create(n))}advance(t){const e=this._get(),n=this.get();Kr(e,n)||(Mr(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&p0(this._active)&&pd(this)}_get(){const t=Ae.arr(this.source)?this.source.map(Un):tr(Un(this.source));return this.calc(...t)}_start(){this.idle&&!p0(this._active)&&(this.idle=!1,rt(Ec(this),t=>{t.done=!1}),Sr.skipAnimation?(He.batchedUpdates(()=>this.advance()),pd(this)):dc.start(this))}_attach(){let t=1;rt(tr(this.source),e=>{pr(e)&&Ni(e,this),cd(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){rt(tr(this.source),t=>{pr(t)&&Fa(t,this)}),this._active.clear(),pd(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=tr(this.source).reduce((e,n)=>Math.max(e,(cd(n)?n.priority:0)+1),0))}};function tE(t){return t.idle!==!1}function p0(t){return!t.size||Array.from(t).every(tE)}function pd(t){t.idle||(t.idle=!0,rt(Ec(t),e=>{e.done=!0}),La(t,{type:"idle",parent:t}))}Sr.assign({createStringInterpolator:Mp,to:(t,e)=>new eE(t,e)});var g0=/^--/;function nE(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!g0.test(t)&&!(za.hasOwnProperty(t)&&za[t])?e+"px":(""+e).trim()}var m0={};function rE(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:s,...c}=e,u=Object.values(c),d=Object.keys(c).map(h=>n||t.hasAttribute(h)?h:m0[h]||(m0[h]=h.replace(/([A-Z])/g,f=>"-"+f.toLowerCase())));o!==void 0&&(t.textContent=o);for(const h in r)if(r.hasOwnProperty(h)){const f=nE(h,r[h]);g0.test(h)?t.style.setProperty(h,f):t.style[h]=f}d.forEach((h,f)=>{t.setAttribute(h,u[f])}),i!==void 0&&(t.scrollTop=i),a!==void 0&&(t.scrollLeft=a),s!==void 0&&t.setAttribute("viewBox",s)}var za={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oE=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),iE=["Webkit","Ms","Moz","O"];za=Object.keys(za).reduce((t,e)=>(iE.forEach(n=>t[oE(n,e)]=t[e]),t),za);var aE=/^(matrix|translate|scale|rotate|skew)/,sE=/^(translate)/,cE=/^(rotate|skew)/,gd=(t,e)=>Ae.num(t)&&t!==0?t+e:t,Ic=(t,e)=>Ae.arr(t)?t.every(n=>Ic(n,e)):Ae.num(t)?t===e:parseFloat(t)===e,uE=class extends _c{constructor({x:t,y:e,z:n,...r}){const o=[],i=[];(t||e||n)&&(o.push([t||0,e||0,n||0]),i.push(a=>[`translate3d(${a.map(s=>gd(s,"px")).join(",")})`,Ic(a,0)])),Dr(r,(a,s)=>{if(s==="transform")o.push([a||""]),i.push(c=>[c,c===""]);else if(aE.test(s)){if(delete r[s],Ae.und(a))return;const c=sE.test(s)?"px":cE.test(s)?"deg":"";o.push(tr(a)),i.push(s==="rotate3d"?([u,d,h,f])=>[`rotate3d(${u},${d},${h},${gd(f,c)})`,Ic(f,0)]:u=>[`${s}(${u.map(d=>gd(d,c)).join(",")})`,Ic(u,s.startsWith("scale")?1:0)])}}),o.length&&(r.transform=new lE(o,i)),super(r)}},lE=class extends Bp{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return rt(this.inputs,(n,r)=>{const o=Un(n[0]),[i,a]=this.transforms[r](Ae.arr(o)?o:n.map(Un));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){t==1&&rt(this.inputs,e=>rt(e,n=>pr(n)&&Ni(n,this)))}observerRemoved(t){t==0&&rt(this.inputs,e=>rt(e,n=>pr(n)&&Fa(n,this)))}eventObserved(t){t.type=="change"&&(this._value=null),La(this,t)}},dE=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Sr.assign({batchedUpdates:vi.unstable_batchedUpdates,createStringInterpolator:Mp,colors:Jb});var fE=k6(dE,{applyAnimatedValues:rE,createAnimatedStyle:t=>new uE(t),getComponentProps:({scrollTop:t,scrollLeft:e,...n})=>n}),hE=fE.animated;function Tc(t){const{rows:e}=t,n=Z6({from:{opacity:0},to:{opacity:1}});return v.jsxs(hE.div,{style:n,className:"flex w-full animate-pulse flex-col items-start space-y-3",children:[[...Array(e)].map((r,o)=>v.jsx("div",{className:"h-10 w-full rounded-lg bg-gray-100 p-5"},`skeleton_rows_${o}`)),v.jsx("span",{className:"sr-only",children:"Loading..."})]})}function y0({children:t,offset:e,max:n=4,initialCollapsed:r=!0}){const o=x.useRef(null),[i,a]=x.useState(0),[s,c]=x.useState(r),u=s&&x.Children.count(t)>n?n:x.Children.count(t);x.useEffect(()=>{o.current&&(i?s?o.current.style.marginBottom=`-${i-(i/u+(u-1)*(e??i/u/7.5))}px`:o.current.style.marginBottom="unset":a(o.current.offsetHeight))},[s,i]);const d=f=>(100-(u-1-f))/100,h=f=>f*(i/u-(e??i/u/7.5));return v.jsx("div",{ref:o,className:"hover:cursor-pointer",onClick:()=>u>1&&c(!s),children:x.Children.map(x.Children.toArray(t).slice(-1*u),(f,p)=>v.jsx("div",{className:`${!s&&"[&:not(:last-child)]:mb-1"} h-full w-full transition-all duration-300 ease-in-out`,style:{transform:s&&u>1?`scaleX(${d(p)}) translateY(-${h(p)}px)`:void 0},children:f}))})}const pE=Oi("flex flex-shrink bg-white rounded-full transform transition-transform ease-out",{variants:{size:{md:"w-3 h-3",lg:"w-7 h-7"}}}),gE=Oi("",{variants:{size:{md:"pr-4",lg:"pr-6"}}}),mE=({id:t,disabled:e,onChange:n,defaultChecked:r=!1,size:o="md"})=>{const i=e,[a,s]=x.useState(r),[c,u]=x.useState(!1),d=()=>{i||(s(!a),n&&n())},h=()=>{e||u(!0)},f=()=>{u(!1)},p=In("relative py-0.5 pl-0.5 rounded-full",{"ring-2 ring-core-white-900 outline-core-primary-500 outline outline-2 outline-offset-2":c,"bg-core-primary-500 hover:bg-core-primary-600":a&&!e,"bg-core-gray-200 hover:bg-core-gray-300":!a&&!e,"bg-core-gray-100":e},gE({size:o})),l=o==="lg"?"translate-x-[1.375rem] ease-out":"translate-x-3.5 ease-out";return v.jsxs("div",{className:`inline-flex items-center py-1 ${i?"pointer-events-none":"cursor-pointer "}`,onClick:d,onFocus:h,children:[v.jsx("input",{className:"sr-only ",id:t,type:"checkbox",checked:a,disabled:i,onBlur:f,onChange:d,onFocus:h}),v.jsx("div",{className:p,children:v.jsx("div",{className:In(pE({size:o}),`${a?l:""} ${i?"shadow-none":"shadow-xs"}`)})})]})},md=({id:t,children:e,size:n="md",description:r,toggleLeft:o=!0,disabled:i,helperText:a,defaultChecked:s=!1,label:c,required:u=!1,tooltip:d,onChange:h})=>{const f=x.useId(),p=t??f;return v.jsxs("div",{className:`flex ${o?"flex-row":"flex-row-reverse"} items-start gap-3`,children:[v.jsx(mE,{disabled:i,defaultChecked:s,id:p,size:n,onChange:h}),e||(c||r||d||a)&&v.jsxs("div",{className:"inline-flex w-full flex-col self-center",children:[v.jsx(kn,{className:In("font-normal"),description:r,required:u,tooltip:d,htmlFor:p,disabled:i,children:c}),v.jsx(kn.Helper,{disabled:i,helperText:a})]})]})};md.displayName="Switch";const v0=x.createContext(null);function yE(t=!1){const e=x.useContext(v0);if(!e&&!t)throw new Error("Switch.Item must be used within a SwitchGroup or SwitchGroup.Root");return e}const w0=x.forwardRef(({toggleLeft:t=!1,size:e="md",children:n,description:r,disabled:o,helperText:i,id:a,label:s,required:c,tooltip:u},d)=>{const h=x.useId(),f=a??h,p=s??r??u??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(kn,{className:"cursor-default",description:r,required:c,tooltip:u,htmlFor:f,disabled:o,children:s}),v.jsx(kn.Helper,{disabled:o,helperText:i})]}):null;return v.jsx(v0.Provider,{value:{disabled:o,toggleLeft:t,size:e},children:v.jsxs("div",{ref:d,"aria-describedby":i?`${f}__describer`:void 0,"aria-labelledby":s?`${f}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[s??i??r??u?v.jsx("div",{className:"flex flex-col",children:p}):null,n?v.jsx("div",{className:In("flex flex-col gap-2"),children:n}):null]})})});w0.displayName="SwitchGroup",Object.assign(w0,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=yE(),{disabled:o,size:i,toggleLeft:a}=r??{};return v.jsx(md,{toggleLeft:a,disabled:t??o,label:e,defaultChecked:n,size:i})}});const vE=({children:t})=>v.jsx("div",{className:"fixed bottom-0 z-10 flex h-[70px] w-full border-b-0 border-t border-gray-100 bg-white lg:bottom-auto lg:top-0 lg:h-[50px] lg:border-b lg:border-t-0",children:t}),wE=({id:t,label:e,icon:n,pathname:r,activeTab:o,setActiveTab:i})=>v.jsx(X1,{className:"flex flex-grow items-center",to:r??"",children:v.jsxs("button",{className:`flex h-full flex-grow flex-col items-center justify-center gap-1 border-b-0 border-t-2 px-3 py-3 text-xs focus:outline-none lg:flex-row lg:border-b-2 lg:border-t-0 lg:text-sm ${o===t?"border-core-primary-500 text-core-primary-500":"border-transparent text-core-gray-500 hover:text-core-gray-800"}`,onClick:()=>i(t),children:[v.jsx(wn,{icon:n,className:"mr-2",variant:o===t?"discovery":"secondary"}),e]})}),b0=Object.prototype.toString;function yd(t){switch(b0.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Xr(t,Error)}}function Di(t,e){return b0.call(t)===`[object ${e}]`}function E0(t){return Di(t,"ErrorEvent")}function C0(t){return Di(t,"DOMError")}function bE(t){return Di(t,"DOMException")}function zr(t){return Di(t,"String")}function vd(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function wd(t){return t===null||vd(t)||typeof t!="object"&&typeof t!="function"}function Mi(t){return Di(t,"Object")}function xc(t){return typeof Event<"u"&&Xr(t,Event)}function EE(t){return typeof Element<"u"&&Xr(t,Element)}function CE(t){return Di(t,"RegExp")}function Oc(t){return!!(t&&t.then&&typeof t.then=="function")}function _E(t){return Mi(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Xr(t,e){try{return t instanceof e}catch{return!1}}function _0(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Li(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function A0(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const o=t[r];try{_0(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function AE(t,e,n=!1){return zr(t)?CE(e)?e.test(t):zr(e)?n?t===e:t.includes(e):!1:!1}function zo(t,e=[],n=!1){return e.some(r=>AE(t,r,n))}function SE(t,e,n=250,r,o,i,a){if(!i.exception||!i.exception.values||!a||!Xr(a.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=IE(bd(t,e,o,a.originalException,r,i.exception.values,s,0),n))}function bd(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let c=[...i];if(Xr(r[o],Error)){S0(a,s);const u=t(e,r[o]),d=c.length;I0(u,o,d,s),c=bd(t,e,n,r[o],o,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Xr(u,Error)){S0(a,s);const h=t(e,u),f=c.length;I0(h,`errors[${d}]`,f,s),c=bd(t,e,n,u,o,[h,...c],h,f)}}),c}function S0(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function I0(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function IE(t,e){return t.map(n=>(n.value&&(n.value=Li(n.value,e)),n))}function T0(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Xo="8.34.0",gt=globalThis;function Pc(t,e,n){const r=gt,o=r.__SENTRY__=r.__SENTRY__||{},i=o[Xo]=o[Xo]||{};return i[t]||(i[t]=e())}const Fi=gt,TE=80;function Qo(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,o=[];let i=0,a=0;const s=" > ",c=s.length;let u;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||TE;for(;n&&i++<r&&(u=xE(n,d),!(u==="html"||i>1&&a+o.length*c+u.length>=h));)o.push(u),a+=u.length,n=n.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function xE(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Fi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(o&&o.length)o.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&zr(a)){const s=a.split(/\s+/);for(const c of s)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const a of i){const s=n.getAttribute(a);s&&r.push(`[${a}="${s}"]`)}return r.join("")}function OE(){try{return Fi.document.location.href}catch{return""}}function PE(t){return Fi.document&&Fi.document.querySelector?Fi.document.querySelector(t):null}function x0(t){if(!Fi.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const ji=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kE="Sentry Logger ",Ed=["debug","info","warn","error","log","assert","trace"],kc={};function Cd(t){if(!("console"in gt))return t();const e=gt.console,n={},r=Object.keys(kc);r.forEach(o=>{const i=kc[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function BE(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ji?Ed.forEach(n=>{e[n]=(...r)=>{t&&Cd(()=>{gt.console[n](`${kE}[${n}]:`,...r)})}}):Ed.forEach(n=>{e[n]=()=>{}}),e}const Ie=Pc("logger",BE),NE=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function RE(t){return t==="http"||t==="https"}function Xa(t,e=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function DE(t){const e=NE.exec(t);if(!e){Cd(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,o="",i="",a="",s=""]=e.slice(1);let c="",u=s;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const h=u.match(/^\d+/);h&&(u=h[0])}return O0({host:i,pass:o,path:c,projectId:u,port:a,protocol:n,publicKey:r})}function O0(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ME(t){if(!ji)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(Ie.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?RE(r)?e&&isNaN(parseInt(e,10))?(Ie.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(Ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function LE(t){const e=typeof t=="string"?DE(t):O0(t);if(!(!e||!ME(e)))return e}class Lr extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function nr(t,e,n){if(!(e in t))return;const r=t[e],o=n(r);typeof o=="function"&&P0(o,r),t[e]=o}function gr(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{ji&&Ie.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function P0(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,gr(t,"__sentry_original__",e)}catch{}}function _d(t){return t.__sentry_original__}function FE(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function k0(t){if(yd(t))return{message:t.message,name:t.name,stack:t.stack,...N0(t)};if(xc(t)){const e={type:t.type,target:B0(t.target),currentTarget:B0(t.currentTarget),...N0(t)};return typeof CustomEvent<"u"&&Xr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function B0(t){try{return EE(t)?Qo(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function N0(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function jE(t,e=40){const n=Object.keys(k0(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Li(r,e);for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(!(i.length>e))return o===n.length?i:Li(i,e)}return""}function xn(t){return Ad(t,new Map)}function Ad(t,e){if(VE(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const o of Object.getOwnPropertyNames(t))typeof t[o]<"u"&&(r[o]=Ad(t[o],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(o=>{r.push(Ad(o,e))}),r}return t}function VE(t){if(!Mi(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const R0=50,Jo="?",D0=/\(error: (.*)\)/,M0=/captureMessage|captureException/;function UE(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const i=[],a=n.split(`
101
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function z(H,$){($==null||$>H.length)&&($=H.length);for(var J=0,S=new Array($);J<$;J++)S[J]=H[J];return S}function te(H){return te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},te(H)}function oe(H,$){var J=Object.keys(H);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(H);$&&(S=S.filter(function(M){return Object.getOwnPropertyDescriptor(H,M).enumerable})),J.push.apply(J,S)}return J}function ne(H,$){for(var J=0;J<$.length;J++){var S=$[J];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(H,we(S.key),S)}}function se(H,$,J){return($=we($))in H?Object.defineProperty(H,$,{value:J,enumerable:!0,configurable:!0,writable:!0}):H[$]=J,H}function we(H){var $=function(J,S){if(te(J)!="object"||!J)return J;var M=J[Symbol.toPrimitive];if(M!==void 0){var F=M.call(J,S);if(te(F)!="object")return F;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(J)}(H,"string");return te($)=="symbol"?$:$+""}var le=function(){return H=function S(M,F){var B=this;if(function(fe,ye){if(!(fe instanceof ye))throw new TypeError("Cannot call a class as a function")}(this,S),se(this,"input",void 0),se(this,"options",void 0),se(this,"utilities",void 0),se(this,"caretPosition",void 0),se(this,"caretPositionEnd",void 0),se(this,"keyboardDOM",void 0),se(this,"keyboardPluginClasses",void 0),se(this,"keyboardDOMClass",void 0),se(this,"buttonElements",void 0),se(this,"currentInstanceName",void 0),se(this,"allKeyboardInstances",void 0),se(this,"keyboardInstanceNames",void 0),se(this,"isFirstKeyboardInstance",void 0),se(this,"physicalKeyboard",void 0),se(this,"modules",void 0),se(this,"activeButtonClass",void 0),se(this,"holdInteractionTimeout",void 0),se(this,"holdTimeout",void 0),se(this,"isMouseHold",void 0),se(this,"initialized",void 0),se(this,"candidateBox",void 0),se(this,"keyboardRowsDOM",void 0),se(this,"defaultName","default"),se(this,"activeInputElement",null),se(this,"handleParams",function(fe,ye){var ue,Oe,ke;if(typeof fe=="string")ue=fe.split(".").join(""),Oe=document.querySelector(".".concat(ue)),ke=ye;else if(fe instanceof HTMLDivElement){if(!fe.className)throw console.warn("Any DOM element passed as parameter must have a class."),new Error("KEYBOARD_DOM_CLASS_ERROR");ue=fe.className.split(" ")[0],Oe=fe,ke=ye}else ue="simple-keyboard",Oe=document.querySelector(".".concat(ue)),ke=fe;return{keyboardDOMClass:ue,keyboardDOM:Oe,options:ke}}),se(this,"getOptions",function(){return B.options}),se(this,"getCaretPosition",function(){return B.caretPosition}),se(this,"getCaretPositionEnd",function(){return B.caretPositionEnd}),se(this,"registerModule",function(fe,ye){B.modules[fe]||(B.modules[fe]={}),ye(B.modules[fe])}),se(this,"getKeyboardClassString",function(){for(var fe=arguments.length,ye=new Array(fe),ue=0;ue<fe;ue++)ye[ue]=arguments[ue];return[B.keyboardDOMClass].concat(ye).filter(function(Oe){return!!Oe}).join(" ")}),typeof window<"u"){var Q=this.handleParams(M,F),Z=Q.keyboardDOMClass,ee=Q.keyboardDOM,K=Q.options,ge=K===void 0?{}:K;this.utilities=new E({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=ee,this.options=function(fe){for(var ye=1;ye<arguments.length;ye++){var ue=arguments[ye]!=null?arguments[ye]:{};ye%2?oe(Object(ue),!0).forEach(function(Oe){se(fe,Oe,ue[Oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(fe,Object.getOwnPropertyDescriptors(ue)):oe(Object(ue)).forEach(function(Oe){Object.defineProperty(fe,Oe,Object.getOwnPropertyDescriptor(ue,Oe))})}return fe}({layoutName:"default",theme:"hg-theme-default",inputName:"default",preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},ge),this.keyboardPluginClasses="",E.bindMethods(S,this);var be=this.options.inputName,pe=be===void 0?this.defaultName:be;if(this.input={},this.input[pe]="",this.keyboardDOMClass=Z,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new N({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new k({utilities:this.utilities,options:this.options}):null,!this.keyboardDOM)throw console.warn('".'.concat(Z,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}},$=[{key:"setCaretPosition",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:S;this.caretPosition=S,this.caretPositionEnd=M}},{key:"getInputCandidates",value:function(S){var M=this,F=this.options,B=F.layoutCandidates,Q=F.layoutCandidatesCaseSensitiveMatch;if(!B||te(B)!=="object")return{};var Z=Object.keys(B).filter(function(ge){var be=S.substring(0,M.getCaretPositionEnd()||0)||S,pe=new RegExp("".concat(M.utilities.escapeRegex(ge),"$"),Q?"g":"gi");return!!U(be.matchAll(pe)).length});if(Z.length>1){var ee=Z.sort(function(ge,be){return be.length-ge.length})[0];return{candidateKey:ee,candidateValue:B[ee]}}if(Z.length){var K=Z[0];return{candidateKey:K,candidateValue:B[K]}}return{}}},{key:"showCandidatesBox",value:function(S,M,F){var B=this;this.candidateBox&&this.candidateBox.show({candidateValue:M,targetElement:F,onSelect:function(Q,Z){var ee=B.options,K=ee.layoutCandidatesCaseSensitiveMatch,ge=ee.disableCandidateNormalization,be=ee.enableLayoutCandidatesKeyPress,pe=Q;ge||(pe=Q.normalize("NFD")),typeof B.options.beforeInputUpdate=="function"&&B.options.beforeInputUpdate(B);var fe=B.getInput(B.options.inputName,!0),ye=B.getCaretPositionEnd()||0,ue=fe.substring(0,ye||0)||fe,Oe=new RegExp("".concat(B.utilities.escapeRegex(S),"$"),K?"g":"gi"),ke=ue.replace(Oe,pe),at=fe.replace(ue,ke),ze=ke.length-ue.length,It=(ye||fe.length)+ze;It<0&&(It=0),B.setInput(at,B.options.inputName,!0),B.setCaretPosition(It),be&&typeof B.options.onKeyPress=="function"&&B.options.onKeyPress(Q,Z),typeof B.options.onChange=="function"&&B.options.onChange(B.getInput(B.options.inputName,!0),Z),typeof B.options.onChangeAll=="function"&&B.options.onChangeAll(B.getAllInputs(),Z)}})}},{key:"handleButtonClicked",value:function(S,M){var F=this.options,B=F.inputName,Q=B===void 0?this.defaultName:B,Z=F.debug;if(S!=="{//}"){this.input[Q]||(this.input[Q]=""),typeof this.options.beforeInputUpdate=="function"&&this.options.beforeInputUpdate(this);var ee=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(S)&&this.activeInputElement&&this.input[Q]&&this.input[Q]===ee&&this.caretPosition===0&&this.caretPositionEnd===ee.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(S,M);if(typeof this.options.onKeyPress=="function"&&this.options.onKeyPress(S,M),this.input[Q]!==ee&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(ee))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,ee))return;var K=this.utilities.getUpdatedInput(S,this.input[Q],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(K,this.options.inputName,!0),Z&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")"),M==null?void 0:M.type),this.options.syncInstanceInputs&&this.syncInstanceInputs(),typeof this.options.onChange=="function"&&this.options.onChange(this.getInput(this.options.inputName,!0),M),typeof this.options.onChangeAll=="function"&&this.options.onChangeAll(this.getAllInputs(),M),M!=null&&M.target&&this.options.enableLayoutCandidates){var ge,be=this.getInputCandidates(ee),pe=be.candidateKey,fe=be.candidateValue;pe&&fe?this.showCandidatesBox(pe,fe,this.keyboardDOM):(ge=this.candidateBox)===null||ge===void 0||ge.destroy()}}this.caretPositionEnd&&this.caretPosition!==this.caretPositionEnd&&(this.setCaretPosition(this.caretPositionEnd,this.caretPositionEnd),this.activeInputElement&&this.activeInputElement.setSelectionRange(this.caretPositionEnd,this.caretPositionEnd),this.options.debug&&console.log("Caret position aligned",this.caretPosition)),Z&&console.log("Key pressed:",S)}}},{key:"getMouseHold",value:function(){return this.isMouseHold}},{key:"setMouseHold",value:function(S){this.options.syncInstanceInputs?this.dispatch(function(M){M.isMouseHold=S}):this.isMouseHold=S}},{key:"handleButtonMouseDown",value:function(S,M){var F=this;M&&(this.options.preventMouseDownDefault&&M.preventDefault(),this.options.stopMouseDownPropagation&&M.stopPropagation(),M.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.setMouseHold(!0),this.options.disableButtonHold||(this.holdTimeout=window.setTimeout(function(){(F.getMouseHold()&&(!S.includes("{")&&!S.includes("}")||S==="{delete}"||S==="{backspace}"||S==="{bksp}"||S==="{space}"||S==="{tab}")||S==="{arrowright}"||S==="{arrowleft}"||S==="{arrowup}"||S==="{arrowdown}")&&(F.options.debug&&console.log("Button held:",S),F.handleButtonHold(S)),clearTimeout(F.holdTimeout)},500))}},{key:"handleButtonMouseUp",value:function(S,M){var F=this;M&&(this.options.preventMouseUpDefault&&M.preventDefault&&M.preventDefault(),this.options.stopMouseUpPropagation&&M.stopPropagation&&M.stopPropagation(),!(M.target===this.keyboardDOM||M.target&&this.keyboardDOM.contains(M.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(M.target===this.candidateBox.candidateBoxElement||M.target&&this.candidateBox.candidateBoxElement.contains(M.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons(function(B){B.classList.remove(F.activeButtonClass)}),this.setMouseHold(!1),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),S&&typeof this.options.onKeyReleased=="function"&&this.options.onKeyReleased(S,M)}},{key:"handleKeyboardContainerMouseDown",value:function(S){this.options.preventMouseDownDefault&&S.preventDefault()}},{key:"handleButtonHold",value:function(S){var M=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout(function(){M.getMouseHold()?(M.handleButtonClicked(S),M.handleButtonHold(S)):clearTimeout(M.holdInteractionTimeout)},100)}},{key:"syncInstanceInputs",value:function(){var S=this;this.dispatch(function(M){M.replaceInput(S.input),M.setCaretPosition(S.caretPosition,S.caretPositionEnd)})}},{key:"clearInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName;this.input[S]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.inputName||this.defaultName,M=arguments.length>1&&arguments[1]!==void 0&&arguments[1];return this.options.syncInstanceInputs&&!M&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[S].replace("‫","").replace("‬","")+"‬":this.input[S]}},{key:"getAllInputs",value:function(){var S=this,M={};return Object.keys(this.input).forEach(function(F){M[F]=S.getInput(F,!0)}),M}},{key:"setInput",value:function(S){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.inputName||this.defaultName,F=arguments.length>2?arguments[2]:void 0;this.input[M]=S,!F&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(S){this.input=S}},{key:"setOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},M=this.changedOptions(S);this.options=Object.assign(this.options,S),M.length&&(this.options.debug&&console.log("changedOptions",M),this.onSetOptions(M),this.render())}},{key:"changedOptions",value:function(S){var M=this;return Object.keys(S).filter(function(F){return JSON.stringify(S[F])!==JSON.stringify(M.options[F])})}},{key:"onSetOptions",value:function(){var S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];S.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(S.includes("layoutCandidatesPageSize")||S.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new k({utilities:this.utilities,options:this.options}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.buttonElements={}}},{key:"dispatch",value:function(S){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach(function(M){S(window.SimpleKeyboardInstances[M],M)})}},{key:"addButtonTheme",value:function(S,M){var F=this;M&&S&&(S.split(" ").forEach(function(B){M.split(" ").forEach(function(Q){F.options.buttonTheme||(F.options.buttonTheme=[]);var Z=!1;F.options.buttonTheme.map(function(ee){if(ee!=null&&ee.class.split(" ").includes(Q)){Z=!0;var K=ee.buttons.split(" ");K.includes(B)||(Z=!0,K.push(B),ee.buttons=K.join(" "))}return ee}),Z||F.options.buttonTheme.push({class:Q,buttons:S})})}),this.render())}},{key:"removeButtonTheme",value:function(S,M){var F=this;if(!S&&!M)return this.options.buttonTheme=[],void this.render();S&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(S.split(" ").forEach(function(B){var Q;(Q=F.options)===null||Q===void 0||(Q=Q.buttonTheme)===null||Q===void 0||Q.map(function(Z,ee){if(Z&&M&&M.includes(Z.class)||!M){var K,ge,be=(K=Z)===null||K===void 0?void 0:K.buttons.split(" ").filter(function(pe){return pe!==B});Z&&be!=null&&be.length?Z.buttons=be.join(" "):((ge=F.options.buttonTheme)===null||ge===void 0||ge.splice(ee,1),Z=null)}return Z})}),this.render())}},{key:"getButtonElement",value:function(S){var M,F=this.buttonElements[S];return F&&(M=F.length>1?F:F[0]),M}},{key:"inputPatternIsValid",value:function(S){var M,F=this.options.inputPattern;if((M=F instanceof RegExp?F:F[this.options.inputName||this.defaultName])&&S){var B=M.test(S);return this.options.debug&&console.log('inputPattern ("'.concat(M,'"): ').concat(B?"passed":"did not pass!")),B}return!0}},{key:"setEventListeners",value:function(){if(this.isFirstKeyboardInstance||!this.allKeyboardInstances){this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")"));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.addEventListener("keyup",this.handleKeyUp,M),document.addEventListener("keydown",this.handleKeyDown,M),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("selectionchange",this.handleSelectionChange),document.addEventListener("select",this.handleSelect)}}},{key:"handleKeyUp",value:function(S){this.caretEventHandler(S),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(S)}},{key:"handleKeyDown",value:function(S){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(S)}},{key:"handleMouseUp",value:function(S){this.caretEventHandler(S)}},{key:"handleTouchEnd",value:function(S){this.caretEventHandler(S)}},{key:"handleSelect",value:function(S){this.caretEventHandler(S)}},{key:"handleSelectionChange",value:function(S){navigator.userAgent.includes("Firefox")||this.caretEventHandler(S)}},{key:"caretEventHandler",value:function(S){var M,F=this;S.target.tagName&&(M=S.target.tagName.toLowerCase()),this.dispatch(function(B){var Q=S.target===B.keyboardDOM||S.target&&B.keyboardDOM.contains(S.target);if(F.options.syncInstanceInputs&&Array.isArray(S.path)&&(Q=S.path.some(function(K){var ge;return K==null||(ge=K.hasAttribute)===null||ge===void 0?void 0:ge.call(K,"data-skInstance")})),(M==="textarea"||M==="input"&&["text","search","url","tel","password"].includes(S.target.type))&&!B.options.disableCaretPositioning){var Z=S.target.selectionStart,ee=S.target.selectionEnd;B.options.rtl&&(Z=B.utilities.getRtlOffset(Z,B.getInput()),ee=B.utilities.getRtlOffset(ee,B.getInput())),B.setCaretPosition(Z,ee),F.activeInputElement=S.target,B.options.debug&&console.log("Caret at: ",B.getCaretPosition(),B.getCaretPositionEnd(),S&&S.target.tagName.toLowerCase(),"(".concat(B.keyboardDOMClass,")"),S==null?void 0:S.type)}else!B.options.disableCaretPositioning&&Q||(S==null?void 0:S.type)==="selectionchange"||(B.setCaretPosition(null),F.activeInputElement=null,B.options.debug&&console.log('Caret position reset due to "'.concat(S==null?void 0:S.type,'" event'),S))})}},{key:"recurseButtons",value:function(S){var M=this;S&&Object.keys(this.buttonElements).forEach(function(F){return M.buttonElements[F].forEach(S)})}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName));var S=this.options.physicalKeyboardHighlightPreventDefault,M=S!==void 0&&S;document.removeEventListener("keyup",this.handleKeyUp,M),document.removeEventListener("keydown",this.handleKeyDown,M),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.removeEventListener("selectionchange",this.handleSelectionChange),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons(function(F){F&&(F.onpointerdown=null,F.onpointerup=null,F.onpointercancel=null,F.ontouchstart=null,F.ontouchend=null,F.ontouchcancel=null,F.onclick=null,F.onmousedown=null,F.onmouseup=null,F.remove(),F=null)}),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.removeAttribute("data-skInstance"),this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(S){var M=this.options.buttonTheme,F=[];return Array.isArray(M)&&M.forEach(function(B){if(B&&B.class&&typeof B.class=="string"&&B.buttons&&typeof B.buttons=="string"){var Q=B.class.split(" ");B.buttons.split(" ").includes(S)&&(F=[].concat(U(F),U(Q)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',B)}),F}},{key:"setDOMButtonAttributes",value:function(S,M){var F=this.options.buttonAttributes;Array.isArray(F)&&F.forEach(function(B){B.attribute&&typeof B.attribute=="string"&&B.value&&typeof B.value=="string"&&B.buttons&&typeof B.buttons=="string"?B.buttons.split(" ").includes(S)&&M(B.attribute,B.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',B)})}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(S){if(S.target.classList.contains("hg-button"))return S.preventDefault(),S.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),typeof this.options.onInit=="function"&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),typeof this.options.beforeFirstRender=="function"&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){typeof this.options.beforeRender=="function"&&this.options.beforeRender(this)}},{key:"onRender",value:function(){typeof this.options.onRender=="function"&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){typeof this.options.onModulesLoaded=="function"&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var S=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach(function(M){var F=new M(S);F.init&&F.init(S)}),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(S,M){return!!this.modules[S]&&this.modules[S][M]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(S,M,F,B){var Q=this,Z=Array.from(S.children),ee=0;return Z.length&&F.forEach(function(K,ge){var be=B[ge];if(!(be&&be>K))return!1;var pe=K-ee,fe=be-ee,ye=document.createElement("div");ye.className+="hg-button-container";var ue="".concat(Q.options.layoutName,"-r").concat(M,"c").concat(ge);ye.setAttribute("data-skUID",ue);var Oe=Z.splice(pe,fe-pe+1);ee=fe-pe,Oe.forEach(function(ke){return ye.appendChild(ke)}),Z.splice(pe,0,ye),S.innerHTML="",Z.forEach(function(ke){return S.appendChild(ke)}),Q.options.debug&&console.log("rowDOMContainer",Oe,pe,fe,ee+1)}),S}},{key:"render",value:function(){var S=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var M="hg-layout-".concat(this.options.layoutName),F=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},B=this.options.useTouchEvents||!1,Q=B?"hg-touch-events":"",Z=this.options.useMouseEvents||!1,ee=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,M,this.keyboardPluginClasses,Q),this.keyboardDOM.setAttribute("data-skInstance",this.currentInstanceName),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",F[this.options.layoutName||this.defaultName].forEach(function(K,ge){var be=K.split(" ");S.options.excludeFromLayout&&S.options.excludeFromLayout[S.options.layoutName||S.defaultName]&&(be=be.filter(function(ue){return S.options.excludeFromLayout&&!S.options.excludeFromLayout[S.options.layoutName||S.defaultName].includes(ue)}));var pe=document.createElement("div");pe.className+="hg-row";var fe=[],ye=[];be.forEach(function(ue,Oe){var ke,at=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("[")===0,ze=!ee&&typeof ue=="string"&&ue.length>1&&ue.indexOf("]")===ue.length-1;at&&(fe.push(Oe),ue=ue.replace(/\[/g,"")),ze&&(ye.push(Oe),ue=ue.replace(/\]/g,""));var It=S.utilities.getButtonClass(ue),ht=S.utilities.getButtonDisplayName(ue,S.options.display,S.options.mergeDisplay),wr=S.options.useButtonTag?"button":"div",pt=document.createElement(wr);pt.className+="hg-button ".concat(It),(ke=pt.classList).add.apply(ke,U(S.getButtonThemeClasses(ue))),S.setDOMButtonAttributes(ue,function(De,Pr){pt.setAttribute(De,Pr)}),S.activeButtonClass="hg-activeButton",!S.utilities.pointerEventsSupported()||B||Z?B?(pt.ontouchstart=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.ontouchend=function(De){S.handleButtonMouseUp(ue,De)},pt.ontouchcancel=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onclick=function(De){S.setMouseHold(!1),typeof S.options.onKeyReleased!="function"&&S.handleButtonClicked(ue,De)},pt.onmousedown=function(De){typeof S.options.onKeyReleased!="function"||S.isMouseHold||S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onmouseup=function(De){S.handleButtonMouseUp(ue,De)}):(pt.onpointerdown=function(De){S.handleButtonClicked(ue,De),S.handleButtonMouseDown(ue,De)},pt.onpointerup=function(De){S.handleButtonMouseUp(ue,De)},pt.onpointercancel=function(De){S.handleButtonMouseUp(ue,De)}),pt.setAttribute("data-skBtn",ue);var mn="".concat(S.options.layoutName,"-r").concat(ge,"b").concat(Oe);pt.setAttribute("data-skBtnUID",mn);var Ot=document.createElement("span");Ot.innerHTML=ht,pt.appendChild(Ot),S.buttonElements[ue]||(S.buttonElements[ue]=[]),S.buttonElements[ue].push(pt),pe.appendChild(pt)}),pe=S.parseRowDOMContainers(pe,ge,fe,ye),S.keyboardRowsDOM.appendChild(pe)}),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||B||Z?B?(document.ontouchend=function(K){return S.handleButtonMouseUp(void 0,K)},document.ontouchcancel=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.ontouchstart=function(K){return S.handleKeyboardContainerMouseDown(K)}):B||(document.onmouseup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onmousedown=function(K){return S.handleKeyboardContainerMouseDown(K)}):(document.onpointerup=function(K){return S.handleButtonMouseUp(void 0,K)},this.keyboardDOM.onpointerdown=function(K){return S.handleKeyboardContainerMouseDown(K)}),this.onInit())}}],$&&ne(H.prototype,$),J&&ne(H,J),Object.defineProperty(H,"prototype",{writable:!1}),H;var H,$,J}(),_e=le,ve=le}(),h}()},442:function(s){s.exports=n}},o={};function i(s){var c=o[s];if(c!==void 0)return c.exports;var u=o[s]={exports:{}};return r[s].call(u.exports,u,u.exports,i),u.exports}i.n=function(s){var c=s&&s.__esModule?function(){return s.default}:function(){return s};return i.d(c,{a:c}),c},i.d=function(s,c){for(var u in c)i.o(c,u)&&!i.o(s,u)&&Object.defineProperty(s,u,{enumerable:!0,get:c[u]})},i.o=function(s,c){return Object.prototype.hasOwnProperty.call(s,c)},i.r=function(s){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(s,"__esModule",{value:!0})};var a={};return function(){i.r(a),i.d(a,{KeyboardReact:function(){return g},default:function(){return m}}),i(981);var s=i(442),c=i(548),u=i.n(c);function d(y){return d=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},d(y)}function h(y,w){var b=Object.keys(y);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(y);w&&(E=E.filter(function(C){return Object.getOwnPropertyDescriptor(y,C).enumerable})),b.push.apply(b,E)}return b}function f(y){for(var w=1;w<arguments.length;w++){var b=arguments[w]!=null?arguments[w]:{};w%2?h(Object(b),!0).forEach(function(E){p(y,E,b[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(b)):h(Object(b)).forEach(function(E){Object.defineProperty(y,E,Object.getOwnPropertyDescriptor(b,E))})}return y}function p(y,w,b){var E;return E=function(C,I){if(d(C)!="object"||!C)return C;var T=C[Symbol.toPrimitive];if(T!==void 0){var P=T.call(C,I||"default");if(d(P)!="object")return P;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(C)}(w,"string"),(w=d(E)=="symbol"?E:E+"")in y?Object.defineProperty(y,w,{value:b,enumerable:!0,configurable:!0,writable:!0}):y[w]=b,y}var l=function(y){return f(f({},y),{},{keyboardRef:null})},g=function(y){var w=y.baseClass||"react-simple-keyboard",b=s.useRef(null),E=s.useRef(null),C=s.useRef(null),I=s.useRef(y);return s.useEffect(function(){return function(){C.current&&C.current.destroy(),b.current=!1}},[]),s.useEffect(function(){var T=function(j){return f(f({},j),{},{theme:"simple-keyboard ".concat(j.theme||"hg-theme-default")})}(y);if(!b.current){b.current=!0,T.debug&&console.log("ReactSimpleKeyboard: Init");var P=E.current,N=".".concat(w);C.current=new(u())(P||N,T),T.keyboardRef&&T.keyboardRef(C.current)}var L=function(j,W){var q=l(W),k=l(j);return Object.keys(q).filter(function(U){return q[U]!==k[U]})}(I.current,T);if(L.length){var V=C.current;I.current=T,V==null||V.setOptions(T),T.debug&&console.log("ReactSimpleKeyboard - setOptions called due to updated props:",L)}},[b,w,I,y]),s.createElement("div",{className:w,ref:E})},m=g}(),a}()})})(dp);var Db=dp.exports;const Mb=Fu(Db);function fp({onChange:t,keyboardRef:e,layout:n,theme:r}){const[o,i]=x.useState("default"),a=s=>{(s==="{shift}"||s==="{lock}")&&i(o==="default"?"shift":"default")};return v.jsx(Mb,{keyboardRef:s=>e.current=s,layoutName:o,layout:n,theme:r,onChange:t,onKeyPress:a,preventMouseDownDefault:!0})}function hp(){const{subscribe:t,unsubscribe:e,publish:n}=Oa();return{initialize:(s,c)=>{t("openKeyboard",s),t("closeKeyboard",c)},terminate:(s,c)=>{e("openKeyboard",s),e("closeKeyboard",c)},open:s=>{n("openKeyboard",{inputId:s.target.id,inputValue:s.target.value})},close:()=>{n("closeKeyboard")}}}const fr="keyboard-custom-overlap-id";function Lb({enabled:t}){const[e,n]=x.useState(!1),r=x.useRef(null),o=x.useRef(null),i=x.useRef(null),[a,s]=x.useState(),[c,u]=x.useState(0),{initialize:d,terminate:h}=hp(),f=w=>{var b,E;o.current=document.getElementById(w.detail.inputId),(b=r.current)==null||b.setInput(w.detail.inputValue),(E=o.current)==null||E.addEventListener("input",C=>{var T;const I=C.target;(T=r.current)==null||T.setInput(I==null?void 0:I.value)}),u(y()),n(!0)},p=()=>{u(0),n(!1)};x.useEffect(()=>(d(f,p),()=>{h(f,p)}),[e]);const l=w=>{var b,E;if(o&&o.current){g(o.current,w);const C=(b=r.current)==null?void 0:b.getCaretPosition();C&&((E=o.current)==null||E.setSelectionRange(C,C))}},g=(w,b)=>{var I;const E=(I=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))==null?void 0:I.set;E==null||E.call(w,b);const C=new Event("input",{bubbles:!0});w.dispatchEvent(C)},m=()=>{var w;if(!a){const b=(w=i.current)==null?void 0:w.getBoundingClientRect();return b&&b.x&&!a&&s(b),b}return a},y=()=>{var T;const w=document.querySelectorAll("#"+fr),b=m(),E=[...w].map(P=>P.getBoundingClientRect()),C=(T=o.current)==null?void 0:T.getBoundingClientRect();E.push(C),E.sort((P,N)=>P.bottom>N.bottom?-1:1);let I=0;return E.every(P=>{if(b&&b.top<P.bottom)return I=P.bottom-b.top+8,!1}),I};return t?v.jsx("div",{className:"relative",style:{height:c},children:v.jsx("div",{ref:i,className:`mobile:hidden absolute bottom-0 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!e&&a&&"hidden"} ${!e&&!a&&"pointer-events-none opacity-0"}`,children:v.jsx(fp,{keyboardRef:r,onChange:l})})}):v.jsx(v.Fragment,{})}const Yo=({id:t,name:e,label:n,description:r,required:o,type:i="text",value:a,placeholder:s,disabled:c,error:u=!1,helperText:d="",onChange:h,beforeIcon:f,afterIcon:p,autoFocus:l,onFocus:g,onBlur:m})=>{const[y,w]=x.useState(d),b=x.useRef(null),[E,C]=x.useState(!1),{open:I,close:T}=hp();x.useEffect(()=>()=>{T()},[]);const P=()=>{b.current&&w(b.current.validationMessage),C(!1),T(),m==null||m()},N=async W=>{C(!0),(async()=>I(W))().then(()=>{var k;return(k=b.current)==null?void 0:k.scrollIntoView({behavior:"smooth",block:"center"})}),g==null||g()},L=W=>{h==null||h(W)},V=x.useId(),j=t??V;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{description:r,disabled:c,htmlFor:j,required:o,children:n}),v.jsx("div",{className:In("flex-start box flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs",c?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",E&&!u&&"border-core-primary-500 ring-1 ring-core-primary-500",u&&"border-core-red-500",u&&E&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex flex-row gap-2 self-stretch p-2",children:[f&&v.jsx(wn,{icon:f}),v.jsx("input",{type:i,id:j,name:e,className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",value:a,onChange:L,onBlur:P,ref:b,placeholder:s,onFocus:N,disabled:c,autoFocus:l}),p&&v.jsx(wn,{icon:p})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${d||y?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-0"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(kn.Helper,{error:u,helperText:d||y})})})]})};Yo.displayName="Input";const pp=({id:t,name:e,label:n,required:r,description:o,placeholder:i,value:a,disabled:s,error:c=!1,helperText:u,onChange:d,type:h="date"})=>{const[f,p]=x.useState(!1),l=x.useId(),g=t??l;return v.jsxs("div",{className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{description:o,disabled:s,htmlFor:g,required:r,children:n}),v.jsx("div",{className:In("flex-start box relative flex h-10 flex-col justify-center self-stretch rounded border border-core-gray-200 shadow-xs ring-core-primary-500 ",s?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":" bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none ",f&&!c&&"border-core-primary-500 ring-1 ring-core-primary-500 selection:bg-core-primary-500",c&&"border-core-red-500",c&&f&&"border-core-red-500 ring-1 ring-core-red-500"),children:v.jsxs("div",{className:"flex w-full flex-row gap-2 self-stretch p-2",children:[v.jsx("input",{type:h,id:g,name:e,value:a,max:"2200-01-01",className:"flex flex-grow border-none bg-transparent p-0 text-sm text-core-gray-800 placeholder:text-core-gray-500 focus:ring-0 disabled:text-core-gray-300 placeholder:disabled:text-core-gray-300",placeholder:i,onChange:d,onFocus:()=>p(!0),onBlur:()=>p(!1),disabled:s}),v.jsx(wn,{icon:"calendar"})]})}),v.jsx("div",{className:`grid overflow-hidden transition-all duration-300 ease-out ${u?"grid-rows-[1fr] opacity-100":"grid-rows-[0fr] opacity-100"}`,children:v.jsx("div",{className:"overflow-hidden",children:v.jsx(kn.Helper,{error:c,helperText:u})})})]})};pp.displayName="Input";function Tn({children:t}){return v.jsx("div",{className:"h-screen w-screen md:p-6",children:v.jsx("div",{className:"flex h-full max-h-full items-center justify-center md:container [&>*]:grow",children:t})})}function Eo({title:t,isOpen:e,onClose:n,primaryAction:r,secondaryAction:o,children:i}){const[a,s]=x.useState(e),c=x.useRef(null);x.useEffect(()=>{s(e)},[e]),x.useEffect(()=>{const h=c.current;h&&(a?h.show():h.close())},[a]);const u=()=>{n&&n(),s(!1)},d=h=>{h.key==="Escape"&&u()};return v.jsx("div",{className:`fixed inset-0 z-40 min-h-screen items-center bg-gray-500 bg-opacity-25 ${a?"flex":"hidden"}`,children:v.jsx("dialog",{ref:c,onKeyDown:d,className:"scrollbar-hide absolute overflow-auto rounded-lg drop-shadow-md",children:v.jsxs("div",{className:"rounded-lg bg-white md:min-w-[420px]",children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:i}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[r&&v.jsx(nt,{label:r.label??"",onClick:r.action,disabled:r.disabled,pending:r.loading}),o&&v.jsx(nt,{label:o.label??"",onClick:o.action,disabled:o.disabled,pending:o.loading,variant:"secondary"})]})})]})})})}function Fb({option:{label:t},checked:e,onChange:n}){return v.jsxs("div",{className:"flex items-center gap-2 px-4 py-2 text-sm hover:bg-core-gray-50",children:[v.jsx(Fl,{defaultChecked:e,onChange:n}),v.jsx("p",{children:t})]})}function jb(t){const{t:e}=Ue(),n=x.useRef(null),[r,o]=x.useState(!1);lp(n,o);const[i,a]=x.useState(""),[s,c]=x.useState(t.value.split(";")),{name:u,onChange:d}=t,h=(f,p)=>{let l=[];f?l=[...s,p]:l=s.filter(g=>g!==p),c(l),d&&d(u??"",l.join(";"))};return v.jsxs("div",{ref:n,className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsxs("div",{className:"relative",children:[v.jsxs("div",{className:`flex h-10 items-center justify-between rounded border p-2 ${t.disabled?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!t.disabled&&o(!r),children:[v.jsx("div",{className:`flex gap-1 overflow-hidden text-sm ${t.disabled?"text-core-gray-300":"text-core-gray-800"}`,children:s.map(f=>{var l;const p=(l=t.options.find(g=>g.value===f))==null?void 0:l.label;return v.jsxs("div",{className:"pointer-events-none flex items-center overflow-hidden rounded bg-core-gray-100 px-1.5 py-0.5",children:[v.jsx("p",{className:"truncate",children:p}),v.jsx("span",{className:"pointer-events-auto cursor-pointer",onClick:()=>h(!1,f),children:v.jsx(wn,{icon:"close"})})]},f)})}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:r?"▴":"▾"})]}),v.jsxs("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!r&&"hidden"} py-2`,children:[t.options.length>6&&v.jsx("div",{className:"px-4",children:v.jsx(Yo,{placeholder:`${e("search")}...`,onChange:f=>a(f.target.value)})}),t.options.map(f=>{if(!(i&&!f.label.toLowerCase().includes(i.toLowerCase())))return v.jsx(Fb,{option:f,checked:s.includes(f.value),onChange:p=>h(p,f.value)},`${f.value}_${s.includes(f.value)?"checked":"unchecked"}`)})]})]})]})}function Vb({value:t,max:e,label:n}){return v.jsxs("div",{children:[v.jsx("div",{className:"font-sm mb-1 text-right text-core-gray-500",children:n}),v.jsx("div",{className:"h-1 w-full rounded-full bg-core-gray-200",children:v.jsx("div",{className:"h-1 rounded-full bg-core-primary-500",style:{width:`${Math.min(t/e*100,100)}%`}})})]})}function Ub({value:t,placeholder:e,open:n,setOpen:r,disabled:o}){return v.jsxs("div",{className:`flex items-center justify-between rounded border p-2 ${o?"pointer-events-none bg-core-gray-50 shadow-none outline-core-gray-200":"bg-core-white-900 hover:border hover:border-core-gray-300 hover:shadow-none"}`,onClick:()=>!o&&r(!n),children:[v.jsx("span",{className:`text-sm ${o?"text-core-gray-300":"text-core-gray-800"}`,children:t||e}),v.jsx("span",{className:"ml-2 text-core-gray-500",children:n?"▴":"▾"})]})}function Gb({label:t,children:e}){return v.jsxs("div",{className:"[&:not(:last-child)]:mb-2",children:[v.jsx("p",{className:"mb-2 px-4 text-xs text-core-gray-500",children:t}),e]})}function jl(t){return v.jsx("div",{className:"px-4 py-2 text-sm hover:bg-core-gray-50",children:t.label})}function qb(t){const e=x.useRef(null),[n,r]=x.useState(!1),[o,i]=x.useState(t.value??"");lp(e,r);const a=(c,u)=>{i(c),r(!1),t.onChange&&t.onChange(u)},s=x.Children.map(t.children,c=>{if(x.isValidElement(c)){if(c.type===jl)return v.jsx("div",{onClick:()=>a(c.props.label,c.props.value),children:c});if(c.type===Gb){const u=x.Children.map(c.props.children,d=>{if(x.isValidElement(d)&&d.type===jl)return v.jsx("div",{onClick:()=>a(d.props.label,d.props.value),children:d})});return x.cloneElement(c,{},...u)}}});return v.jsxs("div",{ref:e,className:"flex flex-col gap-2 antialiased",children:[v.jsx(kn,{description:t.description,disabled:t.disabled,htmlFor:t.id,required:t.required,children:t.label}),v.jsx("div",{children:v.jsxs("div",{className:"relative",children:[v.jsx(Ub,{value:o,placeholder:t.placeholder,open:n,setOpen:r,disabled:t.disabled}),t.children&&v.jsx("div",{className:`absolute left-0 right-0 top-11 z-50 rounded border bg-core-white-900 shadow-xl ${!n&&"hidden"} py-2`,children:s})]})}),v.jsx(kn.Helper,{helperText:t.helperText})]})}var Hb=Object.defineProperty,$b=(t,e)=>{for(var n in e)Hb(t,n,{get:e[n],enumerable:!0})},Sr={};$b(Sr,{assign:()=>Kb,colors:()=>Ao,createStringInterpolator:()=>Kl,skipAnimation:()=>Ep,to:()=>bp,willAdvance:()=>zl});var Vl=ka(),He=t=>Pa(t,Vl),Ul=ka();He.write=t=>Pa(t,Ul);var uc=ka();He.onStart=t=>Pa(t,uc);var Gl=ka();He.onFrame=t=>Pa(t,Gl);var ql=ka();He.onFinish=t=>Pa(t,ql);var Pi=[];He.setTimeout=(t,e)=>{const n=He.now()+e,r=()=>{const i=Pi.findIndex(a=>a.cancel==r);~i&&Pi.splice(i,1),_o-=~i?1:0},o={time:n,handler:t,cancel:r};return Pi.splice(gp(n),0,o),_o+=1,mp(),o};var gp=t=>~(~Pi.findIndex(e=>e.time>t)||~Pi.length);He.cancel=t=>{uc.delete(t),Gl.delete(t),ql.delete(t),Vl.delete(t),Ul.delete(t)},He.sync=t=>{$l=!0,He.batchedUpdates(t),$l=!1},He.throttle=t=>{let e;function n(){try{t(...e)}finally{e=null}}function r(...o){e=o,He.onStart(n)}return r.handler=t,r.cancel=()=>{uc.delete(n),e=null},r};var Hl=typeof window<"u"?window.requestAnimationFrame:()=>{};He.use=t=>Hl=t,He.now=typeof performance<"u"?()=>performance.now():Date.now,He.batchedUpdates=t=>t(),He.catch=console.error,He.frameLoop="always",He.advance=()=>{He.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):vp()};var Co=-1,_o=0,$l=!1;function Pa(t,e){$l?(e.delete(t),t(0)):(e.add(t),mp())}function mp(){Co<0&&(Co=0,He.frameLoop!=="demand"&&Hl(yp))}function Yb(){Co=-1}function yp(){~Co&&(Hl(yp),He.batchedUpdates(vp))}function vp(){const t=Co;Co=He.now();const e=gp(Co);if(e&&(wp(Pi.splice(0,e),n=>n.handler()),_o-=e),!_o){Yb();return}uc.flush(),Vl.flush(t?Math.min(64,Co-t):16.667),Gl.flush(),Ul.flush(),ql.flush()}function ka(){let t=new Set,e=t;return{add(n){_o+=e==t&&!t.has(n)?1:0,t.add(n)},delete(n){return _o-=e==t&&t.has(n)?1:0,t.delete(n)},flush(n){e.size&&(t=new Set,_o-=e.size,wp(e,r=>r(n)&&t.add(r)),_o+=t.size,e=t)}}}function wp(t,e){t.forEach(n=>{try{e(n)}catch(r){He.catch(r)}})}function Yl(){}var Wb=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),Ae={arr:Array.isArray,obj:t=>!!t&&t.constructor.name==="Object",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",und:t=>t===void 0};function Kr(t,e){if(Ae.arr(t)){if(!Ae.arr(e)||t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}return t===e}var rt=(t,e)=>t.forEach(e);function Dr(t,e,n){if(Ae.arr(t)){for(let r=0;r<t.length;r++)e.call(n,t[r],`${r}`);return}for(const r in t)t.hasOwnProperty(r)&&e.call(n,t[r],r)}var tr=t=>Ae.und(t)?[]:Ae.arr(t)?t:[t];function Ba(t,e){if(t.size){const n=Array.from(t);t.clear(),rt(n,e)}}var Na=(t,...e)=>Ba(t,n=>n(...e)),Wl=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Kl,bp,Ao=null,Ep=!1,zl=Yl,Kb=t=>{t.to&&(bp=t.to),t.now&&(He.now=t.now),t.colors!==void 0&&(Ao=t.colors),t.skipAnimation!=null&&(Ep=t.skipAnimation),t.createStringInterpolator&&(Kl=t.createStringInterpolator),t.requestAnimationFrame&&He.use(t.requestAnimationFrame),t.batchedUpdates&&(He.batchedUpdates=t.batchedUpdates),t.willAdvance&&(zl=t.willAdvance),t.frameLoop&&(He.frameLoop=t.frameLoop)},Ra=new Set,hr=[],Xl=[],lc=0,dc={get idle(){return!Ra.size&&!hr.length},start(t){lc>t.priority?(Ra.add(t),He.onStart(zb)):(Cp(t),He(Ql))},advance:Ql,sort(t){if(lc)He.onFrame(()=>dc.sort(t));else{const e=hr.indexOf(t);~e&&(hr.splice(e,1),_p(t))}},clear(){hr=[],Ra.clear()}};function zb(){Ra.forEach(Cp),Ra.clear(),He(Ql)}function Cp(t){hr.includes(t)||_p(t)}function _p(t){hr.splice(Xb(hr,e=>e.priority>t.priority),0,t)}function Ql(t){const e=Xl;for(let n=0;n<hr.length;n++){const r=hr[n];lc=r.priority,r.idle||(zl(r),r.advance(t),r.idle||e.push(r))}return lc=0,Xl=hr,Xl.length=0,hr=e,hr.length>0}function Xb(t,e){const n=t.findIndex(e);return n<0?t.length:n}var Qb=(t,e,n)=>Math.min(Math.max(n,t),e),Jb={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Ir="[-+]?\\d*\\.?\\d+",fc=Ir+"%";function hc(...t){return"\\(\\s*("+t.join(")\\s*,\\s*(")+")\\s*\\)"}var Zb=new RegExp("rgb"+hc(Ir,Ir,Ir)),e6=new RegExp("rgba"+hc(Ir,Ir,Ir,Ir)),t6=new RegExp("hsl"+hc(Ir,fc,fc)),n6=new RegExp("hsla"+hc(Ir,fc,fc,Ir)),r6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,o6=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,i6=/^#([0-9a-fA-F]{6})$/,a6=/^#([0-9a-fA-F]{8})$/;function s6(t){let e;return typeof t=="number"?t>>>0===t&&t>=0&&t<=4294967295?t:null:(e=i6.exec(t))?parseInt(e[1]+"ff",16)>>>0:Ao&&Ao[t]!==void 0?Ao[t]:(e=Zb.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|255)>>>0:(e=e6.exec(t))?(ki(e[1])<<24|ki(e[2])<<16|ki(e[3])<<8|Ip(e[4]))>>>0:(e=r6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=a6.exec(t))?parseInt(e[1],16)>>>0:(e=o6.exec(t))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=t6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|255)>>>0:(e=n6.exec(t))?(Ap(Sp(e[1]),pc(e[2]),pc(e[3]))|Ip(e[4]))>>>0:null}function Jl(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ap(t,e,n){const r=n<.5?n*(1+e):n+e-n*e,o=2*n-r,i=Jl(o,r,t+1/3),a=Jl(o,r,t),s=Jl(o,r,t-1/3);return Math.round(i*255)<<24|Math.round(a*255)<<16|Math.round(s*255)<<8}function ki(t){const e=parseInt(t,10);return e<0?0:e>255?255:e}function Sp(t){return(parseFloat(t)%360+360)%360/360}function Ip(t){const e=parseFloat(t);return e<0?0:e>1?255:Math.round(e*255)}function pc(t){const e=parseFloat(t);return e<0?0:e>100?1:e/100}function Tp(t){let e=s6(t);if(e===null)return t;e=e||0;const n=(e&4278190080)>>>24,r=(e&16711680)>>>16,o=(e&65280)>>>8,i=(e&255)/255;return`rgba(${n}, ${r}, ${o}, ${i})`}var Da=(t,e,n)=>{if(Ae.fun(t))return t;if(Ae.arr(t))return Da({range:t,output:e,extrapolate:n});if(Ae.str(t.output[0]))return Kl(t);const r=t,o=r.output,i=r.range||[0,1],a=r.extrapolateLeft||r.extrapolate||"extend",s=r.extrapolateRight||r.extrapolate||"extend",c=r.easing||(u=>u);return u=>{const d=u6(u,i);return c6(u,i[d],i[d+1],o[d],o[d+1],c,a,s,r.map)}};function c6(t,e,n,r,o,i,a,s,c){let u=c?c(t):t;if(u<e){if(a==="identity")return u;a==="clamp"&&(u=e)}if(u>n){if(s==="identity")return u;s==="clamp"&&(u=n)}return r===o?r:e===n?t<=e?r:o:(e===-1/0?u=-u:n===1/0?u=u-e:u=(u-e)/(n-e),u=i(u),r===-1/0?u=-u:o===1/0?u=u+r:u=u*(o-r)+r,u)}function u6(t,e){for(var n=1;n<e.length-1&&!(e[n]>=t);++n);return n-1}var l6=(t,e="end")=>n=>{n=e==="end"?Math.min(n,.999):Math.max(n,.001);const r=n*t,o=e==="end"?Math.floor(r):Math.ceil(r);return Qb(0,1,o/t)},gc=1.70158,mc=gc*1.525,xp=gc+1,Op=2*Math.PI/3,Pp=2*Math.PI/4.5,yc=t=>t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375,d6={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>1-(1-t)*(1-t),easeInOutQuad:t=>t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2,easeInCubic:t=>t*t*t,easeOutCubic:t=>1-Math.pow(1-t,3),easeInOutCubic:t=>t<.5?4*t*t*t:1-Math.pow(-2*t+2,3)/2,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1-Math.pow(1-t,4),easeInOutQuart:t=>t<.5?8*t*t*t*t:1-Math.pow(-2*t+2,4)/2,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1-Math.pow(1-t,5),easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1-Math.pow(-2*t+2,5)/2,easeInSine:t=>1-Math.cos(t*Math.PI/2),easeOutSine:t=>Math.sin(t*Math.PI/2),easeInOutSine:t=>-(Math.cos(Math.PI*t)-1)/2,easeInExpo:t=>t===0?0:Math.pow(2,10*t-10),easeOutExpo:t=>t===1?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>t===0?0:t===1?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2,easeInCirc:t=>1-Math.sqrt(1-Math.pow(t,2)),easeOutCirc:t=>Math.sqrt(1-Math.pow(t-1,2)),easeInOutCirc:t=>t<.5?(1-Math.sqrt(1-Math.pow(2*t,2)))/2:(Math.sqrt(1-Math.pow(-2*t+2,2))+1)/2,easeInBack:t=>xp*t*t*t-gc*t*t,easeOutBack:t=>1+xp*Math.pow(t-1,3)+gc*Math.pow(t-1,2),easeInOutBack:t=>t<.5?Math.pow(2*t,2)*((mc+1)*2*t-mc)/2:(Math.pow(2*t-2,2)*((mc+1)*(t*2-2)+mc)+2)/2,easeInElastic:t=>t===0?0:t===1?1:-Math.pow(2,10*t-10)*Math.sin((t*10-10.75)*Op),easeOutElastic:t=>t===0?0:t===1?1:Math.pow(2,-10*t)*Math.sin((t*10-.75)*Op)+1,easeInOutElastic:t=>t===0?0:t===1?1:t<.5?-(Math.pow(2,20*t-10)*Math.sin((20*t-11.125)*Pp))/2:Math.pow(2,-20*t+10)*Math.sin((20*t-11.125)*Pp)/2+1,easeInBounce:t=>1-yc(1-t),easeOutBounce:yc,easeInOutBounce:t=>t<.5?(1-yc(1-2*t))/2:(1+yc(2*t-1))/2,steps:l6},Ma=Symbol.for("FluidValue.get"),Bi=Symbol.for("FluidValue.observers"),pr=t=>!!(t&&t[Ma]),Un=t=>t&&t[Ma]?t[Ma]():t,kp=t=>t[Bi]||null;function f6(t,e){t.eventObserved?t.eventObserved(e):t(e)}function La(t,e){const n=t[Bi];n&&n.forEach(r=>{f6(r,e)})}var Bp=class{constructor(t){if(!t&&!(t=this.get))throw Error("Unknown getter");h6(this,t)}},h6=(t,e)=>Np(t,Ma,e);function Ni(t,e){if(t[Ma]){let n=t[Bi];n||Np(t,Bi,n=new Set),n.has(e)||(n.add(e),t.observerAdded&&t.observerAdded(n.size,e))}return e}function Fa(t,e){const n=t[Bi];if(n&&n.has(e)){const r=n.size-1;r?n.delete(e):t[Bi]=null,t.observerRemoved&&t.observerRemoved(r,e)}}var Np=(t,e,n)=>Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0}),vc=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,p6=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Rp=new RegExp(`(${vc.source})(%|[a-z]+)`,"i"),g6=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,wc=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Dp=t=>{const[e,n]=m6(t);if(!e||Wl())return t;const r=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(r)return r.trim();if(n&&n.startsWith("--")){const o=window.getComputedStyle(document.documentElement).getPropertyValue(n);return o||t}else{if(n&&wc.test(n))return Dp(n);if(n)return n}return t},m6=t=>{const e=wc.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]},Zl,y6=(t,e,n,r,o)=>`rgba(${Math.round(e)}, ${Math.round(n)}, ${Math.round(r)}, ${o})`,Mp=t=>{Zl||(Zl=Ao?new RegExp(`(${Object.keys(Ao).join("|")})(?!\\w)`,"g"):/^\b$/);const e=t.output.map(i=>Un(i).replace(wc,Dp).replace(p6,Tp).replace(Zl,Tp)),n=e.map(i=>i.match(vc).map(Number)),o=n[0].map((i,a)=>n.map(s=>{if(!(a in s))throw Error('The arity of each "output" value must be equal');return s[a]})).map(i=>Da({...t,output:i}));return i=>{var c;const a=!Rp.test(e[0])&&((c=e.find(u=>Rp.test(u)))==null?void 0:c.replace(vc,""));let s=0;return e[0].replace(vc,()=>`${o[s++](i)}${a||""}`).replace(g6,y6)}},ed="react-spring: ",Lp=t=>{const e=t;let n=!1;if(typeof e!="function")throw new TypeError(`${ed}once requires a function parameter`);return(...r)=>{n||(e(...r),n=!0)}},v6=Lp(console.warn);function w6(){v6(`${ed}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var b6=Lp(console.warn);function E6(){b6(`${ed}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function bc(t){return Ae.str(t)&&(t[0]=="#"||/\d/.test(t)||!Wl()&&wc.test(t)||t in(Ao||{}))}var td=Wl()?x.useEffect:x.useLayoutEffect,C6=()=>{const t=x.useRef(!1);return td(()=>(t.current=!0,()=>{t.current=!1}),[]),t};function Fp(){const t=x.useState()[1],e=C6();return()=>{e.current&&t(Math.random())}}function _6(t,e){const[n]=x.useState(()=>({inputs:e,result:t()})),r=x.useRef(),o=r.current;let i=o;return i?e&&i.inputs&&A6(e,i.inputs)||(i={inputs:e,result:t()}):i=n,x.useEffect(()=>{r.current=i,o==n&&(n.inputs=n.result=void 0)},[i]),i.result}function A6(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}var jp=t=>x.useEffect(t,S6),S6=[];function Vp(t){const e=x.useRef();return x.useEffect(()=>{e.current=t}),e.current}var ja=Symbol.for("Animated:node"),I6=t=>!!t&&t[ja]===t,Mr=t=>t&&t[ja],nd=(t,e)=>Wb(t,ja,e),Ec=t=>t&&t[ja]&&t[ja].getPayload(),Up=class{constructor(){nd(this,this)}getPayload(){return this.payload||[]}},Va=class extends Up{constructor(t){super(),this._value=t,this.done=!0,this.durationProgress=0,Ae.num(this._value)&&(this.lastPosition=this._value)}static create(t){return new Va(t)}getPayload(){return[this]}getValue(){return this._value}setValue(t,e){return Ae.num(t)&&(this.lastPosition=t,e&&(t=Math.round(t/e)*e,this.done&&(this.lastPosition=t))),this._value===t?!1:(this._value=t,!0)}reset(){const{done:t}=this;this.done=!1,Ae.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,t&&(this.lastVelocity=null),this.v0=null)}},Ua=class extends Va{constructor(t){super(0),this._string=null,this._toString=Da({output:[t,t]})}static create(t){return new Ua(t)}getValue(){const t=this._string;return t??(this._string=this._toString(this._value))}setValue(t){if(Ae.str(t)){if(t==this._string)return!1;this._string=t,this._value=1}else if(super.setValue(t))this._string=null;else return!1;return!0}reset(t){t&&(this._toString=Da({output:[this.getValue(),t]})),this._value=0,super.reset()}},Cc={dependencies:null},_c=class extends Up{constructor(t){super(),this.source=t,this.setValue(t)}getValue(t){const e={};return Dr(this.source,(n,r)=>{I6(n)?e[r]=n.getValue(t):pr(n)?e[r]=Un(n):t||(e[r]=n)}),e}setValue(t){this.source=t,this.payload=this._makePayload(t)}reset(){this.payload&&rt(this.payload,t=>t.reset())}_makePayload(t){if(t){const e=new Set;return Dr(t,this._addToPayload,e),Array.from(e)}}_addToPayload(t){Cc.dependencies&&pr(t)&&Cc.dependencies.add(t);const e=Ec(t);e&&rt(e,n=>this.add(n))}},Gp=class extends _c{constructor(t){super(t)}static create(t){return new Gp(t)}getValue(){return this.source.map(t=>t.getValue())}setValue(t){const e=this.getPayload();return t.length==e.length?e.map((n,r)=>n.setValue(t[r])).some(Boolean):(super.setValue(t.map(T6)),!0)}};function T6(t){return(bc(t)?Ua:Va).create(t)}function rd(t){const e=Mr(t);return e?e.constructor:Ae.arr(t)?Gp:bc(t)?Ua:Va}var qp=(t,e)=>{const n=!Ae.fun(t)||t.prototype&&t.prototype.isReactComponent;return x.forwardRef((r,o)=>{const i=x.useRef(null),a=n&&x.useCallback(l=>{i.current=P6(o,l)},[o]),[s,c]=O6(r,e),u=Fp(),d=()=>{const l=i.current;if(n&&!l)return;(l?e.applyAnimatedValues(l,s.getValue(!0)):!1)===!1&&u()},h=new x6(d,c),f=x.useRef();td(()=>(f.current=h,rt(c,l=>Ni(l,h)),()=>{f.current&&(rt(f.current.deps,l=>Fa(l,f.current)),He.cancel(f.current.update))})),x.useEffect(d,[]),jp(()=>()=>{const l=f.current;rt(l.deps,g=>Fa(g,l))});const p=e.getComponentProps(s.getValue());return ce.createElement(t,{...p,ref:a})})},x6=class{constructor(t,e){this.update=t,this.deps=e}eventObserved(t){t.type=="change"&&He.write(this.update)}};function O6(t,e){const n=new Set;return Cc.dependencies=n,t.style&&(t={...t,style:e.createAnimatedStyle(t.style)}),t=new _c(t),Cc.dependencies=null,[t,n]}function P6(t,e){return t&&(Ae.fun(t)?t(e):t.current=e),e}var Hp=Symbol.for("AnimatedComponent"),k6=(t,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:n=o=>new _c(o),getComponentProps:r=o=>o}={})=>{const o={applyAnimatedValues:e,createAnimatedStyle:n,getComponentProps:r},i=a=>{const s=$p(a)||"Anonymous";return Ae.str(a)?a=i[a]||(i[a]=qp(a,o)):a=a[Hp]||(a[Hp]=qp(a,o)),a.displayName=`Animated(${s})`,a};return Dr(t,(a,s)=>{Ae.arr(t)&&(s=$p(a)),i[s]=i(a)}),{animated:i}},$p=t=>Ae.str(t)?t:t&&Ae.str(t.displayName)?t.displayName:Ae.fun(t)&&t.name||null;function Wo(t,...e){return Ae.fun(t)?t(...e):t}var Ga=(t,e)=>t===!0||!!(e&&t&&(Ae.fun(t)?t(e):tr(t).includes(e))),Yp=(t,e)=>Ae.obj(t)?e&&t[e]:t,Wp=(t,e)=>t.default===!0?t[e]:t.default?t.default[e]:void 0,B6=t=>t,od=(t,e=B6)=>{let n=N6;t.default&&t.default!==!0&&(t=t.default,n=Object.keys(t));const r={};for(const o of n){const i=e(t[o],o);Ae.und(i)||(r[o]=i)}return r},N6=["config","onProps","onStart","onChange","onPause","onResume","onRest"],R6={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function D6(t){const e={};let n=0;if(Dr(t,(r,o)=>{R6[o]||(e[o]=r,n++)}),n)return e}function Kp(t){const e=D6(t);if(e){const n={to:e};return Dr(t,(r,o)=>o in e||(n[o]=r)),n}return{...t}}function qa(t){return t=Un(t),Ae.arr(t)?t.map(qa):bc(t)?Sr.createStringInterpolator({range:[0,1],output:[t,t]})(1):t}function M6(t){for(const e in t)return!0;return!1}function id(t){return Ae.fun(t)||Ae.arr(t)&&Ae.obj(t[0])}function L6(t,e){var n;(n=t.ref)==null||n.delete(t),e==null||e.delete(t)}function F6(t,e){var n;e&&t.ref!==e&&((n=t.ref)==null||n.delete(t),e.add(t),t.ref=e)}var j6={default:{tension:170,friction:26},gentle:{tension:120,friction:14},wobbly:{tension:180,friction:12},stiff:{tension:210,friction:20},slow:{tension:280,friction:60},molasses:{tension:280,friction:120}},ad={...j6.default,mass:1,damping:1,easing:d6.linear,clamp:!1},V6=class{constructor(){this.velocity=0,Object.assign(this,ad)}};function U6(t,e,n){n&&(n={...n},zp(n,e),e={...n,...e}),zp(t,e),Object.assign(t,e);for(const a in ad)t[a]==null&&(t[a]=ad[a]);let{frequency:r,damping:o}=t;const{mass:i}=t;return Ae.und(r)||(r<.01&&(r=.01),o<0&&(o=0),t.tension=Math.pow(2*Math.PI/r,2)*i,t.friction=4*Math.PI*o*i/r),t}function zp(t,e){if(!Ae.und(e.decay))t.duration=void 0;else{const n=!Ae.und(e.tension)||!Ae.und(e.friction);(n||!Ae.und(e.frequency)||!Ae.und(e.damping)||!Ae.und(e.mass))&&(t.duration=void 0,t.decay=void 0),n&&(t.frequency=void 0)}}var Xp=[],G6=class{constructor(){this.changed=!1,this.values=Xp,this.toValues=null,this.fromValues=Xp,this.config=new V6,this.immediate=!1}};function Qp(t,{key:e,props:n,defaultProps:r,state:o,actions:i}){return new Promise((a,s)=>{let c,u,d=Ga(n.cancel??(r==null?void 0:r.cancel),e);if(d)p();else{Ae.und(n.pause)||(o.paused=Ga(n.pause,e));let l=r==null?void 0:r.pause;l!==!0&&(l=o.paused||Ga(l,e)),c=Wo(n.delay||0,e),l?(o.resumeQueue.add(f),i.pause()):(i.resume(),f())}function h(){o.resumeQueue.add(f),o.timeouts.delete(u),u.cancel(),c=u.time-He.now()}function f(){c>0&&!Sr.skipAnimation?(o.delayed=!0,u=He.setTimeout(p,c),o.pauseQueue.add(h),o.timeouts.add(u)):p()}function p(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(h),o.timeouts.delete(u),t<=(o.cancelId||0)&&(d=!0);try{i.start({...n,callId:t,cancel:d},a)}catch(l){s(l)}}})}var sd=(t,e)=>e.length==1?e[0]:e.some(n=>n.cancelled)?Ri(t.get()):e.every(n=>n.noop)?Jp(t.get()):Tr(t.get(),e.every(n=>n.finished)),Jp=t=>({value:t,noop:!0,finished:!0,cancelled:!1}),Tr=(t,e,n=!1)=>({value:t,finished:e,cancelled:n}),Ri=t=>({value:t,cancelled:!0,finished:!1});function Zp(t,e,n,r){const{callId:o,parentId:i,onRest:a}=e,{asyncTo:s,promise:c}=n;return!i&&t===s&&!e.reset?c:n.promise=(async()=>{n.asyncId=o,n.asyncTo=t;const u=od(e,(m,y)=>y==="onRest"?void 0:m);let d,h;const f=new Promise((m,y)=>(d=m,h=y)),p=m=>{const y=o<=(n.cancelId||0)&&Ri(r)||o!==n.asyncId&&Tr(r,!1);if(y)throw m.result=y,h(m),m},l=(m,y)=>{const w=new e0,b=new t0;return(async()=>{if(Sr.skipAnimation)throw Ha(n),b.result=Tr(r,!1),h(b),b;p(w);const E=Ae.obj(m)?{...m}:{...y,to:m};E.parentId=o,Dr(u,(I,T)=>{Ae.und(E[T])&&(E[T]=I)});const C=await r.start(E);return p(w),n.paused&&await new Promise(I=>{n.resumeQueue.add(I)}),C})()};let g;if(Sr.skipAnimation)return Ha(n),Tr(r,!1);try{let m;Ae.arr(t)?m=(async y=>{for(const w of y)await l(w)})(t):m=Promise.resolve(t(l,r.stop.bind(r))),await Promise.all([m.then(d),f]),g=Tr(r.get(),!0,!1)}catch(m){if(m instanceof e0)g=m.result;else if(m instanceof t0)g=m.result;else throw m}finally{o==n.asyncId&&(n.asyncId=i,n.asyncTo=i?s:void 0,n.promise=i?c:void 0)}return Ae.fun(a)&&He.batchedUpdates(()=>{a(g,r,r.item)}),g})()}function Ha(t,e){Ba(t.timeouts,n=>n.cancel()),t.pauseQueue.clear(),t.resumeQueue.clear(),t.asyncId=t.asyncTo=t.promise=void 0,e&&(t.cancelId=e)}var e0=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},t0=class extends Error{constructor(){super("SkipAnimationSignal")}},cd=t=>t instanceof ud,q6=1,ud=class extends Bp{constructor(){super(...arguments),this.id=q6++,this._priority=0}get priority(){return this._priority}set priority(t){this._priority!=t&&(this._priority=t,this._onPriorityChange(t))}get(){const t=Mr(this);return t&&t.getValue()}to(...t){return Sr.to(this,t)}interpolate(...t){return w6(),Sr.to(this,t)}toJSON(){return this.get()}observerAdded(t){t==1&&this._attach()}observerRemoved(t){t==0&&this._detach()}_attach(){}_detach(){}_onChange(t,e=!1){La(this,{type:"change",parent:this,value:t,idle:e})}_onPriorityChange(t){this.idle||dc.sort(this),La(this,{type:"priority",parent:this,priority:t})}},Ko=Symbol.for("SpringPhase"),n0=1,ld=2,dd=4,fd=t=>(t[Ko]&n0)>0,So=t=>(t[Ko]&ld)>0,$a=t=>(t[Ko]&dd)>0,r0=(t,e)=>e?t[Ko]|=ld|n0:t[Ko]&=~ld,o0=(t,e)=>e?t[Ko]|=dd:t[Ko]&=~dd,H6=class extends ud{constructor(t,e){if(super(),this.animation=new G6,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Ae.und(t)||!Ae.und(e)){const n=Ae.obj(t)?{...t}:{...e,from:t};Ae.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(So(this)||this._state.asyncTo)||$a(this)}get goal(){return Un(this.animation.to)}get velocity(){const t=Mr(this);return t instanceof Va?t.lastVelocity||0:t.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return fd(this)}get isAnimating(){return So(this)}get isPaused(){return $a(this)}get isDelayed(){return this._state.delayed}advance(t){let e=!0,n=!1;const r=this.animation;let{toValues:o}=r;const{config:i}=r,a=Ec(r.to);!a&&pr(r.to)&&(o=tr(Un(r.to))),r.values.forEach((u,d)=>{if(u.done)return;const h=u.constructor==Ua?1:a?a[d].lastPosition:o[d];let f=r.immediate,p=h;if(!f){if(p=u.lastPosition,i.tension<=0){u.done=!0;return}let l=u.elapsedTime+=t;const g=r.fromValues[d],m=u.v0!=null?u.v0:u.v0=Ae.arr(i.velocity)?i.velocity[d]:i.velocity;let y;const w=i.precision||(g==h?.005:Math.min(1,Math.abs(h-g)*.001));if(Ae.und(i.duration))if(i.decay){const b=i.decay===!0?.998:i.decay,E=Math.exp(-(1-b)*l);p=g+m/(1-b)*(1-E),f=Math.abs(u.lastPosition-p)<=w,y=m*E}else{y=u.lastVelocity==null?m:u.lastVelocity;const b=i.restVelocity||w/10,E=i.clamp?0:i.bounce,C=!Ae.und(E),I=g==h?u.v0>0:g<h;let T,P=!1;const N=1,L=Math.ceil(t/N);for(let V=0;V<L&&(T=Math.abs(y)>b,!(!T&&(f=Math.abs(h-p)<=w,f)));++V){C&&(P=p==h||p>h==I,P&&(y=-y*E,p=h));const j=-i.tension*1e-6*(p-h),W=-i.friction*.001*y,q=(j+W)/i.mass;y=y+q*N,p=p+y*N}}else{let b=1;i.duration>0&&(this._memoizedDuration!==i.duration&&(this._memoizedDuration=i.duration,u.durationProgress>0&&(u.elapsedTime=i.duration*u.durationProgress,l=u.elapsedTime+=t)),b=(i.progress||0)+l/this._memoizedDuration,b=b>1?1:b<0?0:b,u.durationProgress=b),p=g+i.easing(b)*(h-g),y=(p-u.lastPosition)/t,f=b==1}u.lastVelocity=y,Number.isNaN(p)&&(console.warn("Got NaN while animating:",this),f=!0)}a&&!a[d].done&&(f=!1),f?u.done=!0:e=!1,u.setValue(p,i.round)&&(n=!0)});const s=Mr(this),c=s.getValue();if(e){const u=Un(r.to);(c!==u||n)&&!i.decay?(s.setValue(u),this._onChange(u)):n&&i.decay&&this._onChange(c),this._stop()}else n&&this._onChange(c)}set(t){return He.batchedUpdates(()=>{this._stop(),this._focus(t),this._set(t)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(So(this)){const{to:t,config:e}=this.animation;He.batchedUpdates(()=>{this._onStart(),e.decay||this._set(t,!1),this._stop()})}return this}update(t){return(this.queue||(this.queue=[])).push(t),this}start(t,e){let n;return Ae.und(t)?(n=this.queue||[],this.queue=[]):n=[Ae.obj(t)?t:{...e,to:t}],Promise.all(n.map(r=>this._update(r))).then(r=>sd(this,r))}stop(t){const{to:e}=this.animation;return this._focus(this.get()),Ha(this._state,t&&this._lastCallId),He.batchedUpdates(()=>this._stop(e,t)),this}reset(){this._update({reset:!0})}eventObserved(t){t.type=="change"?this._start():t.type=="priority"&&(this.priority=t.priority+1)}_prepareNode(t){const e=this.key||"";let{to:n,from:r}=t;n=Ae.obj(n)?n[e]:n,(n==null||id(n))&&(n=void 0),r=Ae.obj(r)?r[e]:r,r==null&&(r=void 0);const o={to:n,from:r};return fd(this)||(t.reverse&&([n,r]=[r,n]),r=Un(r),Ae.und(r)?Mr(this)||this._set(n):this._set(r)),o}_update({...t},e){const{key:n,defaultProps:r}=this;t.default&&Object.assign(r,od(t,(a,s)=>/^on/.test(s)?Yp(a,n):a)),s0(this,t,"onProps"),Ka(this,"onProps",t,this);const o=this._prepareNode(t);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return Qp(++this._lastCallId,{key:n,props:t,defaultProps:r,state:i,actions:{pause:()=>{$a(this)||(o0(this,!0),Na(i.pauseQueue),Ka(this,"onPause",Tr(this,Ya(this,this.animation.to)),this))},resume:()=>{$a(this)&&(o0(this,!1),So(this)&&this._resume(),Na(i.resumeQueue),Ka(this,"onResume",Tr(this,Ya(this,this.animation.to)),this))},start:this._merge.bind(this,o)}}).then(a=>{if(t.loop&&a.finished&&!(e&&a.noop)){const s=i0(t);if(s)return this._update(s,!0)}return a})}_merge(t,e,n){if(e.cancel)return this.stop(!0),n(Ri(this));const r=!Ae.und(t.to),o=!Ae.und(t.from);if(r||o)if(e.callId>this._lastToId)this._lastToId=e.callId;else return n(Ri(this));const{key:i,defaultProps:a,animation:s}=this,{to:c,from:u}=s;let{to:d=c,from:h=u}=t;o&&!r&&(!e.default||Ae.und(d))&&(d=h),e.reverse&&([d,h]=[h,d]);const f=!Kr(h,u);f&&(s.from=h),h=Un(h);const p=!Kr(d,c);p&&this._focus(d);const l=id(e.to),{config:g}=s,{decay:m,velocity:y}=g;(r||o)&&(g.velocity=0),e.config&&!l&&U6(g,Wo(e.config,i),e.config!==a.config?Wo(a.config,i):void 0);let w=Mr(this);if(!w||Ae.und(d))return n(Tr(this,!0));const b=Ae.und(e.reset)?o&&!e.default:!Ae.und(h)&&Ga(e.reset,i),E=b?h:this.get(),C=qa(d),I=Ae.num(C)||Ae.arr(C)||bc(C),T=!l&&(!I||Ga(a.immediate||e.immediate,i));if(p){const V=rd(d);if(V!==w.constructor)if(T)w=this._set(C);else throw Error(`Cannot animate between ${w.constructor.name} and ${V.name}, as the "to" prop suggests`)}const P=w.constructor;let N=pr(d),L=!1;if(!N){const V=b||!fd(this)&&f;(p||V)&&(L=Kr(qa(E),C),N=!L),(!Kr(s.immediate,T)&&!T||!Kr(g.decay,m)||!Kr(g.velocity,y))&&(N=!0)}if(L&&So(this)&&(s.changed&&!b?N=!0:N||this._stop(c)),!l&&((N||pr(c))&&(s.values=w.getPayload(),s.toValues=pr(d)?null:P==Ua?[1]:tr(C)),s.immediate!=T&&(s.immediate=T,!T&&!b&&this._set(c)),N)){const{onRest:V}=s;rt(Y6,W=>s0(this,e,W));const j=Tr(this,Ya(this,c));Na(this._pendingCalls,j),this._pendingCalls.add(n),s.changed&&He.batchedUpdates(()=>{var W;s.changed=!b,V==null||V(j,this),b?Wo(a.onRest,j):(W=s.onStart)==null||W.call(s,j,this)})}b&&this._set(E),l?n(Zp(e.to,e,this._state,this)):N?this._start():So(this)&&!p?this._pendingCalls.add(n):n(Jp(E))}_focus(t){const e=this.animation;t!==e.to&&(kp(this)&&this._detach(),e.to=t,kp(this)&&this._attach())}_attach(){let t=0;const{to:e}=this.animation;pr(e)&&(Ni(e,this),cd(e)&&(t=e.priority+1)),this.priority=t}_detach(){const{to:t}=this.animation;pr(t)&&Fa(t,this)}_set(t,e=!0){const n=Un(t);if(!Ae.und(n)){const r=Mr(this);if(!r||!Kr(n,r.getValue())){const o=rd(n);!r||r.constructor!=o?nd(this,o.create(n)):r.setValue(n),r&&He.batchedUpdates(()=>{this._onChange(n,e)})}}return Mr(this)}_onStart(){const t=this.animation;t.changed||(t.changed=!0,Ka(this,"onStart",Tr(this,Ya(this,t.to)),this))}_onChange(t,e){e||(this._onStart(),Wo(this.animation.onChange,t,this)),Wo(this.defaultProps.onChange,t,this),super._onChange(t,e)}_start(){const t=this.animation;Mr(this).reset(Un(t.to)),t.immediate||(t.fromValues=t.values.map(e=>e.lastPosition)),So(this)||(r0(this,!0),$a(this)||this._resume())}_resume(){Sr.skipAnimation?this.finish():dc.start(this)}_stop(t,e){if(So(this)){r0(this,!1);const n=this.animation;rt(n.values,o=>{o.done=!0}),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),La(this,{type:"idle",parent:this});const r=e?Ri(this.get()):Tr(this.get(),Ya(this,t??n.to));Na(this._pendingCalls,r),n.changed&&(n.changed=!1,Ka(this,"onRest",r,this))}}};function Ya(t,e){const n=qa(e),r=qa(t.get());return Kr(r,n)}function i0(t,e=t.loop,n=t.to){const r=Wo(e);if(r){const o=r!==!0&&Kp(r),i=(o||t).reverse,a=!o||o.reset;return Wa({...t,loop:e,default:!1,pause:void 0,to:!i||id(n)?n:void 0,from:a?t.from:void 0,reset:a,...o})}}function Wa(t){const{to:e,from:n}=t=Kp(t),r=new Set;return Ae.obj(e)&&a0(e,r),Ae.obj(n)&&a0(n,r),t.keys=r.size?Array.from(r):null,t}function $6(t){const e=Wa(t);return Ae.und(e.default)&&(e.default=od(e)),e}function a0(t,e){Dr(t,(n,r)=>n!=null&&e.add(r))}var Y6=["onStart","onRest","onChange","onPause","onResume"];function s0(t,e,n){t.animation[n]=e[n]!==Wp(e,n)?Yp(e[n],t.key):void 0}function Ka(t,e,...n){var r,o,i,a;(o=(r=t.animation)[e])==null||o.call(r,...n),(a=(i=t.defaultProps)[e])==null||a.call(i,...n)}var W6=["onStart","onChange","onRest"],K6=1,z6=class{constructor(t,e){this.id=K6++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),t&&this.start({default:!0,...t})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(t=>t.idle&&!t.isDelayed&&!t.isPaused)}get item(){return this._item}set item(t){this._item=t}get(){const t={};return this.each((e,n)=>t[n]=e.get()),t}set(t){for(const e in t){const n=t[e];Ae.und(n)||this.springs[e].set(n)}}update(t){return t&&this.queue.push(Wa(t)),this}start(t){let{queue:e}=this;return t?e=tr(t).map(Wa):this.queue=[],this._flush?this._flush(this,e):(h0(this,e),hd(this,e))}stop(t,e){if(t!==!!t&&(e=t),e){const n=this.springs;rt(tr(e),r=>n[r].stop(!!t))}else Ha(this._state,this._lastAsyncId),this.each(n=>n.stop(!!t));return this}pause(t){if(Ae.und(t))this.start({pause:!0});else{const e=this.springs;rt(tr(t),n=>e[n].pause())}return this}resume(t){if(Ae.und(t))this.start({pause:!1});else{const e=this.springs;rt(tr(t),n=>e[n].resume())}return this}each(t){Dr(this.springs,t)}_onFrame(){const{onStart:t,onChange:e,onRest:n}=this._events,r=this._active.size>0,o=this._changed.size>0;(r&&!this._started||o&&!this._started)&&(this._started=!0,Ba(t,([s,c])=>{c.value=this.get(),s(c,this,this._item)}));const i=!r&&this._started,a=o||i&&n.size?this.get():null;o&&e.size&&Ba(e,([s,c])=>{c.value=a,s(c,this,this._item)}),i&&(this._started=!1,Ba(n,([s,c])=>{c.value=a,s(c,this,this._item)}))}eventObserved(t){if(t.type=="change")this._changed.add(t.parent),t.idle||this._active.add(t.parent);else if(t.type=="idle")this._active.delete(t.parent);else return;He.onFrame(this._onFrame)}};function hd(t,e){return Promise.all(e.map(n=>c0(t,n))).then(n=>sd(t,n))}async function c0(t,e,n){const{keys:r,to:o,from:i,loop:a,onRest:s,onResolve:c}=e,u=Ae.obj(e.default)&&e.default;a&&(e.loop=!1),o===!1&&(e.to=null),i===!1&&(e.from=null);const d=Ae.arr(o)||Ae.fun(o)?o:void 0;d?(e.to=void 0,e.onRest=void 0,u&&(u.onRest=void 0)):rt(W6,g=>{const m=e[g];if(Ae.fun(m)){const y=t._events[g];e[g]=({finished:w,cancelled:b})=>{const E=y.get(m);E?(w||(E.finished=!1),b&&(E.cancelled=!0)):y.set(m,{value:null,finished:w||!1,cancelled:b||!1})},u&&(u[g]=e[g])}});const h=t._state;e.pause===!h.paused?(h.paused=e.pause,Na(e.pause?h.pauseQueue:h.resumeQueue)):h.paused&&(e.pause=!0);const f=(r||Object.keys(t.springs)).map(g=>t.springs[g].start(e)),p=e.cancel===!0||Wp(e,"cancel")===!0;(d||p&&h.asyncId)&&f.push(Qp(++t._lastAsyncId,{props:e,state:h,actions:{pause:Yl,resume:Yl,start(g,m){p?(Ha(h,t._lastAsyncId),m(Ri(t))):(g.onRest=s,m(Zp(d,g,h,t)))}}})),h.paused&&await new Promise(g=>{h.resumeQueue.add(g)});const l=sd(t,await Promise.all(f));if(a&&l.finished&&!(n&&l.noop)){const g=i0(e,a,o);if(g)return h0(t,[g]),c0(t,g,!0)}return c&&He.batchedUpdates(()=>c(l,t,t.item)),l}function u0(t,e){const n={...t.springs};return e&&rt(tr(e),r=>{Ae.und(r.keys)&&(r=Wa(r)),Ae.obj(r.to)||(r={...r,to:void 0}),f0(n,r,o=>d0(o))}),l0(t,n),n}function l0(t,e){Dr(e,(n,r)=>{t.springs[r]||(t.springs[r]=n,Ni(n,t))})}function d0(t,e){const n=new H6;return n.key=t,e&&Ni(n,e),n}function f0(t,e,n){e.keys&&rt(e.keys,r=>{(t[r]||(t[r]=n(r)))._prepareNode(e)})}function h0(t,e){rt(e,n=>{f0(t.springs,n,r=>d0(r,t))})}var Ac=({children:t,...e})=>{const n=x.useContext(Sc),r=e.pause||!!n.pause,o=e.immediate||!!n.immediate;e=_6(()=>({pause:r,immediate:o}),[r,o]);const{Provider:i}=Sc;return ce.createElement(i,{value:e},t)},Sc=X6(Ac,{});Ac.Provider=Sc.Provider,Ac.Consumer=Sc.Consumer;function X6(t,e){return Object.assign(t,ce.createContext(e)),t.Provider._context=t,t.Consumer._context=t,t}var Q6=()=>{const t=[],e=function(r){E6();const o=[];return rt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=n(r,i,a);s&&o.push(i.start(s))}}),o};e.current=t,e.add=function(r){t.includes(r)||t.push(r)},e.delete=function(r){const o=t.indexOf(r);~o&&t.splice(o,1)},e.pause=function(){return rt(t,r=>r.pause(...arguments)),this},e.resume=function(){return rt(t,r=>r.resume(...arguments)),this},e.set=function(r){rt(t,(o,i)=>{const a=Ae.fun(r)?r(i,o):r;a&&o.set(a)})},e.start=function(r){const o=[];return rt(t,(i,a)=>{if(Ae.und(r))o.push(i.start());else{const s=this._getProps(r,i,a);s&&o.push(i.start(s))}}),o},e.stop=function(){return rt(t,r=>r.stop(...arguments)),this},e.update=function(r){return rt(t,(o,i)=>o.update(this._getProps(r,o,i))),this};const n=function(r,o,i){return Ae.fun(r)?r(i,o):r};return e._getProps=n,e};function J6(t,e,n){const r=Ae.fun(e)&&e;r&&!n&&(n=[]);const o=x.useMemo(()=>r||arguments.length==3?Q6():void 0,[]),i=x.useRef(0),a=Fp(),s=x.useMemo(()=>({ctrls:[],queue:[],flush(y,w){const b=u0(y,w);return i.current>0&&!s.queue.length&&!Object.keys(b).some(C=>!y.springs[C])?hd(y,w):new Promise(C=>{l0(y,b),s.queue.push(()=>{C(hd(y,w))}),a()})}}),[]),c=x.useRef([...s.ctrls]),u=[],d=Vp(t)||0;x.useMemo(()=>{rt(c.current.slice(t,d),y=>{L6(y,o),y.stop(!0)}),c.current.length=t,h(d,t)},[t]),x.useMemo(()=>{h(0,Math.min(d,t))},n);function h(y,w){for(let b=y;b<w;b++){const E=c.current[b]||(c.current[b]=new z6(null,s.flush)),C=r?r(b,E):e[b];C&&(u[b]=$6(C))}}const f=c.current.map((y,w)=>u0(y,u[w])),p=x.useContext(Ac),l=Vp(p),g=p!==l&&M6(p);td(()=>{i.current++,s.ctrls=c.current;const{queue:y}=s;y.length&&(s.queue=[],rt(y,w=>w())),rt(c.current,(w,b)=>{o==null||o.add(w),g&&w.start({default:p});const E=u[b];E&&(F6(w,E.ref),w.ref?w.queue.push(E):w.start(E))})}),jp(()=>()=>{rt(s.ctrls,y=>y.stop(!0))});const m=f.map(y=>({...y}));return o?[m,o]:m}function Z6(t,e){const n=Ae.fun(t),[[r],o]=J6(1,n?t:[t],n?[]:e);return n||arguments.length==2?[r,o]:r}var eE=class extends ud{constructor(t,e){super(),this.source=t,this.idle=!0,this._active=new Set,this.calc=Da(...e);const n=this._get(),r=rd(n);nd(this,r.create(n))}advance(t){const e=this._get(),n=this.get();Kr(e,n)||(Mr(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&p0(this._active)&&pd(this)}_get(){const t=Ae.arr(this.source)?this.source.map(Un):tr(Un(this.source));return this.calc(...t)}_start(){this.idle&&!p0(this._active)&&(this.idle=!1,rt(Ec(this),t=>{t.done=!1}),Sr.skipAnimation?(He.batchedUpdates(()=>this.advance()),pd(this)):dc.start(this))}_attach(){let t=1;rt(tr(this.source),e=>{pr(e)&&Ni(e,this),cd(e)&&(e.idle||this._active.add(e),t=Math.max(t,e.priority+1))}),this.priority=t,this._start()}_detach(){rt(tr(this.source),t=>{pr(t)&&Fa(t,this)}),this._active.clear(),pd(this)}eventObserved(t){t.type=="change"?t.idle?this.advance():(this._active.add(t.parent),this._start()):t.type=="idle"?this._active.delete(t.parent):t.type=="priority"&&(this.priority=tr(this.source).reduce((e,n)=>Math.max(e,(cd(n)?n.priority:0)+1),0))}};function tE(t){return t.idle!==!1}function p0(t){return!t.size||Array.from(t).every(tE)}function pd(t){t.idle||(t.idle=!0,rt(Ec(t),e=>{e.done=!0}),La(t,{type:"idle",parent:t}))}Sr.assign({createStringInterpolator:Mp,to:(t,e)=>new eE(t,e)});var g0=/^--/;function nE(t,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!g0.test(t)&&!(za.hasOwnProperty(t)&&za[t])?e+"px":(""+e).trim()}var m0={};function rE(t,e){if(!t.nodeType||!t.setAttribute)return!1;const n=t.nodeName==="filter"||t.parentNode&&t.parentNode.nodeName==="filter",{style:r,children:o,scrollTop:i,scrollLeft:a,viewBox:s,...c}=e,u=Object.values(c),d=Object.keys(c).map(h=>n||t.hasAttribute(h)?h:m0[h]||(m0[h]=h.replace(/([A-Z])/g,f=>"-"+f.toLowerCase())));o!==void 0&&(t.textContent=o);for(const h in r)if(r.hasOwnProperty(h)){const f=nE(h,r[h]);g0.test(h)?t.style.setProperty(h,f):t.style[h]=f}d.forEach((h,f)=>{t.setAttribute(h,u[f])}),i!==void 0&&(t.scrollTop=i),a!==void 0&&(t.scrollLeft=a),s!==void 0&&t.setAttribute("viewBox",s)}var za={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oE=(t,e)=>t+e.charAt(0).toUpperCase()+e.substring(1),iE=["Webkit","Ms","Moz","O"];za=Object.keys(za).reduce((t,e)=>(iE.forEach(n=>t[oE(n,e)]=t[e]),t),za);var aE=/^(matrix|translate|scale|rotate|skew)/,sE=/^(translate)/,cE=/^(rotate|skew)/,gd=(t,e)=>Ae.num(t)&&t!==0?t+e:t,Ic=(t,e)=>Ae.arr(t)?t.every(n=>Ic(n,e)):Ae.num(t)?t===e:parseFloat(t)===e,uE=class extends _c{constructor({x:t,y:e,z:n,...r}){const o=[],i=[];(t||e||n)&&(o.push([t||0,e||0,n||0]),i.push(a=>[`translate3d(${a.map(s=>gd(s,"px")).join(",")})`,Ic(a,0)])),Dr(r,(a,s)=>{if(s==="transform")o.push([a||""]),i.push(c=>[c,c===""]);else if(aE.test(s)){if(delete r[s],Ae.und(a))return;const c=sE.test(s)?"px":cE.test(s)?"deg":"";o.push(tr(a)),i.push(s==="rotate3d"?([u,d,h,f])=>[`rotate3d(${u},${d},${h},${gd(f,c)})`,Ic(f,0)]:u=>[`${s}(${u.map(d=>gd(d,c)).join(",")})`,Ic(u,s.startsWith("scale")?1:0)])}}),o.length&&(r.transform=new lE(o,i)),super(r)}},lE=class extends Bp{constructor(t,e){super(),this.inputs=t,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let t="",e=!0;return rt(this.inputs,(n,r)=>{const o=Un(n[0]),[i,a]=this.transforms[r](Ae.arr(o)?o:n.map(Un));t+=" "+i,e=e&&a}),e?"none":t}observerAdded(t){t==1&&rt(this.inputs,e=>rt(e,n=>pr(n)&&Ni(n,this)))}observerRemoved(t){t==0&&rt(this.inputs,e=>rt(e,n=>pr(n)&&Fa(n,this)))}eventObserved(t){t.type=="change"&&(this._value=null),La(this,t)}},dE=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Sr.assign({batchedUpdates:vi.unstable_batchedUpdates,createStringInterpolator:Mp,colors:Jb});var fE=k6(dE,{applyAnimatedValues:rE,createAnimatedStyle:t=>new uE(t),getComponentProps:({scrollTop:t,scrollLeft:e,...n})=>n}),hE=fE.animated;function Tc(t){const{rows:e}=t,n=Z6({from:{opacity:0},to:{opacity:1}});return v.jsxs(hE.div,{style:n,className:"flex w-full animate-pulse flex-col items-start space-y-3",children:[[...Array(e)].map((r,o)=>v.jsx("div",{className:"h-10 w-full rounded-lg bg-gray-100 p-5"},`skeleton_rows_${o}`)),v.jsx("span",{className:"sr-only",children:"Loading..."})]})}function y0({children:t,offset:e,max:n=4,initialCollapsed:r=!0}){const o=x.useRef(null),[i,a]=x.useState(0),[s,c]=x.useState(r),u=s&&x.Children.count(t)>n?n:x.Children.count(t);x.useEffect(()=>{o.current&&(i?s?o.current.style.marginBottom=`-${i-(i/u+(u-1)*(e??i/u/7.5))}px`:o.current.style.marginBottom="unset":a(o.current.offsetHeight))},[s,i]);const d=f=>(100-(u-1-f))/100,h=f=>f*(i/u-(e??i/u/7.5));return v.jsx("div",{ref:o,className:"hover:cursor-pointer",onClick:()=>u>1&&c(!s),children:x.Children.map(x.Children.toArray(t).slice(-1*u),(f,p)=>v.jsx("div",{className:`${!s&&"[&:not(:last-child)]:mb-1"} h-full w-full transition-all duration-300 ease-in-out`,style:{transform:s&&u>1?`scaleX(${d(p)}) translateY(-${h(p)}px)`:void 0},children:f}))})}const pE=Oi("flex flex-shrink bg-white rounded-full transform transition-transform ease-out",{variants:{size:{md:"w-3 h-3",lg:"w-7 h-7"}}}),gE=Oi("",{variants:{size:{md:"pr-4",lg:"pr-6"}}}),mE=({id:t,disabled:e,onChange:n,defaultChecked:r=!1,size:o="md"})=>{const i=e,[a,s]=x.useState(r),[c,u]=x.useState(!1),d=()=>{i||(s(!a),n&&n())},h=()=>{e||u(!0)},f=()=>{u(!1)},p=In("relative py-0.5 pl-0.5 rounded-full",{"ring-2 ring-core-white-900 outline-core-primary-500 outline outline-2 outline-offset-2":c,"bg-core-primary-500 hover:bg-core-primary-600":a&&!e,"bg-core-gray-200 hover:bg-core-gray-300":!a&&!e,"bg-core-gray-100":e},gE({size:o})),l=o==="lg"?"translate-x-[1.375rem] ease-out":"translate-x-3.5 ease-out";return v.jsxs("div",{className:`inline-flex items-center py-1 ${i?"pointer-events-none":"cursor-pointer "}`,onClick:d,onFocus:h,children:[v.jsx("input",{className:"sr-only ",id:t,type:"checkbox",checked:a,disabled:i,onBlur:f,onChange:d,onFocus:h}),v.jsx("div",{className:p,children:v.jsx("div",{className:In(pE({size:o}),`${a?l:""} ${i?"shadow-none":"shadow-xs"}`)})})]})},md=({id:t,children:e,size:n="md",description:r,toggleLeft:o=!0,disabled:i,helperText:a,defaultChecked:s=!1,label:c,required:u=!1,tooltip:d,onChange:h})=>{const f=x.useId(),p=t??f;return v.jsxs("div",{className:`flex ${o?"flex-row":"flex-row-reverse"} items-start gap-3`,children:[v.jsx(mE,{disabled:i,defaultChecked:s,id:p,size:n,onChange:h}),e||(c||r||d||a)&&v.jsxs("div",{className:"inline-flex w-full flex-col self-center",children:[v.jsx(kn,{className:In("font-normal"),description:r,required:u,tooltip:d,htmlFor:p,disabled:i,children:c}),v.jsx(kn.Helper,{disabled:i,helperText:a})]})]})};md.displayName="Switch";const v0=x.createContext(null);function yE(t=!1){const e=x.useContext(v0);if(!e&&!t)throw new Error("Switch.Item must be used within a SwitchGroup or SwitchGroup.Root");return e}const w0=x.forwardRef(({toggleLeft:t=!1,size:e="md",children:n,description:r,disabled:o,helperText:i,id:a,label:s,required:c,tooltip:u},d)=>{const h=x.useId(),f=a??h,p=s??r??u??i?v.jsxs("div",{className:"inline-flex flex-col",children:[v.jsx(kn,{className:"cursor-default",description:r,required:c,tooltip:u,htmlFor:f,disabled:o,children:s}),v.jsx(kn.Helper,{disabled:o,helperText:i})]}):null;return v.jsx(v0.Provider,{value:{disabled:o,toggleLeft:t,size:e},children:v.jsxs("div",{ref:d,"aria-describedby":i?`${f}__describer`:void 0,"aria-labelledby":s?`${f}__label`:void 0,className:"flex flex-col gap-4",role:"group",children:[s??i??r??u?v.jsx("div",{className:"flex flex-col",children:p}):null,n?v.jsx("div",{className:In("flex flex-col gap-2"),children:n}):null]})})});w0.displayName="SwitchGroup",Object.assign(w0,{Item:({disabled:t,label:e,defaultChecked:n})=>{const r=yE(),{disabled:o,size:i,toggleLeft:a}=r??{};return v.jsx(md,{toggleLeft:a,disabled:t??o,label:e,defaultChecked:n,size:i})}});const vE=({children:t})=>v.jsx("div",{className:"fixed bottom-0 z-10 flex h-[70px] w-full border-b-0 border-t border-gray-100 bg-white lg:bottom-auto lg:top-0 lg:h-[50px] lg:border-b lg:border-t-0",children:t}),wE=({id:t,label:e,icon:n,pathname:r,activeTab:o,setActiveTab:i})=>v.jsx(X1,{className:"flex flex-grow items-center",to:r??"",children:v.jsxs("button",{className:`flex h-full flex-grow flex-col items-center justify-center gap-1 border-b-0 border-t-2 px-3 py-3 text-xs focus:outline-none lg:flex-row lg:border-b-2 lg:border-t-0 lg:text-sm ${o===t?"border-core-primary-500 text-core-primary-500":"border-transparent text-core-gray-500 hover:text-core-gray-800"}`,onClick:()=>i(t),children:[v.jsx(wn,{icon:n,className:"mr-2",variant:o===t?"discovery":"secondary"}),e]})}),b0=Object.prototype.toString;function yd(t){switch(b0.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Xr(t,Error)}}function Di(t,e){return b0.call(t)===`[object ${e}]`}function E0(t){return Di(t,"ErrorEvent")}function C0(t){return Di(t,"DOMError")}function bE(t){return Di(t,"DOMException")}function zr(t){return Di(t,"String")}function vd(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function wd(t){return t===null||vd(t)||typeof t!="object"&&typeof t!="function"}function Mi(t){return Di(t,"Object")}function xc(t){return typeof Event<"u"&&Xr(t,Event)}function EE(t){return typeof Element<"u"&&Xr(t,Element)}function CE(t){return Di(t,"RegExp")}function Oc(t){return!!(t&&t.then&&typeof t.then=="function")}function _E(t){return Mi(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Xr(t,e){try{return t instanceof e}catch{return!1}}function _0(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Li(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function A0(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const o=t[r];try{_0(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function AE(t,e,n=!1){return zr(t)?CE(e)?e.test(t):zr(e)?n?t===e:t.includes(e):!1:!1}function zo(t,e=[],n=!1){return e.some(r=>AE(t,r,n))}function SE(t,e,n=250,r,o,i,a){if(!i.exception||!i.exception.values||!a||!Xr(a.originalException,Error))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=IE(bd(t,e,o,a.originalException,r,i.exception.values,s,0),n))}function bd(t,e,n,r,o,i,a,s){if(i.length>=n+1)return i;let c=[...i];if(Xr(r[o],Error)){S0(a,s);const u=t(e,r[o]),d=c.length;I0(u,o,d,s),c=bd(t,e,n,r[o],o,[u,...c],u,d)}return Array.isArray(r.errors)&&r.errors.forEach((u,d)=>{if(Xr(u,Error)){S0(a,s);const h=t(e,u),f=c.length;I0(h,`errors[${d}]`,f,s),c=bd(t,e,n,u,o,[h,...c],h,f)}}),c}function S0(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function I0(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function IE(t,e){return t.map(n=>(n.value&&(n.value=Li(n.value,e)),n))}function T0(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const Xo="8.34.0",gt=globalThis;function Pc(t,e,n){const r=gt,o=r.__SENTRY__=r.__SENTRY__||{},i=o[Xo]=o[Xo]||{};return i[t]||(i[t]=e())}const Fi=gt,TE=80;function Qo(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,o=[];let i=0,a=0;const s=" > ",c=s.length;let u;const d=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||TE;for(;n&&i++<r&&(u=xE(n,d),!(u==="html"||i>1&&a+o.length*c+u.length>=h));)o.push(u),a+=u.length,n=n.parentNode;return o.reverse().join(s)}catch{return"<unknown>"}}function xE(t,e){const n=t,r=[];if(!n||!n.tagName)return"";if(Fi.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const o=e&&e.length?e.filter(a=>n.getAttribute(a)).map(a=>[a,n.getAttribute(a)]):null;if(o&&o.length)o.forEach(a=>{r.push(`[${a[0]}="${a[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const a=n.className;if(a&&zr(a)){const s=a.split(/\s+/);for(const c of s)r.push(`.${c}`)}}const i=["aria-label","type","name","title","alt"];for(const a of i){const s=n.getAttribute(a);s&&r.push(`[${a}="${s}"]`)}return r.join("")}function OE(){try{return Fi.document.location.href}catch{return""}}function PE(t){return Fi.document&&Fi.document.querySelector?Fi.document.querySelector(t):null}function x0(t){if(!Fi.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}const ji=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,kE="Sentry Logger ",Ed=["debug","info","warn","error","log","assert","trace"],kc={};function Cd(t){if(!("console"in gt))return t();const e=gt.console,n={},r=Object.keys(kc);r.forEach(o=>{const i=kc[o];n[o]=e[o],e[o]=i});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function BE(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return ji?Ed.forEach(n=>{e[n]=(...r)=>{t&&Cd(()=>{gt.console[n](`${kE}[${n}]:`,...r)})}}):Ed.forEach(n=>{e[n]=()=>{}}),e}const Ie=Pc("logger",BE),NE=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function RE(t){return t==="http"||t==="https"}function Xa(t,e=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:c}=t;return`${s}://${c}${e&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${a}`}function DE(t){const e=NE.exec(t);if(!e){Cd(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,o="",i="",a="",s=""]=e.slice(1);let c="",u=s;const d=u.split("/");if(d.length>1&&(c=d.slice(0,-1).join("/"),u=d.pop()),u){const h=u.match(/^\d+/);h&&(u=h[0])}return O0({host:i,pass:o,path:c,projectId:u,port:a,protocol:n,publicKey:r})}function O0(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function ME(t){if(!ji)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(a=>t[a]?!1:(Ie.error(`Invalid Sentry Dsn: ${a} missing`),!0))?!1:n.match(/^\d+$/)?RE(r)?e&&isNaN(parseInt(e,10))?(Ie.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(Ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(Ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function LE(t){const e=typeof t=="string"?DE(t):O0(t);if(!(!e||!ME(e)))return e}class Lr extends Error{constructor(e,n="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function nr(t,e,n){if(!(e in t))return;const r=t[e],o=n(r);typeof o=="function"&&P0(o,r),t[e]=o}function gr(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{ji&&Ie.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function P0(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,gr(t,"__sentry_original__",e)}catch{}}function _d(t){return t.__sentry_original__}function FE(t){return Object.keys(t).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`).join("&")}function k0(t){if(yd(t))return{message:t.message,name:t.name,stack:t.stack,...N0(t)};if(xc(t)){const e={type:t.type,target:B0(t.target),currentTarget:B0(t.currentTarget),...N0(t)};return typeof CustomEvent<"u"&&Xr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function B0(t){try{return EE(t)?Qo(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function N0(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function jE(t,e=40){const n=Object.keys(k0(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Li(r,e);for(let o=n.length;o>0;o--){const i=n.slice(0,o).join(", ");if(!(i.length>e))return o===n.length?i:Li(i,e)}return""}function xn(t){return Ad(t,new Map)}function Ad(t,e){if(VE(t)){const n=e.get(t);if(n!==void 0)return n;const r={};e.set(t,r);for(const o of Object.getOwnPropertyNames(t))typeof t[o]<"u"&&(r[o]=Ad(t[o],e));return r}if(Array.isArray(t)){const n=e.get(t);if(n!==void 0)return n;const r=[];return e.set(t,r),t.forEach(o=>{r.push(Ad(o,e))}),r}return t}function VE(t){if(!Mi(t))return!1;try{const e=Object.getPrototypeOf(t).constructor.name;return!e||e==="Object"}catch{return!0}}const R0=50,Jo="?",D0=/\(error: (.*)\)/,M0=/captureMessage|captureException/;function UE(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{const i=[],a=n.split(`
102
102
  `);for(let s=r;s<a.length;s++){const c=a[s];if(c.length>1024)continue;const u=D0.test(c)?c.replace(D0,"$1"):c;if(!u.match(/\S*Error: /)){for(const d of e){const h=d(u);if(h){i.push(h);break}}if(i.length>=R0+o)break}}return GE(i.slice(o))}}function GE(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(Bc(e).function||"")&&e.pop(),e.reverse(),M0.test(Bc(e).function||"")&&(e.pop(),M0.test(Bc(e).function||"")&&e.pop()),e.slice(0,R0).map(n=>({...n,filename:n.filename||Bc(e).filename,function:n.function||Jo}))}function Bc(t){return t[t.length-1]||{}}const Sd="<anonymous>";function Qr(t){try{return!t||typeof t!="function"?Sd:t.name||Sd}catch{return Sd}}function L0(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const Nc={},F0={};function Io(t,e){Nc[t]=Nc[t]||[],Nc[t].push(e)}function To(t,e){F0[t]||(e(),F0[t]=!0)}function mr(t,e){const n=t&&Nc[t];if(n)for(const r of n)try{r(e)}catch(o){ji&&Ie.error(`Error while triggering instrumentation handler.
103
103
  Type: ${t}
104
104
  Name: ${Qr(r)}
@@ -115,10 +115,10 @@ Event: ${xo(t)}`),!0):XC(t,e.denyUrls)?(Ke&&Ie.warn(`Event dropped due to being
115
115
  Event: ${xo(t)}.
116
116
  Url: ${$c(t)}`),!0):QC(t,e.allowUrls)?!1:(Ke&&Ie.warn(`Event dropped due to not being matched by \`allowUrls\` option.
117
117
  Event: ${xo(t)}.
118
- Url: ${$c(t)}`),!0)}function KC(t,e){return t.type||!e||!e.length?!1:JC(t).some(n=>zo(n,e))}function zC(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?zo(n,e):!1}function XC(t,e){if(!e||!e.length)return!1;const n=$c(t);return n?zo(n,e):!1}function QC(t,e){if(!e||!e.length)return!0;const n=$c(t);return n?zo(n,e):!0}function JC(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function ZC(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function e5(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function $c(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?e5(e):null}catch{return Ke&&Ie.error(`Cannot extract url for event ${xo(t)}`),null}}function t5(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}const n5="Dedupe",r5=()=>{let t;return{name:n5,processEvent(e){if(e.type)return e;try{if(o5(e,t))return Ke&&Ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function o5(t,e){return e?!!(i5(t,e)||a5(t,e)):!1}function i5(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Gg(t,e)||!Ug(t,e))}function a5(t,e){const n=qg(e),r=qg(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Gg(t,e)||!Ug(t,e))}function Ug(t,e){let n=L0(t),r=L0(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Gg(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function qg(t){return t.exception&&t.exception.values&&t.exception.values[0]}function s5(t,e,n,r,o="auto.http.browser"){if(!t.fetchData)return;const i=to()&&e(t.fetchData.url);if(t.endTimestamp&&i){const l=t.fetchData.__span;if(!l)return;const g=r[l];g&&(l5(g,t),delete r[l]);return}const a=on(),s=Tt(),{method:c,url:u}=t.fetchData,d=u5(u),h=d?ei(d).host:void 0,f=!!Bn(),p=i&&f?Bo({name:`${c} ${u}`,attributes:{url:u,type:"fetch","http.method":c,"http.url":d,"server.address":h,[an]:o,[ko]:"http.client"}}):new Hi;if(t.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(t.fetchData.url)&&s){const l=t.args[0];t.args[1]=t.args[1]||{};const g=t.args[1];g.headers=c5(l,s,a,g,to()&&f?p:void 0)}return p}function c5(t,e,n,r,o){const i=qi(),{traceId:a,spanId:s,sampled:c,dsc:u}={...i.getPropagationContext(),...n.getPropagationContext()},d=o?sg(o):Bd(a,s,c),h=X0(u||(o?oi(o):qc(a,e))),f=r.headers||(typeof Request<"u"&&Xr(t,Request)?t.headers:void 0);if(f)if(typeof Headers<"u"&&Xr(f,Headers)){const p=new Headers(f);return p.append("sentry-trace",d),h&&p.append(kd,h),p}else if(Array.isArray(f)){const p=[...f,["sentry-trace",d]];return h&&p.push([kd,h]),p}else{const p="baggage"in f?f.baggage:void 0,l=[];return Array.isArray(p)?l.push(...p):p&&l.push(p),h&&l.push(h),{...f,"sentry-trace":d,baggage:l.length>0?l.join(","):void 0}}else return{"sentry-trace":d,baggage:h}}function u5(t){try{return new URL(t).href}catch{return}}function l5(t,e){if(e.response){og(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:hn,message:"internal_error"});t.end()}const et=gt;let Yd=0;function Hg(){return Yd>0}function d5(){Yd++,setTimeout(()=>{Yd--})}function $i(t,e={},n){if(typeof t!="function")return t;try{const o=t.__sentry_wrapped__;if(o)return typeof o=="function"?o:t;if(_d(t))return t}catch{return t}const r=function(){const o=Array.prototype.slice.call(arguments);try{const i=o.map(a=>$i(a,e));return t.apply(this,i)}catch(i){throw d5(),Fd(a=>{a.addEventProcessor(s=>(e.mechanism&&(Od(s,void 0),Ja(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Pg(i)}),i}};try{for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}P0(r,t),gr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const no=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Wd(t,e){const n=zd(t,e),r={type:m5(e),value:y5(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function f5(t,e,n,r){const o=Tt(),i=o&&o.getOptions().normalizeDepth,a=C5(e),s={__serialized__:W0(e,i)};if(a)return{exception:{values:[Wd(t,a)]},extra:s};const c={exception:{values:[{type:xc(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:b5(e,{isUnhandledRejection:r})}]},extra:s};if(n){const u=zd(t,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function Kd(t,e){return{exception:{values:[Wd(t,e)]}}}function zd(t,e){const n=e.stacktrace||e.stack||"",r=p5(e),o=g5(e);try{return t(n,r,o)}catch{}return[]}const h5=/Minified React error #\d+;/i;function p5(t){return t&&h5.test(t.message)?1:0}function g5(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function $g(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function m5(t){const e=t&&t.name;return!e&&$g(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function y5(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:$g(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function v5(t,e,n,r){const o=n&&n.syntheticException||void 0,i=Xd(t,e,o,r);return Ja(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Zo(i)}function w5(t,e,n="info",r,o){const i=r&&r.syntheticException||void 0,a=Qd(t,e,i,o);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Zo(a)}function Xd(t,e,n,r,o){let i;if(E0(e)&&e.error)return Kd(t,e.error);if(C0(e)||bE(e)){const a=e;if("stack"in e)i=Kd(t,e);else{const s=a.name||(C0(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=Qd(t,c,n,r),Od(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return yd(e)?Kd(t,e):Mi(e)||xc(e)?(i=f5(t,e,n,o),Ja(i,{synthetic:!0}),i):(i=Qd(t,e,n,r),Od(i,`${e}`),Ja(i,{synthetic:!0}),i)}function Qd(t,e,n,r){const o={};if(r&&n){const i=zd(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}if(vd(e)){const{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function b5(t,{isUnhandledRejection:e}){const n=jE(t),r=e?"promise rejection":"exception";return E0(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xc(t)?`Event \`${E5(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function E5(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function C5(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}function _5(t,{metadata:e,tunnel:n,dsn:r}){const o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Xa(r)}},i=A5(t);return Vi(o,[i])}function A5(t){return[{type:"user_report"},t]}class S5 extends RC{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e},r=et.SENTRY_SDK_SOURCE||e8();jC(n,"browser",["browser"],r),super(n),n.sendClientReports&&et.document&&et.document.addEventListener("visibilitychange",()=>{et.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return v5(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return w5(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){no&&Ie.warn("SDK not enabled, will not capture user feedback.");return}const n=_5(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}}const rr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,I5=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",Yi=(t,e,n,r)=>{let o,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(o||0),(i||o===void 0)&&(o=e.value,e.delta=i,e.rating=I5(e.value,n),t(e)))}},Fe=gt,T5=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ns=()=>Fe.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],rs=()=>{const t=ns();return t&&t.activationStart||0},Wi=(t,e)=>{const n=ns();let r="navigate";return n&&(Fe.document&&Fe.document.prerendering||rs()>0?r="prerender":Fe.document&&Fe.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:T5(),navigationType:r}},ai=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},os=t=>{const e=n=>{(n.type==="pagehide"||Fe.document&&Fe.document.visibilityState==="hidden")&&t(n)};Fe.document&&(addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0))},Jd=t=>{let e=!1;return n=>{e||(t(n),e=!0)}};let is=-1;const x5=()=>{is=Fe.document.visibilityState==="hidden"&&!Fe.document.prerendering?0:1/0},Yc=t=>{Fe.document.visibilityState==="hidden"&&is>-1&&(is=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("visibilitychange",Yc,!0),removeEventListener("prerenderingchange",Yc,!0))},O5=()=>{addEventListener("visibilitychange",Yc,!0),addEventListener("prerenderingchange",Yc,!0)},Wc=()=>(Fe.document&&is<0&&(x5(),O5()),{get firstHiddenTime(){return is}}),as=t=>{Fe.document&&Fe.document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},P5=[1800,3e3],k5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FCP");let o;const a=ai("paint",s=>{s.forEach(c=>{c.name==="first-contentful-paint"&&(a.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries.push(c),o(!0)))})});a&&(o=Yi(t,r,P5,e.reportAllChanges))})},B5=[.1,.25],N5=(t,e={})=>{k5(Jd(()=>{const n=Wi("CLS",0);let r,o=0,i=[];const a=c=>{c.forEach(u=>{if(!u.hadRecentInput){const d=i[0],h=i[i.length-1];o&&d&&h&&u.startTime-h.startTime<1e3&&u.startTime-d.startTime<5e3?(o+=u.value,i.push(u)):(o=u.value,i=[u])}}),o>n.value&&(n.value=o,n.entries=i,r())},s=ai("layout-shift",a);s&&(r=Yi(t,n,B5,e.reportAllChanges),os(()=>{a(s.takeRecords()),r(!0)}),setTimeout(r,0))}))},R5=[100,300],D5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FID");let o;const i=c=>{c.startTime<n.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),o(!0))},a=c=>{c.forEach(i)},s=ai("first-input",a);o=Yi(t,r,R5,e.reportAllChanges),s&&os(Jd(()=>{a(s.takeRecords()),s.disconnect()}))})};let Yg=0,Zd=1/0,Kc=0;const M5=t=>{t.forEach(e=>{e.interactionId&&(Zd=Math.min(Zd,e.interactionId),Kc=Math.max(Kc,e.interactionId),Yg=Kc?(Kc-Zd)/7+1:0)})};let ef;const L5=()=>ef?Yg:performance.interactionCount||0,F5=()=>{"interactionCount"in performance||ef||(ef=ai("event",M5,{type:"event",buffered:!0,durationThreshold:0}))},j5=[200,500],V5=0,Wg=()=>L5()-V5,Kg=10,ro=[],tf={},zg=t=>{const e=ro[ro.length-1],n=tf[t.interactionId];if(n||ro.length<Kg||e&&t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};tf[r.id]=r,ro.push(r)}ro.sort((r,o)=>o.latency-r.latency),ro.splice(Kg).forEach(r=>{delete tf[r.id]})}},U5=()=>{const t=Math.min(ro.length-1,Math.floor(Wg()/50));return ro[t]},G5=(t,e={})=>{as(()=>{F5();const n=Wi("INP");let r;const o=a=>{a.forEach(c=>{c.interactionId&&zg(c),c.entryType==="first-input"&&!ro.some(d=>d.entries.some(h=>c.duration===h.duration&&c.startTime===h.startTime))&&zg(c)});const s=U5();s&&s.latency!==n.value&&(n.value=s.latency,n.entries=s.entries,r())},i=ai("event",o,{durationThreshold:e.durationThreshold!=null?e.durationThreshold:40});r=Yi(t,n,j5,e.reportAllChanges),i&&("PerformanceEventTiming"in Fe&&"interactionId"in PerformanceEventTiming.prototype&&i.observe({type:"first-input",buffered:!0}),os(()=>{o(i.takeRecords()),n.value<0&&Wg()>0&&(n.value=0,n.entries=[]),r(!0)}))})},q5=[2500,4e3],Xg={},H5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("LCP");let o;const i=s=>{const c=s[s.length-1];c&&c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries=[c],o())},a=ai("largest-contentful-paint",i);if(a){o=Yi(t,r,q5,e.reportAllChanges);const s=Jd(()=>{Xg[r.id]||(i(a.takeRecords()),a.disconnect(),Xg[r.id]=!0,o(!0))});["keydown","click"].forEach(c=>{Fe.document&&addEventListener(c,()=>setTimeout(s,0),!0)}),os(s)}})},$5=[800,1800],nf=t=>{Fe.document&&Fe.document.prerendering?as(()=>nf(t)):Fe.document&&Fe.document.readyState!=="complete"?addEventListener("load",()=>nf(t),!0):setTimeout(t,0)},Y5=(t,e={})=>{const n=Wi("TTFB"),r=Yi(t,n,$5,e.reportAllChanges);nf(()=>{const o=ns();if(o){const i=o.responseStart;if(i<=0||i>performance.now())return;n.value=Math.max(i-rs(),0),n.entries=[o],r(!0)}})},ss={},zc={};let Qg,Jg,Zg,em,tm;function nm(t,e=!1){return us("cls",t,Q5,Qg,e)}function W5(t,e=!1){return us("lcp",t,Z5,Zg,e)}function K5(t){return us("fid",t,J5,Jg)}function z5(t){return us("ttfb",t,e_,em)}function X5(t){return us("inp",t,t_,tm)}function cs(t,e){return rm(t,e),zc[t]||(n_(t),zc[t]=!0),om(t,e)}function Ki(t,e){const n=ss[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(o){rr&&Ie.error(`Error while triggering instrumentation handler.
118
+ Url: ${$c(t)}`),!0)}function KC(t,e){return t.type||!e||!e.length?!1:JC(t).some(n=>zo(n,e))}function zC(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;const n=t.transaction;return n?zo(n,e):!1}function XC(t,e){if(!e||!e.length)return!1;const n=$c(t);return n?zo(n,e):!1}function QC(t,e){if(!e||!e.length)return!0;const n=$c(t);return n?zo(n,e):!0}function JC(t){const e=[];t.message&&e.push(t.message);let n;try{n=t.exception.values[t.exception.values.length-1]}catch{}return n&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`)),e}function ZC(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function e5(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function $c(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?e5(e):null}catch{return Ke&&Ie.error(`Cannot extract url for event ${xo(t)}`),null}}function t5(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}const n5="Dedupe",r5=()=>{let t;return{name:n5,processEvent(e){if(e.type)return e;try{if(o5(e,t))return Ke&&Ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}};function o5(t,e){return e?!!(i5(t,e)||a5(t,e)):!1}function i5(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Gg(t,e)||!Ug(t,e))}function a5(t,e){const n=qg(e),r=qg(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Gg(t,e)||!Ug(t,e))}function Ug(t,e){let n=L0(t),r=L0(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let o=0;o<r.length;o++){const i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function Gg(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function qg(t){return t.exception&&t.exception.values&&t.exception.values[0]}function s5(t,e,n,r,o="auto.http.browser"){if(!t.fetchData)return;const i=to()&&e(t.fetchData.url);if(t.endTimestamp&&i){const l=t.fetchData.__span;if(!l)return;const g=r[l];g&&(l5(g,t),delete r[l]);return}const a=on(),s=Tt(),{method:c,url:u}=t.fetchData,d=u5(u),h=d?ei(d).host:void 0,f=!!Bn(),p=i&&f?Bo({name:`${c} ${u}`,attributes:{url:u,type:"fetch","http.method":c,"http.url":d,"server.address":h,[an]:o,[ko]:"http.client"}}):new Hi;if(t.fetchData.__span=p.spanContext().spanId,r[p.spanContext().spanId]=p,n(t.fetchData.url)&&s){const l=t.args[0];t.args[1]=t.args[1]||{};const g=t.args[1];g.headers=c5(l,s,a,g,to()&&f?p:void 0)}return p}function c5(t,e,n,r,o){const i=qi(),{traceId:a,spanId:s,sampled:c,dsc:u}={...i.getPropagationContext(),...n.getPropagationContext()},d=o?sg(o):Bd(a,s,c),h=X0(u||(o?oi(o):qc(a,e))),f=r.headers||(typeof Request<"u"&&Xr(t,Request)?t.headers:void 0);if(f)if(typeof Headers<"u"&&Xr(f,Headers)){const p=new Headers(f);return p.append("sentry-trace",d),h&&p.append(kd,h),p}else if(Array.isArray(f)){const p=[...f,["sentry-trace",d]];return h&&p.push([kd,h]),p}else{const p="baggage"in f?f.baggage:void 0,l=[];return Array.isArray(p)?l.push(...p):p&&l.push(p),h&&l.push(h),{...f,"sentry-trace":d,baggage:l.length>0?l.join(","):void 0}}else return{"sentry-trace":d,baggage:h}}function u5(t){try{return new URL(t).href}catch{return}}function l5(t,e){if(e.response){og(t,e.response.status);const n=e.response&&e.response.headers&&e.response.headers.get("content-length");if(n){const r=parseInt(n);r>0&&t.setAttribute("http.response_content_length",r)}}else e.error&&t.setStatus({code:hn,message:"internal_error"});t.end()}const Ze=gt;let Yd=0;function Hg(){return Yd>0}function d5(){Yd++,setTimeout(()=>{Yd--})}function $i(t,e={},n){if(typeof t!="function")return t;try{const o=t.__sentry_wrapped__;if(o)return typeof o=="function"?o:t;if(_d(t))return t}catch{return t}const r=function(){const o=Array.prototype.slice.call(arguments);try{const i=o.map(a=>$i(a,e));return t.apply(this,i)}catch(i){throw d5(),Fd(a=>{a.addEventProcessor(s=>(e.mechanism&&(Od(s,void 0),Ja(s,e.mechanism)),s.extra={...s.extra,arguments:o},s)),Pg(i)}),i}};try{for(const o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=t[o])}catch{}P0(r,t),gr(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}const no=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Wd(t,e){const n=zd(t,e),r={type:m5(e),value:y5(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function f5(t,e,n,r){const o=Tt(),i=o&&o.getOptions().normalizeDepth,a=C5(e),s={__serialized__:W0(e,i)};if(a)return{exception:{values:[Wd(t,a)]},extra:s};const c={exception:{values:[{type:xc(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:b5(e,{isUnhandledRejection:r})}]},extra:s};if(n){const u=zd(t,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function Kd(t,e){return{exception:{values:[Wd(t,e)]}}}function zd(t,e){const n=e.stacktrace||e.stack||"",r=p5(e),o=g5(e);try{return t(n,r,o)}catch{}return[]}const h5=/Minified React error #\d+;/i;function p5(t){return t&&h5.test(t.message)?1:0}function g5(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function $g(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function m5(t){const e=t&&t.name;return!e&&$g(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function y5(t){const e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:$g(t)&&Array.isArray(t.message)&&t.message.length==2?t.message[1]:e:"No error message"}function v5(t,e,n,r){const o=n&&n.syntheticException||void 0,i=Xd(t,e,o,r);return Ja(i),i.level="error",n&&n.event_id&&(i.event_id=n.event_id),Zo(i)}function w5(t,e,n="info",r,o){const i=r&&r.syntheticException||void 0,a=Qd(t,e,i,o);return a.level=n,r&&r.event_id&&(a.event_id=r.event_id),Zo(a)}function Xd(t,e,n,r,o){let i;if(E0(e)&&e.error)return Kd(t,e.error);if(C0(e)||bE(e)){const a=e;if("stack"in e)i=Kd(t,e);else{const s=a.name||(C0(a)?"DOMError":"DOMException"),c=a.message?`${s}: ${a.message}`:s;i=Qd(t,c,n,r),Od(i,c)}return"code"in a&&(i.tags={...i.tags,"DOMException.code":`${a.code}`}),i}return yd(e)?Kd(t,e):Mi(e)||xc(e)?(i=f5(t,e,n,o),Ja(i,{synthetic:!0}),i):(i=Qd(t,e,n,r),Od(i,`${e}`),Ja(i,{synthetic:!0}),i)}function Qd(t,e,n,r){const o={};if(r&&n){const i=zd(t,n);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]})}if(vd(e)){const{__sentry_template_string__:i,__sentry_template_values__:a}=e;return o.logentry={message:i,params:a},o}return o.message=e,o}function b5(t,{isUnhandledRejection:e}){const n=jE(t),r=e?"promise rejection":"exception";return E0(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:xc(t)?`Event \`${E5(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function E5(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function C5(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];if(n instanceof Error)return n}}function _5(t,{metadata:e,tunnel:n,dsn:r}){const o={event_id:t.event_id,sent_at:new Date().toISOString(),...e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}},...!!n&&!!r&&{dsn:Xa(r)}},i=A5(t);return Vi(o,[i])}function A5(t){return[{type:"user_report"},t]}class S5 extends RC{constructor(e){const n={parentSpanIsAlwaysRootSpan:!0,...e},r=Ze.SENTRY_SDK_SOURCE||e8();jC(n,"browser",["browser"],r),super(n),n.sendClientReports&&Ze.document&&Ze.document.addEventListener("visibilitychange",()=>{Ze.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(e,n){return v5(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return w5(this._options.stackParser,e,n,r,this._options.attachStacktrace)}captureUserFeedback(e){if(!this._isEnabled()){no&&Ie.warn("SDK not enabled, will not capture user feedback.");return}const n=_5(e,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(e,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r)}}const rr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,I5=(t,e)=>t>e[1]?"poor":t>e[0]?"needs-improvement":"good",Yi=(t,e,n,r)=>{let o,i;return a=>{e.value>=0&&(a||r)&&(i=e.value-(o||0),(i||o===void 0)&&(o=e.value,e.delta=i,e.rating=I5(e.value,n),t(e)))}},Fe=gt,T5=()=>`v3-${Date.now()}-${Math.floor(Math.random()*(9e12-1))+1e12}`,ns=()=>Fe.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0],rs=()=>{const t=ns();return t&&t.activationStart||0},Wi=(t,e)=>{const n=ns();let r="navigate";return n&&(Fe.document&&Fe.document.prerendering||rs()>0?r="prerender":Fe.document&&Fe.document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:t,value:typeof e>"u"?-1:e,rating:"good",delta:0,entries:[],id:T5(),navigationType:r}},ai=(t,e,n)=>{try{if(PerformanceObserver.supportedEntryTypes.includes(t)){const r=new PerformanceObserver(o=>{Promise.resolve().then(()=>{e(o.getEntries())})});return r.observe(Object.assign({type:t,buffered:!0},n||{})),r}}catch{}},os=t=>{const e=n=>{(n.type==="pagehide"||Fe.document&&Fe.document.visibilityState==="hidden")&&t(n)};Fe.document&&(addEventListener("visibilitychange",e,!0),addEventListener("pagehide",e,!0))},Jd=t=>{let e=!1;return n=>{e||(t(n),e=!0)}};let is=-1;const x5=()=>{is=Fe.document.visibilityState==="hidden"&&!Fe.document.prerendering?0:1/0},Yc=t=>{Fe.document.visibilityState==="hidden"&&is>-1&&(is=t.type==="visibilitychange"?t.timeStamp:0,removeEventListener("visibilitychange",Yc,!0),removeEventListener("prerenderingchange",Yc,!0))},O5=()=>{addEventListener("visibilitychange",Yc,!0),addEventListener("prerenderingchange",Yc,!0)},Wc=()=>(Fe.document&&is<0&&(x5(),O5()),{get firstHiddenTime(){return is}}),as=t=>{Fe.document&&Fe.document.prerendering?addEventListener("prerenderingchange",()=>t(),!0):t()},P5=[1800,3e3],k5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FCP");let o;const a=ai("paint",s=>{s.forEach(c=>{c.name==="first-contentful-paint"&&(a.disconnect(),c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries.push(c),o(!0)))})});a&&(o=Yi(t,r,P5,e.reportAllChanges))})},B5=[.1,.25],N5=(t,e={})=>{k5(Jd(()=>{const n=Wi("CLS",0);let r,o=0,i=[];const a=c=>{c.forEach(u=>{if(!u.hadRecentInput){const d=i[0],h=i[i.length-1];o&&d&&h&&u.startTime-h.startTime<1e3&&u.startTime-d.startTime<5e3?(o+=u.value,i.push(u)):(o=u.value,i=[u])}}),o>n.value&&(n.value=o,n.entries=i,r())},s=ai("layout-shift",a);s&&(r=Yi(t,n,B5,e.reportAllChanges),os(()=>{a(s.takeRecords()),r(!0)}),setTimeout(r,0))}))},R5=[100,300],D5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("FID");let o;const i=c=>{c.startTime<n.firstHiddenTime&&(r.value=c.processingStart-c.startTime,r.entries.push(c),o(!0))},a=c=>{c.forEach(i)},s=ai("first-input",a);o=Yi(t,r,R5,e.reportAllChanges),s&&os(Jd(()=>{a(s.takeRecords()),s.disconnect()}))})};let Yg=0,Zd=1/0,Kc=0;const M5=t=>{t.forEach(e=>{e.interactionId&&(Zd=Math.min(Zd,e.interactionId),Kc=Math.max(Kc,e.interactionId),Yg=Kc?(Kc-Zd)/7+1:0)})};let ef;const L5=()=>ef?Yg:performance.interactionCount||0,F5=()=>{"interactionCount"in performance||ef||(ef=ai("event",M5,{type:"event",buffered:!0,durationThreshold:0}))},j5=[200,500],V5=0,Wg=()=>L5()-V5,Kg=10,ro=[],tf={},zg=t=>{const e=ro[ro.length-1],n=tf[t.interactionId];if(n||ro.length<Kg||e&&t.duration>e.latency){if(n)n.entries.push(t),n.latency=Math.max(n.latency,t.duration);else{const r={id:t.interactionId,latency:t.duration,entries:[t]};tf[r.id]=r,ro.push(r)}ro.sort((r,o)=>o.latency-r.latency),ro.splice(Kg).forEach(r=>{delete tf[r.id]})}},U5=()=>{const t=Math.min(ro.length-1,Math.floor(Wg()/50));return ro[t]},G5=(t,e={})=>{as(()=>{F5();const n=Wi("INP");let r;const o=a=>{a.forEach(c=>{c.interactionId&&zg(c),c.entryType==="first-input"&&!ro.some(d=>d.entries.some(h=>c.duration===h.duration&&c.startTime===h.startTime))&&zg(c)});const s=U5();s&&s.latency!==n.value&&(n.value=s.latency,n.entries=s.entries,r())},i=ai("event",o,{durationThreshold:e.durationThreshold!=null?e.durationThreshold:40});r=Yi(t,n,j5,e.reportAllChanges),i&&("PerformanceEventTiming"in Fe&&"interactionId"in PerformanceEventTiming.prototype&&i.observe({type:"first-input",buffered:!0}),os(()=>{o(i.takeRecords()),n.value<0&&Wg()>0&&(n.value=0,n.entries=[]),r(!0)}))})},q5=[2500,4e3],Xg={},H5=(t,e={})=>{as(()=>{const n=Wc(),r=Wi("LCP");let o;const i=s=>{const c=s[s.length-1];c&&c.startTime<n.firstHiddenTime&&(r.value=Math.max(c.startTime-rs(),0),r.entries=[c],o())},a=ai("largest-contentful-paint",i);if(a){o=Yi(t,r,q5,e.reportAllChanges);const s=Jd(()=>{Xg[r.id]||(i(a.takeRecords()),a.disconnect(),Xg[r.id]=!0,o(!0))});["keydown","click"].forEach(c=>{Fe.document&&addEventListener(c,()=>setTimeout(s,0),!0)}),os(s)}})},$5=[800,1800],nf=t=>{Fe.document&&Fe.document.prerendering?as(()=>nf(t)):Fe.document&&Fe.document.readyState!=="complete"?addEventListener("load",()=>nf(t),!0):setTimeout(t,0)},Y5=(t,e={})=>{const n=Wi("TTFB"),r=Yi(t,n,$5,e.reportAllChanges);nf(()=>{const o=ns();if(o){const i=o.responseStart;if(i<=0||i>performance.now())return;n.value=Math.max(i-rs(),0),n.entries=[o],r(!0)}})},ss={},zc={};let Qg,Jg,Zg,em,tm;function nm(t,e=!1){return us("cls",t,Q5,Qg,e)}function W5(t,e=!1){return us("lcp",t,Z5,Zg,e)}function K5(t){return us("fid",t,J5,Jg)}function z5(t){return us("ttfb",t,e_,em)}function X5(t){return us("inp",t,t_,tm)}function cs(t,e){return rm(t,e),zc[t]||(n_(t),zc[t]=!0),om(t,e)}function Ki(t,e){const n=ss[t];if(!(!n||!n.length))for(const r of n)try{r(e)}catch(o){rr&&Ie.error(`Error while triggering instrumentation handler.
119
119
  Type: ${t}
120
120
  Name: ${Qr(r)}
121
- Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllChanges:!0})}function J5(){return D5(t=>{Ki("fid",{metric:t}),Jg=t})}function Z5(){return H5(t=>{Ki("lcp",{metric:t}),Zg=t},{reportAllChanges:!0})}function e_(){return Y5(t=>{Ki("ttfb",{metric:t}),em=t})}function t_(){return G5(t=>{Ki("inp",{metric:t}),tm=t})}function us(t,e,n,r,o=!1){rm(t,e);let i;return zc[t]||(i=n(),zc[t]=!0),r&&e({metric:r}),om(t,e,o?i:void 0)}function n_(t){const e={};t==="event"&&(e.durationThreshold=0),ai(t,n=>{Ki(t,{entries:n})},e)}function rm(t,e){ss[t]=ss[t]||[],ss[t].push(e)}function om(t,e,n){return()=>{n&&n();const r=ss[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function r_(t){return"duration"in t}function rf(t){return typeof t=="number"&&isFinite(t)}function zi(t,e,n,{...r}){const o=mt(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Ag(t,()=>{const i=Bo({startTime:e,...r});return i&&i.end(n),i})}function im(t){const e=Tt();if(!e)return;const{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),c=e.getIntegrationByName("Replay"),u=c&&c.getReplayId(),d=on(),h=d.getUser(),f=h!==void 0?h.email||h.id||h.ip_address:void 0;let p;try{p=d.getScopeData().contexts.profile.profile_id}catch{}const l={release:a,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":Fe.navigator&&Fe.navigator.userAgent,...o};return Bo({name:n,attributes:l,startTime:i,experimental:{standalone:!0}})}function of(){return Fe&&Fe.addEventListener&&Fe.performance}function qt(t){return t/1e3}function o_(){let t=0,e,n;if(!a_())return;let r=!1;function o(){r||(r=!0,n&&i_(t,e,n),i())}const i=nm(({metric:a})=>{const s=a.entries[a.entries.length-1];s&&(t=a.value,e=s)},!0);os(()=>{o()}),setTimeout(()=>{const a=Tt(),s=Zr([a,"optionalAccess",h=>h.on,"call",h=>h("startNavigationSpan",()=>{o(),s&&s()})]),c=Bn(),u=c&&On(c),d=u&&mt(u);d&&d.op==="pageload"&&(n=u.spanContext().spanId)},0)}function i_(t,e,n){rr&&Ie.log(`Sending CLS span (${t})`);const r=qt((qn||0)+(Zr([e,"optionalAccess",c=>c.startTime])||0)),o=on().getScopeData().transactionName,i=e?Qo(Zr([e,"access",c=>c.sources,"access",c=>c[0],"optionalAccess",c=>c.node])):"Layout shift",a=xn({[an]:"auto.http.browser.cls",[ko]:"ui.webvital.cls",[Ud]:Zr([e,"optionalAccess",c=>c.duration])||0,"sentry.pageload.span_id":n}),s=im({name:i,transaction:o,attributes:a,startTime:r});Zr([s,"optionalAccess",c=>c.addEvent,"call",c=>c("cls",{[Vc]:"",[Uc]:t})]),Zr([s,"optionalAccess",c=>c.end,"call",c=>c(r)])}function a_(){try{return Zr([PerformanceObserver,"access",t=>t.supportedEntryTypes,"optionalAccess",t=>t.includes,"call",t=>t("layout-shift")])}catch{return!1}}const s_=2147483647;let am=0,bn={},Fr,ls;function c_({recordClsStandaloneSpans:t}){const e=of();if(e&&qn){e.mark&&Fe.performance.mark("sentry-tracing-init");const n=p_(),r=h_(),o=g_(),i=t?o_():f_();return()=>{n(),r(),o(),i&&i()}}return()=>{}}function u_(){cs("longtask",({entries:t})=>{if(Bn())for(const e of t){const n=qt(qn+e.startTime),r=qt(e.duration),o=Bo({name:"Main UI thread blocked",op:"ui.long-task",startTime:n,attributes:{[an]:"auto.ui.browser.metrics"}});o&&o.end(n+r)}})}function l_(){new PerformanceObserver(e=>{if(Bn())for(const n of e.getEntries()){if(!n.scripts[0])continue;const r=qt(qn+n.startTime),o=qt(n.duration),i={[an]:"auto.ui.browser.metrics"},a=n.scripts[0],{invoker:s,invokerType:c,sourceURL:u,sourceFunctionName:d,sourceCharPosition:h}=a;i["browser.script.invoker"]=s,i["browser.script.invoker_type"]=c,u&&(i["code.filepath"]=u),d&&(i["code.function"]=d),h!==-1&&(i["browser.script.source_char_position"]=h);const f=Bo({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:r,attributes:i});f&&f.end(r+o)}}).observe({type:"long-animation-frame",buffered:!0})}function d_(){cs("event",({entries:t})=>{if(Bn()){for(const e of t)if(e.name==="click"){const n=qt(qn+e.startTime),r=qt(e.duration),o={name:Qo(e.target),op:`ui.interaction.${e.name}`,startTime:n,attributes:{[an]:"auto.ui.browser.metrics"}},i=x0(e.target);i&&(o.attributes["ui.component_name"]=i);const a=Bo(o);a&&a.end(n+r)}}})}function f_(){return nm(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log(`[Measurements] Adding CLS ${t.value}`),bn.cls={value:t.value,unit:""},ls=e)},!0)}function h_(){return W5(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log("[Measurements] Adding LCP"),bn.lcp={value:t.value,unit:"millisecond"},Fr=e)},!0)}function p_(){return K5(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=qt(qn),r=qt(e.startTime);rr&&Ie.log("[Measurements] Adding FID"),bn.fid={value:t.value,unit:"millisecond"},bn["mark.fid"]={value:n+r,unit:"second"}})}function g_(){return z5(({metric:t})=>{t.entries[t.entries.length-1]&&(rr&&Ie.log("[Measurements] Adding TTFB"),bn.ttfb={value:t.value,unit:"millisecond"})})}function m_(t,e){const n=of();if(!n||!Fe.performance.getEntries||!qn)return;rr&&Ie.log("[Tracing] Adding & adjusting spans using Performance API");const r=qt(qn),o=n.getEntries(),{op:i,start_timestamp:a}=mt(t);if(o.slice(am).forEach(s=>{const c=qt(s.startTime),u=qt(Math.max(0,s.duration));if(!(i==="navigation"&&a&&r+c<a))switch(s.entryType){case"navigation":{v_(t,s,r);break}case"mark":case"paint":case"measure":{y_(t,s,c,u,r);const d=Wc(),h=s.startTime<d.firstHiddenTime;s.name==="first-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FP"),bn.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FCP"),bn.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{b_(t,s,s.name,c,u,r);break}}}),am=Math.max(o.length-1,0),E_(t),i==="pageload"){__(bn);const s=bn["mark.fid"];s&&bn.fid&&(zi(t,s.value,s.value+qt(bn.fid.value),{name:"first input delay",op:"ui.action",attributes:{[an]:"auto.ui.browser.metrics"}}),delete bn["mark.fid"]),(!("fcp"in bn)||!e.recordClsOnPageloadSpan)&&delete bn.cls,Object.entries(bn).forEach(([c,u])=>{rC(c,u.value,u.unit)}),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",rs()),C_(t)}Fr=void 0,ls=void 0,bn={}}function y_(t,e,n,r,o){const i=ns(),a=qt(i?i.requestStart:0),s=o+Math.max(n,a),c=o+n,u=c+r,d={[an]:"auto.resource.browser.metrics"};return s!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=s),zi(t,s,u,{name:e.name,op:e.entryType,attributes:d}),s}function v_(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Xc(t,e,r,n)}),Xc(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Xc(t,e,"fetch",n,"cache","domainLookupStart"),Xc(t,e,"domainLookup",n,"DNS"),w_(t,e,n)}function Xc(t,e,n,r,o,i){const a=i?e[i]:e[`${n}End`],s=e[`${n}Start`];!s||!a||zi(t,r+qt(s),r+qt(a),{op:`browser.${o||n}`,name:e.name,attributes:{[an]:"auto.ui.browser.metrics"}})}function w_(t,e,n){const r=n+qt(e.requestStart),o=n+qt(e.responseEnd),i=n+qt(e.responseStart);e.responseEnd&&(zi(t,r,o,{op:"browser.request",name:e.name,attributes:{[an]:"auto.ui.browser.metrics"}}),zi(t,i,o,{op:"browser.response",name:e.name,attributes:{[an]:"auto.ui.browser.metrics"}}))}function b_(t,e,n,r,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=ei(n),s={[an]:"auto.resource.browser.metrics"};af(s,e,"transferSize","http.response_transfer_size"),af(s,e,"encodedBodySize","http.response_content_length"),af(s,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus),a.protocol&&(s["url.scheme"]=a.protocol.split(":").pop()),a.host&&(s["server.address"]=a.host),s["url.same_origin"]=n.includes(Fe.location.origin);const c=i+r,u=c+o;zi(t,c,u,{name:n.replace(Fe.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:s})}function E_(t){const e=Fe.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),rf(n.rtt)&&(bn["connection.rtt"]={value:n.rtt,unit:"millisecond"})),rf(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),rf(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function C_(t){Fr&&(rr&&Ie.log("[Measurements] Adding LCP Data"),Fr.element&&t.setAttribute("lcp.element",Qo(Fr.element)),Fr.id&&t.setAttribute("lcp.id",Fr.id),Fr.url&&t.setAttribute("lcp.url",Fr.url.trim().slice(0,200)),t.setAttribute("lcp.size",Fr.size)),ls&&ls.sources&&(rr&&Ie.log("[Measurements] Adding CLS Data"),ls.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,Qo(e.node))))}function af(t,e,n,r){const o=e[n];o!=null&&o<s_&&(t[r]=o)}function __(t){const e=ns();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(rr&&Ie.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const A_=1e3;let sm,sf,cf;function S_(t){const e="dom";Io(e,t),To(e,I_)}function I_(){if(!Fe.document)return;const t=mr.bind(null,"dom"),e=cm(t,!0);Fe.document.addEventListener("click",e,!1),Fe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=Fe[n]&&Fe[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(nr(r,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const h=cm(t);d.handler=h,o.call(this,i,h,s)}d.refCount++}catch{}return o.call(this,i,a,s)}}),nr(r,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,s),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}function T_(t){if(t.type!==sf)return!1;try{if(!t.target||t.target._sentryId!==cf)return!1}catch{}return!0}function x_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function cm(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=O_(n);if(x_(n.type,r))return;gr(n,"_sentryCaptured",!0),r&&!r._sentryId&&gr(r,"_sentryId",Ut());const o=n.type==="keypress"?"input":n.type;T_(n)||(t({event:n,name:o,global:e}),sf=n.type,cf=r?r._sentryId:void 0),clearTimeout(sm),sm=Fe.setTimeout(()=>{cf=void 0,sf=void 0},A_)}}function O_(t){try{return t.target}catch{return null}}let Qc;function um(t){const e="history";Io(e,t),To(e,P_)}function P_(){if(!P8())return;const t=Fe.onpopstate;Fe.onpopstate=function(...n){const r=Fe.location.href,o=Qc;if(Qc=r,mr("history",{from:o,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const o=r.length>2?r[2]:void 0;if(o){const i=Qc,a=String(o);Qc=a,mr("history",{from:i,to:a})}return n.apply(this,r)}}nr(Fe.history,"pushState",e),nr(Fe.history,"replaceState",e)}const Jc={};function k_(t){const e=Jc[t];if(e)return e;let n=Fe[t];if(Td(n))return Jc[t]=n.bind(Fe);const r=Fe.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const i=o.contentWindow;i&&i[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){rr&&Ie.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(Jc[t]=n.bind(Fe))}function lm(t){Jc[t]=void 0}const Xi="__sentry_xhr_v3__";function dm(t){const e="xhr";Io(e,t),To(e,B_)}function B_(){if(!Fe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const o=Gn()*1e3,i=zr(r[0])?r[0].toUpperCase():void 0,a=N_(r[1]);if(!i||!a)return e.apply(n,r);n[Xi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const s=()=>{const c=n[Xi];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:Gn()*1e3,startTimestamp:o,xhr:n};mr("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return s(),c.apply(u,d)}}):n.addEventListener("readystatechange",s),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[h,f]=d,p=u[Xi];return p&&zr(h)&&zr(f)&&(p.request_headers[h.toLowerCase()]=f),c.apply(u,d)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const o=n[Xi];if(!o)return e.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const i={startTimestamp:Gn()*1e3,xhr:n};return mr("xhr",i),e.apply(n,r)}})}function N_(t){if(zr(t))return t;try{return t.toString()}catch{}}const uf=[],Zc=new Map;function R_(){if(of()&&qn){const e=D_();return()=>{e()}}return()=>{}}const fm={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function D_(){return X5(({metric:t})=>{if(t.value==null)return;const e=t.entries.find(l=>l.duration===t.value&&fm[l.name]);if(!e)return;const{interactionId:n}=e,r=fm[e.name],o=qt(qn+e.startTime),i=qt(t.value),a=Bn(),s=a?On(a):void 0,u=(n!=null?Zc.get(n):void 0)||s,d=u?mt(u).description:on().getScopeData().transactionName,h=Qo(e.target),f=xn({[an]:"auto.http.browser.inp",[ko]:`ui.interaction.${r}`,[Ud]:e.duration}),p=im({name:h,transaction:d,attributes:f,startTime:o});Zr([p,"optionalAccess",l=>l.addEvent,"call",l=>l("inp",{[Vc]:"millisecond",[Uc]:t.value})]),Zr([p,"optionalAccess",l=>l.end,"call",l=>l(o+i)])})}function M_(t){const e=({entries:n})=>{const r=Bn(),o=r&&On(r);n.forEach(i=>{if(!r_(i)||!o)return;const a=i.interactionId;if(a!=null&&!Zc.has(a)){if(uf.length>10){const s=uf.shift();Zc.delete(s)}uf.push(a),Zc.set(a,o)}})};cs("event",e),cs("first-input",e)}function L_(t,e=k_("fetch")){let n=0,r=0;function o(i){const a=i.body.length;n+=a,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return lm("fetch"),Mc("No fetch implementation available");try{return e(t.url,s).then(c=>(n-=a,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return lm("fetch"),n-=a,r--,Mc(c)}}return FC(t,o)}const F_=30,j_=50;function lf(t,e,n,r){const o={filename:t,function:e==="<anonymous>"?Jo:e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const V_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,U_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,G_=/\((\S*)(?::(\d+))(?::(\d+))\)/,q_=[F_,t=>{const e=V_.exec(t);if(e){const[,r,o,i]=e;return lf(r,Jo,+o,+i)}const n=U_.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=G_.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[o,i]=hm(n[1]||Jo,n[2]);return lf(i,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],H_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y_=UE(...[q_,[j_,t=>{const e=H_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=$_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],o=e[1]||Jo;return[o,r]=hm(o,r),lf(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),hm=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Jo,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},eu=1024,W_="Breadcrumbs",K_=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:W_,setup(n){e.console&&qE(Q_(n)),e.dom&&S_(X_(n,e.dom)),e.xhr&&dm(J_(n)),e.fetch&&V0(Z_(n)),e.history&&um(eA(n)),e.sentry&&n.on("beforeSendEvent",z_(n))}}};function z_(t){return function(n){Tt()===t&&ii({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:xo(n)},{event:n})}}function X_(t,e){return function(r){if(Tt()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>eu&&(no&&Ie.warn(`\`dom.maxStringLength\` cannot exceed ${eu}, but a value of ${s} was configured. Sentry will use ${eu} instead.`),s=eu),typeof a=="string"&&(a=[a]);try{const u=r.event,d=tA(u)?u.target:u;o=Qo(d,{keyAttrs:a,maxStringLength:s}),i=x0(d)}catch{o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),ii(c,{event:r.event,name:r.name,global:r.global})}}function Q_(t){return function(n){if(Tt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:u8(n.level),message:A0(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${A0(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ii(r,{input:n.args,level:n.level})}}function J_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[Xi];if(!r||!o||!i)return;const{method:a,url:s,status_code:c,body:u}=i,d={method:a,url:s,status_code:c},h={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f=T0(c);ii({category:"xhr",data:d,type:"http",level:f},h)}}function Z_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o};ii({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c=T0(a.status_code);ii({category:"fetch",data:a,type:"http",level:c},s)}}}function eA(t){return function(n){if(Tt()!==t)return;let r=n.from,o=n.to;const i=ei(et.location.href);let a=r?ei(r):void 0;const s=ei(o);(!a||!a.path)&&(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),ii({category:"navigation",data:{from:r,to:o}})}}function tA(t){return!!t&&!!t.target}const nA=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],rA="BrowserApiErrors",oA=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:rA,setupOnce(){e.setTimeout&&nr(et,"setTimeout",pm),e.setInterval&&nr(et,"setInterval",pm),e.requestAnimationFrame&&nr(et,"requestAnimationFrame",iA),e.XMLHttpRequest&&"XMLHttpRequest"in et&&nr(XMLHttpRequest.prototype,"send",aA);const n=e.eventTarget;n&&(Array.isArray(n)?n:nA).forEach(sA)}}};function pm(t){return function(...e){const n=e[0];return e[0]=$i(n,{mechanism:{data:{function:Qr(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function iA(t){return function(e){return t.apply(this,[$i(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Qr(t)},handled:!1,type:"instrument"}})])}}function aA(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&nr(n,o,function(i){const a={mechanism:{data:{function:o,handler:Qr(i)},handled:!1,type:"instrument"}},s=_d(i);return s&&(a.mechanism.data.handler=Qr(s)),$i(i,a)})}),t.apply(this,e)}}function sA(t){const e=et,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(nr(n,"addEventListener",function(r){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=$i(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Qr(i),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[o,$i(i,{mechanism:{data:{function:"addEventListener",handler:Qr(i),target:t},handled:!1,type:"instrument"}}),a])}}),nr(n,"removeEventListener",function(r){return function(o,i,a){const s=i;try{const c=s&&s.__sentry_wrapped__;c&&r.call(this,o,c,a)}catch{}return r.call(this,o,s,a)}}))}const cA="GlobalHandlers",uA=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:cA,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(lA(n),gm("onerror")),e.onunhandledrejection&&(dA(n),gm("onunhandledrejection"))}}};function lA(t){q0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const{msg:o,url:i,line:a,column:s,error:c}=e,u=pA(Xd(n,c||o,void 0,r,!1),i,a,s);u.level="error",kg(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function dA(t){H0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const o=fA(e),i=wd(o)?hA(o):Xd(n,o,void 0,r,!0);i.level="error",kg(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function fA(t){if(wd(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function hA(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function pA(t,e,n,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],u=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,h=zr(e)&&e.length>0?e:OE();return c.length===0&&c.push({colno:u,filename:h,function:Jo,in_app:!0,lineno:d}),t}function gm(t){no&&Ie.log(`Global Handler attached: ${t}`)}function mm(){const t=Tt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const gA=()=>({name:"HttpContext",preprocessEvent(t){if(!et.navigator&&!et.location&&!et.document)return;const e=t.request&&t.request.url||et.location&&et.location.href,{referrer:n}=et.document||{},{userAgent:r}=et.navigator||{},o={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:o};t.request=i}}),mA="cause",yA=5,vA="LinkedErrors",wA=(t={})=>{const e=t.limit||yA,n=t.key||mA;return{name:vA,preprocessEvent(r,o,i){const a=i.getOptions();SE(Wd,a.stackParser,a.maxValueLength,n,e,r,o)}}};function bA(t){return[$C(),GC(),oA(),K_(),uA(),wA(),r5(),gA()]}const ym=new WeakMap,df=new Map,ff={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0};function EA(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a}={traceFetch:ff.traceFetch,traceXHR:ff.traceXHR,...e},s=typeof o=="function"?o:d=>!0,c=d=>SA(d,a),u={};n&&(t.addEventProcessor(d=>(d.type==="transaction"&&d.spans&&d.spans.forEach(h=>{if(h.op==="http.client"){const f=df.get(h.span_id);f&&(h.timestamp=f/1e3,df.delete(h.span_id))}}),d)),KE(d=>{if(d.response){const h=ym.get(d.response);h&&d.endTimestamp&&df.set(h,d.endTimestamp)}}),V0(d=>{const h=s5(d,s,c,u);if(d.response&&d.fetchData.__span&&ym.set(d.response,d.fetchData.__span),h){const f=wm(d.fetchData.url),p=f?ei(f).host:void 0;h.setAttributes({"http.url":f,"server.address":p})}i&&h&&vm(h)})),r&&dm(d=>{const h=IA(d,s,c,u);i&&h&&vm(h)})}function CA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function vm(t){const{url:e}=mt(t).data||{};if(!e||typeof e!="string")return;const n=cs("resource",({entries:r})=>{r.forEach(o=>{CA(o)&&o.name.endsWith(e)&&(AA(o).forEach(a=>t.setAttribute(...a)),setTimeout(n))})})}function _A(t){let e="unknown",n="unknown",r="";for(const o of t){if(o==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(o))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=o}return r===t&&(e=r),{name:e,version:n}}function jr(t=0){return((qn||performance.timeOrigin)+t)/1e3}function AA(t){const{name:e,version:n}=_A(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),qn?[...r,["http.request.redirect_start",jr(t.redirectStart)],["http.request.fetch_start",jr(t.fetchStart)],["http.request.domain_lookup_start",jr(t.domainLookupStart)],["http.request.domain_lookup_end",jr(t.domainLookupEnd)],["http.request.connect_start",jr(t.connectStart)],["http.request.secure_connection_start",jr(t.secureConnectionStart)],["http.request.connection_end",jr(t.connectEnd)],["http.request.request_start",jr(t.requestStart)],["http.request.response_start",jr(t.responseStart)],["http.request.response_end",jr(t.responseEnd)]]:r}function SA(t,e){const n=et.location&&et.location.href;if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}const i=r.origin===o;return e?zo(r.toString(),e)||i&&zo(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?zo(t,e):r}}function IA(t,e,n,r){const o=t.xhr,i=o&&o[Xi];if(!o||o.__sentry_own_request__||!i)return;const a=to()&&e(i.url);if(t.endTimestamp&&a){const f=o.__sentry_xhr_span_id__;if(!f)return;const p=r[f];p&&i.status_code!==void 0&&(og(p,i.status_code),p.end(),delete r[f]);return}const s=wm(i.url),c=s?ei(s).host:void 0,u=!!Bn(),d=a&&u?Bo({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":s,url:i.url,"server.address":c,[an]:"auto.http.browser",[ko]:"http.client"}}):new Hi;o.__sentry_xhr_span_id__=d.spanContext().spanId,r[o.__sentry_xhr_span_id__]=d;const h=Tt();return o.setRequestHeader&&n(i.url)&&h&&TA(o,h,to()&&u?d:void 0),d}function TA(t,e,n){const r=on(),o=qi(),{traceId:i,spanId:a,sampled:s,dsc:c}={...o.getPropagationContext(),...r.getPropagationContext()},u=n&&to()?sg(n):Bd(i,a,s),d=X0(c||(n?oi(n):qc(i,e)));xA(t,u,d)}function xA(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(kd,n)}catch{}}function wm(t){try{return new URL(t,et.location.origin).href}catch{return}}function OA(){et&&et.document?et.document.addEventListener("visibilitychange",()=>{const t=Bn();if(!t)return;const e=On(t);if(et.document.hidden&&e){const n="cancelled",{op:r,status:o}=mt(e);no&&Ie.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:hn,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):no&&Ie.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const PA="BrowserTracing",kA={...Hc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...ff},BA=(t={})=>{K8();const{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:o,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:s,finalTimeout:c,childSpanTimeout:u,markBackgroundSpan:d,traceFetch:h,traceXHR:f,shouldCreateSpanForRequest:p,enableHTTPTimings:l,instrumentPageLoad:g,instrumentNavigation:m}={...kA,...t},y=c_({recordClsStandaloneSpans:i||!1});e&&R_(),r&&gt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?l_():n&&u_(),o&&d_();const w={name:void 0,source:void 0};function b(E,C){const I=C.op==="pageload",T=a?a(C):C,P=T.attributes||{};C.name!==T.name&&(P[eo]="custom",T.attributes=P),w.name=T.name,w.source=P[eo];const N=Tg(T,{idleTimeout:s,finalTimeout:c,childSpanTimeout:u,disableAutoFinish:I,beforeSpanEnd:V=>{y(),m_(V,{recordClsOnPageloadSpan:!i})}});function L(){["interactive","complete"].includes(et.document.readyState)&&E.emit("idleSpanEnableAutoFinish",N)}return I&&et.document&&(et.document.addEventListener("readystatechange",()=>{L()}),L()),N}return{name:PA,afterAllSetup(E){let C,I=et.location&&et.location.href;E.on("startNavigationSpan",T=>{Tt()===E&&(C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end()),C=b(E,{op:"navigation",...T}))}),E.on("startPageLoadSpan",(T,P={})=>{if(Tt()!==E)return;C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end());const N=P.sentryTrace||Em("sentry-trace"),L=P.baggage||Em("baggage"),V=m8(N,L);on().setPropagationContext(V),C=b(E,{op:"pageload",...T})}),E.on("spanEnd",T=>{const P=mt(T).op;if(T!==On(T)||P!=="navigation"&&P!=="pageload")return;const N=on(),L=N.getPropagationContext();N.setPropagationContext({...L,sampled:L.sampled!==void 0?L.sampled:ni(T),dsc:L.dsc||oi(T)})}),et.location&&(g&&bm(E,{name:et.location.pathname,startTime:qn?qn/1e3:void 0,attributes:{[eo]:"url",[an]:"auto.pageload.browser"}}),m&&um(({to:T,from:P})=>{if(P===void 0&&I&&I.indexOf(T)!==-1){I=void 0;return}P!==T&&(I=void 0,NA(E,{name:et.location.pathname,attributes:{[eo]:"url",[an]:"auto.navigation.browser"}}))})),d&&OA(),o&&RA(s,c,u,w),e&&M_(),EA(E,{traceFetch:h,traceXHR:f,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:p,enableHTTPTimings:l})}}};function bm(t,e,n){t.emit("startPageLoadSpan",e,n),on().setTransactionName(e.name);const r=Bn();return(r&&mt(r).op)==="pageload"?r:void 0}function NA(t,e){qi().setPropagationContext(Lc()),on().setPropagationContext(Lc()),t.emit("startNavigationSpan",e),on().setTransactionName(e.name);const n=Bn();return(n&&mt(n).op)==="navigation"?n:void 0}function Em(t){const e=PE(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function RA(t,e,n,r){let o;const i=()=>{const a="ui.action.click",s=Bn(),c=s&&On(s);if(c){const u=mt(c).op;if(["navigation","pageload"].includes(u)){no&&Ie.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Vd,"interactionInterrupted"),o.end(),o=void 0),!r.name){no&&Ie.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Tg({name:r.name,op:a,attributes:{[eo]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};et.document&&addEventListener("click",i,{once:!1,capture:!0})}var hf={exports:{}},wt={};/** @license React v16.13.1
121
+ Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllChanges:!0})}function J5(){return D5(t=>{Ki("fid",{metric:t}),Jg=t})}function Z5(){return H5(t=>{Ki("lcp",{metric:t}),Zg=t},{reportAllChanges:!0})}function e_(){return Y5(t=>{Ki("ttfb",{metric:t}),em=t})}function t_(){return G5(t=>{Ki("inp",{metric:t}),tm=t})}function us(t,e,n,r,o=!1){rm(t,e);let i;return zc[t]||(i=n(),zc[t]=!0),r&&e({metric:r}),om(t,e,o?i:void 0)}function n_(t){const e={};t==="event"&&(e.durationThreshold=0),ai(t,n=>{Ki(t,{entries:n})},e)}function rm(t,e){ss[t]=ss[t]||[],ss[t].push(e)}function om(t,e,n){return()=>{n&&n();const r=ss[t];if(!r)return;const o=r.indexOf(e);o!==-1&&r.splice(o,1)}}function r_(t){return"duration"in t}function rf(t){return typeof t=="number"&&isFinite(t)}function zi(t,e,n,{...r}){const o=mt(t).start_timestamp;return o&&o>e&&typeof t.updateStartTime=="function"&&t.updateStartTime(e),Ag(t,()=>{const i=Bo({startTime:e,...r});return i&&i.end(n),i})}function im(t){const e=Tt();if(!e)return;const{name:n,transaction:r,attributes:o,startTime:i}=t,{release:a,environment:s}=e.getOptions(),c=e.getIntegrationByName("Replay"),u=c&&c.getReplayId(),d=on(),h=d.getUser(),f=h!==void 0?h.email||h.id||h.ip_address:void 0;let p;try{p=d.getScopeData().contexts.profile.profile_id}catch{}const l={release:a,environment:s,user:f||void 0,profile_id:p||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":Fe.navigator&&Fe.navigator.userAgent,...o};return Bo({name:n,attributes:l,startTime:i,experimental:{standalone:!0}})}function of(){return Fe&&Fe.addEventListener&&Fe.performance}function qt(t){return t/1e3}function o_(){let t=0,e,n;if(!a_())return;let r=!1;function o(){r||(r=!0,n&&i_(t,e,n),i())}const i=nm(({metric:a})=>{const s=a.entries[a.entries.length-1];s&&(t=a.value,e=s)},!0);os(()=>{o()}),setTimeout(()=>{const a=Tt(),s=Zr([a,"optionalAccess",h=>h.on,"call",h=>h("startNavigationSpan",()=>{o(),s&&s()})]),c=Bn(),u=c&&On(c),d=u&&mt(u);d&&d.op==="pageload"&&(n=u.spanContext().spanId)},0)}function i_(t,e,n){rr&&Ie.log(`Sending CLS span (${t})`);const r=qt((qn||0)+(Zr([e,"optionalAccess",c=>c.startTime])||0)),o=on().getScopeData().transactionName,i=e?Qo(Zr([e,"access",c=>c.sources,"access",c=>c[0],"optionalAccess",c=>c.node])):"Layout shift",a=xn({[an]:"auto.http.browser.cls",[ko]:"ui.webvital.cls",[Ud]:Zr([e,"optionalAccess",c=>c.duration])||0,"sentry.pageload.span_id":n}),s=im({name:i,transaction:o,attributes:a,startTime:r});Zr([s,"optionalAccess",c=>c.addEvent,"call",c=>c("cls",{[Vc]:"",[Uc]:t})]),Zr([s,"optionalAccess",c=>c.end,"call",c=>c(r)])}function a_(){try{return Zr([PerformanceObserver,"access",t=>t.supportedEntryTypes,"optionalAccess",t=>t.includes,"call",t=>t("layout-shift")])}catch{return!1}}const s_=2147483647;let am=0,bn={},Fr,ls;function c_({recordClsStandaloneSpans:t}){const e=of();if(e&&qn){e.mark&&Fe.performance.mark("sentry-tracing-init");const n=p_(),r=h_(),o=g_(),i=t?o_():f_();return()=>{n(),r(),o(),i&&i()}}return()=>{}}function u_(){cs("longtask",({entries:t})=>{if(Bn())for(const e of t){const n=qt(qn+e.startTime),r=qt(e.duration),o=Bo({name:"Main UI thread blocked",op:"ui.long-task",startTime:n,attributes:{[an]:"auto.ui.browser.metrics"}});o&&o.end(n+r)}})}function l_(){new PerformanceObserver(e=>{if(Bn())for(const n of e.getEntries()){if(!n.scripts[0])continue;const r=qt(qn+n.startTime),o=qt(n.duration),i={[an]:"auto.ui.browser.metrics"},a=n.scripts[0],{invoker:s,invokerType:c,sourceURL:u,sourceFunctionName:d,sourceCharPosition:h}=a;i["browser.script.invoker"]=s,i["browser.script.invoker_type"]=c,u&&(i["code.filepath"]=u),d&&(i["code.function"]=d),h!==-1&&(i["browser.script.source_char_position"]=h);const f=Bo({name:"Main UI thread blocked",op:"ui.long-animation-frame",startTime:r,attributes:i});f&&f.end(r+o)}}).observe({type:"long-animation-frame",buffered:!0})}function d_(){cs("event",({entries:t})=>{if(Bn()){for(const e of t)if(e.name==="click"){const n=qt(qn+e.startTime),r=qt(e.duration),o={name:Qo(e.target),op:`ui.interaction.${e.name}`,startTime:n,attributes:{[an]:"auto.ui.browser.metrics"}},i=x0(e.target);i&&(o.attributes["ui.component_name"]=i);const a=Bo(o);a&&a.end(n+r)}}})}function f_(){return nm(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log(`[Measurements] Adding CLS ${t.value}`),bn.cls={value:t.value,unit:""},ls=e)},!0)}function h_(){return W5(({metric:t})=>{const e=t.entries[t.entries.length-1];e&&(rr&&Ie.log("[Measurements] Adding LCP"),bn.lcp={value:t.value,unit:"millisecond"},Fr=e)},!0)}function p_(){return K5(({metric:t})=>{const e=t.entries[t.entries.length-1];if(!e)return;const n=qt(qn),r=qt(e.startTime);rr&&Ie.log("[Measurements] Adding FID"),bn.fid={value:t.value,unit:"millisecond"},bn["mark.fid"]={value:n+r,unit:"second"}})}function g_(){return z5(({metric:t})=>{t.entries[t.entries.length-1]&&(rr&&Ie.log("[Measurements] Adding TTFB"),bn.ttfb={value:t.value,unit:"millisecond"})})}function m_(t,e){const n=of();if(!n||!Fe.performance.getEntries||!qn)return;rr&&Ie.log("[Tracing] Adding & adjusting spans using Performance API");const r=qt(qn),o=n.getEntries(),{op:i,start_timestamp:a}=mt(t);if(o.slice(am).forEach(s=>{const c=qt(s.startTime),u=qt(Math.max(0,s.duration));if(!(i==="navigation"&&a&&r+c<a))switch(s.entryType){case"navigation":{v_(t,s,r);break}case"mark":case"paint":case"measure":{y_(t,s,c,u,r);const d=Wc(),h=s.startTime<d.firstHiddenTime;s.name==="first-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FP"),bn.fp={value:s.startTime,unit:"millisecond"}),s.name==="first-contentful-paint"&&h&&(rr&&Ie.log("[Measurements] Adding FCP"),bn.fcp={value:s.startTime,unit:"millisecond"});break}case"resource":{b_(t,s,s.name,c,u,r);break}}}),am=Math.max(o.length-1,0),E_(t),i==="pageload"){__(bn);const s=bn["mark.fid"];s&&bn.fid&&(zi(t,s.value,s.value+qt(bn.fid.value),{name:"first input delay",op:"ui.action",attributes:{[an]:"auto.ui.browser.metrics"}}),delete bn["mark.fid"]),(!("fcp"in bn)||!e.recordClsOnPageloadSpan)&&delete bn.cls,Object.entries(bn).forEach(([c,u])=>{rC(c,u.value,u.unit)}),t.setAttribute("performance.timeOrigin",r),t.setAttribute("performance.activationStart",rs()),C_(t)}Fr=void 0,ls=void 0,bn={}}function y_(t,e,n,r,o){const i=ns(),a=qt(i?i.requestStart:0),s=o+Math.max(n,a),c=o+n,u=c+r,d={[an]:"auto.resource.browser.metrics"};return s!==c&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=s),zi(t,s,u,{name:e.name,op:e.entryType,attributes:d}),s}function v_(t,e,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Xc(t,e,r,n)}),Xc(t,e,"secureConnection",n,"TLS/SSL","connectEnd"),Xc(t,e,"fetch",n,"cache","domainLookupStart"),Xc(t,e,"domainLookup",n,"DNS"),w_(t,e,n)}function Xc(t,e,n,r,o,i){const a=i?e[i]:e[`${n}End`],s=e[`${n}Start`];!s||!a||zi(t,r+qt(s),r+qt(a),{op:`browser.${o||n}`,name:e.name,attributes:{[an]:"auto.ui.browser.metrics"}})}function w_(t,e,n){const r=n+qt(e.requestStart),o=n+qt(e.responseEnd),i=n+qt(e.responseStart);e.responseEnd&&(zi(t,r,o,{op:"browser.request",name:e.name,attributes:{[an]:"auto.ui.browser.metrics"}}),zi(t,i,o,{op:"browser.response",name:e.name,attributes:{[an]:"auto.ui.browser.metrics"}}))}function b_(t,e,n,r,o,i){if(e.initiatorType==="xmlhttprequest"||e.initiatorType==="fetch")return;const a=ei(n),s={[an]:"auto.resource.browser.metrics"};af(s,e,"transferSize","http.response_transfer_size"),af(s,e,"encodedBodySize","http.response_content_length"),af(s,e,"decodedBodySize","http.decoded_response_content_length"),"renderBlockingStatus"in e&&(s["resource.render_blocking_status"]=e.renderBlockingStatus),a.protocol&&(s["url.scheme"]=a.protocol.split(":").pop()),a.host&&(s["server.address"]=a.host),s["url.same_origin"]=n.includes(Fe.location.origin);const c=i+r,u=c+o;zi(t,c,u,{name:n.replace(Fe.location.origin,""),op:e.initiatorType?`resource.${e.initiatorType}`:"resource.other",attributes:s})}function E_(t){const e=Fe.navigator;if(!e)return;const n=e.connection;n&&(n.effectiveType&&t.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&t.setAttribute("connectionType",n.type),rf(n.rtt)&&(bn["connection.rtt"]={value:n.rtt,unit:"millisecond"})),rf(e.deviceMemory)&&t.setAttribute("deviceMemory",`${e.deviceMemory} GB`),rf(e.hardwareConcurrency)&&t.setAttribute("hardwareConcurrency",String(e.hardwareConcurrency))}function C_(t){Fr&&(rr&&Ie.log("[Measurements] Adding LCP Data"),Fr.element&&t.setAttribute("lcp.element",Qo(Fr.element)),Fr.id&&t.setAttribute("lcp.id",Fr.id),Fr.url&&t.setAttribute("lcp.url",Fr.url.trim().slice(0,200)),t.setAttribute("lcp.size",Fr.size)),ls&&ls.sources&&(rr&&Ie.log("[Measurements] Adding CLS Data"),ls.sources.forEach((e,n)=>t.setAttribute(`cls.source.${n+1}`,Qo(e.node))))}function af(t,e,n,r){const o=e[n];o!=null&&o<s_&&(t[r]=o)}function __(t){const e=ns();if(!e)return;const{responseStart:n,requestStart:r}=e;r<=n&&(rr&&Ie.log("[Measurements] Adding TTFB Request Time"),t["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}const A_=1e3;let sm,sf,cf;function S_(t){const e="dom";Io(e,t),To(e,I_)}function I_(){if(!Fe.document)return;const t=mr.bind(null,"dom"),e=cm(t,!0);Fe.document.addEventListener("click",e,!1),Fe.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{const r=Fe[n]&&Fe[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(nr(r,"addEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},d=u[i]=u[i]||{refCount:0};if(!d.handler){const h=cm(t);d.handler=h,o.call(this,i,h,s)}d.refCount++}catch{}return o.call(this,i,a,s)}}),nr(r,"removeEventListener",function(o){return function(i,a,s){if(i==="click"||i=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},d=u[i];d&&(d.refCount--,d.refCount<=0&&(o.call(this,i,d.handler,s),d.handler=void 0,delete u[i]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return o.call(this,i,a,s)}}))})}function T_(t){if(t.type!==sf)return!1;try{if(!t.target||t.target._sentryId!==cf)return!1}catch{}return!0}function x_(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function cm(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=O_(n);if(x_(n.type,r))return;gr(n,"_sentryCaptured",!0),r&&!r._sentryId&&gr(r,"_sentryId",Ut());const o=n.type==="keypress"?"input":n.type;T_(n)||(t({event:n,name:o,global:e}),sf=n.type,cf=r?r._sentryId:void 0),clearTimeout(sm),sm=Fe.setTimeout(()=>{cf=void 0,sf=void 0},A_)}}function O_(t){try{return t.target}catch{return null}}let Qc;function um(t){const e="history";Io(e,t),To(e,P_)}function P_(){if(!P8())return;const t=Fe.onpopstate;Fe.onpopstate=function(...n){const r=Fe.location.href,o=Qc;if(Qc=r,mr("history",{from:o,to:r}),t)try{return t.apply(this,n)}catch{}};function e(n){return function(...r){const o=r.length>2?r[2]:void 0;if(o){const i=Qc,a=String(o);Qc=a,mr("history",{from:i,to:a})}return n.apply(this,r)}}nr(Fe.history,"pushState",e),nr(Fe.history,"replaceState",e)}const Jc={};function k_(t){const e=Jc[t];if(e)return e;let n=Fe[t];if(Td(n))return Jc[t]=n.bind(Fe);const r=Fe.document;if(r&&typeof r.createElement=="function")try{const o=r.createElement("iframe");o.hidden=!0,r.head.appendChild(o);const i=o.contentWindow;i&&i[t]&&(n=i[t]),r.head.removeChild(o)}catch(o){rr&&Ie.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return n&&(Jc[t]=n.bind(Fe))}function lm(t){Jc[t]=void 0}const Xi="__sentry_xhr_v3__";function dm(t){const e="xhr";Io(e,t),To(e,B_)}function B_(){if(!Fe.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){const o=Gn()*1e3,i=zr(r[0])?r[0].toUpperCase():void 0,a=N_(r[1]);if(!i||!a)return e.apply(n,r);n[Xi]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const s=()=>{const c=n[Xi];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:Gn()*1e3,startTimestamp:o,xhr:n};mr("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,d){return s(),c.apply(u,d)}}):n.addEventListener("readystatechange",s),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,d){const[h,f]=d,p=u[Xi];return p&&zr(h)&&zr(f)&&(p.request_headers[h.toLowerCase()]=f),c.apply(u,d)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const o=n[Xi];if(!o)return e.apply(n,r);r[0]!==void 0&&(o.body=r[0]);const i={startTimestamp:Gn()*1e3,xhr:n};return mr("xhr",i),e.apply(n,r)}})}function N_(t){if(zr(t))return t;try{return t.toString()}catch{}}const uf=[],Zc=new Map;function R_(){if(of()&&qn){const e=D_();return()=>{e()}}return()=>{}}const fm={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"};function D_(){return X5(({metric:t})=>{if(t.value==null)return;const e=t.entries.find(l=>l.duration===t.value&&fm[l.name]);if(!e)return;const{interactionId:n}=e,r=fm[e.name],o=qt(qn+e.startTime),i=qt(t.value),a=Bn(),s=a?On(a):void 0,u=(n!=null?Zc.get(n):void 0)||s,d=u?mt(u).description:on().getScopeData().transactionName,h=Qo(e.target),f=xn({[an]:"auto.http.browser.inp",[ko]:`ui.interaction.${r}`,[Ud]:e.duration}),p=im({name:h,transaction:d,attributes:f,startTime:o});Zr([p,"optionalAccess",l=>l.addEvent,"call",l=>l("inp",{[Vc]:"millisecond",[Uc]:t.value})]),Zr([p,"optionalAccess",l=>l.end,"call",l=>l(o+i)])})}function M_(t){const e=({entries:n})=>{const r=Bn(),o=r&&On(r);n.forEach(i=>{if(!r_(i)||!o)return;const a=i.interactionId;if(a!=null&&!Zc.has(a)){if(uf.length>10){const s=uf.shift();Zc.delete(s)}uf.push(a),Zc.set(a,o)}})};cs("event",e),cs("first-input",e)}function L_(t,e=k_("fetch")){let n=0,r=0;function o(i){const a=i.body.length;n+=a,r++;const s={body:i.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};if(!e)return lm("fetch"),Mc("No fetch implementation available");try{return e(t.url,s).then(c=>(n-=a,r--,{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}))}catch(c){return lm("fetch"),n-=a,r--,Mc(c)}}return FC(t,o)}const F_=30,j_=50;function lf(t,e,n,r){const o={filename:t,function:e==="<anonymous>"?Jo:e,in_app:!0};return n!==void 0&&(o.lineno=n),r!==void 0&&(o.colno=r),o}const V_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,U_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,G_=/\((\S*)(?::(\d+))(?::(\d+))\)/,q_=[F_,t=>{const e=V_.exec(t);if(e){const[,r,o,i]=e;return lf(r,Jo,+o,+i)}const n=U_.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){const a=G_.exec(n[2]);a&&(n[2]=a[1],n[3]=a[2],n[4]=a[3])}const[o,i]=hm(n[1]||Jo,n[2]);return lf(i,o,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}}],H_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,$_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Y_=UE(...[q_,[j_,t=>{const e=H_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const i=$_.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],o=e[1]||Jo;return[o,r]=hm(o,r),lf(r,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}]]),hm=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:Jo,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},eu=1024,W_="Breadcrumbs",K_=(t={})=>{const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:W_,setup(n){e.console&&qE(Q_(n)),e.dom&&S_(X_(n,e.dom)),e.xhr&&dm(J_(n)),e.fetch&&V0(Z_(n)),e.history&&um(eA(n)),e.sentry&&n.on("beforeSendEvent",z_(n))}}};function z_(t){return function(n){Tt()===t&&ii({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:xo(n)},{event:n})}}function X_(t,e){return function(r){if(Tt()!==t)return;let o,i,a=typeof e=="object"?e.serializeAttribute:void 0,s=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;s&&s>eu&&(no&&Ie.warn(`\`dom.maxStringLength\` cannot exceed ${eu}, but a value of ${s} was configured. Sentry will use ${eu} instead.`),s=eu),typeof a=="string"&&(a=[a]);try{const u=r.event,d=tA(u)?u.target:u;o=Qo(d,{keyAttrs:a,maxStringLength:s}),i=x0(d)}catch{o="<unknown>"}if(o.length===0)return;const c={category:`ui.${r.name}`,message:o};i&&(c.data={"ui.component_name":i}),ii(c,{event:r.event,name:r.name,global:r.global})}}function Q_(t){return function(n){if(Tt()!==t)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:u8(n.level),message:A0(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${A0(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;ii(r,{input:n.args,level:n.level})}}function J_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n,i=n.xhr[Xi];if(!r||!o||!i)return;const{method:a,url:s,status_code:c,body:u}=i,d={method:a,url:s,status_code:c},h={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:o},f=T0(c);ii({category:"xhr",data:d,type:"http",level:f},h)}}function Z_(t){return function(n){if(Tt()!==t)return;const{startTimestamp:r,endTimestamp:o}=n;if(o&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const i=n.fetchData,a={data:n.error,input:n.args,startTimestamp:r,endTimestamp:o};ii({category:"fetch",data:i,level:"error",type:"http"},a)}else{const i=n.response,a={...n.fetchData,status_code:i&&i.status},s={input:n.args,response:i,startTimestamp:r,endTimestamp:o},c=T0(a.status_code);ii({category:"fetch",data:a,type:"http",level:c},s)}}}function eA(t){return function(n){if(Tt()!==t)return;let r=n.from,o=n.to;const i=ei(Ze.location.href);let a=r?ei(r):void 0;const s=ei(o);(!a||!a.path)&&(a=i),i.protocol===s.protocol&&i.host===s.host&&(o=s.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),ii({category:"navigation",data:{from:r,to:o}})}}function tA(t){return!!t&&!!t.target}const nA=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],rA="BrowserApiErrors",oA=(t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...t};return{name:rA,setupOnce(){e.setTimeout&&nr(Ze,"setTimeout",pm),e.setInterval&&nr(Ze,"setInterval",pm),e.requestAnimationFrame&&nr(Ze,"requestAnimationFrame",iA),e.XMLHttpRequest&&"XMLHttpRequest"in Ze&&nr(XMLHttpRequest.prototype,"send",aA);const n=e.eventTarget;n&&(Array.isArray(n)?n:nA).forEach(sA)}}};function pm(t){return function(...e){const n=e[0];return e[0]=$i(n,{mechanism:{data:{function:Qr(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function iA(t){return function(e){return t.apply(this,[$i(e,{mechanism:{data:{function:"requestAnimationFrame",handler:Qr(t)},handled:!1,type:"instrument"}})])}}function aA(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in n&&typeof n[o]=="function"&&nr(n,o,function(i){const a={mechanism:{data:{function:o,handler:Qr(i)},handled:!1,type:"instrument"}},s=_d(i);return s&&(a.mechanism.data.handler=Qr(s)),$i(i,a)})}),t.apply(this,e)}}function sA(t){const e=Ze,n=e[t]&&e[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(nr(n,"addEventListener",function(r){return function(o,i,a){try{typeof i.handleEvent=="function"&&(i.handleEvent=$i(i.handleEvent,{mechanism:{data:{function:"handleEvent",handler:Qr(i),target:t},handled:!1,type:"instrument"}}))}catch{}return r.apply(this,[o,$i(i,{mechanism:{data:{function:"addEventListener",handler:Qr(i),target:t},handled:!1,type:"instrument"}}),a])}}),nr(n,"removeEventListener",function(r){return function(o,i,a){const s=i;try{const c=s&&s.__sentry_wrapped__;c&&r.call(this,o,c,a)}catch{}return r.call(this,o,s,a)}}))}const cA="GlobalHandlers",uA=(t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:cA,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(lA(n),gm("onerror")),e.onunhandledrejection&&(dA(n),gm("onunhandledrejection"))}}};function lA(t){q0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const{msg:o,url:i,line:a,column:s,error:c}=e,u=pA(Xd(n,c||o,void 0,r,!1),i,a,s);u.level="error",kg(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function dA(t){H0(e=>{const{stackParser:n,attachStacktrace:r}=mm();if(Tt()!==t||Hg())return;const o=fA(e),i=wd(o)?hA(o):Xd(n,o,void 0,r,!0);i.level="error",kg(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function fA(t){if(wd(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function hA(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function pA(t,e,n,r){const o=t.exception=t.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},c=s.frames=s.frames||[],u=isNaN(parseInt(r,10))?void 0:r,d=isNaN(parseInt(n,10))?void 0:n,h=zr(e)&&e.length>0?e:OE();return c.length===0&&c.push({colno:u,filename:h,function:Jo,in_app:!0,lineno:d}),t}function gm(t){no&&Ie.log(`Global Handler attached: ${t}`)}function mm(){const t=Tt();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const gA=()=>({name:"HttpContext",preprocessEvent(t){if(!Ze.navigator&&!Ze.location&&!Ze.document)return;const e=t.request&&t.request.url||Ze.location&&Ze.location.href,{referrer:n}=Ze.document||{},{userAgent:r}=Ze.navigator||{},o={...t.request&&t.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},i={...t.request,...e&&{url:e},headers:o};t.request=i}}),mA="cause",yA=5,vA="LinkedErrors",wA=(t={})=>{const e=t.limit||yA,n=t.key||mA;return{name:vA,preprocessEvent(r,o,i){const a=i.getOptions();SE(Wd,a.stackParser,a.maxValueLength,n,e,r,o)}}};function bA(t){return[$C(),GC(),oA(),K_(),uA(),wA(),r5(),gA()]}const ym=new WeakMap,df=new Map,ff={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0};function EA(t,e){const{traceFetch:n,traceXHR:r,shouldCreateSpanForRequest:o,enableHTTPTimings:i,tracePropagationTargets:a}={traceFetch:ff.traceFetch,traceXHR:ff.traceXHR,...e},s=typeof o=="function"?o:d=>!0,c=d=>SA(d,a),u={};n&&(t.addEventProcessor(d=>(d.type==="transaction"&&d.spans&&d.spans.forEach(h=>{if(h.op==="http.client"){const f=df.get(h.span_id);f&&(h.timestamp=f/1e3,df.delete(h.span_id))}}),d)),KE(d=>{if(d.response){const h=ym.get(d.response);h&&d.endTimestamp&&df.set(h,d.endTimestamp)}}),V0(d=>{const h=s5(d,s,c,u);if(d.response&&d.fetchData.__span&&ym.set(d.response,d.fetchData.__span),h){const f=wm(d.fetchData.url),p=f?ei(f).host:void 0;h.setAttributes({"http.url":f,"server.address":p})}i&&h&&vm(h)})),r&&dm(d=>{const h=IA(d,s,c,u);i&&h&&vm(h)})}function CA(t){return t.entryType==="resource"&&"initiatorType"in t&&typeof t.nextHopProtocol=="string"&&(t.initiatorType==="fetch"||t.initiatorType==="xmlhttprequest")}function vm(t){const{url:e}=mt(t).data||{};if(!e||typeof e!="string")return;const n=cs("resource",({entries:r})=>{r.forEach(o=>{CA(o)&&o.name.endsWith(e)&&(AA(o).forEach(a=>t.setAttribute(...a)),setTimeout(n))})})}function _A(t){let e="unknown",n="unknown",r="";for(const o of t){if(o==="/"){[e,n]=t.split("/");break}if(!isNaN(Number(o))){e=r==="h"?"http":r,n=t.split(r)[1];break}r+=o}return r===t&&(e=r),{name:e,version:n}}function jr(t=0){return((qn||performance.timeOrigin)+t)/1e3}function AA(t){const{name:e,version:n}=_A(t.nextHopProtocol),r=[];return r.push(["network.protocol.version",n],["network.protocol.name",e]),qn?[...r,["http.request.redirect_start",jr(t.redirectStart)],["http.request.fetch_start",jr(t.fetchStart)],["http.request.domain_lookup_start",jr(t.domainLookupStart)],["http.request.domain_lookup_end",jr(t.domainLookupEnd)],["http.request.connect_start",jr(t.connectStart)],["http.request.secure_connection_start",jr(t.secureConnectionStart)],["http.request.connection_end",jr(t.connectEnd)],["http.request.request_start",jr(t.requestStart)],["http.request.response_start",jr(t.responseStart)],["http.request.response_end",jr(t.responseEnd)]]:r}function SA(t,e){const n=Ze.location&&Ze.location.href;if(n){let r,o;try{r=new URL(t,n),o=new URL(n).origin}catch{return!1}const i=r.origin===o;return e?zo(r.toString(),e)||i&&zo(r.pathname,e):i}else{const r=!!t.match(/^\/(?!\/)/);return e?zo(t,e):r}}function IA(t,e,n,r){const o=t.xhr,i=o&&o[Xi];if(!o||o.__sentry_own_request__||!i)return;const a=to()&&e(i.url);if(t.endTimestamp&&a){const f=o.__sentry_xhr_span_id__;if(!f)return;const p=r[f];p&&i.status_code!==void 0&&(og(p,i.status_code),p.end(),delete r[f]);return}const s=wm(i.url),c=s?ei(s).host:void 0,u=!!Bn(),d=a&&u?Bo({name:`${i.method} ${i.url}`,attributes:{type:"xhr","http.method":i.method,"http.url":s,url:i.url,"server.address":c,[an]:"auto.http.browser",[ko]:"http.client"}}):new Hi;o.__sentry_xhr_span_id__=d.spanContext().spanId,r[o.__sentry_xhr_span_id__]=d;const h=Tt();return o.setRequestHeader&&n(i.url)&&h&&TA(o,h,to()&&u?d:void 0),d}function TA(t,e,n){const r=on(),o=qi(),{traceId:i,spanId:a,sampled:s,dsc:c}={...o.getPropagationContext(),...r.getPropagationContext()},u=n&&to()?sg(n):Bd(i,a,s),d=X0(c||(n?oi(n):qc(i,e)));xA(t,u,d)}function xA(t,e,n){try{t.setRequestHeader("sentry-trace",e),n&&t.setRequestHeader(kd,n)}catch{}}function wm(t){try{return new URL(t,Ze.location.origin).href}catch{return}}function OA(){Ze&&Ze.document?Ze.document.addEventListener("visibilitychange",()=>{const t=Bn();if(!t)return;const e=On(t);if(Ze.document.hidden&&e){const n="cancelled",{op:r,status:o}=mt(e);no&&Ie.log(`[Tracing] Transaction: ${n} -> since tab moved to the background, op: ${r}`),o||e.setStatus({code:hn,message:n}),e.setAttribute("sentry.cancellation_reason","document.hidden"),e.end()}}):no&&Ie.warn("[Tracing] Could not set up background tab detection due to lack of global document")}const PA="BrowserTracing",kA={...Hc,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,_experiments:{},...ff},BA=(t={})=>{K8();const{enableInp:e,enableLongTask:n,enableLongAnimationFrame:r,_experiments:{enableInteractions:o,enableStandaloneClsSpans:i},beforeStartSpan:a,idleTimeout:s,finalTimeout:c,childSpanTimeout:u,markBackgroundSpan:d,traceFetch:h,traceXHR:f,shouldCreateSpanForRequest:p,enableHTTPTimings:l,instrumentPageLoad:g,instrumentNavigation:m}={...kA,...t},y=c_({recordClsStandaloneSpans:i||!1});e&&R_(),r&&gt.PerformanceObserver&&PerformanceObserver.supportedEntryTypes&&PerformanceObserver.supportedEntryTypes.includes("long-animation-frame")?l_():n&&u_(),o&&d_();const w={name:void 0,source:void 0};function b(E,C){const I=C.op==="pageload",T=a?a(C):C,P=T.attributes||{};C.name!==T.name&&(P[eo]="custom",T.attributes=P),w.name=T.name,w.source=P[eo];const N=Tg(T,{idleTimeout:s,finalTimeout:c,childSpanTimeout:u,disableAutoFinish:I,beforeSpanEnd:V=>{y(),m_(V,{recordClsOnPageloadSpan:!i})}});function L(){["interactive","complete"].includes(Ze.document.readyState)&&E.emit("idleSpanEnableAutoFinish",N)}return I&&Ze.document&&(Ze.document.addEventListener("readystatechange",()=>{L()}),L()),N}return{name:PA,afterAllSetup(E){let C,I=Ze.location&&Ze.location.href;E.on("startNavigationSpan",T=>{Tt()===E&&(C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end()),C=b(E,{op:"navigation",...T}))}),E.on("startPageLoadSpan",(T,P={})=>{if(Tt()!==E)return;C&&!mt(C).timestamp&&(no&&Ie.log(`[Tracing] Finishing current root span with op: ${mt(C).op}`),C.end());const N=P.sentryTrace||Em("sentry-trace"),L=P.baggage||Em("baggage"),V=m8(N,L);on().setPropagationContext(V),C=b(E,{op:"pageload",...T})}),E.on("spanEnd",T=>{const P=mt(T).op;if(T!==On(T)||P!=="navigation"&&P!=="pageload")return;const N=on(),L=N.getPropagationContext();N.setPropagationContext({...L,sampled:L.sampled!==void 0?L.sampled:ni(T),dsc:L.dsc||oi(T)})}),Ze.location&&(g&&bm(E,{name:Ze.location.pathname,startTime:qn?qn/1e3:void 0,attributes:{[eo]:"url",[an]:"auto.pageload.browser"}}),m&&um(({to:T,from:P})=>{if(P===void 0&&I&&I.indexOf(T)!==-1){I=void 0;return}P!==T&&(I=void 0,NA(E,{name:Ze.location.pathname,attributes:{[eo]:"url",[an]:"auto.navigation.browser"}}))})),d&&OA(),o&&RA(s,c,u,w),e&&M_(),EA(E,{traceFetch:h,traceXHR:f,tracePropagationTargets:E.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:p,enableHTTPTimings:l})}}};function bm(t,e,n){t.emit("startPageLoadSpan",e,n),on().setTransactionName(e.name);const r=Bn();return(r&&mt(r).op)==="pageload"?r:void 0}function NA(t,e){qi().setPropagationContext(Lc()),on().setPropagationContext(Lc()),t.emit("startNavigationSpan",e),on().setTransactionName(e.name);const n=Bn();return(n&&mt(n).op)==="navigation"?n:void 0}function Em(t){const e=PE(`meta[name=${t}]`);return e?e.getAttribute("content"):void 0}function RA(t,e,n,r){let o;const i=()=>{const a="ui.action.click",s=Bn(),c=s&&On(s);if(c){const u=mt(c).op;if(["navigation","pageload"].includes(u)){no&&Ie.warn(`[Tracing] Did not create ${a} span because a pageload or navigation span is in progress.`);return}}if(o&&(o.setAttribute(Vd,"interactionInterrupted"),o.end(),o=void 0),!r.name){no&&Ie.warn(`[Tracing] Did not create ${a} transaction because _latestRouteName is missing.`);return}o=Tg({name:r.name,op:a,attributes:{[eo]:r.source||"url"}},{idleTimeout:t,finalTimeout:e,childSpanTimeout:n})};Ze.document&&addEventListener("click",i,{once:!1,capture:!0})}var hf={exports:{}},wt={};/** @license React v16.13.1
122
122
  * react-is.production.min.js
123
123
  *
124
124
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -132,8 +132,8 @@ Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllCha
132
132
  *
133
133
  * This source code is licensed under the MIT license found in the
134
134
  * LICENSE file in the root directory of this source tree.
135
- */var _m;function MA(){return _m||(_m=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,l=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function b(B){return typeof B=="string"||typeof B=="function"||B===r||B===u||B===i||B===o||B===h||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===l||B.$$typeof===p||B.$$typeof===a||B.$$typeof===s||B.$$typeof===d||B.$$typeof===m||B.$$typeof===y||B.$$typeof===w||B.$$typeof===g)}function E(B){if(typeof B=="object"&&B!==null){var Q=B.$$typeof;switch(Q){case e:var Z=B.type;switch(Z){case c:case u:case r:case i:case o:case h:return Z;default:var ee=Z&&Z.$$typeof;switch(ee){case s:case d:case l:case p:case a:return ee;default:return Q}}case n:return Q}}}var C=c,I=u,T=s,P=a,N=e,L=d,V=r,j=l,W=p,q=n,k=i,U=o,z=h,te=!1;function oe(B){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ne(B)||E(B)===c}function ne(B){return E(B)===u}function se(B){return E(B)===s}function we(B){return E(B)===a}function le(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function _e(B){return E(B)===d}function ve(B){return E(B)===r}function H(B){return E(B)===l}function $(B){return E(B)===p}function J(B){return E(B)===n}function S(B){return E(B)===i}function M(B){return E(B)===o}function F(B){return E(B)===h}bt.AsyncMode=C,bt.ConcurrentMode=I,bt.ContextConsumer=T,bt.ContextProvider=P,bt.Element=N,bt.ForwardRef=L,bt.Fragment=V,bt.Lazy=j,bt.Memo=W,bt.Portal=q,bt.Profiler=k,bt.StrictMode=U,bt.Suspense=z,bt.isAsyncMode=oe,bt.isConcurrentMode=ne,bt.isContextConsumer=se,bt.isContextProvider=we,bt.isElement=le,bt.isForwardRef=_e,bt.isFragment=ve,bt.isLazy=H,bt.isMemo=$,bt.isPortal=J,bt.isProfiler=S,bt.isStrictMode=M,bt.isSuspense=F,bt.isValidElementType=b,bt.typeOf=E}()),bt}process.env.NODE_ENV==="production"?hf.exports=DA():hf.exports=MA();var LA=hf.exports,Am=LA,FA={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sm={};Sm[Am.ForwardRef]=FA,Sm[Am.Memo]=jA;const VA=new WeakSet;function UA(t){const e=BA({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:o,createRoutesFromChildren:i,matchRoutes:a,stripBasename:s,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=t;return{...e,setup(){},afterAllSetup(d){e.afterAllSetup(d);const h=et&&et.location&&et.location.pathname;c&&h&&bm(d,{name:h,attributes:{[eo]:"url",[ko]:"pageload",[an]:"auto.pageload.react.reactrouter_v6"}}),u&&VA.add(d)}}}function GA(){const{t}=Ue(),[e,n]=x.useState(!1);return v.jsx("div",{className:"default-bg-colors flex h-screen items-center justify-center",children:v.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-300 bg-white shadow-lg",children:[v.jsx("div",{className:"border-b border-gray-200 bg-gray-50 px-6 pb-3 pt-4 shadow",children:v.jsx("h2",{className:"text-3xl",children:"Oops!"})}),v.jsx("p",{className:"mt-4 px-6 text-gray-900",children:t("sorrySomethingWentWrong")}),v.jsx("div",{className:"mt-10 p-6",children:v.jsx(Ze,{onClick:()=>{n(!0),window.location.replace("/")},pending:e,label:t("back")})})]})})}class qA extends x.Component{constructor(e){super(e),this.state={hasError:!1,scope:void 0}}componentDidMount(){const e=bA().filter(o=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(o.name)),n=new S5({dsn:"https://5b16c396f6e8f6e4b0b87455bea7e96b@o80526.ingest.us.sentry.io/4507345428283392",transport:L_,stackParser:Y_,integrations:[...e,UA({useEffect:x.useEffect,useLocation:er,useNavigationType:k3,createRoutesFromChildren:nc,matchRoutes:L1})]}),r=new Po;r.setClient(n),n.init(),this.setState({...this.state,scope:r})}componentDidCatch(e,n){console.error("ErrorBoundary: ",e,n),this.state.scope.captureException(e),this.setState({...this.state,hasError:!0})}render(){return this.state.hasError?v.jsx(GA,{}):this.props.children}}function je(){const t=x.useContext(sh);if(!t)throw new Error("Only use 'usePortalSessionContext' within a PortalSessionProvider");return t}const HA={[Kt.GENERIC]:Le.GENERIC,[Kt.PORTAL]:Le.PORTAL,[Kt.POINTS_TRANSACTION]:Le.POINTS_TRANSACTION,[Kt.PREPAID]:Le.PREPAID,[Kt.PAY_PREPAID]:Le.PREPAID,[Kt.TOP_UP_PREPAID]:Le.PREPAID,[Kt.VOUCHER]:Le.VOUCHER,[Kt.GIFTCARD]:Le.GIFTCARD,[Kt.REDEEM_GIFTCARD]:Le.GIFTCARD,[Kt.TOP_UP_GIFTCARD]:Le.GIFTCARD};function $A(){const{portalSession:t}=je();return v.jsx(dr,{to:HA[t.type]})}function si({onSubmit:t,children:e}){const n=r=>{r.preventDefault(),t&&t(r)};return v.jsx("form",{onSubmit:n,children:e})}const Im=x.createContext({cameraService:1,cameraFacingMode:vn.USER,primaryIdentificationMethod:Ci.IDENTIFIER});function Xt(){const t=x.useContext(Im);if(!t)throw new Error("Only use 'useConfigurationContext' within a ConfigurationContext Provider");return t}var Tm={},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.compactObject=km,Hn.deprecated=e7;var YA=Hn.detectBrowser=t7;Hn.disableLog=QA,Hn.disableWarnings=JA,Hn.extractVersion=tu,Hn.filterStats=n7,Hn.log=ZA,Hn.walkStats=nu,Hn.wrapPeerConnectionEvent=XA;function WA(t,e,n){return e=KA(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KA(t){var e=zA(t,"string");return No(e)=="symbol"?e:e+""}function zA(t,e){if(No(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(No(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function No(t){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(t)}var xm=!0,Om=!0;function tu(t,e,n){var r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function XA(t,e,n){if(t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(a,s){if(a!==e)return o.apply(this,arguments);var c=function(d){var h=n(d);h&&(s.handleEvent?s.handleEvent(h):s(h))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(s,c),o.apply(this,[a,c])};var i=r.removeEventListener;r.removeEventListener=function(a,s){if(a!==e||!this._eventMap||!this._eventMap[e])return i.apply(this,arguments);if(!this._eventMap[e].has(s))return i.apply(this,arguments);var c=this._eventMap[e].get(s);return this._eventMap[e].delete(s),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,i.apply(this,[a,c])},Object.defineProperty(r,"on"+e,{get:function(){return this["_on"+e]},set:function(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}}function QA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(xm=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function JA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(Om=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function ZA(){if((typeof window>"u"?"undefined":No(window))==="object"){if(xm)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function e7(t,e){Om&&console.warn(t+" is deprecated, please use "+e+" instead.")}function t7(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var n=t.navigator;if(n.userAgentData&&n.userAgentData.brands){var r=n.userAgentData.brands.find(function(o){return o.brand==="Chromium"});if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(n.mozGetUserMedia)e.browser="firefox",e.version=tu(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=tu(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=tu(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Pm(t){return Object.prototype.toString.call(t)==="[object Object]"}function km(t){return Pm(t)?Object.keys(t).reduce(function(e,n){var r=Pm(t[n]),o=r?km(t[n]):t[n],i=r&&!Object.keys(o).length;return o===void 0||i?e:Object.assign(e,WA({},n,o))},{}):t}function nu(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(function(r){r.endsWith("Id")?nu(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(function(o){nu(t,t.get(o),n)})}))}function n7(t,e,n){var r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(e===null)return o;var i=[];return t.forEach(function(a){a.type==="track"&&a.trackIdentifier===e.id&&i.push(a)}),i.forEach(function(a){t.forEach(function(s){s.type===r&&s.trackId===a.id&&nu(t,s,o)})}),o}Object.defineProperty(Tm,"__esModule",{value:!0});var r7=Tm.shimGetUserMedia=a7,o7=i7(Hn);function Bm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Bm=function(o){return o?n:e})(t)}function i7(t,e){if(t&&t.__esModule)return t;if(t===null||Ro(t)!="object"&&typeof t!="function")return{default:t};var n=Bm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Ro(t){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(t)}var Nm=o7.log;function a7(t,e){var n=t&&t.navigator;if(n.mediaDevices){var r=function(u){if(Ro(u)!=="object"||u.mandatory||u.optional)return u;var d={};return Object.keys(u).forEach(function(h){if(!(h==="require"||h==="advanced"||h==="mediaSource")){var f=Ro(u[h])==="object"?u[h]:{ideal:u[h]};f.exact!==void 0&&typeof f.exact=="number"&&(f.min=f.max=f.exact);var p=function(m,y){return m?m+y.charAt(0).toUpperCase()+y.slice(1):y==="deviceId"?"sourceId":y};if(f.ideal!==void 0){d.optional=d.optional||[];var l={};typeof f.ideal=="number"?(l[p("min",h)]=f.ideal,d.optional.push(l),l={},l[p("max",h)]=f.ideal,d.optional.push(l)):(l[p("",h)]=f.ideal,d.optional.push(l))}f.exact!==void 0&&typeof f.exact!="number"?(d.mandatory=d.mandatory||{},d.mandatory[p("",h)]=f.exact):["min","max"].forEach(function(g){f[g]!==void 0&&(d.mandatory=d.mandatory||{},d.mandatory[p(g,h)]=f[g])})}}),u.advanced&&(d.optional=(d.optional||[]).concat(u.advanced)),d},o=function(u,d){if(e.version>=61)return d(u);if(u=JSON.parse(JSON.stringify(u)),u&&Ro(u.audio)==="object"){var h=function(m,y,w){y in m&&!(w in m)&&(m[w]=m[y],delete m[y])};u=JSON.parse(JSON.stringify(u)),h(u.audio,"autoGainControl","googAutoGainControl"),h(u.audio,"noiseSuppression","googNoiseSuppression"),u.audio=r(u.audio)}if(u&&Ro(u.video)==="object"){var f=u.video.facingMode;f=f&&(Ro(f)==="object"?f:{ideal:f});var p=e.version<66;if(f&&(f.exact==="user"||f.exact==="environment"||f.ideal==="user"||f.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!p)){delete u.video.facingMode;var l;if(f.exact==="environment"||f.ideal==="environment"?l=["back","rear"]:(f.exact==="user"||f.ideal==="user")&&(l=["front"]),l)return n.mediaDevices.enumerateDevices().then(function(g){g=g.filter(function(y){return y.kind==="videoinput"});var m=g.find(function(y){return l.some(function(w){return y.label.toLowerCase().includes(w)})});return!m&&g.length&&l.includes("back")&&(m=g[g.length-1]),m&&(u.video.deviceId=f.exact?{exact:m.deviceId}:{ideal:m.deviceId}),u.video=r(u.video),Nm("chrome: "+JSON.stringify(u)),d(u)})}u.video=r(u.video)}return Nm("chrome: "+JSON.stringify(u)),d(u)},i=function(u){return e.version>=64?u:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[u.name]||u.name,message:u.message,constraint:u.constraint||u.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},a=function(u,d,h){o(u,function(f){n.webkitGetUserMedia(f,d,function(p){h&&h(i(p))})})};if(n.getUserMedia=a.bind(n),n.mediaDevices.getUserMedia){var s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return o(c,function(u){return s(u).then(function(d){if(u.audio&&!d.getAudioTracks().length||u.video&&!d.getVideoTracks().length)throw d.getTracks().forEach(function(h){h.stop()}),new DOMException("","NotFoundError");return d},function(d){return Promise.reject(i(d))})})}}}}var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0});var s7=Rm.shimGetUserMedia=l7,c7=u7(Hn);function Dm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Dm=function(o){return o?n:e})(t)}function u7(t,e){if(t&&t.__esModule)return t;if(t===null||Qi(t)!="object"&&typeof t!="function")return{default:t};var n=Dm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Qi(t){"@babel/helpers - typeof";return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(t)}function l7(t,e){var n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(c,u,d){c7.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(c).then(u,d)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var o=function(u,d,h){d in u&&!(h in u)&&(u[h]=u[d],delete u[d])},i=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(c){return Qi(c)==="object"&&Qi(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c.audio,"autoGainControl","mozAutoGainControl"),o(c.audio,"noiseSuppression","mozNoiseSuppression")),i(c)},r&&r.prototype.getSettings){var a=r.prototype.getSettings;r.prototype.getSettings=function(){var c=a.apply(this,arguments);return o(c,"mozAutoGainControl","autoGainControl"),o(c,"mozNoiseSuppression","noiseSuppression"),c}}if(r&&r.prototype.applyConstraints){var s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(c){return this.kind==="audio"&&Qi(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c,"autoGainControl","mozAutoGainControl"),o(c,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[c])}}}}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.shimAudioContext=b7,Vr.shimCallbacksAPI=g7,Vr.shimConstraints=Fm,Vr.shimCreateOfferLegacy=w7;var d7=Vr.shimGetUserMedia=m7;Vr.shimLocalStreamsAPI=h7,Vr.shimRTCIceServerUrls=y7,Vr.shimRemoteStreamsAPI=p7,Vr.shimTrackEventTransceiver=v7;var Mm=f7(Hn);function Lm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Lm=function(o){return o?n:e})(t)}function f7(t,e){if(t&&t.__esModule)return t;if(t===null||Do(t)!="object"&&typeof t!="function")return{default:t};var n=Lm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Do(t){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Do(t)}function h7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){var o=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(function(i){return e.call(o,i,r)}),r.getVideoTracks().forEach(function(i){return e.call(o,i,r)})},t.RTCPeerConnection.prototype.addTrack=function(r){for(var o=this,i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return a&&a.forEach(function(c){o._localStreams?o._localStreams.includes(c)||o._localStreams.push(c):o._localStreams=[c]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(r){var o=this;this._localStreams||(this._localStreams=[]);var i=this._localStreams.indexOf(r);if(i!==-1){this._localStreams.splice(i,1);var a=r.getTracks();this.getSenders().forEach(function(s){a.includes(s.track)&&o.removeTrack(s)})}})}}function p7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(r){var o=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=r),this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(function(a){if(o._remoteStreams||(o._remoteStreams=[]),!o._remoteStreams.includes(a)){o._remoteStreams.push(a);var s=new Event("addstream");s.stream=a,o.dispatchEvent(s)}})})}});var e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(o){o.streams.forEach(function(i){if(r._remoteStreams||(r._remoteStreams=[]),!(r._remoteStreams.indexOf(i)>=0)){r._remoteStreams.push(i);var a=new Event("addstream");a.stream=i,r.dispatchEvent(a)}})}),e.apply(r,arguments)}}}function g7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,o=e.setLocalDescription,i=e.setRemoteDescription,a=e.addIceCandidate;e.createOffer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=n.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f},e.createAnswer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=r.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f};var s=function(u,d,h){var f=o.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f};e.setLocalDescription=s,s=function(u,d,h){var f=i.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.setRemoteDescription=s,s=function(u,d,h){var f=a.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.addIceCandidate=s}}function m7(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=function(o){return r(Fm(o))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(i,a,s){e.mediaDevices.getUserMedia(i).then(a,s)}).bind(e))}function Fm(t){return t&&t.video!==void 0?Object.assign({},t,{video:Mm.compactObject(t.video)}):t}function y7(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,o){if(r&&r.iceServers){for(var i=[],a=0;a<r.iceServers.length;a++){var s=r.iceServers[a];s.urls===void 0&&s.url?(Mm.deprecated("RTCIceServer.url","RTCIceServer.urls"),s=JSON.parse(JSON.stringify(s)),s.urls=s.url,delete s.url,i.push(s)):i.push(r.iceServers[a])}r.iceServers=i}return new e(r,o)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:function(){return e.generateCertificate}})}}function v7(t){Do(t)==="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function w7(t){var e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);var o=this.getTransceivers().find(function(a){return a.receiver.track.kind==="audio"});r.offerToReceiveAudio===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveAudio===!0&&!o&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);var i=this.getTransceivers().find(function(a){return a.receiver.track.kind==="video"});r.offerToReceiveVideo===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveVideo===!0&&!i&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function b7(t){Do(t)!=="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var jm=t=>{throw TypeError(t)},Vm=(t,e,n)=>e.has(t)||jm("Cannot "+n),E7=(t,e,n)=>(Vm(t,e,"read from private field"),n?n.call(t):e.get(t)),C7=(t,e,n)=>e.has(t)?jm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),_7=(t,e,n,r)=>(Vm(t,e,"write to private field"),e.set(t,n),n);const Um=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function A7(t){return t.join("|")}function S7(t){const e=Gm(t);let n=0,r=Um.length-1;for(;n<=r;){const o=Math.floor((n+r)/2),i=Um[o],a=Gm(i);if(a===e)return i;a<e?n=o+1:r=o-1}return"None"}function Gm(t){return t.toLowerCase().replace(/_-\[\]/g,"")}function I7(t,e){return t.Binarizer[e]}function T7(t,e){return t.CharacterSet[e]}const x7=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function O7(t){return x7[t.value]}function P7(t,e){return t.EanAddOnSymbol[e]}function k7(t,e){return t.TextMode[e]}const Ji={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function qm(t,e){return{...e,formats:A7(e.formats),binarizer:I7(t,e.binarizer),eanAddOnSymbol:P7(t,e.eanAddOnSymbol),textMode:k7(t,e.textMode),characterSet:T7(t,e.characterSet)}}function Hm(t){return{...t,format:S7(t.format),eccLevel:t.eccLevel,contentType:O7(t.contentType)}}const B7={locateFile:(t,e)=>{const n=t.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${n[1]}/${t}`:e+t}};let $m=new WeakMap;function pf(t,e){var n;const r=$m.get(t);if(r!=null&&r.modulePromise&&e===void 0)return r.modulePromise;const o=(n=r==null?void 0:r.moduleOverrides)!=null?n:B7,i=t({...o});return $m.set(t,{moduleOverrides:o,modulePromise:i}),i}async function N7(t,e,n=Ji){const r={...Ji,...n},o=await pf(t),{size:i}=e,a=new Uint8Array(await e.arrayBuffer()),s=o._malloc(i);o.HEAPU8.set(a,s);const c=o.readBarcodesFromImage(s,i,qm(o,r));o._free(s);const u=[];for(let d=0;d<c.size();++d)u.push(Hm(c.get(d)));return u}async function R7(t,e,n=Ji){const r={...Ji,...n},o=await pf(t),{data:i,width:a,height:s,data:{byteLength:c}}=e,u=o._malloc(c);o.HEAPU8.set(i,u);const d=o.readBarcodesFromPixmap(u,a,s,qm(o,r));o._free(u);const h=[];for(let f=0;f<d.size();++f)h.push(Hm(d.get(f)));return h}({...Ji,formats:[...Ji.formats]});var gf=(()=>{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(n={}){var r,o=n,i,a,s=new Promise((_,A)=>{i=_,a=A}),c=typeof window=="object",u=typeof Bun<"u",d=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var h=Object.assign({},o),f="./this.program",p="";function l(_){return o.locateFile?o.locateFile(_,p):p+_}var g,m;if(c||d||u){var y;d?p=self.location.href:typeof document<"u"&&((y=document.currentScript)===null||y===void 0?void 0:y.tagName.toUpperCase())==="SCRIPT"&&(p=document.currentScript.src),e&&(p=e),p.startsWith("blob:")?p="":p=p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),d&&(m=_=>{var A=new XMLHttpRequest;return A.open("GET",_,!1),A.responseType="arraybuffer",A.send(null),new Uint8Array(A.response)}),g=_=>fetch(_,{credentials:"same-origin"}).then(A=>A.ok?A.arrayBuffer():Promise.reject(new Error(A.status+" : "+A.url)))}var w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,h),h=null,o.arguments&&o.arguments,o.thisProgram&&(f=o.thisProgram);var E=o.wasmBinary,C,I=!1,T,P,N,L,V,j,W,q;function k(){var _=C.buffer;o.HEAP8=T=new Int8Array(_),o.HEAP16=N=new Int16Array(_),o.HEAPU8=P=new Uint8Array(_),o.HEAPU16=L=new Uint16Array(_),o.HEAP32=V=new Int32Array(_),o.HEAPU32=j=new Uint32Array(_),o.HEAPF32=W=new Float32Array(_),o.HEAPF64=q=new Float64Array(_)}var U=[],z=[],te=[];function oe(){var _=o.preRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(we)),fe(U)}function ne(){fe(z)}function se(){var _=o.postRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(_e)),fe(te)}function we(_){U.unshift(_)}function le(_){z.unshift(_)}function _e(_){te.unshift(_)}var ve=0,H=null;function $(_){var A;ve++,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve)}function J(_){var A;if(ve--,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve),ve==0&&H){var O=H;H=null,O()}}function S(_){var A;(A=o.onAbort)===null||A===void 0||A.call(o,_),_="Aborted("+_+")",b(_),I=!0,_+=". Build with -sASSERTIONS for more info.";var O=new WebAssembly.RuntimeError(_);throw a(O),O}var M="data:application/octet-stream;base64,",F=_=>_.startsWith(M);function B(){var _="zxing_reader.wasm";return F(_)?_:l(_)}var Q;function Z(_){if(_==Q&&E)return new Uint8Array(E);if(m)return m(_);throw"both async and sync fetching of the wasm failed"}function ee(_){return E?Promise.resolve().then(()=>Z(_)):g(_).then(A=>new Uint8Array(A),()=>Z(_))}function K(_,A,O){return ee(_).then(R=>WebAssembly.instantiate(R,A)).then(O,R=>{b(`failed to asynchronously prepare wasm: ${R}`),S(R)})}function ge(_,A,O,R){return!_&&typeof WebAssembly.instantiateStreaming=="function"&&!F(A)&&typeof fetch=="function"?fetch(A,{credentials:"same-origin"}).then(G=>{var X=WebAssembly.instantiateStreaming(G,O);return X.then(R,function(ae){return b(`wasm streaming compile failed: ${ae}`),b("falling back to ArrayBuffer instantiation"),K(A,O,R)})}):K(A,O,R)}function be(){return{a:NP}}function pe(){var _,A=be();function O(G,X){return jt=G.exports,C=jt.za,k(),Ty=jt.Da,le(jt.Aa),J(),jt}$();function R(G){O(G.instance)}if(o.instantiateWasm)try{return o.instantiateWasm(A,O)}catch(G){b(`Module.instantiateWasm callback failed with error: ${G}`),a(G)}return(_=Q)!==null&&_!==void 0||(Q=B()),ge(E,Q,A,R).catch(a),{}}var fe=_=>{_.forEach(A=>A(o))};o.noExitRuntime;var ye=_=>jy(_),ue=()=>Vy(),Oe=[],ke=0,at=_=>{var A=new ht(_);return A.get_caught()||(A.set_caught(!0),ke--),A.set_rethrown(!1),Oe.push(A),Gy(_),Ly(_)},ze=0,It=()=>{tt(0,0);var _=Oe.pop();Uy(_.excPtr),ze=0};class ht{constructor(A){this.excPtr=A,this.ptr=A-24}set_type(A){j[this.ptr+4>>2]=A}get_type(){return j[this.ptr+4>>2]}set_destructor(A){j[this.ptr+8>>2]=A}get_destructor(){return j[this.ptr+8>>2]}set_caught(A){A=A?1:0,T[this.ptr+12]=A}get_caught(){return T[this.ptr+12]!=0}set_rethrown(A){A=A?1:0,T[this.ptr+13]=A}get_rethrown(){return T[this.ptr+13]!=0}init(A,O){this.set_adjusted_ptr(0),this.set_type(A),this.set_destructor(O)}set_adjusted_ptr(A){j[this.ptr+16>>2]=A}get_adjusted_ptr(){return j[this.ptr+16>>2]}}var wr=_=>{throw ze||(ze=_),ze},pt=_=>Fy(_),mn=_=>{var A=ze;if(!A)return pt(0),0;var O=new ht(A);O.set_adjusted_ptr(A);var R=O.get_type();if(!R)return pt(0),A;for(var G of _){if(G===0||G===R)break;var X=O.ptr+16;if(qy(G,R,X))return pt(G),A}return pt(R),A},Ot=()=>mn([]),De=_=>mn([_]),Pr=(_,A)=>mn([_,A]),ln=()=>{var _=Oe.pop();_||S("no exception to throw");var A=_.excPtr;throw _.get_rethrown()||(Oe.push(_),_.set_rethrown(!0),_.set_caught(!1),ke++),ze=A,ze},Dn=(_,A,O)=>{var R=new ht(_);throw R.init(A,O),ze=_,ke++,ze},Mn=()=>ke,Gr=()=>{S("")},Sn={},Ln=_=>{for(;_.length;){var A=_.pop(),O=_.pop();O(A)}};function dn(_){return this.fromWireType(j[_>>2])}var Qt={},zn={},qr={},Me,Ge=_=>{throw new Me(_)},qe=(_,A,O)=>{_.forEach(re=>qr[re]=A);function R(re){var me=O(re);me.length!==_.length&&Ge("Mismatched type converter count");for(var Ce=0;Ce<_.length;++Ce)sr(_[Ce],me[Ce])}var G=new Array(A.length),X=[],ae=0;A.forEach((re,me)=>{zn.hasOwnProperty(re)?G[me]=zn[re]:(X.push(re),Qt.hasOwnProperty(re)||(Qt[re]=[]),Qt[re].push(()=>{G[me]=zn[re],++ae,ae===X.length&&R(G)}))}),X.length===0&&R(G)},st=_=>{var A=Sn[_];delete Sn[_];var O=A.rawConstructor,R=A.rawDestructor,G=A.fields,X=G.map(ae=>ae.getterReturnType).concat(G.map(ae=>ae.setterArgumentType));qe([_],X,ae=>{var re={};return G.forEach((me,Ce)=>{var Te=me.fieldName,Be=ae[Ce],nt=me.getter,vt=me.getterContext,Rt=ae[Ce+G.length],fn=me.setter,en=me.setterContext;re[Te]={read:tn=>Be.fromWireType(nt(vt,tn)),write:(tn,yi)=>{var Fn=[];fn(en,tn,Rt.toWireType(Fn,yi)),Ln(Fn)}}}),[{name:A.name,fromWireType:me=>{var Ce={};for(var Te in re)Ce[Te]=re[Te].read(me);return R(me),Ce},toWireType:(me,Ce)=>{for(var Te in re)if(!(Te in Ce))throw new TypeError(`Missing field: "${Te}"`);var Be=O();for(Te in re)re[Te].write(Be,Ce[Te]);return me!==null&&me.push(R,Be),Be},argPackAdvance:br,readValueFromPointer:dn,destructorFunction:R}]})},Lt=(_,A,O,R,G)=>{},ca=()=>{for(var _=new Array(256),A=0;A<256;++A)_[A]=String.fromCharCode(A);mi=_},mi,Jt=_=>{for(var A="",O=_;P[O];)A+=mi[P[O++]];return A},ao,ct=_=>{throw new ao(_)};function Yf(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var R=A.name;if(_||ct(`type "${R}" must have a positive integer typeid pointer`),zn.hasOwnProperty(_)){if(O.ignoreDuplicateRegistrations)return;ct(`Cannot register type '${R}' twice`)}if(zn[_]=A,delete qr[_],Qt.hasOwnProperty(_)){var G=Qt[_];delete Qt[_],G.forEach(X=>X())}}function sr(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Yf(_,A,O)}var br=8,Y=(_,A,O,R)=>{A=Jt(A),sr(_,{name:A,fromWireType:function(G){return!!G},toWireType:function(G,X){return X?O:R},argPackAdvance:br,readValueFromPointer:function(G){return this.fromWireType(P[G])},destructorFunction:null})},Ee=_=>({count:_.count,deleteScheduled:_.deleteScheduled,preservePointerOnDelete:_.preservePointerOnDelete,ptr:_.ptr,ptrType:_.ptrType,smartPtr:_.smartPtr,smartPtrType:_.smartPtrType}),xe=_=>{function A(O){return O.$$.ptrType.registeredClass.name}ct(A(_)+" instance already deleted")},Ne=!1,ut=_=>{},At=_=>{_.smartPtr?_.smartPtrType.rawDestructor(_.smartPtr):_.ptrType.registeredClass.rawDestructor(_.ptr)},Je=_=>{_.count.value-=1;var A=_.count.value===0;A&&At(_)},Qe=(_,A,O)=>{if(A===O)return _;if(O.baseClass===void 0)return null;var R=Qe(_,A,O.baseClass);return R===null?null:O.downcast(R)},yn={},Ft={},Gt=(_,A)=>{for(A===void 0&&ct("ptr should not be undefined");_.baseClass;)A=_.upcast(A),_=_.baseClass;return A},Xn=(_,A)=>(A=Gt(_,A),Ft[A]),kr=(_,A)=>{(!A.ptrType||!A.ptr)&&Ge("makeClassHandle requires ptr and ptrType");var O=!!A.smartPtrType,R=!!A.smartPtr;return O!==R&&Ge("Both smartPtrType and smartPtr must be specified"),A.count={value:1},Zt(Object.create(_,{$$:{value:A,writable:!0}}))};function so(_){var A=this.getPointee(_);if(!A)return this.destructor(_),null;var O=Xn(this.registeredClass,A);if(O!==void 0){if(O.$$.count.value===0)return O.$$.ptr=A,O.$$.smartPtr=_,O.clone();var R=O.clone();return this.destructor(_),R}function G(){return this.isSmartPointer?kr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:A,smartPtrType:this,smartPtr:_}):kr(this.registeredClass.instancePrototype,{ptrType:this,ptr:_})}var X=this.registeredClass.getActualType(A),ae=yn[X];if(!ae)return G.call(this);var re;this.isConst?re=ae.constPointerType:re=ae.pointerType;var me=Qe(A,this.registeredClass,re.registeredClass);return me===null?G.call(this):this.isSmartPointer?kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me,smartPtrType:this,smartPtr:_}):kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me})}var Zt=_=>typeof FinalizationRegistry>"u"?(Zt=A=>A,_):(Ne=new FinalizationRegistry(A=>{Je(A.$$)}),Zt=A=>{var O=A.$$,R=!!O.smartPtr;if(R){var G={$$:O};Ne.register(A,G,A)}return A},ut=A=>Ne.unregister(A),Zt(_)),Vo=[],Wf=()=>{for(;Vo.length;){var _=Vo.pop();_.$$.deleteScheduled=!1,_.delete()}},Ou,pO=()=>{Object.assign(Pu.prototype,{isAliasOf(_){if(!(this instanceof Pu)||!(_ instanceof Pu))return!1;var A=this.$$.ptrType.registeredClass,O=this.$$.ptr;_.$$=_.$$;for(var R=_.$$.ptrType.registeredClass,G=_.$$.ptr;A.baseClass;)O=A.upcast(O),A=A.baseClass;for(;R.baseClass;)G=R.upcast(G),R=R.baseClass;return A===R&&O===G},clone(){if(this.$$.ptr||xe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var _=Zt(Object.create(Object.getPrototypeOf(this),{$$:{value:Ee(this.$$)}}));return _.$$.count.value+=1,_.$$.deleteScheduled=!1,_},delete(){this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),ut(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),Vo.push(this),Vo.length===1&&Ou&&Ou(Wf),this.$$.deleteScheduled=!0,this}})};function Pu(){}var Ss=(_,A)=>Object.defineProperty(A,"name",{value:_}),Sy=(_,A,O)=>{if(_[A].overloadTable===void 0){var R=_[A];_[A]=function(){for(var G=arguments.length,X=new Array(G),ae=0;ae<G;ae++)X[ae]=arguments[ae];return _[A].overloadTable.hasOwnProperty(X.length)||ct(`Function '${O}' called with an invalid number of arguments (${X.length}) - expects one of (${_[A].overloadTable})!`),_[A].overloadTable[X.length].apply(this,X)},_[A].overloadTable=[],_[A].overloadTable[R.argCount]=R}},Kf=(_,A,O)=>{o.hasOwnProperty(_)?((O===void 0||o[_].overloadTable!==void 0&&o[_].overloadTable[O]!==void 0)&&ct(`Cannot register public name '${_}' twice`),Sy(o,_,_),o.hasOwnProperty(O)&&ct(`Cannot register multiple overloads of a function with the same number of arguments (${O})!`),o[_].overloadTable[O]=A):(o[_]=A,O!==void 0&&(o[_].numArguments=O))},gO=48,mO=57,yO=_=>{_=_.replace(/[^a-zA-Z0-9_]/g,"$");var A=_.charCodeAt(0);return A>=gO&&A<=mO?`_${_}`:_};function vO(_,A,O,R,G,X,ae,re){this.name=_,this.constructor=A,this.instancePrototype=O,this.rawDestructor=R,this.baseClass=G,this.getActualType=X,this.upcast=ae,this.downcast=re,this.pureVirtualFunctions=[]}var zf=(_,A,O)=>{for(;A!==O;)A.upcast||ct(`Expected null or instance of ${O.name}, got an instance of ${A.name}`),_=A.upcast(_),A=A.baseClass;return _};function wO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}function bO(_,A){var O;if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),this.isSmartPointer?(O=this.rawConstructor(),_!==null&&_.push(this.rawDestructor,O),O):0;(!A||!A.$$)&&ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);var R=A.$$.ptrType.registeredClass;if(O=zf(A.$$.ptr,R,this.registeredClass),this.isSmartPointer)switch(A.$$.smartPtr===void 0&&ct("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:A.$$.smartPtrType===this?O=A.$$.smartPtr:ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:O=A.$$.smartPtr;break;case 2:if(A.$$.smartPtrType===this)O=A.$$.smartPtr;else{var G=A.clone();O=this.rawShare(O,uo.toHandle(()=>G.delete())),_!==null&&_.push(this.rawDestructor,O)}break;default:ct("Unsupporting sharing policy")}return O}function EO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.ptrType.name} to parameter type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}var CO=()=>{Object.assign(ku.prototype,{getPointee(_){return this.rawGetPointee&&(_=this.rawGetPointee(_)),_},destructor(_){var A;(A=this.rawDestructor)===null||A===void 0||A.call(this,_)},argPackAdvance:br,readValueFromPointer:dn,fromWireType:so})};function ku(_,A,O,R,G,X,ae,re,me,Ce,Te){this.name=_,this.registeredClass=A,this.isReference=O,this.isConst=R,this.isSmartPointer=G,this.pointeeType=X,this.sharingPolicy=ae,this.rawGetPointee=re,this.rawConstructor=me,this.rawShare=Ce,this.rawDestructor=Te,!G&&A.baseClass===void 0?R?(this.toWireType=wO,this.destructorFunction=null):(this.toWireType=EO,this.destructorFunction=null):this.toWireType=bO}var Iy=(_,A,O)=>{o.hasOwnProperty(_)||Ge("Replacing nonexistent public symbol"),o[_].overloadTable!==void 0&&O!==void 0?o[_].overloadTable[O]=A:(o[_]=A,o[_].argCount=O)},_O=(_,A,O)=>{_=_.replace(/p/g,"i");var R=o["dynCall_"+_];return R(A,...O)},Bu=[],Ty,ot=_=>{var A=Bu[_];return A||(_>=Bu.length&&(Bu.length=_+1),Bu[_]=A=Ty.get(_)),A},AO=function(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(_.includes("j"))return _O(_,A,O);var R=ot(A)(...O);return R},SO=(_,A)=>function(){for(var O=arguments.length,R=new Array(O),G=0;G<O;G++)R[G]=arguments[G];return AO(_,A,R)},Br=(_,A)=>{_=Jt(_);function O(){return _.includes("j")?SO(_,A):ot(A)}var R=O();return typeof R!="function"&&ct(`unknown function pointer with signature ${_}: ${A}`),R},IO=(_,A)=>{var O=Ss(A,function(R){this.name=A,this.message=R;var G=new Error(R).stack;G!==void 0&&(this.stack=this.toString()+`
136
- `+G.replace(/^Error(:[^\n]*)?\n/,""))});return O.prototype=Object.create(_.prototype),O.prototype.constructor=O,O.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},O},xy,Oy=_=>{var A=My(_),O=Jt(A);return lo(A),O},Nu=(_,A)=>{var O=[],R={};function G(X){if(!R[X]&&!zn[X]){if(qr[X]){qr[X].forEach(G);return}O.push(X),R[X]=!0}}throw A.forEach(G),new xy(`${_}: `+O.map(Oy).join([", "]))},TO=(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,nt)=>{Te=Jt(Te),X=Br(G,X),re&&(re=Br(ae,re)),Ce&&(Ce=Br(me,Ce)),nt=Br(Be,nt);var vt=yO(Te);Kf(vt,function(){Nu(`Cannot construct ${Te} due to unbound types`,[R])}),qe([_,A,O],R?[R]:[],Rt=>{Rt=Rt[0];var fn,en;R?(fn=Rt.registeredClass,en=fn.instancePrototype):en=Pu.prototype;var tn=Ss(Te,function(){if(Object.getPrototypeOf(this)!==yi)throw new ao("Use 'new' to construct "+Te);if(Fn.constructor_body===void 0)throw new ao(Te+" has no accessible constructor");for(var Xy=arguments.length,Mu=new Array(Xy),Lu=0;Lu<Xy;Lu++)Mu[Lu]=arguments[Lu];var Qy=Fn.constructor_body[Mu.length];if(Qy===void 0)throw new ao(`Tried to invoke ctor of ${Te} with invalid number of parameters (${Mu.length}) - expected (${Object.keys(Fn.constructor_body).toString()}) parameters instead!`);return Qy.apply(this,Mu)}),yi=Object.create(en,{constructor:{value:tn}});tn.prototype=yi;var Fn=new vO(Te,tn,yi,nt,fn,X,re,Ce);if(Fn.baseClass){var fo,Du;(Du=(fo=Fn.baseClass).__derivedClasses)!==null&&Du!==void 0||(fo.__derivedClasses=[]),Fn.baseClass.__derivedClasses.push(Fn)}var pk=new ku(Te,Fn,!0,!1,!1),Ky=new ku(Te+"*",Fn,!1,!1,!1),zy=new ku(Te+" const*",Fn,!1,!0,!1);return yn[_]={pointerType:Ky,constPointerType:zy},Iy(vt,tn),[pk,Ky,zy]})},Xf=(_,A)=>{for(var O=[],R=0;R<_;R++)O.push(j[A+R*4>>2]);return O};function xO(_){for(var A=1;A<_.length;++A)if(_[A]!==null&&_[A].destructorFunction===void 0)return!0;return!1}function Qf(_,A,O,R,G,X){var ae=A.length;ae<2&&ct("argTypes array size mismatch! Must at least get return value and 'this' types!");var re=A[1]!==null&&O!==null,me=xO(A),Ce=A[0].name!=="void",Te=ae-2,Be=new Array(Te),nt=[],vt=[],Rt=function(){vt.length=0;var fn;nt.length=re?2:1,nt[0]=G,re&&(fn=A[1].toWireType(vt,this),nt[1]=fn);for(var en=0;en<Te;++en)Be[en]=A[en+2].toWireType(vt,en<0||arguments.length<=en?void 0:arguments[en]),nt.push(Be[en]);var tn=R(...nt);function yi(Fn){if(me)Ln(vt);else for(var fo=re?1:2;fo<A.length;fo++){var Du=fo===1?fn:Be[fo-2];A[fo].destructorFunction!==null&&A[fo].destructorFunction(Du)}if(Ce)return A[0].fromWireType(Fn)}return yi(tn)};return Ss(_,Rt)}var OO=(_,A,O,R,G,X)=>{var ae=Xf(A,O);G=Br(R,G),qe([],[_],re=>{re=re[0];var me=`constructor ${re.name}`;if(re.registeredClass.constructor_body===void 0&&(re.registeredClass.constructor_body=[]),re.registeredClass.constructor_body[A-1]!==void 0)throw new ao(`Cannot register multiple constructors with identical number of parameters (${A-1}) for class '${re.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return re.registeredClass.constructor_body[A-1]=()=>{Nu(`Cannot construct ${re.name} due to unbound types`,ae)},qe([],ae,Ce=>(Ce.splice(1,0,null),re.registeredClass.constructor_body[A-1]=Qf(me,Ce,null,G,X),[])),[]})},Py=_=>{_=_.trim();const A=_.indexOf("(");return A!==-1?_.substr(0,A):_},PO=(_,A,O,R,G,X,ae,re,me,Ce)=>{var Te=Xf(O,R);A=Jt(A),A=Py(A),X=Br(G,X),qe([],[_],Be=>{Be=Be[0];var nt=`${Be.name}.${A}`;A.startsWith("@@")&&(A=Symbol[A.substring(2)]),re&&Be.registeredClass.pureVirtualFunctions.push(A);function vt(){Nu(`Cannot call ${nt} due to unbound types`,Te)}var Rt=Be.registeredClass.instancePrototype,fn=Rt[A];return fn===void 0||fn.overloadTable===void 0&&fn.className!==Be.name&&fn.argCount===O-2?(vt.argCount=O-2,vt.className=Be.name,Rt[A]=vt):(Sy(Rt,A,nt),Rt[A].overloadTable[O-2]=vt),qe([],Te,en=>{var tn=Qf(nt,en,Be,X,ae);return Rt[A].overloadTable===void 0?(tn.argCount=O-2,Rt[A]=tn):Rt[A].overloadTable[O-2]=tn,[]}),[]})},Jf=[],co=[],Zf=_=>{_>9&&--co[_+1]===0&&(co[_]=void 0,Jf.push(_))},kO=()=>co.length/2-5-Jf.length,BO=()=>{co.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=kO},uo={toValue:_=>(_||ct("Cannot use deleted val. handle = "+_),co[_]),toHandle:_=>{switch(_){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const A=Jf.pop()||co.length;return co[A]=_,co[A+1]=1,A}}}},ky={name:"emscripten::val",fromWireType:_=>{var A=uo.toValue(_);return Zf(_),A},toWireType:(_,A)=>uo.toHandle(A),argPackAdvance:br,readValueFromPointer:dn,destructorFunction:null},NO=_=>sr(_,ky),RO=(_,A,O)=>{switch(A){case 1:return O?function(R){return this.fromWireType(T[R])}:function(R){return this.fromWireType(P[R])};case 2:return O?function(R){return this.fromWireType(N[R>>1])}:function(R){return this.fromWireType(L[R>>1])};case 4:return O?function(R){return this.fromWireType(V[R>>2])}:function(R){return this.fromWireType(j[R>>2])};default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},DO=(_,A,O,R)=>{A=Jt(A);function G(){}G.values={},sr(_,{name:A,constructor:G,fromWireType:function(X){return this.constructor.values[X]},toWireType:(X,ae)=>ae.value,argPackAdvance:br,readValueFromPointer:RO(A,O,R),destructorFunction:null}),Kf(A,G)},eh=(_,A)=>{var O=zn[_];return O===void 0&&ct(`${A} has unknown type ${Oy(_)}`),O},MO=(_,A,O)=>{var R=eh(_,"enum");A=Jt(A);var G=R.constructor,X=Object.create(R.constructor.prototype,{value:{value:O},constructor:{value:Ss(`${R.name}_${A}`,function(){})}});G.values[O]=X,G[A]=X},th=_=>{if(_===null)return"null";var A=typeof _;return A==="object"||A==="array"||A==="function"?_.toString():""+_},LO=(_,A)=>{switch(A){case 4:return function(O){return this.fromWireType(W[O>>2])};case 8:return function(O){return this.fromWireType(q[O>>3])};default:throw new TypeError(`invalid float width (${A}): ${_}`)}},FO=(_,A,O)=>{A=Jt(A),sr(_,{name:A,fromWireType:R=>R,toWireType:(R,G)=>G,argPackAdvance:br,readValueFromPointer:LO(A,O),destructorFunction:null})},jO=(_,A,O,R,G,X,ae,re)=>{var me=Xf(A,O);_=Jt(_),_=Py(_),G=Br(R,G),Kf(_,function(){Nu(`Cannot call ${_} due to unbound types`,me)},A-1),qe([],me,Ce=>{var Te=[Ce[0],null].concat(Ce.slice(1));return Iy(_,Qf(_,Te,null,G,X),A-1),[]})},VO=(_,A,O)=>{switch(A){case 1:return O?R=>T[R]:R=>P[R];case 2:return O?R=>N[R>>1]:R=>L[R>>1];case 4:return O?R=>V[R>>2]:R=>j[R>>2];default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},UO=(_,A,O,R,G)=>{A=Jt(A);var X=Te=>Te;if(R===0){var ae=32-8*O;X=Te=>Te<<ae>>>ae}var re=A.includes("unsigned"),me=(Te,Be)=>{},Ce;re?Ce=function(Te,Be){return me(Be,this.name),Be>>>0}:Ce=function(Te,Be){return me(Be,this.name),Be},sr(_,{name:A,fromWireType:X,toWireType:Ce,argPackAdvance:br,readValueFromPointer:VO(A,O,R!==0),destructorFunction:null})},GO=(_,A,O)=>{var R=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=R[A];function X(ae){var re=j[ae>>2],me=j[ae+4>>2];return new G(T.buffer,me,re)}O=Jt(O),sr(_,{name:O,fromWireType:X,argPackAdvance:br,readValueFromPointer:X},{ignoreDuplicateRegistrations:!0})},qO=Object.assign({optional:!0},ky),HO=(_,A)=>{sr(_,qO)},$O=(_,A,O,R)=>{if(!(R>0))return 0;for(var G=O,X=O+R-1,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(re<=127){if(O>=X)break;A[O++]=re}else if(re<=2047){if(O+1>=X)break;A[O++]=192|re>>6,A[O++]=128|re&63}else if(re<=65535){if(O+2>=X)break;A[O++]=224|re>>12,A[O++]=128|re>>6&63,A[O++]=128|re&63}else{if(O+3>=X)break;A[O++]=240|re>>18,A[O++]=128|re>>12&63,A[O++]=128|re>>6&63,A[O++]=128|re&63}}return A[O]=0,O-G},Is=(_,A,O)=>$O(_,P,A,O),YO=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R<=127?A++:R<=2047?A+=2:R>=55296&&R<=57343?(A+=4,++O):A+=3}return A},By=typeof TextDecoder<"u"?new TextDecoder:void 0,Ny=function(_){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var R=A+O,G=A;_[G]&&!(G>=R);)++G;if(G-A>16&&_.buffer&&By)return By.decode(_.subarray(A,G));for(var X="";A<G;){var ae=_[A++];if(!(ae&128)){X+=String.fromCharCode(ae);continue}var re=_[A++]&63;if((ae&224)==192){X+=String.fromCharCode((ae&31)<<6|re);continue}var me=_[A++]&63;if((ae&240)==224?ae=(ae&15)<<12|re<<6|me:ae=(ae&7)<<18|re<<12|me<<6|_[A++]&63,ae<65536)X+=String.fromCharCode(ae);else{var Ce=ae-65536;X+=String.fromCharCode(55296|Ce>>10,56320|Ce&1023)}}return X},WO=(_,A)=>_?Ny(P,_,A):"",KO=(_,A)=>{A=Jt(A);var O=A==="std::string";sr(_,{name:A,fromWireType(R){var G=j[R>>2],X=R+4,ae;if(O)for(var re=X,me=0;me<=G;++me){var Ce=X+me;if(me==G||P[Ce]==0){var Te=Ce-re,Be=WO(re,Te);ae===void 0?ae=Be:(ae+="\0",ae+=Be),re=Ce+1}}else{for(var nt=new Array(G),me=0;me<G;++me)nt[me]=String.fromCharCode(P[X+me]);ae=nt.join("")}return lo(R),ae},toWireType(R,G){G instanceof ArrayBuffer&&(G=new Uint8Array(G));var X,ae=typeof G=="string";ae||G instanceof Uint8Array||G instanceof Uint8ClampedArray||G instanceof Int8Array||ct("Cannot pass non-string to std::string"),O&&ae?X=YO(G):X=G.length;var re=oh(4+X+1),me=re+4;if(j[re>>2]=X,O&&ae)Is(G,me,X+1);else if(ae)for(var Ce=0;Ce<X;++Ce){var Te=G.charCodeAt(Ce);Te>255&&(lo(me),ct("String has UTF-16 code units that do not fit in 8 bits")),P[me+Ce]=Te}else for(var Ce=0;Ce<X;++Ce)P[me+Ce]=G[Ce];return R!==null&&R.push(lo,re),re},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(R){lo(R)}})},Ry=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,zO=(_,A)=>{for(var O=_,R=O>>1,G=R+A/2;!(R>=G)&&L[R];)++R;if(O=R<<1,O-_>32&&Ry)return Ry.decode(P.subarray(_,O));for(var X="",ae=0;!(ae>=A/2);++ae){var re=N[_+ae*2>>1];if(re==0)break;X+=String.fromCharCode(re)}return X},XO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<2)return 0;O-=2;for(var G=A,X=O<_.length*2?O/2:_.length,ae=0;ae<X;++ae){var re=_.charCodeAt(ae);N[A>>1]=re,A+=2}return N[A>>1]=0,A-G},QO=_=>_.length*2,JO=(_,A)=>{for(var O=0,R="";!(O>=A/4);){var G=V[_+O*4>>2];if(G==0)break;if(++O,G>=65536){var X=G-65536;R+=String.fromCharCode(55296|X>>10,56320|X&1023)}else R+=String.fromCharCode(G)}return R},ZO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<4)return 0;for(var G=A,X=G+O-4,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(V[A>>2]=re,A+=4,A+4>X)break}return V[A>>2]=0,A-G},eP=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R>=55296&&R<=57343&&++O,A+=4}return A},tP=(_,A,O)=>{O=Jt(O);var R,G,X,ae;A===2?(R=zO,G=XO,ae=QO,X=re=>L[re>>1]):A===4&&(R=JO,G=ZO,ae=eP,X=re=>j[re>>2]),sr(_,{name:O,fromWireType:re=>{for(var me=j[re>>2],Ce,Te=re+4,Be=0;Be<=me;++Be){var nt=re+4+Be*A;if(Be==me||X(nt)==0){var vt=nt-Te,Rt=R(Te,vt);Ce===void 0?Ce=Rt:(Ce+="\0",Ce+=Rt),Te=nt+A}}return lo(re),Ce},toWireType:(re,me)=>{typeof me!="string"&&ct(`Cannot pass non-string to C++ string type ${O}`);var Ce=ae(me),Te=oh(4+Ce+A);return j[Te>>2]=Ce/A,G(me,Te+4,Ce+A),re!==null&&re.push(lo,Te),Te},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(re){lo(re)}})},nP=(_,A,O,R,G,X)=>{Sn[_]={name:Jt(A),rawConstructor:Br(O,R),rawDestructor:Br(G,X),fields:[]}},rP=(_,A,O,R,G,X,ae,re,me,Ce)=>{Sn[_].fields.push({fieldName:Jt(A),getterReturnType:O,getter:Br(R,G),getterContext:X,setterArgumentType:ae,setter:Br(re,me),setterContext:Ce})},oP=(_,A)=>{A=Jt(A),sr(_,{isVoid:!0,name:A,argPackAdvance:0,fromWireType:()=>{},toWireType:(O,R)=>{}})},iP=(_,A,O)=>P.copyWithin(_,A,A+O),nh=[],aP=(_,A,O,R)=>(_=nh[_],A=uo.toValue(A),_(null,A,O,R)),sP={},cP=_=>{var A=sP[_];return A===void 0?Jt(_):A},Dy=()=>{if(typeof globalThis=="object")return globalThis;function _(A){A.$$$embind_global$$$=A;var O=typeof $$$embind_global$$$=="object"&&A.$$$embind_global$$$==A;return O||delete A.$$$embind_global$$$,O}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&_(global)?$$$embind_global$$$=global:typeof self=="object"&&_(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},uP=_=>_===0?uo.toHandle(Dy()):(_=cP(_),uo.toHandle(Dy()[_])),lP=_=>{var A=nh.length;return nh.push(_),A},dP=(_,A)=>{for(var O=new Array(_),R=0;R<_;++R)O[R]=eh(j[A+R*4>>2],"parameter "+R);return O},fP=Reflect.construct,hP=(_,A,O)=>{var R=[],G=_.toWireType(R,O);return R.length&&(j[A>>2]=uo.toHandle(R)),G},pP=(_,A,O)=>{var R=dP(_,A),G=R.shift();_--;var X=new Array(_),ae=(me,Ce,Te,Be)=>{for(var nt=0,vt=0;vt<_;++vt)X[vt]=R[vt].readValueFromPointer(Be+nt),nt+=R[vt].argPackAdvance;var Rt=O===1?fP(Ce,X):Ce.apply(me,X);return hP(G,Te,Rt)},re=`methodCaller<(${R.map(me=>me.name).join(", ")}) => ${G.name}>`;return lP(Ss(re,ae))},gP=_=>{_>9&&(co[_+1]+=1)},mP=_=>{var A=uo.toValue(_);Ln(A),Zf(_)},yP=(_,A)=>{_=eh(_,"_emval_take_value");var O=_.readValueFromPointer(A);return uo.toHandle(O)},vP=(_,A,O,R)=>{var G=new Date().getFullYear(),X=new Date(G,0,1),ae=new Date(G,6,1),re=X.getTimezoneOffset(),me=ae.getTimezoneOffset(),Ce=Math.max(re,me);j[_>>2]=Ce*60,V[A>>2]=+(re!=me);var Te=vt=>{var Rt=vt>=0?"-":"+",fn=Math.abs(vt),en=String(Math.floor(fn/60)).padStart(2,"0"),tn=String(fn%60).padStart(2,"0");return`UTC${Rt}${en}${tn}`},Be=Te(re),nt=Te(me);me<re?(Is(Be,O,17),Is(nt,R,17)):(Is(Be,R,17),Is(nt,O,17))},wP=()=>2147483648,bP=(_,A)=>Math.ceil(_/A)*A,EP=_=>{var A=C.buffer,O=(_-A.byteLength+65535)/65536|0;try{return C.grow(O),k(),1}catch{}},CP=_=>{var A=P.length;_>>>=0;var O=wP();if(_>O)return!1;for(var R=1;R<=4;R*=2){var G=A*(1+.2/R);G=Math.min(G,_+100663296);var X=Math.min(O,bP(Math.max(_,G),65536)),ae=EP(X);if(ae)return!0}return!1},rh={},_P=()=>f||"./this.program",Ts=()=>{if(!Ts.strings){var _=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:_,_:_P()};for(var O in rh)rh[O]===void 0?delete A[O]:A[O]=rh[O];var R=[];for(var O in A)R.push(`${O}=${A[O]}`);Ts.strings=R}return Ts.strings},AP=(_,A)=>{for(var O=0;O<_.length;++O)T[A++]=_.charCodeAt(O);T[A]=0},SP=(_,A)=>{var O=0;return Ts().forEach((R,G)=>{var X=A+O;j[_+G*4>>2]=X,AP(R,X),O+=R.length+1}),0},IP=(_,A)=>{var O=Ts();j[_>>2]=O.length;var R=0;return O.forEach(G=>R+=G.length+1),j[A>>2]=R,0},TP=_=>52;function xP(_,A,O,R,G){return 70}var OP=[null,[],[]],PP=(_,A)=>{var O=OP[_];A===0||A===10?((_===1?w:b)(Ny(O)),O.length=0):O.push(A)},kP=(_,A,O,R)=>{for(var G=0,X=0;X<O;X++){var ae=j[A>>2],re=j[A+4>>2];A+=8;for(var me=0;me<re;me++)PP(_,P[ae+me]);G+=re}return j[R>>2]=G,0},BP=_=>_;Me=o.InternalError=class extends Error{constructor(_){super(_),this.name="InternalError"}},ca(),ao=o.BindingError=class extends Error{constructor(_){super(_),this.name="BindingError"}},pO(),CO(),xy=o.UnboundTypeError=IO(Error,"UnboundTypeError"),BO();var NP={t:at,x:It,a:Ot,j:De,k:Pr,O:ln,q:Dn,ga:Mn,d:wr,ca:Gr,va:st,ba:Lt,pa:Y,ta:TO,sa:OO,E:PO,oa:NO,F:DO,n:MO,W:FO,X:jO,y:UO,u:GO,ua:HO,V:KO,P:tP,L:nP,wa:rP,qa:oP,ja:iP,T:aP,xa:Zf,ya:uP,U:pP,Y:gP,Z:mP,ra:yP,da:vP,ha:CP,ea:SP,fa:IP,ia:TP,$:xP,S:kP,J:ek,C:nk,Q:FP,R:uk,r:XP,b:RP,D:ZP,la:ok,c:VP,ka:ik,h:LP,i:HP,s:$P,N:JP,w:WP,I:sk,K:QP,z:rk,H:lk,aa:fk,_:hk,l:UP,f:jP,e:MP,g:DP,M:ck,m:qP,ma:tk,p:YP,v:KP,na:zP,B:ak,o:GP,G:dk,A:BP},jt=pe(),My=_=>(My=jt.Ba)(_),lo=o._free=_=>(lo=o._free=jt.Ca)(_),oh=o._malloc=_=>(oh=o._malloc=jt.Ea)(_),Ly=_=>(Ly=jt.Fa)(_),tt=(_,A)=>(tt=jt.Ga)(_,A),Fy=_=>(Fy=jt.Ha)(_),jy=_=>(jy=jt.Ia)(_),Vy=()=>(Vy=jt.Ja)(),Uy=_=>(Uy=jt.Ka)(_),Gy=_=>(Gy=jt.La)(_),qy=(_,A,O)=>(qy=jt.Ma)(_,A,O);o.dynCall_viijii=(_,A,O,R,G,X,ae)=>(o.dynCall_viijii=jt.Na)(_,A,O,R,G,X,ae);var Hy=o.dynCall_jiii=(_,A,O,R)=>(Hy=o.dynCall_jiii=jt.Oa)(_,A,O,R);o.dynCall_jiji=(_,A,O,R,G)=>(o.dynCall_jiji=jt.Pa)(_,A,O,R,G);var $y=o.dynCall_jiiii=(_,A,O,R,G)=>($y=o.dynCall_jiiii=jt.Qa)(_,A,O,R,G);o.dynCall_iiiiij=(_,A,O,R,G,X,ae)=>(o.dynCall_iiiiij=jt.Ra)(_,A,O,R,G,X,ae),o.dynCall_iiiiijj=(_,A,O,R,G,X,ae,re,me)=>(o.dynCall_iiiiijj=jt.Sa)(_,A,O,R,G,X,ae,re,me),o.dynCall_iiiiiijj=(_,A,O,R,G,X,ae,re,me,Ce)=>(o.dynCall_iiiiiijj=jt.Ta)(_,A,O,R,G,X,ae,re,me,Ce);function RP(_,A){var O=ue();try{return ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;tt(1,0)}}function DP(_,A,O,R){var G=ue();try{ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function MP(_,A,O){var R=ue();try{ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;tt(1,0)}}function LP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function FP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function jP(_,A){var O=ue();try{ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;tt(1,0)}}function VP(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;tt(1,0)}}function UP(_){var A=ue();try{ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;tt(1,0)}}function GP(_,A,O,R,G,X,ae,re,me,Ce,Te){var Be=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te)}catch(nt){if(ye(Be),nt!==nt+0)throw nt;tt(1,0)}}function qP(_,A,O,R,G){var X=ue();try{ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function HP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function $P(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;tt(1,0)}}function YP(_,A,O,R,G,X){var ae=ue();try{ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;tt(1,0)}}function WP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;tt(1,0)}}function KP(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;tt(1,0)}}function zP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;tt(1,0)}}function XP(_){var A=ue();try{return ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;tt(1,0)}}function QP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{return ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;tt(1,0)}}function JP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;tt(1,0)}}function ZP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function ek(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function tk(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;tt(1,0)}}function nk(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;tt(1,0)}}function rk(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;tt(1,0)}}function ok(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;tt(1,0)}}function ik(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}function ak(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;tt(1,0)}}function sk(_,A,O,R,G,X,ae,re){var me=ue();try{return ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;tt(1,0)}}function ck(_,A,O,R,G,X,ae){var re=ue();try{ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;tt(1,0)}}function uk(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function lk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be){var nt=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be)}catch(vt){if(ye(nt),vt!==vt+0)throw vt;tt(1,0)}}function dk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,nt,vt,Rt,fn){var en=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be,nt,vt,Rt,fn)}catch(tn){if(ye(en),tn!==tn+0)throw tn;tt(1,0)}}function fk(_,A,O,R){var G=ue();try{return Hy(_,A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;tt(1,0)}}function hk(_,A,O,R,G){var X=ue();try{return $y(_,A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;tt(1,0)}}var Ru,Yy;H=function _(){Ru||Wy(),Ru||(H=_)};function Wy(){if(ve>0||!Yy&&(Yy=1,oe(),ve>0))return;function _(){var A;Ru||(Ru=1,o.calledRun=1,!I&&(ne(),i(o),(A=o.onRuntimeInitialized)===null||A===void 0||A.call(o),se()))}o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),_()},1)):_()}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Wy(),r=s,r}})();function D7(t){return pf(gf,t)}async function M7(t,e){return N7(gf,t,e)}async function L7(t,e){return R7(gf,t,e)}const Ym=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],F7=[...Ym,["unknown"]].map(t=>t[0]),mf=new Map(Ym);function j7(t){for(const[e,n]of mf)if(t===n)return e;return"unknown"}function V7(t){if(Wm(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Km(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(zm(t))return{width:t.videoWidth,height:t.videoHeight};if(Qm(t))return{width:t.width,height:t.height};if(Zm(t))return{width:t.displayWidth,height:t.displayHeight};if(Xm(t))return{width:t.width,height:t.height};if(Jm(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Wm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLImageElement)}catch{return!1}}function Km(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.SVGImageElement)}catch{return!1}}function zm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLVideoElement)}catch{return!1}}function Xm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLCanvasElement)}catch{return!1}}function Qm(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function Jm(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function Zm(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function e2(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function U7(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function G7(t,e){try{const n=new OffscreenCanvas(t,e);if(n.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{const n=document.createElement("canvas");return n.width=t,n.height=e,n}}async function t2(t){if(Wm(t)&&!await Y7(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Km(t)&&!await W7(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Zm(t)&&K7(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(zm(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Qm(t)&&X7(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:n}=V7(t);if(e===0||n===0)return null;const r=G7(e,n).getContext("2d");r.drawImage(t,0,0);try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function q7(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let n="";try{n=URL.createObjectURL(t),e.src=n,await e.decode()}finally{URL.revokeObjectURL(n)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await t2(e)}function H7(t){const{width:e,height:n}=t;if(e===0||n===0)return null;const r=t.getContext("2d");try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function $7(t){if(e2(t))return await q7(t);if(U7(t)){if(z7(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return Xm(t)||Jm(t)?H7(t):await t2(t)}async function Y7(t){try{return await t.decode(),!0}catch{return!1}}async function W7(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function K7(t){return t.format===null}function z7(t){return t.data.buffer.byteLength===0}function X7(t){return t.width===0&&t.height===0}function n2(t,e){return Q7(t)?new DOMException(`${e}: ${t.message}`,t.name):J7(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function Q7(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function J7(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var ru;let yf=class extends EventTarget{constructor(e={}){var n;super(),C7(this,ru);try{const r=(n=e==null?void 0:e.formats)==null?void 0:n.filter(o=>o!=="unknown");if((r==null?void 0:r.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const o of r??[])if(!mf.has(o))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${o}' is not a valid enum value of type BarcodeFormat.`);_7(this,ru,r??[]),D7().then(o=>{this.dispatchEvent(new CustomEvent("load",{detail:o}))}).catch(o=>{this.dispatchEvent(new CustomEvent("error",{detail:o}))})}catch(r){throw n2(r,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return F7.filter(e=>e!=="unknown")}async detect(e){try{const n=await $7(e);if(n===null)return[];let r;const o={tryHarder:!0,returnCodabarStartEnd:!0,formats:E7(this,ru).map(i=>mf.get(i))};try{e2(n)?r=await M7(n,o):r=await L7(n,o)}catch(i){throw console.error(i),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return r.map(i=>{const{topLeft:{x:a,y:s},topRight:{x:c,y:u},bottomLeft:{x:d,y:h},bottomRight:{x:f,y:p}}=i.position,l=Math.min(a,c,d,f),g=Math.min(s,u,h,p),m=Math.max(a,c,d,f),y=Math.max(s,u,h,p);return{boundingBox:new DOMRectReadOnly(l,g,m-l,y-g),rawValue:i.text,format:j7(i.format),cornerPoints:[{x:a,y:s},{x:c,y:u},{x:f,y:p},{x:d,y:h}]}})}catch(n){throw n2(n,"Failed to execute 'detect' on 'BarcodeDetector'")}}};ru=new WeakMap,globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=yf);function Z7(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function eS(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),x.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function tS(t){const{scanning:e,startScanning:n,stopScanning:r}=t,[o,i]=x.useState(!1);function a(){i(!0),e?r():n(),setTimeout(()=>i(!1),1e3)}return x.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:o?"default":"pointer"}},e?x.createElement(Z7,{disabled:o,onClick:a}):x.createElement(eS,{disabled:o,onClick:a}))}function nS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function rS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function oS(t){const{status:e,scanning:n,torchToggle:r}=t;function o(i){r(i)}return n&&r?x.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?x.createElement(rS,{onClick:()=>o(!1)}):x.createElement(nS,{onClick:()=>o(!0)})):null}function iS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function aS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function sS(t){const{scanning:e,capabilities:n,onZoom:r,value:o}=t;if(!e||!r)return null;const i=(n.max-n.min)/3;return x.createElement(x.Fragment,null,x.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(aS,{disabled:o<=n.min,onClick:function(){r(Math.max(o-i,n.min))}})),x.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(iS,{disabled:o>=n.max,onClick:function(){r(Math.min(o+i,n.max))}})))}function cS(t){const{scanning:e,loading:n,capabilities:r,border:o=35,onOff:i,torch:a,zoom:s,startScanning:c,stopScanning:u}=t,d="rgba(255, 0, 0, 0.5)";return x.createElement("div",{style:{position:"relative"}},x.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${o>=35?o:35}px solid rgba(0, 0, 0, 0.2)`}},n&&x.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",x.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),x.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:d,strokeWidth:3})),i&&x.createElement(tS,{scanning:e,startScanning:c,stopScanning:u}),a&&r.torch&&x.createElement(oS,{scanning:e,status:a.status,torchToggle:a.toggle}),s&&r.zoom&&x.createElement(sS,{scanning:e,capabilities:r.zoom,value:s.value,onZoom:s.onChange}))}const uS={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},lS={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},dS={width:"100%",height:"100%",position:"relative"},fS={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var hS=function(t){let e,n=!1;return(...r)=>(n||(e=t(r),n=!0),e)}(()=>{const t=YA(window);switch(t.browser){case"chrome":r7(window,t);break;case"firefox":s7(window,t);break;case"safari":d7(window,t);break;default:throw new Error("Unsupported browser")}});const pS="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/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qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq";var ds=t=>t instanceof Date,r2=t=>t==null;const o2=t=>typeof t=="object";var i2=t=>!r2(t)&&!Array.isArray(t)&&o2(t)&&!ds(t),a2=t=>r2(t)||!o2(t);function s2(t,e){if(a2(t)||a2(e))return t===e;if(ds(t)&&ds(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const i=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=e[o];if(ds(i)&&ds(a)||i2(i)&&i2(a)||Array.isArray(i)&&Array.isArray(a)?!s2(i,a):i!==a)return!1}}return!0}function ou(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function gS(t){var e;const{onScan:n,constraints:r,formats:o=["qr_code"],paused:i=!1,components:a,children:s,styles:c,classNames:u,allowMultiple:d,scanDelay:h,onError:f}=t,p=x.useRef(null),l=x.useRef(null),g=x.useRef(null),m=x.useMemo(()=>({...uS,...r}),[r]),y=x.useMemo(()=>({...lS,...a}),[a]),[w,b]=x.useState(!1),[E,C]=x.useState(!0),[I,T]=x.useState(m),P=function(){const q=x.useRef(Promise.resolve({type:"stop",data:{}})),k=x.useRef(null),U=x.useRef(null),[z,te]=x.useState({}),[oe,ne]=x.useState({}),se=x.useCallback(async(H,$)=>{var J,S,M;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((J=navigator==null?void 0:navigator.mediaDevices)===null||J===void 0?void 0:J.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");hS();const F=await navigator.mediaDevices.getUserMedia({audio:!1,video:$});H.srcObject!==void 0?H.srcObject=F:H.mozSrcObject!==void 0?H.mozSrcObject=F:window.URL.createObjectURL?H.src=window.URL.createObjectURL(F):window.webkitURL?H.src=window.webkitURL.createObjectURL(F):H.src=F.id,await Promise.race([H.play(),new Promise(Q=>setTimeout(Q,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Q=>setTimeout(Q,500));const[B]=F.getVideoTracks();return ne(B.getSettings()),te((M=(S=B==null?void 0:B.getCapabilities)===null||S===void 0?void 0:S.call(B))!==null&&M!==void 0?M:{}),k.current=F,U.current=B,{type:"start",data:{videoEl:H,stream:F,constraints:$}}},[]),we=x.useCallback(async(H,$)=>{H.src="",H.srcObject=null,H.load();for(const J of $.getTracks())$.removeTrack(J),J.stop();return k.current=null,U.current=null,ne({}),{type:"stop",data:{}}},[]),le=x.useCallback(async(H,{constraints:$,restart:J=!1})=>{if(q.current=q.current.then(S=>{if(S.type==="start"){const{data:{videoEl:M,stream:F,constraints:B}}=S;return J||H!==M||$!==B?we(M,F).then(()=>se(H,$)):S}return se(H,$)}),(await q.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[se,we]),_e=x.useCallback(async()=>{if(q.current=q.current.then(H=>{if(H.type==="stop")return H;const{data:{videoEl:$,stream:J}}=H;return we($,J)}),(await q.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[we]),ve=x.useCallback(async H=>{const $=U.current;if(!$)throw new Error("No active video track found.");{H.advanced&&H.advanced[0].zoom&&$.getCapabilities().torch&&await $.applyConstraints({advanced:[{torch:!1}]}),await $.applyConstraints(H);const J=$.getCapabilities(),S=$.getSettings();te(J),ne(S)}},[]);return x.useEffect(()=>()=>{(async()=>await _e())()},[_e]),{capabilities:z,settings:oe,startCamera:le,stopCamera:_e,updateConstraints:ve}}(),{startScanning:N,stopScanning:L}=function(q){const{videoElementRef:k,onScan:U,onFound:z,retryDelay:te=100,scanDelay:oe=0,formats:ne=[],audio:se=!0,allowMultiple:we=!1}=q,le=x.useRef(new yf({formats:ne})),_e=x.useRef(null),ve=x.useRef(null);x.useEffect(()=>{le.current=new yf({formats:ne})},[ne]),x.useEffect(()=>{typeof window<"u"&&se&&(_e.current=new Audio(pS))},[se]);const H=x.useCallback($=>async J=>{if(k.current!==null&&k.current.readyState>1){const{lastScan:S,contentBefore:M,lastScanHadContent:F}=$;if(J-S<te)ve.current=window.requestAnimationFrame(H($));else{const B=await le.current.detect(k.current),Q=B.some(ge=>!M.includes(ge.rawValue)),Z=B.length>0;let ee=$.lastOnScan;(Q||we&&Z&&J-ee>=oe)&&(se&&_e.current&&_e.current.paused&&_e.current.play().catch(ge=>console.error("Error playing the sound",ge)),ee=J,U(B)),Z&&z(B),!Z&&F&&z(B);const K={lastScan:J,lastOnScan:ee,lastScanHadContent:Z,contentBefore:Q?B.map(ge=>ge.rawValue):M};ve.current=window.requestAnimationFrame(H(K))}}},[k.current,U,z,te]);return{startScanning:x.useCallback(()=>{const $=performance.now(),J={lastScan:$,lastOnScan:$,contentBefore:[],lastScanHadContent:!1};ve.current=window.requestAnimationFrame(H(J))},[H]),stopScanning:x.useCallback(()=>{ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null)},[])}}({videoElementRef:p,onScan:n,onFound:q=>function(k,U,z,te){const oe=z;if(oe==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const ne=U;if(ne==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(k.length===0||te===void 0)ou(oe);else{const se=ne.offsetWidth,we=ne.offsetHeight,le=ne.videoWidth,_e=ne.videoHeight,ve=Math.max(se/le,we/_e),H=le*ve,$=_e*ve,J=H/le,S=$/_e,M=(se-H)/2,F=(we-$)/2,B=({x:K,y:ge})=>({x:Math.floor(K*J),y:Math.floor(ge*S)}),Q=({x:K,y:ge})=>({x:Math.floor(K+M),y:Math.floor(ge+F)}),Z=k.map(K=>{const{boundingBox:ge,cornerPoints:be}=K,{x:pe,y:fe}=Q(B({x:ge.x,y:ge.y})),{x:ye,y:ue}=B({x:ge.width,y:ge.height});return{...K,cornerPoints:be.map(Oe=>Q(B(Oe))),boundingBox:DOMRectReadOnly.fromRect({x:pe,y:fe,width:ye,height:ue})}});oe.width=ne.offsetWidth,oe.height=ne.offsetHeight;const ee=oe.getContext("2d");if(ee===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");te(Z,ee)}}(q,p.current,g.current,y.tracker),formats:o,audio:y.audio,allowMultiple:d,retryDelay:y.tracker===void 0?500:10,scanDelay:h});x.useEffect(()=>(b(!0),()=>{b(!1)}),[]),x.useEffect(()=>{w&&(L(),N())},[a==null?void 0:a.tracker]),x.useEffect(()=>{if(!s2(m,I)){const q=m;r!=null&&r.deviceId&&delete q.facingMode,T(q)}},[r]);const V=x.useMemo(()=>({constraints:I,shouldStream:w&&!i}),[I,w,i]),j=async()=>{const q=p.current;if(q==null)throw new Error("Video should be defined when component is mounted.");const k=l.current;if(k==null)throw new Error("Canvas should be defined when component is mounted.");const U=k.getContext("2d");if(U==null)throw new Error("Canvas should be defined when component is mounted.");if(V.shouldStream){await P.stopCamera(),C(!1);try{await P.startCamera(q,V),q?C(!0):await P.stopCamera()}catch(z){f==null||f(z),console.error("error",z)}}else k.width=q.videoWidth,k.height=q.videoHeight,U.drawImage(q,0,0,q.videoWidth,q.videoHeight),await P.stopCamera(),C(!1)};x.useEffect(()=>{(async()=>await j())()},[V]);const W=x.useMemo(()=>V.shouldStream&&E,[V.shouldStream,E]);return x.useEffect(()=>{if(W){if(l.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(ou(l.current),g.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(ou(g.current),p.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");N()}},[W]),x.createElement("div",{style:{...dS,...c==null?void 0:c.container},className:u==null?void 0:u.container},x.createElement("video",{ref:p,style:{...fS,...c==null?void 0:c.video,visibility:i?"hidden":"visible"},className:u==null?void 0:u.video,autoPlay:!0,muted:!0,playsInline:!0}),x.createElement("canvas",{ref:l,style:{display:i?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),x.createElement("canvas",{ref:g,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),x.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},y.finder&&x.createElement(cS,{scanning:E,capabilities:P.capabilities,loading:!1,onOff:y.onOff,zoom:y.zoom&&P.settings.zoom?{value:P.settings.zoom,onChange:async q=>{const k={...I,advanced:[{zoom:q}]};await P.updateConstraints(k)}}:void 0,torch:y.torch?{status:(e=P.settings.torch)!==null&&e!==void 0&&e,toggle:async q=>{const k={...I,advanced:[{torch:q}]};await P.updateConstraints(k)}}:void 0,startScanning:async()=>await j(),stopScanning:async()=>{await P.stopCamera(),ou(g.current),C(!1)},border:c==null?void 0:c.finderBorder}),s))}const iu="data:image/svg+xml,%3csvg%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m21.25%207.5c.3796958%200%20.693491.28215388.7431534.64822944l.0068466.10177056v8.5c0%201.7330315-1.3564548%203.1492459-3.0655761%203.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555%200-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932%201.06066018%200%20.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734%200%201.6711923-.7071103%201.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815%202%202c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554%200%20.03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2%202c-.2928932.29289321-.767767.29289321-1.0606602%200-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734%200-1.67119234.70711027-1.7441988%201.60647279l-.0058012.14352721v8.5c0%20.4142136-.33578644.75-.75.75-.37969577%200-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146%201.35645477-3.14924593%203.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117%205.85294824c2.209139%200%204%201.790861%204%204s-1.790861%204-4%204-4-1.790861-4-4%201.790861-4%204-4zm0%201.5c-1.3807119%200-2.5%201.1192881-2.5%202.5s1.1192881%202.5%202.5%202.5%202.5-1.1192881%202.5-2.5-1.1192881-2.5-2.5-2.5z'%20fill='%23212121'/%3e%3c/svg%3e";function c2({onScan:t}){const{cameraFacingMode:e}=Xt(),[n,r]=x.useState(e??vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx("div",{className:"scale-x-[-1]",children:v.jsx(gS,{components:{finder:!1},onScan:o=>t(o[0].rawValue),constraints:{facingMode:n},allowMultiple:!0,classNames:{video:"rounded",container:"max-h-[calc(100vh-381px)] min-h-[267px] overflow-hidden rounded"},onError:o=>{console.log(o),Pg(o)}})}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===vn.USER?r(vn.ENVIRONMENT):r(vn.USER),children:v.jsx("img",{src:iu,alt:"camera-switch"})})]})}var au,vf,mS=(au=function(t,e){return au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},au(t,e)},function(t,e){function n(){this.constructor=t}au(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}),yS=function(t){function e(n){var r,o,i,a=this.constructor,s=t.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(c,u){u===void 0&&(u=c.constructor);var d=Error.captureStackTrace;d&&d(c,u)}(s),s}return mS(e,t),e}(Error),vS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function e(n){n===void 0&&(n=void 0);var r=t.call(this,n)||this;return r.message=n,r}return vS(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(yS),wS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return wS(e,t),e.kind="ArgumentException",e}($n),bS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ve=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return bS(e,t),e.kind="IllegalArgumentException",e}($n),u2=function(){function t(e){if(this.binarizer=e,e===null)throw new Ve("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(e,n){return this.binarizer.getBlackRow(e,n)},t.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,n,r,o){var i=this.binarizer.getLuminanceSource().crop(e,n,r,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},t}(),ES=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sn=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return ES(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}($n),CS=function(){function t(e){this.source=e}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Nt=function(){function t(){}return t.arraycopy=function(e,n,r,o,i){for(;i--;)r[o++]=e[n++]},t.currentTimeMillis=function(){return Date.now()},t}(),_S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wf=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return _S(e,t),e.kind="IndexOutOfBoundsException",e}($n),AS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),l2=function(t){function e(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=t.call(this,r)||this;return o.index=n,o.message=r,o}return AS(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(wf),SS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function t(){}return t.fill=function(e,n){for(var r=0,o=e.length;r<o;r++)e[r]=n},t.fillWithin=function(e,n,r,o){t.rangeCheck(e.length,n,r);for(var i=n;i<r;i++)e[i]=o},t.rangeCheck=function(e,n,r){if(n>r)throw new Ve("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new l2(n);if(r>e)throw new l2(r)},t.asList=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e},t.create=function(e,n,r){return Array.from({length:e}).map(function(o){return Array.from({length:n}).fill(r)})},t.createInt32Array=function(e,n,r){return Array.from({length:e}).map(function(o){return Int32Array.from({length:n}).fill(r)})},t.equals=function(e,n){if(!e||!n||!e.length||!n.length||e.length!==n.length)return!1;for(var r=0,o=e.length;r<o;r++)if(e[r]!==n[r])return!1;return!0},t.hashCode=function(e){var n,r;if(e===null)return 0;var o=1;try{for(var i=SS(e),a=i.next();!a.done;a=i.next())o=31*o+a.value}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},t.fillUint8Array=function(e,n){for(var r=0;r!==e.length;r++)e[r]=n},t.copyOf=function(e,n){return e.slice(0,n)},t.copyOfUint8Array=function(e,n){if(e.length<=n){var r=new Uint8Array(n);return r.set(e),r}return e.slice(0,n)},t.copyOfRange=function(e,n,r){var o=r-n,i=new Int32Array(o);return Nt.arraycopy(e,n,i,0,o),i},t.binarySearch=function(e,n,r){r===void 0&&(r=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=r(n,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(e,n){return e-n},t}(),En=function(){function t(){}return t.numberOfTrailingZeros=function(e){var n;if(e===0)return 32;var r=31;return(n=e<<16)!==0&&(r-=16,e=n),(n=e<<8)!==0&&(r-=8,e=n),(n=e<<4)!==0&&(r-=4,e=n),(n=e<<2)!==0&&(r-=2,e=n),r-(e<<1>>>31)},t.numberOfLeadingZeros=function(e){if(e===0)return 32;var n=1;return!(e>>>16)&&(n+=16,e<<=16),!(e>>>24)&&(n+=8,e<<=8),!(e>>>28)&&(n+=4,e<<=4),!(e>>>30)&&(n+=2,e<<=2),n-=e>>>31},t.toHexString=function(e){return e.toString(16)},t.toBinaryString=function(e){return String(parseInt(String(e),2))},t.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},t.truncDivision=function(e,n){return Math.trunc(e/n)},t.parseInt=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Ur=function(){function t(e,n){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=n??t.makeArray(e))}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var n=t.makeArray(e);Nt.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},t.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(31&e))!=0},t.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},t.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},t.prototype.getNextSet=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+En.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.getNextUnset=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=~r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+En.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.setBulk=function(e,n){this.bits[Math.floor(e/32)]=n},t.prototype.setRange=function(e,n){if(n<e||e<0||n>this.size)throw new Ve;if(n!==e){n--;for(var r=Math.floor(e/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(a<o?31:31&n))-(1<<(a>r?0:31&e));i[a]|=s}}},t.prototype.clear=function(){for(var e=this.bits.length,n=this.bits,r=0;r<e;r++)n[r]=0},t.prototype.isRange=function(e,n,r){if(n<e||e<0||n>this.size)throw new Ve;if(n===e)return!0;n--;for(var o=Math.floor(e/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var c=(2<<(s<i?31:31&n))-(1<<(s>o?0:31&e))&4294967295;if((a[s]&c)!==(r?c:0))return!1}return!0},t.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(e,n){if(n<0||n>32)throw new Ve("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((e>>r-1&1)==1)},t.prototype.appendBitArray=function(e){var n=e.size;this.ensureCapacity(this.size+n);for(var r=0;r<n;r++)this.appendBit(e.get(r))},t.prototype.xor=function(e){if(this.size!==e.size)throw new Ve("Sizes don't match");for(var n=this.bits,r=0,o=n.length;r<o;r++)n[r]^=e.bits[r]},t.prototype.toBytes=function(e,n,r,o){for(var i=0;i<o;i++){for(var a=0,s=0;s<8;s++)this.get(e)&&(a|=1<<7-s),e++;n[r+i]=a}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),n=Math.floor((this.size-1)/32),r=n+1,o=this.bits,i=0;i<r;i++){var a=o[i];a=(a=(a=(a=(a=a>>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,e[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,c=e[0]>>>s;for(i=1;i<r;i++){var u=e[i];c|=u<<32-s,e[i-1]=c,c=u>>>s}e[r-1]=c}this.bits=e},t.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.size===n.size&&or.equals(this.bits,n.bits)},t.prototype.hashCode=function(){return 31*this.size+or.hashCode(this.bits)},t.prototype.toString=function(){for(var e="",n=0,r=this.size;n<r;n++)!(7&n)&&(e+=" "),e+=this.get(n)?"X":".";return e},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(vf||(vf={}));var _t,Pt=vf,IS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return IS(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}($n),TS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"})(_t||(_t={}));var bf,Yn=function(){function t(e,n,r){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=r,this.values=typeof n=="number"?Int32Array.from([n]):n,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(r,this);for(var c=this.values,u=0,d=c.length;u!==d;u++){var h=c[u];t.VALUES_TO_ECI.set(h,this)}try{for(var f=TS(a),p=f.next();!p.done;p=f.next()){var l=p.value;t.NAME_TO_ECI.set(l,this)}}catch(g){o={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Se("incorect value");var n=t.VALUES_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.getCharacterSetECIByName=function(e){var n=t.NAME_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.getName()===n.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(_t.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(_t.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(_t.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(_t.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(_t.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(_t.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(_t.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(_t.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(_t.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(_t.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(_t.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(_t.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(_t.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(_t.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(_t.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(_t.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(_t.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(_t.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(_t.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(_t.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(_t.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(_t.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(_t.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(_t.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(_t.Big5,28,"Big5"),t.GB18030=new t(_t.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(_t.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),xS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),su=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return xS(e,t),e.kind="UnsupportedOperationException",e}($n),ci=function(){function t(){}return t.decode=function(e,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(e,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&e==="ISO-8859-1"},t.encode=function(e,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(e,r):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},t.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},t.encodingName=function(e){return typeof e=="string"?e:e.getName()},t.encodingCharacterSet=function(e){return e instanceof Yn?e:Yn.getCharacterSetECIByName(e)},t.decodeFallback=function(e,n){var r=this.encodingCharacterSet(n);if(t.isDecodeFallbackSupported(r)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(r.equals(Yn.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new su("Encoding "+this.encodingName(n)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(e){return e.equals(Yn.UTF8)||e.equals(Yn.ISO8859_1)||e.equals(Yn.ASCII)},t.encodeFallback=function(e){for(var n=btoa(unescape(encodeURIComponent(e))).split(""),r=[],o=0;o<n.length;o++)r.push(n[o].charCodeAt(0));return new Uint8Array(r)},t}(),pn=function(){function t(){}return t.castAsNonUtf8Char=function(e,n){n===void 0&&(n=null);var r=n?n.getName():this.ISO88591;return ci.decode(new Uint8Array([e]),r)},t.guessEncoding=function(e,n){if(n!=null&&n.get(Pt.CHARACTER_SET)!==void 0)return n.get(Pt.CHARACTER_SET).toString();for(var r=e.length,o=!0,i=!0,a=!0,s=0,c=0,u=0,d=0,h=0,f=0,p=0,l=0,g=0,m=0,y=0,w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,b=0;b<r&&(o||i||a);b++){var E=255&e[b];a&&(s>0?128&E?s--:a=!1:128&E&&(64&E?(s++,32&E?(s++,16&E?(s++,8&E?a=!1:d++):u++):c++):a=!1)),o&&(E>127&&E<160?o=!1:E>159&&(E<192||E===215||E===247)&&y++),i&&(h>0?E<64||E===127||E>252?i=!1:h--:E===128||E===160||E>239?i=!1:E>160&&E<224?(f++,l=0,++p>g&&(g=p)):E>127?(h++,p=0,++l>m&&(m=l)):(p=0,l=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(w||c+u+d>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?g===2&&f===2||10*y>=r?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=-1;function i(s,c,u,d,h,f){if(s==="%%")return"%";if(n[++o]!==void 0){s=d?parseInt(d.substr(1)):void 0;var p,l=h?parseInt(h.substr(1)):void 0;switch(f){case"s":p=n[o];break;case"c":p=n[o][0];break;case"f":p=parseFloat(n[o]).toFixed(s);break;case"p":p=parseFloat(n[o]).toPrecision(s);break;case"e":p=parseFloat(n[o]).toExponential(s);break;case"x":p=parseInt(n[o]).toString(l||16);break;case"d":p=parseFloat(parseInt(n[o],l||10).toPrecision(s)).toFixed(0)}p=typeof p=="object"?JSON.stringify(p):(+p).toString(l);for(var g=parseInt(u),m=u&&u[0]+""=="0"?"0":" ";p.length<g;)p=c!==void 0?p+m:m+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(a,i)},t.getBytes=function(e,n){return ci.encode(e,n)},t.getCharCode=function(e,n){return n===void 0&&(n=0),e.charCodeAt(n)},t.getCharAt=function(e){return String.fromCharCode(e)},t.SHIFT_JIS=Yn.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Yn.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Yn.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),xt=function(){function t(e){e===void 0&&(e=""),this.value=e}return t.prototype.enableDecoding=function(e){return this.encoding=e,this},t.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=pn.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},t.prototype.appendChars=function(e,n,r){for(var o=n;n<n+r;o++)this.append(e[o]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(e){return this.value.charAt(e)},t.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},t.prototype.setCharAt=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+1)},t.prototype.substring=function(e,n){return this.value.substring(e,n)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+n.length)},t}(),oo=function(){function t(e,n,r,o){if(this.width=e,this.height=n,this.rowSize=r,this.bits=o,n==null&&(n=e),this.height=n,e<1||n<1)throw new Ve("Both dimensions must be greater than 0");r==null&&(r=Math.floor((e+31)/32)),this.rowSize=r,o==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var n=e.length,r=e[0].length,o=new t(r,n),i=0;i<n;i++)for(var a=e[i],s=0;s<r;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,n,r){if(e===null)throw new Ve("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,c=0,u=0;u<e.length;)if(e.charAt(u)===`
135
+ */var _m;function MA(){return _m||(_m=1,process.env.NODE_ENV!=="production"&&function(){var t=typeof Symbol=="function"&&Symbol.for,e=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,r=t?Symbol.for("react.fragment"):60107,o=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,a=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,h=t?Symbol.for("react.suspense"):60113,f=t?Symbol.for("react.suspense_list"):60120,p=t?Symbol.for("react.memo"):60115,l=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,m=t?Symbol.for("react.fundamental"):60117,y=t?Symbol.for("react.responder"):60118,w=t?Symbol.for("react.scope"):60119;function b(B){return typeof B=="string"||typeof B=="function"||B===r||B===u||B===i||B===o||B===h||B===f||typeof B=="object"&&B!==null&&(B.$$typeof===l||B.$$typeof===p||B.$$typeof===a||B.$$typeof===s||B.$$typeof===d||B.$$typeof===m||B.$$typeof===y||B.$$typeof===w||B.$$typeof===g)}function E(B){if(typeof B=="object"&&B!==null){var Q=B.$$typeof;switch(Q){case e:var Z=B.type;switch(Z){case c:case u:case r:case i:case o:case h:return Z;default:var ee=Z&&Z.$$typeof;switch(ee){case s:case d:case l:case p:case a:return ee;default:return Q}}case n:return Q}}}var C=c,I=u,T=s,P=a,N=e,L=d,V=r,j=l,W=p,q=n,k=i,U=o,z=h,te=!1;function oe(B){return te||(te=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),ne(B)||E(B)===c}function ne(B){return E(B)===u}function se(B){return E(B)===s}function we(B){return E(B)===a}function le(B){return typeof B=="object"&&B!==null&&B.$$typeof===e}function _e(B){return E(B)===d}function ve(B){return E(B)===r}function H(B){return E(B)===l}function $(B){return E(B)===p}function J(B){return E(B)===n}function S(B){return E(B)===i}function M(B){return E(B)===o}function F(B){return E(B)===h}bt.AsyncMode=C,bt.ConcurrentMode=I,bt.ContextConsumer=T,bt.ContextProvider=P,bt.Element=N,bt.ForwardRef=L,bt.Fragment=V,bt.Lazy=j,bt.Memo=W,bt.Portal=q,bt.Profiler=k,bt.StrictMode=U,bt.Suspense=z,bt.isAsyncMode=oe,bt.isConcurrentMode=ne,bt.isContextConsumer=se,bt.isContextProvider=we,bt.isElement=le,bt.isForwardRef=_e,bt.isFragment=ve,bt.isLazy=H,bt.isMemo=$,bt.isPortal=J,bt.isProfiler=S,bt.isStrictMode=M,bt.isSuspense=F,bt.isValidElementType=b,bt.typeOf=E}()),bt}process.env.NODE_ENV==="production"?hf.exports=DA():hf.exports=MA();var LA=hf.exports,Am=LA,FA={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},jA={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Sm={};Sm[Am.ForwardRef]=FA,Sm[Am.Memo]=jA;const VA=new WeakSet;function UA(t){const e=BA({...t,instrumentPageLoad:!1,instrumentNavigation:!1}),{useEffect:n,useLocation:r,useNavigationType:o,createRoutesFromChildren:i,matchRoutes:a,stripBasename:s,instrumentPageLoad:c=!0,instrumentNavigation:u=!0}=t;return{...e,setup(){},afterAllSetup(d){e.afterAllSetup(d);const h=Ze&&Ze.location&&Ze.location.pathname;c&&h&&bm(d,{name:h,attributes:{[eo]:"url",[ko]:"pageload",[an]:"auto.pageload.react.reactrouter_v6"}}),u&&VA.add(d)}}}function GA(){const{t}=Ue(),[e,n]=x.useState(!1);return v.jsx("div",{className:"default-bg-colors flex h-screen items-center justify-center",children:v.jsxs("div",{className:"overflow-hidden rounded-lg border border-gray-300 bg-white shadow-lg",children:[v.jsx("div",{className:"border-b border-gray-200 bg-gray-50 px-6 pb-3 pt-4 shadow",children:v.jsx("h2",{className:"text-3xl",children:"Oops!"})}),v.jsx("p",{className:"mt-4 px-6 text-gray-900",children:t("sorrySomethingWentWrong")}),v.jsx("div",{className:"mt-10 p-6",children:v.jsx(nt,{onClick:()=>{n(!0),window.location.replace("/")},pending:e,label:t("back")})})]})})}class qA extends x.Component{constructor(e){super(e),this.state={hasError:!1,scope:void 0}}componentDidMount(){const e=bA().filter(o=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(o.name)),n=new S5({dsn:"https://5b16c396f6e8f6e4b0b87455bea7e96b@o80526.ingest.us.sentry.io/4507345428283392",transport:L_,stackParser:Y_,integrations:[...e,UA({useEffect:x.useEffect,useLocation:er,useNavigationType:k3,createRoutesFromChildren:nc,matchRoutes:L1})]}),r=new Po;r.setClient(n),n.init(),this.setState({...this.state,scope:r})}componentDidCatch(e,n){console.error("ErrorBoundary: ",e,n),this.state.scope.captureException(e),this.setState({...this.state,hasError:!0})}render(){return this.state.hasError?v.jsx(GA,{}):this.props.children}}function je(){const t=x.useContext(sh);if(!t)throw new Error("Only use 'usePortalSessionContext' within a PortalSessionProvider");return t}const HA={[Kt.GENERIC]:Le.GENERIC,[Kt.PORTAL]:Le.PORTAL,[Kt.POINTS_TRANSACTION]:Le.POINTS_TRANSACTION,[Kt.PREPAID]:Le.PREPAID,[Kt.PAY_PREPAID]:Le.PREPAID,[Kt.TOP_UP_PREPAID]:Le.PREPAID,[Kt.VOUCHER]:Le.VOUCHER,[Kt.GIFTCARD]:Le.GIFTCARD,[Kt.REDEEM_GIFTCARD]:Le.GIFTCARD,[Kt.TOP_UP_GIFTCARD]:Le.GIFTCARD};function $A(){const{portalSession:t}=je();return v.jsx(dr,{to:HA[t.type]})}function si({onSubmit:t,children:e}){const n=r=>{r.preventDefault(),t&&t(r)};return v.jsx("form",{onSubmit:n,children:e})}const Im=x.createContext({cameraService:1,cameraFacingMode:vn.USER,primaryIdentificationMethod:Ci.IDENTIFIER});function Xt(){const t=x.useContext(Im);if(!t)throw new Error("Only use 'useConfigurationContext' within a ConfigurationContext Provider");return t}var Tm={},Hn={};Object.defineProperty(Hn,"__esModule",{value:!0}),Hn.compactObject=km,Hn.deprecated=e7;var YA=Hn.detectBrowser=t7;Hn.disableLog=QA,Hn.disableWarnings=JA,Hn.extractVersion=tu,Hn.filterStats=n7,Hn.log=ZA,Hn.walkStats=nu,Hn.wrapPeerConnectionEvent=XA;function WA(t,e,n){return e=KA(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function KA(t){var e=zA(t,"string");return No(e)=="symbol"?e:e+""}function zA(t,e){if(No(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(No(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function No(t){"@babel/helpers - typeof";return No=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},No(t)}var xm=!0,Om=!0;function tu(t,e,n){var r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function XA(t,e,n){if(t.RTCPeerConnection){var r=t.RTCPeerConnection.prototype,o=r.addEventListener;r.addEventListener=function(a,s){if(a!==e)return o.apply(this,arguments);var c=function(d){var h=n(d);h&&(s.handleEvent?s.handleEvent(h):s(h))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(s,c),o.apply(this,[a,c])};var i=r.removeEventListener;r.removeEventListener=function(a,s){if(a!==e||!this._eventMap||!this._eventMap[e])return i.apply(this,arguments);if(!this._eventMap[e].has(s))return i.apply(this,arguments);var c=this._eventMap[e].get(s);return this._eventMap[e].delete(s),this._eventMap[e].size===0&&delete this._eventMap[e],Object.keys(this._eventMap).length===0&&delete this._eventMap,i.apply(this,[a,c])},Object.defineProperty(r,"on"+e,{get:function(){return this["_on"+e]},set:function(s){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),s&&this.addEventListener(e,this["_on"+e]=s)},enumerable:!0,configurable:!0})}}function QA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(xm=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function JA(t){return typeof t!="boolean"?new Error("Argument type: "+No(t)+". Please use a boolean."):(Om=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function ZA(){if((typeof window>"u"?"undefined":No(window))==="object"){if(xm)return;typeof console<"u"&&typeof console.log=="function"&&console.log.apply(console,arguments)}}function e7(t,e){Om&&console.warn(t+" is deprecated, please use "+e+" instead.")}function t7(t){var e={browser:null,version:null};if(typeof t>"u"||!t.navigator||!t.navigator.userAgent)return e.browser="Not a browser.",e;var n=t.navigator;if(n.userAgentData&&n.userAgentData.brands){var r=n.userAgentData.brands.find(function(o){return o.brand==="Chromium"});if(r)return{browser:"chrome",version:parseInt(r.version,10)}}if(n.mozGetUserMedia)e.browser="firefox",e.version=tu(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||t.isSecureContext===!1&&t.webkitRTCPeerConnection)e.browser="chrome",e.version=tu(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else if(t.RTCPeerConnection&&n.userAgent.match(/AppleWebKit\/(\d+)\./))e.browser="safari",e.version=tu(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype;else return e.browser="Not a supported browser.",e;return e}function Pm(t){return Object.prototype.toString.call(t)==="[object Object]"}function km(t){return Pm(t)?Object.keys(t).reduce(function(e,n){var r=Pm(t[n]),o=r?km(t[n]):t[n],i=r&&!Object.keys(o).length;return o===void 0||i?e:Object.assign(e,WA({},n,o))},{}):t}function nu(t,e,n){!e||n.has(e.id)||(n.set(e.id,e),Object.keys(e).forEach(function(r){r.endsWith("Id")?nu(t,t.get(e[r]),n):r.endsWith("Ids")&&e[r].forEach(function(o){nu(t,t.get(o),n)})}))}function n7(t,e,n){var r=n?"outbound-rtp":"inbound-rtp",o=new Map;if(e===null)return o;var i=[];return t.forEach(function(a){a.type==="track"&&a.trackIdentifier===e.id&&i.push(a)}),i.forEach(function(a){t.forEach(function(s){s.type===r&&s.trackId===a.id&&nu(t,s,o)})}),o}Object.defineProperty(Tm,"__esModule",{value:!0});var r7=Tm.shimGetUserMedia=a7,o7=i7(Hn);function Bm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Bm=function(o){return o?n:e})(t)}function i7(t,e){if(t&&t.__esModule)return t;if(t===null||Ro(t)!="object"&&typeof t!="function")return{default:t};var n=Bm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Ro(t){"@babel/helpers - typeof";return Ro=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ro(t)}var Nm=o7.log;function a7(t,e){var n=t&&t.navigator;if(n.mediaDevices){var r=function(u){if(Ro(u)!=="object"||u.mandatory||u.optional)return u;var d={};return Object.keys(u).forEach(function(h){if(!(h==="require"||h==="advanced"||h==="mediaSource")){var f=Ro(u[h])==="object"?u[h]:{ideal:u[h]};f.exact!==void 0&&typeof f.exact=="number"&&(f.min=f.max=f.exact);var p=function(m,y){return m?m+y.charAt(0).toUpperCase()+y.slice(1):y==="deviceId"?"sourceId":y};if(f.ideal!==void 0){d.optional=d.optional||[];var l={};typeof f.ideal=="number"?(l[p("min",h)]=f.ideal,d.optional.push(l),l={},l[p("max",h)]=f.ideal,d.optional.push(l)):(l[p("",h)]=f.ideal,d.optional.push(l))}f.exact!==void 0&&typeof f.exact!="number"?(d.mandatory=d.mandatory||{},d.mandatory[p("",h)]=f.exact):["min","max"].forEach(function(g){f[g]!==void 0&&(d.mandatory=d.mandatory||{},d.mandatory[p(g,h)]=f[g])})}}),u.advanced&&(d.optional=(d.optional||[]).concat(u.advanced)),d},o=function(u,d){if(e.version>=61)return d(u);if(u=JSON.parse(JSON.stringify(u)),u&&Ro(u.audio)==="object"){var h=function(m,y,w){y in m&&!(w in m)&&(m[w]=m[y],delete m[y])};u=JSON.parse(JSON.stringify(u)),h(u.audio,"autoGainControl","googAutoGainControl"),h(u.audio,"noiseSuppression","googNoiseSuppression"),u.audio=r(u.audio)}if(u&&Ro(u.video)==="object"){var f=u.video.facingMode;f=f&&(Ro(f)==="object"?f:{ideal:f});var p=e.version<66;if(f&&(f.exact==="user"||f.exact==="environment"||f.ideal==="user"||f.ideal==="environment")&&!(n.mediaDevices.getSupportedConstraints&&n.mediaDevices.getSupportedConstraints().facingMode&&!p)){delete u.video.facingMode;var l;if(f.exact==="environment"||f.ideal==="environment"?l=["back","rear"]:(f.exact==="user"||f.ideal==="user")&&(l=["front"]),l)return n.mediaDevices.enumerateDevices().then(function(g){g=g.filter(function(y){return y.kind==="videoinput"});var m=g.find(function(y){return l.some(function(w){return y.label.toLowerCase().includes(w)})});return!m&&g.length&&l.includes("back")&&(m=g[g.length-1]),m&&(u.video.deviceId=f.exact?{exact:m.deviceId}:{ideal:m.deviceId}),u.video=r(u.video),Nm("chrome: "+JSON.stringify(u)),d(u)})}u.video=r(u.video)}return Nm("chrome: "+JSON.stringify(u)),d(u)},i=function(u){return e.version>=64?u:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[u.name]||u.name,message:u.message,constraint:u.constraint||u.constraintName,toString:function(){return this.name+(this.message&&": ")+this.message}}},a=function(u,d,h){o(u,function(f){n.webkitGetUserMedia(f,d,function(p){h&&h(i(p))})})};if(n.getUserMedia=a.bind(n),n.mediaDevices.getUserMedia){var s=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(c){return o(c,function(u){return s(u).then(function(d){if(u.audio&&!d.getAudioTracks().length||u.video&&!d.getVideoTracks().length)throw d.getTracks().forEach(function(h){h.stop()}),new DOMException("","NotFoundError");return d},function(d){return Promise.reject(i(d))})})}}}}var Rm={};Object.defineProperty(Rm,"__esModule",{value:!0});var s7=Rm.shimGetUserMedia=l7,c7=u7(Hn);function Dm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Dm=function(o){return o?n:e})(t)}function u7(t,e){if(t&&t.__esModule)return t;if(t===null||Qi(t)!="object"&&typeof t!="function")return{default:t};var n=Dm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Qi(t){"@babel/helpers - typeof";return Qi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Qi(t)}function l7(t,e){var n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(c,u,d){c7.deprecated("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(c).then(u,d)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){var o=function(u,d,h){d in u&&!(h in u)&&(u[h]=u[d],delete u[d])},i=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(c){return Qi(c)==="object"&&Qi(c.audio)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c.audio,"autoGainControl","mozAutoGainControl"),o(c.audio,"noiseSuppression","mozNoiseSuppression")),i(c)},r&&r.prototype.getSettings){var a=r.prototype.getSettings;r.prototype.getSettings=function(){var c=a.apply(this,arguments);return o(c,"mozAutoGainControl","autoGainControl"),o(c,"mozNoiseSuppression","noiseSuppression"),c}}if(r&&r.prototype.applyConstraints){var s=r.prototype.applyConstraints;r.prototype.applyConstraints=function(c){return this.kind==="audio"&&Qi(c)==="object"&&(c=JSON.parse(JSON.stringify(c)),o(c,"autoGainControl","mozAutoGainControl"),o(c,"noiseSuppression","mozNoiseSuppression")),s.apply(this,[c])}}}}var Vr={};Object.defineProperty(Vr,"__esModule",{value:!0}),Vr.shimAudioContext=b7,Vr.shimCallbacksAPI=g7,Vr.shimConstraints=Fm,Vr.shimCreateOfferLegacy=w7;var d7=Vr.shimGetUserMedia=m7;Vr.shimLocalStreamsAPI=h7,Vr.shimRTCIceServerUrls=y7,Vr.shimRemoteStreamsAPI=p7,Vr.shimTrackEventTransceiver=v7;var Mm=f7(Hn);function Lm(t){if(typeof WeakMap!="function")return null;var e=new WeakMap,n=new WeakMap;return(Lm=function(o){return o?n:e})(t)}function f7(t,e){if(t&&t.__esModule)return t;if(t===null||Do(t)!="object"&&typeof t!="function")return{default:t};var n=Lm(e);if(n&&n.has(t))return n.get(t);var r={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var i in t)if(i!=="default"&&{}.hasOwnProperty.call(t,i)){var a=o?Object.getOwnPropertyDescriptor(t,i):null;a&&(a.get||a.set)?Object.defineProperty(r,i,a):r[i]=t[i]}return r.default=t,n&&n.set(t,r),r}function Do(t){"@babel/helpers - typeof";return Do=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Do(t)}function h7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){var e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(r){var o=this;this._localStreams||(this._localStreams=[]),this._localStreams.includes(r)||this._localStreams.push(r),r.getAudioTracks().forEach(function(i){return e.call(o,i,r)}),r.getVideoTracks().forEach(function(i){return e.call(o,i,r)})},t.RTCPeerConnection.prototype.addTrack=function(r){for(var o=this,i=arguments.length,a=new Array(i>1?i-1:0),s=1;s<i;s++)a[s-1]=arguments[s];return a&&a.forEach(function(c){o._localStreams?o._localStreams.includes(c)||o._localStreams.push(c):o._localStreams=[c]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(r){var o=this;this._localStreams||(this._localStreams=[]);var i=this._localStreams.indexOf(r);if(i!==-1){this._localStreams.splice(i,1);var a=r.getTracks();this.getSenders().forEach(function(s){a.includes(s.track)&&o.removeTrack(s)})}})}}function p7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get:function(){return this._onaddstream},set:function(r){var o=this;this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=r),this.addEventListener("track",this._onaddstreampoly=function(i){i.streams.forEach(function(a){if(o._remoteStreams||(o._remoteStreams=[]),!o._remoteStreams.includes(a)){o._remoteStreams.push(a);var s=new Event("addstream");s.stream=a,o.dispatchEvent(s)}})})}});var e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){var r=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(o){o.streams.forEach(function(i){if(r._remoteStreams||(r._remoteStreams=[]),!(r._remoteStreams.indexOf(i)>=0)){r._remoteStreams.push(i);var a=new Event("addstream");a.stream=i,r.dispatchEvent(a)}})}),e.apply(r,arguments)}}}function g7(t){if(!(Do(t)!=="object"||!t.RTCPeerConnection)){var e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,o=e.setLocalDescription,i=e.setRemoteDescription,a=e.addIceCandidate;e.createOffer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=n.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f},e.createAnswer=function(u,d){var h=arguments.length>=2?arguments[2]:arguments[0],f=r.apply(this,[h]);return d?(f.then(u,d),Promise.resolve()):f};var s=function(u,d,h){var f=o.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f};e.setLocalDescription=s,s=function(u,d,h){var f=i.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.setRemoteDescription=s,s=function(u,d,h){var f=a.apply(this,[u]);return h?(f.then(d,h),Promise.resolve()):f},e.addIceCandidate=s}}function m7(t){var e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){var n=e.mediaDevices,r=n.getUserMedia.bind(n);e.mediaDevices.getUserMedia=function(o){return r(Fm(o))}}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=(function(i,a,s){e.mediaDevices.getUserMedia(i).then(a,s)}).bind(e))}function Fm(t){return t&&t.video!==void 0?Object.assign({},t,{video:Mm.compactObject(t.video)}):t}function y7(t){if(t.RTCPeerConnection){var e=t.RTCPeerConnection;t.RTCPeerConnection=function(r,o){if(r&&r.iceServers){for(var i=[],a=0;a<r.iceServers.length;a++){var s=r.iceServers[a];s.urls===void 0&&s.url?(Mm.deprecated("RTCIceServer.url","RTCIceServer.urls"),s=JSON.parse(JSON.stringify(s)),s.urls=s.url,delete s.url,i.push(s)):i.push(r.iceServers[a])}r.iceServers=i}return new e(r,o)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:function(){return e.generateCertificate}})}}function v7(t){Do(t)==="object"&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get:function(){return{receiver:this.receiver}}})}function w7(t){var e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(r){if(r){typeof r.offerToReceiveAudio<"u"&&(r.offerToReceiveAudio=!!r.offerToReceiveAudio);var o=this.getTransceivers().find(function(a){return a.receiver.track.kind==="audio"});r.offerToReceiveAudio===!1&&o?o.direction==="sendrecv"?o.setDirection?o.setDirection("sendonly"):o.direction="sendonly":o.direction==="recvonly"&&(o.setDirection?o.setDirection("inactive"):o.direction="inactive"):r.offerToReceiveAudio===!0&&!o&&this.addTransceiver("audio",{direction:"recvonly"}),typeof r.offerToReceiveVideo<"u"&&(r.offerToReceiveVideo=!!r.offerToReceiveVideo);var i=this.getTransceivers().find(function(a){return a.receiver.track.kind==="video"});r.offerToReceiveVideo===!1&&i?i.direction==="sendrecv"?i.setDirection?i.setDirection("sendonly"):i.direction="sendonly":i.direction==="recvonly"&&(i.setDirection?i.setDirection("inactive"):i.direction="inactive"):r.offerToReceiveVideo===!0&&!i&&this.addTransceiver("video",{direction:"recvonly"})}return e.apply(this,arguments)}}function b7(t){Do(t)!=="object"||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var jm=t=>{throw TypeError(t)},Vm=(t,e,n)=>e.has(t)||jm("Cannot "+n),E7=(t,e,n)=>(Vm(t,e,"read from private field"),n?n.call(t):e.get(t)),C7=(t,e,n)=>e.has(t)?jm("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),_7=(t,e,n,r)=>(Vm(t,e,"write to private field"),e.set(t,n),n);const Um=["Aztec","Codabar","Code128","Code39","Code93","DataBar","DataBarExpanded","DataBarLimited","DataMatrix","DXFilmEdge","EAN-13","EAN-8","ITF","Linear-Codes","Matrix-Codes","MaxiCode","MicroQRCode","None","PDF417","QRCode","rMQRCode","UPC-A","UPC-E"];function A7(t){return t.join("|")}function S7(t){const e=Gm(t);let n=0,r=Um.length-1;for(;n<=r;){const o=Math.floor((n+r)/2),i=Um[o],a=Gm(i);if(a===e)return i;a<e?n=o+1:r=o-1}return"None"}function Gm(t){return t.toLowerCase().replace(/_-\[\]/g,"")}function I7(t,e){return t.Binarizer[e]}function T7(t,e){return t.CharacterSet[e]}const x7=["Text","Binary","Mixed","GS1","ISO15434","UnknownECI"];function O7(t){return x7[t.value]}function P7(t,e){return t.EanAddOnSymbol[e]}function k7(t,e){return t.TextMode[e]}const Ji={formats:[],tryHarder:!0,tryRotate:!0,tryInvert:!0,tryDownscale:!0,binarizer:"LocalAverage",isPure:!1,downscaleFactor:3,downscaleThreshold:500,minLineCount:2,maxNumberOfSymbols:255,tryCode39ExtendedMode:!1,validateCode39CheckSum:!1,validateITFCheckSum:!1,returnCodabarStartEnd:!1,returnErrors:!1,eanAddOnSymbol:"Read",textMode:"Plain",characterSet:"Unknown"};function qm(t,e){return{...e,formats:A7(e.formats),binarizer:I7(t,e.binarizer),eanAddOnSymbol:P7(t,e.eanAddOnSymbol),textMode:k7(t,e.textMode),characterSet:T7(t,e.characterSet)}}function Hm(t){return{...t,format:S7(t.format),eccLevel:t.eccLevel,contentType:O7(t.contentType)}}const B7={locateFile:(t,e)=>{const n=t.match(/_(.+?)\.wasm$/);return n?`https://fastly.jsdelivr.net/npm/zxing-wasm@1.3.4/dist/${n[1]}/${t}`:e+t}};let $m=new WeakMap;function pf(t,e){var n;const r=$m.get(t);if(r!=null&&r.modulePromise&&e===void 0)return r.modulePromise;const o=(n=r==null?void 0:r.moduleOverrides)!=null?n:B7,i=t({...o});return $m.set(t,{moduleOverrides:o,modulePromise:i}),i}async function N7(t,e,n=Ji){const r={...Ji,...n},o=await pf(t),{size:i}=e,a=new Uint8Array(await e.arrayBuffer()),s=o._malloc(i);o.HEAPU8.set(a,s);const c=o.readBarcodesFromImage(s,i,qm(o,r));o._free(s);const u=[];for(let d=0;d<c.size();++d)u.push(Hm(c.get(d)));return u}async function R7(t,e,n=Ji){const r={...Ji,...n},o=await pf(t),{data:i,width:a,height:s,data:{byteLength:c}}=e,u=o._malloc(c);o.HEAPU8.set(i,u);const d=o.readBarcodesFromPixmap(u,a,s,qm(o,r));o._free(u);const h=[];for(let f=0;f<d.size();++f)h.push(Hm(d.get(f)));return h}({...Ji,formats:[...Ji.formats]});var gf=(()=>{var t,e=typeof document<"u"&&((t=document.currentScript)==null?void 0:t.tagName.toUpperCase())==="SCRIPT"?document.currentScript.src:void 0;return function(n={}){var r,o=n,i,a,s=new Promise((_,A)=>{i=_,a=A}),c=typeof window=="object",u=typeof Bun<"u",d=typeof importScripts=="function";typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string"&&process.type!="renderer";var h=Object.assign({},o),f="./this.program",p="";function l(_){return o.locateFile?o.locateFile(_,p):p+_}var g,m;if(c||d||u){var y;d?p=self.location.href:typeof document<"u"&&((y=document.currentScript)===null||y===void 0?void 0:y.tagName.toUpperCase())==="SCRIPT"&&(p=document.currentScript.src),e&&(p=e),p.startsWith("blob:")?p="":p=p.substr(0,p.replace(/[?#].*/,"").lastIndexOf("/")+1),d&&(m=_=>{var A=new XMLHttpRequest;return A.open("GET",_,!1),A.responseType="arraybuffer",A.send(null),new Uint8Array(A.response)}),g=_=>fetch(_,{credentials:"same-origin"}).then(A=>A.ok?A.arrayBuffer():Promise.reject(new Error(A.status+" : "+A.url)))}var w=o.print||console.log.bind(console),b=o.printErr||console.error.bind(console);Object.assign(o,h),h=null,o.arguments&&o.arguments,o.thisProgram&&(f=o.thisProgram);var E=o.wasmBinary,C,I=!1,T,P,N,L,V,j,W,q;function k(){var _=C.buffer;o.HEAP8=T=new Int8Array(_),o.HEAP16=N=new Int16Array(_),o.HEAPU8=P=new Uint8Array(_),o.HEAPU16=L=new Uint16Array(_),o.HEAP32=V=new Int32Array(_),o.HEAPU32=j=new Uint32Array(_),o.HEAPF32=W=new Float32Array(_),o.HEAPF64=q=new Float64Array(_)}var U=[],z=[],te=[];function oe(){var _=o.preRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(we)),fe(U)}function ne(){fe(z)}function se(){var _=o.postRun;_&&(typeof _=="function"&&(_=[_]),_.forEach(_e)),fe(te)}function we(_){U.unshift(_)}function le(_){z.unshift(_)}function _e(_){te.unshift(_)}var ve=0,H=null;function $(_){var A;ve++,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve)}function J(_){var A;if(ve--,(A=o.monitorRunDependencies)===null||A===void 0||A.call(o,ve),ve==0&&H){var O=H;H=null,O()}}function S(_){var A;(A=o.onAbort)===null||A===void 0||A.call(o,_),_="Aborted("+_+")",b(_),I=!0,_+=". Build with -sASSERTIONS for more info.";var O=new WebAssembly.RuntimeError(_);throw a(O),O}var M="data:application/octet-stream;base64,",F=_=>_.startsWith(M);function B(){var _="zxing_reader.wasm";return F(_)?_:l(_)}var Q;function Z(_){if(_==Q&&E)return new Uint8Array(E);if(m)return m(_);throw"both async and sync fetching of the wasm failed"}function ee(_){return E?Promise.resolve().then(()=>Z(_)):g(_).then(A=>new Uint8Array(A),()=>Z(_))}function K(_,A,O){return ee(_).then(R=>WebAssembly.instantiate(R,A)).then(O,R=>{b(`failed to asynchronously prepare wasm: ${R}`),S(R)})}function ge(_,A,O,R){return!_&&typeof WebAssembly.instantiateStreaming=="function"&&!F(A)&&typeof fetch=="function"?fetch(A,{credentials:"same-origin"}).then(G=>{var X=WebAssembly.instantiateStreaming(G,O);return X.then(R,function(ae){return b(`wasm streaming compile failed: ${ae}`),b("falling back to ArrayBuffer instantiation"),K(A,O,R)})}):K(A,O,R)}function be(){return{a:NP}}function pe(){var _,A=be();function O(G,X){return jt=G.exports,C=jt.za,k(),Ty=jt.Da,le(jt.Aa),J(),jt}$();function R(G){O(G.instance)}if(o.instantiateWasm)try{return o.instantiateWasm(A,O)}catch(G){b(`Module.instantiateWasm callback failed with error: ${G}`),a(G)}return(_=Q)!==null&&_!==void 0||(Q=B()),ge(E,Q,A,R).catch(a),{}}var fe=_=>{_.forEach(A=>A(o))};o.noExitRuntime;var ye=_=>jy(_),ue=()=>Vy(),Oe=[],ke=0,at=_=>{var A=new ht(_);return A.get_caught()||(A.set_caught(!0),ke--),A.set_rethrown(!1),Oe.push(A),Gy(_),Ly(_)},ze=0,It=()=>{et(0,0);var _=Oe.pop();Uy(_.excPtr),ze=0};class ht{constructor(A){this.excPtr=A,this.ptr=A-24}set_type(A){j[this.ptr+4>>2]=A}get_type(){return j[this.ptr+4>>2]}set_destructor(A){j[this.ptr+8>>2]=A}get_destructor(){return j[this.ptr+8>>2]}set_caught(A){A=A?1:0,T[this.ptr+12]=A}get_caught(){return T[this.ptr+12]!=0}set_rethrown(A){A=A?1:0,T[this.ptr+13]=A}get_rethrown(){return T[this.ptr+13]!=0}init(A,O){this.set_adjusted_ptr(0),this.set_type(A),this.set_destructor(O)}set_adjusted_ptr(A){j[this.ptr+16>>2]=A}get_adjusted_ptr(){return j[this.ptr+16>>2]}}var wr=_=>{throw ze||(ze=_),ze},pt=_=>Fy(_),mn=_=>{var A=ze;if(!A)return pt(0),0;var O=new ht(A);O.set_adjusted_ptr(A);var R=O.get_type();if(!R)return pt(0),A;for(var G of _){if(G===0||G===R)break;var X=O.ptr+16;if(qy(G,R,X))return pt(G),A}return pt(R),A},Ot=()=>mn([]),De=_=>mn([_]),Pr=(_,A)=>mn([_,A]),ln=()=>{var _=Oe.pop();_||S("no exception to throw");var A=_.excPtr;throw _.get_rethrown()||(Oe.push(_),_.set_rethrown(!0),_.set_caught(!1),ke++),ze=A,ze},Dn=(_,A,O)=>{var R=new ht(_);throw R.init(A,O),ze=_,ke++,ze},Mn=()=>ke,Gr=()=>{S("")},Sn={},Ln=_=>{for(;_.length;){var A=_.pop(),O=_.pop();O(A)}};function dn(_){return this.fromWireType(j[_>>2])}var Qt={},zn={},qr={},Me,Ge=_=>{throw new Me(_)},qe=(_,A,O)=>{_.forEach(re=>qr[re]=A);function R(re){var me=O(re);me.length!==_.length&&Ge("Mismatched type converter count");for(var Ce=0;Ce<_.length;++Ce)sr(_[Ce],me[Ce])}var G=new Array(A.length),X=[],ae=0;A.forEach((re,me)=>{zn.hasOwnProperty(re)?G[me]=zn[re]:(X.push(re),Qt.hasOwnProperty(re)||(Qt[re]=[]),Qt[re].push(()=>{G[me]=zn[re],++ae,ae===X.length&&R(G)}))}),X.length===0&&R(G)},st=_=>{var A=Sn[_];delete Sn[_];var O=A.rawConstructor,R=A.rawDestructor,G=A.fields,X=G.map(ae=>ae.getterReturnType).concat(G.map(ae=>ae.setterArgumentType));qe([_],X,ae=>{var re={};return G.forEach((me,Ce)=>{var Te=me.fieldName,Be=ae[Ce],tt=me.getter,vt=me.getterContext,Rt=ae[Ce+G.length],fn=me.setter,en=me.setterContext;re[Te]={read:tn=>Be.fromWireType(tt(vt,tn)),write:(tn,yi)=>{var Fn=[];fn(en,tn,Rt.toWireType(Fn,yi)),Ln(Fn)}}}),[{name:A.name,fromWireType:me=>{var Ce={};for(var Te in re)Ce[Te]=re[Te].read(me);return R(me),Ce},toWireType:(me,Ce)=>{for(var Te in re)if(!(Te in Ce))throw new TypeError(`Missing field: "${Te}"`);var Be=O();for(Te in re)re[Te].write(Be,Ce[Te]);return me!==null&&me.push(R,Be),Be},argPackAdvance:br,readValueFromPointer:dn,destructorFunction:R}]})},Lt=(_,A,O,R,G)=>{},ca=()=>{for(var _=new Array(256),A=0;A<256;++A)_[A]=String.fromCharCode(A);mi=_},mi,Jt=_=>{for(var A="",O=_;P[O];)A+=mi[P[O++]];return A},ao,ct=_=>{throw new ao(_)};function Yf(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};var R=A.name;if(_||ct(`type "${R}" must have a positive integer typeid pointer`),zn.hasOwnProperty(_)){if(O.ignoreDuplicateRegistrations)return;ct(`Cannot register type '${R}' twice`)}if(zn[_]=A,delete qr[_],Qt.hasOwnProperty(_)){var G=Qt[_];delete Qt[_],G.forEach(X=>X())}}function sr(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return Yf(_,A,O)}var br=8,Y=(_,A,O,R)=>{A=Jt(A),sr(_,{name:A,fromWireType:function(G){return!!G},toWireType:function(G,X){return X?O:R},argPackAdvance:br,readValueFromPointer:function(G){return this.fromWireType(P[G])},destructorFunction:null})},Ee=_=>({count:_.count,deleteScheduled:_.deleteScheduled,preservePointerOnDelete:_.preservePointerOnDelete,ptr:_.ptr,ptrType:_.ptrType,smartPtr:_.smartPtr,smartPtrType:_.smartPtrType}),xe=_=>{function A(O){return O.$$.ptrType.registeredClass.name}ct(A(_)+" instance already deleted")},Ne=!1,ut=_=>{},At=_=>{_.smartPtr?_.smartPtrType.rawDestructor(_.smartPtr):_.ptrType.registeredClass.rawDestructor(_.ptr)},Je=_=>{_.count.value-=1;var A=_.count.value===0;A&&At(_)},Qe=(_,A,O)=>{if(A===O)return _;if(O.baseClass===void 0)return null;var R=Qe(_,A,O.baseClass);return R===null?null:O.downcast(R)},yn={},Ft={},Gt=(_,A)=>{for(A===void 0&&ct("ptr should not be undefined");_.baseClass;)A=_.upcast(A),_=_.baseClass;return A},Xn=(_,A)=>(A=Gt(_,A),Ft[A]),kr=(_,A)=>{(!A.ptrType||!A.ptr)&&Ge("makeClassHandle requires ptr and ptrType");var O=!!A.smartPtrType,R=!!A.smartPtr;return O!==R&&Ge("Both smartPtrType and smartPtr must be specified"),A.count={value:1},Zt(Object.create(_,{$$:{value:A,writable:!0}}))};function so(_){var A=this.getPointee(_);if(!A)return this.destructor(_),null;var O=Xn(this.registeredClass,A);if(O!==void 0){if(O.$$.count.value===0)return O.$$.ptr=A,O.$$.smartPtr=_,O.clone();var R=O.clone();return this.destructor(_),R}function G(){return this.isSmartPointer?kr(this.registeredClass.instancePrototype,{ptrType:this.pointeeType,ptr:A,smartPtrType:this,smartPtr:_}):kr(this.registeredClass.instancePrototype,{ptrType:this,ptr:_})}var X=this.registeredClass.getActualType(A),ae=yn[X];if(!ae)return G.call(this);var re;this.isConst?re=ae.constPointerType:re=ae.pointerType;var me=Qe(A,this.registeredClass,re.registeredClass);return me===null?G.call(this):this.isSmartPointer?kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me,smartPtrType:this,smartPtr:_}):kr(re.registeredClass.instancePrototype,{ptrType:re,ptr:me})}var Zt=_=>typeof FinalizationRegistry>"u"?(Zt=A=>A,_):(Ne=new FinalizationRegistry(A=>{Je(A.$$)}),Zt=A=>{var O=A.$$,R=!!O.smartPtr;if(R){var G={$$:O};Ne.register(A,G,A)}return A},ut=A=>Ne.unregister(A),Zt(_)),Vo=[],Wf=()=>{for(;Vo.length;){var _=Vo.pop();_.$$.deleteScheduled=!1,_.delete()}},Ou,pO=()=>{Object.assign(Pu.prototype,{isAliasOf(_){if(!(this instanceof Pu)||!(_ instanceof Pu))return!1;var A=this.$$.ptrType.registeredClass,O=this.$$.ptr;_.$$=_.$$;for(var R=_.$$.ptrType.registeredClass,G=_.$$.ptr;A.baseClass;)O=A.upcast(O),A=A.baseClass;for(;R.baseClass;)G=R.upcast(G),R=R.baseClass;return A===R&&O===G},clone(){if(this.$$.ptr||xe(this),this.$$.preservePointerOnDelete)return this.$$.count.value+=1,this;var _=Zt(Object.create(Object.getPrototypeOf(this),{$$:{value:Ee(this.$$)}}));return _.$$.count.value+=1,_.$$.deleteScheduled=!1,_},delete(){this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),ut(this),Je(this.$$),this.$$.preservePointerOnDelete||(this.$$.smartPtr=void 0,this.$$.ptr=void 0)},isDeleted(){return!this.$$.ptr},deleteLater(){return this.$$.ptr||xe(this),this.$$.deleteScheduled&&!this.$$.preservePointerOnDelete&&ct("Object already scheduled for deletion"),Vo.push(this),Vo.length===1&&Ou&&Ou(Wf),this.$$.deleteScheduled=!0,this}})};function Pu(){}var Ss=(_,A)=>Object.defineProperty(A,"name",{value:_}),Sy=(_,A,O)=>{if(_[A].overloadTable===void 0){var R=_[A];_[A]=function(){for(var G=arguments.length,X=new Array(G),ae=0;ae<G;ae++)X[ae]=arguments[ae];return _[A].overloadTable.hasOwnProperty(X.length)||ct(`Function '${O}' called with an invalid number of arguments (${X.length}) - expects one of (${_[A].overloadTable})!`),_[A].overloadTable[X.length].apply(this,X)},_[A].overloadTable=[],_[A].overloadTable[R.argCount]=R}},Kf=(_,A,O)=>{o.hasOwnProperty(_)?((O===void 0||o[_].overloadTable!==void 0&&o[_].overloadTable[O]!==void 0)&&ct(`Cannot register public name '${_}' twice`),Sy(o,_,_),o.hasOwnProperty(O)&&ct(`Cannot register multiple overloads of a function with the same number of arguments (${O})!`),o[_].overloadTable[O]=A):(o[_]=A,O!==void 0&&(o[_].numArguments=O))},gO=48,mO=57,yO=_=>{_=_.replace(/[^a-zA-Z0-9_]/g,"$");var A=_.charCodeAt(0);return A>=gO&&A<=mO?`_${_}`:_};function vO(_,A,O,R,G,X,ae,re){this.name=_,this.constructor=A,this.instancePrototype=O,this.rawDestructor=R,this.baseClass=G,this.getActualType=X,this.upcast=ae,this.downcast=re,this.pureVirtualFunctions=[]}var zf=(_,A,O)=>{for(;A!==O;)A.upcast||ct(`Expected null or instance of ${O.name}, got an instance of ${A.name}`),_=A.upcast(_),A=A.baseClass;return _};function wO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}function bO(_,A){var O;if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),this.isSmartPointer?(O=this.rawConstructor(),_!==null&&_.push(this.rawDestructor,O),O):0;(!A||!A.$$)&&ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),!this.isConst&&A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);var R=A.$$.ptrType.registeredClass;if(O=zf(A.$$.ptr,R,this.registeredClass),this.isSmartPointer)switch(A.$$.smartPtr===void 0&&ct("Passing raw pointer to smart pointer is illegal"),this.sharingPolicy){case 0:A.$$.smartPtrType===this?O=A.$$.smartPtr:ct(`Cannot convert argument of type ${A.$$.smartPtrType?A.$$.smartPtrType.name:A.$$.ptrType.name} to parameter type ${this.name}`);break;case 1:O=A.$$.smartPtr;break;case 2:if(A.$$.smartPtrType===this)O=A.$$.smartPtr;else{var G=A.clone();O=this.rawShare(O,uo.toHandle(()=>G.delete())),_!==null&&_.push(this.rawDestructor,O)}break;default:ct("Unsupporting sharing policy")}return O}function EO(_,A){if(A===null)return this.isReference&&ct(`null is not a valid ${this.name}`),0;A.$$||ct(`Cannot pass "${th(A)}" as a ${this.name}`),A.$$.ptr||ct(`Cannot pass deleted object as a pointer of type ${this.name}`),A.$$.ptrType.isConst&&ct(`Cannot convert argument of type ${A.$$.ptrType.name} to parameter type ${this.name}`);var O=A.$$.ptrType.registeredClass,R=zf(A.$$.ptr,O,this.registeredClass);return R}var CO=()=>{Object.assign(ku.prototype,{getPointee(_){return this.rawGetPointee&&(_=this.rawGetPointee(_)),_},destructor(_){var A;(A=this.rawDestructor)===null||A===void 0||A.call(this,_)},argPackAdvance:br,readValueFromPointer:dn,fromWireType:so})};function ku(_,A,O,R,G,X,ae,re,me,Ce,Te){this.name=_,this.registeredClass=A,this.isReference=O,this.isConst=R,this.isSmartPointer=G,this.pointeeType=X,this.sharingPolicy=ae,this.rawGetPointee=re,this.rawConstructor=me,this.rawShare=Ce,this.rawDestructor=Te,!G&&A.baseClass===void 0?R?(this.toWireType=wO,this.destructorFunction=null):(this.toWireType=EO,this.destructorFunction=null):this.toWireType=bO}var Iy=(_,A,O)=>{o.hasOwnProperty(_)||Ge("Replacing nonexistent public symbol"),o[_].overloadTable!==void 0&&O!==void 0?o[_].overloadTable[O]=A:(o[_]=A,o[_].argCount=O)},_O=(_,A,O)=>{_=_.replace(/p/g,"i");var R=o["dynCall_"+_];return R(A,...O)},Bu=[],Ty,ot=_=>{var A=Bu[_];return A||(_>=Bu.length&&(Bu.length=_+1),Bu[_]=A=Ty.get(_)),A},AO=function(_,A){let O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(_.includes("j"))return _O(_,A,O);var R=ot(A)(...O);return R},SO=(_,A)=>function(){for(var O=arguments.length,R=new Array(O),G=0;G<O;G++)R[G]=arguments[G];return AO(_,A,R)},Br=(_,A)=>{_=Jt(_);function O(){return _.includes("j")?SO(_,A):ot(A)}var R=O();return typeof R!="function"&&ct(`unknown function pointer with signature ${_}: ${A}`),R},IO=(_,A)=>{var O=Ss(A,function(R){this.name=A,this.message=R;var G=new Error(R).stack;G!==void 0&&(this.stack=this.toString()+`
136
+ `+G.replace(/^Error(:[^\n]*)?\n/,""))});return O.prototype=Object.create(_.prototype),O.prototype.constructor=O,O.prototype.toString=function(){return this.message===void 0?this.name:`${this.name}: ${this.message}`},O},xy,Oy=_=>{var A=My(_),O=Jt(A);return lo(A),O},Nu=(_,A)=>{var O=[],R={};function G(X){if(!R[X]&&!zn[X]){if(qr[X]){qr[X].forEach(G);return}O.push(X),R[X]=!0}}throw A.forEach(G),new xy(`${_}: `+O.map(Oy).join([", "]))},TO=(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,tt)=>{Te=Jt(Te),X=Br(G,X),re&&(re=Br(ae,re)),Ce&&(Ce=Br(me,Ce)),tt=Br(Be,tt);var vt=yO(Te);Kf(vt,function(){Nu(`Cannot construct ${Te} due to unbound types`,[R])}),qe([_,A,O],R?[R]:[],Rt=>{Rt=Rt[0];var fn,en;R?(fn=Rt.registeredClass,en=fn.instancePrototype):en=Pu.prototype;var tn=Ss(Te,function(){if(Object.getPrototypeOf(this)!==yi)throw new ao("Use 'new' to construct "+Te);if(Fn.constructor_body===void 0)throw new ao(Te+" has no accessible constructor");for(var Xy=arguments.length,Mu=new Array(Xy),Lu=0;Lu<Xy;Lu++)Mu[Lu]=arguments[Lu];var Qy=Fn.constructor_body[Mu.length];if(Qy===void 0)throw new ao(`Tried to invoke ctor of ${Te} with invalid number of parameters (${Mu.length}) - expected (${Object.keys(Fn.constructor_body).toString()}) parameters instead!`);return Qy.apply(this,Mu)}),yi=Object.create(en,{constructor:{value:tn}});tn.prototype=yi;var Fn=new vO(Te,tn,yi,tt,fn,X,re,Ce);if(Fn.baseClass){var fo,Du;(Du=(fo=Fn.baseClass).__derivedClasses)!==null&&Du!==void 0||(fo.__derivedClasses=[]),Fn.baseClass.__derivedClasses.push(Fn)}var pk=new ku(Te,Fn,!0,!1,!1),Ky=new ku(Te+"*",Fn,!1,!1,!1),zy=new ku(Te+" const*",Fn,!1,!0,!1);return yn[_]={pointerType:Ky,constPointerType:zy},Iy(vt,tn),[pk,Ky,zy]})},Xf=(_,A)=>{for(var O=[],R=0;R<_;R++)O.push(j[A+R*4>>2]);return O};function xO(_){for(var A=1;A<_.length;++A)if(_[A]!==null&&_[A].destructorFunction===void 0)return!0;return!1}function Qf(_,A,O,R,G,X){var ae=A.length;ae<2&&ct("argTypes array size mismatch! Must at least get return value and 'this' types!");var re=A[1]!==null&&O!==null,me=xO(A),Ce=A[0].name!=="void",Te=ae-2,Be=new Array(Te),tt=[],vt=[],Rt=function(){vt.length=0;var fn;tt.length=re?2:1,tt[0]=G,re&&(fn=A[1].toWireType(vt,this),tt[1]=fn);for(var en=0;en<Te;++en)Be[en]=A[en+2].toWireType(vt,en<0||arguments.length<=en?void 0:arguments[en]),tt.push(Be[en]);var tn=R(...tt);function yi(Fn){if(me)Ln(vt);else for(var fo=re?1:2;fo<A.length;fo++){var Du=fo===1?fn:Be[fo-2];A[fo].destructorFunction!==null&&A[fo].destructorFunction(Du)}if(Ce)return A[0].fromWireType(Fn)}return yi(tn)};return Ss(_,Rt)}var OO=(_,A,O,R,G,X)=>{var ae=Xf(A,O);G=Br(R,G),qe([],[_],re=>{re=re[0];var me=`constructor ${re.name}`;if(re.registeredClass.constructor_body===void 0&&(re.registeredClass.constructor_body=[]),re.registeredClass.constructor_body[A-1]!==void 0)throw new ao(`Cannot register multiple constructors with identical number of parameters (${A-1}) for class '${re.name}'! Overload resolution is currently only performed using the parameter count, not actual type info!`);return re.registeredClass.constructor_body[A-1]=()=>{Nu(`Cannot construct ${re.name} due to unbound types`,ae)},qe([],ae,Ce=>(Ce.splice(1,0,null),re.registeredClass.constructor_body[A-1]=Qf(me,Ce,null,G,X),[])),[]})},Py=_=>{_=_.trim();const A=_.indexOf("(");return A!==-1?_.substr(0,A):_},PO=(_,A,O,R,G,X,ae,re,me,Ce)=>{var Te=Xf(O,R);A=Jt(A),A=Py(A),X=Br(G,X),qe([],[_],Be=>{Be=Be[0];var tt=`${Be.name}.${A}`;A.startsWith("@@")&&(A=Symbol[A.substring(2)]),re&&Be.registeredClass.pureVirtualFunctions.push(A);function vt(){Nu(`Cannot call ${tt} due to unbound types`,Te)}var Rt=Be.registeredClass.instancePrototype,fn=Rt[A];return fn===void 0||fn.overloadTable===void 0&&fn.className!==Be.name&&fn.argCount===O-2?(vt.argCount=O-2,vt.className=Be.name,Rt[A]=vt):(Sy(Rt,A,tt),Rt[A].overloadTable[O-2]=vt),qe([],Te,en=>{var tn=Qf(tt,en,Be,X,ae);return Rt[A].overloadTable===void 0?(tn.argCount=O-2,Rt[A]=tn):Rt[A].overloadTable[O-2]=tn,[]}),[]})},Jf=[],co=[],Zf=_=>{_>9&&--co[_+1]===0&&(co[_]=void 0,Jf.push(_))},kO=()=>co.length/2-5-Jf.length,BO=()=>{co.push(0,1,void 0,1,null,1,!0,1,!1,1),o.count_emval_handles=kO},uo={toValue:_=>(_||ct("Cannot use deleted val. handle = "+_),co[_]),toHandle:_=>{switch(_){case void 0:return 2;case null:return 4;case!0:return 6;case!1:return 8;default:{const A=Jf.pop()||co.length;return co[A]=_,co[A+1]=1,A}}}},ky={name:"emscripten::val",fromWireType:_=>{var A=uo.toValue(_);return Zf(_),A},toWireType:(_,A)=>uo.toHandle(A),argPackAdvance:br,readValueFromPointer:dn,destructorFunction:null},NO=_=>sr(_,ky),RO=(_,A,O)=>{switch(A){case 1:return O?function(R){return this.fromWireType(T[R])}:function(R){return this.fromWireType(P[R])};case 2:return O?function(R){return this.fromWireType(N[R>>1])}:function(R){return this.fromWireType(L[R>>1])};case 4:return O?function(R){return this.fromWireType(V[R>>2])}:function(R){return this.fromWireType(j[R>>2])};default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},DO=(_,A,O,R)=>{A=Jt(A);function G(){}G.values={},sr(_,{name:A,constructor:G,fromWireType:function(X){return this.constructor.values[X]},toWireType:(X,ae)=>ae.value,argPackAdvance:br,readValueFromPointer:RO(A,O,R),destructorFunction:null}),Kf(A,G)},eh=(_,A)=>{var O=zn[_];return O===void 0&&ct(`${A} has unknown type ${Oy(_)}`),O},MO=(_,A,O)=>{var R=eh(_,"enum");A=Jt(A);var G=R.constructor,X=Object.create(R.constructor.prototype,{value:{value:O},constructor:{value:Ss(`${R.name}_${A}`,function(){})}});G.values[O]=X,G[A]=X},th=_=>{if(_===null)return"null";var A=typeof _;return A==="object"||A==="array"||A==="function"?_.toString():""+_},LO=(_,A)=>{switch(A){case 4:return function(O){return this.fromWireType(W[O>>2])};case 8:return function(O){return this.fromWireType(q[O>>3])};default:throw new TypeError(`invalid float width (${A}): ${_}`)}},FO=(_,A,O)=>{A=Jt(A),sr(_,{name:A,fromWireType:R=>R,toWireType:(R,G)=>G,argPackAdvance:br,readValueFromPointer:LO(A,O),destructorFunction:null})},jO=(_,A,O,R,G,X,ae,re)=>{var me=Xf(A,O);_=Jt(_),_=Py(_),G=Br(R,G),Kf(_,function(){Nu(`Cannot call ${_} due to unbound types`,me)},A-1),qe([],me,Ce=>{var Te=[Ce[0],null].concat(Ce.slice(1));return Iy(_,Qf(_,Te,null,G,X),A-1),[]})},VO=(_,A,O)=>{switch(A){case 1:return O?R=>T[R]:R=>P[R];case 2:return O?R=>N[R>>1]:R=>L[R>>1];case 4:return O?R=>V[R>>2]:R=>j[R>>2];default:throw new TypeError(`invalid integer width (${A}): ${_}`)}},UO=(_,A,O,R,G)=>{A=Jt(A);var X=Te=>Te;if(R===0){var ae=32-8*O;X=Te=>Te<<ae>>>ae}var re=A.includes("unsigned"),me=(Te,Be)=>{},Ce;re?Ce=function(Te,Be){return me(Be,this.name),Be>>>0}:Ce=function(Te,Be){return me(Be,this.name),Be},sr(_,{name:A,fromWireType:X,toWireType:Ce,argPackAdvance:br,readValueFromPointer:VO(A,O,R!==0),destructorFunction:null})},GO=(_,A,O)=>{var R=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array],G=R[A];function X(ae){var re=j[ae>>2],me=j[ae+4>>2];return new G(T.buffer,me,re)}O=Jt(O),sr(_,{name:O,fromWireType:X,argPackAdvance:br,readValueFromPointer:X},{ignoreDuplicateRegistrations:!0})},qO=Object.assign({optional:!0},ky),HO=(_,A)=>{sr(_,qO)},$O=(_,A,O,R)=>{if(!(R>0))return 0;for(var G=O,X=O+R-1,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(re<=127){if(O>=X)break;A[O++]=re}else if(re<=2047){if(O+1>=X)break;A[O++]=192|re>>6,A[O++]=128|re&63}else if(re<=65535){if(O+2>=X)break;A[O++]=224|re>>12,A[O++]=128|re>>6&63,A[O++]=128|re&63}else{if(O+3>=X)break;A[O++]=240|re>>18,A[O++]=128|re>>12&63,A[O++]=128|re>>6&63,A[O++]=128|re&63}}return A[O]=0,O-G},Is=(_,A,O)=>$O(_,P,A,O),YO=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R<=127?A++:R<=2047?A+=2:R>=55296&&R<=57343?(A+=4,++O):A+=3}return A},By=typeof TextDecoder<"u"?new TextDecoder:void 0,Ny=function(_){let A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,O=arguments.length>2&&arguments[2]!==void 0?arguments[2]:NaN;for(var R=A+O,G=A;_[G]&&!(G>=R);)++G;if(G-A>16&&_.buffer&&By)return By.decode(_.subarray(A,G));for(var X="";A<G;){var ae=_[A++];if(!(ae&128)){X+=String.fromCharCode(ae);continue}var re=_[A++]&63;if((ae&224)==192){X+=String.fromCharCode((ae&31)<<6|re);continue}var me=_[A++]&63;if((ae&240)==224?ae=(ae&15)<<12|re<<6|me:ae=(ae&7)<<18|re<<12|me<<6|_[A++]&63,ae<65536)X+=String.fromCharCode(ae);else{var Ce=ae-65536;X+=String.fromCharCode(55296|Ce>>10,56320|Ce&1023)}}return X},WO=(_,A)=>_?Ny(P,_,A):"",KO=(_,A)=>{A=Jt(A);var O=A==="std::string";sr(_,{name:A,fromWireType(R){var G=j[R>>2],X=R+4,ae;if(O)for(var re=X,me=0;me<=G;++me){var Ce=X+me;if(me==G||P[Ce]==0){var Te=Ce-re,Be=WO(re,Te);ae===void 0?ae=Be:(ae+="\0",ae+=Be),re=Ce+1}}else{for(var tt=new Array(G),me=0;me<G;++me)tt[me]=String.fromCharCode(P[X+me]);ae=tt.join("")}return lo(R),ae},toWireType(R,G){G instanceof ArrayBuffer&&(G=new Uint8Array(G));var X,ae=typeof G=="string";ae||G instanceof Uint8Array||G instanceof Uint8ClampedArray||G instanceof Int8Array||ct("Cannot pass non-string to std::string"),O&&ae?X=YO(G):X=G.length;var re=oh(4+X+1),me=re+4;if(j[re>>2]=X,O&&ae)Is(G,me,X+1);else if(ae)for(var Ce=0;Ce<X;++Ce){var Te=G.charCodeAt(Ce);Te>255&&(lo(me),ct("String has UTF-16 code units that do not fit in 8 bits")),P[me+Ce]=Te}else for(var Ce=0;Ce<X;++Ce)P[me+Ce]=G[Ce];return R!==null&&R.push(lo,re),re},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(R){lo(R)}})},Ry=typeof TextDecoder<"u"?new TextDecoder("utf-16le"):void 0,zO=(_,A)=>{for(var O=_,R=O>>1,G=R+A/2;!(R>=G)&&L[R];)++R;if(O=R<<1,O-_>32&&Ry)return Ry.decode(P.subarray(_,O));for(var X="",ae=0;!(ae>=A/2);++ae){var re=N[_+ae*2>>1];if(re==0)break;X+=String.fromCharCode(re)}return X},XO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<2)return 0;O-=2;for(var G=A,X=O<_.length*2?O/2:_.length,ae=0;ae<X;++ae){var re=_.charCodeAt(ae);N[A>>1]=re,A+=2}return N[A>>1]=0,A-G},QO=_=>_.length*2,JO=(_,A)=>{for(var O=0,R="";!(O>=A/4);){var G=V[_+O*4>>2];if(G==0)break;if(++O,G>=65536){var X=G-65536;R+=String.fromCharCode(55296|X>>10,56320|X&1023)}else R+=String.fromCharCode(G)}return R},ZO=(_,A,O)=>{var R;if((R=O)!==null&&R!==void 0||(O=2147483647),O<4)return 0;for(var G=A,X=G+O-4,ae=0;ae<_.length;++ae){var re=_.charCodeAt(ae);if(re>=55296&&re<=57343){var me=_.charCodeAt(++ae);re=65536+((re&1023)<<10)|me&1023}if(V[A>>2]=re,A+=4,A+4>X)break}return V[A>>2]=0,A-G},eP=_=>{for(var A=0,O=0;O<_.length;++O){var R=_.charCodeAt(O);R>=55296&&R<=57343&&++O,A+=4}return A},tP=(_,A,O)=>{O=Jt(O);var R,G,X,ae;A===2?(R=zO,G=XO,ae=QO,X=re=>L[re>>1]):A===4&&(R=JO,G=ZO,ae=eP,X=re=>j[re>>2]),sr(_,{name:O,fromWireType:re=>{for(var me=j[re>>2],Ce,Te=re+4,Be=0;Be<=me;++Be){var tt=re+4+Be*A;if(Be==me||X(tt)==0){var vt=tt-Te,Rt=R(Te,vt);Ce===void 0?Ce=Rt:(Ce+="\0",Ce+=Rt),Te=tt+A}}return lo(re),Ce},toWireType:(re,me)=>{typeof me!="string"&&ct(`Cannot pass non-string to C++ string type ${O}`);var Ce=ae(me),Te=oh(4+Ce+A);return j[Te>>2]=Ce/A,G(me,Te+4,Ce+A),re!==null&&re.push(lo,Te),Te},argPackAdvance:br,readValueFromPointer:dn,destructorFunction(re){lo(re)}})},nP=(_,A,O,R,G,X)=>{Sn[_]={name:Jt(A),rawConstructor:Br(O,R),rawDestructor:Br(G,X),fields:[]}},rP=(_,A,O,R,G,X,ae,re,me,Ce)=>{Sn[_].fields.push({fieldName:Jt(A),getterReturnType:O,getter:Br(R,G),getterContext:X,setterArgumentType:ae,setter:Br(re,me),setterContext:Ce})},oP=(_,A)=>{A=Jt(A),sr(_,{isVoid:!0,name:A,argPackAdvance:0,fromWireType:()=>{},toWireType:(O,R)=>{}})},iP=(_,A,O)=>P.copyWithin(_,A,A+O),nh=[],aP=(_,A,O,R)=>(_=nh[_],A=uo.toValue(A),_(null,A,O,R)),sP={},cP=_=>{var A=sP[_];return A===void 0?Jt(_):A},Dy=()=>{if(typeof globalThis=="object")return globalThis;function _(A){A.$$$embind_global$$$=A;var O=typeof $$$embind_global$$$=="object"&&A.$$$embind_global$$$==A;return O||delete A.$$$embind_global$$$,O}if(typeof $$$embind_global$$$=="object"||(typeof global=="object"&&_(global)?$$$embind_global$$$=global:typeof self=="object"&&_(self)&&($$$embind_global$$$=self),typeof $$$embind_global$$$=="object"))return $$$embind_global$$$;throw Error("unable to get global object.")},uP=_=>_===0?uo.toHandle(Dy()):(_=cP(_),uo.toHandle(Dy()[_])),lP=_=>{var A=nh.length;return nh.push(_),A},dP=(_,A)=>{for(var O=new Array(_),R=0;R<_;++R)O[R]=eh(j[A+R*4>>2],"parameter "+R);return O},fP=Reflect.construct,hP=(_,A,O)=>{var R=[],G=_.toWireType(R,O);return R.length&&(j[A>>2]=uo.toHandle(R)),G},pP=(_,A,O)=>{var R=dP(_,A),G=R.shift();_--;var X=new Array(_),ae=(me,Ce,Te,Be)=>{for(var tt=0,vt=0;vt<_;++vt)X[vt]=R[vt].readValueFromPointer(Be+tt),tt+=R[vt].argPackAdvance;var Rt=O===1?fP(Ce,X):Ce.apply(me,X);return hP(G,Te,Rt)},re=`methodCaller<(${R.map(me=>me.name).join(", ")}) => ${G.name}>`;return lP(Ss(re,ae))},gP=_=>{_>9&&(co[_+1]+=1)},mP=_=>{var A=uo.toValue(_);Ln(A),Zf(_)},yP=(_,A)=>{_=eh(_,"_emval_take_value");var O=_.readValueFromPointer(A);return uo.toHandle(O)},vP=(_,A,O,R)=>{var G=new Date().getFullYear(),X=new Date(G,0,1),ae=new Date(G,6,1),re=X.getTimezoneOffset(),me=ae.getTimezoneOffset(),Ce=Math.max(re,me);j[_>>2]=Ce*60,V[A>>2]=+(re!=me);var Te=vt=>{var Rt=vt>=0?"-":"+",fn=Math.abs(vt),en=String(Math.floor(fn/60)).padStart(2,"0"),tn=String(fn%60).padStart(2,"0");return`UTC${Rt}${en}${tn}`},Be=Te(re),tt=Te(me);me<re?(Is(Be,O,17),Is(tt,R,17)):(Is(Be,R,17),Is(tt,O,17))},wP=()=>2147483648,bP=(_,A)=>Math.ceil(_/A)*A,EP=_=>{var A=C.buffer,O=(_-A.byteLength+65535)/65536|0;try{return C.grow(O),k(),1}catch{}},CP=_=>{var A=P.length;_>>>=0;var O=wP();if(_>O)return!1;for(var R=1;R<=4;R*=2){var G=A*(1+.2/R);G=Math.min(G,_+100663296);var X=Math.min(O,bP(Math.max(_,G),65536)),ae=EP(X);if(ae)return!0}return!1},rh={},_P=()=>f||"./this.program",Ts=()=>{if(!Ts.strings){var _=(typeof navigator=="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",A={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:_,_:_P()};for(var O in rh)rh[O]===void 0?delete A[O]:A[O]=rh[O];var R=[];for(var O in A)R.push(`${O}=${A[O]}`);Ts.strings=R}return Ts.strings},AP=(_,A)=>{for(var O=0;O<_.length;++O)T[A++]=_.charCodeAt(O);T[A]=0},SP=(_,A)=>{var O=0;return Ts().forEach((R,G)=>{var X=A+O;j[_+G*4>>2]=X,AP(R,X),O+=R.length+1}),0},IP=(_,A)=>{var O=Ts();j[_>>2]=O.length;var R=0;return O.forEach(G=>R+=G.length+1),j[A>>2]=R,0},TP=_=>52;function xP(_,A,O,R,G){return 70}var OP=[null,[],[]],PP=(_,A)=>{var O=OP[_];A===0||A===10?((_===1?w:b)(Ny(O)),O.length=0):O.push(A)},kP=(_,A,O,R)=>{for(var G=0,X=0;X<O;X++){var ae=j[A>>2],re=j[A+4>>2];A+=8;for(var me=0;me<re;me++)PP(_,P[ae+me]);G+=re}return j[R>>2]=G,0},BP=_=>_;Me=o.InternalError=class extends Error{constructor(_){super(_),this.name="InternalError"}},ca(),ao=o.BindingError=class extends Error{constructor(_){super(_),this.name="BindingError"}},pO(),CO(),xy=o.UnboundTypeError=IO(Error,"UnboundTypeError"),BO();var NP={t:at,x:It,a:Ot,j:De,k:Pr,O:ln,q:Dn,ga:Mn,d:wr,ca:Gr,va:st,ba:Lt,pa:Y,ta:TO,sa:OO,E:PO,oa:NO,F:DO,n:MO,W:FO,X:jO,y:UO,u:GO,ua:HO,V:KO,P:tP,L:nP,wa:rP,qa:oP,ja:iP,T:aP,xa:Zf,ya:uP,U:pP,Y:gP,Z:mP,ra:yP,da:vP,ha:CP,ea:SP,fa:IP,ia:TP,$:xP,S:kP,J:ek,C:nk,Q:FP,R:uk,r:XP,b:RP,D:ZP,la:ok,c:VP,ka:ik,h:LP,i:HP,s:$P,N:JP,w:WP,I:sk,K:QP,z:rk,H:lk,aa:fk,_:hk,l:UP,f:jP,e:MP,g:DP,M:ck,m:qP,ma:tk,p:YP,v:KP,na:zP,B:ak,o:GP,G:dk,A:BP},jt=pe(),My=_=>(My=jt.Ba)(_),lo=o._free=_=>(lo=o._free=jt.Ca)(_),oh=o._malloc=_=>(oh=o._malloc=jt.Ea)(_),Ly=_=>(Ly=jt.Fa)(_),et=(_,A)=>(et=jt.Ga)(_,A),Fy=_=>(Fy=jt.Ha)(_),jy=_=>(jy=jt.Ia)(_),Vy=()=>(Vy=jt.Ja)(),Uy=_=>(Uy=jt.Ka)(_),Gy=_=>(Gy=jt.La)(_),qy=(_,A,O)=>(qy=jt.Ma)(_,A,O);o.dynCall_viijii=(_,A,O,R,G,X,ae)=>(o.dynCall_viijii=jt.Na)(_,A,O,R,G,X,ae);var Hy=o.dynCall_jiii=(_,A,O,R)=>(Hy=o.dynCall_jiii=jt.Oa)(_,A,O,R);o.dynCall_jiji=(_,A,O,R,G)=>(o.dynCall_jiji=jt.Pa)(_,A,O,R,G);var $y=o.dynCall_jiiii=(_,A,O,R,G)=>($y=o.dynCall_jiiii=jt.Qa)(_,A,O,R,G);o.dynCall_iiiiij=(_,A,O,R,G,X,ae)=>(o.dynCall_iiiiij=jt.Ra)(_,A,O,R,G,X,ae),o.dynCall_iiiiijj=(_,A,O,R,G,X,ae,re,me)=>(o.dynCall_iiiiijj=jt.Sa)(_,A,O,R,G,X,ae,re,me),o.dynCall_iiiiiijj=(_,A,O,R,G,X,ae,re,me,Ce)=>(o.dynCall_iiiiiijj=jt.Ta)(_,A,O,R,G,X,ae,re,me,Ce);function RP(_,A){var O=ue();try{return ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;et(1,0)}}function DP(_,A,O,R){var G=ue();try{ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function MP(_,A,O){var R=ue();try{ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;et(1,0)}}function LP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function FP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function jP(_,A){var O=ue();try{ot(_)(A)}catch(R){if(ye(O),R!==R+0)throw R;et(1,0)}}function VP(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;et(1,0)}}function UP(_){var A=ue();try{ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;et(1,0)}}function GP(_,A,O,R,G,X,ae,re,me,Ce,Te){var Be=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te)}catch(tt){if(ye(Be),tt!==tt+0)throw tt;et(1,0)}}function qP(_,A,O,R,G){var X=ue();try{ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function HP(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function $P(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;et(1,0)}}function YP(_,A,O,R,G,X){var ae=ue();try{ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;et(1,0)}}function WP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;et(1,0)}}function KP(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;et(1,0)}}function zP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;et(1,0)}}function XP(_){var A=ue();try{return ot(_)()}catch(O){if(ye(A),O!==O+0)throw O;et(1,0)}}function QP(_,A,O,R,G,X,ae,re,me){var Ce=ue();try{return ot(_)(A,O,R,G,X,ae,re,me)}catch(Te){if(ye(Ce),Te!==Te+0)throw Te;et(1,0)}}function JP(_,A,O,R,G,X,ae){var re=ue();try{return ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;et(1,0)}}function ZP(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function ek(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function tk(_,A,O,R,G,X,ae,re){var me=ue();try{ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;et(1,0)}}function nk(_,A,O,R,G,X){var ae=ue();try{return ot(_)(A,O,R,G,X)}catch(re){if(ye(ae),re!==re+0)throw re;et(1,0)}}function rk(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;et(1,0)}}function ok(_,A,O){var R=ue();try{return ot(_)(A,O)}catch(G){if(ye(R),G!==G+0)throw G;et(1,0)}}function ik(_,A,O,R,G){var X=ue();try{return ot(_)(A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}function ak(_,A,O,R,G,X,ae,re,me,Ce){var Te=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce)}catch(Be){if(ye(Te),Be!==Be+0)throw Be;et(1,0)}}function sk(_,A,O,R,G,X,ae,re){var me=ue();try{return ot(_)(A,O,R,G,X,ae,re)}catch(Ce){if(ye(me),Ce!==Ce+0)throw Ce;et(1,0)}}function ck(_,A,O,R,G,X,ae){var re=ue();try{ot(_)(A,O,R,G,X,ae)}catch(me){if(ye(re),me!==me+0)throw me;et(1,0)}}function uk(_,A,O,R){var G=ue();try{return ot(_)(A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function lk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be){var tt=ue();try{return ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be)}catch(vt){if(ye(tt),vt!==vt+0)throw vt;et(1,0)}}function dk(_,A,O,R,G,X,ae,re,me,Ce,Te,Be,tt,vt,Rt,fn){var en=ue();try{ot(_)(A,O,R,G,X,ae,re,me,Ce,Te,Be,tt,vt,Rt,fn)}catch(tn){if(ye(en),tn!==tn+0)throw tn;et(1,0)}}function fk(_,A,O,R){var G=ue();try{return Hy(_,A,O,R)}catch(X){if(ye(G),X!==X+0)throw X;et(1,0)}}function hk(_,A,O,R,G){var X=ue();try{return $y(_,A,O,R,G)}catch(ae){if(ye(X),ae!==ae+0)throw ae;et(1,0)}}var Ru,Yy;H=function _(){Ru||Wy(),Ru||(H=_)};function Wy(){if(ve>0||!Yy&&(Yy=1,oe(),ve>0))return;function _(){var A;Ru||(Ru=1,o.calledRun=1,!I&&(ne(),i(o),(A=o.onRuntimeInitialized)===null||A===void 0||A.call(o),se()))}o.setStatus?(o.setStatus("Running..."),setTimeout(()=>{setTimeout(()=>o.setStatus(""),1),_()},1)):_()}if(o.preInit)for(typeof o.preInit=="function"&&(o.preInit=[o.preInit]);o.preInit.length>0;)o.preInit.pop()();return Wy(),r=s,r}})();function D7(t){return pf(gf,t)}async function M7(t,e){return N7(gf,t,e)}async function L7(t,e){return R7(gf,t,e)}const Ym=[["aztec","Aztec"],["code_128","Code128"],["code_39","Code39"],["code_93","Code93"],["codabar","Codabar"],["databar","DataBar"],["databar_expanded","DataBarExpanded"],["databar_limited","DataBarLimited"],["data_matrix","DataMatrix"],["dx_film_edge","DXFilmEdge"],["ean_13","EAN-13"],["ean_8","EAN-8"],["itf","ITF"],["maxi_code","MaxiCode"],["micro_qr_code","MicroQRCode"],["pdf417","PDF417"],["qr_code","QRCode"],["rm_qr_code","rMQRCode"],["upc_a","UPC-A"],["upc_e","UPC-E"],["linear_codes","Linear-Codes"],["matrix_codes","Matrix-Codes"]],F7=[...Ym,["unknown"]].map(t=>t[0]),mf=new Map(Ym);function j7(t){for(const[e,n]of mf)if(t===n)return e;return"unknown"}function V7(t){if(Wm(t))return{width:t.naturalWidth,height:t.naturalHeight};if(Km(t))return{width:t.width.baseVal.value,height:t.height.baseVal.value};if(zm(t))return{width:t.videoWidth,height:t.videoHeight};if(Qm(t))return{width:t.width,height:t.height};if(Zm(t))return{width:t.displayWidth,height:t.displayHeight};if(Xm(t))return{width:t.width,height:t.height};if(Jm(t))return{width:t.width,height:t.height};throw new TypeError("The provided value is not of type '(Blob or HTMLCanvasElement or HTMLImageElement or HTMLVideoElement or ImageBitmap or ImageData or OffscreenCanvas or SVGImageElement or VideoFrame)'.")}function Wm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLImageElement)}catch{return!1}}function Km(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.SVGImageElement)}catch{return!1}}function zm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLVideoElement)}catch{return!1}}function Xm(t){var e,n;try{return t instanceof((n=(e=t==null?void 0:t.ownerDocument)==null?void 0:e.defaultView)==null?void 0:n.HTMLCanvasElement)}catch{return!1}}function Qm(t){try{return t instanceof ImageBitmap||Object.prototype.toString.call(t)==="[object ImageBitmap]"}catch{return!1}}function Jm(t){try{return t instanceof OffscreenCanvas||Object.prototype.toString.call(t)==="[object OffscreenCanvas]"}catch{return!1}}function Zm(t){try{return t instanceof VideoFrame||Object.prototype.toString.call(t)==="[object VideoFrame]"}catch{return!1}}function e2(t){try{return t instanceof Blob||Object.prototype.toString.call(t)==="[object Blob]"}catch{return!1}}function U7(t){try{return t instanceof ImageData||Object.prototype.toString.call(t)==="[object ImageData]"}catch{return!1}}function G7(t,e){try{const n=new OffscreenCanvas(t,e);if(n.getContext("2d")instanceof OffscreenCanvasRenderingContext2D)return n;throw void 0}catch{const n=document.createElement("canvas");return n.width=t,n.height=e,n}}async function t2(t){if(Wm(t)&&!await Y7(t))throw new DOMException("Failed to load or decode HTMLImageElement.","InvalidStateError");if(Km(t)&&!await W7(t))throw new DOMException("Failed to load or decode SVGImageElement.","InvalidStateError");if(Zm(t)&&K7(t))throw new DOMException("VideoFrame is closed.","InvalidStateError");if(zm(t)&&(t.readyState===0||t.readyState===1))throw new DOMException("Invalid element or state.","InvalidStateError");if(Qm(t)&&X7(t))throw new DOMException("The image source is detached.","InvalidStateError");const{width:e,height:n}=V7(t);if(e===0||n===0)return null;const r=G7(e,n).getContext("2d");r.drawImage(t,0,0);try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function q7(t){let e;try{if(globalThis.createImageBitmap)e=await createImageBitmap(t);else if(globalThis.Image){e=new Image;let n="";try{n=URL.createObjectURL(t),e.src=n,await e.decode()}finally{URL.revokeObjectURL(n)}}else return t}catch{throw new DOMException("Failed to load or decode Blob.","InvalidStateError")}return await t2(e)}function H7(t){const{width:e,height:n}=t;if(e===0||n===0)return null;const r=t.getContext("2d");try{return r.getImageData(0,0,e,n)}catch{throw new DOMException("Source would taint origin.","SecurityError")}}async function $7(t){if(e2(t))return await q7(t);if(U7(t)){if(z7(t))throw new DOMException("The image data has been detached.","InvalidStateError");return t}return Xm(t)||Jm(t)?H7(t):await t2(t)}async function Y7(t){try{return await t.decode(),!0}catch{return!1}}async function W7(t){var e;try{return await((e=t.decode)==null?void 0:e.call(t)),!0}catch{return!1}}function K7(t){return t.format===null}function z7(t){return t.data.buffer.byteLength===0}function X7(t){return t.width===0&&t.height===0}function n2(t,e){return Q7(t)?new DOMException(`${e}: ${t.message}`,t.name):J7(t)?new t.constructor(`${e}: ${t.message}`):new Error(`${e}: ${t}`)}function Q7(t){return t instanceof DOMException||Object.prototype.toString.call(t)==="[object DOMException]"}function J7(t){return t instanceof Error||Object.prototype.toString.call(t)==="[object Error]"}var ru;let yf=class extends EventTarget{constructor(e={}){var n;super(),C7(this,ru);try{const r=(n=e==null?void 0:e.formats)==null?void 0:n.filter(o=>o!=="unknown");if((r==null?void 0:r.length)===0)throw new TypeError("Hint option provided, but is empty.");for(const o of r??[])if(!mf.has(o))throw new TypeError(`Failed to read the 'formats' property from 'BarcodeDetectorOptions': The provided value '${o}' is not a valid enum value of type BarcodeFormat.`);_7(this,ru,r??[]),D7().then(o=>{this.dispatchEvent(new CustomEvent("load",{detail:o}))}).catch(o=>{this.dispatchEvent(new CustomEvent("error",{detail:o}))})}catch(r){throw n2(r,"Failed to construct 'BarcodeDetector'")}}static async getSupportedFormats(){return F7.filter(e=>e!=="unknown")}async detect(e){try{const n=await $7(e);if(n===null)return[];let r;const o={tryHarder:!0,returnCodabarStartEnd:!0,formats:E7(this,ru).map(i=>mf.get(i))};try{e2(n)?r=await M7(n,o):r=await L7(n,o)}catch(i){throw console.error(i),new DOMException("Barcode detection service unavailable.","NotSupportedError")}return r.map(i=>{const{topLeft:{x:a,y:s},topRight:{x:c,y:u},bottomLeft:{x:d,y:h},bottomRight:{x:f,y:p}}=i.position,l=Math.min(a,c,d,f),g=Math.min(s,u,h,p),m=Math.max(a,c,d,f),y=Math.max(s,u,h,p);return{boundingBox:new DOMRectReadOnly(l,g,m-l,y-g),rawValue:i.text,format:j7(i.format),cornerPoints:[{x:a,y:s},{x:c,y:u},{x:f,y:p},{x:d,y:h}]}})}catch(n){throw n2(n,"Failed to execute 'detect' on 'BarcodeDetector'")}}};ru=new WeakMap,globalThis.BarcodeDetector!=null||(globalThis.BarcodeDetector=yf);function Z7(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M3 3L6.00007 6.00007M21 21L19.8455 19.8221M9.74194 4.06811C9.83646 4.04279 9.93334 4.02428 10.0319 4.01299C10.1453 4 10.2683 4 10.5141 4H13.5327C13.7786 4 13.9015 4 14.015 4.01299C14.6068 4.08078 15.1375 4.40882 15.4628 4.90782C15.5252 5.00345 15.5802 5.11345 15.6901 5.33333C15.7451 5.44329 15.7726 5.49827 15.8037 5.54609C15.9664 5.79559 16.2318 5.95961 16.5277 5.9935C16.5844 6 16.6459 6 16.7688 6H17.8234C18.9435 6 19.5036 6 19.9314 6.21799C20.3077 6.40973 20.6137 6.71569 20.8055 7.09202C21.0234 7.51984 21.0234 8.0799 21.0234 9.2V15.3496M19.8455 19.8221C19.4278 20 18.8702 20 17.8234 20H6.22344C5.10333 20 4.54328 20 4.11546 19.782C3.73913 19.5903 3.43317 19.2843 3.24142 18.908C3.02344 18.4802 3.02344 17.9201 3.02344 16.8V9.2C3.02344 8.0799 3.02344 7.51984 3.24142 7.09202C3.43317 6.71569 3.73913 6.40973 4.11546 6.21799C4.51385 6.015 5.0269 6.00103 6.00007 6.00007M19.8455 19.8221L14.5619 14.5619M14.5619 14.5619C14.0349 15.4243 13.0847 16 12 16C10.3431 16 9 14.6569 9 13C9 11.9153 9.57566 10.9651 10.4381 10.4381M14.5619 14.5619L10.4381 10.4381M10.4381 10.4381L6.00007 6.00007"}))}function eS(t){const{onClick:e,disabled:n,className:r}=t,o={cursor:n?"default":"pointer",stroke:n?"grey":"yellow",strokeLineJoin:"round",strokeLineCap:"round",strokeWidth:1.5,...t.style};return x.createElement("svg",{onClick:n?void 0:e,className:r,style:o,width:"28px",height:"28px",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{d:"M12 16C13.6569 16 15 14.6569 15 13C15 11.3431 13.6569 10 12 10C10.3431 10 9 11.3431 9 13C9 14.6569 10.3431 16 12 16Z"}),x.createElement("path",{d:"M3 16.8V9.2C3 8.0799 3 7.51984 3.21799 7.09202C3.40973 6.71569 3.71569 6.40973 4.09202 6.21799C4.51984 6 5.0799 6 6.2 6H7.25464C7.37758 6 7.43905 6 7.49576 5.9935C7.79166 5.95961 8.05705 5.79559 8.21969 5.54609C8.25086 5.49827 8.27836 5.44328 8.33333 5.33333C8.44329 5.11342 8.49827 5.00346 8.56062 4.90782C8.8859 4.40882 9.41668 4.08078 10.0085 4.01299C10.1219 4 10.2448 4 10.4907 4H13.5093C13.7552 4 13.8781 4 13.9915 4.01299C14.5833 4.08078 15.1141 4.40882 15.4394 4.90782C15.5017 5.00345 15.5567 5.11345 15.6667 5.33333C15.7216 5.44329 15.7491 5.49827 15.7803 5.54609C15.943 5.79559 16.2083 5.95961 16.5042 5.9935C16.561 6 16.6224 6 16.7454 6H17.8C18.9201 6 19.4802 6 19.908 6.21799C20.2843 6.40973 20.5903 6.71569 20.782 7.09202C21 7.51984 21 8.0799 21 9.2V16.8C21 17.9201 21 18.4802 20.782 18.908C20.5903 19.2843 20.2843 19.5903 19.908 19.782C19.4802 20 18.9201 20 17.8 20H6.2C5.0799 20 4.51984 20 4.09202 19.782C3.71569 19.5903 3.40973 19.2843 3.21799 18.908C3 18.4802 3 17.9201 3 16.8Z"}))}function tS(t){const{scanning:e,startScanning:n,stopScanning:r}=t,[o,i]=x.useState(!1);function a(){i(!0),e?r():n(),setTimeout(()=>i(!1),1e3)}return x.createElement("div",{style:{bottom:85,right:3,position:"absolute",zIndex:2,cursor:o?"default":"pointer"}},e?x.createElement(Z7,{disabled:o,onClick:a}):x.createElement(eS,{disabled:o,onClick:a}))}function nS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M13.225 9l5.025-7h-7.972l-3.3 11h5.359l-2.452 8.648.75.364L20.374 9zm.438 3H8.322l2.7-9H16.3l-5.025 7h7.101l-6.7 8.953z"}))}function rS(t){const{onClick:e,className:n,style:r}=t;return x.createElement("svg",{onClick:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:r,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.2,stroke:"yellow",fill:"yellow",d:"M14.516 15.158l.714.714-4.595 6.14-.75-.364L12.337 13H6.978L8.22 8.861l.803.803L8.322 12h3.036l1.793 1.792-1.475 5.16zm5.984 4.05L4.793 3.5l.707-.707 3.492 3.492L10.278 2h7.972l-5.025 7h7.149l-3.71 4.957 4.543 4.543zM12.707 10l3.243 3.243L18.376 10zM9.795 7.088l2.079 2.079L16.3 3h-5.278z"}))}function oS(t){const{status:e,scanning:n,torchToggle:r}=t;function o(i){r(i)}return n&&r?x.createElement("div",{style:{bottom:35,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},e?x.createElement(rS,{onClick:()=>o(!1)}):x.createElement(nS,{onClick:()=>o(!0)})):null}function iS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-7.46,0.5l-1.5,0c-0.645,0 -0.643,-1 -0,-1l1.5,0l-0,-1.5c-0,-0.645 1,-0.643 1,0l-0,1.5l1.5,0c0.645,0 0.643,1 -0,1l-1.5,0l-0,1.5c-0,0.645 -1,0.643 -1,0l-0,-1.5Z"}))}function aS(t){const{onClick:e,className:n,disabled:r=!1}=t,o={cursor:r?"default":"pointer",stroke:r?"grey":"yellow",fill:r?"grey":"yellow",...t.style};return x.createElement("svg",{onClick:r?void 0:e,width:"30px",height:"30px",viewBox:"0 0 24 24",className:n,style:o,xmlns:"http://www.w3.org/2000/svg"},x.createElement("path",{strokeWidth:.3,d:"M16.279,17.039c-1.396,1.209 -3.216,1.941 -5.206,1.941c-4.393,0 -7.96,-3.567 -7.96,-7.96c-0,-4.393 3.567,-7.96 7.96,-7.96c4.393,0 7.96,3.567 7.96,7.96c-0,2.044 -0.772,3.909 -2.04,5.319l0.165,0.165c1.194,1.194 2.388,2.388 3.583,3.582c0.455,0.456 -0.252,1.163 -0.707,0.708l-3.755,-3.755Zm1.754,-6.019c-0,-3.841 -3.119,-6.96 -6.96,-6.96c-3.842,0 -6.96,3.119 -6.96,6.96c-0,3.841 3.118,6.96 6.96,6.96c3.841,0 6.96,-3.119 6.96,-6.96Zm-4.96,-0.5c0.645,0 0.643,1 -0,1l-4,0c-0.645,0 -0.643,-1 -0,-1l4,0Z"}))}function sS(t){const{scanning:e,capabilities:n,onZoom:r,value:o}=t;if(!e||!r)return null;const i=(n.max-n.min)/3;return x.createElement(x.Fragment,null,x.createElement("div",{style:{bottom:130,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(aS,{disabled:o<=n.min,onClick:function(){r(Math.max(o-i,n.min))}})),x.createElement("div",{style:{bottom:180,right:3,position:"absolute",zIndex:2,cursor:"pointer"}},x.createElement(iS,{disabled:o>=n.max,onClick:function(){r(Math.min(o+i,n.max))}})))}function cS(t){const{scanning:e,loading:n,capabilities:r,border:o=35,onOff:i,torch:a,zoom:s,startScanning:c,stopScanning:u}=t,d="rgba(255, 0, 0, 0.5)";return x.createElement("div",{style:{position:"relative"}},x.createElement("svg",{viewBox:"0 0 100 100",style:{top:0,left:0,zIndex:1,boxSizing:"border-box",border:`${o>=35?o:35}px solid rgba(0, 0, 0, 0.2)`}},n&&x.createElement("text",{x:"50",y:"50",textAnchor:"middle",fill:"black",fontSize:"8",fontFamily:"Arial",fontWeight:"bold"},"Loading ...",x.createElement("animate",{attributeName:"opacity",values:"0;1;0",dur:"2s",repeatCount:"indefinite"})),x.createElement("path",{fill:"none",d:"M23,0 L0,0 L0,23",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M0,77 L0,100 L23,100",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M77,100 L100,100 L100,77",stroke:d,strokeWidth:3}),x.createElement("path",{fill:"none",d:"M100,23 L100,0 77,0",stroke:d,strokeWidth:3})),i&&x.createElement(tS,{scanning:e,startScanning:c,stopScanning:u}),a&&r.torch&&x.createElement(oS,{scanning:e,status:a.status,torchToggle:a.toggle}),s&&r.zoom&&x.createElement(sS,{scanning:e,capabilities:r.zoom,value:s.value,onZoom:s.onChange}))}const uS={facingMode:"environment",width:{min:640,ideal:720,max:1920},height:{min:640,ideal:720,max:1080}},lS={audio:!0,tracker:void 0,onOff:!1,finder:!0,torch:!0,zoom:!1},dS={width:"100%",height:"100%",position:"relative"},fS={top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden"};var hS=function(t){let e,n=!1;return(...r)=>(n||(e=t(r),n=!0),e)}(()=>{const t=YA(window);switch(t.browser){case"chrome":r7(window,t);break;case"firefox":s7(window,t);break;case"safari":d7(window,t);break;default:throw new Error("Unsupported browser")}});const pS="data:audio/mp3;base64,//PkZAAhghE0AKToAJra/n0FQygAAAGIkYJgmCYXBMAAGCTJz3zhCEM//z//1hz//8MMMMN08ssV6e5DDWIQreAgCvFKy8bXgIKMkUDDBgzJwIBtkRMQAocxIFdxghQGKDoEziAzQxOBOdH92i/iGi+zDCAEIX46a73HrSybZw1x3JZjXp7dSNy/P68rjcbt7p7fakMP5LVMyzCaj1pjvejYYAIDgDGzECjEAk1Jl3559HIon8hzlfPVTCvGJZzfcKSxXfyMWM88//9VKSxXdtnb9vomOuuRyiWVYbf+X8zp6fKGHIdycuWMMMMMMKSnp+6wsYc/9f/7z7rPPWHN556p6fP8MMMP///PPP/7+GHK9PT6p7f/unldP2np7YeHjweiYA4GLNAgAiI7u57n5//oc5/yfk6znOcPhwOBwgg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qqqqqqqqqqqqqqqqqqqqqqqqq";var ds=t=>t instanceof Date,r2=t=>t==null;const o2=t=>typeof t=="object";var i2=t=>!r2(t)&&!Array.isArray(t)&&o2(t)&&!ds(t),a2=t=>r2(t)||!o2(t);function s2(t,e){if(a2(t)||a2(e))return t===e;if(ds(t)&&ds(e))return t.getTime()===e.getTime();const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(const o of n){const i=t[o];if(!r.includes(o))return!1;if(o!=="ref"){const a=e[o];if(ds(i)&&ds(a)||i2(i)&&i2(a)||Array.isArray(i)&&Array.isArray(a)?!s2(i,a):i!==a)return!1}}return!0}function ou(t){if(t===null)throw new Error("Canvas should always be defined when component is mounted.");const e=t.getContext("2d");if(e===null)throw new Error("Canvas 2D context should be non-null");e.clearRect(0,0,t.width,t.height)}function gS(t){var e;const{onScan:n,constraints:r,formats:o=["qr_code"],paused:i=!1,components:a,children:s,styles:c,classNames:u,allowMultiple:d,scanDelay:h,onError:f}=t,p=x.useRef(null),l=x.useRef(null),g=x.useRef(null),m=x.useMemo(()=>({...uS,...r}),[r]),y=x.useMemo(()=>({...lS,...a}),[a]),[w,b]=x.useState(!1),[E,C]=x.useState(!0),[I,T]=x.useState(m),P=function(){const q=x.useRef(Promise.resolve({type:"stop",data:{}})),k=x.useRef(null),U=x.useRef(null),[z,te]=x.useState({}),[oe,ne]=x.useState({}),se=x.useCallback(async(H,$)=>{var J,S,M;if(!window.isSecureContext)throw new Error("camera access is only permitted in secure context. Use HTTPS or localhost rather than HTTP.");if(((J=navigator==null?void 0:navigator.mediaDevices)===null||J===void 0?void 0:J.getUserMedia)===void 0)throw new Error("this browser has no Stream API support");hS();const F=await navigator.mediaDevices.getUserMedia({audio:!1,video:$});H.srcObject!==void 0?H.srcObject=F:H.mozSrcObject!==void 0?H.mozSrcObject=F:window.URL.createObjectURL?H.src=window.URL.createObjectURL(F):window.webkitURL?H.src=window.webkitURL.createObjectURL(F):H.src=F.id,await Promise.race([H.play(),new Promise(Q=>setTimeout(Q,3e3)).then(()=>{throw new Error("Loading camera stream timed out after 3 seconds.")})]),await new Promise(Q=>setTimeout(Q,500));const[B]=F.getVideoTracks();return ne(B.getSettings()),te((M=(S=B==null?void 0:B.getCapabilities)===null||S===void 0?void 0:S.call(B))!==null&&M!==void 0?M:{}),k.current=F,U.current=B,{type:"start",data:{videoEl:H,stream:F,constraints:$}}},[]),we=x.useCallback(async(H,$)=>{H.src="",H.srcObject=null,H.load();for(const J of $.getTracks())$.removeTrack(J),J.stop();return k.current=null,U.current=null,ne({}),{type:"stop",data:{}}},[]),le=x.useCallback(async(H,{constraints:$,restart:J=!1})=>{if(q.current=q.current.then(S=>{if(S.type==="start"){const{data:{videoEl:M,stream:F,constraints:B}}=S;return J||H!==M||$!==B?we(M,F).then(()=>se(H,$)):S}return se(H,$)}),(await q.current).type==="stop")throw new Error("Something went wrong with the camera task queue (start task).")},[se,we]),_e=x.useCallback(async()=>{if(q.current=q.current.then(H=>{if(H.type==="stop")return H;const{data:{videoEl:$,stream:J}}=H;return we($,J)}),(await q.current).type==="start")throw new Error("Something went wrong with the camera task queue (stop task).")},[we]),ve=x.useCallback(async H=>{const $=U.current;if(!$)throw new Error("No active video track found.");{H.advanced&&H.advanced[0].zoom&&$.getCapabilities().torch&&await $.applyConstraints({advanced:[{torch:!1}]}),await $.applyConstraints(H);const J=$.getCapabilities(),S=$.getSettings();te(J),ne(S)}},[]);return x.useEffect(()=>()=>{(async()=>await _e())()},[_e]),{capabilities:z,settings:oe,startCamera:le,stopCamera:_e,updateConstraints:ve}}(),{startScanning:N,stopScanning:L}=function(q){const{videoElementRef:k,onScan:U,onFound:z,retryDelay:te=100,scanDelay:oe=0,formats:ne=[],audio:se=!0,allowMultiple:we=!1}=q,le=x.useRef(new yf({formats:ne})),_e=x.useRef(null),ve=x.useRef(null);x.useEffect(()=>{le.current=new yf({formats:ne})},[ne]),x.useEffect(()=>{typeof window<"u"&&se&&(_e.current=new Audio(pS))},[se]);const H=x.useCallback($=>async J=>{if(k.current!==null&&k.current.readyState>1){const{lastScan:S,contentBefore:M,lastScanHadContent:F}=$;if(J-S<te)ve.current=window.requestAnimationFrame(H($));else{const B=await le.current.detect(k.current),Q=B.some(ge=>!M.includes(ge.rawValue)),Z=B.length>0;let ee=$.lastOnScan;(Q||we&&Z&&J-ee>=oe)&&(se&&_e.current&&_e.current.paused&&_e.current.play().catch(ge=>console.error("Error playing the sound",ge)),ee=J,U(B)),Z&&z(B),!Z&&F&&z(B);const K={lastScan:J,lastOnScan:ee,lastScanHadContent:Z,contentBefore:Q?B.map(ge=>ge.rawValue):M};ve.current=window.requestAnimationFrame(H(K))}}},[k.current,U,z,te]);return{startScanning:x.useCallback(()=>{const $=performance.now(),J={lastScan:$,lastOnScan:$,contentBefore:[],lastScanHadContent:!1};ve.current=window.requestAnimationFrame(H(J))},[H]),stopScanning:x.useCallback(()=>{ve.current!==null&&(window.cancelAnimationFrame(ve.current),ve.current=null)},[])}}({videoElementRef:p,onScan:n,onFound:q=>function(k,U,z,te){const oe=z;if(oe==null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas is always defined.");const ne=U;if(ne==null)throw new Error("onFound handler should only be called when component is mounted. Thus video element is always defined.");if(k.length===0||te===void 0)ou(oe);else{const se=ne.offsetWidth,we=ne.offsetHeight,le=ne.videoWidth,_e=ne.videoHeight,ve=Math.max(se/le,we/_e),H=le*ve,$=_e*ve,J=H/le,S=$/_e,M=(se-H)/2,F=(we-$)/2,B=({x:K,y:ge})=>({x:Math.floor(K*J),y:Math.floor(ge*S)}),Q=({x:K,y:ge})=>({x:Math.floor(K+M),y:Math.floor(ge+F)}),Z=k.map(K=>{const{boundingBox:ge,cornerPoints:be}=K,{x:pe,y:fe}=Q(B({x:ge.x,y:ge.y})),{x:ye,y:ue}=B({x:ge.width,y:ge.height});return{...K,cornerPoints:be.map(Oe=>Q(B(Oe))),boundingBox:DOMRectReadOnly.fromRect({x:pe,y:fe,width:ye,height:ue})}});oe.width=ne.offsetWidth,oe.height=ne.offsetHeight;const ee=oe.getContext("2d");if(ee===null)throw new Error("onFound handler should only be called when component is mounted. Thus tracking canvas 2D context is always defined.");te(Z,ee)}}(q,p.current,g.current,y.tracker),formats:o,audio:y.audio,allowMultiple:d,retryDelay:y.tracker===void 0?500:10,scanDelay:h});x.useEffect(()=>(b(!0),()=>{b(!1)}),[]),x.useEffect(()=>{w&&(L(),N())},[a==null?void 0:a.tracker]),x.useEffect(()=>{if(!s2(m,I)){const q=m;r!=null&&r.deviceId&&delete q.facingMode,T(q)}},[r]);const V=x.useMemo(()=>({constraints:I,shouldStream:w&&!i}),[I,w,i]),j=async()=>{const q=p.current;if(q==null)throw new Error("Video should be defined when component is mounted.");const k=l.current;if(k==null)throw new Error("Canvas should be defined when component is mounted.");const U=k.getContext("2d");if(U==null)throw new Error("Canvas should be defined when component is mounted.");if(V.shouldStream){await P.stopCamera(),C(!1);try{await P.startCamera(q,V),q?C(!0):await P.stopCamera()}catch(z){f==null||f(z),console.error("error",z)}}else k.width=q.videoWidth,k.height=q.videoHeight,U.drawImage(q,0,0,q.videoWidth,q.videoHeight),await P.stopCamera(),C(!1)};x.useEffect(()=>{(async()=>await j())()},[V]);const W=x.useMemo(()=>V.shouldStream&&E,[V.shouldStream,E]);return x.useEffect(()=>{if(W){if(l.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus pause frame canvas is defined");if(ou(l.current),g.current===void 0)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus tracking canvas is defined");if(ou(g.current),p.current==null)throw new Error("shouldScan effect should only be triggered when component is mounted. Thus video element is defined");N()}},[W]),x.createElement("div",{style:{...dS,...c==null?void 0:c.container},className:u==null?void 0:u.container},x.createElement("video",{ref:p,style:{...fS,...c==null?void 0:c.video,visibility:i?"hidden":"visible"},className:u==null?void 0:u.video,autoPlay:!0,muted:!0,playsInline:!0}),x.createElement("canvas",{ref:l,style:{display:i?"block":"none",position:"absolute",top:0,left:0,width:"100%"}}),x.createElement("canvas",{ref:g,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%"}}),x.createElement("div",{style:{top:0,left:0,position:"absolute",width:"100%",height:"100%"}},y.finder&&x.createElement(cS,{scanning:E,capabilities:P.capabilities,loading:!1,onOff:y.onOff,zoom:y.zoom&&P.settings.zoom?{value:P.settings.zoom,onChange:async q=>{const k={...I,advanced:[{zoom:q}]};await P.updateConstraints(k)}}:void 0,torch:y.torch?{status:(e=P.settings.torch)!==null&&e!==void 0&&e,toggle:async q=>{const k={...I,advanced:[{torch:q}]};await P.updateConstraints(k)}}:void 0,startScanning:async()=>await j(),stopScanning:async()=>{await P.stopCamera(),ou(g.current),C(!1)},border:c==null?void 0:c.finderBorder}),s))}const iu="data:image/svg+xml,%3csvg%20height='24'%20viewBox='0%200%2024%2024'%20width='24'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='m21.25%207.5c.3796958%200%20.693491.28215388.7431534.64822944l.0068466.10177056v8.5c0%201.7330315-1.3564548%203.1492459-3.0655761%203.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555%200-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932%201.06066018%200%20.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734%200%201.6711923-.7071103%201.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815%202%202c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554%200%20.03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2%202c-.2928932.29289321-.767767.29289321-1.0606602%200-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734%200-1.67119234.70711027-1.7441988%201.60647279l-.0058012.14352721v8.5c0%20.4142136-.33578644.75-.75.75-.37969577%200-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146%201.35645477-3.14924593%203.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117%205.85294824c2.209139%200%204%201.790861%204%204s-1.790861%204-4%204-4-1.790861-4-4%201.790861-4%204-4zm0%201.5c-1.3807119%200-2.5%201.1192881-2.5%202.5s1.1192881%202.5%202.5%202.5%202.5-1.1192881%202.5-2.5-1.1192881-2.5-2.5-2.5z'%20fill='%23212121'/%3e%3c/svg%3e";function c2({onScan:t}){const{cameraFacingMode:e}=Xt(),[n,r]=x.useState(e??vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx("div",{className:"scale-x-[-1]",children:v.jsx(gS,{components:{finder:!1},onScan:o=>t(o[0].rawValue),constraints:{facingMode:n},allowMultiple:!0,classNames:{video:"rounded",container:"max-h-[calc(100vh-381px)] min-h-[267px] overflow-hidden rounded"},onError:o=>{console.log(o),Pg(o)}})}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===vn.USER?r(vn.ENVIRONMENT):r(vn.USER),children:v.jsx("img",{src:iu,alt:"camera-switch"})})]})}var au,vf,mS=(au=function(t,e){return au=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var o in r)r.hasOwnProperty(o)&&(n[o]=r[o])},au(t,e)},function(t,e){function n(){this.constructor=t}au(t,e),t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}),yS=function(t){function e(n){var r,o,i,a=this.constructor,s=t.call(this,n)||this;return Object.defineProperty(s,"name",{value:a.name,enumerable:!1,configurable:!0}),r=s,o=a.prototype,(i=Object.setPrototypeOf)?i(r,o):r.__proto__=o,function(c,u){u===void 0&&(u=c.constructor);var d=Error.captureStackTrace;d&&d(c,u)}(s),s}return mS(e,t),e}(Error),vS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$n=function(t){function e(n){n===void 0&&(n=void 0);var r=t.call(this,n)||this;return r.message=n,r}return vS(e,t),e.prototype.getKind=function(){return this.constructor.kind},e.kind="Exception",e}(yS),wS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ht=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return wS(e,t),e.kind="ArgumentException",e}($n),bS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Ve=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return bS(e,t),e.kind="IllegalArgumentException",e}($n),u2=function(){function t(e){if(this.binarizer=e,e===null)throw new Ve("Binarizer must be non-null.")}return t.prototype.getWidth=function(){return this.binarizer.getWidth()},t.prototype.getHeight=function(){return this.binarizer.getHeight()},t.prototype.getBlackRow=function(e,n){return this.binarizer.getBlackRow(e,n)},t.prototype.getBlackMatrix=function(){return this.matrix!==null&&this.matrix!==void 0||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix},t.prototype.isCropSupported=function(){return this.binarizer.getLuminanceSource().isCropSupported()},t.prototype.crop=function(e,n,r,o){var i=this.binarizer.getLuminanceSource().crop(e,n,r,o);return new t(this.binarizer.createBinarizer(i))},t.prototype.isRotateSupported=function(){return this.binarizer.getLuminanceSource().isRotateSupported()},t.prototype.rotateCounterClockwise=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new t(this.binarizer.createBinarizer(e))},t.prototype.rotateCounterClockwise45=function(){var e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new t(this.binarizer.createBinarizer(e))},t.prototype.toString=function(){try{return this.getBlackMatrix().toString()}catch{return""}},t}(),ES=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),sn=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return ES(e,t),e.getChecksumInstance=function(){return new e},e.kind="ChecksumException",e}($n),CS=function(){function t(e){this.source=e}return t.prototype.getLuminanceSource=function(){return this.source},t.prototype.getWidth=function(){return this.source.getWidth()},t.prototype.getHeight=function(){return this.source.getHeight()},t}(),Nt=function(){function t(){}return t.arraycopy=function(e,n,r,o,i){for(;i--;)r[o++]=e[n++]},t.currentTimeMillis=function(){return Date.now()},t}(),_S=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),wf=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return _S(e,t),e.kind="IndexOutOfBoundsException",e}($n),AS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),l2=function(t){function e(n,r){n===void 0&&(n=void 0),r===void 0&&(r=void 0);var o=t.call(this,r)||this;return o.index=n,o.message=r,o}return AS(e,t),e.kind="ArrayIndexOutOfBoundsException",e}(wf),SS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},or=function(){function t(){}return t.fill=function(e,n){for(var r=0,o=e.length;r<o;r++)e[r]=n},t.fillWithin=function(e,n,r,o){t.rangeCheck(e.length,n,r);for(var i=n;i<r;i++)e[i]=o},t.rangeCheck=function(e,n,r){if(n>r)throw new Ve("fromIndex("+n+") > toIndex("+r+")");if(n<0)throw new l2(n);if(r>e)throw new l2(r)},t.asList=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return e},t.create=function(e,n,r){return Array.from({length:e}).map(function(o){return Array.from({length:n}).fill(r)})},t.createInt32Array=function(e,n,r){return Array.from({length:e}).map(function(o){return Int32Array.from({length:n}).fill(r)})},t.equals=function(e,n){if(!e||!n||!e.length||!n.length||e.length!==n.length)return!1;for(var r=0,o=e.length;r<o;r++)if(e[r]!==n[r])return!1;return!0},t.hashCode=function(e){var n,r;if(e===null)return 0;var o=1;try{for(var i=SS(e),a=i.next();!a.done;a=i.next())o=31*o+a.value}catch(s){n={error:s}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return o},t.fillUint8Array=function(e,n){for(var r=0;r!==e.length;r++)e[r]=n},t.copyOf=function(e,n){return e.slice(0,n)},t.copyOfUint8Array=function(e,n){if(e.length<=n){var r=new Uint8Array(n);return r.set(e),r}return e.slice(0,n)},t.copyOfRange=function(e,n,r){var o=r-n,i=new Int32Array(o);return Nt.arraycopy(e,n,i,0,o),i},t.binarySearch=function(e,n,r){r===void 0&&(r=t.numberComparator);for(var o=0,i=e.length-1;o<=i;){var a=i+o>>1,s=r(n,e[a]);if(s>0)o=a+1;else{if(!(s<0))return a;i=a-1}}return-o-1},t.numberComparator=function(e,n){return e-n},t}(),En=function(){function t(){}return t.numberOfTrailingZeros=function(e){var n;if(e===0)return 32;var r=31;return(n=e<<16)!==0&&(r-=16,e=n),(n=e<<8)!==0&&(r-=8,e=n),(n=e<<4)!==0&&(r-=4,e=n),(n=e<<2)!==0&&(r-=2,e=n),r-(e<<1>>>31)},t.numberOfLeadingZeros=function(e){if(e===0)return 32;var n=1;return!(e>>>16)&&(n+=16,e<<=16),!(e>>>24)&&(n+=8,e<<=8),!(e>>>28)&&(n+=4,e<<=4),!(e>>>30)&&(n+=2,e<<=2),n-=e>>>31},t.toHexString=function(e){return e.toString(16)},t.toBinaryString=function(e){return String(parseInt(String(e),2))},t.bitCount=function(e){return e=(e=(858993459&(e-=e>>>1&1431655765))+(e>>>2&858993459))+(e>>>4)&252645135,e+=e>>>8,63&(e+=e>>>16)},t.truncDivision=function(e,n){return Math.trunc(e/n)},t.parseInt=function(e,n){return n===void 0&&(n=void 0),parseInt(e,n)},t.MIN_VALUE_32_BITS=-2147483648,t.MAX_VALUE=Number.MAX_SAFE_INTEGER,t}(),Ur=function(){function t(e,n){e===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=e,this.bits=n??t.makeArray(e))}return t.prototype.getSize=function(){return this.size},t.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},t.prototype.ensureCapacity=function(e){if(e>32*this.bits.length){var n=t.makeArray(e);Nt.arraycopy(this.bits,0,n,0,this.bits.length),this.bits=n}},t.prototype.get=function(e){return(this.bits[Math.floor(e/32)]&1<<(31&e))!=0},t.prototype.set=function(e){this.bits[Math.floor(e/32)]|=1<<(31&e)},t.prototype.flip=function(e){this.bits[Math.floor(e/32)]^=1<<(31&e)},t.prototype.getNextSet=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=r[o]}var s=32*o+En.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.getNextUnset=function(e){var n=this.size;if(e>=n)return n;var r=this.bits,o=Math.floor(e/32),i=~r[o];i&=~((1<<(31&e))-1);for(var a=r.length;i===0;){if(++o===a)return n;i=~r[o]}var s=32*o+En.numberOfTrailingZeros(i);return s>n?n:s},t.prototype.setBulk=function(e,n){this.bits[Math.floor(e/32)]=n},t.prototype.setRange=function(e,n){if(n<e||e<0||n>this.size)throw new Ve;if(n!==e){n--;for(var r=Math.floor(e/32),o=Math.floor(n/32),i=this.bits,a=r;a<=o;a++){var s=(2<<(a<o?31:31&n))-(1<<(a>r?0:31&e));i[a]|=s}}},t.prototype.clear=function(){for(var e=this.bits.length,n=this.bits,r=0;r<e;r++)n[r]=0},t.prototype.isRange=function(e,n,r){if(n<e||e<0||n>this.size)throw new Ve;if(n===e)return!0;n--;for(var o=Math.floor(e/32),i=Math.floor(n/32),a=this.bits,s=o;s<=i;s++){var c=(2<<(s<i?31:31&n))-(1<<(s>o?0:31&e))&4294967295;if((a[s]&c)!==(r?c:0))return!1}return!0},t.prototype.appendBit=function(e){this.ensureCapacity(this.size+1),e&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++},t.prototype.appendBits=function(e,n){if(n<0||n>32)throw new Ve("Num bits must be between 0 and 32");this.ensureCapacity(this.size+n);for(var r=n;r>0;r--)this.appendBit((e>>r-1&1)==1)},t.prototype.appendBitArray=function(e){var n=e.size;this.ensureCapacity(this.size+n);for(var r=0;r<n;r++)this.appendBit(e.get(r))},t.prototype.xor=function(e){if(this.size!==e.size)throw new Ve("Sizes don't match");for(var n=this.bits,r=0,o=n.length;r<o;r++)n[r]^=e.bits[r]},t.prototype.toBytes=function(e,n,r,o){for(var i=0;i<o;i++){for(var a=0,s=0;s<8;s++)this.get(e)&&(a|=1<<7-s),e++;n[r+i]=a}},t.prototype.getBitArray=function(){return this.bits},t.prototype.reverse=function(){for(var e=new Int32Array(this.bits.length),n=Math.floor((this.size-1)/32),r=n+1,o=this.bits,i=0;i<r;i++){var a=o[i];a=(a=(a=(a=(a=a>>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,e[n-i]=a}if(this.size!==32*r){var s=32*r-this.size,c=e[0]>>>s;for(i=1;i<r;i++){var u=e[i];c|=u<<32-s,e[i-1]=c,c=u>>>s}e[r-1]=c}this.bits=e},t.makeArray=function(e){return new Int32Array(Math.floor((e+31)/32))},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.size===n.size&&or.equals(this.bits,n.bits)},t.prototype.hashCode=function(){return 31*this.size+or.hashCode(this.bits)},t.prototype.toString=function(){for(var e="",n=0,r=this.size;n<r;n++)!(7&n)&&(e+=" "),e+=this.get(n)?"X":".";return e},t.prototype.clone=function(){return new t(this.size,this.bits.slice())},t}();(function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(vf||(vf={}));var _t,Pt=vf,IS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Se=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return IS(e,t),e.getFormatInstance=function(){return new e},e.kind="FormatException",e}($n),TS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"})(_t||(_t={}));var bf,Yn=function(){function t(e,n,r){for(var o,i,a=[],s=3;s<arguments.length;s++)a[s-3]=arguments[s];this.valueIdentifier=e,this.name=r,this.values=typeof n=="number"?Int32Array.from([n]):n,this.otherEncodingNames=a,t.VALUE_IDENTIFIER_TO_ECI.set(e,this),t.NAME_TO_ECI.set(r,this);for(var c=this.values,u=0,d=c.length;u!==d;u++){var h=c[u];t.VALUES_TO_ECI.set(h,this)}try{for(var f=TS(a),p=f.next();!p.done;p=f.next()){var l=p.value;t.NAME_TO_ECI.set(l,this)}}catch(g){o={error:g}}finally{try{p&&!p.done&&(i=f.return)&&i.call(f)}finally{if(o)throw o.error}}}return t.prototype.getValueIdentifier=function(){return this.valueIdentifier},t.prototype.getName=function(){return this.name},t.prototype.getValue=function(){return this.values[0]},t.getCharacterSetECIByValue=function(e){if(e<0||e>=900)throw new Se("incorect value");var n=t.VALUES_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.getCharacterSetECIByName=function(e){var n=t.NAME_TO_ECI.get(e);if(n===void 0)throw new Se("incorect value");return n},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.getName()===n.getName()},t.VALUE_IDENTIFIER_TO_ECI=new Map,t.VALUES_TO_ECI=new Map,t.NAME_TO_ECI=new Map,t.Cp437=new t(_t.Cp437,Int32Array.from([0,2]),"Cp437"),t.ISO8859_1=new t(_t.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),t.ISO8859_2=new t(_t.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),t.ISO8859_3=new t(_t.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),t.ISO8859_4=new t(_t.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),t.ISO8859_5=new t(_t.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),t.ISO8859_6=new t(_t.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),t.ISO8859_7=new t(_t.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),t.ISO8859_8=new t(_t.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),t.ISO8859_9=new t(_t.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),t.ISO8859_10=new t(_t.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),t.ISO8859_11=new t(_t.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),t.ISO8859_13=new t(_t.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),t.ISO8859_14=new t(_t.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),t.ISO8859_15=new t(_t.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),t.ISO8859_16=new t(_t.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),t.SJIS=new t(_t.SJIS,20,"SJIS","Shift_JIS"),t.Cp1250=new t(_t.Cp1250,21,"Cp1250","windows-1250"),t.Cp1251=new t(_t.Cp1251,22,"Cp1251","windows-1251"),t.Cp1252=new t(_t.Cp1252,23,"Cp1252","windows-1252"),t.Cp1256=new t(_t.Cp1256,24,"Cp1256","windows-1256"),t.UnicodeBigUnmarked=new t(_t.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),t.UTF8=new t(_t.UTF8,26,"UTF8","UTF-8"),t.ASCII=new t(_t.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),t.Big5=new t(_t.Big5,28,"Big5"),t.GB18030=new t(_t.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),t.EUC_KR=new t(_t.EUC_KR,30,"EUC_KR","EUC-KR"),t}(),xS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),su=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return xS(e,t),e.kind="UnsupportedOperationException",e}($n),ci=function(){function t(){}return t.decode=function(e,n){var r=this.encodingName(n);return this.customDecoder?this.customDecoder(e,r):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(r)?this.decodeFallback(e,r):new TextDecoder(r).decode(e)},t.shouldDecodeOnFallback=function(e){return!t.isBrowser()&&e==="ISO-8859-1"},t.encode=function(e,n){var r=this.encodingName(n);return this.customEncoder?this.customEncoder(e,r):typeof TextEncoder>"u"?this.encodeFallback(e):new TextEncoder().encode(e)},t.isBrowser=function(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"},t.encodingName=function(e){return typeof e=="string"?e:e.getName()},t.encodingCharacterSet=function(e){return e instanceof Yn?e:Yn.getCharacterSetECIByName(e)},t.decodeFallback=function(e,n){var r=this.encodingCharacterSet(n);if(t.isDecodeFallbackSupported(r)){for(var o="",i=0,a=e.length;i<a;i++){var s=e[i].toString(16);s.length<2&&(s="0"+s),o+="%"+s}return decodeURIComponent(o)}if(r.equals(Yn.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(e.buffer));throw new su("Encoding "+this.encodingName(n)+" not supported by fallback.")},t.isDecodeFallbackSupported=function(e){return e.equals(Yn.UTF8)||e.equals(Yn.ISO8859_1)||e.equals(Yn.ASCII)},t.encodeFallback=function(e){for(var n=btoa(unescape(encodeURIComponent(e))).split(""),r=[],o=0;o<n.length;o++)r.push(n[o].charCodeAt(0));return new Uint8Array(r)},t}(),pn=function(){function t(){}return t.castAsNonUtf8Char=function(e,n){n===void 0&&(n=null);var r=n?n.getName():this.ISO88591;return ci.decode(new Uint8Array([e]),r)},t.guessEncoding=function(e,n){if(n!=null&&n.get(Pt.CHARACTER_SET)!==void 0)return n.get(Pt.CHARACTER_SET).toString();for(var r=e.length,o=!0,i=!0,a=!0,s=0,c=0,u=0,d=0,h=0,f=0,p=0,l=0,g=0,m=0,y=0,w=e.length>3&&e[0]===239&&e[1]===187&&e[2]===191,b=0;b<r&&(o||i||a);b++){var E=255&e[b];a&&(s>0?128&E?s--:a=!1:128&E&&(64&E?(s++,32&E?(s++,16&E?(s++,8&E?a=!1:d++):u++):c++):a=!1)),o&&(E>127&&E<160?o=!1:E>159&&(E<192||E===215||E===247)&&y++),i&&(h>0?E<64||E===127||E>252?i=!1:h--:E===128||E===160||E>239?i=!1:E>160&&E<224?(f++,l=0,++p>g&&(g=p)):E>127?(h++,p=0,++l>m&&(m=l)):(p=0,l=0))}return a&&s>0&&(a=!1),i&&h>0&&(i=!1),a&&(w||c+u+d>0)?t.UTF8:i&&(t.ASSUME_SHIFT_JIS||g>=3||m>=3)?t.SHIFT_JIS:o&&i?g===2&&f===2||10*y>=r?t.SHIFT_JIS:t.ISO88591:o?t.ISO88591:i?t.SHIFT_JIS:a?t.UTF8:t.PLATFORM_DEFAULT_ENCODING},t.format=function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=-1;function i(s,c,u,d,h,f){if(s==="%%")return"%";if(n[++o]!==void 0){s=d?parseInt(d.substr(1)):void 0;var p,l=h?parseInt(h.substr(1)):void 0;switch(f){case"s":p=n[o];break;case"c":p=n[o][0];break;case"f":p=parseFloat(n[o]).toFixed(s);break;case"p":p=parseFloat(n[o]).toPrecision(s);break;case"e":p=parseFloat(n[o]).toExponential(s);break;case"x":p=parseInt(n[o]).toString(l||16);break;case"d":p=parseFloat(parseInt(n[o],l||10).toPrecision(s)).toFixed(0)}p=typeof p=="object"?JSON.stringify(p):(+p).toString(l);for(var g=parseInt(u),m=u&&u[0]+""=="0"?"0":" ";p.length<g;)p=c!==void 0?p+m:m+p;return p}}var a=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return e.replace(a,i)},t.getBytes=function(e,n){return ci.encode(e,n)},t.getCharCode=function(e,n){return n===void 0&&(n=0),e.charCodeAt(n)},t.getCharAt=function(e){return String.fromCharCode(e)},t.SHIFT_JIS=Yn.SJIS.getName(),t.GB2312="GB2312",t.ISO88591=Yn.ISO8859_1.getName(),t.EUC_JP="EUC_JP",t.UTF8=Yn.UTF8.getName(),t.PLATFORM_DEFAULT_ENCODING=t.UTF8,t.ASSUME_SHIFT_JIS=!1,t}(),xt=function(){function t(e){e===void 0&&(e=""),this.value=e}return t.prototype.enableDecoding=function(e){return this.encoding=e,this},t.prototype.append=function(e){return typeof e=="string"?this.value+=e.toString():this.encoding?this.value+=pn.castAsNonUtf8Char(e,this.encoding):this.value+=String.fromCharCode(e),this},t.prototype.appendChars=function(e,n,r){for(var o=n;n<n+r;o++)this.append(e[o]);return this},t.prototype.length=function(){return this.value.length},t.prototype.charAt=function(e){return this.value.charAt(e)},t.prototype.deleteCharAt=function(e){this.value=this.value.substr(0,e)+this.value.substring(e+1)},t.prototype.setCharAt=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+1)},t.prototype.substring=function(e,n){return this.value.substring(e,n)},t.prototype.setLengthToZero=function(){this.value=""},t.prototype.toString=function(){return this.value},t.prototype.insert=function(e,n){this.value=this.value.substr(0,e)+n+this.value.substr(e+n.length)},t}(),oo=function(){function t(e,n,r,o){if(this.width=e,this.height=n,this.rowSize=r,this.bits=o,n==null&&(n=e),this.height=n,e<1||n<1)throw new Ve("Both dimensions must be greater than 0");r==null&&(r=Math.floor((e+31)/32)),this.rowSize=r,o==null&&(this.bits=new Int32Array(this.rowSize*this.height))}return t.parseFromBooleanArray=function(e){for(var n=e.length,r=e[0].length,o=new t(r,n),i=0;i<n;i++)for(var a=e[i],s=0;s<r;s++)a[s]&&o.set(s,i);return o},t.parseFromString=function(e,n,r){if(e===null)throw new Ve("stringRepresentation cannot be null");for(var o=new Array(e.length),i=0,a=0,s=-1,c=0,u=0;u<e.length;)if(e.charAt(u)===`
137
137
  `||e.charAt(u)==="\r"){if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Ve("row lengths do not match");a=i,c++}u++}else if(e.substring(u,u+n.length)===n)u+=n.length,o[i]=!0,i++;else{if(e.substring(u,u+r.length)!==r)throw new Ve("illegal character encountered: "+e.substring(u));u+=r.length,o[i]=!1,i++}if(i>a){if(s===-1)s=i-a;else if(i-a!==s)throw new Ve("row lengths do not match");c++}for(var d=new t(s,c),h=0;h<i;h++)o[h]&&d.set(Math.floor(h%s),Math.floor(h/s));return d},t.prototype.get=function(e,n){var r=n*this.rowSize+Math.floor(e/32);return(this.bits[r]>>>(31&e)&1)!=0},t.prototype.set=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]|=1<<(31&e)&4294967295},t.prototype.unset=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]&=~(1<<(31&e)&4294967295)},t.prototype.flip=function(e,n){var r=n*this.rowSize+Math.floor(e/32);this.bits[r]^=1<<(31&e)&4294967295},t.prototype.xor=function(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new Ve("input matrix dimensions do not match");for(var n=new Ur(Math.floor(this.width/32)+1),r=this.rowSize,o=this.bits,i=0,a=this.height;i<a;i++)for(var s=i*r,c=e.getRow(i,n).getBitArray(),u=0;u<r;u++)o[s+u]^=c[u]},t.prototype.clear=function(){for(var e=this.bits,n=e.length,r=0;r<n;r++)e[r]=0},t.prototype.setRegion=function(e,n,r,o){if(n<0||e<0)throw new Ve("Left and top must be nonnegative");if(o<1||r<1)throw new Ve("Height and width must be at least 1");var i=e+r,a=n+o;if(a>this.height||i>this.width)throw new Ve("The region must fit inside the matrix");for(var s=this.rowSize,c=this.bits,u=n;u<a;u++)for(var d=u*s,h=e;h<i;h++)c[d+Math.floor(h/32)]|=1<<(31&h)&4294967295},t.prototype.getRow=function(e,n){n==null||n.getSize()<this.width?n=new Ur(this.width):n.clear();for(var r=this.rowSize,o=this.bits,i=e*r,a=0;a<r;a++)n.setBulk(32*a,o[i+a]);return n},t.prototype.setRow=function(e,n){Nt.arraycopy(n.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)},t.prototype.rotate180=function(){for(var e=this.getWidth(),n=this.getHeight(),r=new Ur(e),o=new Ur(e),i=0,a=Math.floor((n+1)/2);i<a;i++)r=this.getRow(i,r),o=this.getRow(n-1-i,o),r.reverse(),o.reverse(),this.setRow(i,o),this.setRow(n-1-i,r)},t.prototype.getEnclosingRectangle=function(){for(var e=this.width,n=this.height,r=this.rowSize,o=this.bits,i=e,a=n,s=-1,c=-1,u=0;u<n;u++)for(var d=0;d<r;d++){var h=o[u*r+d];if(h!==0){if(u<a&&(a=u),u>c&&(c=u),32*d<i){for(var f=0;!(h<<31-f&4294967295);)f++;32*d+f<i&&(i=32*d+f)}if(32*d+31>s){for(f=31;!(h>>>f);)f--;32*d+f>s&&(s=32*d+f)}}}return s<i||c<a?null:Int32Array.from([i,a,s-i+1,c-a+1])},t.prototype.getTopLeftOnBit=function(){for(var e=this.rowSize,n=this.bits,r=0;r<n.length&&n[r]===0;)r++;if(r===n.length)return null;for(var o=r/e,i=r%e*32,a=n[r],s=0;!(a<<31-s&4294967295);)s++;return i+=s,Int32Array.from([i,o])},t.prototype.getBottomRightOnBit=function(){for(var e=this.rowSize,n=this.bits,r=n.length-1;r>=0&&n[r]===0;)r--;if(r<0)return null;for(var o=Math.floor(r/e),i=32*Math.floor(r%e),a=n[r],s=31;!(a>>>s);)s--;return i+=s,Int32Array.from([i,o])},t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.getRowSize=function(){return this.rowSize},t.prototype.equals=function(e){if(!(e instanceof t))return!1;var n=e;return this.width===n.width&&this.height===n.height&&this.rowSize===n.rowSize&&or.equals(this.bits,n.bits)},t.prototype.hashCode=function(){var e=this.width;return e=31*(e=31*(e=31*(e=31*e+this.width)+this.height)+this.rowSize)+or.hashCode(this.bits)},t.prototype.toString=function(e,n,r){return e===void 0&&(e="X "),n===void 0&&(n=" "),r===void 0&&(r=`
138
138
  `),this.buildToString(e,n,r)},t.prototype.buildToString=function(e,n,r){for(var o=new xt,i=0,a=this.height;i<a;i++){for(var s=0,c=this.width;s<c;s++)o.append(this.get(s,i)?e:n);o.append(r)}return o.toString()},t.prototype.clone=function(){return new t(this.width,this.height,this.rowSize,this.bits.slice())},t}(),OS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),he=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return OS(e,t),e.getNotFoundInstance=function(){return new e},e.kind="NotFoundException",e}($n),PS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),kS=function(t){function e(n){var r=t.call(this,n)||this;return r.luminances=e.EMPTY,r.buckets=new Int32Array(e.LUMINANCE_BUCKETS),r}return PS(e,t),e.prototype.getBlackRow=function(n,r){var o=this.getLuminanceSource(),i=o.getWidth();r==null||r.getSize()<i?r=new Ur(i):r.clear(),this.initArrays(i);for(var a=o.getRow(n,this.luminances),s=this.buckets,c=0;c<i;c++)s[(255&a[c])>>e.LUMINANCE_SHIFT]++;var u=e.estimateBlackPoint(s);if(i<3)for(c=0;c<i;c++)(255&a[c])<u&&r.set(c);else{var d=255&a[0],h=255&a[1];for(c=1;c<i-1;c++){var f=255&a[c+1];(4*h-d-f)/2<u&&r.set(c),d=h,h=f}}return r},e.prototype.getBlackMatrix=function(){var n=this.getLuminanceSource(),r=n.getWidth(),o=n.getHeight(),i=new oo(r,o);this.initArrays(r);for(var a=this.buckets,s=1;s<5;s++)for(var c=Math.floor(o*s/5),u=n.getRow(c,this.luminances),d=Math.floor(4*r/5),h=Math.floor(r/5);h<d;h++)a[(255&u[h])>>e.LUMINANCE_SHIFT]++;var f=e.estimateBlackPoint(a),p=n.getMatrix();for(s=0;s<o;s++){var l=s*r;for(h=0;h<r;h++)(255&p[l+h])<f&&i.set(h,s)}return i},e.prototype.createBinarizer=function(n){return new e(n)},e.prototype.initArrays=function(n){this.luminances.length<n&&(this.luminances=new Uint8ClampedArray(n));for(var r=this.buckets,o=0;o<e.LUMINANCE_BUCKETS;o++)r[o]=0},e.estimateBlackPoint=function(n){for(var r=n.length,o=0,i=0,a=0,s=0;s<r;s++)n[s]>a&&(i=s,a=n[s]),n[s]>o&&(o=n[s]);var c=0,u=0;for(s=0;s<r;s++){var d=s-i;(l=n[s]*d*d)>u&&(c=s,u=l)}if(i>c){var h=i;i=c,c=h}if(c-i<=r/16)throw new he;var f=c-1,p=-1;for(s=c-1;s>i;s--){var l,g=s-i;(l=g*g*(c-s)*(o-n[s]))>p&&(f=s,p=l)}return f<<e.LUMINANCE_SHIFT},e.LUMINANCE_BITS=5,e.LUMINANCE_SHIFT=8-e.LUMINANCE_BITS,e.LUMINANCE_BUCKETS=1<<e.LUMINANCE_BITS,e.EMPTY=Uint8ClampedArray.from([0]),e}(CS),BS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),d2=function(t){function e(n){var r=t.call(this,n)||this;return r.matrix=null,r}return BS(e,t),e.prototype.getBlackMatrix=function(){if(this.matrix!==null)return this.matrix;var n=this.getLuminanceSource(),r=n.getWidth(),o=n.getHeight();if(r>=e.MINIMUM_DIMENSION&&o>=e.MINIMUM_DIMENSION){var i=n.getMatrix(),a=r>>e.BLOCK_SIZE_POWER;r&e.BLOCK_SIZE_MASK&&a++;var s=o>>e.BLOCK_SIZE_POWER;o&e.BLOCK_SIZE_MASK&&s++;var c=e.calculateBlackPoints(i,a,s,r,o),u=new oo(r,o);e.calculateThresholdForBlock(i,a,s,r,o,c,u),this.matrix=u}else this.matrix=t.prototype.getBlackMatrix.call(this);return this.matrix},e.prototype.createBinarizer=function(n){return new e(n)},e.calculateThresholdForBlock=function(n,r,o,i,a,s,c){for(var u=a-e.BLOCK_SIZE,d=i-e.BLOCK_SIZE,h=0;h<o;h++){var f=h<<e.BLOCK_SIZE_POWER;f>u&&(f=u);for(var p=e.cap(h,2,o-3),l=0;l<r;l++){var g=l<<e.BLOCK_SIZE_POWER;g>d&&(g=d);for(var m=e.cap(l,2,r-3),y=0,w=-2;w<=2;w++){var b=s[p+w];y+=b[m-2]+b[m-1]+b[m]+b[m+1]+b[m+2]}var E=y/25;e.thresholdBlock(n,g,f,E,i,c)}}},e.cap=function(n,r,o){return n<r?r:n>o?o:n},e.thresholdBlock=function(n,r,o,i,a,s){for(var c=0,u=o*a+r;c<e.BLOCK_SIZE;c++,u+=a)for(var d=0;d<e.BLOCK_SIZE;d++)(255&n[u+d])<=i&&s.set(r+d,o+c)},e.calculateBlackPoints=function(n,r,o,i,a){for(var s=a-e.BLOCK_SIZE,c=i-e.BLOCK_SIZE,u=new Array(o),d=0;d<o;d++){u[d]=new Int32Array(r);var h=d<<e.BLOCK_SIZE_POWER;h>s&&(h=s);for(var f=0;f<r;f++){var p=f<<e.BLOCK_SIZE_POWER;p>c&&(p=c);for(var l=0,g=255,m=0,y=0,w=h*i+p;y<e.BLOCK_SIZE;y++,w+=i){for(var b=0;b<e.BLOCK_SIZE;b++){var E=255&n[w+b];l+=E,E<g&&(g=E),E>m&&(m=E)}if(m-g>e.MIN_DYNAMIC_RANGE)for(y++,w+=i;y<e.BLOCK_SIZE;y++,w+=i)for(b=0;b<e.BLOCK_SIZE;b++)l+=255&n[w+b]}var C=l>>2*e.BLOCK_SIZE_POWER;if(m-g<=e.MIN_DYNAMIC_RANGE&&(C=g/2,d>0&&f>0)){var I=(u[d-1][f]+2*u[d][f-1]+u[d-1][f-1])/4;g<I&&(C=I)}u[d][f]=C}}return u},e.BLOCK_SIZE_POWER=3,e.BLOCK_SIZE=1<<e.BLOCK_SIZE_POWER,e.BLOCK_SIZE_MASK=e.BLOCK_SIZE-1,e.MINIMUM_DIMENSION=5*e.BLOCK_SIZE,e.MIN_DYNAMIC_RANGE=24,e}(kS),fs=function(){function t(e,n){this.width=e,this.height=n}return t.prototype.getWidth=function(){return this.width},t.prototype.getHeight=function(){return this.height},t.prototype.isCropSupported=function(){return!1},t.prototype.crop=function(e,n,r,o){throw new su("This luminance source does not support cropping.")},t.prototype.isRotateSupported=function(){return!1},t.prototype.rotateCounterClockwise=function(){throw new su("This luminance source does not support rotation by 90 degrees.")},t.prototype.rotateCounterClockwise45=function(){throw new su("This luminance source does not support rotation by 45 degrees.")},t.prototype.toString=function(){for(var e=new Uint8ClampedArray(this.width),n=new xt,r=0;r<this.height;r++){for(var o=this.getRow(r,e),i=0;i<this.width;i++){var a=255&o[i],s=void 0;s=a<64?"#":a<128?"+":a<192?".":" ",n.append(s)}n.append(`
139
139
  `)}return n.toString()},t}(),NS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),cu=function(t){function e(n){var r=t.call(this,n.getWidth(),n.getHeight())||this;return r.delegate=n,r}return NS(e,t),e.prototype.getRow=function(n,r){for(var o=this.delegate.getRow(n,r),i=this.getWidth(),a=0;a<i;a++)o[a]=255-(255&o[a]);return o},e.prototype.getMatrix=function(){for(var n=this.delegate.getMatrix(),r=this.getWidth()*this.getHeight(),o=new Uint8ClampedArray(r),i=0;i<r;i++)o[i]=255-(255&n[i]);return o},e.prototype.isCropSupported=function(){return this.delegate.isCropSupported()},e.prototype.crop=function(n,r,o,i){return new e(this.delegate.crop(n,r,o,i))},e.prototype.isRotateSupported=function(){return this.delegate.isRotateSupported()},e.prototype.invert=function(){return this.delegate},e.prototype.rotateCounterClockwise=function(){return new e(this.delegate.rotateCounterClockwise())},e.prototype.rotateCounterClockwise45=function(){return new e(this.delegate.rotateCounterClockwise45())},e}(fs),RS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),DS=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.tempCanvasElement=null,r.buffer=e.makeBufferFromCanvasImageData(n),r}return RS(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d").getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(r.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement(),o=r.getContext("2d"),i=n*e.DEGREE_TO_RADIANS,a=this.canvas.width,s=this.canvas.height,c=Math.ceil(Math.abs(Math.cos(i))*a+Math.abs(Math.sin(i))*s),u=Math.ceil(Math.abs(Math.sin(i))*a+Math.abs(Math.cos(i))*s);return r.width=c,r.height=u,o.translate(c/2,u/2),o.rotate(i),o.drawImage(this.canvas,a/-2,s/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.prototype.invert=function(){return new cu(this)},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs),MS=function(){function t(e,n,r){this.deviceId=e,this.label=n,this.kind="videoinput",this.groupId=r||void 0}return t.prototype.toJSON=function(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}},t}(),Nn=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Rn=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},LS=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Zi=function(){function t(e,n,r){n===void 0&&(n=500),this.reader=e,this.timeBetweenScansMillis=n,this._hints=r,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}return Object.defineProperty(t.prototype,"hasNavigator",{get:function(){return typeof navigator<"u"},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isMediaDevicesSuported",{get:function(){return this.hasNavigator&&!!navigator.mediaDevices},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"canEnumerateDevices",{get:function(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"timeBetweenDecodingAttempts",{get:function(){return this._timeBetweenDecodingAttempts},set:function(e){this._timeBetweenDecodingAttempts=e<0?0:e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"hints",{get:function(){return this._hints},set:function(e){this._hints=e||null},enumerable:!1,configurable:!0}),t.prototype.listVideoInputDevices=function(){return Nn(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Rn(this,function(p){switch(p.label){case 0:if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=LS(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.prototype.getVideoInputDevices=function(){return Nn(this,void 0,void 0,function(){return Rn(this,function(e){switch(e.label){case 0:return[4,this.listVideoInputDevices()];case 1:return[2,e.sent().map(function(n){return new MS(n.deviceId,n.label)})]}})})},t.prototype.findDeviceById=function(e){return Nn(this,void 0,void 0,function(){var n;return Rn(this,function(r){switch(r.label){case 0:return[4,this.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2,null]}})})},t.prototype.decodeFromInputVideoDevice=function(e,n){return Nn(this,void 0,void 0,function(){return Rn(this,function(r){switch(r.label){case 0:return[4,this.decodeOnceFromVideoDevice(e,n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return Nn(this,void 0,void 0,function(){var r;return Rn(this,function(o){switch(o.label){case 0:return this.reset(),r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return Nn(this,void 0,void 0,function(){var r;return Rn(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return Nn(this,void 0,void 0,function(){var r;return Rn(this,function(o){switch(o.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return r=o.sent(),[4,this.decodeOnce(r)];case 2:return[2,o.sent()]}})})},t.prototype.decodeFromInputVideoDeviceContinuously=function(e,n,r){return Nn(this,void 0,void 0,function(){return Rn(this,function(o){switch(o.label){case 0:return[4,this.decodeFromVideoDevice(e,n,r)];case 1:return[2,o.sent()]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return Nn(this,void 0,void 0,function(){var o;return Rn(this,function(i){switch(i.label){case 0:return o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return Nn(this,void 0,void 0,function(){var o;return Rn(this,function(i){switch(i.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return o=i.sent(),[4,this.decodeFromStream(o,n,r)];case 2:return[2,i.sent()]}})})},t.prototype.decodeFromStream=function(e,n,r){return Nn(this,void 0,void 0,function(){var o;return Rn(this,function(i){switch(i.label){case 0:return this.reset(),[4,this.attachStreamToVideo(e,n)];case 1:return o=i.sent(),[4,this.decodeContinuously(o,r)];case 2:return[2,i.sent()]}})})},t.prototype.stopAsyncDecode=function(){this._stopAsyncDecode=!0},t.prototype.stopContinuousDecode=function(){this._stopContinuousDecode=!0},t.prototype.attachStreamToVideo=function(e,n){return Nn(this,void 0,void 0,function(){var r;return Rn(this,function(o){switch(o.label){case 0:return r=this.prepareVideoElement(n),this.addVideoSource(r,e),this.videoElement=r,this.stream=e,[4,this.playVideoOnLoadAsync(r)];case 1:return o.sent(),[2,r]}})})},t.prototype.playVideoOnLoadAsync=function(e){var n=this;return new Promise(function(r,o){return n.playVideoOnLoad(e,function(){return r()})})},t.prototype.playVideoOnLoad=function(e,n){var r=this;this.videoEndedListener=function(){return r.stopStreams()},this.videoCanPlayListener=function(){return r.tryPlayVideo(e)},e.addEventListener("ended",this.videoEndedListener),e.addEventListener("canplay",this.videoCanPlayListener),e.addEventListener("playing",n),this.tryPlayVideo(e)},t.prototype.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&!e.ended&&e.readyState>2},t.prototype.tryPlayVideo=function(e){return Nn(this,void 0,void 0,function(){return Rn(this,function(n){switch(n.label){case 0:if(this.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,e.play()];case 2:return n.sent(),[3,4];case 3:return n.sent(),console.warn("It was not possible to play the video."),[3,4];case 4:return[2]}})})},t.prototype.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.prototype.decodeFromImage=function(e,n){if(!e&&!n)throw new Ht("either imageElement with a src set or an url must be provided");return n&&!e?this.decodeFromImageUrl(n):this.decodeFromImageElement(e)},t.prototype.decodeFromVideo=function(e,n){if(!e&&!n)throw new Ht("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrl(n):this.decodeFromVideoElement(e)},t.prototype.decodeFromVideoContinuously=function(e,n,r){if(e===void 0&&n===void 0)throw new Ht("Either an element with a src set or an URL must be provided");return n&&!e?this.decodeFromVideoUrlContinuously(n,r):this.decodeFromVideoElementContinuously(e,r)},t.prototype.decodeFromImageElement=function(e){if(!e)throw new Ht("An image element must be provided.");this.reset();var n=this.prepareImageElement(e);return this.imageElement=n,this.isImageLoaded(n)?this.decodeOnce(n,!1,!0):this._decodeOnLoadImage(n)},t.prototype.decodeFromVideoElement=function(e){var n=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideo(n)},t.prototype.decodeFromVideoElementContinuously=function(e,n){var r=this._decodeFromVideoElementSetup(e);return this._decodeOnLoadVideoContinuously(r,n)},t.prototype._decodeFromVideoElementSetup=function(e){if(!e)throw new Ht("A video element must be provided.");this.reset();var n=this.prepareVideoElement(e);return this.videoElement=n,n},t.prototype.decodeFromImageUrl=function(e){if(!e)throw new Ht("An URL must be provided.");this.reset();var n=this.prepareImageElement();this.imageElement=n;var r=this._decodeOnLoadImage(n);return n.src=e,r},t.prototype.decodeFromVideoUrl=function(e){if(!e)throw new Ht("An URL must be provided.");this.reset();var n=this.prepareVideoElement(),r=this.decodeFromVideoElement(n);return n.src=e,r},t.prototype.decodeFromVideoUrlContinuously=function(e,n){if(!e)throw new Ht("An URL must be provided.");this.reset();var r=this.prepareVideoElement(),o=this.decodeFromVideoElementContinuously(r,n);return r.src=e,o},t.prototype._decodeOnLoadImage=function(e){var n=this;return new Promise(function(r,o){n.imageLoadedListener=function(){return n.decodeOnce(e,!1,!0).then(r,o)},e.addEventListener("load",n.imageLoadedListener)})},t.prototype._decodeOnLoadVideo=function(e){return Nn(this,void 0,void 0,function(){return Rn(this,function(n){switch(n.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return n.sent(),[4,this.decodeOnce(e)];case 2:return[2,n.sent()]}})})},t.prototype._decodeOnLoadVideoContinuously=function(e,n){return Nn(this,void 0,void 0,function(){return Rn(this,function(r){switch(r.label){case 0:return[4,this.playVideoOnLoadAsync(e)];case 1:return r.sent(),this.decodeContinuously(e,n),[2]}})})},t.prototype.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.prototype.prepareImageElement=function(e){var n;return e===void 0&&((n=document.createElement("img")).width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"img")),e instanceof HTMLImageElement&&(n=e),n},t.prototype.prepareVideoElement=function(e){var n;return e||typeof document>"u"||((n=document.createElement("video")).width=200,n.height=200),typeof e=="string"&&(n=this.getMediaElement(e,"video")),e instanceof HTMLVideoElement&&(n=e),n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.prototype.decodeOnce=function(e,n,r){var o=this;n===void 0&&(n=!0),r===void 0&&(r=!0),this._stopAsyncDecode=!1;var i=function(a,s){if(o._stopAsyncDecode)return s(new he("Video stream has ended before any code could be detected.")),void(o._stopAsyncDecode=void 0);try{a(o.decode(e))}catch(c){if(n&&c instanceof he||(c instanceof sn||c instanceof Se)&&r)return setTimeout(i,o._timeBetweenDecodingAttempts,a,s);s(c)}};return new Promise(function(a,s){return i(a,s)})},t.prototype.decodeContinuously=function(e,n){var r=this;this._stopContinuousDecode=!1;var o=function(){if(r._stopContinuousDecode)r._stopContinuousDecode=void 0;else try{var i=r.decode(e);n(i,null),setTimeout(o,r.timeBetweenScansMillis)}catch(a){n(null,a),(a instanceof sn||a instanceof Se||a instanceof he)&&setTimeout(o,r._timeBetweenDecodingAttempts)}};o()},t.prototype.decode=function(e){var n=this.createBinaryBitmap(e);return this.decodeBitmap(n)},t.prototype.createBinaryBitmap=function(e){var n=this.getCaptureCanvasContext(e);this.drawImageOnCanvas(n,e);var r=this.getCaptureCanvas(e),o=new DS(r),i=new d2(o);return new u2(i)},t.prototype.getCaptureCanvasContext=function(e){if(!this.captureCanvasContext){var n=this.getCaptureCanvas(e).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext},t.prototype.getCaptureCanvas=function(e){if(!this.captureCanvas){var n=this.createCaptureCanvas(e);this.captureCanvas=n}return this.captureCanvas},t.prototype.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this._hints)},t.prototype.createCaptureCanvas=function(e){if(typeof document>"u")return this._destroyCaptureCanvas(),null;var n,r,o=document.createElement("canvas");return e!==void 0&&(e instanceof HTMLVideoElement?(n=e.videoWidth,r=e.videoHeight):e instanceof HTMLImageElement&&(n=e.naturalWidth||e.width,r=e.naturalHeight||e.height)),o.style.width=n+"px",o.style.height=r+"px",o.width=n,o.height=r,o},t.prototype.stopStreams=function(){this.stream&&(this.stream.getVideoTracks().forEach(function(e){return e.stop()}),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()},t.prototype.reset=function(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()},t.prototype._destroyVideoElement=function(){this.videoElement&&(this.videoEndedListener!==void 0&&this.videoElement.removeEventListener("ended",this.videoEndedListener),this.videoPlayingEventListener!==void 0&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),this.videoCanPlayListener!==void 0&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)},t.prototype._destroyImageElement=function(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)},t.prototype._destroyCaptureCanvas=function(){this.captureCanvasContext=void 0,this.captureCanvas=void 0},t.prototype.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.prototype.cleanVideoSource=function(e){try{e.srcObject=null}catch{e.src=""}this.videoElement.removeAttribute("src")},t}(),Wn=function(){function t(e,n,r,o,i,a){r===void 0&&(r=n==null?0:8*n.length),a===void 0&&(a=Nt.currentTimeMillis()),this.text=e,this.rawBytes=n,this.numBits=r,this.resultPoints=o,this.format=i,this.timestamp=a,this.text=e,this.rawBytes=n,this.numBits=r??(n==null?0:8*n.length),this.resultPoints=o,this.format=i,this.resultMetadata=null,this.timestamp=a??Nt.currentTimeMillis()}return t.prototype.getText=function(){return this.text},t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.getResultPoints=function(){return this.resultPoints},t.prototype.getBarcodeFormat=function(){return this.format},t.prototype.getResultMetadata=function(){return this.resultMetadata},t.prototype.putMetadata=function(e,n){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(e,n)},t.prototype.putAllMetadata=function(e){e!==null&&(this.resultMetadata===null?this.resultMetadata=e:this.resultMetadata=new Map(e))},t.prototype.addResultPoints=function(e){var n=this.resultPoints;if(n===null)this.resultPoints=e;else if(e!==null&&e.length>0){var r=new Array(n.length+e.length);Nt.arraycopy(n,0,r,0,n.length),Nt.arraycopy(e,0,r,n.length,e.length),this.resultPoints=r}},t.prototype.getTimestamp=function(){return this.timestamp},t.prototype.toString=function(){return this.text},t}();(function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(bf||(bf={}));var Ef,Re=bf;(function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Ef||(Ef={}));var Cn,_n=Ef,uu=function(){function t(e,n,r,o,i,a){i===void 0&&(i=-1),a===void 0&&(a=-1),this.rawBytes=e,this.text=n,this.byteSegments=r,this.ecLevel=o,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=a,this.numBits=e==null?0:8*e.length}return t.prototype.getRawBytes=function(){return this.rawBytes},t.prototype.getNumBits=function(){return this.numBits},t.prototype.setNumBits=function(e){this.numBits=e},t.prototype.getText=function(){return this.text},t.prototype.getByteSegments=function(){return this.byteSegments},t.prototype.getECLevel=function(){return this.ecLevel},t.prototype.getErrorsCorrected=function(){return this.errorsCorrected},t.prototype.setErrorsCorrected=function(e){this.errorsCorrected=e},t.prototype.getErasures=function(){return this.erasures},t.prototype.setErasures=function(e){this.erasures=e},t.prototype.getOther=function(){return this.other},t.prototype.setOther=function(e){this.other=e},t.prototype.hasStructuredAppend=function(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0},t.prototype.getStructuredAppendParity=function(){return this.structuredAppendParity},t.prototype.getStructuredAppendSequenceNumber=function(){return this.structuredAppendSequenceNumber},t}(),hs=function(){function t(){}return t.prototype.exp=function(e){return this.expTable[e]},t.prototype.log=function(e){if(e===0)throw new Ve;return this.logTable[e]},t.addOrSubtract=function(e,n){return e^n},t}(),ps=function(){function t(e,n){if(n.length===0)throw new Ve;this.field=e;var r=n.length;if(r>1&&n[0]===0){for(var o=1;o<r&&n[o]===0;)o++;o===r?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(r-o),Nt.arraycopy(n,o,this.coefficients,0,this.coefficients.length))}else this.coefficients=n}return t.prototype.getCoefficients=function(){return this.coefficients},t.prototype.getDegree=function(){return this.coefficients.length-1},t.prototype.isZero=function(){return this.coefficients[0]===0},t.prototype.getCoefficient=function(e){return this.coefficients[this.coefficients.length-1-e]},t.prototype.evaluateAt=function(e){if(e===0)return this.getCoefficient(0);var n,r=this.coefficients;if(e===1){n=0;for(var o=0,i=r.length;o!==i;o++){var a=r[o];n=hs.addOrSubtract(n,a)}return n}n=r[0];var s=r.length,c=this.field;for(o=1;o<s;o++)n=hs.addOrSubtract(c.multiply(e,n),r[o]);return n},t.prototype.addOrSubtract=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(this.isZero())return e;if(e.isZero())return this;var n=this.coefficients,r=e.coefficients;if(n.length>r.length){var o=n;n=r,r=o}var i=new Int32Array(r.length),a=r.length-n.length;Nt.arraycopy(r,0,i,0,a);for(var s=a;s<r.length;s++)i[s]=hs.addOrSubtract(n[s-a],r[s]);return new t(this.field,i)},t.prototype.multiply=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(this.isZero()||e.isZero())return this.field.getZero();for(var n=this.coefficients,r=n.length,o=e.coefficients,i=o.length,a=new Int32Array(r+i-1),s=this.field,c=0;c<r;c++)for(var u=n[c],d=0;d<i;d++)a[c+d]=hs.addOrSubtract(a[c+d],s.multiply(u,o[d]));return new t(s,a)},t.prototype.multiplyScalar=function(e){if(e===0)return this.field.getZero();if(e===1)return this;for(var n=this.coefficients.length,r=this.field,o=new Int32Array(n),i=this.coefficients,a=0;a<n;a++)o[a]=r.multiply(i[a],e);return new t(r,o)},t.prototype.multiplyByMonomial=function(e,n){if(e<0)throw new Ve;if(n===0)return this.field.getZero();for(var r=this.coefficients,o=r.length,i=new Int32Array(o+e),a=this.field,s=0;s<o;s++)i[s]=a.multiply(r[s],n);return new t(a,i)},t.prototype.divide=function(e){if(!this.field.equals(e.field))throw new Ve("GenericGFPolys do not have same GenericGF field");if(e.isZero())throw new Ve("Divide by 0");for(var n=this.field,r=n.getZero(),o=this,i=e.getCoefficient(e.getDegree()),a=n.inverse(i);o.getDegree()>=e.getDegree()&&!o.isZero();){var s=o.getDegree()-e.getDegree(),c=n.multiply(o.getCoefficient(o.getDegree()),a),u=e.multiplyByMonomial(s,c),d=n.buildMonomial(s,c);r=r.addOrSubtract(d),o=o.addOrSubtract(u)}return[r,o]},t.prototype.toString=function(){for(var e="",n=this.getDegree();n>=0;n--){var r=this.getCoefficient(n);if(r!==0){if(r<0?(e+=" - ",r=-r):e.length>0&&(e+=" + "),n===0||r!==1){var o=this.field.log(r);o===0?e+="1":o===1?e+="a":(e+="a^",e+=o)}n!==0&&(n===1?e+="x":(e+="x^",e+=n))}}return e},t}(),FS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),f2=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return FS(e,t),e.kind="ArithmeticException",e}($n),jS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Mo=function(t){function e(n,r,o){var i=t.call(this)||this;i.primitive=n,i.size=r,i.generatorBase=o;for(var a=new Int32Array(r),s=1,c=0;c<r;c++)a[c]=s,(s*=2)>=r&&(s^=n,s&=r-1);i.expTable=a;var u=new Int32Array(r);for(c=0;c<r-1;c++)u[a[c]]=c;return i.logTable=u,i.zero=new ps(i,Int32Array.from([0])),i.one=new ps(i,Int32Array.from([1])),i}return jS(e,t),e.prototype.getZero=function(){return this.zero},e.prototype.getOne=function(){return this.one},e.prototype.buildMonomial=function(n,r){if(n<0)throw new Ve;if(r===0)return this.zero;var o=new Int32Array(n+1);return o[0]=r,new ps(this,o)},e.prototype.inverse=function(n){if(n===0)throw new f2;return this.expTable[this.size-this.logTable[n]-1]},e.prototype.multiply=function(n,r){return n===0||r===0?0:this.expTable[(this.logTable[n]+this.logTable[r])%(this.size-1)]},e.prototype.getSize=function(){return this.size},e.prototype.getGeneratorBase=function(){return this.generatorBase},e.prototype.toString=function(){return"GF(0x"+En.toHexString(this.primitive)+","+this.size+")"},e.prototype.equals=function(n){return n===this},e.AZTEC_DATA_12=new e(4201,4096,1),e.AZTEC_DATA_10=new e(1033,1024,1),e.AZTEC_DATA_6=new e(67,64,1),e.AZTEC_PARAM=new e(19,16,1),e.QR_CODE_FIELD_256=new e(285,256,0),e.DATA_MATRIX_FIELD_256=new e(301,256,1),e.AZTEC_DATA_8=e.DATA_MATRIX_FIELD_256,e.MAXICODE_FIELD_64=e.AZTEC_DATA_6,e}(hs),VS=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),lu=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return VS(e,t),e.kind="ReedSolomonException",e}($n),US=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gs=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return US(e,t),e.kind="IllegalStateException",e}($n),du=function(){function t(e){this.field=e}return t.prototype.decode=function(e,n){for(var r=this.field,o=new ps(r,e),i=new Int32Array(n),a=!0,s=0;s<n;s++){var c=o.evaluateAt(r.exp(s+r.getGeneratorBase()));i[i.length-1-s]=c,c!==0&&(a=!1)}if(!a){var u=new ps(r,i),d=this.runEuclideanAlgorithm(r.buildMonomial(n,1),u,n),h=d[0],f=d[1],p=this.findErrorLocations(h),l=this.findErrorMagnitudes(f,p);for(s=0;s<p.length;s++){var g=e.length-1-r.log(p[s]);if(g<0)throw new lu("Bad error location");e[g]=Mo.addOrSubtract(e[g],l[s])}}},t.prototype.runEuclideanAlgorithm=function(e,n,r){if(e.getDegree()<n.getDegree()){var o=e;e=n,n=o}for(var i=this.field,a=e,s=n,c=i.getZero(),u=i.getOne();s.getDegree()>=(r/2|0);){var d=a,h=c;if(c=u,(a=s).isZero())throw new lu("r_{i-1} was zero");s=d;for(var f=i.getZero(),p=a.getCoefficient(a.getDegree()),l=i.inverse(p);s.getDegree()>=a.getDegree()&&!s.isZero();){var g=s.getDegree()-a.getDegree(),m=i.multiply(s.getCoefficient(s.getDegree()),l);f=f.addOrSubtract(i.buildMonomial(g,m)),s=s.addOrSubtract(a.multiplyByMonomial(g,m))}if(u=f.multiply(c).addOrSubtract(h),s.getDegree()>=a.getDegree())throw new gs("Division algorithm failed to reduce polynomial?")}var y=u.getCoefficient(0);if(y===0)throw new lu("sigmaTilde(0) was zero");var w=i.inverse(y);return[u.multiplyScalar(w),s.multiplyScalar(w)]},t.prototype.findErrorLocations=function(e){var n=e.getDegree();if(n===1)return Int32Array.from([e.getCoefficient(1)]);for(var r=new Int32Array(n),o=0,i=this.field,a=1;a<i.getSize()&&o<n;a++)e.evaluateAt(a)===0&&(r[o]=i.inverse(a),o++);if(o!==n)throw new lu("Error locator degree does not match number of roots");return r},t.prototype.findErrorMagnitudes=function(e,n){for(var r=n.length,o=new Int32Array(r),i=this.field,a=0;a<r;a++){for(var s=i.inverse(n[a]),c=1,u=0;u<r;u++)if(a!==u){var d=i.multiply(n[u],s),h=1&d?-2&d:1|d;c=i.multiply(c,h)}o[a]=i.multiply(e.evaluateAt(s),i.inverse(c)),i.getGeneratorBase()!==0&&(o[a]=i.multiply(o[a],s))}return o},t}();(function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"})(Cn||(Cn={}));var h2=function(){function t(){}return t.prototype.decode=function(e){this.ddata=e;var n=e.getBits(),r=this.extractBits(n),o=this.correctBits(r),i=t.convertBoolArrayToByteArray(o),a=t.getEncodedData(o),s=new uu(i,a,null,null);return s.setNumBits(o.length),s},t.highLevelDecode=function(e){return this.getEncodedData(e)},t.getEncodedData=function(e){for(var n=e.length,r=Cn.UPPER,o=Cn.UPPER,i="",a=0;a<n;)if(o===Cn.BINARY){if(n-a<5)break;var s=t.readCode(e,a,5);if(a+=5,s===0){if(n-a<11)break;s=t.readCode(e,a,11)+31,a+=11}for(var c=0;c<s;c++){if(n-a<8){a=n;break}var u=t.readCode(e,a,8);i+=pn.castAsNonUtf8Char(u),a+=8}o=r}else{var d=o===Cn.DIGIT?4:5;if(n-a<d)break;u=t.readCode(e,a,d),a+=d;var h=t.getCharacter(o,u);h.startsWith("CTRL_")?(r=o,o=t.getTable(h.charAt(5)),h.charAt(6)==="L"&&(r=o)):(i+=h,o=r)}return i},t.getTable=function(e){switch(e){case"L":return Cn.LOWER;case"P":return Cn.PUNCT;case"M":return Cn.MIXED;case"D":return Cn.DIGIT;case"B":return Cn.BINARY;default:return Cn.UPPER}},t.getCharacter=function(e,n){switch(e){case Cn.UPPER:return t.UPPER_TABLE[n];case Cn.LOWER:return t.LOWER_TABLE[n];case Cn.MIXED:return t.MIXED_TABLE[n];case Cn.PUNCT:return t.PUNCT_TABLE[n];case Cn.DIGIT:return t.DIGIT_TABLE[n];default:throw new gs("Bad table")}},t.prototype.correctBits=function(e){var n,r;this.ddata.getNbLayers()<=2?(r=6,n=Mo.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(r=8,n=Mo.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(r=10,n=Mo.AZTEC_DATA_10):(r=12,n=Mo.AZTEC_DATA_12);var o=this.ddata.getNbDatablocks(),i=e.length/r;if(i<o)throw new Se;for(var a=e.length%r,s=new Int32Array(i),c=0;c<i;c++,a+=r)s[c]=t.readCode(e,a,r);try{new du(n).decode(s,i-o)}catch(g){throw new Se(g)}var u=(1<<r)-1,d=0;for(c=0;c<o;c++){if((p=s[c])===0||p===u)throw new Se;p!==1&&p!==u-1||d++}var h=new Array(o*r-d),f=0;for(c=0;c<o;c++){var p;if((p=s[c])===1||p===u-1)h.fill(p>1,f,f+r-1),f+=r-1;else for(var l=r-1;l>=0;--l)h[f++]=(p&1<<l)!=0}return h},t.prototype.extractBits=function(e){var n=this.ddata.isCompact(),r=this.ddata.getNbLayers(),o=(n?11:14)+4*r,i=new Int32Array(o),a=new Array(this.totalBitsInLayer(r,n));if(n)for(var s=0;s<i.length;s++)i[s]=s;else{var c=o+1+2*En.truncDivision(En.truncDivision(o,2)-1,15),u=o/2,d=En.truncDivision(c,2);for(s=0;s<u;s++){var h=s+En.truncDivision(s,15);i[u-s-1]=d-h-1,i[u+s]=d+h+1}}s=0;for(var f=0;s<r;s++){for(var p=4*(r-s)+(n?9:12),l=2*s,g=o-1-l,m=0;m<p;m++)for(var y=2*m,w=0;w<2;w++)a[f+y+w]=e.get(i[l+w],i[l+m]),a[f+2*p+y+w]=e.get(i[l+m],i[g-w]),a[f+4*p+y+w]=e.get(i[g-w],i[g-m]),a[f+6*p+y+w]=e.get(i[g-m],i[l+w]);f+=8*p}return a},t.readCode=function(e,n,r){for(var o=0,i=n;i<n+r;i++)o<<=1,e[i]&&(o|=1);return o},t.readByte=function(e,n){var r=e.length-n;return r>=8?t.readCode(e,n,8):t.readCode(e,n,r)<<8-r},t.convertBoolArrayToByteArray=function(e){for(var n=new Uint8Array((e.length+7)/8),r=0;r<n.length;r++)n[r]=t.readByte(e,8*r);return n},t.prototype.totalBitsInLayer=function(e,n){return((n?88:112)+16*e)*e},t.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],t.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],t.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",`
@@ -150,7 +150,7 @@ Error:`,o)}}function Q5(){return N5(t=>{Ki("cls",{metric:t}),Qg=t},{reportAllCha
150
150
  matrix: null
151
151
  `),e.append(`>>
152
152
  `),e.toString()},t.prototype.setMode=function(e){this.mode=e},t.prototype.setECLevel=function(e){this.ecLevel=e},t.prototype.setVersion=function(e){this.version=e},t.prototype.setMaskPattern=function(e){this.maskPattern=e},t.prototype.setMatrix=function(e){this.matrix=e},t.isValidMaskPattern=function(e){return e>=0&&e<t.NUM_MASK_PATTERNS},t.NUM_MASK_PATTERNS=8,t}(),QI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),hi=function(t){function e(){return t!==null&&t.apply(this,arguments)||this}return QI(e,t),e.kind="WriterException",e}($n);(function(){function t(){}return t.clearMatrix=function(e){e.clear(255)},t.buildMatrix=function(e,n,r,o,i){t.clearMatrix(i),t.embedBasicPatterns(r,i),t.embedTypeInfo(n,o,i),t.maybeEmbedVersionInfo(r,i),t.embedDataBits(e,o,i)},t.embedBasicPatterns=function(e,n){t.embedPositionDetectionPatternsAndSeparators(n),t.embedDarkDotAtLeftBottomCorner(n),t.maybeEmbedPositionAdjustmentPatterns(e,n),t.embedTimingPatterns(n)},t.embedTypeInfo=function(e,n,r){var o=new Ur;t.makeTypeInfoBits(e,n,o);for(var i=0,a=o.getSize();i<a;++i){var s=o.get(o.getSize()-1-i),c=t.TYPE_INFO_COORDINATES[i],u=c[0],d=c[1];if(r.setBoolean(u,d,s),i<8){var h=r.getWidth()-i-1,f=8;r.setBoolean(h,f,s)}else h=8,f=r.getHeight()-7+(i-8),r.setBoolean(h,f,s)}},t.maybeEmbedVersionInfo=function(e,n){if(!(e.getVersionNumber()<7)){var r=new Ur;t.makeVersionInfoBits(e,r);for(var o=17,i=0;i<6;++i)for(var a=0;a<3;++a){var s=r.get(o);o--,n.setBoolean(i,n.getHeight()-11+a,s),n.setBoolean(n.getHeight()-11+a,i,s)}}},t.embedDataBits=function(e,n,r){for(var o=0,i=-1,a=r.getWidth()-1,s=r.getHeight()-1;a>0;){for(a===6&&(a-=1);s>=0&&s<r.getHeight();){for(var c=0;c<2;++c){var u=a-c;if(t.isEmpty(r.get(u,s))){var d=void 0;o<e.getSize()?(d=e.get(o),++o):d=!1,n!==255&&zI.getDataMaskBit(n,u,s)&&(d=!d),r.setBoolean(u,s,d)}}s+=i}s+=i=-i,a-=2}if(o!==e.getSize())throw new hi("Not all bits consumed: "+o+"/"+e.getSize())},t.findMSBSet=function(e){return 32-En.numberOfLeadingZeros(e)},t.calculateBCHCode=function(e,n){if(n===0)throw new Ve("0 polynomial");var r=t.findMSBSet(n);for(e<<=r-1;t.findMSBSet(e)>=r;)e^=n<<t.findMSBSet(e)-r;return e},t.makeTypeInfoBits=function(e,n,r){if(!XI.isValidMaskPattern(n))throw new hi("Invalid mask pattern");var o=e.getBits()<<3|n;r.appendBits(o,5);var i=t.calculateBCHCode(o,t.TYPE_INFO_POLY);r.appendBits(i,10);var a=new Ur;if(a.appendBits(t.TYPE_INFO_MASK_PATTERN,15),r.xor(a),r.getSize()!==15)throw new hi("should not happen but we got: "+r.getSize())},t.makeVersionInfoBits=function(e,n){n.appendBits(e.getVersionNumber(),6);var r=t.calculateBCHCode(e.getVersionNumber(),t.VERSION_INFO_POLY);if(n.appendBits(r,12),n.getSize()!==18)throw new hi("should not happen but we got: "+n.getSize())},t.isEmpty=function(e){return e===255},t.embedTimingPatterns=function(e){for(var n=8;n<e.getWidth()-8;++n){var r=(n+1)%2;t.isEmpty(e.get(n,6))&&e.setNumber(n,6,r),t.isEmpty(e.get(6,n))&&e.setNumber(6,n,r)}},t.embedDarkDotAtLeftBottomCorner=function(e){if(e.get(8,e.getHeight()-8)===0)throw new hi;e.setNumber(8,e.getHeight()-8,1)},t.embedHorizontalSeparationPattern=function(e,n,r){for(var o=0;o<8;++o){if(!t.isEmpty(r.get(e+o,n)))throw new hi;r.setNumber(e+o,n,0)}},t.embedVerticalSeparationPattern=function(e,n,r){for(var o=0;o<7;++o){if(!t.isEmpty(r.get(e,n+o)))throw new hi;r.setNumber(e,n+o,0)}},t.embedPositionAdjustmentPattern=function(e,n,r){for(var o=0;o<5;++o)for(var i=t.POSITION_ADJUSTMENT_PATTERN[o],a=0;a<5;++a)r.setNumber(e+a,n+o,i[a])},t.embedPositionDetectionPattern=function(e,n,r){for(var o=0;o<7;++o)for(var i=t.POSITION_DETECTION_PATTERN[o],a=0;a<7;++a)r.setNumber(e+a,n+o,i[a])},t.embedPositionDetectionPatternsAndSeparators=function(e){var n=t.POSITION_DETECTION_PATTERN[0].length;t.embedPositionDetectionPattern(0,0,e),t.embedPositionDetectionPattern(e.getWidth()-n,0,e),t.embedPositionDetectionPattern(0,e.getWidth()-n,e),t.embedHorizontalSeparationPattern(0,7,e),t.embedHorizontalSeparationPattern(e.getWidth()-8,7,e),t.embedHorizontalSeparationPattern(0,e.getWidth()-8,e),t.embedVerticalSeparationPattern(7,0,e),t.embedVerticalSeparationPattern(e.getHeight()-7-1,0,e),t.embedVerticalSeparationPattern(7,e.getHeight()-7,e)},t.maybeEmbedPositionAdjustmentPatterns=function(e,n){if(!(e.getVersionNumber()<2))for(var r=e.getVersionNumber()-1,o=t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[r],i=0,a=o.length;i!==a;i++){var s=o[i];if(s>=0)for(var c=0;c!==a;c++){var u=o[c];u>=0&&t.isEmpty(n.get(u,s))&&t.embedPositionAdjustmentPattern(u-2,s-2,n)}}},t.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),t.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),t.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),t.VERSION_INFO_POLY=7973,t.TYPE_INFO_POLY=1335,t.TYPE_INFO_MASK_PATTERN=21522,t})(),function(){Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Yn.UTF8.getName()}();var JI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o,i,a,s,c,u){var d=t.call(this,s,c)||this;if(d.yuvData=n,d.dataWidth=r,d.dataHeight=o,d.left=i,d.top=a,i+s>r||a+c>o)throw new Ve("Crop rectangle does not fit within image data.");return u&&d.reverseHorizontal(s,c),d}JI(e,t),e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length<o)&&(r=new Uint8ClampedArray(o));var i=(n+this.top)*this.dataWidth+this.left;return Nt.arraycopy(this.yuvData,i,r,0,o),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.yuvData;var o=n*r,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Nt.arraycopy(this.yuvData,a,i,0,o),i;for(var s=0;s<r;s++){var c=s*n;Nt.arraycopy(this.yuvData,a,i,c,n),a+=this.dataWidth}return i},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return new e(this.yuvData,this.dataWidth,this.dataHeight,this.left+n,this.top+r,o,i,!1)},e.prototype.renderThumbnail=function(){for(var n=this.getWidth()/e.THUMBNAIL_SCALE_FACTOR,r=this.getHeight()/e.THUMBNAIL_SCALE_FACTOR,o=new Int32Array(n*r),i=this.yuvData,a=this.top*this.dataWidth+this.left,s=0;s<r;s++){for(var c=s*n,u=0;u<n;u++){var d=255&i[a+u*e.THUMBNAIL_SCALE_FACTOR];o[c+u]=4278190080|65793*d}a+=this.dataWidth*e.THUMBNAIL_SCALE_FACTOR}return o},e.prototype.getThumbnailWidth=function(){return this.getWidth()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.getThumbnailHeight=function(){return this.getHeight()/e.THUMBNAIL_SCALE_FACTOR},e.prototype.reverseHorizontal=function(n,r){for(var o=this.yuvData,i=0,a=this.top*this.dataWidth+this.left;i<r;i++,a+=this.dataWidth)for(var s=a+n/2,c=a,u=a+n-1;c<s;c++,u--){var d=o[c];o[c]=o[u],o[u]=d}},e.prototype.invert=function(){return new cu(this)},e.THUMBNAIL_SCALE_FACTOR=2})(fs);var ZI=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o,i,a,s,c){var u=t.call(this,r,o)||this;if(u.dataWidth=i,u.dataHeight=a,u.left=s,u.top=c,n.BYTES_PER_ELEMENT===4){for(var d=r*o,h=new Uint8ClampedArray(d),f=0;f<d;f++){var p=n[f],l=p>>16&255,g=p>>7&510,m=255&p;h[f]=(l+g+m)/4&255}u.luminances=h}else u.luminances=n;if(i===void 0&&(u.dataWidth=r),a===void 0&&(u.dataHeight=o),s===void 0&&(u.left=0),c===void 0&&(u.top=0),u.left+r>u.dataWidth||u.top+o>u.dataHeight)throw new Ve("Crop rectangle does not fit within image data.");return u}ZI(e,t),e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth();(r==null||r.length<o)&&(r=new Uint8ClampedArray(o));var i=(n+this.top)*this.dataWidth+this.left;return Nt.arraycopy(this.luminances,i,r,0,o),r},e.prototype.getMatrix=function(){var n=this.getWidth(),r=this.getHeight();if(n===this.dataWidth&&r===this.dataHeight)return this.luminances;var o=n*r,i=new Uint8ClampedArray(o),a=this.top*this.dataWidth+this.left;if(n===this.dataWidth)return Nt.arraycopy(this.luminances,a,i,0,o),i;for(var s=0;s<r;s++){var c=s*n;Nt.arraycopy(this.luminances,a,i,c,n),a+=this.dataWidth}return i},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return new e(this.luminances,o,i,this.dataWidth,this.dataHeight,this.left+n,this.top+r)},e.prototype.invert=function(){return new cu(this)}})(fs);var eT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(){return t!==null&&t.apply(this,arguments)||this}eT(e,t),e.forName=function(n){return this.getCharacterSetECIByName(n)}})(Yn);var tT=function(){function t(e){this.previous=e}return t.prototype.getPrevious=function(){return this.previous},t}(),nT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),$2=function(t){function e(n,r,o){var i=t.call(this,n)||this;return i.value=r,i.bitCount=o,i}return nT(e,t),e.prototype.appendTo=function(n,r){n.appendBits(this.value,this.bitCount)},e.prototype.add=function(n,r){return new e(this,n,r)},e.prototype.addBinaryShift=function(n,r){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new e(this,n,r)},e.prototype.toString=function(){var n=this.value&(1<<this.bitCount)-1;return n|=1<<this.bitCount,"<"+En.toBinaryString(n|1<<this.bitCount).substring(1)+">"},e}(tT),rT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r,o){var i=t.call(this,n,0,0)||this;return i.binaryShiftStart=r,i.binaryShiftByteCount=o,i}rT(e,t),e.prototype.appendTo=function(n,r){for(var o=0;o<this.binaryShiftByteCount;o++)(o===0||o===31&&this.binaryShiftByteCount<=62)&&(n.appendBits(31,5),this.binaryShiftByteCount>62?n.appendBits(this.binaryShiftByteCount-31,16):o===0?n.appendBits(Math.min(this.binaryShiftByteCount,31),5):n.appendBits(this.binaryShiftByteCount-31,5)),n.appendBits(r[this.binaryShiftStart+o],8)},e.prototype.addBinaryShift=function(n,r){return new e(this,n,r)},e.prototype.toString=function(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}})($2),new $2(null,0,0);var oT=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")};(function(t){var e,n;try{for(var r=oT(t),o=r.next();!o.done;o=r.next()){var i=o.value;or.fill(i,-1)}}catch(a){e={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(e)throw e.error}}t[0][4]=0,t[1][4]=0,t[1][0]=28,t[3][4]=0,t[2][4]=0,t[2][0]=15})(or.createInt32Array(6,6)),function(t){var e=pn.getCharCode(" "),n=pn.getCharCode("."),r=pn.getCharCode(",");t[0][e]=1;for(var o=pn.getCharCode("Z"),i=pn.getCharCode("A"),a=i;a<=o;a++)t[0][a]=a-i+2;t[1][e]=1;var s=pn.getCharCode("z"),c=pn.getCharCode("a");for(a=c;a<=s;a++)t[1][a]=a-c+2;t[2][e]=1;var u=pn.getCharCode("9"),d=pn.getCharCode("0");for(a=d;a<=u;a++)t[2][a]=a-d+2;t[2][r]=12,t[2][n]=13;for(var h=["\0"," ","","","","","","","\x07","\b"," ",`
153
- `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][pn.getCharCode(h[f])]=f;var p=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<p.length;f++)pn.getCharCode(p[f])>0&&(t[4][pn.getCharCode(p[f])]=f)}(or.createInt32Array(5,256));var iT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aT=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=e.makeBufferFromCanvasImageData(n),r}return iT(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(o.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new cu(this)},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var o=n*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),c=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);r.width=s,r.height=c;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(s/2,c/2),u.rotate(o),u.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs);function Y2(){return typeof navigator<"u"}function sT(){return!!(Y2()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var oa=function(){return oa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},oa.apply(this,arguments)},$t=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Yt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},_u=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cT={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ia=function(){function t(e,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=e,this.hints=n,this.options=oa(oa({},cT),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Pt.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),t.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.mediaStreamSetTorch=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var n,r,o=e.getVideoTracks();try{for(var i=_u(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(e){try{return"torch"in e.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},t.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return t.getMediaElement(e,"video");if(!e&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return t.getMediaElement(e,"img");if(e===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var n=t.createVideoElement(e);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.createBinaryBitmapFromCanvas=function(e){var n=new aT(e),r=new d2(n);return new u2(r)},t.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Ht("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=t.getMediaElementDimensions(e),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},t.tryPlayVideo=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(e!=null&&e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var n=t.createCaptureCanvas(e),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(r,e),n},t.createBinaryBitmapFromMediaElem=function(e){var n=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(n)},t.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},t.listVideoInputDevices=function(){return $t(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Yt(this,function(p){switch(p.label){case 0:if(!Y2())throw new Error("Can't enumerate devices, navigator is not present.");if(!sT())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=_u(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.findDeviceById=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){t.isVideoPlaying(e)||(i(!1),e.removeEventListener("canplay",s))},n),s=function(){t.tryPlayVideo(e).then(function(c){clearTimeout(a),e.removeEventListener("canplay",s),o(c)})};e.addEventListener("canplay",s)})]}})})},t.attachStreamToVideo=function(e,n,r){return r===void 0&&(r=5e3),$t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(n),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(n,r){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),n()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(e){if(!e)throw new Ht("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(n){return n.stop()}),e=void 0},t.prototype.decode=function(e){var n=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(n)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},t.prototype.decodeFromCanvas=function(e){var n=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(n)},t.prototype.decodeFromImageElement=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An image element must be provided.");return n=t.prepareImageElement(e),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareImageElement()).src=e,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return t.destroyImageElement(n),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i;return Yt(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i,a,s,c,u,d,h,f,p,l=this;return Yt(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,n,o)];case 1:return i=g.sent(),a=function(){var m,y;try{for(var w=_u(e.getVideoTracks()),b=w.next();!b.done;b=w.next())b.value.stop()}catch(E){m={error:E}}finally{try{b&&!b.done&&(y=w.return)&&y.call(w)}finally{if(m)throw m.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},c=this.scan(i,r,s),u=e.getVideoTracks(),d=oa(oa({},c),{stop:function(){c.stop()},streamVideoConstraintsApply:function(m,y){return $t(this,void 0,void 0,function(){var w,b,E,C,I,T;return Yt(this,function(P){switch(P.label){case 0:w=y?u.filter(y):u,P.label=1;case 1:P.trys.push([1,6,7,8]),b=_u(w),E=b.next(),P.label=2;case 2:return E.done?[3,5]:[4,E.value.applyConstraints(m)];case 3:P.sent(),P.label=4;case 4:return E=b.next(),[3,2];case 5:return[3,8];case 6:return C=P.sent(),I={error:C},[3,8];case 7:try{E&&!E.done&&(T=b.return)&&T.call(b)}finally{if(I)throw I.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(m){return u.find(m).getConstraints()},streamVideoSettingsGet:function(m){return u.find(m).getSettings()},streamVideoCapabilitiesGet:function(m){return u.find(m).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=u==null?void 0:u.find(function(m){return t.mediaStreamIsTorchCompatibleTrack(m)}),f=function(m){return $t(l,void 0,void 0,function(){return Yt(this,function(y){switch(y.label){case 0:return[4,t.mediaStreamSetTorch(h,m)];case 1:return y.sent(),[2]}})})},d.switchTorch=f,p=function(){c.stop(),f(!1)},d.stop=p),[2,d]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return $t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(r),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("A video element must be provided.");return r=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},t.prototype.decodeFromVideoUrl=function(e,n){return $t(this,void 0,void 0,function(){var r,o,i;return Yt(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("An URL must be provided.");return(r=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:return r=!!n,[4,t.attachStreamToVideo(e,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("A video element must be provided.");return n=t.prepareVideoElement(e),r=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareVideoElement()).src=e,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(n),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(e,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(e,function(c,u,d){if(c)return a(c),void d.stop();if(u){if(u instanceof he&&n||u instanceof sn&&r||u instanceof Se&&o)return;d.stop(),s(u)}})})},t.prototype.scan=function(e,n,r){var o=this;t.checkCallbackFnOrThrow(n);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,c=function(){a=void 0,i=void 0},u=!1,d={stop:function(){u=!0,clearTimeout(s),c(),r&&r()}},h=function(){if(!u)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);n(f,void 0,d),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(p){if(n(void 0,p,d),p instanceof sn||p instanceof Se||p instanceof he)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));c(),r&&r(p)}};return h(),d},t.prototype._decodeOnLoadImage=function(e){return $t(this,void 0,void 0,function(){return Yt(this,function(n){switch(n.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(e)]}})})},t}(),uT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new fu,n,r)||this}uT(e,t)})(ia);var lT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new na(n),n,r)||this}lT(e,t)})(ia);var dT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new vu,n,r)||this}dT(e,t)})(ia);var fT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){var o=this,i=new q2;return i.setHints(n),(o=t.call(this,i,n,r)||this).reader=i,o}fT(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(n){this.hints.set(Pt.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},e.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(ia);var hT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new Cu,n,r)||this}hT(e,t)})(ia);var pT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gT=function(t){function e(n,r){return t.call(this,new Eu,n,r)||this}return pT(e,t),e}(ia),Au=function(t,e,n){var r=typeof t===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(n,'".')),r},mT=function(t){var e=t.scanDelay,n=t.constraints,r=t.onResult,o=t.videoId,i=x.useRef(null);x.useEffect(function(){var a=new gT(null,{delayBetweenScanAttempts:e});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&Au(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),Au(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,c){Au(r,"onResult","function")&&r(s,c,a)}).then(function(s){return i.current=s}).catch(function(s){Au(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},pi=function(){return pi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pi.apply(this,arguments)},W2={container:{width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},video:{top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0}},Rf=function(t){var e=t.videoContainerStyle,n=t.containerStyle,r=t.videoStyle,o=t.constraints,i=t.ViewFinder,a=t.scanDelay,s=t.className,c=t.onResult,u=t.videoId;return mT({constraints:o,scanDelay:a,onResult:c,videoId:u}),ce.createElement("section",{className:s,style:n},ce.createElement("div",{style:pi(pi({},W2.container),e)},!!i&&ce.createElement(i,null),ce.createElement("video",{muted:!0,id:u,style:pi(pi(pi({},W2.video),r),{transform:(o==null?void 0:o.facingMode)==="user"&&"scaleX(-1)"})})))};Rf.displayName="QrReader",Rf.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};function yT({onScan:t}){const{cameraFacingMode:e}=Xt(),[n,r]=x.useState(e??vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx(Rf,{onResult:o=>{o&&t(o.getText())},constraints:{facingMode:n},videoStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem",objectFit:"cover"},videoContainerStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem"}}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===vn.USER?r(vn.ENVIRONMENT):r(vn.USER),children:v.jsx("img",{src:iu,alt:"camera-switch"})})]})}class Xe{constructor(e,n,r,o,i){this._legacyCanvasSize=Xe.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=e,this.$canvas=document.createElement("canvas"),r&&typeof r=="object"?this._onDecode=n:(console.warn(r||o||i?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof r=="object"?r:{},this._onDecodeError=n.onDecodeError||(typeof r=="function"?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||i||this._preferredCamera,this._legacyCanvasSize=typeof r=="number"?r:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;if(e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),r=e.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(o=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),i=this.$overlay.style,i.position="absolute",i.display="none",i.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(e),requestAnimationFrame(()=>{let s=window.getComputedStyle(e);s.display==="none"&&(e.style.setProperty("display","block","important"),a=!0),s.visibility!=="visible"&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity="0",e.style.width="0",e.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=Xe.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await Xe.listCameras(!1)).length}catch{return!1}}static async listCameras(e=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),r;try{e&&(await n()).every(o=>!o.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((o,i)=>({id:o.deviceId,label:o.label||(i===0?"Default Camera":`Camera ${i+1}`)}))}finally{r&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),Xe._stopVideoStream(r))}}async hasFlash(){let e;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;e=this.$video.srcObject}else e=(await this._getCameraStream()).stream;return"torch"in e.getVideoTracks()[0].getSettings()}catch{return!1}finally{e&&e!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),Xe._stopVideoStream(e))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),Xe._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:e,facingMode:n}=await this._getCameraStream();!this._active||this._paused?Xe._stopVideoStream(e):(this._setVideoMirror(n),this.$video.srcObject=e,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(e=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(Xe._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return e?(n(),!0):(await new Promise(r=>setTimeout(r,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(e,n,r,o,i=!1,a=!1){let s,c=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(s=n.scanRegion,r=n.qrEngine,o=n.canvas,i=n.disallowCanvasResizing||!1,a=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||o||i||a?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!r;try{let u,d;[r,u]=await Promise.all([r||Xe.createQrEngine(),Xe._loadImage(e)]),[o,d]=Xe._drawToCanvas(u,s,o,i);let h;if(r instanceof Worker){let f=r;n||Xe._postWorkerMessageSync(f,"inversionMode","both"),h=await new Promise((p,l)=>{let g,m,y,w=-1;m=E=>{E.data.id===w&&(f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),E.data.data!==null?p({data:E.data.data,cornerPoints:Xe._convertPoints(E.data.cornerPoints,s)}):l(Xe.NO_QR_CODE_FOUND))},y=E=>{f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),l("Scanner error: "+(E?E.message||E:"Unknown Error"))},f.addEventListener("message",m),f.addEventListener("error",y),g=setTimeout(()=>y("timeout"),1e4);let b=d.getImageData(0,0,o.width,o.height);w=Xe._postWorkerMessageSync(f,"decode",b,[b.data.buffer])})}else h=await Promise.race([new Promise((f,p)=>window.setTimeout(()=>p("Scanner error: timeout"),1e4)),(async()=>{try{var[f]=await r.detect(o);if(!f)throw Xe.NO_QR_CODE_FOUND;return{data:f.rawValue,cornerPoints:Xe._convertPoints(f.cornerPoints,s)}}catch(p){if(f=p.message||p,/not implemented|service unavailable/.test(f))return Xe._disableBarcodeDetector=!0,Xe.scanImage(e,{scanRegion:s,canvas:o,disallowCanvasResizing:i,alsoTryWithoutScanRegion:a});throw`Scanner error: ${f}`}})()]);return c?h:h.data}catch(u){if(!s||!a)throw u;let d=await Xe.scanImage(e,{qrEngine:r,canvas:o,disallowCanvasResizing:i});return c?d:d.data}finally{n||Xe._postWorkerMessage(r,"close")}}setGrayscaleWeights(e,n,r,o=!0){Xe._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:n,blue:r,useIntegerApproximation:o})}setInversionMode(e){Xe._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static async createQrEngine(e){if(e&&console.warn("Specifying a worker path is not required and not supported anymore."),e=()=>Promise.resolve().then(()=>hO).then(r=>r.createWorker()),!(!Xe._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return e();let n=navigator.userAgentData;return n&&n.brands.some(({brand:r})=>/Chromium/i.test(r))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:r,platformVersion:o})=>/arm/i.test(r||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?e():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let n=Math.round(.6666666666666666*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-n)/2),y:Math.round((e.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,n=e.videoWidth,r=e.videoHeight,o=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,s=e.offsetTop,c=window.getComputedStyle(e),u=c.objectFit,d=n/r,h=o/i;switch(u){case"none":var f=n,p=r;break;case"fill":f=o,p=i;break;default:(u==="cover"?d>h:d<h)?(p=i,f=p*d):(f=o,p=f/d),u==="scale-down"&&(f=Math.min(f,n),p=Math.min(p,r))}var[l,g]=c.objectPosition.split(" ").map((y,w)=>{const b=parseFloat(y);return y.endsWith("%")?(w?i-p:o-f)*b/100:b});c=this._scanRegion.width||n,h=this._scanRegion.height||r,u=this._scanRegion.x||0;var m=this._scanRegion.y||0;d=this.$overlay.style,d.width=`${c/n*f}px`,d.height=`${h/r*p}px`,d.top=`${s+g+m/r*p}px`,r=/scaleX\(-1\)/.test(e.style.transform),d.left=`${a+(r?o-l-f:l)+(r?n-u-c:u)/n*f}px`,d.transform=e.style.transform}})}static _convertPoints(e,n){if(!n)return e;let r=n.x||0,o=n.y||0,i=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let a of e)a.x=a.x*i+r,a.y=a.y*n+o;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var e=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;e<n&&await new Promise(o=>setTimeout(o,n-e)),this._lastScanTimestamp=Date.now();try{var r=await Xe.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!Xe._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=Xe.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",r.cornerPoints.map(({x:o,y:i})=>`${o},${i}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(e){e!==Xe.NO_QR_CODE_FOUND&&console.log(e)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],r=n.map(o=>Object.assign({},o,{[e]:{exact:this._preferredCamera}}));for(let o of[...r,...n])try{let i=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),a=this._getFacingMode(i)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:i,facingMode:a}}catch{}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let n of e.getTracks())n.stop(),e.removeTrack(n)}_setVideoMirror(e){this.$video.style.transform="scaleX("+(e==="user"?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,n,r,o=!1){r=r||document.createElement("canvas");let i=n&&n.x?n.x:0,a=n&&n.y?n.y:0,s=n&&n.width?n.width:e.videoWidth||e.width,c=n&&n.height?n.height:e.videoHeight||e.height;return o||(o=n&&n.downScaledWidth?n.downScaledWidth:s,n=n&&n.downScaledHeight?n.downScaledHeight:c,r.width!==o&&(r.width=o),r.height!==n&&(r.height=n)),n=r.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(e,i,a,s,c,0,0,r.width,r.height),[r,n]}static async _loadImage(e){if(e instanceof Image)return await Xe._awaitImageLoad(e),e;if(e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGImageElement||"OffscreenCanvas"in window&&e instanceof OffscreenCanvas||"ImageBitmap"in window&&e instanceof ImageBitmap)return e;if(e instanceof File||e instanceof Blob||e instanceof URL||typeof e=="string"){let n=new Image;n.src=e instanceof File||e instanceof Blob?URL.createObjectURL(e):e.toString();try{return await Xe._awaitImageLoad(n),n}finally{(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((n,r)=>{let o=i=>{e.removeEventListener("load",o),e.removeEventListener("error",o),i instanceof ErrorEvent?r("Image load error"):n()};e.addEventListener("load",o),e.addEventListener("error",o)})}static async _postWorkerMessage(e,n,r,o){return Xe._postWorkerMessageSync(await e,n,r,o)}static _postWorkerMessageSync(e,n,r,o){if(!(e instanceof Worker))return-1;let i=Xe._workerMessageId++;return e.postMessage({id:i,type:n,data:r},o),i}}Xe.DEFAULT_CANVAS_SIZE=400,Xe.NO_QR_CODE_FOUND="No QR code found",Xe._disableBarcodeDetector=!1,Xe._workerMessageId=0;function vT({onScan:t}){const{cameraFacingMode:e}=Xt(),[n,r]=x.useState(e),o=x.useRef(),i=x.useRef(null),[a,s]=x.useState(!0),c=d=>{t(d==null?void 0:d.data)},u=d=>{};return x.useEffect(()=>{var d;return i!=null&&i.current&&!o.current&&(o.current=new Xe(i==null?void 0:i.current,c,{onDecodeError:u,preferredCamera:n}),(d=o==null?void 0:o.current)==null||d.start().then(()=>s(!0)).catch(h=>{h&&s(!1)})),()=>{var h;i!=null&&i.current||(h=o==null?void 0:o.current)==null||h.stop()}},[]),x.useEffect(()=>{a||alert("Camera is blocked or not accessible. Please allow camera in your browser permissions and reload.")},[a]),v.jsxs("div",{className:"relative",children:[v.jsx("video",{className:"max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover",ref:i}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>{var h;const d=n===vn.USER?vn.ENVIRONMENT:vn.USER;r(d),(h=o==null?void 0:o.current)==null||h.setCamera(d)},children:v.jsx("img",{src:iu,alt:"camera-switch"})})]})}function wT({onScan:t}){const{t:e}=Ue(),{cameraFacingMode:n}=Xt(),[r,o]=x.useState(n),i=x.useRef(),a=x.useRef(null),[s,c]=x.useState(!1),u=f=>{t(f==null?void 0:f.data)},d=f=>{};x.useEffect(()=>()=>{var f;a!=null&&a.current||(f=i==null?void 0:i.current)==null||f.stop()});const h=()=>{var f;a!=null&&a.current&&!i.current&&(i.current=new Xe(a==null?void 0:a.current,u,{onDecodeError:d,preferredCamera:r}),(f=i==null?void 0:i.current)==null||f.start().then(()=>c(!0)).catch(p=>{p&&c(!1)}))};return v.jsxs("div",{className:"relative",children:[v.jsx("video",{className:"max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover",ref:a,autoPlay:!0,playsInline:!0}),s?v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>{var p;const f=r===vn.USER?vn.ENVIRONMENT:vn.USER;o(f),(p=i==null?void 0:i.current)==null||p.setCamera(f)},children:v.jsx("img",{src:iu,alt:"camera-switch"})}):v.jsx("div",{className:"absolute left-1/2 right-1/2 top-1/2 flex items-center justify-center",children:v.jsx(Ze,{label:e("enableCamera"),disabled:s,onClick:h})})]})}function aa({data:t,dataSetter:e,setDefer:n,label:r=""}){const o=x.useRef(null),[i,a]=Rb()??[0,0],{subscribe:s,unsubscribe:c}=Oa(),{cameraService:u}=Xt(),d=f=>{e(f)};x.useEffect(()=>{a&&a<=332&&o.current&&o.current.scrollIntoView({behavior:"smooth",block:"end"});const f=p=>{e(p.detail.code)};return s("onCodeScan",f),()=>{c("onCodeScan",f)}},[a]);const h=()=>{switch(+u){case 1:return v.jsx(c2,{onScan:d});case 2:return v.jsx(vT,{onScan:d});case 3:return v.jsx(yT,{onScan:d});case 4:return v.jsx(wT,{onScan:d});default:return v.jsx(c2,{onScan:d})}};return v.jsxs("div",{ref:o,children:[v.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[h(),v.jsx("hr",{})]}),v.jsx(Yo,{label:r,value:t,autoFocus:!0,placeholder:"CDE2341S",onChange:f=>{n&&n(!0),e(f.target.value)}})]})}function bT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=()=>{u(!0),h.get(`${n}/check-code/${o}`).then(p=>{if(p.data.identifier)return d(`identifier/${p.data.identifier.value}`);if(p.data.voucher)return d(`voucher/${p.data.voucher.code}`);if(p.data.giftcard)return d(`giftcard/${p.data.giftcard.hash}`);e(t("unknownCode",{code:o}))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{o&&!a&&f()},[o]),v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"code"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:f,children:v.jsx(aa,{data:o,dataSetter:i,setDefer:s,label:t("contactIdentifier")})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ze,{label:t("continue"),onClick:f,pending:c}),r.inputData.enable_email_identification&&v.jsx(Ze,{label:t("useEmail"),variant:"secondary",onClick:()=>d("email")})]})})]})})}function ET(){const{hash:t}=Yr();return v.jsx(dr,{to:`${Le.GIFTCARD}/select/${t}`})}function CT(){const{identifierValue:t}=Yr(),{errorToast:e}=Vt(),{uuid:n,mutate:r}=je(),{onContactLink:o}=Xt(),[i,a]=x.useState(!1),s=Dt(),c=d=>s.get(`${n}/contacts`,{contact_uuid:d}),u=()=>{s.put(n,{contact_identifier_value:t}).then(d=>{o&&c(d.data.data.contact.uuid).then(h=>{o==null||o(h.data.data)}),r().then(()=>a(!0))}).catch(e)};return x.useEffect(()=>{u()},[]),i?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):v.jsx(_r,{})}function K2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/vouchers/${t}`,onData:r});return{voucher:n,isLoading:o,pending:i,mutate:a}}function _T(){const{t}=Ue(),{code:e}=Yr(),{voucher:n}=K2(e),{portalSession:r}=je(),[o,i]=x.useState(!1),[a,s]=x.useState(!1),c=zt(),u=()=>{n!=null&&n.contact||r.contact?i(!0):s(!0)};return x.useEffect(()=>{n&&u()},[n]),n?v.jsxs(v.Fragment,{children:[o?v.jsx(dr,{to:`${Le.VOUCHER}/${n.code}/redeem`}):v.jsx(_r,{}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:a,onClose:()=>s(!1),primaryAction:{label:t("linkToContact"),action:()=>c(`${Le.VOUCHER}/${n.code}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>s(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:n.code})})})]}):v.jsx(_r,{})}function Su({redirectRoute:t}){const{state:e}=er(),{t:n}=Ue(),{errorToast:r}=Vt(),{onContactLink:o}=Xt(),{portalSession:i,mutate:a}=je(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt(),m=b=>g.get(`${i.uuid}/contacts`,{contact_uuid:b}),y=()=>{h(!0),g.put(i.uuid,{email:c}).then(b=>{o&&m(b.data.data.contact.uuid).then(E=>{o==null||o(E.data.data)}),a().then(()=>l(t))}).catch(b=>{b.response.data.code===Ws.CONTACT_NOT_FOUND&&p(!0)}).finally(()=>h(!1))},w=()=>{h(!0),g.post(`${i.uuid}/contacts`,{email:c}).then(y).catch(r).finally(()=>h(!1))};return x.useEffect(()=>{s("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n("fillInXBelow",{x:n("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>c&&!d&&y(),children:v.jsx(Yo,{id:"via-email-address-input",label:n("emailAddress"),autoFocus:!0,onChange:b=>u(b.target.value),beforeIcon:"mail"})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ze,{label:n("continue"),className:"w-full",onClick:y,disabled:!c,pending:d}),v.jsx(Ze,{label:n("useIdentifier"),variant:"secondary",onClick:()=>l("../identifier",{state:e})})]})})]})}),v.jsx(Eo,{title:`${n("new")} ${n("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:n("confirm"),action:w,disabled:d},secondaryAction:{label:n("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:n("continueWithEmail",{email:c})})})]})}function AT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/*",element:v.jsx(bT,{})}),v.jsx(Ye,{path:"/giftcard/:hash",element:v.jsx(ET,{})}),v.jsx(Ye,{path:"/identifier/:identifierValue",element:v.jsx(CT,{})}),v.jsx(Ye,{path:"/voucher/:code",element:v.jsx(_T,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.PORTAL})})]})}const ST={[Kt.GIFTCARD]:`${Le.GIFTCARD}/select`,[Kt.REDEEM_GIFTCARD]:`${Le.GIFTCARD}/redeem`,[Kt.TOP_UP_GIFTCARD]:`${Le.GIFTCARD}/top-up`};function IT(){const{t}=Ue(),{portalSession:e}=je(),{errorToast:n}=Vt(),[r,o]=x.useState(""),[i,a]=x.useState(!1),[s,c]=x.useState(!1),u=Dt(),d=zt(),h=()=>{a(!0),u.get(`${e.uuid}/giftcards/${r}`).then(f=>{const p=e.type;d(`${ST[p]}/${f.data.data.hash}`)}).catch(f=>{n(f),o("")}).finally(()=>a(!1))};return x.useEffect(()=>{!s&&r&&h()},[r]),v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanGiftcard")})})}),v.jsx(kt,{children:v.jsx(aa,{data:r,dataSetter:o,setDefer:c,label:t("hash")})}),v.jsx(rn,{children:v.jsx(Ze,{label:t("submit"),className:"w-full",onClick:h,disabled:!r,pending:i})})]})})}function TT(){const{t}=Ue(),{hash:e}=Yr(),n=zt();return v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("chooseType")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Ze,{className:"grow",label:t("redeem"),onClick:()=>n(`${Le.GIFTCARD}/redeem/${e}`)}),v.jsx(Ze,{className:"grow",label:t("topUp"),onClick:()=>n(`${Le.GIFTCARD}/top-up/${e}`)})]})})]})})}function z2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/giftcards/${t}`,onData:r});return{giftcard:n,isLoading:o,pending:i,mutate:a}}function ws(){const{mutate:t}=je();return{get:()=>t().then(r=>r.data.data.events),post:()=>{t().then(r=>{r3(r.data.data.events)})}}}function xT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{onUseGiftcard:s}=Xt(),{post:c}=ws(),[u]=x.useState(i.results.remaining_amount?+i.results.remaining_amount:+i.inputData.amount_in_cents),[d,h]=x.useState(!1),f=i.inputData.allow_multiple_giftcards??!0,p=zt(),l=Dt(),g=()=>{h(!0),l.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:-m()}).then(E=>{o(),a(),c(),s==null||s(E.data.data)}).catch(e).finally(()=>h(!1))},m=()=>Math.min(y(),r.amount_in_cents),y=()=>i.results.remaining_amount??i.inputData.amount_in_cents,w=()=>{let E=0;return i.events.filter(I=>I.type===yo.GIFTCARD_TRANSACTION).forEach(I=>{I.data.giftcard.uuid===r.uuid&&(E+=I.data.amount_in_cents)}),E},b=()=>{if(m())return{label:t("confirmAndPay",{amount:Si(m(),i.currency)}),onClick:g};if(f&&y())return{label:t("useAnotherGiftcard"),onClick:()=>p(Le.GIFTCARD),variant:"secondary"}};return r?v.jsx(Tn,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:`${t("giftcard")} ${r.hash}`})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("balance")}),v.jsx(bo,{value:r.amount_in_cents,start:r.amount_in_cents-w(),currency:i.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u+w(),start:u,currency:i.currency,asCurrency:!0})})]})})]})}),b()&&v.jsx(rn,{children:v.jsx(Ze,{label:"",className:"w-full",...b(),pending:d})})]})}):v.jsx(_r,{})}function OT({value:t,valueSetter:e,enabled:n}){const[r,o]=x.useState(!1),i=x.useRef(null),a=x.useRef(null);x.useEffect(()=>{u(t?t.toString():"")},[]);const s=d=>{e(d?parseInt(d):0),u(d)},c=d=>{const{key:h}=d;if(t===0&&!/^[1-9]$/.test(h)||t!==0&&!/^[0-9]$/.test(h)&&h!=="Backspace")return;let f;if(h!=="Backspace")f=parseInt(t===0?h:`${t}${h}`);else{const p=t.toString().slice(0,-1);f=p.length?parseInt(p,10):0}e(f),u(f?f.toString():"")},u=d=>{a&&a.current&&(d?a.current.style.width=`${Math.max(d.length,3)*3}rem`:a.current.style.width="calc(3rem + 14px)")};return v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:a,className:"h-full w-[65px] rounded border-gray-200 border-transparent text-5xl [appearance:textfield] focus:border-transparent focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",type:"number",pattern:"[0-9]*",inputMode:"numeric",placeholder:"0",autoFocus:!0,value:t?(t/100).toFixed(2):"",onKeyDown:c,onChange:()=>{},onFocus:()=>o(!0),onBlur:()=>o(!1)}),n&&v.jsx("div",{className:`mobile:hidden bottom-2 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!r&&"hidden"} absolute`,children:v.jsx(fp,{keyboardRef:i,layout:{default:["1 2 3","4 5 6","7 8 9","00 0 {bksp}"]},theme:"hg-theme-default hg-layout-numeric numeric-theme",onChange:s})})]})}function X2({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),[a,s]=x.useState(0),{portalSession:c}=je(),u=()=>{let d=0;return c.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d};return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e??0,start:e??0,currency:c.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsx("div",{className:"flex items-center justify-center gap-1 p-4 text-5xl font-bold",children:u()?v.jsx(bo,{value:0,start:a,currency:c.currency,asCurrency:!0}):v.jsxs("div",{className:"flex items-center justify-center gap-1 ",children:[v.jsx("p",{children:n3(c.currency)}),v.jsx(OT,{value:a,valueSetter:s,enabled:c.inputData.enable_on_screen_keyboard})]})})})]})}),v.jsx(rn,{children:v.jsx(Ze,{label:i("confirmAndPay",{amount:Si(a,c.currency)}),className:"w-full",onClick:r&&(()=>r(a)),disabled:!a||!!u(),pending:o})})]})}function PT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{post:s}=ws(),{onUseGiftcard:c}=Xt(),[u,d]=x.useState(!1),h=Dt(),f=p=>{d(!0),h.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:p}).then(l=>{o(),a(),s(),c==null||c(l.data.data),Ct.success(`${t("transactionSuccessful")}! ${t("totalUpgradedAmount")}: ${Si(l.data.data.amount_in_cents,i.currency)}`)}).catch(e).finally(()=>d(!1))};return r?v.jsx(Tn,{children:v.jsx(X2,{title:`${t("giftcard")} ${r.hash}`,balance:r.amount_in_cents,transaction:f,pending:u})}):v.jsx(_r,{})}function kT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(IT,{})}),v.jsx(Ye,{path:"/select/:hash",element:v.jsx(TT,{})}),v.jsx(Ye,{path:"/redeem/:hash",element:v.jsx(xT,{})}),v.jsx(Ye,{path:"/top-up/:hash",element:v.jsx(PT,{})})]})}class Df{constructor(){Qn(this,"uuid");Qn(this,"email");Qn(this,"credit_balance");Qn(this,"prepaid_balance");Qn(this,"current_display_values")}getDisplayName(){return this.current_display_values.firstname||this.current_display_values.lastname?`${this.current_display_values.firstname} ${this.current_display_values.lastname}`:this.current_display_values.email}}const Q2=x.createContext({contact:new Df,mutate:async()=>{}});function Mf({children:t}){const{uuid:e}=je(),[n,r]=x.useState(new Df),{mutate:o}=cr({url:`${e}/contacts`,onData:a=>{const s=new Df;s.uuid=a.uuid,s.email=a.email,s.credit_balance=a.credit_balance,s.prepaid_balance=a.prepaid_balance,s.current_display_values=a.current_display_values,r(s)}}),i=x.useMemo(()=>({contact:n,mutate:o}),[n,o]);return n.uuid?v.jsx(Q2.Provider,{value:i,children:t}):v.jsx(_r,{})}function ar(){const t=x.useContext(Q2);if(!t)throw new Error("Only use 'useContactContext' within a ContactProvider");return t}function Iu({message:t=""}){return v.jsxs("div",{className:"flex items-center justify-center gap-4 text-core-primary-500",children:[v.jsx(Sl,{className:"h-[32px] w-[32px]"}),t&&v.jsx("p",{className:"text-sm",children:t})]})}function BT(){const{t}=Ue(),{errorToast:e}=Vt(),{contact:n,mutate:r}=ar(),{uuid:o,portalSession:i,mutate:a}=je(),s=Dt(),c=()=>{s.post(`${o}/credit-receptions/create`,{unit_value:i.inputData.amount_in_cents/100}).then(()=>{r(),a()}).catch(e)},u=()=>{const d=i.events.filter(h=>h.type===yo.CREDIT_RECEPTION);return d.length?d[0]:null};return x.useEffect(()=>{u()||c()},[]),v.jsx(Tn,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n.getDisplayName()})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsx("div",{className:"flex h-full flex-col items-center gap-2 p-6",children:i.inputData.amount_in_cents?v.jsx("div",{className:"flex h-full items-center justify-center gap-1 text-4xl font-bold",children:u()?v.jsxs(v.Fragment,{children:["+",v.jsx(bo,{value:u().data.credits,start:0})]}):v.jsx(Iu,{})}):v.jsx("p",{className:"text-core-red-500",children:t("xIsRequired",{x:"Amount in cents"})+"."})}),v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:`${t("new")} ${t("balance").toLowerCase()}`}),v.jsx(bo,{value:n.credit_balance.balance??0,start:n.credit_balance.balance-(u()?u().data.credits:0)})]})})]})})]})})}function NT(){const{portalSession:t}=je();return t.contact?v.jsx(Mf,{children:v.jsx(BT,{})}):t.inputData.primary_identification_method&&t.inputData.primary_identification_method===Ci.EMAIL?v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/email`}):v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/identifier`})}function Lf({redirectRoute:t}){const{t:e}=Ue(),{state:n}=er(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=Xt(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt();x.useEffect(()=>{!d&&a&&l()},[a]);const l=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&g(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(t,{state:{contactIdentifier:a}}))}).catch(()=>f("link",{state:{contactIdentifier:a}})).finally(()=>u(!1))},g=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m});return v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>a&&l(),children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:e("contactIdentifier")})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ze,{label:e("continue"),onClick:l,disabled:!a,pending:c}),r.inputData.enable_email_identification&&v.jsx(Ze,{label:e("useEmail"),variant:"secondary",onClick:()=>f("../email",{state:n})})]})})]})})}function Ff({redirectRoute:t}){const{t:e}=Ue(),{errorToast:n}=Vt(),{uuid:r,mutate:o}=je(),{onContactLink:i}=Xt(),{state:a}=er(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt();if(!a||!a.contactIdentifier)return v.jsx(dr,{to:"../"});const m=()=>{h(!0),g.post(`${r}/contacts/link-identifier`,{contact_identifier_value:a.contactIdentifier,email:c}).then(w).catch(E=>{E.response.data.code===Ws.CONTACT_NOT_FOUND?p(!0):n(E)}).finally(()=>h(!1))},y=()=>{h(!0),g.post(`${r}/contacts`,{email:c}).then(m).catch(n).finally(()=>h(!1))},w=()=>{g.put(r,{email:c}).then(E=>{i&&b(E.data.data.contact.uuid).then(C=>{i==null||i(C.data.data)}),o().then(()=>l(t))}).catch(n).finally(()=>h(!1))},b=E=>g.get(`${r}/contacts`,{contact_uuid:E});return x.useEffect(()=>{s("openKeyboard",{inputId:"new-contact-identifier-input",inputValue:""})},[]),v.jsxs(Tn,{children:[v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:e("linkContact")})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Ob,{body:e("noEmailAddressLinkedToIdentifier")}),v.jsx(si,{onSubmit:m,children:v.jsx(Yo,{id:"new-contact-identifier-input",label:e("emailAddress"),autoFocus:!0,onChange:E=>u(E.target.value),beforeIcon:"mail"})})]})}),v.jsx(rn,{children:v.jsx(Ze,{label:e("continue"),className:"w-full",onClick:m,disabled:!c||d})})]}),v.jsx(Eo,{title:`${e("new")} ${e("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:e("confirm"),action:y,loading:d},secondaryAction:{label:e("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:e("continueWithEmail",{email:c})})})]})}function RT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(NT,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.POINTS_TRANSACTION})})]})}function DT(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=Xt();return t.contact?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PORTAL}/email`}):v.jsx(dr,{to:`${Le.PORTAL}/identifier`})}function MT({children:t}){return v.jsx("div",{className:"h-screen w-screen pb-[70px] md:px-4 md:pb-[86px] md:pt-4 lg:pb-4 lg:pt-[66px]",children:v.jsx("div",{className:"h-full max-h-full",children:t})})}function LT({contact:t}){const{t:e}=Ue(),n=zt();return v.jsxs("div",{className:"inline-grid w-full items-center gap-4 py-4 lg:grid-cols-2",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Ml,{src:t.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsx("p",{className:"text-lg",children:t.getDisplayName()}),t.current_display_values.tier&&v.jsx(Ll,{label:t.current_display_values.tier,size:"sm",stroke:!0})]}),v.jsx("p",{className:"text-sm text-core-gray-500 ",children:e("joinedAtDate",{date:new Date(t.current_display_values.created_at).toLocaleDateString(nn.language,{month:"long",year:"numeric"})})})]})]}),v.jsxs("div",{className:"inline-grid gap-2 lg:grid-cols-2",children:[v.jsx(Ze,{label:e("goToX",{x:"identifiers"}),variant:"secondary",size:"md",onClick:()=>n("contact-identifiers")}),v.jsx(Ze,{before:v.jsx(wn,{icon:"edit"}),label:e("editProfile"),variant:"secondary",size:"md",onClick:()=>n("contact-attributes")})]})]})}function bs({children:t}){return v.jsx("div",{className:"flex-grow rounded-lg border p-4",children:t})}function FT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex gap-2 lg:flex-col",children:[v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:e.current_display_values.loyalty_balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})}),v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:Si(e.prepaid_balance.balance_in_cents,n.currency)}),v.jsx("p",{className:"text-sm text-core-gray-500",children:t("prepaidCredit")})]})})]})}function jT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je(),r=(o,i)=>R1(o,i)?`${R1(o,i)} ${t("yearsAgo")}`:N1(o,i)?`${N1(o,i)} ${t("weeksAgo")}`:B1(o,i)?`${B1(o,i)} ${t("daysAgo")}`:t("today");return v.jsx(bs,{children:v.jsxs("div",{className:"h-full justify-between",children:[v.jsx("p",{className:"mb-4 text-lg font-semibold leading-7",children:t("stats")}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(wn,{icon:"calendar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:r(new Date,new Date(e.current_display_values.loyalty_last_transaction_date))}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("lastVisit")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(wn,{icon:"shopping-bag"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_number_of_transactions} ${t("visits")}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalVisits")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(wn,{icon:"dollar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_total_credits_received} ${n.loyaltyProgram.custom_credit_name}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalCredits")})]})]})]})]})})}function J2(){const{uuid:t}=je(),[e,n]=x.useState([]),{data:r,isLoading:o,pending:i,mutate:a}=cr({url:`${t}/loyalty-transactions`});return x.useEffect(()=>{r&&n(r.data)},[r]),{loyaltyTransactions:e,isLoading:o,pending:i,mutate:a}}function Z2({loyaltyTransaction:t}){const{t:e}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs text-core-gray-500",children:t.type===v1.CREDIT_RECEPTION?e("transaction"):`${e("isRedeemed")} '${t.loyalty_transaction_data.title}'`}),v.jsx("p",{className:"text-xs font-semibold",children:t.credits>0?"+"+t.credits:t.credits})]})}function VT(){const{t}=Ue(),e=zt(),{loyaltyTransactions:n}=J2();return n?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("activities")}),n&&n.length?v.jsx("div",{children:n.slice(0,5).map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))}):v.jsx("p",{className:"text-sm text-core-gray-500",children:t("noActivity")})]}),v.jsx(Ze,{label:`${t("all")} ${t("activities").toLowerCase()}`,variant:"secondary",onClick:()=>e("activity")})]})}):v.jsx(Iu,{})}function ey(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/subscriptions/contact`,onData:n});return{subscriptions:e,isLoading:r,pending:o,mutate:i}}function ty({subscription:t,onChange:e,editable:n=!1}){const{t:r}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs font-semibold",children:t.subscription_type.name}),n?v.jsx(md,{defaultChecked:t.is_subscribed,disabled:t.subscription_type.strategy===w1.FUNCTIONAL,onChange:e&&(()=>e(t.subscription_type.name))}):v.jsx(Ll,{label:r(t.status.toLowerCase()),size:"sm",color:t.is_subscribed?"primary":"gray"})]})}function UT(){const{t}=Ue(),{subscriptions:e}=ey(),n=zt();return e?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("subscriptions")}),v.jsx("div",{children:e.map(r=>v.jsx(ty,{subscription:r},r.subscription_type.uuid))})]}),v.jsx(Ze,{label:t("change"),before:v.jsx(wn,{icon:"edit"}),variant:"secondary",onClick:()=>n("subscriptions")})]})}):v.jsx(Iu,{})}function GT(){const{contact:t}=ar();return v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(LT,{contact:t})}),v.jsx(kt,{children:v.jsxs("div",{className:"grid grid-cols-1 gap-x-2 gap-y-2 lg:grid-cols-4",children:[v.jsx(FT,{}),v.jsx(jT,{}),v.jsx(VT,{}),v.jsx(UT,{})]})})]})}function Es({label:t,path:e}){const n=zt();return v.jsx("div",{className:"flex h-16 items-center text-base text-core-gray-900",children:v.jsx(Ze,{label:t,variant:"link-gray",before:v.jsx(wn,{icon:"caret-left",size:"md"}),onClick:()=>n(e)})})}function qT(){const{t}=Ue(),{loyaltyTransactions:e}=J2(),{contact:n}=ar();return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsx("p",{className:"text-sm font-medium",children:t("allActivities")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("checkOutAllActivitiesOfName",{name:n.getDisplayName()})}),v.jsx("div",{className:"overflow-auto",children:e==null?void 0:e.map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))})]})})]})})}function HT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{subscriptions:r,mutate:o}=ey(),[i,a]=x.useState({}),[s,c]=x.useState(!1),u=Dt();x.useEffect(()=>{if(r&&!Object.keys(i).length){const p=r.reduce((l,g)=>({...l,[g.subscription_type.name]:g.is_subscribed}),{});a(p)}},[r]);const d=p=>{Object.hasOwn(i,p)?a({...i,[p]:!i[p]}):a({...i,[p]:!0})},h=()=>{c(!0),u.put(`${n}/subscriptions`,{values:i}).then(()=>o()).catch(e).finally(()=>c(!1))},f=()=>r&&r.some(p=>i[p.subscription_type.name]!==p.is_subscribed);return r?v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("subscriptions")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("manageEmailPreferences")}),r.map(p=>v.jsx(ty,{subscription:p,onChange:d,editable:!0},p.subscription_type.uuid))]})})}),v.jsxs(rn,{children:[v.jsx(Ze,{label:t("saveChanges"),className:"w-full",onClick:h,pending:s,disabled:!f()||s}),v.jsx(Ze,{label:"Log preferences",onClick:()=>console.log(i)})]})]})}):v.jsx(Iu,{})}function $T(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r,mutate:o}=ar(),[i,a]=x.useState(),[s,c]=x.useState(!1),[u,d]=x.useState(),h=Dt();cr({url:`${n}/contact-attributes`,onData:g=>a(g.elements)});const f=g=>{d({...u,[g.target.name]:g.target.value})},p=(g,m)=>{d({...u,[g]:m})},l=async()=>{c(!0),h.put(`${n}/contact-attributes`,u).then(()=>{o(),d(void 0)}).catch(e).finally(()=>c(!1))};return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsxs("div",{className:"mb-4 flex flex-row items-center gap-4 border-b border-b-core-gray-200 px-1 pb-4",children:[v.jsx(Ml,{src:r.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{children:[v.jsx("div",{className:"flex flex-row items-center gap-2 ",children:v.jsxs("h1",{className:"text-lg text-core-gray-900",children:[r.current_display_values.firstname," ",r.current_display_values.lastname]})}),v.jsx("p",{className:"text-sm text-core-gray-500",children:r.current_display_values.email})]})]}),i?i.map(g=>{if(!(g.type==="media_upload"||g.type==="email"))return g.type==="select"?v.jsx(qb,{name:g.name,label:g.label,value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],onChange:m=>p(g.name,m),disabled:g.disabled,children:g.options.map(m=>v.jsx(jl,{label:m.label,value:m.value},m.value))},g.id):g.type==="multi_select"?v.jsx(jb,{name:g.name,value:u&&u[g.name]?u[g.name]:g.defaultValue,label:g.label,onChange:p,disabled:g.disabled,options:g.options},g.id):g.type==="birth_date"||g.type==="date_time"?v.jsx(pp,{id:g.id,name:g.name,label:g.label,type:g.type==="date_time"?"date_time":"date",value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],disabled:g.disabled,onChange:f},g.id):v.jsx(Yo,{disabled:g.disabled,label:g.label,name:g.name,value:u&&u[g.name]!=="undefined"?u[g.name]:r.current_display_values[g.name],onChange:f},g.id)}):v.jsx(Tc,{rows:10})]})}),v.jsx(rn,{children:v.jsx(Ze,{label:t("saveChanges"),className:"w-full",onClick:l,disabled:!u,pending:s})})]})})}function ny(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/contact-identifiers`,onData:n});return{contactIdentifiers:e,isLoading:r,pending:o,mutate:i}}function YT({identifier:t,onClear:e}){const{t:n}=Ue();return v.jsxs("div",{className:"flex items-center justify-between rounded-lg border text-xs",children:[v.jsxs("div",{className:"flex-col pl-4",children:[v.jsx("p",{className:"font-semibold",children:t.value}),v.jsx("p",{className:"text-core-gray-500",children:n("contactIdentifier")})]}),v.jsx("div",{className:"h-full border-l p-4 hover:cursor-pointer hover:bg-core-gray-50",onClick:()=>e&&e(t.value),children:v.jsx(wn,{className:"h-full",icon:"close"})})]})}function WT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contactIdentifiers:r,isLoading:o,mutate:i}=ny(),[a,s]=x.useState(""),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=l=>{s(l),u(!0)},p=async()=>{h.destroy(`${n}/contact-identifiers`,{value:a}).then(()=>i()).catch(e).finally(()=>u(!1))};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("contactIdentifiers")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("contactIdentifierDescription")})]}),o?v.jsx(Tc,{rows:10}):r==null?void 0:r.map(l=>v.jsx(YT,{identifier:l,onClear:f},l.value))]})})}),v.jsx(rn,{children:v.jsx(Ze,{label:t("addIdentifier"),className:"w-full",variant:"secondary",onClick:()=>d("create")})})]}),v.jsx(Eo,{title:t("confirmClearContactIdentifier"),isOpen:c,primaryAction:{label:t("confirm"),action:p},secondaryAction:{label:t("cancel"),action:()=>u(!1)},onClose:()=>u(!1),children:v.jsx("p",{children:t("clearContactIdentifier",{value:a})})})]})}function KT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r}=ar(),{mutate:o}=ny(),[i,a]=x.useState(""),[s,c]=x.useState(!1),[u,d]=x.useState(!1),h=zt(),f=Dt(),p=()=>{c(!0),f.post(`${n}/contacts/link-identifier`,{contact_identifier_value:i,email:r.email}).then(()=>{o(),h("../profile/contact-identifiers")}).catch(e).finally(()=>{a(""),c(!1)})};return x.useEffect(()=>{!u&&i&&p()},[i]),v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile/contact-identifiers"})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>i&&p(),children:v.jsx(aa,{data:i,dataSetter:a,setDefer:d,label:t("contactIdentifier")})})}),v.jsx(rn,{children:v.jsx(Ze,{label:t("addIdentifier"),className:"w-full",onClick:p,pending:s,disabled:!i})})]})})}function zT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/profile",element:v.jsx(GT,{})}),v.jsx(Ye,{path:"/profile/activity",element:v.jsx(qT,{})}),v.jsx(Ye,{path:"/profile/subscriptions",element:v.jsx(HT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers",element:v.jsx(WT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers/create",element:v.jsx(KT,{})}),v.jsx(Ye,{path:"/profile/contact-attributes",element:v.jsx($T,{})})]})}function XT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex h-16 items-center justify-between",children:[v.jsx("h1",{children:t("rewards")}),v.jsxs("div",{className:"flex flex-col items-center",children:[v.jsx("p",{children:e.credit_balance.balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})]})}function ry(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/rewards`,onData:n});return{rewards:e,isLoading:r,pending:o,mutate:i}}function jf({reward:t,selected:e,setSelected:n,disabled:r,readOnly:o}){const{portalSession:i}=je(),{contact:a}=ar();return v.jsxs("div",{className:`max-h-[48px] rounded-lg border ${r?"pointer-events-none opacity-40":!o&&"cursor-pointer"}`,children:[v.jsxs("div",{className:`flex items-center justify-between rounded-lg text-xs ${r?"px-2 pt-2":"p-2"}`,onClick:o?void 0:()=>(e==null?void 0:e.uuid)===t.uuid?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.media&&t.media.value?t.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:t.title??t.description})]}),v.jsxs("p",{className:"whitespace-nowrap text-core-primary-500",children:[t.required_credits," ",i.loyaltyProgram.custom_credit_name]})]}),t.required_credits-a.credit_balance.balance>0&&v.jsx(Vb,{value:a.credit_balance.balance,max:t.required_credits})]})}function QT({selected:t,setSelected:e}){const{t:n}=Ue(),{contact:r}=ar(),{rewards:o,isLoading:i}=ry(),a=o==null?void 0:o.filter(c=>c.required_credits<=r.credit_balance.balance),s=o==null?void 0:o.filter(c=>c.required_credits>r.credit_balance.balance);return v.jsx(v.Fragment,{children:i?v.jsx(Tc,{rows:1}):v.jsxs("div",{className:"flex flex-col gap-3 md:max-h-[528px]",children:[v.jsx("div",{className:"flex flex-col gap-1",children:(a==null?void 0:a.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("redeemableRewards")}),a.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e},c.uuid))]})}),v.jsx("div",{className:"flex flex-col gap-1",children:(s==null?void 0:s.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("saveABitMore")}),s.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e,disabled:!0},c.uuid))]})})]})})}function JT(){const{portalSession:t}=je(),{rewards:e}=ry(),n=()=>t.events.filter(r=>r.type===yo.REWARD_RECEPTION).map(r=>e.find(o=>o.uuid===r.data.reward.uuid)).filter(r=>r);return e?v.jsx("div",{children:v.jsx(y0,{children:n().map((r,o)=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-core-primary-100 bg-core-primary-50 p-2 text-xs",children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:r.media&&r.media.value?r.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-8 w-8 rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:r.title??r.description})]}),v.jsxs("p",{className:"text-core-primary-500",children:[r.required_credits," ",t.loyaltyProgram.custom_credit_name]})]},`${o}-${r.uuid}`))},n().length)}):v.jsx(v.Fragment,{})}function ZT(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{portalSession:r,mutate:o}=je(),{mutate:i}=ar(),{onClaimReward:a}=Xt(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),{post:p}=ws(),l=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const g=y=>{o().then(w=>{const E=w.data.data.events.filter(C=>C.type===yo.REWARD_RECEPTION&&C.data.reward.uuid===s.uuid).reduce((C,I)=>new Date(C.created_at)>new Date(I.created_at)?C:I);a==null||a(y,E.data.uuid)})},m=()=>{d(!0),l.post(`${r.uuid}/rewards/claim`,{uuid:s.uuid}).then(y=>{p(),i(),g(y.data.data),n(t("rewardClaimed",{name:y.data.data.title}))}).catch(e).finally(()=>{f(!1),c(void 0),d(!1)})};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(XT,{})}),v.jsx(kt,{children:v.jsx(QT,{selected:s,setSelected:c})}),v.jsx(rn,{children:v.jsx(JT,{})})]}),v.jsx(Eo,{title:t("confirmRewardRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:m,loading:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},onClose:()=>f(!1),children:v.jsx("div",{className:"flex flex-col gap-4",children:s&&v.jsx(jf,{reward:s,selected:s,setSelected:c,readOnly:!0})})})]})}function Vf(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/vouchers`,onData:n});return{vouchers:e,isLoading:r,pending:o,mutate:i}}function ex(){const{t}=Ue();return v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("vouchers")})})}function Uf({voucher:t,selected:e,setSelected:n}){const{t:r}=Ue();return v.jsxs("div",{className:`flex cursor-pointer items-center justify-between gap-4 rounded-lg ${t.status===Ea.REDEEMED?"border border-core-primary-100 bg-core-primary-50":"border bg-white"} p-2 text-xs`,onClick:()=>(e==null?void 0:e.code)===t.code?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.promotion.image?t.promotion.image.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsxs("div",{className:"overflow-hidden overflow-ellipsis ",children:[v.jsx("p",{className:"font-semibold",children:t.name}),t.status===Ea.REDEEMED?v.jsx("p",{className:"text-core-gray-500",children:r("redeemed")}):v.jsx("p",{className:"text-core-primary-500",children:t.expiration_date?`Valid until ${new Date(t.expiration_date).toLocaleDateString()}`:r("nonExpiring")})]})]}),v.jsx("p",{className:`text-core-${t.status===Ea.REDEEMED?"gray":"primary"}-500`,children:t.code})]})}function tx({selected:t,setSelected:e}){const{t:n}=Ue(),{vouchers:r,isLoading:o}=Vf();return v.jsx(v.Fragment,{children:o?v.jsx(Tc,{rows:1}):v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:r&&r.length?r.map(i=>v.jsx(Uf,{voucher:i,selected:t,setSelected:e},i.code)):v.jsx("p",{className:"text-center text-sm text-core-gray-500",children:n("vouchersEmptyState")})})})})}function nx(){const{t}=Ue(),{portalSession:e}=je(),{vouchers:n}=Vf(),r=()=>e.events.filter(o=>o.type===yo.VOUCHER_REDEEMED);return n?v.jsx("div",{children:v.jsx(y0,{children:r().map((o,i)=>v.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-core-primary-100 bg-core-primary-50 p-2",children:v.jsx("div",{className:"flex h-full flex-col justify-between text-xs",children:v.jsxs("div",{className:"overflow-hidden",children:[v.jsx("p",{className:"font-semibold",children:o.data.name}),v.jsxs("p",{className:"overflow-ellipsis text-core-gray-500",children:[o.data.code," - ",t("applied")]})]})})},`${i}-${o.data.uuid}`))},r().length)}):v.jsx(v.Fragment,{})}function rx(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{uuid:r}=je(),{onRedeemVoucher:o}=Xt(),{post:i}=ws(),{mutate:a}=Vf(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const l=()=>{d(!0),p.post(`${r}/vouchers/redeem`,{code:s.code}).then(m=>{i(),o&&o(m.data.data),n(t("voucherSuccessfullyRedeemed")),a()}).catch(e).finally(()=>{g(),d(!1)})},g=()=>{f(!1),c(void 0)};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(ex,{})}),v.jsx(kt,{children:v.jsx(tx,{selected:s,setSelected:c})}),v.jsx(rn,{children:v.jsx(nx,{})})]}),v.jsx(Eo,{title:t("confirmVoucherRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:l,loading:u},secondaryAction:{label:t("cancel"),action:g},onClose:g,children:v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{children:t("redeemTitle",{title:s==null?void 0:s.name})}),s&&v.jsx(Uf,{voucher:s,setSelected:c})]})})]})}function ox(){const{t}=Ue(),[e,n]=x.useState(1),r=zt(),o=[{id:0,label:t("profile"),icon:"user",pathname:"profile"},{id:1,label:t("rewards"),icon:"edit",pathname:"rewards"},{id:2,label:t("vouchers"),icon:"mail",pathname:"vouchers"}];return x.useEffect(()=>{r(o[e].pathname)},[]),v.jsx(Mf,{children:v.jsxs("div",{className:"relative h-full w-full select-none overflow-auto",children:[v.jsx(vE,{children:o.map(i=>v.jsx(wE,{id:i.id,label:i.label,icon:i.icon,activeTab:e,setActiveTab:n,pathname:i.pathname},i.id))}),v.jsxs(MT,{children:[v.jsx(zT,{}),v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/rewards",element:v.jsx(ZT,{})}),v.jsx(Ye,{path:"/vouchers",element:v.jsx(rx,{})})]})]})]})})}function ix(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(DT,{})}),v.jsx(Ye,{path:"/overview/*",element:v.jsx(ox,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PORTAL})})]})}function oy(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/prepaid`,onData:n});return{prepaidBalance:e,isLoading:r,pending:o,mutate:i}}function ax(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=Xt(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(Tn,{children:v.jsx(X2,{title:a.getDisplayName(),balance:(c==null?void 0:c.balance_in_cents)??0,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function sx({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),{portalSession:a}=je(),s=a.inputData.amount_in_cents??0,c=()=>{let d=0;return a.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d},u=()=>Math.min(s+c(),e);return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e,start:e+c(),currency:a.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"text-sm font-light text-gray-500",children:i("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u(),start:s,currency:a.currency,asCurrency:!0})})]})})]})}),v.jsx(rn,{children:v.jsx(Ze,{label:i("confirmAndPay",{amount:Si(u(),a.currency)}),className:"w-full",onClick:()=>r==null?void 0:r(-u()),disabled:!s||!!c(),pending:o})})]})}function cx(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=Xt(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(Tn,{children:v.jsx(sx,{title:a.getDisplayName(),balance:c.balance_in_cents,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function ux({setType:t}){const{t:e}=Ue();return v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("Choose type")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(Ze,{className:"grow",label:e("pay"),onClick:()=>t(Kt.PAY_PREPAID)}),v.jsx(Ze,{className:"grow",label:e("topUp"),onClick:()=>t(Kt.TOP_UP_PREPAID)})]})})]})})}function lx(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=Xt(),[n,r]=x.useState(t.type);if(!t.contact)return e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PREPAID}/email`}):v.jsx(dr,{to:`${Le.PREPAID}/identifier`});const o=()=>n===Kt.TOP_UP_PREPAID?v.jsx(ax,{}):n===Kt.PAY_PREPAID?v.jsx(cx,{}):v.jsx(ux,{setType:r});return v.jsx(Mf,{children:o()})}function dx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(lx,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PREPAID})})]})}function fx(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=()=>{s(!0),p.get(`${n}/vouchers/check/${o}`).then(g=>{g.data.data.contact||r.contact?f(`${o}/redeem`):h(!0)}).catch(e).finally(()=>s(!1))};return x.useEffect(()=>{!c&&o&&l()},[o]),v.jsxs(v.Fragment,{children:[v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:t("voucherCode").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(aa,{data:o,dataSetter:i,setDefer:u,label:t("code")})}),v.jsx(rn,{children:v.jsx(Ze,{label:t("submit"),className:"w-full",onClick:l,pending:a})})]})}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:d,onClose:()=>h(!1),primaryAction:{label:t("linkToContact"),action:()=>f(`${o}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>h(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:o})})})]})}function hx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{uuid:r}=je(),{onRedeemVoucher:o}=Xt(),{post:i}=ws(),{voucher:a,mutate:s}=K2(n),[c,u]=x.useState(!1),d=Dt(),h=()=>{u(!0),d.post(`${r}/vouchers/redeem`,{code:n}).then(f=>{o==null||o(f.data.data),i(),s()}).catch(e).finally(()=>u(!1))};return a?v.jsx(Tn,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:"Voucher"})})}),v.jsx(kt,{children:v.jsx("div",{children:v.jsx(Uf,{voucher:a,setSelected:()=>{}})})}),v.jsx(rn,{children:v.jsx(Ze,{label:t("redeemVoucher"),className:"w-full",onClick:h,disabled:a.status!==Ea.ACTIVE||c,pending:c})})]})}):v.jsx(_r,{})}function px(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=Xt(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m}),g=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&l(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(`${Le.VOUCHER}/${n}/redeem`))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{!d&&a&&g()},[a]),v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:g,children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:t("contactIdentifier")})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ze,{label:t("continue"),onClick:g,pending:c}),r.inputData.enable_email_identification&&v.jsx(Ze,{label:t("useEmail"),variant:"secondary",onClick:()=>f(`../${n}/email`)})]})})]})})}function gx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{onContactLink:r}=Xt(),{portalSession:o,mutate:i}=je(),{publish:a}=Oa(),[s,c]=x.useState(""),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=zt(),l=Dt(),g=w=>l.get(`${o.uuid}/contacts`,{contact_uuid:w}),m=()=>{d(!0),l.put(o.uuid,{email:s}).then(w=>{r&&g(w.data.data.contact.uuid).then(b=>{r==null||r(b.data.data)}),i().then(()=>p(`${Le.VOUCHER}/${n}/redeem`))}).catch(w=>{w.response.data.code===Ws.CONTACT_NOT_FOUND&&f(!0)}).finally(()=>d(!1))},y=()=>{d(!0),l.post(`${o.uuid}/contacts`,{email:s}).then(m).catch(e).finally(()=>d(!1))};return x.useEffect(()=>{a("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("fillInXBelow",{x:t("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>s&&!u&&m(),children:v.jsx(Yo,{id:"via-email-address-input",label:t("emailAddress"),autoFocus:!0,onChange:w=>c(w.target.value),beforeIcon:"mail"})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(Ze,{label:t("continue"),className:"w-full",onClick:m,pending:u,disabled:!s||u}),v.jsx(Ze,{label:t("useIdentifier"),variant:"secondary",onClick:()=>p(`../${n}/identifier`)})]})})]})}),v.jsx(Eo,{title:`${t("new")} ${t("emailAddress").toLowerCase()}`,isOpen:h,onClose:()=>f(!1),primaryAction:{label:t("confirm"),action:y,disabled:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},children:v.jsx("p",{children:t("continueWithEmail",{email:s})})})]})}function mx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(fx,{})}),v.jsx(Ye,{path:":code/redeem",element:v.jsx(hx,{})}),v.jsx(Ye,{path:":code/email",element:v.jsx(gx,{})}),v.jsx(Ye,{path:":code/identifier",element:v.jsx(px,{})})]})}function yx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx($A,{})}),v.jsx(Ye,{path:`${Le.GENERIC}/*`,element:v.jsx(AT,{})}),v.jsx(Ye,{path:`${Le.GIFTCARD}/*`,element:v.jsx(kT,{})}),v.jsx(Ye,{path:`${Le.POINTS_TRANSACTION}/*`,element:v.jsx(RT,{})}),v.jsx(Ye,{path:`${Le.PORTAL}/*`,element:v.jsx(ix,{})}),v.jsx(Ye,{path:`${Le.PREPAID}/*`,element:v.jsx(dx,{})}),v.jsx(Ye,{path:`${Le.VOUCHER}/*`,element:v.jsx(mx,{})})]})}function Gf(t){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(t)}function iy(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Gf(XMLHttpRequest))==="object"}function vx(t){return!!t&&typeof t.then=="function"}function wx(t){return vx(t)?t:Promise.resolve(t)}function bx(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qf={exports:{}},Tu={exports:{}},ay;function Ex(){return ay||(ay=1,function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wi<"u"&&wi,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s=typeof i<"u"&&i||typeof self<"u"&&self||typeof s<"u"&&s,c={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(k){return k&&d.indexOf(Object.prototype.toString.call(k))>-1};function f(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function p(k){return typeof k!="string"&&(k=String(k)),k}function l(k){var U={next:function(){var z=k.shift();return{done:z===void 0,value:z}}};return c.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(k){this.map={},k instanceof g?k.forEach(function(U,z){this.append(z,U)},this):Array.isArray(k)?k.forEach(function(U){this.append(U[0],U[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(U){this.append(U,k[U])},this)}g.prototype.append=function(k,U){k=f(k),U=p(U);var z=this.map[k];this.map[k]=z?z+", "+U:U},g.prototype.delete=function(k){delete this.map[f(k)]},g.prototype.get=function(k){return k=f(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(f(k))},g.prototype.set=function(k,U){this.map[f(k)]=p(U)},g.prototype.forEach=function(k,U){for(var z in this.map)this.map.hasOwnProperty(z)&&k.call(U,this.map[z],z,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(U,z){k.push(z)}),l(k)},g.prototype.values=function(){var k=[];return this.forEach(function(U){k.push(U)}),l(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(U,z){k.push([z,U])}),l(k)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function m(k){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}function y(k){return new Promise(function(U,z){k.onload=function(){U(k.result)},k.onerror=function(){z(k.error)}})}function w(k){var U=new FileReader,z=y(U);return U.readAsArrayBuffer(k),z}function b(k){var U=new FileReader,z=y(U);return U.readAsText(k),z}function E(k){for(var U=new Uint8Array(k),z=new Array(U.length),te=0;te<U.length;te++)z[te]=String.fromCharCode(U[te]);return z.join("")}function C(k){if(k.slice)return k.slice(0);var U=new Uint8Array(k.byteLength);return U.set(new Uint8Array(k)),U.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&u(k)?(this._bodyArrayBuffer=C(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||h(k))?this._bodyArrayBuffer=C(k):this._bodyText=k=Object.prototype.toString.call(k):this._bodyText="",this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=m(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(w)}),this.text=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(L)}),this.json=function(){return this.text().then(JSON.parse)},this}var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(k){var U=k.toUpperCase();return T.indexOf(U)>-1?U:k}function N(k,U){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var z=U.body;if(k instanceof N){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,U.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!z&&k._bodyInit!=null&&(z=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=P(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&z)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(z),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var te=/([?&])_=[^&]*/;if(te.test(this.url))this.url=this.url.replace(te,"$1_="+new Date().getTime());else{var oe=/\?/;this.url+=(oe.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function L(k){var U=new FormData;return k.trim().split("&").forEach(function(z){if(z){var te=z.split("="),oe=te.shift().replace(/\+/g," "),ne=te.join("=").replace(/\+/g," ");U.append(decodeURIComponent(oe),decodeURIComponent(ne))}}),U}function V(k){var U=new g,z=k.replace(/\r?\n[\t ]+/g," ");return z.split("\r").map(function(te){return te.indexOf(`
153
+ `,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~",""],f=0;f<h.length;f++)t[3][pn.getCharCode(h[f])]=f;var p=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(f=0;f<p.length;f++)pn.getCharCode(p[f])>0&&(t[4][pn.getCharCode(p[f])]=f)}(or.createInt32Array(5,256));var iT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),aT=function(t){function e(n){var r=t.call(this,n.width,n.height)||this;return r.canvas=n,r.buffer=e.makeBufferFromCanvasImageData(n),r}return iT(e,t),e.makeBufferFromCanvasImageData=function(n){var r=n.getContext("2d");if(!r)throw new Error("Couldn't get canvas context.");var o=r.getImageData(0,0,n.width,n.height);return e.toGrayscaleBuffer(o.data,n.width,n.height)},e.toGrayscaleBuffer=function(n,r,o){for(var i=new Uint8ClampedArray(r*o),a=0,s=0,c=n.length;a<c;a+=4,s++){var u=void 0;n[a+3]===0?u=255:u=306*n[a]+601*n[a+1]+117*n[a+2]+512>>10,i[s]=u}return i},e.prototype.getRow=function(n,r){if(n<0||n>=this.getHeight())throw new Ve("Requested row is outside the image: "+n);var o=this.getWidth(),i=n*o;return r===null?r=this.buffer.slice(i,i+o):(r.length<o&&(r=new Uint8ClampedArray(o)),r.set(this.buffer.slice(i,i+o))),r},e.prototype.getMatrix=function(){return this.buffer},e.prototype.isCropSupported=function(){return!0},e.prototype.crop=function(n,r,o,i){return t.prototype.crop.call(this,n,r,o,i),this},e.prototype.isRotateSupported=function(){return!0},e.prototype.rotateCounterClockwise=function(){return this.rotate(-90),this},e.prototype.rotateCounterClockwise45=function(){return this.rotate(-45),this},e.prototype.invert=function(){return new cu(this)},e.prototype.getTempCanvasElement=function(){if(this.tempCanvasElement===null){var n=this.canvas.ownerDocument.createElement("canvas");n.width=this.canvas.width,n.height=this.canvas.height,this.tempCanvasElement=n}return this.tempCanvasElement},e.prototype.rotate=function(n){var r=this.getTempCanvasElement();if(!r)throw new Error("Could not create a Canvas element.");var o=n*e.DEGREE_TO_RADIANS,i=this.canvas.width,a=this.canvas.height,s=Math.ceil(Math.abs(Math.cos(o))*i+Math.abs(Math.sin(o))*a),c=Math.ceil(Math.abs(Math.sin(o))*i+Math.abs(Math.cos(o))*a);r.width=s,r.height=c;var u=r.getContext("2d");if(!u)throw new Error("Could not create a Convas Context element.");return u.translate(s/2,c/2),u.rotate(o),u.drawImage(this.canvas,i/-2,a/-2),this.buffer=e.makeBufferFromCanvasImageData(r),this},e.DEGREE_TO_RADIANS=Math.PI/180,e}(fs);function Y2(){return typeof navigator<"u"}function sT(){return!!(Y2()&&navigator.mediaDevices&&navigator.mediaDevices.enumerateDevices)}var oa=function(){return oa=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},oa.apply(this,arguments)},$t=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(u){try{c(r.next(u))}catch(d){i(d)}}function s(u){try{c(r.throw(u))}catch(d){i(d)}}function c(u){var d;u.done?o(u.value):(d=u.value,d instanceof n?d:new n(function(h){h(d)})).then(a,s)}c((r=r.apply(t,[])).next())})},Yt=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function s(c){return function(u){return function(d){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&d[0]?r.return:d[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,d[1])).done)return o;switch(r=0,o&&(d=[2&d[0],o.value]),d[0]){case 0:case 1:o=d;break;case 4:return a.label++,{value:d[1],done:!1};case 5:a.label++,r=d[1],d=[0];continue;case 7:d=a.ops.pop(),a.trys.pop();continue;default:if(o=a.trys,!((o=o.length>0&&o[o.length-1])||d[0]!==6&&d[0]!==2)){a=0;continue}if(d[0]===3&&(!o||d[1]>o[0]&&d[1]<o[3])){a.label=d[1];break}if(d[0]===6&&a.label<o[1]){a.label=o[1],o=d;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(d);break}o[2]&&a.ops.pop(),a.trys.pop();continue}d=e.call(t,a)}catch(h){d=[6,h],r=0}finally{n=o=0}if(5&d[0])throw d[1];return{value:d[0]?d[1]:void 0,done:!0}}([c,u])}}},_u=function(t){var e=typeof Symbol=="function"&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},cT={delayBetweenScanAttempts:500,delayBetweenScanSuccess:500,tryPlayVideoTimeout:5e3},ia=function(){function t(e,n,r){n===void 0&&(n=new Map),r===void 0&&(r={}),this.reader=e,this.hints=n,this.options=oa(oa({},cT),r)}return Object.defineProperty(t.prototype,"possibleFormats",{set:function(e){this.hints.set(Pt.POSSIBLE_FORMATS,e)},enumerable:!1,configurable:!0}),t.addVideoSource=function(e,n){try{e.srcObject=n}catch{e.src=URL.createObjectURL(n)}},t.mediaStreamSetTorch=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,e.applyConstraints({advanced:[{fillLightMode:n?"flash":"off",torch:!!n}]})];case 1:return r.sent(),[2]}})})},t.mediaStreamIsTorchCompatible=function(e){var n,r,o=e.getVideoTracks();try{for(var i=_u(o),a=i.next();!a.done;a=i.next()){var s=a.value;if(t.mediaStreamIsTorchCompatibleTrack(s))return!0}}catch(c){n={error:c}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},t.mediaStreamIsTorchCompatibleTrack=function(e){try{return"torch"in e.getCapabilities()}catch(n){return console.error(n),console.warn("Your browser may be not fully compatible with WebRTC and/or ImageCapture specs. Torch will not be available."),!1}},t.isVideoPlaying=function(e){return e.currentTime>0&&!e.paused&&e.readyState>2},t.getMediaElement=function(e,n){var r=document.getElementById(e);if(!r)throw new Ht("element with id '"+e+"' not found");if(r.nodeName.toLowerCase()!==n.toLowerCase())throw new Ht("element with id '"+e+"' must be an "+n+" element");return r},t.createVideoElement=function(e){if(e instanceof HTMLVideoElement)return e;if(typeof e=="string")return t.getMediaElement(e,"video");if(!e&&typeof document<"u"){var n=document.createElement("video");return n.width=200,n.height=200,n}throw new Error("Couldn't get videoElement from videoSource!")},t.prepareImageElement=function(e){if(e instanceof HTMLImageElement)return e;if(typeof e=="string")return t.getMediaElement(e,"img");if(e===void 0){var n=document.createElement("img");return n.width=200,n.height=200,n}throw new Error("Couldn't get imageElement from imageSource!")},t.prepareVideoElement=function(e){var n=t.createVideoElement(e);return n.setAttribute("autoplay","true"),n.setAttribute("muted","true"),n.setAttribute("playsinline","true"),n},t.isImageLoaded=function(e){return!!e.complete&&e.naturalWidth!==0},t.createBinaryBitmapFromCanvas=function(e){var n=new aT(e),r=new d2(n);return new u2(r)},t.drawImageOnCanvas=function(e,n){e.drawImage(n,0,0)},t.getMediaElementDimensions=function(e){if(e instanceof HTMLVideoElement)return{height:e.videoHeight,width:e.videoWidth};if(e instanceof HTMLImageElement)return{height:e.naturalHeight||e.height,width:e.naturalWidth||e.width};throw new Error("Couldn't find the Source's dimentions!")},t.createCaptureCanvas=function(e){if(!e)throw new Ht("Cannot create a capture canvas without a media element.");if(typeof document>"u")throw new Error(`The page "Document" is undefined, make sure you're running in a browser.`);var n=document.createElement("canvas"),r=t.getMediaElementDimensions(e),o=r.width,i=r.height;return n.style.width=o+"px",n.style.height=i+"px",n.width=o,n.height=i,n},t.tryPlayVideo=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(e!=null&&e.ended)return console.error("Trying to play video that has ended."),[2,!1];if(t.isVideoPlaying(e))return console.warn("Trying to play video that is already playing."),[2,!0];r.label=1;case 1:return r.trys.push([1,3,,4]),[4,e.play()];case 2:return r.sent(),[2,!0];case 3:return n=r.sent(),console.warn("It was not possible to play the video.",n),[2,!1];case 4:return[2]}})})},t.createCanvasFromMediaElement=function(e){var n=t.createCaptureCanvas(e),r=n.getContext("2d");if(!r)throw new Error("Couldn't find Canvas 2D Context.");return t.drawImageOnCanvas(r,e),n},t.createBinaryBitmapFromMediaElem=function(e){var n=t.createCanvasFromMediaElement(e);return t.createBinaryBitmapFromCanvas(n)},t.destroyImageElement=function(e){e.src="",e.removeAttribute("src"),e=void 0},t.listVideoInputDevices=function(){return $t(this,void 0,void 0,function(){var e,n,r,o,i,a,s,c,u,d,h,f;return Yt(this,function(p){switch(p.label){case 0:if(!Y2())throw new Error("Can't enumerate devices, navigator is not present.");if(!sT())throw new Error("Can't enumerate devices, method not supported.");return[4,navigator.mediaDevices.enumerateDevices()];case 1:e=p.sent(),n=[];try{for(r=_u(e),o=r.next();!o.done;o=r.next())i=o.value,(a=i.kind==="video"?"videoinput":i.kind)==="videoinput"&&(s=i.deviceId||i.id,c=i.label||"Video device "+(n.length+1),u=i.groupId,d={deviceId:s,label:c,kind:a,groupId:u},n.push(d))}catch(l){h={error:l}}finally{try{o&&!o.done&&(f=r.return)&&f.call(r)}finally{if(h)throw h.error}}return[2,n]}})})},t.findDeviceById=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:return[4,t.listVideoInputDevices()];case 1:return(n=r.sent())?[2,n.find(function(o){return o.deviceId===e})]:[2]}})})},t.cleanVideoSource=function(e){if(e){try{e.srcObject=null}catch{e.src=""}e&&e.removeAttribute("src")}},t.playVideoOnLoadAsync=function(e,n){return $t(this,void 0,void 0,function(){return Yt(this,function(r){switch(r.label){case 0:return[4,t.tryPlayVideo(e)];case 1:return r.sent()?[2,!0]:[2,new Promise(function(o,i){var a=setTimeout(function(){t.isVideoPlaying(e)||(i(!1),e.removeEventListener("canplay",s))},n),s=function(){t.tryPlayVideo(e).then(function(c){clearTimeout(a),e.removeEventListener("canplay",s),o(c)})};e.addEventListener("canplay",s)})]}})})},t.attachStreamToVideo=function(e,n,r){return r===void 0&&(r=5e3),$t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return o=t.prepareVideoElement(n),t.addVideoSource(o,e),[4,t.playVideoOnLoadAsync(o,r)];case 1:return i.sent(),[2,o]}})})},t._waitImageLoad=function(e){return new Promise(function(n,r){var o=setTimeout(function(){t.isImageLoaded(e)||(e.removeEventListener("load",i),r())},1e4),i=function(){clearTimeout(o),e.removeEventListener("load",i),n()};e.addEventListener("load",i)})},t.checkCallbackFnOrThrow=function(e){if(!e)throw new Ht("`callbackFn` is a required parameter, you cannot capture results without it.")},t.disposeMediaStream=function(e){e.getVideoTracks().forEach(function(n){return n.stop()}),e=void 0},t.prototype.decode=function(e){var n=t.createCanvasFromMediaElement(e);return this.decodeFromCanvas(n)},t.prototype.decodeBitmap=function(e){return this.reader.decode(e,this.hints)},t.prototype.decodeFromCanvas=function(e){var n=t.createBinaryBitmapFromCanvas(e);return this.decodeBitmap(n)},t.prototype.decodeFromImageElement=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An image element must be provided.");return n=t.prepareImageElement(e),[4,this._decodeOnLoadImage(n)];case 1:return[2,r.sent()]}})})},t.prototype.decodeFromImageUrl=function(e){return $t(this,void 0,void 0,function(){var n;return Yt(this,function(r){switch(r.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareImageElement()).src=e,r.label=1;case 1:return r.trys.push([1,,3,4]),[4,this.decodeFromImageElement(n)];case 2:return[2,r.sent()];case 3:return t.destroyImageElement(n),[7];case 4:return[2]}})})},t.prototype.decodeFromConstraints=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i;return Yt(this,function(a){switch(a.label){case 0:return t.checkCallbackFnOrThrow(r),[4,navigator.mediaDevices.getUserMedia(e)];case 1:o=a.sent(),a.label=2;case 2:return a.trys.push([2,4,,5]),[4,this.decodeFromStream(o,n,r)];case 3:return[2,a.sent()];case 4:throw i=a.sent(),t.disposeMediaStream(o),i;case 5:return[2]}})})},t.prototype.decodeFromStream=function(e,n,r){return $t(this,void 0,void 0,function(){var o,i,a,s,c,u,d,h,f,p,l=this;return Yt(this,function(g){switch(g.label){case 0:return t.checkCallbackFnOrThrow(r),o=this.options.tryPlayVideoTimeout,[4,t.attachStreamToVideo(e,n,o)];case 1:return i=g.sent(),a=function(){var m,y;try{for(var w=_u(e.getVideoTracks()),b=w.next();!b.done;b=w.next())b.value.stop()}catch(E){m={error:E}}finally{try{b&&!b.done&&(y=w.return)&&y.call(w)}finally{if(m)throw m.error}}e=void 0},s=function(){a(),t.cleanVideoSource(i)},c=this.scan(i,r,s),u=e.getVideoTracks(),d=oa(oa({},c),{stop:function(){c.stop()},streamVideoConstraintsApply:function(m,y){return $t(this,void 0,void 0,function(){var w,b,E,C,I,T;return Yt(this,function(P){switch(P.label){case 0:w=y?u.filter(y):u,P.label=1;case 1:P.trys.push([1,6,7,8]),b=_u(w),E=b.next(),P.label=2;case 2:return E.done?[3,5]:[4,E.value.applyConstraints(m)];case 3:P.sent(),P.label=4;case 4:return E=b.next(),[3,2];case 5:return[3,8];case 6:return C=P.sent(),I={error:C},[3,8];case 7:try{E&&!E.done&&(T=b.return)&&T.call(b)}finally{if(I)throw I.error}return[7];case 8:return[2]}})})},streamVideoConstraintsGet:function(m){return u.find(m).getConstraints()},streamVideoSettingsGet:function(m){return u.find(m).getSettings()},streamVideoCapabilitiesGet:function(m){return u.find(m).getCapabilities()}}),t.mediaStreamIsTorchCompatible(e)&&(h=u==null?void 0:u.find(function(m){return t.mediaStreamIsTorchCompatibleTrack(m)}),f=function(m){return $t(l,void 0,void 0,function(){return Yt(this,function(y){switch(y.label){case 0:return[4,t.mediaStreamSetTorch(h,m)];case 1:return y.sent(),[2]}})})},d.switchTorch=f,p=function(){c.stop(),f(!1)},d.stop=p),[2,d]}})})},t.prototype.decodeFromVideoDevice=function(e,n,r){return $t(this,void 0,void 0,function(){var o;return Yt(this,function(i){switch(i.label){case 0:return t.checkCallbackFnOrThrow(r),o={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeFromConstraints(o,n,r)];case 1:return[2,i.sent()]}})})},t.prototype.decodeFromVideoElement=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("A video element must be provided.");return r=t.prepareVideoElement(e),o=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,o)];case 1:return i.sent(),[2,this.scan(r,n)]}})})},t.prototype.decodeFromVideoUrl=function(e,n){return $t(this,void 0,void 0,function(){var r,o,i;return Yt(this,function(a){switch(a.label){case 0:if(t.checkCallbackFnOrThrow(n),!e)throw new Ht("An URL must be provided.");return(r=t.prepareVideoElement()).src=e,o=function(){t.cleanVideoSource(r)},i=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(r,i)];case 1:return a.sent(),[2,this.scan(r,n,o)]}})})},t.prototype.decodeOnceFromConstraints=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return[4,navigator.mediaDevices.getUserMedia(e)];case 1:return r=o.sent(),[4,this.decodeOnceFromStream(r,n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromStream=function(e,n){return $t(this,void 0,void 0,function(){var r,o;return Yt(this,function(i){switch(i.label){case 0:return r=!!n,[4,t.attachStreamToVideo(e,n)];case 1:o=i.sent(),i.label=2;case 2:return i.trys.push([2,,4,5]),[4,this.scanOneResult(o)];case 3:return[2,i.sent()];case 4:return r||t.cleanVideoSource(o),[7];case 5:return[2]}})})},t.prototype.decodeOnceFromVideoDevice=function(e,n){return $t(this,void 0,void 0,function(){var r;return Yt(this,function(o){switch(o.label){case 0:return r={video:e?{deviceId:{exact:e}}:{facingMode:"environment"}},[4,this.decodeOnceFromConstraints(r,n)];case 1:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoElement=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("A video element must be provided.");return n=t.prepareVideoElement(e),r=this.options.tryPlayVideoTimeout,[4,t.playVideoOnLoadAsync(n,r)];case 1:return o.sent(),[4,this.scanOneResult(n)];case 2:return[2,o.sent()]}})})},t.prototype.decodeOnceFromVideoUrl=function(e){return $t(this,void 0,void 0,function(){var n,r;return Yt(this,function(o){switch(o.label){case 0:if(!e)throw new Ht("An URL must be provided.");(n=t.prepareVideoElement()).src=e,r=this.decodeOnceFromVideoElement(n),o.label=1;case 1:return o.trys.push([1,,3,4]),[4,r];case 2:return[2,o.sent()];case 3:return t.cleanVideoSource(n),[7];case 4:return[2]}})})},t.prototype.scanOneResult=function(e,n,r,o){var i=this;return n===void 0&&(n=!0),r===void 0&&(r=!0),o===void 0&&(o=!0),new Promise(function(a,s){i.scan(e,function(c,u,d){if(c)return a(c),void d.stop();if(u){if(u instanceof he&&n||u instanceof sn&&r||u instanceof Se&&o)return;d.stop(),s(u)}})})},t.prototype.scan=function(e,n,r){var o=this;t.checkCallbackFnOrThrow(n);var i=t.createCaptureCanvas(e),a=i.getContext("2d");if(!a)throw new Error("Couldn't create canvas for visual element scan.");var s,c=function(){a=void 0,i=void 0},u=!1,d={stop:function(){u=!0,clearTimeout(s),c(),r&&r()}},h=function(){if(!u)try{t.drawImageOnCanvas(a,e);var f=o.decodeFromCanvas(i);n(f,void 0,d),s=setTimeout(h,o.options.delayBetweenScanSuccess)}catch(p){if(n(void 0,p,d),p instanceof sn||p instanceof Se||p instanceof he)return void(s=setTimeout(h,o.options.delayBetweenScanAttempts));c(),r&&r(p)}};return h(),d},t.prototype._decodeOnLoadImage=function(e){return $t(this,void 0,void 0,function(){return Yt(this,function(n){switch(n.label){case 0:return t.isImageLoaded(e)?[3,2]:[4,t._waitImageLoad(e)];case 1:n.sent(),n.label=2;case 2:return[2,this.decode(e)]}})})},t}(),uT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new fu,n,r)||this}uT(e,t)})(ia);var lT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new na(n),n,r)||this}lT(e,t)})(ia);var dT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new vu,n,r)||this}dT(e,t)})(ia);var fT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){var o=this,i=new q2;return i.setHints(n),(o=t.call(this,i,n,r)||this).reader=i,o}fT(e,t),Object.defineProperty(e.prototype,"possibleFormats",{set:function(n){this.hints.set(Pt.POSSIBLE_FORMATS,n),this.reader.setHints(this.hints)},enumerable:!1,configurable:!0}),e.prototype.decodeBitmap=function(n){return this.reader.decodeWithState(n)},e.prototype.setHints=function(n){this.hints=n,this.reader.setHints(this.hints)}})(ia);var hT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();(function(t){function e(n,r){return t.call(this,new Cu,n,r)||this}hT(e,t)})(ia);var pT=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)o.hasOwnProperty(i)&&(r[i]=o[i])},t(e,n)};return function(e,n){function r(){this.constructor=e}t(e,n),e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),gT=function(t){function e(n,r){return t.call(this,new Eu,n,r)||this}return pT(e,t),e}(ia),Au=function(t,e,n){var r=typeof t===n;return r||console.warn('[ReactQrReader]: Expected "'.concat(e,'" to be a of type "').concat(n,'".')),r},mT=function(t){var e=t.scanDelay,n=t.constraints,r=t.onResult,o=t.videoId,i=x.useRef(null);x.useEffect(function(){var a=new gT(null,{delayBetweenScanAttempts:e});return!function(){var s=typeof navigator<"u"&&!!navigator.mediaDevices;return s||console.warn('[ReactQrReader]: MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),s}()&&Au(r,"onResult","function")&&r(null,new Error('MediaDevices API has no support for your browser. You can fix this by running "npm i webrtc-adapter"'),a),Au(n,"constraints","object")&&a.decodeFromConstraints({video:n},o,function(s,c){Au(r,"onResult","function")&&r(s,c,a)}).then(function(s){return i.current=s}).catch(function(s){Au(r,"onResult","function")&&r(null,s,a)}),function(){var s;(s=i.current)===null||s===void 0||s.stop()}},[])},pi=function(){return pi=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},pi.apply(this,arguments)},W2={container:{width:"100%",paddingTop:"100%",overflow:"hidden",position:"relative"},video:{top:0,left:0,width:"100%",height:"100%",display:"block",overflow:"hidden",position:"absolute",transform:void 0}},Rf=function(t){var e=t.videoContainerStyle,n=t.containerStyle,r=t.videoStyle,o=t.constraints,i=t.ViewFinder,a=t.scanDelay,s=t.className,c=t.onResult,u=t.videoId;return mT({constraints:o,scanDelay:a,onResult:c,videoId:u}),ce.createElement("section",{className:s,style:n},ce.createElement("div",{style:pi(pi({},W2.container),e)},!!i&&ce.createElement(i,null),ce.createElement("video",{muted:!0,id:u,style:pi(pi(pi({},W2.video),r),{transform:(o==null?void 0:o.facingMode)==="user"&&"scaleX(-1)"})})))};Rf.displayName="QrReader",Rf.defaultProps={constraints:{facingMode:"user"},videoId:"video",scanDelay:500};function yT({onScan:t}){const{cameraFacingMode:e}=Xt(),[n,r]=x.useState(e??vn.USER);return v.jsxs("div",{className:"relative w-full",children:[v.jsx(Rf,{onResult:o=>{o&&t(o.getText())},constraints:{facingMode:n},videoStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem",objectFit:"cover"},videoContainerStyle:{maxHeight:"calc(100vh-381px)",minHeight:267,borderRadius:"0.25rem"}}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>n===vn.USER?r(vn.ENVIRONMENT):r(vn.USER),children:v.jsx("img",{src:iu,alt:"camera-switch"})})]})}class Xe{constructor(e,n,r,o,i){this._legacyCanvasSize=Xe.DEFAULT_CANVAS_SIZE,this._preferredCamera="environment",this._maxScansPerSecond=25,this._lastScanTimestamp=-1,this._destroyed=this._flashOn=this._paused=this._active=!1,this.$video=e,this.$canvas=document.createElement("canvas"),r&&typeof r=="object"?this._onDecode=n:(console.warn(r||o||i?"You're using a deprecated version of the QrScanner constructor which will be removed in the future":"Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),this._legacyOnDecode=n),n=typeof r=="object"?r:{},this._onDecodeError=n.onDecodeError||(typeof r=="function"?r:this._onDecodeError),this._calculateScanRegion=n.calculateScanRegion||(typeof o=="function"?o:this._calculateScanRegion),this._preferredCamera=n.preferredCamera||i||this._preferredCamera,this._legacyCanvasSize=typeof r=="number"?r:typeof o=="number"?o:this._legacyCanvasSize,this._maxScansPerSecond=n.maxScansPerSecond||this._maxScansPerSecond,this._onPlay=this._onPlay.bind(this),this._onLoadedMetaData=this._onLoadedMetaData.bind(this),this._onVisibilityChange=this._onVisibilityChange.bind(this),this._updateOverlay=this._updateOverlay.bind(this),e.disablePictureInPicture=!0,e.playsInline=!0,e.muted=!0;let a=!1;if(e.hidden&&(e.hidden=!1,a=!0),document.body.contains(e)||(document.body.appendChild(e),a=!0),r=e.parentElement,n.highlightScanRegion||n.highlightCodeOutline){if(o=!!n.overlay,this.$overlay=n.overlay||document.createElement("div"),i=this.$overlay.style,i.position="absolute",i.display="none",i.pointerEvents="none",this.$overlay.classList.add("scan-region-highlight"),!o&&n.highlightScanRegion){this.$overlay.innerHTML='<svg class="scan-region-highlight-svg" viewBox="0 0 238 238" preserveAspectRatio="none" style="position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round"><path d="M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21"/></svg>';try{this.$overlay.firstElementChild.animate({transform:["scale(.98)","scale(1.01)"]},{duration:400,iterations:1/0,direction:"alternate",easing:"ease-in-out"})}catch{}r.insertBefore(this.$overlay,this.$video.nextSibling)}n.highlightCodeOutline&&(this.$overlay.insertAdjacentHTML("beforeend",'<svg class="code-outline-highlight" preserveAspectRatio="none" style="display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round"><polygon/></svg>'),this.$codeOutlineHighlight=this.$overlay.lastElementChild)}this._scanRegion=this._calculateScanRegion(e),requestAnimationFrame(()=>{let s=window.getComputedStyle(e);s.display==="none"&&(e.style.setProperty("display","block","important"),a=!0),s.visibility!=="visible"&&(e.style.setProperty("visibility","visible","important"),a=!0),a&&(console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."),e.style.opacity="0",e.style.width="0",e.style.height="0",this.$overlay&&this.$overlay.parentElement&&this.$overlay.parentElement.removeChild(this.$overlay),delete this.$overlay,delete this.$codeOutlineHighlight),this.$overlay&&this._updateOverlay()}),e.addEventListener("play",this._onPlay),e.addEventListener("loadedmetadata",this._onLoadedMetaData),document.addEventListener("visibilitychange",this._onVisibilityChange),window.addEventListener("resize",this._updateOverlay),this._qrEnginePromise=Xe.createQrEngine()}static set WORKER_PATH(e){console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.")}static async hasCamera(){try{return!!(await Xe.listCameras(!1)).length}catch{return!1}}static async listCameras(e=!1){if(!navigator.mediaDevices)return[];let n=async()=>(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput"),r;try{e&&(await n()).every(o=>!o.label)&&(r=await navigator.mediaDevices.getUserMedia({audio:!1,video:!0}))}catch{}try{return(await n()).map((o,i)=>({id:o.deviceId,label:o.label||(i===0?"Default Camera":`Camera ${i+1}`)}))}finally{r&&(console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"),Xe._stopVideoStream(r))}}async hasFlash(){let e;try{if(this.$video.srcObject){if(!(this.$video.srcObject instanceof MediaStream))return!1;e=this.$video.srcObject}else e=(await this._getCameraStream()).stream;return"torch"in e.getVideoTracks()[0].getSettings()}catch{return!1}finally{e&&e!==this.$video.srcObject&&(console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"),Xe._stopVideoStream(e))}}isFlashOn(){return this._flashOn}async toggleFlash(){this._flashOn?await this.turnFlashOff():await this.turnFlashOn()}async turnFlashOn(){if(!this._flashOn&&!this._destroyed&&(this._flashOn=!0,this._active&&!this._paused))try{if(!await this.hasFlash())throw"No flash available";await this.$video.srcObject.getVideoTracks()[0].applyConstraints({advanced:[{torch:!0}]})}catch(e){throw this._flashOn=!1,e}}async turnFlashOff(){this._flashOn&&(this._flashOn=!1,await this._restartVideoStream())}destroy(){this.$video.removeEventListener("loadedmetadata",this._onLoadedMetaData),this.$video.removeEventListener("play",this._onPlay),document.removeEventListener("visibilitychange",this._onVisibilityChange),window.removeEventListener("resize",this._updateOverlay),this._destroyed=!0,this._flashOn=!1,this.stop(),Xe._postWorkerMessage(this._qrEnginePromise,"close")}async start(){if(this._destroyed)throw Error("The QR scanner can not be started as it had been destroyed.");if((!this._active||this._paused)&&(window.location.protocol!=="https:"&&console.warn("The camera stream is only accessible if the page is transferred via https."),this._active=!0,!document.hidden))if(this._paused=!1,this.$video.srcObject)await this.$video.play();else try{let{stream:e,facingMode:n}=await this._getCameraStream();!this._active||this._paused?Xe._stopVideoStream(e):(this._setVideoMirror(n),this.$video.srcObject=e,await this.$video.play(),this._flashOn&&(this._flashOn=!1,this.turnFlashOn().catch(()=>{})))}catch(e){if(!this._paused)throw this._active=!1,e}}stop(){this.pause(),this._active=!1}async pause(e=!1){if(this._paused=!0,!this._active)return!0;this.$video.pause(),this.$overlay&&(this.$overlay.style.display="none");let n=()=>{this.$video.srcObject instanceof MediaStream&&(Xe._stopVideoStream(this.$video.srcObject),this.$video.srcObject=null)};return e?(n(),!0):(await new Promise(r=>setTimeout(r,300)),this._paused?(n(),!0):!1)}async setCamera(e){e!==this._preferredCamera&&(this._preferredCamera=e,await this._restartVideoStream())}static async scanImage(e,n,r,o,i=!1,a=!1){let s,c=!1;n&&("scanRegion"in n||"qrEngine"in n||"canvas"in n||"disallowCanvasResizing"in n||"alsoTryWithoutScanRegion"in n||"returnDetailedScanResult"in n)?(s=n.scanRegion,r=n.qrEngine,o=n.canvas,i=n.disallowCanvasResizing||!1,a=n.alsoTryWithoutScanRegion||!1,c=!0):console.warn(n||r||o||i||a?"You're using a deprecated api for scanImage which will be removed in the future.":"Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."),n=!!r;try{let u,d;[r,u]=await Promise.all([r||Xe.createQrEngine(),Xe._loadImage(e)]),[o,d]=Xe._drawToCanvas(u,s,o,i);let h;if(r instanceof Worker){let f=r;n||Xe._postWorkerMessageSync(f,"inversionMode","both"),h=await new Promise((p,l)=>{let g,m,y,w=-1;m=E=>{E.data.id===w&&(f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),E.data.data!==null?p({data:E.data.data,cornerPoints:Xe._convertPoints(E.data.cornerPoints,s)}):l(Xe.NO_QR_CODE_FOUND))},y=E=>{f.removeEventListener("message",m),f.removeEventListener("error",y),clearTimeout(g),l("Scanner error: "+(E?E.message||E:"Unknown Error"))},f.addEventListener("message",m),f.addEventListener("error",y),g=setTimeout(()=>y("timeout"),1e4);let b=d.getImageData(0,0,o.width,o.height);w=Xe._postWorkerMessageSync(f,"decode",b,[b.data.buffer])})}else h=await Promise.race([new Promise((f,p)=>window.setTimeout(()=>p("Scanner error: timeout"),1e4)),(async()=>{try{var[f]=await r.detect(o);if(!f)throw Xe.NO_QR_CODE_FOUND;return{data:f.rawValue,cornerPoints:Xe._convertPoints(f.cornerPoints,s)}}catch(p){if(f=p.message||p,/not implemented|service unavailable/.test(f))return Xe._disableBarcodeDetector=!0,Xe.scanImage(e,{scanRegion:s,canvas:o,disallowCanvasResizing:i,alsoTryWithoutScanRegion:a});throw`Scanner error: ${f}`}})()]);return c?h:h.data}catch(u){if(!s||!a)throw u;let d=await Xe.scanImage(e,{qrEngine:r,canvas:o,disallowCanvasResizing:i});return c?d:d.data}finally{n||Xe._postWorkerMessage(r,"close")}}setGrayscaleWeights(e,n,r,o=!0){Xe._postWorkerMessage(this._qrEnginePromise,"grayscaleWeights",{red:e,green:n,blue:r,useIntegerApproximation:o})}setInversionMode(e){Xe._postWorkerMessage(this._qrEnginePromise,"inversionMode",e)}static async createQrEngine(e){if(e&&console.warn("Specifying a worker path is not required and not supported anymore."),e=()=>Promise.resolve().then(()=>hO).then(r=>r.createWorker()),!(!Xe._disableBarcodeDetector&&"BarcodeDetector"in window&&BarcodeDetector.getSupportedFormats&&(await BarcodeDetector.getSupportedFormats()).includes("qr_code")))return e();let n=navigator.userAgentData;return n&&n.brands.some(({brand:r})=>/Chromium/i.test(r))&&/mac ?OS/i.test(n.platform)&&await n.getHighEntropyValues(["architecture","platformVersion"]).then(({architecture:r,platformVersion:o})=>/arm/i.test(r||"arm")&&13<=parseInt(o||"13")).catch(()=>!0)?e():new BarcodeDetector({formats:["qr_code"]})}_onPlay(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay(),this.$overlay&&(this.$overlay.style.display=""),this._scanFrame()}_onLoadedMetaData(){this._scanRegion=this._calculateScanRegion(this.$video),this._updateOverlay()}_onVisibilityChange(){document.hidden?this.pause():this._active&&this.start()}_calculateScanRegion(e){let n=Math.round(.6666666666666666*Math.min(e.videoWidth,e.videoHeight));return{x:Math.round((e.videoWidth-n)/2),y:Math.round((e.videoHeight-n)/2),width:n,height:n,downScaledWidth:this._legacyCanvasSize,downScaledHeight:this._legacyCanvasSize}}_updateOverlay(){requestAnimationFrame(()=>{if(this.$overlay){var e=this.$video,n=e.videoWidth,r=e.videoHeight,o=e.offsetWidth,i=e.offsetHeight,a=e.offsetLeft,s=e.offsetTop,c=window.getComputedStyle(e),u=c.objectFit,d=n/r,h=o/i;switch(u){case"none":var f=n,p=r;break;case"fill":f=o,p=i;break;default:(u==="cover"?d>h:d<h)?(p=i,f=p*d):(f=o,p=f/d),u==="scale-down"&&(f=Math.min(f,n),p=Math.min(p,r))}var[l,g]=c.objectPosition.split(" ").map((y,w)=>{const b=parseFloat(y);return y.endsWith("%")?(w?i-p:o-f)*b/100:b});c=this._scanRegion.width||n,h=this._scanRegion.height||r,u=this._scanRegion.x||0;var m=this._scanRegion.y||0;d=this.$overlay.style,d.width=`${c/n*f}px`,d.height=`${h/r*p}px`,d.top=`${s+g+m/r*p}px`,r=/scaleX\(-1\)/.test(e.style.transform),d.left=`${a+(r?o-l-f:l)+(r?n-u-c:u)/n*f}px`,d.transform=e.style.transform}})}static _convertPoints(e,n){if(!n)return e;let r=n.x||0,o=n.y||0,i=n.width&&n.downScaledWidth?n.width/n.downScaledWidth:1;n=n.height&&n.downScaledHeight?n.height/n.downScaledHeight:1;for(let a of e)a.x=a.x*i+r,a.y=a.y*n+o;return e}_scanFrame(){!this._active||this.$video.paused||this.$video.ended||("requestVideoFrameCallback"in this.$video?this.$video.requestVideoFrameCallback.bind(this.$video):requestAnimationFrame)(async()=>{if(!(1>=this.$video.readyState)){var e=Date.now()-this._lastScanTimestamp,n=1e3/this._maxScansPerSecond;e<n&&await new Promise(o=>setTimeout(o,n-e)),this._lastScanTimestamp=Date.now();try{var r=await Xe.scanImage(this.$video,{scanRegion:this._scanRegion,qrEngine:this._qrEnginePromise,canvas:this.$canvas})}catch(o){if(!this._active)return;this._onDecodeError(o)}!Xe._disableBarcodeDetector||await this._qrEnginePromise instanceof Worker||(this._qrEnginePromise=Xe.createQrEngine()),r?(this._onDecode?this._onDecode(r):this._legacyOnDecode&&this._legacyOnDecode(r.data),this.$codeOutlineHighlight&&(clearTimeout(this._codeOutlineHighlightRemovalTimeout),this._codeOutlineHighlightRemovalTimeout=void 0,this.$codeOutlineHighlight.setAttribute("viewBox",`${this._scanRegion.x||0} ${this._scanRegion.y||0} ${this._scanRegion.width||this.$video.videoWidth} ${this._scanRegion.height||this.$video.videoHeight}`),this.$codeOutlineHighlight.firstElementChild.setAttribute("points",r.cornerPoints.map(({x:o,y:i})=>`${o},${i}`).join(" ")),this.$codeOutlineHighlight.style.display="")):this.$codeOutlineHighlight&&!this._codeOutlineHighlightRemovalTimeout&&(this._codeOutlineHighlightRemovalTimeout=setTimeout(()=>this.$codeOutlineHighlight.style.display="none",100))}this._scanFrame()})}_onDecodeError(e){e!==Xe.NO_QR_CODE_FOUND&&console.log(e)}async _getCameraStream(){if(!navigator.mediaDevices)throw"Camera not found.";let e=/^(environment|user)$/.test(this._preferredCamera)?"facingMode":"deviceId",n=[{width:{min:1024}},{width:{min:768}},{}],r=n.map(o=>Object.assign({},o,{[e]:{exact:this._preferredCamera}}));for(let o of[...r,...n])try{let i=await navigator.mediaDevices.getUserMedia({video:o,audio:!1}),a=this._getFacingMode(i)||(o.facingMode?this._preferredCamera:this._preferredCamera==="environment"?"user":"environment");return{stream:i,facingMode:a}}catch{}throw"Camera not found."}async _restartVideoStream(){let e=this._paused;await this.pause(!0)&&!e&&this._active&&await this.start()}static _stopVideoStream(e){for(let n of e.getTracks())n.stop(),e.removeTrack(n)}_setVideoMirror(e){this.$video.style.transform="scaleX("+(e==="user"?-1:1)+")"}_getFacingMode(e){return(e=e.getVideoTracks()[0])?/rear|back|environment/i.test(e.label)?"environment":/front|user|face/i.test(e.label)?"user":null:null}static _drawToCanvas(e,n,r,o=!1){r=r||document.createElement("canvas");let i=n&&n.x?n.x:0,a=n&&n.y?n.y:0,s=n&&n.width?n.width:e.videoWidth||e.width,c=n&&n.height?n.height:e.videoHeight||e.height;return o||(o=n&&n.downScaledWidth?n.downScaledWidth:s,n=n&&n.downScaledHeight?n.downScaledHeight:c,r.width!==o&&(r.width=o),r.height!==n&&(r.height=n)),n=r.getContext("2d",{alpha:!1}),n.imageSmoothingEnabled=!1,n.drawImage(e,i,a,s,c,0,0,r.width,r.height),[r,n]}static async _loadImage(e){if(e instanceof Image)return await Xe._awaitImageLoad(e),e;if(e instanceof HTMLVideoElement||e instanceof HTMLCanvasElement||e instanceof SVGImageElement||"OffscreenCanvas"in window&&e instanceof OffscreenCanvas||"ImageBitmap"in window&&e instanceof ImageBitmap)return e;if(e instanceof File||e instanceof Blob||e instanceof URL||typeof e=="string"){let n=new Image;n.src=e instanceof File||e instanceof Blob?URL.createObjectURL(e):e.toString();try{return await Xe._awaitImageLoad(n),n}finally{(e instanceof File||e instanceof Blob)&&URL.revokeObjectURL(n.src)}}else throw"Unsupported image type."}static async _awaitImageLoad(e){e.complete&&e.naturalWidth!==0||await new Promise((n,r)=>{let o=i=>{e.removeEventListener("load",o),e.removeEventListener("error",o),i instanceof ErrorEvent?r("Image load error"):n()};e.addEventListener("load",o),e.addEventListener("error",o)})}static async _postWorkerMessage(e,n,r,o){return Xe._postWorkerMessageSync(await e,n,r,o)}static _postWorkerMessageSync(e,n,r,o){if(!(e instanceof Worker))return-1;let i=Xe._workerMessageId++;return e.postMessage({id:i,type:n,data:r},o),i}}Xe.DEFAULT_CANVAS_SIZE=400,Xe.NO_QR_CODE_FOUND="No QR code found",Xe._disableBarcodeDetector=!1,Xe._workerMessageId=0;function vT({onScan:t}){const{cameraFacingMode:e}=Xt(),[n,r]=x.useState(e),o=x.useRef(),i=x.useRef(null),[a,s]=x.useState(!0),c=d=>{t(d==null?void 0:d.data)},u=d=>{};return x.useEffect(()=>{var d;return i!=null&&i.current&&!o.current&&(o.current=new Xe(i==null?void 0:i.current,c,{onDecodeError:u,preferredCamera:n}),(d=o==null?void 0:o.current)==null||d.start().then(()=>s(!0)).catch(h=>{h&&s(!1)})),()=>{var h;i!=null&&i.current||(h=o==null?void 0:o.current)==null||h.stop()}},[]),x.useEffect(()=>{a||alert("Camera is blocked or not accessible. Please allow camera in your browser permissions and reload.")},[a]),v.jsxs("div",{className:"relative",children:[v.jsx("video",{className:"max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover",ref:i}),v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>{var h;const d=n===vn.USER?vn.ENVIRONMENT:vn.USER;r(d),(h=o==null?void 0:o.current)==null||h.setCamera(d)},children:v.jsx("img",{src:iu,alt:"camera-switch"})})]})}function wT({onScan:t}){const{t:e}=Ue(),{cameraFacingMode:n}=Xt(),[r,o]=x.useState(n),i=x.useRef(),a=x.useRef(null),[s,c]=x.useState(!1),u=f=>{t(f==null?void 0:f.data)},d=f=>{};x.useEffect(()=>()=>{var f;a!=null&&a.current||(f=i==null?void 0:i.current)==null||f.stop()});const h=()=>{var f;a!=null&&a.current&&!i.current&&(i.current=new Xe(a==null?void 0:a.current,u,{onDecodeError:d,preferredCamera:r}),(f=i==null?void 0:i.current)==null||f.start().then(()=>c(!0)).catch(p=>{p&&c(!1)}))};return v.jsxs("div",{className:"relative",children:[v.jsx("video",{className:"max-h-[calc(100vh-381px)] min-h-[370px] rounded object-cover",ref:a,autoPlay:!0,playsInline:!0}),s?v.jsx("div",{className:"absolute right-2 top-2 flex h-10 w-10 cursor-pointer items-center justify-center rounded bg-white shadow-overlay",onClick:()=>{var p;const f=r===vn.USER?vn.ENVIRONMENT:vn.USER;o(f),(p=i==null?void 0:i.current)==null||p.setCamera(f)},children:v.jsx("img",{src:iu,alt:"camera-switch"})}):v.jsx("div",{className:"absolute left-1/2 right-1/2 top-1/2 flex items-center justify-center",children:v.jsx(nt,{label:e("enableCamera"),disabled:s,onClick:h})})]})}function aa({data:t,dataSetter:e,setDefer:n,label:r=""}){const o=x.useRef(null),[i,a]=Rb()??[0,0],{subscribe:s,unsubscribe:c}=Oa(),{cameraService:u}=Xt(),d=f=>{e(f)};x.useEffect(()=>{a&&a<=332&&o.current&&o.current.scrollIntoView({behavior:"smooth",block:"end"});const f=p=>{e(p.detail.code)};return s("onCodeScan",f),()=>{c("onCodeScan",f)}},[a]);const h=()=>{switch(+u){case 1:return v.jsx(c2,{onScan:d});case 2:return v.jsx(vT,{onScan:d});case 3:return v.jsx(yT,{onScan:d});case 4:return v.jsx(wT,{onScan:d});default:return v.jsx(c2,{onScan:d})}};return v.jsxs("div",{ref:o,children:[v.jsxs("div",{className:"mb-4 flex flex-col gap-4",children:[h(),v.jsx("hr",{})]}),v.jsx(Yo,{label:r,value:t,autoFocus:!0,placeholder:"CDE2341S",onChange:f=>{n&&n(!0),e(f.target.value)}})]})}function bT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=()=>{u(!0),h.get(`${n}/check-code/${o}`).then(p=>{if(p.data.identifier)return d(`identifier/${p.data.identifier.value}`);if(p.data.voucher)return d(`voucher/${p.data.voucher.code}`);if(p.data.giftcard)return d(`giftcard/${p.data.giftcard.hash}`);e(t("unknownCode",{code:o}))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{o&&!a&&f()},[o]),v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"code"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:f,children:v.jsx(aa,{data:o,dataSetter:i,setDefer:s,label:t("contactIdentifier")})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(nt,{label:t("continue"),onClick:f,pending:c}),r.inputData.enable_email_identification&&v.jsx(nt,{label:t("useEmail"),variant:"secondary",onClick:()=>d("email")})]})})]})})}function ET(){const{hash:t}=Yr();return v.jsx(dr,{to:`${Le.GIFTCARD}/select/${t}`})}function CT(){const{identifierValue:t}=Yr(),{errorToast:e}=Vt(),{uuid:n,mutate:r}=je(),{onContactLink:o}=Xt(),[i,a]=x.useState(!1),s=Dt(),c=d=>s.get(`${n}/contacts`,{contact_uuid:d}),u=()=>{s.put(n,{contact_identifier_value:t}).then(d=>{o&&c(d.data.data.contact.uuid).then(h=>{o==null||o(h.data.data)}),r().then(()=>a(!0))}).catch(e)};return x.useEffect(()=>{u()},[]),i?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):v.jsx(_r,{})}function K2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/vouchers/${t}`,onData:r});return{voucher:n,isLoading:o,pending:i,mutate:a}}function _T(){const{t}=Ue(),{code:e}=Yr(),{voucher:n}=K2(e),{portalSession:r}=je(),[o,i]=x.useState(!1),[a,s]=x.useState(!1),c=zt(),u=()=>{n!=null&&n.contact||r.contact?i(!0):s(!0)};return x.useEffect(()=>{n&&u()},[n]),n?v.jsxs(v.Fragment,{children:[o?v.jsx(dr,{to:`${Le.VOUCHER}/${n.code}/redeem`}):v.jsx(_r,{}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:a,onClose:()=>s(!1),primaryAction:{label:t("linkToContact"),action:()=>c(`${Le.VOUCHER}/${n.code}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>s(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:n.code})})})]}):v.jsx(_r,{})}function Su({redirectRoute:t}){const{state:e}=er(),{t:n}=Ue(),{errorToast:r}=Vt(),{onContactLink:o}=Xt(),{portalSession:i,mutate:a}=je(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt(),m=b=>g.get(`${i.uuid}/contacts`,{contact_uuid:b}),y=()=>{h(!0),g.put(i.uuid,{email:c}).then(b=>{o&&m(b.data.data.contact.uuid).then(E=>{o==null||o(E.data.data)}),a().then(()=>l(t))}).catch(b=>{b.response.data.code===Ws.CONTACT_NOT_FOUND&&p(!0)}).finally(()=>h(!1))},w=()=>{h(!0),g.post(`${i.uuid}/contacts`,{email:c}).then(y).catch(r).finally(()=>h(!1))};return x.useEffect(()=>{s("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n("fillInXBelow",{x:n("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>c&&!d&&y(),children:v.jsx(Yo,{id:"via-email-address-input",label:n("emailAddress"),autoFocus:!0,onChange:b=>u(b.target.value),beforeIcon:"mail"})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(nt,{label:n("continue"),className:"w-full",onClick:y,disabled:!c,pending:d}),v.jsx(nt,{label:n("useIdentifier"),variant:"secondary",onClick:()=>l("../identifier",{state:e})})]})})]})}),v.jsx(Eo,{title:`${n("new")} ${n("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:n("confirm"),action:w,disabled:d},secondaryAction:{label:n("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:n("continueWithEmail",{email:c})})})]})}function AT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/*",element:v.jsx(bT,{})}),v.jsx(Ye,{path:"/giftcard/:hash",element:v.jsx(ET,{})}),v.jsx(Ye,{path:"/identifier/:identifierValue",element:v.jsx(CT,{})}),v.jsx(Ye,{path:"/voucher/:code",element:v.jsx(_T,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.PORTAL})})]})}const ST={[Kt.GIFTCARD]:`${Le.GIFTCARD}/select`,[Kt.REDEEM_GIFTCARD]:`${Le.GIFTCARD}/redeem`,[Kt.TOP_UP_GIFTCARD]:`${Le.GIFTCARD}/top-up`};function IT(){const{t}=Ue(),{portalSession:e}=je(),{errorToast:n}=Vt(),[r,o]=x.useState(""),[i,a]=x.useState(!1),[s,c]=x.useState(!1),u=Dt(),d=zt(),h=()=>{a(!0),u.get(`${e.uuid}/giftcards/${r}`).then(f=>{const p=e.type;d(`${ST[p]}/${f.data.data.hash}`)}).catch(f=>{n(f),o("")}).finally(()=>a(!1))};return x.useEffect(()=>{!s&&r&&h()},[r]),v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanGiftcard")})})}),v.jsx(kt,{children:v.jsx(aa,{data:r,dataSetter:o,setDefer:c,label:t("hash")})}),v.jsx(rn,{children:v.jsx(nt,{label:t("submit"),className:"w-full",onClick:h,disabled:!r,pending:i})})]})})}function TT(){const{t}=Ue(),{hash:e}=Yr(),n=zt();return v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("chooseType")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(nt,{className:"grow",label:t("redeem"),onClick:()=>n(`${Le.GIFTCARD}/redeem/${e}`)}),v.jsx(nt,{className:"grow",label:t("topUp"),onClick:()=>n(`${Le.GIFTCARD}/top-up/${e}`)})]})})]})})}function z2(t){const{portalSession:e}=je(),[n,r]=x.useState(),{isLoading:o,pending:i,mutate:a}=cr({url:`${e.uuid}/giftcards/${t}`,onData:r});return{giftcard:n,isLoading:o,pending:i,mutate:a}}function ws(){const{mutate:t}=je();return{get:()=>t().then(r=>r.data.data.events),post:()=>{t().then(r=>{r3(r.data.data.events)})}}}function xT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{onUseGiftcard:s}=Xt(),{post:c}=ws(),[u]=x.useState(i.results.remaining_amount?+i.results.remaining_amount:+i.inputData.amount_in_cents),[d,h]=x.useState(!1),f=i.inputData.allow_multiple_giftcards??!0,p=zt(),l=Dt(),g=()=>{h(!0),l.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:-m()}).then(E=>{o(),a(),c(),s==null||s(E.data.data)}).catch(e).finally(()=>h(!1))},m=()=>Math.min(y(),r.amount_in_cents),y=()=>i.results.remaining_amount??i.inputData.amount_in_cents,w=()=>{let E=0;return i.events.filter(I=>I.type===yo.GIFTCARD_TRANSACTION).forEach(I=>{I.data.giftcard.uuid===r.uuid&&(E+=I.data.amount_in_cents)}),E},b=()=>{if(m())return{label:t("confirmAndPay",{amount:Si(m(),i.currency)}),onClick:g};if(f&&y())return{label:t("useAnotherGiftcard"),onClick:()=>p(Le.GIFTCARD),variant:"secondary"}};return r?v.jsx(Tn,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:`${t("giftcard")} ${r.hash}`})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("balance")}),v.jsx(bo,{value:r.amount_in_cents,start:r.amount_in_cents-w(),currency:i.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"font-light text-gray-500",children:t("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u+w(),start:u,currency:i.currency,asCurrency:!0})})]})})]})}),b()&&v.jsx(rn,{children:v.jsx(nt,{label:"",className:"w-full",...b(),pending:d})})]})}):v.jsx(_r,{})}function OT({value:t,valueSetter:e,enabled:n}){const[r,o]=x.useState(!1),i=x.useRef(null),a=x.useRef(null);x.useEffect(()=>{u(t?t.toString():"")},[]);const s=d=>{e(d?parseInt(d):0),u(d)},c=d=>{const{key:h}=d;if(t===0&&!/^[1-9]$/.test(h)||t!==0&&!/^[0-9]$/.test(h)&&h!=="Backspace")return;let f;if(h!=="Backspace")f=parseInt(t===0?h:`${t}${h}`);else{const p=t.toString().slice(0,-1);f=p.length?parseInt(p,10):0}e(f),u(f?f.toString():"")},u=d=>{a&&a.current&&(d?a.current.style.width=`${Math.max(d.length,3)*3}rem`:a.current.style.width="calc(3rem + 14px)")};return v.jsxs(v.Fragment,{children:[v.jsx("input",{ref:a,className:"h-full w-[65px] rounded border-gray-200 border-transparent text-5xl [appearance:textfield] focus:border-transparent focus:ring-0 [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none",type:"number",pattern:"[0-9]*",inputMode:"numeric",placeholder:"0",autoFocus:!0,value:t?(t/100).toFixed(2):"",onKeyDown:c,onChange:()=>{},onFocus:()=>o(!0),onBlur:()=>o(!1)}),n&&v.jsx("div",{className:`mobile:hidden bottom-2 left-2 right-2 z-50 mx-auto w-[98vw] max-w-[1200px] ${!r&&"hidden"} absolute`,children:v.jsx(fp,{keyboardRef:i,layout:{default:["1 2 3","4 5 6","7 8 9","00 0 {bksp}"]},theme:"hg-theme-default hg-layout-numeric numeric-theme",onChange:s})})]})}function X2({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),[a,s]=x.useState(0),{portalSession:c}=je(),u=()=>{let d=0;return c.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d};return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e??0,start:e??0,currency:c.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsx("div",{className:"flex items-center justify-center gap-1 p-4 text-5xl font-bold",children:u()?v.jsx(bo,{value:0,start:a,currency:c.currency,asCurrency:!0}):v.jsxs("div",{className:"flex items-center justify-center gap-1 ",children:[v.jsx("p",{children:n3(c.currency)}),v.jsx(OT,{value:a,valueSetter:s,enabled:c.inputData.enable_on_screen_keyboard})]})})})]})}),v.jsx(rn,{children:v.jsx(nt,{label:i("confirmAndPay",{amount:Si(a,c.currency)}),className:"w-full",onClick:r&&(()=>r(a)),disabled:!a||!!u(),pending:o})})]})}function PT(){const{t}=Ue(),{errorToast:e}=Vt(),{hash:n}=Yr(),{giftcard:r,mutate:o}=z2(n),{portalSession:i,mutate:a}=je(),{post:s}=ws(),{onUseGiftcard:c}=Xt(),[u,d]=x.useState(!1),h=Dt(),f=p=>{d(!0),h.post(`${i.uuid}/giftcards/transaction`,{uuid:r.uuid,amount_in_cents:p}).then(l=>{o(),a(),s(),c==null||c(l.data.data),Ct.success(`${t("transactionSuccessful")}! ${t("totalUpgradedAmount")}: ${Si(l.data.data.amount_in_cents,i.currency)}`)}).catch(e).finally(()=>d(!1))};return r?v.jsx(Tn,{children:v.jsx(X2,{title:`${t("giftcard")} ${r.hash}`,balance:r.amount_in_cents,transaction:f,pending:u})}):v.jsx(_r,{})}function kT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(IT,{})}),v.jsx(Ye,{path:"/select/:hash",element:v.jsx(TT,{})}),v.jsx(Ye,{path:"/redeem/:hash",element:v.jsx(xT,{})}),v.jsx(Ye,{path:"/top-up/:hash",element:v.jsx(PT,{})})]})}class Df{constructor(){Qn(this,"uuid");Qn(this,"email");Qn(this,"credit_balance");Qn(this,"prepaid_balance");Qn(this,"current_display_values")}getDisplayName(){return this.current_display_values.firstname||this.current_display_values.lastname?`${this.current_display_values.firstname} ${this.current_display_values.lastname}`:this.current_display_values.email}}const Q2=x.createContext({contact:new Df,mutate:async()=>{}});function Mf({children:t}){const{uuid:e}=je(),[n,r]=x.useState(new Df),{mutate:o}=cr({url:`${e}/contacts`,onData:a=>{const s=new Df;s.uuid=a.uuid,s.email=a.email,s.credit_balance=a.credit_balance,s.prepaid_balance=a.prepaid_balance,s.current_display_values=a.current_display_values,r(s)}}),i=x.useMemo(()=>({contact:n,mutate:o}),[n,o]);return n.uuid?v.jsx(Q2.Provider,{value:i,children:t}):v.jsx(_r,{})}function ar(){const t=x.useContext(Q2);if(!t)throw new Error("Only use 'useContactContext' within a ContactProvider");return t}function Iu({message:t=""}){return v.jsxs("div",{className:"flex items-center justify-center gap-4 text-core-primary-500",children:[v.jsx(Sl,{className:"h-[32px] w-[32px]"}),t&&v.jsx("p",{className:"text-sm",children:t})]})}function BT(){const{t}=Ue(),{errorToast:e}=Vt(),{contact:n,mutate:r}=ar(),{uuid:o,portalSession:i,mutate:a}=je(),s=Dt(),c=()=>{s.post(`${o}/credit-receptions/create`,{unit_value:i.inputData.amount_in_cents/100}).then(()=>{r(),a()}).catch(e)},u=()=>{const d=i.events.filter(h=>h.type===yo.CREDIT_RECEPTION);return d.length?d[0]:null};return x.useEffect(()=>{u()||c()},[]),v.jsx(Tn,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:n.getDisplayName()})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsx("div",{className:"flex h-full flex-col items-center gap-2 p-6",children:i.inputData.amount_in_cents?v.jsx("div",{className:"flex h-full items-center justify-center gap-1 text-4xl font-bold",children:u()?v.jsxs(v.Fragment,{children:["+",v.jsx(bo,{value:u().data.credits,start:0})]}):v.jsx(Iu,{})}):v.jsx("p",{className:"text-core-red-500",children:t("xIsRequired",{x:"Amount in cents"})+"."})}),v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:`${t("new")} ${t("balance").toLowerCase()}`}),v.jsx(bo,{value:n.credit_balance.balance??0,start:n.credit_balance.balance-(u()?u().data.credits:0)})]})})]})})]})})}function NT(){const{portalSession:t}=je();return t.contact?v.jsx(Mf,{children:v.jsx(BT,{})}):t.inputData.primary_identification_method&&t.inputData.primary_identification_method===Ci.EMAIL?v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/email`}):v.jsx(dr,{to:`${Le.POINTS_TRANSACTION}/identifier`})}function Lf({redirectRoute:t}){const{t:e}=Ue(),{state:n}=er(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=Xt(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt();x.useEffect(()=>{!d&&a&&l()},[a]);const l=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&g(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(t,{state:{contactIdentifier:a}}))}).catch(()=>f("link",{state:{contactIdentifier:a}})).finally(()=>u(!1))},g=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m});return v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>a&&l(),children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:e("contactIdentifier")})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(nt,{label:e("continue"),onClick:l,disabled:!a,pending:c}),r.inputData.enable_email_identification&&v.jsx(nt,{label:e("useEmail"),variant:"secondary",onClick:()=>f("../email",{state:n})})]})})]})})}function Ff({redirectRoute:t}){const{t:e}=Ue(),{errorToast:n}=Vt(),{uuid:r,mutate:o}=je(),{onContactLink:i}=Xt(),{state:a}=er(),{publish:s}=Oa(),[c,u]=x.useState(""),[d,h]=x.useState(!1),[f,p]=x.useState(!1),l=zt(),g=Dt();if(!a||!a.contactIdentifier)return v.jsx(dr,{to:"../"});const m=()=>{h(!0),g.post(`${r}/contacts/link-identifier`,{contact_identifier_value:a.contactIdentifier,email:c}).then(w).catch(E=>{E.response.data.code===Ws.CONTACT_NOT_FOUND?p(!0):n(E)}).finally(()=>h(!1))},y=()=>{h(!0),g.post(`${r}/contacts`,{email:c}).then(m).catch(n).finally(()=>h(!1))},w=()=>{g.put(r,{email:c}).then(E=>{i&&b(E.data.data.contact.uuid).then(C=>{i==null||i(C.data.data)}),o().then(()=>l(t))}).catch(n).finally(()=>h(!1))},b=E=>g.get(`${r}/contacts`,{contact_uuid:E});return x.useEffect(()=>{s("openKeyboard",{inputId:"new-contact-identifier-input",inputValue:""})},[]),v.jsxs(Tn,{children:[v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:e("linkContact")})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex flex-col gap-3",children:[v.jsx(Ob,{body:e("noEmailAddressLinkedToIdentifier")}),v.jsx(si,{onSubmit:m,children:v.jsx(Yo,{id:"new-contact-identifier-input",label:e("emailAddress"),autoFocus:!0,onChange:E=>u(E.target.value),beforeIcon:"mail"})})]})}),v.jsx(rn,{children:v.jsx(nt,{label:e("continue"),className:"w-full",onClick:m,disabled:!c||d})})]}),v.jsx(Eo,{title:`${e("new")} ${e("emailAddress").toLowerCase()}`,isOpen:f,onClose:()=>p(!1),primaryAction:{label:e("confirm"),action:y,loading:d},secondaryAction:{label:e("cancel"),action:()=>p(!1)},children:v.jsx("p",{children:e("continueWithEmail",{email:c})})})]})}function RT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(NT,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.POINTS_TRANSACTION})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.POINTS_TRANSACTION})})]})}function DT(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=Xt();return t.contact?v.jsx(dr,{to:`${Le.PORTAL}/overview`}):e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PORTAL}/email`}):v.jsx(dr,{to:`${Le.PORTAL}/identifier`})}function MT({children:t}){return v.jsx("div",{className:"h-screen w-screen pb-[70px] md:px-4 md:pb-[86px] md:pt-4 lg:pb-4 lg:pt-[66px]",children:v.jsx("div",{className:"h-full max-h-full",children:t})})}function LT({contact:t}){const{t:e}=Ue(),n=zt();return v.jsxs("div",{className:"inline-grid w-full items-center gap-4 py-4 lg:grid-cols-2",children:[v.jsxs("div",{className:"flex items-center gap-4",children:[v.jsx(Ml,{src:t.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{className:"flex flex-col gap-1",children:[v.jsxs("div",{className:"flex gap-2",children:[v.jsx("p",{className:"text-lg",children:t.getDisplayName()}),t.current_display_values.tier&&v.jsx(Ll,{label:t.current_display_values.tier,size:"sm",stroke:!0})]}),v.jsx("p",{className:"text-sm text-core-gray-500 ",children:e("joinedAtDate",{date:new Date(t.current_display_values.created_at).toLocaleDateString(nn.language,{month:"long",year:"numeric"})})})]})]}),v.jsxs("div",{className:"inline-grid gap-2 lg:grid-cols-2",children:[v.jsx(nt,{label:e("goToX",{x:"identifiers"}),variant:"secondary",size:"md",onClick:()=>n("contact-identifiers")}),v.jsx(nt,{before:v.jsx(wn,{icon:"edit"}),label:e("editProfile"),variant:"secondary",size:"md",onClick:()=>n("contact-attributes")})]})]})}function bs({children:t}){return v.jsx("div",{className:"flex-grow rounded-lg border p-4",children:t})}function FT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex gap-2 lg:flex-col",children:[v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:e.current_display_values.loyalty_balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})}),v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col items-center justify-center",children:[v.jsx("p",{className:"text-2xl leading-8",children:Si(e.prepaid_balance.balance_in_cents,n.currency)}),v.jsx("p",{className:"text-sm text-core-gray-500",children:t("prepaidCredit")})]})})]})}function jT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je(),r=(o,i)=>R1(o,i)?`${R1(o,i)} ${t("yearsAgo")}`:N1(o,i)?`${N1(o,i)} ${t("weeksAgo")}`:B1(o,i)?`${B1(o,i)} ${t("daysAgo")}`:t("today");return v.jsx(bs,{children:v.jsxs("div",{className:"h-full justify-between",children:[v.jsx("p",{className:"mb-4 text-lg font-semibold leading-7",children:t("stats")}),v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(wn,{icon:"calendar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:r(new Date,new Date(e.current_display_values.loyalty_last_transaction_date))}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("lastVisit")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(wn,{icon:"shopping-bag"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_number_of_transactions} ${t("visits")}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalVisits")})]})]}),v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx(wn,{icon:"dollar"}),v.jsxs("div",{children:[v.jsx("p",{className:"text-xs font-semibold",children:`${e.current_display_values.loyalty_total_credits_received} ${n.loyaltyProgram.custom_credit_name}`}),v.jsx("p",{className:"text-xs text-core-gray-500",children:t("totalCredits")})]})]})]})]})})}function J2(){const{uuid:t}=je(),[e,n]=x.useState([]),{data:r,isLoading:o,pending:i,mutate:a}=cr({url:`${t}/loyalty-transactions`});return x.useEffect(()=>{r&&n(r.data)},[r]),{loyaltyTransactions:e,isLoading:o,pending:i,mutate:a}}function Z2({loyaltyTransaction:t}){const{t:e}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs text-core-gray-500",children:t.type===v1.CREDIT_RECEPTION?e("transaction"):`${e("isRedeemed")} '${t.loyalty_transaction_data.title}'`}),v.jsx("p",{className:"text-xs font-semibold",children:t.credits>0?"+"+t.credits:t.credits})]})}function VT(){const{t}=Ue(),e=zt(),{loyaltyTransactions:n}=J2();return n?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between gap-4",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("activities")}),n&&n.length?v.jsx("div",{children:n.slice(0,5).map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))}):v.jsx("p",{className:"text-sm text-core-gray-500",children:t("noActivity")})]}),v.jsx(nt,{label:`${t("all")} ${t("activities").toLowerCase()}`,variant:"secondary",onClick:()=>e("activity")})]})}):v.jsx(Iu,{})}function ey(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/subscriptions/contact`,onData:n});return{subscriptions:e,isLoading:r,pending:o,mutate:i}}function ty({subscription:t,onChange:e,editable:n=!1}){const{t:r}=Ue();return v.jsxs("div",{className:"mb-2 flex justify-between",children:[v.jsx("p",{className:"text-xs font-semibold",children:t.subscription_type.name}),n?v.jsx(md,{defaultChecked:t.is_subscribed,disabled:t.subscription_type.strategy===w1.FUNCTIONAL,onChange:e&&(()=>e(t.subscription_type.name))}):v.jsx(Ll,{label:r(t.status.toLowerCase()),size:"sm",color:t.is_subscribed?"primary":"gray"})]})}function UT(){const{t}=Ue(),{subscriptions:e}=ey(),n=zt();return e?v.jsx(bs,{children:v.jsxs("div",{className:"flex h-full flex-col justify-between",children:[v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{className:"text-lg font-semibold leading-7",children:t("subscriptions")}),v.jsx("div",{children:e.map(r=>v.jsx(ty,{subscription:r},r.subscription_type.uuid))})]}),v.jsx(nt,{label:t("change"),before:v.jsx(wn,{icon:"edit"}),variant:"secondary",onClick:()=>n("subscriptions")})]})}):v.jsx(Iu,{})}function GT(){const{contact:t}=ar();return v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(LT,{contact:t})}),v.jsx(kt,{children:v.jsxs("div",{className:"grid grid-cols-1 gap-x-2 gap-y-2 lg:grid-cols-4",children:[v.jsx(FT,{}),v.jsx(jT,{}),v.jsx(VT,{}),v.jsx(UT,{})]})})]})}function Es({label:t,path:e}){const n=zt();return v.jsx("div",{className:"flex h-16 items-center text-base text-core-gray-900",children:v.jsx(nt,{label:t,variant:"link-gray",before:v.jsx(wn,{icon:"caret-left",size:"md"}),onClick:()=>n(e)})})}function qT(){const{t}=Ue(),{loyaltyTransactions:e}=J2(),{contact:n}=ar();return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsx("p",{className:"text-sm font-medium",children:t("allActivities")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("checkOutAllActivitiesOfName",{name:n.getDisplayName()})}),v.jsx("div",{className:"overflow-auto",children:e==null?void 0:e.map(r=>v.jsx(Z2,{loyaltyTransaction:r},r.uuid))})]})})]})})}function HT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{subscriptions:r,mutate:o}=ey(),[i,a]=x.useState({}),[s,c]=x.useState(!1),u=Dt();x.useEffect(()=>{if(r&&!Object.keys(i).length){const p=r.reduce((l,g)=>({...l,[g.subscription_type.name]:g.is_subscribed}),{});a(p)}},[r]);const d=p=>{Object.hasOwn(i,p)?a({...i,[p]:!i[p]}):a({...i,[p]:!0})},h=()=>{c(!0),u.put(`${n}/subscriptions`,{values:i}).then(()=>o()).catch(e).finally(()=>c(!1))},f=()=>r&&r.some(p=>i[p.subscription_type.name]!==p.is_subscribed);return r?v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("subscriptions")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("manageEmailPreferences")}),r.map(p=>v.jsx(ty,{subscription:p,onChange:d,editable:!0},p.subscription_type.uuid))]})})}),v.jsx(rn,{children:v.jsx(nt,{label:t("saveChanges"),className:"w-full",onClick:h,pending:s,disabled:!f()||s})})]})}):v.jsx(Iu,{})}function $T(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r,mutate:o}=ar(),[i,a]=x.useState(),[s,c]=x.useState(!1),[u,d]=x.useState(),h=Dt();cr({url:`${n}/contact-attributes`,onData:g=>a(g.elements)});const f=g=>{d({...u,[g.target.name]:g.target.value})},p=(g,m)=>{d({...u,[g]:m})},l=async()=>{c(!0),h.put(`${n}/contact-attributes`,u).then(()=>{o(),d(void 0)}).catch(e).finally(()=>c(!1))};return v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsxs("div",{className:"md:max-h-[528px]",children:[v.jsxs("div",{className:"mb-4 flex flex-row items-center gap-4 border-b border-b-core-gray-200 px-1 pb-4",children:[v.jsx(Ml,{src:r.current_display_values.avatar,size:"2xl"}),v.jsxs("div",{children:[v.jsx("div",{className:"flex flex-row items-center gap-2 ",children:v.jsxs("h1",{className:"text-lg text-core-gray-900",children:[r.current_display_values.firstname," ",r.current_display_values.lastname]})}),v.jsx("p",{className:"text-sm text-core-gray-500",children:r.current_display_values.email})]})]}),i?i.map(g=>{if(!(g.type==="media_upload"||g.type==="email"))return g.type==="select"?v.jsx(qb,{name:g.name,label:g.label,value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],onChange:m=>p(g.name,m),disabled:g.disabled,children:g.options.map(m=>v.jsx(jl,{label:m.label,value:m.value},m.value))},g.id):g.type==="multi_select"?v.jsx(jb,{name:g.name,value:u&&u[g.name]?u[g.name]:g.defaultValue,label:g.label,onChange:p,disabled:g.disabled,options:g.options},g.id):g.type==="birth_date"||g.type==="date_time"?v.jsx(pp,{id:g.id,name:g.name,label:g.label,type:g.type==="date_time"?"date_time":"date",value:u&&u[g.name]?u[g.name]:r.current_display_values[g.name],disabled:g.disabled,onChange:f},g.id):v.jsx(Yo,{disabled:g.disabled,label:g.label,name:g.name,value:u&&u[g.name]!=="undefined"?u[g.name]:r.current_display_values[g.name],onChange:f},g.id)}):v.jsx(Tc,{rows:10})]})}),v.jsx(rn,{children:v.jsx(nt,{label:t("saveChanges"),className:"w-full",onClick:l,disabled:!u,pending:s})})]})})}function ny(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/contact-identifiers`,onData:n});return{contactIdentifiers:e,isLoading:r,pending:o,mutate:i}}function YT({identifier:t,onClear:e}){const{t:n}=Ue();return v.jsxs("div",{className:"flex items-center justify-between rounded-lg border text-xs",children:[v.jsxs("div",{className:"flex-col pl-4",children:[v.jsx("p",{className:"font-semibold",children:t.value}),v.jsx("p",{className:"text-core-gray-500",children:n("contactIdentifier")})]}),v.jsx("div",{className:"h-full border-l p-4 hover:cursor-pointer hover:bg-core-gray-50",onClick:()=>e&&e(t.value),children:v.jsx(wn,{className:"h-full",icon:"close"})})]})}function WT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contactIdentifiers:r,isLoading:o,mutate:i}=ny(),[a,s]=x.useState(""),[c,u]=x.useState(!1),d=zt(),h=Dt(),f=l=>{s(l),u(!0)},p=async()=>{h.destroy(`${n}/contact-identifiers`,{value:a}).then(()=>i()).catch(e).finally(()=>u(!1))};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile"})}),v.jsx(kt,{children:v.jsx("div",{className:"md:max-h-[528px]",children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsxs("div",{children:[v.jsx("p",{className:"text-sm font-medium",children:t("contactIdentifiers")}),v.jsx("p",{className:"mb-4 text-sm text-core-gray-500",children:t("contactIdentifierDescription")})]}),o?v.jsx(Tc,{rows:10}):r==null?void 0:r.map(l=>v.jsx(YT,{identifier:l,onClear:f},l.value))]})})}),v.jsx(rn,{children:v.jsx(nt,{label:t("addIdentifier"),className:"w-full",variant:"secondary",onClick:()=>d("create")})})]}),v.jsx(Eo,{title:t("confirmClearContactIdentifier"),isOpen:c,primaryAction:{label:t("confirm"),action:p},secondaryAction:{label:t("cancel"),action:()=>u(!1)},onClose:()=>u(!1),children:v.jsx("p",{children:t("clearContactIdentifier",{value:a})})})]})}function KT(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n}=je(),{contact:r}=ar(),{mutate:o}=ny(),[i,a]=x.useState(""),[s,c]=x.useState(!1),[u,d]=x.useState(!1),h=zt(),f=Dt(),p=()=>{c(!0),f.post(`${n}/contacts/link-identifier`,{contact_identifier_value:i,email:r.email}).then(()=>{o(),h("../profile/contact-identifiers")}).catch(e).finally(()=>{a(""),c(!1)})};return x.useEffect(()=>{!u&&i&&p()},[i]),v.jsx("div",{className:"h-full md:container",children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx(Es,{label:t("back"),path:"../profile/contact-identifiers"})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>i&&p(),children:v.jsx(aa,{data:i,dataSetter:a,setDefer:d,label:t("contactIdentifier")})})}),v.jsx(rn,{children:v.jsx(nt,{label:t("addIdentifier"),className:"w-full",onClick:p,pending:s,disabled:!i})})]})})}function zT(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/profile",element:v.jsx(GT,{})}),v.jsx(Ye,{path:"/profile/activity",element:v.jsx(qT,{})}),v.jsx(Ye,{path:"/profile/subscriptions",element:v.jsx(HT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers",element:v.jsx(WT,{})}),v.jsx(Ye,{path:"/profile/contact-identifiers/create",element:v.jsx(KT,{})}),v.jsx(Ye,{path:"/profile/contact-attributes",element:v.jsx($T,{})})]})}function XT(){const{t}=Ue(),{contact:e}=ar(),{portalSession:n}=je();return v.jsxs("div",{className:"flex h-16 items-center justify-between",children:[v.jsx("h1",{children:t("rewards")}),v.jsxs("div",{className:"flex flex-col items-center",children:[v.jsx("p",{children:e.credit_balance.balance}),v.jsx("p",{className:"text-sm text-core-gray-500",children:n.loyaltyProgram.custom_credit_name})]})]})}function ry(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/rewards`,onData:n});return{rewards:e,isLoading:r,pending:o,mutate:i}}function jf({reward:t,selected:e,setSelected:n,disabled:r,readOnly:o}){const{portalSession:i}=je(),{contact:a}=ar();return v.jsxs("div",{className:`max-h-[48px] rounded-lg border ${r?"pointer-events-none opacity-40":!o&&"cursor-pointer"}`,children:[v.jsxs("div",{className:`flex items-center justify-between rounded-lg text-xs ${r?"px-2 pt-2":"p-2"}`,onClick:o?void 0:()=>(e==null?void 0:e.uuid)===t.uuid?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.media&&t.media.value?t.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:t.title??t.description})]}),v.jsxs("p",{className:"whitespace-nowrap text-core-primary-500",children:[t.required_credits," ",i.loyaltyProgram.custom_credit_name]})]}),t.required_credits-a.credit_balance.balance>0&&v.jsx(Vb,{value:a.credit_balance.balance,max:t.required_credits})]})}function QT({selected:t,setSelected:e}){const{t:n}=Ue(),{contact:r}=ar(),{rewards:o,isLoading:i}=ry(),a=o==null?void 0:o.filter(c=>c.required_credits<=r.credit_balance.balance),s=o==null?void 0:o.filter(c=>c.required_credits>r.credit_balance.balance);return v.jsx(v.Fragment,{children:i?v.jsx(Tc,{rows:1}):v.jsxs("div",{className:"flex flex-col gap-3 md:max-h-[528px]",children:[v.jsx("div",{className:"flex flex-col gap-1",children:(a==null?void 0:a.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("redeemableRewards")}),a.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e},c.uuid))]})}),v.jsx("div",{className:"flex flex-col gap-1",children:(s==null?void 0:s.length)>0&&v.jsxs(v.Fragment,{children:[v.jsx("p",{className:"text-sm font-light text-core-gray-500",children:n("saveABitMore")}),s.map(c=>v.jsx(jf,{reward:c,selected:t,setSelected:e,disabled:!0},c.uuid))]})})]})})}function JT(){const{portalSession:t}=je(),{rewards:e}=ry(),n=()=>t.events.filter(r=>r.type===yo.REWARD_RECEPTION).map(r=>e.find(o=>o.uuid===r.data.reward.uuid)).filter(r=>r);return e?v.jsx("div",{children:v.jsx(y0,{children:n().map((r,o)=>v.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-core-primary-100 bg-core-primary-50 p-2 text-xs",children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:r.media&&r.media.value?r.media.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-8 w-8 rounded object-cover object-center"}),v.jsx("p",{className:"truncate",children:r.title??r.description})]}),v.jsxs("p",{className:"text-core-primary-500",children:[r.required_credits," ",t.loyaltyProgram.custom_credit_name]})]},`${o}-${r.uuid}`))},n().length)}):v.jsx(v.Fragment,{})}function ZT(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{portalSession:r,mutate:o}=je(),{mutate:i}=ar(),{onClaimReward:a}=Xt(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),{post:p}=ws(),l=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const g=y=>{o().then(w=>{const E=w.data.data.events.filter(C=>C.type===yo.REWARD_RECEPTION&&C.data.reward.uuid===s.uuid).reduce((C,I)=>new Date(C.created_at)>new Date(I.created_at)?C:I);a==null||a(y,E.data.uuid)})},m=()=>{d(!0),l.post(`${r.uuid}/rewards/claim`,{uuid:s.uuid}).then(y=>{p(),i(),g(y.data.data),n(t("rewardClaimed",{name:y.data.data.title}))}).catch(e).finally(()=>{f(!1),c(void 0),d(!1)})};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(XT,{})}),v.jsx(kt,{children:v.jsx(QT,{selected:s,setSelected:c})}),v.jsx(rn,{children:v.jsx(JT,{})})]}),v.jsx(Eo,{title:t("confirmRewardRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:m,loading:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},onClose:()=>f(!1),children:v.jsx("div",{className:"flex flex-col gap-4",children:s&&v.jsx(jf,{reward:s,selected:s,setSelected:c,readOnly:!0})})})]})}function Vf(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/vouchers`,onData:n});return{vouchers:e,isLoading:r,pending:o,mutate:i}}function ex(){const{t}=Ue();return v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("vouchers")})})}function Uf({voucher:t,selected:e,setSelected:n}){const{t:r}=Ue();return v.jsxs("div",{className:`flex cursor-pointer items-center justify-between gap-4 rounded-lg ${t.status===Ea.REDEEMED?"border border-core-primary-100 bg-core-primary-50":"border bg-white"} p-2 text-xs`,onClick:()=>(e==null?void 0:e.code)===t.code?n(void 0):n(t),children:[v.jsxs("div",{className:"mr-4 flex items-center gap-4 overflow-hidden",children:[v.jsx("img",{src:t.promotion.image?t.promotion.image.value:"https://static.piggy.nl/images/fallback_image.png",alt:"voucher_image",className:"h-[32px] w-[32px] rounded object-cover object-center"}),v.jsxs("div",{className:"overflow-hidden overflow-ellipsis ",children:[v.jsx("p",{className:"font-semibold",children:t.name}),t.status===Ea.REDEEMED?v.jsx("p",{className:"text-core-gray-500",children:r("redeemed")}):v.jsx("p",{className:"text-core-primary-500",children:t.expiration_date?`Valid until ${new Date(t.expiration_date).toLocaleDateString()}`:r("nonExpiring")})]})]}),v.jsx("p",{className:`text-core-${t.status===Ea.REDEEMED?"gray":"primary"}-500`,children:t.code})]})}function tx({selected:t,setSelected:e}){const{t:n}=Ue(),{vouchers:r,isLoading:o}=Vf();return v.jsx(v.Fragment,{children:o?v.jsx(Tc,{rows:1}):v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:v.jsx("div",{className:"flex flex-col gap-1 md:max-h-[528px]",children:r&&r.length?r.map(i=>v.jsx(Uf,{voucher:i,selected:t,setSelected:e},i.code)):v.jsx("p",{className:"text-center text-sm text-core-gray-500",children:n("vouchersEmptyState")})})})})}function nx(){const{t}=Ue(),{portalSession:e}=je(),{vouchers:n}=Vf(),r=()=>e.events.filter(o=>o.type===yo.VOUCHER_REDEEMED);return n?v.jsx("div",{children:v.jsx(y0,{children:r().map((o,i)=>v.jsx("div",{className:"flex items-center gap-2 rounded-lg border border-core-primary-100 bg-core-primary-50 p-2",children:v.jsx("div",{className:"flex h-full flex-col justify-between text-xs",children:v.jsxs("div",{className:"overflow-hidden",children:[v.jsx("p",{className:"font-semibold",children:o.data.name}),v.jsxs("p",{className:"overflow-ellipsis text-core-gray-500",children:[o.data.code," - ",t("applied")]})]})})},`${i}-${o.data.uuid}`))},r().length)}):v.jsx(v.Fragment,{})}function rx(){const{t}=Ue(),{errorToast:e,successToast:n}=Vt(),{uuid:r}=je(),{onRedeemVoucher:o}=Xt(),{post:i}=ws(),{mutate:a}=Vf(),[s,c]=x.useState(),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=Dt();x.useEffect(()=>{s&&f(!0)},[s]);const l=()=>{d(!0),p.post(`${r}/vouchers/redeem`,{code:s.code}).then(m=>{i(),o&&o(m.data.data),n(t("voucherSuccessfullyRedeemed")),a()}).catch(e).finally(()=>{g(),d(!1)})},g=()=>{f(!1),c(void 0)};return v.jsxs("div",{className:"h-full md:container",children:[v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx(ex,{})}),v.jsx(kt,{children:v.jsx(tx,{selected:s,setSelected:c})}),v.jsx(rn,{children:v.jsx(nx,{})})]}),v.jsx(Eo,{title:t("confirmVoucherRedemption"),isOpen:h,primaryAction:{label:t("confirm"),action:l,loading:u},secondaryAction:{label:t("cancel"),action:g},onClose:g,children:v.jsxs("div",{className:"flex flex-col gap-4",children:[v.jsx("p",{children:t("redeemTitle",{title:s==null?void 0:s.name})}),s&&v.jsx(Uf,{voucher:s,setSelected:c})]})})]})}function ox(){const{t}=Ue(),[e,n]=x.useState(1),r=zt(),o=[{id:0,label:t("profile"),icon:"user",pathname:"profile"},{id:1,label:t("rewards"),icon:"edit",pathname:"rewards"},{id:2,label:t("vouchers"),icon:"mail",pathname:"vouchers"}];return x.useEffect(()=>{r(o[e].pathname)},[]),v.jsx(Mf,{children:v.jsxs("div",{className:"relative h-full w-full select-none overflow-auto",children:[v.jsx(vE,{children:o.map(i=>v.jsx(wE,{id:i.id,label:i.label,icon:i.icon,activeTab:e,setActiveTab:n,pathname:i.pathname},i.id))}),v.jsxs(MT,{children:[v.jsx(zT,{}),v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/rewards",element:v.jsx(ZT,{})}),v.jsx(Ye,{path:"/vouchers",element:v.jsx(rx,{})})]})]})]})})}function ix(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(DT,{})}),v.jsx(Ye,{path:"/overview/*",element:v.jsx(ox,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PORTAL})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PORTAL})})]})}function oy(){const{uuid:t}=je(),[e,n]=x.useState(),{isLoading:r,pending:o,mutate:i}=cr({url:`${t}/prepaid`,onData:n});return{prepaidBalance:e,isLoading:r,pending:o,mutate:i}}function ax(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=Xt(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(Tn,{children:v.jsx(X2,{title:a.getDisplayName(),balance:(c==null?void 0:c.balance_in_cents)??0,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function sx({title:t,balance:e,balanceName:n,transaction:r,pending:o}){const{t:i}=Ue(),{portalSession:a}=je(),s=a.inputData.amount_in_cents??0,c=()=>{let d=0;return a.events.filter(f=>Object.values(yo).includes(f.type)).forEach(f=>{d+=f.data.amount_in_cents}),d},u=()=>Math.min(s+c(),e);return v.jsxs(Mt,{children:[t&&v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex h-full flex-col gap-4",children:[v.jsx("div",{className:"rounded-lg bg-core-primary-50 p-4",children:v.jsxs("div",{className:"flex justify-between",children:[v.jsx("p",{className:"font-light text-gray-500",children:n??i("balance")}),v.jsx(bo,{value:e,start:e+c(),currency:a.currency,asCurrency:!0})]})}),v.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 p-6",children:v.jsxs("div",{className:"flex flex-col items-center gap-2 p-4",children:[v.jsx("p",{className:"text-sm font-light text-gray-500",children:i("amountToPay")}),v.jsx("div",{className:"text-5xl font-bold",children:v.jsx(bo,{value:u(),start:s,currency:a.currency,asCurrency:!0})})]})})]})}),v.jsx(rn,{children:v.jsx(nt,{label:i("confirmAndPay",{amount:Si(u(),a.currency)}),className:"w-full",onClick:()=>r==null?void 0:r(-u()),disabled:!s||!!c(),pending:o})})]})}function cx(){const{t}=Ue(),{state:e}=er(),{errorToast:n,successToast:r}=Vt(),{uuid:o,mutate:i}=je(),{contact:a}=ar(),{onCreatePrepaidTransaction:s}=Xt(),{prepaidBalance:c,mutate:u}=oy(),[d,h]=x.useState(!1),f=Dt(),p=l=>{h(!0),f.post(`${o}/prepaid/transaction`,{amount_in_cents:l,contact_identifier_value:(e==null?void 0:e.contactIdentifier)??void 0}).then(g=>{u(),i(),s(g.data.data),r(t("prepaidTransactionCreated"))}).catch(n).finally(()=>h(!1))};return c?v.jsx(Tn,{children:v.jsx(sx,{title:a.getDisplayName(),balance:c.balance_in_cents,balanceName:t("prepaidBalance"),transaction:p,pending:d})}):v.jsx(_r,{})}function ux({setType:t}){const{t:e}=Ue();return v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:e("Choose type")})})}),v.jsx(kt,{children:v.jsxs("div",{className:"flex gap-2",children:[v.jsx(nt,{className:"grow",label:e("pay"),onClick:()=>t(Kt.PAY_PREPAID)}),v.jsx(nt,{className:"grow",label:e("topUp"),onClick:()=>t(Kt.TOP_UP_PREPAID)})]})})]})})}function lx(){const{portalSession:t}=je(),{primaryIdentificationMethod:e}=Xt(),[n,r]=x.useState(t.type);if(!t.contact)return e&&e===Ci.EMAIL?v.jsx(dr,{to:`${Le.PREPAID}/email`}):v.jsx(dr,{to:`${Le.PREPAID}/identifier`});const o=()=>n===Kt.TOP_UP_PREPAID?v.jsx(ax,{}):n===Kt.PAY_PREPAID?v.jsx(cx,{}):v.jsx(ux,{setType:r});return v.jsx(Mf,{children:o()})}function dx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(lx,{})}),v.jsx(Ye,{path:"/email",element:v.jsx(Su,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier",element:v.jsx(Lf,{redirectRoute:Le.PREPAID})}),v.jsx(Ye,{path:"/identifier/link",element:v.jsx(Ff,{redirectRoute:Le.PREPAID})})]})}function fx(){const{t}=Ue(),{errorToast:e}=Vt(),{uuid:n,portalSession:r}=je(),[o,i]=x.useState(""),[a,s]=x.useState(!1),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=()=>{s(!0),p.get(`${n}/vouchers/check/${o}`).then(g=>{g.data.data.contact||r.contact?f(`${o}/redeem`):h(!0)}).catch(e).finally(()=>s(!1))};return x.useEffect(()=>{!c&&o&&l()},[o]),v.jsxs(v.Fragment,{children:[v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:t("voucherCode").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(aa,{data:o,dataSetter:i,setDefer:u,label:t("code")})}),v.jsx(rn,{children:v.jsx(nt,{label:t("submit"),className:"w-full",onClick:l,pending:a})})]})}),v.jsx(Eo,{title:t("noContactLinkedToVoucherTitle"),isOpen:d,onClose:()=>h(!1),primaryAction:{label:t("linkToContact"),action:()=>f(`${o}/identifier`)},secondaryAction:{label:t("cancel"),action:()=>h(!1)},children:v.jsx("p",{children:t("linkVoucherWithCodeToContact",{code:o})})})]})}function hx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{uuid:r}=je(),{onRedeemVoucher:o}=Xt(),{post:i}=ws(),{voucher:a,mutate:s}=K2(n),[c,u]=x.useState(!1),d=Dt(),h=()=>{u(!0),d.post(`${r}/vouchers/redeem`,{code:n}).then(f=>{o==null||o(f.data.data),i(),s()}).catch(e).finally(()=>u(!1))};return a?v.jsx(Tn,{children:v.jsxs(Mt,{children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:"Voucher"})})}),v.jsx(kt,{children:v.jsx("div",{children:v.jsx(Uf,{voucher:a,setSelected:()=>{}})})}),v.jsx(rn,{children:v.jsx(nt,{label:t("redeemVoucher"),className:"w-full",onClick:h,disabled:a.status!==Ea.ACTIVE||c,pending:c})})]})}):v.jsx(_r,{})}function px(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{portalSession:r,mutate:o}=je(),{onContactLink:i}=Xt(),[a,s]=x.useState(""),[c,u]=x.useState(!1),[d,h]=x.useState(!1),f=zt(),p=Dt(),l=m=>p.get(`${r.uuid}/contacts`,{contact_uuid:m}),g=()=>{u(!0),p.put(r.uuid,{contact_identifier_value:a}).then(m=>{i&&l(m.data.data.contact.uuid).then(y=>{i==null||i(y.data.data)}),o().then(()=>f(`${Le.VOUCHER}/${n}/redeem`))}).catch(e).finally(()=>u(!1))};return x.useEffect(()=>{!d&&a&&g()},[a]),v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("scanOrEnterX",{x:"identifier"})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:g,children:v.jsx(aa,{data:a,dataSetter:s,setDefer:h,label:t("contactIdentifier")})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(nt,{label:t("continue"),onClick:g,pending:c}),r.inputData.enable_email_identification&&v.jsx(nt,{label:t("useEmail"),variant:"secondary",onClick:()=>f(`../${n}/email`)})]})})]})})}function gx(){const{t}=Ue(),{errorToast:e}=Vt(),{code:n}=Yr(),{onContactLink:r}=Xt(),{portalSession:o,mutate:i}=je(),{publish:a}=Oa(),[s,c]=x.useState(""),[u,d]=x.useState(!1),[h,f]=x.useState(!1),p=zt(),l=Dt(),g=w=>l.get(`${o.uuid}/contacts`,{contact_uuid:w}),m=()=>{d(!0),l.put(o.uuid,{email:s}).then(w=>{r&&g(w.data.data.contact.uuid).then(b=>{r==null||r(b.data.data)}),i().then(()=>p(`${Le.VOUCHER}/${n}/redeem`))}).catch(w=>{w.response.data.code===Ws.CONTACT_NOT_FOUND&&f(!0)}).finally(()=>d(!1))},y=()=>{d(!0),l.post(`${o.uuid}/contacts`,{email:s}).then(m).catch(e).finally(()=>d(!1))};return x.useEffect(()=>{a("openKeyboard",{inputId:"via-email-address-input",inputValue:""})},[]),v.jsxs(v.Fragment,{children:[v.jsx(Tn,{children:v.jsxs(Mt,{id:fr,children:[v.jsx(Bt,{children:v.jsx("div",{className:"flex h-16 items-center",children:v.jsx("p",{children:t("fillInXBelow",{x:t("emailAddress").toLowerCase()})})})}),v.jsx(kt,{children:v.jsx(si,{onSubmit:()=>s&&!u&&m(),children:v.jsx(Yo,{id:"via-email-address-input",label:t("emailAddress"),autoFocus:!0,onChange:w=>c(w.target.value),beforeIcon:"mail"})})}),v.jsx(rn,{children:v.jsxs("div",{className:"flex flex-col gap-2",children:[v.jsx(nt,{label:t("continue"),className:"w-full",onClick:m,pending:u,disabled:!s||u}),v.jsx(nt,{label:t("useIdentifier"),variant:"secondary",onClick:()=>p(`../${n}/identifier`)})]})})]})}),v.jsx(Eo,{title:`${t("new")} ${t("emailAddress").toLowerCase()}`,isOpen:h,onClose:()=>f(!1),primaryAction:{label:t("confirm"),action:y,disabled:u},secondaryAction:{label:t("cancel"),action:()=>f(!1)},children:v.jsx("p",{children:t("continueWithEmail",{email:s})})})]})}function mx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx(fx,{})}),v.jsx(Ye,{path:":code/redeem",element:v.jsx(hx,{})}),v.jsx(Ye,{path:":code/email",element:v.jsx(gx,{})}),v.jsx(Ye,{path:":code/identifier",element:v.jsx(px,{})})]})}function yx(){return v.jsxs(Wr,{children:[v.jsx(Ye,{path:"/",element:v.jsx($A,{})}),v.jsx(Ye,{path:`${Le.GENERIC}/*`,element:v.jsx(AT,{})}),v.jsx(Ye,{path:`${Le.GIFTCARD}/*`,element:v.jsx(kT,{})}),v.jsx(Ye,{path:`${Le.POINTS_TRANSACTION}/*`,element:v.jsx(RT,{})}),v.jsx(Ye,{path:`${Le.PORTAL}/*`,element:v.jsx(ix,{})}),v.jsx(Ye,{path:`${Le.PREPAID}/*`,element:v.jsx(dx,{})}),v.jsx(Ye,{path:`${Le.VOUCHER}/*`,element:v.jsx(mx,{})})]})}function Gf(t){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gf(t)}function iy(){return typeof XMLHttpRequest=="function"||(typeof XMLHttpRequest>"u"?"undefined":Gf(XMLHttpRequest))==="object"}function vx(t){return!!t&&typeof t.then=="function"}function wx(t){return vx(t)?t:Promise.resolve(t)}function bx(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var qf={exports:{}},Tu={exports:{}},ay;function Ex(){return ay||(ay=1,function(t,e){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof wi<"u"&&wi,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(a){var s=typeof i<"u"&&i||typeof self<"u"&&self||typeof s<"u"&&s,c={searchParams:"URLSearchParams"in s,iterable:"Symbol"in s&&"iterator"in Symbol,blob:"FileReader"in s&&"Blob"in s&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in s,arrayBuffer:"ArrayBuffer"in s};function u(k){return k&&DataView.prototype.isPrototypeOf(k)}if(c.arrayBuffer)var d=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],h=ArrayBuffer.isView||function(k){return k&&d.indexOf(Object.prototype.toString.call(k))>-1};function f(k){if(typeof k!="string"&&(k=String(k)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(k)||k==="")throw new TypeError('Invalid character in header field name: "'+k+'"');return k.toLowerCase()}function p(k){return typeof k!="string"&&(k=String(k)),k}function l(k){var U={next:function(){var z=k.shift();return{done:z===void 0,value:z}}};return c.iterable&&(U[Symbol.iterator]=function(){return U}),U}function g(k){this.map={},k instanceof g?k.forEach(function(U,z){this.append(z,U)},this):Array.isArray(k)?k.forEach(function(U){this.append(U[0],U[1])},this):k&&Object.getOwnPropertyNames(k).forEach(function(U){this.append(U,k[U])},this)}g.prototype.append=function(k,U){k=f(k),U=p(U);var z=this.map[k];this.map[k]=z?z+", "+U:U},g.prototype.delete=function(k){delete this.map[f(k)]},g.prototype.get=function(k){return k=f(k),this.has(k)?this.map[k]:null},g.prototype.has=function(k){return this.map.hasOwnProperty(f(k))},g.prototype.set=function(k,U){this.map[f(k)]=p(U)},g.prototype.forEach=function(k,U){for(var z in this.map)this.map.hasOwnProperty(z)&&k.call(U,this.map[z],z,this)},g.prototype.keys=function(){var k=[];return this.forEach(function(U,z){k.push(z)}),l(k)},g.prototype.values=function(){var k=[];return this.forEach(function(U){k.push(U)}),l(k)},g.prototype.entries=function(){var k=[];return this.forEach(function(U,z){k.push([z,U])}),l(k)},c.iterable&&(g.prototype[Symbol.iterator]=g.prototype.entries);function m(k){if(k.bodyUsed)return Promise.reject(new TypeError("Already read"));k.bodyUsed=!0}function y(k){return new Promise(function(U,z){k.onload=function(){U(k.result)},k.onerror=function(){z(k.error)}})}function w(k){var U=new FileReader,z=y(U);return U.readAsArrayBuffer(k),z}function b(k){var U=new FileReader,z=y(U);return U.readAsText(k),z}function E(k){for(var U=new Uint8Array(k),z=new Array(U.length),te=0;te<U.length;te++)z[te]=String.fromCharCode(U[te]);return z.join("")}function C(k){if(k.slice)return k.slice(0);var U=new Uint8Array(k.byteLength);return U.set(new Uint8Array(k)),U.buffer}function I(){return this.bodyUsed=!1,this._initBody=function(k){this.bodyUsed=this.bodyUsed,this._bodyInit=k,k?typeof k=="string"?this._bodyText=k:c.blob&&Blob.prototype.isPrototypeOf(k)?this._bodyBlob=k:c.formData&&FormData.prototype.isPrototypeOf(k)?this._bodyFormData=k:c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)?this._bodyText=k.toString():c.arrayBuffer&&c.blob&&u(k)?(this._bodyArrayBuffer=C(k.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(k)||h(k))?this._bodyArrayBuffer=C(k):this._bodyText=k=Object.prototype.toString.call(k):this._bodyText="",this.headers.get("content-type")||(typeof k=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):c.searchParams&&URLSearchParams.prototype.isPrototypeOf(k)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},c.blob&&(this.blob=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var k=m(this);return k||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else return this.blob().then(w)}),this.text=function(){var k=m(this);if(k)return k;if(this._bodyBlob)return b(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(E(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},c.formData&&(this.formData=function(){return this.text().then(L)}),this.json=function(){return this.text().then(JSON.parse)},this}var T=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function P(k){var U=k.toUpperCase();return T.indexOf(U)>-1?U:k}function N(k,U){if(!(this instanceof N))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U=U||{};var z=U.body;if(k instanceof N){if(k.bodyUsed)throw new TypeError("Already read");this.url=k.url,this.credentials=k.credentials,U.headers||(this.headers=new g(k.headers)),this.method=k.method,this.mode=k.mode,this.signal=k.signal,!z&&k._bodyInit!=null&&(z=k._bodyInit,k.bodyUsed=!0)}else this.url=String(k);if(this.credentials=U.credentials||this.credentials||"same-origin",(U.headers||!this.headers)&&(this.headers=new g(U.headers)),this.method=P(U.method||this.method||"GET"),this.mode=U.mode||this.mode||null,this.signal=U.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&z)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(z),(this.method==="GET"||this.method==="HEAD")&&(U.cache==="no-store"||U.cache==="no-cache")){var te=/([?&])_=[^&]*/;if(te.test(this.url))this.url=this.url.replace(te,"$1_="+new Date().getTime());else{var oe=/\?/;this.url+=(oe.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}N.prototype.clone=function(){return new N(this,{body:this._bodyInit})};function L(k){var U=new FormData;return k.trim().split("&").forEach(function(z){if(z){var te=z.split("="),oe=te.shift().replace(/\+/g," "),ne=te.join("=").replace(/\+/g," ");U.append(decodeURIComponent(oe),decodeURIComponent(ne))}}),U}function V(k){var U=new g,z=k.replace(/\r?\n[\t ]+/g," ");return z.split("\r").map(function(te){return te.indexOf(`
154
154
  `)===0?te.substr(1,te.length):te}).forEach(function(te){var oe=te.split(":"),ne=oe.shift().trim();if(ne){var se=oe.join(":").trim();U.append(ne,se)}}),U}I.call(N.prototype);function j(k,U){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');U||(U={}),this.type="default",this.status=U.status===void 0?200:U.status,this.ok=this.status>=200&&this.status<300,this.statusText=U.statusText===void 0?"":""+U.statusText,this.headers=new g(U.headers),this.url=U.url||"",this._initBody(k)}I.call(j.prototype),j.prototype.clone=function(){return new j(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new g(this.headers),url:this.url})},j.error=function(){var k=new j(null,{status:0,statusText:""});return k.type="error",k};var W=[301,302,303,307,308];j.redirect=function(k,U){if(W.indexOf(U)===-1)throw new RangeError("Invalid status code");return new j(null,{status:U,headers:{location:k}})},a.DOMException=s.DOMException;try{new a.DOMException}catch{a.DOMException=function(U,z){this.message=U,this.name=z;var te=Error(U);this.stack=te.stack},a.DOMException.prototype=Object.create(Error.prototype),a.DOMException.prototype.constructor=a.DOMException}function q(k,U){return new Promise(function(z,te){var oe=new N(k,U);if(oe.signal&&oe.signal.aborted)return te(new a.DOMException("Aborted","AbortError"));var ne=new XMLHttpRequest;function se(){ne.abort()}ne.onload=function(){var le={status:ne.status,statusText:ne.statusText,headers:V(ne.getAllResponseHeaders()||"")};le.url="responseURL"in ne?ne.responseURL:le.headers.get("X-Request-URL");var _e="response"in ne?ne.response:ne.responseText;setTimeout(function(){z(new j(_e,le))},0)},ne.onerror=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},ne.ontimeout=function(){setTimeout(function(){te(new TypeError("Network request failed"))},0)},ne.onabort=function(){setTimeout(function(){te(new a.DOMException("Aborted","AbortError"))},0)};function we(le){try{return le===""&&s.location.href?s.location.href:le}catch{return le}}ne.open(oe.method,we(oe.url),!0),oe.credentials==="include"?ne.withCredentials=!0:oe.credentials==="omit"&&(ne.withCredentials=!1),"responseType"in ne&&(c.blob?ne.responseType="blob":c.arrayBuffer&&oe.headers.get("Content-Type")&&oe.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(ne.responseType="arraybuffer")),U&&typeof U.headers=="object"&&!(U.headers instanceof g)?Object.getOwnPropertyNames(U.headers).forEach(function(le){ne.setRequestHeader(le,p(U.headers[le]))}):oe.headers.forEach(function(le,_e){ne.setRequestHeader(_e,le)}),oe.signal&&(oe.signal.addEventListener("abort",se),ne.onreadystatechange=function(){ne.readyState===4&&oe.signal.removeEventListener("abort",se)}),ne.send(typeof oe._bodyInit>"u"?null:oe._bodyInit)})}return q.polyfill=!0,s.fetch||(s.fetch=q,s.Headers=g,s.Request=N,s.Response=j),a.Headers=g,a.Request=N,a.Response=j,a.fetch=q,a})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;e=o.fetch,e.default=o.fetch,e.fetch=o.fetch,e.Headers=o.Headers,e.Request=o.Request,e.Response=o.Response,t.exports=e}(Tu,Tu.exports)),Tu.exports}(function(t,e){var n;if(typeof fetch=="function"&&(typeof wi<"u"&&wi.fetch?n=wi.fetch:typeof window<"u"&&window.fetch?n=window.fetch:n=fetch),typeof bx<"u"&&typeof window>"u"){var r=n||Ex();r.default&&(r=r.default),e.default=r,t.exports=e.default}})(qf,qf.exports);var sy=qf.exports;const cy=Fu(sy),uy=Zy({__proto__:null,default:cy},[sy]);function ly(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function dy(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?ly(Object(n),!0).forEach(function(r){Cx(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ly(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cx(t,e,n){return e=_x(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _x(t){var e=Ax(t,"string");return gi(e)=="symbol"?e:e+""}function Ax(t,e){if(gi(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(gi(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function gi(t){"@babel/helpers - typeof";return gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gi(t)}var io;typeof fetch=="function"&&(typeof global<"u"&&global.fetch?io=global.fetch:typeof window<"u"&&window.fetch?io=window.fetch:io=fetch);var Cs;iy()&&(typeof global<"u"&&global.XMLHttpRequest?Cs=global.XMLHttpRequest:typeof window<"u"&&window.XMLHttpRequest&&(Cs=window.XMLHttpRequest));var xu;typeof ActiveXObject=="function"&&(typeof global<"u"&&global.ActiveXObject?xu=global.ActiveXObject:typeof window<"u"&&window.ActiveXObject&&(xu=window.ActiveXObject)),!io&&uy&&!Cs&&!xu&&(io=cy||uy),typeof io!="function"&&(io=void 0);var Hf=function(e,n){if(n&&gi(n)==="object"){var r="";for(var o in n)r+="&"+encodeURIComponent(o)+"="+encodeURIComponent(n[o]);if(!r)return e;e=e+(e.indexOf("?")!==-1?"&":"?")+r.slice(1)}return e},fy=function(e,n,r,o){var i=function(c){if(!c.ok)return r(c.statusText||"Error",{status:c.status});c.text().then(function(u){r(null,{status:c.status,data:u})}).catch(r)};if(o){var a=o(e,n);if(a instanceof Promise){a.then(i).catch(r);return}}typeof fetch=="function"?fetch(e,n).then(i).catch(r):io(e,n).then(i).catch(r)},hy=!1,Sx=function(e,n,r,o){e.queryStringParams&&(n=Hf(n,e.queryStringParams));var i=dy({},typeof e.customHeaders=="function"?e.customHeaders():e.customHeaders);typeof window>"u"&&typeof global<"u"&&typeof global.process<"u"&&global.process.versions&&global.process.versions.node&&(i["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),r&&(i["Content-Type"]="application/json");var a=typeof e.requestOptions=="function"?e.requestOptions(r):e.requestOptions,s=dy({method:r?"POST":"GET",body:r?e.stringify(r):void 0,headers:i},hy?{}:a),c=typeof e.alternateFetch=="function"&&e.alternateFetch.length>=1?e.alternateFetch:void 0;try{fy(n,s,o,c)}catch(u){if(!a||Object.keys(a).length===0||!u.message||u.message.indexOf("not implemented")<0)return o(u);try{Object.keys(a).forEach(function(d){delete s[d]}),fy(n,s,o,c),hy=!0}catch(d){o(d)}}},Ix=function(e,n,r,o){r&&gi(r)==="object"&&(r=Hf("",r).slice(1)),e.queryStringParams&&(n=Hf(n,e.queryStringParams));try{var i;Cs?i=new Cs:i=new xu("MSXML2.XMLHTTP.3.0"),i.open(r?"POST":"GET",n,1),e.crossDomain||i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.withCredentials=!!e.withCredentials,r&&i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.overrideMimeType&&i.overrideMimeType("application/json");var a=e.customHeaders;if(a=typeof a=="function"?a():a,a)for(var s in a)i.setRequestHeader(s,a[s]);i.onreadystatechange=function(){i.readyState>3&&o(i.status>=400?i.statusText:null,{status:i.status,data:i.responseText})},i.send(r)}catch(c){console&&console.log(c)}},Tx=function(e,n,r,o){if(typeof r=="function"&&(o=r,r=void 0),o=o||function(){},io&&n.indexOf("file:")!==0)return Sx(e,n,r,o);if(iy()||typeof ActiveXObject=="function")return Ix(e,n,r,o);o(new Error("No fetch and no xhr implementation found!"))};function sa(t){"@babel/helpers - typeof";return sa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sa(t)}function py(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(t,o).enumerable})),n.push.apply(n,r)}return n}function $f(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?py(Object(n),!0).forEach(function(r){gy(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):py(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function xx(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ox(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,my(r.key),r)}}function Px(t,e,n){return e&&Ox(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function gy(t,e,n){return e=my(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function my(t){var e=kx(t,"string");return sa(e)=="symbol"?e:e+""}function kx(t,e){if(sa(t)!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var r=n.call(t,e||"default");if(sa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Bx=function(){return{loadPath:"/locales/{{lng}}/{{ns}}.json",addPath:"/locales/add/{{lng}}/{{ns}}",parse:function(n){return JSON.parse(n)},stringify:JSON.stringify,parsePayload:function(n,r,o){return gy({},r,o||"")},parseLoadPayload:function(n,r){},request:Tx,reloadInterval:typeof window<"u"?!1:60*60*1e3,customHeaders:{},queryStringParams:{},crossDomain:!1,withCredentials:!1,overrideMimeType:!1,requestOptions:{mode:"cors",credentials:"same-origin",cache:"default"}}},yy=function(){function t(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};xx(this,t),this.services=e,this.options=n,this.allOptions=r,this.type="backend",this.init(e,n,r)}return Px(t,[{key:"init",value:function(n){var r=this,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(this.services=n,this.options=$f($f($f({},Bx()),this.options||{}),o),this.allOptions=i,this.services&&this.options.reloadInterval){var a=setInterval(function(){return r.reload()},this.options.reloadInterval);sa(a)==="object"&&typeof a.unref=="function"&&a.unref()}}},{key:"readMulti",value:function(n,r,o){this._readAny(n,n,r,r,o)}},{key:"read",value:function(n,r,o){this._readAny([n],n,[r],r,o)}},{key:"_readAny",value:function(n,r,o,i,a){var s=this,c=this.options.loadPath;typeof this.options.loadPath=="function"&&(c=this.options.loadPath(n,o)),c=wx(c),c.then(function(u){if(!u)return a(null,{});var d=s.services.interpolator.interpolate(u,{lng:n.join("+"),ns:o.join("+")});s.loadUrl(d,a,r,i)})}},{key:"loadUrl",value:function(n,r,o,i){var a=this,s=typeof o=="string"?[o]:o,c=typeof i=="string"?[i]:i,u=this.options.parseLoadPayload(s,c);this.options.request(this.options,n,u,function(d,h){if(h&&(h.status>=500&&h.status<600||!h.status))return r("failed loading "+n+"; status code: "+h.status,!0);if(h&&h.status>=400&&h.status<500)return r("failed loading "+n+"; status code: "+h.status,!1);if(!h&&d&&d.message&&d.message.indexOf("Failed to fetch")>-1)return r("failed loading "+n+": "+d.message,!0);if(d)return r(d,!1);var f,p;try{typeof h.data=="string"?f=a.options.parse(h.data,o,i):f=h.data}catch{p="failed parsing "+n+" to json"}if(p)return r(p,!1);r(null,f)})}},{key:"create",value:function(n,r,o,i,a){var s=this;if(this.options.addPath){typeof n=="string"&&(n=[n]);var c=this.options.parsePayload(r,o,i),u=0,d=[],h=[];n.forEach(function(f){var p=s.options.addPath;typeof s.options.addPath=="function"&&(p=s.options.addPath(f,r));var l=s.services.interpolator.interpolate(p,{lng:f,ns:r});s.options.request(s.options,l,c,function(g,m){u+=1,d.push(g),h.push(m),u===n.length&&typeof a=="function"&&a(d,h)})})}}},{key:"reload",value:function(){var n=this,r=this.services,o=r.backendConnector,i=r.languageUtils,a=r.logger,s=o.language;if(!(s&&s.toLowerCase()==="cimode")){var c=[],u=function(h){var f=i.toResolveHierarchy(h);f.forEach(function(p){c.indexOf(p)<0&&c.push(p)})};u(s),this.allOptions.preload&&this.allOptions.preload.forEach(function(d){return u(d)}),c.forEach(function(d){n.allOptions.ns.forEach(function(h){o.read(d,h,"read",null,null,function(f,p){f&&a.warn("loading namespace ".concat(h," for language ").concat(d," failed"),f),!f&&p&&a.log("loaded namespace ".concat(h," for language ").concat(d),p),o.loaded("".concat(d,"|").concat(h),f,p)})})})}}}])}();yy.type="backend";const{slice:Nx,forEach:Rx}=[];function Dx(t){return Rx.call(Nx.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}const vy=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Mx=(t,e,n)=>{const r=n||{};r.path=r.path||"/";const o=encodeURIComponent(e);let i=`${t}=${o}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!vy.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!vy.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return i},wy={create(t,e,n,r){let o=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(o.expires=new Date,o.expires.setTime(o.expires.getTime()+n*60*1e3)),r&&(o.domain=r),document.cookie=Mx(t,encodeURIComponent(e),o)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let o=n[r];for(;o.charAt(0)===" ";)o=o.substring(1,o.length);if(o.indexOf(e)===0)return o.substring(e.length,o.length)}return null},remove(t){this.create(t,"",-1)}};var Lx={name:"cookie",lookup(t){let{lookupCookie:e}=t;if(e&&typeof document<"u")return wy.read(e)||void 0},cacheUserLanguage(t,e){let{lookupCookie:n,cookieMinutes:r,cookieDomain:o,cookieOptions:i}=e;n&&typeof document<"u"&&wy.create(n,t,r,o,i)}},Fx={name:"querystring",lookup(t){var r;let{lookupQuerystring:e}=t,n;if(typeof window<"u"){let{search:o}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(o=window.location.hash.substring(window.location.hash.indexOf("?")));const a=o.substring(1).split("&");for(let s=0;s<a.length;s++){const c=a[s].indexOf("=");c>0&&a[s].substring(0,c)===e&&(n=a[s].substring(c+1))}}return n}};let _s=null;const by=()=>{if(_s!==null)return _s;try{_s=window!=="undefined"&&window.localStorage!==null;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{_s=!1}return _s};var jx={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&by())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&by()&&window.localStorage.setItem(n,t)}};let As=null;const Ey=()=>{if(As!==null)return As;try{As=window!=="undefined"&&window.sessionStorage!==null;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{As=!1}return As};var Vx={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&Ey())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&Ey()&&window.sessionStorage.setItem(n,t)}},Ux={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:o}=navigator;if(n)for(let i=0;i<n.length;i++)e.push(n[i]);r&&e.push(r),o&&e.push(o)}return e.length>0?e:void 0}},Gx={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},qx={name:"path",lookup(t){var o;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(o=n[typeof e=="number"?e:0])==null?void 0:o.replace("/",""):void 0}},Hx={name:"subdomain",lookup(t){var o,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(o=window.location)==null?void 0:o.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};function $x(){return{order:["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"],lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t}}class Cy{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e||{languageUtils:{}},this.options=Dx(n,this.options||{},$x()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=o=>o.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Lx),this.addDetector(Fx),this.addDetector(jx),this.addDetector(Vx),this.addDetector(Ux),this.addDetector(Gx),this.addDetector(qx),this.addDetector(Hx)}addDetector(e){return this.detectors[e.name]=e,this}detect(e){e||(e=this.options.order);let n=[];return e.forEach(r=>{if(this.detectors[r]){let o=this.detectors[r].lookup(this.options);o&&typeof o=="string"&&(o=[o]),o&&(n=n.concat(o))}}),n=n.map(r=>this.options.convertDetectedLanguage(r)),this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e,n){n||(n=this.options.caches),n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}Cy.type="languageDetector",nn.use(yy).use(Cy).use(x4).init({fallbackLng:"en",lng:navigator.language&&navigator.language.substring(0,2),interpolation:{escapeValue:!1},backend:{loadPath:"https://translations.piggy.eu/portal-sessions/{{lng}}.json"}});function _y(){const{uuid:t,portalSession:e}=je(),[n,r]=x.useState();return cr({url:`${t}/brand-kit`,onData:r}),x.useEffect(()=>{n&&wb(n)},[n]),v.jsx(x.StrictMode,{children:v.jsxs(qA,{children:[v.jsx(Y3,{children:v.jsx(yx,{})}),v.jsx(Lb,{enabled:e.inputData.enable_on_screen_keyboard}),v.jsx(p4,{className:"lg:top-14"})]},t)})}function Ay(t){const{uuid:e,portalSession:n,error:r}=je();return n.uuid?v.jsx(Im.Provider,{value:{...t,cameraService:n.inputData.camera_service,cameraFacingMode:n.inputData.facing_mode,primaryIdentificationMethod:n.inputData.primary_identification_method},children:t.children}):v.jsx(_r,{message:r&&`No portal session found with uuid: ${e}.`})}function Yx(t){const{portalSession:e}=o3(t);return e?v.jsx(Vu.Provider,{value:{apiKey:t.apiKey,host:t.host},children:v.jsx(b1,{uuid:e.uuid,children:v.jsx(Ay,{...t,children:v.jsx(_y,{})})})}):v.jsx(_r,{})}const Wx="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.37482%209.55838C0.802045%2011.696%200.887351%2013.9567%201.61959%2016.045C2.35183%2018.1334%203.69695%2019.9524%205.47921%2021.2642C7.26146%2022.5761%209.39798%2023.3199%2011.6096%2023.3985C13.8212%2023.477%2016.0051%2022.8866%2017.876%2021.7045C19.7468%2020.5223%2021.2175%2018.8034%2022.0961%2016.7722C22.9746%2014.7411%2023.2201%2012.4921%2022.8004%2010.3193C22.3807%208.1464%2021.3154%206.15066%2019.7436%204.59277C18.1718%203.03489%2016.1667%201.98732%2013.9902%201.58693M7.14096%202.53681C5.21049%203.48732%203.60119%204.98315%202.51232%206.8391M10.7049%201.48193C10.452%201.51191%2010.2003%201.55066%209.95012%201.59811M18.1995%2015.656C18.757%2014.5927%2019.0317%2013.4039%2018.9971%2012.2038C18.9625%2011.0037%2018.6198%209.83263%2018.002%208.8032C17.3842%207.77377%2016.512%206.92055%2015.4692%206.32553C14.4264%205.73051%2013.2481%205.4137%2012.0476%205.40554C10.847%205.39739%209.66449%205.69816%208.61372%206.27895C7.56295%206.85974%206.67923%207.70104%206.04747%208.72198C5.41572%209.74292%205.05717%2010.9092%205.00628%2012.1087C4.9554%2013.3082%205.21389%2014.5007%205.75691%2015.5714M9.15764%2013.3648C9.00624%2012.9162%208.96314%2012.4382%209.03189%2011.9698C9.10064%2011.5014%209.27926%2011.0559%209.55317%2010.6697C9.82708%2010.2836%2010.1885%209.96774%2010.6079%209.74803C11.0272%209.52832%2011.4926%209.41098%2011.966%209.4056C12.4394%209.40023%2012.9074%209.50697%2013.3316%209.71709C13.7559%209.92722%2014.1244%2010.2348%2014.407%2010.6146C14.6896%2010.9944%2014.8783%2011.4358%2014.9576%2011.9025C15.037%2012.3692%2015.0048%2012.8481%2014.8636%2013.3M14.0993%2010.2622C14.0043%2010.1691%2013.9032%2010.0825%2013.7967%2010.0028M8.2478%2018.3147C9.32147%2018.9965%2010.5606%2019.3728%2011.832%2019.4033C13.1035%2019.4339%2014.3592%2019.1174%2015.4644%2018.488'%20stroke='%233430FF'%20stroke-width='2'%20stroke-linecap='round'/%3e%3c/svg%3e";function Kx({message:t}){return v.jsxs("div",{className:"flex h-screen flex-col justify-center gap-12 text-center",children:[v.jsxs("div",{className:"flex items-center justify-center gap-3",children:[v.jsx("img",{alt:"logo",src:Wx,className:"z-10 h-16 w-16 hover:animate-spin"}),v.jsxs("p",{className:"z-10 text-7xl font-semibold tracking-wide text-gray-600",children:["Welcome to ",v.jsx("span",{className:"italic",children:"PortalSessions"})]})]}),v.jsx("p",{className:"text-core-red-500",children:t})]})}function zx({uuid:t,host:e}){return t?v.jsx(Vu.Provider,{value:{host:e},children:v.jsx(b1,{uuid:t,children:v.jsx(Ay,{children:v.jsx(_y,{})})})}):v.jsx(Kx,{message:"No uuid provided."})}const Xx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M8 4.75V8.25M16 4.75V8.25M7.75 10.75H16.25M6.75 19.25H17.25C18.3546 19.25 19.25 18.3546 19.25 17.25V8.75C19.25 7.64543 18.3546 6.75 17.25 6.75H6.75C5.64543 6.75 4.75 7.64543 4.75 8.75V17.25C4.75 18.3546 5.64543 19.25 6.75 19.25Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),Qx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{height:24,viewBox:"0 0 24 24",width:24,xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("path",{d:"m21.25 7.5c.3796958 0 .693491.28215388.7431534.64822944l.0068466.10177056v8.5c0 1.7330315-1.3564548 3.1492459-3.0655761 3.2448552l-.1844239.0051448h-12.689l.71933009.7196699c.26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184c-.26626657.2662665-.68293025.2904726-.97654174.0726181l-.08411844-.0726181-2-2-.06339799-.0720275c-.00244939-.0031685-.00487398-.0063571-.00727348-.0095656l.07067147.0815931c-.03705327-.0370533-.06941902-.077019-.09709724-.1191603-.01316484-.0201549-.025545-.0411423-.03690171-.0627516-.00483354-.0091218-.00919014-.0178526-.01336588-.0266478-.01274712-.0267885-.02425172-.0552483-.03400215-.0845099-.00225837-.0069437-.00418282-.0130149-.00602813-.019105-.02092163-.0684786-.0322748-.1419912-.0322748-.2181555 0-.0383922.00288471-.0761107.00844919-.1129505.00180466-.0115676.0038603-.0232773.00619514-.0349422.00494363-.0250031.01111685-.0492994.01844184-.073091.00362656-.0116598.00765847-.0237092.01200456-.0356703.00848426-.0232976.01778613-.0453662.02808241-.0668678.00549219-.0116011.01179514-.0239381.01846187-.0361292.01323523-.0240158.02734042-.0467392.04258121-.0686124.00392129-.0057417.00832657-.0118713.01283554-.0179483.0251194-.0332177.04801831-.0595185.07261815-.0841184l2-2c.29289322-.2928932.76776696-.2928932 1.06066018 0 .26626656.2662666.29047261.6829303.07261815.9765418l-.07261815.0841184-.72033009.7196699h12.69c.9181734 0 1.6711923-.7071103 1.7441988-1.6064728l.0058012-.1435272v-8.5c0-.41421356.3357864-.75.75-.75zm-3.0537883-5.35294824.0841184.07261815 2 2c.0254481.02544812.049076.05271652.0706715.08159313l-.0706715-.08159313c.0370533.03705328.069419.07701901.0970972.1191603.0131649.02015493.025545.04114226.0369017.06275154.0048336.00912187.0091902.01785262.0133659.02664784.0127471.02678853.0242517.0552483.0340022.08450994.0022583.00694369.0041828.01301489.0060281.01910493.0209216.06847868.0322748.14199127.0322748.21815554 0 .03839224-.0028847.07611073-.0084492.11295053-.0014988.0095454-.0031606.01924362-.0050138.02891241-.0051364.02710922-.0117072.05340972-.0196232.07912072-.0036265.0116598-.0076584.02370928-.0120045.03567032-.0084843.02329763-.0177862.04536621-.0280824.06686781-.0054922.01160108-.0117952.02393815-.0184619.03612923-.0132352.02401575-.0273404.04673917-.0425812.06861233-.0039213.00574174-.0083266.01187138-.0128356.0179483-.023778.03144192-.0451015.05615345-.0679264.07938506l-.0046917.00473338-2 2c-.2928932.29289321-.767767.29289321-1.0606602 0-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844.7183301-.71966991h-12.688c-.9181734 0-1.67119234.70711027-1.7441988 1.60647279l-.0058012.14352721v8.5c0 .4142136-.33578644.75-.75.75-.37969577 0-.69349096-.2821539-.74315338-.6482294l-.00684662-.1017706v-8.5c0-1.73303146 1.35645477-3.14924593 3.06557609-3.24485521l.18442391-.00514479h12.689l-.7193301-.71966991c-.2662665-.26626657-.2904726-.68293025-.0726181-.97654174l.0726181-.08411844c.2662666-.26626656.6829303-.29047261.9765418-.07261815zm-6.1962117 5.85294824c2.209139 0 4 1.790861 4 4s-1.790861 4-4 4-4-1.790861-4-4 1.790861-4 4-4zm0 1.5c-1.3807119 0-2.5 1.1192881-2.5 2.5s1.1192881 2.5 2.5 2.5 2.5-1.1192881 2.5-2.5-1.1192881-2.5-2.5-2.5z",fill:"#212121"}))},Symbol.toStringTag,{value:"Module"})),Jx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M13.25 8.75L9.75 12L13.25 15.25",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),Zx=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M17.25 6.75L6.75 17.25M6.75 6.75L17.25 17.25",strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),eO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("path",{d:"M4.7002 4.70016L11.2999 11.2998",stroke:"#000",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M11.2998 4.70016L4.70014 11.2998",stroke:"#000",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),tO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("circle",{cx:12,cy:12,r:7.25,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M14.25 8.75H11.375C10.4775 8.75 9.75 9.47754 9.75 10.375V10.375C9.75 11.2725 10.4775 12 11.375 12H12.625C13.5225 12 14.25 12.7275 14.25 13.625V13.625C14.25 14.5225 13.5225 15.25 12.625 15.25H9.75"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 7.75V8.25"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 15.75V16.25"}))},Symbol.toStringTag,{value:"Module"})),nO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M19.25 19.25H13.75M9 18.25L4.75 19.25L5.75 15L15.0429 5.70711C15.4334 5.31658 16.0666 5.31658 16.4571 5.70711L18.2929 7.54289C18.6834 7.93342 18.6834 8.56658 18.2929 8.95711L9 18.25Z",strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),rO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M6.75024 19.2502H17.2502C18.3548 19.2502 19.2502 18.3548 19.2502 17.2502V9.75025L12.0002 4.75024L4.75024 9.75025V17.2502C4.75024 18.3548 5.64568 19.2502 6.75024 19.2502Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M9.74963 15.7493C9.74963 14.6447 10.6451 13.7493 11.7496 13.7493H12.2496C13.3542 13.7493 14.2496 14.6447 14.2496 15.7493V19.2493H9.74963V15.7493Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),oO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 13V15"}),ce.createElement("circle",{cx:12,cy:9,r:.5}),ce.createElement("circle",{cx:12,cy:12,r:7.25,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5}))},Symbol.toStringTag,{value:"Module"})),iO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",...t},ce.createElement("path",{d:"M5.5 6.5L12 12.25L18.5 6.5M6.75 18.25H17.25C18.3546 18.25 19.25 17.3546 19.25 16.25V7.75C19.25 6.64543 18.3546 5.75 17.25 5.75H6.75C5.64543 5.75 4.75 6.64543 4.75 7.75V16.25C4.75 17.3546 5.64543 18.25 6.75 18.25Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),aO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_17_95)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#FEF3F2"}),ce.createElement("path",{d:"M12.0003 12L20.0003 20M12.0003 20L20.0003 12",stroke:"#E02731",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_17_95"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),sO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_15_20)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#E7FBF4"}),ce.createElement("path",{d:"M10.6668 17.3333L14.6668 20L21.3335 12",stroke:"#039855",strokeWidth:1.6875,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_15_20"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0V0C24.8366 0 32 7.16344 32 16V16C32 24.8366 24.8366 32 16 32V32C7.16344 32 0 24.8366 0 16V16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),cO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:32,height:32,viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t},ce.createElement("g",{clipPath:"url(#clip0_17_99)"},ce.createElement("rect",{width:32,height:32,rx:4,fill:"#FFFAEB"}),ce.createElement("path",{d:"M16.0002 17.3333V13.3333M16.0002 20V20.0067M23.0353 19.3333L17.942 10.456C17.0833 8.95867 14.9167 8.95867 14.058 10.456L8.96533 19.3333C8.11266 20.8187 9.18933 22.6667 10.9073 22.6667H21.0933C22.8107 22.6667 23.8873 20.8187 23.0353 19.3333Z",stroke:"#CFAA25",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})),ce.createElement("defs",null,ce.createElement("clipPath",{id:"clip0_17_99"},ce.createElement("path",{d:"M0 16C0 7.16344 7.16344 0 16 0C24.8366 0 32 7.16344 32 16C32 24.8366 24.8366 32 16 32C7.16344 32 0 24.8366 0 16Z",fill:"white"}))))},Symbol.toStringTag,{value:"Module"})),uO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M13.1191 5.61336C13.0508 5.11856 12.6279 4.75 12.1285 4.75H11.8715C11.3721 4.75 10.9492 5.11856 10.8809 5.61336L10.7938 6.24511C10.7382 6.64815 10.4403 6.96897 10.0622 7.11922C10.006 7.14156 9.95021 7.16484 9.89497 7.18905C9.52217 7.3524 9.08438 7.3384 8.75876 7.09419L8.45119 6.86351C8.05307 6.56492 7.49597 6.60451 7.14408 6.9564L6.95641 7.14408C6.60452 7.49597 6.56492 8.05306 6.86351 8.45118L7.09419 8.75876C7.33841 9.08437 7.3524 9.52216 7.18905 9.89497C7.16484 9.95021 7.14156 10.006 7.11922 10.0622C6.96897 10.4403 6.64815 10.7382 6.24511 10.7938L5.61336 10.8809C5.11856 10.9492 4.75 11.372 4.75 11.8715V12.1285C4.75 12.6279 5.11856 13.0508 5.61336 13.1191L6.24511 13.2062C6.64815 13.2618 6.96897 13.5597 7.11922 13.9378C7.14156 13.994 7.16484 14.0498 7.18905 14.105C7.3524 14.4778 7.3384 14.9156 7.09419 15.2412L6.86351 15.5488C6.56492 15.9469 6.60451 16.504 6.9564 16.8559L7.14408 17.0436C7.49597 17.3955 8.05306 17.4351 8.45118 17.1365L8.75876 16.9058C9.08437 16.6616 9.52216 16.6476 9.89496 16.811C9.95021 16.8352 10.006 16.8584 10.0622 16.8808C10.4403 17.031 10.7382 17.3519 10.7938 17.7549L10.8809 18.3866C10.9492 18.8814 11.3721 19.25 11.8715 19.25H12.1285C12.6279 19.25 13.0508 18.8814 13.1191 18.3866L13.2062 17.7549C13.2618 17.3519 13.5597 17.031 13.9378 16.8808C13.994 16.8584 14.0498 16.8352 14.105 16.8109C14.4778 16.6476 14.9156 16.6616 15.2412 16.9058L15.5488 17.1365C15.9469 17.4351 16.504 17.3955 16.8559 17.0436L17.0436 16.8559C17.3955 16.504 17.4351 15.9469 17.1365 15.5488L16.9058 15.2412C16.6616 14.9156 16.6476 14.4778 16.811 14.105C16.8352 14.0498 16.8584 13.994 16.8808 13.9378C17.031 13.5597 17.3519 13.2618 17.7549 13.2062L18.3866 13.1191C18.8814 13.0508 19.25 12.6279 19.25 12.1285V11.8715C19.25 11.3721 18.8814 10.9492 18.3866 10.8809L17.7549 10.7938C17.3519 10.7382 17.031 10.4403 16.8808 10.0622C16.8584 10.006 16.8352 9.95021 16.8109 9.89496C16.6476 9.52216 16.6616 9.08437 16.9058 8.75875L17.1365 8.4512C17.4351 8.05308 17.3955 7.49599 17.0436 7.1441L16.8559 6.95642C16.504 6.60453 15.9469 6.56494 15.5488 6.86353L15.2412 7.09419C14.9156 7.33841 14.4778 7.3524 14.105 7.18905C14.0498 7.16484 13.994 7.14156 13.9378 7.11922C13.5597 6.96897 13.2618 6.64815 13.2062 6.24511L13.1191 5.61336Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),ce.createElement("path",{d:"M13.25 12C13.25 12.6904 12.6904 13.25 12 13.25C11.3096 13.25 10.75 12.6904 10.75 12C10.75 11.3096 11.3096 10.75 12 10.75C12.6904 10.75 13.25 11.3096 13.25 12Z",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))},Symbol.toStringTag,{value:"Module"})),lO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.25 7.75H5.75V16.75L4.75 19.25H19.25L18.25 16.75V7.75Z"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M18.25 7.75L16.25 4.75H7.75L5.75 7.75"}),ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M9.75 10.75V11.75C9.75 12.9926 10.7574 14 12 14V14C13.2426 14 14.25 12.9926 14.25 11.75V10.75"}))},Symbol.toStringTag,{value:"Module"})),dO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{width:24,height:24,fill:"none",viewBox:"0 0 24 24",...t},ce.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M12 4.75L13.75 10.25H19.25L14.75 13.75L16.25 19.25L12 15.75L7.75 19.25L9.25 13.75L4.75 10.25H10.25L12 4.75Z"}))},Symbol.toStringTag,{value:"Module"})),fO=Object.freeze(Object.defineProperty({__proto__:null,default:t=>ce.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",...t},ce.createElement("path",{d:"M15.25 8C15.25 9.79493 13.7949 11.25 12 11.25C10.205 11.25 8.74997 9.79493 8.74997 8C8.74997 6.20507 10.205 4.75 12 4.75C13.7949 4.75 15.25 6.20507 15.25 8Z"}),ce.createElement("path",{d:"M6.84748 19.25H17.1525C18.2944 19.25 19.174 18.2681 18.6407 17.2584C17.8563 15.7731 16.068 14 12 14C7.93198 14 6.14364 15.7731 5.35921 17.2584C4.82594 18.2681 5.70556 19.25 6.84748 19.25Z"}))},Symbol.toStringTag,{value:"Module"})),hO=Object.freeze(Object.defineProperty({__proto__:null,createWorker:()=>new Worker(URL.createObjectURL(new Blob([`class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}
155
155
  class A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error("Wrong buffer size");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}
156
156
  class ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error("Cannot read "+a.toString()+" bits");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,