nowity 1.0.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 (192) hide show
  1. package/README.md +751 -0
  2. package/dist/api/contract.d.ts +186 -0
  3. package/dist/api/contract.d.ts.map +1 -0
  4. package/dist/api/contract.js +251 -0
  5. package/dist/api/errors.d.ts +50 -0
  6. package/dist/api/errors.d.ts.map +1 -0
  7. package/dist/api/errors.js +50 -0
  8. package/dist/api/index.d.ts +13 -0
  9. package/dist/api/index.d.ts.map +1 -0
  10. package/dist/api/index.js +32 -0
  11. package/dist/client/confirmed-store.d.ts +33 -0
  12. package/dist/client/confirmed-store.d.ts.map +1 -0
  13. package/dist/client/confirmed-store.js +123 -0
  14. package/dist/client/connection.d.ts +102 -0
  15. package/dist/client/connection.d.ts.map +1 -0
  16. package/dist/client/connection.js +285 -0
  17. package/dist/client/list.d.ts +102 -0
  18. package/dist/client/list.d.ts.map +1 -0
  19. package/dist/client/list.js +257 -0
  20. package/dist/client/live-query.d.ts +153 -0
  21. package/dist/client/live-query.d.ts.map +1 -0
  22. package/dist/client/live-query.js +244 -0
  23. package/dist/client/nowity-client.d.ts +188 -0
  24. package/dist/client/nowity-client.d.ts.map +1 -0
  25. package/dist/client/nowity-client.js +580 -0
  26. package/dist/client/null-transport.d.ts +16 -0
  27. package/dist/client/null-transport.d.ts.map +1 -0
  28. package/dist/client/null-transport.js +17 -0
  29. package/dist/client/overlay.d.ts +44 -0
  30. package/dist/client/overlay.d.ts.map +1 -0
  31. package/dist/client/overlay.js +90 -0
  32. package/dist/client/query-source.d.ts +78 -0
  33. package/dist/client/query-source.d.ts.map +1 -0
  34. package/dist/client/query-source.js +57 -0
  35. package/dist/client/ssr-source.d.ts +70 -0
  36. package/dist/client/ssr-source.d.ts.map +1 -0
  37. package/dist/client/ssr-source.js +134 -0
  38. package/dist/client/transport.d.ts +19 -0
  39. package/dist/client/transport.d.ts.map +1 -0
  40. package/dist/client/transport.js +2 -0
  41. package/dist/client/ws-transport.d.ts +30 -0
  42. package/dist/client/ws-transport.d.ts.map +1 -0
  43. package/dist/client/ws-transport.js +89 -0
  44. package/dist/client.d.ts +47 -0
  45. package/dist/client.d.ts.map +1 -0
  46. package/dist/client.js +80 -0
  47. package/dist/core/diff.d.ts +14 -0
  48. package/dist/core/diff.d.ts.map +1 -0
  49. package/dist/core/diff.js +56 -0
  50. package/dist/core/normalize.d.ts +16 -0
  51. package/dist/core/normalize.d.ts.map +1 -0
  52. package/dist/core/normalize.js +67 -0
  53. package/dist/core/protocol.d.ts +215 -0
  54. package/dist/core/protocol.d.ts.map +1 -0
  55. package/dist/core/protocol.js +14 -0
  56. package/dist/core/ssr-bridge.d.ts +69 -0
  57. package/dist/core/ssr-bridge.d.ts.map +1 -0
  58. package/dist/core/ssr-bridge.js +40 -0
  59. package/dist/core/types.d.ts +96 -0
  60. package/dist/core/types.d.ts.map +1 -0
  61. package/dist/core/types.js +17 -0
  62. package/dist/index.d.ts +47 -0
  63. package/dist/index.d.ts.map +1 -0
  64. package/dist/index.js +98 -0
  65. package/dist/ironbean/client.d.ts +7 -0
  66. package/dist/ironbean/client.d.ts.map +1 -0
  67. package/dist/ironbean/client.js +38 -0
  68. package/dist/ironbean/server.d.ts +42 -0
  69. package/dist/ironbean/server.d.ts.map +1 -0
  70. package/dist/ironbean/server.js +62 -0
  71. package/dist/ironbean/tokens.d.ts +26 -0
  72. package/dist/ironbean/tokens.d.ts.map +1 -0
  73. package/dist/ironbean/tokens.js +23 -0
  74. package/dist/next/config.d.ts +7 -0
  75. package/dist/next/config.d.ts.map +1 -0
  76. package/dist/next/config.js +77 -0
  77. package/dist/next/live.d.ts +69 -0
  78. package/dist/next/live.d.ts.map +1 -0
  79. package/dist/next/live.js +70 -0
  80. package/dist/next/serve.d.ts +44 -0
  81. package/dist/next/serve.d.ts.map +1 -0
  82. package/dist/next/serve.js +107 -0
  83. package/dist/next/server.d.ts +62 -0
  84. package/dist/next/server.d.ts.map +1 -0
  85. package/dist/next/server.js +127 -0
  86. package/dist/react/connection-context.d.ts +4 -0
  87. package/dist/react/connection-context.d.ts.map +1 -0
  88. package/dist/react/connection-context.js +28 -0
  89. package/dist/react/grid-list.d.ts +34 -0
  90. package/dist/react/grid-list.d.ts.map +1 -0
  91. package/dist/react/grid-list.js +62 -0
  92. package/dist/react/hydrate.d.ts +22 -0
  93. package/dist/react/hydrate.d.ts.map +1 -0
  94. package/dist/react/hydrate.js +18 -0
  95. package/dist/react/index.d.ts +35 -0
  96. package/dist/react/index.d.ts.map +1 -0
  97. package/dist/react/index.js +51 -0
  98. package/dist/react/list.d.ts +31 -0
  99. package/dist/react/list.d.ts.map +1 -0
  100. package/dist/react/list.js +35 -0
  101. package/dist/react/prerendered.d.ts +33 -0
  102. package/dist/react/prerendered.d.ts.map +1 -0
  103. package/dist/react/prerendered.js +165 -0
  104. package/dist/react/provider.d.ts +64 -0
  105. package/dist/react/provider.d.ts.map +1 -0
  106. package/dist/react/provider.js +130 -0
  107. package/dist/react/refusals.d.ts +31 -0
  108. package/dist/react/refusals.d.ts.map +1 -0
  109. package/dist/react/refusals.js +51 -0
  110. package/dist/react/restricted.d.ts +76 -0
  111. package/dist/react/restricted.d.ts.map +1 -0
  112. package/dist/react/restricted.js +126 -0
  113. package/dist/react/use-list.d.ts +42 -0
  114. package/dist/react/use-list.d.ts.map +1 -0
  115. package/dist/react/use-list.js +56 -0
  116. package/dist/react/use-query.d.ts +66 -0
  117. package/dist/react/use-query.d.ts.map +1 -0
  118. package/dist/react/use-query.js +126 -0
  119. package/dist/react/virtual.d.ts +60 -0
  120. package/dist/react/virtual.d.ts.map +1 -0
  121. package/dist/react/virtual.js +131 -0
  122. package/dist/server/api/auth.d.ts +37 -0
  123. package/dist/server/api/auth.d.ts.map +1 -0
  124. package/dist/server/api/auth.js +54 -0
  125. package/dist/server/api/bridge.d.ts +28 -0
  126. package/dist/server/api/bridge.d.ts.map +1 -0
  127. package/dist/server/api/bridge.js +330 -0
  128. package/dist/server/api/collector.d.ts +25 -0
  129. package/dist/server/api/collector.d.ts.map +1 -0
  130. package/dist/server/api/collector.js +184 -0
  131. package/dist/server/api/configure.d.ts +31 -0
  132. package/dist/server/api/configure.d.ts.map +1 -0
  133. package/dist/server/api/configure.js +67 -0
  134. package/dist/server/api/execution.d.ts +77 -0
  135. package/dist/server/api/execution.d.ts.map +1 -0
  136. package/dist/server/api/execution.js +97 -0
  137. package/dist/server/api/list.d.ts +141 -0
  138. package/dist/server/api/list.d.ts.map +1 -0
  139. package/dist/server/api/list.js +281 -0
  140. package/dist/server/api/prerender.d.ts +32 -0
  141. package/dist/server/api/prerender.d.ts.map +1 -0
  142. package/dist/server/api/prerender.js +69 -0
  143. package/dist/server/api/read-keys.d.ts +128 -0
  144. package/dist/server/api/read-keys.d.ts.map +1 -0
  145. package/dist/server/api/read-keys.js +464 -0
  146. package/dist/server/api/read-set.d.ts +103 -0
  147. package/dist/server/api/read-set.d.ts.map +1 -0
  148. package/dist/server/api/read-set.js +210 -0
  149. package/dist/server/api/runtime.d.ts +36 -0
  150. package/dist/server/api/runtime.d.ts.map +1 -0
  151. package/dist/server/api/runtime.js +49 -0
  152. package/dist/server/api/tracked-client.d.ts +6 -0
  153. package/dist/server/api/tracked-client.d.ts.map +1 -0
  154. package/dist/server/api/tracked-client.js +56 -0
  155. package/dist/server/change-source/change-source.d.ts +41 -0
  156. package/dist/server/change-source/change-source.d.ts.map +1 -0
  157. package/dist/server/change-source/change-source.js +2 -0
  158. package/dist/server/change-source/outbox-change-source.d.ts +106 -0
  159. package/dist/server/change-source/outbox-change-source.d.ts.map +1 -0
  160. package/dist/server/change-source/outbox-change-source.js +237 -0
  161. package/dist/server/change-source/wal-change-source.d.ts +85 -0
  162. package/dist/server/change-source/wal-change-source.d.ts.map +1 -0
  163. package/dist/server/change-source/wal-change-source.js +193 -0
  164. package/dist/server/db.d.ts +51 -0
  165. package/dist/server/db.d.ts.map +1 -0
  166. package/dist/server/db.js +53 -0
  167. package/dist/server/evaluate.d.ts +39 -0
  168. package/dist/server/evaluate.d.ts.map +1 -0
  169. package/dist/server/evaluate.js +61 -0
  170. package/dist/server/invalidation-index.d.ts +64 -0
  171. package/dist/server/invalidation-index.d.ts.map +1 -0
  172. package/dist/server/invalidation-index.js +0 -0
  173. package/dist/server/mutator.d.ts +59 -0
  174. package/dist/server/mutator.d.ts.map +1 -0
  175. package/dist/server/mutator.js +77 -0
  176. package/dist/server/query.d.ts +113 -0
  177. package/dist/server/query.d.ts.map +1 -0
  178. package/dist/server/query.js +35 -0
  179. package/dist/server/setup.d.ts +30 -0
  180. package/dist/server/setup.d.ts.map +1 -0
  181. package/dist/server/setup.js +107 -0
  182. package/dist/server/sql/setup.sql +215 -0
  183. package/dist/server/ssr.d.ts +29 -0
  184. package/dist/server/ssr.d.ts.map +1 -0
  185. package/dist/server/ssr.js +43 -0
  186. package/dist/server/sync-engine.d.ts +256 -0
  187. package/dist/server/sync-engine.d.ts.map +1 -0
  188. package/dist/server/sync-engine.js +805 -0
  189. package/dist/server/ws-server.d.ts +56 -0
  190. package/dist/server/ws-server.d.ts.map +1 -0
  191. package/dist/server/ws-server.js +241 -0
  192. package/package.json +81 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hydrate.d.ts","sourceRoot":"","sources":["../../src/react/hydrate.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD;;;;;;GAMG;AACH,wBAAgB,WAAW,CACvB,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,gBAAgB,EAAE,GAAG,SAAS,GACzC,IAAI,CAIN"}
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.hydrateOnce = hydrateOnce;
5
+ const applied = new WeakSet();
6
+ /**
7
+ * Apply a payload set once, however often this renders.
8
+ *
9
+ * Keyed on the payloads rather than on the component, because the connection
10
+ * outlives both a strict-mode double render and a remount — and re-applying then
11
+ * would push data the server has since replaced back over the live rows.
12
+ */
13
+ function hydrateOnce(source, payloads) {
14
+ if (!payloads || applied.has(payloads))
15
+ return;
16
+ applied.add(payloads);
17
+ source.hydrate(payloads);
18
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * React bindings — the last step of the design's pipeline, `MobX store → React UI`.
3
+ *
4
+ * The directive is what keeps this module out of the RSC layer. A server
5
+ * component may import `<NowityProvider>` from `nowity/client` — the root layout
6
+ * does — and without a boundary here the bundler would evaluate this barrel while
7
+ * rendering it, `mobx-react-lite` and all, in a React build that has no hooks.
8
+ * Everything exported below is genuinely browser-only, so the boundary belongs
9
+ * exactly here rather than around the contracts that sit beside it.
10
+ *
11
+ * Internal: an application imports these from `nowity/client`, which is the whole
12
+ * of what a browser may reach. `react` and `mobx-react-lite` are peer
13
+ * dependencies, and nothing here reaches the server half.
14
+ *
15
+ * Components that read entity fields must be wrapped in `observer`, which is what
16
+ * makes MobX track individual fields rather than whole objects; `observer` is
17
+ * re-exported here so a component needs one import.
18
+ */
19
+ export { observer } from "mobx-react-lite";
20
+ export { useQuerySuspense, useService, type ContractRef, type Suspended } from "./use-query";
21
+ export { useList, type Listed, type UseListOptions } from "./use-list";
22
+ export { Restricted, type RestrictedProps } from "./restricted";
23
+ export { GridList, type GridListProps } from "./grid-list";
24
+ export { List, type ListProps } from "./list";
25
+ export { LiveList, DEFAULT_PAGE_SIZE } from "../client/list";
26
+ export { NowityProvider, type NowityProviderProps } from "./provider";
27
+ /**
28
+ * Internal, and not re-exported by `nowity/client`: this is what `<Live>` is
29
+ * made of, and its ticket is a handle to a snapshot only the server holds — an
30
+ * application has no way to obtain one, so offering it the component would be
31
+ * offering something it cannot render.
32
+ */
33
+ export { Prerendered, type PrerenderedProps } from "./prerendered";
34
+ export { SourceScope, useQuerySource } from "./connection-context";
35
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AACtE;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACnE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.useQuerySource = exports.SourceScope = exports.Prerendered = exports.NowityProvider = exports.DEFAULT_PAGE_SIZE = exports.LiveList = exports.List = exports.GridList = exports.Restricted = exports.useList = exports.useService = exports.useQuerySuspense = exports.observer = void 0;
5
+ /**
6
+ * React bindings — the last step of the design's pipeline, `MobX store → React UI`.
7
+ *
8
+ * The directive is what keeps this module out of the RSC layer. A server
9
+ * component may import `<NowityProvider>` from `nowity/client` — the root layout
10
+ * does — and without a boundary here the bundler would evaluate this barrel while
11
+ * rendering it, `mobx-react-lite` and all, in a React build that has no hooks.
12
+ * Everything exported below is genuinely browser-only, so the boundary belongs
13
+ * exactly here rather than around the contracts that sit beside it.
14
+ *
15
+ * Internal: an application imports these from `nowity/client`, which is the whole
16
+ * of what a browser may reach. `react` and `mobx-react-lite` are peer
17
+ * dependencies, and nothing here reaches the server half.
18
+ *
19
+ * Components that read entity fields must be wrapped in `observer`, which is what
20
+ * makes MobX track individual fields rather than whole objects; `observer` is
21
+ * re-exported here so a component needs one import.
22
+ */
23
+ var mobx_react_lite_1 = require("mobx-react-lite");
24
+ Object.defineProperty(exports, "observer", { enumerable: true, get: function () { return mobx_react_lite_1.observer; } });
25
+ var use_query_1 = require("./use-query");
26
+ Object.defineProperty(exports, "useQuerySuspense", { enumerable: true, get: function () { return use_query_1.useQuerySuspense; } });
27
+ Object.defineProperty(exports, "useService", { enumerable: true, get: function () { return use_query_1.useService; } });
28
+ var use_list_1 = require("./use-list");
29
+ Object.defineProperty(exports, "useList", { enumerable: true, get: function () { return use_list_1.useList; } });
30
+ var restricted_1 = require("./restricted");
31
+ Object.defineProperty(exports, "Restricted", { enumerable: true, get: function () { return restricted_1.Restricted; } });
32
+ var grid_list_1 = require("./grid-list");
33
+ Object.defineProperty(exports, "GridList", { enumerable: true, get: function () { return grid_list_1.GridList; } });
34
+ var list_1 = require("./list");
35
+ Object.defineProperty(exports, "List", { enumerable: true, get: function () { return list_1.List; } });
36
+ var list_2 = require("../client/list");
37
+ Object.defineProperty(exports, "LiveList", { enumerable: true, get: function () { return list_2.LiveList; } });
38
+ Object.defineProperty(exports, "DEFAULT_PAGE_SIZE", { enumerable: true, get: function () { return list_2.DEFAULT_PAGE_SIZE; } });
39
+ var provider_1 = require("./provider");
40
+ Object.defineProperty(exports, "NowityProvider", { enumerable: true, get: function () { return provider_1.NowityProvider; } });
41
+ /**
42
+ * Internal, and not re-exported by `nowity/client`: this is what `<Live>` is
43
+ * made of, and its ticket is a handle to a snapshot only the server holds — an
44
+ * application has no way to obtain one, so offering it the component would be
45
+ * offering something it cannot render.
46
+ */
47
+ var prerendered_1 = require("./prerendered");
48
+ Object.defineProperty(exports, "Prerendered", { enumerable: true, get: function () { return prerendered_1.Prerendered; } });
49
+ var connection_context_1 = require("./connection-context");
50
+ Object.defineProperty(exports, "SourceScope", { enumerable: true, get: function () { return connection_context_1.SourceScope; } });
51
+ Object.defineProperty(exports, "useQuerySource", { enumerable: true, get: function () { return connection_context_1.useQuerySource; } });
@@ -0,0 +1,31 @@
1
+ import type { JSX } from "react";
2
+ import { type VirtualProps } from "./virtual";
3
+ /** Everything a grid takes except how many fit across, which for a list is one. */
4
+ export type ListProps<T> = VirtualProps<T>;
5
+ /**
6
+ * A virtualised list over a live collection — one item per row.
7
+ *
8
+ * The same component {@link GridList} is, with the one question a list does not
9
+ * have to answer already answered: a row is the full width, so there is nothing
10
+ * to divide and no measurement to wait for before there is a layout.
11
+ *
12
+ * ```tsx
13
+ * const scores = useList(ScoreApi).all();
14
+ * <List of={scores} itemHeight={44} height={600}>
15
+ * {(row, index) => (row ? <Row score={row} /> : <Skeleton rank={index + 1} />)}
16
+ * </List>
17
+ * ```
18
+ *
19
+ * What it loads is what it draws. The rows the viewport covers are rendered and
20
+ * subscribed to; the ones above and below are neither, and scrolling swaps one
21
+ * set for the other a window at a time. A collection of five thousand costs the
22
+ * same as a collection of fifty, because the difference never reaches the
23
+ * browser — which is the point of `useList` returning a store to index into
24
+ * rather than an array to receive.
25
+ *
26
+ * `undefined` is a row whose window has not arrived. It is an ordinary state
27
+ * rather than a failure — a placeholder of the right height keeps the scrollbar
28
+ * honest while it is on its way.
29
+ */
30
+ export declare const List: <T>(props: ListProps<T>) => JSX.Element;
31
+ //# sourceMappingURL=list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/react/list.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEvD,mFAAmF;AACnF,MAAM,MAAM,SAAS,CAAC,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,IAAI,EAEX,CAAC,CAAC,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,OAAO,CAAC"}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.List = void 0;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const mobx_react_lite_1 = require("mobx-react-lite");
7
+ const virtual_1 = require("./virtual");
8
+ /**
9
+ * A virtualised list over a live collection — one item per row.
10
+ *
11
+ * The same component {@link GridList} is, with the one question a list does not
12
+ * have to answer already answered: a row is the full width, so there is nothing
13
+ * to divide and no measurement to wait for before there is a layout.
14
+ *
15
+ * ```tsx
16
+ * const scores = useList(ScoreApi).all();
17
+ * <List of={scores} itemHeight={44} height={600}>
18
+ * {(row, index) => (row ? <Row score={row} /> : <Skeleton rank={index + 1} />)}
19
+ * </List>
20
+ * ```
21
+ *
22
+ * What it loads is what it draws. The rows the viewport covers are rendered and
23
+ * subscribed to; the ones above and below are neither, and scrolling swaps one
24
+ * set for the other a window at a time. A collection of five thousand costs the
25
+ * same as a collection of fifty, because the difference never reaches the
26
+ * browser — which is the point of `useList` returning a store to index into
27
+ * rather than an array to receive.
28
+ *
29
+ * `undefined` is a row whose window has not arrived. It is an ordinary state
30
+ * rather than a failure — a placeholder of the right height keeps the scrollbar
31
+ * honest while it is on its way.
32
+ */
33
+ exports.List = (0, mobx_react_lite_1.observer)(function List(props) {
34
+ return (0, jsx_runtime_1.jsx)(virtual_1.Virtual, { ...props, columnsOf: () => 1, template: "minmax(0, 1fr)" });
35
+ });
@@ -0,0 +1,33 @@
1
+ import { type ReactNode } from "react";
2
+ export interface PrerenderedProps {
3
+ /** Handle of this render's open snapshot. Meaningless in a browser. */
4
+ ticket: string;
5
+ /** Shown until the data is there — and in the server's HTML, if it is not. */
6
+ fallback?: ReactNode;
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Everything server rendering needs, and the last place that knows about it.
11
+ *
12
+ * Above this component a page says where its live queries are read; below it a
13
+ * component reads one and has no way to tell which process it is running in.
14
+ * Between the two there are four things that have to be true at once, and they
15
+ * are all here because getting them right separately is how this went wrong
16
+ * before — a boundary in one file, a gate in another, and a composition nobody
17
+ * could see was load-bearing:
18
+ *
19
+ * - the subtree reads through this request's snapshot rather than a socket that
20
+ * does not exist ({@link SsrQuerySource});
21
+ * - the shell of the HTML waits for those reads, instead of going out with a
22
+ * spinner React patches over later ({@link ShellGate});
23
+ * - what the render asked for leaves with the page ({@link Payloads});
24
+ * - and in a browser all of that is inert: the payloads go to the store before
25
+ * the first component asks, and the socket takes it from there.
26
+ *
27
+ * The ticket is the only thing that crosses. A `"use client"` module is compiled
28
+ * for the browser too, so it cannot import its way to the snapshot; it looks the
29
+ * id up in a registry the server put it in, and finds either a reader — it is
30
+ * rendering on a server — or nothing at all.
31
+ */
32
+ export declare function Prerendered({ ticket, fallback, children }: PrerenderedProps): import("react").JSX.Element;
33
+ //# sourceMappingURL=prerendered.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prerendered.d.ts","sourceRoot":"","sources":["../../src/react/prerendered.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAS3D,MAAM,WAAW,gBAAgB;IAC7B,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,QAAe,EAAE,QAAQ,EAAE,EAAE,gBAAgB,+BAYlF"}
@@ -0,0 +1,165 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Prerendered = Prerendered;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const connection_1 = require("../client/connection");
8
+ const ssr_source_1 = require("../client/ssr-source");
9
+ const ssr_bridge_1 = require("../core/ssr-bridge");
10
+ const connection_context_1 = require("./connection-context");
11
+ const hydrate_1 = require("./hydrate");
12
+ /**
13
+ * Everything server rendering needs, and the last place that knows about it.
14
+ *
15
+ * Above this component a page says where its live queries are read; below it a
16
+ * component reads one and has no way to tell which process it is running in.
17
+ * Between the two there are four things that have to be true at once, and they
18
+ * are all here because getting them right separately is how this went wrong
19
+ * before — a boundary in one file, a gate in another, and a composition nobody
20
+ * could see was load-bearing:
21
+ *
22
+ * - the subtree reads through this request's snapshot rather than a socket that
23
+ * does not exist ({@link SsrQuerySource});
24
+ * - the shell of the HTML waits for those reads, instead of going out with a
25
+ * spinner React patches over later ({@link ShellGate});
26
+ * - what the render asked for leaves with the page ({@link Payloads});
27
+ * - and in a browser all of that is inert: the payloads go to the store before
28
+ * the first component asks, and the socket takes it from there.
29
+ *
30
+ * The ticket is the only thing that crosses. A `"use client"` module is compiled
31
+ * for the browser too, so it cannot import its way to the snapshot; it looks the
32
+ * id up in a registry the server put it in, and finds either a reader — it is
33
+ * rendering on a server — or nothing at all.
34
+ */
35
+ function Prerendered({ ticket, fallback = null, children }) {
36
+ // Still a Suspense boundary: a query answered from a database is not answered
37
+ // instantly, and a component that reads one suspends either way. The gate
38
+ // beside it is what decides whether the browser ever sees this fallback.
39
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_1.Suspense, { fallback: fallback, children: (0, jsx_runtime_1.jsx)(Collected, { ticket: ticket, children: children }) }), (0, jsx_runtime_1.jsx)(ShellGate, { ticket: ticket })] }));
40
+ }
41
+ /**
42
+ * The subtree, reading through whatever this process has.
43
+ *
44
+ * On the server it finds the request's reader and gives the subtree a source
45
+ * backed by it, so `useQuerySuspense` resolves from the open snapshot. Whatever
46
+ * the components ask for is recorded by the asking, and leaves in the script
47
+ * below them.
48
+ *
49
+ * In a browser it finds nothing — which is the point. It takes the payloads the
50
+ * script left behind, hands them to the store before anything under it can ask
51
+ * for a query, and otherwise gets out of the way: the socket is the browser's
52
+ * source and the singleton connection is the one to use.
53
+ */
54
+ function Collected({ ticket, children }) {
55
+ const reader = (0, ssr_bridge_1.ssrReader)(ticket);
56
+ // In state rather than in an effect, and keyed on nothing: children render
57
+ // immediately after this component, and both the source and the payloads have
58
+ // to be in place before the first of them asks for a query.
59
+ const [source] = (0, react_1.useState)(() => {
60
+ if (!reader) {
61
+ (0, hydrate_1.hydrateOnce)((0, connection_1.activeConnection)(), deliveredPayloads(ticket));
62
+ return null;
63
+ }
64
+ return new ssr_source_1.SsrQuerySource(reader);
65
+ });
66
+ return ((0, jsx_runtime_1.jsxs)(connection_context_1.SourceScope, { value: source, children: [children, (0, jsx_runtime_1.jsx)(Payloads, { ticket: ticket, reader: reader })] }));
67
+ }
68
+ /**
69
+ * What keeps the fallback out of the server's HTML.
70
+ *
71
+ * A component that reads a live query suspends, because the answer comes from
72
+ * the database rather than from memory, and React's streaming server does not
73
+ * wait for a boundary: it writes the fallback into the shell, sends it, and
74
+ * patches the rows in afterwards with a script. Everything arrives, and the
75
+ * first paint is still a spinner — which is the one thing prerendering was for.
76
+ *
77
+ * So this renders as a sibling *outside* the boundary and suspends there. A
78
+ * suspension with no boundary above it has nothing to fall back to, so React
79
+ * holds the shell instead of flushing it — and by the time this resolves, the
80
+ * boundary beside it has its answers and is written out complete, in place,
81
+ * with the rows in it.
82
+ *
83
+ * It renders nothing, on both sides, so there is no markup for the two to
84
+ * disagree about. In a browser it finds no reader and does not suspend at all:
85
+ * the boundary is then an ordinary one, waiting for the socket.
86
+ *
87
+ * The cost is honest and it is the point: the HTML now waits for the page's own
88
+ * queries. A page whose data is slow was never going to paint sooner — it was
89
+ * only going to paint a spinner sooner. A route with a `loading.tsx` keeps its
90
+ * own answer to that: Next's boundary is above this one, so that file is what
91
+ * the browser gets while the page reads, which is what it is for.
92
+ */
93
+ function ShellGate({ ticket }) {
94
+ const reader = (0, ssr_bridge_1.ssrReader)(ticket);
95
+ if (reader)
96
+ collectedOf(reader);
97
+ return null;
98
+ }
99
+ /**
100
+ * What the render read, on its way to the browser.
101
+ *
102
+ * It is a sibling *after* the children on purpose. React renders siblings in
103
+ * order, so by the time this one runs the components above it have asked for
104
+ * everything they are going to ask for — and it waits for those answers before
105
+ * writing anything, which is what makes the list complete rather than whatever
106
+ * happened to have resolved first.
107
+ *
108
+ * The same markup is produced in the browser, read back out of the global the
109
+ * script itself set, because a node the server wrote and the client did not is a
110
+ * hydration mismatch. Hydrating an existing `<script>` does not re-run it.
111
+ */
112
+ function Payloads({ ticket, reader }) {
113
+ const payloads = reader ? collectedOf(reader) : deliveredPayloads(ticket);
114
+ if (!payloads?.length)
115
+ return null;
116
+ return ((0, jsx_runtime_1.jsx)("script", { suppressHydrationWarning: true, dangerouslySetInnerHTML: { __html: script(ticket, payloads) } }));
117
+ }
118
+ function script(ticket, payloads) {
119
+ // `<` is escaped because the JSON travels inside an inline script, where a
120
+ // `</script>` in any string value would end the element early. The rest of
121
+ // HTML escaping does not apply inside one.
122
+ const json = JSON.stringify(payloads).replace(/</g, "\\u003c");
123
+ return `(window.${ssr_bridge_1.SSR_PAYLOAD_GLOBAL}=window.${ssr_bridge_1.SSR_PAYLOAD_GLOBAL}||{})[${JSON.stringify(ticket)}]=${json}`;
124
+ }
125
+ function deliveredPayloads(ticket) {
126
+ const global = globalThis;
127
+ return global[ssr_bridge_1.SSR_PAYLOAD_GLOBAL]?.[ticket];
128
+ }
129
+ /**
130
+ * The collected payloads, as something a component can read during render.
131
+ *
132
+ * Suspends on the first call and resolves on a later one, so the record has to
133
+ * outlive the render that started it: throwing a fresh promise every attempt
134
+ * would be a boundary that never settles. Two components ask for it — the gate
135
+ * that holds the shell and the script that carries the payloads to the browser —
136
+ * and both have to be answered from the one collection, or the second would wait
137
+ * for a render that has already gone quiet.
138
+ *
139
+ * Keyed on the reader rather than on the ticket, so a finished render takes its
140
+ * record with it instead of leaving one behind for a string nobody will ask
141
+ * about again.
142
+ */
143
+ const collecting = new WeakMap();
144
+ function collectedOf(reader) {
145
+ let record = collecting.get(reader);
146
+ if (!record) {
147
+ const started = {
148
+ promise: undefined,
149
+ };
150
+ started.promise = reader.collected().then((value) => {
151
+ started.value = value;
152
+ },
153
+ // A collector that failed is not a page that failed: the queries it
154
+ // could not answer are the browser's to open, and the render below
155
+ // has already fallen back to whatever it renders without data.
156
+ () => {
157
+ started.value = [];
158
+ });
159
+ collecting.set(reader, started);
160
+ record = started;
161
+ }
162
+ if (!record.value)
163
+ throw record.promise;
164
+ return record.value;
165
+ }
@@ -0,0 +1,64 @@
1
+ import { type ReactNode } from "react";
2
+ import { type NowityConnectionOptions } from "../client/connection";
3
+ import type { HydrationPayload } from "../core/protocol";
4
+ export interface NowityProviderProps extends Partial<Omit<NowityConnectionOptions, "transport" | "clientId">> {
5
+ /** Where the socket is served, on this page's own origin. Default `/_nowity`. */
6
+ path?: string;
7
+ /**
8
+ * What a server component already read (`prerender`).
9
+ *
10
+ * Applied during this component's own render, before anything below it can
11
+ * ask for a query, so the first paint has the rows instead of a fallback that
12
+ * resolves into them. The server's authoritative snapshot replaces them as
13
+ * soon as the socket is up.
14
+ */
15
+ hydrate?: HydrationPayload[];
16
+ /**
17
+ * Identity of this connection's mutation numbering. Minted per connection
18
+ * unless given, which is the only scope in which two of them cannot collide.
19
+ */
20
+ clientId?: string;
21
+ children: ReactNode;
22
+ }
23
+ /**
24
+ * Connects, once, at the top of the tree.
25
+ *
26
+ * ```tsx
27
+ * <NowityProvider>{children}</NowityProvider>
28
+ * ```
29
+ *
30
+ * There is no address to pass: the socket is served by the same origin as the
31
+ * page — same host, same port, `wss:` when the page is `https:`, because a
32
+ * secure page may not open an insecure socket. Who is connecting is the server's
33
+ * business, read from the request the way any other request is authenticated,
34
+ * rather than something a component has to know and put in a URL.
35
+ *
36
+ * It renders on the server too, where there is no socket to open, so that side
37
+ * gets a connection that goes nowhere and every query simply has no data yet.
38
+ * The browser then loads it for real.
39
+ */
40
+ export declare function NowityProvider({ path, clientId, hydrate, children, ...options }: NowityProviderProps): ReactNode;
41
+ /**
42
+ * Who this connection is, as far as its own writes are concerned.
43
+ *
44
+ * Mutation ids are a sequence per client, and the server acknowledges one it has
45
+ * already seen without applying it again — which is what makes a mutation
46
+ * resent after a reconnect land exactly once. The other side of that bargain is
47
+ * unforgiving: two writers sharing an id means the second one's mutation 1 is
48
+ * indistinguishable from a replay of the first's, so it is acknowledged, never
49
+ * applied, and the write is silently gone.
50
+ *
51
+ * So the id is minted here and stored nowhere. Nothing needs it to outlive the
52
+ * connection: the sequence has to survive a *reconnect*, which it does because
53
+ * the connection object does, and a reload takes the pending queue with the page
54
+ * — there is nothing left for a remembered id to identify.
55
+ *
56
+ * Remembering it is what breaks. `localStorage` is shared by every tab of an
57
+ * origin, which is obviously wrong; `sessionStorage` looks right and is not,
58
+ * because a window opened from another one — duplicate tab, `window.open`, a
59
+ * link opened in a new window — is handed a *copy* of it. Two windows, one id,
60
+ * and every write from the second one acknowledged into nothing. A fresh id per
61
+ * connection cannot collide with anything, whichever way the window was opened.
62
+ */
63
+ export declare function browserClientId(): string;
64
+ //# sourceMappingURL=provider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../../src/react/provider.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,EAIH,KAAK,uBAAuB,EAC/B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAIzD,MAAM,WAAW,mBACb,SAAQ,OAAO,CAAC,IAAI,CAAC,uBAAuB,EAAE,WAAW,GAAG,UAAU,CAAC,CAAC;IACxE,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC7B;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,cAAc,CAAC,EAC3B,IAAI,EACJ,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,GAAG,OAAO,EACb,EAAE,mBAAmB,aAcrB;AAqED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAExC"}
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ "use client";
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.NowityProvider = NowityProvider;
5
+ exports.browserClientId = browserClientId;
6
+ const react_1 = require("react");
7
+ const connection_1 = require("../client/connection");
8
+ const null_transport_1 = require("../client/null-transport");
9
+ const ws_transport_1 = require("../client/ws-transport");
10
+ const client_1 = require("../ironbean/client");
11
+ const hydrate_1 = require("./hydrate");
12
+ /**
13
+ * Connects, once, at the top of the tree.
14
+ *
15
+ * ```tsx
16
+ * <NowityProvider>{children}</NowityProvider>
17
+ * ```
18
+ *
19
+ * There is no address to pass: the socket is served by the same origin as the
20
+ * page — same host, same port, `wss:` when the page is `https:`, because a
21
+ * secure page may not open an insecure socket. Who is connecting is the server's
22
+ * business, read from the request the way any other request is authenticated,
23
+ * rather than something a component has to know and put in a URL.
24
+ *
25
+ * It renders on the server too, where there is no socket to open, so that side
26
+ * gets a connection that goes nowhere and every query simply has no data yet.
27
+ * The browser then loads it for real.
28
+ */
29
+ function NowityProvider({ path, clientId, hydrate, children, ...options }) {
30
+ // In state, not an effect: children render immediately after this component,
31
+ // and a connection that only appeared afterwards would leave their first
32
+ // render with nothing to subscribe to. The connection itself is shared, not
33
+ // owned by this component — React calls a state initialiser twice in strict
34
+ // mode, and a remount would otherwise open a second socket while the first
35
+ // one is still up.
36
+ (0, react_1.useState)(() => {
37
+ const connection = shared(path, clientId, options);
38
+ (0, hydrate_1.hydrateOnce)(connection, hydrate);
39
+ return connection;
40
+ });
41
+ return children;
42
+ }
43
+ const SOCKET_URL = Symbol.for("nowity.connectionUrl");
44
+ function urlSlot() {
45
+ const global = globalThis;
46
+ return (global[SOCKET_URL] ?? (global[SOCKET_URL] = {}));
47
+ }
48
+ function shared(path, clientId, options) {
49
+ const browser = typeof window !== "undefined";
50
+ const url = browser ? sameOrigin(path ?? "/_nowity") : "";
51
+ // One connection per browser session, kept where a module reload cannot lose
52
+ // it: in development Fast Refresh re-evaluates these files, and a connection
53
+ // held in a module variable would vanish while the component that opened it
54
+ // stayed mounted.
55
+ const existing = (0, connection_1.currentConnection)();
56
+ if (existing && urlSlot().current === url)
57
+ return existing;
58
+ // The address changed, which in practice means the session did — a different
59
+ // user, a different tenant. The old socket is authenticated as somebody else
60
+ // and cannot be reused, and reusing it is worse than obvious: the page
61
+ // renders as one identity while the server answers as another.
62
+ if (existing)
63
+ existing.close();
64
+ // In the browser the connection goes into the container: every contract is
65
+ // bound to a proxy over it, so `getBean(DocumentApi)` is the same line here as
66
+ // on the server and only what it resolves to differs.
67
+ //
68
+ // On the server it deliberately is not. This code also runs while Next
69
+ // renders client components, in the process that holds the *server*
70
+ // container — binding the same tokens there would replace the
71
+ // implementations with proxies, for that request and every one after it.
72
+ // Components rendered on the server read through `useQuery`, which goes to
73
+ // the connection rather than through the container.
74
+ const connection = browser
75
+ ? (0, client_1.configureNowityClient)({
76
+ ...options,
77
+ transport: new ws_transport_1.WebSocketTransport({ url }),
78
+ clientId: clientId ?? browserClientId(),
79
+ autoConnect: false,
80
+ })
81
+ : new connection_1.NowityConnection({
82
+ ...options,
83
+ transport: new null_transport_1.NullTransport(),
84
+ clientId: clientId ?? "ssr",
85
+ });
86
+ urlSlot().current = url;
87
+ if (!browser)
88
+ (0, connection_1.setActiveConnection)(connection);
89
+ if (browser)
90
+ connection.connect();
91
+ return connection;
92
+ }
93
+ function sameOrigin(path) {
94
+ const { protocol, host, search } = window.location;
95
+ const scheme = protocol === "https:" ? "wss:" : "ws:";
96
+ // The page's own query string comes along unless the path brings its own.
97
+ // The socket stands in for the session the page is being viewed under, and
98
+ // an application without a login has nowhere else to say which one that is.
99
+ const query = path.includes("?") ? "" : search;
100
+ return `${scheme}//${host}${path.startsWith("/") ? "" : "/"}${path}${query}`;
101
+ }
102
+ /**
103
+ * Who this connection is, as far as its own writes are concerned.
104
+ *
105
+ * Mutation ids are a sequence per client, and the server acknowledges one it has
106
+ * already seen without applying it again — which is what makes a mutation
107
+ * resent after a reconnect land exactly once. The other side of that bargain is
108
+ * unforgiving: two writers sharing an id means the second one's mutation 1 is
109
+ * indistinguishable from a replay of the first's, so it is acknowledged, never
110
+ * applied, and the write is silently gone.
111
+ *
112
+ * So the id is minted here and stored nowhere. Nothing needs it to outlive the
113
+ * connection: the sequence has to survive a *reconnect*, which it does because
114
+ * the connection object does, and a reload takes the pending queue with the page
115
+ * — there is nothing left for a remembered id to identify.
116
+ *
117
+ * Remembering it is what breaks. `localStorage` is shared by every tab of an
118
+ * origin, which is obviously wrong; `sessionStorage` looks right and is not,
119
+ * because a window opened from another one — duplicate tab, `window.open`, a
120
+ * link opened in a new window — is handed a *copy* of it. Two windows, one id,
121
+ * and every write from the second one acknowledged into nothing. A fresh id per
122
+ * connection cannot collide with anything, whichever way the window was opened.
123
+ */
124
+ function browserClientId() {
125
+ return freshId();
126
+ }
127
+ function freshId() {
128
+ const webCrypto = globalThis.crypto;
129
+ return webCrypto?.randomUUID?.() ?? Math.random().toString(36).slice(2);
130
+ }
@@ -0,0 +1,31 @@
1
+ import { type Forbidden } from "../api/errors";
2
+ /** One `<Restricted>` boundary's baton. */
3
+ export interface RefusalScope {
4
+ refusal: Forbidden | null;
5
+ /**
6
+ * What the subtree is waiting on, when it is waiting rather than refused.
7
+ *
8
+ * The boundary's fallback is rendered for both, and the order is the awkward
9
+ * part: a query waits before it is refused, so the fallback renders *first*
10
+ * for the wait and only afterwards for the refusal. It therefore has to be
11
+ * able to say "not yet, and not mine" — which it does by suspending on this,
12
+ * handing the subtree to the next boundary up. On the promise the query is
13
+ * actually waiting for, so that when it settles React comes back and asks
14
+ * again, by which time the refusal is on the baton beside it.
15
+ */
16
+ pending: Promise<void> | null;
17
+ }
18
+ export declare const RefusalContext: import("react").Context<RefusalScope | null>;
19
+ /** The nearest boundary's baton, or null where there is no boundary above. */
20
+ export declare function useRefusalScope(): RefusalScope | null;
21
+ /**
22
+ * Leave a refusal for the boundary above, and hand it back to be thrown.
23
+ *
24
+ * Written for every refusal, not only on a server: which of the two paths picks
25
+ * it up is React's decision, not ours, and a baton nobody collects is cleared by
26
+ * the boundary's next render.
27
+ */
28
+ export declare function refuse<E extends Error>(scope: RefusalScope | null, problem: E): E;
29
+ /** The same, for a wait: what the boundary's fallback should suspend on instead. */
30
+ export declare function waitOn(scope: RefusalScope | null, settled: Promise<void>): Promise<void>;
31
+ //# sourceMappingURL=refusals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"refusals.d.ts","sourceRoot":"","sources":["../../src/react/refusals.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,eAAe,CAAC;AAE5D,2CAA2C;AAC3C,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,SAAS,GAAG,IAAI,CAAC;IAC1B;;;;;;;;;;OAUG;IACH,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;CACjC;AAED,eAAO,MAAM,cAAc,8CAA2C,CAAC;AAEvE,8EAA8E;AAC9E,wBAAgB,eAAe,IAAI,YAAY,GAAG,IAAI,CAErD;AAED;;;;;;GAMG;AACH,wBAAgB,MAAM,CAAC,CAAC,SAAS,KAAK,EAAE,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAGjF;AAED,oFAAoF;AACpF,wBAAgB,MAAM,CAAC,KAAK,EAAE,YAAY,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxF"}