diff --git a/app/page.tsx b/app/page.tsx index 5abd2ec6..de5c8ddf 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,9 +1,9 @@ "use client"; import { Suspense } from "react"; import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; -// import { LiveConnectionProvider } from "@/src/components/LiveConnection"; import { FeaturesProvider } from "@/src/components/FeaturesProvider"; import { MapInspector } from "@/src/components/MapInspector"; +import { SettingsProvider } from "@/src/components/SettingsProvider"; // Three.js has its own loaders for textures and models, but we need to load other // stuff too, e.g. missions, terrains, and more. This client is used for those. @@ -14,7 +14,9 @@ export default function HomePage() { - + + + diff --git a/app/shapes/page.tsx b/app/shapes/page.tsx index 76222092..8c7a3dec 100644 --- a/app/shapes/page.tsx +++ b/app/shapes/page.tsx @@ -305,7 +305,7 @@ function ShapeInspector() { return (
- {}}> +
{showLoading && (
404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/404/index.html b/docs/404/index.html index b99edd65..420eaa0e 100644 --- a/docs/404/index.html +++ b/docs/404/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/__next.__PAGE__.txt b/docs/__next.__PAGE__.txt index f9712c01..5214e43b 100644 --- a/docs/__next.__PAGE__.txt +++ b/docs/__next.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -3:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/63afa42c92661c50.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] +3:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","/t2-mapper/_next/static/chunks/990cfb71eaf1c762.js","/t2-mapper/_next/static/chunks/b30d580062e7b044.js","/t2-mapper/_next/static/chunks/e01e6e76b521dd3c.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/16e2b7e83646cebc.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 7:"$Sreact.suspense" -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/63afa42c92661c50.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/990cfb71eaf1c762.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/b30d580062e7b044.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/e01e6e76b521dd3c.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/16e2b7e83646cebc.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/docs/__next._full.txt b/docs/__next._full.txt index dddeeb18..a736e8b8 100644 --- a/docs/__next._full.txt +++ b/docs/__next._full.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/63afa42c92661c50.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","/t2-mapper/_next/static/chunks/990cfb71eaf1c762.js","/t2-mapper/_next/static/chunks/b30d580062e7b044.js","/t2-mapper/_next/static/chunks/e01e6e76b521dd3c.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/16e2b7e83646cebc.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/63afa42c92661c50.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"P":null,"b":"GVV-bte23-C1OKGsIpGF4","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/990cfb71eaf1c762.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/b30d580062e7b044.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/e01e6e76b521dd3c.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/16e2b7e83646cebc.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/__next._head.txt b/docs/__next._head.txt index b57734f2..c07e1c68 100644 --- a/docs/__next._head.txt +++ b/docs/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/__next._index.txt b/docs/__next._index.txt index a6efb165..0f8c5084 100644 --- a/docs/__next._index.txt +++ b/docs/__next._index.txt @@ -3,4 +3,4 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/__next._tree.txt b/docs/__next._tree.txt index c2544fb1..13d28f9f 100644 --- a/docs/__next._tree.txt +++ b/docs/__next._tree.txt @@ -1,3 +1,3 @@ :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_buildManifest.js b/docs/_next/static/GVV-bte23-C1OKGsIpGF4/_buildManifest.js similarity index 100% rename from docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_buildManifest.js rename to docs/_next/static/GVV-bte23-C1OKGsIpGF4/_buildManifest.js diff --git a/docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_clientMiddlewareManifest.json b/docs/_next/static/GVV-bte23-C1OKGsIpGF4/_clientMiddlewareManifest.json similarity index 100% rename from docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_clientMiddlewareManifest.json rename to docs/_next/static/GVV-bte23-C1OKGsIpGF4/_clientMiddlewareManifest.json diff --git a/docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_ssgManifest.js b/docs/_next/static/GVV-bte23-C1OKGsIpGF4/_ssgManifest.js similarity index 100% rename from docs/_next/static/HUIHRvyaa6D1abkRRPPoG/_ssgManifest.js rename to docs/_next/static/GVV-bte23-C1OKGsIpGF4/_ssgManifest.js diff --git a/docs/_next/static/chunks/1273ef014eba2bd5.js b/docs/_next/static/chunks/1273ef014eba2bd5.js deleted file mode 100644 index 66cf2c28..00000000 --- a/docs/_next/static/chunks/1273ef014eba2bd5.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(47167),r=e.i(2232);let n=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:i,modules:s}=function(){let e=t.default.env.NEXT_PUBLIC_LOG?.trim();if(!e)return{globalLevel:"info",modules:new Map};let r=null,i=new Map;for(let t of e.split(",")){let e=t.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&i.set(t,r)}else n.has(e)&&(r=e)}return{globalLevel:r??=i.size>0?"silent":"info",modules:i}}(),l={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},a=(0,r.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=l[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function o(e){let t=s.get(e)??i;return a.child({module:e},{level:t})}e.s(["createLogger",()=>o])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/16e2b7e83646cebc.js b/docs/_next/static/chunks/16e2b7e83646cebc.js new file mode 100644 index 00000000..39aca2ef --- /dev/null +++ b/docs/_next/static/chunks/16e2b7e83646cebc.js @@ -0,0 +1,521 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65883,e=>{e.v({ButtonGroup:"InspectorControls-module__gNRB6W__ButtonGroup",ButtonHint:"InspectorControls-module__gNRB6W__ButtonHint",ButtonLabel:"InspectorControls-module__gNRB6W__ButtonLabel",CheckboxField:"InspectorControls-module__gNRB6W__CheckboxField",Control:"InspectorControls-module__gNRB6W__Control",Description:"InspectorControls-module__gNRB6W__Description",Dropdown:"InspectorControls-module__gNRB6W__Dropdown",Field:"InspectorControls-module__gNRB6W__Field",ForceRenderButton:"InspectorControls-module__gNRB6W__ForceRenderButton",Group:"InspectorControls-module__gNRB6W__Group",IconButton:"InspectorControls-module__gNRB6W__IconButton",InspectorControls:"InspectorControls-module__gNRB6W__InspectorControls",Label:"InspectorControls-module__gNRB6W__Label",LabelledButton:"InspectorControls-module__gNRB6W__LabelledButton",MapInfoButton:"InspectorControls-module__gNRB6W__MapInfoButton InspectorControls-module__gNRB6W__IconButton InspectorControls-module__gNRB6W__LabelledButton",Toggle:"InspectorControls-module__gNRB6W__Toggle InspectorControls-module__gNRB6W__IconButton",Tools:"InspectorControls-module__gNRB6W__Tools"})},36679,e=>{e.v({ButtonLabel:"CopyCoordinatesButton-module__BxovtG__ButtonLabel "+e.i(65883).ButtonLabel,ClipboardCheck:"CopyCoordinatesButton-module__BxovtG__ClipboardCheck",MapPin:"CopyCoordinatesButton-module__BxovtG__MapPin",Root:"CopyCoordinatesButton-module__BxovtG__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,showClipboardCheck:"CopyCoordinatesButton-module__BxovtG__showClipboardCheck"})},28903,e=>{e.v({ButtonHint:"LoadDemoButton-module__kGZaoW__ButtonHint "+e.i(65883).ButtonHint,ButtonLabel:"LoadDemoButton-module__kGZaoW__ButtonLabel "+e.i(65883).ButtonLabel,Root:"LoadDemoButton-module__kGZaoW__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton})},9607,e=>{e.v({ButtonHint:"JoinServerButton-module__DIR70a__ButtonHint "+e.i(65883).ButtonHint,PingLabel:"JoinServerButton-module__DIR70a__PingLabel "+e.i(65883).ButtonLabel,Pulsing:"JoinServerButton-module__DIR70a__Pulsing",Root:"JoinServerButton-module__DIR70a__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,TextLabel:"JoinServerButton-module__DIR70a__TextLabel "+e.i(65883).ButtonLabel,blink:"JoinServerButton-module__DIR70a__blink"})},81323,e=>{e.v({AccordionGroup:"Accordion-module__rN-DYq__AccordionGroup",Body:"Accordion-module__rN-DYq__Body",Content:"Accordion-module__rN-DYq__Content",Trigger:"Accordion-module__rN-DYq__Trigger",TriggerIcon:"Accordion-module__rN-DYq__TriggerIcon",slideDown:"Accordion-module__rN-DYq__slideDown",slideUp:"Accordion-module__rN-DYq__slideUp"})},16964,e=>{e.v({ActionButton:"StreamingMissionInfo-module__hEaQnW__ActionButton "+e.i(65883).IconButton,Attribution:"StreamingMissionInfo-module__hEaQnW__Attribution",EjectIcon:"StreamingMissionInfo-module__hEaQnW__EjectIcon",Error:"StreamingMissionInfo-module__hEaQnW__Error",Header:"StreamingMissionInfo-module__hEaQnW__Header",Metadata:"StreamingMissionInfo-module__hEaQnW__Metadata",MissionInfo:"StreamingMissionInfo-module__hEaQnW__MissionInfo",MissionName:"StreamingMissionInfo-module__hEaQnW__MissionName "+e.i(97442).SelectedName,MissionType:"StreamingMissionInfo-module__hEaQnW__MissionType "+e.i(97442).ItemType,MissionTypeDisplayName:"StreamingMissionInfo-module__hEaQnW__MissionTypeDisplayName",PlayerName:"StreamingMissionInfo-module__hEaQnW__PlayerName",RecordingDate:"StreamingMissionInfo-module__hEaQnW__RecordingDate",ServerInfo:"StreamingMissionInfo-module__hEaQnW__ServerInfo",ServerName:"StreamingMissionInfo-module__hEaQnW__ServerName"})},29418,e=>{e.v({Bottom:"PlayerNameplate-module__zYDm0a__Bottom PlayerNameplate-module__zYDm0a__Root",HealthBar:"PlayerNameplate-module__zYDm0a__HealthBar",HealthFill:"PlayerNameplate-module__zYDm0a__HealthFill",IffArrow:"PlayerNameplate-module__zYDm0a__IffArrow",Name:"PlayerNameplate-module__zYDm0a__Name",Root:"PlayerNameplate-module__zYDm0a__Root",Top:"PlayerNameplate-module__zYDm0a__Top PlayerNameplate-module__zYDm0a__Root"})},78779,e=>{e.v({Distance:"FlagMarker-module__INpLba__Distance",Icon:"FlagMarker-module__INpLba__Icon",Root:"FlagMarker-module__INpLba__Root"})},89271,e=>{e.v({LoadingIndicator:"LoadingIndicator-module__F20Nda__LoadingIndicator",Progress:"LoadingIndicator-module__F20Nda__Progress",ProgressBar:"LoadingIndicator-module__F20Nda__ProgressBar",ProgressText:"LoadingIndicator-module__F20Nda__ProgressText",Spinner:"LoadingIndicator-module__F20Nda__Spinner",loadingComplete:"LoadingIndicator-module__F20Nda__loadingComplete",spin:"LoadingIndicator-module__F20Nda__spin"})},82156,e=>{e.v({Backdrop:"MapInspector-module__nU0WNq__Backdrop",CancelButton:"MapInspector-module__nU0WNq__CancelButton",Content:"MapInspector-module__nU0WNq__Content",Frame:"MapInspector-module__nU0WNq__Frame",PlayerBar:"MapInspector-module__nU0WNq__PlayerBar",Sidebar:"MapInspector-module__nU0WNq__Sidebar",ThreeView:"MapInspector-module__nU0WNq__ThreeView",ToggleSidebarButton:"MapInspector-module__nU0WNq__ToggleSidebarButton",Toolbar:"MapInspector-module__nU0WNq__Toolbar",layout:"MapInspector-module__nU0WNq__layout"})},31713,e=>{"use strict";var t,r=e.i(43476),n=e.i(932),a=e.i(71645),o=e.i(17751),i=e.i(12598),l=e.i(38847);let s=(0,a.createContext)({live:!1});function c(e){let t,o,i=(0,n.c)(5),{children:c}=e,[d]=(0,l.useQueryState)("features",l.parseAsString);i[0]!==d?(t=()=>({live:new Set((d??"").split(",").map(u).filter(Boolean)).has("live")}),i[0]=d,i[1]=t):t=i[1];let[m]=(0,a.useState)(t);return i[2]!==c||i[3]!==m?(o=(0,r.jsx)(s.Provider,{value:m,children:c}),i[2]=c,i[3]=m,i[4]=o):o=i[4],o}function u(e){return e.trim().toLowerCase()}var d=e.i(40141);function m(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M16 21L11.2381 12.2698L15 6L23 21H16ZM8 10L14 21H2L8 10ZM5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5C8 6.88071 6.88071 8 5.5 8Z"},child:[]}]})(e)}function f(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(e)}function h(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"},child:[]}]})(e)}function p(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 8V2h6"},child:[]},{tag:"path",attr:{d:"m2 2 10 10"},child:[]},{tag:"path",attr:{d:"M12 2A10 10 0 1 1 2 12"},child:[]}]})(e)}function g(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"},child:[]},{tag:"path",attr:{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"M12 11h4"},child:[]},{tag:"path",attr:{d:"M12 16h4"},child:[]},{tag:"path",attr:{d:"M8 11h.01"},child:[]},{tag:"path",attr:{d:"M8 16h.01"},child:[]}]})(e)}function v(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"m16 15-3-3 3-3"},child:[]}]})(e)}function x(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"m14 9 3 3-3 3"},child:[]}]})(e)}function y(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"m9 16 3-3 3 3"},child:[]}]})(e)}function b(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"m15 14-3 3-3-3"},child:[]}]})(e)}var _=e.i(79123),S=e.i(11152),w=e.i(36679);function C(e){let t,o,i,l,s,c=(0,n.c)(12),{cameraRef:u,missionName:d,missionType:m,disabled:h}=e,{fogEnabled:p}=(0,_.useSettings)(),[g,v]=(0,a.useState)(!1),x=(0,a.useRef)(null);c[0]!==u||c[1]!==p||c[2]!==d||c[3]!==m?(t=async()=>{clearTimeout(x.current);let e=u.current;if(!e)return;let t=function({position:e,quaternion:t}){let r=e=>parseFloat(e.toFixed(3)),n=`${r(e.x)},${r(e.y)},${r(e.z)}`,a=`${r(t.x)},${r(t.y)},${r(t.z)},${r(t.w)}`;return`#c${n}~${a}`}(e),r=new URLSearchParams;r.set("mission",`${d}~${m}`),r.set("fog",p.toString());let n=`${window.location.pathname}?${r}${t}`,a=`${window.location.origin}${n}`;window.history.replaceState(null,"",n);try{await navigator.clipboard.writeText(a),v(!0),x.current=setTimeout(()=>{v(!1)},1100)}catch(e){console.error(e)}},c[0]=u,c[1]=p,c[2]=d,c[3]=m,c[4]=t):t=c[4];let y=t,b=g?"true":"false";return c[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,r.jsx)(S.FaMapPin,{className:w.default.MapPin}),i=(0,r.jsx)(f,{className:w.default.ClipboardCheck}),l=(0,r.jsx)("span",{className:w.default.ButtonLabel,children:" Link to coordinates"}),c[5]=o,c[6]=i,c[7]=l):(o=c[5],i=c[6],l=c[7]),c[8]!==h||c[9]!==y||c[10]!==b?(s=(0,r.jsxs)("button",{type:"button",className:w.default.Root,"aria-label":"Link to coordinates",title:"Copy the current coordinates to URL",onClick:y,disabled:h,"data-copied":b,id:"copyCoordinatesButton",children:[o,i,l]}),c[8]=h,c[9]=y,c[10]=b,c[11]=s):s=c[11],s}function j(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z"},child:[]}]})(e)}var M=e.i(25645),k=e.i(98755),N=e.i(32865),T=e.i(28903);let R=(0,M.createLogger)("LoadDemoButton");function D({isActive:t=!1,choosingMap:n=!1,onCancelChoosingMap:o}){let i=(0,N.useRecording)(),l=i?.source==="demo",{setRecording:s}=(0,N.usePlaybackActions)(),c=(0,a.useRef)(null),u=(0,a.useRef)(0),d=(0,a.useCallback)(()=>{if(n&&l)return void o?.();if(l){u.current+=1,s(null);return}c.current?.click()},[l,n,o,s]),m=(0,a.useCallback)(async t=>{let r=t.target.files?.[0];if(r){t.target.value="";try{let t=await r.arrayBuffer(),n=u.current+1;u.current=n;let{createDemoStreamingRecording:a}=await e.A(60946),o=await a(t);if(u.current!==n)return;let i=k.liveConnectionStore.getState();i.disconnectServer(),i.disconnectRelay(),s(o)}catch(e){R.error("Failed to load demo: %o",e)}}},[s]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("input",{ref:c,type:"file",accept:".rec",style:{display:"none"},onChange:m}),(0,r.jsxs)("button",{type:"button",className:T.default.Root,"aria-label":l?"Unload demo":"Load demo (.rec)",title:l?"Unload demo":"Load demo (.rec)",onClick:d,"data-active":t,children:[(0,r.jsx)(j,{className:T.default.DemoIcon}),(0,r.jsx)("span",{className:T.default.ButtonLabel,children:"Demo"}),(0,r.jsx)("span",{className:T.default.ButtonHint,children:n&&l?"Return to demo":l?"Click to unload":"Load a .rec file"})]})]})}function L(e){return(0,d.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z"},child:[]}]})(e)}var F=e.i(9607);function I(e){let t,a,o,i,l,s,c=(0,n.c)(19),{isActive:u,onOpenServerBrowser:d}=e,m=(0,k.useLiveSelector)(B),f=(0,k.useLiveSelector)(k.selectPing),h=(0,k.useLiveSelector)(E),p="connected"===m,g="connecting"===m||"challenging"===m||"authenticating"===m,v=p?"Connected – click to disconnect":"Join server",x=p?"Connected – click to disconnect":"Join server";c[0]!==h||c[1]!==p||c[2]!==d?(t=()=>{p?h():d()},c[0]=h,c[1]=p,c[2]=d,c[3]=t):t=c[3];let y=`${F.default.LiveIcon} ${p?F.default.Pulsing:""}`;if(c[4]!==y?(a=(0,r.jsx)(L,{className:y}),c[4]=y,c[5]=a):a=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(o=(0,r.jsx)("span",{className:F.default.TextLabel,children:"Live"}),c[6]=o):o=c[6],c[7]!==g||c[8]!==f)i=g?"Connecting…":null!=f?`${f.toLocaleString()} ms`:"Join a game",c[7]=g,c[8]=f,c[9]=i;else i=c[9];return c[10]!==i?(l=(0,r.jsxs)(r.Fragment,{children:[o,(0,r.jsx)("span",{className:F.default.ButtonHint,children:i})]}),c[10]=i,c[11]=l):l=c[11],c[12]!==u||c[13]!==v||c[14]!==x||c[15]!==t||c[16]!==a||c[17]!==l?(s=(0,r.jsxs)("button",{type:"button",className:F.default.Root,"aria-label":v,title:x,onClick:t,"data-active":u,children:[a,l]}),c[12]=u,c[13]=v,c[14]=x,c[15]=t,c[16]=a,c[17]=l,c[18]=s):s=c[18],s}function E(e){return e.disconnectServer}function B(e){return e.gameStatus}function P(e,t=[]){let n=[],o=()=>{let t=n.map(e=>a.createContext(e));return function(r){let n=r?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(t,o){let i=a.createContext(o),l=n.length;n=[...n,o];let s=t=>{let{scope:n,children:o,...s}=t,c=n?.[e]?.[l]||i,u=a.useMemo(()=>s,Object.values(s));return(0,r.jsx)(c.Provider,{value:u,children:o})};return s.displayName=t+"Provider",[s,function(r,n){let s=n?.[e]?.[l]||i,c=a.useContext(s);if(c)return c;if(void 0!==o)return o;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let a=r(e)[`__scope${n}`];return{...t,...a}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(o,...t)]}function A(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function z(...e){return t=>{let r=!1,n=e.map(e=>{let n=A(e,t);return r||"function"!=typeof n||(r=!0),n});if(r)return()=>{for(let t=0;t{let{children:r,...n}=e;if(a.isValidElement(r)){var o;let e,i,l=(o=r,(i=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(i=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),s=function(e,t){let r={...t};for(let n in t){let a=e[n],o=t[n];/^on[A-Z]/.test(n)?a&&o?r[n]=(...e)=>{let t=o(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...o}:"className"===n&&(r[n]=[a,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?z(t,l):l),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null})).displayName=`${t}.SlotClone`,n),i=a.forwardRef((e,t)=>{let{children:n,...i}=e,l=a.Children.toArray(n),s=l.find(H);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,r.jsx)(o,{...i,ref:t,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,r.jsx)(o,{...i,ref:t,children:n})});return i.displayName=`${e}.Slot`,i}var W=Symbol("radix.slottable");function H(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===W}var V=new WeakMap;function O(e,t){var r,n;let a,o,i;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let l=(r=e,n=t,a=r.length,(i=(o=q(n))>=0?o:a+o)<0||i>=a?-1:i);return -1===l?void 0:e[l]}function q(e){return e!=e||0===e?0:Math.trunc(e)}function $(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],V.set(this,!0)}set(e,t){return V.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let n,a=this.has(t),o=this.#e.length,i=q(e),l=i>=0?i:o+i,s=l<0||l>=o?-1:l;if(s===this.size||a&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!a;i<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e=this.size&&(n=this.size-1),this.at(n)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let n=r+t;return n<0&&(n=0),n>=this.size&&(n=this.size-1),this.keyAt(n)}find(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return n;r++}}findIndex(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return r;r++}return -1}filter(t,r){let n=[],a=0;for(let e of this)Reflect.apply(t,r,[e,a,this])&&n.push(e),a++;return new e(n)}map(t,r){let n=[],a=0;for(let e of this)n.push([e[0],Reflect.apply(t,r,[e,a,this])]),a++;return new e(n)}reduce(...e){let[t,r]=e,n=0,a=r??this.at(0);for(let r of this)a=0===n&&1===e.length?r:Reflect.apply(t,this,[a,r,n,this]),n++;return a}reduceRight(...e){let[t,r]=e,n=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let a=this.at(r);n=r===this.size-1&&1===e.length?a:Reflect.apply(t,this,[n,a,r,this])}return n}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),n=this.get(r);t.set(r,n)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let n=new e,a=this.size-1;if(void 0===t)return n;t<0&&(t+=this.size),void 0!==r&&r>0&&(a=r-1);for(let e=t;e<=a;e++){let t=this.keyAt(e),r=this.get(t);n.set(t,r)}return n}every(e,t){let r=0;for(let n of this){if(!Reflect.apply(e,t,[n,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let n of this){if(Reflect.apply(e,t,[n,r,this]))return!0;r++}return!1}}),"u">typeof window&&window.document&&window.document.createElement;var K=globalThis?.document?a.useLayoutEffect:()=>{};a[" useEffectEvent ".trim().toString()],a[" useInsertionEffect ".trim().toString()];var Q=a[" useInsertionEffect ".trim().toString()]||K;function Y({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,i,l]=function({defaultProp:e,onChange:t}){let[r,n]=a.useState(e),o=a.useRef(r),i=a.useRef(t);return Q(()=>{i.current=t},[t]),a.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}({defaultProp:t,onChange:r}),s=void 0!==e,c=s?e:o;{let t=a.useRef(void 0!==e);a.useEffect(()=>{let e=t.current;if(e!==s){let t=s?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,n])}return[c,a.useCallback(t=>{if(s){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else i(t)},[s,e,i,l])]}Symbol("RADIX:SYNC_STATE"),e.i(74080);var X=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{let n=G(`Primitive.${t}`),o=a.forwardRef((e,a)=>{let{asChild:o,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,r.jsx)(o?n:t,{...i,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{}),Z=e=>{var t;let r,n,{present:o,children:i}=e,l=function(e){var t,r;let[n,o]=a.useState(),i=a.useRef(null),l=a.useRef(e),s=a.useRef("none"),[c,u]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},a.useReducer((e,t)=>r[e][t]??e,t));return a.useEffect(()=>{let e=J(i.current);s.current="mounted"===c?e:"none"},[c]),K(()=>{let t=i.current,r=l.current;if(r!==e){let n=s.current,a=J(t);e?u("MOUNT"):"none"===a||t?.display==="none"?u("UNMOUNT"):r&&n!==a?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),K(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=J(i.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(u("ANIMATION_END"),!l.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(s.current=J(i.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{i.current=e?getComputedStyle(e):null,o(e)},[])}}(o),s="function"==typeof i?i({present:l.isPresent}):a.Children.only(i),c=U(l.ref,(t=s,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof i||l.isPresent?a.cloneElement(s,{ref:c}):null};function J(e){return e?.animationName||"none"}Z.displayName="Presence";var ee=a[" useId ".trim().toString()]||(()=>void 0),et=0;function er(e){let[t,r]=a.useState(ee());return K(()=>{e||r(e=>e??String(et++))},[e]),e||(t?`radix-${t}`:"")}var en="Collapsible",[ea,eo]=P(en),[ei,el]=ea(en),es=a.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:l,onOpenChange:s,...c}=e,[u,d]=Y({prop:o,defaultProp:i??!1,onChange:s,caller:en});return(0,r.jsx)(ei,{scope:n,disabled:l,contentId:er(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:(0,r.jsx)(X.div,{"data-state":eh(u),"data-disabled":l?"":void 0,...c,ref:t})})});es.displayName=en;var ec="CollapsibleTrigger",eu=a.forwardRef((e,t)=>{let{__scopeCollapsible:n,...a}=e,o=el(ec,n);return(0,r.jsx)(X.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":eh(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...a,ref:t,onClick:$(e.onClick,o.onOpenToggle)})});eu.displayName=ec;var ed="CollapsibleContent",em=a.forwardRef((e,t)=>{let{forceMount:n,...a}=e,o=el(ed,e.__scopeCollapsible);return(0,r.jsx)(Z,{present:n||o.open,children:({present:e})=>(0,r.jsx)(ef,{...a,ref:t,present:e})})});em.displayName=ed;var ef=a.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:o,children:i,...l}=e,s=el(ed,n),[c,u]=a.useState(o),d=a.useRef(null),m=U(t,d),f=a.useRef(0),h=f.current,p=a.useRef(0),g=p.current,v=s.open||c,x=a.useRef(v),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),K(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,p.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(o)}},[s.open,o]),(0,r.jsx)(X.div,{"data-state":eh(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...l,ref:m,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&i})});function eh(e){return e?"open":"closed"}var ep=a.createContext(void 0),eg="Accordion",ev=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ex,ey,eb]=function(e){let t=e+"CollectionProvider",[n,o]=P(t),[i,l]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:t,children:n}=e,o=a.default.useRef(null),l=a.default.useRef(new Map).current;return(0,r.jsx)(i,{scope:t,itemMap:l,collectionRef:o,children:n})};s.displayName=t;let c=e+"CollectionSlot",u=G(c),d=a.default.forwardRef((e,t)=>{let{scope:n,children:a}=e,o=U(t,l(c,n).collectionRef);return(0,r.jsx)(u,{ref:o,children:a})});d.displayName=c;let m=e+"CollectionItemSlot",f="data-radix-collection-item",h=G(m),p=a.default.forwardRef((e,t)=>{let{scope:n,children:o,...i}=e,s=a.default.useRef(null),c=U(t,s),u=l(m,n);return a.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...i}),()=>void u.itemMap.delete(s))),(0,r.jsx)(h,{...{[f]:""},ref:c,children:o})});return p.displayName=m,[{Provider:s,Slot:d,ItemSlot:p},function(t){let r=l(e+"CollectionConsumer",t);return a.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}(eg),[e_,eS]=P(eg,[eb,eo]),ew=eo(),eC=a.default.forwardRef((e,t)=>{let{type:n,...a}=e;return(0,r.jsx)(ex.Provider,{scope:e.__scopeAccordion,children:"multiple"===n?(0,r.jsx)(eR,{...a,ref:t}):(0,r.jsx)(eT,{...a,ref:t})})});eC.displayName=eg;var[ej,eM]=e_(eg),[ek,eN]=e_(eg,{collapsible:!1}),eT=a.default.forwardRef((e,t)=>{let{value:n,defaultValue:o,onValueChange:i=()=>{},collapsible:l=!1,...s}=e,[c,u]=Y({prop:n,defaultProp:o??"",onChange:i,caller:eg});return(0,r.jsx)(ej,{scope:e.__scopeAccordion,value:a.default.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:a.default.useCallback(()=>l&&u(""),[l,u]),children:(0,r.jsx)(ek,{scope:e.__scopeAccordion,collapsible:l,children:(0,r.jsx)(eF,{...s,ref:t})})})}),eR=a.default.forwardRef((e,t)=>{let{value:n,defaultValue:o,onValueChange:i=()=>{},...l}=e,[s,c]=Y({prop:n,defaultProp:o??[],onChange:i,caller:eg}),u=a.default.useCallback(e=>c((t=[])=>[...t,e]),[c]),d=a.default.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,r.jsx)(ej,{scope:e.__scopeAccordion,value:s,onItemOpen:u,onItemClose:d,children:(0,r.jsx)(ek,{scope:e.__scopeAccordion,collapsible:!0,children:(0,r.jsx)(eF,{...l,ref:t})})})}),[eD,eL]=e_(eg),eF=a.default.forwardRef((e,t)=>{let n,{__scopeAccordion:o,disabled:i,dir:l,orientation:s="vertical",...c}=e,u=U(a.default.useRef(null),t),d=ey(o),m="ltr"===(n=a.useContext(ep),l||n||"ltr"),f=$(e.onKeyDown,e=>{if(!ev.includes(e.key))return;let t=e.target,r=d().filter(e=>!e.ref.current?.disabled),n=r.findIndex(e=>e.ref.current===t),a=r.length;if(-1===n)return;e.preventDefault();let o=n,i=a-1,l=()=>{(o=n+1)>i&&(o=0)},c=()=>{(o=n-1)<0&&(o=i)};switch(e.key){case"Home":o=0;break;case"End":o=i;break;case"ArrowRight":"horizontal"===s&&(m?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(m?c():l());break;case"ArrowUp":"vertical"===s&&c()}let u=o%a;r[u].ref.current?.focus()});return(0,r.jsx)(eD,{scope:o,disabled:i,direction:l,orientation:s,children:(0,r.jsx)(ex.Slot,{scope:o,children:(0,r.jsx)(X.div,{...c,"data-orientation":s,ref:u,onKeyDown:i?void 0:f})})})}),eI="AccordionItem",[eE,eB]=e_(eI),eP=a.default.forwardRef((e,t)=>{let{__scopeAccordion:n,value:a,...o}=e,i=eL(eI,n),l=eM(eI,n),s=ew(n),c=er(),u=a&&l.value.includes(a)||!1,d=i.disabled||e.disabled;return(0,r.jsx)(eE,{scope:n,open:u,disabled:d,triggerId:c,children:(0,r.jsx)(es,{"data-orientation":i.orientation,"data-state":eH(u),...s,...o,ref:t,disabled:d,open:u,onOpenChange:e=>{e?l.onItemOpen(a):l.onItemClose(a)}})})});eP.displayName=eI;var eA="AccordionHeader";a.default.forwardRef((e,t)=>{let{__scopeAccordion:n,...a}=e,o=eL(eg,n),i=eB(eA,n);return(0,r.jsx)(X.h3,{"data-orientation":o.orientation,"data-state":eH(i.open),"data-disabled":i.disabled?"":void 0,...a,ref:t})}).displayName=eA;var ez="AccordionTrigger",eU=a.default.forwardRef((e,t)=>{let{__scopeAccordion:n,...a}=e,o=eL(eg,n),i=eB(ez,n),l=eN(ez,n),s=ew(n);return(0,r.jsx)(ex.ItemSlot,{scope:n,children:(0,r.jsx)(eu,{"aria-disabled":i.open&&!l.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...a,ref:t})})});eU.displayName=ez;var eG="AccordionContent",eW=a.default.forwardRef((e,t)=>{let{__scopeAccordion:n,...a}=e,o=eL(eg,n),i=eB(eG,n),l=ew(n);return(0,r.jsx)(em,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...l,...a,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function eH(e){return e?"open":"closed"}function eV(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m190.06 414 163.12-139.78a24 24 0 0 0 0-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z"},child:[]}]})(e)}eW.displayName=eG;var eO=e.i(81323);function eq(e){let t,a=(0,n.c)(2);return a[0]!==e?(t=(0,r.jsx)(eC,{className:eO.default.AccordionGroup,...e}),a[0]=e,a[1]=t):t=a[1],t}function e$(e){let t,a,o,i,l=(0,n.c)(9),{value:s,label:c,children:u}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)(eV,{className:eO.default.TriggerIcon}),l[0]=t):t=l[0],l[1]!==c?(a=(0,r.jsxs)(eU,{className:eO.default.Trigger,children:[t," ",c]}),l[1]=c,l[2]=a):a=l[2],l[3]!==u?(o=(0,r.jsx)(eW,{className:eO.default.Content,children:(0,r.jsx)("div",{className:eO.default.Body,children:u})}),l[3]=u,l[4]=o):o=l[4],l[5]!==a||l[6]!==o||l[7]!==s?(i=(0,r.jsxs)(eP,{value:s,children:[a,o]}),l[5]=a,l[6]=o,l[7]=s,l[8]=i):i=l[8],i}var eK=e.i(65883),eQ=e.i(21025),eY=e.i(92224),eX=e.i(91996);let eZ=["controls","preferences","audio"];function eJ(e){let t,o,i,l,s,c,u,d,f,p,v,x,y,b,S,w,j,M,T,R,L,F,E,B,P,A,z,U,G,W,H,V,O,q,$,K,Q,Y,X,Z,J,ee,et,er,en,ea,eo,ei,el,es,ec,eu,ed,em,ef,eh,ep,eg,ev,ex,ey,eb,e_,eS,ew,eC,ej,eM,ek,eN,eT,eR,eD=(0,n.c)(169),{missionName:eL,missionType:eF,onOpenMapInfo:eI,onOpenServerBrowser:eE,onChooseMap:eB,onCancelChoosingMap:eP,choosingMap:eA,cameraRef:ez,invalidateRef:eU}=e,eG=(0,eQ.useTouchDevice)(),eW=(0,eY.useDataSource)(),eH=(0,N.useRecording)(),eV=(0,eY.useMissionName)(),eO="demo"===eW||"live"===eW?eV:eL;eD[0]!==eO?(t=!!eO&&(0,eX.hasMission)(eO),eD[0]=eO,eD[1]=t):t=eD[1];let eJ=t,e1=(0,k.useLiveSelector)(e0),{fogEnabled:e2,setFogEnabled:e3,fov:e5,setFov:e4,audioEnabled:e6,setAudioEnabled:e8,audioVolume:e7,setAudioVolume:e9,animationEnabled:te,setAnimationEnabled:tt}=(0,_.useSettings)(),{speedMultiplier:tr,setSpeedMultiplier:tn,touchMode:ta,setTouchMode:to,invertScroll:ti,setInvertScroll:tl,invertDrag:ts,setInvertDrag:tc,invertJoystick:tu,setInvertJoystick:td}=(0,_.useControls)(),{debugMode:tm,setDebugMode:tf,renderOnDemand:th,setRenderOnDemand:tp}=(0,_.useDebug)(),[tg,tv]=(0,a.useState)(!1),tx=(0,a.useRef)(null),ty=(0,a.useRef)(null),tb=(0,a.useRef)(null);eD[2]!==tg?(o=()=>{tg&&tx.current?.focus()},i=[tg],eD[2]=tg,eD[3]=o,eD[4]=i):(o=eD[3],i=eD[4]),(0,a.useEffect)(o,i),eD[5]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let t=e.relatedTarget;t&&tb.current?.contains(t)||tv(!1)},eD[5]=l):l=eD[5];let t_=l;eD[6]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{"Escape"===e.key&&(tv(!1),ty.current?.focus())},eD[6]=s):s=eD[6];let tS=s,tw="map"===eW&&!eH||eA;eD[7]===Symbol.for("react.memo_cache_sentinel")?(c=(0,r.jsx)(m,{}),u=(0,r.jsx)("span",{className:eK.default.ButtonLabel,children:"Explore"}),d=(0,r.jsx)("span",{className:eK.default.ButtonHint,children:"Browse maps"}),eD[7]=c,eD[8]=u,eD[9]=d):(c=eD[7],u=eD[8],d=eD[9]),eD[10]!==eB||eD[11]!==tw?(f=(0,r.jsxs)("button",{type:"button",className:eK.default.IconButton,"data-active":tw,onClick:eB,children:[c,u,d]}),eD[10]=eB,eD[11]=tw,eD[12]=f):f=eD[12];let tC=!eA&&eH?.source==="demo";eD[13]!==eA||eD[14]!==eP||eD[15]!==tC?(p=(0,r.jsx)(D,{isActive:tC,choosingMap:eA,onCancelChoosingMap:eP}),eD[13]=eA,eD[14]=eP,eD[15]=tC,eD[16]=p):p=eD[16],eD[17]!==eA||eD[18]!==e1||eD[19]!==eE?(v=eE&&(0,r.jsx)(I,{isActive:!eA&&e1,onOpenServerBrowser:eE}),eD[17]=eA,eD[18]=e1,eD[19]=eE,eD[20]=v):v=eD[20],eD[21]!==f||eD[22]!==p||eD[23]!==v?(x=(0,r.jsxs)("div",{className:eK.default.ButtonGroup,children:[f,p,v]}),eD[21]=f,eD[22]=p,eD[23]=v,eD[24]=x):x=eD[24];let tj=!eJ;eD[25]!==ez||eD[26]!==eL||eD[27]!==eF||eD[28]!==tj?(y=(0,r.jsx)(C,{missionName:eL,missionType:eF,cameraRef:ez,disabled:tj}),eD[25]=ez,eD[26]=eL,eD[27]=eF,eD[28]=tj,eD[29]=y):y=eD[29];let tM=!eJ;eD[30]===Symbol.for("react.memo_cache_sentinel")?(b=(0,r.jsx)(g,{}),S=(0,r.jsx)("span",{className:eK.default.ButtonLabel,children:"Show map info"}),eD[30]=b,eD[31]=S):(b=eD[30],S=eD[31]),eD[32]!==eI||eD[33]!==tM?(w=(0,r.jsxs)("button",{type:"button",className:eK.default.MapInfoButton,"aria-label":"Show map info",onClick:eI,disabled:tM,children:[b,S]}),eD[32]=eI,eD[33]=tM,eD[34]=w):w=eD[34],eD[35]!==x||eD[36]!==y||eD[37]!==w?(j=(0,r.jsxs)("div",{className:eK.default.Tools,children:[x,y,w]}),eD[35]=x,eD[36]=y,eD[37]=w,eD[38]=j):j=eD[38],eD[39]===Symbol.for("react.memo_cache_sentinel")?(M=(0,r.jsx)("label",{htmlFor:"speedInput",children:"Fly speed"}),eD[39]=M):M=eD[39],eD[40]!==tr?(T=Math.round(100*tr),eD[40]=tr,eD[41]=T):T=eD[41],eD[42]!==tn?(R=e=>tn(parseFloat(e.target.value)/100),eD[42]=tn,eD[43]=R):R=eD[43],eD[44]!==T||eD[45]!==R?(L=(0,r.jsx)("input",{id:"speedInput",type:"range",min:1,max:100,step:1,value:T,onChange:R}),eD[44]=T,eD[45]=R,eD[46]=L):L=eD[46];let tk=!1===eG?" Use your scroll wheel or trackpad to adjust while flying.":"";return eD[47]!==tk?(F=(0,r.jsxs)("p",{className:eK.default.Description,children:["How fast you move in free-flying mode.",tk]}),eD[47]=tk,eD[48]=F):F=eD[48],eD[49]!==L||eD[50]!==F?(E=(0,r.jsxs)("div",{className:eK.default.Field,children:[M,L,F]}),eD[49]=L,eD[50]=F,eD[51]=E):E=eD[51],eD[52]!==eG||eD[53]!==to||eD[54]!==ta?(B=eG?(0,r.jsxs)("div",{className:eK.default.Field,children:[(0,r.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick"})," ",(0,r.jsxs)("select",{id:"touchModeInput",value:ta,onChange:e=>to(e.target.value),children:[(0,r.jsx)("option",{value:"dualStick",children:"Dual stick"}),(0,r.jsx)("option",{value:"moveLookStick",children:"Single stick"})]}),(0,r.jsx)("p",{className:eK.default.Description,children:"Single stick has a unified move + look control. Dual stick has independent move + look."})]}):null,eD[52]=eG,eD[53]=to,eD[54]=ta,eD[55]=B):B=eD[55],eD[56]!==ti||eD[57]!==eG||eD[58]!==tl?(P=!1===eG?(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[(0,r.jsx)("input",{id:"invertScroll",type:"checkbox",checked:ti,onChange:e=>{tl(e.target.checked)}}),(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"invertScroll",children:"Invert scroll direction"}),(0,r.jsx)("p",{className:eK.default.Description,children:"Reverse which scroll direction increases and decreases fly speed."})]}):null,eD[56]=ti,eD[57]=eG,eD[58]=tl,eD[59]=P):P=eD[59],eD[60]!==tu||eD[61]!==eG||eD[62]!==td?(A=eG?(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[(0,r.jsx)("input",{id:"invertJoystick",type:"checkbox",checked:tu,onChange:e=>{td(e.target.checked)}}),(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"invertJoystick",children:"Invert joystick direction"}),(0,r.jsx)("p",{className:eK.default.Description,children:"Reverse joystick look direction."})]}):null,eD[60]=tu,eD[61]=eG,eD[62]=td,eD[63]=A):A=eD[63],eD[64]!==tc?(z=e=>{tc(e.target.checked)},eD[64]=tc,eD[65]=z):z=eD[65],eD[66]!==ts||eD[67]!==z?(U=(0,r.jsx)("input",{id:"invertDrag",type:"checkbox",checked:ts,onChange:z}),eD[66]=ts,eD[67]=z,eD[68]=U):U=eD[68],eD[69]===Symbol.for("react.memo_cache_sentinel")?(G=(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"invertDrag",children:"Invert drag direction"}),W=(0,r.jsx)("p",{className:eK.default.Description,children:"Reverse how dragging the viewport aims the camera."}),eD[69]=G,eD[70]=W):(G=eD[69],W=eD[70]),eD[71]!==U?(H=(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[U,G,W]}),eD[71]=U,eD[72]=H):H=eD[72],eD[73]!==E||eD[74]!==B||eD[75]!==P||eD[76]!==A||eD[77]!==H?(V=(0,r.jsxs)(e$,{value:"controls",label:"Controls",children:[E,B,P,A,H]}),eD[73]=E,eD[74]=B,eD[75]=P,eD[76]=A,eD[77]=H,eD[78]=V):V=eD[78],eD[79]===Symbol.for("react.memo_cache_sentinel")?(O=(0,r.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),eD[79]=O):O=eD[79],eD[80]!==e5?(q=(0,r.jsxs)("output",{htmlFor:"fovInput",children:[e5,"°"]}),eD[80]=e5,eD[81]=q):q=eD[81],eD[82]!==e4?($=e=>e4(parseInt(e.target.value)),eD[82]=e4,eD[83]=$):$=eD[83],eD[84]!==e5||eD[85]!==$?(K=(0,r.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:e5,onChange:$}),eD[84]=e5,eD[85]=$,eD[86]=K):K=eD[86],eD[87]!==q||eD[88]!==K?(Q=(0,r.jsx)(e$,{value:"preferences",label:"Preferences",children:(0,r.jsxs)("div",{className:eK.default.Field,children:[O,(0,r.jsxs)("div",{className:eK.default.Control,children:[q,K]})]})}),eD[87]=q,eD[88]=K,eD[89]=Q):Q=eD[89],eD[90]!==e8?(Y=e=>{e8(e.target.checked)},eD[90]=e8,eD[91]=Y):Y=eD[91],eD[92]!==e6||eD[93]!==Y?(X=(0,r.jsx)("input",{id:"audioInput",type:"checkbox",checked:e6,onChange:Y}),eD[92]=e6,eD[93]=Y,eD[94]=X):X=eD[94],eD[95]===Symbol.for("react.memo_cache_sentinel")?(Z=(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"audioInput",children:"Enable audio"}),eD[95]=Z):Z=eD[95],eD[96]!==X?(J=(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[X,Z]}),eD[96]=X,eD[97]=J):J=eD[97],eD[98]===Symbol.for("react.memo_cache_sentinel")?(ee=(0,r.jsx)("label",{htmlFor:"volumeInput",children:"Master volume"}),eD[98]=ee):ee=eD[98],eD[99]!==e7?(et=Math.round(100*e7),eD[99]=e7,eD[100]=et):et=eD[100],eD[101]!==et?(er=(0,r.jsxs)("output",{htmlFor:"volumeInput",children:[et,"%"]}),eD[101]=et,eD[102]=er):er=eD[102],eD[103]!==e9?(en=e=>e9(parseFloat(e.target.value)),eD[103]=e9,eD[104]=en):en=eD[104],eD[105]!==e7||eD[106]!==en?(ea=(0,r.jsx)("input",{id:"volumeInput",type:"range",min:0,max:1,step:.05,value:e7,onChange:en}),eD[105]=e7,eD[106]=en,eD[107]=ea):ea=eD[107],eD[108]!==er||eD[109]!==ea?(eo=(0,r.jsxs)("div",{className:eK.default.Field,children:[ee,(0,r.jsxs)("div",{className:eK.default.Control,children:[er,ea]})]}),eD[108]=er,eD[109]=ea,eD[110]=eo):eo=eD[110],eD[111]!==J||eD[112]!==eo?(ei=(0,r.jsxs)(e$,{value:"audio",label:"Audio",children:[J,eo]}),eD[111]=J,eD[112]=eo,eD[113]=ei):ei=eD[113],eD[114]!==e3?(el=e=>{e3(e.target.checked)},eD[114]=e3,eD[115]=el):el=eD[115],eD[116]!==e2||eD[117]!==el?(es=(0,r.jsx)("input",{id:"fogInput",type:"checkbox",checked:e2,onChange:el}),eD[116]=e2,eD[117]=el,eD[118]=es):es=eD[118],eD[119]===Symbol.for("react.memo_cache_sentinel")?(ec=(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"fogInput",children:"Enable fog"}),eD[119]=ec):ec=eD[119],eD[120]!==es?(eu=(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[es,ec]}),eD[120]=es,eD[121]=eu):eu=eD[121],eD[122]!==tt?(ed=e=>{tt(e.target.checked)},eD[122]=tt,eD[123]=ed):ed=eD[123],eD[124]!==te||eD[125]!==ed?(em=(0,r.jsx)("input",{id:"animationInput",type:"checkbox",checked:te,onChange:ed}),eD[124]=te,eD[125]=ed,eD[126]=em):em=eD[126],eD[127]===Symbol.for("react.memo_cache_sentinel")?(ef=(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"animationInput",children:"Enable animations"}),eD[127]=ef):ef=eD[127],eD[128]!==em?(eh=(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[em,ef]}),eD[128]=em,eD[129]=eh):eh=eD[129],eD[130]!==eu||eD[131]!==eh?(ep=(0,r.jsxs)(e$,{value:"graphics",label:"Graphics",children:[eu,eh]}),eD[130]=eu,eD[131]=eh,eD[132]=ep):ep=eD[132],eD[133]!==tf?(eg=e=>{tf(e.target.checked)},eD[133]=tf,eD[134]=eg):eg=eD[134],eD[135]!==tm||eD[136]!==eg?(ev=(0,r.jsx)("input",{id:"debugInput",type:"checkbox",checked:tm,onChange:eg}),eD[135]=tm,eD[136]=eg,eD[137]=ev):ev=eD[137],eD[138]===Symbol.for("react.memo_cache_sentinel")?(ex=(0,r.jsx)("label",{className:eK.default.Label,htmlFor:"debugInput",children:"Render debug visuals"}),eD[138]=ex):ex=eD[138],eD[139]!==ev?(ey=(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[ev,ex]}),eD[139]=ev,eD[140]=ey):ey=eD[140],eD[141]!==tp?(eb=e=>{tp(e.target.checked)},eD[141]=tp,eD[142]=eb):eb=eD[142],eD[143]!==th||eD[144]!==eb?(e_=(0,r.jsx)("input",{id:"onDemandInput",type:"checkbox",checked:th,onChange:eb}),eD[143]=th,eD[144]=eb,eD[145]=e_):e_=eD[145],eD[146]===Symbol.for("react.memo_cache_sentinel")?(eS=(0,r.jsx)("label",{htmlFor:"onDemandInput",children:"Render on demand "}),eD[146]=eS):eS=eD[146],eD[147]!==eU?(ew=()=>eU.current?.(),eD[147]=eU,eD[148]=ew):ew=eD[148],eD[149]===Symbol.for("react.memo_cache_sentinel")?(eC=(0,r.jsx)(h,{}),eD[149]=eC):eC=eD[149],eD[150]!==ew?(ej=(0,r.jsxs)("div",{className:eK.default.Label,children:[eS,(0,r.jsx)("button",{type:"button",className:eK.default.ForceRenderButton,title:"Force render","aria-label":"Force render",onClick:ew,children:eC})]}),eD[150]=ew,eD[151]=ej):ej=eD[151],eD[152]===Symbol.for("react.memo_cache_sentinel")?(eM=(0,r.jsx)("p",{className:eK.default.Description,children:"Significantly decreases CPU and GPU usage by only rendering frames when requested. Helpful when developing parts of the app unrelated to rendering."}),eD[152]=eM):eM=eD[152],eD[153]!==e_||eD[154]!==ej?(ek=(0,r.jsxs)("div",{className:eK.default.CheckboxField,children:[e_,ej,eM]}),eD[153]=e_,eD[154]=ej,eD[155]=ek):ek=eD[155],eD[156]!==ey||eD[157]!==ek?(eN=(0,r.jsxs)(e$,{value:"debug",label:"Debug",children:[ey,ek]}),eD[156]=ey,eD[157]=ek,eD[158]=eN):eN=eD[158],eD[159]!==V||eD[160]!==Q||eD[161]!==ei||eD[162]!==ep||eD[163]!==eN?(eT=(0,r.jsx)("div",{className:eK.default.Accordions,children:(0,r.jsxs)(eq,{type:"multiple",defaultValue:eZ,children:[V,Q,ei,ep,eN]})}),eD[159]=V,eD[160]=Q,eD[161]=ei,eD[162]=ep,eD[163]=eN,eD[164]=eT):eT=eD[164],eD[165]!==tg||eD[166]!==j||eD[167]!==eT?(eR=(0,r.jsx)("div",{className:eK.default.InspectorControls,children:(0,r.jsx)("div",{ref:tb,children:(0,r.jsxs)("div",{className:eK.default.Dropdown,ref:tx,id:"settingsPanel",tabIndex:-1,onKeyDown:tS,onBlur:t_,"data-open":tg,children:[j,eT]})})}),eD[165]=tg,eD[166]=j,eD[167]=eT,eD[168]=eR):eR=eD[168],eR}function e0(e){return"connected"===e.gameStatus||"authenticating"===e.gameStatus}var e1=e.i(11889),e2=e.i(56373),e3=e.i(86447),e5=e.i(1559),e4=e.i(78440),e6=e.i(59129),e8=e.i(25998),e7=e.i(18364),e9=e.i(68754),te=e.i(70238),tt=e.i(29402),tr=e.i(97442);let tn=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),ta={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},to={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},ti=(0,eX.getMissionList)().filter(e=>!tn.has(e)).map(e=>{let t,r=(0,eX.getMissionInfo)(e),[n]=(0,eX.getSourceAndPath)(r.resourcePath),a=(t=n.match(/^(.*)(\/[^/]+)$/))?t[1]:"",o=ta[n]??to[a]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:n,groupName:o,missionTypes:r.missionTypes}}),tl=new Map(ti.map(e=>[e.missionName,e])),ts=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,tt.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,tt.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(ti),tc="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function tu(e){let t,a,o,i,l,s=(0,n.c)(12),{mission:c}=e,u=c.displayName||c.missionName;return s[0]!==u?(t=(0,r.jsx)("span",{className:tr.default.ItemName,children:u}),s[0]=u,s[1]=t):t=s[1],s[2]!==c.missionTypes?(a=c.missionTypes.length>0&&(0,r.jsx)("span",{className:tr.default.ItemTypes,children:c.missionTypes.map(td)}),s[2]=c.missionTypes,s[3]=a):a=s[3],s[4]!==t||s[5]!==a?(o=(0,r.jsxs)("span",{className:tr.default.ItemHeader,children:[t,a]}),s[4]=t,s[5]=a,s[6]=o):o=s[6],s[7]!==c.missionName?(i=(0,r.jsx)("span",{className:tr.default.ItemMissionName,children:c.missionName}),s[7]=c.missionName,s[8]=i):i=s[8],s[9]!==o||s[10]!==i?(l=(0,r.jsxs)(r.Fragment,{children:[o,i]}),s[9]=o,s[10]=i,s[11]=l):l=s[11],l}function td(e){return(0,r.jsx)("span",{className:tr.default.ItemType,"data-mission-type":e,children:e},e)}function tm(e){let t,o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_=(0,n.c)(48),{value:S,missionType:w,onChange:C,disabled:j,autoFocus:M}=e,[k,N]=(0,a.useState)(""),T=(0,a.useRef)(null),R=(0,a.useRef)(w);_[0]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{(0,a.startTransition)(()=>N(e))},_[0]=t):t=_[0];let D=(0,e7.useComboboxStore)({resetValueOnHide:!0,selectedValue:S,setSelectedValue:e=>{if(e){let t=R.current,r=(0,eX.getMissionInfo)(e).missionTypes;t&&r.includes(t)||(t=r[0]),C({missionName:e,missionType:t}),T.current?.blur()}},setValue:t}),L=(0,e9.useStoreState)(D,"open");_[1]!==D?(o=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),D.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},i=[D],_[1]=D,_[2]=o,_[3]=i):(o=_[2],i=_[3]),(0,a.useEffect)(o,i),_[4]!==S?(l=tl.get(S),_[4]=S,_[5]=l):l=_[5];let F=l;e:{let e,t;if(!k){let e;_[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:ts},_[6]=e):e=_[6],s=e;break e}_[7]!==k?(e=(0,te.matchSorter)(ti,k,{keys:["displayName","missionName","missionTypes","groupName"]}),_[7]=k,_[8]=e):e=_[8];let r=e;_[9]!==r?(t={type:"flat",missions:r},_[9]=r,_[10]=t):t=_[10],s=t}let I=s,E=F?F.displayName||F.missionName:S,B="flat"===I.type?0===I.missions.length:0===I.groups.length,P=e=>(0,r.jsx)(e2.ComboboxItem,{value:e.missionName,className:tr.default.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(R.current=r,e.missionName===S&&C({missionName:e.missionName,missionType:r})):R.current=null}else R.current=null},children:(0,r.jsx)(tu,{mission:e})},e.missionName),A=e4.ComboboxProvider,z=L?"visible":"hidden";_[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,r.jsx)("div",{className:tr.default.Backdrop}),_[11]=c):c=_[11],_[12]!==z?(u=(0,r.jsx)(a.Activity,{mode:z,children:c}),_[12]=z,_[13]=u):u=_[13];let U=F?void 0:"Choose a map…";_[14]!==D?(d=()=>{try{document.exitPointerLock()}catch{}D.show()},m=e=>{"Escape"!==e.key||D.getState().open||T.current?.blur()},_[14]=D,_[15]=d,_[16]=m):(d=_[15],m=_[16]),_[17]!==M||_[18]!==j||_[19]!==d||_[20]!==m||_[21]!==U?(f=(0,r.jsx)(e1.Combobox,{ref:T,autoSelect:!0,autoFocus:M,disabled:j,placeholder:U,className:tr.default.Input,onFocus:d,onKeyDown:m}),_[17]=M,_[18]=j,_[19]=d,_[20]=m,_[21]=U,_[22]=f):f=_[22],_[23]!==E||_[24]!==w||_[25]!==F?(h=F&&(0,r.jsxs)("div",{className:tr.default.SelectedValue,children:[(0,r.jsx)("span",{className:tr.default.SelectedName,children:E}),w&&(0,r.jsx)("span",{className:tr.default.ItemType,"data-mission-type":w,children:w})]}),_[23]=E,_[24]=w,_[25]=F,_[26]=h):h=_[26],_[27]===Symbol.for("react.memo_cache_sentinel")?(p=(0,r.jsx)("kbd",{className:tr.default.Shortcut,children:tc?"⌘K":"^K"}),_[27]=p):p=_[27],_[28]!==f||_[29]!==h?(g=(0,r.jsxs)("div",{className:tr.default.InputWrapper,children:[f,h,p]}),_[28]=f,_[29]=h,_[30]=g):g=_[30];let G=e5.ComboboxPopover,W=tr.default,H=e3.ComboboxList,V=tr.default,O="flat"===I.type?I.missions.map(P):I.groups.map(e=>{let[t,n]=e;return t?(0,r.jsxs)(e6.ComboboxGroup,{className:tr.default.Group,children:[(0,r.jsx)(e8.ComboboxGroupLabel,{className:tr.default.GroupLabel,children:t}),n.map(P)]},t):(0,r.jsx)(a.Fragment,{children:n.map(P)},"ungrouped")});return _[31]!==B?(v=B&&(0,r.jsx)("div",{className:tr.default.NoResults,children:"No missions found"}),_[31]=B,_[32]=v):v=_[32],_[33]!==H||_[34]!==V.List||_[35]!==O||_[36]!==v?(x=(0,r.jsxs)(H,{className:V.List,children:[O,v]}),_[33]=H,_[34]=V.List,_[35]=O,_[36]=v,_[37]=x):x=_[37],_[38]!==G||_[39]!==W.Popover||_[40]!==x?(y=(0,r.jsx)(G,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:W.Popover,children:x}),_[38]=G,_[39]=W.Popover,_[40]=x,_[41]=y):y=_[41],_[42]!==A||_[43]!==D||_[44]!==g||_[45]!==y||_[46]!==u?(b=(0,r.jsxs)(A,{store:D,children:[u,g,y]}),_[42]=A,_[43]=D,_[44]=g,_[45]=y,_[46]=u,_[47]=b):b=_[47],b}var tf=e.i(58647);function th(e){return(0,d.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 6-6 8h12zM6 16h12v2H6z"},child:[]}]})(e)}var tp=e.i(16964);function tg(){let e,t,a,o,i,l,s=(0,n.c)(24),c=(0,eY.useDataSource)(),u=(0,eY.useMissionDisplayName)(),d=(0,eY.useMissionType)(),m=(0,eY.useMissionTypeDisplayName)(),f=(0,eY.useServerDisplayName)(),h=(0,eY.useRecorderName)(),g=(0,eY.useRecordingDate)(),[v,x]=g?g.split(" "):[null,null],y="live"===c,b=(0,N.useRecording)(),_=(0,k.useLiveSelector)(ty),S=tp.default;s[0]!==u||s[1]!==d||s[2]!==m?(e=u&&d?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:tp.default.MissionName,children:u}),d&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)("span",{className:tp.default.MissionType,"data-mission-type":d,children:"LCTF"===m?"LCTF":d})]})]}):null,s[0]=u,s[1]=d,s[2]=m,s[3]=e):e=s[3],s[4]!==e?(t=(0,r.jsx)("div",{className:tp.default.MissionInfo,children:e}),s[4]=e,s[5]=t):t=s[5];let w=tp.default,C=y?_?h?(0,r.jsxs)("div",{className:tp.default.Attribution,children:["Connected as"," ",(0,r.jsx)("span",{className:tp.default.PlayerName,children:h})]}):null:(0,r.jsx)("div",{className:tp.default.Error,children:"Disconnected"}):h&&g?(0,r.jsxs)("div",{className:tp.default.Attribution,children:["Recorded by ",(0,r.jsx)("span",{className:tp.default.PlayerName,children:h})," ","on"," ",(0,r.jsx)("span",{className:tp.default.RecordingDate,children:v.replace(/-/g," ")})," ","at ",(0,r.jsx)("span",{className:tp.default.RecordingDate,children:x})]}):null;return s[6]!==f?(a=f?(0,r.jsxs)("div",{className:tp.default.ServerInfo,children:["Server: ",(0,r.jsx)("span",{className:tp.default.ServerName,children:f})]}):null,s[6]=f,s[7]=a):a=s[7],s[8]!==w.Metadata||s[9]!==C||s[10]!==a?(o=(0,r.jsxs)("div",{className:w.Metadata,children:[C,a]}),s[8]=w.Metadata,s[9]=C,s[10]=a,s[11]=o):o=s[11],s[12]!==c||s[13]!==tv||s[14]!==tx||s[15]!==y||s[16]!==_||s[17]!==b?(i="demo"===c?(0,r.jsx)("button",{type:"button",className:tp.default.ActionButton,title:"Unload demo","aria-label":"Unload demo",onClick:tx,disabled:!b,children:(0,r.jsx)(th,{className:tp.default.EjectIcon})}):y?(0,r.jsx)("button",{type:"button",className:tp.default.ActionButton,title:"Disconnect","aria-label":"Disconnect",onClick:tv,disabled:!_,children:(0,r.jsx)(p,{})}):null,s[12]=c,s[13]=tv,s[14]=tx,s[15]=y,s[16]=_,s[17]=b,s[18]=i):i=s[18],s[19]!==S.Header||s[20]!==t||s[21]!==o||s[22]!==i?(l=(0,r.jsxs)("div",{className:S.Header,children:[t,o,i]}),s[19]=S.Header,s[20]=t,s[21]=o,s[22]=i,s[23]=l):l=s[23],l}function tv(){let e=k.liveConnectionStore.getState();e.disconnectServer(),e.disconnectRelay(),tf.engineStore.getState().setRecording(null)}function tx(){tf.engineStore.getState().setRecording(null)}function ty(e){return"connected"===e.gameStatus||"authenticating"===e.gameStatus}var tb=e.i(31067),t_=e.i(15080),tS=e.i(71753),tw=e.i(90072);let tC=a.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:n,children:o,...i},l)=>{let s=(0,t_.useThree)(({set:e})=>e),c=(0,t_.useThree)(({camera:e})=>e),u=(0,t_.useThree)(({size:e})=>e),d=a.useRef(null);a.useImperativeHandle(l,()=>d.current,[]);let m=a.useRef(null),f=function(e,t,r){let n=(0,t_.useThree)(e=>e.size),o=(0,t_.useThree)(e=>e.viewport),i="number"==typeof e?e:n.width*o.dpr,l=n.height*o.dpr,s=("number"==typeof e?void 0:e)||{},{samples:c=0,depth:u,...d}=s,m=null!=u?u:s.depthBuffer,f=a.useMemo(()=>{let e=new tw.WebGLRenderTarget(i,l,{minFilter:tw.LinearFilter,magFilter:tw.LinearFilter,type:tw.HalfFloatType,...d});return m&&(e.depthTexture=new tw.DepthTexture(i,l,tw.FloatType)),e.samples=c,e},[]);return a.useLayoutEffect(()=>{f.setSize(i,l),c&&(f.samples=c)},[c,f,i,l]),a.useEffect(()=>()=>f.dispose(),[]),f}(t);a.useLayoutEffect(()=>{i.manual||(d.current.aspect=u.width/u.height)},[u,i]),a.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let h=0,p=null,g="function"==typeof o;return(0,tS.useFrame)(t=>{g&&(r===1/0||h{if(n)return s(()=>({camera:d.current})),()=>s(()=>({camera:c}))},[d,n,s]),a.createElement(a.Fragment,null,a.createElement("perspectiveCamera",(0,tb.default)({ref:d},i),!g&&o),a.createElement("group",{ref:m},g&&o(f.texture)))});function tj(){let e,t,a=(0,n.c)(3),{fov:o}=(0,_.useSettings)();return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],a[0]=e):e=a[0],a[1]!==o?(t=(0,r.jsx)(tC,{makeDefault:!0,position:e,fov:o}),a[1]=o,a[2]=t):t=a[2],t}var tM=e.i(51434);let tk=(0,a.createContext)(null);function tN(){let e=(0,a.useContext)(tk);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function tT({children:e}){let t=(0,t_.useThree)(e=>e.camera),[n,o]=(0,a.useState)(-1),[i,l]=(0,a.useState)({}),[s,c]=(0,a.useState)(()=>({initialized:!1,position:null,quarternion:null})),u=(0,a.useCallback)(e=>{l(t=>({...t,[e.id]:e}))},[]),d=(0,a.useCallback)(e=>{l(t=>{let{[e.id]:r,...n}=t;return n})},[]),m=Object.keys(i).length,f=(0,a.useCallback)(e=>{if(e>=0&&e{f(m?(n+1)%m:-1)},[m,n,f]);(0,a.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,r]=e.slice(2).split("~"),n=t.split(",").map(e=>parseFloat(e)),a=r.split(",").map(e=>parseFloat(e));c({initialized:!0,position:new tw.Vector3(...n),quarternion:new tw.Quaternion(...a)})}else c({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,a.useEffect)(()=>{s.initialized&&s.position&&(t.position.copy(s.position),s.quarternion&&t.quaternion.copy(s.quarternion))},[t,s]),(0,a.useEffect)(()=>{s.initialized&&!s.position&&m>0&&-1===n&&f(0)},[m,f,n,s]);let p=(0,a.useMemo)(()=>({registerCamera:u,unregisterCamera:d,nextCamera:h,setCameraIndex:f,cameraCount:m}),[u,d,h,f,m]);return 0===m&&-1!==n&&o(-1),(0,r.jsx)(tk.Provider,{value:p,children:e})}var tR=e.i(93784),tD=e.i(65349),tL=e.i(51475),tF=e.i(89119);let tI=(0,M.createLogger)("InputConsumer"),tE=Math.PI/2-.01,tB=1/32,tP=2*Math.PI;function tA(e){return(Math.round(e/tP*65536)<<16>>16)*tP/65536}let tz=new tw.Vector3,tU=new tw.Vector3,tG=new tw.Vector3,tW=new tw.Euler(0,0,0,"YXZ"),tH=new tw.Vector3,tV=new tw.Vector3;function tO(e,t,r,n,a,o,i){if(0===n&&0===a&&0===o)return;let l=Math.sin(t),s=Math.cos(t),c=Math.sin(r),u=Math.cos(r),d=i*tB;e.x+=(s*n+l*u*a+l*c*o)*d,e.y+=(-l*n+s*u*a+s*c*o)*d,e.z+=(-c*a+u*o)*d}function tq(){let{moveQueue:e,mode:t,setMode:r}=(0,tD.useInputContext)(),n=(0,k.useLiveSelector)(e=>e.adapter),o=(0,k.useLiveSelector)(e=>e.gameStatus),i=(0,k.useLiveSelector)(e=>e.sendMoves),l=(0,tf.useEngineStoreApi)(),s=(0,t_.useThree)(e=>e.camera),c=(0,tL.useGetTickFraction)(),u=(0,a.useRef)(null),d=(0,a.useRef)([]),m=(0,a.useRef)(0),f=(0,a.useRef)(0),h=(0,a.useRef)(null),p=(0,a.useRef)(0),g=(0,a.useRef)(0),v=(0,a.useRef)({x:0,y:0,z:0}),x=(0,a.useRef)(0),y=(0,a.useRef)(0),b=(0,a.useRef)({x:0,y:0,z:0}),_=(0,a.useRef)(!1),S=(0,a.useRef)(0),w=(0,a.useRef)(0),C=(0,a.useRef)(0),j=(0,a.useRef)(0),M=(0,a.useRef)(0),N=(0,a.useRef)([!1,!1,!1,!1,!1,!1]),T=(0,a.useRef)([!1,!1,!1,!1,!1,!1]),R=!!n&&("connected"===o||"authenticating"===o);return(0,a.useEffect)(()=>{if(R&&n){if(u.current===n)return;tI.info("wiring adapter to engine store");let e=k.liveConnectionStore.getState(),t={source:"live",duration:1/0,missionName:e.mapName??null,gameType:null,serverDisplayName:e.serverName??null,recorderName:e.warriorName??null,recordingDate:null,streamingPlayback:n};l.getState().setRecording(t),l.getState().setPlaybackStatus("playing"),u.current=n,_.current=!1,d.current.length=0,m.current=0,f.current=0,h.current=null,r("fly")}else if(!R&&u.current){let e=l.getState().playback.recording;e?.source==="live"&&l.getState().setRecording(null),u.current=null,_.current=!1,d.current.length=0,r("local")}},[R,n,l,r]),(0,tL.useTick)(()=>{if(!u.current||"connected"!==o)return;let e=S.current,t=w.current;S.current=0,w.current=0;let n=C.current,a=j.current,l=M.current;C.current=0,j.current=0,M.current=0;let s=[...N.current];N.current.fill(!1),s[2]&&!T.current[2]&&(u.current.toggleObserverMode(),tI.info("observer mode: %s",u.current.observerMode),r("follow"===u.current.observerMode?"follow":"fly")),T.current=s;let c=tA(e),f=tA(t);p.current+=c-e,g.current+=f-t,x.current=p.current,y.current=g.current,b.current={...v.current};let h=p.current-c,_=g.current-f;tO(v.current,h,_,n,a,l,80),s[1]=!0;let k=m.current++,R=d.current;R.push({moveIndex:k,move:{x:n,y:a,z:l,yaw:e,pitch:t,roll:0,trigger:s,freeLook:!1},yaw:c,pitch:f,x:n,y:a,z:l}),R.length>45&&R.splice(0,R.length-45);let D=u.current.lastMoveAck;for(;R.length>0&&R[0].moveIndex0){let e=R.slice(0,31);i(e.map(e=>e.move),e[0].moveIndex)}}),(0,tS.useFrame)((r,n)=>{let a=e.current;if(a.length>0){let t=0,r=0,n=0,c=0,d=0,f=0,h=[!1,!1,!1,!1,!1,!1];for(let e of a){t+=e.deltaYaw,r+=e.deltaPitch,n=e.x,c=e.y,d=e.z,f+=e.delta;for(let t=0;t0&&(tG.multiplyScalar(Math.min(1,e)/e*300*L),i.position.add(tG))}return}}if(!R||!u.current||"connected"!==o)return;let F=u.current,I=F.getSnapshot(),E=I?.camera;if(E&&E!==h.current&&"number"==typeof E.yaw&&"number"==typeof E.pitch){h.current=E;let e=F.lastMoveAck;if(e>f.current){f.current=e;let t=d.current;for(;t.length>0&&t[0].moveIndexe.name===t.orbitTargetId);if(!o)return;tV.copy(o.position);let i=tR.streamPlaybackStore.getState().entities.get(t.orbitTargetId);i?.renderType==="Player"&&(tV.y+=1);let l=Math.sin(n),s=Math.cos(n),c=Math.sin(r),u=Math.cos(r);if(tH.set(-u*s,-l,c*s),tH.lengthSq()>1e-8){tH.normalize();let r=Math.max(.1,t.orbitDistance??4);e.camera.position.copy(tV).addScaledVector(tH,r),e.camera.lookAt(tV)}}(r,E,p.current,g.current)}),(0,a.useEffect)(()=>()=>{if(u.current){let e=l.getState().playback.recording;e?.source==="live"&&l.getState().setRecording(null),u.current=null}},[l]),null}var t$=e.i(77964),tK=e.i(91907),tQ=e.i(25947),tY=e.i(46325),tX=e.i(31999),tZ=e.i(89887);function tJ(e){let t,r,o,i,l=(0,n.c)(12),{entity:s}=e,{registerCamera:c,unregisterCamera:u}=tN(),d=(0,a.useId)(),m=s.cameraDataBlock;l[0]!==s.position?(t=s.position?new tw.Vector3(...s.position):new tw.Vector3,l[0]=s.position,l[1]=t):t=l[1];let f=t;l[2]!==s.rotation?(r=s.rotation?new tw.Quaternion(...s.rotation):new tw.Quaternion,l[2]=s.rotation,l[3]=r):r=l[3];let h=r;return l[4]!==m||l[5]!==d||l[6]!==f||l[7]!==c||l[8]!==h||l[9]!==u?(o=()=>{if("Observer"===m){let e={id:d,position:f,rotation:h};return c(e),()=>{u(e)}}},i=[d,m,c,u,f,h],l[4]=m,l[5]=d,l[6]=f,l[7]=c,l[8]=h,l[9]=u,l[10]=o,l[11]=i):(o=l[10],i=l[11]),(0,a.useEffect)(o,i),null}function t0(e){let t,a=(0,n.c)(3),{entity:o}=e;return a[0]!==o.label||a[1]!==o.position?(t=o.label?(0,r.jsx)(tZ.FloatingLabel,{position:o.position,opacity:.6,children:o.label}):null,a[0]=o.label,a[1]=o.position,a[2]=t):t=a[2],t}var t1=e.i(66027),t2=e.i(63318),t3=e.i(12979),t5=e.i(75567),t4=e.i(47071);let t6={value:!0},t8=` +vec3 terrainLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 terrainSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`;var t7=e.i(56893),t9=e.i(47021),re=e.i(48066);let rt={0:32,1:32,2:32,3:32,4:32,5:32},rr=(0,a.memo)(function({displacementMap:e,visibilityMask:t,textureNames:n,alphaTextures:o,detailTextureName:i,lightmap:l}){let{debugMode:s}=(0,_.useDebug)(),c=(0,t7.useAnisotropy)(),u=(0,t4.useTexture)(n.map(e=>(0,t3.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,t5.setupTexture)(e,{anisotropy:c}))}),d=i?(0,t3.textureToUrl)(i):null,m=(0,t4.useTexture)(d??t3.FALLBACK_TEXTURE_URL,e=>{(0,t5.setupTexture)(e,{anisotropy:c})}),f=(0,a.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:n,tiling:a,detailTexture:o=null,lightmap:i=null}){e.uniforms.sunLightPointsDown=t6;let l=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),n&&(e.uniforms.visibilityMask={value:n}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:a[r]??32}}),i&&(e.uniforms.terrainLightmap={value:i}),o&&(e.uniforms.detailTexture={value:o},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include +varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include +vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` +uniform sampler2D albedo0; +uniform sampler2D albedo1; +uniform sampler2D albedo2; +uniform sampler2D albedo3; +uniform sampler2D albedo4; +uniform sampler2D albedo5; +uniform sampler2D mask0; +uniform sampler2D mask1; +uniform sampler2D mask2; +uniform sampler2D mask3; +uniform sampler2D mask4; +uniform sampler2D mask5; +uniform float tiling0; +uniform float tiling1; +uniform float tiling2; +uniform float tiling3; +uniform float tiling4; +uniform float tiling5; +${n?"uniform sampler2D visibilityMask;":""} +${i?"uniform sampler2D terrainLightmap;":""} +uniform bool sunLightPointsDown; +${o?`uniform sampler2D detailTexture; +uniform float detailTiling; +uniform float detailFadeDistance; +varying vec3 vTerrainWorldPos;`:""} + +${t8} + +// Global variable to store shadow factor from RE_Direct for use in output calculation +float terrainShadowFactor = 1.0; +`+e.fragmentShader,n){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} + // Early discard for invisible areas (before fog/lighting) + float visibility = texture2D(visibilityMask, vMapUv).r; + if (visibility < 0.5) { + discard; + } + `)}e.fragmentShader=e.fragmentShader.replace("#include ",` + // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) + vec2 baseUv = vMapUv; + vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; + ${l>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} + ${l>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} + ${l>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} + ${l>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} + ${l>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} + + // Sample alpha masks for all layers (use R channel) + // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), + // but GPU linear filtering samples at texel centers. This offset aligns them. + vec2 alphaUv = baseUv + vec2(0.5 / 256.0); + float a0 = texture2D(mask0, alphaUv).r; + ${l>1?"float a1 = texture2D(mask1, alphaUv).r;":""} + ${l>2?"float a2 = texture2D(mask2, alphaUv).r;":""} + ${l>3?"float a3 = texture2D(mask3, alphaUv).r;":""} + ${l>4?"float a4 = texture2D(mask4, alphaUv).r;":""} + ${l>5?"float a5 = texture2D(mask5, alphaUv).r;":""} + + // Torque-style additive weighted blending (blender.cc): + // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... + // Each layer's alpha map defines its contribution weight. + vec3 blended = c0 * a0; + ${l>1?"blended += c1 * a1;":""} + ${l>2?"blended += c2 * a2;":""} + ${l>3?"blended += c3 * a3;":""} + ${l>4?"blended += c4 * a4;":""} + ${l>5?"blended += c5 * a5;":""} + + // Assign to diffuseColor before lighting + vec3 textureColor = blended; + + ${o?`// Detail texture blending (Torque-style multiplicative blend) + // Sample detail texture at high frequency tiling + vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; + + // Calculate distance-based fade factor using world positions + // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance + float distToCamera = distance(vTerrainWorldPos, cameraPosition); + float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); + + // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) + // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray + // Direct multiplication adds subtle darkening for surface detail + textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} + + // Store blended texture in diffuseColor (still in linear space here) + // We'll convert to sRGB in the output calculation + diffuseColor.rgb = textureColor; +`),i&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include + +// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting +#undef RE_Direct +void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { + // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient + // This prevents shadow acne from light hitting terrain backfaces + if (!sunLightPointsDown) { + terrainShadowFactor = 0.0; + return; + } + // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) + // Extract shadow factor by comparing to original sun color + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 originalSunColor = directionalLights[0].color; + float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); + float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); + terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); + #endif + // Don't add to reflectedLight - we'll compute lighting in gamma space at output +} +#define RE_Direct RE_Direct_TerrainShadow + +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +// Clear indirect diffuse - we'll compute ambient in gamma space +#if defined( RE_IndirectDiffuse ) + irradiance = vec3(0.0); +#endif +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include + // Clear Three.js lighting - we compute everything in gamma space + reflectedLight.directDiffuse = vec3(0.0); + reflectedLight.indirectDiffuse = vec3(0.0); +`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +{ + // Get texture in sRGB space (undo Three.js linear decode) + vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); + + ${i?` + // Sample terrain lightmap for smooth NdotL + vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); + float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; + + // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) + // Three.js interprets them as linear, but the numerical values are preserved + #if ( NUM_DIR_LIGHTS > 0 ) + vec3 sunColorSRGB = directionalLights[0].color; + #else + vec3 sunColorSRGB = vec3(0.7); + #endif + vec3 ambientColorSRGB = ambientLightColor; + + // Torque formula (terrLighting.cc:471-483): + // lighting = ambient + NdotL * shadowFactor * sunColor + // Clamp lighting to [0,1] before multiplying by texture + vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); + `:` + // No lightmap - use simple ambient lighting + vec3 lightingSRGB = ambientLightColor; + `} + + // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space + vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + + // Convert back to linear for Three.js output pipeline + outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; +} +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE + // Debug mode: overlay green grid matching terrain grid squares (256x256) + float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); + vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green + gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); +#endif + +#include `)}({shader:e,baseTextures:u,alphaTextures:o,visibilityMask:t,tiling:rt,detailTexture:d?m:null,lightmap:l}),(0,t9.injectCustomFog)(e,re.globalFogUniforms)},[u,o,t,m,d,l]),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!s,e.needsUpdate=!0)},[s]);let p=`${d?"detail":"nodetail"}-${l?"lightmap":"nolightmap"}`;return(0,r.jsx)("meshLambertMaterial",{ref:h,map:e,depthWrite:!0,side:tw.FrontSide,defines:{DEBUG_MODE:+!!s},onBeforeCompile:f},p)}),rn=(0,a.memo)(function(e){let t,o,i=(0,n.c)(8),{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),i[0]=t):t=i[0],i[1]!==u||i[2]!==d||i[3]!==l||i[4]!==m||i[5]!==c||i[6]!==s?(o=(0,r.jsx)(a.Suspense,{fallback:t,children:(0,r.jsx)(rr,{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m})}),i[1]=u,i[2]=d,i[3]=l,i[4]=m,i[5]=c,i[6]=s,i[7]=o):o=i[7],o}),ra=(0,a.memo)(function(e){let t,a,o,i=(0,n.c)(15),{tileX:l,tileZ:s,blockSize:c,basePosition:u,textureNames:d,geometry:m,displacementMap:f,visibilityMask:h,alphaTextures:p,detailTextureName:g,lightmap:v,visible:x}=e,y=void 0===x||x,b=c/2,_=u.x+l*c+b,S=u.z+s*c+b;i[0]!==_||i[1]!==S?(t=[_,0,S],i[0]=_,i[1]=S,i[2]=t):t=i[2];let w=t;return i[3]!==p||i[4]!==g||i[5]!==f||i[6]!==v||i[7]!==d||i[8]!==h?(a=(0,r.jsx)(rn,{displacementMap:f,visibilityMask:h,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),i[3]=p,i[4]=g,i[5]=f,i[6]=v,i[7]=d,i[8]=h,i[9]=a):a=i[9],i[10]!==m||i[11]!==w||i[12]!==a||i[13]!==y?(o=(0,r.jsx)("mesh",{position:w,geometry:m,castShadow:!0,receiveShadow:!0,visible:y,children:a}),i[10]=m,i[11]=w,i[12]=a,i[13]=y,i[14]=o):o=i[14],o});function ro(e){}let ri=(0,M.createLogger)("TerrainBlock");function rl(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,n=r>>8&255,a=r>>16,o=256*n;for(let r=0;r0?S.visibleDistance:600,E=(0,t_.useThree)(rc),B=-(128*D);N[0]!==B?(t={x:B,z:B},N[0]=B,N[1]=t):t=N[1];let P=t;N[2]!==T.emptySquareRuns?(o=T.emptySquareRuns??[],N[2]=T.emptySquareRuns,N[3]=o):o=N[3];let A=o,{data:z}=((M=(0,n.c)(8))[0]!==R?(w={queryKey:["terrain",R],queryFn:()=>(ri.debug("Loading terrain: %s",R),(0,t3.loadTerrain)(R))},M[0]=R,M[1]=w):w=M[1],k=(0,t1.useQuery)(w),M[2]!==k.data||M[3]!==k.error||M[4]!==k.status||M[5]!==R?(C=()=>{ri.debug("Query status: %s%s%s file=%s",k.status,k.error?` error=${k.error.message}`:"",k.data?" (data ready)":" (no data)",R)},j=[k.status,k.error,k.data,R],M[2]=k.data,M[3]=k.error,M[4]=k.status,M[5]=R,M[6]=C,M[7]=j):(C=M[6],j=M[7]),(0,a.useEffect)(C,j),k);e:{let e;if(!z){i=null;break e}let t=256*D;N[4]!==t||N[5]!==D||N[6]!==z.heightMap?(!function(e,t,r){let n=e.attributes.position,a=e.attributes.uv,o=e.attributes.normal,i=n.array,l=a.array,s=o.array,c=n.count,u=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let n=Math.floor(e=Math.max(0,Math.min(255,e))),a=Math.floor(r=Math.max(0,Math.min(255,r))),o=Math.min(n+1,255),i=Math.min(a+1,255),l=e-n,s=r-a;return(t[256*a+n]/65535*2048*(1-l)+t[256*a+o]/65535*2048*l)*(1-s)+(t[256*i+n]/65535*2048*(1-l)+t[256*i+o]/65535*2048*l)*s};for(let e=0;e0?(h/=v,p/=v,g/=v):(h=0,p=1,g=0),s[3*e]=h,s[3*e+1]=p,s[3*e+2]=g}n.needsUpdate=!0,o.needsUpdate=!0}(e=function(e,t){let r=new tw.BufferGeometry,n=new Float32Array(198147),a=new Float32Array(198147),o=new Float32Array(132098),i=new Uint32Array(393216),l=0,s=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let i=257*t+r;n[3*i]=r*s-e/2,n[3*i+1]=e/2-t*s,n[3*i+2]=0,a[3*i]=0,a[3*i+1]=0,a[3*i+2]=1,o[2*i]=r/256,o[2*i+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,n=r+1,a=(e+1)*257+t,o=a+1;((t^e)&1)==0?(i[l++]=r,i[l++]=a,i[l++]=o,i[l++]=r,i[l++]=o,i[l++]=n):(i[l++]=r,i[l++]=a,i[l++]=n,i[l++]=n,i[l++]=a,i[l++]=o)}return r.setIndex(new tw.BufferAttribute(i,1)),r.setAttribute("position",new tw.Float32BufferAttribute(n,3)),r.setAttribute("normal",new tw.Float32BufferAttribute(a,3)),r.setAttribute("uv",new tw.Float32BufferAttribute(o,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),z.heightMap,D),N[4]=t,N[5]=D,N[6]=z.heightMap,N[7]=e):e=N[7],i=e}let U=i;N[8]!==D||N[9]!==z?(l=()=>{if(z){var e;return ro((e=z.heightMap,(t,r)=>{let n=Math.max(0,Math.min(255,t/D+128)),a=Math.max(0,Math.min(255,r/D+128)),o=Math.floor(n),i=Math.floor(a),l=Math.min(o+1,255),s=Math.min(i+1,255),c=n-o,u=a-i;return((e[256*i+o]*(1-c)+e[256*i+l]*c)*(1-u)+(e[256*s+o]*(1-c)+e[256*s+l]*c)*u)/65535*2048})),ru}},s=[z,D],N[8]=D,N[9]=z,N[10]=l,N[11]=s):(l=N[10],s=N[11]),(0,a.useEffect)(l,s);let G=(0,eY.useSceneSun)();t:{let e,t;if(!G){let e;N[12]===Symbol.for("react.memo_cache_sentinel")?(e=new tw.Vector3(.57735,-.57735,.57735),N[12]=e):e=N[12],c=e;break t}N[13]!==G.direction?(e=(0,t2.torqueToThree)(G.direction),N[13]=G.direction,N[14]=e):e=N[14];let[r,n,a]=e,o=Math.sqrt(r*r+n*n+a*a),i=r/o,l=n/o,s=a/o;N[15]!==s||N[16]!==i||N[17]!==l?(t=new tw.Vector3(i,l,s),N[15]=s,N[16]=i,N[17]=l,N[18]=t):t=N[18],c=t}let W=c;r:{let e;if(!z){u=null;break r}N[19]!==D||N[20]!==W||N[21]!==z.heightMap?(e=function(e,t,r){let n=(t,r)=>{let n=Math.max(0,Math.min(255,t)),a=Math.max(0,Math.min(255,r)),o=Math.floor(n),i=Math.floor(a),l=Math.min(o+1,255),s=Math.min(i+1,255),c=n-o,u=a-i;return((e[256*i+o]/65535*(1-c)+e[256*i+l]/65535*c)*(1-u)+(e[256*s+o]/65535*(1-c)+e[256*s+l]/65535*c)*u)*2048},a=new tw.Vector3(-t.x,-t.y,-t.z).normalize(),o=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=t/2+.25,l=e/2+.25,s=n(i,l),c=n(i-.5,l),u=n(i+.5,l),d=n(i,l-.5),m=-((n(i,l+.5)-d)/1),f=-((u-c)/1),h=Math.sqrt(m*m+r*r+f*f),p=Math.max(0,m/h*a.x+r/h*a.y+f/h*a.z),g=1;p>0&&(g=function(e,t,r,n,a,o){let i=n.z/a,l=n.x/a,s=n.y,c=Math.sqrt(i*i+l*l);if(c<1e-4)return 1;let u=.5/c,d=i*u,m=l*u,f=s*u,h=e,p=t,g=r+.1;for(let e=0;e<768&&(h+=d,p+=m,g+=f,!(h<0)&&!(h>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(Q).fill(null),N[32]=Q,N[33]=g):g=N[33];let[X,Z]=(0,a.useState)(g);N[34]===Symbol.for("react.memo_cache_sentinel")?(v={xStart:0,xEnd:0,zStart:0,zEnd:0},N[34]=v):v=N[34];let J=(0,a.useRef)(v);return(N[35]!==P.x||N[36]!==P.z||N[37]!==F||N[38]!==E.position.x||N[39]!==E.position.z||N[40]!==Q||N[41]!==I?(x=()=>{let e=E.position.x-P.x,t=E.position.z-P.z,r=Math.floor((e-I)/F),n=Math.ceil((e+I)/F),a=Math.floor((t-I)/F),o=Math.ceil((t+I)/F),i=J.current;if(r===i.xStart&&n===i.xEnd&&a===i.zStart&&o===i.zEnd)return;i.xStart=r,i.xEnd=n,i.zStart=a,i.zEnd=o;let l=[];for(let e=r;e{let t=X[e];return(0,r.jsx)(ra,{tileX:t?.tileX??0,tileZ:t?.tileZ??0,blockSize:F,basePosition:P,textureNames:z.textureNames,geometry:U,displacementMap:V,visibilityMask:q,alphaTextures:$,detailTextureName:L,lightmap:H,visible:null!==t},e)}),N[53]=P,N[54]=F,N[55]=L,N[56]=Y,N[57]=$,N[58]=V,N[59]=U,N[60]=z.textureNames,N[61]=H,N[62]=X,N[63]=b):b=N[63],N[64]!==y||N[65]!==b?(_=(0,r.jsxs)(r.Fragment,{children:[y,b]}),N[64]=y,N[65]=b,N[66]=_):_=N[66],_):(ri.debug("Not ready: terrain=%s geometry=%s displacement=%s alpha=%s",!!z,!!U,!!V,!!$),null)});function rc(e){return e.camera}function ru(){return ro(null)}function rd(e){return(0,t5.setupMask)(e)}function rm(e,t){return t}var rf=e.i(8597),rh=e.i(78140);let rp=` +vec3 interiorLinearToSRGB(vec3 linear) { + vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; + vec3 lower = linear * 12.92; + return mix(lower, higher, step(vec3(0.0031308), linear)); +} + +vec3 interiorSRGBToLinear(vec3 srgb) { + vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); + vec3 lower = srgb / 12.92; + return mix(lower, higher, step(vec3(0.04045), srgb)); +} + +// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines +// Returns 1.0 on grid lines, 0.0 elsewhere +float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); +} +`,rg=(0,M.createLogger)("InteriorInstance");function rv({materialName:e,material:t,lightMap:n}){let o=(0,_.useDebug)(),i=o?.debugMode??!1,l=(0,t7.useAnisotropy)(),s=(0,t3.textureToUrl)(e),c=(0,t4.useTexture)(s,e=>(0,t5.setupTexture)(e,{anisotropy:l})),u=new Set(t?.userData?.flag_names??[]).has("SelfIlluminating"),d=new Set(t?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),m=(0,a.useCallback)(e=>{let t;(0,t9.injectCustomFog)(e,re.globalFogUniforms),t=d??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new tw.Vector3(0,.4,1):new tw.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +${rp} +uniform bool useSceneLighting; +uniform vec3 interiorDebugColor; +`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation +#ifdef USE_LIGHTMAP + vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space +// Get texture in sRGB space (undo Three.js linear decode) +vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); + +// Compute lighting in sRGB space +vec3 lightingSRGB = vec3(0.0); + +if (useSceneLighting) { + // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI + // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear + vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; + vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); + vec3 extractedLighting = totalLight * PI / safeTexLinear; + // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors + // are sRGB values (Torque used them directly in gamma space). Three.js treats them + // as linear but the numerical values are the same. DO NOT convert to sRGB here! + // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap + // (sceneLighting.cc line 1785: tmp.clamp()) + lightingSRGB = clamp(extractedLighting, 0.0, 1.0); +} + +// Add lightmap contribution (for BOTH outside and inside surfaces) +// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load +// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. +#ifdef USE_LIGHTMAP + // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back + lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); +#endif +// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) +lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); + +// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space +vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); + +// Convert back to linear for Three.js output pipeline +vec3 resultLinear = interiorSRGBToLinear(resultSRGB); + +// Reassign outgoingLight before opaque_fragment consumes it +outgoingLight = resultLinear + totalEmissiveRadiance; + +#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering +// Blue grid = SurfaceOutsideVisible (receives scene ambient light) +// Red grid = inside surface (no scene ambient light) +#if DEBUG_MODE && defined(USE_MAP) + // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide + float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); + gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); +#endif + +#include `)},[d]),f=(0,a.useRef)(null),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=f.current??h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let p={DEBUG_MODE:+!!i},g=`${d}`;return u?(0,r.jsx)("meshBasicMaterial",{ref:f,map:c,toneMapped:!1,defines:p,onBeforeCompile:m},g):(0,r.jsx)("meshLambertMaterial",{ref:h,map:c,lightMap:n,toneMapped:!1,defines:p,onBeforeCompile:m},g)}function rx(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=tw.SRGBColorSpace),t??null}function ry(e){let t,a,o,i=(0,n.c)(13),{node:l}=e;e:{let e,r;if(!l.material){let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0],t=e;break e}if(Array.isArray(l.material)){let e;i[1]!==l.material?(e=l.material.map(rb),i[1]=l.material,i[2]=e):e=i[2],t=e;break e}i[3]!==l.material?(e=rx(l.material),i[3]=l.material,i[4]=e):e=i[4],i[5]!==e?(r=[e],i[5]=e,i[6]=r):r=i[6],t=r}let s=t;return i[7]!==s||i[8]!==l.material?(a=l.material?(0,r.jsx)(tY.DebugSuspense,{name:`InteriorTexture:${Array.isArray(l.material)?l.material[0]?.userData?.resource_path:l.material?.userData?.resource_path??"?"}`,fallback:(0,r.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,t)=>(0,r.jsx)(rv,{materialName:e.userData.resource_path,material:e,lightMap:s[t]},t)):(0,r.jsx)(rv,{materialName:l.material.userData.resource_path,material:l.material,lightMap:s[0]})}):null,i[7]=s,i[8]=l.material,i[9]=a):a=i[9],i[10]!==l.geometry||i[11]!==a?(o=(0,r.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:a}),i[10]=l.geometry,i[11]=a,i[12]=o):o=i[12],o}function rb(e){return rx(e)}let r_=(0,a.memo)(function(e){let t,a,o,i,l,s,c,u=(0,n.c)(10),{interiorFile:d,ghostIndex:m}=e,{nodes:f}=((s=(0,n.c)(2))[0]!==d?(l=(0,t3.interiorToUrl)(d),s[0]=d,s[1]=l):l=s[1],c=l,(0,rh.useGLTF)(c)),h=(0,_.useDebug)(),p=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(t=[0,-Math.PI/2,0],u[0]=t):t=u[0],u[1]!==f?(a=Object.entries(f).filter(rj).map(rM),u[1]=f,u[2]=a):a=u[2],u[3]!==p||u[4]!==m||u[5]!==d?(o=p?(0,r.jsxs)(tZ.FloatingLabel,{children:[m,": ",d]}):null,u[3]=p,u[4]=m,u[5]=d,u[6]=o):o=u[6],u[7]!==a||u[8]!==o?(i=(0,r.jsxs)("group",{rotation:t,children:[a,o]}),u[7]=a,u[8]=o,u[9]=i):i=u[9],i});function rS(e){let t,a,o,i,l=(0,n.c)(9),{color:s,label:c}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)("boxGeometry",{args:[10,10,10]}),l[0]=t):t=l[0],l[1]!==s?(a=(0,r.jsx)("meshStandardMaterial",{color:s,wireframe:!0}),l[1]=s,l[2]=a):a=l[2],l[3]!==s||l[4]!==c?(o=c?(0,r.jsx)(tZ.FloatingLabel,{color:s,children:c}):null,l[3]=s,l[4]=c,l[5]=o):o=l[5],l[6]!==a||l[7]!==o?(i=(0,r.jsxs)("mesh",{children:[t,a,o]}),l[6]=a,l[7]=o,l[8]=i):i=l[8],i}function rw(e){let t,a=(0,n.c)(3),{label:o}=e,i=(0,_.useDebug)(),l=i?.debugMode??!1;return a[0]!==l||a[1]!==o?(t=l?(0,r.jsx)(rS,{color:"red",label:o}):null,a[0]=l,a[1]=o,a[2]=t):t=a[2],t}let rC=(0,a.memo)(function(e){let t,a,o,i,l,s,c,u,d,m,f=(0,n.c)(26),{scene:h}=e;f[0]!==h.transform.position?(t=(0,t2.torqueToThree)(h.transform.position),f[0]=h.transform.position,f[1]=t):t=f[1];let p=t;f[2]!==h.transform?(a=(0,t2.matrixFToQuaternion)(h.transform),f[2]=h.transform,f[3]=a):a=f[3];let g=a;f[4]!==h.scale?(o=(0,t2.torqueScaleToThree)(h.scale),f[4]=h.scale,f[5]=o):o=f[5];let v=o,x=`${h.ghostIndex}: ${h.interiorFile}`;f[6]!==x?(i=(0,r.jsx)(rw,{label:x}),f[6]=x,f[7]=i):i=f[7],f[8]!==h.interiorFile?(l=e=>{rg.error("Failed to load %s: %s",h.interiorFile,e.message)},f[8]=h.interiorFile,f[9]=l):l=f[9];let y=`InteriorModel:${h.interiorFile}`;return f[10]===Symbol.for("react.memo_cache_sentinel")?(s=(0,r.jsx)(rS,{color:"orange"}),f[10]=s):s=f[10],f[11]!==h.ghostIndex||f[12]!==h.interiorFile?(c=(0,r.jsx)(r_,{interiorFile:h.interiorFile,ghostIndex:h.ghostIndex}),f[11]=h.ghostIndex,f[12]=h.interiorFile,f[13]=c):c=f[13],f[14]!==y||f[15]!==c?(u=(0,r.jsx)(tY.DebugSuspense,{name:y,fallback:s,children:c}),f[14]=y,f[15]=c,f[16]=u):u=f[16],f[17]!==u||f[18]!==i||f[19]!==l?(d=(0,r.jsx)(rf.ErrorBoundary,{fallback:i,onError:l,children:u}),f[17]=u,f[18]=i,f[19]=l,f[20]=d):d=f[20],f[21]!==p||f[22]!==g||f[23]!==v||f[24]!==d?(m=(0,r.jsx)("group",{position:p,quaternion:g,scale:v,children:d}),f[21]=p,f[22]=g,f[23]=v,f[24]=d,f[25]=m):m=f[25],m});function rj(e){let[,t]=e;return t.isMesh}function rM(e){let[t,n]=e;return(0,r.jsx)(ry,{node:n},t)}var rk=e.i(99143);function rN(e,{path:t}){let[r]=(0,rk.useLoader)(tw.CubeTextureLoader,[e],e=>e.setPath(t));return r}rN.preload=(e,{path:t})=>rk.useLoader.preload(tw.CubeTextureLoader,[e],e=>e.setPath(t));let rT=()=>{};function rR(e){return e.wrapS=tw.RepeatWrapping,e.wrapT=tw.RepeatWrapping,e.minFilter=tw.LinearFilter,e.magFilter=tw.LinearFilter,e.colorSpace=tw.NoColorSpace,e.needsUpdate=!0,e}let rD=` + attribute float alpha; + + uniform vec2 uvOffset; + + varying vec2 vUv; + varying float vAlpha; + + void main() { + // Apply UV offset for scrolling + vUv = uv + uvOffset; + vAlpha = alpha; + + vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); + // Set depth to far plane so clouds are always visible and behind other geometry + gl_Position = pos.xyww; + } +`,rL=` + uniform sampler2D cloudTexture; + uniform float debugMode; + uniform int layerIndex; + + varying vec2 vUv; + varying float vAlpha; + + // Debug grid using screen-space derivatives for sharp, anti-aliased lines + float debugGrid(vec2 uv, float gridSize, float lineWidth) { + vec2 scaledUV = uv * gridSize; + vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); + float line = min(grid.x, grid.y); + return 1.0 - min(line / lineWidth, 1.0); + } + + void main() { + vec4 texColor = texture2D(cloudTexture, vUv); + + // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color + // Vertex color is white with varying alpha, so: + // Final RGB = Texture RGB \xd7 1.0 = Texture RGB + // Final Alpha = Texture Alpha \xd7 Vertex Alpha + float finalAlpha = texColor.a * vAlpha; + vec3 color = texColor.rgb; + + // Debug mode: overlay R/G/B grid for layers 0/1/2 + if (debugMode > 0.5) { + float gridIntensity = debugGrid(vUv, 4.0, 1.5); + vec3 gridColor; + if (layerIndex == 0) { + gridColor = vec3(1.0, 0.0, 0.0); // Red + } else if (layerIndex == 1) { + gridColor = vec3(0.0, 1.0, 0.0); // Green + } else { + gridColor = vec3(0.0, 0.0, 1.0); // Blue + } + color = mix(color, gridColor, gridIntensity * 0.5); + } + + // Output clouds with texture color and combined alpha + gl_FragColor = vec4(color, finalAlpha); + } +`;function rF({textureUrl:e,radius:t,heightPercent:n,speed:o,windDirection:i,layerIndex:l}){let{debugMode:s}=(0,_.useDebug)(),{animationEnabled:c}=(0,_.useSettings)(),u=(0,a.useRef)(null),d=(0,t4.useTexture)(e,rR),m=(0,a.useMemo)(()=>{let e=n-.05;return function(e,t,r,n){var a;let o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_,S=new tw.BufferGeometry,w=new Float32Array(75),C=new Float32Array(50),j=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let n=5*t+r,a=-e+r*M,o=e-t*M,i=e*j[n];w[3*n]=a,w[3*n+1]=i,w[3*n+2]=o,C[2*n]=r,C[2*n+1]=t}a=w,o=e=>({x:a[3*e],y:a[3*e+1],z:a[3*e+2]}),i=(e,t,r,n)=>{a[3*e]=t,a[3*e+1]=r,a[3*e+2]=n},l=o(1),s=o(3),c=o(5),u=o(6),d=o(8),m=o(9),f=o(15),h=o(16),p=o(18),g=o(19),v=o(21),x=o(23),y=c.x+(l.x-c.x)*.5,b=c.y+(l.y-c.y)*.5,_=c.z+(l.z-c.z)*.5,i(0,u.x+(y-u.x)*2,u.y+(b-u.y)*2,u.z+(_-u.z)*2),y=m.x+(s.x-m.x)*.5,b=m.y+(s.y-m.y)*.5,_=m.z+(s.z-m.z)*.5,i(4,d.x+(y-d.x)*2,d.y+(b-d.y)*2,d.z+(_-d.z)*2),y=v.x+(f.x-v.x)*.5,b=v.y+(f.y-v.y)*.5,_=v.z+(f.z-v.z)*.5,i(20,h.x+(y-h.x)*2,h.y+(b-h.y)*2,h.z+(_-h.z)*2),y=x.x+(g.x-x.x)*.5,b=x.y+(g.y-x.y)*.5,_=x.z+(g.z-x.z)*.5,i(24,p.x+(y-p.x)*2,p.y+(b-p.y)*2,p.z+(_-p.z)*2);let k=function(e,t){let r=new Float32Array(25);for(let n=0;n<25;n++){let a=e[3*n],o=e[3*n+2],i=1.3-Math.sqrt(a*a+o*o)/t;i<.4?i=0:i>.8&&(i=1),r[n]=i}return r}(w,e),N=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,n=r+1,a=r+5,o=a+1;N.push(r,a,o),N.push(r,o,n)}return S.setIndex(N),S.setAttribute("position",new tw.Float32BufferAttribute(w,3)),S.setAttribute("uv",new tw.Float32BufferAttribute(C,2)),S.setAttribute("alpha",new tw.Float32BufferAttribute(k,1)),S.computeBoundingSphere(),S}(t,n,e,0)},[t,n]);(0,a.useEffect)(()=>()=>{m.dispose()},[m]);let f=(0,a.useMemo)(()=>new tw.ShaderMaterial({uniforms:{cloudTexture:{value:d},uvOffset:{value:new tw.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:l}},vertexShader:rD,fragmentShader:rL,transparent:!0,depthWrite:!1,side:tw.DoubleSide}),[d,s,l]);return(0,a.useEffect)(()=>()=>{f.dispose()},[f]),(0,tS.useFrame)(c?(e,t)=>{let r=1e3*t/32;u.current??=new tw.Vector2(0,0),u.current.x+=i.x*o*r,u.current.y+=i.y*o*r,u.current.x-=Math.floor(u.current.x),u.current.y-=Math.floor(u.current.y),f.uniforms.uvOffset.value.copy(u.current)}:rT),(0,r.jsx)("mesh",{geometry:m,frustumCulled:!1,renderOrder:10,children:(0,r.jsx)("primitive",{object:f,attach:"material"})})}function rI(e){var t;let o,i,l,s,c,u,d,m,f,h,p,g=(0,n.c)(18),{scene:v}=e,{data:x}=(t=v.materialList||void 0,(h=(0,n.c)(7))[0]!==t?(d=["detailMapList",t],m=()=>(0,t3.loadDetailMapList)(t),h[0]=t,h[1]=d,h[2]=m):(d=h[1],m=h[2]),p=!!t,h[3]!==d||h[4]!==m||h[5]!==p?(f={queryKey:d,queryFn:m,enabled:p},h[3]=d,h[4]=m,h[5]=p,h[6]=f):f=h[6],(0,t1.useQuery)(f)),y=.95*(v.visibleDistance>0?v.visibleDistance:500);g[0]!==v.cloudLayers?(o=v.cloudLayers.map(rB),g[0]=v.cloudLayers,g[1]=o):o=g[1];let b=o;g[2]!==v.cloudLayers?(i=v.cloudLayers.map(rE),g[2]=v.cloudLayers,g[3]=i):i=g[3];let _=i;e:{let e,{x:t,y:r}=v.windVelocity;if(0!==t||0!==r){let e;g[4]!==t||g[5]!==r?(e=new tw.Vector2(r,-t).normalize(),g[4]=t,g[5]=r,g[6]=e):e=g[6],l=e;break e}g[7]===Symbol.for("react.memo_cache_sentinel")?(e=new tw.Vector2(1,0),g[7]=e):e=g[7],l=e}let S=l;t:{let e;if(!x){let e;g[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],g[8]=e):e=g[8],s=e;break t}if(g[9]!==_||g[10]!==b||g[11]!==x){e=[];for(let t=0;t<3;t++){let r=x[7+t];r&&e.push({texture:r,height:_[t],speed:b[t]})}g[9]=_,g[10]=b,g[11]=x,g[12]=e}else e=g[12];s=e}let w=s,C=(0,a.useRef)(null);return(g[13]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let{camera:t}=e;C.current&&C.current.position.copy(t.position)},g[13]=c):c=g[13],(0,tS.useFrame)(c),w&&0!==w.length)?(g[14]!==w||g[15]!==y||g[16]!==S?(u=(0,r.jsx)("group",{ref:C,children:w.map((e,t)=>{let n=(0,t3.textureToUrl)(e.texture);return(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(rF,{textureUrl:n,radius:y,heightPercent:e.height,speed:e.speed,windDirection:S,layerIndex:t})},t)})}),g[14]=w,g[15]=y,g[16]=S,g[17]=u):u=g[17],u):null}function rE(e,t){return e.heightPercent||[.35,.25,.2][t]}function rB(e,t){return e.speed||[1e-4,2e-4,3e-4][t]}e.i(62395);let rP=(0,M.createLogger)("Sky"),rA=!1;function rz(e){return[new tw.Color().setRGB(e.r,e.g,e.b),new tw.Color().setRGB(e.r,e.g,e.b).convertSRGBToLinear()]}function rU({skyBoxFiles:e,fogColor:t,fogState:n}){let o=(0,t_.useThree)(e=>e.camera),i=rN(e,{path:""}),l=!!t,s=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),c=(0,a.useMemo)(()=>n?(0,re.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),u=(0,a.useRef)({skybox:{value:i},fogColor:{value:t??new tw.Color(0,0,0)},enableFog:{value:l},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:re.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),d=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,a.useEffect)(()=>{u.current.skybox.value=i,u.current.fogColor.value=t??new tw.Color(0,0,0),u.current.enableFog.value=l,u.current.fogVolumeData.value=c,u.current.horizonFogHeight.value=d},[i,t,l,c,d]),(0,r.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,r.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform samplerCube skybox; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + // shaderMaterial does NOT get automatic linear->sRGB output conversion + // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear + vec4 skyColor = textureCube(skybox, direction); + vec3 finalColor; + + if (enableFog) { + vec3 effectiveFogColor = fogColor; + + // Calculate how much fog volume the ray passes through + // For skybox at "infinite" distance, the relevant height is how much + // of the volume is above/below camera depending on view direction + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // Check if camera is inside this volume + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + // Camera is inside the fog volume + // Looking horizontally or up at shallow angles means ray travels + // through more fog before exiting the volume + float heightAboveCamera = volMaxH - cameraHeight; + float heightBelowCamera = cameraHeight - volMinH; + float volumeHeight = volMaxH - volMinH; + + // For horizontal rays (direction.y ≈ 0), maximum fog influence + // For rays going up steeply, less fog (exits volume quickly) + // For rays going down, more fog (travels through volume below) + float rayInfluence; + if (direction.y >= 0.0) { + // Looking up: influence based on how steep we're looking + // Shallow angles = long path through fog = high influence + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + // Looking down: always high fog (into the volume) + rayInfluence = 1.0; + } + + // Scale by percentage and volume depth factor + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction (for haze at horizon) + // In Torque, the fog "bans" (bands) are rendered as geometry from + // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. + // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). + // + // horizonFogHeight is the direction.y value where the fog band ends: + // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) + // + // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 + // + // Torque renders the fog bands as geometry with linear vertex alpha + // interpolation. We use a squared curve (t^2) to create a gentler + // falloff at the top of the gradient, matching Tribes 2's appearance. + float baseFogFactor; + if (direction.y <= 0.0) { + // Looking at or below horizon: full fog + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + // Above fog band: no fog + baseFogFactor = 0.0; + } else { + // Within fog band: squared curve for gentler falloff at top + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + // When inside a volume, increase fog intensity + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); + } else { + finalColor = skyColor.rgb; + } + // Convert linear result to sRGB for display + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function rG(e){let t,o,i,l,s,c,u,d=(0,n.c)(6),{materialList:m,fogColor:f,fogState:h}=e,{data:p}=((c=(0,n.c)(8))[0]!==m?(i={queryKey:["detailMapList",m],queryFn:()=>(rP.debug("Loading detail map list: %s",m),(0,t3.loadDetailMapList)(m))},c[0]=m,c[1]=i):i=c[1],u=(0,t1.useQuery)(i),c[2]!==m||c[3]!==u.data||c[4]!==u.error||c[5]!==u.status?(l=()=>{rP.debug("DML query status: %s%s%s file=%s",u.status,u.error?` error=${u.error.message}`:"",u.data?` (${u.data.length} entries)`:" (no data)",m)},s=[u.status,u.error,u.data,m],c[2]=m,c[3]=u.data,c[4]=u.error,c[5]=u.status,c[6]=l,c[7]=s):(l=c[6],s=c[7]),(0,a.useEffect)(l,s),u);d[0]!==p?(t=p?[(0,t3.textureToUrl)(p[1]),(0,t3.textureToUrl)(p[3]),(0,t3.textureToUrl)(p[4]),(0,t3.textureToUrl)(p[5]),(0,t3.textureToUrl)(p[0]),(0,t3.textureToUrl)(p[2])]:null,d[0]=p,d[1]=t):t=d[1];let g=t;return g?(d[2]!==f||d[3]!==h||d[4]!==g?(o=(0,r.jsx)(rU,{skyBoxFiles:g,fogColor:f,fogState:h}),d[2]=f,d[3]=h,d[4]=g,d[5]=o):o=d[5],o):null}function rW({skyColor:e,fogColor:t,fogState:n}){let o=(0,t_.useThree)(e=>e.camera),i=!!t,l=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),s=(0,a.useMemo)(()=>n?(0,re.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),c=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]),u=(0,a.useRef)({skyColor:{value:e},fogColor:{value:t??new tw.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:re.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:c}});return(0,a.useEffect)(()=>{u.current.skyColor.value=e,u.current.fogColor.value=t??new tw.Color(0,0,0),u.current.enableFog.value=i,u.current.fogVolumeData.value=s,u.current.horizonFogHeight.value=c},[e,t,i,s,c]),(0,r.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,r.jsxs)("bufferGeometry",{children:[(0,r.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,r.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,r.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` + varying vec2 vUv; + + void main() { + vUv = uv; + gl_Position = vec4(position.xy, 0.9999, 1.0); + } + `,fragmentShader:` + uniform vec3 skyColor; + uniform vec3 fogColor; + uniform bool enableFog; + uniform mat4 inverseProjectionMatrix; + uniform mat4 cameraMatrixWorld; + uniform float cameraHeight; + uniform float fogVolumeData[12]; + uniform float horizonFogHeight; + + varying vec2 vUv; + + // Convert linear to sRGB for display + vec3 linearToSRGB(vec3 linear) { + vec3 low = linear * 12.92; + vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; + return mix(low, high, step(vec3(0.0031308), linear)); + } + + void main() { + vec2 ndc = vUv * 2.0 - 1.0; + vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); + viewPos.xyz /= viewPos.w; + vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); + direction = vec3(direction.z, direction.y, -direction.x); + + vec3 finalColor; + + if (enableFog) { + // Calculate volume fog influence (same logic as SkyBoxTexture) + float volumeFogInfluence = 0.0; + + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float rayInfluence; + if (direction.y >= 0.0) { + rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); + } else { + rayInfluence = 1.0; + } + volumeFogInfluence += rayInfluence * volPct; + } + } + + // Base fog factor from view direction + float baseFogFactor; + if (direction.y <= 0.0) { + baseFogFactor = 1.0; + } else if (direction.y >= horizonFogHeight) { + baseFogFactor = 0.0; + } else { + float t = direction.y / horizonFogHeight; + baseFogFactor = (1.0 - t) * (1.0 - t); + } + + // Combine base fog with volume fog influence + float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); + + finalColor = mix(skyColor, fogColor, finalFogFactor); + } else { + finalColor = skyColor; + } + + gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); + } + `,depthWrite:!1,depthTest:!1})]})}function rH(e,t){let{fogDistance:r,visibleDistance:n}=e;return[r,n]}function rV({fogState:e,enabled:t}){let r=(0,t_.useThree)(e=>e.scene),n=(0,t_.useThree)(e=>e.camera),o=(0,a.useRef)(null),i=(0,a.useMemo)(()=>(0,re.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,a.useEffect)(()=>{rA||((0,t9.installCustomFogShader)(),rA=!0)},[]),(0,a.useEffect)(()=>{(0,re.resetGlobalFogUniforms)();let[t,a]=rH(e,n.position.y),l=new tw.Fog(e.fogColor,t,a);return r.fog=l,o.current=l,(0,re.updateGlobalFogUniforms)(n.position.y,i),()=>{r.fog=null,o.current=null,(0,re.resetGlobalFogUniforms)()}},[r,n,e,i]),(0,a.useEffect)(()=>{let r=o.current;if(r)if(t){let[t,a]=rH(e,n.position.y);r.near=t,r.far=a}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,tS.useFrame)(()=>{let r=o.current;if(!r)return;let a=n.position.y;if((0,re.updateGlobalFogUniforms)(a,i,t),t){let[t,n]=rH(e,a);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let rO=(0,a.memo)(function({entity:e}){let{skyData:t}=e;rP.debug("Rendering: materialList=%s, useSkyTextures=%s",t.materialList,t.useSkyTextures);let{fogEnabled:n}=(0,_.useSettings)(),o=t.materialList||void 0,i=(0,a.useMemo)(()=>rz(t.skySolidColor),[t.skySolidColor]),l=t.useSkyTextures,s=(0,a.useMemo)(()=>(function(e){let t=e.fogDistance,r=e.visibleDistance>0?e.visibleDistance:1e3,{r:n,g:a,b:o}=e.fogColor,i=new tw.Color().setRGB(n,a,o).convertSRGBToLinear(),l=[];for(let t of e.fogVolumes)t.visibleDistance<=0||t.maxHeight<=t.minHeight||l.push({visibleDistance:t.visibleDistance,minHeight:t.minHeight,maxHeight:t.maxHeight,percentage:1});let s=l.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:t,visibleDistance:r,fogColor:i,fogVolumes:l,fogLine:s,enabled:r>t}})(t),[t]);rP.debug("fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d",t.fogColor.r.toFixed(3),t.fogColor.g.toFixed(3),t.fogColor.b.toFixed(3),t.visibleDistance,t.fogDistance,s.enabled,s.fogVolumes.length);let c=(0,a.useMemo)(()=>rz(t.fogColor),[t.fogColor]),u=i||c,d=s.enabled&&n,m=s.fogColor,f=(0,t_.useThree)(e=>e.scene),h=(0,t_.useThree)(e=>e.gl);(0,a.useEffect)(()=>{if(d){let e=m.clone();f.background=e,h.setClearColor(e)}else if(u){let e=u[0].clone();f.background=e,h.setClearColor(e)}else f.background=null;return()=>{f.background=null}},[f,h,d,m,u]);let p=i?.[1];return(0,r.jsxs)(r.Fragment,{children:[o&&l&&o.length>0?(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(rG,{materialList:o,fogColor:d?m:void 0,fogState:d?s:void 0},o)}):p?(0,r.jsx)(rW,{skyColor:p,fogColor:d?m:void 0,fogState:d?s:void 0}):null,(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(rI,{scene:t})}),s.enabled?(0,r.jsx)(rV,{fogState:s,enabled:n}):null]})});function rq(e){let t,o=(0,n.c)(3),{children:i}=e,{audioEnabled:l}=(0,_.useSettings)();return o[0]!==l||o[1]!==i?(t=l?(0,r.jsx)(a.Suspense,{children:i}):null,o[0]=l,o[1]=i,o[2]=t):t=o[2],t}function r$(e,t){let o=(0,a.lazy)(()=>t().then(t=>({default:t[e]}))),i=t=>{let a,i,l=(0,n.c)(5),{entity:s}=t,c=`${e}:${s.id}`;return l[0]!==s?(a=(0,r.jsx)(o,{entity:s}),l[0]=s,l[1]=a):a=l[1],l[2]!==c||l[3]!==a?(i=(0,r.jsx)(tY.DebugSuspense,{name:c,children:a}),l[2]=c,l[3]=a,l[4]=i):i=l[4],i};return i.displayName=`createLazy(${e})`,i}let rK=r$("PlayerModel",()=>e.A(30814)),rQ=r$("ExplosionShape",()=>e.A(44325)),rY=r$("TracerProjectile",()=>e.A(62125)),rX=r$("SpriteProjectile",()=>e.A(62125)),rZ=r$("ForceFieldBare",()=>e.A(25147)),rJ=r$("AudioEmitter",()=>e.A(61921)),r0=r$("WaterBlock",()=>e.A(18599)),r1=r$("WeaponModel",()=>e.A(44325)),r2={1:"Storm",2:"Inferno"},r3=(0,a.memo)(function(e){let t=(0,n.c)(26),{entity:a}=e;switch(a.renderType){case"Shape":{let e;return t[0]!==a?(e=(0,r.jsx)(r5,{entity:a}),t[0]=a,t[1]=e):e=t[1],e}case"ForceFieldBare":{let e;return t[2]!==a?(e=(0,r.jsx)(rZ,{entity:a}),t[2]=a,t[3]=e):e=t[3],e}case"Player":{let e;return t[4]!==a?(e=(0,r.jsx)(rK,{entity:a}),t[4]=a,t[5]=e):e=t[5],e}case"Explosion":{let e;return t[6]!==a?(e=(0,r.jsx)(rQ,{entity:a}),t[6]=a,t[7]=e):e=t[7],e}case"Tracer":{let e;return t[8]!==a?(e=(0,r.jsx)(rY,{entity:a}),t[8]=a,t[9]=e):e=t[9],e}case"Sprite":{let e;return t[10]!==a?(e=(0,r.jsx)(rX,{entity:a}),t[10]=a,t[11]=e):e=t[11],e}case"AudioEmitter":{let e;return t[12]!==a?(e=(0,r.jsx)(rq,{children:(0,r.jsx)(rJ,{entity:a})}),t[12]=a,t[13]=e):e=t[13],e}case"Camera":{let e;return t[14]!==a?(e=(0,r.jsx)(tJ,{entity:a}),t[14]=a,t[15]=e):e=t[15],e}case"WayPoint":{let e;return t[16]!==a?(e=(0,r.jsx)(t0,{entity:a}),t[16]=a,t[17]=e):e=t[17],e}case"TerrainBlock":{let e;return t[18]!==a.terrainData?(e=(0,r.jsx)(rs,{scene:a.terrainData}),t[18]=a.terrainData,t[19]=e):e=t[19],e}case"InteriorInstance":{let e;return t[20]!==a.interiorData?(e=(0,r.jsx)(rC,{scene:a.interiorData}),t[20]=a.interiorData,t[21]=e):e=t[21],e}case"Sky":{let e;return t[22]!==a?(e=(0,r.jsx)(rO,{entity:a}),t[22]=a,t[23]=e):e=t[23],e}case"Sun":case"MissionArea":case"None":default:return null;case"WaterBlock":{let e;return t[24]!==a?(e=(0,r.jsx)(r0,{entity:a}),t[24]=a,t[25]=e):e=t[25],e}}});function r5(e){let t,o,i,l,s,c,u,d=(0,n.c)(24),{entity:m}=e,{animationEnabled:f}=(0,_.useSettings)(),h=(0,a.useRef)(null);if(d[0]!==f||d[1]!==m.rotate?(t=()=>{if(!h.current||!m.rotate||!f)return;let e=performance.now()/1e3;h.current.rotation.y=e/3*Math.PI*2},d[0]=f,d[1]=m.rotate,d[2]=t):t=d[2],(0,tS.useFrame)(t),!m.shapeName)throw Error(`Shape entity missing shapeName: ${m.id}`);let p=m.runtimeObject,g=m.shapeType??"StaticShape",v=m.dataBlock?.toLowerCase()==="flag",x=m.teamId&&m.teamId>0?r2[m.teamId]:null,y=v&&x?`${x} Flag`:null,b="Item"===m.shapeType?"pink":m.threads?"#00ff88":"yellow",S=m.rotate?h:void 0,w=p?void 0:m;return d[3]!==y?(o=y?(0,r.jsx)(tZ.FloatingLabel,{opacity:.6,children:y}):null,d[3]=y,d[4]=o):o=d[4],d[5]!==b||d[6]!==w||d[7]!==o?(i=(0,r.jsx)(tK.ShapeRenderer,{loadingColor:b,streamEntity:w,children:o}),d[5]=b,d[6]=w,d[7]=o,d[8]=i):i=d[8],d[9]!==m.barrelShapeName||d[10]!==p?(l=m.barrelShapeName&&(0,r.jsx)(tQ.ShapeInfoProvider,{object:p,shapeName:m.barrelShapeName,type:"Turret",children:(0,r.jsx)("group",{position:[0,1.5,0],children:(0,r.jsx)(tK.ShapeRenderer,{})})}),d[9]=m.barrelShapeName,d[10]=p,d[11]=l):l=d[11],d[12]!==m?(s=m.weaponShape&&(0,r.jsx)(tX.ShapeErrorBoundary,{fallback:(0,r.jsx)(tK.ShapePlaceholder,{color:"red",label:m.weaponShape}),children:(0,r.jsx)(tY.DebugSuspense,{name:`Weapon:${m.id}/${m.weaponShape}`,fallback:(0,r.jsx)(tK.ShapePlaceholder,{color:"cyan",label:m.weaponShape}),children:(0,r.jsx)(r1,{entity:m})})}),d[12]=m,d[13]=s):s=d[13],d[14]!==S||d[15]!==i||d[16]!==l||d[17]!==s?(c=(0,r.jsxs)("group",{ref:S,children:[i,l,s]}),d[14]=S,d[15]=i,d[16]=l,d[17]=s,d[18]=c):c=d[18],d[19]!==m.shapeName||d[20]!==g||d[21]!==c||d[22]!==p?(u=(0,r.jsx)(tQ.ShapeInfoProvider,{object:p,shapeName:m.shapeName,type:g,children:c}),d[19]=m.shapeName,d[20]=g,d[21]=c,d[22]=p,d[23]=u):u=d[23],u}var r4=e.i(60099),r6=e.i(85557),r8=e.i(29418);let r7=(0,t3.textureToUrl)("gui/hud_alliedtriangle"),r9=(0,t3.textureToUrl)("gui/hud_enemytriangle"),ne=new tw.Vector3,nt=[];function nr(e){let t,o,i,l,s,c=(0,n.c)(21),{entity:u}=e,d=(0,tK.useStaticShape)(u.shapeName??u.dataBlock),m=(0,t_.useThree)(na),f=(0,a.useRef)(null),h=(0,a.useRef)(null),p=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),[x,y]=(0,a.useState)(!0),b=(0,a.useRef)(null);c[0]!==d.scene?(t=new tw.Box3().setFromObject(d.scene),c[0]=d.scene,c[1]=t):t=c[1];let _=t.max.y+.1,S=u.keyframes??nt;c[2]!==S?(o=S.some(nn),c[2]=S,c[3]=o):o=c[3];let w=o;c[4]!==m||c[5]!==u.id||c[6]!==u.iffColor||c[7]!==u.playerName||c[8]!==w||c[9]!==x||c[10]!==S?(i=()=>{let e=f.current;if(!e)return;e.getWorldPosition(ne);let t=m.position.distanceTo(ne),r=m.matrixWorld.elements,n=!(-((ne.x-r[12])*r[8])+-((ne.y-r[13])*r[9])+-((ne.z-r[14])*r[10])<0)&&t<150;if(x!==n&&y(n),!n)return;let a=(0,r6.getKeyframeAtTime)(S,tR.streamPlaybackStore.getState().time),o=a?.health??1;if(a?.damageState!=null&&a.damageState>=1){h.current&&(h.current.style.opacity="0"),p.current&&(p.current.style.opacity="0");return}let i=Math.max(0,Math.min(1,1-t/150)).toString();if(h.current&&(h.current.style.opacity=i),p.current&&(p.current.style.opacity=i),b.current){let e=u.playerName??u.id;b.current.textContent!==e&&(b.current.textContent=e)}if(v.current&&u.iffColor){let e=u.iffColor.r>u.iffColor.g?r9:r7;v.current.getAttribute("src")!==e&&(v.current.src=e)}g.current&&w&&(g.current.style.width=`${Math.max(0,Math.min(100,100*o))}%`,g.current.style.background=u.iffColor?`rgb(${u.iffColor.r}, ${u.iffColor.g}, ${u.iffColor.b})`:"")},c[4]=m,c[5]=u.id,c[6]=u.iffColor,c[7]=u.playerName,c[8]=w,c[9]=x,c[10]=S,c[11]=i):i=c[11],(0,tS.useFrame)(i);let C=u.iffColor&&u.iffColor.r>u.iffColor.g?r9:r7;return c[12]!==u.id||c[13]!==u.playerName||c[14]!==w||c[15]!==_||c[16]!==C||c[17]!==x?(l=x&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(r4.Html,{position:[0,_,0],center:!0,children:(0,r.jsx)("div",{ref:h,className:r8.default.Top,children:(0,r.jsx)("img",{ref:v,className:r8.default.IffArrow,src:C,alt:""})})}),(0,r.jsx)(r4.Html,{position:[0,-.2,0],center:!0,children:(0,r.jsxs)("div",{ref:p,className:r8.default.Bottom,children:[(0,r.jsx)("div",{ref:b,className:r8.default.Name,children:u.playerName??u.id}),w&&(0,r.jsx)("div",{className:r8.default.HealthBar,children:(0,r.jsx)("div",{ref:g,className:r8.default.HealthFill})})]})})]}),c[12]=u.id,c[13]=u.playerName,c[14]=w,c[15]=_,c[16]=C,c[17]=x,c[18]=l):l=c[18],c[19]!==l?(s=(0,r.jsx)("group",{ref:f,children:l}),c[19]=l,c[20]=s):s=c[20],s}function nn(e){return null!=e.health}function na(e){return e.camera}var no=e.i(78779);let ni=(0,t3.textureToUrl)("commander/MiniIcons/com_flag_grey"),nl=new tw.Vector3;function ns(e){let t,o,i,l,s,c=(0,n.c)(9),{entity:u}=e,d=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,t_.useThree)(nc);c[0]!==h||c[1]!==u.iffColor?(t=()=>{if(m.current&&u.iffColor){let{r:e,g:t,b:r}=u.iffColor;m.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(f.current&&d.current){d.current.getWorldPosition(nl);let e=h.position.distanceTo(nl);f.current.textContent=e.toFixed(1)}},c[0]=h,c[1]=u.iffColor,c[2]=t):t=c[2],(0,tS.useFrame)(t);let p=u.iffColor?`rgb(${u.iffColor.r},${u.iffColor.g},${u.iffColor.b})`:"rgb(200,200,200)";c[3]===Symbol.for("react.memo_cache_sentinel")?(o=[0,1.5,0],c[3]=o):o=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,r.jsx)("span",{ref:f,className:no.default.Distance}),c[4]=i):i=c[4],c[5]!==p?(l={backgroundColor:p,"--flag-icon-url":`url(${ni})`},c[5]=p,c[6]=l):l=c[6];let g=l;return c[7]!==g?(s=(0,r.jsx)("group",{ref:d,children:(0,r.jsx)(r4.Html,{position:o,center:!0,children:(0,r.jsxs)("div",{className:no.default.Root,children:[i,(0,r.jsx)("div",{ref:m,className:no.default.Icon,style:g})]})})}),c[7]=g,c[8]=s):s=c[8],s}function nc(e){return e.camera}function nu(){let e,t=(0,n.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("group",{ref:nd,children:(0,r.jsx)(nm,{})}),t[0]=e):e=t[0],e}function nd(e){tR.streamPlaybackStore.setState({root:e})}let nm=(0,a.memo)(function(){let e=(0,eY.useAllGameEntities)(),t=(0,a.useRef)(new Map).current,n=new Set;for(let r of e)n.add(r.id),t.set(r.id,r);for(let e of t.keys())n.has(e)||t.delete(e);return(0,r.jsx)(r.Fragment,{children:[...t.values()].map(e=>(0,r.jsx)(nf,{entity:e},e.id))})}),nf=(0,a.memo)(function(e){let t,a=(0,n.c)(7),{entity:o}=e;if((0,t$.isSceneEntity)(o)){let e,t;return a[0]!==o?(e=(0,r.jsx)(r3,{entity:o}),a[0]=o,a[1]=e):e=a[1],a[2]!==o.id||a[3]!==e?(t=(0,r.jsx)("group",{name:o.id,children:e}),a[2]=o.id,a[3]=e,a[4]=t):t=a[4],t}return"None"===o.renderType?null:(a[5]!==o?(t=(0,r.jsx)(nv,{entity:o}),a[5]=o,a[6]=t):t=a[6],t)});function nh(e){let t,a=(0,n.c)(2),{entity:o}=e,i=(0,tf.useEngineSelector)(np);return o.id===i?null:(a[0]!==o?(t=(0,r.jsx)(nr,{entity:o}),a[0]=o,a[1]=t):t=a[1],t)}function np(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function ng({entity:e}){let t=(0,a.useRef)(!1),[n,o]=(0,a.useState)(()=>((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0);return(t.current=n,(0,tS.useFrame)(()=>{let r=((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0;r!==t.current&&(t.current=r,o(r))}),n)?(0,r.jsx)(ns,{entity:e}):null}function nv(e){let t,a,o,i,l,s,c,u,d=(0,n.c)(39),{entity:m}=e,f=m.position,h=m.scale;e:{let e;if(!m.rotation){t=void 0;break e}d[0]!==m.rotation?(e=new tw.Quaternion(...m.rotation),d[0]=m.rotation,d[1]=e):e=d[1],t=e}let p=t,g="Player"===m.renderType;if("Shape"===m.renderType&&!m.shapeName){let e,t,n,a,o,i=m.id;return d[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("sphereGeometry",{args:[.3,6,4]}),d[2]=e):e=d[2],d[3]!==m.className?(t=(0,r6.entityTypeColor)(m.className),d[3]=m.className,d[4]=t):t=d[4],d[5]!==t?(n=(0,r.jsxs)("mesh",{children:[e,(0,r.jsx)("meshBasicMaterial",{color:t,wireframe:!0})]}),d[5]=t,d[6]=n):n=d[6],d[7]!==m?(a=(0,r.jsx)(ng,{entity:m}),d[7]=m,d[8]=a):a=d[8],d[9]!==m.id||d[10]!==f||d[11]!==p||d[12]!==h||d[13]!==n||d[14]!==a?(o=(0,r.jsxs)("group",{name:i,position:f,quaternion:p,scale:h,children:[n,a]}),d[9]=m.id,d[10]=f,d[11]=p,d[12]=h,d[13]=n,d[14]=a,d[15]=o):o=d[15],o}d[16]!==m.className||d[17]!==m.renderType?(a="Explosion"===m.renderType?null:(0,r.jsxs)("mesh",{children:[(0,r.jsx)("sphereGeometry",{args:[.5,8,6]}),(0,r.jsx)("meshBasicMaterial",{color:(0,r6.entityTypeColor)(m.className),wireframe:!0})]}),d[16]=m.className,d[17]=m.renderType,d[18]=a):a=d[18];let v=a;return d[19]!==m?(o=(0,r.jsx)(r3,{entity:m}),d[19]=m,d[20]=o):o=d[20],d[21]!==v||d[22]!==o?(i=(0,r.jsx)(tX.ShapeErrorBoundary,{fallback:v,children:o}),d[21]=v,d[22]=o,d[23]=i):i=d[23],d[24]!==m||d[25]!==g?(l=g&&(0,r.jsx)(nh,{entity:m}),d[24]=m,d[25]=g,d[26]=l):l=d[26],d[27]!==m?(s=(0,r.jsx)(ng,{entity:m}),d[27]=m,d[28]=s):s=d[28],d[29]!==i||d[30]!==l||d[31]!==s?(c=(0,r.jsxs)("group",{name:"model",children:[i,l,s]}),d[29]=i,d[30]=l,d[31]=s,d[32]=c):c=d[32],d[33]!==m.id||d[34]!==f||d[35]!==p||d[36]!==h||d[37]!==c?(u=(0,r.jsx)("group",{name:m.id,position:f,quaternion:p,scale:h,children:c}),d[33]=m.id,d[34]=f,d[35]=p,d[36]=h,d[37]=c,d[38]=u):u=d[38],u}let nx=(0,M.createLogger)("SceneLighting");function ny(){let e,t,o,i=(0,n.c)(6),l=(0,eY.useSceneSun)();if(i[0]!==l?(e=()=>{l?nx.debug("sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",l.direction.x.toFixed(3),l.direction.y.toFixed(3),l.direction.z.toFixed(3),l.color.r.toFixed(3),l.color.g.toFixed(3),l.color.b.toFixed(3),l.ambient.r.toFixed(3),l.ambient.g.toFixed(3),l.ambient.b.toFixed(3)):nx.debug("No sunData — using fallback ambient #888")},t=[l],i[0]=l,i[1]=e,i[2]=t):(e=i[1],t=i[2]),(0,a.useEffect)(e,t),!l){let e;return i[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)("ambientLight",{color:"#888888",intensity:1}),i[3]=e):e=i[3],e}return i[4]!==l?(o=(0,r.jsx)(nb,{sunData:l}),i[4]=l,i[5]=o):o=i[5],o}function nb(e){let t,o,i,l,s,c,u,d,m,f,h=(0,n.c)(29),{sunData:p}=e;h[0]!==p.direction?(t=(0,t2.torqueToThree)(p.direction),h[0]=p.direction,h[1]=t):t=h[1];let[g,v,x]=t,y=Math.sqrt(g*g+v*v+x*x),b=g/y,_=v/y,S=x/y;h[2]!==b||h[3]!==_||h[4]!==S?(o=new tw.Vector3(b,_,S),h[2]=b,h[3]=_,h[4]=S,h[5]=o):o=h[5];let w=o,C=-(5e3*w.x),j=-(5e3*w.y),M=-(5e3*w.z);h[6]!==C||h[7]!==j||h[8]!==M?(i=new tw.Vector3(C,j,M),h[6]=C,h[7]=j,h[8]=M,h[9]=i):i=h[9];let k=i;h[10]!==p.color.b||h[11]!==p.color.g||h[12]!==p.color.r?(l=new tw.Color(p.color.r,p.color.g,p.color.b),h[10]=p.color.b,h[11]=p.color.g,h[12]=p.color.r,h[13]=l):l=h[13];let N=l;h[14]!==p.ambient.b||h[15]!==p.ambient.g||h[16]!==p.ambient.r?(s=new tw.Color(p.ambient.r,p.ambient.g,p.ambient.b),h[14]=p.ambient.b,h[15]=p.ambient.g,h[16]=p.ambient.r,h[17]=s):s=h[17];let T=s,R=w.y<0;return h[18]!==R?(c=()=>{t6.value=R},u=[R],h[18]=R,h[19]=c,h[20]=u):(c=h[19],u=h[20]),(0,a.useEffect)(c,u),h[21]!==N||h[22]!==k?(d=(0,r.jsx)("directionalLight",{position:k,color:N,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),h[21]=N,h[22]=k,h[23]=d):d=h[23],h[24]!==T?(m=(0,r.jsx)("ambientLight",{color:T,intensity:1}),h[24]=T,h[25]=m):m=h[25],h[26]!==d||h[27]!==m?(f=(0,r.jsxs)(r.Fragment,{children:[d,m]}),h[26]=d,h[27]=m,h[28]=f):f=h[28],f}function n_(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}var nS=e.i(74657),nw=e.i(75056);let nC={toneMapping:tw.NoToneMapping,outputColorSpace:tw.SRGBColorSpace};function nj(e){let t,a,o=(0,n.c)(6),{children:i,renderOnDemand:l,dpr:s,onCreated:c}=e,{renderOnDemand:u}=(0,_.useDebug)(),d=void 0!==l&&l||u?"demand":"always";return o[0]===Symbol.for("react.memo_cache_sentinel")?(t={type:tw.PCFShadowMap},o[0]=t):t=o[0],o[1]!==i||o[2]!==s||o[3]!==c||o[4]!==d?(a=(0,r.jsx)(nw.Canvas,{frameloop:d,dpr:s,gl:nC,shadows:t,onCreated:c,children:i}),o[1]=i,o[2]=s,o[3]=c,o[4]=d,o[5]=a):a=o[5],a}var nM=e.i(12631),nk=e.i(66093),nN=e.i(85413),nT=Object.defineProperty,nR=(e,t,r)=>{let n;return(n="symbol"!=typeof t?t+"":t)in e?nT(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r,r};let nD=new tw.Euler(0,0,0,"YXZ"),nL=new tw.Vector3,nF={type:"change"},nI={type:"lock"},nE={type:"unlock"},nB=Math.PI/2;class nP extends nN.EventDispatcher{constructor(e,t){super(),nR(this,"camera"),nR(this,"domElement"),nR(this,"isLocked"),nR(this,"minPolarAngle"),nR(this,"maxPolarAngle"),nR(this,"pointerSpeed"),nR(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(nD.setFromQuaternion(this.camera.quaternion),nD.y-=.002*e.movementX*this.pointerSpeed,nD.x-=.002*e.movementY*this.pointerSpeed,nD.x=Math.max(nB-this.maxPolarAngle,Math.min(nB-this.minPolarAngle,nD.x)),this.camera.quaternion.setFromEuler(nD),this.dispatchEvent(nF))}),nR(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(nI),this.isLocked=!0):(this.dispatchEvent(nE),this.isLocked=!1))}),nR(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),nR(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),nR(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),nR(this,"dispose",()=>{this.disconnect()}),nR(this,"getObject",()=>this.camera),nR(this,"direction",new tw.Vector3(0,0,-1)),nR(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),nR(this,"moveForward",e=>{nL.setFromMatrixColumn(this.camera.matrix,0),nL.crossVectors(this.camera.up,nL),this.camera.position.addScaledVector(nL,e)}),nR(this,"moveRight",e=>{nL.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(nL,e)}),nR(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),nR(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=t,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,t&&this.connect(t)}}(t={}).forward="forward",t.backward="backward",t.left="left",t.right="right",t.up="up",t.down="down",t.lookUp="lookUp",t.lookDown="lookDown",t.lookLeft="lookLeft",t.lookRight="lookRight",t.camera1="camera1",t.camera2="camera2",t.camera3="camera3",t.camera4="camera4",t.camera5="camera5",t.camera6="camera6",t.camera7="camera7",t.camera8="camera8",t.camera9="camera9";let nA=[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}];function nz(){let e,t,r,o,i,l,s,c,u,d,m,f,h,p,g=(0,n.c)(38);g[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],g[0]=e):e=g[0],(0,a.useEffect)(nW,e);let{speedMultiplier:v,setSpeedMultiplier:x,invertScroll:y,invertDrag:b}=(0,_.useControls)(),{onInput:S,mode:w}=(0,tD.useInputContext)(),[C,j]=(0,nM.useKeyboardControls)(),M=(0,t_.useThree)(nG),k=(0,t_.useThree)(nU),{nextCamera:N,setCameraIndex:T,cameraCount:R}=tN(),D=(0,a.useRef)(null);g[1]!==y?(t=()=>y,g[1]=y,g[2]=t):t=g[2];let L=(0,a.useEffectEvent)(t);g[3]!==b?(r=()=>b,g[3]=b,g[4]=r):r=g[4];let F=(0,a.useEffectEvent)(r),I=(0,a.useRef)(0),E=(0,a.useRef)(0),B=(0,a.useRef)(!1),P=(0,a.useRef)(!1);return g[5]!==M||g[6]!==k.domElement?(o=()=>{let e=new nP(M,k.domElement);return D.current=e,()=>{e.dispose()}},i=[M,k.domElement],g[5]=M,g[6]=k.domElement,g[7]=o,g[8]=i):(o=g[7],i=g[8]),(0,a.useEffect)(o,i),g[9]!==F||g[10]!==k.domElement||g[11]!==w||g[12]!==N?(l=()=>{let e=k.domElement,t=!1,r=!1,n=0,a=0,o=o=>{D.current?.isLocked||o.target===e&&(t=!0,r=!1,n=o.clientX,a=o.clientY)},i=e=>{if(D.current?.isLocked){I.current=I.current+.003*e.movementX,E.current=E.current+.003*e.movementY;return}if(!t||!r&&3>Math.abs(e.clientX-n)&&3>Math.abs(e.clientY-a))return;r=!0;let o=F()?-1:1;I.current=I.current+o*e.movementX*.003,E.current=E.current+o*e.movementY*.003},l=()=>{t=!1},s=t=>{let n=D.current;n?.isLocked?"follow"===w?B.current=!0:"local"===w&&N():t.target!==e||r||n?.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",i),document.addEventListener("mouseup",l),document.addEventListener("click",s),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",l),document.removeEventListener("click",s)}},g[9]=F,g[10]=k.domElement,g[11]=w,g[12]=N,g[13]=l):l=g[13],g[14]!==M||g[15]!==k.domElement||g[16]!==w||g[17]!==N?(s=[M,k.domElement,N,w],g[14]=M,g[15]=k.domElement,g[16]=w,g[17]=N,g[18]=s):s=g[18],(0,a.useEffect)(l,s),g[19]!==R||g[20]!==T||g[21]!==C?(c=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return C(t=>{for(let r=0;r{let e=e=>{e.preventDefault();let t=L()?-1:1,r=(e.deltaY>0?-1:1)*t,n=Math.max(2,Math.min(10,Math.abs(.01*e.deltaY)))*r;x(e=>{let t=Math.round(100*e)+n;return Math.max(_.MIN_SPEED_MULTIPLIER,Math.min(_.MAX_SPEED_MULTIPLIER,t/100))})},t=k.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},g[24]=L,g[25]=k.domElement,g[26]=x,g[27]=d):d=g[27],g[28]!==k.domElement||g[29]!==x?(m=[k.domElement,x],g[28]=k.domElement,g[29]=x,g[30]=m):m=g[30],(0,a.useEffect)(d,m),g[31]!==w?(f=()=>{if("local"===w)return;let e=e=>{if("KeyO"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(P.current=!0)};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},h=[w],g[31]=w,g[32]=f,g[33]=h):(f=g[32],h=g[33]),(0,a.useEffect)(f,h),g[34]!==j||g[35]!==S||g[36]!==v?(p=(e,t)=>{let{forward:r,backward:n,left:a,right:o,up:i,down:l,lookUp:s,lookDown:c,lookLeft:u,lookRight:d}=j(),m=I.current,f=E.current;I.current=0,E.current=0,u&&(m-=t),d&&(m+=+t),s&&(f-=t),c&&(f+=+t);let h=0,p=0,g=0;a&&(h=-1),o&&(h+=1),r&&(p=1),n&&(p-=1),i&&(g=1),l&&(g-=1);let x=(Math.round(15*((v-_.MIN_SPEED_MULTIPLIER)/(1-_.MIN_SPEED_MULTIPLIER)))+1)/16;h=Math.max(-1,Math.min(1,h*x)),p=Math.max(-1,Math.min(1,p*x)),g=Math.max(-1,Math.min(1,g*x));let y=[!1,!1,!1,!1,!1,!1];B.current&&(y[0]=!0,B.current=!1),P.current&&(y[2]=!0,P.current=!1);let b=0!==m||0!==f,w=0!==h||0!==p||0!==g,C=y.some(Boolean);(b||w||C)&&S({deltaYaw:m,deltaPitch:f,x:h,y:p,z:g,triggers:y,delta:t})},g[34]=j,g[35]=S,g[36]=v,g[37]=p):p=g[37],(0,tS.useFrame)(p),null}function nU(e){return e.gl}function nG(e){return e.camera}function nW(){return window.addEventListener("keydown",nH,{capture:!0}),window.addEventListener("keyup",nH,{capture:!0}),()=>{window.removeEventListener("keydown",nH,{capture:!0}),window.removeEventListener("keyup",nH,{capture:!0})}}function nH(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}let nV=(0,a.lazy)(()=>e.A(34019).then(e=>({default:e.TouchHandler})));function nO(e){let t,o,i,l,s,c=(0,n.c)(9),{children:u}=e;c[0]===Symbol.for("react.memo_cache_sentinel")?(t=[],c[0]=t):t=c[0];let d=(0,a.useRef)(t),[m,f]=(0,a.useState)("local");c[1]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{d.current.push(e)},c[1]=o):o=c[1];let h=o;return c[2]!==m?(i={moveQueue:d,onInput:h,mode:m,setMode:f},c[2]=m,c[3]=i):i=c[3],c[4]!==u?(l=(0,r.jsx)(nM.KeyboardControls,{map:nA,children:(0,r.jsx)(nk.JoystickProvider,{children:u})}),c[4]=u,c[5]=l):l=c[5],c[6]!==i||c[7]!==l?(s=(0,r.jsx)(tD.InputContext.Provider,{value:i,children:l}),c[6]=i,c[7]=l,c[8]=s):s=c[8],s}function nq(){let e,t,o,i=(0,n.c)(5),l=(0,eQ.useTouchDevice)();return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(nz,{}),i[0]=e):e=i[0],i[1]!==l?(t=l?(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(nV,{})}):null,i[1]=l,i[2]=t):t=i[2],i[3]!==t?(o=(0,r.jsxs)(r.Fragment,{children:[e,t]}),i[3]=t,i[4]=o):o=i[4],o}let n$=(0,a.lazy)(()=>e.A(553).then(e=>({default:e.TouchJoystick}))),nK=(0,a.lazy)(()=>e.A(33487).then(e=>({default:e.KeyboardOverlay})));function nQ(){let e,t,o,i=(0,n.c)(7),l=(0,eQ.useTouchDevice)();return i[0]!==l?(e=l?(0,r.jsx)(n$,{}):null,i[0]=l,i[1]=e):e=i[1],i[2]!==l?(t=!1===l?(0,r.jsx)(nK,{}):null,i[2]=l,i[3]=t):t=i[3],i[4]!==e||i[5]!==t?(o=(0,r.jsxs)(a.Suspense,{children:[e,t]}),i[4]=e,i[5]=t,i[6]=o):o=i[6],o}var nY=e.i(89271);function nX(e){let t,a,o,i,l,s=(0,n.c)(11),{isLoading:c,progress:u}=e,d=!c;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=(0,r.jsx)("div",{className:nY.default.Spinner}),s[0]=t):t=s[0];let m=`${100*u}%`;return s[1]!==m?(a=(0,r.jsx)("div",{className:nY.default.Progress,children:(0,r.jsx)("div",{className:nY.default.ProgressBar,style:{width:m}})}),s[1]=m,s[2]=a):a=s[2],s[3]!==u?(o=Math.round(100*u),s[3]=u,s[4]=o):o=s[4],s[5]!==o?(i=(0,r.jsxs)("div",{className:nY.default.ProgressText,children:[o,"%"]}),s[5]=o,s[6]=i):i=s[6],s[7]!==d||s[8]!==a||s[9]!==i?(l=(0,r.jsxs)("div",{className:nY.default.LoadingIndicator,"data-complete":d,children:[t,a,i]}),s[7]=d,s[8]=a,s[9]=i,s[10]=l):l=s[10],l}function nZ(e){let t,o=(0,n.c)(3),{children:i}=e,{debugMode:l}=(0,_.useDebug)();return o[0]!==i||o[1]!==l?(t=l?(0,r.jsx)(a.Suspense,{children:i}):null,o[0]=i,o[1]=l,o[2]=t):t=o[2],t}var nJ=e.i(82156);function n0(e,t){return(0,a.lazy)(()=>t().then(t=>({default:t[e]})))}let n1=n0("StreamingController",()=>e.A(25483)),n2=n0("DemoPlaybackControls",()=>e.A(93884)),n3=n0("DebugElements",()=>e.A(88487)),n5=n0("Mission",()=>e.A(21683)),n4=n0("ChatSoundPlayer",()=>e.A(38496)),n6=n0("PlayerHUD",()=>e.A(57567)),n8=n0("MapInfoDialog",()=>e.A(59197)),n7=n0("ServerBrowser",()=>e.A(70012));function n9(){let[e,t]=(0,nS.useMissionQueryState)(),o=(0,a.useContext)(s),{clearFogEnabledOverride:i,sidebarOpen:l,setSidebarOpen:c}=(0,_.useSettings)(),{missionName:u,missionType:d}=e,[m,f]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),[g,S]=(0,a.useState)(!1),[w,C]=(0,a.useState)(0),[j,M]=(0,a.useState)(!0),T=(0,eQ.useTouchDevice)(),R=(0,a.useCallback)(e=>{window.location.hash="",i(),S(!1);let r=k.liveConnectionStore.getState();r.disconnectServer(),r.disconnectRelay(),tf.engineStore.getState().setRecording(null),eY.gameEntityStore.getState().endStreaming(),t(e),T&&c(!1)},[i,t,T,c]);!function(e){let t,r,o=(0,n.c)(5),{onChangeMission:i}=e,{setRecording:l}=(0,N.usePlaybackActions)(),s=(0,a.useEffectEvent)(i);o[0]!==s||o[1]!==l?(t=()=>(window.setMissionName=e=>{let t=(0,eX.getMissionInfo)(e).missionTypes;s({missionName:e,missionType:t[0]})},window.getMissionList=eX.getMissionList,window.getMissionInfo=eX.getMissionInfo,window.loadDemoRecording=l,n_),o[0]=s,o[1]=l,o[2]=t):t=o[2],o[3]!==l?(r=[l],o[3]=l,o[4]=r):r=o[4],(0,a.useEffect)(t,r)}({onChangeMission:R});let D=(0,N.useRecording)(),L=(0,eY.useDataSource)(),F="demo"===L||"live"===L,I=(0,eY.useMissionName)(),E=(0,eY.useMissionType)();(0,a.useEffect)(()=>{if(F&&I)try{let e=(0,eX.getMissionInfo)(I),r=E&&e.missionTypes.includes(E)?E:void 0;t({missionName:I,missionType:r})}catch{t(null)}},[F,I,E,t]),(0,a.useEffect)(()=>{D&&S(!1)},[D]);let B=(0,k.useLiveSelector)(e=>e.gameStatus);(0,a.useEffect)(()=>{"connected"===B&&T&&c(!1)},[B,T,c]),(0,a.useEffect)(()=>{D&&T&&c(!1)},[T,D,c]);let P=w<1;(0,a.useEffect)(()=>{if(P)M(!0);else{let e=setTimeout(()=>M(!1),500);return()=>clearTimeout(e)}},[P]);let A=(0,a.useCallback)((e,t=0)=>{C(t)},[]),z=(0,a.useRef)(null),U=(0,a.useRef)(null);return(0,r.jsx)("main",{className:nJ.default.Frame,children:(0,r.jsxs)(N.RecordingProvider,{children:[(0,r.jsxs)("header",{className:nJ.default.Toolbar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,r.jsx)("button",{type:"button",className:nJ.default.ToggleSidebarButton,"data-orientation":"top","aria-label":l?"Close sidebar":"Open sidebar",title:l?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>c(e=>!e))},children:l?(0,r.jsx)(y,{}):(0,r.jsx)(b,{})}),(0,r.jsx)("button",{type:"button",className:nJ.default.ToggleSidebarButton,"data-orientation":"left","aria-label":l?"Close sidebar":"Open sidebar",title:l?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>c(e=>!e))},children:l?(0,r.jsx)(v,{}):(0,r.jsx)(x,{})}),(0,r.jsx)(a.Activity,{mode:F&&!g?"visible":"hidden",children:(0,r.jsx)(tg,{})}),(0,r.jsxs)(a.Activity,{mode:!F||g?"visible":"hidden",children:[(0,r.jsx)(tm,{value:g?"":u,missionType:g?"":d,onChange:R,autoFocus:g}),g&&(0,r.jsx)("button",{type:"button",className:nJ.default.CancelButton,onClick:()=>{S(!1)},children:"Cancel"})]})]}),l?(0,r.jsx)("div",{className:nJ.default.Backdrop}):null,(0,r.jsx)(a.Activity,{mode:l?"visible":"hidden",children:(0,r.jsx)(a.ViewTransition,{children:(0,r.jsx)("div",{className:nJ.default.Sidebar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),"data-open":l,children:(0,r.jsx)(eJ,{missionName:u,missionType:d,onOpenMapInfo:()=>f(!0),onOpenServerBrowser:o.live?()=>p(!0):void 0,onChooseMap:F?()=>{S(!0)}:void 0,onCancelChoosingMap:()=>{S(!1)},choosingMap:g,cameraRef:z,invalidateRef:U})})})}),(0,r.jsx)(nO,{children:(0,r.jsxs)("div",{className:nJ.default.Content,children:[(0,r.jsx)("div",{className:nJ.default.ThreeView,children:(0,r.jsx)(nj,{dpr:m||h?.25:void 0,onCreated:e=>{z.current=e.camera,U.current=e.invalidate},children:(0,r.jsx)(tL.TickProvider,{children:(0,r.jsxs)(tT,{children:[(0,r.jsx)(nq,{}),(0,r.jsxs)(tM.AudioProvider,{children:[(0,r.jsx)(ny,{}),(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(nu,{})}),(0,r.jsx)(tj,{}),(0,r.jsx)(rq,{children:(0,r.jsx)(n4,{})}),(0,r.jsx)(nZ,{children:(0,r.jsx)(n3,{})}),D?(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(n1,{recording:D})}):null,F?null:(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(n5,{name:u,missionType:d,onLoadingChange:A},`${u}~${d}`)}),(0,r.jsx)(tq,{})]})]})})})}),F?(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(n6,{})}):null,(0,r.jsx)(nQ,{}),j&&(0,r.jsx)(nX,{isLoading:P,progress:w})]})}),(0,r.jsx)("footer",{className:nJ.default.PlayerBar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:D?.source==="demo"?(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(n2,{})}):null}),m?(0,r.jsx)(a.ViewTransition,{children:(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(n8,{onClose:()=>f(!1),missionName:u,missionType:d??""})})}):null,h?(0,r.jsx)(a.ViewTransition,{children:(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(n7,{onClose:()=>p(!1)})})}):null]})})}let ae=new o.QueryClient;function at(){let e,t=(0,n.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,r.jsx)(a.Suspense,{children:(0,r.jsx)(c,{children:(0,r.jsx)(i.QueryClientProvider,{client:ae,children:(0,r.jsx)(_.SettingsProvider,{children:(0,r.jsx)(n9,{})})})})}),t[0]=e):e=t[0],e}e.s(["default",()=>at],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/1cf57947857f8eec.js b/docs/_next/static/chunks/1cf57947857f8eec.js deleted file mode 100644 index 6bf75da4..00000000 --- a/docs/_next/static/chunks/1cf57947857f8eec.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,60505,e=>{"use strict";var t=e.i(932),r=e.i(71645),n=e.i(71753),c=e.i(15080),i=e.i(90072),o=e.i(12631),a=e.i(25645),u=e.i(98755),l=e.i(58647),m=e.i(93784),s=e.i(205),d=e.i(79123),v=e.i(51475),p=e.i(89119);let y=(0,a.createLogger)("LiveObserver"),f=1/v.TICK_RATE,g=new i.Vector3,E=new i.Vector3;function h(){let e,i,a,h,M,P,L,_,O,R,I,A,C,k,K=(0,t.c)(27),N=(0,u.useLiveSelector)(T),z=(0,u.useLiveSelector)(b),X=(0,u.useLiveSelector)(w),Y=(0,l.useEngineStoreApi)(),{speedMultiplier:D}=(0,d.useControls)(),x=(0,r.useRef)(null),H=(0,c.useThree)(S),[,U]=(0,o.useKeyboardControls)(),V=(0,r.useRef)(0),W=(0,r.useRef)(0);K[0]===Symbol.for("react.memo_cache_sentinel")?(e={yaw:0,pitch:0,prevYaw:0,prevPitch:0,initialized:!1,lastSyncedCamera:null},K[0]=e):e=K[0];let q=(0,r.useRef)(e),B=(0,r.useRef)(0);return K[1]!==N||K[2]!==z||K[3]!==Y?(i=()=>{if(N&&("connected"===z||"authenticating"===z)){if(x.current===N)return;y.info("wiring adapter to engine store");let e=u.liveConnectionStore.getState(),t={source:"live",duration:1/0,missionName:e.mapName??null,gameType:null,serverDisplayName:e.serverName??null,recorderName:e.warriorName??null,recordingDate:null,streamingPlayback:N};Y.getState().setRecording(t),Y.getState().setPlaybackStatus("playing"),x.current=N,q.current.initialized=!1,q.current.lastSyncedCamera=null}else if(!N&&x.current){let e=Y.getState().playback.recording;e?.source==="live"&&Y.getState().setRecording(null),x.current=null,q.current.initialized=!1}},a=[N,z,Y],K[1]=N,K[2]=z,K[3]=Y,K[4]=i,K[5]=a):(i=K[4],a=K[5]),(0,r.useEffect)(i,a),K[6]!==H.domElement?(h=()=>{let e=!1,t=t=>{document.pointerLockElement?(V.current=V.current+.002*t.movementX,W.current=W.current+.002*t.movementY):e&&(V.current=V.current+t.movementX*s.MOUSE_SENSITIVITY,W.current=W.current+t.movementY*s.MOUSE_SENSITIVITY)},r=t=>{document.pointerLockElement||t.target!==H.domElement||(e=!0)},n=()=>{e=!1};return document.addEventListener("mousemove",t),document.addEventListener("mousedown",r),document.addEventListener("mouseup",n),()=>{document.removeEventListener("mousemove",t),document.removeEventListener("mousedown",r),document.removeEventListener("mouseup",n)}},M=[H.domElement],K[6]=H.domElement,K[7]=h,K[8]=M):(h=K[7],M=K[8]),(0,r.useEffect)(h,M),K[9]===Symbol.for("react.memo_cache_sentinel")?(P=()=>{let e=e=>{document.pointerLockElement&&x.current&&"follow"===x.current.observerMode&&(e.stopImmediatePropagation(),x.current.cycleObserveNext())};return document.addEventListener("click",e,{capture:!0}),()=>{document.removeEventListener("click",e,{capture:!0})}},K[9]=P):P=K[9],K[10]!==H.domElement?(L=[H.domElement],K[10]=H.domElement,K[11]=L):L=K[11],(0,r.useEffect)(P,L),K[12]===Symbol.for("react.memo_cache_sentinel")?(_=()=>{let e=e=>{if("KeyO"!==e.code||e.metaKey||e.ctrlKey||e.altKey)return;let t=e.target;"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||x.current&&(x.current.toggleObserverMode(),y.info("observer mode: %s",x.current.observerMode))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},O=[],K[12]=_,K[13]=O):(_=K[12],O=K[13]),(0,r.useEffect)(_,O),K[14]!==z||K[15]!==U?(R=(e,t)=>{if(!x.current||"connected"!==z)return;let{lookUp:r,lookDown:n,lookLeft:c,lookRight:i}=U();i&&(V.current=V.current+s.ARROW_LOOK_SPEED*t),c&&(V.current=V.current-s.ARROW_LOOK_SPEED*t),n&&(W.current=W.current+s.ARROW_LOOK_SPEED*t),r&&(W.current=W.current-s.ARROW_LOOK_SPEED*t)},K[14]=z,K[15]=U,K[16]=R):R=K[16],(0,n.useFrame)(R),K[17]!==z||K[18]!==U||K[19]!==X||K[20]!==D?(I=()=>{if(!x.current||"connected"!==z)return;let{forward:e,backward:t,left:r,right:n,up:c,down:i}=U(),o=0,a=0,u=0;e&&(a=1),t&&(a-=1),r&&(o=-1),n&&(o+=1),c&&(u=1),i&&(u-=1);let l=V.current,m=W.current;V.current=0,W.current=0;let s=q.current;s.prevYaw=s.yaw,s.prevPitch=s.pitch,s.yaw=s.yaw+l,s.pitch=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,s.pitch+m)),B.current=0;let d=Math.min(1,D);X({x:o*d,y:a*d,z:u*d,yaw:l,pitch:m,roll:0,trigger:[!1,!0,!1,!1,!1,!1],freeLook:!1})},K[17]=z,K[18]=U,K[19]=X,K[20]=D,K[21]=I):I=K[21],(0,v.useTick)(I),K[22]!==z?(A=(e,t)=>{if(!x.current||"connected"!==z)return;let r=q.current,n=x.current.getSnapshot(),c=n?.camera;if(c&&c!==r.lastSyncedCamera&&"number"==typeof c.yaw&&"number"==typeof c.pitch){let e=V.current,t=W.current;r.prevYaw=r.initialized?r.yaw:c.yaw,r.prevPitch=r.initialized?r.pitch:c.pitch,r.yaw=c.yaw+e,r.pitch=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,c.pitch+t)),r.lastSyncedCamera=c,r.initialized=!0}if(!r.initialized)return;B.current=B.current+t;let i=Math.min(1,B.current/f),o=r.prevYaw+(r.yaw-r.prevYaw)*i+V.current,a=Math.max(-p.MAX_PITCH,Math.min(p.MAX_PITCH,r.prevPitch+(r.pitch-r.prevPitch)*i+W.current)),[u,l,s,d]=(0,p.yawPitchToQuaternion)(o,a);if(c?.mode==="third-person"&&c.orbitTargetId){let t=m.streamPlaybackStore.getState().root,r=t?.children.find(e=>e.name===c.orbitTargetId);if(r){E.copy(r.position);let t=m.streamPlaybackStore.getState().entities.get(c.orbitTargetId);t?.renderType==="Player"&&(E.y=E.y+1);let n=Math.sin(a),i=Math.cos(a),u=Math.sin(o),l=Math.cos(o);if(g.set(-l*i,-n,u*i),g.lengthSq()>1e-8){g.normalize();let t=Math.max(.1,c.orbitDistance??4);e.camera.position.copy(E).addScaledVector(g,t),e.camera.lookAt(E)}}}else e.camera.quaternion.set(u,l,s,d)},K[22]=z,K[23]=A):A=K[23],(0,n.useFrame)(A),K[24]!==Y?(C=()=>()=>{if(x.current){let e=Y.getState().playback.recording;e?.source==="live"&&Y.getState().setRecording(null),x.current=null}},k=[Y],K[24]=Y,K[25]=C,K[26]=k):(C=K[25],k=K[26]),(0,r.useEffect)(C,k),null}function S(e){return e.gl}function w(e){return e.sendMove}function b(e){return e.gameStatus}function T(e){return e.adapter}e.s(["LiveObserver",()=>h])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/22c22371d5c1dcba.js b/docs/_next/static/chunks/22c22371d5c1dcba.js deleted file mode 100644 index bb629ada..00000000 --- a/docs/_next/static/chunks/22c22371d5c1dcba.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75840,e=>{e.v({BarFillEnergy:"PlayerHUD-module__-E1Scq__BarFillEnergy",BarFillHealth:"PlayerHUD-module__-E1Scq__BarFillHealth",BarTrack:"PlayerHUD-module__-E1Scq__BarTrack",Bars:"PlayerHUD-module__-E1Scq__Bars",Compass:"PlayerHUD-module__-E1Scq__Compass",CompassNSEW:"PlayerHUD-module__-E1Scq__CompassNSEW",CompassRing:"PlayerHUD-module__-E1Scq__CompassRing",PackInvCount:"PlayerHUD-module__-E1Scq__PackInvCount",PackInvIcon:"PlayerHUD-module__-E1Scq__PackInvIcon",PackInvInfinity:"PlayerHUD-module__-E1Scq__PackInvInfinity",PackInvItem:"PlayerHUD-module__-E1Scq__PackInvItem",PackInvItemActive:"PlayerHUD-module__-E1Scq__PackInvItemActive",PackInvItemDim:"PlayerHUD-module__-E1Scq__PackInvItemDim",PackInventoryHUD:"PlayerHUD-module__-E1Scq__PackInventoryHUD",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD",Reticle:"PlayerHUD-module__-E1Scq__Reticle",ReticleDot:"PlayerHUD-module__-E1Scq__ReticleDot",ReticleImage:"PlayerHUD-module__-E1Scq__ReticleImage",TeamCount:"PlayerHUD-module__-E1Scq__TeamCount",TeamNameEnemy:"PlayerHUD-module__-E1Scq__TeamNameEnemy",TeamNameFriendly:"PlayerHUD-module__-E1Scq__TeamNameFriendly",TeamRow:"PlayerHUD-module__-E1Scq__TeamRow",TeamScore:"PlayerHUD-module__-E1Scq__TeamScore",TeamScores:"PlayerHUD-module__-E1Scq__TeamScores",TopRight:"PlayerHUD-module__-E1Scq__TopRight",WeaponHUD:"PlayerHUD-module__-E1Scq__WeaponHUD",WeaponSeparator:"PlayerHUD-module__-E1Scq__WeaponSeparator"})},75782,e=>{e.v({ChatColor0:"ChatWindow-module__mz35vq__ChatColor0",ChatColor1:"ChatWindow-module__mz35vq__ChatColor1",ChatColor2:"ChatWindow-module__mz35vq__ChatColor2",ChatColor3:"ChatWindow-module__mz35vq__ChatColor3",ChatColor4:"ChatWindow-module__mz35vq__ChatColor4",ChatColor5:"ChatWindow-module__mz35vq__ChatColor5",ChatColor6:"ChatWindow-module__mz35vq__ChatColor6",ChatColor7:"ChatWindow-module__mz35vq__ChatColor7",ChatColor8:"ChatWindow-module__mz35vq__ChatColor8",ChatColor9:"ChatWindow-module__mz35vq__ChatColor9",ChatContainer:"ChatWindow-module__mz35vq__ChatContainer",ChatMessage:"ChatWindow-module__mz35vq__ChatMessage",ChatWindow:"ChatWindow-module__mz35vq__ChatWindow"})},49776,e=>{"use strict";var a=e.i(43476),l=e.i(932),t=e.i(58647),n=e.i(12979),r=e.i(75840),o=e.i(71645),c=e.i(75782);let u=(0,o.lazy)(()=>e.A(60458).then(e=>({default:e.ChatInput}))),i=[],s={0:c.default.ChatColor0,1:c.default.ChatColor1,2:c.default.ChatColor2,3:c.default.ChatColor3,4:c.default.ChatColor4,5:c.default.ChatColor5,6:c.default.ChatColor6,7:c.default.ChatColor7,8:c.default.ChatColor8,9:c.default.ChatColor9},d=(0,o.memo)(function(){let e,n,r,i,s,d,h=(0,l.c)(12),p=(0,t.useEngineSelector)(_),f=(0,t.useEngineSelector)(m),C=(0,o.useRef)(null),k=f[f.length-1]?.id;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},h[0]=e):e=h[0],h[1]!==k?(n=[k],h[1]=k,h[2]=n):n=h[2],(0,o.useEffect)(e,n),h[3]!==f?(r=f.map(g),h[3]=f,h[4]=r):r=h[4],h[5]!==r?(i=(0,a.jsx)("div",{ref:C,className:c.default.ChatWindow,children:r}),h[5]=r,h[6]=i):i=h[6],h[7]!==p?(s=p&&(0,a.jsx)(o.Suspense,{children:(0,a.jsx)(u,{})}),h[7]=p,h[8]=s):s=h[8],h[9]!==i||h[10]!==s?(d=(0,a.jsxs)("div",{className:c.default.ChatContainer,children:[i,s]}),h[9]=i,h[10]=s,h[11]=d):d=h[11],d});function _(e){return e.playback.recording?.source==="live"}function m(e){return e.playback.streamSnapshot?.chatMessages??i}function h(e,l){return(0,a.jsx)("span",{className:s[e.colorCode]??s[0],children:e.text},l)}function g(e){return(0,a.jsx)("div",{className:c.default.ChatMessage,hidden:!e.text,children:e.segments?e.segments.map(h):(0,a.jsxs)("span",{className:null!=e.colorCode&&s[e.colorCode]?s[e.colorCode]:s[0],children:[e.sender?`${e.sender}: `:"",e.text]})},e.id)}let p=(0,n.textureToUrl)("gui/hud_new_compass"),f=(0,n.textureToUrl)("gui/hud_new_NSEW");function C(){let e,n,o=(0,l.c)(3),c=(0,t.useEngineSelector)(k);if(null==c)return null;let u=180*c/Math.PI;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("img",{src:p,alt:"",className:r.default.CompassRing}),o[0]=e):e=o[0];let i=`rotate(${-u}deg)`;return o[1]!==i?(n=(0,a.jsxs)("div",{className:r.default.Compass,children:[e,(0,a.jsx)("img",{src:f,alt:"",className:r.default.CompassNSEW,style:{transform:i}})]}),o[1]=i,o[2]=n):n=o[2],n}function k(e){return e.playback.streamSnapshot?.camera?.yaw}function S(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(y);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillHealth,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function y(e){return e.playback.streamSnapshot?.status?.health}function v(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(x);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillEnergy,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function x(e){return e.playback.streamSnapshot?.status?.energy}let I={weapon_sniper:"gui/hud_ret_sniper",weapon_shocklance:"gui/hud_ret_shocklance",weapon_targeting:"gui/hud_ret_targlaser"};function P(){let e,o=(0,l.c)(5),c=(0,t.useEngineSelector)(b);if(void 0===c)return null;let u=I[!c?"":c.replace(/\.dts$/i,"").toLowerCase()];if(u){let e,l;return o[0]!==u?(e=(0,n.textureToUrl)(u),o[0]=u,o[1]=e):e=o[1],o[2]!==e?(l=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("img",{src:e,alt:"",className:r.default.ReticleImage})}),o[2]=e,o[3]=l):l=o[3],l}return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("div",{className:r.default.ReticleDot})}),o[4]=e):e=o[4],e}function b(e){let a=e.playback.streamSnapshot;if(!a||a.camera?.mode!=="first-person")return;let l=a.controlPlayerGhostId;if(l)return a.entities.find(e=>e.id===l)?.weaponShape}let w={0:{icon:"gui/hud_blaster",label:"Blaster"},1:{icon:"gui/hud_plasma",label:"Plasma"},2:{icon:"gui/hud_chaingun",label:"Chaingun"},3:{icon:"gui/hud_disc",label:"Spinfusor"},4:{icon:"gui/hud_grenlaunch",label:"GL"},5:{icon:"gui/hud_sniper",label:"Laser Rifle"},6:{icon:"gui/hud_elfgun",label:"ELF Gun"},7:{icon:"gui/hud_new_mortar",label:"Mortar"},8:{icon:"gui/hud_missiles",label:"Missile"},9:{icon:"gui/hud_targetlaser",label:"Targeting"},10:{icon:"gui/hud_shocklance",label:"Shocklance"},11:{icon:"gui/hud_disc",label:"Spinfusor"},12:{icon:"gui/hud_grenlaunch",label:"GL"},13:{icon:"gui/hud_chaingun",label:"Chaingun"},14:{icon:"gui/hud_targetlaser",label:"Targeting"},15:{icon:"gui/hud_targetlaser",label:"Targeting"},16:{icon:"gui/hud_shocklance",label:"Shocklance"},17:{icon:"gui/hud_new_mortar",label:"Mortar"}},j=new Map(Object.entries(w).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)])),E=new Set([9,14,15]),N=(0,n.textureToUrl)("gui/hud_infinity");function U(e){let t,n,o,c,u=(0,l.c)(12),{slot:i,isSelected:s}=e,d=w[i.index];if(!d)return null;let _=i.ammo<0,m=`${r.default.PackInvItem} ${s?r.default.PackInvItemActive:r.default.PackInvItemDim}`;return u[0]!==i.index?(t=j.get(i.index),u[0]=i.index,u[1]=t):t=u[1],u[2]!==d.label||u[3]!==t?(n=(0,a.jsx)("img",{src:t,alt:d.label,className:r.default.PackInvIcon}),u[2]=d.label,u[3]=t,u[4]=n):n=u[4],u[5]!==_||u[6]!==i.ammo?(o=_?(0,a.jsx)("img",{src:N,alt:"\\u221E",className:r.default.PackInvInfinity}):(0,a.jsx)("span",{className:r.default.PackInvCount,children:i.ammo}),u[5]=_,u[6]=i.ammo,u[7]=o):o=u[7],u[8]!==m||u[9]!==n||u[10]!==o?(c=(0,a.jsxs)("div",{className:m,children:[n,o]}),u[8]=m,u[9]=n,u[10]=o,u[11]=c):c=u[11],c}function D(){let e,n,o,c,u,i,s=(0,l.c)(15),d=(0,t.useEngineSelector)(H);if(!d||!d.slots.length)return null;if(s[0]!==d.slots){for(let a of(n=[],e=[],d.slots))E.has(a.index)?e.push(a):n.push(a);s[0]=d.slots,s[1]=e,s[2]=n}else e=s[1],n=s[2];return s[3]!==n||s[4]!==d?(o=n.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[3]=n,s[4]=d,s[5]=o):o=s[5],s[6]!==e.length?(c=e.length>0&&(0,a.jsx)("div",{className:r.default.WeaponSeparator}),s[6]=e.length,s[7]=c):c=s[7],s[8]!==e||s[9]!==d?(u=e.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[8]=e,s[9]=d,s[10]=u):u=s[10],s[11]!==o||s[12]!==c||s[13]!==u?(i=(0,a.jsxs)("div",{className:r.default.WeaponHUD,children:[o,c,u]}),s[11]=o,s[12]=c,s[13]=u,s[14]=i):i=s[14],i}function H(e){return e.playback.streamSnapshot?.weaponsHud}let T={1:"Storm",2:"Inferno",3:"Starwolf",4:"Diamond Sword",5:"Blood Eagle",6:"Phoenix"};function q(){let e,n,o,c=(0,l.c)(11),u=(0,t.useEngineSelector)(R),i=(0,t.useEngineSelector)(W);if(!u?.length)return null;if(c[0]!==i||c[1]!==u){let l,t;c[4]!==i?(l=(e,a)=>{if(i){if(e.teamId===i)return -1;if(a.teamId===i)return 1}return e.teamId-a.teamId},c[4]=i,c[5]=l):l=c[5];let o=[...u].sort(l);e=r.default.TeamScores,c[6]!==i?(t=e=>{let l=i>0&&e.teamId===i,t=e.name||(T[e.teamId]??`Team ${e.teamId}`);return(0,a.jsxs)("div",{className:r.default.TeamRow,children:[(0,a.jsx)("span",{className:l?r.default.TeamNameFriendly:r.default.TeamNameEnemy,children:t}),(0,a.jsx)("span",{className:r.default.TeamScore,children:e.score}),(0,a.jsxs)("span",{className:r.default.TeamCount,children:["(",e.playerCount,")"]})]},e.teamId)},c[6]=i,c[7]=t):t=c[7],n=o.map(t),c[0]=i,c[1]=u,c[2]=e,c[3]=n}else e=c[2],n=c[3];return c[8]!==e||c[9]!==n?(o=(0,a.jsx)("div",{className:e,children:n}),c[8]=e,c[9]=n,c[10]=o):o=c[10],o}function W(e){return e.playback.streamSnapshot?.playerSensorGroup}function R(e){return e.playback.streamSnapshot?.teamScores}let B=new Map(Object.entries({0:"gui/hud_new_packammo",1:"gui/hud_new_packcloak",2:"gui/hud_new_packenergy",3:"gui/hud_new_packrepair",4:"gui/hud_new_packsatchel",5:"gui/hud_new_packshield",6:"gui/hud_new_packinventory",7:"gui/hud_new_packmotionsens",8:"gui/hud_new_packradar",9:"gui/hud_new_packturretout",10:"gui/hud_new_packturretin",11:"gui/hud_new_packsensjam",12:"gui/hud_new_packturret",13:"gui/hud_new_packturret",14:"gui/hud_new_packturret",15:"gui/hud_new_packturret",16:"gui/hud_new_packturret",17:"gui/hud_new_packturret",18:"gui/hud_satchel_unarmed",19:"gui/hud_new_packenergy"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),M=new Map(Object.entries({1:"gui/hud_new_packcloak_armed",3:"gui/hud_new_packrepair_armed",4:"gui/hud_satchel_armed",5:"gui/hud_new_packshield_armed",11:"gui/hud_new_packsensjam_armed"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),z={0:{icon:"gui/hud_handgren",label:"Grenade"},1:{icon:"gui/hud_mine",label:"Mine"},2:{icon:"gui/hud_beacon",label:"Beacon"},3:{icon:"gui/hud_medpack",label:"Repair Kit"}},F=new Map(Object.entries(z).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)]));function $(){let e,n,o,c,u,i,s,d=(0,l.c)(25),_=(0,t.useEngineSelector)(O),m=(0,t.useEngineSelector)(G),h=_&&_.packIndex>=0;if(h){let a,l;d[0]!==_.active||d[1]!==_.packIndex?(a=_.active?M.get(_.packIndex):void 0,d[0]=_.active,d[1]=_.packIndex,d[2]=a):a=d[2];let t=a;d[3]!==t||d[4]!==_.packIndex?(l=t??B.get(_.packIndex),d[3]=t,d[4]=_.packIndex,d[5]=l):l=d[5],e=l}if(d[6]!==m){if(n=new Map,m)for(let e of m.slots)n.set(e.slot,e.count);d[6]=m,d[7]=n}else n=d[7];if(d[8]!==_||d[9]!==n||d[10]!==h||d[11]!==e){i=Symbol.for("react.early_return_sentinel");e:{let l,t=Object.keys(z).map(Number).sort(A);if(!h&&!n.size){i=null;break e}o=r.default.PackInventoryHUD,d[16]!==_||d[17]!==e?(c=e&&(0,a.jsxs)("div",{className:`${r.default.PackInvItem} ${_.active?r.default.PackInvItemActive:""}`,children:[(0,a.jsx)("img",{src:e,alt:"",className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:_.text||" "})]}),d[16]=_,d[17]=e,d[18]=c):c=d[18],d[19]!==n?(l=e=>{let l=z[e],t=F.get(e);return l&&t?(0,a.jsxs)("div",{className:r.default.PackInvItem,children:[(0,a.jsx)("img",{src:t,alt:l.label,className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:n.get(e)??0})]},e):null},d[19]=n,d[20]=l):l=d[20],u=t.map(l)}d[8]=_,d[9]=n,d[10]=h,d[11]=e,d[12]=o,d[13]=c,d[14]=u,d[15]=i}else o=d[12],c=d[13],u=d[14],i=d[15];return i!==Symbol.for("react.early_return_sentinel")?i:(d[21]!==o||d[22]!==c||d[23]!==u?(s=(0,a.jsxs)("div",{className:o,children:[c,u]}),d[21]=o,d[22]=c,d[23]=u,d[24]=s):s=d[24],s)}function A(e,a){return e-a}function G(e){return e.playback.streamSnapshot?.inventoryHud}function O(e){return e.playback.streamSnapshot?.backpackHud}function L(){let e,n,o,c,u,i,s,_=(0,l.c)(12),m=(0,t.useEngineSelector)(K);return _[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d,{}),_[0]=e):e=_[0],_[1]!==m?(n=m&&(0,a.jsxs)("div",{className:r.default.Bars,children:[(0,a.jsx)(S,{}),(0,a.jsx)(v,{})]}),_[1]=m,_[2]=n):n=_[2],_[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(C,{}),_[3]=o):o=_[3],_[4]!==n?(c=(0,a.jsxs)("div",{className:r.default.TopRight,children:[n,o]}),_[4]=n,_[5]=c):c=_[5],_[6]!==m?(u=m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(D,{}),(0,a.jsx)($,{}),(0,a.jsx)(P,{})]}),_[6]=m,_[7]=u):u=_[7],_[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(q,{}),_[8]=i):i=_[8],_[9]!==c||_[10]!==u?(s=(0,a.jsxs)("div",{className:r.default.PlayerHUD,children:[e,c,u,i]}),_[9]=c,_[10]=u,_[11]=s):s=_[11],s}function K(e){return!!e.playback.streamSnapshot?.controlPlayerGhostId}e.s(["PlayerHUD",()=>L],49776)},60458,e=>{e.v(a=>Promise.all(["static/chunks/543f866d9a9c134b.css","static/chunks/450cc5a89761fca0.js"].map(a=>e.l(a))).then(()=>a(52728)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/28c57db7b25d3d02.js b/docs/_next/static/chunks/28c57db7b25d3d02.js new file mode 100644 index 00000000..91c46853 --- /dev/null +++ b/docs/_next/static/chunks/28c57db7b25d3d02.js @@ -0,0 +1,211 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,e=>{"use strict";var t=e.i(43476),r=e.i(932),i=e.i(71645),s=e.i(90072),n=e.i(71753),a=e.i(60099),o=e.i(67191);let l=[0,0,0],u=new s.Vector3,c=(0,i.memo)(function(e){let s,c,h,d=(0,r.c)(11),{children:f,color:p,position:m,opacity:v}=e,g=void 0===p?"white":p,y=void 0===m?l:m,b=void 0===v?"fadeWithDistance":v,S="fadeWithDistance"===b,O=(0,i.useRef)(null),[T,x]=(0,i.useState)(0!==b),E=(0,i.useRef)(null);return d[0]!==S||d[1]!==T||d[2]!==b?(s=e=>{var t,r,i;let s,{camera:n}=e,a=O.current;if(!a)return;a.getWorldPosition(u);let o=(t=u.x,r=u.y,i=u.z,-((t-(s=n.matrixWorld.elements)[12])*s[8])+-((r-s[13])*s[9])+-((i-s[14])*s[10])<0);if(S){let e=o?1/0:n.position.distanceTo(u),t=e<200;if(T!==t&&x(t),E.current&&t){let t=Math.max(0,Math.min(1,1-e/200));E.current.style.opacity=t.toString()}}else{let e=!o&&0!==b;T!==e&&x(e),E.current&&(E.current.style.opacity=b.toString())}},d[0]=S,d[1]=T,d[2]=b,d[3]=s):s=d[3],(0,n.useFrame)(s),d[4]!==f||d[5]!==g||d[6]!==T||d[7]!==y?(c=T?(0,t.jsx)(a.Html,{position:y,center:!0,children:(0,t.jsx)("div",{ref:E,className:o.default.Label,style:{color:g},children:f})}):null,d[4]=f,d[5]=g,d[6]=T,d[7]=y,d[8]=c):c=d[8],d[9]!==c?(h=(0,t.jsx)("group",{ref:O,children:c}),d[9]=c,d[10]=h):h=d[10],h});e.s(["FloatingLabel",0,c])},60099,e=>{"use strict";let t,r;var i=e.i(31067),s=e.i(71645),n=e.i(88014),a=e.i(90072),o=e.i(15080),l=e.i(71753);let u=new a.Vector3,c=new a.Vector3,h=new a.Vector3,d=new a.Vector2;function f(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let s=r.width/2,n=r.height/2;return[i.x*s+s,-(i.y*n)+n]}let p=e=>1e-10>Math.abs(e)?0:e;function m(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=p(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>m(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>m(e,r(t),"translate(-50%,-50%)")),y=s.forwardRef(({children:e,eps:t=.001,style:r,className:m,prepend:y,center:b,fullscreen:S,portal:O,distanceFactor:T,sprite:x=!1,transform:E=!1,occlude:F,onOcclude:M,castShadow:R,receiveShadow:w,material:C,geometry:P,zIndexRange:D=[0x1000037,0],calculatePosition:I=f,as:U="div",wrapperClass:j,pointerEvents:_="auto",...Q},k)=>{let{gl:L,camera:q,scene:A,size:H,raycaster:V,events:W,viewport:z}=(0,o.useThree)(),[G]=s.useState(()=>document.createElement(U)),N=s.useRef(null),$=s.useRef(null),K=s.useRef(0),Y=s.useRef([0,0]),B=s.useRef(null),J=s.useRef(null),Z=(null==O?void 0:O.current)||W.connected||L.domElement.parentNode,X=s.useRef(null),ee=s.useRef(!1),et=s.useMemo(()=>{var e;return F&&"blending"!==F||Array.isArray(F)&&F.length&&(e=F[0])&&"object"==typeof e&&"current"in e},[F]);s.useLayoutEffect(()=>{let e=L.domElement;F&&"blending"===F?(e.style.zIndex=`${Math.floor(D[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[F]),s.useLayoutEffect(()=>{if($.current){let e=N.current=n.createRoot(G);if(A.updateMatrixWorld(),E)G.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=I($.current,q,H);G.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(y?Z.prepend(G):Z.appendChild(G)),()=>{Z&&Z.removeChild(G),e.unmount()}}},[Z,E]),s.useLayoutEffect(()=>{j&&(G.className=j)},[j]);let er=s.useMemo(()=>E?{position:"absolute",top:0,left:0,width:H.width,height:H.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-H.height/2,left:-H.width/2,width:H.width,height:H.height},...r},[r,b,S,H,E]),ei=s.useMemo(()=>({position:"absolute",pointerEvents:_}),[_]);s.useLayoutEffect(()=>{var t,i;ee.current=!1,E?null==(t=N.current)||t.render(s.createElement("div",{ref:B,style:er},s.createElement("div",{ref:J,style:ei},s.createElement("div",{ref:k,className:m,style:r,children:e})))):null==(i=N.current)||i.render(s.createElement("div",{ref:k,style:er,className:m,children:e}))});let es=s.useRef(!0);(0,l.useFrame)(e=>{if($.current){q.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);let e=E?Y.current:I($.current,q,H);if(E||Math.abs(K.current-q.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,s,n,o=(r=$.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(q.matrixWorld),s=t.sub(i),n=q.getWorldDirection(h),s.angleTo(n)>Math.PI/2),l=!1;et&&(Array.isArray(F)?l=F.map(e=>e.current):"blending"!==F&&(l=[A]));let f=es.current;l?es.current=function(e,t,r,i){let s=u.setFromMatrixPosition(e.matrixWorld),n=s.clone();n.project(t),d.set(n.x,n.y),r.setFromCamera(d,t);let a=r.intersectObjects(i,!0);if(a.length){let e=a[0].distance;return s.distanceTo(r.ray.origin)({vertexShader:E?void 0:` + /* + This shader is from the THREE's SpriteMaterial. + We need to turn the backing plane into a Sprite + (make it always face the camera) if "transfrom" + is false. + */ + #include + + void main() { + vec2 center = vec2(0., 1.); + float rotation = 0.0; + + // This is somewhat arbitrary, but it seems to work well + // Need to figure out how to derive this dynamically if it even matters + float size = 0.03; + + vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); + vec2 scale; + scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); + scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); + + bool isPerspective = isPerspectiveMatrix( projectionMatrix ); + if ( isPerspective ) scale *= - mvPosition.z; + + vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; + vec2 rotatedPosition; + rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; + rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; + mvPosition.xy += rotatedPosition; + + gl_Position = projectionMatrix * mvPosition; + } + `,fragmentShader:` + void main() { + gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); + } + `}),[E]);return s.createElement("group",(0,i.default)({},Q,{ref:$}),F&&!et&&s.createElement("mesh",{castShadow:R,receiveShadow:w,ref:X},P||s.createElement("planeGeometry",null),C||s.createElement("shaderMaterial",{side:a.DoubleSide,vertexShader:en.vertexShader,fragmentShader:en.fragmentShader})))});e.s(["Html",()=>y])},79123,38847,74657,21025,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(932),s=e.i(80902),n=e.i(22289);function a(e,t,r){try{return e(t)}catch(e){return(0,n.l)("[nuqs] Error while parsing value `%s`: %O"+(r?" (for key `%s`)":""),t,e,r),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),a(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let l=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let u=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function c(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:c}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:c}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:c});let h=(0,s.r)(),d={};function f(e,t,r,i,n,o){let l=!1,u=Object.entries(e).reduce((e,[u,c])=>{var h;let d=t?.[u]??u,f=i[d],p="multi"===c.type?[]:null,m=void 0===f?("multi"===c.type?r?.getAll(d):r?.get(d))??p:f;return n&&o&&((h=n[d]??p)===m||null!==h&&null!==m&&"string"!=typeof h&&"string"!=typeof m&&h.length===m.length&&h.every((e,t)=>e===m[t]))?e[u]=o[u]??null:(l=!0,e[u]=((0,s.i)(m)?null:a(c.parse,m,d))??null,n&&(n[d]=m)),e},{});if(!l){let t=Object.keys(e),r=Object.keys(o??{});l=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:u,hasChanged:l}}function p(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function m(e,t={}){let{parse:i,type:a,serialize:o,eq:l,defaultValue:u,...c}=t,[{[e]:v},g]=function(e,t={}){let i=(0,r.useId)(),a=(0,n.i)(),o=(0,n.a)(),{history:l="replace",scroll:u=a?.scroll??!1,shallow:c=a?.shallow??!0,throttleMs:m=s.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=d}=t,S=Object.keys(e).join(","),O=(0,r.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),T=(0,n.r)(Object.values(O)),x=T.searchParams,E=(0,r.useRef)({}),F=(0,r.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),M=s.t.useQueuedQueries(Object.values(O)),[R,w]=(0,r.useState)(()=>f(e,b,x??new URLSearchParams,M).state),C=(0,r.useRef)(R);if((0,n.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",i,S,R,x),Object.keys(E.current).join("&")!==Object.values(O).join("&")){let{state:t,hasChanged:r}=f(e,b,x,M,E.current,C.current);r&&((0,n.c)("[nuq+ %s `%s`] State changed: %O",i,S,{state:t,initialSearchParams:x,queuedQueries:M,queryRef:E.current,stateRef:C.current}),C.current=t,w(t)),E.current=Object.fromEntries(Object.entries(O).map(([t,r])=>[r,e[t]?.type==="multi"?x?.getAll(r):x?.get(r)??null]))}(0,r.useEffect)(()=>{let{state:t,hasChanged:r}=f(e,b,x,M,E.current,C.current);r&&((0,n.c)("[nuq+ %s `%s`] State changed: %O",i,S,{state:t,initialSearchParams:x,queuedQueries:M,queryRef:E.current,stateRef:C.current}),C.current=t,w(t))},[Object.values(O).map(e=>`${e}=${x?.getAll(e)}`).join("&"),JSON.stringify(M)]),(0,r.useEffect)(()=>{let t=Object.keys(e).reduce((t,r)=>(t[r]=({state:t,query:s})=>{w(a=>{let{defaultValue:o}=e[r],l=O[r],u=t??o??null;return Object.is(a[r]??o??null,u)?((0,n.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",i,S,l,t,o,C.current),a):(C.current={...C.current,[r]:u},E.current[l]=s,(0,n.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",i,S,l,t,o,C.current),C.current)})},t),{});for(let r of Object.keys(e)){let e=O[r];(0,n.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",i,e,S),h.on(e,t[r])}return()=>{for(let r of Object.keys(e)){let e=O[r];(0,n.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",i,e,S),h.off(e,t[r])}}},[S,O]);let P=(0,r.useCallback)((t,r={})=>{let a,d=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof t?t(p(C.current,F))??d:t??d;(0,n.c)("[nuq+ %s `%s`] setState: %O",i,S,f);let b=0,x=!1,E=[];for(let[t,i]of Object.entries(f)){let d=e[t],f=O[t];if(!d||void 0===i)continue;(r.clearOnDefault??d.clearOnDefault??g)&&null!==i&&void 0!==d.defaultValue&&(d.eq??((e,t)=>e===t))(i,d.defaultValue)&&(i=null);let p=null===i?null:(d.serialize??String)(i);h.emit(f,{state:i,query:p});let S={key:f,query:p,options:{history:r.history??d.history??l,shallow:r.shallow??d.shallow??c,scroll:r.scroll??d.scroll??u,startTransition:r.startTransition??d.startTransition??y}};if(r?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||d.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,n.s)(422));let e=r?.limitUrlUpdates?.timeMs??v?.timeMs??d.limitUrlUpdates?.timeMs??s.s.timeMs,t=s.t.push(S,e,T,o);bt(e),x?s.n.flush(T,o):s.n.getPendingPromise(T));return a??M},[S,l,c,u,m,v?.method,v?.timeMs,y,O,T.updateUrl,T.getSearchParamsSnapshot,T.rateLimitFactor,o,F]);return[(0,r.useMemo)(()=>p(R,F),[R,F]),P]}({[e]:{parse:i??(e=>e),type:a,serialize:o,eq:l,defaultValue:u}},c);return[v,(0,r.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>u,"parseAsString",()=>l,"useQueryState",()=>m],38847);var v=e.i(91996);let g=o({parse(e){let[t,r]=e.split("~"),i=r,s=(0,v.getMissionInfo)(t).missionTypes;return r&&s.includes(r)||(i=s[0]),{missionName:t,missionType:i}},serialize({missionName:e,missionType:t}){let r=(0,v.getMissionInfo)(e).missionTypes;return t&&1!==r.length?`${e}~${t}`:e},eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});function y(){let e,t=(0,i.c)(3),[r,s]=m("mission",g);return t[0]!==r||t[1]!==s?(e=[r,s],t[0]=r,t[1]=s,t[2]=e):e=t[2],e}function b(){let e,t=(0,i.c)(3),[r,s]=m("fog",u);return t[0]!==r||t[1]!==s?(e=[r,s],t[0]=r,t[1]=s,t[2]=e):e=t[2],e}e.s(["useFogQueryState",()=>b,"useMissionQueryState",()=>y],74657);let S="(pointer: coarse)",O=()=>null;function T(e){let t=window.matchMedia(S);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}function x(){return window.matchMedia(S).matches}function E(){return(0,r.useSyncExternalStore)(T,x,O)}e.s(["useTouchDevice",()=>E],21025);let F=(0,r.createContext)(null),M=(0,r.createContext)(null),R=(0,r.createContext)(null);function w(){return(0,r.useContext)(F)}function C(){return(0,r.useContext)(M)}function P(){return(0,r.useContext)(R)}function D({children:e}){let[i,s]=(0,r.useState)(!0),[n,a]=(0,r.useState)(!1),[o,l]=(0,r.useState)(.15),[u,c]=(0,r.useState)(90),[h,d]=(0,r.useState)(!1),[f,p]=(0,r.useState)(.75),[m,v]=(0,r.useState)(!0),[g,y]=(0,r.useState)(!1),[S,O]=(0,r.useState)("moveLookStick"),[T,x]=(0,r.useState)("MapGenius"),[w,C]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[I,U]=(0,r.useState)(!1),[j,_]=(0,r.useState)(!1),[Q,k]=(0,r.useState)(!1),[L,q]=b(),A=(0,r.useCallback)(()=>{q(null)},[q]),H=(0,r.useCallback)(e=>{s(e),A()},[A]),V=(0,r.useMemo)(()=>({fogEnabled:L??i,setFogEnabled:H,clearFogEnabledOverride:A,highQualityFog:n,setHighQualityFog:a,fov:u,setFov:c,audioEnabled:h,setAudioEnabled:d,animationEnabled:m,setAnimationEnabled:v,warriorName:T,setWarriorName:x,audioVolume:f,setAudioVolume:p,sidebarOpen:j,setSidebarOpen:_}),[i,L,H,A,n,u,h,m,T,f,j]),W=(0,r.useMemo)(()=>({debugMode:g,setDebugMode:y,renderOnDemand:Q,setRenderOnDemand:k}),[g,y,Q]),z=(0,r.useMemo)(()=>({speedMultiplier:o,setSpeedMultiplier:l,touchMode:S,setTouchMode:O,invertScroll:w,setInvertScroll:C,invertDrag:P,setInvertDrag:D,invertJoystick:I,setInvertJoystick:U}),[o,l,S,O,w,P,I]),G=E();(0,r.useEffect)(()=>{if(null==G)return;let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&y(e.debugMode),null!=e.audioEnabled&&d(e.audioEnabled),null!=e.animationEnabled&&v(e.animationEnabled),null!=e.fogEnabled&&s(e.fogEnabled),null!=e.highQualityFog&&a(e.highQualityFog),null!=e.speedMultiplier&&l(Math.max(.01,Math.min(1,e.speedMultiplier))),null!=e.fov&&c(e.fov),null!=e.touchMode&&O(e.touchMode),null!=e.warriorName&&x(e.warriorName),null!=e.audioVolume&&p(e.audioVolume),null!=e.invertScroll&&C(e.invertScroll),null!=e.invertDrag&&D(e.invertDrag),null!=e.invertJoystick&&U(e.invertJoystick),null==e.sidebarOpen||G||_(e.sidebarOpen)},[G]);let N=(0,r.useRef)(null);return(0,r.useEffect)(()=>(N.current&&clearTimeout(N.current),N.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:i,highQualityFog:n,speedMultiplier:o,fov:u,audioEnabled:h,animationEnabled:m,debugMode:g,touchMode:S,warriorName:T,audioVolume:f,invertScroll:w,invertDrag:P,invertJoystick:I,sidebarOpen:j}))}catch(e){}},500),()=>{N.current&&clearTimeout(N.current)}),[i,n,o,u,h,m,g,S,T,f,w,P,I,j]),(0,t.jsx)(F.Provider,{value:V,children:(0,t.jsx)(M.Provider,{value:W,children:(0,t.jsx)(R.Provider,{value:z,children:e})})})}e.s(["MAX_SPEED_MULTIPLIER",0,1,"MIN_SPEED_MULTIPLIER",0,.01,"SettingsProvider",()=>D,"useControls",()=>P,"useDebug",()=>C,"useSettings",()=>w],79123)},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},19273,80166,e=>{"use strict";e.i(47167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>i,"timeoutManager",()=>r],80166);var s="u"=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:i,fetchStatus:s,predicate:n,queryKey:a,stale:o}=e;if(a){if(i){if(t.queryHash!==f(a,t.options))return!1}else if(!m(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:r,status:i,predicate:s,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(n))return!1}else if(!m(t.options.mutationKey,n))return!1}return(!i||t.state.status===i)&&(!s||!!s(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>m(e[r],t[r]))}var v=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function O(e){return new Promise(t=>{r.setTimeout(t,e)})}function T(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let s=y(t)&&y(r);if(!s&&!(b(t)&&b(r)))return r;let n=(s?t:Object.keys(t)).length,a=s?r:Object.keys(r),o=a.length,l=s?Array(o):{},u=0;for(let c=0;cr?i.slice(1):i}function E(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var F=Symbol();function M(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==F?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function R(e,t){return"function"==typeof e?e(...t):!!e}function w(e,t,r){let i,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}e.s(["addConsumeAwareSignal",()=>w,"addToEnd",()=>x,"addToStart",()=>E,"ensureQueryFn",()=>M,"functionalUpdate",()=>a,"hashKey",()=>p,"hashQueryKeyByOptions",()=>f,"isServer",()=>s,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>m,"replaceData",()=>T,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>g,"shouldThrowError",()=>R,"skipToken",()=>F,"sleep",()=>O,"timeUntilStale",()=>l],19273)},40143,e=>{"use strict";let t,r,i,s,n,a;var o=e.i(80166).systemSetTimeoutZero,l=(t=[],r=0,i=e=>{e()},s=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{i(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>l])},15823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},75555,e=>{"use strict";var t=e.i(15823),r=e.i(19273),i=new class extends t.Subscribable{#r;#i;#s;constructor(){super(),this.#s=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>i])},86491,14448,93803,36553,88587,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),i=e.i(75555),s=e.i(15823),n=new class extends s.Subscribable{#n=!0;#i;#s;constructor(){super(),this.#s=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function a(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||n.isOnline()}e.s(["onlineManager",()=>n],14448),e.s(["pendingThenable",()=>a],93803);var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,s=!1,c=0,h=a(),d=()=>i.focusManager.isFocused()&&("always"===e.networkMode||n.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},m=e=>{"pending"===h.status&&(r?.(),h.reject(e))},v=()=>new Promise(t=>{r=e=>{("pending"!==h.status||d())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),g=()=>{let r;if("pending"!==h.status)return;let i=0===c?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(p).catch(r=>{if("pending"!==h.status)return;let i=e.retry??3*!t.isServer,n=e.retryDelay??o,a="function"==typeof n?n(c,r):n,l=!0===i||"number"==typeof i&&cd()?void 0:v()).then(()=>{s?m(r):g()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new u(t);m(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:f,start:()=>(f()?g():v().then(g),h)}}e.s(["CancelledError",()=>u,"canFetch",()=>l,"createRetryer",()=>c],36553);var h=e.i(80166),d=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>d],88587);var f=class extends d{#o;#l;#u;#c;#h;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=v(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=v(this.options);void 0!==e.data&&(this.setState(m(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#f?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,r){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,s.signal)})},a=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),s=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#f=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},o=(n(i={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),i);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#p({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof u){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...m(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>f,"fetchState",()=>p],86491)},12598,e=>{"use strict";var t=e.i(71645),r=e.i(43476),i=t.createContext(void 0),s=e=>{let r=t.useContext(i);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},n=({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(i.Provider,{value:e,children:s}));e.s(["QueryClientProvider",()=>n,"useQueryClient",()=>s])},69230,e=>{"use strict";var t=e.i(75555),r=e.i(40143),i=e.i(86491),s=e.i(15823),n=e.i(93803),a=e.i(19273),o=e.i(80166),l=class extends s.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#m=null,this.#v=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#y=void 0;#b=void 0;#S;#O;#v;#m;#T;#x;#E;#F;#M;#R;#w=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),u(this.#g,this.options)?this.#C():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#I(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,a.resolveEnabled)(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#U(),this.#g.setOptions(this.options),t._defaulted&&!(0,a.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let i=this.hasListeners();i&&h(this.#g,r,this.options,t)&&this.#C(),this.updateResult(),i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||(0,a.resolveStaleTime)(this.options.staleTime,this.#g)!==(0,a.resolveStaleTime)(t.staleTime,this.#g))&&this.#j();let s=this.#_();i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||s!==this.#R)&&this.#Q(s)}getOptimisticResult(e){var t,r;let i=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(i,e);return t=this,r=s,(0,a.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=s,this.#O=this.options,this.#S=this.#g.state),s}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#w.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#C({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#C(e){this.#U();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(a.noop)),t}#j(){this.#D();let e=(0,a.resolveStaleTime)(this.options.staleTime,this.#g);if(a.isServer||this.#b.isStale||!(0,a.isValidTimeout)(e))return;let t=(0,a.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#F=o.timeoutManager.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#_(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#Q(e){this.#I(),this.#R=e,!a.isServer&&!1!==(0,a.resolveEnabled)(this.options.enabled,this.#g)&&(0,a.isValidTimeout)(this.#R)&&0!==this.#R&&(this.#M=o.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||t.focusManager.isFocused())&&this.#C()},this.#R))}#P(){this.#j(),this.#Q(this.#_())}#D(){this.#F&&(o.timeoutManager.clearTimeout(this.#F),this.#F=void 0)}#I(){this.#M&&(o.timeoutManager.clearInterval(this.#M),this.#M=void 0)}createResult(e,t){let r,s=this.#g,o=this.options,l=this.#b,c=this.#S,f=this.#O,p=e!==s?e.state:this.#y,{state:m}=e,v={...m},g=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&u(e,t),a=r&&h(e,s,t,o);(n||a)&&(v={...v,...(0,i.fetchState)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(v.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=v;r=v.data;let O=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===S){let e;l?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(e=l.data,O=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#E?.state.data,this.#E):t.placeholderData,void 0!==e&&(S="success",r=(0,a.replaceData)(l?.data,e,t),g=!0)}if(t.select&&void 0!==r&&!O)if(l&&r===c?.data&&t.select===this.#T)r=this.#x;else try{this.#T=t.select,r=t.select(r),r=(0,a.replaceData)(l?.data,r,t),this.#x=r,this.#m=null}catch(e){this.#m=e}this.#m&&(y=this.#m,r=this.#x,b=Date.now(),S="error");let T="fetching"===v.fetchStatus,x="pending"===S,E="error"===S,F=x&&T,M=void 0!==r,R={status:S,fetchStatus:v.fetchStatus,isPending:x,isSuccess:"success"===S,isError:E,isInitialLoading:F,isLoading:F,data:r,dataUpdatedAt:v.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!x,isLoadingError:E&&!M,isPaused:"paused"===v.fetchStatus,isPlaceholderData:g,isRefetchError:E&&M,isStale:d(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,a.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==R.data,r="error"===R.status&&!t,i=e=>{r?e.reject(R.error):t&&e.resolve(R.data)},a=()=>{i(this.#v=R.promise=(0,n.pendingThenable)())},o=this.#v;switch(o.status){case"pending":e.queryHash===s.queryHash&&i(o);break;case"fulfilled":(r||R.data!==o.value)&&a();break;case"rejected":r&&R.error===o.reason||a()}}return R}updateResult(){let e=this.#b,t=this.createResult(this.#g,this.options);if(this.#S=this.#g.state,this.#O=this.options,void 0!==this.#S.data&&(this.#E=this.#g),(0,a.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#w.size)return!0;let i=new Set(r??this.#w);return this.options.throwOnError&&i.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&i.has(t))};this.#k({listeners:r()})}#U(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#k(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function u(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,a.resolveEnabled)(t.enabled,e)&&"static"!==(0,a.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&d(e,t)}return!1}function h(e,t,r,i){return(e!==t||!1===(0,a.resolveEnabled)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&d(e,r)}function d(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",()=>l])},69637,54440,e=>{"use strict";let t;e.i(47167);var r=e.i(71645),i=e.i(19273),s=e.i(40143),n=e.i(12598);e.i(43476);var a=r.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),o=r.createContext(!1);o.Provider;var l=(e,t)=>void 0===t.state.data,u=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},c=(e,t)=>e.isLoading&&e.isFetching&&!t,h=(e,t)=>e?.suspense&&t.isPending,d=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function f(e,t,l){let f,p=r.useContext(o),m=r.useContext(a),v=(0,n.useQueryClient)(l),g=v.defaultQueryOptions(e);v.getDefaultOptions().queries?._experimental_beforeQuery?.(g);let y=v.getQueryCache().get(g.queryHash);g._optimisticResults=p?"isRestoring":"optimistic",u(g),f=y?.state.error&&"function"==typeof g.throwOnError?(0,i.shouldThrowError)(g.throwOnError,[y.state.error,y]):g.throwOnError,(g.suspense||g.experimental_prefetchInRender||f)&&!m.isReset()&&(g.retryOnMount=!1),r.useEffect(()=>{m.clearReset()},[m]);let b=!v.getQueryCache().get(g.queryHash),[S]=r.useState(()=>new t(v,g)),O=S.getOptimisticResult(g),T=!p&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{let t=T?S.subscribe(s.notifyManager.batchCalls(e)):i.noop;return S.updateResult(),t},[S,T]),()=>S.getCurrentResult(),()=>S.getCurrentResult()),r.useEffect(()=>{S.setOptions(g)},[g,S]),h(g,O))throw d(g,S,m);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||(0,i.shouldThrowError)(r,[e.error,s])))({result:O,errorResetBoundary:m,throwOnError:g.throwOnError,query:y,suspense:g.suspense}))throw O.error;if(v.getDefaultOptions().queries?._experimental_afterQuery?.(g,O),g.experimental_prefetchInRender&&!i.isServer&&c(O,p)){let e=b?d(g,S,m):y?.promise;e?.catch(i.noop).finally(()=>{S.updateResult()})}return g.notifyOnChangeProps?O:S.trackResult(O)}e.s(["defaultThrowOnError",()=>l,"ensureSuspenseTimers",()=>u,"fetchOptimistic",()=>d,"shouldSuspend",()=>h,"willFetch",()=>c],54440),e.s(["useBaseQuery",()=>f],69637)},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),l=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(l)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(l)?e=l:l instanceof r.Texture?e=[l]:n(l)&&(e=Object.values(l)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,l]),(0,t.useMemo)(()=>{if(!n(e))return l;{let t={},r=0;for(let i in e)t[i]=l[r++];return t}},[e,l])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,56893,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1,anisotropy:n}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=n??1,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a],75567);var l=e.i(15080);function u(){return(0,l.useThree)(c)}function c(e){return e.gl.capabilities.getMaxAnisotropy()}e.s(["useAnisotropy",()=>u],56893)},47021,e=>{"use strict";var t=e.i(8560);let r=` +#ifdef USE_FOG + // Check fog enabled uniform - allows toggling without shader recompilation + #ifdef USE_VOLUMETRIC_FOG + if (!fogEnabled) { + // Skip all fog calculations when disabled + } else { + #endif + + float dist = vFogDepth; + + // Discard fragments at or beyond visible distance - matches Torque's behavior + // where objects beyond visibleDistance are not rendered at all. + // This prevents fully-fogged geometry from showing as silhouettes against + // the sky's fog-to-sky gradient. + if (dist >= fogFar) { + discard; + } + + // Step 1: Calculate distance-based haze (quadratic falloff) + // Since we discard at fogFar, haze never reaches 1.0 here + float haze = 0.0; + if (dist > fogNear) { + float fogScale = 1.0 / (fogFar - fogNear); + float distFactor = (dist - fogNear) * fogScale - 1.0; + haze = 1.0 - distFactor * distFactor; + } + + // Step 2: Calculate fog volume contributions + // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) + // All fog uses the global fogColor - see Tribes2_Fog_System.md for details + float volumeFog = 0.0; + + #ifdef USE_VOLUMETRIC_FOG + { + #ifdef USE_FOG_WORLD_POSITION + float fragmentHeight = vFogWorldPosition.y; + #else + float fragmentHeight = cameraHeight; + #endif + + float deltaY = fragmentHeight - cameraHeight; + float absDeltaY = abs(deltaY); + + // Determine if we're going up (positive) or down (negative) + if (absDeltaY > 0.01) { + // Non-horizontal ray: ray-march through fog volumes + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + // Skip inactive volumes (visibleDistance = 0) + if (volVisDist <= 0.0) continue; + + // Calculate fog factor for this volume + // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage + // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) + // Since we don't have quality settings, we use visFactor = 1.0 + float factor = (1.0 / volVisDist) * volPct; + + // Find ray intersection with this volume's height range + float rayMinY = min(cameraHeight, fragmentHeight); + float rayMaxY = max(cameraHeight, fragmentHeight); + + // Check if ray intersects volume height range + if (rayMinY < volMaxH && rayMaxY > volMinH) { + float intersectMin = max(rayMinY, volMinH); + float intersectMax = min(rayMaxY, volMaxH); + float intersectHeight = intersectMax - intersectMin; + + // Calculate distance traveled through this volume using similar triangles: + // subDist / dist = intersectHeight / absDeltaY + float subDist = dist * (intersectHeight / absDeltaY); + + // Accumulate fog: fog += subDist * factor + volumeFog += subDist * factor; + } + } + } else { + // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume + for (int i = 0; i < 3; i++) { + int offset = i * 4; + float volVisDist = fogVolumeData[offset + 0]; + float volMinH = fogVolumeData[offset + 1]; + float volMaxH = fogVolumeData[offset + 2]; + float volPct = fogVolumeData[offset + 3]; + + if (volVisDist <= 0.0) continue; + + // If camera is inside this volume, apply fog for full distance + if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { + float factor = (1.0 / volVisDist) * volPct; + volumeFog += dist * factor; + } + } + } + } + #endif + + // Step 3: Combine haze and volume fog + // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct + // This gives fog volumes priority over haze + float volPct = min(volumeFog, 1.0); + float hazePct = haze; + if (volPct + hazePct > 1.0) { + hazePct = 1.0 - volPct; + } + float fogFactor = hazePct + volPct; + + // Apply fog using global fogColor (per-volume colors not used in Tribes 2) + gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); + + #ifdef USE_VOLUMETRIC_FOG + } // end fogEnabled check + #endif +#endif +`;function i(){t.ShaderChunk.fog_pars_fragment=` +#ifdef USE_FOG + uniform vec3 fogColor; + varying float vFogDepth; + #ifdef FOG_EXP2 + uniform float fogDensity; + #else + uniform float fogNear; + uniform float fogFar; + #endif + + // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) + // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats + #ifdef USE_VOLUMETRIC_FOG + uniform float fogVolumeData[12]; + uniform float cameraHeight; + #endif + + #ifdef USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; + #endif +#endif +`,t.ShaderChunk.fog_fragment=r,t.ShaderChunk.fog_pars_vertex=` +#ifdef USE_FOG + varying float vFogDepth; + #ifdef USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; + #endif +#endif +`,t.ShaderChunk.fog_vertex=` +#ifdef USE_FOG + // Use Euclidean distance from camera, not view-space z-depth + // This ensures fog doesn't change when rotating the camera + vFogDepth = length(mvPosition.xyz); + #ifdef USE_FOG_WORLD_POSITION + vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; + #endif +#endif +`}function s(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include +#ifdef USE_FOG + #define USE_FOG_WORLD_POSITION + #define USE_VOLUMETRIC_FOG + varying vec3 vFogWorldPosition; +#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include +#ifdef USE_FOG + vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include +#ifdef USE_FOG + #define USE_VOLUMETRIC_FOG + uniform float fogVolumeData[12]; + uniform float cameraHeight; + uniform bool fogEnabled; + #define USE_FOG_WORLD_POSITION + varying vec3 vFogWorldPosition; +#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/341165a5ae0d70ac.js b/docs/_next/static/chunks/341165a5ae0d70ac.js deleted file mode 100644 index 2dda5457..00000000 --- a/docs/_next/static/chunks/341165a5ae0d70ac.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66069,e=>{"use strict";var r=e.i(932),t=e.i(71645),n=e.i(90072),c=e.i(71753),u=e.i(15080),o=e.i(79123),i=e.i(66093);let l=Math.PI/2-.01;function a(){let e,a,h,d,f,v,E,y,x,g,S,p=(0,r.c)(27),{speedMultiplier:M,touchMode:T,invertDrag:q,invertJoystick:b}=(0,o.useControls)(),L=(0,u.useThree)(m),_=(0,u.useThree)(s),{moveState:k,lookState:F}=(0,i.useJoystick)();p[0]===Symbol.for("react.memo_cache_sentinel")?(e=new n.Euler(0,0,0,"YXZ"),p[0]=e):e=p[0];let R=(0,t.useRef)(e),X=(0,t.useRef)(null);p[1]===Symbol.for("react.memo_cache_sentinel")?(a={x:0,y:0},p[1]=a):a=p[1];let Y=(0,t.useRef)(a);p[2]!==q?(h=()=>q,p[2]=q,p[3]=h):h=p[3];let V=(0,t.useEffectEvent)(h);p[4]===Symbol.for("react.memo_cache_sentinel")?(d=new n.Vector3,p[4]=d):d=p[4];let Z=(0,t.useRef)(d);p[5]===Symbol.for("react.memo_cache_sentinel")?(f=new n.Vector3,p[5]=f):f=p[5];let w=(0,t.useRef)(f);p[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,p[6]=v):v=p[6];let z=(0,t.useRef)(v);return p[7]!==L.quaternion?(E=()=>{R.current.setFromQuaternion(L.quaternion,"YXZ")},p[7]=L.quaternion,p[8]=E):E=p[8],p[9]!==L?(y=[L],p[9]=L,p[10]=y):y=p[10],(0,t.useEffect)(E,y),p[11]!==L.quaternion||p[12]!==V||p[13]!==_.domElement||p[14]!==T?(x=()=>{if("moveLookStick"!==T)return;let e=_.domElement,r=e=>{if(null===X.current)for(;0{if(null!==X.current)for(let r=0;r{for(let r=0;r{e.removeEventListener("touchstart",r),e.removeEventListener("touchmove",t),e.removeEventListener("touchend",n),e.removeEventListener("touchcancel",n),X.current=null}},p[11]=L.quaternion,p[12]=V,p[13]=_.domElement,p[14]=T,p[15]=x):x=p[15],p[16]!==L||p[17]!==_.domElement||p[18]!==T?(g=[L,_.domElement,T],p[16]=L,p[17]=_.domElement,p[18]=T,p[19]=g):g=p[19],(0,t.useEffect)(x,g),p[20]!==L||p[21]!==b||p[22]!==F.current||p[23]!==k.current||p[24]!==M||p[25]!==T?(S=(e,r)=>{let{force:t,angle:n}=k.current,{force:c,angle:u}=F.current;if("dualStick"===T){if(c>.15){let e=(c-.15)/.85,t=Math.cos(u),n=Math.sin(u),o=b?-1:1;R.current.setFromQuaternion(L.quaternion,"YXZ"),R.current.y=R.current.y-o*t*e*2.5*r,R.current.x=R.current.x+o*n*e*2.5*r,R.current.x=Math.max(-l,Math.min(l,R.current.x)),L.quaternion.setFromEuler(R.current)}if(t>.08){let e=80*M*((t-.08)/.92),c=Math.cos(n),u=Math.sin(n);L.getWorldDirection(Z.current),Z.current.normalize(),w.current.crossVectors(L.up,Z.current).normalize(),z.current.set(0,0,0).addScaledVector(Z.current,u).addScaledVector(w.current,-c),z.current.lengthSq()>0&&(z.current.normalize().multiplyScalar(e*r),L.position.add(z.current))}}else if("moveLookStick"===T&&t>0){let e=80*M*.5;if(L.getWorldDirection(Z.current),Z.current.normalize(),z.current.copy(Z.current).multiplyScalar(e*r),L.position.add(z.current),t>=.15){let e=Math.cos(n),c=Math.sin(n),u=(t-.15)/.85,o=b?-1:1;R.current.setFromQuaternion(L.quaternion,"YXZ"),R.current.y=R.current.y-o*e*u*1.25*r,R.current.x=R.current.x+o*c*u*1.25*r,R.current.x=Math.max(-l,Math.min(l,R.current.x)),L.quaternion.setFromEuler(R.current)}}},p[20]=L,p[21]=b,p[22]=F.current,p[23]=k.current,p[24]=M,p[25]=T,p[26]=S):S=p[26],(0,c.useFrame)(S),null}function s(e){return e.gl}function m(e){return e.camera}e.s(["TouchHandler",()=>a])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/39402d7e86cbc15f.js b/docs/_next/static/chunks/39402d7e86cbc15f.js deleted file mode 100644 index 067a95f4..00000000 --- a/docs/_next/static/chunks/39402d7e86cbc15f.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,i)=>{let r,l;l=void 0,(r="symbol"!=typeof s?s+"":s)in e?t(e,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):e[r]=l})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let s=t.slice(0);for(let t=0,i=s.length;ts])},32424,7368,e=>{"use strict";var t=e.i(25645),s=e.i(12979);let i=(0,t.createLogger)("scriptLoader");function r(){return async e=>{let t;try{t=(0,s.getUrlForPath)(e)}catch(t){return i.warn("Script not in manifest: %s (%s)",e,t),null}try{let s=await fetch(t);if(!s.ok)return i.error("Script fetch failed: %s (%d)",e,s.status),null;return await s.text()}catch(t){return i.error("Script fetch error: %s %o",e,t),null}}}e.s(["createScriptLoader",()=>r],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},81405,(e,t,s)=>{var i;e.e,(i=function(){function e(e){return r.appendChild(e.dom),e}function t(e){for(var t=0;tn+1e3&&(c.update(1e3*a/(e-n),100),n=e,a=0,d)){var t=performance.memory;d.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){l=this.end()},domElement:r,setMode:t}}).Panel=function(e,t,s){var i=1/0,r=0,l=Math.round,n=l(window.devicePixelRatio||1),a=80*n,c=48*n,o=3*n,d=2*n,f=3*n,u=15*n,p=74*n,m=30*n,h=document.createElement("canvas");h.width=a,h.height=c,h.style.cssText="width:80px;height:48px";var v=h.getContext("2d");return v.font="bold "+9*n+"px Helvetica,Arial,sans-serif",v.textBaseline="top",v.fillStyle=s,v.fillRect(0,0,a,c),v.fillStyle=t,v.fillText(e,o,d),v.fillRect(f,u,p,m),v.fillStyle=s,v.globalAlpha=.9,v.fillRect(f,u,p,m),{dom:h,update:function(c,b){i=Math.min(i,c),r=Math.max(r,c),v.fillStyle=s,v.globalAlpha=1,v.fillRect(0,0,a,u),v.fillStyle=t,v.fillText(l(c)+" "+e+" ("+l(i)+"-"+l(r)+")",o,d),v.drawImage(h,f+n,u,p-n,m,f,u,p-n,m),v.fillRect(f+p-n,u,n,m),v.fillStyle=s,v.globalAlpha=.9,v.fillRect(f+p-n,u,n,l((1-c/b)*m))}}},t.exports=i},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),s=e.i(932),i=e.i(71645),r=e.i(40859),r=r,l=r,n=e.i(81405);function a(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function c({showPanel:e=0,className:t,parent:s}){let c=function(e,t=[],s){let[r,l]=i.useState();return i.useLayoutEffect(()=>{let t=e();return l(t),a(void 0,t),()=>a(void 0,null)},t),r}(()=>new n.default,[]);return i.useEffect(()=>{if(c){let i=s&&s.current||document.body;c.showPanel(e),null==i||i.appendChild(c.dom);let n=(null!=t?t:"").split(" ").filter(e=>e);n.length&&c.dom.classList.add(...n);let a=(0,r.j)(()=>c.begin()),o=(0,l.k)(()=>c.end());return()=>{n.length&&c.dom.classList.remove(...n),null==i||i.removeChild(c.dom),a(),o()}}},[s,c,t,e]),null}var o=e.i(60099),d=e.i(55141);function f(){let e,r,l,n,a,f,u,p,m,h,v=(0,s.c)(10),b=(0,i.useRef)(null);return v[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=b.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},v[0]=e):e=v[0],(0,i.useEffect)(e),v[1]===Symbol.for("react.memo_cache_sentinel")?(r=(0,t.jsx)(c,{className:d.default.StatsPanel}),v[1]=r):r=v[1],v[2]===Symbol.for("react.memo_cache_sentinel")?(l=[70],v[2]=l):l=v[2],v[3]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("axesHelper",{ref:b,args:l,renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),v[3]=n):n=v[3],v[4]===Symbol.for("react.memo_cache_sentinel")?(a=[80,0,0],v[4]=a):a=v[4],v[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,t.jsx)(o.Html,{position:a,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"y",children:"Y"})}),v[5]=f):f=v[5],v[6]===Symbol.for("react.memo_cache_sentinel")?(u=[0,80,0],v[6]=u):u=v[6],v[7]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)(o.Html,{position:u,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"z",children:"Z"})}),v[7]=p):p=v[7],v[8]===Symbol.for("react.memo_cache_sentinel")?(m=[0,0,80],v[8]=m):m=v[8],v[9]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsxs)(t.Fragment,{children:[r,n,f,p,(0,t.jsx)(o.Html,{position:m,center:!0,children:(0,t.jsx)("span",{className:d.default.AxisLabel,"data-axis":"x",children:"X"})})]}),v[9]=h):h=v[9],h}e.s(["DebugElements",()=>f],86855)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/309d84bbb5b2092f.css b/docs/_next/static/chunks/3ec6b524f05ae0b6.css similarity index 98% rename from docs/_next/static/chunks/309d84bbb5b2092f.css rename to docs/_next/static/chunks/3ec6b524f05ae0b6.css index 6e3b9da2..8b2c7fe9 100644 --- a/docs/_next/static/chunks/309d84bbb5b2092f.css +++ b/docs/_next/static/chunks/3ec6b524f05ae0b6.css @@ -4,7 +4,7 @@ .JoinServerButton-module__DIR70a__Root{}.JoinServerButton-module__DIR70a__TextLabel{}.JoinServerButton-module__DIR70a__PingLabel{margin-right:2px;display:flex!important;}.JoinServerButton-module__DIR70a__Pulsing{animation:1.2s ease-out infinite JoinServerButton-module__DIR70a__blink}@keyframes JoinServerButton-module__DIR70a__blink{0%{opacity:1}to{opacity:.25}}.JoinServerButton-module__DIR70a__ButtonHint{} .Accordion-module__rN-DYq__AccordionGroup{flex-direction:column;gap:1px;display:flex}.Accordion-module__rN-DYq__Trigger{color:#fff;text-align:left;text-transform:uppercase;letter-spacing:.0417em;background:#ffffff1a;border:0;align-items:center;gap:4px;width:100%;padding:6px 8px;font-family:inherit;font-size:12px;font-weight:400;display:flex}.Accordion-module__rN-DYq__TriggerIcon{opacity:.5;font-size:12px;transition:transform .2s;transform:rotate(0)}.Accordion-module__rN-DYq__Trigger[data-state=open] .Accordion-module__rN-DYq__TriggerIcon{transform:rotate(90deg)}.Accordion-module__rN-DYq__Content{overflow:hidden}.Accordion-module__rN-DYq__Content[data-state=open]{animation:.3s Accordion-module__rN-DYq__slideDown}.Accordion-module__rN-DYq__Content[data-state=closed]{animation:.3s Accordion-module__rN-DYq__slideUp}.Accordion-module__rN-DYq__Body{padding:10px}@keyframes Accordion-module__rN-DYq__slideDown{0%{height:0}to{height:var(--radix-accordion-content-height)}}@keyframes Accordion-module__rN-DYq__slideUp{0%{height:var(--radix-accordion-content-height)}to{height:0}} .MissionSelect-module__N_AIjG__InputWrapper{z-index:2;align-items:center;margin:10px 10px 10px 8px;display:flex;position:relative}.MissionSelect-module__N_AIjG__Shortcut{color:#fff9;pointer-events:none;background:#ffffff26;border-radius:3px;padding:1px 4px;font-family:system-ui,sans-serif;font-size:11px;position:absolute;right:7px}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__Shortcut{display:none}.MissionSelect-module__N_AIjG__Input{color:#fff;-webkit-user-select:text;user-select:text;background:#0009;border:1px solid #ffffff4d;border-radius:3px;outline:none;width:280px;padding:6px 36px 6px 8px;font-size:14px}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]{padding-right:8px}.MissionSelect-module__N_AIjG__Input:focus{border-color:#fff9}.MissionSelect-module__N_AIjG__Input::placeholder{color:#777;font-family:inherit;font-size:12px}.MissionSelect-module__N_AIjG__SelectedValue{pointer-events:none;align-items:center;gap:6px;display:flex;position:absolute;left:8px;right:36px;overflow:hidden}.MissionSelect-module__N_AIjG__Input[aria-expanded=true]~.MissionSelect-module__N_AIjG__SelectedValue{display:none}.MissionSelect-module__N_AIjG__SelectedName{color:#fff;white-space:nowrap;text-overflow:ellipsis;flex-shrink:1;min-width:0;font-size:14px;font-weight:600;line-height:1.28571;overflow:hidden}.MissionSelect-module__N_AIjG__SelectedValue>.MissionSelect-module__N_AIjG__ItemType{flex-shrink:0}.MissionSelect-module__N_AIjG__Popover{z-index:100;min-width:320px;max-height:var(--popover-available-height,90vh);overscroll-behavior:contain;background:#141414f2;border:1px solid #ffffff80;border-radius:3px;overflow-y:auto;box-shadow:0 8px 24px #0009}.MissionSelect-module__N_AIjG__List{padding:4px 0}.MissionSelect-module__N_AIjG__List:has(>.MissionSelect-module__N_AIjG__Group:first-child){padding-top:0}.MissionSelect-module__N_AIjG__Group{padding-bottom:4px}.MissionSelect-module__N_AIjG__GroupLabel{color:#c6caca;z-index:1;background:#3a4548f2;border-bottom:1px solid #ffffff4d;padding:6px 8px 6px 12px;font-size:13px;font-weight:600;position:sticky;top:0}.MissionSelect-module__N_AIjG__Group:not(:last-child){border-bottom:1px solid #ffffff4d}.MissionSelect-module__N_AIjG__Item{cursor:pointer;border-radius:4px;outline:none;flex-direction:column;gap:1px;margin:4px 4px 0;padding:6px 8px;scroll-margin-top:32px;display:flex}.MissionSelect-module__N_AIjG__List>.MissionSelect-module__N_AIjG__Item:first-child{margin-top:0}.MissionSelect-module__N_AIjG__Item[data-active-item]{background:#ffffff26}.MissionSelect-module__N_AIjG__Item[aria-selected=true]{background:#6496ff4d}.MissionSelect-module__N_AIjG__ItemHeader{align-items:center;gap:6px;display:flex}.MissionSelect-module__N_AIjG__ItemName{color:#fff;font-size:14px;font-weight:600}.MissionSelect-module__N_AIjG__ItemTypes{gap:3px;display:flex}.MissionSelect-module__N_AIjG__ItemType{color:#fff;background:#ff9d0066;border-radius:3px;padding:2px 5px;font-size:10px;font-weight:600;line-height:1.3}.MissionSelect-module__N_AIjG__ItemType:hover{background:#ff9d00b3}.MissionSelect-module__N_AIjG__ItemMissionName{color:#ffffff80;font-size:12px}.MissionSelect-module__N_AIjG__NoResults{color:#ffffff80;text-align:center;padding:12px 8px;font-size:13px}.MissionSelect-module__N_AIjG__Backdrop{z-index:1;background:#00000080;position:fixed;inset:0}@media (max-width:899px){.MissionSelect-module__N_AIjG__InputWrapper{margin-left:4px}} -.StreamingMissionInfo-module__hEaQnW__Header{flex:auto;align-items:center;display:flex}.StreamingMissionInfo-module__hEaQnW__MissionInfo{color:#fff;background:0 0;border:1px solid #fff0;border-radius:3px;align-items:center;gap:6px;margin:10px auto 10px 4px;padding:5px 8px;display:flex}.StreamingMissionInfo-module__hEaQnW__MissionName{}.StreamingMissionInfo-module__hEaQnW__MissionType{pointer-events:none;}.StreamingMissionInfo-module__hEaQnW__MissionTypeDisplayName{opacity:.5;font-size:12px}.StreamingMissionInfo-module__hEaQnW__Metadata{text-align:right;flex-direction:column;gap:2px;margin:0 0 0 auto;padding:8px 12px;font-size:12px;line-height:1.16667;display:flex}.StreamingMissionInfo-module__hEaQnW__Attribution,.StreamingMissionInfo-module__hEaQnW__ServerInfo{color:#83938b}.StreamingMissionInfo-module__hEaQnW__PlayerName,.StreamingMissionInfo-module__hEaQnW__RecordingDate,.StreamingMissionInfo-module__hEaQnW__ServerName{color:#eceae7}.StreamingMissionInfo-module__hEaQnW__ActionButton{flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px;}.StreamingMissionInfo-module__hEaQnW__EjectIcon{margin-top:-.5px;font-size:21px}@media (max-width:899px){.StreamingMissionInfo-module__hEaQnW__Metadata{display:none}.StreamingMissionInfo-module__hEaQnW__MissionInfo{margin-left:0}} +.StreamingMissionInfo-module__hEaQnW__Header{flex:auto;align-items:center;display:flex}.StreamingMissionInfo-module__hEaQnW__MissionInfo{color:#fff;background:0 0;border:1px solid #fff0;border-radius:3px;align-items:center;gap:6px;margin:10px auto 10px 4px;padding:5px 8px;display:flex}.StreamingMissionInfo-module__hEaQnW__MissionName{}.StreamingMissionInfo-module__hEaQnW__MissionType{pointer-events:none;}.StreamingMissionInfo-module__hEaQnW__MissionTypeDisplayName{opacity:.5;font-size:12px}.StreamingMissionInfo-module__hEaQnW__Metadata{text-align:right;flex-direction:column;gap:2px;margin:0 0 0 auto;padding:8px 12px;font-size:12px;line-height:1.16667;display:flex}.StreamingMissionInfo-module__hEaQnW__Attribution,.StreamingMissionInfo-module__hEaQnW__ServerInfo{color:#83938b}.StreamingMissionInfo-module__hEaQnW__PlayerName,.StreamingMissionInfo-module__hEaQnW__RecordingDate,.StreamingMissionInfo-module__hEaQnW__ServerName{color:#eceae7}.StreamingMissionInfo-module__hEaQnW__ActionButton{flex:none;min-width:28px;min-height:28px;margin:0 10px 0 0;padding:2px;font-size:16px;}.StreamingMissionInfo-module__hEaQnW__EjectIcon{margin-top:-.5px;font-size:21px}.StreamingMissionInfo-module__hEaQnW__Error{color:#ff6a45}@media (max-width:899px){.StreamingMissionInfo-module__hEaQnW__Metadata{display:none}.StreamingMissionInfo-module__hEaQnW__MissionInfo{margin-left:0}} .FloatingLabel-module__8y09Ka__Label{color:#fff;white-space:nowrap;text-align:center;background:#00000080;border-radius:1px;padding:1px 3px;font-size:11px} .PlayerNameplate-module__zYDm0a__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;display:inline-flex}.PlayerNameplate-module__zYDm0a__Top{padding-bottom:20px;}.PlayerNameplate-module__zYDm0a__Bottom{padding-top:20px;}.PlayerNameplate-module__zYDm0a__IffArrow{width:12px;height:12px;image-rendering:pixelated;filter:drop-shadow(0 1px 2px #000000b3)}.PlayerNameplate-module__zYDm0a__Name{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;font-size:11px}.PlayerNameplate-module__zYDm0a__HealthBar{background:#00000080;border:1px solid #fff3;width:60px;height:4px;margin:2px auto 0;overflow:hidden}.PlayerNameplate-module__zYDm0a__HealthFill{background:#2ecc40;height:100%} .FlagMarker-module__INpLba__Root{pointer-events:none;white-space:nowrap;flex-direction:column;align-items:center;gap:1px;display:inline-flex}.FlagMarker-module__INpLba__Distance{color:#fff;text-shadow:0 1px 3px #000000e6,0 0 1px #000000b3;opacity:.5;font-size:10px}.FlagMarker-module__INpLba__Icon{width:16px;height:16px;image-rendering:pixelated;opacity:.5;filter:drop-shadow(0 1px 3px #000c);-webkit-mask-image:var(--flag-icon-url);mask-image:var(--flag-icon-url);-webkit-mask-position:50%;mask-position:50%;-webkit-mask-size:contain;mask-size:contain;-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;-webkit-mask-image:var(--flag-icon-url);-webkit-mask-position:50%;-webkit-mask-size:contain;-webkit-mask-repeat:no-repeat} diff --git a/docs/_next/static/chunks/e5d92d4ce07851d8.js b/docs/_next/static/chunks/419d6e651fe3d509.js similarity index 91% rename from docs/_next/static/chunks/e5d92d4ce07851d8.js rename to docs/_next/static/chunks/419d6e651fe3d509.js index ffda4aae..4c101ac5 100644 --- a/docs/_next/static/chunks/e5d92d4ce07851d8.js +++ b/docs/_next/static/chunks/419d6e651fe3d509.js @@ -86,4 +86,4 @@ void main() { vec4 tex = texture2D(uTexture, vUV); gl_FragColor = vec4(vColor.rgb * tex.rgb, vColor.a * tex.a); } -`;function O(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),n=new Uint16Array(6*e);for(let t=0;t{let i=Q.current,r=D.current;if(!i||!r)return;let a=T.engineStore.getState().playback,n="playing"===a.status,s=n?t*a.rate:0,c=1e3*s,u=k.getDataBlockData.bind(k);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],o=i.particleEmitter;if("number"==typeof o){let e=t(o);if(e){let a=f(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let n=i.emitters;if(Array.isArray(n))for(let e of n){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=f(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new y(e.data,256);t.emitBurst(r,e.density);let a=I(e.data.particles.textureName),n=U(256),s=j(a,e.data.particles.useInvAlpha,e.data.orientParticles),l=new o.Mesh(n,s);l.frustumCulled=!1,i.add(l),J.current.push({emitter:t,mesh:l,geometry:n,material:s,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new y(e,256,t.lifetimeMS),n=I(e.particles.textureName),s=U(256),l=j(n,e.particles.useInvAlpha,e.orientParticles),c=new o.Mesh(s,l);c.frustumCulled=!1,i.add(c),J.current.push({emitter:a,mesh:c,geometry:s,material:l,targetTexture:n,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(q){let n=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,s=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),l=new o.MeshBasicMaterial({color:s,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new o.Mesh(V,l);c.frustumCulled=!1,c.scale.setScalar(n),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new o.CanvasTexture(i),n=new o.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),s=new o.Sprite(n),l=i.width/i.height;return s.scale.set(2*l,2,1),{sprite:s,material:n}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,s);u.position.set(r[1],r[2]+n+2,r[0]),u.frustumCulled=!1,i.add(u),ei.current.push({entityId:e.id,mesh:c,material:l,label:u,labelMaterial:d,creationTime:(0,T.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:n})}let n=a?.shockwave;if("number"==typeof n){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(n,u);if(t){let a=I(t.textureName),n=O(t.numSegments),s=new o.ShaderMaterial({vertexShader:F,fragmentShader:_,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:o.AdditiveBlending,side:o.DoubleSide}),l=new o.Mesh(n,s);l.frustumCulled=!1,l.position.set(r[1],r[2],r[0]),i.add(l);let c=null,u=null;t.renderBottom&&(u=O(t.numSegments),(c=new o.Mesh(u,s)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;er.current.push({entityId:e.id,mesh:l,bottomMesh:c,geometry:n,bottomGeometry:u,material:s,creationTime:(0,T.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||Z.current.has(e.id))continue;Z.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=f(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],n=new y(r,256),s=I(r.particles.textureName),l=U(256),c=j(s,r.particles.useInvAlpha,r.orientParticles),m=new o.Mesh(l,c);m.frustumCulled=!1,i.add(m),J.current.push({emitter:n,mesh:m,geometry:l,material:c,targetTexture:s,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of J.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of Z.current)d.has(e)||Z.current.delete(e);let m=J.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,o=e.getContext();o.getProgramParameter(a,o.LINK_STATUS)||A.error("Shader LINK ERROR (%s): %s",i,o.getProgramInfoLog(a))}(Y,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,c,t.emitAxis),t.emitter.update(c),C.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=q?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),o=i.getAttribute("particleSize"),n=i.getAttribute("particleSpin"),s=i.getAttribute("orientDir"),l=r.array,c=a.array,u=o.array,d=n.array,m=s.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e=0;e--){let t=p[e],r=Math.min((h-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let g=er.current;for(let t=g.length-1;t>=0;t--){let r=g[t],a=Math.min((h-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*s,r.radius=r.radius+r.velocity*s;let o=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e=r[e]&&(a=e);let o=Math.min(a+1,i.length-1),n=r[a]??0,s=(r[o]??1)-n,l=s>0?Math.min((t-n)/s,1):0,c=i[a]??i[0],u=i[o]??i[0];return[c.r+(u.r-c.r)*l,c.g+(u.g-c.g)*l,c.b+(u.b-c.b)*l,c.a+(u.a-c.a)*l]}(r.data,a);z(r.geometry,r.data,r.radius,o,r.data.is2D),r.bottomGeometry&&z(r.bottomGeometry,r.data,r.radius,o,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),g.splice(t,1))}if(n&&H&&K&&$&&Q.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(et.current.has(t))continue;et.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,w.resolveAudioProfile)(r,u);if(!a)continue;let n=new o.Vector3(e.position[1],e.position[2],e.position[0]);(0,w.playOneShotSound)(a,$,K,n,Q.current)}let e=ee.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let n=(0,w.resolveAudioProfile)(r,u);if(n&&n.isLooping&&n.is3D)try{let i=(0,l.audioToUrl)(n.filename),r=(0,w.getSoundGeneration)();(0,w.getCachedAudioBuffer)(i,K,i=>{if(r!==(0,w.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let s=Q.current;if(!s)return;let l=new o.PositionalAudio($);l.setBuffer(i),l.setDistanceModel("inverse"),l.setRefDistance(n.refDist),l.setMaxDistance(n.maxDist),l.setRolloffFactor(1),l.setVolume(n.volume),l.setPlaybackRate(a.rate),l.setLoop(!0),l.position.set(t.position[1],t.position[2],t.position[0]),s.add(l),(0,w.trackSound)(l),l.play(),e.set(t.id,l)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,w.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Q.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(et.current.has(t))continue;et.current.add(t);let i=(0,w.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new o.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,w.playOneShotSound)(i,$,K,r,Q.current)}}if(X.current.size>500){let e=new Set(r.entities.map(G));for(let t of X.current)e.has(t)||X.current.delete(t)}if(et.current.size>500){let e=new Set(r.entities.map(L));for(let t of et.current)t.startsWith("snd:")&&e.has(t.slice(4))||et.current.delete(t)}},P[7]=H,P[8]=$,P[9]=K,P[10]=q,P[11]=Y,P[12]=k,P[13]=D,P[14]=g):g=P[14],(0,a.useFrame)(g),P[15]===Symbol.for("react.memo_cache_sentinel")?(v=()=>()=>{let e=Q.current;for(let t of J.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(J.current=[],ei.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(ei.current=[],er.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(er.current=[],X.current.clear(),Z.current.clear(),ee.current)){(0,w.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}ee.current.clear(),et.current.clear()},S=[],P[15]=S,P[16]=v):(S=P[15],v=P[16]),(0,r.useEffect)(v,S),P[17]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("group",{ref:Q}),P[17]=b):b=P[17],b}function L(e){return e.id}function G(e){return e.id}function W(e){return e.gl}var H=e.i(9721),K=e.i(92224),$=e.i(93784);function Y(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var Q=e.i(77964);let J=new WeakMap;function X(e){let t=J.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),J.set(e,t)),t}let Z=new o.Vector3,ee=new o.Quaternion,et=new o.Quaternion,ei=new o.Quaternion(0,1,0,0),er=new o.Vector3,ea=new o.Vector3,eo=new o.Vector3;function en(e){let s,l,c,u,d,m,p,f,h,g=(0,i.c)(25),{recording:y}=e,S=(0,T.useEngineStoreApi)(),v=(0,r.useRef)(0),b=(0,r.useRef)(null),M=(0,r.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(s=new o.Vector3(0,n.DEFAULT_EYE_HEIGHT,0),g[0]=s):s=g[0];let x=(0,r.useRef)(s),A=(0,r.useRef)(y.streamingPlayback??null),P=(0,r.useRef)(null);g[1]===Symbol.for("react.memo_cache_sentinel")?(l=new Map,g[1]=l):l=g[1];let k=(0,r.useRef)(l),C=(0,r.useRef)(null),[D,I]=(0,r.useState)(null);g[2]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{if(e===C.current)return;C.current=e;let t=k.current,i=new Map;for(let a of e.entities){let o=t.get(a.id),n=o&&("Shape"===o.renderType||"Player"===o.renderType||"Explosion"===o.renderType);if(!o||o.className!==(a.className??a.type)||o.ghostIndex!==a.ghostIndex||o.dataBlockId!==a.dataBlockId||o.shapeHint!==a.shapeHint||n&&null!=a.dataBlock&&o.shapeName!==a.dataBlock||"Player"!==o.renderType&&n&&o.weaponShape!==a.weaponShape)o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Y(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Y(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Y(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Y(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Y(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Y(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Y(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Y(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Y(e,t),renderType:"Camera"}:{...Y(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(a,e.timeSec);else{var r=o;switch(r.renderType){case"Player":r.threads=a.threads,r.weaponShape=a.weaponShape,r.packShape=a.packShape,r.flagShape=a.flagShape,r.falling=a.falling,r.jetting=a.jetting,r.weaponImageState=a.weaponImageState,r.weaponImageStates=a.weaponImageStates,r.playerName=a.playerName,r.iffColor=a.iffColor,r.headPitch=a.headPitch,r.headYaw=a.headYaw,r.targetRenderFlags=a.targetRenderFlags;break;case"Shape":r.threads=a.threads,r.targetRenderFlags=a.targetRenderFlags,r.iffColor=a.iffColor}}if(i.set(a.id,o),(0,Q.isSceneEntity)(o)||"None"===o.renderType)continue;let s=o.keyframes;0===s.length&&s.push({time:e.timeSec,position:a.position??[0,0,0],rotation:a.rotation??[0,0,0,1]});let l=s[0];l.time=e.timeSec,a.position&&(l.position=a.position),a.rotation&&(l.rotation=a.rotation),l.velocity=a.velocity,l.health=a.health,l.energy=a.energy,l.actionAnim=a.actionAnim,l.actionAtEnd=a.actionAtEnd,l.damageState=a.damageState}for(let[r,a]of t)if(!i.has(r)&&"Explosion"===a.renderType&&a.shapeName&&null!=a.spawnTime&&e.timeSec-a.spawnTime<5){i.set(r,a);continue}let a=i.size!==t.size||[...i.keys()].some(e=>!t.has(e));k.current=i,a&&K.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let o=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(o=r)}I(e=>e===o?e:o)},g[2]=c):c=g[2];let B=c;return g[3]!==S||g[4]!==y.gameType||g[5]!==y.missionName||g[6]!==y.recorderName||g[7]!==y.recordingDate||g[8]!==y.serverDisplayName||g[9]!==y.source||g[10]!==y.streamingPlayback?(u=()=>{(0,w.stopAllTrackedSounds)(),A.current=y.streamingPlayback??null,k.current=new Map,C.current=null,P.current=null,(0,$.resetStreamPlayback)(),v.current=0,b.current=null,M.current=null;let e=A.current;if($.streamPlaybackStore.setState({playback:e}),K.gameEntityStore.getState().beginStreaming(y.source),!e)return void S.getState().setPlaybackStreamSnapshot(null);e.onMissionInfoChange=()=>{K.gameEntityStore.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,r=e.gameClassName,a=e.serverDisplayName,o=e.connectedPlayerName;"live"!==y.source&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=r,e.serverDisplayName=a,e.connectedPlayerName=o,K.gameEntityStore.getState().setMissionInfo({missionName:y.missionName??void 0,missionTypeDisplayName:y.gameType??void 0,missionDisplayName:t??void 0,gameClassName:r??void 0,serverDisplayName:a??y.serverDisplayName??void 0,recorderName:o??y.recorderName??void 0,recordingDate:y.recordingDate??void 0});let n=e.getSnapshot();return $.streamPlaybackStore.setState({time:n.timeSec}),v.current=n.timeSec,b.current=n,M.current=n,B(n),S.getState().setPlaybackStreamSnapshot(n),P.current=n,()=>{(0,w.stopAllTrackedSounds)(),A.current=null,(0,$.resetStreamPlayback)()}},g[3]=S,g[4]=y.gameType,g[5]=y.missionName,g[6]=y.recorderName,g[7]=y.recordingDate,g[8]=y.serverDisplayName,g[9]=y.source,g[10]=y.streamingPlayback,g[11]=u):u=g[11],g[12]!==S||g[13]!==y?(d=[y,S,B],g[12]=S,g[13]=y,g[14]=d):d=g[14],(0,r.useEffect)(u,d),g[15]!==S||g[16]!==y.source?(m=(e,t)=>{let i=A.current;if(!i)return;let r=S.getState(),a=r.playback,o="playing"===a.status,s=a.timeMs/1e3,l=!o&&Math.abs(s-v.current)>5e-4,c=o&&Math.abs(s-$.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(v.current=s),o&&((0,T.advanceEffectClock)(t,a.rate),v.current=v.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=v.current+n.STREAM_TICK_SEC,p=i.stepToTime(m,o&&!u?d:1/0),f=M.current;!f||p.timeSec1.5*n.STREAM_TICK_SEC?(b.current=p,M.current=p):p.timeSec!==f.timeSec&&(b.current=f,M.current=p);let h=M.current??p,g=b.current??h,w=h.timeSec-n.STREAM_TICK_SEC,C=Math.max(0,Math.min(1,(v.current-w)/n.STREAM_TICK_SEC));$.streamPlaybackStore.setState({time:v.current}),p.exhausted&&o&&(v.current=Math.min(v.current,p.timeSec)),B(h),$.streamPlaybackStore.getState().entities=k.current,h!==P.current&&(P.current=h,r.setPlaybackStreamSnapshot(h));let D=h.camera,I=D&&g.camera&&g.camera.mode===D.mode&&g.camera.controlEntityId===D.controlEntityId&&g.camera.orbitTargetId===D.orbitTargetId?g.camera:null,N=$.streamPlaybackStore.getState().freeFlyCamera,E="live"===y.source;if(D&&!N){if(I){let t=I.position[0],i=I.position[1],r=I.position[2],a=D.position[0],o=D.position[1],n=D.position[2];e.camera.position.set(i+(o-i)*C,r+(n-r)*C,t+(a-t)*C),E||(ee.set(...I.rotation),et.set(...D.rotation),ee.slerp(et,C),e.camera.quaternion.copy(ee))}else e.camera.position.set(D.position[1],D.position[2],D.position[0]),E||e.camera.quaternion.set(...D.rotation);if(Number.isFinite(D.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=I&&Number.isFinite(I.fov)?I.fov+(D.fov-I.fov)*C:D.fov,r=(0,n.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let R=X(h),V=X(g),F=k.current,_=$.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=F.get(t.name);if(i&&(0,Q.isSceneEntity)(i))continue;let r=R.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=V.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],o=a.position[2],n=r.position[0],s=r.position[1],l=r.position[2],c=e+(n-e)*C,u=i+(s-i)*C,d=o+(l-o)*C;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(ei):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(ee.set(...a.rotation),et.set(...r.rotation),ee.slerp(et,C),t.quaternion.copy(ee)):t.quaternion.set(...r.rotation))}let O=D?.mode;if(!N&&!E&&"third-person"===O&&_&&D?.orbitTargetId){let t=_.children.find(e=>e.name===D.orbitTargetId);if(t){let i=R.get(D.orbitTargetId);ea.copy(t.position),i?.type==="Player"&&(ea.y=ea.y+1);let r=!1;if(D.orbitDirection)er.set(D.orbitDirection[0],D.orbitDirection[1],D.orbitDirection[2]),r=er.lengthSq()>1e-8;else if("number"==typeof D.yaw&&"number"==typeof D.pitch){let e=Math.sin(D.pitch),t=Math.cos(D.pitch),i=Math.sin(D.yaw),a=Math.cos(D.yaw);er.set(-a*t,-e,-i*t),r=er.lengthSq()>1e-8}if(r||(er.copy(e.camera.position).sub(ea),r=er.lengthSq()>1e-8),r){er.normalize();let t=Math.max(.1,D.orbitDistance??4);eo.copy(ea).addScaledVector(er,t),e.camera.position.copy(eo),e.camera.lookAt(ea)}}}if(!N&&"first-person"===O&&_&&D?.controlEntityId){let t=_.children.find(e=>e.name===D.controlEntityId);t?(Z.copy(x.current).applyQuaternion(t.quaternion),e.camera.position.add(Z)):e.camera.position.y=e.camera.position.y+x.current.y}o&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*v.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},g[15]=S,g[16]=y.source,g[17]=m):m=g[17],(0,a.useFrame)(m),g[18]!==y.streamingPlayback?(p=(0,t.jsx)(q,{playback:y.streamingPlayback,snapshotRef:M}),g[18]=y.streamingPlayback,g[19]=p):p=g[19],g[20]!==D?(f=D&&(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(H.PlayerEyeOffset,{shapeName:D,eyeOffsetRef:x})}),g[20]=D,g[21]=f):f=g[21],g[22]!==p||g[23]!==f?(h=(0,t.jsxs)(t.Fragment,{children:[p,f]}),g[22]=p,g[23]=f,g[24]=h):h=g[24],h}e.s(["StreamingController",()=>en],51295)}]); \ No newline at end of file +`;function O(e){let t=(e+1)*2,i=new Float32Array(3*t),r=new Float32Array(2*t),a=new Float32Array(4*t),n=new Uint16Array(6*e);for(let t=0;t{let i=Q.current,r=D.current;if(!i||!r)return;let a=T.engineStore.getState().playback,n="playing"===a.status,s=n?t*a.rate:0,c=1e3*s,u=k.getDataBlockData.bind(k);for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position||X.current.has(e.id))continue;X.current.add(e.id);let t=function(e,t){let i=t(e);if(!i)return null;let r=[],a=[],o=i.particleEmitter;if("number"==typeof o){let e=t(o);if(e){let a=f(e,t);if(a){let e=i.particleDensity??10;r.push({data:a,density:e})}}}let n=i.emitters;if(Array.isArray(n))for(let e of n){if("number"!=typeof e)continue;let i=t(e);if(!i)continue;let r=f(i,t);r&&a.push(r)}return 0===r.length&&0===a.length?null:{burstEmitters:r,streamingEmitters:a,lifetimeMS:32*(i.lifetimeMS??31)}}(e.explosionDataBlockId,u);if(!t)continue;let r=[...e.position];for(let e of t.burstEmitters){let t=new y(e.data,256);t.emitBurst(r,e.density);let a=I(e.data.particles.textureName),n=U(256),s=j(a,e.data.particles.useInvAlpha,e.data.orientParticles),l=new o.Mesh(n,s);l.frustumCulled=!1,i.add(l),J.current.push({emitter:t,mesh:l,geometry:n,material:s,targetTexture:a,origin:r,isBurst:!0,hasBurst:!0})}for(let e of t.streamingEmitters){let a=new y(e,256,t.lifetimeMS),n=I(e.particles.textureName),s=U(256),l=j(n,e.particles.useInvAlpha,e.orientParticles),c=new o.Mesh(s,l);c.frustumCulled=!1,i.add(c),J.current.push({emitter:a,mesh:c,geometry:s,material:l,targetTexture:n,origin:r,isBurst:!1,hasBurst:!1})}let a=u(e.explosionDataBlockId);if(q){let n=a?function(e){let t=e.sizes;if(Array.isArray(t)&&t.length>0){let e=0;for(let i of t)e=Math.max(e,i.x,i.y,i.z);if(e>0)return e/1e3}let i=e.particleRadius;return"number"==typeof i&&i>0?i:5}(a):5,s=function(e){if(!e)return 0xff00ff;let t=e.toLowerCase();return t.includes("disc")?4491519:t.includes("grenade")?0xff8800:t.includes("mortar")?0xff4400:t.includes("plasma")?4521796:t.includes("laser")?0xff2222:t.includes("blaster")?0xffff00:t.includes("missile")?0xff6600:t.includes("bomb")?0xff0000:t.includes("mine")?0xff8844:t.includes("concussion")?0xffaa00:t.includes("shocklance")?8930559:t.includes("chaingun")||t.includes("bullet")?0xcccccc:0xff00ff}(e.dataBlock),l=new o.MeshBasicMaterial({color:s,wireframe:!0,transparent:!0,opacity:1,depthWrite:!1}),c=new o.Mesh(V,l);c.frustumCulled=!1,c.scale.setScalar(n),c.position.set(r[1],r[2],r[0]),i.add(c);let{sprite:u,material:d}=function(e,t){let i=document.createElement("canvas"),r=i.getContext("2d");r.font="bold 32px monospace",i.width=Math.ceil(r.measureText(e).width)+16,i.height=48,r.font="bold 32px monospace",r.fillStyle=`#${t.toString(16).padStart(6,"0")}`,r.textBaseline="middle",r.fillText(e,8,i.height/2);let a=new o.CanvasTexture(i),n=new o.SpriteMaterial({map:a,transparent:!0,depthTest:!1,depthWrite:!1}),s=new o.Sprite(n),l=i.width/i.height;return s.scale.set(2*l,2,1),{sprite:s,material:n}}(`${e.id}: ${e.dataBlock??`expId:${e.explosionDataBlockId}`}`,s);u.position.set(r[1],r[2]+n+2,r[0]),u.frustumCulled=!1,i.add(u),ei.current.push({entityId:e.id,mesh:c,material:l,label:u,labelMaterial:d,creationTime:(0,T.effectNow)(),lifetimeMS:Math.max(t.lifetimeMS,3e3),targetRadius:n})}let n=a?.shockwave;if("number"==typeof n){let t=function(e,t){let i=t(e);if(!i)return null;let r=i.colors??[],a=i.times??[0,.5,1,1];return{width:i.width??1,numSegments:Math.max(i.numSegments??16,4),velocity:i.velocity??0,height:i.height??0,verticalCurve:i.verticalCurve??0,acceleration:i.acceleration??0,texWrap:i.texWrap??1,lifetimeMS:i.lifetimeMS??500,is2D:!!i.is2D,renderSquare:!!i.renderSquare,renderBottom:!!i.renderBottom,mapToTerrain:!!i.mapToTerrain,colors:r,times:a,textureName:i.textureName??"",mapToTexture:i.mapToTexture??""}}(n,u);if(t){let a=I(t.textureName),n=O(t.numSegments),s=new o.ShaderMaterial({vertexShader:F,fragmentShader:_,uniforms:{uTexture:{value:a}},transparent:!0,depthWrite:!1,blending:o.AdditiveBlending,side:o.DoubleSide}),l=new o.Mesh(n,s);l.frustumCulled=!1,l.position.set(r[1],r[2],r[0]),i.add(l);let c=null,u=null;t.renderBottom&&(u=O(t.numSegments),(c=new o.Mesh(u,s)).frustumCulled=!1,c.position.set(r[1],r[2],r[0]),c.scale.y=-1,i.add(c));let d=Math.abs(t.velocity)>1e-10?t.velocity:0;er.current.push({entityId:e.id,mesh:l,bottomMesh:c,geometry:n,bottomGeometry:u,material:s,creationTime:(0,T.effectNow)(),lifetimeMS:t.lifetimeMS,data:t,radius:0,velocity:d})}}}let d=new Set;for(let e of r.entities){if(d.add(e.id),!e.maintainEmitterId||Z.current.has(e.id))continue;Z.current.add(e.id);let t=u(e.maintainEmitterId);if(!t)continue;let r=f(t,u);if(!r)continue;let a=e.position?[...e.position]:[0,0,0],n=new y(r,256),s=I(r.particles.textureName),l=U(256),c=j(s,r.particles.useInvAlpha,r.orientParticles),m=new o.Mesh(l,c);m.frustumCulled=!1,i.add(m),J.current.push({emitter:n,mesh:m,geometry:l,material:c,targetTexture:s,origin:a,isBurst:!1,hasBurst:!1,followEntityId:e.id})}for(let e of J.current)e.followEntityId&&!d.has(e.followEntityId)&&e.emitter.kill();for(let e of Z.current)d.has(e)||Z.current.delete(e);let m=J.current;for(let e=m.length-1;e>=0;e--){let t=m[e];if(t.shaderChecked||(!function(e,t,i){let r=e.properties.get(t).currentProgram;if(!r)return;let a=r.program,o=e.getContext();o.getProgramParameter(a,o.LINK_STATUS)||A.error("Shader LINK ERROR (%s): %s",i,o.getProgramInfoLog(a))}(Y,t.material,t.isBurst?"burst":"stream"),t.shaderChecked=!0),t.followEntityId){let e=r.entities.find(e=>e.id===t.followEntityId);e?.position&&(t.origin[0]=e.position[0],t.origin[1]=e.position[1],t.origin[2]=e.position[2]),e?.direction&&(t.emitAxis=e.direction)}if(t.isBurst||t.emitter.emitPeriodic(t.origin,c,t.emitAxis),t.emitter.update(c),C.has(t.targetTexture)&&t.material.uniforms.particleTexture.value!==t.targetTexture&&(t.material.uniforms.particleTexture.value=t.targetTexture),t.material.uniforms.debugOpacity.value=q?.2:1,!function(e){let t=e.emitter.particles,i=e.geometry,r=i.getAttribute("position"),a=i.getAttribute("particleColor"),o=i.getAttribute("particleSize"),n=i.getAttribute("particleSpin"),s=i.getAttribute("orientDir"),l=r.array,c=a.array,u=o.array,d=n.array,m=s.array,p=Math.min(t.length,256),f=e.emitter.data.orientOnVelocity;for(let e=0;e=0;e--){let t=p[e],r=Math.min((h-t.creationTime)/t.lifetimeMS,1),a=Math.min(r/.1,1);t.mesh.scale.setScalar(t.targetRadius*a),t.material.opacity=1-r,t.labelMaterial.opacity=1-r,r>=1&&(i.remove(t.mesh),i.remove(t.label),t.material.dispose(),t.labelMaterial.dispose(),p.splice(e,1))}let g=er.current;for(let t=g.length-1;t>=0;t--){let r=g[t],a=Math.min((h-r.creationTime)/r.lifetimeMS,1);r.velocity=r.velocity+r.data.acceleration*s,r.radius=r.radius+r.velocity*s;let o=function(e,t){let{colors:i,times:r}=e;if(0===i.length)return[1,1,1,1];let a=0;for(let e=0;e=r[e]&&(a=e);let o=Math.min(a+1,i.length-1),n=r[a]??0,s=(r[o]??1)-n,l=s>0?Math.min((t-n)/s,1):0,c=i[a]??i[0],u=i[o]??i[0];return[c.r+(u.r-c.r)*l,c.g+(u.g-c.g)*l,c.b+(u.b-c.b)*l,c.a+(u.a-c.a)*l]}(r.data,a);z(r.geometry,r.data,r.radius,o,r.data.is2D),r.bottomGeometry&&z(r.bottomGeometry,r.data,r.radius,o,r.data.is2D),r.data.is2D&&r.mesh.lookAt(e.camera.position),a>=1&&(i.remove(r.mesh),r.bottomMesh&&i.remove(r.bottomMesh),r.geometry.dispose(),r.bottomGeometry?.dispose(),r.material.dispose(),g.splice(t,1))}if(n&&H&&K&&$&&Q.current){for(let e of r.entities){if("Explosion"!==e.type||!e.explosionDataBlockId||!e.position)continue;let t=`snd:${e.id}`;if(et.current.has(t))continue;et.current.add(t);let i=u(e.explosionDataBlockId);if(!i)continue;let r=i.soundProfile;if("number"!=typeof r)continue;let a=(0,w.resolveAudioProfile)(r,u);if(!a)continue;let n=new o.Vector3(e.position[1],e.position[2],e.position[0]);(0,w.playOneShotSound)(a,$,K,n,Q.current)}let e=ee.current;for(let t of r.entities){if("Projectile"!==t.type||!t.dataBlockId||!t.position)continue;if(e.has(t.id)){e.get(t.id).position.set(t.position[1],t.position[2],t.position[0]);continue}if(e.size>=20)continue;let i=u(t.dataBlockId);if(!i)continue;let r=i.sound;if("number"!=typeof r)continue;let n=(0,w.resolveAudioProfile)(r,u);if(n&&n.isLooping&&n.is3D)try{let i=(0,l.audioToUrl)(n.filename),r=(0,w.getSoundGeneration)();(0,w.getCachedAudioBuffer)(i,K,i=>{if(r!==(0,w.getSoundGeneration)()||!d.has(t.id)||e.has(t.id))return;let s=Q.current;if(!s)return;let l=new o.PositionalAudio($);l.setBuffer(i),l.setDistanceModel("inverse"),l.setRefDistance(n.refDist),l.setMaxDistance(n.maxDist),l.setRolloffFactor(1),l.setVolume(n.volume),l.setPlaybackRate(a.rate),l.setLoop(!0),l.position.set(t.position[1],t.position[2],t.position[0]),s.add(l),(0,w.trackSound)(l),l.play(),e.set(t.id,l)})}catch{}}for(let[t,i]of e)if(!d.has(t)){(0,w.untrackSound)(i);try{i.stop()}catch{}try{i.disconnect()}catch{}Q.current?.remove(i),e.delete(t)}for(let e of r.audioEvents){let t=`${e.timeSec}:${e.profileId}:${e.position?.x??""}`;if(et.current.has(t))continue;et.current.add(t);let i=(0,w.resolveAudioProfile)(e.profileId,u);if(!i)continue;let r=e.position?new o.Vector3(e.position.y,e.position.z,e.position.x):void 0;(0,w.playOneShotSound)(i,$,K,r,Q.current)}}if(X.current.size>500){let e=new Set(r.entities.map(G));for(let t of X.current)e.has(t)||X.current.delete(t)}if(et.current.size>500){let e=new Set(r.entities.map(L));for(let t of et.current)t.startsWith("snd:")&&e.has(t.slice(4))||et.current.delete(t)}},P[7]=H,P[8]=$,P[9]=K,P[10]=q,P[11]=Y,P[12]=k,P[13]=D,P[14]=g):g=P[14],(0,a.useFrame)(g),P[15]===Symbol.for("react.memo_cache_sentinel")?(v=()=>()=>{let e=Q.current;for(let t of J.current){if(e&&(e.remove(t.mesh),t.debugOriginMesh&&e.remove(t.debugOriginMesh),t.debugParticleMeshes))for(let i of t.debugParticleMeshes)e.remove(i);t.geometry.dispose(),t.material.dispose()}for(let t of(J.current=[],ei.current))e&&(e.remove(t.mesh),e.remove(t.label)),t.material.dispose(),t.labelMaterial.dispose();for(let t of(ei.current=[],er.current))e&&(e.remove(t.mesh),t.bottomMesh&&e.remove(t.bottomMesh)),t.geometry.dispose(),t.bottomGeometry?.dispose(),t.material.dispose();for(let[,t]of(er.current=[],X.current.clear(),Z.current.clear(),ee.current)){(0,w.untrackSound)(t);try{t.stop()}catch{}try{t.disconnect()}catch{}e&&e.remove(t)}ee.current.clear(),et.current.clear()},S=[],P[15]=S,P[16]=v):(S=P[15],v=P[16]),(0,r.useEffect)(v,S),P[17]===Symbol.for("react.memo_cache_sentinel")?(b=(0,t.jsx)("group",{ref:Q}),P[17]=b):b=P[17],b}function L(e){return e.id}function G(e){return e.id}function W(e){return e.gl}var H=e.i(9721),K=e.i(92224),$=e.i(93784);function Y(e,t){return{id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t,position:e.position,rotation:e.rotation,velocity:e.velocity,keyframes:[{time:t??0,position:e.position??[0,0,0],rotation:e.rotation??[0,0,0,1]}]}}var Q=e.i(77964);let J=new WeakMap;function X(e){let t=J.get(e);return t||(t=new Map(e.entities.map(e=>[e.id,e])),J.set(e,t)),t}let Z=new o.Vector3,ee=new o.Quaternion,et=new o.Quaternion,ei=new o.Quaternion(0,1,0,0),er=new o.Vector3,ea=new o.Vector3,eo=new o.Vector3;function en(e){let s,l,c,u,d,m,p,f,h,g=(0,i.c)(25),{recording:y}=e,S=(0,T.useEngineStoreApi)(),v=(0,r.useRef)(0),b=(0,r.useRef)(null),M=(0,r.useRef)(null);g[0]===Symbol.for("react.memo_cache_sentinel")?(s=new o.Vector3(0,n.DEFAULT_EYE_HEIGHT,0),g[0]=s):s=g[0];let x=(0,r.useRef)(s),A=(0,r.useRef)(y.streamingPlayback??null),P=(0,r.useRef)(null);g[1]===Symbol.for("react.memo_cache_sentinel")?(l=new Map,g[1]=l):l=g[1];let k=(0,r.useRef)(l),C=(0,r.useRef)(null),[D,I]=(0,r.useState)(null);g[2]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{if(e===C.current)return;C.current=e;let t=k.current,i=new Map;for(let a of e.entities){let o=t.get(a.id),n=o&&("Shape"===o.renderType||"Player"===o.renderType||"Explosion"===o.renderType);if(!o||o.className!==(a.className??a.type)||o.ghostIndex!==a.ghostIndex||o.dataBlockId!==a.dataBlockId||o.shapeHint!==a.shapeHint||n&&null!=a.dataBlock&&o.shapeName!==a.dataBlock||"Player"!==o.renderType&&n&&o.weaponShape!==a.weaponShape)o=function(e,t){if(e.sceneData){let i={id:e.id,className:e.className??e.type,ghostIndex:e.ghostIndex,dataBlockId:e.dataBlockId,shapeHint:e.shapeHint,spawnTime:t};switch(e.sceneData.className){case"TerrainBlock":return{...i,renderType:"TerrainBlock",terrainData:e.sceneData};case"InteriorInstance":return{...i,renderType:"InteriorInstance",interiorData:e.sceneData};case"Sky":return{...i,renderType:"Sky",skyData:e.sceneData};case"Sun":return{...i,renderType:"Sun",sunData:e.sceneData};case"WaterBlock":return{...i,renderType:"WaterBlock",waterData:e.sceneData};case"MissionArea":return{...i,renderType:"MissionArea",missionAreaData:e.sceneData};case"TSStatic":return{...Y(e,t),renderType:"Shape",shapeName:e.sceneData.shapeName,shapeType:"TSStatic",dataBlock:e.dataBlock}}}return e.visual?.kind==="tracer"?{...Y(e,t),renderType:"Tracer",visual:e.visual,dataBlock:e.dataBlock,direction:e.direction}:e.visual?.kind==="sprite"?{...Y(e,t),renderType:"Sprite",visual:e.visual}:"Player"===e.type?{...Y(e,t),renderType:"Player",shapeName:e.dataBlock,dataBlock:e.dataBlock,weaponShape:e.weaponShape,packShape:e.packShape,flagShape:e.flagShape,falling:e.falling,jetting:e.jetting,playerName:e.playerName,iffColor:e.iffColor,threads:e.threads,weaponImageState:e.weaponImageState,weaponImageStates:e.weaponImageStates,headPitch:e.headPitch,headYaw:e.headYaw,targetRenderFlags:e.targetRenderFlags}:"Explosion"===e.type?{...Y(e,t),renderType:"Explosion",shapeName:e.dataBlock,dataBlock:e.dataBlock,explosionDataBlockId:e.explosionDataBlockId,faceViewer:e.faceViewer}:"ForceFieldBare"===e.className?{...Y(e,t),renderType:"ForceFieldBare"}:"AudioEmitter"===e.className?{...Y(e,t),renderType:"AudioEmitter",audioFileName:e.audioFileName,audioVolume:e.audioVolume,audioIs3D:e.audioIs3D,audioIsLooping:e.audioIsLooping??!0,audioMinDistance:e.audioMinDistance,audioMaxDistance:e.audioMaxDistance,audioMinLoopGap:e.audioMinLoopGap,audioMaxLoopGap:e.audioMaxLoopGap}:"WayPoint"===e.className?{...Y(e,t),renderType:"WayPoint",label:e.label}:"Camera"===e.className?{...Y(e,t),renderType:"Camera"}:{...Y(e,t),renderType:"Shape",shapeName:e.dataBlock,shapeType:"Turret"===e.className?"Turret":"Item"===e.className?"Item":"StaticShape",dataBlock:e.dataBlock,weaponShape:e.weaponShape,threads:e.threads,targetRenderFlags:e.targetRenderFlags,iffColor:e.iffColor}}(a,e.timeSec);else{var r=o;switch(r.renderType){case"Player":r.threads=a.threads,r.weaponShape=a.weaponShape,r.packShape=a.packShape,r.flagShape=a.flagShape,r.falling=a.falling,r.jetting=a.jetting,r.weaponImageState=a.weaponImageState,r.weaponImageStates=a.weaponImageStates,r.playerName=a.playerName,r.iffColor=a.iffColor,r.headPitch=a.headPitch,r.headYaw=a.headYaw,r.targetRenderFlags=a.targetRenderFlags;break;case"Shape":r.threads=a.threads,r.targetRenderFlags=a.targetRenderFlags,r.iffColor=a.iffColor}}if(i.set(a.id,o),(0,Q.isSceneEntity)(o)||"None"===o.renderType)continue;let s=o.keyframes;0===s.length&&s.push({time:e.timeSec,position:a.position??[0,0,0],rotation:a.rotation??[0,0,0,1]});let l=s[0];l.time=e.timeSec,a.position&&(l.position=a.position),a.rotation&&(l.rotation=a.rotation),l.velocity=a.velocity,l.health=a.health,l.energy=a.energy,l.actionAnim=a.actionAnim,l.actionAtEnd=a.actionAtEnd,l.damageState=a.damageState}for(let[r,a]of t)if(!i.has(r)&&"Explosion"===a.renderType&&a.shapeName&&null!=a.spawnTime&&e.timeSec-a.spawnTime<5){i.set(r,a);continue}let a=i.size!==t.size||[...i.keys()].some(e=>!t.has(e));k.current=i,a&&K.gameEntityStore.getState().setAllStreamEntities(Array.from(i.values()));let o=null;if(e.camera?.mode==="first-person"&&e.camera.controlEntityId){let t=i.get(e.camera.controlEntityId),r=t?t.shapeName:void 0;r&&(o=r)}I(e=>e===o?e:o)},g[2]=c):c=g[2];let B=c;return g[3]!==S||g[4]!==y.gameType||g[5]!==y.missionName||g[6]!==y.recorderName||g[7]!==y.recordingDate||g[8]!==y.serverDisplayName||g[9]!==y.source||g[10]!==y.streamingPlayback?(u=()=>{(0,w.stopAllTrackedSounds)(),A.current=y.streamingPlayback??null,k.current=new Map,C.current=null,P.current=null,(0,$.resetStreamPlayback)(),v.current=0,b.current=null,M.current=null;let e=A.current;if($.streamPlaybackStore.setState({playback:e}),K.gameEntityStore.getState().beginStreaming(y.source),!e)return void S.getState().setPlaybackStreamSnapshot(null);e.onMissionInfoChange=()=>{K.gameEntityStore.getState().setMissionInfo({missionDisplayName:e.missionDisplayName??void 0,missionTypeDisplayName:e.missionTypeDisplayName??void 0,gameClassName:e.gameClassName??void 0,recorderName:e.connectedPlayerName??void 0})};let t=e.missionDisplayName,i=e.missionTypeDisplayName,r=e.gameClassName,a=e.serverDisplayName,o=e.connectedPlayerName;"live"!==y.source&&e.reset(),e.missionDisplayName=t,e.missionTypeDisplayName=i,e.gameClassName=r,e.serverDisplayName=a,e.connectedPlayerName=o,K.gameEntityStore.getState().setMissionInfo({missionName:y.missionName??void 0,missionTypeDisplayName:y.gameType??void 0,missionDisplayName:t??void 0,gameClassName:r??void 0,serverDisplayName:a??y.serverDisplayName??void 0,recorderName:o??y.recorderName??void 0,recordingDate:y.recordingDate??void 0});let n=e.getSnapshot();return $.streamPlaybackStore.setState({time:n.timeSec}),v.current=n.timeSec,b.current=n,M.current=n,B(n),S.getState().setPlaybackStreamSnapshot(n),P.current=n,()=>{(0,w.stopAllTrackedSounds)(),A.current=null,(0,$.resetStreamPlayback)()}},g[3]=S,g[4]=y.gameType,g[5]=y.missionName,g[6]=y.recorderName,g[7]=y.recordingDate,g[8]=y.serverDisplayName,g[9]=y.source,g[10]=y.streamingPlayback,g[11]=u):u=g[11],g[12]!==S||g[13]!==y?(d=[y,S,B],g[12]=S,g[13]=y,g[14]=d):d=g[14],(0,r.useEffect)(u,d),g[15]!==S||g[16]!==y.source?(m=(e,t)=>{let i=A.current;if(!i)return;let r=S.getState(),a=r.playback,o="playing"===a.status,s=a.timeMs/1e3,l=!o&&Math.abs(s-v.current)>5e-4,c=o&&Math.abs(s-$.streamPlaybackStore.getState().time)>.05,u=l||c;u&&(v.current=s),o&&((0,T.advanceEffectClock)(t,a.rate),v.current=v.current+t*a.rate);let d=Math.max(1,Math.ceil(1e3*t*Math.max(a.rate,.01)/32)+2),m=v.current+n.STREAM_TICK_SEC,p=i.stepToTime(m,o&&!u?d:1/0),f=M.current;!f||p.timeSec1.5*n.STREAM_TICK_SEC?(b.current=p,M.current=p):p.timeSec!==f.timeSec&&(b.current=f,M.current=p);let h=M.current??p,g=b.current??h,w=h.timeSec-n.STREAM_TICK_SEC,C=Math.max(0,Math.min(1,(v.current-w)/n.STREAM_TICK_SEC));$.streamPlaybackStore.setState({time:v.current}),p.exhausted&&o&&(v.current=Math.min(v.current,p.timeSec)),B(h),$.streamPlaybackStore.getState().entities=k.current,h!==P.current&&(P.current=h,r.setPlaybackStreamSnapshot(h));let D=h.camera,I=D&&g.camera&&g.camera.mode===D.mode&&g.camera.controlEntityId===D.controlEntityId&&g.camera.orbitTargetId===D.orbitTargetId?g.camera:null,N=$.streamPlaybackStore.getState().freeFlyCamera,E="live"===y.source;if(D&&!N){if(!E)if(I){let t=I.position[0],i=I.position[1],r=I.position[2],a=D.position[0],o=D.position[1],n=D.position[2];e.camera.position.set(i+(o-i)*C,r+(n-r)*C,t+(a-t)*C),ee.set(...I.rotation),et.set(...D.rotation),ee.slerp(et,C),e.camera.quaternion.copy(ee)}else e.camera.position.set(D.position[1],D.position[2],D.position[0]),e.camera.quaternion.set(...D.rotation);if(Number.isFinite(D.fov)&&"isPerspectiveCamera"in e.camera&&e.camera.isPerspectiveCamera){let t=e.camera,i=I&&Number.isFinite(I.fov)?I.fov+(D.fov-I.fov)*C:D.fov,r=(0,n.torqueHorizontalFovToThreeVerticalFov)(i,t.aspect);Math.abs(t.fov-r)>.01&&(t.fov=r,t.updateProjectionMatrix())}}let R=X(h),V=X(g),F=k.current,_=$.streamPlaybackStore.getState().root;if(_)for(let t of _.children){let i=F.get(t.name);if(i&&(0,Q.isSceneEntity)(i))continue;let r=R.get(t.name);if(!r){let e=i&&"keyframes"in i?i.keyframes:void 0;if(e?.[0]?.position){let i=e[0];t.visible=!0,t.position.set(i.position[1],i.position[2],i.position[0]);continue}}if(!r?.position){t.visible=!1;continue}t.visible=!0;let a=V.get(t.name);if(a?.position){let e=a.position[0],i=a.position[1],o=a.position[2],n=r.position[0],s=r.position[1],l=r.position[2],c=e+(n-e)*C,u=i+(s-i)*C,d=o+(l-o)*C;t.position.set(u,d,c)}else t.position.set(r.position[1],r.position[2],r.position[0]);r.faceViewer?t.quaternion.copy(e.camera.quaternion).multiply(ei):r.visual?.kind==="tracer"?t.quaternion.identity():r.rotation&&(a?.rotation?(ee.set(...a.rotation),et.set(...r.rotation),ee.slerp(et,C),t.quaternion.copy(ee)):t.quaternion.set(...r.rotation))}let O=D?.mode;if(!N&&!E&&"third-person"===O&&_&&D?.orbitTargetId){let t=_.children.find(e=>e.name===D.orbitTargetId);if(t){let i=R.get(D.orbitTargetId);ea.copy(t.position),i?.type==="Player"&&(ea.y=ea.y+1);let r=!1;if(D.orbitDirection)er.set(D.orbitDirection[0],D.orbitDirection[1],D.orbitDirection[2]),r=er.lengthSq()>1e-8;else if("number"==typeof D.yaw&&"number"==typeof D.pitch){let e=Math.sin(D.pitch),t=Math.cos(D.pitch),i=Math.sin(D.yaw),a=Math.cos(D.yaw);er.set(-a*t,-e,-i*t),r=er.lengthSq()>1e-8}if(r||(er.copy(e.camera.position).sub(ea),r=er.lengthSq()>1e-8),r){er.normalize();let t=Math.max(.1,D.orbitDistance??4);eo.copy(ea).addScaledVector(er,t),e.camera.position.copy(eo),e.camera.lookAt(ea)}}}if(!N&&"first-person"===O&&_&&D?.controlEntityId){let t=_.children.find(e=>e.name===D.controlEntityId);t?(Z.copy(x.current).applyQuaternion(t.quaternion),e.camera.position.add(Z)):e.camera.position.y=e.camera.position.y+x.current.y}o&&p.exhausted&&r.setPlaybackStatus("paused");let z=1e3*v.current;Math.abs(z-a.timeMs)>.5&&r.setPlaybackTime(z)},g[15]=S,g[16]=y.source,g[17]=m):m=g[17],(0,a.useFrame)(m),g[18]!==y.streamingPlayback?(p=(0,t.jsx)(q,{playback:y.streamingPlayback,snapshotRef:M}),g[18]=y.streamingPlayback,g[19]=p):p=g[19],g[20]!==D?(f=D&&(0,t.jsx)(r.Suspense,{children:(0,t.jsx)(H.PlayerEyeOffset,{shapeName:D,eyeOffsetRef:x})}),g[20]=D,g[21]=f):f=g[21],g[22]!==p||g[23]!==f?(h=(0,t.jsxs)(t.Fragment,{children:[p,f]}),g[22]=p,g[23]=f,g[24]=h):h=g[24],h}e.s(["StreamingController",()=>en],51295)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/44a6df9214eeac58.js b/docs/_next/static/chunks/44a6df9214eeac58.js new file mode 100644 index 00000000..6dee81d0 --- /dev/null +++ b/docs/_next/static/chunks/44a6df9214eeac58.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,scene:_,onPointerMissed:w,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[I,F]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),L=r.useRef(null),O=r.useRef(null);r.useImperativeHandle(e,()=>L.current);let P=(0,t.a)(w),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let N=r.useRef(null);(0,t.b)(()=>{let e=L.current;F.width>0&&F.height>0&&e&&(N.current||(N.current=(0,t.c)(e)),async function(){await N.current.configure({gl:f,scene:_,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,size:F,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:O.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),N.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=L.current;if(e)return()=>(0,t.d)(e)},[]);let j=p?"none":"auto";return(0,s.jsx)("div",{ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...c},...M,children:(0,s.jsx)("div",{ref:I,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:L,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},85413,e=>{"use strict";var t=Object.defineProperty;class r{constructor(){((e,r,n)=>{let i;return(i="symbol"!=typeof r?r+"":r)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;tr])},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,68754,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function E(e){return e}function A(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function _(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function w(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function I(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function F(){return r&&!!navigator.maxTouchPoints}function L(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function O(){return r&&L()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function N(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function j(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(j(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},V=U.useId;U.useDeferredValue;var q=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return q?q(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)I(r,t)}},e)}function Q(e){if(V){let t=V();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function z(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eE(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eA(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eA(i))}),n}function e_(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eE);return(t&&eE(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=e_(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function ew(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eI(e){!eR(e)&&ex(e)&&e.focus()}var eF=O(),eL=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eO=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function eN(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var ej=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(j("mousedown",ek,!0),j("keydown",eN,!0),eB=!0)},[e]),eF&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&w(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eF||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eO]=!0),N(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eO]=!1),n||eI(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,E=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;N(r,"focusout",()=>C(t,r))}),A=i.onFocusCapture,_=W(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eL.includes(n))}(t.target)?N(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,I=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),F=(0,R.useContext)(eS),L=W(t=>{e&&r&&t&&F&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),O=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!O||"button"===O||"summary"===O||"input"===O||"select"===O||"textarea"===O||"a"===O),G=e&&(!O||"button"===O||"input"===O||"select"===O||"textarea"===O),U=i.style,V=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,L,i.ref),style:V,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:E,onFocusCapture:_,onBlur:I},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eV(e){return e.slice().reverse()}function eq(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",ej(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();A(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eq(e,i.onKeyDownCapture,u),v=eq(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,E=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),_=i.onBlurCapture,w=W(t=>{var r;if(null==_||_(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),I=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eV(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:E,onBlurCapture:w,onKeyDown:I},i=ej({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,eQ=ec([eW.ContextProvider],[eW.ScopedContextProvider]);eQ.useContext,eQ.useScopedContext;var ez=eQ.useProviderContext,e$=eQ.ContextProvider,eX=eQ.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e4=(0,R.createContext)(void 0),e5=ec([e1,ev],[e2,eg]),e8=e5.useContext,e6=e5.useScopedContext,e9=e5.useProviderContext,e7=e5.ContextProvider,te=e5.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return A(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,E=e9();A(e=e||E,!1);let w=(0,R.useRef)(null),[T,M]=$(),I=(0,R.useRef)(!1),F=(0,R.useRef)(!1),L=e.useState(e=>e.virtualFocus&&r),O="inline"===y||"both"===y,[P,D]=(0,R.useState)(O);C=[O],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{O&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let j=e.useState(e=>{var t;if(O&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),V=e.useState("open"),q=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!O||!P)return B;if(tp(U,j,L)){if(tm(B,j)){let e=(null==j?void 0:j.slice(B.length))||"";return B+e}return B}return j||B},[O,P,U,j,L,B]);(0,R.useEffect)(()=>{let e=w.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!O||!P||!j||!tp(U,j,L)||!tm(B,j))return;let e=S;return queueMicrotask(()=>{let t=w.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=j.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,O,P,j,U,L,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!V||!q)return;let t=h(q);if(!t)return;Z.current=t;let r=()=>{I.current=!1},n=()=>{if(!e||!I.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(I.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[V,q,e]),H(()=>{!B||F.current||(I.current=!0)},[B]),H(()=>{"always"!==L&&V||(I.current=V)},[L,V]);let et=e.useState("resetValueOnSelect");z(()=>{var t,r;let n=I.current;if(!e||!V||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(L&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,V,T,B,L,et,J,U]),(0,R.useEffect)(()=>{if(!O)return;let t=w.current;if(!t)return;let r=[t,q].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[O,q,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(I.current=!0,"input"===a.type&&(a.isComposing&&(I.current=!1,F.current=!0),O)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),O&&L&&t&&M()}ei(t)&&e.show(),L&&I.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{I.current=!0,F.current=!1,null==el||el(e),e.defaultPrevented||L&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&N(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(I.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(I.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=Q(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(q,"listbox"),"aria-expanded":V,"aria-controls":null==q?void 0:q.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(w,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!_(g,e)&&(O&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();A(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(j("mousemove",en,!0),j("mousedown",ei,!0),j("mouseup",ei,!0),j("keydown",ei,!0),j("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=E,element:n,...i}){let o=ed();e=e||o;let a=Q(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tE=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=w(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?N(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return ej(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tE(e))});var{useSyncExternalStore:tA}=e.i(2239).default,t_=()=>()=>{};function tw(e,t=E){let r=R.useCallback(t=>e?tl(e,null,t):t_(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tA(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):t_(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tA(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>tw(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tI(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&atR,"useStoreProps",()=>tM,"useStoreState",()=>tw,"useStoreStateObject",()=>tT],68754);var tF=es(function({store:e,rowId:t,preventScrollOnKeyDown:r=!1,moveOnKeyPress:i=!0,tabbable:o=!1,getItem:a,"aria-setsize":l,"aria-posinset":s,...c}){let m=em();e=e||m;let h=Q(c.id),v=(0,R.useRef)(null),g=(0,R.useContext)(eb),S=w(c)&&!c.accessibleWhenDisabled,{rowId:C,baseElement:x,isActiveItem:E,ariaSetSize:A,ariaPosInSet:_,isTabbable:M}=tT(e,{rowId:e=>t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),I=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),F=c.onFocus,L=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==F||F(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((O()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),L.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&L.current&&(L.current=!1,t.preventDefault(),t.stopPropagation())}),N=c.onKeyDown,j=X(r),U=X(i),V=W(t=>{if(null==N||N(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tI(r,e,null==e?void 0:e.up,!0),PageDown:()=>tI(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(j(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),q=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":E||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:q,children:e}),[q]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:V},c=tE(c),T({...c=tS({store:e,...c,getItem:I,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":_})});el(ea(function(e){return eu("button",tF(e))}));var tL=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();A(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),E=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=L();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),_=s.onKeyDown,w=W(t=>{if(null==_||_(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e4)])?d:"option",children:t,...s,onClick:E,onKeyDown:w};let T=X(l);return s=tF({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tO=el(ea(function(e){return eu("div",tL(e))}));e.s(["ComboboxItem",()=>tO],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();A(e=e||n,!1);let i=(0,R.useRef)(null),o=Q(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=tw(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tN=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===tw(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tN,{...t})});var tj=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;A(e,!1);let a=(0,R.useRef)(null),l=Q(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e4.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tj(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tj],86447);var tV=(0,R.createContext)(null),tq=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tq(e))});var tH=es(function(e){return tq(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tQ=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tV),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),I(i,t),!a)return()=>{t.remove(),I(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of e_(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tV.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(ew()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=ew();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=ew())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tQ(e))});var tz=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tz),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tz.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t4(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t5(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t4(e,t,t=>{t5(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=tw(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return j(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eO]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=e_(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return z(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=tw(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=O();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:E,unstable_treeSnapshotKey:A,..._}){var w;let T,M,I,O=ez(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||O,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,_.portalRef),k=_.preserveTabOrder,U=tw(D,e=>k&&!f&&e.mounted),V=Q(_.id),q=tw(D,"open"),z=tw(D,"mounted"),J=tw(D,"contentElement"),ee=tG(z,_.hidden,_.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:V,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=L()&&!(r&&navigator.platform.startsWith("Mac")&&!F());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),w=tw(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!w){M.current=null;return}return j("mousedown",e=>{M.current=e.target},!0)},[w]),re({...I={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...I,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...I,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);_=Y(_,et,[et]),H(()=>{if(!q)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,q]),rc&&(0,R.useEffect)(()=>{if(!z)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),N(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eI(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,z]),(0,R.useEffect)(()=>{if(!z||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[z,G]),(0,R.useEffect)(()=>{if(!f||!z||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,z,G]),H(()=>{if(!rn()||q||!z||!G)return;let e=P.current;if(e)return ri(e)},[q,z,G]);let en=q&&G;H(()=>{if(V&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t4(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(V,[P.current])},[V,en,A]);let ei=W(v);H(()=>{if(!V||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(V,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t4(V,t,n=>{t5(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(V,[e,...t])},[V,D,en,ei,er,f,A]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!q||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=e_(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[q,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(q)return ep(!0),()=>ep(!1)},[q]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(q||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[q,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&z)return j("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,z,ev]);let eg=(_=Y(_,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=_.alwaysVisible;_=Y(_,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eE]=(0,R.useState)();return _=tX({..._={id:V,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,..._=Y(_,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eE,children:e})})}),[D]),ref:K(P,_.ref)},autoFocusOnShow:eu}),_=tQ({portal:d,..._=ej({..._=tk({store:D,..._}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=ez){return ea(function(r){let n=t();return tw(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),ez);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rE(e){return e.split("-")[1]}function rA(e){return"x"===e?"y":"x"}function r_(e){return"y"===e?"height":"width"}let rw=new Set(["top","bottom"]);function rT(e){return rw.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rI=["right","left"],rF=["top","bottom"],rL=["bottom","top"];function rO(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rA(rT(t)),u=r_(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rE(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rV(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rq(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rq(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rq(e).Element)}function rQ(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rq(e).HTMLElement)}function rz(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r4(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r4(){return!("u"rK(e)&&"body"!==rV(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();A(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),E=e.useState("popoverElement"),_=e.useState("contentElement"),w=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),I=(0,R.useRef)(null),[F,L]=(0,R.useState)(!1),{portalRef:O,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(I.current=I.current||document.createElement("div"));let C=S||I.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rj(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return A(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:A=!0,..._}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let w=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),I=C||(M||!A?[rO(v)]:(c=rO(v),[rM(v),c,rM(c)])),F="none"!==E;!C&&F&&I.push(...(f=rE(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rI:rR;return t?rR:rI;case"left":case"right":return t?rF:rL;default:return[]}}(rx(v),"start"===E,R),f&&(d=d.map(e=>e+"-"+f),A&&(d=d.concat(d.map(rM)))),d));let L=[v,...I],O=await g.detectOverflow(e,_),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(O[w]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rE(l),r=r_(t=rA(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rO(n)),[n,rO(n)]);P.push(O[i[0]],O[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=L[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(F){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rA(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rN.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rA(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rA(rT(i)),m=r_(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,E=rm(f[v?"top":"left"],x),A=rm(f[v?"bottom":"right"],x),_=C-h[m]-A,w=C/2-h[m]/2+(y/2-b/2),T=rh(E,rm(w,_)),M=!u.arrow&&null!=rE(i)&&w!==T&&o.reference[m]/2-(w{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rE(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,E=S,A=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(A=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(E=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?A=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):E=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:A,availableHeight:E});let _=await u.getDimensions(s.floating);return v!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}],_=await (v={placement:w,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,E,{...y,platform:b}));null==e||e.setState("currentPlacement",_.placement),L(!0);let M=nS(_.x),R=nS(_.y);if(Object.assign(E.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&_.middlewareData.arrow){let{x:e,y:t}=_.middlewareData.arrow,r=_.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,E,async()=>{G?(await B({updatePosition:r}),L(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{L(!1),n()}},[e,M,E,S,C,E,w,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==E?void 0:E.isConnected)||!(null==_?void 0:_.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(_).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,E,_]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!F||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:F&&i,...y,portalRef:O})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();A(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=tw(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tj({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!_(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nE=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nE],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nA=ec([ev],[eg]),n_=nA.useContext;nA.useScopedContext,nA.useProviderContext,nA.ContextProvider,nA.ScopedContextProvider;var nw={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nI(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nF=O()&&F();function nL({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nI(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),E=y&&c&&(m?"horizontal"!==c:"vertical"!==c),A=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[nw]:[],...e.slice(0,n)]}(E&&!A?v:nM(v,g.rowId),l,A),l);return null==e?void 0:e.id}if(E){let e=nT(A?C:S,l);return A?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let _=nT(C,l);return!_&&A?null:null==_?void 0:_.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eV(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nF&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nO(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=n_();let[c,f]=tR(nL,e={id:Q((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return z(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,z(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,z(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nO(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nO],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return A(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nN=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nN],59129);var nj=es(function(e){let t=(0,R.useContext)(nD),r=Q(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nj(e))});var nU=es(function({store:e,...t}){return nj(t)});ea(function(e){return eu("div",nU(e))});var nV=es(function(e){return nU(e)}),nq=ea(function(e){return eu("div",nV(e))});e.s(["ComboboxGroupLabel",()=>nq],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nQ(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nz(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nz(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nz(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nQ.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nQ],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",E="[object WeakMap]",A="[object ArrayBuffer]",_="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/\\(\\)?/g,F=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,O={};O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O[s]=O[c]=O[A]=O[f]=O[_]=O[d]=O[p]=O[m]=O[h]=O[v]=O[g]=O[b]=O[S]=O[C]=O[E]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,N=k&&k.exports===G&&P.process,j=function(){try{return N&&N.binding("util")}catch(e){}}(),U=j&&j.isTypedArray;function V(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=ew(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eE.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eE.prototype.delete=function(e){return eP(this,e).delete(e)},eE.prototype.get=function(e){return eP(this,e).get(e)},eE.prototype.has=function(e){return eP(this,e).has(e)},eE.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eA.prototype.add=eA.prototype.push=function(e){return this.__data__.set(e,l),this},eA.prototype.has=function(e){return this.__data__.has(e)},e_.prototype.clear=function(){this.__data__=new ex},e_.prototype.delete=function(e){return this.__data__.delete(e)},e_.prototype.get=function(e){return this.__data__.get(e)},e_.prototype.has=function(e){return this.__data__.has(e)},e_.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eE(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!eQ(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eA:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?q(U):function(e){return eY(e)&&e$(e.length)&&!!O[ee.call(e)]};function e0(e){return eQ(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Backdrop:"MissionSelect-module__N_AIjG__Backdrop",Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/4e0d5bbc5104adf2.js b/docs/_next/static/chunks/4e0d5bbc5104adf2.js new file mode 100644 index 00000000..84354f99 --- /dev/null +++ b/docs/_next/static/chunks/4e0d5bbc5104adf2.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75840,e=>{e.v({BarFillEnergy:"PlayerHUD-module__-E1Scq__BarFillEnergy",BarFillHealth:"PlayerHUD-module__-E1Scq__BarFillHealth",BarTrack:"PlayerHUD-module__-E1Scq__BarTrack",Bars:"PlayerHUD-module__-E1Scq__Bars",Compass:"PlayerHUD-module__-E1Scq__Compass",CompassNSEW:"PlayerHUD-module__-E1Scq__CompassNSEW",CompassRing:"PlayerHUD-module__-E1Scq__CompassRing",PackInvCount:"PlayerHUD-module__-E1Scq__PackInvCount",PackInvIcon:"PlayerHUD-module__-E1Scq__PackInvIcon",PackInvInfinity:"PlayerHUD-module__-E1Scq__PackInvInfinity",PackInvItem:"PlayerHUD-module__-E1Scq__PackInvItem",PackInvItemActive:"PlayerHUD-module__-E1Scq__PackInvItemActive",PackInvItemDim:"PlayerHUD-module__-E1Scq__PackInvItemDim",PackInventoryHUD:"PlayerHUD-module__-E1Scq__PackInventoryHUD",PlayerHUD:"PlayerHUD-module__-E1Scq__PlayerHUD",Reticle:"PlayerHUD-module__-E1Scq__Reticle",ReticleDot:"PlayerHUD-module__-E1Scq__ReticleDot",ReticleImage:"PlayerHUD-module__-E1Scq__ReticleImage",TeamCount:"PlayerHUD-module__-E1Scq__TeamCount",TeamInfo:"PlayerHUD-module__-E1Scq__TeamInfo",TeamName:"PlayerHUD-module__-E1Scq__TeamName",TeamNameEnemy:"PlayerHUD-module__-E1Scq__TeamNameEnemy PlayerHUD-module__-E1Scq__TeamName",TeamNameFriendly:"PlayerHUD-module__-E1Scq__TeamNameFriendly PlayerHUD-module__-E1Scq__TeamName",TeamRow:"PlayerHUD-module__-E1Scq__TeamRow",TeamScore:"PlayerHUD-module__-E1Scq__TeamScore",TeamScores:"PlayerHUD-module__-E1Scq__TeamScores",TopRight:"PlayerHUD-module__-E1Scq__TopRight",WeaponHUD:"PlayerHUD-module__-E1Scq__WeaponHUD",WeaponSeparator:"PlayerHUD-module__-E1Scq__WeaponSeparator"})},75782,e=>{e.v({ChatColor0:"ChatWindow-module__mz35vq__ChatColor0",ChatColor1:"ChatWindow-module__mz35vq__ChatColor1",ChatColor2:"ChatWindow-module__mz35vq__ChatColor2",ChatColor3:"ChatWindow-module__mz35vq__ChatColor3",ChatColor4:"ChatWindow-module__mz35vq__ChatColor4",ChatColor5:"ChatWindow-module__mz35vq__ChatColor5",ChatColor6:"ChatWindow-module__mz35vq__ChatColor6",ChatColor7:"ChatWindow-module__mz35vq__ChatColor7",ChatColor8:"ChatWindow-module__mz35vq__ChatColor8",ChatColor9:"ChatWindow-module__mz35vq__ChatColor9",ChatContainer:"ChatWindow-module__mz35vq__ChatContainer",ChatMessage:"ChatWindow-module__mz35vq__ChatMessage",ChatWindow:"ChatWindow-module__mz35vq__ChatWindow"})},49776,e=>{"use strict";var a=e.i(43476),l=e.i(932),t=e.i(58647),n=e.i(12979),r=e.i(75840),o=e.i(71645),c=e.i(75782);let u=(0,o.lazy)(()=>e.A(60458).then(e=>({default:e.ChatInput}))),i=[],s={0:c.default.ChatColor0,1:c.default.ChatColor1,2:c.default.ChatColor2,3:c.default.ChatColor3,4:c.default.ChatColor4,5:c.default.ChatColor5,6:c.default.ChatColor6,7:c.default.ChatColor7,8:c.default.ChatColor8,9:c.default.ChatColor9},d=(0,o.memo)(function(){let e,n,r,i,s,d,h=(0,l.c)(12),f=(0,t.useEngineSelector)(_),g=(0,t.useEngineSelector)(m),C=(0,o.useRef)(null),y=g[g.length-1]?.id;return h[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{C.current&&(C.current.scrollTop=C.current.scrollHeight)},h[0]=e):e=h[0],h[1]!==y?(n=[y],h[1]=y,h[2]=n):n=h[2],(0,o.useEffect)(e,n),h[3]!==g?(r=g.map(p),h[3]=g,h[4]=r):r=h[4],h[5]!==r?(i=(0,a.jsx)("div",{ref:C,className:c.default.ChatWindow,children:r}),h[5]=r,h[6]=i):i=h[6],h[7]!==f?(s=f&&(0,a.jsx)(o.Suspense,{children:(0,a.jsx)(u,{})}),h[7]=f,h[8]=s):s=h[8],h[9]!==i||h[10]!==s?(d=(0,a.jsxs)("div",{className:c.default.ChatContainer,children:[i,s]}),h[9]=i,h[10]=s,h[11]=d):d=h[11],d});function _(e){return e.playback.recording?.source==="live"}function m(e){return e.playback.streamSnapshot?.chatMessages??i}function h(e,l){return(0,a.jsx)("span",{className:s[e.colorCode]??s[0],children:e.text},l)}function p(e){return(0,a.jsx)("div",{className:c.default.ChatMessage,hidden:!e.text,children:e.segments?e.segments.map(h):(0,a.jsxs)("span",{className:null!=e.colorCode&&s[e.colorCode]?s[e.colorCode]:s[0],children:[e.sender?`${e.sender}: `:"",e.text]})},e.id)}let f=(0,n.textureToUrl)("gui/hud_new_compass"),g=(0,n.textureToUrl)("gui/hud_new_NSEW");function C(){let e,n,o=(0,l.c)(3),c=(0,t.useEngineSelector)(y);if(null==c)return null;let u=180*c/Math.PI;o[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("img",{src:f,alt:"",className:r.default.CompassRing}),o[0]=e):e=o[0];let i=`rotate(${-u}deg)`;return o[1]!==i?(n=(0,a.jsxs)("div",{className:r.default.Compass,children:[e,(0,a.jsx)("img",{src:g,alt:"",className:r.default.CompassNSEW,style:{transform:i}})]}),o[1]=i,o[2]=n):n=o[2],n}function y(e){return e.playback.streamSnapshot?.camera?.yaw}function S(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(k);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillHealth,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function k(e){return e.playback.streamSnapshot?.status?.health}function v(){let e,n=(0,l.c)(2),o=(0,t.useEngineSelector)(x);if(null==o)return null;let c=Math.max(0,Math.min(100,100*o)),u=`${c}%`;return n[0]!==u?(e=(0,a.jsx)("div",{className:r.default.BarTrack,children:(0,a.jsx)("div",{className:r.default.BarFillEnergy,style:{width:u}})}),n[0]=u,n[1]=e):e=n[1],e}function x(e){return e.playback.streamSnapshot?.status?.energy}let I={weapon_sniper:"gui/hud_ret_sniper",weapon_shocklance:"gui/hud_ret_shocklance",weapon_targeting:"gui/hud_ret_targlaser"};function P(){let e,o=(0,l.c)(5),c=(0,t.useEngineSelector)(b);if(void 0===c)return null;let u=I[!c?"":c.replace(/\.dts$/i,"").toLowerCase()];if(u){let e,l;return o[0]!==u?(e=(0,n.textureToUrl)(u),o[0]=u,o[1]=e):e=o[1],o[2]!==e?(l=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("img",{src:e,alt:"",className:r.default.ReticleImage})}),o[2]=e,o[3]=l):l=o[3],l}return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)("div",{className:r.default.Reticle,children:(0,a.jsx)("div",{className:r.default.ReticleDot})}),o[4]=e):e=o[4],e}function b(e){let a=e.playback.streamSnapshot;if(!a||a.camera?.mode!=="first-person")return;let l=a.controlPlayerGhostId;if(l)return a.entities.find(e=>e.id===l)?.weaponShape}let w={0:{icon:"gui/hud_blaster",label:"Blaster"},1:{icon:"gui/hud_plasma",label:"Plasma"},2:{icon:"gui/hud_chaingun",label:"Chaingun"},3:{icon:"gui/hud_disc",label:"Spinfusor"},4:{icon:"gui/hud_grenlaunch",label:"GL"},5:{icon:"gui/hud_sniper",label:"Laser Rifle"},6:{icon:"gui/hud_elfgun",label:"ELF Gun"},7:{icon:"gui/hud_new_mortar",label:"Mortar"},8:{icon:"gui/hud_missiles",label:"Missile"},9:{icon:"gui/hud_targetlaser",label:"Targeting"},10:{icon:"gui/hud_shocklance",label:"Shocklance"},11:{icon:"gui/hud_disc",label:"Spinfusor"},12:{icon:"gui/hud_grenlaunch",label:"GL"},13:{icon:"gui/hud_chaingun",label:"Chaingun"},14:{icon:"gui/hud_targetlaser",label:"Targeting"},15:{icon:"gui/hud_targetlaser",label:"Targeting"},16:{icon:"gui/hud_shocklance",label:"Shocklance"},17:{icon:"gui/hud_new_mortar",label:"Mortar"}},j=new Map(Object.entries(w).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)])),E=new Set([9,14,15]),N=(0,n.textureToUrl)("gui/hud_infinity");function U(e){let t,n,o,c,u=(0,l.c)(12),{slot:i,isSelected:s}=e,d=w[i.index];if(!d)return null;let _=i.ammo<0,m=`${r.default.PackInvItem} ${s?r.default.PackInvItemActive:r.default.PackInvItemDim}`;return u[0]!==i.index?(t=j.get(i.index),u[0]=i.index,u[1]=t):t=u[1],u[2]!==d.label||u[3]!==t?(n=(0,a.jsx)("img",{src:t,alt:d.label,className:r.default.PackInvIcon}),u[2]=d.label,u[3]=t,u[4]=n):n=u[4],u[5]!==_||u[6]!==i.ammo?(o=_?(0,a.jsx)("img",{src:N,alt:"\\u221E",className:r.default.PackInvInfinity}):(0,a.jsx)("span",{className:r.default.PackInvCount,children:i.ammo}),u[5]=_,u[6]=i.ammo,u[7]=o):o=u[7],u[8]!==m||u[9]!==n||u[10]!==o?(c=(0,a.jsxs)("div",{className:m,children:[n,o]}),u[8]=m,u[9]=n,u[10]=o,u[11]=c):c=u[11],c}function T(){let e,n,o,c,u,i,s=(0,l.c)(15),d=(0,t.useEngineSelector)(D);if(!d||!d.slots.length)return null;if(s[0]!==d.slots){for(let a of(n=[],e=[],d.slots))E.has(a.index)?e.push(a):n.push(a);s[0]=d.slots,s[1]=e,s[2]=n}else e=s[1],n=s[2];return s[3]!==n||s[4]!==d?(o=n.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[3]=n,s[4]=d,s[5]=o):o=s[5],s[6]!==e.length?(c=e.length>0&&(0,a.jsx)("div",{className:r.default.WeaponSeparator}),s[6]=e.length,s[7]=c):c=s[7],s[8]!==e||s[9]!==d?(u=e.map(e=>(0,a.jsx)(U,{slot:e,isSelected:e.index===d.activeIndex},e.index)),s[8]=e,s[9]=d,s[10]=u):u=s[10],s[11]!==o||s[12]!==c||s[13]!==u?(i=(0,a.jsxs)("div",{className:r.default.WeaponHUD,children:[o,c,u]}),s[11]=o,s[12]=c,s[13]=u,s[14]=i):i=s[14],i}function D(e){return e.playback.streamSnapshot?.weaponsHud}let H={1:"Storm",2:"Inferno",3:"Starwolf",4:"Diamond Sword",5:"Blood Eagle",6:"Phoenix"};function q(){let e,n,o,c=(0,l.c)(11),u=(0,t.useEngineSelector)(R),i=(0,t.useEngineSelector)(W);if(!u?.length)return null;if(c[0]!==i||c[1]!==u){let l,t;c[4]!==i?(l=(e,a)=>{if(i){if(e.teamId===i)return -1;if(a.teamId===i)return 1}return e.teamId-a.teamId},c[4]=i,c[5]=l):l=c[5];let o=[...u].sort(l);e=r.default.TeamScores,c[6]!==i?(t=e=>{let l=i>0&&e.teamId===i,t=e.name||(H[e.teamId]??`Team ${e.teamId}`);return(0,a.jsxs)("div",{className:r.default.TeamRow,children:[(0,a.jsxs)("div",{className:r.default.TeamInfo,children:[(0,a.jsx)("span",{className:l?r.default.TeamNameFriendly:r.default.TeamNameEnemy,children:t})," ",(0,a.jsxs)("span",{className:r.default.TeamCount,children:[e.playerCount," ",1===e.playerCount?"player":"players"]})]}),(0,a.jsx)("span",{className:r.default.TeamScore,children:e.score})]},e.teamId)},c[6]=i,c[7]=t):t=c[7],n=o.map(t),c[0]=i,c[1]=u,c[2]=e,c[3]=n}else e=c[2],n=c[3];return c[8]!==e||c[9]!==n?(o=(0,a.jsx)("div",{className:e,children:n}),c[8]=e,c[9]=n,c[10]=o):o=c[10],o}function W(e){return e.playback.streamSnapshot?.playerSensorGroup}function R(e){return e.playback.streamSnapshot?.teamScores}let B=new Map(Object.entries({0:"gui/hud_new_packammo",1:"gui/hud_new_packcloak",2:"gui/hud_new_packenergy",3:"gui/hud_new_packrepair",4:"gui/hud_new_packsatchel",5:"gui/hud_new_packshield",6:"gui/hud_new_packinventory",7:"gui/hud_new_packmotionsens",8:"gui/hud_new_packradar",9:"gui/hud_new_packturretout",10:"gui/hud_new_packturretin",11:"gui/hud_new_packsensjam",12:"gui/hud_new_packturret",13:"gui/hud_new_packturret",14:"gui/hud_new_packturret",15:"gui/hud_new_packturret",16:"gui/hud_new_packturret",17:"gui/hud_new_packturret",18:"gui/hud_satchel_unarmed",19:"gui/hud_new_packenergy"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),M=new Map(Object.entries({1:"gui/hud_new_packcloak_armed",3:"gui/hud_new_packrepair_armed",4:"gui/hud_satchel_armed",5:"gui/hud_new_packshield_armed",11:"gui/hud_new_packsensjam_armed"}).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a)])),z={0:{icon:"gui/hud_handgren",label:"Grenade"},1:{icon:"gui/hud_mine",label:"Mine"},2:{icon:"gui/hud_beacon",label:"Beacon"},3:{icon:"gui/hud_medpack",label:"Repair Kit"}},F=new Map(Object.entries(z).map(([e,a])=>[Number(e),(0,n.textureToUrl)(a.icon)]));function $(){let e,n,o,c,u,i,s,d=(0,l.c)(25),_=(0,t.useEngineSelector)(O),m=(0,t.useEngineSelector)(G),h=_&&_.packIndex>=0;if(h){let a,l;d[0]!==_.active||d[1]!==_.packIndex?(a=_.active?M.get(_.packIndex):void 0,d[0]=_.active,d[1]=_.packIndex,d[2]=a):a=d[2];let t=a;d[3]!==t||d[4]!==_.packIndex?(l=t??B.get(_.packIndex),d[3]=t,d[4]=_.packIndex,d[5]=l):l=d[5],e=l}if(d[6]!==m){if(n=new Map,m)for(let e of m.slots)n.set(e.slot,e.count);d[6]=m,d[7]=n}else n=d[7];if(d[8]!==_||d[9]!==n||d[10]!==h||d[11]!==e){i=Symbol.for("react.early_return_sentinel");e:{let l,t=Object.keys(z).map(Number).sort(A);if(!h&&!n.size){i=null;break e}o=r.default.PackInventoryHUD,d[16]!==_||d[17]!==e?(c=e&&(0,a.jsxs)("div",{className:`${r.default.PackInvItem} ${_.active?r.default.PackInvItemActive:""}`,children:[(0,a.jsx)("img",{src:e,alt:"",className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:_.text||" "})]}),d[16]=_,d[17]=e,d[18]=c):c=d[18],d[19]!==n?(l=e=>{let l=z[e],t=F.get(e);return l&&t?(0,a.jsxs)("div",{className:r.default.PackInvItem,children:[(0,a.jsx)("img",{src:t,alt:l.label,className:r.default.PackInvIcon}),(0,a.jsx)("span",{className:r.default.PackInvCount,children:n.get(e)??0})]},e):null},d[19]=n,d[20]=l):l=d[20],u=t.map(l)}d[8]=_,d[9]=n,d[10]=h,d[11]=e,d[12]=o,d[13]=c,d[14]=u,d[15]=i}else o=d[12],c=d[13],u=d[14],i=d[15];return i!==Symbol.for("react.early_return_sentinel")?i:(d[21]!==o||d[22]!==c||d[23]!==u?(s=(0,a.jsxs)("div",{className:o,children:[c,u]}),d[21]=o,d[22]=c,d[23]=u,d[24]=s):s=d[24],s)}function A(e,a){return e-a}function G(e){return e.playback.streamSnapshot?.inventoryHud}function O(e){return e.playback.streamSnapshot?.backpackHud}function L(){let e,n,o,c,u,i,s,_=(0,l.c)(12),m=(0,t.useEngineSelector)(K);return _[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,a.jsx)(d,{}),_[0]=e):e=_[0],_[1]!==m?(n=m&&(0,a.jsxs)("div",{className:r.default.Bars,children:[(0,a.jsx)(S,{}),(0,a.jsx)(v,{})]}),_[1]=m,_[2]=n):n=_[2],_[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,a.jsx)(C,{}),_[3]=o):o=_[3],_[4]!==n?(c=(0,a.jsxs)("div",{className:r.default.TopRight,children:[n,o]}),_[4]=n,_[5]=c):c=_[5],_[6]!==m?(u=m&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(T,{}),(0,a.jsx)($,{}),(0,a.jsx)(P,{})]}),_[6]=m,_[7]=u):u=_[7],_[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,a.jsx)(q,{}),_[8]=i):i=_[8],_[9]!==c||_[10]!==u?(s=(0,a.jsxs)("div",{className:r.default.PlayerHUD,children:[e,c,u,i]}),_[9]=c,_[10]=u,_[11]=s):s=_[11],s}function K(e){return!!e.playback.streamSnapshot?.controlPlayerGhostId}e.s(["PlayerHUD",()=>L],49776)},60458,e=>{e.v(a=>Promise.all(["static/chunks/543f866d9a9c134b.css","static/chunks/450cc5a89761fca0.js"].map(a=>e.l(a))).then(()=>a(52728)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/63afa42c92661c50.js b/docs/_next/static/chunks/63afa42c92661c50.js deleted file mode 100644 index 96f62314..00000000 --- a/docs/_next/static/chunks/63afa42c92661c50.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function s(e,s){let n=t(e,s);if(null==n)return;let i=parseFloat(n);return Number.isFinite(i)?i:void 0}function n(e,s){let n=t(e,s);if(null==n)return;let i=parseInt(n,10);return Number.isFinite(i)?i:void 0}function i(e,t={x:0,y:0,z:0}){if(!e)return t;let s=e.split(" ").map(Number);return{x:s[0]??t.x,y:s[1]??t.y,z:s[2]??t.z}}function r(e,t={r:0,g:0,b:0}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b,a:s[3]??t.a}}function o(e,t){let s=i(e),n=(t??"1 0 0 0").split(" ").map(Number),r=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),c=Math.sqrt(r*r+a*a+o*o),u=0,m=0,d=1;c>1e-8&&(u=r/c,m=a/c,d=o/c);let h=Math.cos(l),p=Math.sin(l),g=1-h,y=Array(16).fill(0);return y[0]=g*u*u+h,y[1]=g*u*m+p*d,y[2]=g*u*d-p*m,y[4]=g*u*m-p*d,y[5]=g*m*m+h,y[6]=g*m*d+p*u,y[8]=g*u*d+p*m,y[9]=g*m*d-p*u,y[10]=g*d*d+h,y[12]=s.x,y[13]=s.y,y[14]=s.z,y[15]=1,{elements:y,position:s}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function c(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function u(e){let a=[];for(let s=1;s<=3;s++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),s=t[0]??0,n=t[1]??0,i=t[2]??0;return 0===s&&0===n&&0===i?null:{visibleDistance:s,minHeight:n,maxHeight:i,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${s}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let i=t(e,`cloudText${n+1}`)??"",r=s(e,`cloudHeightPer[${n}]`)??s(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=s(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:i,heightPercent:r,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:r(t(e,"fogColor")),visibleDistance:s(e,"visibleDistance")??1e3,fogDistance:s(e,"fogDistance")??0,skySolidColor:r(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:i(t(e,"windVelocity"))}}function m(e){return{className:"Sun",ghostIndex:e._id,direction:i(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function d(e){let n=t(e,"area"),i={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);i={x:e[0]??i.x,y:e[1]??i.y,w:e[2]??i.w,h:e[3]??i.h}}return{className:"MissionArea",ghostIndex:e._id,area:i,flightCeiling:s(e,"flightCeiling")??2e3,flightCeilingRange:s(e,"flightCeilingRange")??50}}function h(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:s(e,"surfaceOpacity")??.75,waveMagnitude:s(e,"waveMagnitude")??1,envMapIntensity:s(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>c,"missionAreaFromMis",()=>d,"skyFromMis",()=>u,"sunFromMis",()=>m,"terrainFromMis",()=>l,"waterBlockFromMis",()=>h])},70847,47566,63318,e=>{"use strict";let t=(0,e.i(25645).createLogger)("ghostToScene");function s(e,t={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:t}function n(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function i(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:s}=e,n=s.x*s.x,i=s.y*s.y,r=s.z*s.z,a=s.x*s.y,o=s.x*s.z,l=s.y*s.z,c=s.w*s.x,u=s.w*s.y,m=s.w*s.z;return{elements:[1-2*(i+r),2*(a+m),2*(o-u),0,2*(a-m),1-2*(n+r),2*(l+c),0,2*(o+u),2*(l-c),1-2*(n+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function a(e,a,o){let l;switch(e){case"TerrainBlock":return l={className:"TerrainBlock",ghostIndex:a,terrFileName:o.terrFileName??"",detailTextureName:o.detailTextureName??"",squareSize:o.squareSize??8,emptySquareRuns:o.emptySquareRuns},t.debug("TerrainBlock #%d: terrFileName=%s",a,l.terrFileName),l;case"InteriorInstance":return l={className:"InteriorInstance",ghostIndex:a,interiorFile:o.interiorFile??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),showTerrainInside:o.showTerrainInside??!1,skinBase:o.skinBase??"",alarmState:o.alarmState??!1},t.debug("InteriorInstance #%d: interiorFile=%s",a,l.interiorFile),l;case"TSStatic":return{className:"TSStatic",ghostIndex:a,shapeName:o.shapeName??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1})};case"Sky":{let e,i;e=Array.isArray(o.fogVolumes)?o.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:n(e.color)})):[],i=Array.isArray(o.cloudLayers)?o.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[];let r=l={className:"Sky",ghostIndex:a,materialList:o.materialList??"",fogColor:n(o.fogColor),visibleDistance:o.visibleDistance??1e3,fogDistance:o.fogDistance??0,skySolidColor:n(o.skySolidColor),useSkyTextures:o.useSkyTextures??!0,fogVolumes:e,cloudLayers:i,windVelocity:s(o.windVelocity)};return t.debug("Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s",a,r.materialList,r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,r.useSkyTextures),l}case"Sun":{let e=l={className:"Sun",ghostIndex:a,direction:s(o.direction,{x:.57735,y:.57735,z:-.57735}),color:i(o.color,{r:.7,g:.7,b:.7,a:1}),ambient:i(o.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(o.textures)?o.textures:void 0};return t.debug("Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",a,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),l}case"MissionArea":return{className:"MissionArea",ghostIndex:a,area:o.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:o.flightCeiling??2e3,flightCeilingRange:o.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:a,transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),surfaceName:o.surfaceName??"",envMapName:o.envMapName??"",surfaceOpacity:o.surfaceOpacity??.75,waveMagnitude:o.waveMagnitude??1,envMapIntensity:o.envMapIntensity??1};default:return null}}e.s(["ghostToSceneObject",()=>a],47566),e.i(9672);var o=e.i(90072);function l(e){return[e.y,e.z,e.x]}function c(e){return[e.y,e.z,e.x]}function u(e){let t=e.elements,s=new o.Matrix4,n=s.elements;n[0]=t[5],n[1]=t[6],n[2]=t[4],n[3]=0,n[4]=t[9],n[5]=t[10],n[6]=t[8],n[7]=0,n[8]=t[1],n[9]=t[2],n[10]=t[0],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1;let i=new o.Quaternion;return i.setFromRotationMatrix(s),i.conjugate(),i}e.s(["matrixFToQuaternion",()=>u,"torqueScaleToThree",()=>c,"torqueToThree",()=>l],63318),e.s([],70847)},92224,e=>{"use strict";e.i(932);var t=e.i(8155),s=e.i(66748),n=e.i(62395);let i=(0,t.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let s=new Map(e.missionEntities);return s.set(t.id,t),{missionEntities:s,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let s=new Map(e.missionEntities);return s.delete(t),{missionEntities:s,version:e.version+1}})},setEntities(t){e(e=>{let s=new Map(e.missionEntities);for(let e of t)s.set(e.id,e);return{missionEntities:s,version:e.version+1}})},setAllEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);return{missionEntities:s,dataSource:e.isStreaming?e.dataSource:"map"}})},clearEntities(){e(e=>0===e.missionEntities.size?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let s={};if(void 0!==t.missionName&&(s.missionName=t.missionName),void 0!==t.missionType&&(s.missionType=t.missionType),void 0!==t.missionTypeDisplayName&&(s.missionTypeDisplayName=t.missionTypeDisplayName),void 0!==t.missionDisplayName&&(s.missionDisplayName=t.missionDisplayName),void 0!==t.gameClassName&&(s.gameClassName=t.gameClassName,void 0===t.missionType))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,"");s.missionType=n.normalizedMissionTypes[e.toLowerCase()]??e}else s.missionType=null;void 0!==t.serverDisplayName&&(s.serverDisplayName=t.serverDisplayName),void 0!==t.recorderName&&(s.recorderName=t.recorderName),void 0!==t.recordingDate&&(s.recordingDate=t.recordingDate),e(e=>({...s,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?"map":null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let s=new Map(e.streamEntities);return s.set(t.id,t),{streamEntities:s,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let s=new Map(e.streamEntities);return s.delete(t),{streamEntities:s,version:e.version+1}})},setStreamEntities(t){e(e=>{let s=new Map(e.streamEntities);for(let e of t)s.set(e.id,e);return{streamEntities:s,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);let n=e.streamEntities;return s.size===n.size&&[...s.keys()].every(e=>n.has(e))?e:{streamEntities:s,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function r(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,s=[];for(let e of t.values())"None"!==e.renderType&&s.push(e);return s}function a(e,t){if(e.length!==t.length)return!1;for(let s=0;so,"useDataSource",()=>d,"useMissionDisplayName",()=>k,"useMissionName",()=>p,"useMissionType",()=>y,"useMissionTypeDisplayName",()=>v,"useRecorderName",()=>N,"useRecordingDate",()=>x,"useSceneSky",()=>u,"useSceneSun",()=>m,"useServerDisplayName",()=>b])},98755,e=>{"use strict";e.i(47167);var t=e.i(8155),s=e.i(66748),n=e.i(25645);let i=(0,n.createLogger)("relayClient");class r{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{i.info("WebSocket connected to %s",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){i.error("Failed to parse relay message: %o",e)}},this.ws.onclose=()=>{i.info("WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{i.error("WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){i.info("Joining server: %s",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,s){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:s})}sendCRCCompute(e,t,s,n){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:n,datablocks:s})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMove(e){this.send({type:"sendMove",move:e})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):i.warn("send dropped (ws not open): %s",e.type)}}e.i(91891);var a=e.i(94802),o=e.i(89119),l=e.i(10244);let c=(0,n.createLogger)("liveStreaming");class u extends l.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:s,packetParser:n}=(0,a.createLiveParser)();this.packetParser=n,this.ghostTracker=s,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,s=e.sequences;t&&s&&this._shapeConstructorCache.set(t.toLowerCase(),s)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,s]of t){let n=s.explosion;if(null==n)continue;let i=t.get(n);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly",this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let s=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(s)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);c.info("auth event: %s %o",s,t),this.relay.sendAuthEvent(s,t);return}let n=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 1, seq=%s mission=%s resolvedArgs=%o",e,t,n),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===s){let e=n[0]??"";c.info("mission phase 2 (datablocks), seq=%s",e),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 3 (ghosting), seq=%s mission=%s",e,t),t&&(this.missionName=t),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,s=e.field1,n=e.field2,i=(1&s)!=0;c.info("CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s",(t>>>0).toString(16),(s>>>0).toString(16),(n>>>0).toString(16),i);let r=this.packetParser.getDataBlockDataMap(),a=[];if(r)for(let[e,t]of r){let s=this.dataBlockClassNames.get(e);if(!s)continue;let n=(0,o.resolveShapeName)(s,t);a.push({objectId:e,className:s,shapeName:n??""})}c.info("CRC: sending %d datablocks for computation",a.length),this.relay.sendCRCCompute(t,n,a,i)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,s=e.sequence,n=e.ghostCount;c.info("GhostingMessageEvent: message=%d sequence=%d ghostCount=%d",t,s,n),0===t&&(c.info("Sending ghost ack (type 1) for sequence %d",s),this.relay.sendGhostAck(s,n))}observerMode="fly";cycleObserveNext(){"fly"===this.observerMode?(c.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(c.info("observer: cycle next (fire trigger)"),this.sendTrigger(0))}toggleObserverMode(){"fly"===this.observerMode?(c.info("observer: fly → follow (jump trigger)"),this.sendTrigger(2),this.observerMode="follow"):(c.info("observer: follow → fly (jump trigger)"),this.sendTrigger(2),this.observerMode="fly")}sendTrigger(e){let t=[!1,!1,!1,!1,!1,!1];t[e]=!0,this.relay.sendMove({x:0,y:0,z:0,yaw:0,pitch:0,roll:0,trigger:t,freeLook:!1})}getPlayerList(){let e=[];for(let[t,s]of this.targetNames){let n=this.targetTeams.get(t)??0;e.push({targetId:t,name:s,sensorGroup:n})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,s=this.packetParser.protocolNoDispatch,n=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,r=this.packetParser.protocolNoDispatch>s;(i||r)&&c.warn("packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)",this.tickCount,i?"REJECTED":"no-dispatch",e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let a=this.tickCount<20,l=this.tickCount%100==0,u=a||l;for(let t of(u&&c.debug("packet #%d: %d events, %d ghosts, %d bytes%s%s",this.tickCount,n.events.length,n.ghosts.length,e.length,void 0!==n.gameState.controlObjectGhostIndex?`, control=${n.gameState.controlObjectGhostIndex}`:"",void 0!==n.gameState.cameraFov?`, fov=${n.gameState.cameraFov}`:""),this.processControlObject(n.gameState),n.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");c.debug("remote: %s",e)}if(a&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&c.debug("event: %s%s",e,"SimDataBlockEvent"===e?` id=${t.parsedData.objectId} class=${t.parsedData.dataBlockClassName}`:""),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,s=t.parsedData.dataBlockClassName;if(null!=e&&s&&this.dataBlockClassNames.set(e,s),u){let n=t.parsedData.dataBlockData,i=(0,o.resolveShapeName)(s??"",n);c.debug("datablock: id=%d class=%s%s",e,s??"?",i?` shape=${i}`:"")}}let s=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,s),a&&"NetStringEvent"===e){let e=t.parsedData.id,s=t.parsedData.value;null!=e&&"string"==typeof s&&c.trace('netString #%d = "%s"',e,s.length>60?s.slice(0,60)+"…":s)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,s=t.parsedData.nameTag;if(null!=e&&null!=s){let n=this.netStrings.get(s);if(n){let s=(0,o.stripTaggedStringMarkup)(n);c.info('target #%d: "%s" team=%s',e,s,t.parsedData.sensorGroup??"?")}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&c.info("sensor group changed: → %d",e)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,s=t.parsedData.colors;s&&c.debug("sensor group colors: group=%d, %d entries",e,s.length)}}for(let e of n.ghosts){if("create"===e.type){let t=e.parsedData?.position,s=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,n=this.resolveGhostClassName(e.index,e.classId);c.debug("ghost create: #%d %s%s (%d entities total)",e.index,n??"?",s?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"",this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),s=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&c.debug("ghost delete: #%d %s (%d entities remaining)",e.index,s?.className??"?",this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),l&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();c.info("status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d",this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let m=this.entities.size;if(1===this.tickCount||m>0&&m%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");c.info("entity count: %d (%s)",m,t)}let d=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==d&&c.info("camera mode: %s → %s%s",d??"none",this.camera.mode,"third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:""),this.tickCount<=5&&this.camera){let[e,t,s]=this.camera.position;c.debug("camera: mode=%s pos=(%s, %s, %s) fov=%s",this.camera.mode,e.toFixed(1),t.toFixed(1),s.toFixed(1),this.camera.fov)}}catch(s){let t={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};c.error("Failed to process live packet: %o %o",s,t)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:s,audioEvents:n}=this.buildTimeFilteredEvents(t),{weaponsHud:i,inventoryHud:r,backpackHud:a,teamScores:o}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:s,audioEvents:n,weaponsHud:i,backpackHud:a,inventoryHud:r,teamScores:o};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}var m=e.i(92224);let d=(0,n.createLogger)("liveConnectionStore"),h="wss://t2-relay.fly.dev",p=(0,t.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(s=h){let n=t();n._relay&&n._relay.close();let i=new r(s,{onOpen(){e({relayConnected:!0});let s=t();for(let e of s._pending)e();s._pending=[]},onStatus(t,s,n,i){d.info("game status: %s%s%s",t,s?` — ${s}`:"",i?` map=${i}`:""),e({gameStatus:t,gameStatusMessage:s,...i?{mapName:i}:{}})},onServerList(s){t()._listInFlight=!1,e({servers:s,serversLoading:!1})},onGamePacket(e){let s=t()._adapter;s||d.warn("received game packet but no adapter is active"),s?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(s){d.error("error: %s",s),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let s=t();s._relay===i&&(s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let s=t();s._relay?.close(),s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let s=t();if(s._listInFlight)return;s._listInFlight=!0;let n=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),s._relay?.connected?n():(s._pending.push(n),s._relay||t().connectRelay())},joinServer(s,n){let i=t();if(!i._relay)return;let r=i.servers.find(e=>e.address===s),a=new u(i._relay);a.onReady=()=>e({liveReady:!0}),a.onMissionChange=t=>{d.info("mission changed: %s",t),e({mapName:t,liveReady:!1}),m.gameEntityStore.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},a.onMissionInfoChange=()=>{m.gameEntityStore.getState().setMissionInfo({missionDisplayName:a.missionDisplayName??void 0,missionTypeDisplayName:a.missionTypeDisplayName??void 0,gameClassName:a.gameClassName??void 0,serverDisplayName:a.serverDisplayName??void 0,recorderName:a.connectedPlayerName??void 0})},i._adapter=a,e({mapName:r?.mapName??i.mapName,serverName:r?.name,warriorName:n,liveReady:!1,gameStatus:null,adapter:a}),m.gameEntityStore.getState().setMissionInfo({missionName:r?.mapName??void 0,missionTypeDisplayName:r?.gameType??void 0,serverDisplayName:r?.name??void 0,recorderName:n??void 0}),i._relay.joinServer(s,n)},disconnectServer(){let s=t();s._relay?.disconnectServer(),s._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMove(e){t()._relay?.sendMove(e)},sendCommand(e,...s){t()._relay?.sendCommand(e,s)}}));function g(e,t){return(0,s.useStoreWithEqualityFn)(p,e,t)}function y(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}e.s(["liveConnectionStore",0,p,"selectPing",()=>y,"useLiveSelector",()=>g],98755)},66027,e=>{"use strict";var t=e.i(69230),s=e.i(69637);function n(e,n){return(0,s.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},66093,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,n.createContext)(null);function r(){let e=(0,n.useContext)(i);if(!e)throw Error("No JoystickContext found. Did you forget to add a ?");return e}function a(e){let r,a,o,l,c,u,m=(0,s.c)(7),{children:d}=e;m[0]===Symbol.for("react.memo_cache_sentinel")?(r={angle:0,force:0},m[0]=r):r=m[0];let h=(0,n.useRef)(r);m[1]===Symbol.for("react.memo_cache_sentinel")?(a={angle:0,force:0},m[1]=a):a=m[1];let p=(0,n.useRef)(a);m[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{angle:t,force:s}=e;null!=t&&(h.current.angle=t),null!=s&&(h.current.force=s)},m[2]=o):o=m[2];let g=o;m[3]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let{angle:t,force:s}=e;null!=t&&(p.current.angle=t),null!=s&&(p.current.force=s)},m[3]=l):l=m[3];let y=l;m[4]===Symbol.for("react.memo_cache_sentinel")?(c={moveState:h,lookState:p,setMoveState:g,setLookState:y},m[4]=c):c=m[4];let f=c;return m[5]!==d?(u=(0,t.jsx)(i,{value:f,children:d}),m[5]=d,m[6]=u):u=m[6],u}e.s(["JoystickProvider",()=>a,"useJoystick",()=>r])},32865,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(58647);function i(e){let n,i=(0,s.c)(2),{children:r}=e;return i[0]!==r?(n=(0,t.jsx)(t.Fragment,{children:r}),i[0]=r,i[1]=n):n=i[1],n}function r(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function c(){return(0,n.useEngineSelector)(u)}function u(e){return e.playback.timeMs/1e3}function m(){return(0,n.useEngineSelector)(d)}function d(e){return e.playback.durationMs/1e3}function h(){return(0,n.useEngineSelector)(p)}function p(e){return e.playback.rate}function g(){let e,t,i,a,o,l,c=(0,s.c)(17),u=r(),m=(0,n.useEngineSelector)(S),d=(0,n.useEngineSelector)(v),h=(0,n.useEngineSelector)(f),p=(0,n.useEngineSelector)(y);c[0]!==m?(e=e=>{m(e)},c[0]=m,c[1]=e):e=c[1];let g=e;c[2]!==u||c[3]!==d?(t=()=>{u&&d("playing")},c[2]=u,c[3]=d,c[4]=t):t=c[4];let k=t;c[5]!==d?(i=()=>{d("paused")},c[5]=d,c[6]=i):i=c[6];let E=i;c[7]!==h?(a=e=>{h(1e3*e)},c[7]=h,c[8]=a):a=c[8];let b=a;c[9]!==p?(o=e=>{p(e)},c[9]=p,c[10]=o):o=c[10];let C=o;return c[11]!==E||c[12]!==k||c[13]!==b||c[14]!==g||c[15]!==C?(l={setRecording:g,play:k,pause:E,seek:b,setSpeed:C},c[11]=E,c[12]=k,c[13]=b,c[14]=g,c[15]=C,c[16]=l):l=c[16],l}function y(e){return e.setPlaybackRate}function f(e){return e.setPlaybackTime}function v(e){return e.setPlaybackStatus}function S(e){return e.setRecording}e.s(["RecordingProvider",()=>i,"useCurrentTime",()=>c,"useDuration",()=>m,"useIsPlaying",()=>o,"usePlaybackActions",()=>g,"useRecording",()=>r,"useSpeed",()=>h])},51434,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645),i=e.i(15080),r=e.i(90072),a=e.i(58647),o=e.i(79123);let l=(0,n.createContext)(void 0);function c(e){let c,h,p,g,y,f,v=(0,s.c)(11),{children:S}=e,k=(0,i.useThree)(d),{audioVolume:E}=(0,o.useSettings)();v[0]===Symbol.for("react.memo_cache_sentinel")?(c={audioLoader:null,audioListener:null},v[0]=c):c=v[0];let[b,C]=(0,n.useState)(c);return v[1]!==k?(h=()=>{let e=new r.AudioLoader,t=k.children.find(m);t||(t=new r.AudioListener,k.add(t)),C({audioLoader:e,audioListener:t});let s=()=>{let e=t.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s)})};document.addEventListener("click",s),document.addEventListener("keydown",s),document.addEventListener("touchend",s);let n=a.engineStore.subscribe(u,e=>{let s=t.context;s&&("paused"===e?s.suspend():"suspended"===s.state&&s.resume())});return()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s),n(),t&&k.remove(t)}},p=[k],v[1]=k,v[2]=h,v[3]=p):(h=v[2],p=v[3]),(0,n.useEffect)(h,p),v[4]!==b.audioListener||v[5]!==E?(g=()=>{b.audioListener?.setMasterVolume(E)},y=[E,b.audioListener],v[4]=b.audioListener,v[5]=E,v[6]=g,v[7]=y):(g=v[6],y=v[7]),(0,n.useEffect)(g,y),v[8]!==b||v[9]!==S?(f=(0,t.jsx)(l.Provider,{value:b,children:S}),v[8]=b,v[9]=S,v[10]=f):f=v[10],f}function u(e){return e.playback.status}function m(e){return e instanceof r.AudioListener}function d(e){return e.camera}function h(){let e=(0,n.useContext)(l);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>c,"useAudio",()=>h])},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function s(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>s,"streamPlaybackStore",0,t])},46325,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,e.i(25645).createLogger)("DebugSuspense");function r(e){let i,r,l,c=(0,s.c)(10),{name:u,fallback:m,children:d}=e,h=void 0===m?null:m;return c[0]!==h||c[1]!==u?(i=(0,t.jsx)(a,{name:u,children:h}),c[0]=h,c[1]=u,c[2]=i):i=c[2],c[3]!==u?(r=(0,t.jsx)(o,{name:u}),c[3]=u,c[4]=r):r=c[4],c[5]!==d||c[6]!==u||c[7]!==i||c[8]!==r?(l=(0,t.jsxs)(n.Suspense,{name:u,fallback:i,children:[r,d]}),c[5]=d,c[6]=u,c[7]=i,c[8]=r,c[9]=l):l=c[9],l}function a(e){let t,r,a=(0,s.c)(3),{name:o,children:l}=e;return a[0]!==o?(t=()=>{i.debug("🛑 SUSPENDED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),l}function o(e){let t,r,a=(0,s.c)(3),{name:o}=e;return a[0]!==o?(t=()=>{i.debug("✅ RESOLVED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),null}e.s(["DebugSuspense",()=>r])},31999,e=>{"use strict";var t=e.i(71645);let s=(0,e.i(25645).createLogger)("ShapeErrorBoundary");class n extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){s.error("Shape load failed: %s %s",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["ShapeErrorBoundary",()=>n])},77964,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.s(["isSceneEntity",()=>t])},12631,e=>{"use strict";var t=e.i(71645),s=e.i(8155);let n=e=>{let n=(0,s.createStore)(e),i=e=>(function(e,s=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};var i=e.i(79473);let r=t.createContext(null);function a({map:e,children:s,onChange:a,domElement:o}){let l=e.map(e=>e.name+e.keys).join("-"),c=t.useMemo(()=>{let t;return(t=(0,i.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?n(t):n},[l]),u=t.useMemo(()=>[c.subscribe,c.getState,c],[l]),m=c.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:s})=>({keys:t,up:s,fn:t=>{m({[e]:t}),a&&a(e,t,u[1]())}})).reduce((e,{keys:t,fn:s,up:n=!0})=>(t.forEach(t=>e[t]={fn:s,pressed:!1,up:n}),e),{}),s=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,pressed:r,up:a}=n;n.pressed=!0,(a||!r)&&i(!0)},n=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,up:r}=n;n.pressed=!1,r&&i(!1)},i=o||window;return i.addEventListener("keydown",s,{passive:!0}),i.addEventListener("keyup",n,{passive:!0}),()=>{i.removeEventListener("keydown",s),i.removeEventListener("keyup",n)}},[o,l]),t.createElement(r.Provider,{value:u,children:s})}function o(e){let[s,n,i]=t.useContext(r);return e?i(e):[s,n]}e.s(["KeyboardControls",()=>a,"useKeyboardControls",()=>o],12631)},85413,e=>{"use strict";var t=Object.defineProperty;class s{constructor(){((e,s,n)=>{let i,r;r=void 0,(i="symbol"!=typeof s?s+"":s)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[i]=r})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let s=this._listeners;void 0===s[e]&&(s[e]=[]),-1===s[e].indexOf(t)&&s[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let s=this._listeners;return void 0!==s[e]&&-1!==s[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let s=this._listeners[e];if(void 0!==s){let e=s.indexOf(t);-1!==e&&s.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let s=t.slice(0);for(let t=0,n=s.length;ts])},68294,e=>{"use strict";var t=e.i(43476),s=e.i(90072),n=e.i(15080),i=e.i(71645);let r=(0,i.createContext)(null);function a(){let e=(0,i.useContext)(r);if(!e)throw Error("useCameras must be used within CamerasProvider");return e}function o({children:e}){let a=(0,n.useThree)(e=>e.camera),[o,l]=(0,i.useState)(-1),[c,u]=(0,i.useState)({}),[m,d]=(0,i.useState)(()=>({initialized:!1,position:null,quarternion:null})),h=(0,i.useCallback)(e=>{u(t=>({...t,[e.id]:e}))},[]),p=(0,i.useCallback)(e=>{u(t=>{let{[e.id]:s,...n}=t;return n})},[]),g=Object.keys(c).length,y=(0,i.useCallback)(e=>{if(e>=0&&e{y(g?(o+1)%g:-1)},[g,o,y]);(0,i.useEffect)(()=>{let e=()=>{let e=window.location.hash;if(e.startsWith("#c")){let[t,n]=e.slice(2).split("~"),i=t.split(",").map(e=>parseFloat(e)),r=n.split(",").map(e=>parseFloat(e));d({initialized:!0,position:new s.Vector3(...i),quarternion:new s.Quaternion(...r)})}else d({initialized:!0,position:null,quarternion:null})};return window.addEventListener("hashchange",e),e(),()=>{window.removeEventListener("hashchange",e)}},[]),(0,i.useEffect)(()=>{m.initialized&&m.position&&(a.position.copy(m.position),m.quarternion&&a.quaternion.copy(m.quarternion))},[a,m]),(0,i.useEffect)(()=>{m.initialized&&!m.position&&g>0&&-1===o&&y(0)},[g,y,o,m]);let v=(0,i.useMemo)(()=>({registerCamera:h,unregisterCamera:p,nextCamera:f,setCameraIndex:y,cameraCount:g}),[h,p,f,y,g]);return 0===g&&-1!==o&&l(-1),(0,t.jsx)(r.Provider,{value:v,children:e})}e.s(["CamerasProvider",()=>o,"useCameras",()=>a])},26747,e=>{"use strict";var t=e.i(90072),s=e.i(85413),n=Object.defineProperty,i=(e,t,s)=>{let i;return(i="symbol"!=typeof t?t+"":t)in e?n(e,i,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[i]=s,s};let r=new t.Euler(0,0,0,"YXZ"),a=new t.Vector3,o={type:"change"},l={type:"lock"},c={type:"unlock"},u=Math.PI/2;class m extends s.EventDispatcher{constructor(e,s){super(),i(this,"camera"),i(this,"domElement"),i(this,"isLocked"),i(this,"minPolarAngle"),i(this,"maxPolarAngle"),i(this,"pointerSpeed"),i(this,"onMouseMove",e=>{this.domElement&&!1!==this.isLocked&&(r.setFromQuaternion(this.camera.quaternion),r.y-=.002*e.movementX*this.pointerSpeed,r.x-=.002*e.movementY*this.pointerSpeed,r.x=Math.max(u-this.maxPolarAngle,Math.min(u-this.minPolarAngle,r.x)),this.camera.quaternion.setFromEuler(r),this.dispatchEvent(o))}),i(this,"onPointerlockChange",()=>{this.domElement&&(this.domElement.ownerDocument.pointerLockElement===this.domElement?(this.dispatchEvent(l),this.isLocked=!0):(this.dispatchEvent(c),this.isLocked=!1))}),i(this,"onPointerlockError",()=>{console.error("THREE.PointerLockControls: Unable to use Pointer Lock API")}),i(this,"connect",e=>{this.domElement=e||this.domElement,this.domElement&&(this.domElement.ownerDocument.addEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.addEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.addEventListener("pointerlockerror",this.onPointerlockError))}),i(this,"disconnect",()=>{this.domElement&&(this.domElement.ownerDocument.removeEventListener("mousemove",this.onMouseMove),this.domElement.ownerDocument.removeEventListener("pointerlockchange",this.onPointerlockChange),this.domElement.ownerDocument.removeEventListener("pointerlockerror",this.onPointerlockError))}),i(this,"dispose",()=>{this.disconnect()}),i(this,"getObject",()=>this.camera),i(this,"direction",new t.Vector3(0,0,-1)),i(this,"getDirection",e=>e.copy(this.direction).applyQuaternion(this.camera.quaternion)),i(this,"moveForward",e=>{a.setFromMatrixColumn(this.camera.matrix,0),a.crossVectors(this.camera.up,a),this.camera.position.addScaledVector(a,e)}),i(this,"moveRight",e=>{a.setFromMatrixColumn(this.camera.matrix,0),this.camera.position.addScaledVector(a,e)}),i(this,"lock",()=>{this.domElement&&this.domElement.requestPointerLock()}),i(this,"unlock",()=>{this.domElement&&this.domElement.ownerDocument.exitPointerLock()}),this.camera=e,this.domElement=s,this.isLocked=!1,this.minPolarAngle=0,this.maxPolarAngle=Math.PI,this.pointerSpeed=1,s&&this.connect(s)}}e.s(["PointerLockControls",()=>m])},205,e=>{"use strict";var t=e.i(932),s=e.i(71645),n=e.i(90072),i=e.i(71753),r=e.i(15080),a=e.i(12631),o=e.i(26747),l=e.i(79123),c=e.i(68294),u=e.i(93784);let m=Math.PI/2-.01;function d(){let e,d,y,f,v,S,k,E,b,C,N,w,x,D,P,M,T=(0,t.c)(38);T[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],T[0]=e):e=T[0],(0,s.useEffect)(g,e);let{speedMultiplier:_,setSpeedMultiplier:L,invertScroll:F,invertDrag:I}=(0,l.useControls)(),[R,j]=(0,a.useKeyboardControls)(),A=(0,r.useThree)(p),q=(0,r.useThree)(h),{nextCamera:z,setCameraIndex:W,cameraCount:B}=(0,c.useCameras)(),G=(0,s.useRef)(null);T[1]!==F?(d=()=>F,T[1]=F,T[2]=d):d=T[2];let O=(0,s.useEffectEvent)(d);T[3]!==I?(y=()=>I,T[3]=I,T[4]=y):y=T[4];let V=(0,s.useEffectEvent)(y);T[5]===Symbol.for("react.memo_cache_sentinel")?(f=new n.Vector3,T[5]=f):f=T[5];let $=(0,s.useRef)(f);T[6]===Symbol.for("react.memo_cache_sentinel")?(v=new n.Vector3,T[6]=v):v=T[6];let K=(0,s.useRef)(v);T[7]===Symbol.for("react.memo_cache_sentinel")?(S=new n.Vector3,T[7]=S):S=T[7];let Y=(0,s.useRef)(S);T[8]===Symbol.for("react.memo_cache_sentinel")?(k=new n.Euler(0,0,0,"YXZ"),T[8]=k):k=T[8];let H=(0,s.useRef)(k);return T[9]!==A||T[10]!==q.domElement?(E=()=>{let e=new o.PointerLockControls(A,q.domElement);return G.current=e,()=>{e.dispose()}},b=[A,q.domElement],T[9]=A,T[10]=q.domElement,T[11]=E,T[12]=b):(E=T[11],b=T[12]),(0,s.useEffect)(E,b),T[13]!==A||T[14]!==V||T[15]!==q.domElement||T[16]!==z?(C=()=>{let e=q.domElement,t=new n.Euler(0,0,0,"YXZ"),s=!1,i=!1,r=0,a=0,o=t=>{G.current?.isLocked||t.target===e&&(s=!0,i=!1,r=t.clientX,a=t.clientY)},l=e=>{if(!s||!i&&3>Math.abs(e.clientX-r)&&3>Math.abs(e.clientY-a))return;i=!0;let n=V()?-1:1;t.setFromQuaternion(A.quaternion,"YXZ"),t.y=t.y+n*e.movementX*.003,t.x=t.x+n*e.movementY*.003,t.x=Math.max(-m,Math.min(m,t.x)),A.quaternion.setFromEuler(t)},c=()=>{s=!1},u=t=>{let s=G.current;!s||s.isLocked?z():t.target!==e||i||s.lock()};return e.addEventListener("mousedown",o),document.addEventListener("mousemove",l),document.addEventListener("mouseup",c),document.addEventListener("click",u),()=>{e.removeEventListener("mousedown",o),document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",c),document.removeEventListener("click",u)}},T[13]=A,T[14]=V,T[15]=q.domElement,T[16]=z,T[17]=C):C=T[17],T[18]!==A||T[19]!==q.domElement||T[20]!==z?(N=[A,q.domElement,z],T[18]=A,T[19]=q.domElement,T[20]=z,T[21]=N):N=T[21],(0,s.useEffect)(C,N),T[22]!==B||T[23]!==W||T[24]!==R?(w=()=>{let e=["camera1","camera2","camera3","camera4","camera5","camera6","camera7","camera8","camera9"];return R(t=>{for(let s=0;s{let e=e=>{e.preventDefault();let t=O()?-1:1,s=(e.deltaY>0?-1:1)*t,n=Math.max(.05,Math.min(.5,Math.abs(.01*e.deltaY)))*s;L(e=>Math.max(.1,Math.min(5,Math.round((e+n)*20)/20)))},t=q.domElement;return t.addEventListener("wheel",e,{passive:!1}),()=>{t.removeEventListener("wheel",e)}},T[27]=O,T[28]=q.domElement,T[29]=L,T[30]=D):D=T[30],T[31]!==q.domElement||T[32]!==L?(P=[q.domElement,L],T[31]=q.domElement,T[32]=L,T[33]=P):P=T[33],(0,s.useEffect)(D,P),T[34]!==A||T[35]!==j||T[36]!==_?(M=(e,t)=>{let s=u.streamPlaybackStore.getState();if(s.playback&&!s.freeFlyCamera)return;let{forward:n,backward:i,left:r,right:a,up:o,down:l,lookUp:c,lookDown:d,lookLeft:h,lookRight:p}=j();if((c||d||h||p)&&(H.current.setFromQuaternion(A.quaternion,"YXZ"),h&&(H.current.y=H.current.y+ +t),p&&(H.current.y=H.current.y-t),c&&(H.current.x=H.current.x+ +t),d&&(H.current.x=H.current.x-t),H.current.x=Math.max(-m,Math.min(m,H.current.x)),A.quaternion.setFromEuler(H.current)),!n&&!i&&!r&&!a&&!o&&!l)return;let g=80*_;A.getWorldDirection($.current),$.current.normalize(),K.current.crossVectors(A.up,$.current).normalize(),Y.current.set(0,0,0),n&&Y.current.add($.current),i&&Y.current.sub($.current),r&&Y.current.add(K.current),a&&Y.current.sub(K.current),o&&(Y.current.y=Y.current.y+1),l&&(Y.current.y=Y.current.y-1),Y.current.lengthSq()>0&&(Y.current.normalize().multiplyScalar(g*t),A.position.add(Y.current))},T[34]=A,T[35]=j,T[36]=_,T[37]=M):M=T[37],(0,i.useFrame)(M),null}function h(e){return e.gl}function p(e){return e.camera}function g(){return window.addEventListener("keydown",y,{capture:!0}),window.addEventListener("keyup",y,{capture:!0}),()=>{window.removeEventListener("keydown",y,{capture:!0}),window.removeEventListener("keyup",y,{capture:!0})}}function y(e){(e.metaKey||e.ctrlKey)&&"k"===e.key||e.metaKey&&e.stopImmediatePropagation()}e.s(["ARROW_LOOK_SPEED",0,1,"KEYBOARD_CONTROLS",0,[{name:"forward",keys:["KeyW"]},{name:"backward",keys:["KeyS"]},{name:"left",keys:["KeyA"]},{name:"right",keys:["KeyD"]},{name:"up",keys:["Space"]},{name:"down",keys:["ShiftLeft","ShiftRight"]},{name:"lookUp",keys:["ArrowUp"]},{name:"lookDown",keys:["ArrowDown"]},{name:"lookLeft",keys:["ArrowLeft"]},{name:"lookRight",keys:["ArrowRight"]},{name:"camera1",keys:["Digit1"]},{name:"camera2",keys:["Digit2"]},{name:"camera3",keys:["Digit3"]},{name:"camera4",keys:["Digit4"]},{name:"camera5",keys:["Digit5"]},{name:"camera6",keys:["Digit6"]},{name:"camera7",keys:["Digit7"]},{name:"camera8",keys:["Digit8"]},{name:"camera9",keys:["Digit9"]}],"KeyboardAndMouseHandler",()=>d,"MOUSE_SENSITIVITY",0,.003])},60946,e=>{e.v(t=>Promise.all(["static/chunks/48d0203d138a3e57.js"].map(t=>e.l(t))).then(()=>t(0)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/41fb9d5ac0e14608.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/c5f946098461b297.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/6c0bdfaab43cc40b.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/2c772d15a5a10e4d.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/538e72dc81951677.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/2070573ac43e863c.js"].map(t=>e.l(t))).then(()=>t(42585)))},34019,e=>{e.v(t=>Promise.all(["static/chunks/341165a5ae0d70ac.js"].map(t=>e.l(t))).then(()=>t(66069)))},553,e=>{e.v(t=>Promise.all(["static/chunks/66f953934e42712b.css","static/chunks/e27b13e203064a85.js"].map(t=>e.l(t))).then(()=>t(18339)))},33487,e=>{e.v(t=>Promise.all(["static/chunks/9ffe862a9787606f.css","static/chunks/302e494fb721f5e6.js"].map(t=>e.l(t))).then(()=>t(40378)))},25483,e=>{e.v(t=>Promise.all(["static/chunks/41fb9d5ac0e14608.js","static/chunks/e5d92d4ce07851d8.js"].map(t=>e.l(t))).then(()=>t(51295)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/1db3a9d62713e989.css","static/chunks/3770acf7d1a6ba0a.js"].map(t=>e.l(t))).then(()=>t(94737)))},88487,e=>{e.v(t=>Promise.all(["static/chunks/005e475439c5cb3e.js","static/chunks/309d84bbb5b2092f.css"].map(t=>e.l(t))).then(()=>t(86855)))},21683,e=>{e.v(t=>Promise.all(["static/chunks/4c292ca57f1d49be.js"].map(t=>e.l(t))).then(()=>t(91285)))},96145,e=>{e.v(t=>Promise.all(["static/chunks/1cf57947857f8eec.js"].map(t=>e.l(t))).then(()=>t(60505)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/fd10b9633e3b5488.js"].map(t=>e.l(t))).then(()=>t(9962)))},57567,e=>{e.v(t=>Promise.all(["static/chunks/28c98fb093e4695f.css","static/chunks/22c22371d5c1dcba.js"].map(t=>e.l(t))).then(()=>t(49776)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/7317a925124598e3.css","static/chunks/7aec7c45fab908e2.js"].map(t=>e.l(t))).then(()=>t(94247)))},70012,e=>{e.v(t=>Promise.all(["static/chunks/7317a925124598e3.css","static/chunks/0070446447a9983b.js"].map(t=>e.l(t))).then(()=>t(45554)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/7aec7c45fab908e2.js b/docs/_next/static/chunks/7aec7c45fab908e2.js deleted file mode 100644 index a2aea06a..00000000 --- a/docs/_next/static/chunks/7aec7c45fab908e2.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Actions:"GameDialog-module__C6hZDW__Actions",Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(81847).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog "+e.i(81847).Dialog,Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay "+e.i(81847).Overlay,PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),o=e.i(11152),i=e.i(66027),n=e.i(12979),r=e.i(91996),s=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,o=(0,a.c)(5),{name:i}=e;o[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,n.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),o[0]=i,o[1]=l):l=o[1];let u=l;if(u){let e;return o[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:s.default.Bitmap}),o[2]=u,o[3]=e):e=o[3],e}if(/bullet/i.test(i)){let e;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:s.default.Bullet,children:"•"}),o[4]=e):e=o[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let o,i,n=(0,a.c)(4),{markup:r}=e;n[0]!==r?(o=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),o={type:"span",source:"root",style:{},children:[]},i=o,n=[i],r=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||r(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,n.push(i);break}case"spop":if("root"!==i.source){let e=n.pop();for(;"spush"!==e.source;)e=n.pop();i=n[n.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(r(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,n.push(i)}else i.style.fontSize=t;break}case"color":if(r(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,n.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,n.push(i);break}case"/a":{let e=n.pop();for(;"a"!==e.source;)e=n.pop();i=n[n.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(o)}(r),n[0]=r,n[1]=o):o=n[1];let c=o;return n[2]!==c?(i=(0,t.jsx)("div",{className:s.default.GuiMarkup,children:c}),n[2]=c,n[3]=i):i=n[3],i}var f=e.i(41973);function _(e){let o,i,n,r=(0,a.c)(7),{src:s,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(r[0]!==s?(o=()=>{let e,t=!1;return fetch(s).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(h),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[s],r[0]=s,r[1]=o,r[2]=i):(o=r[1],i=r[2]),(0,l.useEffect)(o,i),p)?(r[3]!==u||r[4]!==m||r[5]!==p?(n=(0,t.jsx)("img",{src:p,alt:u,className:m}),r[3]=u,r[4]=m,r[5]=p,r[6]=n):n=r[6],n):null}function h(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,r,s,u,c,m,p,d,_,h,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let D=`${n.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>()=>{k.current?.pause()},s=[],y[2]=r,y[3]=s):(r=y[2],s=y[3]),(0,l.useEffect)(r,s),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==D?(d=(0,t.jsx)("audio",{ref:k,src:D,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=D,y[10]=d):d=y[10],y[11]!==M?(_=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=_):_=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(h=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(o.FaVolumeUp,{}):(0,t.jsx)(o.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=h):h=y[16],y[17]!==v||y[18]!==h||y[19]!==d||y[20]!==_?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,_,h]}),y[17]=v,y[18]=h,y[19]=d,y[20]=_,y[21]=g):g=y[21],g}function x(e){var o,s,u;let c,m,h,g,y,M,x,D,w,I,N,B,S,C,P,L,T,X,E,O,R,U,F,G,$,K,Q,q,W,Z,A,z,H,V,J,Y,ee,et=(0,a.c)(100),{onClose:ea,missionName:el,missionType:eo}=e,{data:ei}=((ee=(0,a.c)(2))[0]!==el?(Y={queryKey:["parsedMission",el],queryFn:()=>(0,n.loadMission)(el)},ee[0]=el,ee[1]=Y):Y=ee[1],(0,i.useQuery)(Y)),en=(0,l.useRef)(null);et[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},m=[],et[0]=c,et[1]=m):(c=et[0],m=et[1]),(0,l.useEffect)(c,m),et[2]!==ea?(h=()=>{let e=e=>{if("Escape"===e.key)ea();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void ea();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea],et[2]=ea,et[3]=h,et[4]=g):(h=et[3],g=et[4]),(0,l.useEffect)(h,g),et[5]!==ei?(y=ei?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(ei.ast):{},et[5]=ei,et[6]=y):y=et[6];let er=y;et[7]!==el||et[8]!==ei?(M=ei?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,n.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,n.getUrlForPath)(e)}catch{}return null}(ei.bitmap,el):null,et[7]=el,et[8]=ei,et[9]=M):M=et[9];let es=M,eu=ei?.displayName??el;et[10]!==eo?(x=eo.toLowerCase(),et[10]=eo,et[11]=x):x=et[11];let ec="singleplayer"===x,em=er.musictrack;if(et[12]!==es||et[13]!==eu||et[14]!==ec||et[15]!==eo||et[16]!==ea||et[17]!==ei){let e,a,l,i,n,r,c=ei?.missionString?(o=ei.missionString,r=eo.toUpperCase(),o.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(r)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[36]!==ei?.missionQuote){if(s=i=ei?.missionQuote?.trim()??"",l="",e="",!(a=p.test(s)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[36]=ei?.missionQuote,et[37]=e,et[38]=a,et[39]=l,et[40]=i}else e=et[37],a=et[38],l=et[39],i=et[40];(U=f.default.Overlay,F=ea,C=en,P=f.default.Dialog,L=j,T=b,X="dialog",E="true",O="Map Information",R=-1,S=f.default.Body,G=f.default.Left,et[41]!==es||et[42]!==eu||et[43]!==ec?($=es&&ec&&(0,t.jsx)(_,{className:f.default.PreviewImageFloating,src:es,alt:`${eu} preview`},es),et[41]=es,et[42]=eu,et[43]=ec,et[44]=$):$=et[44],et[45]!==eu?(D=(0,t.jsx)("h1",{className:f.default.Title,children:eu}),et[45]=eu,et[46]=D):D=et[46],et[47]!==ei?(n=ei?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:ei.planetName}),et[47]=ei,et[48]=n):n=et[48],et[49]!==n?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:n}),et[49]=n,et[50]=w):w=et[50],et[51]!==e||et[52]!==a||et[53]!==l||et[54]!==i?(I=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[51]=e,et[52]=a,et[53]=l,et[54]=i,et[55]=I):I=et[55],et[56]!==ei)?(N=ei?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=ei.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:ei.missionBlurb.trim()}):ei.missionBlurb.trim()}),et[56]=ei,et[57]=N):N=et[57],B=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[12]=es,et[13]=eu,et[14]=ec,et[15]=eo,et[16]=ea,et[17]=ei,et[18]=D,et[19]=w,et[20]=I,et[21]=N,et[22]=B,et[23]=S,et[24]=C,et[25]=P,et[26]=L,et[27]=T,et[28]=X,et[29]=E,et[30]=O,et[31]=R,et[32]=U,et[33]=F,et[34]=G,et[35]=$}else D=et[18],w=et[19],I=et[20],N=et[21],B=et[22],S=et[23],C=et[24],P=et[25],L=et[26],T=et[27],X=et[28],E=et[29],O=et[30],R=et[31],U=et[32],F=et[33],G=et[34],$=et[35];return et[58]!==ei?(K=ei?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:ei.missionBriefing})]}),et[58]=ei,et[59]=K):K=et[59],et[60]!==em?(Q=em&&(0,t.jsx)(v,{track:em}),et[60]=em,et[61]=Q):Q=et[61],et[62]!==D||et[63]!==w||et[64]!==I||et[65]!==N||et[66]!==B||et[67]!==K||et[68]!==Q||et[69]!==G||et[70]!==$?(q=(0,t.jsxs)("div",{className:G,children:[$,D,w,I,N,B,K,Q]}),et[62]=D,et[63]=w,et[64]=I,et[65]=N,et[66]=B,et[67]=K,et[68]=Q,et[69]=G,et[70]=$,et[71]=q):q=et[71],et[72]!==es||et[73]!==eu||et[74]!==ec?(W=es&&!ec&&(0,t.jsx)(_,{src:es,alt:`${eu} preview`},es),et[72]=es,et[73]=eu,et[74]=ec,et[75]=W):W=et[75],et[76]!==S||et[77]!==q||et[78]!==W?(Z=(0,t.jsxs)("div",{className:S,children:[q,W]}),et[76]=S,et[77]=q,et[78]=W,et[79]=Z):Z=et[79],et[80]!==ea?(A=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:ea,children:"Close"}),et[80]=ea,et[81]=A):A=et[81],et[82]===Symbol.for("react.memo_cache_sentinel")?(z=(0,t.jsx)("span",{className:f.default.Hint,children:"Esc to close"}),et[82]=z):z=et[82],et[83]!==A?(H=(0,t.jsxs)("div",{className:f.default.Footer,children:[A,z]}),et[83]=A,et[84]=H):H=et[84],et[85]!==C||et[86]!==P||et[87]!==L||et[88]!==T||et[89]!==X||et[90]!==E||et[91]!==O||et[92]!==R||et[93]!==Z||et[94]!==H?(V=(0,t.jsxs)("div",{ref:C,className:P,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":O,tabIndex:R,children:[Z,H]}),et[85]=C,et[86]=P,et[87]=L,et[88]=T,et[89]=X,et[90]=E,et[91]=O,et[92]=R,et[93]=Z,et[94]=H,et[95]=V):V=et[95],et[96]!==U||et[97]!==F||et[98]!==V?(J=(0,t.jsx)("div",{className:U,onClick:F,children:V}),et[96]=U,et[97]=F,et[98]=V,et[99]=J):J=et[99],J}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/7dcb40c178014bc9.js b/docs/_next/static/chunks/7dcb40c178014bc9.js new file mode 100644 index 00000000..513e646b --- /dev/null +++ b/docs/_next/static/chunks/7dcb40c178014bc9.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81847,e=>{e.v({Actions:"GameDialog-module__C6hZDW__Actions",Dialog:"GameDialog-module__C6hZDW__Dialog",DialogButton:"GameDialog-module__C6hZDW__DialogButton",Overlay:"GameDialog-module__C6hZDW__Overlay",Secondary:"GameDialog-module__C6hZDW__Secondary GameDialog-module__C6hZDW__DialogButton"})},66438,e=>{e.v({Bullet:"GuiMarkup-module__CLgNnq__Bullet",GuiMarkup:"GuiMarkup-module__CLgNnq__GuiMarkup"})},41973,e=>{e.v({Body:"MapInfoDialog-module__m0lXla__Body",CloseButton:"MapInfoDialog-module__m0lXla__CloseButton "+e.i(81847).DialogButton,Dialog:"MapInfoDialog-module__m0lXla__Dialog "+e.i(81847).Dialog,Footer:"MapInfoDialog-module__m0lXla__Footer",Hint:"MapInfoDialog-module__m0lXla__Hint",Left:"MapInfoDialog-module__m0lXla__Left",MapBlurb:"MapInfoDialog-module__m0lXla__MapBlurb",MapMeta:"MapInfoDialog-module__m0lXla__MapMeta",MapPlanet:"MapInfoDialog-module__m0lXla__MapPlanet",MapQuote:"MapInfoDialog-module__m0lXla__MapQuote",MusicButton:"MapInfoDialog-module__m0lXla__MusicButton",MusicTrack:"MapInfoDialog-module__m0lXla__MusicTrack",MusicTrackName:"MapInfoDialog-module__m0lXla__MusicTrackName",Overlay:"MapInfoDialog-module__m0lXla__Overlay "+e.i(81847).Overlay,PreviewImage:"MapInfoDialog-module__m0lXla__PreviewImage",PreviewImageFloating:"MapInfoDialog-module__m0lXla__PreviewImageFloating",Section:"MapInfoDialog-module__m0lXla__Section",SectionTitle:"MapInfoDialog-module__m0lXla__SectionTitle",Title:"MapInfoDialog-module__m0lXla__Title"})},94247,e=>{"use strict";var t=e.i(43476),a=e.i(932),l=e.i(71645),o=e.i(11152),i=e.i(66027),n=e.i(12979),r=e.i(91996),s=e.i(66438);let u=new Set(["spop","spush","lmargin","font","color","bitmap","a","/a"]),c=new Map;function m(e){let l,o=(0,a.c)(5),{name:i}=e;o[0]!==i?(l=function(e){let t;if(c.has(e))return c.get(e);try{t=(0,n.getUrlForPath)((0,r.getStandardTextureResourceKey)(`textures/gui/${e}`))}catch{t=null}return c.set(e,t),t}(i),o[0]=i,o[1]=l):l=o[1];let u=l;if(u){let e;return o[2]!==u?(e=(0,t.jsx)("img",{src:u,alt:"",className:s.default.Bitmap}),o[2]=u,o[3]=e):e=o[3],e}if(/bullet/i.test(i)){let e;return o[4]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("span",{className:s.default.Bullet,children:"•"}),o[4]=e):e=o[4],e}return null}let p=/<(?:font|color|bitmap|just|lmargin|a):/i;function d(e){let o,i,n=(0,a.c)(4),{markup:r}=e;n[0]!==r?(o=function(e){let a=e.split(/<([^><]+)>/g).map((e,t)=>{if(t%2==0)return e?{type:"text",value:e}:null;{let[t,...a]=e.split(":");return u.has(t.toLowerCase())?{type:"tag",name:t,args:a}:{type:"text",value:`<${e}>`}}}).filter(e=>null!=e),o={type:"span",source:"root",style:{},children:[]},i=o,n=[i],r=e=>null!=e.children&&e.children.some(e=>"string"==typeof e||r(e));for(let e of a)switch(e.type){case"text":i.children.push(e.value);break;case"tag":switch(e.name){case"spush":{let e={type:"span",source:"spush",style:{},children:[]};i.children.push(e),i=e,n.push(i);break}case"spop":if("root"!==i.source){let e=n.pop();for(;"spush"!==e.source;)e=n.pop();i=n[n.length-1]}break;case"lmargin":break;case"font":{let t=function(e){let[t,a]=e;return{fontDescription:t,fontSize:a?Math.max(11,Math.min(parseInt(a.trim(),10),16)):void 0}}(e.args).fontSize;if(r(i)){let e={type:"span",source:"spush",style:{fontSize:t},children:[]};i.children.push(e),i=e,n.push(i)}else i.style.fontSize=t;break}case"color":if(r(i)){let t={type:"span",source:"spush",style:{color:`#${e.args[0].trim()}`},children:[]};i.children.push(t),i=t,n.push(i)}else i.style.color=`#${e.args[0].trim()}`;break;case"bitmap":{let t={type:"bitmap",value:e.args[0]};i.children.push(t);break}case"a":{let t=e.args[0].trim().split(" "),a=2===t.length&&"wwwlink"===t[0]?t[1]:t[0],l={type:"a",source:"a",value:`http://${a}`,style:{},children:[]};i.children.push(l),i=l,n.push(i);break}case"/a":{let e=n.pop();for(;"a"!==e.source;)e=n.pop();i=n[n.length-1]}}}return function e(a){switch(a.type){case"span":return l.default.createElement("span",{style:0===Object.keys(a.style).length?void 0:a.style},...a.children.map(t=>"string"==typeof t?t:e(t)));case"a":return l.default.createElement("a",{href:a.value,style:0===Object.keys(a.style).length?void 0:a.style,rel:"noopener noreferrer",target:"_blank"},...a.children.map(t=>"string"==typeof t?t:e(t)));case"bitmap":return(0,t.jsx)(m,{name:a.value})}}(o)}(r),n[0]=r,n[1]=o):o=n[1];let c=o;return n[2]!==c?(i=(0,t.jsx)("div",{className:s.default.GuiMarkup,children:c}),n[2]=c,n[3]=i):i=n[3],i}var f=e.i(41973);function _(e){let o,i,n,r=(0,a.c)(7),{src:s,alt:u,className:c}=e,m=void 0===c?f.default.PreviewImage:c,[p,d]=(0,l.useState)(null);return(r[0]!==s?(o=()=>{let e,t=!1;return fetch(s).then(M).then(y).then(g).then(a=>{!t&&a&&d(e=URL.createObjectURL(a))}).catch(h),()=>{t=!0,e&&URL.revokeObjectURL(e)}},i=[s],r[0]=s,r[1]=o,r[2]=i):(o=r[1],i=r[2]),(0,l.useEffect)(o,i),p)?(r[3]!==u||r[4]!==m||r[5]!==p?(n=(0,t.jsx)("img",{src:p,alt:u,className:m}),r[3]=u,r[4]=m,r[5]=p,r[6]=n):n=r[6],n):null}function h(){}function g(e){return new Promise(t=>{let a=document.createElement("canvas");a.width=e.width,a.height=e.height,a.getContext("2d")?.drawImage(e,0,0),e.close(),a.toBlob(t)})}function y(e){return createImageBitmap(e,{colorSpaceConversion:"none"})}function M(e){return e.blob()}function v(e){let i,r,s,u,c,m,p,d,_,h,g,y=(0,a.c)(22),{track:M}=e,[v,x]=(0,l.useState)(!1),[b,j]=(0,l.useState)(!0),k=(0,l.useRef)(null);y[0]!==M?(i=M.toLowerCase(),y[0]=M,y[1]=i):i=y[1];let D=`${n.RESOURCE_ROOT_URL}music/${i}.mp3`;y[2]===Symbol.for("react.memo_cache_sentinel")?(r=()=>{let e=k.current;if(e)return()=>{e.pause()}},s=[],y[2]=r,y[3]=s):(r=y[2],s=y[3]),(0,l.useEffect)(r,s),y[4]!==v?(u=()=>{let e=k.current;e&&(v?e.pause():e.play().catch(()=>j(!1)))},y[4]=v,y[5]=u):u=y[5];let w=u;return y[6]===Symbol.for("react.memo_cache_sentinel")?(c=()=>x(!0),m=()=>x(!1),p=()=>j(!1),y[6]=c,y[7]=m,y[8]=p):(c=y[6],m=y[7],p=y[8]),y[9]!==D?(d=(0,t.jsx)("audio",{ref:k,src:D,loop:!0,onPlay:c,onPause:m,onError:p}),y[9]=D,y[10]=d):d=y[10],y[11]!==M?(_=(0,t.jsx)("span",{className:f.default.MusicTrackName,children:M}),y[11]=M,y[12]=_):_=y[12],y[13]!==b||y[14]!==v||y[15]!==w?(h=b&&(0,t.jsx)("button",{className:f.default.MusicButton,onClick:w,"aria-label":v?"Pause music":"Play music",children:v?(0,t.jsx)(o.FaVolumeUp,{}):(0,t.jsx)(o.FaVolumeMute,{})}),y[13]=b,y[14]=v,y[15]=w,y[16]=h):h=y[16],y[17]!==v||y[18]!==h||y[19]!==d||y[20]!==_?(g=(0,t.jsxs)("div",{className:f.default.MusicTrack,"data-playing":v,children:[d,_,h]}),y[17]=v,y[18]=h,y[19]=d,y[20]=_,y[21]=g):g=y[21],g}function x(e){var o,s,u;let c,m,h,g,y,M,x,D,w,I,N,B,S,C,P,L,T,X,E,O,R,U,F,G,$,K,Q,q,W,Z,A,z,H,V,J,Y,ee,et=(0,a.c)(100),{onClose:ea,missionName:el,missionType:eo}=e,{data:ei}=((ee=(0,a.c)(2))[0]!==el?(Y={queryKey:["parsedMission",el],queryFn:()=>(0,n.loadMission)(el)},ee[0]=el,ee[1]=Y):Y=ee[1],(0,i.useQuery)(Y)),en=(0,l.useRef)(null);et[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{en.current?.focus();try{document.exitPointerLock()}catch{}},m=[],et[0]=c,et[1]=m):(c=et[0],m=et[1]),(0,l.useEffect)(c,m),et[2]!==ea?(h=()=>{let e=e=>{if("Escape"===e.key)ea();else if("k"===e.key&&(e.metaKey||e.ctrlKey))return void ea();e.stopImmediatePropagation()};return window.addEventListener("keydown",e,{capture:!0}),window.addEventListener("keyup",k,{capture:!0}),()=>{window.removeEventListener("keydown",e,{capture:!0}),window.removeEventListener("keyup",k,{capture:!0})}},g=[ea],et[2]=ea,et[3]=h,et[4]=g):(h=et[3],g=et[4]),(0,l.useEffect)(h,g),et[5]!==ei?(y=ei?function(e){for(let t of e.body){if("ObjectDeclaration"!==t.type)continue;let{instanceName:e,body:a}=t;if(e&&"Identifier"===e.type&&"missiongroup"===e.name.toLowerCase()){let e={};for(let t of a){if("Assignment"!==t.type)continue;let{target:a,value:l}=t;"Identifier"===a.type&&"StringLiteral"===l.type&&(e[a.name.toLowerCase()]=l.value)}return e}}return{}}(ei.ast):{},et[5]=ei,et[6]=y):y=et[6];let er=y;et[7]!==el||et[8]!==ei?(M=ei?function(e,t){if(e)try{let t=(0,r.getStandardTextureResourceKey)(`textures/gui/${e}`);return(0,n.getUrlForPath)(t)}catch{}try{let e=(0,r.getStandardTextureResourceKey)(`textures/gui/Load_${t}`);return(0,n.getUrlForPath)(e)}catch{}return null}(ei.bitmap,el):null,et[7]=el,et[8]=ei,et[9]=M):M=et[9];let es=M,eu=ei?.displayName??el;et[10]!==eo?(x=eo.toLowerCase(),et[10]=eo,et[11]=x):x=et[11];let ec="singleplayer"===x,em=er.musictrack;if(et[12]!==es||et[13]!==eu||et[14]!==ec||et[15]!==eo||et[16]!==ea||et[17]!==ei){let e,a,l,i,n,r,c=ei?.missionString?(o=ei.missionString,r=eo.toUpperCase(),o.split("\n").flatMap(e=>{let t=e.match(/^\[([^\]]+)\]/);return t&&!t[1].toUpperCase().split(/\s+/).includes(r)?[]:[e.replace(/^\[[^\]]+\]/,"")]}).join("\n")):null;if(et[36]!==ei?.missionQuote){if(s=i=ei?.missionQuote?.trim()??"",l="",e="",!(a=p.test(s)))for(let t of i.split("\n")){let a=t.trim();a.match(/^--[^-]/)?e=a.replace(/^-+\s*/,"").trim():a&&(l+=(l?"\n":"")+a)}et[36]=ei?.missionQuote,et[37]=e,et[38]=a,et[39]=l,et[40]=i}else e=et[37],a=et[38],l=et[39],i=et[40];(U=f.default.Overlay,F=ea,C=en,P=f.default.Dialog,L=j,T=b,X="dialog",E="true",O="Map Information",R=-1,S=f.default.Body,G=f.default.Left,et[41]!==es||et[42]!==eu||et[43]!==ec?($=es&&ec&&(0,t.jsx)(_,{className:f.default.PreviewImageFloating,src:es,alt:`${eu} preview`},es),et[41]=es,et[42]=eu,et[43]=ec,et[44]=$):$=et[44],et[45]!==eu?(D=(0,t.jsx)("h1",{className:f.default.Title,children:eu}),et[45]=eu,et[46]=D):D=et[46],et[47]!==ei?(n=ei?.planetName&&(0,t.jsx)("span",{className:f.default.MapPlanet,children:ei.planetName}),et[47]=ei,et[48]=n):n=et[48],et[49]!==n?(w=(0,t.jsx)("div",{className:f.default.MapMeta,children:n}),et[49]=n,et[50]=w):w=et[50],et[51]!==e||et[52]!==a||et[53]!==l||et[54]!==i?(I=a?(0,t.jsx)("blockquote",{className:f.default.MapQuote,children:(0,t.jsx)(d,{markup:i})}):l?(0,t.jsxs)("blockquote",{className:f.default.MapQuote,children:[(0,t.jsx)("p",{children:l}),e&&(0,t.jsxs)("cite",{children:["— ",e]})]}):null,et[51]=e,et[52]=a,et[53]=l,et[54]=i,et[55]=I):I=et[55],et[56]!==ei)?(N=ei?.missionBlurb&&(0,t.jsx)("div",{className:f.default.MapBlurb,children:(u=ei.missionBlurb,p.test(u))?(0,t.jsx)(d,{markup:ei.missionBlurb.trim()}):ei.missionBlurb.trim()}),et[56]=ei,et[57]=N):N=et[57],B=c&&c.trim()&&(0,t.jsx)("div",{className:f.default.Section,children:(0,t.jsx)(d,{markup:c})}),et[12]=es,et[13]=eu,et[14]=ec,et[15]=eo,et[16]=ea,et[17]=ei,et[18]=D,et[19]=w,et[20]=I,et[21]=N,et[22]=B,et[23]=S,et[24]=C,et[25]=P,et[26]=L,et[27]=T,et[28]=X,et[29]=E,et[30]=O,et[31]=R,et[32]=U,et[33]=F,et[34]=G,et[35]=$}else D=et[18],w=et[19],I=et[20],N=et[21],B=et[22],S=et[23],C=et[24],P=et[25],L=et[26],T=et[27],X=et[28],E=et[29],O=et[30],R=et[31],U=et[32],F=et[33],G=et[34],$=et[35];return et[58]!==ei?(K=ei?.missionBriefing&&(0,t.jsxs)("div",{className:f.default.Section,children:[(0,t.jsx)("h2",{className:f.default.SectionTitle,children:"Mission Briefing"}),(0,t.jsx)(d,{markup:ei.missionBriefing})]}),et[58]=ei,et[59]=K):K=et[59],et[60]!==em?(Q=em&&(0,t.jsx)(v,{track:em}),et[60]=em,et[61]=Q):Q=et[61],et[62]!==D||et[63]!==w||et[64]!==I||et[65]!==N||et[66]!==B||et[67]!==K||et[68]!==Q||et[69]!==G||et[70]!==$?(q=(0,t.jsxs)("div",{className:G,children:[$,D,w,I,N,B,K,Q]}),et[62]=D,et[63]=w,et[64]=I,et[65]=N,et[66]=B,et[67]=K,et[68]=Q,et[69]=G,et[70]=$,et[71]=q):q=et[71],et[72]!==es||et[73]!==eu||et[74]!==ec?(W=es&&!ec&&(0,t.jsx)(_,{src:es,alt:`${eu} preview`},es),et[72]=es,et[73]=eu,et[74]=ec,et[75]=W):W=et[75],et[76]!==S||et[77]!==q||et[78]!==W?(Z=(0,t.jsxs)("div",{className:S,children:[q,W]}),et[76]=S,et[77]=q,et[78]=W,et[79]=Z):Z=et[79],et[80]!==ea?(A=(0,t.jsx)("button",{className:f.default.CloseButton,onClick:ea,children:"Close"}),et[80]=ea,et[81]=A):A=et[81],et[82]===Symbol.for("react.memo_cache_sentinel")?(z=(0,t.jsx)("span",{className:f.default.Hint,children:"Esc to close"}),et[82]=z):z=et[82],et[83]!==A?(H=(0,t.jsxs)("div",{className:f.default.Footer,children:[A,z]}),et[83]=A,et[84]=H):H=et[84],et[85]!==C||et[86]!==P||et[87]!==L||et[88]!==T||et[89]!==X||et[90]!==E||et[91]!==O||et[92]!==R||et[93]!==Z||et[94]!==H?(V=(0,t.jsxs)("div",{ref:C,className:P,onClick:L,onKeyDown:T,role:X,"aria-modal":E,"aria-label":O,tabIndex:R,children:[Z,H]}),et[85]=C,et[86]=P,et[87]=L,et[88]=T,et[89]=X,et[90]=E,et[91]=O,et[92]=R,et[93]=Z,et[94]=H,et[95]=V):V=et[95],et[96]!==U||et[97]!==F||et[98]!==V?(J=(0,t.jsx)("div",{className:U,onClick:F,children:V}),et[96]=U,et[97]=F,et[98]=V,et[99]=J):J=et[99],J}function b(e){return e.stopPropagation()}function j(e){return e.stopPropagation()}function k(e){e.stopImmediatePropagation()}e.s(["MapInfoDialog",()=>x],94247)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/926fdfc108de2b2e.js b/docs/_next/static/chunks/926fdfc108de2b2e.js deleted file mode 100644 index 13ac8b4c..00000000 --- a/docs/_next/static/chunks/926fdfc108de2b2e.js +++ /dev/null @@ -1,211 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),i=e.i(71753);let s=(0,r.createContext)(null);function n({children:e}){let n=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,i.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,n.current)for(let e of n.current)e(o.current)});let l=(0,r.useCallback)(e=>(n.current??=new Set,n.current.add(e),()=>{n.current.delete(e)}),[]),u=(0,r.useCallback)(()=>o.current,[]),c=(0,r.useMemo)(()=>({subscribe:l,getTick:u}),[l,u]);return(0,t.jsx)(s.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(s);if(!t)throw Error("useTick must be used within a TickProvider");let i=(0,r.useRef)(e);i.current=e,(0,r.useEffect)(()=>t.subscribe(e=>i.current(e)),[t])}e.s(["TICK_RATE",0,32,"TickProvider",()=>n,"useTick",()=>a])},47071,99143,e=>{"use strict";var t=e.i(71645),r=e.i(90072),i=e.i(15080),s=e.i(40859);e.s(["useLoader",()=>s.G],99143);var s=s;let n=e=>e===Object(e)&&!Array.isArray(e)&&"function"!=typeof e;function a(e,a){let o=(0,i.useThree)(e=>e.gl),l=(0,s.G)(r.TextureLoader,n(e)?Object.values(e):e);return(0,t.useLayoutEffect)(()=>{null==a||a(l)},[a]),(0,t.useEffect)(()=>{if("initTexture"in o){let e=[];Array.isArray(l)?e=l:l instanceof r.Texture?e=[l]:n(l)&&(e=Object.values(l)),e.forEach(e=>{e instanceof r.Texture&&o.initTexture(e)})}},[o,l]),(0,t.useMemo)(()=>{if(!n(e))return l;{let t={},r=0;for(let i in e)t[i]=l[r++];return t}},[e,l])}a.preload=e=>s.G.preload(r.TextureLoader,e),a.clear=e=>s.G.clear(r.TextureLoader,e),e.s(["useTexture",()=>a],47071)},75567,56893,e=>{"use strict";var t=e.i(90072);let r=new t.ImageBitmapLoader,i=new Map;function s(e,s){let n=i.get(e);if(n)return s&&n.image&&s(n),n;let a=new t.Texture;return a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s?.(a)}),a}function n(e){let s=i.get(e);return s?s.image?Promise.resolve(s):new Promise(e=>{let t=()=>{s.image?e(s):setTimeout(t,16)};t()}):new Promise((s,n)=>{let a=new t.Texture;a.flipY=!1,i.set(e,a),r.load(e,e=>{a.image=e,a.needsUpdate=!0,s(a)},void 0,n)})}function a(e,r={}){let{repeat:i=[1,1],disableMipmaps:s=!1,anisotropy:n}=r;return e.wrapS=e.wrapT=t.RepeatWrapping,e.colorSpace=t.SRGBColorSpace,e.repeat.set(...i),e.flipY=!1,e.anisotropy=n??1,s?(e.generateMipmaps=!1,e.minFilter=t.LinearFilter):(e.generateMipmaps=!0,e.minFilter=t.LinearMipmapLinearFilter),e.magFilter=t.LinearFilter,e.needsUpdate=!0,e}function o(e){let r=new t.DataTexture(e,256,256,t.RedFormat,t.UnsignedByteType);return r.colorSpace=t.NoColorSpace,r.wrapS=r.wrapT=t.RepeatWrapping,r.generateMipmaps=!1,r.minFilter=t.LinearFilter,r.magFilter=t.LinearFilter,r.needsUpdate=!0,r}e.s(["loadTexture",()=>s,"loadTextureAsync",()=>n,"setupMask",()=>o,"setupTexture",()=>a],75567);var l=e.i(15080);function u(){return(0,l.useThree)(c)}function c(e){return e.gl.capabilities.getMaxAnisotropy()}e.s(["useAnisotropy",()=>u],56893)},47021,e=>{"use strict";var t=e.i(8560);let r=` -#ifdef USE_FOG - // Check fog enabled uniform - allows toggling without shader recompilation - #ifdef USE_VOLUMETRIC_FOG - if (!fogEnabled) { - // Skip all fog calculations when disabled - } else { - #endif - - float dist = vFogDepth; - - // Discard fragments at or beyond visible distance - matches Torque's behavior - // where objects beyond visibleDistance are not rendered at all. - // This prevents fully-fogged geometry from showing as silhouettes against - // the sky's fog-to-sky gradient. - if (dist >= fogFar) { - discard; - } - - // Step 1: Calculate distance-based haze (quadratic falloff) - // Since we discard at fogFar, haze never reaches 1.0 here - float haze = 0.0; - if (dist > fogNear) { - float fogScale = 1.0 / (fogFar - fogNear); - float distFactor = (dist - fogNear) * fogScale - 1.0; - haze = 1.0 - distFactor * distFactor; - } - - // Step 2: Calculate fog volume contributions - // Note: Per-volume colors are NOT used in Tribes 2 ($specialFog defaults to false) - // All fog uses the global fogColor - see Tribes2_Fog_System.md for details - float volumeFog = 0.0; - - #ifdef USE_VOLUMETRIC_FOG - { - #ifdef USE_FOG_WORLD_POSITION - float fragmentHeight = vFogWorldPosition.y; - #else - float fragmentHeight = cameraHeight; - #endif - - float deltaY = fragmentHeight - cameraHeight; - float absDeltaY = abs(deltaY); - - // Determine if we're going up (positive) or down (negative) - if (absDeltaY > 0.01) { - // Non-horizontal ray: ray-march through fog volumes - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - // Skip inactive volumes (visibleDistance = 0) - if (volVisDist <= 0.0) continue; - - // Calculate fog factor for this volume - // From Torque: factor = (1 / (volumeVisDist * visFactor)) * percentage - // where visFactor is smVisibleDistanceMod (a user quality pref, default 1.0) - // Since we don't have quality settings, we use visFactor = 1.0 - float factor = (1.0 / volVisDist) * volPct; - - // Find ray intersection with this volume's height range - float rayMinY = min(cameraHeight, fragmentHeight); - float rayMaxY = max(cameraHeight, fragmentHeight); - - // Check if ray intersects volume height range - if (rayMinY < volMaxH && rayMaxY > volMinH) { - float intersectMin = max(rayMinY, volMinH); - float intersectMax = min(rayMaxY, volMaxH); - float intersectHeight = intersectMax - intersectMin; - - // Calculate distance traveled through this volume using similar triangles: - // subDist / dist = intersectHeight / absDeltaY - float subDist = dist * (intersectHeight / absDeltaY); - - // Accumulate fog: fog += subDist * factor - volumeFog += subDist * factor; - } - } - } else { - // Near-horizontal ray: if camera is inside a volume, apply full fog for that volume - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // If camera is inside this volume, apply fog for full distance - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float factor = (1.0 / volVisDist) * volPct; - volumeFog += dist * factor; - } - } - } - } - #endif - - // Step 3: Combine haze and volume fog - // Torque's clamping: if (bandPct + hazePct > 1) hazePct = 1 - bandPct - // This gives fog volumes priority over haze - float volPct = min(volumeFog, 1.0); - float hazePct = haze; - if (volPct + hazePct > 1.0) { - hazePct = 1.0 - volPct; - } - float fogFactor = hazePct + volPct; - - // Apply fog using global fogColor (per-volume colors not used in Tribes 2) - gl_FragColor.rgb = mix(gl_FragColor.rgb, fogColor, fogFactor); - - #ifdef USE_VOLUMETRIC_FOG - } // end fogEnabled check - #endif -#endif -`;function i(){t.ShaderChunk.fog_pars_fragment=` -#ifdef USE_FOG - uniform vec3 fogColor; - varying float vFogDepth; - #ifdef FOG_EXP2 - uniform float fogDensity; - #else - uniform float fogNear; - uniform float fogFar; - #endif - - // Custom volumetric fog uniforms (only defined when USE_VOLUMETRIC_FOG is set) - // Format: [visDist, minH, maxH, percentage] x 3 volumes = 12 floats - #ifdef USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - #endif - - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_fragment=r,t.ShaderChunk.fog_pars_vertex=` -#ifdef USE_FOG - varying float vFogDepth; - #ifdef USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; - #endif -#endif -`,t.ShaderChunk.fog_vertex=` -#ifdef USE_FOG - // Use Euclidean distance from camera, not view-space z-depth - // This ensures fog doesn't change when rotating the camera - vFogDepth = length(mvPosition.xyz); - #ifdef USE_FOG_WORLD_POSITION - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; - #endif -#endif -`}function s(e,t){e.uniforms.fogVolumeData=t.fogVolumeData,e.uniforms.cameraHeight=t.cameraHeight,e.uniforms.fogEnabled=t.fogEnabled,e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_FOG_WORLD_POSITION - #define USE_VOLUMETRIC_FOG - varying vec3 vFogWorldPosition; -#endif`),e.vertexShader=e.vertexShader.replace("#include ",`#include -#ifdef USE_FOG - vFogWorldPosition = (modelMatrix * vec4(transformed, 1.0)).xyz; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -#ifdef USE_FOG - #define USE_VOLUMETRIC_FOG - uniform float fogVolumeData[12]; - uniform float cameraHeight; - uniform bool fogEnabled; - #define USE_FOG_WORLD_POSITION - varying vec3 vFogWorldPosition; -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",r)}e.s(["fogFragmentShader",0,r,"injectCustomFog",()=>s,"installCustomFogShader",()=>i])},48066,e=>{"use strict";let t={fogVolumeData:{value:new Float32Array(12)},cameraHeight:{value:0},fogEnabled:{value:!0}};function r(e,i,s=!0){t.cameraHeight.value=e,t.fogVolumeData.value.set(i),t.fogEnabled.value=s}function i(){t.cameraHeight.value=0,t.fogVolumeData.value.fill(0),t.fogEnabled.value=!0}function s(e){let t=new Float32Array(12);for(let r=0;r<3;r++){let i=4*r,s=e[r];s&&(t[i+0]=s.visibleDistance,t[i+1]=s.minHeight,t[i+2]=s.maxHeight,t[i+3]=s.percentage)}return t}e.s(["globalFogUniforms",0,t,"packFogVolumeData",()=>s,"resetGlobalFogUniforms",()=>i,"updateGlobalFogUniforms",()=>r])},67191,e=>{e.v({Label:"FloatingLabel-module__8y09Ka__Label"})},89887,e=>{"use strict";var t=e.i(43476),r=e.i(932),i=e.i(71645),s=e.i(90072),n=e.i(71753),a=e.i(60099),o=e.i(67191);let l=[0,0,0],u=new s.Vector3,c=(0,i.memo)(function(e){let s,c,h,d=(0,r.c)(11),{children:f,color:p,position:m,opacity:v}=e,g=void 0===p?"white":p,y=void 0===m?l:m,b=void 0===v?"fadeWithDistance":v,S="fadeWithDistance"===b,x=(0,i.useRef)(null),[T,F]=(0,i.useState)(0!==b),O=(0,i.useRef)(null);return d[0]!==S||d[1]!==T||d[2]!==b?(s=e=>{var t,r,i;let s,{camera:n}=e,a=x.current;if(!a)return;a.getWorldPosition(u);let o=(t=u.x,r=u.y,i=u.z,-((t-(s=n.matrixWorld.elements)[12])*s[8])+-((r-s[13])*s[9])+-((i-s[14])*s[10])<0);if(S){let e=o?1/0:n.position.distanceTo(u),t=e<200;if(T!==t&&F(t),O.current&&t){let t=Math.max(0,Math.min(1,1-e/200));O.current.style.opacity=t.toString()}}else{let e=!o&&0!==b;T!==e&&F(e),O.current&&(O.current.style.opacity=b.toString())}},d[0]=S,d[1]=T,d[2]=b,d[3]=s):s=d[3],(0,n.useFrame)(s),d[4]!==f||d[5]!==g||d[6]!==T||d[7]!==y?(c=T?(0,t.jsx)(a.Html,{position:y,center:!0,children:(0,t.jsx)("div",{ref:O,className:o.default.Label,style:{color:g},children:f})}):null,d[4]=f,d[5]=g,d[6]=T,d[7]=y,d[8]=c):c=d[8],d[9]!==c?(h=(0,t.jsx)("group",{ref:x,children:c}),d[9]=c,d[10]=h):h=d[10],h});e.s(["FloatingLabel",0,c])},79123,e=>{"use strict";var t=e.i(43476),r=e.i(71645);let i=(0,r.createContext)(null),s=(0,r.createContext)(null),n=(0,r.createContext)(null);function a(){return(0,r.useContext)(i)}function o(){return(0,r.useContext)(s)}function l(){return(0,r.useContext)(n)}function u({children:e,fogEnabledOverride:a,onClearFogEnabledOverride:o}){let[l,u]=(0,r.useState)(!0),[c,h]=(0,r.useState)(!1),[d,f]=(0,r.useState)(1),[p,m]=(0,r.useState)(90),[v,g]=(0,r.useState)(!1),[y,b]=(0,r.useState)(.75),[S,x]=(0,r.useState)(!0),[T,F]=(0,r.useState)(!1),[O,R]=(0,r.useState)("moveLookStick"),[E,w]=(0,r.useState)("MapGenius"),[M,C]=(0,r.useState)(!1),[P,D]=(0,r.useState)(!1),[I,_]=(0,r.useState)(!1),[U,Q]=(0,r.useState)(!1),k=(0,r.useCallback)(e=>{u(e),o()},[o]),L=(0,r.useMemo)(()=>({fogEnabled:a??l,setFogEnabled:k,highQualityFog:c,setHighQualityFog:h,fov:p,setFov:m,audioEnabled:v,setAudioEnabled:g,animationEnabled:S,setAnimationEnabled:x,warriorName:E,setWarriorName:w,audioVolume:y,setAudioVolume:b}),[l,a,k,c,p,v,S,E,y]),j=(0,r.useMemo)(()=>({debugMode:T,setDebugMode:F,renderOnDemand:U,setRenderOnDemand:Q}),[T,F,U]),H=(0,r.useMemo)(()=>({speedMultiplier:d,setSpeedMultiplier:f,touchMode:O,setTouchMode:R,invertScroll:M,setInvertScroll:C,invertDrag:P,setInvertDrag:D,invertJoystick:I,setInvertJoystick:_}),[d,f,O,R,M,P,I]);(0,r.useEffect)(()=>{let e={};try{e=JSON.parse(localStorage.getItem("settings"))||{}}catch(e){}null!=e.debugMode&&F(e.debugMode),null!=e.audioEnabled&&g(e.audioEnabled),null!=e.animationEnabled&&x(e.animationEnabled),null!=e.fogEnabled&&u(e.fogEnabled),null!=e.highQualityFog&&h(e.highQualityFog),null!=e.speedMultiplier&&f(Math.max(0,Math.min(1,e.speedMultiplier))),null!=e.fov&&m(e.fov),null!=e.touchMode&&R(e.touchMode),null!=e.warriorName&&w(e.warriorName),null!=e.audioVolume&&b(e.audioVolume),null!=e.invertScroll&&C(e.invertScroll),null!=e.invertDrag&&D(e.invertDrag),null!=e.invertJoystick&&_(e.invertJoystick)},[]);let A=(0,r.useRef)(null);return(0,r.useEffect)(()=>(A.current&&clearTimeout(A.current),A.current=setTimeout(()=>{try{localStorage.setItem("settings",JSON.stringify({fogEnabled:l,highQualityFog:c,speedMultiplier:d,fov:p,audioEnabled:v,animationEnabled:S,debugMode:T,touchMode:O,warriorName:E,audioVolume:y,invertScroll:M,invertDrag:P,invertJoystick:I}))}catch(e){}},500),()=>{A.current&&clearTimeout(A.current)}),[l,c,d,p,v,S,T,O,E,y,M,P,I]),(0,t.jsx)(i.Provider,{value:L,children:(0,t.jsx)(s.Provider,{value:j,children:(0,t.jsx)(n.Provider,{value:H,children:e})})})}e.s(["SettingsProvider",()=>u,"useControls",()=>l,"useDebug",()=>o,"useSettings",()=>a])},31067,e=>{"use strict";function t(){return(t=Object.assign.bind()).apply(null,arguments)}e.s(["default",()=>t])},60099,e=>{"use strict";let t,r;var i=e.i(31067),s=e.i(71645),n=e.i(88014),a=e.i(90072),o=e.i(15080),l=e.i(71753);let u=new a.Vector3,c=new a.Vector3,h=new a.Vector3,d=new a.Vector2;function f(e,t,r){let i=u.setFromMatrixPosition(e.matrixWorld);i.project(t);let s=r.width/2,n=r.height/2;return[i.x*s+s,-(i.y*n)+n]}let p=e=>1e-10>Math.abs(e)?0:e;function m(e,t,r=""){let i="matrix3d(";for(let r=0;16!==r;r++)i+=p(t[r]*e.elements[r])+(15!==r?",":")");return r+i}let v=(t=[1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1],e=>m(e,t)),g=(r=e=>[1/e,1/e,1/e,1,-1/e,-1/e,-1/e,-1,1/e,1/e,1/e,1,1,1,1,1],(e,t)=>m(e,r(t),"translate(-50%,-50%)")),y=s.forwardRef(({children:e,eps:t=.001,style:r,className:m,prepend:y,center:b,fullscreen:S,portal:x,distanceFactor:T,sprite:F=!1,transform:O=!1,occlude:R,onOcclude:E,castShadow:w,receiveShadow:M,material:C,geometry:P,zIndexRange:D=[0x1000037,0],calculatePosition:I=f,as:_="div",wrapperClass:U,pointerEvents:Q="auto",...k},L)=>{let{gl:j,camera:H,scene:A,size:W,raycaster:V,events:q,viewport:G}=(0,o.useThree)(),[z]=s.useState(()=>document.createElement(_)),N=s.useRef(null),$=s.useRef(null),K=s.useRef(0),Y=s.useRef([0,0]),B=s.useRef(null),J=s.useRef(null),Z=(null==x?void 0:x.current)||q.connected||j.domElement.parentNode,X=s.useRef(null),ee=s.useRef(!1),et=s.useMemo(()=>{var e;return R&&"blending"!==R||Array.isArray(R)&&R.length&&(e=R[0])&&"object"==typeof e&&"current"in e},[R]);s.useLayoutEffect(()=>{let e=j.domElement;R&&"blending"===R?(e.style.zIndex=`${Math.floor(D[0]/2)}`,e.style.position="absolute",e.style.pointerEvents="none"):(e.style.zIndex=null,e.style.position=null,e.style.pointerEvents=null)},[R]),s.useLayoutEffect(()=>{if($.current){let e=N.current=n.createRoot(z);if(A.updateMatrixWorld(),O)z.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{let e=I($.current,H,W);z.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${e[0]}px,${e[1]}px,0);transform-origin:0 0;`}return Z&&(y?Z.prepend(z):Z.appendChild(z)),()=>{Z&&Z.removeChild(z),e.unmount()}}},[Z,O]),s.useLayoutEffect(()=>{U&&(z.className=U)},[U]);let er=s.useMemo(()=>O?{position:"absolute",top:0,left:0,width:W.width,height:W.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:b?"translate3d(-50%,-50%,0)":"none",...S&&{top:-W.height/2,left:-W.width/2,width:W.width,height:W.height},...r},[r,b,S,W,O]),ei=s.useMemo(()=>({position:"absolute",pointerEvents:Q}),[Q]);s.useLayoutEffect(()=>{var t,i;ee.current=!1,O?null==(t=N.current)||t.render(s.createElement("div",{ref:B,style:er},s.createElement("div",{ref:J,style:ei},s.createElement("div",{ref:L,className:m,style:r,children:e})))):null==(i=N.current)||i.render(s.createElement("div",{ref:L,style:er,className:m,children:e}))});let es=s.useRef(!0);(0,l.useFrame)(e=>{if($.current){H.updateMatrixWorld(),$.current.updateWorldMatrix(!0,!1);let e=O?Y.current:I($.current,H,W);if(O||Math.abs(K.current-H.zoom)>t||Math.abs(Y.current[0]-e[0])>t||Math.abs(Y.current[1]-e[1])>t){var r;let t,i,s,n,o=(r=$.current,t=u.setFromMatrixPosition(r.matrixWorld),i=c.setFromMatrixPosition(H.matrixWorld),s=t.sub(i),n=H.getWorldDirection(h),s.angleTo(n)>Math.PI/2),l=!1;et&&(Array.isArray(R)?l=R.map(e=>e.current):"blending"!==R&&(l=[A]));let f=es.current;l?es.current=function(e,t,r,i){let s=u.setFromMatrixPosition(e.matrixWorld),n=s.clone();n.project(t),d.set(n.x,n.y),r.setFromCamera(d,t);let a=r.intersectObjects(i,!0);if(a.length){let e=a[0].distance;return s.distanceTo(r.ray.origin)({vertexShader:O?void 0:` - /* - This shader is from the THREE's SpriteMaterial. - We need to turn the backing plane into a Sprite - (make it always face the camera) if "transfrom" - is false. - */ - #include - - void main() { - vec2 center = vec2(0., 1.); - float rotation = 0.0; - - // This is somewhat arbitrary, but it seems to work well - // Need to figure out how to derive this dynamically if it even matters - float size = 0.03; - - vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 ); - vec2 scale; - scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) ); - scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) ); - - bool isPerspective = isPerspectiveMatrix( projectionMatrix ); - if ( isPerspective ) scale *= - mvPosition.z; - - vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size; - vec2 rotatedPosition; - rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y; - rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y; - mvPosition.xy += rotatedPosition; - - gl_Position = projectionMatrix * mvPosition; - } - `,fragmentShader:` - void main() { - gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0); - } - `}),[O]);return s.createElement("group",(0,i.default)({},k,{ref:$}),R&&!et&&s.createElement("mesh",{castShadow:w,receiveShadow:M,ref:X},P||s.createElement("planeGeometry",null),C||s.createElement("shaderMaterial",{side:a.DoubleSide,vertexShader:en.vertexShader,fragmentShader:en.fragmentShader})))});e.s(["Html",()=>y])},19273,80166,e=>{"use strict";e.i(47167);var t={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},r=new class{#e=t;#t=!1;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function i(e){setTimeout(e,0)}e.s(["systemSetTimeoutZero",()=>i,"timeoutManager",()=>r],80166);var s="u"=0&&e!==1/0}function l(e,t){return Math.max(e+(t||0)-Date.now(),0)}function u(e,t){return"function"==typeof e?e(t):e}function c(e,t){return"function"==typeof e?e(t):e}function h(e,t){let{type:r="all",exact:i,fetchStatus:s,predicate:n,queryKey:a,stale:o}=e;if(a){if(i){if(t.queryHash!==f(a,t.options))return!1}else if(!m(t.queryKey,a))return!1}if("all"!==r){let e=t.isActive();if("active"===r&&!e||"inactive"===r&&e)return!1}return("boolean"!=typeof o||t.isStale()===o)&&(!s||s===t.state.fetchStatus)&&(!n||!!n(t))}function d(e,t){let{exact:r,status:i,predicate:s,mutationKey:n}=e;if(n){if(!t.options.mutationKey)return!1;if(r){if(p(t.options.mutationKey)!==p(n))return!1}else if(!m(t.options.mutationKey,n))return!1}return(!i||t.state.status===i)&&(!s||!!s(t))}function f(e,t){return(t?.queryKeyHashFn||p)(e)}function p(e){return JSON.stringify(e,(e,t)=>b(t)?Object.keys(t).sort().reduce((e,r)=>(e[r]=t[r],e),{}):t)}function m(e,t){return e===t||typeof e==typeof t&&!!e&&!!t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).every(r=>m(e[r],t[r]))}var v=Object.prototype.hasOwnProperty;function g(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}function y(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function b(e){if(!S(e))return!1;let t=e.constructor;if(void 0===t)return!0;let r=t.prototype;return!!S(r)&&!!r.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(e)===Object.prototype}function S(e){return"[object Object]"===Object.prototype.toString.call(e)}function x(e){return new Promise(t=>{r.setTimeout(t,e)})}function T(e,t,r){return"function"==typeof r.structuralSharing?r.structuralSharing(e,t):!1!==r.structuralSharing?function e(t,r,i=0){if(t===r)return t;if(i>500)return r;let s=y(t)&&y(r);if(!s&&!(b(t)&&b(r)))return r;let n=(s?t:Object.keys(t)).length,a=s?r:Object.keys(r),o=a.length,l=s?Array(o):{},u=0;for(let c=0;cr?i.slice(1):i}function O(e,t,r=0){let i=[t,...e];return r&&i.length>r?i.slice(0,-1):i}var R=Symbol();function E(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:e.queryFn&&e.queryFn!==R?e.queryFn:()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`))}function w(e,t){return"function"==typeof e?e(...t):!!e}function M(e,t,r){let i,s=!1;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),s||(s=!0,i.aborted?r():i.addEventListener("abort",r,{once:!0})),i)}),e}e.s(["addConsumeAwareSignal",()=>M,"addToEnd",()=>F,"addToStart",()=>O,"ensureQueryFn",()=>E,"functionalUpdate",()=>a,"hashKey",()=>p,"hashQueryKeyByOptions",()=>f,"isServer",()=>s,"isValidTimeout",()=>o,"matchMutation",()=>d,"matchQuery",()=>h,"noop",()=>n,"partialMatchKey",()=>m,"replaceData",()=>T,"resolveEnabled",()=>c,"resolveStaleTime",()=>u,"shallowEqualObjects",()=>g,"shouldThrowError",()=>w,"skipToken",()=>R,"sleep",()=>x,"timeUntilStale",()=>l],19273)},40143,e=>{"use strict";let t,r,i,s,n,a;var o=e.i(80166).systemSetTimeoutZero,l=(t=[],r=0,i=e=>{e()},s=e=>{e()},n=o,{batch:e=>{let a;r++;try{a=e()}finally{let e;--r||(e=t,t=[],e.length&&n(()=>{s(()=>{e.forEach(e=>{i(e)})})}))}return a},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a=e=>{r?t.push(e):n(()=>{i(e)})},setNotifyFunction:e=>{i=e},setBatchNotifyFunction:e=>{s=e},setScheduler:e=>{n=e}});e.s(["notifyManager",()=>l])},15823,e=>{"use strict";var t=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}};e.s(["Subscribable",()=>t])},75555,e=>{"use strict";var t=e.i(15823),r=e.i(19273),i=new class extends t.Subscribable{#r;#i;#s;constructor(){super(),this.#s=e=>{if(!r.isServer&&window.addEventListener){let t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(e=>{"boolean"==typeof e?this.setFocused(e):this.onFocus()})}setFocused(e){this.#r!==e&&(this.#r=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return"boolean"==typeof this.#r?this.#r:globalThis.document?.visibilityState!=="hidden"}};e.s(["focusManager",()=>i])},86491,14448,93803,36553,88587,e=>{"use strict";e.i(47167);var t=e.i(19273),r=e.i(40143),i=e.i(75555),s=e.i(15823),n=new class extends s.Subscribable{#n=!0;#i;#s;constructor(){super(),this.#s=e=>{if(!t.isServer&&window.addEventListener){let t=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",r)}}}}onSubscribe(){this.#i||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(e){this.#s=e,this.#i?.(),this.#i=e(this.setOnline.bind(this))}setOnline(e){this.#n!==e&&(this.#n=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#n}};function a(){let e,t,r=new Promise((r,i)=>{e=r,t=i});function i(e){Object.assign(r,e),delete r.resolve,delete r.reject}return r.status="pending",r.catch(()=>{}),r.resolve=t=>{i({status:"fulfilled",value:t}),e(t)},r.reject=e=>{i({status:"rejected",reason:e}),t(e)},r}function o(e){return Math.min(1e3*2**e,3e4)}function l(e){return(e??"online")!=="online"||n.isOnline()}e.s(["onlineManager",()=>n],14448),e.s(["pendingThenable",()=>a],93803);var u=class extends Error{constructor(e){super("CancelledError"),this.revert=e?.revert,this.silent=e?.silent}};function c(e){let r,s=!1,c=0,h=a(),d=()=>i.focusManager.isFocused()&&("always"===e.networkMode||n.isOnline())&&e.canRun(),f=()=>l(e.networkMode)&&e.canRun(),p=e=>{"pending"===h.status&&(r?.(),h.resolve(e))},m=e=>{"pending"===h.status&&(r?.(),h.reject(e))},v=()=>new Promise(t=>{r=e=>{("pending"!==h.status||d())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,"pending"===h.status&&e.onContinue?.()}),g=()=>{let r;if("pending"!==h.status)return;let i=0===c?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(p).catch(r=>{if("pending"!==h.status)return;let i=e.retry??3*!t.isServer,n=e.retryDelay??o,a="function"==typeof n?n(c,r):n,l=!0===i||"number"==typeof i&&cd()?void 0:v()).then(()=>{s?m(r):g()}))})};return{promise:h,status:()=>h.status,cancel:t=>{if("pending"===h.status){let r=new u(t);m(r),e.onCancel?.(r)}},continue:()=>(r?.(),h),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:f,start:()=>(f()?g():v().then(g),h)}}e.s(["CancelledError",()=>u,"canFetch",()=>l,"createRetryer",()=>c],36553);var h=e.i(80166),d=class{#a;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),(0,t.isValidTimeout)(this.gcTime)&&(this.#a=h.timeoutManager.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(t.isServer?1/0:3e5))}clearGcTimeout(){this.#a&&(h.timeoutManager.clearTimeout(this.#a),this.#a=void 0)}};e.s(["Removable",()=>d],88587);var f=class extends d{#o;#l;#u;#c;#h;#d;#f;constructor(e){super(),this.#f=!1,this.#d=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#c=e.client,this.#u=this.#c.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#o=v(this.options),this.state=e.state??this.#o,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#h?.promise}setOptions(e){if(this.options={...this.#d,...e},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){let e=v(this.options);void 0!==e.data&&(this.setState(m(e.data,e.dataUpdatedAt)),this.#o=e)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(e,r){let i=(0,t.replaceData)(this.state.data,e,this.options);return this.#p({data:i,type:"success",dataUpdatedAt:r?.updatedAt,manual:r?.manual}),i}setState(e,t){this.#p({type:"setState",state:e,setStateOptions:t})}cancel(e){let r=this.#h?.promise;return this.#h?.cancel(e),r?r.then(t.noop).catch(t.noop):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#o)}isActive(){return this.observers.some(e=>!1!==(0,t.resolveEnabled)(e.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===t.skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>"static"===(0,t.resolveStaleTime)(e.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(e=0){return void 0===this.state.data||"static"!==e&&(!!this.state.isInvalidated||!(0,t.timeUntilStale)(this.state.dataUpdatedAt,e))}onFocus(){let e=this.observers.find(e=>e.shouldFetchOnWindowFocus());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}onOnline(){let e=this.observers.find(e=>e.shouldFetchOnReconnect());e?.refetch({cancelRefetch:!1}),this.#h?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#h&&(this.#f?this.#h.cancel({revert:!0}):this.#h.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(e,r){let i;if("idle"!==this.state.fetchStatus&&this.#h?.status()!=="rejected"){if(void 0!==this.state.data&&r?.cancelRefetch)this.cancel({silent:!0});else if(this.#h)return this.#h.continueRetry(),this.#h.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let s=new AbortController,n=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#f=!0,s.signal)})},a=()=>{let e,i=(0,t.ensureQueryFn)(this.options,r),s=(n(e={client:this.#c,queryKey:this.queryKey,meta:this.meta}),e);return(this.#f=!1,this.options.persister)?this.options.persister(i,s,this):i(s)},o=(n(i={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:this.#c,state:this.state,fetchFn:a}),i);this.options.behavior?.onFetch(o,this),this.#l=this.state,("idle"===this.state.fetchStatus||this.state.fetchMeta!==o.fetchOptions?.meta)&&this.#p({type:"fetch",meta:o.fetchOptions?.meta}),this.#h=c({initialPromise:r?.initialPromise,fn:o.fetchFn,onCancel:e=>{e instanceof u&&e.revert&&this.setState({...this.#l,fetchStatus:"idle"}),s.abort()},onFail:(e,t)=>{this.#p({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:o.options.retry,retryDelay:o.options.retryDelay,networkMode:o.options.networkMode,canRun:()=>!0});try{let e=await this.#h.start();if(void 0===e)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#u.config.onSuccess?.(e,this),this.#u.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof u){if(e.silent)return this.#h.promise;else if(e.revert){if(void 0===this.state.data)throw e;return this.state.data}}throw this.#p({type:"error",error:e}),this.#u.config.onError?.(e,this),this.#u.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#p(e){let t=t=>{switch(e.type){case"failed":return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...t,fetchStatus:"paused"};case"continue":return{...t,fetchStatus:"fetching"};case"fetch":return{...t,...p(t.data,this.options),fetchMeta:e.meta??null};case"success":let r={...t,...m(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#l=e.manual?r:void 0,r;case"error":let i=e.error;return{...t,error:i,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...t,isInvalidated:!0};case"setState":return{...t,...e.state}}};this.state=t(this.state),r.notifyManager.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:e})})}};function p(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:l(t.networkMode)?"fetching":"paused",...void 0===e&&{error:null,status:"pending"}}}function m(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function v(e){let t="function"==typeof e.initialData?e.initialData():e.initialData,r=void 0!==t,i=r?"function"==typeof e.initialDataUpdatedAt?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}e.s(["Query",()=>f,"fetchState",()=>p],86491)},12598,e=>{"use strict";var t=e.i(71645),r=e.i(43476),i=t.createContext(void 0),s=e=>{let r=t.useContext(i);if(e)return e;if(!r)throw Error("No QueryClient set, use QueryClientProvider to set one");return r},n=({client:e,children:s})=>(t.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,r.jsx)(i.Provider,{value:e,children:s}));e.s(["QueryClientProvider",()=>n,"useQueryClient",()=>s])},69230,e=>{"use strict";var t=e.i(75555),r=e.i(40143),i=e.i(86491),s=e.i(15823),n=e.i(93803),a=e.i(19273),o=e.i(80166),l=class extends s.Subscribable{constructor(e,t){super(),this.options=t,this.#c=e,this.#m=null,this.#v=(0,n.pendingThenable)(),this.bindMethods(),this.setOptions(t)}#c;#g=void 0;#y=void 0;#b=void 0;#S;#x;#v;#m;#T;#F;#O;#R;#E;#w;#M=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#g.addObserver(this),u(this.#g,this.options)?this.#C():this.updateResult(),this.#P())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return c(this.#g,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return c(this.#g,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#D(),this.#I(),this.#g.removeObserver(this)}setOptions(e){let t=this.options,r=this.#g;if(this.options=this.#c.defaultQueryOptions(e),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof(0,a.resolveEnabled)(this.options.enabled,this.#g))throw Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#_(),this.#g.setOptions(this.options),t._defaulted&&!(0,a.shallowEqualObjects)(this.options,t)&&this.#c.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#g,observer:this});let i=this.hasListeners();i&&h(this.#g,r,this.options,t)&&this.#C(),this.updateResult(),i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||(0,a.resolveStaleTime)(this.options.staleTime,this.#g)!==(0,a.resolveStaleTime)(t.staleTime,this.#g))&&this.#U();let s=this.#Q();i&&(this.#g!==r||(0,a.resolveEnabled)(this.options.enabled,this.#g)!==(0,a.resolveEnabled)(t.enabled,this.#g)||s!==this.#w)&&this.#k(s)}getOptimisticResult(e){var t,r;let i=this.#c.getQueryCache().build(this.#c,e),s=this.createResult(i,e);return t=this,r=s,(0,a.shallowEqualObjects)(t.getCurrentResult(),r)||(this.#b=s,this.#x=this.options,this.#S=this.#g.state),s}getCurrentResult(){return this.#b}trackResult(e,t){return new Proxy(e,{get:(e,r)=>(this.trackProp(r),t?.(r),"promise"===r&&(this.trackProp("data"),this.options.experimental_prefetchInRender||"pending"!==this.#v.status||this.#v.reject(Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(e,r))})}trackProp(e){this.#M.add(e)}getCurrentQuery(){return this.#g}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#c.defaultQueryOptions(e),r=this.#c.getQueryCache().build(this.#c,t);return r.fetch().then(()=>this.createResult(r,t))}fetch(e){return this.#C({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#b))}#C(e){this.#_();let t=this.#g.fetch(this.options,e);return e?.throwOnError||(t=t.catch(a.noop)),t}#U(){this.#D();let e=(0,a.resolveStaleTime)(this.options.staleTime,this.#g);if(a.isServer||this.#b.isStale||!(0,a.isValidTimeout)(e))return;let t=(0,a.timeUntilStale)(this.#b.dataUpdatedAt,e);this.#R=o.timeoutManager.setTimeout(()=>{this.#b.isStale||this.updateResult()},t+1)}#Q(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#g):this.options.refetchInterval)??!1}#k(e){this.#I(),this.#w=e,!a.isServer&&!1!==(0,a.resolveEnabled)(this.options.enabled,this.#g)&&(0,a.isValidTimeout)(this.#w)&&0!==this.#w&&(this.#E=o.timeoutManager.setInterval(()=>{(this.options.refetchIntervalInBackground||t.focusManager.isFocused())&&this.#C()},this.#w))}#P(){this.#U(),this.#k(this.#Q())}#D(){this.#R&&(o.timeoutManager.clearTimeout(this.#R),this.#R=void 0)}#I(){this.#E&&(o.timeoutManager.clearInterval(this.#E),this.#E=void 0)}createResult(e,t){let r,s=this.#g,o=this.options,l=this.#b,c=this.#S,f=this.#x,p=e!==s?e.state:this.#y,{state:m}=e,v={...m},g=!1;if(t._optimisticResults){let r=this.hasListeners(),n=!r&&u(e,t),a=r&&h(e,s,t,o);(n||a)&&(v={...v,...(0,i.fetchState)(m.data,e.options)}),"isRestoring"===t._optimisticResults&&(v.fetchStatus="idle")}let{error:y,errorUpdatedAt:b,status:S}=v;r=v.data;let x=!1;if(void 0!==t.placeholderData&&void 0===r&&"pending"===S){let e;l?.isPlaceholderData&&t.placeholderData===f?.placeholderData?(e=l.data,x=!0):e="function"==typeof t.placeholderData?t.placeholderData(this.#O?.state.data,this.#O):t.placeholderData,void 0!==e&&(S="success",r=(0,a.replaceData)(l?.data,e,t),g=!0)}if(t.select&&void 0!==r&&!x)if(l&&r===c?.data&&t.select===this.#T)r=this.#F;else try{this.#T=t.select,r=t.select(r),r=(0,a.replaceData)(l?.data,r,t),this.#F=r,this.#m=null}catch(e){this.#m=e}this.#m&&(y=this.#m,r=this.#F,b=Date.now(),S="error");let T="fetching"===v.fetchStatus,F="pending"===S,O="error"===S,R=F&&T,E=void 0!==r,w={status:S,fetchStatus:v.fetchStatus,isPending:F,isSuccess:"success"===S,isError:O,isInitialLoading:R,isLoading:R,data:r,dataUpdatedAt:v.dataUpdatedAt,error:y,errorUpdatedAt:b,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:v.dataUpdateCount>0||v.errorUpdateCount>0,isFetchedAfterMount:v.dataUpdateCount>p.dataUpdateCount||v.errorUpdateCount>p.errorUpdateCount,isFetching:T,isRefetching:T&&!F,isLoadingError:O&&!E,isPaused:"paused"===v.fetchStatus,isPlaceholderData:g,isRefetchError:O&&E,isStale:d(e,t),refetch:this.refetch,promise:this.#v,isEnabled:!1!==(0,a.resolveEnabled)(t.enabled,e)};if(this.options.experimental_prefetchInRender){let t=void 0!==w.data,r="error"===w.status&&!t,i=e=>{r?e.reject(w.error):t&&e.resolve(w.data)},a=()=>{i(this.#v=w.promise=(0,n.pendingThenable)())},o=this.#v;switch(o.status){case"pending":e.queryHash===s.queryHash&&i(o);break;case"fulfilled":(r||w.data!==o.value)&&a();break;case"rejected":r&&w.error===o.reason||a()}}return w}updateResult(){let e=this.#b,t=this.createResult(this.#g,this.options);if(this.#S=this.#g.state,this.#x=this.options,void 0!==this.#S.data&&(this.#O=this.#g),(0,a.shallowEqualObjects)(t,e))return;this.#b=t;let r=()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,r="function"==typeof t?t():t;if("all"===r||!r&&!this.#M.size)return!0;let i=new Set(r??this.#M);return this.options.throwOnError&&i.add("error"),Object.keys(this.#b).some(t=>this.#b[t]!==e[t]&&i.has(t))};this.#L({listeners:r()})}#_(){let e=this.#c.getQueryCache().build(this.#c,this.options);if(e===this.#g)return;let t=this.#g;this.#g=e,this.#y=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#P()}#L(e){r.notifyManager.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#b)}),this.#c.getQueryCache().notify({query:this.#g,type:"observerResultsUpdated"})})}};function u(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&void 0===e.state.data&&("error"!==e.state.status||!1!==t.retryOnMount)||void 0!==e.state.data&&c(e,t,t.refetchOnMount)}function c(e,t,r){if(!1!==(0,a.resolveEnabled)(t.enabled,e)&&"static"!==(0,a.resolveStaleTime)(t.staleTime,e)){let i="function"==typeof r?r(e):r;return"always"===i||!1!==i&&d(e,t)}return!1}function h(e,t,r,i){return(e!==t||!1===(0,a.resolveEnabled)(i.enabled,e))&&(!r.suspense||"error"!==e.state.status)&&d(e,r)}function d(e,t){return!1!==(0,a.resolveEnabled)(t.enabled,e)&&e.isStaleByTime((0,a.resolveStaleTime)(t.staleTime,e))}e.s(["QueryObserver",()=>l])},69637,54440,e=>{"use strict";let t;e.i(47167);var r=e.i(71645),i=e.i(19273),s=e.i(40143),n=e.i(12598);e.i(43476);var a=r.createContext((t=!1,{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t})),o=r.createContext(!1);o.Provider;var l=(e,t)=>void 0===t.state.data,u=e=>{if(e.suspense){let t=e=>"static"===e?e:Math.max(e??1e3,1e3),r=e.staleTime;e.staleTime="function"==typeof r?(...e)=>t(r(...e)):t(r),"number"==typeof e.gcTime&&(e.gcTime=Math.max(e.gcTime,1e3))}},c=(e,t)=>e.isLoading&&e.isFetching&&!t,h=(e,t)=>e?.suspense&&t.isPending,d=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function f(e,t,l){let f,p=r.useContext(o),m=r.useContext(a),v=(0,n.useQueryClient)(l),g=v.defaultQueryOptions(e);v.getDefaultOptions().queries?._experimental_beforeQuery?.(g);let y=v.getQueryCache().get(g.queryHash);g._optimisticResults=p?"isRestoring":"optimistic",u(g),f=y?.state.error&&"function"==typeof g.throwOnError?(0,i.shouldThrowError)(g.throwOnError,[y.state.error,y]):g.throwOnError,(g.suspense||g.experimental_prefetchInRender||f)&&!m.isReset()&&(g.retryOnMount=!1),r.useEffect(()=>{m.clearReset()},[m]);let b=!v.getQueryCache().get(g.queryHash),[S]=r.useState(()=>new t(v,g)),x=S.getOptimisticResult(g),T=!p&&!1!==e.subscribed;if(r.useSyncExternalStore(r.useCallback(e=>{let t=T?S.subscribe(s.notifyManager.batchCalls(e)):i.noop;return S.updateResult(),t},[S,T]),()=>S.getCurrentResult(),()=>S.getCurrentResult()),r.useEffect(()=>{S.setOptions(g)},[g,S]),h(g,x))throw d(g,S,m);if((({result:e,errorResetBoundary:t,throwOnError:r,query:s,suspense:n})=>e.isError&&!t.isReset()&&!e.isFetching&&s&&(n&&void 0===e.data||(0,i.shouldThrowError)(r,[e.error,s])))({result:x,errorResetBoundary:m,throwOnError:g.throwOnError,query:y,suspense:g.suspense}))throw x.error;if(v.getDefaultOptions().queries?._experimental_afterQuery?.(g,x),g.experimental_prefetchInRender&&!i.isServer&&c(x,p)){let e=b?d(g,S,m):y?.promise;e?.catch(i.noop).finally(()=>{S.updateResult()})}return g.notifyOnChangeProps?x:S.trackResult(x)}e.s(["defaultThrowOnError",()=>l,"ensureSuspenseTimers",()=>u,"fetchOptimistic",()=>d,"shouldSuspend",()=>h,"willFetch",()=>c],54440),e.s(["useBaseQuery",()=>f],69637)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/57517f0359971c33.js b/docs/_next/static/chunks/9549e76d03bf90ea.js similarity index 93% rename from docs/_next/static/chunks/57517f0359971c33.js rename to docs/_next/static/chunks/9549e76d03bf90ea.js index 9b2e2fd9..08a722e6 100644 --- a/docs/_next/static/chunks/57517f0359971c33.js +++ b/docs/_next/static/chunks/9549e76d03bf90ea.js @@ -1,8 +1,8 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8597,78140,e=>{"use strict";let t;var r=e.i(71645);let s=(0,r.createContext)(null),n={didCatch:!1,error:null};class i extends r.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=n}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(n))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:s}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,s)&&(this.props.onReset?.({next:s,prev:e.resetKeys,reason:"keys"}),this.setState(n))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:a,error:o}=this.state,A=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)A=t(e);else if(n)A=(0,r.createElement)(n,e);else if(void 0!==i)A=i;else throw o}return(0,r.createElement)(s.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},A)}}e.s(["ErrorBoundary",()=>i],8597);var a=e.i(31067),o=e.i(90072);function A(e,t){if(t===o.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==o.TriangleFanDrawMode&&t!==o.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;etypeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r=2.0 are supported."));return}let o=new et(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});o.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}o.setExtensions(i),o.setPlugins(a),o.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,n){r.parse(e,t,s,n)})}}function h(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let d={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class f{constructor(e){this.parser=e,this.name=d.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class b{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class y{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class L{constructor(e){this.name=d.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],s=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*a);return n.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class x{constructor(e){this.name=d.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==_.TRIANGLES&&e.mode!==_.TRIANGLE_STRIP&&e.mode!==_.TRIANGLE_FAN&&void 0!==e.mode)return null;let s=r.extensions[this.name].attributes,n=[],i={};for(let e in s)n.push(this.parser.getDependency("accessor",s[e]).then(t=>(i[e]=t,i[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],s=e[0].count,n=[];for(let e of r){let t=new o.Matrix4,r=new o.Vector3,a=new o.Quaternion,A=new o.Vector3(1,1,1),l=new o.InstancedMesh(e.geometry,e.material,s);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Z={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},W={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete};function V(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function q(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e){let t="",r=Object.keys(e).sort();for(let s=0,n=r.length;stypeof navigator&&void 0!==navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=(s=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"u"{let r=this.associations.get(e);for(let[s,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[s])};return n(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&i.setY(t,u[e*A+1]),A>=3&&i.setZ(t,u[e*A+2]),A>=4&&i.setW(t,u[e*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,n=t.images[s],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,s,i)}loadTextureImage(e,t,r){let s=this,n=this.json,i=n.textures[e],a=n.images[t],A=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[A])return this.textureCache[A];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=i.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);let r=(n.samplers||{})[i.sampler]||{};return t.magFilter=k[r.magFilter]||o.LinearFilter,t.minFilter=k[r.minFilter]||o.LinearMipmapLinearFilter,t.wrapS=X[r.wrapS]||o.RepeatWrapping,t.wrapT=X[r.wrapT]||o.RepeatWrapping,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){let r=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],i=self.URL||self.webkitURL,a=n.uri||"",A=!1;if(void 0!==n.bufferView)a=this.getDependency("bufferView",n.bufferView).then(function(e){A=!0;let t=new Blob([e],{type:n.mimeType});return a=i.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then(function(e){return new Promise(function(r,n){let i=r;!0===t.isImageBitmapLoader&&(i=function(e){let t=new o.Texture(e);t.needsUpdate=!0,r(t)}),t.load(o.LoaderUtils.resolveURL(e,s.path),i,void 0,n)})}).then(function(e){var t;return!0===A&&i.revokeObjectURL(a),q(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,s){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[d.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[d.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[d.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==s&&("number"==typeof s&&(s=3001===s?c:u),"colorSpace"in i?i.colorSpace=s:i.encoding=s===c?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,s=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.PointsMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.LineBasicMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(s||n||i){let e="ClonedMaterial:"+r.uuid+":";s&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),i&&(t.flatShading=!0),s&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return o.MeshStandardMaterial}loadMaterial(e){let t,r=this,s=this.json,n=this.extensions,i=s.materials[e],a={},A=i.extensions||{},l=[];if(A[d.KHR_MATERIALS_UNLIT]){let e=n[d.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(a,i,r))}else{let s=i.pbrMetallicRoughness||{};if(a.color=new o.Color(1,1,1),a.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],u),a.opacity=e[3]}void 0!==s.baseColorTexture&&l.push(r.assignTexture(a,"map",s.baseColorTexture,c)),a.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,a.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(l.push(r.assignTexture(a,"metalnessMap",s.metallicRoughnessTexture)),l.push(r.assignTexture(a,"roughnessMap",s.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)})))}!0===i.doubleSided&&(a.side=o.DoubleSide);let B=i.alphaMode||"OPAQUE";if("BLEND"===B?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===B&&(a.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new o.Vector2(1,1),void 0!==i.normalTexture.scale)){let e=i.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(a.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==o.MeshBasicMaterial){let e=i.emissiveFactor;a.emissive=new o.Color().setRGB(e[0],e[1],e[2],u)}return void 0!==i.emissiveTexture&&t!==o.MeshBasicMaterial&&l.push(r.assignTexture(a,"emissiveMap",i.emissiveTexture,c)),Promise.all(l).then(function(){let s=new t(a);return i.name&&(s.name=i.name),q(s,i),r.associations.set(s,{materials:e}),i.extensions&&V(n,s,i),s})}createUniqueName(e){let t=o.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,s=this.primitiveCache,n=[];for(let i=0,a=e.length;i0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,s=t.weights.length;r1?new o.Group:1===t.length?t[0]:new o.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of s.associations)(e instanceof o.Material||e instanceof o.Texture)&&t.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,s,n){let i,a=[],A=e.name?e.name:e.uuid,l=[];switch(Z[n.path]===Z.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(A),Z[n.path]){case Z.weights:i=o.NumberKeyframeTrack;break;case Z.rotation:i=o.QuaternionKeyframeTrack;break;case Z.position:case Z.scale:i=o.VectorKeyframeTrack;break;default:i=1===r.itemSize?o.NumberKeyframeTrack:o.VectorKeyframeTrack}let B=void 0!==s.interpolation?W[s.interpolation]:o.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(s)},r,s)}decodeDracoFile(e,t,r,s){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let s=JSON.stringify(t);if(en.has(e)){let t=en.get(e);if(t.key===s)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n=this.workerNextTaskID++,i=e.byteLength,a=this._getWorker(n,i).then(s=>(r=s,new Promise((s,i)=>{r._callbacks[n]={resolve:s,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return a.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),en.set(e,{key:s,promise:a}),a}_createGeometry(e){let t=new es.BufferGeometry;e.index&&t.setIndex(new es.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=ea.toString(),n=["/* draco decoder */",r,"\n/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,s){var n,i,a;let o,A,l,B,c,u,C=s.attributeIDs,h=s.attributeTypes,d=t.GetEncodedGeometryType(r);if(d===e.TRIANGULAR_MESH)c=new e.Mesh,u=t.DecodeBufferToMesh(r,c);else if(d===e.POINT_CLOUD)c=new e.PointCloud,u=t.DecodeBufferToPointCloud(r,c);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||0===c.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());let f={index:null,attributes:[]};for(let r in C){let n,i,a=self[h[r]];if(s.useUniqueIDs)i=C[r],n=t.GetAttributeByUniqueId(c,i);else{if(-1===(i=t.GetAttributeId(c,e[C[r]])))continue;n=t.GetAttribute(c,i)}f.attributes.push(function(e,t,r,s,n,i){let a=i.num_components(),o=r.num_points()*a,A=o*n.BYTES_PER_ELEMENT,l=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,n),B=e._malloc(A);t.GetAttributeDataArrayForAllPoints(r,i,l,A,B);let c=new n(e.HEAPF32.buffer,B,o).slice();return e._free(B),{name:s,array:c,itemSize:a}}(e,t,c,r,a,n))}return d===e.TRIANGULAR_MESH&&(n=e,i=t,a=c,o=3*a.num_faces(),A=4*o,l=n._malloc(A),i.GetTrianglesUInt32Array(a,A,l),B=new Uint32Array(n.HEAPF32.buffer,l,o).slice(),n._free(l),f.index={array:B,itemSize:1}),e.destroy(c),f}(t,r,a,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(a),t.destroy(r)}})}}}var eo=e.i(99143);let eA=function(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;n{let C={keys:B,deep:n,inject:l,castShadow:i,receiveShadow:A};if(Array.isArray(t=r.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return eA(t)}return t},[t,e])))return r.createElement("group",(0,a.default)({},c,{ref:u}),t.map(e=>r.createElement(el,(0,a.default)({key:e.uuid,object:e},C))),s);let{children:h,...d}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:s,inject:n,castShadow:i,receiveShadow:a}){let A={};for(let r of t)A[r]=e[r];return s&&(A.geometry&&"materialsOnly"!==s&&(A.geometry=A.geometry.clone()),A.material&&"geometriesOnly"!==s&&(A.material=A.material.clone())),n&&(A="function"==typeof n?{...A,children:n(e)}:r.isValidElement(n)?{...A,children:n}:{...A,...n}),e instanceof o.Mesh&&(i&&(A.castShadow=!0),a&&(A.receiveShadow=!0)),A}(t,C),f=t.type[0].toLowerCase()+t.type.slice(1);return r.createElement(f,(0,a.default)({},d,c,{ref:u}),t.children.map(e=>"Bone"===e.type?r.createElement("primitive",(0,a.default)({key:e.uuid,object:e},C)):r.createElement(el,(0,a.default)({key:e.uuid,object:e},C,{isChild:!0}))),s,h)}),eB=null,ec="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function eu(e=!0,r=!0,s){return n=>{s&&s(n),e&&(eB||(eB=new ei),eB.setDecoderPath("string"==typeof e?e:ec),n.setDRACOLoader(eB)),r&&n.setMeshoptDecoder((()=>{let e;if(t)return t;let r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(n="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");let i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function a(t,r,s,n,i,a){let o=e.exports.sbrk,A=s+3&-4,l=o(A*n),B=o(i.length),c=new Uint8Array(e.exports.memory.buffer);c.set(i,B);let u=t(l,s,n,B,i.length);if(0===u&&a&&a(l,A,n),r.set(c.subarray(l,l+s*n)),o(l-o(0)),0!==u)throw Error(`Malformed buffer data: ${u}`)}let o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},A={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,s,n,i){a(e.exports.meshopt_decodeVertexBuffer,t,r,s,n,e.exports[o[i]])},decodeIndexBuffer(t,r,s,n){a(e.exports.meshopt_decodeIndexBuffer,t,r,s,n)},decodeIndexSequence(t,r,s,n){a(e.exports.meshopt_decodeIndexSequence,t,r,s,n)},decodeGltfBuffer(t,r,s,n,i,l){a(e.exports[A[i]],t,r,s,n,e.exports[o[l]])}}})())}}let eC=(e,t,r,s)=>(0,eo.useLoader)(C,e,eu(t,r,s));eC.preload=(e,t,r,s)=>eo.useLoader.preload(C,e,eu(t,r,s)),eC.clear=e=>eo.useLoader.clear(C,e),eC.setDecoderPath=e=>{ec=e},e.s(["useGLTF",()=>eC],78140)},82816,e=>{"use strict";function t(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;nt])},25947,71505,6655,e=>{"use strict";var t=e.i(43476),r=e.i(932),s=e.i(71645);let n=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function i(e){return n.test(e)}let a=(0,s.createContext)(null);function o(){let e=(0,s.useContext)(a);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function A(e){let s,n,o,A=(0,r.c)(10),{children:l,object:B,shapeName:c,type:u}=e;A[0]!==c?(s=i(c),A[0]=c,A[1]=s):s=A[1];let C=s;A[2]!==C||A[3]!==B||A[4]!==c||A[5]!==u?(n={object:B,shapeName:c,type:u,isOrganic:C},A[2]=C,A[3]=B,A[4]=c,A[5]=u,A[6]=n):n=A[6];let h=n;return A[7]!==l||A[8]!==h?(o=(0,t.jsx)(a.Provider,{value:h,children:l}),A[7]=l,A[8]=h,A[9]=o):o=A[9],o}e.s(["ShapeInfoProvider",()=>A,"isOrganicShape",()=>i,"useShapeInfo",()=>o],25947);var l=e.i(47071);e.i(47167);var B=e.i(69230),c=e.i(69637),u=e.i(54440),C=e.i(90072),h=e.i(12979),d=e.i(75567),f=e.i(51475),m=e.i(79123);let p=1/30,M=new Map;function F(e){let t=e[0].image,r=t.width,s=t.height,n=e.length,i=Math.ceil(Math.sqrt(n)),a=Math.ceil(n/i),o=document.createElement("canvas");o.width=r*i,o.height=s*a;let A=o.getContext("2d");e.forEach((e,t)=>{let n=Math.floor(t/i);A.drawImage(e.image,t%i*r,n*s)});let l=new C.CanvasTexture(o);return l.colorSpace=C.SRGBColorSpace,l.generateMipmaps=!1,l.minFilter=C.NearestFilter,l.magFilter=C.NearestFilter,l.wrapS=C.ClampToEdgeWrapping,l.wrapT=C.ClampToEdgeWrapping,l.repeat.set(1/i,1/a),{texture:l,columns:i,rows:a,frameCount:n,frameOffsetSeconds:[],totalDurationSeconds:0,lastFrame:-1}}function E(e,t){let r=0;e.frameOffsetSeconds=t.map(e=>r+=e.frameCount*p),e.totalDurationSeconds=r}function G(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,s=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,s/e.rows)}function I(e,t){let r=e.totalDurationSeconds;if(r<=0)return 0;let s=t;s>r&&(s-=r*Math.floor(s/r));for(let t=0;t(0,h.iflTextureToUrl)(t.name,e)),n=F(await Promise.all(s.map(d.loadTextureAsync)));return E(n,r),M.set(e,n),n}function D(e){var t;let s,n,i,a,o=(0,r.c)(14),{animationEnabled:A}=(0,m.useSettings)();o[0]!==e?(s={queryKey:["ifl",e],queryFn:()=>(0,h.loadImageFrameList)(e)},o[0]=e,o[1]=s):s=o[1];let{data:C}=(t=s,(0,c.useBaseQuery)({...t,enabled:!0,suspense:!0,throwOnError:u.defaultThrowOnError,placeholderData:void 0},B.QueryObserver,void 0));if(o[2]!==C||o[3]!==e){let t;o[5]!==e?(t=t=>(0,h.iflTextureToUrl)(t.name,e),o[5]=e,o[6]=t):t=o[6],n=C.map(t),o[2]=C,o[3]=e,o[4]=n}else n=o[4];let d=n,p=(0,l.useTexture)(d);o[7]!==C||o[8]!==e||o[9]!==p?((i=M.get(e))||(i=F(p),M.set(e,i)),E(i,C),o[7]=C,o[8]=e,o[9]=p,o[10]=i):i=o[10];let g=i;return o[11]!==A||o[12]!==g?(a=e=>{let t=e/f.TICK_RATE,r=A?I(g,t):0;G(g,r)},o[11]=A,o[12]=g,o[13]=a):a=o[13],(0,f.useTick)(a),g.texture}e.s(["getFrameIndexForTime",()=>I,"loadIflAtlas",()=>g,"updateAtlasFrame",()=>G,"useIflTexture",()=>D],71505);function R(e){e.uniforms.shapeDirectionalFactor={value:1},e.uniforms.shapeAmbientFactor={value:1.5},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,8597,78140,e=>{"use strict";let t;var r=e.i(71645);let s=(0,r.createContext)(null),n={didCatch:!1,error:null};class i extends r.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=n}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(n))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:s}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,s)&&(this.props.onReset?.({next:s,prev:e.resetKeys,reason:"keys"}),this.setState(n))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:a,error:o}=this.state,A=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)A=t(e);else if(n)A=(0,r.createElement)(n,e);else if(void 0!==i)A=i;else throw o}return(0,r.createElement)(s.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},A)}}e.s(["ErrorBoundary",()=>i],8597);var a=e.i(31067),o=e.i(90072);function A(e,t){if(t===o.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==o.TriangleFanDrawMode&&t!==o.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;etypeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r=2.0 are supported."));return}let o=new et(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});o.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}o.setExtensions(i),o.setPlugins(a),o.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,n){r.parse(e,t,s,n)})}}function h(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let d={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class f{constructor(e){this.parser=e,this.name=d.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class b{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class y{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class L{constructor(e){this.name=d.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],s=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*a);return n.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class x{constructor(e){this.name=d.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==_.TRIANGLES&&e.mode!==_.TRIANGLE_STRIP&&e.mode!==_.TRIANGLE_FAN&&void 0!==e.mode)return null;let s=r.extensions[this.name].attributes,n=[],i={};for(let e in s)n.push(this.parser.getDependency("accessor",s[e]).then(t=>(i[e]=t,i[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],s=e[0].count,n=[];for(let e of r){let t=new o.Matrix4,r=new o.Vector3,a=new o.Quaternion,A=new o.Vector3(1,1,1),l=new o.InstancedMesh(e.geometry,e.material,s);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Z={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},W={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete};function V(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function q(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e){let t="",r=Object.keys(e).sort();for(let s=0,n=r.length;stypeof navigator&&void 0!==navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=(s=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"u"{let r=this.associations.get(e);for(let[s,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[s])};return n(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&i.setY(t,u[e*A+1]),A>=3&&i.setZ(t,u[e*A+2]),A>=4&&i.setW(t,u[e*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,n=t.images[s],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,s,i)}loadTextureImage(e,t,r){let s=this,n=this.json,i=n.textures[e],a=n.images[t],A=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[A])return this.textureCache[A];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=i.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);let r=(n.samplers||{})[i.sampler]||{};return t.magFilter=k[r.magFilter]||o.LinearFilter,t.minFilter=k[r.minFilter]||o.LinearMipmapLinearFilter,t.wrapS=X[r.wrapS]||o.RepeatWrapping,t.wrapT=X[r.wrapT]||o.RepeatWrapping,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){let r=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],i=self.URL||self.webkitURL,a=n.uri||"",A=!1;if(void 0!==n.bufferView)a=this.getDependency("bufferView",n.bufferView).then(function(e){A=!0;let t=new Blob([e],{type:n.mimeType});return a=i.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then(function(e){return new Promise(function(r,n){let i=r;!0===t.isImageBitmapLoader&&(i=function(e){let t=new o.Texture(e);t.needsUpdate=!0,r(t)}),t.load(o.LoaderUtils.resolveURL(e,s.path),i,void 0,n)})}).then(function(e){var t;return!0===A&&i.revokeObjectURL(a),q(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,s){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[d.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[d.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[d.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==s&&("number"==typeof s&&(s=3001===s?c:u),"colorSpace"in i?i.colorSpace=s:i.encoding=s===c?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,s=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.PointsMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.LineBasicMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(s||n||i){let e="ClonedMaterial:"+r.uuid+":";s&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),i&&(t.flatShading=!0),s&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return o.MeshStandardMaterial}loadMaterial(e){let t,r=this,s=this.json,n=this.extensions,i=s.materials[e],a={},A=i.extensions||{},l=[];if(A[d.KHR_MATERIALS_UNLIT]){let e=n[d.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(a,i,r))}else{let s=i.pbrMetallicRoughness||{};if(a.color=new o.Color(1,1,1),a.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],u),a.opacity=e[3]}void 0!==s.baseColorTexture&&l.push(r.assignTexture(a,"map",s.baseColorTexture,c)),a.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,a.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(l.push(r.assignTexture(a,"metalnessMap",s.metallicRoughnessTexture)),l.push(r.assignTexture(a,"roughnessMap",s.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)})))}!0===i.doubleSided&&(a.side=o.DoubleSide);let B=i.alphaMode||"OPAQUE";if("BLEND"===B?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===B&&(a.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new o.Vector2(1,1),void 0!==i.normalTexture.scale)){let e=i.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(a.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==o.MeshBasicMaterial){let e=i.emissiveFactor;a.emissive=new o.Color().setRGB(e[0],e[1],e[2],u)}return void 0!==i.emissiveTexture&&t!==o.MeshBasicMaterial&&l.push(r.assignTexture(a,"emissiveMap",i.emissiveTexture,c)),Promise.all(l).then(function(){let s=new t(a);return i.name&&(s.name=i.name),q(s,i),r.associations.set(s,{materials:e}),i.extensions&&V(n,s,i),s})}createUniqueName(e){let t=o.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,s=this.primitiveCache,n=[];for(let i=0,a=e.length;i0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,s=t.weights.length;r1?new o.Group:1===t.length?t[0]:new o.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of s.associations)(e instanceof o.Material||e instanceof o.Texture)&&t.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,s,n){let i,a=[],A=e.name?e.name:e.uuid,l=[];switch(Z[n.path]===Z.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(A),Z[n.path]){case Z.weights:i=o.NumberKeyframeTrack;break;case Z.rotation:i=o.QuaternionKeyframeTrack;break;case Z.position:case Z.scale:i=o.VectorKeyframeTrack;break;default:i=1===r.itemSize?o.NumberKeyframeTrack:o.VectorKeyframeTrack}let B=void 0!==s.interpolation?W[s.interpolation]:o.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(s)},r,s)}decodeDracoFile(e,t,r,s){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let s=JSON.stringify(t);if(en.has(e)){let t=en.get(e);if(t.key===s)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n=this.workerNextTaskID++,i=e.byteLength,a=this._getWorker(n,i).then(s=>(r=s,new Promise((s,i)=>{r._callbacks[n]={resolve:s,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return a.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),en.set(e,{key:s,promise:a}),a}_createGeometry(e){let t=new es.BufferGeometry;e.index&&t.setIndex(new es.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=ea.toString(),n=["/* draco decoder */",r,"\n/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,s){var n,i,a;let o,A,l,B,c,u,C=s.attributeIDs,h=s.attributeTypes,d=t.GetEncodedGeometryType(r);if(d===e.TRIANGULAR_MESH)c=new e.Mesh,u=t.DecodeBufferToMesh(r,c);else if(d===e.POINT_CLOUD)c=new e.PointCloud,u=t.DecodeBufferToPointCloud(r,c);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||0===c.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());let f={index:null,attributes:[]};for(let r in C){let n,i,a=self[h[r]];if(s.useUniqueIDs)i=C[r],n=t.GetAttributeByUniqueId(c,i);else{if(-1===(i=t.GetAttributeId(c,e[C[r]])))continue;n=t.GetAttribute(c,i)}f.attributes.push(function(e,t,r,s,n,i){let a=i.num_components(),o=r.num_points()*a,A=o*n.BYTES_PER_ELEMENT,l=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,n),B=e._malloc(A);t.GetAttributeDataArrayForAllPoints(r,i,l,A,B);let c=new n(e.HEAPF32.buffer,B,o).slice();return e._free(B),{name:s,array:c,itemSize:a}}(e,t,c,r,a,n))}return d===e.TRIANGULAR_MESH&&(n=e,i=t,a=c,o=3*a.num_faces(),A=4*o,l=n._malloc(A),i.GetTrianglesUInt32Array(a,A,l),B=new Uint32Array(n.HEAPF32.buffer,l,o).slice(),n._free(l),f.index={array:B,itemSize:1}),e.destroy(c),f}(t,r,a,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(a),t.destroy(r)}})}}}var eo=e.i(99143);let eA=function(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;n{let C={keys:B,deep:n,inject:l,castShadow:i,receiveShadow:A};if(Array.isArray(t=r.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return eA(t)}return t},[t,e])))return r.createElement("group",(0,a.default)({},c,{ref:u}),t.map(e=>r.createElement(el,(0,a.default)({key:e.uuid,object:e},C))),s);let{children:h,...d}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:s,inject:n,castShadow:i,receiveShadow:a}){let A={};for(let r of t)A[r]=e[r];return s&&(A.geometry&&"materialsOnly"!==s&&(A.geometry=A.geometry.clone()),A.material&&"geometriesOnly"!==s&&(A.material=A.material.clone())),n&&(A="function"==typeof n?{...A,children:n(e)}:r.isValidElement(n)?{...A,children:n}:{...A,...n}),e instanceof o.Mesh&&(i&&(A.castShadow=!0),a&&(A.receiveShadow=!0)),A}(t,C),f=t.type[0].toLowerCase()+t.type.slice(1);return r.createElement(f,(0,a.default)({},d,c,{ref:u}),t.children.map(e=>"Bone"===e.type?r.createElement("primitive",(0,a.default)({key:e.uuid,object:e},C)):r.createElement(el,(0,a.default)({key:e.uuid,object:e},C,{isChild:!0}))),s,h)}),eB=null,ec="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function eu(e=!0,r=!0,s){return n=>{s&&s(n),e&&(eB||(eB=new ei),eB.setDecoderPath("string"==typeof e?e:ec),n.setDRACOLoader(eB)),r&&n.setMeshoptDecoder((()=>{let e;if(t)return t;let r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(n="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");let i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function a(t,r,s,n,i,a){let o=e.exports.sbrk,A=s+3&-4,l=o(A*n),B=o(i.length),c=new Uint8Array(e.exports.memory.buffer);c.set(i,B);let u=t(l,s,n,B,i.length);if(0===u&&a&&a(l,A,n),r.set(c.subarray(l,l+s*n)),o(l-o(0)),0!==u)throw Error(`Malformed buffer data: ${u}`)}let o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},A={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,s,n,i){a(e.exports.meshopt_decodeVertexBuffer,t,r,s,n,e.exports[o[i]])},decodeIndexBuffer(t,r,s,n){a(e.exports.meshopt_decodeIndexBuffer,t,r,s,n)},decodeIndexSequence(t,r,s,n){a(e.exports.meshopt_decodeIndexSequence,t,r,s,n)},decodeGltfBuffer(t,r,s,n,i,l){a(e.exports[A[i]],t,r,s,n,e.exports[o[l]])}}})())}}let eC=(e,t,r,s)=>(0,eo.useLoader)(C,e,eu(t,r,s));eC.preload=(e,t,r,s)=>eo.useLoader.preload(C,e,eu(t,r,s)),eC.clear=e=>eo.useLoader.clear(C,e),eC.setDecoderPath=e=>{ec=e},e.s(["useGLTF",()=>eC],78140)},82816,e=>{"use strict";function t(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;nt])},25947,54452,e=>{"use strict";var t=e.i(43476),r=e.i(932),s=e.i(71645);let n=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function i(e){return n.test(e)}let a=(0,s.createContext)(null);function o(){let e=(0,s.useContext)(a);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function A(e){let s,n,o,A=(0,r.c)(10),{children:l,object:B,shapeName:c,type:u}=e;A[0]!==c?(s=i(c),A[0]=c,A[1]=s):s=A[1];let C=s;A[2]!==C||A[3]!==B||A[4]!==c||A[5]!==u?(n={object:B,shapeName:c,type:u,isOrganic:C},A[2]=C,A[3]=B,A[4]=c,A[5]=u,A[6]=n):n=A[6];let h=n;return A[7]!==l||A[8]!==h?(o=(0,t.jsx)(a.Provider,{value:h,children:l}),A[7]=l,A[8]=h,A[9]=o):o=A[9],o}e.s(["ShapeInfoProvider",()=>A,"isOrganicShape",()=>i,"useShapeInfo",()=>o],25947),e.i(47167);var l=e.i(69230),B=e.i(69637),c=e.i(54440);function u(e,t){return(0,B.useBaseQuery)({...e,enabled:!0,suspense:!0,throwOnError:c.defaultThrowOnError,placeholderData:void 0},l.QueryObserver,t)}e.s(["useSuspenseQuery",()=>u],54452)},51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(71753);let n=(0,r.createContext)(null);function i({children:e}){let i=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,s.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,i.current)for(let e of i.current)e(o.current)});let A=(0,r.useCallback)(e=>(i.current??=new Set,i.current.add(e),()=>{i.current.delete(e)}),[]),l=(0,r.useCallback)(()=>o.current,[]),B=(0,r.useCallback)(()=>a.current/.03125,[]),c=(0,r.useMemo)(()=>({subscribe:A,getTick:l,getTickFraction:B}),[A,l,B]);return(0,t.jsx)(n.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(n);if(!t)throw Error("useTick must be used within a TickProvider");let s=(0,r.useRef)(e);s.current=e,(0,r.useEffect)(()=>t.subscribe(e=>s.current(e)),[t])}function o(){let e=(0,r.useContext)(n);if(!e)throw Error("useGetTickFraction must be used within a TickProvider");return e.getTickFraction}e.s(["TICK_RATE",0,32,"TickProvider",()=>i,"useGetTickFraction",()=>o,"useTick",()=>a])},71505,6655,e=>{"use strict";var t=e.i(932),r=e.i(47071),s=e.i(54452),n=e.i(90072),i=e.i(12979),a=e.i(75567),o=e.i(51475),A=e.i(79123);let l=1/30,B=new Map;function c(e){let t=e[0].image,r=t.width,s=t.height,i=e.length,a=Math.ceil(Math.sqrt(i)),o=Math.ceil(i/a),A=document.createElement("canvas");A.width=r*a,A.height=s*o;let l=A.getContext("2d");e.forEach((e,t)=>{let n=Math.floor(t/a);l.drawImage(e.image,t%a*r,n*s)});let B=new n.CanvasTexture(A);return B.colorSpace=n.SRGBColorSpace,B.generateMipmaps=!1,B.minFilter=n.NearestFilter,B.magFilter=n.NearestFilter,B.wrapS=n.ClampToEdgeWrapping,B.wrapT=n.ClampToEdgeWrapping,B.repeat.set(1/a,1/o),{texture:B,columns:a,rows:o,frameCount:i,frameOffsetSeconds:[],totalDurationSeconds:0,lastFrame:-1}}function u(e,t){let r=0;e.frameOffsetSeconds=t.map(e=>r+=e.frameCount*l),e.totalDurationSeconds=r}function C(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,s=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,s/e.rows)}function h(e,t){let r=e.totalDurationSeconds;if(r<=0)return 0;let s=t;s>r&&(s-=r*Math.floor(s/r));for(let t=0;t(0,i.iflTextureToUrl)(t.name,e)),n=c(await Promise.all(s.map(a.loadTextureAsync)));return u(n,r),B.set(e,n),n}function f(e){let n,a,l,d,f=(0,t.c)(14),{animationEnabled:m}=(0,A.useSettings)();f[0]!==e?(n={queryKey:["ifl",e],queryFn:()=>(0,i.loadImageFrameList)(e)},f[0]=e,f[1]=n):n=f[1];let{data:p}=(0,s.useSuspenseQuery)(n);if(f[2]!==p||f[3]!==e){let t;f[5]!==e?(t=t=>(0,i.iflTextureToUrl)(t.name,e),f[5]=e,f[6]=t):t=f[6],a=p.map(t),f[2]=p,f[3]=e,f[4]=a}else a=f[4];let M=a,F=(0,r.useTexture)(M);f[7]!==p||f[8]!==e||f[9]!==F?((l=B.get(e))||(l=c(F),B.set(e,l)),u(l,p),f[7]=p,f[8]=e,f[9]=F,f[10]=l):l=f[10];let E=l;return f[11]!==m||f[12]!==E?(d=e=>{let t=e/o.TICK_RATE,r=m?h(E,t):0;C(E,r)},f[11]=m,f[12]=E,f[13]=d):d=f[13],(0,o.useTick)(d),E.texture}e.s(["getFrameIndexForTime",()=>h,"loadIflAtlas",()=>d,"updateAtlasFrame",()=>C,"useIflTexture",()=>f],71505);function m(e){e.uniforms.shapeDirectionalFactor={value:1},e.uniforms.shapeAmbientFactor={value:1.5},e.fragmentShader=e.fragmentShader.replace("#include ",`#include uniform float shapeDirectionalFactor; uniform float shapeAmbientFactor; `),e.fragmentShader=e.fragmentShader.replace("#include ",`#include // Apply shape-specific lighting multipliers reflectedLight.directDiffuse *= shapeDirectionalFactor; reflectedLight.indirectDiffuse *= shapeAmbientFactor; -`)}e.s(["injectShapeLighting",()=>R],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"disposeClonedScene",()=>D,"entityTypeColor",()=>R,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1,o={}){let A=e.userData?.resource_path,l=new Set(e.userData?.flag_names??[]);if(!A){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(l.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,l,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,A,t,r)}}return{material:t,initialize:(e,r)=>I(t,A,e,r)}}let B=(0,a.textureToUrl)(A),c=(0,i.loadTexture)(B),u=l.has("Translucent");n||u?(0,i.setupTexture)(c,{disableMipmaps:!0,anisotropy:o.anisotropy}):(0,i.setupTexture)(c,{anisotropy:o.anisotropy});let C=(0,r.createMaterialFromFlags)(e,c,l,n,s);return Array.isArray(C)?{material:C[1],backMaterial:C[0]}:{material:C}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t,r={}){var n;let i,a=[],o=!!t&&(0,s.isOrganicShape)(t),A=null;e.traverse(e=>{!A&&e.skeleton&&(A=e.skeleton)});let l=A?(n=A,i=new Set,n.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&i.add(t)}),i):new Set,B=[];for(let{parent:t,mesh:s}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;(e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry&&(!function(e,t){if(0===t.size||!e.attributes.skinIndex)return;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index;if(!n)return;let i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}let a=[],o=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(e.geometry));let s=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let n=G(t,s,o,r);if(n.initialize&&a.push({mesh:e,initialize:n.initialize}),n.backMaterial&&e.parent){let t=e.clone();t.material=n.backMaterial,B.push({parent:e.parent,mesh:t})}return n.material});else if(e.material){let t=G(e.material,s,o,r);if(t.initialize&&a.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,B.push({parent:e.parent,mesh:r})}}}),B))t.add(s);return a}function D(e){e.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.dispose()})}function R(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>R,"ShapeRenderer",()=>b,"applyShapeShaderModifications",()=>I,"createMaterialFromFlags",()=>g,"useStaticShape",()=>D]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(56893)),u=e.i(79123),C=e.i(25947),h=e.i(58647),d=e.i(89887),f=e.i(71505),m=e.i(47021),p=e.i(48066),M=e.i(6655),F=e.i(85557);let E=(0,o.createLogger)("GenericShape");function G(){let{recording:e}=h.engineStore.getState().playback;return null!=e?(0,h.effectNow)()/1e3:performance.now()/1e3}function I(e){e.onBeforeCompile=t=>{(0,m.injectCustomFog)(t,p.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,M.injectShapeLighting)(t)}}function g(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return I(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return I(r),I(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return I(c),c}function D(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function R(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(d.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function T(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,u.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(R,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let H=new Set(["octahedron.dts"]);function J(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,u.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(d.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let b=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:u,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,C.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(T,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(H.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(J,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(T,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(R,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==u?(o=(0,t.jsx)(L,{streamEntity:u}),B[8]=u,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),y=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,C.useShapeInfo)(),{debugMode:o}=(0,u.useDebug)(),{animationEnabled:A}=(0,u.useSettings)(),m=(0,h.useEngineSelector)(e=>e.runtime.runtime),p=(0,c.useAnisotropy)(),{clonedScene:M,mixer:I,clipsByName:g,visNodesBySequence:D,iflMeshes:R}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,F.processShapeScene)(t,i??void 0,{anisotropy:p}),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e,p]);(0,s.useEffect)(()=>()=>{(0,F.disposeClonedScene)(M),I?.uncacheRoot(M)},[M,I]);let T=(0,s.useRef)(new Map),H=(0,s.useRef)(new Map),J=(0,s.useRef)([]),b=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let y=(0,s.useRef)(r);y.current=r;let L=(0,s.useRef)(null),x=(0,s.useRef)(null),S=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(J.current=[],H.current.clear(),R))(0,f.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};J.current.push(s),H.current.set(e.mesh,t)}).catch(t=>{E.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[R]);let O=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=T.current,t=null==y.current;function r(t,r){let n=r.toLowerCase();s(t);let i=g.get(n),a=D.get(n),o={sequence:n,startTime:G()};if(i&&I){let e=I.clipAction(i);O.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,F.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=H.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(L.current=r,x.current=s,!t)return()=>{for(let t of(L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(m&&(i.push(m.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(m.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(m.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(g.has(a)||D.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)}},[I,g,D,O,n,m]);let U=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=T.current,s=null!=y.current,n=h.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=y.current?.threads,o=S.current;if(a!==o){let e=L.current,t=x.current;if(e&&t){S.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(b.current+=i,B)){if(!A){(0,f.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=G()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,t))}else(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,b.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:M}),o?(0,t.jsxs)(d.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function L(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,C.useShapeInfo)(),o=D(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(y,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file +`)}e.s(["injectShapeLighting",()=>m],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"disposeClonedScene",()=>R,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1,o={}){let A=e.userData?.resource_path,l=new Set(e.userData?.flag_names??[]);if(!A){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(l.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,l,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,A,t,r)}}return{material:t,initialize:(e,r)=>I(t,A,e,r)}}let B=(0,a.textureToUrl)(A),c=(0,i.loadTexture)(B),u=l.has("Translucent");n||u?(0,i.setupTexture)(c,{disableMipmaps:!0,anisotropy:o.anisotropy}):(0,i.setupTexture)(c,{anisotropy:o.anisotropy});let C=(0,r.createMaterialFromFlags)(e,c,l,n,s);return Array.isArray(C)?{material:C[1],backMaterial:C[0]}:{material:C}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t,r={}){var n;let i,a=[],o=!!t&&(0,s.isOrganicShape)(t),A=null;e.traverse(e=>{!A&&e.skeleton&&(A=e.skeleton)});let l=A?(n=A,i=new Set,n.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&i.add(t)}),i):new Set,B=[];for(let{parent:t,mesh:s}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;(e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry&&(!function(e,t){if(0===t.size||!e.attributes.skinIndex)return;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index;if(!n)return;let i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}let a=[],o=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(e.geometry));let s=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let n=G(t,s,o,r);if(n.initialize&&a.push({mesh:e,initialize:n.initialize}),n.backMaterial&&e.parent){let t=e.clone();t.material=n.backMaterial,B.push({parent:e.parent,mesh:t})}return n.material});else if(e.material){let t=G(e.material,s,o,r);if(t.initialize&&a.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,B.push({parent:e.parent,mesh:r})}}}),B))t.add(s);return a}function R(e){e.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.dispose()})}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>D,"ShapeRenderer",()=>b,"applyShapeShaderModifications",()=>I,"createMaterialFromFlags",()=>g,"useStaticShape",()=>R]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(56893)),u=e.i(79123),C=e.i(25947),h=e.i(58647),d=e.i(89887),f=e.i(71505),m=e.i(47021),p=e.i(48066),M=e.i(6655),F=e.i(85557);let E=(0,o.createLogger)("GenericShape");function G(){let{recording:e}=h.engineStore.getState().playback;return null!=e?(0,h.effectNow)()/1e3:performance.now()/1e3}function I(e){e.onBeforeCompile=t=>{(0,m.injectCustomFog)(t,p.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,M.injectShapeLighting)(t)}}function g(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return I(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return I(r),I(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return I(c),c}function R(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function D(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(d.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function T(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,u.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(D,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let H=new Set(["octahedron.dts"]);function J(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,u.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(d.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let b=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:u,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,C.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(T,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(H.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(J,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(T,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(D,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==u?(o=(0,t.jsx)(L,{streamEntity:u}),B[8]=u,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),y=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,C.useShapeInfo)(),{debugMode:o}=(0,u.useDebug)(),{animationEnabled:A}=(0,u.useSettings)(),m=(0,h.useEngineSelector)(e=>e.runtime.runtime),p=(0,c.useAnisotropy)(),{clonedScene:M,mixer:I,clipsByName:g,visNodesBySequence:R,iflMeshes:D}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,F.processShapeScene)(t,i??void 0,{anisotropy:p}),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e,p]);(0,s.useEffect)(()=>()=>{(0,F.disposeClonedScene)(M),I?.uncacheRoot(M)},[M,I]);let T=(0,s.useRef)(new Map),H=(0,s.useRef)(new Map),J=(0,s.useRef)([]),b=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let y=(0,s.useRef)(r);y.current=r;let L=(0,s.useRef)(null),x=(0,s.useRef)(null),S=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(J.current=[],H.current.clear(),D))(0,f.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};J.current.push(s),H.current.set(e.mesh,t)}).catch(t=>{E.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[D]);let O=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=T.current,t=null==y.current;function r(t,r){let n=r.toLowerCase();s(t);let i=g.get(n),a=R.get(n),o={sequence:n,startTime:G()};if(i&&I){let e=I.clipAction(i);O.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,F.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=H.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(L.current=r,x.current=s,!t)return()=>{for(let t of(L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(m&&(i.push(m.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(m.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(m.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(g.has(a)||R.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)}},[I,g,R,O,n,m]);let U=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=T.current,s=null!=y.current,n=h.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=y.current?.threads,o=S.current;if(a!==o){let e=L.current,t=x.current;if(e&&t){S.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(b.current+=i,B)){if(!A){(0,f.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=G()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,t))}else(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,b.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:M}),o?(0,t.jsxs)(d.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function L(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,C.useShapeInfo)(),o=R(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(y,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/967c4aa315f919d7.js b/docs/_next/static/chunks/967c4aa315f919d7.js new file mode 100644 index 00000000..6fa0fbad --- /dev/null +++ b/docs/_next/static/chunks/967c4aa315f919d7.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66069,e=>{"use strict";var t=e.i(932),n=e.i(71645),r=e.i(71753),c=e.i(15080),u=e.i(79123),i=e.i(66093),l=e.i(65349);function o(){let e,o,a,h,m,d=(0,t.c)(17),{speedMultiplier:f,touchMode:v,invertDrag:E,invertJoystick:g}=(0,u.useControls)(),M=(0,c.useThree)(s),{moveState:T,lookState:L}=(0,i.useJoystick)(),k=(0,l.useOnInput)(),p=(0,n.useRef)(null);d[0]===Symbol.for("react.memo_cache_sentinel")?(e={x:0,y:0},d[0]=e):e=d[0];let b=(0,n.useRef)(e);d[1]!==E?(o=()=>E,d[1]=E,d[2]=o):o=d[2];let x=(0,n.useEffectEvent)(o),y=(0,n.useRef)(0),R=(0,n.useRef)(0);return d[3]!==x||d[4]!==M.domElement||d[5]!==v?(a=()=>{if("moveLookStick"!==v)return;let e=M.domElement,t=e=>{if(null===p.current)for(;0{if(null!==p.current)for(let t=0;t{for(let t=0;t{e.removeEventListener("touchstart",t),e.removeEventListener("touchmove",n),e.removeEventListener("touchend",r),e.removeEventListener("touchcancel",r),p.current=null}},d[3]=x,d[4]=M.domElement,d[5]=v,d[6]=a):a=d[6],d[7]!==M.domElement||d[8]!==v?(h=[M.domElement,v],d[7]=M.domElement,d[8]=v,d[9]=h):h=d[9],(0,n.useEffect)(a,h),d[10]!==g||d[11]!==L.current||d[12]!==T.current||d[13]!==k||d[14]!==f||d[15]!==v?(m=(e,t)=>{let{force:n,angle:r}=T.current,{force:c,angle:u}=L.current,i=y.current,l=R.current;y.current=0,R.current=0;let o=0,s=0;if("dualStick"===v){if(c>.15){let e=(c-.15)/.85,n=Math.cos(u),r=Math.sin(u),o=g?-1:1;i-=o*n*e*2.5*t,l+=o*r*e*2.5*t}if(n>.08){let e=(n-.08)/.92,t=Math.cos(r),c=Math.sin(r);o=Math.max(-1,Math.min(1,-t*e*f)),s=Math.max(-1,Math.min(1,c*e*f))}}else if("moveLookStick"===v&&n>0&&(s=Math.max(-1,Math.min(1,.5*f)),n>=.15)){let e=Math.cos(r),c=Math.sin(r),u=(n-.15)/.85,o=g?-1:1;i-=o*e*u*1.25*t,l+=o*c*u*1.25*t}let a=0!==o||0!==s;(0!==i||0!==l||a)&&k({deltaYaw:i,deltaPitch:l,x:o,y:s,z:0,triggers:[],delta:t})},d[10]=g,d[11]=L.current,d[12]=T.current,d[13]=k,d[14]=f,d[15]=v,d[16]=m):m=d[16],(0,r.useFrame)(m),null}function s(e){return e.gl}e.s(["TouchHandler",()=>o])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/990cfb71eaf1c762.js b/docs/_next/static/chunks/990cfb71eaf1c762.js new file mode 100644 index 00000000..48c4332e --- /dev/null +++ b/docs/_next/static/chunks/990cfb71eaf1c762.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,66027,e=>{"use strict";var t=e.i(69230),s=e.i(69637);function n(e,n){return(0,s.useBaseQuery)(e,t.QueryObserver,n)}e.s(["useQuery",()=>n])},9672,e=>{"use strict";function t(e,t){return e[t.toLowerCase()]}function s(e,s){let n=t(e,s);if(null==n)return;let i=parseFloat(n);return Number.isFinite(i)?i:void 0}function n(e,s){let n=t(e,s);if(null==n)return;let i=parseInt(n,10);return Number.isFinite(i)?i:void 0}function i(e,t={x:0,y:0,z:0}){if(!e)return t;let s=e.split(" ").map(Number);return{x:s[0]??t.x,y:s[1]??t.y,z:s[2]??t.z}}function r(e,t={r:0,g:0,b:0}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b}}function a(e,t={r:.5,g:.5,b:.5,a:1}){if(!e)return t;let s=e.split(" ").map(Number);return{r:s[0]??t.r,g:s[1]??t.g,b:s[2]??t.b,a:s[3]??t.a}}function o(e,t){let s=i(e),n=(t??"1 0 0 0").split(" ").map(Number),r=n[0]??1,a=n[1]??0,o=n[2]??0,l=Math.PI/180*(n[3]??0),c=Math.sqrt(r*r+a*a+o*o),u=0,d=0,m=1;c>1e-8&&(u=r/c,d=a/c,m=o/c);let h=Math.cos(l),p=Math.sin(l),g=1-h,y=Array(16).fill(0);return y[0]=g*u*u+h,y[1]=g*u*d+p*m,y[2]=g*u*m-p*d,y[4]=g*u*d-p*m,y[5]=g*d*d+h,y[6]=g*d*m+p*u,y[8]=g*u*m+p*d,y[9]=g*d*m-p*u,y[10]=g*m*m+h,y[12]=s.x,y[13]=s.y,y[14]=s.z,y[15]=1,{elements:y,position:s}}function l(e){return{className:"TerrainBlock",ghostIndex:e._id,terrFileName:t(e,"terrainFile")??"",detailTextureName:t(e,"detailTexture")??"",squareSize:n(e,"squareSize")??8,emptySquareRuns:function(e){if(!e)return;let t=e.split(/\s+/).map(Number).filter(Number.isFinite);return t.length>0?t:void 0}(t(e,"emptySquares"))}}function c(e){return{className:"InteriorInstance",ghostIndex:e._id,interiorFile:t(e,"interiorFile")??"",transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),showTerrainInside:"1"===t(e,"showTerrainInside"),skinBase:t(e,"skinBase")??"",alarmState:!1}}function u(e){let a=[];for(let s=1;s<=3;s++){let n=function(e){if(!e)return null;let t=e.split(/\s+/).map(Number),s=t[0]??0,n=t[1]??0,i=t[2]??0;return 0===s&&0===n&&0===i?null:{visibleDistance:s,minHeight:n,maxHeight:i,color:{r:.5,g:.5,b:.5}}}(t(e,`fogVolume${s}`));n&&a.push(n)}let o=[];for(let n=0;n<3;n++){let i=t(e,`cloudText${n+1}`)??"",r=s(e,`cloudHeightPer[${n}]`)??s(e,`cloudheightper${n}`)??[.35,.25,.2][n],a=s(e,`cloudSpeed${n+1}`)??[1e-4,2e-4,3e-4][n];o.push({texture:i,heightPercent:r,speed:a})}return{className:"Sky",ghostIndex:e._id,materialList:t(e,"materialList")??"",fogColor:r(t(e,"fogColor")),visibleDistance:s(e,"visibleDistance")??1e3,fogDistance:s(e,"fogDistance")??0,skySolidColor:r(t(e,"SkySolidColor")),useSkyTextures:(n(e,"useSkyTextures")??1)!==0,fogVolumes:a,cloudLayers:o,windVelocity:i(t(e,"windVelocity"))}}function d(e){return{className:"Sun",ghostIndex:e._id,direction:i(t(e,"direction"),{x:.57735,y:.57735,z:-.57735}),color:a(t(e,"color"),{r:.7,g:.7,b:.7,a:1}),ambient:a(t(e,"ambient"),{r:.5,g:.5,b:.5,a:1})}}function m(e){let n=t(e,"area"),i={x:-512,y:-512,w:1024,h:1024};if(n){let e=n.split(/\s+/).map(Number);i={x:e[0]??i.x,y:e[1]??i.y,w:e[2]??i.w,h:e[3]??i.h}}return{className:"MissionArea",ghostIndex:e._id,area:i,flightCeiling:s(e,"flightCeiling")??2e3,flightCeilingRange:s(e,"flightCeilingRange")??50}}function h(e){return{className:"WaterBlock",ghostIndex:e._id,transform:o(t(e,"position"),t(e,"rotation")),scale:i(t(e,"scale"),{x:1,y:1,z:1}),surfaceName:t(e,"surfaceTexture")??"",envMapName:t(e,"envMapTexture")??"",surfaceOpacity:s(e,"surfaceOpacity")??.75,waveMagnitude:s(e,"waveMagnitude")??1,envMapIntensity:s(e,"envMapIntensity")??1}}e.s(["interiorFromMis",()=>c,"missionAreaFromMis",()=>m,"skyFromMis",()=>u,"sunFromMis",()=>d,"terrainFromMis",()=>l,"waterBlockFromMis",()=>h])},70847,47566,63318,e=>{"use strict";let t=(0,e.i(25645).createLogger)("ghostToScene");function s(e,t={x:0,y:0,z:0}){return e&&"object"==typeof e&&"x"in e?e:t}function n(e,t={r:0,g:0,b:0}){return e&&"object"==typeof e&&"r"in e?e:t}function i(e,t={r:.5,g:.5,b:.5,a:1}){return e&&"object"==typeof e&&"r"in e?e:t}function r(e){if(e&&"object"==typeof e&&"elements"in e&&Array.isArray(e.elements))return e;if(e&&"object"==typeof e&&"position"in e&&"rotation"in e){let{position:t,rotation:s}=e,n=s.x*s.x,i=s.y*s.y,r=s.z*s.z,a=s.x*s.y,o=s.x*s.z,l=s.y*s.z,c=s.w*s.x,u=s.w*s.y,d=s.w*s.z;return{elements:[1-2*(i+r),2*(a+d),2*(o-u),0,2*(a-d),1-2*(n+r),2*(l+c),0,2*(o+u),2*(l-c),1-2*(n+i),0,t.x,t.y,t.z,1],position:{x:t.x,y:t.y,z:t.z}}}return{elements:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],position:{x:0,y:0,z:0}}}function a(e,a,o){let l;switch(e){case"TerrainBlock":return l={className:"TerrainBlock",ghostIndex:a,terrFileName:o.terrFileName??"",detailTextureName:o.detailTextureName??"",squareSize:o.squareSize??8,emptySquareRuns:o.emptySquareRuns},t.debug("TerrainBlock #%d: terrFileName=%s",a,l.terrFileName),l;case"InteriorInstance":return l={className:"InteriorInstance",ghostIndex:a,interiorFile:o.interiorFile??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),showTerrainInside:o.showTerrainInside??!1,skinBase:o.skinBase??"",alarmState:o.alarmState??!1},t.debug("InteriorInstance #%d: interiorFile=%s",a,l.interiorFile),l;case"TSStatic":return{className:"TSStatic",ghostIndex:a,shapeName:o.shapeName??"",transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1})};case"Sky":{let e,i;e=Array.isArray(o.fogVolumes)?o.fogVolumes.map(e=>({visibleDistance:e.visibleDistance??0,minHeight:e.minHeight??0,maxHeight:e.maxHeight??0,color:n(e.color)})):[],i=Array.isArray(o.cloudLayers)?o.cloudLayers.map(e=>({texture:e.texture??"",heightPercent:e.heightPercent??0,speed:e.speed??0})):[];let r=l={className:"Sky",ghostIndex:a,materialList:o.materialList??"",fogColor:n(o.fogColor),visibleDistance:o.visibleDistance??1e3,fogDistance:o.fogDistance??0,skySolidColor:n(o.skySolidColor),useSkyTextures:o.useSkyTextures??!0,fogVolumes:e,cloudLayers:i,windVelocity:s(o.windVelocity)};return t.debug("Sky #%d: materialList=%s fogColor=(%s, %s, %s) visibleDist=%d fogDist=%d useSkyTextures=%s",a,r.materialList,r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,r.useSkyTextures),l}case"Sun":{let e=l={className:"Sun",ghostIndex:a,direction:s(o.direction,{x:.57735,y:.57735,z:-.57735}),color:i(o.color,{r:.7,g:.7,b:.7,a:1}),ambient:i(o.ambient,{r:.5,g:.5,b:.5,a:1}),textures:Array.isArray(o.textures)?o.textures:void 0};return t.debug("Sun #%d: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",a,e.direction.x.toFixed(3),e.direction.y.toFixed(3),e.direction.z.toFixed(3),e.color.r.toFixed(3),e.color.g.toFixed(3),e.color.b.toFixed(3),e.ambient.r.toFixed(3),e.ambient.g.toFixed(3),e.ambient.b.toFixed(3)),l}case"MissionArea":return{className:"MissionArea",ghostIndex:a,area:o.area??{x:-512,y:-512,w:1024,h:1024},flightCeiling:o.flightCeiling??2e3,flightCeilingRange:o.flightCeilingRange??50};case"WaterBlock":return{className:"WaterBlock",ghostIndex:a,transform:r(o.transform),scale:s(o.scale,{x:1,y:1,z:1}),surfaceName:o.surfaceName??"",envMapName:o.envMapName??"",surfaceOpacity:o.surfaceOpacity??.75,waveMagnitude:o.waveMagnitude??1,envMapIntensity:o.envMapIntensity??1};default:return null}}e.s(["ghostToSceneObject",()=>a],47566),e.i(9672);var o=e.i(90072);function l(e){return[e.y,e.z,e.x]}function c(e){return[e.y,e.z,e.x]}function u(e){let t=e.elements,s=new o.Matrix4,n=s.elements;n[0]=t[5],n[1]=t[6],n[2]=t[4],n[3]=0,n[4]=t[9],n[5]=t[10],n[6]=t[8],n[7]=0,n[8]=t[1],n[9]=t[2],n[10]=t[0],n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1;let i=new o.Quaternion;return i.setFromRotationMatrix(s),i.conjugate(),i}e.s(["matrixFToQuaternion",()=>u,"torqueScaleToThree",()=>c,"torqueToThree",()=>l],63318),e.s([],70847)},92224,e=>{"use strict";e.i(932);var t=e.i(8155),s=e.i(66748),n=e.i(62395);let i=(0,t.createStore)()(e=>({missionEntities:new Map,streamEntities:new Map,isStreaming:!1,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:0,setEntity(t){e(e=>{let s=new Map(e.missionEntities);return s.set(t.id,t),{missionEntities:s,version:e.version+1}})},deleteEntity(t){e(e=>{if(!e.missionEntities.has(t))return e;let s=new Map(e.missionEntities);return s.delete(t),{missionEntities:s,version:e.version+1}})},setEntities(t){e(e=>{let s=new Map(e.missionEntities);for(let e of t)s.set(e.id,e);return{missionEntities:s,version:e.version+1}})},setAllEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);return{missionEntities:s,dataSource:e.isStreaming?e.dataSource:"map"}})},clearEntities(){e(e=>0===e.missionEntities.size?e:e.isStreaming?{missionEntities:new Map,version:e.version+1}:{missionEntities:new Map,dataSource:null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1})},setMissionInfo(t){let s={};if(void 0!==t.missionName&&(s.missionName=t.missionName),void 0!==t.missionType&&(s.missionType=t.missionType),void 0!==t.missionTypeDisplayName&&(s.missionTypeDisplayName=t.missionTypeDisplayName),void 0!==t.missionDisplayName&&(s.missionDisplayName=t.missionDisplayName),void 0!==t.gameClassName&&(s.gameClassName=t.gameClassName,void 0===t.missionType))if(t.gameClassName){let e=t.gameClassName.replace(/Game$/i,"");s.missionType=n.normalizedMissionTypes[e.toLowerCase()]??e}else s.missionType=null;void 0!==t.serverDisplayName&&(s.serverDisplayName=t.serverDisplayName),void 0!==t.recorderName&&(s.recorderName=t.recorderName),void 0!==t.recordingDate&&(s.recordingDate=t.recordingDate),e(e=>({...s,version:e.version+1}))},beginStreaming(t){e(e=>({isStreaming:!0,dataSource:t,streamEntities:new Map,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,version:e.version+1}))},endStreaming(){e(e=>e.isStreaming?{isStreaming:!1,dataSource:e.missionEntities.size>0?"map":null,missionName:null,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null,serverDisplayName:null,recorderName:null,recordingDate:null,streamEntities:new Map,version:e.version+1}:e)},setStreamEntity(t){e(e=>{let s=new Map(e.streamEntities);return s.set(t.id,t),{streamEntities:s,version:e.version+1}})},deleteStreamEntity(t){e(e=>{if(!e.streamEntities.has(t))return e;let s=new Map(e.streamEntities);return s.delete(t),{streamEntities:s,version:e.version+1}})},setStreamEntities(t){e(e=>{let s=new Map(e.streamEntities);for(let e of t)s.set(e.id,e);return{streamEntities:s,version:e.version+1}})},setAllStreamEntities(t){e(e=>{let s=new Map;for(let e of t)s.set(e.id,e);let n=e.streamEntities;return s.size===n.size&&[...s.keys()].every(e=>n.has(e))?e:{streamEntities:s,version:e.version+1}})},clearStreamEntities(){e(e=>0===e.streamEntities.size?e:{streamEntities:new Map,version:e.version+1})}}));function r(e){let t=e.isStreaming?e.streamEntities:e.missionEntities,s=[];for(let e of t.values())"None"!==e.renderType&&s.push(e);return s}function a(e,t){if(e.length!==t.length)return!1;for(let s=0;so,"useDataSource",()=>m,"useMissionDisplayName",()=>k,"useMissionName",()=>p,"useMissionType",()=>y,"useMissionTypeDisplayName",()=>v,"useRecorderName",()=>E,"useRecordingDate",()=>x,"useSceneSky",()=>u,"useSceneSun",()=>d,"useServerDisplayName",()=>N])},98755,e=>{"use strict";e.i(47167);var t=e.i(8155),s=e.i(66748),n=e.i(25645);let i=(0,n.createLogger)("relayClient");class r{ws=null;handlers;url;_connected=!1;wsPingInterval=null;smoothedWsPing=0;constructor(e,t){this.url=e,this.handlers=t}get connected(){return this._connected}connect(){this.ws=new WebSocket(this.url),this.ws.binaryType="arraybuffer",this.ws.onopen=()=>{i.info("WebSocket connected to %s",this.url),this._connected=!0,this.startWsPing(),this.handlers.onOpen?.()},this.ws.onmessage=e=>{if(e.data instanceof ArrayBuffer)this.handlers.onGamePacket?.(new Uint8Array(e.data));else try{let t=JSON.parse(e.data);this.handleMessage(t)}catch(e){i.error("Failed to parse relay message: %o",e)}},this.ws.onclose=()=>{i.info("WebSocket disconnected"),this._connected=!1,this.stopWsPing(),this.handlers.onClose?.()},this.ws.onerror=()=>{i.error("WebSocket error"),this.handlers.onError?.("WebSocket connection error")}}handleMessage(e){switch(e.type){case"serverList":this.handlers.onServerList?.(e.servers);break;case"status":this.handlers.onStatus?.(e.status,e.message,e.connectSequence,e.mapName);break;case"ping":this.handlers.onPing?.(e.ms);break;case"wsPong":{let t=Date.now()-e.ts;this.smoothedWsPing=0===this.smoothedWsPing?t:.5*this.smoothedWsPing+.5*t,this.handlers.onWsPing?.(Math.round(this.smoothedWsPing));break}case"error":this.handlers.onError?.(e.message)}}listServers(){this.send({type:"listServers"})}sendWsPing(){this.send({type:"wsPing",ts:Date.now()})}joinServer(e,t){i.info("Joining server: %s",e),this.send({type:"joinServer",address:e,warriorName:t})}disconnectServer(){this.send({type:"disconnect"})}sendAuthEvent(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCommand(e,t){this.send({type:"sendCommand",command:e,args:t})}sendCRCResponse(e,t,s){this.send({type:"sendCRCResponse",crcValue:e,field1:t,field2:s})}sendCRCCompute(e,t,s,n){this.send({type:"sendCRCCompute",seed:e,field2:t,includeTextures:n,datablocks:s})}sendGhostAck(e,t){this.send({type:"sendGhostAck",sequence:e,ghostCount:t})}sendMoves(e,t){this.send({type:"sendMoves",moves:e,moveStartIndex:t})}close(){this.stopWsPing(),this.ws&&(this.ws.close(),this.ws=null),this._connected=!1}startWsPing(){this.smoothedWsPing=0,this.send({type:"wsPing",ts:Date.now()}),this.wsPingInterval=setInterval(()=>{this.send({type:"wsPing",ts:Date.now()})},7e3)}stopWsPing(){null!=this.wsPingInterval&&(clearInterval(this.wsPingInterval),this.wsPingInterval=null)}send(e){this.ws?.readyState===WebSocket.OPEN?this.ws.send(JSON.stringify(e)):i.warn("send dropped (ws not open): %s",e.type)}}e.i(91891);var a=e.i(94802),o=e.i(89119),l=e.i(10244);let c=(0,n.createLogger)("liveStreaming");class u extends l.StreamEngine{packetParser;relay;currentTimeSec=0;connectSynced=!1;_snapshot=null;_snapshotTick=-1;_ready=!1;dataBlockClassNames=new Map;onReady;onMissionChange;missionName=null;lastMoveAck=0;constructor(e){super(),this.relay=e;const{registry:t,ghostTracker:s,packetParser:n}=(0,a.createLiveParser)();this.packetParser=n,this.ghostTracker=s,this.registry=t}getDataBlockData(e){return this.packetParser.getDataBlockDataMap()?.get(e)}_shapeConstructorCache=null;getShapeConstructorSequences(e){this._shapeConstructorCache=new Map;let t=this.packetParser.getDataBlockDataMap();if(t){for(let[,e]of t){let t=e.shape,s=e.sequences;t&&s&&this._shapeConstructorCache.set(t.toLowerCase(),s)}return this._shapeConstructorCache.get(e.toLowerCase())}}getTimeSec(){return this.currentTimeSec}getCameraYawPitch(e){return this.getAbsoluteRotation(e)??{yaw:0,pitch:0}}getEffectShapes(){let e=new Set,t=this.packetParser.getDataBlockDataMap();if(!t)return[];for(let[,s]of t){let n=s.explosion;if(null==n)continue;let i=t.get(n);i?.dtsFileName&&e.add(i.dtsFileName)}return[...e]}reset(){this.resetSharedState(),this.ghostTracker.clear?.(),this.currentTimeSec=0,this._snapshot=null,this._snapshotTick=-1,this.dataBlockClassNames.clear(),this.observerMode="fly",this.missionName=null}getSnapshot(){return this._snapshot&&this._snapshotTick===this.tickCount?this._snapshot:this.buildSnapshot()}stepToTime(e,t){return this.currentTimeSec=e,this.getSnapshot()}syncConnectSequence(e){if(this.connectSynced||e.length<1)return;this.connectSynced=!0;let t=e[0]>>1&1;this.packetParser.setConnectionProtocolState({lastSeqRecvdAtSend:Array(32).fill(0),lastSeqRecvd:0,highestAckedSeq:0,lastSendSeq:0x1fffffff,ackMask:0,connectSequence:t,lastRecvAckAck:0,connectionEstablished:!0})}feedPacket(e){this.syncConnectSequence(e),this.processPacket(e)}handleRelayCommands(e){if("RemoteCommandEvent"!==e.type)return;let t=e.funcName;if(!t)return;let s=this.resolveNetString(t);if(["t2csri_pokeClient","t2csri_getChallengeChunk","t2csri_decryptChallenge"].includes(s)){let t=(e.args??[]).map(e=>this.resolveNetString(e)).filter(e=>""!==e);c.info("auth event: %s %o",s,t),this.relay.sendAuthEvent(s,t);return}let n=(e.args??[]).map(e=>this.resolveNetString(e));if("MissionStartPhase1"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 1, seq=%s mission=%s resolvedArgs=%o",e,t,n),t&&t!==this.missionName&&(this.missionName=t,this.entities.clear(),this.entityIdByGhostIndex.clear(),this._ready=!1,this._snapshot=null,this._snapshotTick=-1,this.missionDisplayName=null,this.missionTypeDisplayName=null,this.gameClassName=null,this.serverDisplayName=null,this.onMissionChange?.(t)),this.relay.sendCommand("MissionStartPhase1Done",[e])}else if("MissionStartPhase2"===s){let e=n[0]??"";c.info("mission phase 2 (datablocks), seq=%s",e),this.relay.sendCommand("MissionStartPhase2Done",[e])}else if("MissionStartPhase3"===s){let e=n[0]??"",t=n[1]??null;c.info("mission phase 3 (ghosting), seq=%s mission=%s",e,t),t&&(this.missionName=t),this.relay.sendCommand("setClientFav",[""]),this.relay.sendCommand("MissionStartPhase3Done",[e])}}handleCRCChallenge(e){if("CRCChallengeEvent"!==e.type)return;let t=e.crcValue,s=e.field1,n=e.field2,i=(1&s)!=0;c.info("CRC challenge: seed=0x%s f1=0x%s f2=0x%s includeTextures=%s",(t>>>0).toString(16),(s>>>0).toString(16),(n>>>0).toString(16),i);let r=this.packetParser.getDataBlockDataMap(),a=[];if(r)for(let[e,t]of r){let s=this.dataBlockClassNames.get(e);if(!s)continue;let n=(0,o.resolveShapeName)(s,t);a.push({objectId:e,className:s,shapeName:n??""})}c.info("CRC: sending %d datablocks for computation",a.length),this.relay.sendCRCCompute(t,n,a,i)}handleGhostingMessage(e){if("GhostingMessageEvent"!==e.type)return;let t=e.message,s=e.sequence,n=e.ghostCount;c.info("GhostingMessageEvent: message=%d sequence=%d ghostCount=%d",t,s,n),0===t&&(c.info("Sending ghost ack (type 1) for sequence %d",s),this.relay.sendGhostAck(s,n))}observerMode="fly";toggleObserverMode(){"fly"===this.observerMode?(c.info("observer: fly → follow"),this.observerMode="follow"):(c.info("observer: follow → fly"),this.observerMode="fly")}getPlayerList(){let e=[];for(let[t,s]of this.targetNames){let n=this.targetTeams.get(t)??0;e.push({targetId:t,name:s,sensorGroup:n})}return e}processPacket(e){try{let t=this.packetParser.protocolRejected,s=this.packetParser.protocolNoDispatch,n=this.packetParser.parsePacket(e),i=this.packetParser.protocolRejected>t,r=this.packetParser.protocolNoDispatch>s;(i||r)&&c.warn("packet #%d %s: %d bytes (total rejected=%d, noDispatch=%d)",this.tickCount,i?"REJECTED":"no-dispatch",e.length,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch);let a=this.tickCount<20,l=this.tickCount%100==0,u=a||l;for(let t of(u&&c.debug("packet #%d: %d events, %d ghosts, %d bytes%s%s",this.tickCount,n.events.length,n.ghosts.length,e.length,void 0!==n.gameState.controlObjectGhostIndex?`, control=${n.gameState.controlObjectGhostIndex}`:"",void 0!==n.gameState.cameraFov?`, fov=${n.gameState.cameraFov}`:""),this.lastMoveAck=n.gameState.lastMoveAck,this.processControlObject(n.gameState),n.events))if(t.parsedData){this.handleRelayCommands(t.parsedData),this.handleCRCChallenge(t.parsedData),this.handleGhostingMessage(t.parsedData);let e=t.parsedData.type;if("RemoteCommandEvent"===e){let e=this.resolveNetString(t.parsedData.funcName??"");c.debug("remote: %s",e)}if(a&&"NetStringEvent"!==e&&"RemoteCommandEvent"!==e&&c.debug("event: %s%s",e,"SimDataBlockEvent"===e?` id=${t.parsedData.objectId} class=${t.parsedData.dataBlockClassName}`:""),"SimDataBlockEvent"===e){let e=t.parsedData.objectId,s=t.parsedData.dataBlockClassName;if(null!=e&&s&&this.dataBlockClassNames.set(e,s),u){let n=t.parsedData.dataBlockData,i=(0,o.resolveShapeName)(s??"",n);c.debug("datablock: id=%d class=%s%s",e,s??"?",i?` shape=${i}`:"")}}let s=this.registry.getEventParser(t.classId)?.name;if(this.processEvent(t,s),a&&"NetStringEvent"===e){let e=t.parsedData.id,s=t.parsedData.value;null!=e&&"string"==typeof s&&c.trace('netString #%d = "%s"',e,s.length>60?s.slice(0,60)+"…":s)}if("TargetInfoEvent"===e){let e=t.parsedData.targetId,s=t.parsedData.nameTag;if(null!=e&&null!=s){let n=this.netStrings.get(s);if(n){let s=(0,o.stripTaggedStringMarkup)(n);c.info('target #%d: "%s" team=%s',e,s,t.parsedData.sensorGroup??"?")}}}if("SetSensorGroupEvent"===e){let e=t.parsedData.sensorGroup;null!=e&&c.info("sensor group changed: → %d",e)}if("SensorGroupColorEvent"===e){let e=t.parsedData.sensorGroup,s=t.parsedData.colors;s&&c.debug("sensor group colors: group=%d, %d entries",e,s.length)}}for(let e of n.ghosts){if("create"===e.type){let t=e.parsedData?.position,s=t&&"number"==typeof t.x&&"number"==typeof t.y&&"number"==typeof t.z,n=this.resolveGhostClassName(e.index,e.classId);c.debug("ghost create: #%d %s%s (%d entities total)",e.index,n??"?",s?` at (${t.x.toFixed(1)}, ${t.y.toFixed(1)}, ${t.z.toFixed(1)})`:"",this.entities.size+1),this._ready||(this._ready=!0,this.onReady?.())}else if("delete"===e.type){let t=this.entityIdByGhostIndex.get(e.index),s=t?this.entities.get(t):void 0;(this.tickCount<50||this.tickCount%200==0)&&c.debug("ghost delete: #%d %s (%d entities remaining)",e.index,s?.className??"?",this.entities.size-1)}this.processGhostUpdate(e)}if(this.tickCount++,this.advanceProjectiles(),this.advanceItems(),l&&this.tickCount>1){let e=this.packetParser.getDataBlockDataMap();c.info("status @ tick %d: %d entities, %d datablocks, rejected=%d, noDispatch=%d",this.tickCount,this.entities.size,e?.size??0,this.packetParser.protocolRejected,this.packetParser.protocolNoDispatch)}let d=this.entities.size;if(1===this.tickCount||d>0&&d%25==0&&this.tickCount<100){let e=new Map;for(let t of this.entities.values())e.set(t.type,(e.get(t.type)??0)+1);let t=[...e.entries()].map(([e,t])=>`${e}=${t}`).join(" ");c.info("entity count: %d (%s)",d,t)}let m=this.camera?.mode;if(this.updateCameraAndHud(),this.camera&&this.camera.mode!==m&&c.info("camera mode: %s → %s%s",m??"none",this.camera.mode,"third-person"===this.camera.mode?` orbit=${this.camera.orbitTargetId??"?"} dist=${this.camera.orbitDistance??"?"}`:""),this.tickCount<=5&&this.camera){let[e,t,s]=this.camera.position;c.debug("camera: mode=%s pos=(%s, %s, %s) fov=%s",this.camera.mode,e.toFixed(1),t.toFixed(1),s.toFixed(1),this.camera.fov)}}catch(s){let t={tickCount:this.tickCount,entityCount:this.entities.size,dataLength:e.length,controlGhost:this.latestControl.ghostIndex,connectSynced:this.connectSynced};c.error("Failed to process live packet: %o %o",s,t)}}buildSnapshot(){let e=this.buildEntityList(),t=this.currentTimeSec,{chatMessages:s,audioEvents:n}=this.buildTimeFilteredEvents(t),{weaponsHud:i,inventoryHud:r,backpackHud:a,teamScores:o}=this.buildHudState();this.camera||(this.camera={time:t,position:[0,0,200],rotation:[0,0,0,1],fov:90,mode:"observer"});let l={timeSec:t,exhausted:!1,camera:this.camera,entities:e,controlPlayerGhostId:this.controlPlayerGhostId,playerSensorGroup:this.playerSensorGroup,status:this.lastStatus,chatMessages:s,audioEvents:n,weaponsHud:i,backpackHud:a,inventoryHud:r,teamScores:o};return this._snapshot=l,this._snapshotTick=this.tickCount,l}}var d=e.i(92224);let m=(0,n.createLogger)("liveConnectionStore"),h="wss://t2-relay.fly.dev",p=(0,t.createStore)((e,t)=>({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,servers:[],serversLoading:!1,adapter:null,liveReady:!1,_relay:null,_adapter:null,_pending:[],_listInFlight:!1,connectRelay(s=h){let n=t();n._relay&&n._relay.close();let i=new r(s,{onOpen(){e({relayConnected:!0});let s=t();for(let e of s._pending)e();s._pending=[]},onStatus(t,s,n,i){m.info("game status: %s%s%s",t,s?` — ${s}`:"",i?` map=${i}`:""),e({gameStatus:t,gameStatusMessage:s,...i?{mapName:i}:{}})},onServerList(s){t()._listInFlight=!1,e({servers:s,serversLoading:!1})},onGamePacket(e){let s=t()._adapter;s||m.warn("received game packet but no adapter is active"),s?.feedPacket(e)},onPing(t){e({relayToGameServerPing:t})},onWsPing(t){e({browserToRelayPing:t})},onError(s){m.error("error: %s",s),t()._listInFlight=!1,e({serversLoading:!1})},onClose(){let s=t();s._relay===i&&(s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1}))}});i.connect(),t()._relay=i},disconnectRelay(){let s=t();s._relay?.close(),s._relay=null,s._adapter=null,s._pending=[],s._listInFlight=!1,e({relayConnected:!1,gameStatus:null,gameStatusMessage:void 0,mapName:void 0,serverName:void 0,relayToGameServerPing:null,browserToRelayPing:null,adapter:null,liveReady:!1})},listServers(){let s=t();if(s._listInFlight)return;s._listInFlight=!0;let n=()=>{let e=t();e._relay?.sendWsPing(),e._relay?.listServers()};e({serversLoading:!0}),s._relay?.connected?n():(s._pending.push(n),s._relay||t().connectRelay())},joinServer(s,n){let i=t();if(!i._relay)return;let r=i.servers.find(e=>e.address===s),a=new u(i._relay);a.onReady=()=>e({liveReady:!0}),a.onMissionChange=t=>{m.info("mission changed: %s",t),e({mapName:t,liveReady:!1}),d.gameEntityStore.getState().setMissionInfo({missionName:t,missionType:null,missionTypeDisplayName:null,missionDisplayName:null,gameClassName:null})},a.onMissionInfoChange=()=>{d.gameEntityStore.getState().setMissionInfo({missionDisplayName:a.missionDisplayName??void 0,missionTypeDisplayName:a.missionTypeDisplayName??void 0,gameClassName:a.gameClassName??void 0,serverDisplayName:a.serverDisplayName??void 0,recorderName:a.connectedPlayerName??void 0})},i._adapter=a,e({mapName:r?.mapName??i.mapName,serverName:r?.name,warriorName:n,liveReady:!1,gameStatus:null,adapter:a}),d.gameEntityStore.getState().setMissionInfo({missionName:r?.mapName??void 0,missionTypeDisplayName:r?.gameType??void 0,serverDisplayName:r?.name??void 0,recorderName:n??void 0}),i._relay.joinServer(s,n)},disconnectServer(){let s=t();s._relay?.disconnectServer(),s._adapter=null,e({adapter:null,liveReady:!1,gameStatus:null,mapName:void 0,serverName:void 0,relayToGameServerPing:null})},sendMoves(e,s){t()._relay?.sendMoves(e,s)},sendCommand(e,...s){t()._relay?.sendCommand(e,s)}}));function g(e,t){return(0,s.useStoreWithEqualityFn)(p,e,t)}function y(e){return null!=e.relayToGameServerPing&&null!=e.browserToRelayPing?e.relayToGameServerPing+e.browserToRelayPing:e.relayToGameServerPing??null}e.s(["liveConnectionStore",0,p,"selectPing",()=>y,"useLiveSelector",()=>g],98755)},66093,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,n.createContext)(null);function r(){let e=(0,n.useContext)(i);if(!e)throw Error("No JoystickContext found. Did you forget to add a ?");return e}function a(e){let r,a,o,l,c,u,d=(0,s.c)(7),{children:m}=e;d[0]===Symbol.for("react.memo_cache_sentinel")?(r={angle:0,force:0},d[0]=r):r=d[0];let h=(0,n.useRef)(r);d[1]===Symbol.for("react.memo_cache_sentinel")?(a={angle:0,force:0},d[1]=a):a=d[1];let p=(0,n.useRef)(a);d[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{angle:t,force:s}=e;null!=t&&(h.current.angle=t),null!=s&&(h.current.force=s)},d[2]=o):o=d[2];let g=o;d[3]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let{angle:t,force:s}=e;null!=t&&(p.current.angle=t),null!=s&&(p.current.force=s)},d[3]=l):l=d[3];let y=l;d[4]===Symbol.for("react.memo_cache_sentinel")?(c={moveState:h,lookState:p,setMoveState:g,setLookState:y},d[4]=c):c=d[4];let f=c;return d[5]!==m?(u=(0,t.jsx)(i,{value:f,children:m}),d[5]=m,d[6]=u):u=d[6],u}e.s(["JoystickProvider",()=>a,"useJoystick",()=>r])},65349,e=>{"use strict";var t=e.i(71645);let s=(0,t.createContext)(null);function n(){let e=(0,t.useContext)(s);if(!e)throw Error("useInputContext must be used within an InputProvider");return e}function i(){return n().onInput}e.s(["InputContext",0,s,"useInputContext",()=>n,"useOnInput",()=>i])},32865,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(58647);function i(e){let n,i=(0,s.c)(2),{children:r}=e;return i[0]!==r?(n=(0,t.jsx)(t.Fragment,{children:r}),i[0]=r,i[1]=n):n=i[1],n}function r(){return(0,n.useEngineSelector)(a)}function a(e){return e.playback.recording}function o(){return(0,n.useEngineSelector)(l)}function l(e){return"playing"===e.playback.status}function c(){return(0,n.useEngineSelector)(u)}function u(e){return e.playback.timeMs/1e3}function d(){return(0,n.useEngineSelector)(m)}function m(e){return e.playback.durationMs/1e3}function h(){return(0,n.useEngineSelector)(p)}function p(e){return e.playback.rate}function g(){let e,t,i,a,o,l,c=(0,s.c)(17),u=r(),d=(0,n.useEngineSelector)(S),m=(0,n.useEngineSelector)(v),h=(0,n.useEngineSelector)(f),p=(0,n.useEngineSelector)(y);c[0]!==d?(e=e=>{d(e)},c[0]=d,c[1]=e):e=c[1];let g=e;c[2]!==u||c[3]!==m?(t=()=>{u&&m("playing")},c[2]=u,c[3]=m,c[4]=t):t=c[4];let k=t;c[5]!==m?(i=()=>{m("paused")},c[5]=m,c[6]=i):i=c[6];let b=i;c[7]!==h?(a=e=>{h(1e3*e)},c[7]=h,c[8]=a):a=c[8];let N=a;c[9]!==p?(o=e=>{p(e)},c[9]=p,c[10]=o):o=c[10];let C=o;return c[11]!==b||c[12]!==k||c[13]!==N||c[14]!==g||c[15]!==C?(l={setRecording:g,play:k,pause:b,seek:N,setSpeed:C},c[11]=b,c[12]=k,c[13]=N,c[14]=g,c[15]=C,c[16]=l):l=c[16],l}function y(e){return e.setPlaybackRate}function f(e){return e.setPlaybackTime}function v(e){return e.setPlaybackStatus}function S(e){return e.setRecording}e.s(["RecordingProvider",()=>i,"useCurrentTime",()=>c,"useDuration",()=>d,"useIsPlaying",()=>o,"usePlaybackActions",()=>g,"useRecording",()=>r,"useSpeed",()=>h])},12631,e=>{"use strict";var t=e.i(71645),s=e.i(8155);let n=e=>{let n=(0,s.createStore)(e),i=e=>(function(e,s=e=>e){let n=t.default.useSyncExternalStore(e.subscribe,t.default.useCallback(()=>s(e.getState()),[e,s]),t.default.useCallback(()=>s(e.getInitialState()),[e,s]));return t.default.useDebugValue(n),n})(n,e);return Object.assign(i,n),i};var i=e.i(79473);let r=t.createContext(null);function a({map:e,children:s,onChange:a,domElement:o}){let l=e.map(e=>e.name+e.keys).join("-"),c=t.useMemo(()=>{let t;return(t=(0,i.subscribeWithSelector)(()=>e.reduce((e,t)=>({...e,[t.name]:!1}),{})))?n(t):n},[l]),u=t.useMemo(()=>[c.subscribe,c.getState,c],[l]),d=c.setState;return t.useEffect(()=>{let t=e.map(({name:e,keys:t,up:s})=>({keys:t,up:s,fn:t=>{d({[e]:t}),a&&a(e,t,u[1]())}})).reduce((e,{keys:t,fn:s,up:n=!0})=>(t.forEach(t=>e[t]={fn:s,pressed:!1,up:n}),e),{}),s=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,pressed:r,up:a}=n;n.pressed=!0,(a||!r)&&i(!0)},n=({key:e,code:s})=>{let n=t[e]||t[s];if(!n)return;let{fn:i,up:r}=n;n.pressed=!1,r&&i(!1)},i=o||window;return i.addEventListener("keydown",s,{passive:!0}),i.addEventListener("keyup",n,{passive:!0}),()=>{i.removeEventListener("keydown",s),i.removeEventListener("keyup",n)}},[o,l]),t.createElement(r.Provider,{value:u,children:s})}function o(e){let[s,n,i]=t.useContext(r);return e?i(e):[s,n]}e.s(["KeyboardControls",()=>a,"useKeyboardControls",()=>o],12631)},93784,e=>{"use strict";let t=(0,e.i(8155).createStore)()(()=>({time:0,playback:null,root:null,freeFlyCamera:!1,entities:new Map}));function s(){t.setState({time:0,playback:null,freeFlyCamera:!1})}e.s(["resetStreamPlayback",()=>s,"streamPlaybackStore",0,t])},46325,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645);let i=(0,e.i(25645).createLogger)("DebugSuspense");function r(e){let i,r,l,c=(0,s.c)(10),{name:u,fallback:d,children:m}=e,h=void 0===d?null:d;return c[0]!==h||c[1]!==u?(i=(0,t.jsx)(a,{name:u,children:h}),c[0]=h,c[1]=u,c[2]=i):i=c[2],c[3]!==u?(r=(0,t.jsx)(o,{name:u}),c[3]=u,c[4]=r):r=c[4],c[5]!==m||c[6]!==u||c[7]!==i||c[8]!==r?(l=(0,t.jsxs)(n.Suspense,{name:u,fallback:i,children:[r,m]}),c[5]=m,c[6]=u,c[7]=i,c[8]=r,c[9]=l):l=c[9],l}function a(e){let t,r,a=(0,s.c)(3),{name:o,children:l}=e;return a[0]!==o?(t=()=>{i.debug("🛑 SUSPENDED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),l}function o(e){let t,r,a=(0,s.c)(3),{name:o}=e;return a[0]!==o?(t=()=>{i.debug("✅ RESOLVED: %s",o)},r=[o],a[0]=o,a[1]=t,a[2]=r):(t=a[1],r=a[2]),(0,n.useEffect)(t,r),null}e.s(["DebugSuspense",()=>r])},51434,e=>{"use strict";var t=e.i(43476),s=e.i(932),n=e.i(71645),i=e.i(15080),r=e.i(90072),a=e.i(58647),o=e.i(79123);let l=(0,n.createContext)(void 0);function c(e){let c,h,p,g,y,f,v=(0,s.c)(11),{children:S}=e,k=(0,i.useThree)(m),{audioVolume:b}=(0,o.useSettings)();v[0]===Symbol.for("react.memo_cache_sentinel")?(c={audioLoader:null,audioListener:null},v[0]=c):c=v[0];let[N,C]=(0,n.useState)(c);return v[1]!==k?(h=()=>{let e=new r.AudioLoader,t=k.children.find(d);t||(t=new r.AudioListener,k.add(t)),C({audioLoader:e,audioListener:t});let s=()=>{let e=t.context;e&&"suspended"===e.state&&e.resume().finally(()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s)})};document.addEventListener("click",s),document.addEventListener("keydown",s),document.addEventListener("touchend",s);let n=a.engineStore.subscribe(u,e=>{let s=t.context;s&&("paused"===e?s.suspend():"suspended"===s.state&&s.resume())});return()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",s),document.removeEventListener("touchend",s),n(),t&&k.remove(t)}},p=[k],v[1]=k,v[2]=h,v[3]=p):(h=v[2],p=v[3]),(0,n.useEffect)(h,p),v[4]!==N.audioListener||v[5]!==b?(g=()=>{N.audioListener?.setMasterVolume(b)},y=[b,N.audioListener],v[4]=N.audioListener,v[5]=b,v[6]=g,v[7]=y):(g=v[6],y=v[7]),(0,n.useEffect)(g,y),v[8]!==N||v[9]!==S?(f=(0,t.jsx)(l.Provider,{value:N,children:S}),v[8]=N,v[9]=S,v[10]=f):f=v[10],f}function u(e){return e.playback.status}function d(e){return e instanceof r.AudioListener}function m(e){return e.camera}function h(){let e=(0,n.useContext)(l);if(void 0===e)throw Error("useAudio must be used within AudioProvider");return e}e.s(["AudioProvider",()=>c,"useAudio",()=>h])},31999,e=>{"use strict";var t=e.i(71645);let s=(0,e.i(25645).createLogger)("ShapeErrorBoundary");class n extends t.Component{state={hasError:!1};static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e,t){s.error("Shape load failed: %s %s",e.message,t.componentStack)}render(){return this.state.hasError?this.props.fallback:this.props.children}}e.s(["ShapeErrorBoundary",()=>n])},77964,e=>{"use strict";function t(e){switch(e.renderType){case"TerrainBlock":case"InteriorInstance":case"Sky":case"Sun":case"WaterBlock":case"MissionArea":return!0;default:return!1}}e.s(["isSceneEntity",()=>t])},60946,e=>{e.v(t=>Promise.all(["static/chunks/48d0203d138a3e57.js"].map(t=>e.l(t))).then(()=>t(0)))},30814,e=>{e.v(t=>Promise.all(["static/chunks/41fb9d5ac0e14608.js"].map(t=>e.l(t))).then(()=>t(9721)))},44325,e=>{e.v(t=>Promise.all(["static/chunks/c5f946098461b297.js"].map(t=>e.l(t))).then(()=>t(66789)))},62125,e=>{e.v(t=>Promise.all(["static/chunks/6c0bdfaab43cc40b.js"].map(t=>e.l(t))).then(()=>t(64972)))},25147,e=>{e.v(t=>Promise.all(["static/chunks/2c772d15a5a10e4d.js"].map(t=>e.l(t))).then(()=>t(63724)))},61921,e=>{e.v(t=>Promise.all(["static/chunks/538e72dc81951677.js"].map(t=>e.l(t))).then(()=>t(29055)))},18599,e=>{e.v(t=>Promise.all(["static/chunks/2070573ac43e863c.js"].map(t=>e.l(t))).then(()=>t(42585)))},34019,e=>{e.v(t=>Promise.all(["static/chunks/967c4aa315f919d7.js"].map(t=>e.l(t))).then(()=>t(66069)))},553,e=>{e.v(t=>Promise.all(["static/chunks/66f953934e42712b.css","static/chunks/e27b13e203064a85.js"].map(t=>e.l(t))).then(()=>t(18339)))},33487,e=>{e.v(t=>Promise.all(["static/chunks/9ffe862a9787606f.css","static/chunks/302e494fb721f5e6.js"].map(t=>e.l(t))).then(()=>t(40378)))},25483,e=>{e.v(t=>Promise.all(["static/chunks/41fb9d5ac0e14608.js","static/chunks/419d6e651fe3d509.js"].map(t=>e.l(t))).then(()=>t(51295)))},93884,e=>{e.v(t=>Promise.all(["static/chunks/1db3a9d62713e989.css","static/chunks/3770acf7d1a6ba0a.js"].map(t=>e.l(t))).then(()=>t(94737)))},88487,e=>{e.v(t=>Promise.all(["static/chunks/005e475439c5cb3e.js","static/chunks/3ec6b524f05ae0b6.css"].map(t=>e.l(t))).then(()=>t(86855)))},21683,e=>{e.v(t=>Promise.all(["static/chunks/4c292ca57f1d49be.js"].map(t=>e.l(t))).then(()=>t(91285)))},38496,e=>{e.v(t=>Promise.all(["static/chunks/fd10b9633e3b5488.js"].map(t=>e.l(t))).then(()=>t(9962)))},57567,e=>{e.v(t=>Promise.all(["static/chunks/dbc95e0f1d663220.css","static/chunks/4e0d5bbc5104adf2.js"].map(t=>e.l(t))).then(()=>t(49776)))},59197,e=>{e.v(t=>Promise.all(["static/chunks/7317a925124598e3.css","static/chunks/7dcb40c178014bc9.js"].map(t=>e.l(t))).then(()=>t(94247)))},70012,e=>{e.v(t=>Promise.all(["static/chunks/7317a925124598e3.css","static/chunks/0070446447a9983b.js"].map(t=>e.l(t))).then(()=>t(45554)))}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/acace6aadc879a08.js b/docs/_next/static/chunks/acace6aadc879a08.js deleted file mode 100644 index 427d46e3..00000000 --- a/docs/_next/static/chunks/acace6aadc879a08.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,68754,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function A(e){return e}function E(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eA(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eE(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eE(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eA);return(t&&eA(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,A=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),E=i.onFocusCapture,w=W(t=>{if(null==E||E(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:A,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();E(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,A=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:A,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e4=(0,R.createContext)(void 0),e5=ec([e1,ev],[e2,eg]),e8=e5.useContext,e6=e5.useScopedContext,e9=e5.useProviderContext,e7=e5.ContextProvider,te=e5.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return E(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,A=e9();E(e=e||A,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();E(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=A,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tA=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tA(e))});var{useSyncExternalStore:tE}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=A){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tE(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tE(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&atR,"useStoreProps",()=>tM,"useStoreState",()=>t_,"useStoreStateObject",()=>tT],68754);var tI=es(function({store:e,rowId:t,preventScrollOnKeyDown:r=!1,moveOnKeyPress:i=!0,tabbable:o=!1,getItem:a,"aria-setsize":l,"aria-posinset":s,...c}){let m=em();e=e||m;let h=z(c.id),v=(0,R.useRef)(null),g=(0,R.useContext)(eb),S=_(c)&&!c.accessibleWhenDisabled,{rowId:C,baseElement:x,isActiveItem:A,ariaSetSize:E,ariaPosInSet:w,isTabbable:M}=tT(e,{rowId:e=>t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":A||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tA(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":E,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();E(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),A=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e4)])?d:"option",children:t,...s,onClick:A,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();E(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;E(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e4.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t4(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t5(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t4(e,t,t=>{t5(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:A,unstable_treeSnapshotKey:E,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t4(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,E]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t4(q,t,n=>{t5(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,E]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eA]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eA,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rA(e){return e.split("-")[1]}function rE(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rE(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rA(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r4(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r4(){return!("u"rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();E(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),A=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==A?void 0:A.isConnected))return;A.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return E(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:E=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!E?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==A;!C&&I&&O.push(...(f=rA(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===A,R),f&&(d=d.map(e=>e+"-"+f),E&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rA(l),r=rw(t=rE(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rE(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rE(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rE(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,A=rm(f[v?"top":"left"],x),E=rm(f[v?"bottom":"right"],x),w=C-h[m]-E,_=C/2-h[m]/2+(y/2-b/2),T=rh(A,rm(_,w)),M=!u.arrow&&null!=rA(i)&&_!==T&&o.reference[m]/2-(_{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rA(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,A=S,E=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(A=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?E=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):A=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:E,availableHeight:A});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,A,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(A.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;A.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,A,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,A,S,C,A,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==A?void 0:A.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{A.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,A,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();E(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nA=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nA],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nE=ec([ev],[eg]),nw=nE.useContext;nE.useScopedContext,nE.useProviderContext,nE.ContextProvider,nE.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),A=y&&c&&(m?"horizontal"!==c:"vertical"!==c),E=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(A&&!E?v:nM(v,g.rowId),l,E),l);return null==e?void 0:e.id}if(A){let e=nT(E?C:S,l);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&E?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return E(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",A="[object WeakMap]",E="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[E]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[A]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eA.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eA.prototype.delete=function(e){return eP(this,e).delete(e)},eA.prototype.get=function(e){return eP(this,e).get(e)},eA.prototype.has=function(e){return eP(this,e).has(e)},eA.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eE.prototype.add=eE.prototype.push=function(e){return this.__data__.set(e,l),this},eE.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eA(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eE:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Backdrop:"MissionSelect-module__N_AIjG__Backdrop",Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),A=x.searchParams,E=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,A??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,A),Object.keys(E.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t)),E.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?A?.getAll(r):A?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${A?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},E.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,A=!1,E=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);bt(e),A?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/ad4fd30929cca23f.js b/docs/_next/static/chunks/ad4fd30929cca23f.js new file mode 100644 index 00000000..e5e2134a --- /dev/null +++ b/docs/_next/static/chunks/ad4fd30929cca23f.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,32424,7368,e=>{"use strict";var t=e.i(25645),s=e.i(12979);let r=(0,t.createLogger)("scriptLoader");function i(){return async e=>{let t;try{t=(0,s.getUrlForPath)(e)}catch(t){return r.warn("Script not in manifest: %s (%s)",e,t),null}try{let s=await fetch(t);if(!s.ok)return r.error("Script fetch failed: %s (%d)",e,s.status),null;return await s.text()}catch(t){return r.error("Script fetch error: %s %o",e,t),null}}}e.s(["createScriptLoader",()=>i],32424),e.s(["ignoreScripts",0,["scripts/admin.cs","scripts/ai.cs","scripts/aiBotProfiles.cs","scripts/aiBountyGame.cs","scripts/aiChat.cs","scripts/aiCnH.cs","scripts/aiCTF.cs","scripts/aiDeathMatch.cs","scripts/aiDebug.cs","scripts/aiDefaultTasks.cs","scripts/aiDnD.cs","scripts/aiHumanTasks.cs","scripts/aiHunters.cs","scripts/aiInventory.cs","scripts/aiObjectiveBuilder.cs","scripts/aiObjectives.cs","scripts/aiRabbit.cs","scripts/aiSiege.cs","scripts/aiTDM.cs","scripts/aiTeamHunters.cs","scripts/deathMessages.cs","scripts/graphBuild.cs","scripts/navGraph.cs","scripts/serverTasks.cs","scripts/spdialog.cs"]],7368)},81405,(e,t,s)=>{var r;e.e,(r=function(){function e(e){return i.appendChild(e.dom),e}function t(e){for(var t=0;tl+1e3&&(c.update(1e3*n/(e-l),100),l=e,n=0,f)){var t=performance.memory;f.update(t.usedJSHeapSize/1048576,t.jsHeapSizeLimit/1048576)}return e},update:function(){a=this.end()},domElement:i,setMode:t}}).Panel=function(e,t,s){var r=1/0,i=0,a=Math.round,l=a(window.devicePixelRatio||1),n=80*l,c=48*l,o=3*l,f=2*l,u=3*l,d=15*l,m=74*l,p=30*l,h=document.createElement("canvas");h.width=n,h.height=c,h.style.cssText="width:80px;height:48px";var b=h.getContext("2d");return b.font="bold "+9*l+"px Helvetica,Arial,sans-serif",b.textBaseline="top",b.fillStyle=s,b.fillRect(0,0,n,c),b.fillStyle=t,b.fillText(e,o,f),b.fillRect(u,d,m,p),b.fillStyle=s,b.globalAlpha=.9,b.fillRect(u,d,m,p),{dom:h,update:function(c,x){r=Math.min(r,c),i=Math.max(i,c),b.fillStyle=s,b.globalAlpha=1,b.fillRect(0,0,n,d),b.fillStyle=t,b.fillText(a(c)+" "+e+" ("+a(r)+"-"+a(i)+")",o,f),b.drawImage(h,u+l,d,m-l,p,u,d,m-l,p),b.fillRect(u+m-l,d,l,p),b.fillStyle=s,b.globalAlpha=.9,b.fillRect(u+m-l,d,l,a((1-c/x)*p))}}},t.exports=r},55141,e=>{e.v({AxisLabel:"DebugElements-module__Cmeo9W__AxisLabel",StatsPanel:"DebugElements-module__Cmeo9W__StatsPanel"})},86855,e=>{"use strict";var t=e.i(43476),s=e.i(932),r=e.i(71645),i=e.i(40859),i=i,a=i,l=e.i(81405);function n(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}function c({showPanel:e=0,className:t,parent:s}){let c=function(e,t=[],s){let[i,a]=r.useState();return r.useLayoutEffect(()=>{let t=e();return a(t),n(void 0,t),()=>n(void 0,null)},t),i}(()=>new l.default,[]);return r.useEffect(()=>{if(c){let r=s&&s.current||document.body;c.showPanel(e),null==r||r.appendChild(c.dom);let l=(null!=t?t:"").split(" ").filter(e=>e);l.length&&c.dom.classList.add(...l);let n=(0,i.j)(()=>c.begin()),o=(0,a.k)(()=>c.end());return()=>{l.length&&c.dom.classList.remove(...l),null==r||r.removeChild(c.dom),n(),o()}}},[s,c,t,e]),null}var o=e.i(60099),f=e.i(55141);function u(){let e,i,a,l,n,u,d,m,p,h,b=(0,s.c)(10),x=(0,r.useRef)(null);return b[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=x.current;e&&e.setColors("rgb(153, 255, 0)","rgb(0, 153, 255)","rgb(255, 153, 0)")},b[0]=e):e=b[0],(0,r.useEffect)(e),b[1]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)(c,{className:f.default.StatsPanel}),b[1]=i):i=b[1],b[2]===Symbol.for("react.memo_cache_sentinel")?(a=[70],b[2]=a):a=b[2],b[3]===Symbol.for("react.memo_cache_sentinel")?(l=(0,t.jsx)("axesHelper",{ref:x,args:a,renderOrder:999,children:(0,t.jsx)("lineBasicMaterial",{depthTest:!1,depthWrite:!1,fog:!1,vertexColors:!0})}),b[3]=l):l=b[3],b[4]===Symbol.for("react.memo_cache_sentinel")?(n=[80,0,0],b[4]=n):n=b[4],b[5]===Symbol.for("react.memo_cache_sentinel")?(u=(0,t.jsx)(o.Html,{position:n,center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"y",children:"Y"})}),b[5]=u):u=b[5],b[6]===Symbol.for("react.memo_cache_sentinel")?(d=[0,80,0],b[6]=d):d=b[6],b[7]===Symbol.for("react.memo_cache_sentinel")?(m=(0,t.jsx)(o.Html,{position:d,center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"z",children:"Z"})}),b[7]=m):m=b[7],b[8]===Symbol.for("react.memo_cache_sentinel")?(p=[0,0,80],b[8]=p):p=b[8],b[9]===Symbol.for("react.memo_cache_sentinel")?(h=(0,t.jsxs)(t.Fragment,{children:[i,l,u,m,(0,t.jsx)(o.Html,{position:p,center:!0,children:(0,t.jsx)("span",{className:f.default.AxisLabel,"data-axis":"x",children:"X"})})]}),b[9]=h):h=b[9],h}e.s(["DebugElements",()=>u],86855)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/b30d580062e7b044.js b/docs/_next/static/chunks/b30d580062e7b044.js new file mode 100644 index 00000000..2403359a --- /dev/null +++ b/docs/_next/static/chunks/b30d580062e7b044.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,68754,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function E(e){return e}function A(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function _(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function w(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function I(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function F(){return r&&!!navigator.maxTouchPoints}function L(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function O(){return r&&L()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function N(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function j(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(j(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},V=U.useId;U.useDeferredValue;var q=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return q?q(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)I(r,t)}},e)}function Q(e){if(V){let t=V();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function z(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eE(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eA(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eA(i))}),n}function e_(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eE);return(t&&eE(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=e_(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function ew(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eA(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eE)||(e?i.find(eE):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eI(e){!eR(e)&&ex(e)&&e.focus()}var eF=O(),eL=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eO=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function eN(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var ej=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(j("mousedown",ek,!0),j("keydown",eN,!0),eB=!0)},[e]),eF&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&w(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eF||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eO]=!0),N(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eO]=!1),n||eI(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,E=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;N(r,"focusout",()=>C(t,r))}),A=i.onFocusCapture,_=W(t=>{if(null==A||A(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eL.includes(n))}(t.target)?N(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,I=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),F=(0,R.useContext)(eS),L=W(t=>{e&&r&&t&&F&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),O=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!O||"button"===O||"summary"===O||"input"===O||"select"===O||"textarea"===O||"a"===O),G=e&&(!O||"button"===O||"input"===O||"select"===O||"textarea"===O),U=i.style,V=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,L,i.ref),style:V,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:E,onFocusCapture:_,onBlur:I},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eV(e){return e.slice().reverse()}function eq(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",ej(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();A(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eq(e,i.onKeyDownCapture,u),v=eq(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,E=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),_=i.onBlurCapture,w=W(t=>{var r;if(null==_||_(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),I=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eV(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:E,onBlurCapture:w,onKeyDown:I},i=ej({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,eQ=ec([eW.ContextProvider],[eW.ScopedContextProvider]);eQ.useContext,eQ.useScopedContext;var ez=eQ.useProviderContext,e$=eQ.ContextProvider,eX=eQ.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e4=(0,R.createContext)(void 0),e5=ec([e1,ev],[e2,eg]),e8=e5.useContext,e6=e5.useScopedContext,e9=e5.useProviderContext,e7=e5.ContextProvider,te=e5.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return A(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,E=e9();A(e=e||E,!1);let w=(0,R.useRef)(null),[T,M]=$(),I=(0,R.useRef)(!1),F=(0,R.useRef)(!1),L=e.useState(e=>e.virtualFocus&&r),O="inline"===y||"both"===y,[P,D]=(0,R.useState)(O);C=[O],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{O&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let j=e.useState(e=>{var t;if(O&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),V=e.useState("open"),q=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!O||!P)return B;if(tp(U,j,L)){if(tm(B,j)){let e=(null==j?void 0:j.slice(B.length))||"";return B+e}return B}return j||B},[O,P,U,j,L,B]);(0,R.useEffect)(()=>{let e=w.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!O||!P||!j||!tp(U,j,L)||!tm(B,j))return;let e=S;return queueMicrotask(()=>{let t=w.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=j.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,O,P,j,U,L,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!V||!q)return;let t=h(q);if(!t)return;Z.current=t;let r=()=>{I.current=!1},n=()=>{if(!e||!I.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(I.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[V,q,e]),H(()=>{!B||F.current||(I.current=!0)},[B]),H(()=>{"always"!==L&&V||(I.current=V)},[L,V]);let et=e.useState("resetValueOnSelect");z(()=>{var t,r;let n=I.current;if(!e||!V||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(L&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,V,T,B,L,et,J,U]),(0,R.useEffect)(()=>{if(!O)return;let t=w.current;if(!t)return;let r=[t,q].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[O,q,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(I.current=!0,"input"===a.type&&(a.isComposing&&(I.current=!1,F.current=!0),O)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),O&&L&&t&&M()}ei(t)&&e.show(),L&&I.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{I.current=!0,F.current=!1,null==el||el(e),e.defaultPrevented||L&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&N(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(I.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(I.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=Q(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(q,"listbox"),"aria-expanded":V,"aria-controls":null==q?void 0:q.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(w,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!_(g,e)&&(O&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();A(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(j("mousemove",en,!0),j("mousedown",ei,!0),j("mouseup",ei,!0),j("keydown",ei,!0),j("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=E,element:n,...i}){let o=ed();e=e||o;let a=Q(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tE=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=w(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?N(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return ej(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tE(e))});var{useSyncExternalStore:tA}=e.i(2239).default,t_=()=>()=>{};function tw(e,t=E){let r=R.useCallback(t=>e?tl(e,null,t):t_(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tA(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):t_(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tA(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>tw(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tI(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&atR,"useStoreProps",()=>tM,"useStoreState",()=>tw,"useStoreStateObject",()=>tT],68754);var tF=es(function({store:e,rowId:t,preventScrollOnKeyDown:r=!1,moveOnKeyPress:i=!0,tabbable:o=!1,getItem:a,"aria-setsize":l,"aria-posinset":s,...c}){let m=em();e=e||m;let h=Q(c.id),v=(0,R.useRef)(null),g=(0,R.useContext)(eb),S=w(c)&&!c.accessibleWhenDisabled,{rowId:C,baseElement:x,isActiveItem:E,ariaSetSize:A,ariaPosInSet:_,isTabbable:M}=tT(e,{rowId:e=>t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),I=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),F=c.onFocus,L=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==F||F(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((O()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),L.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&L.current&&(L.current=!1,t.preventDefault(),t.stopPropagation())}),N=c.onKeyDown,j=X(r),U=X(i),V=W(t=>{if(null==N||N(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tI(r,e,null==e?void 0:e.up,!0),PageDown:()=>tI(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(j(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),q=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":E||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:q,children:e}),[q]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:V},c=tE(c),T({...c=tS({store:e,...c,getItem:I,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":A,"aria-posinset":_})});el(ea(function(e){return eu("button",tF(e))}));var tL=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();A(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),E=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=L();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),_=s.onKeyDown,w=W(t=>{if(null==_||_(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e4)])?d:"option",children:t,...s,onClick:E,onKeyDown:w};let T=X(l);return s=tF({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tO=el(ea(function(e){return eu("div",tL(e))}));e.s(["ComboboxItem",()=>tO],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();A(e=e||n,!1);let i=(0,R.useRef)(null),o=Q(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=tw(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tN=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===tw(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tN,{...t})});var tj=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;A(e,!1);let a=(0,R.useRef)(null),l=Q(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e4.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tj(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tj],86447);var tV=(0,R.createContext)(null),tq=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tq(e))});var tH=es(function(e){return tq(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tQ=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tV),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),I(i,t),!a)return()=>{t.remove(),I(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of e_(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tV.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(ew()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=ew();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=ew())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tQ(e))});var tz=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tz),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tz.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t4(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t5(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t4(e,t,t=>{t5(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=tw(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return j(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eO]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=e_(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return z(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=tw(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=O();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:E,unstable_treeSnapshotKey:A,..._}){var w;let T,M,I,O=ez(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||O,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,_.portalRef),k=_.preserveTabOrder,U=tw(D,e=>k&&!f&&e.mounted),V=Q(_.id),q=tw(D,"open"),z=tw(D,"mounted"),J=tw(D,"contentElement"),ee=tG(z,_.hidden,_.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:V,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=L()&&!(r&&navigator.platform.startsWith("Mac")&&!F());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),w=tw(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!w){M.current=null;return}return j("mousedown",e=>{M.current=e.target},!0)},[w]),re({...I={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...I,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...I,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);_=Y(_,et,[et]),H(()=>{if(!q)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,q]),rc&&(0,R.useEffect)(()=>{if(!z)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),N(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eI(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,z]),(0,R.useEffect)(()=>{if(!z||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[z,G]),(0,R.useEffect)(()=>{if(!f||!z||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,z,G]),H(()=>{if(!rn()||q||!z||!G)return;let e=P.current;if(e)return ri(e)},[q,z,G]);let en=q&&G;H(()=>{if(V&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t4(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(V,[P.current])},[V,en,A]);let ei=W(v);H(()=>{if(!V||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(V,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t4(V,t,n=>{t5(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(V,[e,...t])},[V,D,en,ei,er,f,A]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!q||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=e_(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[q,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(q)return ep(!0),()=>ep(!1)},[q]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(q||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[q,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&z)return j("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,z,ev]);let eg=(_=Y(_,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=_.alwaysVisible;_=Y(_,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eE]=(0,R.useState)();return _=tX({..._={id:V,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,..._=Y(_,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eE,children:e})})}),[D]),ref:K(P,_.ref)},autoFocusOnShow:eu}),_=tQ({portal:d,..._=ej({..._=tk({store:D,..._}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=ez){return ea(function(r){let n=t();return tw(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),ez);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rE(e){return e.split("-")[1]}function rA(e){return"x"===e?"y":"x"}function r_(e){return"y"===e?"height":"width"}let rw=new Set(["top","bottom"]);function rT(e){return rw.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rI=["right","left"],rF=["top","bottom"],rL=["bottom","top"];function rO(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rA(rT(t)),u=r_(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rE(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rV(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rq(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rq(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rq(e).Element)}function rQ(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rq(e).HTMLElement)}function rz(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r4(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r4(){return!("u"rK(e)&&"body"!==rV(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();A(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),E=e.useState("popoverElement"),_=e.useState("contentElement"),w=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),I=(0,R.useRef)(null),[F,L]=(0,R.useState)(!1),{portalRef:O,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==E?void 0:E.isConnected))return;E.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(I.current=I.current||document.createElement("div"));let C=S||I.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rj(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return A(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:E="none",flipAlignment:A=!0,..._}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let w=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),I=C||(M||!A?[rO(v)]:(c=rO(v),[rM(v),c,rM(c)])),F="none"!==E;!C&&F&&I.push(...(f=rE(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rI:rR;return t?rR:rI;case"left":case"right":return t?rF:rL;default:return[]}}(rx(v),"start"===E,R),f&&(d=d.map(e=>e+"-"+f),A&&(d=d.concat(d.map(rM)))),d));let L=[v,...I],O=await g.detectOverflow(e,_),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(O[w]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rE(l),r=r_(t=rA(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rO(n)),[n,rO(n)]);P.push(O[i[0]],O[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=L[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(F){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rA(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rN.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rA(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rA(rT(i)),m=r_(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,E=rm(f[v?"top":"left"],x),A=rm(f[v?"bottom":"right"],x),_=C-h[m]-A,w=C/2-h[m]/2+(y/2-b/2),T=rh(E,rm(w,_)),M=!u.arrow&&null!=rE(i)&&w!==T&&o.reference[m]/2-(w{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rE(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,E=S,A=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(A=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(E=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?A=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):E=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:A,availableHeight:E});let _=await u.getDimensions(s.floating);return v!==_.width||g!==_.height?{reset:{rects:!0}}:{}}}],_=await (v={placement:w,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,E,{...y,platform:b}));null==e||e.setState("currentPlacement",_.placement),L(!0);let M=nS(_.x),R=nS(_.y);if(Object.assign(E.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&_.middlewareData.arrow){let{x:e,y:t}=_.middlewareData.arrow,r=_.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;E.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,E,async()=>{G?(await B({updatePosition:r}),L(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{L(!1),n()}},[e,M,E,S,C,E,w,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==E?void 0:E.isConnected)||!(null==_?void 0:_.isConnected))return;let e=()=>{E.style.zIndex=getComputedStyle(_).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,E,_]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!F||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:F&&i,...y,portalRef:O})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();A(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=tw(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tj({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!_(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nE=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nE],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nA=ec([ev],[eg]),n_=nA.useContext;nA.useScopedContext,nA.useProviderContext,nA.ContextProvider,nA.ScopedContextProvider;var nw={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nI(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nF=O()&&F();function nL({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nI(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),E=y&&c&&(m?"horizontal"!==c:"vertical"!==c),A=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[nw]:[],...e.slice(0,n)]}(E&&!A?v:nM(v,g.rowId),l,A),l);return null==e?void 0:e.id}if(E){let e=nT(A?C:S,l);return A?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let _=nT(C,l);return!_&&A?null:null==_?void 0:_.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eV(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nF&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nO(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=n_();let[c,f]=tR(nL,e={id:Q((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return z(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,z(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,z(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nO(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nO],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return A(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nN=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nN],59129);var nj=es(function(e){let t=(0,R.useContext)(nD),r=Q(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nj(e))});var nU=es(function({store:e,...t}){return nj(t)});ea(function(e){return eu("div",nU(e))});var nV=es(function(e){return nU(e)}),nq=ea(function(e){return eu("div",nV(e))});e.s(["ComboboxGroupLabel",()=>nq],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nQ(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nz(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nz(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nz(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nQ.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nQ],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",E="[object WeakMap]",A="[object ArrayBuffer]",_="[object DataView]",w=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,I=/\\(\\)?/g,F=/^\[object .+?Constructor\]$/,L=/^(?:0|[1-9]\d*)$/,O={};O["[object Float32Array]"]=O["[object Float64Array]"]=O["[object Int8Array]"]=O["[object Int16Array]"]=O["[object Int32Array]"]=O["[object Uint8Array]"]=O["[object Uint8ClampedArray]"]=O["[object Uint16Array]"]=O["[object Uint32Array]"]=!0,O[s]=O[c]=O[A]=O[f]=O[_]=O[d]=O[p]=O[m]=O[h]=O[v]=O[g]=O[b]=O[S]=O[C]=O[E]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,N=k&&k.exports===G&&P.process,j=function(){try{return N&&N.binding("util")}catch(e){}}(),U=j&&j.isTypedArray;function V(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=ew(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eE.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eE.prototype.delete=function(e){return eP(this,e).delete(e)},eE.prototype.get=function(e){return eP(this,e).get(e)},eE.prototype.has=function(e){return eP(this,e).has(e)},eE.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eA.prototype.add=eA.prototype.push=function(e){return this.__data__.set(e,l),this},eA.prototype.has=function(e){return this.__data__.has(e)},e_.prototype.clear=function(){this.__data__=new ex},e_.prototype.delete=function(e){return this.__data__.delete(e)},e_.prototype.get=function(e){return this.__data__.get(e)},e_.prototype.has=function(e){return this.__data__.has(e)},e_.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eE(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!eQ(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eA:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?q(U):function(e){return eY(e)&&e$(e.length)&&!!O[ee.call(e)]};function e0(e){return eQ(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Backdrop:"MissionSelect-module__N_AIjG__Backdrop",Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,scene:_,onPointerMissed:w,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[I,F]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),L=r.useRef(null),O=r.useRef(null);r.useImperativeHandle(e,()=>L.current);let P=(0,t.a)(w),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let N=r.useRef(null);(0,t.b)(()=>{let e=L.current;F.width>0&&F.height>0&&e&&(N.current||(N.current=(0,t.c)(e)),async function(){await N.current.configure({gl:f,scene:_,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:E,camera:A,size:F,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:O.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),N.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=L.current;if(e)return()=>(0,t.d)(e)},[]);let j=p?"none":"auto";return(0,s.jsx)("div",{ref:O,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:j,...c},...M,children:(0,s.jsx)("div",{ref:I,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:L,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)},85413,e=>{"use strict";var t=Object.defineProperty;class r{constructor(){((e,r,n)=>{let i;return(i="symbol"!=typeof r?r+"":r)in e?t(e,i,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[i]=n})(this,"_listeners")}addEventListener(e,t){void 0===this._listeners&&(this._listeners={});let r=this._listeners;void 0===r[e]&&(r[e]=[]),-1===r[e].indexOf(t)&&r[e].push(t)}hasEventListener(e,t){if(void 0===this._listeners)return!1;let r=this._listeners;return void 0!==r[e]&&-1!==r[e].indexOf(t)}removeEventListener(e,t){if(void 0===this._listeners)return;let r=this._listeners[e];if(void 0!==r){let e=r.indexOf(t);-1!==e&&r.splice(e,1)}}dispatchEvent(e){if(void 0===this._listeners)return;let t=this._listeners[e.type];if(void 0!==t){e.target=this;let r=t.slice(0);for(let t=0,n=r.length;tr])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/cc36ef62835b35ab.js b/docs/_next/static/chunks/cc36ef62835b35ab.js deleted file mode 100644 index f847502a..00000000 --- a/docs/_next/static/chunks/cc36ef62835b35ab.js +++ /dev/null @@ -1,521 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,65883,e=>{e.v({ButtonGroup:"InspectorControls-module__gNRB6W__ButtonGroup",ButtonHint:"InspectorControls-module__gNRB6W__ButtonHint",ButtonLabel:"InspectorControls-module__gNRB6W__ButtonLabel",CheckboxField:"InspectorControls-module__gNRB6W__CheckboxField",Control:"InspectorControls-module__gNRB6W__Control",Description:"InspectorControls-module__gNRB6W__Description",Dropdown:"InspectorControls-module__gNRB6W__Dropdown",Field:"InspectorControls-module__gNRB6W__Field",ForceRenderButton:"InspectorControls-module__gNRB6W__ForceRenderButton",Group:"InspectorControls-module__gNRB6W__Group",IconButton:"InspectorControls-module__gNRB6W__IconButton",InspectorControls:"InspectorControls-module__gNRB6W__InspectorControls",Label:"InspectorControls-module__gNRB6W__Label",LabelledButton:"InspectorControls-module__gNRB6W__LabelledButton",MapInfoButton:"InspectorControls-module__gNRB6W__MapInfoButton InspectorControls-module__gNRB6W__IconButton InspectorControls-module__gNRB6W__LabelledButton",Toggle:"InspectorControls-module__gNRB6W__Toggle InspectorControls-module__gNRB6W__IconButton",Tools:"InspectorControls-module__gNRB6W__Tools"})},36679,e=>{e.v({ButtonLabel:"CopyCoordinatesButton-module__BxovtG__ButtonLabel "+e.i(65883).ButtonLabel,ClipboardCheck:"CopyCoordinatesButton-module__BxovtG__ClipboardCheck",MapPin:"CopyCoordinatesButton-module__BxovtG__MapPin",Root:"CopyCoordinatesButton-module__BxovtG__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,showClipboardCheck:"CopyCoordinatesButton-module__BxovtG__showClipboardCheck"})},28903,e=>{e.v({ButtonHint:"LoadDemoButton-module__kGZaoW__ButtonHint "+e.i(65883).ButtonHint,ButtonLabel:"LoadDemoButton-module__kGZaoW__ButtonLabel "+e.i(65883).ButtonLabel,Root:"LoadDemoButton-module__kGZaoW__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton})},9607,e=>{e.v({ButtonHint:"JoinServerButton-module__DIR70a__ButtonHint "+e.i(65883).ButtonHint,PingLabel:"JoinServerButton-module__DIR70a__PingLabel "+e.i(65883).ButtonLabel,Pulsing:"JoinServerButton-module__DIR70a__Pulsing",Root:"JoinServerButton-module__DIR70a__Root "+e.i(65883).IconButton+" "+e.i(65883).LabelledButton,TextLabel:"JoinServerButton-module__DIR70a__TextLabel "+e.i(65883).ButtonLabel,blink:"JoinServerButton-module__DIR70a__blink"})},81323,e=>{e.v({AccordionGroup:"Accordion-module__rN-DYq__AccordionGroup",Body:"Accordion-module__rN-DYq__Body",Content:"Accordion-module__rN-DYq__Content",Trigger:"Accordion-module__rN-DYq__Trigger",TriggerIcon:"Accordion-module__rN-DYq__TriggerIcon",slideDown:"Accordion-module__rN-DYq__slideDown",slideUp:"Accordion-module__rN-DYq__slideUp"})},16964,e=>{e.v({ActionButton:"StreamingMissionInfo-module__hEaQnW__ActionButton "+e.i(65883).IconButton,Attribution:"StreamingMissionInfo-module__hEaQnW__Attribution",EjectIcon:"StreamingMissionInfo-module__hEaQnW__EjectIcon",Header:"StreamingMissionInfo-module__hEaQnW__Header",Metadata:"StreamingMissionInfo-module__hEaQnW__Metadata",MissionInfo:"StreamingMissionInfo-module__hEaQnW__MissionInfo",MissionName:"StreamingMissionInfo-module__hEaQnW__MissionName "+e.i(97442).SelectedName,MissionType:"StreamingMissionInfo-module__hEaQnW__MissionType "+e.i(97442).ItemType,MissionTypeDisplayName:"StreamingMissionInfo-module__hEaQnW__MissionTypeDisplayName",PlayerName:"StreamingMissionInfo-module__hEaQnW__PlayerName",RecordingDate:"StreamingMissionInfo-module__hEaQnW__RecordingDate",ServerInfo:"StreamingMissionInfo-module__hEaQnW__ServerInfo",ServerName:"StreamingMissionInfo-module__hEaQnW__ServerName"})},29418,e=>{e.v({Bottom:"PlayerNameplate-module__zYDm0a__Bottom PlayerNameplate-module__zYDm0a__Root",HealthBar:"PlayerNameplate-module__zYDm0a__HealthBar",HealthFill:"PlayerNameplate-module__zYDm0a__HealthFill",IffArrow:"PlayerNameplate-module__zYDm0a__IffArrow",Name:"PlayerNameplate-module__zYDm0a__Name",Root:"PlayerNameplate-module__zYDm0a__Root",Top:"PlayerNameplate-module__zYDm0a__Top PlayerNameplate-module__zYDm0a__Root"})},78779,e=>{e.v({Distance:"FlagMarker-module__INpLba__Distance",Icon:"FlagMarker-module__INpLba__Icon",Root:"FlagMarker-module__INpLba__Root"})},89271,e=>{e.v({LoadingIndicator:"LoadingIndicator-module__F20Nda__LoadingIndicator",Progress:"LoadingIndicator-module__F20Nda__Progress",ProgressBar:"LoadingIndicator-module__F20Nda__ProgressBar",ProgressText:"LoadingIndicator-module__F20Nda__ProgressText",Spinner:"LoadingIndicator-module__F20Nda__Spinner",loadingComplete:"LoadingIndicator-module__F20Nda__loadingComplete",spin:"LoadingIndicator-module__F20Nda__spin"})},82156,e=>{e.v({Backdrop:"MapInspector-module__nU0WNq__Backdrop",CancelButton:"MapInspector-module__nU0WNq__CancelButton",Content:"MapInspector-module__nU0WNq__Content",Frame:"MapInspector-module__nU0WNq__Frame",PlayerBar:"MapInspector-module__nU0WNq__PlayerBar",Sidebar:"MapInspector-module__nU0WNq__Sidebar",ThreeView:"MapInspector-module__nU0WNq__ThreeView",ToggleSidebarButton:"MapInspector-module__nU0WNq__ToggleSidebarButton",Toolbar:"MapInspector-module__nU0WNq__Toolbar",layout:"MapInspector-module__nU0WNq__layout"})},31713,e=>{"use strict";var t=e.i(43476),r=e.i(932),a=e.i(71645),n=e.i(17751),o=e.i(12598),i=e.i(38847);let l=(0,a.createContext)({live:!1});function s(e){let n,o,s=(0,r.c)(5),{children:u}=e,[d]=(0,i.useQueryState)("features",i.parseAsString);s[0]!==d?(n=()=>({live:new Set((d??"").split(",").map(c).filter(Boolean)).has("live")}),s[0]=d,s[1]=n):n=s[1];let[m]=(0,a.useState)(n);return s[2]!==u||s[3]!==m?(o=(0,t.jsx)(l.Provider,{value:m,children:u}),s[2]=u,s[3]=m,s[4]=o):o=s[4],o}function c(e){return e.trim().toLowerCase()}var u=e.i(40141);function d(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"currentColor"},child:[{tag:"path",attr:{d:"M16 21L11.2381 12.2698L15 6L23 21H16ZM8 10L14 21H2L8 10ZM5.5 8C4.11929 8 3 6.88071 3 5.5C3 4.11929 4.11929 3 5.5 3C6.88071 3 8 4.11929 8 5.5C8 6.88071 6.88071 8 5.5 8Z"},child:[]}]})(e)}function m(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM305 273L177 401c-9.4 9.4-24.6 9.4-33.9 0L79 337c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L271 239c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"},child:[]}]})(e)}function f(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M463.5 224l8.5 0c13.3 0 24-10.7 24-24l0-128c0-9.7-5.8-18.5-14.8-22.2s-19.3-1.7-26.2 5.2L413.4 96.6c-87.6-86.5-228.7-86.2-315.8 1c-87.5 87.5-87.5 229.3 0 316.8s229.3 87.5 316.8 0c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0c-62.5 62.5-163.8 62.5-226.3 0s-62.5-163.8 0-226.3c62.2-62.2 162.7-62.5 225.3-1L327 183c-6.9 6.9-8.9 17.2-5.2 26.2s12.5 14.8 22.2 14.8l119.5 0z"},child:[]}]})(e)}function h(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M2 8V2h6"},child:[]},{tag:"path",attr:{d:"m2 2 10 10"},child:[]},{tag:"path",attr:{d:"M12 2A10 10 0 1 1 2 12"},child:[]}]})(e)}function p(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1"},child:[]},{tag:"path",attr:{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"},child:[]},{tag:"path",attr:{d:"M12 11h4"},child:[]},{tag:"path",attr:{d:"M12 16h4"},child:[]},{tag:"path",attr:{d:"M8 11h.01"},child:[]},{tag:"path",attr:{d:"M8 16h.01"},child:[]}]})(e)}function g(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"m16 15-3-3 3-3"},child:[]}]})(e)}function v(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M9 3v18"},child:[]},{tag:"path",attr:{d:"m14 9 3 3-3 3"},child:[]}]})(e)}function x(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"m9 16 3-3 3 3"},child:[]}]})(e)}function y(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"rect",attr:{width:"18",height:"18",x:"3",y:"3",rx:"2"},child:[]},{tag:"path",attr:{d:"M3 9h18"},child:[]},{tag:"path",attr:{d:"m15 14-3 3-3-3"},child:[]}]})(e)}var b=e.i(79123),_=e.i(11152),S=e.i(36679);function j(e){let n,o,i,l,s,c=(0,r.c)(12),{cameraRef:u,missionName:d,missionType:f,disabled:h}=e,{fogEnabled:p}=(0,b.useSettings)(),[g,v]=(0,a.useState)(!1),x=(0,a.useRef)(null);c[0]!==u||c[1]!==p||c[2]!==d||c[3]!==f?(n=async()=>{clearTimeout(x.current);let e=u.current;if(!e)return;let t=function({position:e,quaternion:t}){let r=e=>parseFloat(e.toFixed(3)),a=`${r(e.x)},${r(e.y)},${r(e.z)}`,n=`${r(t.x)},${r(t.y)},${r(t.z)},${r(t.w)}`;return`#c${a}~${n}`}(e),r=new URLSearchParams;r.set("mission",`${d}~${f}`),r.set("fog",p.toString());let a=`${window.location.pathname}?${r}${t}`,n=`${window.location.origin}${a}`;window.history.replaceState(null,"",a);try{await navigator.clipboard.writeText(n),v(!0),x.current=setTimeout(()=>{v(!1)},1100)}catch(e){console.error(e)}},c[0]=u,c[1]=p,c[2]=d,c[3]=f,c[4]=n):n=c[4];let y=n,j=g?"true":"false";return c[5]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)(_.FaMapPin,{className:S.default.MapPin}),i=(0,t.jsx)(m,{className:S.default.ClipboardCheck}),l=(0,t.jsx)("span",{className:S.default.ButtonLabel,children:" Link to coordinates"}),c[5]=o,c[6]=i,c[7]=l):(o=c[5],i=c[6],l=c[7]),c[8]!==h||c[9]!==y||c[10]!==j?(s=(0,t.jsxs)("button",{type:"button",className:S.default.Root,"aria-label":"Link to coordinates",title:"Copy the current coordinates to URL",onClick:y,disabled:h,"data-copied":j,id:"copyCoordinatesButton",children:[o,i,l]}),c[8]=h,c[9]=y,c[10]=j,c[11]=s):s=c[11],s}function C(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M21 3H3c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h5v2h8v-2h5c1.1 0 1.99-.9 1.99-2L23 5a2 2 0 0 0-2-2zm0 14H3V5h18v12zm-5-6-7 4V7z"},child:[]}]})(e)}var w=e.i(25645),M=e.i(98755),N=e.i(32865),T=e.i(28903);let k=(0,w.createLogger)("LoadDemoButton");function F({isActive:r=!1,choosingMap:n=!1,onCancelChoosingMap:o}){let i=(0,N.useRecording)(),l=i?.source==="demo",{setRecording:s}=(0,N.usePlaybackActions)(),c=(0,a.useRef)(null),u=(0,a.useRef)(0),d=(0,a.useCallback)(()=>{if(n&&l)return void o?.();if(l){u.current+=1,s(null);return}c.current?.click()},[l,n,o,s]),m=(0,a.useCallback)(async t=>{let r=t.target.files?.[0];if(r){t.target.value="";try{let t=await r.arrayBuffer(),a=u.current+1;u.current=a;let{createDemoStreamingRecording:n}=await e.A(60946),o=await n(t);if(u.current!==a)return;let i=M.liveConnectionStore.getState();i.disconnectServer(),i.disconnectRelay(),s(o)}catch(e){k.error("Failed to load demo: %o",e)}}},[s]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("input",{ref:c,type:"file",accept:".rec",style:{display:"none"},onChange:m}),(0,t.jsxs)("button",{type:"button",className:T.default.Root,"aria-label":l?"Unload demo":"Load demo (.rec)",title:l?"Unload demo":"Load demo (.rec)",onClick:d,"data-active":r,children:[(0,t.jsx)(C,{className:T.default.DemoIcon}),(0,t.jsx)("span",{className:T.default.ButtonLabel,children:"Demo"}),(0,t.jsx)("span",{className:T.default.ButtonHint,children:n&&l?"Return to demo":l?"Click to unload":"Load a .rec file"})]})]})}function R(e){return(0,u.GenIcon)({tag:"svg",attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M11.251.068a.5.5 0 0 1 .227.58L9.677 6.5H13a.5.5 0 0 1 .364.843l-8 8.5a.5.5 0 0 1-.842-.49L6.323 9.5H3a.5.5 0 0 1-.364-.843l8-8.5a.5.5 0 0 1 .615-.09z"},child:[]}]})(e)}var D=e.i(9607);function L(e){let a,n,o,i,l,s,c=(0,r.c)(19),{isActive:u,onOpenServerBrowser:d}=e,m=(0,M.useLiveSelector)(I),f=(0,M.useLiveSelector)(M.selectPing),h=(0,M.useLiveSelector)(B),p="connected"===m,g="connecting"===m||"challenging"===m||"authenticating"===m,v=p?"Connected – click to disconnect":"Join server",x=p?"Connected – click to disconnect":"Join server";c[0]!==h||c[1]!==p||c[2]!==d?(a=()=>{p?h():d()},c[0]=h,c[1]=p,c[2]=d,c[3]=a):a=c[3];let y=`${D.default.LiveIcon} ${p?D.default.Pulsing:""}`;if(c[4]!==y?(n=(0,t.jsx)(R,{className:y}),c[4]=y,c[5]=n):n=c[5],c[6]===Symbol.for("react.memo_cache_sentinel")?(o=(0,t.jsx)("span",{className:D.default.TextLabel,children:"Live"}),c[6]=o):o=c[6],c[7]!==g||c[8]!==f)i=g?"Connecting…":null!=f?`${f.toLocaleString()} ms`:"Join a game",c[7]=g,c[8]=f,c[9]=i;else i=c[9];return c[10]!==i?(l=(0,t.jsxs)(t.Fragment,{children:[o,(0,t.jsx)("span",{className:D.default.ButtonHint,children:i})]}),c[10]=i,c[11]=l):l=c[11],c[12]!==u||c[13]!==v||c[14]!==x||c[15]!==a||c[16]!==n||c[17]!==l?(s=(0,t.jsxs)("button",{type:"button",className:D.default.Root,"aria-label":v,title:x,onClick:a,"data-active":u,children:[n,l]}),c[12]=u,c[13]=v,c[14]=x,c[15]=a,c[16]=n,c[17]=l,c[18]=s):s=c[18],s}function B(e){return e.disconnectServer}function I(e){return e.gameStatus}function A(e,r=[]){let n=[],o=()=>{let t=n.map(e=>a.createContext(e));return function(r){let n=r?.[e]||t;return a.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){let i=a.createContext(o),l=n.length;n=[...n,o];let s=r=>{let{scope:n,children:o,...s}=r,c=n?.[e]?.[l]||i,u=a.useMemo(()=>s,Object.values(s));return(0,t.jsx)(c.Provider,{value:u,children:o})};return s.displayName=r+"Provider",[s,function(t,n){let s=n?.[e]?.[l]||i,c=a.useContext(s);if(c)return c;if(void 0!==o)return o;throw Error(`\`${t}\` must be used within \`${r}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:a})=>{let n=r(e)[`__scope${a}`];return{...t,...n}},{});return a.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(o,...r)]}function P(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function E(...e){return t=>{let r=!1,a=e.map(e=>{let a=P(e,t);return r||"function"!=typeof a||(r=!0),a});if(r)return()=>{for(let t=0;t{let{children:r,...n}=e;if(a.isValidElement(r)){var o;let e,i,l=(o=r,(i=(e=Object.getOwnPropertyDescriptor(o.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.ref:(i=(e=Object.getOwnPropertyDescriptor(o,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?o.props.ref:o.props.ref||o.ref),s=function(e,t){let r={...t};for(let a in t){let n=e[a],o=t[a];/^on[A-Z]/.test(a)?n&&o?r[a]=(...e)=>{let t=o(...e);return n(...e),t}:n&&(r[a]=n):"style"===a?r[a]={...n,...o}:"className"===a&&(r[a]=[n,o].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==a.Fragment&&(s.ref=t?E(t,l):l),a.cloneElement(r,s)}return a.Children.count(r)>1?a.Children.only(null):null})).displayName=`${r}.SlotClone`,n),i=a.forwardRef((e,r)=>{let{children:n,...i}=e,l=a.Children.toArray(n),s=l.find(W);if(s){let e=s.props.children,n=l.map(t=>t!==s?t:a.Children.count(e)>1?a.Children.only(null):a.isValidElement(e)?e.props.children:null);return(0,t.jsx)(o,{...i,ref:r,children:a.isValidElement(e)?a.cloneElement(e,void 0,n):null})}return(0,t.jsx)(o,{...i,ref:r,children:n})});return i.displayName=`${e}.Slot`,i}var U=Symbol("radix.slottable");function W(e){return a.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===U}var H=new WeakMap;function O(e,t){var r,a;let n,o,i;if("at"in Array.prototype)return Array.prototype.at.call(e,t);let l=(r=e,a=t,n=r.length,(i=(o=$(a))>=0?o:n+o)<0||i>=n?-1:i);return -1===l?void 0:e[l]}function $(e){return e!=e||0===e?0:Math.trunc(e)}function V(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e?.(a),!1===r||!a.defaultPrevented)return t?.(a)}}(class e extends Map{#e;constructor(e){super(e),this.#e=[...super.keys()],H.set(this,!0)}set(e,t){return H.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,r){let a,n=this.has(t),o=this.#e.length,i=$(e),l=i>=0?i:o+i,s=l<0||l>=o?-1:l;if(s===this.size||n&&s===this.size-1||-1===s)return this.set(t,r),this;let c=this.size+ +!n;i<0&&l++;let u=[...this.#e],d=!1;for(let e=l;e=this.size&&(a=this.size-1),this.at(a)}keyFrom(e,t){let r=this.indexOf(e);if(-1===r)return;let a=r+t;return a<0&&(a=0),a>=this.size&&(a=this.size-1),this.keyAt(a)}find(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return a;r++}}findIndex(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return r;r++}return -1}filter(t,r){let a=[],n=0;for(let e of this)Reflect.apply(t,r,[e,n,this])&&a.push(e),n++;return new e(a)}map(t,r){let a=[],n=0;for(let e of this)a.push([e[0],Reflect.apply(t,r,[e,n,this])]),n++;return new e(a)}reduce(...e){let[t,r]=e,a=0,n=r??this.at(0);for(let r of this)n=0===a&&1===e.length?r:Reflect.apply(t,this,[n,r,a,this]),a++;return n}reduceRight(...e){let[t,r]=e,a=r??this.at(-1);for(let r=this.size-1;r>=0;r--){let n=this.at(r);a=r===this.size-1&&1===e.length?n:Reflect.apply(t,this,[a,n,r,this])}return a}toSorted(t){return new e([...this.entries()].sort(t))}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let r=this.keyAt(e),a=this.get(r);t.set(r,a)}return t}toSpliced(...t){let r=[...this.entries()];return r.splice(...t),new e(r)}slice(t,r){let a=new e,n=this.size-1;if(void 0===t)return a;t<0&&(t+=this.size),void 0!==r&&r>0&&(n=r-1);for(let e=t;e<=n;e++){let t=this.keyAt(e),r=this.get(t);a.set(t,r)}return a}every(e,t){let r=0;for(let a of this){if(!Reflect.apply(e,t,[a,r,this]))return!1;r++}return!0}some(e,t){let r=0;for(let a of this){if(Reflect.apply(e,t,[a,r,this]))return!0;r++}return!1}}),"u">typeof window&&window.document&&window.document.createElement;var q=globalThis?.document?a.useLayoutEffect:()=>{};a[" useEffectEvent ".trim().toString()],a[" useInsertionEffect ".trim().toString()];var Q=a[" useInsertionEffect ".trim().toString()]||q;function K({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){let[o,i,l]=function({defaultProp:e,onChange:t}){let[r,n]=a.useState(e),o=a.useRef(r),i=a.useRef(t);return Q(()=>{i.current=t},[t]),a.useEffect(()=>{o.current!==r&&(i.current?.(r),o.current=r)},[r,o]),[r,n,i]}({defaultProp:t,onChange:r}),s=void 0!==e,c=s?e:o;{let t=a.useRef(void 0!==e);a.useEffect(()=>{let e=t.current;if(e!==s){let t=s?"controlled":"uncontrolled";console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${t}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`)}t.current=s},[s,n])}return[c,a.useCallback(t=>{if(s){let r="function"==typeof t?t(e):t;r!==e&&l.current?.(r)}else i(t)},[s,e,i,l])]}Symbol("RADIX:SYNC_STATE"),e.i(74080);var Y=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{let n=G(`Primitive.${r}`),o=a.forwardRef((e,a)=>{let{asChild:o,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,t.jsx)(o?n:r,{...i,ref:a})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{}),J=e=>{var t;let r,n,{present:o,children:i}=e,l=function(e){var t,r;let[n,o]=a.useState(),i=a.useRef(null),l=a.useRef(e),s=a.useRef("none"),[c,u]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},a.useReducer((e,t)=>r[e][t]??e,t));return a.useEffect(()=>{let e=Z(i.current);s.current="mounted"===c?e:"none"},[c]),q(()=>{let t=i.current,r=l.current;if(r!==e){let a=s.current,n=Z(t);e?u("MOUNT"):"none"===n||t?.display==="none"?u("UNMOUNT"):r&&a!==n?u("ANIMATION_OUT"):u("UNMOUNT"),l.current=e}},[e,u]),q(()=>{if(n){let e,t=n.ownerDocument.defaultView??window,r=r=>{let a=Z(i.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(u("ANIMATION_END"),!l.current)){let r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},a=e=>{e.target===n&&(s.current=Z(i.current))};return n.addEventListener("animationstart",a),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",a),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:a.useCallback(e=>{i.current=e?getComputedStyle(e):null,o(e)},[])}}(o),s="function"==typeof i?i({present:l.isPresent}):a.Children.only(i),c=z(l.ref,(t=s,(n=(r=Object.getOwnPropertyDescriptor(t.props,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.ref:(n=(r=Object.getOwnPropertyDescriptor(t,"ref")?.get)&&"isReactWarning"in r&&r.isReactWarning)?t.props.ref:t.props.ref||t.ref));return"function"==typeof i||l.isPresent?a.cloneElement(s,{ref:c}):null};function Z(e){return e?.animationName||"none"}J.displayName="Presence";var X=a[" useId ".trim().toString()]||(()=>void 0),ee=0;function et(e){let[t,r]=a.useState(X());return q(()=>{e||r(e=>e??String(ee++))},[e]),e||(t?`radix-${t}`:"")}var er="Collapsible",[ea,en]=A(er),[eo,ei]=ea(er),el=a.forwardRef((e,r)=>{let{__scopeCollapsible:n,open:o,defaultOpen:i,disabled:l,onOpenChange:s,...c}=e,[u,d]=K({prop:o,defaultProp:i??!1,onChange:s,caller:er});return(0,t.jsx)(eo,{scope:n,disabled:l,contentId:et(),open:u,onOpenToggle:a.useCallback(()=>d(e=>!e),[d]),children:(0,t.jsx)(Y.div,{"data-state":ef(u),"data-disabled":l?"":void 0,...c,ref:r})})});el.displayName=er;var es="CollapsibleTrigger",ec=a.forwardRef((e,r)=>{let{__scopeCollapsible:a,...n}=e,o=ei(es,a);return(0,t.jsx)(Y.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":ef(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...n,ref:r,onClick:V(e.onClick,o.onOpenToggle)})});ec.displayName=es;var eu="CollapsibleContent",ed=a.forwardRef((e,r)=>{let{forceMount:a,...n}=e,o=ei(eu,e.__scopeCollapsible);return(0,t.jsx)(J,{present:a||o.open,children:({present:e})=>(0,t.jsx)(em,{...n,ref:r,present:e})})});ed.displayName=eu;var em=a.forwardRef((e,r)=>{let{__scopeCollapsible:n,present:o,children:i,...l}=e,s=ei(eu,n),[c,u]=a.useState(o),d=a.useRef(null),m=z(r,d),f=a.useRef(0),h=f.current,p=a.useRef(0),g=p.current,v=s.open||c,x=a.useRef(v),y=a.useRef(void 0);return a.useEffect(()=>{let e=requestAnimationFrame(()=>x.current=!1);return()=>cancelAnimationFrame(e)},[]),q(()=>{let e=d.current;if(e){y.current=y.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let t=e.getBoundingClientRect();f.current=t.height,p.current=t.width,x.current||(e.style.transitionDuration=y.current.transitionDuration,e.style.animationName=y.current.animationName),u(o)}},[s.open,o]),(0,t.jsx)(Y.div,{"data-state":ef(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...l,ref:m,style:{"--radix-collapsible-content-height":h?`${h}px`:void 0,"--radix-collapsible-content-width":g?`${g}px`:void 0,...e.style},children:v&&i})});function ef(e){return e?"open":"closed"}var eh=a.createContext(void 0),ep="Accordion",eg=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[ev,ex,ey]=function(e){let r=e+"CollectionProvider",[n,o]=A(r),[i,l]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{let{scope:r,children:n}=e,o=a.default.useRef(null),l=a.default.useRef(new Map).current;return(0,t.jsx)(i,{scope:r,itemMap:l,collectionRef:o,children:n})};s.displayName=r;let c=e+"CollectionSlot",u=G(c),d=a.default.forwardRef((e,r)=>{let{scope:a,children:n}=e,o=z(r,l(c,a).collectionRef);return(0,t.jsx)(u,{ref:o,children:n})});d.displayName=c;let m=e+"CollectionItemSlot",f="data-radix-collection-item",h=G(m),p=a.default.forwardRef((e,r)=>{let{scope:n,children:o,...i}=e,s=a.default.useRef(null),c=z(r,s),u=l(m,n);return a.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...i}),()=>void u.itemMap.delete(s))),(0,t.jsx)(h,{...{[f]:""},ref:c,children:o})});return p.displayName=m,[{Provider:s,Slot:d,ItemSlot:p},function(t){let r=l(e+"CollectionConsumer",t);return a.default.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}(ep),[eb,e_]=A(ep,[ey,en]),eS=en(),ej=a.default.forwardRef((e,r)=>{let{type:a,...n}=e;return(0,t.jsx)(ev.Provider,{scope:e.__scopeAccordion,children:"multiple"===a?(0,t.jsx)(ek,{...n,ref:r}):(0,t.jsx)(eT,{...n,ref:r})})});ej.displayName=ep;var[eC,ew]=eb(ep),[eM,eN]=eb(ep,{collapsible:!1}),eT=a.default.forwardRef((e,r)=>{let{value:n,defaultValue:o,onValueChange:i=()=>{},collapsible:l=!1,...s}=e,[c,u]=K({prop:n,defaultProp:o??"",onChange:i,caller:ep});return(0,t.jsx)(eC,{scope:e.__scopeAccordion,value:a.default.useMemo(()=>c?[c]:[],[c]),onItemOpen:u,onItemClose:a.default.useCallback(()=>l&&u(""),[l,u]),children:(0,t.jsx)(eM,{scope:e.__scopeAccordion,collapsible:l,children:(0,t.jsx)(eD,{...s,ref:r})})})}),ek=a.default.forwardRef((e,r)=>{let{value:n,defaultValue:o,onValueChange:i=()=>{},...l}=e,[s,c]=K({prop:n,defaultProp:o??[],onChange:i,caller:ep}),u=a.default.useCallback(e=>c((t=[])=>[...t,e]),[c]),d=a.default.useCallback(e=>c((t=[])=>t.filter(t=>t!==e)),[c]);return(0,t.jsx)(eC,{scope:e.__scopeAccordion,value:s,onItemOpen:u,onItemClose:d,children:(0,t.jsx)(eM,{scope:e.__scopeAccordion,collapsible:!0,children:(0,t.jsx)(eD,{...l,ref:r})})})}),[eF,eR]=eb(ep),eD=a.default.forwardRef((e,r)=>{let n,{__scopeAccordion:o,disabled:i,dir:l,orientation:s="vertical",...c}=e,u=z(a.default.useRef(null),r),d=ex(o),m="ltr"===(n=a.useContext(eh),l||n||"ltr"),f=V(e.onKeyDown,e=>{if(!eg.includes(e.key))return;let t=e.target,r=d().filter(e=>!e.ref.current?.disabled),a=r.findIndex(e=>e.ref.current===t),n=r.length;if(-1===a)return;e.preventDefault();let o=a,i=n-1,l=()=>{(o=a+1)>i&&(o=0)},c=()=>{(o=a-1)<0&&(o=i)};switch(e.key){case"Home":o=0;break;case"End":o=i;break;case"ArrowRight":"horizontal"===s&&(m?l():c());break;case"ArrowDown":"vertical"===s&&l();break;case"ArrowLeft":"horizontal"===s&&(m?c():l());break;case"ArrowUp":"vertical"===s&&c()}let u=o%n;r[u].ref.current?.focus()});return(0,t.jsx)(eF,{scope:o,disabled:i,direction:l,orientation:s,children:(0,t.jsx)(ev.Slot,{scope:o,children:(0,t.jsx)(Y.div,{...c,"data-orientation":s,ref:u,onKeyDown:i?void 0:f})})})}),eL="AccordionItem",[eB,eI]=eb(eL),eA=a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,value:n,...o}=e,i=eR(eL,a),l=ew(eL,a),s=eS(a),c=et(),u=n&&l.value.includes(n)||!1,d=i.disabled||e.disabled;return(0,t.jsx)(eB,{scope:a,open:u,disabled:d,triggerId:c,children:(0,t.jsx)(el,{"data-orientation":i.orientation,"data-state":eW(u),...s,...o,ref:r,disabled:d,open:u,onOpenChange:e=>{e?l.onItemOpen(n):l.onItemClose(n)}})})});eA.displayName=eL;var eP="AccordionHeader";a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,...n}=e,o=eR(ep,a),i=eI(eP,a);return(0,t.jsx)(Y.h3,{"data-orientation":o.orientation,"data-state":eW(i.open),"data-disabled":i.disabled?"":void 0,...n,ref:r})}).displayName=eP;var eE="AccordionTrigger",ez=a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,...n}=e,o=eR(ep,a),i=eI(eE,a),l=eN(eE,a),s=eS(a);return(0,t.jsx)(ev.ItemSlot,{scope:a,children:(0,t.jsx)(ec,{"aria-disabled":i.open&&!l.collapsible||void 0,"data-orientation":o.orientation,id:i.triggerId,...s,...n,ref:r})})});ez.displayName=eE;var eG="AccordionContent",eU=a.default.forwardRef((e,r)=>{let{__scopeAccordion:a,...n}=e,o=eR(ep,a),i=eI(eG,a),l=eS(a);return(0,t.jsx)(ed,{role:"region","aria-labelledby":i.triggerId,"data-orientation":o.orientation,...l,...n,ref:r,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});function eW(e){return e?"open":"closed"}function eH(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m190.06 414 163.12-139.78a24 24 0 0 0 0-36.44L190.06 98c-15.57-13.34-39.62-2.28-39.62 18.22v279.6c0 20.5 24.05 31.56 39.62 18.18z"},child:[]}]})(e)}eU.displayName=eG;var eO=e.i(81323);function e$(e){let a,n=(0,r.c)(2);return n[0]!==e?(a=(0,t.jsx)(ej,{className:eO.default.AccordionGroup,...e}),n[0]=e,n[1]=a):a=n[1],a}function eV(e){let a,n,o,i,l=(0,r.c)(9),{value:s,label:c,children:u}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)(eH,{className:eO.default.TriggerIcon}),l[0]=a):a=l[0],l[1]!==c?(n=(0,t.jsxs)(ez,{className:eO.default.Trigger,children:[a," ",c]}),l[1]=c,l[2]=n):n=l[2],l[3]!==u?(o=(0,t.jsx)(eU,{className:eO.default.Content,children:(0,t.jsx)("div",{className:eO.default.Body,children:u})}),l[3]=u,l[4]=o):o=l[4],l[5]!==n||l[6]!==o||l[7]!==s?(i=(0,t.jsxs)(eA,{value:s,children:[n,o]}),l[5]=n,l[6]=o,l[7]=s,l[8]=i):i=l[8],i}var eq=e.i(65883);let eQ="(pointer: coarse)",eK=()=>null;function eY(e){let t=window.matchMedia(eQ);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}}function eJ(){return window.matchMedia(eQ).matches}function eZ(){return(0,a.useSyncExternalStore)(eY,eJ,eK)}var eX=e.i(92224),e0=e.i(91996);let e1=["controls","preferences","audio"];function e2(e){let n,o,i,l,s,c,u,m,h,g,v,x,y,_,S,C,w,T,k,R,D,B,I,A,P,E,z,G,U,W,H,O,$,V,q,Q,K,Y,J,Z,X,ee,et,er,ea,en,eo,ei,el,es,ec,eu,ed,em,ef,eh,ep,eg,ev,ex,ey,eb,e_,eS,ej,eC,ew,eM,eN,eT,ek,eF=(0,r.c)(167),{missionName:eR,missionType:eD,onOpenMapInfo:eL,onOpenServerBrowser:eB,onChooseMap:eI,onCancelChoosingMap:eA,choosingMap:eP,cameraRef:eE,invalidateRef:ez}=e,eG=eZ(),eU=(0,eX.useDataSource)(),eW=(0,N.useRecording)(),eH=(0,eX.useMissionName)(),eO="demo"===eU||"live"===eU?eH:eR;eF[0]!==eO?(n=!!eO&&(0,e0.hasMission)(eO),eF[0]=eO,eF[1]=n):n=eF[1];let eQ=n,eK=(0,M.useLiveSelector)(e3),{fogEnabled:eY,setFogEnabled:eJ,fov:e2,setFov:e5,audioEnabled:e4,setAudioEnabled:e6,audioVolume:e8,setAudioVolume:e7,animationEnabled:e9,setAnimationEnabled:te}=(0,b.useSettings)(),{speedMultiplier:tt,setSpeedMultiplier:tr,touchMode:ta,setTouchMode:tn,invertScroll:to,setInvertScroll:ti,invertDrag:tl,setInvertDrag:ts,invertJoystick:tc,setInvertJoystick:tu}=(0,b.useControls)(),{debugMode:td,setDebugMode:tm,renderOnDemand:tf,setRenderOnDemand:th}=(0,b.useDebug)(),[tp,tg]=(0,a.useState)(!1),tv=(0,a.useRef)(null),tx=(0,a.useRef)(null),ty=(0,a.useRef)(null);eF[2]!==tp?(o=()=>{tp&&tv.current?.focus()},i=[tp],eF[2]=tp,eF[3]=o,eF[4]=i):(o=eF[3],i=eF[4]),(0,a.useEffect)(o,i),eF[5]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{let t=e.relatedTarget;t&&ty.current?.contains(t)||tg(!1)},eF[5]=l):l=eF[5];let tb=l;eF[6]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{"Escape"===e.key&&(tg(!1),tx.current?.focus())},eF[6]=s):s=eF[6];let t_=s,tS="map"===eU&&!eW||eP;eF[7]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)(d,{}),u=(0,t.jsx)("span",{className:eq.default.ButtonLabel,children:"Explore"}),m=(0,t.jsx)("span",{className:eq.default.ButtonHint,children:"Browse maps"}),eF[7]=c,eF[8]=u,eF[9]=m):(c=eF[7],u=eF[8],m=eF[9]),eF[10]!==eI||eF[11]!==tS?(h=(0,t.jsxs)("button",{type:"button",className:eq.default.IconButton,"data-active":tS,onClick:eI,children:[c,u,m]}),eF[10]=eI,eF[11]=tS,eF[12]=h):h=eF[12];let tj=!eP&&eW?.source==="demo";eF[13]!==eP||eF[14]!==eA||eF[15]!==tj?(g=(0,t.jsx)(F,{isActive:tj,choosingMap:eP,onCancelChoosingMap:eA}),eF[13]=eP,eF[14]=eA,eF[15]=tj,eF[16]=g):g=eF[16],eF[17]!==eP||eF[18]!==eK||eF[19]!==eB?(v=eB&&(0,t.jsx)(L,{isActive:!eP&&eK,onOpenServerBrowser:eB}),eF[17]=eP,eF[18]=eK,eF[19]=eB,eF[20]=v):v=eF[20],eF[21]!==h||eF[22]!==g||eF[23]!==v?(x=(0,t.jsxs)("div",{className:eq.default.ButtonGroup,children:[h,g,v]}),eF[21]=h,eF[22]=g,eF[23]=v,eF[24]=x):x=eF[24];let tC=!eQ;eF[25]!==eE||eF[26]!==eR||eF[27]!==eD||eF[28]!==tC?(y=(0,t.jsx)(j,{missionName:eR,missionType:eD,cameraRef:eE,disabled:tC}),eF[25]=eE,eF[26]=eR,eF[27]=eD,eF[28]=tC,eF[29]=y):y=eF[29];let tw=!eQ;eF[30]===Symbol.for("react.memo_cache_sentinel")?(_=(0,t.jsx)(p,{}),S=(0,t.jsx)("span",{className:eq.default.ButtonLabel,children:"Show map info"}),eF[30]=_,eF[31]=S):(_=eF[30],S=eF[31]),eF[32]!==eL||eF[33]!==tw?(C=(0,t.jsxs)("button",{type:"button",className:eq.default.MapInfoButton,"aria-label":"Show map info",onClick:eL,disabled:tw,children:[_,S]}),eF[32]=eL,eF[33]=tw,eF[34]=C):C=eF[34],eF[35]!==x||eF[36]!==y||eF[37]!==C?(w=(0,t.jsxs)("div",{className:eq.default.Tools,children:[x,y,C]}),eF[35]=x,eF[36]=y,eF[37]=C,eF[38]=w):w=eF[38],eF[39]===Symbol.for("react.memo_cache_sentinel")?(T=(0,t.jsx)("label",{htmlFor:"speedInput",children:"Fly speed"}),eF[39]=T):T=eF[39],eF[40]!==tr?(k=e=>tr(parseFloat(e.target.value)),eF[40]=tr,eF[41]=k):k=eF[41],eF[42]!==tt||eF[43]!==k?(R=(0,t.jsx)("input",{id:"speedInput",type:"range",min:.1,max:5,step:.05,value:tt,onChange:k}),eF[42]=tt,eF[43]=k,eF[44]=R):R=eF[44];let tM=!1===eG?" Use your scroll wheel or trackpad to adjust while flying.":"";return eF[45]!==tM?(D=(0,t.jsxs)("p",{className:eq.default.Description,children:["How fast you move in free-flying mode.",tM]}),eF[45]=tM,eF[46]=D):D=eF[46],eF[47]!==R||eF[48]!==D?(B=(0,t.jsxs)("div",{className:eq.default.Field,children:[T,R,D]}),eF[47]=R,eF[48]=D,eF[49]=B):B=eF[49],eF[50]!==eG||eF[51]!==tn||eF[52]!==ta?(I=eG?(0,t.jsxs)("div",{className:eq.default.Field,children:[(0,t.jsx)("label",{htmlFor:"touchModeInput",children:"Joystick"})," ",(0,t.jsxs)("select",{id:"touchModeInput",value:ta,onChange:e=>tn(e.target.value),children:[(0,t.jsx)("option",{value:"dualStick",children:"Dual stick"}),(0,t.jsx)("option",{value:"moveLookStick",children:"Single stick"})]}),(0,t.jsx)("p",{className:eq.default.Description,children:"Single stick has a unified move + look control. Dual stick has independent move + look."})]}):null,eF[50]=eG,eF[51]=tn,eF[52]=ta,eF[53]=I):I=eF[53],eF[54]!==to||eF[55]!==eG||eF[56]!==ti?(A=!1===eG?(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[(0,t.jsx)("input",{id:"invertScroll",type:"checkbox",checked:to,onChange:e=>{ti(e.target.checked)}}),(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"invertScroll",children:"Invert scroll direction"}),(0,t.jsx)("p",{className:eq.default.Description,children:"Reverse which scroll direction increases and decreases fly speed."})]}):null,eF[54]=to,eF[55]=eG,eF[56]=ti,eF[57]=A):A=eF[57],eF[58]!==tc||eF[59]!==eG||eF[60]!==tu?(P=eG?(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[(0,t.jsx)("input",{id:"invertJoystick",type:"checkbox",checked:tc,onChange:e=>{tu(e.target.checked)}}),(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"invertJoystick",children:"Invert joystick direction"}),(0,t.jsx)("p",{className:eq.default.Description,children:"Reverse joystick look direction."})]}):null,eF[58]=tc,eF[59]=eG,eF[60]=tu,eF[61]=P):P=eF[61],eF[62]!==ts?(E=e=>{ts(e.target.checked)},eF[62]=ts,eF[63]=E):E=eF[63],eF[64]!==tl||eF[65]!==E?(z=(0,t.jsx)("input",{id:"invertDrag",type:"checkbox",checked:tl,onChange:E}),eF[64]=tl,eF[65]=E,eF[66]=z):z=eF[66],eF[67]===Symbol.for("react.memo_cache_sentinel")?(G=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"invertDrag",children:"Invert drag direction"}),U=(0,t.jsx)("p",{className:eq.default.Description,children:"Reverse how dragging the viewport aims the camera."}),eF[67]=G,eF[68]=U):(G=eF[67],U=eF[68]),eF[69]!==z?(W=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[z,G,U]}),eF[69]=z,eF[70]=W):W=eF[70],eF[71]!==B||eF[72]!==I||eF[73]!==A||eF[74]!==P||eF[75]!==W?(H=(0,t.jsxs)(eV,{value:"controls",label:"Controls",children:[B,I,A,P,W]}),eF[71]=B,eF[72]=I,eF[73]=A,eF[74]=P,eF[75]=W,eF[76]=H):H=eF[76],eF[77]===Symbol.for("react.memo_cache_sentinel")?(O=(0,t.jsx)("label",{htmlFor:"fovInput",children:"FOV"}),eF[77]=O):O=eF[77],eF[78]!==e2?($=(0,t.jsxs)("output",{htmlFor:"fovInput",children:[e2,"°"]}),eF[78]=e2,eF[79]=$):$=eF[79],eF[80]!==e5?(V=e=>e5(parseInt(e.target.value)),eF[80]=e5,eF[81]=V):V=eF[81],eF[82]!==e2||eF[83]!==V?(q=(0,t.jsx)("input",{id:"fovInput",type:"range",min:75,max:120,step:5,value:e2,onChange:V}),eF[82]=e2,eF[83]=V,eF[84]=q):q=eF[84],eF[85]!==$||eF[86]!==q?(Q=(0,t.jsx)(eV,{value:"preferences",label:"Preferences",children:(0,t.jsxs)("div",{className:eq.default.Field,children:[O,(0,t.jsxs)("div",{className:eq.default.Control,children:[$,q]})]})}),eF[85]=$,eF[86]=q,eF[87]=Q):Q=eF[87],eF[88]!==e6?(K=e=>{e6(e.target.checked)},eF[88]=e6,eF[89]=K):K=eF[89],eF[90]!==e4||eF[91]!==K?(Y=(0,t.jsx)("input",{id:"audioInput",type:"checkbox",checked:e4,onChange:K}),eF[90]=e4,eF[91]=K,eF[92]=Y):Y=eF[92],eF[93]===Symbol.for("react.memo_cache_sentinel")?(J=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"audioInput",children:"Enable audio"}),eF[93]=J):J=eF[93],eF[94]!==Y?(Z=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[Y,J]}),eF[94]=Y,eF[95]=Z):Z=eF[95],eF[96]===Symbol.for("react.memo_cache_sentinel")?(X=(0,t.jsx)("label",{htmlFor:"volumeInput",children:"Master volume"}),eF[96]=X):X=eF[96],eF[97]!==e8?(ee=Math.round(100*e8),eF[97]=e8,eF[98]=ee):ee=eF[98],eF[99]!==ee?(et=(0,t.jsxs)("output",{htmlFor:"volumeInput",children:[ee,"%"]}),eF[99]=ee,eF[100]=et):et=eF[100],eF[101]!==e7?(er=e=>e7(parseFloat(e.target.value)),eF[101]=e7,eF[102]=er):er=eF[102],eF[103]!==e8||eF[104]!==er?(ea=(0,t.jsx)("input",{id:"volumeInput",type:"range",min:0,max:1,step:.05,value:e8,onChange:er}),eF[103]=e8,eF[104]=er,eF[105]=ea):ea=eF[105],eF[106]!==et||eF[107]!==ea?(en=(0,t.jsxs)("div",{className:eq.default.Field,children:[X,(0,t.jsxs)("div",{className:eq.default.Control,children:[et,ea]})]}),eF[106]=et,eF[107]=ea,eF[108]=en):en=eF[108],eF[109]!==Z||eF[110]!==en?(eo=(0,t.jsxs)(eV,{value:"audio",label:"Audio",children:[Z,en]}),eF[109]=Z,eF[110]=en,eF[111]=eo):eo=eF[111],eF[112]!==eJ?(ei=e=>{eJ(e.target.checked)},eF[112]=eJ,eF[113]=ei):ei=eF[113],eF[114]!==eY||eF[115]!==ei?(el=(0,t.jsx)("input",{id:"fogInput",type:"checkbox",checked:eY,onChange:ei}),eF[114]=eY,eF[115]=ei,eF[116]=el):el=eF[116],eF[117]===Symbol.for("react.memo_cache_sentinel")?(es=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"fogInput",children:"Enable fog"}),eF[117]=es):es=eF[117],eF[118]!==el?(ec=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[el,es]}),eF[118]=el,eF[119]=ec):ec=eF[119],eF[120]!==te?(eu=e=>{te(e.target.checked)},eF[120]=te,eF[121]=eu):eu=eF[121],eF[122]!==e9||eF[123]!==eu?(ed=(0,t.jsx)("input",{id:"animationInput",type:"checkbox",checked:e9,onChange:eu}),eF[122]=e9,eF[123]=eu,eF[124]=ed):ed=eF[124],eF[125]===Symbol.for("react.memo_cache_sentinel")?(em=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"animationInput",children:"Enable animations"}),eF[125]=em):em=eF[125],eF[126]!==ed?(ef=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[ed,em]}),eF[126]=ed,eF[127]=ef):ef=eF[127],eF[128]!==ec||eF[129]!==ef?(eh=(0,t.jsxs)(eV,{value:"graphics",label:"Graphics",children:[ec,ef]}),eF[128]=ec,eF[129]=ef,eF[130]=eh):eh=eF[130],eF[131]!==tm?(ep=e=>{tm(e.target.checked)},eF[131]=tm,eF[132]=ep):ep=eF[132],eF[133]!==td||eF[134]!==ep?(eg=(0,t.jsx)("input",{id:"debugInput",type:"checkbox",checked:td,onChange:ep}),eF[133]=td,eF[134]=ep,eF[135]=eg):eg=eF[135],eF[136]===Symbol.for("react.memo_cache_sentinel")?(ev=(0,t.jsx)("label",{className:eq.default.Label,htmlFor:"debugInput",children:"Render debug visuals"}),eF[136]=ev):ev=eF[136],eF[137]!==eg?(ex=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[eg,ev]}),eF[137]=eg,eF[138]=ex):ex=eF[138],eF[139]!==th?(ey=e=>{th(e.target.checked)},eF[139]=th,eF[140]=ey):ey=eF[140],eF[141]!==tf||eF[142]!==ey?(eb=(0,t.jsx)("input",{id:"onDemandInput",type:"checkbox",checked:tf,onChange:ey}),eF[141]=tf,eF[142]=ey,eF[143]=eb):eb=eF[143],eF[144]===Symbol.for("react.memo_cache_sentinel")?(e_=(0,t.jsx)("label",{htmlFor:"onDemandInput",children:"Render on demand "}),eF[144]=e_):e_=eF[144],eF[145]!==ez?(eS=()=>ez.current?.(),eF[145]=ez,eF[146]=eS):eS=eF[146],eF[147]===Symbol.for("react.memo_cache_sentinel")?(ej=(0,t.jsx)(f,{}),eF[147]=ej):ej=eF[147],eF[148]!==eS?(eC=(0,t.jsxs)("div",{className:eq.default.Label,children:[e_,(0,t.jsx)("button",{type:"button",className:eq.default.ForceRenderButton,title:"Force render","aria-label":"Force render",onClick:eS,children:ej})]}),eF[148]=eS,eF[149]=eC):eC=eF[149],eF[150]===Symbol.for("react.memo_cache_sentinel")?(ew=(0,t.jsx)("p",{className:eq.default.Description,children:"Significantly decreases CPU and GPU usage by only rendering frames when requested. Helpful when developing parts of the app unrelated to rendering."}),eF[150]=ew):ew=eF[150],eF[151]!==eb||eF[152]!==eC?(eM=(0,t.jsxs)("div",{className:eq.default.CheckboxField,children:[eb,eC,ew]}),eF[151]=eb,eF[152]=eC,eF[153]=eM):eM=eF[153],eF[154]!==ex||eF[155]!==eM?(eN=(0,t.jsxs)(eV,{value:"debug",label:"Debug",children:[ex,eM]}),eF[154]=ex,eF[155]=eM,eF[156]=eN):eN=eF[156],eF[157]!==H||eF[158]!==Q||eF[159]!==eo||eF[160]!==eh||eF[161]!==eN?(eT=(0,t.jsx)("div",{className:eq.default.Accordions,children:(0,t.jsxs)(e$,{type:"multiple",defaultValue:e1,children:[H,Q,eo,eh,eN]})}),eF[157]=H,eF[158]=Q,eF[159]=eo,eF[160]=eh,eF[161]=eN,eF[162]=eT):eT=eF[162],eF[163]!==tp||eF[164]!==w||eF[165]!==eT?(ek=(0,t.jsx)("div",{className:eq.default.InspectorControls,children:(0,t.jsx)("div",{ref:ty,children:(0,t.jsxs)("div",{className:eq.default.Dropdown,ref:tv,id:"settingsPanel",tabIndex:-1,onKeyDown:t_,onBlur:tb,"data-open":tp,children:[w,eT]})})}),eF[163]=tp,eF[164]=w,eF[165]=eT,eF[166]=ek):ek=eF[166],ek}function e3(e){return"connected"===e.gameStatus||"authenticating"===e.gameStatus}var e5=e.i(11889),e4=e.i(56373),e6=e.i(86447),e8=e.i(1559),e7=e.i(78440),e9=e.i(59129),te=e.i(25998),tt=e.i(18364),tr=e.i(68754),ta=e.i(70238),tn=e.i(29402),to=e.i(97442);let ti=new Set(["SkiFree","SkiFree_Daily","SkiFree_Randomizer"]),tl={"missions.vl2":"Official","TR2final105-client.vl2":"Team Rabbit 2","z_mappacks/CTF/Classic_maps_v1.vl2":"Classic","z_mappacks/CTF/DynamixFinalPack.vl2":"Official","z_mappacks/CTF/KryMapPack_b3EDIT.vl2":"KryMapPack","z_mappacks/CTF/S5maps.vl2":"S5","z_mappacks/CTF/S8maps.vl2":"S8","z_mappacks/CTF/TWL-MapPack.vl2":"TWL","z_mappacks/CTF/TWL-MapPackEDIT.vl2":"TWL","z_mappacks/CTF/TWL2-MapPack.vl2":"TWL2","z_mappacks/CTF/TWL2-MapPackEDIT.vl2":"TWL2","z_mappacks/TWL_T2arenaOfficialMaps.vl2":"Arena","z_mappacks/xPack2.vl2":"xPack2","z_mappacks/z_DMP2-V0.6.vl2":"DMP2 (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX.vl2":"DMP (Discord Map Pack)","z_mappacks/zDMP-4.7.3DX-ServerOnly.vl2":"DMP (Discord Map Pack)"},ts={"z_mappacks/DM":"DM","z_mappacks/LCTF":"LCTF","z_mappacks/Lak":"LakRabbit"},tc=(0,e0.getMissionList)().filter(e=>!ti.has(e)).map(e=>{let t,r=(0,e0.getMissionInfo)(e),[a]=(0,e0.getSourceAndPath)(r.resourcePath),n=(t=a.match(/^(.*)(\/[^/]+)$/))?t[1]:"",o=tl[a]??ts[n]??null;return{resourcePath:r.resourcePath,missionName:e,displayName:r.displayName,sourcePath:a,groupName:o,missionTypes:r.missionTypes}}),tu=new Map(tc.map(e=>[e.missionName,e])),td=function(e){let t=new Map;for(let r of e){let e=t.get(r.groupName)??[];e.push(r),t.set(r.groupName,e)}return t.forEach((e,r)=>{t.set(r,(0,tn.default)(e,[e=>(e.displayName||e.missionName).toLowerCase()],["asc"]))}),(0,tn.default)(Array.from(t.entries()),[([e])=>"Official"===e?0:null==e?2:1,([e])=>e?e.toLowerCase():""],["asc","asc"])}(tc),tm="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function tf(e){let a,n,o,i,l,s=(0,r.c)(12),{mission:c}=e,u=c.displayName||c.missionName;return s[0]!==u?(a=(0,t.jsx)("span",{className:to.default.ItemName,children:u}),s[0]=u,s[1]=a):a=s[1],s[2]!==c.missionTypes?(n=c.missionTypes.length>0&&(0,t.jsx)("span",{className:to.default.ItemTypes,children:c.missionTypes.map(th)}),s[2]=c.missionTypes,s[3]=n):n=s[3],s[4]!==a||s[5]!==n?(o=(0,t.jsxs)("span",{className:to.default.ItemHeader,children:[a,n]}),s[4]=a,s[5]=n,s[6]=o):o=s[6],s[7]!==c.missionName?(i=(0,t.jsx)("span",{className:to.default.ItemMissionName,children:c.missionName}),s[7]=c.missionName,s[8]=i):i=s[8],s[9]!==o||s[10]!==i?(l=(0,t.jsxs)(t.Fragment,{children:[o,i]}),s[9]=o,s[10]=i,s[11]=l):l=s[11],l}function th(e){return(0,t.jsx)("span",{className:to.default.ItemType,"data-mission-type":e,children:e},e)}function tp(e){let n,o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_=(0,r.c)(48),{value:S,missionType:j,onChange:C,disabled:w,autoFocus:M}=e,[N,T]=(0,a.useState)(""),k=(0,a.useRef)(null),F=(0,a.useRef)(j);_[0]===Symbol.for("react.memo_cache_sentinel")?(n=e=>{(0,a.startTransition)(()=>T(e))},_[0]=n):n=_[0];let R=(0,tt.useComboboxStore)({resetValueOnHide:!0,selectedValue:S,setSelectedValue:e=>{if(e){let t=F.current,r=(0,e0.getMissionInfo)(e).missionTypes;t&&r.includes(t)||(t=r[0]),C({missionName:e,missionType:t}),k.current?.blur()}},setValue:n}),D=(0,tr.useStoreState)(R,"open");_[1]!==R?(o=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),k.current?.focus(),R.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},i=[R],_[1]=R,_[2]=o,_[3]=i):(o=_[2],i=_[3]),(0,a.useEffect)(o,i),_[4]!==S?(l=tu.get(S),_[4]=S,_[5]=l):l=_[5];let L=l;e:{let e,t;if(!N){let e;_[6]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:td},_[6]=e):e=_[6],s=e;break e}_[7]!==N?(e=(0,ta.matchSorter)(tc,N,{keys:["displayName","missionName","missionTypes","groupName"]}),_[7]=N,_[8]=e):e=_[8];let r=e;_[9]!==r?(t={type:"flat",missions:r},_[9]=r,_[10]=t):t=_[10],s=t}let B=s,I=L?L.displayName||L.missionName:S,A="flat"===B.type?0===B.missions.length:0===B.groups.length,P=e=>(0,t.jsx)(e4.ComboboxItem,{value:e.missionName,className:to.default.Item,focusOnHover:!0,onClick:t=>{if(t.target&&t.target instanceof HTMLElement){let r=t.target.dataset.missionType;r?(F.current=r,e.missionName===S&&C({missionName:e.missionName,missionType:r})):F.current=null}else F.current=null},children:(0,t.jsx)(tf,{mission:e})},e.missionName),E=e7.ComboboxProvider,z=D?"visible":"hidden";_[11]===Symbol.for("react.memo_cache_sentinel")?(c=(0,t.jsx)("div",{className:to.default.Backdrop}),_[11]=c):c=_[11],_[12]!==z?(u=(0,t.jsx)(a.Activity,{mode:z,children:c}),_[12]=z,_[13]=u):u=_[13];let G=L?void 0:"Choose a map…";_[14]!==R?(d=()=>{try{document.exitPointerLock()}catch{}R.show()},m=e=>{"Escape"!==e.key||R.getState().open||k.current?.blur()},_[14]=R,_[15]=d,_[16]=m):(d=_[15],m=_[16]),_[17]!==M||_[18]!==w||_[19]!==d||_[20]!==m||_[21]!==G?(f=(0,t.jsx)(e5.Combobox,{ref:k,autoSelect:!0,autoFocus:M,disabled:w,placeholder:G,className:to.default.Input,onFocus:d,onKeyDown:m}),_[17]=M,_[18]=w,_[19]=d,_[20]=m,_[21]=G,_[22]=f):f=_[22],_[23]!==I||_[24]!==j||_[25]!==L?(h=L&&(0,t.jsxs)("div",{className:to.default.SelectedValue,children:[(0,t.jsx)("span",{className:to.default.SelectedName,children:I}),j&&(0,t.jsx)("span",{className:to.default.ItemType,"data-mission-type":j,children:j})]}),_[23]=I,_[24]=j,_[25]=L,_[26]=h):h=_[26],_[27]===Symbol.for("react.memo_cache_sentinel")?(p=(0,t.jsx)("kbd",{className:to.default.Shortcut,children:tm?"⌘K":"^K"}),_[27]=p):p=_[27],_[28]!==f||_[29]!==h?(g=(0,t.jsxs)("div",{className:to.default.InputWrapper,children:[f,h,p]}),_[28]=f,_[29]=h,_[30]=g):g=_[30];let U=e8.ComboboxPopover,W=to.default,H=e6.ComboboxList,O=to.default,$="flat"===B.type?B.missions.map(P):B.groups.map(e=>{let[r,n]=e;return r?(0,t.jsxs)(e9.ComboboxGroup,{className:to.default.Group,children:[(0,t.jsx)(te.ComboboxGroupLabel,{className:to.default.GroupLabel,children:r}),n.map(P)]},r):(0,t.jsx)(a.Fragment,{children:n.map(P)},"ungrouped")});return _[31]!==A?(v=A&&(0,t.jsx)("div",{className:to.default.NoResults,children:"No missions found"}),_[31]=A,_[32]=v):v=_[32],_[33]!==H||_[34]!==O.List||_[35]!==$||_[36]!==v?(x=(0,t.jsxs)(H,{className:O.List,children:[$,v]}),_[33]=H,_[34]=O.List,_[35]=$,_[36]=v,_[37]=x):x=_[37],_[38]!==U||_[39]!==W.Popover||_[40]!==x?(y=(0,t.jsx)(U,{gutter:4,fitViewport:!0,autoFocusOnHide:!1,className:W.Popover,children:x}),_[38]=U,_[39]=W.Popover,_[40]=x,_[41]=y):y=_[41],_[42]!==E||_[43]!==R||_[44]!==g||_[45]!==y||_[46]!==u?(b=(0,t.jsxs)(E,{store:R,children:[u,g,y]}),_[42]=E,_[43]=R,_[44]=g,_[45]=y,_[46]=u,_[47]=b):b=_[47],b}var tg=e.i(58647);function tv(e){return(0,u.GenIcon)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m12 6-6 8h12zM6 16h12v2H6z"},child:[]}]})(e)}var tx=e.i(16964);function ty(){let e,a,n,o,i,l,s=(0,r.c)(24),c=(0,eX.useDataSource)(),u=(0,eX.useMissionDisplayName)(),d=(0,eX.useMissionType)(),m=(0,eX.useMissionTypeDisplayName)(),f=(0,eX.useServerDisplayName)(),p=(0,eX.useRecorderName)(),g=(0,eX.useRecordingDate)(),[v,x]=g?g.split(" "):[null,null],y="live"===c,b=(0,N.useRecording)(),_=(0,M.useLiveSelector)(tS),S=tx.default;s[0]!==u||s[1]!==d||s[2]!==m?(e=u&&d?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:tx.default.MissionName,children:u}),d&&(0,t.jsxs)(t.Fragment,{children:[" ",(0,t.jsx)("span",{className:tx.default.MissionType,"data-mission-type":d,children:"LCTF"===m?"LCTF":d})]})]}):null,s[0]=u,s[1]=d,s[2]=m,s[3]=e):e=s[3],s[4]!==e?(a=(0,t.jsx)("div",{className:tx.default.MissionInfo,children:e}),s[4]=e,s[5]=a):a=s[5];let j=tx.default,C=y?p?(0,t.jsxs)("div",{className:tx.default.Attribution,children:["Connected as"," ",(0,t.jsx)("span",{className:tx.default.PlayerName,children:p})]}):null:p&&g?(0,t.jsxs)("div",{className:tx.default.Attribution,children:["Recorded by ",(0,t.jsx)("span",{className:tx.default.PlayerName,children:p})," ","on"," ",(0,t.jsx)("span",{className:tx.default.RecordingDate,children:v.replace(/-/g," ")})," ","at ",(0,t.jsx)("span",{className:tx.default.RecordingDate,children:x})]}):null;return s[6]!==f?(n=f?(0,t.jsxs)("div",{className:tx.default.ServerInfo,children:["Server: ",(0,t.jsx)("span",{className:tx.default.ServerName,children:f})]}):null,s[6]=f,s[7]=n):n=s[7],s[8]!==j.Metadata||s[9]!==C||s[10]!==n?(o=(0,t.jsxs)("div",{className:j.Metadata,children:[C,n]}),s[8]=j.Metadata,s[9]=C,s[10]=n,s[11]=o):o=s[11],s[12]!==c||s[13]!==tb||s[14]!==t_||s[15]!==y||s[16]!==_||s[17]!==b?(i="demo"===c?(0,t.jsx)("button",{type:"button",className:tx.default.ActionButton,title:"Unload demo","aria-label":"Unload demo",onClick:t_,disabled:!b,children:(0,t.jsx)(tv,{className:tx.default.EjectIcon})}):y?(0,t.jsx)("button",{type:"button",className:tx.default.ActionButton,title:"Disconnect","aria-label":"Disconnect",onClick:tb,disabled:!_,children:(0,t.jsx)(h,{})}):null,s[12]=c,s[13]=tb,s[14]=t_,s[15]=y,s[16]=_,s[17]=b,s[18]=i):i=s[18],s[19]!==S.Header||s[20]!==a||s[21]!==o||s[22]!==i?(l=(0,t.jsxs)("div",{className:S.Header,children:[a,o,i]}),s[19]=S.Header,s[20]=a,s[21]=o,s[22]=i,s[23]=l):l=s[23],l}function tb(){let e=M.liveConnectionStore.getState();e.disconnectServer(),e.disconnectRelay(),tg.engineStore.getState().setRecording(null)}function t_(){tg.engineStore.getState().setRecording(null)}function tS(e){return"connected"===e.gameStatus||"authenticating"===e.gameStatus}var tj=e.i(31067),tC=e.i(15080),tw=e.i(71753),tM=e.i(90072);let tN=a.forwardRef(({envMap:e,resolution:t=256,frames:r=1/0,makeDefault:n,children:o,...i},l)=>{let s=(0,tC.useThree)(({set:e})=>e),c=(0,tC.useThree)(({camera:e})=>e),u=(0,tC.useThree)(({size:e})=>e),d=a.useRef(null);a.useImperativeHandle(l,()=>d.current,[]);let m=a.useRef(null),f=function(e,t,r){let n=(0,tC.useThree)(e=>e.size),o=(0,tC.useThree)(e=>e.viewport),i="number"==typeof e?e:n.width*o.dpr,l=n.height*o.dpr,s=("number"==typeof e?void 0:e)||{},{samples:c=0,depth:u,...d}=s,m=null!=u?u:s.depthBuffer,f=a.useMemo(()=>{let e=new tM.WebGLRenderTarget(i,l,{minFilter:tM.LinearFilter,magFilter:tM.LinearFilter,type:tM.HalfFloatType,...d});return m&&(e.depthTexture=new tM.DepthTexture(i,l,tM.FloatType)),e.samples=c,e},[]);return a.useLayoutEffect(()=>{f.setSize(i,l),c&&(f.samples=c)},[c,f,i,l]),a.useEffect(()=>()=>f.dispose(),[]),f}(t);a.useLayoutEffect(()=>{i.manual||(d.current.aspect=u.width/u.height)},[u,i]),a.useLayoutEffect(()=>{d.current.updateProjectionMatrix()});let h=0,p=null,g="function"==typeof o;return(0,tw.useFrame)(t=>{g&&(r===1/0||h{if(n)return s(()=>({camera:d.current})),()=>s(()=>({camera:c}))},[d,n,s]),a.createElement(a.Fragment,null,a.createElement("perspectiveCamera",(0,tj.default)({ref:d},i),!g&&o),a.createElement("group",{ref:m},g&&o(f.texture)))});function tT(){let e,a,n=(0,r.c)(3),{fov:o}=(0,b.useSettings)();return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=[0,256,0],n[0]=e):e=n[0],n[1]!==o?(a=(0,t.jsx)(tN,{makeDefault:!0,position:e,fov:o}),n[1]=o,n[2]=a):a=n[2],a}var tk=e.i(51434),tF=e.i(68294),tR=e.i(77964),tD=e.i(93784),tL=e.i(91907),tB=e.i(25947),tI=e.i(46325),tA=e.i(31999),tP=e.i(89887);function tE(e){let t,n,o,i,l=(0,r.c)(12),{entity:s}=e,{registerCamera:c,unregisterCamera:u}=(0,tF.useCameras)(),d=(0,a.useId)(),m=s.cameraDataBlock;l[0]!==s.position?(t=s.position?new tM.Vector3(...s.position):new tM.Vector3,l[0]=s.position,l[1]=t):t=l[1];let f=t;l[2]!==s.rotation?(n=s.rotation?new tM.Quaternion(...s.rotation):new tM.Quaternion,l[2]=s.rotation,l[3]=n):n=l[3];let h=n;return l[4]!==m||l[5]!==d||l[6]!==f||l[7]!==c||l[8]!==h||l[9]!==u?(o=()=>{if("Observer"===m){let e={id:d,position:f,rotation:h};return c(e),()=>{u(e)}}},i=[d,m,c,u,f,h],l[4]=m,l[5]=d,l[6]=f,l[7]=c,l[8]=h,l[9]=u,l[10]=o,l[11]=i):(o=l[10],i=l[11]),(0,a.useEffect)(o,i),null}function tz(e){let a,n=(0,r.c)(3),{entity:o}=e;return n[0]!==o.label||n[1]!==o.position?(a=o.label?(0,t.jsx)(tP.FloatingLabel,{position:o.position,opacity:.6,children:o.label}):null,n[0]=o.label,n[1]=o.position,n[2]=a):a=n[2],a}var tG=e.i(66027),tU=e.i(63318),tW=e.i(12979),tH=e.i(75567),tO=e.i(47071);let t$={value:!0},tV=` -vec3 terrainLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 terrainSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float terrainDebugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`;var tq=e.i(56893),tQ=e.i(47021),tK=e.i(48066);let tY={0:32,1:32,2:32,3:32,4:32,5:32},tJ=(0,a.memo)(function({displacementMap:e,visibilityMask:r,textureNames:n,alphaTextures:o,detailTextureName:i,lightmap:l}){let{debugMode:s}=(0,b.useDebug)(),c=(0,tq.useAnisotropy)(),u=(0,tO.useTexture)(n.map(e=>(0,tW.terrainTextureToUrl)(e)),e=>{e.forEach(e=>(0,tH.setupTexture)(e,{anisotropy:c}))}),d=i?(0,tW.textureToUrl)(i):null,m=(0,tO.useTexture)(d??tW.FALLBACK_TEXTURE_URL,e=>{(0,tH.setupTexture)(e,{anisotropy:c})}),f=(0,a.useCallback)(e=>{!function({shader:e,baseTextures:t,alphaTextures:r,visibilityMask:a,tiling:n,detailTexture:o=null,lightmap:i=null}){e.uniforms.sunLightPointsDown=t$;let l=t.length;if(t.forEach((t,r)=>{e.uniforms[`albedo${r}`]={value:t}}),r.forEach((t,r)=>{e.uniforms[`mask${r}`]={value:t}}),a&&(e.uniforms.visibilityMask={value:a}),t.forEach((t,r)=>{e.uniforms[`tiling${r}`]={value:n[r]??32}}),i&&(e.uniforms.terrainLightmap={value:i}),o&&(e.uniforms.detailTexture={value:o},e.uniforms.detailTiling={value:64},e.uniforms.detailFadeDistance={value:150},e.vertexShader=e.vertexShader.replace("#include ",`#include -varying vec3 vTerrainWorldPos;`),e.vertexShader=e.vertexShader.replace("#include ",`#include -vTerrainWorldPos = (modelMatrix * vec4(transformed, 1.0)).xyz;`)),e.fragmentShader=` -uniform sampler2D albedo0; -uniform sampler2D albedo1; -uniform sampler2D albedo2; -uniform sampler2D albedo3; -uniform sampler2D albedo4; -uniform sampler2D albedo5; -uniform sampler2D mask0; -uniform sampler2D mask1; -uniform sampler2D mask2; -uniform sampler2D mask3; -uniform sampler2D mask4; -uniform sampler2D mask5; -uniform float tiling0; -uniform float tiling1; -uniform float tiling2; -uniform float tiling3; -uniform float tiling4; -uniform float tiling5; -${a?"uniform sampler2D visibilityMask;":""} -${i?"uniform sampler2D terrainLightmap;":""} -uniform bool sunLightPointsDown; -${o?`uniform sampler2D detailTexture; -uniform float detailTiling; -uniform float detailFadeDistance; -varying vec3 vTerrainWorldPos;`:""} - -${tV} - -// Global variable to store shadow factor from RE_Direct for use in output calculation -float terrainShadowFactor = 1.0; -`+e.fragmentShader,a){let t="#include ";e.fragmentShader=e.fragmentShader.replace(t,`${t} - // Early discard for invisible areas (before fog/lighting) - float visibility = texture2D(visibilityMask, vMapUv).r; - if (visibility < 0.5) { - discard; - } - `)}e.fragmentShader=e.fragmentShader.replace("#include ",` - // Sample base albedo layers (sRGB textures auto-decoded to linear by Three.js) - vec2 baseUv = vMapUv; - vec3 c0 = texture2D(albedo0, baseUv * vec2(tiling0)).rgb; - ${l>1?"vec3 c1 = texture2D(albedo1, baseUv * vec2(tiling1)).rgb;":""} - ${l>2?"vec3 c2 = texture2D(albedo2, baseUv * vec2(tiling2)).rgb;":""} - ${l>3?"vec3 c3 = texture2D(albedo3, baseUv * vec2(tiling3)).rgb;":""} - ${l>4?"vec3 c4 = texture2D(albedo4, baseUv * vec2(tiling4)).rgb;":""} - ${l>5?"vec3 c5 = texture2D(albedo5, baseUv * vec2(tiling5)).rgb;":""} - - // Sample alpha masks for all layers (use R channel) - // Add +0.5 texel offset: Torque samples alpha at grid corners (integer indices), - // but GPU linear filtering samples at texel centers. This offset aligns them. - vec2 alphaUv = baseUv + vec2(0.5 / 256.0); - float a0 = texture2D(mask0, alphaUv).r; - ${l>1?"float a1 = texture2D(mask1, alphaUv).r;":""} - ${l>2?"float a2 = texture2D(mask2, alphaUv).r;":""} - ${l>3?"float a3 = texture2D(mask3, alphaUv).r;":""} - ${l>4?"float a4 = texture2D(mask4, alphaUv).r;":""} - ${l>5?"float a5 = texture2D(mask5, alphaUv).r;":""} - - // Torque-style additive weighted blending (blender.cc): - // result = tex0 * alpha0 + tex1 * alpha1 + tex2 * alpha2 + ... - // Each layer's alpha map defines its contribution weight. - vec3 blended = c0 * a0; - ${l>1?"blended += c1 * a1;":""} - ${l>2?"blended += c2 * a2;":""} - ${l>3?"blended += c3 * a3;":""} - ${l>4?"blended += c4 * a4;":""} - ${l>5?"blended += c5 * a5;":""} - - // Assign to diffuseColor before lighting - vec3 textureColor = blended; - - ${o?`// Detail texture blending (Torque-style multiplicative blend) - // Sample detail texture at high frequency tiling - vec3 detailColor = texture2D(detailTexture, baseUv * detailTiling).rgb; - - // Calculate distance-based fade factor using world positions - // Torque: distFactor = (zeroDetailDistance - distance) / zeroDetailDistance - float distToCamera = distance(vTerrainWorldPos, cameraPosition); - float detailFade = clamp(1.0 - distToCamera / detailFadeDistance, 0.0, 1.0); - - // Torque blending: dst * lerp(1.0, detailTexel, fadeFactor) - // Detail textures are authored with bright values (~0.8 mean), not 0.5 gray - // Direct multiplication adds subtle darkening for surface detail - textureColor *= mix(vec3(1.0), detailColor, detailFade);`:""} - - // Store blended texture in diffuseColor (still in linear space here) - // We'll convert to sRGB in the output calculation - diffuseColor.rgb = textureColor; -`),i&&(e.fragmentShader=e.fragmentShader.replace("#include ",`#include - -// Override RE_Direct to extract shadow factor for Torque-style gamma-space lighting -#undef RE_Direct -void RE_Direct_TerrainShadow( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) { - // Torque lighting (terrLighting.cc): if light points up, terrain gets only ambient - // This prevents shadow acne from light hitting terrain backfaces - if (!sunLightPointsDown) { - terrainShadowFactor = 0.0; - return; - } - // directLight.color = sunColor * shadowFactor (shadow already applied by Three.js) - // Extract shadow factor by comparing to original sun color - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 originalSunColor = directionalLights[0].color; - float sunMax = max(max(originalSunColor.r, originalSunColor.g), originalSunColor.b); - float shadowedMax = max(max(directLight.color.r, directLight.color.g), directLight.color.b); - terrainShadowFactor = clamp(shadowedMax / max(sunMax, 0.001), 0.0, 1.0); - #endif - // Don't add to reflectedLight - we'll compute lighting in gamma space at output -} -#define RE_Direct RE_Direct_TerrainShadow - -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include -// Clear indirect diffuse - we'll compute ambient in gamma space -#if defined( RE_IndirectDiffuse ) - irradiance = vec3(0.0); -#endif -`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include - // Clear Three.js lighting - we compute everything in gamma space - reflectedLight.directDiffuse = vec3(0.0); - reflectedLight.indirectDiffuse = vec3(0.0); -`)),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style terrain lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -{ - // Get texture in sRGB space (undo Three.js linear decode) - vec3 textureSRGB = terrainLinearToSRGB(diffuseColor.rgb); - - ${i?` - // Sample terrain lightmap for smooth NdotL - vec2 lightmapUv = vMapUv + vec2(0.5 / 512.0); - float lightmapNdotL = texture2D(terrainLightmap, lightmapUv).r; - - // Get sun and ambient colors from Three.js lights (these ARE sRGB values from mission file) - // Three.js interprets them as linear, but the numerical values are preserved - #if ( NUM_DIR_LIGHTS > 0 ) - vec3 sunColorSRGB = directionalLights[0].color; - #else - vec3 sunColorSRGB = vec3(0.7); - #endif - vec3 ambientColorSRGB = ambientLightColor; - - // Torque formula (terrLighting.cc:471-483): - // lighting = ambient + NdotL * shadowFactor * sunColor - // Clamp lighting to [0,1] before multiplying by texture - vec3 lightingSRGB = clamp(ambientColorSRGB + lightmapNdotL * terrainShadowFactor * sunColorSRGB, 0.0, 1.0); - `:` - // No lightmap - use simple ambient lighting - vec3 lightingSRGB = ambientLightColor; - `} - - // Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space - vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - - // Convert back to linear for Three.js output pipeline - outgoingLight = terrainSRGBToLinear(resultSRGB) + totalEmissiveRadiance; -} -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`#if DEBUG_MODE - // Debug mode: overlay green grid matching terrain grid squares (256x256) - float gridIntensity = terrainDebugGrid(vMapUv, 256.0, 1.5); - vec3 gridColor = vec3(0.0, 0.8, 0.4); // Green - gl_FragColor.rgb = mix(gl_FragColor.rgb, gridColor, gridIntensity * 0.1); -#endif - -#include `)}({shader:e,baseTextures:u,alphaTextures:o,visibilityMask:r,tiling:tY,detailTexture:d?m:null,lightmap:l}),(0,tQ.injectCustomFog)(e,tK.globalFogUniforms)},[u,o,r,m,d,l]),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!s,e.needsUpdate=!0)},[s]);let p=`${d?"detail":"nodetail"}-${l?"lightmap":"nolightmap"}`;return(0,t.jsx)("meshLambertMaterial",{ref:h,map:e,depthWrite:!0,side:tM.FrontSide,defines:{DEBUG_MODE:+!!s},onBeforeCompile:f},p)}),tZ=(0,a.memo)(function(e){let n,o,i=(0,r.c)(8),{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m}=e;return i[0]===Symbol.for("react.memo_cache_sentinel")?(n=(0,t.jsx)("meshLambertMaterial",{color:"rgb(0, 109, 56)",wireframe:!0}),i[0]=n):n=i[0],i[1]!==u||i[2]!==d||i[3]!==l||i[4]!==m||i[5]!==c||i[6]!==s?(o=(0,t.jsx)(a.Suspense,{fallback:n,children:(0,t.jsx)(tJ,{displacementMap:l,visibilityMask:s,textureNames:c,alphaTextures:u,detailTextureName:d,lightmap:m})}),i[1]=u,i[2]=d,i[3]=l,i[4]=m,i[5]=c,i[6]=s,i[7]=o):o=i[7],o}),tX=(0,a.memo)(function(e){let a,n,o,i=(0,r.c)(15),{tileX:l,tileZ:s,blockSize:c,basePosition:u,textureNames:d,geometry:m,displacementMap:f,visibilityMask:h,alphaTextures:p,detailTextureName:g,lightmap:v,visible:x}=e,y=void 0===x||x,b=c/2,_=u.x+l*c+b,S=u.z+s*c+b;i[0]!==_||i[1]!==S?(a=[_,0,S],i[0]=_,i[1]=S,i[2]=a):a=i[2];let j=a;return i[3]!==p||i[4]!==g||i[5]!==f||i[6]!==v||i[7]!==d||i[8]!==h?(n=(0,t.jsx)(tZ,{displacementMap:f,visibilityMask:h,textureNames:d,alphaTextures:p,detailTextureName:g,lightmap:v}),i[3]=p,i[4]=g,i[5]=f,i[6]=v,i[7]=d,i[8]=h,i[9]=n):n=i[9],i[10]!==m||i[11]!==j||i[12]!==n||i[13]!==y?(o=(0,t.jsx)("mesh",{position:j,geometry:m,castShadow:!0,receiveShadow:!0,visible:y,children:n}),i[10]=m,i[11]=j,i[12]=n,i[13]=y,i[14]=o):o=i[14],o});function t0(e){}let t1=(0,w.createLogger)("TerrainBlock");function t2(e){let t=new Uint8Array(65536);for(let r of(t.fill(255),e)){let e=255&r,a=r>>8&255,n=r>>16,o=256*a;for(let r=0;r0?S.visibleDistance:600,I=(0,tC.useThree)(t5),A=-(128*R);T[0]!==A?(n={x:A,z:A},T[0]=A,T[1]=n):n=T[1];let P=n;T[2]!==k.emptySquareRuns?(o=k.emptySquareRuns??[],T[2]=k.emptySquareRuns,T[3]=o):o=T[3];let E=o,{data:z}=((M=(0,r.c)(8))[0]!==F?(j={queryKey:["terrain",F],queryFn:()=>(t1.debug("Loading terrain: %s",F),(0,tW.loadTerrain)(F))},M[0]=F,M[1]=j):j=M[1],N=(0,tG.useQuery)(j),M[2]!==N.data||M[3]!==N.error||M[4]!==N.status||M[5]!==F?(C=()=>{t1.debug("Query status: %s%s%s file=%s",N.status,N.error?` error=${N.error.message}`:"",N.data?" (data ready)":" (no data)",F)},w=[N.status,N.error,N.data,F],M[2]=N.data,M[3]=N.error,M[4]=N.status,M[5]=F,M[6]=C,M[7]=w):(C=M[6],w=M[7]),(0,a.useEffect)(C,w),N);e:{let e;if(!z){i=null;break e}let t=256*R;T[4]!==t||T[5]!==R||T[6]!==z.heightMap?(!function(e,t,r){let a=e.attributes.position,n=e.attributes.uv,o=e.attributes.normal,i=a.array,l=n.array,s=o.array,c=a.count,u=(e,r)=>(e=Math.max(0,Math.min(255,e)),t[256*(r=Math.max(0,Math.min(255,r)))+e]/65535*2048),d=(e,r)=>{let a=Math.floor(e=Math.max(0,Math.min(255,e))),n=Math.floor(r=Math.max(0,Math.min(255,r))),o=Math.min(a+1,255),i=Math.min(n+1,255),l=e-a,s=r-n;return(t[256*n+a]/65535*2048*(1-l)+t[256*n+o]/65535*2048*l)*(1-s)+(t[256*i+a]/65535*2048*(1-l)+t[256*i+o]/65535*2048*l)*s};for(let e=0;e0?(h/=v,p/=v,g/=v):(h=0,p=1,g=0),s[3*e]=h,s[3*e+1]=p,s[3*e+2]=g}a.needsUpdate=!0,o.needsUpdate=!0}(e=function(e,t){let r=new tM.BufferGeometry,a=new Float32Array(198147),n=new Float32Array(198147),o=new Float32Array(132098),i=new Uint32Array(393216),l=0,s=e/256;for(let t=0;t<=256;t++)for(let r=0;r<=256;r++){let i=257*t+r;a[3*i]=r*s-e/2,a[3*i+1]=e/2-t*s,a[3*i+2]=0,n[3*i]=0,n[3*i+1]=0,n[3*i+2]=1,o[2*i]=r/256,o[2*i+1]=1-t/256}for(let e=0;e<256;e++)for(let t=0;t<256;t++){let r=257*e+t,a=r+1,n=(e+1)*257+t,o=n+1;((t^e)&1)==0?(i[l++]=r,i[l++]=n,i[l++]=o,i[l++]=r,i[l++]=o,i[l++]=a):(i[l++]=r,i[l++]=n,i[l++]=a,i[l++]=a,i[l++]=n,i[l++]=o)}return r.setIndex(new tM.BufferAttribute(i,1)),r.setAttribute("position",new tM.Float32BufferAttribute(a,3)),r.setAttribute("normal",new tM.Float32BufferAttribute(n,3)),r.setAttribute("uv",new tM.Float32BufferAttribute(o,2)),r.rotateX(-Math.PI/2),r.rotateY(-Math.PI/2),r}(t,0),z.heightMap,R),T[4]=t,T[5]=R,T[6]=z.heightMap,T[7]=e):e=T[7],i=e}let G=i;T[8]!==R||T[9]!==z?(l=()=>{if(z){var e;return t0((e=z.heightMap,(t,r)=>{let a=Math.max(0,Math.min(255,t/R+128)),n=Math.max(0,Math.min(255,r/R+128)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]*(1-c)+e[256*i+l]*c)*(1-u)+(e[256*s+o]*(1-c)+e[256*s+l]*c)*u)/65535*2048})),t4}},s=[z,R],T[8]=R,T[9]=z,T[10]=l,T[11]=s):(l=T[10],s=T[11]),(0,a.useEffect)(l,s);let U=(0,eX.useSceneSun)();t:{let e,t;if(!U){let e;T[12]===Symbol.for("react.memo_cache_sentinel")?(e=new tM.Vector3(.57735,-.57735,.57735),T[12]=e):e=T[12],c=e;break t}T[13]!==U.direction?(e=(0,tU.torqueToThree)(U.direction),T[13]=U.direction,T[14]=e):e=T[14];let[r,a,n]=e,o=Math.sqrt(r*r+a*a+n*n),i=r/o,l=a/o,s=n/o;T[15]!==s||T[16]!==i||T[17]!==l?(t=new tM.Vector3(i,l,s),T[15]=s,T[16]=i,T[17]=l,T[18]=t):t=T[18],c=t}let W=c;r:{let e;if(!z){u=null;break r}T[19]!==R||T[20]!==W||T[21]!==z.heightMap?(e=function(e,t,r){let a=(t,r)=>{let a=Math.max(0,Math.min(255,t)),n=Math.max(0,Math.min(255,r)),o=Math.floor(a),i=Math.floor(n),l=Math.min(o+1,255),s=Math.min(i+1,255),c=a-o,u=n-i;return((e[256*i+o]/65535*(1-c)+e[256*i+l]/65535*c)*(1-u)+(e[256*s+o]/65535*(1-c)+e[256*s+l]/65535*c)*u)*2048},n=new tM.Vector3(-t.x,-t.y,-t.z).normalize(),o=new Uint8Array(262144);for(let e=0;e<512;e++)for(let t=0;t<512;t++){let i=t/2+.25,l=e/2+.25,s=a(i,l),c=a(i-.5,l),u=a(i+.5,l),d=a(i,l-.5),m=-((a(i,l+.5)-d)/1),f=-((u-c)/1),h=Math.sqrt(m*m+r*r+f*f),p=Math.max(0,m/h*n.x+r/h*n.y+f/h*n.z),g=1;p>0&&(g=function(e,t,r,a,n,o){let i=a.z/n,l=a.x/n,s=a.y,c=Math.sqrt(i*i+l*l);if(c<1e-4)return 1;let u=.5/c,d=i*u,m=l*u,f=s*u,h=e,p=t,g=r+.1;for(let e=0;e<768&&(h+=d,p+=m,g+=f,!(h<0)&&!(h>=256)&&!(p<0)&&!(p>=256)&&!(g>2048));e++)if(gArray(K).fill(null),T[32]=K,T[33]=g):g=T[33];let[J,Z]=(0,a.useState)(g);T[34]===Symbol.for("react.memo_cache_sentinel")?(v={xStart:0,xEnd:0,zStart:0,zEnd:0},T[34]=v):v=T[34];let X=(0,a.useRef)(v);return(T[35]!==P.x||T[36]!==P.z||T[37]!==L||T[38]!==I.position.x||T[39]!==I.position.z||T[40]!==K||T[41]!==B?(x=()=>{let e=I.position.x-P.x,t=I.position.z-P.z,r=Math.floor((e-B)/L),a=Math.ceil((e+B)/L),n=Math.floor((t-B)/L),o=Math.ceil((t+B)/L),i=X.current;if(r===i.xStart&&a===i.xEnd&&n===i.zStart&&o===i.zEnd)return;i.xStart=r,i.xEnd=a,i.zStart=n,i.zEnd=o;let l=[];for(let e=r;e{let r=J[e];return(0,t.jsx)(tX,{tileX:r?.tileX??0,tileZ:r?.tileZ??0,blockSize:L,basePosition:P,textureNames:z.textureNames,geometry:G,displacementMap:O,visibilityMask:V,alphaTextures:q,detailTextureName:D,lightmap:H,visible:null!==r},e)}),T[53]=P,T[54]=L,T[55]=D,T[56]=Y,T[57]=q,T[58]=O,T[59]=G,T[60]=z.textureNames,T[61]=H,T[62]=J,T[63]=b):b=T[63],T[64]!==y||T[65]!==b?(_=(0,t.jsxs)(t.Fragment,{children:[y,b]}),T[64]=y,T[65]=b,T[66]=_):_=T[66],_):(t1.debug("Not ready: terrain=%s geometry=%s displacement=%s alpha=%s",!!z,!!G,!!O,!!q),null)});function t5(e){return e.camera}function t4(){return t0(null)}function t6(e){return(0,tH.setupMask)(e)}function t8(e,t){return t}var t7=e.i(8597),t9=e.i(78140);let re=` -vec3 interiorLinearToSRGB(vec3 linear) { - vec3 higher = pow(linear, vec3(1.0/2.4)) * 1.055 - 0.055; - vec3 lower = linear * 12.92; - return mix(lower, higher, step(vec3(0.0031308), linear)); -} - -vec3 interiorSRGBToLinear(vec3 srgb) { - vec3 higher = pow((srgb + 0.055) / 1.055, vec3(2.4)); - vec3 lower = srgb / 12.92; - return mix(lower, higher, step(vec3(0.04045), srgb)); -} - -// Debug grid overlay function using screen-space derivatives for sharp, anti-aliased lines -// Returns 1.0 on grid lines, 0.0 elsewhere -float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); -} -`,rt=(0,w.createLogger)("InteriorInstance");function rr({materialName:e,material:r,lightMap:n}){let o=(0,b.useDebug)(),i=o?.debugMode??!1,l=(0,tq.useAnisotropy)(),s=(0,tW.textureToUrl)(e),c=(0,tO.useTexture)(s,e=>(0,tH.setupTexture)(e,{anisotropy:l})),u=new Set(r?.userData?.flag_names??[]).has("SelfIlluminating"),d=new Set(r?.userData?.surface_flag_names??[]).has("SurfaceOutsideVisible"),m=(0,a.useCallback)(e=>{let t;(0,tQ.injectCustomFog)(e,tK.globalFogUniforms),t=d??!1,e.uniforms.useSceneLighting={value:t},e.uniforms.interiorDebugColor={value:t?new tM.Vector3(0,.4,1):new tM.Vector3(1,.2,0)},e.fragmentShader=e.fragmentShader.replace("#include ",`#include -${re} -uniform bool useSceneLighting; -uniform vec3 interiorDebugColor; -`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Lightmap handled in custom output calculation -#ifdef USE_LIGHTMAP - vec4 lightMapTexel = texture2D( lightMap, vLightMapUv ); -#endif`),e.fragmentShader=e.fragmentShader.replace("#include ",`// Torque-style lighting: output = clamp(lighting \xd7 texture, 0, 1) in sRGB space -// Get texture in sRGB space (undo Three.js linear decode) -vec3 textureSRGB = interiorLinearToSRGB(diffuseColor.rgb); - -// Compute lighting in sRGB space -vec3 lightingSRGB = vec3(0.0); - -if (useSceneLighting) { - // Three.js computed: reflectedLight = lighting \xd7 texture_linear / PI - // Extract pure lighting: lighting = reflectedLight \xd7 PI / texture_linear - vec3 totalLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse; - vec3 safeTexLinear = max(diffuseColor.rgb, vec3(0.001)); - vec3 extractedLighting = totalLight * PI / safeTexLinear; - // NOTE: extractedLighting is ALREADY sRGB values because mission sun/ambient colors - // are sRGB values (Torque used them directly in gamma space). Three.js treats them - // as linear but the numerical values are the same. DO NOT convert to sRGB here! - // IMPORTANT: Torque clamps scene lighting to [0,1] BEFORE adding to lightmap - // (sceneLighting.cc line 1785: tmp.clamp()) - lightingSRGB = clamp(extractedLighting, 0.0, 1.0); -} - -// Add lightmap contribution (for BOTH outside and inside surfaces) -// In Torque, scene lighting is ADDED to lightmaps for outside surfaces at mission load -// (stored in .ml files). Inside surfaces only have base lightmap. Both need lightmap here. -#ifdef USE_LIGHTMAP - // Lightmap is stored as linear in Three.js (decoded from sRGB texture), convert back - lightingSRGB += interiorLinearToSRGB(lightMapTexel.rgb); -#endif -// Torque clamps the sum to [0,1] per channel (sceneLighting.cc lines 1817-1827) -lightingSRGB = clamp(lightingSRGB, 0.0, 1.0); - -// Torque formula: output = clamp(lighting \xd7 texture, 0, 1) in sRGB/gamma space -vec3 resultSRGB = clamp(lightingSRGB * textureSRGB, 0.0, 1.0); - -// Convert back to linear for Three.js output pipeline -vec3 resultLinear = interiorSRGBToLinear(resultSRGB); - -// Reassign outgoingLight before opaque_fragment consumes it -outgoingLight = resultLinear + totalEmissiveRadiance; - -#include `),e.fragmentShader=e.fragmentShader.replace("#include ",`// Debug mode: overlay colored grid on top of normal rendering -// Blue grid = SurfaceOutsideVisible (receives scene ambient light) -// Red grid = inside surface (no scene ambient light) -#if DEBUG_MODE && defined(USE_MAP) - // gridSize=4 creates 4x4 grid per UV tile, lineWidth=1.5 is ~1.5 pixels wide - float gridIntensity = debugGrid(vMapUv, 4.0, 1.5); - gl_FragColor.rgb = mix(gl_FragColor.rgb, interiorDebugColor, gridIntensity * 0.1); -#endif - -#include `)},[d]),f=(0,a.useRef)(null),h=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=f.current??h.current;e&&(e.defines??={},e.defines.DEBUG_MODE=+!!i,e.needsUpdate=!0)},[i]);let p={DEBUG_MODE:+!!i},g=`${d}`;return u?(0,t.jsx)("meshBasicMaterial",{ref:f,map:c,toneMapped:!1,defines:p,onBeforeCompile:m},g):(0,t.jsx)("meshLambertMaterial",{ref:h,map:c,lightMap:n,toneMapped:!1,defines:p,onBeforeCompile:m},g)}function ra(e){if(!e)return null;let t=e.emissiveMap;return t&&(t.colorSpace=tM.SRGBColorSpace),t??null}function rn(e){let a,n,o,i=(0,r.c)(13),{node:l}=e;e:{let e,t;if(!l.material){let e;i[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],i[0]=e):e=i[0],a=e;break e}if(Array.isArray(l.material)){let e;i[1]!==l.material?(e=l.material.map(ro),i[1]=l.material,i[2]=e):e=i[2],a=e;break e}i[3]!==l.material?(e=ra(l.material),i[3]=l.material,i[4]=e):e=i[4],i[5]!==e?(t=[e],i[5]=e,i[6]=t):t=i[6],a=t}let s=a;return i[7]!==s||i[8]!==l.material?(n=l.material?(0,t.jsx)(tI.DebugSuspense,{name:`InteriorTexture:${Array.isArray(l.material)?l.material[0]?.userData?.resource_path:l.material?.userData?.resource_path??"?"}`,fallback:(0,t.jsx)("meshStandardMaterial",{color:"yellow",wireframe:!0}),children:Array.isArray(l.material)?l.material.map((e,r)=>(0,t.jsx)(rr,{materialName:e.userData.resource_path,material:e,lightMap:s[r]},r)):(0,t.jsx)(rr,{materialName:l.material.userData.resource_path,material:l.material,lightMap:s[0]})}):null,i[7]=s,i[8]=l.material,i[9]=n):n=i[9],i[10]!==l.geometry||i[11]!==n?(o=(0,t.jsx)("mesh",{geometry:l.geometry,castShadow:!0,receiveShadow:!0,children:n}),i[10]=l.geometry,i[11]=n,i[12]=o):o=i[12],o}function ro(e){return ra(e)}let ri=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u=(0,r.c)(10),{interiorFile:d,ghostIndex:m}=e,{nodes:f}=((s=(0,r.c)(2))[0]!==d?(l=(0,tW.interiorToUrl)(d),s[0]=d,s[1]=l):l=s[1],c=l,(0,t9.useGLTF)(c)),h=(0,b.useDebug)(),p=h?.debugMode??!1;return u[0]===Symbol.for("react.memo_cache_sentinel")?(a=[0,-Math.PI/2,0],u[0]=a):a=u[0],u[1]!==f?(n=Object.entries(f).filter(ru).map(rd),u[1]=f,u[2]=n):n=u[2],u[3]!==p||u[4]!==m||u[5]!==d?(o=p?(0,t.jsxs)(tP.FloatingLabel,{children:[m,": ",d]}):null,u[3]=p,u[4]=m,u[5]=d,u[6]=o):o=u[6],u[7]!==n||u[8]!==o?(i=(0,t.jsxs)("group",{rotation:a,children:[n,o]}),u[7]=n,u[8]=o,u[9]=i):i=u[9],i});function rl(e){let a,n,o,i,l=(0,r.c)(9),{color:s,label:c}=e;return l[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),l[0]=a):a=l[0],l[1]!==s?(n=(0,t.jsx)("meshStandardMaterial",{color:s,wireframe:!0}),l[1]=s,l[2]=n):n=l[2],l[3]!==s||l[4]!==c?(o=c?(0,t.jsx)(tP.FloatingLabel,{color:s,children:c}):null,l[3]=s,l[4]=c,l[5]=o):o=l[5],l[6]!==n||l[7]!==o?(i=(0,t.jsxs)("mesh",{children:[a,n,o]}),l[6]=n,l[7]=o,l[8]=i):i=l[8],i}function rs(e){let a,n=(0,r.c)(3),{label:o}=e,i=(0,b.useDebug)(),l=i?.debugMode??!1;return n[0]!==l||n[1]!==o?(a=l?(0,t.jsx)(rl,{color:"red",label:o}):null,n[0]=l,n[1]=o,n[2]=a):a=n[2],a}let rc=(0,a.memo)(function(e){let a,n,o,i,l,s,c,u,d,m,f=(0,r.c)(26),{scene:h}=e;f[0]!==h.transform.position?(a=(0,tU.torqueToThree)(h.transform.position),f[0]=h.transform.position,f[1]=a):a=f[1];let p=a;f[2]!==h.transform?(n=(0,tU.matrixFToQuaternion)(h.transform),f[2]=h.transform,f[3]=n):n=f[3];let g=n;f[4]!==h.scale?(o=(0,tU.torqueScaleToThree)(h.scale),f[4]=h.scale,f[5]=o):o=f[5];let v=o,x=`${h.ghostIndex}: ${h.interiorFile}`;f[6]!==x?(i=(0,t.jsx)(rs,{label:x}),f[6]=x,f[7]=i):i=f[7],f[8]!==h.interiorFile?(l=e=>{rt.error("Failed to load %s: %s",h.interiorFile,e.message)},f[8]=h.interiorFile,f[9]=l):l=f[9];let y=`InteriorModel:${h.interiorFile}`;return f[10]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)(rl,{color:"orange"}),f[10]=s):s=f[10],f[11]!==h.ghostIndex||f[12]!==h.interiorFile?(c=(0,t.jsx)(ri,{interiorFile:h.interiorFile,ghostIndex:h.ghostIndex}),f[11]=h.ghostIndex,f[12]=h.interiorFile,f[13]=c):c=f[13],f[14]!==y||f[15]!==c?(u=(0,t.jsx)(tI.DebugSuspense,{name:y,fallback:s,children:c}),f[14]=y,f[15]=c,f[16]=u):u=f[16],f[17]!==u||f[18]!==i||f[19]!==l?(d=(0,t.jsx)(t7.ErrorBoundary,{fallback:i,onError:l,children:u}),f[17]=u,f[18]=i,f[19]=l,f[20]=d):d=f[20],f[21]!==p||f[22]!==g||f[23]!==v||f[24]!==d?(m=(0,t.jsx)("group",{position:p,quaternion:g,scale:v,children:d}),f[21]=p,f[22]=g,f[23]=v,f[24]=d,f[25]=m):m=f[25],m});function ru(e){let[,t]=e;return t.isMesh}function rd(e){let[r,a]=e;return(0,t.jsx)(rn,{node:a},r)}var rm=e.i(99143);function rf(e,{path:t}){let[r]=(0,rm.useLoader)(tM.CubeTextureLoader,[e],e=>e.setPath(t));return r}rf.preload=(e,{path:t})=>rm.useLoader.preload(tM.CubeTextureLoader,[e],e=>e.setPath(t));let rh=()=>{};function rp(e){return e.wrapS=tM.RepeatWrapping,e.wrapT=tM.RepeatWrapping,e.minFilter=tM.LinearFilter,e.magFilter=tM.LinearFilter,e.colorSpace=tM.NoColorSpace,e.needsUpdate=!0,e}let rg=` - attribute float alpha; - - uniform vec2 uvOffset; - - varying vec2 vUv; - varying float vAlpha; - - void main() { - // Apply UV offset for scrolling - vUv = uv + uvOffset; - vAlpha = alpha; - - vec4 pos = projectionMatrix * modelViewMatrix * vec4(position, 1.0); - // Set depth to far plane so clouds are always visible and behind other geometry - gl_Position = pos.xyww; - } -`,rv=` - uniform sampler2D cloudTexture; - uniform float debugMode; - uniform int layerIndex; - - varying vec2 vUv; - varying float vAlpha; - - // Debug grid using screen-space derivatives for sharp, anti-aliased lines - float debugGrid(vec2 uv, float gridSize, float lineWidth) { - vec2 scaledUV = uv * gridSize; - vec2 grid = abs(fract(scaledUV - 0.5) - 0.5) / fwidth(scaledUV); - float line = min(grid.x, grid.y); - return 1.0 - min(line / lineWidth, 1.0); - } - - void main() { - vec4 texColor = texture2D(cloudTexture, vUv); - - // Tribes 2 uses GL_MODULATE: final = texture \xd7 vertex color - // Vertex color is white with varying alpha, so: - // Final RGB = Texture RGB \xd7 1.0 = Texture RGB - // Final Alpha = Texture Alpha \xd7 Vertex Alpha - float finalAlpha = texColor.a * vAlpha; - vec3 color = texColor.rgb; - - // Debug mode: overlay R/G/B grid for layers 0/1/2 - if (debugMode > 0.5) { - float gridIntensity = debugGrid(vUv, 4.0, 1.5); - vec3 gridColor; - if (layerIndex == 0) { - gridColor = vec3(1.0, 0.0, 0.0); // Red - } else if (layerIndex == 1) { - gridColor = vec3(0.0, 1.0, 0.0); // Green - } else { - gridColor = vec3(0.0, 0.0, 1.0); // Blue - } - color = mix(color, gridColor, gridIntensity * 0.5); - } - - // Output clouds with texture color and combined alpha - gl_FragColor = vec4(color, finalAlpha); - } -`;function rx({textureUrl:e,radius:r,heightPercent:n,speed:o,windDirection:i,layerIndex:l}){let{debugMode:s}=(0,b.useDebug)(),{animationEnabled:c}=(0,b.useSettings)(),u=(0,a.useRef)(null),d=(0,tO.useTexture)(e,rp),m=(0,a.useMemo)(()=>{let e=n-.05;return function(e,t,r,a){var n;let o,i,l,s,c,u,d,m,f,h,p,g,v,x,y,b,_,S=new tM.BufferGeometry,j=new Float32Array(75),C=new Float32Array(50),w=[.05,.05,.05,.05,.05,.05,r,r,r,.05,.05,r,t,r,.05,.05,r,r,r,.05,.05,.05,.05,.05,.05],M=2*e/4;for(let t=0;t<5;t++)for(let r=0;r<5;r++){let a=5*t+r,n=-e+r*M,o=e-t*M,i=e*w[a];j[3*a]=n,j[3*a+1]=i,j[3*a+2]=o,C[2*a]=r,C[2*a+1]=t}n=j,o=e=>({x:n[3*e],y:n[3*e+1],z:n[3*e+2]}),i=(e,t,r,a)=>{n[3*e]=t,n[3*e+1]=r,n[3*e+2]=a},l=o(1),s=o(3),c=o(5),u=o(6),d=o(8),m=o(9),f=o(15),h=o(16),p=o(18),g=o(19),v=o(21),x=o(23),y=c.x+(l.x-c.x)*.5,b=c.y+(l.y-c.y)*.5,_=c.z+(l.z-c.z)*.5,i(0,u.x+(y-u.x)*2,u.y+(b-u.y)*2,u.z+(_-u.z)*2),y=m.x+(s.x-m.x)*.5,b=m.y+(s.y-m.y)*.5,_=m.z+(s.z-m.z)*.5,i(4,d.x+(y-d.x)*2,d.y+(b-d.y)*2,d.z+(_-d.z)*2),y=v.x+(f.x-v.x)*.5,b=v.y+(f.y-v.y)*.5,_=v.z+(f.z-v.z)*.5,i(20,h.x+(y-h.x)*2,h.y+(b-h.y)*2,h.z+(_-h.z)*2),y=x.x+(g.x-x.x)*.5,b=x.y+(g.y-x.y)*.5,_=x.z+(g.z-x.z)*.5,i(24,p.x+(y-p.x)*2,p.y+(b-p.y)*2,p.z+(_-p.z)*2);let N=function(e,t){let r=new Float32Array(25);for(let a=0;a<25;a++){let n=e[3*a],o=e[3*a+2],i=1.3-Math.sqrt(n*n+o*o)/t;i<.4?i=0:i>.8&&(i=1),r[a]=i}return r}(j,e),T=[];for(let e=0;e<4;e++)for(let t=0;t<4;t++){let r=5*e+t,a=r+1,n=r+5,o=n+1;T.push(r,n,o),T.push(r,o,a)}return S.setIndex(T),S.setAttribute("position",new tM.Float32BufferAttribute(j,3)),S.setAttribute("uv",new tM.Float32BufferAttribute(C,2)),S.setAttribute("alpha",new tM.Float32BufferAttribute(N,1)),S.computeBoundingSphere(),S}(r,n,e,0)},[r,n]);(0,a.useEffect)(()=>()=>{m.dispose()},[m]);let f=(0,a.useMemo)(()=>new tM.ShaderMaterial({uniforms:{cloudTexture:{value:d},uvOffset:{value:new tM.Vector2(0,0)},debugMode:{value:+!!s},layerIndex:{value:l}},vertexShader:rg,fragmentShader:rv,transparent:!0,depthWrite:!1,side:tM.DoubleSide}),[d,s,l]);return(0,a.useEffect)(()=>()=>{f.dispose()},[f]),(0,tw.useFrame)(c?(e,t)=>{let r=1e3*t/32;u.current??=new tM.Vector2(0,0),u.current.x+=i.x*o*r,u.current.y+=i.y*o*r,u.current.x-=Math.floor(u.current.x),u.current.y-=Math.floor(u.current.y),f.uniforms.uvOffset.value.copy(u.current)}:rh),(0,t.jsx)("mesh",{geometry:m,frustumCulled:!1,renderOrder:10,children:(0,t.jsx)("primitive",{object:f,attach:"material"})})}function ry(e){var n;let o,i,l,s,c,u,d,m,f,h,p,g=(0,r.c)(18),{scene:v}=e,{data:x}=(n=v.materialList||void 0,(h=(0,r.c)(7))[0]!==n?(d=["detailMapList",n],m=()=>(0,tW.loadDetailMapList)(n),h[0]=n,h[1]=d,h[2]=m):(d=h[1],m=h[2]),p=!!n,h[3]!==d||h[4]!==m||h[5]!==p?(f={queryKey:d,queryFn:m,enabled:p},h[3]=d,h[4]=m,h[5]=p,h[6]=f):f=h[6],(0,tG.useQuery)(f)),y=.95*(v.visibleDistance>0?v.visibleDistance:500);g[0]!==v.cloudLayers?(o=v.cloudLayers.map(r_),g[0]=v.cloudLayers,g[1]=o):o=g[1];let b=o;g[2]!==v.cloudLayers?(i=v.cloudLayers.map(rb),g[2]=v.cloudLayers,g[3]=i):i=g[3];let _=i;e:{let e,{x:t,y:r}=v.windVelocity;if(0!==t||0!==r){let e;g[4]!==t||g[5]!==r?(e=new tM.Vector2(r,-t).normalize(),g[4]=t,g[5]=r,g[6]=e):e=g[6],l=e;break e}g[7]===Symbol.for("react.memo_cache_sentinel")?(e=new tM.Vector2(1,0),g[7]=e):e=g[7],l=e}let S=l;t:{let e;if(!x){let e;g[8]===Symbol.for("react.memo_cache_sentinel")?(e=[],g[8]=e):e=g[8],s=e;break t}if(g[9]!==_||g[10]!==b||g[11]!==x){e=[];for(let t=0;t<3;t++){let r=x[7+t];r&&e.push({texture:r,height:_[t],speed:b[t]})}g[9]=_,g[10]=b,g[11]=x,g[12]=e}else e=g[12];s=e}let j=s,C=(0,a.useRef)(null);return(g[13]===Symbol.for("react.memo_cache_sentinel")?(c=e=>{let{camera:t}=e;C.current&&C.current.position.copy(t.position)},g[13]=c):c=g[13],(0,tw.useFrame)(c),j&&0!==j.length)?(g[14]!==j||g[15]!==y||g[16]!==S?(u=(0,t.jsx)("group",{ref:C,children:j.map((e,r)=>{let n=(0,tW.textureToUrl)(e.texture);return(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rx,{textureUrl:n,radius:y,heightPercent:e.height,speed:e.speed,windDirection:S,layerIndex:r})},r)})}),g[14]=j,g[15]=y,g[16]=S,g[17]=u):u=g[17],u):null}function rb(e,t){return e.heightPercent||[.35,.25,.2][t]}function r_(e,t){return e.speed||[1e-4,2e-4,3e-4][t]}e.i(62395);let rS=(0,w.createLogger)("Sky"),rj=!1;function rC(e){return[new tM.Color().setRGB(e.r,e.g,e.b),new tM.Color().setRGB(e.r,e.g,e.b).convertSRGBToLinear()]}function rw({skyBoxFiles:e,fogColor:r,fogState:n}){let o=(0,tC.useThree)(e=>e.camera),i=rf(e,{path:""}),l=!!r,s=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),c=(0,a.useMemo)(()=>n?(0,tK.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),u=(0,a.useRef)({skybox:{value:i},fogColor:{value:r??new tM.Color(0,0,0)},enableFog:{value:l},inverseProjectionMatrix:{value:s},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:tK.globalFogUniforms.cameraHeight,fogVolumeData:{value:c},horizonFogHeight:{value:.18}}),d=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]);return(0,a.useEffect)(()=>{u.current.skybox.value=i,u.current.fogColor.value=r??new tM.Color(0,0,0),u.current.enableFog.value=l,u.current.fogVolumeData.value=c,u.current.horizonFogHeight.value=d},[i,r,l,c,d]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform samplerCube skybox; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - // shaderMaterial does NOT get automatic linear->sRGB output conversion - // Use proper sRGB transfer function (not simplified gamma 2.2) to match Three.js - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - // Sample skybox - Three.js CubeTexture with SRGBColorSpace auto-converts to linear - vec4 skyColor = textureCube(skybox, direction); - vec3 finalColor; - - if (enableFog) { - vec3 effectiveFogColor = fogColor; - - // Calculate how much fog volume the ray passes through - // For skybox at "infinite" distance, the relevant height is how much - // of the volume is above/below camera depending on view direction - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - // Check if camera is inside this volume - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - // Camera is inside the fog volume - // Looking horizontally or up at shallow angles means ray travels - // through more fog before exiting the volume - float heightAboveCamera = volMaxH - cameraHeight; - float heightBelowCamera = cameraHeight - volMinH; - float volumeHeight = volMaxH - volMinH; - - // For horizontal rays (direction.y ≈ 0), maximum fog influence - // For rays going up steeply, less fog (exits volume quickly) - // For rays going down, more fog (travels through volume below) - float rayInfluence; - if (direction.y >= 0.0) { - // Looking up: influence based on how steep we're looking - // Shallow angles = long path through fog = high influence - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - // Looking down: always high fog (into the volume) - rayInfluence = 1.0; - } - - // Scale by percentage and volume depth factor - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction (for haze at horizon) - // In Torque, the fog "bans" (bands) are rendered as geometry from - // height 0 (HORIZON) to height 60 (OFFSET_HEIGHT) on the skybox. - // The skybox corner is at mSkyBoxPt.x = mRadius / sqrt(3). - // - // horizonFogHeight is the direction.y value where the fog band ends: - // horizonFogHeight = 60 / sqrt(skyBoxPt.x^2 + 60^2) - // - // For Firestorm (visDist=600): mRadius=570, skyBoxPt.x=329, horizonFogHeight≈0.18 - // - // Torque renders the fog bands as geometry with linear vertex alpha - // interpolation. We use a squared curve (t^2) to create a gentler - // falloff at the top of the gradient, matching Tribes 2's appearance. - float baseFogFactor; - if (direction.y <= 0.0) { - // Looking at or below horizon: full fog - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - // Above fog band: no fog - baseFogFactor = 0.0; - } else { - // Within fog band: squared curve for gentler falloff at top - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - // When inside a volume, increase fog intensity - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor.rgb, effectiveFogColor, finalFogFactor); - } else { - finalColor = skyColor.rgb; - } - // Convert linear result to sRGB for display - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function rM(e){let n,o,i,l,s,c,u,d=(0,r.c)(6),{materialList:m,fogColor:f,fogState:h}=e,{data:p}=((c=(0,r.c)(8))[0]!==m?(i={queryKey:["detailMapList",m],queryFn:()=>(rS.debug("Loading detail map list: %s",m),(0,tW.loadDetailMapList)(m))},c[0]=m,c[1]=i):i=c[1],u=(0,tG.useQuery)(i),c[2]!==m||c[3]!==u.data||c[4]!==u.error||c[5]!==u.status?(l=()=>{rS.debug("DML query status: %s%s%s file=%s",u.status,u.error?` error=${u.error.message}`:"",u.data?` (${u.data.length} entries)`:" (no data)",m)},s=[u.status,u.error,u.data,m],c[2]=m,c[3]=u.data,c[4]=u.error,c[5]=u.status,c[6]=l,c[7]=s):(l=c[6],s=c[7]),(0,a.useEffect)(l,s),u);d[0]!==p?(n=p?[(0,tW.textureToUrl)(p[1]),(0,tW.textureToUrl)(p[3]),(0,tW.textureToUrl)(p[4]),(0,tW.textureToUrl)(p[5]),(0,tW.textureToUrl)(p[0]),(0,tW.textureToUrl)(p[2])]:null,d[0]=p,d[1]=n):n=d[1];let g=n;return g?(d[2]!==f||d[3]!==h||d[4]!==g?(o=(0,t.jsx)(rw,{skyBoxFiles:g,fogColor:f,fogState:h}),d[2]=f,d[3]=h,d[4]=g,d[5]=o):o=d[5],o):null}function rN({skyColor:e,fogColor:r,fogState:n}){let o=(0,tC.useThree)(e=>e.camera),i=!!r,l=(0,a.useMemo)(()=>o.projectionMatrixInverse,[o]),s=(0,a.useMemo)(()=>n?(0,tK.packFogVolumeData)(n.fogVolumes):new Float32Array(12),[n]),c=(0,a.useMemo)(()=>{if(!n)return .18;let e=.95*n.visibleDistance/Math.sqrt(3);return 60/Math.sqrt(e*e+3600)},[n]),u=(0,a.useRef)({skyColor:{value:e},fogColor:{value:r??new tM.Color(0,0,0)},enableFog:{value:i},inverseProjectionMatrix:{value:l},cameraMatrixWorld:{value:o.matrixWorld},cameraHeight:tK.globalFogUniforms.cameraHeight,fogVolumeData:{value:s},horizonFogHeight:{value:c}});return(0,a.useEffect)(()=>{u.current.skyColor.value=e,u.current.fogColor.value=r??new tM.Color(0,0,0),u.current.enableFog.value=i,u.current.fogVolumeData.value=s,u.current.horizonFogHeight.value=c},[e,r,i,s,c]),(0,t.jsxs)("mesh",{renderOrder:-1e3,frustumCulled:!1,children:[(0,t.jsxs)("bufferGeometry",{children:[(0,t.jsx)("bufferAttribute",{attach:"attributes-position",array:new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),count:3,itemSize:3}),(0,t.jsx)("bufferAttribute",{attach:"attributes-uv",array:new Float32Array([0,0,2,0,0,2]),count:3,itemSize:2})]}),(0,t.jsx)("shaderMaterial",{uniforms:u.current,vertexShader:` - varying vec2 vUv; - - void main() { - vUv = uv; - gl_Position = vec4(position.xy, 0.9999, 1.0); - } - `,fragmentShader:` - uniform vec3 skyColor; - uniform vec3 fogColor; - uniform bool enableFog; - uniform mat4 inverseProjectionMatrix; - uniform mat4 cameraMatrixWorld; - uniform float cameraHeight; - uniform float fogVolumeData[12]; - uniform float horizonFogHeight; - - varying vec2 vUv; - - // Convert linear to sRGB for display - vec3 linearToSRGB(vec3 linear) { - vec3 low = linear * 12.92; - vec3 high = 1.055 * pow(linear, vec3(1.0 / 2.4)) - 0.055; - return mix(low, high, step(vec3(0.0031308), linear)); - } - - void main() { - vec2 ndc = vUv * 2.0 - 1.0; - vec4 viewPos = inverseProjectionMatrix * vec4(ndc, 1.0, 1.0); - viewPos.xyz /= viewPos.w; - vec3 direction = normalize((cameraMatrixWorld * vec4(viewPos.xyz, 0.0)).xyz); - direction = vec3(direction.z, direction.y, -direction.x); - - vec3 finalColor; - - if (enableFog) { - // Calculate volume fog influence (same logic as SkyBoxTexture) - float volumeFogInfluence = 0.0; - - for (int i = 0; i < 3; i++) { - int offset = i * 4; - float volVisDist = fogVolumeData[offset + 0]; - float volMinH = fogVolumeData[offset + 1]; - float volMaxH = fogVolumeData[offset + 2]; - float volPct = fogVolumeData[offset + 3]; - - if (volVisDist <= 0.0) continue; - - if (cameraHeight >= volMinH && cameraHeight <= volMaxH) { - float rayInfluence; - if (direction.y >= 0.0) { - rayInfluence = 1.0 - smoothstep(0.0, 0.3, direction.y); - } else { - rayInfluence = 1.0; - } - volumeFogInfluence += rayInfluence * volPct; - } - } - - // Base fog factor from view direction - float baseFogFactor; - if (direction.y <= 0.0) { - baseFogFactor = 1.0; - } else if (direction.y >= horizonFogHeight) { - baseFogFactor = 0.0; - } else { - float t = direction.y / horizonFogHeight; - baseFogFactor = (1.0 - t) * (1.0 - t); - } - - // Combine base fog with volume fog influence - float finalFogFactor = min(1.0, baseFogFactor + volumeFogInfluence * 0.5); - - finalColor = mix(skyColor, fogColor, finalFogFactor); - } else { - finalColor = skyColor; - } - - gl_FragColor = vec4(linearToSRGB(finalColor), 1.0); - } - `,depthWrite:!1,depthTest:!1})]})}function rT(e,t){let{fogDistance:r,visibleDistance:a}=e;return[r,a]}function rk({fogState:e,enabled:t}){let r=(0,tC.useThree)(e=>e.scene),n=(0,tC.useThree)(e=>e.camera),o=(0,a.useRef)(null),i=(0,a.useMemo)(()=>(0,tK.packFogVolumeData)(e.fogVolumes),[e.fogVolumes]);return(0,a.useEffect)(()=>{rj||((0,tQ.installCustomFogShader)(),rj=!0)},[]),(0,a.useEffect)(()=>{(0,tK.resetGlobalFogUniforms)();let[t,a]=rT(e,n.position.y),l=new tM.Fog(e.fogColor,t,a);return r.fog=l,o.current=l,(0,tK.updateGlobalFogUniforms)(n.position.y,i),()=>{r.fog=null,o.current=null,(0,tK.resetGlobalFogUniforms)()}},[r,n,e,i]),(0,a.useEffect)(()=>{let r=o.current;if(r)if(t){let[t,a]=rT(e,n.position.y);r.near=t,r.far=a}else r.near=1e10,r.far=1e10},[t,e,n.position.y]),(0,tw.useFrame)(()=>{let r=o.current;if(!r)return;let a=n.position.y;if((0,tK.updateGlobalFogUniforms)(a,i,t),t){let[t,n]=rT(e,a);r.near=t,r.far=n,r.color.copy(e.fogColor)}}),null}let rF=(0,a.memo)(function({entity:e}){let{skyData:r}=e;rS.debug("Rendering: materialList=%s, useSkyTextures=%s",r.materialList,r.useSkyTextures);let{fogEnabled:n}=(0,b.useSettings)(),o=r.materialList||void 0,i=(0,a.useMemo)(()=>rC(r.skySolidColor),[r.skySolidColor]),l=r.useSkyTextures,s=(0,a.useMemo)(()=>(function(e){let t=e.fogDistance,r=e.visibleDistance>0?e.visibleDistance:1e3,{r:a,g:n,b:o}=e.fogColor,i=new tM.Color().setRGB(a,n,o).convertSRGBToLinear(),l=[];for(let t of e.fogVolumes)t.visibleDistance<=0||t.maxHeight<=t.minHeight||l.push({visibleDistance:t.visibleDistance,minHeight:t.minHeight,maxHeight:t.maxHeight,percentage:1});let s=l.reduce((e,t)=>Math.max(e,t.maxHeight),0);return{fogDistance:t,visibleDistance:r,fogColor:i,fogVolumes:l,fogLine:s,enabled:r>t}})(r),[r]);rS.debug("fogState: fogColor=(%s, %s, %s) visibleDistance=%d fogDistance=%d enabled=%s volumes=%d",r.fogColor.r.toFixed(3),r.fogColor.g.toFixed(3),r.fogColor.b.toFixed(3),r.visibleDistance,r.fogDistance,s.enabled,s.fogVolumes.length);let c=(0,a.useMemo)(()=>rC(r.fogColor),[r.fogColor]),u=i||c,d=s.enabled&&n,m=s.fogColor,f=(0,tC.useThree)(e=>e.scene),h=(0,tC.useThree)(e=>e.gl);(0,a.useEffect)(()=>{if(d){let e=m.clone();f.background=e,h.setClearColor(e)}else if(u){let e=u[0].clone();f.background=e,h.setClearColor(e)}else f.background=null;return()=>{f.background=null}},[f,h,d,m,u]);let p=i?.[1];return(0,t.jsxs)(t.Fragment,{children:[o&&l&&o.length>0?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(rM,{materialList:o,fogColor:d?m:void 0,fogState:d?s:void 0},o)}):p?(0,t.jsx)(rN,{skyColor:p,fogColor:d?m:void 0,fogState:d?s:void 0}):null,(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ry,{scene:r})}),s.enabled?(0,t.jsx)(rk,{fogState:s,enabled:n}):null]})});function rR(e){let n,o=(0,r.c)(3),{children:i}=e,{audioEnabled:l}=(0,b.useSettings)();return o[0]!==l||o[1]!==i?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=l,o[1]=i,o[2]=n):n=o[2],n}function rD(e,n){let o=(0,a.lazy)(()=>n().then(t=>({default:t[e]}))),i=a=>{let n,i,l=(0,r.c)(5),{entity:s}=a,c=`${e}:${s.id}`;return l[0]!==s?(n=(0,t.jsx)(o,{entity:s}),l[0]=s,l[1]=n):n=l[1],l[2]!==c||l[3]!==n?(i=(0,t.jsx)(tI.DebugSuspense,{name:c,children:n}),l[2]=c,l[3]=n,l[4]=i):i=l[4],i};return i.displayName=`createLazy(${e})`,i}let rL=rD("PlayerModel",()=>e.A(30814)),rB=rD("ExplosionShape",()=>e.A(44325)),rI=rD("TracerProjectile",()=>e.A(62125)),rA=rD("SpriteProjectile",()=>e.A(62125)),rP=rD("ForceFieldBare",()=>e.A(25147)),rE=rD("AudioEmitter",()=>e.A(61921)),rz=rD("WaterBlock",()=>e.A(18599)),rG=rD("WeaponModel",()=>e.A(44325)),rU={1:"Storm",2:"Inferno"},rW=(0,a.memo)(function(e){let a=(0,r.c)(26),{entity:n}=e;switch(n.renderType){case"Shape":{let e;return a[0]!==n?(e=(0,t.jsx)(rH,{entity:n}),a[0]=n,a[1]=e):e=a[1],e}case"ForceFieldBare":{let e;return a[2]!==n?(e=(0,t.jsx)(rP,{entity:n}),a[2]=n,a[3]=e):e=a[3],e}case"Player":{let e;return a[4]!==n?(e=(0,t.jsx)(rL,{entity:n}),a[4]=n,a[5]=e):e=a[5],e}case"Explosion":{let e;return a[6]!==n?(e=(0,t.jsx)(rB,{entity:n}),a[6]=n,a[7]=e):e=a[7],e}case"Tracer":{let e;return a[8]!==n?(e=(0,t.jsx)(rI,{entity:n}),a[8]=n,a[9]=e):e=a[9],e}case"Sprite":{let e;return a[10]!==n?(e=(0,t.jsx)(rA,{entity:n}),a[10]=n,a[11]=e):e=a[11],e}case"AudioEmitter":{let e;return a[12]!==n?(e=(0,t.jsx)(rR,{children:(0,t.jsx)(rE,{entity:n})}),a[12]=n,a[13]=e):e=a[13],e}case"Camera":{let e;return a[14]!==n?(e=(0,t.jsx)(tE,{entity:n}),a[14]=n,a[15]=e):e=a[15],e}case"WayPoint":{let e;return a[16]!==n?(e=(0,t.jsx)(tz,{entity:n}),a[16]=n,a[17]=e):e=a[17],e}case"TerrainBlock":{let e;return a[18]!==n.terrainData?(e=(0,t.jsx)(t3,{scene:n.terrainData}),a[18]=n.terrainData,a[19]=e):e=a[19],e}case"InteriorInstance":{let e;return a[20]!==n.interiorData?(e=(0,t.jsx)(rc,{scene:n.interiorData}),a[20]=n.interiorData,a[21]=e):e=a[21],e}case"Sky":{let e;return a[22]!==n?(e=(0,t.jsx)(rF,{entity:n}),a[22]=n,a[23]=e):e=a[23],e}case"Sun":case"MissionArea":case"None":default:return null;case"WaterBlock":{let e;return a[24]!==n?(e=(0,t.jsx)(rz,{entity:n}),a[24]=n,a[25]=e):e=a[25],e}}});function rH(e){let n,o,i,l,s,c,u,d=(0,r.c)(24),{entity:m}=e,{animationEnabled:f}=(0,b.useSettings)(),h=(0,a.useRef)(null);if(d[0]!==f||d[1]!==m.rotate?(n=()=>{if(!h.current||!m.rotate||!f)return;let e=performance.now()/1e3;h.current.rotation.y=e/3*Math.PI*2},d[0]=f,d[1]=m.rotate,d[2]=n):n=d[2],(0,tw.useFrame)(n),!m.shapeName)throw Error(`Shape entity missing shapeName: ${m.id}`);let p=m.runtimeObject,g=m.shapeType??"StaticShape",v=m.dataBlock?.toLowerCase()==="flag",x=m.teamId&&m.teamId>0?rU[m.teamId]:null,y=v&&x?`${x} Flag`:null,_="Item"===m.shapeType?"pink":m.threads?"#00ff88":"yellow",S=m.rotate?h:void 0,j=p?void 0:m;return d[3]!==y?(o=y?(0,t.jsx)(tP.FloatingLabel,{opacity:.6,children:y}):null,d[3]=y,d[4]=o):o=d[4],d[5]!==_||d[6]!==j||d[7]!==o?(i=(0,t.jsx)(tL.ShapeRenderer,{loadingColor:_,streamEntity:j,children:o}),d[5]=_,d[6]=j,d[7]=o,d[8]=i):i=d[8],d[9]!==m.barrelShapeName||d[10]!==p?(l=m.barrelShapeName&&(0,t.jsx)(tB.ShapeInfoProvider,{object:p,shapeName:m.barrelShapeName,type:"Turret",children:(0,t.jsx)("group",{position:[0,1.5,0],children:(0,t.jsx)(tL.ShapeRenderer,{})})}),d[9]=m.barrelShapeName,d[10]=p,d[11]=l):l=d[11],d[12]!==m?(s=m.weaponShape&&(0,t.jsx)(tA.ShapeErrorBoundary,{fallback:(0,t.jsx)(tL.ShapePlaceholder,{color:"red",label:m.weaponShape}),children:(0,t.jsx)(tI.DebugSuspense,{name:`Weapon:${m.id}/${m.weaponShape}`,fallback:(0,t.jsx)(tL.ShapePlaceholder,{color:"cyan",label:m.weaponShape}),children:(0,t.jsx)(rG,{entity:m})})}),d[12]=m,d[13]=s):s=d[13],d[14]!==S||d[15]!==i||d[16]!==l||d[17]!==s?(c=(0,t.jsxs)("group",{ref:S,children:[i,l,s]}),d[14]=S,d[15]=i,d[16]=l,d[17]=s,d[18]=c):c=d[18],d[19]!==m.shapeName||d[20]!==g||d[21]!==c||d[22]!==p?(u=(0,t.jsx)(tB.ShapeInfoProvider,{object:p,shapeName:m.shapeName,type:g,children:c}),d[19]=m.shapeName,d[20]=g,d[21]=c,d[22]=p,d[23]=u):u=d[23],u}var rO=e.i(60099),r$=e.i(85557),rV=e.i(29418);let rq=(0,tW.textureToUrl)("gui/hud_alliedtriangle"),rQ=(0,tW.textureToUrl)("gui/hud_enemytriangle"),rK=new tM.Vector3;function rY(e){let n,o,i,l,s,c,u=(0,r.c)(23),{entity:d}=e,m=(0,tL.useStaticShape)(d.shapeName??d.dataBlock),f=(0,tC.useThree)(rZ),h=(0,a.useRef)(null),p=(0,a.useRef)(null),g=(0,a.useRef)(null),v=(0,a.useRef)(null),x=(0,a.useRef)(null),[y,b]=(0,a.useState)(!0),_=(0,a.useRef)(null);u[0]!==m.scene?(n=new tM.Box3().setFromObject(m.scene),u[0]=m.scene,u[1]=n):n=u[1];let S=n.max.y+.1;u[2]!==d.keyframes?(o=d.keyframes??[],u[2]=d.keyframes,u[3]=o):o=u[3];let j=o;u[4]!==j?(i=j.some(rJ),u[4]=j,u[5]=i):i=u[5];let C=i;u[6]!==f||u[7]!==d.id||u[8]!==d.iffColor||u[9]!==d.playerName||u[10]!==C||u[11]!==y||u[12]!==j?(l=()=>{let e=h.current;if(!e)return;e.getWorldPosition(rK);let t=f.position.distanceTo(rK),r=f.matrixWorld.elements,a=!(-((rK.x-r[12])*r[8])+-((rK.y-r[13])*r[9])+-((rK.z-r[14])*r[10])<0)&&t<150;if(y!==a&&b(a),!a)return;let n=(0,r$.getKeyframeAtTime)(j,tD.streamPlaybackStore.getState().time),o=n?.health??1;if(n?.damageState!=null&&n.damageState>=1){p.current&&(p.current.style.opacity="0"),g.current&&(g.current.style.opacity="0");return}let i=Math.max(0,Math.min(1,1-t/150)).toString();if(p.current&&(p.current.style.opacity=i),g.current&&(g.current.style.opacity=i),_.current){let e=d.playerName??d.id;_.current.textContent!==e&&(_.current.textContent=e)}if(x.current&&d.iffColor){let e=d.iffColor.r>d.iffColor.g?rQ:rq;x.current.getAttribute("src")!==e&&(x.current.src=e)}v.current&&C&&(v.current.style.width=`${Math.max(0,Math.min(100,100*o))}%`,v.current.style.background=d.iffColor?`rgb(${d.iffColor.r}, ${d.iffColor.g}, ${d.iffColor.b})`:"")},u[6]=f,u[7]=d.id,u[8]=d.iffColor,u[9]=d.playerName,u[10]=C,u[11]=y,u[12]=j,u[13]=l):l=u[13],(0,tw.useFrame)(l);let w=d.iffColor&&d.iffColor.r>d.iffColor.g?rQ:rq;return u[14]!==d.id||u[15]!==d.playerName||u[16]!==C||u[17]!==S||u[18]!==w||u[19]!==y?(s=y&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(rO.Html,{position:[0,S,0],center:!0,children:(0,t.jsx)("div",{ref:p,className:rV.default.Top,children:(0,t.jsx)("img",{ref:x,className:rV.default.IffArrow,src:w,alt:""})})}),(0,t.jsx)(rO.Html,{position:[0,-.2,0],center:!0,children:(0,t.jsxs)("div",{ref:g,className:rV.default.Bottom,children:[(0,t.jsx)("div",{ref:_,className:rV.default.Name,children:d.playerName??d.id}),C&&(0,t.jsx)("div",{className:rV.default.HealthBar,children:(0,t.jsx)("div",{ref:v,className:rV.default.HealthFill})})]})})]}),u[14]=d.id,u[15]=d.playerName,u[16]=C,u[17]=S,u[18]=w,u[19]=y,u[20]=s):s=u[20],u[21]!==s?(c=(0,t.jsx)("group",{ref:h,children:s}),u[21]=s,u[22]=c):c=u[22],c}function rJ(e){return null!=e.health}function rZ(e){return e.camera}var rX=e.i(78779);let r0=(0,tW.textureToUrl)("commander/MiniIcons/com_flag_grey"),r1=new tM.Vector3;function r2(e){let n,o,i,l,s,c=(0,r.c)(9),{entity:u}=e,d=(0,a.useRef)(null),m=(0,a.useRef)(null),f=(0,a.useRef)(null),h=(0,tC.useThree)(r3);c[0]!==h||c[1]!==u.iffColor?(n=()=>{if(m.current&&u.iffColor){let{r:e,g:t,b:r}=u.iffColor;m.current.style.backgroundColor=`rgb(${e},${t},${r})`}if(f.current&&d.current){d.current.getWorldPosition(r1);let e=h.position.distanceTo(r1);f.current.textContent=e.toFixed(1)}},c[0]=h,c[1]=u.iffColor,c[2]=n):n=c[2],(0,tw.useFrame)(n);let p=u.iffColor?`rgb(${u.iffColor.r},${u.iffColor.g},${u.iffColor.b})`:"rgb(200,200,200)";c[3]===Symbol.for("react.memo_cache_sentinel")?(o=[0,1.5,0],c[3]=o):o=c[3],c[4]===Symbol.for("react.memo_cache_sentinel")?(i=(0,t.jsx)("span",{ref:f,className:rX.default.Distance}),c[4]=i):i=c[4],c[5]!==p?(l={backgroundColor:p,"--flag-icon-url":`url(${r0})`},c[5]=p,c[6]=l):l=c[6];let g=l;return c[7]!==g?(s=(0,t.jsx)("group",{ref:d,children:(0,t.jsx)(rO.Html,{position:o,center:!0,children:(0,t.jsxs)("div",{className:rX.default.Root,children:[i,(0,t.jsx)("div",{ref:m,className:rX.default.Icon,style:g})]})})}),c[7]=g,c[8]=s):s=c[8],s}function r3(e){return e.camera}function r5(){let e,a=(0,r.c)(1);return a[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("group",{ref:r4,children:(0,t.jsx)(r6,{})}),a[0]=e):e=a[0],e}function r4(e){tD.streamPlaybackStore.setState({root:e})}let r6=(0,a.memo)(function(){let e=(0,eX.useAllGameEntities)(),r=(0,a.useRef)(new Map).current,n=new Set;for(let t of e)n.add(t.id),r.set(t.id,t);for(let e of r.keys())n.has(e)||r.delete(e);return(0,t.jsx)(t.Fragment,{children:[...r.values()].map(e=>(0,t.jsx)(r8,{entity:e},e.id))})}),r8=(0,a.memo)(function(e){let a,n=(0,r.c)(7),{entity:o}=e;if((0,tR.isSceneEntity)(o)){let e,r;return n[0]!==o?(e=(0,t.jsx)(rW,{entity:o}),n[0]=o,n[1]=e):e=n[1],n[2]!==o.id||n[3]!==e?(r=(0,t.jsx)("group",{name:o.id,children:e}),n[2]=o.id,n[3]=e,n[4]=r):r=n[4],r}return"None"===o.renderType?null:(n[5]!==o?(a=(0,t.jsx)(at,{entity:o}),n[5]=o,n[6]=a):a=n[6],a)});function r7(e){let a,n=(0,r.c)(2),{entity:o}=e,i=(0,tg.useEngineSelector)(r9);return o.id===i?null:(n[0]!==o?(a=(0,t.jsx)(rY,{entity:o}),n[0]=o,n[1]=a):a=n[1],a)}function r9(e){return e.playback.streamSnapshot?.controlPlayerGhostId}function ae({entity:e}){let r=(0,a.useRef)(!1),[n,o]=(0,a.useState)(()=>((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0);return(r.current=n,(0,tw.useFrame)(()=>{let t=((("targetRenderFlags"in e?e.targetRenderFlags:void 0)??0)&2)!=0;t!==r.current&&(r.current=t,o(t))}),n)?(0,t.jsx)(r2,{entity:e}):null}function at(e){let a,n,o,i,l,s,c,u,d=(0,r.c)(39),{entity:m}=e,f=m.position,h=m.scale;e:{let e;if(!m.rotation){a=void 0;break e}d[0]!==m.rotation?(e=new tM.Quaternion(...m.rotation),d[0]=m.rotation,d[1]=e):e=d[1],a=e}let p=a,g="Player"===m.renderType;if("Shape"===m.renderType&&!m.shapeName){let e,r,a,n,o,i=m.id;return d[2]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("sphereGeometry",{args:[.3,6,4]}),d[2]=e):e=d[2],d[3]!==m.className?(r=(0,r$.entityTypeColor)(m.className),d[3]=m.className,d[4]=r):r=d[4],d[5]!==r?(a=(0,t.jsxs)("mesh",{children:[e,(0,t.jsx)("meshBasicMaterial",{color:r,wireframe:!0})]}),d[5]=r,d[6]=a):a=d[6],d[7]!==m?(n=(0,t.jsx)(ae,{entity:m}),d[7]=m,d[8]=n):n=d[8],d[9]!==m.id||d[10]!==f||d[11]!==p||d[12]!==h||d[13]!==a||d[14]!==n?(o=(0,t.jsxs)("group",{name:i,position:f,quaternion:p,scale:h,children:[a,n]}),d[9]=m.id,d[10]=f,d[11]=p,d[12]=h,d[13]=a,d[14]=n,d[15]=o):o=d[15],o}d[16]!==m.className||d[17]!==m.renderType?(n="Explosion"===m.renderType?null:(0,t.jsxs)("mesh",{children:[(0,t.jsx)("sphereGeometry",{args:[.5,8,6]}),(0,t.jsx)("meshBasicMaterial",{color:(0,r$.entityTypeColor)(m.className),wireframe:!0})]}),d[16]=m.className,d[17]=m.renderType,d[18]=n):n=d[18];let v=n;return d[19]!==m?(o=(0,t.jsx)(rW,{entity:m}),d[19]=m,d[20]=o):o=d[20],d[21]!==v||d[22]!==o?(i=(0,t.jsx)(tA.ShapeErrorBoundary,{fallback:v,children:o}),d[21]=v,d[22]=o,d[23]=i):i=d[23],d[24]!==m||d[25]!==g?(l=g&&(0,t.jsx)(r7,{entity:m}),d[24]=m,d[25]=g,d[26]=l):l=d[26],d[27]!==m?(s=(0,t.jsx)(ae,{entity:m}),d[27]=m,d[28]=s):s=d[28],d[29]!==i||d[30]!==l||d[31]!==s?(c=(0,t.jsxs)("group",{name:"model",children:[i,l,s]}),d[29]=i,d[30]=l,d[31]=s,d[32]=c):c=d[32],d[33]!==m.id||d[34]!==f||d[35]!==p||d[36]!==h||d[37]!==c?(u=(0,t.jsx)("group",{name:m.id,position:f,quaternion:p,scale:h,children:c}),d[33]=m.id,d[34]=f,d[35]=p,d[36]=h,d[37]=c,d[38]=u):u=d[38],u}var ar=e.i(51475);let aa=(0,w.createLogger)("SceneLighting");function an(){let e,n,o,i=(0,r.c)(6),l=(0,eX.useSceneSun)();if(i[0]!==l?(e=()=>{l?aa.debug("sunData: dir=(%s, %s, %s) color=(%s, %s, %s) ambient=(%s, %s, %s)",l.direction.x.toFixed(3),l.direction.y.toFixed(3),l.direction.z.toFixed(3),l.color.r.toFixed(3),l.color.g.toFixed(3),l.color.b.toFixed(3),l.ambient.r.toFixed(3),l.ambient.g.toFixed(3),l.ambient.b.toFixed(3)):aa.debug("No sunData — using fallback ambient #888")},n=[l],i[0]=l,i[1]=e,i[2]=n):(e=i[1],n=i[2]),(0,a.useEffect)(e,n),!l){let e;return i[3]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)("ambientLight",{color:"#888888",intensity:1}),i[3]=e):e=i[3],e}return i[4]!==l?(o=(0,t.jsx)(ao,{sunData:l}),i[4]=l,i[5]=o):o=i[5],o}function ao(e){let n,o,i,l,s,c,u,d,m,f,h=(0,r.c)(29),{sunData:p}=e;h[0]!==p.direction?(n=(0,tU.torqueToThree)(p.direction),h[0]=p.direction,h[1]=n):n=h[1];let[g,v,x]=n,y=Math.sqrt(g*g+v*v+x*x),b=g/y,_=v/y,S=x/y;h[2]!==b||h[3]!==_||h[4]!==S?(o=new tM.Vector3(b,_,S),h[2]=b,h[3]=_,h[4]=S,h[5]=o):o=h[5];let j=o,C=-(5e3*j.x),w=-(5e3*j.y),M=-(5e3*j.z);h[6]!==C||h[7]!==w||h[8]!==M?(i=new tM.Vector3(C,w,M),h[6]=C,h[7]=w,h[8]=M,h[9]=i):i=h[9];let N=i;h[10]!==p.color.b||h[11]!==p.color.g||h[12]!==p.color.r?(l=new tM.Color(p.color.r,p.color.g,p.color.b),h[10]=p.color.b,h[11]=p.color.g,h[12]=p.color.r,h[13]=l):l=h[13];let T=l;h[14]!==p.ambient.b||h[15]!==p.ambient.g||h[16]!==p.ambient.r?(s=new tM.Color(p.ambient.r,p.ambient.g,p.ambient.b),h[14]=p.ambient.b,h[15]=p.ambient.g,h[16]=p.ambient.r,h[17]=s):s=h[17];let k=s,F=j.y<0;return h[18]!==F?(c=()=>{t$.value=F},u=[F],h[18]=F,h[19]=c,h[20]=u):(c=h[19],u=h[20]),(0,a.useEffect)(c,u),h[21]!==T||h[22]!==N?(d=(0,t.jsx)("directionalLight",{position:N,color:T,intensity:1,castShadow:!0,"shadow-mapSize-width":8192,"shadow-mapSize-height":8192,"shadow-camera-left":-4096,"shadow-camera-right":4096,"shadow-camera-top":4096,"shadow-camera-bottom":-4096,"shadow-camera-near":100,"shadow-camera-far":12e3,"shadow-bias":-1e-5,"shadow-normalBias":.4,"shadow-radius":2}),h[21]=T,h[22]=N,h[23]=d):d=h[23],h[24]!==k?(m=(0,t.jsx)("ambientLight",{color:k,intensity:1}),h[24]=k,h[25]=m):m=h[25],h[26]!==d||h[27]!==m?(f=(0,t.jsxs)(t.Fragment,{children:[d,m]}),h[26]=d,h[27]=m,h[28]=f):f=h[28],f}function ai(){delete window.setMissionName,delete window.getMissionList,delete window.getMissionInfo,delete window.loadDemoRecording}let al=(0,i.createParser)({parse(e){let[t,r]=e.split("~"),a=r,n=(0,e0.getMissionInfo)(t).missionTypes;return r&&n.includes(r)||(a=n[0]),{missionName:t,missionType:a}},serialize({missionName:e,missionType:t}){let r=(0,e0.getMissionInfo)(e).missionTypes;return t&&1!==r.length?`${e}~${t}`:e},eq:(e,t)=>e.missionName===t.missionName&&e.missionType===t.missionType}).withDefault({missionName:"RiverDance",missionType:"CTF"});var as=e.i(75056);let ac={toneMapping:tM.NoToneMapping,outputColorSpace:tM.SRGBColorSpace};function au(e){let a,n,o=(0,r.c)(6),{children:i,renderOnDemand:l,dpr:s,onCreated:c}=e,{renderOnDemand:u}=(0,b.useDebug)(),d=void 0!==l&&l||u?"demand":"always";return o[0]===Symbol.for("react.memo_cache_sentinel")?(a={type:tM.PCFShadowMap},o[0]=a):a=o[0],o[1]!==i||o[2]!==s||o[3]!==c||o[4]!==d?(n=(0,t.jsx)(as.Canvas,{frameloop:d,dpr:s,gl:ac,shadows:a,onCreated:c,children:i}),o[1]=i,o[2]=s,o[3]=c,o[4]=d,o[5]=n):n=o[5],n}var ad=e.i(12631),am=e.i(66093),af=e.i(205);let ah=(0,a.lazy)(()=>e.A(34019).then(e=>({default:e.TouchHandler})));function ap(e){let a,n=(0,r.c)(2),{children:o}=e;return n[0]!==o?(a=(0,t.jsx)(ad.KeyboardControls,{map:af.KEYBOARD_CONTROLS,children:(0,t.jsx)(am.JoystickProvider,{children:o})}),n[0]=o,n[1]=a):a=n[1],a}function ag(){let e,n,o,i=(0,r.c)(5),l=eZ();return i[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(af.KeyboardAndMouseHandler,{}),i[0]=e):e=i[0],i[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ah,{})}):null,i[1]=l,i[2]=n):n=i[2],i[3]!==n?(o=(0,t.jsxs)(t.Fragment,{children:[e,n]}),i[3]=n,i[4]=o):o=i[4],o}let av=(0,a.lazy)(()=>e.A(553).then(e=>({default:e.TouchJoystick}))),ax=(0,a.lazy)(()=>e.A(33487).then(e=>({default:e.KeyboardOverlay})));function ay(){let e,n,o,i=(0,r.c)(7),l=eZ();return i[0]!==l?(e=l?(0,t.jsx)(av,{}):null,i[0]=l,i[1]=e):e=i[1],i[2]!==l?(n=!1===l?(0,t.jsx)(ax,{}):null,i[2]=l,i[3]=n):n=i[3],i[4]!==e||i[5]!==n?(o=(0,t.jsxs)(a.Suspense,{children:[e,n]}),i[4]=e,i[5]=n,i[6]=o):o=i[6],o}var ab=e.i(89271);function a_(e){let a,n,o,i,l,s=(0,r.c)(11),{isLoading:c,progress:u}=e,d=!c;s[0]===Symbol.for("react.memo_cache_sentinel")?(a=(0,t.jsx)("div",{className:ab.default.Spinner}),s[0]=a):a=s[0];let m=`${100*u}%`;return s[1]!==m?(n=(0,t.jsx)("div",{className:ab.default.Progress,children:(0,t.jsx)("div",{className:ab.default.ProgressBar,style:{width:m}})}),s[1]=m,s[2]=n):n=s[2],s[3]!==u?(o=Math.round(100*u),s[3]=u,s[4]=o):o=s[4],s[5]!==o?(i=(0,t.jsxs)("div",{className:ab.default.ProgressText,children:[o,"%"]}),s[5]=o,s[6]=i):i=s[6],s[7]!==d||s[8]!==n||s[9]!==i?(l=(0,t.jsxs)("div",{className:ab.default.LoadingIndicator,"data-complete":d,children:[a,n,i]}),s[7]=d,s[8]=n,s[9]=i,s[10]=l):l=s[10],l}function aS(e){let n,o=(0,r.c)(3),{children:i}=e,{debugMode:l}=(0,b.useDebug)();return o[0]!==i||o[1]!==l?(n=l?(0,t.jsx)(a.Suspense,{children:i}):null,o[0]=i,o[1]=l,o[2]=n):n=o[2],n}var aj=e.i(82156);function aC(e,t){return(0,a.lazy)(()=>t().then(t=>({default:t[e]})))}let aw=aC("StreamingController",()=>e.A(25483)),aM=aC("DemoPlaybackControls",()=>e.A(93884)),aN=aC("DebugElements",()=>e.A(88487)),aT=aC("Mission",()=>e.A(21683)),ak=aC("LiveObserver",()=>e.A(96145)),aF=aC("ChatSoundPlayer",()=>e.A(38496)),aR=aC("PlayerHUD",()=>e.A(57567)),aD=aC("MapInfoDialog",()=>e.A(59197)),aL=aC("ServerBrowser",()=>e.A(70012));function aB(){let[e,n]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("mission",al);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),[o,s]=function(){let e,t=(0,r.c)(3),[a,n]=(0,i.useQueryState)("fog",i.parseAsBoolean);return t[0]!==a||t[1]!==n?(e=[a,n],t[0]=a,t[1]=n,t[2]=e):e=t[2],e}(),c=(0,a.useCallback)(()=>{s(null)},[s]),u=(0,a.useContext)(l),{missionName:d,missionType:m}=e,[f,h]=(0,a.useState)(!1),[p,_]=(0,a.useState)(!1),[S,j]=(0,a.useState)(!1),[C,w]=(0,a.useState)(!1),[T,k]=(0,a.useState)(0),[F,R]=(0,a.useState)(!0),D=eZ(),L=(0,a.useCallback)(e=>{window.location.hash="",c(),w(!1);let t=M.liveConnectionStore.getState();t.disconnectServer(),t.disconnectRelay(),tg.engineStore.getState().setRecording(null),eX.gameEntityStore.getState().endStreaming(),n(e),D&&j(!1)},[c,n,D]);!function(e){let t,n,o=(0,r.c)(5),{onChangeMission:i}=e,{setRecording:l}=(0,N.usePlaybackActions)(),s=(0,a.useEffectEvent)(i);o[0]!==s||o[1]!==l?(t=()=>(window.setMissionName=e=>{let t=(0,e0.getMissionInfo)(e).missionTypes;s({missionName:e,missionType:t[0]})},window.getMissionList=e0.getMissionList,window.getMissionInfo=e0.getMissionInfo,window.loadDemoRecording=l,ai),o[0]=s,o[1]=l,o[2]=t):t=o[2],o[3]!==l?(n=[l],o[3]=l,o[4]=n):n=o[4],(0,a.useEffect)(t,n)}({onChangeMission:L});let B=(0,N.useRecording)(),I=(0,eX.useDataSource)(),A="demo"===I||"live"===I,P=(0,M.useLiveSelector)(e=>null!=e.adapter),E=(0,eX.useMissionName)(),z=(0,eX.useMissionType)();(0,a.useEffect)(()=>{if(A&&E)try{let e=(0,e0.getMissionInfo)(E),t=z&&e.missionTypes.includes(z)?z:void 0;n({missionName:E,missionType:t})}catch{n(null)}},[A,E,z,n]),(0,a.useEffect)(()=>{B&&w(!1)},[B]);let G=(0,M.useLiveSelector)(e=>e.gameStatus);(0,a.useEffect)(()=>{"connected"===G&&D&&j(!1)},[G,D]),(0,a.useEffect)(()=>{B&&D&&j(!1)},[D,B]);let U=T<1;(0,a.useEffect)(()=>{if(U)R(!0);else{let e=setTimeout(()=>R(!1),500);return()=>clearTimeout(e)}},[U]);let W=(0,a.useCallback)((e,t=0)=>{k(t)},[]),H=(0,a.useRef)(null),O=(0,a.useRef)(null);return(0,t.jsx)("main",{className:aj.default.Frame,children:(0,t.jsx)(N.RecordingProvider,{children:(0,t.jsxs)(b.SettingsProvider,{fogEnabledOverride:o,onClearFogEnabledOverride:c,children:[(0,t.jsxs)("header",{className:aj.default.Toolbar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:[(0,t.jsx)("button",{type:"button",className:aj.default.ToggleSidebarButton,"data-orientation":"top","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(x,{}):(0,t.jsx)(y,{})}),(0,t.jsx)("button",{type:"button",className:aj.default.ToggleSidebarButton,"data-orientation":"left","aria-label":S?"Close sidebar":"Open sidebar",title:S?"Close sidebar":"Open sidebar",onClick:e=>{(0,a.startTransition)(()=>j(e=>!e))},children:S?(0,t.jsx)(g,{}):(0,t.jsx)(v,{})}),(0,t.jsx)(a.Activity,{mode:A&&!C?"visible":"hidden",children:(0,t.jsx)(ty,{})}),(0,t.jsxs)(a.Activity,{mode:!A||C?"visible":"hidden",children:[(0,t.jsx)(tp,{value:C?"":d,missionType:C?"":m,onChange:L,autoFocus:C}),C&&(0,t.jsx)("button",{type:"button",className:aj.default.CancelButton,onClick:()=>{w(!1)},children:"Cancel"})]})]}),S?(0,t.jsx)("div",{className:aj.default.Backdrop}):null,(0,t.jsx)(a.Activity,{mode:S?"visible":"hidden",children:(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)("div",{className:aj.default.Sidebar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),"data-open":S,children:(0,t.jsx)(e2,{missionName:d,missionType:m,onOpenMapInfo:()=>h(!0),onOpenServerBrowser:u.live?()=>_(!0):void 0,onChooseMap:A?()=>{w(!0)}:void 0,onCancelChoosingMap:()=>{w(!1)},choosingMap:C,cameraRef:H,invalidateRef:O})})})}),(0,t.jsx)(ap,{children:(0,t.jsxs)("div",{className:aj.default.Content,children:[(0,t.jsx)("div",{className:aj.default.ThreeView,children:(0,t.jsx)(au,{dpr:f||p?.25:void 0,onCreated:e=>{H.current=e.camera,O.current=e.invalidate},children:(0,t.jsx)(ar.TickProvider,{children:(0,t.jsxs)(tF.CamerasProvider,{children:[(0,t.jsx)(ag,{}),(0,t.jsxs)(tk.AudioProvider,{children:[(0,t.jsx)(an,{}),(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(r5,{})}),(0,t.jsx)(tT,{}),(0,t.jsx)(rR,{children:(0,t.jsx)(aF,{})}),(0,t.jsx)(aS,{children:(0,t.jsx)(aN,{})}),B?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aw,{recording:B})}):null,A?null:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aT,{name:d,missionType:m,onLoadingChange:W},`${d}~${m}`)}),P?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(ak,{})}):null]})]})})})}),A?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aR,{})}):null,(0,t.jsx)(ay,{}),F&&(0,t.jsx)(a_,{isLoading:U,progress:T})]})}),(0,t.jsx)("footer",{className:aj.default.PlayerBar,onKeyDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation(),onClick:e=>e.stopPropagation(),children:B?.source==="demo"?(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aM,{})}):null}),f?(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aD,{onClose:()=>h(!1),missionName:d,missionType:m??""})})}):null,p?(0,t.jsx)(a.ViewTransition,{children:(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(aL,{onClose:()=>_(!1)})})}):null]})})})}let aI=new n.QueryClient;function aA(){let e,n=(0,r.c)(1);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(a.Suspense,{children:(0,t.jsx)(s,{children:(0,t.jsx)(o.QueryClientProvider,{client:aI,children:(0,t.jsx)(aB,{})})})}),n[0]=e):e=n[0],e}e.s(["default",()=>aA],31713)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/9236f2f78e6373a1.js b/docs/_next/static/chunks/d712fc4c15db64e6.js similarity index 93% rename from docs/_next/static/chunks/9236f2f78e6373a1.js rename to docs/_next/static/chunks/d712fc4c15db64e6.js index f46182fd..96101d10 100644 --- a/docs/_next/static/chunks/9236f2f78e6373a1.js +++ b/docs/_next/static/chunks/d712fc4c15db64e6.js @@ -1 +1 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,99140,e=>{e.v({AnimationItem:"page-module__v6zvCa__AnimationItem",AnimationList:"page-module__v6zvCa__AnimationList",AnimationName:"page-module__v6zvCa__AnimationName",CanvasContainer:"page-module__v6zvCa__CanvasContainer",CheckboxField:"page-module__v6zvCa__CheckboxField",ClipName:"page-module__v6zvCa__ClipName",CyclicIcon:"page-module__v6zvCa__CyclicIcon",LoadingIndicator:"page-module__v6zvCa__LoadingIndicator",PlayButton:"page-module__v6zvCa__PlayButton",SectionLabel:"page-module__v6zvCa__SectionLabel",Sidebar:"page-module__v6zvCa__Sidebar",SidebarSection:"page-module__v6zvCa__SidebarSection",Spinner:"page-module__v6zvCa__Spinner",loadingComplete:"page-module__v6zvCa__loadingComplete",spin:"page-module__v6zvCa__spin"})},39724,e=>{"use strict";var t,n=e.i(43476),a=e.i(932),o=e.i(71645),r=e.i(75056),i=e.i(90072),s=e.i(17751),c=e.i(12598),l=e.i(31067),u=e.i(15080),m=e.i(71753),p=e.i(85413),d=Object.defineProperty,h=(e,t,n)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?d(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,n};let f=new i.Ray,b=new i.Plane,g=Math.cos(Math.PI/180*70),v=(e,t)=>(e%t+t)%t;class y extends p.EventDispatcher{constructor(e,t){super(),h(this,"object"),h(this,"domElement"),h(this,"enabled",!0),h(this,"target",new i.Vector3),h(this,"minDistance",0),h(this,"maxDistance",1/0),h(this,"minZoom",0),h(this,"maxZoom",1/0),h(this,"minPolarAngle",0),h(this,"maxPolarAngle",Math.PI),h(this,"minAzimuthAngle",-1/0),h(this,"maxAzimuthAngle",1/0),h(this,"enableDamping",!1),h(this,"dampingFactor",.05),h(this,"enableZoom",!0),h(this,"zoomSpeed",1),h(this,"enableRotate",!0),h(this,"rotateSpeed",1),h(this,"enablePan",!0),h(this,"panSpeed",1),h(this,"screenSpacePanning",!0),h(this,"keyPanSpeed",7),h(this,"zoomToCursor",!1),h(this,"autoRotate",!1),h(this,"autoRotateSpeed",2),h(this,"reverseOrbit",!1),h(this,"reverseHorizontalOrbit",!1),h(this,"reverseVerticalOrbit",!1),h(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),h(this,"mouseButtons",{LEFT:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN}),h(this,"touches",{ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN}),h(this,"target0"),h(this,"position0"),h(this,"zoom0"),h(this,"_domElementKeyEvents",null),h(this,"getPolarAngle"),h(this,"getAzimuthalAngle"),h(this,"setPolarAngle"),h(this,"setAzimuthalAngle"),h(this,"getDistance"),h(this,"getZoomScale"),h(this,"listenToKeyEvents"),h(this,"stopListenToKeyEvents"),h(this,"saveState"),h(this,"reset"),h(this,"update"),h(this,"connect"),h(this,"dispose"),h(this,"dollyIn"),h(this,"dollyOut"),h(this,"getScale"),h(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=e=>{let t=v(e,2*Math.PI),a=u.phi;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-o{let t=v(e,2*Math.PI),a=u.theta;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-on.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",ee),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ee),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(a),n.update(),c=s.NONE},this.update=(()=>{let t=new i.Vector3,o=new i.Vector3(0,1,0),r=new i.Quaternion().setFromUnitVectors(e.up,o),h=r.clone().invert(),v=new i.Vector3,y=new i.Quaternion,x=2*Math.PI;return function(){let E=n.object.position;r.setFromUnitVectors(e.up,o),h.copy(r).invert(),t.copy(E).sub(n.target),t.applyQuaternion(r),u.setFromVector3(t),n.autoRotate&&c===s.NONE&&R(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(u.theta+=m.theta*n.dampingFactor,u.phi+=m.phi*n.dampingFactor):(u.theta+=m.theta,u.phi+=m.phi);let S=n.minAzimuthAngle,j=n.maxAzimuthAngle;isFinite(S)&&isFinite(j)&&(S<-Math.PI?S+=x:S>Math.PI&&(S-=x),j<-Math.PI?j+=x:j>Math.PI&&(j-=x),S<=j?u.theta=Math.max(S,Math.min(j,u.theta)):u.theta=u.theta>(S+j)/2?Math.max(S,u.theta):Math.min(j,u.theta)),u.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,u.phi)),u.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.zoomToCursor&&A||n.object.isOrthographicCamera?u.radius=U(u.radius):u.radius=U(u.radius*p),t.setFromSpherical(u),t.applyQuaternion(h),E.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),!0===n.enableDamping?(m.theta*=1-n.dampingFactor,m.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(m.set(0,0,0),d.set(0,0,0));let C=!1;if(n.zoomToCursor&&A){let a=null;if(n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let e=t.length();a=U(e*p);let o=e-a;n.object.position.addScaledVector(w,o),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new i.Vector3(N.x,N.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),C=!0;let o=new i.Vector3(N.x,N.y,0);o.unproject(n.object),n.object.position.sub(o).add(e),n.object.updateMatrixWorld(),a=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==a&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(a).add(n.object.position):(f.origin.copy(n.object.position),f.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(f.direction))l||8*(1-y.dot(n.object.quaternion))>l)&&(n.dispatchEvent(a),v.copy(n.object.position),y.copy(n.object.quaternion),C=!1,!0)}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",et),n.domElement.addEventListener("pointerdown",G),n.domElement.addEventListener("pointercancel",$),n.domElement.addEventListener("wheel",J)},this.dispose=()=>{var e,t,a,o,r,i;n.domElement&&(n.domElement.style.touchAction="auto"),null==(e=n.domElement)||e.removeEventListener("contextmenu",et),null==(t=n.domElement)||t.removeEventListener("pointerdown",G),null==(a=n.domElement)||a.removeEventListener("pointercancel",$),null==(o=n.domElement)||o.removeEventListener("wheel",J),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",Q),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",$),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",ee)};const n=this,a={type:"change"},o={type:"start"},r={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=s.NONE;const l=1e-6,u=new i.Spherical,m=new i.Spherical;let p=1;const d=new i.Vector3,y=new i.Vector2,x=new i.Vector2,E=new i.Vector2,S=new i.Vector2,j=new i.Vector2,C=new i.Vector2,P=new i.Vector2,T=new i.Vector2,_=new i.Vector2,w=new i.Vector3,N=new i.Vector2;let A=!1;const O=[],M={};function L(){return Math.pow(.95,n.zoomSpeed)}function R(e){n.reverseOrbit||n.reverseHorizontalOrbit?m.theta+=e:m.theta-=e}function z(e){n.reverseOrbit||n.reverseVerticalOrbit?m.phi+=e:m.phi-=e}const I=(()=>{let e=new i.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),d.add(e)}})(),k=(()=>{let e=new i.Vector3;return function(t,a){!0===n.screenSpacePanning?e.setFromMatrixColumn(a,1):(e.setFromMatrixColumn(a,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),d.add(e)}})(),V=(()=>{let e=new i.Vector3;return function(t,a){let o=n.domElement;if(o&&n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let r=n.object.position;e.copy(r).sub(n.target);let i=e.length();I(2*t*(i*=Math.tan(n.object.fov/2*Math.PI/180))/o.clientHeight,n.object.matrix),k(2*a*i/o.clientHeight,n.object.matrix)}else o&&n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?(I(t*(n.object.right-n.object.left)/n.object.zoom/o.clientWidth,n.object.matrix),k(a*(n.object.top-n.object.bottom)/n.object.zoom/o.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function D(e){n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?p=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function F(e){if(!n.zoomToCursor||!n.domElement)return;A=!0;let t=n.domElement.getBoundingClientRect(),a=e.clientX-t.left,o=e.clientY-t.top,r=t.width,i=t.height;N.x=a/r*2-1,N.y=-(o/i*2)+1,w.set(N.x,N.y,1).unproject(n.object).sub(n.object.position).normalize()}function U(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function Y(e){y.set(e.clientX,e.clientY)}function H(e){S.set(e.clientX,e.clientY)}function Z(){if(1==O.length)y.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);y.set(e,t)}}function B(){if(1==O.length)S.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);S.set(e,t)}}function K(){let e=O[0].pageX-O[1].pageX,t=O[0].pageY-O[1].pageY,n=Math.sqrt(e*e+t*t);P.set(0,n)}function X(e){if(1==O.length)x.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);x.set(n,a)}E.subVectors(x,y).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x)}function W(e){if(1==O.length)j.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);j.set(n,a)}C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j)}function q(e){var t;let a=ea(e),o=e.pageX-a.x,r=e.pageY-a.y,i=Math.sqrt(o*o+r*r);T.set(0,i),_.set(0,Math.pow(T.y/P.y,n.zoomSpeed)),t=_.y,D(p/t),P.copy(T)}function G(e){var t,a,r;!1!==n.enabled&&(0===O.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",Q),null==(a=n.domElement)||a.ownerDocument.addEventListener("pointerup",$)),r=e,O.push(r),"touch"===e.pointerType?function(e){switch(en(e),O.length){case 1:switch(n.touches.ONE){case i.TOUCH.ROTATE:if(!1===n.enableRotate)return;Z(),c=s.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(!1===n.enablePan)return;B(),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(n.touches.TWO){case i.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&K(),n.enablePan&&B(),c=s.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&K(),n.enableRotate&&Z(),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case i.MOUSE.DOLLY:if(!1===n.enableZoom)return;F(e),P.set(e.clientX,e.clientY),c=s.DOLLY;break;case i.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;H(e),c=s.PAN}else{if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}break;case i.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}else{if(!1===n.enablePan)return;H(e),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e))}function Q(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(en(e),c){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;X(e),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;W(e),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&q(e),n.enablePan&&W(e),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&q(e),n.enableRotate&&X(e),n.update();break;default:c=s.NONE}}(e):function(e){if(!1!==n.enabled)switch(c){case s.ROTATE:let t;if(!1===n.enableRotate)return;x.set(e.clientX,e.clientY),E.subVectors(x,y).multiplyScalar(n.rotateSpeed),(t=n.domElement)&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x),n.update();break;case s.DOLLY:var a,o;if(!1===n.enableZoom)return;(T.set(e.clientX,e.clientY),_.subVectors(T,P),_.y>0)?(a=L(),D(p/a)):_.y<0&&(o=L(),D(p*o)),P.copy(T),n.update();break;case s.PAN:if(!1===n.enablePan)return;j.set(e.clientX,e.clientY),C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j),n.update()}}(e))}function $(e){var t,a,o;(function(e){delete M[e.pointerId];for(let t=0;t0&&(a=L(),D(p/a)),n.update(),n.dispatchEvent(r)}}function ee(e){if(!1!==n.enabled&&!1!==n.enablePan){let t=!1;switch(e.code){case n.keys.UP:V(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}}function et(e){!1!==n.enabled&&e.preventDefault()}function en(e){let t=M[e.pointerId];void 0===t&&(t=new i.Vector2,M[e.pointerId]=t),t.set(e.pageX,e.pageY)}function ea(e){return M[(e.pointerId===O[0].pointerId?O[1]:O[0]).pointerId]}this.dollyIn=(e=L())=>{D(p*e),n.update()},this.dollyOut=(e=L())=>{D(p/e),n.update()},this.getScale=()=>p,this.setScale=e=>{D(e),n.update()},this.getZoomScale=()=>L(),void 0!==t&&this.connect(t),this.update()}}let x=o.forwardRef(({makeDefault:e,camera:t,regress:n,domElement:a,enableDamping:r=!0,keyEvents:i=!1,onChange:s,onStart:c,onEnd:p,...d},h)=>{let f=(0,u.useThree)(e=>e.invalidate),b=(0,u.useThree)(e=>e.camera),g=(0,u.useThree)(e=>e.gl),v=(0,u.useThree)(e=>e.events),x=(0,u.useThree)(e=>e.setEvents),E=(0,u.useThree)(e=>e.set),S=(0,u.useThree)(e=>e.get),j=(0,u.useThree)(e=>e.performance),C=t||b,P=a||v.connected||g.domElement,T=o.useMemo(()=>new y(C),[C]);return(0,m.useFrame)(()=>{T.enabled&&T.update()},-1),o.useEffect(()=>(i&&T.connect(!0===i?P:i),T.connect(P),()=>void T.dispose()),[i,P,n,T,f]),o.useEffect(()=>{let e=e=>{f(),n&&j.regress(),s&&s(e)},t=e=>{c&&c(e)},a=e=>{p&&p(e)};return T.addEventListener("change",e),T.addEventListener("start",t),T.addEventListener("end",a),()=>{T.removeEventListener("start",t),T.removeEventListener("end",a),T.removeEventListener("change",e)}},[s,c,p,T,f,x]),o.useEffect(()=>{if(e){let e=S().controls;return E({controls:T}),()=>E({controls:e})}},[e,T]),o.createElement("primitive",(0,l.default)({ref:h,object:T,enableDamping:r},d))}),E=o.forwardRef(function({children:e,object:t,disable:n,disableX:a,disableY:r,disableZ:s,left:c,right:u,top:m,bottom:p,front:d,back:h,onCentered:f,precise:b=!0,cacheKey:g=0,...v},y){let x=o.useRef(null),E=o.useRef(null),S=o.useRef(null),[j]=o.useState(()=>new i.Box3),[C]=o.useState(()=>new i.Vector3),[P]=o.useState(()=>new i.Sphere);return o.useLayoutEffect(()=>{E.current.matrixWorld.identity(),j.setFromObject(null!=t?t:S.current,b);let e=j.max.x-j.min.x,o=j.max.y-j.min.y,i=j.max.z-j.min.z;j.getCenter(C),j.getBoundingSphere(P);let l=m?o/2:p?-o/2:0,g=c?-e/2:u?e/2:0,v=d?i/2:h?-i/2:0;E.current.position.set(n||a?0:-C.x+g,n||r?0:-C.y+l,n||s?0:-C.z+v),null==f||f({parent:x.current.parent,container:x.current,width:e,height:o,depth:i,boundingBox:j,boundingSphere:P,center:C,verticalAlignment:l,horizontalAlignment:g,depthAlignment:v})},[g,f,m,c,d,n,a,r,s,t,b,u,p,h,j,C,P]),o.useImperativeHandle(y,()=>x.current,[]),o.createElement("group",(0,l.default)({ref:x},v),o.createElement("group",{ref:E},o.createElement("group",{ref:S},e)))});var S=((t=S||{})[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t);let j=e=>1-Math.exp(-5*e)+.007*e,C=o.createContext(null);function P({children:e,maxDuration:t=1,margin:n=1.2,observe:a,fit:r,clip:s,interpolateFunc:c=j,onFit:l}){let p=o.useRef(null),{camera:d,size:h,invalidate:f}=(0,u.useThree)(),b=(0,u.useThree)(e=>e.controls),g=o.useRef(l);g.current=l;let v=o.useRef({camPos:new i.Vector3,camRot:new i.Quaternion,camZoom:1}),y=o.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),x=o.useRef(S.NONE),E=o.useRef(0),[P]=o.useState(()=>new i.Box3),T=o.useMemo(()=>{function e(){let e=P.getSize(new i.Vector3),t=P.getCenter(new i.Vector3),a=Math.max(e.x,e.y,e.z),o=d&&d.isOrthographicCamera?4*a:a/(2*Math.atan(Math.PI*d.fov/360)),r=d&&d.isOrthographicCamera?4*a:o/d.aspect;return{box:P,size:e,center:t,distance:n*Math.max(o,r)}}return{getSize:e,refresh(e){if(e&&e.isBox3)P.copy(e);else{let t=e||p.current;if(!t)return this;t.updateWorldMatrix(!0,!0),P.setFromObject(t)}if(P.isEmpty()){let e=d.position.length()||10;P.setFromCenterAndSize(new i.Vector3,new i.Vector3(e,e,e))}return v.current.camPos.copy(d.position),v.current.camRot.copy(d.quaternion),d&&d.isOrthographicCamera&&(v.current.camZoom=d.zoom),y.current.camPos=void 0,y.current.camRot=void 0,y.current.camZoom=void 0,y.current.camUp=void 0,y.current.target=void 0,this},reset(){let{center:t,distance:n}=e(),a=d.position.clone().sub(t).normalize();y.current.camPos=t.clone().addScaledVector(a,n),y.current.target=t.clone();let o=new i.Matrix4().lookAt(y.current.camPos,y.current.target,d.up);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(o),x.current=S.START,E.current=0,this},moveTo(e){return y.current.camPos=Array.isArray(e)?new i.Vector3(...e):e.clone(),x.current=S.START,E.current=0,this},lookAt({target:e,up:t}){y.current.target=Array.isArray(e)?new i.Vector3(...e):e.clone(),t?y.current.camUp=Array.isArray(t)?new i.Vector3(...t):t.clone():y.current.camUp=d.up.clone();let n=new i.Matrix4().lookAt(y.current.camPos||d.position,y.current.target,y.current.camUp);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(n),x.current=S.START,E.current=0,this},to({position:e,target:t}){return this.moveTo(e).lookAt({target:t})},fit(){if(!(d&&d.isOrthographicCamera))return this.reset();let e=0,t=0,a=[new i.Vector3(P.min.x,P.min.y,P.min.z),new i.Vector3(P.min.x,P.max.y,P.min.z),new i.Vector3(P.min.x,P.min.y,P.max.z),new i.Vector3(P.min.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.min.z),new i.Vector3(P.max.x,P.min.y,P.max.z),new i.Vector3(P.max.x,P.min.y,P.min.z)],o=y.current.camPos||d.position,r=y.current.target||(null==b?void 0:b.target),s=y.current.camUp||d.up,c=r?new i.Matrix4().lookAt(o,r,s).setPosition(o).invert():d.matrixWorldInverse;for(let n of a)n.applyMatrix4(c),e=Math.max(e,Math.abs(n.y)),t=Math.max(t,Math.abs(n.x));e*=2,t*=2;let l=(d.top-d.bottom)/e,u=(d.right-d.left)/t;return y.current.camZoom=Math.min(l,u)/n,x.current=S.START,E.current=0,g.current&&g.current(this.getSize()),this},clip(){let{distance:t}=e();return d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),b&&(b.maxDistance=10*t,b.update()),f(),this}}},[P,d,b,n,f]);o.useLayoutEffect(()=>{if(b){let e=()=>{if(b&&y.current.target&&x.current!==S.NONE){let e=new i.Vector3().setFromMatrixColumn(d.matrix,2),t=v.current.camPos.distanceTo(b.target),n=(y.current.camPos||v.current.camPos).distanceTo(y.current.target),a=(1-E.current)*t+E.current*n;b.target.copy(d.position).addScaledVector(e,-a),b.update()}x.current=S.NONE};return b.addEventListener("start",e),()=>b.removeEventListener("start",e)}},[b]);let _=o.useRef(0);return o.useLayoutEffect(()=>{(a||0==_.current++)&&(T.refresh(),r&&T.reset().fit(),s&&T.clip())},[h,s,r,a,d,b]),(0,m.useFrame)((e,n)=>{if(x.current===S.START)x.current=S.ACTIVE,f();else if(x.current===S.ACTIVE){if(E.current+=n/t,E.current>=1)y.current.camPos&&d.position.copy(y.current.camPos),y.current.camRot&&d.quaternion.copy(y.current.camRot),y.current.camUp&&d.up.copy(y.current.camUp),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix(),b&&y.current.target&&(b.target.copy(y.current.target),b.update()),x.current=S.NONE;else{let e=c(E.current);y.current.camPos&&d.position.lerpVectors(v.current.camPos,y.current.camPos,e),y.current.camRot&&d.quaternion.slerpQuaternions(v.current.camRot,y.current.camRot,e),y.current.camUp&&d.up.set(0,1,0).applyQuaternion(d.quaternion),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=(1-e)*v.current.camZoom+e*y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix()}f()}}),o.createElement("group",{ref:p},o.createElement(C.Provider,{value:T},e))}var T=e.i(79123),_=e.i(91907),w=e.i(25947),N=e.i(86855),A=e.i(51475),O=e.i(11889),M=e.i(56373),L=e.i(86447),R=e.i(1559),z=e.i(78440),I=e.i(59129),k=e.i(25998),V=e.i(18364),D=e.i(70238),F=e.i(91996),U=e.i(29402),Y=e.i(97442);let H={"shapes.vl2":"Shapes","TR2final105-client.vl2":"Team Rabbit 2"},Z=(0,F.getResourceList)().filter(e=>e.startsWith("shapes/")&&e.endsWith(".dts")).map(e=>{let[t,n]=(0,F.getSourceAndPath)(e),a=n.split("/").pop()??n,o=H[t]??(t||"Loose");return{resourceKey:e,displayName:a,shapeName:a,sourcePath:t,groupName:o}}),B=new Map(Z.map(e=>[e.shapeName,e])),K=function(e){let t=new Map;for(let n of e){let e=t.get(n.groupName)??[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,n)=>{t.set(n,(0,U.default)(e,[e=>e.displayName.toLowerCase()],["asc"]))}),(0,U.default)(Array.from(t.entries()),[([e])=>+("Shapes"!==e),([e])=>e.toLowerCase()],["asc","asc"])}(Z),X="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function W(e){let t,r,i,s,c,l,u,m,p,d,h,f,b,g,v,y,x,E=(0,a.c)(42),{value:S,onChange:j}=e,[C,P]=(0,o.useState)(""),T=(0,o.useRef)(null);E[0]!==j?(t=e=>{e&&(j(e),T.current?.blur())},E[0]=j,E[1]=t):t=E[1],E[2]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{(0,o.startTransition)(()=>P(e))},E[2]=r):r=E[2],E[3]!==t||E[4]!==S?(i={placement:"bottom-start",resetValueOnHide:!0,selectedValue:S,setSelectedValue:t,setValue:r},E[3]=t,E[4]=S,E[5]=i):i=E[5];let _=(0,V.useComboboxStore)(i);E[6]!==_?(s=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),_.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},c=[_],E[6]=_,E[7]=s,E[8]=c):(s=E[7],c=E[8]),(0,o.useEffect)(s,c),E[9]!==S?(l=B.get(S),E[9]=S,E[10]=l):l=E[10];let w=l;e:{let e,t;if(!C){let e;E[11]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:K},E[11]=e):e=E[11],u=e;break e}E[12]!==C?(e=(0,D.matchSorter)(Z,C,{keys:["displayName","groupName"]}),E[12]=C,E[13]=e):e=E[13];let n=e;E[14]!==n?(t={type:"flat",shapes:n},E[14]=n,E[15]=t):t=E[15],u=t}let N=u,A=w?.displayName??S,M="flat"===N.type?0===N.shapes.length:0===N.groups.length;return E[16]!==_?(m=()=>{try{document.exitPointerLock()}catch{}_.show()},p=e=>{"Escape"!==e.key||_.getState().open||T.current?.blur()},E[16]=_,E[17]=m,E[18]=p):(m=E[17],p=E[18]),E[19]!==A||E[20]!==m||E[21]!==p?(d=(0,n.jsx)(O.Combobox,{ref:T,autoSelect:!0,placeholder:A,className:Y.default.Input,onFocus:m,onKeyDown:p}),E[19]=A,E[20]=m,E[21]=p,E[22]=d):d=E[22],E[23]!==A?(h=(0,n.jsx)("div",{className:Y.default.SelectedValue,children:(0,n.jsx)("span",{className:Y.default.SelectedName,children:A})}),E[23]=A,E[24]=h):h=E[24],E[25]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)("kbd",{className:Y.default.Shortcut,children:X?"⌘K":"^K"}),E[25]=f):f=E[25],E[26]!==d||E[27]!==h?(b=(0,n.jsxs)("div",{className:Y.default.InputWrapper,children:[d,h,f]}),E[26]=d,E[27]=h,E[28]=b):b=E[28],E[29]!==N.groups||E[30]!==N.shapes||E[31]!==N.type?(g="flat"===N.type?N.shapes.map(q):N.groups.map(e=>{let[t,a]=e;return(0,n.jsxs)(I.ComboboxGroup,{className:Y.default.Group,children:[(0,n.jsx)(k.ComboboxGroupLabel,{className:Y.default.GroupLabel,children:t}),a.map(q)]},t)}),E[29]=N.groups,E[30]=N.shapes,E[31]=N.type,E[32]=g):g=E[32],E[33]!==M?(v=M&&(0,n.jsx)("div",{className:Y.default.NoResults,children:"No shapes found"}),E[33]=M,E[34]=v):v=E[34],E[35]!==g||E[36]!==v?(y=(0,n.jsx)(R.ComboboxPopover,{portal:!0,gutter:4,autoFocusOnHide:!1,className:Y.default.Popover,children:(0,n.jsxs)(L.ComboboxList,{className:Y.default.List,children:[g,v]})}),E[35]=g,E[36]=v,E[37]=y):y=E[37],E[38]!==_||E[39]!==b||E[40]!==y?(x=(0,n.jsxs)(z.ComboboxProvider,{store:_,children:[b,y]}),E[38]=_,E[39]=b,E[40]=y,E[41]=x):x=E[41],x}function q(e){return(0,n.jsx)(M.ComboboxItem,{value:e.shapeName,className:Y.default.Item,focusOnHover:!0,children:(0,n.jsx)("span",{className:Y.default.ItemName,children:e.displayName})},e.shapeName)}var G=e.i(58647),Q=e.i(38847),$=e.i(32424),J=e.i(54970),ee=e.i(86608),et=e.i(33870),en=e.i(99140),ea=e.i(7368);let eo=new s.QueryClient,er=new i.Color(.1,.1,.1),ei={toneMapping:i.NoToneMapping,outputColorSpace:i.SRGBColorSpace},es=(0,$.createScriptLoader)(),ec=(0,et.createScriptCache)(),el={findFiles:e=>{let t=(0,J.default)(e,{nocase:!0});return(0,F.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,F.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,F.getResourceMap)()[(0,F.getResourceKey)(e)]},eu=(0,Q.createParser)({parse:e=>e,serialize:e=>e,eq:(e,t)=>e===t}).withDefault("deploy_inventory.dts");function em(e){"batch.flushed"===e.type&&G.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function ep(e){e instanceof Error&&"AbortError"===e.name||console.error("Shape runtime failed:",e)}function ed(){let e,t,n=(0,a.c)(3),r=o.useContext(C);return n[0]!==r?(e=()=>{r.refresh().fit()},t=[r],n[0]=r,n[1]=e,n[2]=t):(e=n[1],t=n[2]),(0,o.useEffect)(e,t),null}function eh(e){let t,n,r,i,s=(0,a.c)(11),{shapeName:c,onAnimations:l}=e,u=(0,_.useStaticShape)(c);s[0]!==c?(t=e=>e.runtime.sequenceAliases.get(c.toLowerCase()),s[0]=c,s[1]=t):t=s[1];let m=(0,G.useEngineSelector)(t);if(s[2]!==u.animations||s[3]!==u.scene||s[4]!==m){let e,t=new Map;if(u.scene.traverse(e=>{let n=e.userData;n?.vis_sequence&&null!=n.vis_cyclic&&t.set(n.vis_sequence.toLowerCase(),!!n.vis_cyclic)}),m)for(let[t,n]of(e=new Map,m))e.set(n,t);n=u.animations.map(n=>({name:n.name,alias:e?.get(n.name.toLowerCase())??null,cyclic:t.get(n.name.toLowerCase())??null})),s[2]=u.animations,s[3]=u.scene,s[4]=m,s[5]=n}else n=s[5];let p=n,d=(0,o.useEffectEvent)(l);return s[6]!==p||s[7]!==d?(r=()=>{d(p)},s[6]=p,s[7]=d,s[8]=r):r=s[8],s[9]!==p?(i=[p],s[9]=p,s[10]=i):i=s[10],(0,o.useEffect)(r,i),null}function ef(e){let t,n,r=(0,a.c)(5),{object:i,runtime:s,animation:c}=e;return r[0]!==c||r[1]!==i||r[2]!==s?(t=()=>{if(s&&c){for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e);return s.$.nsCall("ShapeBase","playThread",i,0,c),()=>{for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e)}}},n=[s,i,c],r[0]=c,r[1]=i,r[2]=s,r[3]=t,r[4]=n):(t=r[3],n=r[4]),(0,o.useEffect)(t,n),null}function eb(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{shapeName:m,runtime:p,onAnimations:d,selectedAnimation:h}=e;u[0]!==p||u[1]!==m?(t=function(e,t){let n;if(e){for(let a of e.state.objectsById.values())if(a.shapeFile&&String(a.shapeFile).toLowerCase()===t.toLowerCase()){n=a._name;break}}return{_id:99999,_class:"StaticShapeData",_className:"StaticShape",...n?{datablock:n}:{}}}(p,m),u[0]=p,u[1]=m,u[2]=t):t=u[2];let f=t;return u[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(_.ShapeRenderer,{}),u[3]=o):o=u[3],u[4]!==d||u[5]!==m?(r=(0,n.jsx)(eh,{shapeName:m,onAnimations:d}),u[4]=d,u[5]=m,u[6]=r):r=u[6],u[7]!==f||u[8]!==p||u[9]!==h?(i=(0,n.jsx)(ef,{object:f,runtime:p,animation:h}),u[7]=f,u[8]=p,u[9]=h,u[10]=i):i=u[10],u[11]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(ed,{}),u[11]=s):s=u[11],u[12]!==r||u[13]!==i?(c=(0,n.jsxs)(E,{children:[o,r,i,s]}),u[12]=r,u[13]=i,u[14]=c):c=u[14],u[15]!==f||u[16]!==m||u[17]!==c?(l=(0,n.jsx)(w.ShapeInfoProvider,{type:"StaticShape",object:f,shapeName:m,children:c}),u[15]=f,u[16]=m,u[17]=c,u[18]=l):l=u[18],l}function eg(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("directionalLight",{position:[50,80,30],intensity:1.2})]}),t[0]=e):e=t[0],e}function ev(){let e,t,s,l,u,m,p,d,h,f,b,g,v,y,E,S,j=(0,a.c)(31),[C,_]=(0,Q.useQueryState)("shape",eu),w=function(){let e,t,n=(0,a.c)(2),[r,i]=(0,o.useState)(null);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=new AbortController,t=!1,{runtime:n,ready:a}=(0,ee.runServer)({missionName:"SC_Normal",missionType:"CTF",runtimeOptions:{loadScript:es,fileSystem:el,cache:ec,signal:e.signal,ignoreScripts:ea.ignoreScripts}});a.then(()=>{t||e.signal.aborted||(G.engineStore.getState().setRuntime(n),i(n))}).catch(ep),G.engineStore.getState().setRuntime(n);let o=n.subscribeRuntimeEvents(em);return()=>{t=!0,e.abort(),o(),G.engineStore.getState().clearRuntime(),n.destroy()}},t=[],n[0]=e,n[1]=t):(e=n[0],t=n[1]),(0,o.useEffect)(e,t),r}();j[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],j[0]=e):e=j[0];let[O,M]=(0,o.useState)(e),[L,R]=(0,o.useState)("");j[1]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{M(e),R("")},j[1]=t):t=j[1];let z=t,[I,k]=(0,o.useState)(!0);return j[2]!==w?(s=()=>{if(w){let e=setTimeout(()=>k(!1),300);return()=>clearTimeout(e)}},l=[w],j[2]=w,j[3]=s,j[4]=l):(s=j[3],l=j[4]),(0,o.useEffect)(s,l),j[5]!==w||j[6]!==I?(u=I&&(0,n.jsx)("div",{className:en.default.LoadingIndicator,"data-complete":!!w,children:(0,n.jsx)("div",{className:en.default.Spinner})}),j[5]=w,j[6]=I,j[7]=u):u=j[7],j[8]===Symbol.for("react.memo_cache_sentinel")?(m={type:i.PCFShadowMap},p={background:er},d={position:[5,3,5],fov:90},j[8]=m,j[9]=p,j[10]=d):(m=j[8],p=j[9],d=j[10]),j[11]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(eg,{}),j[11]=h):h=j[11],j[12]!==C||j[13]!==w||j[14]!==L?(f=(0,n.jsx)(P,{fit:!0,clip:!0,observe:!0,margin:1.5,children:(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(eb,{shapeName:C,runtime:w,onAnimations:z,selectedAnimation:L},C)})}),j[12]=C,j[13]=w,j[14]=L,j[15]=f):f=j[15],j[16]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsx)(N.DebugElements,{}),g=(0,n.jsx)(x,{makeDefault:!0}),j[16]=b,j[17]=g):(b=j[16],g=j[17]),j[18]!==f?(v=(0,n.jsx)(r.Canvas,{frameloop:"always",gl:ei,shadows:m,scene:p,camera:d,children:(0,n.jsxs)(A.TickProvider,{children:[h,f,b,g]})}),j[18]=f,j[19]=v):v=j[19],j[20]!==v||j[21]!==u?(y=(0,n.jsxs)("div",{className:en.default.CanvasContainer,children:[u,v]}),j[20]=v,j[21]=u,j[22]=y):y=j[22],j[23]!==O||j[24]!==C||j[25]!==L||j[26]!==_?(E=(0,n.jsx)(ex,{currentShape:C,onChangeShape:_,animations:O,selectedAnimation:L,onChangeAnimation:R}),j[23]=O,j[24]=C,j[25]=L,j[26]=_,j[27]=E):E=j[27],j[28]!==y||j[29]!==E?(S=(0,n.jsx)(c.QueryClientProvider,{client:eo,children:(0,n.jsx)("main",{children:(0,n.jsxs)(T.SettingsProvider,{onClearFogEnabledOverride:ey,children:[y,E]})})}),j[28]=y,j[29]=E,j[30]=S):S=j[30],S}function ey(){}function ex(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{currentShape:m,onChangeShape:p,animations:d,selectedAnimation:h,onChangeAnimation:f}=e,{debugMode:b,setDebugMode:g}=(0,T.useDebug)();return u[0]!==m||u[1]!==p?(t=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)(W,{value:m,onChange:p})}),u[0]=m,u[1]=p,u[2]=t):t=u[2],u[3]!==g?(o=e=>g(e.target.checked),u[3]=g,u[4]=o):o=u[4],u[5]!==b||u[6]!==o?(r=(0,n.jsx)("input",{id:"debugInput",type:"checkbox",checked:b,onChange:o}),u[5]=b,u[6]=o,u[7]=r):r=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("label",{htmlFor:"debugInput",children:"Debug"}),u[8]=i):i=u[8],u[9]!==r?(s=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsxs)("div",{className:en.default.CheckboxField,children:[r,i]})}),u[9]=r,u[10]=s):s=u[10],u[11]!==d||u[12]!==f||u[13]!==h?(c=d.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)("div",{className:en.default.SectionLabel,children:"Animations"})}),(0,n.jsx)("div",{className:en.default.AnimationList,children:d.map(e=>(0,n.jsxs)("div",{className:en.default.AnimationItem,"data-active":h===e.name,onClick:()=>f(h===e.name?"":e.name),children:[(0,n.jsx)("button",{className:en.default.PlayButton,title:`Play ${e.alias??e.name}`,children:h===e.name?"■":"▶"}),(0,n.jsx)("span",{className:en.default.AnimationName,children:e.alias??e.name}),e.alias&&(0,n.jsx)("span",{className:en.default.ClipName,title:`GLB clip: ${e.name}`,children:e.name}),!0===e.cyclic&&(0,n.jsx)("span",{className:en.default.CyclicIcon,title:"Cyclic (looping)",children:"∞"})]},e.name))})]}),u[11]=d,u[12]=f,u[13]=h,u[14]=c):c=u[14],u[15]!==t||u[16]!==s||u[17]!==c?(l=(0,n.jsxs)("div",{className:en.default.Sidebar,children:[t,s,c]}),u[15]=t,u[16]=s,u[17]=c,u[18]=l):l=u[18],l}function eE(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(ev,{})}),t[0]=e):e=t[0],e}e.s(["default",()=>eE],39724)}]); \ No newline at end of file +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,99140,e=>{e.v({AnimationItem:"page-module__v6zvCa__AnimationItem",AnimationList:"page-module__v6zvCa__AnimationList",AnimationName:"page-module__v6zvCa__AnimationName",CanvasContainer:"page-module__v6zvCa__CanvasContainer",CheckboxField:"page-module__v6zvCa__CheckboxField",ClipName:"page-module__v6zvCa__ClipName",CyclicIcon:"page-module__v6zvCa__CyclicIcon",LoadingIndicator:"page-module__v6zvCa__LoadingIndicator",PlayButton:"page-module__v6zvCa__PlayButton",SectionLabel:"page-module__v6zvCa__SectionLabel",Sidebar:"page-module__v6zvCa__Sidebar",SidebarSection:"page-module__v6zvCa__SidebarSection",Spinner:"page-module__v6zvCa__Spinner",loadingComplete:"page-module__v6zvCa__loadingComplete",spin:"page-module__v6zvCa__spin"})},39724,e=>{"use strict";var t,n=e.i(43476),a=e.i(932),o=e.i(71645),r=e.i(75056),i=e.i(90072),s=e.i(17751),c=e.i(12598),l=e.i(31067),u=e.i(15080),m=e.i(71753),p=e.i(85413),d=Object.defineProperty,h=(e,t,n)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?d(e,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[a]=n,n};let f=new i.Ray,b=new i.Plane,g=Math.cos(Math.PI/180*70),v=(e,t)=>(e%t+t)%t;class y extends p.EventDispatcher{constructor(e,t){super(),h(this,"object"),h(this,"domElement"),h(this,"enabled",!0),h(this,"target",new i.Vector3),h(this,"minDistance",0),h(this,"maxDistance",1/0),h(this,"minZoom",0),h(this,"maxZoom",1/0),h(this,"minPolarAngle",0),h(this,"maxPolarAngle",Math.PI),h(this,"minAzimuthAngle",-1/0),h(this,"maxAzimuthAngle",1/0),h(this,"enableDamping",!1),h(this,"dampingFactor",.05),h(this,"enableZoom",!0),h(this,"zoomSpeed",1),h(this,"enableRotate",!0),h(this,"rotateSpeed",1),h(this,"enablePan",!0),h(this,"panSpeed",1),h(this,"screenSpacePanning",!0),h(this,"keyPanSpeed",7),h(this,"zoomToCursor",!1),h(this,"autoRotate",!1),h(this,"autoRotateSpeed",2),h(this,"reverseOrbit",!1),h(this,"reverseHorizontalOrbit",!1),h(this,"reverseVerticalOrbit",!1),h(this,"keys",{LEFT:"ArrowLeft",UP:"ArrowUp",RIGHT:"ArrowRight",BOTTOM:"ArrowDown"}),h(this,"mouseButtons",{LEFT:i.MOUSE.ROTATE,MIDDLE:i.MOUSE.DOLLY,RIGHT:i.MOUSE.PAN}),h(this,"touches",{ONE:i.TOUCH.ROTATE,TWO:i.TOUCH.DOLLY_PAN}),h(this,"target0"),h(this,"position0"),h(this,"zoom0"),h(this,"_domElementKeyEvents",null),h(this,"getPolarAngle"),h(this,"getAzimuthalAngle"),h(this,"setPolarAngle"),h(this,"setAzimuthalAngle"),h(this,"getDistance"),h(this,"getZoomScale"),h(this,"listenToKeyEvents"),h(this,"stopListenToKeyEvents"),h(this,"saveState"),h(this,"reset"),h(this,"update"),h(this,"connect"),h(this,"dispose"),h(this,"dollyIn"),h(this,"dollyOut"),h(this,"getScale"),h(this,"setScale"),this.object=e,this.domElement=t,this.target0=this.target.clone(),this.position0=this.object.position.clone(),this.zoom0=this.object.zoom,this.getPolarAngle=()=>u.phi,this.getAzimuthalAngle=()=>u.theta,this.setPolarAngle=e=>{let t=v(e,2*Math.PI),a=u.phi;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-o{let t=v(e,2*Math.PI),a=u.theta;a<0&&(a+=2*Math.PI),t<0&&(t+=2*Math.PI);let o=Math.abs(t-a);2*Math.PI-on.object.position.distanceTo(n.target),this.listenToKeyEvents=e=>{e.addEventListener("keydown",ee),this._domElementKeyEvents=e},this.stopListenToKeyEvents=()=>{this._domElementKeyEvents.removeEventListener("keydown",ee),this._domElementKeyEvents=null},this.saveState=()=>{n.target0.copy(n.target),n.position0.copy(n.object.position),n.zoom0=n.object.zoom},this.reset=()=>{n.target.copy(n.target0),n.object.position.copy(n.position0),n.object.zoom=n.zoom0,n.object.updateProjectionMatrix(),n.dispatchEvent(a),n.update(),c=s.NONE},this.update=(()=>{let t=new i.Vector3,o=new i.Vector3(0,1,0),r=new i.Quaternion().setFromUnitVectors(e.up,o),h=r.clone().invert(),v=new i.Vector3,y=new i.Quaternion,x=2*Math.PI;return function(){let E=n.object.position;r.setFromUnitVectors(e.up,o),h.copy(r).invert(),t.copy(E).sub(n.target),t.applyQuaternion(r),u.setFromVector3(t),n.autoRotate&&c===s.NONE&&R(2*Math.PI/60/60*n.autoRotateSpeed),n.enableDamping?(u.theta+=m.theta*n.dampingFactor,u.phi+=m.phi*n.dampingFactor):(u.theta+=m.theta,u.phi+=m.phi);let S=n.minAzimuthAngle,j=n.maxAzimuthAngle;isFinite(S)&&isFinite(j)&&(S<-Math.PI?S+=x:S>Math.PI&&(S-=x),j<-Math.PI?j+=x:j>Math.PI&&(j-=x),S<=j?u.theta=Math.max(S,Math.min(j,u.theta)):u.theta=u.theta>(S+j)/2?Math.max(S,u.theta):Math.min(j,u.theta)),u.phi=Math.max(n.minPolarAngle,Math.min(n.maxPolarAngle,u.phi)),u.makeSafe(),!0===n.enableDamping?n.target.addScaledVector(d,n.dampingFactor):n.target.add(d),n.zoomToCursor&&A||n.object.isOrthographicCamera?u.radius=U(u.radius):u.radius=U(u.radius*p),t.setFromSpherical(u),t.applyQuaternion(h),E.copy(n.target).add(t),n.object.matrixAutoUpdate||n.object.updateMatrix(),n.object.lookAt(n.target),!0===n.enableDamping?(m.theta*=1-n.dampingFactor,m.phi*=1-n.dampingFactor,d.multiplyScalar(1-n.dampingFactor)):(m.set(0,0,0),d.set(0,0,0));let C=!1;if(n.zoomToCursor&&A){let a=null;if(n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let e=t.length();a=U(e*p);let o=e-a;n.object.position.addScaledVector(w,o),n.object.updateMatrixWorld()}else if(n.object.isOrthographicCamera){let e=new i.Vector3(N.x,N.y,0);e.unproject(n.object),n.object.zoom=Math.max(n.minZoom,Math.min(n.maxZoom,n.object.zoom/p)),n.object.updateProjectionMatrix(),C=!0;let o=new i.Vector3(N.x,N.y,0);o.unproject(n.object),n.object.position.sub(o).add(e),n.object.updateMatrixWorld(),a=t.length()}else console.warn("WARNING: OrbitControls.js encountered an unknown camera type - zoom to cursor disabled."),n.zoomToCursor=!1;null!==a&&(n.screenSpacePanning?n.target.set(0,0,-1).transformDirection(n.object.matrix).multiplyScalar(a).add(n.object.position):(f.origin.copy(n.object.position),f.direction.set(0,0,-1).transformDirection(n.object.matrix),Math.abs(n.object.up.dot(f.direction))l||8*(1-y.dot(n.object.quaternion))>l)&&(n.dispatchEvent(a),v.copy(n.object.position),y.copy(n.object.quaternion),C=!1,!0)}})(),this.connect=e=>{n.domElement=e,n.domElement.style.touchAction="none",n.domElement.addEventListener("contextmenu",et),n.domElement.addEventListener("pointerdown",G),n.domElement.addEventListener("pointercancel",$),n.domElement.addEventListener("wheel",J)},this.dispose=()=>{var e,t,a,o,r,i;n.domElement&&(n.domElement.style.touchAction="auto"),null==(e=n.domElement)||e.removeEventListener("contextmenu",et),null==(t=n.domElement)||t.removeEventListener("pointerdown",G),null==(a=n.domElement)||a.removeEventListener("pointercancel",$),null==(o=n.domElement)||o.removeEventListener("wheel",J),null==(r=n.domElement)||r.ownerDocument.removeEventListener("pointermove",Q),null==(i=n.domElement)||i.ownerDocument.removeEventListener("pointerup",$),null!==n._domElementKeyEvents&&n._domElementKeyEvents.removeEventListener("keydown",ee)};const n=this,a={type:"change"},o={type:"start"},r={type:"end"},s={NONE:-1,ROTATE:0,DOLLY:1,PAN:2,TOUCH_ROTATE:3,TOUCH_PAN:4,TOUCH_DOLLY_PAN:5,TOUCH_DOLLY_ROTATE:6};let c=s.NONE;const l=1e-6,u=new i.Spherical,m=new i.Spherical;let p=1;const d=new i.Vector3,y=new i.Vector2,x=new i.Vector2,E=new i.Vector2,S=new i.Vector2,j=new i.Vector2,C=new i.Vector2,P=new i.Vector2,T=new i.Vector2,_=new i.Vector2,w=new i.Vector3,N=new i.Vector2;let A=!1;const O=[],M={};function L(){return Math.pow(.95,n.zoomSpeed)}function R(e){n.reverseOrbit||n.reverseHorizontalOrbit?m.theta+=e:m.theta-=e}function z(e){n.reverseOrbit||n.reverseVerticalOrbit?m.phi+=e:m.phi-=e}const I=(()=>{let e=new i.Vector3;return function(t,n){e.setFromMatrixColumn(n,0),e.multiplyScalar(-t),d.add(e)}})(),k=(()=>{let e=new i.Vector3;return function(t,a){!0===n.screenSpacePanning?e.setFromMatrixColumn(a,1):(e.setFromMatrixColumn(a,0),e.crossVectors(n.object.up,e)),e.multiplyScalar(t),d.add(e)}})(),V=(()=>{let e=new i.Vector3;return function(t,a){let o=n.domElement;if(o&&n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera){let r=n.object.position;e.copy(r).sub(n.target);let i=e.length();I(2*t*(i*=Math.tan(n.object.fov/2*Math.PI/180))/o.clientHeight,n.object.matrix),k(2*a*i/o.clientHeight,n.object.matrix)}else o&&n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?(I(t*(n.object.right-n.object.left)/n.object.zoom/o.clientWidth,n.object.matrix),k(a*(n.object.top-n.object.bottom)/n.object.zoom/o.clientHeight,n.object.matrix)):(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - pan disabled."),n.enablePan=!1)}})();function D(e){n.object instanceof i.PerspectiveCamera&&n.object.isPerspectiveCamera||n.object instanceof i.OrthographicCamera&&n.object.isOrthographicCamera?p=e:(console.warn("WARNING: OrbitControls.js encountered an unknown camera type - dolly/zoom disabled."),n.enableZoom=!1)}function F(e){if(!n.zoomToCursor||!n.domElement)return;A=!0;let t=n.domElement.getBoundingClientRect(),a=e.clientX-t.left,o=e.clientY-t.top,r=t.width,i=t.height;N.x=a/r*2-1,N.y=-(o/i*2)+1,w.set(N.x,N.y,1).unproject(n.object).sub(n.object.position).normalize()}function U(e){return Math.max(n.minDistance,Math.min(n.maxDistance,e))}function Y(e){y.set(e.clientX,e.clientY)}function H(e){S.set(e.clientX,e.clientY)}function Z(){if(1==O.length)y.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);y.set(e,t)}}function B(){if(1==O.length)S.set(O[0].pageX,O[0].pageY);else{let e=.5*(O[0].pageX+O[1].pageX),t=.5*(O[0].pageY+O[1].pageY);S.set(e,t)}}function K(){let e=O[0].pageX-O[1].pageX,t=O[0].pageY-O[1].pageY,n=Math.sqrt(e*e+t*t);P.set(0,n)}function X(e){if(1==O.length)x.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);x.set(n,a)}E.subVectors(x,y).multiplyScalar(n.rotateSpeed);let t=n.domElement;t&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x)}function W(e){if(1==O.length)j.set(e.pageX,e.pageY);else{let t=ea(e),n=.5*(e.pageX+t.x),a=.5*(e.pageY+t.y);j.set(n,a)}C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j)}function q(e){var t;let a=ea(e),o=e.pageX-a.x,r=e.pageY-a.y,i=Math.sqrt(o*o+r*r);T.set(0,i),_.set(0,Math.pow(T.y/P.y,n.zoomSpeed)),t=_.y,D(p/t),P.copy(T)}function G(e){var t,a,r;!1!==n.enabled&&(0===O.length&&(null==(t=n.domElement)||t.ownerDocument.addEventListener("pointermove",Q),null==(a=n.domElement)||a.ownerDocument.addEventListener("pointerup",$)),r=e,O.push(r),"touch"===e.pointerType?function(e){switch(en(e),O.length){case 1:switch(n.touches.ONE){case i.TOUCH.ROTATE:if(!1===n.enableRotate)return;Z(),c=s.TOUCH_ROTATE;break;case i.TOUCH.PAN:if(!1===n.enablePan)return;B(),c=s.TOUCH_PAN;break;default:c=s.NONE}break;case 2:switch(n.touches.TWO){case i.TOUCH.DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&K(),n.enablePan&&B(),c=s.TOUCH_DOLLY_PAN;break;case i.TOUCH.DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&K(),n.enableRotate&&Z(),c=s.TOUCH_DOLLY_ROTATE;break;default:c=s.NONE}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e):function(e){let t;switch(e.button){case 0:t=n.mouseButtons.LEFT;break;case 1:t=n.mouseButtons.MIDDLE;break;case 2:t=n.mouseButtons.RIGHT;break;default:t=-1}switch(t){case i.MOUSE.DOLLY:if(!1===n.enableZoom)return;F(e),P.set(e.clientX,e.clientY),c=s.DOLLY;break;case i.MOUSE.ROTATE:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enablePan)return;H(e),c=s.PAN}else{if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}break;case i.MOUSE.PAN:if(e.ctrlKey||e.metaKey||e.shiftKey){if(!1===n.enableRotate)return;Y(e),c=s.ROTATE}else{if(!1===n.enablePan)return;H(e),c=s.PAN}break;default:c=s.NONE}c!==s.NONE&&n.dispatchEvent(o)}(e))}function Q(e){!1!==n.enabled&&("touch"===e.pointerType?function(e){switch(en(e),c){case s.TOUCH_ROTATE:if(!1===n.enableRotate)return;X(e),n.update();break;case s.TOUCH_PAN:if(!1===n.enablePan)return;W(e),n.update();break;case s.TOUCH_DOLLY_PAN:if(!1===n.enableZoom&&!1===n.enablePan)return;n.enableZoom&&q(e),n.enablePan&&W(e),n.update();break;case s.TOUCH_DOLLY_ROTATE:if(!1===n.enableZoom&&!1===n.enableRotate)return;n.enableZoom&&q(e),n.enableRotate&&X(e),n.update();break;default:c=s.NONE}}(e):function(e){if(!1!==n.enabled)switch(c){case s.ROTATE:let t;if(!1===n.enableRotate)return;x.set(e.clientX,e.clientY),E.subVectors(x,y).multiplyScalar(n.rotateSpeed),(t=n.domElement)&&(R(2*Math.PI*E.x/t.clientHeight),z(2*Math.PI*E.y/t.clientHeight)),y.copy(x),n.update();break;case s.DOLLY:var a,o;if(!1===n.enableZoom)return;(T.set(e.clientX,e.clientY),_.subVectors(T,P),_.y>0)?(a=L(),D(p/a)):_.y<0&&(o=L(),D(p*o)),P.copy(T),n.update();break;case s.PAN:if(!1===n.enablePan)return;j.set(e.clientX,e.clientY),C.subVectors(j,S).multiplyScalar(n.panSpeed),V(C.x,C.y),S.copy(j),n.update()}}(e))}function $(e){var t,a,o;(function(e){delete M[e.pointerId];for(let t=0;t0&&(a=L(),D(p/a)),n.update(),n.dispatchEvent(r)}}function ee(e){if(!1!==n.enabled&&!1!==n.enablePan){let t=!1;switch(e.code){case n.keys.UP:V(0,n.keyPanSpeed),t=!0;break;case n.keys.BOTTOM:V(0,-n.keyPanSpeed),t=!0;break;case n.keys.LEFT:V(n.keyPanSpeed,0),t=!0;break;case n.keys.RIGHT:V(-n.keyPanSpeed,0),t=!0}t&&(e.preventDefault(),n.update())}}function et(e){!1!==n.enabled&&e.preventDefault()}function en(e){let t=M[e.pointerId];void 0===t&&(t=new i.Vector2,M[e.pointerId]=t),t.set(e.pageX,e.pageY)}function ea(e){return M[(e.pointerId===O[0].pointerId?O[1]:O[0]).pointerId]}this.dollyIn=(e=L())=>{D(p*e),n.update()},this.dollyOut=(e=L())=>{D(p/e),n.update()},this.getScale=()=>p,this.setScale=e=>{D(e),n.update()},this.getZoomScale=()=>L(),void 0!==t&&this.connect(t),this.update()}}let x=o.forwardRef(({makeDefault:e,camera:t,regress:n,domElement:a,enableDamping:r=!0,keyEvents:i=!1,onChange:s,onStart:c,onEnd:p,...d},h)=>{let f=(0,u.useThree)(e=>e.invalidate),b=(0,u.useThree)(e=>e.camera),g=(0,u.useThree)(e=>e.gl),v=(0,u.useThree)(e=>e.events),x=(0,u.useThree)(e=>e.setEvents),E=(0,u.useThree)(e=>e.set),S=(0,u.useThree)(e=>e.get),j=(0,u.useThree)(e=>e.performance),C=t||b,P=a||v.connected||g.domElement,T=o.useMemo(()=>new y(C),[C]);return(0,m.useFrame)(()=>{T.enabled&&T.update()},-1),o.useEffect(()=>(i&&T.connect(!0===i?P:i),T.connect(P),()=>void T.dispose()),[i,P,n,T,f]),o.useEffect(()=>{let e=e=>{f(),n&&j.regress(),s&&s(e)},t=e=>{c&&c(e)},a=e=>{p&&p(e)};return T.addEventListener("change",e),T.addEventListener("start",t),T.addEventListener("end",a),()=>{T.removeEventListener("start",t),T.removeEventListener("end",a),T.removeEventListener("change",e)}},[s,c,p,T,f,x]),o.useEffect(()=>{if(e){let e=S().controls;return E({controls:T}),()=>E({controls:e})}},[e,T]),o.createElement("primitive",(0,l.default)({ref:h,object:T,enableDamping:r},d))}),E=o.forwardRef(function({children:e,object:t,disable:n,disableX:a,disableY:r,disableZ:s,left:c,right:u,top:m,bottom:p,front:d,back:h,onCentered:f,precise:b=!0,cacheKey:g=0,...v},y){let x=o.useRef(null),E=o.useRef(null),S=o.useRef(null),[j]=o.useState(()=>new i.Box3),[C]=o.useState(()=>new i.Vector3),[P]=o.useState(()=>new i.Sphere);return o.useLayoutEffect(()=>{E.current.matrixWorld.identity(),j.setFromObject(null!=t?t:S.current,b);let e=j.max.x-j.min.x,o=j.max.y-j.min.y,i=j.max.z-j.min.z;j.getCenter(C),j.getBoundingSphere(P);let l=m?o/2:p?-o/2:0,g=c?-e/2:u?e/2:0,v=d?i/2:h?-i/2:0;E.current.position.set(n||a?0:-C.x+g,n||r?0:-C.y+l,n||s?0:-C.z+v),null==f||f({parent:x.current.parent,container:x.current,width:e,height:o,depth:i,boundingBox:j,boundingSphere:P,center:C,verticalAlignment:l,horizontalAlignment:g,depthAlignment:v})},[g,f,m,c,d,n,a,r,s,t,b,u,p,h,j,C,P]),o.useImperativeHandle(y,()=>x.current,[]),o.createElement("group",(0,l.default)({ref:x},v),o.createElement("group",{ref:E},o.createElement("group",{ref:S},e)))});var S=((t=S||{})[t.NONE=0]="NONE",t[t.START=1]="START",t[t.ACTIVE=2]="ACTIVE",t);let j=e=>1-Math.exp(-5*e)+.007*e,C=o.createContext(null);function P({children:e,maxDuration:t=1,margin:n=1.2,observe:a,fit:r,clip:s,interpolateFunc:c=j,onFit:l}){let p=o.useRef(null),{camera:d,size:h,invalidate:f}=(0,u.useThree)(),b=(0,u.useThree)(e=>e.controls),g=o.useRef(l);g.current=l;let v=o.useRef({camPos:new i.Vector3,camRot:new i.Quaternion,camZoom:1}),y=o.useRef({camPos:void 0,camRot:void 0,camZoom:void 0,camUp:void 0,target:void 0}),x=o.useRef(S.NONE),E=o.useRef(0),[P]=o.useState(()=>new i.Box3),T=o.useMemo(()=>{function e(){let e=P.getSize(new i.Vector3),t=P.getCenter(new i.Vector3),a=Math.max(e.x,e.y,e.z),o=d&&d.isOrthographicCamera?4*a:a/(2*Math.atan(Math.PI*d.fov/360)),r=d&&d.isOrthographicCamera?4*a:o/d.aspect;return{box:P,size:e,center:t,distance:n*Math.max(o,r)}}return{getSize:e,refresh(e){if(e&&e.isBox3)P.copy(e);else{let t=e||p.current;if(!t)return this;t.updateWorldMatrix(!0,!0),P.setFromObject(t)}if(P.isEmpty()){let e=d.position.length()||10;P.setFromCenterAndSize(new i.Vector3,new i.Vector3(e,e,e))}return v.current.camPos.copy(d.position),v.current.camRot.copy(d.quaternion),d&&d.isOrthographicCamera&&(v.current.camZoom=d.zoom),y.current.camPos=void 0,y.current.camRot=void 0,y.current.camZoom=void 0,y.current.camUp=void 0,y.current.target=void 0,this},reset(){let{center:t,distance:n}=e(),a=d.position.clone().sub(t).normalize();y.current.camPos=t.clone().addScaledVector(a,n),y.current.target=t.clone();let o=new i.Matrix4().lookAt(y.current.camPos,y.current.target,d.up);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(o),x.current=S.START,E.current=0,this},moveTo(e){return y.current.camPos=Array.isArray(e)?new i.Vector3(...e):e.clone(),x.current=S.START,E.current=0,this},lookAt({target:e,up:t}){y.current.target=Array.isArray(e)?new i.Vector3(...e):e.clone(),t?y.current.camUp=Array.isArray(t)?new i.Vector3(...t):t.clone():y.current.camUp=d.up.clone();let n=new i.Matrix4().lookAt(y.current.camPos||d.position,y.current.target,y.current.camUp);return y.current.camRot=new i.Quaternion().setFromRotationMatrix(n),x.current=S.START,E.current=0,this},to({position:e,target:t}){return this.moveTo(e).lookAt({target:t})},fit(){if(!(d&&d.isOrthographicCamera))return this.reset();let e=0,t=0,a=[new i.Vector3(P.min.x,P.min.y,P.min.z),new i.Vector3(P.min.x,P.max.y,P.min.z),new i.Vector3(P.min.x,P.min.y,P.max.z),new i.Vector3(P.min.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.max.z),new i.Vector3(P.max.x,P.max.y,P.min.z),new i.Vector3(P.max.x,P.min.y,P.max.z),new i.Vector3(P.max.x,P.min.y,P.min.z)],o=y.current.camPos||d.position,r=y.current.target||(null==b?void 0:b.target),s=y.current.camUp||d.up,c=r?new i.Matrix4().lookAt(o,r,s).setPosition(o).invert():d.matrixWorldInverse;for(let n of a)n.applyMatrix4(c),e=Math.max(e,Math.abs(n.y)),t=Math.max(t,Math.abs(n.x));e*=2,t*=2;let l=(d.top-d.bottom)/e,u=(d.right-d.left)/t;return y.current.camZoom=Math.min(l,u)/n,x.current=S.START,E.current=0,g.current&&g.current(this.getSize()),this},clip(){let{distance:t}=e();return d.near=t/100,d.far=100*t,d.updateProjectionMatrix(),b&&(b.maxDistance=10*t,b.update()),f(),this}}},[P,d,b,n,f]);o.useLayoutEffect(()=>{if(b){let e=()=>{if(b&&y.current.target&&x.current!==S.NONE){let e=new i.Vector3().setFromMatrixColumn(d.matrix,2),t=v.current.camPos.distanceTo(b.target),n=(y.current.camPos||v.current.camPos).distanceTo(y.current.target),a=(1-E.current)*t+E.current*n;b.target.copy(d.position).addScaledVector(e,-a),b.update()}x.current=S.NONE};return b.addEventListener("start",e),()=>b.removeEventListener("start",e)}},[b]);let _=o.useRef(0);return o.useLayoutEffect(()=>{(a||0==_.current++)&&(T.refresh(),r&&T.reset().fit(),s&&T.clip())},[h,s,r,a,d,b]),(0,m.useFrame)((e,n)=>{if(x.current===S.START)x.current=S.ACTIVE,f();else if(x.current===S.ACTIVE){if(E.current+=n/t,E.current>=1)y.current.camPos&&d.position.copy(y.current.camPos),y.current.camRot&&d.quaternion.copy(y.current.camRot),y.current.camUp&&d.up.copy(y.current.camUp),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix(),b&&y.current.target&&(b.target.copy(y.current.target),b.update()),x.current=S.NONE;else{let e=c(E.current);y.current.camPos&&d.position.lerpVectors(v.current.camPos,y.current.camPos,e),y.current.camRot&&d.quaternion.slerpQuaternions(v.current.camRot,y.current.camRot,e),y.current.camUp&&d.up.set(0,1,0).applyQuaternion(d.quaternion),y.current.camZoom&&d&&d.isOrthographicCamera&&(d.zoom=(1-e)*v.current.camZoom+e*y.current.camZoom),d.updateMatrixWorld(),d.updateProjectionMatrix()}f()}}),o.createElement("group",{ref:p},o.createElement(C.Provider,{value:T},e))}var T=e.i(79123),_=e.i(91907),w=e.i(25947),N=e.i(86855),A=e.i(51475),O=e.i(11889),M=e.i(56373),L=e.i(86447),R=e.i(1559),z=e.i(78440),I=e.i(59129),k=e.i(25998),V=e.i(18364),D=e.i(70238),F=e.i(91996),U=e.i(29402),Y=e.i(97442);let H={"shapes.vl2":"Shapes","TR2final105-client.vl2":"Team Rabbit 2"},Z=(0,F.getResourceList)().filter(e=>e.startsWith("shapes/")&&e.endsWith(".dts")).map(e=>{let[t,n]=(0,F.getSourceAndPath)(e),a=n.split("/").pop()??n,o=H[t]??(t||"Loose");return{resourceKey:e,displayName:a,shapeName:a,sourcePath:t,groupName:o}}),B=new Map(Z.map(e=>[e.shapeName,e])),K=function(e){let t=new Map;for(let n of e){let e=t.get(n.groupName)??[];e.push(n),t.set(n.groupName,e)}return t.forEach((e,n)=>{t.set(n,(0,U.default)(e,[e=>e.displayName.toLowerCase()],["asc"]))}),(0,U.default)(Array.from(t.entries()),[([e])=>+("Shapes"!==e),([e])=>e.toLowerCase()],["asc","asc"])}(Z),X="u">typeof navigator&&/Mac|iPhone|iPad|iPod/.test(navigator.platform);function W(e){let t,r,i,s,c,l,u,m,p,d,h,f,b,g,v,y,x,E=(0,a.c)(42),{value:S,onChange:j}=e,[C,P]=(0,o.useState)(""),T=(0,o.useRef)(null);E[0]!==j?(t=e=>{e&&(j(e),T.current?.blur())},E[0]=j,E[1]=t):t=E[1],E[2]===Symbol.for("react.memo_cache_sentinel")?(r=e=>{(0,o.startTransition)(()=>P(e))},E[2]=r):r=E[2],E[3]!==t||E[4]!==S?(i={placement:"bottom-start",resetValueOnHide:!0,selectedValue:S,setSelectedValue:t,setValue:r},E[3]=t,E[4]=S,E[5]=i):i=E[5];let _=(0,V.useComboboxStore)(i);E[6]!==_?(s=()=>{let e=e=>{"k"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),T.current?.focus(),_.show())};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},c=[_],E[6]=_,E[7]=s,E[8]=c):(s=E[7],c=E[8]),(0,o.useEffect)(s,c),E[9]!==S?(l=B.get(S),E[9]=S,E[10]=l):l=E[10];let w=l;e:{let e,t;if(!C){let e;E[11]===Symbol.for("react.memo_cache_sentinel")?(e={type:"grouped",groups:K},E[11]=e):e=E[11],u=e;break e}E[12]!==C?(e=(0,D.matchSorter)(Z,C,{keys:["displayName","groupName"]}),E[12]=C,E[13]=e):e=E[13];let n=e;E[14]!==n?(t={type:"flat",shapes:n},E[14]=n,E[15]=t):t=E[15],u=t}let N=u,A=w?.displayName??S,M="flat"===N.type?0===N.shapes.length:0===N.groups.length;return E[16]!==_?(m=()=>{try{document.exitPointerLock()}catch{}_.show()},p=e=>{"Escape"!==e.key||_.getState().open||T.current?.blur()},E[16]=_,E[17]=m,E[18]=p):(m=E[17],p=E[18]),E[19]!==A||E[20]!==m||E[21]!==p?(d=(0,n.jsx)(O.Combobox,{ref:T,autoSelect:!0,placeholder:A,className:Y.default.Input,onFocus:m,onKeyDown:p}),E[19]=A,E[20]=m,E[21]=p,E[22]=d):d=E[22],E[23]!==A?(h=(0,n.jsx)("div",{className:Y.default.SelectedValue,children:(0,n.jsx)("span",{className:Y.default.SelectedName,children:A})}),E[23]=A,E[24]=h):h=E[24],E[25]===Symbol.for("react.memo_cache_sentinel")?(f=(0,n.jsx)("kbd",{className:Y.default.Shortcut,children:X?"⌘K":"^K"}),E[25]=f):f=E[25],E[26]!==d||E[27]!==h?(b=(0,n.jsxs)("div",{className:Y.default.InputWrapper,children:[d,h,f]}),E[26]=d,E[27]=h,E[28]=b):b=E[28],E[29]!==N.groups||E[30]!==N.shapes||E[31]!==N.type?(g="flat"===N.type?N.shapes.map(q):N.groups.map(e=>{let[t,a]=e;return(0,n.jsxs)(I.ComboboxGroup,{className:Y.default.Group,children:[(0,n.jsx)(k.ComboboxGroupLabel,{className:Y.default.GroupLabel,children:t}),a.map(q)]},t)}),E[29]=N.groups,E[30]=N.shapes,E[31]=N.type,E[32]=g):g=E[32],E[33]!==M?(v=M&&(0,n.jsx)("div",{className:Y.default.NoResults,children:"No shapes found"}),E[33]=M,E[34]=v):v=E[34],E[35]!==g||E[36]!==v?(y=(0,n.jsx)(R.ComboboxPopover,{portal:!0,gutter:4,autoFocusOnHide:!1,className:Y.default.Popover,children:(0,n.jsxs)(L.ComboboxList,{className:Y.default.List,children:[g,v]})}),E[35]=g,E[36]=v,E[37]=y):y=E[37],E[38]!==_||E[39]!==b||E[40]!==y?(x=(0,n.jsxs)(z.ComboboxProvider,{store:_,children:[b,y]}),E[38]=_,E[39]=b,E[40]=y,E[41]=x):x=E[41],x}function q(e){return(0,n.jsx)(M.ComboboxItem,{value:e.shapeName,className:Y.default.Item,focusOnHover:!0,children:(0,n.jsx)("span",{className:Y.default.ItemName,children:e.displayName})},e.shapeName)}var G=e.i(58647),Q=e.i(38847),$=e.i(32424),J=e.i(54970),ee=e.i(86608),et=e.i(33870),en=e.i(99140),ea=e.i(7368);let eo=new s.QueryClient,er=new i.Color(.1,.1,.1),ei={toneMapping:i.NoToneMapping,outputColorSpace:i.SRGBColorSpace},es=(0,$.createScriptLoader)(),ec=(0,et.createScriptCache)(),el={findFiles:e=>{let t=(0,J.default)(e,{nocase:!0});return(0,F.getResourceList)().filter(e=>t(e)).map(e=>{let[,t]=(0,F.getSourceAndPath)(e);return t})},isFile:e=>null!=(0,F.getResourceMap)()[(0,F.getResourceKey)(e)]},eu=(0,Q.createParser)({parse:e=>e,serialize:e=>e,eq:(e,t)=>e===t}).withDefault("deploy_inventory.dts");function em(e){"batch.flushed"===e.type&&G.engineStore.getState().applyRuntimeBatch(e.events,{tick:e.tick})}function ep(e){e instanceof Error&&"AbortError"===e.name||console.error("Shape runtime failed:",e)}function ed(){let e,t,n=(0,a.c)(3),r=o.useContext(C);return n[0]!==r?(e=()=>{r.refresh().fit()},t=[r],n[0]=r,n[1]=e,n[2]=t):(e=n[1],t=n[2]),(0,o.useEffect)(e,t),null}function eh(e){let t,n,r,i,s=(0,a.c)(11),{shapeName:c,onAnimations:l}=e,u=(0,_.useStaticShape)(c);s[0]!==c?(t=e=>e.runtime.sequenceAliases.get(c.toLowerCase()),s[0]=c,s[1]=t):t=s[1];let m=(0,G.useEngineSelector)(t);if(s[2]!==u.animations||s[3]!==u.scene||s[4]!==m){let e,t=new Map;if(u.scene.traverse(e=>{let n=e.userData;n?.vis_sequence&&null!=n.vis_cyclic&&t.set(n.vis_sequence.toLowerCase(),!!n.vis_cyclic)}),m)for(let[t,n]of(e=new Map,m))e.set(n,t);n=u.animations.map(n=>({name:n.name,alias:e?.get(n.name.toLowerCase())??null,cyclic:t.get(n.name.toLowerCase())??null})),s[2]=u.animations,s[3]=u.scene,s[4]=m,s[5]=n}else n=s[5];let p=n,d=(0,o.useEffectEvent)(l);return s[6]!==p||s[7]!==d?(r=()=>{d(p)},s[6]=p,s[7]=d,s[8]=r):r=s[8],s[9]!==p?(i=[p],s[9]=p,s[10]=i):i=s[10],(0,o.useEffect)(r,i),null}function ef(e){let t,n,r=(0,a.c)(5),{object:i,runtime:s,animation:c}=e;return r[0]!==c||r[1]!==i||r[2]!==s?(t=()=>{if(s&&c){for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e);return s.$.nsCall("ShapeBase","playThread",i,0,c),()=>{for(let e=0;e<4;e++)s.$.nsCall("ShapeBase","stopThread",i,e)}}},n=[s,i,c],r[0]=c,r[1]=i,r[2]=s,r[3]=t,r[4]=n):(t=r[3],n=r[4]),(0,o.useEffect)(t,n),null}function eb(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{shapeName:m,runtime:p,onAnimations:d,selectedAnimation:h}=e;u[0]!==p||u[1]!==m?(t=function(e,t){let n;if(e){for(let a of e.state.objectsById.values())if(a.shapeFile&&String(a.shapeFile).toLowerCase()===t.toLowerCase()){n=a._name;break}}return{_id:99999,_class:"StaticShapeData",_className:"StaticShape",...n?{datablock:n}:{}}}(p,m),u[0]=p,u[1]=m,u[2]=t):t=u[2];let f=t;return u[3]===Symbol.for("react.memo_cache_sentinel")?(o=(0,n.jsx)(_.ShapeRenderer,{}),u[3]=o):o=u[3],u[4]!==d||u[5]!==m?(r=(0,n.jsx)(eh,{shapeName:m,onAnimations:d}),u[4]=d,u[5]=m,u[6]=r):r=u[6],u[7]!==f||u[8]!==p||u[9]!==h?(i=(0,n.jsx)(ef,{object:f,runtime:p,animation:h}),u[7]=f,u[8]=p,u[9]=h,u[10]=i):i=u[10],u[11]===Symbol.for("react.memo_cache_sentinel")?(s=(0,n.jsx)(ed,{}),u[11]=s):s=u[11],u[12]!==r||u[13]!==i?(c=(0,n.jsxs)(E,{children:[o,r,i,s]}),u[12]=r,u[13]=i,u[14]=c):c=u[14],u[15]!==f||u[16]!==m||u[17]!==c?(l=(0,n.jsx)(w.ShapeInfoProvider,{type:"StaticShape",object:f,shapeName:m,children:c}),u[15]=f,u[16]=m,u[17]=c,u[18]=l):l=u[18],l}function eg(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("ambientLight",{intensity:.6}),(0,n.jsx)("directionalLight",{position:[50,80,30],intensity:1.2})]}),t[0]=e):e=t[0],e}function ev(){let e,t,s,l,u,m,p,d,h,f,b,g,v,y,E,S,j=(0,a.c)(31),[C,_]=(0,Q.useQueryState)("shape",eu),w=function(){let e,t,n=(0,a.c)(2),[r,i]=(0,o.useState)(null);return n[0]===Symbol.for("react.memo_cache_sentinel")?(e=()=>{let e=new AbortController,t=!1,{runtime:n,ready:a}=(0,ee.runServer)({missionName:"SC_Normal",missionType:"CTF",runtimeOptions:{loadScript:es,fileSystem:el,cache:ec,signal:e.signal,ignoreScripts:ea.ignoreScripts}});a.then(()=>{t||e.signal.aborted||(G.engineStore.getState().setRuntime(n),i(n))}).catch(ep),G.engineStore.getState().setRuntime(n);let o=n.subscribeRuntimeEvents(em);return()=>{t=!0,e.abort(),o(),G.engineStore.getState().clearRuntime(),n.destroy()}},t=[],n[0]=e,n[1]=t):(e=n[0],t=n[1]),(0,o.useEffect)(e,t),r}();j[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],j[0]=e):e=j[0];let[O,M]=(0,o.useState)(e),[L,R]=(0,o.useState)("");j[1]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{M(e),R("")},j[1]=t):t=j[1];let z=t,[I,k]=(0,o.useState)(!0);return j[2]!==w?(s=()=>{if(w){let e=setTimeout(()=>k(!1),300);return()=>clearTimeout(e)}},l=[w],j[2]=w,j[3]=s,j[4]=l):(s=j[3],l=j[4]),(0,o.useEffect)(s,l),j[5]!==w||j[6]!==I?(u=I&&(0,n.jsx)("div",{className:en.default.LoadingIndicator,"data-complete":!!w,children:(0,n.jsx)("div",{className:en.default.Spinner})}),j[5]=w,j[6]=I,j[7]=u):u=j[7],j[8]===Symbol.for("react.memo_cache_sentinel")?(m={type:i.PCFShadowMap},p={background:er},d={position:[5,3,5],fov:90},j[8]=m,j[9]=p,j[10]=d):(m=j[8],p=j[9],d=j[10]),j[11]===Symbol.for("react.memo_cache_sentinel")?(h=(0,n.jsx)(eg,{}),j[11]=h):h=j[11],j[12]!==C||j[13]!==w||j[14]!==L?(f=(0,n.jsx)(P,{fit:!0,clip:!0,observe:!0,margin:1.5,children:(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(eb,{shapeName:C,runtime:w,onAnimations:z,selectedAnimation:L},C)})}),j[12]=C,j[13]=w,j[14]=L,j[15]=f):f=j[15],j[16]===Symbol.for("react.memo_cache_sentinel")?(b=(0,n.jsx)(N.DebugElements,{}),g=(0,n.jsx)(x,{makeDefault:!0}),j[16]=b,j[17]=g):(b=j[16],g=j[17]),j[18]!==f?(v=(0,n.jsx)(r.Canvas,{frameloop:"always",gl:ei,shadows:m,scene:p,camera:d,children:(0,n.jsxs)(A.TickProvider,{children:[h,f,b,g]})}),j[18]=f,j[19]=v):v=j[19],j[20]!==v||j[21]!==u?(y=(0,n.jsxs)("div",{className:en.default.CanvasContainer,children:[u,v]}),j[20]=v,j[21]=u,j[22]=y):y=j[22],j[23]!==O||j[24]!==C||j[25]!==L||j[26]!==_?(E=(0,n.jsx)(ey,{currentShape:C,onChangeShape:_,animations:O,selectedAnimation:L,onChangeAnimation:R}),j[23]=O,j[24]=C,j[25]=L,j[26]=_,j[27]=E):E=j[27],j[28]!==y||j[29]!==E?(S=(0,n.jsx)(c.QueryClientProvider,{client:eo,children:(0,n.jsx)("main",{children:(0,n.jsxs)(T.SettingsProvider,{children:[y,E]})})}),j[28]=y,j[29]=E,j[30]=S):S=j[30],S}function ey(e){let t,o,r,i,s,c,l,u=(0,a.c)(19),{currentShape:m,onChangeShape:p,animations:d,selectedAnimation:h,onChangeAnimation:f}=e,{debugMode:b,setDebugMode:g}=(0,T.useDebug)();return u[0]!==m||u[1]!==p?(t=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)(W,{value:m,onChange:p})}),u[0]=m,u[1]=p,u[2]=t):t=u[2],u[3]!==g?(o=e=>g(e.target.checked),u[3]=g,u[4]=o):o=u[4],u[5]!==b||u[6]!==o?(r=(0,n.jsx)("input",{id:"debugInput",type:"checkbox",checked:b,onChange:o}),u[5]=b,u[6]=o,u[7]=r):r=u[7],u[8]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("label",{htmlFor:"debugInput",children:"Debug"}),u[8]=i):i=u[8],u[9]!==r?(s=(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsxs)("div",{className:en.default.CheckboxField,children:[r,i]})}),u[9]=r,u[10]=s):s=u[10],u[11]!==d||u[12]!==f||u[13]!==h?(c=d.length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:en.default.SidebarSection,children:(0,n.jsx)("div",{className:en.default.SectionLabel,children:"Animations"})}),(0,n.jsx)("div",{className:en.default.AnimationList,children:d.map(e=>(0,n.jsxs)("div",{className:en.default.AnimationItem,"data-active":h===e.name,onClick:()=>f(h===e.name?"":e.name),children:[(0,n.jsx)("button",{className:en.default.PlayButton,title:`Play ${e.alias??e.name}`,children:h===e.name?"■":"▶"}),(0,n.jsx)("span",{className:en.default.AnimationName,children:e.alias??e.name}),e.alias&&(0,n.jsx)("span",{className:en.default.ClipName,title:`GLB clip: ${e.name}`,children:e.name}),!0===e.cyclic&&(0,n.jsx)("span",{className:en.default.CyclicIcon,title:"Cyclic (looping)",children:"∞"})]},e.name))})]}),u[11]=d,u[12]=f,u[13]=h,u[14]=c):c=u[14],u[15]!==t||u[16]!==s||u[17]!==c?(l=(0,n.jsxs)("div",{className:en.default.Sidebar,children:[t,s,c]}),u[15]=t,u[16]=s,u[17]=c,u[18]=l):l=u[18],l}function ex(){let e,t=(0,a.c)(1);return t[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)(o.Suspense,{children:(0,n.jsx)(ev,{})}),t[0]=e):e=t[0],e}e.s(["default",()=>ex],39724)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/28c98fb093e4695f.css b/docs/_next/static/chunks/dbc95e0f1d663220.css similarity index 50% rename from docs/_next/static/chunks/28c98fb093e4695f.css rename to docs/_next/static/chunks/dbc95e0f1d663220.css index 696d899c..e6de31d4 100644 --- a/docs/_next/static/chunks/28c98fb093e4695f.css +++ b/docs/_next/static/chunks/dbc95e0f1d663220.css @@ -1,2 +1,2 @@ -.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__TopRight{align-items:flex-start;gap:6px;display:flex;position:absolute;top:10px;right:10px}.PlayerHUD-module__-E1Scq__Compass{flex-shrink:0;width:64px;height:64px;position:relative}.PlayerHUD-module__-E1Scq__CompassRing{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__CompassNSEW{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__Bars{flex-direction:column;gap:3px;padding-top:10px;display:flex}.PlayerHUD-module__-E1Scq__BarTrack{background:#00000080;border:1px solid #ffffff26;width:120px;height:10px;overflow:hidden}.PlayerHUD-module__-E1Scq__BarFillHealth{background:#2ecc40;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__BarFillEnergy{background:#0af;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__WeaponHUD{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:8px;transform:translateY(-50%)}.PlayerHUD-module__-E1Scq__WeaponSeparator{height:6px}.PlayerHUD-module__-E1Scq__TeamScores{font-family:monospace;font-size:12px;position:absolute;bottom:8px;left:8px}.PlayerHUD-module__-E1Scq__TeamRow{background:#00323ca6;gap:6px;padding:2px 8px;display:flex}.PlayerHUD-module__-E1Scq__TeamRow+.PlayerHUD-module__-E1Scq__TeamRow{border-top:1px solid #80ffc826}.PlayerHUD-module__-E1Scq__TeamNameFriendly{color:#2ecc40;min-width:60px}.PlayerHUD-module__-E1Scq__TeamNameEnemy{color:#e44;min-width:60px}.PlayerHUD-module__-E1Scq__TeamScore{color:#fff;text-align:right;min-width:24px;font-weight:700}.PlayerHUD-module__-E1Scq__TeamCount{color:#9ba;text-align:right;min-width:24px}.PlayerHUD-module__-E1Scq__PackInventoryHUD{align-items:center;gap:4px;display:flex;position:absolute;bottom:8px;right:8px}.PlayerHUD-module__-E1Scq__PackInvItem{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}.PlayerHUD-module__-E1Scq__PackInvItemActive{border-color:#80ffc880;box-shadow:0 0 6px #80ffc84d}.PlayerHUD-module__-E1Scq__PackInvItemDim{opacity:.5}.PlayerHUD-module__-E1Scq__PackInvIcon{image-rendering:pixelated;display:block}.PlayerHUD-module__-E1Scq__PackInvCount{color:#bfe;text-align:center;min-width:12px;font-family:monospace;font-size:11px}.PlayerHUD-module__-E1Scq__PackInvInfinity{image-rendering:pixelated;opacity:.8;display:block}.PlayerHUD-module__-E1Scq__Reticle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.PlayerHUD-module__-E1Scq__ReticleImage{opacity:.85;width:64px;height:64px;image-rendering:pixelated}.PlayerHUD-module__-E1Scq__ReticleDot{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080} -.ChatWindow-module__mz35vq__ChatContainer{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;width:400px;max-width:50%;display:flex;position:absolute;top:8px;left:8px}.ChatWindow-module__mz35vq__ChatWindow{-webkit-user-select:text;user-select:text;scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;min-height:4em;max-height:12.5em;padding:6px;font-size:12px;line-height:1.25;overflow-y:auto}.ChatWindow-module__mz35vq__ChatMessage{color:#2cacb5;padding:2px 0}.ChatWindow-module__mz35vq__ChatColor0{color:#2cacb5}.ChatWindow-module__mz35vq__ChatColor1{color:#04eb69}.ChatWindow-module__mz35vq__ChatColor2{color:#dbc880}.ChatWindow-module__mz35vq__ChatColor3{color:#4dfd5f}.ChatWindow-module__mz35vq__ChatColor4{color:#28e7f0}.ChatWindow-module__mz35vq__ChatColor5{color:#c8c832}.ChatWindow-module__mz35vq__ChatColor6{color:#c8c8c8}.ChatWindow-module__mz35vq__ChatColor7{color:#dcdc14}.ChatWindow-module__mz35vq__ChatColor8{color:#9696fa}.ChatWindow-module__mz35vq__ChatColor9{color:#3cdc96} +.PlayerHUD-module__-E1Scq__PlayerHUD{z-index:1;pointer-events:none;position:absolute;inset:0}.PlayerHUD-module__-E1Scq__TopRight{align-items:flex-start;gap:6px;display:flex;position:absolute;top:10px;right:10px}.PlayerHUD-module__-E1Scq__Compass{flex-shrink:0;width:64px;height:64px;position:relative}.PlayerHUD-module__-E1Scq__CompassRing{image-rendering:auto;width:100%;height:100%;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__CompassNSEW{width:100%;height:100%;image-rendering:pixelated;position:absolute;top:0;left:0}.PlayerHUD-module__-E1Scq__Bars{flex-direction:column;gap:3px;padding-top:10px;display:flex}.PlayerHUD-module__-E1Scq__BarTrack{background:#00000080;border:1px solid #ffffff26;width:120px;height:10px;overflow:hidden}.PlayerHUD-module__-E1Scq__BarFillHealth{background:#2ecc40;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__BarFillEnergy{background:#0af;height:100%;transition:width .15s ease-out}.PlayerHUD-module__-E1Scq__WeaponHUD{flex-direction:column;gap:2px;display:flex;position:absolute;top:50%;right:6px;transform:translateY(-50%)}.PlayerHUD-module__-E1Scq__WeaponSeparator{height:6px}.PlayerHUD-module__-E1Scq__TeamInfo{flex-direction:column;gap:2px;display:flex}.PlayerHUD-module__-E1Scq__TeamScores{border:1px solid #80ffc826;font-size:12px;position:absolute;bottom:6px;left:6px}.PlayerHUD-module__-E1Scq__TeamRow{background:#00323ca6;flex:1 0 auto;justify-content:space-between;align-items:center;gap:6px;padding:4px 8px 4px 6px;display:flex}.PlayerHUD-module__-E1Scq__TeamRow+.PlayerHUD-module__-E1Scq__TeamRow{border-top:1px solid #80ffc826}.PlayerHUD-module__-E1Scq__TeamName{min-width:6em;font-size:12px;font-weight:500}.PlayerHUD-module__-E1Scq__TeamNameFriendly{color:#2de46a;}.PlayerHUD-module__-E1Scq__TeamNameEnemy{color:#79cbd4;}.PlayerHUD-module__-E1Scq__TeamScore{color:#fff;text-align:right;font-weight:500}.PlayerHUD-module__-E1Scq__TeamCount{color:#9ba;font-size:9px}.PlayerHUD-module__-E1Scq__PackInventoryHUD{align-items:center;gap:4px;display:flex;position:absolute;bottom:6px;right:6px}.PlayerHUD-module__-E1Scq__PackInvItem{background:#00323ca6;border:1px solid #80ffc826;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:4px;display:flex}.PlayerHUD-module__-E1Scq__PackInvItemActive{border-color:#80ffc880;box-shadow:0 0 6px #80ffc84d}.PlayerHUD-module__-E1Scq__PackInvItemDim{opacity:.5}.PlayerHUD-module__-E1Scq__PackInvIcon{image-rendering:pixelated;display:block}.PlayerHUD-module__-E1Scq__PackInvCount{color:#bfe;text-align:center;min-width:12px;font-size:11px}.PlayerHUD-module__-E1Scq__PackInvInfinity{image-rendering:pixelated;opacity:.8;display:block}.PlayerHUD-module__-E1Scq__Reticle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.PlayerHUD-module__-E1Scq__ReticleImage{opacity:.85;width:64px;height:64px;image-rendering:pixelated}.PlayerHUD-module__-E1Scq__ReticleDot{background:#2ecc40b3;border-radius:50%;width:4px;height:4px;box-shadow:0 0 4px #2ecc4080} +.ChatWindow-module__mz35vq__ChatContainer{pointer-events:auto;border:1px solid #2cacb566;flex-direction:column;width:400px;max-width:50%;display:flex;position:absolute;top:6px;left:6px}.ChatWindow-module__mz35vq__ChatWindow{-webkit-user-select:text;user-select:text;scrollbar-width:thin;scrollbar-color:#2cacb566 transparent;background:#00323ca6;min-height:4em;max-height:12.5em;padding:6px;font-size:12px;line-height:1.25;overflow-y:auto}.ChatWindow-module__mz35vq__ChatMessage{color:#2cacb5;padding:2px 0}.ChatWindow-module__mz35vq__ChatColor0{color:#2cacb5}.ChatWindow-module__mz35vq__ChatColor1{color:#04eb69}.ChatWindow-module__mz35vq__ChatColor2{color:#dbc880}.ChatWindow-module__mz35vq__ChatColor3{color:#4dfd5f}.ChatWindow-module__mz35vq__ChatColor4{color:#28e7f0}.ChatWindow-module__mz35vq__ChatColor5{color:#c8c832}.ChatWindow-module__mz35vq__ChatColor6{color:#c8c8c8}.ChatWindow-module__mz35vq__ChatColor7{color:#dcdc14}.ChatWindow-module__mz35vq__ChatColor8{color:#9696fa}.ChatWindow-module__mz35vq__ChatColor9{color:#3cdc96} diff --git a/docs/_next/static/chunks/df1e111d87e0ccf8.js b/docs/_next/static/chunks/df1e111d87e0ccf8.js deleted file mode 100644 index 23f07363..00000000 --- a/docs/_next/static/chunks/df1e111d87e0ccf8.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(47167),r=e.i(2232);let n=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:i,modules:s}=function(){let e=t.default.env.NEXT_PUBLIC_LOG?.trim();if(!e)return{globalLevel:"info",modules:new Map};let r=null,i=new Map;for(let t of e.split(",")){let e=t.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&i.set(t,r)}else n.has(e)&&(r=e)}return{globalLevel:r??=i.size>0?"silent":"info",modules:i}}(),l={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},a=(0,r.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=l[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function o(e){let t=s.get(e)??i;return a.child({module:e},{level:t})}e.s(["createLogger",()=>o])},98223,e=>{"use strict";function t(e){return e.split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["parseImageFileList",()=>t])},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},12979,e=>{"use strict";var t=e.i(98223),r=e.i(25645),n=e.i(91996),i=e.i(62395),s=e.i(71726);let l=(0,r.createLogger)("loaders"),a="/t2-mapper",o=`${a}/base/`,u=`${a}/magenta.png`;function c(e,t){let r;try{r=(0,n.getActualResourceKey)(e)}catch(r){if(t)return l.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,s]=(0,n.getSourceAndPath)(r);return i?`${o}@vl2/${i}/${s}`:`${o}${s}`}function f(e){return c(`interiors/${e}`).replace(/\.dif$/i,".glb")}function d(e){return c(`shapes/${e}`).replace(/\.dts$/i,".glb")}function b(e){return e=e.replace(/^terrain\./,""),c((0,n.getStandardTextureResourceKey)(`textures/terrain/${e}`),u)}function g(e,t){let r=(0,s.normalizePath)(t).split("/"),i=r.length>1?r.slice(0,-1).join("/")+"/":"",l=`${i}${e}`;return c((0,n.getStandardTextureResourceKey)(l),u)}function p(e){return c((0,n.getStandardTextureResourceKey)(`textures/${e}`),u)}function h(e){return c(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function m(e){let t=c(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function y(e){let t,r=(0,n.getMissionInfo)(e),s=await fetch(c(r.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,i.parseMissionScript)(t)}async function v(e){let t=c(`terrains/${e}`);l.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return l.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function w(e){let r=c(e),n=await fetch(r),i=await n.text();return(0,t.parseImageFileList)(i)}e.s(["FALLBACK_TEXTURE_URL",0,u,"RESOURCE_ROOT_URL",0,o,"audioToUrl",()=>h,"getUrlForPath",()=>c,"iflTextureToUrl",()=>g,"interiorToUrl",()=>f,"loadDetailMapList",()=>m,"loadImageFrameList",()=>w,"loadMission",()=>y,"loadTerrain",()=>v,"shapeToUrl",()=>d,"terrainTextureToUrl",()=>b,"textureToUrl",()=>p],12979)}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/e01e6e76b521dd3c.js b/docs/_next/static/chunks/e01e6e76b521dd3c.js new file mode 100644 index 00000000..db0fa207 --- /dev/null +++ b/docs/_next/static/chunks/e01e6e76b521dd3c.js @@ -0,0 +1,8 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,51475,e=>{"use strict";var t=e.i(43476),r=e.i(71645),s=e.i(71753);let n=(0,r.createContext)(null);function i({children:e}){let i=(0,r.useRef)(void 0),a=(0,r.useRef)(0),o=(0,r.useRef)(0);(0,s.useFrame)((e,t)=>{for(a.current+=t;a.current>=.03125;)if(a.current-=.03125,o.current++,i.current)for(let e of i.current)e(o.current)});let A=(0,r.useCallback)(e=>(i.current??=new Set,i.current.add(e),()=>{i.current.delete(e)}),[]),l=(0,r.useCallback)(()=>o.current,[]),B=(0,r.useCallback)(()=>a.current/.03125,[]),c=(0,r.useMemo)(()=>({subscribe:A,getTick:l,getTickFraction:B}),[A,l,B]);return(0,t.jsx)(n.Provider,{value:c,children:e})}function a(e){let t=(0,r.useContext)(n);if(!t)throw Error("useTick must be used within a TickProvider");let s=(0,r.useRef)(e);s.current=e,(0,r.useEffect)(()=>t.subscribe(e=>s.current(e)),[t])}function o(){let e=(0,r.useContext)(n);if(!e)throw Error("useGetTickFraction must be used within a TickProvider");return e.getTickFraction}e.s(["TICK_RATE",0,32,"TickProvider",()=>i,"useGetTickFraction",()=>o,"useTick",()=>a])},8597,78140,e=>{"use strict";let t;var r=e.i(71645);let s=(0,r.createContext)(null),n={didCatch:!1,error:null};class i extends r.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=n}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(...e){let{error:t}=this.state;null!==t&&(this.props.onReset?.({args:e,reason:"imperative-api"}),this.setState(n))}componentDidCatch(e,t){this.props.onError?.(e,t)}componentDidUpdate(e,t){let{didCatch:r}=this.state,{resetKeys:s}=this.props;r&&null!==t.error&&function(e=[],t=[]){return e.length!==t.length||e.some((e,r)=>!Object.is(e,t[r]))}(e.resetKeys,s)&&(this.props.onReset?.({next:s,prev:e.resetKeys,reason:"keys"}),this.setState(n))}render(){let{children:e,fallbackRender:t,FallbackComponent:n,fallback:i}=this.props,{didCatch:a,error:o}=this.state,A=e;if(a){let e={error:o,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof t)A=t(e);else if(n)A=(0,r.createElement)(n,e);else if(void 0!==i)A=i;else throw o}return(0,r.createElement)(s.Provider,{value:{didCatch:a,error:o,resetErrorBoundary:this.resetErrorBoundary}},A)}}e.s(["ErrorBoundary",()=>i],8597);var a=e.i(31067),o=e.i(90072);function A(e,t){if(t===o.TrianglesDrawMode)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),e;if(t!==o.TriangleFanDrawMode&&t!==o.TriangleStripDrawMode)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",t),e;{let r=e.getIndex();if(null===r){let t=[],s=e.getAttribute("position");if(void 0===s)return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),e;for(let e=0;etypeof TextDecoder)return new TextDecoder().decode(e);let t="";for(let r=0,s=e.length;r=2.0 are supported."));return}let o=new et(n,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});o.fileLoader.setRequestHeader(this.requestHeader);for(let e=0;e=0&&void 0===a[t]&&console.warn('THREE.GLTFLoader: Unknown extension "'+t+'".')}}o.setExtensions(i),o.setPlugins(a),o.parse(r,s)}parseAsync(e,t){let r=this;return new Promise(function(s,n){r.parse(e,t,s,n)})}}function h(){let e={};return{get:function(t){return e[t]},add:function(t,r){e[t]=r},remove:function(t){delete e[t]},removeAll:function(){e={}}}}let d={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class f{constructor(e){this.parser=e,this.name=d.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){let e=this.parser,t=this.parser.json.nodes||[];for(let r=0,s=t.length;r=0))return null;else throw Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return t.loadTextureImage(e,n.source,i)}}class b{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class y{constructor(e){this.parser=e,this.name=d.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){let t=this.name,r=this.parser,s=r.json,n=s.textures[e];if(!n.extensions||!n.extensions[t])return null;let i=n.extensions[t],a=s.images[i.source],o=r.textureLoader;if(a.uri){let e=r.options.manager.getHandler(a.uri);null!==e&&(o=e)}return this.detectSupport().then(function(n){if(n)return r.loadTextureImage(e,i.source,o);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return r.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){let t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(1===t.height)}})),this.isSupported}}class L{constructor(e){this.name=d.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){let t=this.parser.json,r=t.bufferViews[e];if(!r.extensions||!r.extensions[this.name])return null;{let e=r.extensions[this.name],s=this.parser.getDependency("buffer",e.buffer),n=this.parser.options.meshoptDecoder;if(!n||!n.supported)if(!(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0))return null;else throw Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return s.then(function(t){let r=e.byteOffset||0,s=e.byteLength||0,i=e.count,a=e.byteStride,o=new Uint8Array(t,r,s);return n.decodeGltfBufferAsync?n.decodeGltfBufferAsync(i,a,o,e.mode,e.filter).then(function(e){return e.buffer}):n.ready.then(function(){let t=new ArrayBuffer(i*a);return n.decodeGltfBuffer(new Uint8Array(t),i,a,o,e.mode,e.filter),t})})}}}class x{constructor(e){this.name=d.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){let t=this.parser.json,r=t.nodes[e];if(!r.extensions||!r.extensions[this.name]||void 0===r.mesh)return null;for(let e of t.meshes[r.mesh].primitives)if(e.mode!==_.TRIANGLES&&e.mode!==_.TRIANGLE_STRIP&&e.mode!==_.TRIANGLE_FAN&&void 0!==e.mode)return null;let s=r.extensions[this.name].attributes,n=[],i={};for(let e in s)n.push(this.parser.getDependency("accessor",s[e]).then(t=>(i[e]=t,i[e])));return n.length<1?null:(n.push(this.parser.createNodeMesh(e)),Promise.all(n).then(e=>{let t=e.pop(),r=t.isGroup?t.children:[t],s=e[0].count,n=[];for(let e of r){let t=new o.Matrix4,r=new o.Vector3,a=new o.Quaternion,A=new o.Vector3(1,1,1),l=new o.InstancedMesh(e.geometry,e.material,s);for(let e=0;e=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},Z={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},W={CUBICSPLINE:void 0,LINEAR:o.InterpolateLinear,STEP:o.InterpolateDiscrete};function V(e,t,r){for(let s in r.extensions)void 0===e[s]&&(t.userData.gltfExtensions=t.userData.gltfExtensions||{},t.userData.gltfExtensions[s]=r.extensions[s])}function q(e,t){void 0!==t.extras&&("object"==typeof t.extras?Object.assign(e.userData,t.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+t.extras))}function z(e){let t="",r=Object.keys(e).sort();for(let s=0,n=r.length;stypeof navigator&&void 0!==navigator.userAgent&&(r=!0===/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=(s=navigator.userAgent.indexOf("Firefox")>-1)?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),"u"{let r=this.associations.get(e);for(let[s,i]of(null!=r&&this.associations.set(t,r),e.children.entries()))n(i,t.children[s])};return n(r,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){let t=Object.values(this.plugins);t.push(this);for(let r=0;r=2&&i.setY(t,u[e*A+1]),A>=3&&i.setZ(t,u[e*A+2]),A>=4&&i.setW(t,u[e*A+3]),A>=5)throw Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return i})}loadTexture(e){let t=this.json,r=this.options,s=t.textures[e].source,n=t.images[s],i=this.textureLoader;if(n.uri){let e=r.manager.getHandler(n.uri);null!==e&&(i=e)}return this.loadTextureImage(e,s,i)}loadTextureImage(e,t,r){let s=this,n=this.json,i=n.textures[e],a=n.images[t],A=(a.uri||a.bufferView)+":"+i.sampler;if(this.textureCache[A])return this.textureCache[A];let l=this.loadImageSource(t,r).then(function(t){t.flipY=!1,t.name=i.name||a.name||"",""===t.name&&"string"==typeof a.uri&&!1===a.uri.startsWith("data:image/")&&(t.name=a.uri);let r=(n.samplers||{})[i.sampler]||{};return t.magFilter=k[r.magFilter]||o.LinearFilter,t.minFilter=k[r.minFilter]||o.LinearMipmapLinearFilter,t.wrapS=X[r.wrapS]||o.RepeatWrapping,t.wrapT=X[r.wrapT]||o.RepeatWrapping,s.associations.set(t,{textures:e}),t}).catch(function(){return null});return this.textureCache[A]=l,l}loadImageSource(e,t){let r=this.json,s=this.options;if(void 0!==this.sourceCache[e])return this.sourceCache[e].then(e=>e.clone());let n=r.images[e],i=self.URL||self.webkitURL,a=n.uri||"",A=!1;if(void 0!==n.bufferView)a=this.getDependency("bufferView",n.bufferView).then(function(e){A=!0;let t=new Blob([e],{type:n.mimeType});return a=i.createObjectURL(t)});else if(void 0===n.uri)throw Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");let l=Promise.resolve(a).then(function(e){return new Promise(function(r,n){let i=r;!0===t.isImageBitmapLoader&&(i=function(e){let t=new o.Texture(e);t.needsUpdate=!0,r(t)}),t.load(o.LoaderUtils.resolveURL(e,s.path),i,void 0,n)})}).then(function(e){var t;return!0===A&&i.revokeObjectURL(a),q(e,n),e.userData.mimeType=n.mimeType||((t=n.uri).search(/\.jpe?g($|\?)/i)>0||0===t.search(/^data\:image\/jpeg/)?"image/jpeg":t.search(/\.webp($|\?)/i)>0||0===t.search(/^data\:image\/webp/)?"image/webp":"image/png"),e}).catch(function(e){throw console.error("THREE.GLTFLoader: Couldn't load texture",a),e});return this.sourceCache[e]=l,l}assignTexture(e,t,r,s){let n=this;return this.getDependency("texture",r.index).then(function(i){if(!i)return null;if(void 0!==r.texCoord&&r.texCoord>0&&((i=i.clone()).channel=r.texCoord),n.extensions[d.KHR_TEXTURE_TRANSFORM]){let e=void 0!==r.extensions?r.extensions[d.KHR_TEXTURE_TRANSFORM]:void 0;if(e){let t=n.associations.get(i);i=n.extensions[d.KHR_TEXTURE_TRANSFORM].extendTexture(i,e),n.associations.set(i,t)}}return void 0!==s&&("number"==typeof s&&(s=3001===s?c:u),"colorSpace"in i?i.colorSpace=s:i.encoding=s===c?3001:3e3),e[t]=i,i})}assignFinalMaterial(e){let t=e.geometry,r=e.material,s=void 0===t.attributes.tangent,n=void 0!==t.attributes.color,i=void 0===t.attributes.normal;if(e.isPoints){let e="PointsMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.PointsMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,t.sizeAttenuation=!1,this.cache.add(e,t)),r=t}else if(e.isLine){let e="LineBasicMaterial:"+r.uuid,t=this.cache.get(e);t||(t=new o.LineBasicMaterial,o.Material.prototype.copy.call(t,r),t.color.copy(r.color),t.map=r.map,this.cache.add(e,t)),r=t}if(s||n||i){let e="ClonedMaterial:"+r.uuid+":";s&&(e+="derivative-tangents:"),n&&(e+="vertex-colors:"),i&&(e+="flat-shading:");let t=this.cache.get(e);t||(t=r.clone(),n&&(t.vertexColors=!0),i&&(t.flatShading=!0),s&&(t.normalScale&&(t.normalScale.y*=-1),t.clearcoatNormalScale&&(t.clearcoatNormalScale.y*=-1)),this.cache.add(e,t),this.associations.set(t,this.associations.get(r))),r=t}e.material=r}getMaterialType(){return o.MeshStandardMaterial}loadMaterial(e){let t,r=this,s=this.json,n=this.extensions,i=s.materials[e],a={},A=i.extensions||{},l=[];if(A[d.KHR_MATERIALS_UNLIT]){let e=n[d.KHR_MATERIALS_UNLIT];t=e.getMaterialType(),l.push(e.extendParams(a,i,r))}else{let s=i.pbrMetallicRoughness||{};if(a.color=new o.Color(1,1,1),a.opacity=1,Array.isArray(s.baseColorFactor)){let e=s.baseColorFactor;a.color.setRGB(e[0],e[1],e[2],u),a.opacity=e[3]}void 0!==s.baseColorTexture&&l.push(r.assignTexture(a,"map",s.baseColorTexture,c)),a.metalness=void 0!==s.metallicFactor?s.metallicFactor:1,a.roughness=void 0!==s.roughnessFactor?s.roughnessFactor:1,void 0!==s.metallicRoughnessTexture&&(l.push(r.assignTexture(a,"metalnessMap",s.metallicRoughnessTexture)),l.push(r.assignTexture(a,"roughnessMap",s.metallicRoughnessTexture))),t=this._invokeOne(function(t){return t.getMaterialType&&t.getMaterialType(e)}),l.push(Promise.all(this._invokeAll(function(t){return t.extendMaterialParams&&t.extendMaterialParams(e,a)})))}!0===i.doubleSided&&(a.side=o.DoubleSide);let B=i.alphaMode||"OPAQUE";if("BLEND"===B?(a.transparent=!0,a.depthWrite=!1):(a.transparent=!1,"MASK"===B&&(a.alphaTest=void 0!==i.alphaCutoff?i.alphaCutoff:.5)),void 0!==i.normalTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"normalMap",i.normalTexture)),a.normalScale=new o.Vector2(1,1),void 0!==i.normalTexture.scale)){let e=i.normalTexture.scale;a.normalScale.set(e,e)}if(void 0!==i.occlusionTexture&&t!==o.MeshBasicMaterial&&(l.push(r.assignTexture(a,"aoMap",i.occlusionTexture)),void 0!==i.occlusionTexture.strength&&(a.aoMapIntensity=i.occlusionTexture.strength)),void 0!==i.emissiveFactor&&t!==o.MeshBasicMaterial){let e=i.emissiveFactor;a.emissive=new o.Color().setRGB(e[0],e[1],e[2],u)}return void 0!==i.emissiveTexture&&t!==o.MeshBasicMaterial&&l.push(r.assignTexture(a,"emissiveMap",i.emissiveTexture,c)),Promise.all(l).then(function(){let s=new t(a);return i.name&&(s.name=i.name),q(s,i),r.associations.set(s,{materials:e}),i.extensions&&V(n,s,i),s})}createUniqueName(e){let t=o.PropertyBinding.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){let t=this,r=this.extensions,s=this.primitiveCache,n=[];for(let i=0,a=e.length;i0&&function(e,t){if(e.updateMorphTargets(),void 0!==t.weights)for(let r=0,s=t.weights.length;r1?new o.Group:1===t.length?t[0]:new o.Object3D)!==t[0])for(let e=0,r=t.length;e{let t=new Map;for(let[e,r]of s.associations)(e instanceof o.Material||e instanceof o.Texture)&&t.set(e,r);return e.traverse(e=>{let r=s.associations.get(e);null!=r&&t.set(e,r)}),t})(n),n})}_createAnimationTracks(e,t,r,s,n){let i,a=[],A=e.name?e.name:e.uuid,l=[];switch(Z[n.path]===Z.weights?e.traverse(function(e){e.morphTargetInfluences&&l.push(e.name?e.name:e.uuid)}):l.push(A),Z[n.path]){case Z.weights:i=o.NumberKeyframeTrack;break;case Z.rotation:i=o.QuaternionKeyframeTrack;break;case Z.position:case Z.scale:i=o.VectorKeyframeTrack;break;default:i=1===r.itemSize?o.NumberKeyframeTrack:o.VectorKeyframeTrack}let B=void 0!==s.interpolation?W[s.interpolation]:o.InterpolateLinear,c=this._getArrayFromAccessor(r);for(let e=0,r=l.length;e{let r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(s)},r,s)}decodeDracoFile(e,t,r,s){let n={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,n).then(t)}decodeGeometry(e,t){let r;for(let e in t.attributeTypes){let r=t.attributeTypes[e];void 0!==r.BYTES_PER_ELEMENT&&(t.attributeTypes[e]=r.name)}let s=JSON.stringify(t);if(en.has(e)){let t=en.get(e);if(t.key===s)return t.promise;if(0===e.byteLength)throw Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let n=this.workerNextTaskID++,i=e.byteLength,a=this._getWorker(n,i).then(s=>(r=s,new Promise((s,i)=>{r._callbacks[n]={resolve:s,reject:i},r.postMessage({type:"decode",id:n,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return a.catch(()=>!0).then(()=>{r&&n&&this._releaseTask(r,n)}),en.set(e,{key:s,promise:a}),a}_createGeometry(e){let t=new es.BufferGeometry;e.index&&t.setIndex(new es.BufferAttribute(e.index.array,1));for(let r=0;r{r.load(e,t,void 0,s)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;let e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{let r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);let s=ea.toString(),n=["/* draco decoder */",r,"\n/* worker */",s.substring(s.indexOf("{")+1,s.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([n]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.lengtht._taskLoad?-1:1});let r=this.workerPool[this.workerPool.length-1];return r._taskCosts[e]=t,r._taskLoad+=t,r})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e{let t=e.draco,r=new t.Decoder,a=new t.DecoderBuffer;a.Init(new Int8Array(n),n.byteLength);try{let e=function(e,t,r,s){var n,i,a;let o,A,l,B,c,u,C=s.attributeIDs,h=s.attributeTypes,d=t.GetEncodedGeometryType(r);if(d===e.TRIANGULAR_MESH)c=new e.Mesh,u=t.DecodeBufferToMesh(r,c);else if(d===e.POINT_CLOUD)c=new e.PointCloud,u=t.DecodeBufferToPointCloud(r,c);else throw Error("THREE.DRACOLoader: Unexpected geometry type.");if(!u.ok()||0===c.ptr)throw Error("THREE.DRACOLoader: Decoding failed: "+u.error_msg());let f={index:null,attributes:[]};for(let r in C){let n,i,a=self[h[r]];if(s.useUniqueIDs)i=C[r],n=t.GetAttributeByUniqueId(c,i);else{if(-1===(i=t.GetAttributeId(c,e[C[r]])))continue;n=t.GetAttribute(c,i)}f.attributes.push(function(e,t,r,s,n,i){let a=i.num_components(),o=r.num_points()*a,A=o*n.BYTES_PER_ELEMENT,l=function(e,t){switch(t){case Float32Array:return e.DT_FLOAT32;case Int8Array:return e.DT_INT8;case Int16Array:return e.DT_INT16;case Int32Array:return e.DT_INT32;case Uint8Array:return e.DT_UINT8;case Uint16Array:return e.DT_UINT16;case Uint32Array:return e.DT_UINT32}}(e,n),B=e._malloc(A);t.GetAttributeDataArrayForAllPoints(r,i,l,A,B);let c=new n(e.HEAPF32.buffer,B,o).slice();return e._free(B),{name:s,array:c,itemSize:a}}(e,t,c,r,a,n))}return d===e.TRIANGULAR_MESH&&(n=e,i=t,a=c,o=3*a.num_faces(),A=4*o,l=n._malloc(A),i.GetTrianglesUInt32Array(a,A,l),B=new Uint32Array(n.HEAPF32.buffer,l,o).slice(),n._free(l),f.index={array:B,itemSize:1}),e.destroy(c),f}(t,r,a,i),n=e.attributes.map(e=>e.array.buffer);e.index&&n.push(e.index.array.buffer),self.postMessage({type:"decode",id:s.id,geometry:e},n)}catch(e){console.error(e),self.postMessage({type:"error",id:s.id,error:e.message})}finally{t.destroy(a),t.destroy(r)}})}}}var eo=e.i(99143);let eA=function(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;n{let C={keys:B,deep:n,inject:l,castShadow:i,receiveShadow:A};if(Array.isArray(t=r.useMemo(()=>{if(!1===e&&!Array.isArray(t)){let e=!1;if(t.traverse(t=>{t.isSkinnedMesh&&(e=!0)}),e)return eA(t)}return t},[t,e])))return r.createElement("group",(0,a.default)({},c,{ref:u}),t.map(e=>r.createElement(el,(0,a.default)({key:e.uuid,object:e},C))),s);let{children:h,...d}=function(e,{keys:t=["near","far","color","distance","decay","penumbra","angle","intensity","skeleton","visible","castShadow","receiveShadow","morphTargetDictionary","morphTargetInfluences","name","geometry","material","position","rotation","scale","up","userData","bindMode","bindMatrix","bindMatrixInverse","skeleton"],deep:s,inject:n,castShadow:i,receiveShadow:a}){let A={};for(let r of t)A[r]=e[r];return s&&(A.geometry&&"materialsOnly"!==s&&(A.geometry=A.geometry.clone()),A.material&&"geometriesOnly"!==s&&(A.material=A.material.clone())),n&&(A="function"==typeof n?{...A,children:n(e)}:r.isValidElement(n)?{...A,children:n}:{...A,...n}),e instanceof o.Mesh&&(i&&(A.castShadow=!0),a&&(A.receiveShadow=!0)),A}(t,C),f=t.type[0].toLowerCase()+t.type.slice(1);return r.createElement(f,(0,a.default)({},d,c,{ref:u}),t.children.map(e=>"Bone"===e.type?r.createElement("primitive",(0,a.default)({key:e.uuid,object:e},C)):r.createElement(el,(0,a.default)({key:e.uuid,object:e},C,{isChild:!0}))),s,h)}),eB=null,ec="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function eu(e=!0,r=!0,s){return n=>{s&&s(n),e&&(eB||(eB=new ei),eB.setDecoderPath("string"==typeof e?e:ec),n.setDRACOLoader(eB)),r&&n.setMeshoptDecoder((()=>{let e;if(t)return t;let r=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),s=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if("object"!=typeof WebAssembly)return{supported:!1};let n="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB";WebAssembly.validate(r)&&(n="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB");let i=WebAssembly.instantiate(function(e){let t=new Uint8Array(e.length);for(let r=0;r96?s-71:s>64?s-65:s>47?s+4:s>46?63:62}let r=0;for(let n=0;n{(e=t.instance).exports.__wasm_call_ctors()});function a(t,r,s,n,i,a){let o=e.exports.sbrk,A=s+3&-4,l=o(A*n),B=o(i.length),c=new Uint8Array(e.exports.memory.buffer);c.set(i,B);let u=t(l,s,n,B,i.length);if(0===u&&a&&a(l,A,n),r.set(c.subarray(l,l+s*n)),o(l-o(0)),0!==u)throw Error(`Malformed buffer data: ${u}`)}let o={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},A={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return t={ready:i,supported:!0,decodeVertexBuffer(t,r,s,n,i){a(e.exports.meshopt_decodeVertexBuffer,t,r,s,n,e.exports[o[i]])},decodeIndexBuffer(t,r,s,n){a(e.exports.meshopt_decodeIndexBuffer,t,r,s,n)},decodeIndexSequence(t,r,s,n){a(e.exports.meshopt_decodeIndexSequence,t,r,s,n)},decodeGltfBuffer(t,r,s,n,i,l){a(e.exports[A[i]],t,r,s,n,e.exports[o[l]])}}})())}}let eC=(e,t,r,s)=>(0,eo.useLoader)(C,e,eu(t,r,s));eC.preload=(e,t,r,s)=>eo.useLoader.preload(C,e,eu(t,r,s)),eC.clear=e=>eo.useLoader.clear(C,e),eC.setDecoderPath=e=>{ec=e},e.s(["useGLTF",()=>eC],78140)},82816,e=>{"use strict";function t(e){let t=new Map,r=new Map,s=e.clone();return function e(t,r,s){s(t,r);for(let n=0;nt])},25947,54452,e=>{"use strict";var t=e.i(43476),r=e.i(932),s=e.i(71645);let n=/borg|xorg|porg|dorg|plant|tree|bush|fern|vine|grass|leaf|flower|frond|palm|foliage/i;function i(e){return n.test(e)}let a=(0,s.createContext)(null);function o(){let e=(0,s.useContext)(a);if(!e)throw Error("useShapeInfo must be used within ShapeInfoProvider");return e}function A(e){let s,n,o,A=(0,r.c)(10),{children:l,object:B,shapeName:c,type:u}=e;A[0]!==c?(s=i(c),A[0]=c,A[1]=s):s=A[1];let C=s;A[2]!==C||A[3]!==B||A[4]!==c||A[5]!==u?(n={object:B,shapeName:c,type:u,isOrganic:C},A[2]=C,A[3]=B,A[4]=c,A[5]=u,A[6]=n):n=A[6];let h=n;return A[7]!==l||A[8]!==h?(o=(0,t.jsx)(a.Provider,{value:h,children:l}),A[7]=l,A[8]=h,A[9]=o):o=A[9],o}e.s(["ShapeInfoProvider",()=>A,"isOrganicShape",()=>i,"useShapeInfo",()=>o],25947),e.i(47167);var l=e.i(69230),B=e.i(69637),c=e.i(54440);function u(e,t){return(0,B.useBaseQuery)({...e,enabled:!0,suspense:!0,throwOnError:c.defaultThrowOnError,placeholderData:void 0},l.QueryObserver,t)}e.s(["useSuspenseQuery",()=>u],54452)},71505,6655,e=>{"use strict";var t=e.i(932),r=e.i(47071),s=e.i(54452),n=e.i(90072),i=e.i(12979),a=e.i(75567),o=e.i(51475),A=e.i(79123);let l=1/30,B=new Map;function c(e){let t=e[0].image,r=t.width,s=t.height,i=e.length,a=Math.ceil(Math.sqrt(i)),o=Math.ceil(i/a),A=document.createElement("canvas");A.width=r*a,A.height=s*o;let l=A.getContext("2d");e.forEach((e,t)=>{let n=Math.floor(t/a);l.drawImage(e.image,t%a*r,n*s)});let B=new n.CanvasTexture(A);return B.colorSpace=n.SRGBColorSpace,B.generateMipmaps=!1,B.minFilter=n.NearestFilter,B.magFilter=n.NearestFilter,B.wrapS=n.ClampToEdgeWrapping,B.wrapT=n.ClampToEdgeWrapping,B.repeat.set(1/a,1/o),{texture:B,columns:a,rows:o,frameCount:i,frameOffsetSeconds:[],totalDurationSeconds:0,lastFrame:-1}}function u(e,t){let r=0;e.frameOffsetSeconds=t.map(e=>r+=e.frameCount*l),e.totalDurationSeconds=r}function C(e,t){if(t===e.lastFrame)return;e.lastFrame=t;let r=t%e.columns,s=e.rows-1-Math.floor(t/e.columns);e.texture.offset.set(r/e.columns,s/e.rows)}function h(e,t){let r=e.totalDurationSeconds;if(r<=0)return 0;let s=t;s>r&&(s-=r*Math.floor(s/r));for(let t=0;t(0,i.iflTextureToUrl)(t.name,e)),n=c(await Promise.all(s.map(a.loadTextureAsync)));return u(n,r),B.set(e,n),n}function f(e){let n,a,l,d,f=(0,t.c)(14),{animationEnabled:m}=(0,A.useSettings)();f[0]!==e?(n={queryKey:["ifl",e],queryFn:()=>(0,i.loadImageFrameList)(e)},f[0]=e,f[1]=n):n=f[1];let{data:p}=(0,s.useSuspenseQuery)(n);if(f[2]!==p||f[3]!==e){let t;f[5]!==e?(t=t=>(0,i.iflTextureToUrl)(t.name,e),f[5]=e,f[6]=t):t=f[6],a=p.map(t),f[2]=p,f[3]=e,f[4]=a}else a=f[4];let M=a,F=(0,r.useTexture)(M);f[7]!==p||f[8]!==e||f[9]!==F?((l=B.get(e))||(l=c(F),B.set(e,l)),u(l,p),f[7]=p,f[8]=e,f[9]=F,f[10]=l):l=f[10];let E=l;return f[11]!==m||f[12]!==E?(d=e=>{let t=e/o.TICK_RATE,r=m?h(E,t):0;C(E,r)},f[11]=m,f[12]=E,f[13]=d):d=f[13],(0,o.useTick)(d),E.texture}e.s(["getFrameIndexForTime",()=>h,"loadIflAtlas",()=>d,"updateAtlasFrame",()=>C,"useIflTexture",()=>f],71505);function m(e){e.uniforms.shapeDirectionalFactor={value:1},e.uniforms.shapeAmbientFactor={value:1.5},e.fragmentShader=e.fragmentShader.replace("#include ",`#include +uniform float shapeDirectionalFactor; +uniform float shapeAmbientFactor; +`),e.fragmentShader=e.fragmentShader.replace("#include ",`#include + // Apply shape-specific lighting multipliers + reflectedLight.directDiffuse *= shapeDirectionalFactor; + reflectedLight.indirectDiffuse *= shapeAmbientFactor; +`)}e.s(["injectShapeLighting",()=>m],6655)},85557,e=>{"use strict";e.s(["ANIM_TRANSITION_TIME",()=>A,"DEFAULT_EYE_HEIGHT",()=>o,"STREAM_TICK_SEC",()=>l,"_r90",()=>h,"_r90inv",()=>d,"disposeClonedScene",()=>R,"entityTypeColor",()=>D,"getKeyframeAtTime",()=>F,"getPosedNodeTransform",()=>E,"processShapeScene",()=>g,"replaceWithShapeMaterial",()=>G,"setQuaternionFromDir",()=>M,"setupEffectTexture",()=>m,"torqueHorizontalFovToThreeVerticalFov",()=>f,"torqueVecToThree",()=>p],85557);var t=e.i(90072),r=e.i(91907),s=e.i(25947),n=e.i(71505),i=e.i(75567),a=e.i(12979);let o=2.1,A=.25,l=.032,B=new t.Vector3,c=new t.Vector3,u=new t.Matrix4,C=new t.Vector3(0,1,0),h=new t.Quaternion().setFromAxisAngle(new t.Vector3(0,1,0),Math.PI/2),d=h.clone().invert();function f(e,t){return 180*(2*Math.atan(Math.tan(Math.max(.01,Math.min(179.99,e))*Math.PI/180/2)/(Number.isFinite(t)&&t>1e-6?t:4/3)))/Math.PI}function m(e){e.wrapS=t.ClampToEdgeWrapping,e.wrapT=t.ClampToEdgeWrapping,e.minFilter=t.LinearFilter,e.magFilter=t.LinearFilter,e.colorSpace=t.NoColorSpace,e.flipY=!1,e.needsUpdate=!0}function p(e,t){return t.set(e[1],e[2],e[0])}function M(e,t){B.crossVectors(e,C),1e-8>B.lengthSq()&&B.set(-1,0,0),B.normalize(),c.crossVectors(B,e).normalize(),u.set(B.x,e.x,c.x,0,B.y,e.y,c.y,0,B.z,e.z,c.z,0,0,0,0,1),t.setFromRotationMatrix(u)}function F(e,t){if(0===e.length)return null;if(t<=e[0].time)return e[0];if(t>=e[e.length-1].time)return e[e.length-1];let r=0,s=e.length-1;for(;s-r>1;){let n=r+s>>1;e[n].time<=t?r=n:s=n}return e[r]}function E(e,r,s,n){let i=e.clone(!0),a=r.find(e=>"Root"===e.name);if(a){let e=new t.AnimationMixer(i);if(e.clipAction(a).play(),n)for(let t of n){let s=r.find(e=>e.name.toLowerCase()===t.toLowerCase());if(s){let t=e.clipAction(s);t.time=s.duration/2,t.setEffectiveTimeScale(0),t.play()}}e.setTime(0)}i.updateMatrixWorld(!0);let o=null,A=null;return(i.traverse(e=>{o||e.name!==s||(o=new t.Vector3,A=new t.Quaternion,e.getWorldPosition(o),e.getWorldQuaternion(A))}),o&&A)?{position:o,quaternion:A}:null}function G(e,s,n=!1,o={}){let A=e.userData?.resource_path,l=new Set(e.userData?.flag_names??[]);if(!A){let s=new t.MeshLambertMaterial({color:e.color,side:2,reflectivity:0});return(0,r.applyShapeShaderModifications)(s),{material:s}}if(l.has("IflMaterial")){let t=(0,r.createMaterialFromFlags)(e,null,l,n,s);if(Array.isArray(t)){let e=t[1];return{material:e,backMaterial:t[0],initialize:(t,r)=>I(e,A,t,r)}}return{material:t,initialize:(e,r)=>I(t,A,e,r)}}let B=(0,a.textureToUrl)(A),c=(0,i.loadTexture)(B),u=l.has("Translucent");n||u?(0,i.setupTexture)(c,{disableMipmaps:!0,anisotropy:o.anisotropy}):(0,i.setupTexture)(c,{anisotropy:o.anisotropy});let C=(0,r.createMaterialFromFlags)(e,c,l,n,s);return Array.isArray(C)?{material:C[1],backMaterial:C[0]}:{material:C}}async function I(e,t,r,s){let i=`textures/${t}.ifl`,a=await (0,n.loadIflAtlas)(i);e.map=a.texture,e.needsUpdate=!0;let o=!1,A=r.onBeforeRender;return r.onBeforeRender=function(...e){A?.apply(this,e),o||(0,n.updateAtlasFrame)(a,(0,n.getFrameIndexForTime)(a,s()))},()=>{o=!0,r.onBeforeRender=A??(()=>{})}}function g(e,t,r={}){var n;let i,a=[],o=!!t&&(0,s.isOrganicShape)(t),A=null;e.traverse(e=>{!A&&e.skeleton&&(A=e.skeleton)});let l=A?(n=A,i=new Set,n.bones.forEach((e,t)=>{e.name.match(/^Hulk/i)&&i.add(t)}),i):new Set,B=[];for(let{parent:t,mesh:s}of(e.traverse(e=>{if(!e.isMesh)return;if(e.name.match(/^Hulk/i)||e.material?.name==="Unassigned"){e.visible=!1;return}let t=!!e.userData?.vis_sequence;(e.userData?.vis??1)<.01&&(e.visible=!1),e.geometry&&(!function(e,t){if(0===t.size||!e.attributes.skinIndex)return;let r=e.attributes.skinIndex,s=e.attributes.skinWeight,n=e.index;if(!n)return;let i=Array(r.count).fill(!1);for(let e=0;e.01&&t.has(a)){i[e]=!0;break}}let a=[],o=n.array;for(let e=0;e1){let t=0,r=0,s=0;for(let i of e)t+=n[3*i],r+=n[3*i+1],s+=n[3*i+2];let i=Math.sqrt(t*t+r*r+s*s);for(let a of(i>0&&(t/=i,r/=i,s/=i),e))n[3*a]=t,n[3*a+1]=r,n[3*a+2]=s}r.needsUpdate=!0}(e.geometry));let s=t?1:e.userData?.vis??1;if(Array.isArray(e.material))e.material=e.material.map(t=>{let n=G(t,s,o,r);if(n.initialize&&a.push({mesh:e,initialize:n.initialize}),n.backMaterial&&e.parent){let t=e.clone();t.material=n.backMaterial,B.push({parent:e.parent,mesh:t})}return n.material});else if(e.material){let t=G(e.material,s,o,r);if(t.initialize&&a.push({mesh:e,initialize:t.initialize}),e.material=t.material,t.backMaterial&&e.parent){let r=e.clone();r.material=t.backMaterial,B.push({parent:e.parent,mesh:r})}}}),B))t.add(s);return a}function R(e){e.traverse(e=>{if(e.geometry&&e.geometry.dispose(),e.material)for(let t of Array.isArray(e.material)?e.material:[e.material])t.dispose()})}function D(e){switch(e.toLowerCase()){case"player":return"#00ff88";case"vehicle":return"#ff8800";case"projectile":return"#ff0044";case"deployable":return"#ffcc00";default:return"#8888ff"}}},91907,e=>{"use strict";e.s(["ShapePlaceholder",()=>D,"ShapeRenderer",()=>b,"applyShapeShaderModifications",()=>I,"createMaterialFromFlags",()=>g,"useStaticShape",()=>R]);var t=e.i(43476),r=e.i(932),s=e.i(71645),n=e.i(8597),i=e.i(78140),a=(e.i(47071),e.i(71753)),o=e.i(25645),A=e.i(12979),l=e.i(90072),B=e.i(82816),c=(e.i(75567),e.i(56893)),u=e.i(79123),C=e.i(25947),h=e.i(58647),d=e.i(89887),f=e.i(71505),m=e.i(47021),p=e.i(48066),M=e.i(6655),F=e.i(85557);let E=(0,o.createLogger)("GenericShape");function G(){let{recording:e}=h.engineStore.getState().playback;return null!=e?(0,h.effectNow)()/1e3:performance.now()/1e3}function I(e){e.onBeforeCompile=t=>{(0,m.injectCustomFog)(t,p.globalFogUniforms),e instanceof l.MeshLambertMaterial&&(0,M.injectShapeLighting)(t)}}function g(e,t,r,s,n=1,i=!1){let a=r.has("Translucent"),o=r.has("Additive"),A=r.has("SelfIlluminating"),B=n<1||i;if(A||o){let e=o||a||B,r=new l.MeshBasicMaterial({map:t,side:2,transparent:e,depthWrite:!e,alphaTest:0,fog:!0,...B&&{opacity:n},...o&&{blending:l.AdditiveBlending}});return I(r),r}if(s||a){let e={map:t,transparent:B,alphaTest:.5*!B,...B&&{opacity:n,depthWrite:!1},reflectivity:0},r=new l.MeshLambertMaterial({...e,side:1,polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}),s=new l.MeshLambertMaterial({...e,side:0});return I(r),I(s),[r,s]}let c=new l.MeshLambertMaterial({map:t,side:2,reflectivity:0,...B&&{transparent:!0,opacity:n,depthWrite:!1}});return I(c),c}function R(e){let t,s=(0,r.c)(2);s[0]!==e?(t=(0,A.shapeToUrl)(e),s[0]=e,s[1]=t):t=s[1];let n=t;return(0,i.useGLTF)(n)}function D(e){let s,n,i,a,o=(0,r.c)(9),{color:A,label:l}=e;return o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("boxGeometry",{args:[10,10,10]}),o[0]=s):s=o[0],o[1]!==A?(n=(0,t.jsx)("meshStandardMaterial",{color:A,wireframe:!0}),o[1]=A,o[2]=n):n=o[2],o[3]!==A||o[4]!==l?(i=l?(0,t.jsx)(d.FloatingLabel,{color:A,children:l}):null,o[3]=A,o[4]=l,o[5]=i):i=o[5],o[6]!==n||o[7]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[6]=n,o[7]=i,o[8]=a):a=o[8],a}function T(e){let s,n=(0,r.c)(4),{color:i,label:a}=e,{debugMode:o}=(0,u.useDebug)();return n[0]!==i||n[1]!==o||n[2]!==a?(s=o?(0,t.jsx)(D,{color:i,label:a}):null,n[0]=i,n[1]=o,n[2]=a,n[3]=s):s=n[3],s}let H=new Set(["octahedron.dts"]);function J(e){let s,n,i,a,o=(0,r.c)(6),{label:A}=e,{debugMode:l}=(0,u.useDebug)();return l?(o[0]===Symbol.for("react.memo_cache_sentinel")?(s=(0,t.jsx)("icosahedronGeometry",{args:[1,1]}),n=(0,t.jsx)("meshBasicMaterial",{color:"cyan",wireframe:!0}),o[0]=s,o[1]=n):(s=o[0],n=o[1]),o[2]!==A?(i=A?(0,t.jsx)(d.FloatingLabel,{color:"cyan",children:A}):null,o[2]=A,o[3]=i):i=o[3],o[4]!==i?(a=(0,t.jsxs)("mesh",{children:[s,n,i]}),o[4]=i,o[5]=a):a=o[5],a):null}let b=(0,s.memo)(function(e){let i,a,o,A,l,B=(0,r.c)(17),{loadingColor:c,streamEntity:u,children:h}=e,d=void 0===c?"yellow":c,{object:f,shapeName:m}=(0,C.useShapeInfo)();if(!m){let e,r=`${f?._id}: `;return B[0]!==r?(e=(0,t.jsx)(T,{color:"orange",label:r}),B[0]=r,B[1]=e):e=B[1],e}if(H.has(m.toLowerCase())){let e,r=`${f?._id}: ${m}`;return B[2]!==r?(e=(0,t.jsx)(J,{label:r}),B[2]=r,B[3]=e):e=B[3],e}let p=`${f?._id}: ${m}`;return B[4]!==p?(i=(0,t.jsx)(T,{color:"red",label:p}),B[4]=p,B[5]=i):i=B[5],B[6]!==d?(a=(0,t.jsx)(D,{color:d}),B[6]=d,B[7]=a):a=B[7],B[8]!==u?(o=(0,t.jsx)(L,{streamEntity:u}),B[8]=u,B[9]=o):o=B[9],B[10]!==h||B[11]!==a||B[12]!==o?(A=(0,t.jsxs)(s.Suspense,{fallback:a,children:[o,h]}),B[10]=h,B[11]=a,B[12]=o,B[13]=A):A=B[13],B[14]!==i||B[15]!==A?(l=(0,t.jsx)(n.ErrorBoundary,{fallback:i,children:A}),B[14]=i,B[15]=A,B[16]=l):l=B[16],l}),y=(0,s.memo)(function({gltf:e,streamEntity:r}){let{object:n,shapeName:i}=(0,C.useShapeInfo)(),{debugMode:o}=(0,u.useDebug)(),{animationEnabled:A}=(0,u.useSettings)(),m=(0,h.useEngineSelector)(e=>e.runtime.runtime),p=(0,c.useAnisotropy)(),{clonedScene:M,mixer:I,clipsByName:g,visNodesBySequence:R,iflMeshes:D}=(0,s.useMemo)(()=>{let t=B.clone(e.scene),r=[];for(let{mesh:e,hasVisSequence:s}of(t.traverse(e=>{if(!e.isMesh||!e.material)return;let t=Array.isArray(e.material)?e.material[0]:e.material;if(!t?.userData)return;let s=new Set(t.userData.flag_names??[]),n=t.userData.resource_path;if(s.has("IflMaterial")&&n){let t=e.userData,s=t?.ifl_sequence?String(t.ifl_sequence).toLowerCase():void 0,i=t?.ifl_duration?Number(t.ifl_duration):void 0,a=t?.ifl_sequence?!!t.ifl_cyclic:void 0,o=t?.ifl_tool_begin!=null?Number(t.ifl_tool_begin):void 0;r.push({mesh:e,iflPath:`textures/${n}.ifl`,hasVisSequence:!!t?.vis_sequence,iflSequence:s,iflDuration:i,iflCyclic:a,iflToolBegin:o})}}),(0,F.processShapeScene)(t,i??void 0,{anisotropy:p}),r))s||(e.visible=!0);let s=new Map;t.traverse(e=>{if(!e.isMesh)return;let t=e.userData;if(!t)return;let r=t.vis_keyframes,n=t.vis_duration,i=(t.vis_sequence??"").toLowerCase();if(!i||!Array.isArray(r)||r.length<=1||!n||n<=0)return;let a=s.get(i);a||(a=[],s.set(i,a)),a.push({mesh:e,keyframes:r,duration:n,cyclic:!!t.vis_cyclic})});let n=new Map;for(let t of e.animations)n.set(t.name.toLowerCase(),t);let a=n.size>0?new l.AnimationMixer(t):null;return{clonedScene:t,mixer:a,clipsByName:n,visNodesBySequence:s,iflMeshes:r}},[e,p]);(0,s.useEffect)(()=>()=>{(0,F.disposeClonedScene)(M),I?.uncacheRoot(M)},[M,I]);let T=(0,s.useRef)(new Map),H=(0,s.useRef)(new Map),J=(0,s.useRef)([]),b=(0,s.useRef)(0);(0,s.useRef)(A).current=A;let y=(0,s.useRef)(r);y.current=r;let L=(0,s.useRef)(null),x=(0,s.useRef)(null),S=(0,s.useRef)(void 0);(0,s.useEffect)(()=>{for(let e of(J.current=[],H.current.clear(),D))(0,f.loadIflAtlas)(e.iflPath).then(t=>{let r=Array.isArray(e.mesh.material)?e.mesh.material[0]:e.mesh.material;r&&(r.map=t.texture,r.needsUpdate=!0);let s={atlas:t,sequenceName:e.iflSequence,sequenceDuration:e.iflDuration,cyclic:e.iflCyclic,toolBegin:e.iflToolBegin};J.current.push(s),H.current.set(e.mesh,t)}).catch(t=>{E.warn("Failed to load IFL atlas for %s: %o",e.iflPath,t)})},[D]);let O=(0,s.useMemo)(()=>{let t=new Map,r=e.scene.userData?.dts_sequence_names,s=e.scene.userData?.dts_sequence_cyclic;if("string"==typeof r&&"string"==typeof s)try{let e=JSON.parse(r),n=JSON.parse(s);for(let r=0;r{let e=T.current,t=null==y.current;function r(t,r){let n=r.toLowerCase();s(t);let i=g.get(n),a=R.get(n),o={sequence:n,startTime:G()};if(i&&I){let e=I.clipAction(i);O.get(n)??!0?e.setLoop(l.LoopRepeat,1/0):(e.setLoop(l.LoopOnce,1),e.clampWhenFinished=!0),e.reset().play(),o.action=e}if(a){for(let e of a)!function(e){if(e.mesh.visible=!0,e.mesh.material?.isMeshStandardMaterial){let t=e.mesh.material,r=(0,F.replaceWithShapeMaterial)(t,e.mesh.userData?.vis??0);e.mesh.material=r.material}e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.transparent=!0,e.mesh.material.depthWrite=!1);let t=H.current.get(e.mesh);t&&e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.map=t.texture,e.mesh.material.needsUpdate=!0)}(e);o.visNodes=a}e.set(t,o)}function s(t){let r=e.get(t);if(r){if(r.action&&r.action.stop(),r.visNodes)for(let e of r.visNodes)e.mesh.visible=!1,e.mesh.material&&!Array.isArray(e.mesh.material)&&(e.mesh.material.opacity=e.keyframes[0]);e.delete(t)}}if(L.current=r,x.current=s,!t)return()=>{for(let t of(L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)};let i=[];for(let[t,a]of(m&&(i.push(m.$.onMethodCalled("ShapeBase","playThread",(e,t,s)=>{e._id===n?._id&&r(Number(t),String(s))})),i.push(m.$.onMethodCalled("ShapeBase","stopThread",(e,t)=>{e._id===n?._id&&s(Number(t))})),i.push(m.$.onMethodCalled("ShapeBase","pauseThread",(t,r)=>{if(t._id!==n?._id)return;let s=e.get(Number(r));s?.action&&(s.action.paused=!0)}))),[[0,"power"],[1,"ambient"]]))(g.has(a)||R.has(a))&&r(t,a);return()=>{for(let t of(i.forEach(e=>e()),L.current=null,x.current=null,S.current=void 0,[...e.keys()]))s(t)}},[I,g,R,O,n,m]);let U=(0,s.useMemo)(()=>{let t=e.scene.userData?.dts_sequence_names;if("string"==typeof t)try{return JSON.parse(t).map(e=>e.toLowerCase())}catch{}return e.animations.map(e=>e.name.toLowerCase())},[e]);return(0,a.useFrame)((e,t)=>{let r=T.current,s=null!=y.current,n=h.engineStore.getState().playback,i=s?"playing"===n.status?t*n.rate:0:t,a=y.current?.threads,o=S.current;if(a!==o){let e=L.current,t=x.current;if(e&&t){S.current=a;let s=[];if(a)for(let e of a)s[e.index]=e;let n=[];if(o)for(let e of o)n[e.index]=e;let i=Math.max(s.length,n.length);for(let a=0;a0)for(let e of(b.current+=i,B)){if(!A){(0,f.updateAtlasFrame)(e.atlas,0);continue}if(e.sequenceName&&e.sequenceDuration){let t=0;for(let[,s]of r)if(s.sequence===e.sequenceName){let r=G()-s.startTime,n=e.sequenceDuration;t=(e.cyclic?r/n%1:Math.min(r/n,1))*n+(e.toolBegin??0);break}(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,t))}else(0,f.updateAtlasFrame)(e.atlas,(0,f.getFrameIndexForTime)(e.atlas,b.current))}}),(0,t.jsxs)("group",{rotation:[0,Math.PI/2,0],children:[(0,t.jsx)("primitive",{object:M}),o?(0,t.jsxs)(d.FloatingLabel,{children:[n?._id,": ",i]}):null]})});function L(e){let s,n=(0,r.c)(3),{streamEntity:i}=e,{shapeName:a}=(0,C.useShapeInfo)(),o=R(a);return n[0]!==o||n[1]!==i?(s=(0,t.jsx)(y,{gltf:o,streamEntity:i}),n[0]=o,n[1]=i,n[2]=s):s=n[2],s}}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/f6808786c34b74b0.js b/docs/_next/static/chunks/f6808786c34b74b0.js new file mode 100644 index 00000000..0f2938c5 --- /dev/null +++ b/docs/_next/static/chunks/f6808786c34b74b0.js @@ -0,0 +1 @@ +(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,58647,79473,43595,e=>{"use strict";e.i(932);var t=e.i(8155);let r=e=>(t,r,n)=>{let i=n.subscribe;return n.subscribe=(e,t,r)=>{let s=e;if(t){let i=(null==r?void 0:r.equalityFn)||Object.is,l=e(n.getState());s=r=>{let n=e(r);if(!i(l,n)){let e=l;t(l=n,e)}},(null==r?void 0:r.fireImmediately)&&t(l,l)}return i(s)},e(t,r,n)};e.s(["subscribeWithSelector",()=>r],79473);var n=e.i(66748);function i(e){let t=new Map;for(let r of e.state.datablocks.values()){if("tsshapeconstructor"!==r._class)continue;let e=r.baseshape;if("string"!=typeof e)continue;let n=e.toLowerCase(),i=n.replace(/\.dts$/i,"")+"_",s=new Map;for(let e=0;e<=127;e++){let t=r[`sequence${e}`];if("string"!=typeof t)continue;let n=t.indexOf(" ");if(-1===n)continue;let l=t.slice(0,n).toLowerCase(),a=t.slice(n+1).trim().toLowerCase();if(!a||!l.startsWith(i)||!l.endsWith(".dsq"))continue;let o=l.slice(i.length,-4);o&&s.set(a,o)}s.size>0&&t.set(n,s)}return t}function s(e,t,r){let n=new Map;for(let r of e){let e=t.clipAction(r);n.set(r.name.toLowerCase(),e)}if(r)for(let[e,t]of r){let r=n.get(t);r&&!n.has(e)&&n.set(e,r)}return n}function l(e){return e.toLowerCase()}function a(e){let t=l(e.trim());return t.startsWith("$")?t.slice(1):t}e.s(["buildSequenceAliasMap",()=>i,"getAliasedActions",()=>s],43595);let o={runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0},playback:{recording:null,status:"stopped",timeMs:0,rate:1,durationMs:0,streamSnapshot:null}},u=(0,t.createStore)()(r(e=>({...o,setRuntime(t){let r=function(e){let t={},r={},n={},i={};for(let r of e.state.objectsById.values())t[r._id]=0,r._name&&(n[l(r._name)]=r._id,r._isDatablock&&(i[l(r._name)]=r._id));for(let t of e.state.globals.keys())r[a(t)]=0;return{objectVersionById:t,globalVersionByName:r,objectIdsByName:n,datablockIdsByName:i}}(t),n=i(t);e(e=>({...e,runtime:{runtime:t,sequenceAliases:n,objectVersionById:r.objectVersionById,globalVersionByName:r.globalVersionByName,objectIdsByName:r.objectIdsByName,datablockIdsByName:r.datablockIdsByName,lastRuntimeTick:0}}))},clearRuntime(){e(e=>({...e,runtime:{runtime:null,sequenceAliases:new Map,objectVersionById:{},globalVersionByName:{},objectIdsByName:{},datablockIdsByName:{},lastRuntimeTick:0}}))},applyRuntimeBatch(t,r){0!==t.length&&e(e=>{let n={...e.runtime.objectVersionById},i={...e.runtime.globalVersionByName},s={...e.runtime.objectIdsByName},o={...e.runtime.datablockIdsByName},u=e=>{null!=e&&(n[e]=(n[e]??0)+1)};for(let e of t){if("object.created"===e.type){let t=e.object;if(u(e.objectId),t._name){let r=l(t._name);s[r]=e.objectId,t._isDatablock&&(o[r]=e.objectId)}u(t._parent?._id);continue}if("object.deleted"===e.type){let t=e.object;if(delete n[e.objectId],t?._name){let e=l(t._name);delete s[e],t._isDatablock&&delete o[e]}u(t?._parent?._id);continue}if("field.changed"===e.type){u(e.objectId);continue}if("global.changed"===e.type){let t=a(e.name);i[t]=(i[t]??0)+1;continue}}let c=r?.tick??(e.runtime.lastRuntimeTick>0?e.runtime.lastRuntimeTick+1:1);return{...e,runtime:{...e.runtime,objectVersionById:n,globalVersionByName:i,objectIdsByName:s,datablockIdsByName:o,lastRuntimeTick:c}}})},setRecording(t){let r=Math.max(0,(t?.duration??0)*1e3);e(e=>({...e,playback:{recording:t,status:t?"stopped":e.playback.status,timeMs:t?0:e.playback.timeMs,rate:t?1:e.playback.rate,durationMs:r,streamSnapshot:t?null:e.playback.streamSnapshot}}))},setPlaybackTime(t){e(e=>{var r,n,i;let s=(r=t,n=0,i=e.playback.durationMs,r<0?0:r>i?i:r);return{...e,playback:{...e.playback,timeMs:s}}})},setPlaybackStatus(t){e(e=>({...e,playback:{...e.playback,status:t}}))},setPlaybackRate(t){var r,n,i;let s=Number.isFinite(t)?(n=.01,i=16,(r=t)<.01?.01:r>16?16:r):1;e(e=>({...e,playback:{...e.playback,rate:s}}))},setPlaybackStreamSnapshot(t){e(e=>({...e,playback:{...e.playback,streamSnapshot:t}}))}}))),c=0;function f(){return c}function d(e,t){c+=e*t*1e3}function b(){return u}function g(e,t){return(0,n.useStoreWithEqualityFn)(u,e,t)}u.subscribe(e=>e.playback.status,e=>{"stopped"===e&&(c=0)}),e.s(["advanceEffectClock",()=>d,"effectNow",()=>f,"engineStore",0,u,"useEngineSelector",()=>g,"useEngineStoreApi",()=>b],58647)},12979,e=>{"use strict";var t=e.i(25645),r=e.i(91996),n=e.i(62395),i=e.i(71726);let s=(0,t.createLogger)("loaders"),l="/t2-mapper",a=`${l}/base/`,o=`${l}/magenta.png`;function u(e,t){let n;try{n=(0,r.getActualResourceKey)(e)}catch(r){if(t)return s.warn('Resource "%s" not found — rendering fallback',e),t;throw r}let[i,l]=(0,r.getSourceAndPath)(n);return i?`${a}@vl2/${i}/${l}`:`${a}${l}`}function c(e){return u(`interiors/${e}`).replace(/\.dif$/i,".glb")}function f(e){return u(`shapes/${e}`).replace(/\.dts$/i,".glb")}function d(e){return e=e.replace(/^terrain\./,""),u((0,r.getStandardTextureResourceKey)(`textures/terrain/${e}`),o)}function b(e,t){let n=(0,i.normalizePath)(t).split("/"),s=n.length>1?n.slice(0,-1).join("/")+"/":"",l=`${s}${e}`;return u((0,r.getStandardTextureResourceKey)(l),o)}function g(e){return u((0,r.getStandardTextureResourceKey)(`textures/${e}`),o)}function p(e){return u(`audio/${e}`).replace(/\.wav$/i,".m4a")}async function h(e){let t=u(`textures/${e}`),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/).map(e=>{if(!(e=e.trim()).startsWith(";"))return e}).filter(Boolean)}async function m(e){let t,i=(0,r.getMissionInfo)(e),s=await fetch(u(i.resourcePath)),l=await s.arrayBuffer();try{t=new TextDecoder("utf-8",{fatal:!0}).decode(l)}catch{t=new TextDecoder("windows-1252").decode(l)}return t=t.replaceAll("�","'"),(0,n.parseMissionScript)(t)}async function y(e){let t=u(`terrains/${e}`);s.debug("Fetching terrain: %s",t);let r=await fetch(t);if(!r.ok)throw Error(`[loadTerrain] Failed to fetch ${t}: ${r.status} ${r.statusText}`);let n=await r.arrayBuffer();return s.debug("Loaded terrain %s: %d bytes",e,n.byteLength),function(e){let t=new DataView(e),r=0,n=t.getUint8(r++),i=new Uint16Array(65536),s=[],l=e=>{let n="";for(let i=0;i0&&s.push(i)}let a=[];for(let e of s){let e=new Uint8Array(65536);for(let n=0;n<65536;n++){let i=t.getUint8(r++);e[n]=i}a.push(e)}return{version:n,textureNames:s,heightMap:i,alphaMaps:a}}(n)}async function v(e){let t=u(e),r=await fetch(t);return(await r.text()).split(/(?:\r\n|\r|\n)/g).map(e=>e.trim()).filter(Boolean).filter(e=>!e.startsWith(";")).map(e=>{let t=e.match(/^(.+)\s(\d+)$/);if(!t)return{name:e,frameCount:1};{let e=parseInt(t[2],10);return{name:t[1],frameCount:e}}})}e.s(["FALLBACK_TEXTURE_URL",0,o,"RESOURCE_ROOT_URL",0,a,"audioToUrl",()=>p,"getUrlForPath",()=>u,"iflTextureToUrl",()=>b,"interiorToUrl",()=>c,"loadDetailMapList",()=>h,"loadImageFrameList",()=>v,"loadMission",()=>m,"loadTerrain",()=>y,"shapeToUrl",()=>f,"terrainTextureToUrl",()=>d,"textureToUrl",()=>g],12979)},79474,(e,t,r)=>{"use strict";var n=e.r(71645).__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;r.c=function(e){return n.H.useMemoCache(e)}},932,(e,t,r)=>{"use strict";t.exports=e.r(79474)},55838,(e,t,r)=>{"use strict";var n=e.r(71645),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useState,l=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!i(e,r)}catch(e){return!0}}var c="u"{"use strict";t.exports=e.r(55838)},52822,(e,t,r)=>{"use strict";var n=e.r(71645),i=e.r(2239),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},l=i.useSyncExternalStore,a=n.useRef,o=n.useEffect,u=n.useMemo,c=n.useDebugValue;r.useSyncExternalStoreWithSelector=function(e,t,r,n,i){var f=a(null);if(null===f.current){var d={hasValue:!1,value:null};f.current=d}else d=f.current;var b=l(e,(f=u(function(){function e(e){if(!o){if(o=!0,l=e,e=n(e),void 0!==i&&d.hasValue){var t=d.value;if(i(t,e))return a=t}return a=e}if(t=a,s(l,e))return t;var r=n(e);return void 0!==i&&i(t,r)?(l=e,t):(l=e,a=r)}var l,a,o=!1,u=void 0===r?null:r;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]},[t,r,n,i]))[0],f[1]);return o(function(){d.hasValue=!0,d.value=b},[b]),c(b),b}},30224,(e,t,r)=>{"use strict";t.exports=e.r(52822)},66748,8155,e=>{"use strict";var t=e.i(71645),r=e.i(30224);let n=e=>{let t,r=new Set,n=(e,n)=>{let i="function"==typeof e?e(t):e;if(!Object.is(i,t)){let e=t;t=(null!=n?n:"object"!=typeof i||null===i)?i:Object.assign({},t,i),r.forEach(r=>r(t,e))}},i=()=>t,s={setState:n,getState:i,getInitialState:()=>l,subscribe:e=>(r.add(e),()=>r.delete(e))},l=t=e(n,i,s);return s},i=e=>e?n(e):n;e.s(["createStore",()=>i],8155);let{useSyncExternalStoreWithSelector:s}=r.default,l=e=>e;function a(e,r=l,n){let i=s(e.subscribe,e.getState,e.getInitialState,r,n);return t.default.useDebugValue(i),i}let o=(e,t)=>{let r=i(e),n=(e,n=t)=>a(r,e,n);return Object.assign(n,r),n},u=(e,t)=>e?o(e,t):o;e.s(["createWithEqualityFn",()=>u,"useStoreWithEqualityFn",()=>a],66748)},91996,71726,e=>{"use strict";var t=e.i(87447);function r(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}e.s(["normalizePath",()=>r],71726);let n=t.default;function i(e){return r(e).toLowerCase()}function s(){return n.resources}function l(e){let[t,...r]=n.resources[e],[i,s]=r[r.length-1];return[i,s??t]}function a(e){let t=i(e);if(n.resources[t])return t;let r=t.replace(/\d+(\.(png))$/i,"$1");if(n.resources[r])return r;throw Error(`Resource not found in manifest: ${e}`)}function o(){return Object.keys(n.resources)}let u=["",".jpg",".png",".gif",".bmp"];function c(e){let t=i(e);for(let e of u){let r=`${t}${e}`;if(n.resources[r])return r}return t}function f(e){let t=n.missions[e];if(!t)throw Error(`Mission not found: ${e}`);return t}function d(e){return e in n.missions}function b(){return Object.keys(n.missions)}e.s(["getActualResourceKey",()=>a,"getMissionInfo",()=>f,"getMissionList",()=>b,"getResourceKey",()=>i,"getResourceList",()=>o,"getResourceMap",()=>s,"getSourceAndPath",()=>l,"getStandardTextureResourceKey",()=>c,"hasMission",()=>d],91996)},71187,(e,t,r)=>{"use strict";function n(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}t.exports=function(e,t,r){var i=r&&r.stringify||n;if("object"==typeof e&&null!==e){var s=t.length+1;if(1===s)return e;var l=Array(s);l[0]=i(e);for(var a=1;a-1?f:0,e.charCodeAt(b+1)){case 100:case 102:if(c>=o||null==t[c])break;f=o||null==t[c])break;f=o||void 0===t[c])break;f",f=b+2,b++;break}u+=i(t[c]),f=b+2,b++;break;case 115:if(c>=o)break;f{"use strict";let n=e.r(71187);t.exports=c;let i=function(){function e(e){return void 0!==e&&e}try{if("u">typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}().console||{};function s(e,t){return"silent"===e?1/0:t.levels.values[e]}let l=Symbol("pino.logFuncs"),a=Symbol("pino.hierarchy"),o={error:"log",fatal:"error",warn:"error",info:"log",debug:"log",trace:"log"};function u(e,t){let r={logger:t,parent:e[a]};t[a]=r}function c(e){var t,r,n;let a,g,p;(e=e||{}).browser=e.browser||{};let h=e.browser.transmit;if(h&&"function"!=typeof h.send)throw Error("pino: transmit option must have a send function");let w=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let j=e.serializers||{},S=(t=e.browser.serialize,Array.isArray(t)?t.filter(function(e){return"!stdSerializers.err"!==e}):!0===t&&Object.keys(j)),O=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(O=!1);let _=Object.keys(e.customLevels||{}),k=["error","fatal","warn","info","debug","trace"].concat(_);"function"==typeof w&&k.forEach(function(e){w[e]=w}),(!1===e.enabled||e.browser.disabled)&&(e.level="silent");let E=e.level||"info",T=Object.create(w);T.log||(T.log=m),a={},k.forEach(e=>{a[e]=w[e]?w[e]:i[e]||i[o[e]||"log"]||m}),T[l]=a,u({},T),Object.defineProperty(T,"levelVal",{get:function(){return s(this.level,this)}}),Object.defineProperty(T,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,f(this,L,T,"error"),f(this,L,T,"fatal"),f(this,L,T,"warn"),f(this,L,T,"info"),f(this,L,T,"debug"),f(this,L,T,"trace"),_.forEach(e=>{f(this,L,T,e)})}});let L={transmit:h,serialize:S,asObject:e.browser.asObject,asObjectBindingsOnly:e.browser.asObjectBindingsOnly,formatters:e.browser.formatters,reportCaller:e.browser.reportCaller,levels:k,timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?y:v,messageKey:e.messageKey||"msg",onChild:e.onChild||m};function R(t,r,n){if(!r)throw Error("missing bindings for child Pino");n=n||{},S&&r.serializers&&(n.serializers=r.serializers);let i=n.serializers;if(S&&i){var s=Object.assign({},j,i),l=!0===e.browser.serialize?Object.keys(s):S;delete r.serializers,d([r],l,s,this._stdErrSerialize)}function a(e){this._childLevel=(0|e._childLevel)+1,this.bindings=r,s&&(this.serializers=s,this._serialize=l),h&&(this._logEvent=b([].concat(e._logEvent.bindings,r)))}a.prototype=this;let o=new a(this);return u(this,o),o.child=function(...e){return R.call(this,t,...e)},o.level=n.level||this.level,t.onChild(o),o}return g=e.customLevels||{},T.levels={values:Object.assign({},c.levels.values,g),labels:Object.assign({},c.levels.labels,(p={},Object.keys(n=g).forEach(function(e){p[n[e]]=e}),p))},T.level=E,T.isLevelEnabled=function(e){return!!this.levels.values[e]&&this.levels.values[e]>=this.levels.values[this.level]},T.setMaxListeners=T.getMaxListeners=T.emit=T.addListener=T.on=T.prependListener=T.once=T.prependOnceListener=T.removeListener=T.removeAllListeners=T.listeners=T.listenerCount=T.eventNames=T.write=T.flush=m,T.serializers=j,T._serialize=S,T._stdErrSerialize=O,T.child=function(...e){return R.call(this,L,...e)},h&&(T._logEvent=b()),T}function f(e,t,r,o){var u,c,f,g,p,h,y;if(Object.defineProperty(e,o,{value:s(e.level,r)>s(o,r)?m:r[l][o],writable:!0,enumerable:!0,configurable:!0}),e[o]===m){if(!t.transmit)return;let n=s(t.transmit.level||e.level,r);if(s(o,r)e}=s.formatters||{},o=r.slice(),u=o[0],c={},f=(0|e._childLevel)+1;if(f<1&&(f=1),i&&(c.time=i),l?Object.assign(c,l(t,e.levels.values[t])):c.level=e.levels.values[t],s.asObjectBindingsOnly){if(null!==u&&"object"==typeof u)for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());return[a(c),...o]}if(null!==u&&"object"==typeof u){for(;f--&&"object"==typeof o[0];)Object.assign(c,o.shift());u=o.length?n(o.shift(),o):void 0}else"string"==typeof u&&(u=n(o.shift(),o));return void 0!==u&&(c[s.messageKey]=u),[a(c)]}(this,g,t,e,c);if(c.reportCaller&&i&&i.length>0&&i[0]&&"object"==typeof i[0])try{let e=w();e&&(i[0].caller=e)}catch(e){}p.call(r,...i)}else{if(c.reportCaller)try{let e=w();e&&t.push(e)}catch(e){}p.apply(r,t)}if(c.transmit){let r=c.transmit.level||u._level,n=s(r,f),i=s(g,f);if(i-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function b(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function g(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function p(){return{}}function h(e){return e}function m(){}function y(){return!1}function v(){return Date.now()}function w(){let e=Error().stack;if(!e)return null;let t=e.split("\n");for(let e=1;e{"use strict";var t=e.i(47167),r=e.i(2232);let n=new Set(["trace","debug","info","warn","error","fatal","silent"]),{globalLevel:i,modules:s}=function(){let e=t.default.env.NEXT_PUBLIC_LOG?.trim();if(!e)return{globalLevel:"info",modules:new Map};let r=null,i=new Map;for(let t of e.split(",")){let e=t.trim();if(e)if(e.includes(":")){let[t,r]=e.split(":");t&&r&&i.set(t,r)}else n.has(e)&&(r=e)}return{globalLevel:r??=i.size>0?"silent":"info",modules:i}}(),l={10:"debug",20:"debug",30:"log",40:"warn",50:"error",60:"error"},a=(0,r.default)({name:"t2-mapper",level:"trace",browser:{write:function(e){let t=l[e.level]??"log";console[t](e.module?`[${e.module}]`:"[t2-mapper]",e.msg)}}});function o(e){let t=s.get(e)??i;return a.child({module:e},{level:t})}e.s(["createLogger",()=>o])}]); \ No newline at end of file diff --git a/docs/_next/static/chunks/fcfc8a45de71c4a4.js b/docs/_next/static/chunks/fcfc8a45de71c4a4.js deleted file mode 100644 index 97c46aac..00000000 --- a/docs/_next/static/chunks/fcfc8a45de71c4a4.js +++ /dev/null @@ -1 +0,0 @@ -(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,17751,e=>{"use strict";var t=e.i(19273),r=e.i(86491),n=e.i(40143),i=e.i(15823),o=class extends i.Subscribable{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,n,i){let o=n.queryKey,a=n.queryHash??(0,t.hashQueryKeyByOptions)(o,n),l=this.get(a);return l||(l=new r.Query({client:e,queryKey:o,queryHash:a,options:e.defaultQueryOptions(n),state:i,defaultOptions:e.getQueryDefaults(o)}),this.add(l)),l}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchQuery)(r,e))}findAll(e={}){let r=this.getAll();return Object.keys(e).length>0?r.filter(r=>(0,t.matchQuery)(e,r)):r}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){n.notifyManager.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},a=e.i(88587),l=e.i(36553),u=class extends a.Removable{#t;#r;#n;#i;constructor(e){super(),this.#t=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#r=[],this.state=e.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#r.includes(e)||(this.#r.push(e),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.#r=this.#r.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.#r.length||("pending"===this.state.status?this.scheduleGc():this.#n.remove(this))}continue(){return this.#i?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#o({type:"continue"})},r={client:this.#t,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#i=(0,l.createRetryer)({fn:()=>this.options.mutationFn?this.options.mutationFn(e,r):Promise.reject(Error("No mutationFn found")),onFail:(e,t)=>{this.#o({type:"failed",failureCount:e,error:t})},onPause:()=>{this.#o({type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let n="pending"===this.state.status,i=!this.#i.canStart();try{if(n)t();else{this.#o({type:"pending",variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,r);let t=await this.options.onMutate?.(e,r);t!==this.state.context&&this.#o({type:"pending",context:t,variables:e,isPaused:i})}let o=await this.#i.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,r),await this.options.onSuccess?.(o,e,this.state.context,r),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,r),await this.options.onSettled?.(o,null,e,this.state.context,r),this.#o({type:"success",data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,r)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,r)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,r)}catch(e){Promise.reject(e)}throw this.#o({type:"error",error:t}),t}finally{this.#n.runNext(this)}}#o(e){this.state=(t=>{switch(e.type){case"failed":return{...t,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...t,isPaused:!0};case"continue":return{...t,isPaused:!1};case"pending":return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}})(this.state),n.notifyManager.batch(()=>{this.#r.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:"updated",action:e})})}},s=i,c=class extends s.Subscribable{constructor(e={}){super(),this.config=e,this.#a=new Set,this.#l=new Map,this.#u=0}#a;#l;#u;build(e,t,r){let n=new u({client:e,mutationCache:this,mutationId:++this.#u,options:e.defaultMutationOptions(t),state:r});return this.add(n),n}add(e){this.#a.add(e);let t=f(e);if("string"==typeof t){let r=this.#l.get(t);r?r.push(e):this.#l.set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(this.#a.delete(e)){let t=f(e);if("string"==typeof t){let r=this.#l.get(t);if(r)if(r.length>1){let t=r.indexOf(e);-1!==t&&r.splice(t,1)}else r[0]===e&&this.#l.delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){let t=f(e);if("string"!=typeof t)return!0;{let r=this.#l.get(t),n=r?.find(e=>"pending"===e.state.status);return!n||n===e}}runNext(e){let t=f(e);if("string"!=typeof t)return Promise.resolve();{let r=this.#l.get(t)?.find(t=>t!==e&&t.state.isPaused);return r?.continue()??Promise.resolve()}}clear(){n.notifyManager.batch(()=>{this.#a.forEach(e=>{this.notify({type:"removed",mutation:e})}),this.#a.clear(),this.#l.clear()})}getAll(){return Array.from(this.#a)}find(e){let r={exact:!0,...e};return this.getAll().find(e=>(0,t.matchMutation)(r,e))}findAll(e={}){return this.getAll().filter(r=>(0,t.matchMutation)(e,r))}notify(e){n.notifyManager.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return n.notifyManager.batch(()=>Promise.all(e.map(e=>e.continue().catch(t.noop))))}};function f(e){return e.options.scope?.id}var d=e.i(75555),p=e.i(14448);function m(e){return{onFetch:(r,n)=>{let i=r.options,o=r.fetchOptions?.meta?.fetchMore?.direction,a=r.state.data?.pages||[],l=r.state.data?.pageParams||[],u={pages:[],pageParams:[]},s=0,c=async()=>{let n=!1,c=(0,t.ensureQueryFn)(r.options,r.fetchOptions),f=async(e,i,o)=>{let a;if(n)return Promise.reject();if(null==i&&e.pages.length)return Promise.resolve(e);let l=(a={client:r.client,queryKey:r.queryKey,pageParam:i,direction:o?"backward":"forward",meta:r.options.meta},(0,t.addConsumeAwareSignal)(a,()=>r.signal,()=>n=!0),a),u=await c(l),{maxPages:s}=r.options,f=o?t.addToStart:t.addToEnd;return{pages:f(e.pages,u,s),pageParams:f(e.pageParams,i,s)}};if(o&&a.length){let e="backward"===o,t={pages:a,pageParams:l},r=(e?function(e,{pages:t,pageParams:r}){return t.length>0?e.getPreviousPageParam?.(t[0],t,r[0],r):void 0}:h)(i,t);u=await f(t,r,e)}else{let t=e??a.length;do{let e=0===s?l[0]??i.initialPageParam:h(i,u);if(s>0&&null==e)break;u=await f(u,e),s++}while(sr.options.persister?.(c,{client:r.client,queryKey:r.queryKey,meta:r.options.meta,signal:r.signal},n):r.fetchFn=c}}}function h(e,{pages:t,pageParams:r}){let n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}var v=class{#s;#n;#c;#f;#d;#p;#m;#h;constructor(e={}){this.#s=e.queryCache||new o,this.#n=e.mutationCache||new c,this.#c=e.defaultOptions||{},this.#f=new Map,this.#d=new Map,this.#p=0}mount(){this.#p++,1===this.#p&&(this.#m=d.focusManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onFocus())}),this.#h=p.onlineManager.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#s.onOnline())}))}unmount(){this.#p--,0===this.#p&&(this.#m?.(),this.#m=void 0,this.#h?.(),this.#h=void 0)}isFetching(e){return this.#s.findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return this.#n.findAll({...e,status:"pending"}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state.data}ensureQueryData(e){let r=this.defaultQueryOptions(e),n=this.#s.build(this,r),i=n.state.data;return void 0===i?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))&&this.prefetchQuery(r),Promise.resolve(i))}getQueriesData(e){return this.#s.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,r,n){let i=this.defaultQueryOptions({queryKey:e}),o=this.#s.get(i.queryHash),a=o?.state.data,l=(0,t.functionalUpdate)(r,a);if(void 0!==l)return this.#s.build(this,i).setData(l,{...n,manual:!0})}setQueriesData(e,t,r){return n.notifyManager.batch(()=>this.#s.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,r)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#s.get(t.queryHash)?.state}removeQueries(e){let t=this.#s;n.notifyManager.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let r=this.#s;return n.notifyManager.batch(()=>(r.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,r={}){let i={revert:!0,...r};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).map(e=>e.cancel(i)))).then(t.noop).catch(t.noop)}invalidateQueries(e,t={}){return n.notifyManager.batch(()=>(this.#s.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType==="none")?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??"active"},t))}refetchQueries(e,r={}){let i={...r,cancelRefetch:r.cancelRefetch??!0};return Promise.all(n.notifyManager.batch(()=>this.#s.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let r=e.fetch(void 0,i);return i.throwOnError||(r=r.catch(t.noop)),"paused"===e.state.fetchStatus?Promise.resolve():r}))).then(t.noop)}fetchQuery(e){let r=this.defaultQueryOptions(e);void 0===r.retry&&(r.retry=!1);let n=this.#s.build(this,r);return n.isStaleByTime((0,t.resolveStaleTime)(r.staleTime,n))?n.fetch(r):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(t.noop).catch(t.noop)}fetchInfiniteQuery(e){return e.behavior=m(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(t.noop).catch(t.noop)}ensureInfiniteQueryData(e){return e.behavior=m(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return p.onlineManager.isOnline()?this.#n.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#s}getMutationCache(){return this.#n}getDefaultOptions(){return this.#c}setDefaultOptions(e){this.#c=e}setQueryDefaults(e,r){this.#f.set((0,t.hashKey)(e),{queryKey:e,defaultOptions:r})}getQueryDefaults(e){let r=[...this.#f.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,r){this.#d.set((0,t.hashKey)(e),{mutationKey:e,defaultOptions:r})}getMutationDefaults(e){let r=[...this.#d.values()],n={};return r.forEach(r=>{(0,t.partialMatchKey)(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let r={...this.#c.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return r.queryHash||(r.queryHash=(0,t.hashQueryKeyByOptions)(r.queryKey,r)),void 0===r.refetchOnReconnect&&(r.refetchOnReconnect="always"!==r.networkMode),void 0===r.throwOnError&&(r.throwOnError=!!r.suspense),!r.networkMode&&r.persister&&(r.networkMode="offlineFirst"),r.queryFn===t.skipToken&&(r.enabled=!1),r}defaultMutationOptions(e){return e?._defaulted?e:{...this.#c.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#s.clear(),this.#n.clear()}};e.s(["QueryClient",()=>v],17751)},38847,e=>{"use strict";var t=e.i(80902),r=e.i(22289),n=e.i(71645);function i(e,t,n){try{return e(t)}catch(e){return(0,r.l)("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,e,n),null}}function o(e){function t(t){if(void 0===t)return null;let r="";if(Array.isArray(t)){if(void 0===t[0])return null;r=t[0]}return"string"==typeof t&&(r=t),i(e.parse,r)}return{type:"single",eq:(e,t)=>e===t,...e,parseServerSide:t,withDefault(e){return{...this,defaultValue:e,parseServerSide:r=>t(r)??e}},withOptions(e){return{...this,...e}}}}let a=o({parse:e=>e,serialize:String});o({parse:e=>{let t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)}),o({parse:e=>{let t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)}),o({parse:e=>{let t=parseInt(e,16);return t==t?t:null},serialize:e=>{let t=Math.round(e).toString(16);return(1&t.length?"0":"")+t}}),o({parse:e=>{let t=parseFloat(e);return t==t?t:null},serialize:String});let l=o({parse:e=>"true"===e.toLowerCase(),serialize:String});function u(e,t){return e.valueOf()===t.valueOf()}o({parse:e=>{let t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:u}),o({parse:e=>{let t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:u}),o({parse:e=>{let t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:u});let s=(0,t.r)(),c={};function f(e,r,n,o,a,l){let u=!1,s=Object.entries(e).reduce((e,[s,c])=>{var f;let d=r?.[s]??s,p=o[d],m="multi"===c.type?[]:null,h=void 0===p?("multi"===c.type?n?.getAll(d):n?.get(d))??m:p;return a&&l&&((f=a[d]??m)===h||null!==f&&null!==h&&"string"!=typeof f&&"string"!=typeof h&&f.length===h.length&&f.every((e,t)=>e===h[t]))?e[s]=l[s]??null:(u=!0,e[s]=((0,t.i)(h)?null:i(c.parse,h,d))??null,a&&(a[d]=h)),e},{});if(!u){let t=Object.keys(e),r=Object.keys(l??{});u=t.length!==r.length||t.some(e=>!r.includes(e))}return{state:s,hasChanged:u}}function d(e,t){return Object.fromEntries(Object.keys(e).map(r=>[r,e[r]??t[r]??null]))}function p(e,i={}){let{parse:o,type:a,serialize:l,eq:u,defaultValue:m,...h}=i,[{[e]:v},g]=function(e,i={}){let o=(0,n.useId)(),a=(0,r.i)(),l=(0,r.a)(),{history:u="replace",scroll:p=a?.scroll??!1,shallow:m=a?.shallow??!0,throttleMs:h=t.s.timeMs,limitUrlUpdates:v=a?.limitUrlUpdates,clearOnDefault:g=a?.clearOnDefault??!0,startTransition:y,urlKeys:b=c}=i,S=Object.keys(e).join(","),C=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(e=>[e,b[e]??e])),[S,JSON.stringify(b)]),x=(0,r.r)(Object.values(C)),A=x.searchParams,E=(0,n.useRef)({}),w=(0,n.useMemo)(()=>Object.fromEntries(Object.keys(e).map(t=>[t,e[t].defaultValue??null])),[Object.values(e).map(({defaultValue:e})=>e).join(",")]),_=t.t.useQueuedQueries(Object.values(C)),[T,M]=(0,n.useState)(()=>f(e,b,A??new URLSearchParams,_).state),R=(0,n.useRef)(T);if((0,r.c)("[nuq+ %s `%s`] render - state: %O, iSP: %s",o,S,T,A),Object.keys(E.current).join("&")!==Object.values(C).join("&")){let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t)),E.current=Object.fromEntries(Object.entries(C).map(([t,r])=>[r,e[t]?.type==="multi"?A?.getAll(r):A?.get(r)??null]))}(0,n.useEffect)(()=>{let{state:t,hasChanged:n}=f(e,b,A,_,E.current,R.current);n&&((0,r.c)("[nuq+ %s `%s`] State changed: %O",o,S,{state:t,initialSearchParams:A,queuedQueries:_,queryRef:E.current,stateRef:R.current}),R.current=t,M(t))},[Object.values(C).map(e=>`${e}=${A?.getAll(e)}`).join("&"),JSON.stringify(_)]),(0,n.useEffect)(()=>{let t=Object.keys(e).reduce((t,n)=>(t[n]=({state:t,query:i})=>{M(a=>{let{defaultValue:l}=e[n],u=C[n],s=t??l??null;return Object.is(a[n]??l??null,s)?((0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",o,S,u,t,l,R.current),a):(R.current={...R.current,[n]:s},E.current[u]=i,(0,r.c)("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",o,S,u,t,l,R.current),R.current)})},t),{});for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Subscribing to sync for `%s`",o,e,S),s.on(e,t[n])}return()=>{for(let n of Object.keys(e)){let e=C[n];(0,r.c)("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",o,e,S),s.off(e,t[n])}}},[S,C]);let O=(0,n.useCallback)((n,i={})=>{let a,c=Object.fromEntries(Object.keys(e).map(e=>[e,null])),f="function"==typeof n?n(d(R.current,w))??c:n??c;(0,r.c)("[nuq+ %s `%s`] setState: %O",o,S,f);let b=0,A=!1,E=[];for(let[n,o]of Object.entries(f)){let c=e[n],f=C[n];if(!c||void 0===o)continue;(i.clearOnDefault??c.clearOnDefault??g)&&null!==o&&void 0!==c.defaultValue&&(c.eq??((e,t)=>e===t))(o,c.defaultValue)&&(o=null);let d=null===o?null:(c.serialize??String)(o);s.emit(f,{state:o,query:d});let S={key:f,query:d,options:{history:i.history??c.history??u,shallow:i.shallow??c.shallow??m,scroll:i.scroll??c.scroll??p,startTransition:i.startTransition??c.startTransition??y}};if(i?.limitUrlUpdates?.method==="debounce"||v?.method==="debounce"||c.limitUrlUpdates?.method==="debounce"){!0===S.options.shallow&&console.warn((0,r.s)(422));let e=i?.limitUrlUpdates?.timeMs??v?.timeMs??c.limitUrlUpdates?.timeMs??t.s.timeMs,n=t.t.push(S,e,x,l);bt(e),A?t.n.flush(x,l):t.n.getPendingPromise(x));return a??_},[S,u,m,p,h,v?.method,v?.timeMs,y,C,x.updateUrl,x.getSearchParamsSnapshot,x.rateLimitFactor,l,w]);return[(0,n.useMemo)(()=>d(T,w),[T,w]),O]}({[e]:{parse:o??(e=>e),type:a,serialize:l,eq:u,defaultValue:m}},h);return[v,(0,n.useCallback)((t,r={})=>g(r=>({[e]:"function"==typeof t?t(r[e]):t}),r),[e,g])]}e.s(["createParser",()=>o,"parseAsBoolean",()=>l,"parseAsString",()=>a,"useQueryState",()=>p],38847)},38360,(e,t,r)=>{var n={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ả:"A",Ạ:"A",Ẩ:"A",Ẫ:"A",Ậ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ẻ:"E",Ẽ:"E",Ẹ:"E",Ể:"E",Ễ:"E",Ệ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ỉ:"I",Ị:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ỏ:"O",Ọ:"O",Ổ:"O",Ỗ:"O",Ộ:"O",Ờ:"O",Ở:"O",Ỡ:"O",Ớ:"O",Ợ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ủ:"U",Ụ:"U",Ử:"U",Ữ:"U",Ự:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ả:"a",ạ:"a",ẩ:"a",ẫ:"a",ậ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ẻ:"e",ẽ:"e",ẹ:"e",ể:"e",ễ:"e",ệ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ỉ:"i",ị:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ỏ:"o",ọ:"o",ổ:"o",ỗ:"o",ộ:"o",ờ:"o",ở:"o",ỡ:"o",ớ:"o",ợ:"o",ù:"u",ú:"u",û:"u",ü:"u",ủ:"u",ụ:"u",ử:"u",ữ:"u",ự:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z",й:"и",Й:"И",ё:"е",Ё:"Е"},i=Object.keys(n).join("|"),o=RegExp(i,"g"),a=RegExp(i,"");function l(e){return n[e]}var u=function(e){return e.replace(o,l)};t.exports=u,t.exports.has=function(e){return!!e.match(a)},t.exports.remove=u},11889,68754,56373,86447,1559,18364,78440,59129,25998,70238,e=>{"use strict";e.i(47167);var t,r="u">typeof window&&!!(null==(t=window.document)?void 0:t.createElement);function n(e){return e?"self"in e?e.document:e.ownerDocument||document:document}function i(e){return e?"self"in e?e.self:n(e).defaultView||window:self}function o(e,t=!1){var r;let{activeElement:i}=n(e);if(!(null==i?void 0:i.nodeName))return null;if(l(i)&&(null==(r=i.contentDocument)?void 0:r.body))return o(i.contentDocument.body,t);if(t){let e=i.getAttribute("aria-activedescendant");if(e){let t=n(i).getElementById(e);if(t)return t}}return i}function a(e,t){return e===t||e.contains(t)}function l(e){return"IFRAME"===e.tagName}function u(e){let t=e.tagName.toLowerCase();return"button"===t||"input"===t&&!!e.type&&-1!==s.indexOf(e.type)}var s=["button","color","file","image","reset","submit"];function c(e){return"function"==typeof e.checkVisibility?e.checkVisibility():e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0}function f(e){try{let t=e instanceof HTMLInputElement&&null!==e.selectionStart,r="TEXTAREA"===e.tagName;return t||r||!1}catch(e){return!1}}function d(e){return e.isContentEditable||f(e)}function p(e){let t=0,r=0;if(f(e))t=e.selectionStart||0,r=e.selectionEnd||0;else if(e.isContentEditable){let i=n(e).getSelection();if((null==i?void 0:i.rangeCount)&&i.anchorNode&&a(e,i.anchorNode)&&i.focusNode&&a(e,i.focusNode)){let n=i.getRangeAt(0),o=n.cloneRange();o.selectNodeContents(e),o.setEnd(n.startContainer,n.startOffset),t=o.toString().length,o.setEnd(n.endContainer,n.endOffset),r=o.toString().length}}return{start:t,end:r}}function m(e,t){let r=null==e?void 0:e.getAttribute("role");return r&&-1!==["dialog","menu","listbox","tree","grid"].indexOf(r)?r:t}function h(e){if(!e)return null;let t=e=>"auto"===e||"scroll"===e;if(e.clientHeight&&e.scrollHeight>e.clientHeight){let{overflowY:r}=getComputedStyle(e);if(t(r))return e}else if(e.clientWidth&&e.scrollWidth>e.clientWidth){let{overflowX:r}=getComputedStyle(e);if(t(r))return e}return h(e.parentElement)||document.scrollingElement||document.body}function v(e,...t){/text|search|password|tel|url/i.test(e.type)&&e.setSelectionRange(...t)}function g(e,t){return t&&e.item(t)||null}var y=Symbol("FOCUS_SILENTLY");function b(e,t,r){if(!t||t===r)return!1;let n=e.item(t.id);return!!n&&(!r||n.element!==r)}function S(){}function C(e,t){return"function"==typeof Object.hasOwn?Object.hasOwn(e,t):Object.prototype.hasOwnProperty.call(e,t)}function x(...e){return(...t)=>{for(let r of e)"function"==typeof r&&r(...t)}}function A(e){return e}function E(e,t){if(!e){if("string"!=typeof t)throw Error("Invariant failed");throw Error(t)}}function w(e,...t){let r="function"==typeof e?e(...t):e;return null!=r&&!r}function _(e){return e.disabled||!0===e["aria-disabled"]||"true"===e["aria-disabled"]}function T(e){let t={};for(let r in e)void 0!==e[r]&&(t[r]=e[r]);return t}function M(...e){for(let t of e)if(void 0!==t)return t}var R=e.i(71645);function O(e,t){"function"==typeof e?e(t):e&&(e.current=t)}function I(){return r&&!!navigator.maxTouchPoints}function F(){return!!r&&/mac|iphone|ipad|ipod/i.test(navigator.platform)}function L(){return r&&F()&&/apple/i.test(navigator.vendor)}function P(e){return!!(e.currentTarget&&!a(e.currentTarget,e.target))}function D(e){return e.target===e.currentTarget}function B(e,t){let r=new FocusEvent("blur",t),n=e.dispatchEvent(r),i={...t,bubbles:!0};return e.dispatchEvent(new FocusEvent("focusout",i)),n}function G(e,t){let r=new MouseEvent("click",t);return e.dispatchEvent(r)}function k(e,t){let r=t||e.currentTarget,n=e.relatedTarget;return!n||!a(r,n)}function j(e,t,r,n){let i=(e=>{if(n){let t=setTimeout(e,n);return()=>clearTimeout(t)}let t=requestAnimationFrame(e);return()=>cancelAnimationFrame(t)})(()=>{e.removeEventListener(t,o,!0),r()}),o=()=>{i(),r()};return e.addEventListener(t,o,{once:!0,capture:!0}),i}function N(e,t,r,n=window){let i=[];try{for(let o of(n.document.addEventListener(e,t,r),Array.from(n.frames)))i.push(N(e,t,r,o))}catch(e){}return()=>{try{n.document.removeEventListener(e,t,r)}catch(e){}for(let e of i)e()}}var U={...R},q=U.useId;U.useDeferredValue;var V=U.useInsertionEffect,H=r?R.useLayoutEffect:R.useEffect;function W(e){let t=(0,R.useRef)(()=>{throw Error("Cannot call an event handler while rendering.")});return V?V(()=>{t.current=e}):t.current=e,(0,R.useCallback)((...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}function K(...e){return(0,R.useMemo)(()=>{if(e.some(Boolean))return t=>{for(let r of e)O(r,t)}},e)}function z(e){if(q){let t=q();return e||t}let[t,r]=(0,R.useState)(e);return H(()=>{if(e||t)return;let n=Math.random().toString(36).slice(2,8);r(`id-${n}`)},[e,t]),e||t}function Q(e,t){let r=(0,R.useRef)(!1);(0,R.useEffect)(()=>{if(r.current)return e();r.current=!0},t),(0,R.useEffect)(()=>()=>{r.current=!1},[])}function $(){return(0,R.useReducer)(()=>[],[])}function X(e){return W("function"==typeof e?e:()=>e)}function Y(e,t,r=[]){let n=(0,R.useCallback)(r=>(e.wrapElement&&(r=e.wrapElement(r)),t(r)),[...r,e.wrapElement]);return{...e,wrapElement:n}}function Z(e=!1,t){let[r,n]=(0,R.useState)(null);return{portalRef:K(n,t),portalNode:r,domReady:!e||r}}var J=!1,ee=!1,et=0,er=0;function en(e){let t,r;t=e.movementX||e.screenX-et,r=e.movementY||e.screenY-er,et=e.screenX,er=e.screenY,(t||r||0)&&(ee=!0)}function ei(){ee=!1}var eo=e.i(43476);function ea(e){let t=R.forwardRef((t,r)=>e({...t,ref:r}));return t.displayName=e.displayName||e.name,t}function el(e,t){return R.memo(e,t)}function eu(e,t){let r,{wrapElement:n,render:i,...o}=t,a=K(t.ref,i&&(0,R.isValidElement)(i)&&("ref"in i.props||"ref"in i)?({...i.props}).ref||i.ref:null);if(R.isValidElement(i)){let e={...i.props,ref:a};r=R.cloneElement(i,function(e,t){let r={...e};for(let n in t){if(!C(t,n))continue;if("className"===n){let n="className";r[n]=e[n]?`${e[n]} ${t[n]}`:t[n];continue}if("style"===n){let n="style";r[n]=e[n]?{...e[n],...t[n]}:t[n];continue}let i=t[n];if("function"==typeof i&&n.startsWith("on")){let t=e[n];if("function"==typeof t){r[n]=(...e)=>{i(...e),t(...e)};continue}}r[n]=i}return r}(o,e))}else r=i?i(o):(0,eo.jsx)(e,{...o});return n?n(r):r}function es(e){let t=(t={})=>e(t);return t.displayName=e.name,t}function ec(e=[],t=[]){let r=R.createContext(void 0),n=R.createContext(void 0),i=()=>R.useContext(r),o=t=>e.reduceRight((e,r)=>(0,eo.jsx)(r,{...t,children:e}),(0,eo.jsx)(r.Provider,{...t}));return{context:r,scopedContext:n,useContext:i,useScopedContext:(e=!1)=>{let t=R.useContext(n),r=i();return e?t:t||r},useProviderContext:()=>{let e=R.useContext(n),t=i();if(!e||e!==t)return t},ContextProvider:o,ScopedContextProvider:e=>(0,eo.jsx)(o,{...e,children:t.reduceRight((t,r)=>(0,eo.jsx)(r,{...e,children:t}),(0,eo.jsx)(n.Provider,{...e}))})}}var ef=ec(),ed=ef.useContext;ef.useScopedContext,ef.useProviderContext;var ep=ec([ef.ContextProvider],[ef.ScopedContextProvider]),em=ep.useContext;ep.useScopedContext;var eh=ep.useProviderContext,ev=ep.ContextProvider,eg=ep.ScopedContextProvider,ey=(0,R.createContext)(void 0),eb=(0,R.createContext)(void 0),eS=(0,R.createContext)(!0),eC="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function ex(e){return!(!e.matches(eC)||!c(e)||e.closest("[inert]"))}function eA(e){if(!ex(e)||0>Number.parseInt(e.getAttribute("tabindex")||"0",10))return!1;if(!("form"in e)||!e.form||e.checked||"radio"!==e.type)return!0;let t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;let r=o(e);return!r||r===e||!("form"in r)||r.form!==e.form||r.name!==e.name}function eE(e,t){let r=Array.from(e.querySelectorAll(eC));t&&r.unshift(e);let n=r.filter(ex);return n.forEach((e,t)=>{var r;if(!l(e))return;let i=null==(r=e.contentDocument)?void 0:r.body;i&&n.splice(t,1,...eE(i))}),n}function ew(e,t,r){let n=Array.from(e.querySelectorAll(eC)),i=n.filter(eA);return(t&&eA(e)&&i.unshift(e),i.forEach((e,t)=>{var n;if(!l(e))return;let o=null==(n=e.contentDocument)?void 0:n.body;if(!o)return;let a=ew(o,!1,r);i.splice(t,1,...a)}),!i.length&&r)?n:i}function e_(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1)).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eT(e,t){var r;let n,i,a,l;return r=document.body,n=o(r),a=(i=eE(r,!1).reverse()).indexOf(n),(l=i.slice(a+1)).find(eA)||(e?i.find(eA):null)||(t?l[0]:null)||null}function eM(e){let t=o(e);if(!t)return!1;if(t===e)return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&r===e.id}function eR(e){let t=o(e);if(!t)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");return!!r&&"id"in e&&(r===e.id||!!e.querySelector(`#${CSS.escape(r)}`))}function eO(e){!eR(e)&&ex(e)&&e.focus()}var eI=L(),eF=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"],eL=Symbol("safariFocusAncestor");function eP(e){return"input"===e.tagName.toLowerCase()&&!!e.type&&("radio"===e.type||"checkbox"===e.type)}function eD(e,t){return W(r=>{null==e||e(r),!r.defaultPrevented&&t&&(r.stopPropagation(),r.preventDefault())})}var eB=!1,eG=!0;function ek(e){let t=e.target;t&&"hasAttribute"in t&&!t.hasAttribute("data-focus-visible")&&(eG=!1)}function ej(e){e.metaKey||e.ctrlKey||e.altKey||(eG=!0)}var eN=es(function({focusable:e=!0,accessibleWhenDisabled:t,autoFocus:r,onFocusVisible:n,...i}){var o,a,l,s,c;let f=(0,R.useRef)(null);(0,R.useEffect)(()=>{!e||eB||(N("mousedown",ek,!0),N("keydown",ej,!0),eB=!0)},[e]),eI&&(0,R.useEffect)(()=>{if(!e)return;let t=f.current;if(!t||!eP(t))return;let r="labels"in t?t.labels:null;if(!r)return;let n=()=>queueMicrotask(()=>t.focus());for(let e of r)e.addEventListener("mouseup",n);return()=>{for(let e of r)e.removeEventListener("mouseup",n)}},[e]);let d=e&&_(i),p=!!d&&!t,[m,h]=(0,R.useState)(!1);(0,R.useEffect)(()=>{e&&p&&m&&h(!1)},[e,p,m]),(0,R.useEffect)(()=>{if(!e||!m)return;let t=f.current;if(!t||"u"{ex(t)||h(!1)});return r.observe(t),()=>r.disconnect()},[e,m]);let v=eD(i.onKeyPressCapture,d),g=eD(i.onMouseDownCapture,d),y=eD(i.onClickCapture,d),b=i.onMouseDown,S=W(t=>{if(null==b||b(t),t.defaultPrevented||!e)return;let r=t.currentTarget;if(!eI||P(t)||!u(r)&&!eP(r))return;let n=!1,i=()=>{n=!0};r.addEventListener("focusin",i,{capture:!0,once:!0});let o=function(e){for(;e&&!ex(e);)e=e.closest(eC);return e||null}(r.parentElement);o&&(o[eL]=!0),j(r,"mouseup",()=>{r.removeEventListener("focusin",i,!0),o&&(o[eL]=!1),n||eO(r)})}),C=(t,r)=>{if(r&&(t.currentTarget=r),!e)return;let i=t.currentTarget;i&&eM(i)&&(null==n||n(t),t.defaultPrevented||(i.dataset.focusVisible="true",h(!0)))},x=i.onKeyDownCapture,A=W(t=>{if(null==x||x(t),t.defaultPrevented||!e||m||t.metaKey||t.altKey||t.ctrlKey||!D(t))return;let r=t.currentTarget;j(r,"focusout",()=>C(t,r))}),E=i.onFocusCapture,w=W(t=>{if(null==E||E(t),t.defaultPrevented||!e)return;if(!D(t))return void h(!1);let r=t.currentTarget;eG||function(e){let{tagName:t,readOnly:r,type:n}=e;return"TEXTAREA"===t&&!r||"SELECT"===t&&!r||("INPUT"!==t||r?!!e.isContentEditable||"combobox"===e.getAttribute("role")&&!!e.dataset.name:eF.includes(n))}(t.target)?j(t.target,"focusout",()=>C(t,r)):h(!1)}),M=i.onBlur,O=W(t=>{null==M||M(t),!e||k(t)&&(t.currentTarget.removeAttribute("data-focus-visible"),h(!1))}),I=(0,R.useContext)(eS),F=W(t=>{e&&r&&t&&I&&queueMicrotask(()=>{eM(t)||ex(t)&&t.focus()})}),L=function(e,t){let r=e=>{if("string"==typeof e)return e},[n,i]=(0,R.useState)(()=>r(void 0));return H(()=>{let t=e&&"current"in e?e.current:e;i((null==t?void 0:t.tagName.toLowerCase())||r(void 0))},[e,void 0]),n}(f),B=e&&(!L||"button"===L||"summary"===L||"input"===L||"select"===L||"textarea"===L||"a"===L),G=e&&(!L||"button"===L||"input"===L||"select"===L||"textarea"===L),U=i.style,q=(0,R.useMemo)(()=>p?{pointerEvents:"none",...U}:U,[p,U]);return i={"data-focus-visible":e&&m||void 0,"data-autofocus":r||void 0,"aria-disabled":d||void 0,...i,ref:K(f,F,i.ref),style:q,tabIndex:(o=e,a=p,l=B,s=G,c=i.tabIndex,o?a?l&&!s?-1:void 0:l?c:c||0:c),disabled:!!G&&!!p||void 0,contentEditable:d?void 0:i.contentEditable,onKeyPressCapture:v,onClickCapture:y,onMouseDownCapture:g,onMouseDown:S,onKeyDownCapture:A,onFocusCapture:w,onBlur:O},T(i)});function eU(e){let t=[];for(let r of e)t.push(...r);return t}function eq(e){return e.slice().reverse()}function eV(e,t,r){return W(n=>{var i;let o,a;if(null==t||t(n),n.defaultPrevented||n.isPropagationStopped()||!D(n)||"Shift"===n.key||"Control"===n.key||"Alt"===n.key||"Meta"===n.key||(!(o=n.target)||f(o))&&1===n.key.length&&!n.ctrlKey&&!n.metaKey)return;let l=e.getState(),u=null==(i=g(e,l.activeId))?void 0:i.element;if(!u)return;let{view:s,...c}=n;u!==(null==r?void 0:r.current)&&u.focus(),a=new KeyboardEvent(n.type,c),u.dispatchEvent(a)||n.preventDefault(),n.currentTarget.contains(u)&&n.stopPropagation()})}ea(function(e){return eu("div",eN(e))});var eH=es(function({store:e,composite:t=!0,focusOnMove:r=t,moveOnKeyPress:n=!0,...i}){let a=eh();E(e=e||a,!1);let l=(0,R.useRef)(null),u=(0,R.useRef)(null),s=function(e){let[t,r]=(0,R.useState)(!1),n=(0,R.useCallback)(()=>r(!0),[]),i=e.useState(t=>g(e,t.activeId));return(0,R.useEffect)(()=>{let e=null==i?void 0:i.element;!t||e&&(r(!1),e.focus({preventScroll:!0}))},[i,t]),n}(e),c=e.useState("moves"),[,d]=function(e){let[t,r]=(0,R.useState)(null);return H(()=>{if(null==t||!e)return;let r=null;return e(e=>(r=e,t)),()=>{e(r)}},[t,e]),[t,r]}(t?e.setBaseElement:null);(0,R.useEffect)(()=>{var n;if(!e||!c||!t||!r)return;let{activeId:i}=e.getState(),o=null==(n=g(e,i))?void 0:n.element;o&&("scrollIntoView"in o?(o.focus({preventScroll:!0}),o.scrollIntoView({block:"nearest",inline:"nearest",...void 0})):o.focus())},[e,c,t,r]),H(()=>{if(!e||!c||!t)return;let{baseElement:r,activeId:n}=e.getState();if(null!==n||!r)return;let i=u.current;u.current=null,i&&B(i,{relatedTarget:r}),eM(r)||r.focus()},[e,c,t]);let p=e.useState("activeId"),m=e.useState("virtualFocus");H(()=>{var r;if(!e||!t||!m)return;let n=u.current;if(u.current=null,!n)return;let i=(null==(r=g(e,p))?void 0:r.element)||o(n);i!==n&&B(n,{relatedTarget:i})},[e,p,m,t]);let h=eV(e,i.onKeyDownCapture,u),v=eV(e,i.onKeyUpCapture,u),S=i.onFocusCapture,C=W(t=>{var r;let n;if(null==S||S(t),t.defaultPrevented||!e)return;let{virtualFocus:i}=e.getState();if(!i)return;let o=t.relatedTarget,a=(n=(r=t.currentTarget)[y],delete r[y],n);D(t)&&a&&(t.stopPropagation(),u.current=o)}),x=i.onFocus,A=W(r=>{if(null==x||x(r),r.defaultPrevented||!t||!e)return;let{relatedTarget:n}=r,{virtualFocus:i}=e.getState();i?D(r)&&!b(e,n)&&queueMicrotask(s):D(r)&&e.setActiveId(null)}),w=i.onBlurCapture,_=W(t=>{var r;if(null==w||w(t),t.defaultPrevented||!e)return;let{virtualFocus:n,activeId:i}=e.getState();if(!n)return;let o=null==(r=g(e,i))?void 0:r.element,a=t.relatedTarget,l=b(e,a),s=u.current;u.current=null,D(t)&&l?(a===o?s&&s!==a&&B(s,t):o?B(o,t):s&&B(s,t),t.stopPropagation()):!b(e,t.target)&&o&&B(o,t)}),T=i.onKeyDown,M=X(n),O=W(t=>{var r;if(null==T||T(t),t.nativeEvent.isComposing||t.defaultPrevented||!e||!D(t))return;let{orientation:n,renderedItems:i,activeId:o}=e.getState(),a=g(e,o);if(null==(r=null==a?void 0:a.element)?void 0:r.isConnected)return;let l="horizontal"!==n,u="vertical"!==n,s=i.some(e=>!!e.rowId);if(("ArrowLeft"===t.key||"ArrowRight"===t.key||"Home"===t.key||"End"===t.key)&&f(t.currentTarget))return;let c={ArrowUp:(s||l)&&(()=>{if(s){let e=eU(eq(function(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}(i))).find(e=>!e.disabled);return null==e?void 0:e.id}return null==e?void 0:e.last()}),ArrowRight:(s||u)&&e.first,ArrowDown:(s||l)&&e.first,ArrowLeft:(s||u)&&e.last,Home:e.first,End:e.last,PageUp:e.first,PageDown:e.last}[t.key];if(c){let r=c();if(void 0!==r){if(!M(t))return;t.preventDefault(),e.move(r)}}});return i=Y(i,t=>(0,eo.jsx)(ev,{value:e,children:t}),[e]),i={"aria-activedescendant":e.useState(r=>{var n;if(e&&t&&r.virtualFocus)return null==(n=g(e,r.activeId))?void 0:n.id}),...i,ref:K(l,d,i.ref),onKeyDownCapture:h,onKeyUpCapture:v,onFocusCapture:C,onFocus:A,onBlurCapture:_,onKeyDown:O},i=eN({focusable:e.useState(e=>t&&(e.virtualFocus||null===e.activeId)),...i})});ea(function(e){return eu("div",eH(e))});var eW=ec();eW.useContext,eW.useScopedContext;var eK=eW.useProviderContext,ez=ec([eW.ContextProvider],[eW.ScopedContextProvider]);ez.useContext,ez.useScopedContext;var eQ=ez.useProviderContext,e$=ez.ContextProvider,eX=ez.ScopedContextProvider,eY=(0,R.createContext)(void 0),eZ=(0,R.createContext)(void 0),eJ=ec([e$],[eX]);eJ.useContext,eJ.useScopedContext;var e0=eJ.useProviderContext,e1=eJ.ContextProvider,e2=eJ.ScopedContextProvider,e3=es(function({store:e,...t}){let r=e0();return e=e||r,t={...t,ref:K(null==e?void 0:e.setAnchorElement,t.ref)}});ea(function(e){return eu("div",e3(e))});var e4=(0,R.createContext)(void 0),e5=ec([e1,ev],[e2,eg]),e8=e5.useContext,e6=e5.useScopedContext,e9=e5.useProviderContext,e7=e5.ContextProvider,te=e5.ScopedContextProvider,tt=(0,R.createContext)(void 0),tr=(0,R.createContext)(!1);function tn(e,t){let r=e.__unstableInternals;return E(r,"Invalid store"),r[t]}function ti(e,...t){let r=e,n=r,i=Symbol(),o=S,a=new Set,l=new Set,u=new Set,s=new Set,c=new Set,f=new WeakMap,d=new WeakMap,p=(e,t,r=s)=>(r.add(t),d.set(t,e),()=>{var e;null==(e=f.get(t))||e(),f.delete(t),d.delete(t),r.delete(t)}),m=(e,o,a=!1)=>{var u,p;if(!C(r,e))return;let m=(p=r[e],"function"==typeof o?o("function"==typeof p?p():p):o);if(m===r[e])return;if(!a)for(let r of t)null==(u=null==r?void 0:r.setState)||u.call(r,e,m);let h=r;r={...r,[e]:m};let v=Symbol();i=v,l.add(e);let g=(t,n,i)=>{var o;let a=d.get(t);(!a||a.some(t=>i?i.has(t):t===e))&&(null==(o=f.get(t))||o(),f.set(t,t(r,n)))};for(let e of s)g(e,h);queueMicrotask(()=>{if(i!==v)return;let e=r;for(let e of c)g(e,n,l);n=e,l.clear()})},h={getState:()=>r,setState:m,__unstableInternals:{setup:e=>(u.add(e),()=>u.delete(e)),init:()=>{let e=a.size,n=Symbol();a.add(n);let i=()=>{a.delete(n),a.size||o()};if(e)return i;let l=Object.keys(r).map(e=>x(...t.map(t=>{var r;let n=null==(r=null==t?void 0:t.getState)?void 0:r.call(t);if(n&&C(n,e))return tu(t,[e],t=>{m(e,t[e],!0)})}))),s=[];for(let e of u)s.push(e());return o=x(...l,...s,...t.map(ta)),i},subscribe:(e,t)=>p(e,t),sync:(e,t)=>(f.set(t,t(r,r)),p(e,t)),batch:(e,t)=>(f.set(t,t(r,n)),p(e,t,c)),pick:e=>ti(function(e,t){let r={};for(let n of t)C(e,n)&&(r[n]=e[n]);return r}(r,e),h),omit:e=>ti(function(e,t){let r={...e};for(let e of t)C(r,e)&&delete r[e];return r}(r,e),h)}};return h}function to(e,...t){if(e)return tn(e,"setup")(...t)}function ta(e,...t){if(e)return tn(e,"init")(...t)}function tl(e,...t){if(e)return tn(e,"subscribe")(...t)}function tu(e,...t){if(e)return tn(e,"sync")(...t)}function ts(e,...t){if(e)return tn(e,"batch")(...t)}function tc(e,...t){if(e)return tn(e,"omit")(...t)}function tf(...e){var t;let r={};for(let n of e){let e=null==(t=null==n?void 0:n.getState)?void 0:t.call(n);e&&Object.assign(r,e)}let n=ti(r,...e);return Object.assign({},...e,n)}function td(e,t){}function tp(e,t,r){if(!r)return!1;let n=e.find(e=>!e.disabled&&e.value);return(null==n?void 0:n.value)===t}function tm(e,t){return!!t&&null!=e&&(e=e.normalize("NFD").replace(/[\u0300-\u036f]/g,""),t.length>e.length&&0===t.toLowerCase().indexOf(e.toLowerCase()))}var th=es(function({store:e,focusable:t=!0,autoSelect:r=!1,getAutoSelectId:n,setValueOnChange:i,showMinLength:o=0,showOnChange:a,showOnMouseDown:l,showOnClick:u=l,showOnKeyDown:s,showOnKeyPress:c=s,blurActiveItemOnClick:f,setValueOnClick:d=!0,moveOnKeyPress:g=!0,autoComplete:y="list",...b}){var C;let x,A=e9();E(e=e||A,!1);let _=(0,R.useRef)(null),[T,M]=$(),O=(0,R.useRef)(!1),I=(0,R.useRef)(!1),F=e.useState(e=>e.virtualFocus&&r),L="inline"===y||"both"===y,[P,D]=(0,R.useState)(L);C=[L],x=(0,R.useRef)(!1),H(()=>{if(x.current)return(()=>{L&&D(!0)})();x.current=!0},C),H(()=>()=>{x.current=!1},[]);let B=e.useState("value"),G=(0,R.useRef)(void 0);(0,R.useEffect)(()=>tu(e,["selectedValue","activeId"],(e,t)=>{G.current=t.selectedValue}),[]);let N=e.useState(e=>{var t;if(L&&P){if(e.activeValue&&Array.isArray(e.selectedValue)&&(e.selectedValue.includes(e.activeValue)||(null==(t=G.current)?void 0:t.includes(e.activeValue))))return;return e.activeValue}}),U=e.useState("renderedItems"),q=e.useState("open"),V=e.useState("contentElement"),Y=(0,R.useMemo)(()=>{if(!L||!P)return B;if(tp(U,N,F)){if(tm(B,N)){let e=(null==N?void 0:N.slice(B.length))||"";return B+e}return B}return N||B},[L,P,U,N,F,B]);(0,R.useEffect)(()=>{let e=_.current;if(!e)return;let t=()=>D(!0);return e.addEventListener("combobox-item-move",t),()=>{e.removeEventListener("combobox-item-move",t)}},[]),(0,R.useEffect)(()=>{if(!L||!P||!N||!tp(U,N,F)||!tm(B,N))return;let e=S;return queueMicrotask(()=>{let t=_.current;if(!t)return;let{start:r,end:n}=p(t),i=B.length,o=N.length;v(t,i,o),e=()=>{if(!eM(t))return;let{start:e,end:a}=p(t);e!==i||a===o&&v(t,r,n)}}),()=>e()},[T,L,P,N,U,F,B]);let Z=(0,R.useRef)(null),J=W(n),ee=(0,R.useRef)(null);(0,R.useEffect)(()=>{if(!q||!V)return;let t=h(V);if(!t)return;Z.current=t;let r=()=>{O.current=!1},n=()=>{if(!e||!O.current)return;let{activeId:t}=e.getState();null===t||t!==ee.current&&(O.current=!1)},i={passive:!0,capture:!0};return t.addEventListener("wheel",r,i),t.addEventListener("touchmove",r,i),t.addEventListener("scroll",n,i),()=>{t.removeEventListener("wheel",r,!0),t.removeEventListener("touchmove",r,!0),t.removeEventListener("scroll",n,!0)}},[q,V,e]),H(()=>{!B||I.current||(O.current=!0)},[B]),H(()=>{"always"!==F&&q||(O.current=q)},[F,q]);let et=e.useState("resetValueOnSelect");Q(()=>{var t,r;let n=O.current;if(!e||!q||!n&&!et)return;let{baseElement:i,contentElement:o,activeId:a}=e.getState();if(!i||eM(i)){if(null==o?void 0:o.hasAttribute("data-placing")){let e=new MutationObserver(M);return e.observe(o,{attributeFilter:["data-placing"]}),()=>e.disconnect()}if(F&&n){let r,n=J(U),i=void 0!==n?n:null!=(t=null==(r=U.find(e=>{var t;return!e.disabled&&(null==(t=e.element)?void 0:t.getAttribute("role"))!=="tab"}))?void 0:r.id)?t:e.first();ee.current=i,e.move(null!=i?i:null)}else{let t=null==(r=e.item(a||e.first()))?void 0:r.element;t&&"scrollIntoView"in t&&t.scrollIntoView({block:"nearest",inline:"nearest"})}}},[e,q,T,B,F,et,J,U]),(0,R.useEffect)(()=>{if(!L)return;let t=_.current;if(!t)return;let r=[t,V].filter(e=>!!e),n=t=>{r.every(e=>k(t,e))&&(null==e||e.setValue(Y))};for(let e of r)e.addEventListener("focusout",n);return()=>{for(let e of r)e.removeEventListener("focusout",n)}},[L,V,e,Y]);let er=e=>e.currentTarget.value.length>=o,en=b.onChange,ei=X(null!=a?a:er),eo=X(null!=i?i:!e.tag),ea=W(t=>{if(null==en||en(t),t.defaultPrevented||!e)return;let r=t.currentTarget,{value:n,selectionStart:i,selectionEnd:o}=r,a=t.nativeEvent;if(O.current=!0,"input"===a.type&&(a.isComposing&&(O.current=!1,I.current=!0),L)){let e="insertText"===a.inputType||"insertCompositionText"===a.inputType,t=i===n.length;D(e&&t)}if(eo(t)){let t=n===e.getState().value;e.setValue(n),queueMicrotask(()=>{v(r,i,o)}),L&&F&&t&&M()}ei(t)&&e.show(),F&&O.current||e.setActiveId(null)}),el=b.onCompositionEnd,eu=W(e=>{O.current=!0,I.current=!1,null==el||el(e),e.defaultPrevented||F&&M()}),es=b.onMouseDown,ec=X(null!=f?f:()=>!!(null==e?void 0:e.getState().includesBaseElement)),ef=X(d),ed=X(null!=u?u:er),ep=W(t=>{null==es||es(t),t.defaultPrevented||t.button||t.ctrlKey||e&&(ec(t)&&e.setActiveId(null),ef(t)&&e.setValue(Y),ed(t)&&j(t.currentTarget,"mouseup",e.show))}),em=b.onKeyDown,eh=X(null!=c?c:er),ev=W(t=>{if(null==em||em(t),t.repeat||(O.current=!1),t.defaultPrevented||t.ctrlKey||t.altKey||t.shiftKey||t.metaKey||!e)return;let{open:r}=e.getState();!r&&("ArrowUp"===t.key||"ArrowDown"===t.key)&&eh(t)&&(t.preventDefault(),e.show())}),eg=b.onBlur,ey=W(e=>{if(O.current=!1,null==eg||eg(e),e.defaultPrevented)return}),eb=z(b.id),eS=e.useState(e=>null===e.activeId);return b={id:eb,role:"combobox","aria-autocomplete":"inline"===y||"list"===y||"both"===y||"none"===y?y:void 0,"aria-haspopup":m(V,"listbox"),"aria-expanded":q,"aria-controls":null==V?void 0:V.id,"data-active-item":eS||void 0,value:Y,...b,ref:K(_,b.ref),onChange:ea,onCompositionEnd:eu,onMouseDown:ep,onKeyDown:ev,onBlur:ey},b=eH({store:e,focusable:t,...b,moveOnKeyPress:e=>!w(g,e)&&(L&&D(!0),!0)}),{autoComplete:"off",...b=e3({store:e,...b})}}),tv=ea(function(e){return eu("input",th(e))});function tg(e){let t=e.relatedTarget;return(null==t?void 0:t.nodeType)===Node.ELEMENT_NODE?t:null}e.s(["Combobox",()=>tv],11889);var ty=Symbol("composite-hover"),tb=es(function({store:e,focusOnHover:t=!0,blurOnHoverEnd:r=!!t,...n}){let i=em();E(e=e||i,!1);let o=((0,R.useEffect)(()=>{J||(N("mousemove",en,!0),N("mousedown",ei,!0),N("mouseup",ei,!0),N("keydown",ei,!0),N("scroll",ei,!0),J=!0)},[]),W(()=>ee)),l=n.onMouseMove,u=X(t),s=W(t=>{if((null==l||l(t),!t.defaultPrevented&&o())&&u(t)){if(!eR(t.currentTarget)){let t=null==e?void 0:e.getState().baseElement;t&&!eM(t)&&t.focus()}null==e||e.setActiveId(t.currentTarget.id)}}),c=n.onMouseLeave,f=X(r),d=W(t=>{var r;let n;null==c||c(t),!t.defaultPrevented&&o()&&((n=tg(t))&&a(t.currentTarget,n)||function(e){let t=tg(e);if(!t)return!1;do{if(C(t,ty)&&t[ty])return!0;t=t.parentElement}while(t)return!1}(t)||!u(t)||f(t)&&(null==e||e.setActiveId(null),null==(r=null==e?void 0:e.getState().baseElement)||r.focus()))}),p=(0,R.useCallback)(e=>{e&&(e[ty]=!0)},[]);return T(n={...n,ref:K(p,n.ref),onMouseMove:s,onMouseLeave:d})});el(ea(function(e){return eu("div",tb(e))}));var tS=es(function({store:e,shouldRegisterItem:t=!0,getItem:r=A,element:n,...i}){let o=ed();e=e||o;let a=z(i.id),l=(0,R.useRef)(n);return(0,R.useEffect)(()=>{let n=l.current;if(!a||!n||!t)return;let i=r({id:a,element:n});return null==e?void 0:e.renderItem(i)},[a,t,r,e]),T(i={...i,ref:K(l,i.ref)})});function tC(e){if(!e.isTrusted)return!1;let t=e.currentTarget;return"Enter"===e.key?u(t)||"SUMMARY"===t.tagName||"A"===t.tagName:" "===e.key&&(u(t)||"SUMMARY"===t.tagName||"INPUT"===t.tagName||"SELECT"===t.tagName)}ea(function(e){return eu("div",tS(e))});var tx=Symbol("command"),tA=es(function({clickOnEnter:e=!0,clickOnSpace:t=!0,...n}){let i,o,a=(0,R.useRef)(null),[l,s]=(0,R.useState)(!1);(0,R.useEffect)(()=>{a.current&&s(u(a.current))},[]);let[c,d]=(0,R.useState)(!1),p=(0,R.useRef)(!1),m=_(n),[h,v]=(i=n.onLoadedMetadataCapture,o=(0,R.useMemo)(()=>Object.assign(()=>{},{...i,[tx]:!0}),[i,tx,!0]),[null==i?void 0:i[tx],{onLoadedMetadataCapture:o}]),g=n.onKeyDown,y=W(n=>{null==g||g(n);let i=n.currentTarget;if(n.defaultPrevented||h||m||!D(n)||f(i)||i.isContentEditable)return;let o=e&&"Enter"===n.key,a=t&&" "===n.key,l="Enter"===n.key&&!e,u=" "===n.key&&!t;if(l||u)return void n.preventDefault();if(o||a){let e=tC(n);if(o){if(!e){n.preventDefault();let{view:e,...t}=n,o=()=>G(i,t);r&&/firefox\//i.test(navigator.userAgent)?j(i,"keyup",o):queueMicrotask(o)}}else a&&(p.current=!0,e||(n.preventDefault(),d(!0)))}}),b=n.onKeyUp,S=W(e=>{if(null==b||b(e),e.defaultPrevented||h||m||e.metaKey)return;let r=t&&" "===e.key;if(p.current&&r&&(p.current=!1,!tC(e))){e.preventDefault(),d(!1);let t=e.currentTarget,{view:r,...n}=e;queueMicrotask(()=>G(t,n))}});return eN(n={"data-active":c||void 0,type:l?"button":void 0,...v,...n,ref:K(a,n.ref),onKeyDown:y,onKeyUp:S})});ea(function(e){return eu("button",tA(e))});var{useSyncExternalStore:tE}=e.i(2239).default,tw=()=>()=>{};function t_(e,t=A){let r=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),n=()=>{let r="string"==typeof t?t:null,n="function"==typeof t?t:null,i=null==e?void 0:e.getState();return n?n(i):i&&r&&C(i,r)?i[r]:void 0};return tE(r,n,n)}function tT(e,t){let r=R.useRef({}),n=R.useCallback(t=>e?tl(e,null,t):tw(),[e]),i=()=>{let n=null==e?void 0:e.getState(),i=!1,o=r.current;for(let e in t){let r=t[e];if("function"==typeof r){let t=r(n);t!==o[e]&&(o[e]=t,i=!0)}if("string"==typeof r){if(!n||!C(n,r))continue;let t=n[r];t!==o[e]&&(o[e]=t,i=!0)}}return i&&(r.current={...o}),r.current};return tE(n,i,i)}function tM(e,t,r,n){var i;let o,a=C(t,r)?t[r]:void 0,l=(i={value:a,setValue:n?t[n]:void 0},o=(0,R.useRef)(i),H(()=>{o.current=i}),o);H(()=>tu(e,[r],(e,t)=>{let{value:n,setValue:i}=l.current;i&&e[r]!==t[r]&&e[r]!==n&&i(e[r])}),[e,r]),H(()=>{if(void 0!==a)return e.setState(r,a),ts(e,[r],()=>{void 0!==a&&e.setState(r,a)})})}function tR(e,t){let[r,n]=R.useState(()=>e(t));H(()=>ta(r),[r]);let i=R.useCallback(e=>t_(r,e),[r]);return[R.useMemo(()=>({...r,useState:i}),[r,i]),W(()=>{n(r=>e({...t,...r.getState()}))})]}function tO(e,t,r,n=!1){var i;let o,a;if(!t||!r)return;let{renderedItems:l}=t.getState(),u=h(e);if(!u)return;let s=function(e,t=!1){let r=e.clientHeight,{top:n}=e.getBoundingClientRect(),i=1.5*Math.max(.875*r,r-40),o=t?r-i+n:i+n;return"HTML"===e.tagName?o+e.scrollTop:o}(u,n);for(let e=0;e=0){void 0!==a&&atR,"useStoreProps",()=>tM,"useStoreState",()=>t_,"useStoreStateObject",()=>tT],68754);var tI=es(function({store:e,rowId:t,preventScrollOnKeyDown:r=!1,moveOnKeyPress:i=!0,tabbable:o=!1,getItem:a,"aria-setsize":l,"aria-posinset":s,...c}){let m=em();e=e||m;let h=z(c.id),v=(0,R.useRef)(null),g=(0,R.useContext)(eb),S=_(c)&&!c.accessibleWhenDisabled,{rowId:C,baseElement:x,isActiveItem:A,ariaSetSize:E,ariaPosInSet:w,isTabbable:M}=tT(e,{rowId:e=>t||(e&&(null==g?void 0:g.baseElement)&&g.baseElement===e.baseElement?g.id:void 0),baseElement:e=>(null==e?void 0:e.baseElement)||void 0,isActiveItem:e=>!!e&&e.activeId===h,ariaSetSize:e=>null!=l?l:e&&(null==g?void 0:g.ariaSetSize)&&g.baseElement===e.baseElement?g.ariaSetSize:void 0,ariaPosInSet(e){if(null!=s)return s;if(!e||!(null==g?void 0:g.ariaPosInSet)||g.baseElement!==e.baseElement)return;let t=e.renderedItems.filter(e=>e.rowId===C);return g.ariaPosInSet+t.findIndex(e=>e.id===h)},isTabbable(t){if(!(null==t?void 0:t.renderedItems.length))return!0;if(t.virtualFocus)return!1;if(o)return!0;if(null===t.activeId)return!1;let r=null==e?void 0:e.item(t.activeId);return null!=r&&!!r.disabled||null==r||!r.element||t.activeId===h}}),O=(0,R.useCallback)(e=>{var t;let r={...e,id:h||e.id,rowId:C,disabled:!!S,children:null==(t=e.element)?void 0:t.textContent};return a?a(r):r},[h,C,S,a]),I=c.onFocus,F=(0,R.useRef)(!1),B=W(t=>{var r,i;if(null==I||I(t),t.defaultPrevented||P(t)||!h||!e||(r=e,!D(t)&&b(r,t.target)))return;let{virtualFocus:o,baseElement:a}=e.getState();e.setActiveId(h),d(t.currentTarget)&&function(e,t=!1){if(f(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){let r=n(e).getSelection();null==r||r.selectAllChildren(e),t&&(null==r||r.collapseToEnd())}}(t.currentTarget),!o||!D(t)||!d(i=t.currentTarget)&&("INPUT"!==i.tagName||u(i))&&(null==a?void 0:a.isConnected)&&((L()&&t.currentTarget.hasAttribute("data-autofocus")&&t.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),F.current=!0,t.relatedTarget===a||b(e,t.relatedTarget))?(a[y]=!0,a.focus({preventScroll:!0})):a.focus())}),G=c.onBlurCapture,k=W(t=>{if(null==G||G(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState();(null==r?void 0:r.virtualFocus)&&F.current&&(F.current=!1,t.preventDefault(),t.stopPropagation())}),j=c.onKeyDown,N=X(r),U=X(i),q=W(t=>{if(null==j||j(t),t.defaultPrevented||!D(t)||!e)return;let{currentTarget:r}=t,i=e.getState(),o=e.item(h),a=!!(null==o?void 0:o.rowId),l="horizontal"!==i.orientation,u="vertical"!==i.orientation,s=()=>!(!a&&!u&&i.baseElement&&f(i.baseElement)),c={ArrowUp:(a||l)&&e.up,ArrowRight:(a||u)&&e.next,ArrowDown:(a||l)&&e.down,ArrowLeft:(a||u)&&e.previous,Home:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.first():null==e?void 0:e.previous(-1)},End:()=>{if(s())return!a||t.ctrlKey?null==e?void 0:e.last():null==e?void 0:e.next(-1)},PageUp:()=>tO(r,e,null==e?void 0:e.up,!0),PageDown:()=>tO(r,e,null==e?void 0:e.down)}[t.key];if(c){if(d(r)){let e=p(r),i=u&&"ArrowLeft"===t.key,o=u&&"ArrowRight"===t.key,a=l&&"ArrowUp"===t.key,s=l&&"ArrowDown"===t.key;if(o||s){let{length:t}=function(e){if(f(e))return e.value;if(e.isContentEditable){let t=n(e).createRange();return t.selectNodeContents(e),t.toString()}return""}(r);if(e.end!==t)return}else if((i||a)&&0!==e.start)return}let i=c();if(N(t)||void 0!==i){if(!U(t))return;t.preventDefault(),e.move(i)}}}),V=(0,R.useMemo)(()=>({id:h,baseElement:x}),[h,x]);return c={id:h,"data-active-item":A||void 0,...c=Y(c,e=>(0,eo.jsx)(ey.Provider,{value:V,children:e}),[V]),ref:K(v,c.ref),tabIndex:M?c.tabIndex:-1,onFocus:B,onBlurCapture:k,onKeyDown:q},c=tA(c),T({...c=tS({store:e,...c,getItem:O,shouldRegisterItem:!!h&&c.shouldRegisterItem}),"aria-setsize":E,"aria-posinset":w})});el(ea(function(e){return eu("button",tI(e))}));var tF=es(function({store:e,value:t,hideOnClick:r,setValueOnClick:n,selectValueOnClick:i=!0,resetValueOnSelect:o,focusOnHover:a=!1,moveOnKeyPress:l=!0,getItem:u,...s}){var c,d;let p=e6();E(e=e||p,!1);let{resetValueOnSelectState:m,multiSelectable:h,selected:v}=tT(e,{resetValueOnSelectState:"resetValueOnSelect",multiSelectable:e=>Array.isArray(e.selectedValue),selected:e=>(function(e,t){if(null!=t)return null!=e&&(Array.isArray(e)?e.includes(t):e===t)})(e.selectedValue,t)}),g=(0,R.useCallback)(e=>{let r={...e,value:t};return u?u(r):r},[t,u]);n=null!=n?n:!h,r=null!=r?r:null!=t&&!h;let y=s.onClick,b=X(n),S=X(i),C=X(null!=(c=null!=o?o:m)?c:h),x=X(r),A=W(r=>{null==y||y(r),r.defaultPrevented||function(e){let t=e.currentTarget;if(!t)return!1;let r=t.tagName.toLowerCase();return!!e.altKey&&("a"===r||"button"===r&&"submit"===t.type||"input"===r&&"submit"===t.type)}(r)||!function(e){let t=e.currentTarget;if(!t)return!1;let r=F();if(r&&!e.metaKey||!r&&!e.ctrlKey)return!1;let n=t.tagName.toLowerCase();return"a"===n||"button"===n&&"submit"===t.type||"input"===n&&"submit"===t.type}(r)&&(null!=t&&(S(r)&&(C(r)&&(null==e||e.resetValue()),null==e||e.setSelectedValue(e=>Array.isArray(e)?e.includes(t)?e.filter(e=>e!==t):[...e,t]:t)),b(r)&&(null==e||e.setValue(t))),x(r)&&(null==e||e.hide()))}),w=s.onKeyDown,_=W(t=>{if(null==w||w(t),t.defaultPrevented)return;let r=null==e?void 0:e.getState().baseElement;!r||eM(r)||(1===t.key.length||"Backspace"===t.key||"Delete"===t.key)&&(queueMicrotask(()=>r.focus()),f(r)&&(null==e||e.setValue(r.value)))});h&&null!=v&&(s={"aria-selected":v,...s}),s=Y(s,e=>(0,eo.jsx)(tt.Provider,{value:t,children:(0,eo.jsx)(tr.Provider,{value:null!=v&&v,children:e})}),[t,v]),s={role:null!=(d=({menu:"menuitem",listbox:"option",tree:"treeitem"})[(0,R.useContext)(e4)])?d:"option",children:t,...s,onClick:A,onKeyDown:_};let T=X(l);return s=tI({store:e,...s,getItem:g,moveOnKeyPress:t=>{if(!T(t))return!1;let r=new Event("combobox-item-move"),n=null==e?void 0:e.getState().baseElement;return null==n||n.dispatchEvent(r),!0}}),s=tb({store:e,focusOnHover:a,...s})}),tL=el(ea(function(e){return eu("div",tF(e))}));e.s(["ComboboxItem",()=>tL],56373);var tP=e.i(74080);function tD(e,t){let r=setTimeout(t,e);return()=>clearTimeout(r)}function tB(...e){return e.join(", ").split(", ").reduce((e,t)=>{let r=t.endsWith("ms")?1:1e3,n=Number.parseFloat(t||"0s")*r;return n>e?n:e},0)}function tG(e,t,r){return!r&&!1!==t&&(!e||!!t)}var tk=es(function({store:e,alwaysVisible:t,...r}){let n=eK();E(e=e||n,!1);let i=(0,R.useRef)(null),o=z(r.id),[a,l]=(0,R.useState)(null),u=e.useState("open"),s=e.useState("mounted"),c=e.useState("animated"),f=e.useState("contentElement"),d=t_(e.disclosure,"contentElement");H(()=>{i.current&&(null==e||e.setContentElement(i.current))},[e]),H(()=>{let t;return null==e||e.setState("animated",e=>(t=e,!0)),()=>{void 0!==t&&(null==e||e.setState("animated",t))}},[e]),H(()=>{if(c){var e;let t;return(null==f?void 0:f.isConnected)?(e=()=>{l(u?"enter":s?"leave":null)},t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)}),()=>cancelAnimationFrame(t)):void l(null)}},[c,f,u,s]),H(()=>{if(!e||!c||!a||!f)return;let t=()=>null==e?void 0:e.setState("animating",!1),r=()=>(0,tP.flushSync)(t);if("leave"===a&&u||"enter"===a&&!u)return;if("number"==typeof c)return tD(c,r);let{transitionDuration:n,animationDuration:i,transitionDelay:o,animationDelay:l}=getComputedStyle(f),{transitionDuration:s="0",animationDuration:p="0",transitionDelay:m="0",animationDelay:h="0"}=d?getComputedStyle(d):{},v=tB(o,l,m,h)+tB(n,i,s,p);if(!v){"enter"===a&&e.setState("animated",!1),t();return}return tD(Math.max(v-1e3/60,0),r)},[e,c,f,d,u,a]);let p=tG(s,(r=Y(r,t=>(0,eo.jsx)(eX,{value:e,children:t}),[e])).hidden,t),m=r.style,h=(0,R.useMemo)(()=>p?{...m,display:"none"}:m,[p,m]);return T(r={id:o,"data-open":u||void 0,"data-enter":"enter"===a||void 0,"data-leave":"leave"===a||void 0,hidden:p,...r,ref:K(o?e.setContentElement:null,i,r.ref),style:h})}),tj=ea(function(e){return eu("div",tk(e))});ea(function({unmountOnHide:e,...t}){let r=eK();return!1===t_(t.store||r,t=>!e||(null==t?void 0:t.mounted))?null:(0,eo.jsx)(tj,{...t})});var tN=es(function({store:e,alwaysVisible:t,...r}){let n=e6(!0),i=e8(),o=!!(e=e||i)&&e===n;E(e,!1);let a=(0,R.useRef)(null),l=z(r.id),u=e.useState("mounted"),s=tG(u,r.hidden,t),c=s?{...r.style,display:"none"}:r.style,f=e.useState(e=>Array.isArray(e.selectedValue)),d=function(e,t,r){let n=function(e){let[t]=(0,R.useState)(e);return t}(r),[i,o]=(0,R.useState)(n);return(0,R.useEffect)(()=>{let r=e&&"current"in e?e.current:e;if(!r)return;let i=()=>{let e=r.getAttribute(t);o(null==e?n:e)},a=new MutationObserver(i);return a.observe(r,{attributeFilter:[t]}),i(),()=>a.disconnect()},[e,t,n]),i}(a,"role",r.role),p="listbox"===d||"tree"===d||"grid"===d,[m,h]=(0,R.useState)(!1),v=e.useState("contentElement");H(()=>{if(!u)return;let e=a.current;if(!e||v!==e)return;let t=()=>{h(!!e.querySelector("[role='listbox']"))},r=new MutationObserver(t);return r.observe(e,{subtree:!0,childList:!0,attributeFilter:["role"]}),t(),()=>r.disconnect()},[u,v]),m||(r={role:"listbox","aria-multiselectable":p&&f||void 0,...r}),r=Y(r,t=>(0,eo.jsx)(te,{value:e,children:(0,eo.jsx)(e4.Provider,{value:d,children:t})}),[e,d]);let g=!l||n&&o?null:e.setContentElement;return T(r={id:l,hidden:s,...r,ref:K(g,a,r.ref),style:c})}),tU=ea(function(e){return eu("div",tN(e))});e.s(["ComboboxList",()=>tU,"useComboboxList",()=>tN],86447);var tq=(0,R.createContext)(null),tV=es(function(e){return{...e,style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px",...e.style}}});ea(function(e){return eu("span",tV(e))});var tH=es(function(e){return tV(e={"data-focus-trap":"",tabIndex:0,"aria-hidden":!0,...e,style:{position:"fixed",top:0,left:0,...e.style}})}),tW=ea(function(e){return eu("span",tH(e))});function tK(e){queueMicrotask(()=>{null==e||e.focus()})}var tz=es(function({preserveTabOrder:e,preserveTabOrderAnchor:t,portalElement:r,portalRef:i,portal:o=!0,...a}){let l=(0,R.useRef)(null),u=K(l,a.ref),s=(0,R.useContext)(tq),[c,f]=(0,R.useState)(null),[d,p]=(0,R.useState)(null),m=(0,R.useRef)(null),h=(0,R.useRef)(null),v=(0,R.useRef)(null),g=(0,R.useRef)(null);return H(()=>{let e=l.current;if(!e||!o)return void f(null);let t=r?"function"==typeof r?r(e):r:n(e).createElement("div");if(!t)return void f(null);let a=t.isConnected;if(a||(s||n(e).body).appendChild(t),t.id||(t.id=e.id?`portal/${e.id}`:function(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).slice(2,8)}`}()),f(t),O(i,t),!a)return()=>{t.remove(),O(i,null)}},[o,r,s,i]),H(()=>{if(!o||!e||!t)return;let r=n(t).createElement("span");return r.style.position="fixed",t.insertAdjacentElement("afterend",r),p(r),()=>{r.remove(),p(null)}},[o,e,t]),(0,R.useEffect)(()=>{if(!c||!e)return;let t=0,r=e=>{if(!k(e))return;let r="focusin"===e.type;if(cancelAnimationFrame(t),r){let e=c.querySelectorAll("[data-tabindex]"),t=e=>{let t=e.getAttribute("data-tabindex");e.removeAttribute("data-tabindex"),t?e.setAttribute("tabindex",t):e.removeAttribute("tabindex")};for(let r of(c.hasAttribute("data-tabindex")&&t(c),e))t(r);return}t=requestAnimationFrame(()=>{for(let e of ew(c,!0))!function(e){var t;let r=null!=(t=e.getAttribute("tabindex"))?t:"";e.setAttribute("data-tabindex",r),e.setAttribute("tabindex","-1")}(e)})};return c.addEventListener("focusin",r,!0),c.addEventListener("focusout",r,!0),()=>{cancelAnimationFrame(t),c.removeEventListener("focusin",r,!0),c.removeEventListener("focusout",r,!0)}},[c,e]),a={...a=Y(a,t=>{if(t=(0,eo.jsx)(tq.Provider,{value:c||s,children:t}),!o)return t;if(!c)return(0,eo.jsx)("span",{ref:u,id:a.id,style:{position:"fixed"},hidden:!0});t=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:h,"data-focus-trap":a.id,className:"__focus-trap-inner-before",onFocus:e=>{k(e,c)?tK(e_()):tK(m.current)}}),t,e&&c&&(0,eo.jsx)(tW,{ref:v,"data-focus-trap":a.id,className:"__focus-trap-inner-after",onFocus:e=>{k(e,c)?tK(eT()):tK(g.current)}})]}),c&&(t=(0,tP.createPortal)(t,c));let r=(0,eo.jsxs)(eo.Fragment,{children:[e&&c&&(0,eo.jsx)(tW,{ref:m,"data-focus-trap":a.id,className:"__focus-trap-outer-before",onFocus:e=>{e.relatedTarget!==g.current&&k(e,c)?tK(h.current):tK(eT())}}),e&&(0,eo.jsx)("span",{"aria-owns":null==c?void 0:c.id,style:{position:"fixed"}}),e&&c&&(0,eo.jsx)(tW,{ref:g,"data-focus-trap":a.id,className:"__focus-trap-outer-after",onFocus:e=>{if(k(e,c))tK(v.current);else{let e=e_();if(e===h.current)return void requestAnimationFrame(()=>{var e;return null==(e=e_())?void 0:e.focus()});tK(e)}}})]});return d&&e&&(r=(0,tP.createPortal)(r,d)),(0,eo.jsxs)(eo.Fragment,{children:[r,t]})},[c,s,o,a.id,e,d]),ref:u}});ea(function(e){return eu("div",tz(e))});var tQ=(0,R.createContext)(0);function t$({level:e,children:t}){let r=(0,R.useContext)(tQ),n=Math.max(Math.min(e||r+1,6),1);return(0,eo.jsx)(tQ.Provider,{value:n,children:t})}var tX=es(function({autoFocusOnShow:e=!0,...t}){return Y(t,t=>(0,eo.jsx)(eS.Provider,{value:e,children:t}),[e])});ea(function(e){return eu("div",tX(e))});var tY=new WeakMap;function tZ(e,t,r){tY.has(e)||tY.set(e,new Map);let n=tY.get(e),i=n.get(t);if(!i)return n.set(t,r()),()=>{var e;null==(e=n.get(t))||e(),n.delete(t)};let o=r(),a=()=>{o(),i(),n.delete(t)};return n.set(t,a),()=>{n.get(t)===a&&(o(),n.set(t,i))}}function tJ(e,t,r){return tZ(e,t,()=>{let n=e.getAttribute(t);return e.setAttribute(t,r),()=>{null==n?e.removeAttribute(t):e.setAttribute(t,n)}})}function t0(e,t,r){return tZ(e,t,()=>{let n=t in e,i=e[t];return e[t]=r,()=>{n?e[t]=i:delete e[t]}})}function t1(e,t){return e?tZ(e,"style",()=>{let r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var t2=["SCRIPT","STYLE"];function t3(e){return`__ariakit-dialog-snapshot-${e}`}function t4(e,t,r,i){for(let o of t){if(!(null==o?void 0:o.isConnected))continue;let l=t.some(e=>!!e&&e!==o&&e.contains(o)),u=n(o),s=o;for(;o.parentElement&&o!==u.body;){if(null==i||i(o.parentElement,s),!l)for(let i of o.parentElement.children)(function(e,t,r){return!t2.includes(t.tagName)&&!!function(e,t){let r=n(t),i=t3(e);if(!r.body[i])return!0;for(;;){if(t===r.body)return!1;if(t[i])return!0;if(!t.parentElement)return!1;t=t.parentElement}}(e,t)&&!r.some(e=>e&&a(t,e))})(e,i,t)&&r(i,s);o=o.parentElement}}}function t5(e,...t){if(!e)return!1;let r=e.getAttribute("data-backdrop");return null!=r&&(""===r||"true"===r||!t.length||t.some(e=>r===e))}function t8(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function t6(e,t=""){return x(t0(e,t8("",!0),!0),t0(e,t8(t,!0),!0))}function t9(e,t){if(e[t8(t,!0)])return!0;let r=t8(t);for(;;){if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}}function t7(e,t){let r=[],n=t.map(e=>null==e?void 0:e.id);return t4(e,t,t=>{t5(t,...n)||r.unshift(function(e,t=""){return x(t0(e,t8(),!0),t0(e,t8(t),!0))}(t,e))},(t,n)=>{n.hasAttribute("data-dialog")&&n.id!==e||r.unshift(t6(t,e))}),()=>{for(let e of r)e()}}function re({store:e,type:t,listener:r,capture:i,domReady:o}){let l=W(r),u=t_(e,"open"),s=(0,R.useRef)(!1);H(()=>{if(!u||!o)return;let{contentElement:t}=e.getState();if(!t)return;let r=()=>{s.current=!0};return t.addEventListener("focusin",r,!0),()=>t.removeEventListener("focusin",r,!0)},[e,u,o]),(0,R.useEffect)(()=>{if(u)return N(t,t=>{let{contentElement:r,disclosureElement:i}=e.getState(),o=t.target;!r||!o||!(!("HTML"===o.tagName||a(n(o).body,o))||a(r,o)||function(e,t){if(!e)return!1;if(a(e,t))return!0;let r=t.getAttribute("aria-activedescendant");if(r){let t=n(e).getElementById(r);if(t)return a(e,t)}return!1}(i,o)||o.hasAttribute("data-focus-trap")||function(e,t){if(!("clientY"in e))return!1;let r=t.getBoundingClientRect();return 0!==r.width&&0!==r.height&&r.top<=e.clientY&&e.clientY<=r.top+r.height&&r.left<=e.clientX&&e.clientX<=r.left+r.width}(t,r))&&(!s.current||t9(o,r.id))&&(o&&o[eL]||l(t))},i)},[u,i])}function rt(e,t){return"function"==typeof e?e(t):!!e}var rr=(0,R.createContext)({});function rn(){return"inert"in HTMLElement.prototype}function ri(e,t){if(!("style"in e))return S;if(rn())return t0(e,"inert",!0);let r=ew(e,!0).map(e=>{if(null==t?void 0:t.some(t=>t&&a(t,e)))return S;let r=tZ(e,"focus",()=>(e.focus=S,()=>{delete e.focus}));return x(tJ(e,"tabindex","-1"),r)});return x(...r,tJ(e,"aria-hidden","true"),t1(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ro(e={}){let t=tf(e.store,tc(e.disclosure,["contentElement","disclosureElement"]));td(e,t);let r=null==t?void 0:t.getState(),n=M(e.open,null==r?void 0:r.open,e.defaultOpen,!1),i=M(e.animated,null==r?void 0:r.animated,!1),o=ti({open:n,animated:i,animating:!!i&&n,mounted:n,contentElement:M(null==r?void 0:r.contentElement,null),disclosureElement:M(null==r?void 0:r.disclosureElement,null)},t);return to(o,()=>tu(o,["animated","animating"],e=>{e.animated||o.setState("animating",!1)})),to(o,()=>tl(o,["open"],()=>{o.getState().animated&&o.setState("animating",!0)})),to(o,()=>tu(o,["open","animating"],e=>{o.setState("mounted",e.open||e.animating)})),{...o,disclosure:e.disclosure,setOpen:e=>o.setState("open",e),show:()=>o.setState("open",!0),hide:()=>o.setState("open",!1),toggle:()=>o.setState("open",e=>!e),stopAnimation:()=>o.setState("animating",!1),setContentElement:e=>o.setState("contentElement",e),setDisclosureElement:e=>o.setState("disclosureElement",e)}}function ra(e,t,r){return Q(t,[r.store,r.disclosure]),tM(e,r,"open","setOpen"),tM(e,r,"mounted","setMounted"),tM(e,r,"animated"),Object.assign(e,{disclosure:r.disclosure})}es(function(e){return e});var rl=ea(function(e){return eu("div",e)});function ru({store:e,backdrop:t,alwaysVisible:r,hidden:n}){let i=(0,R.useRef)(null),o=function(e={}){let[t,r]=tR(ro,e);return ra(t,r,e)}({disclosure:e}),a=t_(e,"contentElement");(0,R.useEffect)(()=>{let e=i.current;!e||a&&(e.style.zIndex=getComputedStyle(a).zIndex)},[a]),H(()=>{let e=null==a?void 0:a.id;if(!e)return;let t=i.current;if(t)return t6(t,e)},[a]);let l=tk({ref:i,store:o,role:"presentation","data-backdrop":(null==a?void 0:a.id)||"",alwaysVisible:r,hidden:null!=n?n:void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if((0,R.isValidElement)(t))return(0,eo.jsx)(rl,{...l,render:t});let u="boolean"!=typeof t?t:"div";return(0,eo.jsx)(rl,{...l,render:(0,eo.jsx)(u,{})})}function rs(e={}){return ro(e)}Object.assign(rl,["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"].reduce((e,t)=>(e[t]=ea(function(e){return eu(t,e)}),e),{}));var rc=L();function rf(e,t=!1){if(!e)return null;let r="current"in e?e.current:e;return r?t?ex(r)?r:null:r:null}var rd=es(function({store:e,open:t,onClose:l,focusable:s=!0,modal:f=!0,portal:d=!!f,backdrop:p=!!f,hideOnEscape:m=!0,hideOnInteractOutside:h=!0,getPersistentElements:v,preventBodyScroll:g=!!f,autoFocusOnShow:y=!0,autoFocusOnHide:b=!0,initialFocus:S,finalFocus:C,unmountOnHide:A,unstable_treeSnapshotKey:E,...w}){var _;let T,M,O,L=eQ(),P=(0,R.useRef)(null),D=function(e={}){let[t,r]=tR(rs,e);return ra(t,r,e)}({store:e||L,open:t,setOpen(e){if(e)return;let t=P.current;if(!t)return;let r=new Event("close",{bubbles:!1,cancelable:!0});l&&t.addEventListener("close",l,{once:!0}),t.dispatchEvent(r),r.defaultPrevented&&D.setOpen(!0)}}),{portalRef:B,domReady:G}=Z(d,w.portalRef),k=w.preserveTabOrder,U=t_(D,e=>k&&!f&&e.mounted),q=z(w.id),V=t_(D,"open"),Q=t_(D,"mounted"),J=t_(D,"contentElement"),ee=tG(Q,w.hidden,w.alwaysVisible);T=function({attribute:e,contentId:t,contentElement:r,enabled:i}){let[o,a]=$(),l=(0,R.useCallback)(()=>{if(!i||!r)return!1;let{body:o}=n(r),a=o.getAttribute(e);return!a||a===t},[o,i,r,e,t]);return(0,R.useEffect)(()=>{if(!i||!t||!r)return;let{body:o}=n(r);if(l())return o.setAttribute(e,t),()=>o.removeAttribute(e);let u=new MutationObserver(()=>(0,tP.flushSync)(a));return u.observe(o,{attributeFilter:[e]}),()=>u.disconnect()},[o,i,t,r,l,e]),l}({attribute:"data-dialog-prevent-body-scroll",contentElement:J,contentId:q,enabled:g&&!ee}),(0,R.useEffect)(()=>{var e,t;if(!T()||!J)return;let o=n(J),a=i(J),{documentElement:l,body:u}=o,s=l.style.getPropertyValue("--scrollbar-width"),c=s?Number.parseInt(s,10):a.innerWidth-l.clientWidth,f=Math.round(l.getBoundingClientRect().left)+l.scrollLeft?"paddingLeft":"paddingRight",d=F()&&!(r&&navigator.platform.startsWith("Mac")&&!I());return x((e="--scrollbar-width",t=`${c}px`,l?tZ(l,e,()=>{let r=l.style.getPropertyValue(e);return l.style.setProperty(e,t),()=>{r?l.style.setProperty(e,r):l.style.removeProperty(e)}}):()=>{}),d?(()=>{var e,t;let{scrollX:r,scrollY:n,visualViewport:i}=a,o=null!=(e=null==i?void 0:i.offsetLeft)?e:0,l=null!=(t=null==i?void 0:i.offsetTop)?t:0,s=t1(u,{position:"fixed",overflow:"hidden",top:`${-(n-Math.floor(l))}px`,left:`${-(r-Math.floor(o))}px`,right:"0",[f]:`${c}px`});return()=>{s(),a.scrollTo({left:r,top:n,behavior:"instant"})}})():t1(u,{overflow:"hidden",[f]:`${c}px`}))},[T,J]),_=t_(D,"open"),M=(0,R.useRef)(null),(0,R.useEffect)(()=>{if(!_){M.current=null;return}return N("mousedown",e=>{M.current=e.target},!0)},[_]),re({...O={store:D,domReady:G,capture:!0},type:"click",listener:e=>{let{contentElement:t}=D.getState(),r=M.current;r&&c(r)&&t9(r,null==t?void 0:t.id)&&rt(h,e)&&D.hide()}}),re({...O,type:"focusin",listener:e=>{let{contentElement:t}=D.getState();!t||e.target===n(t)||rt(h,e)&&D.hide()}}),re({...O,type:"contextmenu",listener:e=>{rt(h,e)&&D.hide()}});let{wrapElement:et,nestedDialogs:er}=function(e){let t=(0,R.useContext)(rr),[r,n]=(0,R.useState)([]),i=(0,R.useCallback)(e=>{var r;return n(t=>[...t,e]),x(null==(r=t.add)?void 0:r.call(t,e),()=>{n(t=>t.filter(t=>t!==e))})},[t]);H(()=>tu(e,["open","contentElement"],r=>{var n;if(r.open&&r.contentElement)return null==(n=t.add)?void 0:n.call(t,e)}),[e,t]);let o=(0,R.useMemo)(()=>({store:e,add:i}),[e,i]);return{wrapElement:(0,R.useCallback)(e=>(0,eo.jsx)(rr.Provider,{value:o,children:e}),[o]),nestedDialogs:r}}(D);w=Y(w,et,[et]),H(()=>{if(!V)return;let e=P.current,t=o(e,!0);!t||"BODY"===t.tagName||e&&a(e,t)||D.setDisclosureElement(t)},[D,V]),rc&&(0,R.useEffect)(()=>{if(!Q)return;let{disclosureElement:e}=D.getState();if(!e||!u(e))return;let t=()=>{let t=!1,r=()=>{t=!0};e.addEventListener("focusin",r,{capture:!0,once:!0}),j(e,"mouseup",()=>{e.removeEventListener("focusin",r,!0),t||eO(e)})};return e.addEventListener("mousedown",t),()=>{e.removeEventListener("mousedown",t)}},[D,Q]),(0,R.useEffect)(()=>{if(!Q||!G)return;let e=P.current;if(!e)return;let t=i(e),r=t.visualViewport||t,n=()=>{var r,n;let i=null!=(n=null==(r=t.visualViewport)?void 0:r.height)?n:t.innerHeight;e.style.setProperty("--dialog-viewport-height",`${i}px`)};return n(),r.addEventListener("resize",n),()=>{r.removeEventListener("resize",n)}},[Q,G]),(0,R.useEffect)(()=>{if(!f||!Q||!G)return;let e=P.current;if(e&&!e.querySelector("[data-dialog-dismiss]")){var t;let r;return t=D.hide,(r=n(e).createElement("button")).type="button",r.tabIndex=-1,r.textContent="Dismiss popup",Object.assign(r.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),r.addEventListener("click",t),e.prepend(r),()=>{r.removeEventListener("click",t),r.remove()}}},[D,f,Q,G]),H(()=>{if(!rn()||V||!Q||!G)return;let e=P.current;if(e)return ri(e)},[V,Q,G]);let en=V&&G;H(()=>{if(q&&en)return function(e,t){let{body:r}=n(t[0]),i=[];return t4(e,t,t=>{i.push(t0(t,t3(e),!0))}),x(t0(r,t3(e),!0),()=>{for(let e of i)e()})}(q,[P.current])},[q,en,E]);let ei=W(v);H(()=>{if(!q||!en)return;let{disclosureElement:e}=D.getState(),t=[P.current,...ei()||[],...er.map(e=>e.getState().contentElement)];if(f){let e,r;return x(t7(q,t),(e=[],r=t.map(e=>null==e?void 0:e.id),t4(q,t,n=>{t5(n,...r)||!function(e,...t){if(!e)return!1;let r=e.getAttribute("data-focus-trap");return null!=r&&(!t.length||""!==r&&t.some(e=>r===e))}(n,...r)&&e.unshift(ri(n,t))},r=>{!r.hasAttribute("role")||t.some(e=>e&&a(e,r))||e.unshift(tJ(r,"role","none"))}),()=>{for(let t of e)t()}))}return t7(q,[e,...t])},[q,D,en,ei,er,f,E]);let ea=!!y,el=X(y),[eu,es]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(!V||!ea||!G||!(null==J?void 0:J.isConnected))return;let e=rf(S,!0)||J.querySelector("[data-autofocus=true],[autofocus]")||function(e,t,r){let[n]=ew(e,t,r);return n||null}(J,!0,d&&U)||J,t=ex(e);el(t?e:null)&&(es(!0),queueMicrotask(()=>{e.focus(),!rc||t&&e.scrollIntoView({block:"nearest",inline:"nearest"})}))},[V,ea,G,J,S,d,U,el]);let ec=!!b,ef=X(b),[ed,ep]=(0,R.useState)(!1);(0,R.useEffect)(()=>{if(V)return ep(!0),()=>ep(!1)},[V]);let em=(0,R.useCallback)((e,t=!0)=>{let r,{disclosureElement:i}=D.getState();if(!(!(r=o())||e&&a(e,r))&&ex(r))return;let l=rf(C)||i;if(null==l?void 0:l.id){let e=n(l),t=`[aria-activedescendant="${l.id}"]`,r=e.querySelector(t);r&&(l=r)}if(l&&!ex(l)){let e=l.closest("[data-dialog]");if(null==e?void 0:e.id){let t=n(e),r=`[aria-controls~="${e.id}"]`,i=t.querySelector(r);i&&(l=i)}}let u=l&&ex(l);!u&&t?requestAnimationFrame(()=>em(e,!1)):!ef(u?l:null)||u&&(null==l||l.focus({preventScroll:!0}))},[D,C,ef]),eh=(0,R.useRef)(!1);H(()=>{if(V||!ed||!ec)return;let e=P.current;eh.current=!0,em(e)},[V,ed,G,ec,em]),(0,R.useEffect)(()=>{if(!ed||!ec)return;let e=P.current;return()=>{if(eh.current){eh.current=!1;return}em(e)}},[ed,ec,em]);let ev=X(m);(0,R.useEffect)(()=>{if(G&&Q)return N("keydown",e=>{if("Escape"!==e.key||e.defaultPrevented)return;let t=P.current;if(!t||t9(t))return;let r=e.target;if(!r)return;let{disclosureElement:n}=D.getState();!("BODY"===r.tagName||a(t,r)||!n||a(n,r))||ev(e)&&D.hide()},!0)},[D,G,Q,ev]);let eg=(w=Y(w,e=>(0,eo.jsx)(t$,{level:f?1:void 0,children:e}),[f])).hidden,ey=w.alwaysVisible;w=Y(w,e=>p?(0,eo.jsxs)(eo.Fragment,{children:[(0,eo.jsx)(ru,{store:D,backdrop:p,hidden:eg,alwaysVisible:ey}),e]}):e,[D,p,eg,ey]);let[eb,eS]=(0,R.useState)(),[eC,eA]=(0,R.useState)();return w=tX({...w={id:q,"data-dialog":"",role:"dialog",tabIndex:s?-1:void 0,"aria-labelledby":eb,"aria-describedby":eC,...w=Y(w,e=>(0,eo.jsx)(eX,{value:D,children:(0,eo.jsx)(eY.Provider,{value:eS,children:(0,eo.jsx)(eZ.Provider,{value:eA,children:e})})}),[D]),ref:K(P,w.ref)},autoFocusOnShow:eu}),w=tz({portal:d,...w=eN({...w=tk({store:D,...w}),focusable:s}),portalRef:B,preserveTabOrder:U})});function rp(e,t=eQ){return ea(function(r){let n=t();return t_(r.store||n,e=>!r.unmountOnHide||(null==e?void 0:e.mounted)||!!r.open)?(0,eo.jsx)(e,{...r}):null})}rp(ea(function(e){return eu("div",rd(e))}),eQ);let rm=Math.min,rh=Math.max,rv=Math.round,rg=Math.floor,ry=e=>({x:e,y:e}),rb={left:"right",right:"left",bottom:"top",top:"bottom"},rS={start:"end",end:"start"};function rC(e,t){return"function"==typeof e?e(t):e}function rx(e){return e.split("-")[0]}function rA(e){return e.split("-")[1]}function rE(e){return"x"===e?"y":"x"}function rw(e){return"y"===e?"height":"width"}let r_=new Set(["top","bottom"]);function rT(e){return r_.has(rx(e))?"y":"x"}function rM(e){return e.replace(/start|end/g,e=>rS[e])}let rR=["left","right"],rO=["right","left"],rI=["top","bottom"],rF=["bottom","top"];function rL(e){return e.replace(/left|right|bottom|top/g,e=>rb[e])}function rP(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function rD(e){let{x:t,y:r,width:n,height:i}=e;return{width:n,height:i,top:r,left:t,right:t+n,bottom:r+i,x:t,y:r}}function rB(e,t,r){let n,{reference:i,floating:o}=e,a=rT(t),l=rE(rT(t)),u=rw(l),s=rx(t),c="y"===a,f=i.x+i.width/2-o.width/2,d=i.y+i.height/2-o.height/2,p=i[u]/2-o[u]/2;switch(s){case"top":n={x:f,y:i.y-o.height};break;case"bottom":n={x:f,y:i.y+i.height};break;case"right":n={x:i.x+i.width,y:d};break;case"left":n={x:i.x-o.width,y:d};break;default:n={x:i.x,y:i.y}}switch(rA(t)){case"start":n[l]-=p*(r&&c?-1:1);break;case"end":n[l]+=p*(r&&c?-1:1)}return n}async function rG(e,t){var r;void 0===t&&(t={});let{x:n,y:i,platform:o,rects:a,elements:l,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=rC(t,e),m=rP(p),h=l[d?"floating"===f?"reference":"floating":f],v=rD(await o.getClippingRect({element:null==(r=await (null==o.isElement?void 0:o.isElement(h)))||r?h:h.contextElement||await (null==o.getDocumentElement?void 0:o.getDocumentElement(l.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:n,y:i,width:a.floating.width,height:a.floating.height}:a.reference,y=await (null==o.getOffsetParent?void 0:o.getOffsetParent(l.floating)),b=await (null==o.isElement?void 0:o.isElement(y))&&await (null==o.getScale?void 0:o.getScale(y))||{x:1,y:1},S=rD(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:g,offsetParent:y,strategy:u}):g);return{top:(v.top-S.top+m.top)/b.y,bottom:(S.bottom-v.bottom+m.bottom)/b.y,left:(v.left-S.left+m.left)/b.x,right:(S.right-v.right+m.right)/b.x}}let rk=async(e,t,r)=>{let{placement:n="bottom",strategy:i="absolute",middleware:o=[],platform:a}=r,l=o.filter(Boolean),u=await (null==a.isRTL?void 0:a.isRTL(t)),s=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:c,y:f}=rB(s,n,u),d=n,p={},m=0;for(let r=0;rtypeof window}function rq(e){return rW(e)?(e.nodeName||"").toLowerCase():"#document"}function rV(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function rH(e){var t;return null==(t=(rW(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function rW(e){return!!rU()&&(e instanceof Node||e instanceof rV(e).Node)}function rK(e){return!!rU()&&(e instanceof Element||e instanceof rV(e).Element)}function rz(e){return!!rU()&&(e instanceof HTMLElement||e instanceof rV(e).HTMLElement)}function rQ(e){return!(!rU()||"u"{try{return e.matches(t)}catch(e){return!1}})}let r0=["transform","translate","scale","rotate","perspective"],r1=["transform","translate","scale","rotate","perspective","filter"],r2=["paint","layout","strict","content"];function r3(e){let t=r4(),r=rK(e)?r6(e):e;return r0.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||r1.some(e=>(r.willChange||"").includes(e))||r2.some(e=>(r.contain||"").includes(e))}function r4(){return!("u"rK(e)&&"body"!==rq(e)),i=null,o="fixed"===r6(e).position,a=o?r7(e):e;for(;rK(a)&&!r8(a);){let t=r6(a),r=r3(a);r||"fixed"!==t.position||(i=null),(o?!r&&!i:!r&&"static"===t.position&&!!i&&nc.has(i.position)||rX(a)&&!r&&function e(t,r){let n=r7(t);return!(n===r||!rK(n)||r8(n))&&("fixed"===r6(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):i=t,a=r7(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=o[0],l=o.reduce((e,r)=>{let n=nf(t,r,i);return e.top=rh(n.top,e.top),e.right=rm(n.right,e.right),e.bottom=rm(n.bottom,e.bottom),e.left=rh(n.left,e.left),e},nf(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:nm,getElementRects:nh,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=nr(e);return{width:t,height:r}},getScale:ni,isElement:rK,isRTL:function(e){return"rtl"===r6(e).direction}};function ng(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ny(e=0,t=0,r=0,n=0){if("function"==typeof DOMRect)return new DOMRect(e,t,r,n);let i={x:e,y:t,width:r,height:n,top:t,right:e+r,bottom:t+n,left:e};return{...i,toJSON:()=>i}}function nb(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function nS(e){let t=window.devicePixelRatio||1;return Math.round(e*t)/t}var nC=es(function({store:e,modal:t=!1,portal:r=!!t,preserveTabOrder:n=!0,autoFocusOnShow:i=!0,wrapperProps:o,fixed:a=!1,flip:l=!0,shift:u=0,slide:s=!0,overlap:c=!1,sameWidth:f=!1,fitViewport:d=!1,gutter:p,arrowPadding:m=4,overflowPadding:h=8,getAnchorRect:v,updatePosition:g,...y}){let b=e0();E(e=e||b,!1);let S=e.useState("arrowElement"),C=e.useState("anchorElement"),x=e.useState("disclosureElement"),A=e.useState("popoverElement"),w=e.useState("contentElement"),_=e.useState("placement"),T=e.useState("mounted"),M=e.useState("rendered"),O=(0,R.useRef)(null),[I,F]=(0,R.useState)(!1),{portalRef:L,domReady:P}=Z(r,y.portalRef),D=W(v),B=W(g),G=!!g;H(()=>{if(!(null==A?void 0:A.isConnected))return;A.style.setProperty("--popover-overflow-padding",`${h}px`);let t={contextElement:C||void 0,getBoundingClientRect:()=>{let e=null==D?void 0:D(C);return e||!C?function(e){if(!e)return ny();let{x:t,y:r,width:n,height:i}=e;return ny(t,r,n,i)}(e):C.getBoundingClientRect()}},r=async()=>{var r,n,i,o,v;let g,y,b;if(!T)return;S||(O.current=O.current||document.createElement("div"));let C=S||O.current,x=[(r={gutter:p,shift:u},void 0===(n=({placement:e})=>{var t;let n=((null==C?void 0:C.clientHeight)||0)/2,i="number"==typeof r.gutter?r.gutter+n:null!=(t=r.gutter)?t:n;return{crossAxis:e.split("-")[1]?void 0:r.shift,mainAxis:i,alignmentAxis:r.shift}})&&(n=0),{name:"offset",options:n,async fn(e){var t,r;let{x:i,y:o,placement:a,middlewareData:l}=e,u=await rN(e,n);return a===(null==(t=l.offset)?void 0:t.placement)&&null!=(r=l.arrow)&&r.alignmentOffset?{}:{x:i+u.x,y:o+u.y,data:{...u,placement:a}}}}),function(e){var t;if(!1===e.flip)return;let r="string"==typeof e.flip?e.flip.split(" "):void 0;return E(!r||r.every(nb),!1),{name:"flip",options:t={padding:e.overflowPadding,fallbackPlacements:r},async fn(e){var r,n,i,o,a,l,u,s;let c,f,d,{placement:p,middlewareData:m,rects:h,initialPlacement:v,platform:g,elements:y}=e,{mainAxis:b=!0,crossAxis:S=!0,fallbackPlacements:C,fallbackStrategy:x="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:E=!0,...w}=rC(t,e);if(null!=(r=m.arrow)&&r.alignmentOffset)return{};let _=rx(p),T=rT(v),M=rx(v)===v,R=await (null==g.isRTL?void 0:g.isRTL(y.floating)),O=C||(M||!E?[rL(v)]:(c=rL(v),[rM(v),c,rM(c)])),I="none"!==A;!C&&I&&O.push(...(f=rA(v),d=function(e,t,r){switch(e){case"top":case"bottom":if(r)return t?rO:rR;return t?rR:rO;case"left":case"right":return t?rI:rF;default:return[]}}(rx(v),"start"===A,R),f&&(d=d.map(e=>e+"-"+f),E&&(d=d.concat(d.map(rM)))),d));let F=[v,...O],L=await g.detectOverflow(e,w),P=[],D=(null==(n=m.flip)?void 0:n.overflows)||[];if(b&&P.push(L[_]),S){let e,t,r,n,i=(l=p,u=h,void 0===(s=R)&&(s=!1),e=rA(l),r=rw(t=rE(rT(l))),n="x"===t?e===(s?"end":"start")?"right":"left":"start"===e?"bottom":"top",u.reference[r]>u.floating[r]&&(n=rL(n)),[n,rL(n)]);P.push(L[i[0]],L[i[1]])}if(D=[...D,{placement:p,overflows:P}],!P.every(e=>e<=0)){let e=((null==(i=m.flip)?void 0:i.index)||0)+1,t=F[e];if(t&&("alignment"!==S||T===rT(t)||D.every(e=>rT(e.placement)!==T||e.overflows[0]>0)))return{data:{index:e,overflows:D},reset:{placement:t}};let r=null==(o=D.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:o.placement;if(!r)switch(x){case"bestFit":{let e=null==(a=D.filter(e=>{if(I){let t=rT(e.placement);return t===T||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:a[0];e&&(r=e);break}case"initialPlacement":r=v}if(p!==r)return{reset:{placement:r}}}return{}}}}({flip:l,overflowPadding:h}),function(e){if(e.slide||e.overlap){var t,r;return{name:"shift",options:r={mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:(void 0===t&&(t={}),{options:t,fn(e){let{x:r,y:n,placement:i,rects:o,middlewareData:a}=e,{offset:l=0,mainAxis:u=!0,crossAxis:s=!0}=rC(t,e),c={x:r,y:n},f=rT(i),d=rE(f),p=c[d],m=c[f],h=rC(l,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(u){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,r=o.reference[d]+o.reference[e]-v.mainAxis;pr&&(p=r)}if(s){var g,y;let e="y"===d?"width":"height",t=rj.has(rx(i)),r=o.reference[f]-o.floating[e]+(t&&(null==(g=a.offset)?void 0:g[f])||0)+(t?0:v.crossAxis),n=o.reference[f]+o.reference[e]+(t?0:(null==(y=a.offset)?void 0:y[f])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[d]:p,[f]:m}}})},async fn(e){let{x:t,y:n,placement:i,platform:o}=e,{mainAxis:a=!0,crossAxis:l=!1,limiter:u={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=rC(r,e),c={x:t,y:n},f=await o.detectOverflow(e,s),d=rT(rx(i)),p=rE(d),m=c[p],h=c[d];if(a){let e="y"===p?"top":"left",t="y"===p?"bottom":"right",r=m+f[e],n=m-f[t];m=rh(r,rm(m,n))}if(l){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+f[e],n=h-f[t];h=rh(r,rm(h,n))}let v=u.fn({...e,[p]:m,[d]:h});return{...v,data:{x:v.x-t,y:v.y-n,enabled:{[p]:a,[d]:l}}}}}}}({slide:s,shift:u,overlap:c,overflowPadding:h}),function(e,t){if(e){let r;return{name:"arrow",options:r={element:e,padding:t.arrowPadding},async fn(e){let{x:t,y:n,placement:i,rects:o,platform:a,elements:l,middlewareData:u}=e,{element:s,padding:c=0}=rC(r,e)||{};if(null==s)return{};let f=rP(c),d={x:t,y:n},p=rE(rT(i)),m=rw(p),h=await a.getDimensions(s),v="y"===p,g=v?"clientHeight":"clientWidth",y=o.reference[m]+o.reference[p]-d[p]-o.floating[m],b=d[p]-o.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(s)),C=S?S[g]:0;C&&await (null==a.isElement?void 0:a.isElement(S))||(C=l.floating[g]||o.floating[m]);let x=C/2-h[m]/2-1,A=rm(f[v?"top":"left"],x),E=rm(f[v?"bottom":"right"],x),w=C-h[m]-E,_=C/2-h[m]/2+(y/2-b/2),T=rh(A,rm(_,w)),M=!u.arrow&&null!=rA(i)&&_!==T&&o.reference[m]/2-(_{},...f}=rC(o,e),d=await u.detectOverflow(e,f),p=rx(a),m=rA(a),h="y"===rT(a),{width:v,height:g}=l.floating;"top"===p||"bottom"===p?(n=p,i=m===(await (null==u.isRTL?void 0:u.isRTL(s.floating))?"start":"end")?"left":"right"):(i=p,n="end"===m?"top":"bottom");let y=g-d.top-d.bottom,b=v-d.left-d.right,S=rm(g-d[n],y),C=rm(v-d[i],b),x=!e.middlewareData.shift,A=S,E=C;if(null!=(t=e.middlewareData.shift)&&t.enabled.x&&(E=b),null!=(r=e.middlewareData.shift)&&r.enabled.y&&(A=y),x&&!m){let e=rh(d.left,0),t=rh(d.right,0),r=rh(d.top,0),n=rh(d.bottom,0);h?E=v-2*(0!==e||0!==t?e+t:rh(d.left,d.right)):A=g-2*(0!==r||0!==n?r+n:rh(d.top,d.bottom))}await c({...e,availableWidth:E,availableHeight:A});let w=await u.getDimensions(s.floating);return v!==w.width||g!==w.height?{reset:{rects:!0}}:{}}}],w=await (v={placement:_,strategy:a?"fixed":"absolute",middleware:x},g=new Map,b={...(y={platform:nv,...v}).platform,_c:g},rk(t,A,{...y,platform:b}));null==e||e.setState("currentPlacement",w.placement),F(!0);let M=nS(w.x),R=nS(w.y);if(Object.assign(A.style,{top:"0",left:"0",transform:`translate3d(${M}px,${R}px,0)`}),C&&w.middlewareData.arrow){let{x:e,y:t}=w.middlewareData.arrow,r=w.placement.split("-")[0],n=C.clientWidth/2,i=C.clientHeight/2,o=null!=e?e+n:-n,a=null!=t?t+i:-i;A.style.setProperty("--popover-transform-origin",{top:`${o}px calc(100% + ${i}px)`,bottom:`${o}px ${-i}px`,left:`calc(100% + ${n}px) ${a}px`,right:`${-n}px ${a}px`}[r]),Object.assign(C.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[r]:"100%"})}},n=function(e,t,r,n){let i;void 0===n&&(n={});let{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:u="function"==typeof IntersectionObserver,animationFrame:s=!1}=n,c=nn(e),f=o||a?[...c?ne(c):[],...ne(t)]:[];f.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let d=c&&u?function(e,t){let r,n=null,i=rH(e);function o(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(l,u){void 0===l&&(l=!1),void 0===u&&(u=1),o();let s=e.getBoundingClientRect(),{left:c,top:f,width:d,height:p}=s;if(l||t(),!d||!p)return;let m={rootMargin:-rg(f)+"px "+-rg(i.clientWidth-(c+d))+"px "+-rg(i.clientHeight-(f+p))+"px "+-rg(c)+"px",threshold:rh(0,rm(1,u))||1},h=!0;function v(t){let n=t[0].intersectionRatio;if(n!==u){if(!h)return a();n?a(!1,n):r=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==n||ng(s,e.getBoundingClientRect())||a(),h=!1}try{n=new IntersectionObserver(v,{...m,root:i.ownerDocument})}catch(e){n=new IntersectionObserver(v,m)}n.observe(e)}(!0),o}(c,r):null,p=-1,m=null;l&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),c&&!s&&m.observe(c),m.observe(t));let h=s?nl(e):null;return s&&function t(){let n=nl(e);h&&!ng(h,n)&&r(),h=n,i=requestAnimationFrame(t)}(),r(),()=>{var e;f.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=m)||e.disconnect(),m=null,s&&cancelAnimationFrame(i)}}(t,A,async()=>{G?(await B({updatePosition:r}),F(!0)):await r()},{elementResize:"function"==typeof ResizeObserver});return()=>{F(!1),n()}},[e,M,A,S,C,A,_,T,P,a,l,u,s,c,f,d,p,m,h,D,G,B]),H(()=>{if(!T||!P||!(null==A?void 0:A.isConnected)||!(null==w?void 0:w.isConnected))return;let e=()=>{A.style.zIndex=getComputedStyle(w).zIndex};e();let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)},[T,P,A,w]);let k=a?"fixed":"absolute";return y=Y(y,t=>(0,eo.jsx)("div",{...o,style:{position:k,top:0,left:0,width:"max-content",...null==o?void 0:o.style},ref:null==e?void 0:e.setPopoverElement,children:t}),[e,k,o]),y={"data-placing":!I||void 0,...y=Y(y,t=>(0,eo.jsx)(e2,{value:e,children:t}),[e]),style:{position:"relative",...y.style}},y=rd({store:e,modal:t,portal:r,preserveTabOrder:n,preserveTabOrderAnchor:x||C,autoFocusOnShow:I&&i,...y,portalRef:L})});rp(ea(function(e){return eu("div",nC(e))}),e0);var nx=es(function({store:e,modal:t,tabIndex:r,alwaysVisible:i,autoFocusOnHide:o=!0,hideOnInteractOutside:a=!0,...l}){let u=e9();E(e=e||u,!1);let s=e.useState("baseElement"),c=(0,R.useRef)(!1),f=t_(e.tag,e=>null==e?void 0:e.renderedItems.length);return l=tN({store:e,alwaysVisible:i,...l}),l=nC({store:e,modal:t,alwaysVisible:i,backdrop:!1,autoFocusOnShow:!1,finalFocus:s,preserveTabOrderAnchor:null,unstable_treeSnapshotKey:f,...l,getPersistentElements(){var r;let i=(null==(r=l.getPersistentElements)?void 0:r.call(l))||[];if(!t||!e)return i;let{contentElement:o,baseElement:a}=e.getState();if(!a)return i;let u=n(a),s=[];if((null==o?void 0:o.id)&&s.push(`[aria-controls~="${o.id}"]`),(null==a?void 0:a.id)&&s.push(`[aria-controls~="${a.id}"]`),!s.length)return[...i,a];let c=s.join(",");return[...i,...u.querySelectorAll(c)]},autoFocusOnHide:e=>!w(o,e)&&(!c.current||(c.current=!1,!1)),hideOnInteractOutside(t){var r,n;let i=null==e?void 0:e.getState(),o=null==(r=null==i?void 0:i.contentElement)?void 0:r.id,l=null==(n=null==i?void 0:i.baseElement)?void 0:n.id;if(function(e,...t){if(!e)return!1;if("id"in e){let r=t.filter(Boolean).map(e=>`[aria-controls~="${e}"]`).join(", ");return!!r&&e.matches(r)}return!1}(t.target,o,l))return!1;let u="function"==typeof a?a(t):a;return u&&(c.current="click"===t.type),u}})}),nA=rp(ea(function(e){return eu("div",nx(e))}),e9);e.s(["ComboboxPopover",()=>nA],1559),(0,R.createContext)(null),(0,R.createContext)(null);var nE=ec([ev],[eg]),nw=nE.useContext;nE.useScopedContext,nE.useProviderContext,nE.ContextProvider,nE.ScopedContextProvider;var n_={id:null};function nT(e,t){return e.find(e=>t?!e.disabled&&e.id!==t:!e.disabled)}function nM(e,t){return e.filter(e=>e.rowId===t)}function nR(e){let t=[];for(let r of e){let e=t.find(e=>{var t;return(null==(t=e[0])?void 0:t.rowId)===r.rowId});e?e.push(r):t.push([r])}return t}function nO(e){let t=0;for(let{length:r}of e)r>t&&(t=r);return t}var nI=L()&&I();function nF({tag:e,...t}={}){let r=tf(t.store,function(e,...t){if(e)return tn(e,"pick")(...t)}(e,["value","rtl"]));td(t,r);let i=null==e?void 0:e.getState(),o=null==r?void 0:r.getState(),a=M(t.activeId,null==o?void 0:o.activeId,t.defaultActiveId,null),l=function(e={}){var t;let r=null==(t=e.store)?void 0:t.getState(),i=function(e={}){var t,r;td(e,e.store);let i=null==(t=e.store)?void 0:t.getState(),o=M(e.items,null==i?void 0:i.items,e.defaultItems,[]),a=new Map(o.map(e=>[e.id,e])),l={items:o,renderedItems:M(null==i?void 0:i.renderedItems,[])},u=null==(r=e.store)?void 0:r.__unstablePrivateStore,s=ti({items:o,renderedItems:l.renderedItems},u),c=ti(l,e.store),f=e=>{var t;let r,n,i=(t=e=>e.element,r=e.map((e,t)=>[t,e]),n=!1,(r.sort(([e,r],[i,o])=>{var a;let l=t(r),u=t(o);return l!==u&&l&&u?(a=l,u.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_PRECEDING)?(e>i&&(n=!0),-1):(et):e);s.setState("renderedItems",i),c.setState("renderedItems",i)};to(c,()=>ta(s)),to(s,()=>ts(s,["items"],e=>{c.setState("items",e.items)})),to(s,()=>ts(s,["renderedItems"],e=>{let t=!0,r=requestAnimationFrame(()=>{let{renderedItems:t}=c.getState();e.renderedItems!==t&&f(e.renderedItems)});if("function"!=typeof IntersectionObserver)return()=>cancelAnimationFrame(r);let i=new IntersectionObserver(()=>{if(t){t=!1;return}cancelAnimationFrame(r),r=requestAnimationFrame(()=>f(e.renderedItems))},{root:function(e){var t;let r=e.find(e=>!!e.element),i=[...e].reverse().find(e=>!!e.element),o=null==(t=null==r?void 0:r.element)?void 0:t.parentElement;for(;o&&(null==i?void 0:i.element);){let e=o;if(i&&e.contains(i.element))return o;o=o.parentElement}return n(o).body}(e.renderedItems)});for(let t of e.renderedItems)t.element&&i.observe(t.element);return()=>{cancelAnimationFrame(r),i.disconnect()}}));let d=(e,t,r=!1)=>{let n;return t(t=>{let r=t.findIndex(({id:t})=>t===e.id),i=t.slice();if(-1!==r){let o={...n=t[r],...e};i[r]=o,a.set(e.id,o)}else i.push(e),a.set(e.id,e);return i}),()=>{t(t=>{if(!n)return r&&a.delete(e.id),t.filter(({id:t})=>t!==e.id);let i=t.findIndex(({id:t})=>t===e.id);if(-1===i)return t;let o=t.slice();return o[i]=n,a.set(e.id,n),o})}},p=e=>d(e,e=>s.setState("items",e),!0);return{...c,registerItem:p,renderItem:e=>x(p(e),d(e,e=>s.setState("renderedItems",e))),item:e=>{if(!e)return null;let t=a.get(e);if(!t){let{items:r}=s.getState();(t=r.find(t=>t.id===e))&&a.set(e,t)}return t||null},__unstablePrivateStore:s}}(e),o=M(e.activeId,null==r?void 0:r.activeId,e.defaultActiveId),a=ti({...i.getState(),id:M(e.id,null==r?void 0:r.id,`id-${Math.random().toString(36).slice(2,8)}`),activeId:o,baseElement:M(null==r?void 0:r.baseElement,null),includesBaseElement:M(e.includesBaseElement,null==r?void 0:r.includesBaseElement,null===o),moves:M(null==r?void 0:r.moves,0),orientation:M(e.orientation,null==r?void 0:r.orientation,"both"),rtl:M(e.rtl,null==r?void 0:r.rtl,!1),virtualFocus:M(e.virtualFocus,null==r?void 0:r.virtualFocus,!1),focusLoop:M(e.focusLoop,null==r?void 0:r.focusLoop,!1),focusWrap:M(e.focusWrap,null==r?void 0:r.focusWrap,!1),focusShift:M(e.focusShift,null==r?void 0:r.focusShift,!1)},i,e.store);to(a,()=>tu(a,["renderedItems","activeId"],e=>{a.setState("activeId",t=>{var r;return void 0!==t?t:null==(r=nT(e.renderedItems))?void 0:r.id})}));let l=(e="next",t={})=>{var r,n;let i=a.getState(),{skip:o=0,activeId:l=i.activeId,focusShift:u=i.focusShift,focusLoop:s=i.focusLoop,focusWrap:c=i.focusWrap,includesBaseElement:f=i.includesBaseElement,renderedItems:d=i.renderedItems,rtl:p=i.rtl}=t,m="up"===e||"down"===e,h="next"===e||"down"===e,v=m?eU(function(e,t,r){let n=nO(e);for(let i of e)for(let e=0;ee.id===l);if(!g)return null==(n=nT(v))?void 0:n.id;let y=v.some(e=>e.rowId),b=v.indexOf(g),S=v.slice(b+1),C=nM(S,g.rowId);if(o){let e=C.filter(e=>l?!e.disabled&&e.id!==l:!e.disabled),t=e.slice(o)[0]||e[e.length-1];return null==t?void 0:t.id}let x=s&&(m?"horizontal"!==s:"vertical"!==s),A=y&&c&&(m?"horizontal"!==c:"vertical"!==c),E=h?(!y||m)&&x&&f:!!m&&f;if(x){let e=nT(function(e,t,r=!1){let n=e.findIndex(e=>e.id===t);return[...e.slice(n+1),...r?[n_]:[],...e.slice(0,n)]}(A&&!E?v:nM(v,g.rowId),l,E),l);return null==e?void 0:e.id}if(A){let e=nT(E?C:S,l);return E?(null==e?void 0:e.id)||null:null==e?void 0:e.id}let w=nT(C,l);return!w&&E?null:null==w?void 0:w.id};return{...i,...a,setBaseElement:e=>a.setState("baseElement",e),setActiveId:e=>a.setState("activeId",e),move:e=>{void 0!==e&&(a.setState("activeId",e),a.setState("moves",e=>e+1))},first:()=>{var e;return null==(e=nT(a.getState().renderedItems))?void 0:e.id},last:()=>{var e;return null==(e=nT(eq(a.getState().renderedItems)))?void 0:e.id},next:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("next",e)),previous:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("previous",e)),down:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("down",e)),up:e=>(void 0!==e&&"number"==typeof e&&(e={skip:e}),l("up",e))}}({...t,activeId:a,includesBaseElement:M(t.includesBaseElement,null==o?void 0:o.includesBaseElement,!0),orientation:M(t.orientation,null==o?void 0:o.orientation,"vertical"),focusLoop:M(t.focusLoop,null==o?void 0:o.focusLoop,!0),focusWrap:M(t.focusWrap,null==o?void 0:o.focusWrap,!0),virtualFocus:M(t.virtualFocus,null==o?void 0:o.virtualFocus,!0)}),u=function({popover:e,...t}={}){let r=tf(t.store,tc(e,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));td(t,r);let n=null==r?void 0:r.getState(),i=rs({...t,store:r}),o=M(t.placement,null==n?void 0:n.placement,"bottom"),a=ti({...i.getState(),placement:o,currentPlacement:o,anchorElement:M(null==n?void 0:n.anchorElement,null),popoverElement:M(null==n?void 0:n.popoverElement,null),arrowElement:M(null==n?void 0:n.arrowElement,null),rendered:Symbol("rendered")},i,r);return{...i,...a,setAnchorElement:e=>a.setState("anchorElement",e),setPopoverElement:e=>a.setState("popoverElement",e),setArrowElement:e=>a.setState("arrowElement",e),render:()=>a.setState("rendered",Symbol("rendered"))}}({...t,placement:M(t.placement,null==o?void 0:o.placement,"bottom-start")}),s=M(t.value,null==o?void 0:o.value,t.defaultValue,""),c=M(t.selectedValue,null==o?void 0:o.selectedValue,null==i?void 0:i.values,t.defaultSelectedValue,""),f=Array.isArray(c),d={...l.getState(),...u.getState(),value:s,selectedValue:c,resetValueOnSelect:M(t.resetValueOnSelect,null==o?void 0:o.resetValueOnSelect,f),resetValueOnHide:M(t.resetValueOnHide,null==o?void 0:o.resetValueOnHide,f&&!e),activeValue:null==o?void 0:o.activeValue},p=ti(d,l,u,r);return nI&&to(p,()=>tu(p,["virtualFocus"],()=>{p.setState("virtualFocus",!1)})),to(p,()=>{if(e)return x(tu(p,["selectedValue"],t=>{Array.isArray(t.selectedValue)&&e.setValues(t.selectedValue)}),tu(e,["values"],e=>{p.setState("selectedValue",e.values)}))}),to(p,()=>tu(p,["resetValueOnHide","mounted"],e=>{!e.resetValueOnHide||e.mounted||p.setState("value",s)})),to(p,()=>tu(p,["open"],e=>{e.open||(p.setState("activeId",a),p.setState("moves",0))})),to(p,()=>tu(p,["moves","activeId"],(e,t)=>{e.moves===t.moves&&p.setState("activeValue",void 0)})),to(p,()=>ts(p,["moves","renderedItems"],(e,t)=>{if(e.moves===t.moves)return;let{activeId:r}=p.getState(),n=l.item(r);p.setState("activeValue",null==n?void 0:n.value)})),{...u,...l,...p,tag:e,setValue:e=>p.setState("value",e),resetValue:()=>p.setState("value",d.value),setSelectedValue:e=>p.setState("selectedValue",e)}}function nL(e={}){var t,r,n,i,o,a,l,u;let s;t=e,s=nw();let[c,f]=tR(nF,e={id:z((r=t={...t,tag:void 0!==t.tag?t.tag:s}).id),...r});return Q(f,[(n=e).tag]),tM(c,n,"value","setValue"),tM(c,n,"selectedValue","setSelectedValue"),tM(c,n,"resetValueOnHide"),tM(c,n,"resetValueOnSelect"),Object.assign((a=c,Q(l=f,[(u=n).popover]),tM(a,u,"placement"),i=ra(a,l,u),o=i,Q(f,[n.store]),tM(o,n,"items","setItems"),tM(i=o,n,"activeId","setActiveId"),tM(i,n,"includesBaseElement"),tM(i,n,"virtualFocus"),tM(i,n,"orientation"),tM(i,n,"rtl"),tM(i,n,"focusLoop"),tM(i,n,"focusWrap"),tM(i,n,"focusShift"),i),{tag:n.tag})}function nP(e={}){let t=nL(e);return(0,eo.jsx)(e7,{value:t,children:e.children})}e.s(["useComboboxStore",()=>nL],18364),e.s(["ComboboxProvider",()=>nP],78440);var nD=(0,R.createContext)(void 0),nB=es(function(e){let[t,r]=(0,R.useState)();return T(e={role:"group","aria-labelledby":t,...e=Y(e,e=>(0,eo.jsx)(nD.Provider,{value:r,children:e}),[])})});ea(function(e){return eu("div",nB(e))});var nG=es(function({store:e,...t}){return nB(t)});ea(function(e){return eu("div",nG(e))});var nk=es(function({store:e,...t}){let r=e6();return E(e=e||r,!1),"grid"===m(e.useState("contentElement"))&&(t={role:"rowgroup",...t}),t=nG({store:e,...t})}),nj=ea(function(e){return eu("div",nk(e))});e.s(["ComboboxGroup",()=>nj],59129);var nN=es(function(e){let t=(0,R.useContext)(nD),r=z(e.id);return H(()=>(null==t||t(r),()=>null==t?void 0:t(void 0)),[t,r]),T(e={id:r,"aria-hidden":!0,...e})});ea(function(e){return eu("div",nN(e))});var nU=es(function({store:e,...t}){return nN(t)});ea(function(e){return eu("div",nU(e))});var nq=es(function(e){return nU(e)}),nV=ea(function(e){return eu("div",nq(e))});e.s(["ComboboxGroupLabel",()=>nV],25998);var nH=e.i(38360);let nW={CASE_SENSITIVE_EQUAL:7,EQUAL:6,STARTS_WITH:5,WORD_STARTS_WITH:4,CONTAINS:3,ACRONYM:2,MATCHES:1,NO_MATCH:0},nK=(e,t)=>String(e.rankedValue).localeCompare(String(t.rankedValue));function nz(e,t,r={}){let{keys:n,threshold:i=nW.MATCHES,baseSort:o=nK,sorter:a=e=>e.sort((e,t)=>(function(e,t,r){let{rank:n,keyIndex:i}=e,{rank:o,keyIndex:a}=t;return n!==o?n>o?-1:1:i===a?r(e,t):i{let l=nQ(i,s,c),u=t,{minRanking:f,maxRanking:d,threshold:p}=o;return l=nW.MATCHES?l=f:l>d&&(l=d),l>e&&(e=l,r=a,n=p,u=i),{rankedValue:u,rank:e,keyIndex:r,keyThreshold:n}},{rankedValue:l,rank:nW.NO_MATCH,keyIndex:-1,keyThreshold:c.threshold}):{rankedValue:l,rank:nQ(l,s,c),keyIndex:-1,keyThreshold:c.threshold}),{rank:d,keyThreshold:p=i}=f;return d>=p&&e.push({...f,item:o,index:a}),e},[])).map(({item:e})=>e)}function nQ(e,t,r){if(e=n$(e,r),(t=n$(t,r)).length>e.length)return nW.NO_MATCH;if(e===t)return nW.CASE_SENSITIVE_EQUAL;let n=function*(e,t){let r=-1;for(;(r=e.indexOf(t,r+1))>-1;)yield r;return -1}(e=e.toLowerCase(),t=t.toLowerCase()),i=n.next(),o=i.value;if(e.length===t.length&&0===o)return nW.EQUAL;if(0===o)return nW.STARTS_WITH;let a=i;for(;!a.done;){if(a.value>0&&" "===e[a.value-1])return nW.WORD_STARTS_WITH;a=n.next()}return o>0?nW.CONTAINS:1===t.length?nW.NO_MATCH:(function(e){let t="",r=" ";for(let n=0;n-1))return nW.NO_MATCH;return r=o-l,n=i/t.length,nW.MATCHES+1/r*n}(e,t)}function n$(e,{keepDiacritics:t}){return e=`${e}`,t||(e=(0,nH.default)(e)),e}nz.rankings=nW;let nX={maxRanking:1/0,minRanking:-1/0};e.s(["matchSorter",()=>nz],70238)},29402,(e,t,r)=>{var n,i,o,a,l="__lodash_hash_undefined__",u=1/0,s="[object Arguments]",c="[object Array]",f="[object Boolean]",d="[object Date]",p="[object Error]",m="[object Function]",h="[object Map]",v="[object Number]",g="[object Object]",y="[object Promise]",b="[object RegExp]",S="[object Set]",C="[object String]",x="[object Symbol]",A="[object WeakMap]",E="[object ArrayBuffer]",w="[object DataView]",_=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,T=/^\w*$/,M=/^\./,R=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,O=/\\(\\)?/g,I=/^\[object .+?Constructor\]$/,F=/^(?:0|[1-9]\d*)$/,L={};L["[object Float32Array]"]=L["[object Float64Array]"]=L["[object Int8Array]"]=L["[object Int16Array]"]=L["[object Int32Array]"]=L["[object Uint8Array]"]=L["[object Uint8ClampedArray]"]=L["[object Uint16Array]"]=L["[object Uint32Array]"]=!0,L[s]=L[c]=L[E]=L[f]=L[w]=L[d]=L[p]=L[m]=L[h]=L[v]=L[g]=L[b]=L[S]=L[C]=L[A]=!1;var P=e.g&&e.g.Object===Object&&e.g,D="object"==typeof self&&self&&self.Object===Object&&self,B=P||D||Function("return this")(),G=r&&!r.nodeType&&r,k=G&&t&&!t.nodeType&&t,j=k&&k.exports===G&&P.process,N=function(){try{return j&&j.binding("util")}catch(e){}}(),U=N&&N.isTypedArray;function q(e,t){for(var r=-1,n=e?e.length:0,i=Array(n);++r-1},ex.prototype.set=function(e,t){var r=this.__data__,n=e_(r,e);return n<0?r.push([e,t]):r[n][1]=t,this},eA.prototype.clear=function(){this.__data__={hash:new eC,map:new(eu||ex),string:new eC}},eA.prototype.delete=function(e){return eP(this,e).delete(e)},eA.prototype.get=function(e){return eP(this,e).get(e)},eA.prototype.has=function(e){return eP(this,e).has(e)},eA.prototype.set=function(e,t){return eP(this,e).set(e,t),this},eE.prototype.add=eE.prototype.push=function(e){return this.__data__.set(e,l),this},eE.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.clear=function(){this.__data__=new ex},ew.prototype.delete=function(e){return this.__data__.delete(e)},ew.prototype.get=function(e){return this.__data__.get(e)},ew.prototype.has=function(e){return this.__data__.has(e)},ew.prototype.set=function(e,t){var r=this.__data__;if(r instanceof ex){var n=r.__data__;if(!eu||n.length<199)return n.push([e,t]),this;r=this.__data__=new eA(n)}return r.set(e,t),this};var eT=(n=function(e,t){return e&&eM(e,t,e0)},function(e,t){if(null==e)return e;if(!ez(e))return n(e,t);for(var r=e.length,i=-1,o=Object(e);++il))return!1;var s=o.get(e);if(s&&o.get(t))return s==t;var c=-1,f=!0,d=1&i?new eE:void 0;for(o.set(e,t),o.set(t,e);++c-1&&e%1==0&&e-1&&e%1==0&&e<=0x1fffffffffffff}function eX(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function eY(e){return!!e&&"object"==typeof e}function eZ(e){return"symbol"==typeof e||eY(e)&&ee.call(e)==x}var eJ=U?V(U):function(e){return eY(e)&&e$(e.length)&&!!L[ee.call(e)]};function e0(e){return ez(e)?function(e,t){var r=eK(e)||eW(e)?function(e,t){for(var r=-1,n=Array(e);++rt||o&&a&&u&&!l&&!s||n&&a&&u||!r&&u||!i)return 1;if(!n&&!o&&!s&&e=l)return u;return u*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)});u--;)l[u]=l[u].value;return l}(e,t,r))}},97442,e=>{e.v({Backdrop:"MissionSelect-module__N_AIjG__Backdrop",Group:"MissionSelect-module__N_AIjG__Group",GroupLabel:"MissionSelect-module__N_AIjG__GroupLabel",Input:"MissionSelect-module__N_AIjG__Input",InputWrapper:"MissionSelect-module__N_AIjG__InputWrapper",Item:"MissionSelect-module__N_AIjG__Item",ItemHeader:"MissionSelect-module__N_AIjG__ItemHeader",ItemMissionName:"MissionSelect-module__N_AIjG__ItemMissionName",ItemName:"MissionSelect-module__N_AIjG__ItemName",ItemType:"MissionSelect-module__N_AIjG__ItemType",ItemTypes:"MissionSelect-module__N_AIjG__ItemTypes",List:"MissionSelect-module__N_AIjG__List",NoResults:"MissionSelect-module__N_AIjG__NoResults",Popover:"MissionSelect-module__N_AIjG__Popover",SelectedName:"MissionSelect-module__N_AIjG__SelectedName",SelectedValue:"MissionSelect-module__N_AIjG__SelectedValue",Shortcut:"MissionSelect-module__N_AIjG__Shortcut"})},75056,e=>{"use strict";var t=e.i(40859),r=e.i(71645),n=e.i(8560),i=e.i(90072);e.s(["ACESFilmicToneMapping",()=>i.ACESFilmicToneMapping,"AddEquation",()=>i.AddEquation,"AddOperation",()=>i.AddOperation,"AdditiveAnimationBlendMode",()=>i.AdditiveAnimationBlendMode,"AdditiveBlending",()=>i.AdditiveBlending,"AgXToneMapping",()=>i.AgXToneMapping,"AlphaFormat",()=>i.AlphaFormat,"AlwaysCompare",()=>i.AlwaysCompare,"AlwaysDepth",()=>i.AlwaysDepth,"AlwaysStencilFunc",()=>i.AlwaysStencilFunc,"AmbientLight",()=>i.AmbientLight,"AnimationAction",()=>i.AnimationAction,"AnimationClip",()=>i.AnimationClip,"AnimationLoader",()=>i.AnimationLoader,"AnimationMixer",()=>i.AnimationMixer,"AnimationObjectGroup",()=>i.AnimationObjectGroup,"AnimationUtils",()=>i.AnimationUtils,"ArcCurve",()=>i.ArcCurve,"ArrayCamera",()=>i.ArrayCamera,"ArrowHelper",()=>i.ArrowHelper,"AttachedBindMode",()=>i.AttachedBindMode,"Audio",()=>i.Audio,"AudioAnalyser",()=>i.AudioAnalyser,"AudioContext",()=>i.AudioContext,"AudioListener",()=>i.AudioListener,"AudioLoader",()=>i.AudioLoader,"AxesHelper",()=>i.AxesHelper,"BackSide",()=>i.BackSide,"BasicDepthPacking",()=>i.BasicDepthPacking,"BasicShadowMap",()=>i.BasicShadowMap,"BatchedMesh",()=>i.BatchedMesh,"Bone",()=>i.Bone,"BooleanKeyframeTrack",()=>i.BooleanKeyframeTrack,"Box2",()=>i.Box2,"Box3",()=>i.Box3,"Box3Helper",()=>i.Box3Helper,"BoxGeometry",()=>i.BoxGeometry,"BoxHelper",()=>i.BoxHelper,"BufferAttribute",()=>i.BufferAttribute,"BufferGeometry",()=>i.BufferGeometry,"BufferGeometryLoader",()=>i.BufferGeometryLoader,"ByteType",()=>i.ByteType,"Cache",()=>i.Cache,"Camera",()=>i.Camera,"CameraHelper",()=>i.CameraHelper,"CanvasTexture",()=>i.CanvasTexture,"CapsuleGeometry",()=>i.CapsuleGeometry,"CatmullRomCurve3",()=>i.CatmullRomCurve3,"CineonToneMapping",()=>i.CineonToneMapping,"CircleGeometry",()=>i.CircleGeometry,"ClampToEdgeWrapping",()=>i.ClampToEdgeWrapping,"Clock",()=>i.Clock,"Color",()=>i.Color,"ColorKeyframeTrack",()=>i.ColorKeyframeTrack,"ColorManagement",()=>i.ColorManagement,"CompressedArrayTexture",()=>i.CompressedArrayTexture,"CompressedCubeTexture",()=>i.CompressedCubeTexture,"CompressedTexture",()=>i.CompressedTexture,"CompressedTextureLoader",()=>i.CompressedTextureLoader,"ConeGeometry",()=>i.ConeGeometry,"ConstantAlphaFactor",()=>i.ConstantAlphaFactor,"ConstantColorFactor",()=>i.ConstantColorFactor,"Controls",()=>i.Controls,"CubeCamera",()=>i.CubeCamera,"CubeDepthTexture",()=>i.CubeDepthTexture,"CubeReflectionMapping",()=>i.CubeReflectionMapping,"CubeRefractionMapping",()=>i.CubeRefractionMapping,"CubeTexture",()=>i.CubeTexture,"CubeTextureLoader",()=>i.CubeTextureLoader,"CubeUVReflectionMapping",()=>i.CubeUVReflectionMapping,"CubicBezierCurve",()=>i.CubicBezierCurve,"CubicBezierCurve3",()=>i.CubicBezierCurve3,"CubicInterpolant",()=>i.CubicInterpolant,"CullFaceBack",()=>i.CullFaceBack,"CullFaceFront",()=>i.CullFaceFront,"CullFaceFrontBack",()=>i.CullFaceFrontBack,"CullFaceNone",()=>i.CullFaceNone,"Curve",()=>i.Curve,"CurvePath",()=>i.CurvePath,"CustomBlending",()=>i.CustomBlending,"CustomToneMapping",()=>i.CustomToneMapping,"CylinderGeometry",()=>i.CylinderGeometry,"Cylindrical",()=>i.Cylindrical,"Data3DTexture",()=>i.Data3DTexture,"DataArrayTexture",()=>i.DataArrayTexture,"DataTexture",()=>i.DataTexture,"DataTextureLoader",()=>i.DataTextureLoader,"DataUtils",()=>i.DataUtils,"DecrementStencilOp",()=>i.DecrementStencilOp,"DecrementWrapStencilOp",()=>i.DecrementWrapStencilOp,"DefaultLoadingManager",()=>i.DefaultLoadingManager,"DepthFormat",()=>i.DepthFormat,"DepthStencilFormat",()=>i.DepthStencilFormat,"DepthTexture",()=>i.DepthTexture,"DetachedBindMode",()=>i.DetachedBindMode,"DirectionalLight",()=>i.DirectionalLight,"DirectionalLightHelper",()=>i.DirectionalLightHelper,"DiscreteInterpolant",()=>i.DiscreteInterpolant,"DodecahedronGeometry",()=>i.DodecahedronGeometry,"DoubleSide",()=>i.DoubleSide,"DstAlphaFactor",()=>i.DstAlphaFactor,"DstColorFactor",()=>i.DstColorFactor,"DynamicCopyUsage",()=>i.DynamicCopyUsage,"DynamicDrawUsage",()=>i.DynamicDrawUsage,"DynamicReadUsage",()=>i.DynamicReadUsage,"EdgesGeometry",()=>i.EdgesGeometry,"EllipseCurve",()=>i.EllipseCurve,"EqualCompare",()=>i.EqualCompare,"EqualDepth",()=>i.EqualDepth,"EqualStencilFunc",()=>i.EqualStencilFunc,"EquirectangularReflectionMapping",()=>i.EquirectangularReflectionMapping,"EquirectangularRefractionMapping",()=>i.EquirectangularRefractionMapping,"Euler",()=>i.Euler,"EventDispatcher",()=>i.EventDispatcher,"ExternalTexture",()=>i.ExternalTexture,"ExtrudeGeometry",()=>i.ExtrudeGeometry,"FileLoader",()=>i.FileLoader,"Float16BufferAttribute",()=>i.Float16BufferAttribute,"Float32BufferAttribute",()=>i.Float32BufferAttribute,"FloatType",()=>i.FloatType,"Fog",()=>i.Fog,"FogExp2",()=>i.FogExp2,"FramebufferTexture",()=>i.FramebufferTexture,"FrontSide",()=>i.FrontSide,"Frustum",()=>i.Frustum,"FrustumArray",()=>i.FrustumArray,"GLBufferAttribute",()=>i.GLBufferAttribute,"GLSL1",()=>i.GLSL1,"GLSL3",()=>i.GLSL3,"GreaterCompare",()=>i.GreaterCompare,"GreaterDepth",()=>i.GreaterDepth,"GreaterEqualCompare",()=>i.GreaterEqualCompare,"GreaterEqualDepth",()=>i.GreaterEqualDepth,"GreaterEqualStencilFunc",()=>i.GreaterEqualStencilFunc,"GreaterStencilFunc",()=>i.GreaterStencilFunc,"GridHelper",()=>i.GridHelper,"Group",()=>i.Group,"HalfFloatType",()=>i.HalfFloatType,"HemisphereLight",()=>i.HemisphereLight,"HemisphereLightHelper",()=>i.HemisphereLightHelper,"IcosahedronGeometry",()=>i.IcosahedronGeometry,"ImageBitmapLoader",()=>i.ImageBitmapLoader,"ImageLoader",()=>i.ImageLoader,"ImageUtils",()=>i.ImageUtils,"IncrementStencilOp",()=>i.IncrementStencilOp,"IncrementWrapStencilOp",()=>i.IncrementWrapStencilOp,"InstancedBufferAttribute",()=>i.InstancedBufferAttribute,"InstancedBufferGeometry",()=>i.InstancedBufferGeometry,"InstancedInterleavedBuffer",()=>i.InstancedInterleavedBuffer,"InstancedMesh",()=>i.InstancedMesh,"Int16BufferAttribute",()=>i.Int16BufferAttribute,"Int32BufferAttribute",()=>i.Int32BufferAttribute,"Int8BufferAttribute",()=>i.Int8BufferAttribute,"IntType",()=>i.IntType,"InterleavedBuffer",()=>i.InterleavedBuffer,"InterleavedBufferAttribute",()=>i.InterleavedBufferAttribute,"Interpolant",()=>i.Interpolant,"InterpolateDiscrete",()=>i.InterpolateDiscrete,"InterpolateLinear",()=>i.InterpolateLinear,"InterpolateSmooth",()=>i.InterpolateSmooth,"InterpolationSamplingMode",()=>i.InterpolationSamplingMode,"InterpolationSamplingType",()=>i.InterpolationSamplingType,"InvertStencilOp",()=>i.InvertStencilOp,"KeepStencilOp",()=>i.KeepStencilOp,"KeyframeTrack",()=>i.KeyframeTrack,"LOD",()=>i.LOD,"LatheGeometry",()=>i.LatheGeometry,"Layers",()=>i.Layers,"LessCompare",()=>i.LessCompare,"LessDepth",()=>i.LessDepth,"LessEqualCompare",()=>i.LessEqualCompare,"LessEqualDepth",()=>i.LessEqualDepth,"LessEqualStencilFunc",()=>i.LessEqualStencilFunc,"LessStencilFunc",()=>i.LessStencilFunc,"Light",()=>i.Light,"LightProbe",()=>i.LightProbe,"Line",()=>i.Line,"Line3",()=>i.Line3,"LineBasicMaterial",()=>i.LineBasicMaterial,"LineCurve",()=>i.LineCurve,"LineCurve3",()=>i.LineCurve3,"LineDashedMaterial",()=>i.LineDashedMaterial,"LineLoop",()=>i.LineLoop,"LineSegments",()=>i.LineSegments,"LinearFilter",()=>i.LinearFilter,"LinearInterpolant",()=>i.LinearInterpolant,"LinearMipMapLinearFilter",()=>i.LinearMipMapLinearFilter,"LinearMipMapNearestFilter",()=>i.LinearMipMapNearestFilter,"LinearMipmapLinearFilter",()=>i.LinearMipmapLinearFilter,"LinearMipmapNearestFilter",()=>i.LinearMipmapNearestFilter,"LinearSRGBColorSpace",()=>i.LinearSRGBColorSpace,"LinearToneMapping",()=>i.LinearToneMapping,"LinearTransfer",()=>i.LinearTransfer,"Loader",()=>i.Loader,"LoaderUtils",()=>i.LoaderUtils,"LoadingManager",()=>i.LoadingManager,"LoopOnce",()=>i.LoopOnce,"LoopPingPong",()=>i.LoopPingPong,"LoopRepeat",()=>i.LoopRepeat,"MOUSE",()=>i.MOUSE,"Material",()=>i.Material,"MaterialLoader",()=>i.MaterialLoader,"MathUtils",()=>i.MathUtils,"Matrix2",()=>i.Matrix2,"Matrix3",()=>i.Matrix3,"Matrix4",()=>i.Matrix4,"MaxEquation",()=>i.MaxEquation,"Mesh",()=>i.Mesh,"MeshBasicMaterial",()=>i.MeshBasicMaterial,"MeshDepthMaterial",()=>i.MeshDepthMaterial,"MeshDistanceMaterial",()=>i.MeshDistanceMaterial,"MeshLambertMaterial",()=>i.MeshLambertMaterial,"MeshMatcapMaterial",()=>i.MeshMatcapMaterial,"MeshNormalMaterial",()=>i.MeshNormalMaterial,"MeshPhongMaterial",()=>i.MeshPhongMaterial,"MeshPhysicalMaterial",()=>i.MeshPhysicalMaterial,"MeshStandardMaterial",()=>i.MeshStandardMaterial,"MeshToonMaterial",()=>i.MeshToonMaterial,"MinEquation",()=>i.MinEquation,"MirroredRepeatWrapping",()=>i.MirroredRepeatWrapping,"MixOperation",()=>i.MixOperation,"MultiplyBlending",()=>i.MultiplyBlending,"MultiplyOperation",()=>i.MultiplyOperation,"NearestFilter",()=>i.NearestFilter,"NearestMipMapLinearFilter",()=>i.NearestMipMapLinearFilter,"NearestMipMapNearestFilter",()=>i.NearestMipMapNearestFilter,"NearestMipmapLinearFilter",()=>i.NearestMipmapLinearFilter,"NearestMipmapNearestFilter",()=>i.NearestMipmapNearestFilter,"NeutralToneMapping",()=>i.NeutralToneMapping,"NeverCompare",()=>i.NeverCompare,"NeverDepth",()=>i.NeverDepth,"NeverStencilFunc",()=>i.NeverStencilFunc,"NoBlending",()=>i.NoBlending,"NoColorSpace",()=>i.NoColorSpace,"NoNormalPacking",()=>i.NoNormalPacking,"NoToneMapping",()=>i.NoToneMapping,"NormalAnimationBlendMode",()=>i.NormalAnimationBlendMode,"NormalBlending",()=>i.NormalBlending,"NormalGAPacking",()=>i.NormalGAPacking,"NormalRGPacking",()=>i.NormalRGPacking,"NotEqualCompare",()=>i.NotEqualCompare,"NotEqualDepth",()=>i.NotEqualDepth,"NotEqualStencilFunc",()=>i.NotEqualStencilFunc,"NumberKeyframeTrack",()=>i.NumberKeyframeTrack,"Object3D",()=>i.Object3D,"ObjectLoader",()=>i.ObjectLoader,"ObjectSpaceNormalMap",()=>i.ObjectSpaceNormalMap,"OctahedronGeometry",()=>i.OctahedronGeometry,"OneFactor",()=>i.OneFactor,"OneMinusConstantAlphaFactor",()=>i.OneMinusConstantAlphaFactor,"OneMinusConstantColorFactor",()=>i.OneMinusConstantColorFactor,"OneMinusDstAlphaFactor",()=>i.OneMinusDstAlphaFactor,"OneMinusDstColorFactor",()=>i.OneMinusDstColorFactor,"OneMinusSrcAlphaFactor",()=>i.OneMinusSrcAlphaFactor,"OneMinusSrcColorFactor",()=>i.OneMinusSrcColorFactor,"OrthographicCamera",()=>i.OrthographicCamera,"PCFShadowMap",()=>i.PCFShadowMap,"PCFSoftShadowMap",()=>i.PCFSoftShadowMap,"PMREMGenerator",()=>n.PMREMGenerator,"Path",()=>i.Path,"PerspectiveCamera",()=>i.PerspectiveCamera,"Plane",()=>i.Plane,"PlaneGeometry",()=>i.PlaneGeometry,"PlaneHelper",()=>i.PlaneHelper,"PointLight",()=>i.PointLight,"PointLightHelper",()=>i.PointLightHelper,"Points",()=>i.Points,"PointsMaterial",()=>i.PointsMaterial,"PolarGridHelper",()=>i.PolarGridHelper,"PolyhedronGeometry",()=>i.PolyhedronGeometry,"PositionalAudio",()=>i.PositionalAudio,"PropertyBinding",()=>i.PropertyBinding,"PropertyMixer",()=>i.PropertyMixer,"QuadraticBezierCurve",()=>i.QuadraticBezierCurve,"QuadraticBezierCurve3",()=>i.QuadraticBezierCurve3,"Quaternion",()=>i.Quaternion,"QuaternionKeyframeTrack",()=>i.QuaternionKeyframeTrack,"QuaternionLinearInterpolant",()=>i.QuaternionLinearInterpolant,"R11_EAC_Format",()=>i.R11_EAC_Format,"RED_GREEN_RGTC2_Format",()=>i.RED_GREEN_RGTC2_Format,"RED_RGTC1_Format",()=>i.RED_RGTC1_Format,"REVISION",()=>i.REVISION,"RG11_EAC_Format",()=>i.RG11_EAC_Format,"RGBADepthPacking",()=>i.RGBADepthPacking,"RGBAFormat",()=>i.RGBAFormat,"RGBAIntegerFormat",()=>i.RGBAIntegerFormat,"RGBA_ASTC_10x10_Format",()=>i.RGBA_ASTC_10x10_Format,"RGBA_ASTC_10x5_Format",()=>i.RGBA_ASTC_10x5_Format,"RGBA_ASTC_10x6_Format",()=>i.RGBA_ASTC_10x6_Format,"RGBA_ASTC_10x8_Format",()=>i.RGBA_ASTC_10x8_Format,"RGBA_ASTC_12x10_Format",()=>i.RGBA_ASTC_12x10_Format,"RGBA_ASTC_12x12_Format",()=>i.RGBA_ASTC_12x12_Format,"RGBA_ASTC_4x4_Format",()=>i.RGBA_ASTC_4x4_Format,"RGBA_ASTC_5x4_Format",()=>i.RGBA_ASTC_5x4_Format,"RGBA_ASTC_5x5_Format",()=>i.RGBA_ASTC_5x5_Format,"RGBA_ASTC_6x5_Format",()=>i.RGBA_ASTC_6x5_Format,"RGBA_ASTC_6x6_Format",()=>i.RGBA_ASTC_6x6_Format,"RGBA_ASTC_8x5_Format",()=>i.RGBA_ASTC_8x5_Format,"RGBA_ASTC_8x6_Format",()=>i.RGBA_ASTC_8x6_Format,"RGBA_ASTC_8x8_Format",()=>i.RGBA_ASTC_8x8_Format,"RGBA_BPTC_Format",()=>i.RGBA_BPTC_Format,"RGBA_ETC2_EAC_Format",()=>i.RGBA_ETC2_EAC_Format,"RGBA_PVRTC_2BPPV1_Format",()=>i.RGBA_PVRTC_2BPPV1_Format,"RGBA_PVRTC_4BPPV1_Format",()=>i.RGBA_PVRTC_4BPPV1_Format,"RGBA_S3TC_DXT1_Format",()=>i.RGBA_S3TC_DXT1_Format,"RGBA_S3TC_DXT3_Format",()=>i.RGBA_S3TC_DXT3_Format,"RGBA_S3TC_DXT5_Format",()=>i.RGBA_S3TC_DXT5_Format,"RGBDepthPacking",()=>i.RGBDepthPacking,"RGBFormat",()=>i.RGBFormat,"RGBIntegerFormat",()=>i.RGBIntegerFormat,"RGB_BPTC_SIGNED_Format",()=>i.RGB_BPTC_SIGNED_Format,"RGB_BPTC_UNSIGNED_Format",()=>i.RGB_BPTC_UNSIGNED_Format,"RGB_ETC1_Format",()=>i.RGB_ETC1_Format,"RGB_ETC2_Format",()=>i.RGB_ETC2_Format,"RGB_PVRTC_2BPPV1_Format",()=>i.RGB_PVRTC_2BPPV1_Format,"RGB_PVRTC_4BPPV1_Format",()=>i.RGB_PVRTC_4BPPV1_Format,"RGB_S3TC_DXT1_Format",()=>i.RGB_S3TC_DXT1_Format,"RGDepthPacking",()=>i.RGDepthPacking,"RGFormat",()=>i.RGFormat,"RGIntegerFormat",()=>i.RGIntegerFormat,"RawShaderMaterial",()=>i.RawShaderMaterial,"Ray",()=>i.Ray,"Raycaster",()=>i.Raycaster,"RectAreaLight",()=>i.RectAreaLight,"RedFormat",()=>i.RedFormat,"RedIntegerFormat",()=>i.RedIntegerFormat,"ReinhardToneMapping",()=>i.ReinhardToneMapping,"RenderTarget",()=>i.RenderTarget,"RenderTarget3D",()=>i.RenderTarget3D,"RepeatWrapping",()=>i.RepeatWrapping,"ReplaceStencilOp",()=>i.ReplaceStencilOp,"ReverseSubtractEquation",()=>i.ReverseSubtractEquation,"RingGeometry",()=>i.RingGeometry,"SIGNED_R11_EAC_Format",()=>i.SIGNED_R11_EAC_Format,"SIGNED_RED_GREEN_RGTC2_Format",()=>i.SIGNED_RED_GREEN_RGTC2_Format,"SIGNED_RED_RGTC1_Format",()=>i.SIGNED_RED_RGTC1_Format,"SIGNED_RG11_EAC_Format",()=>i.SIGNED_RG11_EAC_Format,"SRGBColorSpace",()=>i.SRGBColorSpace,"SRGBTransfer",()=>i.SRGBTransfer,"Scene",()=>i.Scene,"ShaderChunk",()=>n.ShaderChunk,"ShaderLib",()=>n.ShaderLib,"ShaderMaterial",()=>i.ShaderMaterial,"ShadowMaterial",()=>i.ShadowMaterial,"Shape",()=>i.Shape,"ShapeGeometry",()=>i.ShapeGeometry,"ShapePath",()=>i.ShapePath,"ShapeUtils",()=>i.ShapeUtils,"ShortType",()=>i.ShortType,"Skeleton",()=>i.Skeleton,"SkeletonHelper",()=>i.SkeletonHelper,"SkinnedMesh",()=>i.SkinnedMesh,"Source",()=>i.Source,"Sphere",()=>i.Sphere,"SphereGeometry",()=>i.SphereGeometry,"Spherical",()=>i.Spherical,"SphericalHarmonics3",()=>i.SphericalHarmonics3,"SplineCurve",()=>i.SplineCurve,"SpotLight",()=>i.SpotLight,"SpotLightHelper",()=>i.SpotLightHelper,"Sprite",()=>i.Sprite,"SpriteMaterial",()=>i.SpriteMaterial,"SrcAlphaFactor",()=>i.SrcAlphaFactor,"SrcAlphaSaturateFactor",()=>i.SrcAlphaSaturateFactor,"SrcColorFactor",()=>i.SrcColorFactor,"StaticCopyUsage",()=>i.StaticCopyUsage,"StaticDrawUsage",()=>i.StaticDrawUsage,"StaticReadUsage",()=>i.StaticReadUsage,"StereoCamera",()=>i.StereoCamera,"StreamCopyUsage",()=>i.StreamCopyUsage,"StreamDrawUsage",()=>i.StreamDrawUsage,"StreamReadUsage",()=>i.StreamReadUsage,"StringKeyframeTrack",()=>i.StringKeyframeTrack,"SubtractEquation",()=>i.SubtractEquation,"SubtractiveBlending",()=>i.SubtractiveBlending,"TOUCH",()=>i.TOUCH,"TangentSpaceNormalMap",()=>i.TangentSpaceNormalMap,"TetrahedronGeometry",()=>i.TetrahedronGeometry,"Texture",()=>i.Texture,"TextureLoader",()=>i.TextureLoader,"TextureUtils",()=>i.TextureUtils,"Timer",()=>i.Timer,"TimestampQuery",()=>i.TimestampQuery,"TorusGeometry",()=>i.TorusGeometry,"TorusKnotGeometry",()=>i.TorusKnotGeometry,"Triangle",()=>i.Triangle,"TriangleFanDrawMode",()=>i.TriangleFanDrawMode,"TriangleStripDrawMode",()=>i.TriangleStripDrawMode,"TrianglesDrawMode",()=>i.TrianglesDrawMode,"TubeGeometry",()=>i.TubeGeometry,"UVMapping",()=>i.UVMapping,"Uint16BufferAttribute",()=>i.Uint16BufferAttribute,"Uint32BufferAttribute",()=>i.Uint32BufferAttribute,"Uint8BufferAttribute",()=>i.Uint8BufferAttribute,"Uint8ClampedBufferAttribute",()=>i.Uint8ClampedBufferAttribute,"Uniform",()=>i.Uniform,"UniformsGroup",()=>i.UniformsGroup,"UniformsLib",()=>n.UniformsLib,"UniformsUtils",()=>i.UniformsUtils,"UnsignedByteType",()=>i.UnsignedByteType,"UnsignedInt101111Type",()=>i.UnsignedInt101111Type,"UnsignedInt248Type",()=>i.UnsignedInt248Type,"UnsignedInt5999Type",()=>i.UnsignedInt5999Type,"UnsignedIntType",()=>i.UnsignedIntType,"UnsignedShort4444Type",()=>i.UnsignedShort4444Type,"UnsignedShort5551Type",()=>i.UnsignedShort5551Type,"UnsignedShortType",()=>i.UnsignedShortType,"VSMShadowMap",()=>i.VSMShadowMap,"Vector2",()=>i.Vector2,"Vector3",()=>i.Vector3,"Vector4",()=>i.Vector4,"VectorKeyframeTrack",()=>i.VectorKeyframeTrack,"VideoFrameTexture",()=>i.VideoFrameTexture,"VideoTexture",()=>i.VideoTexture,"WebGL3DRenderTarget",()=>i.WebGL3DRenderTarget,"WebGLArrayRenderTarget",()=>i.WebGLArrayRenderTarget,"WebGLCoordinateSystem",()=>i.WebGLCoordinateSystem,"WebGLCubeRenderTarget",()=>i.WebGLCubeRenderTarget,"WebGLRenderTarget",()=>i.WebGLRenderTarget,"WebGLRenderer",()=>n.WebGLRenderer,"WebGLUtils",()=>n.WebGLUtils,"WebGPUCoordinateSystem",()=>i.WebGPUCoordinateSystem,"WebXRController",()=>i.WebXRController,"WireframeGeometry",()=>i.WireframeGeometry,"WrapAroundEnding",()=>i.WrapAroundEnding,"ZeroCurvatureEnding",()=>i.ZeroCurvatureEnding,"ZeroFactor",()=>i.ZeroFactor,"ZeroSlopeEnding",()=>i.ZeroSlopeEnding,"ZeroStencilOp",()=>i.ZeroStencilOp,"createCanvasElement",()=>i.createCanvasElement,"error",()=>i.error,"getConsoleFunction",()=>i.getConsoleFunction,"log",()=>i.log,"setConsoleFunction",()=>i.setConsoleFunction,"warn",()=>i.warn,"warnOnce",()=>i.warnOnce],32009);var o=e.i(32009);function a(e,t){let r;return(...n)=>{window.clearTimeout(r),r=window.setTimeout(()=>e(...n),t)}}let l=["x","y","top","bottom","left","right","width","height"];var u=e.i(46791),s=e.i(43476);function c({ref:e,children:n,fallback:i,resize:u,style:c,gl:f,events:d=t.f,eventSource:p,eventPrefix:m,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,scene:w,onPointerMissed:_,onCreated:T,...M}){r.useMemo(()=>(0,t.e)(o),[]);let R=(0,t.u)(),[O,I]=function({debounce:e,scroll:t,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){var o,u,s;let c=n||("u"(v.current=!0,()=>void(v.current=!1)));let[g,y,b]=(0,r.useMemo)(()=>{let e=()=>{let e,t;if(!p.current.element)return;let{left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f}=p.current.element.getBoundingClientRect(),m={left:r,top:n,width:o,height:a,bottom:u,right:s,x:c,y:f};p.current.element instanceof HTMLElement&&i&&(m.height=p.current.element.offsetHeight,m.width=p.current.element.offsetWidth),Object.freeze(m),v.current&&(e=p.current.lastBounds,t=m,!l.every(r=>e[r]===t[r]))&&d(p.current.lastBounds=m)};return[e,h?a(e,h):e,m?a(e,m):e]},[d,i,m,h]);function S(){p.current.scrollContainers&&(p.current.scrollContainers.forEach(e=>e.removeEventListener("scroll",b,!0)),p.current.scrollContainers=null),p.current.resizeObserver&&(p.current.resizeObserver.disconnect(),p.current.resizeObserver=null),p.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",p.current.orientationHandler))}function C(){p.current.element&&(p.current.resizeObserver=new c(b),p.current.resizeObserver.observe(p.current.element),t&&p.current.scrollContainers&&p.current.scrollContainers.forEach(e=>e.addEventListener("scroll",b,{capture:!0,passive:!0})),p.current.orientationHandler=()=>{b()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",p.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",p.current.orientationHandler))}return o=b,u=!!t,(0,r.useEffect)(()=>{if(u)return window.addEventListener("scroll",o,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",o,!0)},[o,u]),s=y,(0,r.useEffect)(()=>(window.addEventListener("resize",s),()=>void window.removeEventListener("resize",s)),[s]),(0,r.useEffect)(()=>{S(),C()},[t,b,y]),(0,r.useEffect)(()=>S,[]),[e=>{e&&e!==p.current.element&&(S(),p.current.element=e,p.current.scrollContainers=function e(t){let r=[];if(!t||t===document.body)return r;let{overflow:n,overflowX:i,overflowY:o}=window.getComputedStyle(t);return[n,i,o].some(e=>"auto"===e||"scroll"===e)&&r.push(t),[...r,...e(t.parentElement)]}(e),C())},f,g]}({scroll:!0,debounce:{scroll:50,resize:0},...u}),F=r.useRef(null),L=r.useRef(null);r.useImperativeHandle(e,()=>F.current);let P=(0,t.a)(_),[D,B]=r.useState(!1),[G,k]=r.useState(!1);if(D)throw D;if(G)throw G;let j=r.useRef(null);(0,t.b)(()=>{let e=F.current;I.width>0&&I.height>0&&e&&(j.current||(j.current=(0,t.c)(e)),async function(){await j.current.configure({gl:f,scene:w,events:d,shadows:h,linear:v,flat:g,legacy:y,orthographic:b,frameloop:S,dpr:C,performance:x,raycaster:A,camera:E,size:I,onPointerMissed:(...e)=>null==P.current?void 0:P.current(...e),onCreated:e=>{null==e.events.connect||e.events.connect(p?(0,t.i)(p)?p.current:p:L.current),m&&e.setEvents({compute:(e,t)=>{let r=e[m+"X"],n=e[m+"Y"];t.pointer.set(r/t.size.width*2-1,-(2*(n/t.size.height))+1),t.raycaster.setFromCamera(t.pointer,t.camera)}}),null==T||T(e)}}),j.current.render((0,s.jsx)(R,{children:(0,s.jsx)(t.E,{set:k,children:(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)(t.B,{set:B}),children:null!=n?n:null})})}))}())}),r.useEffect(()=>{let e=F.current;if(e)return()=>(0,t.d)(e)},[]);let N=p?"none":"auto";return(0,s.jsx)("div",{ref:L,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:N,...c},...M,children:(0,s.jsx)("div",{ref:O,style:{width:"100%",height:"100%"},children:(0,s.jsx)("canvas",{ref:F,style:{display:"block"},children:i})})})}function f(e){return(0,s.jsx)(u.FiberProvider,{children:(0,s.jsx)(c,{...e})})}e.i(89499),e.s(["Canvas",()=>f],75056)}]); \ No newline at end of file diff --git a/docs/_not-found/__next._full.txt b/docs/_not-found/__next._full.txt index 3bcec8d1..9ea289c6 100644 --- a/docs/_not-found/__next._full.txt +++ b/docs/_not-found/__next._full.txt @@ -8,7 +8,7 @@ a:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +0:{"P":null,"b":"GVV-bte23-C1OKGsIpGF4","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} 9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] 7:null diff --git a/docs/_not-found/__next._head.txt b/docs/_not-found/__next._head.txt index f6ea5756..7452a8cc 100644 --- a/docs/_not-found/__next._head.txt +++ b/docs/_not-found/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._index.txt b/docs/_not-found/__next._index.txt index a6efb165..0f8c5084 100644 --- a/docs/_not-found/__next._index.txt +++ b/docs/_not-found/__next._index.txt @@ -3,4 +3,4 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._not-found.__PAGE__.txt b/docs/_not-found/__next._not-found.__PAGE__.txt index b619c104..962ecc14 100644 --- a/docs/_not-found/__next._not-found.__PAGE__.txt +++ b/docs/_not-found/__next._not-found.__PAGE__.txt @@ -1,5 +1,5 @@ 1:"$Sreact.fragment" 2:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 3:"$Sreact.suspense" -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],null,["$","$L2",null,{"children":["$","$3",null,{"name":"Next.MetadataOutlet","children":"$@4"}]}]]}],"loading":null,"isPartial":false} 4:null diff --git a/docs/_not-found/__next._not-found.txt b/docs/_not-found/__next._not-found.txt index 10690d3b..13ca9055 100644 --- a/docs/_not-found/__next._not-found.txt +++ b/docs/_not-found/__next._not-found.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/_not-found/__next._tree.txt b/docs/_not-found/__next._tree.txt index 053892a9..a21f46a7 100644 --- a/docs/_not-found/__next._tree.txt +++ b/docs/_not-found/__next._tree.txt @@ -1,2 +1,2 @@ :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"/_not-found","paramType":null,"paramKey":"/_not-found","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/_not-found/index.html b/docs/_not-found/index.html index b99edd65..420eaa0e 100644 --- a/docs/_not-found/index.html +++ b/docs/_not-found/index.html @@ -1 +1 @@ -404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.MapGenius – Explore maps for Tribes 2

404

This page could not be found.

\ No newline at end of file diff --git a/docs/_not-found/index.txt b/docs/_not-found/index.txt index 3bcec8d1..9ea289c6 100644 --- a/docs/_not-found/index.txt +++ b/docs/_not-found/index.txt @@ -8,7 +8,7 @@ a:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] c:I[68027,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} +0:{"P":null,"b":"GVV-bte23-C1OKGsIpGF4","c":["","_not-found",""],"q":"","i":false,"f":[[["",{"children":["/_not-found",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:style","children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style","children":404}],["$","div",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style","children":["$","h2",null,{"style":"$0:f:0:1:0:props:children:1:props:children:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style","children":"This page could not be found."}]}]]}]}]],null,["$","$L5",null,{"children":["$","$6",null,{"name":"Next.MetadataOutlet","children":"$@7"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[["$","meta",null,{"name":"robots","content":"noindex"}],["$","$L8",null,{"children":"$L9"}],["$","div",null,{"hidden":true,"children":["$","$La",null,{"children":["$","$6",null,{"name":"Next.Metadata","children":"$Lb"}]}]}],null]}],false]],"m":"$undefined","G":["$c","$undefined"],"S":true} 9:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] d:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] 7:null diff --git a/docs/index.html b/docs/index.html index 17311634..a580969d 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/index.txt b/docs/index.txt index dddeeb18..a736e8b8 100644 --- a/docs/index.txt +++ b/docs/index.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/63afa42c92661c50.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js"],"default"] +6:I[31713,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","/t2-mapper/_next/static/chunks/990cfb71eaf1c762.js","/t2-mapper/_next/static/chunks/b30d580062e7b044.js","/t2-mapper/_next/static/chunks/e01e6e76b521dd3c.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/16e2b7e83646cebc.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js","/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","/t2-mapper/_next/static/chunks/0a364447adf881eb.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/1273ef014eba2bd5.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/63afa42c92661c50.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/cc36ef62835b35ab.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/fcfc8a45de71c4a4.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"P":null,"b":"GVV-bte23-C1OKGsIpGF4","c":["",""],"q":"","i":false,"f":[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/990cfb71eaf1c762.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/b30d580062e7b044.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/e01e6e76b521dd3c.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/16e2b7e83646cebc.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/af18e4f3fa33de6b.js","async":true,"nonce":"$undefined"}],["$","script","script-10",{"src":"/t2-mapper/_next/static/chunks/0a364447adf881eb.js","async":true,"nonce":"$undefined"}],["$","script","script-11",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/shapes/__next._full.txt b/docs/shapes/__next._full.txt index c9659abe..3a6b67a1 100644 --- a/docs/shapes/__next._full.txt +++ b/docs/shapes/__next._full.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] +6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/ad4fd30929cca23f.js","/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","/t2-mapper/_next/static/chunks/44a6df9214eeac58.js","/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","/t2-mapper/_next/static/chunks/d712fc4c15db64e6.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/9549e76d03bf90ea.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"P":null,"b":"GVV-bte23-C1OKGsIpGF4","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ad4fd30929cca23f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/44a6df9214eeac58.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/d712fc4c15db64e6.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9549e76d03bf90ea.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/docs/shapes/__next._head.txt b/docs/shapes/__next._head.txt index b57734f2..c07e1c68 100644 --- a/docs/shapes/__next._head.txt +++ b/docs/shapes/__next._head.txt @@ -3,4 +3,4 @@ 3:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 4:"$Sreact.suspense" 5:I[27201,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"IconMark"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","h",{"children":[null,["$","$L2",null,{"children":[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]]}],["$","div",null,{"hidden":true,"children":["$","$L3",null,{"children":["$","$4",null,{"name":"Next.Metadata","children":[["$","title","0",{"children":"MapGenius – Explore maps for Tribes 2"}],["$","meta","1",{"name":"description","content":"Tribes 2 forever."}],["$","link","2",{"rel":"icon","href":"/t2-mapper/icon.png?icon.2911bba1.png","sizes":"108x128","type":"image/png"}],["$","$L5","3",{}]]}]}]}],null]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/__next._index.txt b/docs/shapes/__next._index.txt index a6efb165..0f8c5084 100644 --- a/docs/shapes/__next._index.txt +++ b/docs/shapes/__next._index.txt @@ -3,4 +3,4 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","template":["$","$L4",null,{}],"notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]]}]}]}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/__next._tree.txt b/docs/shapes/__next._tree.txt index 8a9a608b..99b817c4 100644 --- a/docs/shapes/__next._tree.txt +++ b/docs/shapes/__next._tree.txt @@ -1,3 +1,3 @@ :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"shapes","paramType":null,"paramKey":"shapes","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","tree":{"name":"","paramType":null,"paramKey":"","hasRuntimePrefetch":false,"slots":{"children":{"name":"shapes","paramType":null,"paramKey":"shapes","hasRuntimePrefetch":false,"slots":{"children":{"name":"__PAGE__","paramType":null,"paramKey":"__PAGE__","hasRuntimePrefetch":false,"slots":null,"isRootLayout":false}},"isRootLayout":false}},"isRootLayout":true},"staleTime":300} diff --git a/docs/shapes/__next.shapes.__PAGE__.txt b/docs/shapes/__next.shapes.__PAGE__.txt index f42c911d..3d33d789 100644 --- a/docs/shapes/__next.shapes.__PAGE__.txt +++ b/docs/shapes/__next.shapes.__PAGE__.txt @@ -1,10 +1,10 @@ 1:"$Sreact.fragment" 2:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -3:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] +3:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/ad4fd30929cca23f.js","/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","/t2-mapper/_next/static/chunks/44a6df9214eeac58.js","/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","/t2-mapper/_next/static/chunks/d712fc4c15db64e6.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/9549e76d03bf90ea.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 6:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] 7:"$Sreact.suspense" -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[["$","$L2",null,{"Component":"$3","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@4","$@5"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","precedence":"next"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ad4fd30929cca23f.js","async":true}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","async":true}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/44a6df9214eeac58.js","async":true}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","async":true}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/d712fc4c15db64e6.js","async":true}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9549e76d03bf90ea.js","async":true}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true}]],["$","$L6",null,{"children":["$","$7",null,{"name":"Next.MetadataOutlet","children":"$@8"}]}]]}],"loading":null,"isPartial":false} 4:{} 5:"$0:rsc:props:children:0:props:serverProvidedParams:params" 8:null diff --git a/docs/shapes/__next.shapes.txt b/docs/shapes/__next.shapes.txt index 10690d3b..13ca9055 100644 --- a/docs/shapes/__next.shapes.txt +++ b/docs/shapes/__next.shapes.txt @@ -1,4 +1,4 @@ 1:"$Sreact.fragment" 2:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 3:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] -0:{"buildId":"HUIHRvyaa6D1abkRRPPoG","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} +0:{"buildId":"GVV-bte23-C1OKGsIpGF4","rsc":["$","$1","c",{"children":[null,["$","$L2",null,{"parallelRouterKey":"children","template":["$","$L3",null,{}]}]]}],"loading":null,"isPartial":false} diff --git a/docs/shapes/index.html b/docs/shapes/index.html index 535b1a7d..e4cc1648 100644 --- a/docs/shapes/index.html +++ b/docs/shapes/index.html @@ -1 +1 @@ -MapGenius – Explore maps for Tribes 2 \ No newline at end of file +MapGenius – Explore maps for Tribes 2 \ No newline at end of file diff --git a/docs/shapes/index.txt b/docs/shapes/index.txt index c9659abe..3a6b67a1 100644 --- a/docs/shapes/index.txt +++ b/docs/shapes/index.txt @@ -3,15 +3,15 @@ 3:I[39756,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 4:I[37457,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"default"] 5:I[47257,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ClientPageRoot"] -6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","/t2-mapper/_next/static/chunks/57517f0359971c33.js","/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/acace6aadc879a08.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] +6:I[39724,["/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","/t2-mapper/_next/static/chunks/ad4fd30929cca23f.js","/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","/t2-mapper/_next/static/chunks/44a6df9214eeac58.js","/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","/t2-mapper/_next/static/chunks/d712fc4c15db64e6.js","/t2-mapper/_next/static/chunks/9a99559140e82f06.js","/t2-mapper/_next/static/chunks/153d5796298dee1e.js","/t2-mapper/_next/static/chunks/21659079be7af0ab.js","/t2-mapper/_next/static/chunks/9549e76d03bf90ea.js","/t2-mapper/_next/static/chunks/727710e55f003daf.js"],"default"] 9:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"OutletBoundary"] a:"$Sreact.suspense" c:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"ViewportBoundary"] e:I[97367,["/t2-mapper/_next/static/chunks/2f236954d6a65e12.js"],"MetadataBoundary"] 10:I[68027,[],"default"] :HL["/t2-mapper/_next/static/chunks/ad52ebedad251428.css","style"] -:HL["/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","style"] -0:{"P":null,"b":"HUIHRvyaa6D1abkRRPPoG","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/309d84bbb5b2092f.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/39402d7e86cbc15f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/df1e111d87e0ccf8.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/57517f0359971c33.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/926fdfc108de2b2e.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/9236f2f78e6373a1.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/acace6aadc879a08.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} +:HL["/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","style"] +0:{"P":null,"b":"GVV-bte23-C1OKGsIpGF4","c":["","shapes",""],"q":"","i":false,"f":[[["",{"children":["shapes",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],[["$","$1","c",{"children":[[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/ad52ebedad251428.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/89fcb9c19e93d0ef.js","async":true,"nonce":"$undefined"}]],["$","html",null,{"lang":"en","children":["$","body",null,{"children":["$","$L2",null,{"defaultOptions":{"clearOnDefault":false},"children":["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":404}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],[]],"forbidden":"$undefined","unauthorized":"$undefined"}]}]}]}]]}],{"children":[["$","$1","c",{"children":[null,["$","$L3",null,{"parallelRouterKey":"children","error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L4",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","forbidden":"$undefined","unauthorized":"$undefined"}]]}],{"children":[["$","$1","c",{"children":[["$","$L5",null,{"Component":"$6","serverProvidedParams":{"searchParams":{},"params":{},"promises":["$@7","$@8"]}}],[["$","link","0",{"rel":"stylesheet","href":"/t2-mapper/_next/static/chunks/3ec6b524f05ae0b6.css","precedence":"next","crossOrigin":"$undefined","nonce":"$undefined"}],["$","script","script-0",{"src":"/t2-mapper/_next/static/chunks/ad4fd30929cca23f.js","async":true,"nonce":"$undefined"}],["$","script","script-1",{"src":"/t2-mapper/_next/static/chunks/f6808786c34b74b0.js","async":true,"nonce":"$undefined"}],["$","script","script-2",{"src":"/t2-mapper/_next/static/chunks/44a6df9214eeac58.js","async":true,"nonce":"$undefined"}],["$","script","script-3",{"src":"/t2-mapper/_next/static/chunks/28c57db7b25d3d02.js","async":true,"nonce":"$undefined"}],["$","script","script-4",{"src":"/t2-mapper/_next/static/chunks/d712fc4c15db64e6.js","async":true,"nonce":"$undefined"}],["$","script","script-5",{"src":"/t2-mapper/_next/static/chunks/9a99559140e82f06.js","async":true,"nonce":"$undefined"}],["$","script","script-6",{"src":"/t2-mapper/_next/static/chunks/153d5796298dee1e.js","async":true,"nonce":"$undefined"}],["$","script","script-7",{"src":"/t2-mapper/_next/static/chunks/21659079be7af0ab.js","async":true,"nonce":"$undefined"}],["$","script","script-8",{"src":"/t2-mapper/_next/static/chunks/9549e76d03bf90ea.js","async":true,"nonce":"$undefined"}],["$","script","script-9",{"src":"/t2-mapper/_next/static/chunks/727710e55f003daf.js","async":true,"nonce":"$undefined"}]],["$","$L9",null,{"children":["$","$a",null,{"name":"Next.MetadataOutlet","children":"$@b"}]}]]}],{},null,false,false]},null,false,false]},null,false,false],["$","$1","h",{"children":[null,["$","$Lc",null,{"children":"$Ld"}],["$","div",null,{"hidden":true,"children":["$","$Le",null,{"children":["$","$a",null,{"name":"Next.Metadata","children":"$Lf"}]}]}],null]}],false]],"m":"$undefined","G":["$10",[]],"S":true} 7:{} 8:"$0:f:0:1:1:children:1:children:0:props:children:0:props:serverProvidedParams:params" d:[["$","meta","0",{"charSet":"utf-8"}],["$","meta","1",{"name":"viewport","content":"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"}]] diff --git a/package.json b/package.json index 3a8050ac..452b2b5d 100644 --- a/package.json +++ b/package.json @@ -14,16 +14,16 @@ "deploy": "npm run build && git add -f docs && git commit -m \"Deploy\" && git push", "format": "prettier --write .", "lint": "eslint .", - "login": "node --env-file-if-exists=.env --env-file-if-exists=.env.local --import=tsx/esm scripts/t2-login.ts", + "login": "node --env-file-if-exists=.env.development.local --import=tsx/esm scripts/t2-login.ts", "postbuild": "git checkout -- public/base && touch docs/.nojekyll", "prebuild": "git checkout -- docs && rimraf public/base && mv docs/base public/", - "relay:dev": "node --env-file-if-exists=.env.local --watch --import=tsx/esm relay/server.ts", - "relay": "node --env-file-if-exists=.env.local --import=tsx/esm relay/server.ts", + "relay:dev": "node --env-file-if-exists=.env.development.local --watch --import=tsx/esm relay/server.ts", + "relay": "node --env-file-if-exists=.env.development.local --import=tsx/esm relay/server.ts", "serve:static": "tsx scripts/serve-static.ts", - "server-list": "node --env-file-if-exists=.env --env-file-if-exists=.env.local --import=tsx/esm scripts/t2-server-list.ts", + "server-list": "node --env-file-if-exists=.env.development.local --import=tsx/esm scripts/t2-server-list.ts", "start:both": "concurrently npm:start npm:relay:dev", "start": "next dev --turbopack", - "test-connect": "node --env-file-if-exists=.env.local --import=tsx/esm scripts/test-connect.ts", + "test-connect": "node --env-file-if-exists=.env.development.local --import=tsx/esm scripts/test-connect.ts", "test:watch": "vitest", "test": "vitest run", "typecheck": "tsc --noEmit" diff --git a/relay/gameConnection.ts b/relay/gameConnection.ts index fec2e255..f2c87d5a 100644 --- a/relay/gameConnection.ts +++ b/relay/gameConnection.ts @@ -65,17 +65,10 @@ export class GameConnection extends EventEmitter { /** Events waiting to be sent (new or retransmitted from lost packets). */ private eventSendQueue: { seq: number; event: ClientEvent }[] = []; private stringTable = new ClientNetStringTable(); - /** Incrementing move index so the server doesn't deduplicate our moves. */ - private moveIndex = 0; private dataPacketCount = 0; private rawMessageCount = 0; - private sendMoveCount = 0; private _mapName?: string; private observerEnforced = false; - /** Buffered move state — merged into the next keepalive tick. */ - private bufferedMove: ClientMoveData | null = null; - /** Ticks remaining to hold the current trigger state before clearing. */ - private triggerHoldTicks = 0; /** Send timestamps by sequence number for RTT measurement. */ private sendTimestamps = new Map(); /** Smoothed RTT in ms (exponential moving average). */ @@ -631,60 +624,12 @@ export class GameConnection extends EventEmitter { this.flushEvents(); } - /** Flush pending events in a data packet. */ + /** Flush pending events in a data packet immediately. */ private flushEvents(): void { - // Assign sequence numbers to new pending events and add to send queue. - for (const event of this.pendingEvents.splice(0)) { - const seq = this.nextSendEventSeq++; - this.eventSendQueue.push({ seq, event }); + if (this.pendingEvents.length === 0 && this.eventSendQueue.length === 0) { + return; } - if (this.eventSendQueue.length === 0) return; - - this.sendDataPacketWithEvents(); - } - - /** - * Build and send a data packet that includes events from the send queue. - * Events stay tracked per-packet so they can be re-queued on loss. - */ - private sendDataPacketWithEvents(move?: ClientMoveData): void { - const events = this.eventSendQueue.splice(0); - if (events.length === 0) return; - - const startSeq = events[0].seq; - - connLog.debug( - { - eventCount: events.length, - seqRange: `${startSeq}-${events[events.length - 1].seq}`, - sendSeq: this.protocol.lastSendSeq + 1, - }, - "Sending data packet with guaranteed events", - ); - - // Track which events are in this packet for ack/loss handling. - // lastSendSeq+1 because buildSendPacketHeader increments it. - const packetSeq = this.protocol.lastSendSeq + 1; - this.sentEventsByPacket.set(packetSeq, events); - - const moveData = move ?? { - x: 0, - y: 0, - z: 0, - yaw: 0, - pitch: 0, - roll: 0, - freeLook: false, - trigger: [false, false, false, false, false, false], - }; - - const packet = buildClientGamePacket(this.protocol, { - moves: [moveData], - moveStartIndex: this.moveIndex++, - events: events.map((e) => e.event), - nextSendEventSeq: startSeq, - }); - this.sendRaw(packet); + this.emitDataPacket([], 0); } /** Handle packet delivery notification from the protocol layer. */ @@ -733,62 +678,23 @@ export class GameConnection extends EventEmitter { } /** - * Buffer a move to be sent in the next keepalive tick. - * Moves are merged into the 32ms keepalive cadence rather than sent as - * separate packets, because the server's Camera control object processes - * moves from the regular tick stream (separate extra packets can be - * ignored or cause trigger edge detection issues). + * Send moves immediately to the game server. + * The browser owns move indices and re-sends all unacked moves each tick, + * just like real Tribes 2's moveWritePacket. */ - sendMove(move: ClientMoveData): void { - this.sendMoveCount++; - if (this.sendMoveCount <= 5 || this.sendMoveCount % 100 === 0) { - connLog.debug( - { - yaw: move.yaw, - pitch: move.pitch, - x: move.x, - y: move.y, - z: move.z, - total: this.sendMoveCount, - }, - "Sending move", - ); - } - // During trigger hold, merge trigger flags so rapid move updates - // (e.g. from useFrame at 60fps) can't overwrite a pending trigger - // before the server sees it. - if (this.triggerHoldTicks > 0 && this.bufferedMove) { - move = { - ...move, - trigger: this.bufferedMove.trigger.map( - (held, i) => held || (move.trigger[i] ?? false), - ), - }; - } - this.bufferedMove = move; - // If any trigger is set, hold it for 2 ticks to ensure the server - // sees the edge (true then false on the next tick). - if (move.trigger.some(Boolean)) { - this.triggerHoldTicks = 2; - } + sendMoves(moves: ClientMoveData[], moveStartIndex: number): void { + this.emitDataPacket(moves, moveStartIndex); } - /** Send the current move state as a keepalive packet at the tick rate. */ - private sendTickMove(): void { - const move: ClientMoveData = this.bufferedMove ?? { - x: 0, - y: 0, - z: 0, - yaw: 0, - pitch: 0, - roll: 0, - freeLook: false, - trigger: [false, false, false, false, false, false], - }; - - // Record send time keyed by the 9-bit sequence number (0–511) that the - // server will echo back in highestAck. lastSendSeq is the full counter; - // the wire format uses only the low 9 bits. + /** + * Internal: build and send a data packet with moves and/or pending events. + * Used by both sendMoves (browser-initiated) and keepalive (idle). + */ + private emitDataPacket( + moves: ClientMoveData[], + moveStartIndex: number, + ): void { + // Record send time for RTT measurement. const nextSeq9 = (this.protocol.lastSendSeq + 1) & 0x1ff; this.sendTimestamps.set(nextSeq9, Date.now()); @@ -798,37 +704,37 @@ export class GameConnection extends EventEmitter { this.eventSendQueue.push({ seq, event }); } - // If we have events waiting to be sent (new or re-queued from lost - // packets), include them in this tick's data packet. + let events: { seq: number; event: ClientEvent }[] | undefined; if (this.eventSendQueue.length > 0) { - this.sendDataPacketWithEvents(move); - } else { - const packet = buildClientGamePacket(this.protocol, { - moves: [move], - moveStartIndex: this.moveIndex++, - }); - this.sendRaw(packet); + events = this.eventSendQueue.splice(0); + const packetSeq = this.protocol.lastSendSeq + 1; + this.sentEventsByPacket.set(packetSeq, events); } - // Count down trigger hold, then clear triggers. - if (this.triggerHoldTicks > 0) { - this.triggerHoldTicks--; - if (this.triggerHoldTicks === 0 && this.bufferedMove) { - this.bufferedMove = { - ...this.bufferedMove, - trigger: [false, false, false, false, false, false], - }; - } - } + const packet = buildClientGamePacket(this.protocol, { + moves, + moveStartIndex, + ...(events + ? { + events: events.map((e) => e.event), + nextSendEventSeq: events[0].seq, + } + : {}), + }); + this.sendRaw(packet); } - /** Start keepalive timer. */ + /** Send an idle keepalive packet (no moves, but flushes pending events). */ + private sendKeepalive(): void { + this.emitDataPacket([], 0); + } + + /** Start keepalive timer. Sends idle packets when the browser isn't sending moves. */ private startKeepalive(): void { let keepaliveCount = 0; this.keepaliveTimer = setInterval(() => { keepaliveCount++; if (keepaliveCount % 300 === 0) { - // ~10s at 32ms tick rate connLog.info( { dataPackets: this.dataPacketCount, @@ -840,7 +746,7 @@ export class GameConnection extends EventEmitter { "Connection status", ); } - this.sendTickMove(); + this.sendKeepalive(); }, KEEPALIVE_INTERVAL_MS); } @@ -863,7 +769,10 @@ export class GameConnection extends EventEmitter { // Send a Disconnect packet so the server knows we're leaving if (this.socket && this.serverConnectSequence !== 0) { try { - const packet = buildDisconnectPacket(this.connectSequence); + const packet = buildDisconnectPacket( + this.serverConnectSequence, + this.clientConnectSequence, + ); this.socket.send(packet, this.port, this.host); connLog.info("Sent Disconnect packet to server"); } catch { diff --git a/relay/protocol.ts b/relay/protocol.ts index 9cec6948..b9592b72 100644 --- a/relay/protocol.ts +++ b/relay/protocol.ts @@ -274,10 +274,13 @@ export interface ClientEvent { */ function writeMove(bs: BitStreamWriter, move: ClientMoveData): void { // Rotation (flag + optional 16-bit signed). - // Pack: int16 = (int)(radians * 65536). Server unpacks: float = (short)int16 / 65536. - const pyaw = Math.round(move.yaw * 65536) | 0; - const ppitch = Math.round(move.pitch * 65536) | 0; - const proll = Math.round(move.roll * 65536) | 0; + // Matches Torque's Move::clamp(): pyaw = (yaw / M_2PI) * 0x10000. + // Server's Move::unclamp() reverses: yaw = (short)pyaw * M_2PI / 0x10000. + // Input values are in radians; divide by 2π to get fractional turns for packing. + const M_2PI = 2 * Math.PI; + const pyaw = Math.round((move.yaw / M_2PI) * 65536) | 0; + const ppitch = Math.round((move.pitch / M_2PI) * 65536) | 0; + const proll = Math.round((move.roll / M_2PI) * 65536) | 0; if (pyaw !== 0) { bs.writeFlag(true); @@ -480,10 +483,14 @@ export function buildConnectRequest( } /** Build a Disconnect (type 38) OOB packet. */ -export function buildDisconnectPacket(connectSequence: number): Uint8Array { +export function buildDisconnectPacket( + serverConnectSequence: number, + clientConnectSequence: number, +): Uint8Array { const bs = new BitStreamWriter(64); bs.writeU8(38); // Disconnect type - bs.writeU32(connectSequence); + bs.writeU32(serverConnectSequence); + bs.writeU32(clientConnectSequence); writeString(bs, ""); // reason return bs.getBuffer(); } diff --git a/relay/server.ts b/relay/server.ts index d47c67a5..3862021f 100644 --- a/relay/server.ts +++ b/relay/server.ts @@ -355,18 +355,21 @@ wss.on("connection", (ws) => { break; } - case "sendMove": { + case "sendMoves": { if (gameConnection) { - gameConnection.sendMove({ - x: message.move.x, - y: message.move.y, - z: message.move.z, - yaw: message.move.yaw, - pitch: message.move.pitch, - roll: message.move.roll, - freeLook: message.move.freeLook, - trigger: message.move.trigger, - }); + gameConnection.sendMoves( + message.moves.map((m) => ({ + x: m.x, + y: m.y, + z: m.z, + yaw: m.yaw, + pitch: m.pitch, + roll: m.roll, + freeLook: m.freeLook, + trigger: m.trigger, + })), + message.moveStartIndex, + ); } break; } diff --git a/relay/types.ts b/relay/types.ts index 605fe265..890b0d51 100644 --- a/relay/types.ts +++ b/relay/types.ts @@ -3,7 +3,7 @@ export type ClientMessage = | { type: "listServers" } | { type: "joinServer"; address: string; warriorName?: string } | { type: "disconnect" } - | { type: "sendMove"; move: ClientMove } + | { type: "sendMoves"; moves: ClientMove[]; moveStartIndex: number } | { type: "sendCommand"; command: string; args: string[] } | { type: "sendCRCResponse"; diff --git a/src/components/ChatWindow.module.css b/src/components/ChatWindow.module.css index ad55aaa2..40b11977 100644 --- a/src/components/ChatWindow.module.css +++ b/src/components/ChatWindow.module.css @@ -1,7 +1,7 @@ .ChatContainer { position: absolute; - top: 8px; - left: 8px; + top: 6px; + left: 6px; width: 400px; max-width: 50%; display: flex; @@ -11,8 +11,8 @@ } .ChatWindow { - max-height: 12.5em; min-height: 4em; + max-height: 12.5em; overflow-y: auto; background: rgba(0, 50, 60, 0.65); padding: 6px; diff --git a/src/components/InputConsumer.tsx b/src/components/InputConsumer.tsx new file mode 100644 index 00000000..128a6923 --- /dev/null +++ b/src/components/InputConsumer.tsx @@ -0,0 +1,610 @@ +import { useRef, useEffect } from "react"; +import { useFrame, useThree } from "@react-three/fiber"; +import { Camera, Euler, Vector3 } from "three"; +import { createLogger } from "../logger"; +import { + liveConnectionStore, + useLiveSelector, +} from "../state/liveConnectionStore"; +import { useEngineStoreApi } from "../state/engineStore"; +import { streamPlaybackStore } from "../state/streamPlaybackStore"; +import { useInputContext } from "./InputContext"; +import { useTick, useGetTickFraction } from "./TickProvider"; +import { yawPitchToQuaternion, MAX_PITCH } from "../stream/streamHelpers"; +import type { StreamRecording, StreamCamera } from "../stream/types"; +import type { LiveStreamAdapter } from "../stream/liveStreaming"; +import type { ClientMove } from "../../relay/types"; + +const log = createLogger("InputConsumer"); + +const MAX_SPEED = 300; +const LOCAL_MAX_PITCH = Math.PI / 2 - 0.01; // ~89° + +/** + * Max moves in the unacked buffer. Matches Torque's MaxMoveQueueSize. + * Also the max we can send per packet (5-bit count = 31), but we keep + * a slightly larger buffer to avoid losing moves during high latency. + */ +const MAX_MOVE_BUFFER = 45; + +/** Max moves per packet (MoveCountBits = 5 → 2^5 - 1). */ +const MAX_MOVES_PER_PACKET = 31; + +/** + * $Camera::movementSpeed (default 40 in Tribes2.exe at _DAT_0079abe8). + * With trigger[1] (altTrigger) always set, the effective speed is 80. + */ +const CAMERA_SPEED = 40; + +/** Torque tick duration in seconds (1/32 = 0.03125). */ +const TICK_SEC = 1 / 32; + +const M_2PI = 2 * Math.PI; + +/** + * Quantize a rotation delta through Torque's Move clamp/unclamp round-trip. + * This ensures our predicted rotation exactly matches the server's decoded value. + * + * clamp: pyaw = (radians / 2π) * 65536, masked to 16 bits + * unclamp: radians = (short)pyaw * 2π / 65536 + */ +function quantizeRotation(radians: number): number { + const packed = Math.round((radians / M_2PI) * 65536) | 0; + // Sign-extend 16-bit (like C's (short) cast). + const signed = (packed << 16) >> 16; + return (signed * M_2PI) / 65536; +} + +// Scratch objects to avoid per-frame allocations. +const _forwardVec = new Vector3(); +const _sideVec = new Vector3(); +const _moveVec = new Vector3(); +const _lookEuler = new Euler(0, 0, 0, "YXZ"); +const _orbitDir = new Vector3(); +const _orbitTarget = new Vector3(); + +/** A buffered move sent to the server, awaiting acknowledgment. */ +interface BufferedMove { + /** Browser-assigned move index. */ + moveIndex: number; + /** The full move data for re-sending to the server. */ + move: ClientMove; + /** Rotation deltas for prediction replay. */ + yaw: number; + pitch: number; + /** Movement axes for position prediction replay. */ + x: number; + y: number; + z: number; +} + +/** + * Apply Camera::processTick position update. + * + * Matches Tribes2.exe FUN_005cbc80: builds Rz(yaw)*Rx(pitch) orientation + * matrix, transforms local move axes to world space, applies at tick rate. + * + * Torque uses (cos,+sin;-sin,cos) rotation convention, NOT standard math. + * The resulting Rz(y)*Rx(p) row-major matrix columns are: + * right (move.x): { cy, -sy, 0 } + * forward (move.y): { sy*cp, cy*cp, -sp } + * up (move.z): { sy*sp, cy*sp, cp } + * + * IMPORTANT: `yaw`/`pitch` must be the rotation state from the PREVIOUS + * tick, not the current one. Tribes2.exe reads the old transform matrix + * (built at end of previous tick) for position computation. + */ +function applyProcessTickPosition( + pos: { x: number; y: number; z: number }, + yaw: number, + pitch: number, + mx: number, + my: number, + mz: number, + speed: number, +): void { + if (mx === 0 && my === 0 && mz === 0) return; + + const sy = Math.sin(yaw); + const cy = Math.cos(yaw); + const sp = Math.sin(pitch); + const cp = Math.cos(pitch); + + // pos += (right*mx + forward*my + up*mz) * speed * TickSec + const scale = speed * TICK_SEC; + pos.x += (cy * mx + sy * cp * my + sy * sp * mz) * scale; + pos.y += (-sy * mx + cy * cp * my + cy * sp * mz) * scale; + pos.z += (-sp * my + cp * mz) * scale; +} + +/** + * Consumes input frames from the move queue and applies them. + * + * Implements the same client-side prediction strategy as the real Tribes 2 + * client (verified against Tribes2.exe): + * + * 1. Camera::processTick — apply rotation + position at tick rate. + * 2. Camera::interpolateTick — interpolate between tick states for smooth + * frame-rate rendering. + * 3. Send ALL unacked moves to the server at tick rate (like moveWritePacket). + * 4. On server correction (readPacketData), snap to authoritative state and + * replay all unacknowledged moves. + * + * The browser owns the move index counter and re-sends unacked moves for + * UDP reliability, just like the real Tribes 2 client. + */ +export function InputConsumer() { + const { moveQueue, mode, setMode } = useInputContext(); + const adapter = useLiveSelector((s) => s.adapter); + const gameStatus = useLiveSelector((s) => s.gameStatus); + const sendMoves = useLiveSelector((s) => s.sendMoves); + const store = useEngineStoreApi(); + const camera = useThree((state) => state.camera); + const getTickFraction = useGetTickFraction(); + const activeAdapterRef = useRef(null); + + // ── Move buffer (unacked moves) ── + const moveBuffer = useRef([]); + // Browser-owned move index counter. + const nextMoveIndex = useRef(0); + // The last lastMoveAck we processed (to detect new server corrections). + const lastProcessedAck = useRef(0); + // The last server camera snapshot we reconciled from (identity check). + const lastReconciledCamera = useRef(null); + + // ── Local predicted state (Torque coordinates) ── + // Absolute predicted yaw/pitch in Torque radians. + const predYaw = useRef(0); + const predPitch = useRef(0); + // Predicted position in Torque world coords (x=east, y=north, z=up). + const predPos = useRef({ x: 0, y: 0, z: 0 }); + + // ── Previous tick state for interpolateTick ── + const prevYaw = useRef(0); + const prevPitch = useRef(0); + const prevPos = useRef({ x: 0, y: 0, z: 0 }); + + // Whether prediction has been initialized from a server snapshot. + const predInitialized = useRef(false); + + // ── Accumulated input for current tick (live mode) ── + const tickDeltaYaw = useRef(0); + const tickDeltaPitch = useRef(0); + const tickMoveX = useRef(0); + const tickMoveY = useRef(0); + const tickMoveZ = useRef(0); + const tickTriggers = useRef([false, false, false, false, false, false]); + + // Previous trigger state for edge detection. + const prevTriggers = useRef([false, false, false, false, false, false]); + + const isLive = + !!adapter && + (gameStatus === "connected" || gameStatus === "authenticating"); + + // Wire adapter to engine store. + useEffect(() => { + if (isLive && adapter) { + if (activeAdapterRef.current === adapter) return; + + log.info("wiring adapter to engine store"); + const liveState = liveConnectionStore.getState(); + const liveRecording: StreamRecording = { + source: "live", + duration: Infinity, + missionName: liveState.mapName ?? null, + gameType: null, + serverDisplayName: liveState.serverName ?? null, + recorderName: liveState.warriorName ?? null, + recordingDate: null, + streamingPlayback: adapter, + }; + + store.getState().setRecording(liveRecording); + store.getState().setPlaybackStatus("playing"); + activeAdapterRef.current = adapter; + + // Reset prediction state for new connection. + predInitialized.current = false; + moveBuffer.current.length = 0; + nextMoveIndex.current = 0; + lastProcessedAck.current = 0; + lastReconciledCamera.current = null; + + setMode("fly"); + } else if (!isLive && activeAdapterRef.current) { + const current = store.getState().playback.recording; + if (current?.source === "live") { + store.getState().setRecording(null); + } + activeAdapterRef.current = null; + predInitialized.current = false; + moveBuffer.current.length = 0; + + setMode("local"); + } + }, [isLive, adapter, store, setMode]); + + // ── processTick: send moves at the Torque tick rate (32Hz). ── + useTick(() => { + if (!activeAdapterRef.current || gameStatus !== "connected") return; + + // Consume accumulated deltas. + const yaw = tickDeltaYaw.current; + const pitch = tickDeltaPitch.current; + tickDeltaYaw.current = 0; + tickDeltaPitch.current = 0; + + const mx = tickMoveX.current; + const my = tickMoveY.current; + const mz = tickMoveZ.current; + tickMoveX.current = 0; + tickMoveY.current = 0; + tickMoveZ.current = 0; + + const triggers = [...tickTriggers.current]; + tickTriggers.current.fill(false); + + // Trigger edge detection. + if (triggers[2] && !prevTriggers.current[2]) { + activeAdapterRef.current.toggleObserverMode(); + log.info("observer mode: %s", activeAdapterRef.current.observerMode); + setMode( + activeAdapterRef.current.observerMode === "follow" ? "follow" : "fly", + ); + } + prevTriggers.current = triggers; + + // ── Camera::processTick equivalent ── + + // Quantize rotation to match server's Move::clamp/unclamp round-trip. + // useFrame already applied raw deltas for responsiveness; correct to + // the quantized value the server will actually use. + const qYaw = quantizeRotation(yaw); + const qPitch = quantizeRotation(pitch); + predYaw.current += qYaw - yaw; + predPitch.current += qPitch - pitch; + + // Save previous tick state for interpolateTick. + prevYaw.current = predYaw.current; + prevPitch.current = predPitch.current; + prevPos.current = { ...predPos.current }; + + // NOTE: Rotation is NOT re-applied here — useFrame already applied + // (now corrected to quantized). useTick only buffers and sends. + + // Apply position using the PREVIOUS tick's rotation, matching Tribes2.exe: + // processTick reads the old transform matrix (built at end of previous + // tick) for position computation, even though mRot is updated first. + // Since predYaw/predPitch already include this tick's quantized deltas, + // subtract them to get the old rotation. + const speed = CAMERA_SPEED * 2; + const posRotYaw = predYaw.current - qYaw; + const posRotPitch = predPitch.current - qPitch; + applyProcessTickPosition( + predPos.current, + posRotYaw, + posRotPitch, + mx, + my, + mz, + speed, + ); + + // Always set trigger[1] (altTrigger) — the Torque Camera doubles its + // movement speed when this trigger is active. Our speedMultiplier is + // a fraction of this faster base speed, already applied by the input + // producer (KeyboardAndMouseHandler) to the movement axes. + triggers[1] = true; + + // Build the move and assign a browser-owned index. + const moveIndex = nextMoveIndex.current++; + const move: ClientMove = { + x: mx, + y: my, + z: mz, + yaw, + pitch, + roll: 0, + trigger: triggers, + freeLook: false, + }; + + // Buffer for prediction replay and re-sending. + const buffer = moveBuffer.current; + buffer.push({ moveIndex, move, yaw: qYaw, pitch: qPitch, x: mx, y: my, z: mz }); + + // Cap buffer size. + if (buffer.length > MAX_MOVE_BUFFER) { + buffer.splice(0, buffer.length - MAX_MOVE_BUFFER); + } + + // Prune acknowledged moves before sending. + const ack = activeAdapterRef.current.lastMoveAck; + while (buffer.length > 0 && buffer[0].moveIndex < ack) { + buffer.shift(); + } + + // Send ALL unacked moves, just like Tribes 2's moveWritePacket. + // The server deduplicates based on moveStartIndex. + if (buffer.length > 0) { + const movesToSend = buffer.slice(0, MAX_MOVES_PER_PACKET); + sendMoves( + movesToSend.map((m) => m.move), + movesToSend[0].moveIndex, + ); + } + }); + + // ── useFrame: drain moveQueue, reconcile, interpolateTick + render. ── + useFrame((state, delta) => { + const frames = moveQueue.current; + if (frames.length > 0) { + // Drain the move queue. + let dYaw = 0; + let dPitch = 0; + let x = 0; + let y = 0; + let z = 0; + let frameDelta = 0; + const frameTriggers = [false, false, false, false, false, false]; + + for (const frame of frames) { + dYaw += frame.deltaYaw; + dPitch += frame.deltaPitch; + x = frame.x; // latest wins + y = frame.y; + z = frame.z; + frameDelta += frame.delta; + for (let i = 0; i < frame.triggers.length; i++) { + if (frame.triggers[i]) frameTriggers[i] = true; + } + } + moveQueue.current.length = 0; + + if (isLive && activeAdapterRef.current && gameStatus === "connected") { + // Live mode: accumulate for useTick to consume and send. + tickDeltaYaw.current += dYaw; + tickDeltaPitch.current += dPitch; + tickMoveX.current = x; + tickMoveY.current = y; + tickMoveZ.current = z; + for (let i = 0; i < frameTriggers.length; i++) { + if (frameTriggers[i]) tickTriggers.current[i] = true; + } + + // Apply look deltas to prediction immediately for frame-rate + // responsiveness (the pending deltas haven't been consumed by useTick + // yet, but we still want them to affect the camera this frame). + predYaw.current += dYaw; + predPitch.current = Math.max( + -MAX_PITCH, + Math.min(MAX_PITCH, predPitch.current + dPitch), + ); + } else { + // Local mode: apply input directly to camera. + const spState = streamPlaybackStore.getState(); + if (spState.playback && !spState.freeFlyCamera) return; + + applyLocalCamera(camera, dYaw, dPitch, x, y, z, frameDelta); + return; + } + } + + // ── Live mode: server reconciliation + interpolateTick ── + + if (!isLive || !activeAdapterRef.current || gameStatus !== "connected") { + return; + } + + const adapterRef = activeAdapterRef.current; + const snapshot = adapterRef.getSnapshot(); + const serverCam = snapshot?.camera; + + // Check for new server correction. + if ( + serverCam && + serverCam !== lastReconciledCamera.current && + typeof serverCam.yaw === "number" && + typeof serverCam.pitch === "number" + ) { + lastReconciledCamera.current = serverCam; + + // Prune acknowledged moves from the buffer. + const ack = adapterRef.lastMoveAck; + if (ack > lastProcessedAck.current) { + lastProcessedAck.current = ack; + const buffer = moveBuffer.current; + while (buffer.length > 0 && buffer[0].moveIndex < ack) { + buffer.shift(); + } + } + + // Snap to server's authoritative state (rotation + position). + predYaw.current = serverCam.yaw; + predPitch.current = serverCam.pitch; + predPos.current = { + x: serverCam.position[0], + y: serverCam.position[1], + z: serverCam.position[2], + }; + + // Replay all unacknowledged moves on top of server state. + // This is exactly what ProcessList::advanceClientTime does: + // for each pending move, call control->processTick(&move). + // Position uses the rotation from BEFORE each move (old transform), + // then rotation is updated for the next move. + const speed = CAMERA_SPEED * 2; + for (const move of moveBuffer.current) { + // Position first, using pre-move rotation (matches Tribes2.exe). + applyProcessTickPosition( + predPos.current, + predYaw.current, + predPitch.current, + move.x, + move.y, + move.z, + speed, + ); + // Then update rotation for the next move. + predYaw.current += move.yaw; + predPitch.current = Math.max( + -MAX_PITCH, + Math.min(MAX_PITCH, predPitch.current + move.pitch), + ); + } + + // Also add any pending deltas not yet consumed by useTick. + predYaw.current += tickDeltaYaw.current; + predPitch.current = Math.max( + -MAX_PITCH, + Math.min(MAX_PITCH, predPitch.current + tickDeltaPitch.current), + ); + + // After reconciliation, snap prev state to match (no interpolation + // glitch — we want the corrected state to appear immediately). + prevYaw.current = predYaw.current; + prevPitch.current = predPitch.current; + prevPos.current = { ...predPos.current }; + + predInitialized.current = true; + } + + if (!predInitialized.current) return; + + if (mode === "fly") { + // ── Camera::interpolateTick equivalent for position ── + // Torque interpolates between prev and current tick states: + // renderState = prevState + (currentState - prevState) * tickFrac + // tickFrac goes 0→1 between ticks (0 = just after tick, 1 = next tick). + const tickFrac = getTickFraction(); + const pp = prevPos.current; + const cp = predPos.current; + const renderX = pp.x + (cp.x - pp.x) * tickFrac; + const renderY = pp.y + (cp.y - pp.y) * tickFrac; + const renderZ = pp.z + (cp.z - pp.z) * tickFrac; + + // Convert Torque coords (x=east, y=north, z=up) to Three.js (x=north, y=up, z=east). + state.camera.position.set(renderY, renderZ, renderX); + + // Rotation uses predicted values directly (already includes pending + // deltas from useFrame above for immediate responsiveness). + const [qx, qy, qz, qw] = yawPitchToQuaternion( + predYaw.current, + predPitch.current, + ); + state.camera.quaternion.set(qx, qy, qz, qw); + } else if (mode === "follow") { + // Follow/orbit mode: use server position for orbit target, + // but apply our predicted rotation for responsive orbit camera. + applyOrbitCamera(state, serverCam, predYaw.current, predPitch.current); + } + }); + + // Clean up on unmount. + useEffect(() => { + return () => { + if (activeAdapterRef.current) { + const current = store.getState().playback.recording; + if (current?.source === "live") { + store.getState().setRecording(null); + } + activeAdapterRef.current = null; + } + }; + }, [store]); + + return null; +} + +/** Apply rotation and movement to the camera locally (local/demo mode). */ +function applyLocalCamera( + camera: Camera, + dYaw: number, + dPitch: number, + x: number, + y: number, + z: number, + delta: number, +) { + if (dYaw !== 0 || dPitch !== 0) { + _lookEuler.setFromQuaternion(camera.quaternion, "YXZ"); + _lookEuler.y -= dYaw; + _lookEuler.x -= dPitch; + _lookEuler.x = Math.max( + -LOCAL_MAX_PITCH, + Math.min(LOCAL_MAX_PITCH, _lookEuler.x), + ); + camera.quaternion.setFromEuler(_lookEuler); + } + + if (x !== 0 || y !== 0 || z !== 0) { + camera.getWorldDirection(_forwardVec); + _forwardVec.normalize(); + _sideVec.crossVectors(camera.up, _forwardVec).normalize(); + + _moveVec.set(0, 0, 0); + if (y !== 0) _moveVec.addScaledVector(_forwardVec, y); + if (x !== 0) _moveVec.addScaledVector(_sideVec, -x); + if (z !== 0) _moveVec.y += z; + + const len = _moveVec.length(); + if (len > 0) { + // Clamp length to 1 so diagonal movement isn't faster, but preserve + // sub-1 magnitudes from speedMultiplier. + _moveVec.multiplyScalar((Math.min(1, len) / len) * MAX_SPEED * delta); + camera.position.add(_moveVec); + } + } +} + +/** + * In follow/orbit mode, recompute orbit camera position from the server's + * orbit target using our predicted rotation. + */ +function applyOrbitCamera( + state: { camera: Camera }, + serverCam: StreamCamera | undefined, + predYaw: number, + predPitch: number, +) { + if ( + !serverCam || + serverCam.mode !== "third-person" || + !serverCam.orbitTargetId + ) { + return; + } + + const root = streamPlaybackStore.getState().root; + if (!root) return; + + const targetGroup = root.children.find( + (child) => child.name === serverCam.orbitTargetId, + ); + if (!targetGroup) return; + + _orbitTarget.copy(targetGroup.position); + const entities = streamPlaybackStore.getState().entities; + const orbitEntity = entities.get(serverCam.orbitTargetId); + if (orbitEntity?.renderType === "Player") { + _orbitTarget.y += 1.0; + } + + const sx = Math.sin(predPitch); + const cx = Math.cos(predPitch); + const sz = Math.sin(predYaw); + const cz = Math.cos(predYaw); + // Camera pulls back along negative forward (Torque Rz*Rx column 1, + // converted to Three.js coords). + _orbitDir.set(-cz * cx, -sx, sz * cx); + + if (_orbitDir.lengthSq() > 1e-8) { + _orbitDir.normalize(); + const orbitDistance = Math.max(0.1, serverCam.orbitDistance ?? 4); + state.camera.position + .copy(_orbitTarget) + .addScaledVector(_orbitDir, orbitDistance); + state.camera.lookAt(_orbitTarget); + } +} diff --git a/src/components/InputContext.tsx b/src/components/InputContext.tsx new file mode 100644 index 00000000..fcf8992e --- /dev/null +++ b/src/components/InputContext.tsx @@ -0,0 +1,48 @@ +import { createContext, useContext } from "react"; + +export type InputMode = "local" | "fly" | "follow"; + +export interface InputFrame { + /** Look rotation deltas (radians). */ + deltaYaw: number; + deltaPitch: number; + /** Movement axes [-1, 1], pre-scaled by speedMultiplier. */ + x: number; + y: number; + z: number; + /** Trigger states. OR'd by consumer between ticks. */ + triggers: boolean[]; + /** Frame delta time (seconds). */ + delta: number; +} + +export type OnInput = (frame: InputFrame) => void; + +export interface InputContextValue { + /** Ref to accumulated input frames. Consumer reads and clears. */ + moveQueue: React.RefObject; + /** Callback for producers to report input each frame. */ + onInput: OnInput; + /** Current input mode. Set by InputConsumer, read by producers. */ + mode: InputMode; + /** Setter for mode (called by InputConsumer). */ + setMode: (mode: InputMode) => void; +} + +export const InputContext = createContext(null); + +export function useInputContext(): InputContextValue { + const ctx = useContext(InputContext); + if (!ctx) { + throw new Error("useInputContext must be used within an InputProvider"); + } + return ctx; +} + +export function useOnInput(): OnInput { + return useInputContext().onInput; +} + +export function useInputMode(): InputMode { + return useInputContext().mode; +} diff --git a/src/components/InputHandlers.tsx b/src/components/InputHandlers.tsx index 65841b58..96f041ab 100644 --- a/src/components/InputHandlers.tsx +++ b/src/components/InputHandlers.tsx @@ -1,4 +1,4 @@ -import { lazy, ReactNode, Suspense } from "react"; +import { lazy, ReactNode, Suspense, useCallback, useRef, useState } from "react"; import { KeyboardControls } from "@react-three/drei"; import { JoystickProvider } from "./JoystickContext"; import { useTouchDevice } from "./useTouchDevice"; @@ -6,6 +6,12 @@ import { KeyboardAndMouseHandler, KEYBOARD_CONTROLS, } from "./KeyboardAndMouseHandler"; +import { + InputContext, + type InputFrame, + type InputMode, + type OnInput, +} from "./InputContext"; const TouchHandler = lazy(() => import("@/src/components/TouchHandler").then((mod) => ({ @@ -14,14 +20,23 @@ const TouchHandler = lazy(() => ); export function InputProvider({ children }: { children: ReactNode }) { + const moveQueue = useRef([]); + const [mode, setMode] = useState("local"); + + const onInput: OnInput = useCallback((frame: InputFrame) => { + moveQueue.current.push(frame); + }, []); + return ( - - {children} - + + + {children} + + ); } -export function InputHandlers() { +export function InputProducers() { const isTouch = useTouchDevice(); return ( @@ -35,3 +50,6 @@ export function InputHandlers() { ); } + +/** @deprecated Use `InputProducers` instead. */ +export const InputHandlers = InputProducers; diff --git a/src/components/InspectorControls.tsx b/src/components/InspectorControls.tsx index c53d7a3d..f0beeb35 100644 --- a/src/components/InspectorControls.tsx +++ b/src/components/InspectorControls.tsx @@ -170,12 +170,12 @@ export function InspectorControls({ - setSpeedMultiplier(parseFloat(event.target.value)) + setSpeedMultiplier(parseFloat(event.target.value) / 100) } />

diff --git a/src/components/KeyboardAndMouseHandler.tsx b/src/components/KeyboardAndMouseHandler.tsx index 6db3546c..ec669eff 100644 --- a/src/components/KeyboardAndMouseHandler.tsx +++ b/src/components/KeyboardAndMouseHandler.tsx @@ -1,11 +1,14 @@ import { useEffect, useEffectEvent, useRef } from "react"; -import { Euler, Vector3 } from "three"; import { useFrame, useThree } from "@react-three/fiber"; import { useKeyboardControls } from "@react-three/drei"; import { PointerLockControls } from "three-stdlib"; -import { useControls } from "./SettingsProvider"; +import { + MAX_SPEED_MULTIPLIER, + MIN_SPEED_MULTIPLIER, + useControls, +} from "./SettingsProvider"; import { useCameras } from "./CamerasProvider"; -import { streamPlaybackStore } from "../state/streamPlaybackStore"; +import { useInputContext } from "./InputContext"; export enum Controls { forward = "forward", @@ -51,16 +54,22 @@ export const KEYBOARD_CONTROLS = [ { name: Controls.camera9, keys: ["Digit9"] }, ]; -const BASE_SPEED = 80; -const MIN_SPEED_ADJUSTMENT = 0.05; -const MAX_SPEED_ADJUSTMENT = 0.5; -const MAX_PITCH = Math.PI / 2 - 0.01; // ~89° +const MIN_SPEED_ADJUSTMENT = 2; +const MAX_SPEED_ADJUSTMENT = 10; const DRAG_THRESHOLD = 3; // px of movement before it counts as a drag /** Shared mouse/look sensitivity used across all modes (.mis, .rec, live). */ export const MOUSE_SENSITIVITY = 0.003; export const ARROW_LOOK_SPEED = 1; // radians/sec +function quantizeSpeed(speedMultiplier: number): number { + // Map [0.01, 1] → [1/16, 1], snapped to the 6-bit grid (multiples of 1/16). + const t = + (speedMultiplier - MIN_SPEED_MULTIPLIER) / (1 - MIN_SPEED_MULTIPLIER); + const steps = Math.round(t * 15); // 0..15 → 16 levels (1/16 to 16/16) + return (steps + 1) / 16; +} + export function KeyboardAndMouseHandler() { // Don't let KeyboardControls handle stuff when metaKey is held. useEffect(() => { @@ -85,6 +94,7 @@ export function KeyboardAndMouseHandler() { const { speedMultiplier, setSpeedMultiplier, invertScroll, invertDrag } = useControls(); + const { onInput, mode } = useInputContext(); const [subscribe, getKeys] = useKeyboardControls(); const camera = useThree((state) => state.camera); const gl = useThree((state) => state.gl); @@ -94,11 +104,13 @@ export function KeyboardAndMouseHandler() { const getInvertScroll = useEffectEvent(() => invertScroll); const getInvertDrag = useEffectEvent(() => invertDrag); - // Scratch vectors/euler to avoid allocations each frame - const forwardVec = useRef(new Vector3()); - const sideVec = useRef(new Vector3()); - const moveVec = useRef(new Vector3()); - const lookEuler = useRef(new Euler(0, 0, 0, "YXZ")); + // Accumulated mouse deltas between frames. + const mouseDeltaYaw = useRef(0); + const mouseDeltaPitch = useRef(0); + + // Trigger flags set by event handlers, consumed in useFrame. + const triggerFire = useRef(false); + const triggerObserve = useRef(false); // Setup pointer lock controls useEffect(() => { @@ -110,11 +122,11 @@ export function KeyboardAndMouseHandler() { }; }, [camera, gl.domElement]); - // When pointer is locked: click cycles camera. - // When pointer is unlocked: drag rotates camera, click locks pointer. + // Mouse handling: accumulate deltas for input frames. + // In local mode, drag-to-look works without pointer lock. + // Pointer lock and click behavior depend on mode. useEffect(() => { const canvas = gl.domElement; - const euler = new Euler(0, 0, 0, "YXZ"); let dragging = false; let didDrag = false; let startX = 0; @@ -130,6 +142,13 @@ export function KeyboardAndMouseHandler() { }; const handleMouseMove = (e: MouseEvent) => { + if (controlsRef.current?.isLocked) { + // Pointer is locked: accumulate raw deltas. + mouseDeltaYaw.current += e.movementX * MOUSE_SENSITIVITY; + mouseDeltaPitch.current += e.movementY * MOUSE_SENSITIVITY; + return; + } + if (!dragging) return; if ( !didDrag && @@ -141,11 +160,8 @@ export function KeyboardAndMouseHandler() { didDrag = true; const dragSign = getInvertDrag() ? -1 : 1; - euler.setFromQuaternion(camera.quaternion, "YXZ"); - euler.y += dragSign * e.movementX * MOUSE_SENSITIVITY; - euler.x += dragSign * e.movementY * MOUSE_SENSITIVITY; - euler.x = Math.max(-MAX_PITCH, Math.min(MAX_PITCH, euler.x)); - camera.quaternion.setFromEuler(euler); + mouseDeltaYaw.current += dragSign * e.movementX * MOUSE_SENSITIVITY; + mouseDeltaPitch.current += dragSign * e.movementY * MOUSE_SENSITIVITY; }; const handleMouseUp = () => { @@ -154,10 +170,17 @@ export function KeyboardAndMouseHandler() { const handleClick = (e: MouseEvent) => { const controls = controlsRef.current; - if (!controls || controls.isLocked) { - nextCamera(); + if (controls?.isLocked) { + if (mode === "follow") { + // In follow mode, click cycles to next player (trigger 0). + triggerFire.current = true; + } else if (mode === "local") { + // In local mode, click while locked cycles preset cameras. + nextCamera(); + } + // In fly mode, clicks while locked do nothing special. } else if (e.target === canvas && !didDrag) { - controls.lock(); + controls?.lock(); } }; @@ -172,9 +195,9 @@ export function KeyboardAndMouseHandler() { document.removeEventListener("mouseup", handleMouseUp); document.removeEventListener("click", handleClick); }; - }, [camera, gl.domElement, nextCamera]); + }, [camera, gl.domElement, nextCamera, mode]); - // Handle number keys 1-9 for camera selection + // Handle number keys 1-9 for camera selection (local-only UI action). useEffect(() => { const cameraControls = [ Controls.camera1, @@ -198,7 +221,7 @@ export function KeyboardAndMouseHandler() { }); }, [subscribe, setCameraIndex, cameraCount]); - // Handle mousewheel for speed adjustment + // Handle mousewheel for speed adjustment (local setting, stays in KMH). useEffect(() => { const handleWheel = (e: WheelEvent) => { e.preventDefault(); @@ -207,16 +230,17 @@ export function KeyboardAndMouseHandler() { const direction = (e.deltaY > 0 ? -1 : 1) * scrollSign; const delta = - // Helps normalize sensitivity; trackpad scrolling will have many small - // updates while mouse wheels have fewer updates but large deltas. Math.max( MIN_SPEED_ADJUSTMENT, Math.min(MAX_SPEED_ADJUSTMENT, Math.abs(e.deltaY * 0.01)), ) * direction; setSpeedMultiplier((prev) => { - const newSpeed = Math.round((prev + delta) * 20) / 20; - return Math.max(0.1, Math.min(5, newSpeed)); + const newSpeed = Math.round(prev * 100) + delta; + return Math.max( + MIN_SPEED_MULTIPLIER, + Math.min(MAX_SPEED_MULTIPLIER, newSpeed / 100), + ); }); }; @@ -228,12 +252,28 @@ export function KeyboardAndMouseHandler() { }; }, [gl.domElement, setSpeedMultiplier]); - useFrame((state, delta) => { - // When streaming is active and not in free-fly mode, the stream - // (StreamingController) drives the camera — skip our movement. - const spState = streamPlaybackStore.getState(); - if (spState.playback && !spState.freeFlyCamera) return; + // 'O' key: toggle observer mode (sets trigger 2). + useEffect(() => { + if (mode === "local") return; + const handleKey = (e: KeyboardEvent) => { + if (e.code !== "KeyO" || e.metaKey || e.ctrlKey || e.altKey) return; + const target = e.target as HTMLElement; + if ( + target.tagName === "INPUT" || + target.tagName === "TEXTAREA" || + target.isContentEditable + ) { + return; + } + triggerObserve.current = true; + }; + window.addEventListener("keydown", handleKey); + return () => window.removeEventListener("keydown", handleKey); + }, [mode]); + + // Build and emit InputFrame each render frame. + useFrame((_state, delta) => { const { forward, backward, @@ -247,58 +287,60 @@ export function KeyboardAndMouseHandler() { lookRight, } = getKeys(); - // Arrow keys: rotate camera look direction - if (lookUp || lookDown || lookLeft || lookRight) { - lookEuler.current.setFromQuaternion(camera.quaternion, "YXZ"); - if (lookLeft) lookEuler.current.y += ARROW_LOOK_SPEED * delta; - if (lookRight) lookEuler.current.y -= ARROW_LOOK_SPEED * delta; - if (lookUp) lookEuler.current.x += ARROW_LOOK_SPEED * delta; - if (lookDown) lookEuler.current.x -= ARROW_LOOK_SPEED * delta; - lookEuler.current.x = Math.max( - -MAX_PITCH, - Math.min(MAX_PITCH, lookEuler.current.x), - ); - camera.quaternion.setFromEuler(lookEuler.current); + // Arrow keys contribute to look deltas. + let deltaYaw = mouseDeltaYaw.current; + let deltaPitch = mouseDeltaPitch.current; + mouseDeltaYaw.current = 0; + mouseDeltaPitch.current = 0; + + if (lookLeft) deltaYaw -= ARROW_LOOK_SPEED * delta; + if (lookRight) deltaYaw += ARROW_LOOK_SPEED * delta; + if (lookUp) deltaPitch -= ARROW_LOOK_SPEED * delta; + if (lookDown) deltaPitch += ARROW_LOOK_SPEED * delta; + + // Movement axes, pre-scaled by speedMultiplier (clamped to [-1, 1]). + let x = 0; + let y = 0; + let z = 0; + if (left) x -= 1; + if (right) x += 1; + if (forward) y += 1; + if (backward) y -= 1; + if (up) z += 1; + if (down) z -= 1; + + const quantizedSpeedMultiplier = quantizeSpeed(speedMultiplier); + + x = Math.max(-1, Math.min(1, x * quantizedSpeedMultiplier)); + y = Math.max(-1, Math.min(1, y * quantizedSpeedMultiplier)); + z = Math.max(-1, Math.min(1, z * quantizedSpeedMultiplier)); + + // Triggers. + const triggers = [false, false, false, false, false, false]; + if (triggerFire.current) { + triggers[0] = true; + triggerFire.current = false; + } + if (triggerObserve.current) { + triggers[2] = true; + triggerObserve.current = false; } - if (!forward && !backward && !left && !right && !up && !down) { - return; - } + // Only emit if there's actual input. + const hasLook = deltaYaw !== 0 || deltaPitch !== 0; + const hasMove = x !== 0 || y !== 0 || z !== 0; + const hasTriggers = triggers.some(Boolean); + if (!hasLook && !hasMove && !hasTriggers) return; - const speed = BASE_SPEED * speedMultiplier; - - // Forward/backward: take complete camera angle into account (including Y) - camera.getWorldDirection(forwardVec.current); - forwardVec.current.normalize(); - - // Left/right: move along XZ plane - sideVec.current.crossVectors(camera.up, forwardVec.current).normalize(); - - moveVec.current.set(0, 0, 0); - - if (forward) { - moveVec.current.add(forwardVec.current); - } - if (backward) { - moveVec.current.sub(forwardVec.current); - } - if (left) { - moveVec.current.add(sideVec.current); - } - if (right) { - moveVec.current.sub(sideVec.current); - } - if (up) { - moveVec.current.y += 1; - } - if (down) { - moveVec.current.y -= 1; - } - - if (moveVec.current.lengthSq() > 0) { - moveVec.current.normalize().multiplyScalar(speed * delta); - camera.position.add(moveVec.current); - } + onInput({ + deltaYaw, + deltaPitch, + x, + y, + z, + triggers, + delta, + }); }); return null; diff --git a/src/components/LiveObserver.tsx b/src/components/LiveObserver.tsx deleted file mode 100644 index efd0093d..00000000 --- a/src/components/LiveObserver.tsx +++ /dev/null @@ -1,365 +0,0 @@ -import { useRef, useEffect } from "react"; -import { useFrame, useThree } from "@react-three/fiber"; -import { Vector3 } from "three"; -import { useKeyboardControls } from "@react-three/drei"; -import { createLogger } from "../logger"; -import { - liveConnectionStore, - useLiveSelector, -} from "../state/liveConnectionStore"; -import { useEngineStoreApi } from "../state/engineStore"; -import { streamPlaybackStore } from "../state/streamPlaybackStore"; -import { - Controls, - MOUSE_SENSITIVITY, - ARROW_LOOK_SPEED, -} from "./KeyboardAndMouseHandler"; -import { useControls } from "./SettingsProvider"; -import { useTick, TICK_RATE } from "./TickProvider"; -import { yawPitchToQuaternion, MAX_PITCH } from "../stream/streamHelpers"; -import type { StreamRecording, StreamCamera } from "../stream/types"; -import type { LiveStreamAdapter } from "../stream/liveStreaming"; - -const log = createLogger("LiveObserver"); - -const TICK_INTERVAL = 1 / TICK_RATE; - -// Scratch objects to avoid per-frame allocations. -const _orbitDir = new Vector3(); -const _orbitTarget = new Vector3(); - -/** Predicted camera rotation state for client-side prediction. */ -interface PredictionState { - /** Absolute predicted yaw (Torque radians). */ - yaw: number; - /** Absolute predicted pitch (Torque radians). */ - pitch: number; - /** Previous tick's yaw, for inter-tick interpolation. */ - prevYaw: number; - /** Previous tick's pitch, for inter-tick interpolation. */ - prevPitch: number; - /** Whether prediction has been initialized from a server snapshot. */ - initialized: boolean; - /** Last server camera snapshot we synced from (identity check for new data). */ - lastSyncedCamera: StreamCamera | null; -} - -/** - * Bridges the LiveStreamAdapter into the playback pipeline. - * Sends Move structs to the relay and applies client-side rotation prediction - * so camera look feels responsive at frame rate, matching how the real - * Tribes 2 client works (predict locally, correct from server). - */ -export function LiveObserver() { - const adapter = useLiveSelector((s) => s.adapter); - const gameStatus = useLiveSelector((s) => s.gameStatus); - const sendMove = useLiveSelector((s) => s.sendMove); - const store = useEngineStoreApi(); - const { speedMultiplier } = useControls(); - const activeAdapterRef = useRef(null); - const gl = useThree((state) => state.gl); - const [, getKeys] = useKeyboardControls(); - - // Accumulated rotation deltas since last move was sent. Mouse events and - // arrow keys both add to these; consumed at the tick rate (32ms). - const deltaYawRef = useRef(0); - const deltaPitchRef = useRef(0); - - // Client-side prediction state. - const predRef = useRef({ - yaw: 0, - pitch: 0, - prevYaw: 0, - prevPitch: 0, - initialized: false, - lastSyncedCamera: null, - }); - - // Sub-tick accumulator for interpolation (0..TICK_INTERVAL). - const tickAccRef = useRef(0); - - // Wire adapter to engine store. - useEffect(() => { - if ( - adapter && - (gameStatus === "connected" || gameStatus === "authenticating") - ) { - if (activeAdapterRef.current === adapter) return; - - log.info("wiring adapter to engine store"); - const liveState = liveConnectionStore.getState(); - const liveRecording: StreamRecording = { - source: "live", - duration: Infinity, - missionName: liveState.mapName ?? null, - gameType: null, - serverDisplayName: liveState.serverName ?? null, - recorderName: liveState.warriorName ?? null, - recordingDate: null, - streamingPlayback: adapter, - }; - - store.getState().setRecording(liveRecording); - store.getState().setPlaybackStatus("playing"); - activeAdapterRef.current = adapter; - // Reset prediction when connecting to a new server. - predRef.current.initialized = false; - predRef.current.lastSyncedCamera = null; - } else if (!adapter && activeAdapterRef.current) { - // Only clear the recording if it's still the live one we set. - const current = store.getState().playback.recording; - if (current?.source === "live") { - store.getState().setRecording(null); - } - activeAdapterRef.current = null; - predRef.current.initialized = false; - } - }, [adapter, gameStatus, store]); - - // Accumulate mouse deltas when pointer is locked or dragging. - useEffect(() => { - let dragging = false; - - const handleMouseMove = (e: MouseEvent) => { - if (document.pointerLockElement) { - // Match Three.js PointerLockControls default (0.002). - deltaYawRef.current += e.movementX * 0.002; - deltaPitchRef.current += e.movementY * 0.002; - } else if (dragging) { - deltaYawRef.current += e.movementX * MOUSE_SENSITIVITY; - deltaPitchRef.current += e.movementY * MOUSE_SENSITIVITY; - } - }; - - const handleMouseDown = (e: MouseEvent) => { - if (!document.pointerLockElement && e.target === gl.domElement) { - dragging = true; - } - }; - - const handleMouseUp = () => { - dragging = false; - }; - - document.addEventListener("mousemove", handleMouseMove); - document.addEventListener("mousedown", handleMouseDown); - document.addEventListener("mouseup", handleMouseUp); - return () => { - document.removeEventListener("mousemove", handleMouseMove); - document.removeEventListener("mousedown", handleMouseDown); - document.removeEventListener("mouseup", handleMouseUp); - }; - }, [gl.domElement]); - - // Left-click when pointer-locked in follow mode: cycle to next player. - // Only intercepts in follow mode — in fly mode, clicks pass through to - // ObserverControls for pointer lock acquisition. - useEffect(() => { - const handleClick = (e: MouseEvent) => { - if (!document.pointerLockElement || !activeAdapterRef.current) return; - if (activeAdapterRef.current.observerMode !== "follow") return; - e.stopImmediatePropagation(); - activeAdapterRef.current.cycleObserveNext(); - }; - - document.addEventListener("click", handleClick, { capture: true }); - return () => { - document.removeEventListener("click", handleClick, { capture: true }); - }; - }, [gl.domElement]); - - // 'O' toggles between follow and free-fly observer modes on the server. - useEffect(() => { - const handleKey = (e: KeyboardEvent) => { - if (e.code !== "KeyO" || e.metaKey || e.ctrlKey || e.altKey) return; - const target = e.target as HTMLElement; - if ( - target.tagName === "INPUT" || - target.tagName === "TEXTAREA" || - target.isContentEditable - ) { - return; - } - if (!activeAdapterRef.current) return; - - activeAdapterRef.current.toggleObserverMode(); - log.info("observer mode: %s", activeAdapterRef.current.observerMode); - }; - window.addEventListener("keydown", handleKey); - return () => window.removeEventListener("keydown", handleKey); - }, []); - - // Accumulate arrow-key rotation each render frame (frame-rate independent). - useFrame((_, delta) => { - if (!activeAdapterRef.current || gameStatus !== "connected") return; - const { lookUp, lookDown, lookLeft, lookRight } = getKeys(); - if (lookRight) deltaYawRef.current += ARROW_LOOK_SPEED * delta; - if (lookLeft) deltaYawRef.current -= ARROW_LOOK_SPEED * delta; - if (lookDown) deltaPitchRef.current += ARROW_LOOK_SPEED * delta; - if (lookUp) deltaPitchRef.current -= ARROW_LOOK_SPEED * delta; - }); - - // Send moves at the Torque tick rate (32Hz) and apply rotation prediction. - useTick(() => { - if (!activeAdapterRef.current || gameStatus !== "connected") return; - - const { forward, backward, left, right, up, down } = getKeys(); - - // Torque Camera axes: x = strafe (+ right), y = forward/back, z = up/down. - let mx = 0; - let my = 0; - let mz = 0; - if (forward) my += 1; - if (backward) my -= 1; - if (left) mx -= 1; - if (right) mx += 1; - if (up) mz += 1; - if (down) mz -= 1; - - // Consume accumulated rotation deltas. - const yaw = deltaYawRef.current; - const pitch = deltaPitchRef.current; - deltaYawRef.current = 0; - deltaPitchRef.current = 0; - - // Apply prediction: save previous tick state, then advance. - const pred = predRef.current; - pred.prevYaw = pred.yaw; - pred.prevPitch = pred.pitch; - pred.yaw += yaw; - pred.pitch = Math.max(-MAX_PITCH, Math.min(MAX_PITCH, pred.pitch + pitch)); - // Reset sub-tick accumulator for interpolation. - tickAccRef.current = 0; - - // Always set trigger[1] (altTrigger) to enable the server's 2× speed mode - // (80 u/s max). We use altTrigger instead of trigger[0] (fire) because the - // Observer::onTrigger script interprets fire as "join team" / "cycle player" - // depending on camera mode, but altTrigger is unhandled in all observer modes. - // The C++ Camera::processTick checks `trigger[0] || trigger[1]` for fast mode. - const speed = Math.min(1, speedMultiplier); - sendMove({ - x: mx * speed, - y: my * speed, - z: mz * speed, - yaw, - pitch, - roll: 0, - trigger: [false, true, false, false, false, false], - freeLook: false, - }); - }); - - // Override camera rotation with predicted values at frame rate. - // Priority 1 ensures this runs AFTER StreamingController (priority 0), - // which handles position from server snapshots. - useFrame((state, delta) => { - if (!activeAdapterRef.current || gameStatus !== "connected") return; - - const pred = predRef.current; - - // Sync prediction base from each new server snapshot. The server's - // yaw/pitch is authoritative; we layer any pending (unconsumed) mouse - // deltas on top so the camera feels responsive between server updates. - const snapshot = activeAdapterRef.current.getSnapshot(); - const serverCam = snapshot?.camera; - if ( - serverCam && - serverCam !== pred.lastSyncedCamera && - typeof serverCam.yaw === "number" && - typeof serverCam.pitch === "number" - ) { - // Pending deltas not yet consumed by useTick — replay on top of server. - const pendingYaw = deltaYawRef.current; - const pendingPitch = deltaPitchRef.current; - - pred.prevYaw = pred.initialized ? pred.yaw : serverCam.yaw; - pred.prevPitch = pred.initialized ? pred.pitch : serverCam.pitch; - pred.yaw = serverCam.yaw + pendingYaw; - pred.pitch = Math.max( - -MAX_PITCH, - Math.min(MAX_PITCH, serverCam.pitch + pendingPitch), - ); - pred.lastSyncedCamera = serverCam; - pred.initialized = true; - } - - if (!pred.initialized) return; - - // Advance sub-tick accumulator for interpolation. - tickAccRef.current += delta; - const t = Math.min(1, tickAccRef.current / TICK_INTERVAL); - - // Interpolate between previous and current tick prediction, then add - // pending (unconsumed) mouse/arrow deltas so rotation responds at frame - // rate rather than waiting for the next useTick to consume them. - const interpYaw = - pred.prevYaw + (pred.yaw - pred.prevYaw) * t + deltaYawRef.current; - const interpPitch = Math.max( - -MAX_PITCH, - Math.min( - MAX_PITCH, - pred.prevPitch + - (pred.pitch - pred.prevPitch) * t + - deltaPitchRef.current, - ), - ); - - // Convert predicted rotation to Three.js quaternion and apply. - const [qx, qy, qz, qw] = yawPitchToQuaternion(interpYaw, interpPitch); - - // For third-person (orbit) mode, recompute orbit position from predicted - // angles so the orbit responds at frame rate too. - if (serverCam?.mode === "third-person" && serverCam.orbitTargetId) { - const root = streamPlaybackStore.getState().root; - const targetGroup = root?.children.find( - (child) => child.name === serverCam.orbitTargetId, - ); - if (targetGroup) { - _orbitTarget.copy(targetGroup.position); - const entities = streamPlaybackStore.getState().entities; - const orbitEntity = entities.get(serverCam.orbitTargetId); - if (orbitEntity?.renderType === "Player") { - _orbitTarget.y += 1.0; - } - - const sx = Math.sin(interpPitch); - const cx = Math.cos(interpPitch); - const sz = Math.sin(interpYaw); - const cz = Math.cos(interpYaw); - // Camera pulls back along negative forward direction (Torque column 1 - // of Rz*Rx, converted to Three.js coords). - // Torque forward = (-sz*cx, cz*cx, sx) → Three.js = (cz*cx, sx, -sz*cx) - // Negate for pull-back: (-cz*cx, -sx, sz*cx) - _orbitDir.set(-cz * cx, -sx, sz * cx); - - if (_orbitDir.lengthSq() > 1e-8) { - _orbitDir.normalize(); - const orbitDistance = Math.max(0.1, serverCam.orbitDistance ?? 4); - state.camera.position - .copy(_orbitTarget) - .addScaledVector(_orbitDir, orbitDistance); - state.camera.lookAt(_orbitTarget); - } - } - } else { - // Observer fly or first-person: override rotation only (position comes - // from StreamingController's server snapshot interpolation). - state.camera.quaternion.set(qx, qy, qz, qw); - } - }); - - // Clean up on unmount. - useEffect(() => { - return () => { - if (activeAdapterRef.current) { - const current = store.getState().playback.recording; - if (current?.source === "live") { - store.getState().setRecording(null); - } - activeAdapterRef.current = null; - } - }; - }, [store]); - - return null; -} diff --git a/src/components/MapInfoDialog.tsx b/src/components/MapInfoDialog.tsx index 677102b5..4c1e8648 100644 --- a/src/components/MapInfoDialog.tsx +++ b/src/components/MapInfoDialog.tsx @@ -125,9 +125,12 @@ function MusicPlayer({ track }: { track: string }) { const url = `${RESOURCE_ROOT_URL}music/${track.toLowerCase()}.mp3`; useEffect(() => { - return () => { - audioRef.current?.pause(); - }; + const audio = audioRef.current; + if (audio) { + return () => { + audio.pause(); + }; + } }, []); const toggle = () => { diff --git a/src/components/MapInspector.tsx b/src/components/MapInspector.tsx index d084bc23..3fac518a 100644 --- a/src/components/MapInspector.tsx +++ b/src/components/MapInspector.tsx @@ -14,10 +14,11 @@ import { Camera } from "three"; import { InspectorControls } from "@/src/components/InspectorControls"; import { MissionSelect } from "@/src/components/MissionSelect"; import { StreamingMissionInfo } from "@/src/components/StreamingMissionInfo"; -import { SettingsProvider } from "@/src/components/SettingsProvider"; +import { useSettings } from "@/src/components/SettingsProvider"; import { ObserverCamera } from "@/src/components/ObserverCamera"; import { AudioProvider } from "@/src/components/AudioContext"; import { CamerasProvider } from "@/src/components/CamerasProvider"; +import { InputConsumer } from "./InputConsumer"; import { RecordingProvider, useRecording, @@ -33,11 +34,10 @@ import { import { usePublicWindowAPI } from "@/src/components/usePublicWindowAPI"; import { CurrentMission, - useFogQueryState, useMissionQueryState, } from "@/src/components/useQueryParams"; import { ThreeCanvas, InvalidateFunction } from "@/src/components/ThreeCanvas"; -import { InputHandlers, InputProvider } from "./InputHandlers"; +import { InputProducers, InputProvider } from "./InputHandlers"; import { VisualInput } from "./VisualInput"; import { LoadingIndicator } from "./LoadingIndicator"; import { AudioEnabled } from "./AudioEnabled"; @@ -81,10 +81,6 @@ const DebugElements = createLazy( () => import("@/src/components/DebugElements"), ); const Mission = createLazy("Mission", () => import("@/src/components/Mission")); -const LiveObserver = createLazy( - "LiveObserver", - () => import("@/src/components/LiveObserver"), -); const ChatSoundPlayer = createLazy( "ChatSoundPlayer", () => import("@/src/components/ChatSoundPlayer"), @@ -104,16 +100,12 @@ const ServerBrowser = createLazy( export function MapInspector() { const [currentMission, setCurrentMission] = useMissionQueryState(); - const [fogEnabledOverride, setFogEnabledOverride] = useFogQueryState(); - - const clearFogEnabledOverride = useCallback(() => { - setFogEnabledOverride(null); - }, [setFogEnabledOverride]); const features = useFeatures(); + const { clearFogEnabledOverride, sidebarOpen, setSidebarOpen } = + useSettings(); const { missionName, missionType } = currentMission; const [mapInfoOpen, setMapInfoOpen] = useState(false); const [serverBrowserOpen, setServerBrowserOpen] = useState(false); - const [sidebarOpen, setSidebarOpen] = useState(false); const [choosingMap, setChoosingMap] = useState(false); const [missionLoadingProgress, setMissionLoadingProgress] = useState(0); const [showLoadingIndicator, setShowLoadingIndicator] = useState(true); @@ -136,7 +128,7 @@ export function MapInspector() { setSidebarOpen(false); } }, - [clearFogEnabledOverride, setCurrentMission, isTouch], + [clearFogEnabledOverride, setCurrentMission, isTouch, setSidebarOpen], ); usePublicWindowAPI({ onChangeMission: changeMission }); @@ -144,8 +136,6 @@ export function MapInspector() { const recording = useRecording(); const dataSource = useDataSource(); const hasStreamData = dataSource === "demo" || dataSource === "live"; - const hasLiveAdapter = useLiveSelector((s) => s.adapter != null); - // Sync the mission query param when streaming data provides a mission name. const streamMissionName = useMissionName(); const streamMissionType = useMissionType(); @@ -180,13 +170,13 @@ export function MapInspector() { if (gameStatus === "connected" && isTouch) { setSidebarOpen(false); } - }, [gameStatus, isTouch]); + }, [gameStatus, isTouch, setSidebarOpen]); useEffect(() => { if (recording && isTouch) { setSidebarOpen(false); } - }, [isTouch, recording]); + }, [isTouch, recording, setSidebarOpen]); const loadingProgress = missionLoadingProgress; const isLoading = loadingProgress < 1; @@ -214,196 +204,183 @@ export function MapInspector() { return (

- e.stopPropagation()} + onPointerDown={(e) => e.stopPropagation()} + onClick={(e) => e.stopPropagation()} > -
e.stopPropagation()} - onPointerDown={(e) => e.stopPropagation()} - onClick={(e) => e.stopPropagation()} + - - - - - - - {choosingMap && ( - - )} - -
- {sidebarOpen ?
: null} - - -
e.stopPropagation()} - onPointerDown={(e) => e.stopPropagation()} - onClick={(e) => e.stopPropagation()} - data-open={sidebarOpen} - > - setMapInfoOpen(true)} - onOpenServerBrowser={ - features.live ? () => setServerBrowserOpen(true) : undefined - } - onChooseMap={ - hasStreamData - ? () => { - setChoosingMap(true); - } - : undefined - } - onCancelChoosingMap={() => { - setChoosingMap(false); - }} - choosingMap={choosingMap} - cameraRef={cameraRef} - invalidateRef={invalidateRef} - /> -
-
+ {sidebarOpen ? : } + + + + - -
-
- { - cameraRef.current = state.camera; - invalidateRef.current = state.invalidate; - }} - > - - - - - - - - - - - - - - - - {recording ? ( - - - - ) : null} - {!hasStreamData ? ( - - - - ) : null} - {hasLiveAdapter ? ( - - - - ) : null} - - - - -
- {hasStreamData ? ( - - - - ) : null} - - {showLoadingIndicator && ( - - )} + + + {choosingMap && ( + + )} + + + {sidebarOpen ?
: null} + + +
e.stopPropagation()} + onPointerDown={(e) => e.stopPropagation()} + onClick={(e) => e.stopPropagation()} + data-open={sidebarOpen} + > + setMapInfoOpen(true)} + onOpenServerBrowser={ + features.live ? () => setServerBrowserOpen(true) : undefined + } + onChooseMap={ + hasStreamData + ? () => { + setChoosingMap(true); + } + : undefined + } + onCancelChoosingMap={() => { + setChoosingMap(false); + }} + choosingMap={choosingMap} + cameraRef={cameraRef} + invalidateRef={invalidateRef} + />
- -
e.stopPropagation()} - onPointerDown={(e) => e.stopPropagation()} - onClick={(e) => e.stopPropagation()} - > - {recording?.source === "demo" ? ( + + + +
+
+ { + cameraRef.current = state.camera; + invalidateRef.current = state.invalidate; + }} + > + + + + + + + + + + + + + + + + {recording ? ( + + + + ) : null} + {!hasStreamData ? ( + + + + ) : null} + + + + + +
+ {hasStreamData ? ( - + ) : null} -
- {mapInfoOpen ? ( - - - setMapInfoOpen(false)} - missionName={missionName} - missionType={missionType ?? ""} - /> - - + + {showLoadingIndicator && ( + + )} +
+ +
e.stopPropagation()} + onPointerDown={(e) => e.stopPropagation()} + onClick={(e) => e.stopPropagation()} + > + {recording?.source === "demo" ? ( + + + ) : null} - {serverBrowserOpen ? ( - - - setServerBrowserOpen(false)} /> - - - ) : null} - +
+ {mapInfoOpen ? ( + + + setMapInfoOpen(false)} + missionName={missionName} + missionType={missionType ?? ""} + /> + + + ) : null} + {serverBrowserOpen ? ( + + + setServerBrowserOpen(false)} /> + + + ) : null}
); diff --git a/src/components/PlayerHUD.module.css b/src/components/PlayerHUD.module.css index 8263bc46..efd78107 100644 --- a/src/components/PlayerHUD.module.css +++ b/src/components/PlayerHUD.module.css @@ -73,7 +73,7 @@ .WeaponHUD { position: absolute; - right: 8px; + right: 6px; top: 50%; transform: translateY(-50%); display: flex; @@ -87,18 +87,27 @@ /* ── Team Scores (bottom-left) ── */ +.TeamInfo { + display: flex; + flex-direction: column; + gap: 2px; +} + .TeamScores { position: absolute; - bottom: 8px; - left: 8px; - font-family: monospace; + bottom: 6px; + left: 6px; font-size: 12px; + border: 1px solid rgba(128, 255, 200, 0.15); } .TeamRow { + flex: 1 0 auto; display: flex; + align-items: center; + justify-content: space-between; gap: 6px; - padding: 2px 8px; + padding: 4px 8px 4px 6px; background: rgba(0, 50, 60, 0.65); } @@ -106,35 +115,39 @@ border-top: 1px solid rgba(128, 255, 200, 0.15); } +.TeamName { + min-width: 6em; + font-size: 12px; + font-weight: 500; +} + .TeamNameFriendly { - color: #2ecc40; - min-width: 60px; + composes: TeamName; + color: #2de46a; } .TeamNameEnemy { - color: #e44; - min-width: 60px; + composes: TeamName; + color: rgb(121, 203, 212); } .TeamScore { color: #fff; - min-width: 24px; + font-weight: 500; text-align: right; - font-weight: bold; } .TeamCount { color: #9ba; - min-width: 24px; - text-align: right; + font-size: 9px; } /* ── Pack + Inventory HUD (bottom-right) ── */ .PackInventoryHUD { position: absolute; - bottom: 8px; - right: 8px; + bottom: 6px; + right: 6px; display: flex; align-items: center; gap: 4px; @@ -166,7 +179,6 @@ } .PackInvCount { - font-family: monospace; font-size: 11px; color: #bfe; min-width: 12px; diff --git a/src/components/PlayerHUD.tsx b/src/components/PlayerHUD.tsx index 535d78c6..c373339b 100644 --- a/src/components/PlayerHUD.tsx +++ b/src/components/PlayerHUD.tsx @@ -235,15 +235,20 @@ function TeamScores() { (DEFAULT_TEAM_NAMES[team.teamId] ?? `Team ${team.teamId}`); return (
- - {name} - +
+ + {name} + {" "} + + {team.playerCount}{" "} + {team.playerCount === 1 ? "player" : "players"} + +
{team.score} - ({team.playerCount})
); })} diff --git a/src/components/PlayerNameplate.tsx b/src/components/PlayerNameplate.tsx index e8904e25..2c656b24 100644 --- a/src/components/PlayerNameplate.tsx +++ b/src/components/PlayerNameplate.tsx @@ -23,6 +23,8 @@ const IFF_ENEMY_URL = textureToUrl("gui/hud_enemytriangle"); const _tmpVec = new Vector3(); +const EMPTY_KEYFRAMES = []; + /** * Floating nameplate above a player model showing the entity name and a health * bar. Fades out with distance. @@ -45,7 +47,7 @@ export function PlayerNameplate({ entity }: { entity: PlayerEntity }) { }, [gltf.scene]); // Check whether this entity has any health data at all. - const keyframes = entity.keyframes ?? []; + const keyframes = entity.keyframes ?? EMPTY_KEYFRAMES; const hasHealthData = useMemo( () => keyframes.some((kf) => kf.health != null), [keyframes], diff --git a/src/components/SettingsProvider.tsx b/src/components/SettingsProvider.tsx index bae6cc7b..acf2653d 100644 --- a/src/components/SettingsProvider.tsx +++ b/src/components/SettingsProvider.tsx @@ -8,6 +8,8 @@ import { useRef, useState, } from "react"; +import { useFogQueryState } from "./useQueryParams"; +import { useTouchDevice } from "./useTouchDevice"; type StateSetter = ReturnType>[1]; @@ -16,6 +18,7 @@ export type TouchMode = "dualStick" | "moveLookStick"; type SettingsContext = { fogEnabled: boolean; setFogEnabled: StateSetter; + clearFogEnabledOverride: () => void; highQualityFog: boolean; setHighQualityFog: StateSetter; fov: number; @@ -28,6 +31,8 @@ type SettingsContext = { setWarriorName: StateSetter; audioVolume: number; setAudioVolume: StateSetter; + sidebarOpen: boolean; + setSidebarOpen: StateSetter; }; type DebugContext = { @@ -50,6 +55,9 @@ type ControlsContext = { setInvertJoystick: StateSetter; }; +export const MIN_SPEED_MULTIPLIER = 0.01; +export const MAX_SPEED_MULTIPLIER = 1; + const SettingsContext = createContext(null); const DebugContext = createContext(null); const ControlsContext = createContext(null); @@ -68,6 +76,7 @@ type PersistedSettings = { invertScroll?: boolean; invertDrag?: boolean; invertJoystick?: boolean; + sidebarOpen?: boolean; }; export function useSettings() { @@ -82,18 +91,10 @@ export function useControls() { return useContext(ControlsContext); } -export function SettingsProvider({ - children, - fogEnabledOverride, - onClearFogEnabledOverride, -}: { - children: ReactNode; - fogEnabledOverride?: boolean | null; - onClearFogEnabledOverride: () => void; -}) { +export function SettingsProvider({ children }: { children: ReactNode }) { const [fogEnabled, setFogEnabled] = useState(true); const [highQualityFog, setHighQualityFog] = useState(false); - const [speedMultiplier, setSpeedMultiplier] = useState(1); + const [speedMultiplier, setSpeedMultiplier] = useState(0.15); const [fov, setFov] = useState(90); const [audioEnabled, setAudioEnabled] = useState(false); const [audioVolume, setAudioVolume] = useState(0.75); @@ -104,20 +105,27 @@ export function SettingsProvider({ const [invertScroll, setInvertScroll] = useState(false); const [invertDrag, setInvertDrag] = useState(false); const [invertJoystick, setInvertJoystick] = useState(false); + const [sidebarOpen, setSidebarOpen] = useState(false); const [renderOnDemand, setRenderOnDemand] = useState(false); + const [fogEnabledOverride, setFogEnabledOverride] = useFogQueryState(); + const clearFogEnabledOverride = useCallback(() => { + setFogEnabledOverride(null); + }, [setFogEnabledOverride]); + const setFogEnabledWithoutOverride: StateSetter = useCallback( (value) => { setFogEnabled(value); - onClearFogEnabledOverride(); + clearFogEnabledOverride(); }, - [onClearFogEnabledOverride], + [clearFogEnabledOverride], ); const settingsContext: SettingsContext = useMemo( () => ({ fogEnabled: fogEnabledOverride ?? fogEnabled, setFogEnabled: setFogEnabledWithoutOverride, + clearFogEnabledOverride, highQualityFog, setHighQualityFog, fov, @@ -130,17 +138,21 @@ export function SettingsProvider({ setWarriorName, audioVolume, setAudioVolume, + sidebarOpen, + setSidebarOpen, }), [ fogEnabled, fogEnabledOverride, setFogEnabledWithoutOverride, + clearFogEnabledOverride, highQualityFog, fov, audioEnabled, animationEnabled, warriorName, audioVolume, + sidebarOpen, ], ); @@ -178,8 +190,13 @@ export function SettingsProvider({ ], ); + const isTouch = useTouchDevice(); + // Read persisted settings from localStorage. useEffect(() => { + // Defer until we know whether or not we're on a touch device... + if (isTouch == null) return; + let savedSettings: PersistedSettings = {}; try { savedSettings = JSON.parse(localStorage.getItem("settings")) || {}; @@ -203,7 +220,10 @@ export function SettingsProvider({ } if (savedSettings.speedMultiplier != null) { setSpeedMultiplier( - Math.max(0, Math.min(1, savedSettings.speedMultiplier)), + Math.max( + MIN_SPEED_MULTIPLIER, + Math.min(MAX_SPEED_MULTIPLIER, savedSettings.speedMultiplier), + ), ); } if (savedSettings.fov != null) { @@ -227,7 +247,13 @@ export function SettingsProvider({ if (savedSettings.invertJoystick != null) { setInvertJoystick(savedSettings.invertJoystick); } - }, []); + if (savedSettings.sidebarOpen != null) { + // Don't restore on touch devices! + if (!isTouch) { + setSidebarOpen(savedSettings.sidebarOpen); + } + } + }, [isTouch]); // Persist settings to localStorage with debouncing to avoid excessive writes const saveTimerRef = useRef | null>(null); @@ -254,6 +280,7 @@ export function SettingsProvider({ invertScroll, invertDrag, invertJoystick, + sidebarOpen, }; try { localStorage.setItem("settings", JSON.stringify(settingsToSave)); @@ -281,6 +308,7 @@ export function SettingsProvider({ invertScroll, invertDrag, invertJoystick, + sidebarOpen, ]); return ( diff --git a/src/components/StreamingController.tsx b/src/components/StreamingController.tsx index 433da908..fbfc075a 100644 --- a/src/components/StreamingController.tsx +++ b/src/components/StreamingController.tsx @@ -418,36 +418,40 @@ export function StreamingController({ // When freeFlyCamera is active, skip stream camera positioning so // ObserverControls drives the camera instead. const freeFly = streamPlaybackStore.getState().freeFlyCamera; - // In live mode, LiveObserver owns camera rotation (client-side prediction). - // StreamingController still handles position, FOV, and entity interpolation. + // In live mode, InputConsumer owns camera position and rotation + // (moves are applied locally, matching how the real Tribes 2 client + // handles its control Camera). StreamingController still handles + // entity interpolation, FOV, and orbit target positioning. const isLive = recording.source === "live"; if (currentCamera && !freeFly) { - if (previousCamera) { - const px = previousCamera.position[0]; - const py = previousCamera.position[1]; - const pz = previousCamera.position[2]; - const cx = currentCamera.position[0]; - const cy = currentCamera.position[1]; - const cz = currentCamera.position[2]; - const ix = px + (cx - px) * interpT; - const iy = py + (cy - py) * interpT; - const iz = pz + (cz - pz) * interpT; - state.camera.position.set(iy, iz, ix); + // In live mode, InputConsumer owns both camera position and rotation + // (client-side prediction with server reconciliation + interpolateTick, + // matching Tribes 2's Camera behavior). StreamingController only + // handles entity interpolation, FOV, and orbit target positioning. + if (!isLive) { + if (previousCamera) { + const px = previousCamera.position[0]; + const py = previousCamera.position[1]; + const pz = previousCamera.position[2]; + const cx = currentCamera.position[0]; + const cy = currentCamera.position[1]; + const cz = currentCamera.position[2]; + const ix = px + (cx - px) * interpT; + const iy = py + (cy - py) * interpT; + const iz = pz + (cz - pz) * interpT; + state.camera.position.set(iy, iz, ix); - if (!isLive) { _interpQuatA.set(...previousCamera.rotation); _interpQuatB.set(...currentCamera.rotation); _interpQuatA.slerp(_interpQuatB, interpT); state.camera.quaternion.copy(_interpQuatA); - } - } else { - state.camera.position.set( - currentCamera.position[1], - currentCamera.position[2], - currentCamera.position[0], - ); - if (!isLive) { + } else { + state.camera.position.set( + currentCamera.position[1], + currentCamera.position[2], + currentCamera.position[0], + ); state.camera.quaternion.set(...currentCamera.rotation); } } @@ -550,8 +554,8 @@ export function StreamingController({ } const mode = currentCamera?.mode; - // In live mode, LiveObserver handles orbit positioning from predicted - // angles so the orbit responds at frame rate. Skip here to avoid fighting. + // In live mode, InputConsumer handles orbit positioning from local rotation + // so the orbit responds at frame rate. Skip here to avoid fighting. if ( !freeFly && !isLive && diff --git a/src/components/StreamingMissionInfo.module.css b/src/components/StreamingMissionInfo.module.css index 3005e4e6..c1af028d 100644 --- a/src/components/StreamingMissionInfo.module.css +++ b/src/components/StreamingMissionInfo.module.css @@ -67,6 +67,10 @@ margin-top: -0.5px; } +.Error { + color: rgb(255, 106, 69); +} + @media (max-width: 899px) { .Metadata { display: none; diff --git a/src/components/StreamingMissionInfo.tsx b/src/components/StreamingMissionInfo.tsx index ca780264..c7d8a452 100644 --- a/src/components/StreamingMissionInfo.tsx +++ b/src/components/StreamingMissionInfo.tsx @@ -68,12 +68,16 @@ export function StreamingMissionInfo() {
{isLive ? ( - playerName ? ( -
- Connected as{" "} - {playerName} -
- ) : null + isLiveConnected ? ( + playerName ? ( +
+ Connected as{" "} + {playerName} +
+ ) : null + ) : ( +
Disconnected
+ ) ) : playerName && dateString ? (
Recorded by {playerName}{" "} diff --git a/src/components/TickProvider.tsx b/src/components/TickProvider.tsx index 322aad9b..cfc12e2c 100644 --- a/src/components/TickProvider.tsx +++ b/src/components/TickProvider.tsx @@ -18,6 +18,8 @@ export type TickCallback = (tick: number) => void; interface TickContextValue { subscribe: (callback: TickCallback) => () => void; getTick: () => number; + /** Fraction [0, 1) of the current tick elapsed since the last tick fired. */ + getTickFraction: () => number; } const TickContext = createContext(null); @@ -56,7 +58,15 @@ export function TickProvider({ children }: TickProviderProps) { const getTick = useCallback(() => tickRef.current, []); - const context = useMemo(() => ({ subscribe, getTick }), [subscribe, getTick]); + const getTickFraction = useCallback( + () => accumulatorRef.current / TICK_INTERVAL, + [], + ); + + const context = useMemo( + () => ({ subscribe, getTick, getTickFraction }), + [subscribe, getTick, getTickFraction], + ); return ( {children} @@ -83,3 +93,11 @@ export function useGetTick() { } return context.getTick; } + +export function useGetTickFraction() { + const context = useContext(TickContext); + if (!context) { + throw new Error("useGetTickFraction must be used within a TickProvider"); + } + return context.getTickFraction; +} diff --git a/src/components/TouchHandler.tsx b/src/components/TouchHandler.tsx index a829052e..2a1ef4b3 100644 --- a/src/components/TouchHandler.tsx +++ b/src/components/TouchHandler.tsx @@ -1,16 +1,14 @@ import { useEffect, useEffectEvent, useRef } from "react"; -import { Euler, Vector3 } from "three"; import { useFrame, useThree } from "@react-three/fiber"; import { useControls } from "./SettingsProvider"; import { useJoystick } from "./JoystickContext"; +import { useOnInput } from "./InputContext"; -const BASE_SPEED = 80; const LOOK_SENSITIVITY = 0.004; const STICK_LOOK_SENSITIVITY = 2.5; const DUAL_MOVE_DEADZONE = 0.08; const DUAL_LOOK_DEADZONE = 0.15; const SINGLE_STICK_DEADZONE = 0.15; -const MAX_PITCH = Math.PI / 2 - 0.01; // ~89° export type JoystickState = { angle: number; @@ -21,25 +19,18 @@ export type JoystickState = { export function TouchHandler() { const { speedMultiplier, touchMode, invertDrag, invertJoystick } = useControls(); - const camera = useThree((state) => state.camera); const gl = useThree((state) => state.gl); const { moveState, lookState } = useJoystick(); + const onInput = useOnInput(); // Touch look state - const euler = useRef(new Euler(0, 0, 0, "YXZ")); const lookTouchId = useRef(null); const lastTouchPos = useRef({ x: 0, y: 0 }); const getInvertDrag = useEffectEvent(() => invertDrag); - // Scratch vectors - const forwardVec = useRef(new Vector3()); - const sideVec = useRef(new Vector3()); - const moveVec = useRef(new Vector3()); - - // Initialize euler from current camera rotation on mount - useEffect(() => { - euler.current.setFromQuaternion(camera.quaternion, "YXZ"); - }, [camera]); + // Accumulated touch-drag deltas between frames. + const touchDeltaYaw = useRef(0); + const touchDeltaPitch = useRef(0); // Touch-drag look handling (moveLookStick mode) useEffect(() => { @@ -47,27 +38,13 @@ export function TouchHandler() { const canvas = gl.domElement; - // const isTouchOnJoystick = (touch: Touch) => { - // const zone = joystickZone.current; - // if (!zone) return false; - // const rect = zone.getBoundingClientRect(); - // return ( - // touch.clientX >= rect.left && - // touch.clientX <= rect.right && - // touch.clientY >= rect.top && - // touch.clientY <= rect.bottom - // ); - // }; - const handleTouchStart = (e: TouchEvent) => { if (lookTouchId.current !== null) return; for (let i = 0; i < e.changedTouches.length; i++) { const touch = e.changedTouches[i]; - // if (!isTouchOnJoystick(touch)) { lookTouchId.current = touch.identifier; lastTouchPos.current = { x: touch.clientX, y: touch.clientY }; break; - // } } }; @@ -81,14 +58,8 @@ export function TouchHandler() { lastTouchPos.current = { x: touch.clientX, y: touch.clientY }; const dragSign = getInvertDrag() ? -1 : 1; - euler.current.setFromQuaternion(camera.quaternion, "YXZ"); - euler.current.y += dragSign * dx * LOOK_SENSITIVITY; - euler.current.x += dragSign * dy * LOOK_SENSITIVITY; - euler.current.x = Math.max( - -MAX_PITCH, - Math.min(MAX_PITCH, euler.current.x), - ); - camera.quaternion.setFromEuler(euler.current); + touchDeltaYaw.current += dragSign * dx * LOOK_SENSITIVITY; + touchDeltaPitch.current += dragSign * dy * LOOK_SENSITIVITY; break; } } @@ -115,14 +86,23 @@ export function TouchHandler() { canvas.removeEventListener("touchcancel", handleTouchEnd); lookTouchId.current = null; }; - }, [camera, gl.domElement, touchMode]); + }, [gl.domElement, touchMode]); useFrame((_state, delta) => { const { force: moveForce, angle: moveAngle } = moveState.current; const { force: lookForce, angle: lookAngle } = lookState.current; + let deltaYaw = touchDeltaYaw.current; + let deltaPitch = touchDeltaPitch.current; + touchDeltaYaw.current = 0; + touchDeltaPitch.current = 0; + + let x = 0; + let y = 0; + const z = 0; + if (touchMode === "dualStick") { - // Right stick → camera rotation + // Right stick -> camera rotation if (lookForce > DUAL_LOOK_DEADZONE) { const normalizedLookForce = (lookForce - DUAL_LOOK_DEADZONE) / (1 - DUAL_LOOK_DEADZONE); @@ -130,56 +110,41 @@ export function TouchHandler() { const lookY = Math.sin(lookAngle); const joySign = invertJoystick ? -1 : 1; - euler.current.setFromQuaternion(camera.quaternion, "YXZ"); - euler.current.y -= + deltaYaw -= joySign * lookX * normalizedLookForce * STICK_LOOK_SENSITIVITY * delta; - euler.current.x += + deltaPitch += joySign * lookY * normalizedLookForce * STICK_LOOK_SENSITIVITY * delta; - euler.current.x = Math.max( - -MAX_PITCH, - Math.min(MAX_PITCH, euler.current.x), - ); - camera.quaternion.setFromEuler(euler.current); } - // Left stick → movement + // Left stick -> movement if (moveForce > DUAL_MOVE_DEADZONE) { const normalizedMoveForce = (moveForce - DUAL_MOVE_DEADZONE) / (1 - DUAL_MOVE_DEADZONE); - const speed = BASE_SPEED * speedMultiplier * normalizedMoveForce; const joyX = Math.cos(moveAngle); const joyY = Math.sin(moveAngle); - camera.getWorldDirection(forwardVec.current); - forwardVec.current.normalize(); - sideVec.current.crossVectors(camera.up, forwardVec.current).normalize(); - - moveVec.current - .set(0, 0, 0) - .addScaledVector(forwardVec.current, joyY) - .addScaledVector(sideVec.current, -joyX); - - if (moveVec.current.lengthSq() > 0) { - moveVec.current.normalize().multiplyScalar(speed * delta); - camera.position.add(moveVec.current); - } + // Map joystick to movement axes, pre-scaled by speedMultiplier. + x = Math.max( + -1, + Math.min(1, -joyX * normalizedMoveForce * speedMultiplier), + ); + y = Math.max( + -1, + Math.min(1, joyY * normalizedMoveForce * speedMultiplier), + ); } } else if (touchMode === "moveLookStick") { if (moveForce > 0) { - // Move forward at half the configured speed. - const speed = BASE_SPEED * speedMultiplier * 0.5; - camera.getWorldDirection(forwardVec.current); - forwardVec.current.normalize(); - moveVec.current.copy(forwardVec.current).multiplyScalar(speed * delta); - camera.position.add(moveVec.current); + // Move forward at half speed. + y = Math.max(-1, Math.min(1, 0.5 * speedMultiplier)); if (moveForce >= SINGLE_STICK_DEADZONE) { // Outer zone: also control camera look (yaw + pitch). @@ -189,29 +154,38 @@ export function TouchHandler() { (moveForce - SINGLE_STICK_DEADZONE) / (1 - SINGLE_STICK_DEADZONE); const singleJoySign = invertJoystick ? -1 : 1; - euler.current.setFromQuaternion(camera.quaternion, "YXZ"); - euler.current.y -= + deltaYaw -= singleJoySign * lookX * normalizedLookForce * STICK_LOOK_SENSITIVITY * 0.5 * delta; - euler.current.x += + deltaPitch += singleJoySign * lookY * normalizedLookForce * STICK_LOOK_SENSITIVITY * 0.5 * delta; - euler.current.x = Math.max( - -MAX_PITCH, - Math.min(MAX_PITCH, euler.current.x), - ); - camera.quaternion.setFromEuler(euler.current); } } } + + // Only emit if there's actual input. + const hasLook = deltaYaw !== 0 || deltaPitch !== 0; + const hasMove = x !== 0 || y !== 0 || z !== 0; + if (!hasLook && !hasMove) return; + + onInput({ + deltaYaw, + deltaPitch, + x, + y, + z, + triggers: [], + delta, + }); }); return null; diff --git a/src/state/liveConnectionStore.ts b/src/state/liveConnectionStore.ts index 8b8c4ce0..6b22da02 100644 --- a/src/state/liveConnectionStore.ts +++ b/src/state/liveConnectionStore.ts @@ -45,7 +45,7 @@ export interface LiveConnectionStore extends LiveConnectionState { listServers(): void; joinServer(address: string, warriorName?: string): void; disconnectServer(): void; - sendMove(move: ClientMove): void; + sendMoves(moves: ClientMove[], moveStartIndex: number): void; sendCommand(command: string, ...args: string[]): void; } @@ -254,8 +254,8 @@ export const liveConnectionStore = createStore( }); }, - sendMove(move) { - get()._relay?.sendMove(move); + sendMoves(moves, moveStartIndex) { + get()._relay?.sendMoves(moves, moveStartIndex); }, sendCommand(command, ...args) { diff --git a/src/stream/liveStreaming.ts b/src/stream/liveStreaming.ts index 587b5267..e0ac2830 100644 --- a/src/stream/liveStreaming.ts +++ b/src/stream/liveStreaming.ts @@ -39,6 +39,9 @@ export class LiveStreamAdapter extends StreamEngine { /** Current mission name as reported by the server. */ missionName: string | null = null; + /** Server's latest move acknowledgment (which moveIndex it has processed). */ + lastMoveAck = 0; + constructor(relay: RelayClient) { super(); this.relay = relay; @@ -306,57 +309,17 @@ export class LiveStreamAdapter extends StreamEngine { */ observerMode: "fly" | "follow" = "fly"; - /** Enter follow mode (from fly) or cycle to next player (in follow). */ - cycleObserveNext(): void { - if (this.observerMode === "fly") { - // Jump trigger enters observerFollow from observerFly - log.info("observer: fly → follow (jump trigger)"); - this.sendTrigger(2); - this.observerMode = "follow"; - } else { - // Fire trigger cycles to next player in observerFollow - log.info("observer: cycle next (fire trigger)"); - this.sendTrigger(0); - } - } - - /** Toggle between follow and free-fly observer modes. */ + /** Toggle between follow and free-fly observer modes (local state only). */ toggleObserverMode(): void { if (this.observerMode === "fly") { - // Jump trigger enters observerFollow from observerFly - log.info("observer: fly → follow (jump trigger)"); - this.sendTrigger(2); + log.info("observer: fly → follow"); this.observerMode = "follow"; } else { - // Jump trigger returns to observerFly from observerFollow - log.info("observer: follow → fly (jump trigger)"); - this.sendTrigger(2); + log.info("observer: follow → fly"); this.observerMode = "fly"; } } - private sendTrigger(index: number): void { - const trigger: [boolean, boolean, boolean, boolean, boolean, boolean] = [ - false, - false, - false, - false, - false, - false, - ]; - trigger[index] = true; - this.relay.sendMove({ - x: 0, - y: 0, - z: 0, - yaw: 0, - pitch: 0, - roll: 0, - trigger, - freeLook: false, - }); - } - /** Get the player list (for observer cycling UI). */ getPlayerList(): PlayerListEntry[] { const entries: PlayerListEntry[] = []; @@ -409,6 +372,9 @@ export class LiveStreamAdapter extends StreamEngine { ); } + // Track move acknowledgments for client-side prediction replay. + this.lastMoveAck = parsed.gameState.lastMoveAck; + // Control object state this.processControlObject(parsed.gameState); diff --git a/src/stream/relayClient.ts b/src/stream/relayClient.ts index c2ee0645..b2bdfcb5 100644 --- a/src/stream/relayClient.ts +++ b/src/stream/relayClient.ts @@ -175,9 +175,9 @@ export class RelayClient { this.send({ type: "sendGhostAck", sequence, ghostCount }); } - /** Send a move struct to the relay for forwarding to the game server. */ - sendMove(move: ClientMove): void { - this.send({ type: "sendMove", move }); + /** Send moves to the relay for immediate forwarding to the game server. */ + sendMoves(moves: ClientMove[], moveStartIndex: number): void { + this.send({ type: "sendMoves", moves, moveStartIndex }); } /** Close the WebSocket connection entirely. */