tempest.games 0.1.28 → 0.1.30

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.
@@ -0,0 +1,62 @@
1
+ var zv=Object.defineProperty;var Uv=(s,n,i)=>n in s?zv(s,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):s[n]=i;var B=(s,n,i)=>Uv(s,typeof n!="symbol"?n+"":n,i);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))u(c);new MutationObserver(c=>{for(const f of c)if(f.type==="childList")for(const h of f.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function i(c){const f={};return c.integrity&&(f.integrity=c.integrity),c.referrerPolicy&&(f.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?f.credentials="include":c.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(c){if(c.ep)return;c.ep=!0;const f=i(c);fetch(c.href,f)}})();var uo={exports:{}},Ll={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var $y;function jv(){if($y)return Ll;$y=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function i(u,c,f){var h=null;if(f!==void 0&&(h=""+f),c.key!==void 0&&(h=""+c.key),"key"in c){f={};for(var y in c)y!=="key"&&(f[y]=c[y])}else f=c;return c=f.ref,{$$typeof:s,type:u,key:h,ref:c!==void 0?c:null,props:f}}return Ll.Fragment=n,Ll.jsx=i,Ll.jsxs=i,Ll}var Xy;function Bv(){return Xy||(Xy=1,uo.exports=jv()),uo.exports}var q=Bv();function mm(s=Math.random){return s().toString(36).slice(2)}class _o extends Promise{constructor(i){let u,c;super((f,h)=>{u=f,c=h});B(this,"fate");B(this,"resolve");B(this,"reject");B(this,"done",!1);this.resolve=u,this.reject=c,this.use(i instanceof Promise?i:new Promise(i))}pass(i,u){i===this.fate&&(this.resolve(u),this.done=!0)}fail(i,u){i===this.fate&&(this.reject(u),this.done=!0)}use(i){if(i instanceof Promise){const u=i;this.fate=u,u.then(c=>{this.pass(u,c)},c=>{this.fail(u,c)})}else this.resolve(i),this.fate=void 0}}function pm(s){return Object.entries(s)}const qv=(s,n,i=Xe.STORE)=>Am(i,{key:`${s.key}:JSON`,get:({get:u})=>n.toJson(u(s)),set:({set:u},c)=>{u(s,n.fromJson(c))}});function re(s){for(;s.child!==null;)s=s.child;return s}class Ie{constructor(){B(this,"Subscriber");B(this,"subscribers",new Map)}subscribe(n,i){return this.subscribers.set(n,i),()=>{this.unsubscribe(n)}}unsubscribe(n){this.subscribers.delete(n)}next(n){const i=this.subscribers.values();for(const u of i)u(n)}}class Zv extends Ie{constructor(i){super();B(this,"state");this.state=i}next(i){this.state=i,super.next(i)}}function qo(s,n,i){const u={key:n.key,type:"atom_family"},c=s.families.get(n.key);c&&s.logger.error("❗","atom_family",n.key,`Overwriting an existing ${qi(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new Ie,y=Object.assign(p=>{const g=Ve(p),_={key:n.key,subKey:g},O=`${n.key}(${g})`,C=re(s),U=n.default,Y={key:O,default:U instanceof Function?U(p):U};n.effects&&(Y.effects=n.effects(p));const K=Xu(C,Y,_);return f.next({type:"state_creation",token:K}),K},u,{subject:f,install:p=>qo(p,n),internalRoles:i});return s.families.set(n.key,y),s.defaults.set(n.key,n.default),u}function Di(s,n,i){const u={key:n.key,type:"readonly_selector_family"},c=s.families.get(n.key);c&&s.logger.error("❗","readonly_selector_family",n.key,`Overwriting an existing ${qi(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new Ie,y=Object.assign(p=>{const g=Ve(p),_={key:n.key,subKey:g},O=`${n.key}(${g})`,C=re(s),U=Go(C,{key:O,get:n.get(p)},_);return f.next({type:"state_creation",token:U}),U},u,{internalRoles:i,subject:f,install:p=>Di(p,n),default:p=>n.get(p)({get:(..._)=>It(s,..._),find:(_,O)=>gt(s,_,O),seek:(_,O)=>_n(s,_,O),json:_=>Ja(s,_)})});return s.families.set(n.key,y),u}function Hv(s,n){return"set"in n?Xo(s,n):Di(s,n)}class Zo{constructor(n){B(this,"_buffer");B(this,"_index",0);let i;typeof n=="number"?i=n:i=n.length,this._buffer=Array.from({length:i})}get buffer(){return this._buffer}get index(){return this._index}add(n){this._buffer[this._index]=n,this._index=(this._index+1)%this._buffer.length}copy(){const n=new Zo([...this._buffer]);return n._index=this._index,n}}const Vv={atom_family:"atom",mutable_atom_family:"mutable_atom",selector_family:"selector",readonly_selector_family:"readonly_selector",molecule_family:"molecule"};function Lv(s,n){const i=Ve(n),u=`${s.key}(${i})`,c=Vv[s.type],f={key:u,type:c};return Object.assign(f,{family:{key:s.key,subKey:i}}),Object.assign(f,{counterfeit:!0}),f}function Bi(s){const n={key:s.key,type:s.type};return"family"in s&&(n.family=s.family),n}function Kv(s,n=Xe.STORE){const i={key:s,stringKey:Ve(s),dependsOn:"any"};return n.molecules.set(Ve(s),i),s}function os(s,n,i,u="any"){const c=n,f=Ve(i),h=[],y=re(s);if(Array.isArray(c))for(const _ of c){const O=Ve(_);y.molecules.get(O)?s.moleculeGraph.set(O,f,{source:O}):h.push(O)}else{const _=Ve(c);y.molecules.get(_)?s.moleculeGraph.set(_,f,{source:_}):h.push(_)}h.length===0&&y.molecules.set(f,{key:i,stringKey:f,dependsOn:u});const p={type:"molecule_creation",key:i,provenance:c};vt(y)&&y.transactionMeta.phase==="building"?y.transactionMeta.update.updates.push(p):y.on.moleculeCreation.next(p);for(const _ of h){const O=s.disposalTraces.buffer.find(C=>(C==null?void 0:C.key)===_);s.logger.error("❌","molecule",i,"allocation failed:",`Could not allocate to ${_} in store "${s.config.name}".`,O?`
10
+ ${_} was most recently disposed
11
+ ${O.trace}`:`No previous disposal trace for ${_} was found.`)}return i}function Yv(s,n,i,u){const c=`T$--${n}==${i}++${u}`;return os(s,[i,u],c,"all"),c}function fs(s,n){const i=Ve(n),u=s.molecules.get(i);if(!u){const U=s.disposalTraces.buffer.find(Y=>(Y==null?void 0:Y.key)===i);s.logger.error("❌","molecule",n,"deallocation failed:",`Could not find allocation for ${i} in store "${s.config.name}".`,U?`
12
+ This state was most recently deallocated
13
+ ${U.trace}`:`No previous disposal trace for ${i} was found.`);return}const c=s.moleculeJoins.getRelatedKeys(u.key);if(c)for(const U of c){const Y=s.joins.get(U);Y&&(Y.relations.delete(u.key),Y.molecules.delete(u.stringKey))}s.moleculeJoins.delete(u.stringKey);const f=[],h=[],y={type:"molecule_disposal",key:u.key,values:h,provenance:f},p=re(s);p.molecules.delete(i);const g=vt(p)&&p.transactionMeta.phase==="building";g&&p.transactionMeta.update.updates.push(y);const _=s.moleculeGraph.getRelationEntries({downstreamMoleculeKey:u.stringKey});if(_)for(const[U,{source:Y}]of _)if(Y===u.stringKey){const K=ma(U);fs(s,K)}else f.push(Y);const O=p.moleculeData.getRelatedKeys(u.stringKey);if(O)for(const U of O){const Y=p.families.get(U),K=gt(s,Y,u.key);h.push([Y.key,K]),$u(s,K)}p.moleculeGraph.delete(u.stringKey),p.moleculeJoins.delete(u.stringKey),p.moleculeData.delete(u.stringKey),g||p.on.moleculeDisposal.next(y),p.molecules.delete(u.stringKey);const C=Zb(new Error);s.disposalTraces.add({key:i,trace:C})}function Uu(s,n,i,u){const c=Ve(i),f=re(s),h=f.molecules.get(c);if(!h){const C=s.disposalTraces.buffer.find(U=>(U==null?void 0:U.key)===c);return s.logger.error("❌","molecule",i,"claim failed:",`Could not allocate to ${c} in store "${s.config.name}".`,C?`
14
+ ${c} was most recently disposed
15
+ ${C.trace}`:`No previous disposal trace for ${c} was found.`),i}const y=Ve(n),p=f.molecules.get(y);if(!p){const C=s.disposalTraces.buffer.find(U=>(U==null?void 0:U.key)===y);return s.logger.error("❌","molecule",i,"claim failed:",`Could not allocate to ${y} in store "${s.config.name}".`,C?`
16
+ ${y} was most recently disposed
17
+ ${C.trace}`:`No previous disposal trace for ${y} was found.`),i}const g=s.moleculeGraph.getRelationEntries({downstreamMoleculeKey:h.stringKey}).filter(([,{source:C}])=>C!==c).map(([C])=>ma(C));u&&f.moleculeGraph.delete(c),f.moleculeGraph.set({upstreamMoleculeKey:p.stringKey,downstreamMoleculeKey:h.stringKey},{source:p.stringKey});const _={type:"molecule_transfer",key:h.key,from:g,to:[p.key]};return vt(f)&&f.transactionMeta.phase==="building"&&f.transactionMeta.update.updates.push(_),i}class Gv{constructor(n=Xe.STORE){B(this,"store");this.store=n,Kv("root",n)}allocate(n,i,u){return os(this.store,n,i,u)}fuse(n,i,u){return Yv(this.store,n,i,u)}deallocate(n){fs(this.store,n)}claim(n,i,u){return Uu(this.store,n,i,u)}}class $v{constructor(n=Xe.STORE){B(this,"store");B(this,"realm");this.store=n,this.realm=new Gv(n)}allocate(n,i,u){os(this.store,n,i,u)}deallocate(n){fs(this.store,n)}claim(n,i,u){Uu(this.store,n,i,u)}}function Bt(s){return qb(Xe.STORE,s)}function So(...s){return s.length===2?It(Xe.STORE,...s):It(Xe.STORE,...s)}const ro=s=>(n,i,u,c,...f)=>{console[s](`${n} ${i} "${u}" ${c}`,...f)},Xv={error:ro("error"),info:ro("info"),warn:ro("warn")};class Qv{constructor(n,i,u=Xv){B(this,"error",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel!==null&&this.logger.error(...n)});B(this,"info",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel==="info"&&this.logger.info(...n)});B(this,"warn",(...n)=>{var i;(((i=this.filter)==null?void 0:i.call(this,...n))??!0)&&this.logLevel!=="error"&&this.logLevel!==null&&this.logger.warn(...n)});this.logLevel=n,this.filter=i,this.logger=u}}function Qa(s){return Am(Xe.STORE,s)}function Jv(s){return Hv(Xe.STORE,s)}function Ho(...s){s.length===2?Pe(Xe.STORE,...s):Pe(Xe.STORE,...s)}function Fv(s){return Sm(s,Xe.STORE)}function Wv(s,n=mm()){return Vo(s,n,Xe.STORE)}class Et{constructor(n,i){B(this,"a");B(this,"b");B(this,"cardinality");B(this,"relations",new Map);B(this,"contents",new Map);B(this,"isAType");B(this,"isBType");B(this,"isContent");B(this,"makeContentKey",(n,i)=>`${n}:${i}`);B(this,"warn");var u,c;if(this.a=n.between[0],this.b=n.between[1],this.cardinality=n.cardinality,i!=null&&i.externalStore||(this.relations=new Map((u=n.relations)==null?void 0:u.map(([f,h])=>[f,new Set(h)])),this.contents=new Map(n.contents)),this.isAType=(i==null?void 0:i.isAType)??null,this.isBType=(i==null?void 0:i.isBType)??null,this.isContent=(i==null?void 0:i.isContent)??null,i!=null&&i.makeContentKey&&(this.makeContentKey=i.makeContentKey),i!=null&&i.externalStore){const f=i.externalStore;this.has=(h,y)=>f.has(h,y),this.addRelation=(h,y)=>{f.addRelation(h,y)},this.deleteRelation=(h,y)=>{f.deleteRelation(h,y)},this.replaceRelationsSafely=(h,y)=>{f.replaceRelationsSafely(h,y)},this.replaceRelationsUnsafely=(h,y)=>{f.replaceRelationsUnsafely(h,y)},this.getRelatedKeys=h=>f.getRelatedKeys(h),f.getContent&&(this.getContentInternal=h=>f.getContent(h),this.setContent=(h,y)=>{f.setContent(h,y)},this.deleteContent=h=>{f.deleteContent(h)});for(const[h,y]of n.relations??[]){let p=(c=this.isAType)!=null&&c.call(this,h)?h:void 0,g=p===void 0?h:void 0;for(const _ of y)p??(p=_),g??(g=_),this.addRelation(p,g)}for(const[h,y]of n.contents??[])this.setContent(h,y)}i!=null&&i.warn&&(this.warn=i.warn)}getRelatedKeys(n){return this.relations.get(n)}addRelation(n,i){let u=this.relations.get(n),c=this.relations.get(i);u?u.add(i):(u=new Set([i]),this.relations.set(n,u)),c?c.add(n):(c=new Set([n]),this.relations.set(i,c))}deleteRelation(n,i){const u=this.relations.get(n);if(u){u.delete(i),u.size===0&&this.relations.delete(n);const c=this.relations.get(i);c&&(c.delete(n),c.size===0&&this.relations.delete(i))}}replaceRelationsUnsafely(n,i){this.relations.set(n,new Set(i));for(const u of i){const c=new Set().add(n);this.relations.set(u,c)}}replaceRelationsSafely(n,i){var h;const u=this.relations.get(n);let c=(h=this.isAType)!=null&&h.call(this,n)?n:void 0,f=c===void 0?n:void 0;if(u)for(const y of u){c??(c=y),f??(f=y);const p=this.relations.get(y);p&&(p.size===1?this.relations.delete(y):p.delete(n),this.contents.delete(this.makeContentKey(c,f)))}this.relations.set(n,new Set(i));for(const y of i){let p=this.relations.get(y);p?p.add(n):(p=new Set().add(n),this.relations.set(y,p))}}getContentInternal(n){return this.contents.get(n)}setContent(n,i){this.contents.set(n,i)}deleteContent(n){this.contents.delete(n)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([n,i])=>[n,[...i]]),contents:[...this.contents.entries()]}}set(...n){let i,u,c;switch(n.length){case 1:{const f=n[0];i=f[this.a],u=f[this.b],c=void 0;break}case 2:{const f=n[0];typeof f=="string"?[i,u]=n:(i=f[this.a],u=f[this.b],c=n[1]);break}default:{i=n[0],u=n[1],c=n[2];break}}switch(this.cardinality){case"1:1":{const f=this.getRelatedKey(i);f&&f!==u&&this.delete(i,f)}case"1:n":{const f=this.getRelatedKey(u);f&&f!==i&&this.delete(f,u)}}if(c){const f=this.makeContentKey(i,u);this.setContent(f,c)}return this.addRelation(i,u),this}delete(n,i){i=typeof i=="string"?i:n[this.b];const u=typeof n=="string"?n:n[this.a];if(u===void 0&&typeof i=="string"){const c=this.getRelatedKeys(i);if(c)for(const f of c)this.delete(f,i)}if(typeof u=="string"&&i===void 0){const c=this.getRelatedKeys(u);if(c)for(const f of c)this.delete(u,f)}if(typeof u=="string"&&typeof i=="string"){this.deleteRelation(u,i);const c=this.makeContentKey(u,i);this.deleteContent(c)}return this}getRelatedKey(n){var u;const i=this.getRelatedKeys(n);if(i){i.size>1&&((u=this.warn)==null||u.call(this,`${i.size} related keys were found for key "${n}": (${[...i].map(f=>`"${f}"`).join(", ")}). Only one related key was expected.`));let c;for(const f of i){c=f;break}return c}}replaceRelations(n,i,u){const c=!Array.isArray(i),f=c?Object.keys(i):i;if(u!=null&&u.reckless?this.replaceRelationsUnsafely(n,f):this.replaceRelationsSafely(n,f),c)for(const h of f){const y=this.makeContentKey(n,h),p=i[h];this.setContent(y,p)}return this}getContent(n,i){const u=this.makeContentKey(n,i);return this.getContentInternal(u)}getRelationEntries(n){const i=n[this.a],u=n[this.b];if(i!==void 0&&u===void 0){const c=this.getRelatedKeys(i);if(c)return[...c].map(f=>[f,this.getContent(i,f)])}if(i===void 0&&u!==void 0){const c=this.getRelatedKeys(u);if(c)return[...c].map(f=>[f,this.getContent(f,u)])}return[]}has(n,i){if(i){const u=this.getRelatedKeys(n);return(u==null?void 0:u.has(i))??!1}return this.relations.has(n)}}function rn(s){return"epoch"in s.transactionMeta}function vt(s){return"phase"in s.transactionMeta}const Iv=s=>{const n=re(s);if(!vt(n)){s.logger.warn("🐞","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}s.logger.info("🪂","transaction",n.transactionMeta.update.key,"Aborting transaction"),n.parent.child=null},Pv=s=>s[0].toUpperCase()+s.slice(1);function qi(s){return s.type.split("_").map(Pv).join(" ")}class Yu extends Error{constructor(...n){const i=n[0],u=n.length===2?n[1]:n[2];if(n.length===2)super(`${qi(i)} ${Ve(i.key)} not found in store "${u.config.name}".`);else{const c=n[1];super(`${qi(i)} "${i.key}" member ${Ve(c)} not found in store "${u.config.name}".`)}}}function Vo(s,n,i){return(...u)=>{const c=at(s,i);if(c)return c.run(u,n);throw new Yu(s,i)}}const gm=s=>n=>s instanceof Function?s(n):s,Gu=(s,n)=>{if(n.valueMap.has(s.key))return n.logger.info("📖",s.type,s.key,"reading cached value"),zb(s,n);if(s.type==="selector"||s.type==="readonly_selector")return n.logger.info("🧮",s.type,s.key,"computing value"),s.get();const i=s.default instanceof Function?s.default():s.default;return n.logger.info("💁","atom",s.key,"could not find cached value; using default",i),s.default instanceof Function?s.default():s.default},eb=(s,n)=>{if(s.operation.open){const i=performance.now();return s.logger.info("❗",n.type,n.key,`deferring setState at T-${i} until setState for "${s.operation.token.key}" is done`),i}s.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:n},s.logger.info("⭕",n.type,n.key,`operation start in store "${s.config.name}"${vt(s)?` ${s.transactionMeta.phase} "${s.transactionMeta.update.key}"`:""}`)},tb=s=>{s.operation.open&&s.logger.info("🔴",s.operation.token.type,s.operation.token.key,`operation done in store "${s.config.name}"`),s.operation={open:!1},s.on.operationClose.next(s.operation)},nb=(s,n)=>s.operation.open?s.operation.done.has(n):(s.logger.error("🐞","unknown",n,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Lo=(s,n)=>{if(!s.operation.open){s.logger.error("🐞","unknown",n,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}s.operation.done.add(n)},ab=(s,n,i)=>{switch(s.type){case"mutable_atom":i.logger.info("📢",s.type,s.key,"is now (",n.newValue,") subscribers:",s.subject.subscribers);break;default:i.logger.info("📢",s.type,s.key,"went (",n.oldValue,"->",n.newValue,") subscribers:",s.subject.subscribers)}s.subject.next(n)},Qy=(s,n)=>{const i=re(n),u=i.selectorAtoms.getRelatedKeys(s.key);if(i.logger.info("🧹",s.type,s.key,u?`evicting ${u.size} states downstream:`:"no downstream states",u??"to evict"),u){i.operation.open&&i.logger.info("🧹",s.type,s.key,`[ ${[...i.operation.done].join(", ")} ] already done`);for(const c of u)nb(i,c)||(Ub(c,i),Lo(i,c))}};function ib(s,n){return!(Db(n.newValue)||s.includes("🔍"))}const lb=(s,n,i)=>{const{key:u}=s,c=re(i);if(!vt(c)||c.transactionMeta.phase!=="building"){i.logger.error("🐞","atom",u,"stowUpdate called outside of a transaction. This is probably a bug.");return}if(!ib(u,n))return;const h={type:"atom_update",key:u,...n};s.family&&(h.family=s.family),c.transactionMeta.update.updates.push(h),i.logger.info("📁","atom",u,"stowed (",n.oldValue,"->",n.newValue,")")},sb=(s,n,i)=>{const u=Gu(s,i);let c=u;if(s.type==="mutable_atom"&&vt(i)){const{parent:h}=i;c=Eo(s,h,i)}c=gm(n)(c),i.logger.info("📝","atom",s.key,"set to",c),c=Ya(s.key,c,s.subject,i),jb(s.key,i)&&Bb(s.key,i),Lo(i,s.key),Qy(s,i);const f={oldValue:u,newValue:c};if(rn(i))ab(s,f,i);else if(i.parent){if(i.on.transactionApplying.state===null)lb(s,f,i);else if(s.key.startsWith("*")){const h=s.key.slice(1),y=i.atoms.get(h);let p=i.valueMap.get(h);if(y.type==="mutable_atom"&&vt(i)){const{parent:_}=i;p=Eo(y,_,i)}p.do(f.newValue)===null&&Qy(y,i)}}},vm=(s,n,i)=>{switch(s.type){case"atom":case"mutable_atom":sb(s,n,i);break;case"selector":s.set(n);break}};function ub(s,n){if(n.family){const i=s.families.get(n.family.key);if(i)return i}}function Pe(s,...n){let i,u,c,f;if(n.length===2?(i=n[0],f=n[1],u=ub(s,i)??null,u&&(c=i.family?ma(i.family.subKey):null,i=gt(s,u,c))):(u=n[0],c=n[1],f=n[2],i=gt(s,u,c)),"counterfeit"in i&&"family"in i){const p=i.family.subKey,g=s.disposalTraces.buffer.find(_=>(_==null?void 0:_.key)===p);s.logger.error("❌",i.type,i.key,`could not be set because it was not found in the store "${s.config.name}".`,g?`This state was previously disposed:
18
+ ${g.trace}`:"No previous disposal trace was found.");return}const h=eb(s,i);if(h){const p=s.on.operationClose.subscribe(`waiting to set "${i.key}" at T-${h}`,()=>{p(),s.logger.info("🟢",i.type,i.key,`resuming deferred setState from T-${h}`),Pe(s,i,f)});return}const y=at(i,s);vm(y,f,s),tb(s)}function rb(s,n,i){const{key:u,newValue:c,oldValue:f}=n,h=s==="newValue"?c:f,y={key:u,type:"atom"};n.family&&Object.assign(y,{family:n.family}),Pe(i,y,h)}function cb(s,n,i){switch(n){case"newValue":{bm(s,i);break}case"oldValue":{$u(i,s.token);break}}}function ob(s,n,i){switch(n){case"newValue":{$u(i,s.token);break}case"oldValue":{bm(s,i),s.subType==="atom"&&i.valueMap.set(s.token.key,s.value);break}}}function bm(s,n){const{family:i}=s.token;if(i){const u=n.families.get(i.key);u&&gt(n,u,ma(i.subKey))}}function fb(s,n,i){switch(n){case"newValue":os(i,s.provenance,s.key);break;case"oldValue":fs(i,s.key);break}}function db(s,n,i){switch(n){case"newValue":fs(i,s.key);break;case"oldValue":{const u=s.provenance.map(ma);os(i,u,s.key);for(const[c,f]of s.values){const h=i.families.get(c);if(h){gt(i,h,s.key);const y=`${c}(${Ve(s.key)})`;i.valueMap.set(y,f)}}}break}}function hb(s,n,i){switch(n){case"newValue":{const u=s.to.length===1?s.to[0]:s.to;Uu(i,u,s.key,"exclusive")}break;case"oldValue":{const u=s.from.length===1?s.from[0]:s.from;Uu(i,u,s.key,"exclusive")}break}}function zi(s,n,i){const u=s==="newValue"?n.updates:[...n.updates].reverse();for(const c of u)switch(c.type){case"atom_update":case"selector_update":rb(s,c,i);break;case"state_creation":cb(c,s,i);break;case"state_disposal":ob(c,s,i);break;case"molecule_creation":fb(c,s,i);break;case"molecule_disposal":db(c,s,i);break;case"molecule_transfer":hb(c,s,i);break;case"transaction_update":zi(s,c,i);break}}function Ko(s,n,i){rn(i)&&s&&i.transactionMeta.epoch.set(s,n)}function yb(s,n,i){if(!rn(i))return;const c=i.transactionMeta.actionContinuities.getRelatedKey(s);c!==void 0&&i.transactionMeta.epoch.set(c,n)}const mb=(s,n)=>{var f;const i=re(n),{parent:u}=i;if(u===null||!vt(i)||((f=i.transactionMeta)==null?void 0:f.phase)!=="building"){n.logger.warn("🐞","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}i.transactionMeta.phase="applying",i.transactionMeta.update.output=s,u.child=null,u.on.transactionApplying.next(i.transactionMeta);const{updates:c}=i.transactionMeta.update;if(n.logger.info("🛄","transaction",i.transactionMeta.update.key,`Applying transaction with ${c.length} updates:`,c),zi("newValue",i.transactionMeta.update,u),rn(u)){yb(i.transactionMeta.update.key,i.transactionMeta.update.epoch,u);const h=at({key:i.transactionMeta.update.key,type:"transaction"},n);h==null||h.subject.next(i.transactionMeta.update),n.logger.info("🛬","transaction",i.transactionMeta.update.key,"Finished applying transaction.")}else vt(u)&&u.transactionMeta.update.updates.push(i.transactionMeta.update);u.on.transactionApplying.next(null)};function _m(s,n,i){if(!rn(i))return;const{epoch:c,actionContinuities:f}=i.transactionMeta;f.set(s,n),c.has(s)||c.set(s,-1)}function pb(s){return{store:s}}function It(s,...n){let i,u,c;if(n.length===1?i=n[0]:(u=n[0],c=n[1],i=gt(s,u,c)),"counterfeit"in i&&"family"in i){u=s.families.get(i.family.key);const f=i.family.subKey,h=s.disposalTraces.buffer.find(y=>(y==null?void 0:y.key)===f);switch(s.logger.error("❌",i.type,i.key,`could not be retrieved because it was not found in the store "${s.config.name}".`,h?`This state was previously disposed:
19
+ ${h.trace}`:"No previous disposal trace was found."),u.type){case"atom_family":case"mutable_atom_family":return s.defaults.get(u.key);case"selector_family":case"readonly_selector_family":{if(s.defaults.has(u.key))return s.defaults.get(i.family.key);const y=at(u,s).default(f);return s.defaults.set(u.key,y),y}}}return Gu(at(i,s),s)}class pn extends Map{constructor(i){super();B(this,"deleted",new Set);this.source=i}get(i){if(super.has(i))return super.get(i);if(!this.deleted.has(i)&&this.source.has(i))return this.source.get(i)}set(i,u){return this.deleted.delete(i),super.set(i,u)}hasOwn(i){return super.has(i)}has(i){return!this.deleted.has(i)&&(super.has(i)||this.source.has(i))}delete(i){return this.deleted.add(i),super.delete(i)}}const gb=(s,n,i,u)=>{const c=re(i),f={parent:c,child:null,on:c.on,loggers:c.loggers,logger:c.logger,config:c.config,atoms:new pn(c.atoms),atomsThatAreDefault:new Set(c.atomsThatAreDefault),families:new pn(c.families),joins:new pn(c.joins),operation:{open:!1},readonlySelectors:new pn(c.readonlySelectors),timelines:new pn(c.timelines),timelineTopics:new Et(c.timelineTopics.toJSON()),trackers:new Map,transactions:new pn(c.transactions),selectorAtoms:new Et(c.selectorAtoms.toJSON()),selectorGraph:new Et(c.selectorGraph.toJSON(),{makeContentKey:(...g)=>g.sort().join(":")}),selectors:new pn(c.selectors),valueMap:new pn(c.valueMap),defaults:c.defaults,disposalTraces:i.disposalTraces.copy(),molecules:new pn(c.molecules),moleculeGraph:new Et(c.moleculeGraph.toJSON(),{makeContentKey:c.moleculeGraph.makeContentKey}),moleculeData:new Et(c.moleculeData.toJSON(),{makeContentKey:c.moleculeData.makeContentKey}),moleculeJoins:new Et(c.moleculeJoins.toJSON(),{makeContentKey:c.moleculeJoins.makeContentKey}),miscResources:new pn(c.miscResources)},h=bb(s,i),y={phase:"building",update:{type:"transaction_update",key:s,id:u,epoch:h===void 0?Number.NaN:h+1,updates:[],params:n,output:void 0},toolkit:{get:(...g)=>It(p,...g),set:(...g)=>{Pe(p,...g)},run:(g,_=mm())=>Vo(g,_,p),find:(g,_)=>gt(p,g,_),seek:(g,_)=>_n(p,g,_),json:g=>Ja(p,g),dispose:(...g)=>{$u(p,...g)},env:()=>pb(p)}},p=Object.assign(f,{transactionMeta:y});return c.child=p,i.logger.info("🛫","transaction",s,"Building transaction with params:",n),p};function Sm(s,n){const i={key:s.key,type:"transaction",run:(f,h)=>{const y=gb(s.key,f,n,h);try{const p=re(n),{toolkit:g}=y.transactionMeta,_=s.do(g,...f);return mb(_,p),_}catch(p){throw Iv(u),n.logger.warn("💥","transaction",s.key,"caught:",p),p}},install:f=>Sm(s,f),subject:new Ie},u=re(n);u.transactions.set(i.key,i);const c=Bi(i);return n.on.transactionCreation.next(c),c}function vb(s,n){return rn(n)&&s?n.transactionMeta.epoch.get(s):void 0}function bb(s,n){const i=rn(n),u=i?n.transactionMeta.actionContinuities.getRelatedKey(s):void 0;return i&&u!==void 0?n.transactionMeta.epoch.get(u):void 0}class _b{constructor(n,i=null){B(this,"parent",null);B(this,"child",null);B(this,"valueMap",new Map);B(this,"defaults",new Map);B(this,"atoms",new Map);B(this,"selectors",new Map);B(this,"readonlySelectors",new Map);B(this,"atomsThatAreDefault",new Set);B(this,"selectorAtoms",new Et({between:["selectorKey","atomKey"],cardinality:"n:n"}));B(this,"selectorGraph",new Et({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));B(this,"trackers",new Map);B(this,"families",new Map);B(this,"joins",new Map);B(this,"transactions",new Map);B(this,"transactionMeta",{epoch:new Map,actionContinuities:new Et({between:["continuity","action"],cardinality:"1:n"})});B(this,"timelines",new Map);B(this,"timelineTopics",new Et({between:["timelineKey","topicKey"],cardinality:"1:n"}));B(this,"disposalTraces",new Zo(100));B(this,"molecules",new Map);B(this,"moleculeJoins",new Et({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));B(this,"moleculeGraph",new Et({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));B(this,"moleculeData",new Et({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...n)=>n.sort().join(":")}));B(this,"miscResources",new Map);B(this,"on",{atomCreation:new Ie,atomDisposal:new Ie,selectorCreation:new Ie,selectorDisposal:new Ie,timelineCreation:new Ie,transactionCreation:new Ie,transactionApplying:new Zv(null),operationClose:new Ie,moleculeCreation:new Ie,moleculeDisposal:new Ie});B(this,"operation",{open:!1});B(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});B(this,"loggers",[new Qv("warn",(n,i,u)=>!u.includes("🔍"))]);B(this,"logger",{error:(...n)=>{for(const i of this.loggers)i.error(...n)},info:(...n)=>{for(const i of this.loggers)i.info(...n)},warn:(...n)=>{for(const i of this.loggers)i.warn(...n)}});var u,c;if(this.config={...i==null?void 0:i.config,...n},i!==null){this.valueMap=new Map(i==null?void 0:i.valueMap),this.operation={...i==null?void 0:i.operation},rn(i)&&(this.transactionMeta={epoch:new Map(i==null?void 0:i.transactionMeta.epoch),actionContinuities:new Et(i==null?void 0:i.transactionMeta.actionContinuities.toJSON())});for(const[,h]of i.families)(u=h.internalRoles)!=null&&u.includes("mutable")||(c=h.internalRoles)!=null&&c.includes("join")||h.install(this);const f=new Set;for(const[,h]of i.atoms)if(!f.has(h.key)&&(h.install(this),h.type==="mutable_atom")){const y=Ja(i,h),p=wm(h);f.add(y.key),f.add(p.key)}for(const[,h]of i.readonlySelectors)h.install(this);for(const[,h]of i.selectors)f.has(h.key)||h.install(this);for(const[,h]of i.transactions)h.install(this);for(const[,h]of i.timelines)h.install(this)}}}const Xe={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE||(globalThis.ATOM_IO_IMPLICIT_STORE=new _b({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function at(s,n){let i,u=n;for(;u!==null;){switch(s.type){case"atom":case"mutable_atom":i=u.atoms.get(s.key);break;case"selector":i=u.selectors.get(s.key);break;case"readonly_selector":i=u.readonlySelectors.get(s.key);break;case"atom_family":case"mutable_atom_family":case"selector_family":case"readonly_selector_family":i=u.families.get(s.key);break;case"timeline":i=u.timelines.get(s.key);break;case"transaction":i=u.transactions.get(s.key);break}if(i)return i;u=u.child}throw new Yu(s,n)}function Sb(s,n,i){const u=s.families.get(n.key);if(u===void 0)throw new Yu(n,s);const c=u(i),f=re(s);if(c.family)if(rn(f))switch(c.type){case"atom":case"mutable_atom":s.on.atomCreation.next(c);break;case"selector":case"readonly_selector":s.on.selectorCreation.next(c);break}else vt(f)&&f.on.transactionApplying.state===null&&f.transactionMeta.update.updates.push({type:"state_creation",token:c});return c}function _n(s,n,i){const u=Ve(i),c=`${n.key}(${u})`,f=re(s);let h;switch(n.type){case"atom_family":case"mutable_atom_family":h=f.atoms.get(c);break;case"selector_family":h=f.selectors.get(c);break;case"readonly_selector_family":h=f.readonlySelectors.get(c);break}return h&&Bi(h)}function gt(s,n,i){let u=_n(s,n,i);if(u)return u;const c=Ve(i),f=s.molecules.get(c);if(!f&&s.config.lifespan==="immortal"){const h=Lv(n,i);return s.logger.error("❌",h.type,h.key,`was not found in store "${s.config.name}"; returned a counterfeit token.`),h}return u=Sb(s,n,i),f&&re(s).moleculeData.set(c,n.key),u}function $u(s,...n){let i;if(n.length===1)i=n[0];else{const u=n[0],c=n[1];i=gt(s,u,c)}try{at(i,s)}catch{s.logger.error("❌",i.type,i.key,`could not be disposed because it was not found in the store "${s.config.name}".`);return}switch(i.type){case"atom":case"mutable_atom":Jo(i,s);break;case"selector":case"readonly_selector":Rb(i,s);break}}const Yo=(s,n)=>re(n).atoms.has(s),Tb=(s,n)=>re(n).selectors.has(s),Eb=(s,n)=>re(n).readonlySelectors.has(s),Ab=(s,n)=>Yo(s,n)||Tb(s,n)||Eb(s,n),To=(s,n)=>re(n).selectorGraph.getRelationEntries({downstreamSelectorKey:s}).filter(([u,{source:c}])=>c!==s).map(([u,{source:c}])=>c).filter(u=>Ab(u,n)),Tm=(s,n,i)=>{const u=[],c=To(s,i);for(;c.length>0;){const f=c.shift();n.has(f)||(n.add(f),Yo(f,i)?u.includes(f)||u.push(f):c.push(...To(f,i)))}return u},Ob=(s,n)=>{const i=s.key,u=To(i,n),c=new Set;return u.flatMap(f=>Yo(f,n)?f:Tm(f,c,n))},wb=(s,n,i,u)=>{const c=re(u);if(n.type==="atom"||n.type==="mutable_atom")c.selectorAtoms.set({selectorKey:s,atomKey:n.key}),u.logger.info("🔍","selector",s,`discovers root atom "${n.key}"`);else{const f=Tm(n.key,i,u);u.logger.info("🔍","selector",s,`discovers root atoms: [ ${f.map(h=>`"${h}"`).join(", ")} ]`);for(const h of f)c.selectorAtoms=c.selectorAtoms.set({selectorKey:s,atomKey:h})}i.add(n.key)},Em=(s,n,i)=>({get:(...u)=>{const c=re(i);let f;if(u.length===2){const[p,g]=u;f=gt(i,p,g)}else[f]=u;const h=at(f,i),y=Gu(h,i);return i.logger.info("🔌","selector",s,`registers dependency ( "${f.key}" =`,y,")"),c.selectorGraph.set({upstreamSelectorKey:f.key,downstreamSelectorKey:s},{source:f.key}),wb(s,f,n,i),y},set:(...u)=>{let c,f;if(u.length===2)c=u[0],f=u[1];else{const p=u[0],g=u[1];f=u[2];const _=i.config.lifespan==="ephemeral"?gt(i,p,g):_n(i,p,g);if(!_)throw new Yu(p,g,i);c=_}const h=re(i),y=at(c,h);vm(y,f,h)},find:(u,c)=>gt(i,u,c),seek:(u,c)=>_n(i,u,c),json:u=>Ja(i,u)}),Go=(s,n,i)=>{const u=re(s),c=new Ie,f=new Set,{get:h,find:y,seek:p,json:g}=Em(n.key,f,u),_=()=>{const Y=n.get({get:h,find:y,seek:p,json:g});return Ya(n.key,Y,c,re(s)),f.clear(),Y},O={...n,subject:c,install:Y=>Go(Y,n,i),get:_,type:"readonly_selector",...i&&{family:i}};u.readonlySelectors.set(n.key,O);const C=_();s.logger.info("✨",O.type,O.key,"=",C);const U={key:n.key,type:"readonly_selector"};return i&&(U.family=i),U},$o=(s,n,i)=>{const u=re(s),c=new Ie,f=new Set,h=Em(n.key,f,u),{find:y,get:p,seek:g,json:_}=h,O={find:y,get:p,seek:g,json:_},C=(ye=n.get,fe=re(s))=>{const Be=ye(O);return Ya(n.key,Be,c,fe),f.clear(),Be},Y={...n,subject:c,install:ye=>$o(ye,n,i),get:C,set:ye=>{const fe=re(s),Be=C(n.get,fe),ht=gm(ye)(Be);s.logger.info("📝","selector",n.key,"set (",Be,"->",ht,")"),Ya(n.key,ht,c,fe),Lo(fe,n.key),rn(fe)&&c.next({newValue:ht,oldValue:Be}),n.set(h,ht)},type:"selector",...i&&{family:i}};u.selectors.set(n.key,Y);const K=C();s.logger.info("✨",Y.type,Y.key,"=",K);const ge={key:n.key,type:"selector"};return i&&(ge.family=i),ge};function Am(s,n){if("set"in n){const c=$o(s,n,void 0);return s.on.selectorCreation.next(c),c}const u=Go(s,n,void 0);return s.on.selectorCreation.next(u),u}function Rb(s,n){const i=re(n),{key:u}=s,c=at(s,i);if(!c.family)n.logger.error("❌","selector",u,"Standalone selectors cannot be disposed.");else{switch(i.molecules.get(c.family.subKey)&&i.moleculeData.delete(c.family.subKey,c.family.key),s.type){case"selector":i.selectors.delete(u),at({key:c.family.key,type:"selector_family"},n);break;case"readonly_selector":i.readonlySelectors.delete(u),at({key:c.family.key,type:"readonly_selector_family"},n).subject.next({type:"state_disposal",subType:"selector",token:s});break}i.valueMap.delete(u),i.selectorAtoms.delete(u),i.selectorGraph.delete(u),n.logger.info("🔥",s.type,u,"deleted"),vt(i)&&i.transactionMeta.phase==="building"?i.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:s}):n.on.selectorDisposal.next(s)}}function Xo(s,n,i){const u={key:n.key,type:"selector_family"},c=s.families.get(n.key);c&&s.logger.error("❗","selector_family",n.key,`Overwriting an existing ${qi(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new Ie,y=Object.assign(p=>{const g=Ve(p),_={key:n.key,subKey:g},O=`${n.key}(${g})`,C=re(s),U=$o(C,{key:O,get:n.get(p),set:n.set(p)},_);return f.next({type:"state_creation",token:U}),U},u,{internalRoles:i,subject:f,install:p=>Xo(p,n),default:p=>n.get(p)({get:(..._)=>It(s,..._),find:(_,O)=>gt(s,_,O),seek:(_,O)=>_n(s,_,O),json:_=>Ja(s,_)})});return s.families.set(n.key,y),u}function xb(s,n,i=Xe.STORE){const u=Xo(i,{key:`${s.key}:JSON`,get:f=>({get:h})=>{const y=h(s,f);return n.toJson(y)},set:f=>({set:h},y)=>{h(s,f,n.fromJson(y))}},["mutable","json"]);return at(s,i).subject.subscribe(`store=${i.config.name}::json-selector-family`,f=>{f.token.family&&_n(i,u,ma(f.token.family.subKey))}),u}const ma=s=>JSON.parse(s),Ve=s=>JSON.stringify(s),kb=(s,n)=>{const i=re(n);return i.operation.open?i.operation.prev.get(s.key):i.valueMap.get(s.key)},Jy=(s,n)=>{const i=re(n);return Ob(s,n).map(c=>{const f=i.atoms.get(c);if(f===void 0)throw new Error(`Atom "${c}", a dependency of selector "${s.key}", not found in store "${n.config.name}".`);return f.subject.subscribe(`${s.type}:${s.key}`,h=>{n.logger.info("📢",s.type,s.key,"root",c,"went",h.oldValue,"->",h.newValue);const y=kb(s,i),p=Gu(s,i);n.logger.info("✨",s.type,s.key,"went",y,"->",p),s.subject.next({newValue:p,oldValue:y})})})};function Jl(s,n,i,u){function c(O){if(u.operation.open){const C=u.on.operationClose.subscribe(`state subscription ${i}`,()=>{C(),n(O)})}else n(O)}const f=at(s,u);u.logger.info("👀",f.type,f.key,`Adding subscription "${i}"`);const h=f.type==="selector"||f.type==="readonly_selector";let y=null,p=c;h&&(y=Jy(f,u),p=O=>{y&&(y.length=0,y.push(...Jy(f,u))),c(O)});const g=f.subject.subscribe(i,p);return()=>{if(u.logger.info("🙈",f.type,f.key,`Removing subscription "${i}"`),g(),y)for(const O of y)O()}}const Mb=(s,n,i,u)=>{const c=at(s,u);u.logger.info("👀","timeline",s.key,`Adding subscription "${i}"`);const f=c.subject.subscribe(i,n);return()=>{u.logger.info("🙈","timeline",s.key,`Removing subscription "${i}" from timeline`),f()}},Nb=(s,n,i,u)=>{const c=at(s,u);u.logger.info("👀","transaction",s.key,`Adding subscription "${i}"`);const f=c.subject.subscribe(i,n);return()=>{u.logger.info("🙈","transaction",s.key,`Removing subscription "${i}"`),f()}};class ju{constructor(n,i){B(this,"Update");B(this,"unsubscribeFromInnerValue");B(this,"unsubscribeFromState");B(this,"mutableState");B(this,"latestUpdateState");B(this,"dispose");this.mutableState=n;const u=re(i);this.latestUpdateState=this.initializeState(n,u),this.observeCore(n,this.latestUpdateState,u),this.updateCore(n,this.latestUpdateState,u),u.trackers.set(n.key,this),this.dispose=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),u.trackers.delete(n.key)}}initializeState(n,i){var h;const u=`*${n.key}`;i.atoms.delete(u),i.valueMap.delete(u);const c=n.family?{key:`*${n.family.key}`,subKey:n.family.subKey}:void 0,f=Xu(i,{key:u,default:null},c);if((h=i.parent)!=null&&h.valueMap.has(u)){const y=i.parent.valueMap.get(u);i.valueMap.set(u,y)}return f}observeCore(n,i,u){const c=`tracker:${u.config.name}:${vt(u)?u.transactionMeta.update.key:"main"}:${n.key}`,f=It(u,n);this.unsubscribeFromInnerValue=f.subscribe(c,h=>{Pe(u,i,h)}),this.unsubscribeFromState=Jl(n,h=>{h.newValue!==h.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=h.newValue.subscribe(c,y=>{Pe(u,i,y)}))},c,u)}updateCore(n,i,u){const c=`tracker:${u.config.name}:${vt(u)?u.transactionMeta.update.key:"main"}:${n.key}`;Jl(i,({newValue:f,oldValue:h})=>{const y=u.timelineTopics.getRelatedKey(i.key);if(y){const g=u.timelines.get(y);if(g!=null&&g.timeTraveling){const _=Mb({key:y,type:"timeline"},O=>{_(),Pe(u,n,C=>(O==="redo"&&f?C.do(f):O==="undo"&&h&&C.undo(h),C))},c,u);return}}const p=u.on.operationClose.subscribe(c,()=>{p();const g=It(u,n),_=f===null?-1:g.getUpdateNumber(f),O=_-g.cacheUpdateNumber;f&&O===1?Pe(u,n,C=>(C.do(f),C)):u.logger.info("❌","mutable_atom",n.key,`could not be updated. Expected update number ${g.cacheUpdateNumber+1}, but got ${_}`)})},c,u)}}function Qo(s,n,i){s.logger.info("🔨","atom",n.key,`creating in store "${s.config.name}"`);const u=re(s),c=u.atoms.get(n.key);if(c&&c.type==="mutable_atom")return s.logger.error("❌","atom",n.key,"Tried to create atom, but it already exists in the store."),Bi(c);const f=new Ie,h={...n,type:"mutable_atom",install:g=>(g.logger.info("🛠️","atom",n.key,`installing in store "${g.config.name}"`),Qo(g,n,i)),subject:f};i&&(h.family=i);const y=n.default();u.atoms.set(h.key,h),Rm(n.key,s),Ya(n.key,y,f,u);const p=Bi(h);if(n.effects){let g=0;const _=[];for(const O of n.effects){const C=O({setSelf:U=>{Pe(s,p,U)},onSet:U=>Jl(p,U,`effect[${g}]`,s)});C&&_.push(C),++g}h.cleanup=()=>{for(const O of _)O()}}return new ju(p,s),i||qv(p,n,s),p}class Cb{constructor(n,i){B(this,"Update");B(this,"latestUpdateAtoms");B(this,"mutableAtoms");const u=qo(i,{key:`*${n.key}`,default:null},["mutable","updates"]);this.latestUpdateAtoms=at(u,i),this.mutableAtoms=n,this.mutableAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,c=>{if(c.token.family){const f=ma(c.token.family.subKey);_n(i,this.latestUpdateAtoms,f),new ju(c.token,i)}}),this.latestUpdateAtoms.subject.subscribe(`store=${i.config.name}::tracker-atom-family`,c=>{if(c.token.family){const f=ma(c.token.family.subKey),h=_n(i,this.mutableAtoms,f);h&&new ju(h,i)}})}}function Om(s,n,i){const u={key:n.key,type:"mutable_atom_family"},c=s.families.get(n.key);c&&s.logger.error("❗","mutable_atom_family",n.key,`Overwriting an existing ${qi(c)} "${c.key}" in store "${s.config.name}". You can safely ignore this warning if it is due to hot module replacement.`);const f=new Ie,y=Object.assign(p=>{const g=Ve(p),_={key:n.key,subKey:g},O=`${n.key}(${g})`,C=re(s),U={key:O,default:()=>n.default(p),toJson:n.toJson,fromJson:n.fromJson,mutable:!0};n.effects&&(U.effects=n.effects(p));const Y=Qo(C,U,_);return f.next({type:"state_creation",token:Y}),Y},u,{subject:f,install:p=>Om(p,n),toJson:n.toJson,fromJson:n.fromJson,internalRoles:i});return s.families.set(n.key,y),xb(y,n,s),new Cb(y,s),u}const Fy=(s,n)=>{const i=re(n),u=`${s.key}:JSON`;return i.families.get(u)},Ja=(s,n)=>{if(n.family){const u=re(s),f={key:`${n.family.key}:JSON`,type:"selector_family"},h=at(f,u),y=JSON.parse(n.family.subKey);return gt(s,h,y)}return{type:"selector",key:`${n.key}:JSON`}},wm=s=>{const i={type:"atom",key:`*${s.key}`};return s.family&&(i.family={key:`*${s.family.key}`,subKey:s.family.subKey}),i};function Db(s){return typeof s=="object"&&s!==null&&"do"in s&&"undo"in s&&"subscribe"in s}function Eo(s,n,i){const u=n.valueMap.get(s.key),c=i.valueMap.get(s.key);if(u===c){if(u===void 0)return typeof s.default=="function"?s.default():s.default;n.logger.info("📃","atom",s.key,"copying");const f=s.toJson(u),h=s.fromJson(f);return i.valueMap.set(s.key,h),new ju(s,n),h}return c}function Ya(s,n,i,u){const c=u.valueMap.get(s);if(c instanceof _o&&c.use(n),n instanceof Promise){const f=new _o(n);return u.valueMap.set(s,f),f.then(h=>{Ya(s,h,i,u),i.next({newValue:h,oldValue:f})}).catch(h=>{u.logger.error("💥","state",s,"rejected:",h)}),f}return u.valueMap.set(s,n),n}const zb=(s,n)=>{let i=n.valueMap.get(s.key);if(s.type==="mutable_atom"&&vt(n)){const{parent:u}=n;i=Eo(s,u,n)}return i},Ub=(s,n)=>{const i=n.valueMap.get(s);if(i instanceof _o){const u=i,c=n.selectors.get(s)??n.readonlySelectors.get(s);c&&u.use(c.get());return}n.operation.open&&n.operation.prev.set(s,i),n.valueMap.delete(s),n.logger.info("🗑","state",s,"evicted")},jb=(s,n)=>re(n).atomsThatAreDefault.has(s),Rm=(s,n)=>{const i=re(n);i.atomsThatAreDefault=new Set(i.atomsThatAreDefault).add(s)},Bb=(s,n)=>{const i=re(n);i.atomsThatAreDefault=new Set(re(n).atomsThatAreDefault),i.atomsThatAreDefault.delete(s)};function Xu(s,n,i){s.logger.info("🔨","atom",n.key,`creating in store "${s.config.name}"`);const u=re(s),c=u.atoms.get(n.key);if(c&&c.type==="atom")return s.logger.error("❌","atom",n.key,"Tried to create atom, but it already exists in the store."),Bi(c);const f=new Ie,h={...n,type:"atom",install:g=>(g.logger.info("🛠️","atom",n.key,`installing in store "${g.config.name}"`),Xu(g,n,i)),subject:f};i&&(h.family=i);let y=n.default;n.default instanceof Function&&(y=n.default()),u.atoms.set(h.key,h),Rm(n.key,s),Ya(n.key,y,f,u);const p=Bi(h);if(n.effects){let g=0;const _=[];for(const O of n.effects){const C=O({setSelf:U=>{Pe(s,p,U)},onSet:U=>Jl(p,U,`effect[${g}]`,s)});C&&_.push(C),++g}h.cleanup=()=>{for(const O of _)O()}}return p}function qb(s,n){if("mutable"in n){const c=Qo(s,n,void 0);return s.on.atomCreation.next(c),c}const u=Xu(s,n,void 0);return s.on.atomCreation.next(u),u}function Jo(s,n){var h;const i=re(n),{key:u,family:c}=s,f=at(s,i);if(!c)n.logger.error("❌","atom",u,"Standalone atoms cannot be disposed.");else{(h=f.cleanup)==null||h.call(f);const y=n.valueMap.get(f.key),p=at({key:c.key,type:"atom_family"},n),g={type:"state_disposal",subType:"atom",token:s,value:y};p.subject.next(g);const _=vt(i);if(i.atoms.delete(u),i.valueMap.delete(u),i.selectorAtoms.delete(u),i.atomsThatAreDefault.delete(u),n.timelineTopics.delete(u),s.type==="mutable_atom"){const O=wm(s);Jo(O,n),n.trackers.delete(u)}if(n.logger.info("🔥","atom",u,"deleted"),_&&i.transactionMeta.phase==="building"){const O=i.transactionMeta.update.updates.at(-1);(O==null?void 0:O.type)==="molecule_disposal"&&O.values.some(([Y])=>{var K;return Y===((K=f.family)==null?void 0:K.key)})||i.transactionMeta.update.updates.push(g)}else n.on.atomDisposal.next(s)}}function Zb(s){var i,u;const{stack:n}=s;return n?`
20
+ `+((u=(i=n.split(`
21
+ `))==null?void 0:i.slice(1))==null?void 0:u.join(`
22
+ `)):""}var co={exports:{}},ce={};/**
23
+ * @license React
24
+ * react.production.js
25
+ *
26
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
27
+ *
28
+ * This source code is licensed under the MIT license found in the
29
+ * LICENSE file in the root directory of this source tree.
30
+ */var Wy;function Hb(){if(Wy)return ce;Wy=1;var s=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),c=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),h=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),O=Symbol.iterator;function C(b){return b===null||typeof b!="object"?null:(b=O&&b[O]||b["@@iterator"],typeof b=="function"?b:null)}var U={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Y=Object.assign,K={};function ge(b,D,te){this.props=b,this.context=D,this.refs=K,this.updater=te||U}ge.prototype.isReactComponent={},ge.prototype.setState=function(b,D){if(typeof b!="object"&&typeof b!="function"&&b!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,b,D,"setState")},ge.prototype.forceUpdate=function(b){this.updater.enqueueForceUpdate(this,b,"forceUpdate")};function ye(){}ye.prototype=ge.prototype;function fe(b,D,te){this.props=b,this.context=D,this.refs=K,this.updater=te||U}var Be=fe.prototype=new ye;Be.constructor=fe,Y(Be,ge.prototype),Be.isPureReactComponent=!0;var ht=Array.isArray,N={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function se(b,D,te,P,G,_e){return te=_e.ref,{$$typeof:s,type:b,key:D,ref:te!==void 0?te:null,props:_e}}function W(b,D){return se(b.type,D,void 0,void 0,void 0,b.props)}function j(b){return typeof b=="object"&&b!==null&&b.$$typeof===s}function X(b){var D={"=":"=0",":":"=2"};return"$"+b.replace(/[=:]/g,function(te){return D[te]})}var we=/\/+/g;function Ge(b,D){return typeof b=="object"&&b!==null&&b.key!=null?X(""+b.key):D.toString(36)}function Ce(){}function it(b){switch(b.status){case"fulfilled":return b.value;case"rejected":throw b.reason;default:switch(typeof b.status=="string"?b.then(Ce,Ce):(b.status="pending",b.then(function(D){b.status==="pending"&&(b.status="fulfilled",b.value=D)},function(D){b.status==="pending"&&(b.status="rejected",b.reason=D)})),b.status){case"fulfilled":return b.value;case"rejected":throw b.reason}}throw b}function Ue(b,D,te,P,G){var _e=typeof b;(_e==="undefined"||_e==="boolean")&&(b=null);var de=!1;if(b===null)de=!0;else switch(_e){case"bigint":case"string":case"number":de=!0;break;case"object":switch(b.$$typeof){case s:case n:de=!0;break;case _:return de=b._init,Ue(de(b._payload),D,te,P,G)}}if(de)return G=G(b),de=P===""?"."+Ge(b,0):P,ht(G)?(te="",de!=null&&(te=de.replace(we,"$&/")+"/"),Ue(G,D,te,"",function(Qe){return Qe})):G!=null&&(j(G)&&(G=W(G,te+(G.key==null||b&&b.key===G.key?"":(""+G.key).replace(we,"$&/")+"/")+de)),D.push(G)),1;de=0;var _t=P===""?".":P+":";if(ht(b))for(var Re=0;Re<b.length;Re++)P=b[Re],_e=_t+Ge(P,Re),de+=Ue(P,D,te,_e,G);else if(Re=C(b),typeof Re=="function")for(b=Re.call(b),Re=0;!(P=b.next()).done;)P=P.value,_e=_t+Ge(P,Re++),de+=Ue(P,D,te,_e,G);else if(_e==="object"){if(typeof b.then=="function")return Ue(it(b),D,te,P,G);throw D=String(b),Error("Objects are not valid as a React child (found: "+(D==="[object Object]"?"object with keys {"+Object.keys(b).join(", ")+"}":D)+"). If you meant to render a collection of children, use an array instead.")}return de}function Z(b,D,te){if(b==null)return b;var P=[],G=0;return Ue(b,P,"","",function(_e){return D.call(te,_e,G++)}),P}function ie(b){if(b._status===-1){var D=b._result;D=D(),D.then(function(te){(b._status===0||b._status===-1)&&(b._status=1,b._result=te)},function(te){(b._status===0||b._status===-1)&&(b._status=2,b._result=te)}),b._status===-1&&(b._status=0,b._result=D)}if(b._status===1)return b._result.default;throw b._result}var I=typeof reportError=="function"?reportError:function(b){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var D=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof b=="object"&&b!==null&&typeof b.message=="string"?String(b.message):String(b),error:b});if(!window.dispatchEvent(D))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",b);return}console.error(b)};function Ee(){}return ce.Children={map:Z,forEach:function(b,D,te){Z(b,function(){D.apply(this,arguments)},te)},count:function(b){var D=0;return Z(b,function(){D++}),D},toArray:function(b){return Z(b,function(D){return D})||[]},only:function(b){if(!j(b))throw Error("React.Children.only expected to receive a single React element child.");return b}},ce.Component=ge,ce.Fragment=i,ce.Profiler=c,ce.PureComponent=fe,ce.StrictMode=u,ce.Suspense=p,ce.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=N,ce.act=function(){throw Error("act(...) is not supported in production builds of React.")},ce.cache=function(b){return function(){return b.apply(null,arguments)}},ce.cloneElement=function(b,D,te){if(b==null)throw Error("The argument must be a React element, but you passed "+b+".");var P=Y({},b.props),G=b.key,_e=void 0;if(D!=null)for(de in D.ref!==void 0&&(_e=void 0),D.key!==void 0&&(G=""+D.key),D)!L.call(D,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&D.ref===void 0||(P[de]=D[de]);var de=arguments.length-2;if(de===1)P.children=te;else if(1<de){for(var _t=Array(de),Re=0;Re<de;Re++)_t[Re]=arguments[Re+2];P.children=_t}return se(b.type,G,void 0,void 0,_e,P)},ce.createContext=function(b){return b={$$typeof:h,_currentValue:b,_currentValue2:b,_threadCount:0,Provider:null,Consumer:null},b.Provider=b,b.Consumer={$$typeof:f,_context:b},b},ce.createElement=function(b,D,te){var P,G={},_e=null;if(D!=null)for(P in D.key!==void 0&&(_e=""+D.key),D)L.call(D,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(G[P]=D[P]);var de=arguments.length-2;if(de===1)G.children=te;else if(1<de){for(var _t=Array(de),Re=0;Re<de;Re++)_t[Re]=arguments[Re+2];G.children=_t}if(b&&b.defaultProps)for(P in de=b.defaultProps,de)G[P]===void 0&&(G[P]=de[P]);return se(b,_e,void 0,void 0,null,G)},ce.createRef=function(){return{current:null}},ce.forwardRef=function(b){return{$$typeof:y,render:b}},ce.isValidElement=j,ce.lazy=function(b){return{$$typeof:_,_payload:{_status:-1,_result:b},_init:ie}},ce.memo=function(b,D){return{$$typeof:g,type:b,compare:D===void 0?null:D}},ce.startTransition=function(b){var D=N.T,te={};N.T=te;try{var P=b(),G=N.S;G!==null&&G(te,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(Ee,I)}catch(_e){I(_e)}finally{N.T=D}},ce.unstable_useCacheRefresh=function(){return N.H.useCacheRefresh()},ce.use=function(b){return N.H.use(b)},ce.useActionState=function(b,D,te){return N.H.useActionState(b,D,te)},ce.useCallback=function(b,D){return N.H.useCallback(b,D)},ce.useContext=function(b){return N.H.useContext(b)},ce.useDebugValue=function(){},ce.useDeferredValue=function(b,D){return N.H.useDeferredValue(b,D)},ce.useEffect=function(b,D){return N.H.useEffect(b,D)},ce.useId=function(){return N.H.useId()},ce.useImperativeHandle=function(b,D,te){return N.H.useImperativeHandle(b,D,te)},ce.useInsertionEffect=function(b,D){return N.H.useInsertionEffect(b,D)},ce.useLayoutEffect=function(b,D){return N.H.useLayoutEffect(b,D)},ce.useMemo=function(b,D){return N.H.useMemo(b,D)},ce.useOptimistic=function(b,D){return N.H.useOptimistic(b,D)},ce.useReducer=function(b,D,te){return N.H.useReducer(b,D,te)},ce.useRef=function(b){return N.H.useRef(b)},ce.useState=function(b){return N.H.useState(b)},ce.useSyncExternalStore=function(b,D,te){return N.H.useSyncExternalStore(b,D,te)},ce.useTransition=function(){return N.H.useTransition()},ce.version="19.0.0",ce}var Iy;function Fo(){return Iy||(Iy=1,co.exports=Hb()),co.exports}var dt=Fo();const Wo=dt.createContext(Xe.STORE);function xm(s,...n){let i;if(n.length===2){const u=n[0],c=n[1];i=gt(s,u,c)}else i=n[0];return i}function La(...s){const n=dt.useContext(Wo),i=xm(n,...s),u=dt.useRef(null);return u.current===null&&(u.current=c=>{Pe(n,i,c)}),u.current}function Ut(...s){const n=dt.useContext(Wo),i=xm(n,...s),u=dt.useId();return dt.useSyncExternalStore(c=>Jl(i,c,`use-o:${u}`,n),()=>It(n,i),()=>It(n,i))}const Vb=(s,n,i,u,c)=>f=>{function h(p,g){if(s.logger.info("🧑‍⚖️","continuity",n,"reconciling updates"),Pe(s,Mu,O=>(O.shift(),O)),p.id===g.id){const O=JSON.stringify(p.updates),C=JSON.stringify(g.updates);if(O===C){s.logger.info("✅","continuity",n,`results for ${p.id} match between client and server`),i.emit(`ack:${n}`,g.epoch);return}}else s.logger.info("❌","continuity",n,`thought update #${g.epoch} was ${p.key}:${p.id}, but it was actually ${g.key}:${g.id}`);s.logger.info("🧑‍⚖️","continuity",n,"updates do not match",p,g);const _=u.toReversed();for(const O of _)zi("oldValue",O,s);s.logger.info("⏪","continuity",n,"undid optimistic updates:",_),zi("oldValue",p,s),s.logger.info("⏪","continuity",n,"undid zeroth optimistic update",p),zi("newValue",g,s),s.logger.info("⏩","continuity",n,"applied confirmed update",g),i.emit(`ack:${n}`,g.epoch);for(const O of u){const C={type:"transaction",key:O.key},{id:U,params:Y}=O;Vo(C,U,s)(...Y)}s.logger.info("⏩","continuity",n,"reapplied subsequent optimistic updates:",u)}s.logger.info("🧑‍⚖️","continuity",n,"integrating confirmed update",{confirmedUpdate:f,confirmedUpdates:c,optimisticUpdates:u});const y=u[0];if(y)if(s.logger.info("🧑‍⚖️","continuity",n,"has optimistic updates to reconcile"),f.epoch===y.epoch){s.logger.info("🧑‍⚖️","continuity",n,`epoch of confirmed update #${f.epoch} matches zeroth optimistic update`),h(y,f);for(const p of c){const g=u[0];if(p.epoch===(g==null?void 0:g.epoch))h(g,p);else break}}else s.logger.info("🧑‍⚖️","continuity",n,`epoch of confirmed update #${f.epoch} does not match zeroth optimistic update #${y.epoch}`),c.some(g=>g.epoch===f.epoch)||(s.logger.info("👈","continuity",n,"pushing confirmed update to queue",f),Pe(s,Ao,g=>(g.push(f),g.sort((_,O)=>_.epoch-O.epoch),g)));else{s.logger.info("🧑‍⚖️","continuity",n,"has no optimistic updates to deal with");const p=vb(n,s),g=rn(s);g&&p===f.epoch-1?(s.logger.info("✅","continuity",n,`integrating update #${f.epoch} (${f.key} ${f.id})`),zi("newValue",f,s),i.emit(`ack:${n}`,f.epoch),Ko(n,f.epoch,s)):g&&p!==void 0&&(s.logger.info("🧑‍⚖️","continuity",n,`received update #${f.epoch} but still waiting for update #${p+1}`,{clientEpoch:p,serverEpoch:f.epoch}),c.some(O=>O.epoch===f.epoch)?s.logger.info("👍","continuity",n,`confirmed update #${f.epoch} is already enqueued`):(s.logger.info("👈","continuity",n,`pushing confirmed update #${f.epoch} to queue`),Pe(s,Ao,O=>(O.push(f),O.sort((C,U)=>C.epoch-U.epoch),O))))}};function Lb(s){return n=>{for(const i of n)Jo(i,s)}}function Kb(s){return n=>{let i=0,u,c;for(const f of n)i%2===0?u=f:(c=f,Pe(s,u,c)),i++}}const Yb=(s,{stringify:n,parse:i},u)=>({setSelf:c,onSet:f})=>{const h=s.getItem(u);h!=null&&c(i(h)),f(({newValue:y})=>{if(y==null){s.removeItem(u);return}s.setItem(u,n(y))})},km=Bt({key:"mySocketId__INTERNAL",default:void 0});Qa({key:"mySocketId",get:({get:s})=>s(km)});Bt({key:"myName",default:null,effects:typeof window>"u"?[]:[Yb(window.localStorage,JSON,"myUsername")]});const Mu=Bt({key:"updateQueue",default:[]}),Ao=Bt({key:"serverConfirmedUpdateQueue",default:[]});function Gb(s,n,i){const u=s.key,c=It(i,Mu),f=It(i,Ao),h=(O,C)=>{n.off(`continuity-init:${u}`,h);let U=0,Y,K;for(const ge of C)U%2===0?Y=ge:(K=ge,"type"in Y&&Y.type==="mutable_atom"&&(Y=Ja(i,Y)),Pe(i,Y,K)),U++;Ko(u,O,i)};n.off(`continuity-init:${u}`),n.on(`continuity-init:${u}`,h);const y=Vb(i,u,n,c,f);n.off(`tx-new:${u}`),n.on(`tx-new:${u}`,y);const p=s.actions.map(O=>(_m(u,O.key,i),Nb(O,U=>{i.logger.info("🤞","continuity",u,"enqueuing optimistic update");const Y=c.findIndex(K=>K.id===U.id);Y===-1?(i.logger.info("🤞","continuity",u,"enqueuing new optimistic update"),Pe(i,Mu,K=>(K.push(U),K.sort((ge,ye)=>ge.epoch-ye.epoch),K))):(i.logger.info("🤞","continuity",u,`replacing existing optimistic update at index ${Y}`),Pe(i,Mu,K=>(K[Y]=U,K))),n.emit(`tx-run:${u}`,{id:U.id,key:O.key,params:U.params})},`tx-run:${u}`,i))),g=Kb(i),_=Lb(i);return n.on(`reveal:${u}`,g),n.on(`conceal:${u}`,_),n.emit(`get:${u}`),()=>{n.off(`continuity-init:${u}`),n.off(`tx-new:${u}`);for(const O of p)O()}}const Mm=dt.createContext({socket:null,services:null}),$b=({children:s,socket:n})=>{const i=dt.useRef(new Map).current,u=La(km);return dt.useEffect(()=>{u(n==null?void 0:n.id),n==null||n.on("connect",()=>{u(n.id)}),n==null||n.on("disconnect",()=>{u(void 0)})},[n,u]),q.jsx(Mm.Provider,{value:{socket:n,services:i},children:s})},{NODE_ENV:Xb}=globalThis.env??{},Qb=Xb==="development";function Ru(){}function Jb(s,n){if(Qb){const i=dt.useRef(Ru);dt.useEffect(()=>{let u=i.current;if(u===Ru)u=s()??Ru,i.current=u;else return()=>{u(),i.current=Ru}},n)}else dt.useEffect(s,n)}function Fb(s){Jb(s,[])}function Wb(s,n){const{socket:i,services:u}=dt.useContext(Mm);Fb(()=>{let c=u==null?void 0:u.get(s);return c?c[0]++:(c=[1,i?n(i):void 0],u==null||u.set(s,c)),()=>{var f;c&&(c[0]--,c[0]===0&&((f=c[1])==null||f.call(c),u==null||u.delete(s)))}})}function Ib(s){const n=dt.useContext(Wo);Wb(`tx-sync:${s.key}`,i=>Gb(s,i,n))}var oo={exports:{}},Kl={},fo={exports:{}},ho={};/**
31
+ * @license React
32
+ * scheduler.production.js
33
+ *
34
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
35
+ *
36
+ * This source code is licensed under the MIT license found in the
37
+ * LICENSE file in the root directory of this source tree.
38
+ */var Py;function Pb(){return Py||(Py=1,function(s){function n(Z,ie){var I=Z.length;Z.push(ie);e:for(;0<I;){var Ee=I-1>>>1,b=Z[Ee];if(0<c(b,ie))Z[Ee]=ie,Z[I]=b,I=Ee;else break e}}function i(Z){return Z.length===0?null:Z[0]}function u(Z){if(Z.length===0)return null;var ie=Z[0],I=Z.pop();if(I!==ie){Z[0]=I;e:for(var Ee=0,b=Z.length,D=b>>>1;Ee<D;){var te=2*(Ee+1)-1,P=Z[te],G=te+1,_e=Z[G];if(0>c(P,I))G<b&&0>c(_e,P)?(Z[Ee]=_e,Z[G]=I,Ee=G):(Z[Ee]=P,Z[te]=I,Ee=te);else if(G<b&&0>c(_e,I))Z[Ee]=_e,Z[G]=I,Ee=G;else break e}}return ie}function c(Z,ie){var I=Z.sortIndex-ie.sortIndex;return I!==0?I:Z.id-ie.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;s.unstable_now=function(){return f.now()}}else{var h=Date,y=h.now();s.unstable_now=function(){return h.now()-y}}var p=[],g=[],_=1,O=null,C=3,U=!1,Y=!1,K=!1,ge=typeof setTimeout=="function"?setTimeout:null,ye=typeof clearTimeout=="function"?clearTimeout:null,fe=typeof setImmediate<"u"?setImmediate:null;function Be(Z){for(var ie=i(g);ie!==null;){if(ie.callback===null)u(g);else if(ie.startTime<=Z)u(g),ie.sortIndex=ie.expirationTime,n(p,ie);else break;ie=i(g)}}function ht(Z){if(K=!1,Be(Z),!Y)if(i(p)!==null)Y=!0,it();else{var ie=i(g);ie!==null&&Ue(ht,ie.startTime-Z)}}var N=!1,L=-1,se=5,W=-1;function j(){return!(s.unstable_now()-W<se)}function X(){if(N){var Z=s.unstable_now();W=Z;var ie=!0;try{e:{Y=!1,K&&(K=!1,ye(L),L=-1),U=!0;var I=C;try{t:{for(Be(Z),O=i(p);O!==null&&!(O.expirationTime>Z&&j());){var Ee=O.callback;if(typeof Ee=="function"){O.callback=null,C=O.priorityLevel;var b=Ee(O.expirationTime<=Z);if(Z=s.unstable_now(),typeof b=="function"){O.callback=b,Be(Z),ie=!0;break t}O===i(p)&&u(p),Be(Z)}else u(p);O=i(p)}if(O!==null)ie=!0;else{var D=i(g);D!==null&&Ue(ht,D.startTime-Z),ie=!1}}break e}finally{O=null,C=I,U=!1}ie=void 0}}finally{ie?we():N=!1}}}var we;if(typeof fe=="function")we=function(){fe(X)};else if(typeof MessageChannel<"u"){var Ge=new MessageChannel,Ce=Ge.port2;Ge.port1.onmessage=X,we=function(){Ce.postMessage(null)}}else we=function(){ge(X,0)};function it(){N||(N=!0,we())}function Ue(Z,ie){L=ge(function(){Z(s.unstable_now())},ie)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(Z){Z.callback=null},s.unstable_continueExecution=function(){Y||U||(Y=!0,it())},s.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<Z?Math.floor(1e3/Z):5},s.unstable_getCurrentPriorityLevel=function(){return C},s.unstable_getFirstCallbackNode=function(){return i(p)},s.unstable_next=function(Z){switch(C){case 1:case 2:case 3:var ie=3;break;default:ie=C}var I=C;C=ie;try{return Z()}finally{C=I}},s.unstable_pauseExecution=function(){},s.unstable_requestPaint=function(){},s.unstable_runWithPriority=function(Z,ie){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var I=C;C=Z;try{return ie()}finally{C=I}},s.unstable_scheduleCallback=function(Z,ie,I){var Ee=s.unstable_now();switch(typeof I=="object"&&I!==null?(I=I.delay,I=typeof I=="number"&&0<I?Ee+I:Ee):I=Ee,Z){case 1:var b=-1;break;case 2:b=250;break;case 5:b=1073741823;break;case 4:b=1e4;break;default:b=5e3}return b=I+b,Z={id:_++,callback:ie,priorityLevel:Z,startTime:I,expirationTime:b,sortIndex:-1},I>Ee?(Z.sortIndex=I,n(g,Z),i(p)===null&&Z===i(g)&&(K?(ye(L),L=-1):K=!0,Ue(ht,I-Ee))):(Z.sortIndex=b,n(p,Z),Y||U||(Y=!0,it())),Z},s.unstable_shouldYield=j,s.unstable_wrapCallback=function(Z){var ie=C;return function(){var I=C;C=ie;try{return Z.apply(this,arguments)}finally{C=I}}}}(ho)),ho}var em;function e0(){return em||(em=1,fo.exports=Pb()),fo.exports}var yo={exports:{}},pt={};/**
39
+ * @license React
40
+ * react-dom.production.js
41
+ *
42
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
43
+ *
44
+ * This source code is licensed under the MIT license found in the
45
+ * LICENSE file in the root directory of this source tree.
46
+ */var tm;function t0(){if(tm)return pt;tm=1;var s=Fo();function n(p){var g="https://react.dev/errors/"+p;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)g+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+p+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var u={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},c=Symbol.for("react.portal");function f(p,g,_){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:c,key:O==null?null:""+O,children:p,containerInfo:g,implementation:_}}var h=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function y(p,g){if(p==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,pt.createPortal=function(p,g){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(n(299));return f(p,g,null,_)},pt.flushSync=function(p){var g=h.T,_=u.p;try{if(h.T=null,u.p=2,p)return p()}finally{h.T=g,u.p=_,u.d.f()}},pt.preconnect=function(p,g){typeof p=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(p,g))},pt.prefetchDNS=function(p){typeof p=="string"&&u.d.D(p)},pt.preinit=function(p,g){if(typeof p=="string"&&g&&typeof g.as=="string"){var _=g.as,O=y(_,g.crossOrigin),C=typeof g.integrity=="string"?g.integrity:void 0,U=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;_==="style"?u.d.S(p,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:O,integrity:C,fetchPriority:U}):_==="script"&&u.d.X(p,{crossOrigin:O,integrity:C,fetchPriority:U,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},pt.preinitModule=function(p,g){if(typeof p=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var _=y(g.as,g.crossOrigin);u.d.M(p,{crossOrigin:_,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(p)},pt.preload=function(p,g){if(typeof p=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var _=g.as,O=y(_,g.crossOrigin);u.d.L(p,_,{crossOrigin:O,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},pt.preloadModule=function(p,g){if(typeof p=="string")if(g){var _=y(g.as,g.crossOrigin);u.d.m(p,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:_,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(p)},pt.requestFormReset=function(p){u.d.r(p)},pt.unstable_batchedUpdates=function(p,g){return p(g)},pt.useFormState=function(p,g,_){return h.H.useFormState(p,g,_)},pt.useFormStatus=function(){return h.H.useHostTransitionStatus()},pt.version="19.0.0",pt}var nm;function n0(){if(nm)return yo.exports;nm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),yo.exports=t0(),yo.exports}/**
47
+ * @license React
48
+ * react-dom-client.production.js
49
+ *
50
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
51
+ *
52
+ * This source code is licensed under the MIT license found in the
53
+ * LICENSE file in the root directory of this source tree.
54
+ */var am;function a0(){if(am)return Kl;am=1;var s=e0(),n=Fo(),i=n0();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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."}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}var f=Symbol.for("react.element"),h=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),p=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),O=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),U=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ge=Symbol.for("react.suspense_list"),ye=Symbol.for("react.memo"),fe=Symbol.for("react.lazy"),Be=Symbol.for("react.offscreen"),ht=Symbol.for("react.memo_cache_sentinel"),N=Symbol.iterator;function L(e){return e===null||typeof e!="object"?null:(e=N&&e[N]||e["@@iterator"],typeof e=="function"?e:null)}var se=Symbol.for("react.client.reference");function W(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===se?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case p:return"Fragment";case y:return"Portal";case _:return"Profiler";case g:return"StrictMode";case K:return"Suspense";case ge:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case U:return(e.displayName||"Context")+".Provider";case C:return(e._context.displayName||"Context")+".Consumer";case Y:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ye:return t=e.displayName||null,t!==null?t:W(e.type)||"Memo";case fe:t=e._payload,e=e._init;try{return W(e(t))}catch{}}return null}var j=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=Object.assign,we,Ge;function Ce(e){if(we===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);we=t&&t[1]||"",Ge=-1<a.stack.indexOf(`
55
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
56
+ `+we+e+Ge}var it=!1;function Ue(e,t){if(!e||it)return"";it=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var M=function(){throw Error()};if(Object.defineProperty(M.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(M,[])}catch(R){var w=R}Reflect.construct(e,[],M)}else{try{M.call()}catch(R){w=R}e.call(M.prototype)}}else{try{throw Error()}catch(R){w=R}(M=e())&&typeof M.catch=="function"&&M.catch(function(){})}}catch(R){if(R&&w&&typeof R.stack=="string")return[R.stack,w.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var r=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");r&&r.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=l.DetermineComponentFrameRoot(),d=o[0],m=o[1];if(d&&m){var v=d.split(`
57
+ `),T=m.split(`
58
+ `);for(r=l=0;l<v.length&&!v[l].includes("DetermineComponentFrameRoot");)l++;for(;r<T.length&&!T[r].includes("DetermineComponentFrameRoot");)r++;if(l===v.length||r===T.length)for(l=v.length-1,r=T.length-1;1<=l&&0<=r&&v[l]!==T[r];)r--;for(;1<=l&&0<=r;l--,r--)if(v[l]!==T[r]){if(l!==1||r!==1)do if(l--,r--,0>r||v[l]!==T[r]){var x=`
59
+ `+v[l].replace(" at new "," at ");return e.displayName&&x.includes("<anonymous>")&&(x=x.replace("<anonymous>",e.displayName)),x}while(1<=l&&0<=r);break}}}finally{it=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ce(a):""}function Z(e){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce("Lazy");case 13:return Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return e=Ue(e.type,!1),e;case 11:return e=Ue(e.type.render,!1),e;case 1:return e=Ue(e.type,!0),e;default:return""}}function ie(e){try{var t="";do t+=Z(e),e=e.return;while(e);return t}catch(a){return`
60
+ Error generating stack: `+a.message+`
61
+ `+a.stack}}function I(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function Ee(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 b(e){if(I(e)!==e)throw Error(u(188))}function D(e){var t=e.alternate;if(!t){if(t=I(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,l=t;;){var r=a.return;if(r===null)break;var o=r.alternate;if(o===null){if(l=r.return,l!==null){a=l;continue}break}if(r.child===o.child){for(o=r.child;o;){if(o===a)return b(r),e;if(o===l)return b(r),t;o=o.sibling}throw Error(u(188))}if(a.return!==l.return)a=r,l=o;else{for(var d=!1,m=r.child;m;){if(m===a){d=!0,a=r,l=o;break}if(m===l){d=!0,l=r,a=o;break}m=m.sibling}if(!d){for(m=o.child;m;){if(m===a){d=!0,a=o,l=r;break}if(m===l){d=!0,l=o,a=r;break}m=m.sibling}if(!d)throw Error(u(189))}}if(a.alternate!==l)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function te(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=te(e),t!==null)return t;e=e.sibling}return null}var P=Array.isArray,G=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},de=[],_t=-1;function Re(e){return{current:e}}function Qe(e){0>_t||(e.current=de[_t],de[_t]=null,_t--)}function je(e,t){_t++,de[_t]=e.current,e.current=t}var cn=Re(null),Gi=Re(null),Yn=Re(null),hs=Re(null);function ys(e,t){switch(je(Yn,t),je(Gi,e),je(cn,null),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?Sy(t):0;break;default:if(e=e===8?t.parentNode:t,t=e.tagName,e=e.namespaceURI)e=Sy(e),t=Ty(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}Qe(cn),je(cn,t)}function Fa(){Qe(cn),Qe(Gi),Qe(Yn)}function Iu(e){e.memoizedState!==null&&je(hs,e);var t=cn.current,a=Ty(t,e.type);t!==a&&(je(Gi,e),je(cn,a))}function ms(e){Gi.current===e&&(Qe(cn),Qe(Gi)),hs.current===e&&(Qe(hs),Bl._currentValue=_e)}var Pu=Object.prototype.hasOwnProperty,er=s.unstable_scheduleCallback,tr=s.unstable_cancelCallback,dp=s.unstable_shouldYield,hp=s.unstable_requestPaint,on=s.unstable_now,yp=s.unstable_getCurrentPriorityLevel,of=s.unstable_ImmediatePriority,ff=s.unstable_UserBlockingPriority,ps=s.unstable_NormalPriority,mp=s.unstable_LowPriority,df=s.unstable_IdlePriority,pp=s.log,gp=s.unstable_setDisableYieldValue,$i=null,xt=null;function vp(e){if(xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot($i,e,void 0,(e.current.flags&128)===128)}catch{}}function Gn(e){if(typeof pp=="function"&&gp(e),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode($i,e)}catch{}}var kt=Math.clz32?Math.clz32:Sp,bp=Math.log,_p=Math.LN2;function Sp(e){return e>>>=0,e===0?32:31-(bp(e)/_p|0)|0}var gs=128,vs=4194304;function _a(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128: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&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function bs(e,t){var a=e.pendingLanes;if(a===0)return 0;var l=0,r=e.suspendedLanes,o=e.pingedLanes,d=e.warmLanes;e=e.finishedLanes!==0;var m=a&134217727;return m!==0?(a=m&~r,a!==0?l=_a(a):(o&=m,o!==0?l=_a(o):e||(d=m&~d,d!==0&&(l=_a(d))))):(m=a&~r,m!==0?l=_a(m):o!==0?l=_a(o):e||(d=a&~d,d!==0&&(l=_a(d)))),l===0?0:t!==0&&t!==l&&!(t&r)&&(r=l&-l,d=t&-t,r>=d||r===32&&(d&4194176)!==0)?t:l}function Xi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Tp(e,t){switch(e){case 1:case 2:case 4:case 8:return t+250;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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hf(){var e=gs;return gs<<=1,!(gs&4194176)&&(gs=128),e}function yf(){var e=vs;return vs<<=1,!(vs&62914560)&&(vs=4194304),e}function nr(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Qi(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ep(e,t,a,l,r,o){var d=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var m=e.entanglements,v=e.expirationTimes,T=e.hiddenUpdates;for(a=d&~a;0<a;){var x=31-kt(a),M=1<<x;m[x]=0,v[x]=-1;var w=T[x];if(w!==null)for(T[x]=null,x=0;x<w.length;x++){var R=w[x];R!==null&&(R.lane&=-536870913)}a&=~M}l!==0&&mf(e,l,0),o!==0&&r===0&&e.tag!==0&&(e.suspendedLanes|=o&~(d&~t))}function mf(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-kt(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&4194218}function pf(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-kt(a),r=1<<l;r&t|e[l]&t&&(e[l]|=t),a&=~r}}function gf(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function vf(){var e=G.p;return e!==0?e:(e=window.event,e===void 0?32:Hy(e.type))}function Ap(e,t){var a=G.p;try{return G.p=e,t()}finally{G.p=a}}var $n=Math.random().toString(36).slice(2),yt="__reactFiber$"+$n,Ot="__reactProps$"+$n,Wa="__reactContainer$"+$n,ar="__reactEvents$"+$n,Op="__reactListeners$"+$n,wp="__reactHandles$"+$n,bf="__reactResources$"+$n,Ji="__reactMarker$"+$n;function ir(e){delete e[yt],delete e[Ot],delete e[ar],delete e[Op],delete e[wp]}function Sa(e){var t=e[yt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Wa]||a[yt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Oy(e);e!==null;){if(a=e[yt])return a;e=Oy(e)}return t}e=a,a=e.parentNode}return null}function Ia(e){if(e=e[yt]||e[Wa]){var t=e.tag;if(t===5||t===6||t===13||t===26||t===27||t===3)return e}return null}function Fi(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Pa(e){var t=e[bf];return t||(t=e[bf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function lt(e){e[Ji]=!0}var _f=new Set,Sf={};function Ta(e,t){ei(e,t),ei(e+"Capture",t)}function ei(e,t){for(Sf[e]=t,e=0;e<t.length;e++)_f.add(t[e])}var An=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Rp=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tf={},Ef={};function xp(e){return Pu.call(Ef,e)?!0:Pu.call(Tf,e)?!1:Rp.test(e)?Ef[e]=!0:(Tf[e]=!0,!1)}function _s(e,t,a){if(xp(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Ss(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function On(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+l)}}function qt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Af(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kp(e){var t=Af(e)?"checked":"value",a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),l=""+e[t];if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var r=a.get,o=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return r.call(this)},set:function(d){l=""+d,o.call(this,d)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(d){l=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Ts(e){e._valueTracker||(e._valueTracker=kp(e))}function Of(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=Af(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}function Es(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Mp=/[\n"\\]/g;function Zt(e){return e.replace(Mp,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function lr(e,t,a,l,r,o,d,m){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+qt(t)):e.value!==""+qt(t)&&(e.value=""+qt(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?sr(e,d,qt(t)):a!=null?sr(e,d,qt(a)):l!=null&&e.removeAttribute("value"),r==null&&o!=null&&(e.defaultChecked=!!o),r!=null&&(e.checked=r&&typeof r!="function"&&typeof r!="symbol"),m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"?e.name=""+qt(m):e.removeAttribute("name")}function wf(e,t,a,l,r,o,d,m){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null))return;a=a!=null?""+qt(a):"",t=t!=null?""+qt(t):a,m||t===e.value||(e.value=t),e.defaultValue=t}l=l??r,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=m?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d)}function sr(e,t,a){t==="number"&&Es(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ti(e,t,a,l){if(e=e.options,t){t={};for(var r=0;r<a.length;r++)t["$"+a[r]]=!0;for(a=0;a<e.length;a++)r=t.hasOwnProperty("$"+e[a].value),e[a].selected!==r&&(e[a].selected=r),r&&l&&(e[a].defaultSelected=!0)}else{for(a=""+qt(a),t=null,r=0;r<e.length;r++){if(e[r].value===a){e[r].selected=!0,l&&(e[r].defaultSelected=!0);return}t!==null||e[r].disabled||(t=e[r])}t!==null&&(t.selected=!0)}}function Rf(e,t,a){if(t!=null&&(t=""+qt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+qt(a):""}function xf(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(u(92));if(P(l)){if(1<l.length)throw Error(u(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=qt(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l)}function ni(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Np=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function kf(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Np.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function Mf(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="");for(var r in t)l=t[r],t.hasOwnProperty(r)&&a[r]!==l&&kf(e,r,l)}else for(var o in t)t.hasOwnProperty(o)&&kf(e,o,t[o])}function ur(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Cp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Dp=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function As(e){return Dp.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}var rr=null;function cr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ai=null,ii=null;function Nf(e){var t=Ia(e);if(t&&(e=t.stateNode)){var a=e[Ot]||null;e:switch(e=t.stateNode,t.type){case"input":if(lr(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Zt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var r=l[Ot]||null;if(!r)throw Error(u(90));lr(l,r.value,r.defaultValue,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&Of(l)}break e;case"textarea":Rf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&ti(e,!!a.multiple,t,!1)}}}var or=!1;function Cf(e,t,a){if(or)return e(t,a);or=!0;try{var l=e(t);return l}finally{if(or=!1,(ai!==null||ii!==null)&&(uu(),ai&&(t=ai,e=ii,ii=ai=null,Nf(t),e)))for(t=0;t<e.length;t++)Nf(e[t])}}function Wi(e,t){var a=e.stateNode;if(a===null)return null;var l=a[Ot]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var fr=!1;if(An)try{var Ii={};Object.defineProperty(Ii,"passive",{get:function(){fr=!0}}),window.addEventListener("test",Ii,Ii),window.removeEventListener("test",Ii,Ii)}catch{fr=!1}var Xn=null,dr=null,Os=null;function Df(){if(Os)return Os;var e,t=dr,a=t.length,l,r="value"in Xn?Xn.value:Xn.textContent,o=r.length;for(e=0;e<a&&t[e]===r[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===r[o-l];l++);return Os=r.slice(e,1<l?1-l:void 0)}function ws(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 Rs(){return!0}function zf(){return!1}function wt(e){function t(a,l,r,o,d){this._reactName=a,this._targetInst=r,this.type=l,this.nativeEvent=o,this.target=d,this.currentTarget=null;for(var m in e)e.hasOwnProperty(m)&&(a=e[m],this[m]=a?a(o):o[m]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Rs:zf,this.isPropagationStopped=zf,this}return X(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Rs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Rs)},persist:function(){},isPersistent:Rs}),t}var Ea={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},xs=wt(Ea),Pi=X({},Ea,{view:0,detail:0}),zp=wt(Pi),hr,yr,el,ks=X({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pr,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!==el&&(el&&e.type==="mousemove"?(hr=e.screenX-el.screenX,yr=e.screenY-el.screenY):yr=hr=0,el=e),hr)},movementY:function(e){return"movementY"in e?e.movementY:yr}}),Uf=wt(ks),Up=X({},ks,{dataTransfer:0}),jp=wt(Up),Bp=X({},Pi,{relatedTarget:0}),mr=wt(Bp),qp=X({},Ea,{animationName:0,elapsedTime:0,pseudoElement:0}),Zp=wt(qp),Hp=X({},Ea,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Vp=wt(Hp),Lp=X({},Ea,{data:0}),jf=wt(Lp),Kp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yp={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"},Gp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $p(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gp[e])?!!t[e]:!1}function pr(){return $p}var Xp=X({},Pi,{key:function(e){if(e.key){var t=Kp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ws(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Yp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pr,charCode:function(e){return e.type==="keypress"?ws(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ws(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Qp=wt(Xp),Jp=X({},ks,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Bf=wt(Jp),Fp=X({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pr}),Wp=wt(Fp),Ip=X({},Ea,{propertyName:0,elapsedTime:0,pseudoElement:0}),Pp=wt(Ip),eg=X({},ks,{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}),tg=wt(eg),ng=X({},Ea,{newState:0,oldState:0}),ag=wt(ng),ig=[9,13,27,32],gr=An&&"CompositionEvent"in window,tl=null;An&&"documentMode"in document&&(tl=document.documentMode);var lg=An&&"TextEvent"in window&&!tl,qf=An&&(!gr||tl&&8<tl&&11>=tl),Zf=" ",Hf=!1;function Vf(e,t){switch(e){case"keyup":return ig.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Lf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var li=!1;function sg(e,t){switch(e){case"compositionend":return Lf(t);case"keypress":return t.which!==32?null:(Hf=!0,Zf);case"textInput":return e=t.data,e===Zf&&Hf?null:e;default:return null}}function ug(e,t){if(li)return e==="compositionend"||!gr&&Vf(e,t)?(e=Df(),Os=dr=Xn=null,li=!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 qf&&t.locale!=="ko"?null:t.data;default:return null}}var rg={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 Kf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!rg[e.type]:t==="textarea"}function Yf(e,t,a,l){ai?ii?ii.push(l):ii=[l]:ai=l,t=du(t,"onChange"),0<t.length&&(a=new xs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var nl=null,al=null;function cg(e){py(e,0)}function Ms(e){var t=Fi(e);if(Of(t))return e}function Gf(e,t){if(e==="change")return t}var $f=!1;if(An){var vr;if(An){var br="oninput"in document;if(!br){var Xf=document.createElement("div");Xf.setAttribute("oninput","return;"),br=typeof Xf.oninput=="function"}vr=br}else vr=!1;$f=vr&&(!document.documentMode||9<document.documentMode)}function Qf(){nl&&(nl.detachEvent("onpropertychange",Jf),al=nl=null)}function Jf(e){if(e.propertyName==="value"&&Ms(al)){var t=[];Yf(t,al,e,cr(e)),Cf(cg,t)}}function og(e,t,a){e==="focusin"?(Qf(),nl=t,al=a,nl.attachEvent("onpropertychange",Jf)):e==="focusout"&&Qf()}function fg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ms(al)}function dg(e,t){if(e==="click")return Ms(t)}function hg(e,t){if(e==="input"||e==="change")return Ms(t)}function yg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Mt=typeof Object.is=="function"?Object.is:yg;function il(e,t){if(Mt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var r=a[l];if(!Pu.call(t,r)||!Mt(e[r],t[r]))return!1}return!0}function Ff(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Wf(e,t){var a=Ff(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Ff(a)}}function If(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?If(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Pf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Es(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Es(e.document)}return t}function _r(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 mg(e,t){var a=Pf(t);t=e.focusedElem;var l=e.selectionRange;if(a!==t&&t&&t.ownerDocument&&If(t.ownerDocument.documentElement,t)){if(l!==null&&_r(t)){if(e=l.start,a=l.end,a===void 0&&(a=e),"selectionStart"in t)t.selectionStart=e,t.selectionEnd=Math.min(a,t.value.length);else if(a=(e=t.ownerDocument||document)&&e.defaultView||window,a.getSelection){a=a.getSelection();var r=t.textContent.length,o=Math.min(l.start,r);l=l.end===void 0?o:Math.min(l.end,r),!a.extend&&o>l&&(r=l,l=o,o=r),r=Wf(t,o);var d=Wf(t,l);r&&d&&(a.rangeCount!==1||a.anchorNode!==r.node||a.anchorOffset!==r.offset||a.focusNode!==d.node||a.focusOffset!==d.offset)&&(e=e.createRange(),e.setStart(r.node,r.offset),a.removeAllRanges(),o>l?(a.addRange(e),a.extend(d.node,d.offset)):(e.setEnd(d.node,d.offset),a.addRange(e)))}}for(e=[],a=t;a=a.parentNode;)a.nodeType===1&&e.push({element:a,left:a.scrollLeft,top:a.scrollTop});for(typeof t.focus=="function"&&t.focus(),t=0;t<e.length;t++)a=e[t],a.element.scrollLeft=a.left,a.element.scrollTop=a.top}}var pg=An&&"documentMode"in document&&11>=document.documentMode,si=null,Sr=null,ll=null,Tr=!1;function ed(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Tr||si==null||si!==Es(l)||(l=si,"selectionStart"in l&&_r(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),ll&&il(ll,l)||(ll=l,l=du(Sr,"onSelect"),0<l.length&&(t=new xs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=si)))}function Aa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var ui={animationend:Aa("Animation","AnimationEnd"),animationiteration:Aa("Animation","AnimationIteration"),animationstart:Aa("Animation","AnimationStart"),transitionrun:Aa("Transition","TransitionRun"),transitionstart:Aa("Transition","TransitionStart"),transitioncancel:Aa("Transition","TransitionCancel"),transitionend:Aa("Transition","TransitionEnd")},Er={},td={};An&&(td=document.createElement("div").style,"AnimationEvent"in window||(delete ui.animationend.animation,delete ui.animationiteration.animation,delete ui.animationstart.animation),"TransitionEvent"in window||delete ui.transitionend.transition);function Oa(e){if(Er[e])return Er[e];if(!ui[e])return e;var t=ui[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in td)return Er[e]=t[a];return e}var nd=Oa("animationend"),ad=Oa("animationiteration"),id=Oa("animationstart"),gg=Oa("transitionrun"),vg=Oa("transitionstart"),bg=Oa("transitioncancel"),ld=Oa("transitionend"),sd=new Map,ud="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function Pt(e,t){sd.set(e,t),Ta(t,[e])}var Ht=[],ri=0,Ar=0;function Ns(){for(var e=ri,t=Ar=ri=0;t<e;){var a=Ht[t];Ht[t++]=null;var l=Ht[t];Ht[t++]=null;var r=Ht[t];Ht[t++]=null;var o=Ht[t];if(Ht[t++]=null,l!==null&&r!==null){var d=l.pending;d===null?r.next=r:(r.next=d.next,d.next=r),l.pending=r}o!==0&&rd(a,r,o)}}function Cs(e,t,a,l){Ht[ri++]=e,Ht[ri++]=t,Ht[ri++]=a,Ht[ri++]=l,Ar|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Or(e,t,a,l){return Cs(e,t,a,l),Ds(e)}function Qn(e,t){return Cs(e,null,null,t),Ds(e)}function rd(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var r=!1,o=e.return;o!==null;)o.childLanes|=a,l=o.alternate,l!==null&&(l.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(r=!0)),e=o,o=o.return;r&&t!==null&&e.tag===3&&(o=e.stateNode,r=31-kt(a),o=o.hiddenUpdates,e=o[r],e===null?o[r]=[t]:e.push(t),t.lane=a|536870912)}function Ds(e){if(50<Ml)throw Ml=0,Nc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ci={},cd=new WeakMap;function Vt(e,t){if(typeof e=="object"&&e!==null){var a=cd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:ie(t)},cd.set(e,t),t)}return{value:e,source:t,stack:ie(t)}}var oi=[],fi=0,zs=null,Us=0,Lt=[],Kt=0,wa=null,wn=1,Rn="";function Ra(e,t){oi[fi++]=Us,oi[fi++]=zs,zs=e,Us=t}function od(e,t,a){Lt[Kt++]=wn,Lt[Kt++]=Rn,Lt[Kt++]=wa,wa=e;var l=wn;e=Rn;var r=32-kt(l)-1;l&=~(1<<r),a+=1;var o=32-kt(t)+r;if(30<o){var d=r-r%5;o=(l&(1<<d)-1).toString(32),l>>=d,r-=d,wn=1<<32-kt(t)+r|a<<r|l,Rn=o+e}else wn=1<<o|a<<r|l,Rn=e}function wr(e){e.return!==null&&(Ra(e,1),od(e,1,0))}function Rr(e){for(;e===zs;)zs=oi[--fi],oi[fi]=null,Us=oi[--fi],oi[fi]=null;for(;e===wa;)wa=Lt[--Kt],Lt[Kt]=null,Rn=Lt[--Kt],Lt[Kt]=null,wn=Lt[--Kt],Lt[Kt]=null}var St=null,ct=null,Ae=!1,en=null,fn=!1,xr=Error(u(519));function xa(e){var t=Error(u(418,""));throw rl(Vt(t,e)),xr}function fd(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[yt]=e,t[Ot]=l,a){case"dialog":ve("cancel",t),ve("close",t);break;case"iframe":case"object":case"embed":ve("load",t);break;case"video":case"audio":for(a=0;a<Cl.length;a++)ve(Cl[a],t);break;case"source":ve("error",t);break;case"img":case"image":case"link":ve("error",t),ve("load",t);break;case"details":ve("toggle",t);break;case"input":ve("invalid",t),wf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Ts(t);break;case"select":ve("invalid",t);break;case"textarea":ve("invalid",t),xf(t,l.value,l.defaultValue,l.children),Ts(t)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||_y(t.textContent,a)?(l.popover!=null&&(ve("beforetoggle",t),ve("toggle",t)),l.onScroll!=null&&ve("scroll",t),l.onScrollEnd!=null&&ve("scrollend",t),l.onClick!=null&&(t.onclick=hu),t=!0):t=!1,t||xa(e)}function dd(e){for(St=e.return;St;)switch(St.tag){case 3:case 27:fn=!0;return;case 5:case 13:fn=!1;return;default:St=St.return}}function sl(e){if(e!==St)return!1;if(!Ae)return dd(e),Ae=!0,!1;var t=!1,a;if((a=e.tag!==3&&e.tag!==27)&&((a=e.tag===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Qc(e.type,e.memoizedProps)),a=!a),a&&(t=!0),t&&ct&&xa(e),dd(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8)if(a=e.data,a==="/$"){if(t===0){ct=nn(e.nextSibling);break e}t--}else a!=="$"&&a!=="$!"&&a!=="$?"||t++;e=e.nextSibling}ct=null}}else ct=St?nn(e.stateNode.nextSibling):null;return!0}function ul(){ct=St=null,Ae=!1}function rl(e){en===null?en=[e]:en.push(e)}var cl=Error(u(460)),hd=Error(u(474)),kr={then:function(){}};function yd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function js(){}function md(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(js,js),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===cl?Error(u(483)):e;default:if(typeof t.status=="string")t.then(js,js);else{if(e=De,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var r=t;r.status="fulfilled",r.value=l}},function(l){if(t.status==="pending"){var r=t;r.status="rejected",r.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,e===cl?Error(u(483)):e}throw ol=t,cl}}var ol=null;function pd(){if(ol===null)throw Error(u(459));var e=ol;return ol=null,e}var di=null,fl=0;function Bs(e){var t=fl;return fl+=1,di===null&&(di=[]),md(di,e,t)}function dl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function qs(e,t){throw t.$$typeof===f?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function gd(e){var t=e._init;return t(e._payload)}function vd(e){function t(E,S){if(e){var A=E.deletions;A===null?(E.deletions=[S],E.flags|=16):A.push(S)}}function a(E,S){if(!e)return null;for(;S!==null;)t(E,S),S=S.sibling;return null}function l(E){for(var S=new Map;E!==null;)E.key!==null?S.set(E.key,E):S.set(E.index,E),E=E.sibling;return S}function r(E,S){return E=sa(E,S),E.index=0,E.sibling=null,E}function o(E,S,A){return E.index=A,e?(A=E.alternate,A!==null?(A=A.index,A<S?(E.flags|=33554434,S):A):(E.flags|=33554434,S)):(E.flags|=1048576,S)}function d(E){return e&&E.alternate===null&&(E.flags|=33554434),E}function m(E,S,A,k){return S===null||S.tag!==6?(S=Ec(A,E.mode,k),S.return=E,S):(S=r(S,A),S.return=E,S)}function v(E,S,A,k){var $=A.type;return $===p?x(E,S,A.props.children,k,A.key):S!==null&&(S.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===fe&&gd($)===S.type)?(S=r(S,A.props),dl(S,A),S.return=E,S):(S=nu(A.type,A.key,A.props,null,E.mode,k),dl(S,A),S.return=E,S)}function T(E,S,A,k){return S===null||S.tag!==4||S.stateNode.containerInfo!==A.containerInfo||S.stateNode.implementation!==A.implementation?(S=Ac(A,E.mode,k),S.return=E,S):(S=r(S,A.children||[]),S.return=E,S)}function x(E,S,A,k,$){return S===null||S.tag!==7?(S=qa(A,E.mode,k,$),S.return=E,S):(S=r(S,A),S.return=E,S)}function M(E,S,A){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=Ec(""+S,E.mode,A),S.return=E,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case h:return A=nu(S.type,S.key,S.props,null,E.mode,A),dl(A,S),A.return=E,A;case y:return S=Ac(S,E.mode,A),S.return=E,S;case fe:var k=S._init;return S=k(S._payload),M(E,S,A)}if(P(S)||L(S))return S=qa(S,E.mode,A,null),S.return=E,S;if(typeof S.then=="function")return M(E,Bs(S),A);if(S.$$typeof===U)return M(E,Ps(E,S),A);qs(E,S)}return null}function w(E,S,A,k){var $=S!==null?S.key:null;if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return $!==null?null:m(E,S,""+A,k);if(typeof A=="object"&&A!==null){switch(A.$$typeof){case h:return A.key===$?v(E,S,A,k):null;case y:return A.key===$?T(E,S,A,k):null;case fe:return $=A._init,A=$(A._payload),w(E,S,A,k)}if(P(A)||L(A))return $!==null?null:x(E,S,A,k,null);if(typeof A.then=="function")return w(E,S,Bs(A),k);if(A.$$typeof===U)return w(E,S,Ps(E,A),k);qs(E,A)}return null}function R(E,S,A,k,$){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return E=E.get(A)||null,m(S,E,""+k,$);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case h:return E=E.get(k.key===null?A:k.key)||null,v(S,E,k,$);case y:return E=E.get(k.key===null?A:k.key)||null,T(S,E,k,$);case fe:var me=k._init;return k=me(k._payload),R(E,S,A,k,$)}if(P(k)||L(k))return E=E.get(A)||null,x(S,E,k,$,null);if(typeof k.then=="function")return R(E,S,A,Bs(k),$);if(k.$$typeof===U)return R(E,S,A,Ps(S,k),$);qs(S,k)}return null}function J(E,S,A,k){for(var $=null,me=null,F=S,ee=S=0,rt=null;F!==null&&ee<A.length;ee++){F.index>ee?(rt=F,F=null):rt=F.sibling;var Oe=w(E,F,A[ee],k);if(Oe===null){F===null&&(F=rt);break}e&&F&&Oe.alternate===null&&t(E,F),S=o(Oe,S,ee),me===null?$=Oe:me.sibling=Oe,me=Oe,F=rt}if(ee===A.length)return a(E,F),Ae&&Ra(E,ee),$;if(F===null){for(;ee<A.length;ee++)F=M(E,A[ee],k),F!==null&&(S=o(F,S,ee),me===null?$=F:me.sibling=F,me=F);return Ae&&Ra(E,ee),$}for(F=l(F);ee<A.length;ee++)rt=R(F,E,ee,A[ee],k),rt!==null&&(e&&rt.alternate!==null&&F.delete(rt.key===null?ee:rt.key),S=o(rt,S,ee),me===null?$=rt:me.sibling=rt,me=rt);return e&&F.forEach(function(ha){return t(E,ha)}),Ae&&Ra(E,ee),$}function le(E,S,A,k){if(A==null)throw Error(u(151));for(var $=null,me=null,F=S,ee=S=0,rt=null,Oe=A.next();F!==null&&!Oe.done;ee++,Oe=A.next()){F.index>ee?(rt=F,F=null):rt=F.sibling;var ha=w(E,F,Oe.value,k);if(ha===null){F===null&&(F=rt);break}e&&F&&ha.alternate===null&&t(E,F),S=o(ha,S,ee),me===null?$=ha:me.sibling=ha,me=ha,F=rt}if(Oe.done)return a(E,F),Ae&&Ra(E,ee),$;if(F===null){for(;!Oe.done;ee++,Oe=A.next())Oe=M(E,Oe.value,k),Oe!==null&&(S=o(Oe,S,ee),me===null?$=Oe:me.sibling=Oe,me=Oe);return Ae&&Ra(E,ee),$}for(F=l(F);!Oe.done;ee++,Oe=A.next())Oe=R(F,E,ee,Oe.value,k),Oe!==null&&(e&&Oe.alternate!==null&&F.delete(Oe.key===null?ee:Oe.key),S=o(Oe,S,ee),me===null?$=Oe:me.sibling=Oe,me=Oe);return e&&F.forEach(function(Dv){return t(E,Dv)}),Ae&&Ra(E,ee),$}function Ye(E,S,A,k){if(typeof A=="object"&&A!==null&&A.type===p&&A.key===null&&(A=A.props.children),typeof A=="object"&&A!==null){switch(A.$$typeof){case h:e:{for(var $=A.key;S!==null;){if(S.key===$){if($=A.type,$===p){if(S.tag===7){a(E,S.sibling),k=r(S,A.props.children),k.return=E,E=k;break e}}else if(S.elementType===$||typeof $=="object"&&$!==null&&$.$$typeof===fe&&gd($)===S.type){a(E,S.sibling),k=r(S,A.props),dl(k,A),k.return=E,E=k;break e}a(E,S);break}else t(E,S);S=S.sibling}A.type===p?(k=qa(A.props.children,E.mode,k,A.key),k.return=E,E=k):(k=nu(A.type,A.key,A.props,null,E.mode,k),dl(k,A),k.return=E,E=k)}return d(E);case y:e:{for($=A.key;S!==null;){if(S.key===$)if(S.tag===4&&S.stateNode.containerInfo===A.containerInfo&&S.stateNode.implementation===A.implementation){a(E,S.sibling),k=r(S,A.children||[]),k.return=E,E=k;break e}else{a(E,S);break}else t(E,S);S=S.sibling}k=Ac(A,E.mode,k),k.return=E,E=k}return d(E);case fe:return $=A._init,A=$(A._payload),Ye(E,S,A,k)}if(P(A))return J(E,S,A,k);if(L(A)){if($=L(A),typeof $!="function")throw Error(u(150));return A=$.call(A),le(E,S,A,k)}if(typeof A.then=="function")return Ye(E,S,Bs(A),k);if(A.$$typeof===U)return Ye(E,S,Ps(E,A),k);qs(E,A)}return typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint"?(A=""+A,S!==null&&S.tag===6?(a(E,S.sibling),k=r(S,A),k.return=E,E=k):(a(E,S),k=Ec(A,E.mode,k),k.return=E,E=k),d(E)):a(E,S)}return function(E,S,A,k){try{fl=0;var $=Ye(E,S,A,k);return di=null,$}catch(F){if(F===cl)throw F;var me=Xt(29,F,null,E.mode);return me.lanes=k,me.return=E,me}finally{}}}var ka=vd(!0),bd=vd(!1),hi=Re(null),Zs=Re(0);function _d(e,t){e=qn,je(Zs,e),je(hi,t),qn=e|t.baseLanes}function Mr(){je(Zs,qn),je(hi,hi.current)}function Nr(){qn=Zs.current,Qe(hi),Qe(Zs)}var Yt=Re(null),dn=null;function Jn(e){var t=e.alternate;je(tt,tt.current&1),je(Yt,e),dn===null&&(t===null||hi.current!==null||t.memoizedState!==null)&&(dn=e)}function Sd(e){if(e.tag===22){if(je(tt,tt.current),je(Yt,e),dn===null){var t=e.alternate;t!==null&&t.memoizedState!==null&&(dn=e)}}else Fn()}function Fn(){je(tt,tt.current),je(Yt,Yt.current)}function xn(e){Qe(Yt),dn===e&&(dn=null),Qe(tt)}var tt=Re(0);function Hs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.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 _g=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Sg=s.unstable_scheduleCallback,Tg=s.unstable_NormalPriority,nt={$$typeof:U,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Cr(){return{controller:new _g,data:new Map,refCount:0}}function hl(e){e.refCount--,e.refCount===0&&Sg(Tg,function(){e.controller.abort()})}var yl=null,Dr=0,yi=0,mi=null;function Eg(e,t){if(yl===null){var a=yl=[];Dr=0,yi=Zc(),mi={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Dr++,t.then(Td,Td),t}function Td(){if(--Dr===0&&yl!==null){mi!==null&&(mi.status="fulfilled");var e=yl;yl=null,yi=0,mi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ag(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(r){a.push(r)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var r=0;r<a.length;r++)(0,a[r])(t)},function(r){for(l.status="rejected",l.reason=r,r=0;r<a.length;r++)(0,a[r])(void 0)}),l}var Ed=j.S;j.S=function(e,t){typeof t=="object"&&t!==null&&typeof t.then=="function"&&Eg(e,t),Ed!==null&&Ed(e,t)};var Ma=Re(null);function zr(){var e=Ma.current;return e!==null?e:De.pooledCache}function Vs(e,t){t===null?je(Ma,Ma.current):je(Ma,t.pool)}function Ad(){var e=zr();return e===null?null:{parent:nt._currentValue,pool:e}}var Wn=0,he=null,ke=null,Je=null,Ls=!1,pi=!1,Na=!1,Ks=0,ml=0,gi=null,Og=0;function $e(){throw Error(u(321))}function Ur(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Mt(e[a],t[a]))return!1;return!0}function jr(e,t,a,l,r,o){return Wn=o,he=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,j.H=e===null||e.memoizedState===null?Ca:In,Na=!1,o=a(l,r),Na=!1,pi&&(o=wd(t,a,l,r)),Od(e),o}function Od(e){j.H=hn;var t=ke!==null&&ke.next!==null;if(Wn=0,Je=ke=he=null,Ls=!1,ml=0,gi=null,t)throw Error(u(300));e===null||st||(e=e.dependencies,e!==null&&Is(e)&&(st=!0))}function wd(e,t,a,l){he=e;var r=0;do{if(pi&&(gi=null),ml=0,pi=!1,25<=r)throw Error(u(301));if(r+=1,Je=ke=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}j.H=Da,o=t(a,l)}while(pi);return o}function wg(){var e=j.H,t=e.useState()[0];return t=typeof t.then=="function"?pl(t):t,e=e.useState()[0],(ke!==null?ke.memoizedState:null)!==e&&(he.flags|=1024),t}function Br(){var e=Ks!==0;return Ks=0,e}function qr(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Zr(e){if(Ls){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ls=!1}Wn=0,Je=ke=he=null,pi=!1,ml=Ks=0,gi=null}function Rt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Je===null?he.memoizedState=Je=e:Je=Je.next=e,Je}function Fe(){if(ke===null){var e=he.alternate;e=e!==null?e.memoizedState:null}else e=ke.next;var t=Je===null?he.memoizedState:Je.next;if(t!==null)Je=t,ke=e;else{if(e===null)throw he.alternate===null?Error(u(467)):Error(u(310));ke=e,e={memoizedState:ke.memoizedState,baseState:ke.baseState,baseQueue:ke.baseQueue,queue:ke.queue,next:null},Je===null?he.memoizedState=Je=e:Je=Je.next=e}return Je}var Ys;Ys=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}};function pl(e){var t=ml;return ml+=1,gi===null&&(gi=[]),e=md(gi,e,t),t=he,(Je===null?t.memoizedState:Je.next)===null&&(t=t.alternate,j.H=t===null||t.memoizedState===null?Ca:In),e}function Gs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return pl(e);if(e.$$typeof===U)return mt(e)}throw Error(u(438,String(e)))}function Hr(e){var t=null,a=he.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=he.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(r){return r.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=Ys(),he.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=ht;return t.index++,a}function kn(e,t){return typeof t=="function"?t(e):t}function $s(e){var t=Fe();return Vr(t,ke,e)}function Vr(e,t,a){var l=e.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=a;var r=e.baseQueue,o=l.pending;if(o!==null){if(r!==null){var d=r.next;r.next=o.next,o.next=d}t.baseQueue=r=o,l.pending=null}if(o=e.baseState,r===null)e.memoizedState=o;else{t=r.next;var m=d=null,v=null,T=t,x=!1;do{var M=T.lane&-536870913;if(M!==T.lane?(Se&M)===M:(Wn&M)===M){var w=T.revertLane;if(w===0)v!==null&&(v=v.next={lane:0,revertLane:0,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),M===yi&&(x=!0);else if((Wn&w)===w){T=T.next,w===yi&&(x=!0);continue}else M={lane:0,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},v===null?(m=v=M,d=o):v=v.next=M,he.lanes|=w,ua|=w;M=T.action,Na&&a(o,M),o=T.hasEagerState?T.eagerState:a(o,M)}else w={lane:M,revertLane:T.revertLane,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},v===null?(m=v=w,d=o):v=v.next=w,he.lanes|=M,ua|=M;T=T.next}while(T!==null&&T!==t);if(v===null?d=o:v.next=m,!Mt(o,e.memoizedState)&&(st=!0,x&&(a=mi,a!==null)))throw a;e.memoizedState=o,e.baseState=d,e.baseQueue=v,l.lastRenderedState=o}return r===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function Lr(e){var t=Fe(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var l=a.dispatch,r=a.pending,o=t.memoizedState;if(r!==null){a.pending=null;var d=r=r.next;do o=e(o,d.action),d=d.next;while(d!==r);Mt(o,t.memoizedState)||(st=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,l]}function Rd(e,t,a){var l=he,r=Fe(),o=Ae;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var d=!Mt((ke||r).memoizedState,a);if(d&&(r.memoizedState=a,st=!0),r=r.queue,Gr(Md.bind(null,l,r,e),[e]),r.getSnapshot!==t||d||Je!==null&&Je.memoizedState.tag&1){if(l.flags|=2048,vi(9,kd.bind(null,l,r,a,t),{destroy:void 0},null),De===null)throw Error(u(349));o||Wn&60||xd(l,t,a)}return a}function xd(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=he.updateQueue,t===null?(t=Ys(),he.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function kd(e,t,a,l){t.value=a,t.getSnapshot=l,Nd(t)&&Cd(e)}function Md(e,t,a){return a(function(){Nd(t)&&Cd(e)})}function Nd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Mt(e,a)}catch{return!0}}function Cd(e){var t=Qn(e,2);t!==null&&Tt(t,e,2)}function Kr(e){var t=Rt();if(typeof e=="function"){var a=e;if(e=a(),Na){Gn(!0);try{a()}finally{Gn(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:e},t}function Dd(e,t,a,l){return e.baseState=a,Vr(e,ke,typeof l=="function"?l:kn)}function Rg(e,t,a,l,r){if(Js(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:r,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){o.listeners.push(d)}};j.T!==null?a(!0):o.isTransition=!1,l(o),a=t.pending,a===null?(o.next=t.pending=o,zd(t,o)):(o.next=a.next,t.pending=a.next=o)}}function zd(e,t){var a=t.action,l=t.payload,r=e.state;if(t.isTransition){var o=j.T,d={};j.T=d;try{var m=a(r,l),v=j.S;v!==null&&v(d,m),Ud(e,t,m)}catch(T){Yr(e,t,T)}finally{j.T=o}}else try{o=a(r,l),Ud(e,t,o)}catch(T){Yr(e,t,T)}}function Ud(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){jd(e,t,l)},function(l){return Yr(e,t,l)}):jd(e,t,a)}function jd(e,t,a){t.status="fulfilled",t.value=a,Bd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,zd(e,a)))}function Yr(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,Bd(t),t=t.next;while(t!==l)}e.action=null}function Bd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function qd(e,t){return t}function Zd(e,t){if(Ae){var a=De.formState;if(a!==null){e:{var l=he;if(Ae){if(ct){t:{for(var r=ct,o=fn;r.nodeType!==8;){if(!o){r=null;break t}if(r=nn(r.nextSibling),r===null){r=null;break t}}o=r.data,r=o==="F!"||o==="F"?r:null}if(r){ct=nn(r.nextSibling),l=r.data==="F!";break e}}xa(l)}l=!1}l&&(t=a[0])}}return a=Rt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:qd,lastRenderedState:t},a.queue=l,a=ah.bind(null,he,l),l.dispatch=a,l=Kr(!1),o=Fr.bind(null,he,!1,l.queue),l=Rt(),r={state:t,dispatch:null,action:e,pending:null},l.queue=r,a=Rg.bind(null,he,r,o,a),r.dispatch=a,l.memoizedState=e,[t,a,!1]}function Hd(e){var t=Fe();return Vd(t,ke,e)}function Vd(e,t,a){t=Vr(e,t,qd)[0],e=$s(kn)[0],t=typeof t=="object"&&t!==null&&typeof t.then=="function"?pl(t):t;var l=Fe(),r=l.queue,o=r.dispatch;return a!==l.memoizedState&&(he.flags|=2048,vi(9,xg.bind(null,r,a),{destroy:void 0},null)),[t,o,e]}function xg(e,t){e.action=t}function Ld(e){var t=Fe(),a=ke;if(a!==null)return Vd(t,a,e);Fe(),t=t.memoizedState,a=Fe();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function vi(e,t,a,l){return e={tag:e,create:t,inst:a,deps:l,next:null},t=he.updateQueue,t===null&&(t=Ys(),he.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function Kd(){return Fe().memoizedState}function Xs(e,t,a,l){var r=Rt();he.flags|=e,r.memoizedState=vi(1|t,a,{destroy:void 0},l===void 0?null:l)}function Qs(e,t,a,l){var r=Fe();l=l===void 0?null:l;var o=r.memoizedState.inst;ke!==null&&l!==null&&Ur(l,ke.memoizedState.deps)?r.memoizedState=vi(t,a,o,l):(he.flags|=e,r.memoizedState=vi(1|t,a,o,l))}function Yd(e,t){Xs(8390656,8,e,t)}function Gr(e,t){Qs(2048,8,e,t)}function Gd(e,t){return Qs(4,2,e,t)}function $d(e,t){return Qs(4,4,e,t)}function Xd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Qd(e,t,a){a=a!=null?a.concat([e]):null,Qs(4,4,Xd.bind(null,t,e),a)}function $r(){}function Jd(e,t){var a=Fe();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&Ur(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function Fd(e,t){var a=Fe();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&Ur(t,l[1]))return l[0];if(l=e(),Na){Gn(!0);try{e()}finally{Gn(!1)}}return a.memoizedState=[l,t],l}function Xr(e,t,a){return a===void 0||Wn&1073741824?e.memoizedState=t:(e.memoizedState=a,e=Ih(),he.lanes|=e,ua|=e,a)}function Wd(e,t,a,l){return Mt(a,t)?a:hi.current!==null?(e=Xr(e,a,l),Mt(e,t)||(st=!0),e):Wn&42?(e=Ih(),he.lanes|=e,ua|=e,t):(st=!0,e.memoizedState=a)}function Id(e,t,a,l,r){var o=G.p;G.p=o!==0&&8>o?o:8;var d=j.T,m={};j.T=m,Fr(e,!1,t,a);try{var v=r(),T=j.S;if(T!==null&&T(m,v),v!==null&&typeof v=="object"&&typeof v.then=="function"){var x=Ag(v,l);gl(e,t,x,zt(e))}else gl(e,t,l,zt(e))}catch(M){gl(e,t,{then:function(){},status:"rejected",reason:M},zt())}finally{G.p=o,j.T=d}}function kg(){}function Qr(e,t,a,l){if(e.tag!==5)throw Error(u(476));var r=Pd(e).queue;Id(e,r,t,_e,a===null?kg:function(){return eh(e),a(l)})}function Pd(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:_e},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:kn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function eh(e){var t=Pd(e).next.queue;gl(e,t,{},zt())}function Jr(){return mt(Bl)}function th(){return Fe().memoizedState}function nh(){return Fe().memoizedState}function Mg(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=zt();e=ta(a);var l=na(t,e,a);l!==null&&(Tt(l,t,a),_l(l,t,a)),t={cache:Cr()},e.payload=t;return}t=t.return}}function Ng(e,t,a){var l=zt();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Js(e)?ih(t,a):(a=Or(e,t,a,l),a!==null&&(Tt(a,e,l),lh(a,t,l)))}function ah(e,t,a){var l=zt();gl(e,t,a,l)}function gl(e,t,a,l){var r={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Js(e))ih(t,r);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var d=t.lastRenderedState,m=o(d,a);if(r.hasEagerState=!0,r.eagerState=m,Mt(m,d))return Cs(e,t,r,0),De===null&&Ns(),!1}catch{}finally{}if(a=Or(e,t,r,l),a!==null)return Tt(a,e,l),lh(a,t,l),!0}return!1}function Fr(e,t,a,l){if(l={lane:2,revertLane:Zc(),action:l,hasEagerState:!1,eagerState:null,next:null},Js(e)){if(t)throw Error(u(479))}else t=Or(e,a,l,2),t!==null&&Tt(t,e,2)}function Js(e){var t=e.alternate;return e===he||t!==null&&t===he}function ih(e,t){pi=Ls=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function lh(e,t,a){if(a&4194176){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,pf(e,a)}}var hn={readContext:mt,use:Gs,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useLayoutEffect:$e,useInsertionEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useSyncExternalStore:$e,useId:$e};hn.useCacheRefresh=$e,hn.useMemoCache=$e,hn.useHostTransitionStatus=$e,hn.useFormState=$e,hn.useActionState=$e,hn.useOptimistic=$e;var Ca={readContext:mt,use:Gs,useCallback:function(e,t){return Rt().memoizedState=[e,t===void 0?null:t],e},useContext:mt,useEffect:Yd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,Xs(4194308,4,Xd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return Xs(4194308,4,e,t)},useInsertionEffect:function(e,t){Xs(4,2,e,t)},useMemo:function(e,t){var a=Rt();t=t===void 0?null:t;var l=e();if(Na){Gn(!0);try{e()}finally{Gn(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Rt();if(a!==void 0){var r=a(t);if(Na){Gn(!0);try{a(t)}finally{Gn(!1)}}}else r=t;return l.memoizedState=l.baseState=r,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},l.queue=e,e=e.dispatch=Ng.bind(null,he,e),[l.memoizedState,e]},useRef:function(e){var t=Rt();return e={current:e},t.memoizedState=e},useState:function(e){e=Kr(e);var t=e.queue,a=ah.bind(null,he,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:$r,useDeferredValue:function(e,t){var a=Rt();return Xr(a,e,t)},useTransition:function(){var e=Kr(!1);return e=Id.bind(null,he,e.queue,!0,!1),Rt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=he,r=Rt();if(Ae){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),De===null)throw Error(u(349));Se&60||xd(l,t,a)}r.memoizedState=a;var o={value:a,getSnapshot:t};return r.queue=o,Yd(Md.bind(null,l,o,e),[e]),l.flags|=2048,vi(9,kd.bind(null,l,o,a,t),{destroy:void 0},null),a},useId:function(){var e=Rt(),t=De.identifierPrefix;if(Ae){var a=Rn,l=wn;a=(l&~(1<<32-kt(l)-1)).toString(32)+a,t=":"+t+"R"+a,a=Ks++,0<a&&(t+="H"+a.toString(32)),t+=":"}else a=Og++,t=":"+t+"r"+a.toString(32)+":";return e.memoizedState=t},useCacheRefresh:function(){return Rt().memoizedState=Mg.bind(null,he)}};Ca.useMemoCache=Hr,Ca.useHostTransitionStatus=Jr,Ca.useFormState=Zd,Ca.useActionState=Zd,Ca.useOptimistic=function(e){var t=Rt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Fr.bind(null,he,!0,a),a.dispatch=t,[e,t]};var In={readContext:mt,use:Gs,useCallback:Jd,useContext:mt,useEffect:Gr,useImperativeHandle:Qd,useInsertionEffect:Gd,useLayoutEffect:$d,useMemo:Fd,useReducer:$s,useRef:Kd,useState:function(){return $s(kn)},useDebugValue:$r,useDeferredValue:function(e,t){var a=Fe();return Wd(a,ke.memoizedState,e,t)},useTransition:function(){var e=$s(kn)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:pl(e),t]},useSyncExternalStore:Rd,useId:th};In.useCacheRefresh=nh,In.useMemoCache=Hr,In.useHostTransitionStatus=Jr,In.useFormState=Hd,In.useActionState=Hd,In.useOptimistic=function(e,t){var a=Fe();return Dd(a,ke,e,t)};var Da={readContext:mt,use:Gs,useCallback:Jd,useContext:mt,useEffect:Gr,useImperativeHandle:Qd,useInsertionEffect:Gd,useLayoutEffect:$d,useMemo:Fd,useReducer:Lr,useRef:Kd,useState:function(){return Lr(kn)},useDebugValue:$r,useDeferredValue:function(e,t){var a=Fe();return ke===null?Xr(a,e,t):Wd(a,ke.memoizedState,e,t)},useTransition:function(){var e=Lr(kn)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:pl(e),t]},useSyncExternalStore:Rd,useId:th};Da.useCacheRefresh=nh,Da.useMemoCache=Hr,Da.useHostTransitionStatus=Jr,Da.useFormState=Ld,Da.useActionState=Ld,Da.useOptimistic=function(e,t){var a=Fe();return ke!==null?Dd(a,ke,e,t):(a.baseState=e,[e,a.queue.dispatch])};function Wr(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:X({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ir={isMounted:function(e){return(e=e._reactInternals)?I(e)===e:!1},enqueueSetState:function(e,t,a){e=e._reactInternals;var l=zt(),r=ta(l);r.payload=t,a!=null&&(r.callback=a),t=na(e,r,l),t!==null&&(Tt(t,e,l),_l(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=zt(),r=ta(l);r.tag=1,r.payload=t,a!=null&&(r.callback=a),t=na(e,r,l),t!==null&&(Tt(t,e,l),_l(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=zt(),l=ta(a);l.tag=2,t!=null&&(l.callback=t),t=na(e,l,a),t!==null&&(Tt(t,e,a),_l(t,e,a))}};function sh(e,t,a,l,r,o,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,o,d):t.prototype&&t.prototype.isPureReactComponent?!il(a,l)||!il(r,o):!0}function uh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Ir.enqueueReplaceState(t,t.state,null)}function za(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=X({},a));for(var r in e)a[r]===void 0&&(a[r]=e[r])}return a}var Fs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)};function rh(e){Fs(e)}function ch(e){console.error(e)}function oh(e){Fs(e)}function Ws(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function fh(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(r){setTimeout(function(){throw r})}}function Pr(e,t,a){return a=ta(a),a.tag=3,a.payload={element:null},a.callback=function(){Ws(e,t)},a}function dh(e){return e=ta(e),e.tag=3,e}function hh(e,t,a,l){var r=a.type.getDerivedStateFromError;if(typeof r=="function"){var o=l.value;e.payload=function(){return r(o)},e.callback=function(){fh(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){fh(t,a,l),typeof r!="function"&&(ra===null?ra=new Set([this]):ra.add(this));var m=l.stack;this.componentDidCatch(l.value,{componentStack:m!==null?m:""})})}function Cg(e,t,a,l,r){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&bl(t,a,r,!0),a=Yt.current,a!==null){switch(a.tag){case 13:return dn===null?zc():a.alternate===null&&Ke===0&&(Ke=3),a.flags&=-257,a.flags|=65536,a.lanes=r,l===kr?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),jc(e,l,r)),!1;case 22:return a.flags|=65536,l===kr?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),jc(e,l,r)),!1}throw Error(u(435,a.tag))}return jc(e,l,r),zc(),!1}if(Ae)return t=Yt.current,t!==null?(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=r,l!==xr&&(e=Error(u(422),{cause:l}),rl(Vt(e,a)))):(l!==xr&&(t=Error(u(423),{cause:l}),rl(Vt(t,a))),e=e.current.alternate,e.flags|=65536,r&=-r,e.lanes|=r,l=Vt(l,a),r=Pr(e.stateNode,l,r),yc(e,r),Ke!==4&&(Ke=2)),!1;var o=Error(u(520),{cause:l});if(o=Vt(o,a),xl===null?xl=[o]:xl.push(o),Ke!==4&&(Ke=2),t===null)return!0;l=Vt(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=r&-r,a.lanes|=e,e=Pr(a.stateNode,l,e),yc(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(ra===null||!ra.has(o))))return a.flags|=65536,r&=-r,a.lanes|=r,r=dh(r),hh(r,e,a,l),yc(a,r),!1}a=a.return}while(a!==null);return!1}var yh=Error(u(461)),st=!1;function ot(e,t,a,l){t.child=e===null?bd(t,null,a,l):ka(t,e.child,a,l)}function mh(e,t,a,l,r){a=a.render;var o=t.ref;if("ref"in l){var d={};for(var m in l)m!=="ref"&&(d[m]=l[m])}else d=l;return ja(t),l=jr(e,t,a,d,o,r),m=Br(),e!==null&&!st?(qr(e,t,r),Mn(e,t,r)):(Ae&&m&&wr(t),t.flags|=1,ot(e,t,l,r),t.child)}function ph(e,t,a,l,r){if(e===null){var o=a.type;return typeof o=="function"&&!Tc(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,gh(e,t,o,l,r)):(e=nu(a.type,null,l,t,t.mode,r),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!rc(e,r)){var d=o.memoizedProps;if(a=a.compare,a=a!==null?a:il,a(d,l)&&e.ref===t.ref)return Mn(e,t,r)}return t.flags|=1,e=sa(o,l),e.ref=t.ref,e.return=t,t.child=e}function gh(e,t,a,l,r){if(e!==null){var o=e.memoizedProps;if(il(o,l)&&e.ref===t.ref)if(st=!1,t.pendingProps=l=o,rc(e,r))e.flags&131072&&(st=!0);else return t.lanes=e.lanes,Mn(e,t,r)}return ec(e,t,a,l,r)}function vh(e,t,a){var l=t.pendingProps,r=l.children,o=(t.stateNode._pendingVisibility&2)!==0,d=e!==null?e.memoizedState:null;if(vl(e,t),l.mode==="hidden"||o){if(t.flags&128){if(l=d!==null?d.baseLanes|a:a,e!==null){for(r=t.child=e.child,o=0;r!==null;)o=o|r.lanes|r.childLanes,r=r.sibling;t.childLanes=o&~l}else t.childLanes=0,t.child=null;return bh(e,t,l,a)}if(a&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Vs(t,d!==null?d.cachePool:null),d!==null?_d(t,d):Mr(),Sd(t);else return t.lanes=t.childLanes=536870912,bh(e,t,d!==null?d.baseLanes|a:a,a)}else d!==null?(Vs(t,d.cachePool),_d(t,d),Fn(),t.memoizedState=null):(e!==null&&Vs(t,null),Mr(),Fn());return ot(e,t,r,a),t.child}function bh(e,t,a,l){var r=zr();return r=r===null?null:{parent:nt._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&Vs(t,null),Mr(),Sd(t),e!==null&&bl(e,t,l,!0),null}function vl(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=2097664);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=2097664)}}function ec(e,t,a,l,r){return ja(t),a=jr(e,t,a,l,void 0,r),l=Br(),e!==null&&!st?(qr(e,t,r),Mn(e,t,r)):(Ae&&l&&wr(t),t.flags|=1,ot(e,t,a,r),t.child)}function _h(e,t,a,l,r,o){return ja(t),t.updateQueue=null,a=wd(t,l,a,r),Od(e),l=Br(),e!==null&&!st?(qr(e,t,o),Mn(e,t,o)):(Ae&&l&&wr(t),t.flags|=1,ot(e,t,a,o),t.child)}function Sh(e,t,a,l,r){if(ja(t),t.stateNode===null){var o=ci,d=a.contextType;typeof d=="object"&&d!==null&&(o=mt(d)),o=new a(l,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=Ir,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=l,o.state=t.memoizedState,o.refs={},dc(t),d=a.contextType,o.context=typeof d=="object"&&d!==null?mt(d):ci,o.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Wr(t,a,d,l),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(d=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),d!==o.state&&Ir.enqueueReplaceState(o,o.state,null),Tl(t,l,o,r),Sl(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){o=t.stateNode;var m=t.memoizedProps,v=za(a,m);o.props=v;var T=o.context,x=a.contextType;d=ci,typeof x=="object"&&x!==null&&(d=mt(x));var M=a.getDerivedStateFromProps;x=typeof M=="function"||typeof o.getSnapshotBeforeUpdate=="function",m=t.pendingProps!==m,x||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(m||T!==d)&&uh(t,o,l,d),ea=!1;var w=t.memoizedState;o.state=w,Tl(t,l,o,r),Sl(),T=t.memoizedState,m||w!==T||ea?(typeof M=="function"&&(Wr(t,a,M,l),T=t.memoizedState),(v=ea||sh(t,a,v,l,w,T,d))?(x||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=l,t.memoizedState=T),o.props=l,o.state=T,o.context=d,l=v):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{o=t.stateNode,hc(e,t),d=t.memoizedProps,x=za(a,d),o.props=x,M=t.pendingProps,w=o.context,T=a.contextType,v=ci,typeof T=="object"&&T!==null&&(v=mt(T)),m=a.getDerivedStateFromProps,(T=typeof m=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(d!==M||w!==v)&&uh(t,o,l,v),ea=!1,w=t.memoizedState,o.state=w,Tl(t,l,o,r),Sl();var R=t.memoizedState;d!==M||w!==R||ea||e!==null&&e.dependencies!==null&&Is(e.dependencies)?(typeof m=="function"&&(Wr(t,a,m,l),R=t.memoizedState),(x=ea||sh(t,a,x,l,w,R,v)||e!==null&&e.dependencies!==null&&Is(e.dependencies))?(T||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(l,R,v),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(l,R,v)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||d===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=R),o.props=l,o.state=R,o.context=v,l=x):(typeof o.componentDidUpdate!="function"||d===e.memoizedProps&&w===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&w===e.memoizedState||(t.flags|=1024),l=!1)}return o=l,vl(e,t),l=(t.flags&128)!==0,o||l?(o=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&l?(t.child=ka(t,e.child,null,r),t.child=ka(t,null,a,r)):ot(e,t,a,r),t.memoizedState=o.state,e=t.child):e=Mn(e,t,r),e}function Th(e,t,a,l){return ul(),t.flags|=256,ot(e,t,a,l),t.child}var tc={dehydrated:null,treeContext:null,retryLane:0};function nc(e){return{baseLanes:e,cachePool:Ad()}}function ac(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Qt),e}function Eh(e,t,a){var l=t.pendingProps,r=!1,o=(t.flags&128)!==0,d;if((d=o)||(d=e!==null&&e.memoizedState===null?!1:(tt.current&2)!==0),d&&(r=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ae){if(r?Jn(t):Fn(),Ae){var m=ct,v;if(v=m){e:{for(v=m,m=fn;v.nodeType!==8;){if(!m){m=null;break e}if(v=nn(v.nextSibling),v===null){m=null;break e}}m=v}m!==null?(t.memoizedState={dehydrated:m,treeContext:wa!==null?{id:wn,overflow:Rn}:null,retryLane:536870912},v=Xt(18,null,null,0),v.stateNode=m,v.return=t,t.child=v,St=t,ct=null,v=!0):v=!1}v||xa(t)}if(m=t.memoizedState,m!==null&&(m=m.dehydrated,m!==null))return m.data==="$!"?t.lanes=16:t.lanes=536870912,null;xn(t)}return m=l.children,l=l.fallback,r?(Fn(),r=t.mode,m=lc({mode:"hidden",children:m},r),l=qa(l,r,a,null),m.return=t,l.return=t,m.sibling=l,t.child=m,r=t.child,r.memoizedState=nc(a),r.childLanes=ac(e,d,a),t.memoizedState=tc,l):(Jn(t),ic(t,m))}if(v=e.memoizedState,v!==null&&(m=v.dehydrated,m!==null)){if(o)t.flags&256?(Jn(t),t.flags&=-257,t=sc(e,t,a)):t.memoizedState!==null?(Fn(),t.child=e.child,t.flags|=128,t=null):(Fn(),r=l.fallback,m=t.mode,l=lc({mode:"visible",children:l.children},m),r=qa(r,m,a,null),r.flags|=2,l.return=t,r.return=t,l.sibling=r,t.child=l,ka(t,e.child,null,a),l=t.child,l.memoizedState=nc(a),l.childLanes=ac(e,d,a),t.memoizedState=tc,t=r);else if(Jn(t),m.data==="$!"){if(d=m.nextSibling&&m.nextSibling.dataset,d)var T=d.dgst;d=T,l=Error(u(419)),l.stack="",l.digest=d,rl({value:l,source:null,stack:null}),t=sc(e,t,a)}else if(st||bl(e,t,a,!1),d=(a&e.childLanes)!==0,st||d){if(d=De,d!==null){if(l=a&-a,l&42)l=1;else switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;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:l=64;break;case 268435456:l=134217728;break;default:l=0}if(l=l&(d.suspendedLanes|a)?0:l,l!==0&&l!==v.retryLane)throw v.retryLane=l,Qn(e,l),Tt(d,e,l),yh}m.data==="$?"||zc(),t=sc(e,t,a)}else m.data==="$?"?(t.flags|=128,t.child=e.child,t=Xg.bind(null,e),m._reactRetry=t,t=null):(e=v.treeContext,ct=nn(m.nextSibling),St=t,Ae=!0,en=null,fn=!1,e!==null&&(Lt[Kt++]=wn,Lt[Kt++]=Rn,Lt[Kt++]=wa,wn=e.id,Rn=e.overflow,wa=t),t=ic(t,l.children),t.flags|=4096);return t}return r?(Fn(),r=l.fallback,m=t.mode,v=e.child,T=v.sibling,l=sa(v,{mode:"hidden",children:l.children}),l.subtreeFlags=v.subtreeFlags&31457280,T!==null?r=sa(T,r):(r=qa(r,m,a,null),r.flags|=2),r.return=t,l.return=t,l.sibling=r,t.child=l,l=r,r=t.child,m=e.child.memoizedState,m===null?m=nc(a):(v=m.cachePool,v!==null?(T=nt._currentValue,v=v.parent!==T?{parent:T,pool:T}:v):v=Ad(),m={baseLanes:m.baseLanes|a,cachePool:v}),r.memoizedState=m,r.childLanes=ac(e,d,a),t.memoizedState=tc,l):(Jn(t),a=e.child,e=a.sibling,a=sa(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function ic(e,t){return t=lc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function lc(e,t){return Jh(e,t,0,null)}function sc(e,t,a){return ka(t,e.child,null,a),e=ic(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ah(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),oc(e.return,t,a)}function uc(e,t,a,l,r){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:r}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=l,o.tail=a,o.tailMode=r)}function Oh(e,t,a){var l=t.pendingProps,r=l.revealOrder,o=l.tail;if(ot(e,t,l.children,a),l=tt.current,l&2)l=l&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&&Ah(e,a,t);else if(e.tag===19)Ah(e,a,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}l&=1}switch(je(tt,l),r){case"forwards":for(a=t.child,r=null;a!==null;)e=a.alternate,e!==null&&Hs(e)===null&&(r=a),a=a.sibling;a=r,a===null?(r=t.child,t.child=null):(r=a.sibling,a.sibling=null),uc(t,!1,r,a,o);break;case"backwards":for(a=null,r=t.child,t.child=null;r!==null;){if(e=r.alternate,e!==null&&Hs(e)===null){t.child=r;break}e=r.sibling,r.sibling=a,a=r,r=e}uc(t,!0,a,null,o);break;case"together":uc(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Mn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,!(a&t.childLanes))if(e!==null){if(bl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=sa(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=sa(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function rc(e,t){return e.lanes&t?!0:(e=e.dependencies,!!(e!==null&&Is(e)))}function Dg(e,t,a){switch(t.tag){case 3:ys(t,t.stateNode.containerInfo),Pn(t,nt,e.memoizedState.cache),ul();break;case 27:case 5:Iu(t);break;case 4:ys(t,t.stateNode.containerInfo);break;case 10:Pn(t,t.type,t.memoizedProps.value);break;case 13:var l=t.memoizedState;if(l!==null)return l.dehydrated!==null?(Jn(t),t.flags|=128,null):a&t.child.childLanes?Eh(e,t,a):(Jn(t),e=Mn(e,t,a),e!==null?e.sibling:null);Jn(t);break;case 19:var r=(e.flags&128)!==0;if(l=(a&t.childLanes)!==0,l||(bl(e,t,a,!1),l=(a&t.childLanes)!==0),r){if(l)return Oh(e,t,a);t.flags|=128}if(r=t.memoizedState,r!==null&&(r.rendering=null,r.tail=null,r.lastEffect=null),je(tt,tt.current),l)break;return null;case 22:case 23:return t.lanes=0,vh(e,t,a);case 24:Pn(t,nt,e.memoizedState.cache)}return Mn(e,t,a)}function wh(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)st=!0;else{if(!rc(e,a)&&!(t.flags&128))return st=!1,Dg(e,t,a);st=!!(e.flags&131072)}else st=!1,Ae&&t.flags&1048576&&od(t,Us,t.index);switch(t.lanes=0,t.tag){case 16:e:{e=t.pendingProps;var l=t.elementType,r=l._init;if(l=r(l._payload),t.type=l,typeof l=="function")Tc(l)?(e=za(l,e),t.tag=1,t=Sh(null,t,l,e,a)):(t.tag=0,t=ec(null,t,l,e,a));else{if(l!=null){if(r=l.$$typeof,r===Y){t.tag=11,t=mh(null,t,l,e,a);break e}else if(r===ye){t.tag=14,t=ph(null,t,l,e,a);break e}}throw t=W(l)||l,Error(u(306,t,""))}}return t;case 0:return ec(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,r=za(l,t.pendingProps),Sh(e,t,l,r,a);case 3:e:{if(ys(t,t.stateNode.containerInfo),e===null)throw Error(u(387));var o=t.pendingProps;r=t.memoizedState,l=r.element,hc(e,t),Tl(t,o,null,a);var d=t.memoizedState;if(o=d.cache,Pn(t,nt,o),o!==r.cache&&fc(t,[nt],a,!0),Sl(),o=d.element,r.isDehydrated)if(r={element:o,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Th(e,t,o,a);break e}else if(o!==l){l=Vt(Error(u(424)),t),rl(l),t=Th(e,t,o,a);break e}else for(ct=nn(t.stateNode.containerInfo.firstChild),St=t,Ae=!0,en=null,fn=!0,a=bd(t,null,o,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(ul(),o===l){t=Mn(e,t,a);break e}ot(e,t,o,a)}t=t.child}return t;case 26:return vl(e,t),e===null?(a=ky(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ae||(a=t.type,e=t.pendingProps,l=yu(Yn.current).createElement(a),l[yt]=t,l[Ot]=e,ft(l,a,e),lt(l),t.stateNode=l):t.memoizedState=ky(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Iu(t),e===null&&Ae&&(l=t.stateNode=wy(t.type,t.pendingProps,Yn.current),St=t,fn=!0,ct=nn(l.firstChild)),l=t.pendingProps.children,e!==null||Ae?ot(e,t,l,a):t.child=ka(t,null,l,a),vl(e,t),t.child;case 5:return e===null&&Ae&&((r=l=ct)&&(l=cv(l,t.type,t.pendingProps,fn),l!==null?(t.stateNode=l,St=t,ct=nn(l.firstChild),fn=!1,r=!0):r=!1),r||xa(t)),Iu(t),r=t.type,o=t.pendingProps,d=e!==null?e.memoizedProps:null,l=o.children,Qc(r,o)?l=null:d!==null&&Qc(r,d)&&(t.flags|=32),t.memoizedState!==null&&(r=jr(e,t,wg,null,null,a),Bl._currentValue=r),vl(e,t),ot(e,t,l,a),t.child;case 6:return e===null&&Ae&&((e=a=ct)&&(a=ov(a,t.pendingProps,fn),a!==null?(t.stateNode=a,St=t,ct=null,e=!0):e=!1),e||xa(t)),null;case 13:return Eh(e,t,a);case 4:return ys(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=ka(t,null,l,a):ot(e,t,l,a),t.child;case 11:return mh(e,t,t.type,t.pendingProps,a);case 7:return ot(e,t,t.pendingProps,a),t.child;case 8:return ot(e,t,t.pendingProps.children,a),t.child;case 12:return ot(e,t,t.pendingProps.children,a),t.child;case 10:return l=t.pendingProps,Pn(t,t.type,l.value),ot(e,t,l.children,a),t.child;case 9:return r=t.type._context,l=t.pendingProps.children,ja(t),r=mt(r),l=l(r),t.flags|=1,ot(e,t,l,a),t.child;case 14:return ph(e,t,t.type,t.pendingProps,a);case 15:return gh(e,t,t.type,t.pendingProps,a);case 19:return Oh(e,t,a);case 22:return vh(e,t,a);case 24:return ja(t),l=mt(nt),e===null?(r=zr(),r===null&&(r=De,o=Cr(),r.pooledCache=o,o.refCount++,o!==null&&(r.pooledCacheLanes|=a),r=o),t.memoizedState={parent:l,cache:r},dc(t),Pn(t,nt,r)):(e.lanes&a&&(hc(e,t),Tl(t,null,null,a),Sl()),r=e.memoizedState,o=t.memoizedState,r.parent!==l?(r={parent:l,cache:l},t.memoizedState=r,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=r),Pn(t,nt,l)):(l=o.cache,Pn(t,nt,l),l!==r.cache&&fc(t,[nt],a,!0))),ot(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}var cc=Re(null),Ua=null,Nn=null;function Pn(e,t,a){je(cc,t._currentValue),t._currentValue=a}function Cn(e){e._currentValue=cc.current,Qe(cc)}function oc(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function fc(e,t,a,l){var r=e.child;for(r!==null&&(r.return=e);r!==null;){var o=r.dependencies;if(o!==null){var d=r.child;o=o.firstContext;e:for(;o!==null;){var m=o;o=r;for(var v=0;v<t.length;v++)if(m.context===t[v]){o.lanes|=a,m=o.alternate,m!==null&&(m.lanes|=a),oc(o.return,a,e),l||(d=null);break e}o=m.next}}else if(r.tag===18){if(d=r.return,d===null)throw Error(u(341));d.lanes|=a,o=d.alternate,o!==null&&(o.lanes|=a),oc(d,a,e),d=null}else d=r.child;if(d!==null)d.return=r;else for(d=r;d!==null;){if(d===e){d=null;break}if(r=d.sibling,r!==null){r.return=d.return,d=r;break}d=d.return}r=d}}function bl(e,t,a,l){e=null;for(var r=t,o=!1;r!==null;){if(!o){if(r.flags&524288)o=!0;else if(r.flags&262144)break}if(r.tag===10){var d=r.alternate;if(d===null)throw Error(u(387));if(d=d.memoizedProps,d!==null){var m=r.type;Mt(r.pendingProps.value,d.value)||(e!==null?e.push(m):e=[m])}}else if(r===hs.current){if(d=r.alternate,d===null)throw Error(u(387));d.memoizedState.memoizedState!==r.memoizedState.memoizedState&&(e!==null?e.push(Bl):e=[Bl])}r=r.return}e!==null&&fc(t,e,a,l),t.flags|=262144}function Is(e){for(e=e.firstContext;e!==null;){if(!Mt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ja(e){Ua=e,Nn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Rh(Ua,e)}function Ps(e,t){return Ua===null&&ja(e),Rh(e,t)}function Rh(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Nn===null){if(e===null)throw Error(u(308));Nn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Nn=Nn.next=t;return a}var ea=!1;function dc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function hc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ta(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function na(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,Ze&2){var r=l.pending;return r===null?t.next=t:(t.next=r.next,r.next=t),l.pending=t,t=Ds(e),rd(e,null,a),t}return Cs(e,l,t,a),Ds(e)}function _l(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194176)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,pf(e,a)}}function yc(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var r=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?r=o=d:o=o.next=d,a=a.next}while(a!==null);o===null?r=o=t:o=o.next=t}else r=o=t;a={baseState:l.baseState,firstBaseUpdate:r,lastBaseUpdate:o,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var mc=!1;function Sl(){if(mc){var e=mi;if(e!==null)throw e}}function Tl(e,t,a,l){mc=!1;var r=e.updateQueue;ea=!1;var o=r.firstBaseUpdate,d=r.lastBaseUpdate,m=r.shared.pending;if(m!==null){r.shared.pending=null;var v=m,T=v.next;v.next=null,d===null?o=T:d.next=T,d=v;var x=e.alternate;x!==null&&(x=x.updateQueue,m=x.lastBaseUpdate,m!==d&&(m===null?x.firstBaseUpdate=T:m.next=T,x.lastBaseUpdate=v))}if(o!==null){var M=r.baseState;d=0,x=T=v=null,m=o;do{var w=m.lane&-536870913,R=w!==m.lane;if(R?(Se&w)===w:(l&w)===w){w!==0&&w===yi&&(mc=!0),x!==null&&(x=x.next={lane:0,tag:m.tag,payload:m.payload,callback:null,next:null});e:{var J=e,le=m;w=t;var Ye=a;switch(le.tag){case 1:if(J=le.payload,typeof J=="function"){M=J.call(Ye,M,w);break e}M=J;break e;case 3:J.flags=J.flags&-65537|128;case 0:if(J=le.payload,w=typeof J=="function"?J.call(Ye,M,w):J,w==null)break e;M=X({},M,w);break e;case 2:ea=!0}}w=m.callback,w!==null&&(e.flags|=64,R&&(e.flags|=8192),R=r.callbacks,R===null?r.callbacks=[w]:R.push(w))}else R={lane:w,tag:m.tag,payload:m.payload,callback:m.callback,next:null},x===null?(T=x=R,v=M):x=x.next=R,d|=w;if(m=m.next,m===null){if(m=r.shared.pending,m===null)break;R=m,m=R.next,R.next=null,r.lastBaseUpdate=R,r.shared.pending=null}}while(!0);x===null&&(v=M),r.baseState=v,r.firstBaseUpdate=T,r.lastBaseUpdate=x,o===null&&(r.shared.lanes=0),ua|=d,e.lanes=d,e.memoizedState=M}}function xh(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function kh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)xh(a[e],t)}function El(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var r=l.next;a=r;do{if((a.tag&e)===e){l=void 0;var o=a.create,d=a.inst;l=o(),d.destroy=l}a=a.next}while(a!==r)}}catch(m){Ne(t,t.return,m)}}function aa(e,t,a){try{var l=t.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var o=r.next;l=o;do{if((l.tag&e)===e){var d=l.inst,m=d.destroy;if(m!==void 0){d.destroy=void 0,r=t;var v=a;try{m()}catch(T){Ne(r,v,T)}}}l=l.next}while(l!==o)}}catch(T){Ne(t,t.return,T)}}function Mh(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{kh(t,a)}catch(l){Ne(e,e.return,l)}}}function Nh(e,t,a){a.props=za(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ne(e,t,l)}}function Ba(e,t){try{var a=e.ref;if(a!==null){var l=e.stateNode;switch(e.tag){case 26:case 27:case 5:var r=l;break;default:r=l}typeof a=="function"?e.refCleanup=a(r):a.current=r}}catch(o){Ne(e,t,o)}}function Nt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(r){Ne(e,t,r)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(r){Ne(e,t,r)}else a.current=null}function Ch(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(r){Ne(e,e.return,r)}}function Dh(e,t,a){try{var l=e.stateNode;iv(l,e.type,a,t),l[Ot]=t}catch(r){Ne(e,e.return,r)}}function zh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27||e.tag===4}function pc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||zh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==27&&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 gc(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.nodeType===8?a.parentNode.insertBefore(e,t):a.insertBefore(e,t):(a.nodeType===8?(t=a.parentNode,t.insertBefore(e,a)):(t=a,t.appendChild(e)),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=hu));else if(l!==4&&l!==27&&(e=e.child,e!==null))for(gc(e,t,a),e=e.sibling;e!==null;)gc(e,t,a),e=e.sibling}function eu(e,t,a){var l=e.tag;if(l===5||l===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(l!==4&&l!==27&&(e=e.child,e!==null))for(eu(e,t,a),e=e.sibling;e!==null;)eu(e,t,a),e=e.sibling}var Dn=!1,Le=!1,vc=!1,Uh=typeof WeakSet=="function"?WeakSet:Set,ut=null,jh=!1;function zg(e,t){if(e=e.containerInfo,$c=_u,e=Pf(e),_r(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var r=l.anchorOffset,o=l.focusNode;l=l.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var d=0,m=-1,v=-1,T=0,x=0,M=e,w=null;t:for(;;){for(var R;M!==a||r!==0&&M.nodeType!==3||(m=d+r),M!==o||l!==0&&M.nodeType!==3||(v=d+l),M.nodeType===3&&(d+=M.nodeValue.length),(R=M.firstChild)!==null;)w=M,M=R;for(;;){if(M===e)break t;if(w===a&&++T===r&&(m=d),w===o&&++x===l&&(v=d),(R=M.nextSibling)!==null)break;M=w,w=M.parentNode}M=R}a=m===-1||v===-1?null:{start:m,end:v}}else a=null}a=a||{start:0,end:0}}else a=null;for(Xc={focusedElem:e,selectionRange:a},_u=!1,ut=t;ut!==null;)if(t=ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ut=e;else for(;ut!==null;){switch(t=ut,o=t.alternate,e=t.flags,t.tag){case 0:break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,a=t,r=o.memoizedProps,o=o.memoizedState,l=a.stateNode;try{var J=za(a.type,r,a.elementType===a.type);e=l.getSnapshotBeforeUpdate(J,o),l.__reactInternalSnapshotBeforeUpdate=e}catch(le){Ne(a,a.return,le)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Wc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Wc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,ut=e;break}ut=t.return}return J=jh,jh=!1,J}function Bh(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Un(e,a),l&4&&El(5,a);break;case 1:if(Un(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(m){Ne(a,a.return,m)}else{var r=za(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}catch(m){Ne(a,a.return,m)}}l&64&&Mh(a),l&512&&Ba(a,a.return);break;case 3:if(Un(e,a),l&64&&(l=a.updateQueue,l!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{kh(l,e)}catch(m){Ne(a,a.return,m)}}break;case 26:Un(e,a),l&512&&Ba(a,a.return);break;case 27:case 5:Un(e,a),t===null&&l&4&&Ch(a),l&512&&Ba(a,a.return);break;case 12:Un(e,a);break;case 13:Un(e,a),l&4&&Hh(e,a);break;case 22:if(r=a.memoizedState!==null||Dn,!r){t=t!==null&&t.memoizedState!==null||Le;var o=Dn,d=Le;Dn=r,(Le=t)&&!d?ia(e,a,(a.subtreeFlags&8772)!==0):Un(e,a),Dn=o,Le=d}l&512&&(a.memoizedProps.mode==="manual"?Ba(a,a.return):Nt(a,a.return));break;default:Un(e,a)}}function qh(e){var t=e.alternate;t!==null&&(e.alternate=null,qh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ir(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var We=null,Ct=!1;function zn(e,t,a){for(a=a.child;a!==null;)Zh(e,t,a),a=a.sibling}function Zh(e,t,a){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount($i,a)}catch{}switch(a.tag){case 26:Le||Nt(a,t),zn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Le||Nt(a,t);var l=We,r=Ct;for(We=a.stateNode,zn(e,t,a),a=a.stateNode,t=a.attributes;t.length;)a.removeAttributeNode(t[0]);ir(a),We=l,Ct=r;break;case 5:Le||Nt(a,t);case 6:r=We;var o=Ct;if(We=null,zn(e,t,a),We=r,Ct=o,We!==null)if(Ct)try{e=We,l=a.stateNode,e.nodeType===8?e.parentNode.removeChild(l):e.removeChild(l)}catch(d){Ne(a,t,d)}else try{We.removeChild(a.stateNode)}catch(d){Ne(a,t,d)}break;case 18:We!==null&&(Ct?(t=We,a=a.stateNode,t.nodeType===8?Fc(t.parentNode,a):t.nodeType===1&&Fc(t,a),Vl(t)):Fc(We,a.stateNode));break;case 4:l=We,r=Ct,We=a.stateNode.containerInfo,Ct=!0,zn(e,t,a),We=l,Ct=r;break;case 0:case 11:case 14:case 15:Le||aa(2,a,t),Le||aa(4,a,t),zn(e,t,a);break;case 1:Le||(Nt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&Nh(a,t,l)),zn(e,t,a);break;case 21:zn(e,t,a);break;case 22:Le||Nt(a,t),Le=(l=Le)||a.memoizedState!==null,zn(e,t,a),Le=l;break;default:zn(e,t,a)}}function Hh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vl(e)}catch(a){Ne(t,t.return,a)}}function Ug(e){switch(e.tag){case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Uh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Uh),t;default:throw Error(u(435,e.tag))}}function bc(e,t){var a=Ug(e);t.forEach(function(l){var r=Qg.bind(null,e,l);a.has(l)||(a.add(l),l.then(r,r))})}function Gt(e,t){var a=t.deletions;if(a!==null)for(var l=0;l<a.length;l++){var r=a[l],o=e,d=t,m=d;e:for(;m!==null;){switch(m.tag){case 27:case 5:We=m.stateNode,Ct=!1;break e;case 3:We=m.stateNode.containerInfo,Ct=!0;break e;case 4:We=m.stateNode.containerInfo,Ct=!0;break e}m=m.return}if(We===null)throw Error(u(160));Zh(o,d,r),We=null,Ct=!1,o=r.alternate,o!==null&&(o.return=null),r.return=null}if(t.subtreeFlags&13878)for(t=t.child;t!==null;)Vh(t,e),t=t.sibling}var tn=null;function Vh(e,t){var a=e.alternate,l=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),$t(e),l&4&&(aa(3,e,e.return),El(3,e),aa(5,e,e.return));break;case 1:Gt(t,e),$t(e),l&512&&(Le||a===null||Nt(a,a.return)),l&64&&Dn&&(e=e.updateQueue,e!==null&&(l=e.callbacks,l!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var r=tn;if(Gt(t,e),$t(e),l&512&&(Le||a===null||Nt(a,a.return)),l&4){var o=a!==null?a.memoizedState:null;if(l=e.memoizedState,a===null)if(l===null)if(e.stateNode===null){e:{l=e.type,a=e.memoizedProps,r=r.ownerDocument||r;t:switch(l){case"title":o=r.getElementsByTagName("title")[0],(!o||o[Ji]||o[yt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=r.createElement(l),r.head.insertBefore(o,r.querySelector("head > title"))),ft(o,l,a),o[yt]=e,lt(o),l=o;break e;case"link":var d=Cy("link","href",r).get(l+(a.href||""));if(d){for(var m=0;m<d.length;m++)if(o=d[m],o.getAttribute("href")===(a.href==null?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){d.splice(m,1);break t}}o=r.createElement(l),ft(o,l,a),r.head.appendChild(o);break;case"meta":if(d=Cy("meta","content",r).get(l+(a.content||""))){for(m=0;m<d.length;m++)if(o=d[m],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){d.splice(m,1);break t}}o=r.createElement(l),ft(o,l,a),r.head.appendChild(o);break;default:throw Error(u(468,l))}o[yt]=e,lt(o),l=o}e.stateNode=l}else Dy(r,e.type,e.stateNode);else e.stateNode=Ny(r,l,e.memoizedProps);else o!==l?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,l===null?Dy(r,e.type,e.stateNode):Ny(r,l,e.memoizedProps)):l===null&&e.stateNode!==null&&Dh(e,e.memoizedProps,a.memoizedProps)}break;case 27:if(l&4&&e.alternate===null){r=e.stateNode,o=e.memoizedProps;try{for(var v=r.firstChild;v;){var T=v.nextSibling,x=v.nodeName;v[Ji]||x==="HEAD"||x==="BODY"||x==="SCRIPT"||x==="STYLE"||x==="LINK"&&v.rel.toLowerCase()==="stylesheet"||r.removeChild(v),v=T}for(var M=e.type,w=r.attributes;w.length;)r.removeAttributeNode(w[0]);ft(r,M,o),r[yt]=e,r[Ot]=o}catch(J){Ne(e,e.return,J)}}case 5:if(Gt(t,e),$t(e),l&512&&(Le||a===null||Nt(a,a.return)),e.flags&32){r=e.stateNode;try{ni(r,"")}catch(J){Ne(e,e.return,J)}}l&4&&e.stateNode!=null&&(r=e.memoizedProps,Dh(e,r,a!==null?a.memoizedProps:r)),l&1024&&(vc=!0);break;case 6:if(Gt(t,e),$t(e),l&4){if(e.stateNode===null)throw Error(u(162));l=e.memoizedProps,a=e.stateNode;try{a.nodeValue=l}catch(J){Ne(e,e.return,J)}}break;case 3:if(gu=null,r=tn,tn=mu(t.containerInfo),Gt(t,e),tn=r,$t(e),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(J){Ne(e,e.return,J)}vc&&(vc=!1,Lh(e));break;case 4:l=tn,tn=mu(e.stateNode.containerInfo),Gt(t,e),$t(e),tn=l;break;case 12:Gt(t,e),$t(e);break;case 13:Gt(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(xc=on()),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bc(e,l)));break;case 22:if(l&512&&(Le||a===null||Nt(a,a.return)),v=e.memoizedState!==null,T=a!==null&&a.memoizedState!==null,x=Dn,M=Le,Dn=x||v,Le=M||T,Gt(t,e),Le=M,Dn=x,$t(e),t=e.stateNode,t._current=e,t._visibility&=-3,t._visibility|=t._pendingVisibility&2,l&8192&&(t._visibility=v?t._visibility&-2:t._visibility|1,v&&(t=Dn||Le,a===null||T||t||bi(e)),e.memoizedProps===null||e.memoizedProps.mode!=="manual"))e:for(a=null,t=e;;){if(t.tag===5||t.tag===26||t.tag===27){if(a===null){T=a=t;try{if(r=T.stateNode,v)o=r.style,typeof o.setProperty=="function"?o.setProperty("display","none","important"):o.display="none";else{d=T.stateNode,m=T.memoizedProps.style;var R=m!=null&&m.hasOwnProperty("display")?m.display:null;d.style.display=R==null||typeof R=="boolean"?"":(""+R).trim()}}catch(J){Ne(T,T.return,J)}}}else if(t.tag===6){if(a===null){T=t;try{T.stateNode.nodeValue=v?"":T.memoizedProps}catch(J){Ne(T,T.return,J)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}l&4&&(l=e.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,bc(e,a))));break;case 19:Gt(t,e),$t(e),l&4&&(l=e.updateQueue,l!==null&&(e.updateQueue=null,bc(e,l)));break;case 21:break;default:Gt(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{if(e.tag!==27){e:{for(var a=e.return;a!==null;){if(zh(a)){var l=a;break e}a=a.return}throw Error(u(160))}switch(l.tag){case 27:var r=l.stateNode,o=pc(e);eu(e,o,r);break;case 5:var d=l.stateNode;l.flags&32&&(ni(d,""),l.flags&=-33);var m=pc(e);eu(e,m,d);break;case 3:case 4:var v=l.stateNode.containerInfo,T=pc(e);gc(e,T,v);break;default:throw Error(u(161))}}}catch(x){Ne(e,e.return,x)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Lh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Lh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Un(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Bh(e,t.alternate,t),t=t.sibling}function bi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:aa(4,t,t.return),bi(t);break;case 1:Nt(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Nh(t,t.return,a),bi(t);break;case 26:case 27:case 5:Nt(t,t.return),bi(t);break;case 22:Nt(t,t.return),t.memoizedState===null&&bi(t);break;default:bi(t)}e=e.sibling}}function ia(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var l=t.alternate,r=e,o=t,d=o.flags;switch(o.tag){case 0:case 11:case 15:ia(r,o,a),El(4,o);break;case 1:if(ia(r,o,a),l=o,r=l.stateNode,typeof r.componentDidMount=="function")try{r.componentDidMount()}catch(T){Ne(l,l.return,T)}if(l=o,r=l.updateQueue,r!==null){var m=l.stateNode;try{var v=r.shared.hiddenCallbacks;if(v!==null)for(r.shared.hiddenCallbacks=null,r=0;r<v.length;r++)xh(v[r],m)}catch(T){Ne(l,l.return,T)}}a&&d&64&&Mh(o),Ba(o,o.return);break;case 26:case 27:case 5:ia(r,o,a),a&&l===null&&d&4&&Ch(o),Ba(o,o.return);break;case 12:ia(r,o,a);break;case 13:ia(r,o,a),a&&d&4&&Hh(r,o);break;case 22:o.memoizedState===null&&ia(r,o,a),Ba(o,o.return);break;default:ia(r,o,a)}t=t.sibling}}function _c(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&hl(a))}function Sc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hl(e))}function la(e,t,a,l){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Kh(e,t,a,l),t=t.sibling}function Kh(e,t,a,l){var r=t.flags;switch(t.tag){case 0:case 11:case 15:la(e,t,a,l),r&2048&&El(9,t);break;case 3:la(e,t,a,l),r&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&hl(e)));break;case 12:if(r&2048){la(e,t,a,l),e=t.stateNode;try{var o=t.memoizedProps,d=o.id,m=o.onPostCommit;typeof m=="function"&&m(d,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(v){Ne(t,t.return,v)}}else la(e,t,a,l);break;case 23:break;case 22:o=t.stateNode,t.memoizedState!==null?o._visibility&4?la(e,t,a,l):Al(e,t):o._visibility&4?la(e,t,a,l):(o._visibility|=4,_i(e,t,a,l,(t.subtreeFlags&10256)!==0)),r&2048&&_c(t.alternate,t);break;case 24:la(e,t,a,l),r&2048&&Sc(t.alternate,t);break;default:la(e,t,a,l)}}function _i(e,t,a,l,r){for(r=r&&(t.subtreeFlags&10256)!==0,t=t.child;t!==null;){var o=e,d=t,m=a,v=l,T=d.flags;switch(d.tag){case 0:case 11:case 15:_i(o,d,m,v,r),El(8,d);break;case 23:break;case 22:var x=d.stateNode;d.memoizedState!==null?x._visibility&4?_i(o,d,m,v,r):Al(o,d):(x._visibility|=4,_i(o,d,m,v,r)),r&&T&2048&&_c(d.alternate,d);break;case 24:_i(o,d,m,v,r),r&&T&2048&&Sc(d.alternate,d);break;default:_i(o,d,m,v,r)}t=t.sibling}}function Al(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,r=l.flags;switch(l.tag){case 22:Al(a,l),r&2048&&_c(l.alternate,l);break;case 24:Al(a,l),r&2048&&Sc(l.alternate,l);break;default:Al(a,l)}t=t.sibling}}var Ol=8192;function Si(e){if(e.subtreeFlags&Ol)for(e=e.child;e!==null;)Yh(e),e=e.sibling}function Yh(e){switch(e.tag){case 26:Si(e),e.flags&Ol&&e.memoizedState!==null&&Ev(tn,e.memoizedState,e.memoizedProps);break;case 5:Si(e);break;case 3:case 4:var t=tn;tn=mu(e.stateNode.containerInfo),Si(e),tn=t;break;case 22:e.memoizedState===null&&(t=e.alternate,t!==null&&t.memoizedState!==null?(t=Ol,Ol=16777216,Si(e),Ol=t):Si(e));break;default:Si(e)}}function Gh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function wl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];ut=l,Xh(l,e)}Gh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$h(e),e=e.sibling}function $h(e){switch(e.tag){case 0:case 11:case 15:wl(e),e.flags&2048&&aa(9,e,e.return);break;case 3:wl(e);break;case 12:wl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&4&&(e.return===null||e.return.tag!==13)?(t._visibility&=-5,tu(e)):wl(e);break;default:wl(e)}}function tu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];ut=l,Xh(l,e)}Gh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:aa(8,t,t.return),tu(t);break;case 22:a=t.stateNode,a._visibility&4&&(a._visibility&=-5,tu(t));break;default:tu(t)}e=e.sibling}}function Xh(e,t){for(;ut!==null;){var a=ut;switch(a.tag){case 0:case 11:case 15:aa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:hl(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,ut=l;else e:for(a=e;ut!==null;){l=ut;var r=l.sibling,o=l.return;if(qh(l),l===a){ut=null;break e}if(r!==null){r.return=o,ut=r;break e}ut=o}}}function jg(e,t,a,l){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Xt(e,t,a,l){return new jg(e,t,a,l)}function Tc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sa(e,t){var a=e.alternate;return a===null?(a=Xt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&31457280,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Qh(e,t){e.flags&=31457282;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function nu(e,t,a,l,r,o){var d=0;if(l=e,typeof e=="function")Tc(e)&&(d=1);else if(typeof e=="string")d=Sv(e,a,cn.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case p:return qa(a.children,r,o,t);case g:d=8,r|=24;break;case _:return e=Xt(12,a,t,r|2),e.elementType=_,e.lanes=o,e;case K:return e=Xt(13,a,t,r),e.elementType=K,e.lanes=o,e;case ge:return e=Xt(19,a,t,r),e.elementType=ge,e.lanes=o,e;case Be:return Jh(a,r,o,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:case U:d=10;break e;case C:d=9;break e;case Y:d=11;break e;case ye:d=14;break e;case fe:d=16,l=null;break e}d=29,a=Error(u(130,e===null?"null":typeof e,"")),l=null}return t=Xt(d,a,t,r),t.elementType=e,t.type=l,t.lanes=o,t}function qa(e,t,a,l){return e=Xt(7,e,l,t),e.lanes=a,e}function Jh(e,t,a,l){e=Xt(22,e,l,t),e.elementType=Be,e.lanes=a;var r={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var o=r._current;if(o===null)throw Error(u(456));if(!(r._pendingVisibility&2)){var d=Qn(o,2);d!==null&&(r._pendingVisibility|=2,Tt(d,o,2))}},attach:function(){var o=r._current;if(o===null)throw Error(u(456));if(r._pendingVisibility&2){var d=Qn(o,2);d!==null&&(r._pendingVisibility&=-3,Tt(d,o,2))}}};return e.stateNode=r,e}function Ec(e,t,a){return e=Xt(6,e,null,t),e.lanes=a,e}function Ac(e,t,a){return t=Xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function jn(e){e.flags|=4}function Fh(e,t){if(t.type!=="stylesheet"||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!zy(t)){if(t=Yt.current,t!==null&&((Se&4194176)===Se?dn!==null:(Se&62914560)!==Se&&!(Se&536870912)||t!==dn))throw ol=kr,hd;e.flags|=8192}}function au(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yf():536870912,e.lanes|=t,Ei|=t)}function Rl(e,t){if(!Ae)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null}}function qe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags&31457280,l|=r.flags&31457280,r.return=e,r=r.sibling;else for(r=e.child;r!==null;)a|=r.lanes|r.childLanes,l|=r.subtreeFlags,l|=r.flags,r.return=e,r=r.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function Bg(e,t,a){var l=t.pendingProps;switch(Rr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qe(t),null;case 1:return qe(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),Cn(nt),Fa(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(sl(t)?jn(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,en!==null&&(Cc(en),en=null))),qe(t),null;case 26:return a=t.memoizedState,e===null?(jn(t),a!==null?(qe(t),Fh(t,a)):(qe(t),t.flags&=-16777217)):a?a!==e.memoizedState?(jn(t),qe(t),Fh(t,a)):(qe(t),t.flags&=-16777217):(e.memoizedProps!==l&&jn(t),qe(t),t.flags&=-16777217),null;case 27:ms(t),a=Yn.current;var r=t.type;if(e!==null&&t.stateNode!=null)e.memoizedProps!==l&&jn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return qe(t),null}e=cn.current,sl(t)?fd(t):(e=wy(r,l,a),t.stateNode=e,jn(t))}return qe(t),null;case 5:if(ms(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&jn(t);else{if(!l){if(t.stateNode===null)throw Error(u(166));return qe(t),null}if(e=cn.current,sl(t))fd(t);else{switch(r=yu(Yn.current),e){case 1:e=r.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:e=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":e=r.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":e=r.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":e=r.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild);break;case"select":e=typeof l.is=="string"?r.createElement("select",{is:l.is}):r.createElement("select"),l.multiple?e.multiple=!0:l.size&&(e.size=l.size);break;default:e=typeof l.is=="string"?r.createElement(a,{is:l.is}):r.createElement(a)}}e[yt]=t,e[Ot]=l;e:for(r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.tag!==27&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break e;for(;r.sibling===null;){if(r.return===null||r.return===t)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}t.stateNode=e;e:switch(ft(e,a,l),a){case"button":case"input":case"select":case"textarea":e=!!l.autoFocus;break e;case"img":e=!0;break e;default:e=!1}e&&jn(t)}}return qe(t),t.flags&=-16777217,null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&jn(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(u(166));if(e=Yn.current,sl(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,r=St,r!==null)switch(r.tag){case 27:case 5:l=r.memoizedProps}e[yt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||_y(e.nodeValue,a)),e||xa(t)}else e=yu(e).createTextNode(l),e[yt]=t,t.stateNode=e}return qe(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(r=sl(t),l!==null&&l.dehydrated!==null){if(e===null){if(!r)throw Error(u(318));if(r=t.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(u(317));r[yt]=t}else ul(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;qe(t),r=!1}else en!==null&&(Cc(en),en=null),r=!0;if(!r)return t.flags&256?(xn(t),t):(xn(t),null)}if(xn(t),t.flags&128)return t.lanes=a,t;if(a=l!==null,e=e!==null&&e.memoizedState!==null,a){l=t.child,r=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(r=l.alternate.memoizedState.cachePool.pool);var o=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(o=l.memoizedState.cachePool.pool),o!==r&&(l.flags|=2048)}return a!==e&&a&&(t.child.flags|=8192),au(t,t.updateQueue),qe(t),null;case 4:return Fa(),e===null&&Kc(t.stateNode.containerInfo),qe(t),null;case 10:return Cn(t.type),qe(t),null;case 19:if(Qe(tt),r=t.memoizedState,r===null)return qe(t),null;if(l=(t.flags&128)!==0,o=r.rendering,o===null)if(l)Rl(r,!1);else{if(Ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Hs(e),o!==null){for(t.flags|=128,Rl(r,!1),e=o.updateQueue,t.updateQueue=e,au(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Qh(a,e),a=a.sibling;return je(tt,tt.current&1|2),t.child}e=e.sibling}r.tail!==null&&on()>iu&&(t.flags|=128,l=!0,Rl(r,!1),t.lanes=4194304)}else{if(!l)if(e=Hs(o),e!==null){if(t.flags|=128,l=!0,e=e.updateQueue,t.updateQueue=e,au(t,e),Rl(r,!0),r.tail===null&&r.tailMode==="hidden"&&!o.alternate&&!Ae)return qe(t),null}else 2*on()-r.renderingStartTime>iu&&a!==536870912&&(t.flags|=128,l=!0,Rl(r,!1),t.lanes=4194304);r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e!==null?e.sibling=o:t.child=o,r.last=o)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=on(),t.sibling=null,e=tt.current,je(tt,l?e&1|2:e&1),t):(qe(t),null);case 22:case 23:return xn(t),Nr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?a&536870912&&!(t.flags&128)&&(qe(t),t.subtreeFlags&6&&(t.flags|=8192)):qe(t),a=t.updateQueue,a!==null&&au(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&Qe(Ma),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Cn(nt),qe(t),null;case 25:return null}throw Error(u(156,t.tag))}function qg(e,t){switch(Rr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(nt),Fa(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ms(t),null;case 13:if(xn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));ul()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Qe(tt),null;case 4:return Fa(),null;case 10:return Cn(t.type),null;case 22:case 23:return xn(t),Nr(),e!==null&&Qe(Ma),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cn(nt),null;case 25:return null;default:return null}}function Wh(e,t){switch(Rr(t),t.tag){case 3:Cn(nt),Fa();break;case 26:case 27:case 5:ms(t);break;case 4:Fa();break;case 13:xn(t);break;case 19:Qe(tt);break;case 10:Cn(t.type);break;case 22:case 23:xn(t),Nr(),e!==null&&Qe(Ma);break;case 24:Cn(nt)}}var Zg={getCacheForType:function(e){var t=mt(nt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a}},Hg=typeof WeakMap=="function"?WeakMap:Map,Ze=0,De=null,pe=null,Se=0,ze=0,Dt=null,Bn=!1,Ti=!1,Oc=!1,qn=0,Ke=0,ua=0,Za=0,wc=0,Qt=0,Ei=0,xl=null,yn=null,Rc=!1,xc=0,iu=1/0,lu=null,ra=null,su=!1,Ha=null,kl=0,kc=0,Mc=null,Ml=0,Nc=null;function zt(){if(Ze&2&&Se!==0)return Se&-Se;if(j.T!==null){var e=yi;return e!==0?e:Zc()}return vf()}function Ih(){Qt===0&&(Qt=!(Se&536870912)||Ae?hf():536870912);var e=Yt.current;return e!==null&&(e.flags|=32),Qt}function Tt(e,t,a){(e===De&&ze===2||e.cancelPendingCommit!==null)&&(Ai(e,0),Zn(e,Se,Qt,!1)),Qi(e,a),(!(Ze&2)||e!==De)&&(e===De&&(!(Ze&2)&&(Za|=a),Ke===4&&Zn(e,Se,Qt,!1)),mn(e))}function Ph(e,t,a){if(Ze&6)throw Error(u(327));var l=!a&&(t&60)===0&&(t&e.expiredLanes)===0||Xi(e,t),r=l?Kg(e,t):Uc(e,t,!0),o=l;do{if(r===0){Ti&&!l&&Zn(e,t,0,!1);break}else if(r===6)Zn(e,t,0,!Bn);else{if(a=e.current.alternate,o&&!Vg(a)){r=Uc(e,t,!1),o=!1;continue}if(r===2){if(o=t,e.errorRecoveryDisabledLanes&o)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var m=e;r=xl;var v=m.current.memoizedState.isDehydrated;if(v&&(Ai(m,d).flags|=256),d=Uc(m,d,!1),d!==2){if(Oc&&!v){m.errorRecoveryDisabledLanes|=o,Za|=o,r=4;break e}o=yn,yn=r,o!==null&&Cc(o)}r=d}if(o=!1,r!==2)continue}}if(r===1){Ai(e,0),Zn(e,t,0,!0);break}e:{switch(l=e,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194176)===t){Zn(l,t,Qt,!Bn);break e}break;case 2:yn=null;break;case 3:case 5:break;default:throw Error(u(329))}if(l.finishedWork=a,l.finishedLanes=t,(t&62914560)===t&&(o=xc+300-on(),10<o)){if(Zn(l,t,Qt,!Bn),bs(l,0)!==0)break e;l.timeoutHandle=Ey(ey.bind(null,l,a,yn,lu,Rc,t,Qt,Za,Ei,Bn,2,-0,0),o);break e}ey(l,a,yn,lu,Rc,t,Qt,Za,Ei,Bn,0,-0,0)}}break}while(!0);mn(e)}function Cc(e){yn===null?yn=e:yn.push.apply(yn,e)}function ey(e,t,a,l,r,o,d,m,v,T,x,M,w){var R=t.subtreeFlags;if((R&8192||(R&16785408)===16785408)&&(jl={stylesheets:null,count:0,unsuspend:Tv},Yh(t),t=Av(),t!==null)){e.cancelPendingCommit=t(uy.bind(null,e,a,l,r,d,m,v,1,M,w)),Zn(e,o,d,!T);return}uy(e,a,l,r,d,m,v,x,M,w)}function Vg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var r=a[l],o=r.getSnapshot;r=r.value;try{if(!Mt(o(),r))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 Zn(e,t,a,l){t&=~wc,t&=~Za,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var r=t;0<r;){var o=31-kt(r),d=1<<o;l[o]=-1,r&=~d}a!==0&&mf(e,a,t)}function uu(){return Ze&6?!0:(Nl(0),!1)}function Dc(){if(pe!==null){if(ze===0)var e=pe.return;else e=pe,Nn=Ua=null,Zr(e),di=null,fl=0,e=pe;for(;e!==null;)Wh(e.alternate,e),e=e.return;pe=null}}function Ai(e,t){e.finishedWork=null,e.finishedLanes=0;var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,sv(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Dc(),De=e,pe=a=sa(e.current,null),Se=t,ze=0,Dt=null,Bn=!1,Ti=Xi(e,t),Oc=!1,Ei=Qt=wc=Za=ua=Ke=0,yn=xl=null,Rc=!1,t&8&&(t|=t&32);var l=e.entangledLanes;if(l!==0)for(e=e.entanglements,l&=t;0<l;){var r=31-kt(l),o=1<<r;t|=e[r],l&=~o}return qn=t,Ns(),a}function ty(e,t){he=null,j.H=hn,t===cl?(t=pd(),ze=3):t===hd?(t=pd(),ze=4):ze=t===yh?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Dt=t,pe===null&&(Ke=1,Ws(e,Vt(t,e.current)))}function ny(){var e=j.H;return j.H=hn,e===null?hn:e}function ay(){var e=j.A;return j.A=Zg,e}function zc(){Ke=4,Bn||(Se&4194176)!==Se&&Yt.current!==null||(Ti=!0),!(ua&134217727)&&!(Za&134217727)||De===null||Zn(De,Se,Qt,!1)}function Uc(e,t,a){var l=Ze;Ze|=2;var r=ny(),o=ay();(De!==e||Se!==t)&&(lu=null,Ai(e,t)),t=!1;var d=Ke;e:do try{if(ze!==0&&pe!==null){var m=pe,v=Dt;switch(ze){case 8:Dc(),d=6;break e;case 3:case 2:case 6:Yt.current===null&&(t=!0);var T=ze;if(ze=0,Dt=null,Oi(e,m,v,T),a&&Ti){d=0;break e}break;default:T=ze,ze=0,Dt=null,Oi(e,m,v,T)}}Lg(),d=Ke;break}catch(x){ty(e,x)}while(!0);return t&&e.shellSuspendCounter++,Nn=Ua=null,Ze=l,j.H=r,j.A=o,pe===null&&(De=null,Se=0,Ns()),d}function Lg(){for(;pe!==null;)iy(pe)}function Kg(e,t){var a=Ze;Ze|=2;var l=ny(),r=ay();De!==e||Se!==t?(lu=null,iu=on()+500,Ai(e,t)):Ti=Xi(e,t);e:do try{if(ze!==0&&pe!==null){t=pe;var o=Dt;t:switch(ze){case 1:ze=0,Dt=null,Oi(e,t,o,1);break;case 2:if(yd(o)){ze=0,Dt=null,ly(t);break}t=function(){ze===2&&De===e&&(ze=7),mn(e)},o.then(t,t);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:yd(o)?(ze=0,Dt=null,ly(t)):(ze=0,Dt=null,Oi(e,t,o,7));break;case 5:var d=null;switch(pe.tag){case 26:d=pe.memoizedState;case 5:case 27:var m=pe;if(!d||zy(d)){ze=0,Dt=null;var v=m.sibling;if(v!==null)pe=v;else{var T=m.return;T!==null?(pe=T,ru(T)):pe=null}break t}}ze=0,Dt=null,Oi(e,t,o,5);break;case 6:ze=0,Dt=null,Oi(e,t,o,6);break;case 8:Dc(),Ke=6;break e;default:throw Error(u(462))}}Yg();break}catch(x){ty(e,x)}while(!0);return Nn=Ua=null,j.H=l,j.A=r,Ze=a,pe!==null?0:(De=null,Se=0,Ns(),Ke)}function Yg(){for(;pe!==null&&!dp();)iy(pe)}function iy(e){var t=wh(e.alternate,e,qn);e.memoizedProps=e.pendingProps,t===null?ru(e):pe=t}function ly(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=_h(a,t,t.pendingProps,t.type,void 0,Se);break;case 11:t=_h(a,t,t.pendingProps,t.type.render,t.ref,Se);break;case 5:Zr(t);default:Wh(a,t),t=pe=Qh(t,qn),t=wh(a,t,qn)}e.memoizedProps=e.pendingProps,t===null?ru(e):pe=t}function Oi(e,t,a,l){Nn=Ua=null,Zr(t),di=null,fl=0;var r=t.return;try{if(Cg(e,r,t,a,Se)){Ke=1,Ws(e,Vt(a,e.current)),pe=null;return}}catch(o){if(r!==null)throw pe=r,o;Ke=1,Ws(e,Vt(a,e.current)),pe=null;return}t.flags&32768?(Ae||l===1?e=!0:Ti||Se&536870912?e=!1:(Bn=e=!0,(l===2||l===3||l===6)&&(l=Yt.current,l!==null&&l.tag===13&&(l.flags|=16384))),sy(t,e)):ru(t)}function ru(e){var t=e;do{if(t.flags&32768){sy(t,Bn);return}e=t.return;var a=Bg(t.alternate,t,qn);if(a!==null){pe=a;return}if(t=t.sibling,t!==null){pe=t;return}pe=t=e}while(t!==null);Ke===0&&(Ke=5)}function sy(e,t){do{var a=qg(e.alternate,e);if(a!==null){a.flags&=32767,pe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){pe=e;return}pe=e=a}while(e!==null);Ke=6,pe=null}function uy(e,t,a,l,r,o,d,m,v,T){var x=j.T,M=G.p;try{G.p=2,j.T=null,Gg(e,t,a,l,M,r,o,d,m,v,T)}finally{j.T=x,G.p=M}}function Gg(e,t,a,l,r,o,d,m){do wi();while(Ha!==null);if(Ze&6)throw Error(u(327));var v=e.finishedWork;if(l=e.finishedLanes,v===null)return null;if(e.finishedWork=null,e.finishedLanes=0,v===e.current)throw Error(u(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var T=v.lanes|v.childLanes;if(T|=Ar,Ep(e,l,T,o,d,m),e===De&&(pe=De=null,Se=0),!(v.subtreeFlags&10256)&&!(v.flags&10256)||su||(su=!0,kc=T,Mc=a,Jg(ps,function(){return wi(),null})),a=(v.flags&15990)!==0,v.subtreeFlags&15990||a?(a=j.T,j.T=null,o=G.p,G.p=2,d=Ze,Ze|=4,zg(e,v),Vh(v,e),mg(Xc,e.containerInfo),_u=!!$c,Xc=$c=null,e.current=v,Bh(e,v.alternate,v),hp(),Ze=d,G.p=o,j.T=a):e.current=v,su?(su=!1,Ha=e,kl=l):ry(e,T),T=e.pendingLanes,T===0&&(ra=null),vp(v.stateNode),mn(e),t!==null)for(r=e.onRecoverableError,v=0;v<t.length;v++)T=t[v],r(T.value,{componentStack:T.stack});return kl&3&&wi(),T=e.pendingLanes,l&4194218&&T&42?e===Nc?Ml++:(Ml=0,Nc=e):Ml=0,Nl(0),null}function ry(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,hl(t)))}function wi(){if(Ha!==null){var e=Ha,t=kc;kc=0;var a=gf(kl),l=j.T,r=G.p;try{if(G.p=32>a?32:a,j.T=null,Ha===null)var o=!1;else{a=Mc,Mc=null;var d=Ha,m=kl;if(Ha=null,kl=0,Ze&6)throw Error(u(331));var v=Ze;if(Ze|=4,$h(d.current),Kh(d,d.current,m,a),Ze=v,Nl(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot($i,d)}catch{}o=!0}return o}finally{G.p=r,j.T=l,ry(e,t)}}return!1}function cy(e,t,a){t=Vt(a,t),t=Pr(e.stateNode,t,2),e=na(e,t,2),e!==null&&(Qi(e,2),mn(e))}function Ne(e,t,a){if(e.tag===3)cy(e,e,a);else for(;t!==null;){if(t.tag===3){cy(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ra===null||!ra.has(l))){e=Vt(a,e),a=dh(2),l=na(t,a,2),l!==null&&(hh(a,l,t,e),Qi(l,2),mn(l));break}}t=t.return}}function jc(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new Hg;var r=new Set;l.set(t,r)}else r=l.get(t),r===void 0&&(r=new Set,l.set(t,r));r.has(a)||(Oc=!0,r.add(a),e=$g.bind(null,e,t,a),t.then(e,e))}function $g(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,De===e&&(Se&a)===a&&(Ke===4||Ke===3&&(Se&62914560)===Se&&300>on()-xc?!(Ze&2)&&Ai(e,0):wc|=a,Ei===Se&&(Ei=0)),mn(e)}function oy(e,t){t===0&&(t=yf()),e=Qn(e,t),e!==null&&(Qi(e,t),mn(e))}function Xg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),oy(e,a)}function Qg(e,t){var a=0;switch(e.tag){case 13:var l=e.stateNode,r=e.memoizedState;r!==null&&(a=r.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(u(314))}l!==null&&l.delete(t),oy(e,a)}function Jg(e,t){return er(e,t)}var cu=null,Ri=null,Bc=!1,ou=!1,qc=!1,Va=0;function mn(e){e!==Ri&&e.next===null&&(Ri===null?cu=Ri=e:Ri=Ri.next=e),ou=!0,Bc||(Bc=!0,Wg(Fg))}function Nl(e,t){if(!qc&&ou){qc=!0;do for(var a=!1,l=cu;l!==null;){if(e!==0){var r=l.pendingLanes;if(r===0)var o=0;else{var d=l.suspendedLanes,m=l.pingedLanes;o=(1<<31-kt(42|e)+1)-1,o&=r&~(d&~m),o=o&201326677?o&201326677|1:o?o|2:0}o!==0&&(a=!0,hy(l,o))}else o=Se,o=bs(l,l===De?o:0),!(o&3)||Xi(l,o)||(a=!0,hy(l,o));l=l.next}while(a);qc=!1}}function Fg(){ou=Bc=!1;var e=0;Va!==0&&(lv()&&(e=Va),Va=0);for(var t=on(),a=null,l=cu;l!==null;){var r=l.next,o=fy(l,t);o===0?(l.next=null,a===null?cu=r:a.next=r,r===null&&(Ri=a)):(a=l,(e!==0||o&3)&&(ou=!0)),l=r}Nl(e)}function fy(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,r=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var d=31-kt(o),m=1<<d,v=r[d];v===-1?(!(m&a)||m&l)&&(r[d]=Tp(m,t)):v<=t&&(e.expiredLanes|=m),o&=~m}if(t=De,a=Se,a=bs(e,e===t?a:0),l=e.callbackNode,a===0||e===t&&ze===2||e.cancelPendingCommit!==null)return l!==null&&l!==null&&tr(l),e.callbackNode=null,e.callbackPriority=0;if(!(a&3)||Xi(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&tr(l),gf(a)){case 2:case 8:a=ff;break;case 32:a=ps;break;case 268435456:a=df;break;default:a=ps}return l=dy.bind(null,e),a=er(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&tr(l),e.callbackPriority=2,e.callbackNode=null,2}function dy(e,t){var a=e.callbackNode;if(wi()&&e.callbackNode!==a)return null;var l=Se;return l=bs(e,e===De?l:0),l===0?null:(Ph(e,l,t),fy(e,on()),e.callbackNode!=null&&e.callbackNode===a?dy.bind(null,e):null)}function hy(e,t){if(wi())return null;Ph(e,t,!0)}function Wg(e){uv(function(){Ze&6?er(of,e):e()})}function Zc(){return Va===0&&(Va=hf()),Va}function yy(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:As(""+e)}function my(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function Ig(e,t,a,l,r){if(t==="submit"&&a&&a.stateNode===r){var o=yy((r[Ot]||null).action),d=l.submitter;d&&(t=(t=d[Ot]||null)?yy(t.formAction):d.getAttribute("formAction"),t!==null&&(o=t,d=null));var m=new xs("action","action",null,l,r);e.push({event:m,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Va!==0){var v=d?my(r,d):new FormData(r);Qr(a,{pending:!0,data:v,method:r.method,action:o},null,v)}}else typeof o=="function"&&(m.preventDefault(),v=d?my(r,d):new FormData(r),Qr(a,{pending:!0,data:v,method:r.method,action:o},o,v))},currentTarget:r}]})}}for(var Hc=0;Hc<ud.length;Hc++){var Vc=ud[Hc],Pg=Vc.toLowerCase(),ev=Vc[0].toUpperCase()+Vc.slice(1);Pt(Pg,"on"+ev)}Pt(nd,"onAnimationEnd"),Pt(ad,"onAnimationIteration"),Pt(id,"onAnimationStart"),Pt("dblclick","onDoubleClick"),Pt("focusin","onFocus"),Pt("focusout","onBlur"),Pt(gg,"onTransitionRun"),Pt(vg,"onTransitionStart"),Pt(bg,"onTransitionCancel"),Pt(ld,"onTransitionEnd"),ei("onMouseEnter",["mouseout","mouseover"]),ei("onMouseLeave",["mouseout","mouseover"]),ei("onPointerEnter",["pointerout","pointerover"]),ei("onPointerLeave",["pointerout","pointerover"]),Ta("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ta("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ta("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ta("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ta("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cl="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(" "),tv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cl));function py(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],r=l.event;l=l.listeners;e:{var o=void 0;if(t)for(var d=l.length-1;0<=d;d--){var m=l[d],v=m.instance,T=m.currentTarget;if(m=m.listener,v!==o&&r.isPropagationStopped())break e;o=m,r.currentTarget=T;try{o(r)}catch(x){Fs(x)}r.currentTarget=null,o=v}else for(d=0;d<l.length;d++){if(m=l[d],v=m.instance,T=m.currentTarget,m=m.listener,v!==o&&r.isPropagationStopped())break e;o=m,r.currentTarget=T;try{o(r)}catch(x){Fs(x)}r.currentTarget=null,o=v}}}}function ve(e,t){var a=t[ar];a===void 0&&(a=t[ar]=new Set);var l=e+"__bubble";a.has(l)||(gy(t,e,2,!1),a.add(l))}function Lc(e,t,a){var l=0;t&&(l|=4),gy(a,e,l,t)}var fu="_reactListening"+Math.random().toString(36).slice(2);function Kc(e){if(!e[fu]){e[fu]=!0,_f.forEach(function(a){a!=="selectionchange"&&(tv.has(a)||Lc(a,!1,e),Lc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[fu]||(t[fu]=!0,Lc("selectionchange",!1,t))}}function gy(e,t,a,l){switch(Hy(t)){case 2:var r=Rv;break;case 8:r=xv;break;default:r=no}a=r.bind(null,t,a,e),r=void 0,!fr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(r=!0),l?r!==void 0?e.addEventListener(t,a,{capture:!0,passive:r}):e.addEventListener(t,a,!0):r!==void 0?e.addEventListener(t,a,{passive:r}):e.addEventListener(t,a,!1)}function Yc(e,t,a,l,r){var o=l;if(!(t&1)&&!(t&2)&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var m=l.stateNode.containerInfo;if(m===r||m.nodeType===8&&m.parentNode===r)break;if(d===4)for(d=l.return;d!==null;){var v=d.tag;if((v===3||v===4)&&(v=d.stateNode.containerInfo,v===r||v.nodeType===8&&v.parentNode===r))return;d=d.return}for(;m!==null;){if(d=Sa(m),d===null)return;if(v=d.tag,v===5||v===6||v===26||v===27){l=o=d;continue e}m=m.parentNode}}l=l.return}Cf(function(){var T=o,x=cr(a),M=[];e:{var w=sd.get(e);if(w!==void 0){var R=xs,J=e;switch(e){case"keypress":if(ws(a)===0)break e;case"keydown":case"keyup":R=Qp;break;case"focusin":J="focus",R=mr;break;case"focusout":J="blur",R=mr;break;case"beforeblur":case"afterblur":R=mr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":R=Uf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":R=jp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":R=Wp;break;case nd:case ad:case id:R=Zp;break;case ld:R=Pp;break;case"scroll":case"scrollend":R=zp;break;case"wheel":R=tg;break;case"copy":case"cut":case"paste":R=Vp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":R=Bf;break;case"toggle":case"beforetoggle":R=ag}var le=(t&4)!==0,Ye=!le&&(e==="scroll"||e==="scrollend"),E=le?w!==null?w+"Capture":null:w;le=[];for(var S=T,A;S!==null;){var k=S;if(A=k.stateNode,k=k.tag,k!==5&&k!==26&&k!==27||A===null||E===null||(k=Wi(S,E),k!=null&&le.push(Dl(S,k,A))),Ye)break;S=S.return}0<le.length&&(w=new R(w,J,null,a,x),M.push({event:w,listeners:le}))}}if(!(t&7)){e:{if(w=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",w&&a!==rr&&(J=a.relatedTarget||a.fromElement)&&(Sa(J)||J[Wa]))break e;if((R||w)&&(w=x.window===x?x:(w=x.ownerDocument)?w.defaultView||w.parentWindow:window,R?(J=a.relatedTarget||a.toElement,R=T,J=J?Sa(J):null,J!==null&&(Ye=I(J),le=J.tag,J!==Ye||le!==5&&le!==27&&le!==6)&&(J=null)):(R=null,J=T),R!==J)){if(le=Uf,k="onMouseLeave",E="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(le=Bf,k="onPointerLeave",E="onPointerEnter",S="pointer"),Ye=R==null?w:Fi(R),A=J==null?w:Fi(J),w=new le(k,S+"leave",R,a,x),w.target=Ye,w.relatedTarget=A,k=null,Sa(x)===T&&(le=new le(E,S+"enter",J,a,x),le.target=A,le.relatedTarget=Ye,k=le),Ye=k,R&&J)t:{for(le=R,E=J,S=0,A=le;A;A=xi(A))S++;for(A=0,k=E;k;k=xi(k))A++;for(;0<S-A;)le=xi(le),S--;for(;0<A-S;)E=xi(E),A--;for(;S--;){if(le===E||E!==null&&le===E.alternate)break t;le=xi(le),E=xi(E)}le=null}else le=null;R!==null&&vy(M,w,R,le,!1),J!==null&&Ye!==null&&vy(M,Ye,J,le,!0)}}e:{if(w=T?Fi(T):window,R=w.nodeName&&w.nodeName.toLowerCase(),R==="select"||R==="input"&&w.type==="file")var $=Gf;else if(Kf(w))if($f)$=hg;else{$=fg;var me=og}else R=w.nodeName,!R||R.toLowerCase()!=="input"||w.type!=="checkbox"&&w.type!=="radio"?T&&ur(T.elementType)&&($=Gf):$=dg;if($&&($=$(e,T))){Yf(M,$,a,x);break e}me&&me(e,w,T),e==="focusout"&&T&&w.type==="number"&&T.memoizedProps.value!=null&&sr(w,"number",w.value)}switch(me=T?Fi(T):window,e){case"focusin":(Kf(me)||me.contentEditable==="true")&&(si=me,Sr=T,ll=null);break;case"focusout":ll=Sr=si=null;break;case"mousedown":Tr=!0;break;case"contextmenu":case"mouseup":case"dragend":Tr=!1,ed(M,a,x);break;case"selectionchange":if(pg)break;case"keydown":case"keyup":ed(M,a,x)}var F;if(gr)e:{switch(e){case"compositionstart":var ee="onCompositionStart";break e;case"compositionend":ee="onCompositionEnd";break e;case"compositionupdate":ee="onCompositionUpdate";break e}ee=void 0}else li?Vf(e,a)&&(ee="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ee="onCompositionStart");ee&&(qf&&a.locale!=="ko"&&(li||ee!=="onCompositionStart"?ee==="onCompositionEnd"&&li&&(F=Df()):(Xn=x,dr="value"in Xn?Xn.value:Xn.textContent,li=!0)),me=du(T,ee),0<me.length&&(ee=new jf(ee,e,null,a,x),M.push({event:ee,listeners:me}),F?ee.data=F:(F=Lf(a),F!==null&&(ee.data=F)))),(F=lg?sg(e,a):ug(e,a))&&(ee=du(T,"onBeforeInput"),0<ee.length&&(me=new jf("onBeforeInput","beforeinput",null,a,x),M.push({event:me,listeners:ee}),me.data=F)),Ig(M,e,T,a,x)}py(M,t)})}function Dl(e,t,a){return{instance:e,listener:t,currentTarget:a}}function du(e,t){for(var a=t+"Capture",l=[];e!==null;){var r=e,o=r.stateNode;r=r.tag,r!==5&&r!==26&&r!==27||o===null||(r=Wi(e,a),r!=null&&l.unshift(Dl(e,r,o)),r=Wi(e,t),r!=null&&l.push(Dl(e,r,o))),e=e.return}return l}function xi(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function vy(e,t,a,l,r){for(var o=t._reactName,d=[];a!==null&&a!==l;){var m=a,v=m.alternate,T=m.stateNode;if(m=m.tag,v!==null&&v===l)break;m!==5&&m!==26&&m!==27||T===null||(v=T,r?(T=Wi(a,o),T!=null&&d.unshift(Dl(a,T,v))):r||(T=Wi(a,o),T!=null&&d.push(Dl(a,T,v)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var nv=/\r\n?/g,av=/\u0000|\uFFFD/g;function by(e){return(typeof e=="string"?e:""+e).replace(nv,`
62
+ `).replace(av,"")}function _y(e,t){return t=by(t),by(e)===t}function hu(){}function Me(e,t,a,l,r,o){switch(a){case"children":typeof l=="string"?t==="body"||t==="textarea"&&l===""||ni(e,l):(typeof l=="number"||typeof l=="bigint")&&t!=="body"&&ni(e,""+l);break;case"className":Ss(e,"class",l);break;case"tabIndex":Ss(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":Ss(e,a,l);break;case"style":Mf(e,l,o);break;case"data":if(t!=="object"){Ss(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=As(""+l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof o=="function"&&(a==="formAction"?(t!=="input"&&Me(e,t,"name",r.name,r,null),Me(e,t,"formEncType",r.formEncType,r,null),Me(e,t,"formMethod",r.formMethod,r,null),Me(e,t,"formTarget",r.formTarget,r,null)):(Me(e,t,"encType",r.encType,r,null),Me(e,t,"method",r.method,r,null),Me(e,t,"target",r.target,r,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=As(""+l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=hu);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=As(""+l),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""+l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":ve("beforetoggle",e),ve("toggle",e),_s(e,"popover",l);break;case"xlinkActuate":On(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":On(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":On(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":On(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":On(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":On(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":On(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":On(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":On(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":_s(e,"is",l);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Cp.get(a)||a,_s(e,a,l))}}function Gc(e,t,a,l,r,o){switch(a){case"style":Mf(e,l,o);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(u(61));if(a=l.__html,a!=null){if(r.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof l=="string"?ni(e,l):(typeof l=="number"||typeof l=="bigint")&&ni(e,""+l);break;case"onScroll":l!=null&&ve("scroll",e);break;case"onScrollEnd":l!=null&&ve("scrollend",e);break;case"onClick":l!=null&&(e.onclick=hu);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Sf.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(r=a.endsWith("Capture"),t=a.slice(2,r?a.length-7:void 0),o=e[Ot]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,r),typeof l=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,l,r);break e}a in e?e[a]=l:l===!0?e.setAttribute(a,""):_s(e,a,l)}}}function ft(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ve("error",e),ve("load",e);var l=!1,r=!1,o;for(o in a)if(a.hasOwnProperty(o)){var d=a[o];if(d!=null)switch(o){case"src":l=!0;break;case"srcSet":r=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Me(e,t,o,d,a,null)}}r&&Me(e,t,"srcSet",a.srcSet,a,null),l&&Me(e,t,"src",a.src,a,null);return;case"input":ve("invalid",e);var m=o=d=r=null,v=null,T=null;for(l in a)if(a.hasOwnProperty(l)){var x=a[l];if(x!=null)switch(l){case"name":r=x;break;case"type":d=x;break;case"checked":v=x;break;case"defaultChecked":T=x;break;case"value":o=x;break;case"defaultValue":m=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(u(137,t));break;default:Me(e,t,l,x,a,null)}}wf(e,o,m,v,T,d,r,!1),Ts(e);return;case"select":ve("invalid",e),l=d=o=null;for(r in a)if(a.hasOwnProperty(r)&&(m=a[r],m!=null))switch(r){case"value":o=m;break;case"defaultValue":d=m;break;case"multiple":l=m;default:Me(e,t,r,m,a,null)}t=o,a=d,e.multiple=!!l,t!=null?ti(e,!!l,t,!1):a!=null&&ti(e,!!l,a,!0);return;case"textarea":ve("invalid",e),o=r=l=null;for(d in a)if(a.hasOwnProperty(d)&&(m=a[d],m!=null))switch(d){case"value":l=m;break;case"defaultValue":r=m;break;case"children":o=m;break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(u(91));break;default:Me(e,t,d,m,a,null)}xf(e,l,r,o),Ts(e);return;case"option":for(v in a)if(a.hasOwnProperty(v)&&(l=a[v],l!=null))switch(v){case"selected":e.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:Me(e,t,v,l,a,null)}return;case"dialog":ve("cancel",e),ve("close",e);break;case"iframe":case"object":ve("load",e);break;case"video":case"audio":for(l=0;l<Cl.length;l++)ve(Cl[l],e);break;case"image":ve("error",e),ve("load",e);break;case"details":ve("toggle",e);break;case"embed":case"source":case"link":ve("error",e),ve("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in a)if(a.hasOwnProperty(T)&&(l=a[T],l!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Me(e,t,T,l,a,null)}return;default:if(ur(t)){for(x in a)a.hasOwnProperty(x)&&(l=a[x],l!==void 0&&Gc(e,t,x,l,a,void 0));return}}for(m in a)a.hasOwnProperty(m)&&(l=a[m],l!=null&&Me(e,t,m,l,a,null))}function iv(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var r=null,o=null,d=null,m=null,v=null,T=null,x=null;for(R in a){var M=a[R];if(a.hasOwnProperty(R)&&M!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":v=M;default:l.hasOwnProperty(R)||Me(e,t,R,null,l,M)}}for(var w in l){var R=l[w];if(M=a[w],l.hasOwnProperty(w)&&(R!=null||M!=null))switch(w){case"type":o=R;break;case"name":r=R;break;case"checked":T=R;break;case"defaultChecked":x=R;break;case"value":d=R;break;case"defaultValue":m=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(u(137,t));break;default:R!==M&&Me(e,t,w,R,l,M)}}lr(e,d,m,v,T,x,o,r);return;case"select":R=d=m=w=null;for(o in a)if(v=a[o],a.hasOwnProperty(o)&&v!=null)switch(o){case"value":break;case"multiple":R=v;default:l.hasOwnProperty(o)||Me(e,t,o,null,l,v)}for(r in l)if(o=l[r],v=a[r],l.hasOwnProperty(r)&&(o!=null||v!=null))switch(r){case"value":w=o;break;case"defaultValue":m=o;break;case"multiple":d=o;default:o!==v&&Me(e,t,r,o,l,v)}t=m,a=d,l=R,w!=null?ti(e,!!a,w,!1):!!l!=!!a&&(t!=null?ti(e,!!a,t,!0):ti(e,!!a,a?[]:"",!1));return;case"textarea":R=w=null;for(m in a)if(r=a[m],a.hasOwnProperty(m)&&r!=null&&!l.hasOwnProperty(m))switch(m){case"value":break;case"children":break;default:Me(e,t,m,null,l,r)}for(d in l)if(r=l[d],o=a[d],l.hasOwnProperty(d)&&(r!=null||o!=null))switch(d){case"value":w=r;break;case"defaultValue":R=r;break;case"children":break;case"dangerouslySetInnerHTML":if(r!=null)throw Error(u(91));break;default:r!==o&&Me(e,t,d,r,l,o)}Rf(e,w,R);return;case"option":for(var J in a)if(w=a[J],a.hasOwnProperty(J)&&w!=null&&!l.hasOwnProperty(J))switch(J){case"selected":e.selected=!1;break;default:Me(e,t,J,null,l,w)}for(v in l)if(w=l[v],R=a[v],l.hasOwnProperty(v)&&w!==R&&(w!=null||R!=null))switch(v){case"selected":e.selected=w&&typeof w!="function"&&typeof w!="symbol";break;default:Me(e,t,v,w,l,R)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var le in a)w=a[le],a.hasOwnProperty(le)&&w!=null&&!l.hasOwnProperty(le)&&Me(e,t,le,null,l,w);for(T in l)if(w=l[T],R=a[T],l.hasOwnProperty(T)&&w!==R&&(w!=null||R!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(u(137,t));break;default:Me(e,t,T,w,l,R)}return;default:if(ur(t)){for(var Ye in a)w=a[Ye],a.hasOwnProperty(Ye)&&w!==void 0&&!l.hasOwnProperty(Ye)&&Gc(e,t,Ye,void 0,l,w);for(x in l)w=l[x],R=a[x],!l.hasOwnProperty(x)||w===R||w===void 0&&R===void 0||Gc(e,t,x,w,l,R);return}}for(var E in a)w=a[E],a.hasOwnProperty(E)&&w!=null&&!l.hasOwnProperty(E)&&Me(e,t,E,null,l,w);for(M in l)w=l[M],R=a[M],!l.hasOwnProperty(M)||w===R||w==null&&R==null||Me(e,t,M,w,l,R)}var $c=null,Xc=null;function yu(e){return e.nodeType===9?e:e.ownerDocument}function Sy(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ty(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Qc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Jc=null;function lv(){var e=window.event;return e&&e.type==="popstate"?e===Jc?!1:(Jc=e,!0):(Jc=null,!1)}var Ey=typeof setTimeout=="function"?setTimeout:void 0,sv=typeof clearTimeout=="function"?clearTimeout:void 0,Ay=typeof Promise=="function"?Promise:void 0,uv=typeof queueMicrotask=="function"?queueMicrotask:typeof Ay<"u"?function(e){return Ay.resolve(null).then(e).catch(rv)}:Ey;function rv(e){setTimeout(function(){throw e})}function Fc(e,t){var a=t,l=0;do{var r=a.nextSibling;if(e.removeChild(a),r&&r.nodeType===8)if(a=r.data,a==="/$"){if(l===0){e.removeChild(r),Vl(t);return}l--}else a!=="$"&&a!=="$?"&&a!=="$!"||l++;a=r}while(a);Vl(t)}function Wc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Wc(a),ir(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function cv(e,t,a,l){for(;e.nodeType===1;){var r=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Ji])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==r.rel||e.getAttribute("href")!==(r.href==null?null:r.href)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin)||e.getAttribute("title")!==(r.title==null?null:r.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(r.src==null?null:r.src)||e.getAttribute("type")!==(r.type==null?null:r.type)||e.getAttribute("crossorigin")!==(r.crossOrigin==null?null:r.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=r.name==null?null:""+r.name;if(r.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=nn(e.nextSibling),e===null)break}return null}function ov(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=nn(e.nextSibling),e===null))return null;return e}function nn(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==="$?"||t==="F!"||t==="F")break;if(t==="/$")return null}}return e}function Oy(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"){if(t===0)return e;t--}else a==="/$"&&t++}e=e.previousSibling}return null}function wy(e,t,a){switch(t=yu(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}var Jt=new Map,Ry=new Set;function mu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.ownerDocument}var Hn=G.d;G.d={f:fv,r:dv,D:hv,C:yv,L:mv,m:pv,X:vv,S:gv,M:bv};function fv(){var e=Hn.f(),t=uu();return e||t}function dv(e){var t=Ia(e);t!==null&&t.tag===5&&t.type==="form"?eh(t):Hn.r(e)}var ki=typeof document>"u"?null:document;function xy(e,t,a){var l=ki;if(l&&typeof t=="string"&&t){var r=Zt(t);r='link[rel="'+e+'"][href="'+r+'"]',typeof a=="string"&&(r+='[crossorigin="'+a+'"]'),Ry.has(r)||(Ry.add(r),e={rel:e,crossOrigin:a,href:t},l.querySelector(r)===null&&(t=l.createElement("link"),ft(t,"link",e),lt(t),l.head.appendChild(t)))}}function hv(e){Hn.D(e),xy("dns-prefetch",e,null)}function yv(e,t){Hn.C(e,t),xy("preconnect",e,t)}function mv(e,t,a){Hn.L(e,t,a);var l=ki;if(l&&e&&t){var r='link[rel="preload"][as="'+Zt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(r+='[imagesrcset="'+Zt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(r+='[imagesizes="'+Zt(a.imageSizes)+'"]')):r+='[href="'+Zt(e)+'"]';var o=r;switch(t){case"style":o=Mi(e);break;case"script":o=Ni(e)}Jt.has(o)||(e=X({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Jt.set(o,e),l.querySelector(r)!==null||t==="style"&&l.querySelector(zl(o))||t==="script"&&l.querySelector(Ul(o))||(t=l.createElement("link"),ft(t,"link",e),lt(t),l.head.appendChild(t)))}}function pv(e,t){Hn.m(e,t);var a=ki;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",r='link[rel="modulepreload"][as="'+Zt(l)+'"][href="'+Zt(e)+'"]',o=r;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Ni(e)}if(!Jt.has(o)&&(e=X({rel:"modulepreload",href:e},t),Jt.set(o,e),a.querySelector(r)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ul(o)))return}l=a.createElement("link"),ft(l,"link",e),lt(l),a.head.appendChild(l)}}}function gv(e,t,a){Hn.S(e,t,a);var l=ki;if(l&&e){var r=Pa(l).hoistableStyles,o=Mi(e);t=t||"default";var d=r.get(o);if(!d){var m={loading:0,preload:null};if(d=l.querySelector(zl(o)))m.loading=5;else{e=X({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Jt.get(o))&&Ic(e,a);var v=d=l.createElement("link");lt(v),ft(v,"link",e),v._p=new Promise(function(T,x){v.onload=T,v.onerror=x}),v.addEventListener("load",function(){m.loading|=1}),v.addEventListener("error",function(){m.loading|=2}),m.loading|=4,pu(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:m},r.set(o,d)}}}function vv(e,t){Hn.X(e,t);var a=ki;if(a&&e){var l=Pa(a).hoistableScripts,r=Ni(e),o=l.get(r);o||(o=a.querySelector(Ul(r)),o||(e=X({src:e,async:!0},t),(t=Jt.get(r))&&Pc(e,t),o=a.createElement("script"),lt(o),ft(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function bv(e,t){Hn.M(e,t);var a=ki;if(a&&e){var l=Pa(a).hoistableScripts,r=Ni(e),o=l.get(r);o||(o=a.querySelector(Ul(r)),o||(e=X({src:e,async:!0,type:"module"},t),(t=Jt.get(r))&&Pc(e,t),o=a.createElement("script"),lt(o),ft(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},l.set(r,o))}}function ky(e,t,a,l){var r=(r=Yn.current)?mu(r):null;if(!r)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Mi(a.href),a=Pa(r).hoistableStyles,l=a.get(t),l||(l={type:"style",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Mi(a.href);var o=Pa(r).hoistableStyles,d=o.get(e);if(d||(r=r.ownerDocument||r,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,d),(o=r.querySelector(zl(e)))&&!o._p&&(d.instance=o,d.state.loading=5),Jt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Jt.set(e,a),o||_v(r,e,a,d.state))),t&&l===null)throw Error(u(528,""));return d}if(t&&l!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Ni(a),a=Pa(r).hoistableScripts,l=a.get(t),l||(l={type:"script",instance:null,count:0,state:null},a.set(t,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Mi(e){return'href="'+Zt(e)+'"'}function zl(e){return'link[rel="stylesheet"]['+e+"]"}function My(e){return X({},e,{"data-precedence":e.precedence,precedence:null})}function _v(e,t,a,l){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?l.loading=1:(t=e.createElement("link"),l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2}),ft(t,"link",a),lt(t),e.head.appendChild(t))}function Ni(e){return'[src="'+Zt(e)+'"]'}function Ul(e){return"script[async]"+e}function Ny(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+Zt(a.href)+'"]');if(l)return t.instance=l,lt(l),l;var r=X({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),lt(l),ft(l,"style",r),pu(l,a.precedence,e),t.instance=l;case"stylesheet":r=Mi(a.href);var o=e.querySelector(zl(r));if(o)return t.state.loading|=4,t.instance=o,lt(o),o;l=My(a),(r=Jt.get(r))&&Ic(l,r),o=(e.ownerDocument||e).createElement("link"),lt(o);var d=o;return d._p=new Promise(function(m,v){d.onload=m,d.onerror=v}),ft(o,"link",l),t.state.loading|=4,pu(o,a.precedence,e),t.instance=o;case"script":return o=Ni(a.src),(r=e.querySelector(Ul(o)))?(t.instance=r,lt(r),r):(l=a,(r=Jt.get(o))&&(l=X({},a),Pc(l,r)),e=e.ownerDocument||e,r=e.createElement("script"),lt(r),ft(r,"link",l),e.head.appendChild(r),t.instance=r);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&!(t.state.loading&4)&&(l=t.instance,t.state.loading|=4,pu(l,a.precedence,e));return t.instance}function pu(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),r=l.length?l[l.length-1]:null,o=r,d=0;d<l.length;d++){var m=l[d];if(m.dataset.precedence===t)o=m;else if(o!==r)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Ic(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Pc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var gu=null;function Cy(e,t,a){if(gu===null){var l=new Map,r=gu=new Map;r.set(a,l)}else r=gu,l=r.get(a),l||(l=new Map,r.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),r=0;r<a.length;r++){var o=a[r];if(!(o[Ji]||o[yt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var d=o.getAttribute(t)||"";d=e+d;var m=l.get(d);m?m.push(o):l.set(d,[o])}}return l}function Dy(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Sv(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function zy(e){return!(e.type==="stylesheet"&&!(e.state.loading&3))}var jl=null;function Tv(){}function Ev(e,t,a){if(jl===null)throw Error(u(475));var l=jl;if(t.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&!(t.state.loading&4)){if(t.instance===null){var r=Mi(a.href),o=e.querySelector(zl(r));if(o){e=o._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(l.count++,l=vu.bind(l),e.then(l,l)),t.state.loading|=4,t.instance=o,lt(o);return}o=e.ownerDocument||e,a=My(a),(r=Jt.get(r))&&Ic(a,r),o=o.createElement("link"),lt(o);var d=o;d._p=new Promise(function(m,v){d.onload=m,d.onerror=v}),ft(o,"link",a),t.instance=o}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(t,e),(e=t.state.preload)&&!(t.state.loading&3)&&(l.count++,t=vu.bind(l),e.addEventListener("load",t),e.addEventListener("error",t))}}function Av(){if(jl===null)throw Error(u(475));var e=jl;return e.stylesheets&&e.count===0&&eo(e,e.stylesheets),0<e.count?function(t){var a=setTimeout(function(){if(e.stylesheets&&eo(e,e.stylesheets),e.unsuspend){var l=e.unsuspend;e.unsuspend=null,l()}},6e4);return e.unsuspend=t,function(){e.unsuspend=null,clearTimeout(a)}}:null}function vu(){if(this.count--,this.count===0){if(this.stylesheets)eo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var bu=null;function eo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,bu=new Map,t.forEach(Ov,e),bu=null,vu.call(e))}function Ov(e,t){if(!(t.state.loading&4)){var a=bu.get(e);if(a)var l=a.get(null);else{a=new Map,bu.set(e,a);for(var r=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<r.length;o++){var d=r[o];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}r=t.instance,d=r.getAttribute("data-precedence"),o=a.get(d)||l,o===l&&a.set(null,r),a.set(d,r),this.count++,l=vu.bind(this),r.addEventListener("load",l),r.addEventListener("error",l),o?o.parentNode.insertBefore(r,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(r,e.firstChild)),t.state.loading|=4}}var Bl={$$typeof:U,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function wv(e,t,a,l,r,o,d,m){this.tag=1,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=nr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=nr(0),this.hiddenUpdates=nr(null),this.identifierPrefix=l,this.onUncaughtError=r,this.onCaughtError=o,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=m,this.incompleteTransitions=new Map}function Uy(e,t,a,l,r,o,d,m,v,T,x,M){return e=new wv(e,t,a,d,m,v,T,M),t=1,o===!0&&(t|=24),o=Xt(3,null,null,t),e.current=o,o.stateNode=e,t=Cr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:l,isDehydrated:a,cache:t},dc(o),e}function jy(e){return e?(e=ci,e):ci}function By(e,t,a,l,r,o){r=jy(r),l.context===null?l.context=r:l.pendingContext=r,l=ta(t),l.payload={element:a},o=o===void 0?null:o,o!==null&&(l.callback=o),a=na(e,l,t),a!==null&&(Tt(a,e,t),_l(a,e,t))}function qy(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function to(e,t){qy(e,t),(e=e.alternate)&&qy(e,t)}function Zy(e){if(e.tag===13){var t=Qn(e,67108864);t!==null&&Tt(t,e,67108864),to(e,67108864)}}var _u=!0;function Rv(e,t,a,l){var r=j.T;j.T=null;var o=G.p;try{G.p=2,no(e,t,a,l)}finally{G.p=o,j.T=r}}function xv(e,t,a,l){var r=j.T;j.T=null;var o=G.p;try{G.p=8,no(e,t,a,l)}finally{G.p=o,j.T=r}}function no(e,t,a,l){if(_u){var r=ao(l);if(r===null)Yc(e,t,l,Su,a),Vy(e,l);else if(Mv(r,e,t,a,l))l.stopPropagation();else if(Vy(e,l),t&4&&-1<kv.indexOf(e)){for(;r!==null;){var o=Ia(r);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var d=_a(o.pendingLanes);if(d!==0){var m=o;for(m.pendingLanes|=2,m.entangledLanes|=2;d;){var v=1<<31-kt(d);m.entanglements[1]|=v,d&=~v}mn(o),!(Ze&6)&&(iu=on()+500,Nl(0))}}break;case 13:m=Qn(o,2),m!==null&&Tt(m,o,2),uu(),to(o,2)}if(o=ao(l),o===null&&Yc(e,t,l,Su,a),o===r)break;r=o}r!==null&&l.stopPropagation()}else Yc(e,t,l,null,a)}}function ao(e){return e=cr(e),io(e)}var Su=null;function io(e){if(Su=null,e=Sa(e),e!==null){var t=I(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=Ee(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Su=e,null}function Hy(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(yp()){case of:return 2;case ff:return 8;case ps:case mp:return 32;case df:return 268435456;default:return 32}default:return 32}}var lo=!1,ca=null,oa=null,fa=null,ql=new Map,Zl=new Map,da=[],kv="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Vy(e,t){switch(e){case"focusin":case"focusout":ca=null;break;case"dragenter":case"dragleave":oa=null;break;case"mouseover":case"mouseout":fa=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Zl.delete(t.pointerId)}}function Hl(e,t,a,l,r,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:o,targetContainers:[r]},t!==null&&(t=Ia(t),t!==null&&Zy(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,r!==null&&t.indexOf(r)===-1&&t.push(r),e)}function Mv(e,t,a,l,r){switch(t){case"focusin":return ca=Hl(ca,e,t,a,l,r),!0;case"dragenter":return oa=Hl(oa,e,t,a,l,r),!0;case"mouseover":return fa=Hl(fa,e,t,a,l,r),!0;case"pointerover":var o=r.pointerId;return ql.set(o,Hl(ql.get(o)||null,e,t,a,l,r)),!0;case"gotpointercapture":return o=r.pointerId,Zl.set(o,Hl(Zl.get(o)||null,e,t,a,l,r)),!0}return!1}function Ly(e){var t=Sa(e.target);if(t!==null){var a=I(t);if(a!==null){if(t=a.tag,t===13){if(t=Ee(a),t!==null){e.blockedOn=t,Ap(e.priority,function(){if(a.tag===13){var l=zt(),r=Qn(a,l);r!==null&&Tt(r,a,l),to(a,l)}});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Tu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=ao(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);rr=l,a.target.dispatchEvent(l),rr=null}else return t=Ia(a),t!==null&&Zy(t),e.blockedOn=a,!1;t.shift()}return!0}function Ky(e,t,a){Tu(e)&&a.delete(t)}function Nv(){lo=!1,ca!==null&&Tu(ca)&&(ca=null),oa!==null&&Tu(oa)&&(oa=null),fa!==null&&Tu(fa)&&(fa=null),ql.forEach(Ky),Zl.forEach(Ky)}function Eu(e,t){e.blockedOn===t&&(e.blockedOn=null,lo||(lo=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Nv)))}var Au=null;function Yy(e){Au!==e&&(Au=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){Au===e&&(Au=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],r=e[t+2];if(typeof l!="function"){if(io(l||a)===null)continue;break}var o=Ia(a);o!==null&&(e.splice(t,3),t-=3,Qr(o,{pending:!0,data:r,method:a.method,action:l},l,r))}}))}function Vl(e){function t(v){return Eu(v,e)}ca!==null&&Eu(ca,e),oa!==null&&Eu(oa,e),fa!==null&&Eu(fa,e),ql.forEach(t),Zl.forEach(t);for(var a=0;a<da.length;a++){var l=da[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<da.length&&(a=da[0],a.blockedOn===null);)Ly(a),a.blockedOn===null&&da.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var r=a[l],o=a[l+1],d=r[Ot]||null;if(typeof o=="function")d||Yy(a);else if(d){var m=null;if(o&&o.hasAttribute("formAction")){if(r=o,d=o[Ot]||null)m=d.formAction;else if(io(r)!==null)continue}else m=d.action;typeof m=="function"?a[l+1]=m:(a.splice(l,3),l-=3),Yy(a)}}}function so(e){this._internalRoot=e}Ou.prototype.render=so.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,l=zt();By(a,l,e,t,null,null)},Ou.prototype.unmount=so.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;e.tag===0&&wi(),By(e.current,2,null,e,null,null),uu(),t[Wa]=null}};function Ou(e){this._internalRoot=e}Ou.prototype.unstable_scheduleHydration=function(e){if(e){var t=vf();e={blockedOn:null,target:e,priority:t};for(var a=0;a<da.length&&t!==0&&t<da[a].priority;a++);da.splice(a,0,e),a===0&&Ly(e)}};var Gy=n.version;if(Gy!=="19.0.0")throw Error(u(527,Gy,"19.0.0"));G.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=D(t),e=e!==null?te(e):null,e=e===null?null:e.stateNode,e};var Cv={bundleType:0,version:"19.0.0",rendererPackageName:"react-dom",currentDispatcherRef:j,findFiberByHostInstance:Sa,reconcilerVersion:"19.0.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var wu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!wu.isDisabled&&wu.supportsFiber)try{$i=wu.inject(Cv),xt=wu}catch{}}return Kl.createRoot=function(e,t){if(!c(e))throw Error(u(299));var a=!1,l="",r=rh,o=ch,d=oh,m=null;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(r=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError),t.unstable_transitionCallbacks!==void 0&&(m=t.unstable_transitionCallbacks)),t=Uy(e,1,!1,null,null,a,l,r,o,d,m,null),e[Wa]=t.current,Kc(e.nodeType===8?e.parentNode:e),new so(t)},Kl.hydrateRoot=function(e,t,a){if(!c(e))throw Error(u(299));var l=!1,r="",o=rh,d=ch,m=oh,v=null,T=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(r=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(m=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(v=a.unstable_transitionCallbacks),a.formState!==void 0&&(T=a.formState)),t=Uy(e,1,!0,t,a??null,l,r,o,d,m,v,T),t.context=jy(null),a=t.current,l=zt(),r=ta(l),r.callback=null,na(a,r,l),t.current.lanes=l,Qi(t,l),mn(t),e[Wa]=t.current,Kc(e),new Ou(t)},Kl.version="19.0.0",Kl}var im;function i0(){if(im)return oo.exports;im=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(n){console.error(n)}}return s(),oo.exports=a0(),oo.exports}var l0=i0(),Te;(function(s){s.assertEqual=c=>c;function n(c){}s.assertIs=n;function i(c){throw new Error}s.assertNever=i,s.arrayToEnum=c=>{const f={};for(const h of c)f[h]=h;return f},s.getValidEnumValues=c=>{const f=s.objectKeys(c).filter(y=>typeof c[c[y]]!="number"),h={};for(const y of f)h[y]=c[y];return s.objectValues(h)},s.objectValues=c=>s.objectKeys(c).map(function(f){return c[f]}),s.objectKeys=typeof Object.keys=="function"?c=>Object.keys(c):c=>{const f=[];for(const h in c)Object.prototype.hasOwnProperty.call(c,h)&&f.push(h);return f},s.find=(c,f)=>{for(const h of c)if(f(h))return h},s.isInteger=typeof Number.isInteger=="function"?c=>Number.isInteger(c):c=>typeof c=="number"&&isFinite(c)&&Math.floor(c)===c;function u(c,f=" | "){return c.map(h=>typeof h=="string"?`'${h}'`:h).join(f)}s.joinValues=u,s.jsonStringifyReplacer=(c,f)=>typeof f=="bigint"?f.toString():f})(Te||(Te={}));var Oo;(function(s){s.mergeShapes=(n,i)=>({...n,...i})})(Oo||(Oo={}));const V=Te.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Ln=s=>{switch(typeof s){case"undefined":return V.undefined;case"string":return V.string;case"number":return isNaN(s)?V.nan:V.number;case"boolean":return V.boolean;case"function":return V.function;case"bigint":return V.bigint;case"symbol":return V.symbol;case"object":return Array.isArray(s)?V.array:s===null?V.null:s.then&&typeof s.then=="function"&&s.catch&&typeof s.catch=="function"?V.promise:typeof Map<"u"&&s instanceof Map?V.map:typeof Set<"u"&&s instanceof Set?V.set:typeof Date<"u"&&s instanceof Date?V.date:V.object;default:return V.unknown}},z=Te.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"]),s0=s=>JSON.stringify(s,null,2).replace(/"([^"]+)":/g,"$1:");class jt extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=u=>{this.issues=[...this.issues,u]},this.addIssues=(u=[])=>{this.issues=[...this.issues,...u]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=n}format(n){const i=n||function(f){return f.message},u={_errors:[]},c=f=>{for(const h of f.issues)if(h.code==="invalid_union")h.unionErrors.map(c);else if(h.code==="invalid_return_type")c(h.returnTypeError);else if(h.code==="invalid_arguments")c(h.argumentsError);else if(h.path.length===0)u._errors.push(i(h));else{let y=u,p=0;for(;p<h.path.length;){const g=h.path[p];p===h.path.length-1?(y[g]=y[g]||{_errors:[]},y[g]._errors.push(i(h))):y[g]=y[g]||{_errors:[]},y=y[g],p++}}};return c(this),u}static assert(n){if(!(n instanceof jt))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Te.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=i=>i.message){const i={},u=[];for(const c of this.issues)c.path.length>0?(i[c.path[0]]=i[c.path[0]]||[],i[c.path[0]].push(n(c))):u.push(n(c));return{formErrors:u,fieldErrors:i}}get formErrors(){return this.flatten()}}jt.create=s=>new jt(s);const Zi=(s,n)=>{let i;switch(s.code){case z.invalid_type:s.received===V.undefined?i="Required":i=`Expected ${s.expected}, received ${s.received}`;break;case z.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(s.expected,Te.jsonStringifyReplacer)}`;break;case z.unrecognized_keys:i=`Unrecognized key(s) in object: ${Te.joinValues(s.keys,", ")}`;break;case z.invalid_union:i="Invalid input";break;case z.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${Te.joinValues(s.options)}`;break;case z.invalid_enum_value:i=`Invalid enum value. Expected ${Te.joinValues(s.options)}, received '${s.received}'`;break;case z.invalid_arguments:i="Invalid function arguments";break;case z.invalid_return_type:i="Invalid function return type";break;case z.invalid_date:i="Invalid date";break;case z.invalid_string:typeof s.validation=="object"?"includes"in s.validation?(i=`Invalid input: must include "${s.validation.includes}"`,typeof s.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${s.validation.position}`)):"startsWith"in s.validation?i=`Invalid input: must start with "${s.validation.startsWith}"`:"endsWith"in s.validation?i=`Invalid input: must end with "${s.validation.endsWith}"`:Te.assertNever(s.validation):s.validation!=="regex"?i=`Invalid ${s.validation}`:i="Invalid";break;case z.too_small:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at least":"more than"} ${s.minimum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at least":"over"} ${s.minimum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${s.minimum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly equal to ":s.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(s.minimum))}`:i="Invalid input";break;case z.too_big:s.type==="array"?i=`Array must contain ${s.exact?"exactly":s.inclusive?"at most":"less than"} ${s.maximum} element(s)`:s.type==="string"?i=`String must contain ${s.exact?"exactly":s.inclusive?"at most":"under"} ${s.maximum} character(s)`:s.type==="number"?i=`Number must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="bigint"?i=`BigInt must be ${s.exact?"exactly":s.inclusive?"less than or equal to":"less than"} ${s.maximum}`:s.type==="date"?i=`Date must be ${s.exact?"exactly":s.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(s.maximum))}`:i="Invalid input";break;case z.custom:i="Invalid input";break;case z.invalid_intersection_types:i="Intersection results could not be merged";break;case z.not_multiple_of:i=`Number must be a multiple of ${s.multipleOf}`;break;case z.not_finite:i="Number must be finite";break;default:i=n.defaultError,Te.assertNever(s)}return{message:i}};let Nm=Zi;function u0(s){Nm=s}function Bu(){return Nm}const qu=s=>{const{data:n,path:i,errorMaps:u,issueData:c}=s,f=[...i,...c.path||[]],h={...c,path:f};if(c.message!==void 0)return{...c,path:f,message:c.message};let y="";const p=u.filter(g=>!!g).slice().reverse();for(const g of p)y=g(h,{data:n,defaultError:y}).message;return{...c,path:f,message:y}},r0=[];function H(s,n){const i=Bu(),u=qu({issueData:n,data:s.data,path:s.path,errorMaps:[s.common.contextualErrorMap,s.schemaErrorMap,i,i===Zi?void 0:Zi].filter(c=>!!c)});s.common.issues.push(u)}class bt{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,i){const u=[];for(const c of i){if(c.status==="aborted")return ae;c.status==="dirty"&&n.dirty(),u.push(c.value)}return{status:n.value,value:u}}static async mergeObjectAsync(n,i){const u=[];for(const c of i){const f=await c.key,h=await c.value;u.push({key:f,value:h})}return bt.mergeObjectSync(n,u)}static mergeObjectSync(n,i){const u={};for(const c of i){const{key:f,value:h}=c;if(f.status==="aborted"||h.status==="aborted")return ae;f.status==="dirty"&&n.dirty(),h.status==="dirty"&&n.dirty(),f.value!=="__proto__"&&(typeof h.value<"u"||c.alwaysSet)&&(u[f.value]=h.value)}return{status:n.value,value:u}}}const ae=Object.freeze({status:"aborted"}),Ui=s=>({status:"dirty",value:s}),At=s=>({status:"valid",value:s}),wo=s=>s.status==="aborted",Ro=s=>s.status==="dirty",Ga=s=>s.status==="valid",Fl=s=>typeof Promise<"u"&&s instanceof Promise;function Zu(s,n,i,u){if(typeof n=="function"?s!==n||!0:!n.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return n.get(s)}function Cm(s,n,i,u,c){if(typeof n=="function"?s!==n||!0:!n.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n.set(s,i),i}var Q;(function(s){s.errToObj=n=>typeof n=="string"?{message:n}:n||{},s.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(Q||(Q={}));var Gl,$l;class Sn{constructor(n,i,u,c){this._cachedPath=[],this.parent=n,this.data=i,this._path=u,this._key=c}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 lm=(s,n)=>{if(Ga(n))return{success:!0,data:n.value};if(!s.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new jt(s.common.issues);return this._error=i,this._error}}};function ue(s){if(!s)return{};const{errorMap:n,invalid_type_error:i,required_error:u,description:c}=s;if(n&&(i||u))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:c}:{errorMap:(h,y)=>{var p,g;const{message:_}=s;return h.code==="invalid_enum_value"?{message:_??y.defaultError}:typeof y.data>"u"?{message:(p=_??u)!==null&&p!==void 0?p:y.defaultError}:h.code!=="invalid_type"?{message:y.defaultError}:{message:(g=_??i)!==null&&g!==void 0?g:y.defaultError}},description:c}}class oe{get description(){return this._def.description}_getType(n){return Ln(n.data)}_getOrReturnCtx(n,i){return i||{common:n.parent.common,data:n.data,parsedType:Ln(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new bt,ctx:{common:n.parent.common,data:n.data,parsedType:Ln(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const i=this._parse(n);if(Fl(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(n){const i=this._parse(n);return Promise.resolve(i)}parse(n,i){const u=this.safeParse(n,i);if(u.success)return u.data;throw u.error}safeParse(n,i){var u;const c={common:{issues:[],async:(u=i==null?void 0:i.async)!==null&&u!==void 0?u:!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Ln(n)},f=this._parseSync({data:n,path:c.path,parent:c});return lm(c,f)}"~validate"(n){var i,u;const c={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Ln(n)};if(!this["~standard"].async)try{const f=this._parseSync({data:n,path:[],parent:c});return Ga(f)?{value:f.value}:{issues:c.common.issues}}catch(f){!((u=(i=f==null?void 0:f.message)===null||i===void 0?void 0:i.toLowerCase())===null||u===void 0)&&u.includes("encountered")&&(this["~standard"].async=!0),c.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:c}).then(f=>Ga(f)?{value:f.value}:{issues:c.common.issues})}async parseAsync(n,i){const u=await this.safeParseAsync(n,i);if(u.success)return u.data;throw u.error}async safeParseAsync(n,i){const u={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:Ln(n)},c=this._parse({data:n,path:u.path,parent:u}),f=await(Fl(c)?c:Promise.resolve(c));return lm(u,f)}refine(n,i){const u=c=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(c):i;return this._refinement((c,f)=>{const h=n(c),y=()=>f.addIssue({code:z.custom,...u(c)});return typeof Promise<"u"&&h instanceof Promise?h.then(p=>p?!0:(y(),!1)):h?!0:(y(),!1)})}refinement(n,i){return this._refinement((u,c)=>n(u)?!0:(c.addIssue(typeof i=="function"?i(u,c):i),!1))}_refinement(n){return new un({schema:this,typeName:ne.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,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),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return gn.create(this,this._def)}nullable(){return ba.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sn.create(this)}promise(){return Vi.create(this,this._def)}or(n){return es.create([this,n],this._def)}and(n){return ts.create(this,n,this._def)}transform(n){return new un({...ue(this._def),schema:this,typeName:ne.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const i=typeof n=="function"?n:()=>n;return new ss({...ue(this._def),innerType:this,defaultValue:i,typeName:ne.ZodDefault})}brand(){return new Io({typeName:ne.ZodBranded,type:this,...ue(this._def)})}catch(n){const i=typeof n=="function"?n:()=>n;return new us({...ue(this._def),innerType:this,catchValue:i,typeName:ne.ZodCatch})}describe(n){const i=this.constructor;return new i({...this._def,description:n})}pipe(n){return ds.create(this,n)}readonly(){return rs.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const c0=/^c[^\s-]{8,}$/i,o0=/^[0-9a-z]+$/,f0=/^[0-9A-HJKMNP-TV-Z]{26}$/i,d0=/^[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,h0=/^[a-z0-9_-]{21}$/i,y0=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,m0=/^[-+]?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)?)??$/,p0=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,g0="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let mo;const v0=/^(?:(?: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])$/,b0=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,_0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,S0=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,T0=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,E0=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Dm="((\\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])))",A0=new RegExp(`^${Dm}$`);function zm(s){let n="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return s.precision?n=`${n}\\.\\d{${s.precision}}`:s.precision==null&&(n=`${n}(\\.\\d+)?`),n}function O0(s){return new RegExp(`^${zm(s)}$`)}function Um(s){let n=`${Dm}T${zm(s)}`;const i=[];return i.push(s.local?"Z?":"Z"),s.offset&&i.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${i.join("|")})`,new RegExp(`^${n}$`)}function w0(s,n){return!!((n==="v4"||!n)&&v0.test(s)||(n==="v6"||!n)&&_0.test(s))}function R0(s,n){if(!y0.test(s))return!1;try{const[i]=s.split("."),u=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),c=JSON.parse(atob(u));return!(typeof c!="object"||c===null||!c.typ||!c.alg||n&&c.alg!==n)}catch{return!1}}function x0(s,n){return!!((n==="v4"||!n)&&b0.test(s)||(n==="v6"||!n)&&S0.test(s))}class ln extends oe{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==V.string){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.string,received:f.parsedType}),ae}const u=new bt;let c;for(const f of this._def.checks)if(f.kind==="min")n.data.length<f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="max")n.data.length>f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!1,message:f.message}),u.dirty());else if(f.kind==="length"){const h=n.data.length>f.value,y=n.data.length<f.value;(h||y)&&(c=this._getOrReturnCtx(n,c),h?H(c,{code:z.too_big,maximum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}):y&&H(c,{code:z.too_small,minimum:f.value,type:"string",inclusive:!0,exact:!0,message:f.message}),u.dirty())}else if(f.kind==="email")p0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"email",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="emoji")mo||(mo=new RegExp(g0,"u")),mo.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"emoji",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="uuid")d0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"uuid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="nanoid")h0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"nanoid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid")c0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cuid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="cuid2")o0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cuid2",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="ulid")f0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"ulid",code:z.invalid_string,message:f.message}),u.dirty());else if(f.kind==="url")try{new URL(n.data)}catch{c=this._getOrReturnCtx(n,c),H(c,{validation:"url",code:z.invalid_string,message:f.message}),u.dirty()}else f.kind==="regex"?(f.regex.lastIndex=0,f.regex.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"regex",code:z.invalid_string,message:f.message}),u.dirty())):f.kind==="trim"?n.data=n.data.trim():f.kind==="includes"?n.data.includes(f.value,f.position)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{includes:f.value,position:f.position},message:f.message}),u.dirty()):f.kind==="toLowerCase"?n.data=n.data.toLowerCase():f.kind==="toUpperCase"?n.data=n.data.toUpperCase():f.kind==="startsWith"?n.data.startsWith(f.value)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{startsWith:f.value},message:f.message}),u.dirty()):f.kind==="endsWith"?n.data.endsWith(f.value)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:{endsWith:f.value},message:f.message}),u.dirty()):f.kind==="datetime"?Um(f).test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"datetime",message:f.message}),u.dirty()):f.kind==="date"?A0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"date",message:f.message}),u.dirty()):f.kind==="time"?O0(f).test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{code:z.invalid_string,validation:"time",message:f.message}),u.dirty()):f.kind==="duration"?m0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"duration",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="ip"?w0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"ip",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="jwt"?R0(n.data,f.alg)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"jwt",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="cidr"?x0(n.data,f.version)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"cidr",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="base64"?T0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"base64",code:z.invalid_string,message:f.message}),u.dirty()):f.kind==="base64url"?E0.test(n.data)||(c=this._getOrReturnCtx(n,c),H(c,{validation:"base64url",code:z.invalid_string,message:f.message}),u.dirty()):Te.assertNever(f);return{status:u.value,value:n.data}}_regex(n,i,u){return this.refinement(c=>n.test(c),{validation:i,code:z.invalid_string,...Q.errToObj(u)})}_addCheck(n){return new ln({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Q.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Q.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Q.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Q.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...Q.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Q.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Q.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Q.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...Q.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...Q.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...Q.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Q.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...Q.errToObj(n)})}datetime(n){var i,u;return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(i=n==null?void 0:n.offset)!==null&&i!==void 0?i:!1,local:(u=n==null?void 0:n.local)!==null&&u!==void 0?u:!1,...Q.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...Q.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...Q.errToObj(n)})}regex(n,i){return this._addCheck({kind:"regex",regex:n,...Q.errToObj(i)})}includes(n,i){return this._addCheck({kind:"includes",value:n,position:i==null?void 0:i.position,...Q.errToObj(i==null?void 0:i.message)})}startsWith(n,i){return this._addCheck({kind:"startsWith",value:n,...Q.errToObj(i)})}endsWith(n,i){return this._addCheck({kind:"endsWith",value:n,...Q.errToObj(i)})}min(n,i){return this._addCheck({kind:"min",value:n,...Q.errToObj(i)})}max(n,i){return this._addCheck({kind:"max",value:n,...Q.errToObj(i)})}length(n,i){return this._addCheck({kind:"length",value:n,...Q.errToObj(i)})}nonempty(n){return this.min(1,Q.errToObj(n))}trim(){return new ln({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ln({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxLength(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}ln.create=s=>{var n;return new ln({checks:[],typeName:ne.ZodString,coerce:(n=s==null?void 0:s.coerce)!==null&&n!==void 0?n:!1,...ue(s)})};function k0(s,n){const i=(s.toString().split(".")[1]||"").length,u=(n.toString().split(".")[1]||"").length,c=i>u?i:u,f=parseInt(s.toFixed(c).replace(".","")),h=parseInt(n.toFixed(c).replace(".",""));return f%h/Math.pow(10,c)}class pa extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==V.number){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.number,received:f.parsedType}),ae}let u;const c=new bt;for(const f of this._def.checks)f.kind==="int"?Te.isInteger(n.data)||(u=this._getOrReturnCtx(n,u),H(u,{code:z.invalid_type,expected:"integer",received:"float",message:f.message}),c.dirty()):f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_small,minimum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_big,maximum:f.value,type:"number",inclusive:f.inclusive,exact:!1,message:f.message}),c.dirty()):f.kind==="multipleOf"?k0(n.data,f.value)!==0&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):f.kind==="finite"?Number.isFinite(n.data)||(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_finite,message:f.message}),c.dirty()):Te.assertNever(f);return{status:c.value,value:n.data}}gte(n,i){return this.setLimit("min",n,!0,Q.toString(i))}gt(n,i){return this.setLimit("min",n,!1,Q.toString(i))}lte(n,i){return this.setLimit("max",n,!0,Q.toString(i))}lt(n,i){return this.setLimit("max",n,!1,Q.toString(i))}setLimit(n,i,u,c){return new pa({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:u,message:Q.toString(c)}]})}_addCheck(n){return new pa({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Q.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Q.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Q.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Q.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Q.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:Q.toString(i)})}finite(n){return this._addCheck({kind:"finite",message:Q.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Q.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Q.toString(n)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&Te.isInteger(n.value))}get isFinite(){let n=null,i=null;for(const u of this._def.checks){if(u.kind==="finite"||u.kind==="int"||u.kind==="multipleOf")return!0;u.kind==="min"?(i===null||u.value>i)&&(i=u.value):u.kind==="max"&&(n===null||u.value<n)&&(n=u.value)}return Number.isFinite(i)&&Number.isFinite(n)}}pa.create=s=>new pa({checks:[],typeName:ne.ZodNumber,coerce:(s==null?void 0:s.coerce)||!1,...ue(s)});class ga extends oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==V.bigint)return this._getInvalidInput(n);let u;const c=new bt;for(const f of this._def.checks)f.kind==="min"?(f.inclusive?n.data<f.value:n.data<=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_small,type:"bigint",minimum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="max"?(f.inclusive?n.data>f.value:n.data>=f.value)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.too_big,type:"bigint",maximum:f.value,inclusive:f.inclusive,message:f.message}),c.dirty()):f.kind==="multipleOf"?n.data%f.value!==BigInt(0)&&(u=this._getOrReturnCtx(n,u),H(u,{code:z.not_multiple_of,multipleOf:f.value,message:f.message}),c.dirty()):Te.assertNever(f);return{status:c.value,value:n.data}}_getInvalidInput(n){const i=this._getOrReturnCtx(n);return H(i,{code:z.invalid_type,expected:V.bigint,received:i.parsedType}),ae}gte(n,i){return this.setLimit("min",n,!0,Q.toString(i))}gt(n,i){return this.setLimit("min",n,!1,Q.toString(i))}lte(n,i){return this.setLimit("max",n,!0,Q.toString(i))}lt(n,i){return this.setLimit("max",n,!1,Q.toString(i))}setLimit(n,i,u,c){return new ga({...this._def,checks:[...this._def.checks,{kind:n,value:i,inclusive:u,message:Q.toString(c)}]})}_addCheck(n){return new ga({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Q.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Q.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Q.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Q.toString(n)})}multipleOf(n,i){return this._addCheck({kind:"multipleOf",value:n,message:Q.toString(i)})}get minValue(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n}get maxValue(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n}}ga.create=s=>{var n;return new ga({checks:[],typeName:ne.ZodBigInt,coerce:(n=s==null?void 0:s.coerce)!==null&&n!==void 0?n:!1,...ue(s)})};class Wl extends oe{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==V.boolean){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.boolean,received:u.parsedType}),ae}return At(n.data)}}Wl.create=s=>new Wl({typeName:ne.ZodBoolean,coerce:(s==null?void 0:s.coerce)||!1,...ue(s)});class $a extends oe{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==V.date){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_type,expected:V.date,received:f.parsedType}),ae}if(isNaN(n.data.getTime())){const f=this._getOrReturnCtx(n);return H(f,{code:z.invalid_date}),ae}const u=new bt;let c;for(const f of this._def.checks)f.kind==="min"?n.data.getTime()<f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_small,message:f.message,inclusive:!0,exact:!1,minimum:f.value,type:"date"}),u.dirty()):f.kind==="max"?n.data.getTime()>f.value&&(c=this._getOrReturnCtx(n,c),H(c,{code:z.too_big,message:f.message,inclusive:!0,exact:!1,maximum:f.value,type:"date"}),u.dirty()):Te.assertNever(f);return{status:u.value,value:new Date(n.data.getTime())}}_addCheck(n){return new $a({...this._def,checks:[...this._def.checks,n]})}min(n,i){return this._addCheck({kind:"min",value:n.getTime(),message:Q.toString(i)})}max(n,i){return this._addCheck({kind:"max",value:n.getTime(),message:Q.toString(i)})}get minDate(){let n=null;for(const i of this._def.checks)i.kind==="min"&&(n===null||i.value>n)&&(n=i.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const i of this._def.checks)i.kind==="max"&&(n===null||i.value<n)&&(n=i.value);return n!=null?new Date(n):null}}$a.create=s=>new $a({checks:[],coerce:(s==null?void 0:s.coerce)||!1,typeName:ne.ZodDate,...ue(s)});class Hu extends oe{_parse(n){if(this._getType(n)!==V.symbol){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.symbol,received:u.parsedType}),ae}return At(n.data)}}Hu.create=s=>new Hu({typeName:ne.ZodSymbol,...ue(s)});class Il extends oe{_parse(n){if(this._getType(n)!==V.undefined){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.undefined,received:u.parsedType}),ae}return At(n.data)}}Il.create=s=>new Il({typeName:ne.ZodUndefined,...ue(s)});class Pl extends oe{_parse(n){if(this._getType(n)!==V.null){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.null,received:u.parsedType}),ae}return At(n.data)}}Pl.create=s=>new Pl({typeName:ne.ZodNull,...ue(s)});class Hi extends oe{constructor(){super(...arguments),this._any=!0}_parse(n){return At(n.data)}}Hi.create=s=>new Hi({typeName:ne.ZodAny,...ue(s)});class Ka extends oe{constructor(){super(...arguments),this._unknown=!0}_parse(n){return At(n.data)}}Ka.create=s=>new Ka({typeName:ne.ZodUnknown,...ue(s)});class Kn extends oe{_parse(n){const i=this._getOrReturnCtx(n);return H(i,{code:z.invalid_type,expected:V.never,received:i.parsedType}),ae}}Kn.create=s=>new Kn({typeName:ne.ZodNever,...ue(s)});class Vu extends oe{_parse(n){if(this._getType(n)!==V.undefined){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.void,received:u.parsedType}),ae}return At(n.data)}}Vu.create=s=>new Vu({typeName:ne.ZodVoid,...ue(s)});class sn extends oe{_parse(n){const{ctx:i,status:u}=this._processInputParams(n),c=this._def;if(i.parsedType!==V.array)return H(i,{code:z.invalid_type,expected:V.array,received:i.parsedType}),ae;if(c.exactLength!==null){const h=i.data.length>c.exactLength.value,y=i.data.length<c.exactLength.value;(h||y)&&(H(i,{code:h?z.too_big:z.too_small,minimum:y?c.exactLength.value:void 0,maximum:h?c.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:c.exactLength.message}),u.dirty())}if(c.minLength!==null&&i.data.length<c.minLength.value&&(H(i,{code:z.too_small,minimum:c.minLength.value,type:"array",inclusive:!0,exact:!1,message:c.minLength.message}),u.dirty()),c.maxLength!==null&&i.data.length>c.maxLength.value&&(H(i,{code:z.too_big,maximum:c.maxLength.value,type:"array",inclusive:!0,exact:!1,message:c.maxLength.message}),u.dirty()),i.common.async)return Promise.all([...i.data].map((h,y)=>c.type._parseAsync(new Sn(i,h,i.path,y)))).then(h=>bt.mergeArray(u,h));const f=[...i.data].map((h,y)=>c.type._parseSync(new Sn(i,h,i.path,y)));return bt.mergeArray(u,f)}get element(){return this._def.type}min(n,i){return new sn({...this._def,minLength:{value:n,message:Q.toString(i)}})}max(n,i){return new sn({...this._def,maxLength:{value:n,message:Q.toString(i)}})}length(n,i){return new sn({...this._def,exactLength:{value:n,message:Q.toString(i)}})}nonempty(n){return this.min(1,n)}}sn.create=(s,n)=>new sn({type:s,minLength:null,maxLength:null,exactLength:null,typeName:ne.ZodArray,...ue(n)});function Ci(s){if(s instanceof He){const n={};for(const i in s.shape){const u=s.shape[i];n[i]=gn.create(Ci(u))}return new He({...s._def,shape:()=>n})}else return s instanceof sn?new sn({...s._def,type:Ci(s.element)}):s instanceof gn?gn.create(Ci(s.unwrap())):s instanceof ba?ba.create(Ci(s.unwrap())):s instanceof Tn?Tn.create(s.items.map(n=>Ci(n))):s}class He extends oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),i=Te.objectKeys(n);return this._cached={shape:n,keys:i}}_parse(n){if(this._getType(n)!==V.object){const g=this._getOrReturnCtx(n);return H(g,{code:z.invalid_type,expected:V.object,received:g.parsedType}),ae}const{status:u,ctx:c}=this._processInputParams(n),{shape:f,keys:h}=this._getCached(),y=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const g in c.data)h.includes(g)||y.push(g);const p=[];for(const g of h){const _=f[g],O=c.data[g];p.push({key:{status:"valid",value:g},value:_._parse(new Sn(c,O,c.path,g)),alwaysSet:g in c.data})}if(this._def.catchall instanceof Kn){const g=this._def.unknownKeys;if(g==="passthrough")for(const _ of y)p.push({key:{status:"valid",value:_},value:{status:"valid",value:c.data[_]}});else if(g==="strict")y.length>0&&(H(c,{code:z.unrecognized_keys,keys:y}),u.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const g=this._def.catchall;for(const _ of y){const O=c.data[_];p.push({key:{status:"valid",value:_},value:g._parse(new Sn(c,O,c.path,_)),alwaysSet:_ in c.data})}}return c.common.async?Promise.resolve().then(async()=>{const g=[];for(const _ of p){const O=await _.key,C=await _.value;g.push({key:O,value:C,alwaysSet:_.alwaysSet})}return g}).then(g=>bt.mergeObjectSync(u,g)):bt.mergeObjectSync(u,p)}get shape(){return this._def.shape()}strict(n){return Q.errToObj,new He({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(i,u)=>{var c,f,h,y;const p=(h=(f=(c=this._def).errorMap)===null||f===void 0?void 0:f.call(c,i,u).message)!==null&&h!==void 0?h:u.defaultError;return i.code==="unrecognized_keys"?{message:(y=Q.errToObj(n).message)!==null&&y!==void 0?y:p}:{message:p}}}:{}})}strip(){return new He({...this._def,unknownKeys:"strip"})}passthrough(){return new He({...this._def,unknownKeys:"passthrough"})}extend(n){return new He({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new He({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:ne.ZodObject})}setKey(n,i){return this.augment({[n]:i})}catchall(n){return new He({...this._def,catchall:n})}pick(n){const i={};return Te.objectKeys(n).forEach(u=>{n[u]&&this.shape[u]&&(i[u]=this.shape[u])}),new He({...this._def,shape:()=>i})}omit(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{n[u]||(i[u]=this.shape[u])}),new He({...this._def,shape:()=>i})}deepPartial(){return Ci(this)}partial(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{const c=this.shape[u];n&&!n[u]?i[u]=c:i[u]=c.optional()}),new He({...this._def,shape:()=>i})}required(n){const i={};return Te.objectKeys(this.shape).forEach(u=>{if(n&&!n[u])i[u]=this.shape[u];else{let f=this.shape[u];for(;f instanceof gn;)f=f._def.innerType;i[u]=f}}),new He({...this._def,shape:()=>i})}keyof(){return jm(Te.objectKeys(this.shape))}}He.create=(s,n)=>new He({shape:()=>s,unknownKeys:"strip",catchall:Kn.create(),typeName:ne.ZodObject,...ue(n)});He.strictCreate=(s,n)=>new He({shape:()=>s,unknownKeys:"strict",catchall:Kn.create(),typeName:ne.ZodObject,...ue(n)});He.lazycreate=(s,n)=>new He({shape:s,unknownKeys:"strip",catchall:Kn.create(),typeName:ne.ZodObject,...ue(n)});class es extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u=this._def.options;function c(f){for(const y of f)if(y.result.status==="valid")return y.result;for(const y of f)if(y.result.status==="dirty")return i.common.issues.push(...y.ctx.common.issues),y.result;const h=f.map(y=>new jt(y.ctx.common.issues));return H(i,{code:z.invalid_union,unionErrors:h}),ae}if(i.common.async)return Promise.all(u.map(async f=>{const h={...i,common:{...i.common,issues:[]},parent:null};return{result:await f._parseAsync({data:i.data,path:i.path,parent:h}),ctx:h}})).then(c);{let f;const h=[];for(const p of u){const g={...i,common:{...i.common,issues:[]},parent:null},_=p._parseSync({data:i.data,path:i.path,parent:g});if(_.status==="valid")return _;_.status==="dirty"&&!f&&(f={result:_,ctx:g}),g.common.issues.length&&h.push(g.common.issues)}if(f)return i.common.issues.push(...f.ctx.common.issues),f.result;const y=h.map(p=>new jt(p));return H(i,{code:z.invalid_union,unionErrors:y}),ae}}get options(){return this._def.options}}es.create=(s,n)=>new es({options:s,typeName:ne.ZodUnion,...ue(n)});const Vn=s=>s instanceof as?Vn(s.schema):s instanceof un?Vn(s.innerType()):s instanceof is?[s.value]:s instanceof va?s.options:s instanceof ls?Te.objectValues(s.enum):s instanceof ss?Vn(s._def.innerType):s instanceof Il?[void 0]:s instanceof Pl?[null]:s instanceof gn?[void 0,...Vn(s.unwrap())]:s instanceof ba?[null,...Vn(s.unwrap())]:s instanceof Io||s instanceof rs?Vn(s.unwrap()):s instanceof us?Vn(s._def.innerType):[];class Qu extends oe{_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.object)return H(i,{code:z.invalid_type,expected:V.object,received:i.parsedType}),ae;const u=this.discriminator,c=i.data[u],f=this.optionsMap.get(c);return f?i.common.async?f._parseAsync({data:i.data,path:i.path,parent:i}):f._parseSync({data:i.data,path:i.path,parent:i}):(H(i,{code:z.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[u]}),ae)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(n,i,u){const c=new Map;for(const f of i){const h=Vn(f.shape[n]);if(!h.length)throw new Error(`A discriminator value for key \`${n}\` could not be extracted from all schema options`);for(const y of h){if(c.has(y))throw new Error(`Discriminator property ${String(n)} has duplicate value ${String(y)}`);c.set(y,f)}}return new Qu({typeName:ne.ZodDiscriminatedUnion,discriminator:n,options:i,optionsMap:c,...ue(u)})}}function xo(s,n){const i=Ln(s),u=Ln(n);if(s===n)return{valid:!0,data:s};if(i===V.object&&u===V.object){const c=Te.objectKeys(n),f=Te.objectKeys(s).filter(y=>c.indexOf(y)!==-1),h={...s,...n};for(const y of f){const p=xo(s[y],n[y]);if(!p.valid)return{valid:!1};h[y]=p.data}return{valid:!0,data:h}}else if(i===V.array&&u===V.array){if(s.length!==n.length)return{valid:!1};const c=[];for(let f=0;f<s.length;f++){const h=s[f],y=n[f],p=xo(h,y);if(!p.valid)return{valid:!1};c.push(p.data)}return{valid:!0,data:c}}else return i===V.date&&u===V.date&&+s==+n?{valid:!0,data:s}:{valid:!1}}class ts extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n),c=(f,h)=>{if(wo(f)||wo(h))return ae;const y=xo(f.value,h.value);return y.valid?((Ro(f)||Ro(h))&&i.dirty(),{status:i.value,value:y.data}):(H(u,{code:z.invalid_intersection_types}),ae)};return u.common.async?Promise.all([this._def.left._parseAsync({data:u.data,path:u.path,parent:u}),this._def.right._parseAsync({data:u.data,path:u.path,parent:u})]).then(([f,h])=>c(f,h)):c(this._def.left._parseSync({data:u.data,path:u.path,parent:u}),this._def.right._parseSync({data:u.data,path:u.path,parent:u}))}}ts.create=(s,n,i)=>new ts({left:s,right:n,typeName:ne.ZodIntersection,...ue(i)});class Tn extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.array)return H(u,{code:z.invalid_type,expected:V.array,received:u.parsedType}),ae;if(u.data.length<this._def.items.length)return H(u,{code:z.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ae;!this._def.rest&&u.data.length>this._def.items.length&&(H(u,{code:z.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const f=[...u.data].map((h,y)=>{const p=this._def.items[y]||this._def.rest;return p?p._parse(new Sn(u,h,u.path,y)):null}).filter(h=>!!h);return u.common.async?Promise.all(f).then(h=>bt.mergeArray(i,h)):bt.mergeArray(i,f)}get items(){return this._def.items}rest(n){return new Tn({...this._def,rest:n})}}Tn.create=(s,n)=>{if(!Array.isArray(s))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Tn({items:s,typeName:ne.ZodTuple,rest:null,...ue(n)})};class ns extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.object)return H(u,{code:z.invalid_type,expected:V.object,received:u.parsedType}),ae;const c=[],f=this._def.keyType,h=this._def.valueType;for(const y in u.data)c.push({key:f._parse(new Sn(u,y,u.path,y)),value:h._parse(new Sn(u,u.data[y],u.path,y)),alwaysSet:y in u.data});return u.common.async?bt.mergeObjectAsync(i,c):bt.mergeObjectSync(i,c)}get element(){return this._def.valueType}static create(n,i,u){return i instanceof oe?new ns({keyType:n,valueType:i,typeName:ne.ZodRecord,...ue(u)}):new ns({keyType:ln.create(),valueType:n,typeName:ne.ZodRecord,...ue(i)})}}class Lu extends oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.map)return H(u,{code:z.invalid_type,expected:V.map,received:u.parsedType}),ae;const c=this._def.keyType,f=this._def.valueType,h=[...u.data.entries()].map(([y,p],g)=>({key:c._parse(new Sn(u,y,u.path,[g,"key"])),value:f._parse(new Sn(u,p,u.path,[g,"value"]))}));if(u.common.async){const y=new Map;return Promise.resolve().then(async()=>{for(const p of h){const g=await p.key,_=await p.value;if(g.status==="aborted"||_.status==="aborted")return ae;(g.status==="dirty"||_.status==="dirty")&&i.dirty(),y.set(g.value,_.value)}return{status:i.value,value:y}})}else{const y=new Map;for(const p of h){const g=p.key,_=p.value;if(g.status==="aborted"||_.status==="aborted")return ae;(g.status==="dirty"||_.status==="dirty")&&i.dirty(),y.set(g.value,_.value)}return{status:i.value,value:y}}}}Lu.create=(s,n,i)=>new Lu({valueType:n,keyType:s,typeName:ne.ZodMap,...ue(i)});class Xa extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.parsedType!==V.set)return H(u,{code:z.invalid_type,expected:V.set,received:u.parsedType}),ae;const c=this._def;c.minSize!==null&&u.data.size<c.minSize.value&&(H(u,{code:z.too_small,minimum:c.minSize.value,type:"set",inclusive:!0,exact:!1,message:c.minSize.message}),i.dirty()),c.maxSize!==null&&u.data.size>c.maxSize.value&&(H(u,{code:z.too_big,maximum:c.maxSize.value,type:"set",inclusive:!0,exact:!1,message:c.maxSize.message}),i.dirty());const f=this._def.valueType;function h(p){const g=new Set;for(const _ of p){if(_.status==="aborted")return ae;_.status==="dirty"&&i.dirty(),g.add(_.value)}return{status:i.value,value:g}}const y=[...u.data.values()].map((p,g)=>f._parse(new Sn(u,p,u.path,g)));return u.common.async?Promise.all(y).then(p=>h(p)):h(y)}min(n,i){return new Xa({...this._def,minSize:{value:n,message:Q.toString(i)}})}max(n,i){return new Xa({...this._def,maxSize:{value:n,message:Q.toString(i)}})}size(n,i){return this.min(n,i).max(n,i)}nonempty(n){return this.min(1,n)}}Xa.create=(s,n)=>new Xa({valueType:s,minSize:null,maxSize:null,typeName:ne.ZodSet,...ue(n)});class ji extends oe{constructor(){super(...arguments),this.validate=this.implement}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.function)return H(i,{code:z.invalid_type,expected:V.function,received:i.parsedType}),ae;function u(y,p){return qu({data:y,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Bu(),Zi].filter(g=>!!g),issueData:{code:z.invalid_arguments,argumentsError:p}})}function c(y,p){return qu({data:y,path:i.path,errorMaps:[i.common.contextualErrorMap,i.schemaErrorMap,Bu(),Zi].filter(g=>!!g),issueData:{code:z.invalid_return_type,returnTypeError:p}})}const f={errorMap:i.common.contextualErrorMap},h=i.data;if(this._def.returns instanceof Vi){const y=this;return At(async function(...p){const g=new jt([]),_=await y._def.args.parseAsync(p,f).catch(U=>{throw g.addIssue(u(p,U)),g}),O=await Reflect.apply(h,this,_);return await y._def.returns._def.type.parseAsync(O,f).catch(U=>{throw g.addIssue(c(O,U)),g})})}else{const y=this;return At(function(...p){const g=y._def.args.safeParse(p,f);if(!g.success)throw new jt([u(p,g.error)]);const _=Reflect.apply(h,this,g.data),O=y._def.returns.safeParse(_,f);if(!O.success)throw new jt([c(_,O.error)]);return O.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...n){return new ji({...this._def,args:Tn.create(n).rest(Ka.create())})}returns(n){return new ji({...this._def,returns:n})}implement(n){return this.parse(n)}strictImplement(n){return this.parse(n)}static create(n,i,u){return new ji({args:n||Tn.create([]).rest(Ka.create()),returns:i||Ka.create(),typeName:ne.ZodFunction,...ue(u)})}}class as extends oe{get schema(){return this._def.getter()}_parse(n){const{ctx:i}=this._processInputParams(n);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}as.create=(s,n)=>new as({getter:s,typeName:ne.ZodLazy,...ue(n)});class is extends oe{_parse(n){if(n.data!==this._def.value){const i=this._getOrReturnCtx(n);return H(i,{received:i.data,code:z.invalid_literal,expected:this._def.value}),ae}return{status:"valid",value:n.data}}get value(){return this._def.value}}is.create=(s,n)=>new is({value:s,typeName:ne.ZodLiteral,...ue(n)});function jm(s,n){return new va({values:s,typeName:ne.ZodEnum,...ue(n)})}class va extends oe{constructor(){super(...arguments),Gl.set(this,void 0)}_parse(n){if(typeof n.data!="string"){const i=this._getOrReturnCtx(n),u=this._def.values;return H(i,{expected:Te.joinValues(u),received:i.parsedType,code:z.invalid_type}),ae}if(Zu(this,Gl)||Cm(this,Gl,new Set(this._def.values)),!Zu(this,Gl).has(n.data)){const i=this._getOrReturnCtx(n),u=this._def.values;return H(i,{received:i.data,code:z.invalid_enum_value,options:u}),ae}return At(n.data)}get options(){return this._def.values}get enum(){const n={};for(const i of this._def.values)n[i]=i;return n}get Values(){const n={};for(const i of this._def.values)n[i]=i;return n}get Enum(){const n={};for(const i of this._def.values)n[i]=i;return n}extract(n,i=this._def){return va.create(n,{...this._def,...i})}exclude(n,i=this._def){return va.create(this.options.filter(u=>!n.includes(u)),{...this._def,...i})}}Gl=new WeakMap;va.create=jm;class ls extends oe{constructor(){super(...arguments),$l.set(this,void 0)}_parse(n){const i=Te.getValidEnumValues(this._def.values),u=this._getOrReturnCtx(n);if(u.parsedType!==V.string&&u.parsedType!==V.number){const c=Te.objectValues(i);return H(u,{expected:Te.joinValues(c),received:u.parsedType,code:z.invalid_type}),ae}if(Zu(this,$l)||Cm(this,$l,new Set(Te.getValidEnumValues(this._def.values))),!Zu(this,$l).has(n.data)){const c=Te.objectValues(i);return H(u,{received:u.data,code:z.invalid_enum_value,options:c}),ae}return At(n.data)}get enum(){return this._def.values}}$l=new WeakMap;ls.create=(s,n)=>new ls({values:s,typeName:ne.ZodNativeEnum,...ue(n)});class Vi extends oe{unwrap(){return this._def.type}_parse(n){const{ctx:i}=this._processInputParams(n);if(i.parsedType!==V.promise&&i.common.async===!1)return H(i,{code:z.invalid_type,expected:V.promise,received:i.parsedType}),ae;const u=i.parsedType===V.promise?i.data:Promise.resolve(i.data);return At(u.then(c=>this._def.type.parseAsync(c,{path:i.path,errorMap:i.common.contextualErrorMap})))}}Vi.create=(s,n)=>new Vi({type:s,typeName:ne.ZodPromise,...ue(n)});class un extends oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ne.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:i,ctx:u}=this._processInputParams(n),c=this._def.effect||null,f={addIssue:h=>{H(u,h),h.fatal?i.abort():i.dirty()},get path(){return u.path}};if(f.addIssue=f.addIssue.bind(f),c.type==="preprocess"){const h=c.transform(u.data,f);if(u.common.async)return Promise.resolve(h).then(async y=>{if(i.value==="aborted")return ae;const p=await this._def.schema._parseAsync({data:y,path:u.path,parent:u});return p.status==="aborted"?ae:p.status==="dirty"||i.value==="dirty"?Ui(p.value):p});{if(i.value==="aborted")return ae;const y=this._def.schema._parseSync({data:h,path:u.path,parent:u});return y.status==="aborted"?ae:y.status==="dirty"||i.value==="dirty"?Ui(y.value):y}}if(c.type==="refinement"){const h=y=>{const p=c.refinement(y,f);if(u.common.async)return Promise.resolve(p);if(p instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return y};if(u.common.async===!1){const y=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});return y.status==="aborted"?ae:(y.status==="dirty"&&i.dirty(),h(y.value),{status:i.value,value:y.value})}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(y=>y.status==="aborted"?ae:(y.status==="dirty"&&i.dirty(),h(y.value).then(()=>({status:i.value,value:y.value}))))}if(c.type==="transform")if(u.common.async===!1){const h=this._def.schema._parseSync({data:u.data,path:u.path,parent:u});if(!Ga(h))return h;const y=c.transform(h.value,f);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:y}}else return this._def.schema._parseAsync({data:u.data,path:u.path,parent:u}).then(h=>Ga(h)?Promise.resolve(c.transform(h.value,f)).then(y=>({status:i.value,value:y})):h);Te.assertNever(c)}}un.create=(s,n,i)=>new un({schema:s,typeName:ne.ZodEffects,effect:n,...ue(i)});un.createWithPreprocess=(s,n,i)=>new un({schema:n,effect:{type:"preprocess",transform:s},typeName:ne.ZodEffects,...ue(i)});class gn extends oe{_parse(n){return this._getType(n)===V.undefined?At(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}gn.create=(s,n)=>new gn({innerType:s,typeName:ne.ZodOptional,...ue(n)});class ba extends oe{_parse(n){return this._getType(n)===V.null?At(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}ba.create=(s,n)=>new ba({innerType:s,typeName:ne.ZodNullable,...ue(n)});class ss extends oe{_parse(n){const{ctx:i}=this._processInputParams(n);let u=i.data;return i.parsedType===V.undefined&&(u=this._def.defaultValue()),this._def.innerType._parse({data:u,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}ss.create=(s,n)=>new ss({innerType:s,typeName:ne.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...ue(n)});class us extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u={...i,common:{...i.common,issues:[]}},c=this._def.innerType._parse({data:u.data,path:u.path,parent:{...u}});return Fl(c)?c.then(f=>({status:"valid",value:f.status==="valid"?f.value:this._def.catchValue({get error(){return new jt(u.common.issues)},input:u.data})})):{status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new jt(u.common.issues)},input:u.data})}}removeCatch(){return this._def.innerType}}us.create=(s,n)=>new us({innerType:s,typeName:ne.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...ue(n)});class Ku extends oe{_parse(n){if(this._getType(n)!==V.nan){const u=this._getOrReturnCtx(n);return H(u,{code:z.invalid_type,expected:V.nan,received:u.parsedType}),ae}return{status:"valid",value:n.data}}}Ku.create=s=>new Ku({typeName:ne.ZodNaN,...ue(s)});const M0=Symbol("zod_brand");class Io extends oe{_parse(n){const{ctx:i}=this._processInputParams(n),u=i.data;return this._def.type._parse({data:u,path:i.path,parent:i})}unwrap(){return this._def.type}}class ds extends oe{_parse(n){const{status:i,ctx:u}=this._processInputParams(n);if(u.common.async)return(async()=>{const f=await this._def.in._parseAsync({data:u.data,path:u.path,parent:u});return f.status==="aborted"?ae:f.status==="dirty"?(i.dirty(),Ui(f.value)):this._def.out._parseAsync({data:f.value,path:u.path,parent:u})})();{const c=this._def.in._parseSync({data:u.data,path:u.path,parent:u});return c.status==="aborted"?ae:c.status==="dirty"?(i.dirty(),{status:"dirty",value:c.value}):this._def.out._parseSync({data:c.value,path:u.path,parent:u})}}static create(n,i){return new ds({in:n,out:i,typeName:ne.ZodPipeline})}}class rs extends oe{_parse(n){const i=this._def.innerType._parse(n),u=c=>(Ga(c)&&(c.value=Object.freeze(c.value)),c);return Fl(i)?i.then(c=>u(c)):u(i)}unwrap(){return this._def.innerType}}rs.create=(s,n)=>new rs({innerType:s,typeName:ne.ZodReadonly,...ue(n)});function sm(s,n){const i=typeof s=="function"?s(n):typeof s=="string"?{message:s}:s;return typeof i=="string"?{message:i}:i}function Bm(s,n={},i){return s?Hi.create().superRefine((u,c)=>{var f,h;const y=s(u);if(y instanceof Promise)return y.then(p=>{var g,_;if(!p){const O=sm(n,u),C=(_=(g=O.fatal)!==null&&g!==void 0?g:i)!==null&&_!==void 0?_:!0;c.addIssue({code:"custom",...O,fatal:C})}});if(!y){const p=sm(n,u),g=(h=(f=p.fatal)!==null&&f!==void 0?f:i)!==null&&h!==void 0?h:!0;c.addIssue({code:"custom",...p,fatal:g})}}):Hi.create()}const N0={object:He.lazycreate};var ne;(function(s){s.ZodString="ZodString",s.ZodNumber="ZodNumber",s.ZodNaN="ZodNaN",s.ZodBigInt="ZodBigInt",s.ZodBoolean="ZodBoolean",s.ZodDate="ZodDate",s.ZodSymbol="ZodSymbol",s.ZodUndefined="ZodUndefined",s.ZodNull="ZodNull",s.ZodAny="ZodAny",s.ZodUnknown="ZodUnknown",s.ZodNever="ZodNever",s.ZodVoid="ZodVoid",s.ZodArray="ZodArray",s.ZodObject="ZodObject",s.ZodUnion="ZodUnion",s.ZodDiscriminatedUnion="ZodDiscriminatedUnion",s.ZodIntersection="ZodIntersection",s.ZodTuple="ZodTuple",s.ZodRecord="ZodRecord",s.ZodMap="ZodMap",s.ZodSet="ZodSet",s.ZodFunction="ZodFunction",s.ZodLazy="ZodLazy",s.ZodLiteral="ZodLiteral",s.ZodEnum="ZodEnum",s.ZodEffects="ZodEffects",s.ZodNativeEnum="ZodNativeEnum",s.ZodOptional="ZodOptional",s.ZodNullable="ZodNullable",s.ZodDefault="ZodDefault",s.ZodCatch="ZodCatch",s.ZodPromise="ZodPromise",s.ZodBranded="ZodBranded",s.ZodPipeline="ZodPipeline",s.ZodReadonly="ZodReadonly"})(ne||(ne={}));const C0=(s,n={message:`Input not instance of ${s.name}`})=>Bm(i=>i instanceof s,n),qm=ln.create,Zm=pa.create,D0=Ku.create,z0=ga.create,Hm=Wl.create,U0=$a.create,j0=Hu.create,B0=Il.create,q0=Pl.create,Z0=Hi.create,H0=Ka.create,V0=Kn.create,L0=Vu.create,K0=sn.create,Y0=He.create,G0=He.strictCreate,$0=es.create,X0=Qu.create,Q0=ts.create,J0=Tn.create,F0=ns.create,W0=Lu.create,I0=Xa.create,P0=ji.create,e_=as.create,t_=is.create,n_=va.create,a_=ls.create,i_=Vi.create,um=un.create,l_=gn.create,s_=ba.create,u_=un.createWithPreprocess,r_=ds.create,c_=()=>qm().optional(),o_=()=>Zm().optional(),f_=()=>Hm().optional(),d_={string:s=>ln.create({...s,coerce:!0}),number:s=>pa.create({...s,coerce:!0}),boolean:s=>Wl.create({...s,coerce:!0}),bigint:s=>ga.create({...s,coerce:!0}),date:s=>$a.create({...s,coerce:!0})},h_=ae;var xe=Object.freeze({__proto__:null,defaultErrorMap:Zi,setErrorMap:u0,getErrorMap:Bu,makeIssue:qu,EMPTY_PATH:r0,addIssueToContext:H,ParseStatus:bt,INVALID:ae,DIRTY:Ui,OK:At,isAborted:wo,isDirty:Ro,isValid:Ga,isAsync:Fl,get util(){return Te},get objectUtil(){return Oo},ZodParsedType:V,getParsedType:Ln,ZodType:oe,datetimeRegex:Um,ZodString:ln,ZodNumber:pa,ZodBigInt:ga,ZodBoolean:Wl,ZodDate:$a,ZodSymbol:Hu,ZodUndefined:Il,ZodNull:Pl,ZodAny:Hi,ZodUnknown:Ka,ZodNever:Kn,ZodVoid:Vu,ZodArray:sn,ZodObject:He,ZodUnion:es,ZodDiscriminatedUnion:Qu,ZodIntersection:ts,ZodTuple:Tn,ZodRecord:ns,ZodMap:Lu,ZodSet:Xa,ZodFunction:ji,ZodLazy:as,ZodLiteral:is,ZodEnum:va,ZodNativeEnum:ls,ZodPromise:Vi,ZodEffects:un,ZodTransformer:un,ZodOptional:gn,ZodNullable:ba,ZodDefault:ss,ZodCatch:us,ZodNaN:Ku,BRAND:M0,ZodBranded:Io,ZodPipeline:ds,ZodReadonly:rs,custom:Bm,Schema:oe,ZodSchema:oe,late:N0,get ZodFirstPartyTypeKind(){return ne},coerce:d_,any:Z0,array:K0,bigint:z0,boolean:Hm,date:U0,discriminatedUnion:X0,effect:um,enum:n_,function:P0,instanceof:C0,intersection:Q0,lazy:e_,literal:t_,map:W0,nan:D0,nativeEnum:a_,never:V0,null:q0,nullable:s_,number:Zm,object:Y0,oboolean:f_,onumber:o_,optional:l_,ostring:c_,pipeline:r_,preprocess:u_,promise:i_,record:F0,set:I0,strictObject:G0,string:qm,symbol:j0,transformer:um,tuple:J0,undefined:B0,union:$0,unknown:H0,void:L0,NEVER:h_,ZodIssueCode:z,quotelessJson:s0,ZodError:jt});const Vm={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"},po=pm(Vm).map(([s])=>xe.literal(Number(s))),y_=xe.union([po[0],po[1],...po]);xe.tuple([y_,xe.string()]);function m_(){return q.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",children:[q.jsx("title",{children:"Tempest Games Logo"}),q.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.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}}),q.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}}),q.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}}),q.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}}),q.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}}),q.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),q.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}}),q.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}}),q.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}}),q.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}}),q.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}}),q.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 Ju(s){return q.jsx("a",{...s})}const p_={class:"_class_wtkls_1"};function g_(s){return["required",s]}function v_(s){return["optional",s]}function b_(s,n){let i=s;for(const u of n){if(i===null||typeof u!="string")return!1;const c=i[1];if(u in c)i=c[u];else{const f=Object.keys(c).find(h=>h.startsWith("$"));if(f){i=c[f];continue}return!1}}if(i===null)return!0;switch(i[0]){case"required":return!1;case"optional":return!0}}const En=Object.create(null);En.open="0";En.close="1";En.ping="2";En.pong="3";En.message="4";En.upgrade="5";En.noop="6";const Nu=Object.create(null);Object.keys(En).forEach(s=>{Nu[En[s]]=s});const ko={type:"error",data:"parser error"},Lm=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",Km=typeof ArrayBuffer=="function",Ym=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s&&s.buffer instanceof ArrayBuffer,Po=({type:s,data:n},i,u)=>Lm&&n instanceof Blob?i?u(n):rm(n,u):Km&&(n instanceof ArrayBuffer||Ym(n))?i?u(n):rm(new Blob([n]),u):u(En[s]+(n||"")),rm=(s,n)=>{const i=new FileReader;return i.onload=function(){const u=i.result.split(",")[1];n("b"+(u||""))},i.readAsDataURL(s)};function cm(s){return s instanceof Uint8Array?s:s instanceof ArrayBuffer?new Uint8Array(s):new Uint8Array(s.buffer,s.byteOffset,s.byteLength)}let go;function __(s,n){if(Lm&&s.data instanceof Blob)return s.data.arrayBuffer().then(cm).then(n);if(Km&&(s.data instanceof ArrayBuffer||Ym(s.data)))return n(cm(s.data));Po(s,!1,i=>{go||(go=new TextEncoder),n(go.encode(i))})}const om="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Xl=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let s=0;s<om.length;s++)Xl[om.charCodeAt(s)]=s;const S_=s=>{let n=s.length*.75,i=s.length,u,c=0,f,h,y,p;s[s.length-1]==="="&&(n--,s[s.length-2]==="="&&n--);const g=new ArrayBuffer(n),_=new Uint8Array(g);for(u=0;u<i;u+=4)f=Xl[s.charCodeAt(u)],h=Xl[s.charCodeAt(u+1)],y=Xl[s.charCodeAt(u+2)],p=Xl[s.charCodeAt(u+3)],_[c++]=f<<2|h>>4,_[c++]=(h&15)<<4|y>>2,_[c++]=(y&3)<<6|p&63;return g},T_=typeof ArrayBuffer=="function",ef=(s,n)=>{if(typeof s!="string")return{type:"message",data:Gm(s,n)};const i=s.charAt(0);return i==="b"?{type:"message",data:E_(s.substring(1),n)}:Nu[i]?s.length>1?{type:Nu[i],data:s.substring(1)}:{type:Nu[i]}:ko},E_=(s,n)=>{if(T_){const i=S_(s);return Gm(i,n)}else return{base64:!0,data:s}},Gm=(s,n)=>{switch(n){case"blob":return s instanceof Blob?s:new Blob([s]);case"arraybuffer":default:return s instanceof ArrayBuffer?s:s.buffer}},$m="",A_=(s,n)=>{const i=s.length,u=new Array(i);let c=0;s.forEach((f,h)=>{Po(f,!1,y=>{u[h]=y,++c===i&&n(u.join($m))})})},O_=(s,n)=>{const i=s.split($m),u=[];for(let c=0;c<i.length;c++){const f=ef(i[c],n);if(u.push(f),f.type==="error")break}return u};function w_(){return new TransformStream({transform(s,n){__(s,i=>{const u=i.length;let c;if(u<126)c=new Uint8Array(1),new DataView(c.buffer).setUint8(0,u);else if(u<65536){c=new Uint8Array(3);const f=new DataView(c.buffer);f.setUint8(0,126),f.setUint16(1,u)}else{c=new Uint8Array(9);const f=new DataView(c.buffer);f.setUint8(0,127),f.setBigUint64(1,BigInt(u))}s.data&&typeof s.data!="string"&&(c[0]|=128),n.enqueue(c),n.enqueue(i)})}})}let vo;function xu(s){return s.reduce((n,i)=>n+i.length,0)}function ku(s,n){if(s[0].length===n)return s.shift();const i=new Uint8Array(n);let u=0;for(let c=0;c<n;c++)i[c]=s[0][u++],u===s[0].length&&(s.shift(),u=0);return s.length&&u<s[0].length&&(s[0]=s[0].slice(u)),i}function R_(s,n){vo||(vo=new TextDecoder);const i=[];let u=0,c=-1,f=!1;return new TransformStream({transform(h,y){for(i.push(h);;){if(u===0){if(xu(i)<1)break;const p=ku(i,1);f=(p[0]&128)===128,c=p[0]&127,c<126?u=3:c===126?u=1:u=2}else if(u===1){if(xu(i)<2)break;const p=ku(i,2);c=new DataView(p.buffer,p.byteOffset,p.length).getUint16(0),u=3}else if(u===2){if(xu(i)<8)break;const p=ku(i,8),g=new DataView(p.buffer,p.byteOffset,p.length),_=g.getUint32(0);if(_>Math.pow(2,21)-1){y.enqueue(ko);break}c=_*Math.pow(2,32)+g.getUint32(4),u=3}else{if(xu(i)<c)break;const p=ku(i,c);y.enqueue(ef(f?p:vo.decode(p),n)),u=0}if(c===0||c>s){y.enqueue(ko);break}}}})}const Xm=4;function et(s){if(s)return x_(s)}function x_(s){for(var n in et.prototype)s[n]=et.prototype[n];return s}et.prototype.on=et.prototype.addEventListener=function(s,n){return this._callbacks=this._callbacks||{},(this._callbacks["$"+s]=this._callbacks["$"+s]||[]).push(n),this};et.prototype.once=function(s,n){function i(){this.off(s,i),n.apply(this,arguments)}return i.fn=n,this.on(s,i),this};et.prototype.off=et.prototype.removeListener=et.prototype.removeAllListeners=et.prototype.removeEventListener=function(s,n){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var i=this._callbacks["$"+s];if(!i)return this;if(arguments.length==1)return delete this._callbacks["$"+s],this;for(var u,c=0;c<i.length;c++)if(u=i[c],u===n||u.fn===n){i.splice(c,1);break}return i.length===0&&delete this._callbacks["$"+s],this};et.prototype.emit=function(s){this._callbacks=this._callbacks||{};for(var n=new Array(arguments.length-1),i=this._callbacks["$"+s],u=1;u<arguments.length;u++)n[u-1]=arguments[u];if(i){i=i.slice(0);for(var u=0,c=i.length;u<c;++u)i[u].apply(this,n)}return this};et.prototype.emitReserved=et.prototype.emit;et.prototype.listeners=function(s){return this._callbacks=this._callbacks||{},this._callbacks["$"+s]||[]};et.prototype.hasListeners=function(s){return!!this.listeners(s).length};const Fu=typeof Promise=="function"&&typeof Promise.resolve=="function"?n=>Promise.resolve().then(n):(n,i)=>i(n,0),Wt=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),k_="arraybuffer";function Qm(s,...n){return n.reduce((i,u)=>(s.hasOwnProperty(u)&&(i[u]=s[u]),i),{})}const M_=Wt.setTimeout,N_=Wt.clearTimeout;function Wu(s,n){n.useNativeTimers?(s.setTimeoutFn=M_.bind(Wt),s.clearTimeoutFn=N_.bind(Wt)):(s.setTimeoutFn=Wt.setTimeout.bind(Wt),s.clearTimeoutFn=Wt.clearTimeout.bind(Wt))}const C_=1.33;function D_(s){return typeof s=="string"?z_(s):Math.ceil((s.byteLength||s.size)*C_)}function z_(s){let n=0,i=0;for(let u=0,c=s.length;u<c;u++)n=s.charCodeAt(u),n<128?i+=1:n<2048?i+=2:n<55296||n>=57344?i+=3:(u++,i+=4);return i}function Jm(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function U_(s){let n="";for(let i in s)s.hasOwnProperty(i)&&(n.length&&(n+="&"),n+=encodeURIComponent(i)+"="+encodeURIComponent(s[i]));return n}function j_(s){let n={},i=s.split("&");for(let u=0,c=i.length;u<c;u++){let f=i[u].split("=");n[decodeURIComponent(f[0])]=decodeURIComponent(f[1])}return n}class B_ extends Error{constructor(n,i,u){super(n),this.description=i,this.context=u,this.type="TransportError"}}class tf extends et{constructor(n){super(),this.writable=!1,Wu(this,n),this.opts=n,this.query=n.query,this.socket=n.socket,this.supportsBinary=!n.forceBase64}onError(n,i,u){return super.emitReserved("error",new B_(n,i,u)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(n){this.readyState==="open"&&this.write(n)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(n){const i=ef(n,this.socket.binaryType);this.onPacket(i)}onPacket(n){super.emitReserved("packet",n)}onClose(n){this.readyState="closed",super.emitReserved("close",n)}pause(n){}createUri(n,i={}){return n+"://"+this._hostname()+this._port()+this.opts.path+this._query(i)}_hostname(){const n=this.opts.hostname;return n.indexOf(":")===-1?n:"["+n+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(n){const i=U_(n);return i.length?"?"+i:""}}class q_ extends tf{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(n){this.readyState="pausing";const i=()=>{this.readyState="paused",n()};if(this._polling||!this.writable){let u=0;this._polling&&(u++,this.once("pollComplete",function(){--u||i()})),this.writable||(u++,this.once("drain",function(){--u||i()}))}else i()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(n){const i=u=>{if(this.readyState==="opening"&&u.type==="open"&&this.onOpen(),u.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(u)};O_(n,this.socket.binaryType).forEach(i),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const n=()=>{this.write([{type:"close"}])};this.readyState==="open"?n():this.once("open",n)}write(n){this.writable=!1,A_(n,i=>{this.doWrite(i,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const n=this.opts.secure?"https":"http",i=this.query||{};return this.opts.timestampRequests!==!1&&(i[this.opts.timestampParam]=Jm()),!this.supportsBinary&&!i.sid&&(i.b64=1),this.createUri(n,i)}}let Fm=!1;try{Fm=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const Z_=Fm;function H_(){}class V_ extends q_{constructor(n){if(super(n),typeof location<"u"){const i=location.protocol==="https:";let u=location.port;u||(u=i?"443":"80"),this.xd=typeof location<"u"&&n.hostname!==location.hostname||u!==n.port}}doWrite(n,i){const u=this.request({method:"POST",data:n});u.on("success",i),u.on("error",(c,f)=>{this.onError("xhr post error",c,f)})}doPoll(){const n=this.request();n.on("data",this.onData.bind(this)),n.on("error",(i,u)=>{this.onError("xhr poll error",i,u)}),this.pollXhr=n}}class vn extends et{constructor(n,i,u){super(),this.createRequest=n,Wu(this,u),this._opts=u,this._method=u.method||"GET",this._uri=i,this._data=u.data!==void 0?u.data:null,this._create()}_create(){var n;const i=Qm(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");i.xdomain=!!this._opts.xd;const u=this._xhr=this.createRequest(i);try{u.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){u.setDisableHeaderCheck&&u.setDisableHeaderCheck(!0);for(let c in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(c)&&u.setRequestHeader(c,this._opts.extraHeaders[c])}}catch{}if(this._method==="POST")try{u.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{u.setRequestHeader("Accept","*/*")}catch{}(n=this._opts.cookieJar)===null||n===void 0||n.addCookies(u),"withCredentials"in u&&(u.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(u.timeout=this._opts.requestTimeout),u.onreadystatechange=()=>{var c;u.readyState===3&&((c=this._opts.cookieJar)===null||c===void 0||c.parseCookies(u.getResponseHeader("set-cookie"))),u.readyState===4&&(u.status===200||u.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof u.status=="number"?u.status:0)},0))},u.send(this._data)}catch(c){this.setTimeoutFn(()=>{this._onError(c)},0);return}typeof document<"u"&&(this._index=vn.requestsCount++,vn.requests[this._index]=this)}_onError(n){this.emitReserved("error",n,this._xhr),this._cleanup(!0)}_cleanup(n){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=H_,n)try{this._xhr.abort()}catch{}typeof document<"u"&&delete vn.requests[this._index],this._xhr=null}}_onLoad(){const n=this._xhr.responseText;n!==null&&(this.emitReserved("data",n),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}}vn.requestsCount=0;vn.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",fm);else if(typeof addEventListener=="function"){const s="onpagehide"in Wt?"pagehide":"unload";addEventListener(s,fm,!1)}}function fm(){for(let s in vn.requests)vn.requests.hasOwnProperty(s)&&vn.requests[s].abort()}const L_=function(){const s=Wm({xdomain:!1});return s&&s.responseType!==null}();class K_ extends V_{constructor(n){super(n);const i=n&&n.forceBase64;this.supportsBinary=L_&&!i}request(n={}){return Object.assign(n,{xd:this.xd},this.opts),new vn(Wm,this.uri(),n)}}function Wm(s){const n=s.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!n||Z_))return new XMLHttpRequest}catch{}if(!n)try{return new Wt[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const Im=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class Y_ extends tf{get name(){return"websocket"}doOpen(){const n=this.uri(),i=this.opts.protocols,u=Im?{}:Qm(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(u.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(n,i,u)}catch(c){return this.emitReserved("error",c)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=n=>this.onClose({description:"websocket connection closed",context:n}),this.ws.onmessage=n=>this.onData(n.data),this.ws.onerror=n=>this.onError("websocket error",n)}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const u=n[i],c=i===n.length-1;Po(u,this.supportsBinary,f=>{try{this.doWrite(u,f)}catch{}c&&Fu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const n=this.opts.secure?"wss":"ws",i=this.query||{};return this.opts.timestampRequests&&(i[this.opts.timestampParam]=Jm()),this.supportsBinary||(i.b64=1),this.createUri(n,i)}}const bo=Wt.WebSocket||Wt.MozWebSocket;class G_ extends Y_{createSocket(n,i,u){return Im?new bo(n,i,u):i?new bo(n,i):new bo(n)}doWrite(n,i){this.ws.send(i)}}class $_ extends tf{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(n){return this.emitReserved("error",n)}this._transport.closed.then(()=>{this.onClose()}).catch(n=>{this.onError("webtransport error",n)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(n=>{const i=R_(Number.MAX_SAFE_INTEGER,this.socket.binaryType),u=n.readable.pipeThrough(i).getReader(),c=w_();c.readable.pipeTo(n.writable),this._writer=c.writable.getWriter();const f=()=>{u.read().then(({done:y,value:p})=>{y||(this.onPacket(p),f())}).catch(y=>{})};f();const h={type:"open"};this.query.sid&&(h.data=`{"sid":"${this.query.sid}"}`),this._writer.write(h).then(()=>this.onOpen())})})}write(n){this.writable=!1;for(let i=0;i<n.length;i++){const u=n[i],c=i===n.length-1;this._writer.write(u).then(()=>{c&&Fu(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var n;(n=this._transport)===null||n===void 0||n.close()}}const X_={websocket:G_,webtransport:$_,polling:K_},Q_=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,J_=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Mo(s){if(s.length>8e3)throw"URI too long";const n=s,i=s.indexOf("["),u=s.indexOf("]");i!=-1&&u!=-1&&(s=s.substring(0,i)+s.substring(i,u).replace(/:/g,";")+s.substring(u,s.length));let c=Q_.exec(s||""),f={},h=14;for(;h--;)f[J_[h]]=c[h]||"";return i!=-1&&u!=-1&&(f.source=n,f.host=f.host.substring(1,f.host.length-1).replace(/;/g,":"),f.authority=f.authority.replace("[","").replace("]","").replace(/;/g,":"),f.ipv6uri=!0),f.pathNames=F_(f,f.path),f.queryKey=W_(f,f.query),f}function F_(s,n){const i=/\/{2,9}/g,u=n.replace(i,"/").split("/");return(n.slice(0,1)=="/"||n.length===0)&&u.splice(0,1),n.slice(-1)=="/"&&u.splice(u.length-1,1),u}function W_(s,n){const i={};return n.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(u,c,f){c&&(i[c]=f)}),i}const No=typeof addEventListener=="function"&&typeof removeEventListener=="function",Cu=[];No&&addEventListener("offline",()=>{Cu.forEach(s=>s())},!1);class ya extends et{constructor(n,i){if(super(),this.binaryType=k_,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,n&&typeof n=="object"&&(i=n,n=null),n){const u=Mo(n);i.hostname=u.host,i.secure=u.protocol==="https"||u.protocol==="wss",i.port=u.port,u.query&&(i.query=u.query)}else i.host&&(i.hostname=Mo(i.host).host);Wu(this,i),this.secure=i.secure!=null?i.secure:typeof location<"u"&&location.protocol==="https:",i.hostname&&!i.port&&(i.port=this.secure?"443":"80"),this.hostname=i.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=i.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},i.transports.forEach(u=>{const c=u.prototype.name;this.transports.push(c),this._transportsByName[c]=u}),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},i),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=j_(this.opts.query)),No&&(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"})},Cu.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(n){const i=Object.assign({},this.opts.query);i.EIO=Xm,i.transport=n,this.id&&(i.sid=this.id);const u=Object.assign({},this.opts,{query:i,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[n]);return new this._transportsByName[n](u)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const n=this.opts.rememberUpgrade&&ya.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const i=this.createTransport(n);i.open(),this.setTransport(i)}setTransport(n){this.transport&&this.transport.removeAllListeners(),this.transport=n,n.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",i=>this._onClose("transport close",i))}onOpen(){this.readyState="open",ya.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",n),this.emitReserved("heartbeat"),n.type){case"open":this.onHandshake(JSON.parse(n.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const i=new Error("server error");i.code=n.data,this._onError(i);break;case"message":this.emitReserved("data",n.data),this.emitReserved("message",n.data);break}}onHandshake(n){this.emitReserved("handshake",n),this.id=n.sid,this.transport.query.sid=n.sid,this._pingInterval=n.pingInterval,this._pingTimeout=n.pingTimeout,this._maxPayload=n.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const n=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+n,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},n),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 n=this._getWritablePackets();this.transport.send(n),this._prevBufferLen=n.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let i=1;for(let u=0;u<this.writeBuffer.length;u++){const c=this.writeBuffer[u].data;if(c&&(i+=D_(c)),u>0&&i>this._maxPayload)return this.writeBuffer.slice(0,u);i+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const n=Date.now()>this._pingTimeoutTime;return n&&(this._pingTimeoutTime=0,Fu(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),n}write(n,i,u){return this._sendPacket("message",n,i,u),this}send(n,i,u){return this._sendPacket("message",n,i,u),this}_sendPacket(n,i,u,c){if(typeof i=="function"&&(c=i,i=void 0),typeof u=="function"&&(c=u,u=null),this.readyState==="closing"||this.readyState==="closed")return;u=u||{},u.compress=u.compress!==!1;const f={type:n,data:i,options:u};this.emitReserved("packetCreate",f),this.writeBuffer.push(f),c&&this.once("flush",c),this.flush()}close(){const n=()=>{this._onClose("forced close"),this.transport.close()},i=()=>{this.off("upgrade",i),this.off("upgradeError",i),n()},u=()=>{this.once("upgrade",i),this.once("upgradeError",i)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?u():n()}):this.upgrading?u():n()),this}_onError(n){if(ya.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",n),this._onClose("transport error",n)}_onClose(n,i){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(),No&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const u=Cu.indexOf(this._offlineEventListener);u!==-1&&Cu.splice(u,1)}this.readyState="closed",this.id=null,this.emitReserved("close",n,i),this.writeBuffer=[],this._prevBufferLen=0}}}ya.protocol=Xm;class I_ extends ya{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let n=0;n<this._upgrades.length;n++)this._probe(this._upgrades[n])}_probe(n){let i=this.createTransport(n),u=!1;ya.priorWebsocketSuccess=!1;const c=()=>{u||(i.send([{type:"ping",data:"probe"}]),i.once("packet",O=>{if(!u)if(O.type==="pong"&&O.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",i),!i)return;ya.priorWebsocketSuccess=i.name==="websocket",this.transport.pause(()=>{u||this.readyState!=="closed"&&(_(),this.setTransport(i),i.send([{type:"upgrade"}]),this.emitReserved("upgrade",i),i=null,this.upgrading=!1,this.flush())})}else{const C=new Error("probe error");C.transport=i.name,this.emitReserved("upgradeError",C)}}))};function f(){u||(u=!0,_(),i.close(),i=null)}const h=O=>{const C=new Error("probe error: "+O);C.transport=i.name,f(),this.emitReserved("upgradeError",C)};function y(){h("transport closed")}function p(){h("socket closed")}function g(O){i&&O.name!==i.name&&f()}const _=()=>{i.removeListener("open",c),i.removeListener("error",h),i.removeListener("close",y),this.off("close",p),this.off("upgrading",g)};i.once("open",c),i.once("error",h),i.once("close",y),this.once("close",p),this.once("upgrading",g),this._upgrades.indexOf("webtransport")!==-1&&n!=="webtransport"?this.setTimeoutFn(()=>{u||i.open()},200):i.open()}onHandshake(n){this._upgrades=this._filterUpgrades(n.upgrades),super.onHandshake(n)}_filterUpgrades(n){const i=[];for(let u=0;u<n.length;u++)~this.transports.indexOf(n[u])&&i.push(n[u]);return i}}let P_=class extends I_{constructor(n,i={}){const u=typeof n=="object"?n:i;(!u.transports||u.transports&&typeof u.transports[0]=="string")&&(u.transports=(u.transports||["polling","websocket","webtransport"]).map(c=>X_[c]).filter(c=>!!c)),super(n,u)}};function e1(s,n="",i){let u=s;i=i||typeof location<"u"&&location,s==null&&(s=i.protocol+"//"+i.host),typeof s=="string"&&(s.charAt(0)==="/"&&(s.charAt(1)==="/"?s=i.protocol+s:s=i.host+s),/^(https?|wss?):\/\//.test(s)||(typeof i<"u"?s=i.protocol+"//"+s:s="https://"+s),u=Mo(s)),u.port||(/^(http|ws)$/.test(u.protocol)?u.port="80":/^(http|ws)s$/.test(u.protocol)&&(u.port="443")),u.path=u.path||"/";const f=u.host.indexOf(":")!==-1?"["+u.host+"]":u.host;return u.id=u.protocol+"://"+f+":"+u.port+n,u.href=u.protocol+"://"+f+(i&&i.port===u.port?"":":"+u.port),u}const t1=typeof ArrayBuffer=="function",n1=s=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(s):s.buffer instanceof ArrayBuffer,Pm=Object.prototype.toString,a1=typeof Blob=="function"||typeof Blob<"u"&&Pm.call(Blob)==="[object BlobConstructor]",i1=typeof File=="function"||typeof File<"u"&&Pm.call(File)==="[object FileConstructor]";function nf(s){return t1&&(s instanceof ArrayBuffer||n1(s))||a1&&s instanceof Blob||i1&&s instanceof File}function Du(s,n){if(!s||typeof s!="object")return!1;if(Array.isArray(s)){for(let i=0,u=s.length;i<u;i++)if(Du(s[i]))return!0;return!1}if(nf(s))return!0;if(s.toJSON&&typeof s.toJSON=="function"&&arguments.length===1)return Du(s.toJSON(),!0);for(const i in s)if(Object.prototype.hasOwnProperty.call(s,i)&&Du(s[i]))return!0;return!1}function l1(s){const n=[],i=s.data,u=s;return u.data=Co(i,n),u.attachments=n.length,{packet:u,buffers:n}}function Co(s,n){if(!s)return s;if(nf(s)){const i={_placeholder:!0,num:n.length};return n.push(s),i}else if(Array.isArray(s)){const i=new Array(s.length);for(let u=0;u<s.length;u++)i[u]=Co(s[u],n);return i}else if(typeof s=="object"&&!(s instanceof Date)){const i={};for(const u in s)Object.prototype.hasOwnProperty.call(s,u)&&(i[u]=Co(s[u],n));return i}return s}function s1(s,n){return s.data=Do(s.data,n),delete s.attachments,s}function Do(s,n){if(!s)return s;if(s&&s._placeholder===!0){if(typeof s.num=="number"&&s.num>=0&&s.num<n.length)return n[s.num];throw new Error("illegal attachments")}else if(Array.isArray(s))for(let i=0;i<s.length;i++)s[i]=Do(s[i],n);else if(typeof s=="object")for(const i in s)Object.prototype.hasOwnProperty.call(s,i)&&(s[i]=Do(s[i],n));return s}const u1=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],r1=5;var be;(function(s){s[s.CONNECT=0]="CONNECT",s[s.DISCONNECT=1]="DISCONNECT",s[s.EVENT=2]="EVENT",s[s.ACK=3]="ACK",s[s.CONNECT_ERROR=4]="CONNECT_ERROR",s[s.BINARY_EVENT=5]="BINARY_EVENT",s[s.BINARY_ACK=6]="BINARY_ACK"})(be||(be={}));class c1{constructor(n){this.replacer=n}encode(n){return(n.type===be.EVENT||n.type===be.ACK)&&Du(n)?this.encodeAsBinary({type:n.type===be.EVENT?be.BINARY_EVENT:be.BINARY_ACK,nsp:n.nsp,data:n.data,id:n.id}):[this.encodeAsString(n)]}encodeAsString(n){let i=""+n.type;return(n.type===be.BINARY_EVENT||n.type===be.BINARY_ACK)&&(i+=n.attachments+"-"),n.nsp&&n.nsp!=="/"&&(i+=n.nsp+","),n.id!=null&&(i+=n.id),n.data!=null&&(i+=JSON.stringify(n.data,this.replacer)),i}encodeAsBinary(n){const i=l1(n),u=this.encodeAsString(i.packet),c=i.buffers;return c.unshift(u),c}}function dm(s){return Object.prototype.toString.call(s)==="[object Object]"}class af extends et{constructor(n){super(),this.reviver=n}add(n){let i;if(typeof n=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");i=this.decodeString(n);const u=i.type===be.BINARY_EVENT;u||i.type===be.BINARY_ACK?(i.type=u?be.EVENT:be.ACK,this.reconstructor=new o1(i),i.attachments===0&&super.emitReserved("decoded",i)):super.emitReserved("decoded",i)}else if(nf(n)||n.base64)if(this.reconstructor)i=this.reconstructor.takeBinaryData(n),i&&(this.reconstructor=null,super.emitReserved("decoded",i));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+n)}decodeString(n){let i=0;const u={type:Number(n.charAt(0))};if(be[u.type]===void 0)throw new Error("unknown packet type "+u.type);if(u.type===be.BINARY_EVENT||u.type===be.BINARY_ACK){const f=i+1;for(;n.charAt(++i)!=="-"&&i!=n.length;);const h=n.substring(f,i);if(h!=Number(h)||n.charAt(i)!=="-")throw new Error("Illegal attachments");u.attachments=Number(h)}if(n.charAt(i+1)==="/"){const f=i+1;for(;++i&&!(n.charAt(i)===","||i===n.length););u.nsp=n.substring(f,i)}else u.nsp="/";const c=n.charAt(i+1);if(c!==""&&Number(c)==c){const f=i+1;for(;++i;){const h=n.charAt(i);if(h==null||Number(h)!=h){--i;break}if(i===n.length)break}u.id=Number(n.substring(f,i+1))}if(n.charAt(++i)){const f=this.tryParse(n.substr(i));if(af.isPayloadValid(u.type,f))u.data=f;else throw new Error("invalid payload")}return u}tryParse(n){try{return JSON.parse(n,this.reviver)}catch{return!1}}static isPayloadValid(n,i){switch(n){case be.CONNECT:return dm(i);case be.DISCONNECT:return i===void 0;case be.CONNECT_ERROR:return typeof i=="string"||dm(i);case be.EVENT:case be.BINARY_EVENT:return Array.isArray(i)&&(typeof i[0]=="number"||typeof i[0]=="string"&&u1.indexOf(i[0])===-1);case be.ACK:case be.BINARY_ACK:return Array.isArray(i)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class o1{constructor(n){this.packet=n,this.buffers=[],this.reconPack=n}takeBinaryData(n){if(this.buffers.push(n),this.buffers.length===this.reconPack.attachments){const i=s1(this.reconPack,this.buffers);return this.finishedReconstruction(),i}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const f1=Object.freeze(Object.defineProperty({__proto__:null,Decoder:af,Encoder:c1,get PacketType(){return be},protocol:r1},Symbol.toStringTag,{value:"Module"}));function an(s,n,i){return s.on(n,i),function(){s.off(n,i)}}const d1=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class ep extends et{constructor(n,i,u){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=n,this.nsp=i,u&&u.auth&&(this.auth=u.auth),this._opts=Object.assign({},u),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const n=this.io;this.subs=[an(n,"open",this.onopen.bind(this)),an(n,"packet",this.onpacket.bind(this)),an(n,"error",this.onerror.bind(this)),an(n,"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(...n){return n.unshift("message"),this.emit.apply(this,n),this}emit(n,...i){var u,c,f;if(d1.hasOwnProperty(n))throw new Error('"'+n.toString()+'" is a reserved event name');if(i.unshift(n),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(i),this;const h={type:be.EVENT,data:i};if(h.options={},h.options.compress=this.flags.compress!==!1,typeof i[i.length-1]=="function"){const _=this.ids++,O=i.pop();this._registerAckCallback(_,O),h.id=_}const y=(c=(u=this.io.engine)===null||u===void 0?void 0:u.transport)===null||c===void 0?void 0:c.writable,p=this.connected&&!(!((f=this.io.engine)===null||f===void 0)&&f._hasPingExpired());return this.flags.volatile&&!y||(p?(this.notifyOutgoingListeners(h),this.packet(h)):this.sendBuffer.push(h)),this.flags={},this}_registerAckCallback(n,i){var u;const c=(u=this.flags.timeout)!==null&&u!==void 0?u:this._opts.ackTimeout;if(c===void 0){this.acks[n]=i;return}const f=this.io.setTimeoutFn(()=>{delete this.acks[n];for(let y=0;y<this.sendBuffer.length;y++)this.sendBuffer[y].id===n&&this.sendBuffer.splice(y,1);i.call(this,new Error("operation has timed out"))},c),h=(...y)=>{this.io.clearTimeoutFn(f),i.apply(this,y)};h.withError=!0,this.acks[n]=h}emitWithAck(n,...i){return new Promise((u,c)=>{const f=(h,y)=>h?c(h):u(y);f.withError=!0,i.push(f),this.emit(n,...i)})}_addToQueue(n){let i;typeof n[n.length-1]=="function"&&(i=n.pop());const u={id:this._queueSeq++,tryCount:0,pending:!1,args:n,flags:Object.assign({fromQueue:!0},this.flags)};n.push((c,...f)=>u!==this._queue[0]?void 0:(c!==null?u.tryCount>this._opts.retries&&(this._queue.shift(),i&&i(c)):(this._queue.shift(),i&&i(null,...f)),u.pending=!1,this._drainQueue())),this._queue.push(u),this._drainQueue()}_drainQueue(n=!1){if(!this.connected||this._queue.length===0)return;const i=this._queue[0];i.pending&&!n||(i.pending=!0,i.tryCount++,this.flags=i.flags,this.emit.apply(this,i.args))}packet(n){n.nsp=this.nsp,this.io._packet(n)}onopen(){typeof this.auth=="function"?this.auth(n=>{this._sendConnectPacket(n)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(n){this.packet({type:be.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},n):n})}onerror(n){this.connected||this.emitReserved("connect_error",n)}onclose(n,i){this.connected=!1,delete this.id,this.emitReserved("disconnect",n,i),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(n=>{if(!this.sendBuffer.some(u=>String(u.id)===n)){const u=this.acks[n];delete this.acks[n],u.withError&&u.call(this,new Error("socket has been disconnected"))}})}onpacket(n){if(n.nsp===this.nsp)switch(n.type){case be.CONNECT:n.data&&n.data.sid?this.onconnect(n.data.sid,n.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 be.EVENT:case be.BINARY_EVENT:this.onevent(n);break;case be.ACK:case be.BINARY_ACK:this.onack(n);break;case be.DISCONNECT:this.ondisconnect();break;case be.CONNECT_ERROR:this.destroy();const u=new Error(n.data.message);u.data=n.data.data,this.emitReserved("connect_error",u);break}}onevent(n){const i=n.data||[];n.id!=null&&i.push(this.ack(n.id)),this.connected?this.emitEvent(i):this.receiveBuffer.push(Object.freeze(i))}emitEvent(n){if(this._anyListeners&&this._anyListeners.length){const i=this._anyListeners.slice();for(const u of i)u.apply(this,n)}super.emit.apply(this,n),this._pid&&n.length&&typeof n[n.length-1]=="string"&&(this._lastOffset=n[n.length-1])}ack(n){const i=this;let u=!1;return function(...c){u||(u=!0,i.packet({type:be.ACK,id:n,data:c}))}}onack(n){const i=this.acks[n.id];typeof i=="function"&&(delete this.acks[n.id],i.withError&&n.data.unshift(null),i.apply(this,n.data))}onconnect(n,i){this.id=n,this.recovered=i&&this._pid===i,this._pid=i,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(n=>this.emitEvent(n)),this.receiveBuffer=[],this.sendBuffer.forEach(n=>{this.notifyOutgoingListeners(n),this.packet(n)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(n=>n()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:be.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(n){return this.flags.compress=n,this}get volatile(){return this.flags.volatile=!0,this}timeout(n){return this.flags.timeout=n,this}onAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(n),this}prependAny(n){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(n),this}offAny(n){if(!this._anyListeners)return this;if(n){const i=this._anyListeners;for(let u=0;u<i.length;u++)if(n===i[u])return i.splice(u,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(n),this}prependAnyOutgoing(n){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(n),this}offAnyOutgoing(n){if(!this._anyOutgoingListeners)return this;if(n){const i=this._anyOutgoingListeners;for(let u=0;u<i.length;u++)if(n===i[u])return i.splice(u,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(n){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const i=this._anyOutgoingListeners.slice();for(const u of i)u.apply(this,n.data)}}}function Yi(s){s=s||{},this.ms=s.min||100,this.max=s.max||1e4,this.factor=s.factor||2,this.jitter=s.jitter>0&&s.jitter<=1?s.jitter:0,this.attempts=0}Yi.prototype.duration=function(){var s=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var n=Math.random(),i=Math.floor(n*this.jitter*s);s=Math.floor(n*10)&1?s+i:s-i}return Math.min(s,this.max)|0};Yi.prototype.reset=function(){this.attempts=0};Yi.prototype.setMin=function(s){this.ms=s};Yi.prototype.setMax=function(s){this.max=s};Yi.prototype.setJitter=function(s){this.jitter=s};class zo extends et{constructor(n,i){var u;super(),this.nsps={},this.subs=[],n&&typeof n=="object"&&(i=n,n=void 0),i=i||{},i.path=i.path||"/socket.io",this.opts=i,Wu(this,i),this.reconnection(i.reconnection!==!1),this.reconnectionAttempts(i.reconnectionAttempts||1/0),this.reconnectionDelay(i.reconnectionDelay||1e3),this.reconnectionDelayMax(i.reconnectionDelayMax||5e3),this.randomizationFactor((u=i.randomizationFactor)!==null&&u!==void 0?u:.5),this.backoff=new Yi({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(i.timeout==null?2e4:i.timeout),this._readyState="closed",this.uri=n;const c=i.parser||f1;this.encoder=new c.Encoder,this.decoder=new c.Decoder,this._autoConnect=i.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(n){return arguments.length?(this._reconnection=!!n,n||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(n){return n===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=n,this)}reconnectionDelay(n){var i;return n===void 0?this._reconnectionDelay:(this._reconnectionDelay=n,(i=this.backoff)===null||i===void 0||i.setMin(n),this)}randomizationFactor(n){var i;return n===void 0?this._randomizationFactor:(this._randomizationFactor=n,(i=this.backoff)===null||i===void 0||i.setJitter(n),this)}reconnectionDelayMax(n){var i;return n===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=n,(i=this.backoff)===null||i===void 0||i.setMax(n),this)}timeout(n){return arguments.length?(this._timeout=n,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(n){if(~this._readyState.indexOf("open"))return this;this.engine=new P_(this.uri,this.opts);const i=this.engine,u=this;this._readyState="opening",this.skipReconnect=!1;const c=an(i,"open",function(){u.onopen(),n&&n()}),f=y=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",y),n?n(y):this.maybeReconnectOnOpen()},h=an(i,"error",f);if(this._timeout!==!1){const y=this._timeout,p=this.setTimeoutFn(()=>{c(),f(new Error("timeout")),i.close()},y);this.opts.autoUnref&&p.unref(),this.subs.push(()=>{this.clearTimeoutFn(p)})}return this.subs.push(c),this.subs.push(h),this}connect(n){return this.open(n)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const n=this.engine;this.subs.push(an(n,"ping",this.onping.bind(this)),an(n,"data",this.ondata.bind(this)),an(n,"error",this.onerror.bind(this)),an(n,"close",this.onclose.bind(this)),an(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(n){try{this.decoder.add(n)}catch(i){this.onclose("parse error",i)}}ondecoded(n){Fu(()=>{this.emitReserved("packet",n)},this.setTimeoutFn)}onerror(n){this.emitReserved("error",n)}socket(n,i){let u=this.nsps[n];return u?this._autoConnect&&!u.active&&u.connect():(u=new ep(this,n,i),this.nsps[n]=u),u}_destroy(n){const i=Object.keys(this.nsps);for(const u of i)if(this.nsps[u].active)return;this._close()}_packet(n){const i=this.encoder.encode(n);for(let u=0;u<i.length;u++)this.engine.write(i[u],n.options)}cleanup(){this.subs.forEach(n=>n()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(n,i){var u;this.cleanup(),(u=this.engine)===null||u===void 0||u.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",n,i),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const n=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const i=this.backoff.duration();this._reconnecting=!0;const u=this.setTimeoutFn(()=>{n.skipReconnect||(this.emitReserved("reconnect_attempt",n.backoff.attempts),!n.skipReconnect&&n.open(c=>{c?(n._reconnecting=!1,n.reconnect(),this.emitReserved("reconnect_error",c)):n.onreconnect()}))},i);this.opts.autoUnref&&u.unref(),this.subs.push(()=>{this.clearTimeoutFn(u)})}}onreconnect(){const n=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",n)}}const Yl={};function zu(s,n){typeof s=="object"&&(n=s,s=void 0),n=n||{};const i=e1(s,n.path||"/socket.io"),u=i.source,c=i.id,f=i.path,h=Yl[c]&&f in Yl[c].nsps,y=n.forceNew||n["force new connection"]||n.multiplex===!1||h;let p;return y?p=new zo(u,n):(Yl[c]||(Yl[c]=new zo(u,n)),p=Yl[c]),i.query&&!n.query&&(n.query=i.queryKey),p.socket(i.path,n)}Object.assign(zu,{Manager:zo,Socket:ep,io:zu,connect:zu});const h1=["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,m1=15,p1=/^[a-zA-Z0-9_-]+$/,lf=xe.string().min(y1).max(m1).regex(p1),hm=20,ym={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function g1(s){let n="";for(const i of s)i in ym?n+=ym[i]:n+=i;return n}function v1(s){const n=s.toLocaleLowerCase(),i=g1(n);for(const u of h1)if(i.includes(u)||n.includes(u))return!0;return!1}function b1(s){const n=new Set(s).size;return s.length*Math.log2(n)}function _1(s){let n=0;return v1(s)&&(n-=100),n+=b1(s)*.5,Math.max(n,0)}const sf=xe.string().refine(s=>_1(s)>=hm,{message:`Password does not meet the minimum complexity of ${hm}.`}).brand("password");xe.object({username:lf,password:sf}).strict();const tp=xe.string().email().brand("email");xe.object({username:lf,password:sf,email:tp}).strict();var S1={};function T1(s,n){const i={},u=[];for(const c in s){const f=s[c],h=n[c],y=f["~standard"].validate(h);if(y instanceof Promise)throw new Error(`Validation must be synchronous, but ${c} returned a Promise.`);if(y.issues){u.push(...y.issues.map(p=>({...p,path:[c,...p.path??[]]})));continue}i[c]=y.value}return u.length?{issues:u}:{value:i}}function E1(s){const n=s.runtimeEnvStrict??s.runtimeEnv??S1;for(const[ye,fe]of Object.entries(n))fe===""&&delete n[ye];if(!!s.skipValidation)return n;const u=typeof s.client=="object"?s.client:{},c=typeof s.server=="object"?s.server:{},f=typeof s.shared=="object"?s.shared:{},h=s.isServer??(typeof window>"u"||"Deno"in window),y=h?{...c,...f,...u}:{...u,...f},p=T1(y,n),g=s.onValidationError??(ye=>{throw console.error("❌ Invalid environment variables:",ye),new Error("Invalid environment variables")}),_=s.onInvalidAccess??(()=>{throw new Error("❌ Attempted to access a server-side environment variable on the client")});if(p.issues)return g(p.issues);const O=ye=>s.clientPrefix?!ye.startsWith(s.clientPrefix)&&!(ye in f):!0,C=ye=>h||!O(ye),U=ye=>ye==="__esModule"||ye==="$$typeof",Y=(s.extends??[]).reduce((ye,fe)=>Object.assign(ye,fe),{}),K=Object.assign(p.value,Y);return new Proxy(K,{get(ye,fe){if(typeof fe=="string"&&!U(fe))return C(fe)?Reflect.get(ye,fe):_(fe)}})}const A1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},O1="__vite_start_time"in globalThis,w1=typeof window<"u",uf=E1({isServer:!O1&&!w1,server:{CI:xe.string().transform(s=>!0).optional(),POSTGRES_USER:xe.string(),POSTGRES_PASSWORD:xe.string(),POSTGRES_DATABASE:xe.string(),POSTGRES_HOST:xe.string(),POSTGRES_PORT:xe.string().transform(s=>Number.parseInt(s,10)),BACKEND_PORT:xe.string().transform(s=>Number.parseInt(s,10)),RUN_WORKERS_FROM_SOURCE:xe.union([xe.literal("true"),xe.literal("false")]).optional().transform(s=>s==="true"),FRONTEND_PORT:xe.string().transform(s=>Number.parseInt(s,10)),FRONTEND_ORIGINS:xe.string().transform(s=>JSON.parse(s)).pipe(xe.array(xe.string())),OPENAI_API_KEY:xe.string().optional()},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:xe.string(),VITE_USE_SELF_SIGNED_CERTIFICATE:xe.union([xe.literal("true"),xe.literal("false")]).optional().transform(s=>s==="true")},runtimeEnv:A1,emptyStringAsUndefined:!0}),rf=zu(uf.VITE_BACKEND_ORIGIN,{auth:s=>{const n=So(Li);n&&s(n)},autoConnect:!1}).on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),Ho(Li,null)}),Li=Bt({key:"auth",default:null,effects:[({onSet:s})=>{s(({newValue:n})=>{n?(localStorage.setItem("username",n.username),localStorage.setItem("sessionKey",n.sessionKey),console.log("connecting..."),rf.connect()):(console.log("clearing session..."),localStorage.removeItem("sessionKey"))})},({setSelf:s})=>{const n=localStorage.getItem("username"),i=localStorage.getItem("sessionKey");n&&i&&s({username:n,sessionKey:i})}]}),cs=Bt({key:"username",default:window.localStorage.getItem("username")??""}),np=Qa({key:"usernameIssues",get:({get:s})=>{const n=s(cs),i=lf.safeParse(n);return i.success?null:i.error.issues}}),Ki=Bt({key:"password0",default:""}),ap=Qa({key:"password0Issues",get:({get:s})=>{const n=s(Ki),i=sf.safeParse(n);return i.success?null:i.error.issues}}),Uo=Bt({key:"password1",default:""}),ip=Qa({key:"password1Issues",get:({get:s})=>{const n=s(Ki),i=s(Uo),u=xe.string().refine(c=>c===n,{message:"Passwords do not match."}).safeParse(i);return u.success?null:u.error.issues}}),jo=Bt({key:"email",default:""}),lp=Qa({key:"emailIssues",get:({get:s})=>{const n=s(jo),i=tp.safeParse(n);return i.success?null:i.error.issues}}),R1=Qa({key:"signupReady",get:({get:s})=>{const n=s(np),i=s(ap),u=s(ip),c=s(lp);return!(n??i??u??c)}}),sp=g_({login:null,sign_up:null,game:v_({clicker:null}),admin:null});function x1(s){return b_(sp,s)}const k1=[["login"],["sign_up"]];function M1(s){return k1.some(n=>n.join("/")===s.join("/"))}function up(s){history.pushState(null,"",s),Ho(rp,s)}const rp=Bt({key:"pathName",default:window.location.pathname,effects:[({onSet:s,setSelf:n})=>{const i=c=>{history.replaceState(null,"",c),n(c)},u=c=>{switch(c){case"/":{const f=So(Li);let h="/login";f&&(h="/game"),i(h);break}case"/login":case"/sign_up":So(Li)&&i("/game")}};u(window.location.pathname),s(({newValue:c})=>{u(c)})},({setSelf:s})=>{document.addEventListener("click",n=>{const i=n.target.closest("a");if(i&&i instanceof HTMLAnchorElement){const u=i.getAttribute("href");u!=null&&u.startsWith("/")&&(n.preventDefault(),history.pushState(null,"",u),s(u))}}),window.addEventListener("popstate",()=>{s(window.location.pathname)})}]}),N1=Qa({key:"route",get:({get:s})=>{const i=s(rp).split("/").slice(1);return x1(i)?M1(i)||s(Li)?i:401:404}});function C1(){return q.jsx("article",{children:q.jsx("h1",{children:"admin"})})}class D1 extends Map{set(n,i){return this.has(n)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:n,value:i}),this):super.set(n,i)}clear(){throw new Error("Cannot clear an InvariantMap")}}const Ql=class Ql{constructor(n){B(this,"type","continuity");B(this,"globals",[]);B(this,"actions",[]);B(this,"perspectives",[]);this.key=n}static create(n,i){const u=new Ql(n),{type:c,globals:f,actions:h,perspectives:y}=i(u),p={type:c,key:n,globals:f,actions:h,perspectives:y};return Ql.existing.set(n,p),p}add(...n){switch(n[0].type){case"atom":case"mutable_atom":this.globals.push(...n);break;case"transaction":this.actions.push(...n);break;case"atom_family":{const[u,c]=n;this.perspectives.push({type:"realtime_perspective",resourceAtoms:u,viewAtoms:c})}break}return this}};B(Ql,"existing",new D1);let Bo=Ql;function z1(s){const{key:n,config:i}=s,u=Bo.create(n,i),{actions:c}=u;for(const f of c)_m(n,f.key,Xe.STORE);return Ko(n,-1,Xe.STORE),u}class bn extends Set{constructor(i,u=0){super(i);B(this,"mode","record");B(this,"subject",new Ie);B(this,"cacheLimit",0);B(this,"cache",[]);B(this,"cacheIdx",-1);B(this,"cacheUpdateNumber",-1);B(this,"parent");B(this,"child",null);B(this,"transactionUpdates",null);i instanceof bn&&(this.parent=i,this.cacheUpdateNumber=i.cacheUpdateNumber),u&&(this.cacheLimit=u,this.cache=new Array(u),this.subscribe("auto cache",c=>{this.cacheIdx++,this.cacheIdx%=this.cacheLimit,this.cache[this.cacheIdx]=c}))}toJSON(){return{members:[...this],cache:this.cache,cacheLimit:this.cacheLimit,cacheIdx:this.cacheIdx,cacheUpdateNumber:this.cacheUpdateNumber}}static fromJSON(i){const u=new bn(i.members,i.cacheLimit);return u.cache=i.cache,u.cacheIdx=i.cacheIdx,u.cacheUpdateNumber=i.cacheUpdateNumber,u}add(i){const u=super.add(i);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`add:${Ve(i)}`)),u}clear(){const i=this.mode==="record"?[...this]:null;super.clear(),i&&(this.cacheUpdateNumber++,this.emit(`clear:${JSON.stringify(i)}`))}delete(i){const u=super.delete(i);return this.mode==="record"&&(this.cacheUpdateNumber++,this.emit(`del:${Ve(i)}`)),u}transaction(i){this.mode="transaction",this.transactionUpdates=[],this.child=new bn(this);const u=this.child._subscribe("transaction",c=>{var f;(f=this.transactionUpdates)==null||f.push(c)});try{if(i(this.child)){for(const f of this.transactionUpdates)this.doStep(f);this.cacheUpdateNumber++,this.emit(`tx:${this.transactionUpdates.join(";")}`)}}catch(c){throw console.error("Failed to apply transaction to SetRTX:",c),c}finally{u(),this.child=null,this.transactionUpdates=null,this.mode="record"}}_subscribe(i,u){return this.subject.subscribe(i,u)}subscribe(i,u){return this.subject.subscribe(i,c=>{u(`${this.cacheUpdateNumber}=${c}`)})}emit(i){this.subject.next(i)}doStep(i){const u=i.indexOf(":"),c=i.substring(0,u),f=i.substring(u+1);switch(c){case"add":this.add(JSON.parse(f));break;case"clear":this.clear();break;case"del":this.delete(JSON.parse(f));break;case"tx":for(const h of f.split(";"))this.doStep(h)}}getUpdateNumber(i){const u=i.indexOf("=");return Number(i.substring(0,u))}do(i){const u=i.indexOf("="),c=Number(i.substring(0,u)),f=c-this.cacheUpdateNumber;if(f>0){if(f===1){this.mode="playback";const y=i.substring(u+1);return this.doStep(y),this.mode="record",this.cacheUpdateNumber=c,null}return this.cacheUpdateNumber+1}if(Math.abs(f)<this.cacheLimit){const y=this.cacheIdx+f;if(this.cache[y]===i)return null;this.mode="playback";let g=!1;for(;!g;){this.cacheIdx%=this.cacheLimit;const O=this.cache[this.cacheIdx];if(this.cacheIdx--,!O)return"OUT_OF_RANGE";this.undo(O),g=this.cacheIdx===y-1}const _=i.substring(u+1);return this.doStep(_),this.mode="record",this.cacheUpdateNumber=c,null}return"OUT_OF_RANGE"}undoStep(i){const u=i.indexOf(":"),c=i.substring(0,u),f=i.substring(u+1);switch(c){case"add":this.delete(JSON.parse(f));break;case"del":this.add(JSON.parse(f));break;case"clear":{const h=JSON.parse(f);for(const y of h)this.add(y);break}case"tx":{const h=f.split(";");for(let y=h.length-1;y>=0;y--)this.undoStep(h[y])}}}undo(i){const u=i.indexOf("=");if(Number(i.substring(0,u))===this.cacheUpdateNumber){this.mode="playback";const f=i.substring(u+1);return this.undoStep(f),this.mode="record",this.cacheUpdateNumber--,null}return this.cacheUpdateNumber}}function Ft(s){return s[0].toUpperCase()+s.slice(1)}class cp{constructor(n,i,u=Xe.STORE){B(this,"toolkit");B(this,"options");B(this,"defaultContent");B(this,"molecules",new Map);B(this,"relations");B(this,"states");B(this,"core");B(this,"store");B(this,"realm");this.store=u,this.realm=new $v(u),this.options=n,this.defaultContent=i,this.store.miscResources.set(`join:${n.key}`,this),this.realm.allocate("root",n.key),this.toolkit={get:(...N)=>It(u,...N),set:(...N)=>{Pe(u,...N)},find:(...N)=>gt(u,...N),seek:(...N)=>_n(u,...N),json:N=>Ja(u,N)};const c=n.between[0],f=n.between[1],h=Om(u,{key:`${n.key}/relatedKeys`,default:()=>new bn,mutable:!0,fromJson:N=>bn.fromJSON(N),toJson:N=>N.toJSON()},["join","relations"]);this.core={relatedKeysAtoms:h};const y=({get:N},L)=>N(h,L),p=({set:N},L,se)=>{this.store.molecules.has(Ve(L))||this.realm.allocate(n.key,L),N(h,L,W=>W.add(se)),N(h,se,W=>W.add(L))},g=({set:N},L,se)=>{N(h,L,W=>(W.delete(se),W)),N(h,se,W=>(W.delete(L),W))},_=(N,L,se)=>{const{find:W,get:j,set:X}=N,we=W(h,L),Ge=j(we);for(const Ce of Ge)se.includes(Ce)||X(h,Ce,Ue=>(Ue.delete(L),Ue));X(we,Ce=>(Ce.transaction(it=>{it.clear();for(const Ue of se){const Z=y(N,Ue),ie=Z.has(L);if(this.relations.cardinality==="1:n"){const I=[];for(const Ee of Z){if(Ee===L)continue;const b=y(N,Ee);b.delete(Ue),b.size===0&&I.push(Ee)}!ie&&Z.size>0&&Z.clear();for(const Ee of I){const b=[Ue,Ee].sort(),D=`"${b[0]}:${b[1]}"`;this.molecules.delete(D)}}ie||Z.add(L),it.add(Ue)}return!0}),Ce))},O=(N,L,se)=>{const{set:W}=N;W(h,L,j=>(j.transaction(X=>{for(const we of se)X.add(we);return!0}),j));for(const j of se)W(h,j,X=>(X.add(L),X));return!0},C=(N,L,se)=>{const W=y(N,L);return se?W.has(se):W.size>0},U={getRelatedKeys:N=>y(this.toolkit,N),addRelation:(N,L)=>{this.store.moleculeJoins.set(N,n.key),this.store.moleculeJoins.set(L,n.key),p(this.toolkit,N,L)},deleteRelation:(N,L)=>{g(this.toolkit,N,L)},replaceRelationsSafely:(N,L)=>{_(this.toolkit,N,L)},replaceRelationsUnsafely:(N,L)=>{O(this.toolkit,N,L)},has:(N,L)=>C(this.toolkit,N,L)};let Y,K;if(i){K=qo(u,{key:`${n.key}/content`,default:i},["join","content"]);const N=({get:W},j)=>W(K,j),L=({set:W},j,X)=>{W(K,j,X)};Y=Object.assign(U,{getContent:W=>N(this.toolkit,W),setContent:(W,j)=>{L(this.toolkit,W,j)},deleteContent:W=>{this.realm.deallocate(W)}})}else Y=U;const ge=new Et(n,{externalStore:Y,isAType:n.isAType,isBType:n.isBType,makeContentKey:(...N)=>{const[L,se]=N,W=N.sort(),j=`${W[0]}:${W[1]}`,X=u.molecules.get(Ve(L)),we=u.molecules.get(Ve(se));return X||this.realm.allocate(n.key,L),we||this.realm.allocate(n.key,se),this.realm.allocate(L,j,"all"),this.realm.claim(se,j),this.store.moleculeJoins.set(j,n.key),j}}),ye=()=>Di(u,{key:`${n.key}/singleRelatedKey`,get:N=>({get:L})=>{const se=L(h,N);for(const W of se)return W;return null}},["join","keys"]),fe=()=>Di(u,{key:`${n.key}/multipleRelatedKeys`,get:N=>({get:L})=>{const se=Fy(h,u);return L(se,N).members}},["join","keys"]),Be=()=>Di(u,{key:`${n.key}/singleRelatedEntry`,get:N=>({get:L})=>{var W;const se=L(h,N);for(const j of se){let X=(W=ge.isAType)!=null&&W.call(ge,N)?N:void 0,we=X===void 0?N:void 0;X??(X=j),we??(we=j);const Ge=ge.makeContentKey(X,we),Ce=L(K,Ge);return[j,Ce]}return null}},["join","entries"]),ht=()=>Di(u,{key:`${n.key}/multipleRelatedEntries`,get:N=>({get:L})=>{const se=Fy(h,u);return L(se,N).members.map(j=>{var it;let X=(it=ge.isAType)!=null&&it.call(ge,N)?N:void 0,we=X===void 0?N:void 0;X??(X=j),we??(we=j);const Ge=ge.makeContentKey(X,we),Ce=L(K,Ge);return[j,Ce]})}},["join","entries"]);switch(n.cardinality){case"1:1":{const N=ye(),L=`${c}KeyOf${Ft(f)}`,se=`${f}KeyOf${Ft(c)}`,W={[L]:N,[se]:N};let j;if(i){const X=Be(),we=`${c}EntryOf${Ft(f)}`,Ge=`${f}EntryOf${Ft(c)}`,Ce={[we]:X,[Ge]:X};j=Object.assign(W,Ce)}else j=W;this.relations=ge,this.states=j;break}case"1:n":{const N=ye(),L=fe(),se=`${c}KeyOf${Ft(f)}`,W=`${f}KeysOf${Ft(c)}`,j={[se]:N,[W]:L};let X;if(i){const we=Be(),Ge=ht(),Ce=`${c}EntryOf${Ft(f)}`,it=`${f}EntriesOf${Ft(c)}`,Ue={[Ce]:we,[it]:Ge};X=Object.assign(j,Ue)}else X=j;this.relations=ge,this.states=X;break}default:{const N=fe(),L=`${c}KeysOf${Ft(f)}`,se=`${f}KeysOf${Ft(c)}`,W={[L]:N,[se]:N};let j;if(i){const X=ht(),we=`${c}EntriesOf${Ft(f)}`,Ge=`${f}EntriesOf${Ft(c)}`,Ce={[we]:X,[Ge]:X};j=Object.assign(W,Ce)}else j=W;this.relations=ge,this.states=j}}}transact(n,i){const u=this.toolkit;this.toolkit=n,i(this),this.toolkit=u}[Symbol.dispose](){}}function U1(s,n,i=Xe.STORE){return i.joins.set(s.key,new cp(s,n,i)),{key:s.key,type:"join",a:s.between[0],b:s.between[1],cardinality:s.cardinality}}function j1(s,n){let i=n.joins.get(s.key);if(i===void 0){const c=Xe.STORE.joins.get(s.key);if(c===void 0)throw new Error(`Join "${s.key}" not found in store "${n.config.name}"`);i=new cp(c.options,c.defaultContent,n),n.joins.set(s.key,i)}return i}function B1(s,n){return j1(s,n).core.relatedKeysAtoms}function q1(s){return B1(s,Xe.STORE)}Bt({key:"usersInRoomIndex",mutable:!0,default:()=>new bn,toJson:s=>s.toJSON(),fromJson:s=>bn.fromJSON(s)});Bt({key:"roomIndex",default:()=>new bn,mutable:!0,toJson:s=>s.toJSON(),fromJson:s=>bn.fromJSON(s)});const Z1={enteredAtEpoch:0},H1=U1({key:"usersInRooms",between:["room","user"],cardinality:"1:n",isAType:s=>typeof s=="string",isBType:s=>typeof s=="string"},Z1);Jv({key:"usersInMyRoomView",get:s=>({find:n})=>{const i=q1(H1);return[n(i,s)]}});const cf=Bt({key:"count",default:0}),op=Fv({key:"incrementTX",do:({set:s})=>{s(cf,n=>n+1)}}),V1=z1({key:"countContinuity",config:s=>s.add(cf).add(op)});function L1({route:[s]}){return q.jsx("article",{children:s?q.jsx(Y1,{gameId:s}):q.jsx(K1,{})})}function K1(){return q.jsx("nav",{children:q.jsx(Ju,{href:"/game/clicker",children:"Clicker"})})}pm(sp[1].game[1]);function Y1({gameId:s}){console.log(s);const n=Ut(cf),i=Wv(op);return Ib(V1),q.jsxs("article",{children:[q.jsxs("button",{type:"button",onClick:()=>{i()},children:["count is ",n]}),q.jsx("p",{children:"Let's see how high we can count!"})]})}async function G1(s,n="SHA-256"){const u=new TextEncoder().encode(s),c=await crypto.subtle.digest(n,u);return Array.from(new Uint8Array(c)).map(h=>h.toString(16).padStart(2,"0")).join("")}async function fp(s){const n=await G1(s);return`${n.substring(0,8)}-${n.substring(8,12)}-${n.substring(12,16)}-${n.substring(16,20)}-${n.substring(20,32)}`}function $1(){const s=La(cs),n=La(Ki),i=Ut(cs),u=Ut(Ki),[c,f]=dt.useState(null);return q.jsxs("form",{onSubmit:async h=>{h.preventDefault();const y=await fp("login"),p=await fetch(`${uf.VITE_BACKEND_ORIGIN}/login-${y}`,{method:"POST",body:JSON.stringify({username:i,password:u})});if(console.log(p),p.status===200){s(""),n("");const g=await p.text(),[,_]=g.split(" ");Ho(Li,{username:i,sessionKey:_}),rf.once("connect",()=>{up("/game")})}if(p.status>=400){const g=await p.text();f(g)}},children:[q.jsxs("main",{children:[c?q.jsx("aside",{children:c}):null,q.jsxs("label",{htmlFor:"username",children:[q.jsx("span",{children:"Username"}),q.jsx("input",{id:"username",type:"text",value:i,onChange:h=>{s(h.target.value)},autoComplete:"username",autoCapitalize:"none"})]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Password"}),q.jsx("input",{id:"password",type:"password",value:u,onChange:h=>{n(h.target.value)},autoComplete:"current-password",autoCapitalize:"none"})]}),q.jsx("button",{type:"submit",disabled:!i||!u,children:"->"})]}),q.jsx("footer",{children:q.jsxs(Ju,{href:"/sign_up",children:["New here? ",q.jsx("u",{children:"Sign up"})," for an account."]})})]})}function X1(){const s=La(cs),n=La(Ki),i=La(Uo),u=La(jo),c=Ut(cs),f=Ut(Ki),h=Ut(Uo),y=Ut(jo),p=Ut(np),g=Ut(ap),_=Ut(ip),O=Ut(lp),C=Ut(R1),[U,Y]=dt.useState(null);return q.jsxs("form",{onSubmit:async K=>{K.preventDefault();const ge=f,ye=await fp("sign-up"),fe=await fetch(`${uf.VITE_BACKEND_ORIGIN}/sign-up-${ye}`,{method:"POST",body:JSON.stringify({username:c,password:ge,email:y})});if(fe.status===201&&(i(""),u(""),up("/login")),fe.status>=400){const Be=await fe.text();Y(Be)}},children:[q.jsxs("main",{children:[U?q.jsx("aside",{children:U}):null,q.jsxs("label",{htmlFor:"username",children:[q.jsx("span",{children:"Username"}),q.jsx("input",{id:"username",type:"text",value:c,onChange:K=>{s(K.target.value)},autoComplete:"username",autoCapitalize:"none",style:{"--energy-color":c?p?"red":"green":void 0}}),c&&p?q.jsx("aside",{children:p.map(K=>q.jsx("span",{children:K.message},K.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Password"}),q.jsx("input",{id:"password0",type:"password",value:f,onChange:K=>{n(K.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":f?g?"red":"green":void 0}}),f&&g?q.jsx("aside",{children:g.map(K=>q.jsx("span",{children:K.message},K.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"password",children:[q.jsx("span",{children:"Confirm Password"}),q.jsx("input",{id:"password1",type:"password",value:h,onChange:K=>{i(K.target.value)},autoComplete:"new-password",autoCapitalize:"none",style:{"--energy-color":h?_?"red":"green":void 0}}),h&&_?q.jsx("aside",{children:_.map(K=>q.jsx("span",{children:K.message},K.path.join(".")))}):null]}),q.jsxs("label",{htmlFor:"email",children:[q.jsx("span",{children:"Email"}),q.jsx("input",{id:"email",type:"email",value:y,onChange:K=>{u(K.target.value)},autoComplete:"email",autoCapitalize:"none",style:{"--energy-color":y?O?"red":"green":void 0}}),y&&O?q.jsx("aside",{children:O.map(K=>q.jsx("span",{children:K.message},K.path.join(".")))}):null]}),q.jsx("button",{type:"submit",disabled:!C,children:"->"})]}),q.jsx("footer",{children:q.jsxs(Ju,{href:"/login",children:["Already have an account? ",q.jsx("u",{children:"Log in"})," instead."]})})]})}function Q1(){const s=Ut(N1);return q.jsxs("main",{className:p_.class,children:[q.jsx("header",{children:q.jsx(m_,{})}),q.jsx("main",{children:typeof s=="number"?q.jsxs("article",{children:[q.jsx("h1",{children:s}),q.jsx("h2",{children:Vm[s]}),q.jsx(Ju,{href:"/login",children:"Return to Home Page"})]}):(()=>{const[n,...i]=s;switch(n){case"admin":return q.jsx(C1,{});case"login":return q.jsx($1,{});case"sign_up":return q.jsx(X1,{});case"game":return q.jsx(L1,{route:i})}})()})]})}l0.createRoot(document.getElementById("root")).render(q.jsx(dt.StrictMode,{children:q.jsx($b,{socket:rf,children:q.jsx(Q1,{})})}));