@recombine-ai/bosun 0.8.3 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/bosun.js +22 -0
- package/build/client/_app/immutable/chunks/{0e_4hQ6g.js → BqYZT6mz.js} +1 -1
- package/build/client/_app/immutable/chunks/BqYZT6mz.js.br +0 -0
- package/build/client/_app/immutable/chunks/BqYZT6mz.js.gz +0 -0
- package/build/client/_app/immutable/chunks/{Qml5ZyeD.js → CZNq9Fp2.js} +1 -1
- package/build/client/_app/immutable/chunks/CZNq9Fp2.js.br +0 -0
- package/build/client/_app/immutable/chunks/CZNq9Fp2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DgnCUaz1.js +1 -0
- package/build/client/_app/immutable/chunks/DgnCUaz1.js.br +0 -0
- package/build/client/_app/immutable/chunks/DgnCUaz1.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.Bpgxjy-s.js → app.CE1yZowM.js} +2 -2
- package/build/client/_app/immutable/entry/app.CE1yZowM.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CE1yZowM.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.D15lqSpY.js +1 -0
- package/build/client/_app/immutable/entry/start.D15lqSpY.js.br +2 -0
- package/build/client/_app/immutable/entry/start.D15lqSpY.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{0.B_DUfle6.js → 0.cfpwGp_4.js} +1 -1
- package/build/client/_app/immutable/nodes/0.cfpwGp_4.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.cfpwGp_4.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{1.BMRtiAgG.js → 1.CHri8WYe.js} +1 -1
- package/build/client/_app/immutable/nodes/1.CHri8WYe.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.CHri8WYe.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{17.Bn7AdwZ5.js → 17.BTYNQV25.js} +1 -1
- package/build/client/_app/immutable/nodes/17.BTYNQV25.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.BTYNQV25.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{18.D6rkjSXS.js → 18.B8hhkZZh.js} +1 -1
- package/build/client/_app/immutable/nodes/18.B8hhkZZh.js.br +0 -0
- package/build/client/_app/immutable/nodes/18.B8hhkZZh.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{2.DuwVz5hs.js → 2.DZ1cMXf3.js} +1 -1
- package/build/client/_app/immutable/nodes/2.DZ1cMXf3.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DZ1cMXf3.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{3.CWbDFdJc.js → 3.CCm10CUg.js} +1 -1
- package/build/client/_app/immutable/nodes/3.CCm10CUg.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CCm10CUg.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{4.BKfSk-la.js → 4.Bh8P8-OG.js} +1 -1
- package/build/client/_app/immutable/nodes/4.Bh8P8-OG.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.Bh8P8-OG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{6.BBELyzrl.js → 6.Bt2W7P40.js} +1 -1
- package/build/client/_app/immutable/nodes/6.Bt2W7P40.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.Bt2W7P40.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{9.B5srlcvO.js → 9.Td5mdQc9.js} +1 -1
- package/build/client/_app/immutable/nodes/9.Td5mdQc9.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.Td5mdQc9.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/chunks/{0-DQYiSkTc.js → 0-bHCVPlND.js} +2 -2
- package/build/server/chunks/{0-DQYiSkTc.js.map → 0-bHCVPlND.js.map} +1 -1
- package/build/server/chunks/{1-DhkFWhdS.js → 1--P6amfWt.js} +2 -2
- package/build/server/chunks/{1-DhkFWhdS.js.map → 1--P6amfWt.js.map} +1 -1
- package/build/server/chunks/{17-spCxnu0D.js → 17-CoHFBhYv.js} +2 -2
- package/build/server/chunks/{17-spCxnu0D.js.map → 17-CoHFBhYv.js.map} +1 -1
- package/build/server/chunks/{18-5ywopQxh.js → 18-BbzKL6Ws.js} +2 -2
- package/build/server/chunks/{18-5ywopQxh.js.map → 18-BbzKL6Ws.js.map} +1 -1
- package/build/server/chunks/{2-DHZvoK0l.js → 2-C4K8hcZz.js} +2 -2
- package/build/server/chunks/{2-DHZvoK0l.js.map → 2-C4K8hcZz.js.map} +1 -1
- package/build/server/chunks/{3-C4s3Ddrr.js → 3-DE5hYVwf.js} +2 -2
- package/build/server/chunks/{3-C4s3Ddrr.js.map → 3-DE5hYVwf.js.map} +1 -1
- package/build/server/chunks/{4-8t7YAnVi.js → 4-Cg9g_jQ6.js} +2 -2
- package/build/server/chunks/{4-8t7YAnVi.js.map → 4-Cg9g_jQ6.js.map} +1 -1
- package/build/server/chunks/{6-B-5Y3vyU.js → 6-BrZQQi63.js} +2 -2
- package/build/server/chunks/{6-B-5Y3vyU.js.map → 6-BrZQQi63.js.map} +1 -1
- package/build/server/chunks/{9-CXFkFySA.js → 9-F1QcQ0ns.js} +2 -2
- package/build/server/chunks/{9-CXFkFySA.js.map → 9-F1QcQ0ns.js.map} +1 -1
- package/build/server/index.js +1 -1
- package/build/server/index.js.map +1 -1
- package/build/server/manifest.js +10 -10
- package/build/server/manifest.js.map +1 -1
- package/package.json +4 -2
- package/src/backend/lib/get-agent-factories.ts +1 -1
- package/src/backend/roleplay/agents.ts +19 -43
- package/src/backend/roleplay/message-dispatcher.ts +5 -9
- package/src/backend/roleplay/router.ts +8 -6
- package/src/backend/roleplay/scheduler.ts +2 -15
- package/src/backend/roleplay/variants.ts +11 -26
- package/src/backend/tests/academy.ts +1 -21
- package/src/backend/tests/emulate-agents.ts +67 -72
- package/build/client/_app/immutable/chunks/0e_4hQ6g.js.br +0 -0
- package/build/client/_app/immutable/chunks/0e_4hQ6g.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Qml5ZyeD.js.br +0 -0
- package/build/client/_app/immutable/chunks/Qml5ZyeD.js.gz +0 -0
- package/build/client/_app/immutable/chunks/yPd1epTY.js +0 -1
- package/build/client/_app/immutable/chunks/yPd1epTY.js.br +0 -0
- package/build/client/_app/immutable/chunks/yPd1epTY.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.Bpgxjy-s.js.br +0 -0
- package/build/client/_app/immutable/entry/app.Bpgxjy-s.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.gcze8Gig.js +0 -1
- package/build/client/_app/immutable/entry/start.gcze8Gig.js.br +0 -2
- package/build/client/_app/immutable/entry/start.gcze8Gig.js.gz +0 -0
- package/build/client/_app/immutable/nodes/0.B_DUfle6.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.B_DUfle6.js.gz +0 -0
- package/build/client/_app/immutable/nodes/1.BMRtiAgG.js.br +0 -0
- package/build/client/_app/immutable/nodes/1.BMRtiAgG.js.gz +0 -0
- package/build/client/_app/immutable/nodes/17.Bn7AdwZ5.js.br +0 -0
- package/build/client/_app/immutable/nodes/17.Bn7AdwZ5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/18.D6rkjSXS.js.br +0 -0
- package/build/client/_app/immutable/nodes/18.D6rkjSXS.js.gz +0 -0
- package/build/client/_app/immutable/nodes/2.DuwVz5hs.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.DuwVz5hs.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.CWbDFdJc.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.CWbDFdJc.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BKfSk-la.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BKfSk-la.js.gz +0 -0
- package/build/client/_app/immutable/nodes/6.BBELyzrl.js.br +0 -0
- package/build/client/_app/immutable/nodes/6.BBELyzrl.js.gz +0 -0
- package/build/client/_app/immutable/nodes/9.B5srlcvO.js.br +0 -0
- package/build/client/_app/immutable/nodes/9.B5srlcvO.js.gz +0 -0
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
type StepTracer,
|
|
5
|
-
type Logger,
|
|
6
|
-
type TestAgent,
|
|
7
|
-
type TestVoiceAgent
|
|
8
|
-
} from '@recombine-ai/engine'
|
|
1
|
+
import { createContext, type Message, type Logger, type Scheduler } from '@recombine-ai/engine'
|
|
2
|
+
import { type TestAgent, type TestVoiceAgent } from '@recombine-ai/bosun-lib'
|
|
3
|
+
import { type StepTracer } from '@recombine-ai/telescope'
|
|
9
4
|
import { getAgentFactories } from '../lib/get-agent-factories'
|
|
10
5
|
import { getImportNonce } from '../lib/import-nonce'
|
|
11
6
|
import { getRootPath } from '../lib/get-root-path'
|
|
@@ -17,8 +12,7 @@ export async function loadAgents(props: {
|
|
|
17
12
|
sendMessage: (message: Message | string) => Promise<void>
|
|
18
13
|
stepTracer: StepTracer
|
|
19
14
|
logger?: Logger
|
|
20
|
-
context?: Record<string,
|
|
21
|
-
timeoutSeconds: number
|
|
15
|
+
context?: Record<string, unknown>
|
|
22
16
|
abortSignal?: AbortSignal
|
|
23
17
|
}): Promise<void> {
|
|
24
18
|
const {
|
|
@@ -29,7 +23,6 @@ export async function loadAgents(props: {
|
|
|
29
23
|
stepTracer: stepTracer,
|
|
30
24
|
logger: providedLogger,
|
|
31
25
|
context,
|
|
32
|
-
timeoutSeconds,
|
|
33
26
|
abortSignal
|
|
34
27
|
} = props
|
|
35
28
|
const importNonce = getImportNonce()
|
|
@@ -44,34 +37,20 @@ export async function loadAgents(props: {
|
|
|
44
37
|
error: () => {},
|
|
45
38
|
warn: () => {}
|
|
46
39
|
}
|
|
47
|
-
const scheduler = {
|
|
40
|
+
const scheduler: Scheduler = {
|
|
48
41
|
clearAllPendingActions: async () => {},
|
|
49
|
-
registerAction: () => async () => {}
|
|
50
|
-
triggerAction: async () => {},
|
|
51
|
-
serialize: () => ({}) as any,
|
|
52
|
-
setState: (_: any) => {}
|
|
53
|
-
}
|
|
54
|
-
const ctx = createContext({})
|
|
55
|
-
|
|
56
|
-
// Maintain in-run history so sendMessage appends to it, mirroring backend behavior
|
|
57
|
-
const history = getMessages()
|
|
58
|
-
const getMessagesWithHistory = () => history
|
|
59
|
-
const sendMessageWithHistory = async (message: Message | string) => {
|
|
60
|
-
const m =
|
|
61
|
-
typeof message === 'string' ? ({ sender: 'agent', text: message } as Message) : message
|
|
62
|
-
try {
|
|
63
|
-
history.push(m)
|
|
64
|
-
} catch {
|
|
65
|
-
// Best-effort: if history is immutable, ignore push errors
|
|
66
|
-
logger.log('Failed to push message to history:', m)
|
|
67
|
-
}
|
|
68
|
-
await sendMessage(m)
|
|
42
|
+
registerAction: () => async () => {}
|
|
69
43
|
}
|
|
70
44
|
|
|
71
45
|
const stepRegistry = {
|
|
72
46
|
addStep: () => {}
|
|
73
47
|
}
|
|
74
48
|
|
|
49
|
+
const ctx = createContext({})
|
|
50
|
+
|
|
51
|
+
// Maintain in-run history so sendMessage appends to it, mirroring backend behavior
|
|
52
|
+
let history: Message[] = []
|
|
53
|
+
|
|
75
54
|
if (region) {
|
|
76
55
|
// The UI-selected region is stored in Bosun's runtime ctx and consumed by the project's workflows.
|
|
77
56
|
// Setting it before calling the factory ensures region-scoped config/strings are used for this run.
|
|
@@ -82,13 +61,25 @@ export async function loadAgents(props: {
|
|
|
82
61
|
const agent = await factory({
|
|
83
62
|
stepTracer: stepTracer,
|
|
84
63
|
stepRegistry,
|
|
85
|
-
tracer: stepRegistry,
|
|
86
64
|
logger: logger,
|
|
87
|
-
scheduler: scheduler
|
|
88
|
-
getMessages:
|
|
89
|
-
sendMessage
|
|
90
|
-
|
|
91
|
-
|
|
65
|
+
scheduler: scheduler,
|
|
66
|
+
getMessages: () => history,
|
|
67
|
+
async sendMessage(message) {
|
|
68
|
+
const m =
|
|
69
|
+
typeof message === 'string' ? ({ sender: 'agent', text: message } as Message) : message
|
|
70
|
+
try {
|
|
71
|
+
history.push(m)
|
|
72
|
+
} catch {
|
|
73
|
+
// Best-effort: if history is immutable, ignore push errors
|
|
74
|
+
logger.log('Failed to push message to history:', m)
|
|
75
|
+
}
|
|
76
|
+
await sendMessage(m)
|
|
77
|
+
},
|
|
78
|
+
ctx,
|
|
79
|
+
config: {
|
|
80
|
+
isTest: true,
|
|
81
|
+
enableTimers: false
|
|
82
|
+
}
|
|
92
83
|
})
|
|
93
84
|
|
|
94
85
|
if (context && typeof context === 'object') {
|
|
@@ -100,7 +91,43 @@ export async function loadAgents(props: {
|
|
|
100
91
|
console.error('UNHANDLED', r)
|
|
101
92
|
})
|
|
102
93
|
|
|
103
|
-
const withAbort =
|
|
94
|
+
const withAbort = wrapAbort(abortSignal)
|
|
95
|
+
|
|
96
|
+
process.env.IS_TEST = 'true'
|
|
97
|
+
try {
|
|
98
|
+
if (isVoiceAgent(agent)) {
|
|
99
|
+
// preparation
|
|
100
|
+
history = []
|
|
101
|
+
await withAbort(agent.onCallStart())
|
|
102
|
+
await withAbort(agent.waitForIdle())
|
|
103
|
+
|
|
104
|
+
// actual test
|
|
105
|
+
history = getMessages()
|
|
106
|
+
await withAbort(agent.streamResponse())
|
|
107
|
+
await withAbort(agent.waitForIdle())
|
|
108
|
+
} else {
|
|
109
|
+
history = getMessages()
|
|
110
|
+
await withAbort(agent.start())
|
|
111
|
+
await withAbort(agent.respondToMessage())
|
|
112
|
+
}
|
|
113
|
+
} catch (err) {
|
|
114
|
+
const error = err instanceof Error ? err : new Error(String(err))
|
|
115
|
+
try {
|
|
116
|
+
logger.error('Error in agent.respondToMessage():', error.message)
|
|
117
|
+
if (error.stack) logger.error(error.stack)
|
|
118
|
+
} catch {
|
|
119
|
+
/* noop */
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
process.env.IS_TEST = undefined
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function isVoiceAgent(agent: TestAgent): agent is TestVoiceAgent {
|
|
126
|
+
return 'streamResponse' in agent
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
function wrapAbort(abortSignal: AbortSignal | undefined) {
|
|
130
|
+
return async <T>(p: Promise<T>): Promise<T> => {
|
|
104
131
|
if (!abortSignal) return p
|
|
105
132
|
if (abortSignal.aborted) throw new Error('Operation cancelled')
|
|
106
133
|
return await new Promise<T>((resolve, reject) => {
|
|
@@ -127,41 +154,9 @@ export async function loadAgents(props: {
|
|
|
127
154
|
},
|
|
128
155
|
(e) => {
|
|
129
156
|
cleanup()
|
|
130
|
-
reject(e)
|
|
157
|
+
reject(e as Error)
|
|
131
158
|
}
|
|
132
159
|
)
|
|
133
160
|
})
|
|
134
161
|
}
|
|
135
|
-
|
|
136
|
-
try {
|
|
137
|
-
// Some project workflows (e.g. voice) persist required per-run state (like region) during `start()`.
|
|
138
|
-
await withAbort(
|
|
139
|
-
Promise.resolve().then(() => (isVoiceAgent(agent) ? agent.onCallStart() : agent.start()))
|
|
140
|
-
)
|
|
141
|
-
if (isVoiceAgent(agent)) {
|
|
142
|
-
await withAbort(agent.streamResponse())
|
|
143
|
-
} else {
|
|
144
|
-
await withAbort(agent.respondToMessage())
|
|
145
|
-
}
|
|
146
|
-
await withAbort(new Promise((resolve) => setTimeout(resolve, timeoutSeconds * 1000)))
|
|
147
|
-
} catch (err) {
|
|
148
|
-
const msg = err instanceof Error ? `${err.name}: ${err.message}` : String(err)
|
|
149
|
-
const stack = err instanceof Error ? err.stack : undefined
|
|
150
|
-
try {
|
|
151
|
-
logger.error('Error in agent.respondToMessage():', msg)
|
|
152
|
-
} catch {
|
|
153
|
-
/* noop */
|
|
154
|
-
}
|
|
155
|
-
if (stack) {
|
|
156
|
-
try {
|
|
157
|
-
logger.error(stack)
|
|
158
|
-
} catch {
|
|
159
|
-
/* noop */
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function isVoiceAgent(agent: TestAgent): agent is TestVoiceAgent {
|
|
166
|
-
return 'streamResponse' in agent
|
|
167
162
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var Wt=t=>{throw TypeError(t)};var Te=(t,e,n)=>e.has(t)||Wt("Cannot "+n);var v=(t,e,n)=>(Te(t,e,"read from private field"),n?n.call(t):e.get(t)),T=(t,e,n)=>e.has(t)?Wt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n);import{o as Yt,e as Pe}from"./CB3MYTwM.js";import{b as Ie,H as It,S as Ot,R as $t}from"./BUApaBEI.js";import{w as jt}from"./B394X4Dm.js";import{i as I,h as O,l as $,z as zt,w as Oe}from"./BRMnbBOX.js";new URL("sveltekit-internal://");function $e(t,e){return t==="/"||e==="ignore"?t:e==="never"?t.endsWith("/")?t.slice(0,-1):t:e==="always"&&!t.endsWith("/")?t+"/":t}function je(t){return t.split("%25").map(decodeURI).join("%25")}function Ce(t){for(const e in t)t[e]=decodeURIComponent(t[e]);return t}function Rt({href:t}){return t.split("#")[0]}function Ne(t,e,n,r=!1){const a=new URL(t);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(o,i){if(i==="get"||i==="getAll"||i==="has")return c=>(n(c),o[i](c));e();const l=Reflect.get(o,i);return typeof l=="function"?l.bind(o):l}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const o of s)Object.defineProperty(a,o,{get(){return e(),t[o]},enumerable:!0,configurable:!0});return a}function De(...t){let e=5381;for(const n of t)if(typeof n=="string"){let r=n.length;for(;r;)e=e*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)e=e*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(e>>>0).toString(36)}const qe=window.fetch;window.fetch=(t,e)=>((t instanceof Request?t.method:(e==null?void 0:e.method)||"GET")!=="GET"&&M.delete(Ct(t)),qe(t,e));const M=new Map;function Ve(t,e){const n=Ct(t,e),r=document.querySelector(n);if(r!=null&&r.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const o=r.getAttribute("data-ttl");return o&&M.set(n,{body:a,init:s,ttl:1e3*Number(o)}),r.getAttribute("data-b64")!==null&&(a=Ie(a)),Promise.resolve(new Response(a,s))}return window.fetch(t,e)}function Be(t,e,n){if(M.size>0){const r=Ct(t,n),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n==null?void 0:n.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(e,n)}function Ct(t,e){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(t instanceof Request?t.url:t)}]`;if(e!=null&&e.headers||e!=null&&e.body){const a=[];e.headers&&a.push([...new Headers(e.headers)].join(",")),e.body&&(typeof e.body=="string"||ArrayBuffer.isView(e.body))&&a.push(e.body),r+=`[data-hash="${De(...a)}"]`}return r}const Ke=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Fe(t){const e=[];return{pattern:t==="/"?/^\/$/:new RegExp(`^${He(t).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return e.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return e.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const o=r.split(/\[(.+?)\](?!\])/);return"/"+o.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return Et(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return Et(String.fromCharCode(...l.slice(2).split("-").map(f=>parseInt(f,16))));const g=Ke.exec(l),[,h,w,u,m]=g;return e.push({name:u,matcher:m,optional:!!h,rest:!!w,chained:w?c===1&&o[0]==="":!1}),w?"([^]*?)":h?"([^/]*)?":"([^/]+?)"}return Et(l)}).join("")}).join("")}/?$`),params:e}}function Ge(t){return t!==""&&!/^\([^)]+\)$/.test(t)}function He(t){return t.slice(1).split("/").filter(Ge)}function Me(t,e,n){const r={},a=t.slice(1),s=a.filter(i=>i!==void 0);let o=0;for(let i=0;i<e.length;i+=1){const l=e[i];let c=a[i-o];if(l.chained&&l.rest&&o&&(c=a.slice(i-o,i+1).filter(g=>g).join("/"),o=0),c===void 0){l.rest&&(r[l.name]="");continue}if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const g=e[i+1],h=a[i+1];g&&!g.rest&&g.optional&&h&&l.chained&&(o=0),!g&&!h&&Object.keys(r).length===s.length&&(o=0);continue}if(l.optional&&l.chained){o++;continue}return}if(!o)return r}function Et(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function We({nodes:t,server_loads:e,dictionary:n,matchers:r}){const a=new Set(e);return Object.entries(n).map(([i,[l,c,g]])=>{const{pattern:h,params:w}=Fe(i),u={id:i,exec:m=>{const f=h.exec(m);if(f)return Me(f,w,r)},errors:[1,...g||[]].map(m=>t[m]),layouts:[0,...c||[]].map(o),leaf:s(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function s(i){const l=i<0;return l&&(i=~i),[l,t[i]]}function o(i){return i===void 0?i:[a.has(i),t[i]]}}function ce(t,e=JSON.parse){try{return e(sessionStorage[t])}catch{}}function Jt(t,e,n=JSON.stringify){const r=n(e);try{sessionStorage[t]=r}catch{}}var re;const U=((re=globalThis.__sveltekit_1wsflj2)==null?void 0:re.base)??"";var oe;const Ye=((oe=globalThis.__sveltekit_1wsflj2)==null?void 0:oe.assets)??U??"",ze="1778572095187",fe="sveltekit:snapshot",ue="sveltekit:scroll",Nt="sveltekit:states",de="sveltekit:pageurl",V="sveltekit:history",G="sveltekit:navigation",D={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},wt=location.origin;function vt(t){if(t instanceof URL)return t;let e=document.baseURI;if(!e){const n=document.getElementsByTagName("base");e=n.length?n[0].href:document.URL}return new URL(t,e)}function yt(){return{x:pageXOffset,y:pageYOffset}}function K(t,e){return t.getAttribute(`data-sveltekit-${e}`)}const Xt={...D,"":D.hover};function he(t){let e=t.assignedSlot??t.parentNode;return(e==null?void 0:e.nodeType)===11&&(e=e.host),e}function pe(t,e){for(;t&&t!==e;){if(t.nodeName.toUpperCase()==="A"&&t.hasAttribute("href"))return t;t=he(t)}}function At(t,e,n){let r;try{if(r=new URL(t instanceof SVGAElement?t.href.baseVal:t.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const i=location.hash.split("#")[1]||"/";r.hash=`#${i}${r.hash}`}}catch{}const a=t instanceof SVGAElement?t.target.baseVal:t.target,s=!r||!!a||bt(r,e,n)||(t.getAttribute("rel")||"").split(/\s+/).includes("external"),o=(r==null?void 0:r.origin)===wt&&t.hasAttribute("download");return{url:r,external:s,target:a,download:o}}function ft(t){let e=null,n=null,r=null,a=null,s=null,o=null,i=t;for(;i&&i!==document.documentElement;)r===null&&(r=K(i,"preload-code")),a===null&&(a=K(i,"preload-data")),e===null&&(e=K(i,"keepfocus")),n===null&&(n=K(i,"noscroll")),s===null&&(s=K(i,"reload")),o===null&&(o=K(i,"replacestate")),i=he(i);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Xt[r??"off"],preload_data:Xt[a??"off"],keepfocus:l(e),noscroll:l(n),reload:l(s),replace_state:l(o)}}function Qt(t){const e=jt(t);let n=!0;function r(){n=!0,e.update(o=>o)}function a(o){n=!1,e.set(o)}function s(o){let i;return e.subscribe(l=>{(i===void 0||n&&l!==i)&&o(i=l)})}return{notify:r,set:a,subscribe:s}}const ge={v:()=>{}};function Je(){const{set:t,subscribe:e}=jt(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ye}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const o=(await a.json()).version!==ze;return o&&(t(!0),ge.v(),clearTimeout(n)),o}catch{return!1}}return{subscribe:e,check:r}}function bt(t,e,n){return t.origin!==wt||!t.pathname.startsWith(e)?!0:n?!(t.pathname===e+"/"||t.pathname===e+"/index.html"||t.protocol==="file:"&&t.pathname.replace(/\/[^/]+\.html?$/,"")===e):!1}function Un(t){}const me=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...me];const Xe=new Set([...me]);[...Xe];function Qe(t){return t.filter(e=>e!=null)}function Dt(t){return t instanceof It||t instanceof Ot?t.status:500}function Ze(t){return t instanceof Ot?t.text:"Internal Error"}let R,Y,xt;const tn=Yt.toString().includes("$$")||/function \w+\(\) \{\}/.test(Yt.toString());var Z,tt,et,nt,at,rt,ot,st,se,it,ie,lt,le;tn?(R={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},Y={current:null},xt={current:!1}):(R=new(se=class{constructor(){T(this,Z,I({}));T(this,tt,I(null));T(this,et,I(null));T(this,nt,I({}));T(this,at,I({id:null}));T(this,rt,I({}));T(this,ot,I(-1));T(this,st,I(new URL("https://example.com")))}get data(){return O(v(this,Z))}set data(e){$(v(this,Z),e)}get form(){return O(v(this,tt))}set form(e){$(v(this,tt),e)}get error(){return O(v(this,et))}set error(e){$(v(this,et),e)}get params(){return O(v(this,nt))}set params(e){$(v(this,nt),e)}get route(){return O(v(this,at))}set route(e){$(v(this,at),e)}get state(){return O(v(this,rt))}set state(e){$(v(this,rt),e)}get status(){return O(v(this,ot))}set status(e){$(v(this,ot),e)}get url(){return O(v(this,st))}set url(e){$(v(this,st),e)}},Z=new WeakMap,tt=new WeakMap,et=new WeakMap,nt=new WeakMap,at=new WeakMap,rt=new WeakMap,ot=new WeakMap,st=new WeakMap,se),Y=new(ie=class{constructor(){T(this,it,I(null))}get current(){return O(v(this,it))}set current(e){$(v(this,it),e)}},it=new WeakMap,ie),xt=new(le=class{constructor(){T(this,lt,I(!1))}get current(){return O(v(this,lt))}set current(e){$(v(this,lt),e)}},lt=new WeakMap,le),ge.v=()=>xt.current=!0);function en(t){Object.assign(R,t)}const Zt={spanContext(){return nn},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},nn={traceId:"",spanId:"",traceFlags:0},{tick:an}=Pe,rn=Oe??(t=>t()),on=new Set(["icon","shortcut icon","apple-touch-icon"]),B=ce(ue)??{},z=ce(fe)??{},N={url:Qt({}),page:Qt({}),navigating:jt(null),updated:Je()};function qt(t){B[t]=yt()}function sn(t,e){let n=t+1;for(;B[n];)delete B[n],n+=1;for(n=e+1;z[n];)delete z[n],n+=1}function J(t,e=!1){return e?location.replace(t.href):location.href=t.href,new Promise(()=>{})}async function _e(){if("serviceWorker"in navigator){const t=await navigator.serviceWorker.getRegistration(U||"/");t&&await t.update()}}function te(){}let Vt,Ut,ut,j,Tt,y;const dt=[],ht=[];let x=null;const ct=new Map,we=new Set,ln=new Set,W=new Set;let _={branch:[],error:null,url:null},ve=!1,pt=!1,ee=!0,X=!1,H=!1,ye=!1,Bt=!1,Kt,S,L,q;const gt=new Set,ne=new Map;async function On(t,e,n){var s,o,i,l,c;(s=globalThis.__sveltekit_1wsflj2)!=null&&s.data&&globalThis.__sveltekit_1wsflj2.data,document.URL!==location.href&&(location.href=location.href),y=t,await((i=(o=t.hooks).init)==null?void 0:i.call(o)),Vt=We(t),j=document.documentElement,Tt=e,Ut=t.nodes[0],ut=t.nodes[1],Ut(),ut(),S=(l=history.state)==null?void 0:l[V],L=(c=history.state)==null?void 0:c[G],S||(S=L=Date.now(),history.replaceState({...history.state,[V]:S,[G]:L},""));const r=B[S];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await yn(Tt,n)):(await F({type:"enter",url:vt(y.hash?Sn(new URL(location.href)):location.href),replace_state:!0}),a()),vn()}function cn(){dt.length=0,Bt=!1}function be(t){ht.some(e=>e==null?void 0:e.snapshot)&&(z[t]=ht.map(e=>{var n;return(n=e==null?void 0:e.snapshot)==null?void 0:n.capture()}))}function ke(t){var e;(e=z[t])==null||e.forEach((n,r)=>{var a,s;(s=(a=ht[r])==null?void 0:a.snapshot)==null||s.restore(n)})}function ae(){qt(S),Jt(ue,B),be(L),Jt(fe,z)}async function Se(t,e,n,r){let a;e.invalidateAll&&(x=null),await F({type:"goto",url:vt(t),keepfocus:e.keepFocus,noscroll:e.noScroll,replace_state:e.replaceState,state:e.state,redirect_count:n,nav_token:r,accept:()=>{e.invalidateAll&&(Bt=!0,a=[...ne.keys()]),e.invalidate&&e.invalidate.forEach(wn)}}),e.invalidateAll&&zt().then(zt).then(()=>{ne.forEach(({resource:s},o)=>{var i;a!=null&&a.includes(o)&&((i=s.refresh)==null||i.call(s))})})}async function fn(t){if(t.id!==(x==null?void 0:x.id)){const e={};gt.add(e),x={id:t.id,token:e,promise:xe({...t,preload:e}).then(n=>(gt.delete(e),n.type==="loaded"&&n.state.error&&(x=null),n))}}return x.promise}async function Lt(t){var n;const e=(n=await kt(t,!1))==null?void 0:n.route;e&&await Promise.all([...e.layouts,e.leaf].map(r=>r==null?void 0:r[1]()))}function Re(t,e,n){var a;_=t.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(R,t.props.page),Kt=new y.root({target:e,props:{...t.props,stores:N,components:ht},hydrate:n,sync:!1}),ke(L),n){const s={from:null,to:{params:_.params,route:{id:((a=_.route)==null?void 0:a.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};W.forEach(o=>o(s))}pt=!0}function mt({url:t,params:e,branch:n,status:r,error:a,route:s,form:o}){let i="never";if(U&&(t.pathname===U||t.pathname===U+"/"))i="always";else for(const u of n)(u==null?void 0:u.slash)!==void 0&&(i=u.slash);t.pathname=$e(t.pathname,i),t.search=t.search;const l={type:"loaded",state:{url:t,params:e,branch:n,error:a,route:s},props:{constructors:Qe(n).map(u=>u.node.component),page:St(R)}};o!==void 0&&(l.props.form=o);let c={},g=!R,h=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const m=n[u],f=_.branch[u];(m==null?void 0:m.data)!==(f==null?void 0:f.data)&&(g=!0),m&&(c={...c,...m.data},g&&(l.props[`data_${h}`]=c),h+=1)}return(!_.url||t.href!==_.url.href||_.error!==a||o!==void 0&&o!==R.form||g)&&(l.props.page={error:a,params:e,route:{id:(s==null?void 0:s.id)??null},state:{},status:r,url:new URL(t),form:o??null,data:g?c:R.data}),l}async function Ft({loader:t,parent:e,url:n,params:r,route:a,server_data_node:s}){var g,h,w;let o=null,i=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await t();if((g=c.universal)!=null&&g.load){let u=function(...f){for(const d of f){const{href:p}=new URL(d,n);l.dependencies.add(p)}};const m={tracing:{enabled:!1,root:Zt,current:Zt},route:new Proxy(a,{get:(f,d)=>(i&&(l.route=!0),f[d])}),params:new Proxy(r,{get:(f,d)=>(i&&l.params.add(d),f[d])}),data:(s==null?void 0:s.data)??null,url:Ne(n,()=>{i&&(l.url=!0)},f=>{i&&l.search_params.add(f)},y.hash),async fetch(f,d){f instanceof Request&&(d={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f==null?void 0:f.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...d});const{resolved:p,promise:b}=Ee(f,d,n);return i&&u(p.href),b},setHeaders:()=>{},depends:u,parent(){return i&&(l.parent=!0),e()},untrack(f){i=!1;try{return f()}finally{i=!0}}};o=await c.universal.load.call(null,m)??null}return{node:c,loader:t,server:s,universal:(h=c.universal)!=null&&h.load?{type:"data",data:o,uses:l}:null,data:o??(s==null?void 0:s.data)??null,slash:((w=c.universal)==null?void 0:w.trailingSlash)??(s==null?void 0:s.slash)}}function Ee(t,e,n){let r=t instanceof Request?t.url:t;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=pt?Be(r,a.href,e):Ve(r,e);return{resolved:a,promise:s}}function un(t,e,n,r,a,s){if(Bt)return!0;if(!a)return!1;if(a.parent&&t||a.route&&e||a.url&&n)return!0;for(const o of a.search_params)if(r.has(o))return!0;for(const o of a.params)if(s[o]!==_.params[o])return!0;for(const o of a.dependencies)if(dt.some(i=>i(new URL(o))))return!0;return!1}function Gt(t,e){return(t==null?void 0:t.type)==="data"?t:(t==null?void 0:t.type)==="skip"?e??null:null}function dn(t,e){if(!t)return new Set(e.searchParams.keys());const n=new Set([...t.searchParams.keys(),...e.searchParams.keys()]);for(const r of n){const a=t.searchParams.getAll(r),s=e.searchParams.getAll(r);a.every(o=>s.includes(o))&&s.every(o=>a.includes(o))&&n.delete(r)}return n}function hn({error:t,url:e,route:n,params:r}){return{type:"loaded",state:{error:t,url:e,route:n,params:r,branch:[]},props:{page:St(R),constructors:[]}}}async function xe({id:t,invalidating:e,url:n,params:r,route:a,preload:s}){if((x==null?void 0:x.id)===t)return gt.delete(x.token),x.promise;const{errors:o,layouts:i,leaf:l}=a,c=[...i,l];o.forEach(d=>d==null?void 0:d().catch(()=>{})),c.forEach(d=>d==null?void 0:d[1]().catch(()=>{}));const g=_.url?t!==_t(_.url):!1,h=_.route?a.id!==_.route.id:!1,w=dn(_.url,n);let u=!1;const m=c.map(async(d,p)=>{var C;if(!d)return;const b=_.branch[p];return d[1]===(b==null?void 0:b.loader)&&!un(u,h,g,w,(C=b.universal)==null?void 0:C.uses,r)?b:(u=!0,Ft({loader:d[1],url:n,params:r,route:a,parent:async()=>{var A;const k={};for(let P=0;P<p;P+=1)Object.assign(k,(A=await m[P])==null?void 0:A.data);return k},server_data_node:Gt(d[0]?{type:"skip"}:null,d[0]?b==null?void 0:b.server:void 0)}))});for(const d of m)d.catch(()=>{});const f=[];for(let d=0;d<c.length;d+=1)if(c[d])try{f.push(await m[d])}catch(p){if(p instanceof $t)return{type:"redirect",location:p.location};if(gt.has(s))return hn({error:await Q(p,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let b=Dt(p),E;if(p instanceof It)E=p.body;else{if(await N.updated.check())return await _e(),await J(n);E=await Q(p,{params:r,url:n,route:{id:a.id}})}const C=await pn(d,f,o);return C?mt({url:n,params:r,branch:f.slice(0,C.idx).concat(C.node),status:b,error:E,route:a}):await Ae(n,{id:a.id},E,b)}else f.push(void 0);return mt({url:n,params:r,branch:f,status:200,error:null,route:a,form:e?void 0:null})}async function pn(t,e,n){for(;t--;)if(n[t]){let r=t;for(;!e[r];)r-=1;try{return{idx:r+1,node:{node:await n[t](),loader:n[t],data:{},server:null,universal:null}}}catch{continue}}}async function Ht({status:t,error:e,url:n,route:r}){const a={};let s=null;try{const o=await Ft({loader:Ut,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Gt(s)}),i={node:await ut(),loader:ut,universal:null,server:null,data:null};return mt({url:n,params:a,branch:[o,i],status:t,error:e,route:null})}catch(o){if(o instanceof $t)return Se(new URL(o.location,location.href),{},0);throw o}}async function gn(t){const e=t.href;if(ct.has(e))return ct.get(e);let n;try{const r=(async()=>{let a=await y.hooks.reroute({url:new URL(t),fetch:async(s,o)=>Ee(s,o,t).promise})??t;if(typeof a=="string"){const s=new URL(t);y.hash?s.hash=a:s.pathname=a,a=s}return a})();ct.set(e,r),n=await r}catch{ct.delete(e);return}return n}async function kt(t,e){if(t&&!bt(t,U,y.hash)){const n=await gn(t);if(!n)return;const r=mn(n);for(const a of Vt){const s=a.exec(r);if(s)return{id:_t(t),invalidating:e,route:a,params:Ce(s),url:t}}}}function mn(t){return je(y.hash?t.hash.replace(/^#/,"").replace(/[?#].+/,""):t.pathname.slice(U.length))||"/"}function _t(t){return(y.hash?t.hash.replace(/^#/,""):t.pathname)+t.search}function Le({url:t,type:e,intent:n,delta:r,event:a}){let s=!1;const o=Mt(_,n,t,e);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const i={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||we.forEach(l=>l(i)),s?null:o}async function F({type:t,url:e,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o={},redirect_count:i=0,nav_token:l={},accept:c=te,block:g=te,event:h}){const w=q;q=l;const u=await kt(e,!1),m=t==="enter"?Mt(_,u,e,t):Le({url:e,type:t,delta:n==null?void 0:n.delta,intent:u,event:h});if(!m){g(),q===l&&(q=w);return}const f=S,d=L;c(),X=!0,pt&&m.navigation.type!=="enter"&&N.navigating.set(Y.current=m.navigation);let p=u&&await xe(u);if(!p){if(bt(e,U,y.hash))return await J(e,s);p=await Ae(e,{id:null},await Q(new Ot(404,"Not Found",`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404,s)}if(e=(u==null?void 0:u.url)||e,q!==l)return m.reject(new Error("navigation aborted")),!1;if(p.type==="redirect"){if(i<20){await F({type:t,url:new URL(p.location,e),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:o,redirect_count:i+1,nav_token:l}),m.fulfil(void 0);return}p=await Ht({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}})}else p.props.page.status>=400&&await N.updated.check()&&(await _e(),await J(e,s));if(cn(),qt(f),be(d),p.props.page.url.pathname!==e.pathname&&(e.pathname=p.props.page.url.pathname),o=n?n.state:o,!n){const k=s?0:1,A={[V]:S+=k,[G]:L+=k,[Nt]:o};(s?history.replaceState:history.pushState).call(history,A,"",e),s||sn(S,L)}if(x=null,p.props.page.state=o,pt){const k=(await Promise.all(Array.from(ln,A=>A(m.navigation)))).filter(A=>typeof A=="function");if(k.length>0){let A=function(){k.forEach(P=>{W.delete(P)})};k.push(A),k.forEach(P=>{W.add(P)})}_=p.state,p.props.page&&(p.props.page.url=e),Kt.$set(p.props),en(p.props.page),ye=!0}else Re(p,Tt,!1);const{activeElement:b}=document;await an();let E=n?n.scroll:a?yt():null;if(ee){const k=e.hash&&document.getElementById(Ue(e));if(E)scrollTo(E.x,E.y);else if(k){k.scrollIntoView();const{top:A,left:P}=k.getBoundingClientRect();E={x:pageXOffset+P,y:pageYOffset+A}}else scrollTo(0,0)}const C=document.activeElement!==b&&document.activeElement!==document.body;!r&&!C&&kn(e,E),ee=!0,p.props.page&&Object.assign(R,p.props.page),X=!1,t==="popstate"&&ke(L),m.fulfil(void 0),W.forEach(k=>k(m.navigation)),N.navigating.set(Y.current=null)}async function Ae(t,e,n,r,a){return t.origin===wt&&t.pathname===location.pathname&&!ve?await Ht({status:r,error:n,url:t,route:e}):await J(t,a)}function _n(){let t,e,n;j.addEventListener("mousemove",i=>{const l=i.target;clearTimeout(t),t=setTimeout(()=>{s(l,D.hover)},20)});function r(i){i.defaultPrevented||s(i.composedPath()[0],D.tap)}j.addEventListener("mousedown",r),j.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(i=>{for(const l of i)l.isIntersecting&&(Lt(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function s(i,l){const c=pe(i,j),g=c===e&&l>=n;if(!c||g)return;const{url:h,external:w,download:u}=At(c,U,y.hash);if(w||u)return;const m=ft(c),f=h&&_t(_.url)===_t(h);if(!(m.reload||f))if(l<=m.preload_data){e=c,n=D.tap;const d=await kt(h,!1);if(!d)return;fn(d)}else l<=m.preload_code&&(e=c,n=l,Lt(h))}function o(){a.disconnect();for(const i of j.querySelectorAll("a")){const{url:l,external:c,download:g}=At(i,U,y.hash);if(c||g)continue;const h=ft(i);h.reload||(h.preload_code===D.viewport&&a.observe(i),h.preload_code===D.eager&&Lt(l))}}W.add(o),o()}function Q(t,e){if(t instanceof It)return t.body;const n=Dt(t),r=Ze(t);return y.hooks.handleError({error:t,event:e,status:n,message:r})??{message:r}}function $n(t,e={}){return t=new URL(vt(t)),t.origin!==wt?Promise.reject(new Error("goto: invalid URL")):Se(t,e,0)}function wn(t){if(typeof t=="function")dt.push(t);else{const{href:e}=new URL(t,location.href);dt.push(n=>n.href===e)}}function jn(t,e){const n={[V]:S,[G]:L,[de]:R.url.href,[Nt]:e};history.replaceState(n,"",vt(t)),R.state=e,Kt.$set({page:rn(()=>St(R))})}function vn(){var e;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let r=!1;if(ae(),!X){const a=Mt(_,void 0,null,"leave"),s={...a.navigation,cancel:()=>{r=!0,a.reject(new Error("navigation cancelled"))}};we.forEach(o=>o(s))}r?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&ae()}),(e=navigator.connection)!=null&&e.saveData||_n(),j.addEventListener("click",async n=>{if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const r=pe(n.composedPath()[0],j);if(!r)return;const{url:a,external:s,target:o,download:i}=At(r,U,y.hash);if(!a)return;if(o==="_parent"||o==="_top"){if(window.parent!==window)return}else if(o&&o!=="_self")return;const l=ft(r);if(!(r instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||i)return;const[g,h]=(y.hash?a.hash.replace(/^#/,""):a.href).split("#"),w=g===Rt(location);if(s||l.reload&&(!w||!h)){Le({url:a,type:"link",event:n})?X=!0:n.preventDefault();return}if(h!==void 0&&w){const[,u]=_.url.href.split("#");if(u===h){if(n.preventDefault(),h===""||h==="top"&&r.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const m=r.ownerDocument.getElementById(decodeURIComponent(h));m&&(m.scrollIntoView(),m.focus())}return}if(H=!0,qt(S),t(a),!l.replace_state)return;H=!1}n.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await F({type:"link",url:a,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??a.href===location.href,event:n})}),j.addEventListener("submit",n=>{if(n.defaultPrevented)return;const r=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formTarget)||r.target)==="_blank"||((a==null?void 0:a.formMethod)||r.method)!=="get")return;const i=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||r.action);if(bt(i,U,!1))return;const l=n.target,c=ft(l);if(c.reload)return;n.preventDefault(),n.stopPropagation();const g=new FormData(l,a);i.search=new URLSearchParams(g).toString(),F({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:n})}),addEventListener("popstate",async n=>{var r;if(!Pt){if((r=n.state)!=null&&r[V]){const a=n.state[V];if(q={},a===S)return;const s=B[a],o=n.state[Nt]??{},i=new URL(n.state[de]??location.href),l=n.state[G],c=_.url?Rt(location)===Rt(_.url):!1;if(l===L&&(ye||c)){o!==R.state&&(R.state=o),t(i),B[S]=yt(),s&&scrollTo(s.x,s.y),S=a;return}const h=a-S;await F({type:"popstate",url:i,popped:{state:o,scroll:s,delta:h},accept:()=>{S=a,L=l},block:()=>{history.go(-h)},nav_token:q,event:n})}else if(!H){const a=new URL(location.href);t(a),y.hash&&location.reload()}}}),addEventListener("hashchange",()=>{H&&(H=!1,history.replaceState({...history.state,[V]:++S,[G]:L},"",location.href))});for(const n of document.querySelectorAll("link"))on.has(n.rel)&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&N.navigating.set(Y.current=null)});function t(n){_.url=R.url=n,N.page.set(St(R)),N.page.notify()}}async function yn(t,{status:e=200,error:n,node_ids:r,params:a,route:s,server_route:o,data:i,form:l}){ve=!0;const c=new URL(location.href);let g;({params:a={},route:s={id:null}}=await kt(c,!1)||{}),g=Vt.find(({id:u})=>u===s.id);let h,w=!0;try{const u=r.map(async(f,d)=>{const p=i[d];return p!=null&&p.uses&&(p.uses=bn(p.uses)),Ft({loader:y.nodes[f],url:c,params:a,route:s,parent:async()=>{const b={};for(let E=0;E<d;E+=1)Object.assign(b,(await u[E]).data);return b},server_data_node:Gt(p)})}),m=await Promise.all(u);if(g){const f=g.layouts;for(let d=0;d<f.length;d++)f[d]||m.splice(d,0,void 0)}h=mt({url:c,params:a,branch:m,status:e,error:n,form:l,route:g??null})}catch(u){if(u instanceof $t){await J(new URL(u.location,location.href));return}h=await Ht({status:Dt(u),error:await Q(u,{url:c,params:a,route:s}),url:c,route:s}),t.textContent="",w=!1}h.props.page&&(h.props.page.state={}),Re(h,t,w)}function bn(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url),search_params:new Set((t==null?void 0:t.search_params)??[])}}let Pt=!1;function kn(t,e=null){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=Ue(t);if(r&&document.getElementById(r)){const{x:s,y:o}=e??yt();setTimeout(()=>{const i=history.state;Pt=!0,location.replace(`#${r}`),y.hash&&location.replace(t.hash),history.replaceState(i,"",t.hash),scrollTo(s,o),Pt=!1})}else{const s=document.body,o=s.getAttribute("tabindex");s.tabIndex=-1,s.focus({preventScroll:!0,focusVisible:!1}),o!==null?s.setAttribute("tabindex",o):s.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const s=[];for(let o=0;o<a.rangeCount;o+=1)s.push(a.getRangeAt(o));setTimeout(()=>{if(a.rangeCount===s.length){for(let o=0;o<a.rangeCount;o+=1){const i=s[o],l=a.getRangeAt(o);if(i.commonAncestorContainer!==l.commonAncestorContainer||i.startContainer!==l.startContainer||i.endContainer!==l.endContainer||i.startOffset!==l.startOffset||i.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Mt(t,e,n,r){var l,c;let a,s;const o=new Promise((g,h)=>{a=g,s=h});return o.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((l=t.route)==null?void 0:l.id)??null},url:t.url},to:n&&{params:(e==null?void 0:e.params)??null,route:{id:((c=e==null?void 0:e.route)==null?void 0:c.id)??null},url:n},willUnload:!e,type:r,complete:o},fulfil:a,reject:s}}function St(t){return{data:t.data,error:t.error,form:t.form,params:t.params,route:t.route,state:t.state,status:t.status,url:t.url}}function Sn(t){const e=new URL(t);return e.hash=decodeURIComponent(t.hash),e}function Ue(t){let e;if(y.hash){const[,,n]=t.hash.split("#",3);e=n??""}else e=t.hash.slice(1);return decodeURIComponent(e)}export{On as a,$n as g,Un as l,R as p,jn as r,N as s};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{l as o,a as r}from"../chunks/yPd1epTY.js";export{o as load_css,r as start};
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|