tempest.games 0.2.8 โ†’ 0.2.10

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,109 @@
1
+ var f_=Object.defineProperty;var d_=(e,t,n)=>t in e?f_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var x=(e,t,n)=>d_(e,typeof t!="symbol"?t+"":t,n);function h_(e,t){for(var n=0;n<t.length;n++){const s=t[n];if(typeof s!="string"&&!Array.isArray(s)){for(const o in s)if(o!=="default"&&!(o in e)){const u=Object.getOwnPropertyDescriptor(s,o);u&&Object.defineProperty(e,o,u.get?u:{enumerable:!0,get:()=>s[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))s(o);new MutationObserver(o=>{for(const u of o)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&s(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const u={};return o.integrity&&(u.integrity=o.integrity),o.referrerPolicy&&(u.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?u.credentials="include":o.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function s(o){if(o.ep)return;o.ep=!0;const u=n(o);fetch(o.href,u)}})();function p_(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var vh={exports:{}},Na={};/**
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 R0;function m_(){if(R0)return Na;R0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(s,o,u){var c=null;if(u!==void 0&&(c=""+u),o.key!==void 0&&(c=""+o.key),"key"in o){u={};for(var d in o)d!=="key"&&(u[d]=o[d])}else u=o;return o=u.ref,{$$typeof:e,type:s,key:c,ref:o!==void 0?o:null,props:u}}return Na.Fragment=t,Na.jsx=n,Na.jsxs=n,Na}var O0;function y_(){return O0||(O0=1,vh.exports=m_()),vh.exports}var Y=y_(),Sh={exports:{}},be={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var M0;function g_(){if(M0)return be;M0=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(T){return T===null||typeof T!="object"?null:(T=g&&T[g]||T["@@iterator"],typeof T=="function"?T:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,E={};function _(T,U,G){this.props=T,this.context=U,this.refs=E,this.updater=G||S}_.prototype.isReactComponent={},_.prototype.setState=function(T,U){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,U,"setState")},_.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function D(){}D.prototype=_.prototype;function $(T,U,G){this.props=T,this.context=U,this.refs=E,this.updater=G||S}var M=$.prototype=new D;M.constructor=$,A(M,_.prototype),M.isPureReactComponent=!0;var H=Array.isArray,z={H:null,A:null,T:null,S:null,V:null},ee=Object.prototype.hasOwnProperty;function ie(T,U,G,Q,re,Ee){return G=Ee.ref,{$$typeof:e,type:T,key:U,ref:G!==void 0?G:null,props:Ee}}function te(T,U){return ie(T.type,U,void 0,void 0,void 0,T.props)}function fe(T){return typeof T=="object"&&T!==null&&T.$$typeof===e}function me(T){var U={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(G){return U[G]})}var Se=/\/+/g;function Ce(T,U){return typeof T=="object"&&T!==null&&T.key!=null?me(""+T.key):U.toString(36)}function we(){}function ye(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(we,we):(T.status="pending",T.then(function(U){T.status==="pending"&&(T.status="fulfilled",T.value=U)},function(U){T.status==="pending"&&(T.status="rejected",T.reason=U)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function X(T,U,G,Q,re){var Ee=typeof T;(Ee==="undefined"||Ee==="boolean")&&(T=null);var se=!1;if(T===null)se=!0;else switch(Ee){case"bigint":case"string":case"number":se=!0;break;case"object":switch(T.$$typeof){case e:case t:se=!0;break;case y:return se=T._init,X(se(T._payload),U,G,Q,re)}}if(se)return re=re(T),se=Q===""?"."+Ce(T,0):Q,H(re)?(G="",se!=null&&(G=se.replace(Se,"$&/")+"/"),X(re,U,G,"",function(un){return un})):re!=null&&(fe(re)&&(re=te(re,G+(re.key==null||T&&T.key===re.key?"":(""+re.key).replace(Se,"$&/")+"/")+se)),U.push(re)),1;se=0;var Ze=Q===""?".":Q+":";if(H(T))for(var Ne=0;Ne<T.length;Ne++)Q=T[Ne],Ee=Ze+Ce(Q,Ne),se+=X(Q,U,G,Ee,re);else if(Ne=v(T),typeof Ne=="function")for(T=Ne.call(T),Ne=0;!(Q=T.next()).done;)Q=Q.value,Ee=Ze+Ce(Q,Ne++),se+=X(Q,U,G,Ee,re);else if(Ee==="object"){if(typeof T.then=="function")return X(ye(T),U,G,Q,re);throw U=String(T),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return se}function L(T,U,G){if(T==null)return T;var Q=[],re=0;return X(T,Q,"","",function(Ee){return U.call(G,Ee,re++)}),Q}function P(T){if(T._status===-1){var U=T._result;U=U(),U.then(function(G){(T._status===0||T._status===-1)&&(T._status=1,T._result=G)},function(G){(T._status===0||T._status===-1)&&(T._status=2,T._result=G)}),T._status===-1&&(T._status=0,T._result=U)}if(T._status===1)return T._result.default;throw T._result}var F=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof T=="object"&&T!==null&&typeof T.message=="string"?String(T.message):String(T),error:T});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)};function J(){}return be.Children={map:L,forEach:function(T,U,G){L(T,function(){U.apply(this,arguments)},G)},count:function(T){var U=0;return L(T,function(){U++}),U},toArray:function(T){return L(T,function(U){return U})||[]},only:function(T){if(!fe(T))throw Error("React.Children.only expected to receive a single React element child.");return T}},be.Component=_,be.Fragment=n,be.Profiler=o,be.PureComponent=$,be.StrictMode=s,be.Suspense=h,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=z,be.__COMPILER_RUNTIME={__proto__:null,c:function(T){return z.H.useMemoCache(T)}},be.cache=function(T){return function(){return T.apply(null,arguments)}},be.cloneElement=function(T,U,G){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var Q=A({},T.props),re=T.key,Ee=void 0;if(U!=null)for(se in U.ref!==void 0&&(Ee=void 0),U.key!==void 0&&(re=""+U.key),U)!ee.call(U,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&U.ref===void 0||(Q[se]=U[se]);var se=arguments.length-2;if(se===1)Q.children=G;else if(1<se){for(var Ze=Array(se),Ne=0;Ne<se;Ne++)Ze[Ne]=arguments[Ne+2];Q.children=Ze}return ie(T.type,re,void 0,void 0,Ee,Q)},be.createContext=function(T){return T={$$typeof:c,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:u,_context:T},T},be.createElement=function(T,U,G){var Q,re={},Ee=null;if(U!=null)for(Q in U.key!==void 0&&(Ee=""+U.key),U)ee.call(U,Q)&&Q!=="key"&&Q!=="__self"&&Q!=="__source"&&(re[Q]=U[Q]);var se=arguments.length-2;if(se===1)re.children=G;else if(1<se){for(var Ze=Array(se),Ne=0;Ne<se;Ne++)Ze[Ne]=arguments[Ne+2];re.children=Ze}if(T&&T.defaultProps)for(Q in se=T.defaultProps,se)re[Q]===void 0&&(re[Q]=se[Q]);return ie(T,Ee,void 0,void 0,null,re)},be.createRef=function(){return{current:null}},be.forwardRef=function(T){return{$$typeof:d,render:T}},be.isValidElement=fe,be.lazy=function(T){return{$$typeof:y,_payload:{_status:-1,_result:T},_init:P}},be.memo=function(T,U){return{$$typeof:p,type:T,compare:U===void 0?null:U}},be.startTransition=function(T){var U=z.T,G={};z.T=G;try{var Q=T(),re=z.S;re!==null&&re(G,Q),typeof Q=="object"&&Q!==null&&typeof Q.then=="function"&&Q.then(J,F)}catch(Ee){F(Ee)}finally{z.T=U}},be.unstable_useCacheRefresh=function(){return z.H.useCacheRefresh()},be.use=function(T){return z.H.use(T)},be.useActionState=function(T,U,G){return z.H.useActionState(T,U,G)},be.useCallback=function(T,U){return z.H.useCallback(T,U)},be.useContext=function(T){return z.H.useContext(T)},be.useDebugValue=function(){},be.useDeferredValue=function(T,U){return z.H.useDeferredValue(T,U)},be.useEffect=function(T,U,G){var Q=z.H;if(typeof G=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Q.useEffect(T,U)},be.useId=function(){return z.H.useId()},be.useImperativeHandle=function(T,U,G){return z.H.useImperativeHandle(T,U,G)},be.useInsertionEffect=function(T,U){return z.H.useInsertionEffect(T,U)},be.useLayoutEffect=function(T,U){return z.H.useLayoutEffect(T,U)},be.useMemo=function(T,U){return z.H.useMemo(T,U)},be.useOptimistic=function(T,U){return z.H.useOptimistic(T,U)},be.useReducer=function(T,U,G){return z.H.useReducer(T,U,G)},be.useRef=function(T){return z.H.useRef(T)},be.useState=function(T){return z.H.useState(T)},be.useSyncExternalStore=function(T,U,G){return z.H.useSyncExternalStore(T,U,G)},be.useTransition=function(){return z.H.useTransition()},be.version="19.1.0",be}var _0;function mm(){return _0||(_0=1,Sh.exports=g_()),Sh.exports}var V=mm();const cp=p_(V),Zw=h_({__proto__:null,default:cp},[V]),{NODE_ENV:b_}=globalThis.env??{},v_=b_==="development";function $u(){}function S_(e,t){if(v_){const n=V.useRef($u);V.useEffect(()=>{let s=n.current;if(s===$u)s=e()??$u,n.current=s;else return()=>{s(),n.current=$u}},t)}else V.useEffect(e,t)}function ac(e){S_(e,[])}function Nc(e=Math.random){return e().toString(36).slice(2)}class fp extends Promise{constructor(n){let s,o;super((u,c)=>{s=u,o=c});x(this,"fate");x(this,"resolve");x(this,"reject");x(this,"done",!1);this.resolve=s,this.reject=o,this.use(n instanceof Promise?n:new Promise(n))}pass(n,s){n===this.fate&&(this.resolve(s),this.done=!0)}fail(n,s){n===this.fate&&(this.reject(s),this.done=!0)}use(n){if(n instanceof Promise){const s=n;this.fate=s,s.then(o=>{this.pass(s,o)},o=>{this.fail(s,o)})}else this.resolve(n),this.fate=void 0}}function w_(e){return Object.entries(e)}const x_=(e,t,n=xn.STORE)=>sx(n,{key:`${e.key}:JSON`,get:({get:s})=>t.toJson(s(e)),set:({set:s},o)=>{s(e,t.fromJson(o))}}),Mo=e=>JSON.parse(e),Ln=e=>JSON.stringify(e);function ve(e){for(;e.child!==null;)e=e.child;return e}class ym{constructor(t){x(this,"_buffer");x(this,"_index",0);let n;typeof t=="number"?n=t:n=t.length,this._buffer=Array.from({length:n})}get buffer(){return this._buffer}get index(){return this._index}add(t){this._buffer[this._index]=t,this._index=(this._index+1)%this._buffer.length}copy(){const t=new ym([...this._buffer]);return t._index=this._index,t}}const A_={atom_family:"atom",molecule_family:"molecule",mutable_atom_family:"mutable_atom",readonly_held_selector_family:"readonly_held_selector",readonly_pure_selector_family:"readonly_pure_selector",writable_held_selector_family:"writable_held_selector",writable_pure_selector_family:"writable_pure_selector"};function T_(e,t){const n=Ln(t),s=`${e.key}(${n})`,o=A_[e.type],u={key:s,type:o};return Object.assign(u,{family:{key:e.key,subKey:n}}),Object.assign(u,{counterfeit:!0}),u}function go(e){const t={key:e.key,type:e.type};return"family"in e&&(t.family=e.family),t}function lt(e){return hC(xn.STORE,e)}function Je(...e){return e.length===2?Li(xn.STORE,...e):Li(xn.STORE,...e)}const wh=e=>(t,n,s,o,...u)=>{console[e](`${t} ${n} "${s}" ${o}`,...u)},E_={error:wh("error"),info:wh("info"),warn:wh("warn")};class R_{constructor(t,n,s=E_){x(this,"logLevel");x(this,"filter");x(this,"logger");x(this,"error",(...t)=>{var s;const n=((s=this.filter)==null?void 0:s.call(this,...t))??!0;this.logLevel!==null&&(n===!0?this.logger.error(...t):n!==!1&&this.logger.error(...n))});x(this,"info",(...t)=>{var s;const n=((s=this.filter)==null?void 0:s.call(this,...t))??!0;this.logLevel==="info"&&(n===!0?this.logger.info(...t):n!==!1&&this.logger.info(...n))});x(this,"warn",(...t)=>{var s;const n=((s=this.filter)==null?void 0:s.call(this,...t))??!0;this.logLevel!=="error"&&this.logLevel!==null&&(n===!0?this.logger.warn(...t):n!==!1&&this.logger.warn(...n))});this.logLevel=t,this.filter=n,this.logger=s}}function fi(e){return sx(xn.STORE,e)}function Be(...e){e.length===2?Mt(xn.STORE,...e):Mt(xn.STORE,...e)}function O_(e,t,n=Nc()){return aC(xn.STORE,e,t,n)}function M_(e){return cx(xn.STORE,e)}function __(e,t=Nc()){return bm(xn.STORE,e,t)}class on{constructor(t,n){x(this,"a");x(this,"b");x(this,"cardinality");x(this,"relations",new Map);x(this,"contents",new Map);x(this,"isAType");x(this,"isBType");x(this,"isContent");x(this,"makeContentKey",(t,n)=>`${t}:${n}`);x(this,"warn");var s,o;if(this.a=t.between[0],this.b=t.between[1],this.cardinality=t.cardinality,n!=null&&n.externalStore||(this.relations=new Map((s=t.relations)==null?void 0:s.map(([u,c])=>[u,new Set(c)])),this.contents=new Map(t.contents)),this.isAType=(n==null?void 0:n.isAType)??null,this.isBType=(n==null?void 0:n.isBType)??null,this.isContent=(n==null?void 0:n.isContent)??null,n!=null&&n.makeContentKey&&(this.makeContentKey=n.makeContentKey),n!=null&&n.externalStore){const u=n.externalStore;this.has=(c,d)=>u.has(c,d),this.addRelation=(c,d)=>{u.addRelation(c,d)},this.deleteRelation=(c,d)=>{u.deleteRelation(c,d)},this.replaceRelationsSafely=(c,d)=>{u.replaceRelationsSafely(c,d)},this.replaceRelationsUnsafely=(c,d)=>{u.replaceRelationsUnsafely(c,d)},this.getRelatedKeys=c=>u.getRelatedKeys(c),u.getContent&&(this.getContentInternal=c=>u.getContent(c),this.setContent=(c,d)=>{u.setContent(c,d)},this.deleteContent=c=>{u.deleteContent(c)});for(const[c,d]of t.relations??[]){let h=(o=this.isAType)!=null&&o.call(this,c)?c:void 0,p=h===void 0?c:void 0;for(const y of d)h??(h=y),p??(p=y),this.addRelation(h,p)}for(const[c,d]of t.contents??[])this.setContent(c,d)}n!=null&&n.warn&&(this.warn=n.warn)}getRelatedKeys(t){return this.relations.get(t)}addRelation(t,n){let s=this.relations.get(t),o=this.relations.get(n);s?s.add(n):(s=new Set([n]),this.relations.set(t,s)),o?o.add(t):(o=new Set([t]),this.relations.set(n,o))}deleteRelation(t,n){const s=this.relations.get(t);if(s){s.delete(n),s.size===0&&this.relations.delete(t);const o=this.relations.get(n);o&&(o.delete(t),o.size===0&&this.relations.delete(n))}}replaceRelationsUnsafely(t,n){this.relations.set(t,new Set(n));for(const s of n){const o=new Set().add(t);this.relations.set(s,o)}}replaceRelationsSafely(t,n){var c;const s=this.relations.get(t);let o=(c=this.isAType)!=null&&c.call(this,t)?t:void 0,u=o===void 0?t:void 0;if(s)for(const d of s){o??(o=d),u??(u=d);const h=this.relations.get(d);h&&(h.size===1?this.relations.delete(d):h.delete(t),this.contents.delete(this.makeContentKey(o,u)))}this.relations.set(t,new Set(n));for(const d of n){let h=this.relations.get(d);h?h.add(t):(h=new Set().add(t),this.relations.set(d,h))}}getContentInternal(t){return this.contents.get(t)}setContent(t,n){this.contents.set(t,n)}deleteContent(t){this.contents.delete(t)}toJSON(){return{between:[this.a,this.b],cardinality:this.cardinality,relations:[...this.relations.entries()].map(([t,n])=>[t,[...n]]),contents:[...this.contents.entries()]}}set(...t){let n,s,o;switch(t.length){case 1:{const u=t[0];n=u[this.a],s=u[this.b],o=void 0;break}case 2:{const u=t[0];typeof u=="string"?[n,s]=t:(n=u[this.a],s=u[this.b],o=t[1]);break}default:{n=t[0],s=t[1],o=t[2];break}}switch(this.cardinality){case"1:1":{const u=this.getRelatedKey(n);u&&u!==s&&this.delete(n,u)}case"1:n":{const u=this.getRelatedKey(s);u&&u!==n&&this.delete(u,s)}break}if(o){const u=this.makeContentKey(n,s);this.setContent(u,o)}return this.addRelation(n,s),this}delete(t,n){n=typeof n=="string"?n:t[this.b];const s=typeof t=="string"?t:t[this.a];if(s===void 0&&typeof n=="string"){const o=this.getRelatedKeys(n);if(o)for(const u of o)this.delete(u,n)}if(typeof s=="string"&&n===void 0){const o=this.getRelatedKeys(s);if(o)for(const u of o)this.delete(s,u)}if(typeof s=="string"&&typeof n=="string"){this.deleteRelation(s,n);const o=this.makeContentKey(s,n);this.deleteContent(o)}return this}getRelatedKey(t){var s;const n=this.getRelatedKeys(t);if(n){n.size>1&&((s=this.warn)==null||s.call(this,`${n.size} related keys were found for key "${t}": (${[...n].map(u=>`"${u}"`).join(", ")}). Only one related key was expected.`));let o;for(const u of n){o=u;break}return o}}replaceRelations(t,n,s){const o=!Array.isArray(n),u=o?Object.keys(n):n;if(s!=null&&s.reckless?this.replaceRelationsUnsafely(t,u):this.replaceRelationsSafely(t,u),o)for(const c of u){const d=this.makeContentKey(t,c),h=n[c];this.setContent(d,h)}return this}getContent(t,n){const s=this.makeContentKey(t,n);return this.getContentInternal(s)}getRelationEntries(t){const n=t[this.a],s=t[this.b];if(n!==void 0&&s===void 0){const o=this.getRelatedKeys(n);if(o)return[...o].map(u=>[u,this.getContent(n,u)])}if(n===void 0&&s!==void 0){const o=this.getRelatedKeys(s);if(o)return[...o].map(u=>[u,this.getContent(u,s)])}return[]}has(t,n){if(n){const s=this.getRelatedKeys(t);return(s==null?void 0:s.has(n))??!1}return this.relations.has(t)}}class qt{constructor(){x(this,"Subscriber");x(this,"subscribers",new Map)}subscribe(t,n){return this.subscribers.set(t,n),()=>{this.unsubscribe(t)}}unsubscribe(t){this.subscribers.delete(t)}next(t){const n=this.subscribers.values();for(const s of n)s(t)}}class C_ extends qt{constructor(n){super();x(this,"state");this.state=n}next(n){this.state=n,super.next(n)}}function di(e){return"epoch"in e.transactionMeta}function Gt(e){return"phase"in e.transactionMeta}const k_=e=>{const t=ve(e);if(!Gt(t)){e.logger.warn("๐Ÿž","transaction","???","abortTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}e.logger.info("๐Ÿช‚","transaction",t.transactionMeta.update.key,"Aborting transaction"),t.parent.child=null};function Jw(e){return e[0].toUpperCase()+e.slice(1)}function D_(e){return e.type.split("_").map(Jw).join(" ")}class gm extends Error{constructor(t,n){super(`${D_(t)} ${Ln(t.key)} not found in store "${n.config.name}".`)}}function bm(e,t,n){return(...s)=>{const o=Rt(e,t);if(o)return o.run(s,n);throw new gm(t,e)}}const vm=e=>t=>e instanceof Function?e(t):e,$c=(e,t)=>{if(e.valueMap.has(t.key))return e.logger.info("๐Ÿ“–",t.type,t.key,"reading cached value"),uC(t,e);switch(t.type){case"readonly_held_selector":case"readonly_pure_selector":case"writable_held_selector":case"writable_pure_selector":return e.logger.info("๐Ÿงฎ",t.type,t.key,"computing value"),t.get();case"atom":case"mutable_atom":{const n=t.default;let s;return n instanceof Function?s=n():s=n,e.logger.info("๐Ÿ’","atom",t.key,"could not find cached value; using default",s),s}}},N_=(e,t)=>{if(e.operation.open){const n=performance.now();return e.logger.info("โ—",t.type,t.key,`deferring setState at T-${n} until setState for "${e.operation.token.key}" is done`),n}e.operation={open:!0,done:new Set,prev:new Map,time:Date.now(),token:t},e.logger.info("โญ•",t.type,t.key,`operation start in store "${e.config.name}"${Gt(e)?` ${e.transactionMeta.phase} "${e.transactionMeta.update.key}"`:""}`)},$_=e=>{e.operation.open&&e.logger.info("๐Ÿ”ด",e.operation.token.type,e.operation.token.key,`operation done in store "${e.config.name}"`),e.operation={open:!1},e.on.operationClose.next(e.operation)},B_=(e,t)=>e.operation.open?e.operation.done.has(t):(e.logger.error("๐Ÿž","unknown",t,"isDone called outside of an operation. This is probably a bug in AtomIO."),!0),Bc=(e,t)=>{if(!e.operation.open){e.logger.error("๐Ÿž","unknown",t,"markDone called outside of an operation. This is probably a bug in AtomIO.");return}e.operation.done.add(t)},L_=(e,t,n)=>{switch(t.type){case"mutable_atom":e.logger.info("๐Ÿ“ข",t.type,t.key,"is now (",n.newValue,") subscribers:",t.subject.subscribers);break;case"atom":case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":e.logger.info("๐Ÿ“ข",t.type,t.key,"went (",n.oldValue,"->",n.newValue,") subscribers:",t.subject.subscribers)}t.subject.next(n)},C0=(e,t)=>{const n=ve(e),s=n.selectorAtoms.getRelatedKeys(t.key);if(n.logger.info("๐Ÿงน",t.type,t.key,s?`evicting ${s.size} states downstream:`:"no downstream states",s??"to evict"),s){n.operation.open&&n.logger.info("๐Ÿงน",t.type,t.key,`[ ${[...n.operation.done].join(", ")} ] already done`);for(const o of s)B_(n,o)||(cC(o,n),Bc(n,o))}},V_=(e,t,n)=>{const s=$c(e,t);let o=s;if(t.type==="mutable_atom"&&Gt(e)){const{parent:c}=e;o=hp(e,t,c)}o=vm(n)(o),e.logger.info("๐Ÿ“","atom",t.key,"set to",o),o=li(e,t.key,o,t.subject),fC(e,t.key)&&dC(e,t.key),Bc(e,t.key),C0(e,t);const u={oldValue:s,newValue:o};if(!Gt(e)){L_(e,t,u);return}if(e.on.transactionApplying.state===null){const{key:c}=t;if(lC(u.newValue))return;const d={type:"atom_update",key:c,...u};t.family&&(d.family=t.family),e.transactionMeta.update.updates.push(d),e.logger.info("๐Ÿ“","atom",c,"stowed (",u.oldValue,"->",u.newValue,")")}else if(t.key.startsWith("*")){const c=t.key.slice(1),d=e.atoms.get(c);let h=e.valueMap.get(c);if(d.type==="mutable_atom"&&Gt(e)){const{parent:y}=e;h=hp(e,d,y)}h.do(u.newValue)===null&&C0(e,d)}},Qw=(e,t,n)=>{switch(t.type){case"atom":case"mutable_atom":V_(e,t,n);break;case"writable_pure_selector":case"writable_held_selector":t.set(n);break}},Sm=(e,t)=>ve(e).atoms.has(t),j_=(e,t)=>ve(e).writableSelectors.has(t),z_=(e,t)=>ve(e).readonlySelectors.has(t),U_=(e,t)=>Sm(e,t)||j_(e,t)||z_(e,t),dp=(e,t)=>ve(e).selectorGraph.getRelationEntries({downstreamSelectorKey:t}).filter(([s,{source:o}])=>o!==t).map(([s,{source:o}])=>o).filter(s=>U_(e,s)),Ww=(e,t,n)=>{const s=[],o=dp(e,t);for(;o.length>0;){const u=o.shift();n.has(u)||(n.add(u),Sm(e,u)?s.includes(u)||s.push(u):o.push(...dp(e,u)))}return s},q_=(e,t)=>{const n=e.key,s=dp(t,n),o=new Set;return s.flatMap(u=>Sm(t,u)?u:Ww(t,u,o))},K_=(e,t,n,s,o)=>{const u=ve(e),{type:c,key:d}=s;if(c==="atom"||c==="mutable_atom")u.selectorAtoms.set({selectorKey:n,atomKey:d}),e.logger.info("๐Ÿ”",t,n,`discovers root atom "${d}"`);else{const h=Ww(e,d,o);e.logger.info("๐Ÿ”",t,n,`discovers root atoms: [ ${h.map(p=>`"${p}"`).join(", ")} ]`);for(const p of h)u.selectorAtoms=u.selectorAtoms.set({selectorKey:n,atomKey:p})}o.add(d)},Lc=(e,t,n,s)=>({get:(...o)=>{const u=ve(e);let c;if(o.length===2){const[y,g]=o;c=Sn(e,y,g)}else[c]=o;const d=Rt(e,c),h=$c(e,d),p=c.key;return e.logger.info("๐Ÿ”Œ",t,n,`registers dependency ( "${p}" =`,h,")"),u.selectorGraph.set({upstreamSelectorKey:p,downstreamSelectorKey:n},{source:c.key}),K_(e,t,n,c,s),h},set:(...o)=>{let u,c;if(o.length===2)u=o[0],c=o[1];else{const p=o[0],y=o[1];c=o[2],u=Sn(e,p,y)}const d=ve(e),h=Rt(d,u);Qw(d,h,c)},find:(...o)=>Sn(e,...o),json:o=>jc(e,o)}),ex=(e,t,n)=>{const s=ve(e),o=new qt,u=new Set,{key:c,const:d}=t,h="readonly_held_selector",{get:p,find:y,json:g}=Lc(s,h,c,u),S={...t,type:h,subject:o,install:E=>ex(E,t,n),get:()=>(t.get({get:p,find:y,json:g},d),li(ve(e),c,d,o),u.clear(),d),...n};return s.readonlySelectors.set(c,S),e.logger.info("โœจ",h,c,"=",d),{key:c,type:h}},tx=(e,t,n)=>{const s=ve(e),o=new qt,u=new Set,c=t.key,d="readonly_pure_selector",{get:h,find:p,json:y}=Lc(s,d,c,u),g=()=>{const E=t.get({get:h,find:p,json:y});return li(ve(e),c,E,o),u.clear(),E},v={...t,type:d,subject:o,install:E=>tx(E,t,n),get:g,...n};s.readonlySelectors.set(c,v);const S=g();return e.logger.info("โœจ",d,c,"=",S),{key:c,type:d}},nx=(e,t,n)=>{const s=ve(e),o=new qt,u=new Set,{key:c,const:d}=t,h="writable_held_selector",p=Lc(s,h,c,u),{find:y,get:g,json:v}=p,S={find:y,get:g,json:v},A=(M=t.get,H=ve(e))=>(M(S,d),li(H,c,d,o),u.clear(),d),_={...t,type:h,subject:o,install:M=>nx(M,t,n),get:A,set:M=>{const H=ve(e),z=A(t.get,H),ee=vm(M)(z);e.logger.info("๐Ÿ“",h,c,"set (",z,"->",ee,")"),li(H,c,ee,o),Bc(H,c),di(H)&&o.next({newValue:ee,oldValue:z}),t.set(p,ee)},...n};s.writableSelectors.set(c,_);const D=A();return e.logger.info("โœจ",h,c,"=",D),{key:c,type:h}},ix=(e,t,n)=>{const s=ve(e),o=new qt,u=new Set,c=t.key,d="writable_pure_selector",h=Lc(s,d,c,u),{find:p,get:y,json:g}=h,v={find:p,get:y,json:g},S=($=t.get,M=ve(e))=>{const H=$(v);return li(M,c,H,o),u.clear(),H},E={...t,type:d,subject:o,install:$=>ix($,t,n),get:S,set:$=>{const M=ve(e),H=S(t.get,M),z=vm($)(H);e.logger.info("๐Ÿ“",d,c,"set (",H,"->",z,")"),li(M,t.key,z,o),Bc(M,t.key),di(M)&&o.next({newValue:z,oldValue:H}),t.set(h,z)},...n};s.writableSelectors.set(c,E);const _=S();return e.logger.info("โœจ",E.type,E.key,"=",_),{key:c,type:d}};function sx(e,t){const n="set"in t,s="const"in t;if(s&&n){const u=nx(e,t,void 0);return e.on.selectorCreation.next(u),u}if(s){const u=ex(e,t,void 0);return e.on.selectorCreation.next(u),u}if(n){const u=ix(e,t,void 0);return e.on.selectorCreation.next(u),u}const o=tx(e,t,void 0);return e.on.selectorCreation.next(o),o}function P_(e,t){const n=ve(e),{key:s,type:o}=t,u=Rt(n,t);if(!u.family)e.logger.error("โŒ",o,s,"Standalone selectors cannot be disposed.");else{n.molecules.get(u.family.subKey)&&n.moleculeData.delete(u.family.subKey,u.family.key);let d;switch(t.type){case"writable_held_selector":n.writableSelectors.delete(s),d={key:u.family.key,type:"writable_held_selector_family"},Rt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"writable_pure_selector":n.writableSelectors.delete(s),d={key:u.family.key,type:"writable_pure_selector_family"},Rt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"readonly_held_selector":n.readonlySelectors.delete(s),d={key:u.family.key,type:"readonly_held_selector_family"},Rt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break;case"readonly_pure_selector":n.readonlySelectors.delete(s),d={key:u.family.key,type:"readonly_pure_selector_family"},Rt(e,d).subject.next({type:"state_disposal",subType:"selector",token:t});break}n.valueMap.delete(s),n.selectorAtoms.delete(s),n.selectorGraph.delete(s),e.logger.info("๐Ÿ”ฅ",t.type,s,"deleted"),Gt(n)&&n.transactionMeta.phase==="building"?n.transactionMeta.update.updates.push({type:"state_disposal",subType:"selector",token:t}):e.on.selectorDisposal.next(t)}}function I_(e,t,n){const s=e.families.get(t.key);if(s===void 0)throw new gm(t,e);const o=s(n),u=ve(e);if(o.family)if(di(u))switch(o.type){case"atom":case"mutable_atom":e.on.atomCreation.next(o);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":e.on.selectorCreation.next(o);break}else Gt(u)&&u.on.transactionApplying.state===null&&u.transactionMeta.update.updates.push({type:"state_creation",token:o});return o}function H_(e,t,n){const s=Ln(n),o=`${t.key}(${s})`,u=ve(e);let c;switch(t.type){case"atom_family":case"mutable_atom_family":c=u.atoms.get(o);break;case"writable_held_selector_family":case"writable_pure_selector_family":c=u.writableSelectors.get(o);break;case"readonly_held_selector_family":case"readonly_pure_selector_family":c=u.readonlySelectors.get(o);break}return c&&go(c)}function Sn(e,t,n){let s=H_(e,t,n);if(s)return s;const o=Ln(n),u=e.molecules.get(o);if(!u&&e.config.lifespan==="immortal"){const c=T_(t,n);return e.logger.error("โŒ",c.type,c.key,`was not found in store "${e.config.name}"; returned a counterfeit token.`),c}return s=I_(e,t,n),u&&ve(e).moleculeData.set(o,t.key),s}function Vc(e,...t){let n;if(t.length===1)n=t[0];else{const s=t[0],o=t[1];n=Sn(e,s,o)}try{Rt(e,n)}catch{e.logger.error("โŒ",n.type,n.key,`could not be disposed because it was not found in the store "${e.config.name}".`);return}switch(n.type){case"atom":case"mutable_atom":Tm(e,n);break;case"writable_pure_selector":case"readonly_pure_selector":case"writable_held_selector":case"readonly_held_selector":P_(e,n);break}}function F_(e,t){if(t.family){const n=e.families.get(t.family.key);if(n)return n}}function Mt(e,...t){let n,s,o,u;if(t.length===2?(n=t[0],u=t[1],s=F_(e,n)??null,s&&(o=n.family?Mo(n.family.subKey):null,n=Sn(e,s,o))):(s=t[0],o=t[1],u=t[2],n=Sn(e,s,o)),"counterfeit"in n&&"family"in n){const h=n.family.subKey,p=e.disposalTraces.buffer.find(y=>(y==null?void 0:y.key)===h);e.logger.error("โŒ",n.type,n.key,`could not be set because it was not found in the store "${e.config.name}".`,p?`This state was previously disposed:
18
+ ${p.trace}`:"No previous disposal trace was found.");return}const c=N_(e,n);if(c){const h=e.on.operationClose.subscribe(`waiting to set "${n.key}" at T-${c}`,()=>{h(),e.logger.info("๐ŸŸข",n.type,n.key,`resuming deferred setState from T-${c}`),Mt(e,n,u)});return}const d=Rt(e,n);Qw(e,d,u),$_(e)}function G_(e,t,n){const{key:s,newValue:o,oldValue:u}=t,c=e==="newValue"?o:u,d={key:s,type:"atom"};t.family&&Object.assign(d,{family:t.family}),Mt(n,d,c)}function Y_(e){var n,s;const{stack:t}=e;return t?`
19
+ `+((s=(n=t.split(`
20
+ `))==null?void 0:n.slice(1))==null?void 0:s.join(`
21
+ `)):""}function rx(e,t,n,s="any"){const o=t,u=Ln(n),c=[],d=ve(e);if(Array.isArray(o))for(const y of o){const g=Ln(y);d.molecules.get(g)?e.moleculeGraph.set(g,u,{source:g}):c.push(g)}else{const y=Ln(o);d.molecules.get(y)?e.moleculeGraph.set(y,u,{source:y}):c.push(y)}c.length===0&&d.molecules.set(u,{key:n,stringKey:u,dependsOn:s});const h={type:"molecule_creation",key:n,provenance:o};Gt(d)&&d.transactionMeta.phase==="building"?d.transactionMeta.update.updates.push(h):d.on.moleculeCreation.next(h);for(const y of c){const g=e.disposalTraces.buffer.find(v=>(v==null?void 0:v.key)===y);e.logger.error("โŒ","molecule",n,"allocation failed:",`Could not allocate to ${y} in store "${e.config.name}".`,g?`
22
+ ${y} was most recently disposed
23
+ ${g.trace}`:`No previous disposal trace for ${y} was found.`)}return n}function wm(e,t){const n=Ln(t),s=e.molecules.get(n);if(!s){const S=e.disposalTraces.buffer.find(A=>(A==null?void 0:A.key)===n);e.logger.error("โŒ","molecule",t,"deallocation failed:",`Could not find allocation for ${n} in store "${e.config.name}".`,S?`
24
+ This state was most recently deallocated
25
+ ${S.trace}`:`No previous disposal trace for ${n} was found.`);return}const o=e.moleculeJoins.getRelatedKeys(s.key);if(o)for(const S of o){const A=e.joins.get(S);A&&(A.relations.delete(s.key),A.molecules.delete(s.stringKey))}e.moleculeJoins.delete(s.stringKey);const u=[],c=[],d={type:"molecule_disposal",key:s.key,values:c,provenance:u},h=ve(e);h.molecules.delete(n);const p=Gt(h)&&h.transactionMeta.phase==="building";p&&h.transactionMeta.update.updates.push(d);const y=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:s.stringKey});if(y)for(const[S,{source:A}]of y)if(A===s.stringKey){const E=Mo(S);wm(e,E)}else u.push(A);const g=h.moleculeData.getRelatedKeys(s.stringKey);if(g)for(const S of g){const A=h.families.get(S),E=Sn(e,A,s.key);c.push([A.key,E]),Vc(e,E)}h.moleculeGraph.delete(s.stringKey),h.moleculeJoins.delete(s.stringKey),h.moleculeData.delete(s.stringKey),p||h.on.moleculeDisposal.next(d),h.molecules.delete(s.stringKey);const v=Y_(new Error);e.disposalTraces.add({key:n,trace:v})}function k0(e,t,n,s){const o=Ln(n),u=ve(e),c=u.molecules.get(o);if(!c){const v=e.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===o);return e.logger.error("โŒ","molecule",n,"claim failed:",`Could not allocate to ${o} in store "${e.config.name}".`,v?`
26
+ ${o} was most recently disposed
27
+ ${v.trace}`:`No previous disposal trace for ${o} was found.`),n}const d=Ln(t),h=u.molecules.get(d);if(!h){const v=e.disposalTraces.buffer.find(S=>(S==null?void 0:S.key)===d);return e.logger.error("โŒ","molecule",n,"claim failed:",`Could not allocate to ${d} in store "${e.config.name}".`,v?`
28
+ ${d} was most recently disposed
29
+ ${v.trace}`:`No previous disposal trace for ${d} was found.`),n}const p=e.moleculeGraph.getRelationEntries({downstreamMoleculeKey:c.stringKey}).filter(([,{source:v}])=>v!==o).map(([v])=>Mo(v));u.moleculeGraph.delete(o),u.moleculeGraph.set({upstreamMoleculeKey:h.stringKey,downstreamMoleculeKey:c.stringKey},{source:h.stringKey});const y={type:"molecule_transfer",key:c.key,from:p,to:[h.key]};return Gt(u)&&u.transactionMeta.phase==="building"&&u.transactionMeta.update.updates.push(y),n}function X_(e,t,n){switch(t){case"newValue":{ox(e,n);break}case"oldValue":{Vc(n,e.token);break}}}function Z_(e,t,n){switch(t){case"newValue":{Vc(n,e.token);break}case"oldValue":{ox(e,n),e.subType==="atom"&&n.valueMap.set(e.token.key,e.value);break}}}function ox(e,t){const{family:n}=e.token;if(n){const s=t.families.get(n.key);s&&Sn(t,s,Mo(n.subKey))}}function J_(e,t,n){switch(t){case"newValue":rx(n,e.provenance,e.key);break;case"oldValue":wm(n,e.key);break}}function Q_(e,t,n){switch(t){case"newValue":wm(n,e.key);break;case"oldValue":{const s=e.provenance.map(Mo);rx(n,s,e.key);for(const[o,u]of e.values){const c=n.families.get(o);if(c){Sn(n,c,e.key);const d=`${o}(${Ln(e.key)})`;n.valueMap.set(d,u)}}}break}}function W_(e,t,n){switch(t){case"newValue":{const s=e.to.length===1?e.to[0]:e.to;k0(n,s,e.key)}break;case"oldValue":{const s=e.from.length===1?e.from[0]:e.from;k0(n,s,e.key)}break}}function io(e,t,n){const s=e==="newValue"?t.updates:[...t.updates].reverse();for(const o of s)switch(o.type){case"atom_update":case"selector_update":G_(e,o,n);break;case"state_creation":X_(o,e,n);break;case"state_disposal":Z_(o,e,n);break;case"molecule_creation":J_(o,e,n);break;case"molecule_disposal":Q_(o,e,n);break;case"molecule_transfer":W_(o,e,n);break;case"transaction_update":io(e,o,n);break}}function ax(e,t){return e.transactionMeta.actionContinuities.getRelatedKey(t)}function lx(e,t){return e.transactionMeta.epoch.get(t)}function eC(e,t){if(!di(e))return;const s=ax(e,t);if(s!==void 0)return lx(e,s)}function xm(e,t,n){di(e)&&t&&e.transactionMeta.epoch.set(t,n)}function tC(e,t,n){if(!di(e))return;const o=ax(e,t);o!==void 0&&e.transactionMeta.epoch.set(o,n)}const nC=(e,t)=>{var u;const n=ve(t),{parent:s}=n;if(s===null||!Gt(n)||((u=n.transactionMeta)==null?void 0:u.phase)!=="building"){t.logger.warn("๐Ÿž","transaction","???","applyTransaction called outside of a transaction. This is probably a bug in AtomIO.");return}n.transactionMeta.phase="applying",n.transactionMeta.update.output=e,s.child=null,s.on.transactionApplying.next(n.transactionMeta);const{updates:o}=n.transactionMeta.update;if(t.logger.info("๐Ÿ›„","transaction",n.transactionMeta.update.key,`Applying transaction with ${o.length} updates:`,o),io("newValue",n.transactionMeta.update,s),di(s)){tC(s,n.transactionMeta.update.key,n.transactionMeta.update.epoch);const c=Rt(t,{key:n.transactionMeta.update.key,type:"transaction"});c==null||c.subject.next(n.transactionMeta.update),t.logger.info("๐Ÿ›ฌ","transaction",n.transactionMeta.update.key,"Finished applying transaction.")}else Gt(s)&&s.transactionMeta.update.updates.push(n.transactionMeta.update);s.on.transactionApplying.next(null)};function ux(e,t,n){if(!di(e))return;const{epoch:o,actionContinuities:u}=e.transactionMeta;u.set(t,n),o.has(t)||o.set(t,-1)}function iC(e){return{store:e}}function Li(e,...t){let n,s,o;if(t.length===1?n=t[0]:(s=t[0],o=t[1],n=Sn(e,s,o)),"counterfeit"in n&&"family"in n){s=e.families.get(n.family.key);const u=n.family.subKey,c=e.disposalTraces.buffer.find(d=>(d==null?void 0:d.key)===u);switch(e.logger.error("โŒ",n.type,n.key,`could not be retrieved because it was not found in the store "${e.config.name}".`,c?`This state was previously disposed:
30
+ ${c.trace}`:"No previous disposal trace was found."),s.type){case"atom_family":case"mutable_atom_family":return e.defaults.get(s.key);case"readonly_pure_selector_family":case"writable_pure_selector_family":case"readonly_held_selector_family":case"writable_held_selector_family":{if(e.defaults.has(s.key))return e.defaults.get(n.family.key);const d=Rt(e,s).default(u);return e.defaults.set(s.key,d),d}}}return $c(e,Rt(e,n))}class Wn extends Map{constructor(n){super();x(this,"deleted",new Set);x(this,"source");this.source=n}get(n){if(super.has(n))return super.get(n);if(!this.deleted.has(n)&&this.source.has(n))return this.source.get(n)}set(n,s){return this.deleted.delete(n),super.set(n,s)}hasOwn(n){return super.has(n)}has(n){return!this.deleted.has(n)&&(super.has(n)||this.source.has(n))}delete(n){return this.deleted.add(n),super.delete(n)}}const sC=(e,t,n,s)=>{const o=ve(e),u={parent:o,child:null,on:o.on,loggers:o.loggers,logger:o.logger,config:o.config,atoms:new Wn(o.atoms),atomsThatAreDefault:new Set(o.atomsThatAreDefault),families:new Wn(o.families),joins:new Wn(o.joins),operation:{open:!1},readonlySelectors:new Wn(o.readonlySelectors),timelines:new Wn(o.timelines),timelineTopics:new on(o.timelineTopics.toJSON()),trackers:new Map,transactions:new Wn(o.transactions),selectorAtoms:new on(o.selectorAtoms.toJSON()),selectorGraph:new on(o.selectorGraph.toJSON(),{makeContentKey:(...p)=>p.sort().join(":")}),writableSelectors:new Wn(o.writableSelectors),valueMap:new Wn(o.valueMap),defaults:o.defaults,disposalTraces:e.disposalTraces.copy(),molecules:new Wn(o.molecules),moleculeGraph:new on(o.moleculeGraph.toJSON(),{makeContentKey:o.moleculeGraph.makeContentKey}),moleculeData:new on(o.moleculeData.toJSON(),{makeContentKey:o.moleculeData.makeContentKey}),moleculeJoins:new on(o.moleculeJoins.toJSON(),{makeContentKey:o.moleculeJoins.makeContentKey}),miscResources:new Wn(o.miscResources)},c=eC(e,t),d={phase:"building",update:{type:"transaction_update",key:t,id:s,epoch:c===void 0?Number.NaN:c+1,updates:[],params:n,output:void 0},toolkit:{get:(...p)=>Li(h,...p),set:(...p)=>{Mt(h,...p)},run:(p,y=Nc())=>bm(h,p,y),find:(...p)=>Sn(e,...p),json:p=>jc(h,p),dispose:(...p)=>{Vc(h,...p)},env:()=>iC(h)}},h=Object.assign(u,{transactionMeta:d});return o.child=h,e.logger.info("๐Ÿ›ซ","transaction",t,"Building transaction with params:",n),h};function cx(e,t){const n={key:t.key,type:"transaction",run:(u,c)=>{const d=sC(e,t.key,u,c);try{const h=ve(e),{toolkit:p}=d.transactionMeta,y=t.do(p,...u);return nC(y,h),y}catch(h){throw k_(s),e.logger.warn("๐Ÿ’ฅ","transaction",t.key,"caught:",h),h}},install:u=>cx(u,t),subject:new qt},s=ve(e);s.transactions.set(n.key,n);const o=go(n);return e.on.transactionCreation.next(o),o}class rC{constructor(t,n=null){x(this,"parent",null);x(this,"child",null);x(this,"valueMap",new Map);x(this,"defaults",new Map);x(this,"atoms",new Map);x(this,"writableSelectors",new Map);x(this,"readonlySelectors",new Map);x(this,"atomsThatAreDefault",new Set);x(this,"selectorAtoms",new on({between:["selectorKey","atomKey"],cardinality:"n:n"}));x(this,"selectorGraph",new on({between:["upstreamSelectorKey","downstreamSelectorKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"trackers",new Map);x(this,"families",new Map);x(this,"joins",new Map);x(this,"transactions",new Map);x(this,"transactionMeta",{epoch:new Map,actionContinuities:new on({between:["continuity","action"],cardinality:"1:n"})});x(this,"timelines",new Map);x(this,"timelineTopics",new on({between:["timelineKey","topicKey"],cardinality:"1:n"}));x(this,"disposalTraces",new ym(100));x(this,"molecules",new Map);x(this,"moleculeJoins",new on({between:["moleculeKey","joinKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"moleculeGraph",new on({between:["upstreamMoleculeKey","downstreamMoleculeKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"moleculeData",new on({between:["moleculeKey","stateFamilyKey"],cardinality:"n:n"},{makeContentKey:(...t)=>t.sort().join(":")}));x(this,"miscResources",new Map);x(this,"on",{atomCreation:new qt,atomDisposal:new qt,selectorCreation:new qt,selectorDisposal:new qt,timelineCreation:new qt,transactionCreation:new qt,transactionApplying:new C_(null),operationClose:new qt,moleculeCreation:new qt,moleculeDisposal:new qt});x(this,"operation",{open:!1});x(this,"config",{name:"IMPLICIT_STORE",lifespan:"ephemeral"});x(this,"loggers",[new R_("warn",(t,n,s)=>!pC(s))]);x(this,"logger",{error:(...t)=>{for(const n of this.loggers)n.error(...t)},info:(...t)=>{for(const n of this.loggers)n.info(...t)},warn:(...t)=>{for(const n of this.loggers)n.warn(...t)}});var s,o;if(this.config={...n==null?void 0:n.config,...t},n!==null){this.valueMap=new Map(n==null?void 0:n.valueMap),this.operation={...n==null?void 0:n.operation},di(n)&&(this.transactionMeta={epoch:new Map(n==null?void 0:n.transactionMeta.epoch),actionContinuities:new on(n==null?void 0:n.transactionMeta.actionContinuities.toJSON())});for(const[,c]of n.families)(s=c.internalRoles)!=null&&s.includes("mutable")||(o=c.internalRoles)!=null&&o.includes("join")||c.install(this);const u=new Set;for(const[,c]of n.atoms)if(!u.has(c.key)&&(c.install(this),c.type==="mutable_atom")){const d=jc(n,c),h=mx(c);u.add(d.key),u.add(h.key)}for(const[,c]of n.readonlySelectors)c.install(this);for(const[,c]of n.writableSelectors)u.has(c.key)||c.install(this);for(const[,c]of n.transactions)c.install(this);for(const[,c]of n.timelines)c.install(this)}}}const xn={get STORE(){return globalThis.ATOM_IO_IMPLICIT_STORE??(globalThis.ATOM_IO_IMPLICIT_STORE=new rC({name:"IMPLICIT_STORE",lifespan:"ephemeral"})),globalThis.ATOM_IO_IMPLICIT_STORE}};function Rt(e,t){let n,s=e;for(;s!==null;){switch(t.type){case"atom":case"mutable_atom":n=s.atoms.get(t.key);break;case"writable_pure_selector":case"writable_held_selector":n=s.writableSelectors.get(t.key);break;case"readonly_pure_selector":case"readonly_held_selector":n=s.readonlySelectors.get(t.key);break;case"atom_family":case"mutable_atom_family":case"writable_pure_selector_family":case"readonly_pure_selector_family":case"writable_held_selector_family":case"readonly_held_selector_family":n=s.families.get(t.key);break;case"timeline":n=s.timelines.get(t.key);break;case"transaction":n=s.transactions.get(t.key);break}if(n)return n;s=s.child}throw new gm(t,e)}const oC=(e,t)=>{const n=ve(e);return n.operation.open?n.operation.prev.get(t.key):n.valueMap.get(t.key)};function aC(e,t,n,s=Nc()){switch(t.type){case"atom":case"mutable_atom":case"readonly_pure_selector":case"readonly_held_selector":case"writable_pure_selector":case"writable_held_selector":return bo(e,t,s,n);case"transaction":return dx(e,t,s,n);case"timeline":return fx(e,t,s,n)}}const D0=(e,t)=>{const n=ve(e);return q_(t,e).map(o=>{const u=n.atoms.get(o);if(u===void 0)throw new Error(`Atom "${o}", a dependency of selector "${t.key}", not found in store "${e.config.name}".`);return u.subject.subscribe(`${t.type}:${t.key}`,c=>{e.logger.info("๐Ÿ“ข",t.type,t.key,"root",o,"went",c.oldValue,"->",c.newValue);const d=oC(n,t),h=$c(n,t);e.logger.info("โœจ",t.type,t.key,"went",d,"->",h),t.subject.next({newValue:h,oldValue:d})})})};function bo(e,t,n,s){function o(g){if(e.operation.open){const v=e.on.operationClose.subscribe(`state subscription ${n}`,()=>{v(),s(g)})}else s(g)}const u=Rt(e,t);e.logger.info("๐Ÿ‘€",u.type,u.key,`Adding subscription "${n}"`);const c=u.type==="writable_pure_selector"||u.type==="readonly_pure_selector";let d=null,h=o;c&&(d=D0(e,u),h=g=>{d&&(d.length=0,d.push(...D0(e,u))),o(g)});const p=u.subject.subscribe(n,h);return()=>{if(e.logger.info("๐Ÿ™ˆ",u.type,u.key,`Removing subscription "${n}"`),p(),d)for(const g of d)g()}}const fx=(e,t,n,s)=>{const o=Rt(e,t);e.logger.info("๐Ÿ‘€","timeline",t.key,`Adding subscription "${n}"`);const u=o.subject.subscribe(n,s);return()=>{e.logger.info("๐Ÿ™ˆ","timeline",t.key,`Removing subscription "${n}" from timeline`),u()}},dx=(e,t,n,s)=>{const o=Rt(e,t);e.logger.info("๐Ÿ‘€","transaction",t.key,`Adding subscription "${n}"`);const u=o.subject.subscribe(n,s);return()=>{e.logger.info("๐Ÿ™ˆ","transaction",t.key,`Removing subscription "${n}"`),u()}};var _w;_w=Symbol.dispose;class hx{constructor(t,n){x(this,"unsubscribeFromInnerValue");x(this,"unsubscribeFromState");x(this,"mutableState");x(this,"latestUpdateState");x(this,_w);this.mutableState=t;const s=ve(n);this.latestUpdateState=this.initializeState(t,s),this.observeCore(t,this.latestUpdateState,s),this.updateCore(t,this.latestUpdateState,s),s.trackers.set(t.key,this),this[Symbol.dispose]=()=>{this.unsubscribeFromInnerValue(),this.unsubscribeFromState(),s.trackers.delete(t.key)}}initializeState(t,n){var c;const s=`*${t.key}`;n.atoms.delete(s),n.valueMap.delete(s);const o=t.family?{key:`*${t.family.key}`,subKey:t.family.subKey}:void 0,u=Am(n,{key:s,default:null},o);if((c=n.parent)!=null&&c.valueMap.has(s)){const d=n.parent.valueMap.get(s);n.valueMap.set(s,d)}return u}observeCore(t,n,s){const o=`tracker:${s.config.name}:${Gt(s)?s.transactionMeta.update.key:"main"}:${t.key}`,u=Li(s,t);this.unsubscribeFromInnerValue=u.subscribe(o,c=>{Mt(s,n,c)}),this.unsubscribeFromState=bo(s,t,o,c=>{c.newValue!==c.oldValue&&(this.unsubscribeFromInnerValue(),this.unsubscribeFromInnerValue=c.newValue.subscribe(o,d=>{Mt(s,n,d)}))})}updateCore(t,n,s){const o=`tracker:${s.config.name}:${Gt(s)?s.transactionMeta.update.key:"main"}:${t.key}`;bo(s,n,o,({newValue:u,oldValue:c})=>{const d=s.timelineTopics.getRelatedKey(n.key);if(d){const p=s.timelines.get(d);if(p!=null&&p.timeTraveling){const y=fx(s,{key:d,type:"timeline"},o,g=>{y(),Mt(s,t,v=>(g==="redo"&&u?v.do(u):g==="undo"&&c&&v.undo(c),v))});return}}const h=s.on.operationClose.subscribe(o,()=>{h();const p=Li(s,t),y=u===null?-1:p.getUpdateNumber(u),g=y-p.cacheUpdateNumber;u&&g===1?Mt(s,t,v=>(v.do(u),v)):s.logger.info("โŒ","mutable_atom",t.key,`could not be updated. Expected update number ${p.cacheUpdateNumber+1}, but got ${y}`)})})}}function px(e,t,n){e.logger.info("๐Ÿ”จ","atom",t.key,`creating in store "${e.config.name}"`);const s=ve(e),{key:o,default:u}=t,c=s.atoms.get(o),d="mutable_atom";if(c&&c.type===d)return e.logger.error("โŒ",d,o,"Tried to create atom, but it already exists in the store."),go(c);const h=new qt,p={...t,type:d,install:v=>(v.logger.info("๐Ÿ› ๏ธ","atom",o,`installing in store "${v.config.name}"`),px(v,t)),subject:h},y=u();s.atoms.set(p.key,p),yx(e,o),li(s,o,y,h);const g=go(p);if(t.effects){let v=0;const S=[];for(const A of t.effects){const E=A({setSelf:_=>{Mt(e,g,_)},onSet:_=>bo(e,g,`effect[${v}]`,_)});E&&S.push(E),++v}p.cleanup=()=>{for(const A of S)A()}}return new hx(g,e),x_(g,t,e),g}const jc=(e,t)=>{if(t.family){const s=ve(e),u={key:`${t.family.key}:JSON`,type:"writable_pure_selector_family"},c=Rt(s,u),d=JSON.parse(t.family.subKey);return Sn(e,c,d)}return{type:"writable_pure_selector",key:`${t.key}:JSON`}},mx=e=>{const n={type:"atom",key:`*${e.key}`};return e.family&&(n.family={key:`*${e.family.key}`,subKey:e.family.subKey}),n};function lC(e){return typeof e=="object"&&e!==null&&"do"in e&&"undo"in e&&"subscribe"in e}function hp(e,t,n){const s=n.valueMap.get(t.key),o=e.valueMap.get(t.key);if(s!==o)return o;if(s===void 0)return t.default();n.logger.info("๐Ÿ“ƒ","atom",t.key,"copying");const u=t.toJson(s),c=t.fromJson(u);return e.valueMap.set(t.key,c),new hx(t,n),c}function li(e,t,n,s){const o=e.valueMap.get(t);if(o instanceof fp&&o.use(n),n instanceof Promise){const u=new fp(n);return e.valueMap.set(t,u),u.then(c=>{li(e,t,c,s),s.next({newValue:c,oldValue:u})}).catch(c=>{e.logger.error("๐Ÿ’ฅ","state",t,"rejected:",c)}),u}return e.valueMap.set(t,n),n}const uC=(e,t)=>{let n=t.valueMap.get(e.key);if(e.type==="mutable_atom"&&Gt(t)){const{parent:s}=t;n=hp(t,e,s)}return n},cC=(e,t)=>{const n=t.valueMap.get(e);if(n instanceof fp){const s=n,o=t.writableSelectors.get(e)??t.readonlySelectors.get(e);o&&s.use(o.get());return}t.operation.open&&t.operation.prev.set(e,n),t.valueMap.delete(e),t.logger.info("๐Ÿ—‘","state",e,"evicted")},fC=(e,t)=>ve(e).atomsThatAreDefault.has(t),yx=(e,t)=>{const n=ve(e);n.atomsThatAreDefault=new Set(n.atomsThatAreDefault).add(t)},dC=(e,t)=>{const n=ve(e);n.atomsThatAreDefault=new Set(ve(e).atomsThatAreDefault),n.atomsThatAreDefault.delete(t)};function Am(e,t,n){const s="atom",{key:o,default:u}=t;e.logger.info("๐Ÿ”จ","atom",o,`creating in store "${e.config.name}"`);const c=ve(e),d=c.atoms.get(o);if(d&&d.type===s)return e.logger.error("โŒ","atom",o,"Tried to create atom, but it already exists in the store."),go(d);const h=new qt,p={...t,type:s,install:v=>(v.logger.info("๐Ÿ› ๏ธ",s,o,`installing in store "${v.config.name}"`),Am(v,t,n)),subject:h};n&&(p.family=n);let y=u;u instanceof Function&&(y=u()),c.atoms.set(o,p),yx(e,o),li(c,o,y,h);const g=go(p);if(t.effects){let v=0;const S=[];for(const A of t.effects){const E=A({setSelf:_=>{Mt(e,g,_)},onSet:_=>bo(e,g,`effect[${v}]`,_)});E&&S.push(E),++v}p.cleanup=()=>{for(const A of S)A()}}return g}function hC(e,t){if("mutable"in t){const o=px(e,t);return e.on.atomCreation.next(o),o}const s=Am(e,t,void 0);return e.on.atomCreation.next(s),s}function Tm(e,t){var c;const n=ve(e),{key:s,family:o}=t,u=Rt(n,t);if(!o)e.logger.error("โŒ","atom",s,"Standalone atoms cannot be disposed.");else{(c=u.cleanup)==null||c.call(u);const d=e.valueMap.get(u.key),h=Rt(e,{key:o.key,type:"atom_family"}),p={type:"state_disposal",subType:"atom",token:t,value:d};h.subject.next(p);const y=Gt(n);if(n.atoms.delete(s),n.valueMap.delete(s),n.selectorAtoms.delete(s),n.atomsThatAreDefault.delete(s),e.timelineTopics.delete(s),t.type==="mutable_atom"){const g=mx(t);Tm(e,g),e.trackers.delete(s)}if(e.logger.info("๐Ÿ”ฅ","atom",s,"deleted"),y&&n.transactionMeta.phase==="building"){const g=n.transactionMeta.update.updates.at(-1);(g==null?void 0:g.type)==="molecule_disposal"&&g.values.some(([A])=>{var E;return A===((E=u.family)==null?void 0:E.key)})||n.transactionMeta.update.updates.push(p)}else e.on.atomDisposal.next(t)}}function pC(e){return e.startsWith("๐Ÿ” ")}const Em=V.createContext(xn.STORE);function gx(e,...t){let n;if(t.length===2){const s=t[0],o=t[1];n=Sn(e,s,o)}else n=t[0];return n}function Hn(...e){const t=V.useContext(Em),n=gx(t,...e),s=V.useRef(null);return s.current??(s.current=o=>{Mt(t,n,o)}),s.current}function bt(...e){const t=V.useContext(Em),n=gx(t,...e),s=V.useId();return V.useSyncExternalStore(o=>bo(t,n,`use-o:${s}`,o),()=>Li(t,n),()=>Li(t,n))}const mC=(e,t,n,s,o)=>u=>{function c(h,p){if(e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"reconciling updates"),Mt(e,Yu,g=>(g.shift(),g)),h.id===p.id){const g=JSON.stringify(h.updates),v=JSON.stringify(p.updates);if(g===v){e.logger.info("โœ…","continuity",t,`results for ${h.id} match between client and server`),n.emit(`ack:${t}`,p.epoch);return}}else e.logger.info("โŒ","continuity",t,`thought update #${p.epoch} was ${h.key}:${h.id}, but it was actually ${p.key}:${p.id}`);e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"updates do not match",h,p);const y=s.toReversed();for(const g of y)io("oldValue",g,e);e.logger.info("โช","continuity",t,"undid optimistic updates:",y),io("oldValue",h,e),e.logger.info("โช","continuity",t,"undid zeroth optimistic update",h),io("newValue",p,e),e.logger.info("โฉ","continuity",t,"applied confirmed update",p),n.emit(`ack:${t}`,p.epoch);for(const g of s){const v={type:"transaction",key:g.key},{id:S,params:A}=g;bm(e,v,S)(...A)}e.logger.info("โฉ","continuity",t,"reapplied subsequent optimistic updates:",s)}e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"integrating confirmed update",{confirmedUpdate:u,confirmedUpdates:o,optimisticUpdates:s});const d=s[0];if(d)if(e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"has optimistic updates to reconcile"),u.epoch===d.epoch){e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,`epoch of confirmed update #${u.epoch} matches zeroth optimistic update`),c(d,u);for(const h of o){const p=s[0];if(h.epoch===(p==null?void 0:p.epoch))c(p,h);else break}}else e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,`epoch of confirmed update #${u.epoch} does not match zeroth optimistic update #${d.epoch}`),o.some(p=>p.epoch===u.epoch)||(e.logger.info("๐Ÿ‘ˆ","continuity",t,"pushing confirmed update to queue",u),Mt(e,pp,p=>(p.push(u),p.sort((y,g)=>y.epoch-g.epoch),p)));else{e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,"has no optimistic updates to deal with");const h=di(e);let p;h&&(p=lx(e,t)),p===u.epoch-1?(e.logger.info("โœ…","continuity",t,`integrating update #${u.epoch} (${u.key} ${u.id})`),io("newValue",u,e),n.emit(`ack:${t}`,u.epoch),xm(e,t,u.epoch)):h&&p!==void 0&&(e.logger.info("๐Ÿง‘โ€โš–๏ธ","continuity",t,`received update #${u.epoch} but still waiting for update #${p+1}`,{clientEpoch:p,serverEpoch:u.epoch}),o.some(g=>g.epoch===u.epoch)?e.logger.info("๐Ÿ‘","continuity",t,`confirmed update #${u.epoch} is already enqueued`):(e.logger.info("๐Ÿ‘ˆ","continuity",t,`pushing confirmed update #${u.epoch} to queue`),Mt(e,pp,g=>(g.push(u),g.sort((v,S)=>v.epoch-S.epoch),g))))}};function yC(e){return t=>{for(const n of t)Tm(e,n)}}function gC(e){return t=>{let n=0,s,o;for(const u of t)n%2===0?s=u:(o=u,Mt(e,s,o)),n++}}const bx=(e,{stringify:t,parse:n},s)=>({setSelf:o,onSet:u})=>{const c=e.getItem(s);c!=null&&o(n(c)),u(({newValue:d})=>{if(d==null){e.removeItem(s);return}e.setItem(s,t(d))})},vx=lt({key:"mySocketId__INTERNAL",default:void 0});fi({key:"mySocketId",get:({get:e})=>e(vx)});lt({key:"myName",default:null,effects:typeof window>"u"?[]:[bx(window.localStorage,JSON,"myUsername")]});const Yu=lt({key:"updateQueue",default:[]}),pp=lt({key:"serverConfirmedUpdateQueue",default:[]});function bC(e,t,n){const s=n.key,o=Li(e,Yu),u=Li(e,pp),c=(g,v)=>{t.off(`continuity-init:${s}`,c);let S=0,A,E;for(const _ of v)S%2===0?A=_:(E=_,"type"in A&&A.type==="mutable_atom"&&(A=jc(e,A)),Mt(e,A,E)),S++;xm(e,s,g)};t.off(`continuity-init:${s}`),t.on(`continuity-init:${s}`,c);const d=mC(e,s,t,o,u);t.off(`tx-new:${s}`),t.on(`tx-new:${s}`,d);const h=n.actions.map(g=>(ux(e,s,g.key),dx(e,g,`tx-run:${s}`,S=>{e.logger.info("๐Ÿคž","continuity",s,"enqueuing optimistic update");const A=o.findIndex(E=>E.id===S.id);A===-1?(e.logger.info("๐Ÿคž","continuity",s,"enqueuing new optimistic update"),Mt(e,Yu,E=>(E.push(S),E.sort((_,D)=>_.epoch-D.epoch),E))):(e.logger.info("๐Ÿคž","continuity",s,`replacing existing optimistic update at index ${A}`),Mt(e,Yu,E=>(E[A]=S,E))),t.emit(`tx-run:${s}`,{id:S.id,key:g.key,params:S.params})}))),p=gC(e),y=yC(e);return t.on(`reveal:${s}`,p),t.on(`conceal:${s}`,y),t.emit(`get:${s}`),()=>{t.off(`continuity-init:${s}`),t.off(`tx-new:${s}`);for(const g of h)g()}}const Sx=V.createContext({socket:null,services:null}),vC=({children:e,socket:t})=>{const n=V.useRef(new Map).current,s=Hn(vx);return V.useEffect(()=>{s(t==null?void 0:t.id),t==null||t.on("connect",()=>{s(t.id)}),t==null||t.on("disconnect",()=>{s(void 0)})},[t,s]),Y.jsx(Sx.Provider,{value:{socket:t,services:n},children:e})};function SC(e,t){const{socket:n,services:s}=V.useContext(Sx);ac(()=>{let o=s==null?void 0:s.get(e);return o?o[0]++:(o=[1,n?t(n):void 0],s==null||s.set(e,o)),()=>{var u;o&&(o[0]--,o[0]===0&&((u=o[1])==null||u.call(o),s==null||s.delete(e)))}})}function wC(e){const t=V.useContext(Em);SC(`tx-sync:${e.key}`,n=>bC(t,n,e))}var xh={exports:{}},$a={},Ah={exports:{}},Th={};/**
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 N0;function xC(){return N0||(N0=1,function(e){function t(L,P){var F=L.length;L.push(P);e:for(;0<F;){var J=F-1>>>1,T=L[J];if(0<o(T,P))L[J]=P,L[F]=T,F=J;else break e}}function n(L){return L.length===0?null:L[0]}function s(L){if(L.length===0)return null;var P=L[0],F=L.pop();if(F!==P){L[0]=F;e:for(var J=0,T=L.length,U=T>>>1;J<U;){var G=2*(J+1)-1,Q=L[G],re=G+1,Ee=L[re];if(0>o(Q,F))re<T&&0>o(Ee,Q)?(L[J]=Ee,L[re]=F,J=re):(L[J]=Q,L[G]=F,J=G);else if(re<T&&0>o(Ee,F))L[J]=Ee,L[re]=F,J=re;else break e}}return P}function o(L,P){var F=L.sortIndex-P.sortIndex;return F!==0?F:L.id-P.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var h=[],p=[],y=1,g=null,v=3,S=!1,A=!1,E=!1,_=!1,D=typeof setTimeout=="function"?setTimeout:null,$=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function H(L){for(var P=n(p);P!==null;){if(P.callback===null)s(p);else if(P.startTime<=L)s(p),P.sortIndex=P.expirationTime,t(h,P);else break;P=n(p)}}function z(L){if(E=!1,H(L),!A)if(n(h)!==null)A=!0,ee||(ee=!0,Ce());else{var P=n(p);P!==null&&X(z,P.startTime-L)}}var ee=!1,ie=-1,te=5,fe=-1;function me(){return _?!0:!(e.unstable_now()-fe<te)}function Se(){if(_=!1,ee){var L=e.unstable_now();fe=L;var P=!0;try{e:{A=!1,E&&(E=!1,$(ie),ie=-1),S=!0;var F=v;try{t:{for(H(L),g=n(h);g!==null&&!(g.expirationTime>L&&me());){var J=g.callback;if(typeof J=="function"){g.callback=null,v=g.priorityLevel;var T=J(g.expirationTime<=L);if(L=e.unstable_now(),typeof T=="function"){g.callback=T,H(L),P=!0;break t}g===n(h)&&s(h),H(L)}else s(h);g=n(h)}if(g!==null)P=!0;else{var U=n(p);U!==null&&X(z,U.startTime-L),P=!1}}break e}finally{g=null,v=F,S=!1}P=void 0}}finally{P?Ce():ee=!1}}}var Ce;if(typeof M=="function")Ce=function(){M(Se)};else if(typeof MessageChannel<"u"){var we=new MessageChannel,ye=we.port2;we.port1.onmessage=Se,Ce=function(){ye.postMessage(null)}}else Ce=function(){D(Se,0)};function X(L,P){ie=D(function(){L(e.unstable_now())},P)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(L){switch(v){case 1:case 2:case 3:var P=3;break;default:P=v}var F=v;v=P;try{return L()}finally{v=F}},e.unstable_requestPaint=function(){_=!0},e.unstable_runWithPriority=function(L,P){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var F=v;v=L;try{return P()}finally{v=F}},e.unstable_scheduleCallback=function(L,P,F){var J=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?J+F:J):F=J,L){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=F+T,L={id:y++,callback:P,priorityLevel:L,startTime:F,expirationTime:T,sortIndex:-1},F>J?(L.sortIndex=F,t(p,L),n(h)===null&&L===n(p)&&(E?($(ie),ie=-1):E=!0,X(z,F-J))):(L.sortIndex=T,t(h,L),A||S||(A=!0,ee||(ee=!0,Ce()))),L},e.unstable_shouldYield=me,e.unstable_wrapCallback=function(L){var P=v;return function(){var F=v;v=P;try{return L.apply(this,arguments)}finally{v=F}}}}(Th)),Th}var $0;function AC(){return $0||($0=1,Ah.exports=xC()),Ah.exports}var Eh={exports:{}},It={};/**
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 B0;function TC(){if(B0)return It;B0=1;var e=mm();function t(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function u(h,p,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:y}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return It.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,It.createPortal=function(h,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return u(h,p,null,y)},It.flushSync=function(h){var p=c.T,y=s.p;try{if(c.T=null,s.p=2,h)return h()}finally{c.T=p,s.p=y,s.d.f()}},It.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,s.d.C(h,p))},It.prefetchDNS=function(h){typeof h=="string"&&s.d.D(h)},It.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,S=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?s.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:S}):y==="script"&&s.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:S,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},It.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);s.d.M(h,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&s.d.M(h)},It.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin);s.d.L(h,y,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},It.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=d(p.as,p.crossOrigin);s.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else s.d.m(h)},It.requestFormReset=function(h){s.d.r(h)},It.unstable_batchedUpdates=function(h,p){return h(p)},It.useFormState=function(h,p,y){return c.H.useFormState(h,p,y)},It.useFormStatus=function(){return c.H.useHostTransitionStatus()},It.version="19.1.0",It}var L0;function wx(){if(L0)return Eh.exports;L0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Eh.exports=TC(),Eh.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 V0;function EC(){if(V0)return $a;V0=1;var e=AC(),t=mm(),n=wx();function s(i){var r="https://react.dev/errors/"+i;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)r+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+i+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function u(i){var r=i,a=i;if(i.alternate)for(;r.return;)r=r.return;else{i=r;do r=i,(r.flags&4098)!==0&&(a=r.return),i=r.return;while(i)}return r.tag===3?a:null}function c(i){if(i.tag===13){var r=i.memoizedState;if(r===null&&(i=i.alternate,i!==null&&(r=i.memoizedState)),r!==null)return r.dehydrated}return null}function d(i){if(u(i)!==i)throw Error(s(188))}function h(i){var r=i.alternate;if(!r){if(r=u(i),r===null)throw Error(s(188));return r!==i?null:i}for(var a=i,l=r;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(l=f.return,l!==null){a=l;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return d(f),i;if(m===l)return d(f),r;m=m.sibling}throw Error(s(188))}if(a.return!==l.return)a=f,l=m;else{for(var b=!1,w=f.child;w;){if(w===a){b=!0,a=f,l=m;break}if(w===l){b=!0,l=f,a=m;break}w=w.sibling}if(!b){for(w=m.child;w;){if(w===a){b=!0,a=m,l=f;break}if(w===l){b=!0,l=m,a=f;break}w=w.sibling}if(!b)throw Error(s(189))}}if(a.alternate!==l)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?i:r}function p(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i;for(i=i.child;i!==null;){if(r=p(i),r!==null)return r;i=i.sibling}return null}var y=Object.assign,g=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),A=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),$=Symbol.for("react.consumer"),M=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),ee=Symbol.for("react.suspense_list"),ie=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),fe=Symbol.for("react.activity"),me=Symbol.for("react.memo_cache_sentinel"),Se=Symbol.iterator;function Ce(i){return i===null||typeof i!="object"?null:(i=Se&&i[Se]||i["@@iterator"],typeof i=="function"?i:null)}var we=Symbol.for("react.client.reference");function ye(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===we?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case A:return"Fragment";case _:return"Profiler";case E:return"StrictMode";case z:return"Suspense";case ee:return"SuspenseList";case fe:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case S:return"Portal";case M:return(i.displayName||"Context")+".Provider";case $:return(i._context.displayName||"Context")+".Consumer";case H:var r=i.render;return i=i.displayName,i||(i=r.displayName||r.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case ie:return r=i.displayName||null,r!==null?r:ye(i.type)||"Memo";case te:r=i._payload,i=i._init;try{return ye(i(r))}catch{}}return null}var X=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},J=[],T=-1;function U(i){return{current:i}}function G(i){0>T||(i.current=J[T],J[T]=null,T--)}function Q(i,r){T++,J[T]=i.current,i.current=r}var re=U(null),Ee=U(null),se=U(null),Ze=U(null);function Ne(i,r){switch(Q(se,r),Q(Ee,i),Q(re,null),r.nodeType){case 9:case 11:i=(i=r.documentElement)&&(i=i.namespaceURI)?e0(i):0;break;default:if(i=r.tagName,r=r.namespaceURI)r=e0(r),i=t0(r,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(re),Q(re,i)}function un(){G(re),G(Ee),G(se)}function Hi(i){i.memoizedState!==null&&Q(Ze,i);var r=re.current,a=t0(r,i.type);r!==a&&(Q(Ee,i),Q(re,a))}function ge(i){Ee.current===i&&(G(re),G(Ee)),Ze.current===i&&(G(Ze),Ma._currentValue=F)}var ke=Object.prototype.hasOwnProperty,xe=e.unstable_scheduleCallback,Ae=e.unstable_cancelCallback,_t=e.unstable_shouldYield,xt=e.unstable_requestPaint,ct=e.unstable_now,Ct=e.unstable_getCurrentPriorityLevel,Ge=e.unstable_ImmediatePriority,et=e.unstable_UserBlockingPriority,Os=e.unstable_NormalPriority,FR=e.unstable_LowPriority,Ly=e.unstable_IdlePriority,GR=e.log,YR=e.unstable_setDisableYieldValue,Lo=null,cn=null;function Fi(i){if(typeof GR=="function"&&YR(i),cn&&typeof cn.setStrictMode=="function")try{cn.setStrictMode(Lo,i)}catch{}}var fn=Math.clz32?Math.clz32:JR,XR=Math.log,ZR=Math.LN2;function JR(i){return i>>>=0,i===0?32:31-(XR(i)/ZR|0)|0}var wl=256,xl=4194304;function Ms(i){var r=i&42;if(r!==0)return r;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Al(i,r,a){var l=i.pendingLanes;if(l===0)return 0;var f=0,m=i.suspendedLanes,b=i.pingedLanes;i=i.warmLanes;var w=l&134217727;return w!==0?(l=w&~m,l!==0?f=Ms(l):(b&=w,b!==0?f=Ms(b):a||(a=w&~i,a!==0&&(f=Ms(a))))):(w=l&~m,w!==0?f=Ms(w):b!==0?f=Ms(b):a||(a=l&~i,a!==0&&(f=Ms(a)))),f===0?0:r!==0&&r!==f&&(r&m)===0&&(m=f&-f,a=r&-r,m>=a||m===32&&(a&4194048)!==0)?r:f}function Vo(i,r){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&r)===0}function QR(i,r){switch(i){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+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 Vy(){var i=wl;return wl<<=1,(wl&4194048)===0&&(wl=256),i}function jy(){var i=xl;return xl<<=1,(xl&62914560)===0&&(xl=4194304),i}function lf(i){for(var r=[],a=0;31>a;a++)r.push(i);return r}function jo(i,r){i.pendingLanes|=r,r!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function WR(i,r,a,l,f,m){var b=i.pendingLanes;i.pendingLanes=a,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=a,i.entangledLanes&=a,i.errorRecoveryDisabledLanes&=a,i.shellSuspendCounter=0;var w=i.entanglements,R=i.expirationTimes,N=i.hiddenUpdates;for(a=b&~a;0<a;){var q=31-fn(a),I=1<<q;w[q]=0,R[q]=-1;var B=N[q];if(B!==null)for(N[q]=null,q=0;q<B.length;q++){var j=B[q];j!==null&&(j.lane&=-536870913)}a&=~I}l!==0&&zy(i,l,0),m!==0&&f===0&&i.tag!==0&&(i.suspendedLanes|=m&~(b&~r))}function zy(i,r,a){i.pendingLanes|=r,i.suspendedLanes&=~r;var l=31-fn(r);i.entangledLanes|=r,i.entanglements[l]=i.entanglements[l]|1073741824|a&4194090}function Uy(i,r){var a=i.entangledLanes|=r;for(i=i.entanglements;a;){var l=31-fn(a),f=1<<l;f&r|i[l]&r&&(i[l]|=r),a&=~f}}function uf(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function cf(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function qy(){var i=P.p;return i!==0?i:(i=window.event,i===void 0?32:S0(i.type))}function eO(i,r){var a=P.p;try{return P.p=i,r()}finally{P.p=a}}var Gi=Math.random().toString(36).slice(2),Kt="__reactFiber$"+Gi,Wt="__reactProps$"+Gi,hr="__reactContainer$"+Gi,ff="__reactEvents$"+Gi,tO="__reactListeners$"+Gi,nO="__reactHandles$"+Gi,Ky="__reactResources$"+Gi,zo="__reactMarker$"+Gi;function df(i){delete i[Kt],delete i[Wt],delete i[ff],delete i[tO],delete i[nO]}function pr(i){var r=i[Kt];if(r)return r;for(var a=i.parentNode;a;){if(r=a[hr]||a[Kt]){if(a=r.alternate,r.child!==null||a!==null&&a.child!==null)for(i=r0(i);i!==null;){if(a=i[Kt])return a;i=r0(i)}return r}i=a,a=i.parentNode}return null}function mr(i){if(i=i[Kt]||i[hr]){var r=i.tag;if(r===5||r===6||r===13||r===26||r===27||r===3)return i}return null}function Uo(i){var r=i.tag;if(r===5||r===26||r===27||r===6)return i.stateNode;throw Error(s(33))}function yr(i){var r=i[Ky];return r||(r=i[Ky]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function kt(i){i[zo]=!0}var Py=new Set,Iy={};function _s(i,r){gr(i,r),gr(i+"Capture",r)}function gr(i,r){for(Iy[i]=r,i=0;i<r.length;i++)Py.add(r[i])}var iO=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]*$"),Hy={},Fy={};function sO(i){return ke.call(Fy,i)?!0:ke.call(Hy,i)?!1:iO.test(i)?Fy[i]=!0:(Hy[i]=!0,!1)}function Tl(i,r,a){if(sO(r))if(a===null)i.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":i.removeAttribute(r);return;case"boolean":var l=r.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){i.removeAttribute(r);return}}i.setAttribute(r,""+a)}}function El(i,r,a){if(a===null)i.removeAttribute(r);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(r);return}i.setAttribute(r,""+a)}}function yi(i,r,a,l){if(l===null)i.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(a);return}i.setAttributeNS(r,a,""+l)}}var hf,Gy;function br(i){if(hf===void 0)try{throw Error()}catch(a){var r=a.stack.trim().match(/\n( *(at )?)/);hf=r&&r[1]||"",Gy=-1<a.stack.indexOf(`
55
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
56
+ `+hf+i+Gy}var pf=!1;function mf(i,r){if(!i||pf)return"";pf=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(r){var I=function(){throw Error()};if(Object.defineProperty(I.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(I,[])}catch(j){var B=j}Reflect.construct(i,[],I)}else{try{I.call()}catch(j){B=j}i.call(I.prototype)}}else{try{throw Error()}catch(j){B=j}(I=i())&&typeof I.catch=="function"&&I.catch(function(){})}}catch(j){if(j&&B&&typeof j.stack=="string")return[j.stack,B.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=l.DetermineComponentFrameRoot(),b=m[0],w=m[1];if(b&&w){var R=b.split(`
57
+ `),N=w.split(`
58
+ `);for(f=l=0;l<R.length&&!R[l].includes("DetermineComponentFrameRoot");)l++;for(;f<N.length&&!N[f].includes("DetermineComponentFrameRoot");)f++;if(l===R.length||f===N.length)for(l=R.length-1,f=N.length-1;1<=l&&0<=f&&R[l]!==N[f];)f--;for(;1<=l&&0<=f;l--,f--)if(R[l]!==N[f]){if(l!==1||f!==1)do if(l--,f--,0>f||R[l]!==N[f]){var q=`
59
+ `+R[l].replace(" at new "," at ");return i.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",i.displayName)),q}while(1<=l&&0<=f);break}}}finally{pf=!1,Error.prepareStackTrace=a}return(a=i?i.displayName||i.name:"")?br(a):""}function rO(i){switch(i.tag){case 26:case 27:case 5:return br(i.type);case 16:return br("Lazy");case 13:return br("Suspense");case 19:return br("SuspenseList");case 0:case 15:return mf(i.type,!1);case 11:return mf(i.type.render,!1);case 1:return mf(i.type,!0);case 31:return br("Activity");default:return""}}function Yy(i){try{var r="";do r+=rO(i),i=i.return;while(i);return r}catch(a){return`
60
+ Error generating stack: `+a.message+`
61
+ `+a.stack}}function An(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Xy(i){var r=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function oO(i){var r=Xy(i)?"checked":"value",a=Object.getOwnPropertyDescriptor(i.constructor.prototype,r),l=""+i[r];if(!i.hasOwnProperty(r)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,m=a.set;return Object.defineProperty(i,r,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(i,r,{enumerable:a.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){i._valueTracker=null,delete i[r]}}}}function Rl(i){i._valueTracker||(i._valueTracker=oO(i))}function Zy(i){if(!i)return!1;var r=i._valueTracker;if(!r)return!0;var a=r.getValue(),l="";return i&&(l=Xy(i)?i.checked?"true":"false":i.value),i=l,i!==a?(r.setValue(i),!0):!1}function Ol(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var aO=/[\n"\\]/g;function Tn(i){return i.replace(aO,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function yf(i,r,a,l,f,m,b,w){i.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?i.type=b:i.removeAttribute("type"),r!=null?b==="number"?(r===0&&i.value===""||i.value!=r)&&(i.value=""+An(r)):i.value!==""+An(r)&&(i.value=""+An(r)):b!=="submit"&&b!=="reset"||i.removeAttribute("value"),r!=null?gf(i,b,An(r)):a!=null?gf(i,b,An(a)):l!=null&&i.removeAttribute("value"),f==null&&m!=null&&(i.defaultChecked=!!m),f!=null&&(i.checked=f&&typeof f!="function"&&typeof f!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?i.name=""+An(w):i.removeAttribute("name")}function Jy(i,r,a,l,f,m,b,w){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(i.type=m),r!=null||a!=null){if(!(m!=="submit"&&m!=="reset"||r!=null))return;a=a!=null?""+An(a):"",r=r!=null?""+An(r):a,w||r===i.value||(i.value=r),i.defaultValue=r}l=l??f,l=typeof l!="function"&&typeof l!="symbol"&&!!l,i.checked=w?i.checked:!!l,i.defaultChecked=!!l,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(i.name=b)}function gf(i,r,a){r==="number"&&Ol(i.ownerDocument)===i||i.defaultValue===""+a||(i.defaultValue=""+a)}function vr(i,r,a,l){if(i=i.options,r){r={};for(var f=0;f<a.length;f++)r["$"+a[f]]=!0;for(a=0;a<i.length;a++)f=r.hasOwnProperty("$"+i[a].value),i[a].selected!==f&&(i[a].selected=f),f&&l&&(i[a].defaultSelected=!0)}else{for(a=""+An(a),r=null,f=0;f<i.length;f++){if(i[f].value===a){i[f].selected=!0,l&&(i[f].defaultSelected=!0);return}r!==null||i[f].disabled||(r=i[f])}r!==null&&(r.selected=!0)}}function Qy(i,r,a){if(r!=null&&(r=""+An(r),r!==i.value&&(i.value=r),a==null)){i.defaultValue!==r&&(i.defaultValue=r);return}i.defaultValue=a!=null?""+An(a):""}function Wy(i,r,a,l){if(r==null){if(l!=null){if(a!=null)throw Error(s(92));if(X(l)){if(1<l.length)throw Error(s(93));l=l[0]}a=l}a==null&&(a=""),r=a}a=An(r),i.defaultValue=a,l=i.textContent,l===a&&l!==""&&l!==null&&(i.value=l)}function Sr(i,r){if(r){var a=i.firstChild;if(a&&a===i.lastChild&&a.nodeType===3){a.nodeValue=r;return}}i.textContent=r}var lO=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 eg(i,r,a){var l=r.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?i.setProperty(r,""):r==="float"?i.cssFloat="":i[r]="":l?i.setProperty(r,a):typeof a!="number"||a===0||lO.has(r)?r==="float"?i.cssFloat=a:i[r]=(""+a).trim():i[r]=a+"px"}function tg(i,r,a){if(r!=null&&typeof r!="object")throw Error(s(62));if(i=i.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||r!=null&&r.hasOwnProperty(l)||(l.indexOf("--")===0?i.setProperty(l,""):l==="float"?i.cssFloat="":i[l]="");for(var f in r)l=r[f],r.hasOwnProperty(f)&&a[f]!==l&&eg(i,f,l)}else for(var m in r)r.hasOwnProperty(m)&&eg(i,m,r[m])}function bf(i){if(i.indexOf("-")===-1)return!1;switch(i){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 uO=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"]]),cO=/^[\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 Ml(i){return cO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}var vf=null;function Sf(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var wr=null,xr=null;function ng(i){var r=mr(i);if(r&&(i=r.stateNode)){var a=i[Wt]||null;e:switch(i=r.stateNode,r.type){case"input":if(yf(i,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),r=a.name,a.type==="radio"&&r!=null){for(a=i;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Tn(""+r)+'"][type="radio"]'),r=0;r<a.length;r++){var l=a[r];if(l!==i&&l.form===i.form){var f=l[Wt]||null;if(!f)throw Error(s(90));yf(l,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(r=0;r<a.length;r++)l=a[r],l.form===i.form&&Zy(l)}break e;case"textarea":Qy(i,a.value,a.defaultValue);break e;case"select":r=a.value,r!=null&&vr(i,!!a.multiple,r,!1)}}}var wf=!1;function ig(i,r,a){if(wf)return i(r,a);wf=!0;try{var l=i(r);return l}finally{if(wf=!1,(wr!==null||xr!==null)&&(hu(),wr&&(r=wr,i=xr,xr=wr=null,ng(r),i)))for(r=0;r<i.length;r++)ng(i[r])}}function qo(i,r){var a=i.stateNode;if(a===null)return null;var l=a[Wt]||null;if(l===null)return null;a=l[r];e:switch(r){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)||(i=i.type,l=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!l;break e;default:i=!1}if(i)return null;if(a&&typeof a!="function")throw Error(s(231,r,typeof a));return a}var gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xf=!1;if(gi)try{var Ko={};Object.defineProperty(Ko,"passive",{get:function(){xf=!0}}),window.addEventListener("test",Ko,Ko),window.removeEventListener("test",Ko,Ko)}catch{xf=!1}var Yi=null,Af=null,_l=null;function sg(){if(_l)return _l;var i,r=Af,a=r.length,l,f="value"in Yi?Yi.value:Yi.textContent,m=f.length;for(i=0;i<a&&r[i]===f[i];i++);var b=a-i;for(l=1;l<=b&&r[a-l]===f[m-l];l++);return _l=f.slice(i,1<l?1-l:void 0)}function Cl(i){var r=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&r===13&&(i=13)):i=r,i===10&&(i=13),32<=i||i===13?i:0}function kl(){return!0}function rg(){return!1}function en(i){function r(a,l,f,m,b){this._reactName=a,this._targetInst=f,this.type=l,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var w in i)i.hasOwnProperty(w)&&(a=i[w],this[w]=a?a(m):m[w]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?kl:rg,this.isPropagationStopped=rg,this}return y(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=kl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=kl)},persist:function(){},isPersistent:kl}),r}var Cs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Dl=en(Cs),Po=y({},Cs,{view:0,detail:0}),fO=en(Po),Tf,Ef,Io,Nl=y({},Po,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Of,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==Io&&(Io&&i.type==="mousemove"?(Tf=i.screenX-Io.screenX,Ef=i.screenY-Io.screenY):Ef=Tf=0,Io=i),Tf)},movementY:function(i){return"movementY"in i?i.movementY:Ef}}),og=en(Nl),dO=y({},Nl,{dataTransfer:0}),hO=en(dO),pO=y({},Po,{relatedTarget:0}),Rf=en(pO),mO=y({},Cs,{animationName:0,elapsedTime:0,pseudoElement:0}),yO=en(mO),gO=y({},Cs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),bO=en(gO),vO=y({},Cs,{data:0}),ag=en(vO),SO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wO={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"},xO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function AO(i){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(i):(i=xO[i])?!!r[i]:!1}function Of(){return AO}var TO=y({},Po,{key:function(i){if(i.key){var r=SO[i.key]||i.key;if(r!=="Unidentified")return r}return i.type==="keypress"?(i=Cl(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?wO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Of,charCode:function(i){return i.type==="keypress"?Cl(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Cl(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),EO=en(TO),RO=y({},Nl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),lg=en(RO),OO=y({},Po,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Of}),MO=en(OO),_O=y({},Cs,{propertyName:0,elapsedTime:0,pseudoElement:0}),CO=en(_O),kO=y({},Nl,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),DO=en(kO),NO=y({},Cs,{newState:0,oldState:0}),$O=en(NO),BO=[9,13,27,32],Mf=gi&&"CompositionEvent"in window,Ho=null;gi&&"documentMode"in document&&(Ho=document.documentMode);var LO=gi&&"TextEvent"in window&&!Ho,ug=gi&&(!Mf||Ho&&8<Ho&&11>=Ho),cg=" ",fg=!1;function dg(i,r){switch(i){case"keyup":return BO.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hg(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ar=!1;function VO(i,r){switch(i){case"compositionend":return hg(r);case"keypress":return r.which!==32?null:(fg=!0,cg);case"textInput":return i=r.data,i===cg&&fg?null:i;default:return null}}function jO(i,r){if(Ar)return i==="compositionend"||!Mf&&dg(i,r)?(i=sg(),_l=Af=Yi=null,Ar=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return ug&&r.locale!=="ko"?null:r.data;default:return null}}var zO={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 pg(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r==="input"?!!zO[i.type]:r==="textarea"}function mg(i,r,a,l){wr?xr?xr.push(l):xr=[l]:wr=l,r=vu(r,"onChange"),0<r.length&&(a=new Dl("onChange","change",null,a,l),i.push({event:a,listeners:r}))}var Fo=null,Go=null;function UO(i){Xv(i,0)}function $l(i){var r=Uo(i);if(Zy(r))return i}function yg(i,r){if(i==="change")return r}var gg=!1;if(gi){var _f;if(gi){var Cf="oninput"in document;if(!Cf){var bg=document.createElement("div");bg.setAttribute("oninput","return;"),Cf=typeof bg.oninput=="function"}_f=Cf}else _f=!1;gg=_f&&(!document.documentMode||9<document.documentMode)}function vg(){Fo&&(Fo.detachEvent("onpropertychange",Sg),Go=Fo=null)}function Sg(i){if(i.propertyName==="value"&&$l(Go)){var r=[];mg(r,Go,i,Sf(i)),ig(UO,r)}}function qO(i,r,a){i==="focusin"?(vg(),Fo=r,Go=a,Fo.attachEvent("onpropertychange",Sg)):i==="focusout"&&vg()}function KO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return $l(Go)}function PO(i,r){if(i==="click")return $l(r)}function IO(i,r){if(i==="input"||i==="change")return $l(r)}function HO(i,r){return i===r&&(i!==0||1/i===1/r)||i!==i&&r!==r}var dn=typeof Object.is=="function"?Object.is:HO;function Yo(i,r){if(dn(i,r))return!0;if(typeof i!="object"||i===null||typeof r!="object"||r===null)return!1;var a=Object.keys(i),l=Object.keys(r);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var f=a[l];if(!ke.call(r,f)||!dn(i[f],r[f]))return!1}return!0}function wg(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function xg(i,r){var a=wg(i);i=0;for(var l;a;){if(a.nodeType===3){if(l=i+a.textContent.length,i<=r&&l>=r)return{node:a,offset:r-i};i=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=wg(a)}}function Ag(i,r){return i&&r?i===r?!0:i&&i.nodeType===3?!1:r&&r.nodeType===3?Ag(i,r.parentNode):"contains"in i?i.contains(r):i.compareDocumentPosition?!!(i.compareDocumentPosition(r)&16):!1:!1}function Tg(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var r=Ol(i.document);r instanceof i.HTMLIFrameElement;){try{var a=typeof r.contentWindow.location.href=="string"}catch{a=!1}if(a)i=r.contentWindow;else break;r=Ol(i.document)}return r}function kf(i){var r=i&&i.nodeName&&i.nodeName.toLowerCase();return r&&(r==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||r==="textarea"||i.contentEditable==="true")}var FO=gi&&"documentMode"in document&&11>=document.documentMode,Tr=null,Df=null,Xo=null,Nf=!1;function Eg(i,r,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Nf||Tr==null||Tr!==Ol(l)||(l=Tr,"selectionStart"in l&&kf(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}),Xo&&Yo(Xo,l)||(Xo=l,l=vu(Df,"onSelect"),0<l.length&&(r=new Dl("onSelect","select",null,r,a),i.push({event:r,listeners:l}),r.target=Tr)))}function ks(i,r){var a={};return a[i.toLowerCase()]=r.toLowerCase(),a["Webkit"+i]="webkit"+r,a["Moz"+i]="moz"+r,a}var Er={animationend:ks("Animation","AnimationEnd"),animationiteration:ks("Animation","AnimationIteration"),animationstart:ks("Animation","AnimationStart"),transitionrun:ks("Transition","TransitionRun"),transitionstart:ks("Transition","TransitionStart"),transitioncancel:ks("Transition","TransitionCancel"),transitionend:ks("Transition","TransitionEnd")},$f={},Rg={};gi&&(Rg=document.createElement("div").style,"AnimationEvent"in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),"TransitionEvent"in window||delete Er.transitionend.transition);function Ds(i){if($f[i])return $f[i];if(!Er[i])return i;var r=Er[i],a;for(a in r)if(r.hasOwnProperty(a)&&a in Rg)return $f[i]=r[a];return i}var Og=Ds("animationend"),Mg=Ds("animationiteration"),_g=Ds("animationstart"),GO=Ds("transitionrun"),YO=Ds("transitionstart"),XO=Ds("transitioncancel"),Cg=Ds("transitionend"),kg=new Map,Bf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Bf.push("scrollEnd");function zn(i,r){kg.set(i,r),_s(r,[i])}var Dg=new WeakMap;function En(i,r){if(typeof i=="object"&&i!==null){var a=Dg.get(i);return a!==void 0?a:(r={value:i,source:r,stack:Yy(r)},Dg.set(i,r),r)}return{value:i,source:r,stack:Yy(r)}}var Rn=[],Rr=0,Lf=0;function Bl(){for(var i=Rr,r=Lf=Rr=0;r<i;){var a=Rn[r];Rn[r++]=null;var l=Rn[r];Rn[r++]=null;var f=Rn[r];Rn[r++]=null;var m=Rn[r];if(Rn[r++]=null,l!==null&&f!==null){var b=l.pending;b===null?f.next=f:(f.next=b.next,b.next=f),l.pending=f}m!==0&&Ng(a,f,m)}}function Ll(i,r,a,l){Rn[Rr++]=i,Rn[Rr++]=r,Rn[Rr++]=a,Rn[Rr++]=l,Lf|=l,i.lanes|=l,i=i.alternate,i!==null&&(i.lanes|=l)}function Vf(i,r,a,l){return Ll(i,r,a,l),Vl(i)}function Or(i,r){return Ll(i,null,null,r),Vl(i)}function Ng(i,r,a){i.lanes|=a;var l=i.alternate;l!==null&&(l.lanes|=a);for(var f=!1,m=i.return;m!==null;)m.childLanes|=a,l=m.alternate,l!==null&&(l.childLanes|=a),m.tag===22&&(i=m.stateNode,i===null||i._visibility&1||(f=!0)),i=m,m=m.return;return i.tag===3?(m=i.stateNode,f&&r!==null&&(f=31-fn(a),i=m.hiddenUpdates,l=i[f],l===null?i[f]=[r]:l.push(r),r.lane=a|536870912),m):null}function Vl(i){if(50<Sa)throw Sa=0,Pd=null,Error(s(185));for(var r=i.return;r!==null;)i=r,r=i.return;return i.tag===3?i.stateNode:null}var Mr={};function ZO(i,r,a,l){this.tag=i,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=r,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 hn(i,r,a,l){return new ZO(i,r,a,l)}function jf(i){return i=i.prototype,!(!i||!i.isReactComponent)}function bi(i,r){var a=i.alternate;return a===null?(a=hn(i.tag,r,i.key,i.mode),a.elementType=i.elementType,a.type=i.type,a.stateNode=i.stateNode,a.alternate=i,i.alternate=a):(a.pendingProps=r,a.type=i.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=i.flags&65011712,a.childLanes=i.childLanes,a.lanes=i.lanes,a.child=i.child,a.memoizedProps=i.memoizedProps,a.memoizedState=i.memoizedState,a.updateQueue=i.updateQueue,r=i.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},a.sibling=i.sibling,a.index=i.index,a.ref=i.ref,a.refCleanup=i.refCleanup,a}function $g(i,r){i.flags&=65011714;var a=i.alternate;return a===null?(i.childLanes=0,i.lanes=r,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,r=a.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),i}function jl(i,r,a,l,f,m){var b=0;if(l=i,typeof i=="function")jf(i)&&(b=1);else if(typeof i=="string")b=QM(i,a,re.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case fe:return i=hn(31,a,r,f),i.elementType=fe,i.lanes=m,i;case A:return Ns(a.children,f,m,r);case E:b=8,f|=24;break;case _:return i=hn(12,a,r,f|2),i.elementType=_,i.lanes=m,i;case z:return i=hn(13,a,r,f),i.elementType=z,i.lanes=m,i;case ee:return i=hn(19,a,r,f),i.elementType=ee,i.lanes=m,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case D:case M:b=10;break e;case $:b=9;break e;case H:b=11;break e;case ie:b=14;break e;case te:b=16,l=null;break e}b=29,a=Error(s(130,i===null?"null":typeof i,"")),l=null}return r=hn(b,a,r,f),r.elementType=i,r.type=l,r.lanes=m,r}function Ns(i,r,a,l){return i=hn(7,i,l,r),i.lanes=a,i}function zf(i,r,a){return i=hn(6,i,null,r),i.lanes=a,i}function Uf(i,r,a){return r=hn(4,i.children!==null?i.children:[],i.key,r),r.lanes=a,r.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},r}var _r=[],Cr=0,zl=null,Ul=0,On=[],Mn=0,$s=null,vi=1,Si="";function Bs(i,r){_r[Cr++]=Ul,_r[Cr++]=zl,zl=i,Ul=r}function Bg(i,r,a){On[Mn++]=vi,On[Mn++]=Si,On[Mn++]=$s,$s=i;var l=vi;i=Si;var f=32-fn(l)-1;l&=~(1<<f),a+=1;var m=32-fn(r)+f;if(30<m){var b=f-f%5;m=(l&(1<<b)-1).toString(32),l>>=b,f-=b,vi=1<<32-fn(r)+f|a<<f|l,Si=m+i}else vi=1<<m|a<<f|l,Si=i}function qf(i){i.return!==null&&(Bs(i,1),Bg(i,1,0))}function Kf(i){for(;i===zl;)zl=_r[--Cr],_r[Cr]=null,Ul=_r[--Cr],_r[Cr]=null;for(;i===$s;)$s=On[--Mn],On[Mn]=null,Si=On[--Mn],On[Mn]=null,vi=On[--Mn],On[Mn]=null}var Xt=null,rt=null,Le=!1,Ls=null,Yn=!1,Pf=Error(s(519));function Vs(i){var r=Error(s(418,""));throw Qo(En(r,i)),Pf}function Lg(i){var r=i.stateNode,a=i.type,l=i.memoizedProps;switch(r[Kt]=i,r[Wt]=l,a){case"dialog":Me("cancel",r),Me("close",r);break;case"iframe":case"object":case"embed":Me("load",r);break;case"video":case"audio":for(a=0;a<xa.length;a++)Me(xa[a],r);break;case"source":Me("error",r);break;case"img":case"image":case"link":Me("error",r),Me("load",r);break;case"details":Me("toggle",r);break;case"input":Me("invalid",r),Jy(r,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0),Rl(r);break;case"select":Me("invalid",r);break;case"textarea":Me("invalid",r),Wy(r,l.value,l.defaultValue,l.children),Rl(r)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||r.textContent===""+a||l.suppressHydrationWarning===!0||Wv(r.textContent,a)?(l.popover!=null&&(Me("beforetoggle",r),Me("toggle",r)),l.onScroll!=null&&Me("scroll",r),l.onScrollEnd!=null&&Me("scrollend",r),l.onClick!=null&&(r.onclick=Su),r=!0):r=!1,r||Vs(i)}function Vg(i){for(Xt=i.return;Xt;)switch(Xt.tag){case 5:case 13:Yn=!1;return;case 27:case 3:Yn=!0;return;default:Xt=Xt.return}}function Zo(i){if(i!==Xt)return!1;if(!Le)return Vg(i),Le=!0,!1;var r=i.tag,a;if((a=r!==3&&r!==27)&&((a=r===5)&&(a=i.type,a=!(a!=="form"&&a!=="button")||rh(i.type,i.memoizedProps)),a=!a),a&&rt&&Vs(i),Vg(i),r===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(s(317));e:{for(i=i.nextSibling,r=0;i;){if(i.nodeType===8)if(a=i.data,a==="/$"){if(r===0){rt=qn(i.nextSibling);break e}r--}else a!=="$"&&a!=="$!"&&a!=="$?"||r++;i=i.nextSibling}rt=null}}else r===27?(r=rt,cs(i.type)?(i=uh,uh=null,rt=i):rt=r):rt=Xt?qn(i.stateNode.nextSibling):null;return!0}function Jo(){rt=Xt=null,Le=!1}function jg(){var i=Ls;return i!==null&&(sn===null?sn=i:sn.push.apply(sn,i),Ls=null),i}function Qo(i){Ls===null?Ls=[i]:Ls.push(i)}var If=U(null),js=null,wi=null;function Xi(i,r,a){Q(If,r._currentValue),r._currentValue=a}function xi(i){i._currentValue=If.current,G(If)}function Hf(i,r,a){for(;i!==null;){var l=i.alternate;if((i.childLanes&r)!==r?(i.childLanes|=r,l!==null&&(l.childLanes|=r)):l!==null&&(l.childLanes&r)!==r&&(l.childLanes|=r),i===a)break;i=i.return}}function Ff(i,r,a,l){var f=i.child;for(f!==null&&(f.return=i);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var w=m;m=f;for(var R=0;R<r.length;R++)if(w.context===r[R]){m.lanes|=a,w=m.alternate,w!==null&&(w.lanes|=a),Hf(m.return,a,i),l||(b=null);break e}m=w.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(s(341));b.lanes|=a,m=b.alternate,m!==null&&(m.lanes|=a),Hf(b,a,i),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===i){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Wo(i,r,a,l){i=null;for(var f=r,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(s(387));if(b=b.memoizedProps,b!==null){var w=f.type;dn(f.pendingProps.value,b.value)||(i!==null?i.push(w):i=[w])}}else if(f===Ze.current){if(b=f.alternate,b===null)throw Error(s(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(i!==null?i.push(Ma):i=[Ma])}f=f.return}i!==null&&Ff(r,i,a,l),r.flags|=262144}function ql(i){for(i=i.firstContext;i!==null;){if(!dn(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function zs(i){js=i,wi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Pt(i){return zg(js,i)}function Kl(i,r){return js===null&&zs(i),zg(i,r)}function zg(i,r){var a=r._currentValue;if(r={context:r,memoizedValue:a,next:null},wi===null){if(i===null)throw Error(s(308));wi=r,i.dependencies={lanes:0,firstContext:r},i.flags|=524288}else wi=wi.next=r;return a}var JO=typeof AbortController<"u"?AbortController:function(){var i=[],r=this.signal={aborted:!1,addEventListener:function(a,l){i.push(l)}};this.abort=function(){r.aborted=!0,i.forEach(function(a){return a()})}},QO=e.unstable_scheduleCallback,WO=e.unstable_NormalPriority,At={$$typeof:M,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gf(){return{controller:new JO,data:new Map,refCount:0}}function ea(i){i.refCount--,i.refCount===0&&QO(WO,function(){i.controller.abort()})}var ta=null,Yf=0,kr=0,Dr=null;function eM(i,r){if(ta===null){var a=ta=[];Yf=0,kr=Zd(),Dr={status:"pending",value:void 0,then:function(l){a.push(l)}}}return Yf++,r.then(Ug,Ug),r}function Ug(){if(--Yf===0&&ta!==null){Dr!==null&&(Dr.status="fulfilled");var i=ta;ta=null,kr=0,Dr=null;for(var r=0;r<i.length;r++)(0,i[r])()}}function tM(i,r){var a=[],l={status:"pending",value:null,reason:null,then:function(f){a.push(f)}};return i.then(function(){l.status="fulfilled",l.value=r;for(var f=0;f<a.length;f++)(0,a[f])(r)},function(f){for(l.status="rejected",l.reason=f,f=0;f<a.length;f++)(0,a[f])(void 0)}),l}var qg=L.S;L.S=function(i,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&eM(i,r),qg!==null&&qg(i,r)};var Us=U(null);function Xf(){var i=Us.current;return i!==null?i:Ye.pooledCache}function Pl(i,r){r===null?Q(Us,Us.current):Q(Us,r.pool)}function Kg(){var i=Xf();return i===null?null:{parent:At._currentValue,pool:i}}var na=Error(s(460)),Pg=Error(s(474)),Il=Error(s(542)),Zf={then:function(){}};function Ig(i){return i=i.status,i==="fulfilled"||i==="rejected"}function Hl(){}function Hg(i,r,a){switch(a=i[a],a===void 0?i.push(r):a!==r&&(r.then(Hl,Hl),r=a),r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Gg(i),i;default:if(typeof r.status=="string")r.then(Hl,Hl);else{if(i=Ye,i!==null&&100<i.shellSuspendCounter)throw Error(s(482));i=r,i.status="pending",i.then(function(l){if(r.status==="pending"){var f=r;f.status="fulfilled",f.value=l}},function(l){if(r.status==="pending"){var f=r;f.status="rejected",f.reason=l}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw i=r.reason,Gg(i),i}throw ia=r,na}}var ia=null;function Fg(){if(ia===null)throw Error(s(459));var i=ia;return ia=null,i}function Gg(i){if(i===na||i===Il)throw Error(s(483))}var Zi=!1;function Jf(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Qf(i,r){i=i.updateQueue,r.updateQueue===i&&(r.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ji(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Qi(i,r,a){var l=i.updateQueue;if(l===null)return null;if(l=l.shared,(je&2)!==0){var f=l.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),l.pending=r,r=Vl(i),Ng(i,null,a),r}return Ll(i,l,r,a),Vl(i)}function sa(i,r,a){if(r=r.updateQueue,r!==null&&(r=r.shared,(a&4194048)!==0)){var l=r.lanes;l&=i.pendingLanes,a|=l,r.lanes=a,Uy(i,a)}}function Wf(i,r){var a=i.updateQueue,l=i.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var b={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,a=a.next}while(a!==null);m===null?f=m=r:m=m.next=r}else f=m=r;a={baseState:l.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:l.shared,callbacks:l.callbacks},i.updateQueue=a;return}i=a.lastBaseUpdate,i===null?a.firstBaseUpdate=r:i.next=r,a.lastBaseUpdate=r}var ed=!1;function ra(){if(ed){var i=Dr;if(i!==null)throw i}}function oa(i,r,a,l){ed=!1;var f=i.updateQueue;Zi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,w=f.shared.pending;if(w!==null){f.shared.pending=null;var R=w,N=R.next;R.next=null,b===null?m=N:b.next=N,b=R;var q=i.alternate;q!==null&&(q=q.updateQueue,w=q.lastBaseUpdate,w!==b&&(w===null?q.firstBaseUpdate=N:w.next=N,q.lastBaseUpdate=R))}if(m!==null){var I=f.baseState;b=0,q=N=R=null,w=m;do{var B=w.lane&-536870913,j=B!==w.lane;if(j?(De&B)===B:(l&B)===B){B!==0&&B===kr&&(ed=!0),q!==null&&(q=q.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var de=i,le=w;B=r;var Ke=a;switch(le.tag){case 1:if(de=le.payload,typeof de=="function"){I=de.call(Ke,I,B);break e}I=de;break e;case 3:de.flags=de.flags&-65537|128;case 0:if(de=le.payload,B=typeof de=="function"?de.call(Ke,I,B):de,B==null)break e;I=y({},I,B);break e;case 2:Zi=!0}}B=w.callback,B!==null&&(i.flags|=64,j&&(i.flags|=8192),j=f.callbacks,j===null?f.callbacks=[B]:j.push(B))}else j={lane:B,tag:w.tag,payload:w.payload,callback:w.callback,next:null},q===null?(N=q=j,R=I):q=q.next=j,b|=B;if(w=w.next,w===null){if(w=f.shared.pending,w===null)break;j=w,w=j.next,j.next=null,f.lastBaseUpdate=j,f.shared.pending=null}}while(!0);q===null&&(R=I),f.baseState=R,f.firstBaseUpdate=N,f.lastBaseUpdate=q,m===null&&(f.shared.lanes=0),os|=b,i.lanes=b,i.memoizedState=I}}function Yg(i,r){if(typeof i!="function")throw Error(s(191,i));i.call(r)}function Xg(i,r){var a=i.callbacks;if(a!==null)for(i.callbacks=null,i=0;i<a.length;i++)Yg(a[i],r)}var Nr=U(null),Fl=U(0);function Zg(i,r){i=_i,Q(Fl,i),Q(Nr,r),_i=i|r.baseLanes}function td(){Q(Fl,_i),Q(Nr,Nr.current)}function nd(){_i=Fl.current,G(Nr),G(Fl)}var Wi=0,Te=null,Ue=null,mt=null,Gl=!1,$r=!1,qs=!1,Yl=0,aa=0,Br=null,nM=0;function ft(){throw Error(s(321))}function id(i,r){if(r===null)return!1;for(var a=0;a<r.length&&a<i.length;a++)if(!dn(i[a],r[a]))return!1;return!0}function sd(i,r,a,l,f,m){return Wi=m,Te=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,L.H=i===null||i.memoizedState===null?Nb:$b,qs=!1,m=a(l,f),qs=!1,$r&&(m=Qg(r,a,l,f)),Jg(i),m}function Jg(i){L.H=eu;var r=Ue!==null&&Ue.next!==null;if(Wi=0,mt=Ue=Te=null,Gl=!1,aa=0,Br=null,r)throw Error(s(300));i===null||Dt||(i=i.dependencies,i!==null&&ql(i)&&(Dt=!0))}function Qg(i,r,a,l){Te=i;var f=0;do{if($r&&(Br=null),aa=0,$r=!1,25<=f)throw Error(s(301));if(f+=1,mt=Ue=null,i.updateQueue!=null){var m=i.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}L.H=uM,m=r(a,l)}while($r);return m}function iM(){var i=L.H,r=i.useState()[0];return r=typeof r.then=="function"?la(r):r,i=i.useState()[0],(Ue!==null?Ue.memoizedState:null)!==i&&(Te.flags|=1024),r}function rd(){var i=Yl!==0;return Yl=0,i}function od(i,r,a){r.updateQueue=i.updateQueue,r.flags&=-2053,i.lanes&=~a}function ad(i){if(Gl){for(i=i.memoizedState;i!==null;){var r=i.queue;r!==null&&(r.pending=null),i=i.next}Gl=!1}Wi=0,mt=Ue=Te=null,$r=!1,aa=Yl=0,Br=null}function tn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Te.memoizedState=mt=i:mt=mt.next=i,mt}function yt(){if(Ue===null){var i=Te.alternate;i=i!==null?i.memoizedState:null}else i=Ue.next;var r=mt===null?Te.memoizedState:mt.next;if(r!==null)mt=r,Ue=i;else{if(i===null)throw Te.alternate===null?Error(s(467)):Error(s(310));Ue=i,i={memoizedState:Ue.memoizedState,baseState:Ue.baseState,baseQueue:Ue.baseQueue,queue:Ue.queue,next:null},mt===null?Te.memoizedState=mt=i:mt=mt.next=i}return mt}function ld(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function la(i){var r=aa;return aa+=1,Br===null&&(Br=[]),i=Hg(Br,i,r),r=Te,(mt===null?r.memoizedState:mt.next)===null&&(r=r.alternate,L.H=r===null||r.memoizedState===null?Nb:$b),i}function Xl(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return la(i);if(i.$$typeof===M)return Pt(i)}throw Error(s(438,String(i)))}function ud(i){var r=null,a=Te.updateQueue;if(a!==null&&(r=a.memoCache),r==null){var l=Te.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(r={data:l.data.map(function(f){return f.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),a===null&&(a=ld(),Te.updateQueue=a),a.memoCache=r,a=r.data[r.index],a===void 0)for(a=r.data[r.index]=Array(i),l=0;l<i;l++)a[l]=me;return r.index++,a}function Ai(i,r){return typeof r=="function"?r(i):r}function Zl(i){var r=yt();return cd(r,Ue,i)}function cd(i,r,a){var l=i.queue;if(l===null)throw Error(s(311));l.lastRenderedReducer=a;var f=i.baseQueue,m=l.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}r.baseQueue=f=m,l.pending=null}if(m=i.baseState,f===null)i.memoizedState=m;else{r=f.next;var w=b=null,R=null,N=r,q=!1;do{var I=N.lane&-536870913;if(I!==N.lane?(De&I)===I:(Wi&I)===I){var B=N.revertLane;if(B===0)R!==null&&(R=R.next={lane:0,revertLane:0,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null}),I===kr&&(q=!0);else if((Wi&B)===B){N=N.next,B===kr&&(q=!0);continue}else I={lane:0,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},R===null?(w=R=I,b=m):R=R.next=I,Te.lanes|=B,os|=B;I=N.action,qs&&a(m,I),m=N.hasEagerState?N.eagerState:a(m,I)}else B={lane:I,revertLane:N.revertLane,action:N.action,hasEagerState:N.hasEagerState,eagerState:N.eagerState,next:null},R===null?(w=R=B,b=m):R=R.next=B,Te.lanes|=I,os|=I;N=N.next}while(N!==null&&N!==r);if(R===null?b=m:R.next=w,!dn(m,i.memoizedState)&&(Dt=!0,q&&(a=Dr,a!==null)))throw a;i.memoizedState=m,i.baseState=b,i.baseQueue=R,l.lastRenderedState=m}return f===null&&(l.lanes=0),[i.memoizedState,l.dispatch]}function fd(i){var r=yt(),a=r.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=i;var l=a.dispatch,f=a.pending,m=r.memoizedState;if(f!==null){a.pending=null;var b=f=f.next;do m=i(m,b.action),b=b.next;while(b!==f);dn(m,r.memoizedState)||(Dt=!0),r.memoizedState=m,r.baseQueue===null&&(r.baseState=m),a.lastRenderedState=m}return[m,l]}function Wg(i,r,a){var l=Te,f=yt(),m=Le;if(m){if(a===void 0)throw Error(s(407));a=a()}else a=r();var b=!dn((Ue||f).memoizedState,a);b&&(f.memoizedState=a,Dt=!0),f=f.queue;var w=nb.bind(null,l,f,i);if(ua(2048,8,w,[i]),f.getSnapshot!==r||b||mt!==null&&mt.memoizedState.tag&1){if(l.flags|=2048,Lr(9,Jl(),tb.bind(null,l,f,a,r),null),Ye===null)throw Error(s(349));m||(Wi&124)!==0||eb(l,r,a)}return a}function eb(i,r,a){i.flags|=16384,i={getSnapshot:r,value:a},r=Te.updateQueue,r===null?(r=ld(),Te.updateQueue=r,r.stores=[i]):(a=r.stores,a===null?r.stores=[i]:a.push(i))}function tb(i,r,a,l){r.value=a,r.getSnapshot=l,ib(r)&&sb(i)}function nb(i,r,a){return a(function(){ib(r)&&sb(i)})}function ib(i){var r=i.getSnapshot;i=i.value;try{var a=r();return!dn(i,a)}catch{return!0}}function sb(i){var r=Or(i,2);r!==null&&bn(r,i,2)}function dd(i){var r=tn();if(typeof i=="function"){var a=i;if(i=a(),qs){Fi(!0);try{a()}finally{Fi(!1)}}}return r.memoizedState=r.baseState=i,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:i},r}function rb(i,r,a,l){return i.baseState=a,cd(i,Ue,typeof l=="function"?l:Ai)}function sM(i,r,a,l,f){if(Wl(i))throw Error(s(485));if(i=r.action,i!==null){var m={payload:f,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};L.T!==null?a(!0):m.isTransition=!1,l(m),a=r.pending,a===null?(m.next=r.pending=m,ob(r,m)):(m.next=a.next,r.pending=a.next=m)}}function ob(i,r){var a=r.action,l=r.payload,f=i.state;if(r.isTransition){var m=L.T,b={};L.T=b;try{var w=a(f,l),R=L.S;R!==null&&R(b,w),ab(i,r,w)}catch(N){hd(i,r,N)}finally{L.T=m}}else try{m=a(f,l),ab(i,r,m)}catch(N){hd(i,r,N)}}function ab(i,r,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){lb(i,r,l)},function(l){return hd(i,r,l)}):lb(i,r,a)}function lb(i,r,a){r.status="fulfilled",r.value=a,ub(r),i.state=a,r=i.pending,r!==null&&(a=r.next,a===r?i.pending=null:(a=a.next,r.next=a,ob(i,a)))}function hd(i,r,a){var l=i.pending;if(i.pending=null,l!==null){l=l.next;do r.status="rejected",r.reason=a,ub(r),r=r.next;while(r!==l)}i.action=null}function ub(i){i=i.listeners;for(var r=0;r<i.length;r++)(0,i[r])()}function cb(i,r){return r}function fb(i,r){if(Le){var a=Ye.formState;if(a!==null){e:{var l=Te;if(Le){if(rt){t:{for(var f=rt,m=Yn;f.nodeType!==8;){if(!m){f=null;break t}if(f=qn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){rt=qn(f.nextSibling),l=f.data==="F!";break e}}Vs(l)}l=!1}l&&(r=a[0])}}return a=tn(),a.memoizedState=a.baseState=r,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cb,lastRenderedState:r},a.queue=l,a=Cb.bind(null,Te,l),l.dispatch=a,l=dd(!1),m=bd.bind(null,Te,!1,l.queue),l=tn(),f={state:r,dispatch:null,action:i,pending:null},l.queue=f,a=sM.bind(null,Te,f,m,a),f.dispatch=a,l.memoizedState=i,[r,a,!1]}function db(i){var r=yt();return hb(r,Ue,i)}function hb(i,r,a){if(r=cd(i,r,cb)[0],i=Zl(Ai)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var l=la(r)}catch(b){throw b===na?Il:b}else l=r;r=yt();var f=r.queue,m=f.dispatch;return a!==r.memoizedState&&(Te.flags|=2048,Lr(9,Jl(),rM.bind(null,f,a),null)),[l,m,i]}function rM(i,r){i.action=r}function pb(i){var r=yt(),a=Ue;if(a!==null)return hb(r,a,i);yt(),r=r.memoizedState,a=yt();var l=a.queue.dispatch;return a.memoizedState=i,[r,l,!1]}function Lr(i,r,a,l){return i={tag:i,create:a,deps:l,inst:r,next:null},r=Te.updateQueue,r===null&&(r=ld(),Te.updateQueue=r),a=r.lastEffect,a===null?r.lastEffect=i.next=i:(l=a.next,a.next=i,i.next=l,r.lastEffect=i),i}function Jl(){return{destroy:void 0,resource:void 0}}function mb(){return yt().memoizedState}function Ql(i,r,a,l){var f=tn();l=l===void 0?null:l,Te.flags|=i,f.memoizedState=Lr(1|r,Jl(),a,l)}function ua(i,r,a,l){var f=yt();l=l===void 0?null:l;var m=f.memoizedState.inst;Ue!==null&&l!==null&&id(l,Ue.memoizedState.deps)?f.memoizedState=Lr(r,m,a,l):(Te.flags|=i,f.memoizedState=Lr(1|r,m,a,l))}function yb(i,r){Ql(8390656,8,i,r)}function gb(i,r){ua(2048,8,i,r)}function bb(i,r){return ua(4,2,i,r)}function vb(i,r){return ua(4,4,i,r)}function Sb(i,r){if(typeof r=="function"){i=i();var a=r(i);return function(){typeof a=="function"?a():r(null)}}if(r!=null)return i=i(),r.current=i,function(){r.current=null}}function wb(i,r,a){a=a!=null?a.concat([i]):null,ua(4,4,Sb.bind(null,r,i),a)}function pd(){}function xb(i,r){var a=yt();r=r===void 0?null:r;var l=a.memoizedState;return r!==null&&id(r,l[1])?l[0]:(a.memoizedState=[i,r],i)}function Ab(i,r){var a=yt();r=r===void 0?null:r;var l=a.memoizedState;if(r!==null&&id(r,l[1]))return l[0];if(l=i(),qs){Fi(!0);try{i()}finally{Fi(!1)}}return a.memoizedState=[l,r],l}function md(i,r,a){return a===void 0||(Wi&1073741824)!==0?i.memoizedState=r:(i.memoizedState=a,i=Rv(),Te.lanes|=i,os|=i,a)}function Tb(i,r,a,l){return dn(a,r)?a:Nr.current!==null?(i=md(i,a,l),dn(i,r)||(Dt=!0),i):(Wi&42)===0?(Dt=!0,i.memoizedState=a):(i=Rv(),Te.lanes|=i,os|=i,r)}function Eb(i,r,a,l,f){var m=P.p;P.p=m!==0&&8>m?m:8;var b=L.T,w={};L.T=w,bd(i,!1,r,a);try{var R=f(),N=L.S;if(N!==null&&N(w,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var q=tM(R,l);ca(i,r,q,gn(i))}else ca(i,r,l,gn(i))}catch(I){ca(i,r,{then:function(){},status:"rejected",reason:I},gn())}finally{P.p=m,L.T=b}}function oM(){}function yd(i,r,a,l){if(i.tag!==5)throw Error(s(476));var f=Rb(i).queue;Eb(i,f,r,F,a===null?oM:function(){return Ob(i),a(l)})}function Rb(i){var r=i.memoizedState;if(r!==null)return r;r={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:F},next:null};var a={};return r.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ai,lastRenderedState:a},next:null},i.memoizedState=r,i=i.alternate,i!==null&&(i.memoizedState=r),r}function Ob(i){var r=Rb(i).next.queue;ca(i,r,{},gn())}function gd(){return Pt(Ma)}function Mb(){return yt().memoizedState}function _b(){return yt().memoizedState}function aM(i){for(var r=i.return;r!==null;){switch(r.tag){case 24:case 3:var a=gn();i=Ji(a);var l=Qi(r,i,a);l!==null&&(bn(l,r,a),sa(l,r,a)),r={cache:Gf()},i.payload=r;return}r=r.return}}function lM(i,r,a){var l=gn();a={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},Wl(i)?kb(r,a):(a=Vf(i,r,a,l),a!==null&&(bn(a,i,l),Db(a,r,l)))}function Cb(i,r,a){var l=gn();ca(i,r,a,l)}function ca(i,r,a,l){var f={lane:l,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(Wl(i))kb(r,f);else{var m=i.alternate;if(i.lanes===0&&(m===null||m.lanes===0)&&(m=r.lastRenderedReducer,m!==null))try{var b=r.lastRenderedState,w=m(b,a);if(f.hasEagerState=!0,f.eagerState=w,dn(w,b))return Ll(i,r,f,0),Ye===null&&Bl(),!1}catch{}finally{}if(a=Vf(i,r,f,l),a!==null)return bn(a,i,l),Db(a,r,l),!0}return!1}function bd(i,r,a,l){if(l={lane:2,revertLane:Zd(),action:l,hasEagerState:!1,eagerState:null,next:null},Wl(i)){if(r)throw Error(s(479))}else r=Vf(i,a,l,2),r!==null&&bn(r,i,2)}function Wl(i){var r=i.alternate;return i===Te||r!==null&&r===Te}function kb(i,r){$r=Gl=!0;var a=i.pending;a===null?r.next=r:(r.next=a.next,a.next=r),i.pending=r}function Db(i,r,a){if((a&4194048)!==0){var l=r.lanes;l&=i.pendingLanes,a|=l,r.lanes=a,Uy(i,a)}}var eu={readContext:Pt,use:Xl,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft},Nb={readContext:Pt,use:Xl,useCallback:function(i,r){return tn().memoizedState=[i,r===void 0?null:r],i},useContext:Pt,useEffect:yb,useImperativeHandle:function(i,r,a){a=a!=null?a.concat([i]):null,Ql(4194308,4,Sb.bind(null,r,i),a)},useLayoutEffect:function(i,r){return Ql(4194308,4,i,r)},useInsertionEffect:function(i,r){Ql(4,2,i,r)},useMemo:function(i,r){var a=tn();r=r===void 0?null:r;var l=i();if(qs){Fi(!0);try{i()}finally{Fi(!1)}}return a.memoizedState=[l,r],l},useReducer:function(i,r,a){var l=tn();if(a!==void 0){var f=a(r);if(qs){Fi(!0);try{a(r)}finally{Fi(!1)}}}else f=r;return l.memoizedState=l.baseState=f,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:f},l.queue=i,i=i.dispatch=lM.bind(null,Te,i),[l.memoizedState,i]},useRef:function(i){var r=tn();return i={current:i},r.memoizedState=i},useState:function(i){i=dd(i);var r=i.queue,a=Cb.bind(null,Te,r);return r.dispatch=a,[i.memoizedState,a]},useDebugValue:pd,useDeferredValue:function(i,r){var a=tn();return md(a,i,r)},useTransition:function(){var i=dd(!1);return i=Eb.bind(null,Te,i.queue,!0,!1),tn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,r,a){var l=Te,f=tn();if(Le){if(a===void 0)throw Error(s(407));a=a()}else{if(a=r(),Ye===null)throw Error(s(349));(De&124)!==0||eb(l,r,a)}f.memoizedState=a;var m={value:a,getSnapshot:r};return f.queue=m,yb(nb.bind(null,l,m,i),[i]),l.flags|=2048,Lr(9,Jl(),tb.bind(null,l,m,a,r),null),a},useId:function(){var i=tn(),r=Ye.identifierPrefix;if(Le){var a=Si,l=vi;a=(l&~(1<<32-fn(l)-1)).toString(32)+a,r="ยซ"+r+"R"+a,a=Yl++,0<a&&(r+="H"+a.toString(32)),r+="ยป"}else a=nM++,r="ยซ"+r+"r"+a.toString(32)+"ยป";return i.memoizedState=r},useHostTransitionStatus:gd,useFormState:fb,useActionState:fb,useOptimistic:function(i){var r=tn();r.memoizedState=r.baseState=i;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=a,r=bd.bind(null,Te,!0,a),a.dispatch=r,[i,r]},useMemoCache:ud,useCacheRefresh:function(){return tn().memoizedState=aM.bind(null,Te)}},$b={readContext:Pt,use:Xl,useCallback:xb,useContext:Pt,useEffect:gb,useImperativeHandle:wb,useInsertionEffect:bb,useLayoutEffect:vb,useMemo:Ab,useReducer:Zl,useRef:mb,useState:function(){return Zl(Ai)},useDebugValue:pd,useDeferredValue:function(i,r){var a=yt();return Tb(a,Ue.memoizedState,i,r)},useTransition:function(){var i=Zl(Ai)[0],r=yt().memoizedState;return[typeof i=="boolean"?i:la(i),r]},useSyncExternalStore:Wg,useId:Mb,useHostTransitionStatus:gd,useFormState:db,useActionState:db,useOptimistic:function(i,r){var a=yt();return rb(a,Ue,i,r)},useMemoCache:ud,useCacheRefresh:_b},uM={readContext:Pt,use:Xl,useCallback:xb,useContext:Pt,useEffect:gb,useImperativeHandle:wb,useInsertionEffect:bb,useLayoutEffect:vb,useMemo:Ab,useReducer:fd,useRef:mb,useState:function(){return fd(Ai)},useDebugValue:pd,useDeferredValue:function(i,r){var a=yt();return Ue===null?md(a,i,r):Tb(a,Ue.memoizedState,i,r)},useTransition:function(){var i=fd(Ai)[0],r=yt().memoizedState;return[typeof i=="boolean"?i:la(i),r]},useSyncExternalStore:Wg,useId:Mb,useHostTransitionStatus:gd,useFormState:pb,useActionState:pb,useOptimistic:function(i,r){var a=yt();return Ue!==null?rb(a,Ue,i,r):(a.baseState=i,[i,a.queue.dispatch])},useMemoCache:ud,useCacheRefresh:_b},Vr=null,fa=0;function tu(i){var r=fa;return fa+=1,Vr===null&&(Vr=[]),Hg(Vr,i,r)}function da(i,r){r=r.props.ref,i.ref=r!==void 0?r:null}function nu(i,r){throw r.$$typeof===g?Error(s(525)):(i=Object.prototype.toString.call(r),Error(s(31,i==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":i)))}function Bb(i){var r=i._init;return r(i._payload)}function Lb(i){function r(C,O){if(i){var k=C.deletions;k===null?(C.deletions=[O],C.flags|=16):k.push(O)}}function a(C,O){if(!i)return null;for(;O!==null;)r(C,O),O=O.sibling;return null}function l(C){for(var O=new Map;C!==null;)C.key!==null?O.set(C.key,C):O.set(C.index,C),C=C.sibling;return O}function f(C,O){return C=bi(C,O),C.index=0,C.sibling=null,C}function m(C,O,k){return C.index=k,i?(k=C.alternate,k!==null?(k=k.index,k<O?(C.flags|=67108866,O):k):(C.flags|=67108866,O)):(C.flags|=1048576,O)}function b(C){return i&&C.alternate===null&&(C.flags|=67108866),C}function w(C,O,k,K){return O===null||O.tag!==6?(O=zf(k,C.mode,K),O.return=C,O):(O=f(O,k),O.return=C,O)}function R(C,O,k,K){var ne=k.type;return ne===A?q(C,O,k.props.children,K,k.key):O!==null&&(O.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===te&&Bb(ne)===O.type)?(O=f(O,k.props),da(O,k),O.return=C,O):(O=jl(k.type,k.key,k.props,null,C.mode,K),da(O,k),O.return=C,O)}function N(C,O,k,K){return O===null||O.tag!==4||O.stateNode.containerInfo!==k.containerInfo||O.stateNode.implementation!==k.implementation?(O=Uf(k,C.mode,K),O.return=C,O):(O=f(O,k.children||[]),O.return=C,O)}function q(C,O,k,K,ne){return O===null||O.tag!==7?(O=Ns(k,C.mode,K,ne),O.return=C,O):(O=f(O,k),O.return=C,O)}function I(C,O,k){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return O=zf(""+O,C.mode,k),O.return=C,O;if(typeof O=="object"&&O!==null){switch(O.$$typeof){case v:return k=jl(O.type,O.key,O.props,null,C.mode,k),da(k,O),k.return=C,k;case S:return O=Uf(O,C.mode,k),O.return=C,O;case te:var K=O._init;return O=K(O._payload),I(C,O,k)}if(X(O)||Ce(O))return O=Ns(O,C.mode,k,null),O.return=C,O;if(typeof O.then=="function")return I(C,tu(O),k);if(O.$$typeof===M)return I(C,Kl(C,O),k);nu(C,O)}return null}function B(C,O,k,K){var ne=O!==null?O.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return ne!==null?null:w(C,O,""+k,K);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case v:return k.key===ne?R(C,O,k,K):null;case S:return k.key===ne?N(C,O,k,K):null;case te:return ne=k._init,k=ne(k._payload),B(C,O,k,K)}if(X(k)||Ce(k))return ne!==null?null:q(C,O,k,K,null);if(typeof k.then=="function")return B(C,O,tu(k),K);if(k.$$typeof===M)return B(C,O,Kl(C,k),K);nu(C,k)}return null}function j(C,O,k,K,ne){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return C=C.get(k)||null,w(O,C,""+K,ne);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case v:return C=C.get(K.key===null?k:K.key)||null,R(O,C,K,ne);case S:return C=C.get(K.key===null?k:K.key)||null,N(O,C,K,ne);case te:var Re=K._init;return K=Re(K._payload),j(C,O,k,K,ne)}if(X(K)||Ce(K))return C=C.get(k)||null,q(O,C,K,ne,null);if(typeof K.then=="function")return j(C,O,k,tu(K),ne);if(K.$$typeof===M)return j(C,O,k,Kl(O,K),ne);nu(O,K)}return null}function de(C,O,k,K){for(var ne=null,Re=null,ae=O,ue=O=0,$t=null;ae!==null&&ue<k.length;ue++){ae.index>ue?($t=ae,ae=null):$t=ae.sibling;var $e=B(C,ae,k[ue],K);if($e===null){ae===null&&(ae=$t);break}i&&ae&&$e.alternate===null&&r(C,ae),O=m($e,O,ue),Re===null?ne=$e:Re.sibling=$e,Re=$e,ae=$t}if(ue===k.length)return a(C,ae),Le&&Bs(C,ue),ne;if(ae===null){for(;ue<k.length;ue++)ae=I(C,k[ue],K),ae!==null&&(O=m(ae,O,ue),Re===null?ne=ae:Re.sibling=ae,Re=ae);return Le&&Bs(C,ue),ne}for(ae=l(ae);ue<k.length;ue++)$t=j(ae,C,ue,k[ue],K),$t!==null&&(i&&$t.alternate!==null&&ae.delete($t.key===null?ue:$t.key),O=m($t,O,ue),Re===null?ne=$t:Re.sibling=$t,Re=$t);return i&&ae.forEach(function(ms){return r(C,ms)}),Le&&Bs(C,ue),ne}function le(C,O,k,K){if(k==null)throw Error(s(151));for(var ne=null,Re=null,ae=O,ue=O=0,$t=null,$e=k.next();ae!==null&&!$e.done;ue++,$e=k.next()){ae.index>ue?($t=ae,ae=null):$t=ae.sibling;var ms=B(C,ae,$e.value,K);if(ms===null){ae===null&&(ae=$t);break}i&&ae&&ms.alternate===null&&r(C,ae),O=m(ms,O,ue),Re===null?ne=ms:Re.sibling=ms,Re=ms,ae=$t}if($e.done)return a(C,ae),Le&&Bs(C,ue),ne;if(ae===null){for(;!$e.done;ue++,$e=k.next())$e=I(C,$e.value,K),$e!==null&&(O=m($e,O,ue),Re===null?ne=$e:Re.sibling=$e,Re=$e);return Le&&Bs(C,ue),ne}for(ae=l(ae);!$e.done;ue++,$e=k.next())$e=j(ae,C,ue,$e.value,K),$e!==null&&(i&&$e.alternate!==null&&ae.delete($e.key===null?ue:$e.key),O=m($e,O,ue),Re===null?ne=$e:Re.sibling=$e,Re=$e);return i&&ae.forEach(function(c_){return r(C,c_)}),Le&&Bs(C,ue),ne}function Ke(C,O,k,K){if(typeof k=="object"&&k!==null&&k.type===A&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case v:e:{for(var ne=k.key;O!==null;){if(O.key===ne){if(ne=k.type,ne===A){if(O.tag===7){a(C,O.sibling),K=f(O,k.props.children),K.return=C,C=K;break e}}else if(O.elementType===ne||typeof ne=="object"&&ne!==null&&ne.$$typeof===te&&Bb(ne)===O.type){a(C,O.sibling),K=f(O,k.props),da(K,k),K.return=C,C=K;break e}a(C,O);break}else r(C,O);O=O.sibling}k.type===A?(K=Ns(k.props.children,C.mode,K,k.key),K.return=C,C=K):(K=jl(k.type,k.key,k.props,null,C.mode,K),da(K,k),K.return=C,C=K)}return b(C);case S:e:{for(ne=k.key;O!==null;){if(O.key===ne)if(O.tag===4&&O.stateNode.containerInfo===k.containerInfo&&O.stateNode.implementation===k.implementation){a(C,O.sibling),K=f(O,k.children||[]),K.return=C,C=K;break e}else{a(C,O);break}else r(C,O);O=O.sibling}K=Uf(k,C.mode,K),K.return=C,C=K}return b(C);case te:return ne=k._init,k=ne(k._payload),Ke(C,O,k,K)}if(X(k))return de(C,O,k,K);if(Ce(k)){if(ne=Ce(k),typeof ne!="function")throw Error(s(150));return k=ne.call(k),le(C,O,k,K)}if(typeof k.then=="function")return Ke(C,O,tu(k),K);if(k.$$typeof===M)return Ke(C,O,Kl(C,k),K);nu(C,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,O!==null&&O.tag===6?(a(C,O.sibling),K=f(O,k),K.return=C,C=K):(a(C,O),K=zf(k,C.mode,K),K.return=C,C=K),b(C)):a(C,O)}return function(C,O,k,K){try{fa=0;var ne=Ke(C,O,k,K);return Vr=null,ne}catch(ae){if(ae===na||ae===Il)throw ae;var Re=hn(29,ae,null,C.mode);return Re.lanes=K,Re.return=C,Re}finally{}}}var jr=Lb(!0),Vb=Lb(!1),_n=U(null),Xn=null;function es(i){var r=i.alternate;Q(Tt,Tt.current&1),Q(_n,i),Xn===null&&(r===null||Nr.current!==null||r.memoizedState!==null)&&(Xn=i)}function jb(i){if(i.tag===22){if(Q(Tt,Tt.current),Q(_n,i),Xn===null){var r=i.alternate;r!==null&&r.memoizedState!==null&&(Xn=i)}}else ts()}function ts(){Q(Tt,Tt.current),Q(_n,_n.current)}function Ti(i){G(_n),Xn===i&&(Xn=null),G(Tt)}var Tt=U(0);function iu(i){for(var r=i;r!==null;){if(r.tag===13){var a=r.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||lh(a)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function vd(i,r,a,l){r=i.memoizedState,a=a(l,r),a=a==null?r:y({},r,a),i.memoizedState=a,i.lanes===0&&(i.updateQueue.baseState=a)}var Sd={enqueueSetState:function(i,r,a){i=i._reactInternals;var l=gn(),f=Ji(l);f.payload=r,a!=null&&(f.callback=a),r=Qi(i,f,l),r!==null&&(bn(r,i,l),sa(r,i,l))},enqueueReplaceState:function(i,r,a){i=i._reactInternals;var l=gn(),f=Ji(l);f.tag=1,f.payload=r,a!=null&&(f.callback=a),r=Qi(i,f,l),r!==null&&(bn(r,i,l),sa(r,i,l))},enqueueForceUpdate:function(i,r){i=i._reactInternals;var a=gn(),l=Ji(a);l.tag=2,r!=null&&(l.callback=r),r=Qi(i,l,a),r!==null&&(bn(r,i,a),sa(r,i,a))}};function zb(i,r,a,l,f,m,b){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(l,m,b):r.prototype&&r.prototype.isPureReactComponent?!Yo(a,l)||!Yo(f,m):!0}function Ub(i,r,a,l){i=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(a,l),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(a,l),r.state!==i&&Sd.enqueueReplaceState(r,r.state,null)}function Ks(i,r){var a=r;if("ref"in r){a={};for(var l in r)l!=="ref"&&(a[l]=r[l])}if(i=i.defaultProps){a===r&&(a=y({},a));for(var f in i)a[f]===void 0&&(a[f]=i[f])}return a}var su=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)};function qb(i){su(i)}function Kb(i){console.error(i)}function Pb(i){su(i)}function ru(i,r){try{var a=i.onUncaughtError;a(r.value,{componentStack:r.stack})}catch(l){setTimeout(function(){throw l})}}function Ib(i,r,a){try{var l=i.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function wd(i,r,a){return a=Ji(a),a.tag=3,a.payload={element:null},a.callback=function(){ru(i,r)},a}function Hb(i){return i=Ji(i),i.tag=3,i}function Fb(i,r,a,l){var f=a.type.getDerivedStateFromError;if(typeof f=="function"){var m=l.value;i.payload=function(){return f(m)},i.callback=function(){Ib(r,a,l)}}var b=a.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(i.callback=function(){Ib(r,a,l),typeof f!="function"&&(as===null?as=new Set([this]):as.add(this));var w=l.stack;this.componentDidCatch(l.value,{componentStack:w!==null?w:""})})}function cM(i,r,a,l,f){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(r=a.alternate,r!==null&&Wo(r,a,f,!0),a=_n.current,a!==null){switch(a.tag){case 13:return Xn===null?Hd():a.alternate===null&&ot===0&&(ot=3),a.flags&=-257,a.flags|=65536,a.lanes=f,l===Zf?a.flags|=16384:(r=a.updateQueue,r===null?a.updateQueue=new Set([l]):r.add(l),Gd(i,l,f)),!1;case 22:return a.flags|=65536,l===Zf?a.flags|=16384:(r=a.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=r):(a=r.retryQueue,a===null?r.retryQueue=new Set([l]):a.add(l)),Gd(i,l,f)),!1}throw Error(s(435,a.tag))}return Gd(i,l,f),Hd(),!1}if(Le)return r=_n.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=f,l!==Pf&&(i=Error(s(422),{cause:l}),Qo(En(i,a)))):(l!==Pf&&(r=Error(s(423),{cause:l}),Qo(En(r,a))),i=i.current.alternate,i.flags|=65536,f&=-f,i.lanes|=f,l=En(l,a),f=wd(i.stateNode,l,f),Wf(i,f),ot!==4&&(ot=2)),!1;var m=Error(s(520),{cause:l});if(m=En(m,a),va===null?va=[m]:va.push(m),ot!==4&&(ot=2),r===null)return!0;l=En(l,a),a=r;do{switch(a.tag){case 3:return a.flags|=65536,i=f&-f,a.lanes|=i,i=wd(a.stateNode,l,i),Wf(a,i),!1;case 1:if(r=a.type,m=a.stateNode,(a.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(as===null||!as.has(m))))return a.flags|=65536,f&=-f,a.lanes|=f,f=Hb(f),Fb(f,i,a,l),Wf(a,f),!1}a=a.return}while(a!==null);return!1}var Gb=Error(s(461)),Dt=!1;function Vt(i,r,a,l){r.child=i===null?Vb(r,null,a,l):jr(r,i.child,a,l)}function Yb(i,r,a,l,f){a=a.render;var m=r.ref;if("ref"in l){var b={};for(var w in l)w!=="ref"&&(b[w]=l[w])}else b=l;return zs(r),l=sd(i,r,a,b,m,f),w=rd(),i!==null&&!Dt?(od(i,r,f),Ei(i,r,f)):(Le&&w&&qf(r),r.flags|=1,Vt(i,r,l,f),r.child)}function Xb(i,r,a,l,f){if(i===null){var m=a.type;return typeof m=="function"&&!jf(m)&&m.defaultProps===void 0&&a.compare===null?(r.tag=15,r.type=m,Zb(i,r,m,l,f)):(i=jl(a.type,null,l,r,r.mode,f),i.ref=r.ref,i.return=r,r.child=i)}if(m=i.child,!_d(i,f)){var b=m.memoizedProps;if(a=a.compare,a=a!==null?a:Yo,a(b,l)&&i.ref===r.ref)return Ei(i,r,f)}return r.flags|=1,i=bi(m,l),i.ref=r.ref,i.return=r,r.child=i}function Zb(i,r,a,l,f){if(i!==null){var m=i.memoizedProps;if(Yo(m,l)&&i.ref===r.ref)if(Dt=!1,r.pendingProps=l=m,_d(i,f))(i.flags&131072)!==0&&(Dt=!0);else return r.lanes=i.lanes,Ei(i,r,f)}return xd(i,r,a,l,f)}function Jb(i,r,a){var l=r.pendingProps,f=l.children,m=i!==null?i.memoizedState:null;if(l.mode==="hidden"){if((r.flags&128)!==0){if(l=m!==null?m.baseLanes|a:a,i!==null){for(f=r.child=i.child,m=0;f!==null;)m=m|f.lanes|f.childLanes,f=f.sibling;r.childLanes=m&~l}else r.childLanes=0,r.child=null;return Qb(i,r,l,a)}if((a&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},i!==null&&Pl(r,m!==null?m.cachePool:null),m!==null?Zg(r,m):td(),jb(r);else return r.lanes=r.childLanes=536870912,Qb(i,r,m!==null?m.baseLanes|a:a,a)}else m!==null?(Pl(r,m.cachePool),Zg(r,m),ts(),r.memoizedState=null):(i!==null&&Pl(r,null),td(),ts());return Vt(i,r,f,a),r.child}function Qb(i,r,a,l){var f=Xf();return f=f===null?null:{parent:At._currentValue,pool:f},r.memoizedState={baseLanes:a,cachePool:f},i!==null&&Pl(r,null),td(),jb(r),i!==null&&Wo(i,r,l,!0),null}function ou(i,r){var a=r.ref;if(a===null)i!==null&&i.ref!==null&&(r.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(i===null||i.ref!==a)&&(r.flags|=4194816)}}function xd(i,r,a,l,f){return zs(r),a=sd(i,r,a,l,void 0,f),l=rd(),i!==null&&!Dt?(od(i,r,f),Ei(i,r,f)):(Le&&l&&qf(r),r.flags|=1,Vt(i,r,a,f),r.child)}function Wb(i,r,a,l,f,m){return zs(r),r.updateQueue=null,a=Qg(r,l,a,f),Jg(i),l=rd(),i!==null&&!Dt?(od(i,r,m),Ei(i,r,m)):(Le&&l&&qf(r),r.flags|=1,Vt(i,r,a,m),r.child)}function ev(i,r,a,l,f){if(zs(r),r.stateNode===null){var m=Mr,b=a.contextType;typeof b=="object"&&b!==null&&(m=Pt(b)),m=new a(l,m),r.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Sd,r.stateNode=m,m._reactInternals=r,m=r.stateNode,m.props=l,m.state=r.memoizedState,m.refs={},Jf(r),b=a.contextType,m.context=typeof b=="object"&&b!==null?Pt(b):Mr,m.state=r.memoizedState,b=a.getDerivedStateFromProps,typeof b=="function"&&(vd(r,a,b,l),m.state=r.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&Sd.enqueueReplaceState(m,m.state,null),oa(r,l,m,f),ra(),m.state=r.memoizedState),typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!0}else if(i===null){m=r.stateNode;var w=r.memoizedProps,R=Ks(a,w);m.props=R;var N=m.context,q=a.contextType;b=Mr,typeof q=="object"&&q!==null&&(b=Pt(q));var I=a.getDerivedStateFromProps;q=typeof I=="function"||typeof m.getSnapshotBeforeUpdate=="function",w=r.pendingProps!==w,q||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(w||N!==b)&&Ub(r,m,l,b),Zi=!1;var B=r.memoizedState;m.state=B,oa(r,l,m,f),ra(),N=r.memoizedState,w||B!==N||Zi?(typeof I=="function"&&(vd(r,a,I,l),N=r.memoizedState),(R=Zi||zb(r,a,R,l,B,N,b))?(q||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(r.flags|=4194308)):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=l,r.memoizedState=N),m.props=l,m.state=N,m.context=b,l=R):(typeof m.componentDidMount=="function"&&(r.flags|=4194308),l=!1)}else{m=r.stateNode,Qf(i,r),b=r.memoizedProps,q=Ks(a,b),m.props=q,I=r.pendingProps,B=m.context,N=a.contextType,R=Mr,typeof N=="object"&&N!==null&&(R=Pt(N)),w=a.getDerivedStateFromProps,(N=typeof w=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==I||B!==R)&&Ub(r,m,l,R),Zi=!1,B=r.memoizedState,m.state=B,oa(r,l,m,f),ra();var j=r.memoizedState;b!==I||B!==j||Zi||i!==null&&i.dependencies!==null&&ql(i.dependencies)?(typeof w=="function"&&(vd(r,a,w,l),j=r.memoizedState),(q=Zi||zb(r,a,q,l,B,j,R)||i!==null&&i.dependencies!==null&&ql(i.dependencies))?(N||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(l,j,R),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(l,j,R)),typeof m.componentDidUpdate=="function"&&(r.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=1024),r.memoizedProps=l,r.memoizedState=j),m.props=l,m.state=j,m.context=R,l=q):(typeof m.componentDidUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===i.memoizedProps&&B===i.memoizedState||(r.flags|=1024),l=!1)}return m=l,ou(i,r),l=(r.flags&128)!==0,m||l?(m=r.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:m.render(),r.flags|=1,i!==null&&l?(r.child=jr(r,i.child,null,f),r.child=jr(r,null,a,f)):Vt(i,r,a,f),r.memoizedState=m.state,i=r.child):i=Ei(i,r,f),i}function tv(i,r,a,l){return Jo(),r.flags|=256,Vt(i,r,a,l),r.child}var Ad={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Td(i){return{baseLanes:i,cachePool:Kg()}}function Ed(i,r,a){return i=i!==null?i.childLanes&~a:0,r&&(i|=Cn),i}function nv(i,r,a){var l=r.pendingProps,f=!1,m=(r.flags&128)!==0,b;if((b=m)||(b=i!==null&&i.memoizedState===null?!1:(Tt.current&2)!==0),b&&(f=!0,r.flags&=-129),b=(r.flags&32)!==0,r.flags&=-33,i===null){if(Le){if(f?es(r):ts(),Le){var w=rt,R;if(R=w){e:{for(R=w,w=Yn;R.nodeType!==8;){if(!w){w=null;break e}if(R=qn(R.nextSibling),R===null){w=null;break e}}w=R}w!==null?(r.memoizedState={dehydrated:w,treeContext:$s!==null?{id:vi,overflow:Si}:null,retryLane:536870912,hydrationErrors:null},R=hn(18,null,null,0),R.stateNode=w,R.return=r,r.child=R,Xt=r,rt=null,R=!0):R=!1}R||Vs(r)}if(w=r.memoizedState,w!==null&&(w=w.dehydrated,w!==null))return lh(w)?r.lanes=32:r.lanes=536870912,null;Ti(r)}return w=l.children,l=l.fallback,f?(ts(),f=r.mode,w=au({mode:"hidden",children:w},f),l=Ns(l,f,a,null),w.return=r,l.return=r,w.sibling=l,r.child=w,f=r.child,f.memoizedState=Td(a),f.childLanes=Ed(i,b,a),r.memoizedState=Ad,l):(es(r),Rd(r,w))}if(R=i.memoizedState,R!==null&&(w=R.dehydrated,w!==null)){if(m)r.flags&256?(es(r),r.flags&=-257,r=Od(i,r,a)):r.memoizedState!==null?(ts(),r.child=i.child,r.flags|=128,r=null):(ts(),f=l.fallback,w=r.mode,l=au({mode:"visible",children:l.children},w),f=Ns(f,w,a,null),f.flags|=2,l.return=r,f.return=r,l.sibling=f,r.child=l,jr(r,i.child,null,a),l=r.child,l.memoizedState=Td(a),l.childLanes=Ed(i,b,a),r.memoizedState=Ad,r=f);else if(es(r),lh(w)){if(b=w.nextSibling&&w.nextSibling.dataset,b)var N=b.dgst;b=N,l=Error(s(419)),l.stack="",l.digest=b,Qo({value:l,source:null,stack:null}),r=Od(i,r,a)}else if(Dt||Wo(i,r,a,!1),b=(a&i.childLanes)!==0,Dt||b){if(b=Ye,b!==null&&(l=a&-a,l=(l&42)!==0?1:uf(l),l=(l&(b.suspendedLanes|a))!==0?0:l,l!==0&&l!==R.retryLane))throw R.retryLane=l,Or(i,l),bn(b,i,l),Gb;w.data==="$?"||Hd(),r=Od(i,r,a)}else w.data==="$?"?(r.flags|=192,r.child=i.child,r=null):(i=R.treeContext,rt=qn(w.nextSibling),Xt=r,Le=!0,Ls=null,Yn=!1,i!==null&&(On[Mn++]=vi,On[Mn++]=Si,On[Mn++]=$s,vi=i.id,Si=i.overflow,$s=r),r=Rd(r,l.children),r.flags|=4096);return r}return f?(ts(),f=l.fallback,w=r.mode,R=i.child,N=R.sibling,l=bi(R,{mode:"hidden",children:l.children}),l.subtreeFlags=R.subtreeFlags&65011712,N!==null?f=bi(N,f):(f=Ns(f,w,a,null),f.flags|=2),f.return=r,l.return=r,l.sibling=f,r.child=l,l=f,f=r.child,w=i.child.memoizedState,w===null?w=Td(a):(R=w.cachePool,R!==null?(N=At._currentValue,R=R.parent!==N?{parent:N,pool:N}:R):R=Kg(),w={baseLanes:w.baseLanes|a,cachePool:R}),f.memoizedState=w,f.childLanes=Ed(i,b,a),r.memoizedState=Ad,l):(es(r),a=i.child,i=a.sibling,a=bi(a,{mode:"visible",children:l.children}),a.return=r,a.sibling=null,i!==null&&(b=r.deletions,b===null?(r.deletions=[i],r.flags|=16):b.push(i)),r.child=a,r.memoizedState=null,a)}function Rd(i,r){return r=au({mode:"visible",children:r},i.mode),r.return=i,i.child=r}function au(i,r){return i=hn(22,i,null,r),i.lanes=0,i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},i}function Od(i,r,a){return jr(r,i.child,null,a),i=Rd(r,r.pendingProps.children),i.flags|=2,r.memoizedState=null,i}function iv(i,r,a){i.lanes|=r;var l=i.alternate;l!==null&&(l.lanes|=r),Hf(i.return,r,a)}function Md(i,r,a,l,f){var m=i.memoizedState;m===null?i.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:f}:(m.isBackwards=r,m.rendering=null,m.renderingStartTime=0,m.last=l,m.tail=a,m.tailMode=f)}function sv(i,r,a){var l=r.pendingProps,f=l.revealOrder,m=l.tail;if(Vt(i,r,l.children,a),l=Tt.current,(l&2)!==0)l=l&1|2,r.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=r.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&iv(i,a,r);else if(i.tag===19)iv(i,a,r);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}l&=1}switch(Q(Tt,l),f){case"forwards":for(a=r.child,f=null;a!==null;)i=a.alternate,i!==null&&iu(i)===null&&(f=a),a=a.sibling;a=f,a===null?(f=r.child,r.child=null):(f=a.sibling,a.sibling=null),Md(r,!1,f,a,m);break;case"backwards":for(a=null,f=r.child,r.child=null;f!==null;){if(i=f.alternate,i!==null&&iu(i)===null){r.child=f;break}i=f.sibling,f.sibling=a,a=f,f=i}Md(r,!0,a,null,m);break;case"together":Md(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function Ei(i,r,a){if(i!==null&&(r.dependencies=i.dependencies),os|=r.lanes,(a&r.childLanes)===0)if(i!==null){if(Wo(i,r,a,!1),(a&r.childLanes)===0)return null}else return null;if(i!==null&&r.child!==i.child)throw Error(s(153));if(r.child!==null){for(i=r.child,a=bi(i,i.pendingProps),r.child=a,a.return=r;i.sibling!==null;)i=i.sibling,a=a.sibling=bi(i,i.pendingProps),a.return=r;a.sibling=null}return r.child}function _d(i,r){return(i.lanes&r)!==0?!0:(i=i.dependencies,!!(i!==null&&ql(i)))}function fM(i,r,a){switch(r.tag){case 3:Ne(r,r.stateNode.containerInfo),Xi(r,At,i.memoizedState.cache),Jo();break;case 27:case 5:Hi(r);break;case 4:Ne(r,r.stateNode.containerInfo);break;case 10:Xi(r,r.type,r.memoizedProps.value);break;case 13:var l=r.memoizedState;if(l!==null)return l.dehydrated!==null?(es(r),r.flags|=128,null):(a&r.child.childLanes)!==0?nv(i,r,a):(es(r),i=Ei(i,r,a),i!==null?i.sibling:null);es(r);break;case 19:var f=(i.flags&128)!==0;if(l=(a&r.childLanes)!==0,l||(Wo(i,r,a,!1),l=(a&r.childLanes)!==0),f){if(l)return sv(i,r,a);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Q(Tt,Tt.current),l)break;return null;case 22:case 23:return r.lanes=0,Jb(i,r,a);case 24:Xi(r,At,i.memoizedState.cache)}return Ei(i,r,a)}function rv(i,r,a){if(i!==null)if(i.memoizedProps!==r.pendingProps)Dt=!0;else{if(!_d(i,a)&&(r.flags&128)===0)return Dt=!1,fM(i,r,a);Dt=(i.flags&131072)!==0}else Dt=!1,Le&&(r.flags&1048576)!==0&&Bg(r,Ul,r.index);switch(r.lanes=0,r.tag){case 16:e:{i=r.pendingProps;var l=r.elementType,f=l._init;if(l=f(l._payload),r.type=l,typeof l=="function")jf(l)?(i=Ks(l,i),r.tag=1,r=ev(null,r,l,i,a)):(r.tag=0,r=xd(null,r,l,i,a));else{if(l!=null){if(f=l.$$typeof,f===H){r.tag=11,r=Yb(null,r,l,i,a);break e}else if(f===ie){r.tag=14,r=Xb(null,r,l,i,a);break e}}throw r=ye(l)||l,Error(s(306,r,""))}}return r;case 0:return xd(i,r,r.type,r.pendingProps,a);case 1:return l=r.type,f=Ks(l,r.pendingProps),ev(i,r,l,f,a);case 3:e:{if(Ne(r,r.stateNode.containerInfo),i===null)throw Error(s(387));l=r.pendingProps;var m=r.memoizedState;f=m.element,Qf(i,r),oa(r,l,null,a);var b=r.memoizedState;if(l=b.cache,Xi(r,At,l),l!==m.cache&&Ff(r,[At],a,!0),ra(),l=b.element,m.isDehydrated)if(m={element:l,isDehydrated:!1,cache:b.cache},r.updateQueue.baseState=m,r.memoizedState=m,r.flags&256){r=tv(i,r,l,a);break e}else if(l!==f){f=En(Error(s(424)),r),Qo(f),r=tv(i,r,l,a);break e}else{switch(i=r.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(rt=qn(i.firstChild),Xt=r,Le=!0,Ls=null,Yn=!0,a=Vb(r,null,l,a),r.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Jo(),l===f){r=Ei(i,r,a);break e}Vt(i,r,l,a)}r=r.child}return r;case 26:return ou(i,r),i===null?(a=u0(r.type,null,r.pendingProps,null))?r.memoizedState=a:Le||(a=r.type,i=r.pendingProps,l=wu(se.current).createElement(a),l[Kt]=r,l[Wt]=i,zt(l,a,i),kt(l),r.stateNode=l):r.memoizedState=u0(r.type,i.memoizedProps,r.pendingProps,i.memoizedState),null;case 27:return Hi(r),i===null&&Le&&(l=r.stateNode=o0(r.type,r.pendingProps,se.current),Xt=r,Yn=!0,f=rt,cs(r.type)?(uh=f,rt=qn(l.firstChild)):rt=f),Vt(i,r,r.pendingProps.children,a),ou(i,r),i===null&&(r.flags|=4194304),r.child;case 5:return i===null&&Le&&((f=l=rt)&&(l=zM(l,r.type,r.pendingProps,Yn),l!==null?(r.stateNode=l,Xt=r,rt=qn(l.firstChild),Yn=!1,f=!0):f=!1),f||Vs(r)),Hi(r),f=r.type,m=r.pendingProps,b=i!==null?i.memoizedProps:null,l=m.children,rh(f,m)?l=null:b!==null&&rh(f,b)&&(r.flags|=32),r.memoizedState!==null&&(f=sd(i,r,iM,null,null,a),Ma._currentValue=f),ou(i,r),Vt(i,r,l,a),r.child;case 6:return i===null&&Le&&((i=a=rt)&&(a=UM(a,r.pendingProps,Yn),a!==null?(r.stateNode=a,Xt=r,rt=null,i=!0):i=!1),i||Vs(r)),null;case 13:return nv(i,r,a);case 4:return Ne(r,r.stateNode.containerInfo),l=r.pendingProps,i===null?r.child=jr(r,null,l,a):Vt(i,r,l,a),r.child;case 11:return Yb(i,r,r.type,r.pendingProps,a);case 7:return Vt(i,r,r.pendingProps,a),r.child;case 8:return Vt(i,r,r.pendingProps.children,a),r.child;case 12:return Vt(i,r,r.pendingProps.children,a),r.child;case 10:return l=r.pendingProps,Xi(r,r.type,l.value),Vt(i,r,l.children,a),r.child;case 9:return f=r.type._context,l=r.pendingProps.children,zs(r),f=Pt(f),l=l(f),r.flags|=1,Vt(i,r,l,a),r.child;case 14:return Xb(i,r,r.type,r.pendingProps,a);case 15:return Zb(i,r,r.type,r.pendingProps,a);case 19:return sv(i,r,a);case 31:return l=r.pendingProps,a=r.mode,l={mode:l.mode,children:l.children},i===null?(a=au(l,a),a.ref=r.ref,r.child=a,a.return=r,r=a):(a=bi(i.child,l),a.ref=r.ref,r.child=a,a.return=r,r=a),r;case 22:return Jb(i,r,a);case 24:return zs(r),l=Pt(At),i===null?(f=Xf(),f===null&&(f=Ye,m=Gf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=a),f=m),r.memoizedState={parent:l,cache:f},Jf(r),Xi(r,At,f)):((i.lanes&a)!==0&&(Qf(i,r),oa(r,null,null,a),ra()),f=i.memoizedState,m=r.memoizedState,f.parent!==l?(f={parent:l,cache:l},r.memoizedState=f,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=f),Xi(r,At,l)):(l=m.cache,Xi(r,At,l),l!==f.cache&&Ff(r,[At],a,!0))),Vt(i,r,r.pendingProps.children,a),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Ri(i){i.flags|=4}function ov(i,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!p0(r)){if(r=_n.current,r!==null&&((De&4194048)===De?Xn!==null:(De&62914560)!==De&&(De&536870912)===0||r!==Xn))throw ia=Zf,Pg;i.flags|=8192}}function lu(i,r){r!==null&&(i.flags|=4),i.flags&16384&&(r=i.tag!==22?jy():536870912,i.lanes|=r,Kr|=r)}function ha(i,r){if(!Le)switch(i.tailMode){case"hidden":r=i.tail;for(var a=null;r!==null;)r.alternate!==null&&(a=r),r=r.sibling;a===null?i.tail=null:a.sibling=null;break;case"collapsed":a=i.tail;for(var l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?r||i.tail===null?i.tail=null:i.tail.sibling=null:l.sibling=null}}function tt(i){var r=i.alternate!==null&&i.alternate.child===i.child,a=0,l=0;if(r)for(var f=i.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags&65011712,l|=f.flags&65011712,f.return=i,f=f.sibling;else for(f=i.child;f!==null;)a|=f.lanes|f.childLanes,l|=f.subtreeFlags,l|=f.flags,f.return=i,f=f.sibling;return i.subtreeFlags|=l,i.childLanes=a,r}function dM(i,r,a){var l=r.pendingProps;switch(Kf(r),r.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return tt(r),null;case 1:return tt(r),null;case 3:return a=r.stateNode,l=null,i!==null&&(l=i.memoizedState.cache),r.memoizedState.cache!==l&&(r.flags|=2048),xi(At),un(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(i===null||i.child===null)&&(Zo(r)?Ri(r):i===null||i.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,jg())),tt(r),null;case 26:return a=r.memoizedState,i===null?(Ri(r),a!==null?(tt(r),ov(r,a)):(tt(r),r.flags&=-16777217)):a?a!==i.memoizedState?(Ri(r),tt(r),ov(r,a)):(tt(r),r.flags&=-16777217):(i.memoizedProps!==l&&Ri(r),tt(r),r.flags&=-16777217),null;case 27:ge(r),a=se.current;var f=r.type;if(i!==null&&r.stateNode!=null)i.memoizedProps!==l&&Ri(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return tt(r),null}i=re.current,Zo(r)?Lg(r):(i=o0(f,l,a),r.stateNode=i,Ri(r))}return tt(r),null;case 5:if(ge(r),a=r.type,i!==null&&r.stateNode!=null)i.memoizedProps!==l&&Ri(r);else{if(!l){if(r.stateNode===null)throw Error(s(166));return tt(r),null}if(i=re.current,Zo(r))Lg(r);else{switch(f=wu(se.current),i){case 1:i=f.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:i=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":i=f.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":i=f.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":i=f.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild);break;case"select":i=typeof l.is=="string"?f.createElement("select",{is:l.is}):f.createElement("select"),l.multiple?i.multiple=!0:l.size&&(i.size=l.size);break;default:i=typeof l.is=="string"?f.createElement(a,{is:l.is}):f.createElement(a)}}i[Kt]=r,i[Wt]=l;e:for(f=r.child;f!==null;){if(f.tag===5||f.tag===6)i.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===r)break e;for(;f.sibling===null;){if(f.return===null||f.return===r)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}r.stateNode=i;e:switch(zt(i,a,l),a){case"button":case"input":case"select":case"textarea":i=!!l.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Ri(r)}}return tt(r),r.flags&=-16777217,null;case 6:if(i&&r.stateNode!=null)i.memoizedProps!==l&&Ri(r);else{if(typeof l!="string"&&r.stateNode===null)throw Error(s(166));if(i=se.current,Zo(r)){if(i=r.stateNode,a=r.memoizedProps,l=null,f=Xt,f!==null)switch(f.tag){case 27:case 5:l=f.memoizedProps}i[Kt]=r,i=!!(i.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||Wv(i.nodeValue,a)),i||Vs(r)}else i=wu(i).createTextNode(l),i[Kt]=r,r.stateNode=i}return tt(r),null;case 13:if(l=r.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(f=Zo(r),l!==null&&l.dehydrated!==null){if(i===null){if(!f)throw Error(s(318));if(f=r.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(s(317));f[Kt]=r}else Jo(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;tt(r),f=!1}else f=jg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),f=!0;if(!f)return r.flags&256?(Ti(r),r):(Ti(r),null)}if(Ti(r),(r.flags&128)!==0)return r.lanes=a,r;if(a=l!==null,i=i!==null&&i.memoizedState!==null,a){l=r.child,f=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(f=l.alternate.memoizedState.cachePool.pool);var m=null;l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(m=l.memoizedState.cachePool.pool),m!==f&&(l.flags|=2048)}return a!==i&&a&&(r.child.flags|=8192),lu(r,r.updateQueue),tt(r),null;case 4:return un(),i===null&&eh(r.stateNode.containerInfo),tt(r),null;case 10:return xi(r.type),tt(r),null;case 19:if(G(Tt),f=r.memoizedState,f===null)return tt(r),null;if(l=(r.flags&128)!==0,m=f.rendering,m===null)if(l)ha(f,!1);else{if(ot!==0||i!==null&&(i.flags&128)!==0)for(i=r.child;i!==null;){if(m=iu(i),m!==null){for(r.flags|=128,ha(f,!1),i=m.updateQueue,r.updateQueue=i,lu(r,i),r.subtreeFlags=0,i=a,a=r.child;a!==null;)$g(a,i),a=a.sibling;return Q(Tt,Tt.current&1|2),r.child}i=i.sibling}f.tail!==null&&ct()>fu&&(r.flags|=128,l=!0,ha(f,!1),r.lanes=4194304)}else{if(!l)if(i=iu(m),i!==null){if(r.flags|=128,l=!0,i=i.updateQueue,r.updateQueue=i,lu(r,i),ha(f,!0),f.tail===null&&f.tailMode==="hidden"&&!m.alternate&&!Le)return tt(r),null}else 2*ct()-f.renderingStartTime>fu&&a!==536870912&&(r.flags|=128,l=!0,ha(f,!1),r.lanes=4194304);f.isBackwards?(m.sibling=r.child,r.child=m):(i=f.last,i!==null?i.sibling=m:r.child=m,f.last=m)}return f.tail!==null?(r=f.tail,f.rendering=r,f.tail=r.sibling,f.renderingStartTime=ct(),r.sibling=null,i=Tt.current,Q(Tt,l?i&1|2:i&1),r):(tt(r),null);case 22:case 23:return Ti(r),nd(),l=r.memoizedState!==null,i!==null?i.memoizedState!==null!==l&&(r.flags|=8192):l&&(r.flags|=8192),l?(a&536870912)!==0&&(r.flags&128)===0&&(tt(r),r.subtreeFlags&6&&(r.flags|=8192)):tt(r),a=r.updateQueue,a!==null&&lu(r,a.retryQueue),a=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),l=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(l=r.memoizedState.cachePool.pool),l!==a&&(r.flags|=2048),i!==null&&G(Us),null;case 24:return a=null,i!==null&&(a=i.memoizedState.cache),r.memoizedState.cache!==a&&(r.flags|=2048),xi(At),tt(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function hM(i,r){switch(Kf(r),r.tag){case 1:return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 3:return xi(At),un(),i=r.flags,(i&65536)!==0&&(i&128)===0?(r.flags=i&-65537|128,r):null;case 26:case 27:case 5:return ge(r),null;case 13:if(Ti(r),i=r.memoizedState,i!==null&&i.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Jo()}return i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 19:return G(Tt),null;case 4:return un(),null;case 10:return xi(r.type),null;case 22:case 23:return Ti(r),nd(),i!==null&&G(Us),i=r.flags,i&65536?(r.flags=i&-65537|128,r):null;case 24:return xi(At),null;case 25:return null;default:return null}}function av(i,r){switch(Kf(r),r.tag){case 3:xi(At),un();break;case 26:case 27:case 5:ge(r);break;case 4:un();break;case 13:Ti(r);break;case 19:G(Tt);break;case 10:xi(r.type);break;case 22:case 23:Ti(r),nd(),i!==null&&G(Us);break;case 24:xi(At)}}function pa(i,r){try{var a=r.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var f=l.next;a=f;do{if((a.tag&i)===i){l=void 0;var m=a.create,b=a.inst;l=m(),b.destroy=l}a=a.next}while(a!==f)}}catch(w){Ie(r,r.return,w)}}function ns(i,r,a){try{var l=r.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var m=f.next;l=m;do{if((l.tag&i)===i){var b=l.inst,w=b.destroy;if(w!==void 0){b.destroy=void 0,f=r;var R=a,N=w;try{N()}catch(q){Ie(f,R,q)}}}l=l.next}while(l!==m)}}catch(q){Ie(r,r.return,q)}}function lv(i){var r=i.updateQueue;if(r!==null){var a=i.stateNode;try{Xg(r,a)}catch(l){Ie(i,i.return,l)}}}function uv(i,r,a){a.props=Ks(i.type,i.memoizedProps),a.state=i.memoizedState;try{a.componentWillUnmount()}catch(l){Ie(i,r,l)}}function ma(i,r){try{var a=i.ref;if(a!==null){switch(i.tag){case 26:case 27:case 5:var l=i.stateNode;break;case 30:l=i.stateNode;break;default:l=i.stateNode}typeof a=="function"?i.refCleanup=a(l):a.current=l}}catch(f){Ie(i,r,f)}}function Zn(i,r){var a=i.ref,l=i.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(f){Ie(i,r,f)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(f){Ie(i,r,f)}else a.current=null}function cv(i){var r=i.type,a=i.memoizedProps,l=i.stateNode;try{e:switch(r){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(f){Ie(i,i.return,f)}}function Cd(i,r,a){try{var l=i.stateNode;$M(l,i.type,a,r),l[Wt]=r}catch(f){Ie(i,i.return,f)}}function fv(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&cs(i.type)||i.tag===4}function kd(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||fv(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&cs(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Dd(i,r,a){var l=i.tag;if(l===5||l===6)i=i.stateNode,r?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,r):(r=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,r.appendChild(i),a=a._reactRootContainer,a!=null||r.onclick!==null||(r.onclick=Su));else if(l!==4&&(l===27&&cs(i.type)&&(a=i.stateNode,r=null),i=i.child,i!==null))for(Dd(i,r,a),i=i.sibling;i!==null;)Dd(i,r,a),i=i.sibling}function uu(i,r,a){var l=i.tag;if(l===5||l===6)i=i.stateNode,r?a.insertBefore(i,r):a.appendChild(i);else if(l!==4&&(l===27&&cs(i.type)&&(a=i.stateNode),i=i.child,i!==null))for(uu(i,r,a),i=i.sibling;i!==null;)uu(i,r,a),i=i.sibling}function dv(i){var r=i.stateNode,a=i.memoizedProps;try{for(var l=i.type,f=r.attributes;f.length;)r.removeAttributeNode(f[0]);zt(r,l,a),r[Kt]=i,r[Wt]=a}catch(m){Ie(i,i.return,m)}}var Oi=!1,dt=!1,Nd=!1,hv=typeof WeakSet=="function"?WeakSet:Set,Nt=null;function pM(i,r){if(i=i.containerInfo,ih=Ou,i=Tg(i),kf(i)){if("selectionStart"in i)var a={start:i.selectionStart,end:i.selectionEnd};else e:{a=(a=i.ownerDocument)&&a.defaultView||window;var l=a.getSelection&&a.getSelection();if(l&&l.rangeCount!==0){a=l.anchorNode;var f=l.anchorOffset,m=l.focusNode;l=l.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var b=0,w=-1,R=-1,N=0,q=0,I=i,B=null;t:for(;;){for(var j;I!==a||f!==0&&I.nodeType!==3||(w=b+f),I!==m||l!==0&&I.nodeType!==3||(R=b+l),I.nodeType===3&&(b+=I.nodeValue.length),(j=I.firstChild)!==null;)B=I,I=j;for(;;){if(I===i)break t;if(B===a&&++N===f&&(w=b),B===m&&++q===l&&(R=b),(j=I.nextSibling)!==null)break;I=B,B=I.parentNode}I=j}a=w===-1||R===-1?null:{start:w,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(sh={focusedElem:i,selectionRange:a},Ou=!1,Nt=r;Nt!==null;)if(r=Nt,i=r.child,(r.subtreeFlags&1024)!==0&&i!==null)i.return=r,Nt=i;else for(;Nt!==null;){switch(r=Nt,m=r.alternate,i=r.flags,r.tag){case 0:break;case 11:case 15:break;case 1:if((i&1024)!==0&&m!==null){i=void 0,a=r,f=m.memoizedProps,m=m.memoizedState,l=a.stateNode;try{var de=Ks(a.type,f,a.elementType===a.type);i=l.getSnapshotBeforeUpdate(de,m),l.__reactInternalSnapshotBeforeUpdate=i}catch(le){Ie(a,a.return,le)}}break;case 3:if((i&1024)!==0){if(i=r.stateNode.containerInfo,a=i.nodeType,a===9)ah(i);else if(a===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":ah(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(s(163))}if(i=r.sibling,i!==null){i.return=r.return,Nt=i;break}Nt=r.return}}function pv(i,r,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:is(i,a),l&4&&pa(5,a);break;case 1:if(is(i,a),l&4)if(i=a.stateNode,r===null)try{i.componentDidMount()}catch(b){Ie(a,a.return,b)}else{var f=Ks(a.type,r.memoizedProps);r=r.memoizedState;try{i.componentDidUpdate(f,r,i.__reactInternalSnapshotBeforeUpdate)}catch(b){Ie(a,a.return,b)}}l&64&&lv(a),l&512&&ma(a,a.return);break;case 3:if(is(i,a),l&64&&(i=a.updateQueue,i!==null)){if(r=null,a.child!==null)switch(a.child.tag){case 27:case 5:r=a.child.stateNode;break;case 1:r=a.child.stateNode}try{Xg(i,r)}catch(b){Ie(a,a.return,b)}}break;case 27:r===null&&l&4&&dv(a);case 26:case 5:is(i,a),r===null&&l&4&&cv(a),l&512&&ma(a,a.return);break;case 12:is(i,a);break;case 13:is(i,a),l&4&&gv(i,a),l&64&&(i=a.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(a=AM.bind(null,a),qM(i,a))));break;case 22:if(l=a.memoizedState!==null||Oi,!l){r=r!==null&&r.memoizedState!==null||dt,f=Oi;var m=dt;Oi=l,(dt=r)&&!m?ss(i,a,(a.subtreeFlags&8772)!==0):is(i,a),Oi=f,dt=m}break;case 30:break;default:is(i,a)}}function mv(i){var r=i.alternate;r!==null&&(i.alternate=null,mv(r)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(r=i.stateNode,r!==null&&df(r)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var We=null,nn=!1;function Mi(i,r,a){for(a=a.child;a!==null;)yv(i,r,a),a=a.sibling}function yv(i,r,a){if(cn&&typeof cn.onCommitFiberUnmount=="function")try{cn.onCommitFiberUnmount(Lo,a)}catch{}switch(a.tag){case 26:dt||Zn(a,r),Mi(i,r,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:dt||Zn(a,r);var l=We,f=nn;cs(a.type)&&(We=a.stateNode,nn=!1),Mi(i,r,a),Ta(a.stateNode),We=l,nn=f;break;case 5:dt||Zn(a,r);case 6:if(l=We,f=nn,We=null,Mi(i,r,a),We=l,nn=f,We!==null)if(nn)try{(We.nodeType===9?We.body:We.nodeName==="HTML"?We.ownerDocument.body:We).removeChild(a.stateNode)}catch(m){Ie(a,r,m)}else try{We.removeChild(a.stateNode)}catch(m){Ie(a,r,m)}break;case 18:We!==null&&(nn?(i=We,s0(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,a.stateNode),Da(i)):s0(We,a.stateNode));break;case 4:l=We,f=nn,We=a.stateNode.containerInfo,nn=!0,Mi(i,r,a),We=l,nn=f;break;case 0:case 11:case 14:case 15:dt||ns(2,a,r),dt||ns(4,a,r),Mi(i,r,a);break;case 1:dt||(Zn(a,r),l=a.stateNode,typeof l.componentWillUnmount=="function"&&uv(a,r,l)),Mi(i,r,a);break;case 21:Mi(i,r,a);break;case 22:dt=(l=dt)||a.memoizedState!==null,Mi(i,r,a),dt=l;break;default:Mi(i,r,a)}}function gv(i,r){if(r.memoizedState===null&&(i=r.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{Da(i)}catch(a){Ie(r,r.return,a)}}function mM(i){switch(i.tag){case 13:case 19:var r=i.stateNode;return r===null&&(r=i.stateNode=new hv),r;case 22:return i=i.stateNode,r=i._retryCache,r===null&&(r=i._retryCache=new hv),r;default:throw Error(s(435,i.tag))}}function $d(i,r){var a=mM(i);r.forEach(function(l){var f=TM.bind(null,i,l);a.has(l)||(a.add(l),l.then(f,f))})}function pn(i,r){var a=r.deletions;if(a!==null)for(var l=0;l<a.length;l++){var f=a[l],m=i,b=r,w=b;e:for(;w!==null;){switch(w.tag){case 27:if(cs(w.type)){We=w.stateNode,nn=!1;break e}break;case 5:We=w.stateNode,nn=!1;break e;case 3:case 4:We=w.stateNode.containerInfo,nn=!0;break e}w=w.return}if(We===null)throw Error(s(160));yv(m,b,f),We=null,nn=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)bv(r,i),r=r.sibling}var Un=null;function bv(i,r){var a=i.alternate,l=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:pn(r,i),mn(i),l&4&&(ns(3,i,i.return),pa(3,i),ns(5,i,i.return));break;case 1:pn(r,i),mn(i),l&512&&(dt||a===null||Zn(a,a.return)),l&64&&Oi&&(i=i.updateQueue,i!==null&&(l=i.callbacks,l!==null&&(a=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=a===null?l:a.concat(l))));break;case 26:var f=Un;if(pn(r,i),mn(i),l&512&&(dt||a===null||Zn(a,a.return)),l&4){var m=a!==null?a.memoizedState:null;if(l=i.memoizedState,a===null)if(l===null)if(i.stateNode===null){e:{l=i.type,a=i.memoizedProps,f=f.ownerDocument||f;t:switch(l){case"title":m=f.getElementsByTagName("title")[0],(!m||m[zo]||m[Kt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(l),f.head.insertBefore(m,f.querySelector("head > title"))),zt(m,l,a),m[Kt]=i,kt(m),l=m;break e;case"link":var b=d0("link","href",f).get(l+(a.href||""));if(b){for(var w=0;w<b.length;w++)if(m=b[w],m.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&m.getAttribute("rel")===(a.rel==null?null:a.rel)&&m.getAttribute("title")===(a.title==null?null:a.title)&&m.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){b.splice(w,1);break t}}m=f.createElement(l),zt(m,l,a),f.head.appendChild(m);break;case"meta":if(b=d0("meta","content",f).get(l+(a.content||""))){for(w=0;w<b.length;w++)if(m=b[w],m.getAttribute("content")===(a.content==null?null:""+a.content)&&m.getAttribute("name")===(a.name==null?null:a.name)&&m.getAttribute("property")===(a.property==null?null:a.property)&&m.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&m.getAttribute("charset")===(a.charSet==null?null:a.charSet)){b.splice(w,1);break t}}m=f.createElement(l),zt(m,l,a),f.head.appendChild(m);break;default:throw Error(s(468,l))}m[Kt]=i,kt(m),l=m}i.stateNode=l}else h0(f,i.type,i.stateNode);else i.stateNode=f0(f,l,i.memoizedProps);else m!==l?(m===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):m.count--,l===null?h0(f,i.type,i.stateNode):f0(f,l,i.memoizedProps)):l===null&&i.stateNode!==null&&Cd(i,i.memoizedProps,a.memoizedProps)}break;case 27:pn(r,i),mn(i),l&512&&(dt||a===null||Zn(a,a.return)),a!==null&&l&4&&Cd(i,i.memoizedProps,a.memoizedProps);break;case 5:if(pn(r,i),mn(i),l&512&&(dt||a===null||Zn(a,a.return)),i.flags&32){f=i.stateNode;try{Sr(f,"")}catch(j){Ie(i,i.return,j)}}l&4&&i.stateNode!=null&&(f=i.memoizedProps,Cd(i,f,a!==null?a.memoizedProps:f)),l&1024&&(Nd=!0);break;case 6:if(pn(r,i),mn(i),l&4){if(i.stateNode===null)throw Error(s(162));l=i.memoizedProps,a=i.stateNode;try{a.nodeValue=l}catch(j){Ie(i,i.return,j)}}break;case 3:if(Tu=null,f=Un,Un=xu(r.containerInfo),pn(r,i),Un=f,mn(i),l&4&&a!==null&&a.memoizedState.isDehydrated)try{Da(r.containerInfo)}catch(j){Ie(i,i.return,j)}Nd&&(Nd=!1,vv(i));break;case 4:l=Un,Un=xu(i.stateNode.containerInfo),pn(r,i),mn(i),Un=l;break;case 12:pn(r,i),mn(i);break;case 13:pn(r,i),mn(i),i.child.flags&8192&&i.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ud=ct()),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,$d(i,l)));break;case 22:f=i.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,N=Oi,q=dt;if(Oi=N||f,dt=q||R,pn(r,i),dt=q,Oi=N,mn(i),l&8192)e:for(r=i.stateNode,r._visibility=f?r._visibility&-2:r._visibility|1,f&&(a===null||R||Oi||dt||Ps(i)),a=null,r=i;;){if(r.tag===5||r.tag===26){if(a===null){R=a=r;try{if(m=R.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{w=R.stateNode;var I=R.memoizedProps.style,B=I!=null&&I.hasOwnProperty("display")?I.display:null;w.style.display=B==null||typeof B=="boolean"?"":(""+B).trim()}}catch(j){Ie(R,R.return,j)}}}else if(r.tag===6){if(a===null){R=r;try{R.stateNode.nodeValue=f?"":R.memoizedProps}catch(j){Ie(R,R.return,j)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===i)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;a===r&&(a=null),r=r.return}a===r&&(a=null),r.sibling.return=r.return,r=r.sibling}l&4&&(l=i.updateQueue,l!==null&&(a=l.retryQueue,a!==null&&(l.retryQueue=null,$d(i,a))));break;case 19:pn(r,i),mn(i),l&4&&(l=i.updateQueue,l!==null&&(i.updateQueue=null,$d(i,l)));break;case 30:break;case 21:break;default:pn(r,i),mn(i)}}function mn(i){var r=i.flags;if(r&2){try{for(var a,l=i.return;l!==null;){if(fv(l)){a=l;break}l=l.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var f=a.stateNode,m=kd(i);uu(i,m,f);break;case 5:var b=a.stateNode;a.flags&32&&(Sr(b,""),a.flags&=-33);var w=kd(i);uu(i,w,b);break;case 3:case 4:var R=a.stateNode.containerInfo,N=kd(i);Dd(i,N,R);break;default:throw Error(s(161))}}catch(q){Ie(i,i.return,q)}i.flags&=-3}r&4096&&(i.flags&=-4097)}function vv(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var r=i;vv(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),i=i.sibling}}function is(i,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)pv(i,r.alternate,r),r=r.sibling}function Ps(i){for(i=i.child;i!==null;){var r=i;switch(r.tag){case 0:case 11:case 14:case 15:ns(4,r,r.return),Ps(r);break;case 1:Zn(r,r.return);var a=r.stateNode;typeof a.componentWillUnmount=="function"&&uv(r,r.return,a),Ps(r);break;case 27:Ta(r.stateNode);case 26:case 5:Zn(r,r.return),Ps(r);break;case 22:r.memoizedState===null&&Ps(r);break;case 30:Ps(r);break;default:Ps(r)}i=i.sibling}}function ss(i,r,a){for(a=a&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var l=r.alternate,f=i,m=r,b=m.flags;switch(m.tag){case 0:case 11:case 15:ss(f,m,a),pa(4,m);break;case 1:if(ss(f,m,a),l=m,f=l.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(N){Ie(l,l.return,N)}if(l=m,f=l.updateQueue,f!==null){var w=l.stateNode;try{var R=f.shared.hiddenCallbacks;if(R!==null)for(f.shared.hiddenCallbacks=null,f=0;f<R.length;f++)Yg(R[f],w)}catch(N){Ie(l,l.return,N)}}a&&b&64&&lv(m),ma(m,m.return);break;case 27:dv(m);case 26:case 5:ss(f,m,a),a&&l===null&&b&4&&cv(m),ma(m,m.return);break;case 12:ss(f,m,a);break;case 13:ss(f,m,a),a&&b&4&&gv(f,m);break;case 22:m.memoizedState===null&&ss(f,m,a),ma(m,m.return);break;case 30:break;default:ss(f,m,a)}r=r.sibling}}function Bd(i,r){var a=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),i=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(i=r.memoizedState.cachePool.pool),i!==a&&(i!=null&&i.refCount++,a!=null&&ea(a))}function Ld(i,r){i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&ea(i))}function Jn(i,r,a,l){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Sv(i,r,a,l),r=r.sibling}function Sv(i,r,a,l){var f=r.flags;switch(r.tag){case 0:case 11:case 15:Jn(i,r,a,l),f&2048&&pa(9,r);break;case 1:Jn(i,r,a,l);break;case 3:Jn(i,r,a,l),f&2048&&(i=null,r.alternate!==null&&(i=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==i&&(r.refCount++,i!=null&&ea(i)));break;case 12:if(f&2048){Jn(i,r,a,l),i=r.stateNode;try{var m=r.memoizedProps,b=m.id,w=m.onPostCommit;typeof w=="function"&&w(b,r.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(R){Ie(r,r.return,R)}}else Jn(i,r,a,l);break;case 13:Jn(i,r,a,l);break;case 23:break;case 22:m=r.stateNode,b=r.alternate,r.memoizedState!==null?m._visibility&2?Jn(i,r,a,l):ya(i,r):m._visibility&2?Jn(i,r,a,l):(m._visibility|=2,zr(i,r,a,l,(r.subtreeFlags&10256)!==0)),f&2048&&Bd(b,r);break;case 24:Jn(i,r,a,l),f&2048&&Ld(r.alternate,r);break;default:Jn(i,r,a,l)}}function zr(i,r,a,l,f){for(f=f&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var m=i,b=r,w=a,R=l,N=b.flags;switch(b.tag){case 0:case 11:case 15:zr(m,b,w,R,f),pa(8,b);break;case 23:break;case 22:var q=b.stateNode;b.memoizedState!==null?q._visibility&2?zr(m,b,w,R,f):ya(m,b):(q._visibility|=2,zr(m,b,w,R,f)),f&&N&2048&&Bd(b.alternate,b);break;case 24:zr(m,b,w,R,f),f&&N&2048&&Ld(b.alternate,b);break;default:zr(m,b,w,R,f)}r=r.sibling}}function ya(i,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var a=i,l=r,f=l.flags;switch(l.tag){case 22:ya(a,l),f&2048&&Bd(l.alternate,l);break;case 24:ya(a,l),f&2048&&Ld(l.alternate,l);break;default:ya(a,l)}r=r.sibling}}var ga=8192;function Ur(i){if(i.subtreeFlags&ga)for(i=i.child;i!==null;)wv(i),i=i.sibling}function wv(i){switch(i.tag){case 26:Ur(i),i.flags&ga&&i.memoizedState!==null&&e_(Un,i.memoizedState,i.memoizedProps);break;case 5:Ur(i);break;case 3:case 4:var r=Un;Un=xu(i.stateNode.containerInfo),Ur(i),Un=r;break;case 22:i.memoizedState===null&&(r=i.alternate,r!==null&&r.memoizedState!==null?(r=ga,ga=16777216,Ur(i),ga=r):Ur(i));break;default:Ur(i)}}function xv(i){var r=i.alternate;if(r!==null&&(i=r.child,i!==null)){r.child=null;do r=i.sibling,i.sibling=null,i=r;while(i!==null)}}function ba(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];Nt=l,Tv(l,i)}xv(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Av(i),i=i.sibling}function Av(i){switch(i.tag){case 0:case 11:case 15:ba(i),i.flags&2048&&ns(9,i,i.return);break;case 3:ba(i);break;case 12:ba(i);break;case 22:var r=i.stateNode;i.memoizedState!==null&&r._visibility&2&&(i.return===null||i.return.tag!==13)?(r._visibility&=-3,cu(i)):ba(i);break;default:ba(i)}}function cu(i){var r=i.deletions;if((i.flags&16)!==0){if(r!==null)for(var a=0;a<r.length;a++){var l=r[a];Nt=l,Tv(l,i)}xv(i)}for(i=i.child;i!==null;){switch(r=i,r.tag){case 0:case 11:case 15:ns(8,r,r.return),cu(r);break;case 22:a=r.stateNode,a._visibility&2&&(a._visibility&=-3,cu(r));break;default:cu(r)}i=i.sibling}}function Tv(i,r){for(;Nt!==null;){var a=Nt;switch(a.tag){case 0:case 11:case 15:ns(8,a,r);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:ea(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Nt=l;else e:for(a=i;Nt!==null;){l=Nt;var f=l.sibling,m=l.return;if(mv(l),l===a){Nt=null;break e}if(f!==null){f.return=m,Nt=f;break e}Nt=m}}}var yM={getCacheForType:function(i){var r=Pt(At),a=r.data.get(i);return a===void 0&&(a=i(),r.data.set(i,a)),a}},gM=typeof WeakMap=="function"?WeakMap:Map,je=0,Ye=null,Oe=null,De=0,ze=0,yn=null,rs=!1,qr=!1,Vd=!1,_i=0,ot=0,os=0,Is=0,jd=0,Cn=0,Kr=0,va=null,sn=null,zd=!1,Ud=0,fu=1/0,du=null,as=null,jt=0,ls=null,Pr=null,Ir=0,qd=0,Kd=null,Ev=null,Sa=0,Pd=null;function gn(){if((je&2)!==0&&De!==0)return De&-De;if(L.T!==null){var i=kr;return i!==0?i:Zd()}return qy()}function Rv(){Cn===0&&(Cn=(De&536870912)===0||Le?Vy():536870912);var i=_n.current;return i!==null&&(i.flags|=32),Cn}function bn(i,r,a){(i===Ye&&(ze===2||ze===9)||i.cancelPendingCommit!==null)&&(Hr(i,0),us(i,De,Cn,!1)),jo(i,a),((je&2)===0||i!==Ye)&&(i===Ye&&((je&2)===0&&(Is|=a),ot===4&&us(i,De,Cn,!1)),Qn(i))}function Ov(i,r,a){if((je&6)!==0)throw Error(s(327));var l=!a&&(r&124)===0&&(r&i.expiredLanes)===0||Vo(i,r),f=l?SM(i,r):Fd(i,r,!0),m=l;do{if(f===0){qr&&!l&&us(i,r,0,!1);break}else{if(a=i.current.alternate,m&&!bM(a)){f=Fd(i,r,!1),m=!1;continue}if(f===2){if(m=r,i.errorRecoveryDisabledLanes&m)var b=0;else b=i.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){r=b;e:{var w=i;f=va;var R=w.current.memoizedState.isDehydrated;if(R&&(Hr(w,b).flags|=256),b=Fd(w,b,!1),b!==2){if(Vd&&!R){w.errorRecoveryDisabledLanes|=m,Is|=m,f=4;break e}m=sn,sn=f,m!==null&&(sn===null?sn=m:sn.push.apply(sn,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Hr(i,0),us(i,r,0,!0);break}e:{switch(l=i,m=f,m){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:us(l,r,Cn,!rs);break e;case 2:sn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(f=Ud+300-ct(),10<f)){if(us(l,r,Cn,!rs),Al(l,0,!0)!==0)break e;l.timeoutHandle=n0(Mv.bind(null,l,a,sn,du,zd,r,Cn,Is,Kr,rs,m,2,-0,0),f);break e}Mv(l,a,sn,du,zd,r,Cn,Is,Kr,rs,m,0,-0,0)}}break}while(!0);Qn(i)}function Mv(i,r,a,l,f,m,b,w,R,N,q,I,B,j){if(i.timeoutHandle=-1,I=r.subtreeFlags,(I&8192||(I&16785408)===16785408)&&(Oa={stylesheets:null,count:0,unsuspend:WM},wv(r),I=t_(),I!==null)){i.cancelPendingCommit=I(Bv.bind(null,i,r,m,a,l,f,b,w,R,q,1,B,j)),us(i,m,b,!N);return}Bv(i,r,m,a,l,f,b,w,R)}function bM(i){for(var r=i;;){var a=r.tag;if((a===0||a===11||a===15)&&r.flags&16384&&(a=r.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var l=0;l<a.length;l++){var f=a[l],m=f.getSnapshot;f=f.value;try{if(!dn(m(),f))return!1}catch{return!1}}if(a=r.child,r.subtreeFlags&16384&&a!==null)a.return=r,r=a;else{if(r===i)break;for(;r.sibling===null;){if(r.return===null||r.return===i)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function us(i,r,a,l){r&=~jd,r&=~Is,i.suspendedLanes|=r,i.pingedLanes&=~r,l&&(i.warmLanes|=r),l=i.expirationTimes;for(var f=r;0<f;){var m=31-fn(f),b=1<<m;l[m]=-1,f&=~b}a!==0&&zy(i,a,r)}function hu(){return(je&6)===0?(wa(0),!1):!0}function Id(){if(Oe!==null){if(ze===0)var i=Oe.return;else i=Oe,wi=js=null,ad(i),Vr=null,fa=0,i=Oe;for(;i!==null;)av(i.alternate,i),i=i.return;Oe=null}}function Hr(i,r){var a=i.timeoutHandle;a!==-1&&(i.timeoutHandle=-1,LM(a)),a=i.cancelPendingCommit,a!==null&&(i.cancelPendingCommit=null,a()),Id(),Ye=i,Oe=a=bi(i.current,null),De=r,ze=0,yn=null,rs=!1,qr=Vo(i,r),Vd=!1,Kr=Cn=jd=Is=os=ot=0,sn=va=null,zd=!1,(r&8)!==0&&(r|=r&32);var l=i.entangledLanes;if(l!==0)for(i=i.entanglements,l&=r;0<l;){var f=31-fn(l),m=1<<f;r|=i[f],l&=~m}return _i=r,Bl(),a}function _v(i,r){Te=null,L.H=eu,r===na||r===Il?(r=Fg(),ze=3):r===Pg?(r=Fg(),ze=4):ze=r===Gb?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,yn=r,Oe===null&&(ot=1,ru(i,En(r,i.current)))}function Cv(){var i=L.H;return L.H=eu,i===null?eu:i}function kv(){var i=L.A;return L.A=yM,i}function Hd(){ot=4,rs||(De&4194048)!==De&&_n.current!==null||(qr=!0),(os&134217727)===0&&(Is&134217727)===0||Ye===null||us(Ye,De,Cn,!1)}function Fd(i,r,a){var l=je;je|=2;var f=Cv(),m=kv();(Ye!==i||De!==r)&&(du=null,Hr(i,r)),r=!1;var b=ot;e:do try{if(ze!==0&&Oe!==null){var w=Oe,R=yn;switch(ze){case 8:Id(),b=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(r=!0);var N=ze;if(ze=0,yn=null,Fr(i,w,R,N),a&&qr){b=0;break e}break;default:N=ze,ze=0,yn=null,Fr(i,w,R,N)}}vM(),b=ot;break}catch(q){_v(i,q)}while(!0);return r&&i.shellSuspendCounter++,wi=js=null,je=l,L.H=f,L.A=m,Oe===null&&(Ye=null,De=0,Bl()),b}function vM(){for(;Oe!==null;)Dv(Oe)}function SM(i,r){var a=je;je|=2;var l=Cv(),f=kv();Ye!==i||De!==r?(du=null,fu=ct()+500,Hr(i,r)):qr=Vo(i,r);e:do try{if(ze!==0&&Oe!==null){r=Oe;var m=yn;t:switch(ze){case 1:ze=0,yn=null,Fr(i,r,m,1);break;case 2:case 9:if(Ig(m)){ze=0,yn=null,Nv(r);break}r=function(){ze!==2&&ze!==9||Ye!==i||(ze=7),Qn(i)},m.then(r,r);break e;case 3:ze=7;break e;case 4:ze=5;break e;case 7:Ig(m)?(ze=0,yn=null,Nv(r)):(ze=0,yn=null,Fr(i,r,m,7));break;case 5:var b=null;switch(Oe.tag){case 26:b=Oe.memoizedState;case 5:case 27:var w=Oe;if(!b||p0(b)){ze=0,yn=null;var R=w.sibling;if(R!==null)Oe=R;else{var N=w.return;N!==null?(Oe=N,pu(N)):Oe=null}break t}}ze=0,yn=null,Fr(i,r,m,5);break;case 6:ze=0,yn=null,Fr(i,r,m,6);break;case 8:Id(),ot=6;break e;default:throw Error(s(462))}}wM();break}catch(q){_v(i,q)}while(!0);return wi=js=null,L.H=l,L.A=f,je=a,Oe!==null?0:(Ye=null,De=0,Bl(),ot)}function wM(){for(;Oe!==null&&!_t();)Dv(Oe)}function Dv(i){var r=rv(i.alternate,i,_i);i.memoizedProps=i.pendingProps,r===null?pu(i):Oe=r}function Nv(i){var r=i,a=r.alternate;switch(r.tag){case 15:case 0:r=Wb(a,r,r.pendingProps,r.type,void 0,De);break;case 11:r=Wb(a,r,r.pendingProps,r.type.render,r.ref,De);break;case 5:ad(r);default:av(a,r),r=Oe=$g(r,_i),r=rv(a,r,_i)}i.memoizedProps=i.pendingProps,r===null?pu(i):Oe=r}function Fr(i,r,a,l){wi=js=null,ad(r),Vr=null,fa=0;var f=r.return;try{if(cM(i,f,r,a,De)){ot=1,ru(i,En(a,i.current)),Oe=null;return}}catch(m){if(f!==null)throw Oe=f,m;ot=1,ru(i,En(a,i.current)),Oe=null;return}r.flags&32768?(Le||l===1?i=!0:qr||(De&536870912)!==0?i=!1:(rs=i=!0,(l===2||l===9||l===3||l===6)&&(l=_n.current,l!==null&&l.tag===13&&(l.flags|=16384))),$v(r,i)):pu(r)}function pu(i){var r=i;do{if((r.flags&32768)!==0){$v(r,rs);return}i=r.return;var a=dM(r.alternate,r,_i);if(a!==null){Oe=a;return}if(r=r.sibling,r!==null){Oe=r;return}Oe=r=i}while(r!==null);ot===0&&(ot=5)}function $v(i,r){do{var a=hM(i.alternate,i);if(a!==null){a.flags&=32767,Oe=a;return}if(a=i.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!r&&(i=i.sibling,i!==null)){Oe=i;return}Oe=i=a}while(i!==null);ot=6,Oe=null}function Bv(i,r,a,l,f,m,b,w,R){i.cancelPendingCommit=null;do mu();while(jt!==0);if((je&6)!==0)throw Error(s(327));if(r!==null){if(r===i.current)throw Error(s(177));if(m=r.lanes|r.childLanes,m|=Lf,WR(i,a,m,b,w,R),i===Ye&&(Oe=Ye=null,De=0),Pr=r,ls=i,Ir=a,qd=m,Kd=f,Ev=l,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,EM(Os,function(){return Uv(),null})):(i.callbackNode=null,i.callbackPriority=0),l=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||l){l=L.T,L.T=null,f=P.p,P.p=2,b=je,je|=4;try{pM(i,r,a)}finally{je=b,P.p=f,L.T=l}}jt=1,Lv(),Vv(),jv()}}function Lv(){if(jt===1){jt=0;var i=ls,r=Pr,a=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||a){a=L.T,L.T=null;var l=P.p;P.p=2;var f=je;je|=4;try{bv(r,i);var m=sh,b=Tg(i.containerInfo),w=m.focusedElem,R=m.selectionRange;if(b!==w&&w&&w.ownerDocument&&Ag(w.ownerDocument.documentElement,w)){if(R!==null&&kf(w)){var N=R.start,q=R.end;if(q===void 0&&(q=N),"selectionStart"in w)w.selectionStart=N,w.selectionEnd=Math.min(q,w.value.length);else{var I=w.ownerDocument||document,B=I&&I.defaultView||window;if(B.getSelection){var j=B.getSelection(),de=w.textContent.length,le=Math.min(R.start,de),Ke=R.end===void 0?le:Math.min(R.end,de);!j.extend&&le>Ke&&(b=Ke,Ke=le,le=b);var C=xg(w,le),O=xg(w,Ke);if(C&&O&&(j.rangeCount!==1||j.anchorNode!==C.node||j.anchorOffset!==C.offset||j.focusNode!==O.node||j.focusOffset!==O.offset)){var k=I.createRange();k.setStart(C.node,C.offset),j.removeAllRanges(),le>Ke?(j.addRange(k),j.extend(O.node,O.offset)):(k.setEnd(O.node,O.offset),j.addRange(k))}}}}for(I=[],j=w;j=j.parentNode;)j.nodeType===1&&I.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<I.length;w++){var K=I[w];K.element.scrollLeft=K.left,K.element.scrollTop=K.top}}Ou=!!ih,sh=ih=null}finally{je=f,P.p=l,L.T=a}}i.current=r,jt=2}}function Vv(){if(jt===2){jt=0;var i=ls,r=Pr,a=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||a){a=L.T,L.T=null;var l=P.p;P.p=2;var f=je;je|=4;try{pv(i,r.alternate,r)}finally{je=f,P.p=l,L.T=a}}jt=3}}function jv(){if(jt===4||jt===3){jt=0,xt();var i=ls,r=Pr,a=Ir,l=Ev;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?jt=5:(jt=0,Pr=ls=null,zv(i,i.pendingLanes));var f=i.pendingLanes;if(f===0&&(as=null),cf(a),r=r.stateNode,cn&&typeof cn.onCommitFiberRoot=="function")try{cn.onCommitFiberRoot(Lo,r,void 0,(r.current.flags&128)===128)}catch{}if(l!==null){r=L.T,f=P.p,P.p=2,L.T=null;try{for(var m=i.onRecoverableError,b=0;b<l.length;b++){var w=l[b];m(w.value,{componentStack:w.stack})}}finally{L.T=r,P.p=f}}(Ir&3)!==0&&mu(),Qn(i),f=i.pendingLanes,(a&4194090)!==0&&(f&42)!==0?i===Pd?Sa++:(Sa=0,Pd=i):Sa=0,wa(0)}}function zv(i,r){(i.pooledCacheLanes&=r)===0&&(r=i.pooledCache,r!=null&&(i.pooledCache=null,ea(r)))}function mu(i){return Lv(),Vv(),jv(),Uv()}function Uv(){if(jt!==5)return!1;var i=ls,r=qd;qd=0;var a=cf(Ir),l=L.T,f=P.p;try{P.p=32>a?32:a,L.T=null,a=Kd,Kd=null;var m=ls,b=Ir;if(jt=0,Pr=ls=null,Ir=0,(je&6)!==0)throw Error(s(331));var w=je;if(je|=4,Av(m.current),Sv(m,m.current,b,a),je=w,wa(0,!1),cn&&typeof cn.onPostCommitFiberRoot=="function")try{cn.onPostCommitFiberRoot(Lo,m)}catch{}return!0}finally{P.p=f,L.T=l,zv(i,r)}}function qv(i,r,a){r=En(a,r),r=wd(i.stateNode,r,2),i=Qi(i,r,2),i!==null&&(jo(i,2),Qn(i))}function Ie(i,r,a){if(i.tag===3)qv(i,i,a);else for(;r!==null;){if(r.tag===3){qv(r,i,a);break}else if(r.tag===1){var l=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(as===null||!as.has(l))){i=En(a,i),a=Hb(2),l=Qi(r,a,2),l!==null&&(Fb(a,l,r,i),jo(l,2),Qn(l));break}}r=r.return}}function Gd(i,r,a){var l=i.pingCache;if(l===null){l=i.pingCache=new gM;var f=new Set;l.set(r,f)}else f=l.get(r),f===void 0&&(f=new Set,l.set(r,f));f.has(a)||(Vd=!0,f.add(a),i=xM.bind(null,i,r,a),r.then(i,i))}function xM(i,r,a){var l=i.pingCache;l!==null&&l.delete(r),i.pingedLanes|=i.suspendedLanes&a,i.warmLanes&=~a,Ye===i&&(De&a)===a&&(ot===4||ot===3&&(De&62914560)===De&&300>ct()-Ud?(je&2)===0&&Hr(i,0):jd|=a,Kr===De&&(Kr=0)),Qn(i)}function Kv(i,r){r===0&&(r=jy()),i=Or(i,r),i!==null&&(jo(i,r),Qn(i))}function AM(i){var r=i.memoizedState,a=0;r!==null&&(a=r.retryLane),Kv(i,a)}function TM(i,r){var a=0;switch(i.tag){case 13:var l=i.stateNode,f=i.memoizedState;f!==null&&(a=f.retryLane);break;case 19:l=i.stateNode;break;case 22:l=i.stateNode._retryCache;break;default:throw Error(s(314))}l!==null&&l.delete(r),Kv(i,a)}function EM(i,r){return xe(i,r)}var yu=null,Gr=null,Yd=!1,gu=!1,Xd=!1,Hs=0;function Qn(i){i!==Gr&&i.next===null&&(Gr===null?yu=Gr=i:Gr=Gr.next=i),gu=!0,Yd||(Yd=!0,OM())}function wa(i,r){if(!Xd&&gu){Xd=!0;do for(var a=!1,l=yu;l!==null;){if(i!==0){var f=l.pendingLanes;if(f===0)var m=0;else{var b=l.suspendedLanes,w=l.pingedLanes;m=(1<<31-fn(42|i)+1)-1,m&=f&~(b&~w),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(a=!0,Fv(l,m))}else m=De,m=Al(l,l===Ye?m:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(m&3)===0||Vo(l,m)||(a=!0,Fv(l,m));l=l.next}while(a);Xd=!1}}function RM(){Pv()}function Pv(){gu=Yd=!1;var i=0;Hs!==0&&(BM()&&(i=Hs),Hs=0);for(var r=ct(),a=null,l=yu;l!==null;){var f=l.next,m=Iv(l,r);m===0?(l.next=null,a===null?yu=f:a.next=f,f===null&&(Gr=a)):(a=l,(i!==0||(m&3)!==0)&&(gu=!0)),l=f}wa(i)}function Iv(i,r){for(var a=i.suspendedLanes,l=i.pingedLanes,f=i.expirationTimes,m=i.pendingLanes&-62914561;0<m;){var b=31-fn(m),w=1<<b,R=f[b];R===-1?((w&a)===0||(w&l)!==0)&&(f[b]=QR(w,r)):R<=r&&(i.expiredLanes|=w),m&=~w}if(r=Ye,a=De,a=Al(i,i===r?a:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l=i.callbackNode,a===0||i===r&&(ze===2||ze===9)||i.cancelPendingCommit!==null)return l!==null&&l!==null&&Ae(l),i.callbackNode=null,i.callbackPriority=0;if((a&3)===0||Vo(i,a)){if(r=a&-a,r===i.callbackPriority)return r;switch(l!==null&&Ae(l),cf(a)){case 2:case 8:a=et;break;case 32:a=Os;break;case 268435456:a=Ly;break;default:a=Os}return l=Hv.bind(null,i),a=xe(a,l),i.callbackPriority=r,i.callbackNode=a,r}return l!==null&&l!==null&&Ae(l),i.callbackPriority=2,i.callbackNode=null,2}function Hv(i,r){if(jt!==0&&jt!==5)return i.callbackNode=null,i.callbackPriority=0,null;var a=i.callbackNode;if(mu()&&i.callbackNode!==a)return null;var l=De;return l=Al(i,i===Ye?l:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),l===0?null:(Ov(i,l,r),Iv(i,ct()),i.callbackNode!=null&&i.callbackNode===a?Hv.bind(null,i):null)}function Fv(i,r){if(mu())return null;Ov(i,r,!0)}function OM(){VM(function(){(je&6)!==0?xe(Ge,RM):Pv()})}function Zd(){return Hs===0&&(Hs=Vy()),Hs}function Gv(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ml(""+i)}function Yv(i,r){var a=r.ownerDocument.createElement("input");return a.name=r.name,a.value=r.value,i.id&&a.setAttribute("form",i.id),r.parentNode.insertBefore(a,r),i=new FormData(i),a.parentNode.removeChild(a),i}function MM(i,r,a,l,f){if(r==="submit"&&a&&a.stateNode===f){var m=Gv((f[Wt]||null).action),b=l.submitter;b&&(r=(r=b[Wt]||null)?Gv(r.formAction):b.getAttribute("formAction"),r!==null&&(m=r,b=null));var w=new Dl("action","action",null,l,f);i.push({event:w,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(Hs!==0){var R=b?Yv(f,b):new FormData(f);yd(a,{pending:!0,data:R,method:f.method,action:m},null,R)}}else typeof m=="function"&&(w.preventDefault(),R=b?Yv(f,b):new FormData(f),yd(a,{pending:!0,data:R,method:f.method,action:m},m,R))},currentTarget:f}]})}}for(var Jd=0;Jd<Bf.length;Jd++){var Qd=Bf[Jd],_M=Qd.toLowerCase(),CM=Qd[0].toUpperCase()+Qd.slice(1);zn(_M,"on"+CM)}zn(Og,"onAnimationEnd"),zn(Mg,"onAnimationIteration"),zn(_g,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(GO,"onTransitionRun"),zn(YO,"onTransitionStart"),zn(XO,"onTransitionCancel"),zn(Cg,"onTransitionEnd"),gr("onMouseEnter",["mouseout","mouseover"]),gr("onMouseLeave",["mouseout","mouseover"]),gr("onPointerEnter",["pointerout","pointerover"]),gr("onPointerLeave",["pointerout","pointerover"]),_s("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),_s("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),_s("onBeforeInput",["compositionend","keypress","textInput","paste"]),_s("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),_s("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xa="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(" "),kM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xa));function Xv(i,r){r=(r&4)!==0;for(var a=0;a<i.length;a++){var l=i[a],f=l.event;l=l.listeners;e:{var m=void 0;if(r)for(var b=l.length-1;0<=b;b--){var w=l[b],R=w.instance,N=w.currentTarget;if(w=w.listener,R!==m&&f.isPropagationStopped())break e;m=w,f.currentTarget=N;try{m(f)}catch(q){su(q)}f.currentTarget=null,m=R}else for(b=0;b<l.length;b++){if(w=l[b],R=w.instance,N=w.currentTarget,w=w.listener,R!==m&&f.isPropagationStopped())break e;m=w,f.currentTarget=N;try{m(f)}catch(q){su(q)}f.currentTarget=null,m=R}}}}function Me(i,r){var a=r[ff];a===void 0&&(a=r[ff]=new Set);var l=i+"__bubble";a.has(l)||(Zv(r,i,2,!1),a.add(l))}function Wd(i,r,a){var l=0;r&&(l|=4),Zv(a,i,l,r)}var bu="_reactListening"+Math.random().toString(36).slice(2);function eh(i){if(!i[bu]){i[bu]=!0,Py.forEach(function(a){a!=="selectionchange"&&(kM.has(a)||Wd(a,!1,i),Wd(a,!0,i))});var r=i.nodeType===9?i:i.ownerDocument;r===null||r[bu]||(r[bu]=!0,Wd("selectionchange",!1,r))}}function Zv(i,r,a,l){switch(S0(r)){case 2:var f=s_;break;case 8:f=r_;break;default:f=ph}a=f.bind(null,r,a,i),f=void 0,!xf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),l?f!==void 0?i.addEventListener(r,a,{capture:!0,passive:f}):i.addEventListener(r,a,!0):f!==void 0?i.addEventListener(r,a,{passive:f}):i.addEventListener(r,a,!1)}function th(i,r,a,l,f){var m=l;if((r&1)===0&&(r&2)===0&&l!==null)e:for(;;){if(l===null)return;var b=l.tag;if(b===3||b===4){var w=l.stateNode.containerInfo;if(w===f)break;if(b===4)for(b=l.return;b!==null;){var R=b.tag;if((R===3||R===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;w!==null;){if(b=pr(w),b===null)return;if(R=b.tag,R===5||R===6||R===26||R===27){l=m=b;continue e}w=w.parentNode}}l=l.return}ig(function(){var N=m,q=Sf(a),I=[];e:{var B=kg.get(i);if(B!==void 0){var j=Dl,de=i;switch(i){case"keypress":if(Cl(a)===0)break e;case"keydown":case"keyup":j=EO;break;case"focusin":de="focus",j=Rf;break;case"focusout":de="blur",j=Rf;break;case"beforeblur":case"afterblur":j=Rf;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":j=og;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=hO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=MO;break;case Og:case Mg:case _g:j=yO;break;case Cg:j=CO;break;case"scroll":case"scrollend":j=fO;break;case"wheel":j=DO;break;case"copy":case"cut":case"paste":j=bO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=lg;break;case"toggle":case"beforetoggle":j=$O}var le=(r&4)!==0,Ke=!le&&(i==="scroll"||i==="scrollend"),C=le?B!==null?B+"Capture":null:B;le=[];for(var O=N,k;O!==null;){var K=O;if(k=K.stateNode,K=K.tag,K!==5&&K!==26&&K!==27||k===null||C===null||(K=qo(O,C),K!=null&&le.push(Aa(O,K,k))),Ke)break;O=O.return}0<le.length&&(B=new j(B,de,null,a,q),I.push({event:B,listeners:le}))}}if((r&7)===0){e:{if(B=i==="mouseover"||i==="pointerover",j=i==="mouseout"||i==="pointerout",B&&a!==vf&&(de=a.relatedTarget||a.fromElement)&&(pr(de)||de[hr]))break e;if((j||B)&&(B=q.window===q?q:(B=q.ownerDocument)?B.defaultView||B.parentWindow:window,j?(de=a.relatedTarget||a.toElement,j=N,de=de?pr(de):null,de!==null&&(Ke=u(de),le=de.tag,de!==Ke||le!==5&&le!==27&&le!==6)&&(de=null)):(j=null,de=N),j!==de)){if(le=og,K="onMouseLeave",C="onMouseEnter",O="mouse",(i==="pointerout"||i==="pointerover")&&(le=lg,K="onPointerLeave",C="onPointerEnter",O="pointer"),Ke=j==null?B:Uo(j),k=de==null?B:Uo(de),B=new le(K,O+"leave",j,a,q),B.target=Ke,B.relatedTarget=k,K=null,pr(q)===N&&(le=new le(C,O+"enter",de,a,q),le.target=k,le.relatedTarget=Ke,K=le),Ke=K,j&&de)t:{for(le=j,C=de,O=0,k=le;k;k=Yr(k))O++;for(k=0,K=C;K;K=Yr(K))k++;for(;0<O-k;)le=Yr(le),O--;for(;0<k-O;)C=Yr(C),k--;for(;O--;){if(le===C||C!==null&&le===C.alternate)break t;le=Yr(le),C=Yr(C)}le=null}else le=null;j!==null&&Jv(I,B,j,le,!1),de!==null&&Ke!==null&&Jv(I,Ke,de,le,!0)}}e:{if(B=N?Uo(N):window,j=B.nodeName&&B.nodeName.toLowerCase(),j==="select"||j==="input"&&B.type==="file")var ne=yg;else if(pg(B))if(gg)ne=IO;else{ne=KO;var Re=qO}else j=B.nodeName,!j||j.toLowerCase()!=="input"||B.type!=="checkbox"&&B.type!=="radio"?N&&bf(N.elementType)&&(ne=yg):ne=PO;if(ne&&(ne=ne(i,N))){mg(I,ne,a,q);break e}Re&&Re(i,B,N),i==="focusout"&&N&&B.type==="number"&&N.memoizedProps.value!=null&&gf(B,"number",B.value)}switch(Re=N?Uo(N):window,i){case"focusin":(pg(Re)||Re.contentEditable==="true")&&(Tr=Re,Df=N,Xo=null);break;case"focusout":Xo=Df=Tr=null;break;case"mousedown":Nf=!0;break;case"contextmenu":case"mouseup":case"dragend":Nf=!1,Eg(I,a,q);break;case"selectionchange":if(FO)break;case"keydown":case"keyup":Eg(I,a,q)}var ae;if(Mf)e:{switch(i){case"compositionstart":var ue="onCompositionStart";break e;case"compositionend":ue="onCompositionEnd";break e;case"compositionupdate":ue="onCompositionUpdate";break e}ue=void 0}else Ar?dg(i,a)&&(ue="onCompositionEnd"):i==="keydown"&&a.keyCode===229&&(ue="onCompositionStart");ue&&(ug&&a.locale!=="ko"&&(Ar||ue!=="onCompositionStart"?ue==="onCompositionEnd"&&Ar&&(ae=sg()):(Yi=q,Af="value"in Yi?Yi.value:Yi.textContent,Ar=!0)),Re=vu(N,ue),0<Re.length&&(ue=new ag(ue,i,null,a,q),I.push({event:ue,listeners:Re}),ae?ue.data=ae:(ae=hg(a),ae!==null&&(ue.data=ae)))),(ae=LO?VO(i,a):jO(i,a))&&(ue=vu(N,"onBeforeInput"),0<ue.length&&(Re=new ag("onBeforeInput","beforeinput",null,a,q),I.push({event:Re,listeners:ue}),Re.data=ae)),MM(I,i,N,a,q)}Xv(I,r)})}function Aa(i,r,a){return{instance:i,listener:r,currentTarget:a}}function vu(i,r){for(var a=r+"Capture",l=[];i!==null;){var f=i,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=qo(i,a),f!=null&&l.unshift(Aa(i,f,m)),f=qo(i,r),f!=null&&l.push(Aa(i,f,m))),i.tag===3)return l;i=i.return}return[]}function Yr(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Jv(i,r,a,l,f){for(var m=r._reactName,b=[];a!==null&&a!==l;){var w=a,R=w.alternate,N=w.stateNode;if(w=w.tag,R!==null&&R===l)break;w!==5&&w!==26&&w!==27||N===null||(R=N,f?(N=qo(a,m),N!=null&&b.unshift(Aa(a,N,R))):f||(N=qo(a,m),N!=null&&b.push(Aa(a,N,R)))),a=a.return}b.length!==0&&i.push({event:r,listeners:b})}var DM=/\r\n?/g,NM=/\u0000|\uFFFD/g;function Qv(i){return(typeof i=="string"?i:""+i).replace(DM,`
62
+ `).replace(NM,"")}function Wv(i,r){return r=Qv(r),Qv(i)===r}function Su(){}function qe(i,r,a,l,f,m){switch(a){case"children":typeof l=="string"?r==="body"||r==="textarea"&&l===""||Sr(i,l):(typeof l=="number"||typeof l=="bigint")&&r!=="body"&&Sr(i,""+l);break;case"className":El(i,"class",l);break;case"tabIndex":El(i,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":El(i,a,l);break;case"style":tg(i,l,m);break;case"data":if(r!=="object"){El(i,"data",l);break}case"src":case"href":if(l===""&&(r!=="a"||a!=="href")){i.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(a);break}l=Ml(""+l),i.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="function"){i.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 m=="function"&&(a==="formAction"?(r!=="input"&&qe(i,r,"name",f.name,f,null),qe(i,r,"formEncType",f.formEncType,f,null),qe(i,r,"formMethod",f.formMethod,f,null),qe(i,r,"formTarget",f.formTarget,f,null)):(qe(i,r,"encType",f.encType,f,null),qe(i,r,"method",f.method,f,null),qe(i,r,"target",f.target,f,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){i.removeAttribute(a);break}l=Ml(""+l),i.setAttribute(a,l);break;case"onClick":l!=null&&(i.onclick=Su);break;case"onScroll":l!=null&&Me("scroll",i);break;case"onScrollEnd":l!=null&&Me("scrollend",i);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(s(60));i.innerHTML=a}}break;case"multiple":i.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":i.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"){i.removeAttribute("xlink:href");break}a=Ml(""+l),i.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"?i.setAttribute(a,""+l):i.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"?i.setAttribute(a,""):i.removeAttribute(a);break;case"capture":case"download":l===!0?i.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?i.setAttribute(a,l):i.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?i.setAttribute(a,l):i.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?i.removeAttribute(a):i.setAttribute(a,l);break;case"popover":Me("beforetoggle",i),Me("toggle",i),Tl(i,"popover",l);break;case"xlinkActuate":yi(i,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":yi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":yi(i,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":yi(i,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":yi(i,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":yi(i,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":yi(i,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":yi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":yi(i,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Tl(i,"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=uO.get(a)||a,Tl(i,a,l))}}function nh(i,r,a,l,f,m){switch(a){case"style":tg(i,l,m);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(s(61));if(a=l.__html,a!=null){if(f.children!=null)throw Error(s(60));i.innerHTML=a}}break;case"children":typeof l=="string"?Sr(i,l):(typeof l=="number"||typeof l=="bigint")&&Sr(i,""+l);break;case"onScroll":l!=null&&Me("scroll",i);break;case"onScrollEnd":l!=null&&Me("scrollend",i);break;case"onClick":l!=null&&(i.onclick=Su);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Iy.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(f=a.endsWith("Capture"),r=a.slice(2,f?a.length-7:void 0),m=i[Wt]||null,m=m!=null?m[a]:null,typeof m=="function"&&i.removeEventListener(r,m,f),typeof l=="function")){typeof m!="function"&&m!==null&&(a in i?i[a]=null:i.hasAttribute(a)&&i.removeAttribute(a)),i.addEventListener(r,l,f);break e}a in i?i[a]=l:l===!0?i.setAttribute(a,""):Tl(i,a,l)}}}function zt(i,r,a){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",i),Me("load",i);var l=!1,f=!1,m;for(m in a)if(a.hasOwnProperty(m)){var b=a[m];if(b!=null)switch(m){case"src":l=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:qe(i,r,m,b,a,null)}}f&&qe(i,r,"srcSet",a.srcSet,a,null),l&&qe(i,r,"src",a.src,a,null);return;case"input":Me("invalid",i);var w=m=b=f=null,R=null,N=null;for(l in a)if(a.hasOwnProperty(l)){var q=a[l];if(q!=null)switch(l){case"name":f=q;break;case"type":b=q;break;case"checked":R=q;break;case"defaultChecked":N=q;break;case"value":m=q;break;case"defaultValue":w=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,r));break;default:qe(i,r,l,q,a,null)}}Jy(i,m,w,R,N,b,f,!1),Rl(i);return;case"select":Me("invalid",i),l=b=m=null;for(f in a)if(a.hasOwnProperty(f)&&(w=a[f],w!=null))switch(f){case"value":m=w;break;case"defaultValue":b=w;break;case"multiple":l=w;default:qe(i,r,f,w,a,null)}r=m,a=b,i.multiple=!!l,r!=null?vr(i,!!l,r,!1):a!=null&&vr(i,!!l,a,!0);return;case"textarea":Me("invalid",i),m=f=l=null;for(b in a)if(a.hasOwnProperty(b)&&(w=a[b],w!=null))switch(b){case"value":l=w;break;case"defaultValue":f=w;break;case"children":m=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:qe(i,r,b,w,a,null)}Wy(i,l,f,m),Rl(i);return;case"option":for(R in a)if(a.hasOwnProperty(R)&&(l=a[R],l!=null))switch(R){case"selected":i.selected=l&&typeof l!="function"&&typeof l!="symbol";break;default:qe(i,r,R,l,a,null)}return;case"dialog":Me("beforetoggle",i),Me("toggle",i),Me("cancel",i),Me("close",i);break;case"iframe":case"object":Me("load",i);break;case"video":case"audio":for(l=0;l<xa.length;l++)Me(xa[l],i);break;case"image":Me("error",i),Me("load",i);break;case"details":Me("toggle",i);break;case"embed":case"source":case"link":Me("error",i),Me("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(N in a)if(a.hasOwnProperty(N)&&(l=a[N],l!=null))switch(N){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:qe(i,r,N,l,a,null)}return;default:if(bf(r)){for(q in a)a.hasOwnProperty(q)&&(l=a[q],l!==void 0&&nh(i,r,q,l,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(l=a[w],l!=null&&qe(i,r,w,l,a,null))}function $M(i,r,a,l){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,w=null,R=null,N=null,q=null;for(j in a){var I=a[j];if(a.hasOwnProperty(j)&&I!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":R=I;default:l.hasOwnProperty(j)||qe(i,r,j,null,l,I)}}for(var B in l){var j=l[B];if(I=a[B],l.hasOwnProperty(B)&&(j!=null||I!=null))switch(B){case"type":m=j;break;case"name":f=j;break;case"checked":N=j;break;case"defaultChecked":q=j;break;case"value":b=j;break;case"defaultValue":w=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(s(137,r));break;default:j!==I&&qe(i,r,B,j,l,I)}}yf(i,b,w,R,N,q,m,f);return;case"select":j=b=w=B=null;for(m in a)if(R=a[m],a.hasOwnProperty(m)&&R!=null)switch(m){case"value":break;case"multiple":j=R;default:l.hasOwnProperty(m)||qe(i,r,m,null,l,R)}for(f in l)if(m=l[f],R=a[f],l.hasOwnProperty(f)&&(m!=null||R!=null))switch(f){case"value":B=m;break;case"defaultValue":w=m;break;case"multiple":b=m;default:m!==R&&qe(i,r,f,m,l,R)}r=w,a=b,l=j,B!=null?vr(i,!!a,B,!1):!!l!=!!a&&(r!=null?vr(i,!!a,r,!0):vr(i,!!a,a?[]:"",!1));return;case"textarea":j=B=null;for(w in a)if(f=a[w],a.hasOwnProperty(w)&&f!=null&&!l.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:qe(i,r,w,null,l,f)}for(b in l)if(f=l[b],m=a[b],l.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":B=f;break;case"defaultValue":j=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(s(91));break;default:f!==m&&qe(i,r,b,f,l,m)}Qy(i,B,j);return;case"option":for(var de in a)if(B=a[de],a.hasOwnProperty(de)&&B!=null&&!l.hasOwnProperty(de))switch(de){case"selected":i.selected=!1;break;default:qe(i,r,de,null,l,B)}for(R in l)if(B=l[R],j=a[R],l.hasOwnProperty(R)&&B!==j&&(B!=null||j!=null))switch(R){case"selected":i.selected=B&&typeof B!="function"&&typeof B!="symbol";break;default:qe(i,r,R,B,l,j)}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)B=a[le],a.hasOwnProperty(le)&&B!=null&&!l.hasOwnProperty(le)&&qe(i,r,le,null,l,B);for(N in l)if(B=l[N],j=a[N],l.hasOwnProperty(N)&&B!==j&&(B!=null||j!=null))switch(N){case"children":case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(137,r));break;default:qe(i,r,N,B,l,j)}return;default:if(bf(r)){for(var Ke in a)B=a[Ke],a.hasOwnProperty(Ke)&&B!==void 0&&!l.hasOwnProperty(Ke)&&nh(i,r,Ke,void 0,l,B);for(q in l)B=l[q],j=a[q],!l.hasOwnProperty(q)||B===j||B===void 0&&j===void 0||nh(i,r,q,B,l,j);return}}for(var C in a)B=a[C],a.hasOwnProperty(C)&&B!=null&&!l.hasOwnProperty(C)&&qe(i,r,C,null,l,B);for(I in l)B=l[I],j=a[I],!l.hasOwnProperty(I)||B===j||B==null&&j==null||qe(i,r,I,B,l,j)}var ih=null,sh=null;function wu(i){return i.nodeType===9?i:i.ownerDocument}function e0(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function t0(i,r){if(i===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&r==="foreignObject"?0:i}function rh(i,r){return i==="textarea"||i==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var oh=null;function BM(){var i=window.event;return i&&i.type==="popstate"?i===oh?!1:(oh=i,!0):(oh=null,!1)}var n0=typeof setTimeout=="function"?setTimeout:void 0,LM=typeof clearTimeout=="function"?clearTimeout:void 0,i0=typeof Promise=="function"?Promise:void 0,VM=typeof queueMicrotask=="function"?queueMicrotask:typeof i0<"u"?function(i){return i0.resolve(null).then(i).catch(jM)}:n0;function jM(i){setTimeout(function(){throw i})}function cs(i){return i==="head"}function s0(i,r){var a=r,l=0,f=0;do{var m=a.nextSibling;if(i.removeChild(a),m&&m.nodeType===8)if(a=m.data,a==="/$"){if(0<l&&8>l){a=l;var b=i.ownerDocument;if(a&1&&Ta(b.documentElement),a&2&&Ta(b.body),a&4)for(a=b.head,Ta(a),b=a.firstChild;b;){var w=b.nextSibling,R=b.nodeName;b[zo]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&b.rel.toLowerCase()==="stylesheet"||a.removeChild(b),b=w}}if(f===0){i.removeChild(m),Da(r);return}f--}else a==="$"||a==="$?"||a==="$!"?f++:l=a.charCodeAt(0)-48;else l=0;a=m}while(a);Da(r)}function ah(i){var r=i.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var a=r;switch(r=r.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ah(a),df(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}i.removeChild(a)}}function zM(i,r,a,l){for(;i.nodeType===1;){var f=a;if(i.nodeName.toLowerCase()!==r.toLowerCase()){if(!l&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(l){if(!i[zo])switch(r){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(m=i.getAttribute("rel"),m==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(m!==f.rel||i.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||i.getAttribute("title")!==(f.title==null?null:f.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(m=i.getAttribute("src"),(m!==(f.src==null?null:f.src)||i.getAttribute("type")!==(f.type==null?null:f.type)||i.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(r==="input"&&i.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&i.getAttribute("name")===m)return i}else return i;if(i=qn(i.nextSibling),i===null)break}return null}function UM(i,r,a){if(r==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!a||(i=qn(i.nextSibling),i===null))return null;return i}function lh(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState==="complete"}function qM(i,r){var a=i.ownerDocument;if(i.data!=="$?"||a.readyState==="complete")r();else{var l=function(){r(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),i._reactRetry=l}}function qn(i){for(;i!=null;i=i.nextSibling){var r=i.nodeType;if(r===1||r===3)break;if(r===8){if(r=i.data,r==="$"||r==="$!"||r==="$?"||r==="F!"||r==="F")break;if(r==="/$")return null}}return i}var uh=null;function r0(i){i=i.previousSibling;for(var r=0;i;){if(i.nodeType===8){var a=i.data;if(a==="$"||a==="$!"||a==="$?"){if(r===0)return i;r--}else a==="/$"&&r++}i=i.previousSibling}return null}function o0(i,r,a){switch(r=wu(a),i){case"html":if(i=r.documentElement,!i)throw Error(s(452));return i;case"head":if(i=r.head,!i)throw Error(s(453));return i;case"body":if(i=r.body,!i)throw Error(s(454));return i;default:throw Error(s(451))}}function Ta(i){for(var r=i.attributes;r.length;)i.removeAttributeNode(r[0]);df(i)}var kn=new Map,a0=new Set;function xu(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var Ci=P.d;P.d={f:KM,r:PM,D:IM,C:HM,L:FM,m:GM,X:XM,S:YM,M:ZM};function KM(){var i=Ci.f(),r=hu();return i||r}function PM(i){var r=mr(i);r!==null&&r.tag===5&&r.type==="form"?Ob(r):Ci.r(i)}var Xr=typeof document>"u"?null:document;function l0(i,r,a){var l=Xr;if(l&&typeof r=="string"&&r){var f=Tn(r);f='link[rel="'+i+'"][href="'+f+'"]',typeof a=="string"&&(f+='[crossorigin="'+a+'"]'),a0.has(f)||(a0.add(f),i={rel:i,crossOrigin:a,href:r},l.querySelector(f)===null&&(r=l.createElement("link"),zt(r,"link",i),kt(r),l.head.appendChild(r)))}}function IM(i){Ci.D(i),l0("dns-prefetch",i,null)}function HM(i,r){Ci.C(i,r),l0("preconnect",i,r)}function FM(i,r,a){Ci.L(i,r,a);var l=Xr;if(l&&i&&r){var f='link[rel="preload"][as="'+Tn(r)+'"]';r==="image"&&a&&a.imageSrcSet?(f+='[imagesrcset="'+Tn(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(f+='[imagesizes="'+Tn(a.imageSizes)+'"]')):f+='[href="'+Tn(i)+'"]';var m=f;switch(r){case"style":m=Zr(i);break;case"script":m=Jr(i)}kn.has(m)||(i=y({rel:"preload",href:r==="image"&&a&&a.imageSrcSet?void 0:i,as:r},a),kn.set(m,i),l.querySelector(f)!==null||r==="style"&&l.querySelector(Ea(m))||r==="script"&&l.querySelector(Ra(m))||(r=l.createElement("link"),zt(r,"link",i),kt(r),l.head.appendChild(r)))}}function GM(i,r){Ci.m(i,r);var a=Xr;if(a&&i){var l=r&&typeof r.as=="string"?r.as:"script",f='link[rel="modulepreload"][as="'+Tn(l)+'"][href="'+Tn(i)+'"]',m=f;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Jr(i)}if(!kn.has(m)&&(i=y({rel:"modulepreload",href:i},r),kn.set(m,i),a.querySelector(f)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ra(m)))return}l=a.createElement("link"),zt(l,"link",i),kt(l),a.head.appendChild(l)}}}function YM(i,r,a){Ci.S(i,r,a);var l=Xr;if(l&&i){var f=yr(l).hoistableStyles,m=Zr(i);r=r||"default";var b=f.get(m);if(!b){var w={loading:0,preload:null};if(b=l.querySelector(Ea(m)))w.loading=5;else{i=y({rel:"stylesheet",href:i,"data-precedence":r},a),(a=kn.get(m))&&ch(i,a);var R=b=l.createElement("link");kt(R),zt(R,"link",i),R._p=new Promise(function(N,q){R.onload=N,R.onerror=q}),R.addEventListener("load",function(){w.loading|=1}),R.addEventListener("error",function(){w.loading|=2}),w.loading|=4,Au(b,r,l)}b={type:"stylesheet",instance:b,count:1,state:w},f.set(m,b)}}}function XM(i,r){Ci.X(i,r);var a=Xr;if(a&&i){var l=yr(a).hoistableScripts,f=Jr(i),m=l.get(f);m||(m=a.querySelector(Ra(f)),m||(i=y({src:i,async:!0},r),(r=kn.get(f))&&fh(i,r),m=a.createElement("script"),kt(m),zt(m,"link",i),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function ZM(i,r){Ci.M(i,r);var a=Xr;if(a&&i){var l=yr(a).hoistableScripts,f=Jr(i),m=l.get(f);m||(m=a.querySelector(Ra(f)),m||(i=y({src:i,async:!0,type:"module"},r),(r=kn.get(f))&&fh(i,r),m=a.createElement("script"),kt(m),zt(m,"link",i),a.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},l.set(f,m))}}function u0(i,r,a,l){var f=(f=se.current)?xu(f):null;if(!f)throw Error(s(446));switch(i){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(r=Zr(a.href),a=yr(f).hoistableStyles,l=a.get(r),l||(l={type:"style",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){i=Zr(a.href);var m=yr(f).hoistableStyles,b=m.get(i);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(i,b),(m=f.querySelector(Ea(i)))&&!m._p&&(b.instance=m,b.state.loading=5),kn.has(i)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},kn.set(i,a),m||JM(f,i,a,b.state))),r&&l===null)throw Error(s(528,""));return b}if(r&&l!==null)throw Error(s(529,""));return null;case"script":return r=a.async,a=a.src,typeof a=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Jr(a),a=yr(f).hoistableScripts,l=a.get(r),l||(l={type:"script",instance:null,count:0,state:null},a.set(r,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,i))}}function Zr(i){return'href="'+Tn(i)+'"'}function Ea(i){return'link[rel="stylesheet"]['+i+"]"}function c0(i){return y({},i,{"data-precedence":i.precedence,precedence:null})}function JM(i,r,a,l){i.querySelector('link[rel="preload"][as="style"]['+r+"]")?l.loading=1:(r=i.createElement("link"),l.preload=r,r.addEventListener("load",function(){return l.loading|=1}),r.addEventListener("error",function(){return l.loading|=2}),zt(r,"link",a),kt(r),i.head.appendChild(r))}function Jr(i){return'[src="'+Tn(i)+'"]'}function Ra(i){return"script[async]"+i}function f0(i,r,a){if(r.count++,r.instance===null)switch(r.type){case"style":var l=i.querySelector('style[data-href~="'+Tn(a.href)+'"]');if(l)return r.instance=l,kt(l),l;var f=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(i.ownerDocument||i).createElement("style"),kt(l),zt(l,"style",f),Au(l,a.precedence,i),r.instance=l;case"stylesheet":f=Zr(a.href);var m=i.querySelector(Ea(f));if(m)return r.state.loading|=4,r.instance=m,kt(m),m;l=c0(a),(f=kn.get(f))&&ch(l,f),m=(i.ownerDocument||i).createElement("link"),kt(m);var b=m;return b._p=new Promise(function(w,R){b.onload=w,b.onerror=R}),zt(m,"link",l),r.state.loading|=4,Au(m,a.precedence,i),r.instance=m;case"script":return m=Jr(a.src),(f=i.querySelector(Ra(m)))?(r.instance=f,kt(f),f):(l=a,(f=kn.get(m))&&(l=y({},a),fh(l,f)),i=i.ownerDocument||i,f=i.createElement("script"),kt(f),zt(f,"link",l),i.head.appendChild(f),r.instance=f);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(l=r.instance,r.state.loading|=4,Au(l,a.precedence,i));return r.instance}function Au(i,r,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=l.length?l[l.length-1]:null,m=f,b=0;b<l.length;b++){var w=l[b];if(w.dataset.precedence===r)m=w;else if(m!==f)break}m?m.parentNode.insertBefore(i,m.nextSibling):(r=a.nodeType===9?a.head:a,r.insertBefore(i,r.firstChild))}function ch(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.title==null&&(i.title=r.title)}function fh(i,r){i.crossOrigin==null&&(i.crossOrigin=r.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=r.referrerPolicy),i.integrity==null&&(i.integrity=r.integrity)}var Tu=null;function d0(i,r,a){if(Tu===null){var l=new Map,f=Tu=new Map;f.set(a,l)}else f=Tu,l=f.get(a),l||(l=new Map,f.set(a,l));if(l.has(i))return l;for(l.set(i,null),a=a.getElementsByTagName(i),f=0;f<a.length;f++){var m=a[f];if(!(m[zo]||m[Kt]||i==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(r)||"";b=i+b;var w=l.get(b);w?w.push(m):l.set(b,[m])}}return l}function h0(i,r,a){i=i.ownerDocument||i,i.head.insertBefore(a,r==="title"?i.querySelector("head > title"):null)}function QM(i,r,a){if(a===1||r.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return i=r.disabled,typeof r.precedence=="string"&&i==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function p0(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}var Oa=null;function WM(){}function e_(i,r,a){if(Oa===null)throw Error(s(475));var l=Oa;if(r.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(r.state.loading&4)===0){if(r.instance===null){var f=Zr(a.href),m=i.querySelector(Ea(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(l.count++,l=Eu.bind(l),i.then(l,l)),r.state.loading|=4,r.instance=m,kt(m);return}m=i.ownerDocument||i,a=c0(a),(f=kn.get(f))&&ch(a,f),m=m.createElement("link"),kt(m);var b=m;b._p=new Promise(function(w,R){b.onload=w,b.onerror=R}),zt(m,"link",a),r.instance=m}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(r,i),(i=r.state.preload)&&(r.state.loading&3)===0&&(l.count++,r=Eu.bind(l),i.addEventListener("load",r),i.addEventListener("error",r))}}function t_(){if(Oa===null)throw Error(s(475));var i=Oa;return i.stylesheets&&i.count===0&&dh(i,i.stylesheets),0<i.count?function(r){var a=setTimeout(function(){if(i.stylesheets&&dh(i,i.stylesheets),i.unsuspend){var l=i.unsuspend;i.unsuspend=null,l()}},6e4);return i.unsuspend=r,function(){i.unsuspend=null,clearTimeout(a)}}:null}function Eu(){if(this.count--,this.count===0){if(this.stylesheets)dh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Ru=null;function dh(i,r){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Ru=new Map,r.forEach(n_,i),Ru=null,Eu.call(i))}function n_(i,r){if(!(r.state.loading&4)){var a=Ru.get(i);if(a)var l=a.get(null);else{a=new Map,Ru.set(i,a);for(var f=i.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(a.set(b.dataset.precedence,b),l=b)}l&&a.set(null,l)}f=r.instance,b=f.getAttribute("data-precedence"),m=a.get(b)||l,m===l&&a.set(null,f),a.set(b,f),this.count++,l=Eu.bind(this),f.addEventListener("load",l),f.addEventListener("error",l),m?m.parentNode.insertBefore(f,m.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(f,i.firstChild)),r.state.loading|=4}}var Ma={$$typeof:M,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function i_(i,r,a,l,f,m,b,w){this.tag=1,this.containerInfo=i,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=lf(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lf(0),this.hiddenUpdates=lf(null),this.identifierPrefix=l,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.incompleteTransitions=new Map}function m0(i,r,a,l,f,m,b,w,R,N,q,I){return i=new i_(i,r,a,b,w,R,N,I),r=1,m===!0&&(r|=24),m=hn(3,null,null,r),i.current=m,m.stateNode=i,r=Gf(),r.refCount++,i.pooledCache=r,r.refCount++,m.memoizedState={element:l,isDehydrated:a,cache:r},Jf(m),i}function y0(i){return i?(i=Mr,i):Mr}function g0(i,r,a,l,f,m){f=y0(f),l.context===null?l.context=f:l.pendingContext=f,l=Ji(r),l.payload={element:a},m=m===void 0?null:m,m!==null&&(l.callback=m),a=Qi(i,l,r),a!==null&&(bn(a,i,r),sa(a,i,r))}function b0(i,r){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var a=i.retryLane;i.retryLane=a!==0&&a<r?a:r}}function hh(i,r){b0(i,r),(i=i.alternate)&&b0(i,r)}function v0(i){if(i.tag===13){var r=Or(i,67108864);r!==null&&bn(r,i,67108864),hh(i,67108864)}}var Ou=!0;function s_(i,r,a,l){var f=L.T;L.T=null;var m=P.p;try{P.p=2,ph(i,r,a,l)}finally{P.p=m,L.T=f}}function r_(i,r,a,l){var f=L.T;L.T=null;var m=P.p;try{P.p=8,ph(i,r,a,l)}finally{P.p=m,L.T=f}}function ph(i,r,a,l){if(Ou){var f=mh(l);if(f===null)th(i,r,l,Mu,a),w0(i,l);else if(a_(f,i,r,a,l))l.stopPropagation();else if(w0(i,l),r&4&&-1<o_.indexOf(i)){for(;f!==null;){var m=mr(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Ms(m.pendingLanes);if(b!==0){var w=m;for(w.pendingLanes|=2,w.entangledLanes|=2;b;){var R=1<<31-fn(b);w.entanglements[1]|=R,b&=~R}Qn(m),(je&6)===0&&(fu=ct()+500,wa(0))}}break;case 13:w=Or(m,2),w!==null&&bn(w,m,2),hu(),hh(m,2)}if(m=mh(l),m===null&&th(i,r,l,Mu,a),m===f)break;f=m}f!==null&&l.stopPropagation()}else th(i,r,l,null,a)}}function mh(i){return i=Sf(i),yh(i)}var Mu=null;function yh(i){if(Mu=null,i=pr(i),i!==null){var r=u(i);if(r===null)i=null;else{var a=r.tag;if(a===13){if(i=c(r),i!==null)return i;i=null}else if(a===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;i=null}else r!==i&&(i=null)}}return Mu=i,null}function S0(i){switch(i){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(Ct()){case Ge:return 2;case et:return 8;case Os:case FR:return 32;case Ly:return 268435456;default:return 32}default:return 32}}var gh=!1,fs=null,ds=null,hs=null,_a=new Map,Ca=new Map,ps=[],o_="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 w0(i,r){switch(i){case"focusin":case"focusout":fs=null;break;case"dragenter":case"dragleave":ds=null;break;case"mouseover":case"mouseout":hs=null;break;case"pointerover":case"pointerout":_a.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ca.delete(r.pointerId)}}function ka(i,r,a,l,f,m){return i===null||i.nativeEvent!==m?(i={blockedOn:r,domEventName:a,eventSystemFlags:l,nativeEvent:m,targetContainers:[f]},r!==null&&(r=mr(r),r!==null&&v0(r)),i):(i.eventSystemFlags|=l,r=i.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),i)}function a_(i,r,a,l,f){switch(r){case"focusin":return fs=ka(fs,i,r,a,l,f),!0;case"dragenter":return ds=ka(ds,i,r,a,l,f),!0;case"mouseover":return hs=ka(hs,i,r,a,l,f),!0;case"pointerover":var m=f.pointerId;return _a.set(m,ka(_a.get(m)||null,i,r,a,l,f)),!0;case"gotpointercapture":return m=f.pointerId,Ca.set(m,ka(Ca.get(m)||null,i,r,a,l,f)),!0}return!1}function x0(i){var r=pr(i.target);if(r!==null){var a=u(r);if(a!==null){if(r=a.tag,r===13){if(r=c(a),r!==null){i.blockedOn=r,eO(i.priority,function(){if(a.tag===13){var l=gn();l=uf(l);var f=Or(a,l);f!==null&&bn(f,a,l),hh(a,l)}});return}}else if(r===3&&a.stateNode.current.memoizedState.isDehydrated){i.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}i.blockedOn=null}function _u(i){if(i.blockedOn!==null)return!1;for(var r=i.targetContainers;0<r.length;){var a=mh(i.nativeEvent);if(a===null){a=i.nativeEvent;var l=new a.constructor(a.type,a);vf=l,a.target.dispatchEvent(l),vf=null}else return r=mr(a),r!==null&&v0(r),i.blockedOn=a,!1;r.shift()}return!0}function A0(i,r,a){_u(i)&&a.delete(r)}function l_(){gh=!1,fs!==null&&_u(fs)&&(fs=null),ds!==null&&_u(ds)&&(ds=null),hs!==null&&_u(hs)&&(hs=null),_a.forEach(A0),Ca.forEach(A0)}function Cu(i,r){i.blockedOn===r&&(i.blockedOn=null,gh||(gh=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,l_)))}var ku=null;function T0(i){ku!==i&&(ku=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ku===i&&(ku=null);for(var r=0;r<i.length;r+=3){var a=i[r],l=i[r+1],f=i[r+2];if(typeof l!="function"){if(yh(l||a)===null)continue;break}var m=mr(a);m!==null&&(i.splice(r,3),r-=3,yd(m,{pending:!0,data:f,method:a.method,action:l},l,f))}}))}function Da(i){function r(R){return Cu(R,i)}fs!==null&&Cu(fs,i),ds!==null&&Cu(ds,i),hs!==null&&Cu(hs,i),_a.forEach(r),Ca.forEach(r);for(var a=0;a<ps.length;a++){var l=ps[a];l.blockedOn===i&&(l.blockedOn=null)}for(;0<ps.length&&(a=ps[0],a.blockedOn===null);)x0(a),a.blockedOn===null&&ps.shift();if(a=(i.ownerDocument||i).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var f=a[l],m=a[l+1],b=f[Wt]||null;if(typeof m=="function")b||T0(a);else if(b){var w=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[Wt]||null)w=b.formAction;else if(yh(f)!==null)continue}else w=b.action;typeof w=="function"?a[l+1]=w:(a.splice(l,3),l-=3),T0(a)}}}function bh(i){this._internalRoot=i}Du.prototype.render=bh.prototype.render=function(i){var r=this._internalRoot;if(r===null)throw Error(s(409));var a=r.current,l=gn();g0(a,l,i,r,null,null)},Du.prototype.unmount=bh.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var r=i.containerInfo;g0(i.current,2,null,i,null,null),hu(),r[hr]=null}};function Du(i){this._internalRoot=i}Du.prototype.unstable_scheduleHydration=function(i){if(i){var r=qy();i={blockedOn:null,target:i,priority:r};for(var a=0;a<ps.length&&r!==0&&r<ps[a].priority;a++);ps.splice(a,0,i),a===0&&x0(i)}};var E0=t.version;if(E0!=="19.1.0")throw Error(s(527,E0,"19.1.0"));P.findDOMNode=function(i){var r=i._reactInternals;if(r===void 0)throw typeof i.render=="function"?Error(s(188)):(i=Object.keys(i).join(","),Error(s(268,i)));return i=h(r),i=i!==null?p(i):null,i=i===null?null:i.stateNode,i};var u_={bundleType:0,version:"19.1.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.1.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Nu=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Nu.isDisabled&&Nu.supportsFiber)try{Lo=Nu.inject(u_),cn=Nu}catch{}}return $a.createRoot=function(i,r){if(!o(i))throw Error(s(299));var a=!1,l="",f=qb,m=Kb,b=Pb,w=null;return r!=null&&(r.unstable_strictMode===!0&&(a=!0),r.identifierPrefix!==void 0&&(l=r.identifierPrefix),r.onUncaughtError!==void 0&&(f=r.onUncaughtError),r.onCaughtError!==void 0&&(m=r.onCaughtError),r.onRecoverableError!==void 0&&(b=r.onRecoverableError),r.unstable_transitionCallbacks!==void 0&&(w=r.unstable_transitionCallbacks)),r=m0(i,1,!1,null,null,a,l,f,m,b,w,null),i[hr]=r.current,eh(i),new bh(r)},$a.hydrateRoot=function(i,r,a){if(!o(i))throw Error(s(299));var l=!1,f="",m=qb,b=Kb,w=Pb,R=null,N=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(f=a.identifierPrefix),a.onUncaughtError!==void 0&&(m=a.onUncaughtError),a.onCaughtError!==void 0&&(b=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(R=a.unstable_transitionCallbacks),a.formState!==void 0&&(N=a.formState)),r=m0(i,1,!0,r,a??null,l,f,m,b,w,R,N),r.context=y0(null),a=r.current,l=gn(),l=uf(l),f=Ji(l),f.callback=null,Qi(a,f,l),a=l,r.current.lanes=a,jo(r,a),Qn(r),i[hr]=r.current,eh(i),new Du(r)},$a.version="19.1.0",$a}var j0;function RC(){if(j0)return xh.exports;j0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),xh.exports=EC(),xh.exports}var OC=RC();function zc(){return typeof window<"u"}function Es(e){return xx(e)?(e.nodeName||"").toLowerCase():"#document"}function wn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function hi(e){var t;return(t=(xx(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function xx(e){return zc()?e instanceof Node||e instanceof wn(e).Node:!1}function pt(e){return zc()?e instanceof Element||e instanceof wn(e).Element:!1}function Ot(e){return zc()?e instanceof HTMLElement||e instanceof wn(e).HTMLElement:!1}function mp(e){return!zc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof wn(e).ShadowRoot}function ol(e){const{overflow:t,overflowX:n,overflowY:s,display:o}=jn(e);return/auto|scroll|overlay|hidden|clip/.test(t+s+n)&&!["inline","contents"].includes(o)}function MC(e){return["table","td","th"].includes(Es(e))}function Uc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Rm(e){const t=qc(),n=pt(e)?jn(e):e;return["transform","translate","scale","rotate","perspective"].some(s=>n[s]?n[s]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function _C(e){let t=Vi(e);for(;Ot(t)&&!$i(t);){if(Rm(t))return t;if(Uc(t))return null;t=Vi(t)}return null}function qc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function $i(e){return["html","body","#document"].includes(Es(e))}function jn(e){return wn(e).getComputedStyle(e)}function Kc(e){return pt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Vi(e){if(Es(e)==="html")return e;const t=e.assignedSlot||e.parentNode||mp(e)&&e.host||hi(e);return mp(t)?t.host:t}function Ax(e){const t=Vi(e);return $i(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ot(t)&&ol(t)?t:Ax(t)}function Ss(e,t,n){var s;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=Ax(e),u=o===((s=e.ownerDocument)==null?void 0:s.body),c=wn(o);if(u){const d=yp(c);return t.concat(c,c.visualViewport||[],ol(o)?o:[],d&&n?Ss(d):[])}return t.concat(o,Ss(o,[],n))}function yp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const lc=Math.min,nr=Math.max,uc=Math.round,Bu=Math.floor,ii=e=>({x:e,y:e}),CC={left:"right",right:"left",bottom:"top",top:"bottom"},kC={start:"end",end:"start"};function z0(e,t,n){return nr(e,lc(t,n))}function Pc(e,t){return typeof e=="function"?e(t):e}function ar(e){return e.split("-")[0]}function Ic(e){return e.split("-")[1]}function Tx(e){return e==="x"?"y":"x"}function Ex(e){return e==="y"?"height":"width"}function ir(e){return["top","bottom"].includes(ar(e))?"y":"x"}function Rx(e){return Tx(ir(e))}function DC(e,t,n){n===void 0&&(n=!1);const s=Ic(e),o=Rx(e),u=Ex(o);let c=o==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[u]>t.floating[u]&&(c=cc(c)),[c,cc(c)]}function NC(e){const t=cc(e);return[gp(e),t,gp(t)]}function gp(e){return e.replace(/start|end/g,t=>kC[t])}function $C(e,t,n){const s=["left","right"],o=["right","left"],u=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:s:t?s:o;case"left":case"right":return t?u:c;default:return[]}}function BC(e,t,n,s){const o=Ic(e);let u=$C(ar(e),n==="start",s);return o&&(u=u.map(c=>c+"-"+o),t&&(u=u.concat(u.map(gp)))),u}function cc(e){return e.replace(/left|right|bottom|top/g,t=>CC[t])}function LC(e){return{top:0,right:0,bottom:0,left:0,...e}}function VC(e){return typeof e!="number"?LC(e):{top:e,right:e,bottom:e,left:e}}function fc(e){const{x:t,y:n,width:s,height:o}=e;return{width:s,height:o,top:n,left:t,right:t+s,bottom:n+o,x:t,y:n}}/*!
63
+ * tabbable 6.2.0
64
+ * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
65
+ */var jC=["input:not([inert])","select:not([inert])","textarea:not([inert])","a[href]:not([inert])","button:not([inert])","[tabindex]:not(slot):not([inert])","audio[controls]:not([inert])","video[controls]:not([inert])",'[contenteditable]:not([contenteditable="false"]):not([inert])',"details>summary:first-of-type:not([inert])","details:not([inert])"],dc=jC.join(","),Ox=typeof Element>"u",vo=Ox?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,hc=!Ox&&Element.prototype.getRootNode?function(e){var t;return e==null||(t=e.getRootNode)===null||t===void 0?void 0:t.call(e)}:function(e){return e==null?void 0:e.ownerDocument},pc=function e(t,n){var s;n===void 0&&(n=!0);var o=t==null||(s=t.getAttribute)===null||s===void 0?void 0:s.call(t,"inert"),u=o===""||o==="true",c=u||n&&t&&e(t.parentNode);return c},zC=function(t){var n,s=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return s===""||s==="true"},Mx=function(t,n,s){if(pc(t))return[];var o=Array.prototype.slice.apply(t.querySelectorAll(dc));return n&&vo.call(t,dc)&&o.unshift(t),o=o.filter(s),o},_x=function e(t,n,s){for(var o=[],u=Array.from(t);u.length;){var c=u.shift();if(!pc(c,!1))if(c.tagName==="SLOT"){var d=c.assignedElements(),h=d.length?d:c.children,p=e(h,!0,s);s.flatten?o.push.apply(o,p):o.push({scopeParent:c,candidates:p})}else{var y=vo.call(c,dc);y&&s.filter(c)&&(n||!t.includes(c))&&o.push(c);var g=c.shadowRoot||typeof s.getShadowRoot=="function"&&s.getShadowRoot(c),v=!pc(g,!1)&&(!s.shadowRootFilter||s.shadowRootFilter(c));if(g&&v){var S=e(g===!0?c.children:g.children,!0,s);s.flatten?o.push.apply(o,S):o.push({scopeParent:c,candidates:S})}else u.unshift.apply(u,c.children)}}return o},Cx=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},kx=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||zC(t))&&!Cx(t)?0:t.tabIndex},UC=function(t,n){var s=kx(t);return s<0&&n&&!Cx(t)?0:s},qC=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Dx=function(t){return t.tagName==="INPUT"},KC=function(t){return Dx(t)&&t.type==="hidden"},PC=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(s){return s.tagName==="SUMMARY"});return n},IC=function(t,n){for(var s=0;s<t.length;s++)if(t[s].checked&&t[s].form===n)return t[s]},HC=function(t){if(!t.name)return!0;var n=t.form||hc(t),s=function(d){return n.querySelectorAll('input[type="radio"][name="'+d+'"]')},o;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")o=s(window.CSS.escape(t.name));else try{o=s(t.name)}catch(c){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",c.message),!1}var u=IC(o,t.form);return!u||u===t},FC=function(t){return Dx(t)&&t.type==="radio"},GC=function(t){return FC(t)&&!HC(t)},YC=function(t){var n,s=t&&hc(t),o=(n=s)===null||n===void 0?void 0:n.host,u=!1;if(s&&s!==t){var c,d,h;for(u=!!((c=o)!==null&&c!==void 0&&(d=c.ownerDocument)!==null&&d!==void 0&&d.contains(o)||t!=null&&(h=t.ownerDocument)!==null&&h!==void 0&&h.contains(t));!u&&o;){var p,y,g;s=hc(o),o=(p=s)===null||p===void 0?void 0:p.host,u=!!((y=o)!==null&&y!==void 0&&(g=y.ownerDocument)!==null&&g!==void 0&&g.contains(o))}}return u},U0=function(t){var n=t.getBoundingClientRect(),s=n.width,o=n.height;return s===0&&o===0},XC=function(t,n){var s=n.displayCheck,o=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var u=vo.call(t,"details>summary:first-of-type"),c=u?t.parentElement:t;if(vo.call(c,"details:not([open]) *"))return!0;if(!s||s==="full"||s==="legacy-full"){if(typeof o=="function"){for(var d=t;t;){var h=t.parentElement,p=hc(t);if(h&&!h.shadowRoot&&o(h)===!0)return U0(t);t.assignedSlot?t=t.assignedSlot:!h&&p!==t.ownerDocument?t=p.host:t=h}t=d}if(YC(t))return!t.getClientRects().length;if(s!=="legacy-full")return!0}else if(s==="non-zero-area")return U0(t);return!1},ZC=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var s=0;s<n.children.length;s++){var o=n.children.item(s);if(o.tagName==="LEGEND")return vo.call(n,"fieldset[disabled] *")?!0:!o.contains(t)}return!0}n=n.parentElement}return!1},bp=function(t,n){return!(n.disabled||pc(n)||KC(n)||XC(n,t)||PC(n)||ZC(n))},vp=function(t,n){return!(GC(n)||kx(n)<0||!bp(t,n))},JC=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},QC=function e(t){var n=[],s=[];return t.forEach(function(o,u){var c=!!o.scopeParent,d=c?o.scopeParent:o,h=UC(d,c),p=c?e(o.candidates):d;h===0?c?n.push.apply(n,p):n.push(d):s.push({documentOrder:u,tabIndex:h,item:o,isScope:c,content:p})}),s.sort(qC).reduce(function(o,u){return u.isScope?o.push.apply(o,u.content):o.push(u.content),o},[]).concat(n)},Om=function(t,n){n=n||{};var s;return n.getShadowRoot?s=_x([t],n.includeContainer,{filter:vp.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:JC}):s=Mx(t,n.includeContainer,vp.bind(null,n)),QC(s)},WC=function(t,n){n=n||{};var s;return n.getShadowRoot?s=_x([t],n.includeContainer,{filter:bp.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):s=Mx(t,n.includeContainer,bp.bind(null,n)),s},Nx=function(t,n){if(n=n||{},!t)throw new Error("No node provided");return vo.call(t,dc)===!1?!1:vp(n,t)};function ek(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function $x(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:s}=t;return n+"/"+s}).join(" "):navigator.userAgent}function tk(){return/apple/i.test(navigator.vendor)}function Sp(){const e=/android/i;return e.test(ek())||e.test($x())}function nk(){return $x().includes("jsdom/")}const q0="data-floating-ui-focusable",ik="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function no(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function vn(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&mp(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function Js(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Rh(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function sk(e){return e.matches("html,body")}function Fn(e){return(e==null?void 0:e.ownerDocument)||document}function Bx(e){return Ot(e)&&e.matches(ik)}function K0(e){return e?e.getAttribute("role")==="combobox"&&Bx(e):!1}function wp(e){return e?e.hasAttribute(q0)?e:e.querySelector("["+q0+"]")||e:null}function qa(e,t,n){n===void 0&&(n=!0);let s=e.filter(u=>{var c;return u.parentId===t&&((c=u.context)==null?void 0:c.open)}),o=s;for(;o.length;)o=n?e.filter(u=>{var c;return(c=o)==null?void 0:c.some(d=>{var h;return u.parentId===d.id&&((h=u.context)==null?void 0:h.open)})}):e,s=s.concat(o);return s}function P0(e,t){var n;let s=[],o=(n=e.find(u=>u.id===t))==null?void 0:n.parentId;for(;o;){const u=e.find(c=>c.id===o);o=u==null?void 0:u.parentId,u&&(s=s.concat(u))}return s}function Oh(e){e.preventDefault(),e.stopPropagation()}function rk(e){return"nativeEvent"in e}function ok(e){return e.mozInputSource===0&&e.isTrusted?!0:Sp()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function ak(e){return nk()?!1:!Sp()&&e.width===0&&e.height===0||Sp()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function I0(e,t){return["mouse","pen"].includes(e)}var Ni=typeof document<"u"?V.useLayoutEffect:V.useEffect;const lk={...Zw};function Mh(e){const t=V.useRef(e);return Ni(()=>{t.current=e}),t}const uk=lk.useInsertionEffect,ck=uk||(e=>e());function ti(e){const t=V.useRef(()=>{});return ck(()=>{t.current=e}),V.useCallback(function(){for(var n=arguments.length,s=new Array(n),o=0;o<n;o++)s[o]=arguments[o];return t.current==null?void 0:t.current(...s)},[])}const Hc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Lx(e,t){const n=Om(e,Hc()),s=n.length;if(s===0)return;const o=no(Fn(e)),u=n.indexOf(o),c=u===-1?t===1?0:s-1:u+t;return n[c]}function fk(e){return Lx(Fn(e).body,1)||e}function dk(e){return Lx(Fn(e).body,-1)||e}function H0(e,t){const n=t||e.currentTarget,s=e.relatedTarget;return!s||!vn(n,s)}var hk=wx();function F0(e,t,n){let{reference:s,floating:o}=e;const u=ir(t),c=Rx(t),d=Ex(c),h=ar(t),p=u==="y",y=s.x+s.width/2-o.width/2,g=s.y+s.height/2-o.height/2,v=s[d]/2-o[d]/2;let S;switch(h){case"top":S={x:y,y:s.y-o.height};break;case"bottom":S={x:y,y:s.y+s.height};break;case"right":S={x:s.x+s.width,y:g};break;case"left":S={x:s.x-o.width,y:g};break;default:S={x:s.x,y:s.y}}switch(Ic(t)){case"start":S[c]-=v*(n&&p?-1:1);break;case"end":S[c]+=v*(n&&p?-1:1);break}return S}const pk=async(e,t,n)=>{const{placement:s="bottom",strategy:o="absolute",middleware:u=[],platform:c}=n,d=u.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:y,y:g}=F0(p,s,h),v=s,S={},A=0;for(let E=0;E<d.length;E++){const{name:_,fn:D}=d[E],{x:$,y:M,data:H,reset:z}=await D({x:y,y:g,initialPlacement:s,placement:v,strategy:o,middlewareData:S,rects:p,platform:c,elements:{reference:e,floating:t}});y=$??y,g=M??g,S={...S,[_]:{...S[_],...H}},z&&A<=50&&(A++,typeof z=="object"&&(z.placement&&(v=z.placement),z.rects&&(p=z.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):z.rects),{x:y,y:g}=F0(p,v,h)),E=-1)}return{x:y,y:g,placement:v,strategy:o,middlewareData:S}};async function Vx(e,t){var n;t===void 0&&(t={});const{x:s,y:o,platform:u,rects:c,elements:d,strategy:h}=e,{boundary:p="clippingAncestors",rootBoundary:y="viewport",elementContext:g="floating",altBoundary:v=!1,padding:S=0}=Pc(t,e),A=VC(S),_=d[v?g==="floating"?"reference":"floating":g],D=fc(await u.getClippingRect({element:(n=await(u.isElement==null?void 0:u.isElement(_)))==null||n?_:_.contextElement||await(u.getDocumentElement==null?void 0:u.getDocumentElement(d.floating)),boundary:p,rootBoundary:y,strategy:h})),$=g==="floating"?{x:s,y:o,width:c.floating.width,height:c.floating.height}:c.reference,M=await(u.getOffsetParent==null?void 0:u.getOffsetParent(d.floating)),H=await(u.isElement==null?void 0:u.isElement(M))?await(u.getScale==null?void 0:u.getScale(M))||{x:1,y:1}:{x:1,y:1},z=fc(u.convertOffsetParentRelativeRectToViewportRelativeRect?await u.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:$,offsetParent:M,strategy:h}):$);return{top:(D.top-z.top+A.top)/H.y,bottom:(z.bottom-D.bottom+A.bottom)/H.y,left:(D.left-z.left+A.left)/H.x,right:(z.right-D.right+A.right)/H.x}}const mk=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,s;const{placement:o,middlewareData:u,rects:c,initialPlacement:d,platform:h,elements:p}=t,{mainAxis:y=!0,crossAxis:g=!0,fallbackPlacements:v,fallbackStrategy:S="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:E=!0,..._}=Pc(e,t);if((n=u.arrow)!=null&&n.alignmentOffset)return{};const D=ar(o),$=ir(d),M=ar(d)===d,H=await(h.isRTL==null?void 0:h.isRTL(p.floating)),z=v||(M||!E?[cc(d)]:NC(d)),ee=A!=="none";!v&&ee&&z.push(...BC(d,E,A,H));const ie=[d,...z],te=await Vx(t,_),fe=[];let me=((s=u.flip)==null?void 0:s.overflows)||[];if(y&&fe.push(te[D]),g){const X=DC(o,c,H);fe.push(te[X[0]],te[X[1]])}if(me=[...me,{placement:o,overflows:fe}],!fe.every(X=>X<=0)){var Se,Ce;const X=(((Se=u.flip)==null?void 0:Se.index)||0)+1,L=ie[X];if(L){var we;const F=g==="alignment"?$!==ir(L):!1,J=((we=me[0])==null?void 0:we.overflows[0])>0;if(!F||J)return{data:{index:X,overflows:me},reset:{placement:L}}}let P=(Ce=me.filter(F=>F.overflows[0]<=0).sort((F,J)=>F.overflows[1]-J.overflows[1])[0])==null?void 0:Ce.placement;if(!P)switch(S){case"bestFit":{var ye;const F=(ye=me.filter(J=>{if(ee){const T=ir(J.placement);return T===$||T==="y"}return!0}).map(J=>[J.placement,J.overflows.filter(T=>T>0).reduce((T,U)=>T+U,0)]).sort((J,T)=>J[1]-T[1])[0])==null?void 0:ye[0];F&&(P=F);break}case"initialPlacement":P=d;break}if(o!==P)return{reset:{placement:P}}}return{}}}};async function yk(e,t){const{placement:n,platform:s,elements:o}=e,u=await(s.isRTL==null?void 0:s.isRTL(o.floating)),c=ar(n),d=Ic(n),h=ir(n)==="y",p=["left","top"].includes(c)?-1:1,y=u&&h?-1:1,g=Pc(t,e);let{mainAxis:v,crossAxis:S,alignmentAxis:A}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof A=="number"&&(S=d==="end"?A*-1:A),h?{x:S*y,y:v*p}:{x:v*p,y:S*y}}const gk=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,s;const{x:o,y:u,placement:c,middlewareData:d}=t,h=await yk(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(s=d.arrow)!=null&&s.alignmentOffset?{}:{x:o+h.x,y:u+h.y,data:{...h,placement:c}}}}},bk=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:s,placement:o}=t,{mainAxis:u=!0,crossAxis:c=!1,limiter:d={fn:_=>{let{x:D,y:$}=_;return{x:D,y:$}}},...h}=Pc(e,t),p={x:n,y:s},y=await Vx(t,h),g=ir(ar(o)),v=Tx(g);let S=p[v],A=p[g];if(u){const _=v==="y"?"top":"left",D=v==="y"?"bottom":"right",$=S+y[_],M=S-y[D];S=z0($,S,M)}if(c){const _=g==="y"?"top":"left",D=g==="y"?"bottom":"right",$=A+y[_],M=A-y[D];A=z0($,A,M)}const E=d.fn({...t,[v]:S,[g]:A});return{...E,data:{x:E.x-n,y:E.y-s,enabled:{[v]:u,[g]:c}}}}}};function jx(e){const t=jn(e);let n=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const o=Ot(e),u=o?e.offsetWidth:n,c=o?e.offsetHeight:s,d=uc(n)!==u||uc(s)!==c;return d&&(n=u,s=c),{width:n,height:s,$:d}}function Mm(e){return pt(e)?e:e.contextElement}function fo(e){const t=Mm(e);if(!Ot(t))return ii(1);const n=t.getBoundingClientRect(),{width:s,height:o,$:u}=jx(t);let c=(u?uc(n.width):n.width)/s,d=(u?uc(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const vk=ii(0);function zx(e){const t=wn(e);return!qc()||!t.visualViewport?vk:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Sk(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==wn(e)?!1:t}function lr(e,t,n,s){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),u=Mm(e);let c=ii(1);t&&(s?pt(s)&&(c=fo(s)):c=fo(e));const d=Sk(u,n,s)?zx(u):ii(0);let h=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,y=o.width/c.x,g=o.height/c.y;if(u){const v=wn(u),S=s&&pt(s)?wn(s):s;let A=v,E=yp(A);for(;E&&s&&S!==A;){const _=fo(E),D=E.getBoundingClientRect(),$=jn(E),M=D.left+(E.clientLeft+parseFloat($.paddingLeft))*_.x,H=D.top+(E.clientTop+parseFloat($.paddingTop))*_.y;h*=_.x,p*=_.y,y*=_.x,g*=_.y,h+=M,p+=H,A=wn(E),E=yp(A)}}return fc({width:y,height:g,x:h,y:p})}function _m(e,t){const n=Kc(e).scrollLeft;return t?t.left+n:lr(hi(e)).left+n}function Ux(e,t,n){n===void 0&&(n=!1);const s=e.getBoundingClientRect(),o=s.left+t.scrollLeft-(n?0:_m(e,s)),u=s.top+t.scrollTop;return{x:o,y:u}}function wk(e){let{elements:t,rect:n,offsetParent:s,strategy:o}=e;const u=o==="fixed",c=hi(s),d=t?Uc(t.floating):!1;if(s===c||d&&u)return n;let h={scrollLeft:0,scrollTop:0},p=ii(1);const y=ii(0),g=Ot(s);if((g||!g&&!u)&&((Es(s)!=="body"||ol(c))&&(h=Kc(s)),Ot(s))){const S=lr(s);p=fo(s),y.x=S.x+s.clientLeft,y.y=S.y+s.clientTop}const v=c&&!g&&!u?Ux(c,h,!0):ii(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-h.scrollLeft*p.x+y.x+v.x,y:n.y*p.y-h.scrollTop*p.y+y.y+v.y}}function xk(e){return Array.from(e.getClientRects())}function Ak(e){const t=hi(e),n=Kc(e),s=e.ownerDocument.body,o=nr(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),u=nr(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let c=-n.scrollLeft+_m(e);const d=-n.scrollTop;return jn(s).direction==="rtl"&&(c+=nr(t.clientWidth,s.clientWidth)-o),{width:o,height:u,x:c,y:d}}function Tk(e,t){const n=wn(e),s=hi(e),o=n.visualViewport;let u=s.clientWidth,c=s.clientHeight,d=0,h=0;if(o){u=o.width,c=o.height;const p=qc();(!p||p&&t==="fixed")&&(d=o.offsetLeft,h=o.offsetTop)}return{width:u,height:c,x:d,y:h}}function Ek(e,t){const n=lr(e,!0,t==="fixed"),s=n.top+e.clientTop,o=n.left+e.clientLeft,u=Ot(e)?fo(e):ii(1),c=e.clientWidth*u.x,d=e.clientHeight*u.y,h=o*u.x,p=s*u.y;return{width:c,height:d,x:h,y:p}}function G0(e,t,n){let s;if(t==="viewport")s=Tk(e,n);else if(t==="document")s=Ak(hi(e));else if(pt(t))s=Ek(t,n);else{const o=zx(e);s={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return fc(s)}function qx(e,t){const n=Vi(e);return n===t||!pt(n)||$i(n)?!1:jn(n).position==="fixed"||qx(n,t)}function Rk(e,t){const n=t.get(e);if(n)return n;let s=Ss(e,[],!1).filter(d=>pt(d)&&Es(d)!=="body"),o=null;const u=jn(e).position==="fixed";let c=u?Vi(e):e;for(;pt(c)&&!$i(c);){const d=jn(c),h=Rm(c);!h&&d.position==="fixed"&&(o=null),(u?!h&&!o:!h&&d.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||ol(c)&&!h&&qx(e,c))?s=s.filter(y=>y!==c):o=d,c=Vi(c)}return t.set(e,s),s}function Ok(e){let{element:t,boundary:n,rootBoundary:s,strategy:o}=e;const c=[...n==="clippingAncestors"?Uc(t)?[]:Rk(t,this._c):[].concat(n),s],d=c[0],h=c.reduce((p,y)=>{const g=G0(t,y,o);return p.top=nr(g.top,p.top),p.right=lc(g.right,p.right),p.bottom=lc(g.bottom,p.bottom),p.left=nr(g.left,p.left),p},G0(t,d,o));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function Mk(e){const{width:t,height:n}=jx(e);return{width:t,height:n}}function _k(e,t,n){const s=Ot(t),o=hi(t),u=n==="fixed",c=lr(e,!0,u,t);let d={scrollLeft:0,scrollTop:0};const h=ii(0);function p(){h.x=_m(o)}if(s||!s&&!u)if((Es(t)!=="body"||ol(o))&&(d=Kc(t)),s){const S=lr(t,!0,u,t);h.x=S.x+t.clientLeft,h.y=S.y+t.clientTop}else o&&p();u&&!s&&o&&p();const y=o&&!s&&!u?Ux(o,d):ii(0),g=c.left+d.scrollLeft-h.x-y.x,v=c.top+d.scrollTop-h.y-y.y;return{x:g,y:v,width:c.width,height:c.height}}function _h(e){return jn(e).position==="static"}function Y0(e,t){if(!Ot(e)||jn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return hi(e)===n&&(n=n.ownerDocument.body),n}function Kx(e,t){const n=wn(e);if(Uc(e))return n;if(!Ot(e)){let o=Vi(e);for(;o&&!$i(o);){if(pt(o)&&!_h(o))return o;o=Vi(o)}return n}let s=Y0(e,t);for(;s&&MC(s)&&_h(s);)s=Y0(s,t);return s&&$i(s)&&_h(s)&&!Rm(s)?n:s||_C(e)||n}const Ck=async function(e){const t=this.getOffsetParent||Kx,n=this.getDimensions,s=await n(e.floating);return{reference:_k(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function kk(e){return jn(e).direction==="rtl"}const Dk={convertOffsetParentRelativeRectToViewportRelativeRect:wk,getDocumentElement:hi,getClippingRect:Ok,getOffsetParent:Kx,getElementRects:Ck,getClientRects:xk,getDimensions:Mk,getScale:fo,isElement:pt,isRTL:kk};function Px(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Nk(e,t){let n=null,s;const o=hi(e);function u(){var d;clearTimeout(s),(d=n)==null||d.disconnect(),n=null}function c(d,h){d===void 0&&(d=!1),h===void 0&&(h=1),u();const p=e.getBoundingClientRect(),{left:y,top:g,width:v,height:S}=p;if(d||t(),!v||!S)return;const A=Bu(g),E=Bu(o.clientWidth-(y+v)),_=Bu(o.clientHeight-(g+S)),D=Bu(y),M={rootMargin:-A+"px "+-E+"px "+-_+"px "+-D+"px",threshold:nr(0,lc(1,h))||1};let H=!0;function z(ee){const ie=ee[0].intersectionRatio;if(ie!==h){if(!H)return c();ie?c(!1,ie):s=setTimeout(()=>{c(!1,1e-7)},1e3)}ie===1&&!Px(p,e.getBoundingClientRect())&&c(),H=!1}try{n=new IntersectionObserver(z,{...M,root:o.ownerDocument})}catch{n=new IntersectionObserver(z,M)}n.observe(e)}return c(!0),u}function $k(e,t,n,s){s===void 0&&(s={});const{ancestorScroll:o=!0,ancestorResize:u=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:h=!1}=s,p=Mm(e),y=o||u?[...p?Ss(p):[],...Ss(t)]:[];y.forEach(D=>{o&&D.addEventListener("scroll",n,{passive:!0}),u&&D.addEventListener("resize",n)});const g=p&&d?Nk(p,n):null;let v=-1,S=null;c&&(S=new ResizeObserver(D=>{let[$]=D;$&&$.target===p&&S&&(S.unobserve(t),cancelAnimationFrame(v),v=requestAnimationFrame(()=>{var M;(M=S)==null||M.observe(t)})),n()}),p&&!h&&S.observe(p),S.observe(t));let A,E=h?lr(e):null;h&&_();function _(){const D=lr(e);E&&!Px(E,D)&&n(),E=D,A=requestAnimationFrame(_)}return n(),()=>{var D;y.forEach($=>{o&&$.removeEventListener("scroll",n),u&&$.removeEventListener("resize",n)}),g==null||g(),(D=S)==null||D.disconnect(),S=null,h&&cancelAnimationFrame(A)}}const Bk=gk,Lk=bk,Vk=mk,jk=(e,t,n)=>{const s=new Map,o={platform:Dk,...n},u={...o.platform,_c:s};return pk(e,t,{...o,platform:u})};var Xu=typeof document<"u"?V.useLayoutEffect:V.useEffect;function mc(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,s,o;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(s=n;s--!==0;)if(!mc(e[s],t[s]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(t,o[s]))return!1;for(s=n;s--!==0;){const u=o[s];if(!(u==="_owner"&&e.$$typeof)&&!mc(e[u],t[u]))return!1}return!0}return e!==e&&t!==t}function Ix(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function X0(e,t){const n=Ix(e);return Math.round(t*n)/n}function Ch(e){const t=V.useRef(e);return Xu(()=>{t.current=e}),t}function zk(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:s=[],platform:o,elements:{reference:u,floating:c}={},transform:d=!0,whileElementsMounted:h,open:p}=e,[y,g]=V.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,S]=V.useState(s);mc(v,s)||S(s);const[A,E]=V.useState(null),[_,D]=V.useState(null),$=V.useCallback(F=>{F!==ee.current&&(ee.current=F,E(F))},[]),M=V.useCallback(F=>{F!==ie.current&&(ie.current=F,D(F))},[]),H=u||A,z=c||_,ee=V.useRef(null),ie=V.useRef(null),te=V.useRef(y),fe=h!=null,me=Ch(h),Se=Ch(o),Ce=Ch(p),we=V.useCallback(()=>{if(!ee.current||!ie.current)return;const F={placement:t,strategy:n,middleware:v};Se.current&&(F.platform=Se.current),jk(ee.current,ie.current,F).then(J=>{const T={...J,isPositioned:Ce.current!==!1};ye.current&&!mc(te.current,T)&&(te.current=T,hk.flushSync(()=>{g(T)}))})},[v,t,n,Se,Ce]);Xu(()=>{p===!1&&te.current.isPositioned&&(te.current.isPositioned=!1,g(F=>({...F,isPositioned:!1})))},[p]);const ye=V.useRef(!1);Xu(()=>(ye.current=!0,()=>{ye.current=!1}),[]),Xu(()=>{if(H&&(ee.current=H),z&&(ie.current=z),H&&z){if(me.current)return me.current(H,z,we);we()}},[H,z,we,me,fe]);const X=V.useMemo(()=>({reference:ee,floating:ie,setReference:$,setFloating:M}),[$,M]),L=V.useMemo(()=>({reference:H,floating:z}),[H,z]),P=V.useMemo(()=>{const F={position:n,left:0,top:0};if(!L.floating)return F;const J=X0(L.floating,y.x),T=X0(L.floating,y.y);return d?{...F,transform:"translate("+J+"px, "+T+"px)",...Ix(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:J,top:T}},[n,d,L.floating,y.x,y.y]);return V.useMemo(()=>({...y,update:we,refs:X,elements:L,floatingStyles:P}),[y,we,X,L,P])}const Uk=(e,t)=>({...Bk(e),options:[e,t]}),qk=(e,t)=>({...Lk(e),options:[e,t]}),Kk=(e,t)=>({...Vk(e),options:[e,t]}),Pk="data-floating-ui-focusable",Z0="active",J0="selected",Ik={...Zw};let Q0=!1,Hk=0;const W0=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Hk++;function Fk(){const[e,t]=V.useState(()=>Q0?W0():void 0);return Ni(()=>{e==null&&t(W0())},[]),V.useEffect(()=>{Q0=!0},[]),e}const Gk=Ik.useId,Hx=Gk||Fk;function Yk(){const e=new Map;return{emit(t,n){var s;(s=e.get(t))==null||s.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var s;(s=e.get(t))==null||s.delete(n)}}}const Xk=V.createContext(null),Zk=V.createContext(null),Fx=()=>{var e;return((e=V.useContext(Xk))==null?void 0:e.id)||null},Cm=()=>V.useContext(Zk);function yc(e){return"data-floating-ui-"+e}function Jk(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}let eS=0;function Qr(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:s=!0,sync:o=!1}=t;s&&cancelAnimationFrame(eS);const u=()=>e==null?void 0:e.focus({preventScroll:n});o?u():eS=requestAnimationFrame(u)}function Qk(e){return(e==null?void 0:e.ownerDocument)||document}let Wr=new WeakMap,Lu=new WeakSet,Vu={},kh=0;const Wk=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Gx=e=>e&&(e.host||Gx(e.parentNode)),eD=(e,t)=>t.map(n=>{if(e.contains(n))return n;const s=Gx(n);return e.contains(s)?s:null}).filter(n=>n!=null);function tD(e,t,n,s){const o="data-floating-ui-inert",u=s?"inert":n?"aria-hidden":null,c=eD(t,e),d=new Set,h=new Set(c),p=[];Vu[o]||(Vu[o]=new WeakMap);const y=Vu[o];c.forEach(g),v(t),d.clear();function g(S){!S||d.has(S)||(d.add(S),S.parentNode&&g(S.parentNode))}function v(S){!S||h.has(S)||[].forEach.call(S.children,A=>{if(Es(A)!=="script")if(d.has(A))v(A);else{const E=u?A.getAttribute(u):null,_=E!==null&&E!=="false",D=Wr.get(A)||0,$=u?D+1:D,M=(y.get(A)||0)+1;Wr.set(A,$),y.set(A,M),p.push(A),$===1&&_&&Lu.add(A),M===1&&A.setAttribute(o,""),!_&&u&&A.setAttribute(u,u==="inert"?"":"true")}})}return kh++,()=>{p.forEach(S=>{const A=Wr.get(S)||0,E=u?A-1:A,_=(y.get(S)||0)-1;Wr.set(S,E),y.set(S,_),E||(!Lu.has(S)&&u&&S.removeAttribute(u),Lu.delete(S)),_||S.removeAttribute(o)}),kh--,kh||(Wr=new WeakMap,Wr=new WeakMap,Lu=new WeakSet,Vu={})}}function tS(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=Qk(e[0]).body;return tD(e.concat(Array.from(s.querySelectorAll("[aria-live]"))),s,t,n)}const km={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"fixed",whiteSpace:"nowrap",width:"1px",top:0,left:0},nS=V.forwardRef(function(t,n){const[s,o]=V.useState();Ni(()=>{tk()&&o("button")},[]);const u={ref:n,tabIndex:0,role:s,"aria-hidden":s?void 0:!0,[yc("focus-guard")]:"",style:km};return Y.jsx("span",{...t,...u})}),nD=V.createContext(null),iD=()=>V.useContext(nD);function iS(e){return V.useMemo(()=>t=>{e.forEach(n=>{n&&(n.current=t)})},e)}const sD=20;let Gs=[];function rD(e){Gs=Gs.filter(t=>t.isConnected),e&&Es(e)!=="body"&&(Gs.push(e),Gs.length>sD&&(Gs=Gs.slice(-20)))}function sS(){return Gs.slice().reverse().find(e=>e.isConnected)}function oD(e){const t=Hc();return Nx(e,t)?e:Om(e,t)[0]||e}function rS(e,t){var n;if(!t.current.includes("floating")&&!((n=e.getAttribute("role"))!=null&&n.includes("dialog")))return;const s=Hc(),u=WC(e,s).filter(d=>{const h=d.getAttribute("data-tabindex")||"";return Nx(d,s)||d.hasAttribute("data-tabindex")&&!h.startsWith("-")}),c=e.getAttribute("tabindex");t.current.includes("floating")||u.length===0?c!=="0"&&e.setAttribute("tabindex","0"):(c!=="-1"||e.hasAttribute("data-tabindex")&&e.getAttribute("data-tabindex")!=="-1")&&(e.setAttribute("tabindex","-1"),e.setAttribute("data-tabindex","-1"))}const aD=V.forwardRef(function(t,n){return Y.jsx("button",{...t,type:"button",ref:n,tabIndex:-1,style:km})});function lD(e){const{context:t,children:n,disabled:s=!1,order:o=["content"],guards:u=!0,initialFocus:c=0,returnFocus:d=!0,restoreFocus:h=!1,modal:p=!0,visuallyHiddenDismiss:y=!1,closeOnFocusOut:g=!0,outsideElementsInert:v=!1,getInsideElements:S=()=>[]}=e,{open:A,onOpenChange:E,events:_,dataRef:D,elements:{domReference:$,floating:M}}=t,H=ti(()=>{var ge;return(ge=D.current.floatingContext)==null?void 0:ge.nodeId}),z=ti(S),ee=typeof c=="number"&&c<0,ie=K0($)&&ee,te=Wk(),fe=te?u:!0,me=!fe||te&&v,Se=Mh(o),Ce=Mh(c),we=Mh(d),ye=Cm(),X=iD(),L=V.useRef(null),P=V.useRef(null),F=V.useRef(!1),J=V.useRef(!1),T=V.useRef(-1),U=X!=null,G=wp(M),Q=ti(function(ge){return ge===void 0&&(ge=G),ge?Om(ge,Hc()):[]}),re=ti(ge=>{const ke=Q(ge);return Se.current.map(xe=>$&&xe==="reference"?$:G&&xe==="floating"?G:ke).filter(Boolean).flat()});V.useEffect(()=>{if(s||!p)return;function ge(xe){if(xe.key==="Tab"){vn(G,no(Fn(G)))&&Q().length===0&&!ie&&Oh(xe);const Ae=re(),_t=Js(xe);Se.current[0]==="reference"&&_t===$&&(Oh(xe),xe.shiftKey?Qr(Ae[Ae.length-1]):Qr(Ae[1])),Se.current[1]==="floating"&&_t===G&&xe.shiftKey&&(Oh(xe),Qr(Ae[0]))}}const ke=Fn(G);return ke.addEventListener("keydown",ge),()=>{ke.removeEventListener("keydown",ge)}},[s,$,G,p,Se,ie,Q,re]),V.useEffect(()=>{if(s||!M)return;function ge(ke){const xe=Js(ke),_t=Q().indexOf(xe);_t!==-1&&(T.current=_t)}return M.addEventListener("focusin",ge),()=>{M.removeEventListener("focusin",ge)}},[s,M,Q]),V.useEffect(()=>{if(s||!g)return;function ge(){J.current=!0,setTimeout(()=>{J.current=!1})}function ke(xe){const Ae=xe.relatedTarget,_t=xe.currentTarget;queueMicrotask(()=>{const xt=H(),ct=!(vn($,Ae)||vn(M,Ae)||vn(Ae,M)||vn(X==null?void 0:X.portalNode,Ae)||Ae!=null&&Ae.hasAttribute(yc("focus-guard"))||ye&&(qa(ye.nodesRef.current,xt).find(Ct=>{var Ge,et;return vn((Ge=Ct.context)==null?void 0:Ge.elements.floating,Ae)||vn((et=Ct.context)==null?void 0:et.elements.domReference,Ae)})||P0(ye.nodesRef.current,xt).find(Ct=>{var Ge,et,Os;return[(Ge=Ct.context)==null?void 0:Ge.elements.floating,wp((et=Ct.context)==null?void 0:et.elements.floating)].includes(Ae)||((Os=Ct.context)==null?void 0:Os.elements.domReference)===Ae})));if(_t===$&&G&&rS(G,Se),h&&ct&&no(Fn(G))===Fn(G).body){Ot(G)&&G.focus();const Ct=T.current,Ge=Q(),et=Ge[Ct]||Ge[Ge.length-1]||G;Ot(et)&&et.focus()}if(D.current.insideReactTree){D.current.insideReactTree=!1;return}(ie||!p)&&Ae&&ct&&!J.current&&Ae!==sS()&&(F.current=!0,E(!1,xe,"focus-out"))})}if(M&&Ot($))return $.addEventListener("focusout",ke),$.addEventListener("pointerdown",ge),M.addEventListener("focusout",ke),()=>{$.removeEventListener("focusout",ke),$.removeEventListener("pointerdown",ge),M.removeEventListener("focusout",ke)}},[s,$,M,G,p,ye,X,E,g,h,Q,ie,H,Se,D]);const Ee=V.useRef(null),se=V.useRef(null),Ze=iS([Ee,X==null?void 0:X.beforeInsideRef]),Ne=iS([se,X==null?void 0:X.afterInsideRef]);V.useEffect(()=>{var ge,ke;if(s||!M)return;const xe=Array.from((X==null||(ge=X.portalNode)==null?void 0:ge.querySelectorAll("["+yc("portal")+"]"))||[]),Ae=ye?P0(ye.nodesRef.current,H()):[],_t=ye&&!p?Ae.map(Ge=>{var et;return(et=Ge.context)==null?void 0:et.elements.floating}):[],xt=(ke=Ae.find(Ge=>{var et;return K0(((et=Ge.context)==null?void 0:et.elements.domReference)||null)}))==null||(ke=ke.context)==null?void 0:ke.elements.domReference,ct=[M,xt,...xe,..._t,...z(),L.current,P.current,Ee.current,se.current,X==null?void 0:X.beforeOutsideRef.current,X==null?void 0:X.afterOutsideRef.current,Se.current.includes("reference")||ie?$:null].filter(Ge=>Ge!=null),Ct=p||ie?tS(ct,!me,me):tS(ct);return()=>{Ct()}},[s,$,M,p,Se,X,ie,fe,me,ye,H,z]),Ni(()=>{if(s||!Ot(G))return;const ge=Fn(G),ke=no(ge);queueMicrotask(()=>{const xe=re(G),Ae=Ce.current,_t=(typeof Ae=="number"?xe[Ae]:Ae.current)||G,xt=vn(G,ke);!ee&&!xt&&A&&Qr(_t,{preventScroll:_t===G})})},[s,A,G,ee,re,Ce]),Ni(()=>{if(s||!G)return;const ge=Fn(G),ke=no(ge);rD(ke);function xe(xt){let{reason:ct,event:Ct,nested:Ge}=xt;if(["hover","safe-polygon"].includes(ct)&&Ct.type==="mouseleave"&&(F.current=!0),ct==="outside-press")if(Ge)F.current=!1;else if(ok(Ct)||ak(Ct))F.current=!1;else{let et=!1;document.createElement("div").focus({get preventScroll(){return et=!0,!1}}),et?F.current=!1:F.current=!0}}_.on("openchange",xe);const Ae=ge.createElement("span");Ae.setAttribute("tabindex","-1"),Ae.setAttribute("aria-hidden","true"),Object.assign(Ae.style,km),U&&$&&$.insertAdjacentElement("afterend",Ae);function _t(){if(typeof we.current=="boolean"){const xt=$||sS();return xt&&xt.isConnected?xt:Ae}return we.current.current||Ae}return()=>{_.off("openchange",xe);const xt=no(ge),ct=vn(M,xt)||ye&&qa(ye.nodesRef.current,H()).some(Ge=>{var et;return vn((et=Ge.context)==null?void 0:et.elements.floating,xt)}),Ct=_t();queueMicrotask(()=>{const Ge=oD(Ct);we.current&&!F.current&&Ot(Ge)&&(!(Ge!==xt&&xt!==ge.body)||ct)&&Ge.focus({preventScroll:!0}),Ae.remove()})}},[s,M,G,we,D,_,ye,U,$,H]),V.useEffect(()=>{queueMicrotask(()=>{F.current=!1})},[s]),Ni(()=>{if(!s&&X)return X.setFocusManagerState({modal:p,closeOnFocusOut:g,open:A,onOpenChange:E,domReference:$}),()=>{X.setFocusManagerState(null)}},[s,X,p,A,E,g,$]),Ni(()=>{s||G&&rS(G,Se)},[s,G,Se]);function un(ge){return s||!y||!p?null:Y.jsx(aD,{ref:ge==="start"?L:P,onClick:ke=>E(!1,ke.nativeEvent),children:typeof y=="string"?y:"Dismiss"})}const Hi=!s&&fe&&(p?!ie:!0)&&(U||p);return Y.jsxs(Y.Fragment,{children:[Hi&&Y.jsx(nS,{"data-type":"inside",ref:Ze,onFocus:ge=>{if(p){const xe=re();Qr(o[0]==="reference"?xe[0]:xe[xe.length-1])}else if(X!=null&&X.preserveTabOrder&&X.portalNode)if(F.current=!1,H0(ge,X.portalNode)){const xe=fk($);xe==null||xe.focus()}else{var ke;(ke=X.beforeOutsideRef.current)==null||ke.focus()}}}),!ie&&un("start"),n,un("end"),Hi&&Y.jsx(nS,{"data-type":"inside",ref:Ne,onFocus:ge=>{if(p)Qr(re()[0]);else if(X!=null&&X.preserveTabOrder&&X.portalNode)if(g&&(F.current=!0),H0(ge,X.portalNode)){const xe=dk($);xe==null||xe.focus()}else{var ke;(ke=X.afterOutsideRef.current)==null||ke.focus()}}})]})}function oS(e){return Ot(e.target)&&e.target.tagName==="BUTTON"}function uD(e){return Ot(e.target)&&e.target.tagName==="A"}function aS(e){return Bx(e)}function cD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:s,dataRef:o,elements:{domReference:u}}=e,{enabled:c=!0,event:d="click",toggle:h=!0,ignoreMouse:p=!1,keyboardHandlers:y=!0,stickIfOpen:g=!0}=t,v=V.useRef(),S=V.useRef(!1),A=V.useMemo(()=>({onPointerDown(E){v.current=E.pointerType},onMouseDown(E){const _=v.current;E.button===0&&d!=="click"&&(I0(_)&&p||(n&&h&&(!(o.current.openEvent&&g)||o.current.openEvent.type==="mousedown")?s(!1,E.nativeEvent,"click"):(E.preventDefault(),s(!0,E.nativeEvent,"click"))))},onClick(E){const _=v.current;if(d==="mousedown"&&v.current){v.current=void 0;return}I0(_)&&p||(n&&h&&(!(o.current.openEvent&&g)||o.current.openEvent.type==="click")?s(!1,E.nativeEvent,"click"):s(!0,E.nativeEvent,"click"))},onKeyDown(E){v.current=void 0,!(E.defaultPrevented||!y||oS(E))&&(E.key===" "&&!aS(u)&&(E.preventDefault(),S.current=!0),!uD(E)&&E.key==="Enter"&&s(!(n&&h),E.nativeEvent,"click"))},onKeyUp(E){E.defaultPrevented||!y||oS(E)||aS(u)||E.key===" "&&S.current&&(S.current=!1,s(!(n&&h),E.nativeEvent,"click"))}}),[o,u,d,p,y,s,n,g,h]);return V.useMemo(()=>c?{reference:A}:{},[c,A])}const fD={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},dD={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},lS=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function hD(e,t){t===void 0&&(t={});const{open:n,onOpenChange:s,elements:o,dataRef:u}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:h=!0,outsidePressEvent:p="pointerdown",referencePress:y=!1,referencePressEvent:g="pointerdown",ancestorScroll:v=!1,bubbles:S,capture:A}=t,E=Cm(),_=ti(typeof h=="function"?h:()=>!1),D=typeof h=="function"?_:h,$=V.useRef(!1),{escapeKey:M,outsidePress:H}=lS(S),{escapeKey:z,outsidePress:ee}=lS(A),ie=V.useRef(!1),te=V.useRef(-1),fe=ti(X=>{var L;if(!n||!c||!d||X.key!=="Escape"||ie.current)return;const P=(L=u.current.floatingContext)==null?void 0:L.nodeId,F=E?qa(E.nodesRef.current,P):[];if(!M&&(X.stopPropagation(),F.length>0)){let J=!0;if(F.forEach(T=>{var U;if((U=T.context)!=null&&U.open&&!T.context.dataRef.current.__escapeKeyBubbles){J=!1;return}}),!J)return}s(!1,rk(X)?X.nativeEvent:X,"escape-key")}),me=ti(X=>{var L;const P=()=>{var F;fe(X),(F=Js(X))==null||F.removeEventListener("keydown",P)};(L=Js(X))==null||L.addEventListener("keydown",P)}),Se=ti(X=>{var L;const P=u.current.insideReactTree;u.current.insideReactTree=!1;const F=$.current;if($.current=!1,p==="click"&&F||P||typeof D=="function"&&!D(X))return;const J=Js(X),T="["+yc("inert")+"]",U=Fn(o.floating).querySelectorAll(T);let G=pt(J)?J:null;for(;G&&!$i(G);){const se=Vi(G);if($i(se)||!pt(se))break;G=se}if(U.length&&pt(J)&&!sk(J)&&!vn(J,o.floating)&&Array.from(U).every(se=>!vn(G,se)))return;if(Ot(J)&&ye){const se=$i(J),Ze=jn(J),Ne=/auto|scroll/,un=se||Ne.test(Ze.overflowX),Hi=se||Ne.test(Ze.overflowY),ge=un&&J.clientWidth>0&&J.scrollWidth>J.clientWidth,ke=Hi&&J.clientHeight>0&&J.scrollHeight>J.clientHeight,xe=Ze.direction==="rtl",Ae=ke&&(xe?X.offsetX<=J.offsetWidth-J.clientWidth:X.offsetX>J.clientWidth),_t=ge&&X.offsetY>J.clientHeight;if(Ae||_t)return}const Q=(L=u.current.floatingContext)==null?void 0:L.nodeId,re=E&&qa(E.nodesRef.current,Q).some(se=>{var Ze;return Rh(X,(Ze=se.context)==null?void 0:Ze.elements.floating)});if(Rh(X,o.floating)||Rh(X,o.domReference)||re)return;const Ee=E?qa(E.nodesRef.current,Q):[];if(Ee.length>0){let se=!0;if(Ee.forEach(Ze=>{var Ne;if((Ne=Ze.context)!=null&&Ne.open&&!Ze.context.dataRef.current.__outsidePressBubbles){se=!1;return}}),!se)return}s(!1,X,"outside-press")}),Ce=ti(X=>{var L;const P=()=>{var F;Se(X),(F=Js(X))==null||F.removeEventListener(p,P)};(L=Js(X))==null||L.addEventListener(p,P)});V.useEffect(()=>{if(!n||!c)return;u.current.__escapeKeyBubbles=M,u.current.__outsidePressBubbles=H;let X=-1;function L(U){s(!1,U,"ancestor-scroll")}function P(){window.clearTimeout(X),ie.current=!0}function F(){X=window.setTimeout(()=>{ie.current=!1},qc()?5:0)}const J=Fn(o.floating);d&&(J.addEventListener("keydown",z?me:fe,z),J.addEventListener("compositionstart",P),J.addEventListener("compositionend",F)),D&&J.addEventListener(p,ee?Ce:Se,ee);let T=[];return v&&(pt(o.domReference)&&(T=Ss(o.domReference)),pt(o.floating)&&(T=T.concat(Ss(o.floating))),!pt(o.reference)&&o.reference&&o.reference.contextElement&&(T=T.concat(Ss(o.reference.contextElement)))),T=T.filter(U=>{var G;return U!==((G=J.defaultView)==null?void 0:G.visualViewport)}),T.forEach(U=>{U.addEventListener("scroll",L,{passive:!0})}),()=>{d&&(J.removeEventListener("keydown",z?me:fe,z),J.removeEventListener("compositionstart",P),J.removeEventListener("compositionend",F)),D&&J.removeEventListener(p,ee?Ce:Se,ee),T.forEach(U=>{U.removeEventListener("scroll",L)}),window.clearTimeout(X)}},[u,o,d,D,p,n,s,v,c,M,H,fe,z,me,Se,ee,Ce]),V.useEffect(()=>{u.current.insideReactTree=!1},[u,D,p]);const we=V.useMemo(()=>({onKeyDown:fe,...y&&{[fD[g]]:X=>{s(!1,X.nativeEvent,"reference-press")},...g!=="click"&&{onClick(X){s(!1,X.nativeEvent,"reference-press")}}}}),[fe,s,y,g]),ye=V.useMemo(()=>({onKeyDown:fe,onMouseDown(){$.current=!0},onMouseUp(){$.current=!0},[dD[p]]:()=>{u.current.insideReactTree=!0},onBlurCapture(){Jk(te),u.current.insideReactTree=!0,te.current=window.setTimeout(()=>{u.current.insideReactTree=!1})}}),[fe,p,u]);return V.useMemo(()=>c?{reference:we,floating:ye}:{},[c,we,ye])}function pD(e){const{open:t=!1,onOpenChange:n,elements:s}=e,o=Hx(),u=V.useRef({}),[c]=V.useState(()=>Yk()),d=Fx()!=null,[h,p]=V.useState(s.reference),y=ti((S,A,E)=>{u.current.openEvent=S?A:void 0,c.emit("openchange",{open:S,event:A,reason:E,nested:d}),n==null||n(S,A,E)}),g=V.useMemo(()=>({setPositionReference:p}),[]),v=V.useMemo(()=>({reference:h||s.reference||null,floating:s.floating||null,domReference:s.reference}),[h,s.reference,s.floating]);return V.useMemo(()=>({dataRef:u,open:t,onOpenChange:y,elements:v,events:c,floatingId:o,refs:g}),[t,y,v,c,o,g])}function mD(e){e===void 0&&(e={});const{nodeId:t}=e,n=pD({...e,elements:{reference:null,floating:null,...e.elements}}),s=e.rootContext||n,o=s.elements,[u,c]=V.useState(null),[d,h]=V.useState(null),y=(o==null?void 0:o.domReference)||u,g=V.useRef(null),v=Cm();Ni(()=>{y&&(g.current=y)},[y]);const S=zk({...e,elements:{...o,...d&&{reference:d}}}),A=V.useCallback(M=>{const H=pt(M)?{getBoundingClientRect:()=>M.getBoundingClientRect(),getClientRects:()=>M.getClientRects(),contextElement:M}:M;h(H),S.refs.setReference(H)},[S.refs]),E=V.useCallback(M=>{(pt(M)||M===null)&&(g.current=M,c(M)),(pt(S.refs.reference.current)||S.refs.reference.current===null||M!==null&&!pt(M))&&S.refs.setReference(M)},[S.refs]),_=V.useMemo(()=>({...S.refs,setReference:E,setPositionReference:A,domReference:g}),[S.refs,E,A]),D=V.useMemo(()=>({...S.elements,domReference:y}),[S.elements,y]),$=V.useMemo(()=>({...S,...s,refs:_,elements:D,nodeId:t}),[S,_,D,t,s]);return Ni(()=>{s.dataRef.current.floatingContext=$;const M=v==null?void 0:v.nodesRef.current.find(H=>H.id===t);M&&(M.context=$)}),V.useMemo(()=>({...S,context:$,refs:_,elements:D}),[S,_,D,$])}function Dh(e,t,n){const s=new Map,o=n==="item";let u=e;if(o&&e){const{[Z0]:c,[J0]:d,...h}=e;u=h}return{...n==="floating"&&{tabIndex:-1,[Pk]:""},...u,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(h=>{let[p,y]=h;if(!(o&&[Z0,J0].includes(p)))if(p.indexOf("on")===0){if(s.has(p)||s.set(p,[]),typeof y=="function"){var g;(g=s.get(p))==null||g.push(y),c[p]=function(){for(var v,S=arguments.length,A=new Array(S),E=0;E<S;E++)A[E]=arguments[E];return(v=s.get(p))==null?void 0:v.map(_=>_(...A)).find(_=>_!==void 0)}}}else c[p]=y}),c),{})}}function yD(e){e===void 0&&(e=[]);const t=e.map(d=>d==null?void 0:d.reference),n=e.map(d=>d==null?void 0:d.floating),s=e.map(d=>d==null?void 0:d.item),o=V.useCallback(d=>Dh(d,e,"reference"),t),u=V.useCallback(d=>Dh(d,e,"floating"),n),c=V.useCallback(d=>Dh(d,e,"item"),s);return V.useMemo(()=>({getReferenceProps:o,getFloatingProps:u,getItemProps:c}),[o,u,c])}const gD=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function bD(e,t){var n,s;t===void 0&&(t={});const{open:o,elements:u,floatingId:c}=e,{enabled:d=!0,role:h="dialog"}=t,p=Hx(),y=((n=u.domReference)==null?void 0:n.id)||p,g=V.useMemo(()=>{var $;return(($=wp(u.floating))==null?void 0:$.id)||c},[u.floating,c]),v=(s=gD.get(h))!=null?s:h,A=Fx()!=null,E=V.useMemo(()=>v==="tooltip"||h==="label"?{["aria-"+(h==="label"?"labelledby":"describedby")]:o?g:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":v==="alertdialog"?"dialog":v,"aria-controls":o?g:void 0,...v==="listbox"&&{role:"combobox"},...v==="menu"&&{id:y},...v==="menu"&&A&&{role:"menuitem"},...h==="select"&&{"aria-autocomplete":"none"},...h==="combobox"&&{"aria-autocomplete":"list"}},[v,g,A,o,y,h]),_=V.useMemo(()=>{const $={id:g,...v&&{role:v}};return v==="tooltip"||h==="label"?$:{...$,...v==="menu"&&{"aria-labelledby":y}}},[v,g,y,h]),D=V.useCallback($=>{let{active:M,selected:H}=$;const z={role:"option",...M&&{id:g+"-fui-option"}};switch(h){case"select":return{...z,"aria-selected":M&&H};case"combobox":return{...z,"aria-selected":H}}return{}},[g,h]);return V.useMemo(()=>d?{reference:E,floating:_,item:D}:{},[d,E,_,D])}const al=e=>Array.isArray(e)?e:[e],vD=(e,t)=>{const n=[[],[]];for(const s of e)t(s)?n[0].push(s):n[1].push(s);return n},Yx=Array,Ys=(e,t)=>e.includes(t),SD=(e,t=0)=>[...new Array(e)].map((n,s)=>s+t),He=(e,t,n)=>e===void 0?t===void 0?[]:Array.isArray(t)?t:[t]:(Array.isArray(t)?e.push(...t):e.push(t),e),Ws=(e,t)=>t==null?e??[]:e==null?al(t):e.concat(t),wD=(...e)=>e.reduce(Ws,[]),sr=(e,t,n)=>{if(e===void 0)return Array.isArray(t)?t:[t];const s=(n==null?void 0:n.isEqual)??((o,u)=>o===u);for(const o of al(t))e.some(u=>s(u,o))||e.push(o);return e},xD=(e,t)=>e.reduce((n,s)=>{const o=s[t];return n[o]=He(n[o],s),n},{}),So=(e,t,n)=>e.length===t.length&&e.every(n!=null&&n.isEqual?(s,o)=>n.isEqual(s,t[o]):(s,o)=>s===t[o]),fr=(e,t)=>Gn(e)===t,Gn=e=>{const t=typeof e;return t==="object"?e===null?"null":"object":t==="function"?"object":t},ji={boolean:"boolean",null:"null",undefined:"undefined",bigint:"a bigint",number:"a number",object:"an object",string:"a string",symbol:"a symbol"},AD={...ji,function:"a function"};class TD extends Error{}const wt=e=>wo(e,TD),wo=(e,t=Error)=>{throw new t(e)};class ED extends Error{constructor(){super(...arguments);x(this,"name","ParseError")}}const Z=e=>wo(e,ED),Xx=e=>` ${e}`,Fe=(e,t)=>{const n={},s=Array.isArray(e);let o=!1;for(const[u,c]of Object.entries(e).entries()){const d=s?t(u,c[1]):t(...c,u);o||(o=typeof d[0]=="number");const h=Array.isArray(d[0])||d.length===0?d:[d];for(const[p,y]of h)typeof p=="object"?n[p.group]=He(n[p.group],y):n[p]=y}return o?Object.values(n):n},Zx=Object.entries,pi=(e,t)=>e in t,Dm=(e,t)=>t in e;class RD{constructor(t){Object.assign(this,t)}}const OD=class{};class Jx extends OD{}const MD=(e,t)=>{const n={},s={};let o;for(o in e)o in t?n[o]=e[o]:s[o]=e[o];return[n,s]},_D=(e,t)=>MD(e,t)[1],ll=e=>Object.keys(e).length===0,gc=e=>[...Object.entries(e),...Object.getOwnPropertySymbols(e).map(t=>[t,e[t]])],CD=(e,t)=>Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)),kD=e=>{const t=Object.keys(e).sort(),n={};for(let s=0;s<t.length;s++)n[t[s]]=e[t[s]];return n},Di=Xx("represents an uninitialized value"),DD=e=>Object.values(e).filter(t=>typeof t=="number"?!0:typeof e[t]!="number"),Qx={Array,Boolean,Date,Error,Function,Map,Number,Promise,RegExp,Set,String,WeakMap,WeakSet},Wx=globalThis.File??Blob,eA={ArrayBuffer,Blob,File:Wx,FormData,Headers,Request,Response,URL},ND={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,BigInt64Array,BigUint64Array},xo={...Qx,...eA,...ND,String,Number,Boolean},Nm=e=>{var s;let t=Object.getPrototypeOf(e);for(;t!=null&&t.constructor&&(!pi(t.constructor.name,xo)||!(e instanceof xo[t.constructor.name]));)t=Object.getPrototypeOf(t);const n=(s=t==null?void 0:t.constructor)==null?void 0:s.name;if(!(n===void 0||n==="Object"))return n},xp=e=>typeof e=="object"&&e!==null?Nm(e)??"object":Gn(e),Yt=Array.isArray,$D={Array:"an array",Function:"a function",Date:"a Date",RegExp:"a RegExp",Error:"an Error",Map:"a Map",Set:"a Set",String:"a String object",Number:"a Number object",Boolean:"a Boolean object",Promise:"a Promise",WeakMap:"a WeakMap",WeakSet:"a WeakSet"},BD={ArrayBuffer:"an ArrayBuffer instance",Blob:"a Blob instance",File:"a File instance",FormData:"a FormData instance",Headers:"a Headers instance",Request:"a Request instance",Response:"a Response instance",URL:"a URL instance"},LD={Int8Array:"an Int8Array",Uint8Array:"a Uint8Array",Uint8ClampedArray:"a Uint8ClampedArray",Int16Array:"an Int16Array",Uint16Array:"a Uint16Array",Int32Array:"an Int32Array",Uint32Array:"a Uint32Array",Float32Array:"a Float32Array",Float64Array:"a Float64Array",BigInt64Array:"a BigInt64Array",BigUint64Array:"a BigUint64Array"},VD={...$D,...BD,...LD},$m=e=>{const t=Object(e).name??null;return t&&pi(t,xo)&&xo[t]===e?t:null},uS=(e,t)=>{let n=e.prototype;for(;n!==null;){if(n===t.prototype)return!0;n=Object.getPrototypeOf(n)}return!1},jD=e=>tA(e,new Map),tA=(e,t)=>{if(typeof e!="object"||e===null)return e;if(t!=null&&t.has(e))return t.get(e);const n=$m(e.constructor);if(n==="Date")return new Date(e.getTime());if(n&&n!=="Array")return e;const s=Array.isArray(e)?e.slice():Object.create(Object.getPrototypeOf(e)),o=Object.getOwnPropertyDescriptors(e);if(t){t.set(e,s);for(const u in o){const c=o[u];"get"in c||"set"in c||(c.value=tA(c.value,t))}}return Object.defineProperties(s,o),s},zD=e=>{let t=Di;return()=>t===Di?t=e():t},Fc=e=>typeof e=="function"&&e.length===0,UD=class extends Function{constructor(...e){const t=e.slice(0,-1),n=e.at(-1);try{super(...t,n)}catch(s){return wt(`Encountered an unexpected error while compiling your definition:
66
+ Message: ${s}
67
+ Source: (${e.slice(0,-1)}) => {
68
+ ${e.at(-1)}
69
+ }`)}}};class _o{constructor(t,...[n]){return Object.assign(Object.setPrototypeOf(t.bind((n==null?void 0:n.bind)??this),this.constructor.prototype),n==null?void 0:n.attach)}}const qD=zD(()=>{try{return new Function("return false")()}catch{return!0}});class mi{constructor(){}}const KD=()=>{var e,t,n;try{return(((n=(((t=(e=new Error().stack)==null?void 0:e.split(`
70
+ `)[2])==null?void 0:t.trim())||"").match(/\(?(.+?)(?::\d+:\d+)?\)?$/))==null?void 0:n[1])||"unknown").replace(/^file:\/\//,"")}catch{return"unknown"}};var Cw;const PD=((Cw=globalThis.process)==null?void 0:Cw.env)??{},ID={fileName:KD,env:PD},HD=e=>e[0].toUpperCase()+e.slice(1),nA=e=>new RegExp(FD(e),typeof e=="string"?"":e.flags),FD=e=>`^(?:${typeof e=="string"?e:e.source})$`,bs={negativeLookahead:e=>`(?!${e})`,nonCapturingGroup:e=>`(?:${e})`},Ap="\\",Gc={" ":1,"\n":1," ":1},GD=/^-0\.?0*$/.source,iA=/[1-9]\d*/.source,YD=/\.\d+/.source,XD=/\.\d*[1-9]/.source,sA=e=>nA(bs.negativeLookahead(GD)+bs.nonCapturingGroup("-?"+bs.nonCapturingGroup(bs.nonCapturingGroup("0|"+iA)+bs.nonCapturingGroup(e.decimalPattern)+"?")+(e.allowDecimalOnly?"|"+e.decimalPattern:"")+"?")),cS=sA({decimalPattern:XD,allowDecimalOnly:!1}),ZD=cS.test.bind(cS),Tp=sA({decimalPattern:YD,allowDecimalOnly:!0});Tp.test.bind(Tp);const JD=/^-?\d*\.?\d*$/,QD=e=>e.length!==0&&JD.test(e),bc=nA(bs.negativeLookahead("^-0$")+"-?"+bs.nonCapturingGroup(bs.nonCapturingGroup("0|"+iA))),WD=bc.test.bind(bc),Ep=/^-?\d+$/,eN=Ep.test.bind(Ep),rA={number:"a number",bigint:"a bigint",integer:"an integer"},oA=(e,t)=>`'${e}' was parsed as ${rA[t]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`,tN=(e,t)=>t==="number"?ZD(e):WD(e),nN=(e,t)=>t==="number"?Number(e):Number.parseInt(e),iN=(e,t)=>t==="number"?QD(e):eN(e),sN=(e,t)=>Bm(e,"number",t),rN=(e,t)=>Bm(e,"number",{...t,strict:!0}),oN=(e,t)=>Bm(e,"integer",t),Bm=(e,t,n)=>{const s=nN(e,t);return!Number.isNaN(s)&&iN(e,t)?n!=null&&n.strict?tN(e,t)?s:Z(oA(e,t)):s:n!=null&&n.errorOnFail?Z((n==null?void 0:n.errorOnFail)===!0?`Failed to parse ${rA[t]} from '${e}'`:n==null?void 0:n.errorOnFail):void 0},aN=e=>{if(e[e.length-1]!=="n")return;const t=e.slice(0,-1);let n;try{n=BigInt(t)}catch{return}if(bc.test(t))return n;if(Ep.test(t))return Z(oA(e,"bigint"))},lN="0.46.0",uN={version:lN,filename:ID.fileName(),FileConstructor:Wx},ul=uN,fS=new Map,Nh=Object.create(null),Rp=e=>{const t=fS.get(e);if(t)return t;let n=cN(e);return Nh[n]?n=`${n}${Nh[n]++}`:Nh[n]=1,ul[n]=e,fS.set(e,n),n},Xa=e=>/^[$A-Z_a-z][\w$]*$/.test(e),cN=e=>{switch(typeof e){case"object":{if(e===null)break;const t=Nm(e)??"object";return t[0].toLowerCase()+t.slice(1)}case"function":return Xa(e.name)?e.name:"fn";case"symbol":return e.description&&Xa(e.description)?e.description:"symbol"}return wt(`Unexpected attempt to register serializable value of type ${Gn(e)}`)},Lm=e=>typeof e=="string"?JSON.stringify(e):typeof e=="bigint"?`${e}n`:`${e}`,fN=(e,t={})=>Ka(e,{onUndefined:"$ark.undefined",onBigInt:n=>`$ark.bigint-${n}`,...t},[]),Pe=(e,t)=>{switch(Gn(e)){case"object":const n=e,s=n.constructor.name;return s==="Object"||s==="Array"?(t==null?void 0:t.quoteKeys)===!1?vc(n,(t==null?void 0:t.indent)??0,""):JSON.stringify(Ka(n,Ao,[]),null,t==null?void 0:t.indent):vc(n,(t==null?void 0:t.indent)??0,"");case"symbol":return Ao.onSymbol(e);default:return Lm(e)}},vc=(e,t,n)=>{if(typeof e=="function")return Ao.onFunction(e);if(typeof e!="object"||e===null)return Lm(e);const s=n+" ".repeat(t);if(Array.isArray(e)){if(e.length===0)return"[]";const u=e.map(c=>vc(c,t,s)).join(`,
71
+ `+s);return t?`[
72
+ ${s}${u}
73
+ ${n}]`:`[${u}]`}const o=e.constructor.name;if(o==="Object"){const u=gc(e).map(([c,d])=>{const h=typeof c=="symbol"?Ao.onSymbol(c):Xa(c)?c:JSON.stringify(c),p=vc(d,t,s);return`${s}${h}: ${p}`});return u.length===0?"{}":t?`{
74
+ ${u.join(`,
75
+ `)}
76
+ ${n}}`:`{${u.join(", ")}}`}return e instanceof Date?cl(e):"expression"in e&&typeof e.expression=="string"?e.expression:o},Ao={onCycle:()=>"(cycle)",onSymbol:e=>`Symbol(${Rp(e)})`,onFunction:e=>`Function(${Rp(e)})`},Ka=(e,t,n)=>{var s,o;switch(Gn(e)){case"object":{const u=e;if("toJSON"in u&&typeof u.toJSON=="function")return u.toJSON();if(typeof u=="function")return Ao.onFunction(u);if(n.includes(u))return"(cycle)";const c=[...n,u];if(Array.isArray(u))return u.map(h=>Ka(h,t,c));if(u instanceof Date)return u.toDateString();const d={};for(const h in u)d[h]=Ka(u[h],t,c);for(const h of Object.getOwnPropertySymbols(u))d[((s=t.onSymbol)==null?void 0:s.call(t,h))??h.toString()]=Ka(u[h],t,c);return d}case"symbol":return Ao.onSymbol(e);case"bigint":return((o=t.onBigInt)==null?void 0:o.call(t,e))??`${e}n`;case"undefined":return t.onUndefined??"undefined";case"string":return e.replaceAll("\\","\\\\");default:return e}},cl=e=>{const t=e.getFullYear(),n=e.getMonth(),s=e.getDate(),o=e.getHours(),u=e.getMinutes(),c=e.getSeconds(),d=e.getMilliseconds();if(n===0&&s===1&&o===0&&u===0&&c===0&&d===0)return`${t}`;const h=`${dN[n]} ${s}, ${t}`;if(o===0&&u===0&&c===0&&d===0)return h;let p=e.toLocaleTimeString();const y=p.endsWith(" AM")||p.endsWith(" PM")?p.slice(-3):"";return y&&(p=p.slice(0,-y.length)),d?p+=`.${pN(d,3)}`:hN.test(p)&&(p=p.slice(0,-3)),`${p+y}, ${h}`},dN=["January","February","March","April","May","June","July","August","September","October","November","December"],hN=/:\d\d:00$/,pN=(e,t)=>String(e).padStart(t,"0"),aA=(e,t,...[n])=>{const s=(n==null?void 0:n.stringifySymbol)??Pe;let o=e;switch(typeof t){case"string":o=Xa(t)?e===""?t:`${e}.${t}`:`${e}[${JSON.stringify(t)}]`;break;case"number":o=`${e}[${t}]`;break;case"symbol":o=`${e}[${s(t)}]`;break;default:n!=null&&n.stringifyNonKey?o=`${e}[${n.stringifyNonKey(t)}]`:Z(`${Pe(t)} must be a PropertyKey or stringifyNonKey must be passed to options`)}return o},fl=(e,...t)=>e.reduce((n,s)=>aA(n,s,...t),"");class lA extends Yx{constructor(...n){super();x(this,"cache",{});this.push(...n)}toJSON(){if(this.cache.json)return this.cache.json;this.cache.json=[];for(let n=0;n<this.length;n++)this.cache.json.push(typeof this[n]=="symbol"?Pe(this[n]):this[n]);return this.cache.json}stringify(){return this.cache.stringify?this.cache.stringify:this.cache.stringify=fl(this)}stringifyAncestors(){if(this.cache.stringifyAncestors)return this.cache.stringifyAncestors;let n="";const s=[n];for(const o of this)n=aA(n,o),s.push(n);return this.cache.stringifyAncestors=s}}class mN{constructor(t){x(this,"chars");x(this,"i");x(this,"def");this.def=t,this.chars=[...t],this.i=0}shift(){return this.chars[this.i++]??""}get lookahead(){return this.chars[this.i]??""}get nextLookahead(){return this.chars[this.i+1]??""}get length(){return this.chars.length}shiftUntil(t){let n="";for(;this.lookahead;){if(t(this,n))if(n[n.length-1]===Ap)n=n.slice(0,-1);else break;n+=this.shift()}return n}shiftUntilLookahead(t){return typeof t=="string"?this.shiftUntil(n=>n.lookahead===t):this.shiftUntil(n=>n.lookahead in t)}shiftUntilNonWhitespace(){return this.shiftUntil(()=>!(this.lookahead in Gc))}jumpToIndex(t){this.i=t<0?this.length+t:t}jumpForward(t){this.i+=t}get location(){return this.i}get unscanned(){return this.chars.slice(this.i,this.length).join("")}get scanned(){return this.chars.slice(0,this.i).join("")}sliceChars(t,n){return this.chars.slice(t,n).join("")}lookaheadIs(t){return this.lookahead===t}lookaheadIsIn(t){return this.lookahead in t}}let Op="$ark",yN=2;for(;Op in globalThis;)Op=`$ark${yN++}`;const uA=Op;globalThis[uA]=ul;const W=ul,gN=e=>`${uA}.${e}`,Qt=e=>gN(Rp(e));class cA extends Jx{constructor(...n){super();x(this,"argNames");x(this,"body","");x(this,"indentation",0);this.argNames=n;for(const s of n){if(s in this)throw new Error(`Arg name '${s}' would overwrite an existing property on FunctionBody`);this[s]=s}}indent(){return this.indentation+=4,this}dedent(){return this.indentation-=4,this}prop(n,s=!1){return fA(n,s)}index(n,s=!1){return dA(`${n}`,s)}line(n){return this.body+=`${" ".repeat(this.indentation)}${n}
77
+ `,this}const(n,s){return this.line(`const ${n} = ${s}`),this}let(n,s){return this.line(`let ${n} = ${s}`)}set(n,s){return this.line(`${n} = ${s}`)}if(n,s){return this.block(`if (${n})`,s)}elseIf(n,s){return this.block(`else if (${n})`,s)}else(n){return this.block("else",n)}for(n,s,o=0){return this.block(`for (let i = ${o}; ${n}; i++)`,s)}forIn(n,s){return this.block(`for (const k in ${n})`,s)}block(n,s,o=""){return this.line(`${n} {`),this.indent(),s(this),this.dedent(),this.line(`}${o}`)}return(n=""){return this.line(`return ${n}`)}write(n="anonymous",s=0){return`${n}(${this.argNames.join(", ")}) { ${s?this.body.split(`
78
+ `).map(o=>" ".repeat(s)+`${o}`).join(`
79
+ `):this.body} }`}compile(){return new UD(...this.argNames,this.body)}}const dl=e=>fr(e,"object")||typeof e=="symbol"?Qt(e):Lm(e),fA=(e,t=!1)=>typeof e=="string"&&Xa(e)?`${t?"?":""}.${e}`:dA(bN(e),t),bN=e=>typeof e=="symbol"?Qt(e):JSON.stringify(e),dA=(e,t=!1)=>`${t?"?.":""}[${e}]`;class $h extends cA{constructor(n){super("data","ctx");x(this,"traversalKind");x(this,"optimistic");this.traversalKind=n.kind,this.optimistic=n.optimistic===!0}invoke(n,s){const o=(s==null?void 0:s.arg)??this.data,u=typeof n=="string"?!0:this.requiresContextFor(n),c=typeof n=="string"?n:n.id;return u?`${this.referenceToId(c,s)}(${o}, ${this.ctx})`:`${this.referenceToId(c,s)}(${o})`}referenceToId(n,s){const o=(s==null?void 0:s.kind)??this.traversalKind,u=`this.${n}${o}`;return s!=null&&s.bind?`${u}.bind(${s==null?void 0:s.bind})`:u}requiresContextFor(n){return this.traversalKind==="Apply"||n.allowsRequiresContext}initializeErrorCount(){return this.const("errorCount","ctx.currentErrorCount")}returnIfFail(){return this.if("ctx.currentErrorCount > errorCount",()=>this.return())}returnIfFailFast(){return this.if("ctx.failFast && ctx.currentErrorCount > errorCount",()=>this.return())}traverseKey(n,s,o){const u=this.requiresContextFor(o);return u&&this.line(`${this.ctx}.path.push(${n})`),this.check(o,{arg:s}),u&&this.line(`${this.ctx}.path.pop()`),this}check(n,s){return this.traversalKind==="Allows"?this.if(`!${this.invoke(n,s)}`,()=>this.return(!1)):this.line(this.invoke(n,s))}}const hA=e=>Fe(e,(t,n)=>[t,Yt(n)?[...n]:n]),zi=Xx("arkKind"),ce=(e,t)=>(e==null?void 0:e[zi])===t,Zt=e=>ce(e,"root")||ce(e,"constraint"),vN=["unit","proto","domain"],Yc=["required","optional","index","sequence"],pA=["pattern","divisor","exactLength","max","min","maxLength","minLength","before","after"],Vm=[...pA,...Yc,"structure","predicate"],Xc=["alias","union","morph","unit","intersection","proto","domain"],SN=[...Xc,...Vm],mA=Fe(Vm,(e,t)=>[t,1]),wN=Fe([...Yc,"undeclared"],(e,t)=>[t,1]),yA=Fe(SN,(e,t)=>[t,e]),Zu=e=>typeof e=="string"&&e in yA,Sc=e=>yA[e],jm=e=>Xc.slice(Sc(e)+1);[...jm("union")];[...jm("morph")];const ur=e=>typeof e=="string"||typeof e=="boolean"||e===null?e:typeof e=="number"?Number.isNaN(e)?"NaN":e===Number.POSITIVE_INFINITY?"Infinity":e===Number.NEGATIVE_INFINITY?"-Infinity":e:dl(e),Zc=e=>{let t="{ ";for(const[n,s]of Object.entries(e))t+=`${n}: ${dl(s)}, `;return t+" }"},ut=e=>{var n,s,o,u;const t=e;return t.hasAssociatedError&&((n=t.defaults).expected??(n.expected=c=>"description"in c?c.description:t.defaults.description(c)),(s=t.defaults).actual??(s.actual=c=>Pe(c)),(o=t.defaults).problem??(o.problem=c=>`must be ${c.expected}${c.actual?` (was ${c.actual})`:""}`),(u=t.defaults).message??(u.message=c=>{if(c.path.length===0)return c.problem;const d=`${c.propString} ${c.problem}`;return d[0]==="["?`value at ${d}`:d})),t};class xN extends Error{constructor(n,s){super(Pe(s,{quoteKeys:!1,indent:4}));x(this,"name","ToJsonSchemaError");x(this,"code");x(this,"context");this.code=n,this.context=s}hasCode(n){return this.code===n}}const AN={dialect:"https://json-schema.org/draft/2020-12/schema",useRefs:!1,fallback:{arrayObject:e=>Et.throw("arrayObject",e),arrayPostfix:e=>Et.throw("arrayPostfix",e),defaultValue:e=>Et.throw("defaultValue",e),domain:e=>Et.throw("domain",e),morph:e=>Et.throw("morph",e),patternIntersection:e=>Et.throw("patternIntersection",e),predicate:e=>Et.throw("predicate",e),proto:e=>Et.throw("proto",e),symbolKey:e=>Et.throw("symbolKey",e),unit:e=>Et.throw("unit",e),date:e=>Et.throw("date",e)}},Et={Error:xN,throw:(...e)=>{throw new Et.Error(...e)},throwInternalOperandError:(e,t)=>wt(`Unexpected JSON Schema input for ${e}: ${Pe(t)}`),defaultConfig:AN};W.config??(W.config={});const Mp=(e,t)=>{if(!t)return e;const n={...e};let s;for(s in t){const o={...e.keywords};if(s==="keywords"){for(const u in t[s]){const c=t.keywords[u];c!==void 0&&(o[u]=typeof c=="string"?{description:c}:c)}n.keywords=o}else s==="toJsonSchema"?n[s]=gA(e.toJsonSchema,t.toJsonSchema):Zu(s)?n[s]={...e[s],...t[s]}:n[s]=t[s]}return n},gA=(e,t)=>{if(!e)return t??{};if(!t)return e;const n={...e};let s;for(s in t)s==="fallback"?n.fallback=TN(e.fallback,t.fallback):n[s]=t[s];return n},TN=(e,t)=>{e=dS(e),t=dS(t);const n={};let s;for(s in Et.defaultConfig.fallback)n[s]=t[s]??t.default??e[s]??e.default??Et.defaultConfig.fallback[s];return n},dS=e=>typeof e=="function"?{default:e}:e??{};var kw,Dw;class To extends(Dw=Jx,kw=zi,Dw){constructor({prefixPath:n,relativePath:s,...o},u){super();x(this,kw,"error");x(this,"path");x(this,"data");x(this,"nodeConfig");x(this,"input");x(this,"ctx");this.input=o,this.ctx=u,CD(this,o);const c=u.data;o.code==="union"&&(o.errors=o.errors.flatMap(h=>{const p=h.hasCode("union")?h.errors:[h];return!n&&!s?p:p.map(y=>y.transform(g=>({...g,path:wD(n,g.path,s)})))})),this.nodeConfig=u.config[this.code];const d=[...o.path??u.path];s&&d.push(...s),n&&d.unshift(...n),this.path=new lA(...d),this.data="data"in o?o.data:c}transform(n){return new To(n({data:this.data,path:this.path,...this.input}),this.ctx)}hasCode(n){return this.code===n}get propString(){return fl(this.path)}get expected(){var s;if(this.input.expected)return this.input.expected;const n=((s=this.meta)==null?void 0:s.expected)??this.nodeConfig.expected;return typeof n=="function"?n(this.input):n}get actual(){var s;if(this.input.actual)return this.input.actual;const n=((s=this.meta)==null?void 0:s.actual)??this.nodeConfig.actual;return typeof n=="function"?n(this.data):n}get problem(){var s;if(this.input.problem)return this.input.problem;const n=((s=this.meta)==null?void 0:s.problem)??this.nodeConfig.problem;return typeof n=="function"?n(this):n}get message(){var s;if(this.input.message)return this.input.message;const n=((s=this.meta)==null?void 0:s.message)??this.nodeConfig.message;return typeof n=="function"?n(this):n}get flat(){return this.hasCode("intersection")?[...this.errors]:[this]}toJSON(){return{data:this.data,path:this.path,...this.input,expected:this.expected,actual:this.actual,problem:this.problem,message:this.message}}toString(){return this.message}throw(){throw this}}var Nw,$w;class xs extends($w=Yx,Nw=zi,$w){constructor(n){super();x(this,Nw,"errors");x(this,"ctx");x(this,"byPath",Object.create(null));x(this,"byAncestorPath",Object.create(null));x(this,"count",0);x(this,"mutable",this);this.ctx=n}get flatByPath(){return Fe(this.byPath,(n,s)=>[n,s.flat])}get flatProblemsByPath(){return Fe(this.byPath,(n,s)=>[n,s.flat.map(o=>o.problem)])}throw(){throw this.toTraversalError()}toTraversalError(){return new EN(this)}add(n){this.includes(n)||this._add(n)}transform(n){const s=new xs(this.ctx);for(const o of this)s.add(n(o));return s}merge(n){for(const s of n)this.includes(s)||this._add(new To({...s,path:[...this.ctx.path,...s.path]},this.ctx))}affectsPath(n){return this.length===0?!1:n.stringifyAncestors().some(s=>s in this.byPath)||n.stringify()in this.byAncestorPath}get summary(){return this.toString()}get issues(){return this}toJSON(){return[...this.map(n=>n.toJSON())]}toString(){return this.join(`
80
+ `)}_add(n){const s=this.byPath[n.propString];if(s){if(s.hasCode("union")&&s.errors.length===0)return;const o=n.hasCode("union")&&n.errors.length===0?n:new To({code:"intersection",errors:s.hasCode("intersection")?[...s.errors,n]:[s,n]},this.ctx),u=this.indexOf(s);this.mutable[u===-1?this.length:u]=o,this.byPath[n.propString]=o,this.addAncestorPaths(n)}else this.byPath[n.propString]=n,this.addAncestorPaths(n),this.mutable.push(n);this.count++}addAncestorPaths(n){for(const s of n.path.stringifyAncestors())this.byAncestorPath[s]=He(this.byAncestorPath[s],n)}}class EN extends Error{constructor(n){var t=(...u6)=>(super(...u6),x(this,"name","TraversalError"),this);n.length===1?t(n.summary):t(`
81
+ `+n.map(s=>` โ€ข ${RN(s)}`).join(`
82
+ `)),Object.defineProperty(this,"arkErrors",{value:n,enumerable:!1})}}const RN=e=>e.toString().split(`
83
+ `).join(`
84
+ `);class so{constructor(t,n){x(this,"path",[]);x(this,"errors",new xs(this));x(this,"root");x(this,"config");x(this,"queuedMorphs",[]);x(this,"branches",[]);x(this,"seen",{});this.root=t,this.config=n}get data(){let t=this.root;for(const n of this.path)t=t==null?void 0:t[n];return t}get propString(){return fl(this.path)}reject(t){return this.error(t),!1}mustBe(t){return this.error(t),!1}error(t){const n=typeof t=="object"?t.code?t:{...t,code:"predicate"}:{code:"predicate",expected:t};return this.errorFromContext(n)}hasError(){return this.currentErrorCount!==0}get currentBranch(){return this.branches.at(-1)}queueMorphs(t){const n={path:new lA(...this.path),morphs:t};this.currentBranch?this.currentBranch.queuedMorphs.push(n):this.queuedMorphs.push(n)}finalize(t){return this.queuedMorphs.length&&(typeof this.root=="object"&&this.root!==null&&this.config.clone&&(this.root=this.config.clone(this.root)),this.applyQueuedMorphs()),this.hasError()?t?t(this.errors):this.errors:this.root}get currentErrorCount(){return this.currentBranch?this.currentBranch.error?1:0:this.errors.count}get failFast(){return this.branches.length!==0}pushBranch(){this.branches.push({error:void 0,queuedMorphs:[]})}popBranch(){return this.branches.pop()}get external(){return this}errorFromNodeContext(t){return this.errorFromContext(t)}errorFromContext(t){const n=new To(t,this);return this.currentBranch?this.currentBranch.error=n:this.errors.add(n),n}applyQueuedMorphs(){for(;this.queuedMorphs.length;){const t=this.queuedMorphs;this.queuedMorphs=[];for(const{path:n,morphs:s}of t)this.errors.affectsPath(n)||this.applyMorphsAtPath(n,s)}}applyMorphsAtPath(t,n){const s=t.at(-1);let o;if(s!==void 0){o=this.root;for(let u=0;u<t.length-1;u++)o=o[t[u]]}this.path=[...t];for(const u of n){const c=Zt(u),d=u(o===void 0?this.root:o[s],this);if(d instanceof To){this.errors.add(d);break}if(d instanceof xs){c||this.errors.merge(d);break}o===void 0?this.root=d:o[s]=d,this.applyQueuedMorphs()}}}const Ui=(e,t,n)=>{if(!n)return t();n.path.push(e);const s=t();return n.path.pop(),s};class bA extends _o{constructor(n,s){var u;super((c,d,h=this.onFail)=>d?(this.traverseApply(c,d),d.hasError()?d.errors:d.data):this.rootApply(c,h),{attach:n});x(this,"attachments");x(this,"$");x(this,"onFail");x(this,"includesTransform");x(this,"includesContextualPredicate");x(this,"isCyclic");x(this,"allowsRequiresContext");x(this,"rootApplyStrategy");x(this,"contextFreeMorph");x(this,"rootApply");x(this,"referencesById");x(this,"shallowReferences");x(this,"flatRefs");x(this,"flatMorphs");x(this,"allows");x(this,"compiledMeta",_N(this.metaJson));x(this,"precedence",Sc(this.kind));x(this,"precompilation");x(this,"assert",(n,s)=>this(n,s,o=>o.throw()));this.attachments=n,this.$=s,this.onFail=this.meta.onFail??this.$.resolvedConfig.onFail,this.includesTransform=this.hasKind("morph")||this.hasKind("structure")&&this.structuralMorph!==void 0,this.includesContextualPredicate=this.hasKind("predicate")&&this.inner.predicate.length!==1,this.isCyclic=this.kind==="alias",this.referencesById={[this.id]:this},this.shallowReferences=this.hasKind("structure")?[this,...this.children]:this.children.reduce((c,d)=>CN(c,d.shallowReferences),[this]);const o=this.isStructural();this.flatRefs=[],this.flatMorphs=[];for(let c=0;c<this.children.length;c++){if(this.includesTransform||(this.includesTransform=this.children[c].includesTransform),this.includesContextualPredicate||(this.includesContextualPredicate=this.children[c].includesContextualPredicate),this.isCyclic||(this.isCyclic=this.children[c].isCyclic),!o){const d=this.children[c].flatRefs;for(let h=0;h<d.length;h++){const p=d[h];if(!this.flatRefs.some(y=>vA(y,p))){this.flatRefs.push(p);for(const y of p.node.branches)(y.hasKind("morph")||y.hasKind("intersection")&&((u=y.structure)==null?void 0:u.structuralMorph)!==void 0)&&this.flatMorphs.push({path:p.path,propString:p.propString,node:y})}}}Object.assign(this.referencesById,this.children[c].referencesById)}this.flatRefs.sort((c,d)=>c.path.length>d.path.length?1:c.path.length<d.path.length?-1:c.propString>d.propString?1:c.propString<d.propString||c.node.expression<d.node.expression?-1:1),this.allowsRequiresContext=this.includesContextualPredicate||this.isCyclic,this.rootApplyStrategy=!this.allowsRequiresContext&&this.flatMorphs.length===0?this.shallowMorphs.length===0?"allows":this.shallowMorphs.every(c=>c.length===1||c.name==="$arkStructuralMorph")?this.hasKind("union")?this.branches.some(c=>c.shallowMorphs.length>1)?"contextual":"branchedOptimistic":this.shallowMorphs.length>1?"contextual":"optimistic":"contextual":"contextual",this.rootApply=this.createRootApply(),this.allows=this.allowsRequiresContext?c=>this.traverseAllows(c,new so(c,this.$.resolvedConfig)):c=>this.traverseAllows(c)}get shallowMorphs(){return[]}createRootApply(){switch(this.rootApplyStrategy){case"allows":return(s,o)=>{if(this.allows(s))return s;const u=new so(s,this.$.resolvedConfig);return this.traverseApply(s,u),u.finalize(o)};case"contextual":return(s,o)=>{const u=new so(s,this.$.resolvedConfig);return this.traverseApply(s,u),u.finalize(o)};case"optimistic":this.contextFreeMorph=this.shallowMorphs[0];const n=this.$.resolvedConfig.clone;return(s,o)=>{if(this.allows(s))return this.contextFreeMorph(n&&(typeof s=="object"&&s!==null||typeof s=="function")?n(s):s);const u=new so(s,this.$.resolvedConfig);return this.traverseApply(s,u),u.finalize(o)};case"branchedOptimistic":return this.createBranchedOptimisticRootApply();default:return this.rootApplyStrategy,wt(`Unexpected rootApplyStrategy ${this.rootApplyStrategy}`)}}cacheGetter(n,s){return Object.defineProperty(this,n,{value:s}),s}get description(){var n;return this.cacheGetter("description",((n=this.meta)==null?void 0:n.description)??this.$.resolvedConfig[this.kind].description(this))}get references(){return Object.values(this.referencesById)}traverse(n,s){return this(n,s,null)}get in(){return this.cacheGetter("in",this.getIo("in"))}get out(){return this.cacheGetter("out",this.getIo("out"))}getIo(n){if(!this.includesTransform)return this;const s={};for(const[o,u]of this.innerEntries){const c=this.impl.keys[o];if(c.reduceIo)c.reduceIo(n,s,u);else if(c.child){const d=u;s[o]=Yt(d)?d.map(h=>h[n]):d[n]}else s[o]=u}return this.$.node(this.kind,s)}toJSON(){return this.json}toString(){return`Type<${this.expression}>`}equals(n){const s=Zt(n)?n:this.$.parseDefinition(n);return this.innerHash===s.innerHash}ifEquals(n){return this.equals(n)?this:void 0}hasKind(n){return this.kind===n}assertHasKind(n){return this.kind!==n&&wo(`${this.kind} node was not of asserted kind ${n}`),this}hasKindIn(...n){return n.includes(this.kind)}assertHasKindIn(...n){return Ys(n,this.kind)||wo(`${this.kind} node was not one of asserted kinds ${n}`),this}isBasis(){return Ys(vN,this.kind)}isConstraint(){return Ys(Vm,this.kind)}isStructural(){return Ys(Yc,this.kind)}isRefinement(){return Ys(pA,this.kind)}isRoot(){return Ys(Xc,this.kind)}isUnknown(){return this.hasKind("intersection")&&this.children.length===0}isNever(){return this.hasKind("union")&&this.children.length===0}hasUnit(n){return this.hasKind("unit")&&this.allows(n)}hasOpenIntersection(){return this.impl.intersectionIsOpen}get nestableExpression(){return this.expression}select(n){const s=Va.normalize(n);return this._select(s)}_select(n){let s=Va.applyBoundary[n.boundary??"references"](this);return n.kind&&(s=s.filter(o=>o.kind===n.kind)),n.where&&(s=s.filter(n.where)),Va.applyMethod[n.method??"filter"](s,this,n)}transform(n,s){return this._transform(n,this._createTransformContext(s))}_createTransformContext(n){return{root:this,selected:void 0,seen:{},path:[],parseOptions:{prereduced:(n==null?void 0:n.prereduced)??!1},undeclaredKeyHandling:void 0,...n}}_transform(n,s){var g;const o=s.bindScope??this.$;if(s.seen[this.id])return this.$.lazilyResolve(s.seen[this.id]);if(((g=s.shouldTransform)==null?void 0:g.call(s,this,s))===!1)return this;let u;s.seen[this.id]=()=>u,this.hasKind("structure")&&this.undeclared!==s.undeclaredKeyHandling&&(s={...s,undeclaredKeyHandling:this.undeclared});const c=Fe(this.inner,(v,S)=>{if(!this.impl.keys[v].child)return[v,S];const A=S;if(!Yt(A)){const _=A._transform(n,s);return _?[v,_]:[]}if(A.length===0)return[v,S];const E=A.flatMap(_=>_._transform(n,s)??[]);return E.length?[v,E]:[]});delete s.seen[this.id];const d=Object.assign(c,{meta:this.meta}),h=s.selected&&!s.selected.includes(this)?d:n(this.kind,d,s);if(h===null)return null;if(Zt(h))return u=h;const p=Object.keys(h);return(p.length===0||p.length===1&&p[0]==="meta")&&!ll(this.inner)?null:(this.kind==="required"||this.kind==="optional"||this.kind==="index")&&!("value"in h)?s.undeclaredKeyHandling?{...h,value:W.intrinsic.unknown}:null:(this.kind==="morph"&&(h.in??(h.in=W.intrinsic.unknown)),u=o.node(this.kind,h,s.parseOptions))}configureReferences(n,s="references"){const o=Va.normalize(s),u=typeof n=="string"?(p,y)=>({...y,meta:{...y.meta,description:n}}):typeof n=="function"?(p,y)=>({...y,meta:n(y.meta)}):(p,y)=>({...y,meta:{...y.meta,...n}});if(o.boundary==="self")return this.$.node(this.kind,u(this.kind,{...this.inner,meta:this.meta}));const c=this._select(o),d=c&&al(c),h=o.boundary==="child"?(p,y)=>y.root.children.includes(p):o.boundary==="shallow"?p=>p.kind!=="structure":()=>!0;return this.$.finalize(this.transform(u,{shouldTransform:h,selected:d}))}}const Va={applyBoundary:{self:e=>[e],child:e=>[...e.children],shallow:e=>[...e.shallowReferences],references:e=>[...e.references]},applyMethod:{filter:e=>e,assertFilter:(e,t,n)=>(e.length===0&&wo(hS(t,n)),e),find:e=>e[0],assertFind:(e,t,n)=>(e.length===0&&wo(hS(t,n)),e[0])},normalize:e=>typeof e=="function"?{boundary:"references",method:"filter",where:e}:typeof e=="string"?pi(e,Va.applyBoundary)?{method:"filter",boundary:e}:{boundary:"references",method:"filter",kind:e}:{boundary:"references",method:"filter",...e}},hS=(e,t)=>`${e} had no references matching ${Pe(t)}.`,ON=e=>fl(e,{stringifyNonKey:t=>t.expression}),MN=/"(\$ark\.[^"]+)"/g,_N=e=>JSON.stringify(e).replaceAll(MN,"$1"),vs=(e,t)=>({path:e,node:t,propString:ON(e)}),vA=(e,t)=>e.propString===t.propString&&e.node.equals(t.node),pS=(e,t)=>sr(e,t,{isEqual:vA}),CN=(e,t)=>sr(e,t,{isEqual:(n,s)=>n.equals(s)});class oe extends Array{static init(t,n,s,o){return new oe({kind:t,l:n,r:s,path:(o==null?void 0:o.path)??[],optional:(o==null?void 0:o.optional)??!1})}add(t,n,s,o){return this.push({kind:t,l:n,r:s,path:(o==null?void 0:o.path)??[],optional:(o==null?void 0:o.optional)??!1}),this}get summary(){return this.describeReasons()}describeReasons(){if(this.length===1){const{path:t,l:n,r:s}=this[0],o=fl(t);return SA(`Intersection${o&&` at ${o}`} of ${mS(n,s)}`)}return`The following intersections result in unsatisfiable types:
85
+ โ€ข ${this.map(({path:t,l:n,r:s})=>`${t}: ${mS(n,s)}`).join(`
86
+ โ€ข `)}`}throw(){return Z(this.describeReasons())}invert(){const t=this.map(n=>({...n,l:n.r,r:n.l}));return t instanceof oe?t:new oe(...t)}withPrefixKey(t,n){return this.map(s=>({...s,path:[t,...s.path],optional:s.optional||n==="optional"}))}toNeverIfDisjoint(){return W.intrinsic.never}}const mS=(e,t)=>`${_p(e)} and ${_p(t)}`,_p=e=>Zt(e)?e.expression:Yt(e)?e.map(_p).join(" | ")||"never":String(e),SA=e=>`${e} results in an unsatisfiable type`,eo={},qi=(e,t,n)=>Lt(e,t,{$:n,invert:!1,pipe:!1}),Cp=(e,t,n)=>Lt(e,t,{$:n,invert:!1,pipe:!0}),Lt=(e,t,n)=>{const s=n.pipe?"|>":"&",o=`${e.hash}${s}${t.hash}`;if(eo[o]!==void 0)return eo[o];if(!n.pipe){const d=`${t.hash}${s}${e.hash}`;if(eo[d]!==void 0){const h=eo[d],p=h instanceof oe?h.invert():h;return eo[o]=p,p}}const u=!n.pipe||!e.includesTransform&&!t.includesTransform;if(u&&e.equals(t))return e;let c=u?kp(e,t,n):e.hasKindIn(...Xc)?kN(e,t,n):kp(e,t,n);return Zt(c)&&(e.equals(c)?c=e:t.equals(c)&&(c=t)),eo[o]=c,c},kp=(e,t,n)=>{const s=e.precedence<t.precedence?e.kind:t.kind,o=e.impl.intersections[t.kind]??t.impl.intersections[e.kind];if(o===void 0)return null;if(s===e.kind)return o(e,t,n);{let u=o(t,e,{...n,invert:!n.invert});return u instanceof oe&&(u=u.invert()),u}},kN=(e,t,n)=>e.includesTransform||t.includesTransform?n.invert?yS(t,e,n):yS(e,t,n):kp(e,t,n),yS=(e,t,n)=>e.distribute(s=>DN(s,t,n),s=>{const o=s.filter(Zt);if(o.length===0)return oe.init("union",e.branches,t.branches);if(o.length<e.branches.length||!e.branches.every((c,d)=>c.in.equals(o[d].in)))return n.$.parseSchema(o);if(o.length===1)return o[0];const u={branches:o};return n.$.parseSchema(u)}),DN=(e,t,n)=>{if(e.hasKind("morph")){const o=[...e.morphs];if(e.lastMorphIfNode){const u=Lt(e.lastMorphIfNode,t,n);if(u instanceof oe)return u;o[o.length-1]=u}else o.push(t);return n.$.node("morph",{morphs:o,in:e.inner.in})}if(t.hasKind("morph")){const o=Lt(e,t.in,n);return o instanceof oe?o:n.$.node("morph",{morphs:[t],in:o})}return n.$.node("morph",{morphs:[t],in:e})};class Co extends bA{constructor(n,s){super(n,s);x(this,"impliedSiblings");Object.defineProperty(this,zi,{value:"constraint",enumerable:!1})}intersect(n){return qi(this,n,this.$)}}class Jc extends Co{constructor(){super(...arguments);x(this,"traverseApply",(n,s)=>{this.traverseAllows(n,s)||s.errorFromNodeContext(this.errorContext)})}compile(n){n.traversalKind==="Allows"?n.return(this.compiledCondition):n.if(this.compiledNegation,()=>n.line(`${n.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Zc(this.errorContext)}}const rn=e=>(t,n)=>{if(Yt(t)){if(t.length===0)return;const o=t.map(u=>n.$.node(e,u));return e==="predicate"?o:o.sort((u,c)=>u.hash<c.hash?-1:1)}const s=n.$.node(e,t);return s.hasOpenIntersection()?[s]:s},wc=e=>{const t=e.r.shift();if(!t){let s=e.l.length===0&&e.kind==="structure"?W.intrinsic.unknown.internal:e.ctx.$.node(e.kind,Object.assign(e.baseInner,NN(e.l)),{prereduced:!0});for(const o of e.roots){if(s instanceof oe)return s;s=Lt(o,s,e.ctx)}return s}let n=!1;for(let s=0;s<e.l.length;s++){const o=Lt(e.l[s],t,e.ctx);if(o!==null){if(o instanceof oe)return o;if(n){if(!e.l.includes(o))return wt(`Unexpectedly encountered multiple distinct intersection results for refinement ${o}`)}else{if(o.isRoot())return e.roots.push(o),e.l.splice(s),wc(e);e.l[s]=o,n=!0}}}if(n||e.l.push(t),e.kind==="intersection"&&t.impliedSiblings)for(const s of t.impliedSiblings)sr(e.r,s);return wc(e)},xc=e=>Object.entries(e).flatMap(([n,s])=>n in mA?s:[]).sort((n,s)=>n.precedence<s.precedence?-1:n.precedence>s.precedence?1:n.kind==="predicate"&&s.kind==="predicate"?0:n.hash<s.hash?-1:1),NN=e=>{const t={};for(const n of e)if(n.hasOpenIntersection())t[n.kind]=He(t[n.kind],n);else{if(t[n.kind])return wt(`Unexpected intersection of closed refinements of kind ${n.kind}`);t[n.kind]=n}return t},$N=(...e)=>Z(BN(...e)),BN=(e,t,n)=>{const s=n.hasKind("morph")?"a morph":n.isUnknown()?"unknown":n.exclude(t).defaultShortDescription;return`${HD(e)} operand must be ${t.description} (was ${s})`},LN=(e,t,n)=>new Ac(e,t,n,n,null);class wA extends _o{}var Bw,Lw;class Ac extends(Lw=_o,Bw=zi,Lw){constructor(n,s,o,u,c){super((...d)=>{const h=Fe(this.names,(p,y)=>{const g=this.arg$.parse(d[p]);return g.extends(this.constraints[p])||Z(VN(y,this.constraints[p].expression,g.expression)),[y,g]});if(this.defIsLazy()){const p=this.bodyDef(h);return this.$.parse(p)}return this.$.parse(s,{args:h})});x(this,Bw,"generic");x(this,"paramDefs");x(this,"bodyDef");x(this,"$");x(this,"arg$");x(this,"baseInstantiation");x(this,"hkt");x(this,"description");this.paramDefs=n,this.bodyDef=s,this.$=o,this.arg$=u,this.hkt=c,this.description=c?new c().description??`a generic type for ${c.constructor.name}`:"a generic type",this.baseInstantiation=this(...this.constraints)}defIsLazy(){return this.bodyDef instanceof wA}cacheGetter(n,s){return Object.defineProperty(this,n,{value:s}),s}get json(){return this.cacheGetter("json",{params:this.params.map(n=>n[1].isUnknown()?n[0]:[n[0],n[1].json]),body:fN(this.bodyDef)})}get params(){return this.cacheGetter("params",this.paramDefs.map(n=>typeof n=="string"?[n,W.intrinsic.unknown]:[n[0],this.$.parse(n[1])]))}get names(){return this.cacheGetter("names",this.params.map(n=>n[0]))}get constraints(){return this.cacheGetter("constraints",this.params.map(n=>n[1]))}get internal(){return this}get referencesById(){return this.baseInstantiation.internal.referencesById}get references(){return this.baseInstantiation.internal.references}}const VN=(e,t,n)=>`${e} must be assignable to ${t} (was ${n})`,jN=ut({kind:"predicate",hasAssociatedError:!0,collapsibleKey:"predicate",keys:{predicate:{}},normalize:e=>typeof e=="function"?{predicate:e}:e,defaults:{description:e=>`valid according to ${e.predicate.name||"an anonymous predicate"}`},intersectionIsOpen:!0,intersections:{predicate:()=>null}});class zN extends Co{constructor(){super(...arguments);x(this,"serializedPredicate",Qt(this.predicate));x(this,"compiledCondition",`${this.serializedPredicate}(data, ctx)`);x(this,"compiledNegation",`!${this.compiledCondition}`);x(this,"impliedBasis",null);x(this,"expression",this.serializedPredicate);x(this,"traverseAllows",this.predicate);x(this,"errorContext",{code:"predicate",description:this.description,meta:this.meta});x(this,"compiledErrorContext",Zc(this.errorContext));x(this,"traverseApply",(n,s)=>{!this.predicate(n,s.external)&&!s.hasError()&&s.errorFromNodeContext(this.errorContext)})}compile(n){if(n.traversalKind==="Allows"){n.return(this.compiledCondition);return}n.if(`${this.compiledNegation} && !ctx.hasError()`,()=>n.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`))}reduceJsonSchema(n,s){return s.fallback.predicate({code:"predicate",base:n,predicate:this.predicate})}}const xA={implementation:jN,Node:zN},UN=ut({kind:"divisor",collapsibleKey:"rule",keys:{rule:{parse:e=>Number.isInteger(e)?e:Z(KN(e))}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>e.rule===1?"an integer":e.rule===2?"even":`a multiple of ${e.rule}`},intersections:{divisor:(e,t,n)=>n.$.node("divisor",{rule:Math.abs(e.rule*t.rule/PN(e.rule,t.rule))})},obviatesBasisDescription:!0});class qN extends Jc{constructor(){super(...arguments);x(this,"traverseAllows",n=>n%this.rule===0);x(this,"compiledCondition",`data % ${this.rule} === 0`);x(this,"compiledNegation",`data % ${this.rule} !== 0`);x(this,"impliedBasis",W.intrinsic.number.internal);x(this,"expression",`% ${this.rule}`)}reduceJsonSchema(n){return n.type="integer",this.rule===1||(n.multipleOf=this.rule),n}}const AA={implementation:UN,Node:qN},KN=e=>`divisor must be an integer (was ${e})`,PN=(e,t)=>{let n,s=e,o=t;for(;o!==0;)n=o,o=s%o,s=n;return s};class ko extends Jc{constructor(){super(...arguments);x(this,"boundOperandKind",GN[this.kind]);x(this,"compiledActual",this.boundOperandKind==="value"?"data":this.boundOperandKind==="length"?"data.length":"data.valueOf()");x(this,"comparator",YN(this.kind,this.exclusive));x(this,"numericLimit",this.rule.valueOf());x(this,"expression",`${this.comparator} ${this.rule}`);x(this,"compiledCondition",`${this.compiledActual} ${this.comparator} ${this.numericLimit}`);x(this,"compiledNegation",`${this.compiledActual} ${IN[this.comparator]} ${this.numericLimit}`);x(this,"stringLimit",this.boundOperandKind==="date"?XN(this.numericLimit):`${this.numericLimit}`);x(this,"limitKind",this.comparator[0]==="<"?"upper":"lower")}isStricterThan(n){return(this.limitKind==="upper"?this.numericLimit<n.numericLimit:this.numericLimit>n.numericLimit)||this.numericLimit===n.numericLimit&&this.exclusive===!0&&!n.exclusive}overlapsRange(n){return!(this.isStricterThan(n)||this.numericLimit===n.numericLimit&&(this.exclusive||n.exclusive))}overlapIsUnit(n){return this.numericLimit===n.numericLimit&&!this.exclusive&&!n.exclusive}}const IN={"<":">=","<=":">",">":"<=",">=":"<"},HN={min:"max",minLength:"maxLength",after:"before"},TA={parse:e=>e||void 0},EA=e=>t=>{if(typeof t=="number")return{rule:t};const{exclusive:n,...s}=t;return n?{...s,rule:e==="minLength"?s.rule+1:s.rule-1}:s},RA=e=>t=>{if(typeof t=="number"||typeof t=="string"||t instanceof Date)return{rule:t};const{exclusive:n,...s}=t;if(!n)return s;const o=typeof s.rule=="number"?s.rule:typeof s.rule=="string"?new Date(s.rule).valueOf():s.rule.valueOf();return n?{...s,rule:e==="after"?o+1:o-1}:s},OA=e=>typeof e=="string"||typeof e=="number"?new Date(e):e,FN=(e,t)=>`${e} bound must be a positive integer (was ${t})`,zm=e=>t=>((!Number.isInteger(t)||t<0)&&Z(FN(e,t)),t),GN={min:"value",max:"value",minLength:"length",maxLength:"length",after:"date",before:"date"},YN=(e,t)=>`${pi(e,HN)?">":"<"}${t?"":"="}`,XN=e=>typeof e=="string"?e:new Date(e).toLocaleString(),ZN=e=>`Bounded expression ${e} must be exactly one of number, string, Array, or Date`,JN=ut({kind:"after",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:OA,serialize:e=>e.toISOString()}},normalize:RA("after"),defaults:{description:e=>`${e.collapsibleLimitString} or later`,actual:cl},intersections:{after:(e,t)=>e.isStricterThan(t)?e:t}});class QN extends ko{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.Date.internal);x(this,"collapsibleLimitString",cl(this.rule));x(this,"traverseAllows",n=>n>=this.rule)}reduceJsonSchema(n,s){return s.fallback.date({code:"date",base:n,after:this.rule})}}const MA={implementation:JN,Node:QN},WN=ut({kind:"before",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:OA,serialize:e=>e.toISOString()}},normalize:RA("before"),defaults:{description:e=>`${e.collapsibleLimitString} or earlier`,actual:cl},intersections:{before:(e,t)=>e.isStricterThan(t)?e:t,after:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:oe.init("range",e,t)}});class e2 extends ko{constructor(){super(...arguments);x(this,"collapsibleLimitString",cl(this.rule));x(this,"traverseAllows",n=>n<=this.rule);x(this,"impliedBasis",W.intrinsic.Date.internal)}reduceJsonSchema(n,s){return s.fallback.date({code:"date",base:n,before:this.rule})}}const _A={implementation:WN,Node:e2},t2=ut({kind:"exactLength",collapsibleKey:"rule",keys:{rule:{parse:zm("exactLength")}},normalize:e=>typeof e=="number"?{rule:e}:e,hasAssociatedError:!0,defaults:{description:e=>`exactly length ${e.rule}`,actual:e=>`${e.length}`},intersections:{exactLength:(e,t,n)=>oe.init("unit",n.$.node("unit",{unit:e.rule}),n.$.node("unit",{unit:t.rule}),{path:["length"]}),minLength:(e,t)=>e.rule>=t.rule?e:oe.init("range",e,t),maxLength:(e,t)=>e.rule<=t.rule?e:oe.init("range",e,t)}});class n2 extends Jc{constructor(){super(...arguments);x(this,"traverseAllows",n=>n.length===this.rule);x(this,"compiledCondition",`data.length === ${this.rule}`);x(this,"compiledNegation",`data.length !== ${this.rule}`);x(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);x(this,"expression",`== ${this.rule}`)}reduceJsonSchema(n){switch(n.type){case"string":return n.minLength=this.rule,n.maxLength=this.rule,n;case"array":return n.minItems=this.rule,n.maxItems=this.rule,n;default:return Et.throwInternalOperandError("exactLength",n)}}}const CA={implementation:t2,Node:n2},i2=ut({kind:"max",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:TA},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"negative":"non-positive":`${e.exclusive?"less than":"at most"} ${e.rule}`},intersections:{max:(e,t)=>e.isStricterThan(t)?e:t,min:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("unit",{unit:e.rule}):null:oe.init("range",e,t)},obviatesBasisDescription:!0});class s2 extends ko{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.number.internal);x(this,"traverseAllows",this.exclusive?n=>n<this.rule:n=>n<=this.rule)}reduceJsonSchema(n){return this.exclusive?n.exclusiveMaximum=this.rule:n.maximum=this.rule,n}}const kA={implementation:i2,Node:s2},r2=ut({kind:"maxLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:zm("maxLength")}},reduce:(e,t)=>e.rule===0?t.node("exactLength",e):void 0,normalize:EA("maxLength"),defaults:{description:e=>`at most length ${e.rule}`,actual:e=>`${e.length}`},intersections:{maxLength:(e,t)=>e.isStricterThan(t)?e:t,minLength:(e,t,n)=>e.overlapsRange(t)?e.overlapIsUnit(t)?n.$.node("exactLength",{rule:e.rule}):null:oe.init("range",e,t)}});class o2 extends ko{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);x(this,"traverseAllows",n=>n.length<=this.rule)}reduceJsonSchema(n){switch(n.type){case"string":return n.maxLength=this.rule,n;case"array":return n.maxItems=this.rule,n;default:return Et.throwInternalOperandError("maxLength",n)}}}const DA={implementation:r2,Node:o2},a2=ut({kind:"min",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{},exclusive:TA},normalize:e=>typeof e=="number"?{rule:e}:e,defaults:{description:e=>e.rule===0?e.exclusive?"positive":"non-negative":`${e.exclusive?"more than":"at least"} ${e.rule}`},intersections:{min:(e,t)=>e.isStricterThan(t)?e:t},obviatesBasisDescription:!0});class l2 extends ko{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.number.internal);x(this,"traverseAllows",this.exclusive?n=>n>this.rule:n=>n>=this.rule)}reduceJsonSchema(n){return this.exclusive?n.exclusiveMinimum=this.rule:n.minimum=this.rule,n}}const NA={implementation:a2,Node:l2},u2=ut({kind:"minLength",collapsibleKey:"rule",hasAssociatedError:!0,keys:{rule:{parse:zm("minLength")}},reduce:e=>e.rule===0?W.intrinsic.unknown:void 0,normalize:EA("minLength"),defaults:{description:e=>e.rule===1?"non-empty":`at least length ${e.rule}`,actual:e=>e.length===0?"":`${e.length}`},intersections:{minLength:(e,t)=>e.isStricterThan(t)?e:t}});class c2 extends ko{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.lengthBoundable.internal);x(this,"traverseAllows",n=>n.length>=this.rule)}reduceJsonSchema(n){switch(n.type){case"string":return n.minLength=this.rule,n;case"array":return n.minItems=this.rule,n;default:return Et.throwInternalOperandError("minLength",n)}}}const $A={implementation:u2,Node:c2},f2={min:NA.implementation,max:kA.implementation,minLength:$A.implementation,maxLength:DA.implementation,exactLength:CA.implementation,after:MA.implementation,before:_A.implementation},d2={min:NA.Node,max:kA.Node,minLength:$A.Node,maxLength:DA.Node,exactLength:CA.Node,after:MA.Node,before:_A.Node},h2=ut({kind:"pattern",collapsibleKey:"rule",keys:{rule:{},flags:{}},normalize:e=>typeof e=="string"?{rule:e}:e instanceof RegExp?e.flags?{rule:e.source,flags:e.flags}:{rule:e.source}:e,obviatesBasisDescription:!0,obviatesBasisExpression:!0,hasAssociatedError:!0,intersectionIsOpen:!0,defaults:{description:e=>`matched by ${e.rule}`},intersections:{pattern:()=>null}});class p2 extends Jc{constructor(){super(...arguments);x(this,"instance",new RegExp(this.rule,this.flags));x(this,"expression",`${this.instance}`);x(this,"traverseAllows",this.instance.test.bind(this.instance));x(this,"compiledCondition",`${this.expression}.test(data)`);x(this,"compiledNegation",`!${this.compiledCondition}`);x(this,"impliedBasis",W.intrinsic.string.internal)}reduceJsonSchema(n,s){return n.pattern?s.fallback.patternIntersection({code:"patternIntersection",base:n,pattern:this.rule}):(n.pattern=this.rule,n)}}const BA={implementation:h2,Node:p2},Ju=(e,t)=>{const n=m2(e);return t&&!t.includes(n)?Z(`Root of kind ${n} should be one of ${t}`):n},m2=e=>{if(ce(e,"root"))return e.kind;if(typeof e=="string")return e[0]==="$"?"alias":e in ji?"domain":"proto";if(typeof e=="function")return"proto";if(typeof e!="object"||e===null)return Z(gS(e));if("morphs"in e)return"morph";if("branches"in e||Yt(e))return"union";if("unit"in e)return"unit";if("reference"in e)return"alias";const t=Object.keys(e);return t.length===0||t.some(n=>n in mA)?"intersection":"proto"in e?"proto":"domain"in e?"domain":Z(gS(e))},gS=e=>`${Pe(e)} is not a valid type schema`,ju={},y2=e=>Yt(e)?e.map(t=>t.collapsibleJson):e.collapsibleJson,$n={};W.nodesByRegisteredId=$n;const LA=e=>(ju[e]??(ju[e]=0),`${e}${++ju[e]}`),VA=e=>{var p;const t=Qc[e.kind],n=((p=t.applyConfig)==null?void 0:p.call(t,e.def,e.$.resolvedConfig))??e.def,s={},{meta:o,...u}=n,c=o===void 0?{}:typeof o=="string"?{description:o}:o,d=Zx(u).sort(([y],[g])=>Zu(y)?Zu(g)?Sc(y)-Sc(g):1:Zu(g)||y<g?-1:1).filter(([y,g])=>{if(y.startsWith("meta.")){const v=y.slice(5);return c[v]=g,!1}return!0});for(const y of d){const g=y[0],v=t.keys[g];if(!v)return Z(`Key ${g} is not valid on ${e.kind} schema`);const S=v.parse?v.parse(y[1],e):y[1];S!==Di&&(S!==void 0||v.preserveUndefined)&&(s[g]=S)}if(t.reduce&&!e.prereduced){const y=t.reduce(s,e.$);if(y)return y instanceof oe?y.throw():b2(y,c)}return Um({id:e.id,kind:e.kind,inner:s,meta:c,$:e.$})},Um=({id:e,kind:t,inner:n,meta:s,$:o,ignoreCache:u})=>{const c=Qc[t],d=Zx(n),h=[];let p={};for(const[D,$]of d){const M=c.keys[D],H=M.serialize??(M.child?y2:ur);if(p[D]=H($),M.child===!0){const z=$;Yt(z)?h.push(...z):h.push(z)}else typeof M.child=="function"&&h.push(...M.child($))}c.finalizeInnerJson&&(p=c.finalizeInnerJson(p));let y={...p},g={};ll(s)||(g=Fe(s,(D,$)=>[D,D==="examples"?$:ur($)]),y.meta=zu(g,"description",!0)),p=zu(p,c.collapsibleKey,!1);const v=JSON.stringify({kind:t,...p});y=zu(y,c.collapsibleKey,!1);const S=zu(y,c.collapsibleKey,!0),A=JSON.stringify({kind:t,...y});if(o.nodesByHash[A]&&!u)return o.nodesByHash[A];const E={id:e,kind:t,impl:c,inner:n,innerEntries:d,innerJson:p,innerHash:v,meta:s,metaJson:g,json:y,hash:A,collapsibleJson:S,children:h};if(t!=="intersection")for(const D in n)D!=="in"&&D!=="out"&&(E[D]=n[D]);const _=new x$[t](E,o);return o.nodesByHash[A]=_},g2=(e,t)=>e.id===t?e:(Zt($n[t])&&wt(`Unexpected attempt to overwrite node id ${t}`),Um({id:t,kind:e.kind,inner:e.inner,meta:e.meta,$:e.$,ignoreCache:!0})),b2=(e,t,n)=>Um({id:LA(t.alias??e.kind),kind:e.kind,inner:e.inner,meta:t,$:e.$}),zu=(e,t,n)=>{const s=Object.keys(e);if(s.length===1&&s[0]===t){const o=e[t];if(n||fr(o,"object")&&(Object.keys(o).length===1||Array.isArray(o)))return o}return e},Dp=(e,t,n)=>{if(e.key!==t.key)return null;const s=e.key;let o=Lt(e.value,t.value,n);const u=e.required||t.required?"required":"optional";if(o instanceof oe)if(u==="optional")o=W.intrinsic.never.internal;else return o.withPrefixKey(e.key,e.required&&t.required?"required":"optional");if(u==="required")return n.$.node("required",{key:s,value:o});const c=e.hasDefault()?t.hasDefault()?e.default===t.default?e.default:Z(zA(e.default,t.default)):e.default:t.hasDefault()?t.default:Di;return n.$.node("optional",{key:s,value:o,default:c})};class jA extends Co{constructor(){super(...arguments);x(this,"required",this.kind==="required");x(this,"optional",this.kind==="optional");x(this,"impliedBasis",W.intrinsic.object.internal);x(this,"serializedKey",dl(this.key));x(this,"compiledKey",typeof this.key=="string"?this.key:this.serializedKey);x(this,"flatRefs",He(this.value.flatRefs.map(n=>vs([this.key,...n.path],n.node)),vs([this.key],this.value)));x(this,"traverseAllows",(n,s)=>this.key in n?Ui(this.key,()=>this.value.traverseAllows(n[this.key],s),s):this.optional);x(this,"traverseApply",(n,s)=>{this.key in n?Ui(this.key,()=>this.value.traverseApply(n[this.key],s),s):this.hasKind("required")&&s.errorFromNodeContext(this.errorContext)})}_transform(n,s){s.path.push(this.key);const o=super._transform(n,s);return s.path.pop(),o}hasDefault(){return"default"in this.inner}compile(n){n.if(`${this.serializedKey} in data`,()=>n.traverseKey(this.serializedKey,`data${n.prop(this.key)}`,this.value)),this.hasKind("required")&&n.else(()=>n.traversalKind==="Apply"?n.line(`ctx.errorFromNodeContext(${this.compiledErrorContext})`):n.return(!1)),n.traversalKind==="Allows"&&n.return(!0)}}const zA=(e,t)=>`Invalid intersection of default values ${Pe(e)} & ${Pe(t)}`,v2=ut({kind:"optional",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},default:{preserveUndefined:!0}},normalize:e=>e,reduce:(e,t)=>{if(t.resolvedConfig.exactOptionalPropertyTypes===!1&&!e.value.allows(void 0))return t.node("optional",{...e,value:e.value.or(pe.undefined)},{prereduced:!0})},defaults:{description:e=>`${e.compiledKey}?: ${e.value.description}`},intersections:{optional:Dp}});class S2 extends jA{constructor(...n){super(...n);x(this,"expression",this.hasDefault()?`${this.compiledKey}: ${this.value.expression} = ${Pe(this.inner.default)}`:`${this.compiledKey}?: ${this.value.expression}`);x(this,"defaultValueMorph",w2(this));x(this,"defaultValueMorphRef",this.defaultValueMorph&&Qt(this.defaultValueMorph));"default"in this.inner&&Km(this.value,this.inner.default,this.key)}get outProp(){if(!this.hasDefault())return this;const{default:n,...s}=this.inner;return this.cacheGetter("outProp",this.$.node("required",s,{prereduced:!0}))}}const qm={implementation:v2,Node:S2},Bh={},w2=e=>{if(!e.hasDefault())return;const t=`{${e.compiledKey}: ${e.value.id} = ${ur(e.default)}}`;return Bh[t]??(Bh[t]=UA(e.key,e.value,e.default))},UA=(e,t,n)=>{if(typeof n=="function")return t.includesTransform?(o,u)=>(Ui(e,()=>t(o[e]=n(),u),u),o):o=>(o[e]=n(),o);const s=t.includesTransform?t.assert(n):n;return fr(s,"object")?(o,u)=>(Ui(e,()=>t(o[e]=n,u),u),o):o=>(o[e]=s,o)},Km=(e,t,n)=>{const s=Fc(t);fr(t,"object")&&!s&&Z(x2(n));const o=e.in(s?t():t);if(o instanceof xs){n===null&&Z(`Default ${o.summary}`);const u=o.transform(c=>c.transform(d=>({...d,prefixPath:[n]})));Z(`Default for ${u.summary}`)}return t},x2=e=>`Non-primitive default ${e===null?"":typeof e=="number"?`for value at [${e}] `:`for ${dl(e)} `}must be specified as a function like () => ({my: 'object'})`;class hl extends bA{constructor(n,s){super(n,s);x(this,"branches",this.hasKind("union")?this.inner.branches:[this]);x(this,"_keyof");x(this,"pipe",Object.assign(this._pipe.bind(this),{try:this.tryPipe.bind(this)}));Object.defineProperty(this,zi,{value:"root",enumerable:!1})}get internal(){return this}get"~standard"(){return{vendor:"arktype",version:1,validate:n=>{const s=this(n);return s instanceof xs?s:{value:s}}}}as(){return this}brand(n){return n===""?Z(A2):this}readonly(){return this}distribute(n,s){const o=this.branches.map(n);return(s==null?void 0:s(o))??o}get shortDescription(){return this.meta.description??this.defaultShortDescription}toJsonSchema(n={}){const s=gA(this.$.resolvedConfig.toJsonSchema,n);s.useRefs||(s.useRefs=this.isCyclic);const o=typeof s.dialect=="string"?{$schema:s.dialect}:{};return Object.assign(o,this.toJsonSchemaRecurse(s)),s.useRefs&&(o.$defs=Fe(this.references,(u,c)=>c.isRoot()&&!c.alwaysExpandJsonSchema?[c.id,c.toResolvedJsonSchema(s)]:[])),o}toJsonSchemaRecurse(n){return n.useRefs&&!this.alwaysExpandJsonSchema?{$ref:`#/$defs/${this.id}`}:this.toResolvedJsonSchema(n)}get alwaysExpandJsonSchema(){return this.isBasis()||this.kind==="alias"||this.hasKind("union")&&this.isBoolean}toResolvedJsonSchema(n){const s=this.innerToJsonSchema(n);return Object.assign(s,this.metaJson)}intersect(n){const s=this.$.parseDefinition(n),o=this.rawIntersect(s);return o instanceof oe?o:this.$.finalize(o)}rawIntersect(n){return qi(this,n,this.$)}toNeverIfDisjoint(){return this}and(n){const s=this.intersect(n);return s instanceof oe?s.throw():s}rawAnd(n){const s=this.rawIntersect(n);return s instanceof oe?s.throw():s}or(n){const s=this.$.parseDefinition(n);return this.$.finalize(this.rawOr(s))}rawOr(n){const s=[...this.branches,...n.branches];return this.$.node("union",s)}map(n){return this.$.schema(this.applyStructuralOperation("map",[n]))}pick(...n){return this.$.schema(this.applyStructuralOperation("pick",n))}omit(...n){return this.$.schema(this.applyStructuralOperation("omit",n))}required(){return this.$.schema(this.applyStructuralOperation("required",[]))}partial(){return this.$.schema(this.applyStructuralOperation("partial",[]))}keyof(){if(this._keyof)return this._keyof;const n=this.applyStructuralOperation("keyof",[]).reduce((s,o)=>s.intersect(o).toNeverIfDisjoint(),W.intrinsic.unknown.internal);return n.branches.length===0&&Z(SA(`keyof ${this.expression}`)),this._keyof=this.$.finalize(n)}get props(){return this.branches.length!==1?Z(T2(this.expression)):[...this.applyStructuralOperation("props",[])[0]]}merge(n){const s=this.$.parseDefinition(n);return this.$.schema(s.distribute(o=>this.applyStructuralOperation("merge",[bS(o)??Z(vS("merge",o.expression))])))}applyStructuralOperation(n,s){return this.distribute(o=>{if(o.equals(W.intrinsic.object)&&n!=="merge")return o;const u=bS(o);if(u||Z(vS(n,o.expression)),n==="keyof")return u.keyof();if(n==="get")return u.get(...s);if(n==="props")return u.props;const c=n==="required"?"require":n==="partial"?"optionalize":n;return this.$.node("intersection",{...o.inner,structure:u[c](...s)})})}get(...n){return n[0]===void 0?this:this.$.schema(this.applyStructuralOperation("get",n))}extract(n){const s=this.$.parseDefinition(n);return this.$.schema(this.branches.filter(o=>o.extends(s)))}exclude(n){const s=this.$.parseDefinition(n);return this.$.schema(this.branches.filter(o=>!o.extends(s)))}array(){return this.$.schema(this.isUnknown()?{proto:Array}:{proto:Array,sequence:this},{prereduced:!0})}overlaps(n){return!(this.intersect(n)instanceof oe)}extends(n){const s=this.intersect(n);return!(s instanceof oe)&&this.equals(s)}ifExtends(n){return this.extends(n)?this:void 0}subsumes(n){return this.$.parseDefinition(n).extends(this)}configure(n,s="shallow"){return this.configureReferences(n,s)}describe(n,s="shallow"){return this.configure({description:n},s)}optional(){return[this,"?"]}default(n){return Km(this,n,null),[this,"=",n]}from(n){return this.assert(n)}_pipe(...n){const s=n.reduce((o,u)=>o.rawPipeOnce(u),this);return this.$.finalize(s)}tryPipe(...n){const s=n.reduce((o,u)=>o.rawPipeOnce(ce(u,"root")?u:(c,d)=>{try{return u(c,d)}catch(h){return d.error({code:"predicate",predicate:u,actual:`aborted due to error:
87
+ ${h}
88
+ `})}}),this);return this.$.finalize(s)}to(n){return this.$.finalize(this.toNode(this.$.parseDefinition(n)))}toNode(n){const s=Cp(this,n,this.$);return s instanceof oe?s.throw():s}rawPipeOnce(n){return ce(n,"root")?this.toNode(n):this.distribute(s=>s.hasKind("morph")?this.$.node("morph",{in:s.inner.in,morphs:[...s.morphs,n]}):this.$.node("morph",{in:s,morphs:[n]}),this.$.parseSchema)}narrow(n){return this.constrainOut("predicate",n)}constrain(n,s){return this._constrain("root",n,s)}constrainIn(n,s){return this._constrain("in",n,s)}constrainOut(n,s){return this._constrain("out",n,s)}_constrain(n,s,o){const u=this.$.node(s,o);if(u.isRoot())return u.isUnknown()?this:wt(`Unexpected constraint node ${u}`);const c=n==="root"?this:this[n];if(c.hasKind("morph")||u.impliedBasis&&!c.extends(u.impliedBasis))return $N(s,u.impliedBasis,this);const d=this.$.node("intersection",{[u.kind]:u}),h=n==="out"?Cp(this,d,this.$):qi(this,d,this.$);return h instanceof oe&&h.throw(),this.$.finalize(h)}onUndeclaredKey(n){const s=typeof n=="string"?n:n.rule,o=typeof n=="string"?!1:n.deep;return this.$.finalize(this.transform((u,c)=>u==="structure"?s==="ignore"?_D(c,{undeclared:1}):{...c,undeclared:s}:c,o?void 0:{shouldTransform:u=>!Ys(Yc,u.kind)}))}hasEqualMorphs(n){return!this.includesTransform&&!n.includesTransform?!0:!(!So(this.shallowMorphs,n.shallowMorphs)||!So(this.flatMorphs,n.flatMorphs,{isEqual:(s,o)=>{var u,c;return s.propString===o.propString&&(s.node.hasKind("morph")&&o.node.hasKind("morph")?s.node.hasEqualMorphs(o.node):s.node.hasKind("intersection")&&o.node.hasKind("intersection")?((u=s.node.structure)==null?void 0:u.structuralMorphRef)===((c=o.node.structure)==null?void 0:c.structuralMorphRef):!1)}}))}onDeepUndeclaredKey(n){return this.onUndeclaredKey({rule:n,deep:!0})}filter(n){return this.constrainIn("predicate",n)}divisibleBy(n){return this.constrain("divisor",n)}matching(n){return this.constrain("pattern",n)}atLeast(n){return this.constrain("min",n)}atMost(n){return this.constrain("max",n)}moreThan(n){return this.constrain("min",to(n))}lessThan(n){return this.constrain("max",to(n))}atLeastLength(n){return this.constrain("minLength",n)}atMostLength(n){return this.constrain("maxLength",n)}moreThanLength(n){return this.constrain("minLength",to(n))}lessThanLength(n){return this.constrain("maxLength",to(n))}exactlyLength(n){return this.constrain("exactLength",n)}atOrAfter(n){return this.constrain("after",n)}atOrBefore(n){return this.constrain("before",n)}laterThan(n){return this.constrain("after",to(n))}earlierThan(n){return this.constrain("before",to(n))}}const A2="Expected a non-empty brand name after #",to=e=>typeof e=="object"&&!(e instanceof Date)?{...e,exclusive:!0}:{rule:e,exclusive:!0},Uu=(e,t)=>ce(t,"root")?ce(e,"root")?e.extends(t):t.allows(e):ce(e,"root")?e.hasUnit(t):t===e,bS=e=>{var t;return e.hasKind("morph")?null:e.hasKind("intersection")?e.inner.structure??(((t=e.basis)==null?void 0:t.domain)==="object"?e.$.bindReference(W.intrinsic.emptyStructure):null):e.isBasis()&&e.domain==="object"?e.$.bindReference(W.intrinsic.emptyStructure):null},T2=e=>`Props cannot be extracted from a union. Use .distribute to extract props from each branch instead. Received:
89
+ ${e}`,vS=(e,t)=>`${e} operand must be an object (was ${t})`,pl=(e,t)=>Fe(jm(e),(n,s)=>[s,t]),E2=e=>typeof e=="string"?{reference:e}:e,SS=e=>e instanceof oe?W.intrinsic.never.internal:e,R2=ut({kind:"alias",hasAssociatedError:!1,collapsibleKey:"reference",keys:{reference:{serialize:e=>e.startsWith("$")?e:`$ark.${e}`},resolve:{}},normalize:E2,defaults:{description:e=>e.reference},intersections:{alias:(e,t,n)=>n.$.lazilyResolve(()=>SS(Lt(e.resolution,t.resolution,n)),`${e.reference}${n.pipe?"=>":"&"}${t.reference}`),...pl("alias",(e,t,n)=>t.isUnknown()?e:t.isNever()?t:t.isBasis()&&!t.overlaps(W.intrinsic.object)?oe.init("assignability",W.intrinsic.object,t):n.$.lazilyResolve(()=>SS(Lt(e.resolution,t,n)),`${e.reference}${n.pipe?"=>":"&"}${t.id}`))}});class O2 extends hl{constructor(){super(...arguments);x(this,"expression",this.reference);x(this,"structure");x(this,"traverseAllows",(n,s)=>{const o=s.seen[this.reference];return o!=null&&o.includes(n)?!0:(s.seen[this.reference]=He(o,n),this.resolution.traverseAllows(n,s))});x(this,"traverseApply",(n,s)=>{const o=s.seen[this.reference];o!=null&&o.includes(n)||(s.seen[this.reference]=He(o,n),this.resolution.traverseApply(n,s))})}get resolution(){const n=this._resolve();return $n[this.id]=n}_resolve(){if(this.resolve)return this.resolve();if(this.reference[0]==="$")return this.$.resolveRoot(this.reference.slice(1));const n=this.reference;let s=$n[n];const o=[];for(;ce(s,"context");){if(o.includes(s.id))return Z(M2(s.id,o));o.push(s.id),s=$n[s.id]}return ce(s,"root")?s:wt(`Unexpected resolution for reference ${this.reference}
90
+ Seen: [${o.join("->")}]
91
+ Resolution: ${Pe(s)}`)}get resolutionId(){if(this.reference.includes("&")||this.reference.includes("=>"))return this.resolution.id;if(this.reference[0]!=="$")return this.reference;const n=this.reference.slice(1),s=this.$.resolutions[n];return typeof s=="string"?s:ce(s,"root")?s.id:wt(`Unexpected resolution for reference ${this.reference}: ${Pe(s)}`)}get defaultShortDescription(){return ji.object}innerToJsonSchema(n){return this.resolution.toJsonSchemaRecurse(n)}compile(n){const s=this.resolutionId;n.if(`ctx.seen.${s} && ctx.seen.${s}.includes(data)`,()=>n.return(!0)),n.if(`!ctx.seen.${s}`,()=>n.line(`ctx.seen.${s} = []`)),n.line(`ctx.seen.${s}.push(data)`),n.return(n.invoke(s))}}const M2=(e,t)=>`Alias '${e}' has a shallow resolution cycle: ${[...t,e].join("->")}`,Pm={implementation:R2,Node:O2};class Im extends hl{constructor(){super(...arguments);x(this,"traverseApply",(n,s)=>{this.traverseAllows(n,s)||s.errorFromNodeContext(this.errorContext)})}get errorContext(){return{code:this.kind,description:this.description,meta:this.meta,...this.inner}}get compiledErrorContext(){return Zc(this.errorContext)}compile(n){n.traversalKind==="Allows"?n.return(this.compiledCondition):n.if(this.compiledNegation,()=>n.line(`${n.ctx}.errorFromNodeContext(${this.compiledErrorContext})`))}}const _2=ut({kind:"domain",hasAssociatedError:!0,collapsibleKey:"domain",keys:{domain:{},numberAllowsNaN:{}},normalize:e=>typeof e=="string"?{domain:e}:Dm(e,"numberAllowsNaN")&&e.domain!=="number"?Z(Hm.writeBadAllowNanMessage(e.domain)):e,applyConfig:(e,t)=>e.numberAllowsNaN===void 0&&e.domain==="number"&&t.numberAllowsNaN?{...e,numberAllowsNaN:!0}:e,defaults:{description:e=>ji[e.domain],actual:e=>Number.isNaN(e)?"NaN":ji[Gn(e)]},intersections:{domain:(e,t)=>e.domain==="number"&&t.domain==="number"?e.numberAllowsNaN?t:e:oe.init("domain",e,t)}});class C2 extends Im{constructor(){super(...arguments);x(this,"requiresNaNCheck",this.domain==="number"&&!this.numberAllowsNaN);x(this,"traverseAllows",this.requiresNaNCheck?n=>typeof n=="number"&&!Number.isNaN(n):n=>Gn(n)===this.domain);x(this,"compiledCondition",this.domain==="object"?'((typeof data === "object" && data !== null) || typeof data === "function")':`typeof data === "${this.domain}"${this.requiresNaNCheck?" && !Number.isNaN(data)":""}`);x(this,"compiledNegation",this.domain==="object"?'((typeof data !== "object" || data === null) && typeof data !== "function")':`typeof data !== "${this.domain}"${this.requiresNaNCheck?" || Number.isNaN(data)":""}`);x(this,"expression",this.numberAllowsNaN?"number | NaN":this.domain)}get nestableExpression(){return this.numberAllowsNaN?`(${this.expression})`:this.expression}get defaultShortDescription(){return ji[this.domain]}innerToJsonSchema(n){return this.domain==="bigint"||this.domain==="symbol"?n.fallback.domain({code:"domain",base:{},domain:this.domain}):{type:this.domain}}}const Hm={implementation:_2,Node:C2,writeBadAllowNanMessage:e=>`numberAllowsNaN may only be specified with domain "number" (was ${e})`},k2=ut({kind:"intersection",hasAssociatedError:!0,normalize:e=>{if(Zt(e))return e;const{structure:t,...n}=e,s=!!t,o=t??{},u=Fe(n,(c,d)=>pi(c,wN)?(s&&Z(`Flattened structure key ${c} cannot be specified alongside a root 'structure' key.`),o[c]=d,[]):[c,d]);return(ce(o,"constraint")||!ll(o))&&(u.structure=o),u},finalizeInnerJson:({structure:e,...t})=>fr(e,"object")?{...e,...t}:t,keys:{domain:{child:!0,parse:(e,t)=>t.$.node("domain",e)},proto:{child:!0,parse:(e,t)=>t.$.node("proto",e)},structure:{child:!0,parse:(e,t)=>t.$.node("structure",e),serialize:e=>{var c;if(!((c=e.sequence)!=null&&c.minLength))return e.collapsibleJson;const{sequence:t,...n}=e.collapsibleJson,{minVariadicLength:s,...o}=t,u=o.variadic&&Object.keys(o).length===1?o.variadic:o;return{...n,sequence:u}}},divisor:{child:!0,parse:rn("divisor")},max:{child:!0,parse:rn("max")},min:{child:!0,parse:rn("min")},maxLength:{child:!0,parse:rn("maxLength")},minLength:{child:!0,parse:rn("minLength")},exactLength:{child:!0,parse:rn("exactLength")},before:{child:!0,parse:rn("before")},after:{child:!0,parse:rn("after")},pattern:{child:!0,parse:rn("pattern")},predicate:{child:!0,parse:rn("predicate")}},reduce:(e,t)=>wS({},e,{$:t,invert:!1,pipe:!1}),defaults:{description:e=>{if(e.children.length===0)return"unknown";if(e.structure)return e.structure.description;const t=[];if(e.basis&&!e.refinements.some(n=>n.impl.obviatesBasisDescription)&&t.push(e.basis.description),e.refinements.length){const n=e.refinements.toSorted((s,o)=>s.kind==="min"&&o.kind==="max"?-1:0).map(s=>s.description);t.push(...n)}return e.inner.predicate&&t.push(...e.inner.predicate.map(n=>n.description)),t.join(" and ")},expected:e=>` โ—ฆ ${e.errors.map(t=>t.expected).join(`
92
+ โ—ฆ `)}`,problem:e=>`(${e.actual}) must be...
93
+ ${e.expected}`},intersections:{intersection:(e,t,n)=>wS(e.inner,t.inner,n),...pl("intersection",(e,t,n)=>{var h;if(e.children.length===0)return t;const{domain:s,proto:o,...u}=e.inner,c=o??s,d=c?Lt(c,t,n):t;return d instanceof oe?d:(h=e==null?void 0:e.basis)!=null&&h.equals(d)?e:e.$.node("intersection",{...u,[d.kind]:d},{prereduced:!0})})}});class D2 extends hl{constructor(){super(...arguments);x(this,"basis",this.inner.domain??this.inner.proto??null);x(this,"refinements",this.children.filter(n=>n.isRefinement()));x(this,"structure",this.inner.structure);x(this,"expression",N2(this));x(this,"traverseAllows",(n,s)=>this.children.every(o=>o.traverseAllows(n,s)));x(this,"traverseApply",(n,s)=>{const o=s.currentErrorCount;if(!(this.basis&&(this.basis.traverseApply(n,s),s.currentErrorCount>o))){if(this.refinements.length){for(let u=0;u<this.refinements.length-1;u++)if(this.refinements[u].traverseApply(n,s),s.failFast&&s.currentErrorCount>o)return;if(this.refinements.at(-1).traverseApply(n,s),s.currentErrorCount>o)return}if(!(this.structure&&(this.structure.traverseApply(n,s),s.currentErrorCount>o))&&this.inner.predicate){for(let u=0;u<this.inner.predicate.length-1;u++)if(this.inner.predicate[u].traverseApply(n,s),s.failFast&&s.currentErrorCount>o)return;this.inner.predicate.at(-1).traverseApply(n,s)}}})}get shallowMorphs(){var n;return(n=this.inner.structure)!=null&&n.structuralMorph?[this.inner.structure.structuralMorph]:[]}get defaultShortDescription(){var n;return((n=this.basis)==null?void 0:n.defaultShortDescription)??"present"}innerToJsonSchema(n){return this.children.reduce((s,o)=>o.isBasis()?o.toJsonSchemaRecurse(n):o.reduceJsonSchema(s,n),{})}compile(n){if(n.traversalKind==="Allows"){for(const s of this.children)n.check(s);n.return(!0);return}if(n.initializeErrorCount(),this.basis&&(n.check(this.basis),this.children.length>1&&n.returnIfFail()),this.refinements.length){for(let s=0;s<this.refinements.length-1;s++)n.check(this.refinements[s]),n.returnIfFailFast();n.check(this.refinements.at(-1)),(this.structure||this.inner.predicate)&&n.returnIfFail()}if(this.structure&&(n.check(this.structure),this.inner.predicate&&n.returnIfFail()),this.inner.predicate){for(let s=0;s<this.inner.predicate.length-1;s++)n.check(this.inner.predicate[s]),n.returnIfFail();n.check(this.inner.predicate.at(-1))}}}const qA={implementation:k2,Node:D2},N2=e=>{var n;let t=((n=e.structure)==null?void 0:n.expression)||`${e.basis&&!e.refinements.some(s=>s.impl.obviatesBasisExpression)?e.basis.nestableExpression+" ":""}${e.refinements.map(s=>s.expression).join(" & ")}`||"unknown";return t==="Array == 0"&&(t="[]"),t},wS=(e,t,n)=>{const s={},o=e.proto??e.domain,u=t.proto??t.domain,c=o?u?Lt(o,u,n):o:u;return c instanceof oe?c:(c&&(s[c.kind]=c),wc({kind:"intersection",baseInner:s,l:xc(e),r:xc(t),roots:[],ctx:n}))},$2=ut({kind:"morph",hasAssociatedError:!1,keys:{in:{child:!0,parse:(e,t)=>t.$.parseSchema(e)},morphs:{parse:al,serialize:e=>e.map(t=>ce(t,"root")?t.json:Qt(t))},declaredIn:{child:!1,serialize:e=>e.json},declaredOut:{child:!1,serialize:e=>e.json}},normalize:e=>e,defaults:{description:e=>{var t;return`a morph from ${e.in.description} to ${((t=e.out)==null?void 0:t.description)??"unknown"}`}},intersections:{morph:(e,t,n)=>{if(!e.hasEqualMorphs(t))return Z(L2(e.expression,t.expression));const s=Lt(e.in,t.in,n);if(s instanceof oe)return s;const o={morphs:e.morphs};if(e.declaredIn||t.declaredIn){const u=Lt(e.in,t.in,n);if(u instanceof oe)return u.throw();o.declaredIn=u}if(e.declaredOut||t.declaredOut){const u=Lt(e.out,t.out,n);if(u instanceof oe)return u.throw();o.declaredOut=u}return s.distribute(u=>n.$.node("morph",{...o,in:u}),n.$.parseSchema)},...pl("morph",(e,t,n)=>{const s=e.inner.in?Lt(e.inner.in,t,n):t;return s instanceof oe?s:s.equals(e.inner.in)?e:n.$.node("morph",{...e.inner,in:s})})}});class B2 extends hl{constructor(){super(...arguments);x(this,"serializedMorphs",this.morphs.map(Qt));x(this,"compiledMorphs",`[${this.serializedMorphs}]`);x(this,"lastMorph",this.inner.morphs.at(-1));x(this,"lastMorphIfNode",ce(this.lastMorph,"root")?this.lastMorph:void 0);x(this,"introspectableIn",this.inner.in);x(this,"introspectableOut",this.lastMorphIfNode?Object.assign(this.referencesById,this.lastMorphIfNode.referencesById)&&this.lastMorphIfNode.out:void 0);x(this,"expression",`(In: ${this.in.expression}) => ${this.lastMorphIfNode?"To":"Out"}<${this.out.expression}>`);x(this,"traverseAllows",(n,s)=>!this.introspectableIn||this.introspectableIn.traverseAllows(n,s));x(this,"traverseApply",(n,s)=>{this.introspectableIn&&this.introspectableIn.traverseApply(n,s),s.queueMorphs(this.morphs)})}get shallowMorphs(){var n;return Array.isArray((n=this.inner.in)==null?void 0:n.shallowMorphs)?[...this.inner.in.shallowMorphs,...this.morphs]:this.morphs}get in(){var n;return this.declaredIn??((n=this.inner.in)==null?void 0:n.in)??W.intrinsic.unknown.internal}get out(){return this.declaredOut??this.introspectableOut??W.intrinsic.unknown.internal}declareIn(n){return this.$.node("morph",{...this.inner,declaredIn:n})}declareOut(n){return this.$.node("morph",{...this.inner,declaredOut:n})}get defaultShortDescription(){return this.in.meta.description??this.in.defaultShortDescription}innerToJsonSchema(n){var s;return n.fallback.morph({code:"morph",base:this.in.toJsonSchemaRecurse(n),out:((s=this.introspectableOut)==null?void 0:s.toJsonSchemaRecurse(n))??null})}compile(n){if(n.traversalKind==="Allows"){if(!this.introspectableIn)return;n.return(n.invoke(this.introspectableIn));return}this.introspectableIn&&n.line(n.invoke(this.introspectableIn)),n.line(`ctx.queueMorphs(${this.compiledMorphs})`)}hasEqualMorphs(n){return So(this.morphs,n.morphs,{isEqual:(s,o)=>s===o||ce(s,"root")&&ce(o,"root")&&s.equals(o)})}}const KA={implementation:$2,Node:B2},L2=(e,t)=>`The intersection of distinct morphs at a single path is indeterminate:
94
+ Left: ${e}
95
+ Right: ${t}`,V2=ut({kind:"proto",hasAssociatedError:!0,collapsibleKey:"proto",keys:{proto:{serialize:e=>$m(e)??ur(e)},dateAllowsInvalid:{}},normalize:e=>{const t=typeof e=="string"?{proto:xo[e]}:typeof e=="function"?Zt(e)?e:{proto:e}:typeof e.proto=="string"?{...e,proto:xo[e.proto]}:e;return typeof t.proto!="function"&&Z(Tc.writeInvalidSchemaMessage(t.proto)),Dm(t,"dateAllowsInvalid")&&t.proto!==Date&&Z(Tc.writeBadInvalidDateMessage(t.proto)),t},applyConfig:(e,t)=>e.dateAllowsInvalid===void 0&&e.proto===Date&&t.dateAllowsInvalid?{...e,dateAllowsInvalid:!0}:e,defaults:{description:e=>e.builtinName?VD[e.builtinName]:`an instance of ${e.proto.name}`,actual:e=>e instanceof Date&&e.toString()==="Invalid Date"?"an invalid Date":xp(e)},intersections:{proto:(e,t)=>e.proto===Date&&t.proto===Date?e.dateAllowsInvalid?t:e:uS(e.proto,t.proto)?e:uS(t.proto,e.proto)?t:oe.init("proto",e,t),domain:(e,t)=>t.domain==="object"?e:oe.init("domain",W.intrinsic.object.internal,t)}});class j2 extends Im{constructor(){super(...arguments);x(this,"builtinName",$m(this.proto));x(this,"serializedConstructor",this.json.proto);x(this,"requiresInvalidDateCheck",this.proto===Date&&!this.dateAllowsInvalid);x(this,"traverseAllows",this.requiresInvalidDateCheck?n=>n instanceof Date&&n.toString()!=="Invalid Date":n=>n instanceof this.proto);x(this,"compiledCondition",`data instanceof ${this.serializedConstructor}${this.requiresInvalidDateCheck?' && data.toString() !== "Invalid Date"':""}`);x(this,"compiledNegation",`!(${this.compiledCondition})`);x(this,"expression",this.dateAllowsInvalid?"Date | InvalidDate":this.proto.name);x(this,"domain","object")}innerToJsonSchema(n){var s,o;switch(this.builtinName){case"Array":return{type:"array"};case"Date":return((o=(s=n.fallback).date)==null?void 0:o.call(s,{code:"date",base:{}}))??n.fallback.proto({code:"proto",base:{},proto:this.proto});default:return n.fallback.proto({code:"proto",base:{},proto:this.proto})}}get nestableExpression(){return this.dateAllowsInvalid?`(${this.expression})`:this.expression}get defaultShortDescription(){return this.description}}const Tc={implementation:V2,Node:j2,writeBadInvalidDateMessage:e=>`dateAllowsInvalid may only be specified with constructor Date (was ${e.name})`,writeInvalidSchemaMessage:e=>`instanceOf operand must be a function (was ${Gn(e)})`},z2=ut({kind:"union",hasAssociatedError:!0,collapsibleKey:"branches",keys:{ordered:{},branches:{child:!0,parse:(e,t)=>{const n=[];for(const s of e){const o=ce(s,"root")?s.branches:t.$.parseSchema(s).branches;for(const u of o)if(u.hasKind("morph")){const c=n.findIndex(d=>d.hasKind("morph")&&d.hasEqualMorphs(u));if(c===-1)n.push(u);else{const d=n[c];n[c]=t.$.node("morph",{...d.inner,in:d.in.rawOr(u.in)})}}else n.push(u)}return t.def.ordered||n.sort((s,o)=>s.hash<o.hash?-1:1),n}}},normalize:e=>Yt(e)?{branches:e}:e,reduce:(e,t)=>{const n=Z2(e);if(n.length===1)return n[0];if(n.length!==e.branches.length)return t.node("union",{...e,branches:n},{prereduced:!0})},defaults:{description:e=>e.distribute(t=>t.description,ho),expected:e=>{const t=xD(e.errors,"propString"),n=Object.entries(t).map(([s,o])=>{const u=[];for(const h of o)sr(u,h.expected);const c=ho(u),d=o.every(h=>h.actual===o[0].actual)?o[0].actual:Pe(o[0].data);return`${s&&`${s} `}must be ${c}${d&&` (was ${d})`}`});return ho(n)},problem:e=>e.expected,message:e=>e.problem},intersections:{union:(e,t,n)=>{if(e.isNever!==t.isNever)return oe.init("presence",e,t);let s;return e.ordered?(t.ordered&&Z(Q2(e.expression,t.expression)),s=Lh(t.branches,e.branches,n),s instanceof oe&&s.invert()):s=Lh(e.branches,t.branches,n),s instanceof oe?s:n.$.parseSchema(e.ordered||t.ordered?{branches:s,ordered:!0}:{branches:s})},...pl("union",(e,t,n)=>{const s=Lh(e.branches,[t],n);return s instanceof oe?s:s.length===1?s[0]:n.$.parseSchema(e.ordered?{branches:s,ordered:!0}:{branches:s})})}});class U2 extends hl{constructor(){super(...arguments);x(this,"isBoolean",this.branches.length===2&&this.branches[0].hasUnit(!1)&&this.branches[1].hasUnit(!0));x(this,"unitBranches",this.branches.filter(n=>n.in.hasKind("unit")));x(this,"discriminant",this.discriminate());x(this,"discriminantJson",this.discriminant?G2(this.discriminant):null);x(this,"expression",this.distribute(n=>n.nestableExpression,X2));x(this,"traverseAllows",(n,s)=>this.branches.some(o=>o.traverseAllows(n,s)));x(this,"traverseApply",(n,s)=>{const o=[];for(let u=0;u<this.branches.length;u++){if(s.pushBranch(),this.branches[u].traverseApply(n,s),!s.hasError())return this.branches[u].includesTransform?s.queuedMorphs.push(...s.popBranch().queuedMorphs):s.popBranch();o.push(s.popBranch().error)}s.errorFromNodeContext({code:"union",errors:o,meta:this.meta})});x(this,"traverseOptimistic",n=>{for(let s=0;s<this.branches.length;s++){const o=this.branches[s];if(o.traverseAllows(n))return o.contextFreeMorph?o.contextFreeMorph(n):n}return Di})}get branchGroups(){const n=[];let s=-1;for(const o of this.branches){if(o.hasKind("unit")&&o.domain==="boolean"){s===-1?(s=n.length,n.push(o)):n[s]=W.intrinsic.boolean;continue}n.push(o)}return n}createBranchedOptimisticRootApply(){return(n,s)=>{const o=this.traverseOptimistic(n);if(o!==Di)return o;const u=new so(n,this.$.resolvedConfig);return this.traverseApply(n,u),u.finalize(s)}}get shallowMorphs(){return this.branches.reduce((n,s)=>sr(n,s.shallowMorphs),[])}get defaultShortDescription(){return this.distribute(n=>n.defaultShortDescription,ho)}innerToJsonSchema(n){if(this.branchGroups.length===1&&this.branchGroups[0].equals(W.intrinsic.boolean))return{type:"boolean"};const s=this.branchGroups.map(o=>o.toJsonSchemaRecurse(n));return s.every(o=>Object.keys(o).length===1&&Dm(o,"const"))?{enum:s.map(o=>o.const)}:{anyOf:s}}compile(n){if(!this.discriminant||this.unitBranches.length===this.branches.length&&this.branches.length===2)return this.compileIndiscriminable(n);let s=this.discriminant.optionallyChainedPropString;this.discriminant.kind==="domain"&&(s=`typeof ${s} === "object" ? ${s} === null ? "null" : "object" : typeof ${s} === "function" ? "object" : typeof ${s}`);const o=this.discriminant.cases,u=Object.keys(o),{optimistic:c}=n;if(n.optimistic=!1,n.block(`switch(${s})`,()=>{for(const g in o){const v=o[g],S=g==="default"?g:`case ${g}`;n.line(`${S}: return ${v===!0?c?n.data:v:c?`${n.invoke(v)} ? ${v.contextFreeMorph?`${Qt(v.contextFreeMorph)}(${n.data})`:n.data} : "${Di}"`:n.invoke(v)}`)}return n}),n.traversalKind==="Allows"){n.return(c?`"${Di}"`:!1);return}const d=ho(this.discriminant.kind==="domain"?u.map(g=>{const v=g.slice(1,-1);return v==="function"?ji.object:ji[v]}):u),h=this.discriminant.path.map(g=>typeof g=="symbol"?Qt(g):JSON.stringify(g)),p=JSON.stringify(d),y=this.discriminant.kind==="domain"?`${H2}[${s}]`:`${F2}(${s})`;n.line(`ctx.errorFromNodeContext({
96
+ code: "predicate",
97
+ expected: ${p},
98
+ actual: ${y},
99
+ relativePath: [${h}],
100
+ meta: ${this.compiledMeta}
101
+ })`)}compileIndiscriminable(n){if(n.traversalKind==="Apply"){n.const("errors","[]");for(const s of this.branches)n.line("ctx.pushBranch()").line(n.invoke(s)).if("!ctx.hasError()",()=>n.return(s.includesTransform?"ctx.queuedMorphs.push(...ctx.popBranch().queuedMorphs)":"ctx.popBranch()")).line("errors.push(ctx.popBranch().error)");n.line(`ctx.errorFromNodeContext({ code: "union", errors, meta: ${this.compiledMeta} })`)}else{const{optimistic:s}=n;n.optimistic=!1;for(const o of this.branches)n.if(`${n.invoke(o)}`,()=>n.return(s?o.contextFreeMorph?`${Qt(o.contextFreeMorph)}(${n.data})`:n.data:!0));n.return(s?`"${Di}"`:!1)}}get nestableExpression(){return this.isBoolean?"boolean":`(${this.expression})`}discriminate(){var c,d;if(this.branches.length<2||this.isCyclic)return null;if(this.unitBranches.length===this.branches.length){const h=Fe(this.unitBranches,(p,y)=>[`${y.in.serializedValue}`,y.hasKind("morph")?y:!0]);return{kind:"unit",path:[],optionallyChainedPropString:"data",cases:h}}const n=[];for(let h=0;h<this.branches.length-1;h++){const p=this.branches[h];for(let y=h+1;y<this.branches.length;y++){const g=this.branches[y],v=qi(p.in,g.in,p.$);if(v instanceof oe)for(const S of v){if(!S.kind||S.optional)continue;let A,E;if(S.kind==="domain"){const D=S.l,$=S.r;A=`"${typeof D=="string"?D:D.domain}"`,E=`"${typeof $=="string"?$:$.domain}"`}else if(S.kind==="unit")A=S.l.serializedValue,E=S.r.serializedValue;else continue;const _=n.find(D=>So(D.path,S.path)&&D.kind===S.kind);_?(_.cases[A]?_.cases[A].branchIndices=sr(_.cases[A].branchIndices,h):(c=_.cases)[A]??(c[A]={branchIndices:[h],condition:S.l}),_.cases[E]?_.cases[E].branchIndices=sr(_.cases[E].branchIndices,y):(d=_.cases)[E]??(d[E]={branchIndices:[y],condition:S.r})):n.push({kind:S.kind,cases:{[A]:{branchIndices:[h],condition:S.l},[E]:{branchIndices:[y],condition:S.r}},path:S.path})}}}const s=this.ordered?P2(n,this.branches):n;if(!s.length)return null;const o=q2(s,this),u={};for(const h in o.best.cases){const p=K2(o,h);if(p===null){u[h]=!0;continue}if(p.length===this.branches.length)return null;this.ordered&&p.sort((v,S)=>v.originalIndex-S.originalIndex);const y=p.map(v=>v.branch),g=y.length===1?y[0]:this.$.node("union",this.ordered?{branches:y,ordered:!0}:y);Object.assign(this.referencesById,g.referencesById),u[h]=g}if(o.defaultEntries.length){const h=o.defaultEntries.map(p=>p.branch);u.default=this.$.node("union",this.ordered?{branches:h,ordered:!0}:h,{prereduced:!0}),Object.assign(this.referencesById,u.default.referencesById)}return Object.assign(o.location,{cases:u})}}const q2=(e,t)=>{const n=e.sort((u,c)=>Object.keys(c.cases).length-Object.keys(u.cases).length)[0],s={kind:n.kind,path:n.path,optionallyChainedPropString:PA(n.path)},o=t.branches.map((u,c)=>({originalIndex:c,branch:u}));return{best:n,location:s,defaultEntries:o,node:t}},K2=(e,t)=>{const n=e.best.cases[t],s=I2(n.condition,e.location.path,e.node.$);let o=[];const u=[];for(let c=0;c<e.defaultEntries.length;c++){const d=e.defaultEntries[c];if(n.branchIndices.includes(d.originalIndex)){const h=xS(e.node.branches[d.originalIndex],e.location);h===null?o=null:o==null||o.push({originalIndex:d.originalIndex,branch:h})}else if(d.branch.hasKind("alias")&&s.hasKind("domain")&&s.domain==="object")o==null||o.push(d);else{if(d.branch.in.overlaps(s)){const h=xS(d.branch,e.location);o==null||o.push({originalIndex:d.originalIndex,branch:h})}u.push(d)}}return e.defaultEntries=u,o},P2=(e,t)=>e.filter(s=>{const o=Object.values(s.cases).map(u=>u.branchIndices);for(let u=0;u<o.length-1;u++){const c=o[u];for(let d=u+1;d<o.length;d++){const h=o[d];for(const p of c)for(const y of h)if(p>y&&t[p].overlaps(t[y]))return!1}}return!0}),I2=(e,t,n)=>{let s=e==="undefined"?n.node("unit",{unit:void 0}):e==="null"?n.node("unit",{unit:null}):e==="boolean"?n.units([!0,!1]):e;for(let o=t.length-1;o>=0;o--){const u=t[o];s=n.node("intersection",typeof u=="number"?{proto:"Array",sequence:[...SD(u).map(c=>({})),s]}:{domain:"object",required:[{key:u,value:s}]})}return s},PA=e=>e.reduce((t,n)=>t+fA(n,!0),"data"),H2=Qt(AD),F2=Qt(Pe),IA={implementation:z2,Node:U2},G2=e=>({kind:e.kind,path:e.path.map(t=>typeof t=="string"?t:dl(t)),cases:Fe(e.cases,(t,n)=>[t,n===!0?n:n.hasKind("union")&&n.discriminantJson?n.discriminantJson:n.json])}),Y2={delimiter:" | ",finalDelimiter:" | "},X2=e=>ho(e,Y2),ho=(e,t)=>{const n=(t==null?void 0:t.delimiter)??", ",s=(t==null?void 0:t.finalDelimiter)??" or ";if(e.length===0)return"never";if(e.length===1)return e[0];if(e.length===2&&e[0]==="false"&&e[1]==="true"||e[0]==="true"&&e[1]==="false")return"boolean";const o={},u=e.filter(d=>o[d]?!1:o[d]=!0),c=u.pop();return`${u.join(n)}${u.length?s:""}${c}`},Lh=(e,t,n)=>{const s=t.map(()=>[]);for(let u=0;u<e.length;u++){let c={};for(let d=0;d<t.length;d++){if(s[d]===null)continue;if(e[u].equals(t[d])){s[d]=null,c={};break}const h=Lt(e[u],t[d],n);if(!(h instanceof oe)){if(h.equals(e[u])){s[d].push(e[u]),c={};break}h.equals(t[d])?s[d]=null:c[d]=h}}for(const d in c)s[d][u]=c[d]}const o=s.flatMap((u,c)=>(u==null?void 0:u.flatMap(d=>d.branches))??t[c]);return o.length===0?oe.init("union",e,t):o},Z2=({branches:e,ordered:t})=>{if(e.length<2)return e;const n=e.map(()=>!0);for(let s=0;s<e.length;s++)for(let o=s+1;o<e.length&&n[s]&&n[o];o++){if(e[s].equals(e[o])){n[o]=!1;continue}const u=qi(e[s].in,e[o].in,e[0].$);u instanceof oe||(t||J2(e[s],e[o]),u.equals(e[s].in)?n[s]=!!t:u.equals(e[o].in)&&(n[o]=!1))}return e.filter((s,o)=>n[o])},J2=(e,t)=>{!e.includesTransform&&!t.includesTransform||(So(e.shallowMorphs,t.shallowMorphs)||Z(AS(e.expression,t.expression)),So(e.flatMorphs,t.flatMorphs,{isEqual:(n,s)=>{var o,u;return n.propString===s.propString&&(n.node.hasKind("morph")&&s.node.hasKind("morph")?n.node.hasEqualMorphs(s.node):n.node.hasKind("intersection")&&s.node.hasKind("intersection")?((o=n.node.structure)==null?void 0:o.structuralMorphRef)===((u=s.node.structure)==null?void 0:u.structuralMorphRef):!1)}})||Z(AS(e.expression,t.expression)))},xS=(e,t)=>e.transform((n,s)=>n==="domain"||n==="unit"?null:s,{shouldTransform:(n,s)=>{const o=PA(s.path);return t.optionallyChainedPropString.startsWith(o)?n.hasKind("domain")&&n.domain==="object"||(n.hasKind("domain")||t.kind==="unit")&&o===t.optionallyChainedPropString?!0:n.children.length!==0&&n.kind!=="index":!1}}),AS=(e,t)=>`An unordered union of a type including a morph and a type with overlapping input is indeterminate:
102
+ Left: ${e}
103
+ Right: ${t}`,Q2=(e,t)=>`The intersection of two ordered unions is indeterminate:
104
+ Left: ${e}
105
+ Right: ${t}`,W2=ut({kind:"unit",hasAssociatedError:!0,keys:{unit:{preserveUndefined:!0,serialize:e=>e instanceof Date?e.toISOString():ur(e)}},normalize:e=>e,defaults:{description:e=>Pe(e.unit),problem:({expected:e,actual:t})=>`${e===t?`must be reference equal to ${e} (serialized to the same value)`:`must be ${e} (was ${t})`}`},intersections:{unit:(e,t)=>oe.init("unit",e,t),...pl("unit",(e,t)=>{if(t.allows(e.unit))return e;const n=t.hasKind("intersection")?t.basis:t;if(n){const s=n.hasKind("domain")?n:W.intrinsic.object;if(e.domain!==s.domain){const o=e.domain==="undefined"||e.domain==="null"||e.domain==="boolean"?e.domain:W.intrinsic[e.domain];return oe.init("domain",o,s)}}return oe.init("assignability",e,t.hasKind("intersection")?t.children.find(s=>!s.allows(e.unit)):t)})}});class e$ extends Im{constructor(){super(...arguments);x(this,"compiledValue",this.json.unit);x(this,"serializedValue",typeof this.unit=="string"||this.unit instanceof Date?JSON.stringify(this.compiledValue):`${this.compiledValue}`);x(this,"compiledCondition",TS(this.unit,this.serializedValue));x(this,"compiledNegation",TS(this.unit,this.serializedValue,"negated"));x(this,"expression",Pe(this.unit));x(this,"domain",Gn(this.unit));x(this,"traverseAllows",this.unit instanceof Date?n=>n instanceof Date&&n.toISOString()===this.compiledValue:Number.isNaN(this.unit)?n=>Number.isNaN(n):n=>n===this.unit)}get defaultShortDescription(){return this.domain==="object"?ji.object:this.description}innerToJsonSchema(n){return this.unit===null?{type:"null"}:W.intrinsic.jsonPrimitive.allows(this.unit)?{const:this.unit}:n.fallback.unit({code:"unit",base:{},unit:this.unit})}}const HA={implementation:W2,Node:e$},TS=(e,t,n)=>{if(e instanceof Date){const s=`data instanceof Date && data.toISOString() === ${t}`;return n?`!(${s})`:s}return Number.isNaN(e)?`${n?"!":""}Number.isNaN(data)`:`data ${n?"!":"="}== ${t}`},t$=ut({kind:"index",hasAssociatedError:!1,intersectionIsOpen:!0,keys:{signature:{child:!0,parse:(e,t)=>{const n=t.$.parseSchema(e);if(!n.extends(W.intrinsic.key))return Z(s$(n.expression));const s=n.branches.filter(o=>o.hasKind("unit"));return s.length?Z(i$(s.map(o=>Pe(o.unit)))):n}},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`[${e.signature.expression}]: ${e.value.description}`},intersections:{index:(e,t,n)=>{if(e.signature.equals(t.signature)){const s=Lt(e.value,t.value,n),o=s instanceof oe?W.intrinsic.never.internal:s;return n.$.node("index",{signature:e.signature,value:o})}return e.signature.extends(t.signature)&&e.value.subsumes(t.value)?t:t.signature.extends(e.signature)&&t.value.subsumes(e.value)?e:null}}});class n$ extends Co{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.object.internal);x(this,"expression",`[${this.signature.expression}]: ${this.value.expression}`);x(this,"flatRefs",He(this.value.flatRefs.map(n=>vs([this.signature,...n.path],n.node)),vs([this.signature],this.value)));x(this,"traverseAllows",(n,s)=>gc(n).every(o=>this.signature.traverseAllows(o[0],s)?Ui(o[0],()=>this.value.traverseAllows(o[1],s),s):!0));x(this,"traverseApply",(n,s)=>{for(const o of gc(n))this.signature.traverseAllows(o[0],s)&&Ui(o[0],()=>this.value.traverseApply(o[1],s),s)})}_transform(n,s){s.path.push(this.signature);const o=super._transform(n,s);return s.path.pop(),o}compile(){}}const FA={implementation:t$,Node:n$},i$=e=>`Index keys ${e.join(", ")} should be specified as named props.`,s$=e=>`Indexed key definition '${e}' must be a string or symbol`,r$=ut({kind:"required",hasAssociatedError:!0,intersectionIsOpen:!0,keys:{key:{},value:{child:!0,parse:(e,t)=>t.$.parseSchema(e)}},normalize:e=>e,defaults:{description:e=>`${e.compiledKey}: ${e.value.description}`,expected:e=>e.missingValueDescription,actual:()=>"missing"},intersections:{required:Dp,optional:Dp}});class o$ extends jA{constructor(){super(...arguments);x(this,"expression",`${this.compiledKey}: ${this.value.expression}`);x(this,"errorContext",Object.freeze({code:"required",missingValueDescription:this.value.defaultShortDescription,relativePath:[this.key],meta:this.meta}));x(this,"compiledErrorContext",Zc(this.errorContext))}}const GA={implementation:r$,Node:o$},a$=ut({kind:"sequence",hasAssociatedError:!1,collapsibleKey:"variadic",keys:{prefix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},optionals:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}},defaultables:{child:e=>e.map(t=>t[0]),parse:(e,t)=>{if(e.length!==0)return e.map(n=>{const s=t.$.parseSchema(n[0]);return Km(s,n[1],null),[s,n[1]]})},serialize:e=>e.map(t=>[t[0].collapsibleJson,ur(t[1])])},variadic:{child:!0,parse:(e,t)=>t.$.parseSchema(e,t)},minVariadicLength:{parse:e=>e===0?void 0:e},postfix:{child:!0,parse:(e,t)=>{if(e.length!==0)return e.map(n=>t.$.parseSchema(n))}}},normalize:e=>{var t,n,s;if(typeof e=="string")return{variadic:e};if("variadic"in e||"prefix"in e||"defaultables"in e||"optionals"in e||"postfix"in e||"minVariadicLength"in e){if((t=e.postfix)!=null&&t.length){if(!e.variadic)return Z(f$);if((n=e.optionals)!=null&&n.length||(s=e.defaultables)!=null&&s.length)return Z(XA)}return e.minVariadicLength&&!e.variadic?Z("minVariadicLength may not be specified without a variadic element"):e}return{variadic:e}},reduce:(e,t)=>{var d,h,p,y,g,v,S;let n=e.minVariadicLength??0;const s=((d=e.prefix)==null?void 0:d.slice())??[],o=((h=e.defaultables)==null?void 0:h.slice())??[],u=((p=e.optionals)==null?void 0:p.slice())??[],c=((y=e.postfix)==null?void 0:y.slice())??[];if(e.variadic){for(;(g=u.at(-1))!=null&&g.equals(e.variadic);)u.pop();if(u.length===0&&o.length===0)for(;(v=s.at(-1))!=null&&v.equals(e.variadic);)s.pop(),n++;for(;(S=c[0])!=null&&S.equals(e.variadic);)c.shift(),n++}else u.length===0&&o.length===0&&s.push(...c.splice(0));if(n!==e.minVariadicLength||e.prefix&&e.prefix.length!==s.length)return t.node("sequence",{...e,prefix:s,defaultables:o,optionals:u,postfix:c,minVariadicLength:n},{prereduced:!0})},defaults:{description:e=>e.isVariadicOnly?`${e.variadic.nestableExpression}[]`:`[${e.tuple.map(n=>n.kind==="defaultables"?`${n.node.nestableExpression} = ${Pe(n.default)}`:n.kind==="optionals"?`${n.node.nestableExpression}?`:n.kind==="variadic"?`...${n.node.nestableExpression}[]`:n.node.expression).join(", ")}]`},intersections:{sequence:(e,t,n)=>{const s=ja({l:e.tuple,r:t.tuple,disjoint:new oe,result:[],fixedVariants:[],ctx:n}),o=s.disjoint.length===0?[s,...s.fixedVariants]:s.fixedVariants;return o.length===0?s.disjoint:o.length===1?n.$.node("sequence",ES(o[0].result)):n.$.node("union",o.map(u=>({proto:Array,sequence:ES(u.result)})))}}});var Vw,jw,zw,Uw;class l$ extends Co{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.Array.internal);x(this,"tuple",c$(this.inner));x(this,"prefixLength",((Vw=this.prefix)==null?void 0:Vw.length)??0);x(this,"defaultablesLength",((jw=this.defaultables)==null?void 0:jw.length)??0);x(this,"optionalsLength",((zw=this.optionals)==null?void 0:zw.length)??0);x(this,"postfixLength",((Uw=this.postfix)==null?void 0:Uw.length)??0);x(this,"defaultablesAndOptionals",[]);x(this,"prevariadic",this.tuple.filter(n=>n.kind==="defaultables"||n.kind==="optionals"?(this.defaultablesAndOptionals.push(n.node),!0):n.kind==="prefix"));x(this,"variadicOrPostfix",Ws(this.variadic&&[this.variadic],this.postfix));x(this,"flatRefs",this.addFlatRefs());x(this,"isVariadicOnly",this.prevariadic.length+this.postfixLength===0);x(this,"minVariadicLength",this.inner.minVariadicLength??0);x(this,"minLength",this.prefixLength+this.minVariadicLength+this.postfixLength);x(this,"minLengthNode",this.minLength===0?null:this.$.node("minLength",this.minLength));x(this,"maxLength",this.variadic?null:this.tuple.length);x(this,"maxLengthNode",this.maxLength===null?null:this.$.node("maxLength",this.maxLength));x(this,"impliedSiblings",this.minLengthNode?this.maxLengthNode?[this.minLengthNode,this.maxLengthNode]:[this.minLengthNode]:this.maxLengthNode?[this.maxLengthNode]:[]);x(this,"defaultValueMorphs",u$(this));x(this,"defaultValueMorphsReference",this.defaultValueMorphs.length?Qt(this.defaultValueMorphs):void 0);x(this,"traverseAllows",(n,s)=>{for(let o=0;o<n.length;o++)if(!this.elementAtIndex(n,o).node.traverseAllows(n[o],s))return!1;return!0});x(this,"traverseApply",(n,s)=>{let o=0;for(;o<n.length;o++)Ui(o,()=>this.elementAtIndex(n,o).node.traverseApply(n[o],s),s)});x(this,"expression",this.description)}addFlatRefs(){return pS(this.flatRefs,this.prevariadic.flatMap((n,s)=>He(n.node.flatRefs.map(o=>vs([`${s}`,...o.path],o.node)),vs([`${s}`],n.node)))),pS(this.flatRefs,this.variadicOrPostfix.flatMap(n=>He(n.flatRefs.map(s=>vs([W.intrinsic.nonNegativeIntegerString.internal,...s.path],s.node)),vs([W.intrinsic.nonNegativeIntegerString.internal],n)))),this.flatRefs}elementAtIndex(n,s){if(s<this.prevariadic.length)return this.tuple[s];const o=n.length-this.postfixLength;return s>=o?{kind:"postfix",node:this.postfix[s-o]}:{kind:"variadic",node:this.variadic??wt(`Unexpected attempt to access index ${s} on ${this}`)}}get element(){return this.cacheGetter("element",this.$.node("union",this.children))}compile(n){if(this.prefix)for(const[s,o]of this.prefix.entries())n.traverseKey(`${s}`,`data[${s}]`,o);for(const[s,o]of this.defaultablesAndOptionals.entries()){const u=`${s+this.prefixLength}`;n.if(`${u} >= ${n.data}.length`,()=>n.traversalKind==="Allows"?n.return(!0):n.return()),n.traverseKey(u,`data[${u}]`,o)}if(this.variadic&&(this.postfix&&n.const("firstPostfixIndex",`${n.data}.length${this.postfix?`- ${this.postfix.length}`:""}`),n.for(`i < ${this.postfix?"firstPostfixIndex":"data.length"}`,()=>n.traverseKey("i","data[i]",this.variadic),this.prevariadic.length),this.postfix))for(const[s,o]of this.postfix.entries()){const u=`firstPostfixIndex + ${s}`;n.traverseKey(u,`data[${u}]`,o)}n.traversalKind==="Allows"&&n.return(!0)}_transform(n,s){s.path.push(W.intrinsic.nonNegativeIntegerString.internal);const o=super._transform(n,s);return s.path.pop(),o}reduceJsonSchema(n,s){if(this.prevariadic.length&&(n.prefixItems=this.prevariadic.map(o=>{const u=o.node.toJsonSchemaRecurse(s);if(o.kind==="defaultables"){const c=typeof o.default=="function"?o.default():o.default;u.default=W.intrinsic.jsonData.allows(c)?c:s.fallback.defaultValue({code:"defaultValue",base:u,value:c})}return u})),this.minLength&&(n.minItems=this.minLength),this.variadic){const o=Object.assign(n,{items:this.variadic.toJsonSchemaRecurse(s)});if(this.maxLength&&(o.maxItems=this.maxLength),this.postfix){const u=this.postfix.map(c=>c.toJsonSchemaRecurse(s));n=s.fallback.arrayPostfix({code:"arrayPostfix",base:o,elements:u})}}else n.items=!1,delete n.maxItems;return n}}const Vh={},u$=e=>{if(!e.defaultables)return[];const t=[];let n="[";const s=e.prefixLength+e.defaultablesLength-1;for(let o=e.prefixLength;o<=s;o++){const[u,c]=e.defaultables[o-e.prefixLength];t.push(UA(o,u,c)),n+=`${o}: ${u.id} = ${ur(c)}, `}return n+="]",Vh[n]??(Vh[n]=t)},YA={implementation:a$,Node:l$},c$=e=>{const t=[];if(e.prefix)for(const n of e.prefix)t.push({kind:"prefix",node:n});if(e.defaultables)for(const[n,s]of e.defaultables)t.push({kind:"defaultables",node:n,default:s});if(e.optionals)for(const n of e.optionals)t.push({kind:"optionals",node:n});if(e.variadic&&t.push({kind:"variadic",node:e.variadic}),e.postfix)for(const n of e.postfix)t.push({kind:"postfix",node:n});return t},ES=e=>e.reduce((t,n)=>(n.kind==="variadic"?t.variadic=n.node:n.kind==="defaultables"?t.defaultables=He(t.defaultables,[[n.node,n.default]]):t[n.kind]=He(t[n.kind],n.node),t),{}),XA="A postfix required element cannot follow an optional or defaultable element",f$="A postfix element requires a variadic element",ja=e=>{var g,v;const[t,...n]=e.l,[s,...o]=e.r;if(!t||!s)return e;const u=((g=n.at(-1))==null?void 0:g.kind)==="postfix",c=((v=o.at(-1))==null?void 0:v.kind)==="postfix",d=t.kind==="prefix"||s.kind==="prefix"?"prefix":t.kind==="postfix"||s.kind==="postfix"?"postfix":t.kind==="variadic"&&s.kind==="variadic"?"variadic":u||c?"prefix":t.kind==="defaultables"||s.kind==="defaultables"?"defaultables":"optionals";if(t.kind==="prefix"&&s.kind==="variadic"&&c){const S=ja({...e,fixedVariants:[],r:o.map(A=>({...A,kind:"prefix"}))});S.disjoint.length===0&&e.fixedVariants.push(S)}else if(s.kind==="prefix"&&t.kind==="variadic"&&u){const S=ja({...e,fixedVariants:[],l:n.map(A=>({...A,kind:"prefix"}))});S.disjoint.length===0&&e.fixedVariants.push(S)}const h=Lt(t.node,s.node,e.ctx);if(h instanceof oe)if(d==="prefix"||d==="postfix")e.disjoint.push(...h.withPrefixKey(d==="prefix"?e.result.length:`-${n.length+1}`,"required")),e.result=[...e.result,{kind:d,node:W.intrinsic.never.internal}];else return d==="optionals"||d==="defaultables"?e:ja({...e,fixedVariants:[],l:n.map(S=>({...S,kind:"prefix"})),r:n.map(S=>({...S,kind:"prefix"}))});else d==="defaultables"?(t.kind==="defaultables"&&s.kind==="defaultables"&&t.default!==s.default&&Z(zA(t.default,s.default)),e.result=[...e.result,{kind:d,node:h,default:t.kind==="defaultables"?t.default:s.kind==="defaultables"?s.default:wt(`Unexpected defaultable intersection from ${t.kind} and ${s.kind} elements.`)}]):e.result=[...e.result,{kind:d,node:h}];const p=e.l.length,y=e.r.length;return(t.kind!=="variadic"||p>=y&&(s.kind==="variadic"||y===1))&&(e.l=n),(s.kind!=="variadic"||y>=p&&(t.kind==="variadic"||p===1))&&(e.r=o),ja(e)},ZA=e=>t=>{var n,s;if(t.props.length||t.index){const o=((n=t.index)==null?void 0:n.map(c=>c[e]))??[];for(const c of t.props)o.push(c[e]);t.undeclared&&o.push(`+ (undeclared): ${t.undeclared}`);const u=`{ ${o.join(", ")} }`;return t.sequence?`${u} & ${t.sequence.description}`:u}return((s=t.sequence)==null?void 0:s.description)??"{}"},d$=ZA("description"),h$=ZA("expression"),RS=(e,t,n)=>{const s=e.required?"required":"optional";if(!t.signature.allows(e.key))return null;const o=qi(e.value,t.value,n);return o instanceof oe?s==="optional"?n.node("optional",{key:e.key,value:W.intrinsic.never.internal}):o.withPrefixKey(e.key,e.kind):null},p$=ut({kind:"structure",hasAssociatedError:!1,normalize:e=>e,applyConfig:(e,t)=>!e.undeclared&&t.onUndeclaredKey!=="ignore"?{...e,undeclared:t.onUndeclaredKey}:e,keys:{required:{child:!0,parse:rn("required"),reduceIo:(e,t,n)=>{t.required=He(t.required,n.map(s=>s[e]))}},optional:{child:!0,parse:rn("optional"),reduceIo:(e,t,n)=>{if(e==="in"){t.optional=n.map(s=>s.in);return}for(const s of n)t[s.outProp.kind]=He(t[s.outProp.kind],s.outProp.out)}},index:{child:!0,parse:rn("index")},sequence:{child:!0,parse:rn("sequence")},undeclared:{parse:e=>e==="ignore"?void 0:e,reduceIo:(e,t,n)=>{n==="delete"&&(e==="in"?delete t.undeclared:t.undeclared="reject")}}},defaults:{description:d$},intersections:{structure:(e,t,n)=>{const s={...e.inner},o={...t.inner},u=new oe;if(e.undeclared){const h=e.keyof();for(const p of t.requiredKeys)h.allows(p)||u.add("presence",W.intrinsic.never.internal,t.propsByKey[p].value,{path:[p]});o.optional&&(o.optional=o.optional.filter(p=>h.allows(p.key))),o.index&&(o.index=o.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=qi(h,p.signature,n.$);if(y instanceof oe)return[];const g=Np(y,p.value,n.$);return g.required&&(o.required=Ws(o.required,g.required)),g.optional&&(o.optional=Ws(o.optional,g.optional)),g.index??[]}))}if(t.undeclared){const h=t.keyof();for(const p of e.requiredKeys)h.allows(p)||u.add("presence",e.propsByKey[p].value,W.intrinsic.never.internal,{path:[p]});s.optional&&(s.optional=s.optional.filter(p=>h.allows(p.key))),s.index&&(s.index=s.index.flatMap(p=>{if(p.signature.extends(h))return p;const y=qi(h,p.signature,n.$);if(y instanceof oe)return[];const g=Np(y,p.value,n.$);return g.required&&(s.required=Ws(s.required,g.required)),g.optional&&(s.optional=Ws(s.optional,g.optional)),g.index??[]}))}const c={};(e.undeclared||t.undeclared)&&(c.undeclared=e.undeclared==="reject"||t.undeclared==="reject"?"reject":"delete");const d=wc({kind:"structure",baseInner:c,l:xc(s),r:xc(o),roots:[],ctx:n});return d instanceof oe&&u.push(...d),u.length?u:d}},reduce:(e,t)=>{if(e.index){if(!(e.required||e.optional))return;let n=!1;const s=e.required??[],o=e.optional??[],u=[...o];for(const c of e.index){for(const d of s){const h=RS(d,c,t);if(h instanceof oe)return h}for(const[d,h]of o.entries()){const p=RS(h,c,t);if(p instanceof oe)return p;p!==null&&(u[d]=p,n=!0)}}if(n)return t.node("structure",{...e,optional:u},{prereduced:!0})}}});var qw,Kw;class m$ extends Co{constructor(){super(...arguments);x(this,"impliedBasis",W.intrinsic.object.internal);x(this,"impliedSiblings",this.children.flatMap(n=>n.impliedSiblings??[]));x(this,"props",Ws(this.required,this.optional));x(this,"propsByKey",Fe(this.props,(n,s)=>[s.key,s]));x(this,"propsByKeyReference",Qt(this.propsByKey));x(this,"expression",h$(this));x(this,"requiredKeys",((qw=this.required)==null?void 0:qw.map(n=>n.key))??[]);x(this,"optionalKeys",((Kw=this.optional)==null?void 0:Kw.map(n=>n.key))??[]);x(this,"literalKeys",[...this.requiredKeys,...this.optionalKeys]);x(this,"_keyof");x(this,"traverseAllows",(n,s)=>this._traverse("Allows",n,s));x(this,"traverseApply",(n,s)=>this._traverse("Apply",n,s));x(this,"_traverse",(n,s,o)=>{const u=(o==null?void 0:o.currentErrorCount)??0;for(let c=0;c<this.props.length;c++)if(n==="Allows"){if(!this.props[c].traverseAllows(s,o))return!1}else if(this.props[c].traverseApply(s,o),o.failFast&&o.currentErrorCount>u)return!1;if(this.sequence){if(n==="Allows"){if(!this.sequence.traverseAllows(s,o))return!1}else if(this.sequence.traverseApply(s,o),o.failFast&&o.currentErrorCount>u)return!1}if(this.index||this.undeclared==="reject"){const c=Object.keys(s);c.push(...Object.getOwnPropertySymbols(s));for(let d=0;d<c.length;d++){const h=c[d];if(this.index){for(const p of this.index)if(p.signature.traverseAllows(h,o)){if(n==="Allows"){if(!Ui(h,()=>p.value.traverseAllows(s[h],o),o))return!1}else if(Ui(h,()=>p.value.traverseApply(s[h],o),o),o.failFast&&o.currentErrorCount>u)return!1}}if(this.undeclared==="reject"&&!this.declaresKey(h)&&(n==="Allows"||(o.errorFromNodeContext({code:"predicate",expected:"removed",actual:"",relativePath:[h],meta:this.meta}),o.failFast)))return!1}}return this.structuralMorph&&o&&!o.hasError()&&o.queueMorphs([this.structuralMorph]),!0});x(this,"declaresKey",n=>{var s;return n in this.propsByKey||((s=this.index)==null?void 0:s.some(o=>o.signature.allows(n)))||this.sequence!==void 0&&W.intrinsic.nonNegativeIntegerString.allows(n)});x(this,"structuralMorphRef",this.structuralMorph&&Qt(this.structuralMorph))}keyof(){if(this._keyof)return this._keyof;let n=this.$.units(this.literalKeys).branches;if(this.index)for(const{signature:s}of this.index)n=n.concat(s.branches);return this._keyof=this.$.node("union",n)}map(n){return this.$.node("structure",this.props.flatMap(n).reduce((s,o)=>{const u=this.propsByKey[o.key];if(Zt(o))return o.kind!=="required"&&o.kind!=="optional"?Z(`Map result must have kind "required" or "optional" (was ${o.kind})`):(s[o.kind]=He(s[o.kind],o),s);const c=o.kind??(u==null?void 0:u.kind)??"required",d=Fe(o,(h,p)=>h in qm.implementation.keys?[h,p]:[]);return s[c]=He(s[c],this.$.node(c,d)),s},{}))}assertHasKeys(n){const s=n.filter(o=>!Uu(o,this.keyof()));if(s.length)return Z(OS(this.expression,s))}get(n,...s){var h;let o,u=!1;const c=v$(n);if((typeof c=="string"||typeof c=="symbol")&&this.propsByKey[c]&&(o=this.propsByKey[c].value,u=this.propsByKey[c].required),this.index)for(const p of this.index)Uu(c,p.signature)&&(o=(o==null?void 0:o.and(p.value))??p.value);if(this.sequence&&Uu(c,W.intrinsic.nonNegativeIntegerString))if(ce(c,"root"))this.sequence.variadic&&(o=(o==null?void 0:o.and(this.sequence.element))??this.sequence.element);else{const p=Number.parseInt(c);if(p<this.sequence.prevariadic.length){const y=this.sequence.prevariadic[p].node;o=(o==null?void 0:o.and(y))??y,u||(u=p<this.sequence.prefixLength)}else if(this.sequence.variadic){const y=this.$.node("union",this.sequence.variadicOrPostfix);o=(o==null?void 0:o.and(y))??y}}if(!o)return(h=this.sequence)!=null&&h.variadic&&ce(c,"root")&&c.extends(W.intrinsic.number)?Z(S$(c.expression,this.sequence.expression)):Z(OS(this.expression,[c]));const d=o.get(...s);return u?d:d.or(W.intrinsic.undefined)}pick(...n){return this.assertHasKeys(n),this.$.node("structure",this.filterKeys("pick",n))}omit(...n){return this.assertHasKeys(n),this.$.node("structure",this.filterKeys("omit",n))}optionalize(){const{required:n,...s}=this.inner;return this.$.node("structure",{...s,optional:this.props.map(o=>o.hasKind("required")?this.$.node("optional",o.inner):o)})}require(){const{optional:n,...s}=this.inner;return this.$.node("structure",{...s,required:this.props.map(o=>o.hasKind("optional")?{key:o.key,value:o.value}:o)})}merge(n){const s=this.filterKeys("omit",[n.keyof()]);return n.required&&(s.required=He(s.required,n.required)),n.optional&&(s.optional=He(s.optional,n.optional)),n.index&&(s.index=He(s.index,n.index)),n.sequence&&(s.sequence=n.sequence),n.undeclared?s.undeclared=n.undeclared:delete s.undeclared,this.$.node("structure",s)}filterKeys(n,s){const o=hA(this.inner),u=c=>{const d=s.some(h=>Uu(c,h));return n==="pick"?d:!d};return o.required&&(o.required=o.required.filter(c=>u(c.key))),o.optional&&(o.optional=o.optional.filter(c=>u(c.key))),o.index&&(o.index=o.index.filter(c=>u(c.signature))),o}get defaultable(){var n;return this.cacheGetter("defaultable",((n=this.optional)==null?void 0:n.filter(s=>s.hasDefault()))??[])}_compileDeclaresKey(n){const s=[];if(this.props.length&&s.push(`k in ${this.propsByKeyReference}`),this.index)for(const o of this.index)s.push(n.invoke(o.signature,{kind:"Allows",arg:"k"}));return this.sequence&&s.push("$ark.intrinsic.nonNegativeIntegerString.allows(k)"),s.join(" || ")||"false"}get structuralMorph(){return this.cacheGetter("structuralMorph",g$(this))}compile(n){n.traversalKind==="Apply"&&n.initializeErrorCount();for(const s of this.props)n.check(s),n.traversalKind==="Apply"&&n.returnIfFailFast();if(this.sequence&&(n.check(this.sequence),n.traversalKind==="Apply"&&n.returnIfFailFast()),(this.index||this.undeclared==="reject")&&(n.const("keys","Object.keys(data)"),n.line("keys.push(...Object.getOwnPropertySymbols(data))"),n.for("i < keys.length",()=>this.compileExhaustiveEntry(n))),n.traversalKind==="Allows")return n.return(!0);this.structuralMorphRef&&n.if("ctx && !ctx.hasError()",()=>(n.line("ctx.queueMorphs(["),b$(n,this),n.line("])")))}compileExhaustiveEntry(n){if(n.const("k","keys[i]"),this.index)for(const s of this.index)n.if(`${n.invoke(s.signature,{arg:"k",kind:"Allows"})}`,()=>n.traverseKey("k","data[k]",s.value));return this.undeclared==="reject"&&n.if(`!(${this._compileDeclaresKey(n)})`,()=>n.traversalKind==="Allows"?n.return(!1):n.line(`ctx.errorFromNodeContext({ code: "predicate", expected: "removed", actual: "", relativePath: [k], meta: ${this.compiledMeta} })`).if("ctx.failFast",()=>n.return())),n}reduceJsonSchema(n,s){var o;switch(n.type){case"object":return this.reduceObjectJsonSchema(n,s);case"array":const u=((o=this.sequence)==null?void 0:o.reduceJsonSchema(n,s))??n;return this.props.length||this.index?s.fallback.arrayObject({code:"arrayObject",base:u,object:this.reduceObjectJsonSchema({type:"object"},s)}):u;default:return Et.throwInternalOperandError("structure",n)}}reduceObjectJsonSchema(n,s){if(this.props.length){n.properties={};for(const o of this.props){const u=o.value.toJsonSchemaRecurse(s);if(typeof o.key=="symbol"){s.fallback.symbolKey({code:"symbolKey",base:n,key:o.key,value:u,optional:o.optional});continue}if(o.hasDefault()){const c=typeof o.default=="function"?o.default():o.default;u.default=W.intrinsic.jsonData.allows(c)?c:s.fallback.defaultValue({code:"defaultValue",base:u,value:c})}n.properties[o.key]=u}this.requiredKeys.length&&n.properties&&(n.required=this.requiredKeys.filter(o=>typeof o=="string"&&o in n.properties))}if(this.index)for(const o of this.index){const u=o.value.toJsonSchemaRecurse(s);if(o.signature.equals(W.intrinsic.string)){n.additionalProperties=u;continue}for(const c of o.signature.branches){if(!c.extends(W.intrinsic.string)){n=s.fallback.symbolKey({code:"symbolKey",base:n,key:null,value:u,optional:!1});continue}let d={type:"string"};if(c.hasKind("morph")&&(d=s.fallback.morph({code:"morph",base:c.in.toJsonSchemaRecurse(s),out:c.out.toJsonSchemaRecurse(s)})),!c.hasKind("intersection"))return wt(`Unexpected index branch kind ${c.kind}.`);const{pattern:h}=c.inner;if(h){const p=Object.assign(d,{pattern:h[0].rule});for(let y=1;y<h.length;y++)d=s.fallback.patternIntersection({code:"patternIntersection",base:p,pattern:h[y].rule});n.patternProperties??(n.patternProperties={}),n.patternProperties[p.pattern]=u}}}return this.undeclared&&!n.additionalProperties&&(n.additionalProperties=!1),n}}const jh={},y$=e=>{var n,s;let t="";for(let o=0;o<e.defaultable.length;o++)t+=e.defaultable[o].defaultValueMorphRef;if((n=e.sequence)!=null&&n.defaultValueMorphsReference&&(t+=(s=e.sequence)==null?void 0:s.defaultValueMorphsReference),e.undeclared==="delete"){if(t+="delete !(",e.required)for(const o of e.required)t+=o.compiledKey+" | ";if(e.optional)for(const o of e.optional)t+=o.compiledKey+" | ";if(e.index)for(const o of e.index)t+=o.signature.id+" | ";if(e.sequence)if(e.sequence.maxLength===null)t+=pe.nonNegativeIntegerString.id;else for(let o=0;o<e.sequence.tuple.length;o++)t+=o+" | ";t+=")"}return t},g$=e=>{const t=y$(e);if(!t)return;if(jh[t])return jh[t];const n=(s,o)=>{var u;for(let c=0;c<e.defaultable.length;c++)e.defaultable[c].key in s||e.defaultable[c].defaultValueMorph(s,o);if((u=e.sequence)!=null&&u.defaultables)for(let c=s.length-e.sequence.prefixLength;c<e.sequence.defaultables.length;c++)e.sequence.defaultValueMorphs[c](s,o);if(e.undeclared==="delete")for(const c in s)e.declaresKey(c)||delete s[c];return s};return jh[t]=n},b$=(e,t)=>{var o;const s=`(data${t.defaultable.some(u=>u.defaultValueMorph.length===2)||((o=t.sequence)==null?void 0:o.defaultValueMorphs.some(u=>u.length===2))?", ctx":""})`;return e.block(`${s} => `,u=>{var c;for(let d=0;d<t.defaultable.length;d++){const{serializedKey:h,defaultValueMorphRef:p}=t.defaultable[d];u.if(`!(${h} in data)`,y=>y.line(`${p}${s}`))}return(c=t.sequence)!=null&&c.defaultables&&u.for(`i < ${t.sequence.defaultables.length}`,d=>d.set("data[i]",5),`data.length - ${t.sequence.prefixLength}`),t.undeclared==="delete"&&u.forIn("data",d=>d.if(`!(${t._compileDeclaresKey(d)})`,h=>h.line("delete data[k]"))),u.return("data")})},JA={implementation:p$,Node:m$},v$=e=>(ce(e,"root")&&e.hasKind("unit")&&(e=e.unit),typeof e=="number"&&(e=`${e}`),e),S$=(e,t)=>`${e} is not allowed as an array index on ${t}. Use the 'nonNegativeIntegerString' keyword instead.`,Np=(e,t,n)=>{const[s,o]=vD(e.branches,c=>c.hasKind("unit"));if(!s.length)return{index:n.node("index",{signature:e,value:t})};const u={};for(const c of s){const d=n.node("required",{key:c.unit,value:t});u[d.kind]=He(u[d.kind],d)}return o.length&&(u.index=n.node("index",{signature:o,value:t})),u},w$=e=>ce(e,"root")?e.expression:Pe(e),OS=(e,t)=>`Key${t.length===1?"":"s"} ${t.map(w$).join(", ")} ${t.length===1?"does":"do"} not exist on ${e}`,Qc={...f2,alias:Pm.implementation,domain:Hm.implementation,unit:HA.implementation,proto:Tc.implementation,union:IA.implementation,morph:KA.implementation,intersection:qA.implementation,divisor:AA.implementation,pattern:BA.implementation,predicate:xA.implementation,required:GA.implementation,optional:qm.implementation,index:FA.implementation,sequence:YA.implementation,structure:JA.implementation};W.defaultConfig=kD(Object.assign(Fe(Qc,(e,t)=>[e,t.defaults]),{jitless:qD(),clone:jD,onUndeclaredKey:"ignore",exactOptionalPropertyTypes:!0,numberAllowsNaN:!1,dateAllowsInvalid:!1,onFail:null,keywords:{},toJsonSchema:Et.defaultConfig}));W.resolvedConfig=Mp(W.defaultConfig,W.config);const x$={...d2,alias:Pm.Node,domain:Hm.Node,unit:HA.Node,proto:Tc.Node,union:IA.Node,morph:KA.Node,intersection:qA.Node,divisor:AA.Node,pattern:BA.Node,predicate:xA.Node,required:GA.Node,optional:qm.Node,index:FA.Node,sequence:YA.Node,structure:JA.Node};class $p extends RD{get[zi](){return"module"}}const QA=(e,t)=>new $p(Fe(e,(n,s)=>[n,ce(s,"module")?QA(s,t):t.bindReference(s)])),A$=e=>Yt(e)?e:"branches"in e&&Yt(e.branches)?e.branches:void 0,T$=(e,t)=>Z(`Node of kind ${t} is not valid as a ${e} definition`),MS=e=>`#${e} duplicates public alias ${e}`,zh={};W.ambient??(W.ambient={});let _S;const WA="function $",E$=e=>eT(e,tT(e)),eT=(e,t)=>{const n=t.write(WA,4),s=t.compile()();for(const o of e)o.precompilation||(o.traverseAllows=s[`${o.id}Allows`].bind(s),o.isRoot()&&!o.allowsRequiresContext&&(o.allows=o.traverseAllows),o.traverseApply=s[`${o.id}Apply`].bind(s),s[`${o.id}Optimistic`]&&(o.traverseOptimistic=s[`${o.id}Optimistic`].bind(s)),o.precompilation=n)},tT=e=>new cA().return(e.reduce((t,n)=>{const s=new $h({kind:"Allows"}).indent();n.compile(s);const o=s.write(`${n.id}Allows`),u=new $h({kind:"Apply"}).indent();n.compile(u);const c=u.write(`${n.id}Apply`),d=`${t}${o},
106
+ ${c},
107
+ `;if(!n.hasKind("union"))return d;const h=new $h({kind:"Allows",optimistic:!0}).indent();n.compile(h);const p=h.write(`${n.id}Optimistic`);return`${d}${p},
108
+ `},`{
109
+ `)+"}");class nT{constructor(t,n){x(this,"config");x(this,"resolvedConfig");x(this,"name");x(this,"referencesById",{});x(this,"references",[]);x(this,"resolutions",{});x(this,"exportedNames",[]);x(this,"aliases",{});x(this,"resolved",!1);x(this,"nodesByHash",{});x(this,"intrinsic");x(this,"_json");x(this,"generic",(...t)=>{const n=this;return(s,o)=>new Ac(t,o?new wA(s):s,n,n,o??null)});x(this,"units",(t,n)=>{const s=[];for(const u of t)s.includes(u)||s.push(u);const o=s.map(u=>this.node("unit",{unit:u},n));return this.node("union",o,{...n,prereduced:!0})});x(this,"lazyResolutions",[]);x(this,"schema",(t,n)=>this.finalize(this.parseSchema(t,n)));x(this,"parseSchema",(t,n)=>this.node(Ju(t),t,n));x(this,"precompilation");x(this,"_exportedResolutions");x(this,"_exports");x(this,"node",(t,n,s={})=>{const o=this.preparseNode(t,n,s);if(Zt(o))return this.bindReference(o);const u=this.createParseContext(o),c=VA(u),d=this.bindReference(c);return $n[u.id]=d});x(this,"parse",(t,n={})=>this.finalize(this.parseDefinition(t,n)));this.config=Mp(W.config,n),this.resolvedConfig=Mp(W.resolvedConfig,n),this.name=this.resolvedConfig.name??`anonymousScope${Object.keys(zh).length}`,this.name in zh&&Z(`A Scope already named ${this.name} already exists`),zh[this.name]=this;const s=Object.entries(t).map(o=>this.preparseOwnAliasEntry(...o));for(const[o,u]of s){let c=o;if(o[0]==="#"?(c=o.slice(1),c in this.aliases&&Z(MS(c)),this.aliases[c]=u):(c in this.aliases&&Z(MS(o)),this.aliases[c]=u,this.exportedNames.push(c)),!ce(u,"module")&&!ce(u,"generic")&&!Fc(u)){const d=this.preparseOwnDefinitionFormat(u,{alias:c});this.resolutions[c]=ce(d,"root")?this.bindReference(d):this.createParseContext(d).id}}_S??(_S=this.node("union",{branches:["string","number","object","bigint","symbol",{unit:!0},{unit:!1},{unit:void 0},{unit:null}]},{prereduced:!0})),this.nodesByHash[_S.hash]=this.node("intersection",{},{prereduced:!0}),this.intrinsic=W.intrinsic?Fe(W.intrinsic,(o,u)=>o.startsWith("json")?[]:[o,this.bindReference(u)]):{}}get[zi](){return"scope"}cacheGetter(t,n){return Object.defineProperty(this,t,{value:n}),n}get internal(){return this}get json(){return this._json||this.export(),this._json}defineSchema(t){return t}lazilyResolve(t,n){const s=this.node("alias",{reference:n??"synthetic",resolve:t},{prereduced:!0});return this.resolved||this.lazyResolutions.push(s),s}preparseNode(t,n,s){var d;let o=typeof t=="string"?t:Ju(n,t);if(Zt(n)&&n.kind===o)return n;if(o==="alias"&&!(s!=null&&s.prereduced)){const{reference:h}=Pm.implementation.normalize(n,this);if(h.startsWith("$")){const p=this.resolveRoot(h.slice(1));n=p,o=p.kind}}else if(o==="union"&&fr(n,"object")){const h=A$(n);(h==null?void 0:h.length)===1&&(n=h[0],o=Ju(n))}if(Zt(n)&&n.kind===o)return n;const u=Qc[o],c=((d=u.normalize)==null?void 0:d.call(u,n,this))??n;return Zt(c)?c.kind===o?c:T$(o,c.kind):{...s,$:this,kind:o,def:c,prefix:s.alias??o}}bindReference(t){let n;return Zt(t)?n=t.$===this?t:new t.constructor(t.attachments,this):n=t.$===this?t:new Ac(t.params,t.bodyDef,t.$,this,t.hkt),this.resolved||Object.assign(this.referencesById,n.referencesById),n}resolveRoot(t){return this.maybeResolveRoot(t)??Z(oT(t))}maybeResolveRoot(t){const n=this.maybeResolve(t);if(!ce(n,"generic"))return n}maybeResolveSubalias(t){return Bp(this.aliases,t)??Bp(this.ambient,t)}get ambient(){return W.ambient}maybeResolve(t){var o;const n=this.resolutions[t];if(n){if(typeof n!="string")return this.bindReference(n);const u=$n[n];if(ce(u,"root"))return this.resolutions[t]=u;if(ce(u,"context")){if(u.phase==="resolving")return this.node("alias",{reference:`$${t}`},{prereduced:!0});if(u.phase==="resolved")return wt(`Unexpected resolved context for was uncached by its scope: ${Pe(u)}`);u.phase="resolving";const c=this.bindReference(this.parseOwnDefinitionFormat(u.def,u));return u.phase="resolved",$n[c.id]=c,$n[u.id]=c,this.resolutions[t]=c}return wt(`Unexpected nodesById entry for ${n}: ${Pe(u)}`)}let s=this.aliases[t]??((o=this.ambient)==null?void 0:o[t]);return s?(s=this.normalizeRootScopeValue(s),ce(s,"generic")?this.resolutions[t]=this.bindReference(s):ce(s,"module")?(s.root||Z(aT(t)),this.resolutions[t]=this.bindReference(s.root)):this.resolutions[t]=this.parse(s,{alias:t})):this.maybeResolveSubalias(t)}createParseContext(t){const n=t.id??LA(t.prefix);return $n[n]=Object.assign(t,{[zi]:"context",$:this,id:n,phase:"unresolved"})}traversal(t){return new so(t,this.resolvedConfig)}import(...t){return new $p(Fe(this.export(...t),(n,s)=>[`#${n}`,s]))}export(...t){if(!this._exports){this._exports={};for(const s of this.exportedNames){const o=this.aliases[s];this._exports[s]=ce(o,"module")?QA(o,this):CS(this.maybeResolve(s))}for(const s of this.lazyResolutions)s.resolution;if(this._exportedResolutions=rT(this,this._exports),this._json=sT(this._exportedResolutions),Object.assign(this.resolutions,this._exportedResolutions),this.references=Object.values(this.referencesById),!this.resolvedConfig.jitless){const s=tT(this.references);this.precompilation=s.write(WA,4),eT(this.references,s)}this.resolved=!0}const n=t.length?t:this.exportedNames;return new $p(Fe(n,(s,o)=>[o,this._exports[o]]))}resolve(t){return this.export()[t]}parseDefinition(t,n={}){if(ce(t,"root"))return this.bindReference(t);const s=this.preparseOwnDefinitionFormat(t,n);if(ce(s,"root"))return this.bindReference(s);const o=this.createParseContext(s);$n[o.id]=o;let u=this.bindReference(this.parseOwnDefinitionFormat(t,o));return u.isCyclic&&(u=g2(u,o.id)),$n[o.id]=u,u}finalize(t){return CS(t),!t.precompilation&&!this.resolvedConfig.jitless&&E$(t.references),t}}class iT extends nT{parseOwnDefinitionFormat(t,n){return VA(n)}preparseOwnDefinitionFormat(t,n){return this.preparseNode(Ju(t),t,n)}preparseOwnAliasEntry(t,n){return[t,n]}normalizeRootScopeValue(t){return t}}const CS=e=>{const t=e.references.filter(n=>n.hasKind("alias"));for(const n of t){Object.assign(n.referencesById,n.resolution.referencesById);for(const s of e.references)n.id in s.referencesById&&Object.assign(s.referencesById,n.referencesById)}return e},sT=e=>Fe(e,(t,n)=>[t,ce(n,"root")||ce(n,"generic")?n.json:ce(n,"module")?sT(n):wt(`Unexpected resolution ${Pe(n)}`)]),Bp=(e,t)=>{const n=t.indexOf(".");if(n===-1)return;const s=t.slice(0,n),o=e[s];if(o===void 0)return;if(!ce(o,"module"))return Z(R$(s));const u=t.slice(n+1),c=o[u];if(c===void 0)return Bp(o,u);if(ce(c,"root")||ce(c,"generic"))return c;if(ce(c,"module"))return c.root??Z(aT(t));wt(`Unexpected resolution for alias '${t}': ${Pe(c)}`)},Fm=(e,t)=>new iT(e,t),ml=new iT({}),rT=(e,t)=>{const n={};for(const s in t){const o=t[s];if(ce(o,"module")){const u=rT(e,o),c=Fe(u,(d,h)=>[`${s}.${d}`,h]);Object.assign(n,c)}else ce(o,"root")||ce(o,"generic")?n[s]=o:wt(`Unexpected scope resolution ${Pe(o)}`)}return n},oT=e=>`'${e}' is unresolvable`,R$=e=>`'${e}' must reference a module to be accessed using dot syntax`,aT=e=>`Reference to submodule '${e}' must specify an alias`;ml.export();const Xe=ml.schema,Gm=ml.node;ml.defineSchema;const Ii=ml.generic,lT="^(?:0|[1-9]\\d*)$",O$=new RegExp(lT);Qt(O$);const uT=Fm({bigint:"bigint",boolean:[{unit:!1},{unit:!0}],false:{unit:!1},never:[],null:{unit:null},number:"number",object:"object",string:"string",symbol:"symbol",true:{unit:!0},unknown:{},undefined:{unit:void 0},Array,Date},{prereducedAliases:!0}).export();W.intrinsic={...uT};const cT=Fm({integer:{domain:"number",divisor:1},lengthBoundable:["string",Array],key:["string","symbol"],nonNegativeIntegerString:{domain:"string",pattern:lT}},{prereducedAliases:!0}).export();Object.assign(W.intrinsic,cT);const M$=Fm({jsonPrimitive:["string","number",{unit:!0},{unit:!1},{unit:null}],jsonObject:{domain:"object",index:{signature:"string",value:"$jsonData"}},jsonData:["$jsonPrimitive","$jsonObject"]},{prereducedAliases:!0}).export(),pe={...uT,...cT,...M$,emptyStructure:Gm("structure",{},{prereduced:!0})};W.intrinsic={...pe};const _$=e=>typeof e=="string"&&e[0]==="d"&&(e[1]==="'"||e[1]==='"')&&e.at(-1)===e[1],kS=e=>e.toString()!=="Invalid Date",C$=e=>e.slice(2,-1),fT=e=>`'${e}' could not be parsed by the Date constructor`,k$=(e,t)=>D$(e,t),D$=(e,t)=>{const n=new Date(e);if(kS(n))return n;const s=sN(e);if(s!==void 0){const o=new Date(s);if(kS(o))return o}return t?Z(t===!0?fT(e):t):void 0},DS=(e,t)=>{const n=e.scanner.shiftUntil($$[hT[t]]);if(e.scanner.lookahead==="")return e.error(L$(n,t));if(e.scanner.shift(),t==="/"){try{new RegExp(n)}catch(s){Z(String(s))}e.root=e.ctx.$.node("intersection",{domain:"string",pattern:n},{prereduced:!0})}else if(pi(t,dT))e.root=e.ctx.$.node("unit",{unit:n});else{const s=k$(n,fT(n));e.root=e.ctx.$.node("unit",{meta:n,unit:s})}},dT={"'":1,'"':1},N$={"/":1,"'":1,'"':1},hT={"d'":"'",'d"':'"',"'":"'",'"':'"',"/":"/"},$$={"'":e=>e.lookahead==="'",'"':e=>e.lookahead==='"',"/":e=>e.lookahead==="/"},B$={'"':"double-quote","'":"single-quote","/":"forward slash"},L$=(e,t)=>`${t}${e} requires a closing ${B$[hT[t]]}`,V$=e=>`Private type references should not include '#'. Use '${e}' instead.`,pT="Optional definitions like 'string?' are only valid as properties in an object or tuple",mT="Defaultable definitions like 'number = 0' are only valid as properties in an object or tuple",j$={">":!0,">=":!0},z$={"<":!0,"<=":!0},Ec={"<":">",">":"<","<=":">=",">=":"<=","==":"=="},U$=e=>`Unmatched )${e===""?"":` before ${e}`}`,yT=e=>`Missing ${e}`,q$=(e,t)=>`Left bounds are only valid when paired with right bounds (try ...${t}${e})`,gT=e=>`Left-bounded expressions must specify their limits using < or <= (was ${e})`,K$=(e,t,n,s)=>`An expression may have at most one left bound (parsed ${e}${Ec[t]}, ${n}${Ec[s]})`,P$=(e,t,n)=>bT(e,t,n,[]),bT=(e,t,n,s)=>{const o=n.parseUntilFinalizer();return s.push(o.root),o.finalizer===">"?s.length!==t.params.length?n.error(vT(e,t.names,s.map(u=>u.expression))):s:o.finalizer===","?bT(e,t,n,s):o.error(yT(">"))},vT=(e,t,n)=>`${e}<${t.join(", ")}> requires exactly ${t.length} args (got ${n.length}${n.length===0?"":`: ${n.join(", ")}`})`,NS=e=>{const t=e.scanner.shiftUntilNextTerminator();t==="keyof"?e.addPrefix("keyof"):e.root=H$(e,t)},I$=(e,t,n)=>{if(n.scanner.shiftUntilNonWhitespace(),n.scanner.shift()!=="<")return n.error(vT(e,t.names,[]));const o=P$(e,t,n);return t(...o)},H$=(e,t)=>F$(e,t)??G$(e,t)??e.error(t===""?e.scanner.lookahead==="#"?V$(e.shiftedByOne().scanner.shiftUntilNextTerminator()):ST(e):oT(t)),F$=(e,t)=>{var s;if((s=e.ctx.args)!=null&&s[t]){const o=e.ctx.args[t];return typeof o!="string"?o:e.ctx.$.node("alias",{reference:o},{prereduced:!0})}const n=e.ctx.$.maybeResolve(t);if(ce(n,"root"))return n;if(n!==void 0)return ce(n,"generic")?I$(t,n,e):Z(`Unexpected resolution ${Pe(n)}`)},G$=(e,t)=>{const n=rN(t);if(n!==void 0)return e.ctx.$.node("unit",{unit:n});const s=aN(t);if(s!==void 0)return e.ctx.$.node("unit",{unit:s})},ST=e=>{const t=e.previousOperator();return t?wT(t,e.scanner.unscanned):Y$(e.scanner.unscanned)},wT=(e,t="")=>`Token '${e}' requires a right operand${t?` before '${t}'`:""}`,Y$=e=>`Expected an expression${e?` before '${e}'`:""}`,xT=e=>e.scanner.lookahead===""?e.error(ST(e)):e.scanner.lookahead==="("?e.shiftedByOne().reduceGroupOpen():e.scanner.lookaheadIsIn(N$)?DS(e,e.scanner.shift()):e.scanner.lookaheadIsIn(Gc)?xT(e.shiftedByOne()):e.scanner.lookahead==="d"&&e.scanner.nextLookahead in dT?DS(e,`${e.scanner.shift()}${e.scanner.shift()}`):NS(e),Qs=class Qs extends mN{shiftUntilNextTerminator(){return this.shiftUntilNonWhitespace(),this.shiftUntil(()=>this.lookahead in Qs.terminatingChars)}};x(Qs,"terminatingChars",{"<":1,">":1,"=":1,"|":1,"&":1,")":1,"[":1,"%":1,",":1,":":1,"?":1,"#":1,...Gc}),x(Qs,"finalizingLookaheads",{">":1,",":1,"":1,"=":1,"?":1}),x(Qs,"lookaheadIsFinalizing",(t,n)=>t===">"?n[0]==="="?n[1]==="=":n.trimStart()===""||pi(n.trimStart()[0],Qs.terminatingChars):t==="="?n[0]!=="=":t===","||t==="?");let Za=Qs;const X$=(e,t)=>{const n=J$(e,t);if(e.root.hasKind("unit")){if(typeof e.root.unit=="number"){e.reduceLeftBound(e.root.unit,n),e.unsetRoot();return}if(e.root.unit instanceof Date){const s=`d'${e.root.description??e.root.unit.toISOString()}'`;e.unsetRoot(),e.reduceLeftBound(s,n);return}}return W$(e,n)},Z$={"<":1,">":1,"=":1},J$=(e,t)=>e.scanner.lookaheadIs("=")?`${t}${e.scanner.shift()}`:t,$S=(e,t,n,s)=>n.extends(W.intrinsic.number)?typeof t!="number"?Z(Lp(e,t,s)):e==="=="?["min","max"]:e[0]===">"?["min"]:["max"]:n.extends(W.intrinsic.lengthBoundable)?typeof t!="number"?Z(Lp(e,t,s)):e==="=="?["exactLength"]:e[0]===">"?["minLength"]:["maxLength"]:n.extends(W.intrinsic.Date)?e==="=="?["after","before"]:e[0]===">"?["after"]:["before"]:Z(ZN(n.expression)),Q$=e=>({rule:_$(e.limit)?C$(e.limit):e.limit,exclusive:e.comparator.length===1}),W$=(e,t)=>{const n=e.unsetRoot(),s=e.scanner.location;e.parseOperand();const o=e.unsetRoot(),u=e.scanner.sliceChars(s,e.scanner.location);if(e.root=n,!o.hasKind("unit")||typeof o.unit!="number"&&!(o.unit instanceof Date))return e.error(Lp(t,u,"right"));const c=o.unit,d=t.length===1,h=$S(t,typeof c=="number"?c:u,n,"right");for(const y of h)e.constrainRoot(y,t==="=="?{rule:c}:{rule:c,exclusive:d});if(!e.branches.leftBound)return;if(!pi(t,z$))return e.error(gT(t));const p=$S(e.branches.leftBound.comparator,e.branches.leftBound.limit,n,"left");e.constrainRoot(p[0],Q$(e.branches.leftBound)),e.branches.leftBound=null},Lp=(e,t,n)=>`Comparator ${n==="left"?Ec[e]:e} must be ${n==="left"?"preceded":"followed"} by a corresponding literal (was ${t})`,e3=e=>{e.scanner.shiftUntilNonWhitespace();const t=e.scanner.shiftUntilNextTerminator();e.root=e.root.brand(t)},t3=e=>{const t=e.scanner.shiftUntilNextTerminator(),n=oN(t,{errorOnFail:BS(t)});n===0&&e.error(BS(0)),e.root=e.root.constrain("divisor",n)},BS=e=>`% operator must be followed by a non-zero integer literal (was ${e})`,AT=e=>{const t=e.scanner.shift();return t===""?e.finalize(""):t==="["?e.scanner.shift()==="]"?e.setRoot(e.root.array()):e.error(n3):t==="|"?e.scanner.lookahead===">"?e.shiftedByOne().pushRootToBranch("|>"):e.pushRootToBranch(t):t==="&"?e.pushRootToBranch(t):t===")"?e.finalizeGroup():Za.lookaheadIsFinalizing(t,e.scanner.unscanned)?e.finalize(t):pi(t,Z$)?X$(e,t):t==="%"?t3(e):t==="#"?e3(e):t in Gc?AT(e):e.error(Ym(t))},Ym=(e,t="")=>`'${e}' is not allowed here${t&&` (should be ${t})`}`,n3="Missing expected ']'",i3=e=>{const t=e.unsetRoot();e.parseOperand();const n=e.unsetRoot();if(!n.hasKind("unit"))return e.error(s3(n.expression));const s=n.unit instanceof Date?()=>new Date(n.unit):n.unit;return[t,"=",s]},s3=e=>`Default value '${e}' must a literal value`,LS=(e,t)=>{const n=t.$.maybeResolveRoot(e);if(n)return n;if(e.endsWith("[]")){const u=t.$.maybeResolveRoot(e.slice(0,-2));if(u)return u.array()}const s=new Wc(new Za(e),t),o=r3(s);return s.finalizer===">"&&Z(Ym(">")),o},r3=e=>{e.parseOperand();let t=Xm(e).root;return t?(e.finalizer==="="?t=i3(e):e.finalizer==="?"&&(t=[t,"?"]),e.scanner.shiftUntilNonWhitespace(),e.scanner.lookahead&&Z(Ym(e.scanner.lookahead)),t):wt(`Root was unexpectedly unset after parsing string '${e.scanner.scanned}'`)},Xm=e=>{for(;e.finalizer===void 0;)o3(e);return e},o3=e=>e.hasRoot()?e.parseOperator():e.parseOperand();class Wc{constructor(t,n){x(this,"root");x(this,"branches",{prefixes:[],leftBound:null,intersection:null,union:null,pipe:null});x(this,"finalizer");x(this,"groups",[]);x(this,"scanner");x(this,"ctx");this.scanner=t,this.ctx=n}error(t){return Z(t)}hasRoot(){return this.root!==void 0}setRoot(t){this.root=t}unsetRoot(){const t=this.root;return this.root=void 0,t}constrainRoot(...t){this.root=this.root.constrain(t[0],t[1])}finalize(t){if(this.groups.length)return this.error(yT(")"));this.finalizeBranches(),this.finalizer=t}reduceLeftBound(t,n){const s=Ec[n];if(!pi(s,j$))return this.error(gT(n));if(this.branches.leftBound)return this.error(K$(this.branches.leftBound.limit,this.branches.leftBound.comparator,t,s));this.branches.leftBound={comparator:s,limit:t}}finalizeBranches(){if(this.assertRangeUnset(),this.branches.pipe){this.pushRootToBranch("|>"),this.root=this.branches.pipe;return}if(this.branches.union){this.pushRootToBranch("|"),this.root=this.branches.union;return}if(this.branches.intersection){this.pushRootToBranch("&"),this.root=this.branches.intersection;return}this.applyPrefixes()}finalizeGroup(){this.finalizeBranches();const t=this.groups.pop();if(!t)return this.error(U$(this.scanner.unscanned));this.branches=t}addPrefix(t){this.branches.prefixes.push(t)}applyPrefixes(){for(;this.branches.prefixes.length;){const t=this.branches.prefixes.pop();this.root=t==="keyof"?this.root.keyof():wt(`Unexpected prefix '${t}'`)}}pushRootToBranch(t){var s,o,u;this.assertRangeUnset(),this.applyPrefixes();const n=this.root;this.root=void 0,this.branches.intersection=((s=this.branches.intersection)==null?void 0:s.rawAnd(n))??n,t!=="&"&&(this.branches.union=((o=this.branches.union)==null?void 0:o.rawOr(this.branches.intersection))??this.branches.intersection,this.branches.intersection=null,t!=="|"&&(this.branches.pipe=((u=this.branches.pipe)==null?void 0:u.rawPipeOnce(this.branches.union))??this.branches.union,this.branches.union=null))}parseUntilFinalizer(){return Xm(new Wc(this.scanner,this.ctx))}parseOperator(){return AT(this)}parseOperand(){return xT(this)}assertRangeUnset(){if(this.branches.leftBound)return this.error(q$(this.branches.leftBound.limit,this.branches.leftBound.comparator))}reduceGroupOpen(){this.groups.push(this.branches),this.branches={prefixes:[],leftBound:null,union:null,intersection:null,pipe:null}}previousOperator(){var t;return((t=this.branches.leftBound)==null?void 0:t.comparator)??this.branches.prefixes.at(-1)??(this.branches.intersection?"&":this.branches.union?"|":this.branches.pipe?"|>":void 0)}shiftedByOne(){return this.scanner.shift(),this}}const a3="An empty string is not a valid generic parameter name",Vp=(e,t,n)=>{e.shiftUntilNonWhitespace();const s=e.shiftUntilNextTerminator();return s===""?e.lookahead===""&&t.length?t:Z(a3):(e.shiftUntilNonWhitespace(),l3(e,s,t,n))},VS="extends ",l3=(e,t,n,s)=>{if(e.shiftUntilNonWhitespace(),e.unscanned.startsWith(VS))e.jumpForward(VS.length);else return e.lookahead===","&&e.shift(),n.push(t),Vp(e,n,s);const o=Xm(new Wc(e,s));return n.push([t,o.root]),Vp(e,n,s)};class u3 extends _o{constructor(n){super((...s)=>new qu(n)(...s),{bind:n});x(this,"$");this.$=n}in(n){return new qu(this.$,n===void 0?void 0:this.$.parse(n))}at(n,s){return new qu(this.$).at(n,s)}case(n,s){return new qu(this.$).case(n,s)}}class qu extends _o{constructor(n,s){super(o=>this.caseEntries(Object.entries(o).map(([u,c])=>u==="default"?[u,c]:[this.$.parse(u),c])));x(this,"$");x(this,"in");x(this,"key");x(this,"branches",[]);this.$=n,this.in=s}at(n,s){return this.key&&Z(f3),this.branches.length&&Z(c3),this.key=n,s?this.match(s):this}case(n,s){return this.caseEntry(this.$.parse(n),s)}caseEntry(n,s){const u=(this.key?this.$.parse({[this.key]:n}):n).pipe(s);return this.branches.push(u),this}match(n){return this(n)}strings(n){return this.caseEntries(Object.entries(n).map(([s,o])=>s==="default"?[s,o]:[this.$.node("unit",{unit:s}),o]))}caseEntries(n){for(let s=0;s<n.length;s++){const[o,u]=n[s];if(o==="default")return s!==n.length-1&&Z("default may only be specified as the last key of a switch definition"),this.default(u);if(typeof u!="function")return Z(`Value for case "${o}" must be a function (was ${Gn(u)})`);this.caseEntry(o,u)}return this}default(n){typeof n=="function"&&this.case(pe.unknown,n);const s={branches:this.branches,ordered:!0};(n==="never"||n==="assert")&&(s.meta={onFail:jS});const o=this.$.node("union",s);if(!this.in)return this.$.finalize(o);let u=this.in.pipe(o);return(n==="never"||n==="assert")&&(u=u.configureReferences({onFail:jS},"self")),this.$.finalize(u)}}const jS=e=>e.throw(),c3="A key matcher must be specified before the first case i.e. match.at('foo') or match.in<object>().at('bar')",f3="At most one key matcher may be specified per expression",TT=(e,t)=>{if(Yt(e)){if(e[1]==="=")return[t.$.parseOwnDefinitionFormat(e[0],t),"=",e[2]];if(e[1]==="?")return[t.$.parseOwnDefinitionFormat(e[0],t),"?"]}return kT(e,t)},d3="Only required keys may make their values optional, e.g. { [mySymbol]: ['number', '?'] }",h3="Only required keys may specify default values, e.g. { value: 'number = 0' }",p3=(e,t)=>{var c;let n;const s={},o=gc(e);for(const[d,h]of o){const p=g3(d);if(p.kind==="spread"){if(!ll(s))return Z(y3);const A=t.$.parseOwnDefinitionFormat(h,t);if(A.equals(pe.object))continue;if(!A.hasKind("intersection")||!((c=A.basis)!=null&&c.equals(pe.object)))return Z(b3(A.expression));n=A.structure;continue}if(p.kind==="undeclared"){h!=="reject"&&h!=="delete"&&h!=="ignore"&&Z(m3(h)),s.undeclared=h;continue}const y=TT(h,t),g=p;if(p.kind==="required"){Yt(y)?Uh(s,"optional",y[1]==="="?{key:p.normalized,value:y[0],default:y[2]}:{key:p.normalized,value:y[0]},t):Uh(s,"required",{key:p.normalized,value:y},t);continue}if(Yt(y)&&(y[1]==="?"&&Z(d3),y[1]==="="&&Z(h3)),p.kind==="optional"){Uh(s,"optional",{key:p.normalized,value:y},t);continue}const v=t.$.parseOwnDefinitionFormat(g.normalized,t),S=Np(v,y,t.$);S.index&&(s.index=He(s.index,S.index)),S.required&&(s.required=He(s.required,S.required))}const u=t.$.node("structure",s);return t.$.parseSchema({domain:"object",structure:(n==null?void 0:n.merge(u))??u})},Uh=(e,t,n,s)=>{e[t]=He(e[t],s.$.node(t,n))},m3=e=>`Value of '+' key must be 'reject', 'delete', or 'ignore' (was ${Pe(e)})`,y3="Spread operator may only be used as the first key in an object",g3=e=>typeof e=="symbol"?{kind:"required",normalized:e}:e.at(-1)==="?"?e.at(-2)===Ap?{kind:"required",normalized:`${e.slice(0,-2)}?`}:{kind:"optional",normalized:e.slice(0,-1)}:e[0]==="["&&e.at(-1)==="]"?{kind:"index",normalized:e.slice(1,-1)}:e[0]===Ap&&e[1]==="["&&e.at(-1)==="]"?{kind:"required",normalized:e.slice(1)}:e==="..."?{kind:"spread"}:e==="+"?{kind:"undeclared"}:{kind:"required",normalized:e==="\\..."?"...":e==="\\+"?"+":e},b3=e=>`Spread operand must resolve to an object literal type (was ${e})`,v3=(e,t)=>_3(e)?MT[e[0]](e,t):O3(e)?OT[e[1]](e,t):null,S3=(e,t)=>t.$.parseOwnDefinitionFormat(e[1],t).keyof(),qh=(e,t)=>{if(e[2]===void 0)return Z(wT(e[1],""));const n=t.$.parseOwnDefinitionFormat(e[0],t),s=t.$.parseOwnDefinitionFormat(e[2],t);if(e[1]==="|")return t.$.node("union",{branches:[n,s]});const o=e[1]==="&"?qi(n,s,t.$):Cp(n,s,t.$);return o instanceof oe?o.throw():o},w3=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).array(),x3=(e,t)=>typeof e[2]!="function"?Z(ET("=>",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).pipe(e[2]),ET=(e,t)=>`${e===":"?"Narrow":"Morph"} expression requires a function following '${e}' (was ${typeof t})`,A3=(e,t)=>typeof e[2]!="function"?Z(ET(":",e[2])):t.$.parseOwnDefinitionFormat(e[0],t).constrain("predicate",e[2]),T3=(e,t)=>t.$.parseOwnDefinitionFormat(e[0],t).configureReferences(e[2],"shallow"),RT=e=>e,E3=RT({"[]":w3,"?":()=>Z(pT)}),R3=RT({"|":qh,"&":qh,":":A3,"=>":x3,"|>":qh,"@":T3,"=":()=>Z(mT)}),OT={...E3,...R3},O3=e=>OT[e[1]]!==void 0,M3=e=>e,MT=M3({keyof:S3,instanceof:(e,t)=>{if(typeof e[1]!="function")return Z(zS(xp(e[1])));const n=e.slice(1).map(s=>typeof s=="function"?t.$.node("proto",{proto:s}):Z(zS(xp(s))));return n.length===1?n[0]:t.$.node("union",{branches:n})},"===":(e,t)=>t.$.units(e.slice(1))}),_3=e=>MT[e[0]]!==void 0,zS=e=>`Expected a constructor following 'instanceof' operator (was ${e})`,C3=(e,t)=>{let n=[{}],s=0;for(;s<e.length;){let o=!1;e[s]==="..."&&s<e.length-1&&(o=!0,s++);const u=TT(e[s],t),[c,d,h]=Yt(u)?u:[u];if(s++,o){if(!c.extends(W.intrinsic.Array))return Z(N3(c.expression));n=n.flatMap(p=>c.distribute(y=>D3(hA(p),y)))}else n=n.map(p=>d==="?"?_T(p,c):d==="="?k3(p,c,h):jp(p,c))}return t.$.parseSchema(n.map(o=>ll(o)?{proto:Array,exactLength:0}:{proto:Array,sequence:o}))},jp=(e,t)=>e.defaultables||e.optionals?Z(e.variadic?XA:$3):(e.variadic?e.postfix=He(e.postfix,t):e.prefix=He(e.prefix,t),e),_T=(e,t)=>e.variadic?Z(CT):(e.optionals=He(e.optionals,t),e),k3=(e,t,n)=>e.variadic?Z(CT):e.optionals?Z(B3):(e.defaultables=He(e.defaultables,[[t,n]]),e),US=(e,t)=>(e.postfix&&Z(qS),e.variadic?e.variadic.equals(t)||Z(qS):e.variadic=t.internal,e),D3=(e,t)=>{const n=t.select({method:"find",kind:"sequence"});if(!n)return US(e,W.intrinsic.unknown);if(n.prefix)for(const s of n.prefix)jp(e,s);if(n.optionals)for(const s of n.optionals)_T(e,s);if(n.variadic&&US(e,n.variadic),n.postfix)for(const s of n.postfix)jp(e,s);return e},N3=e=>`Spread element must be an array (was ${e})`,qS="A tuple may have at most one variadic element",$3="A required element may not follow an optional element",CT="An optional element may not follow a variadic element",B3="A defaultable element may not follow an optional element without a default",Kh={},kT=(e,t)=>{var n;if(typeof e=="string"){if(t.args&&Object.keys(t.args).some(o=>e.includes(o)))return LS(e,t);const s=Kh[n=t.$.name]??(Kh[n]={});return s[e]??(s[e]=LS(e,t))}return fr(e,"object")?L3(e,t):Z(zp(Gn(e)))},L3=(e,t)=>{const n=Nm(e);switch(n){case void 0:return ce(e,"root")?e:p3(e,t);case"Array":return V3(e,t);case"RegExp":return t.$.node("intersection",{domain:"string",pattern:e},{prereduced:!0});case"Function":{const s=Fc(e)?e():e;return ce(s,"root")?s:Z(zp("Function"))}default:return Z(zp(n??Pe(e)))}},V3=(e,t)=>v3(e,t)??C3(e,t),zp=e=>`Type definitions must be strings or objects (was ${e})`;class j3 extends _o{constructor(t){const n=Object.assign({errors:xs,hkt:mi,$:t,raw:t.parse,module:t.constructor.module,scope:t.constructor.scope,define:t.define,match:t.match,generic:t.generic,schema:t.schema,keywords:t.ambient,unit:t.unit,enumerated:t.enumerated,instanceOf:t.instanceOf,valueOf:t.valueOf,or:t.or,and:t.and,merge:t.merge,pipe:t.pipe},t.ambientAttachments);super((...s)=>{if(s.length===1)return t.parse(s[0]);if(s.length===2&&typeof s[0]=="string"&&s[0][0]==="<"&&s[0].at(-1)===">"){const o=s[0].slice(1,-1),u=t.parseGenericParams(o,{});return new Ac(u,s[1],t,t,null)}return t.parse(s)},{bind:t,attach:n})}}const Ja=W,co=class co extends nT{constructor(){super(...arguments);x(this,"unit",n=>this.units([n]));x(this,"valueOf",n=>this.units(DD(n)));x(this,"enumerated",(...n)=>this.units(n));x(this,"instanceOf",n=>this.node("proto",{proto:n},{prereduced:!0}));x(this,"or",(...n)=>this.schema(n.map(s=>this.parse(s))));x(this,"and",(...n)=>n.reduce((s,o)=>s.and(this.parse(o)),this.intrinsic.unknown));x(this,"merge",(...n)=>n.reduce((s,o)=>s.merge(this.parse(o)),this.intrinsic.object));x(this,"pipe",(...n)=>this.intrinsic.unknown.pipe(...n));x(this,"match",new u3(this));x(this,"declare",()=>({type:this.type}));x(this,"type",new j3(this))}get ambientAttachments(){if(Ja.typeAttachments)return this.cacheGetter("ambientAttachments",Fe(Ja.typeAttachments,(n,s)=>[n,this.bindReference(s)]))}preparseOwnAliasEntry(n,s){var d;const o=n.indexOf("<");if(o===-1){if(ce(s,"module")||ce(s,"generic"))return[n,s];const h=this.name==="ark"?n:n==="root"?this.name:`${this.name}.${n}`,p=(d=this.resolvedConfig.keywords)==null?void 0:d[h];return p&&(s=[s,"@",p]),[n,s]}n.at(-1)!==">"&&Z("'>' must be the last character of a generic declaration in a scope");const u=n.slice(0,o),c=n.slice(o+1,-1);return[u,()=>{const h=this.parseGenericParams(c,{alias:u});return LN(h,s,this)}]}parseGenericParams(n,s){return Vp(new Za(n),[],this.createParseContext({...s,def:n,prefix:"generic"}))}normalizeRootScopeValue(n){return Fc(n)&&!ce(n,"generic")?n():n}preparseOwnDefinitionFormat(n,s){return{...s,def:n,prefix:s.alias??"type"}}parseOwnDefinitionFormat(n,s){!(s.alias&&s.alias in this.aliases)&&!s.args&&(s.args={this:s.id});const u=kT(n,s);if(Yt(u)){if(u[1]==="=")return Z(mT);if(u[1]==="?")return Z(pT)}return u}define(n){return n}};x(co,"scope",(n,s={})=>new co(n,s)),x(co,"module",(n,s={})=>co.scope(n,s).export());let Rc=co;const z3=Object.assign(Rc.scope,{define:e=>e}),Ve=Rc;class U3 extends mi{constructor(){super(...arguments);x(this,"description",'merge an object\'s properties onto another like `Merge(User, { isAdmin: "true" })`')}}const q3=Ii(["base",pe.object],["props",pe.object])(e=>e.base.merge(e.props),U3),K3=Ve.module({Key:pe.key,Merge:q3});class P3 extends mi{}const I3=Ii("element")(e=>{const t=e.element.exclude(pe.Array),n=t.array();return t.rawOr(n).pipe(al).distribute(s=>s.assertHasKind("morph").declareOut(n),Xe)},P3),H3=Ve.module({root:pe.Array,readonly:"root",index:pe.nonNegativeIntegerString,liftFrom:I3},{name:"Array"}),Up=Xe(["string",ul.FileConstructor]),F3=Up.rawOr(Up.array()),KS=Xe({meta:"an object representing parsed form data",domain:"object",index:{signature:"string",value:F3}}),G3=Ve.module({root:["instanceof",FormData],value:Up,parsed:KS,parse:Xe({in:FormData,morphs:e=>{const t={};for(const[n,s]of e)if(n in t){const o=t[n];typeof o=="string"||o instanceof ul.FileConstructor?t[n]=[o,s]:o.push(s)}else t[n]=s;return t},declaredOut:KS})},{name:"FormData"}),Y3=Ve.module({Int8:["instanceof",Int8Array],Uint8:["instanceof",Uint8Array],Uint8Clamped:["instanceof",Uint8ClampedArray],Int16:["instanceof",Int16Array],Uint16:["instanceof",Uint16Array],Int32:["instanceof",Int32Array],Uint32:["instanceof",Uint32Array],Float32:["instanceof",Float32Array],Float64:["instanceof",Float64Array],BigInt64:["instanceof",BigInt64Array],BigUint64:["instanceof",BigUint64Array]},{name:"TypedArray"}),X3={Boolean:1,Number:1,String:1},Z3=Ve.module({...Fe({...Qx,...eA},(e,t)=>e in X3?[]:[e,["instanceof",t]]),Array:H3,TypedArray:Y3,FormData:G3}),J3=Xe({domain:{domain:"number",meta:"a number representing a Unix timestamp"},divisor:{rule:1,meta:"an integer representing a Unix timestamp"},min:{rule:-864e13,meta:"a Unix timestamp after -8640000000000000"},max:{rule:864e13,meta:"a Unix timestamp before 8640000000000000"},meta:"an integer representing a safe Unix timestamp"}),Q3=Xe({domain:"number",divisor:1}),DT=Ve.module({root:pe.number,integer:Q3,epoch:J3,safe:Xe({domain:{domain:"number",numberAllowsNaN:!1},min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER}),NaN:["===",Number.NaN],Infinity:["===",Number.POSITIVE_INFINITY],NegativeInfinity:["===",Number.NEGATIVE_INFINITY]},{name:"number"}),Qe=(e,t,n)=>{const s={domain:"string",pattern:{rule:e.source,flags:e.flags,meta:t}};return n&&(s.meta={format:n}),Gm("intersection",s)},PS=Qe(bc,"a well-formed integer string"),NT=Ve.module({root:PS,parse:Xe({in:PS,morphs:(e,t)=>{const n=Number.parseInt(e);return Number.isSafeInteger(n)?n:t.error("an integer in the range Number.MIN_SAFE_INTEGER to Number.MAX_SAFE_INTEGER")},declaredOut:pe.integer})},{name:"string.integer"}),W3=Qe(/^[\dA-Fa-f]+$/,"hex characters only"),eB=Ve.module({root:Qe(/^(?:[\d+/A-Za-z]{4})*(?:[\d+/A-Za-z]{2}==|[\d+/A-Za-z]{3}=)?$/,"base64-encoded"),url:Qe(/^(?:[\w-]{4})*(?:[\w-]{2}(?:==|%3D%3D)?|[\w-]{3}(?:=|%3D)?)?$/,"base64url-encoded")},{name:"string.base64"}),IS=Qe(/^[A-Z].*$/,"capitalized"),tB=Ve.module({root:Xe({in:"string",morphs:e=>e.charAt(0).toUpperCase()+e.slice(1),declaredOut:IS}),preformatted:IS},{name:"string.capitalize"}),nB=e=>{const t=e.replaceAll(/[ -]+/g,"");let n=0,s,o,u=!1;for(let c=t.length-1;c>=0;c--)s=t.substring(c,c+1),o=Number.parseInt(s,10),u?(o*=2,n+=o>=10?o%10+1:o):n+=o,u=!u;return!!(n%10===0&&t)},iB=/^(?:4\d{12}(?:\d{3,6})?|5[1-5]\d{14}|(222[1-9]|22[3-9]\d|2[3-6]\d{2}|27[01]\d|2720)\d{12}|6(?:011|5\d\d)\d{12,15}|3[47]\d{13}|3(?:0[0-5]|[68]\d)\d{11}|(?:2131|1800|35\d{3})\d{11}|6[27]\d{14}|^(81\d{14,17}))$/,sB=Xe({domain:"string",pattern:{meta:"a credit card number",rule:iB.source},predicate:{meta:"a credit card number",predicate:nB}}),rB=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-3])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))(T((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([,.]\d+(?!:))?)?(\17[0-5]\d([,.]\d+)?)?([Zz]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/,oB=e=>!Number.isNaN(new Date(e).valueOf()),HS=Xe({domain:"string",predicate:{meta:"a parsable date",predicate:oB}}).assertHasKind("intersection"),FS=NT.root.internal.narrow((e,t)=>{const n=Number.parseInt(e),s=DT.epoch(n);return s instanceof xs?(t.errors.merge(s),!1):!0}).configure({description:"an integer string representing a safe Unix timestamp"},"self").assertHasKind("intersection"),aB=Ve.module({root:FS,parse:Xe({in:FS,morphs:e=>new Date(e),declaredOut:pe.Date})},{name:"string.date.epoch"}),GS=Qe(rB,"an ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ) date").internal.assertHasKind("intersection"),lB=Ve.module({root:GS,parse:Xe({in:GS,morphs:e=>new Date(e),declaredOut:pe.Date})},{name:"string.date.iso"}),uB=Ve.module({root:HS,parse:Xe({declaredIn:HS,in:"string",morphs:(e,t)=>{const n=new Date(e);return Number.isNaN(n.valueOf())?t.error("a parsable date"):n},declaredOut:pe.Date}),iso:lB,epoch:aB},{name:"string.date"}),cB=Qe(/^[\w%+.-]+@[\d.A-Za-z-]+\.[A-Za-z]{2,}$/,"an email address","email"),YS="(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])",ys=`(${YS}[.]){3}${YS}`,fB=new RegExp(`^${ys}$`),gt="(?:[0-9a-fA-F]{1,4})",dB=new RegExp(`^((?:${gt}:){7}(?:${gt}|:)|(?:${gt}:){6}(?:${ys}|:${gt}|:)|(?:${gt}:){5}(?::${ys}|(:${gt}){1,2}|:)|(?:${gt}:){4}(?:(:${gt}){0,1}:${ys}|(:${gt}){1,3}|:)|(?:${gt}:){3}(?:(:${gt}){0,2}:${ys}|(:${gt}){1,4}|:)|(?:${gt}:){2}(?:(:${gt}){0,3}:${ys}|(:${gt}){1,5}|:)|(?:${gt}:){1}(?:(:${gt}){0,4}:${ys}|(:${gt}){1,6}|:)|(?::((?::${gt}){0,5}:${ys}|(?::${gt}){1,7}|:)))(%[0-9a-zA-Z.]{1,})?$`),hB=Ve.module({root:["v4 | v6","@","an IP address"],v4:Qe(fB,"an IPv4 address","ipv4"),v6:Qe(dB,"an IPv6 address","ipv6")},{name:"string.ip"}),po="a JSON string",$T=e=>{if(!(e instanceof SyntaxError))throw e;return`must be ${po} (${e})`},pB=Xe({meta:po,domain:"string",predicate:{meta:po,predicate:(e,t)=>{try{return JSON.parse(e),!0}catch(n){return t.reject({code:"predicate",expected:po,problem:$T(n)})}}}}),mB=(e,t)=>{if(e.length===0)return t.error({code:"predicate",expected:po,actual:"empty"});try{return JSON.parse(e)}catch(n){return t.error({code:"predicate",expected:po,problem:$T(n)})}},yB=Ve.module({root:pB,parse:Xe({meta:"safe JSON string parser",in:"string",morphs:mB,declaredOut:pe.jsonObject})},{name:"string.json"}),XS=Qe(/^[a-z]*$/,"only lowercase letters"),gB=Ve.module({root:Xe({in:"string",morphs:e=>e.toLowerCase(),declaredOut:XS}),preformatted:XS},{name:"string.lower"}),BT=["NFC","NFD","NFKC","NFKD"],yl=Fe(BT,(e,t)=>[t,Xe({domain:"string",predicate:n=>n.normalize(t)===n,meta:`${t}-normalized unicode`})]),ef=Fe(BT,(e,t)=>[t,Xe({in:"string",morphs:n=>n.normalize(t),declaredOut:yl[t]})]),bB=Ve.module({root:ef.NFC,preformatted:yl.NFC},{name:"string.normalize.NFC"}),vB=Ve.module({root:ef.NFD,preformatted:yl.NFD},{name:"string.normalize.NFD"}),SB=Ve.module({root:ef.NFKC,preformatted:yl.NFKC},{name:"string.normalize.NFKC"}),wB=Ve.module({root:ef.NFKD,preformatted:yl.NFKD},{name:"string.normalize.NFKD"}),xB=Ve.module({root:"NFC",NFC:bB,NFD:vB,NFKC:SB,NFKD:wB},{name:"string.normalize"}),ZS=Qe(Tp,"a well-formed numeric string"),AB=Ve.module({root:ZS,parse:Xe({in:ZS,morphs:e=>Number.parseFloat(e),declaredOut:pe.number})},{name:"string.numeric"}),JS="a regex pattern",TB=Xe({domain:"string",predicate:{meta:JS,predicate:(e,t)=>{try{return new RegExp(e),!0}catch(n){return t.reject({code:"predicate",expected:JS,problem:String(n)})}}},meta:{format:"regex"}}),EB=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][\dA-Za-z-]*))*))?(?:\+([\dA-Za-z-]+(?:\.[\dA-Za-z-]+)*))?$/,RB=Qe(EB,"a semantic version (see https://semver.org/)"),QS=Qe(/^\S.*\S$|^\S?$/,"trimmed"),OB=Ve.module({root:Xe({in:"string",morphs:e=>e.trim(),declaredOut:QS}),preformatted:QS},{name:"string.trim"}),WS=Qe(/^[A-Z]*$/,"only uppercase letters"),MB=Ve.module({root:Xe({in:"string",morphs:e=>e.toUpperCase(),declaredOut:WS}),preformatted:WS},{name:"string.upper"}),_B=e=>{if(URL.canParse)return URL.canParse(e);try{return new URL(e),!0}catch{return!1}},e1=Xe({domain:"string",predicate:{meta:"a URL string",predicate:_B},meta:{format:"uri"}}),CB=Ve.module({root:e1,parse:Xe({declaredIn:e1,in:"string",morphs:(e,t)=>{try{return new URL(e)}catch{return t.error("a URL string")}},declaredOut:Xe(URL)})},{name:"string.url"}),kB=Ve.module({root:["versioned | nil | max","@",{description:"a UUID",format:"uuid"}],"#nil":"'00000000-0000-0000-0000-000000000000'","#max":"'ffffffff-ffff-ffff-ffff-ffffffffffff'","#versioned":/[\da-f]{8}-[\da-f]{4}-[1-8][\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}/i,v1:Qe(/^[\da-f]{8}-[\da-f]{4}-1[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv1"),v2:Qe(/^[\da-f]{8}-[\da-f]{4}-2[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv2"),v3:Qe(/^[\da-f]{8}-[\da-f]{4}-3[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv3"),v4:Qe(/^[\da-f]{8}-[\da-f]{4}-4[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv4"),v5:Qe(/^[\da-f]{8}-[\da-f]{4}-5[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv5"),v6:Qe(/^[\da-f]{8}-[\da-f]{4}-6[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv6"),v7:Qe(/^[\da-f]{8}-[\da-f]{4}-7[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv7"),v8:Qe(/^[\da-f]{8}-[\da-f]{4}-8[\da-f]{3}-[89ab][\da-f]{3}-[\da-f]{12}$/i,"a UUIDv8")},{name:"string.uuid"}),DB=Ve.module({root:pe.string,alpha:Qe(/^[A-Za-z]*$/,"only letters"),alphanumeric:Qe(/^[\dA-Za-z]*$/,"only letters and digits 0-9"),hex:W3,base64:eB,capitalize:tB,creditCard:sB,date:uB,digits:Qe(/^\d*$/,"only digits 0-9"),email:cB,integer:NT,ip:hB,json:yB,lower:gB,normalize:xB,numeric:AB,regex:TB,semver:RB,trim:OB,upper:MB,url:CB,uuid:kB},{name:"string"}),NB=Ve.module({bigint:pe.bigint,boolean:pe.boolean,false:pe.false,never:pe.never,null:pe.null,number:pe.number,object:pe.object,string:pe.string,symbol:pe.symbol,true:pe.true,unknown:pe.unknown,undefined:pe.undefined}),$B=Ve.module({root:pe.unknown,any:pe.unknown},{name:"unknown"}),BB=Ve.module({root:pe.jsonObject,stringify:Gm("morph",{in:pe.jsonObject,morphs:e=>JSON.stringify(e),declaredOut:pe.string})},{name:"object.json"}),LB=Ve.module({root:pe.object,json:BB},{name:"object"});class VB extends mi{constructor(){super(...arguments);x(this,"description",'instantiate an object from an index signature and corresponding value type like `Record("string", "number")`')}}const jB=Ii(["K",pe.key],"V")(e=>({domain:"object",index:{signature:e.K,value:e.V}}),VB);class zB extends mi{constructor(){super(...arguments);x(this,"description",'pick a set of properties from an object like `Pick(User, "name | age")`')}}const UB=Ii(["T",pe.object],["K",pe.key])(e=>e.T.pick(e.K),zB);class qB extends mi{constructor(){super(...arguments);x(this,"description",'omit a set of properties from an object like `Omit(User, "age")`')}}const KB=Ii(["T",pe.object],["K",pe.key])(e=>e.T.omit(e.K),qB);class PB extends mi{constructor(){super(...arguments);x(this,"description","make all named properties of an object optional like `Partial(User)`")}}const IB=Ii(["T",pe.object])(e=>e.T.partial(),PB);class HB extends mi{constructor(){super(...arguments);x(this,"description","make all named properties of an object required like `Required(User)`")}}const FB=Ii(["T",pe.object])(e=>e.T.required(),HB);class GB extends mi{constructor(){super(...arguments);x(this,"description",'exclude branches of a union like `Exclude("boolean", "true")`')}}const YB=Ii("T","U")(e=>e.T.exclude(e.U),GB);class XB extends mi{constructor(){super(...arguments);x(this,"description",'extract branches of a union like `Extract("0 | false | 1", "number")`')}}const ZB=Ii("T","U")(e=>e.T.extract(e.U),XB),JB=Ve.module({Exclude:YB,Extract:ZB,Omit:KB,Partial:IB,Pick:UB,Record:jB,Required:FB}),dr=z3({...NB,...JB,...Z3,...K3,string:DB,number:DT,object:LB,unknown:$B},{prereducedAliases:!0,name:"ark"}),Bt=dr.export();Object.assign(Ja.ambient,Bt);Ja.typeAttachments={string:Bt.string.root,number:Bt.number.root,bigint:Bt.bigint,boolean:Bt.boolean,symbol:Bt.symbol,undefined:Bt.undefined,null:Bt.null,object:Bt.object.root,unknown:Bt.unknown.root,false:Bt.false,true:Bt.true,never:Bt.never,arrayIndex:Bt.Array.index,Key:Bt.Key,Record:Bt.Record,Array:Bt.Array.root,Date:Bt.Date};const vt=Object.assign(dr.type,Ja.typeAttachments);dr.match;dr.generic;dr.schema;dr.define;dr.declare;const LT={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"'};function QB(e){return Number.parseInt(e,10)}const WB=vt(LT),eL=WB.keyof().pipe(e=>QB(e));vt([eL,"string"]);function tL(e){return Y.jsxs("svg",{id:"uuid-3d2d6be6-f179-42a3-9511-1e9ddeb8575f",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 500 101",...e,children:[Y.jsx("title",{children:"Tempest Games Logo"}),Y.jsx("path",{d:"M155.76.93v59.89h-17.11V7.78h-13.69V.93h30.8Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.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}}),Y.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}}),Y.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}}),Y.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}}),Y.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}}),Y.jsx("path",{d:"M500,7.78h-13.69v53.04h-17.11V.93h30.8v6.84Z",style:{fill:"var(--logo-color)",strokeWidth:0}}),Y.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}}),Y.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}}),Y.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}}),Y.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}}),Y.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}}),Y.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 VT(e){return Y.jsx("a",{...e})}const nL={class:"_class_1riwg_1"},Ph=["โ ‹","โ ™","โ ธ","โ ด","โ ฆ","โ ‡"];function iL({input:e}){const t=V.useRef(null),[n,s]=V.useState(typeof e=="string"?e:null);return V.useEffect(()=>{let o=!0,u;if(typeof e=="string")s(e);else{let c=0;u=setInterval(()=>{t.current&&(t.current.textContent=Ph[c],c=(c+1)%Ph.length)},100),e.then(d=>{o&&(clearInterval(u),s(d))})}return()=>{o=!1,u&&clearInterval(u)}},[e]),Y.jsx("span",{ref:t,children:n??Ph[0]})}function tf(e){const t={subscribe(n){let s=null,o=!1,u=!1,c=!1;function d(){if(s===null){c=!0;return}u||(u=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=e({next(h){var p;o||(p=n.next)==null||p.call(n,h)},error(h){var p;o||(o=!0,(p=n.error)==null||p.call(n,h),d())},complete(){var h;o||(o=!0,(h=n.complete)==null||h.call(n),d())}}),c&&d(),{unsubscribe:d}},pipe(...n){return n.reduce(sL,t)}};return t}function sL(e,t){return t(e)}function rL(e){const t=new AbortController;return new Promise((s,o)=>{let u=!1;function c(){u||(u=!0,d.unsubscribe())}t.signal.addEventListener("abort",()=>{o(t.signal.reason)});const d=e.subscribe({next(h){u=!0,s(h),c()},error(h){o(h)},complete(){t.abort(),c()}})})}function oL(e){return t=>{let n=0,s=null;const o=[];function u(){s||(s=t.subscribe({next(d){var h;for(const p of o)(h=p.next)==null||h.call(p,d)},error(d){var h;for(const p of o)(h=p.error)==null||h.call(p,d)},complete(){var d;for(const h of o)(d=h.complete)==null||d.call(h)}}))}function c(){if(n===0&&s){const d=s;s=null,d.unsubscribe()}}return tf(d=>(n++,o.push(d),u(),{unsubscribe(){n--,c();const h=o.findIndex(p=>p===d);h>-1&&o.splice(h,1)}}))}}function aL(e){let t=e;const n=[],s=c=>{t!==void 0&&c.next(t),n.push(c)},o=c=>{n.splice(n.indexOf(c),1)},u=tf(c=>(s(c),()=>{o(c)}));return u.next=c=>{if(t!==c){t=c;for(const d of n)d.next(c)}},u.get=()=>t,u}function lL(e){return tf(t=>{function n(o=0,u=e.op){const c=e.links[o];if(!c)throw new Error("No more links to execute - did you forget to add an ending link?");return c({op:u,next(h){return n(o+1,h)}})}return n().subscribe(t)})}const jT=()=>{},t1=e=>{Object.freeze&&Object.freeze(e)};function zT(e,t,n){var s,o;const u=t.join(".");return(s=n)[o=u]??(s[o]=new Proxy(jT,{get(c,d){if(!(typeof d!="string"||d==="then"))return zT(e,[...t,d],n)},apply(c,d,h){const p=t[t.length-1];let y={args:h,path:t};return p==="call"?y={args:h.length>=2?[h[1]]:[],path:t.slice(0,-1)}:p==="apply"&&(y={args:h.length>=2?h[1]:[],path:t.slice(0,-1)}),t1(y.args),t1(y.path),e(y)}})),n[u]}const uL=e=>zT(e,[],Object.create(null)),cL=e=>new Proxy(jT,{get(t,n){if(n!=="then")return e(n)}});function Qa(e){return!!e&&!Array.isArray(e)&&typeof e=="object"}function fL(e,t){if("error"in e){const s=t.deserialize(e.error);return{ok:!1,error:{...e,error:s}}}return{ok:!0,result:{...e.result,...(!e.result.type||e.result.type==="data")&&{type:"data",data:t.deserialize(e.result.data)}}}}class Ih extends Error{constructor(){super("Unable to transform response from server")}}function dL(e,t){let n;try{n=fL(e,t)}catch{throw new Ih}if(!n.ok&&(!Qa(n.error.error)||typeof n.error.error.code!="number"))throw new Ih;if(n.ok&&!Qa(n.result))throw new Ih;return n}var n1,i1;(n1=Symbol).dispose??(n1.dispose=Symbol());(i1=Symbol).asyncDispose??(i1.asyncDispose=Symbol());var Pw,Iw,Hw,Fw,Gw,Yw;typeof window>"u"||"Deno"in window||((Iw=(Pw=globalThis.process)==null?void 0:Pw.env)==null?void 0:Iw.NODE_ENV)==="test"||(Fw=(Hw=globalThis.process)==null?void 0:Hw.env)!=null&&Fw.JEST_WORKER_ID||(Yw=(Gw=globalThis.process)==null?void 0:Gw.env)!=null&&Yw.VITEST_WORKER_ID;function Ku(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function hL(e){return e instanceof si||e instanceof Error&&e.name==="TRPCClientError"}function pL(e){return Qa(e)&&Qa(e.error)&&typeof e.error.code=="number"&&typeof e.error.message=="string"}function mL(e,t){return typeof e=="string"?e:Qa(e)&&typeof e.message=="string"?e.message:t}class si extends Error{static from(t,n={}){const s=t;return hL(s)?(n.meta&&(s.meta={...s.meta,...n.meta}),s):pL(s)?new si(s.error.message,{...n,result:s}):new si(mL(s,"Unknown error"),{...n,cause:s})}constructor(t,n){var o,u;const s=n==null?void 0:n.cause;super(t,{cause:s}),Ku(this,"cause",void 0),Ku(this,"shape",void 0),Ku(this,"data",void 0),Ku(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=s,this.shape=(o=n==null?void 0:n.result)==null?void 0:o.error,this.data=(u=n==null?void 0:n.result)==null?void 0:u.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,si.prototype)}}function Hh(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class yL{$request(t){return lL({links:this.links,op:{...t,context:t.context??{},id:++this.requestId}}).pipe(oL())}async requestAsPromise(t){try{const n=this.$request(t);return(await rL(n)).result.data}catch(n){throw si.from(n)}}query(t,n,s){return this.requestAsPromise({type:"query",path:t,input:n,context:s==null?void 0:s.context,signal:s==null?void 0:s.signal})}mutation(t,n,s){return this.requestAsPromise({type:"mutation",path:t,input:n,context:s==null?void 0:s.context,signal:s==null?void 0:s.signal})}subscription(t,n,s){return this.$request({type:"subscription",path:t,input:n,context:s.context,signal:s.signal}).subscribe({next(u){var c,d,h,p;switch(u.result.type){case"state":{(c=s.onConnectionStateChange)==null||c.call(s,u.result);break}case"started":{(d=s.onStarted)==null||d.call(s,{context:u.context});break}case"stopped":{(h=s.onStopped)==null||h.call(s);break}case"data":case void 0:{(p=s.onData)==null||p.call(s,u.result.data);break}}},error(u){var c;(c=s.onError)==null||c.call(s,u)},complete(){var u;(u=s.onComplete)==null||u.call(s)}})}constructor(t){Hh(this,"links",void 0),Hh(this,"runtime",void 0),Hh(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(n=>n(this.runtime))}}const gL=Symbol.for("trpc_untypedClient"),bL={query:"query",mutate:"mutation",subscribe:"subscription"},vL=e=>bL[e];function SL(e){const t=uL(({path:n,args:s})=>{const o=[...n],u=vL(o.pop()),c=o.join(".");return e[u](c,...s)});return cL(n=>n===gL?e:t[n])}function wL(e){const t=new yL(e);return SL(t)}const s1=e=>typeof e=="function";function xL(e){if(e)return e;if(typeof window<"u"&&s1(window.fetch))return window.fetch;if(typeof globalThis<"u"&&s1(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}const r1=()=>{throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new")};function o1(e){let t=null,n=null;const s=()=>{clearTimeout(n),n=null,t=null};function o(d){var y,g;const h=[[]];let p=0;for(;;){const v=d[p];if(!v)break;const S=h[h.length-1];if(v.aborted){(y=v.reject)==null||y.call(v,new Error("Aborted")),p++;continue}if(e.validate(S.concat(v).map(E=>E.key))){S.push(v),p++;continue}if(S.length===0){(g=v.reject)==null||g.call(v,new Error("Input is too big for a single dispatch")),p++;continue}h.push([])}return h}function u(){const d=o(t);s();for(const h of d){if(!h.length)continue;const p={items:h};for(const g of h)g.batch=p;e.fetch(p.items.map(g=>g.key)).then(async g=>{var v;await Promise.all(g.map(async(S,A)=>{var _,D;const E=p.items[A];try{const $=await Promise.resolve(S);(_=E.resolve)==null||_.call(E,$)}catch($){(D=E.reject)==null||D.call(E,$)}E.batch=null,E.reject=null,E.resolve=null}));for(const S of p.items)(v=S.reject)==null||v.call(S,new Error("Missing result")),S.batch=null}).catch(g=>{var v;for(const S of p.items)(v=S.reject)==null||v.call(S,g),S.batch=null})}}function c(d){const h={aborted:!1,key:d,batch:null,resolve:r1,reject:r1},p=new Promise((y,g)=>{h.reject=g,h.resolve=y,t??(t=[]),t.push(h)});return n??(n=setTimeout(u)),p}return{load:c}}function AL(...e){const t=new AbortController,n=e.length;let s=0;const o=()=>{++s===n&&t.abort()};for(const u of e)u!=null&&u.aborted?o():u==null||u.addEventListener("abort",o,{once:!0});return t.signal}function TL(e){const t=e;return t?"input"in t?t:{input:t,output:t}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}function EL(e){return{url:e.url.toString(),fetch:e.fetch,transformer:TL(e.transformer),methodOverride:e.methodOverride}}function RL(e){const t={};for(let n=0;n<e.length;n++){const s=e[n];t[n]=s}return t}const OL={query:"GET",mutation:"POST",subscription:"PATCH"};function UT(e){return"input"in e?e.transformer.input.serialize(e.input):RL(e.inputs.map(t=>e.transformer.input.serialize(t)))}const qT=e=>{const t=e.url.split("?");let s=t[0].replace(/\/$/,"")+"/"+e.path;const o=[];if(t[1]&&o.push(t[1]),"inputs"in e&&o.push("batch=1"),e.type==="query"||e.type==="subscription"){const u=UT(e);u!==void 0&&e.methodOverride!=="POST"&&o.push(`input=${encodeURIComponent(JSON.stringify(u))}`)}return o.length&&(s+="?"+o.join("&")),s},ML=e=>{if(e.type==="query"&&e.methodOverride!=="POST")return;const t=UT(e);return t!==void 0?JSON.stringify(t):void 0},_L=e=>NL({...e,contentTypeHeader:"application/json",getUrl:qT,getBody:ML});class CL extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}}const kL=e=>{var t;if(e!=null&&e.aborted)throw(t=e.throwIfAborted)==null||t.call(e),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new CL};async function DL(e){kL(e.signal);const t=e.getUrl(e),n=e.getBody(e),{type:s}=e,o=await(async()=>{const c=await e.headers();return Symbol.iterator in c?Object.fromEntries(c):c})(),u={...e.contentTypeHeader?{"content-type":e.contentTypeHeader}:{},...e.trpcAcceptHeader?{"trpc-accept":e.trpcAcceptHeader}:void 0,...o};return xL(e.fetch)(t,{method:e.methodOverride??OL[s],signal:e.signal,body:n,headers:u})}async function NL(e){const t={},n=await DL(e);t.response=n;const s=await n.json();return t.responseJSON=s,{json:s,meta:t}}function $L(e){const t=EL(e),n=e.maxURLLength??1/0,s=e.maxItems??1/0;return()=>{const o=h=>({validate(p){if(n===1/0&&s===1/0)return!0;if(p.length>s)return!1;const y=p.map(S=>S.path).join(","),g=p.map(S=>S.input);return qT({...t,type:h,path:y,inputs:g,signal:null}).length<=n},async fetch(p){const y=p.map(_=>_.path).join(","),g=p.map(_=>_.input),v=AL(...p.map(_=>_.signal)),S=await _L({...t,path:y,inputs:g,type:h,headers(){return e.headers?typeof e.headers=="function"?e.headers({opList:p}):e.headers:{}},signal:v});return(Array.isArray(S.json)?S.json:p.map(()=>S.json)).map(_=>({meta:S.meta,json:_}))}}),u=o1(o("query")),c=o1(o("mutation")),d={query:u,mutation:c};return({op:h})=>tf(p=>{/* istanbul ignore if -- @preserve */if(h.type==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const g=d[h.type].load(h);let v;return g.then(S=>{v=S;const A=dL(S.json,t.transformer.output);if(!A.ok){p.error(si.from(A.error,{meta:S.meta}));return}p.next({context:S.meta,result:A.result}),p.complete()}).catch(S=>{p.error(si.from(S,{meta:v==null?void 0:v.meta}))}),()=>{}})}}const KT=(e,...t)=>typeof e=="function"?e(...t):e;function BL(){let e,t;return{promise:new Promise((s,o)=>{e=s,t=o}),resolve:e,reject:t}}async function LL(e){const t=await KT(e.url);if(!e.connectionParams)return t;const s=`${t.includes("?")?"&":"?"}connectionParams=1`;return t+s}async function VL(e){const t={method:"connectionParams",data:await KT(e)};return JSON.stringify(t)}function Xs(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function jL(e){const{promise:t,resolve:n,reject:s}=BL();return e.addEventListener("open",()=>{e.removeEventListener("error",s),n()}),e.addEventListener("error",s),t}function zL(e,{intervalMs:t,pongTimeoutMs:n}){let s,o;function u(){s=setTimeout(()=>{e.send("PING"),o=setTimeout(()=>{e.close()},n)},t)}function c(){clearTimeout(s),u()}function d(){clearTimeout(o),c()}e.addEventListener("open",u),e.addEventListener("message",({data:h})=>{clearTimeout(s),u(),h==="PONG"&&d()}),e.addEventListener("close",()=>{clearTimeout(s),clearTimeout(o)})}class Oc{get ws(){return this.wsObservable.get()}set ws(t){this.wsObservable.next(t)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){if(this.openPromise)return this.openPromise;this.id=++Oc.connectCount;const t=LL(this.urlOptions).then(n=>new this.WebSocketPonyfill(n));this.openPromise=t.then(async n=>{this.ws=n,n.addEventListener("message",function({data:s}){s==="PING"&&this.send("PONG")}),this.keepAliveOpts.enabled&&zL(n,this.keepAliveOpts),n.addEventListener("close",()=>{this.ws===n&&(this.ws=null)}),await jL(n),this.urlOptions.connectionParams&&n.send(await VL(this.urlOptions.connectionParams))});try{await this.openPromise}finally{this.openPromise=null}}async close(){var t;try{await this.openPromise}finally{(t=this.ws)==null||t.close()}}constructor(t){if(Xs(this,"id",++Oc.connectCount),Xs(this,"WebSocketPonyfill",void 0),Xs(this,"urlOptions",void 0),Xs(this,"keepAliveOpts",void 0),Xs(this,"wsObservable",aL(null)),Xs(this,"openPromise",null),this.WebSocketPonyfill=t.WebSocketPonyfill??WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=t.urlOptions,this.keepAliveOpts=t.keepAlive}}Xs(Oc,"connectCount",0);var UL={};function PT(e,t){if(e instanceof Promise)throw new Error(t)}function qL(e,t){const n={},s=[];for(const o in e){const u=e[o]["~standard"].validate(t[o]);if(PT(u,`Validation must be synchronous, but ${o} returned a Promise.`),u.issues){s.push(...u.issues.map(c=>({...c,path:[o,...c.path??[]]})));continue}n[o]=u.value}return s.length?{issues:s}:{value:n}}function KL(e){var $;const t=e.runtimeEnvStrict??e.runtimeEnv??UL;if(e.emptyStringAsUndefined??!1)for(const[M,H]of Object.entries(t))H===""&&delete t[M];if(!!e.skipValidation)return t;const o=typeof e.client=="object"?e.client:{},u=typeof e.server=="object"?e.server:{},c=typeof e.shared=="object"?e.shared:{},d=e.isServer??(typeof window>"u"||"Deno"in window),h=d?{...u,...c,...o}:{...o,...c},p=(($=e.createFinalSchema)==null?void 0:$.call(e,h,d)["~standard"].validate(t))??qL(h,t);PT(p,"Validation must be synchronous");const y=e.onValidationError??(M=>{throw console.error("โŒ Invalid environment variables:",M),new Error("Invalid environment variables")}),g=e.onInvalidAccess??(()=>{throw new Error("โŒ Attempted to access a server-side environment variable on the client")});if(p.issues)return y(p.issues);const v=M=>e.clientPrefix?!M.startsWith(e.clientPrefix)&&!(M in c):!0,S=M=>d||!v(M),A=M=>M==="__esModule"||M==="$$typeof",E=(e.extends??[]).reduce((M,H)=>Object.assign(M,H),{}),_=Object.assign(E,p.value);return new Proxy(_,{get(M,H){if(typeof H=="string"&&!A(H))return S(H)?Reflect.get(M,H):g(H)}})}const PL={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_BACKEND_ORIGIN:"https://realtime.tempest.games"},IL="__vite_start_time"in globalThis,HL=typeof window<"u",ki=vt("string"),a1=vt('"true" | "false" | undefined'),IT=KL({isServer:!IL&&!HL,server:{CI:vt("string | undefined").pipe(Boolean),POSTGRES_USER:ki,POSTGRES_PASSWORD:ki,POSTGRES_DATABASE:ki,POSTGRES_HOST:ki,POSTGRES_PORT:ki.pipe(e=>Number.parseInt(e,10)),BACKEND_PORT:ki.pipe(e=>Number.parseInt(e,10)),RUN_WORKERS_FROM_SOURCE:a1.pipe(e=>e==="true"),FRONTEND_PORT:ki.pipe(e=>Number.parseInt(e,10)),FRONTEND_ORIGINS:ki.pipe.try(e=>JSON.parse(e),vt("string[]")),API_KEY_OPENAI:vt("string | undefined"),API_KEY_RESEND:vt("string | undefined")},clientPrefix:"VITE_",client:{VITE_BACKEND_ORIGIN:ki,VITE_DEV_FRONTEND_HOST:vt("string | undefined"),VITE_DEV_HTTPS:a1.pipe(e=>e==="true")},runtimeEnv:PL,emptyStringAsUndefined:!0}),FL="modulepreload",GL=function(e){return"/"+e},l1={},HT=function(t,n,s){let o=Promise.resolve();if(n&&n.length>0){let c=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),h=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=c(n.map(p=>{if(p=GL(p),p in l1)return;l1[p]=!0;const y=p.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const v=document.createElement("link");if(v.rel=y?"stylesheet":FL,y||(v.as="script"),v.crossOrigin="",v.href=p,h&&v.setAttribute("nonce",h),document.head.appendChild(v),y)return new Promise((S,A)=>{v.addEventListener("load",S),v.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${p}`)))})}))}function u(c){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=c,window.dispatchEvent(d),!d.defaultPrevented)throw c}return o.then(c=>{for(const d of c||[])d.status==="rejected"&&u(d.reason);return t().catch(u)})},ui=Object.create(null);ui.open="0";ui.close="1";ui.ping="2";ui.pong="3";ui.message="4";ui.upgrade="5";ui.noop="6";const Qu=Object.create(null);Object.keys(ui).forEach(e=>{Qu[ui[e]]=e});const qp={type:"error",data:"parser error"},FT=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",GT=typeof ArrayBuffer=="function",YT=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e&&e.buffer instanceof ArrayBuffer,Zm=({type:e,data:t},n,s)=>FT&&t instanceof Blob?n?s(t):u1(t,s):GT&&(t instanceof ArrayBuffer||YT(t))?n?s(t):u1(new Blob([t]),s):s(ui[e]+(t||"")),u1=(e,t)=>{const n=new FileReader;return n.onload=function(){const s=n.result.split(",")[1];t("b"+(s||""))},n.readAsDataURL(e)};function c1(e){return e instanceof Uint8Array?e:e instanceof ArrayBuffer?new Uint8Array(e):new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}let Fh;function YL(e,t){if(FT&&e.data instanceof Blob)return e.data.arrayBuffer().then(c1).then(t);if(GT&&(e.data instanceof ArrayBuffer||YT(e.data)))return t(c1(e.data));Zm(e,!1,n=>{Fh||(Fh=new TextEncoder),t(Fh.encode(n))})}const f1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",za=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let e=0;e<f1.length;e++)za[f1.charCodeAt(e)]=e;const XL=e=>{let t=e.length*.75,n=e.length,s,o=0,u,c,d,h;e[e.length-1]==="="&&(t--,e[e.length-2]==="="&&t--);const p=new ArrayBuffer(t),y=new Uint8Array(p);for(s=0;s<n;s+=4)u=za[e.charCodeAt(s)],c=za[e.charCodeAt(s+1)],d=za[e.charCodeAt(s+2)],h=za[e.charCodeAt(s+3)],y[o++]=u<<2|c>>4,y[o++]=(c&15)<<4|d>>2,y[o++]=(d&3)<<6|h&63;return p},ZL=typeof ArrayBuffer=="function",Jm=(e,t)=>{if(typeof e!="string")return{type:"message",data:XT(e,t)};const n=e.charAt(0);return n==="b"?{type:"message",data:JL(e.substring(1),t)}:Qu[n]?e.length>1?{type:Qu[n],data:e.substring(1)}:{type:Qu[n]}:qp},JL=(e,t)=>{if(ZL){const n=XL(e);return XT(n,t)}else return{base64:!0,data:e}},XT=(e,t)=>{switch(t){case"blob":return e instanceof Blob?e:new Blob([e]);case"arraybuffer":default:return e instanceof ArrayBuffer?e:e.buffer}},ZT="",QL=(e,t)=>{const n=e.length,s=new Array(n);let o=0;e.forEach((u,c)=>{Zm(u,!1,d=>{s[c]=d,++o===n&&t(s.join(ZT))})})},WL=(e,t)=>{const n=e.split(ZT),s=[];for(let o=0;o<n.length;o++){const u=Jm(n[o],t);if(s.push(u),u.type==="error")break}return s};function eV(){return new TransformStream({transform(e,t){YL(e,n=>{const s=n.length;let o;if(s<126)o=new Uint8Array(1),new DataView(o.buffer).setUint8(0,s);else if(s<65536){o=new Uint8Array(3);const u=new DataView(o.buffer);u.setUint8(0,126),u.setUint16(1,s)}else{o=new Uint8Array(9);const u=new DataView(o.buffer);u.setUint8(0,127),u.setBigUint64(1,BigInt(s))}e.data&&typeof e.data!="string"&&(o[0]|=128),t.enqueue(o),t.enqueue(n)})}})}let Gh;function Pu(e){return e.reduce((t,n)=>t+n.length,0)}function Iu(e,t){if(e[0].length===t)return e.shift();const n=new Uint8Array(t);let s=0;for(let o=0;o<t;o++)n[o]=e[0][s++],s===e[0].length&&(e.shift(),s=0);return e.length&&s<e[0].length&&(e[0]=e[0].slice(s)),n}function tV(e,t){Gh||(Gh=new TextDecoder);const n=[];let s=0,o=-1,u=!1;return new TransformStream({transform(c,d){for(n.push(c);;){if(s===0){if(Pu(n)<1)break;const h=Iu(n,1);u=(h[0]&128)===128,o=h[0]&127,o<126?s=3:o===126?s=1:s=2}else if(s===1){if(Pu(n)<2)break;const h=Iu(n,2);o=new DataView(h.buffer,h.byteOffset,h.length).getUint16(0),s=3}else if(s===2){if(Pu(n)<8)break;const h=Iu(n,8),p=new DataView(h.buffer,h.byteOffset,h.length),y=p.getUint32(0);if(y>Math.pow(2,21)-1){d.enqueue(qp);break}o=y*Math.pow(2,32)+p.getUint32(4),s=3}else{if(Pu(n)<o)break;const h=Iu(n,o);d.enqueue(Jm(u?h:Gh.decode(h),t)),s=0}if(o===0||o>e){d.enqueue(qp);break}}}})}const JT=4;function St(e){if(e)return nV(e)}function nV(e){for(var t in St.prototype)e[t]=St.prototype[t];return e}St.prototype.on=St.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this};St.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this};St.prototype.off=St.prototype.removeListener=St.prototype.removeAllListeners=St.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var n=this._callbacks["$"+e];if(!n)return this;if(arguments.length==1)return delete this._callbacks["$"+e],this;for(var s,o=0;o<n.length;o++)if(s=n[o],s===t||s.fn===t){n.splice(o,1);break}return n.length===0&&delete this._callbacks["$"+e],this};St.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),n=this._callbacks["$"+e],s=1;s<arguments.length;s++)t[s-1]=arguments[s];if(n){n=n.slice(0);for(var s=0,o=n.length;s<o;++s)n[s].apply(this,t)}return this};St.prototype.emitReserved=St.prototype.emit;St.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]};St.prototype.hasListeners=function(e){return!!this.listeners(e).length};const nf=typeof Promise=="function"&&typeof Promise.resolve=="function"?t=>Promise.resolve().then(t):(t,n)=>n(t,0),Bn=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),iV="arraybuffer";function QT(e,...t){return t.reduce((n,s)=>(e.hasOwnProperty(s)&&(n[s]=e[s]),n),{})}const sV=Bn.setTimeout,rV=Bn.clearTimeout;function sf(e,t){t.useNativeTimers?(e.setTimeoutFn=sV.bind(Bn),e.clearTimeoutFn=rV.bind(Bn)):(e.setTimeoutFn=Bn.setTimeout.bind(Bn),e.clearTimeoutFn=Bn.clearTimeout.bind(Bn))}const oV=1.33;function aV(e){return typeof e=="string"?lV(e):Math.ceil((e.byteLength||e.size)*oV)}function lV(e){let t=0,n=0;for(let s=0,o=e.length;s<o;s++)t=e.charCodeAt(s),t<128?n+=1:t<2048?n+=2:t<55296||t>=57344?n+=3:(s++,n+=4);return n}function WT(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function uV(e){let t="";for(let n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t}function cV(e){let t={},n=e.split("&");for(let s=0,o=n.length;s<o;s++){let u=n[s].split("=");t[decodeURIComponent(u[0])]=decodeURIComponent(u[1])}return t}class fV extends Error{constructor(t,n,s){super(t),this.description=n,this.context=s,this.type="TransportError"}}class Qm extends St{constructor(t){super(),this.writable=!1,sf(this,t),this.opts=t,this.query=t.query,this.socket=t.socket,this.supportsBinary=!t.forceBase64}onError(t,n,s){return super.emitReserved("error",new fV(t,n,s)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(t){this.readyState==="open"&&this.write(t)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(t){const n=Jm(t,this.socket.binaryType);this.onPacket(n)}onPacket(t){super.emitReserved("packet",t)}onClose(t){this.readyState="closed",super.emitReserved("close",t)}pause(t){}createUri(t,n={}){return t+"://"+this._hostname()+this._port()+this.opts.path+this._query(n)}_hostname(){const t=this.opts.hostname;return t.indexOf(":")===-1?t:"["+t+"]"}_port(){return this.opts.port&&(this.opts.secure&&+(this.opts.port!==443)||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(t){const n=uV(t);return n.length?"?"+n:""}}class dV extends Qm{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(t){this.readyState="pausing";const n=()=>{this.readyState="paused",t()};if(this._polling||!this.writable){let s=0;this._polling&&(s++,this.once("pollComplete",function(){--s||n()})),this.writable||(s++,this.once("drain",function(){--s||n()}))}else n()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(t){const n=s=>{if(this.readyState==="opening"&&s.type==="open"&&this.onOpen(),s.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(s)};WL(t,this.socket.binaryType).forEach(n),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const t=()=>{this.write([{type:"close"}])};this.readyState==="open"?t():this.once("open",t)}write(t){this.writable=!1,QL(t,n=>{this.doWrite(n,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const t=this.opts.secure?"https":"http",n=this.query||{};return this.opts.timestampRequests!==!1&&(n[this.opts.timestampParam]=WT()),!this.supportsBinary&&!n.sid&&(n.b64=1),this.createUri(t,n)}}let eE=!1;try{eE=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch{}const hV=eE;function pV(){}class mV extends dV{constructor(t){if(super(t),typeof location<"u"){const n=location.protocol==="https:";let s=location.port;s||(s=n?"443":"80"),this.xd=typeof location<"u"&&t.hostname!==location.hostname||s!==t.port}}doWrite(t,n){const s=this.request({method:"POST",data:t});s.on("success",n),s.on("error",(o,u)=>{this.onError("xhr post error",o,u)})}doPoll(){const t=this.request();t.on("data",this.onData.bind(this)),t.on("error",(n,s)=>{this.onError("xhr poll error",n,s)}),this.pollXhr=t}}let mo=class Wu extends St{constructor(t,n,s){super(),this.createRequest=t,sf(this,s),this._opts=s,this._method=s.method||"GET",this._uri=n,this._data=s.data!==void 0?s.data:null,this._create()}_create(){var t;const n=QT(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");n.xdomain=!!this._opts.xd;const s=this._xhr=this.createRequest(n);try{s.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){s.setDisableHeaderCheck&&s.setDisableHeaderCheck(!0);for(let o in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(o)&&s.setRequestHeader(o,this._opts.extraHeaders[o])}}catch{}if(this._method==="POST")try{s.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{s.setRequestHeader("Accept","*/*")}catch{}(t=this._opts.cookieJar)===null||t===void 0||t.addCookies(s),"withCredentials"in s&&(s.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(s.timeout=this._opts.requestTimeout),s.onreadystatechange=()=>{var o;s.readyState===3&&((o=this._opts.cookieJar)===null||o===void 0||o.parseCookies(s.getResponseHeader("set-cookie"))),s.readyState===4&&(s.status===200||s.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof s.status=="number"?s.status:0)},0))},s.send(this._data)}catch(o){this.setTimeoutFn(()=>{this._onError(o)},0);return}typeof document<"u"&&(this._index=Wu.requestsCount++,Wu.requests[this._index]=this)}_onError(t){this.emitReserved("error",t,this._xhr),this._cleanup(!0)}_cleanup(t){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=pV,t)try{this._xhr.abort()}catch{}typeof document<"u"&&delete Wu.requests[this._index],this._xhr=null}}_onLoad(){const t=this._xhr.responseText;t!==null&&(this.emitReserved("data",t),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};mo.requestsCount=0;mo.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",d1);else if(typeof addEventListener=="function"){const e="onpagehide"in Bn?"pagehide":"unload";addEventListener(e,d1,!1)}}function d1(){for(let e in mo.requests)mo.requests.hasOwnProperty(e)&&mo.requests[e].abort()}const yV=function(){const e=tE({xdomain:!1});return e&&e.responseType!==null}();class gV extends mV{constructor(t){super(t);const n=t&&t.forceBase64;this.supportsBinary=yV&&!n}request(t={}){return Object.assign(t,{xd:this.xd},this.opts),new mo(tE,this.uri(),t)}}function tE(e){const t=e.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!t||hV))return new XMLHttpRequest}catch{}if(!t)try{return new Bn[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const nE=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class bV extends Qm{get name(){return"websocket"}doOpen(){const t=this.uri(),n=this.opts.protocols,s=nE?{}:QT(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(s.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(t,n,s)}catch(o){return this.emitReserved("error",o)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=t=>this.onClose({description:"websocket connection closed",context:t}),this.ws.onmessage=t=>this.onData(t.data),this.ws.onerror=t=>this.onError("websocket error",t)}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],o=n===t.length-1;Zm(s,this.supportsBinary,u=>{try{this.doWrite(s,u)}catch{}o&&nf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const t=this.opts.secure?"wss":"ws",n=this.query||{};return this.opts.timestampRequests&&(n[this.opts.timestampParam]=WT()),this.supportsBinary||(n.b64=1),this.createUri(t,n)}}const Yh=Bn.WebSocket||Bn.MozWebSocket;class vV extends bV{createSocket(t,n,s){return nE?new Yh(t,n,s):n?new Yh(t,n):new Yh(t)}doWrite(t,n){this.ws.send(n)}}class SV extends Qm{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(t){return this.emitReserved("error",t)}this._transport.closed.then(()=>{this.onClose()}).catch(t=>{this.onError("webtransport error",t)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(t=>{const n=tV(Number.MAX_SAFE_INTEGER,this.socket.binaryType),s=t.readable.pipeThrough(n).getReader(),o=eV();o.readable.pipeTo(t.writable),this._writer=o.writable.getWriter();const u=()=>{s.read().then(({done:d,value:h})=>{d||(this.onPacket(h),u())}).catch(d=>{})};u();const c={type:"open"};this.query.sid&&(c.data=`{"sid":"${this.query.sid}"}`),this._writer.write(c).then(()=>this.onOpen())})})}write(t){this.writable=!1;for(let n=0;n<t.length;n++){const s=t[n],o=n===t.length-1;this._writer.write(s).then(()=>{o&&nf(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var t;(t=this._transport)===null||t===void 0||t.close()}}const wV={websocket:vV,webtransport:SV,polling:gV},xV=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,AV=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function Kp(e){if(e.length>8e3)throw"URI too long";const t=e,n=e.indexOf("["),s=e.indexOf("]");n!=-1&&s!=-1&&(e=e.substring(0,n)+e.substring(n,s).replace(/:/g,";")+e.substring(s,e.length));let o=xV.exec(e||""),u={},c=14;for(;c--;)u[AV[c]]=o[c]||"";return n!=-1&&s!=-1&&(u.source=t,u.host=u.host.substring(1,u.host.length-1).replace(/;/g,":"),u.authority=u.authority.replace("[","").replace("]","").replace(/;/g,":"),u.ipv6uri=!0),u.pathNames=TV(u,u.path),u.queryKey=EV(u,u.query),u}function TV(e,t){const n=/\/{2,9}/g,s=t.replace(n,"/").split("/");return(t.slice(0,1)=="/"||t.length===0)&&s.splice(0,1),t.slice(-1)=="/"&&s.splice(s.length-1,1),s}function EV(e,t){const n={};return t.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(s,o,u){o&&(n[o]=u)}),n}const Pp=typeof addEventListener=="function"&&typeof removeEventListener=="function",ec=[];Pp&&addEventListener("offline",()=>{ec.forEach(e=>e())},!1);class ws extends St{constructor(t,n){if(super(),this.binaryType=iV,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,t&&typeof t=="object"&&(n=t,t=null),t){const s=Kp(t);n.hostname=s.host,n.secure=s.protocol==="https"||s.protocol==="wss",n.port=s.port,s.query&&(n.query=s.query)}else n.host&&(n.hostname=Kp(n.host).host);sf(this,n),this.secure=n.secure!=null?n.secure:typeof location<"u"&&location.protocol==="https:",n.hostname&&!n.port&&(n.port=this.secure?"443":"80"),this.hostname=n.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=n.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},n.transports.forEach(s=>{const o=s.prototype.name;this.transports.push(o),this._transportsByName[o]=s}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},n),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=cV(this.opts.query)),Pp&&(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"})},ec.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(t){const n=Object.assign({},this.opts.query);n.EIO=JT,n.transport=t,this.id&&(n.sid=this.id);const s=Object.assign({},this.opts,{query:n,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[t]);return new this._transportsByName[t](s)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const t=this.opts.rememberUpgrade&&ws.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const n=this.createTransport(t);n.open(),this.setTransport(n)}setTransport(t){this.transport&&this.transport.removeAllListeners(),this.transport=t,t.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",n=>this._onClose("transport close",n))}onOpen(){this.readyState="open",ws.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(t){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",t),this.emitReserved("heartbeat"),t.type){case"open":this.onHandshake(JSON.parse(t.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const n=new Error("server error");n.code=t.data,this._onError(n);break;case"message":this.emitReserved("data",t.data),this.emitReserved("message",t.data);break}}onHandshake(t){this.emitReserved("handshake",t),this.id=t.sid,this.transport.query.sid=t.sid,this._pingInterval=t.pingInterval,this._pingTimeout=t.pingTimeout,this._maxPayload=t.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const t=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+t,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},t),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const t=this._getWritablePackets();this.transport.send(t),this._prevBufferLen=t.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let n=1;for(let s=0;s<this.writeBuffer.length;s++){const o=this.writeBuffer[s].data;if(o&&(n+=aV(o)),s>0&&n>this._maxPayload)return this.writeBuffer.slice(0,s);n+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const t=Date.now()>this._pingTimeoutTime;return t&&(this._pingTimeoutTime=0,nf(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),t}write(t,n,s){return this._sendPacket("message",t,n,s),this}send(t,n,s){return this._sendPacket("message",t,n,s),this}_sendPacket(t,n,s,o){if(typeof n=="function"&&(o=n,n=void 0),typeof s=="function"&&(o=s,s=null),this.readyState==="closing"||this.readyState==="closed")return;s=s||{},s.compress=s.compress!==!1;const u={type:t,data:n,options:s};this.emitReserved("packetCreate",u),this.writeBuffer.push(u),o&&this.once("flush",o),this.flush()}close(){const t=()=>{this._onClose("forced close"),this.transport.close()},n=()=>{this.off("upgrade",n),this.off("upgradeError",n),t()},s=()=>{this.once("upgrade",n),this.once("upgradeError",n)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?s():t()}):this.upgrading?s():t()),this}_onError(t){if(ws.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",t),this._onClose("transport error",t)}_onClose(t,n){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),Pp&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const s=ec.indexOf(this._offlineEventListener);s!==-1&&ec.splice(s,1)}this.readyState="closed",this.id=null,this.emitReserved("close",t,n),this.writeBuffer=[],this._prevBufferLen=0}}}ws.protocol=JT;class RV extends ws{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let t=0;t<this._upgrades.length;t++)this._probe(this._upgrades[t])}_probe(t){let n=this.createTransport(t),s=!1;ws.priorWebsocketSuccess=!1;const o=()=>{s||(n.send([{type:"ping",data:"probe"}]),n.once("packet",g=>{if(!s)if(g.type==="pong"&&g.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",n),!n)return;ws.priorWebsocketSuccess=n.name==="websocket",this.transport.pause(()=>{s||this.readyState!=="closed"&&(y(),this.setTransport(n),n.send([{type:"upgrade"}]),this.emitReserved("upgrade",n),n=null,this.upgrading=!1,this.flush())})}else{const v=new Error("probe error");v.transport=n.name,this.emitReserved("upgradeError",v)}}))};function u(){s||(s=!0,y(),n.close(),n=null)}const c=g=>{const v=new Error("probe error: "+g);v.transport=n.name,u(),this.emitReserved("upgradeError",v)};function d(){c("transport closed")}function h(){c("socket closed")}function p(g){n&&g.name!==n.name&&u()}const y=()=>{n.removeListener("open",o),n.removeListener("error",c),n.removeListener("close",d),this.off("close",h),this.off("upgrading",p)};n.once("open",o),n.once("error",c),n.once("close",d),this.once("close",h),this.once("upgrading",p),this._upgrades.indexOf("webtransport")!==-1&&t!=="webtransport"?this.setTimeoutFn(()=>{s||n.open()},200):n.open()}onHandshake(t){this._upgrades=this._filterUpgrades(t.upgrades),super.onHandshake(t)}_filterUpgrades(t){const n=[];for(let s=0;s<t.length;s++)~this.transports.indexOf(t[s])&&n.push(t[s]);return n}}let OV=class extends RV{constructor(t,n={}){const s=typeof t=="object"?t:n;(!s.transports||s.transports&&typeof s.transports[0]=="string")&&(s.transports=(s.transports||["polling","websocket","webtransport"]).map(o=>wV[o]).filter(o=>!!o)),super(t,s)}};function MV(e,t="",n){let s=e;n=n||typeof location<"u"&&location,e==null&&(e=n.protocol+"//"+n.host),typeof e=="string"&&(e.charAt(0)==="/"&&(e.charAt(1)==="/"?e=n.protocol+e:e=n.host+e),/^(https?|wss?):\/\//.test(e)||(typeof n<"u"?e=n.protocol+"//"+e:e="https://"+e),s=Kp(e)),s.port||(/^(http|ws)$/.test(s.protocol)?s.port="80":/^(http|ws)s$/.test(s.protocol)&&(s.port="443")),s.path=s.path||"/";const u=s.host.indexOf(":")!==-1?"["+s.host+"]":s.host;return s.id=s.protocol+"://"+u+":"+s.port+t,s.href=s.protocol+"://"+u+(n&&n.port===s.port?"":":"+s.port),s}const _V=typeof ArrayBuffer=="function",CV=e=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(e):e.buffer instanceof ArrayBuffer,iE=Object.prototype.toString,kV=typeof Blob=="function"||typeof Blob<"u"&&iE.call(Blob)==="[object BlobConstructor]",DV=typeof File=="function"||typeof File<"u"&&iE.call(File)==="[object FileConstructor]";function Wm(e){return _V&&(e instanceof ArrayBuffer||CV(e))||kV&&e instanceof Blob||DV&&e instanceof File}function tc(e,t){if(!e||typeof e!="object")return!1;if(Array.isArray(e)){for(let n=0,s=e.length;n<s;n++)if(tc(e[n]))return!0;return!1}if(Wm(e))return!0;if(e.toJSON&&typeof e.toJSON=="function"&&arguments.length===1)return tc(e.toJSON(),!0);for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&tc(e[n]))return!0;return!1}function NV(e){const t=[],n=e.data,s=e;return s.data=Ip(n,t),s.attachments=t.length,{packet:s,buffers:t}}function Ip(e,t){if(!e)return e;if(Wm(e)){const n={_placeholder:!0,num:t.length};return t.push(e),n}else if(Array.isArray(e)){const n=new Array(e.length);for(let s=0;s<e.length;s++)n[s]=Ip(e[s],t);return n}else if(typeof e=="object"&&!(e instanceof Date)){const n={};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(n[s]=Ip(e[s],t));return n}return e}function $V(e,t){return e.data=Hp(e.data,t),delete e.attachments,e}function Hp(e,t){if(!e)return e;if(e&&e._placeholder===!0){if(typeof e.num=="number"&&e.num>=0&&e.num<t.length)return t[e.num];throw new Error("illegal attachments")}else if(Array.isArray(e))for(let n=0;n<e.length;n++)e[n]=Hp(e[n],t);else if(typeof e=="object")for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=Hp(e[n],t));return e}const BV=["connect","connect_error","disconnect","disconnecting","newListener","removeListener"],LV=5;var _e;(function(e){e[e.CONNECT=0]="CONNECT",e[e.DISCONNECT=1]="DISCONNECT",e[e.EVENT=2]="EVENT",e[e.ACK=3]="ACK",e[e.CONNECT_ERROR=4]="CONNECT_ERROR",e[e.BINARY_EVENT=5]="BINARY_EVENT",e[e.BINARY_ACK=6]="BINARY_ACK"})(_e||(_e={}));class VV{constructor(t){this.replacer=t}encode(t){return(t.type===_e.EVENT||t.type===_e.ACK)&&tc(t)?this.encodeAsBinary({type:t.type===_e.EVENT?_e.BINARY_EVENT:_e.BINARY_ACK,nsp:t.nsp,data:t.data,id:t.id}):[this.encodeAsString(t)]}encodeAsString(t){let n=""+t.type;return(t.type===_e.BINARY_EVENT||t.type===_e.BINARY_ACK)&&(n+=t.attachments+"-"),t.nsp&&t.nsp!=="/"&&(n+=t.nsp+","),t.id!=null&&(n+=t.id),t.data!=null&&(n+=JSON.stringify(t.data,this.replacer)),n}encodeAsBinary(t){const n=NV(t),s=this.encodeAsString(n.packet),o=n.buffers;return o.unshift(s),o}}function h1(e){return Object.prototype.toString.call(e)==="[object Object]"}class ey extends St{constructor(t){super(),this.reviver=t}add(t){let n;if(typeof t=="string"){if(this.reconstructor)throw new Error("got plaintext data when reconstructing a packet");n=this.decodeString(t);const s=n.type===_e.BINARY_EVENT;s||n.type===_e.BINARY_ACK?(n.type=s?_e.EVENT:_e.ACK,this.reconstructor=new jV(n),n.attachments===0&&super.emitReserved("decoded",n)):super.emitReserved("decoded",n)}else if(Wm(t)||t.base64)if(this.reconstructor)n=this.reconstructor.takeBinaryData(t),n&&(this.reconstructor=null,super.emitReserved("decoded",n));else throw new Error("got binary data when not reconstructing a packet");else throw new Error("Unknown type: "+t)}decodeString(t){let n=0;const s={type:Number(t.charAt(0))};if(_e[s.type]===void 0)throw new Error("unknown packet type "+s.type);if(s.type===_e.BINARY_EVENT||s.type===_e.BINARY_ACK){const u=n+1;for(;t.charAt(++n)!=="-"&&n!=t.length;);const c=t.substring(u,n);if(c!=Number(c)||t.charAt(n)!=="-")throw new Error("Illegal attachments");s.attachments=Number(c)}if(t.charAt(n+1)==="/"){const u=n+1;for(;++n&&!(t.charAt(n)===","||n===t.length););s.nsp=t.substring(u,n)}else s.nsp="/";const o=t.charAt(n+1);if(o!==""&&Number(o)==o){const u=n+1;for(;++n;){const c=t.charAt(n);if(c==null||Number(c)!=c){--n;break}if(n===t.length)break}s.id=Number(t.substring(u,n+1))}if(t.charAt(++n)){const u=this.tryParse(t.substr(n));if(ey.isPayloadValid(s.type,u))s.data=u;else throw new Error("invalid payload")}return s}tryParse(t){try{return JSON.parse(t,this.reviver)}catch{return!1}}static isPayloadValid(t,n){switch(t){case _e.CONNECT:return h1(n);case _e.DISCONNECT:return n===void 0;case _e.CONNECT_ERROR:return typeof n=="string"||h1(n);case _e.EVENT:case _e.BINARY_EVENT:return Array.isArray(n)&&(typeof n[0]=="number"||typeof n[0]=="string"&&BV.indexOf(n[0])===-1);case _e.ACK:case _e.BINARY_ACK:return Array.isArray(n)}}destroy(){this.reconstructor&&(this.reconstructor.finishedReconstruction(),this.reconstructor=null)}}class jV{constructor(t){this.packet=t,this.buffers=[],this.reconPack=t}takeBinaryData(t){if(this.buffers.push(t),this.buffers.length===this.reconPack.attachments){const n=$V(this.reconPack,this.buffers);return this.finishedReconstruction(),n}return null}finishedReconstruction(){this.reconPack=null,this.buffers=[]}}const zV=Object.freeze(Object.defineProperty({__proto__:null,Decoder:ey,Encoder:VV,get PacketType(){return _e},protocol:LV},Symbol.toStringTag,{value:"Module"}));function In(e,t,n){return e.on(t,n),function(){e.off(t,n)}}const UV=Object.freeze({connect:1,connect_error:1,disconnect:1,disconnecting:1,newListener:1,removeListener:1});class sE extends St{constructor(t,n,s){super(),this.connected=!1,this.recovered=!1,this.receiveBuffer=[],this.sendBuffer=[],this._queue=[],this._queueSeq=0,this.ids=0,this.acks={},this.flags={},this.io=t,this.nsp=n,s&&s.auth&&(this.auth=s.auth),this._opts=Object.assign({},s),this.io._autoConnect&&this.open()}get disconnected(){return!this.connected}subEvents(){if(this.subs)return;const t=this.io;this.subs=[In(t,"open",this.onopen.bind(this)),In(t,"packet",this.onpacket.bind(this)),In(t,"error",this.onerror.bind(this)),In(t,"close",this.onclose.bind(this))]}get active(){return!!this.subs}connect(){return this.connected?this:(this.subEvents(),this.io._reconnecting||this.io.open(),this.io._readyState==="open"&&this.onopen(),this)}open(){return this.connect()}send(...t){return t.unshift("message"),this.emit.apply(this,t),this}emit(t,...n){var s,o,u;if(UV.hasOwnProperty(t))throw new Error('"'+t.toString()+'" is a reserved event name');if(n.unshift(t),this._opts.retries&&!this.flags.fromQueue&&!this.flags.volatile)return this._addToQueue(n),this;const c={type:_e.EVENT,data:n};if(c.options={},c.options.compress=this.flags.compress!==!1,typeof n[n.length-1]=="function"){const y=this.ids++,g=n.pop();this._registerAckCallback(y,g),c.id=y}const d=(o=(s=this.io.engine)===null||s===void 0?void 0:s.transport)===null||o===void 0?void 0:o.writable,h=this.connected&&!(!((u=this.io.engine)===null||u===void 0)&&u._hasPingExpired());return this.flags.volatile&&!d||(h?(this.notifyOutgoingListeners(c),this.packet(c)):this.sendBuffer.push(c)),this.flags={},this}_registerAckCallback(t,n){var s;const o=(s=this.flags.timeout)!==null&&s!==void 0?s:this._opts.ackTimeout;if(o===void 0){this.acks[t]=n;return}const u=this.io.setTimeoutFn(()=>{delete this.acks[t];for(let d=0;d<this.sendBuffer.length;d++)this.sendBuffer[d].id===t&&this.sendBuffer.splice(d,1);n.call(this,new Error("operation has timed out"))},o),c=(...d)=>{this.io.clearTimeoutFn(u),n.apply(this,d)};c.withError=!0,this.acks[t]=c}emitWithAck(t,...n){return new Promise((s,o)=>{const u=(c,d)=>c?o(c):s(d);u.withError=!0,n.push(u),this.emit(t,...n)})}_addToQueue(t){let n;typeof t[t.length-1]=="function"&&(n=t.pop());const s={id:this._queueSeq++,tryCount:0,pending:!1,args:t,flags:Object.assign({fromQueue:!0},this.flags)};t.push((o,...u)=>s!==this._queue[0]?void 0:(o!==null?s.tryCount>this._opts.retries&&(this._queue.shift(),n&&n(o)):(this._queue.shift(),n&&n(null,...u)),s.pending=!1,this._drainQueue())),this._queue.push(s),this._drainQueue()}_drainQueue(t=!1){if(!this.connected||this._queue.length===0)return;const n=this._queue[0];n.pending&&!t||(n.pending=!0,n.tryCount++,this.flags=n.flags,this.emit.apply(this,n.args))}packet(t){t.nsp=this.nsp,this.io._packet(t)}onopen(){typeof this.auth=="function"?this.auth(t=>{this._sendConnectPacket(t)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(t){this.packet({type:_e.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},t):t})}onerror(t){this.connected||this.emitReserved("connect_error",t)}onclose(t,n){this.connected=!1,delete this.id,this.emitReserved("disconnect",t,n),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(t=>{if(!this.sendBuffer.some(s=>String(s.id)===t)){const s=this.acks[t];delete this.acks[t],s.withError&&s.call(this,new Error("socket has been disconnected"))}})}onpacket(t){if(t.nsp===this.nsp)switch(t.type){case _e.CONNECT:t.data&&t.data.sid?this.onconnect(t.data.sid,t.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case _e.EVENT:case _e.BINARY_EVENT:this.onevent(t);break;case _e.ACK:case _e.BINARY_ACK:this.onack(t);break;case _e.DISCONNECT:this.ondisconnect();break;case _e.CONNECT_ERROR:this.destroy();const s=new Error(t.data.message);s.data=t.data.data,this.emitReserved("connect_error",s);break}}onevent(t){const n=t.data||[];t.id!=null&&n.push(this.ack(t.id)),this.connected?this.emitEvent(n):this.receiveBuffer.push(Object.freeze(n))}emitEvent(t){if(this._anyListeners&&this._anyListeners.length){const n=this._anyListeners.slice();for(const s of n)s.apply(this,t)}super.emit.apply(this,t),this._pid&&t.length&&typeof t[t.length-1]=="string"&&(this._lastOffset=t[t.length-1])}ack(t){const n=this;let s=!1;return function(...o){s||(s=!0,n.packet({type:_e.ACK,id:t,data:o}))}}onack(t){const n=this.acks[t.id];typeof n=="function"&&(delete this.acks[t.id],n.withError&&t.data.unshift(null),n.apply(this,t.data))}onconnect(t,n){this.id=t,this.recovered=n&&this._pid===n,this._pid=n,this.connected=!0,this.emitBuffered(),this.emitReserved("connect"),this._drainQueue(!0)}emitBuffered(){this.receiveBuffer.forEach(t=>this.emitEvent(t)),this.receiveBuffer=[],this.sendBuffer.forEach(t=>{this.notifyOutgoingListeners(t),this.packet(t)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(t=>t()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:_e.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(t){return this.flags.compress=t,this}get volatile(){return this.flags.volatile=!0,this}timeout(t){return this.flags.timeout=t,this}onAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(t),this}prependAny(t){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(t),this}offAny(t){if(!this._anyListeners)return this;if(t){const n=this._anyListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(t),this}prependAnyOutgoing(t){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(t),this}offAnyOutgoing(t){if(!this._anyOutgoingListeners)return this;if(t){const n=this._anyOutgoingListeners;for(let s=0;s<n.length;s++)if(t===n[s])return n.splice(s,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(t){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const n=this._anyOutgoingListeners.slice();for(const s of n)s.apply(this,t.data)}}}function Do(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}Do.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=(Math.floor(t*10)&1)==0?e-n:e+n}return Math.min(e,this.max)|0};Do.prototype.reset=function(){this.attempts=0};Do.prototype.setMin=function(e){this.ms=e};Do.prototype.setMax=function(e){this.max=e};Do.prototype.setJitter=function(e){this.jitter=e};class Fp extends St{constructor(t,n){var s;super(),this.nsps={},this.subs=[],t&&typeof t=="object"&&(n=t,t=void 0),n=n||{},n.path=n.path||"/socket.io",this.opts=n,sf(this,n),this.reconnection(n.reconnection!==!1),this.reconnectionAttempts(n.reconnectionAttempts||1/0),this.reconnectionDelay(n.reconnectionDelay||1e3),this.reconnectionDelayMax(n.reconnectionDelayMax||5e3),this.randomizationFactor((s=n.randomizationFactor)!==null&&s!==void 0?s:.5),this.backoff=new Do({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(n.timeout==null?2e4:n.timeout),this._readyState="closed",this.uri=t;const o=n.parser||zV;this.encoder=new o.Encoder,this.decoder=new o.Decoder,this._autoConnect=n.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(t){return arguments.length?(this._reconnection=!!t,t||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(t){return t===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=t,this)}reconnectionDelay(t){var n;return t===void 0?this._reconnectionDelay:(this._reconnectionDelay=t,(n=this.backoff)===null||n===void 0||n.setMin(t),this)}randomizationFactor(t){var n;return t===void 0?this._randomizationFactor:(this._randomizationFactor=t,(n=this.backoff)===null||n===void 0||n.setJitter(t),this)}reconnectionDelayMax(t){var n;return t===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=t,(n=this.backoff)===null||n===void 0||n.setMax(t),this)}timeout(t){return arguments.length?(this._timeout=t,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(t){if(~this._readyState.indexOf("open"))return this;this.engine=new OV(this.uri,this.opts);const n=this.engine,s=this;this._readyState="opening",this.skipReconnect=!1;const o=In(n,"open",function(){s.onopen(),t&&t()}),u=d=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",d),t?t(d):this.maybeReconnectOnOpen()},c=In(n,"error",u);if(this._timeout!==!1){const d=this._timeout,h=this.setTimeoutFn(()=>{o(),u(new Error("timeout")),n.close()},d);this.opts.autoUnref&&h.unref(),this.subs.push(()=>{this.clearTimeoutFn(h)})}return this.subs.push(o),this.subs.push(c),this}connect(t){return this.open(t)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const t=this.engine;this.subs.push(In(t,"ping",this.onping.bind(this)),In(t,"data",this.ondata.bind(this)),In(t,"error",this.onerror.bind(this)),In(t,"close",this.onclose.bind(this)),In(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(t){try{this.decoder.add(t)}catch(n){this.onclose("parse error",n)}}ondecoded(t){nf(()=>{this.emitReserved("packet",t)},this.setTimeoutFn)}onerror(t){this.emitReserved("error",t)}socket(t,n){let s=this.nsps[t];return s?this._autoConnect&&!s.active&&s.connect():(s=new sE(this,t,n),this.nsps[t]=s),s}_destroy(t){const n=Object.keys(this.nsps);for(const s of n)if(this.nsps[s].active)return;this._close()}_packet(t){const n=this.encoder.encode(t);for(let s=0;s<n.length;s++)this.engine.write(n[s],t.options)}cleanup(){this.subs.forEach(t=>t()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(t,n){var s;this.cleanup(),(s=this.engine)===null||s===void 0||s.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",t,n),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const t=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const n=this.backoff.duration();this._reconnecting=!0;const s=this.setTimeoutFn(()=>{t.skipReconnect||(this.emitReserved("reconnect_attempt",t.backoff.attempts),!t.skipReconnect&&t.open(o=>{o?(t._reconnecting=!1,t.reconnect(),this.emitReserved("reconnect_error",o)):t.onreconnect()}))},n);this.opts.autoUnref&&s.unref(),this.subs.push(()=>{this.clearTimeoutFn(s)})}}onreconnect(){const t=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",t)}}const Ba={};function nc(e,t){typeof e=="object"&&(t=e,e=void 0),t=t||{};const n=MV(e,t.path||"/socket.io"),s=n.source,o=n.id,u=n.path,c=Ba[o]&&u in Ba[o].nsps,d=t.forceNew||t["force new connection"]||t.multiplex===!1||c;let h;return d?h=new Fp(s,t):(Ba[o]||(Ba[o]=new Fp(s,t)),h=Ba[o]),n.query&&!t.query&&(t.query=n.queryKey),h.socket(n.path,t)}Object.assign(nc,{Manager:Fp,Socket:sE,io:nc,connect:nc});const qV=["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"],KV=3,PV=15,IV=/^[a-zA-Z0-9_-]+$/,HV=vt(IV).pipe(vt(`string > ${KV} & string < ${PV}`)).brand("username"),p1=20,m1={0:"o",1:"l",3:"e",4:"a",5:"s",7:"t","@":"a",$:"s","!":"i"};function FV(e){let t="";for(const n of e)n in m1?t+=m1[n]:t+=n;return t}function GV(e){const t=e.toLocaleLowerCase(),n=FV(t);for(const s of qV)if(n.includes(s)||t.includes(s))return!0;return!1}function YV(e){const t=new Set(e).size;return e.length*Math.log2(t)}function XV(e){let t=0;return GV(e)&&(t-=100),t+=YV(e)*.5,Math.max(t,0)}const ZV=vt("string").narrow((e,t)=>{const n=XV(e);return n>=p1?!0:t.mustBe(`Of complexity ${p1} or more. Was ${n.toFixed(2)}.`)}).brand("password");vt({"+":"delete",email:"string",password:"string"});const JV=vt("string").brand("email");vt({"+":"delete",username:"string",password:"string",email:"string"});const QV=vt({email:"string",userId:"string",username:"string",password:"boolean",sessionKey:"string",verification:"'unverified' | 'verified'"}),ci=nc(IT.VITE_BACKEND_ORIGIN,{auth:e=>{const t=Je(nt);t&&e(t)},autoConnect:!1});ci.on("connect",()=>{console.log("connected")}).on("connect_error",()=>{console.log("connect_error"),Be(nt,null)}).on("usernameChanged",e=>{Be(nt,t=>t===null?null:{...t,username:e})});const nt=lt({key:"auth",default:function(){const t=localStorage.getItem("auth");if(t)try{const n=Mo(t),s=QV(n);return s instanceof vt.errors?(console.error("failed to parse auth data",s),null):(s.verification==="verified"&&(console.log("connecting..."),ci.connect()),s)}catch(n){return console.error("failed to parse auth data",n),null}return null},effects:[function({onSet:t}){t(async({newValue:n})=>{console.log("setting auth",n),n?(console.log("setting auth",n),Be(yo,n.username),localStorage.setItem("auth",Ln(n)),n.verification==="verified"?(console.log("connecting..."),ci.connect()):await HT(async()=>{const{navigate:s}=await Promise.resolve().then(()=>o4);return{navigate:s}},void 0).then(({navigate:s})=>{s("/verify")})):(console.log("clearing session..."),localStorage.removeItem("auth"))})}]});var Xw;const yo=lt({key:"username",default:((Xw=Je(nt))==null?void 0:Xw.username)??""}),Xh=lt({key:"usernameDebounce",default:!0}),WV=lt({key:"usernameDebounced100ms",default:window.localStorage.getItem("username")??"",effects:[({setSelf:e})=>{O_(yo,()=>{Je(Xh)&&(e(Je(yo)),Be(Xh,!1),setTimeout(()=>{Be(Xh,!0),e(Je(yo))},2e3))})}]}),e4=fi({key:"isUsernameTakenQuery",get:async({get:e})=>{const t=e(WV);if(!t)return!1;const n=Je(nt);if(t===(n==null?void 0:n.username))return!1;const{trpcClient:s}=await HT(async()=>{const{trpcClient:o}=await Promise.resolve().then(()=>t4);return{trpcClient:o}},void 0);return s.isUsernameTaken.query({username:t})}}),rE=fi({key:"usernameIssues",get:({get:e})=>{const t=e(yo),n=HV(t);return n instanceof vt.errors?n:null}}),ni=lt({key:"password0",default:""}),oE=fi({key:"password0Issues",get:({get:e})=>{const t=e(ni),n=ZV(t);return n instanceof vt.errors?n:null}}),Eo=lt({key:"email",default:""}),aE=fi({key:"emailIssues",get:({get:e})=>{const t=e(Eo),n=JV(t);return n instanceof vt.errors?n:null}});fi({key:"signupReady",get:({get:e})=>{const t=e(rE),n=e(oE),s=e(aE);return!(t??n??s)}});const Bi=lt({key:"oneTimeCode",default:""}),Gp=lt({key:"oneTimeCodeNewEmail",default:""}),ei=lt({key:"authTarget",default:null}),an=wL({links:[$L({url:IT.VITE_BACKEND_ORIGIN,headers(){const e=Je(nt);if(!e)return{};const{userId:t,sessionKey:n}=e;return{Authorization:`${t} ${n}`}}})]}),t4=Object.freeze(Object.defineProperty({__proto__:null,trpcClient:an},Symbol.toStringTag,{value:"Module"})),n4=lt({key:"appVersionQuery",default:an.version.query});lt({key:"lastKnownVersion",default:null,effects:[bx(localStorage,JSON,"lastKnownVersion")]});const i4=fi({key:"appVersion",get:async({get:e})=>{const t=e(n4);return t instanceof Promise?t.then(n=>n.version):t.version}});function Zh(e){return["optional",e]}function s4(e,t){let n=[e];for(const s of t){if(typeof s!="string")return!1;n=n.flatMap(o=>{if(o===null)return[];const u=[],c=o[1],d=c[s];d!==void 0&&u.push(d);const h=Object.keys(c).find(p=>p.startsWith("$"));if(h){const p=c[h];p&&u.push(p)}return u})}for(const s of n)if(s===null||s[0]==="optional")return!0;return!1}const ty=Zh({verify:Zh({$token:null}),game:Zh({clicker:null}),account:null,admin:null});function lE(e){return s4(ty,e)}const uE=[[]];function r4(e){return uE.some(t=>t.join("/")===e.join("/"))}function cr(e){history.pushState(null,"",e),Be(ny,e)}const ny=lt({key:"pathName",default:window.location.pathname,effects:[({onSet:e,setSelf:t})=>{const n=o=>{history.replaceState(null,"",o),t(o)},s=o=>{switch(o){case"/":{const u=Je(nt);switch(console.log("/","auth",u),u==null?void 0:u.verification){case"verified":n("/game");break;case"unverified":n("/verify");break}break}case"/verify":{const u=Je(nt);(u==null?void 0:u.verification)==="verified"&&n("/game");break}case"/game":case"/game/clicker":{const u=Je(nt);(u==null?void 0:u.verification)==="unverified"&&n("/verify");break}case"/admin":break;case"/account":{const u=Je(nt);if(!u){n("/");break}u.verification==="unverified"&&n("/verify");break}}};s(window.location.pathname),e(({newValue:o})=>{s(o)})},({setSelf:e})=>{document.addEventListener("click",t=>{const n=t.target.closest("a");if(n&&n instanceof HTMLAnchorElement){const s=n.getAttribute("href");s!=null&&s.startsWith("/")&&(t.preventDefault(),history.pushState(null,"",s),e(s))}}),window.addEventListener("popstate",()=>{e(window.location.pathname)})}]}),cE=fi({key:"route",get:({get:e})=>{const n=e(ny).split("/").slice(1).filter(Boolean);return lE(n)?r4(n)||e(nt)?n:401:404}}),o4=Object.freeze(Object.defineProperty({__proto__:null,PUBLIC_ROUTES:uE,ROUTES:ty,isRoute:lE,navigate:cr,pathnameAtom:ny,routeSelector:cE},Symbol.toStringTag,{value:"Module"})),y1=lt({key:"buttonBlockActive",default:!1}),Kn=lt({key:"editing",default:[],effects:[({onSet:e})=>{e(({newValue:t})=>{var n,s,o;switch(t[0]){case"email":{(n=Je(fE))==null||n.focus();break}case"new-password":{(s=Je(dE))==null||s.focus();break}case"username":{(o=Je(hE))==null||o.focus();break}}})}]}),fE=lt({key:"emailInputElement",default:null}),dE=lt({key:"password0InputElement",default:null}),hE=lt({key:"usernameInputElement",default:null});function a4(e){const t=V.useRef(null);return V.useEffect(()=>{Be(e,t.current)},[e]),t}const l4=fi({key:"otcLoginFieldLabel",get:({get:e})=>{const t=e(nt);return t?`Code sent to ${t.email}`:""}}),u4=fi({key:"otcVerifyFieldLabel",get:({get:e})=>{const t=e(Eo);return t?`Code sent to ${t}`:""}});function Jh({label:e,inputToken:t,issuesToken:n,inputElementToken:s,initialState:o,onSubmit:u,onOpen:c,onCancel:d,extraIssues:h}){const p=bt(t),y=Hn(t),g=bt(Bi),v=Hn(Bi),S=bt(Gp),A=Hn(Gp),E=bt(ni),_=Hn(ni),D=bt(y1),$=Hn(y1),M=bt(Kn),H=Hn(Kn),z=bt(n),ee=bt(l4),ie=bt(u4),te=a4(s),fe=M[0]===e,me=M.at(-1),[Se,...Ce]=M;return Y.jsxs("form",{onSubmit:async we=>{if(we.preventDefault(),D){$(!1);return}console.log(`submitted! changing ${e} to`,p);const ye=await u(p);Error.isError(ye)&&console.error(ye)},children:[fe?Y.jsx("button",{type:"button",onClick:async()=>{await(d==null?void 0:d()),H([])},children:"x"}):null,Y.jsxs("main",{children:[Y.jsxs("label",{htmlFor:e,children:[z||h?Y.jsxs("aside",{children:[h,z==null?void 0:z.map(we=>Y.jsx("span",{children:we.message},we.path.join(".")))]}):null,Y.jsx("span",{children:e==="new-password"?"Password":Jw(e)}),Y.jsx("input",{id:e,type:e==="new-password"?"password":"text",ref:te,value:p,onChange:we=>{y(we.target.value)},autoComplete:e,autoCapitalize:"none",disabled:me!==e})]}),fe?Ce.map(we=>Y.jsxs("label",{htmlFor:`${e}-${we}`,children:[Y.jsx("span",{children:(()=>{switch(we){case"otcLogin":return ee;case"otcVerify":return ie;case"passwordLogin":return"Password"}})()}),Y.jsx("input",{id:`${e}-otc`,type:"text",ref:te,value:(()=>{switch(we){case"otcLogin":return g;case"otcVerify":return e==="email"?S:g;case"passwordLogin":return E}})(),onChange:ye=>{switch(we){case"otcLogin":v(ye.target.value);break;case"otcVerify":if(e==="email"){A(ye.target.value);break}v(ye.target.value);break;case"passwordLogin":_(ye.target.value)}},autoComplete:e.includes("otc")?"one-time-code":e.includes("password")?"password":"",autoCapitalize:"none",disabled:we!==me})]},`${e}-${we}`)):null]}),M[0]===e?Y.jsx("button",{type:"submit",children:"->"}):Y.jsx("button",{type:"button",onMouseDown:async()=>{$(!0),await(c==null?void 0:c()),H(o)},onMouseUp:()=>{$(!1)},children:"/"})]})}function c4(){const e=bt(nt),t=bt(e4);return ac(()=>{e&&Be(Eo,e.email),e!=null&&e.password&&Be(ni,"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข")}),e?Y.jsxs("article",{"data-css":"editor",children:[Y.jsx(Jh,{label:"username",inputToken:yo,issuesToken:rE,inputElementToken:hE,initialState:["username"],onSubmit:n=>new Promise(s=>{ci.once("usernameChanged",s),ci.emit("changeUsername",n)}),extraIssues:t?Y.jsx("span",{children:"This username is taken."}):null}),Y.jsx(Jh,{label:"email",inputToken:Eo,issuesToken:aE,inputElementToken:fE,initialState:["email"],onSubmit:async n=>{const s=Je(Kn);if(s[0]!=="email")return new Error("field not email");switch(s.length){case 1:{const{userKey:o,nextStep:u}=await an.offerNewEmail.mutate({emailOffered:n});switch(console.log({authTarget:o,nextStep:u}),u){case"otc_login":{Be(ei,o),Be(Kn,["email","otcLogin"]);break}case"password_login":{Be(ei,o),Be(Kn,["email","passwordLogin"]);break}case"otc_verify":{Be(ei,o),Be(Bi,"not needed"),Be(Kn,["email","otcLogin","otcVerify"]);break}}return o}case 2:switch(console.log("case 2"),s[1]){case"otcLogin":{console.log("case 2.1");const o=Je(ei);if(!o)return new Error("No auth target");const u=Je(Bi),c=await an.verifyAccountAction.mutate({oneTimeCode:u,userKey:o});return Be(nt,c),Be(Kn,["email","otcLogin","otcVerify"]),o}case"passwordLogin":return new Error("not implemented")}break;case 3:{const o=Je(ei);if(!o)return new Error("No auth target");const u=Je(Gp),c=await an.verifyAccountAction.mutate({oneTimeCode:u,userKey:o});return Be(nt,c),Be(Kn,[]),c.email}}}}),Y.jsx(Jh,{label:"new-password",inputToken:ni,issuesToken:oE,inputElementToken:dE,initialState:e.password?["new-password","otcVerify"]:["new-password"],onSubmit:async n=>{const s=Je(Kn);if(s[0]!=="new-password")return new Error("field not new-password");switch(s.length){case 1:return await an.setPassword.mutate({password:n}),Be(ni,"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข"),Be(nt,o=>o&&{...o,password:!0}),Be(Kn,[]),"done";case 2:{const o=Je(ei);return o?(await an.verifyAccountAction.mutate({oneTimeCode:Je(Bi),userKey:o}),Be(nt,u=>u&&{...u,password:!1}),Be(ni,""),Be(Kn,["new-password"]),"done"):new Error("No userKey")}}},onCancel:()=>{e.password&&Be(ni,"โ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ขโ€ข")},onOpen:async()=>{if(e.password){const n=Je(ei);if(!n)return new Error("No userKey");await an.startPasswordReset.mutate({userKey:n})}}})]}):Y.jsx("p",{children:"You must be logged in to verify your account."})}function f4(){return Y.jsx("article",{children:Y.jsx("h1",{children:"admin"})})}class d4 extends Map{set(t,n){return this.has(t)?(console.warn("Tried to set a key that already exists in an InvariantMap",{key:t,value:n}),this):super.set(t,n)}clear(){throw new Error("Cannot clear an InvariantMap")}}const Ya=class Ya{constructor(t){x(this,"type","continuity");x(this,"globals",[]);x(this,"actions",[]);x(this,"perspectives",[]);x(this,"key");this.key=t}static create(t,n){const s=new Ya(t),{type:o,globals:u,actions:c,perspectives:d}=n(s),h={type:o,key:t,globals:u,actions:c,perspectives:d};return Ya.existing.set(t,h),h}add(...t){switch(t[0].type){case"atom":case"mutable_atom":this.globals.push(...t);break;case"transaction":this.actions.push(...t);break;case"atom_family":case"mutable_atom_family":{const[s,o]=t;this.perspectives.push({type:"realtime_perspective",resourceAtoms:s,viewAtoms:o})}break}return this}};x(Ya,"existing",new d4);let Yp=Ya;function h4(e){const{key:t,config:n}=e,s=Yp.create(t,n),{actions:o}=s;for(const u of o)ux(xn.STORE,t,u.key);return xm(xn.STORE,t,-1),s}const iy=lt({key:"count",default:0}),pE=M_({key:"incrementTX",do:({set:e})=>{e(iy,t=>t+1)}}),p4=h4({key:"countContinuity",config:e=>e.add(iy).add(pE)});function m4({route:[,e]}){return Y.jsx("article",{children:e?Y.jsx(g4,{gameId:e}):Y.jsx(y4,{})})}function y4(){return Y.jsx("nav",{children:Y.jsx(VT,{href:"/game/clicker",children:"Clicker"})})}w_(ty[1].game[1]);function g4({gameId:e}){console.log(e);const t=bt(iy),n=__(pE);return wC(p4),Y.jsxs("article",{children:[Y.jsxs("button",{type:"button",onClick:()=>{n()},children:["count is ",t]}),Y.jsx("p",{children:"Let's see how high we can count!"})]})}const mE=V.createContext({});function b4(e){const t=V.useRef(null);return t.current===null&&(t.current=e()),t.current}const sy=typeof window<"u",v4=sy?V.useLayoutEffect:V.useEffect,ry=V.createContext(null),yE=V.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function gE(e){return typeof e=="object"&&e!==null}function bE(e){return gE(e)&&"offsetHeight"in e}function S4(e=!0){const t=V.useContext(ry);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:o}=t,u=V.useId();V.useEffect(()=>{if(e)return o(u)},[e]);const c=V.useCallback(()=>e&&s&&s(u),[u,s,e]);return!n&&s?[!1,c]:[!0]}const Hu=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],g1={value:null};function w4(e,t){let n=new Set,s=new Set,o=!1,u=!1;const c=new WeakSet;let d={delta:0,timestamp:0,isProcessing:!1},h=0;function p(g){c.has(g)&&(y.schedule(g),e()),h++,g(d)}const y={schedule:(g,v=!1,S=!1)=>{const E=S&&o?n:s;return v&&c.add(g),E.has(g)||E.add(g),g},cancel:g=>{s.delete(g),c.delete(g)},process:g=>{if(d=g,o){u=!0;return}o=!0,[n,s]=[s,n],n.forEach(p),t&&g1.value&&g1.value.frameloop[t].push(h),h=0,n.clear(),o=!1,u&&(u=!1,y.process(g))}};return y}const Ki={},x4=40;function vE(e,t){let n=!1,s=!0;const o={delta:0,timestamp:0,isProcessing:!1},u=()=>n=!0,c=Hu.reduce((M,H)=>(M[H]=w4(u,t?H:void 0),M),{}),{setup:d,read:h,resolveKeyframes:p,preUpdate:y,update:g,preRender:v,render:S,postRender:A}=c,E=()=>{const M=Ki.useManualTiming?o.timestamp:performance.now();n=!1,Ki.useManualTiming||(o.delta=s?1e3/60:Math.max(Math.min(M-o.timestamp,x4),1)),o.timestamp=M,o.isProcessing=!0,d.process(o),h.process(o),p.process(o),y.process(o),g.process(o),v.process(o),S.process(o),A.process(o),o.isProcessing=!1,n&&t&&(s=!1,e(E))},_=()=>{n=!0,s=!0,o.isProcessing||e(E)};return{schedule:Hu.reduce((M,H)=>{const z=c[H];return M[H]=(ee,ie=!1,te=!1)=>(n||_(),z.schedule(ee,ie,te)),M},{}),cancel:M=>{for(let H=0;H<Hu.length;H++)c[Hu[H]].cancel(M)},state:o,steps:c}}const Vn=e=>e,{schedule:st,cancel:As,state:Ut,steps:Qh}=vE(typeof requestAnimationFrame<"u"?requestAnimationFrame:Vn,!0),SE=V.createContext({strict:!1}),b1={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ro={};for(const e in b1)Ro[e]={isEnabled:t=>b1[e].some(n=>!!t[n])};function A4(e){for(const t in e)Ro[t]={...Ro[t],...e[t]}}const T4=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Mc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||T4.has(e)}let wE=e=>!Mc(e);function E4(e){e&&(wE=t=>t.startsWith("on")?!Mc(t):e(t))}try{E4(require("@emotion/is-prop-valid").default)}catch{}function R4(e,t,n){const s={};for(const o in e)o==="values"&&typeof e.values=="object"||(wE(o)||n===!0&&Mc(o)||!t&&!Mc(o)||e.draggable&&o.startsWith("onDrag"))&&(s[o]=e[o]);return s}function O4(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...s)=>e(...s);return new Proxy(n,{get:(s,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const rf=V.createContext({});function of(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Wa(e){return typeof e=="string"||Array.isArray(e)}const oy=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],ay=["initial",...oy];function af(e){return of(e.animate)||ay.some(t=>Wa(e[t]))}function xE(e){return!!(af(e)||e.variants)}function M4(e,t){if(af(e)){const{initial:n,animate:s}=e;return{initial:n===!1||Wa(n)?n:void 0,animate:Wa(s)?s:void 0}}return e.inherit!==!1?t:{}}function _4(e){const{initial:t,animate:n}=M4(e,V.useContext(rf));return V.useMemo(()=>({initial:t,animate:n}),[v1(t),v1(n)])}function v1(e){return Array.isArray(e)?e.join(" "):e}const C4=Symbol.for("motionComponentSymbol");function ro(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function k4(e,t,n){return V.useCallback(s=>{s&&e.onMount&&e.onMount(s),t&&(s?t.mount(s):t.unmount()),n&&(typeof n=="function"?n(s):ro(n)&&(n.current=s))},[t])}const ly=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),D4="framerAppearId",AE="data-"+ly(D4),TE=V.createContext({}),{schedule:uy}=vE(queueMicrotask,!1);function N4(e,t,n,s,o){var E,_;const{visualElement:u}=V.useContext(rf),c=V.useContext(SE),d=V.useContext(ry),h=V.useContext(yE).reducedMotion,p=V.useRef(null);s=s||c.renderer,!p.current&&s&&(p.current=s(e,{visualState:t,parent:u,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:h}));const y=p.current,g=V.useContext(TE);y&&!y.projection&&o&&(y.type==="html"||y.type==="svg")&&$4(p.current,n,o,g);const v=V.useRef(!1);V.useInsertionEffect(()=>{y&&v.current&&y.update(n,d)});const S=n[AE],A=V.useRef(!!S&&!((E=window.MotionHandoffIsComplete)!=null&&E.call(window,S))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,S)));return v4(()=>{y&&(v.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),uy.render(y.render),A.current&&y.animationState&&y.animationState.animateChanges())}),V.useEffect(()=>{y&&(!A.current&&y.animationState&&y.animationState.animateChanges(),A.current&&(queueMicrotask(()=>{var D;(D=window.MotionHandoffMarkAsComplete)==null||D.call(window,S)}),A.current=!1))}),y}function $4(e,t,n,s){const{layoutId:o,layout:u,drag:c,dragConstraints:d,layoutScroll:h,layoutRoot:p,layoutCrossfade:y}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:EE(e.parent)),e.projection.setOptions({layoutId:o,layout:u,alwaysMeasureLayout:!!c||d&&ro(d),visualElement:e,animationType:typeof u=="string"?u:"both",initialPromotionConfig:s,crossfade:y,layoutScroll:h,layoutRoot:p})}function EE(e){if(e)return e.options.allowProjection!==!1?e.projection:EE(e.parent)}let cy=()=>{};function B4({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:s,Component:o}){e&&A4(e);function u(d,h){let p;const y={...V.useContext(yE),...d,layoutId:L4(d)},{isStatic:g}=y,v=_4(d),S=s(d,g);if(!g&&sy){V4();const A=j4(y);p=A.MeasureLayout,v.visualElement=N4(o,S,y,t,A.ProjectionNode)}return Y.jsxs(rf.Provider,{value:v,children:[p&&v.visualElement?Y.jsx(p,{visualElement:v.visualElement,...y}):null,n(o,d,k4(S,v.visualElement,h),S,g,v.visualElement)]})}u.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const c=V.forwardRef(u);return c[C4]=o,c}function L4({layoutId:e}){const t=V.useContext(mE).id;return t&&e!==void 0?t+"-"+e:e}function V4(e,t){V.useContext(SE).strict}function j4(e){const{drag:t,layout:n}=Ro;if(!t&&!n)return{};const s={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const RE=e=>t=>typeof t=="string"&&t.startsWith(e),fy=RE("--"),z4=RE("var(--"),dy=e=>z4(e)?U4.test(e.split("/*")[0].trim()):!1,U4=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,el={};function q4(e){for(const t in e)el[t]=e[t],fy(t)&&(el[t].isCSSVariable=!0)}const No=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$o=new Set(No);function OE(e,{layout:t,layoutId:n}){return $o.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!el[e]||e==="opacity")}const ME=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Pi=(e,t,n)=>n>t?t:n<e?e:n,Bo={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},tl={...Bo,transform:e=>Pi(0,1,e)},Fu={...Bo,default:1},S1={...Bo,transform:Math.round},gl=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),gs=gl("deg"),ri=gl("%"),he=gl("px"),K4=gl("vh"),P4=gl("vw"),w1={...ri,parse:e=>ri.parse(e)/100,transform:e=>ri.transform(e*100)},I4={rotate:gs,rotateX:gs,rotateY:gs,rotateZ:gs,scale:Fu,scaleX:Fu,scaleY:Fu,scaleZ:Fu,skew:gs,skewX:gs,skewY:gs,distance:he,translateX:he,translateY:he,translateZ:he,x:he,y:he,z:he,perspective:he,transformPerspective:he,opacity:tl,originX:w1,originY:w1,originZ:he},hy={borderWidth:he,borderTopWidth:he,borderRightWidth:he,borderBottomWidth:he,borderLeftWidth:he,borderRadius:he,radius:he,borderTopLeftRadius:he,borderTopRightRadius:he,borderBottomRightRadius:he,borderBottomLeftRadius:he,width:he,maxWidth:he,height:he,maxHeight:he,top:he,right:he,bottom:he,left:he,padding:he,paddingTop:he,paddingRight:he,paddingBottom:he,paddingLeft:he,margin:he,marginTop:he,marginRight:he,marginBottom:he,marginLeft:he,backgroundPositionX:he,backgroundPositionY:he,...I4,zIndex:S1,fillOpacity:tl,strokeOpacity:tl,numOctaves:S1},H4={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},F4=No.length;function G4(e,t,n){let s="",o=!0;for(let u=0;u<F4;u++){const c=No[u],d=e[c];if(d===void 0)continue;let h=!0;if(typeof d=="number"?h=d===(c.startsWith("scale")?1:0):h=parseFloat(d)===0,!h||n){const p=ME(d,hy[c]);if(!h){o=!1;const y=H4[c]||c;s+=`${y}(${p}) `}n&&(t[c]=p)}}return s=s.trim(),n?s=n(t,o?"":s):o&&(s="none"),s}function py(e,t,n){const{style:s,vars:o,transformOrigin:u}=e;let c=!1,d=!1;for(const h in t){const p=t[h];if($o.has(h)){c=!0;continue}else if(fy(h)){o[h]=p;continue}else{const y=ME(p,hy[h]);h.startsWith("origin")?(d=!0,u[h]=y):s[h]=y}}if(t.transform||(c||n?s.transform=G4(t,e.transform,n):s.transform&&(s.transform="none")),d){const{originX:h="50%",originY:p="50%",originZ:y=0}=u;s.transformOrigin=`${h} ${p} ${y}`}}const my=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Ft=e=>!!(e&&e.getVelocity);function _E(e,t,n){for(const s in t)!Ft(t[s])&&!OE(s,n)&&(e[s]=t[s])}function Y4({transformTemplate:e},t){return V.useMemo(()=>{const n=my();return py(n,t,e),Object.assign({},n.vars,n.style)},[t])}function X4(e,t){const n=e.style||{},s={};return _E(s,n,e),Object.assign(s,Y4(e,t)),s}function Z4(e,t){const n={},s=X4(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=s,n}const J4={offset:"stroke-dashoffset",array:"stroke-dasharray"},Q4={offset:"strokeDashoffset",array:"strokeDasharray"};function W4(e,t,n=1,s=0,o=!0){e.pathLength=1;const u=o?J4:Q4;e[u.offset]=he.transform(-s);const c=he.transform(t),d=he.transform(n);e[u.array]=`${c} ${d}`}function CE(e,{attrX:t,attrY:n,attrScale:s,pathLength:o,pathSpacing:u=1,pathOffset:c=0,...d},h,p,y){if(py(e,d,p),h){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:g,style:v}=e;g.transform&&(v.transform=g.transform,delete g.transform),(v.transform||g.transformOrigin)&&(v.transformOrigin=g.transformOrigin??"50% 50%",delete g.transformOrigin),v.transform&&(v.transformBox=(y==null?void 0:y.transformBox)??"fill-box",delete g.transformBox),t!==void 0&&(g.x=t),n!==void 0&&(g.y=n),s!==void 0&&(g.scale=s),o!==void 0&&W4(g,o,u,c,!1)}const kE=()=>({...my(),attrs:{}}),DE=e=>typeof e=="string"&&e.toLowerCase()==="svg";function ej(e,t,n,s){const o=V.useMemo(()=>{const u=kE();return CE(u,t,DE(s),e.transformTemplate,e.style),{...u.attrs,style:{...u.style}}},[t]);if(e.style){const u={};_E(u,e.style,e),o.style={...u,...o.style}}return o}const tj=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function yy(e){return typeof e!="string"||e.includes("-")?!1:!!(tj.indexOf(e)>-1||/[A-Z]/u.test(e))}function nj(e=!1){return(n,s,o,{latestValues:u},c)=>{const h=(yy(n)?ej:Z4)(s,u,c,n),p=R4(s,typeof n=="string",e),y=n!==V.Fragment?{...p,...h,ref:o}:{},{children:g}=s,v=V.useMemo(()=>Ft(g)?g.get():g,[g]);return V.createElement(n,{...y,children:v})}}function x1(e){const t=[{},{}];return e==null||e.values.forEach((n,s)=>{t[0][s]=n.get(),t[1][s]=n.getVelocity()}),t}function gy(e,t,n,s){if(typeof t=="function"){const[o,u]=x1(s);t=t(n!==void 0?n:e.custom,o,u)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,u]=x1(s);t=t(n!==void 0?n:e.custom,o,u)}return t}function ic(e){return Ft(e)?e.get():e}function ij({scrapeMotionValuesFromProps:e,createRenderState:t},n,s,o){return{latestValues:sj(n,s,o,e),renderState:t()}}const NE=e=>(t,n)=>{const s=V.useContext(rf),o=V.useContext(ry),u=()=>ij(e,t,s,o);return n?u():b4(u)};function sj(e,t,n,s){const o={},u=s(e,{});for(const v in u)o[v]=ic(u[v]);let{initial:c,animate:d}=e;const h=af(e),p=xE(e);t&&p&&!h&&e.inherit!==!1&&(c===void 0&&(c=t.initial),d===void 0&&(d=t.animate));let y=n?n.initial===!1:!1;y=y||c===!1;const g=y?d:c;if(g&&typeof g!="boolean"&&!of(g)){const v=Array.isArray(g)?g:[g];for(let S=0;S<v.length;S++){const A=gy(e,v[S]);if(A){const{transitionEnd:E,transition:_,...D}=A;for(const $ in D){let M=D[$];if(Array.isArray(M)){const H=y?M.length-1:0;M=M[H]}M!==null&&(o[$]=M)}for(const $ in E)o[$]=E[$]}}}return o}function by(e,t,n){var u;const{style:s}=e,o={};for(const c in s)(Ft(s[c])||t.style&&Ft(t.style[c])||OE(c,e)||((u=n==null?void 0:n.getValue(c))==null?void 0:u.liveStyle)!==void 0)&&(o[c]=s[c]);return o}const rj={useVisualState:NE({scrapeMotionValuesFromProps:by,createRenderState:my})};function $E(e,t,n){const s=by(e,t,n);for(const o in e)if(Ft(e[o])||Ft(t[o])){const u=No.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;s[u]=e[o]}return s}const oj={useVisualState:NE({scrapeMotionValuesFromProps:$E,createRenderState:kE})};function aj(e,t){return function(s,{forwardMotionProps:o}={forwardMotionProps:!1}){const c={...yy(s)?oj:rj,preloadedFeatures:e,useRender:nj(o),createVisualElement:t,Component:s};return B4(c)}}function nl(e,t,n){const s=e.getProps();return gy(s,t,n!==void 0?n:s.custom,e)}const Xp=e=>Array.isArray(e);let sc;function lj(){sc=void 0}const ln={now:()=>(sc===void 0&&ln.set(Ut.isProcessing||Ki.useManualTiming?Ut.timestamp:performance.now()),sc),set:e=>{sc=e,queueMicrotask(lj)}};function vy(e,t){e.indexOf(t)===-1&&e.push(t)}function Sy(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class wy{constructor(){this.subscriptions=[]}add(t){return vy(this.subscriptions,t),()=>Sy(this.subscriptions,t)}notify(t,n,s){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,s);else for(let u=0;u<o;u++){const c=this.subscriptions[u];c&&c(t,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function BE(e,t){return t?e*(1e3/t):0}const A1=30,uj=e=>!isNaN(parseFloat(e));class cj{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,o=!0)=>{var c,d;const u=ln.now();if(this.updatedAt!==u&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&((c=this.events.change)==null||c.notify(this.current),this.dependents))for(const h of this.dependents)h.dirty();o&&((d=this.events.renderRequest)==null||d.notify(this.current))},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ln.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=uj(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new wy);const s=this.events[t].add(n);return t==="change"?()=>{s(),st.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ln.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>A1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,A1);return BE(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Oo(e,t){return new cj(e,t)}function fj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Oo(n))}function dj(e){return Xp(e)?e[e.length-1]||0:e}function hj(e,t){const n=nl(e,t);let{transitionEnd:s={},transition:o={},...u}=n||{};u={...u,...s};for(const c in u){const d=dj(u[c]);fj(e,c,d)}}function pj(e){return!!(Ft(e)&&e.add)}function Zp(e,t){const n=e.getValue("willChange");if(pj(n))return n.add(t);if(!n&&Ki.WillChange){const s=new Ki.WillChange("auto");e.addValue("willChange",s),s.add(t)}}function LE(e){return e.props[AE]}const mj=e=>e!==null;function yj(e,{repeat:t,repeatType:n="loop"},s){const o=e.filter(mj),u=t&&n!=="loop"&&t%2===1?0:o.length-1;return o[u]}const gj={type:"spring",stiffness:500,damping:25,restSpeed:10},bj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),vj={type:"keyframes",duration:.8},Sj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},wj=(e,{keyframes:t})=>t.length>2?vj:$o.has(e)?e.startsWith("scale")?bj(t[1]):gj:Sj;function xj({when:e,delay:t,delayChildren:n,staggerChildren:s,staggerDirection:o,repeat:u,repeatType:c,repeatDelay:d,from:h,elapsed:p,...y}){return!!Object.keys(y).length}function xy(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const oi=e=>e*1e3,ai=e=>e/1e3,Pa=e=>Math.round(e*1e5)/1e5,Ay=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Aj(e){return e==null}const Tj=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ty=(e,t)=>n=>!!(typeof n=="string"&&Tj.test(n)&&n.startsWith(e)||t&&!Aj(n)&&Object.prototype.hasOwnProperty.call(n,t)),VE=(e,t,n)=>s=>{if(typeof s!="string")return s;const[o,u,c,d]=s.match(Ay);return{[e]:parseFloat(o),[t]:parseFloat(u),[n]:parseFloat(c),alpha:d!==void 0?parseFloat(d):1}},Ej=e=>Pi(0,255,e),Wh={...Bo,transform:e=>Math.round(Ej(e))},er={test:Ty("rgb","red"),parse:VE("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:s=1})=>"rgba("+Wh.transform(e)+", "+Wh.transform(t)+", "+Wh.transform(n)+", "+Pa(tl.transform(s))+")"};function Rj(e){let t="",n="",s="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),s=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),s=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,s+=s,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:o?parseInt(o,16)/255:1}}const Jp={test:Ty("#"),parse:Rj,transform:er.transform},oo={test:Ty("hsl","hue"),parse:VE("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:s=1})=>"hsla("+Math.round(e)+", "+ri.transform(Pa(t))+", "+ri.transform(Pa(n))+", "+Pa(tl.transform(s))+")"},Ht={test:e=>er.test(e)||Jp.test(e)||oo.test(e),parse:e=>er.test(e)?er.parse(e):oo.test(e)?oo.parse(e):Jp.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?er.transform(e):oo.transform(e)},Oj=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Mj(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Ay))==null?void 0:t.length)||0)+(((n=e.match(Oj))==null?void 0:n.length)||0)>0}const jE="number",zE="color",_j="var",Cj="var(",T1="${}",kj=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function il(e){const t=e.toString(),n=[],s={color:[],number:[],var:[]},o=[];let u=0;const d=t.replace(kj,h=>(Ht.test(h)?(s.color.push(u),o.push(zE),n.push(Ht.parse(h))):h.startsWith(Cj)?(s.var.push(u),o.push(_j),n.push(h)):(s.number.push(u),o.push(jE),n.push(parseFloat(h))),++u,T1)).split(T1);return{values:n,split:d,indexes:s,types:o}}function UE(e){return il(e).values}function qE(e){const{split:t,types:n}=il(e),s=t.length;return o=>{let u="";for(let c=0;c<s;c++)if(u+=t[c],o[c]!==void 0){const d=n[c];d===jE?u+=Pa(o[c]):d===zE?u+=Ht.transform(o[c]):u+=o[c]}return u}}const Dj=e=>typeof e=="number"?0:e;function Nj(e){const t=UE(e);return qE(e)(t.map(Dj))}const Ts={test:Mj,parse:UE,createTransformer:qE,getAnimatableNone:Nj};function ep(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function $j({hue:e,saturation:t,lightness:n,alpha:s}){e/=360,t/=100,n/=100;let o=0,u=0,c=0;if(!t)o=u=c=n;else{const d=n<.5?n*(1+t):n+t-n*t,h=2*n-d;o=ep(h,d,e+1/3),u=ep(h,d,e),c=ep(h,d,e-1/3)}return{red:Math.round(o*255),green:Math.round(u*255),blue:Math.round(c*255),alpha:s}}function _c(e,t){return n=>n>0?t:e}const it=(e,t,n)=>e+(t-e)*n,tp=(e,t,n)=>{const s=e*e,o=n*(t*t-s)+s;return o<0?0:Math.sqrt(o)},Bj=[Jp,er,oo],Lj=e=>Bj.find(t=>t.test(e));function E1(e){const t=Lj(e);if(!t)return!1;let n=t.parse(e);return t===oo&&(n=$j(n)),n}const R1=(e,t)=>{const n=E1(e),s=E1(t);if(!n||!s)return _c(e,t);const o={...n};return u=>(o.red=tp(n.red,s.red,u),o.green=tp(n.green,s.green,u),o.blue=tp(n.blue,s.blue,u),o.alpha=it(n.alpha,s.alpha,u),er.transform(o))},Qp=new Set(["none","hidden"]);function Vj(e,t){return Qp.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}const jj=(e,t)=>n=>t(e(n)),bl=(...e)=>e.reduce(jj);function zj(e,t){return n=>it(e,t,n)}function Ey(e){return typeof e=="number"?zj:typeof e=="string"?dy(e)?_c:Ht.test(e)?R1:Kj:Array.isArray(e)?KE:typeof e=="object"?Ht.test(e)?R1:Uj:_c}function KE(e,t){const n=[...e],s=n.length,o=e.map((u,c)=>Ey(u)(u,t[c]));return u=>{for(let c=0;c<s;c++)n[c]=o[c](u);return n}}function Uj(e,t){const n={...e,...t},s={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(s[o]=Ey(e[o])(e[o],t[o]));return o=>{for(const u in s)n[u]=s[u](o);return n}}function qj(e,t){const n=[],s={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const u=t.types[o],c=e.indexes[u][s[u]],d=e.values[c]??0;n[o]=d,s[u]++}return n}const Kj=(e,t)=>{const n=Ts.createTransformer(t),s=il(e),o=il(t);return s.indexes.var.length===o.indexes.var.length&&s.indexes.color.length===o.indexes.color.length&&s.indexes.number.length>=o.indexes.number.length?Qp.has(e)&&!o.values.length||Qp.has(t)&&!s.values.length?Vj(e,t):bl(KE(qj(s,o),o.values),n):_c(e,t)};function PE(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?it(e,t,n):Ey(e)(e,t)}const Pj=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>st.update(t,n),stop:()=>As(t),now:()=>Ut.isProcessing?Ut.timestamp:ln.now()}},IE=(e,t,n=10)=>{let s="";const o=Math.max(Math.round(t/n),2);for(let u=0;u<o;u++)s+=e(u/(o-1))+", ";return`linear(${s.substring(0,s.length-2)})`},Cc=2e4;function Ry(e){let t=0;const n=50;let s=e.next(t);for(;!s.done&&t<Cc;)t+=n,s=e.next(t);return t>=Cc?1/0:t}function Ij(e,t=100,n){const s=n({...e,keyframes:[0,t]}),o=Math.min(Ry(s),Cc);return{type:"keyframes",ease:u=>s.next(o*u).value/t,duration:ai(o)}}const Hj=5;function HE(e,t,n){const s=Math.max(t-Hj,0);return BE(n-e(s),t-s)}const at={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},O1=.001;function Fj({duration:e=at.duration,bounce:t=at.bounce,velocity:n=at.velocity,mass:s=at.mass}){let o,u,c=1-t;c=Pi(at.minDamping,at.maxDamping,c),e=Pi(at.minDuration,at.maxDuration,ai(e)),c<1?(o=p=>{const y=p*c,g=y*e,v=y-n,S=Wp(p,c),A=Math.exp(-g);return O1-v/S*A},u=p=>{const g=p*c*e,v=g*n+n,S=Math.pow(c,2)*Math.pow(p,2)*e,A=Math.exp(-g),E=Wp(Math.pow(p,2),c);return(-o(p)+O1>0?-1:1)*((v-S)*A)/E}):(o=p=>{const y=Math.exp(-p*e),g=(p-n)*e+1;return-.001+y*g},u=p=>{const y=Math.exp(-p*e),g=(n-p)*(e*e);return y*g});const d=5/e,h=Yj(o,u,d);if(e=oi(e),isNaN(h))return{stiffness:at.stiffness,damping:at.damping,duration:e};{const p=Math.pow(h,2)*s;return{stiffness:p,damping:c*2*Math.sqrt(s*p),duration:e}}}const Gj=12;function Yj(e,t,n){let s=n;for(let o=1;o<Gj;o++)s=s-e(s)/t(s);return s}function Wp(e,t){return e*Math.sqrt(1-t*t)}const Xj=["duration","bounce"],Zj=["stiffness","damping","mass"];function M1(e,t){return t.some(n=>e[n]!==void 0)}function Jj(e){let t={velocity:at.velocity,stiffness:at.stiffness,damping:at.damping,mass:at.mass,isResolvedFromDuration:!1,...e};if(!M1(e,Zj)&&M1(e,Xj))if(e.visualDuration){const n=e.visualDuration,s=2*Math.PI/(n*1.2),o=s*s,u=2*Pi(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:at.mass,stiffness:o,damping:u}}else{const n=Fj(e);t={...t,...n,mass:at.mass},t.isResolvedFromDuration=!0}return t}function kc(e=at.visualDuration,t=at.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:s,restDelta:o}=n;const u=n.keyframes[0],c=n.keyframes[n.keyframes.length-1],d={done:!1,value:u},{stiffness:h,damping:p,mass:y,duration:g,velocity:v,isResolvedFromDuration:S}=Jj({...n,velocity:-ai(n.velocity||0)}),A=v||0,E=p/(2*Math.sqrt(h*y)),_=c-u,D=ai(Math.sqrt(h/y)),$=Math.abs(_)<5;s||(s=$?at.restSpeed.granular:at.restSpeed.default),o||(o=$?at.restDelta.granular:at.restDelta.default);let M;if(E<1){const z=Wp(D,E);M=ee=>{const ie=Math.exp(-E*D*ee);return c-ie*((A+E*D*_)/z*Math.sin(z*ee)+_*Math.cos(z*ee))}}else if(E===1)M=z=>c-Math.exp(-D*z)*(_+(A+D*_)*z);else{const z=D*Math.sqrt(E*E-1);M=ee=>{const ie=Math.exp(-E*D*ee),te=Math.min(z*ee,300);return c-ie*((A+E*D*_)*Math.sinh(te)+z*_*Math.cosh(te))/z}}const H={calculatedDuration:S&&g||null,next:z=>{const ee=M(z);if(S)d.done=z>=g;else{let ie=z===0?A:0;E<1&&(ie=z===0?oi(A):HE(M,z,ee));const te=Math.abs(ie)<=s,fe=Math.abs(c-ee)<=o;d.done=te&&fe}return d.value=d.done?c:ee,d},toString:()=>{const z=Math.min(Ry(H),Cc),ee=IE(ie=>H.next(z*ie).value,z,30);return z+"ms "+ee},toTransition:()=>{}};return H}kc.applyToOptions=e=>{const t=Ij(e,100,kc);return e.ease=t.ease,e.duration=oi(t.duration),e.type="keyframes",e};function em({keyframes:e,velocity:t=0,power:n=.8,timeConstant:s=325,bounceDamping:o=10,bounceStiffness:u=500,modifyTarget:c,min:d,max:h,restDelta:p=.5,restSpeed:y}){const g=e[0],v={done:!1,value:g},S=te=>d!==void 0&&te<d||h!==void 0&&te>h,A=te=>d===void 0?h:h===void 0||Math.abs(d-te)<Math.abs(h-te)?d:h;let E=n*t;const _=g+E,D=c===void 0?_:c(_);D!==_&&(E=D-g);const $=te=>-E*Math.exp(-te/s),M=te=>D+$(te),H=te=>{const fe=$(te),me=M(te);v.done=Math.abs(fe)<=p,v.value=v.done?D:me};let z,ee;const ie=te=>{S(v.value)&&(z=te,ee=kc({keyframes:[v.value,A(v.value)],velocity:HE(M,te,v.value),damping:o,stiffness:u,restDelta:p,restSpeed:y}))};return ie(0),{calculatedDuration:null,next:te=>{let fe=!1;return!ee&&z===void 0&&(fe=!0,H(te),ie(te)),z!==void 0&&te>=z?ee.next(te-z):(!fe&&H(te),v)}}}const sl=(e,t,n)=>{const s=t-e;return s===0?1:(n-e)/s};function Qj(e,t,n){const s=[],o=n||Ki.mix||PE,u=e.length-1;for(let c=0;c<u;c++){let d=o(e[c],e[c+1]);if(t){const h=Array.isArray(t)?t[c]||Vn:t;d=bl(h,d)}s.push(d)}return s}function Wj(e,t,{clamp:n=!0,ease:s,mixer:o}={}){const u=e.length;if(cy(u===t.length),u===1)return()=>t[0];if(u===2&&t[0]===t[1])return()=>t[1];const c=e[0]===e[1];e[0]>e[u-1]&&(e=[...e].reverse(),t=[...t].reverse());const d=Qj(t,s,o),h=d.length,p=y=>{if(c&&y<e[0])return t[0];let g=0;if(h>1)for(;g<e.length-2&&!(y<e[g+1]);g++);const v=sl(e[g],e[g+1],y);return d[g](v)};return n?y=>p(Pi(e[0],e[u-1],y)):p}function ez(e,t){const n=e[e.length-1];for(let s=1;s<=t;s++){const o=sl(0,t,s);e.push(it(n,1,o))}}function tz(e){const t=[0];return ez(t,e.length-1),t}function nz(e,t){return e.map(n=>n*t)}const FE=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,iz=1e-7,sz=12;function rz(e,t,n,s,o){let u,c,d=0;do c=t+(n-t)/2,u=FE(c,s,o)-e,u>0?n=c:t=c;while(Math.abs(u)>iz&&++d<sz);return c}function vl(e,t,n,s){if(e===t&&n===s)return Vn;const o=u=>rz(u,0,1,e,n);return u=>u===0||u===1?u:FE(o(u),t,s)}const oz=vl(.42,0,1,1),az=vl(0,0,.58,1),GE=vl(.42,0,.58,1),lz=e=>Array.isArray(e)&&typeof e[0]!="number",YE=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,XE=e=>t=>1-e(1-t),ZE=vl(.33,1.53,.69,.99),Oy=XE(ZE),JE=YE(Oy),QE=e=>(e*=2)<1?.5*Oy(e):.5*(2-Math.pow(2,-10*(e-1))),My=e=>1-Math.sin(Math.acos(e)),WE=XE(My),eR=YE(My),tR=e=>Array.isArray(e)&&typeof e[0]=="number",uz={linear:Vn,easeIn:oz,easeInOut:GE,easeOut:az,circIn:My,circInOut:eR,circOut:WE,backIn:Oy,backInOut:JE,backOut:ZE,anticipate:QE},cz=e=>typeof e=="string",_1=e=>{if(tR(e)){cy(e.length===4);const[t,n,s,o]=e;return vl(t,n,s,o)}else if(cz(e))return uz[e];return e};function fz(e,t){return e.map(()=>t||GE).splice(0,e.length-1)}function Ia({duration:e=300,keyframes:t,times:n,ease:s="easeInOut"}){const o=lz(s)?s.map(_1):_1(s),u={done:!1,value:t[0]},c=nz(n&&n.length===t.length?n:tz(t),e),d=Wj(c,t,{ease:Array.isArray(o)?o:fz(t,o)});return{calculatedDuration:e,next:h=>(u.value=d(h),u.done=h>=e,u)}}const dz=e=>e!==null;function _y(e,{repeat:t,repeatType:n="loop"},s,o=1){const u=e.filter(dz),d=o<0||t&&n!=="loop"&&t%2===1?0:u.length-1;return!d||s===void 0?u[d]:s}const hz={decay:em,inertia:em,tween:Ia,keyframes:Ia,spring:kc};function nR(e){typeof e.type=="string"&&(e.type=hz[e.type])}class Cy{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const pz=e=>e/100;class ky extends Cy{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var s,o;const{motionValue:n}=this.options;n&&n.updatedAt!==ln.now()&&this.tick(ln.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(o=(s=this.options).onStop)==null||o.call(s))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;nR(t);const{type:n=Ia,repeat:s=0,repeatDelay:o=0,repeatType:u,velocity:c=0}=t;let{keyframes:d}=t;const h=n||Ia;h!==Ia&&typeof d[0]!="number"&&(this.mixKeyframes=bl(pz,PE(d[0],d[1])),d=[0,100]);const p=h({...t,keyframes:d});u==="mirror"&&(this.mirroredGenerator=h({...t,keyframes:[...d].reverse(),velocity:-c})),p.calculatedDuration===null&&(p.calculatedDuration=Ry(p));const{calculatedDuration:y}=p;this.calculatedDuration=y,this.resolvedDuration=y+o,this.totalDuration=this.resolvedDuration*(s+1)-o,this.generator=p}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:s,totalDuration:o,mixKeyframes:u,mirroredGenerator:c,resolvedDuration:d,calculatedDuration:h}=this;if(this.startTime===null)return s.next(0);const{delay:p=0,keyframes:y,repeat:g,repeatType:v,repeatDelay:S,type:A,onUpdate:E,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-o/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const D=this.currentTime-p*(this.playbackSpeed>=0?1:-1),$=this.playbackSpeed>=0?D<0:D>o;this.currentTime=Math.max(D,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=o);let M=this.currentTime,H=s;if(g){const te=Math.min(this.currentTime,o)/d;let fe=Math.floor(te),me=te%1;!me&&te>=1&&(me=1),me===1&&fe--,fe=Math.min(fe,g+1),!!(fe%2)&&(v==="reverse"?(me=1-me,S&&(me-=S/d)):v==="mirror"&&(H=c)),M=Pi(0,1,me)*d}const z=$?{done:!1,value:y[0]}:H.next(M);u&&(z.value=u(z.value));let{done:ee}=z;!$&&h!==null&&(ee=this.playbackSpeed>=0?this.currentTime>=o:this.currentTime<=0);const ie=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&ee);return ie&&A!==em&&(z.value=_y(y,this.options,_,this.speed)),E&&E(z.value),ie&&this.finish(),z}then(t,n){return this.finished.then(t,n)}get duration(){return ai(this.calculatedDuration)}get time(){return ai(this.currentTime)}set time(t){var n;t=oi(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(ln.now());const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ai(this.currentTime))}play(){var o,u;if(this.isStopped)return;const{driver:t=Pj,startTime:n}=this.options;this.driver||(this.driver=t(c=>this.tick(c))),(u=(o=this.options).onPlay)==null||u.call(o);const s=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=s):this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime||(this.startTime=n??s),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ln.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function mz(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const tr=e=>e*180/Math.PI,tm=e=>{const t=tr(Math.atan2(e[1],e[0]));return nm(t)},yz={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:tm,rotateZ:tm,skewX:e=>tr(Math.atan(e[1])),skewY:e=>tr(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},nm=e=>(e=e%360,e<0&&(e+=360),e),C1=tm,k1=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),D1=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),gz={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:k1,scaleY:D1,scale:e=>(k1(e)+D1(e))/2,rotateX:e=>nm(tr(Math.atan2(e[6],e[5]))),rotateY:e=>nm(tr(Math.atan2(-e[2],e[0]))),rotateZ:C1,rotate:C1,skewX:e=>tr(Math.atan(e[4])),skewY:e=>tr(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function im(e){return e.includes("scale")?1:0}function sm(e,t){if(!e||e==="none")return im(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,o;if(n)s=gz,o=n;else{const d=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=yz,o=d}if(!o)return im(t);const u=s[t],c=o[1].split(",").map(vz);return typeof u=="function"?u(c):c[u]}const bz=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return sm(n,t)};function vz(e){return parseFloat(e.trim())}const N1=e=>e===Bo||e===he,Sz=new Set(["x","y","z"]),wz=No.filter(e=>!Sz.has(e));function xz(e){const t=[];return wz.forEach(n=>{const s=e.getValue(n);s!==void 0&&(t.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),t}const rr={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>sm(t,"x"),y:(e,{transform:t})=>sm(t,"y")};rr.translateX=rr.x;rr.translateY=rr.y;const or=new Set;let rm=!1,om=!1,am=!1;function iR(){if(om){const e=Array.from(or).filter(s=>s.needsMeasurement),t=new Set(e.map(s=>s.element)),n=new Map;t.forEach(s=>{const o=xz(s);o.length&&(n.set(s,o),s.render())}),e.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const o=n.get(s);o&&o.forEach(([u,c])=>{var d;(d=s.getValue(u))==null||d.set(c)})}),e.forEach(s=>s.measureEndState()),e.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}om=!1,rm=!1,or.forEach(e=>e.complete(am)),or.clear()}function sR(){or.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(om=!0)})}function Az(){am=!0,sR(),iR(),am=!1}class Dy{constructor(t,n,s,o,u,c=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=s,this.motionValue=o,this.element=u,this.isAsync=c}scheduleResolve(){this.state="scheduled",this.isAsync?(or.add(this),rm||(rm=!0,st.read(sR),st.resolveKeyframes(iR))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:s,motionValue:o}=this;if(t[0]===null){const u=o==null?void 0:o.get(),c=t[t.length-1];if(u!==void 0)t[0]=u;else if(s&&n){const d=s.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),o&&u===void 0&&o.set(t[0])}mz(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),or.delete(this)}cancel(){this.state==="scheduled"&&(or.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const Tz=e=>e.startsWith("--");function Ez(e,t,n){Tz(t)?e.style.setProperty(t,n):e.style[t]=n}function Ny(e){let t;return()=>(t===void 0&&(t=e()),t)}const Rz=Ny(()=>window.ScrollTimeline!==void 0),Oz={};function Mz(e,t){const n=Ny(e);return()=>Oz[t]??n()}const rR=Mz(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Ua=([e,t,n,s])=>`cubic-bezier(${e}, ${t}, ${n}, ${s})`,$1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Ua([0,.65,.55,1]),circOut:Ua([.55,0,1,.45]),backIn:Ua([.31,.01,.66,-.59]),backOut:Ua([.33,1.53,.69,.99])};function oR(e,t){if(e)return typeof e=="function"?rR()?IE(e,t):"ease-out":tR(e)?Ua(e):Array.isArray(e)?e.map(n=>oR(n,t)||$1.easeOut):$1[e]}function _z(e,t,n,{delay:s=0,duration:o=300,repeat:u=0,repeatType:c="loop",ease:d="easeOut",times:h}={},p=void 0){const y={[t]:n};h&&(y.offset=h);const g=oR(d,o);Array.isArray(g)&&(y.easing=g);const v={delay:s,duration:o,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:u+1,direction:c==="reverse"?"alternate":"normal"};return p&&(v.pseudoElement=p),e.animate(y,v)}function aR(e){return typeof e=="function"&&"applyToOptions"in e}function Cz({type:e,...t}){return aR(e)&&rR()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class kz extends Cy{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:n,name:s,keyframes:o,pseudoElement:u,allowFlatten:c=!1,finalKeyframe:d,onComplete:h}=t;this.isPseudoElement=!!u,this.allowFlatten=c,this.options=t,cy(typeof t.type!="string");const p=Cz(t);this.animation=_z(n,s,o,p,u),p.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!u){const y=_y(o,this.options,d,this.speed);this.updateMotionValue?this.updateMotionValue(y):Ez(n,s,y),this.animation.cancel()}h==null||h(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,n;this.isPseudoElement||(n=(t=this.animation).commitStyles)==null||n.call(t)}get duration(){var n,s;const t=((s=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:s.call(n).duration)||0;return ai(Number(t))}get time(){return ai(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=oi(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:n}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Rz()?(this.animation.timeline=t,Vn):n(this)}}const lR={anticipate:QE,backInOut:JE,circInOut:eR};function Dz(e){return e in lR}function Nz(e){typeof e.ease=="string"&&Dz(e.ease)&&(e.ease=lR[e.ease])}const B1=10;class $z extends kz{constructor(t){Nz(t),nR(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:s,onComplete:o,element:u,...c}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const d=new ky({...c,autoplay:!1}),h=oi(this.finishedTime??this.time);n.setWithVelocity(d.sample(h-B1).value,d.sample(h).value,B1),d.stop()}}const L1=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ts.test(e)||e==="0")&&!e.startsWith("url("));function Bz(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Lz(e,t,n,s){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const u=e[e.length-1],c=L1(o,t),d=L1(u,t);return!c||!d?!1:Bz(e)||(n==="spring"||aR(n))&&s}const Vz=new Set(["opacity","clipPath","filter","transform"]),jz=Ny(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function zz(e){var p;const{motionValue:t,name:n,repeatDelay:s,repeatType:o,damping:u,type:c}=e;if(!bE((p=t==null?void 0:t.owner)==null?void 0:p.current))return!1;const{onUpdate:d,transformTemplate:h}=t.owner.getProps();return jz()&&n&&Vz.has(n)&&(n!=="transform"||!h)&&!d&&!s&&o!=="mirror"&&u!==0&&c!=="inertia"}const Uz=40;class qz extends Cy{constructor({autoplay:t=!0,delay:n=0,type:s="keyframes",repeat:o=0,repeatDelay:u=0,repeatType:c="loop",keyframes:d,name:h,motionValue:p,element:y,...g}){var A;super(),this.stop=()=>{var E,_;this._animation&&(this._animation.stop(),(E=this.stopTimeline)==null||E.call(this)),(_=this.keyframeResolver)==null||_.cancel()},this.createdAt=ln.now();const v={autoplay:t,delay:n,type:s,repeat:o,repeatDelay:u,repeatType:c,name:h,motionValue:p,element:y,...g},S=(y==null?void 0:y.KeyframeResolver)||Dy;this.keyframeResolver=new S(d,(E,_,D)=>this.onKeyframesResolved(E,_,v,!D),h,p,y),(A=this.keyframeResolver)==null||A.scheduleResolve()}onKeyframesResolved(t,n,s,o){this.keyframeResolver=void 0;const{name:u,type:c,velocity:d,delay:h,isHandoff:p,onUpdate:y}=s;this.resolvedAt=ln.now(),Lz(t,u,c,d)||((Ki.instantAnimations||!h)&&(y==null||y(_y(t,s,n))),t[0]=t[t.length-1],s.duration=0,s.repeat=0);const v={startTime:o?this.resolvedAt?this.resolvedAt-this.createdAt>Uz?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...s,keyframes:t},S=!p&&zz(v)?new $z({...v,element:v.motionValue.owner.current}):new ky(v);S.finished.then(()=>this.notifyFinished()).catch(Vn),this.pendingTimeline&&(this.stopTimeline=S.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=S}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Az()),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}const $y=(e,t,n,s={},o,u)=>c=>{const d=xy(s,e)||{},h=d.delay||s.delay||0;let{elapsed:p=0}=s;p=p-oi(h);const y={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...d,delay:-p,onUpdate:v=>{t.set(v),d.onUpdate&&d.onUpdate(v)},onComplete:()=>{c(),d.onComplete&&d.onComplete()},name:e,motionValue:t,element:u?void 0:o};xj(d)||Object.assign(y,wj(e,y)),y.duration&&(y.duration=oi(y.duration)),y.repeatDelay&&(y.repeatDelay=oi(y.repeatDelay)),y.from!==void 0&&(y.keyframes[0]=y.from);let g=!1;if((y.type===!1||y.duration===0&&!y.repeatDelay)&&(y.duration=0,y.delay===0&&(g=!0)),(Ki.instantAnimations||Ki.skipAnimations)&&(g=!0,y.duration=0,y.delay=0),y.allowFlatten=!d.type&&!d.ease,g&&!u&&t.get()!==void 0){const v=yj(y.keyframes,d);if(v!==void 0){st.update(()=>{y.onUpdate(v),y.onComplete()});return}}return d.isSync?new ky(y):new qz(y)},uR=new Set(["width","height","top","left","right","bottom",...No]);function Kz({protectedKeys:e,needsAnimating:t},n){const s=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,s}function cR(e,t,{delay:n=0,transitionOverride:s,type:o}={}){let{transition:u=e.getDefaultTransition(),transitionEnd:c,...d}=t;s&&(u=s);const h=[],p=o&&e.animationState&&e.animationState.getState()[o];for(const y in d){const g=e.getValue(y,e.latestValues[y]??null),v=d[y];if(v===void 0||p&&Kz(p,y))continue;const S={delay:n,...xy(u||{},y)},A=g.get();if(A!==void 0&&!g.isAnimating&&!Array.isArray(v)&&v===A&&!S.velocity)continue;let E=!1;if(window.MotionHandoffAnimation){const D=LE(e);if(D){const $=window.MotionHandoffAnimation(D,y,st);$!==null&&(S.startTime=$,E=!0)}}Zp(e,y),g.start($y(y,g,v,e.shouldReduceMotion&&uR.has(y)?{type:!1}:S,e,E));const _=g.animation;_&&h.push(_)}return c&&Promise.all(h).then(()=>{st.update(()=>{c&&hj(e,c)})}),h}function lm(e,t,n={}){var h;const s=nl(e,t,n.type==="exit"?(h=e.presenceContext)==null?void 0:h.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const u=s?()=>Promise.all(cR(e,s,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(p=0)=>{const{delayChildren:y=0,staggerChildren:g,staggerDirection:v}=o;return Pz(e,t,y+p,g,v,n)}:()=>Promise.resolve(),{when:d}=o;if(d){const[p,y]=d==="beforeChildren"?[u,c]:[c,u];return p().then(()=>y())}else return Promise.all([u(),c(n.delay)])}function Pz(e,t,n=0,s=0,o=1,u){const c=[],d=(e.variantChildren.size-1)*s,h=o===1?(p=0)=>p*s:(p=0)=>d-p*s;return Array.from(e.variantChildren).sort(Iz).forEach((p,y)=>{p.notify("AnimationStart",t),c.push(lm(p,t,{...u,delay:n+h(y)}).then(()=>p.notify("AnimationComplete",t)))}),Promise.all(c)}function Iz(e,t){return e.sortNodePosition(t)}function Hz(e,t,n={}){e.notify("AnimationStart",t);let s;if(Array.isArray(t)){const o=t.map(u=>lm(e,u,n));s=Promise.all(o)}else if(typeof t=="string")s=lm(e,t,n);else{const o=typeof t=="function"?nl(e,t,n.custom):t;s=Promise.all(cR(e,o,n))}return s.then(()=>{e.notify("AnimationComplete",t)})}function fR(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let s=0;s<n;s++)if(t[s]!==e[s])return!1;return!0}const Fz=ay.length;function dR(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?dR(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<Fz;n++){const s=ay[n],o=e.props[s];(Wa(o)||o===!1)&&(t[s]=o)}return t}const Gz=[...oy].reverse(),Yz=oy.length;function Xz(e){return t=>Promise.all(t.map(({animation:n,options:s})=>Hz(e,n,s)))}function Zz(e){let t=Xz(e),n=V1(),s=!0;const o=h=>(p,y)=>{var v;const g=nl(e,y,h==="exit"?(v=e.presenceContext)==null?void 0:v.custom:void 0);if(g){const{transition:S,transitionEnd:A,...E}=g;p={...p,...E,...A}}return p};function u(h){t=h(e)}function c(h){const{props:p}=e,y=dR(e.parent)||{},g=[],v=new Set;let S={},A=1/0;for(let _=0;_<Yz;_++){const D=Gz[_],$=n[D],M=p[D]!==void 0?p[D]:y[D],H=Wa(M),z=D===h?$.isActive:null;z===!1&&(A=_);let ee=M===y[D]&&M!==p[D]&&H;if(ee&&s&&e.manuallyAnimateOnMount&&(ee=!1),$.protectedKeys={...S},!$.isActive&&z===null||!M&&!$.prevProp||of(M)||typeof M=="boolean")continue;const ie=Jz($.prevProp,M);let te=ie||D===h&&$.isActive&&!ee&&H||_>A&&H,fe=!1;const me=Array.isArray(M)?M:[M];let Se=me.reduce(o(D),{});z===!1&&(Se={});const{prevResolvedValues:Ce={}}=$,we={...Ce,...Se},ye=P=>{te=!0,v.has(P)&&(fe=!0,v.delete(P)),$.needsAnimating[P]=!0;const F=e.getValue(P);F&&(F.liveStyle=!1)};for(const P in we){const F=Se[P],J=Ce[P];if(S.hasOwnProperty(P))continue;let T=!1;Xp(F)&&Xp(J)?T=!fR(F,J):T=F!==J,T?F!=null?ye(P):v.add(P):F!==void 0&&v.has(P)?ye(P):$.protectedKeys[P]=!0}$.prevProp=M,$.prevResolvedValues=Se,$.isActive&&(S={...S,...Se}),s&&e.blockInitialAnimation&&(te=!1),te&&(!(ee&&ie)||fe)&&g.push(...me.map(P=>({animation:P,options:{type:D}})))}if(v.size){const _={};if(typeof p.initial!="boolean"){const D=nl(e,Array.isArray(p.initial)?p.initial[0]:p.initial);D&&D.transition&&(_.transition=D.transition)}v.forEach(D=>{const $=e.getBaseTarget(D),M=e.getValue(D);M&&(M.liveStyle=!0),_[D]=$??null}),g.push({animation:_})}let E=!!g.length;return s&&(p.initial===!1||p.initial===p.animate)&&!e.manuallyAnimateOnMount&&(E=!1),s=!1,E?t(g):Promise.resolve()}function d(h,p){var g;if(n[h].isActive===p)return Promise.resolve();(g=e.variantChildren)==null||g.forEach(v=>{var S;return(S=v.animationState)==null?void 0:S.setActive(h,p)}),n[h].isActive=p;const y=c(h);for(const v in n)n[v].protectedKeys={};return y}return{animateChanges:c,setActive:d,setAnimateFunction:u,getState:()=>n,reset:()=>{n=V1(),s=!0}}}function Jz(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!fR(t,e):!1}function Fs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function V1(){return{animate:Fs(!0),whileInView:Fs(),whileHover:Fs(),whileTap:Fs(),whileDrag:Fs(),whileFocus:Fs(),exit:Fs()}}class Rs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Qz extends Rs{constructor(t){super(t),t.animationState||(t.animationState=Zz(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();of(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let Wz=0;class eU extends Rs{constructor(){super(...arguments),this.id=Wz++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const tU={animation:{Feature:Qz},exit:{Feature:eU}};function rl(e,t,n,s={passive:!0}){return e.addEventListener(t,n,s),()=>e.removeEventListener(t,n)}const By=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;function Sl(e){return{point:{x:e.pageX,y:e.pageY}}}const nU=e=>t=>By(t)&&e(t,Sl(t));function Ha(e,t,n,s){return rl(e,t,nU(n),s)}function hR({top:e,left:t,right:n,bottom:s}){return{x:{min:t,max:n},y:{min:e,max:s}}}function iU({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function sU(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),s=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const pR=1e-4,rU=1-pR,oU=1+pR,mR=.01,aU=0-mR,lU=0+mR;function Jt(e){return e.max-e.min}function uU(e,t,n){return Math.abs(e-t)<=n}function j1(e,t,n,s=.5){e.origin=s,e.originPoint=it(t.min,t.max,e.origin),e.scale=Jt(n)/Jt(t),e.translate=it(n.min,n.max,e.origin)-e.originPoint,(e.scale>=rU&&e.scale<=oU||isNaN(e.scale))&&(e.scale=1),(e.translate>=aU&&e.translate<=lU||isNaN(e.translate))&&(e.translate=0)}function Fa(e,t,n,s){j1(e.x,t.x,n.x,s?s.originX:void 0),j1(e.y,t.y,n.y,s?s.originY:void 0)}function z1(e,t,n){e.min=n.min+t.min,e.max=e.min+Jt(t)}function cU(e,t,n){z1(e.x,t.x,n.x),z1(e.y,t.y,n.y)}function U1(e,t,n){e.min=t.min-n.min,e.max=e.min+Jt(t)}function Ga(e,t,n){U1(e.x,t.x,n.x),U1(e.y,t.y,n.y)}const q1=()=>({translate:0,scale:1,origin:0,originPoint:0}),ao=()=>({x:q1(),y:q1()}),K1=()=>({min:0,max:0}),ht=()=>({x:K1(),y:K1()});function Nn(e){return[e("x"),e("y")]}function np(e){return e===void 0||e===1}function um({scale:e,scaleX:t,scaleY:n}){return!np(e)||!np(t)||!np(n)}function Zs(e){return um(e)||yR(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function yR(e){return P1(e.x)||P1(e.y)}function P1(e){return e&&e!=="0%"}function Dc(e,t,n){const s=e-n,o=t*s;return n+o}function I1(e,t,n,s,o){return o!==void 0&&(e=Dc(e,o,s)),Dc(e,n,s)+t}function cm(e,t=0,n=1,s,o){e.min=I1(e.min,t,n,s,o),e.max=I1(e.max,t,n,s,o)}function gR(e,{x:t,y:n}){cm(e.x,t.translate,t.scale,t.originPoint),cm(e.y,n.translate,n.scale,n.originPoint)}const H1=.999999999999,F1=1.0000000000001;function fU(e,t,n,s=!1){const o=n.length;if(!o)return;t.x=t.y=1;let u,c;for(let d=0;d<o;d++){u=n[d],c=u.projectionDelta;const{visualElement:h}=u.options;h&&h.props.style&&h.props.style.display==="contents"||(s&&u.options.layoutScroll&&u.scroll&&u!==u.root&&uo(e,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),c&&(t.x*=c.x.scale,t.y*=c.y.scale,gR(e,c)),s&&Zs(u.latestValues)&&uo(e,u.latestValues))}t.x<F1&&t.x>H1&&(t.x=1),t.y<F1&&t.y>H1&&(t.y=1)}function lo(e,t){e.min=e.min+t,e.max=e.max+t}function G1(e,t,n,s,o=.5){const u=it(e.min,e.max,o);cm(e,t,n,u,s)}function uo(e,t){G1(e.x,t.x,t.scaleX,t.scale,t.originX),G1(e.y,t.y,t.scaleY,t.scale,t.originY)}function bR(e,t){return hR(sU(e.getBoundingClientRect(),t))}function dU(e,t,n){const s=bR(e,n),{scroll:o}=t;return o&&(lo(s.x,o.offset.x),lo(s.y,o.offset.y)),s}const vR=({current:e})=>e?e.ownerDocument.defaultView:null,Y1=(e,t)=>Math.abs(e-t);function hU(e,t){const n=Y1(e.x,t.x),s=Y1(e.y,t.y);return Math.sqrt(n**2+s**2)}class SR{constructor(t,n,{transformPagePoint:s,contextWindow:o,dragSnapToOrigin:u=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=sp(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,S=hU(g.offset,{x:0,y:0})>=3;if(!v&&!S)return;const{point:A}=g,{timestamp:E}=Ut;this.history.push({...A,timestamp:E});const{onStart:_,onMove:D}=this.handlers;v||(_&&_(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),D&&D(this.lastMoveEvent,g)},this.handlePointerMove=(g,v)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=ip(v,this.transformPagePoint),st.update(this.updatePoint,!0)},this.handlePointerUp=(g,v)=>{this.end();const{onEnd:S,onSessionEnd:A,resumeAnimation:E}=this.handlers;if(this.dragSnapToOrigin&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const _=sp(g.type==="pointercancel"?this.lastMoveEventInfo:ip(v,this.transformPagePoint),this.history);this.startEvent&&S&&S(g,_),A&&A(g,_)},!By(t))return;this.dragSnapToOrigin=u,this.handlers=n,this.transformPagePoint=s,this.contextWindow=o||window;const c=Sl(t),d=ip(c,this.transformPagePoint),{point:h}=d,{timestamp:p}=Ut;this.history=[{...h,timestamp:p}];const{onSessionStart:y}=n;y&&y(t,sp(d,this.history)),this.removeListeners=bl(Ha(this.contextWindow,"pointermove",this.handlePointerMove),Ha(this.contextWindow,"pointerup",this.handlePointerUp),Ha(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),As(this.updatePoint)}}function ip(e,t){return t?{point:t(e.point)}:e}function X1(e,t){return{x:e.x-t.x,y:e.y-t.y}}function sp({point:e},t){return{point:e,delta:X1(e,wR(t)),offset:X1(e,pU(t)),velocity:mU(t,.1)}}function pU(e){return e[0]}function wR(e){return e[e.length-1]}function mU(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,s=null;const o=wR(e);for(;n>=0&&(s=e[n],!(o.timestamp-s.timestamp>oi(t)));)n--;if(!s)return{x:0,y:0};const u=ai(o.timestamp-s.timestamp);if(u===0)return{x:0,y:0};const c={x:(o.x-s.x)/u,y:(o.y-s.y)/u};return c.x===1/0&&(c.x=0),c.y===1/0&&(c.y=0),c}function yU(e,{min:t,max:n},s){return t!==void 0&&e<t?e=s?it(t,e,s.min):Math.max(e,t):n!==void 0&&e>n&&(e=s?it(n,e,s.max):Math.min(e,n)),e}function Z1(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function gU(e,{top:t,left:n,bottom:s,right:o}){return{x:Z1(e.x,n,o),y:Z1(e.y,t,s)}}function J1(e,t){let n=t.min-e.min,s=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,s]=[s,n]),{min:n,max:s}}function bU(e,t){return{x:J1(e.x,t.x),y:J1(e.y,t.y)}}function vU(e,t){let n=.5;const s=Jt(e),o=Jt(t);return o>s?n=sl(t.min,t.max-s,e.min):s>o&&(n=sl(e.min,e.max-o,t.min)),Pi(0,1,n)}function SU(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const fm=.35;function wU(e=fm){return e===!1?e=0:e===!0&&(e=fm),{x:Q1(e,"left","right"),y:Q1(e,"top","bottom")}}function Q1(e,t,n){return{min:W1(e,t),max:W1(e,n)}}function W1(e,t){return typeof e=="number"?e:e[t]||0}const Pn={x:!1,y:!1};function xR(){return Pn.x||Pn.y}function xU(e){return e==="x"||e==="y"?Pn[e]?null:(Pn[e]=!0,()=>{Pn[e]=!1}):Pn.x||Pn.y?null:(Pn.x=Pn.y=!0,()=>{Pn.x=Pn.y=!1})}const AU=new WeakMap;class TU{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ht(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const o=y=>{const{dragSnapToOrigin:g}=this.getProps();g?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Sl(y).point)},u=(y,g)=>{const{drag:v,dragPropagation:S,onDragStart:A}=this.getProps();if(v&&!S&&(this.openDragLock&&this.openDragLock(),this.openDragLock=xU(v),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Nn(_=>{let D=this.getAxisMotionValue(_).get()||0;if(ri.test(D)){const{projection:$}=this.visualElement;if($&&$.layout){const M=$.layout.layoutBox[_];M&&(D=Jt(M)*(parseFloat(D)/100))}}this.originPoint[_]=D}),A&&st.postRender(()=>A(y,g)),Zp(this.visualElement,"transform");const{animationState:E}=this.visualElement;E&&E.setActive("whileDrag",!0)},c=(y,g)=>{const{dragPropagation:v,dragDirectionLock:S,onDirectionLock:A,onDrag:E}=this.getProps();if(!v&&!this.openDragLock)return;const{offset:_}=g;if(S&&this.currentDirection===null){this.currentDirection=EU(_),this.currentDirection!==null&&A&&A(this.currentDirection);return}this.updateAxis("x",g.point,_),this.updateAxis("y",g.point,_),this.visualElement.render(),E&&E(y,g)},d=(y,g)=>this.stop(y,g),h=()=>Nn(y=>{var g;return this.getAnimationState(y)==="paused"&&((g=this.getAxisMotionValue(y).animation)==null?void 0:g.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new SR(t,{onSessionStart:o,onStart:u,onMove:c,onSessionEnd:d,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:vR(this.visualElement)})}stop(t,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:u}=this.getProps();u&&st.postRender(()=>u(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,s){const{drag:o}=this.getProps();if(!s||!Gu(t,o,this.currentDirection))return;const u=this.getAxisMotionValue(t);let c=this.originPoint[t]+s[t];this.constraints&&this.constraints[t]&&(c=yU(c,this.constraints[t],this.elastic[t])),u.set(c)}resolveConstraints(){var u;const{dragConstraints:t,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(u=this.visualElement.projection)==null?void 0:u.layout,o=this.constraints;t&&ro(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&s?this.constraints=gU(s.layoutBox,t):this.constraints=!1,this.elastic=wU(n),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Nn(c=>{this.constraints!==!1&&this.getAxisMotionValue(c)&&(this.constraints[c]=SU(s.layoutBox[c],this.constraints[c]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ro(t))return!1;const s=t.current,{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const u=dU(s,o.root,this.visualElement.getTransformPagePoint());let c=bU(o.layout.layoutBox,u);if(n){const d=n(iU(c));this.hasMutatedConstraints=!!d,d&&(c=hR(d))}return c}startAnimation(t){const{drag:n,dragMomentum:s,dragElastic:o,dragTransition:u,dragSnapToOrigin:c,onDragTransitionEnd:d}=this.getProps(),h=this.constraints||{},p=Nn(y=>{if(!Gu(y,n,this.currentDirection))return;let g=h&&h[y]||{};c&&(g={min:0,max:0});const v=o?200:1e6,S=o?40:1e7,A={type:"inertia",velocity:s?t[y]:0,bounceStiffness:v,bounceDamping:S,timeConstant:750,restDelta:1,restSpeed:10,...u,...g};return this.startAxisValueAnimation(y,A)});return Promise.all(p).then(d)}startAxisValueAnimation(t,n){const s=this.getAxisMotionValue(t);return Zp(this.visualElement,t),s.start($y(t,s,0,n,this.visualElement,!1))}stopAnimation(){Nn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Nn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps(),o=s[n];return o||this.visualElement.getValue(t,(s.initial?s.initial[t]:void 0)||0)}snapToCursor(t){Nn(n=>{const{drag:s}=this.getProps();if(!Gu(n,s,this.currentDirection))return;const{projection:o}=this.visualElement,u=this.getAxisMotionValue(n);if(o&&o.layout){const{min:c,max:d}=o.layout.layoutBox[n];u.set(t[n]-it(c,d,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!ro(n)||!s||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Nn(c=>{const d=this.getAxisMotionValue(c);if(d&&this.constraints!==!1){const h=d.get();o[c]=vU({min:h,max:h},this.constraints[c])}});const{transformTemplate:u}=this.visualElement.getProps();this.visualElement.current.style.transform=u?u({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Nn(c=>{if(!Gu(c,t,null))return;const d=this.getAxisMotionValue(c),{min:h,max:p}=this.constraints[c];d.set(it(h,p,o[c]))})}addListeners(){if(!this.visualElement.current)return;AU.set(this.visualElement,this);const t=this.visualElement.current,n=Ha(t,"pointerdown",h=>{const{drag:p,dragListener:y=!0}=this.getProps();p&&y&&this.start(h)}),s=()=>{const{dragConstraints:h}=this.getProps();ro(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,u=o.addEventListener("measure",s);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),st.read(s);const c=rl(window,"resize",()=>this.scalePositionWithinConstraints()),d=o.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(Nn(y=>{const g=this.getAxisMotionValue(y);g&&(this.originPoint[y]+=h[y].translate,g.set(g.get()+h[y].translate))}),this.visualElement.render())});return()=>{c(),n(),u(),d&&d()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:o=!1,dragConstraints:u=!1,dragElastic:c=fm,dragMomentum:d=!0}=t;return{...t,drag:n,dragDirectionLock:s,dragPropagation:o,dragConstraints:u,dragElastic:c,dragMomentum:d}}}function Gu(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function EU(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class RU extends Rs{constructor(t){super(t),this.removeGroupControls=Vn,this.removeListeners=Vn,this.controls=new TU(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Vn}unmount(){this.removeGroupControls(),this.removeListeners()}}const ew=e=>(t,n)=>{e&&st.postRender(()=>e(t,n))};class OU extends Rs{constructor(){super(...arguments),this.removePointerDownListener=Vn}onPointerDown(t){this.session=new SR(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:vR(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:s,onPanEnd:o}=this.node.getProps();return{onSessionStart:ew(t),onStart:ew(n),onMove:s,onEnd:(u,c)=>{delete this.session,o&&st.postRender(()=>o(u,c))}}}mount(){this.removePointerDownListener=Ha(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const rc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function tw(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const La={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(he.test(e))e=parseFloat(e);else return e;const n=tw(e,t.target.x),s=tw(e,t.target.y);return`${n}% ${s}%`}},MU={correct:(e,{treeScale:t,projectionDelta:n})=>{const s=e,o=Ts.parse(e);if(o.length>5)return s;const u=Ts.createTransformer(e),c=typeof o[0]!="number"?1:0,d=n.x.scale*t.x,h=n.y.scale*t.y;o[0+c]/=d,o[1+c]/=h;const p=it(d,h,.5);return typeof o[2+c]=="number"&&(o[2+c]/=p),typeof o[3+c]=="number"&&(o[3+c]/=p),u(o)}};class _U extends V.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s,layoutId:o}=this.props,{projection:u}=t;q4(CU),u&&(n.group&&n.group.add(u),s&&s.register&&o&&s.register(u),u.root.didUpdate(),u.addEventListener("animationComplete",()=>{this.safeToRemove()}),u.setOptions({...u.options,onExitComplete:()=>this.safeToRemove()})),rc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:s,drag:o,isPresent:u}=this.props,{projection:c}=s;return c&&(c.isPresent=u,o||t.layoutDependency!==n||n===void 0||t.isPresent!==u?c.willUpdate():this.safeToRemove(),t.isPresent!==u&&(u?c.promote():c.relegate()||st.postRender(()=>{const d=c.getStack();(!d||!d.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),uy.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),s&&s.deregister&&s.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function AR(e){const[t,n]=S4(),s=V.useContext(mE);return Y.jsx(_U,{...e,layoutGroup:s,switchLayoutGroup:V.useContext(TE),isPresent:t,safeToRemove:n})}const CU={borderRadius:{...La,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:La,borderTopRightRadius:La,borderBottomLeftRadius:La,borderBottomRightRadius:La,boxShadow:MU};function kU(e,t,n){const s=Ft(e)?e:Oo(e);return s.start($y("",s,t,n)),s.animation}const DU=(e,t)=>e.depth-t.depth;class NU{constructor(){this.children=[],this.isDirty=!1}add(t){vy(this.children,t),this.isDirty=!0}remove(t){Sy(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(DU),this.isDirty=!1,this.children.forEach(t)}}function $U(e,t){const n=ln.now(),s=({timestamp:o})=>{const u=o-n;u>=t&&(As(s),e(u-t))};return st.setup(s,!0),()=>As(s)}const TR=["TopLeft","TopRight","BottomLeft","BottomRight"],BU=TR.length,nw=e=>typeof e=="string"?parseFloat(e):e,iw=e=>typeof e=="number"||he.test(e);function LU(e,t,n,s,o,u){o?(e.opacity=it(0,n.opacity??1,VU(s)),e.opacityExit=it(t.opacity??1,0,jU(s))):u&&(e.opacity=it(t.opacity??1,n.opacity??1,s));for(let c=0;c<BU;c++){const d=`border${TR[c]}Radius`;let h=sw(t,d),p=sw(n,d);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||iw(h)===iw(p)?(e[d]=Math.max(it(nw(h),nw(p),s),0),(ri.test(p)||ri.test(h))&&(e[d]+="%")):e[d]=p}(t.rotate||n.rotate)&&(e.rotate=it(t.rotate||0,n.rotate||0,s))}function sw(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const VU=ER(0,.5,WE),jU=ER(.5,.95,Vn);function ER(e,t,n){return s=>s<e?0:s>t?1:n(sl(e,t,s))}function rw(e,t){e.min=t.min,e.max=t.max}function Dn(e,t){rw(e.x,t.x),rw(e.y,t.y)}function ow(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function aw(e,t,n,s,o){return e-=t,e=Dc(e,1/n,s),o!==void 0&&(e=Dc(e,1/o,s)),e}function zU(e,t=0,n=1,s=.5,o,u=e,c=e){if(ri.test(t)&&(t=parseFloat(t),t=it(c.min,c.max,t/100)-c.min),typeof t!="number")return;let d=it(u.min,u.max,s);e===u&&(d-=t),e.min=aw(e.min,t,n,d,o),e.max=aw(e.max,t,n,d,o)}function lw(e,t,[n,s,o],u,c){zU(e,t[n],t[s],t[o],t.scale,u,c)}const UU=["x","scaleX","originX"],qU=["y","scaleY","originY"];function uw(e,t,n,s){lw(e.x,t,UU,n?n.x:void 0,s?s.x:void 0),lw(e.y,t,qU,n?n.y:void 0,s?s.y:void 0)}function cw(e){return e.translate===0&&e.scale===1}function RR(e){return cw(e.x)&&cw(e.y)}function fw(e,t){return e.min===t.min&&e.max===t.max}function KU(e,t){return fw(e.x,t.x)&&fw(e.y,t.y)}function dw(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function OR(e,t){return dw(e.x,t.x)&&dw(e.y,t.y)}function hw(e){return Jt(e.x)/Jt(e.y)}function pw(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class PU{constructor(){this.members=[]}add(t){vy(this.members,t),t.scheduleRender()}remove(t){if(Sy(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let s;for(let o=n;o>=0;o--){const u=this.members[o];if(u.isPresent!==!1){s=u;break}}return s?(this.promote(s),!0):!1}promote(t,n){const s=this.lead;if(t!==s&&(this.prevLead=s,this.lead=t,t.show(),s)){s.instance&&s.scheduleRender(),t.scheduleRender(),t.resumeFrom=s,n&&(t.resumeFrom.preserveOpacity=!0),s.snapshot&&(t.snapshot=s.snapshot,t.snapshot.latestValues=s.animationValues||s.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:s}=t;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function IU(e,t,n){let s="";const o=e.x.translate/t.x,u=e.y.translate/t.y,c=(n==null?void 0:n.z)||0;if((o||u||c)&&(s=`translate3d(${o}px, ${u}px, ${c}px) `),(t.x!==1||t.y!==1)&&(s+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:p,rotate:y,rotateX:g,rotateY:v,skewX:S,skewY:A}=n;p&&(s=`perspective(${p}px) ${s}`),y&&(s+=`rotate(${y}deg) `),g&&(s+=`rotateX(${g}deg) `),v&&(s+=`rotateY(${v}deg) `),S&&(s+=`skewX(${S}deg) `),A&&(s+=`skewY(${A}deg) `)}const d=e.x.scale*t.x,h=e.y.scale*t.y;return(d!==1||h!==1)&&(s+=`scale(${d}, ${h})`),s||"none"}function MR(e){return gE(e)&&"ownerSVGElement"in e}function HU(e){return MR(e)&&e.tagName==="svg"}const rp=["","X","Y","Z"],FU={visibility:"hidden"},GU=1e3;let YU=0;function op(e,t,n,s){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),s&&(s[e]=0))}function _R(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=LE(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:u}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",st,!(o||u))}const{parent:s}=e;s&&!s.hasCheckedOptimisedAppear&&_R(s)}function CR({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:s,resetTransform:o}){return class{constructor(c={},d=t==null?void 0:t()){this.id=YU++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(JU),this.nodes.forEach(nq),this.nodes.forEach(iq),this.nodes.forEach(QU)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=c,this.root=d?d.root||d:this,this.path=d?[...d.path,d]:[],this.parent=d,this.depth=d?d.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new NU)}addEventListener(c,d){return this.eventHandlers.has(c)||this.eventHandlers.set(c,new wy),this.eventHandlers.get(c).add(d)}notifyListeners(c,...d){const h=this.eventHandlers.get(c);h&&h.notify(...d)}hasListeners(c){return this.eventHandlers.has(c)}mount(c){if(this.instance)return;this.isSVG=MR(c)&&!HU(c),this.instance=c;const{layoutId:d,layout:h,visualElement:p}=this.options;if(p&&!p.current&&p.mount(c),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(h||d)&&(this.isLayoutDirty=!0),e){let y;const g=()=>this.root.updateBlockedByResize=!1;e(c,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=$U(g,250),rc.hasAnimatedSinceResize&&(rc.hasAnimatedSinceResize=!1,this.nodes.forEach(yw))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||h)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:g,hasRelativeLayoutChanged:v,layout:S})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const A=this.options.transition||p.getDefaultTransition()||lq,{onLayoutAnimationStart:E,onLayoutAnimationComplete:_}=p.getProps(),D=!this.targetLayout||!OR(this.targetLayout,S),$=!g&&v;if(this.options.layoutRoot||this.resumeFrom||$||g&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const M={...xy(A,"layout"),onPlay:E,onComplete:_};(p.shouldReduceMotion||this.options.layoutRoot)&&(M.delay=0,M.type=!1),this.startAnimation(M),this.setAnimationOrigin(y,$)}else g||yw(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=S})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const c=this.getStack();c&&c.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),As(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(sq),this.animationId++)}getTransformTemplate(){const{visualElement:c}=this.options;return c&&c.getProps().transformTemplate}willUpdate(c=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&_R(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let y=0;y<this.path.length;y++){const g=this.path[y];g.shouldResetTransform=!0,g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:d,layout:h}=this.options;if(d===void 0&&!h)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),c&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(mw);return}this.isUpdating||this.nodes.forEach(eq),this.isUpdating=!1,this.nodes.forEach(tq),this.nodes.forEach(XU),this.nodes.forEach(ZU),this.clearAllSnapshots();const d=ln.now();Ut.delta=Pi(0,1e3/60,d-Ut.timestamp),Ut.timestamp=d,Ut.isProcessing=!0,Qh.update.process(Ut),Qh.preRender.process(Ut),Qh.render.process(Ut),Ut.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(WU),this.sharedNodes.forEach(rq)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,st.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){st.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Jt(this.snapshot.measuredBox.x)&&!Jt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const c=this.layout;this.layout=this.measure(!1),this.layoutCorrected=ht(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:d}=this.options;d&&d.notify("LayoutMeasure",this.layout.layoutBox,c?c.layoutBox:void 0)}updateScroll(c="measure"){let d=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===c&&(d=!1),d&&this.instance){const h=s(this.instance);this.scroll={animationId:this.root.animationId,phase:c,isRoot:h,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!o)return;const c=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,d=this.projectionDelta&&!RR(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,y=p!==this.prevTransformTemplateValue;c&&this.instance&&(d||Zs(this.latestValues)||y)&&(o(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(c=!0){const d=this.measurePageBox();let h=this.removeElementScroll(d);return c&&(h=this.removeTransform(h)),uq(h),{animationId:this.root.animationId,measuredBox:d,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var p;const{visualElement:c}=this.options;if(!c)return ht();const d=c.measureViewportBox();if(!(((p=this.scroll)==null?void 0:p.wasRoot)||this.path.some(cq))){const{scroll:y}=this.root;y&&(lo(d.x,y.offset.x),lo(d.y,y.offset.y))}return d}removeElementScroll(c){var h;const d=ht();if(Dn(d,c),(h=this.scroll)!=null&&h.wasRoot)return d;for(let p=0;p<this.path.length;p++){const y=this.path[p],{scroll:g,options:v}=y;y!==this.root&&g&&v.layoutScroll&&(g.wasRoot&&Dn(d,c),lo(d.x,g.offset.x),lo(d.y,g.offset.y))}return d}applyTransform(c,d=!1){const h=ht();Dn(h,c);for(let p=0;p<this.path.length;p++){const y=this.path[p];!d&&y.options.layoutScroll&&y.scroll&&y!==y.root&&uo(h,{x:-y.scroll.offset.x,y:-y.scroll.offset.y}),Zs(y.latestValues)&&uo(h,y.latestValues)}return Zs(this.latestValues)&&uo(h,this.latestValues),h}removeTransform(c){const d=ht();Dn(d,c);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!Zs(p.latestValues))continue;um(p.latestValues)&&p.updateSnapshot();const y=ht(),g=p.measurePageBox();Dn(y,g),uw(d,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,y)}return Zs(this.latestValues)&&uw(d,this.latestValues),d}setTargetDelta(c){this.targetDelta=c,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(c){this.options={...this.options,...c,crossfade:c.crossfade!==void 0?c.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ut.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(c=!1){var v;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const h=!!this.resumingFrom||this!==d;if(!(c||h&&this.isSharedProjectionDirty||this.isProjectionDirty||(v=this.parent)!=null&&v.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:g}=this.options;if(!(!this.layout||!(y||g))){if(this.resolvedRelativeTargetAt=Ut.timestamp,!this.targetDelta&&!this.relativeTarget){const S=this.getClosestProjectingParent();S&&S.layout&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ht(),this.relativeTargetOrigin=ht(),Ga(this.relativeTargetOrigin,this.layout.layoutBox,S.layout.layoutBox),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=ht(),this.targetWithTransforms=ht()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),cU(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Dn(this.target,this.layout.layoutBox),gR(this.target,this.targetDelta)):Dn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const S=this.getClosestProjectingParent();S&&!!S.resumingFrom==!!this.resumingFrom&&!S.options.layoutScroll&&S.target&&this.animationProgress!==1?(this.relativeParent=S,this.forceRelativeParentToResolveTarget(),this.relativeTarget=ht(),this.relativeTargetOrigin=ht(),Ga(this.relativeTargetOrigin,this.target,S.target),Dn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||um(this.parent.latestValues)||yR(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var A;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let h=!0;if((this.isProjectionDirty||(A=this.parent)!=null&&A.isProjectionDirty)&&(h=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(h=!1),this.resolvedRelativeTargetAt===Ut.timestamp&&(h=!1),h)return;const{layout:p,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||y))return;Dn(this.layoutCorrected,this.layout.layoutBox);const g=this.treeScale.x,v=this.treeScale.y;fU(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=ht());const{target:S}=c;if(!S){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(ow(this.prevProjectionDelta.x,this.projectionDelta.x),ow(this.prevProjectionDelta.y,this.projectionDelta.y)),Fa(this.projectionDelta,this.layoutCorrected,S,this.latestValues),(this.treeScale.x!==g||this.treeScale.y!==v||!pw(this.projectionDelta.x,this.prevProjectionDelta.x)||!pw(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",S))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(c=!0){var d;if((d=this.options.visualElement)==null||d.scheduleRender(),c){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ao(),this.projectionDelta=ao(),this.projectionDeltaWithTransform=ao()}setAnimationOrigin(c,d=!1){const h=this.snapshot,p=h?h.latestValues:{},y={...this.latestValues},g=ao();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!d;const v=ht(),S=h?h.source:void 0,A=this.layout?this.layout.source:void 0,E=S!==A,_=this.getStack(),D=!_||_.members.length<=1,$=!!(E&&!D&&this.options.crossfade===!0&&!this.path.some(aq));this.animationProgress=0;let M;this.mixTargetDelta=H=>{const z=H/1e3;gw(g.x,c.x,z),gw(g.y,c.y,z),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ga(v,this.layout.layoutBox,this.relativeParent.layout.layoutBox),oq(this.relativeTarget,this.relativeTargetOrigin,v,z),M&&KU(this.relativeTarget,M)&&(this.isProjectionDirty=!1),M||(M=ht()),Dn(M,this.relativeTarget)),E&&(this.animationValues=y,LU(y,p,this.latestValues,z,$,D)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=z},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(c){var d,h,p;this.notifyListeners("animationStart"),(d=this.currentAnimation)==null||d.stop(),(p=(h=this.resumingFrom)==null?void 0:h.currentAnimation)==null||p.stop(),this.pendingAnimation&&(As(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=st.update(()=>{rc.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Oo(0)),this.currentAnimation=kU(this.motionValue,[0,1e3],{...c,isSync:!0,onUpdate:y=>{this.mixTargetDelta(y),c.onUpdate&&c.onUpdate(y)},onStop:()=>{},onComplete:()=>{c.onComplete&&c.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const c=this.getStack();c&&c.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(GU),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const c=this.getLead();let{targetWithTransforms:d,target:h,layout:p,latestValues:y}=c;if(!(!d||!h||!p)){if(this!==c&&this.layout&&p&&kR(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||ht();const g=Jt(this.layout.layoutBox.x);h.x.min=c.target.x.min,h.x.max=h.x.min+g;const v=Jt(this.layout.layoutBox.y);h.y.min=c.target.y.min,h.y.max=h.y.min+v}Dn(d,h),uo(d,y),Fa(this.projectionDeltaWithTransform,this.layoutCorrected,d,y)}}registerSharedNode(c,d){this.sharedNodes.has(c)||this.sharedNodes.set(c,new PU),this.sharedNodes.get(c).add(d);const p=d.options.initialPromotionConfig;d.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(d):void 0})}isLead(){const c=this.getStack();return c?c.lead===this:!0}getLead(){var d;const{layoutId:c}=this.options;return c?((d=this.getStack())==null?void 0:d.lead)||this:this}getPrevLead(){var d;const{layoutId:c}=this.options;return c?(d=this.getStack())==null?void 0:d.prevLead:void 0}getStack(){const{layoutId:c}=this.options;if(c)return this.root.sharedNodes.get(c)}promote({needsReset:c,transition:d,preserveFollowOpacity:h}={}){const p=this.getStack();p&&p.promote(this,h),c&&(this.projectionDelta=void 0,this.needsReset=!0),d&&this.setOptions({transition:d})}relegate(){const c=this.getStack();return c?c.relegate(this):!1}resetSkewAndRotation(){const{visualElement:c}=this.options;if(!c)return;let d=!1;const{latestValues:h}=c;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(d=!0),!d)return;const p={};h.z&&op("z",c,p,this.animationValues);for(let y=0;y<rp.length;y++)op(`rotate${rp[y]}`,c,p,this.animationValues),op(`skew${rp[y]}`,c,p,this.animationValues);c.render();for(const y in p)c.setStaticValue(y,p[y]),this.animationValues&&(this.animationValues[y]=p[y]);c.scheduleRender()}getProjectionStyles(c){if(!this.instance||this.isSVG)return;if(!this.isVisible)return FU;const d={visibility:""},h=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=ic(c==null?void 0:c.pointerEvents)||"",d.transform=h?h(this.latestValues,""):"none",d;const p=this.getLead();if(!this.projectionDelta||!this.layout||!p.target){const S={};return this.options.layoutId&&(S.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,S.pointerEvents=ic(c==null?void 0:c.pointerEvents)||""),this.hasProjected&&!Zs(this.latestValues)&&(S.transform=h?h({},""):"none",this.hasProjected=!1),S}const y=p.animationValues||p.latestValues;this.applyTransformsToTarget(),d.transform=IU(this.projectionDeltaWithTransform,this.treeScale,y),h&&(d.transform=h(y,d.transform));const{x:g,y:v}=this.projectionDelta;d.transformOrigin=`${g.origin*100}% ${v.origin*100}% 0`,p.animationValues?d.opacity=p===this?y.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:d.opacity=p===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const S in el){if(y[S]===void 0)continue;const{correct:A,applyTo:E,isCSSVariable:_}=el[S],D=d.transform==="none"?y[S]:A(y[S],p);if(E){const $=E.length;for(let M=0;M<$;M++)d[E[M]]=D}else _?this.options.visualElement.renderState.vars[S]=D:d[S]=D}return this.options.layoutId&&(d.pointerEvents=p===this?ic(c==null?void 0:c.pointerEvents)||"":"none"),d}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(c=>{var d;return(d=c.currentAnimation)==null?void 0:d.stop()}),this.root.nodes.forEach(mw),this.root.sharedNodes.clear()}}}function XU(e){e.updateLayout()}function ZU(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:s,measuredBox:o}=e.layout,{animationType:u}=e.options,c=t.source!==e.layout.source;u==="size"?Nn(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Jt(v);v.min=s[g].min,v.max=v.min+S}):kR(u,t.layoutBox,s)&&Nn(g=>{const v=c?t.measuredBox[g]:t.layoutBox[g],S=Jt(s[g]);v.max=v.min+S,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+S)});const d=ao();Fa(d,s,t.layoutBox);const h=ao();c?Fa(h,e.applyTransform(o,!0),t.measuredBox):Fa(h,s,t.layoutBox);const p=!RR(d);let y=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:v,layout:S}=g;if(v&&S){const A=ht();Ga(A,t.layoutBox,v.layoutBox);const E=ht();Ga(E,s,S.layoutBox),OR(A,E)||(y=!0),g.options.layoutRoot&&(e.relativeTarget=E,e.relativeTargetOrigin=A,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:s,snapshot:t,delta:h,layoutDelta:d,hasLayoutChanged:p,hasRelativeLayoutChanged:y})}else if(e.isLead()){const{onExitComplete:s}=e.options;s&&s()}e.options.transition=void 0}function JU(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function QU(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function WU(e){e.clearSnapshot()}function mw(e){e.clearMeasurements()}function eq(e){e.isLayoutDirty=!1}function tq(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function yw(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function nq(e){e.resolveTargetDelta()}function iq(e){e.calcProjection()}function sq(e){e.resetSkewAndRotation()}function rq(e){e.removeLeadSnapshot()}function gw(e,t,n){e.translate=it(t.translate,0,n),e.scale=it(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function bw(e,t,n,s){e.min=it(t.min,n.min,s),e.max=it(t.max,n.max,s)}function oq(e,t,n,s){bw(e.x,t.x,n.x,s),bw(e.y,t.y,n.y,s)}function aq(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const lq={duration:.45,ease:[.4,0,.1,1]},vw=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Sw=vw("applewebkit/")&&!vw("chrome/")?Math.round:Vn;function ww(e){e.min=Sw(e.min),e.max=Sw(e.max)}function uq(e){ww(e.x),ww(e.y)}function kR(e,t,n){return e==="position"||e==="preserve-aspect"&&!uU(hw(t),hw(n),.2)}function cq(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const fq=CR({attachResizeListener:(e,t)=>rl(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ap={current:void 0},DR=CR({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!ap.current){const e=new fq({});e.mount(window),e.setOptions({layoutScroll:!0}),ap.current=e}return ap.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),dq={pan:{Feature:OU},drag:{Feature:RU,ProjectionNode:DR,MeasureLayout:AR}};function hq(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let s=document;const o=(n==null?void 0:n[e])??s.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function NR(e,t){const n=hq(e),s=new AbortController,o={passive:!0,...t,signal:s.signal};return[n,o,()=>s.abort()]}function xw(e){return!(e.pointerType==="touch"||xR())}function pq(e,t,n={}){const[s,o,u]=NR(e,n),c=d=>{if(!xw(d))return;const{target:h}=d,p=t(h,d);if(typeof p!="function"||!h)return;const y=g=>{xw(g)&&(p(g),h.removeEventListener("pointerleave",y))};h.addEventListener("pointerleave",y,o)};return s.forEach(d=>{d.addEventListener("pointerenter",c,o)}),u}function Aw(e,t,n){const{props:s}=e;e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,u=s[o];u&&st.postRender(()=>u(t,Sl(t)))}class mq extends Rs{mount(){const{current:t}=this.node;t&&(this.unmount=pq(t,(n,s)=>(Aw(this.node,s,"Start"),o=>Aw(this.node,o,"End"))))}unmount(){}}class yq extends Rs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=bl(rl(this.node.current,"focus",()=>this.onFocus()),rl(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}const $R=(e,t)=>t?e===t?!0:$R(e,t.parentElement):!1,gq=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function bq(e){return gq.has(e.tagName)||e.tabIndex!==-1}const oc=new WeakSet;function Tw(e){return t=>{t.key==="Enter"&&e(t)}}function lp(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const vq=(e,t)=>{const n=e.currentTarget;if(!n)return;const s=Tw(()=>{if(oc.has(n))return;lp(n,"down");const o=Tw(()=>{lp(n,"up")}),u=()=>lp(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",u,t)});n.addEventListener("keydown",s,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),t)};function Ew(e){return By(e)&&!xR()}function Sq(e,t,n={}){const[s,o,u]=NR(e,n),c=d=>{const h=d.currentTarget;if(!Ew(d))return;oc.add(h);const p=t(h,d),y=(S,A)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",v),oc.has(h)&&oc.delete(h),Ew(S)&&typeof p=="function"&&p(S,{success:A})},g=S=>{y(S,h===window||h===document||n.useGlobalTarget||$R(h,S.target))},v=S=>{y(S,!1)};window.addEventListener("pointerup",g,o),window.addEventListener("pointercancel",v,o)};return s.forEach(d=>{(n.useGlobalTarget?window:d).addEventListener("pointerdown",c,o),bE(d)&&(d.addEventListener("focus",p=>vq(p,o)),!bq(d)&&!d.hasAttribute("tabindex")&&(d.tabIndex=0))}),u}function Rw(e,t,n){const{props:s}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&s.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),u=s[o];u&&st.postRender(()=>u(t,Sl(t)))}class wq extends Rs{mount(){const{current:t}=this.node;t&&(this.unmount=Sq(t,(n,s)=>(Rw(this.node,s,"Start"),(o,{success:u})=>Rw(this.node,o,u?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dm=new WeakMap,up=new WeakMap,xq=e=>{const t=dm.get(e.target);t&&t(e)},Aq=e=>{e.forEach(xq)};function Tq({root:e,...t}){const n=e||document;up.has(n)||up.set(n,{});const s=up.get(n),o=JSON.stringify(t);return s[o]||(s[o]=new IntersectionObserver(Aq,{root:e,...t})),s[o]}function Eq(e,t,n){const s=Tq(t);return dm.set(e,n),s.observe(e),()=>{dm.delete(e),s.unobserve(e)}}const Rq={some:0,all:1};class Oq extends Rs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:s,amount:o="some",once:u}=t,c={root:n?n.current:void 0,rootMargin:s,threshold:typeof o=="number"?o:Rq[o]},d=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,u&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:y,onViewportLeave:g}=this.node.getProps(),v=p?y:g;v&&v(h)};return Eq(this.node.current,c,d)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(Mq(t,n))&&this.startObserver()}unmount(){}}function Mq({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const _q={inView:{Feature:Oq},tap:{Feature:wq},focus:{Feature:yq},hover:{Feature:mq}},Cq={layout:{ProjectionNode:DR,MeasureLayout:AR}},hm={current:null},BR={current:!1};function kq(){if(BR.current=!0,!!sy)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>hm.current=e.matches;e.addListener(t),t()}else hm.current=!1}const Dq=new WeakMap;function Nq(e,t,n){for(const s in t){const o=t[s],u=n[s];if(Ft(o))e.addValue(s,o);else if(Ft(u))e.addValue(s,Oo(o,{owner:e}));else if(u!==o)if(e.hasValue(s)){const c=e.getValue(s);c.liveStyle===!0?c.jump(o):c.hasAnimated||c.set(o)}else{const c=e.getStaticValue(s);e.addValue(s,Oo(c!==void 0?c:o,{owner:e}))}}for(const s in n)t[s]===void 0&&e.removeValue(s);return t}const LR=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),VR=e=>/^0[^.\s]+$/u.test(e),$q={test:e=>e==="auto",parse:e=>e},jR=e=>t=>t.test(e),zR=[Bo,he,ri,gs,P4,K4,$q],Ow=e=>zR.find(jR(e)),Bq=[...zR,Ht,Ts],Lq=e=>Bq.find(jR(e)),Vq=new Set(["brightness","contrast","saturate","opacity"]);function jq(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[s]=n.match(Ay)||[];if(!s)return e;const o=n.replace(s,"");let u=Vq.has(t)?1:0;return s!==n&&(u*=100),t+"("+u+o+")"}const zq=/\b([a-z-]*)\(.*?\)/gu,pm={...Ts,getAnimatableNone:e=>{const t=e.match(zq);return t?t.map(jq).join(" "):e}},Uq={...hy,color:Ht,backgroundColor:Ht,outlineColor:Ht,fill:Ht,stroke:Ht,borderColor:Ht,borderTopColor:Ht,borderRightColor:Ht,borderBottomColor:Ht,borderLeftColor:Ht,filter:pm,WebkitFilter:pm},UR=e=>Uq[e];function qR(e,t){let n=UR(e);return n!==pm&&(n=Ts),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Mw=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class qq{scrapeMotionValuesFromProps(t,n,s){return{}}constructor({parent:t,props:n,presenceContext:s,reducedMotionConfig:o,blockInitialAnimation:u,visualState:c},d={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Dy,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const v=ln.now();this.renderScheduledAt<v&&(this.renderScheduledAt=v,st.render(this.render,!1,!0))};const{latestValues:h,renderState:p}=c;this.latestValues=h,this.baseTarget={...h},this.initialValues=n.initial?{...h}:{},this.renderState=p,this.parent=t,this.props=n,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=d,this.blockInitialAnimation=!!u,this.isControllingVariants=af(n),this.isVariantNode=xE(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:y,...g}=this.scrapeMotionValuesFromProps(n,{},this);for(const v in g){const S=g[v];h[v]!==void 0&&Ft(S)&&S.set(h[v],!1)}}mount(t){this.current=t,Dq.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),BR.current||kq(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:hm.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),As(this.notifyUpdate),As(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=$o.has(t);s&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",d=>{this.latestValues[t]=d,this.props.onUpdate&&st.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),u=n.on("renderRequest",this.scheduleRender);let c;window.MotionCheckAppearSync&&(c=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),u(),c&&c(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ro){const n=Ro[t];if(!n)continue;const{isEnabled:s,Feature:o}=n;if(!this.features[t]&&o&&s(this.props)&&(this.features[t]=new o(this)),this.features[t]){const u=this.features[t];u.isMounted?u.update():(u.mount(),u.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ht()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Mw.length;s++){const o=Mw[s];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const u="on"+o,c=t[u];c&&(this.propEventSubscriptions[o]=this.on(o,c))}this.prevMotionValues=Nq(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const s=this.values.get(t);n!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&n!==void 0&&(s=Oo(n===null?void 0:n,{owner:this}),this.addValue(t,s)),s}readValue(t,n){let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(LR(s)||VR(s))?s=parseFloat(s):!Lq(s)&&Ts.test(n)&&(s=qR(t,n)),this.setBaseTarget(t,Ft(s)?s.get():s)),Ft(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var u;const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const c=gy(this.props,n,(u=this.presenceContext)==null?void 0:u.custom);c&&(s=c[t])}if(n&&s!==void 0)return s;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Ft(o)?o:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new wy),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}const Kq=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Pq(e){const t=Kq.exec(e);if(!t)return[,];const[,n,s,o]=t;return[`--${n??s}`,o]}function KR(e,t,n=1){const[s,o]=Pq(e);if(!s)return;const u=window.getComputedStyle(t).getPropertyValue(s);if(u){const c=u.trim();return LR(c)?parseFloat(c):c}return dy(o)?KR(o,t,n+1):o}function Iq(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||VR(e):!0}const Hq=new Set(["auto","none","0"]);function Fq(e,t,n){let s=0,o;for(;s<e.length&&!o;){const u=e[s];typeof u=="string"&&!Hq.has(u)&&il(u).values.length&&(o=e[s]),s++}if(o&&n)for(const u of t)e[u]=qR(n,o)}class Gq extends Dy{constructor(t,n,s,o,u){super(t,n,s,o,u,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let h=0;h<t.length;h++){let p=t[h];if(typeof p=="string"&&(p=p.trim(),dy(p))){const y=KR(p,n.current);y!==void 0&&(t[h]=y),h===t.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!uR.has(s)||t.length!==2)return;const[o,u]=t,c=Ow(o),d=Ow(u);if(c!==d)if(N1(c)&&N1(d))for(let h=0;h<t.length;h++){const p=t[h];typeof p=="string"&&(t[h]=parseFloat(p))}else rr[s]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,s=[];for(let o=0;o<t.length;o++)(t[o]===null||Iq(t[o]))&&s.push(o);s.length&&Fq(t,s,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=rr[s](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(s,o).jump(o,!1)}measureEndState(){var d;const{element:t,name:n,unresolvedKeyframes:s}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const u=s.length-1,c=s[u];s[u]=rr[n](t.measureViewportBox(),window.getComputedStyle(t.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),(d=this.removedTransforms)!=null&&d.length&&this.removedTransforms.forEach(([h,p])=>{t.getValue(h).set(p)}),this.resolveNoneKeyframes()}}class PR extends qq{constructor(){super(...arguments),this.KeyframeResolver=Gq}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:s}){delete n[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ft(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function IR(e,{style:t,vars:n},s,o){Object.assign(e.style,t,o&&o.getProjectionStyles(s));for(const u in n)e.style.setProperty(u,n[u])}function Yq(e){return window.getComputedStyle(e)}class Xq extends PR{constructor(){super(...arguments),this.type="html",this.renderInstance=IR}readValueFromInstance(t,n){var s;if($o.has(n))return(s=this.projection)!=null&&s.isProjecting?im(n):bz(t,n);{const o=Yq(t),u=(fy(n)?o.getPropertyValue(n):o[n])||0;return typeof u=="string"?u.trim():u}}measureInstanceViewportBox(t,{transformPagePoint:n}){return bR(t,n)}build(t,n,s){py(t,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,n,s){return by(t,n,s)}}const HR=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Zq(e,t,n,s){IR(e,t,void 0,s);for(const o in t.attrs)e.setAttribute(HR.has(o)?o:ly(o),t.attrs[o])}class Jq extends PR{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ht}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if($o.has(n)){const s=UR(n);return s&&s.default||0}return n=HR.has(n)?n:ly(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,s){return $E(t,n,s)}build(t,n,s){CE(t,n,this.isSVGTag,s.transformTemplate,s.style)}renderInstance(t,n,s,o){Zq(t,n,s,o)}mount(t){this.isSVGTag=DE(t.tagName),super.mount(t)}}const Qq=(e,t)=>yy(e)?new Jq(t):new Xq(t,{allowProjection:e!==V.Fragment}),Wq=aj({...tU,..._q,...dq,...Cq},Qq),e6=O4(Wq);function t6(){const e=Hn(Eo),t=Hn(ni),n=Hn(Bi),s=bt(Eo),o=bt(ni),u=bt(Bi),[c,d]=V.useState(null),[h,p]=V.useState("email");return Y.jsx("form",{onSubmit:async y=>{y.preventDefault();const g=Je(ei);try{switch(h){case"email":{const{nextStep:v,userKey:S}=await an.declareAuthTarget.query({email:s});switch(Be(ei,S),v){case"otc_login":case"otc_verify":{p("otc");break}case"password_login":{p("password");break}}break}case"otc":{if(!g){console.error("somehow userKey is null");return}const v=await an.verifyAccountAction.mutate({oneTimeCode:u,userKey:g});Be(nt,v),ci.once("connect",()=>{cr("/game"),e(""),n("")});break}case"password":{const v=await an.openSession.mutate({email:s,password:o});Be(nt,v),ci.once("connect",()=>{cr("/game"),e(""),t("")});break}}}catch(v){v instanceof si&&d(v.message)}},children:Y.jsxs("main",{children:[c?Y.jsx("aside",{children:c}):null,Y.jsxs(e6.label,{htmlFor:"email",children:[Y.jsx("span",{children:"Email"}),Y.jsx("input",{id:"email",type:"text",value:s,onChange:y=>{e(y.target.value)},autoComplete:"email",autoCapitalize:"none",disabled:h!=="email"})]}),h==="password"?Y.jsxs("label",{htmlFor:"password",children:[Y.jsx("span",{children:"Password"}),Y.jsx("input",{id:"password",type:"password",value:o,onChange:y=>{t(y.target.value)},autoComplete:"current-password",autoCapitalize:"none",autoFocus:h==="password"})]}):null,h==="otc"?Y.jsxs("label",{htmlFor:"otc",children:[Y.jsx("span",{children:"One-time Code"}),Y.jsx("input",{id:"otc",type:"otc",value:u,onChange:y=>{n(y.target.value)},autoComplete:"one-time-code",autoCapitalize:"none",autoFocus:h==="otc"})]}):null,Y.jsxs("footer",{children:[h==="password"?Y.jsx("button",{type:"button",onClick:async()=>{const y=Je(ei);if(!y)return new Error("No userKey");await an.startPasswordReset.mutate({userKey:y}),p("otc")},children:"Forgot Password?"}):null,Y.jsx("span",{}),Y.jsx("button",{type:"submit",disabled:!s&&h==="email"||!o&&h==="password"||!u&&h==="otc",children:">>->"})]})]})})}function n6({route:[,e]}){const t=bt(nt),n=bt(Bi),s=Hn(Bi);cp.useState(!1);const[o,u]=cp.useState(null);if(ac(()=>{e&&s(e)}),!t)return Y.jsx("p",{children:"You must be logged in to verify your account."});const{verification:c}=t;return ac(()=>{n&&console.log("verifying token",n)}),Y.jsx("form",{onSubmit:async d=>{d.preventDefault();try{const h=await an.verifyAccountAction.mutate({oneTimeCode:n,userKey:"CHANGEME"});Be(nt,h),h.action==="resetPassword"?cr("/account"):cr("/game")}catch(h){h instanceof si&&u(h.message)}},children:Y.jsxs("main",{children:[Y.jsx("p",{children:"Check your email for a verification code."}),Y.jsxs("label",{htmlFor:"code",children:[Y.jsx("span",{children:"Verification code"}),Y.jsx("input",{id:"code",type:"text",value:n,onChange:d=>{s(d.target.value)},placeholder:"Verification code",autoComplete:"one-time-code",autoCapitalize:"none"})]})]})})}function i6(){const e=bt(cE),t=bt(nt),[n,s]=V.useState(!1),{refs:o,floatingStyles:u,context:c}=mD({open:n,onOpenChange:s,placement:"bottom-end",middleware:[Uk(5),Kk(),qk()],whileElementsMounted:$k}),d=cD(c),h=hD(c),p=bD(c),{getReferenceProps:y,getFloatingProps:g}=yD([d,h,p]),v=bt(i4);return Y.jsxs("main",{className:nL.class,children:[Y.jsxs("header",{children:[Y.jsxs("main",{children:[Y.jsx(tL,{}),Y.jsx("span",{children:Y.jsx(iL,{input:v})})]}),Y.jsx("button",{"data-css":"profile",ref:o.setReference,...y(),children:t!=null&&t.username?t.username.slice(0,2):""}),n&&t&&Y.jsx(lD,{context:c,modal:!1,children:Y.jsxs("div",{"data-css":"profile-actions",ref:o.setFloating,style:u,...g(),children:[Y.jsx("span",{children:t.username}),Y.jsx("button",{type:"button",onClick:()=>{cr("/account")},children:"Account"}),Y.jsx("button",{type:"button",onClick:async()=>{t&&(await an.closeSession.mutate({username:t.username,sessionKey:t.sessionKey}),ci.once("disconnect",()=>{Be(nt,null),cr("/")}),ci.disconnect())},children:"Sign out"})]})})]}),Y.jsx("main",{children:typeof e=="number"?Y.jsxs("article",{children:[Y.jsx("h1",{children:e}),Y.jsx("h2",{children:JSON.parse(LT[e])}),Y.jsx(VT,{href:"/",children:"Return to Home Page"})]}):(()=>{switch(e[0]){case void 0:return Y.jsx(t6,{});case"admin":return Y.jsx(f4,{});case"game":return Y.jsx(m4,{route:e});case"verify":return Y.jsx(n6,{route:e});case"account":return Y.jsx(c4,{})}})()})]})}OC.createRoot(document.getElementById("root")).render(Y.jsx(V.StrictMode,{children:Y.jsx(vC,{socket:ci,children:Y.jsx(i6,{})})}));