tempest.games 0.1.19 → 0.1.21

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,46 +0,0 @@
1
- var Ap=Object.defineProperty;var Ip=(e,t,n)=>t in e?Ap(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var x=(e,t,n)=>Ip(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var _d={exports:{}},mo={},wd={exports:{}},Z={};/**
2
- * @license React
3
- * react.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Vs=Symbol.for("react.element"),Mp=Symbol.for("react.portal"),Pp=Symbol.for("react.fragment"),jp=Symbol.for("react.strict_mode"),$p=Symbol.for("react.profiler"),Lp=Symbol.for("react.provider"),zp=Symbol.for("react.context"),Dp=Symbol.for("react.forward_ref"),Up=Symbol.for("react.suspense"),Bp=Symbol.for("react.memo"),Fp=Symbol.for("react.lazy"),Yu=Symbol.iterator;function Vp(e){return e===null||typeof e!="object"?null:(e=Yu&&e[Yu]||e["@@iterator"],typeof e=="function"?e:null)}var kd={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Sd=Object.assign,xd={};function Pr(e,t,n){this.props=e,this.context=t,this.refs=xd,this.updater=n||kd}Pr.prototype.isReactComponent={};Pr.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Pr.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Ed(){}Ed.prototype=Pr.prototype;function Al(e,t,n){this.props=e,this.context=t,this.refs=xd,this.updater=n||kd}var Il=Al.prototype=new Ed;Il.constructor=Al;Sd(Il,Pr.prototype);Il.isPureReactComponent=!0;var Gu=Array.isArray,Td=Object.prototype.hasOwnProperty,Ml={current:null},Cd={key:!0,ref:!0,__self:!0,__source:!0};function Rd(e,t,n){var r,s={},i=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)Td.call(t,r)&&!Cd.hasOwnProperty(r)&&(s[r]=t[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1<a){for(var l=Array(a),u=0;u<a;u++)l[u]=arguments[u+2];s.children=l}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)s[r]===void 0&&(s[r]=a[r]);return{$$typeof:Vs,type:e,key:i,ref:o,props:s,_owner:Ml.current}}function Kp(e,t){return{$$typeof:Vs,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Pl(e){return typeof e=="object"&&e!==null&&e.$$typeof===Vs}function Zp(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Xu=/\/+/g;function Do(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Zp(""+e.key):t.toString(36)}function vi(e,t,n,r,s){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case Vs:case Mp:o=!0}}if(o)return o=e,s=s(o),e=r===""?"."+Do(o,0):r,Gu(s)?(n="",e!=null&&(n=e.replace(Xu,"$&/")+"/"),vi(s,t,n,"",function(u){return u})):s!=null&&(Pl(s)&&(s=Kp(s,n+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(Xu,"$&/")+"/")+e)),t.push(s)),1;if(o=0,r=r===""?".":r+":",Gu(e))for(var a=0;a<e.length;a++){i=e[a];var l=r+Do(i,a);o+=vi(i,t,n,l,s)}else if(l=Vp(e),typeof l=="function")for(e=l.call(e),a=0;!(i=e.next()).done;)i=i.value,l=r+Do(i,a++),o+=vi(i,t,n,l,s);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Ys(e,t,n){if(e==null)return e;var r=[],s=0;return vi(e,r,"","",function(i){return t.call(n,i,s++)}),r}function Wp(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ue={current:null},_i={transition:null},Hp={ReactCurrentDispatcher:Ue,ReactCurrentBatchConfig:_i,ReactCurrentOwner:Ml};function Od(){throw Error("act(...) is not supported in production builds of React.")}Z.Children={map:Ys,forEach:function(e,t,n){Ys(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Ys(e,function(){t++}),t},toArray:function(e){return Ys(e,function(t){return t})||[]},only:function(e){if(!Pl(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Z.Component=Pr;Z.Fragment=Pp;Z.Profiler=$p;Z.PureComponent=Al;Z.StrictMode=jp;Z.Suspense=Up;Z.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hp;Z.act=Od;Z.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=Sd({},e.props),s=e.key,i=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,o=Ml.current),t.key!==void 0&&(s=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(l in t)Td.call(t,l)&&!Cd.hasOwnProperty(l)&&(r[l]=t[l]===void 0&&a!==void 0?a[l]:t[l])}var l=arguments.length-2;if(l===1)r.children=n;else if(1<l){a=Array(l);for(var u=0;u<l;u++)a[u]=arguments[u+2];r.children=a}return{$$typeof:Vs,type:e.type,key:s,ref:i,props:r,_owner:o}};Z.createContext=function(e){return e={$$typeof:zp,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Lp,_context:e},e.Consumer=e};Z.createElement=Rd;Z.createFactory=function(e){var t=Rd.bind(null,e);return t.type=e,t};Z.createRef=function(){return{current:null}};Z.forwardRef=function(e){return{$$typeof:Dp,render:e}};Z.isValidElement=Pl;Z.lazy=function(e){return{$$typeof:Fp,_payload:{_status:-1,_result:e},_init:Wp}};Z.memo=function(e,t){return{$$typeof:Bp,type:e,compare:t===void 0?null:t}};Z.startTransition=function(e){var t=_i.transition;_i.transition={};try{e()}finally{_i.transition=t}};Z.unstable_act=Od;Z.useCallback=function(e,t){return Ue.current.useCallback(e,t)};Z.useContext=function(e){return Ue.current.useContext(e)};Z.useDebugValue=function(){};Z.useDeferredValue=function(e){return Ue.current.useDeferredValue(e)};Z.useEffect=function(e,t){return Ue.current.useEffect(e,t)};Z.useId=function(){return Ue.current.useId()};Z.useImperativeHandle=function(e,t,n){return Ue.current.useImperativeHandle(e,t,n)};Z.useInsertionEffect=function(e,t){return Ue.current.useInsertionEffect(e,t)};Z.useLayoutEffect=function(e,t){return Ue.current.useLayoutEffect(e,t)};Z.useMemo=function(e,t){return Ue.current.useMemo(e,t)};Z.useReducer=function(e,t,n){return Ue.current.useReducer(e,t,n)};Z.useRef=function(e){return Ue.current.useRef(e)};Z.useState=function(e){return Ue.current.useState(e)};Z.useSyncExternalStore=function(e,t,n){return Ue.current.useSyncExternalStore(e,t,n)};Z.useTransition=function(){return Ue.current.useTransition()};Z.version="18.3.1";wd.exports=Z;var ve=wd.exports;/**
10
- * @license React
11
- * react-jsx-runtime.production.min.js
12
- *
13
- * Copyright (c) Facebook, Inc. and its affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Jp=ve,Qp=Symbol.for("react.element"),qp=Symbol.for("react.fragment"),Yp=Object.prototype.hasOwnProperty,Gp=Jp.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Xp={key:!0,ref:!0,__self:!0,__source:!0};function Nd(e,t,n){var r,s={},i=null,o=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(r in t)Yp.call(t,r)&&!Xp.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:Qp,type:e,key:i,ref:o,props:s,_owner:Gp.current}}mo.Fragment=qp;mo.jsx=Nd;mo.jsxs=Nd;_d.exports=mo;var O=_d.exports;function jl(e=Math.random){return e().toString(36).slice(2)}class va extends Promise{constructor(n){let r,s;super((i,o)=>{r=i,s=o});x(this,"fate");x(this,"resolve");x(this,"reject");x(this,"done",!1);this.resolve=r,this.reject=s,this.use(n instanceof Promise?n:new Promise(n))}pass(n,r){n===this.fate&&(this.resolve(r),this.done=!0)}fail(n,r){n===this.fate&&(this.reject(r),this.done=!0)}use(n){if(n instanceof Promise){const r=n;this.fate=r,r.then(s=>{this.pass(r,s)},s=>{this.fail(r,s)})}else this.resolve(n),this.fate=void 0}}function bd(e){return Object.entries(e)}const em=(e,t,n=_e.STORE)=>Bd(n,{key:`${e.key}:JSON`,get:({get:r})=>t.toJson(r(e)),set:({set:r},s)=>{r(e,t.fromJson(s))}});function L(e){for(;e.child!==null;)e=e.child;return e}function tm(e){for(;e.parent!==null;)e=e.parent;return e}class oe{constructor(){x(this,"Subscriber");x(this,"subscribers",new Map)}subscribe(t,n){return this.subscribers.set(t,n),()=>{this.unsubscribe(t)}}unsubscribe(t){this.subscribers.delete(t)}next(t){const n=this.subscribers.values();for(const r of n)r(t)}}class nm extends oe{constructor(n){super();x(this,"state");this.state=n}next(n){this.state=n,super.next(n)}}function $l(e,t,n){const r={key:t.key,type:"atom_family"},s=e.families.get(t.key);s&&e.logger.error("❗","atom_family",t.key,`Overwriting an existing ${_r(s)} "${s.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const i=new oe,a=Object.assign(l=>{const u=Y(l),c={key:t.key,subKey:u},f=`${t.key}(${u})`,h=L(e),y=t.default,w={key:f,default:y instanceof Function?y(l):y};t.effects&&(w.effects=t.effects(l));const v=vo(h,w,c);return i.next({type:"state_creation",token:v}),v},r,{subject:i,install:l=>$l(l,t),internalRoles:n});return e.families.set(t.key,a),e.defaults.set(t.key,t.default),r}function Yn(e,t,n){const r={key:t.key,type:"readonly_selector_family"},s=e.families.get(t.key);s&&e.logger.error("❗","readonly_selector_family",t.key,`Overwriting an existing ${_r(s)} "${s.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const i=new oe,a=Object.assign(l=>{const u=Y(l),c={key:t.key,subKey:u},f=`${t.key}(${u})`,h=L(e),y=Kl(h,{key:f,get:t.get(l)},c);return i.next({type:"state_creation",token:y}),y},r,{internalRoles:n,subject:i,install:l=>Yn(l,t),default:l=>t.get(l)({get:(...c)=>ze(e,...c),find:(c,f)=>$e(e,c,f),seek:(c,f)=>je(e,c,f),json:c=>wn(e,c)})});return e.families.set(t.key,a),r}function rm(e,t){return"set"in t?Wl(e,t):Yn(e,t)}const sm={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function Ll(e,t){const n=Y(t),r=`${e.key}(${n})`,s=sm[e.type],i={key:r,type:s};return s==="molecule"?Object.assign(i,{key:t,family:e}):Object.assign(i,{family:{key:e.key,subKey:n}}),Object.assign(i,{counterfeit:!0}),i}function jn(e){const t={key:e.key,type:e.type};return"family"in e&&(t.family=e.family),t}function Ad(e,t,n){const r=Y(n);try{const s=[];let i;if(t==="root")s.push(e.molecules.get('"root"')),i="all";else if(typeof t=="string"&&t.startsWith(im)){i="any";const c=Y(t),f=e.molecules.get(c);if(!f)throw new Error(`Molecule ${c} not found in store "${e.config.name}"`);s.push(f)}else if(n.startsWith("T$--")){i="all";for(const f of t){const h=Y(f),y=e.molecules.get(h);if(!y)throw new Error(`Molecule ${h} not found in store "${e.config.name}"`);s.push(y)}}else{i="any";const f=Y(t),h=e.molecules.get(f);if(!h)throw new Error(`Molecule ${f} not found in store "${e.config.name}"`);s.push(h)}const o=new ka(s,n);o._dependsOn=i,e.molecules.set(r,o);for(const c of s)c.below.set(o.stringKey,o);const a={type:"molecule_creation",subType:"modern",key:o.key,provenance:t},l=L(e);Ee(l)&&l.transactionMeta.phase==="building"?l.transactionMeta.update.updates.push(a):l.on.moleculeCreationStart.next(a)}catch(s){s instanceof Error&&e.logger.error("❌","molecule",r,"allocation failed:",s.message)}return n}function ji(e,t){const n=Y(t),r=e.molecules.get(n);if(!r)throw new Error(`Molecule ${n} not found in store "${e.config.name}"`);for(const u of r.joins.values())u.relations.delete(r.key),u.molecules.delete(r.stringKey);let s;r.above.size===1?s=r.above.values().next().value.key:s=[...r.above.values()].map(({key:u})=>u);const i=[];for(const u of r.tokens.values()){const c=u.family;i.push([c.key,e.valueMap.get(u.key)])}for(const u of r.tokens.values())Ht(e,u);for(const u of r.below.values())u.dependsOn==="all"?ji(e,u.key):(u.above.delete(r.stringKey),u.above.size===0&&ji(e,u.key));r.below.clear();const o={type:"molecule_disposal",subType:"modern",key:r.key,values:i,provenance:s},a=L(e);Ee(a)&&a.transactionMeta.phase==="building"?a.transactionMeta.update.updates.push(o):a.on.moleculeDisposal.next(o),a.molecules.delete(r.stringKey);for(const u of r.above.values())u.below.delete(r.stringKey)}const im="T$";function et(e){return Xm(_e.STORE,e)}function _a(...e){return e.length===2?ze(_e.STORE,...e):ze(_e.STORE,...e)}const Uo=e=>(t,n,r,s,...i)=>{console[e](`${t} ${n} "${r}" ${s}`,...i)},om={error:Uo("error"),info:Uo("info"),warn:Uo("warn")};class am{constructor(t,n,r=om){x(this,"error",(...t)=>{var n;(((n=this.filter)==null?void 0:n.call(this,...t))??!0)&&this.logLevel!==null&&this.logger.error(...t)});x(this,"info",(...t)=>{var n;(((n=this.filter)==null?void 0:n.call(this,...t))??!0)&&this.logLevel==="info"&&this.logger.info(...t)});x(this,"warn",(...t)=>{var n;(((n=this.filter)==null?void 0:n.call(this,...t))??!0)&&this.logLevel!=="error"&&this.logLevel!==null&&this.logger.warn(...t)});this.logLevel=t,this.filter=n,this.logger=r}}function Wn(e){return Bd(_e.STORE,e)}function lm(e){return rm(_e.STORE,e)}function zl(...e){e.length===2?fe(_e.STORE,...e):fe(_e.STORE,...e)}function um(e){return zd(e,_e.STORE)}function cm(e,t=jl()){return yo(e,t,_e.STORE)}class zt{constructor(t,n){x(this,"a");x(this,"b");x(this,"cardinality");x(this,"relations",new Map);x(this,"contents",new Map);x(this,"isAType");x(this,"isBType");x(this,"isContent");x(this,"makeContentKey",(t,n)=>`${t}:${n}`);x(this,"warn");var r,s;if(this.a=t.between[0],this.b=t.between[1],this.cardinality=t.cardinality,n!=null&&n.externalStore||(this.relations=new Map((r=t.relations)==null?void 0:r.map(([i,o])=>[i,new Set(o)])),this.contents=new Map(t.contents)),this.isAType=(n==null?void 0:n.isAType)??null,this.isBType=(n==null?void 0:n.isBType)??null,this.isContent=(n==null?void 0:n.isContent)??null,n!=null&&n.makeContentKey&&(this.makeContentKey=n.makeContentKey),n!=null&&n.externalStore){const i=n.externalStore;this.has=(o,a)=>i.has(o,a),this.addRelation=(o,a)=>{i.addRelation(o,a)},this.deleteRelation=(o,a)=>{i.deleteRelation(o,a)},this.replaceRelationsSafely=(o,a)=>{i.replaceRelationsSafely(o,a)},this.replaceRelationsUnsafely=(o,a)=>{i.replaceRelationsUnsafely(o,a)},this.getRelatedKeys=o=>i.getRelatedKeys(o),i.getContent&&(this.getContentInternal=o=>i.getContent(o),this.setContent=(o,a)=>{i.setContent(o,a)},this.deleteContent=o=>{i.deleteContent(o)});for(const[o,a]of t.relations??[]){let l=(s=this.isAType)!=null&&s.call(this,o)?o:void 0,u=l===void 0?o:void 0;for(const c of a)l??(l=c),u??(u=c),this.addRelation(l,u)}for(const[o,a]of t.contents??[])this.setContent(o,a)}n!=null&&n.warn&&(this.warn=n.warn)}getRelatedKeys(t){return this.relations.get(t)}addRelation(t,n){let r=this.relations.get(t),s=this.relations.get(n);r?r.add(n):(r=new Set([n]),this.relations.set(t,r)),s?s.add(t):(s=new Set([t]),this.relations.set(n,s))}deleteRelation(t,n){const r=this.relations.get(t);if(r){r.delete(n),r.size===0&&this.relations.delete(t);const s=this.relations.get(n);s&&(s.delete(t),s.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(t,n){this.relations.set(t,new Set(n));for(const r of n){const s=new Set().add(t);this.relations.set(r,s)}}replaceRelationsSafely(t,n){var o;const r=this.relations.get(t);let s=(o=this.isAType)!=null&&o.call(this,t)?t:void 0,i=s===void 0?t:void 0;if(r)for(const a of r){s??(s=a),i??(i=a);const l=this.relations.get(a);l&&(l.size===1?this.relations.delete(a):l.delete(t),this.contents.delete(this.makeContentKey(s,i)))}this.relations.set(t,new Set(n));for(const a of n){let l=this.relations.get(a);l?l.add(t):(l=new Set().add(t),this.relations.set(a,l))}}getContentInternal(t){return this.contents.get(t)}setContent(t,n){this.contents.set(t,n)}deleteContent(t){this.contents.delete(t)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([t,n])=>[t,[...n]]),contents:[...this.contents.entries()]}}set(t,...n){const r=typeof n[0]=="string"?n[0]:t[this.b],s=n[1]??typeof n[0]=="string"?void 0:n[0];switch(t=typeof t=="string"?t:t[this.a],this.cardinality){case"1:1":{const i=this.getRelatedKey(t);i&&i!==r&&this.delete(t,i)}case"1:n":{const i=this.getRelatedKey(r);i&&i!==t&&this.delete(i,r)}}if(s){const i=this.makeContentKey(t,r);this.setContent(i,s)}return this.addRelation(t,r),this}delete(t,n){n=typeof n=="string"?n:t[this.b];const r=typeof t=="string"?t:t[this.a];if(r===void 0&&typeof n=="string"){const s=this.getRelatedKeys(n);if(s)for(const i of s)this.delete(i,n)}if(typeof r=="string"&&n===void 0){const s=this.getRelatedKeys(r);if(s)for(const i of s)this.delete(r,i)}if(typeof r=="string"&&typeof n=="string"){this.deleteRelation(r,n);const s=this.makeContentKey(r,n);this.deleteContent(s)}return this}getRelatedKey(t){var r;const n=this.getRelatedKeys(t);if(n){n.size>1&&((r=this.warn)==null||r.call(this,`${n.size} related keys were found for key "${t}": (${[...n].map(i=>`"${i}"`).join(", ")}). Only one related key was expected.`));let s;for(const i of n){s=i;break}return s}}replaceRelations(t,n,r){const s=!Array.isArray(n),i=s?Object.keys(n):n;if(r!=null&&r.reckless?this.replaceRelationsUnsafely(t,i):this.replaceRelationsSafely(t,i),s)for(const o of i){const a=this.makeContentKey(t,o),l=n[o];this.setContent(a,l)}return this}getContent(t,n){const r=this.makeContentKey(t,n);return this.getContentInternal(r)}getRelationEntries(t){const n=t[this.a],r=t[this.b];if(n!==void 0&&r===void 0){const s=this.getRelatedKeys(n);if(s)return[...s].map(i=>[i,this.getContent(n,i)])}if(n===void 0&&r!==void 0){const s=this.getRelatedKeys(r);if(s)return[...s].map(i=>[i,this.getContent(i,r)])}return[]}has(t,n){if(n){const r=this.getRelatedKeys(t);return(r==null?void 0:r.has(n))??!1}return this.relations.has(t)}}function ct(e){return"epoch"in e.transactionMeta}function Ee(e){return"phase"in e.transactionMeta}const dm=e=>{const t=L(e);if(!Ee(t)){e.logger.warn("🐞","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}e.logger.info("🪂","transaction",t.transactionMeta.update.key,"Aborting transaction"),t.parent.child=null},fm=e=>e[0].toUpperCase()+e.slice(1);function _r(e){return e.type.split("_").map(fm).join(" ")}class hn extends Error{constructor(...t){const n=t[0],r=t.length===2?t[1]:t[2];if(t.length===2)super(`${_r(n)} ${Y(n.key)} not found in store "${r.config.name}".`);else{const s=t[1];super(`${_r(n)} "${n.key}" member ${Y(s)} not found in store "${r.config.name}".`)}}}function yo(e,t,n){return(...r)=>{const s=q(e,n);if(s)return s.run(r,t);throw new hn(e,n)}}const Id=e=>t=>e instanceof Function?e(t):e,go=(e,t)=>{if(t.valueMap.has(e.key))return t.logger.info("📖",e.type,e.key,"reading cached value"),Qm(e,t);if(e.type==="selector"||e.type==="readonly_selector")return t.logger.info("🧮",e.type,e.key,"computing value"),e.get();const n=e.default instanceof Function?e.default():e.default;return t.logger.info("💁","atom",e.key,"could not find cached value; using default",n),e.default instanceof Function?e.default():e.default},hm=(e,t)=>{if(e.operation.open){const n=performance.now();return e.logger.info("❗",t.type,t.key,`deferring setState at T-${n} until setState for "${e.operation.token.key}" is done`),n}e.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:t},e.logger.info("⭕",t.type,t.key,`operation start in store "${e.config.name}"${Ee(e)?` ${e.transactionMeta.phase} "${e.transactionMeta.update.key}"`:""}`)},pm=e=>{e.operation.open&&e.logger.info("🔴",e.operation.token.type,e.operation.token.key,`operation done in store "${e.config.name}"`),e.operation={open:!1},e.on.operationClose.next(e.operation)},mm=(e,t)=>e.operation.open?e.operation.done.has(t):(e.logger.error("🐞","unknown",t,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Dl=(e,t)=>{if(!e.operation.open){e.logger.error("🐞","unknown",t,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}e.operation.done.add(t)},ym=(e,t,n)=>{switch(e.type){case"mutable_atom":n.logger.info("📢",e.type,e.key,"is now (",t.newValue,") subscribers:",e.subject.subscribers);break;default:n.logger.info("📢",e.type,e.key,"went (",t.oldValue,"->",t.newValue,") subscribers:",e.subject.subscribers)}e.subject.next(t)},ec=(e,t)=>{const n=L(t),r=n.selectorAtoms.getRelatedKeys(e.key);if(n.logger.info("🧹",e.type,e.key,r?`evicting ${r.size} states downstream:`:"no downstream states",r??"to evict"),r){n.operation.open&&n.logger.info("🧹",e.type,e.key,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const s of r)mm(n,s)||(qm(s,n),Dl(n,s))}};function gm(e,t){return!(Jm(t.newValue)||e.includes("🔍"))}const vm=(e,t,n)=>{const{key:r}=e,s=L(n);if(!Ee(s)||s.transactionMeta.phase!=="building"){n.logger.error("🐞","atom",r,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!gm(r,t))return;const o={type:"atom_update",key:r,...t};e.family&&(o.family=e.family),s.transactionMeta.update.updates.push(o),n.logger.info("📁","atom",r,"stowed (",t.oldValue,"->",t.newValue,")")},_m=(e,t,n)=>{const r=go(e,n);let s=r;if(e.type==="mutable_atom"&&Ee(n)){const{parent:o}=n;s=Ta(e,o,n)}s=Id(t)(s),n.logger.info("📝","atom",e.key,"set to",s),s=zn(e.key,s,e.subject,n),Ym(e.key,n)&&Gm(e.key,n),Dl(n,e.key),ec(e,n);const i={oldValue:r,newValue:s};if(ct(n))ym(e,i,n);else if(n.parent){if(n.on.transactionApplying.state===null)vm(e,i,n);else if(e.key.startsWith("*")){const o=e.key.slice(1),a=n.atoms.get(o);let l=n.valueMap.get(o);if(a.type==="mutable_atom"&&Ee(n)){const{parent:c}=n;l=Ta(a,c,n)}l.do(i.newValue)===null&&ec(a,n)}}},Md=(e,t,n)=>{switch(e.type){case"atom":case"mutable_atom":_m(e,t,n);break;case"selector":e.set(t);break}};function Pd(e,t){if(t.family){const n=e.families.get(t.family.key);if(n)return n}}function fe(e,...t){let n,r,s,i;if(t.length===2?(n=t[0],i=t[1],r=Pd(e,n)??null,r&&(s=n.family?Ln(n.family.subKey):null,n=$e(e,r,s))):(r=t[0],s=t[1],i=t[2],n=$e(e,r,s)),"counterfeit"in n){const l=e.disposalTraces.buffer.find(u=>(u==null?void 0:u.key)===n.key);e.logger.error("❌",n.type,n.key,`could not be set because it was not found in the store "${e.config.name}".`,l?`This state was previously disposed:
18
- ${l.trace}`:"No previous disposal trace was found.");return}const o=hm(e,n);if(o){const l=e.on.operationClose.subscribe(`waiting to set "${n.key}" at T-${o}`,()=>{l(),e.logger.info("🟢",n.type,n.key,`resuming deferred setState from T-${o}`),fe(e,n,i)});return}const a=q(n,e);Md(a,i,e),pm(e)}function wm(e,t,n){const{key:r,newValue:s,oldValue:i}=t,o=e==="newValue"?s:i,a={key:r,type:"atom"};t.family&&Object.assign(a,{family:t.family}),fe(n,a,o)}function km(e,t){const n=new oe,r={type:"molecule_family",key:t.key,dependsOn:t.dependsOn??"all"},s={...r,subject:n,new:t.new};return e.moleculeFamilies.set(t.key,s),r}function $n(e,t,n){const r=kr(n,t,e.key);e.tokens.set(r.key,r);const s=Ee(n)&&n.transactionMeta.phase==="building",i=n.moleculeInProgress===e.key;return!s&&!i&&e.subject.next({type:"state_creation",token:r}),r}class Ct extends Set{constructor(n,r=0){super(n);x(this,"mode","record");x(this,"subject",new oe);x(this,"cacheLimit",0);x(this,"cache",[]);x(this,"cacheIdx",-1);x(this,"cacheUpdateNumber",-1);x(this,"parent");x(this,"child",null);x(this,"transactionUpdates",null);n instanceof Ct&&(this.parent=n,this.cacheUpdateNumber=n.cacheUpdateNumber),r&&(this.cacheLimit=r,this.cache=new Array(r),this.subscribe("auto cache",s=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=s}))}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(n){const r=new Ct(n.members,n.cacheLimit);return r.cache=n.cache,r.cacheIdx=n.cacheIdx,r.cacheUpdateNumber=n.cacheUpdateNumber,r}add(n){const r=super.add(n);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`add:${Y(n)}`)),r}clear(){const n=this.mode==="record"?[...this]:null;super.clear(),n&&(this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(n)}`))}delete(n){const r=super.delete(n);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`del:${Y(n)}`)),r}transaction(n){this.mode="transaction",this.transactionUpdates=[],this.child=new Ct(this);const r=this.child._subscribe("transaction",s=>{var i;(i=this.transactionUpdates)==null||i.push(s)});try{if(n(this.child)){for(const i of this.transactionUpdates)this.doStep(i);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(s){throw console.error("Failed to apply transaction to SetRTX:",s),s}finally{r(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(n,r){return this.subject.subscribe(n,r)}subscribe(n,r){return this.subject.subscribe(n,s=>{r(`${this.cacheUpdateNumber}=${s}`)})}emit(n){this.subject.next(n)}doStep(n){const r=n.indexOf(":"),s=n.substring(0,r),i=n.substring(r+1);switch(s){case"add":this.add(JSON.parse(i));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(i));break;case"tx":for(const o of i.split(";"))this.doStep(o)}}getUpdateNumber(n){const r=n.indexOf("=");return Number(n.substring(0,r))}do(n){const r=n.indexOf("="),s=Number(n.substring(0,r)),i=s-this.cacheUpdateNumber;if(i>0){if(i===1){this.mode="playback";const a=n.substring(r+1);return this.doStep(a),this.mode="record",this.cacheUpdateNumber=s,null}return this.cacheUpdateNumber+1}if(Math.abs(i)<this.cacheLimit){const a=this.cacheIdx+i;if(this.cache[a]===n)return null;this.mode="playback";let u=!1;for(;!u;){this.cacheIdx%=this.cacheLimit;const f=this.cache[this.cacheIdx];if(this.cacheIdx--,!f)return"OUT_OF_RANGE";this.undo(f),u=this.cacheIdx===a-1}const c=n.substring(r+1);return this.doStep(c),this.mode="record",this.cacheUpdateNumber=s,null}return"OUT_OF_RANGE"}undoStep(n){const r=n.indexOf(":"),s=n.substring(0,r),i=n.substring(r+1);switch(s){case"add":this.delete(JSON.parse(i));break;case"del":this.add(JSON.parse(i));break;case"clear":{const o=JSON.parse(i);for(const a of o)this.add(a);break}case"tx":{const o=i.split(";");for(let a=o.length-1;a>=0;a--)this.undoStep(o[a])}}}undo(n){const r=n.indexOf("=");if(Number(n.substring(0,r))===this.cacheUpdateNumber){this.mode="playback";const i=n.substring(r+1);return this.undoStep(i),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}function re(e){return e[0].toUpperCase()+e.slice(1)}class Ul{constructor(t,n,r=_e.STORE){x(this,"options");x(this,"defaultContent");x(this,"toolkit");x(this,"retrieve");x(this,"molecules",new Map);x(this,"relations");x(this,"states");x(this,"core");x(this,"store");x(this,"alternates");this.store=r,this.options=t,this.defaultContent=n,this.alternates=new Map,this.alternates.set(r.config.name,this),this.store.miscResources.set(`join:${t.key}`,this),this.retrieve=(g,_)=>{const S=this.toolkit.seek(g,_);if(S)return S;const P=this.store.molecules.get(Y(_));if(P){const R=q(g,r);return $n(P,R,r)}if(r.config.lifespan==="immortal")throw new hn(g,_,r);return kr(r,g,_)},this.toolkit={get:(...g)=>ze(r,...g),set:(...g)=>{fe(r,...g)},find:this.retrieve,seek:(...g)=>je(r,...g),json:g=>wn(r,g),dispose:(...g)=>{Ht(r,...g)}};const s=t.between[0],i=t.between[1],o=Fd(r,{key:`${t.key}/relatedKeys`,default:()=>new Ct,mutable:!0,fromJson:g=>Ct.fromJSON(g),toJson:g=>g.toJSON()},["join","relations"]);this.core={findRelatedKeysState:o};const a=({get:g},_)=>g(this.retrieve(o,_)),l=(g,_,S)=>{const{set:P}=g,R=this.retrieve(o,_),j=this.retrieve(o,S);P(R,B=>B.add(S)),P(j,B=>B.add(_))},u=(g,_,S)=>{const{set:P}=g,R=this.retrieve(o,_),j=this.retrieve(o,S);P(R,B=>(B.delete(S),B.size,B)),P(j,B=>(B.delete(_),B.size,B))},c=(g,_,S)=>{const{get:P,set:R}=g,j=this.retrieve(o,_),B=P(j);for(const X of B){if(S.includes(X))continue;const Fe=this.retrieve(o,X);R(Fe,we=>(we.delete(_),we))}R(j,X=>(X.transaction(Oe=>{Oe.clear();for(const Fe of S){const we=a(g,Fe),Pt=we.has(_);if(this.relations.cardinality==="1:n"){const I=[];for(const U of we){if(U===_)continue;const F=a(g,U);F.delete(Fe),F.size===0&&I.push(U)}!Pt&&we.size>0&&we.clear();for(const U of I){const F=[Fe,U].sort(),ie=`"${F[0]}:${F[1]}"`;this.molecules.delete(ie)}}Pt||we.add(_),Oe.add(Fe)}return!0}),X))},f=(g,_,S)=>{const{set:P}=g,R=this.retrieve(o,_);P(R,j=>(j.transaction(B=>{for(const X of S)B.add(X);return!0}),j));for(const j of S){const B=this.retrieve(o,j);P(B,X=>(X.add(_),X))}return!0},h=(g,_,S)=>{const P=a(g,_);return S?P.has(S):P.size>0},y={getRelatedKeys:g=>a(this.toolkit,g),addRelation:(g,_)=>{l(this.toolkit,g,_)},deleteRelation:(g,_)=>{u(this.toolkit,g,_)},replaceRelationsSafely:(g,_)=>{c(this.toolkit,g,_)},replaceRelationsUnsafely:(g,_)=>{f(this.toolkit,g,_)},has:(g,_)=>h(this.toolkit,g,_)};let w,v,N;if(n){v=$l(r,{key:`${t.key}/content`,default:n},["join","content"]),N=km(r,{key:`${t.key}/content-molecules`,new:class{constructor(j,B){this.key=B}}});const g=({get:R},j)=>R(this.retrieve(v,j)),_=({set:R},j,B)=>{R(this.retrieve(v,j),B)},S=(R,j)=>{const B=r.molecules.get(`"${j}"`);B&&(this.toolkit.dispose(B),this.molecules.delete(`"${j}"`))};w=Object.assign(y,{getContent:R=>g(this.toolkit,R),setContent:(R,j)=>{_(this.toolkit,R,j)},deleteContent:R=>{S(this.toolkit,R)}})}else w=y;const p=new zt(t,{externalStore:w,isAType:t.isAType,isBType:t.isBType,makeContentKey:(...g)=>{const _=g.sort(),S=`${_[0]}:${_[1]}`,[P,R]=_.map(j=>this.molecules.get(Y(j)));if(r.config.lifespan==="immortal"&&P&&R){const j=L(r),B=wr(j,[P,R],N,S);this.molecules.set(`"${S}"`,q(B,j))}return S}}),d=()=>Yn(r,{key:`${t.key}/singleRelatedKey`,get:g=>({get:_})=>{const S=this.retrieve(o,g),P=_(S);for(const R of P)return R;return null}},["join","keys"]),m=()=>Yn(r,{key:`${t.key}/multipleRelatedKeys`,get:g=>({get:_})=>{const S=rc(o,r),P=this.retrieve(S,g);return _(P).members}},["join","keys"]),k=()=>Yn(r,{key:`${t.key}/singleRelatedEntry`,get:g=>({get:_})=>{var R;const S=this.retrieve(o,g),P=_(S);for(const j of P){let B=(R=p.isAType)!=null&&R.call(p,g)?g:void 0,X=B===void 0?g:void 0;B??(B=j),X??(X=j);const Oe=p.makeContentKey(B,X),Fe=this.retrieve(v,Oe),we=_(Fe);return[j,we]}return null}},["join","entries"]),C=()=>Yn(r,{key:`${t.key}/multipleRelatedEntries`,get:g=>({get:_})=>{const S=rc(o,r),P=this.retrieve(S,g);return _(P).members.map(j=>{var Pt;let B=(Pt=p.isAType)!=null&&Pt.call(p,g)?g:void 0,X=B===void 0?g:void 0;B??(B=j),X??(X=j);const Oe=p.makeContentKey(B,X),Fe=this.retrieve(v,Oe),we=_(Fe);return[j,we]})}},["join","entries"]);switch(t.cardinality){case"1:1":{const g=d(),_=`${s}KeyOf${re(i)}`,S=`${i}KeyOf${re(s)}`,P={[_]:g,[S]:g};let R;if(n){const j=k(),B=`${s}EntryOf${re(i)}`,X=`${i}EntryOf${re(s)}`,Oe={[B]:j,[X]:j};R=Object.assign(P,Oe)}else R=P;this.relations=p,this.states=R;break}case"1:n":{const g=d(),_=m(),S=`${s}KeyOf${re(i)}`,P=`${i}KeysOf${re(s)}`,R={[S]:g,[P]:_};let j;if(n){const B=k(),X=C(),Oe=`${s}EntryOf${re(i)}`,Fe=`${i}EntriesOf${re(s)}`,we={[Oe]:B,[Fe]:X};j=Object.assign(R,we)}else j=R;this.relations=p,this.states=j;break}default:{const g=m(),_=`${s}KeysOf${re(i)}`,S=`${i}KeysOf${re(s)}`,P={[_]:g,[S]:g};let R;if(n){const j=C(),B=`${s}EntriesOf${re(i)}`,X=`${i}EntriesOf${re(s)}`,Oe={[B]:j,[X]:j};R=Object.assign(P,Oe)}else R=P;this.relations=p,this.states=R}}}transact(t,n){const r=this.toolkit;this.toolkit=t,n(this),this.toolkit=r}[Symbol.dispose](){this.alternates.delete(this.store.config.name)}in(t){const n=t.config.name,r=this.alternates.get(n);if(r)return r;const s=new Ul(this.options,this.defaultContent,t);return this.alternates.set(n,s),s.alternates=this.alternates,s}}function Sm(e,t,n=_e.STORE){return wa(n).set(e.key,new Ul(e,t,n)),{key:e.key,type:"join",a:e.between[0],b:e.between[1],cardinality:e.cardinality}}function wa(e){if("joins"in e&&e.joins instanceof Map)return e.joins;const t=new Map;return e.joins=t,t}function Bl(e,t){var s;const n=wa(t);let r=n.get(e.key);if(r===void 0){if(r=(s=wa(_e.STORE).get(e.key))==null?void 0:s.in(t),r===void 0)throw new Error(`Join "${e.key}" not found in store "${t.config.name}"`);n.set(e.key,r)}return r}function xm(e,t,n){const r=Bl(e,n);let s;switch(e.cardinality){case"1:1":{const i=`${e.a}KeyOf${re(e.b)}`,o=`${e.b}KeyOf${re(e.a)}`;s={get[i](){const l=r.states[i];return r.retrieve(l,t)},get[o](){const l=r.states[o];return r.retrieve(l,t)}};const a=`${e.a}EntryOf${re(e.b)}`;if(a in r.states){const l=`${e.b}EntryOf${re(e.a)}`;Object.assign(s,{get[a](){const u=r.states[a];return r.retrieve(u,t)},get[l](){const u=r.states[l];return r.retrieve(u,t)}})}break}case"1:n":{const i=`${e.a}KeyOf${re(e.b)}`,o=`${e.b}KeysOf${re(e.a)}`;s={get[i](){const l=r.states[i];return r.retrieve(l,t)},get[o](){const l=r.states[o];return r.retrieve(l,t)}};const a=`${e.a}EntryOf${re(e.b)}`;if(a in r.states){const l=`${e.b}EntriesOf${re(e.a)}`;Object.assign(s,{get[a](){const u=r.states[a];return r.retrieve(u,t)},get[l](){const u=r.states[l];return r.retrieve(u,t)}})}break}case"n:n":{const i=`${e.a}KeysOf${re(e.b)}`,o=`${e.b}KeysOf${re(e.a)}`;s={get[i](){const l=r.states[i];return r.retrieve(l,t)},get[o](){const l=r.states[o];return r.retrieve(l,t)}};const a=`${e.a}EntriesOf${re(e.b)}`;if(a in r.states){const l=`${e.b}EntriesOf${re(e.a)}`;Object.assign(s,{get[a](){const u=r.states[a];return r.retrieve(u,t)},get[l](){const u=r.states[l];return r.retrieve(u,t)}})}}}return s}function Em(e,t){return xm(e,t,_e.STORE)}function Tm(e,t){return Bl(e,t).core.findRelatedKeysState}function Cm(e){return Tm(e,_e.STORE)}function jd(e){return{store:e}}function ze(e,...t){let n,r,s;if(t.length===1)n=t[0],n.type!=="molecule"&&(r=Pd(e,n)??null,r&&(s=n.family?Ln(n.family.subKey):null,n=$e(e,r,s)));else{r=t[0],s=t[1];let i;r.type==="molecule_family"?i=je(e,r,s)??Ll(r,s):i=$e(e,r,s),n=i}if("counterfeit"in n&&"family"in n){r=n.type==="molecule"?q(n.family,e):e.families.get(n.family.key);const i=n.type==="molecule"?n.key:n.family.subKey,o=e.disposalTraces.buffer.find(a=>(a==null?void 0:a.key)===n.key);switch(e.logger.error("❌",n.type,n.key,`could not be retrieved because it was not found in the store "${e.config.name}".`,o?`This state was previously disposed:
19
- ${o.trace}`:"No previous disposal trace was found."),r.type){case"atom_family":case"mutable_atom_family":return e.defaults.get(r.key);case"selector_family":case"readonly_selector_family":{if(e.defaults.has(r.key))return e.defaults.get(n.family.key);const a=q(r,e).default(i);return e.defaults.set(r.key,a),a}case"molecule_family":throw new hn(r,i,e)}}switch(n.type){case"atom":case"mutable_atom":case"selector":case"readonly_selector":return go(q(n,e),e);case"molecule":return q(n,e).instance}}class ka{constructor(t,n,r){x(this,"type","molecule");x(this,"stringKey");x(this,"family");x(this,"_dependsOn");x(this,"subject",new oe);x(this,"tokens",new Map);x(this,"above",new Map);x(this,"below",new Map);x(this,"joins",new Map);x(this,"instance");if(this.key=n,this.stringKey=Y(n),r&&(this.family=r,this._dependsOn=r.dependsOn),t)for(const s of t)this.above.set(s.stringKey,s)}get dependsOn(){return this.family?this.family.dependsOn:this._dependsOn}}function tc(e){return e[0].toUpperCase()+e.slice(1)}function wr(e,t,n,r,...s){const i=tm(e),o=L(e),a=Y(r);o.moleculeInProgress=a;const l=Array.isArray(t)?t:[t],u=l.map(N=>{if(N instanceof ka)return N;const p=Y(N.key),d=e.molecules.get(p);if(!d)throw new Error(`Molecule ${p} not found in store "${e.config.name}"`);return d}),c=new ka(u,r,n);o.molecules.set(a,c);for(const N of u)N.below.set(c.stringKey,c);const f={get:(...N)=>ze(L(i),...N),set:(...N)=>{fe(L(i),...N)},seek:(N,p)=>je(L(i),N,p),json:N=>wn(L(i),N),run:(N,p=jl())=>yo(N,p,L(e)),make:(N,p,d,...m)=>wr(L(i),N,p,d,...m),dispose:N=>{Ht(L(i),N)},env:()=>jd(L(i)),bond:(N,p)=>{if(N.type==="join"){const{as:d}=p,m=Bl(N,i);m.molecules.set(a,c),c.joins.set(N.key,m);const k=h.subject.subscribe(`join:${N.key}-${a}`,R=>{R.type==="molecule_disposal"&&Y(R.token.key)===a&&(k(),m.molecules.delete(a))});if(d===null)return;const C=N.a===d?N.b:N.a,g=Em(N,r),_=g[`${C}KeysOf${tc(d)}`],S=g[`${C}EntriesOf${tc(d)}`];let P={relatedKeys:_};return S&&(P=Object.assign(P,{relatedEntries:S})),P}return $n(c,q(N,i),L(i))},claim:(N,p)=>{const{exclusive:d}=p,m=L(e).molecules.get(Y(N.key));if(m)if(d){for(const k of m.above.values())k.below.delete(m.stringKey);m.above.clear(),m.above.set(c.stringKey,c),c.below.set(m.stringKey,m)}else m.above.set(c.stringKey,c),c.below.set(m.stringKey,m)},spawn:(N,p,...d)=>wr(L(e),[c],q(N,e),p,...d)},h=q(n,e),y=h.new;c.instance=new y(f,r,...s);const w={type:"molecule",key:r,family:n},v={type:"molecule_creation",subType:"classic",token:w,family:n,context:l,params:s};return ct(o)?h.subject.next(v):Ee(o)&&o.on.transactionApplying.state===null&&o.transactionMeta.update.updates.push(v),o.moleculeInProgress=null,w}function Rm(e,t,n){switch(t){case"newValue":{$d(e,n);break}case"oldValue":{Ht(n,e.token);break}}}function Om(e,t,n){switch(t){case"newValue":{Ht(n,e.token);break}case"oldValue":{$d(e,n),n.valueMap.set(e.token.key,e.value);break}}}function $d(e,t){const{family:n}=e.token;if(n){const r=t.families.get(n.key);r&&$e(t,r,Ln(n.subKey))}}function Nm(e,t,n){switch(t){case"newValue":switch(e.subType){case"classic":wr(n,e.context,e.family,e.token.key,...e.params);break;case"modern":Ad(n,e.provenance,e.key);break}break;case"oldValue":switch(e.subType){case"classic":Ht(n,e.token);break;case"modern":ji(n,e.key);break}break}}function bm(e,t,n){switch(t){case"newValue":switch(e.subType){case"classic":Ht(n,e.token);break;case"modern":ji(n,e.key);break}break;case"oldValue":switch(e.subType){case"classic":{const r=wr(n,e.context,e.family,e.token.key);for(const[s,i]of e.values){const o=`${s}(${Y(r.key)})`,a=q(r,n),l=a.tokens.has(o),u=n.families.get(s);u&&!l&&$n(a,u,n),n.valueMap.set(o,i)}}break;case"modern":{Ad(n,e.provenance,e.key);for(const[r,s]of e.values){const i=n.families.get(r);if(i){$e(n,i,e.key);const o=`${r}(${Y(e.key)})`;n.valueMap.set(o,s)}}}}break}}function Gn(e,t,n){const r=e==="newValue"?t.updates:[...t.updates].reverse();for(const s of r)switch(s.type){case"atom_update":case"selector_update":wm(e,s,n);break;case"state_creation":Rm(s,e,n);break;case"state_disposal":Om(s,e,n);break;case"molecule_creation":Nm(s,e,n);break;case"molecule_disposal":bm(s,e,n);break;case"transaction_update":Gn(e,s,n);break}}function Sa(e,t,n){ct(n)&&e&&n.transactionMeta.epoch.set(e,t)}function Am(e,t,n){if(!ct(n))return;const s=n.transactionMeta.actionContinuities.getRelatedKey(e);s!==void 0&&n.transactionMeta.epoch.set(s,t)}const Im=(e,t)=>{var i;const n=L(t),{parent:r}=n;if(r===null||!Ee(n)||((i=n.transactionMeta)==null?void 0:i.phase)!=="building"){t.logger.warn("🐞","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,r.child=null,r.on.transactionApplying.next(n.transactionMeta);const{updates:s}=n.transactionMeta.update;if(t.logger.info("🛄","transaction",n.transactionMeta.update.key,`Applying transaction with ${s.length} updates:`,s),Gn("newValue",n.transactionMeta.update,r),ct(r)){Am(n.transactionMeta.update.key,n.transactionMeta.update.epoch,r);const o=q({key:n.transactionMeta.update.key,type:"transaction"},t);o==null||o.subject.next(n.transactionMeta.update),t.logger.info("🛬","transaction",n.transactionMeta.update.key,"Finished applying transaction.")}else Ee(r)&&r.transactionMeta.update.updates.push(n.transactionMeta.update);r.on.transactionApplying.next(null)};function Ld(e,t,n){if(!ct(n))return;const{epoch:s,actionContinuities:i}=n.transactionMeta;i.set(e,t),s.has(e)||s.set(e,-1)}class St extends Map{constructor(n){super();x(this,"deleted",new Set);this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n)}set(n,r){return this.deleted.delete(n),super.set(n,r)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}const Mm=(e,t,n,r)=>{const s=L(n),i={parent:s,child:null,on:s.on,loggers:s.loggers,logger:s.logger,config:s.config,atoms:new St(s.atoms),atomsThatAreDefault:new Set(s.atomsThatAreDefault),families:new St(s.families),operation:{open:!1},readonlySelectors:new St(s.readonlySelectors),timelines:new St(s.timelines),timelineTopics:new zt(s.timelineTopics.toJSON()),trackers:new Map,transactions:new St(s.transactions),selectorAtoms:new zt(s.selectorAtoms.toJSON()),selectorGraph:new zt(s.selectorGraph.toJSON(),{makeContentKey:(...u)=>u.sort().join(":")}),selectors:new St(s.selectors),valueMap:new St(s.valueMap),defaults:s.defaults,disposalTraces:n.disposalTraces.copy(),molecules:new St(s.molecules),moleculeFamilies:new St(s.moleculeFamilies),moleculeInProgress:s.moleculeInProgress,miscResources:new St(s.miscResources)},o=jm(e,n),a={phase:"building",update:{type:"transaction_update",key:e,id:r,epoch:o===void 0?Number.NaN:o+1,updates:[],params:t,output:void 0},toolkit:{get:(...u)=>ze(l,...u),set:(...u)=>{fe(l,...u)},run:(u,c=jl())=>yo(u,c,l),find:(u,c)=>$e(l,u,c),seek:(u,c)=>je(l,u,c),json:u=>wn(l,u),make:(u,c,f,...h)=>wr(l,u,c,f,...h),dispose:(...u)=>{Ht(l,...u)},env:()=>jd(l)}},l=Object.assign(i,{transactionMeta:a});return s.child=l,n.logger.info("🛫","transaction",e,"Building transaction with params:",t),l};function zd(e,t){const n={key:e.key,type:"transaction",run:(i,o)=>{const a=Mm(e.key,i,t,o);try{const l=L(t),{toolkit:u}=a.transactionMeta,c=e.do(u,...i);return Im(c,l),c}catch(l){throw dm(r),t.logger.warn("💥","transaction",e.key,"caught:",l),l}},install:i=>zd(e,i),subject:new oe},r=L(t);r.transactions.set(n.key,n);const s=jn(n);return t.on.transactionCreation.next(s),s}function Pm(e,t){return ct(t)&&e?t.transactionMeta.epoch.get(e):void 0}function jm(e,t){const n=ct(t),r=n?t.transactionMeta.actionContinuities.getRelatedKey(e):void 0;return n&&r!==void 0?t.transactionMeta.epoch.get(r):void 0}class Fl{constructor(t){x(this,"_buffer");x(this,"_index",0);let n;typeof t=="number"?n=t:n=t.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(t){this._buffer[this._index]=t,this._index=(this._index+1)%this._buffer.length}copy(){const t=new Fl([...this._buffer]);return t._index=this._index,t}}class $m{constructor(t,n=null){x(this,"parent",null);x(this,"child",null);x(this,"valueMap",new Map);x(this,"defaults",new Map);x(this,"atoms",new Map);x(this,"selectors",new Map);x(this,"readonlySelectors",new Map);x(this,"atomsThatAreDefault",new Set);x(this,"selectorAtoms",new zt({between:["selectorKey","atomKey"],cardinality:"n:n"}));x(this,"selectorGraph",new zt({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"trackers",new Map);x(this,"families",new Map);x(this,"transactions",new Map);x(this,"transactionMeta",{epoch:new Map,actionContinuities:new zt({between:["continuity","action"],cardinality:"1:n"})});x(this,"timelines",new Map);x(this,"timelineTopics",new zt({between:["timelineKey","topicKey"],cardinality:"1:n"}));x(this,"disposalTraces",new Fl(100));x(this,"molecules",new Map);x(this,"moleculeFamilies",new Map);x(this,"moleculeInProgress",null);x(this,"miscResources",new Map);x(this,"on",{atomCreation:new oe,atomDisposal:new oe,selectorCreation:new oe,selectorDisposal:new oe,timelineCreation:new oe,transactionCreation:new oe,transactionApplying:new nm(null),operationClose:new oe,moleculeCreationStart:new oe,moleculeCreationDone:new oe,moleculeDisposal:new oe});x(this,"operation",{open:!1});x(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});x(this,"loggers",[new am("warn",(t,n,r)=>!r.includes("🔍"))]);x(this,"logger",{error:(...t)=>{for(const n of this.loggers)n.error(...t)},info:(...t)=>{for(const n of this.loggers)n.info(...t)},warn:(...t)=>{for(const n of this.loggers)n.warn(...t)}});var r,s;if(this.config={...n==null?void 0:n.config,...t},n!==null){this.valueMap=new Map(n==null?void 0:n.valueMap),this.operation={...n==null?void 0:n.operation},ct(n)&&(this.transactionMeta={epoch:new Map(n==null?void 0:n.transactionMeta.epoch),actionContinuities:new zt(n==null?void 0:n.transactionMeta.actionContinuities.toJSON())});for(const[,o]of n.families)(r=o.internalRoles)!=null&&r.includes("mutable")||(s=o.internalRoles)!=null&&s.includes("join")||o.install(this);const i=new Set;for(const[,o]of n.atoms)if(!i.has(o.key)&&(o.install(this),o.type==="mutable_atom")){const a=wn(n,o),l=Vd(o);i.add(a.key),i.add(l.key)}for(const[,o]of n.readonlySelectors)o.install(this);for(const[,o]of n.selectors)i.has(o.key)||o.install(this);for(const[,o]of n.transactions)o.install(this);for(const[,o]of n.timelines)o.install(this)}}}const _e={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE||(globalThis.ATOM_IO_IMPLICIT_STORE=new $m({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function q(e,t){let n,r=t;for(;r!==null;){switch(e.type){case"atom":case"mutable_atom":n=r.atoms.get(e.key);break;case"selector":n=r.selectors.get(e.key);break;case"readonly_selector":n=r.readonlySelectors.get(e.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":n=r.families.get(e.key);break;case"timeline":n=r.timelines.get(e.key);break;case"transaction":n=r.transactions.get(e.key);break;case"molecule":n=r.molecules.get(Y(e.key));break;case"molecule_family":n=r.moleculeFamilies.get(e.key);break}if(n)return n;r=r.child}throw new hn(e,t)}function xa(e,t){let n;n=q(e,t);const{family:r}=e;for(const o of n.joins.values())o.relations.delete(n.key),o.molecules.delete(n.stringKey);const s=[];for(const o of n.above.values())s.push(jn(o));const i=[];for(const o of n.tokens.values()){const a=o.family;i.push([a.key,t.valueMap.get(o.key)])}if(r){const o=q(r,t),a={type:"molecule_disposal",subType:"classic",token:e,family:r,context:s,values:i};e.family&&(a.family=e.family);for(const u of n.tokens.values())Ht(t,u);for(const u of n.below.values())u.dependsOn==="all"?xa(u,t):(u.above.delete(n.stringKey),u.above.size===0&&xa(u,t));n.below.clear(),Ee(t)&&t.transactionMeta.phase==="building"?t.transactionMeta.update.updates.push(a):o.subject.next(a),t.molecules.delete(n.stringKey)}for(const o of n.above.values())o.below.delete(n.stringKey)}function kr(e,t,n){const r=e.families.get(t.key);if(r===void 0)throw new hn(t,e);const s=r(n),i=L(e);if(s.family&&i.moleculeInProgress===null)if(ct(i))switch(s.type){case"atom":case"mutable_atom":e.on.atomCreation.next(s);break;case"selector":case"readonly_selector":e.on.selectorCreation.next(s);break}else Ee(i)&&i.on.transactionApplying.state===null&&i.transactionMeta.update.updates.push({type:"state_creation",token:s});return s}function je(e,t,n){const r=Y(n),s=`${t.key}(${r})`,i=L(e);let o;switch(t.type){case"atom_family":case"mutable_atom_family":o=i.atoms.get(s);break;case"selector_family":o=i.selectors.get(s);break;case"readonly_selector_family":o=i.readonlySelectors.get(s);break;case"molecule_family":o=i.molecules.get(Y(n))}return o&&jn(o)}function $e(e,t,n){let r=je(e,t,n);if(r)return r;const s=e.molecules.get(Y(n));if(s)return $n(s,t,e);if(e.config.lifespan==="immortal"){const i=Ll(t,n);return e.logger.error("❌",i.type,i.key,`was not found in store "${e.config.name}"; returned a counterfeit token.`),i}return r=kr(e,t,n),r}function Ht(e,...t){var s,i;let n;if(t.length===1)n=t[0],n.key;else{const o=t[0],a=t[1];n=o.type==="molecule_family"?je(e,o,a)??Ll(o,a):$e(e,o,a)}try{q(n,e)}catch{const a=e.disposalTraces.buffer.find(l=>(l==null?void 0:l.key)===n.key);e.logger.error("❌",n.type,n.key,`could not be disposed because it was not found in the store "${e.config.name}".`,a?`
20
- This state was most recently disposed
21
- ${a.trace}`:"No previous disposal trace was found.");return}switch(n.type){case"atom":case"mutable_atom":Jl(n,e);break;case"selector":case"readonly_selector":Fm(n,e);break;case"molecule":xa(n,e);break}const{stack:r}=new Error;if(r){const o=(i=(s=r==null?void 0:r.split(`
22
- `))==null?void 0:s.slice(3))==null?void 0:i.join(`
23
- `);e.disposalTraces.add({key:n.key,trace:o})}}const Vl=(e,t)=>L(t).atoms.has(e),Lm=(e,t)=>L(t).selectors.has(e),zm=(e,t)=>L(t).readonlySelectors.has(e),Dm=(e,t)=>Vl(e,t)||Lm(e,t)||zm(e,t),Ea=(e,t)=>L(t).selectorGraph.getRelationEntries({downstreamSelectorKey:e}).filter(([r,{source:s}])=>s!==e).map(([r,{source:s}])=>s).filter(r=>Dm(r,t)),Dd=(e,t,n)=>{const r=[],s=Ea(e,n);for(;s.length>0;){const i=s.shift();t.has(i)||(t.add(i),Vl(i,n)?r.includes(i)||r.push(i):s.push(...Ea(i,n)))}return r},Um=(e,t)=>{const n=e.key,r=Ea(n,t),s=new Set;return r.flatMap(i=>Vl(i,t)?i:Dd(i,s,t))},Bm=(e,t,n,r)=>{const s=L(r);if(t.type==="atom"||t.type==="mutable_atom")s.selectorAtoms.set({selectorKey:e,atomKey:t.key}),r.logger.info("🔍","selector",e,`discovers root atom "${t.key}"`);else{const i=Dd(t.key,n,r);r.logger.info("🔍","selector",e,`discovers root atoms: [ ${i.map(o=>`"${o}"`).join(", ")} ]`);for(const o of i)s.selectorAtoms=s.selectorAtoms.set({selectorKey:e,atomKey:o})}n.add(t.key)},Ud=(e,t,n)=>({get:(...r)=>{const s=L(n);let i;if(r.length===2){const[l,u]=r;switch(l.type){case"molecule_family":return ze(n,l,u);default:if(n.config.lifespan==="ephemeral")i=$e(n,l,u);else{const c=je(n,l,u);if(c)i=c;else throw new hn(l,u,n)}}}else[i]=r;if(i.type==="molecule")return ze(n,i);const o=q(i,n),a=go(o,n);return n.logger.info("🔌","selector",e,`registers dependency ( "${i.key}" =`,a,")"),s.selectorGraph.set({upstreamSelectorKey:i.key,downstreamSelectorKey:e},{source:i.key}),Bm(e,i,t,n),a},set:(...r)=>{let s,i;if(r.length===2)s=r[0],i=r[1];else{const l=r[0],u=r[1];i=r[2];const c=n.config.lifespan==="ephemeral"?$e(n,l,u):je(n,l,u);if(!c)throw new hn(l,u,n);s=c}const o=L(n),a=q(s,o);Md(a,i,o)},find:(r,s)=>$e(n,r,s),seek:(r,s)=>je(n,r,s),json:r=>wn(n,r)}),Kl=(e,t,n)=>{const r=L(e),s=new oe,i=new Set,{get:o,find:a,seek:l,json:u}=Ud(t.key,i,r),c=()=>{const w=t.get({get:o,find:a,seek:l,json:u});return zn(t.key,w,s,L(e)),i.clear(),w},f={...t,subject:s,install:w=>Kl(w,t,n),get:c,type:"readonly_selector",...n&&{family:n}};r.readonlySelectors.set(t.key,f);const h=c();e.logger.info("✨",f.type,f.key,"=",h);const y={key:t.key,type:"readonly_selector"};return n&&(y.family=n),y},Zl=(e,t,n)=>{const r=L(e),s=new oe,i=new Set,o=Ud(t.key,i,r),{find:a,get:l,seek:u,json:c}=o,f={find:a,get:l,seek:u,json:c},h=(p=t.get,d=L(e))=>{const m=p(f);return zn(t.key,m,s,d),i.clear(),m},w={...t,subject:s,install:p=>Zl(p,t,n),get:h,set:p=>{const d=L(e),m=h(t.get,d),k=Id(p)(m);e.logger.info("📝","selector",t.key,"set (",m,"->",k,")"),zn(t.key,k,s,d),Dl(d,t.key),ct(d)&&s.next({newValue:k,oldValue:m}),t.set(o,k)},type:"selector",...n&&{family:n}};r.selectors.set(t.key,w);const v=h();e.logger.info("✨",w.type,w.key,"=",v);const N={key:t.key,type:"selector"};return n&&(N.family=n),N};function Bd(e,t){if("set"in t){const s=Zl(e,t,void 0);return e.on.selectorCreation.next(s),s}const r=Kl(e,t,void 0);return e.on.selectorCreation.next(r),r}function Fm(e,t){const n=L(t),{key:r}=e,s=q(e,n);if(!s.family)t.logger.error("❌","selector",r,"Standalone selectors cannot be disposed.");else{const i=n.molecules.get(s.family.subKey);switch(i&&i.tokens.delete(r),e.type){case"selector":n.selectors.delete(r),q({key:s.family.key,type:"selector_family"},t).subject.next({type:"state_disposal",token:e});break;case"readonly_selector":n.readonlySelectors.delete(r),q({key:s.family.key,type:"readonly_selector_family"},t).subject.next({type:"state_disposal",token:e});break}n.valueMap.delete(r),n.selectorAtoms.delete(r),n.selectorGraph.delete(r),t.logger.info("🔥",e.type,r,"deleted"),Ee(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.updates.push({type:"state_disposal",token:e}):t.on.selectorDisposal.next(e)}}function Wl(e,t,n){const r={key:t.key,type:"selector_family"},s=e.families.get(t.key);s&&e.logger.error("❗","selector_family",t.key,`Overwriting an existing ${_r(s)} "${s.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const i=new oe,a=Object.assign(l=>{const u=Y(l),c={key:t.key,subKey:u},f=`${t.key}(${u})`,h=L(e),y=Zl(h,{key:f,get:t.get(l),set:t.set(l)},c);return i.next({type:"state_creation",token:y}),y},r,{internalRoles:n,subject:i,install:l=>Wl(l,t),default:l=>t.get(l)({get:(...c)=>ze(e,...c),find:(c,f)=>$e(e,c,f),seek:(c,f)=>je(e,c,f),json:c=>wn(e,c)})});return e.families.set(t.key,a),r}function Vm(e,t,n=_e.STORE){const r=Wl(n,{key:`${e.key}:JSON`,get:i=>({seek:o,get:a})=>{const l=o(e,i);if(l)return t.toJson(a(l));const u=Y(i),c=n.molecules.get(u);if(c){const h=$n(c,e,n);return t.toJson(a(h))}if(n.config.lifespan==="immortal")throw new Error(`No molecule found for key "${u}"`);const f=kr(n,e,i);return t.toJson(a(f))},set:i=>({seek:o,set:a},l)=>{const u=o(e,i);if(u)a(u,t.fromJson(l));else{const c=Y(i),f=n.molecules.get(c);if(f){const h=$n(f,e,n);a(h,t.fromJson(l))}else{if(n.config.lifespan==="immortal")throw new Error(`No molecule found for key "${c}"`);a(kr(n,e,i),t.fromJson(l))}}}},["mutable","json"]);return q(e,n).subject.subscribe(`store=${n.config.name}::json-selector-family`,i=>{i.token.family&&je(n,r,Ln(i.token.family.subKey))}),r}const Ln=e=>JSON.parse(e),Y=e=>JSON.stringify(e),Km=(e,t)=>{const n=L(t);return n.operation.open?n.operation.prev.get(e.key):n.valueMap.get(e.key)},nc=(e,t)=>{const n=L(t);return Um(e,t).map(s=>{const i=n.atoms.get(s);if(i===void 0)throw new Error(`Atom "${s}", a dependency of selector "${e.key}", not found in store "${t.config.name}".`);return i.subject.subscribe(`${e.type}:${e.key}`,o=>{t.logger.info("📢",e.type,e.key,"root",s,"went",o.oldValue,"->",o.newValue);const a=Km(e,n),l=go(e,n);t.logger.info("✨",e.type,e.key,"went",a,"->",l),e.subject.next({newValue:l,oldValue:a})})})};function cs(e,t,n,r){function s(f){if(r.operation.open){const h=r.on.operationClose.subscribe(`state subscription ${n}`,()=>{h(),t(f)})}else t(f)}const i=q(e,r);r.logger.info("👀",i.type,i.key,`Adding subscription "${n}"`);const o=i.type==="selector"||i.type==="readonly_selector";let a=null,l=s;o&&(a=nc(i,r),l=f=>{a&&(a.length=0,a.push(...nc(i,r))),s(f)});const u=i.subject.subscribe(n,l);return()=>{if(r.logger.info("🙈",i.type,i.key,`Removing subscription "${n}"`),u(),a)for(const f of a)f()}}const Zm=(e,t,n,r)=>{const s=q(e,r);r.logger.info("👀","timeline",e.key,`Adding subscription "${n}"`);const i=s.subject.subscribe(n,t);return()=>{r.logger.info("🙈","timeline",e.key,`Removing subscription "${n}" from timeline`),i()}},Wm=(e,t,n,r)=>{const s=q(e,r);r.logger.info("👀","transaction",e.key,`Adding subscription "${n}"`);const i=s.subject.subscribe(n,t);return()=>{r.logger.info("🙈","transaction",e.key,`Removing subscription "${n}"`),i()}};class $i{constructor(t,n){x(this,"Update");x(this,"unsubscribeFromInnerValue");x(this,"unsubscribeFromState");x(this,"mutableState");x(this,"latestUpdateState");x(this,"dispose");this.mutableState=t;const r=L(n);this.latestUpdateState=this.initializeState(t,r),this.observeCore(t,this.latestUpdateState,r),this.updateCore(t,this.latestUpdateState,r),r.trackers.set(t.key,this),this.dispose=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),r.trackers.delete(t.key)}}initializeState(t,n){var o;const r=`*${t.key}`;n.atoms.delete(r),n.valueMap.delete(r);const s=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,i=vo(n,{key:r,default:null},s);if((o=n.parent)!=null&&o.valueMap.has(r)){const a=n.parent.valueMap.get(r);n.valueMap.set(r,a)}return i}observeCore(t,n,r){const s=`tracker:${r.config.name}:${Ee(r)?r.transactionMeta.update.key:"main"}:${t.key}`,i=ze(r,t);this.unsubscribeFromInnerValue=i.subscribe(s,o=>{fe(r,n,o)}),this.unsubscribeFromState=cs(t,o=>{o.newValue!==o.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=o.newValue.subscribe(s,a=>{fe(r,n,a)}))},s,r)}updateCore(t,n,r){const s=`tracker:${r.config.name}:${Ee(r)?r.transactionMeta.update.key:"main"}:${t.key}`;cs(n,({newValue:i,oldValue:o})=>{const a=r.timelineTopics.getRelatedKey(n.key);if(a){const u=r.timelines.get(a);if(u!=null&&u.timeTraveling){const c=Zm({key:a,type:"timeline"},f=>{c(),fe(r,t,h=>(f==="redo"&&i?h.do(i):f==="undo"&&o&&h.undo(o),h))},s,r);return}}const l=r.on.operationClose.subscribe(s,()=>{l();const u=ze(r,t),c=i===null?-1:u.getUpdateNumber(i),f=c-u.cacheUpdateNumber;i&&f===1?fe(r,t,h=>(h.do(i),h)):r.logger.info("❌","mutable_atom",t.key,`could not be updated. Expected update number ${u.cacheUpdateNumber+1}, but got ${c}`)})},s,r)}}function Hl(e,t,n){e.logger.info("🔨","atom",t.key,`creating in store "${e.config.name}"`);const r=L(e),s=r.atoms.get(t.key);if(s&&s.type==="mutable_atom")return e.logger.error("❌","atom",t.key,"Tried to create atom, but it already exists in the store."),jn(s);const i=new oe,o={...t,type:"mutable_atom",install:u=>(u.logger.info("🛠️","atom",t.key,`installing in store "${u.config.name}"`),Hl(u,t,n)),subject:i};n&&(o.family=n);const a=t.default();r.atoms.set(o.key,o),Kd(t.key,e),zn(t.key,a,i,r);const l=jn(o);if(t.effects){let u=0;const c=[];for(const f of t.effects){const h=f({setSelf:y=>{fe(e,l,y)},onSet:y=>cs(l,y,`effect[${u}]`,e)});h&&c.push(h),++u}o.cleanup=()=>{for(const f of c)f()}}return new $i(l,e),n||em(l,t,e),l}class Hm{constructor(t,n){x(this,"Update");x(this,"latestUpdateAtoms");x(this,"mutableAtoms");const r=$l(n,{key:`*${t.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=q(r,n),this.mutableAtoms=t,this.mutableAtoms.subject.subscribe(`store=${n.config.name}::tracker-atom-family`,s=>{if(s.token.family){const i=Ln(s.token.family.subKey);je(n,this.latestUpdateAtoms,i),new $i(s.token,n)}}),this.latestUpdateAtoms.subject.subscribe(`store=${n.config.name}::tracker-atom-family`,s=>{if(s.token.family){const i=Ln(s.token.family.subKey),o=je(n,this.mutableAtoms,i);o&&new $i(o,n)}})}}function Fd(e,t,n){const r={key:t.key,type:"mutable_atom_family"},s=e.families.get(t.key);s&&e.logger.error("❗","mutable_atom_family",t.key,`Overwriting an existing ${_r(s)} "${s.key}" in store "${e.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const i=new oe,a=Object.assign(l=>{const u=Y(l),c={key:t.key,subKey:u},f=`${t.key}(${u})`,h=L(e),y={key:f,default:()=>t.default(l),toJson:t.toJson,fromJson:t.fromJson,mutable:!0};t.effects&&(y.effects=t.effects(l));const w=Hl(h,y,c);return i.next({type:"state_creation",token:w}),w},r,{subject:i,install:l=>Fd(l,t),toJson:t.toJson,fromJson:t.fromJson,internalRoles:n});return e.families.set(t.key,a),Vm(a,t,e),new Hm(a,e),r}const rc=(e,t)=>{const n=L(t),r=`${e.key}:JSON`;return n.families.get(r)},wn=(e,t)=>{if(t.family){const r=L(e),i={key:`${t.family.key}:JSON`,type:"selector_family"},o=q(i,r),a=JSON.parse(t.family.subKey);return $e(e,o,a)}return{type:"selector",key:`${t.key}:JSON`}},Vd=e=>{const n={type:"atom",key:`*${e.key}`};return e.family&&(n.family={key:`*${e.family.key}`,subKey:e.family.subKey}),n};function Jm(e){return typeof e=="object"&&e!==null&&"do"in e&&"undo"in e&&"subscribe"in e}function Ta(e,t,n){const r=t.valueMap.get(e.key),s=n.valueMap.get(e.key);if(r===s){if(r===void 0)return typeof e.default=="function"?e.default():e.default;t.logger.info("📃","atom",e.key,"copying");const i=e.toJson(r),o=e.fromJson(i);return n.valueMap.set(e.key,o),new $i(e,t),o}return s}function zn(e,t,n,r){const s=r.valueMap.get(e);if(s instanceof va&&s.use(t),t instanceof Promise){const i=new va(t);return r.valueMap.set(e,i),i.then(o=>{zn(e,o,n,r),n.next({newValue:o,oldValue:i})}).catch(o=>{r.logger.error("💥","state",e,"rejected:",o)}),i}return r.valueMap.set(e,t),t}const Qm=(e,t)=>{let n=t.valueMap.get(e.key);if(e.type==="mutable_atom"&&Ee(t)){const{parent:r}=t;n=Ta(e,r,t)}return n},qm=(e,t)=>{const n=t.valueMap.get(e);if(n instanceof va){const r=n,s=t.selectors.get(e)??t.readonlySelectors.get(e);s&&r.use(s.get());return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("🗑","state",e,"evicted")},Ym=(e,t)=>L(t).atomsThatAreDefault.has(e),Kd=(e,t)=>{const n=L(t);n.atomsThatAreDefault=new Set(n.atomsThatAreDefault).add(e)},Gm=(e,t)=>{const n=L(t);n.atomsThatAreDefault=new Set(L(t).atomsThatAreDefault),n.atomsThatAreDefault.delete(e)};function vo(e,t,n){e.logger.info("🔨","atom",t.key,`creating in store "${e.config.name}"`);const r=L(e),s=r.atoms.get(t.key);if(s&&s.type==="atom")return e.logger.error("❌","atom",t.key,"Tried to create atom, but it already exists in the store."),jn(s);const i=new oe,o={...t,type:"atom",install:u=>(u.logger.info("🛠️","atom",t.key,`installing in store "${u.config.name}"`),vo(u,t,n)),subject:i};n&&(o.family=n);let a=t.default;t.default instanceof Function&&(a=t.default()),r.atoms.set(o.key,o),Kd(t.key,e),zn(t.key,a,i,r);const l=jn(o);if(t.effects){let u=0;const c=[];for(const f of t.effects){const h=f({setSelf:y=>{fe(e,l,y)},onSet:y=>cs(l,y,`effect[${u}]`,e)});h&&c.push(h),++u}o.cleanup=()=>{for(const f of c)f()}}return l}function Xm(e,t){if("mutable"in t){const s=Hl(e,t,void 0);return e.on.atomCreation.next(s),s}const r=vo(e,t,void 0);return e.on.atomCreation.next(r),r}function Jl(e,t){var i;const n=L(t),{key:r}=e,s=q(e,n);if(!s.family)t.logger.error("❌","atom",r,"Standalone atoms cannot be disposed.");else{(i=s.cleanup)==null||i.call(s);const o=t.valueMap.get(s.key);q({key:s.family.key,type:"atom_family"},t).subject.next({type:"state_disposal",token:e,value:o});const l=n.molecules.get(s.family.subKey);if(l&&l.tokens.delete(r),n.atoms.delete(r),n.valueMap.delete(r),n.selectorAtoms.delete(r),n.atomsThatAreDefault.delete(r),t.timelineTopics.delete(r),e.type==="mutable_atom"){const u=Vd(e);Jl(u,t),t.trackers.delete(r)}t.logger.info("🔥","atom",r,"deleted"),Ee(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.updates.push({type:"state_disposal",token:e}):t.on.atomDisposal.next(e)}}const Ql=ve.createContext(_e.STORE);function Zd(e,...t){let n;if(t.length===2){const r=t[0],s=t[1];if(e.config.lifespan==="immortal"){const i=je(e,r,s);if(!i)throw new hn(r,s,e);n=i}else n=$e(e,r,s)}else n=t[0];return n}function On(...e){const t=ve.useContext(Ql),n=Zd(t,...e),r=ve.useRef(null);return r.current===null&&(r.current=s=>{fe(t,n,s)}),r.current}function Je(...e){const t=ve.useContext(Ql),n=Zd(t,...e),r=ve.useId();return ve.useSyncExternalStore(s=>cs(n,s,`use-o:${r}`,t),()=>ze(t,n),()=>ze(t,n))}const ey=(e,{stringify:t,parse:n},r)=>({setSelf:s,onSet:i})=>{const o=e.getItem(r);o!=null&&s(n(o)),i(({newValue:a})=>{if(a==null){e.removeItem(r);return}e.setItem(r,t(a))})},Wd=et({key:"mySocketId__INTERNAL",default:void 0});Wn({key:"mySocketId",get:({get:e})=>e(Wd)});et({key:"myName",default:null,effects:typeof window>"u"?[]:[ey(window.localStorage,JSON,"myUsername")]});const Gs=et({key:"updateQueue",default:[]}),Bo=et({key:"serverConfirmedUpdateQueue",default:[]});function ty(e,t,n){const r=e.key,s=ze(n,Gs),i=ze(n,Bo),o=(u,c)=>{t.off(`continuity-init:${r}`,o);let f=0,h,y;for(const w of c)f%2===0?h=w:(y=w,"type"in h&&h.type==="mutable_atom"&&(h=wn(n,h)),fe(n,h,y)),f++;Sa(r,u,n)};t.off(`continuity-init:${r}`),t.on(`continuity-init:${r}`,o);const a=u=>{function c(h,y){if(n.logger.info("🧑‍⚖️","continuity",r,"reconciling updates"),fe(n,Gs,v=>(v.shift(),v)),h.id===y.id){const v=JSON.stringify(h.updates),N=JSON.stringify(y.updates);if(v===N){n.logger.info("✅","continuity",r,`results for ${h.id} match between client and server`),t.emit(`ack:${r}`,y.epoch);return}}else n.logger.info("❌","continuity",r,`thought update #${y.epoch} was ${h.key}:${h.id}, but it was actually ${y.key}:${y.id}`);n.logger.info("🧑‍⚖️","continuity",r,"updates do not match",h,y);const w=s.toReversed();for(const v of w)Gn("oldValue",v,n);n.logger.info("⏪","continuity",r,"undid optimistic updates:",w),Gn("oldValue",h,n),n.logger.info("⏪","continuity",r,"undid zeroth optimistic update",h),Gn("newValue",y,n),n.logger.info("⏩","continuity",r,"applied confirmed update",y),t.emit(`ack:${r}`,y.epoch);for(const v of s){const N={type:"transaction",key:v.key},{id:p,params:d}=v;yo(N,p,n)(...d)}n.logger.info("⏩","continuity",r,"reapplied subsequent optimistic updates:",s)}n.logger.info("🧑‍⚖️","continuity",r,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:i,optimisticUpdates:s});const f=s[0];if(f)if(n.logger.info("🧑‍⚖️","continuity",r,"has optimistic updates to reconcile"),u.epoch===f.epoch){n.logger.info("🧑‍⚖️","continuity",r,`epoch of confirmed update #${u.epoch} matches zeroth optimistic update`),c(f,u);for(const h of i){const y=s[0];if(h.epoch===(y==null?void 0:y.epoch))c(y,h);else break}}else n.logger.info("🧑‍⚖️","continuity",r,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${f.epoch}`),i.some(y=>y.epoch===u.epoch)||(n.logger.info("👈","continuity",r,"pushing confirmed update to queue",u),fe(n,Bo,y=>(y.push(u),y.sort((w,v)=>w.epoch-v.epoch),y)));else{n.logger.info("🧑‍⚖️","continuity",r,"has no optimistic updates to deal with");const h=Pm(r,n),y=ct(n);y&&h===u.epoch-1?(n.logger.info("✅","continuity",r,`integrating update #${u.epoch} (${u.key} ${u.id})`),Gn("newValue",u,n),t.emit(`ack:${r}`,u.epoch),Sa(r,u.epoch,n)):y&&h!==void 0&&(n.logger.info("🧑‍⚖️","continuity",r,`received update #${u.epoch} but still waiting for update #${h+1}`,{clientEpoch:h,serverEpoch:u.epoch}),i.some(v=>v.epoch===u.epoch)?n.logger.info("👍","continuity",r,`confirmed update #${u.epoch} is already enqueued`):(n.logger.info("👈","continuity",r,`pushing confirmed update #${u.epoch} to queue`),fe(n,Bo,v=>(v.push(u),v.sort((N,p)=>N.epoch-p.epoch),v))))}};t.off(`tx-new:${r}`),t.on(`tx-new:${r}`,a);const l=e.actions.map(u=>(Ld(r,u.key,n),Wm(u,f=>{n.logger.info("🤞","continuity",r,"enqueuing optimistic update");const h=s.findIndex(y=>y.id===f.id);h===-1?(n.logger.info("🤞","continuity",r,"enqueuing new optimistic update"),fe(n,Gs,y=>(y.push(f),y.sort((w,v)=>w.epoch-v.epoch),y))):(n.logger.info("🤞","continuity",r,`replacing existing optimistic update at index ${h}`),fe(n,Gs,y=>(y[h]=f,y))),t.emit(`tx-run:${r}`,{id:f.id,key:u.key,params:f.params})},`tx-run:${r}`,n)));return t.on(`reveal:${r}`,u=>{let c=0,f,h;for(const y of u)c%2===0?f=y:(h=y,ny(f,h,n)),c++}),t.on(`conceal:${r}`,u=>{for(const c of u)Jl(c,n)}),t.emit(`get:${r}`),()=>{t.off(`continuity-init:${r}`),t.off(`tx-new:${r}`);for(const u of l)u()}}function ny(e,t,n){if(t.family){const r=e.families.get(t.family.key);if(r){const s=e.molecules.get(t.family.subKey);if(s)$n(s,r,e);else if(e.config.lifespan==="immortal")throw new Error(`No molecule found for key "${t.family.subKey}"`);kr(e,r,Ln(t.family.subKey))}}fe(e,t,n)}const Hd=ve.createContext({socket:null,services:null}),ry=({children:e,socket:t})=>{const n=ve.useRef(new Map).current,r=On(Wd);return ve.useEffect(()=>{r(t==null?void 0:t.id),t==null||t.on("connect",()=>{r(t.id)}),t==null||t.on("disconnect",()=>{r(void 0)})},[t,r]),O.jsx(Hd.Provider,{value:{socket:t,services:n},children:e})},{NODE_ENV:sy}=globalThis.env??{},iy=sy==="development";function Xs(){}function oy(e,t){if(iy){const n=ve.useRef(Xs);ve.useEffect(()=>{let r=n.current;if(r===Xs)r=e()??Xs,n.current=r;else return()=>{r(),n.current=Xs}},t)}else ve.useEffect(e,t)}function ay(e){oy(e,[])}function ly(e,t){const{socket:n,services:r}=ve.useContext(Hd);ay(()=>{let s=r==null?void 0:r.get(e);return s?s[0]++:(s=[1,n?t(n):void 0],r==null||r.set(e,s)),()=>{var i;s&&(s[0]--,s[0]===0&&((i=s[1])==null||i.call(s),r==null||r.delete(e)))}})}function uy(e){const t=ve.useContext(Ql);ly(`tx-sync:${e.key}`,n=>ty(e,n,t))}var Jd={exports:{}},tt={},Qd={exports:{}},qd={};/**
24
- * @license React
25
- * scheduler.production.min.js
26
- *
27
- * Copyright (c) Facebook, Inc. and its affiliates.
28
- *
29
- * This source code is licensed under the MIT license found in the
30
- * LICENSE file in the root directory of this source tree.
31
- */(function(e){function t(I,U){var F=I.length;I.push(U);e:for(;0<F;){var ie=F-1>>>1,ke=I[ie];if(0<s(ke,U))I[ie]=U,I[F]=ke,F=ie;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var U=I[0],F=I.pop();if(F!==U){I[0]=F;e:for(var ie=0,ke=I.length,Qs=ke>>>1;ie<Qs;){var En=2*(ie+1)-1,zo=I[En],Tn=En+1,qs=I[Tn];if(0>s(zo,F))Tn<ke&&0>s(qs,zo)?(I[ie]=qs,I[Tn]=F,ie=Tn):(I[ie]=zo,I[En]=F,ie=En);else if(Tn<ke&&0>s(qs,F))I[ie]=qs,I[Tn]=F,ie=Tn;else break e}}return U}function s(I,U){var F=I.sortIndex-U.sortIndex;return F!==0?F:I.id-U.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var l=[],u=[],c=1,f=null,h=3,y=!1,w=!1,v=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,d=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function m(I){for(var U=n(u);U!==null;){if(U.callback===null)r(u);else if(U.startTime<=I)r(u),U.sortIndex=U.expirationTime,t(l,U);else break;U=n(u)}}function k(I){if(v=!1,m(I),!w)if(n(l)!==null)w=!0,we(C);else{var U=n(u);U!==null&&Pt(k,U.startTime-I)}}function C(I,U){w=!1,v&&(v=!1,p(S),S=-1),y=!0;var F=h;try{for(m(U),f=n(l);f!==null&&(!(f.expirationTime>U)||I&&!j());){var ie=f.callback;if(typeof ie=="function"){f.callback=null,h=f.priorityLevel;var ke=ie(f.expirationTime<=U);U=e.unstable_now(),typeof ke=="function"?f.callback=ke:f===n(l)&&r(l),m(U)}else r(l);f=n(l)}if(f!==null)var Qs=!0;else{var En=n(u);En!==null&&Pt(k,En.startTime-U),Qs=!1}return Qs}finally{f=null,h=F,y=!1}}var g=!1,_=null,S=-1,P=5,R=-1;function j(){return!(e.unstable_now()-R<P)}function B(){if(_!==null){var I=e.unstable_now();R=I;var U=!0;try{U=_(!0,I)}finally{U?X():(g=!1,_=null)}}else g=!1}var X;if(typeof d=="function")X=function(){d(B)};else if(typeof MessageChannel<"u"){var Oe=new MessageChannel,Fe=Oe.port2;Oe.port1.onmessage=B,X=function(){Fe.postMessage(null)}}else X=function(){N(B,0)};function we(I){_=I,g||(g=!0,X())}function Pt(I,U){S=N(function(){I(e.unstable_now())},U)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){w||y||(w=!0,we(C))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(l)},e.unstable_next=function(I){switch(h){case 1:case 2:case 3:var U=3;break;default:U=h}var F=h;h=U;try{return I()}finally{h=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,U){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var F=h;h=I;try{return U()}finally{h=F}},e.unstable_scheduleCallback=function(I,U,F){var ie=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?ie+F:ie):F=ie,I){case 1:var ke=-1;break;case 2:ke=250;break;case 5:ke=1073741823;break;case 4:ke=1e4;break;default:ke=5e3}return ke=F+ke,I={id:c++,callback:U,priorityLevel:I,startTime:F,expirationTime:ke,sortIndex:-1},F>ie?(I.sortIndex=F,t(u,I),n(l)===null&&I===n(u)&&(v?(p(S),S=-1):v=!0,Pt(k,F-ie))):(I.sortIndex=ke,t(l,I),w||y||(w=!0,we(C))),I},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(I){var U=h;return function(){var F=h;h=U;try{return I.apply(this,arguments)}finally{h=F}}}})(qd);Qd.exports=qd;var cy=Qd.exports;/**
32
- * @license React
33
- * react-dom.production.min.js
34
- *
35
- * Copyright (c) Facebook, Inc. and its affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- */var dy=ve,Xe=cy;function E(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Yd=new Set,ds={};function Hn(e,t){Sr(e,t),Sr(e+"Capture",t)}function Sr(e,t){for(ds[e]=t,e=0;e<t.length;e++)Yd.add(t[e])}var Ft=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ca=Object.prototype.hasOwnProperty,fy=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,sc={},ic={};function hy(e){return Ca.call(ic,e)?!0:Ca.call(sc,e)?!1:fy.test(e)?ic[e]=!0:(sc[e]=!0,!1)}function py(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function my(e,t,n,r){if(t===null||typeof t>"u"||py(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Be(e,t,n,r,s,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Re={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Re[e]=new Be(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Re[t]=new Be(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Re[e]=new Be(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Re[e]=new Be(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Re[e]=new Be(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Re[e]=new Be(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Re[e]=new Be(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Re[e]=new Be(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Re[e]=new Be(e,5,!1,e.toLowerCase(),null,!1,!1)});var ql=/[\-:]([a-z])/g;function Yl(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ql,Yl);Re[t]=new Be(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ql,Yl);Re[t]=new Be(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ql,Yl);Re[t]=new Be(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Re[e]=new Be(e,1,!1,e.toLowerCase(),null,!1,!1)});Re.xlinkHref=new Be("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Re[e]=new Be(e,1,!1,e.toLowerCase(),null,!0,!0)});function Gl(e,t,n,r){var s=Re.hasOwnProperty(t)?Re[t]:null;(s!==null?s.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(my(t,n,s,r)&&(n=null),r||s===null?hy(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):s.mustUseProperty?e[s.propertyName]=n===null?s.type===3?!1:"":n:(t=s.attributeName,r=s.attributeNamespace,n===null?e.removeAttribute(t):(s=s.type,n=s===3||s===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Jt=dy.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,ei=Symbol.for("react.element"),Xn=Symbol.for("react.portal"),er=Symbol.for("react.fragment"),Xl=Symbol.for("react.strict_mode"),Ra=Symbol.for("react.profiler"),Gd=Symbol.for("react.provider"),Xd=Symbol.for("react.context"),eu=Symbol.for("react.forward_ref"),Oa=Symbol.for("react.suspense"),Na=Symbol.for("react.suspense_list"),tu=Symbol.for("react.memo"),qt=Symbol.for("react.lazy"),ef=Symbol.for("react.offscreen"),oc=Symbol.iterator;function zr(e){return e===null||typeof e!="object"?null:(e=oc&&e[oc]||e["@@iterator"],typeof e=="function"?e:null)}var ce=Object.assign,Fo;function Hr(e){if(Fo===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fo=t&&t[1]||""}return`
40
- `+Fo+e}var Vo=!1;function Ko(e,t){if(!e||Vo)return"";Vo=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var s=u.stack.split(`
41
- `),i=r.stack.split(`
42
- `),o=s.length-1,a=i.length-1;1<=o&&0<=a&&s[o]!==i[a];)a--;for(;1<=o&&0<=a;o--,a--)if(s[o]!==i[a]){if(o!==1||a!==1)do if(o--,a--,0>a||s[o]!==i[a]){var l=`
43
- `+s[o].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),l}while(1<=o&&0<=a);break}}}finally{Vo=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Hr(e):""}function yy(e){switch(e.tag){case 5:return Hr(e.type);case 16:return Hr("Lazy");case 13:return Hr("Suspense");case 19:return Hr("SuspenseList");case 0:case 2:case 15:return e=Ko(e.type,!1),e;case 11:return e=Ko(e.type.render,!1),e;case 1:return e=Ko(e.type,!0),e;default:return""}}function ba(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case er:return"Fragment";case Xn:return"Portal";case Ra:return"Profiler";case Xl:return"StrictMode";case Oa:return"Suspense";case Na:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Xd:return(e.displayName||"Context")+".Consumer";case Gd:return(e._context.displayName||"Context")+".Provider";case eu:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case tu:return t=e.displayName||null,t!==null?t:ba(e.type)||"Memo";case qt:t=e._payload,e=e._init;try{return ba(e(t))}catch{}}return null}function gy(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ba(t);case 8:return t===Xl?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function pn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function vy(e){var t=tf(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ti(e){e._valueTracker||(e._valueTracker=vy(e))}function nf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=tf(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Li(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Aa(e,t){var n=t.checked;return ce({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function ac(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=pn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function rf(e,t){t=t.checked,t!=null&&Gl(e,"checked",t,!1)}function Ia(e,t){rf(e,t);var n=pn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ma(e,t.type,n):t.hasOwnProperty("defaultValue")&&Ma(e,t.type,pn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function lc(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Ma(e,t,n){(t!=="number"||Li(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Jr=Array.isArray;function fr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s<n.length;s++)t["$"+n[s]]=!0;for(n=0;n<e.length;n++)s=t.hasOwnProperty("$"+e[n].value),e[n].selected!==s&&(e[n].selected=s),s&&r&&(e[n].defaultSelected=!0)}else{for(n=""+pn(n),t=null,s=0;s<e.length;s++){if(e[s].value===n){e[s].selected=!0,r&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Pa(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(E(91));return ce({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function uc(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(E(92));if(Jr(n)){if(1<n.length)throw Error(E(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:pn(n)}}function sf(e,t){var n=pn(t.value),r=pn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function cc(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function of(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ja(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?of(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var ni,af=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,s){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,s)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(ni=ni||document.createElement("div"),ni.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ni.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var es={animationIterationCount:!0,aspectRatio:!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,gridArea:!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},_y=["Webkit","ms","Moz","O"];Object.keys(es).forEach(function(e){_y.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),es[t]=es[e]})});function lf(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||es.hasOwnProperty(e)&&es[e]?(""+t).trim():t+"px"}function uf(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=lf(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var wy=ce({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function $a(e,t){if(t){if(wy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(E(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(E(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(E(61))}if(t.style!=null&&typeof t.style!="object")throw Error(E(62))}}function La(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var za=null;function nu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Da=null,hr=null,pr=null;function dc(e){if(e=Ws(e)){if(typeof Da!="function")throw Error(E(280));var t=e.stateNode;t&&(t=xo(t),Da(e.stateNode,e.type,t))}}function cf(e){hr?pr?pr.push(e):pr=[e]:hr=e}function df(){if(hr){var e=hr,t=pr;if(pr=hr=null,dc(e),t)for(e=0;e<t.length;e++)dc(t[e])}}function ff(e,t){return e(t)}function hf(){}var Zo=!1;function pf(e,t,n){if(Zo)return e(t,n);Zo=!0;try{return ff(e,t,n)}finally{Zo=!1,(hr!==null||pr!==null)&&(hf(),df())}}function hs(e,t){var n=e.stateNode;if(n===null)return null;var r=xo(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(E(231,t,typeof n));return n}var Ua=!1;if(Ft)try{var Dr={};Object.defineProperty(Dr,"passive",{get:function(){Ua=!0}}),window.addEventListener("test",Dr,Dr),window.removeEventListener("test",Dr,Dr)}catch{Ua=!1}function ky(e,t,n,r,s,i,o,a,l){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var ts=!1,zi=null,Di=!1,Ba=null,Sy={onError:function(e){ts=!0,zi=e}};function xy(e,t,n,r,s,i,o,a,l){ts=!1,zi=null,ky.apply(Sy,arguments)}function Ey(e,t,n,r,s,i,o,a,l){if(xy.apply(this,arguments),ts){if(ts){var u=zi;ts=!1,zi=null}else throw Error(E(198));Di||(Di=!0,Ba=u)}}function Jn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function mf(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function fc(e){if(Jn(e)!==e)throw Error(E(188))}function Ty(e){var t=e.alternate;if(!t){if(t=Jn(e),t===null)throw Error(E(188));return t!==e?null:e}for(var n=e,r=t;;){var s=n.return;if(s===null)break;var i=s.alternate;if(i===null){if(r=s.return,r!==null){n=r;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===n)return fc(s),e;if(i===r)return fc(s),t;i=i.sibling}throw Error(E(188))}if(n.return!==r.return)n=s,r=i;else{for(var o=!1,a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o){for(a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o)throw Error(E(189))}}if(n.alternate!==r)throw Error(E(190))}if(n.tag!==3)throw Error(E(188));return n.stateNode.current===n?e:t}function yf(e){return e=Ty(e),e!==null?gf(e):null}function gf(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=gf(e);if(t!==null)return t;e=e.sibling}return null}var vf=Xe.unstable_scheduleCallback,hc=Xe.unstable_cancelCallback,Cy=Xe.unstable_shouldYield,Ry=Xe.unstable_requestPaint,he=Xe.unstable_now,Oy=Xe.unstable_getCurrentPriorityLevel,ru=Xe.unstable_ImmediatePriority,_f=Xe.unstable_UserBlockingPriority,Ui=Xe.unstable_NormalPriority,Ny=Xe.unstable_LowPriority,wf=Xe.unstable_IdlePriority,_o=null,Rt=null;function by(e){if(Rt&&typeof Rt.onCommitFiberRoot=="function")try{Rt.onCommitFiberRoot(_o,e,void 0,(e.current.flags&128)===128)}catch{}}var gt=Math.clz32?Math.clz32:My,Ay=Math.log,Iy=Math.LN2;function My(e){return e>>>=0,e===0?32:31-(Ay(e)/Iy|0)|0}var ri=64,si=4194304;function Qr(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Bi(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Qr(a):(i&=o,i!==0&&(r=Qr(i)))}else o=n&~s,o!==0?r=Qr(o):i!==0&&(r=Qr(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-gt(t),s=1<<n,r|=e[n],t&=~s;return r}function Py(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jy(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,s=e.expirationTimes,i=e.pendingLanes;0<i;){var o=31-gt(i),a=1<<o,l=s[o];l===-1?(!(a&n)||a&r)&&(s[o]=Py(a,t)):l<=t&&(e.expiredLanes|=a),i&=~a}}function Fa(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function kf(){var e=ri;return ri<<=1,!(ri&4194240)&&(ri=64),e}function Wo(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Ks(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-gt(t),e[t]=n}function $y(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var s=31-gt(n),i=1<<s;t[s]=0,r[s]=-1,e[s]=-1,n&=~i}}function su(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-gt(n),s=1<<r;s&t|e[r]&t&&(e[r]|=t),n&=~s}}var G=0;function Sf(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var xf,iu,Ef,Tf,Cf,Va=!1,ii=[],rn=null,sn=null,on=null,ps=new Map,ms=new Map,Gt=[],Ly="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function pc(e,t){switch(e){case"focusin":case"focusout":rn=null;break;case"dragenter":case"dragleave":sn=null;break;case"mouseover":case"mouseout":on=null;break;case"pointerover":case"pointerout":ps.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":ms.delete(t.pointerId)}}function Ur(e,t,n,r,s,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[s]},t!==null&&(t=Ws(t),t!==null&&iu(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function zy(e,t,n,r,s){switch(t){case"focusin":return rn=Ur(rn,e,t,n,r,s),!0;case"dragenter":return sn=Ur(sn,e,t,n,r,s),!0;case"mouseover":return on=Ur(on,e,t,n,r,s),!0;case"pointerover":var i=s.pointerId;return ps.set(i,Ur(ps.get(i)||null,e,t,n,r,s)),!0;case"gotpointercapture":return i=s.pointerId,ms.set(i,Ur(ms.get(i)||null,e,t,n,r,s)),!0}return!1}function Rf(e){var t=Nn(e.target);if(t!==null){var n=Jn(t);if(n!==null){if(t=n.tag,t===13){if(t=mf(n),t!==null){e.blockedOn=t,Cf(e.priority,function(){Ef(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wi(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Ka(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);za=r,n.target.dispatchEvent(r),za=null}else return t=Ws(n),t!==null&&iu(t),e.blockedOn=n,!1;t.shift()}return!0}function mc(e,t,n){wi(e)&&n.delete(t)}function Dy(){Va=!1,rn!==null&&wi(rn)&&(rn=null),sn!==null&&wi(sn)&&(sn=null),on!==null&&wi(on)&&(on=null),ps.forEach(mc),ms.forEach(mc)}function Br(e,t){e.blockedOn===t&&(e.blockedOn=null,Va||(Va=!0,Xe.unstable_scheduleCallback(Xe.unstable_NormalPriority,Dy)))}function ys(e){function t(s){return Br(s,e)}if(0<ii.length){Br(ii[0],e);for(var n=1;n<ii.length;n++){var r=ii[n];r.blockedOn===e&&(r.blockedOn=null)}}for(rn!==null&&Br(rn,e),sn!==null&&Br(sn,e),on!==null&&Br(on,e),ps.forEach(t),ms.forEach(t),n=0;n<Gt.length;n++)r=Gt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Gt.length&&(n=Gt[0],n.blockedOn===null);)Rf(n),n.blockedOn===null&&Gt.shift()}var mr=Jt.ReactCurrentBatchConfig,Fi=!0;function Uy(e,t,n,r){var s=G,i=mr.transition;mr.transition=null;try{G=1,ou(e,t,n,r)}finally{G=s,mr.transition=i}}function By(e,t,n,r){var s=G,i=mr.transition;mr.transition=null;try{G=4,ou(e,t,n,r)}finally{G=s,mr.transition=i}}function ou(e,t,n,r){if(Fi){var s=Ka(e,t,n,r);if(s===null)na(e,t,r,Vi,n),pc(e,r);else if(zy(s,e,t,n,r))r.stopPropagation();else if(pc(e,r),t&4&&-1<Ly.indexOf(e)){for(;s!==null;){var i=Ws(s);if(i!==null&&xf(i),i=Ka(e,t,n,r),i===null&&na(e,t,r,Vi,n),i===s)break;s=i}s!==null&&r.stopPropagation()}else na(e,t,r,null,n)}}var Vi=null;function Ka(e,t,n,r){if(Vi=null,e=nu(r),e=Nn(e),e!==null)if(t=Jn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=mf(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Vi=e,null}function Of(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Oy()){case ru:return 1;case _f:return 4;case Ui:case Ny:return 16;case wf:return 536870912;default:return 16}default:return 16}}var tn=null,au=null,ki=null;function Nf(){if(ki)return ki;var e,t=au,n=t.length,r,s="value"in tn?tn.value:tn.textContent,i=s.length;for(e=0;e<n&&t[e]===s[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===s[i-r];r++);return ki=s.slice(e,1<r?1-r:void 0)}function Si(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function oi(){return!0}function yc(){return!1}function nt(e){function t(n,r,s,i,o){this._reactName=n,this._targetInst=s,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(i):i[a]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?oi:yc,this.isPropagationStopped=yc,this}return ce(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=oi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=oi)},persist:function(){},isPersistent:oi}),t}var jr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lu=nt(jr),Zs=ce({},jr,{view:0,detail:0}),Fy=nt(Zs),Ho,Jo,Fr,wo=ce({},Zs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:uu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Fr&&(Fr&&e.type==="mousemove"?(Ho=e.screenX-Fr.screenX,Jo=e.screenY-Fr.screenY):Jo=Ho=0,Fr=e),Ho)},movementY:function(e){return"movementY"in e?e.movementY:Jo}}),gc=nt(wo),Vy=ce({},wo,{dataTransfer:0}),Ky=nt(Vy),Zy=ce({},Zs,{relatedTarget:0}),Qo=nt(Zy),Wy=ce({},jr,{animationName:0,elapsedTime:0,pseudoElement:0}),Hy=nt(Wy),Jy=ce({},jr,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qy=nt(Jy),qy=ce({},jr,{data:0}),vc=nt(qy),Yy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Gy={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Xy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eg(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Xy[e])?!!t[e]:!1}function uu(){return eg}var tg=ce({},Zs,{key:function(e){if(e.key){var t=Yy[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Si(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Gy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:uu,charCode:function(e){return e.type==="keypress"?Si(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Si(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ng=nt(tg),rg=ce({},wo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),_c=nt(rg),sg=ce({},Zs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:uu}),ig=nt(sg),og=ce({},jr,{propertyName:0,elapsedTime:0,pseudoElement:0}),ag=nt(og),lg=ce({},wo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ug=nt(lg),cg=[9,13,27,32],cu=Ft&&"CompositionEvent"in window,ns=null;Ft&&"documentMode"in document&&(ns=document.documentMode);var dg=Ft&&"TextEvent"in window&&!ns,bf=Ft&&(!cu||ns&&8<ns&&11>=ns),wc=" ",kc=!1;function Af(e,t){switch(e){case"keyup":return cg.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function If(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var tr=!1;function fg(e,t){switch(e){case"compositionend":return If(t);case"keypress":return t.which!==32?null:(kc=!0,wc);case"textInput":return e=t.data,e===wc&&kc?null:e;default:return null}}function hg(e,t){if(tr)return e==="compositionend"||!cu&&Af(e,t)?(e=Nf(),ki=au=tn=null,tr=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bf&&t.locale!=="ko"?null:t.data;default:return null}}var pg={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Sc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!pg[e.type]:t==="textarea"}function Mf(e,t,n,r){cf(r),t=Ki(t,"onChange"),0<t.length&&(n=new lu("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var rs=null,gs=null;function mg(e){Kf(e,0)}function ko(e){var t=sr(e);if(nf(t))return e}function yg(e,t){if(e==="change")return t}var Pf=!1;if(Ft){var qo;if(Ft){var Yo="oninput"in document;if(!Yo){var xc=document.createElement("div");xc.setAttribute("oninput","return;"),Yo=typeof xc.oninput=="function"}qo=Yo}else qo=!1;Pf=qo&&(!document.documentMode||9<document.documentMode)}function Ec(){rs&&(rs.detachEvent("onpropertychange",jf),gs=rs=null)}function jf(e){if(e.propertyName==="value"&&ko(gs)){var t=[];Mf(t,gs,e,nu(e)),pf(mg,t)}}function gg(e,t,n){e==="focusin"?(Ec(),rs=t,gs=n,rs.attachEvent("onpropertychange",jf)):e==="focusout"&&Ec()}function vg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ko(gs)}function _g(e,t){if(e==="click")return ko(t)}function wg(e,t){if(e==="input"||e==="change")return ko(t)}function kg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var wt=typeof Object.is=="function"?Object.is:kg;function vs(e,t){if(wt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var s=n[r];if(!Ca.call(t,s)||!wt(e[s],t[s]))return!1}return!0}function Tc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cc(e,t){var n=Tc(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Tc(n)}}function $f(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$f(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Lf(){for(var e=window,t=Li();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Li(e.document)}return t}function du(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function Sg(e){var t=Lf(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&$f(n.ownerDocument.documentElement,n)){if(r!==null&&du(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=Cc(n,i);var o=Cc(n,r);s&&o&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var xg=Ft&&"documentMode"in document&&11>=document.documentMode,nr=null,Za=null,ss=null,Wa=!1;function Rc(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Wa||nr==null||nr!==Li(r)||(r=nr,"selectionStart"in r&&du(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ss&&vs(ss,r)||(ss=r,r=Ki(Za,"onSelect"),0<r.length&&(t=new lu("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=nr)))}function ai(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var rr={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionend:ai("Transition","TransitionEnd")},Go={},zf={};Ft&&(zf=document.createElement("div").style,"AnimationEvent"in window||(delete rr.animationend.animation,delete rr.animationiteration.animation,delete rr.animationstart.animation),"TransitionEvent"in window||delete rr.transitionend.transition);function So(e){if(Go[e])return Go[e];if(!rr[e])return e;var t=rr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in zf)return Go[e]=t[n];return e}var Df=So("animationend"),Uf=So("animationiteration"),Bf=So("animationstart"),Ff=So("transitionend"),Vf=new Map,Oc="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function kn(e,t){Vf.set(e,t),Hn(t,[e])}for(var Xo=0;Xo<Oc.length;Xo++){var ea=Oc[Xo],Eg=ea.toLowerCase(),Tg=ea[0].toUpperCase()+ea.slice(1);kn(Eg,"on"+Tg)}kn(Df,"onAnimationEnd");kn(Uf,"onAnimationIteration");kn(Bf,"onAnimationStart");kn("dblclick","onDoubleClick");kn("focusin","onFocus");kn("focusout","onBlur");kn(Ff,"onTransitionEnd");Sr("onMouseEnter",["mouseout","mouseover"]);Sr("onMouseLeave",["mouseout","mouseover"]);Sr("onPointerEnter",["pointerout","pointerover"]);Sr("onPointerLeave",["pointerout","pointerover"]);Hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Hn("onBeforeInput",["compositionend","keypress","textInput","paste"]);Hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Cg=new Set("cancel close invalid load scroll toggle".split(" ").concat(qr));function Nc(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,Ey(r,t,void 0,e),e.currentTarget=null}function Kf(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],s=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],l=a.instance,u=a.currentTarget;if(a=a.listener,l!==i&&s.isPropagationStopped())break e;Nc(s,a,u),i=l}else for(o=0;o<r.length;o++){if(a=r[o],l=a.instance,u=a.currentTarget,a=a.listener,l!==i&&s.isPropagationStopped())break e;Nc(s,a,u),i=l}}}if(Di)throw e=Ba,Di=!1,Ba=null,e}function te(e,t){var n=t[Ya];n===void 0&&(n=t[Ya]=new Set);var r=e+"__bubble";n.has(r)||(Zf(t,e,2,!1),n.add(r))}function ta(e,t,n){var r=0;t&&(r|=4),Zf(n,e,r,t)}var li="_reactListening"+Math.random().toString(36).slice(2);function _s(e){if(!e[li]){e[li]=!0,Yd.forEach(function(n){n!=="selectionchange"&&(Cg.has(n)||ta(n,!1,e),ta(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[li]||(t[li]=!0,ta("selectionchange",!1,t))}}function Zf(e,t,n,r){switch(Of(t)){case 1:var s=Uy;break;case 4:s=By;break;default:s=ou}n=s.bind(null,t,n,e),s=void 0,!Ua||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),r?s!==void 0?e.addEventListener(t,n,{capture:!0,passive:s}):e.addEventListener(t,n,!0):s!==void 0?e.addEventListener(t,n,{passive:s}):e.addEventListener(t,n,!1)}function na(e,t,n,r,s){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===s||a.nodeType===8&&a.parentNode===s)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&(l=o.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;o=o.return}for(;a!==null;){if(o=Nn(a),o===null)return;if(l=o.tag,l===5||l===6){r=i=o;continue e}a=a.parentNode}}r=r.return}pf(function(){var u=i,c=nu(n),f=[];e:{var h=Vf.get(e);if(h!==void 0){var y=lu,w=e;switch(e){case"keypress":if(Si(n)===0)break e;case"keydown":case"keyup":y=ng;break;case"focusin":w="focus",y=Qo;break;case"focusout":w="blur",y=Qo;break;case"beforeblur":case"afterblur":y=Qo;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":y=gc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":y=Ky;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":y=ig;break;case Df:case Uf:case Bf:y=Hy;break;case Ff:y=ag;break;case"scroll":y=Fy;break;case"wheel":y=ug;break;case"copy":case"cut":case"paste":y=Qy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":y=_c}var v=(t&4)!==0,N=!v&&e==="scroll",p=v?h!==null?h+"Capture":null:h;v=[];for(var d=u,m;d!==null;){m=d;var k=m.stateNode;if(m.tag===5&&k!==null&&(m=k,p!==null&&(k=hs(d,p),k!=null&&v.push(ws(d,k,m)))),N)break;d=d.return}0<v.length&&(h=new y(h,w,null,n,c),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",y=e==="mouseout"||e==="pointerout",h&&n!==za&&(w=n.relatedTarget||n.fromElement)&&(Nn(w)||w[Vt]))break e;if((y||h)&&(h=c.window===c?c:(h=c.ownerDocument)?h.defaultView||h.parentWindow:window,y?(w=n.relatedTarget||n.toElement,y=u,w=w?Nn(w):null,w!==null&&(N=Jn(w),w!==N||w.tag!==5&&w.tag!==6)&&(w=null)):(y=null,w=u),y!==w)){if(v=gc,k="onMouseLeave",p="onMouseEnter",d="mouse",(e==="pointerout"||e==="pointerover")&&(v=_c,k="onPointerLeave",p="onPointerEnter",d="pointer"),N=y==null?h:sr(y),m=w==null?h:sr(w),h=new v(k,d+"leave",y,n,c),h.target=N,h.relatedTarget=m,k=null,Nn(c)===u&&(v=new v(p,d+"enter",w,n,c),v.target=m,v.relatedTarget=N,k=v),N=k,y&&w)t:{for(v=y,p=w,d=0,m=v;m;m=Qn(m))d++;for(m=0,k=p;k;k=Qn(k))m++;for(;0<d-m;)v=Qn(v),d--;for(;0<m-d;)p=Qn(p),m--;for(;d--;){if(v===p||p!==null&&v===p.alternate)break t;v=Qn(v),p=Qn(p)}v=null}else v=null;y!==null&&bc(f,h,y,v,!1),w!==null&&N!==null&&bc(f,N,w,v,!0)}}e:{if(h=u?sr(u):window,y=h.nodeName&&h.nodeName.toLowerCase(),y==="select"||y==="input"&&h.type==="file")var C=yg;else if(Sc(h))if(Pf)C=wg;else{C=vg;var g=gg}else(y=h.nodeName)&&y.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=_g);if(C&&(C=C(e,u))){Mf(f,C,n,c);break e}g&&g(e,h,u),e==="focusout"&&(g=h._wrapperState)&&g.controlled&&h.type==="number"&&Ma(h,"number",h.value)}switch(g=u?sr(u):window,e){case"focusin":(Sc(g)||g.contentEditable==="true")&&(nr=g,Za=u,ss=null);break;case"focusout":ss=Za=nr=null;break;case"mousedown":Wa=!0;break;case"contextmenu":case"mouseup":case"dragend":Wa=!1,Rc(f,n,c);break;case"selectionchange":if(xg)break;case"keydown":case"keyup":Rc(f,n,c)}var _;if(cu)e:{switch(e){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else tr?Af(e,n)&&(S="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(S="onCompositionStart");S&&(bf&&n.locale!=="ko"&&(tr||S!=="onCompositionStart"?S==="onCompositionEnd"&&tr&&(_=Nf()):(tn=c,au="value"in tn?tn.value:tn.textContent,tr=!0)),g=Ki(u,S),0<g.length&&(S=new vc(S,e,null,n,c),f.push({event:S,listeners:g}),_?S.data=_:(_=If(n),_!==null&&(S.data=_)))),(_=dg?fg(e,n):hg(e,n))&&(u=Ki(u,"onBeforeInput"),0<u.length&&(c=new vc("onBeforeInput","beforeinput",null,n,c),f.push({event:c,listeners:u}),c.data=_))}Kf(f,t)})}function ws(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ki(e,t){for(var n=t+"Capture",r=[];e!==null;){var s=e,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=hs(e,n),i!=null&&r.unshift(ws(e,i,s)),i=hs(e,t),i!=null&&r.push(ws(e,i,s))),e=e.return}return r}function Qn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function bc(e,t,n,r,s){for(var i=t._reactName,o=[];n!==null&&n!==r;){var a=n,l=a.alternate,u=a.stateNode;if(l!==null&&l===r)break;a.tag===5&&u!==null&&(a=u,s?(l=hs(n,i),l!=null&&o.unshift(ws(n,l,a))):s||(l=hs(n,i),l!=null&&o.push(ws(n,l,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Rg=/\r\n?/g,Og=/\u0000|\uFFFD/g;function Ac(e){return(typeof e=="string"?e:""+e).replace(Rg,`
44
- `).replace(Og,"")}function ui(e,t,n){if(t=Ac(t),Ac(e)!==t&&n)throw Error(E(425))}function Zi(){}var Ha=null,Ja=null;function Qa(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qa=typeof setTimeout=="function"?setTimeout:void 0,Ng=typeof clearTimeout=="function"?clearTimeout:void 0,Ic=typeof Promise=="function"?Promise:void 0,bg=typeof queueMicrotask=="function"?queueMicrotask:typeof Ic<"u"?function(e){return Ic.resolve(null).then(e).catch(Ag)}:qa;function Ag(e){setTimeout(function(){throw e})}function ra(e,t){var n=t,r=0;do{var s=n.nextSibling;if(e.removeChild(n),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(r===0){e.removeChild(s),ys(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=s}while(n);ys(t)}function an(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function Mc(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var $r=Math.random().toString(36).slice(2),Tt="__reactFiber$"+$r,ks="__reactProps$"+$r,Vt="__reactContainer$"+$r,Ya="__reactEvents$"+$r,Ig="__reactListeners$"+$r,Mg="__reactHandles$"+$r;function Nn(e){var t=e[Tt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Vt]||n[Tt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Mc(e);e!==null;){if(n=e[Tt])return n;e=Mc(e)}return t}e=n,n=e.parentNode}return null}function Ws(e){return e=e[Tt]||e[Vt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function sr(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(E(33))}function xo(e){return e[ks]||null}var Ga=[],ir=-1;function Sn(e){return{current:e}}function ne(e){0>ir||(e.current=Ga[ir],Ga[ir]=null,ir--)}function ee(e,t){ir++,Ga[ir]=e.current,e.current=t}var mn={},Ie=Sn(mn),Ze=Sn(!1),Dn=mn;function xr(e,t){var n=e.type.contextTypes;if(!n)return mn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function We(e){return e=e.childContextTypes,e!=null}function Wi(){ne(Ze),ne(Ie)}function Pc(e,t,n){if(Ie.current!==mn)throw Error(E(168));ee(Ie,t),ee(Ze,n)}function Wf(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(E(108,gy(e)||"Unknown",s));return ce({},n,r)}function Hi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||mn,Dn=Ie.current,ee(Ie,e),ee(Ze,Ze.current),!0}function jc(e,t,n){var r=e.stateNode;if(!r)throw Error(E(169));n?(e=Wf(e,t,Dn),r.__reactInternalMemoizedMergedChildContext=e,ne(Ze),ne(Ie),ee(Ie,e)):ne(Ze),ee(Ze,n)}var Lt=null,Eo=!1,sa=!1;function Hf(e){Lt===null?Lt=[e]:Lt.push(e)}function Pg(e){Eo=!0,Hf(e)}function xn(){if(!sa&&Lt!==null){sa=!0;var e=0,t=G;try{var n=Lt;for(G=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Lt=null,Eo=!1}catch(s){throw Lt!==null&&(Lt=Lt.slice(e+1)),vf(ru,xn),s}finally{G=t,sa=!1}}return null}var or=[],ar=0,Ji=null,Qi=0,rt=[],st=0,Un=null,Dt=1,Ut="";function Cn(e,t){or[ar++]=Qi,or[ar++]=Ji,Ji=e,Qi=t}function Jf(e,t,n){rt[st++]=Dt,rt[st++]=Ut,rt[st++]=Un,Un=e;var r=Dt;e=Ut;var s=32-gt(r)-1;r&=~(1<<s),n+=1;var i=32-gt(t)+s;if(30<i){var o=s-s%5;i=(r&(1<<o)-1).toString(32),r>>=o,s-=o,Dt=1<<32-gt(t)+s|n<<s|r,Ut=i+e}else Dt=1<<i|n<<s|r,Ut=e}function fu(e){e.return!==null&&(Cn(e,1),Jf(e,1,0))}function hu(e){for(;e===Ji;)Ji=or[--ar],or[ar]=null,Qi=or[--ar],or[ar]=null;for(;e===Un;)Un=rt[--st],rt[st]=null,Ut=rt[--st],rt[st]=null,Dt=rt[--st],rt[st]=null}var Ye=null,qe=null,se=!1,mt=null;function Qf(e,t){var n=ot(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function $c(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,Ye=e,qe=an(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,Ye=e,qe=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=Un!==null?{id:Dt,overflow:Ut}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=ot(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,Ye=e,qe=null,!0):!1;default:return!1}}function Xa(e){return(e.mode&1)!==0&&(e.flags&128)===0}function el(e){if(se){var t=qe;if(t){var n=t;if(!$c(e,t)){if(Xa(e))throw Error(E(418));t=an(n.nextSibling);var r=Ye;t&&$c(e,t)?Qf(r,n):(e.flags=e.flags&-4097|2,se=!1,Ye=e)}}else{if(Xa(e))throw Error(E(418));e.flags=e.flags&-4097|2,se=!1,Ye=e}}}function Lc(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ye=e}function ci(e){if(e!==Ye)return!1;if(!se)return Lc(e),se=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Qa(e.type,e.memoizedProps)),t&&(t=qe)){if(Xa(e))throw qf(),Error(E(418));for(;t;)Qf(e,t),t=an(t.nextSibling)}if(Lc(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(E(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){qe=an(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}qe=null}}else qe=Ye?an(e.stateNode.nextSibling):null;return!0}function qf(){for(var e=qe;e;)e=an(e.nextSibling)}function Er(){qe=Ye=null,se=!1}function pu(e){mt===null?mt=[e]:mt.push(e)}var jg=Jt.ReactCurrentBatchConfig;function Vr(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(E(309));var r=n.stateNode}if(!r)throw Error(E(147,e));var s=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(o){var a=s.refs;o===null?delete a[i]:a[i]=o},t._stringRef=i,t)}if(typeof e!="string")throw Error(E(284));if(!n._owner)throw Error(E(290,e))}return e}function di(e,t){throw e=Object.prototype.toString.call(t),Error(E(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function zc(e){var t=e._init;return t(e._payload)}function Yf(e){function t(p,d){if(e){var m=p.deletions;m===null?(p.deletions=[d],p.flags|=16):m.push(d)}}function n(p,d){if(!e)return null;for(;d!==null;)t(p,d),d=d.sibling;return null}function r(p,d){for(p=new Map;d!==null;)d.key!==null?p.set(d.key,d):p.set(d.index,d),d=d.sibling;return p}function s(p,d){return p=dn(p,d),p.index=0,p.sibling=null,p}function i(p,d,m){return p.index=m,e?(m=p.alternate,m!==null?(m=m.index,m<d?(p.flags|=2,d):m):(p.flags|=2,d)):(p.flags|=1048576,d)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,d,m,k){return d===null||d.tag!==6?(d=da(m,p.mode,k),d.return=p,d):(d=s(d,m),d.return=p,d)}function l(p,d,m,k){var C=m.type;return C===er?c(p,d,m.props.children,k,m.key):d!==null&&(d.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===qt&&zc(C)===d.type)?(k=s(d,m.props),k.ref=Vr(p,d,m),k.return=p,k):(k=Ni(m.type,m.key,m.props,null,p.mode,k),k.ref=Vr(p,d,m),k.return=p,k)}function u(p,d,m,k){return d===null||d.tag!==4||d.stateNode.containerInfo!==m.containerInfo||d.stateNode.implementation!==m.implementation?(d=fa(m,p.mode,k),d.return=p,d):(d=s(d,m.children||[]),d.return=p,d)}function c(p,d,m,k,C){return d===null||d.tag!==7?(d=Mn(m,p.mode,k,C),d.return=p,d):(d=s(d,m),d.return=p,d)}function f(p,d,m){if(typeof d=="string"&&d!==""||typeof d=="number")return d=da(""+d,p.mode,m),d.return=p,d;if(typeof d=="object"&&d!==null){switch(d.$$typeof){case ei:return m=Ni(d.type,d.key,d.props,null,p.mode,m),m.ref=Vr(p,null,d),m.return=p,m;case Xn:return d=fa(d,p.mode,m),d.return=p,d;case qt:var k=d._init;return f(p,k(d._payload),m)}if(Jr(d)||zr(d))return d=Mn(d,p.mode,m,null),d.return=p,d;di(p,d)}return null}function h(p,d,m,k){var C=d!==null?d.key:null;if(typeof m=="string"&&m!==""||typeof m=="number")return C!==null?null:a(p,d,""+m,k);if(typeof m=="object"&&m!==null){switch(m.$$typeof){case ei:return m.key===C?l(p,d,m,k):null;case Xn:return m.key===C?u(p,d,m,k):null;case qt:return C=m._init,h(p,d,C(m._payload),k)}if(Jr(m)||zr(m))return C!==null?null:c(p,d,m,k,null);di(p,m)}return null}function y(p,d,m,k,C){if(typeof k=="string"&&k!==""||typeof k=="number")return p=p.get(m)||null,a(d,p,""+k,C);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case ei:return p=p.get(k.key===null?m:k.key)||null,l(d,p,k,C);case Xn:return p=p.get(k.key===null?m:k.key)||null,u(d,p,k,C);case qt:var g=k._init;return y(p,d,m,g(k._payload),C)}if(Jr(k)||zr(k))return p=p.get(m)||null,c(d,p,k,C,null);di(d,k)}return null}function w(p,d,m,k){for(var C=null,g=null,_=d,S=d=0,P=null;_!==null&&S<m.length;S++){_.index>S?(P=_,_=null):P=_.sibling;var R=h(p,_,m[S],k);if(R===null){_===null&&(_=P);break}e&&_&&R.alternate===null&&t(p,_),d=i(R,d,S),g===null?C=R:g.sibling=R,g=R,_=P}if(S===m.length)return n(p,_),se&&Cn(p,S),C;if(_===null){for(;S<m.length;S++)_=f(p,m[S],k),_!==null&&(d=i(_,d,S),g===null?C=_:g.sibling=_,g=_);return se&&Cn(p,S),C}for(_=r(p,_);S<m.length;S++)P=y(_,p,S,m[S],k),P!==null&&(e&&P.alternate!==null&&_.delete(P.key===null?S:P.key),d=i(P,d,S),g===null?C=P:g.sibling=P,g=P);return e&&_.forEach(function(j){return t(p,j)}),se&&Cn(p,S),C}function v(p,d,m,k){var C=zr(m);if(typeof C!="function")throw Error(E(150));if(m=C.call(m),m==null)throw Error(E(151));for(var g=C=null,_=d,S=d=0,P=null,R=m.next();_!==null&&!R.done;S++,R=m.next()){_.index>S?(P=_,_=null):P=_.sibling;var j=h(p,_,R.value,k);if(j===null){_===null&&(_=P);break}e&&_&&j.alternate===null&&t(p,_),d=i(j,d,S),g===null?C=j:g.sibling=j,g=j,_=P}if(R.done)return n(p,_),se&&Cn(p,S),C;if(_===null){for(;!R.done;S++,R=m.next())R=f(p,R.value,k),R!==null&&(d=i(R,d,S),g===null?C=R:g.sibling=R,g=R);return se&&Cn(p,S),C}for(_=r(p,_);!R.done;S++,R=m.next())R=y(_,p,S,R.value,k),R!==null&&(e&&R.alternate!==null&&_.delete(R.key===null?S:R.key),d=i(R,d,S),g===null?C=R:g.sibling=R,g=R);return e&&_.forEach(function(B){return t(p,B)}),se&&Cn(p,S),C}function N(p,d,m,k){if(typeof m=="object"&&m!==null&&m.type===er&&m.key===null&&(m=m.props.children),typeof m=="object"&&m!==null){switch(m.$$typeof){case ei:e:{for(var C=m.key,g=d;g!==null;){if(g.key===C){if(C=m.type,C===er){if(g.tag===7){n(p,g.sibling),d=s(g,m.props.children),d.return=p,p=d;break e}}else if(g.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===qt&&zc(C)===g.type){n(p,g.sibling),d=s(g,m.props),d.ref=Vr(p,g,m),d.return=p,p=d;break e}n(p,g);break}else t(p,g);g=g.sibling}m.type===er?(d=Mn(m.props.children,p.mode,k,m.key),d.return=p,p=d):(k=Ni(m.type,m.key,m.props,null,p.mode,k),k.ref=Vr(p,d,m),k.return=p,p=k)}return o(p);case Xn:e:{for(g=m.key;d!==null;){if(d.key===g)if(d.tag===4&&d.stateNode.containerInfo===m.containerInfo&&d.stateNode.implementation===m.implementation){n(p,d.sibling),d=s(d,m.children||[]),d.return=p,p=d;break e}else{n(p,d);break}else t(p,d);d=d.sibling}d=fa(m,p.mode,k),d.return=p,p=d}return o(p);case qt:return g=m._init,N(p,d,g(m._payload),k)}if(Jr(m))return w(p,d,m,k);if(zr(m))return v(p,d,m,k);di(p,m)}return typeof m=="string"&&m!==""||typeof m=="number"?(m=""+m,d!==null&&d.tag===6?(n(p,d.sibling),d=s(d,m),d.return=p,p=d):(n(p,d),d=da(m,p.mode,k),d.return=p,p=d),o(p)):n(p,d)}return N}var Tr=Yf(!0),Gf=Yf(!1),qi=Sn(null),Yi=null,lr=null,mu=null;function yu(){mu=lr=Yi=null}function gu(e){var t=qi.current;ne(qi),e._currentValue=t}function tl(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function yr(e,t){Yi=e,mu=lr=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Ke=!0),e.firstContext=null)}function lt(e){var t=e._currentValue;if(mu!==e)if(e={context:e,memoizedValue:t,next:null},lr===null){if(Yi===null)throw Error(E(308));lr=e,Yi.dependencies={lanes:0,firstContext:e}}else lr=lr.next=e;return t}var bn=null;function vu(e){bn===null?bn=[e]:bn.push(e)}function Xf(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,vu(t)):(n.next=s.next,s.next=n),t.interleaved=n,Kt(e,r)}function Kt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Yt=!1;function _u(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function eh(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Bt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function ln(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Kt(e,n)}return s=r.interleaved,s===null?(t.next=t,vu(r)):(t.next=s.next,s.next=t),r.interleaved=t,Kt(e,n)}function xi(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,su(e,n)}}function Dc(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Gi(e,t,n,r){var s=e.updateQueue;Yt=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var c=e.alternate;c!==null&&(c=c.updateQueue,a=c.lastBaseUpdate,a!==o&&(a===null?c.firstBaseUpdate=u:a.next=u,c.lastBaseUpdate=l))}if(i!==null){var f=s.baseState;o=0,c=u=l=null,a=i;do{var h=a.lane,y=a.eventTime;if((r&h)===h){c!==null&&(c=c.next={eventTime:y,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var w=e,v=a;switch(h=t,y=n,v.tag){case 1:if(w=v.payload,typeof w=="function"){f=w.call(y,f,h);break e}f=w;break e;case 3:w.flags=w.flags&-65537|128;case 0:if(w=v.payload,h=typeof w=="function"?w.call(y,f,h):w,h==null)break e;f=ce({},f,h);break e;case 2:Yt=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,h=s.effects,h===null?s.effects=[a]:h.push(a))}else y={eventTime:y,lane:h,tag:a.tag,payload:a.payload,callback:a.callback,next:null},c===null?(u=c=y,l=f):c=c.next=y,o|=h;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;h=a,a=h.next,h.next=null,s.lastBaseUpdate=h,s.shared.pending=null}}while(!0);if(c===null&&(l=f),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,t=s.shared.interleaved,t!==null){s=t;do o|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Fn|=o,e.lanes=o,e.memoizedState=f}}function Uc(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],s=r.callback;if(s!==null){if(r.callback=null,r=n,typeof s!="function")throw Error(E(191,s));s.call(r)}}}var Hs={},Ot=Sn(Hs),Ss=Sn(Hs),xs=Sn(Hs);function An(e){if(e===Hs)throw Error(E(174));return e}function wu(e,t){switch(ee(xs,t),ee(Ss,e),ee(Ot,Hs),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ja(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ja(t,e)}ne(Ot),ee(Ot,t)}function Cr(){ne(Ot),ne(Ss),ne(xs)}function th(e){An(xs.current);var t=An(Ot.current),n=ja(t,e.type);t!==n&&(ee(Ss,e),ee(Ot,n))}function ku(e){Ss.current===e&&(ne(Ot),ne(Ss))}var le=Sn(0);function Xi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ia=[];function Su(){for(var e=0;e<ia.length;e++)ia[e]._workInProgressVersionPrimary=null;ia.length=0}var Ei=Jt.ReactCurrentDispatcher,oa=Jt.ReactCurrentBatchConfig,Bn=0,ue=null,ye=null,Se=null,eo=!1,is=!1,Es=0,$g=0;function Ne(){throw Error(E(321))}function xu(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!wt(e[n],t[n]))return!1;return!0}function Eu(e,t,n,r,s,i){if(Bn=i,ue=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Ei.current=e===null||e.memoizedState===null?Ug:Bg,e=n(r,s),is){i=0;do{if(is=!1,Es=0,25<=i)throw Error(E(301));i+=1,Se=ye=null,t.updateQueue=null,Ei.current=Fg,e=n(r,s)}while(is)}if(Ei.current=to,t=ye!==null&&ye.next!==null,Bn=0,Se=ye=ue=null,eo=!1,t)throw Error(E(300));return e}function Tu(){var e=Es!==0;return Es=0,e}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Se===null?ue.memoizedState=Se=e:Se=Se.next=e,Se}function ut(){if(ye===null){var e=ue.alternate;e=e!==null?e.memoizedState:null}else e=ye.next;var t=Se===null?ue.memoizedState:Se.next;if(t!==null)Se=t,ye=e;else{if(e===null)throw Error(E(310));ye=e,e={memoizedState:ye.memoizedState,baseState:ye.baseState,baseQueue:ye.baseQueue,queue:ye.queue,next:null},Se===null?ue.memoizedState=Se=e:Se=Se.next=e}return Se}function Ts(e,t){return typeof t=="function"?t(e):t}function aa(e){var t=ut(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var r=ye,s=r.baseQueue,i=n.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}r.baseQueue=s=i,n.pending=null}if(s!==null){i=s.next,r=r.baseState;var a=o=null,l=null,u=i;do{var c=u.lane;if((Bn&c)===c)l!==null&&(l=l.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(a=l=f,o=r):l=l.next=f,ue.lanes|=c,Fn|=c}u=u.next}while(u!==null&&u!==i);l===null?o=r:l.next=a,wt(r,t.memoizedState)||(Ke=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=l,n.lastRenderedState=r}if(e=n.interleaved,e!==null){s=e;do i=s.lane,ue.lanes|=i,Fn|=i,s=s.next;while(s!==e)}else s===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function la(e){var t=ut(),n=t.queue;if(n===null)throw Error(E(311));n.lastRenderedReducer=e;var r=n.dispatch,s=n.pending,i=t.memoizedState;if(s!==null){n.pending=null;var o=s=s.next;do i=e(i,o.action),o=o.next;while(o!==s);wt(i,t.memoizedState)||(Ke=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function nh(){}function rh(e,t){var n=ue,r=ut(),s=t(),i=!wt(r.memoizedState,s);if(i&&(r.memoizedState=s,Ke=!0),r=r.queue,Cu(oh.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Se!==null&&Se.memoizedState.tag&1){if(n.flags|=2048,Cs(9,ih.bind(null,n,r,s,t),void 0,null),xe===null)throw Error(E(349));Bn&30||sh(n,t,s)}return s}function sh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ue.updateQueue,t===null?(t={lastEffect:null,stores:null},ue.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ih(e,t,n,r){t.value=n,t.getSnapshot=r,ah(t)&&lh(e)}function oh(e,t,n){return n(function(){ah(t)&&lh(e)})}function ah(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!wt(e,n)}catch{return!0}}function lh(e){var t=Kt(e,1);t!==null&&vt(t,e,1,-1)}function Bc(e){var t=Et();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ts,lastRenderedState:e},t.queue=e,e=e.dispatch=Dg.bind(null,ue,e),[t.memoizedState,e]}function Cs(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=ue.updateQueue,t===null?(t={lastEffect:null,stores:null},ue.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function uh(){return ut().memoizedState}function Ti(e,t,n,r){var s=Et();ue.flags|=e,s.memoizedState=Cs(1|t,n,void 0,r===void 0?null:r)}function To(e,t,n,r){var s=ut();r=r===void 0?null:r;var i=void 0;if(ye!==null){var o=ye.memoizedState;if(i=o.destroy,r!==null&&xu(r,o.deps)){s.memoizedState=Cs(t,n,i,r);return}}ue.flags|=e,s.memoizedState=Cs(1|t,n,i,r)}function Fc(e,t){return Ti(8390656,8,e,t)}function Cu(e,t){return To(2048,8,e,t)}function ch(e,t){return To(4,2,e,t)}function dh(e,t){return To(4,4,e,t)}function fh(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function hh(e,t,n){return n=n!=null?n.concat([e]):null,To(4,4,fh.bind(null,t,e),n)}function Ru(){}function ph(e,t){var n=ut();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xu(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function mh(e,t){var n=ut();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&xu(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function yh(e,t,n){return Bn&21?(wt(n,t)||(n=kf(),ue.lanes|=n,Fn|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Ke=!0),e.memoizedState=n)}function Lg(e,t){var n=G;G=n!==0&&4>n?n:4,e(!0);var r=oa.transition;oa.transition={};try{e(!1),t()}finally{G=n,oa.transition=r}}function gh(){return ut().memoizedState}function zg(e,t,n){var r=cn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},vh(e))_h(t,n);else if(n=Xf(e,t,n,r),n!==null){var s=Le();vt(n,e,r,s),wh(n,t,r)}}function Dg(e,t,n){var r=cn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(vh(e))_h(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,wt(a,o)){var l=t.interleaved;l===null?(s.next=s,vu(t)):(s.next=l.next,l.next=s),t.interleaved=s;return}}catch{}finally{}n=Xf(e,t,s,r),n!==null&&(s=Le(),vt(n,e,r,s),wh(n,t,r))}}function vh(e){var t=e.alternate;return e===ue||t!==null&&t===ue}function _h(e,t){is=eo=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function wh(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,su(e,n)}}var to={readContext:lt,useCallback:Ne,useContext:Ne,useEffect:Ne,useImperativeHandle:Ne,useInsertionEffect:Ne,useLayoutEffect:Ne,useMemo:Ne,useReducer:Ne,useRef:Ne,useState:Ne,useDebugValue:Ne,useDeferredValue:Ne,useTransition:Ne,useMutableSource:Ne,useSyncExternalStore:Ne,useId:Ne,unstable_isNewReconciler:!1},Ug={readContext:lt,useCallback:function(e,t){return Et().memoizedState=[e,t===void 0?null:t],e},useContext:lt,useEffect:Fc,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Ti(4194308,4,fh.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ti(4194308,4,e,t)},useInsertionEffect:function(e,t){return Ti(4,2,e,t)},useMemo:function(e,t){var n=Et();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Et();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=zg.bind(null,ue,e),[r.memoizedState,e]},useRef:function(e){var t=Et();return e={current:e},t.memoizedState=e},useState:Bc,useDebugValue:Ru,useDeferredValue:function(e){return Et().memoizedState=e},useTransition:function(){var e=Bc(!1),t=e[0];return e=Lg.bind(null,e[1]),Et().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ue,s=Et();if(se){if(n===void 0)throw Error(E(407));n=n()}else{if(n=t(),xe===null)throw Error(E(349));Bn&30||sh(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,Fc(oh.bind(null,r,i,e),[e]),r.flags|=2048,Cs(9,ih.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Et(),t=xe.identifierPrefix;if(se){var n=Ut,r=Dt;n=(r&~(1<<32-gt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Es++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=$g++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},Bg={readContext:lt,useCallback:ph,useContext:lt,useEffect:Cu,useImperativeHandle:hh,useInsertionEffect:ch,useLayoutEffect:dh,useMemo:mh,useReducer:aa,useRef:uh,useState:function(){return aa(Ts)},useDebugValue:Ru,useDeferredValue:function(e){var t=ut();return yh(t,ye.memoizedState,e)},useTransition:function(){var e=aa(Ts)[0],t=ut().memoizedState;return[e,t]},useMutableSource:nh,useSyncExternalStore:rh,useId:gh,unstable_isNewReconciler:!1},Fg={readContext:lt,useCallback:ph,useContext:lt,useEffect:Cu,useImperativeHandle:hh,useInsertionEffect:ch,useLayoutEffect:dh,useMemo:mh,useReducer:la,useRef:uh,useState:function(){return la(Ts)},useDebugValue:Ru,useDeferredValue:function(e){var t=ut();return ye===null?t.memoizedState=e:yh(t,ye.memoizedState,e)},useTransition:function(){var e=la(Ts)[0],t=ut().memoizedState;return[e,t]},useMutableSource:nh,useSyncExternalStore:rh,useId:gh,unstable_isNewReconciler:!1};function ft(e,t){if(e&&e.defaultProps){t=ce({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function nl(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ce({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Co={isMounted:function(e){return(e=e._reactInternals)?Jn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Le(),s=cn(e),i=Bt(r,s);i.payload=t,n!=null&&(i.callback=n),t=ln(e,i,s),t!==null&&(vt(t,e,s,r),xi(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Le(),s=cn(e),i=Bt(r,s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=ln(e,i,s),t!==null&&(vt(t,e,s,r),xi(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Le(),r=cn(e),s=Bt(n,r);s.tag=2,t!=null&&(s.callback=t),t=ln(e,s,r),t!==null&&(vt(t,e,r,n),xi(t,e,r))}};function Vc(e,t,n,r,s,i,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,o):t.prototype&&t.prototype.isPureReactComponent?!vs(n,r)||!vs(s,i):!0}function kh(e,t,n){var r=!1,s=mn,i=t.contextType;return typeof i=="object"&&i!==null?i=lt(i):(s=We(t)?Dn:Ie.current,r=t.contextTypes,i=(r=r!=null)?xr(e,s):mn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Co,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=s,e.__reactInternalMemoizedMaskedChildContext=i),t}function Kc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Co.enqueueReplaceState(t,t.state,null)}function rl(e,t,n,r){var s=e.stateNode;s.props=n,s.state=e.memoizedState,s.refs={},_u(e);var i=t.contextType;typeof i=="object"&&i!==null?s.context=lt(i):(i=We(t)?Dn:Ie.current,s.context=xr(e,i)),s.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(nl(e,t,i,n),s.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(t=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),t!==s.state&&Co.enqueueReplaceState(s,s.state,null),Gi(e,n,s,r),s.state=e.memoizedState),typeof s.componentDidMount=="function"&&(e.flags|=4194308)}function Rr(e,t){try{var n="",r=t;do n+=yy(r),r=r.return;while(r);var s=n}catch(i){s=`
45
- Error generating stack: `+i.message+`
46
- `+i.stack}return{value:e,source:t,stack:s,digest:null}}function ua(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function sl(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Vg=typeof WeakMap=="function"?WeakMap:Map;function Sh(e,t,n){n=Bt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){ro||(ro=!0,pl=r),sl(e,t)},n}function xh(e,t,n){n=Bt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var s=t.value;n.payload=function(){return r(s)},n.callback=function(){sl(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){sl(e,t),typeof r!="function"&&(un===null?un=new Set([this]):un.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function Zc(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Vg;var s=new Set;r.set(t,s)}else s=r.get(t),s===void 0&&(s=new Set,r.set(t,s));s.has(n)||(s.add(n),e=rv.bind(null,e,t,n),t.then(e,e))}function Wc(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Hc(e,t,n,r,s){return e.mode&1?(e.flags|=65536,e.lanes=s,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=Bt(-1,1),t.tag=2,ln(n,t,1))),n.lanes|=1),e)}var Kg=Jt.ReactCurrentOwner,Ke=!1;function Pe(e,t,n,r){t.child=e===null?Gf(t,null,n,r):Tr(t,e.child,n,r)}function Jc(e,t,n,r,s){n=n.render;var i=t.ref;return yr(t,s),r=Eu(e,t,n,r,i,s),n=Tu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Zt(e,t,s)):(se&&n&&fu(t),t.flags|=1,Pe(e,t,r,s),t.child)}function Qc(e,t,n,r,s){if(e===null){var i=n.type;return typeof i=="function"&&!ju(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,Eh(e,t,i,r,s)):(e=Ni(n.type,null,r,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&s)){var o=i.memoizedProps;if(n=n.compare,n=n!==null?n:vs,n(o,r)&&e.ref===t.ref)return Zt(e,t,s)}return t.flags|=1,e=dn(i,r),e.ref=t.ref,e.return=t,t.child=e}function Eh(e,t,n,r,s){if(e!==null){var i=e.memoizedProps;if(vs(i,r)&&e.ref===t.ref)if(Ke=!1,t.pendingProps=r=i,(e.lanes&s)!==0)e.flags&131072&&(Ke=!0);else return t.lanes=e.lanes,Zt(e,t,s)}return il(e,t,n,r,s)}function Th(e,t,n){var r=t.pendingProps,s=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ee(cr,Qe),Qe|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ee(cr,Qe),Qe|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ee(cr,Qe),Qe|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ee(cr,Qe),Qe|=r;return Pe(e,t,s,n),t.child}function Ch(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function il(e,t,n,r,s){var i=We(n)?Dn:Ie.current;return i=xr(t,i),yr(t,s),n=Eu(e,t,n,r,i,s),r=Tu(),e!==null&&!Ke?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s,Zt(e,t,s)):(se&&r&&fu(t),t.flags|=1,Pe(e,t,n,s),t.child)}function qc(e,t,n,r,s){if(We(n)){var i=!0;Hi(t)}else i=!1;if(yr(t,s),t.stateNode===null)Ci(e,t),kh(t,n,r),rl(t,n,r,s),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var l=o.context,u=n.contextType;typeof u=="object"&&u!==null?u=lt(u):(u=We(n)?Dn:Ie.current,u=xr(t,u));var c=n.getDerivedStateFromProps,f=typeof c=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||l!==u)&&Kc(t,o,r,u),Yt=!1;var h=t.memoizedState;o.state=h,Gi(t,r,o,s),l=t.memoizedState,a!==r||h!==l||Ze.current||Yt?(typeof c=="function"&&(nl(t,n,c,r),l=t.memoizedState),(a=Yt||Vc(t,n,a,r,h,l,u))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),o.props=r,o.state=l,o.context=u,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,eh(e,t),a=t.memoizedProps,u=t.type===t.elementType?a:ft(t.type,a),o.props=u,f=t.pendingProps,h=o.context,l=n.contextType,typeof l=="object"&&l!==null?l=lt(l):(l=We(n)?Dn:Ie.current,l=xr(t,l));var y=n.getDerivedStateFromProps;(c=typeof y=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==f||h!==l)&&Kc(t,o,r,l),Yt=!1,h=t.memoizedState,o.state=h,Gi(t,r,o,s);var w=t.memoizedState;a!==f||h!==w||Ze.current||Yt?(typeof y=="function"&&(nl(t,n,y,r),w=t.memoizedState),(u=Yt||Vc(t,n,u,r,h,w,l)||!1)?(c||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,w,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,w,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=w),o.props=r,o.state=w,o.context=l,r=u):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return ol(e,t,n,r,i,s)}function ol(e,t,n,r,s,i){Ch(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return s&&jc(t,n,!1),Zt(e,t,i);r=t.stateNode,Kg.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Tr(t,e.child,null,i),t.child=Tr(t,null,a,i)):Pe(e,t,a,i),t.memoizedState=r.state,s&&jc(t,n,!0),t.child}function Rh(e){var t=e.stateNode;t.pendingContext?Pc(e,t.pendingContext,t.pendingContext!==t.context):t.context&&Pc(e,t.context,!1),wu(e,t.containerInfo)}function Yc(e,t,n,r,s){return Er(),pu(s),t.flags|=256,Pe(e,t,n,r),t.child}var al={dehydrated:null,treeContext:null,retryLane:0};function ll(e){return{baseLanes:e,cachePool:null,transitions:null}}function Oh(e,t,n){var r=t.pendingProps,s=le.current,i=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(s&2)!==0),a?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(s|=1),ee(le,s&1),e===null)return el(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,i?(r=t.mode,i=t.child,o={mode:"hidden",children:o},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=No(o,r,0,null),e=Mn(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=ll(n),t.memoizedState=al,e):Ou(t,o));if(s=e.memoizedState,s!==null&&(a=s.dehydrated,a!==null))return Zg(e,t,o,r,a,s,n);if(i){i=r.fallback,o=t.mode,s=e.child,a=s.sibling;var l={mode:"hidden",children:r.children};return!(o&1)&&t.child!==s?(r=t.child,r.childLanes=0,r.pendingProps=l,t.deletions=null):(r=dn(s,l),r.subtreeFlags=s.subtreeFlags&14680064),a!==null?i=dn(a,i):(i=Mn(i,o,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,o=e.child.memoizedState,o=o===null?ll(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~n,t.memoizedState=al,r}return i=e.child,e=i.sibling,r=dn(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Ou(e,t){return t=No({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function fi(e,t,n,r){return r!==null&&pu(r),Tr(t,e.child,null,n),e=Ou(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Zg(e,t,n,r,s,i,o){if(n)return t.flags&256?(t.flags&=-257,r=ua(Error(E(422))),fi(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,s=t.mode,r=No({mode:"visible",children:r.children},s,0,null),i=Mn(i,s,o,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Tr(t,e.child,null,o),t.child.memoizedState=ll(o),t.memoizedState=al,i);if(!(t.mode&1))return fi(e,t,o,null);if(s.data==="$!"){if(r=s.nextSibling&&s.nextSibling.dataset,r)var a=r.dgst;return r=a,i=Error(E(419)),r=ua(i,r,void 0),fi(e,t,o,r)}if(a=(o&e.childLanes)!==0,Ke||a){if(r=xe,r!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(r.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,Kt(e,s),vt(r,e,s,-1))}return Pu(),r=ua(Error(E(421))),fi(e,t,o,r)}return s.data==="$?"?(t.flags|=128,t.child=e.child,t=sv.bind(null,e),s._reactRetry=t,null):(e=i.treeContext,qe=an(s.nextSibling),Ye=t,se=!0,mt=null,e!==null&&(rt[st++]=Dt,rt[st++]=Ut,rt[st++]=Un,Dt=e.id,Ut=e.overflow,Un=t),t=Ou(t,r.children),t.flags|=4096,t)}function Gc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),tl(e.return,t,n)}function ca(e,t,n,r,s){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:s}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=s)}function Nh(e,t,n){var r=t.pendingProps,s=r.revealOrder,i=r.tail;if(Pe(e,t,r.children,n),r=le.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Gc(e,n,t);else if(e.tag===19)Gc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ee(le,r),!(t.mode&1))t.memoizedState=null;else switch(s){case"forwards":for(n=t.child,s=null;n!==null;)e=n.alternate,e!==null&&Xi(e)===null&&(s=n),n=n.sibling;n=s,n===null?(s=t.child,t.child=null):(s=n.sibling,n.sibling=null),ca(t,!1,s,n,i);break;case"backwards":for(n=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&Xi(e)===null){t.child=s;break}e=s.sibling,s.sibling=n,n=s,s=e}ca(t,!0,n,null,i);break;case"together":ca(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ci(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Zt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Fn|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(E(153));if(t.child!==null){for(e=t.child,n=dn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=dn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Wg(e,t,n){switch(t.tag){case 3:Rh(t),Er();break;case 5:th(t);break;case 1:We(t.type)&&Hi(t);break;case 4:wu(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,s=t.memoizedProps.value;ee(qi,r._currentValue),r._currentValue=s;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ee(le,le.current&1),t.flags|=128,null):n&t.child.childLanes?Oh(e,t,n):(ee(le,le.current&1),e=Zt(e,t,n),e!==null?e.sibling:null);ee(le,le.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Nh(e,t,n);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),ee(le,le.current),r)break;return null;case 22:case 23:return t.lanes=0,Th(e,t,n)}return Zt(e,t,n)}var bh,ul,Ah,Ih;bh=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ul=function(){};Ah=function(e,t,n,r){var s=e.memoizedProps;if(s!==r){e=t.stateNode,An(Ot.current);var i=null;switch(n){case"input":s=Aa(e,s),r=Aa(e,r),i=[];break;case"select":s=ce({},s,{value:void 0}),r=ce({},r,{value:void 0}),i=[];break;case"textarea":s=Pa(e,s),r=Pa(e,r),i=[];break;default:typeof s.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Zi)}$a(n,r);var o;n=null;for(u in s)if(!r.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var a=s[u];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(ds.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var l=r[u];if(a=s!=null?s[u]:void 0,r.hasOwnProperty(u)&&l!==a&&(l!=null||a!=null))if(u==="style")if(a){for(o in a)!a.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in l)l.hasOwnProperty(o)&&a[o]!==l[o]&&(n||(n={}),n[o]=l[o])}else n||(i||(i=[]),i.push(u,n)),n=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,a=a?a.__html:void 0,l!=null&&a!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(ds.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&te("scroll",e),i||a===l||(i=[])):(i=i||[]).push(u,l))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};Ih=function(e,t,n,r){n!==r&&(t.flags|=4)};function Kr(e,t){if(!se)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function be(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags&14680064,r|=s.flags&14680064,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)n|=s.lanes|s.childLanes,r|=s.subtreeFlags,r|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hg(e,t,n){var r=t.pendingProps;switch(hu(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return be(t),null;case 1:return We(t.type)&&Wi(),be(t),null;case 3:return r=t.stateNode,Cr(),ne(Ze),ne(Ie),Su(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(ci(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,mt!==null&&(gl(mt),mt=null))),ul(e,t),be(t),null;case 5:ku(t);var s=An(xs.current);if(n=t.type,e!==null&&t.stateNode!=null)Ah(e,t,n,r,s),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(E(166));return be(t),null}if(e=An(Ot.current),ci(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Tt]=t,r[ks]=i,e=(t.mode&1)!==0,n){case"dialog":te("cancel",r),te("close",r);break;case"iframe":case"object":case"embed":te("load",r);break;case"video":case"audio":for(s=0;s<qr.length;s++)te(qr[s],r);break;case"source":te("error",r);break;case"img":case"image":case"link":te("error",r),te("load",r);break;case"details":te("toggle",r);break;case"input":ac(r,i),te("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},te("invalid",r);break;case"textarea":uc(r,i),te("invalid",r)}$a(n,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var a=i[o];o==="children"?typeof a=="string"?r.textContent!==a&&(i.suppressHydrationWarning!==!0&&ui(r.textContent,a,e),s=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(i.suppressHydrationWarning!==!0&&ui(r.textContent,a,e),s=["children",""+a]):ds.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&te("scroll",r)}switch(n){case"input":ti(r),lc(r,i,!0);break;case"textarea":ti(r),cc(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Zi)}r=s,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=of(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[Tt]=t,e[ks]=r,bh(e,t,!1,!1),t.stateNode=e;e:{switch(o=La(n,r),n){case"dialog":te("cancel",e),te("close",e),s=r;break;case"iframe":case"object":case"embed":te("load",e),s=r;break;case"video":case"audio":for(s=0;s<qr.length;s++)te(qr[s],e);s=r;break;case"source":te("error",e),s=r;break;case"img":case"image":case"link":te("error",e),te("load",e),s=r;break;case"details":te("toggle",e),s=r;break;case"input":ac(e,r),s=Aa(e,r),te("invalid",e);break;case"option":s=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},s=ce({},r,{value:void 0}),te("invalid",e);break;case"textarea":uc(e,r),s=Pa(e,r),te("invalid",e);break;default:s=r}$a(n,s),a=s;for(i in a)if(a.hasOwnProperty(i)){var l=a[i];i==="style"?uf(e,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&af(e,l)):i==="children"?typeof l=="string"?(n!=="textarea"||l!=="")&&fs(e,l):typeof l=="number"&&fs(e,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(ds.hasOwnProperty(i)?l!=null&&i==="onScroll"&&te("scroll",e):l!=null&&Gl(e,i,l,o))}switch(n){case"input":ti(e),lc(e,r,!1);break;case"textarea":ti(e),cc(e);break;case"option":r.value!=null&&e.setAttribute("value",""+pn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?fr(e,!!r.multiple,i,!1):r.defaultValue!=null&&fr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof s.onClick=="function"&&(e.onclick=Zi)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return be(t),null;case 6:if(e&&t.stateNode!=null)Ih(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(E(166));if(n=An(xs.current),An(Ot.current),ci(t)){if(r=t.stateNode,n=t.memoizedProps,r[Tt]=t,(i=r.nodeValue!==n)&&(e=Ye,e!==null))switch(e.tag){case 3:ui(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ui(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Tt]=t,t.stateNode=r}return be(t),null;case 13:if(ne(le),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(se&&qe!==null&&t.mode&1&&!(t.flags&128))qf(),Er(),t.flags|=98560,i=!1;else if(i=ci(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(E(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(E(317));i[Tt]=t}else Er(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;be(t),i=!1}else mt!==null&&(gl(mt),mt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||le.current&1?ge===0&&(ge=3):Pu())),t.updateQueue!==null&&(t.flags|=4),be(t),null);case 4:return Cr(),ul(e,t),e===null&&_s(t.stateNode.containerInfo),be(t),null;case 10:return gu(t.type._context),be(t),null;case 17:return We(t.type)&&Wi(),be(t),null;case 19:if(ne(le),i=t.memoizedState,i===null)return be(t),null;if(r=(t.flags&128)!==0,o=i.rendering,o===null)if(r)Kr(i,!1);else{if(ge!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Xi(e),o!==null){for(t.flags|=128,Kr(i,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,e=o.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ee(le,le.current&1|2),t.child}e=e.sibling}i.tail!==null&&he()>Or&&(t.flags|=128,r=!0,Kr(i,!1),t.lanes=4194304)}else{if(!r)if(e=Xi(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Kr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!se)return be(t),null}else 2*he()-i.renderingStartTime>Or&&n!==1073741824&&(t.flags|=128,r=!0,Kr(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(n=i.last,n!==null?n.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=he(),t.sibling=null,n=le.current,ee(le,r?n&1|2:n&1),t):(be(t),null);case 22:case 23:return Mu(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Qe&1073741824&&(be(t),t.subtreeFlags&6&&(t.flags|=8192)):be(t),null;case 24:return null;case 25:return null}throw Error(E(156,t.tag))}function Jg(e,t){switch(hu(t),t.tag){case 1:return We(t.type)&&Wi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cr(),ne(Ze),ne(Ie),Su(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return ku(t),null;case 13:if(ne(le),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(E(340));Er()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ne(le),null;case 4:return Cr(),null;case 10:return gu(t.type._context),null;case 22:case 23:return Mu(),null;case 24:return null;default:return null}}var hi=!1,Ae=!1,Qg=typeof WeakSet=="function"?WeakSet:Set,M=null;function ur(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){de(e,t,r)}else n.current=null}function cl(e,t,n){try{n()}catch(r){de(e,t,r)}}var Xc=!1;function qg(e,t){if(Ha=Fi,e=Lf(),du(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,c=0,f=e,h=null;t:for(;;){for(var y;f!==n||s!==0&&f.nodeType!==3||(a=o+s),f!==i||r!==0&&f.nodeType!==3||(l=o+r),f.nodeType===3&&(o+=f.nodeValue.length),(y=f.firstChild)!==null;)h=f,f=y;for(;;){if(f===e)break t;if(h===n&&++u===s&&(a=o),h===i&&++c===r&&(l=o),(y=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=y}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Ja={focusedElem:e,selectionRange:n},Fi=!1,M=t;M!==null;)if(t=M,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,M=e;else for(;M!==null;){t=M;try{var w=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(w!==null){var v=w.memoizedProps,N=w.memoizedState,p=t.stateNode,d=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:ft(t.type,v),N);p.__reactInternalSnapshotBeforeUpdate=d}break;case 3:var m=t.stateNode.containerInfo;m.nodeType===1?m.textContent="":m.nodeType===9&&m.documentElement&&m.removeChild(m.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(E(163))}}catch(k){de(t,t.return,k)}if(e=t.sibling,e!==null){e.return=t.return,M=e;break}M=t.return}return w=Xc,Xc=!1,w}function os(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&cl(t,n,i)}s=s.next}while(s!==r)}}function Ro(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function dl(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Mh(e){var t=e.alternate;t!==null&&(e.alternate=null,Mh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Tt],delete t[ks],delete t[Ya],delete t[Ig],delete t[Mg])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Ph(e){return e.tag===5||e.tag===3||e.tag===4}function ed(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Ph(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function fl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Zi));else if(r!==4&&(e=e.child,e!==null))for(fl(e,t,n),e=e.sibling;e!==null;)fl(e,t,n),e=e.sibling}function hl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(hl(e,t,n),e=e.sibling;e!==null;)hl(e,t,n),e=e.sibling}var Te=null,ht=!1;function Qt(e,t,n){for(n=n.child;n!==null;)jh(e,t,n),n=n.sibling}function jh(e,t,n){if(Rt&&typeof Rt.onCommitFiberUnmount=="function")try{Rt.onCommitFiberUnmount(_o,n)}catch{}switch(n.tag){case 5:Ae||ur(n,t);case 6:var r=Te,s=ht;Te=null,Qt(e,t,n),Te=r,ht=s,Te!==null&&(ht?(e=Te,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Te.removeChild(n.stateNode));break;case 18:Te!==null&&(ht?(e=Te,n=n.stateNode,e.nodeType===8?ra(e.parentNode,n):e.nodeType===1&&ra(e,n),ys(e)):ra(Te,n.stateNode));break;case 4:r=Te,s=ht,Te=n.stateNode.containerInfo,ht=!0,Qt(e,t,n),Te=r,ht=s;break;case 0:case 11:case 14:case 15:if(!Ae&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&cl(n,t,o),s=s.next}while(s!==r)}Qt(e,t,n);break;case 1:if(!Ae&&(ur(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){de(n,t,a)}Qt(e,t,n);break;case 21:Qt(e,t,n);break;case 22:n.mode&1?(Ae=(r=Ae)||n.memoizedState!==null,Qt(e,t,n),Ae=r):Qt(e,t,n);break;default:Qt(e,t,n)}}function td(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Qg),t.forEach(function(r){var s=iv.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function dt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var s=n[r];try{var i=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Te=a.stateNode,ht=!1;break e;case 3:Te=a.stateNode.containerInfo,ht=!0;break e;case 4:Te=a.stateNode.containerInfo,ht=!0;break e}a=a.return}if(Te===null)throw Error(E(160));jh(i,o,s),Te=null,ht=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){de(s,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)$h(t,e),t=t.sibling}function $h(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(dt(t,e),xt(e),r&4){try{os(3,e,e.return),Ro(3,e)}catch(v){de(e,e.return,v)}try{os(5,e,e.return)}catch(v){de(e,e.return,v)}}break;case 1:dt(t,e),xt(e),r&512&&n!==null&&ur(n,n.return);break;case 5:if(dt(t,e),xt(e),r&512&&n!==null&&ur(n,n.return),e.flags&32){var s=e.stateNode;try{fs(s,"")}catch(v){de(e,e.return,v)}}if(r&4&&(s=e.stateNode,s!=null)){var i=e.memoizedProps,o=n!==null?n.memoizedProps:i,a=e.type,l=e.updateQueue;if(e.updateQueue=null,l!==null)try{a==="input"&&i.type==="radio"&&i.name!=null&&rf(s,i),La(a,o);var u=La(a,i);for(o=0;o<l.length;o+=2){var c=l[o],f=l[o+1];c==="style"?uf(s,f):c==="dangerouslySetInnerHTML"?af(s,f):c==="children"?fs(s,f):Gl(s,c,f,u)}switch(a){case"input":Ia(s,i);break;case"textarea":sf(s,i);break;case"select":var h=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var y=i.value;y!=null?fr(s,!!i.multiple,y,!1):h!==!!i.multiple&&(i.defaultValue!=null?fr(s,!!i.multiple,i.defaultValue,!0):fr(s,!!i.multiple,i.multiple?[]:"",!1))}s[ks]=i}catch(v){de(e,e.return,v)}}break;case 6:if(dt(t,e),xt(e),r&4){if(e.stateNode===null)throw Error(E(162));s=e.stateNode,i=e.memoizedProps;try{s.nodeValue=i}catch(v){de(e,e.return,v)}}break;case 3:if(dt(t,e),xt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{ys(t.containerInfo)}catch(v){de(e,e.return,v)}break;case 4:dt(t,e),xt(e);break;case 13:dt(t,e),xt(e),s=e.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Au=he())),r&4&&td(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Ae=(u=Ae)||c,dt(t,e),Ae=u):dt(t,e),xt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(M=e,c=e.child;c!==null;){for(f=M=c;M!==null;){switch(h=M,y=h.child,h.tag){case 0:case 11:case 14:case 15:os(4,h,h.return);break;case 1:ur(h,h.return);var w=h.stateNode;if(typeof w.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,w.props=t.memoizedProps,w.state=t.memoizedState,w.componentWillUnmount()}catch(v){de(r,n,v)}}break;case 5:ur(h,h.return);break;case 22:if(h.memoizedState!==null){rd(f);continue}}y!==null?(y.return=h,M=y):rd(f)}c=c.sibling}e:for(c=null,f=e;;){if(f.tag===5){if(c===null){c=f;try{s=f.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(a=f.stateNode,l=f.memoizedProps.style,o=l!=null&&l.hasOwnProperty("display")?l.display:null,a.style.display=lf("display",o))}catch(v){de(e,e.return,v)}}}else if(f.tag===6){if(c===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){de(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;c===f&&(c=null),f=f.return}c===f&&(c=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:dt(t,e),xt(e),r&4&&td(e);break;case 21:break;default:dt(t,e),xt(e)}}function xt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Ph(n)){var r=n;break e}n=n.return}throw Error(E(160))}switch(r.tag){case 5:var s=r.stateNode;r.flags&32&&(fs(s,""),r.flags&=-33);var i=ed(e);hl(e,i,s);break;case 3:case 4:var o=r.stateNode.containerInfo,a=ed(e);fl(e,a,o);break;default:throw Error(E(161))}}catch(l){de(e,e.return,l)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Yg(e,t,n){M=e,Lh(e)}function Lh(e,t,n){for(var r=(e.mode&1)!==0;M!==null;){var s=M,i=s.child;if(s.tag===22&&r){var o=s.memoizedState!==null||hi;if(!o){var a=s.alternate,l=a!==null&&a.memoizedState!==null||Ae;a=hi;var u=Ae;if(hi=o,(Ae=l)&&!u)for(M=s;M!==null;)o=M,l=o.child,o.tag===22&&o.memoizedState!==null?sd(s):l!==null?(l.return=o,M=l):sd(s);for(;i!==null;)M=i,Lh(i),i=i.sibling;M=s,hi=a,Ae=u}nd(e)}else s.subtreeFlags&8772&&i!==null?(i.return=s,M=i):nd(e)}}function nd(e){for(;M!==null;){var t=M;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ae||Ro(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ae)if(n===null)r.componentDidMount();else{var s=t.elementType===t.type?n.memoizedProps:ft(t.type,n.memoizedProps);r.componentDidUpdate(s,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Uc(t,i,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Uc(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var l=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break;case"img":l.src&&(n.src=l.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var f=c.dehydrated;f!==null&&ys(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(E(163))}Ae||t.flags&512&&dl(t)}catch(h){de(t,t.return,h)}}if(t===e){M=null;break}if(n=t.sibling,n!==null){n.return=t.return,M=n;break}M=t.return}}function rd(e){for(;M!==null;){var t=M;if(t===e){M=null;break}var n=t.sibling;if(n!==null){n.return=t.return,M=n;break}M=t.return}}function sd(e){for(;M!==null;){var t=M;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Ro(4,t)}catch(l){de(t,n,l)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var s=t.return;try{r.componentDidMount()}catch(l){de(t,s,l)}}var i=t.return;try{dl(t)}catch(l){de(t,i,l)}break;case 5:var o=t.return;try{dl(t)}catch(l){de(t,o,l)}}}catch(l){de(t,t.return,l)}if(t===e){M=null;break}var a=t.sibling;if(a!==null){a.return=t.return,M=a;break}M=t.return}}var Gg=Math.ceil,no=Jt.ReactCurrentDispatcher,Nu=Jt.ReactCurrentOwner,at=Jt.ReactCurrentBatchConfig,J=0,xe=null,pe=null,Ce=0,Qe=0,cr=Sn(0),ge=0,Rs=null,Fn=0,Oo=0,bu=0,as=null,Ve=null,Au=0,Or=1/0,$t=null,ro=!1,pl=null,un=null,pi=!1,nn=null,so=0,ls=0,ml=null,Ri=-1,Oi=0;function Le(){return J&6?he():Ri!==-1?Ri:Ri=he()}function cn(e){return e.mode&1?J&2&&Ce!==0?Ce&-Ce:jg.transition!==null?(Oi===0&&(Oi=kf()),Oi):(e=G,e!==0||(e=window.event,e=e===void 0?16:Of(e.type)),e):1}function vt(e,t,n,r){if(50<ls)throw ls=0,ml=null,Error(E(185));Ks(e,n,r),(!(J&2)||e!==xe)&&(e===xe&&(!(J&2)&&(Oo|=n),ge===4&&Xt(e,Ce)),He(e,r),n===1&&J===0&&!(t.mode&1)&&(Or=he()+500,Eo&&xn()))}function He(e,t){var n=e.callbackNode;jy(e,t);var r=Bi(e,e===xe?Ce:0);if(r===0)n!==null&&hc(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&hc(n),t===1)e.tag===0?Pg(id.bind(null,e)):Hf(id.bind(null,e)),bg(function(){!(J&6)&&xn()}),n=null;else{switch(Sf(r)){case 1:n=ru;break;case 4:n=_f;break;case 16:n=Ui;break;case 536870912:n=wf;break;default:n=Ui}n=Zh(n,zh.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function zh(e,t){if(Ri=-1,Oi=0,J&6)throw Error(E(327));var n=e.callbackNode;if(gr()&&e.callbackNode!==n)return null;var r=Bi(e,e===xe?Ce:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=io(e,r);else{t=r;var s=J;J|=2;var i=Uh();(xe!==e||Ce!==t)&&($t=null,Or=he()+500,In(e,t));do try{tv();break}catch(a){Dh(e,a)}while(!0);yu(),no.current=i,J=s,pe!==null?t=0:(xe=null,Ce=0,t=ge)}if(t!==0){if(t===2&&(s=Fa(e),s!==0&&(r=s,t=yl(e,s))),t===1)throw n=Rs,In(e,0),Xt(e,r),He(e,he()),n;if(t===6)Xt(e,r);else{if(s=e.current.alternate,!(r&30)&&!Xg(s)&&(t=io(e,r),t===2&&(i=Fa(e),i!==0&&(r=i,t=yl(e,i))),t===1))throw n=Rs,In(e,0),Xt(e,r),He(e,he()),n;switch(e.finishedWork=s,e.finishedLanes=r,t){case 0:case 1:throw Error(E(345));case 2:Rn(e,Ve,$t);break;case 3:if(Xt(e,r),(r&130023424)===r&&(t=Au+500-he(),10<t)){if(Bi(e,0)!==0)break;if(s=e.suspendedLanes,(s&r)!==r){Le(),e.pingedLanes|=e.suspendedLanes&s;break}e.timeoutHandle=qa(Rn.bind(null,e,Ve,$t),t);break}Rn(e,Ve,$t);break;case 4:if(Xt(e,r),(r&4194240)===r)break;for(t=e.eventTimes,s=-1;0<r;){var o=31-gt(r);i=1<<o,o=t[o],o>s&&(s=o),r&=~i}if(r=s,r=he()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Gg(r/1960))-r,10<r){e.timeoutHandle=qa(Rn.bind(null,e,Ve,$t),r);break}Rn(e,Ve,$t);break;case 5:Rn(e,Ve,$t);break;default:throw Error(E(329))}}}return He(e,he()),e.callbackNode===n?zh.bind(null,e):null}function yl(e,t){var n=as;return e.current.memoizedState.isDehydrated&&(In(e,t).flags|=256),e=io(e,t),e!==2&&(t=Ve,Ve=n,t!==null&&gl(t)),e}function gl(e){Ve===null?Ve=e:Ve.push.apply(Ve,e)}function Xg(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var s=n[r],i=s.getSnapshot;s=s.value;try{if(!wt(i(),s))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Xt(e,t){for(t&=~bu,t&=~Oo,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-gt(t),r=1<<n;e[n]=-1,t&=~r}}function id(e){if(J&6)throw Error(E(327));gr();var t=Bi(e,0);if(!(t&1))return He(e,he()),null;var n=io(e,t);if(e.tag!==0&&n===2){var r=Fa(e);r!==0&&(t=r,n=yl(e,r))}if(n===1)throw n=Rs,In(e,0),Xt(e,t),He(e,he()),n;if(n===6)throw Error(E(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Rn(e,Ve,$t),He(e,he()),null}function Iu(e,t){var n=J;J|=1;try{return e(t)}finally{J=n,J===0&&(Or=he()+500,Eo&&xn())}}function Vn(e){nn!==null&&nn.tag===0&&!(J&6)&&gr();var t=J;J|=1;var n=at.transition,r=G;try{if(at.transition=null,G=1,e)return e()}finally{G=r,at.transition=n,J=t,!(J&6)&&xn()}}function Mu(){Qe=cr.current,ne(cr)}function In(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,Ng(n)),pe!==null)for(n=pe.return;n!==null;){var r=n;switch(hu(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Wi();break;case 3:Cr(),ne(Ze),ne(Ie),Su();break;case 5:ku(r);break;case 4:Cr();break;case 13:ne(le);break;case 19:ne(le);break;case 10:gu(r.type._context);break;case 22:case 23:Mu()}n=n.return}if(xe=e,pe=e=dn(e.current,null),Ce=Qe=t,ge=0,Rs=null,bu=Oo=Fn=0,Ve=as=null,bn!==null){for(t=0;t<bn.length;t++)if(n=bn[t],r=n.interleaved,r!==null){n.interleaved=null;var s=r.next,i=n.pending;if(i!==null){var o=i.next;i.next=s,r.next=o}n.pending=r}bn=null}return e}function Dh(e,t){do{var n=pe;try{if(yu(),Ei.current=to,eo){for(var r=ue.memoizedState;r!==null;){var s=r.queue;s!==null&&(s.pending=null),r=r.next}eo=!1}if(Bn=0,Se=ye=ue=null,is=!1,Es=0,Nu.current=null,n===null||n.return===null){ge=1,Rs=t,pe=null;break}e:{var i=e,o=n.return,a=n,l=t;if(t=Ce,a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=a,f=c.tag;if(!(c.mode&1)&&(f===0||f===11||f===15)){var h=c.alternate;h?(c.updateQueue=h.updateQueue,c.memoizedState=h.memoizedState,c.lanes=h.lanes):(c.updateQueue=null,c.memoizedState=null)}var y=Wc(o);if(y!==null){y.flags&=-257,Hc(y,o,a,i,t),y.mode&1&&Zc(i,u,t),t=y,l=u;var w=t.updateQueue;if(w===null){var v=new Set;v.add(l),t.updateQueue=v}else w.add(l);break e}else{if(!(t&1)){Zc(i,u,t),Pu();break e}l=Error(E(426))}}else if(se&&a.mode&1){var N=Wc(o);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Hc(N,o,a,i,t),pu(Rr(l,a));break e}}i=l=Rr(l,a),ge!==4&&(ge=2),as===null?as=[i]:as.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=Sh(i,l,t);Dc(i,p);break e;case 1:a=l;var d=i.type,m=i.stateNode;if(!(i.flags&128)&&(typeof d.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(un===null||!un.has(m)))){i.flags|=65536,t&=-t,i.lanes|=t;var k=xh(i,a,t);Dc(i,k);break e}}i=i.return}while(i!==null)}Fh(n)}catch(C){t=C,pe===n&&n!==null&&(pe=n=n.return);continue}break}while(!0)}function Uh(){var e=no.current;return no.current=to,e===null?to:e}function Pu(){(ge===0||ge===3||ge===2)&&(ge=4),xe===null||!(Fn&268435455)&&!(Oo&268435455)||Xt(xe,Ce)}function io(e,t){var n=J;J|=2;var r=Uh();(xe!==e||Ce!==t)&&($t=null,In(e,t));do try{ev();break}catch(s){Dh(e,s)}while(!0);if(yu(),J=n,no.current=r,pe!==null)throw Error(E(261));return xe=null,Ce=0,ge}function ev(){for(;pe!==null;)Bh(pe)}function tv(){for(;pe!==null&&!Cy();)Bh(pe)}function Bh(e){var t=Kh(e.alternate,e,Qe);e.memoizedProps=e.pendingProps,t===null?Fh(e):pe=t,Nu.current=null}function Fh(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Jg(n,t),n!==null){n.flags&=32767,pe=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ge=6,pe=null;return}}else if(n=Hg(n,t,Qe),n!==null){pe=n;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);ge===0&&(ge=5)}function Rn(e,t,n){var r=G,s=at.transition;try{at.transition=null,G=1,nv(e,t,n,r)}finally{at.transition=s,G=r}return null}function nv(e,t,n,r){do gr();while(nn!==null);if(J&6)throw Error(E(327));n=e.finishedWork;var s=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(E(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if($y(e,i),e===xe&&(pe=xe=null,Ce=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||pi||(pi=!0,Zh(Ui,function(){return gr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=at.transition,at.transition=null;var o=G;G=1;var a=J;J|=4,Nu.current=null,qg(e,n),$h(n,e),Sg(Ja),Fi=!!Ha,Ja=Ha=null,e.current=n,Yg(n),Ry(),J=a,G=o,at.transition=i}else e.current=n;if(pi&&(pi=!1,nn=e,so=s),i=e.pendingLanes,i===0&&(un=null),by(n.stateNode),He(e,he()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)s=t[n],r(s.value,{componentStack:s.stack,digest:s.digest});if(ro)throw ro=!1,e=pl,pl=null,e;return so&1&&e.tag!==0&&gr(),i=e.pendingLanes,i&1?e===ml?ls++:(ls=0,ml=e):ls=0,xn(),null}function gr(){if(nn!==null){var e=Sf(so),t=at.transition,n=G;try{if(at.transition=null,G=16>e?16:e,nn===null)var r=!1;else{if(e=nn,nn=null,so=0,J&6)throw Error(E(331));var s=J;for(J|=4,M=e.current;M!==null;){var i=M,o=i.child;if(M.flags&16){var a=i.deletions;if(a!==null){for(var l=0;l<a.length;l++){var u=a[l];for(M=u;M!==null;){var c=M;switch(c.tag){case 0:case 11:case 15:os(8,c,i)}var f=c.child;if(f!==null)f.return=c,M=f;else for(;M!==null;){c=M;var h=c.sibling,y=c.return;if(Mh(c),c===u){M=null;break}if(h!==null){h.return=y,M=h;break}M=y}}}var w=i.alternate;if(w!==null){var v=w.child;if(v!==null){w.child=null;do{var N=v.sibling;v.sibling=null,v=N}while(v!==null)}}M=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,M=o;else e:for(;M!==null;){if(i=M,i.flags&2048)switch(i.tag){case 0:case 11:case 15:os(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,M=p;break e}M=i.return}}var d=e.current;for(M=d;M!==null;){o=M;var m=o.child;if(o.subtreeFlags&2064&&m!==null)m.return=o,M=m;else e:for(o=d;M!==null;){if(a=M,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:Ro(9,a)}}catch(C){de(a,a.return,C)}if(a===o){M=null;break e}var k=a.sibling;if(k!==null){k.return=a.return,M=k;break e}M=a.return}}if(J=s,xn(),Rt&&typeof Rt.onPostCommitFiberRoot=="function")try{Rt.onPostCommitFiberRoot(_o,e)}catch{}r=!0}return r}finally{G=n,at.transition=t}}return!1}function od(e,t,n){t=Rr(n,t),t=Sh(e,t,1),e=ln(e,t,1),t=Le(),e!==null&&(Ks(e,1,t),He(e,t))}function de(e,t,n){if(e.tag===3)od(e,e,n);else for(;t!==null;){if(t.tag===3){od(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(un===null||!un.has(r))){e=Rr(n,e),e=xh(t,e,1),t=ln(t,e,1),e=Le(),t!==null&&(Ks(t,1,e),He(t,e));break}}t=t.return}}function rv(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Le(),e.pingedLanes|=e.suspendedLanes&n,xe===e&&(Ce&n)===n&&(ge===4||ge===3&&(Ce&130023424)===Ce&&500>he()-Au?In(e,0):bu|=n),He(e,t)}function Vh(e,t){t===0&&(e.mode&1?(t=si,si<<=1,!(si&130023424)&&(si=4194304)):t=1);var n=Le();e=Kt(e,t),e!==null&&(Ks(e,t,n),He(e,n))}function sv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Vh(e,n)}function iv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(E(314))}r!==null&&r.delete(t),Vh(e,n)}var Kh;Kh=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Ze.current)Ke=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Ke=!1,Wg(e,t,n);Ke=!!(e.flags&131072)}else Ke=!1,se&&t.flags&1048576&&Jf(t,Qi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ci(e,t),e=t.pendingProps;var s=xr(t,Ie.current);yr(t,n),s=Eu(null,t,r,e,s,n);var i=Tu();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,We(r)?(i=!0,Hi(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,_u(t),s.updater=Co,t.stateNode=s,s._reactInternals=t,rl(t,r,e,n),t=ol(null,t,r,!0,i,n)):(t.tag=0,se&&i&&fu(t),Pe(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ci(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=av(r),e=ft(r,e),s){case 0:t=il(null,t,r,e,n);break e;case 1:t=qc(null,t,r,e,n);break e;case 11:t=Jc(null,t,r,e,n);break e;case 14:t=Qc(null,t,r,ft(r.type,e),n);break e}throw Error(E(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),il(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),qc(e,t,r,s,n);case 3:e:{if(Rh(t),e===null)throw Error(E(387));r=t.pendingProps,i=t.memoizedState,s=i.element,eh(e,t),Gi(t,r,null,n);var o=t.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Rr(Error(E(423)),t),t=Yc(e,t,r,n,s);break e}else if(r!==s){s=Rr(Error(E(424)),t),t=Yc(e,t,r,n,s);break e}else for(qe=an(t.stateNode.containerInfo.firstChild),Ye=t,se=!0,mt=null,n=Gf(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Er(),r===s){t=Zt(e,t,n);break e}Pe(e,t,r,n)}t=t.child}return t;case 5:return th(t),e===null&&el(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,o=s.children,Qa(r,s)?o=null:i!==null&&Qa(r,i)&&(t.flags|=32),Ch(e,t),Pe(e,t,o,n),t.child;case 6:return e===null&&el(t),null;case 13:return Oh(e,t,n);case 4:return wu(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Tr(t,null,r,n):Pe(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Jc(e,t,r,s,n);case 7:return Pe(e,t,t.pendingProps,n),t.child;case 8:return Pe(e,t,t.pendingProps.children,n),t.child;case 12:return Pe(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,o=s.value,ee(qi,r._currentValue),r._currentValue=o,i!==null)if(wt(i.value,o)){if(i.children===s.children&&!Ze.current){t=Zt(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=Bt(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),tl(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(E(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),tl(o,n,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Pe(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,yr(t,n),s=lt(s),r=r(s),t.flags|=1,Pe(e,t,r,n),t.child;case 14:return r=t.type,s=ft(r,t.pendingProps),s=ft(r.type,s),Qc(e,t,r,s,n);case 15:return Eh(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:ft(r,s),Ci(e,t),t.tag=1,We(r)?(e=!0,Hi(t)):e=!1,yr(t,n),kh(t,r,s),rl(t,r,s,n),ol(null,t,r,!0,e,n);case 19:return Nh(e,t,n);case 22:return Th(e,t,n)}throw Error(E(156,t.tag))};function Zh(e,t){return vf(e,t)}function ov(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ot(e,t,n,r){return new ov(e,t,n,r)}function ju(e){return e=e.prototype,!(!e||!e.isReactComponent)}function av(e){if(typeof e=="function")return ju(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eu)return 11;if(e===tu)return 14}return 2}function dn(e,t){var n=e.alternate;return n===null?(n=ot(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ni(e,t,n,r,s,i){var o=2;if(r=e,typeof e=="function")ju(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case er:return Mn(n.children,s,i,t);case Xl:o=8,s|=8;break;case Ra:return e=ot(12,n,t,s|2),e.elementType=Ra,e.lanes=i,e;case Oa:return e=ot(13,n,t,s),e.elementType=Oa,e.lanes=i,e;case Na:return e=ot(19,n,t,s),e.elementType=Na,e.lanes=i,e;case ef:return No(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Gd:o=10;break e;case Xd:o=9;break e;case eu:o=11;break e;case tu:o=14;break e;case qt:o=16,r=null;break e}throw Error(E(130,e==null?e:typeof e,""))}return t=ot(o,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function Mn(e,t,n,r){return e=ot(7,e,r,t),e.lanes=n,e}function No(e,t,n,r){return e=ot(22,e,r,t),e.elementType=ef,e.lanes=n,e.stateNode={isHidden:!1},e}function da(e,t,n){return e=ot(6,e,null,t),e.lanes=n,e}function fa(e,t,n){return t=ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function lv(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wo(0),this.expirationTimes=Wo(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wo(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function $u(e,t,n,r,s,i,o,a,l){return e=new lv(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=ot(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},_u(i),e}function uv(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Wh(e){if(!e)return mn;e=e._reactInternals;e:{if(Jn(e)!==e||e.tag!==1)throw Error(E(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(We(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(E(171))}if(e.tag===1){var n=e.type;if(We(n))return Wf(e,n,t)}return t}function Hh(e,t,n,r,s,i,o,a,l){return e=$u(n,r,!0,e,s,i,o,a,l),e.context=Wh(null),n=e.current,r=Le(),s=cn(n),i=Bt(r,s),i.callback=t??null,ln(n,i,s),e.current.lanes=s,Ks(e,s,r),He(e,r),e}function bo(e,t,n,r){var s=t.current,i=Le(),o=cn(s);return n=Wh(n),t.context===null?t.context=n:t.pendingContext=n,t=Bt(i,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=ln(s,t,o),e!==null&&(vt(e,s,o,i),xi(e,s,o)),o}function oo(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function ad(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Lu(e,t){ad(e,t),(e=e.alternate)&&ad(e,t)}function cv(){return null}var Jh=typeof reportError=="function"?reportError:function(e){console.error(e)};function zu(e){this._internalRoot=e}Ao.prototype.render=zu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(E(409));bo(e,t,null,null)};Ao.prototype.unmount=zu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Vn(function(){bo(null,e,null,null)}),t[Vt]=null}};function Ao(e){this._internalRoot=e}Ao.prototype.unstable_scheduleHydration=function(e){if(e){var t=Tf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Gt.length&&t!==0&&t<Gt[n].priority;n++);Gt.splice(n,0,e),n===0&&Rf(e)}};function Du(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Io(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function ld(){}function dv(e,t,n,r,s){if(s){if(typeof r=="function"){var i=r;r=function(){var u=oo(o);i.call(u)}}var o=Hh(t,r,e,0,null,!1,!1,"",ld);return e._reactRootContainer=o,e[Vt]=o.current,_s(e.nodeType===8?e.parentNode:e),Vn(),o}for(;s=e.lastChild;)e.removeChild(s);if(typeof r=="function"){var a=r;r=function(){var u=oo(l);a.call(u)}}var l=$u(e,0,!1,null,null,!1,!1,"",ld);return e._reactRootContainer=l,e[Vt]=l.current,_s(e.nodeType===8?e.parentNode:e),Vn(function(){bo(t,l,n,r)}),l}function Mo(e,t,n,r,s){var i=n._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var a=s;s=function(){var l=oo(o);a.call(l)}}bo(t,o,e,s)}else o=dv(n,t,e,s,r);return oo(o)}xf=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Qr(t.pendingLanes);n!==0&&(su(t,n|1),He(t,he()),!(J&6)&&(Or=he()+500,xn()))}break;case 13:Vn(function(){var r=Kt(e,1);if(r!==null){var s=Le();vt(r,e,1,s)}}),Lu(e,1)}};iu=function(e){if(e.tag===13){var t=Kt(e,134217728);if(t!==null){var n=Le();vt(t,e,134217728,n)}Lu(e,134217728)}};Ef=function(e){if(e.tag===13){var t=cn(e),n=Kt(e,t);if(n!==null){var r=Le();vt(n,e,t,r)}Lu(e,t)}};Tf=function(){return G};Cf=function(e,t){var n=G;try{return G=e,t()}finally{G=n}};Da=function(e,t,n){switch(t){case"input":if(Ia(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var s=xo(r);if(!s)throw Error(E(90));nf(r),Ia(r,s)}}}break;case"textarea":sf(e,n);break;case"select":t=n.value,t!=null&&fr(e,!!n.multiple,t,!1)}};ff=Iu;hf=Vn;var fv={usingClientEntryPoint:!1,Events:[Ws,sr,xo,cf,df,Iu]},Zr={findFiberByHostInstance:Nn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hv={bundleType:Zr.bundleType,version:Zr.version,rendererPackageName:Zr.rendererPackageName,rendererConfig:Zr.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Jt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=yf(e),e===null?null:e.stateNode},findFiberByHostInstance:Zr.findFiberByHostInstance||cv,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mi=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mi.isDisabled&&mi.supportsFiber)try{_o=mi.inject(hv),Rt=mi}catch{}}tt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=fv;tt.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Du(t))throw Error(E(200));return uv(e,t,null,n)};tt.createRoot=function(e,t){if(!Du(e))throw Error(E(299));var n=!1,r="",s=Jh;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=$u(e,1,!1,null,null,n,!1,r,s),e[Vt]=t.current,_s(e.nodeType===8?e.parentNode:e),new zu(t)};tt.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(E(188)):(e=Object.keys(e).join(","),Error(E(268,e)));return e=yf(t),e=e===null?null:e.stateNode,e};tt.flushSync=function(e){return Vn(e)};tt.hydrate=function(e,t,n){if(!Io(t))throw Error(E(200));return Mo(null,e,t,!0,n)};tt.hydrateRoot=function(e,t,n){if(!Du(e))throw Error(E(405));var r=n!=null&&n.hydratedSources||null,s=!1,i="",o=Jh;if(n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Hh(t,null,e,1,n??null,s,!1,i,o),e[Vt]=t.current,_s(e),r)for(e=0;e<r.length;e++)n=r[e],s=n._getVersion,s=s(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,s]:t.mutableSourceEagerHydrationData.push(n,s);return new Ao(t)};tt.render=function(e,t,n){if(!Io(t))throw Error(E(200));return Mo(null,e,t,!1,n)};tt.unmountComponentAtNode=function(e){if(!Io(e))throw Error(E(40));return e._reactRootContainer?(Vn(function(){Mo(null,null,e,!1,function(){e._reactRootContainer=null,e[Vt]=null})}),!0):!1};tt.unstable_batchedUpdates=Iu;tt.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Io(n))throw Error(E(200));if(e==null||e._reactInternals===void 0)throw Error(E(38));return Mo(e,t,n,!1,r)};tt.version="18.3.1-next-f1338f8080-20240426";function Qh(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Qh)}catch(e){console.error(e)}}Qh(),Jd.exports=tt;var pv=Jd.exports,qh,ud=pv;qh=ud.createRoot,ud.hydrateRoot;var H;(function(e){e.assertEqual=s=>s;function t(s){}e.assertIs=t;function n(s){throw new Error}e.assertNever=n,e.arrayToEnum=s=>{const i={};for(const o of s)i[o]=o;return i},e.getValidEnumValues=s=>{const i=e.objectKeys(s).filter(a=>typeof s[s[a]]!="number"),o={};for(const a of i)o[a]=s[a];return e.objectValues(o)},e.objectValues=s=>e.objectKeys(s).map(function(i){return s[i]}),e.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const o in s)Object.prototype.hasOwnProperty.call(s,o)&&i.push(o);return i},e.find=(s,i)=>{for(const o of s)if(i(o))return o},e.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&isFinite(s)&&Math.floor(s)===s;function r(s,i=" | "){return s.map(o=>typeof o=="string"?`'${o}'`:o).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(H||(H={}));var vl;(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(vl||(vl={}));const A=H.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),en=e=>{switch(typeof e){case"undefined":return A.undefined;case"string":return A.string;case"number":return isNaN(e)?A.nan:A.number;case"boolean":return A.boolean;case"function":return A.function;case"bigint":return A.bigint;case"symbol":return A.symbol;case"object":return Array.isArray(e)?A.array:e===null?A.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?A.promise:typeof Map<"u"&&e instanceof Map?A.map:typeof Set<"u"&&e instanceof Set?A.set:typeof Date<"u"&&e instanceof Date?A.date:A.object;default:return A.unknown}},T=H.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),mv=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class Ge extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){const n=t||function(i){return i.message},r={_errors:[]},s=i=>{for(const o of i.issues)if(o.code==="invalid_union")o.unionErrors.map(s);else if(o.code==="invalid_return_type")s(o.returnTypeError);else if(o.code==="invalid_arguments")s(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let a=r,l=0;for(;l<o.path.length;){const u=o.path[l];l===o.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(o))):a[u]=a[u]||{_errors:[]},a=a[u],l++}}};return s(this),r}static assert(t){if(!(t instanceof Ge))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,H.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){const n={},r=[];for(const s of this.issues)s.path.length>0?(n[s.path[0]]=n[s.path[0]]||[],n[s.path[0]].push(t(s))):r.push(t(s));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}Ge.create=e=>new Ge(e);const Nr=(e,t)=>{let n;switch(e.code){case T.invalid_type:e.received===A.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case T.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,H.jsonStringifyReplacer)}`;break;case T.unrecognized_keys:n=`Unrecognized key(s) in object: ${H.joinValues(e.keys,", ")}`;break;case T.invalid_union:n="Invalid input";break;case T.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${H.joinValues(e.options)}`;break;case T.invalid_enum_value:n=`Invalid enum value. Expected ${H.joinValues(e.options)}, received '${e.received}'`;break;case T.invalid_arguments:n="Invalid function arguments";break;case T.invalid_return_type:n="Invalid function return type";break;case T.invalid_date:n="Invalid date";break;case T.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:H.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case T.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case T.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case T.custom:n="Invalid input";break;case T.invalid_intersection_types:n="Intersection results could not be merged";break;case T.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case T.not_finite:n="Number must be finite";break;default:n=t.defaultError,H.assertNever(e)}return{message:n}};let Yh=Nr;function yv(e){Yh=e}function ao(){return Yh}const lo=e=>{const{data:t,path:n,errorMaps:r,issueData:s}=e,i=[...n,...s.path||[]],o={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let a="";const l=r.filter(u=>!!u).slice().reverse();for(const u of l)a=u(o,{data:t,defaultError:a}).message;return{...s,path:i,message:a}},gv=[];function b(e,t){const n=ao(),r=lo({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===Nr?void 0:Nr].filter(s=>!!s)});e.common.issues.push(r)}class Me{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){const r=[];for(const s of n){if(s.status==="aborted")return D;s.status==="dirty"&&t.dirty(),r.push(s.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){const r=[];for(const s of n){const i=await s.key,o=await s.value;r.push({key:i,value:o})}return Me.mergeObjectSync(t,r)}static mergeObjectSync(t,n){const r={};for(const s of n){const{key:i,value:o}=s;if(i.status==="aborted"||o.status==="aborted")return D;i.status==="dirty"&&t.dirty(),o.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof o.value<"u"||s.alwaysSet)&&(r[i.value]=o.value)}return{status:t.value,value:r}}}const D=Object.freeze({status:"aborted"}),dr=e=>({status:"dirty",value:e}),De=e=>({status:"valid",value:e}),_l=e=>e.status==="aborted",wl=e=>e.status==="dirty",Os=e=>e.status==="valid",Ns=e=>typeof Promise<"u"&&e instanceof Promise;function uo(e,t,n,r){if(typeof t=="function"?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function Gh(e,t,n,r,s){if(typeof t=="function"?e!==t||!s:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,n),n}var $;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})($||($={}));var Yr,Gr;class At{constructor(t,n,r,s){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=s}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const cd=(e,t)=>{if(Os(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new Ge(e.common.issues);return this._error=n,this._error}}};function V(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:s}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:s}:{errorMap:(o,a)=>{var l,u;const{message:c}=e;return o.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:(l=c??r)!==null&&l!==void 0?l:a.defaultError}:o.code!=="invalid_type"?{message:a.defaultError}:{message:(u=c??n)!==null&&u!==void 0?u:a.defaultError}},description:s}}class K{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return en(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Me,ctx:{common:t.parent.common,data:t.data,parsedType:en(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const n=this._parse(t);if(Ns(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){const n=this._parse(t);return Promise.resolve(n)}parse(t,n){const r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;const s={common:{issues:[],async:(r=n==null?void 0:n.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:en(t)},i=this._parseSync({data:t,path:s.path,parent:s});return cd(s,i)}async parseAsync(t,n){const r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:en(t)},s=this._parse({data:t,path:r.path,parent:r}),i=await(Ns(s)?s:Promise.resolve(s));return cd(r,i)}refine(t,n){const r=s=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(s):n;return this._refinement((s,i)=>{const o=t(s),a=()=>i.addIssue({code:T.custom,...r(s)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(a(),!1)):o?!0:(a(),!1)})}refinement(t,n){return this._refinement((r,s)=>t(r)?!0:(s.addIssue(typeof n=="function"?n(r,s):n),!1))}_refinement(t){return new kt({schema:this,typeName:z.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return Nt.create(this,this._def)}nullable(){return _n.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _t.create(this,this._def)}promise(){return Ar.create(this,this._def)}or(t){return Ms.create([this,t],this._def)}and(t){return Ps.create(this,t,this._def)}transform(t){return new kt({...V(this._def),schema:this,typeName:z.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const n=typeof t=="function"?t:()=>t;return new Ds({...V(this._def),innerType:this,defaultValue:n,typeName:z.ZodDefault})}brand(){return new Uu({typeName:z.ZodBranded,type:this,...V(this._def)})}catch(t){const n=typeof t=="function"?t:()=>t;return new Us({...V(this._def),innerType:this,catchValue:n,typeName:z.ZodCatch})}describe(t){const n=this.constructor;return new n({...this._def,description:t})}pipe(t){return Js.create(this,t)}readonly(){return Bs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const vv=/^c[^\s-]{8,}$/i,_v=/^[0-9a-z]+$/,wv=/^[0-9A-HJKMNP-TV-Z]{26}$/,kv=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Sv=/^[a-z0-9_-]{21}$/i,xv=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ev=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Tv="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ha;const Cv=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Rv=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Ov=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xh="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",Nv=new RegExp(`^${Xh}$`);function ep(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`),t}function bv(e){return new RegExp(`^${ep(e)}$`)}function tp(e){let t=`${Xh}T${ep(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function Av(e,t){return!!((t==="v4"||!t)&&Cv.test(e)||(t==="v6"||!t)&&Rv.test(e))}class yt extends K{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==A.string){const i=this._getOrReturnCtx(t);return b(i,{code:T.invalid_type,expected:A.string,received:i.parsedType}),D}const r=new Me;let s;for(const i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(s=this._getOrReturnCtx(t,s),b(s,{code:T.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(s=this._getOrReturnCtx(t,s),b(s,{code:T.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){const o=t.data.length>i.value,a=t.data.length<i.value;(o||a)&&(s=this._getOrReturnCtx(t,s),o?b(s,{code:T.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&b(s,{code:T.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Ev.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"email",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")ha||(ha=new RegExp(Tv,"u")),ha.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"emoji",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")kv.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"uuid",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="nanoid")Sv.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"nanoid",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")vv.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"cuid",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")_v.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"cuid2",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")wv.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"ulid",code:T.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{s=this._getOrReturnCtx(t,s),b(s,{validation:"url",code:T.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"regex",code:T.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(t,s),b(s,{code:T.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(s=this._getOrReturnCtx(t,s),b(s,{code:T.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(s=this._getOrReturnCtx(t,s),b(s,{code:T.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?tp(i).test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{code:T.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="date"?Nv.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{code:T.invalid_string,validation:"date",message:i.message}),r.dirty()):i.kind==="time"?bv(i).test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{code:T.invalid_string,validation:"time",message:i.message}),r.dirty()):i.kind==="duration"?xv.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"duration",code:T.invalid_string,message:i.message}),r.dirty()):i.kind==="ip"?Av(t.data,i.version)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"ip",code:T.invalid_string,message:i.message}),r.dirty()):i.kind==="base64"?Ov.test(t.data)||(s=this._getOrReturnCtx(t,s),b(s,{validation:"base64",code:T.invalid_string,message:i.message}),r.dirty()):H.assertNever(i);return{status:r.value,value:t.data}}_regex(t,n,r){return this.refinement(s=>t.test(s),{validation:n,code:T.invalid_string,...$.errToObj(r)})}_addCheck(t){return new yt({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...$.errToObj(t)})}url(t){return this._addCheck({kind:"url",...$.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...$.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...$.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...$.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...$.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...$.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...$.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...$.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...$.errToObj(t)})}datetime(t){var n,r;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(n=t==null?void 0:t.offset)!==null&&n!==void 0?n:!1,local:(r=t==null?void 0:t.local)!==null&&r!==void 0?r:!1,...$.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...$.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...$.errToObj(t)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...$.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n==null?void 0:n.position,...$.errToObj(n==null?void 0:n.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...$.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...$.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...$.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...$.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...$.errToObj(n)})}nonempty(t){return this.min(1,$.errToObj(t))}trim(){return new yt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new yt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new yt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get minLength(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}yt.create=e=>{var t;return new yt({checks:[],typeName:z.ZodString,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...V(e)})};function Iv(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,s=n>r?n:r,i=parseInt(e.toFixed(s).replace(".","")),o=parseInt(t.toFixed(s).replace(".",""));return i%o/Math.pow(10,s)}class yn extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==A.number){const i=this._getOrReturnCtx(t);return b(i,{code:T.invalid_type,expected:A.number,received:i.parsedType}),D}let r;const s=new Me;for(const i of this._def.checks)i.kind==="int"?H.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),b(r,{code:T.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:T.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:T.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?Iv(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),b(r,{code:T.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),b(r,{code:T.not_finite,message:i.message}),s.dirty()):H.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,r,s){return new yn({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(s)}]})}_addCheck(t){return new yn({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:$.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:$.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:$.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:$.toString(t)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&H.isInteger(t.value))}get isFinite(){let t=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}}yn.create=e=>new yn({checks:[],typeName:z.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...V(e)});class gn extends K{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==A.bigint){const i=this._getOrReturnCtx(t);return b(i,{code:T.invalid_type,expected:A.bigint,received:i.parsedType}),D}let r;const s=new Me;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:T.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),b(r,{code:T.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),b(r,{code:T.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):H.assertNever(i);return{status:s.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,$.toString(n))}gt(t,n){return this.setLimit("min",t,!1,$.toString(n))}lte(t,n){return this.setLimit("max",t,!0,$.toString(n))}lt(t,n){return this.setLimit("max",t,!1,$.toString(n))}setLimit(t,n,r,s){return new gn({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:$.toString(s)}]})}_addCheck(t){return new gn({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:$.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:$.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:$.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:$.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:$.toString(n)})}get minValue(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}}gn.create=e=>{var t;return new gn({checks:[],typeName:z.ZodBigInt,coerce:(t=e==null?void 0:e.coerce)!==null&&t!==void 0?t:!1,...V(e)})};class bs extends K{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==A.boolean){const r=this._getOrReturnCtx(t);return b(r,{code:T.invalid_type,expected:A.boolean,received:r.parsedType}),D}return De(t.data)}}bs.create=e=>new bs({typeName:z.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...V(e)});class Kn extends K{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==A.date){const i=this._getOrReturnCtx(t);return b(i,{code:T.invalid_type,expected:A.date,received:i.parsedType}),D}if(isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return b(i,{code:T.invalid_date}),D}const r=new Me;let s;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(s=this._getOrReturnCtx(t,s),b(s,{code:T.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(s=this._getOrReturnCtx(t,s),b(s,{code:T.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):H.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Kn({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:$.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:$.toString(n)})}get minDate(){let t=null;for(const n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}}Kn.create=e=>new Kn({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:z.ZodDate,...V(e)});class co extends K{_parse(t){if(this._getType(t)!==A.symbol){const r=this._getOrReturnCtx(t);return b(r,{code:T.invalid_type,expected:A.symbol,received:r.parsedType}),D}return De(t.data)}}co.create=e=>new co({typeName:z.ZodSymbol,...V(e)});class As extends K{_parse(t){if(this._getType(t)!==A.undefined){const r=this._getOrReturnCtx(t);return b(r,{code:T.invalid_type,expected:A.undefined,received:r.parsedType}),D}return De(t.data)}}As.create=e=>new As({typeName:z.ZodUndefined,...V(e)});class Is extends K{_parse(t){if(this._getType(t)!==A.null){const r=this._getOrReturnCtx(t);return b(r,{code:T.invalid_type,expected:A.null,received:r.parsedType}),D}return De(t.data)}}Is.create=e=>new Is({typeName:z.ZodNull,...V(e)});class br extends K{constructor(){super(...arguments),this._any=!0}_parse(t){return De(t.data)}}br.create=e=>new br({typeName:z.ZodAny,...V(e)});class Pn extends K{constructor(){super(...arguments),this._unknown=!0}_parse(t){return De(t.data)}}Pn.create=e=>new Pn({typeName:z.ZodUnknown,...V(e)});class Wt extends K{_parse(t){const n=this._getOrReturnCtx(t);return b(n,{code:T.invalid_type,expected:A.never,received:n.parsedType}),D}}Wt.create=e=>new Wt({typeName:z.ZodNever,...V(e)});class fo extends K{_parse(t){if(this._getType(t)!==A.undefined){const r=this._getOrReturnCtx(t);return b(r,{code:T.invalid_type,expected:A.void,received:r.parsedType}),D}return De(t.data)}}fo.create=e=>new fo({typeName:z.ZodVoid,...V(e)});class _t extends K{_parse(t){const{ctx:n,status:r}=this._processInputParams(t),s=this._def;if(n.parsedType!==A.array)return b(n,{code:T.invalid_type,expected:A.array,received:n.parsedType}),D;if(s.exactLength!==null){const o=n.data.length>s.exactLength.value,a=n.data.length<s.exactLength.value;(o||a)&&(b(n,{code:o?T.too_big:T.too_small,minimum:a?s.exactLength.value:void 0,maximum:o?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),r.dirty())}if(s.minLength!==null&&n.data.length<s.minLength.value&&(b(n,{code:T.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),r.dirty()),s.maxLength!==null&&n.data.length>s.maxLength.value&&(b(n,{code:T.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,a)=>s.type._parseAsync(new At(n,o,n.path,a)))).then(o=>Me.mergeArray(r,o));const i=[...n.data].map((o,a)=>s.type._parseSync(new At(n,o,n.path,a)));return Me.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new _t({...this._def,minLength:{value:t,message:$.toString(n)}})}max(t,n){return new _t({...this._def,maxLength:{value:t,message:$.toString(n)}})}length(t,n){return new _t({...this._def,exactLength:{value:t,message:$.toString(n)}})}nonempty(t){return this.min(1,t)}}_t.create=(e,t)=>new _t({type:e,minLength:null,maxLength:null,exactLength:null,typeName:z.ZodArray,...V(t)});function qn(e){if(e instanceof ae){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=Nt.create(qn(r))}return new ae({...e._def,shape:()=>t})}else return e instanceof _t?new _t({...e._def,type:qn(e.element)}):e instanceof Nt?Nt.create(qn(e.unwrap())):e instanceof _n?_n.create(qn(e.unwrap())):e instanceof It?It.create(e.items.map(t=>qn(t))):e}class ae extends K{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),n=H.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==A.object){const u=this._getOrReturnCtx(t);return b(u,{code:T.invalid_type,expected:A.object,received:u.parsedType}),D}const{status:r,ctx:s}=this._processInputParams(t),{shape:i,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof Wt&&this._def.unknownKeys==="strip"))for(const u in s.data)o.includes(u)||a.push(u);const l=[];for(const u of o){const c=i[u],f=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new At(s,f,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Wt){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of a)l.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(u==="strict")a.length>0&&(b(s,{code:T.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of a){const f=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new At(s,f,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const f=await c.key,h=await c.value;u.push({key:f,value:h,alwaysSet:c.alwaysSet})}return u}).then(u=>Me.mergeObjectSync(r,u)):Me.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(t){return $.errToObj,new ae({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var s,i,o,a;const l=(o=(i=(s=this._def).errorMap)===null||i===void 0?void 0:i.call(s,n,r).message)!==null&&o!==void 0?o:r.defaultError;return n.code==="unrecognized_keys"?{message:(a=$.errToObj(t).message)!==null&&a!==void 0?a:l}:{message:l}}}:{}})}strip(){return new ae({...this._def,unknownKeys:"strip"})}passthrough(){return new ae({...this._def,unknownKeys:"passthrough"})}extend(t){return new ae({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new ae({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:z.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new ae({...this._def,catchall:t})}pick(t){const n={};return H.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new ae({...this._def,shape:()=>n})}omit(t){const n={};return H.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new ae({...this._def,shape:()=>n})}deepPartial(){return qn(this)}partial(t){const n={};return H.objectKeys(this.shape).forEach(r=>{const s=this.shape[r];t&&!t[r]?n[r]=s:n[r]=s.optional()}),new ae({...this._def,shape:()=>n})}required(t){const n={};return H.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof Nt;)i=i._def.innerType;n[r]=i}}),new ae({...this._def,shape:()=>n})}keyof(){return np(H.objectKeys(this.shape))}}ae.create=(e,t)=>new ae({shape:()=>e,unknownKeys:"strip",catchall:Wt.create(),typeName:z.ZodObject,...V(t)});ae.strictCreate=(e,t)=>new ae({shape:()=>e,unknownKeys:"strict",catchall:Wt.create(),typeName:z.ZodObject,...V(t)});ae.lazycreate=(e,t)=>new ae({shape:e,unknownKeys:"strip",catchall:Wt.create(),typeName:z.ZodObject,...V(t)});class Ms extends K{_parse(t){const{ctx:n}=this._processInputParams(t),r=this._def.options;function s(i){for(const a of i)if(a.result.status==="valid")return a.result;for(const a of i)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;const o=i.map(a=>new Ge(a.ctx.common.issues));return b(n,{code:T.invalid_union,unionErrors:o}),D}if(n.common.async)return Promise.all(r.map(async i=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(s);{let i;const o=[];for(const l of r){const u={...n,common:{...n.common,issues:[]},parent:null},c=l._parseSync({data:n.data,path:n.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&o.push(u.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;const a=o.map(l=>new Ge(l));return b(n,{code:T.invalid_union,unionErrors:a}),D}}get options(){return this._def.options}}Ms.create=(e,t)=>new Ms({options:e,typeName:z.ZodUnion,...V(t)});const jt=e=>e instanceof $s?jt(e.schema):e instanceof kt?jt(e.innerType()):e instanceof Ls?[e.value]:e instanceof vn?e.options:e instanceof zs?H.objectValues(e.enum):e instanceof Ds?jt(e._def.innerType):e instanceof As?[void 0]:e instanceof Is?[null]:e instanceof Nt?[void 0,...jt(e.unwrap())]:e instanceof _n?[null,...jt(e.unwrap())]:e instanceof Uu||e instanceof Bs?jt(e.unwrap()):e instanceof Us?jt(e._def.innerType):[];class Po extends K{_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.object)return b(n,{code:T.invalid_type,expected:A.object,received:n.parsedType}),D;const r=this.discriminator,s=n.data[r],i=this.optionsMap.get(s);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(b(n,{code:T.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),D)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){const s=new Map;for(const i of n){const o=jt(i.shape[t]);if(!o.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(const a of o){if(s.has(a))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(a)}`);s.set(a,i)}}return new Po({typeName:z.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:s,...V(r)})}}function kl(e,t){const n=en(e),r=en(t);if(e===t)return{valid:!0,data:e};if(n===A.object&&r===A.object){const s=H.objectKeys(t),i=H.objectKeys(e).filter(a=>s.indexOf(a)!==-1),o={...e,...t};for(const a of i){const l=kl(e[a],t[a]);if(!l.valid)return{valid:!1};o[a]=l.data}return{valid:!0,data:o}}else if(n===A.array&&r===A.array){if(e.length!==t.length)return{valid:!1};const s=[];for(let i=0;i<e.length;i++){const o=e[i],a=t[i],l=kl(o,a);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return n===A.date&&r===A.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Ps extends K{_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=(i,o)=>{if(_l(i)||_l(o))return D;const a=kl(i.value,o.value);return a.valid?((wl(i)||wl(o))&&n.dirty(),{status:n.value,value:a.data}):(b(r,{code:T.invalid_intersection_types}),D)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,o])=>s(i,o)):s(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ps.create=(e,t,n)=>new Ps({left:e,right:t,typeName:z.ZodIntersection,...V(n)});class It extends K{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==A.array)return b(r,{code:T.invalid_type,expected:A.array,received:r.parsedType}),D;if(r.data.length<this._def.items.length)return b(r,{code:T.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),D;!this._def.rest&&r.data.length>this._def.items.length&&(b(r,{code:T.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const i=[...r.data].map((o,a)=>{const l=this._def.items[a]||this._def.rest;return l?l._parse(new At(r,o,r.path,a)):null}).filter(o=>!!o);return r.common.async?Promise.all(i).then(o=>Me.mergeArray(n,o)):Me.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new It({...this._def,rest:t})}}It.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new It({items:e,typeName:z.ZodTuple,rest:null,...V(t)})};class js extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==A.object)return b(r,{code:T.invalid_type,expected:A.object,received:r.parsedType}),D;const s=[],i=this._def.keyType,o=this._def.valueType;for(const a in r.data)s.push({key:i._parse(new At(r,a,r.path,a)),value:o._parse(new At(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?Me.mergeObjectAsync(n,s):Me.mergeObjectSync(n,s)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof K?new js({keyType:t,valueType:n,typeName:z.ZodRecord,...V(r)}):new js({keyType:yt.create(),valueType:t,typeName:z.ZodRecord,...V(n)})}}class ho extends K{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==A.map)return b(r,{code:T.invalid_type,expected:A.map,received:r.parsedType}),D;const s=this._def.keyType,i=this._def.valueType,o=[...r.data.entries()].map(([a,l],u)=>({key:s._parse(new At(r,a,r.path,[u,"key"])),value:i._parse(new At(r,l,r.path,[u,"value"]))}));if(r.common.async){const a=new Map;return Promise.resolve().then(async()=>{for(const l of o){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return D;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}})}else{const a=new Map;for(const l of o){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return D;(u.status==="dirty"||c.status==="dirty")&&n.dirty(),a.set(u.value,c.value)}return{status:n.value,value:a}}}}ho.create=(e,t,n)=>new ho({valueType:t,keyType:e,typeName:z.ZodMap,...V(n)});class Zn extends K{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==A.set)return b(r,{code:T.invalid_type,expected:A.set,received:r.parsedType}),D;const s=this._def;s.minSize!==null&&r.data.size<s.minSize.value&&(b(r,{code:T.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),n.dirty()),s.maxSize!==null&&r.data.size>s.maxSize.value&&(b(r,{code:T.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),n.dirty());const i=this._def.valueType;function o(l){const u=new Set;for(const c of l){if(c.status==="aborted")return D;c.status==="dirty"&&n.dirty(),u.add(c.value)}return{status:n.value,value:u}}const a=[...r.data.values()].map((l,u)=>i._parse(new At(r,l,r.path,u)));return r.common.async?Promise.all(a).then(l=>o(l)):o(a)}min(t,n){return new Zn({...this._def,minSize:{value:t,message:$.toString(n)}})}max(t,n){return new Zn({...this._def,maxSize:{value:t,message:$.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}}Zn.create=(e,t)=>new Zn({valueType:e,minSize:null,maxSize:null,typeName:z.ZodSet,...V(t)});class vr extends K{constructor(){super(...arguments),this.validate=this.implement}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.function)return b(n,{code:T.invalid_type,expected:A.function,received:n.parsedType}),D;function r(a,l){return lo({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ao(),Nr].filter(u=>!!u),issueData:{code:T.invalid_arguments,argumentsError:l}})}function s(a,l){return lo({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,ao(),Nr].filter(u=>!!u),issueData:{code:T.invalid_return_type,returnTypeError:l}})}const i={errorMap:n.common.contextualErrorMap},o=n.data;if(this._def.returns instanceof Ar){const a=this;return De(async function(...l){const u=new Ge([]),c=await a._def.args.parseAsync(l,i).catch(y=>{throw u.addIssue(r(l,y)),u}),f=await Reflect.apply(o,this,c);return await a._def.returns._def.type.parseAsync(f,i).catch(y=>{throw u.addIssue(s(f,y)),u})})}else{const a=this;return De(function(...l){const u=a._def.args.safeParse(l,i);if(!u.success)throw new Ge([r(l,u.error)]);const c=Reflect.apply(o,this,u.data),f=a._def.returns.safeParse(c,i);if(!f.success)throw new Ge([s(c,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new vr({...this._def,args:It.create(t).rest(Pn.create())})}returns(t){return new vr({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new vr({args:t||It.create([]).rest(Pn.create()),returns:n||Pn.create(),typeName:z.ZodFunction,...V(r)})}}class $s extends K{get schema(){return this._def.getter()}_parse(t){const{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}$s.create=(e,t)=>new $s({getter:e,typeName:z.ZodLazy,...V(t)});class Ls extends K{_parse(t){if(t.data!==this._def.value){const n=this._getOrReturnCtx(t);return b(n,{received:n.data,code:T.invalid_literal,expected:this._def.value}),D}return{status:"valid",value:t.data}}get value(){return this._def.value}}Ls.create=(e,t)=>new Ls({value:e,typeName:z.ZodLiteral,...V(t)});function np(e,t){return new vn({values:e,typeName:z.ZodEnum,...V(t)})}class vn extends K{constructor(){super(...arguments),Yr.set(this,void 0)}_parse(t){if(typeof t.data!="string"){const n=this._getOrReturnCtx(t),r=this._def.values;return b(n,{expected:H.joinValues(r),received:n.parsedType,code:T.invalid_type}),D}if(uo(this,Yr)||Gh(this,Yr,new Set(this._def.values)),!uo(this,Yr).has(t.data)){const n=this._getOrReturnCtx(t),r=this._def.values;return b(n,{received:n.data,code:T.invalid_enum_value,options:r}),D}return De(t.data)}get options(){return this._def.values}get enum(){const t={};for(const n of this._def.values)t[n]=n;return t}get Values(){const t={};for(const n of this._def.values)t[n]=n;return t}get Enum(){const t={};for(const n of this._def.values)t[n]=n;return t}extract(t,n=this._def){return vn.create(t,{...this._def,...n})}exclude(t,n=this._def){return vn.create(this.options.filter(r=>!t.includes(r)),{...this._def,...n})}}Yr=new WeakMap;vn.create=np;class zs extends K{constructor(){super(...arguments),Gr.set(this,void 0)}_parse(t){const n=H.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==A.string&&r.parsedType!==A.number){const s=H.objectValues(n);return b(r,{expected:H.joinValues(s),received:r.parsedType,code:T.invalid_type}),D}if(uo(this,Gr)||Gh(this,Gr,new Set(H.getValidEnumValues(this._def.values))),!uo(this,Gr).has(t.data)){const s=H.objectValues(n);return b(r,{received:r.data,code:T.invalid_enum_value,options:s}),D}return De(t.data)}get enum(){return this._def.values}}Gr=new WeakMap;zs.create=(e,t)=>new zs({values:e,typeName:z.ZodNativeEnum,...V(t)});class Ar extends K{unwrap(){return this._def.type}_parse(t){const{ctx:n}=this._processInputParams(t);if(n.parsedType!==A.promise&&n.common.async===!1)return b(n,{code:T.invalid_type,expected:A.promise,received:n.parsedType}),D;const r=n.parsedType===A.promise?n.data:Promise.resolve(n.data);return De(r.then(s=>this._def.type.parseAsync(s,{path:n.path,errorMap:n.common.contextualErrorMap})))}}Ar.create=(e,t)=>new Ar({type:e,typeName:z.ZodPromise,...V(t)});class kt extends K{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===z.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:n,ctx:r}=this._processInputParams(t),s=this._def.effect||null,i={addIssue:o=>{b(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const o=s.transform(r.data,i);if(r.common.async)return Promise.resolve(o).then(async a=>{if(n.value==="aborted")return D;const l=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return l.status==="aborted"?D:l.status==="dirty"||n.value==="dirty"?dr(l.value):l});{if(n.value==="aborted")return D;const a=this._def.schema._parseSync({data:o,path:r.path,parent:r});return a.status==="aborted"?D:a.status==="dirty"||n.value==="dirty"?dr(a.value):a}}if(s.type==="refinement"){const o=a=>{const l=s.refinement(a,i);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){const a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?D:(a.status==="dirty"&&n.dirty(),o(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?D:(a.status==="dirty"&&n.dirty(),o(a.value).then(()=>({status:n.value,value:a.value}))))}if(s.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Os(o))return o;const a=s.transform(o.value,i);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Os(o)?Promise.resolve(s.transform(o.value,i)).then(a=>({status:n.value,value:a})):o);H.assertNever(s)}}kt.create=(e,t,n)=>new kt({schema:e,typeName:z.ZodEffects,effect:t,...V(n)});kt.createWithPreprocess=(e,t,n)=>new kt({schema:t,effect:{type:"preprocess",transform:e},typeName:z.ZodEffects,...V(n)});class Nt extends K{_parse(t){return this._getType(t)===A.undefined?De(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Nt.create=(e,t)=>new Nt({innerType:e,typeName:z.ZodOptional,...V(t)});class _n extends K{_parse(t){return this._getType(t)===A.null?De(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}_n.create=(e,t)=>new _n({innerType:e,typeName:z.ZodNullable,...V(t)});class Ds extends K{_parse(t){const{ctx:n}=this._processInputParams(t);let r=n.data;return n.parsedType===A.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}Ds.create=(e,t)=>new Ds({innerType:e,typeName:z.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...V(t)});class Us extends K{_parse(t){const{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},s=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return Ns(s)?s.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Ge(r.common.issues)},input:r.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new Ge(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}Us.create=(e,t)=>new Us({innerType:e,typeName:z.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...V(t)});class po extends K{_parse(t){if(this._getType(t)!==A.nan){const r=this._getOrReturnCtx(t);return b(r,{code:T.invalid_type,expected:A.nan,received:r.parsedType}),D}return{status:"valid",value:t.data}}}po.create=e=>new po({typeName:z.ZodNaN,...V(e)});const Mv=Symbol("zod_brand");class Uu extends K{_parse(t){const{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Js extends K{_parse(t){const{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?D:i.status==="dirty"?(n.dirty(),dr(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{const s=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?D:s.status==="dirty"?(n.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:r.path,parent:r})}}static create(t,n){return new Js({in:t,out:n,typeName:z.ZodPipeline})}}class Bs extends K{_parse(t){const n=this._def.innerType._parse(t),r=s=>(Os(s)&&(s.value=Object.freeze(s.value)),s);return Ns(n)?n.then(s=>r(s)):r(n)}unwrap(){return this._def.innerType}}Bs.create=(e,t)=>new Bs({innerType:e,typeName:z.ZodReadonly,...V(t)});function rp(e,t={},n){return e?br.create().superRefine((r,s)=>{var i,o;if(!e(r)){const a=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,l=(o=(i=a.fatal)!==null&&i!==void 0?i:n)!==null&&o!==void 0?o:!0,u=typeof a=="string"?{message:a}:a;s.addIssue({code:"custom",...u,fatal:l})}}):br.create()}const Pv={object:ae.lazycreate};var z;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(z||(z={}));const jv=(e,t={message:`Input not instance of ${e.name}`})=>rp(n=>n instanceof e,t),sp=yt.create,ip=yn.create,$v=po.create,Lv=gn.create,op=bs.create,zv=Kn.create,Dv=co.create,Uv=As.create,Bv=Is.create,Fv=br.create,Vv=Pn.create,Kv=Wt.create,Zv=fo.create,Wv=_t.create,bi=ae.create,Hv=ae.strictCreate,Jv=Ms.create,Qv=Po.create,qv=Ps.create,Yv=It.create,Gv=js.create,Xv=ho.create,e0=Zn.create,t0=vr.create,n0=$s.create,r0=Ls.create,s0=vn.create,i0=zs.create,o0=Ar.create,dd=kt.create,a0=Nt.create,l0=_n.create,u0=kt.createWithPreprocess,c0=Js.create,d0=()=>sp().optional(),f0=()=>ip().optional(),h0=()=>op().optional(),p0={string:e=>yt.create({...e,coerce:!0}),number:e=>yn.create({...e,coerce:!0}),boolean:e=>bs.create({...e,coerce:!0}),bigint:e=>gn.create({...e,coerce:!0}),date:e=>Kn.create({...e,coerce:!0})},m0=D;var Q=Object.freeze({__proto__:null,defaultErrorMap:Nr,setErrorMap:yv,getErrorMap:ao,makeIssue:lo,EMPTY_PATH:gv,addIssueToContext:b,ParseStatus:Me,INVALID:D,DIRTY:dr,OK:De,isAborted:_l,isDirty:wl,isValid:Os,isAsync:Ns,get util(){return H},get objectUtil(){return vl},ZodParsedType:A,getParsedType:en,ZodType:K,datetimeRegex:tp,ZodString:yt,ZodNumber:yn,ZodBigInt:gn,ZodBoolean:bs,ZodDate:Kn,ZodSymbol:co,ZodUndefined:As,ZodNull:Is,ZodAny:br,ZodUnknown:Pn,ZodNever:Wt,ZodVoid:fo,ZodArray:_t,ZodObject:ae,ZodUnion:Ms,ZodDiscriminatedUnion:Po,ZodIntersection:Ps,ZodTuple:It,ZodRecord:js,ZodMap:ho,ZodSet:Zn,ZodFunction:vr,ZodLazy:$s,ZodLiteral:Ls,ZodEnum:vn,ZodNativeEnum:zs,ZodPromise:Ar,ZodEffects:kt,ZodTransformer:kt,ZodOptional:Nt,ZodNullable:_n,ZodDefault:Ds,ZodCatch:Us,ZodNaN:po,BRAND:Mv,ZodBranded:Uu,ZodPipeline:Js,ZodReadonly:Bs,custom:rp,Schema:K,ZodSchema:K,late:Pv,get ZodFirstPartyTypeKind(){return z},coerce:p0,any:Fv,array:Wv,bigint:Lv,boolean:op,date:zv,discriminatedUnion:Qv,effect:dd,enum:s0,function:t0,instanceof:jv,intersection:qv,lazy:n0,literal:r0,map:Xv,nan:$v,nativeEnum:i0,never:Kv,null:Bv,nullable:l0,number:ip,object:bi,oboolean:h0,onumber:f0,optional:a0,ostring:d0,pipeline:c0,preprocess:u0,promise:o0,record:Gv,set:e0,strictObject:Hv,string:sp,symbol:Dv,transformer:dd,tuple:Yv,undefined:Uv,union:Jv,unknown:Vv,void:Zv,NEVER:m0,ZodIssueCode:T,quotelessJson:mv,ZodError:Ge});const ap={100:"Continue",101:"Switching Protocols",102:"Processing",103:"Early Hints",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",306:"Switch Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Too Early",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",510:"Not Extended",511:"Network Authentication Required"},pa=bd(ap).map(([e])=>Q.literal(Number(e))),y0=Q.union([pa[0],pa[1],...pa]);Q.tuple([y0,Q.string()]);function g0(){return O.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",children:[O.jsx("title",{children:"Tempest Games Logo"}),O.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M202.91,7.86h-13.18v17.03h13.18v6.84h-13.18v22.24h13.18v6.84h-30.29V.93h30.29v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M289.49.93v59.89h-17.11V7.78h-.43c-8.21,0-11.21,5.82-11.21,17.03v36.02h-16.25V24.8c0-11.21-2.99-17.03-11.21-17.03h-.43v53.04h-17.11V.93h18.74c9.92,0,15.31,4.96,18.14,11.21,2.82-6.25,8.21-11.21,18.14-11.21h18.73Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M352.82,29.68c0,11.72-6.42,19.16-24.55,19.16h-4.53v11.98h-17.11V1.1l46.2-.17v28.75ZM323.73,7.78v34.22h2.48c7.36,0,9.5-4.11,9.5-12.15V7.78h-11.98Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M396.8,7.86h-13.17v17.03h13.17v6.84h-13.17v22.24h13.17v6.84h-30.28V.93h30.28v6.93Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M425.9,12.57v14.03h27.89v16.94c0,12.75-1.71,18.13-16.43,18.13h-14.54c-9.58,0-14.03-2.74-14.03-11.97v-5.99h15.4v5.13c0,4.53.77,5.99,4.62,5.99h1.71c5.05,0,6.16-1.46,6.16-6.84v-14.54h-27.89v-16.68c0-13.52,3.85-16.68,18.82-16.68h12.83c8.81,0,13.17,1.54,13.17,10.78v7.19h-15.4v-6.5c0-3.42-1.03-4.62-4.45-4.62h-1.45c-4.28,0-6.42,1.46-6.42,5.65Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M155.96,93.78v-3.57h-5.58v-7.14h13.39v17.85h-24.76v-28.56h24.76v7.14h-16.96v14.28h9.15Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M224.26,100.92h-8.25v-10.71h-8.25v3.57h4.68v7.14h-12.94v-17.85h16.51v-3.57h-16.51v-7.14h24.76v28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M259.99,72.36h30.57v28.56h-7.81v-21.42h-3.57v21.42h-7.81v-21.42h-3.57v21.42h-7.81v-28.56Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M343.24,83.08v-3.57h-9.14v14.28h16.96v7.14h-24.76v-28.56h24.76v17.85h-13.38v-7.14h5.57Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M394.59,79.5v3.57h16.96v17.85h-24.76v-7.14h16.96v-3.57h-16.96v-17.85h24.76v7.14h-16.96Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),O.jsx("path",{d:"M0,63.42v-20.84h20.83L0,63.42ZM100,.92v32.29h-35.42v8.33h-8.33V14.46h-22.92l1.04,7.29h9.38v19.79h-8.33v-8.33H0V.92h100ZM0,100.92v-26.04l6.25-1.04,25-26.04,1.04,1.05-10.42,18.75-4.16,7.29h13.54l3.13-3.12,8.33-22.92h1.04v41.66h3.12l9.38-8.33v-33.33h1.04l8.33,22.92,3.12,3.12h13.54l-4.17-7.29-10.42-19.8,1.04-1.04,25,27.09,6.25,1.04v26.04H0ZM100,42.59v20.84l-20.83-20.84h20.83Z",style:{fill:"var(--logo-color)",strokeWidth:0}})]})}function jo(e){return O.jsx("a",{...e})}const v0={class:"_class_wtkls_1"};function _0(e){return["required",e]}function w0(e){return["optional",e]}function k0(e,t){let n=e;for(const r of t){if(n===null||typeof r!="string")return!1;const s=n[1];if(r in s)n=s[r];else{const i=Object.keys(s).find(o=>o.startsWith("$"));if(i){n=s[i];continue}return!1}}if(n===null)return!0;switch(n[0]){case"required":return!1;case"optional":return!0}}const Mt=Object.create(null);Mt.open="0";Mt.close="1";Mt.ping="2";Mt.pong="3";Mt.message="4";Mt.upgrade="5";Mt.noop="6";const Ai=Object.create(null);Object.keys(Mt).forEach(e=>{Ai[Mt[e]]=e});const Sl={type:"error",data:"parser error"},lp=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",up=typeof ArrayBuffer=="function",cp=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Bu=({type:e,data:t},n,r)=>lp&&t instanceof Blob?n?r(t):fd(t,r):up&&(t instanceof ArrayBuffer||cp(t))?n?r(t):fd(new Blob([t]),r):r(Mt[e]+(t||"")),fd=(e,t)=>{const n=new FileReader;return n.onload=function(){const r=n.result.split(",")[1];t("b"+(r||""))},n.readAsDataURL(e)};function hd(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let ma;function S0(e,t){if(lp&&e.data instanceof Blob)return e.data.arrayBuffer().then(hd).then(t);if(up&&(e.data instanceof ArrayBuffer||cp(e.data)))return t(hd(e.data));Bu(e,!1,n=>{ma||(ma=new TextEncoder),t(ma.encode(n))})}const pd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xr=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<pd.length;e++)Xr[pd.charCodeAt(e)]=e;const x0=e=>{let t=e.length*.75,n=e.length,r,s=0,i,o,a,l;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const u=new ArrayBuffer(t),c=new Uint8Array(u);for(r=0;r<n;r+=4)i=Xr[e.charCodeAt(r)],o=Xr[e.charCodeAt(r+1)],a=Xr[e.charCodeAt(r+2)],l=Xr[e.charCodeAt(r+3)],c[s++]=i<<2|o>>4,c[s++]=(o&15)<<4|a>>2,c[s++]=(a&3)<<6|l&63;return u},E0=typeof ArrayBuffer=="function",Fu=(e,t)=>{if(typeof e!="string")return{type:"message",data:dp(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:T0(e.substring(1),t)}:Ai[n]?e.length>1?{type:Ai[n],data:e.substring(1)}:{type:Ai[n]}:Sl},T0=(e,t)=>{if(E0){const n=x0(e);return dp(n,t)}else return{base64:!0,data:e}},dp=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},fp="",C0=(e,t)=>{const n=e.length,r=new Array(n);let s=0;e.forEach((i,o)=>{Bu(i,!1,a=>{r[o]=a,++s===n&&t(r.join(fp))})})},R0=(e,t)=>{const n=e.split(fp),r=[];for(let s=0;s<n.length;s++){const i=Fu(n[s],t);if(r.push(i),i.type==="error")break}return r};function O0(){return new TransformStream({transform(e,t){S0(e,n=>{const r=n.length;let s;if(r<126)s=new Uint8Array(1),new DataView(s.buffer).setUint8(0,r);else if(r<65536){s=new Uint8Array(3);const i=new DataView(s.buffer);i.setUint8(0,126),i.setUint16(1,r)}else{s=new Uint8Array(9);const i=new DataView(s.buffer);i.setUint8(0,127),i.setBigUint64(1,BigInt(r))}e.data&&typeof e.data!="string"&&(s[0]|=128),t.enqueue(s),t.enqueue(n)})}})}let ya;function yi(e){return e.reduce((t,n)=>t+n.length,0)}function gi(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let r=0;for(let s=0;s<t;s++)n[s]=e[0][r++],r===e[0].length&&(e.shift(),r=0);return e.length&&r<e[0].length&&(e[0]=e[0].slice(r)),n}function N0(e,t){ya||(ya=new TextDecoder);const n=[];let r=0,s=-1,i=!1;return new TransformStream({transform(o,a){for(n.push(o);;){if(r===0){if(yi(n)<1)break;const l=gi(n,1);i=(l[0]&128)===128,s=l[0]&127,s<126?r=3:s===126?r=1:r=2}else if(r===1){if(yi(n)<2)break;const l=gi(n,2);s=new DataView(l.buffer,l.byteOffset,l.length).getUint16(0),r=3}else if(r===2){if(yi(n)<8)break;const l=gi(n,8),u=new DataView(l.buffer,l.byteOffset,l.length),c=u.getUint32(0);if(c>Math.pow(2,21)-1){a.enqueue(Sl);break}s=c*Math.pow(2,32)+u.getUint32(4),r=3}else{if(yi(n)<s)break;const l=gi(n,s);a.enqueue(Fu(i?l:ya.decode(l),t)),r=0}if(s===0||s>e){a.enqueue(Sl);break}}}})}const hp=4;function me(e){if(e)return b0(e)}function b0(e){for(var t in me.prototype)e[t]=me.prototype[t];return e}me.prototype.on=me.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};me.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};me.prototype.off=me.prototype.removeListener=me.prototype.removeAllListeners=me.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var r,s=0;s<n.length;s++)if(r=n[s],r===t||r.fn===t){n.splice(s,1);break}return n.length===0&&delete this._callbacks["$"+e],this};me.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(n){n=n.slice(0);for(var r=0,s=n.length;r<s;++r)n[r].apply(this,t)}return this};me.prototype.emitReserved=me.prototype.emit;me.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};me.prototype.hasListeners=function(e){return!!this.listeners(e).length};const $o=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),it=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),A0="arraybuffer";function pp(e,...t){return t.reduce((n,r)=>(e.hasOwnProperty(r)&&(n[r]=e[r]),n),{})}const I0=it.setTimeout,M0=it.clearTimeout;function Lo(e,t){t.useNativeTimers?(e.setTimeoutFn=I0.bind(it),e.clearTimeoutFn=M0.bind(it)):(e.setTimeoutFn=it.setTimeout.bind(it),e.clearTimeoutFn=it.clearTimeout.bind(it))}const P0=1.33;function j0(e){return typeof e=="string"?$0(e):Math.ceil((e.byteLength||e.size)*P0)}function $0(e){let t=0,n=0;for(let r=0,s=e.length;r<s;r++)t=e.charCodeAt(r),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(r++,n+=4);return n}function mp(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function L0(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function z0(e){let t={},n=e.split("&");for(let r=0,s=n.length;r<s;r++){let i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}class D0 extends Error{constructor(t,n,r){super(t),this.description=n,this.context=r,this.type="TransportError"}}class Vu extends me{constructor(t){super(),this.writable=!1,Lo(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,r){return super.emitReserved("error",new D0(t,n,r)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Fu(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=L0(t);return n.length?"?"+n:""}}class U0 extends Vu{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let r=0;this._polling&&(r++,this.once("pollComplete",function(){--r||n()})),this.writable||(r++,this.once("drain",function(){--r||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=r=>{if(this.readyState==="opening"&&r.type==="open"&&this.onOpen(),r.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(r)};R0(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,C0(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=mp()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let yp=!1;try{yp=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const B0=yp;function F0(){}class V0 extends U0{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let r=location.port;r||(r=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||r!==t.port}}doWrite(t,n){const r=this.request({method:"POST",data:t});r.on("success",n),r.on("error",(s,i)=>{this.onError("xhr post error",s,i)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,r)=>{this.onError("xhr poll error",n,r)}),this.pollXhr=t}}class bt extends me{constructor(t,n,r){super(),this.createRequest=t,Lo(this,r),this._opts=r,this._method=r.method||"GET",this._uri=n,this._data=r.data!==void 0?r.data:null,this._create()}_create(){var t;const n=pp(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const r=this._xhr=this.createRequest(n);try{r.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0);for(let s in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this._opts.extraHeaders[s])}}catch{}if(this._method==="POST")try{r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{r.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(r),"withCredentials"in r&&(r.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(r.timeout=this._opts.requestTimeout),r.onreadystatechange=()=>{var s;r.readyState===3&&((s=this._opts.cookieJar)===null||s===void 0||s.parseCookies(r.getResponseHeader("set-cookie"))),r.readyState===4&&(r.status===200||r.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof r.status=="number"?r.status:0)},0))},r.send(this._data)}catch(s){this.setTimeoutFn(()=>{this._onError(s)},0);return}typeof document<"u"&&(this._index=bt.requestsCount++,bt.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=F0,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete bt.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}bt.requestsCount=0;bt.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",md);else if(typeof addEventListener=="function"){const e="onpagehide"in it?"pagehide":"unload";addEventListener(e,md,!1)}}function md(){for(let e in bt.requests)bt.requests.hasOwnProperty(e)&&bt.requests[e].abort()}const K0=function(){const e=gp({xdomain:!1});return e&&e.responseType!==null}();class Z0 extends V0{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=K0&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new bt(gp,this.uri(),t)}}function gp(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||B0))return new XMLHttpRequest}catch{}if(!t)try{return new it[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const vp=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class W0 extends Vu{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,r=vp?{}:pp(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(r.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,r)}catch(s){return this.emitReserved("error",s)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;Bu(r,this.supportsBinary,i=>{try{this.doWrite(r,i)}catch{}s&&$o(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=mp()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const ga=it.WebSocket||it.MozWebSocket;class H0 extends W0{createSocket(t,n,r){return vp?new ga(t,n,r):n?new ga(t,n):new ga(t)}doWrite(t,n){this.ws.send(n)}}class J0 extends Vu{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=N0(Number.MAX_SAFE_INTEGER,this.socket.binaryType),r=t.readable.pipeThrough(n).getReader(),s=O0();s.readable.pipeTo(t.writable),this._writer=s.writable.getWriter();const i=()=>{r.read().then(({done:a,value:l})=>{a||(this.onPacket(l),i())}).catch(a=>{})};i();const o={type:"open"};this.query.sid&&(o.data=`{"sid":"${this.query.sid}"}`),this._writer.write(o).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const r=t[n],s=n===t.length-1;this._writer.write(r).then(()=>{s&&$o(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const Q0={websocket:H0,webtransport:J0,polling:Z0},q0=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Y0=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function xl(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),r=e.indexOf("]");n!=-1&&r!=-1&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));let s=q0.exec(e||""),i={},o=14;for(;o--;)i[Y0[o]]=s[o]||"";return n!=-1&&r!=-1&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i.pathNames=G0(i,i.path),i.queryKey=X0(i,i.query),i}function G0(e,t){const n=/\/{2,9}/g,r=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&r.splice(0,1),t.slice(-1)=="/"&&r.splice(r.length-1,1),r}function X0(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(r,s,i){s&&(n[s]=i)}),n}const El=typeof addEventListener=="function"&&typeof removeEventListener=="function",Ii=[];El&&addEventListener("offline",()=>{Ii.forEach(e=>e())},!1);class fn extends me{constructor(t,n){if(super(),this.binaryType=A0,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const r=xl(t);n.hostname=r.host,n.secure=r.protocol==="https"||r.protocol==="wss",n.port=r.port,r.query&&(n.query=r.query)}else n.host&&(n.hostname=xl(n.host).host);Lo(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(r=>{const s=r.prototype.name;this.transports.push(s),this._transportsByName[s]=r}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=z0(this.opts.query)),El&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},Ii.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=hp,n.transport=t,this.id&&(n.sid=this.id);const r=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](r)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&fn.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",fn.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let r=0;r<this.writeBuffer.length;r++){const s=this.writeBuffer[r].data;if(s&&(n+=j0(s)),r>0&&n>this._maxPayload)return this.writeBuffer.slice(0,r);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,$o(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,r){return this._sendPacket("message",t,n,r),this}send(t,n,r){return this._sendPacket("message",t,n,r),this}_sendPacket(t,n,r,s){if(typeof n=="function"&&(s=n,n=void 0),typeof r=="function"&&(s=r,r=null),this.readyState==="closing"||this.readyState==="closed")return;r=r||{},r.compress=r.compress!==!1;const i={type:t,data:n,options:r};this.emitReserved("packetCreate",i),this.writeBuffer.push(i),s&&this.once("flush",s),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},r=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?r():t()}):this.upgrading?r():t()),this}_onError(t){if(fn.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),El&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const r=Ii.indexOf(this._offlineEventListener);r!==-1&&Ii.splice(r,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}fn.protocol=hp;class e1 extends fn{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),r=!1;fn.priorWebsocketSuccess=!1;const s=()=>{r||(n.send([{type:"ping",data:"probe"}]),n.once("packet",f=>{if(!r)if(f.type==="pong"&&f.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;fn.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{r||this.readyState!=="closed"&&(c(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const h=new Error("probe error");h.transport=n.name,this.emitReserved("upgradeError",h)}}))};function i(){r||(r=!0,c(),n.close(),n=null)}const o=f=>{const h=new Error("probe error: "+f);h.transport=n.name,i(),this.emitReserved("upgradeError",h)};function a(){o("transport closed")}function l(){o("socket closed")}function u(f){n&&f.name!==n.name&&i()}const c=()=>{n.removeListener("open",s),n.removeListener("error",o),n.removeListener("close",a),this.off("close",l),this.off("upgrading",u)};n.once("open",s),n.once("error",o),n.once("close",a),this.once("close",l),this.once("upgrading",u),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{r||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let r=0;r<t.length;r++)~this.transports.indexOf(t[r])&&n.push(t[r]);return n}}let t1=class extends e1{constructor(t,n={}){const r=typeof t=="object"?t:n;(!r.transports||r.transports&&typeof r.transports[0]=="string")&&(r.transports=(r.transports||["polling","websocket","webtransport"]).map(s=>Q0[s]).filter(s=>!!s)),super(t,r)}};function n1(e,t="",n){let r=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),r=xl(e)),r.port||(/^(http|ws)$/.test(r.protocol)?r.port="80":/^(http|ws)s$/.test(r.protocol)&&(r.port="443")),r.path=r.path||"/";const i=r.host.indexOf(":")!==-1?"["+r.host+"]":r.host;return r.id=r.protocol+"://"+i+":"+r.port+t,r.href=r.protocol+"://"+i+(n&&n.port===r.port?"":":"+r.port),r}const r1=typeof ArrayBuffer=="function",s1=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,_p=Object.prototype.toString,i1=typeof Blob=="function"||typeof Blob<"u"&&_p.call(Blob)==="[object BlobConstructor]",o1=typeof File=="function"||typeof File<"u"&&_p.call(File)==="[object FileConstructor]";function Ku(e){return r1&&(e instanceof ArrayBuffer||s1(e))||i1&&e instanceof Blob||o1&&e instanceof File}function Mi(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,r=e.length;n<r;n++)if(Mi(e[n]))return!0;return!1}if(Ku(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return Mi(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&Mi(e[n]))return!0;return!1}function a1(e){const t=[],n=e.data,r=e;return r.data=Tl(n,t),r.attachments=t.length,{packet:r,buffers:t}}function Tl(e,t){if(!e)return e;if(Ku(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let r=0;r<e.length;r++)n[r]=Tl(e[r],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=Tl(e[r],t));return n}return e}function l1(e,t){return e.data=Cl(e.data,t),delete e.attachments,e}function Cl(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Cl(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Cl(e[n],t));return e}const u1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],c1=5;var W;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(W||(W={}));class d1{constructor(t){this.replacer=t}encode(t){return(t.type===W.EVENT||t.type===W.ACK)&&Mi(t)?this.encodeAsBinary({type:t.type===W.EVENT?W.BINARY_EVENT:W.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===W.BINARY_EVENT||t.type===W.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=a1(t),r=this.encodeAsString(n.packet),s=n.buffers;return s.unshift(r),s}}function yd(e){return Object.prototype.toString.call(e)==="[object Object]"}class Zu extends me{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const r=n.type===W.BINARY_EVENT;r||n.type===W.BINARY_ACK?(n.type=r?W.EVENT:W.ACK,this.reconstructor=new f1(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Ku(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const r={type:Number(t.charAt(0))};if(W[r.type]===void 0)throw new Error("unknown packet type "+r.type);if(r.type===W.BINARY_EVENT||r.type===W.BINARY_ACK){const i=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const o=t.substring(i,n);if(o!=Number(o)||t.charAt(n)!=="-")throw new Error("Illegal attachments");r.attachments=Number(o)}if(t.charAt(n+1)==="/"){const i=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););r.nsp=t.substring(i,n)}else r.nsp="/";const s=t.charAt(n+1);if(s!==""&&Number(s)==s){const i=n+1;for(;++n;){const o=t.charAt(n);if(o==null||Number(o)!=o){--n;break}if(n===t.length)break}r.id=Number(t.substring(i,n+1))}if(t.charAt(++n)){const i=this.tryParse(t.substr(n));if(Zu.isPayloadValid(r.type,i))r.data=i;else throw new Error("invalid payload")}return r}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case W.CONNECT:return yd(n);case W.DISCONNECT:return n===void 0;case W.CONNECT_ERROR:return typeof n=="string"||yd(n);case W.EVENT:case W.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&u1.indexOf(n[0])===-1);case W.ACK:case W.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class f1{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=l1(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const h1=Object.freeze(Object.defineProperty({__proto__:null,Decoder:Zu,Encoder:d1,get PacketType(){return W},protocol:c1},Symbol.toStringTag,{value:"Module"}));function pt(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const p1=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class wp extends me{constructor(t,n,r){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,r&&r.auth&&(this.auth=r.auth),this._opts=Object.assign({},r),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[pt(t,"open",this.onopen.bind(this)),pt(t,"packet",this.onpacket.bind(this)),pt(t,"error",this.onerror.bind(this)),pt(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var r,s,i;if(p1.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const o={type:W.EVENT,data:n};if(o.options={},o.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const c=this.ids++,f=n.pop();this._registerAckCallback(c,f),o.id=c}const a=(s=(r=this.io.engine)===null||r===void 0?void 0:r.transport)===null||s===void 0?void 0:s.writable,l=this.connected&&!(!((i=this.io.engine)===null||i===void 0)&&i._hasPingExpired());return this.flags.volatile&&!a||(l?(this.notifyOutgoingListeners(o),this.packet(o)):this.sendBuffer.push(o)),this.flags={},this}_registerAckCallback(t,n){var r;const s=(r=this.flags.timeout)!==null&&r!==void 0?r:this._opts.ackTimeout;if(s===void 0){this.acks[t]=n;return}const i=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let a=0;a<this.sendBuffer.length;a++)this.sendBuffer[a].id===t&&this.sendBuffer.splice(a,1);n.call(this,new Error("operation has timed out"))},s),o=(...a)=>{this.io.clearTimeoutFn(i),n.apply(this,a)};o.withError=!0,this.acks[t]=o}emitWithAck(t,...n){return new Promise((r,s)=>{const i=(o,a)=>o?s(o):r(a);i.withError=!0,n.push(i),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const r={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((s,...i)=>r!==this._queue[0]?void 0:(s!==null?r.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(s)):(this._queue.shift(),n&&n(null,...i)),r.pending=!1,this._drainQueue())),this._queue.push(r),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:W.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(r=>String(r.id)===t)){const r=this.acks[t];delete this.acks[t],r.withError&&r.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case W.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case W.EVENT:case W.BINARY_EVENT:this.onevent(t);break;case W.ACK:case W.BINARY_ACK:this.onack(t);break;case W.DISCONNECT:this.ondisconnect();break;case W.CONNECT_ERROR:this.destroy();const r=new Error(t.data.message);r.data=t.data.data,this.emitReserved("connect_error",r);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const r of n)r.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let r=!1;return function(...s){r||(r=!0,n.packet({type:W.ACK,id:t,data:s}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:W.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let r=0;r<n.length;r++)if(t===n[r])return n.splice(r,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const r of n)r.apply(this,t.data)}}}function Lr(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Lr.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=Math.floor(t*10)&1?e+n:e-n}return Math.min(e,this.max)|0};Lr.prototype.reset=function(){this.attempts=0};Lr.prototype.setMin=function(e){this.ms=e};Lr.prototype.setMax=function(e){this.max=e};Lr.prototype.setJitter=function(e){this.jitter=e};class Rl extends me{constructor(t,n){var r;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,Lo(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((r=n.randomizationFactor)!==null&&r!==void 0?r:.5),this.backoff=new Lr({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const s=n.parser||h1;this.encoder=new s.Encoder,this.decoder=new s.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new t1(this.uri,this.opts);const n=this.engine,r=this;this._readyState="opening",this.skipReconnect=!1;const s=pt(n,"open",function(){r.onopen(),t&&t()}),i=a=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",a),t?t(a):this.maybeReconnectOnOpen()},o=pt(n,"error",i);if(this._timeout!==!1){const a=this._timeout,l=this.setTimeoutFn(()=>{s(),i(new Error("timeout")),n.close()},a);this.opts.autoUnref&&l.unref(),this.subs.push(()=>{this.clearTimeoutFn(l)})}return this.subs.push(s),this.subs.push(o),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(pt(t,"ping",this.onping.bind(this)),pt(t,"data",this.ondata.bind(this)),pt(t,"error",this.onerror.bind(this)),pt(t,"close",this.onclose.bind(this)),pt(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){$o(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let r=this.nsps[t];return r?this._autoConnect&&!r.active&&r.connect():(r=new wp(this,t,n),this.nsps[t]=r),r}_destroy(t){const n=Object.keys(this.nsps);for(const r of n)if(this.nsps[r].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let r=0;r<n.length;r++)this.engine.write(n[r],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var r;this.cleanup(),(r=this.engine)===null||r===void 0||r.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const r=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(s=>{s?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",s)):t.onreconnect()}))},n);this.opts.autoUnref&&r.unref(),this.subs.push(()=>{this.clearTimeoutFn(r)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Wr={};function Pi(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=n1(e,t.path||"/socket.io"),r=n.source,s=n.id,i=n.path,o=Wr[s]&&i in Wr[s].nsps,a=t.forceNew||t["force new connection"]||t.multiplex===!1||o;let l;return a?l=new Rl(r,t):(Wr[s]||(Wr[s]=new Rl(r,t)),l=Wr[s]),n.query&&!t.query&&(t.query=n.queryKey),l.socket(n.path,t)}Object.assign(Pi,{Manager:Rl,Socket:wp,io:Pi,connect:Pi});const m1=["123","321","abc","admin","adobe","alexander","amanda","andrea","andrew","angel","apple","asdf","ashley","baby","banana","baseball","batman","bear","biteme","blazer","blonde","boston","buster","butterfly","cameron","charlie","cheese","chelsea","chicken","chocolate","chris","compaq","computer","cookie","corvette","cowboys","dakota","dallas","daniel","david","diamond","dolphin","donald","dragon","eagle","flower","football","frank","freedom","friend","gateway","george","ginger","god","golf","hannah","hardcore","harley","heather","hello","hottie","hunter","internet","jasmine","jennifer","jessica","jesus","johnny","jordan","joshua","justin","justme","killer","knight","lakers","letmein","liverpool","login","london","love","lucky","mackenzie","maggie","master","matrix","matthew","maverick","melissa","mercedes","michael","michelle","mickey","miller","money","monkey","morgan","mother","muffin","mustang","natasha","nathan","nicole","ninja","orange","pass","password","patrick","peanut","pepper","phoenix","photoshop","pokemon","princess","purple","qazwsx","qwerty","rainbow","ranger","root","samantha","samsung","scooter","secret","shadow","simpson","smile","soccer","sparkle","starwars","summer","sunflower","sunshine","superman","taylor","temp","test","thomas","tigers","tigger","tinkerbell","trust","turtle","victoria","welcome","whatever","william","winter","yellow","zaq12wsx","zxcvbn"],y1=3,g1=15,v1=/^[a-zA-Z0-9_-]+$/,Wu=Q.string().min(y1).max(g1).regex(v1),gd=20,vd={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function _1(e){let t="";for(const n of e)n in vd?t+=vd[n]:t+=n;return t}function w1(e){const t=e.toLocaleLowerCase(),n=_1(t);for(const r of m1)if(n.includes(r)||t.includes(r))return!0;return!1}function k1(e){const t=new Set(e).size;return e.length*Math.log2(t)}function S1(e){let t=0;return w1(e)&&(t-=100),t+=k1(e)*.5,Math.max(t,0)}const Hu=Q.string().refine(e=>S1(e)>=gd,{message:`Password does not meet the minimum complexity of ${gd}.`}).brand("password");Q.object({username:Wu,password:Hu}).strict();const kp=Q.string().email().brand("email");Q.object({username:Wu,password:Hu,email:kp}).strict();var x1={};function E1(e){const t=e.runtimeEnvStrict??e.runtimeEnv??x1;for(const[C,g]of Object.entries(t))g===""&&delete t[C];if(!!e.skipValidation)return t;const r=typeof e.client=="object"?e.client:{},s=typeof e.server=="object"?e.server:{},i=typeof e.shared=="object"?e.shared:{},o=bi(r),a=bi(s),l=bi(i),u=e.isServer??(typeof window>"u"||"Deno"in window),c=o.merge(l),f=a.merge(l).merge(o),h=u?f.safeParse(t):c.safeParse(t),y=e.onValidationError??(C=>{throw console.error("❌ Invalid environment variables:",C.flatten().fieldErrors),new Error("Invalid environment variables")}),w=e.onInvalidAccess??(C=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(h.success===!1)return y(h.error);const v=C=>e.clientPrefix?!C.startsWith(e.clientPrefix)&&!(C in l.shape):!0,N=C=>u||!v(C),p=C=>C==="__esModule"||C==="$$typeof",d=(e.extends??[]).reduce((C,g)=>Object.assign(C,g),{}),m=Object.assign(h.data,d);return new Proxy(m,{get(C,g){if(typeof g=="string"&&!p(g))return N(g)?Reflect.get(C,g):w(g)}})}const T1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},C1="__vite_start_time"in globalThis,R1=typeof window<"u",Ju=E1({isServer:!C1&&!R1,server:{CI:Q.string().transform(e=>!0).optional(),POSTGRES_USER:Q.string(),POSTGRES_PASSWORD:Q.string(),POSTGRES_DATABASE:Q.string(),POSTGRES_HOST:Q.string(),POSTGRES_PORT:Q.string().transform(e=>Number.parseInt(e,10)),BACKEND_PORT:Q.string().transform(e=>Number.parseInt(e,10)),RUN_WORKERS_FROM_SOURCE:Q.union([Q.literal("true"),Q.literal("false")]).optional().transform(e=>e==="true"),FRONTEND_PORT:Q.string().transform(e=>Number.parseInt(e,10)),FRONTEND_ORIGINS:Q.string().transform(e=>JSON.parse(e)).pipe(Q.array(Q.string())),OPENAI_API_KEY:Q.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:Q.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:Q.union([Q.literal("true"),Q.literal("false")]).optional().transform(e=>e==="true")},runtimeEnv:T1,emptyStringAsUndefined:!0}),Qu=Pi(Ju.VITE_BACKEND_ORIGIN,{auth:e=>{const t=_a(Ir);t&&e(t)},autoConnect:!1}).on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),zl(Ir,null)}),Ir=et({key:"auth",default:null,effects:[({onSet:e})=>{e(({newValue:t})=>{t?(localStorage.setItem("username",t.username),localStorage.setItem("sessionKey",t.sessionKey),console.log("connecting..."),Qu.connect()):(console.log("clearing session..."),localStorage.removeItem("sessionKey"))})},({setSelf:e})=>{const t=localStorage.getItem("username"),n=localStorage.getItem("sessionKey");t&&n&&e({username:t,sessionKey:n})}]}),Fs=et({key:"username",default:window.localStorage.getItem("username")??""}),Sp=Wn({key:"usernameIssues",get:({get:e})=>{const t=e(Fs),n=Wu.safeParse(t);return n.success?null:n.error.issues}}),Mr=et({key:"password0",default:""}),xp=Wn({key:"password0Issues",get:({get:e})=>{const t=e(Mr),n=Hu.safeParse(t);return n.success?null:n.error.issues}}),Ol=et({key:"password1",default:""}),Ep=Wn({key:"password1Issues",get:({get:e})=>{const t=e(Mr),n=e(Ol),r=Q.string().refine(s=>s===t,{message:"Passwords do not match."}).safeParse(n);return r.success?null:r.error.issues}}),Nl=et({key:"email",default:""}),Tp=Wn({key:"emailIssues",get:({get:e})=>{const t=e(Nl),n=kp.safeParse(t);return n.success?null:n.error.issues}}),O1=Wn({key:"signupReady",get:({get:e})=>{const t=e(Sp),n=e(xp),r=e(Ep),s=e(Tp);return!(t??n??r??s)}}),Cp=_0({login:null,sign_up:null,game:w0({clicker:null}),admin:null});function N1(e){return k0(Cp,e)}const b1=[["login"],["sign_up"]];function A1(e){return b1.some(t=>t.join("/")===e.join("/"))}function Rp(e){history.pushState(null,"",e),zl(Op,e)}const Op=et({key:"pathName",default:window.location.pathname,effects:[({onSet:e,setSelf:t})=>{const n=s=>{history.replaceState(null,"",s),t(s)},r=s=>{switch(s){case"/":{const i=_a(Ir);let o="/login";i&&(o="/game"),n(o);break}case"/login":case"/sign_up":_a(Ir)&&n("/game")}};r(window.location.pathname),e(({newValue:s})=>{r(s)})},({setSelf:e})=>{document.addEventListener("click",t=>{const n=t.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const r=n.getAttribute("href");r!=null&&r.startsWith("/")&&(t.preventDefault(),history.pushState(null,"",r),e(r))}}),window.addEventListener("popstate",()=>{e(window.location.pathname)})}]}),I1=Wn({key:"route",get:({get:e})=>{const n=e(Op).split("/").slice(1);return N1(n)?A1(n)||e(Ir)?n:401:404}});function M1(){return O.jsx("article",{children:O.jsx("h1",{children:"admin"})})}class P1 extends Map{set(t,n){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:n}),this):super.set(t,n)}clear(){throw new Error("Cannot clear an InvariantMap")}}const us=class us{constructor(t){x(this,"type","continuity");x(this,"globals",[]);x(this,"actions",[]);x(this,"perspectives",[]);this.key=t}static create(t,n){const r=new us(t),{type:s,globals:i,actions:o,perspectives:a}=n(r),l={type:s,key:t,globals:i,actions:o,perspectives:a};return us.existing.set(t,l),l}add(...t){switch(t[0].type){case"atom":case"mutable_atom":this.globals.push(...t);break;case"transaction":this.actions.push(...t);break;case"atom_family":{const[r,s]=t;this.perspectives.push({type:"realtime_perspective",resourceAtoms:r,viewAtoms:s})}break}return this}};x(us,"existing",new P1);let bl=us;function j1(e){const{key:t,config:n}=e,r=bl.create(t,n),{actions:s}=r;for(const i of s)Ld(t,i.key,_e.STORE);return Sa(t,-1,_e.STORE),r}et({key:"usersInRoomIndex",mutable:!0,default:()=>new Ct,toJson:e=>e.toJSON(),fromJson:e=>Ct.fromJSON(e)});et({key:"roomIndex",default:()=>new Ct,mutable:!0,toJson:e=>e.toJSON(),fromJson:e=>Ct.fromJSON(e)});const $1={enteredAtEpoch:0},L1=Sm({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:e=>typeof e=="string",isBType:e=>typeof e=="string"},$1);lm({key:"usersInMyRoomView",get:e=>({find:t})=>{const n=Cm(L1);return[t(n,e)]}});const qu=et({key:"count",default:0}),Np=um({key:"incrementTX",do:({set:e})=>{e(qu,t=>t+1)}}),z1=j1({key:"countContinuity",config:e=>e.add(qu).add(Np)});function D1({route:[e]}){return O.jsx("article",{children:e?O.jsx(B1,{gameId:e}):O.jsx(U1,{})})}function U1(){return O.jsx("nav",{children:O.jsx(jo,{href:"/game/clicker",children:"Clicker"})})}bd(Cp[1].game[1]);function B1({gameId:e}){console.log(e);const t=Je(qu),n=cm(Np);return uy(z1),O.jsxs("article",{children:[O.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",t]}),O.jsx("p",{children:"Let's see how high we can count!"})]})}async function F1(e,t="SHA-256"){const r=new TextEncoder().encode(e),s=await crypto.subtle.digest(t,r);return Array.from(new Uint8Array(s)).map(o=>o.toString(16).padStart(2,"0")).join("")}async function bp(e){const t=await F1(e);return`${t.substring(0,8)}-${t.substring(8,12)}-${t.substring(12,16)}-${t.substring(16,20)}-${t.substring(20,32)}`}function V1(){const e=On(Fs),t=On(Mr),n=Je(Fs),r=Je(Mr),[s,i]=ve.useState(null);return O.jsxs("form",{onSubmit:async o=>{o.preventDefault();const a=await bp("login"),l=await fetch(`${Ju.VITE_BACKEND_ORIGIN}/login-${a}`,{method:"POST",body:JSON.stringify({username:n,password:r})});if(console.log(l),l.status===200){e(""),t("");const u=await l.text(),[,c]=u.split(" ");zl(Ir,{username:n,sessionKey:c}),Qu.once("connect",()=>{Rp("/game")})}if(l.status>=400){const u=await l.text();i(u)}},children:[O.jsxs("main",{children:[s?O.jsx("aside",{children:s}):null,O.jsxs("label",{htmlFor:"username",children:[O.jsx("span",{children:"Username"}),O.jsx("input",{id:"username",type:"text",value:n,onChange:o=>{e(o.target.value)},autoComplete:"username",autoCapitalize:"none"})]}),O.jsxs("label",{htmlFor:"password",children:[O.jsx("span",{children:"Password"}),O.jsx("input",{id:"password",type:"password",value:r,onChange:o=>{t(o.target.value)},autoComplete:"current-password",autoCapitalize:"none"})]}),O.jsx("button",{type:"submit",disabled:!n||!r,children:"->"})]}),O.jsx("footer",{children:O.jsxs(jo,{href:"/sign_up",children:["New here? ",O.jsx("u",{children:"Sign up"})," for an account."]})})]})}function K1(){const e=On(Fs),t=On(Mr),n=On(Ol),r=On(Nl),s=Je(Fs),i=Je(Mr),o=Je(Ol),a=Je(Nl),l=Je(Sp),u=Je(xp),c=Je(Ep),f=Je(Tp),h=Je(O1),[y,w]=ve.useState(null);return O.jsxs("form",{onSubmit:async v=>{v.preventDefault();const N=i,p=await bp("sign-up"),d=await fetch(`${Ju.VITE_BACKEND_ORIGIN}/sign-up-${p}`,{method:"POST",body:JSON.stringify({username:s,password:N,email:a})});if(d.status===201&&(n(""),r(""),Rp("/login")),d.status>=400){const m=await d.text();w(m)}},children:[O.jsxs("main",{children:[y?O.jsx("aside",{children:y}):null,O.jsxs("label",{htmlFor:"username",children:[O.jsx("span",{children:"Username"}),O.jsx("input",{id:"username",type:"text",value:s,onChange:v=>{e(v.target.value)},autoComplete:"username",autoCapitalize:"none",style:{"--energy-color":s?l?"red":"green":void 0}}),s&&l?O.jsx("aside",{children:l.map(v=>O.jsx("span",{children:v.message},v.path.join(".")))}):null]}),O.jsxs("label",{htmlFor:"password",children:[O.jsx("span",{children:"Password"}),O.jsx("input",{id:"password0",type:"password",value:i,onChange:v=>{t(v.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":i?u?"red":"green":void 0}}),i&&u?O.jsx("aside",{children:u.map(v=>O.jsx("span",{children:v.message},v.path.join(".")))}):null]}),O.jsxs("label",{htmlFor:"password",children:[O.jsx("span",{children:"Confirm Password"}),O.jsx("input",{id:"password1",type:"password",value:o,onChange:v=>{n(v.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":o?c?"red":"green":void 0}}),o&&c?O.jsx("aside",{children:c.map(v=>O.jsx("span",{children:v.message},v.path.join(".")))}):null]}),O.jsxs("label",{htmlFor:"email",children:[O.jsx("span",{children:"Email"}),O.jsx("input",{id:"email",type:"email",value:a,onChange:v=>{r(v.target.value)},autoComplete:"email",autoCapitalize:"none",style:{"--energy-color":a?f?"red":"green":void 0}}),a&&f?O.jsx("aside",{children:f.map(v=>O.jsx("span",{children:v.message},v.path.join(".")))}):null]}),O.jsx("button",{type:"submit",disabled:!h,children:"->"})]}),O.jsx("footer",{children:O.jsxs(jo,{href:"/login",children:["Already have an account? ",O.jsx("u",{children:"Log in"})," instead."]})})]})}function Z1(){const e=Je(I1);return O.jsxs("main",{className:v0.class,children:[O.jsx("header",{children:O.jsx(g0,{})}),O.jsx("main",{children:typeof e=="number"?O.jsxs("article",{children:[O.jsx("h1",{children:e}),O.jsx("h2",{children:ap[e]}),O.jsx(jo,{href:"/login",children:"Return to Home Page"})]}):(()=>{const[t,...n]=e;switch(t){case"admin":return O.jsx(M1,{});case"login":return O.jsx(V1,{});case"sign_up":return O.jsx(K1,{});case"game":return O.jsx(D1,{route:n})}})()})]})}qh(document.getElementById("root")).render(O.jsx(ve.StrictMode,{children:O.jsx(ry,{socket:Qu,children:O.jsx(Z1,{})})}));