From 0ab9c297a5880222f1f8a3e61c659d124a862f94 Mon Sep 17 00:00:00 2001 From: Valerio Ageno <51341197+Valerioageno@users.noreply.github.com> Date: Tue, 28 Jan 2025 19:08:18 +0100 Subject: [PATCH] test: integration test to `tuono_lib` (#425) --- crates/tuono/src/source_builder.rs | 5 +- crates/tuono_lib/Cargo.toml | 4 + crates/tuono_lib/src/lib.rs | 3 +- crates/tuono_lib/src/manifest.rs | 2 +- crates/tuono_lib/src/server.rs | 49 ++++---- .../tests/assets/fake_react_build.js | 84 ++++++++++++++ crates/tuono_lib/tests/main.rs | 1 + crates/tuono_lib/tests/server_test.rs | 105 +++++++++++++++++ crates/tuono_lib/tests/utils/health_check.rs | 7 ++ crates/tuono_lib/tests/utils/mod.rs | 3 + crates/tuono_lib/tests/utils/route.rs | 6 + crates/tuono_lib/tests/utils/utils.rs | 106 ++++++++++++++++++ 12 files changed, 348 insertions(+), 27 deletions(-) create mode 100644 crates/tuono_lib/tests/assets/fake_react_build.js create mode 100644 crates/tuono_lib/tests/main.rs create mode 100644 crates/tuono_lib/tests/server_test.rs create mode 100644 crates/tuono_lib/tests/utils/health_check.rs create mode 100644 crates/tuono_lib/tests/utils/mod.rs create mode 100644 crates/tuono_lib/tests/utils/route.rs create mode 100644 crates/tuono_lib/tests/utils/utils.rs diff --git a/crates/tuono/src/source_builder.rs b/crates/tuono/src/source_builder.rs index c8770d2d..25d09472 100644 --- a/crates/tuono/src/source_builder.rs +++ b/crates/tuono/src/source_builder.rs @@ -35,7 +35,7 @@ pub const AXUM_ENTRY_POINT: &str = r##" // File automatically generated // Do not manually change it -use tuono_lib::{tokio, Mode, Server, axum::Router}; +use tuono_lib::{tokio, Mode, Server, axum::Router, tuono_internal_init_v8_platform}; // AXUM_GET_ROUTE_HANDLER const MODE: Mode = /*MODE*/; @@ -46,6 +46,7 @@ const MODE: Mode = /*MODE*/; #[tokio::main] async fn main() { + tuono_internal_init_v8_platform(); println!("\n ⚡ Tuono v/*VERSION*/"); //MAIN_FILE_DEFINITION// @@ -54,7 +55,7 @@ async fn main() { // ROUTE_BUILDER //MAIN_FILE_USAGE//; - Server::init(router, MODE).start().await + Server::init(router, MODE).await.start().await } "##; diff --git a/crates/tuono_lib/Cargo.toml b/crates/tuono_lib/Cargo.toml index 3c830b4a..04d5016e 100644 --- a/crates/tuono_lib/Cargo.toml +++ b/crates/tuono_lib/Cargo.toml @@ -42,3 +42,7 @@ http = "1.1.0" pin-project = "1.1.7" tower = "0.5.1" +[dev-dependencies] +fs_extra = "1.3.0" +tempfile = "3.14.0" +serial_test = "0.10.0" diff --git a/crates/tuono_lib/src/lib.rs b/crates/tuono_lib/src/lib.rs index 7da4b60e..96ff6996 100644 --- a/crates/tuono_lib/src/lib.rs +++ b/crates/tuono_lib/src/lib.rs @@ -20,10 +20,11 @@ pub use mode::Mode; pub use payload::Payload; pub use request::Request; pub use response::{Props, Response}; -pub use server::Server; +pub use server::{tuono_internal_init_v8_platform, Server}; pub use tuono_lib_macros::{api, handler}; // Re-exports pub use axum; pub use axum_extra::extract::cookie; +pub use ssr_rs::Ssr; pub use tokio; diff --git a/crates/tuono_lib/src/manifest.rs b/crates/tuono_lib/src/manifest.rs index 5e047de8..28e4df61 100644 --- a/crates/tuono_lib/src/manifest.rs +++ b/crates/tuono_lib/src/manifest.rs @@ -29,7 +29,7 @@ pub fn load_manifest() { let file = File::open(PathBuf::from(VITE_MANIFEST_PATH)).unwrap(); let reader = BufReader::new(file); let manifest = serde_json::from_reader(reader).unwrap(); - MANIFEST.set(remap_manifest_keys(manifest)).unwrap(); + let _ = MANIFEST.set(remap_manifest_keys(manifest)); } fn remap_manifest_keys(manifest: HashMap) -> HashMap { diff --git a/crates/tuono_lib/src/server.rs b/crates/tuono_lib/src/server.rs index e6a918af..28e8a0ab 100644 --- a/crates/tuono_lib/src/server.rs +++ b/crates/tuono_lib/src/server.rs @@ -15,41 +15,44 @@ use crate::{ const DEV_PUBLIC_DIR: &str = "public"; const PROD_PUBLIC_DIR: &str = "out/client"; +pub fn tuono_internal_init_v8_platform() { + Ssr::create_platform(); +} + +#[derive(Debug)] pub struct Server { router: Router, mode: Mode, + pub listener: tokio::net::TcpListener, + pub address: String, } impl Server { - pub fn init(router: Router, mode: Mode) -> Server { - Ssr::create_platform(); + pub async fn init(router: Router, mode: Mode) -> Server { + let config = Config::get().expect("[SERVER] Failed to load config"); - GLOBAL_MODE.set(mode).unwrap(); - GLOBAL_CONFIG - .set(Config::get().expect("[SERVER] Failed to load config")) - .unwrap(); + let _ = GLOBAL_MODE.set(mode); + let _ = GLOBAL_CONFIG.set(config.clone()); if mode == Mode::Prod { load_manifest() } - Server { router, mode } + let server_http_address = format!("{}:{}", config.server.host, config.server.port); + + Server { + router, + mode, + address: server_http_address.clone(), + listener: tokio::net::TcpListener::bind(&server_http_address) + .await + .expect("[SERVER] Failed to bind to address"), + } } - pub async fn start(&self) { - let config = GLOBAL_CONFIG - .get() - .expect("Failed to get the internal config"); - - let server_http_address = format!("{}:{}", config.server.host, config.server.port); - let listener = tokio::net::TcpListener::bind(&server_http_address) - .await - .unwrap(); - - let server_url = format!("http://{}", &server_http_address); - + pub async fn start(self) { if self.mode == Mode::Dev { - println!(" Ready at: {}\n", &server_url.blue().bold()); + println!(" Ready at: {}\n", self.address.blue().bold()); let router = self .router .to_owned() @@ -61,11 +64,11 @@ impl Server { .fallback(get(catch_all).layer(LoggerLayer::new())), ); - axum::serve(listener, router) + axum::serve(self.listener, router) .await .expect("Failed to serve development server"); } else { - println!(" Production server at: {}\n", &server_url.blue().bold()); + println!(" Production server at: {}\n", self.address.blue().bold()); let router = self .router .to_owned() @@ -75,7 +78,7 @@ impl Server { .fallback(get(catch_all).layer(LoggerLayer::new())), ); - axum::serve(listener, router) + axum::serve(self.listener, router) .await .expect("Failed to serve production server"); } diff --git a/crates/tuono_lib/tests/assets/fake_react_build.js b/crates/tuono_lib/tests/assets/fake_react_build.js new file mode 100644 index 00000000..5474f6cd --- /dev/null +++ b/crates/tuono_lib/tests/assets/fake_react_build.js @@ -0,0 +1,84 @@ +(function(xa){"use strict";var Oa=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function uh(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wo={exports:{}},jl={};/** + * @license React + * react-jsx-runtime.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var oh=Symbol.for("react.transitional.element"),fh=Symbol.for("react.fragment");function No(e,n,t){var r=null;if(t!==void 0&&(r=""+t),n.key!==void 0&&(r=""+n.key),"key"in n){t={};for(var l in n)l!=="key"&&(t[l]=n[l])}else t=n;return n=t.ref,{$$typeof:oh,type:e,key:r,ref:n!==void 0?n:null,props:t}}jl.Fragment=fh,jl.jsx=No,jl.jsxs=No,Wo.exports=jl;var m=Wo.exports,Ho={exports:{}},B={};/** + * @license React + * react.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Aa=Symbol.for("react.transitional.element"),ch=Symbol.for("react.portal"),sh=Symbol.for("react.fragment"),dh=Symbol.for("react.strict_mode"),hh=Symbol.for("react.profiler"),gh=Symbol.for("react.consumer"),bh=Symbol.for("react.context"),yh=Symbol.for("react.forward_ref"),vh=Symbol.for("react.suspense"),_h=Symbol.for("react.memo"),Uo=Symbol.for("react.lazy"),Yo=Symbol.iterator;function wh(e){return e===null||typeof e!="object"?null:(e=Yo&&e[Yo]||e["@@iterator"],typeof e=="function"?e:null)}var Go={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},Xo=Object.assign,Zo={};function Kt(e,n,t){this.props=e,this.context=n,this.refs=Zo,this.updater=t||Go}Kt.prototype.isReactComponent={},Kt.prototype.setState=function(e,n){if(typeof e!="object"&&typeof e!="function"&&e!=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,e,n,"setState")},Kt.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Jo(){}Jo.prototype=Kt.prototype;function ma(e,n,t){this.props=e,this.context=n,this.refs=Zo,this.updater=t||Go}var Fa=ma.prototype=new Jo;Fa.constructor=ma,Xo(Fa,Kt.prototype),Fa.isPureReactComponent=!0;var Qo=Array.isArray,K={H:null,A:null,T:null,S:null},Vo=Object.prototype.hasOwnProperty;function ka(e,n,t,r,l,i){return t=i.ref,{$$typeof:Aa,type:e,key:n,ref:t!==void 0?t:null,props:i}}function Rh(e,n){return ka(e.type,n,void 0,void 0,void 0,e.props)}function Ia(e){return typeof e=="object"&&e!==null&&e.$$typeof===Aa}function Eh(e){var n={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(t){return n[t]})}var Ko=/\/+/g;function Ma(e,n){return typeof e=="object"&&e!==null&&e.key!=null?Eh(""+e.key):n.toString(36)}function qo(){}function Sh(e){switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:switch(typeof e.status=="string"?e.then(qo,qo):(e.status="pending",e.then(function(n){e.status==="pending"&&(e.status="fulfilled",e.value=n)},function(n){e.status==="pending"&&(e.status="rejected",e.reason=n)})),e.status){case"fulfilled":return e.value;case"rejected":throw e.reason}}throw e}function qt(e,n,t,r,l){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"bigint":case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case Aa:case ch:a=!0;break;case Uo:return a=e._init,qt(a(e._payload),n,t,r,l)}}if(a)return l=l(e),a=r===""?"."+Ma(e,0):r,Qo(l)?(t="",a!=null&&(t=a.replace(Ko,"$&/")+"/"),qt(l,n,t,"",function(f){return f})):l!=null&&(Ia(l)&&(l=Rh(l,t+(l.key==null||e&&e.key===l.key?"":(""+l.key).replace(Ko,"$&/")+"/")+a)),n.push(l)),1;a=0;var u=r===""?".":r+":";if(Qo(e))for(var o=0;o"u",$o=G.createContext({});function Oh(e){if(xh)return{pathname:e.pathname||"",hash:"",href:e.href||"",searchStr:e.searchStr||"",search:{}};const{pathname:n,hash:t,href:r,search:l}=window.location;return{pathname:n,hash:t,href:r,searchStr:l,search:Object.fromEntries(new URLSearchParams(l))}}function Ah({router:e,serverInitialLocation:n,children:t}){e.update({...e.options});const[r,l]=G.useState(()=>Oh(n));G.useEffect(()=>{const a=({target:u})=>{const{location:o}=u,{pathname:f,hash:s,href:c,search:d}=o;l({pathname:f,hash:s,href:c,searchStr:d,search:Object.fromEntries(new URLSearchParams(d))})};return window.addEventListener("popstate",a),()=>{window.removeEventListener("popstate",a)}},[]);const i=G.useMemo(()=>({router:e,location:r,updateLocation:l}),[r,e]);return m.jsx($o.Provider,{value:i,children:t})}function Cr(){return G.useContext($o)}const ef=/\[(.*?)\]/;function mh(e){return e.endsWith("/")&&e!=="/"?e.substring(0,e.length-1):e}function nf(e){var n;const{router:{routesById:t}}=Cr();if(!e)return;if(e=mh(e),t[e])return t[e];const r=Object.keys(t).filter(a=>ef.test(a));if(!r.length)return;const l=e.split("/").filter(Boolean);let i;for(const a of r){const u=a.split("/").filter(Boolean),o=[];for(let f=0;f"u",Ih=async()=>await(await fetch(`/__tuono/data${location.pathname}`)).json();function Mh(e,n){const t=G.useRef(!0),{location:r,updateLocation:l}=Cr(),[i,a]=G.useState(!!e.options.hasHandler&&!kh&&!t.current),[u,o]=G.useState(n);return G.useEffect(()=>{if(t.current){t.current=!1;return}return e.options.hasHandler&&(async()=>{a(!0);try{const f=await Ih();if(f.info.redirect_destination){const s=Fh(f.info.redirect_destination);history.pushState(s.pathname,"",s.pathname),l(s);return}o(f.data)}catch(f){throw Error("Failed loading Server Side Data",{cause:f})}finally{a(!1)}})(),()=>{o(void 0)}},[r.pathname,e.options.hasHandler,l]),{isLoading:i,data:u}}const tf=({route:e,serverInitialData:n})=>{const{data:t,isLoading:r}=Mh(e,n),l=G.useMemo(()=>rf(e),[e.id]);return m.jsx(La,{routes:l,data:t,isLoading:r,children:m.jsx(G.Suspense,{children:m.jsx(e.component,{data:t,isLoading:r})})})},La=G.memo(({routes:e,data:n,isLoading:t,index:r=0,children:l})=>{if(e.length>r){const i=e[r].component;return m.jsx(i,{data:n,isLoading:t,children:m.jsx(La,{routes:e,data:n,isLoading:t,index:r+1,children:l})})}return m.jsx(m.Fragment,{children:l})});La.displayName="TraverseRootComponents";const rf=(e,n=[])=>{var t,r;const l=(r=(t=e.options).getParentRoute)==null?void 0:r.call(t);return n.push(l),l.isRoot?n.reverse():rf(l,n)};var Ba=new Map,ei=new WeakMap,lf=0,Lh=void 0;function Bh(e){return e?(ei.has(e)||(lf+=1,ei.set(e,lf.toString())),ei.get(e)):"0"}function ph(e){return Object.keys(e).sort().filter(n=>e[n]!==void 0).map(n=>`${n}_${n==="root"?Bh(e.root):e[n]}`).toString()}function zh(e){const n=ph(e);let t=Ba.get(n);if(!t){const r=new Map;let l;const i=new IntersectionObserver(a=>{a.forEach(u=>{var o;const f=u.isIntersecting&&l.some(s=>u.intersectionRatio>=s);e.trackVisibility&&typeof u.isVisible>"u"&&(u.isVisible=f),(o=r.get(u.target))==null||o.forEach(s=>{s(f,u)})})},e);l=i.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),t={id:n,observer:i,elements:r},Ba.set(n,t)}return t}function Dh(e,n,t={},r=Lh){if(typeof window.IntersectionObserver>"u"&&r!==void 0){const o=e.getBoundingClientRect();return n(r,{isIntersecting:r,target:e,intersectionRatio:typeof t.threshold=="number"?t.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}const{id:l,observer:i,elements:a}=zh(t),u=a.get(e)||[];return a.has(e)||a.set(e,u),u.push(n),i.observe(e),function(){u.splice(u.indexOf(n),1),u.length===0&&(a.delete(e),i.unobserve(e)),a.size===0&&(i.disconnect(),Ba.delete(l))}}function Wh({threshold:e,delay:n,trackVisibility:t,rootMargin:r,root:l,triggerOnce:i,skip:a,initialInView:u,fallbackInView:o,onChange:f}={}){var s;const[c,d]=G.useState(null),h=G.useRef(f),[g,v]=G.useState({inView:!!u,entry:void 0});h.current=f,G.useEffect(()=>{if(a||!c)return;let w;return w=Dh(c,(S,E)=>{v({inView:S,entry:E}),h.current&&h.current(S,E),E.isIntersecting&&i&&w&&(w(),w=void 0)},{root:l,rootMargin:r,threshold:e,trackVisibility:t,delay:n},o),()=>{w&&w()}},[Array.isArray(e)?e.toString():e,c,l,r,i,a,t,o,n]);const x=(s=g.entry)==null?void 0:s.target,_=G.useRef(void 0);!c&&x&&!i&&!a&&_.current!==x&&(_.current=x,v({inView:!!u,entry:void 0}));const R=[d,g.inView,g.entry];return R.ref=R[0],R.inView=R[1],R.entry=R[2],R}const Nh=()=>{const{location:e,updateLocation:n}=Cr();return{push:Ph.useCallback((r,l)=>{const{scroll:i=!0}=l||{},a=new URL(r,window.location.origin);n({href:a.href,pathname:a.pathname,search:Object.fromEntries(a.searchParams),searchStr:a.search,hash:a.hash}),history.pushState(r,"",r),i&&window.scroll(0,0)},[n]),query:e.search,pathname:e.pathname}};function Hh(e){const{preload:n=!0,scroll:t=!0,children:r,href:l,onClick:i,...a}=e,u=Nh(),o=nf(l),{ref:f}=Wh({onChange(c){c&&n&&(o==null||o.component.preload())},triggerOnce:!0}),s=c=>{if(c.preventDefault(),i==null||i(c),l!=null&&l.startsWith("#")){window.location.hash=l;return}u.push(l||"",{scroll:t})};return m.jsx("a",{...a,href:l,ref:f,onClick:s,children:r})}function Uh(){const{router:e}=Cr(),n=e.routesById["/404"];return n?m.jsx(tf,{route:n,serverInitialData:{}}):m.jsxs(m.Fragment,{children:[m.jsx("h1",{children:"404 Not found"}),m.jsx(Hh,{href:"/",children:"Return home"})]})}function Yh({serverInitialData:e}){const{location:n}=Cr(),t=nf(n.pathname);return t?m.jsx(tf,{route:t,serverInitialData:e}):m.jsx(Uh,{})}function Gh({router:e,serverInitialLocation:n,serverInitialData:t}){return m.jsx(Ah,{router:e,serverInitialLocation:n,children:m.jsx(Yh,{serverInitialData:t})})}function af(e){return Xh(e.filter(Boolean).join("/"))}function Xh(e){return e.replace(/\/{2,}/g,"/")}function uf(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function of(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Zh(e){return of(uf(e))}var Jh=Object.defineProperty,ff=e=>{throw TypeError(e)},Qh=(e,n,t)=>n in e?Jh(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ft=(e,n,t)=>Qh(e,typeof n!="symbol"?n+"":n,t),Vh=(e,n,t)=>n.has(e)||ff("Cannot "+t),cf=(e,n,t)=>(Vh(e,n,"read from private field"),t?t.call(e):n.get(e)),sf=(e,n,t)=>n.has(e)?ff("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,t),pa,za;function Kh(e){return new qh(e)}class qh{constructor(n){ft(this,"options"),ft(this,"basePath","/"),ft(this,"routeTree"),ft(this,"isServer",typeof document>"u"),ft(this,"routesById",{}),ft(this,"routesByPath",{}),ft(this,"update",t=>{this.options={...this.options,...t},cf(this,za).call(this,t.basePath),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,cf(this,pa).call(this))}),sf(this,pa,()=>{const t=r=>{r.forEach((l,i)=>{if(l.init(i),this.routesById[l.id||""]=l,!l.isRoot&&l.options.path){const u=of(l.fullPath);(!this.routesByPath[u]||l.fullPath.endsWith("/"))&&(this.routesByPath[u]=l)}const a=l.children;a!=null&&a.length&&t(a)})};t([this.routeTree])}),sf(this,za,t=>{(!this.basePath||t&&t!==t)&&(t===void 0||t===""||t==="/"?this.basePath="/":this.basePath=`/${Zh(t)}`)}),this.update({...n}),this.isServer||(window.__TUONO__ROUTER__=this)}}pa=new WeakMap,za=new WeakMap;var jh=Object.defineProperty,$h=(e,n,t)=>n in e?jh(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,Ue=(e,n,t)=>$h(e,typeof n!="symbol"?n+"":n,t);function df(e){return new eg(e)}const jt="__root__";class eg{constructor(n){Ue(this,"options"),Ue(this,"id"),Ue(this,"isRoot"),Ue(this,"path"),Ue(this,"fullPath"),Ue(this,"children"),Ue(this,"parentRoute"),Ue(this,"originalIndex"),Ue(this,"component"),Ue(this,"$$typeof"),Ue(this,"init",t=>{var r,l;this.originalIndex=t;const i=!this.options.path&&!this.options.id;this.parentRoute=(l=(r=this.options).getParentRoute)==null?void 0:l.call(r),i&&(this.path=jt);let a=i?jt:this.options.path;a&&a!=="/"&&(a=uf(a));const u=this.options.id||a;let o=i?jt:af([u]);a===jt&&(a="/"),o!==jt&&(o=af(["/",o]));const f=o===jt?"/":a;this.path=a,this.id=o,this.fullPath=f||""}),Ue(this,"update",t=>(Object.assign(this.options,t),this.isRoot=t.isRoot||!t.getParentRoute,this)),this.isRoot=n.isRoot??typeof n.getParentRoute!="function",this.options=n,this.$$typeof=Symbol.for("react.memo"),this.component=n.component}addChildren(n){return this.children=n,this}}const hf="__TUONO_SERVER_PAYLOAD__",ng=typeof window>"u",gf=G.createContext({});function tg({serverPayload:e,children:n}){const t=G.useMemo(()=>({serverPayload:ng?e:window[hf]}),[e]);return m.jsx(gf,{value:t,children:n})}function ni(){return G.useContext(gf).serverPayload}const rg="/vite-server",lg={host:"localhost",port:3e3},ig=()=>{const{devServerConfig:e}=ni(),{host:n,port:t}=e??lg,r=`http://${n}:${t}${rg}`;return m.jsxs(m.Fragment,{children:[m.jsx("script",{type:"module",async:!0,children:[`import RefreshRuntime from '${r}/@react-refresh'`,"RefreshRuntime.injectIntoGlobalHook(window)","window.$RefreshReg$ = () => {}","window.$RefreshSig$ = () => (type) => type","window.__vite_plugin_react_preamble_installed__ = true"].join(` +`)}),m.jsx("script",{type:"module",async:!0,src:`${r}/@vite/client`}),m.jsx("script",{type:"module",async:!0,src:`${r}/client-main.tsx`})]})},ag=()=>{const{cssBundles:e,jsBundles:n}=ni();return m.jsxs(m.Fragment,{children:[e==null?void 0:e.map(t=>m.jsx("link",{rel:"stylesheet",precedence:"high",type:"text/css",href:`/${t}`},t)),n==null?void 0:n.map(t=>m.jsx("script",{type:"module",src:`/${t}`},t))]})};function ug(){const e=ni();return m.jsxs(m.Fragment,{children:[m.jsx("script",{children:`window['${hf}']=${JSON.stringify(e)}`}),e.mode==="Dev"&&m.jsx(ig,{}),e.mode==="Prod"&&m.jsx(ag,{})]})}const og=e=>{let n;const t=G.lazy(e),r=()=>e().then(i=>{n=i.default}),l=i=>G.createElement(n||t,i);return l.preload=r,l};function fg({children:e}){return m.jsx("html",{children:m.jsxs("body",{children:[m.jsx("main",{children:e}),m.jsx(ug,{})]})})}const cg=og(()=>Promise.resolve().then(()=>U_)),bf=df({isRoot:!0,component:fg}),sg=df({component:cg}).update({path:"/",getParentRoute:()=>bf,hasHandler:!0}),dg=bf.addChildren([sg]);(function(e){function n(_,R){var w;return _ instanceof Buffer?w=_:w=Buffer.from(_.buffer,_.byteOffset,_.byteLength),w.toString(R)}var t=function(_){return Buffer.from(_)};function r(_){for(var R=0,w=Math.min(256*256,_.length+1),S=new Uint16Array(w),E=[],P=0;;){var T=R<_.length;if(!T||P>=w-1){var M=S.subarray(0,P),O=M;if(E.push(String.fromCharCode.apply(null,O)),!T)return E.join("");_=_.subarray(R),R=0,P=0}var F=_[R++];if(!(F&128))S[P++]=F;else if((F&224)===192){var L=_[R++]&63;S[P++]=(F&31)<<6|L}else if((F&240)===224){var L=_[R++]&63,ne=_[R++]&63;S[P++]=(F&31)<<12|L<<6|ne}else if((F&248)===240){var L=_[R++]&63,ne=_[R++]&63,X=_[R++]&63,V=(F&7)<<18|L<<12|ne<<6|X;V>65535&&(V-=65536,S[P++]=V>>>10&1023|55296,V=56320|V&1023),S[P++]=V}}}function l(_){for(var R=0,w=_.length,S=0,E=Math.max(32,w+(w>>>1)+7),P=new Uint8Array(E>>>3<<3);R=55296&&T<=56319){if(R=55296&&T<=56319)continue}if(S+4>P.length){E+=8,E*=1+R/_.length*2,E=E>>>3<<3;var O=new Uint8Array(E);O.set(P),P=O}if(T&4294967168)if(!(T&4294965248))P[S++]=T>>>6&31|192;else if(!(T&4294901760))P[S++]=T>>>12&15|224,P[S++]=T>>>6&63|128;else if(!(T&4292870144))P[S++]=T>>>18&7|240,P[S++]=T>>>12&63|128,P[S++]=T>>>6&63|128;else continue;else{P[S++]=T;continue}P[S++]=T&63|128}return P.slice?P.slice(0,S):P.subarray(0,S)}var i="Failed to ",a=function(_,R,w){if(_)throw new Error("".concat(i).concat(R,": the '").concat(w,"' option is unsupported."))},u=typeof Buffer=="function"&&Buffer.from,o=u?t:l;function f(){this.encoding="utf-8"}f.prototype.encode=function(_,R){return a(R&&R.stream,"encode","stream"),o(_)};function s(_){var R;try{var w=new Blob([_],{type:"text/plain;charset=UTF-8"});R=URL.createObjectURL(w);var S=new XMLHttpRequest;return S.open("GET",R,!1),S.send(),S.responseText}finally{R&&URL.revokeObjectURL(R)}}var c=!u&&typeof Blob=="function"&&typeof URL=="function"&&typeof URL.createObjectURL=="function",d=["utf-8","utf8","unicode-1-1-utf-8"],h=r;u?h=n:c&&(h=function(_){try{return s(_)}catch{return r(_)}});var g="construct 'TextDecoder'",v="".concat(i," ").concat(g,": the ");function x(_,R){a(R&&R.fatal,g,"fatal"),_=_||"utf-8";var w;if(u?w=Buffer.isEncoding(_):w=d.indexOf(_.toLowerCase())!==-1,!w)throw new RangeError("".concat(v," encoding label provided ('").concat(_,"') is invalid."));this.encoding=_,this.fatal=!1,this.ignoreBOM=!1}x.prototype.decode=function(_,R){a(R&&R.stream,"decode","stream");var w;return _ instanceof Uint8Array?w=_:_.buffer instanceof ArrayBuffer?w=new Uint8Array(_.buffer):w=new Uint8Array(_),h(w,this.encoding)},e.TextEncoder=e.TextEncoder||f,e.TextDecoder=e.TextDecoder||x})(typeof window<"u"?window:Oa);var hg=Object.defineProperty,gg=(e,n,t)=>n in e?hg(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,ct=(e,n,t)=>gg(e,typeof n!="symbol"?n+"":n,t);let yf=class{constructor(){ct(this,"onmessage",null),ct(this,"onmessageerror",null),ct(this,"otherPort",null),ct(this,"onmessageListeners",[]),ct(this,"isClosed",!1)}dispatchEvent(n){return this.isClosed?!1:(this.onmessage&&this.onmessage(n),this.onmessageListeners.forEach(t=>{t(n)}),!0)}postMessage(n){if(this.isClosed||!this.otherPort)return;const t=new W_("message",{data:n});this.otherPort.dispatchEvent(t)}addEventListener(n,t){this.isClosed||n!=="message"||typeof t=="function"&&!this.onmessageListeners.includes(t)&&this.onmessageListeners.push(t)}removeEventListener(n,t){if(!(this.isClosed||n!=="message")&&typeof t=="function"){const r=this.onmessageListeners.indexOf(t);r!==-1&&this.onmessageListeners.splice(r,1)}}start(){}close(){this.isClosed=!0}},bg=class{constructor(){ct(this,"port1"),ct(this,"port2"),this.port1=new yf,this.port2=new yf,this.port1.otherPort=this.port2,this.port2.otherPort=this.port1}};var ti={},vf={exports:{}},ve={};/** + * @license React + * react-dom.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var yg=G;function _f(e){var n="https://react.dev/errors/"+e;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(wf)}catch(e){console.error(e)}}wf(),vf.exports=ve;var Rf=vf.exports;/** + * @license React + * react-dom-server-legacy.browser.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Ef=G,wg=Rf;function k(e){var n="https://react.dev/errors/"+e;if(1>>16)&65535)<<16)&4294967295,i=i<<15|i>>>17,i=461845907*(i&65535)+((461845907*(i>>>16)&65535)<<16)&4294967295,l^=i,l=l<<13|l>>>19,l=5*(l&65535)+((5*(l>>>16)&65535)<<16)&4294967295,l=(l&65535)+27492+(((l>>>16)+58964&65535)<<16)}switch(i=0,t){case 3:i^=(e.charCodeAt(n+2)&255)<<16;case 2:i^=(e.charCodeAt(n+1)&255)<<8;case 1:i^=e.charCodeAt(n)&255,i=3432918353*(i&65535)+((3432918353*(i>>>16)&65535)<<16)&4294967295,i=i<<15|i>>>17,l^=461845907*(i&65535)+((461845907*(i>>>16)&65535)<<16)&4294967295}return l^=e.length,l^=l>>>16,l=2246822507*(l&65535)+((2246822507*(l>>>16)&65535)<<16)&4294967295,l^=l>>>13,l=3266489909*(l&65535)+((3266489909*(l>>>16)&65535)<<16)&4294967295,(l^l>>>16)>>>0}var Fe=Object.assign,q=Object.prototype.hasOwnProperty,xg=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]*$"),Ff={},kf={};function Ua(e){return q.call(kf,e)?!0:q.call(Ff,e)?!1:xg.test(e)?kf[e]=!0:(Ff[e]=!0,!1)}var Og=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(" ")),Ag=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"]]),mg=/["'&<>]/;function z(e){if(typeof e=="boolean"||typeof e=="number"||typeof e=="bigint")return""+e;e=""+e;var n=mg.exec(e);if(n){var t="",r,l=0;for(r=n.index;r")}function Wf(e){if(typeof e!="string")throw Error(k(480))}function Nf(e,n){if(typeof n.$$FORM_ACTION=="function"){var t=e.nextFormID++;e=e.idPrefix+t;try{var r=n.$$FORM_ACTION(e);if(r){var l=r.data;l!=null&&l.forEach(Wf)}return r}catch(i){if(typeof i=="object"&&i!==null&&typeof i.then=="function")throw i}}return null}function Hf(e,n,t,r,l,i,a,u){var o=null;if(typeof r=="function"){var f=Nf(n,r);f!==null?(u=f.name,r=f.action||"",l=f.encType,i=f.method,a=f.target,o=f.data):(e.push(" ","formAction",'="',Df,'"'),a=i=l=r=u=null,Uf(n,t))}return u!=null&&U(e,"name",u),r!=null&&U(e,"formAction",r),l!=null&&U(e,"formEncType",l),i!=null&&U(e,"formMethod",i),a!=null&&U(e,"formTarget",a),o}function U(e,n,t){switch(n){case"className":se(e,"class",t);break;case"tabIndex":se(e,"tabindex",t);break;case"dir":case"role":case"viewBox":case"width":case"height":se(e,n,t);break;case"style":zf(e,t);break;case"src":case"href":if(t==="")break;case"action":case"formAction":if(t==null||typeof t=="function"||typeof t=="symbol"||typeof t=="boolean")break;t=xr(""+t),e.push(" ",n,'="',z(t),'"');break;case"defaultValue":case"defaultChecked":case"innerHTML":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"autoFocus":case"multiple":case"muted":Ya(e,n.toLowerCase(),t);break;case"xlinkHref":if(typeof t=="function"||typeof t=="symbol"||typeof t=="boolean")break;t=xr(""+t),e.push(" ","xlink:href",'="',z(t),'"');break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":typeof t!="function"&&typeof t!="symbol"&&e.push(" ",n,'="',z(t),'"');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":t&&typeof t!="function"&&typeof t!="symbol"&&e.push(" ",n,'=""');break;case"capture":case"download":t===!0?e.push(" ",n,'=""'):t!==!1&&typeof t!="function"&&typeof t!="symbol"&&e.push(" ",n,'="',z(t),'"');break;case"cols":case"rows":case"size":case"span":typeof t!="function"&&typeof t!="symbol"&&!isNaN(t)&&1<=t&&e.push(" ",n,'="',z(t),'"');break;case"rowSpan":case"start":typeof t=="function"||typeof t=="symbol"||isNaN(t)||e.push(" ",n,'="',z(t),'"');break;case"xlinkActuate":se(e,"xlink:actuate",t);break;case"xlinkArcrole":se(e,"xlink:arcrole",t);break;case"xlinkRole":se(e,"xlink:role",t);break;case"xlinkShow":se(e,"xlink:show",t);break;case"xlinkTitle":se(e,"xlink:title",t);break;case"xlinkType":se(e,"xlink:type",t);break;case"xmlBase":se(e,"xml:base",t);break;case"xmlLang":se(e,"xml:lang",t);break;case"xmlSpace":se(e,"xml:space",t);break;default:if((!(2"))}function de(e,n){e.push(re("link"));for(var t in n)if(q.call(n,t)){var r=n[t];if(r!=null)switch(t){case"children":case"dangerouslySetInnerHTML":throw Error(k(399,"link"));default:U(e,t,r)}}return e.push("/>"),null}var Yf=/(<\/|<)(s)(tyle)/gi;function Gf(e,n,t,r){return""+n+(t==="s"?"\\73 ":"\\53 ")+r}function er(e,n,t){e.push(re(t));for(var r in n)if(q.call(n,r)){var l=n[r];if(l!=null)switch(r){case"children":case"dangerouslySetInnerHTML":throw Error(k(399,t));default:U(e,r,l)}}return e.push("/>"),null}function Xf(e,n){e.push(re("title"));var t=null,r=null,l;for(l in n)if(q.call(n,l)){var i=n[l];if(i!=null)switch(l){case"children":t=i;break;case"dangerouslySetInnerHTML":r=i;break;default:U(e,l,i)}}return e.push(">"),n=Array.isArray(t)?2>t.length?t[0]:null:t,typeof n!="function"&&typeof n!="symbol"&&n!==null&&n!==void 0&&e.push(z(""+n)),Ge(e,r,t),e.push(st("title")),null}function ui(e,n){e.push(re("script"));var t=null,r=null,l;for(l in n)if(q.call(n,l)){var i=n[l];if(i!=null)switch(l){case"children":t=i;break;case"dangerouslySetInnerHTML":r=i;break;default:U(e,l,i)}}return e.push(">"),Ge(e,r,t),typeof t=="string"&&e.push((""+t).replace(Mf,Lf)),e.push(st("script")),null}function Or(e,n,t){e.push(re(t));var r=t=null,l;for(l in n)if(q.call(n,l)){var i=n[l];if(i!=null)switch(l){case"children":t=i;break;case"dangerouslySetInnerHTML":r=i;break;default:U(e,l,i)}}return e.push(">"),Ge(e,r,t),typeof t=="string"?(e.push(z(t)),null):t}var pg=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,Zf=new Map;function re(e){var n=Zf.get(e);if(n===void 0){if(!pg.test(e))throw Error(k(65,e));n="<"+e,Zf.set(e,n)}return n}function zg(e,n,t,r,l,i,a,u,o){switch(n){case"div":case"span":case"svg":case"path":break;case"a":e.push(re("a"));var f=null,s=null,c;for(c in t)if(q.call(t,c)){var d=t[c];if(d!=null)switch(c){case"children":f=d;break;case"dangerouslySetInnerHTML":s=d;break;case"href":d===""?se(e,"href",""):U(e,c,d);break;default:U(e,c,d)}}if(e.push(">"),Ge(e,s,f),typeof f=="string"){e.push(z(f));var h=null}else h=f;return h;case"g":case"p":case"li":break;case"select":e.push(re("select"));var g=null,v=null,x;for(x in t)if(q.call(t,x)){var _=t[x];if(_!=null)switch(x){case"children":g=_;break;case"dangerouslySetInnerHTML":v=_;break;case"defaultValue":case"value":break;default:U(e,x,_)}}return e.push(">"),Ge(e,v,g),g;case"option":var R=a.selectedValue;e.push(re("option"));var w=null,S=null,E=null,P=null,T;for(T in t)if(q.call(t,T)){var M=t[T];if(M!=null)switch(T){case"children":w=M;break;case"selected":E=M;break;case"dangerouslySetInnerHTML":P=M;break;case"value":S=M;default:U(e,T,M)}}if(R!=null){var O=S!==null?""+S:Bg(w);if(Ha(R)){for(var F=0;F"),Ge(e,P,w),w;case"textarea":e.push(re("textarea"));var L=null,ne=null,X=null,V;for(V in t)if(q.call(t,V)){var ye=t[V];if(ye!=null)switch(V){case"children":X=ye;break;case"value":L=ye;break;case"defaultValue":ne=ye;break;case"dangerouslySetInnerHTML":throw Error(k(91));default:U(e,V,ye)}}if(L===null&&ne!==null&&(L=ne),e.push(">"),X!=null){if(L!=null)throw Error(k(92));if(Ha(X)){if(1"),El!=null&&El.forEach(Ga,e),null;case"button":e.push(re("button"));var on=null,Sl=null,Tl=null,Cl=null,Pl=null,xl=null,Ol=null,fn;for(fn in t)if(q.call(t,fn)){var te=t[fn];if(te!=null)switch(fn){case"children":on=te;break;case"dangerouslySetInnerHTML":Sl=te;break;case"name":Tl=te;break;case"formAction":Cl=te;break;case"formEncType":Pl=te;break;case"formMethod":xl=te;break;case"formTarget":Ol=te;break;default:U(e,fn,te)}}var Al=Hf(e,r,l,Cl,Pl,xl,Ol,Tl);if(e.push(">"),Al!=null&&Al.forEach(Ga,e),Ge(e,Sl,on),typeof on=="string"){e.push(z(on));var ml=null}else ml=on;return ml;case"form":e.push(re("form"));var cn=null,Fl=null,Te=null,sn=null,dn=null,hn=null,gn;for(gn in t)if(q.call(t,gn)){var fe=t[gn];if(fe!=null)switch(gn){case"children":cn=fe;break;case"dangerouslySetInnerHTML":Fl=fe;break;case"action":Te=fe;break;case"encType":sn=fe;break;case"method":dn=fe;break;case"target":hn=fe;break;default:U(e,gn,fe)}}var Wt=null,Nt=null;if(typeof Te=="function"){var Ce=Nf(r,Te);Ce!==null?(Te=Ce.action||"",sn=Ce.encType,dn=Ce.method,hn=Ce.target,Wt=Ce.data,Nt=Ce.name):(e.push(" ","action",'="',Df,'"'),hn=dn=sn=Te=null,Uf(r,l))}if(Te!=null&&U(e,"action",Te),sn!=null&&U(e,"encType",sn),dn!=null&&U(e,"method",dn),hn!=null&&U(e,"target",hn),e.push(">"),Nt!==null&&(e.push('"),Wt!=null&&Wt.forEach(Ga,e)),Ge(e,Fl,cn),typeof cn=="string"){e.push(z(cn));var kl=null}else kl=cn;return kl;case"menuitem":e.push(re("menuitem"));for(var Bn in t)if(q.call(t,Bn)){var Il=t[Bn];if(Il!=null)switch(Bn){case"children":case"dangerouslySetInnerHTML":throw Error(k(400));default:U(e,Bn,Il)}}return e.push(">"),null;case"object":e.push(re("object"));var bn=null,Ml=null,yn;for(yn in t)if(q.call(t,yn)){var vn=t[yn];if(vn!=null)switch(yn){case"children":bn=vn;break;case"dangerouslySetInnerHTML":Ml=vn;break;case"data":var Ll=xr(""+vn);if(Ll==="")break;e.push(" ","data",'="',z(Ll),'"');break;default:U(e,yn,vn)}}if(e.push(">"),Ge(e,Ml,bn),typeof bn=="string"){e.push(z(bn));var Bl=null}else Bl=bn;return Bl;case"title":if(a.insertionMode===3||a.tagScope&1||t.itemProp!=null)var Ht=Xf(e,t);else o?Ht=null:(Xf(l.hoistableChunks,t),Ht=void 0);return Ht;case"link":var Do=t.rel,ce=t.href,pn=t.precedence;if(a.insertionMode===3||a.tagScope&1||t.itemProp!=null||typeof Do!="string"||typeof ce!="string"||ce===""){de(e,t);var _n=null}else if(t.rel==="stylesheet")if(typeof pn!="string"||t.disabled!=null||t.onLoad||t.onError)_n=de(e,t);else{var ze=l.styles.get(pn),zn=r.styleResources.hasOwnProperty(ce)?r.styleResources[ce]:void 0;if(zn!==null){r.styleResources[ce]=null,ze||(ze={precedence:z(pn),rules:[],hrefs:[],sheets:new Map},l.styles.set(pn,ze));var Dn={state:0,props:Fe({},t,{"data-precedence":t.precedence,precedence:null})};if(zn){zn.length===2&&mr(Dn.props,zn);var Ut=l.preloads.stylesheets.get(ce);Ut&&0"),_n=null}else t.onLoad||t.onError?_n=de(e,t):(u&&e.push(""),_n=o?null:de(l.hoistableChunks,t));return _n;case"script":var Yt=t.async;if(typeof t.src!="string"||!t.src||!Yt||typeof Yt=="function"||typeof Yt=="symbol"||t.onLoad||t.onError||a.insertionMode===3||a.tagScope&1||t.itemProp!=null)var zl=ui(e,t);else{var Wn=t.src;if(t.type==="module")var Nn=r.moduleScriptResources,Dl=l.preloads.moduleScripts;else Nn=r.scriptResources,Dl=l.preloads.scripts;var Hn=Nn.hasOwnProperty(Wn)?Nn[Wn]:void 0;if(Hn!==null){Nn[Wn]=null;var Gt=t;if(Hn){Hn.length===2&&(Gt=Fe({},t),mr(Gt,Hn));var Wl=Dl.get(Wn);Wl&&(Wl.length=0)}var Nl=[];l.scripts.add(Nl),ui(Nl,Gt)}u&&e.push(""),zl=null}return zl;case"style":var Un=t.precedence,Pe=t.href;if(a.insertionMode===3||a.tagScope&1||t.itemProp!=null||typeof Un!="string"||typeof Pe!="string"||Pe===""){e.push(re("style"));var De=null,Hl=null,wn;for(wn in t)if(q.call(t,wn)){var Yn=t[wn];if(Yn!=null)switch(wn){case"children":De=Yn;break;case"dangerouslySetInnerHTML":Hl=Yn;break;default:U(e,wn,Yn)}}e.push(">");var Rn=Array.isArray(De)?2>De.length?De[0]:null:De;typeof Rn!="function"&&typeof Rn!="symbol"&&Rn!==null&&Rn!==void 0&&e.push((""+Rn).replace(Yf,Gf)),Ge(e,Hl,De),e.push(st("style"));var Ul=null}else{var xe=l.styles.get(Un);if((r.styleResources.hasOwnProperty(Pe)?r.styleResources[Pe]:void 0)!==null){r.styleResources[Pe]=null,xe?xe.hrefs.push(z(Pe)):(xe={precedence:z(Un),rules:[],hrefs:[z(Pe)],sheets:new Map},l.styles.set(Un,xe));var Yl=xe.rules,We=null,Gl=null,Gn;for(Gn in t)if(q.call(t,Gn)){var Xt=t[Gn];if(Xt!=null)switch(Gn){case"children":We=Xt;break;case"dangerouslySetInnerHTML":Gl=Xt}}var En=Array.isArray(We)?2>We.length?We[0]:null:We;typeof En!="function"&&typeof En!="symbol"&&En!==null&&En!==void 0&&Yl.push((""+En).replace(Yf,Gf)),Ge(Yl,Gl,We)}xe&&i&&i.styles.add(xe),u&&e.push(""),Ul=void 0}return Ul;case"meta":if(a.insertionMode===3||a.tagScope&1||t.itemProp!=null)var Xl=er(e,t,"meta");else u&&e.push(""),Xl=o?null:typeof t.charSet=="string"?er(l.charsetChunks,t,"meta"):t.name==="viewport"?er(l.viewportChunks,t,"meta"):er(l.hoistableChunks,t,"meta");return Xl;case"listing":case"pre":e.push(re(n));var Sn=null,Tn=null,Cn;for(Cn in t)if(q.call(t,Cn)){var Xn=t[Cn];if(Xn!=null)switch(Cn){case"children":Sn=Xn;break;case"dangerouslySetInnerHTML":Tn=Xn;break;default:U(e,Cn,Xn)}}if(e.push(">"),Tn!=null){if(Sn!=null)throw Error(k(60));if(typeof Tn!="object"||!("__html"in Tn))throw Error(k(61));var Oe=Tn.__html;Oe!=null&&(typeof Oe=="string"&&0l.highImagePreloads.size)&&(Zt.delete(Ne),l.highImagePreloads.add(Ae));else if(!r.imageResources.hasOwnProperty(Ne)){r.imageResources[Ne]=Ye;var Jt=t.crossOrigin,Jl=typeof Jt=="string"?Jt==="use-credentials"?Jt:"":void 0,me=l.headers,Qt;me&&0me.highImagePreloads.length)&&(Qt=fi(N,"image",{imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:Jl,integrity:t.integrity,nonce:t.nonce,type:t.type,fetchPriority:t.fetchPriority,referrerPolicy:t.refererPolicy}),0<=(me.remainingCapacity-=Qt.length+2))?(l.resets.image[Ne]=Ye,me.highImagePreloads&&(me.highImagePreloads+=", "),me.highImagePreloads+=Qt):(Ae=[],de(Ae,{rel:"preload",as:"image",href:D?void 0:N,imageSrcSet:D,imageSizes:Zl,crossOrigin:Jl,integrity:t.integrity,type:t.type,fetchPriority:t.fetchPriority,referrerPolicy:t.referrerPolicy}),t.fetchPriority==="high"||10>l.highImagePreloads.size?l.highImagePreloads.add(Ae):(l.bulkPreloads.add(Ae),Zt.set(Ne,Ae)))}}return er(e,t,"img");case"base":case"area":case"br":case"col":case"embed":case"hr":case"keygen":case"param":case"source":case"track":case"wbr":return er(e,t,n);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":break;case"head":if(2>a.insertionMode&&l.headChunks===null){l.headChunks=[];var Ql=Or(l.headChunks,t,"head")}else Ql=Or(e,t,"head");return Ql;case"html":if(a.insertionMode===0&&l.htmlChunks===null){l.htmlChunks=[""];var Vl=Or(l.htmlChunks,t,"html")}else Vl=Or(e,t,"html");return Vl;default:if(n.indexOf("-")!==-1){e.push(re(n));var Vt=null,Kl=null,He;for(He in t)if(q.call(t,He)){var ee=t[He];if(ee!=null){var ql=He;switch(He){case"children":Vt=ee;break;case"dangerouslySetInnerHTML":Kl=ee;break;case"style":zf(e,ee);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"ref":break;case"className":ql="class";default:if(Ua(He)&&typeof ee!="function"&&typeof ee!="symbol"&&ee!==!1){if(ee===!0)ee="";else if(typeof ee=="object")continue;e.push(" ",ql,'="',z(ee),'"')}}}}return e.push(">"),Ge(e,Kl,Vt),Vt}}return Or(e,t,n)}var Jf=new Map;function st(e){var n=Jf.get(e);return n===void 0&&(n="",Jf.set(e,n)),n}function Qf(e,n){n=n.bootstrapChunks;for(var t=0;t')}function Dg(e,n,t,r){switch(t.insertionMode){case 0:case 1:case 2:return e.push('