lula2 0.3.5-nightly.4 → 0.4.0-nightly.0

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.
@@ -184,7 +184,7 @@ var init_fileStore = __esm({
184
184
  if (!parsed.id) {
185
185
  try {
186
186
  parsed.id = getControlId(parsed, this.baseDir);
187
- } catch (error) {
187
+ } catch {
188
188
  parsed.id = controlId;
189
189
  }
190
190
  }
@@ -211,7 +211,7 @@ var init_fileStore = __esm({
211
211
  if (!parsed.id) {
212
212
  try {
213
213
  parsed.id = getControlId(parsed, this.baseDir);
214
- } catch (error) {
214
+ } catch {
215
215
  parsed.id = controlId;
216
216
  }
217
217
  }
@@ -429,14 +429,16 @@ var init_fileStore = __esm({
429
429
  /**
430
430
  * Delete a single mapping
431
431
  */
432
- async deleteMapping(uuid) {
432
+ async deleteMapping(compositeKey) {
433
433
  const mappingFiles = this.getAllMappingFiles();
434
434
  for (const file of mappingFiles) {
435
435
  try {
436
436
  const content = readFileSync2(file, "utf8");
437
437
  let mappings = yaml2.load(content) || [];
438
438
  const originalLength = mappings.length;
439
- mappings = mappings.filter((m) => m.uuid !== uuid);
439
+ mappings = mappings.filter((m) => {
440
+ return `${m.control_id}:${m.uuid}` !== compositeKey;
441
+ });
440
442
  if (mappings.length < originalLength) {
441
443
  if (mappings.length === 0) {
442
444
  unlinkSync(file);
@@ -1238,7 +1240,8 @@ async function loadAllData() {
1238
1240
  debug(`Loaded ${controls.length} controls from individual files`);
1239
1241
  const mappings = await state.fileStore.loadMappings();
1240
1242
  for (const mapping of mappings) {
1241
- state.mappingsCache.set(mapping.uuid, mapping);
1243
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
1244
+ state.mappingsCache.set(compositeKey, mapping);
1242
1245
  addMappingToIndexes(mapping);
1243
1246
  }
1244
1247
  debug(`Loaded ${mappings.length} mappings`);
@@ -2143,7 +2146,8 @@ var WebSocketManager = class {
2143
2146
  mapping.uuid = crypto2.randomUUID();
2144
2147
  }
2145
2148
  await state.fileStore.saveMapping(mapping);
2146
- state.mappingsCache.set(mapping.uuid, mapping);
2149
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
2150
+ state.mappingsCache.set(compositeKey, mapping);
2147
2151
  const family = mapping.control_id.split("-")[0];
2148
2152
  if (!state.mappingsByFamily.has(family)) {
2149
2153
  state.mappingsByFamily.set(family, /* @__PURE__ */ new Set());
@@ -2168,7 +2172,8 @@ var WebSocketManager = class {
2168
2172
  if (payload && payload.uuid) {
2169
2173
  const mapping = payload;
2170
2174
  await state.fileStore.saveMapping(mapping);
2171
- state.mappingsCache.set(mapping.uuid, mapping);
2175
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
2176
+ state.mappingsCache.set(compositeKey, mapping);
2172
2177
  ws.send(
2173
2178
  JSON.stringify({
2174
2179
  type: "mapping-updated",
package/dist/index.html CHANGED
@@ -6,10 +6,10 @@
6
6
  <link rel="icon" href="/lula.png" />
7
7
  <meta name="viewport" content="width=device-width, initial-scale=1" />
8
8
 
9
- <link rel="modulepreload" href="/_app/immutable/entry/start.CNJ8UExp.js">
10
- <link rel="modulepreload" href="/_app/immutable/chunks/DUYNrdfy.js">
9
+ <link rel="modulepreload" href="/_app/immutable/entry/start.sVNR7Hbg.js">
10
+ <link rel="modulepreload" href="/_app/immutable/chunks/xZlTocHV.js">
11
11
  <link rel="modulepreload" href="/_app/immutable/chunks/B8sFn9qB.js">
12
- <link rel="modulepreload" href="/_app/immutable/entry/app.CmauYmwF.js">
12
+ <link rel="modulepreload" href="/_app/immutable/entry/app.DG0UbF3Y.js">
13
13
  <link rel="modulepreload" href="/_app/immutable/chunks/DsnmJJEf.js">
14
14
  <link rel="modulepreload" href="/_app/immutable/chunks/AMsv4DTs.js">
15
15
  <link rel="modulepreload" href="/_app/immutable/chunks/DL7cUWpq.js">
@@ -19,15 +19,15 @@
19
19
  <div style="display: contents">
20
20
  <script>
21
21
  {
22
- __sveltekit_zzc82m = {
22
+ __sveltekit_wgx1o2 = {
23
23
  base: ""
24
24
  };
25
25
 
26
26
  const element = document.currentScript.parentElement;
27
27
 
28
28
  Promise.all([
29
- import("/_app/immutable/entry/start.CNJ8UExp.js"),
30
- import("/_app/immutable/entry/app.CmauYmwF.js")
29
+ import("/_app/immutable/entry/start.sVNR7Hbg.js"),
30
+ import("/_app/immutable/entry/app.DG0UbF3Y.js")
31
31
  ]).then(([kit, app]) => {
32
32
  kit.start(app, element);
33
33
  });
package/dist/index.js CHANGED
@@ -1756,7 +1756,7 @@ var init_fileStore = __esm({
1756
1756
  if (!parsed.id) {
1757
1757
  try {
1758
1758
  parsed.id = getControlId(parsed, this.baseDir);
1759
- } catch (error) {
1759
+ } catch {
1760
1760
  parsed.id = controlId;
1761
1761
  }
1762
1762
  }
@@ -1783,7 +1783,7 @@ var init_fileStore = __esm({
1783
1783
  if (!parsed.id) {
1784
1784
  try {
1785
1785
  parsed.id = getControlId(parsed, this.baseDir);
1786
- } catch (error) {
1786
+ } catch {
1787
1787
  parsed.id = controlId;
1788
1788
  }
1789
1789
  }
@@ -2001,14 +2001,16 @@ var init_fileStore = __esm({
2001
2001
  /**
2002
2002
  * Delete a single mapping
2003
2003
  */
2004
- async deleteMapping(uuid) {
2004
+ async deleteMapping(compositeKey) {
2005
2005
  const mappingFiles = this.getAllMappingFiles();
2006
2006
  for (const file of mappingFiles) {
2007
2007
  try {
2008
2008
  const content = readFileSync2(file, "utf8");
2009
2009
  let mappings = yaml2.load(content) || [];
2010
2010
  const originalLength = mappings.length;
2011
- mappings = mappings.filter((m) => m.uuid !== uuid);
2011
+ mappings = mappings.filter((m) => {
2012
+ return `${m.control_id}:${m.uuid}` !== compositeKey;
2013
+ });
2012
2014
  if (mappings.length < originalLength) {
2013
2015
  if (mappings.length === 0) {
2014
2016
  unlinkSync(file);
@@ -2810,7 +2812,8 @@ async function loadAllData() {
2810
2812
  debug(`Loaded ${controls.length} controls from individual files`);
2811
2813
  const mappings = await state.fileStore.loadMappings();
2812
2814
  for (const mapping of mappings) {
2813
- state.mappingsCache.set(mapping.uuid, mapping);
2815
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
2816
+ state.mappingsCache.set(compositeKey, mapping);
2814
2817
  addMappingToIndexes(mapping);
2815
2818
  }
2816
2819
  debug(`Loaded ${mappings.length} mappings`);
@@ -4590,7 +4593,8 @@ var WebSocketManager = class {
4590
4593
  mapping.uuid = crypto2.randomUUID();
4591
4594
  }
4592
4595
  await state.fileStore.saveMapping(mapping);
4593
- state.mappingsCache.set(mapping.uuid, mapping);
4596
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4597
+ state.mappingsCache.set(compositeKey, mapping);
4594
4598
  const family = mapping.control_id.split("-")[0];
4595
4599
  if (!state.mappingsByFamily.has(family)) {
4596
4600
  state.mappingsByFamily.set(family, /* @__PURE__ */ new Set());
@@ -4615,7 +4619,8 @@ var WebSocketManager = class {
4615
4619
  if (payload && payload.uuid) {
4616
4620
  const mapping = payload;
4617
4621
  await state.fileStore.saveMapping(mapping);
4618
- state.mappingsCache.set(mapping.uuid, mapping);
4622
+ const compositeKey = `${mapping.control_id}:${mapping.uuid}`;
4623
+ state.mappingsCache.set(compositeKey, mapping);
4619
4624
  ws.send(
4620
4625
  JSON.stringify({
4621
4626
  type: "mapping-updated",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lula2",
3
- "version": "0.3.5-nightly.4",
3
+ "version": "0.4.0-nightly.0",
4
4
  "description": "A tool for managing compliance as code in your GitHub repositories.",
5
5
  "bin": {
6
6
  "lula2": "./dist/lula2"
@@ -221,10 +221,10 @@
221
221
  >
222
222
  <div class="flex justify-between items-start mb-2">
223
223
  <span class="text-sm font-medium text-gray-900 dark:text-white"
224
- >@lula {mapping.uuid}</span
224
+ >{mapping.uuid}</span
225
225
  >
226
226
  <button
227
- onclick={() => navigator.clipboard.writeText(`@lula ${mapping.uuid}`)}
227
+ onclick={() => navigator.clipboard.writeText(`${mapping.uuid}`)}
228
228
  class="text-xs text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300"
229
229
  >
230
230
  Copy UUID
@@ -15,7 +15,7 @@
15
15
  let { mapping, onEdit, onDelete, showActions = false }: Props = $props();
16
16
 
17
17
  function handleCopyUuid() {
18
- navigator.clipboard.writeText(`@lula ${mapping.uuid}`);
18
+ navigator.clipboard.writeText(`${mapping.uuid}`);
19
19
  }
20
20
 
21
21
  function handleEdit() {
@@ -7,6 +7,7 @@
7
7
  import FormField from '../forms/FormField.svelte';
8
8
 
9
9
  interface MappingFormData {
10
+ uuid: string;
10
11
  justification: string;
11
12
  status: 'planned' | 'implemented' | 'verified';
12
13
  source_entries: SourceEntry[];
@@ -29,6 +30,7 @@
29
30
  }: Props = $props();
30
31
 
31
32
  let formData = $state<MappingFormData>({
33
+ uuid: initialData.uuid || '',
32
34
  justification: initialData.justification || '',
33
35
  status: initialData.status || 'planned',
34
36
  source_entries: initialData.source_entries || []
@@ -49,6 +51,7 @@
49
51
  function handleCancel() {
50
52
  // Reset form
51
53
  formData = {
54
+ uuid: initialData.uuid || '',
52
55
  justification: initialData.justification || '',
53
56
  status: initialData.status || 'planned',
54
57
  source_entries: initialData.source_entries || []
@@ -81,6 +84,14 @@
81
84
  <div class="space-y-8">
82
85
  <!-- Main form fields -->
83
86
  <div class="grid grid-cols-1 gap-8">
87
+ <FormField
88
+ id="mapping-uuid"
89
+ label="UUID"
90
+ type="text"
91
+ bind:value={formData.uuid}
92
+ placeholder="Enter mapping UUID (leave empty to auto-generate)"
93
+ />
94
+
84
95
  <FormField
85
96
  id="mapping-justification"
86
97
  label="Justification"
@@ -21,6 +21,7 @@
21
21
 
22
22
  // Form state
23
23
  let newMappingData = $state({
24
+ uuid: '',
24
25
  justification: '',
25
26
  status: 'planned' as 'planned' | 'implemented' | 'verified',
26
27
  source_entries: [] as { location: string; shasum?: string }[]
@@ -34,7 +35,7 @@
34
35
  justification: data.justification,
35
36
  status: data.status,
36
37
  source_entries: data.source_entries,
37
- uuid: '' // Will be generated by backend
38
+ uuid: data.uuid || '' // Use the UUID from form or empty for auto-generation
38
39
  };
39
40
 
40
41
  await wsClient.createMapping(mappingData);
@@ -50,6 +51,7 @@
50
51
 
51
52
  function resetMappingForm() {
52
53
  newMappingData = {
54
+ uuid: '',
53
55
  justification: '',
54
56
  status: 'planned',
55
57
  source_entries: []
@@ -62,6 +64,7 @@
62
64
  editingMapping = { ...mapping };
63
65
  showNewMappingForm = true;
64
66
  newMappingData = {
67
+ uuid: mapping.uuid,
65
68
  justification: mapping.justification,
66
69
  status: mapping.status,
67
70
  source_entries: mapping.source_entries || []
@@ -74,12 +77,22 @@
74
77
  try {
75
78
  const updatedMapping = {
76
79
  ...editingMapping,
80
+ uuid: data.uuid || editingMapping.uuid, // Use form UUID or fallback to original
77
81
  justification: data.justification,
78
82
  status: data.status,
79
83
  source_entries: data.source_entries
80
84
  };
81
85
 
82
- await wsClient.updateMapping(updatedMapping);
86
+ const uuidChanged = updatedMapping.uuid !== editingMapping.uuid;
87
+
88
+ if (uuidChanged) {
89
+ const compositeId = `${control.id}:${editingMapping.uuid}`;
90
+ await wsClient.deleteMapping(compositeId);
91
+ await wsClient.createMapping(updatedMapping);
92
+ } else {
93
+ await wsClient.updateMapping(updatedMapping);
94
+ }
95
+
83
96
  resetMappingForm();
84
97
  } catch (error) {
85
98
  console.error('Failed to update mapping:', error);
@@ -88,7 +101,8 @@
88
101
 
89
102
  async function handleDeleteMapping(uuid: string) {
90
103
  try {
91
- await wsClient.deleteMapping(uuid);
104
+ const compositeId = `${control.id}:${uuid}`;
105
+ await wsClient.deleteMapping(compositeId);
92
106
  } catch (error) {
93
107
  console.error('Failed to delete mapping:', error);
94
108
  }
@@ -1,3 +0,0 @@
1
- import{b2 as Ee,o as $e,g as U,h as L,d as P,bi as yt,ai as De}from"./B8sFn9qB.js";class le{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Se{constructor(t,n){this.status=t,this.location=n}}class Re extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function wt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function vt(e){return e.split("%25").map(decodeURI).join("%25")}function bt(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function me({href:e}){return e.split("#")[0]}function kt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(i,o){if(o==="get"||o==="getAll"||o==="has")return f=>(n(f),i[o](f));t();const c=Reflect.get(i,o);return typeof c=="function"?c.bind(i):c}}),enumerable:!0,configurable:!0});const s=["href","pathname","search","toString","toJSON"];r&&s.push("hash");for(const i of s)Object.defineProperty(a,i,{get(){return t(),e[i]},enumerable:!0,configurable:!0});return a}function At(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*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;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;const Et=new TextDecoder;function St(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const Rt=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&G.delete(Te(e)),Rt(e,t));const G=new Map;function Tt(e,t){const n=Te(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...s}=JSON.parse(r.textContent);const i=r.getAttribute("data-ttl");return i&&G.set(n,{body:a,init:s,ttl:1e3*Number(i)}),r.getAttribute("data-b64")!==null&&(a=St(a)),Promise.resolve(new Response(a,s))}return window.fetch(e,t)}function It(e,t,n){if(G.size>0){const r=Te(e,n),a=G.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);G.delete(r)}}return window.fetch(t,n)}function Te(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${At(...a)}"]`}return r}const Ut=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function Lt(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${xt(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const s=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(s)return t.push({name:s[1],matcher:s[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const i=r.split(/\[(.+?)\](?!\])/);return"/"+i.map((c,f)=>{if(f%2){if(c.startsWith("x+"))return _e(String.fromCharCode(parseInt(c.slice(2),16)));if(c.startsWith("u+"))return _e(String.fromCharCode(...c.slice(2).split("-").map(w=>parseInt(w,16))));const d=Ut.exec(c),[,p,u,l,h]=d;return t.push({name:l,matcher:h,optional:!!p,rest:!!u,chained:u?f===1&&i[0]==="":!1}),u?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return _e(c)}).join("")}).join("")}/?$`),params:t}}function Pt(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function xt(e){return e.slice(1).split("/").filter(Pt)}function Ct(e,t,n){const r={},a=e.slice(1),s=a.filter(o=>o!==void 0);let i=0;for(let o=0;o<t.length;o+=1){const c=t[o];let f=a[o-i];if(c.chained&&c.rest&&i&&(f=a.slice(o-i,o+1).filter(d=>d).join("/"),i=0),f===void 0){c.rest&&(r[c.name]="");continue}if(!c.matcher||n[c.matcher](f)){r[c.name]=f;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&c.chained&&(i=0),!d&&!p&&Object.keys(r).length===s.length&&(i=0);continue}if(c.optional&&c.chained){i++;continue}return}if(!i)return r}function _e(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function Nt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[c,f,d]])=>{const{pattern:p,params:u}=Lt(o),l={id:o,exec:h=>{const w=p.exec(h);if(w)return Ct(w,u,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...f||[]].map(i),leaf:s(c)};return l.errors.length=l.layouts.length=Math.max(l.errors.length,l.layouts.length),l});function s(o){const c=o<0;return c&&(o=~o),[c,e[o]]}function i(o){return o===void 0?o:[a.has(o),e[o]]}}function We(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function Fe(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const I=globalThis.__sveltekit_zzc82m?.base??"",Ot=globalThis.__sveltekit_zzc82m?.assets??I,jt="1758673933685",Je="sveltekit:snapshot",Xe="sveltekit:scroll",Ze="sveltekit:states",$t="sveltekit:pageurl",B="sveltekit:history",Y="sveltekit:navigation",j={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},Z=location.origin;function Ie(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function fe(){return{x:pageXOffset,y:pageYOffset}}function F(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const Be={...j,"":j.hover};function Qe(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function et(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=Qe(e)}}function ve(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,s=!r||!!a||ue(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),i=r?.origin===Z&&e.hasAttribute("download");return{url:r,external:s,target:a,download:i}}function te(e){let t=null,n=null,r=null,a=null,s=null,i=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=F(o,"preload-code")),a===null&&(a=F(o,"preload-data")),t===null&&(t=F(o,"keepfocus")),n===null&&(n=F(o,"noscroll")),s===null&&(s=F(o,"reload")),i===null&&(i=F(o,"replacestate")),o=Qe(o);function c(f){switch(f){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:Be[r??"off"],preload_data:Be[a??"off"],keepfocus:c(t),noscroll:c(n),reload:c(s),replace_state:c(i)}}function Ve(e){const t=Ee(e);let n=!0;function r(){n=!0,t.update(i=>i)}function a(i){n=!1,t.set(i)}function s(i){let o;return t.subscribe(c=>{(o===void 0||n&&c!==o)&&i(o=c)})}return{notify:r,set:a,subscribe:s}}const tt={v:()=>{}};function Dt(){const{set:e,subscribe:t}=Ee(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Ot}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const i=(await a.json()).version!==jt;return i&&(e(!0),tt.v(),clearTimeout(n)),i}catch{return!1}}return{subscribe:t,check:r}}function ue(e,t,n){return e.origin!==Z||!e.pathname.startsWith(t)?!0:n?!(e.pathname===t+"/"||e.pathname===t+"/index.html"||e.protocol==="file:"&&e.pathname.replace(/\/[^/]+\.html?$/,"")===t):!1}function En(e){}function Ft(e){const t=Vt(e),n=new ArrayBuffer(t.length),r=new DataView(n);for(let a=0;a<n.byteLength;a++)r.setUint8(a,t.charCodeAt(a));return n}const Bt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function Vt(e){e.length%4===0&&(e=e.replace(/==?$/,""));let t="",n=0,r=0;for(let a=0;a<e.length;a++)n<<=6,n|=Bt.indexOf(e[a]),r+=6,r===24&&(t+=String.fromCharCode((n&16711680)>>16),t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255),n=r=0);return r===12?(n>>=4,t+=String.fromCharCode(n)):r===18&&(n>>=2,t+=String.fromCharCode((n&65280)>>8),t+=String.fromCharCode(n&255)),t}const Mt=-1,qt=-2,zt=-3,Gt=-4,Ht=-5,Kt=-6;function Yt(e,t){if(typeof e=="number")return a(e,!0);if(!Array.isArray(e)||e.length===0)throw new Error("Invalid input");const n=e,r=Array(n.length);function a(s,i=!1){if(s===Mt)return;if(s===zt)return NaN;if(s===Gt)return 1/0;if(s===Ht)return-1/0;if(s===Kt)return-0;if(i||typeof s!="number")throw new Error("Invalid input");if(s in r)return r[s];const o=n[s];if(!o||typeof o!="object")r[s]=o;else if(Array.isArray(o))if(typeof o[0]=="string"){const c=o[0],f=t?.[c];if(f)return r[s]=f(a(o[1]));switch(c){case"Date":r[s]=new Date(o[1]);break;case"Set":const d=new Set;r[s]=d;for(let l=1;l<o.length;l+=1)d.add(a(o[l]));break;case"Map":const p=new Map;r[s]=p;for(let l=1;l<o.length;l+=2)p.set(a(o[l]),a(o[l+1]));break;case"RegExp":r[s]=new RegExp(o[1],o[2]);break;case"Object":r[s]=Object(o[1]);break;case"BigInt":r[s]=BigInt(o[1]);break;case"null":const u=Object.create(null);r[s]=u;for(let l=1;l<o.length;l+=2)u[o[l]]=a(o[l+1]);break;case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":{const l=globalThis[c],h=new l(a(o[1]));r[s]=o[2]!==void 0?h.subarray(o[2],o[3]):h;break}case"ArrayBuffer":{const l=o[1],h=Ft(l);r[s]=h;break}case"Temporal.Duration":case"Temporal.Instant":case"Temporal.PlainDate":case"Temporal.PlainTime":case"Temporal.PlainDateTime":case"Temporal.PlainMonthDay":case"Temporal.PlainYearMonth":case"Temporal.ZonedDateTime":{const l=c.slice(9);r[s]=Temporal[l].from(o[1]);break}case"URL":{const l=new URL(o[1]);r[s]=l;break}case"URLSearchParams":{const l=new URLSearchParams(o[1]);r[s]=l;break}default:throw new Error(`Unknown type ${c}`)}}else{const c=new Array(o.length);r[s]=c;for(let f=0;f<o.length;f+=1){const d=o[f];d!==qt&&(c[f]=a(d))}}else{const c={};r[s]=c;for(const f in o){if(f==="__proto__")throw new Error("Cannot parse an object with a `__proto__` property");const d=o[f];c[f]=a(d)}}return r[s]}return a(0)}const nt=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...nt];const Wt=new Set([...nt]);[...Wt];function Jt(e){return e.filter(t=>t!=null)}const Xt="x-sveltekit-invalidated",Zt="x-sveltekit-trailing-slash";function ne(e){return e instanceof le||e instanceof Re?e.status:500}function Qt(e){return e instanceof Re?e.text:"Internal Error"}let S,W,ye;const en=$e.toString().includes("$$")||/function \w+\(\) \{\}/.test($e.toString());en?(S={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ye={current:!1}):(S=new class{#e=U({});get data(){return L(this.#e)}set data(t){P(this.#e,t)}#t=U(null);get form(){return L(this.#t)}set form(t){P(this.#t,t)}#n=U(null);get error(){return L(this.#n)}set error(t){P(this.#n,t)}#r=U({});get params(){return L(this.#r)}set params(t){P(this.#r,t)}#a=U({id:null});get route(){return L(this.#a)}set route(t){P(this.#a,t)}#o=U({});get state(){return L(this.#o)}set state(t){P(this.#o,t)}#s=U(-1);get status(){return L(this.#s)}set status(t){P(this.#s,t)}#i=U(new URL("https://example.com"));get url(){return L(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=U(null);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=U(!1);get current(){return L(this.#e)}set current(t){P(this.#e,t)}},tt.v=()=>ye.current=!0);function tn(e){Object.assign(S,e)}const nn="/__data.json",rn=".html__data.json";function an(e){return e.endsWith(".html")?e.replace(/\.html$/,rn):e.replace(/\/$/,"")+nn}const Me={spanContext(){return on},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}},on={traceId:"",spanId:"",traceFlags:0},{tick:sn}=yt,cn=new Set(["icon","shortcut icon","apple-touch-icon"]),D=We(Xe)??{},J=We(Je)??{},O={url:Ve({}),page:Ve({}),navigating:Ee(null),updated:Dt()};function Ue(e){D[e]=fe()}function ln(e,t){let n=e+1;for(;D[n];)delete D[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function q(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function rt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(I||"/");e&&await e.update()}}function qe(){}let Le,be,re,x,ke,v;const ae=[],oe=[];let C=null;const ee=new Map,at=new Set,fn=new Set,H=new Set;let y={branch:[],error:null,url:null},Pe=!1,se=!1,ze=!0,X=!1,z=!1,ot=!1,xe=!1,st,E,T,$;const K=new Set,Ge=new Map;async function In(e,t,n){globalThis.__sveltekit_zzc82m.data&&globalThis.__sveltekit_zzc82m?.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Le=Nt(e),x=document.documentElement,ke=t,be=e.nodes[0],re=e.nodes[1],be(),re(),E=history.state?.[B],T=history.state?.[Y],E||(E=T=Date.now(),history.replaceState({...history.state,[B]:E,[Y]:T},""));const r=D[E];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await vn(ke,n)):(await V({type:"enter",url:Ie(v.hash?kn(new URL(location.href)):location.href),replace_state:!0}),a()),wn()}function un(){ae.length=0,xe=!1}function it(e){oe.some(t=>t?.snapshot)&&(J[e]=oe.map(t=>t?.snapshot?.capture()))}function ct(e){J[e]?.forEach((t,n)=>{oe[n]?.snapshot?.restore(t)})}function He(){Ue(E),Fe(Xe,D),it(T),Fe(Je,J)}async function lt(e,t,n,r){let a;t.invalidateAll&&(C=null),await V({type:"goto",url:Ie(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(xe=!0,a=[...Ge.keys()]),t.invalidate&&t.invalidate.forEach(yn)}}),t.invalidateAll&&De().then(De).then(()=>{Ge.forEach(({resource:s},i)=>{a?.includes(i)&&s.refresh?.()})})}async function dn(e){if(e.id!==C?.id){const t={};K.add(t),C={id:e.id,token:t,promise:dt({...e,preload:t}).then(n=>(K.delete(t),n.type==="loaded"&&n.state.error&&(C=null),n))}}return C.promise}async function we(e){const t=(await he(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].map(n=>n?.[1]()))}function ft(e,t,n){y=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(S,e.props.page),st=new v.root({target:t,props:{...e.props,stores:O,components:oe},hydrate:n,sync:!1}),ct(T),n){const a={from:null,to:{params:y.params,route:{id:y.route?.id??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};H.forEach(s=>s(a))}se=!0}function ie({url:e,params:t,branch:n,status:r,error:a,route:s,form:i}){let o="never";if(I&&(e.pathname===I||e.pathname===I+"/"))o="always";else for(const l of n)l?.slash!==void 0&&(o=l.slash);e.pathname=wt(e.pathname,o),e.search=e.search;const c={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:s},props:{constructors:Jt(n).map(l=>l.node.component),page:je(S)}};i!==void 0&&(c.props.form=i);let f={},d=!S,p=0;for(let l=0;l<Math.max(n.length,y.branch.length);l+=1){const h=n[l],w=y.branch[l];h?.data!==w?.data&&(d=!0),h&&(f={...f,...h.data},d&&(c.props[`data_${p}`]=f),p+=1)}return(!y.url||e.href!==y.url.href||y.error!==a||i!==void 0&&i!==S.form||d)&&(c.props.page={error:a,params:t,route:{id:s?.id??null},state:{},status:r,url:new URL(e),form:i??null,data:d?f:S.data}),c}async function Ce({loader:e,parent:t,url:n,params:r,route:a,server_data_node:s}){let i=null,o=!0;const c={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},f=await e();if(f.universal?.load){let d=function(...u){for(const l of u){const{href:h}=new URL(l,n);c.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Me,current:Me},route:new Proxy(a,{get:(u,l)=>(o&&(c.route=!0),u[l])}),params:new Proxy(r,{get:(u,l)=>(o&&c.params.add(l),u[l])}),data:s?.data??null,url:kt(n,()=>{o&&(c.url=!0)},u=>{o&&c.search_params.add(u)},v.hash),async fetch(u,l){u instanceof Request&&(l={body:u.method==="GET"||u.method==="HEAD"?void 0:await u.blob(),cache:u.cache,credentials:u.credentials,headers:[...u.headers].length>0?u?.headers:void 0,integrity:u.integrity,keepalive:u.keepalive,method:u.method,mode:u.mode,redirect:u.redirect,referrer:u.referrer,referrerPolicy:u.referrerPolicy,signal:u.signal,...l});const{resolved:h,promise:w}=ut(u,l,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(c.parent=!0),t()},untrack(u){o=!1;try{return u()}finally{o=!0}}};i=await f.universal.load.call(null,p)??null}return{node:f,loader:e,server:s,universal:f.universal?.load?{type:"data",data:i,uses:c}:null,data:i??s?.data??null,slash:f.universal?.trailingSlash??s?.slash}}function ut(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const s=se?It(r,a.href,t):Tt(r,t);return{resolved:a,promise:s}}function Ke(e,t,n,r,a,s){if(xe)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const i of a.search_params)if(r.has(i))return!0;for(const i of a.params)if(s[i]!==y.params[i])return!0;for(const i of a.dependencies)if(ae.some(o=>o(new URL(i))))return!0;return!1}function Ne(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function hn(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),s=t.searchParams.getAll(r);a.every(i=>s.includes(i))&&s.every(i=>a.includes(i))&&n.delete(r)}return n}function Ye({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:je(S),constructors:[]}}}async function dt({id:e,invalidating:t,url:n,params:r,route:a,preload:s}){if(C?.id===e)return K.delete(C.token),C.promise;const{errors:i,layouts:o,leaf:c}=a,f=[...o,c];i.forEach(_=>_?.().catch(()=>{})),f.forEach(_=>_?.[1]().catch(()=>{}));let d=null;const p=y.url?e!==ce(y.url):!1,u=y.route?a.id!==y.route.id:!1,l=hn(y.url,n);let h=!1;const w=f.map((_,g)=>{const b=y.branch[g],k=!!_?.[0]&&(b?.loader!==_[1]||Ke(h,u,p,l,b.server?.uses,r));return k&&(h=!0),k});if(w.some(Boolean)){try{d=await gt(n,w)}catch(_){const g=await M(_,{url:n,params:r,route:{id:e}});return K.has(s)?Ye({error:g,url:n,params:r,route:a}):de({status:ne(_),error:g,url:n,route:a})}if(d.type==="redirect")return d}const A=d?.nodes;let m=!1;const N=f.map(async(_,g)=>{if(!_)return;const b=y.branch[g],k=A?.[g];if((!k||k.type==="skip")&&_[1]===b?.loader&&!Ke(m,u,p,l,b.universal?.uses,r))return b;if(m=!0,k?.type==="error")throw k;return Ce({loader:_[1],url:n,params:r,route:a,parent:async()=>{const pe={};for(let ge=0;ge<g;ge+=1)Object.assign(pe,(await N[ge])?.data);return pe},server_data_node:Ne(k===void 0&&_[0]?{type:"skip"}:k??null,_[0]?b?.server:void 0)})});for(const _ of N)_.catch(()=>{});const R=[];for(let _=0;_<f.length;_+=1)if(f[_])try{R.push(await N[_])}catch(g){if(g instanceof Se)return{type:"redirect",location:g.location};if(K.has(s))return Ye({error:await M(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let b=ne(g),k;if(A?.includes(g))b=g.status??b,k=g.error;else if(g instanceof le)k=g.body;else{if(await O.updated.check())return await rt(),await q(n);k=await M(g,{params:r,url:n,route:{id:a.id}})}const Q=await pn(_,R,i);return Q?ie({url:n,params:r,branch:R.slice(0,Q.idx).concat(Q.node),status:b,error:k,route:a}):await pt(n,{id:a.id},k,b)}else R.push(void 0);return ie({url:n,params:r,branch:R,status:200,error:null,route:a,form:t?void 0:null})}async function pn(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function de({status:e,error:t,url:n,route:r}){const a={};let s=null;if(v.server_loads[0]===0)try{const o=await gt(n,[!0]);if(o.type!=="data"||o.nodes[0]&&o.nodes[0].type!=="data")throw 0;s=o.nodes[0]??null}catch{(n.origin!==Z||n.pathname!==location.pathname||Pe)&&await q(n)}try{const o=await Ce({loader:be,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ne(s)}),c={node:await re(),loader:re,universal:null,server:null,data:null};return ie({url:n,params:a,branch:[o,c],status:e,error:t,route:null})}catch(o){if(o instanceof Se)return lt(new URL(o.location,location.href),{},0);throw o}}async function gn(e){const t=e.href;if(ee.has(t))return ee.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(s,i)=>ut(s,i,e).promise})??e;if(typeof a=="string"){const s=new URL(e);v.hash?s.hash=a:s.pathname=a,a=s}return a})();ee.set(t,r),n=await r}catch{ee.delete(t);return}return n}async function he(e,t){if(e&&!ue(e,I,v.hash)){const n=await gn(e);if(!n)return;const r=mn(n);for(const a of Le){const s=a.exec(r);if(s)return{id:ce(e),invalidating:t,route:a,params:bt(s),url:e}}}}function mn(e){return vt(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(I.length))||"/"}function ce(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function ht({url:e,type:t,intent:n,delta:r,event:a}){let s=!1;const i=Oe(y,n,e,t);r!==void 0&&(i.navigation.delta=r),a!==void 0&&(i.navigation.event=a);const o={...i.navigation,cancel:()=>{s=!0,i.reject(new Error("navigation cancelled"))}};return X||at.forEach(c=>c(o)),s?null:i}async function V({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i={},redirect_count:o=0,nav_token:c={},accept:f=qe,block:d=qe,event:p}){const u=$;$=c;const l=await he(t,!1),h=e==="enter"?Oe(y,l,t,e):ht({url:t,type:e,delta:n?.delta,intent:l,event:p});if(!h){d(),$===c&&($=u);return}const w=E,A=T;f(),X=!0,se&&h.navigation.type!=="enter"&&O.navigating.set(W.current=h.navigation);let m=l&&await dt(l);if(!m){if(ue(t,I,v.hash))return await q(t,s);m=await pt(t,{id:null},await M(new Re(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,s)}if(t=l?.url||t,$!==c)return h.reject(new Error("navigation aborted")),!1;if(m.type==="redirect"){if(o<20){await V({type:e,url:new URL(m.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:s,state:i,redirect_count:o+1,nav_token:c}),h.fulfil(void 0);return}m=await de({status:500,error:await M(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else m.props.page.status>=400&&await O.updated.check()&&(await rt(),await q(t,s));if(un(),Ue(w),it(A),m.props.page.url.pathname!==t.pathname&&(t.pathname=m.props.page.url.pathname),i=n?n.state:i,!n){const g=s?0:1,b={[B]:E+=g,[Y]:T+=g,[Ze]:i};(s?history.replaceState:history.pushState).call(history,b,"",t),s||ln(E,T)}if(C=null,m.props.page.state=i,se){const g=(await Promise.all(Array.from(fn,b=>b(h.navigation)))).filter(b=>typeof b=="function");if(g.length>0){let b=function(){g.forEach(k=>{H.delete(k)})};g.push(b),g.forEach(k=>{H.add(k)})}y=m.state,m.props.page&&(m.props.page.url=t),st.$set(m.props),tn(m.props.page),ot=!0}else ft(m,ke,!1);const{activeElement:N}=document;await sn();const R=n?n.scroll:a?fe():null;if(ze){const g=t.hash&&document.getElementById(_t(t));R?scrollTo(R.x,R.y):g?g.scrollIntoView():scrollTo(0,0)}const _=document.activeElement!==N&&document.activeElement!==document.body;!r&&!_&&bn(t),ze=!0,m.props.page&&Object.assign(S,m.props.page),X=!1,e==="popstate"&&ct(T),h.fulfil(void 0),H.forEach(g=>g(h.navigation)),O.navigating.set(W.current=null)}async function pt(e,t,n,r,a){return e.origin===Z&&e.pathname===location.pathname&&!Pe?await de({status:r,error:n,url:e,route:t}):await q(e,a)}function _n(){let e,t,n;x.addEventListener("mousemove",o=>{const c=o.target;clearTimeout(e),e=setTimeout(()=>{s(c,j.hover)},20)});function r(o){o.defaultPrevented||s(o.composedPath()[0],j.tap)}x.addEventListener("mousedown",r),x.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const c of o)c.isIntersecting&&(we(new URL(c.target.href)),a.unobserve(c.target))},{threshold:0});async function s(o,c){const f=et(o,x),d=f===t&&c>=n;if(!f||d)return;const{url:p,external:u,download:l}=ve(f,I,v.hash);if(u||l)return;const h=te(f),w=p&&ce(y.url)===ce(p);if(!(h.reload||w))if(c<=h.preload_data){t=f,n=j.tap;const A=await he(p,!1);if(!A)return;dn(A)}else c<=h.preload_code&&(t=f,n=c,we(p))}function i(){a.disconnect();for(const o of x.querySelectorAll("a")){const{url:c,external:f,download:d}=ve(o,I,v.hash);if(f||d)continue;const p=te(o);p.reload||(p.preload_code===j.viewport&&a.observe(o),p.preload_code===j.eager&&we(c))}}H.add(i),i()}function M(e,t){if(e instanceof le)return e.body;const n=ne(e),r=Qt(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function Un(e,t={}){return e=new URL(Ie(e)),e.origin!==Z?Promise.reject(new Error("goto: invalid URL")):lt(e,t,0)}function yn(e){if(typeof e=="function")ae.push(e);else{const{href:t}=new URL(e,location.href);ae.push(n=>n.href===t)}}function wn(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(He(),!X){const r=Oe(y,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};at.forEach(s=>s(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&He()}),navigator.connection?.saveData||_n(),x.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=et(t.composedPath()[0],x);if(!n)return;const{url:r,external:a,target:s,download:i}=ve(n,I,v.hash);if(!r)return;if(s==="_parent"||s==="_top"){if(window.parent!==window)return}else if(s&&s!=="_self")return;const o=te(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||i)return;const[f,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=f===me(location);if(a||o.reload&&(!p||!d)){ht({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,u]=y.url.href.split("#");if(u===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)window.scrollTo({top:0});else{const l=n.ownerDocument.getElementById(decodeURIComponent(d));l&&(l.scrollIntoView(),l.focus())}return}if(z=!0,Ue(E),e(r),!o.replace_state)return;z=!1}t.preventDefault(),await new Promise(u=>{requestAnimationFrame(()=>{setTimeout(u,0)}),setTimeout(u,100)}),await V({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),x.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const i=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ue(i,I,!1))return;const o=t.target,c=te(o);if(c.reload)return;t.preventDefault(),t.stopPropagation();const f=new FormData(o),d=r?.getAttribute("name");d&&f.append(d,r?.getAttribute("value")??""),i.search=new URLSearchParams(f).toString(),V({type:"form",url:i,keepfocus:c.keepfocus,noscroll:c.noscroll,replace_state:c.replace_state??i.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[B]){const n=t.state[B];if($={},n===E)return;const r=D[n],a=t.state[Ze]??{},s=new URL(t.state[$t]??location.href),i=t.state[Y],o=y.url?me(location)===me(y.url):!1;if(i===T&&(ot||o)){a!==S.state&&(S.state=a),e(s),D[E]=fe(),r&&scrollTo(r.x,r.y),E=n;return}const f=n-E;await V({type:"popstate",url:s,popped:{state:a,scroll:r,delta:f},accept:()=>{E=n,T=i},block:()=>{history.go(-f)},nav_token:$,event:t})}else if(!z){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{z&&(z=!1,history.replaceState({...history.state,[B]:++E,[Y]:T},"",location.href))});for(const t of document.querySelectorAll("link"))cn.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&O.navigating.set(W.current=null)});function e(t){y.url=S.url=t,O.page.set(je(S)),O.page.notify()}}async function vn(e,{status:t=200,error:n,node_ids:r,params:a,route:s,server_route:i,data:o,form:c}){Pe=!0;const f=new URL(location.href);let d;({params:a={},route:s={id:null}}=await he(f,!1)||{}),d=Le.find(({id:l})=>l===s.id);let p,u=!0;try{const l=r.map(async(w,A)=>{const m=o[A];return m?.uses&&(m.uses=mt(m.uses)),Ce({loader:v.nodes[w],url:f,params:a,route:s,parent:async()=>{const N={};for(let R=0;R<A;R+=1)Object.assign(N,(await l[R]).data);return N},server_data_node:Ne(m)})}),h=await Promise.all(l);if(d){const w=d.layouts;for(let A=0;A<w.length;A++)w[A]||h.splice(A,0,void 0)}p=ie({url:f,params:a,branch:h,status:t,error:n,form:c,route:d??null})}catch(l){if(l instanceof Se){await q(new URL(l.location,location.href));return}p=await de({status:ne(l),error:await M(l,{url:f,params:a,route:s}),url:f,route:s}),e.textContent="",u=!1}p.props.page&&(p.props.page.state={}),ft(p,e,u)}async function gt(e,t){const n=new URL(e);n.pathname=an(e.pathname),e.pathname.endsWith("/")&&n.searchParams.append(Zt,"1"),n.searchParams.append(Xt,t.map(s=>s?"1":"0").join(""));const r=window.fetch,a=await r(n.href,{});if(!a.ok){let s;throw a.headers.get("content-type")?.includes("application/json")?s=await a.json():a.status===404?s="Not Found":a.status===500&&(s="Internal Error"),new le(a.status,s)}return new Promise(async s=>{const i=new Map,o=a.body.getReader();function c(d){return Yt(d,{...v.decoders,Promise:p=>new Promise((u,l)=>{i.set(p,{fulfil:u,reject:l})})})}let f="";for(;;){const{done:d,value:p}=await o.read();if(d&&!f)break;for(f+=!p&&f?`
2
- `:Et.decode(p,{stream:!0});;){const u=f.indexOf(`
3
- `);if(u===-1)break;const l=JSON.parse(f.slice(0,u));if(f=f.slice(u+1),l.type==="redirect")return s(l);if(l.type==="data")l.nodes?.forEach(h=>{h?.type==="data"&&(h.uses=mt(h.uses),h.data=c(h.data))}),s(l);else if(l.type==="chunk"){const{id:h,data:w,error:A}=l,m=i.get(h);i.delete(h),A?m.reject(c(A)):m.fulfil(c(w))}}}})}function mt(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ae=!1;function bn(e){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const n=_t(e);if(n&&document.getElementById(n)){const{x:a,y:s}=fe();setTimeout(()=>{const i=history.state;Ae=!0,location.replace(`#${n}`),v.hash&&location.replace(e.hash),history.replaceState(i,"",e.hash),scrollTo(a,s),Ae=!1})}else{const a=document.body,s=a.getAttribute("tabindex");a.tabIndex=-1,a.focus({preventScroll:!0,focusVisible:!1}),s!==null?a.setAttribute("tabindex",s):a.removeAttribute("tabindex")}const r=getSelection();if(r&&r.type!=="None"){const a=[];for(let s=0;s<r.rangeCount;s+=1)a.push(r.getRangeAt(s));setTimeout(()=>{if(r.rangeCount===a.length){for(let s=0;s<r.rangeCount;s+=1){const i=a[s],o=r.getRangeAt(s);if(i.commonAncestorContainer!==o.commonAncestorContainer||i.startContainer!==o.startContainer||i.endContainer!==o.endContainer||i.startOffset!==o.startOffset||i.endOffset!==o.endOffset)return}r.removeAllRanges()}})}}}function Oe(e,t,n,r){let a,s;const i=new Promise((c,f)=>{a=c,s=f});return i.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n},willUnload:!t,type:r,complete:i},fulfil:a,reject:s}}function je(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function kn(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function _t(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{In as a,Un as g,En as l,S as p,O as s};
@@ -1 +0,0 @@
1
- import{l as o,a as r}from"../chunks/DUYNrdfy.js";export{o as load_css,r as start};