lowlander 0.4.0 → 0.6.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.
Files changed (71) hide show
  1. package/README.md +108 -78
  2. package/build/client/client.d.ts +8 -1
  3. package/build/client/client.js +44 -22
  4. package/build/client/client.js.map +1 -1
  5. package/build/dashboard/client/crud.d.ts +16 -0
  6. package/build/dashboard/client/crud.js +525 -0
  7. package/build/dashboard/client/crud.js.map +1 -0
  8. package/build/dashboard/client/main.d.ts +1 -0
  9. package/build/dashboard/client/main.js +615 -0
  10. package/build/dashboard/client/main.js.map +1 -0
  11. package/build/dashboard/client/shim-server.d.ts +3 -0
  12. package/build/dashboard/client/shim-server.js +2 -0
  13. package/build/dashboard/client/shim-server.js.map +1 -0
  14. package/build/dashboard/dashboard.html +20 -0
  15. package/build/dashboard/index.d.ts +18 -0
  16. package/build/dashboard/index.d.ts.map +1 -0
  17. package/build/dashboard/index.js +50 -0
  18. package/build/dashboard/index.js.map +1 -0
  19. package/build/dashboard/serve.d.ts +18 -0
  20. package/build/dashboard/serve.d.ts.map +1 -0
  21. package/build/dashboard/serve.js +53 -0
  22. package/build/dashboard/serve.js.map +1 -0
  23. package/build/dashboard/server.d.ts +93 -0
  24. package/build/dashboard/server.d.ts.map +1 -0
  25. package/build/dashboard/server.js +384 -0
  26. package/build/dashboard/server.js.map +1 -0
  27. package/build/examples/helloworld/.edinburgh/commit_worker.log +4927 -0
  28. package/build/examples/helloworld/.edinburgh/data.mdb +0 -0
  29. package/build/examples/helloworld/.edinburgh/lock.mdb +0 -0
  30. package/build/examples/helloworld/client/assets/style.css +0 -45
  31. package/build/examples/helloworld/client/index.html +3 -14
  32. package/build/examples/helloworld/client/js/base.css +1 -0
  33. package/build/examples/helloworld/client/js/base.d.ts +1 -4
  34. package/build/examples/helloworld/client/js/base.js +8 -71
  35. package/build/examples/helloworld/client/js/base.js.map +1 -1
  36. package/build/examples/helloworld/server/api.d.ts +8 -2
  37. package/build/examples/helloworld/server/api.d.ts.map +1 -1
  38. package/build/examples/helloworld/server/api.js +29 -8
  39. package/build/examples/helloworld/server/api.js.map +1 -1
  40. package/build/examples/helloworld/server/main.d.ts +1 -1
  41. package/build/examples/helloworld/server/main.d.ts.map +1 -1
  42. package/build/examples/helloworld/server/main.js +6 -17
  43. package/build/examples/helloworld/server/main.js.map +1 -1
  44. package/build/server/password.d.ts +10 -0
  45. package/build/server/password.d.ts.map +1 -0
  46. package/build/server/password.js +38 -0
  47. package/build/server/password.js.map +1 -0
  48. package/build/server/server.d.ts +5 -3
  49. package/build/server/server.d.ts.map +1 -1
  50. package/build/server/server.js +65 -7
  51. package/build/server/server.js.map +1 -1
  52. package/build/server/wshandler.d.ts +7 -1
  53. package/build/server/wshandler.d.ts.map +1 -1
  54. package/build/server/wshandler.js +54 -14
  55. package/build/server/wshandler.js.map +1 -1
  56. package/build/tsconfig.client.tsbuildinfo +1 -1
  57. package/build/tsconfig.server.tsbuildinfo +1 -1
  58. package/client/client.ts +47 -24
  59. package/dashboard/build-bundle.ts +44 -0
  60. package/dashboard/client/crud.ts +634 -0
  61. package/dashboard/client/index.html +12 -0
  62. package/dashboard/client/main.ts +554 -0
  63. package/dashboard/client/shim-server.ts +5 -0
  64. package/dashboard/index.ts +49 -0
  65. package/dashboard/server.ts +399 -0
  66. package/package.json +26 -11
  67. package/server/server.ts +61 -10
  68. package/server/wshandler.ts +57 -13
  69. package/skill/SKILL.md +82 -51
  70. package/skill/getStreamTypesForModel.md +7 -0
  71. package/skill/Connection_pruneCommitIds.md +0 -8
@@ -1,45 +0,0 @@
1
- html,
2
- body {
3
- box-sizing: border-box;
4
- }
5
- body {
6
- background-color: #0a0f0a;
7
- background-image:
8
- linear-gradient(rgba(0, 120, 0, 0.1) 1px, transparent 1px),
9
- linear-gradient(90deg, rgba(0, 120, 0, 0.1) 1px, transparent 1px);
10
- background-size: 20px 20px;
11
- color: #00ff00;
12
- font-family: 'Courier New', Courier, monospace;
13
- min-height: 100vh;
14
- padding: 20px;
15
- }
16
- h2 {
17
- border-bottom: 1px solid rgba(0, 255, 0, 0.3);
18
- padding-bottom: 5px;
19
- margin-top: 25px;
20
- }
21
- ul {
22
- list-style-type: none;
23
- padding-left: 20px;
24
- }
25
- input, button {
26
- border: 1px solid #00ff00;
27
- padding: 8px 12px;
28
- color: #00ff00;
29
- font-family: inherit;
30
- background-color: rgba(0, 255, 0, 0.1);
31
- }
32
- input:focus, button:hover {
33
- outline: none;
34
- }
35
- button {
36
- cursor: pointer;
37
- background-color: green;
38
- color: white;
39
- }
40
-
41
- .busy {
42
- cursor: default;
43
- pointer-events: none;
44
- opacity: 0.6;
45
- }
@@ -1,22 +1,11 @@
1
1
  <!doctype html>
2
- <html lang="en" dir="ltr" class="mdui-theme-dark">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
5
6
  <title>Lowlander Hello World Example</title>
6
- <meta
7
- name="viewport"
8
- content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
9
- />
10
- <meta name="format-detection" content="telephone=no" />
11
- <meta name="msapplication-tap-highlight" content="no" />
12
- <meta name="theme-color" content="#31d53d" />
13
- <link
14
- href="https://fonts.googleapis.com/icon?family=Material+Icons"
15
- rel="stylesheet"
16
- />
17
7
  </head>
18
8
  <body>
19
- <script src="./js/base.ts" type="module"></script>
9
+ <script src="./js/base.js" type="module"></script>
20
10
  </body>
21
-
22
11
  </html>
@@ -0,0 +1 @@
1
+ :root{--mdui-breakpoint-xs:0px;--mdui-breakpoint-sm:600px;--mdui-breakpoint-md:840px;--mdui-breakpoint-lg:1080px;--mdui-breakpoint-xl:1440px;--mdui-breakpoint-xxl:1920px}:root{--mdui-color-primary-light:103,80,164;--mdui-color-primary-container-light:234,221,255;--mdui-color-on-primary-light:255,255,255;--mdui-color-on-primary-container-light:33,0,94;--mdui-color-inverse-primary-light:208,188,255;--mdui-color-secondary-light:98,91,113;--mdui-color-secondary-container-light:232,222,248;--mdui-color-on-secondary-light:255,255,255;--mdui-color-on-secondary-container-light:30,25,43;--mdui-color-tertiary-light:125,82,96;--mdui-color-tertiary-container-light:255,216,228;--mdui-color-on-tertiary-light:255,255,255;--mdui-color-on-tertiary-container-light:55,11,30;--mdui-color-surface-light:254,247,255;--mdui-color-surface-dim-light:222,216,225;--mdui-color-surface-bright-light:254,247,255;--mdui-color-surface-container-lowest-light:255,255,255;--mdui-color-surface-container-low-light:247,242,250;--mdui-color-surface-container-light:243,237,247;--mdui-color-surface-container-high-light:236,230,240;--mdui-color-surface-container-highest-light:230,224,233;--mdui-color-surface-variant-light:231,224,236;--mdui-color-on-surface-light:28,27,31;--mdui-color-on-surface-variant-light:73,69,78;--mdui-color-inverse-surface-light:49,48,51;--mdui-color-inverse-on-surface-light:244,239,244;--mdui-color-background-light:254,247,255;--mdui-color-on-background-light:28,27,31;--mdui-color-error-light:179,38,30;--mdui-color-error-container-light:249,222,220;--mdui-color-on-error-light:255,255,255;--mdui-color-on-error-container-light:65,14,11;--mdui-color-outline-light:121,116,126;--mdui-color-outline-variant-light:196,199,197;--mdui-color-shadow-light:0,0,0;--mdui-color-surface-tint-color-light:103,80,164;--mdui-color-scrim-light:0,0,0;--mdui-color-primary-dark:208,188,255;--mdui-color-primary-container-dark:79,55,139;--mdui-color-on-primary-dark:55,30,115;--mdui-color-on-primary-container-dark:234,221,255;--mdui-color-inverse-primary-dark:103,80,164;--mdui-color-secondary-dark:204,194,220;--mdui-color-secondary-container-dark:74,68,88;--mdui-color-on-secondary-dark:51,45,65;--mdui-color-on-secondary-container-dark:232,222,248;--mdui-color-tertiary-dark:239,184,200;--mdui-color-tertiary-container-dark:99,59,72;--mdui-color-on-tertiary-dark:73,37,50;--mdui-color-on-tertiary-container-dark:255,216,228;--mdui-color-surface-dark:20,18,24;--mdui-color-surface-dim-dark:20,18,24;--mdui-color-surface-bright-dark:59,56,62;--mdui-color-surface-container-lowest-dark:15,13,19;--mdui-color-surface-container-low-dark:29,27,32;--mdui-color-surface-container-dark:33,31,38;--mdui-color-surface-container-high-dark:43,41,48;--mdui-color-surface-container-highest-dark:54,52,59;--mdui-color-surface-variant-dark:73,69,79;--mdui-color-on-surface-dark:230,225,229;--mdui-color-on-surface-variant-dark:202,196,208;--mdui-color-inverse-surface-dark:230,225,229;--mdui-color-inverse-on-surface-dark:49,48,51;--mdui-color-background-dark:20,18,24;--mdui-color-on-background-dark:230,225,229;--mdui-color-error-dark:242,184,181;--mdui-color-error-container-dark:140,29,24;--mdui-color-on-error-dark:96,20,16;--mdui-color-on-error-container-dark:249,222,220;--mdui-color-outline-dark:147,143,153;--mdui-color-outline-variant-dark:68,71,70;--mdui-color-shadow-dark:0,0,0;--mdui-color-surface-tint-color-dark:208,188,255;--mdui-color-scrim-dark:0,0,0;font-size:16px}.mdui-theme-light,:root{color-scheme:light;--mdui-color-primary:var(--mdui-color-primary-light);--mdui-color-primary-container:var(--mdui-color-primary-container-light);--mdui-color-on-primary:var(--mdui-color-on-primary-light);--mdui-color-on-primary-container:var(--mdui-color-on-primary-container-light);--mdui-color-inverse-primary:var(--mdui-color-inverse-primary-light);--mdui-color-secondary:var(--mdui-color-secondary-light);--mdui-color-secondary-container:var(--mdui-color-secondary-container-light);--mdui-color-on-secondary:var(--mdui-color-on-secondary-light);--mdui-color-on-secondary-container:var(--mdui-color-on-secondary-container-light);--mdui-color-tertiary:var(--mdui-color-tertiary-light);--mdui-color-tertiary-container:var(--mdui-color-tertiary-container-light);--mdui-color-on-tertiary:var(--mdui-color-on-tertiary-light);--mdui-color-on-tertiary-container:var(--mdui-color-on-tertiary-container-light);--mdui-color-surface:var(--mdui-color-surface-light);--mdui-color-surface-dim:var(--mdui-color-surface-dim-light);--mdui-color-surface-bright:var(--mdui-color-surface-bright-light);--mdui-color-surface-container-lowest:var(--mdui-color-surface-container-lowest-light);--mdui-color-surface-container-low:var(--mdui-color-surface-container-low-light);--mdui-color-surface-container:var(--mdui-color-surface-container-light);--mdui-color-surface-container-high:var(--mdui-color-surface-container-high-light);--mdui-color-surface-container-highest:var(--mdui-color-surface-container-highest-light);--mdui-color-surface-variant:var(--mdui-color-surface-variant-light);--mdui-color-on-surface:var(--mdui-color-on-surface-light);--mdui-color-on-surface-variant:var(--mdui-color-on-surface-variant-light);--mdui-color-inverse-surface:var(--mdui-color-inverse-surface-light);--mdui-color-inverse-on-surface:var(--mdui-color-inverse-on-surface-light);--mdui-color-background:var(--mdui-color-background-light);--mdui-color-on-background:var(--mdui-color-on-background-light);--mdui-color-error:var(--mdui-color-error-light);--mdui-color-error-container:var(--mdui-color-error-container-light);--mdui-color-on-error:var(--mdui-color-on-error-light);--mdui-color-on-error-container:var(--mdui-color-on-error-container-light);--mdui-color-outline:var(--mdui-color-outline-light);--mdui-color-outline-variant:var(--mdui-color-outline-variant-light);--mdui-color-shadow:var(--mdui-color-shadow-light);--mdui-color-surface-tint-color:var(--mdui-color-surface-tint-color-light);--mdui-color-scrim:var(--mdui-color-scrim-light);color:rgb(var(--mdui-color-on-background));background-color:rgb(var(--mdui-color-background))}.mdui-theme-dark{color-scheme:dark;--mdui-color-primary:var(--mdui-color-primary-dark);--mdui-color-primary-container:var(--mdui-color-primary-container-dark);--mdui-color-on-primary:var(--mdui-color-on-primary-dark);--mdui-color-on-primary-container:var(--mdui-color-on-primary-container-dark);--mdui-color-inverse-primary:var(--mdui-color-inverse-primary-dark);--mdui-color-secondary:var(--mdui-color-secondary-dark);--mdui-color-secondary-container:var(--mdui-color-secondary-container-dark);--mdui-color-on-secondary:var(--mdui-color-on-secondary-dark);--mdui-color-on-secondary-container:var(--mdui-color-on-secondary-container-dark);--mdui-color-tertiary:var(--mdui-color-tertiary-dark);--mdui-color-tertiary-container:var(--mdui-color-tertiary-container-dark);--mdui-color-on-tertiary:var(--mdui-color-on-tertiary-dark);--mdui-color-on-tertiary-container:var(--mdui-color-on-tertiary-container-dark);--mdui-color-surface:var(--mdui-color-surface-dark);--mdui-color-surface-dim:var(--mdui-color-surface-dim-dark);--mdui-color-surface-bright:var(--mdui-color-surface-bright-dark);--mdui-color-surface-container-lowest:var(--mdui-color-surface-container-lowest-dark);--mdui-color-surface-container-low:var(--mdui-color-surface-container-low-dark);--mdui-color-surface-container:var(--mdui-color-surface-container-dark);--mdui-color-surface-container-high:var(--mdui-color-surface-container-high-dark);--mdui-color-surface-container-highest:var(--mdui-color-surface-container-highest-dark);--mdui-color-surface-variant:var(--mdui-color-surface-variant-dark);--mdui-color-on-surface:var(--mdui-color-on-surface-dark);--mdui-color-on-surface-variant:var(--mdui-color-on-surface-variant-dark);--mdui-color-inverse-surface:var(--mdui-color-inverse-surface-dark);--mdui-color-inverse-on-surface:var(--mdui-color-inverse-on-surface-dark);--mdui-color-background:var(--mdui-color-background-dark);--mdui-color-on-background:var(--mdui-color-on-background-dark);--mdui-color-error:var(--mdui-color-error-dark);--mdui-color-error-container:var(--mdui-color-error-container-dark);--mdui-color-on-error:var(--mdui-color-on-error-dark);--mdui-color-on-error-container:var(--mdui-color-on-error-container-dark);--mdui-color-outline:var(--mdui-color-outline-dark);--mdui-color-outline-variant:var(--mdui-color-outline-variant-dark);--mdui-color-shadow:var(--mdui-color-shadow-dark);--mdui-color-surface-tint-color:var(--mdui-color-surface-tint-color-dark);--mdui-color-scrim:var(--mdui-color-scrim-dark);color:rgb(var(--mdui-color-on-background));background-color:rgb(var(--mdui-color-background))}@media(prefers-color-scheme:dark){.mdui-theme-auto{color-scheme:dark;--mdui-color-primary:var(--mdui-color-primary-dark);--mdui-color-primary-container:var(--mdui-color-primary-container-dark);--mdui-color-on-primary:var(--mdui-color-on-primary-dark);--mdui-color-on-primary-container:var(--mdui-color-on-primary-container-dark);--mdui-color-inverse-primary:var(--mdui-color-inverse-primary-dark);--mdui-color-secondary:var(--mdui-color-secondary-dark);--mdui-color-secondary-container:var(--mdui-color-secondary-container-dark);--mdui-color-on-secondary:var(--mdui-color-on-secondary-dark);--mdui-color-on-secondary-container:var(--mdui-color-on-secondary-container-dark);--mdui-color-tertiary:var(--mdui-color-tertiary-dark);--mdui-color-tertiary-container:var(--mdui-color-tertiary-container-dark);--mdui-color-on-tertiary:var(--mdui-color-on-tertiary-dark);--mdui-color-on-tertiary-container:var(--mdui-color-on-tertiary-container-dark);--mdui-color-surface:var(--mdui-color-surface-dark);--mdui-color-surface-dim:var(--mdui-color-surface-dim-dark);--mdui-color-surface-bright:var(--mdui-color-surface-bright-dark);--mdui-color-surface-container-lowest:var(--mdui-color-surface-container-lowest-dark);--mdui-color-surface-container-low:var(--mdui-color-surface-container-low-dark);--mdui-color-surface-container:var(--mdui-color-surface-container-dark);--mdui-color-surface-container-high:var(--mdui-color-surface-container-high-dark);--mdui-color-surface-container-highest:var(--mdui-color-surface-container-highest-dark);--mdui-color-surface-variant:var(--mdui-color-surface-variant-dark);--mdui-color-on-surface:var(--mdui-color-on-surface-dark);--mdui-color-on-surface-variant:var(--mdui-color-on-surface-variant-dark);--mdui-color-inverse-surface:var(--mdui-color-inverse-surface-dark);--mdui-color-inverse-on-surface:var(--mdui-color-inverse-on-surface-dark);--mdui-color-background:var(--mdui-color-background-dark);--mdui-color-on-background:var(--mdui-color-on-background-dark);--mdui-color-error:var(--mdui-color-error-dark);--mdui-color-error-container:var(--mdui-color-error-container-dark);--mdui-color-on-error:var(--mdui-color-on-error-dark);--mdui-color-on-error-container:var(--mdui-color-on-error-container-dark);--mdui-color-outline:var(--mdui-color-outline-dark);--mdui-color-outline-variant:var(--mdui-color-outline-variant-dark);--mdui-color-shadow:var(--mdui-color-shadow-dark);--mdui-color-surface-tint-color:var(--mdui-color-surface-tint-color-dark);--mdui-color-scrim:var(--mdui-color-scrim-dark);color:rgb(var(--mdui-color-on-background));background-color:rgb(var(--mdui-color-background))}}:root{--mdui-elevation-level0:none;--mdui-elevation-level1:0 .5px 1.5px 0 rgba(var(--mdui-color-shadow), 19%),0 0 1px 0 rgba(var(--mdui-color-shadow), 3.9%);--mdui-elevation-level2:0 .85px 3px 0 rgba(var(--mdui-color-shadow), 19%),0 .25px 1px 0 rgba(var(--mdui-color-shadow), 3.9%);--mdui-elevation-level3:0 1.25px 5px 0 rgba(var(--mdui-color-shadow), 19%),0 .3333px 1.5px 0 rgba(var(--mdui-color-shadow), 3.9%);--mdui-elevation-level4:0 1.85px 6.25px 0 rgba(var(--mdui-color-shadow), 19%),0 .5px 1.75px 0 rgba(var(--mdui-color-shadow), 3.9%);--mdui-elevation-level5:0 2.75px 9px 0 rgba(var(--mdui-color-shadow), 19%),0 .25px 3px 0 rgba(var(--mdui-color-shadow), 3.9%)}:root{--mdui-motion-easing-linear:cubic-bezier(0, 0, 1, 1);--mdui-motion-easing-standard:cubic-bezier(.2, 0, 0, 1);--mdui-motion-easing-standard-accelerate:cubic-bezier(.3, 0, 1, 1);--mdui-motion-easing-standard-decelerate:cubic-bezier(0, 0, 0, 1);--mdui-motion-easing-emphasized:var(--mdui-motion-easing-standard);--mdui-motion-easing-emphasized-accelerate:cubic-bezier(.3, 0, .8, .15);--mdui-motion-easing-emphasized-decelerate:cubic-bezier(.05, .7, .1, 1);--mdui-motion-duration-short1:50ms;--mdui-motion-duration-short2:.1s;--mdui-motion-duration-short3:.15s;--mdui-motion-duration-short4:.2s;--mdui-motion-duration-medium1:.25s;--mdui-motion-duration-medium2:.3s;--mdui-motion-duration-medium3:.35s;--mdui-motion-duration-medium4:.4s;--mdui-motion-duration-long1:.45s;--mdui-motion-duration-long2:.5s;--mdui-motion-duration-long3:.55s;--mdui-motion-duration-long4:.6s;--mdui-motion-duration-extra-long1:.7s;--mdui-motion-duration-extra-long2:.8s;--mdui-motion-duration-extra-long3:.9s;--mdui-motion-duration-extra-long4:1s}.mdui-prose{line-height:1.75;word-wrap:break-word}.mdui-prose :first-child{margin-top:0}.mdui-prose :last-child{margin-bottom:0}.mdui-prose code,.mdui-prose kbd,.mdui-prose pre,.mdui-prose pre tt,.mdui-prose samp{font-family:Consolas,Courier,Courier New,monospace}.mdui-prose caption{text-align:left}.mdui-prose [draggable=true],.mdui-prose [draggable]{cursor:move}.mdui-prose [draggable=false]{cursor:inherit}.mdui-prose dl,.mdui-prose form,.mdui-prose ol,.mdui-prose p,.mdui-prose ul{margin-top:1.25em;margin-bottom:1.25em}.mdui-prose a{text-decoration:none;outline:0;color:rgb(var(--mdui-color-primary))}.mdui-prose a:focus,.mdui-prose a:hover{border-bottom:.0625rem solid rgb(var(--mdui-color-primary))}.mdui-prose small{font-size:.875em}.mdui-prose strong{font-weight:600}.mdui-prose blockquote{margin:1.6em 2em;padding-left:1em;border-left:.25rem solid rgb(var(--mdui-color-surface-variant))}@media only screen and (max-width:599.98px){.mdui-prose blockquote{margin:1.6em 0}}.mdui-prose blockquote footer{font-size:86%;color:rgb(var(--mdui-color-on-surface-variant))}.mdui-prose mark{color:inherit;background-color:rgb(var(--mdui-color-secondary-container));border-bottom:.0625rem solid rgb(var(--mdui-color-secondary));margin:0 .375rem;padding:.125rem}.mdui-prose h1,.mdui-prose h2,.mdui-prose h3,.mdui-prose h4,.mdui-prose h5,.mdui-prose h6{font-weight:400}.mdui-prose h1 small,.mdui-prose h2 small,.mdui-prose h3 small,.mdui-prose h4 small,.mdui-prose h5 small,.mdui-prose h6 small{font-weight:inherit;font-size:65%;color:rgb(var(--mdui-color-on-surface-variant))}.mdui-prose h1 strong,.mdui-prose h2 strong,.mdui-prose h3 strong,.mdui-prose h4 strong,.mdui-prose h5 strong,.mdui-prose h6 strong{font-weight:600}.mdui-prose h1{font-size:2.5em;margin-top:0;margin-bottom:1.25em;line-height:1.1111}.mdui-prose h2{font-size:1.875em;margin-top:2.25em;margin-bottom:1.125em;line-height:1.3333}.mdui-prose h3{font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.6}.mdui-prose h4{font-size:1.25em;margin-top:1.875em;margin-bottom:.875em;line-height:1.5}.mdui-prose h2+*,.mdui-prose h3+*,.mdui-prose h4+*,.mdui-prose hr+*{margin-top:0}.mdui-prose code,.mdui-prose kbd{font-size:.875em;color:rgb(var(--mdui-color-on-surface-container));background-color:rgba(var(--mdui-color-surface-variant),.28);padding:.125rem .375rem;border-radius:var(--mdui-shape-corner-extra-small)}.mdui-prose kbd{font-size:.9em}.mdui-prose abbr[title]{text-decoration:none;cursor:help;border-bottom:.0625rem dotted rgb(var(--mdui-color-on-surface-variant))}.mdui-prose ins,.mdui-prose u{text-decoration:none;border-bottom:.0625rem solid rgb(var(--mdui-color-on-surface-variant))}.mdui-prose del{text-decoration:line-through}.mdui-prose hr{margin-top:3em;margin-bottom:3em;border:none;border-bottom:.0625rem solid rgb(var(--mdui-color-surface-variant))}.mdui-prose pre{margin-top:1.7143em;margin-bottom:1.7143em}.mdui-prose pre code{padding:.8571em 1.1429em;overflow-x:auto;-webkit-overflow-scrolling:touch;background-color:rgb(var(--mdui-color-surface-container));color:rgb(var(--mdui-color-on-surface-container));border-radius:var(--mdui-shape-corner-extra-small)}.mdui-prose ol,.mdui-prose ul{padding-left:1.625em}.mdui-prose ul{list-style-type:disc}.mdui-prose ol{list-style-type:decimal}.mdui-prose ol[type=A]{list-style-type:upper-alpha}.mdui-prose ol[type=a]{list-style-type:lower-alpha}.mdui-prose ol[type=I]{list-style-type:upper-roman}.mdui-prose ol[type=i]{list-style-type:lower-roman}.mdui-prose ol[type="1"]{list-style-type:decimal}.mdui-prose li{margin-top:.5em;margin-bottom:.5em}.mdui-prose ol>li,.mdui-prose ul>li{padding-left:.375em}.mdui-prose ol>li>p,.mdui-prose ul>li>p{margin-top:.75em;margin-bottom:.75em}.mdui-prose ol>li>:first-child,.mdui-prose ul>li>:first-child{margin-top:1.25em}.mdui-prose ol>li>:last-child,.mdui-prose ul>li>:last-child{margin-bottom:1.25em}.mdui-prose ol>li::marker{font-weight:400;color:rgb(var(--mdui-color-on-surface-variant))}.mdui-prose ul>li::marker{color:rgb(var(--mdui-color-on-surface-variant))}.mdui-prose ol ol,.mdui-prose ol ul,.mdui-prose ul ol,.mdui-prose ul ul{margin-top:.75em;margin-bottom:.75em}.mdui-prose fieldset,.mdui-prose img{border:none}.mdui-prose figure,.mdui-prose img,.mdui-prose video{margin-top:2em;margin-bottom:2em;max-width:100%}.mdui-prose figure>*{margin-top:0;margin-bottom:0}.mdui-prose figcaption{font-size:.875em;line-height:1.4286;margin-top:.8571em;color:rgb(var(--mdui-color-on-surface-variant))}.mdui-prose figcaption:empty:before{z-index:-1;cursor:text;content:attr(placeholder);color:rgb(var(--mdui-color-on-surface-variant))}.mdui-prose table{margin-top:2em;margin-bottom:2em;border:.0625rem solid rgb(var(--mdui-color-surface-variant));border-radius:var(--mdui-shape-corner-large)}.mdui-table{width:100%;overflow-x:auto;margin-top:2em;margin-bottom:2em;border:.0625rem solid rgb(var(--mdui-color-surface-variant));border-radius:var(--mdui-shape-corner-large)}.mdui-table table{margin-top:0;margin-bottom:0;border:none;border-radius:0}.mdui-prose table,.mdui-table table{width:100%;text-align:left;border-collapse:collapse;border-spacing:0}.mdui-prose td,.mdui-prose th,.mdui-table td,.mdui-table th{border-top:.0625rem solid rgb(var(--mdui-color-surface-variant))}.mdui-prose td:not(:first-child),.mdui-prose th:not(:first-child),.mdui-table td:not(:first-child),.mdui-table th:not(:first-child){border-left:.0625rem solid rgb(var(--mdui-color-surface-variant))}.mdui-prose td:not(:last-child),.mdui-prose th:not(:last-child),.mdui-table td:not(:last-child),.mdui-table th:not(:last-child){border-right:.0625rem solid rgb(var(--mdui-color-surface-variant))}.mdui-prose tfoot td,.mdui-prose tfoot th,.mdui-prose thead td,.mdui-prose thead th,.mdui-table tfoot td,.mdui-table tfoot th,.mdui-table thead td,.mdui-table thead th{position:relative;vertical-align:middle;padding:1.125rem 1rem;font-weight:var(--mdui-typescale-title-medium-weight);letter-spacing:var(--mdui-typescale-title-medium-tracking);line-height:var(--mdui-typescale-title-medium-line-height);color:rgb(var(--mdui-color-on-surface-variant));box-shadow:var(--mdui-elevation-level1)}.mdui-prose tbody td,.mdui-prose tbody th,.mdui-table tbody td,.mdui-table tbody th{padding:.875rem 1rem}.mdui-prose tbody th,.mdui-table tbody th{vertical-align:middle;font-weight:inherit}.mdui-prose tbody td,.mdui-table tbody td{vertical-align:baseline}.mdui-prose tbody:first-child tr:first-child td,.mdui-prose thead:first-child tr:first-child th,.mdui-table tbody:first-child tr:first-child td,.mdui-table thead:first-child tr:first-child th{border-top:0}:root{--mdui-shape-corner-none:0;--mdui-shape-corner-extra-small:.25rem;--mdui-shape-corner-small:.5rem;--mdui-shape-corner-medium:.75rem;--mdui-shape-corner-large:1rem;--mdui-shape-corner-extra-large:1.75rem;--mdui-shape-corner-full:1000rem}:root{--mdui-state-layer-hover:.08;--mdui-state-layer-focus:.12;--mdui-state-layer-pressed:.12;--mdui-state-layer-dragged:.16}:root{--mdui-typescale-display-large-weight:400;--mdui-typescale-display-medium-weight:400;--mdui-typescale-display-small-weight:400;--mdui-typescale-display-large-line-height:4rem;--mdui-typescale-display-medium-line-height:3.25rem;--mdui-typescale-display-small-line-height:2.75rem;--mdui-typescale-display-large-size:3.5625rem;--mdui-typescale-display-medium-size:2.8125rem;--mdui-typescale-display-small-size:2.25rem;--mdui-typescale-display-large-tracking:0rem;--mdui-typescale-display-medium-tracking:0rem;--mdui-typescale-display-small-tracking:0rem;--mdui-typescale-headline-large-weight:400;--mdui-typescale-headline-medium-weight:400;--mdui-typescale-headline-small-weight:400;--mdui-typescale-headline-large-line-height:2.5rem;--mdui-typescale-headline-medium-line-height:2.25rem;--mdui-typescale-headline-small-line-height:2rem;--mdui-typescale-headline-large-size:2rem;--mdui-typescale-headline-medium-size:1.75rem;--mdui-typescale-headline-small-size:1.5rem;--mdui-typescale-headline-large-tracking:0rem;--mdui-typescale-headline-medium-tracking:0rem;--mdui-typescale-headline-small-tracking:0rem;--mdui-typescale-title-large-weight:400;--mdui-typescale-title-medium-weight:500;--mdui-typescale-title-small-weight:500;--mdui-typescale-title-large-line-height:1.75rem;--mdui-typescale-title-medium-line-height:1.5rem;--mdui-typescale-title-small-line-height:1.25rem;--mdui-typescale-title-large-size:1.375rem;--mdui-typescale-title-medium-size:1rem;--mdui-typescale-title-small-size:.875rem;--mdui-typescale-title-large-tracking:0rem;--mdui-typescale-title-medium-tracking:.009375rem;--mdui-typescale-title-small-tracking:.00625rem;--mdui-typescale-label-large-weight:500;--mdui-typescale-label-medium-weight:500;--mdui-typescale-label-small-weight:500;--mdui-typescale-label-large-line-height:1.25rem;--mdui-typescale-label-medium-line-height:1rem;--mdui-typescale-label-small-line-height:.375rem;--mdui-typescale-label-large-size:.875rem;--mdui-typescale-label-medium-size:.75rem;--mdui-typescale-label-small-size:.6875rem;--mdui-typescale-label-large-tracking:.00625rem;--mdui-typescale-label-medium-tracking:.03125rem;--mdui-typescale-label-small-tracking:.03125rem;--mdui-typescale-body-large-weight:400;--mdui-typescale-body-medium-weight:400;--mdui-typescale-body-small-weight:400;--mdui-typescale-body-large-line-height:1.5rem;--mdui-typescale-body-medium-line-height:1.25rem;--mdui-typescale-body-small-line-height:1rem;--mdui-typescale-body-large-size:1rem;--mdui-typescale-body-medium-size:.875rem;--mdui-typescale-body-small-size:.75rem;--mdui-typescale-body-large-tracking:.009375rem;--mdui-typescale-body-medium-tracking:.015625rem;--mdui-typescale-body-small-tracking:.025rem}.mdui-lock-screen{overflow:hidden!important}
@@ -1,4 +1 @@
1
- import 'mdui/mdui.css';
2
- import 'mdui/components/button.js';
3
- import 'mdui/components/fab.js';
4
- import 'mdui/components/text-field.js';
1
+ export {};
@@ -1,71 +1,8 @@
1
- import 'mdui/mdui.css';
2
- import 'mdui/components/button.js';
3
- import 'mdui/components/fab.js';
4
- import 'mdui/components/text-field.js';
5
- import { alert } from 'mdui/functions/alert.js';
6
- import { Connection } from 'lowlander/client';
7
- import A from 'aberdeen';
8
- import { setColorScheme } from 'mdui/functions/setColorScheme.js';
9
- // Generate a color scheme based on #0061a4 and set the <html> element to that color scheme
10
- setColorScheme('#ef6b00');
11
- A.setSpacingCssVars();
12
- const WEBSOCKET_URL = `ws://${location.hostname}:8080/`;
13
- // Create a WebSocket connection with type-safe RPC to the server API.
14
- const connection = new Connection(WEBSOCKET_URL);
15
- const api = connection.api;
16
- A('h2#Online');
17
- // Create a reactive scope to render online status
18
- A(() => {
19
- A(connection.isOnline() ? 'text=yes' : 'text=no');
20
- });
21
- // Simple RPC call - returns a PromiseProxy that resolves to the result.
22
- const sum = api.add(1234, 6753);
23
- A('h2#Answer');
24
- A.dump(sum);
25
- // Server proxy example - authenticate returns both a value and a stateful API object.
26
- const auth = api.authenticate('Frank');
27
- A('h2#AuthToken');
28
- A.dump(auth); // auth.value will become "secret" once authentication completes
29
- // Access the server-side UserAPI through the .serverProxy property.
30
- // Note that this proxy is usable immediately, even though the authentication
31
- // call is still in progress - the server will process requests in-order.
32
- // If authentication were to fail, so would any calls on the server proxy.
33
- const userApi = auth.serverProxy;
34
- // Call methods on the server proxy (returns PromiseProxy like regular RPC).
35
- const bio = userApi.getBio();
36
- A('h2#Bio');
37
- A.dump(bio); // bio.value will become "1:Frank"
38
- // Model streaming - returns a reactive proxy that updates when server-side model changes.
39
- const model = api.streamModel();
40
- A('h2#Model');
41
- A.dump(model); // Live model (and nested linked models) will appear in model.value
42
- A('h2#Toggle friend');
43
- const formBusy = A.proxy(false);
44
- const friendName = A.proxy('');
45
- A('form display:flex gap:$2', 'submit=', async (e) => {
46
- e.preventDefault();
47
- formBusy.value = true;
48
- const found = await userApi.toggleFriend(friendName.value).promise;
49
- formBusy.value = false;
50
- if (!found)
51
- alert({ description: 'No such person: ' + friendName.value });
52
- }, () => {
53
- A('mdui-text-field label="Person name" bind=', friendName);
54
- A(() => {
55
- if (formBusy.value)
56
- A('mdui-circular-progress');
57
- else
58
- A('mdui-button type=submit #Toggle friend');
59
- });
60
- });
61
- // Socket streaming - server pushes data via callbacks.
62
- const data = A.proxy([]);
63
- let dataIndex = 0;
64
- api.streamSomething(item => data[dataIndex++ % 20] = item);
65
- A('h2#Streamed data');
66
- A.dump(data);
67
- A('mdui-fab icon=admin_panel_settings text="Lowlander Admin" click=', async () => {
68
- const { showAdminModal } = await import('./admin');
69
- showAdminModal(api);
70
- });
71
- //# sourceMappingURL=base.js.map
1
+ var Ae=class{keyProp;tail;symbols;constructor(t){this.keyProp=t,this.tail={},this.symbols=[Symbol(0)]}add(t){if(this.symbols[0]in t)return!1;let r=1+(Math.clz32(Math.random()*4294967295)>>2);for(let l=this.symbols.length;l<r;l++)this.symbols.push(Symbol(l));let n=this.keyProp,o=t[n],i,a=this.tail;for(let l=this.symbols.length-1;l>=0;l--){let c=this.symbols[l];for(;(i=a[c])&&i[n]>o;)a=i;l<r&&(t[c]=a[c],a[c]=t)}return!0}has(t){return this.symbols[0]in t}fetchLast(){let t=this.tail[this.symbols[0]];if(t)return this.remove(t),t}isEmpty(){return this.tail[this.symbols[0]]===void 0}get(t){let r=this.keyProp,n,o=this.tail;for(let i=this.symbols.length-1;i>=0;i--){let a=this.symbols[i];for(;(n=o[a])&&n[r]>t;)o=n}return o[this.symbols[0]]?.[r]===t?o[this.symbols[0]]:void 0}*[Symbol.iterator](){let t=this.symbols[0],r=this.tail[t];for(;r;)yield r,r=r[t]}prev(t){return t[this.symbols[0]]}remove(t){if(!(this.symbols[0]in t))return!1;let r=this.keyProp,n=t[r],o,i=this.tail;for(let a=this.symbols.length-1;a>=0;a--){let l=this.symbols[a];for(;(o=i[l])&&o[r]>=n&&o!==t;)i=o;o===t&&(i[l]=o[l],delete o[l])}return o===t}clear(){let t=this.symbols[0],r=this.tail;for(;r;){let n=r[t];for(let o of this.symbols){if(!(o in r))break;delete r[o]}r=n}this.tail={}}},D,Z=0,T,S;function X(e,t,r,n){(e.sideEffects||=[]).push(t,r,n)}function Sr(e,t){for(let r=t.length-3;r>=0;r-=3){let n=t[r+1],o=t[r+2];switch(t[r]){case 0:o?e.classList.add(n):e.classList.remove(n);break;case 1:e.style[n]=o??"";break;case 2:e[n]=o;break;case 3:o==null?e.removeAttribute(n):e.setAttribute(n,o);break;case 4:e.removeEventListener(n,o);break}}}function st(e){if(!D)D=new Ae("prio"),queueMicrotask(Nt);else if(!(Z&1)&&(Z++,Z>98))throw new Error("Too many recursive updates from observes");D.add(e)}function Nt(){let e=Date.now();for(;D;){let t=D.fetchLast();if(!t)break;Z&1&&Z++,t.queueRun()}D=void 0,Z=0,e=Date.now()-e,e>9&&console.debug(`Aberdeen queue took ${e}ms`)}function Et(e){let t="";for(let r of e){if(typeof r=="string"){t+=`${r}`;continue}if(typeof r!="number")throw new Error("onEach() sort key must be a string, number or an array of such");let n="",o=Math.abs(Math.round(r)),i=r<0;for(;o>0;)n=String.fromCharCode(i?65534-o%65533:2+o%65533)+n,o=Math.floor(o/65533);t+=String.fromCharCode(128+(i?-n.length:n.length))+n}return t}function Er(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCodePoint(65535-e.charCodeAt(r));return t}var Lt=0,ke=class{prio=--Lt;remove(){let t=this.getLastNode();t&&Ee(t,this.getPrecedingNode());let r=S;S=this.el,this.delete(),S=r}},Ve=class{queueRun;prio=--Lt;constructor(t){this.queueRun=t,st(this)}},ee=class extends ke{cleaners;sideEffects;changes;constructor(t=[]){super(),this.cleaners=t}lastChild;redraw(){}getLastNode(){return pe(this.lastChild)}delete(){let t=this.cleaners;for(let n=t.length-1;n>=0;n--){let o=t[n];typeof o=="function"?o():o.delete(this)}this.cleaners.length=0;let r=this.sideEffects;r&&(this.el===S&&Sr(this.el,r),this.sideEffects=void 0),D?.remove(this),this.lastChild=void 0}onChange(t,r,n,o){this.changes||(this.changes=new Map,st(this));let i=this.changes.get(t);i||(i=new Map,this.changes.set(t,i)),i.has(r)?i.get(r)===n&&i.delete(r):i.set(r,o)}fetchHasChanges(){if(!this.changes)return!1;for(let t of this.changes.values())if(t.size>0)return delete this.changes,!0;return delete this.changes,!1}queueRun(){this.fetchHasChanges()&&(this.remove(),T=this,this.redraw(),T=void 0)}getInsertAfterNode(){return this.getLastNode()||this.getPrecedingNode()}getChildPrevSibling(){return this.lastChild}},ge=class extends ee{el;svg;prevSibling;constructor(t,r,n=!1){super(n?h.cleaners:[]),this.el=t,this.svg=r,t===h.el?(this.prevSibling=h.getChildPrevSibling(),h.lastChild=this):this.prevSibling=t.lastChild||void 0,n||h.cleaners.push(this)}getPrecedingNode(){return pe(this.prevSibling)}getChildPrevSibling(){return this.lastChild||this.prevSibling}},Ce=class extends ge{renderer;constructor(t,r,n){super(t,r),this.renderer=n,this.redraw()}redraw(){let t=h;h=this;try{this.renderer()}catch(r){ft(r,!0)}h=t}},Se=class extends ee{el=document.body;svg=!1;getPrecedingNode(){}},Ye=class extends ee{el;renderer;svg;constructor(t,r){super(),this.el=t,this.renderer=r,this.svg=t.namespaceURI==="http://www.w3.org/2000/svg";let n=T;T=this,this.redraw(),T=n,h.cleaners.push(this)}redraw(){Ce.prototype.redraw.call(this)}getPrecedingNode(){}delete(){Ee(this.getLastNode(),this.getPrecedingNode());let t=S;S=this.el,super.delete(),S=t}remove(){this.delete()}};function Ee(e,t){for(;e&&e!==t;){let r=e.previousSibling,n=rt.get(e);n&&e instanceof Element?n!==!0&&(typeof n=="function"?n(e):jr(e,n),rt.set(e,!0)):e.remove(),e=r}}function pe(e){return!e||e instanceof Node?e:e.getLastNode()||e.getPrecedingNode()}var Qe=class extends ge{renderer;result=$({value:void 0});constructor(t){super(h.el,h.svg),this.renderer=t,this.redraw()}redraw(){let t=h;h=this;try{this.result.value=this.renderer()}catch(r){ft(r,!0)}h=t}},Je=class extends ge{key;target;svg=!1;constructor(t,r,n){super(t,t.namespaceURI==="http://www.w3.org/2000/svg"),this.key=r,this.target=n,this.redraw()}redraw(){let t=h;h=this,M(this.el,this.key,this.target.value),h=t}},Xe=class extends ke{renderer;makeSortKey;parentElement=h.el;prevSibling;target;byIndex=new Map;sortedSet=new Ae("sortKey");changedIndexes=new Map;constructor(t,r,n){super(),this.renderer=r,this.makeSortKey=n;let o=this.target=t[p]||t;if(w(o,P,this),this.prevSibling=h.getChildPrevSibling(),h.lastChild=this,h.cleaners.push(this),o instanceof Array)for(let i=0;i<o.length;i++)new ue(this,i,!1);else for(let i of o instanceof Map?o.keys():o instanceof Set?o.values():Object.keys(o))new ue(this,i,!1)}getPrecedingNode(){return pe(this.prevSibling)}onChange(t,r,n,o){(!(t instanceof Array)||typeof r=="number")&&(this.changedIndexes.has(r)?this.changedIndexes.get(r)===n&&this.changedIndexes.delete(r):(this.changedIndexes.set(r,o),st(this)))}queueRun(){let t=this.changedIndexes;this.changedIndexes=new Map;for(let r of t.keys()){let n=this.byIndex.get(r);n&&n.remove(),(this.target instanceof Set||this.target instanceof Map?this.target.has(r):r in this.target)?new ue(this,r,!0):this.byIndex.delete(r)}T=void 0}delete(){for(let t of this.byIndex.values())t.delete();D?.remove(this),this.byIndex.clear(),setTimeout(()=>{this.sortedSet.clear()},1)}getLastNode(){for(let t of this.sortedSet){let r=t.getActualLastNode();if(r)return r}}},ue=class extends ee{parent;itemIndex;sortKey;el;svg;constructor(t,r,n){super(),this.parent=t,this.itemIndex=r,this.el=t.parentElement,this.svg=h.svg,this.parent.byIndex.set(this.itemIndex,this),this.lastChild=this,n&&(T=this),this.redraw()}getPrecedingNode(){this.parent.sortedSet.add(this);let t=this.parent.sortedSet.prev(this);return t?pe(t.lastChild):this.parent.getPrecedingNode()}getLastNode(){return this.getPrecedingNode()}getActualLastNode(){let t=this.lastChild;for(;t&&t!==this;){if(t instanceof Node)return t;let r=t.getLastNode();if(r)return r;t=t.getPrecedingNode()}}queueRun(){if(h!==re&&Ot(4),!this.fetchHasChanges())return;if(this.sortKey!==void 0){let r=this.getActualLastNode();r&&Ee(r,this.getPrecedingNode())}let t=S;S=this.el,this.delete(),S=t,this.lastChild=this,T=this,this.redraw(),T=void 0}redraw(){let t,r=this.parent.target,n=this.itemIndex;r instanceof Set?t=n=$(n):r instanceof Map?(t=$(r.get(n)),n=$(n)):t=$(r[n]);let o=h;h=this;let i;try{this.parent.makeSortKey?i=this.parent.makeSortKey(t,n):i=n,i instanceof Array?i=Et(i):typeof i!="string"&&i!=null&&(i=Et([i])),this.sortKey!==i&&(this.parent.sortedSet.remove(this),this.sortKey=i),i!=null&&this.parent.renderer(t,n)}catch(a){ft(a,i!=null)}h=o}getInsertAfterNode(){return this.sortKey==null&&Ot(1),pe(this.lastChild)}remove(){if(this.sortKey!==void 0){let r=this.getActualLastNode();r&&Ee(r,this.getPrecedingNode()),this.parent.sortedSet.remove(this),this.sortKey=void 0}let t=S;S=this.el,this.delete(),S=t}};function F(e,t){if(e!==h.el){e.appendChild(t);return}let r=h.el,n=h.getInsertAfterNode();r.insertBefore(t,n?n.nextSibling:r.firstChild),h.lastChild=t}var re=new Se,h=re;function ot(e){let t=h;h=new Se;try{return e()}finally{h=t}}var P=Symbol("any"),p=Symbol("target"),N=Symbol("mapSize"),Ze=new WeakMap,be=0;function w(e,t,r=h){if(r===re||be)return;let n=Ze.get(e);if(n||Ze.set(e,n=new Map),t!==P&&n.get(P)?.has(r))return;let o=n.get(t);o||n.set(t,o=new Set),!o.has(r)&&(o.add(r),r===h?h.cleaners.push(o):h.cleaners.push(()=>{o.delete(r)}))}function ne(e,t,r){if(!e||typeof e!="object")throw new Error("A.onEach requires an object");e=e[p]||e,new Xe(e,t,r)}function et(e){for(let t of Object.keys(e))return!1;return!0}var y=Symbol("empty");function $e(e){let t=e[p]||e,r=h;if(t instanceof Array)return w(t,"length",(o,i,a)=>{!i!=!a&&r.onChange(t,y,!i,!a)}),!t.length;if(t instanceof Map||t instanceof Set)return w(t,N,(o,i,a)=>{!i!=!a&&r.onChange(t,y,!i,!a)}),!t.size;let n=et(t);return w(t,P,(o,i,a)=>{if(i===y!=(a===y)){let l=et(t);l!==n&&(r.onChange(t,y,l,n),n=l)}}),n}function Rr(e){if(e instanceof Array)return Ie(e,"length");if(e instanceof Map||e instanceof Set)return Ie(e,"size");let t=e[p]||e,r=0;for(let o of Object.keys(t))t[o]!==void 0&&r++;let n=Oe(r);return w(t,P,(o,i,a)=>{a===i||(a===y?n.value=++r:i===y&&(n.value=--r))}),n}function Ir(e,t,r,n){if(r===n&&r!==void 0)return;let o=Ze.get(e);if(o!==void 0)for(let i of[t,P]){let a=o.get(i);if(a)for(let l of a)typeof l=="function"?l(t,r,n):l.onChange(e,t,r,n)}}var x=Ir,Mr={get(e,t){return t===p?e:(w(e,t),$(e[t]))},set(e,t,r){typeof r=="object"&&r&&(r=r[p]||r);let n=e.hasOwnProperty(t)?e[t]:y;return r!==n&&(e[t]=r,x(e,t,r,n)),!0},deleteProperty(e,t){let r=e.hasOwnProperty(t)?e[t]:y;return delete e[t],x(e,t,y,r),!0},has(e,t){return w(e,t),e.hasOwnProperty(t)},ownKeys(e){return w(e,P),Reflect.ownKeys(e)}};function Tr(e,t,r){typeof r=="object"&&r&&(r=r[p]||r);let n=e[t];if(n===void 0&&!e.hasOwnProperty(t)&&(n=y),r!==n){let o=e.length;if(t==="length"){e.length=r;for(let i=r;i<o;i++)x(e,i,y,e[i])}else{if(typeof t=="string"){let i=0|t;String(i)===t&&i>=0&&(t=i)}e[t]=r,x(e,t,r,n)}e.length!==o&&x(e,"length",e.length,o)}return!0}var Or={get(e,t){if(t===p)return e;if(typeof t=="string"){let r=0|t;String(r)===t&&r>=0&&(t=r)}return w(e,t),$(e[t])},set:Tr,deleteProperty(e,t){if(typeof t=="string"){let n=0|t;String(n)===t&&n>=0&&(t=n)}let r=e[t];return r===void 0&&!e.hasOwnProperty(t)&&(r=y),delete e[t],x(e,t,y,r),!0}};function de(e){return{[Symbol.iterator](){return this},next(){let t=e.next();return t.done?t:{done:!1,value:$(t.value)}}}}function tt(e){return{[Symbol.iterator](){return this},next(){let t=e.next();return t.done?t:{done:!1,value:[$(t.value[0]),$(t.value[1])]}}}}function K(e){return typeof e=="object"&&e&&e[p]||e}var Rt={get(e){let t=this[p];return e=K(e),w(t,e),$(t.get(e))},set(e,t){let r=this[p];e=K(e),t=K(t);let n=r.get(e);if(n===void 0&&!r.has(e)&&(n=y),t!==n){let o=r.size;r.set(e,t),x(r,e,t,n),x(r,N,r.size,o)}return this},delete(e){let t=this[p];e=K(e);let r=t.get(e);r===void 0&&!t.has(e)&&(r=y);let n=t.delete(e);return n&&(x(t,e,y,r),x(t,N,t.size,t.size+1)),n},clear(){let e=this[p],t=e.size;for(let r of e.keys())x(e,r,void 0,e.get(r));e.clear(),x(e,N,0,t)},has(e){let t=this[p];return e=K(e),w(t,e),t.has(e)},keys(){let e=this[p];return w(e,P),de(e.keys())},values(){let e=this[p];return w(e,P),de(e.values())},entries(){let e=this[p];return w(e,P),tt(e.entries())},[Symbol.iterator](){let e=this[p];return w(e,P),tt(e[Symbol.iterator]())}},It={add(e){let t=this[p];if(e=K(e),!t.has(e)){let r=t.size;t.add(e),x(t,e,e,y),x(t,N,t.size,r)}return this},delete(e){let t=this[p];if(e=K(e),!t.has(e))return!1;let r=t.size;return t.delete(e),x(t,e,y,e),x(t,N,t.size,r),!0},clear(){let e=this[p],t=e.size;if(t){for(let r of e.values())x(e,r,y,r);e.clear(),x(e,N,0,t)}},has(e){let t=this[p];return e=K(e),w(t,e),t.has(e)},keys(){let e=this[p];return w(e,P),de(e.keys())},values(){let e=this[p];return w(e,P),de(e.values())},entries(){let e=this[p];return w(e,P),tt(e.entries())},[Symbol.iterator](){let e=this[p];return w(e,P),de(e[Symbol.iterator]())}},Nr={get(e,t){return t===p?e:Rt.hasOwnProperty(t)?Rt[t]:t==="size"?(w(e,N),e.size):e[t]}},Lr={get(e,t){return t===p?e:It.hasOwnProperty(t)?It[t]:t==="size"?(w(e,N),e.size):e[t]}},Mt=new WeakMap;function $(e){if(typeof e!="object"||e===null||e[p]!==void 0||e[I])return e;let t=Mt.get(e);if(t)return t;let r;return e instanceof Array?r=Or:e instanceof Map?r=Nr:e instanceof Set?r=Lr:r=Mr,t=new Proxy(e,r),Mt.set(e,t),t}function Oe(e){if(e instanceof Promise){let t=$({busy:!0});return e.then(r=>{t.value=r,t.busy=!1}).catch(r=>{t.error=r,t.busy=!1}),t}return $(typeof e=="object"&&e!==null?e:{value:e})}function at(e){return e&&(e[p]||e)}var rt=new WeakMap;function jr(e,t){let r=t.split(".").filter(n=>n);e.classList.add(...r),setTimeout(()=>e.remove(),2e3)}function qr(e,t,r){return arguments.length>2?jt(e,t,r,0):lt(e,t,0)}function jt(e,t,r,n){let o=Ft(e,t);return r===o?!1:typeof o=="object"&&o!==null&&typeof r=="object"&&r!==null&&o.constructor===r.constructor?lt(o,r,n):(r=nt(r),e instanceof Map?e.set(t,r):e[t]=nt(r),!0)}function zr(e,t,r){return arguments.length>2?jt(e,t,r,Re):lt(e,t,Re)}function lt(e,t,r){let n=e[p];return n&&(e=n,r|=B),n=t[p],n&&(t=n,h!==re&&!be&&(r|=H)),Pe(e,t,r)}function Pe(e,t,r){r&H&&w(t,P);let n=!1;if(t instanceof Array&&e instanceof Array){let o=e.length,i=t.length;for(let a=0;a<i;a++){let l=e[a];l===void 0&&!e.hasOwnProperty(a)&&(l=y);let c=t[a];if(c===void 0&&!t.hasOwnProperty(a))delete e[a],r&B&&x(e,a,y,l),n=!0;else if(l!==c){if(typeof c=="object"&&c!==null){if(typeof l=="object"&&l!==null&&c.constructor===l.constructor&&!(I in c)){n=Pe(l,c,r)||n;continue}c=me(c,r&H)}e[a]=c,r&B&&x(e,a,c,l),n=!0}}if(i!==o){if(r&B){for(let a=i;a<o;a++){let l=e[a];delete e[a],x(e,a,y,l)}e.length=i,x(e,"length",i,o)}else e.length=i;n=!0}}else if(t instanceof Map&&e instanceof Map){for(let o of t.keys()){let i=t.get(o),a=e.get(o);if(a===void 0&&!e.has(o)&&(a=y),a!==i){if(typeof i=="object"&&i!==null){if(typeof a=="object"&&a!==null&&i.constructor===a.constructor&&!(I in i)){n=Pe(a,i,r)||n;continue}i=me(i,r&H)}e.set(o,i),r&B&&x(e,o,i,a),n=!0}}if(!(r&Re)){for(let o of e.keys())if(!t.has(o)){let i=e.get(o);e.delete(o),r&B&&x(e,o,y,i),n=!0}}}else if(t.constructor===e.constructor){for(let o of Object.keys(t)){let i=t[o],a=e.hasOwnProperty(o)?e[o]:y;if(a!==i){if(typeof i=="object"&&i!==null){if(typeof a=="object"&&a!==null&&i.constructor===a.constructor&&!(I in i)){n=Pe(a,i,r)||n;continue}i=me(i,r&H)}e[o]=i,r&B&&x(e,o,i,a),n=!0}}if(!(r&Re)){for(let o of Object.keys(e))if(!t.hasOwnProperty(o)){let i=e[o];delete e[o],r&B&&i!==void 0&&x(e,o,y,i),n=!0}}}else throw new Error(`Incompatible or non-object types: ${t?.constructor?.name||typeof t} vs ${e?.constructor?.name||typeof e}`);return n}var Re=1,H=32,B=64,I=Symbol("OPAQUE"),_r=I;Promise.prototype[I]=!0;Date.prototype[I]=!0;Node.prototype[I]=!0;if(typeof Temporal<"u")for(let e of"Duration Instant PlainDate PlainDateTime PlainMonthDay PlainTime PlainYearMonth ZonedDateTime".split(" ")){let t=Temporal[e];t&&(t.prototype[I]=!0)}var he=$({});function Ur(e=1,t="rem"){for(let r=0;r<=12;r++)he[r]=2**(r-3)*e+t}var Br=/(\burl\([^)]*\))|("[^"]*")|(^| )\$([\w-]+)/g,qt=/^\d/;function zt(e){return e.indexOf("$")<0?e:e.replace(Br,(t,r,n,o,i)=>{if(r||n)return t;let a=qt.test(i)?`m${i}`:i;return`${o}var(--${a})`})}var we;function Kr(){if(!we){if(typeof window>"u"||!window.matchMedia)return!1;let e=window.matchMedia("(prefers-color-scheme: dark)");we=Oe({value:e.matches}),e.addEventListener("change",()=>we.value=e.matches)}return we.value}function me(e,t){if(I in e)return e;if(t&H&&w(e,P),e instanceof Array)return e.map(n=>Fe(n,t));if(e instanceof Map){let n=new Map;for(let[o,i]of e)n.set(o,Fe(i,t));return n}let r=Object.create(Object.getPrototypeOf(e));for(let n of Object.keys(e))r[n]=Fe(e[n],t);return r}function Fe(e,t){return typeof e=="object"&&e!==null?me(e,t):e}function nt(e){if(typeof e!="object"||e===null)return e;let t=0,r=e[p];return r&&(e=r,h!==re&&!be&&(t=H)),me(e,t)}var Dr={get(e,t){if(t===p)return Ie(at(e.proxy),e.index);if(t==="value")return e.proxy[e.index]},set(e,t,r){return t==="value"?(e.proxy[e.index]=r,!0):!1}};function Ie(e,t){return new Proxy({proxy:e,index:t},Dr)}function Gr(e,t){let r,n,o=e.getAttribute("type"),i=at(t).value;o==="checkbox"?(i===void 0&&(t.value=e.checked),r=()=>{e.checked=t.value},n=()=>{t.value=e.checked}):o==="radio"?(i===void 0&&e.checked&&(t.value=e.value),r=()=>{e.checked=t.value===e.value},n=()=>{e.checked&&(t.value=e.value)}):(n=()=>{t.value=o==="number"||o==="range"?e.value===""?null:+e.value:e.value},i===void 0&&n(),r=()=>{e.value=t.value,e.tagName==="SELECT"&&e.value!=t.value&&new Ve(()=>e.value=t.value)}),Gt(r),e.addEventListener("input",n),L(()=>{e.removeEventListener("input",n)})}var He=/\*\*(.+?)\*\*|\*(.+?)\*|`(.+?)`|\[(.+?)\]\((.+?)\)/g,Me={create:(e,t)=>{if(h===T)if(typeof t=="function")t(e);else{let r=t.split(".").filter(n=>n);e.classList.add(...r),(async()=>(e.offsetHeight,e.classList.remove(...r)))()}},destroy:(e,t)=>{rt.set(e,t)},html:(e,t)=>{if(e===h.el&&!e.firstChild)e.innerHTML=`${t}`;else{let r=document.createElement(h.el.tagName);for(r.innerHTML=`${t}`;r.firstChild;)F(e,r.firstChild)}},text:(e,t)=>{F(e,document.createTextNode(t))},rich:(e,t)=>{let r=0,n,o=String(t);for(He.lastIndex=0;(n=He.exec(o))!==null;){n.index>r&&F(e,document.createTextNode(o.slice(r,n.index)));let i;if(n[1]!==void 0)i=document.createElement("strong"),i.textContent=n[1];else if(n[2]!==void 0)i=document.createElement("em"),i.textContent=n[2];else if(n[3]!==void 0)i=document.createElement("code"),i.textContent=n[3];else{let a=document.createElement("a");a.textContent=n[4],a.href=n[5],i=a}F(e,i),r=He.lastIndex}r<o.length&&F(e,document.createTextNode(o.slice(r)))}};function Wr(){Me.create=Me.destroy=()=>{}}function k(...e){let t=h.el,r=h.svg,n=e.length;for(let o=0;o<n;o++){let i=e[o];if(!(i==null||i===!1))if(typeof i=="string"){let a=i.length,l=0;for(let c=0;c<a;c=l+1){l=J(i," .=:#",c);let m=i[l];if(m===":"){let d="$"+i.substring(c,l);if(l+1>=a){M(t,d,e[++o]);break}if(i[l+1]===" "){let f=J(i,";",l+2),u=i.substring(l+2,f).trim();M(t,d,u),l=f}else{let f=J(i," ",l+1),u=i.substring(l+1,f);M(t,d,u),l=f}}else if(m==="="){let d=i.substring(c,l);if(l+1>=a){M(t,d,e[++o]);break}let f=i[l+1];if(f==='"'||f==="'"||f==="`"){let u=J(i,f,l+2),g=i.substring(l+2,u);M(t,d,g),l=u}else{let u=J(i," ",l+1),g=i.substring(l+1,u);M(t,d,g),l=u}}else{if(l>c){let d=i.substring(c,l);r||=d==="svg";let f=r?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d);F(t,f),t=f}if(m==="#"){let d=l+1<a?i.substring(l+1):e[++o];M(t,"text",d);break}if(m==="."){let d=J(i," #=.",l+1);if(i[d]==="="&&d+1>=a)M(t,i.substring(l,d),e[++o]),l=d;else{let u=i.substring(l+1,d)||e[++o];t.classList.contains(u)||(t===h.el&&X(h,0,u,!1),t.classList.add(u)),l=d-1}}}}}else if(typeof i=="object")if(i.constructor!==Object)if(i instanceof Node)F(t,i),i instanceof Element&&(t=i,r=i.namespaceURI==="http://www.w3.org/2000/svg");else throw new Error(`Unexpected argument: ${i}`);else for(let a of Object.keys(i))M(t,a,i[a]);else if(typeof i=="function")new Ce(t,r,i);else throw new Error(`Unexpected argument: ${i}`)}return t}function J(e,t,r){if(t.length===1){let o=e.indexOf(t,r);return o>=0?o:e.length}let n=e.length;for(let o=r;o<n;o++)if(t.indexOf(e[o])>=0)return o;return n}var _t=0;function Fr(e){let t=`.AbdStl${++_t}`,r=typeof e=="string"?it(e,t):Te(e,t);if(r){let n=Ut++;te[n]=r,L(()=>delete te[n])}return t}var te=Oe({}),Ut=0;function Tt(e,t){let r=[];for(let n of e.split(","))for(let o of t.split(","))r.push(o.includes("&")?o.trim().replace(/&/g,n):`${n} ${o.trim()}`.trim());return r.join(",")}function Te(e,t){let r="";for(let[n,o]of Object.entries(e))o&&typeof o=="object"?n.startsWith("@")?r+=`${n}{
2
+ ${Te(o,t)}}
3
+ `:r+=Te(o,Tt(t,n)):typeof o=="string"&&(n.startsWith("@")?r+=`${n}{
4
+ ${it(o,t)}}
5
+ `:r+=it(o,Tt(t,n)));return r}var Hr=/-([a-z])/g;function Vr(e){return e.replace(Hr,(t,r)=>r.toUpperCase())}var Yr=/^[a-zA-Z-]+$/;function it(e,t){let r="";for(let n=0,o=e.length;n<o;){for(;e[n]===" ";)n++;if(n>=o)break;let i=e.indexOf(":",n);if(i===-1)throw new Error(`Trailing data in style string: "${e.substring(n)}"`);let a=e.substring(n,i);if(!Yr.test(a))throw new Error(`Invalid CSS key: "${a}" in style string: "${e}"`);n=i+1;let l;if(e[n]===" "){n++;let d=e.indexOf(";",n);l=e.substring(n,d===-1?o:d).trim(),n=d===-1?o:d+1}else{let d=e.indexOf(" ",n);l=e.substring(n,d===-1?o:d),n=d===-1?o:d}let c=zt(l),m=Bt[a]||a;r+=typeof m=="string"?`${m}:${c};`:m.map(d=>`${d}:${c};`).join("")}return r?`${t}{${r}}
6
+ `:""}function Qr(e){let t=Te(e,"");if(t){let r=Ut++;te[r]=t,L(()=>delete te[r])}}var Bt={m:"margin",mt:"margin-top",mb:"margin-bottom",ml:"margin-left",mr:"margin-right",mh:["margin-left","margin-right"],mv:["margin-top","margin-bottom"],p:"padding",pt:"padding-top",pb:"padding-bottom",pl:"padding-left",pr:"padding-right",ph:["padding-left","padding-right"],pv:["padding-top","padding-bottom"],w:"width",h:"height",bg:"background",fg:"color",r:"border-radius"};function M(e,t,r){if(typeof r=="object"&&r!==null&&r[p])t==="bind"?Gr(e,r):new Je(e,t,r);else if(t[0]==="."){let n=t.substring(1).split("."),o=e.classList,i=!!r;if(e===h.el)for(let a of n){let l=o.contains(a);l!==i&&X(h,0,a,l)}i?o.add(...n):o.remove(...n)}else if(t[0]==="$"){t=t.substring(1);let n=r==null||r===!1?"":typeof r=="string"?zt(r):String(r),o=Bt[t]||t,i=e.style,a=e===h.el,l=typeof o=="string"?[o]:o;for(let c of l){let m=Vr(c);a&&X(h,1,m,i[m]),i[m]=n}}else r==null||(t in Me?Me[t](e,r):typeof r=="function"?(e.addEventListener(t,r),e===h.el&&X(h,4,t,r)):r===!0||r===!1||t==="value"||t==="selectedIndex"?(e===h.el&&X(h,2,t,e[t]),e[t]=r):(e===h.el&&X(h,3,t,e.getAttribute(t)),e.setAttribute(t,r)))}function Kt(e){return console.error("Error while in Aberdeen render:",e),!0}var Dt=Kt;function Jr(e){Dt=e||Kt}function L(e){h.cleaners.push(e)}function Gt(e){return new Qe(e).result}function Wt(e,t){new Ye(e,t)}function Xr(){re.remove(),_t=0}function Ft(e,t){be++;try{return arguments.length===1?e():e instanceof Map?e.get(t):e[t]}finally{be--}}function Zr(e,t){let r;return e instanceof Array?r=$([]):e instanceof Map?r=$(new Map):r=$({}),ne(e,(n,o)=>{let i=t(n,o);i!==void 0&&(r instanceof Map?(r.set(o,i),L(()=>{r.delete(o)})):(r[o]=i,L(()=>{delete r[o]})))}),r}function en(e,t){let r=$({});return ne(e,(n,o)=>{let i=t(n,o);if(i){for(let a of Object.keys(i))r[a]=i[a];L(()=>{for(let a of Object.keys(i))delete r[a]})}}),r}function tn(e,t){let r={},n=$(r);return ne(e,(o,i)=>{let a=t(o,i);if(a!=null){let l=a instanceof Array?a:[a];if(l.length){for(let c of l)r[c]?n[c][i]=o:n[c]={[i]:o};L(()=>{for(let c of l)delete n[c][i],et(r[c])&&delete n[c]})}}}),n}function rn(e){let t=ve;ve||=new Set;try{Ht(e,ve)}finally{ve=t}return e}var ve;function Ht(e,t){if(e&&typeof e=="object"){let r=e.constructor.name||"unknown object";if(t.has(e)){k(`#<${r}: circular reference>`);return}t.add(e),L(()=>t.delete(e));let n=e[ct];n!==void 0?typeof n=="function"?n.call(e):k(`#${n}`):k(`#<${r}>`,"ul",()=>{ne(e,(o,i)=>{k("li",()=>{e instanceof Array||k(`#${JSON.stringify(i)}: `),Ht(o,t)})})})}else k(e===void 0?"#undefined":"#"+JSON.stringify(e))}var ct=Symbol("CUSTOM_DUMP");Date.prototype[ct]=function(){k("#<Date> "+this.toISOString())};function Ot(e){throw new Error(`Aberdeen internal error ${e}`)}function ft(e,t){try{Dt(e)===!1&&(t=!1)}catch(r){console.error(r)}try{t&&k("div.aberdeen-error#Error")}catch{}}typeof document<"u"&&ot(()=>{k(()=>{$e(te)&&$e(he)||Wt(document.head,()=>{k("style.abd",()=>{ne(te,e=>{k("#",e)}),k(()=>{if($e(he))return;let e=":root{";for(let[t,r]of Object.entries(he)){let n=qt.test(String(t))?`m${t}`:t;e+=`--${n}:${r};`}e+=`}
7
+ `,k("#",e)})})})})});var s=Object.assign(k,{clean:L,clone:nt,copy:qr,count:Rr,cssVars:he,CUSTOM_DUMP:ct,darkMode:Kr,derive:Gt,disableCreateDestroy:Wr,dump:rn,insertCss:Fr,insertGlobalCss:Qr,invertString:Er,isEmpty:$e,map:Zr,merge:zr,mount:Wt,multiMap:en,OPAQUE:I,NO_COPY:_r,onEach:ne,partition:tn,peek:Ft,proxy:Oe,ref:Ie,runQueue:Nt,setErrorHandler:Jr,setSpacingCssVars:Ur,unmountAll:Xr,unproxy:at});var ut="staffa:darkMode",Vt=s.proxy({value:nn()});function nn(){try{let e=localStorage.getItem(ut);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function dt(e){Vt.value=e;try{e===void 0?localStorage.removeItem(ut):localStorage.setItem(ut,e?"dark":"light")}catch{}}function Ne(e=!1){let t=Vt.value;return t===void 0&&!e?s.darkMode():t}s(()=>{Ne()?s.insertGlobalCss({":root":"--s-primary:#8b7bff --s-secondary:#ef7fd0 --s-danger:#ff6b6b --s-success:#46d39a --s-warning:#fbbf24 --s-neutral:#3c4352 --s-page:#0e1015 --s-panel:#181b22 --s-raised:#222632 --s-ink:#e8eaf0 --s-on-accent:#0c0a14 --s-focus:rgba(139,123,255,0.45) --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 34px rgba(0,0,0,0.5);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#6db3ff"}):s.insertGlobalCss({":root":"--s-primary:#6c5ce7 --s-secondary:#d6459e --s-danger:#e23b3b --s-success:#1f9d6b --s-warning:#d97706 --s-neutral:#c7ccda --s-page:#f3f4f8 --s-panel:#ffffff --s-raised:#eceef4 --s-ink:#1b1e27 --s-on-accent:#0c0a14 --s-focus:rgba(108,92,231,0.35) --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 30px rgba(20,24,40,0.13);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#2563eb"})});s.setSpacingCssVars();s.insertGlobalCss({":root":"--s-gradient: linear-gradient(135deg, $s-primary, $s-secondary); --s-glow: 0 8px 24px color-mix(in srgb, $s-primary 32%, transparent); --s-page-bg: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, $s-secondary, transparent 86%), transparent 56%), radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, $s-primary, transparent 87%), transparent 56%), $s-page;",":root, .s-s.base":"--s-a:$s-ink --s-b:$s-page",".s-s.base":"background: $s-page-bg;",".s-s.panel":"--s-a:$s-ink --s-b:$s-panel",".s-s.raised":"--s-a:$s-ink --s-b:$s-raised",".s-s.neutral":"--s-a:$s-ink --s-b:$s-neutral",".s-s.primary":"--s-a:$s-on-accent --s-b:$s-primary",".s-s.secondary":"--s-a:$s-on-accent --s-b:$s-secondary",".s-s.danger":"--s-a:$s-on-accent --s-b:$s-danger",".s-s.success":"--s-a:$s-on-accent --s-b:$s-success",".s-s.warning":"--s-a:$s-on-accent --s-b:$s-warning",".s-s.gradient":"--s-a:$s-on-accent --s-b:$s-primary",":root, .s-s":"--s-fg:$s-a --s-bg:$s-b --s-fg-muted: color-mix(in oklab, $s-fg, $s-bg 42%); --s-fg-faint: color-mix(in oklab, $s-fg, $s-bg 64%); --s-border: color-mix(in oklab, $s-fg, $s-bg 82%); --s-border-strong: color-mix(in oklab, $s-fg, $s-bg 68%); scrollbar-width:thin scrollbar-color: $s-border-strong transparent; background:$s-bg color:$s-fg",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover":"background:$s-fg-faint background-clip:padding-box",".s-s.tonal":"--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent);",".s-s.outlined":"--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg);",".s-s.filled":"--s-fg:$s-a --s-bg:$s-b background:$s-bg;",".s-s.gradient:not(.tonal):not(.outlined)":"background: $s-gradient;",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-accent:$s-primary",".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient":"--s-accent:$s-fg --s-link:$s-fg"});s.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased",a:"color: $s-link; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select":"font:inherit color:inherit","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-fg, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-fg, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-border;","::placeholder":"color: $s-fg-faint; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-fg-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"}});s.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let e=document.documentElement;e.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>e.classList.remove("s-preload")))}var sn="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";s.insertGlobalCss({[`${sn}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-fg-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-border; padding-left: $3; fg: $s-fg-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-border; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-border-strong;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-fg-muted font-size:0.9em margin-top:$1 text-align:center"});var on=0;function j(e="s"){return`${e}-${++on}`}function b(e,...t){e!=null&&(typeof e=="function"?e(...t):s("rich=",e))}s.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-fg user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-fg-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color:$s-border-strong","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&:disabled":"opacity:0.6 cursor:not-allowed","&[aria-invalid=true]":"border-color:$s-danger"}});function G(e,t){let r=e.id??j("field"),n=()=>!!e.error;s("div.s-field",e.attrs,()=>{s(()=>{e.label!=null&&s(`label for=${r}`,()=>{b(e.label),e.required&&s("span.s-req aria-hidden=true #*")})}),t(r,n),s(()=>{e.help!=null&&!e.error&&s("div.s-help",()=>b(e.help))}),s(()=>{e.error&&s("div.s-error role=alert #",e.error)})})}function ie(e,t,r,n){s(`id=${t}`),e.name&&s(`name=${e.name}`),s(()=>{e.disabled&&s("disabled=true")}),s(()=>{e.required&&s("aria-required=true")}),s(()=>s("aria-invalid=",r()?"true":"false")),n&&s("bind=",n)}s.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color:$s-border-strong","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em bg:$s-raised border: 1px solid $s-border; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-fg background:$s-border",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0 bg:$s-panel border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-fg-muted"}});function an(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function Yt(e){let t=j("ac-menu"),r=s.proxy({query:"",open:!1,active:0}),n=()=>(typeof e.options=="function"?e.options():e.options).map(an),o=()=>{let f=e.bind?.value;return f==null||f===""?[]:Array.isArray(f)?f:[f]},i=f=>n().find(u=>u.value===f)?.label??f;if(!e.multi){let f=e.bind?s.peek(e.bind,"value"):void 0;typeof f=="string"&&f&&(r.query=s.peek(()=>i(f)))}let a=()=>{let f=new Set(o()),u=n();e.multi&&(u=u.filter(v=>!f.has(v.value)));let g=r.query.trim().toLowerCase();return g&&(u=u.filter(v=>v.label.toLowerCase().includes(g))),u},l=(f,u)=>{if(e.multi){let g=Array.isArray(e.bind?.value)?[...e.bind.value]:[];g.includes(f)||g.push(f),e.bind&&(e.bind.value=g),r.query=""}else e.bind&&(e.bind.value=f),r.query=i(f),r.open=!1;r.active=0,u?.focus()},c=f=>{if(!e.bind)return;let u=e.bind.value??[];e.bind.value=u.filter(g=>g!==f)};G(e,(f,u)=>{s("div.s-ac",e.inputAttrs,()=>{s(()=>s("aria-invalid=",u()?"true":"false"));let g;s("div.s-control",()=>{s("click=",()=>g?.focus()),s(()=>{if(e.multi)for(let v of o())s("span.s-chip",()=>{s("span #",s.peek(()=>i(v))),s("button type=button aria-label=",`Remove ${v}`,()=>{s("#\xD7"),s("click=",A=>{A.stopPropagation(),c(v),g?.focus()})})})}),g=s("input type=text role=combobox autocomplete=off",()=>{s(`id=${f} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&s("placeholder=",e.placeholder),e.disabled&&s("disabled=true"),e.required&&s("aria-required=true"),s("bind=",s.ref(r,"query")),s(()=>s("aria-expanded=",r.open?"true":"false")),s(()=>{let A=a()[r.active];s("aria-activedescendant=",r.open&&A?`${t}-opt-${r.active}`:"")}),s("input=",()=>{r.open=!0,r.active=0}),s("focus=",()=>{r.open=!0}),s("blur=",()=>{setTimeout(()=>d(),150)}),s("keydown=",v=>m(v,g))})}),s(()=>{if(!r.open)return;let v=a(),A=r.query.trim(),St=e.allowCustom!==!1&&A!==""&&!v.some(Q=>Q.label.toLowerCase()===A.toLowerCase());s("ul.s-menu role=listbox",`id=${t}`,()=>{v.forEach((Q,We)=>{s("li.s-option role=option",`id=${t}-opt-${We}`,()=>{s(()=>s("aria-selected=",r.active===We?"true":"false")),s("#",Q.label),s("mousedown=",Cr=>Cr.preventDefault()),s("click=",()=>l(Q.value,g)),s("mousemove=",()=>{r.active=We})})}),St&&s("li.s-option.s-add role=option",()=>{s("#",`Add "${A}"`),s("mousedown=",Q=>Q.preventDefault()),s("click=",()=>l(A,g))}),v.length===0&&!St&&s("li.s-empty #No matches")})}),s(()=>{if(e.name)if(e.multi)for(let v of o())s("input type=hidden",()=>{s("name=",e.name),s("value=",v)});else s("input type=hidden",()=>{s("name=",e.name),s("value=",o()[0]??"")})})})});function m(f,u){let g=a(),v=g.length-1;if(f.key==="ArrowDown")f.preventDefault(),r.open=!0,r.active=Math.min(v,r.active+1);else if(f.key==="ArrowUp")f.preventDefault(),r.active=Math.max(0,r.active-1);else if(f.key==="Enter"){f.preventDefault();let A=g[r.active];A?l(A.value,u):e.allowCustom!==!1&&r.query.trim()?l(r.query.trim(),u):r.open&&(r.open=!1)}else if(f.key==="Escape")r.open=!1,e.multi||(r.query=i(o()[0]??""));else if(f.key==="Backspace"&&e.multi&&r.query===""){let A=o();A.length&&c(A[A.length-1])}}function d(){r.open=!1,e.multi?r.query="":e.allowCustom!==!1&&r.query.trim()?l(r.query.trim()):r.query=i(o()[0]??"")}}s.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column border: 1px solid $s-border; r: $s-radius-lg; overflow:hidden box-shadow: $s-shadow;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600","> footer":"display:flex align-items:center gap:$2 padding: $2 $3; border-top: 1px solid $s-border;","> div":"p:$3 gap:$3"}});function Qt(e={}){let t=typeof e=="function"?{content:e}:e;s("section.s-box.s-s.panel",t.attrs,()=>{s(()=>{t.header!=null&&s("header.s-s.raised",t.headerAttrs,()=>b(t.header))}),s("div",t.contentAttrs,()=>{t.content&&t.content()}),s(()=>{t.footer!=null&&s("footer.s-s.raised",t.footerAttrs,()=>b(t.footer))})})}s.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none border: 1px solid $s-border; r: $s-radius; padding: 0.5em 1em; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus;","&:disabled, &[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none filter:saturate(0.6)","&:hover":"filter: brightness(1.08); transform: translateY(-1px)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-b 26%, transparent);","&.gradient:not(.tonal):not(.outlined)":"border:0 box-shadow: $s-glow;","&.gradient:not(.tonal):not(.outlined):hover":"filter: brightness(1.06); box-shadow: 0 10px 28px color-mix(in srgb, $s-primary 42%, transparent); transform: translateY(-1px);","&:active:not(:disabled):not([aria-disabled=true])":"transform: translateY(1px)","&.small, .small > &":"padding: 0.32em 0.7em; font-size:0.85em","&.large, .large > &":"padding: 0.66em 1.3em; font-size:1.1em"}});var ln=/\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;function R(e={}){let t=typeof e=="string"?{text:e}:typeof e=="function"?{content:e}:e,r=t.href!=null?"a":"button",n=t.attrs&&ln.test(t.attrs)?"":".gradient";s(`${r}.s-btn.s-s${n}`,t.attrs,()=>{t.href!=null?(s(`href=${t.href} role=button`),t.disabled&&s("aria-disabled=true")):(s("type=",t.type??"button"),t.disabled&&s("disabled=true")),t.ariaLabel&&s("aria-label=",t.ariaLabel),t.click&&s("click=",t.click),b(t.icon),t.content?t.content():t.text!=null&&s("#",t.text)})}s.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function W(e={}){let r=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;s(`div.s-bgroup${r} role=group`,e.attrs,()=>{if(e.buttons)for(let n of e.buttons)R(n);e.content&&e.content()})}function Jt(e){s(()=>{let t=e.bind.value;W({attrs:e.attrs,buttons:Object.entries(e.options).map(([r,n])=>({text:typeof n=="string"?n:void 0,content:typeof n=="function"?n:void 0,attrs:t===r?".primary":".neutral .outlined",click:()=>{e.bind.value=e.allowDeselect&&t===r?null:r}}))})}),e.name&&s(()=>s(`input type=hidden name=${e.name} value=`,e.bind.value??""))}s.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.6",input:"width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0"}});function Xt(e={}){let t=e.id??j("check");s("div.s-check",e.attrs,()=>{s(`label for=${t}`,()=>{s("input type=checkbox",e.inputAttrs,()=>{s(`id=${t}`),e.name&&s(`name=${e.name}`),e.checked&&!e.bind&&s("checked=true"),e.change&&s("change=",e.change),s(()=>{e.disabled&&s("disabled=true")}),s(()=>{e.required&&s("aria-required=true")}),e.bind&&s("bind=",e.bind)}),s(()=>{e.label!=null&&b(e.label),e.required&&s("span.s-req aria-hidden=true #*")})}),s(()=>{e.help!=null&&!e.error&&s("div.s-help",()=>b(e.help))}),s(()=>{e.error&&s("div.s-error role=alert #",e.error)})})}s.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center gap:$2 flex-wrap:wrap margin-top:$1"}});function Zt(e={}){let t=typeof e=="function"?{content:e}:e;s("form.s-form",t.attrs,()=>{s(()=>{s(".grid=",t.layout==="grid")}),s("submit=",r=>{if(r.preventDefault(),t.submit){let n=new FormData(r.target),o={};for(let i of new Set(n.keys())){let a=n.getAll(i);o[i]=a.length===1?a[0]:a}t.submit(o,r)}}),t.content&&t.content(),s(()=>{t.actions&&s("footer",t.actionsAttrs,()=>t.actions?.())})})}var gt=()=>{};var pt=typeof ABERDEEN_FAKE_WINDOW<"u"?ABERDEEN_FAKE_WINDOW:window,z=pt.location,V=pt.history;function er(){return tr({path:z.pathname,hash:z.hash,search:Object.fromEntries(new URLSearchParams(z.search)),state:V.state?.state||{}},"load",(V.state?.stack?.length||0)+1)}function ht(e,t,r){if(e===t)return!0;if(typeof e!="object"||!e||typeof t!="object"||!t||e.constructor!==t.constructor)return!1;if(t instanceof Array){if(e.length!==t.length)return!1;for(let n=0;n<t.length;n++)if(!ht(e[n],t[n],r))return!1}else{for(let n of Object.keys(t))if(!ht(e[n],t[n],r))return!1;if(!r){for(let n of Object.keys(e))if(!t.hasOwnProperty(n))return!1}}return!0}function cn(e){let t=new URLSearchParams(e.search).toString();return(t?`${e.path}?${t}`:e.path)+e.hash}function tr(e,t,r){let n=e.path||(e.p||[]).join("/")||"/";return n=(""+n).replace(/\/+$/,""),n.startsWith("/")||(n=`/${n}`),{path:n,hash:e.hash&&e.hash!=="#"?e.hash.startsWith("#")?e.hash:"#"+e.hash:"",p:n.length>1?n.slice(1).replace(/\/+$/,"").split("/"):[],nav:t,search:typeof e.search=="object"&&e.search?s.clone(e.search):{},state:typeof e.state=="object"&&e.state?s.clone(e.state):{},depth:r}}function fn(e,t=!1){if(typeof e=="string"){let r=new URL(e,z.href);if(r.host!==z.host){if(t)return;throw new Error(`Unexpected external URL: ${r.host} != ${z.host}`)}e={path:r.pathname,search:Object.fromEntries(r.searchParams),hash:r.hash}}else e instanceof Array&&(e={p:e});if(e.p&&(e.p=e.p.map(String)),e.search)for(let r of Object.keys(e.search))e.search[r]=String(e.search[r]);return e}function rr(e){let t=fn(e,!0);if(!t)return!1;if(t.path!=null||t.p!=null){let r=t.path||(t.p||[]).join("/")||"/";if(r=(""+r).replace(/\/+$/,""),r.startsWith("/")||(r=`/${r}`),!mt[r])return!1}if(t.search){for(let[r,n]of Object.entries(t.search))if(!mt[`${r}=${n}`])return!1}return!0}var se,un=0;var q=s.proxy({}),mt=s.proxy({});function dn(){se=V.state?.stack||[];let e=er();gt("initial",e),s.copy(s.unproxy(q),e)}dn();pt.addEventListener("popstate",function(e){un=0;let t=er(),r=V.state?.stack||[];if(r.length!==se.length){let n=Math.min(se.length,r.length)-1;(n<0||r[n]===se[n])&&(t.nav=r.length<se.length?"back":"forward")}se=r,gt("popstate",t),s.copy(q,t),s.runQueue()});ot(()=>{s(()=>{q.path="/"+Array.from(q.p).join("/")}),s(()=>{let e=V.state?.stack||[],t=tr(q,s.unproxy(q).nav,e.length+1);s.copy(q,t);let r={state:t.state,stack:e},n=cn(t);(n!==z.pathname+z.search+z.hash||!ht(V.state,r,!1))&&(gt("replaceState",t,r,n),V.replaceState(r,"",n))}),s(()=>{let e={};e[q.path]=!0;for(let[t,r]of Object.entries(q.search))e[`${t}=${r}`]=!0;s.copy(mt,e)})});s.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 border: 1px solid $s-border; r:$s-radius-lg box-shadow:$s-shadow overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item, .s-menu-item-link":"display:flex align-items:center gap:$2 w:100% padding: 0.5em 0.65em; r:$s-radius cursor:pointer text-align:left font-size:0.9em border:0 background:transparent fg:$s-fg text-decoration:none transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;",".s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page]), .s-menu-item-link:hover:not([aria-current=page])":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-menu-item[aria-current=page], .s-menu-item-link[aria-current=page]":"color:$s-on-accent font-weight:600 background: $s-gradient; box-shadow: 0 3px 10px color-mix(in srgb, $s-primary 38%, transparent);",".s-menu-item[aria-current=page] .s-menu-icon, .s-menu-item-link[aria-current=page] .s-menu-icon":"color:$s-on-accent",".s-menu-item[aria-current=page]:hover, .s-menu-item-link[aria-current=page]:hover":"filter:brightness(1.06)",".s-menu-item:focus-visible, .s-menu-item-link:focus-visible":"outline:none background: color-mix(in srgb, $s-fg 10%, transparent); box-shadow: 0 0 0 2px inset $s-focus;",".s-menu-item[aria-disabled=true], .s-menu-item-link[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"fg:$s-fg-muted flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);"});function Le(e,t){s("keydown=",r=>{if(r.key!=="ArrowDown"&&r.key!=="ArrowUp"&&r.key!=="Home"&&r.key!=="End")return;r.preventDefault();let o=[...r.currentTarget.querySelectorAll(".s-menu-item, .s-menu-item-link")].filter(c=>c.getAttribute("aria-disabled")!=="true");if(!o.length)return;let i=o.indexOf(document.activeElement),a=r.key==="ArrowUp"?-1:1,l=r.key==="Home"?0:r.key==="End"?o.length-1:i<0?a>0?0:o.length-1:(i+a+o.length)%o.length;o[l].focus()});for(let r of e){if(typeof r=="function"){r();continue}if("separator"in r){s("hr.s-menu-sep");continue}s(r.href?"a.s-menu-item-link":"button.s-menu-item type=button",r.attrs,()=>{r.href&&(s("href=",r.href),r.target&&s("target=",r.target),s(()=>{rr(r.href)&&s("aria-current=page")})),r.disabled&&s("aria-disabled=true"),s("click=",n=>{if(r.disabled){n.preventDefault();return}t?.(),r.click?.(n)}),r.icon&&s("span.s-menu-icon",()=>b(r.icon)),b(r.label)})}}var ae=s.proxy({opts:null});function oe(){let e=ae.opts?.anchor;ae.opts=null,e?.focus()}function hn(e,t){let r=e.offsetWidth,n=e.offsetHeight,o=window.innerWidth,i=window.innerHeight,a=4,l=t.left;l+r>o-8&&(l=Math.max(8,t.right-r));let c=t.bottom+a;c+n>i-8&&t.top-n-a>=8&&(c=t.top-n-a),e.style.left=Math.max(8,l)+"px",e.style.top=Math.max(8,c)+"px"}s.mount(document.body,()=>{let e=ae.opts;if(!e)return;let t=s("div.s-menu-list.s-s.panel create=hidden destroy=hidden",e.dropdownAttrs,()=>{Le(e.items,oe)}),r=o=>{let i=o.target;!t.contains(i)&&!e.anchor.contains(i)&&oe()},n=o=>{(o.key==="Escape"||o.key==="Tab")&&(o.preventDefault(),oe())};document.addEventListener("click",r,!0),document.addEventListener("keydown",n,!0),s.clean(()=>{document.removeEventListener("click",r,!0),document.removeEventListener("keydown",n,!0)}),requestAnimationFrame(()=>{document.body.contains(t)&&(hn(t,e.anchor.getBoundingClientRect()),t.querySelector(".s-menu-item:not([aria-disabled=true]), .s-menu-item-link:not([aria-disabled=true])")?.focus())})});function bt(e){return ae.opts=e,oe}function je(e){let t=null;s.clean(()=>{ae.opts?.anchor===t&&oe()}),R({icon:()=>s("span aria-hidden=true #\u2630"),ariaLabel:"Open menu",attrs:".neutral .outlined",...e.button,click:r=>{if(t=r.currentTarget,ae.opts?.anchor===t){oe();return}bt({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}s.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","> header":"border-bottom: 1px solid $s-border; position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-border; fg:$s-fg-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-header-icon":"display:flex align-items:center font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex:1","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header .s-subtitle":"fg:$s-fg-muted font-size:0.85em overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-menu":"display:flex align-items:center gap:$2",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center",".s-body-inner":"flex:1 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);","> main, .s-body main":"flex:1 overflow-y:auto display:flex flex-direction:column","> main > .s-content, .s-body main > .s-content":"width:100% flex:1 p:$3","> main.s-scroll-y, .s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1 background:transparent"},".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:none",".s-main.s-nav-btn-only .s-nav-panel":"display:none",".s-main.s-nav-btn-only .s-nav-trigger":"display:flex","@container (max-width: 640px)":{".s-main.s-nav-left .s-nav-panel, .s-main.s-nav-right .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:flex",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0"}});function ir(e={}){let t=e.nav,r=e.navPosition??"left",n=t!=null&&t.items.length>0,o=n?r==="button"?".s-nav-btn-only":`.s-nav-${r}`:"";s(`div.s-main.s-s.base${o}`,e.attrs,()=>{s(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||n)&&s("header.s-s.raised",e.topbarAttrs,()=>{s("div.s-bar",()=>{s(()=>{e.maxWidth!=null&&s("max-width:",e.maxWidth)}),s(()=>{n&&s("div.s-nav-trigger",()=>{je({...t,button:{icon:()=>s("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .outlined .small",...t.button}})})}),s(()=>{e.icon!=null&&s("div.s-header-icon",()=>b(e.icon))}),s("div.s-titles",()=>{s(()=>{e.title!=null&&s("div.s-title",()=>b(e.title))}),s(()=>{e.subtitle!=null&&s("div.s-subtitle",()=>b(e.subtitle))})}),s(()=>{e.menu&&s("div.s-menu",()=>e.menu?.())})})})}),n&&r!=="button"?s("div.s-body",()=>{s("div.s-body-inner",()=>{s(()=>{e.maxWidth!=null&&s("max-width:",e.maxWidth)}),s(`nav.s-nav-panel.s-s.raised.s-nav-${r}`,e.navAttrs,()=>{Le(t.items)}),s("div.s-nav-sep aria-hidden=true"),nr(e,!1)})}):nr(e,!0),s(()=>{e.footer!=null&&s("footer",()=>{s("div.s-bar",()=>{s(()=>{e.maxWidth!=null&&s("max-width:",e.maxWidth)}),b(e.footer)})})})})}function nr(e,t){let r=s("main",()=>{s("div.s-content",e.contentAttrs,()=>{t&&s(()=>{e.maxWidth!=null&&s("margin-inline:auto max-width:",e.maxWidth)}),e.content&&e.content()})});mn(r)}function mn(e){if(typeof ResizeObserver>"u")return;let t=()=>e.classList.toggle("s-scroll-y",e.offsetWidth>e.clientWidth),r=new ResizeObserver(t);r.observe(e),e.firstElementChild&&r.observe(e.firstElementChild),t(),s.clean(()=>r.disconnect())}function qe(e={}){G(e,(t,r)=>{s("input.s-input",e.inputAttrs,()=>{s("type=",e.type??"text"),e.placeholder!=null&&s("placeholder=",e.placeholder),e.autocomplete!=null&&s("autocomplete=",e.autocomplete),e.value!=null&&!e.bind&&s("value=",e.value),e.input&&s("input=",e.input),e.change&&s("change=",e.change),ie(e,t,r,e.bind)})})}s.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) border: 1px solid $s-border; r: $s-radius-lg; box-shadow: $s-shadow; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center gap:$2 padding: $2 $3; border-top: 1px solid $s-border; flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var Y=s.proxy({}),yt=0,gn=s.derive(()=>{let e=Object.keys(Y);if(e.length)return e[e.length-1]});s.mount(document.body,()=>{s.onEach(Y,({resolve:e,opts:t},r)=>{let n=()=>{delete Y[r]};s.clean(()=>{t.onClose?.(),e()});let o=s.derive(()=>gn.value!=r);s("div.s-backdrop create=hidden destroy=hidden .hidden=",o,"click=",()=>{t.allowCancel!==!1&&n()}),s("div.s-dialog.s-s.panel create=hidden destroy=hidden",t.attrs,()=>{s(()=>{t.header!=null&&s("header.s-s.raised",t.headerAttrs,()=>b(t.header))}),s("div",t.contentAttrs,()=>{b(t.content,n)}),s(()=>{t.footer!=null&&s("footer.s-s.raised",t.footerAttrs,()=>b(t.footer))})})})});function ye(e){yt||document.addEventListener("keydown",r=>{if(r.key==="Escape"&&e.allowCancel!==!1){let n=s.unproxy(Y);for(let o=yt;o>0;o--)if(n[o]){n[o].opts.allowCancel!==!1&&delete Y[o];break}}});let t=++yt;return e.cancelWithScope!==!1&&s.clean(()=>{delete Y[t]}),new Promise(r=>{Y[t]={resolve:r,opts:e}})}function sr(e,t={}){return ye({header:"Alert",allowCancel:!0,content:r=>{s("p",()=>{s("#",e)}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{R({text:"OK",click:r})}})},...t})}function or(e,t={}){return new Promise(r=>{let n=!1;ye({header:"Confirm",allowCancel:!0,content:o=>{s("p",()=>{s("#",e)}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{R({text:"Cancel",attrs:".neutral .outlined",click:o}),R({text:"OK",click:()=>{n=!0,o()}})}})},...t,onClose:()=>{r(n),t.onClose?.()}})})}function ar(e,t="",r={}){return new Promise(n=>{let o=null;ye({header:"Input",allowCancel:!0,content:i=>{s("p",()=>{s("#",e)});let a=s.proxy({value:t});s("form display:contents",()=>{s("submit=",l=>{l.preventDefault(),o=a.value,i()}),qe({bind:s.ref(a,"value")}),W({layout:"spaced",attrs:"align-self:flex-end",content:()=>{R({text:"Cancel",attrs:".neutral .outlined",type:"button",click:i}),R({text:"OK",type:"submit"})}})})},...r,onClose:()=>{n(o),r.onClose?.()}})})}s.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-fg-muted font-size:0.85em"}});function lr(e){G(e,(t,r)=>{s("div.s-select_wrap",e.inputAttrs,()=>{s("select.s-input",()=>{ie(e,t,r),s("change=",n=>{e.bind&&(e.bind.value=n.target.value)}),s(()=>{let n=typeof e.options=="function"?e.options():e.options,o=e.bind?.value??"";e.placeholder!=null&&s("option",()=>{s("value= disabled=true hidden=true"),o||s("selected=true"),s("#",e.placeholder)});for(let i of n){let a=typeof i=="string"?{value:i,label:i}:{value:i.value,label:i.label??i.value};s("option",()=>{s("value=",a.value),a.value===o&&s("selected=true"),s("#",a.label)})}})})})})}s.insertGlobalCss({".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tablist":"display:flex gap:$1 align-items:stretch overflow-x:auto scrollbar-width:none border-bottom: 1px solid $s-border;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-fg-muted; font-weight:600 padding: 0.6em 0.9em; border-bottom: 3px solid transparent; margin-bottom:-1px transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-fg;",".s-tab:disabled":"opacity:0.5 cursor:not-allowed",".s-tab:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function cr(e){let t=j("tabs"),r=(i,a)=>i.id??String(a),n=e.bind??s.proxy(r(e.tabs[0]??{label:""},0)),o=(i,a)=>{i.disabled||(n.value=r(i,a))};s("div.s-tabs",e.attrs,()=>{s("div.s-tablist role=tablist",()=>{e.tabs.forEach((i,a)=>{let l=r(i,a);s("button.s-tab type=button role=tab",()=>{s(`id=${t}-tab-${l} aria-controls=${t}-panel-${l}`),s(()=>{let c=n.value===l;s("aria-selected=",c?"true":"false"),s("tabindex=",c?"0":"-1")}),i.disabled&&s("disabled=true"),s("click=",()=>o(i,a)),s("keydown=",c=>pn(c,e.tabs,a,o)),b(i.icon),b(i.label)})})}),s("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{s(()=>{let i=n.value,a=e.tabs.findIndex((c,m)=>r(c,m)===i),l=e.tabs[a]??e.tabs[0];l&&(s(`id=${t}-panel-${r(l,a)} aria-labelledby=${t}-tab-${r(l,a)}`),l.content?.())})})})}function pn(e,t,r,n){let o=r;if(e.key==="ArrowRight"||e.key==="ArrowDown")o=(r+1)%t.length;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")o=(r-1+t.length)%t.length;else if(e.key==="Home")o=0;else if(e.key==="End")o=t.length-1;else return;e.preventDefault();let i=o>=r?1:-1;for(let a=0;a<t.length;a++){let l=t[o];if(l&&!l.disabled){n(l,o),e.currentTarget?.parentElement?.children[o]?.focus();return}o=(o+i+t.length)%t.length}}s.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function ur(e={}){let t=e.autoGrow!==!1;G(e,(r,n)=>{let o=s("textarea.s-input",e.inputAttrs,()=>{t?(s(".s-autoGrow"),s("input=",i=>{fr(i.currentTarget),e.input&&e.input(i)})):(s("rows=",e.rows??4),s("resize:",e.resize??"vertical"),e.input&&s("input=",e.input)),e.placeholder!=null&&s("placeholder=",e.placeholder),e.value!=null&&!e.bind&&s("value=",e.value),e.change&&s("change=",e.change),ie(e,r,n,e.bind)});t&&requestAnimationFrame(()=>fr(o))})}function fr(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}var ze=400,dr=`margin ${ze}ms ease-out, transform ${ze}ms ease-out`;function hr(e){if(e.parentElement){let t=getComputedStyle(e.parentElement);if(t.display==="flex"&&(t.flexDirection||"").startsWith("row"))return{marginLeft:`-${e.offsetWidth/2}px`,marginRight:`-${e.offsetWidth/2}px`,transform:"scaleX(0)"}}return{marginBottom:`-${e.offsetHeight/2}px`,marginTop:`-${e.offsetHeight/2}px`,transform:"scaleY(0)"}}async function mr(e){let t=hr(e);Object.assign(e.style,t),e.offsetHeight,e.style.transition=dr;for(let r in t)e.style[r]="";setTimeout(()=>{e.style.transition=""},ze)}async function gr(e){let t=hr(e);e.style.transition=dr,Object.assign(e.style,t),setTimeout(()=>{e.remove()},ze)}s.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow pointer-events:auto",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-msg":"font-size:0.9em fg:$s-fg-muted line-height:1.4",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-fg",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg"}});var bn=0,wt=s.proxy({});s.mount(document.body,()=>{s("div.s-toasts aria-live=polite aria-atomic=false",()=>{s.onEach(wt,e=>{let{opts:t}=e,r=t.type==="danger"||t.type==="warning"?"alert":"status",n=t.type??"neutral";s(`div.s-toast.s-s.${n} role=${r}`,"create=",mr,"destroy=",gr,t.attrs,()=>{s("div.s-toast-body",()=>{s(()=>{t.title!=null&&s("div.s-toast-title",()=>b(t.title))}),s("div.s-toast-msg",()=>b(t.message))}),s(()=>{t.dismissible!==!1&&s("button.s-toast-close type=button aria-label=Dismiss",()=>{s("#\xD7"),s("click=",()=>xt(e.id))})})})})})});function xt(e){delete wt[e]}function pr(e){let t=++bn;wt[t]={id:t,opts:e};let r=e.duration??4e3,n;return r>0&&(n=setTimeout(()=>xt(t),r)),()=>{n!=null&&clearTimeout(n),xt(t)}}s.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content bg:$s-raised fg:$s-fg border: 1px solid $s-border-strong; r:$s-radius box-shadow:$s-shadow padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var le=s.proxy(void 0),O=null;typeof window<"u"&&window.addEventListener("scroll",()=>{le.value=void 0},{capture:!0,passive:!0});function yn(e,t,r,n){let i=window.innerWidth,a=window.innerHeight,l=0,c=0;return n==="bottom"?(l=e.left+(e.width-t)/2,c=e.bottom+7,c+r>a-8&&(c=e.top-r-7)):n==="left"?(l=e.left-t-7,c=e.top+(e.height-r)/2,l<8&&(l=e.right+7)):n==="right"?(l=e.right+7,c=e.top+(e.height-r)/2,l+t>i-8&&(l=e.left-t-7)):(l=e.left+(e.width-t)/2,c=e.top-r-7,c<8&&(c=e.bottom+7)),{x:Math.max(8,Math.min(l,i-t-8)),y:Math.max(8,Math.min(c,a-r-8))}}function vt(){O&&clearTimeout(O),O=setTimeout(()=>{le.value=void 0,O=null},100)}s.mount(document.body,()=>{let e=le.value;if(!e)return;let{opts:t,anchor:r}=e,n=t.placement??"top",o=s("div.s-tt-tip role=tooltip visibility:hidden",t.attrs,()=>{s("mouseenter=",()=>{O&&(clearTimeout(O),O=null)}),s("mouseleave=",vt),b(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(o))return;let{x:i,y:a}=yn(r.getBoundingClientRect(),o.offsetWidth,o.offsetHeight,n);o.style.left=i+"px",o.style.top=a+"px",o.style.visibility=""})});function br(e){let t=r=>{O&&(clearTimeout(O),O=null),le.value={opts:e,anchor:r.currentTarget}};s("mouseenter=",t),s("mouseleave=",vt),s("focusin=",t),s("focusout=",vt),s.clean(()=>{le.value?.opts===e&&(le.value=void 0)})}var xn={main:ir,box:Qt,dialog:ye,alert:sr,confirm:or,prompt:ar,form:Zt,menuButton:je,showFloatingMenu:bt,textline:qe,textarea:ur,checkbox:Xt,tabs:cr,button:R,buttonChooser:Jt,buttonGroup:W,autocomplete:Yt,select:lr,toast:pr,addTooltip:br,setDarkMode:dt,getDarkMode:Ne},E=xn;var wn=new TextEncoder,$t=new TextDecoder("utf-8",{fatal:!0}),ce=Symbol("EOD"),Be="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_$",wr=new Uint8Array(128).fill(255);for(let e=0;e<Be.length;++e)wr[Be.charCodeAt(e)]=e;var Pt=typeof process<"u"&&process?.stdout?.isTTY,_e=Pt?["\x1B[32m","\x1B[33m","\x1B[34m","\x1B[35m"]:[""],vn=Pt?"\x1B[0m":"",yr=Pt?"\x1B[31m":"",xr={array:5,object:6,map:7,set:8,end:9},Ue=0,$n=typeof process<"u"?!!process.env?.DATAPACK_EXTENDED_LOGGING:!1,_=class e{buffer;dataView;readPos=0;writePos=0;static EOD=ce;get _buffer(){return this.buffer}constructor(t=1900){t instanceof Uint8Array?(this.buffer=t,this.writePos=t.length):this.buffer=new Uint8Array(t)}writeMultiByteNumber(t,r,n=!1,o=!1){let i=0,a=t;for(;a>0;)i++,a=Math.floor(a/256);let l=o?~i&31:i;this.buffer[this.writePos++]=r<<5|l;let c=1;for(let m=0;m<i;m++)c*=256;for(let m=0;m<i;m++){c=Math.floor(c/256);let d=Math.floor(t/c)%256;n&&(d^=255),this.buffer[this.writePos++]=d}}readMultiByteNumber(t,r=!1){this.readPos+t>this.writePos&&this.notEnoughData("number");let n=0,o=1;for(let i=t-1;i>=0;i--){let a=this.buffer[this.readPos+i];r&&(a^=255),n+=a*o,o*=256}return this.readPos+=t,n}notEnoughData(t){throw new Error(`Not enough data to read a ${t} at position ${this.readPos} in
8
+ ${this.toString(!0)}`)}write(t){if(this.ensureCapacity(33),typeof t=="number")Number.isInteger(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER?t>=0?t<32?this.buffer[this.writePos++]=32|t:t<64?this.buffer[this.writePos++]=64|t-32:this.writeMultiByteNumber(t-64,3):this.writeMultiByteNumber(-t,0,!0,!0):(this.buffer[this.writePos++]=128,this.dataView||=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),this.dataView.setFloat64(this.writePos,t),this.writePos+=8);else if(t===void 0)this.buffer[this.writePos++]=129;else if(t===null)this.buffer[this.writePos++]=130;else if(t===!0)this.buffer[this.writePos++]=131;else if(t===!1)this.buffer[this.writePos++]=132;else if(typeof t=="string"){let r=wn.encode(t);r.length<32?this.buffer[this.writePos++]=160|r.length:this.writeMultiByteNumber(r.length,6),this.ensureCapacity(r.length),this.buffer.set(r,this.writePos),this.writePos+=r.length}else if(t instanceof Uint8Array)this.writeMultiByteNumber(t.length,7),this.ensureCapacity(t.length),this.buffer.set(t,this.writePos),this.writePos+=t.length;else if(Array.isArray(t)||typeof t.length=="number"&&typeof t[Symbol.iterator]=="function"){this.buffer[this.writePos++]=133;for(let r of t)this.write(r);this.buffer[this.writePos++]=137}else if(t instanceof Map){this.buffer[this.writePos++]=135;for(let[r,n]of t)this.write(r),this.write(n);this.buffer[this.writePos++]=137}else if(t instanceof Set){this.buffer[this.writePos++]=136;for(let r of t)this.write(r);this.buffer[this.writePos++]=137}else if(t instanceof Date)this.buffer[this.writePos++]=140,this.write(Math.floor(t.getTime()/1e3));else if(typeof t=="object")t instanceof xe?this.writeCustom(t.name,t.data):typeof t.toDataPack=="function"?t.toDataPack(this):this.writeAsObject(t);else throw new Error(`Unsupported data type: ${typeof t}`);return this}read(t){if(this.readPos>this.writePos)throw new Error("Not enough data");let r=this.buffer[this.readPos++],n=r>>5&7,o=r&31;switch(n){case 0:{let i=~o&31;return-this.readMultiByteNumber(i,!0)}case 1:return o;case 2:return o+32;case 3:return this.readMultiByteNumber(o)+64;case 4:switch(o){case 0:{this.readPos+8>this.writePos&&this.notEnoughData("float64"),this.dataView||=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength);let i=this.dataView.getFloat64(this.readPos);return this.readPos+=8,i}case 1:return;case 2:return null;case 3:return!0;case 4:return!1;case 5:{let i=[];for(;;){let a=this.read(t);if(a===ce)break;i.push(a)}return i}case 6:{let i={};for(;;){let a=this.read(t);if(a===ce)break;let l=this.read(t);i[a]=l}return i}case 7:{let i=new Map;for(;;){let a=this.read(t);if(a===ce)break;let l=this.read(t);i.set(a,l)}return i}case 8:{let i=new Set;for(;;){let a=this.read(t);if(a===ce)break;i.add(a)}return i}case 9:return ce;case 10:return--this.readPos,this.readIdentifier();case 11:{let i=this.readPos,a=i;for(;a>=this.writePos&&this.notEnoughData("null-terminated string"),this.buffer[a]!==0;)a++;return this.readPos=a+1,$t.decode(this.buffer.subarray(i,a))}case 12:{let i=this.readPositiveInt();return new Date(i*1e3)}case 13:{let i=this.readString(),a=this.read();return t&&i in t?t[i](a):new xe(i,a)}default:throw new Error(`Unknown type 4 subtype: ${o}`)}case 5:{let i=o;this.readPos+i>this.writePos&&this.notEnoughData("short string");let a=this.buffer.subarray(this.readPos,this.readPos+i);return this.readPos+=i,$t.decode(a)}case 6:{let i=this.readMultiByteNumber(o);this.readPos+i>this.writePos&&this.notEnoughData("string");let a=this.buffer.subarray(this.readPos,this.readPos+i);return this.readPos+=i,$t.decode(a)}case 7:{let i=this.readMultiByteNumber(o);this.readPos+i>this.writePos&&this.notEnoughData("blob");let a=this.buffer.slice(this.readPos,this.readPos+i);return this.readPos+=i,new Uint8Array(a)}default:throw new Error(`Unknown type: ${n}`)}}ensureCapacity(t){let r=this.writePos+t;if(r<=this.buffer.length)return;let n=Math.max(r,Math.floor(this.buffer.length*1.5)),o=new Uint8Array(n);o.set(this.buffer.subarray(0,this.writePos)),this.buffer=o,delete this.dataView}readNumber(){let t=this.read();if(typeof t!="number")throw new Error("Expected number but got "+typeof t);return t}readDate(){let t=this.read();if(!(t instanceof Date))throw new Error("Expected Date but got "+typeof t);return t}readPositiveInt(t){let r=this.read();if(typeof r!="number"||!Number.isInteger(r)||r<0||t!==void 0&&r>=t)throw new Error(`Expected positive integer < ${t} but got ${r}`);return r}readBoolean(){let t=this.read();if(typeof t!="boolean")throw new Error("Expected boolean but got "+typeof t);return t}readUint8Array(){let t=this.read();if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array but got "+typeof t);return t}readString(){let t=this.read();if(typeof t!="string")throw new Error("Expected string but got "+typeof t);return t}writeIdentifier(t){let r=0;if(typeof t=="number")r=t;else{if(t.length!==8)throw new Error(`Identifier must be exactly 8 characters, got ${t.length}`);let n;for(let o=0;o<8;o++){let i=t.charCodeAt(o);if(i>127||(n=wr[i])===255)throw new Error(`Invalid base64 character: ${t[o]}`);r=r*64+n}}this.ensureCapacity(7),this.buffer[this.writePos++]=138;for(let n=5;n>=0;n--)this.buffer[this.writePos+n]=r%256,r=Math.floor(r/256);return this.writePos+=6,this}readIdentifier(){let t=this.readIdentifierNumber(),r="";for(let n=0;n<8;n++)r=Be[t%64]+r,t=Math.floor(t/64);return r}readIdentifierNumber(){if(this.readPos+7>this.writePos&&this.notEnoughData("identifier"),this.buffer[this.readPos++]!==138)throw new Error("Invalid identifier header");let r=0;for(let n=0;n<6;n++)r=r*256+this.buffer[this.readPos++];return r}writeOrderedString(t){let r=new TextEncoder().encode(t);if(r.includes(0))throw new Error("String contains null character");return this.ensureCapacity(r.length+2),this.buffer[this.writePos++]=139,this.buffer.set(r,this.writePos),this.writePos+=r.length,this.buffer[this.writePos++]=0,this}toUint8Array(t=!0,r=0,n=this.writePos){return t?this.buffer.slice(r,n):this.buffer.subarray(r,n)}toBuffer(){return this.buffer.buffer.slice(0,this.writePos)}clone(t,r=0,n=this.writePos){if(t)return new e(this.buffer.slice(r,n));{let o=new e(this.buffer);return o.readPos=r,o.writePos=n,o}}writeCustom(t,r){this.buffer[this.writePos++]=141,this.write(t),this.write(r)}writeAsObject(t){this.buffer[this.writePos++]=134;for(let r of Object.keys(t))this.write(r),this.write(t[r]);return this.buffer[this.writePos++]=137,this}writeCollection(t,r){return this.writeCollectionBoundary(t),r(t==="array"||t==="set"?n=>{this.write(n)}:t==="object"?(n,o)=>{this.writeObjectKey(n),this.write(o)}:(n,o)=>{this.write(n),this.write(o)}),this.writeCollectionBoundary("end")}writeCollectionBoundary(t){let r=xr[t];if(!r)throw new Error(`Invalid collection type: ${t}`);return this.buffer[this.writePos++]=128|r,this}writeObjectKey(t){if(typeof t=="string"){let r=parseInt(t,10);r.toString()==t&&(t=r)}else typeof t!="number"&&(t=""+t);this.write(t)}readCollectionBoundary(t){this.readPos>=this.writePos&&this.notEnoughData("collection boundary");let r=this.buffer[this.readPos++],n=128|xr[t];if(r!==n)throw new Error(`Expected ${t} boundary but got byte ${r}`)}increment(){for(let t=this.writePos-1;t>=0;t--)if(this.buffer[t]===255)this.buffer[t]=0;else return this.buffer[t]++,this}toString(t=void 0,r=0,n=this.writePos){t===void 0&&(t=$n);let o=this.readPos;this.readPos=r;let i=0,a="",l="",c=Ue,m=c>0?_e[(c-1)%_e.length]:vn;try{for(;this.readPos<n;){let d=_e[Ue++%_e.length];if(a+=d+fe(this.read())+" ",t)for(l+=d;i<this.readPos;)l+=this.buffer[i].toString(16).padStart(2,"0")+" ",i++}}catch{if(!t)return this.readPos=o,Ue=c,this.toString(!0,r,n);for(a+=yr+"ERROR ",l+=yr;i<this.writePos;)l+=this.buffer[i].toString(16).padStart(2,"0")+" ",i++}return this.readPos=o,c||(Ue=0),t?"DataPack{"+l+m+"\u2192 "+a.trimEnd()+m+"}":"DataPack{"+a.trimEnd()+m+"}"}[Symbol.for("nodejs.util.inspect.custom")](){return this.toString()}readAvailable(){return this.readPos<this.writePos}static generateIdentifier(){let t=Math.floor(+new Date*256+Math.random()*16384),r="";for(let n=0;n<8;n++)r=Be[t&63]+r,t=Math.floor(t/64);return r}static createBuffer(...t){let r=new e;for(let n of t)r.write(n);return r.toBuffer()}static createUint8Array(...t){let r=new e;for(let n of t)r.write(n);return r.toUint8Array(!1)}};function fe(e){if(e===void 0)return"undefined";if(typeof e=="object"&&e!==null){if(e instanceof Uint8Array)return new _(e).toString();if(e instanceof Array)return"["+e.map(t=>fe(t)).join(", ")+"]";if(e instanceof Map)return"Map{"+Array.from(e.entries()).map(([t,r])=>`${fe(t)}=>${fe(r)}`).join(", ")+"}";if(e instanceof Set)return"Set{"+Array.from(e.values()).map(t=>fe(t)).join(", ")+"}";if(typeof e=="object"&&e!==null)return"{"+Object.entries(e).map(([t,r])=>`${t}:${fe(r)}`).join(", ")+"}"}return JSON.stringify(e)}var xe=class{name;data;constructor(t,r){this.name=t,this.data=r}};_.prototype.CustomData=xe;var U={error:"e",response:"r",response_proxy:"p",response_model:"m",response_proxy_model:"q",model_data:"d"},At={call:1,cancel:2};var C=0;var Ke=Symbol(),De=class{constructor(t){this.url=t;this.api=new Proxy({connection:this,requestId:void 0},vr),this.connect()}url;ws;activeRequests=new Map;requestCounter=0;reconnectAttempts=0;_proxyCounter=0;$state=s.proxy({online:!1,error:void 0});streamCache=new Map;get[s.OPAQUE](){return!0}api;isOnline(){return this.$state.online}getError(){return this.$state.error}connect(){let t;try{t=this.ws=typeof this.url=="string"?new WebSocket(this.url):this.url()}catch(r){console.error("WebSocket connection error:",r),this.$state.error=r?.message||"WebSocket connection error";return}t.binaryType="arraybuffer",C>=1&&console.log(`[lowlander] Connecting to WebSocket at ${typeof this.url=="string"?this.url:"[custom WebSocket]"}`),t.onopen=()=>{if(t===this.ws){C>=1&&console.log("[lowlander] WebSocket connected"),this.$state.online=!0,this.$state.error=void 0,this.reconnectAttempts=0;for(let r of this.activeRequests.values())r.$result.busy=!0,this.ws.send(r.requestBuffer)}},t.onclose=()=>{t===this.ws&&(C>=1&&console.log("[lowlander] WebSocket disconnected"),this.reconnect())},t.onerror=r=>{t===this.ws&&(console.error("WebSocket error:",r),this.$state.error=r?.message||"WebSocket connection error",this.reconnect())},t.onmessage=r=>{if(t!==this.ws)return;let n=new _(new Uint8Array(r.data)),o=n.readPositiveInt(),i=this.activeRequests.get(o);if(!i)return;let a=s.unproxy(i.$result),l=n.read();if(typeof l=="number"){let c=i.callbacks?.[l],m=[];for(;n.readAvailable();)m.push(n.read());c(...m);return}if(l===U.model_data){i.database||=new Map,i.commitIds||=new Map;let c=n.readNumber(),m=n.readNumber(),d=n.read({model:function(g){let v=i.database.get(g);return v||console.error("Unknown linked model hash "+g),v}});C>=3&&console.log("[lowlander] incoming model_data",o,c,m,d),setTimeout(()=>this.pruneCommitIds(i,m),15e3);let f=i.commitIds.get(c);if(!d){if(f&&m<Math.max(...f.values()))return;i.database.delete(c),i.commitIds.set(c,new Map([[Ke,m]]));return}let u=i.database.get(c);if(u){f||(f=new Map,i.commitIds.set(c,f));for(let g of Object.keys(d))m<(f.get(g)??f.get(Ke)??-1)||(d[g]&&typeof d[g]=="object"?s.copy(u,g,d[g]):u[g]=d[g],f.set(g,m))}else{if(f&&m<(f.get(Ke)??-1))return;let g=s.proxy(d);s.unproxy(g)[s.OPAQUE]=!1,i.database.set(c,g),i.commitIds.set(c,new Map([[Ke,m]]))}return}if(l===U.error){let c=n.readString();i.$result.error=new Error(c),C>=2&&console.log(`[lowlander] incoming error requestId=${o} message=${c}`)}else if(l===U.response||l===U.response_proxy)i.$result.value=n.read(),i.virtualSocketIds=n.read(),i.hasServerProxy=l===U.response_proxy,C>=2&&console.log(`[lowlander] incoming response requestId=${o} value=${a.value} virtualSocketIds=${i.virtualSocketIds} hasServerProxy=${i.hasServerProxy}`);else if(l===U.response_model||l===U.response_proxy_model){i.virtualSocketIds=n.read();let c=n.readNumber(),m=n.read(),d=i.database?.get(c);i.hasServerProxy=l===U.response_proxy_model,C>=2&&console.log(`[lowlander] incoming ${i.hasServerProxy?"response_proxy_model":"response_model"} requestId=${o} dbKey=${c} cacheMs=${m} obj=${d}`),d?i.$result.value=s.proxy(d):i.$result.error=new Error("Unknown database key "+c),m!==void 0&&i.cacheKey&&!this.streamCache.has(i.cacheKey)&&this.streamCache.set(i.cacheKey,{request:i,cacheKey:i.cacheKey,cacheMs:m,refCount:1})}else throw new Error("Unknown message type "+l);!i.hasServerProxy&&!i.virtualSocketIds?.length&&this.activeRequests.delete(o),i.hasServerProxy||delete i.$result.serverProxy,i.$result.busy=!1,i.resolve&&(a.error!=null?(console.error(a.error),i.reject(a.error)):i.resolve(a.value),delete i.resolve,delete i.reject)}}reconnect(){if(this.ws=void 0,this.$state.online=!1,typeof this.url!="string")return;let t=Math.min(500*Math.pow(2,this.reconnectAttempts),2e4);this.reconnectAttempts++,C>=1&&console.log(`[lowlander] Reconnecting in ${t}ms (attempt ${this.reconnectAttempts})`),setTimeout(this.connect.bind(this),t)}pruneCommitIds(t,r){if(t.commitIds)for(let[n,o]of t.commitIds){for(let[i,a]of o)a<=r&&o.delete(i);o.size||t.commitIds.delete(n)}}_createMethodStub(t,r){return(...n)=>{let i=n.some(u=>typeof u=="function")?void 0:(r??"")+":"+t+":"+JSON.stringify(n);if(i){let u=this.streamCache.get(i);if(u)return u.lingerTimeout&&(clearTimeout(u.lingerTimeout),u.lingerTimeout=void 0),u.refCount++,C>=2&&console.log(`[lowlander] reusing cached stream cacheKey=${i} refCount=${u.refCount}`),s.clean(()=>{u.refCount--,C>=2&&console.log(`[lowlander] clean cached consumer cacheKey=${i} refCount=${u.refCount}`),u.refCount<=0&&this.startLinger(u)}),u.request.$result}let a={busy:!0},l=s.proxy(a),c=++this.requestCounter,m=new _;m.write(c).write(At.call).write(r).write(t);let d;m.writeCollection("array",()=>{for(let u of n)typeof u=="function"?(d||=[],m.writeCustom("cb",d.length),d.push(u)):m.write(u)});let f={$result:l,requestBuffer:m.toUint8Array(!0),requestId:c,connection:this,callbacks:d,cacheKey:i};return a.serverProxy=new Proxy(f,vr),a.promise=new Promise((u,g)=>{f.resolve=u,f.reject=g}),this.activeRequests.set(c,f),C>=2&&console.log(`[lowlander] outgoing call requestId=${c} method=${t} params=`,n),this.ws&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(f.requestBuffer),s.clean(()=>{let u=i?this.streamCache.get(i):void 0;if(u&&u.request===f){u.refCount--,C>=2&&console.log(`[lowlander] clean stream owner cacheKey=${i} refCount=${u.refCount}`),u.refCount<=0&&this.startLinger(u);return}this.cancelRequest(f)}),l}}cancelRequest(t){if(this.activeRequests.delete(t.requestId),t.virtualSocketIds?.length||t.hasServerProxy){C>=2&&console.log(`[lowlander] outgoing cancel requestId=${t.requestId} virtualSocketIds=${t.virtualSocketIds} hasServerProxy=${t.hasServerProxy}`);let r=_.createUint8Array(++this.requestCounter,At.cancel,t.requestId,t.virtualSocketIds);this.ws?.send(r)}}startLinger(t){t.lingerTimeout&&clearTimeout(t.lingerTimeout),C>=2&&console.log(`[lowlander] start linger cacheKey=${t.cacheKey} cacheMs=${t.cacheMs}`),t.lingerTimeout=setTimeout(()=>{t.refCount>0||(C>=2&&console.log(`[lowlander] linger expired cacheKey=${t.cacheKey}`),this.streamCache.delete(t.cacheKey),this.cancelRequest(t.request))},t.cacheMs)}},vr={get(e,t){if(typeof t=="symbol")return t===s.OPAQUE?!0:t===s.CUSTOM_DUMP?`<ServerProxy for #${e.requestId}>`:void 0;if(e.serverProxyCache?.has(t))return e.serverProxyCache.get(t);if(t==="then"||t==="catch"||t==="finally")return;if(t==="constructor")return{name:"ServerProxy-"+e.requestId};let r=e.connection._createMethodStub(t,e.requestId);return e.serverProxyCache||(e.serverProxyCache=new Map),e.serverProxyCache.set(t,r),r},has(e,t){return typeof t=="string"||t===s.NO_COPY}};var Pn=`ws://${location.hostname}:8080/`,$r=new De(Pn),Ge=$r.api,An=Ge.add(1234,6753),Pr=Ge.authenticate("Frank"),Ar=Pr.serverProxy,kn=Ar.getBio(),Cn=Ge.streamModel(),kt=s.proxy(!1),Ct=s.proxy(""),kr=s.proxy([]),Sn=0;Ge.streamSomething(e=>kr[Sn++%20]=e);s.mount(document.body,()=>{E.main({title:"Lowlander Hello World",maxWidth:"48rem",content:()=>{E.box({header:"Connection",content:()=>{s("p","m:0",()=>{s("#Online: "),s(()=>s($r.isOnline()?"text=yes":"text=no"))})}}),E.box({header:"Add(1234, 6753)",content:()=>s.dump(An)}),E.box({header:"Auth token",content:()=>s.dump(Pr)}),E.box({header:"Bio",content:()=>s.dump(kn)}),E.box({header:"Live model",content:()=>s.dump(Cn)}),E.box({header:"Toggle friend",content:()=>{E.form({submit:async()=>{kt.value=!0;let e=await Ar.toggleFriend(Ct.value).promise;kt.value=!1,e||E.alert("No such person: "+Ct.value)},content:()=>E.textline({label:"Person name",bind:Ct}),actions:()=>{s(()=>{kt.value?s("span","fg:$s-fg-muted","#Busy\u2026"):E.button({text:"Toggle friend",type:"submit"})})}})}}),E.box({header:"Streamed data",content:()=>s.dump(kr)})}})});
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../examples/helloworld/client/js/base.ts"],"names":[],"mappings":"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"}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../../../../../examples/helloworld/client/js/base.ts"],"names":[],"mappings":"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"}
@@ -1,5 +1,8 @@
1
1
  import * as E from "edinburgh";
2
2
  import { ServerProxy, Socket } from "lowlander/server";
3
+ import type { HttpRequest, HttpResponse } from "warpsocket";
4
+ export { _dashboard } from "lowlander/dashboard";
5
+ export declare function handleHttpRequest(req: HttpRequest, res: HttpResponse): void;
3
6
  export declare const getDebugState: typeof import("warpsocket/addon-loader").getDebugState;
4
7
  export declare function add(a: number, b: number): number;
5
8
  export declare class UserAPI {
@@ -20,7 +23,7 @@ declare const Person: E.ModelClass<{}, {
20
23
  password: string;
21
24
  onlineCount: number;
22
25
  }, [string], {
23
- [x: string]: "name" | "age" | "friends" | "password" | "onlineCount" | readonly ("name" | "age" | "friends" | "password" | "onlineCount")[] | ((instance: {
26
+ [x: string]: "password" | "name" | "age" | "friends" | "onlineCount" | readonly ("password" | "name" | "age" | "friends" | "onlineCount")[] | ((instance: {
24
27
  name: string;
25
28
  age: number;
26
29
  friends: (/*elided*/ any & E.ModelBase<E.ModelLookup<[string]>>)[];
@@ -60,11 +63,14 @@ export declare function streamModelLinkedRecord(): import("lowlander/server").St
60
63
  name: string;
61
64
  }>;
62
65
  }>;
66
+ export declare function streamVirtual(): import("lowlander/server").StreamTypeBase<{
67
+ name: string;
68
+ nameUpper: string;
69
+ }>;
63
70
  export declare function incrOwnerAge(delta: number): Promise<void>;
64
71
  export declare function setOwnerAge(age: number): void;
65
72
  export declare function setModelName(name: string): void;
66
73
  export declare function setMeta(key: string, value: number): void;
67
74
  export declare function deleteMeta(key: string): void;
68
75
  export declare function streamSomething(socket: Socket<number>): void;
69
- export {};
70
76
  //# sourceMappingURL=api.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../examples/helloworld/server/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAoB,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAGzE,eAAO,MAAM,aAAa,wDAA2B,CAAC;AAGtD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAGD,qBAAa,OAAO;IACG,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;IAEnC,IAAI,IAAI,IAAI,MAAM,CAIjB;IAED,MAAM;IAIN,YAAY,CAAC,UAAU,EAAE,MAAM;IAa/B,MAAM;CAGT;AAGD,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,yCAM9C;AAED,wBAAgB,cAAc,aAE7B;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAgB,UAE7D;AAID,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;EASV,CAAC;AACH,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC;AAI1C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM;;;KAMxD;AAgBD,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,OAAO,iBAmB5D;AAqCD,wBAAgB,WAAW;;;;;;;;;;;;GAG1B;AAED,wBAAgB,iBAAiB;;;;;GAGhC;AAED,wBAAgB,uBAAuB;;;;GAGtC;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,iBAK/C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,QAGtC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,QAGxC;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAGjD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,QAKrC;AAKD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QASrD"}
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../examples/helloworld/server/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,WAAW,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAoB,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEzE,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK5D,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAOjD,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,QASpE;AAED,eAAO,MAAM,aAAa,wDAA2B,CAAC;AAGtD,wBAAgB,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAEhD;AAGD,qBAAa,OAAO;IACG,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,EAAE,MAAM;IAEnC,IAAI,IAAI,IAAI,MAAM,CAIjB;IAED,MAAM;IAIN,YAAY,CAAC,UAAU,EAAE,MAAM;IAa/B,MAAM;CAGT;AAGD,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,yCAM9C;AAED,wBAAgB,cAAc,aAE7B;AAED,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,GAAE,MAAgB,UAE7D;AAID,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;EASV,CAAC;AACH,KAAK,MAAM,GAAG,YAAY,CAAC,OAAO,MAAM,CAAC,CAAC;AAI1C,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM;;;KAMxD;AAiBD,wBAAsB,aAAa,CAAC,gBAAgB,EAAE,OAAO,iBAmB5D;AAoCD,wBAAgB,WAAW;;;;;;;;;;;;GAG1B;AAED,wBAAgB,iBAAiB;;;;;GAGhC;AAED,wBAAgB,uBAAuB;;;;GAGtC;AAED,wBAAgB,aAAa;;;GAG5B;AAED,wBAAsB,YAAY,CAAC,KAAK,EAAE,MAAM,iBAK/C;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,QAGtC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,QAGxC;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,QAGjD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,QAKrC;AAKD,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,QASrD"}
@@ -1,6 +1,24 @@
1
1
  import * as E from "edinburgh";
2
2
  import { ServerProxy, createStreamType } from "lowlander/server";
3
3
  import * as warpsocket from "warpsocket";
4
+ import { serveDashboard } from "lowlander/dashboard";
5
+ import { fileURLToPath } from "url";
6
+ import { dirname, resolve } from "path";
7
+ import sirv from "sirv";
8
+ export { _dashboard } from "lowlander/dashboard";
9
+ E.init(resolve(dirname(fileURLToPath(import.meta.url)), '../.edinburgh'));
10
+ const CLIENT_DIR = resolve(dirname(fileURLToPath(import.meta.url)), '../client');
11
+ const serveStatic = sirv(CLIENT_DIR, { dev: false });
12
+ export function handleHttpRequest(req, res) {
13
+ if (req.url === '/_dashboard' || req.url.startsWith('/_dashboard?')) {
14
+ return serveDashboard(res);
15
+ }
16
+ serveStatic(req, res, () => {
17
+ res.statusCode = 404;
18
+ res.setHeader('content-type', 'text/plain');
19
+ res.end('Not found');
20
+ });
21
+ }
4
22
  export const getDebugState = warpsocket.getDebugState;
5
23
  // Simple RPC function example
6
24
  export function add(a, b) {
@@ -59,7 +77,7 @@ const Person = E.defineModel('Person', class {
59
77
  age = E.field(E.number);
60
78
  friends = E.field(E.array(E.link(() => Person)));
61
79
  password = E.field(E.string);
62
- onlineCount = E.field(E.number);
80
+ onlineCount = E.field(E.number, { default: 0 });
63
81
  }, {
64
82
  pk: 'name',
65
83
  index: { online: (p) => p.onlineCount > 0 ? [true] : [] },
@@ -81,6 +99,7 @@ const MyModel = E.defineModel('MyModel', class {
81
99
  createdAt = E.field(E.dateTime);
82
100
  meta = E.field(E.record(E.number));
83
101
  owners = E.field(E.record(E.link(() => Person)));
102
+ get nameUpper() { return this.name.toUpperCase(); }
84
103
  }, {
85
104
  pk: 'id',
86
105
  unique: { name: 'name' },
@@ -108,13 +127,6 @@ export async function resetTestData(deleteEverything) {
108
127
  });
109
128
  }
110
129
  resetTestData(false);
111
- ``;
112
- await E.transact(() => {
113
- E.dump();
114
- for (const p of Person.find()) {
115
- console.log('Person:', p.name, 'age', p.age, 'friends', p.friends.map(f => f.name).join(','), 'password', p.password);
116
- }
117
- });
118
130
  // Create a stream type that specifies which fields to send to clients
119
131
  // Note: password is excluded for security, and we include nested linked model fields
120
132
  const MyStream = createStreamType(MyModel, {
@@ -137,6 +149,11 @@ const CachedStream = createStreamType(MyModel, {
137
149
  const LinkedRecordStream = createStreamType(MyModel, {
138
150
  owners: { name: true },
139
151
  });
152
+ // Virtual getter stream: nameUpper is derived from name and updates live when name changes
153
+ const VirtualStream = createStreamType(MyModel, {
154
+ name: true,
155
+ nameUpper: true,
156
+ });
140
157
  // Example of model streaming - returns a reactive proxy that auto-updates on changes
141
158
  export function streamModel() {
142
159
  const m1 = MyModel.get(ids.m1);
@@ -150,6 +167,10 @@ export function streamModelLinkedRecord() {
150
167
  const m1 = MyModel.get(ids.m1);
151
168
  return new LinkedRecordStream(m1);
152
169
  }
170
+ export function streamVirtual() {
171
+ const m1 = MyModel.get(ids.m1);
172
+ return new VirtualStream(m1);
173
+ }
153
174
  export async function incrOwnerAge(delta) {
154
175
  const m1 = MyModel.get(ids.m1);
155
176
  const current = m1.owner.age;