@absolutejs/absolute 0.19.0-beta.807 → 0.19.0-beta.809

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 (260) hide show
  1. package/dist/angular/browser.js +9801 -57
  2. package/dist/angular/browser.js.map +246 -4
  3. package/dist/angular/components/core/streamingSlotRegistrar.js +1 -1
  4. package/dist/angular/components/core/streamingSlotRegistry.js +2 -2
  5. package/dist/angular/index.js +14877 -60
  6. package/dist/angular/index.js.map +281 -4
  7. package/dist/angular/server.js +5610 -45
  8. package/dist/angular/server.js.map +51 -3
  9. package/dist/build.js +18092 -45
  10. package/dist/build.js.map +99 -3
  11. package/dist/cli/index.js +317 -86
  12. package/dist/client/index.js +1091 -70
  13. package/dist/client/index.js.map +24 -4
  14. package/dist/core/streamingSlotRegistrar.js +108 -11
  15. package/dist/core/streamingSlotRegistrar.js.map +4 -3
  16. package/dist/core/streamingSlotRegistry.js +169 -7
  17. package/dist/core/streamingSlotRegistry.js.map +5 -3
  18. package/dist/index.js +19957 -547
  19. package/dist/index.js.map +116 -3
  20. package/dist/islands/browser.js +228 -9
  21. package/dist/islands/browser.js.map +9 -4
  22. package/dist/islands/index.js +1908 -17
  23. package/dist/islands/index.js.map +27 -3
  24. package/dist/react/browser.js +328 -12
  25. package/dist/react/browser.js.map +12 -4
  26. package/dist/react/components/index.js +167 -16
  27. package/dist/react/components/index.js.map +6 -3
  28. package/dist/react/hooks/index.js +183 -8
  29. package/dist/react/hooks/index.js.map +7 -3
  30. package/dist/react/index.js +3627 -36
  31. package/dist/react/index.js.map +45 -4
  32. package/dist/react/jsxDevRuntimeCompat.js +61 -2
  33. package/dist/react/jsxDevRuntimeCompat.js.map +2 -2
  34. package/dist/react/server.js +1789 -18
  35. package/dist/react/server.js.map +21 -3
  36. package/dist/src/angular/injectorPatch.d.ts +1 -0
  37. package/dist/src/angular/islands.d.ts +1 -0
  38. package/dist/src/client/hydrators/react.d.ts +3 -0
  39. package/dist/src/client/hydrators/svelte.d.ts +2 -0
  40. package/dist/src/client/hydrators/vue.d.ts +2 -0
  41. package/dist/src/index.d.ts +1 -0
  42. package/dist/svelte/browser.js +247 -12
  43. package/dist/svelte/browser.js.map +10 -3
  44. package/dist/svelte/index.js +3732 -37
  45. package/dist/svelte/index.js.map +47 -4
  46. package/dist/svelte/server.js +2794 -21
  47. package/dist/svelte/server.js.map +27 -3
  48. package/dist/vue/browser.js +348 -12
  49. package/dist/vue/browser.js.map +12 -4
  50. package/dist/vue/components/Image.js +240 -7
  51. package/dist/vue/components/Image.js.map +6 -3
  52. package/dist/vue/components/index.js +544 -11
  53. package/dist/vue/components/index.js.map +9 -3
  54. package/dist/vue/index.js +4212 -52
  55. package/dist/vue/index.js.map +50 -4
  56. package/dist/vue/server.js +1849 -18
  57. package/dist/vue/server.js.map +21 -3
  58. package/package.json +1 -1
  59. package/dist/chunk-0867j0r0.js +0 -136
  60. package/dist/chunk-0867j0r0.js.map +0 -10
  61. package/dist/chunk-102fp7xe.js +0 -63
  62. package/dist/chunk-102fp7xe.js.map +0 -10
  63. package/dist/chunk-11zpfqz6.js +0 -19
  64. package/dist/chunk-11zpfqz6.js.map +0 -10
  65. package/dist/chunk-1rfh7hw9.js +0 -319
  66. package/dist/chunk-1rfh7hw9.js.map +0 -11
  67. package/dist/chunk-1x4fxm57.js +0 -51
  68. package/dist/chunk-1x4fxm57.js.map +0 -9
  69. package/dist/chunk-25v9t56f.js +0 -29
  70. package/dist/chunk-25v9t56f.js.map +0 -11
  71. package/dist/chunk-2f21eenc.js +0 -21
  72. package/dist/chunk-2f21eenc.js.map +0 -10
  73. package/dist/chunk-2ga2znex.js +0 -13
  74. package/dist/chunk-2ga2znex.js.map +0 -9
  75. package/dist/chunk-30yrw0f6.js +0 -33
  76. package/dist/chunk-30yrw0f6.js.map +0 -10
  77. package/dist/chunk-3g91wb4f.js +0 -358
  78. package/dist/chunk-3g91wb4f.js.map +0 -10
  79. package/dist/chunk-3rea1gam.js +0 -4403
  80. package/dist/chunk-3rea1gam.js.map +0 -28
  81. package/dist/chunk-3yjzpcne.js +0 -34
  82. package/dist/chunk-3yjzpcne.js.map +0 -10
  83. package/dist/chunk-41bf6aqt.js +0 -17
  84. package/dist/chunk-41bf6aqt.js.map +0 -9
  85. package/dist/chunk-4d39r92n.js +0 -81
  86. package/dist/chunk-4d39r92n.js.map +0 -10
  87. package/dist/chunk-5003emhv.js +0 -17
  88. package/dist/chunk-5003emhv.js.map +0 -10
  89. package/dist/chunk-5f67rsed.js +0 -466
  90. package/dist/chunk-5f67rsed.js.map +0 -10
  91. package/dist/chunk-5fhp1jap.js +0 -9169
  92. package/dist/chunk-5fhp1jap.js.map +0 -236
  93. package/dist/chunk-629x0yh4.js +0 -20
  94. package/dist/chunk-629x0yh4.js.map +0 -9
  95. package/dist/chunk-6pdj08z3.js +0 -73
  96. package/dist/chunk-6pdj08z3.js.map +0 -12
  97. package/dist/chunk-6qjbrt0k.js +0 -13
  98. package/dist/chunk-6qjbrt0k.js.map +0 -9
  99. package/dist/chunk-6sccb4jr.js +0 -14
  100. package/dist/chunk-6sccb4jr.js.map +0 -9
  101. package/dist/chunk-798spvzv.js +0 -50
  102. package/dist/chunk-798spvzv.js.map +0 -10
  103. package/dist/chunk-7fw6x3js.js +0 -131
  104. package/dist/chunk-7fw6x3js.js.map +0 -11
  105. package/dist/chunk-7kjj42xm.js +0 -11
  106. package/dist/chunk-7kjj42xm.js.map +0 -10
  107. package/dist/chunk-7mtstdqn.js +0 -90
  108. package/dist/chunk-7mtstdqn.js.map +0 -10
  109. package/dist/chunk-851whwc7.js +0 -17
  110. package/dist/chunk-851whwc7.js.map +0 -10
  111. package/dist/chunk-85n68sy6.js +0 -103
  112. package/dist/chunk-85n68sy6.js.map +0 -10
  113. package/dist/chunk-8kcfffry.js +0 -35
  114. package/dist/chunk-8kcfffry.js.map +0 -10
  115. package/dist/chunk-92fsjfpp.js +0 -1731
  116. package/dist/chunk-92fsjfpp.js.map +0 -11
  117. package/dist/chunk-93sqk7be.js +0 -139
  118. package/dist/chunk-93sqk7be.js.map +0 -12
  119. package/dist/chunk-9c5tj4k3.js +0 -130
  120. package/dist/chunk-9c5tj4k3.js.map +0 -10
  121. package/dist/chunk-9j59emg3.js +0 -184
  122. package/dist/chunk-9j59emg3.js.map +0 -11
  123. package/dist/chunk-9ve9jq72.js +0 -203
  124. package/dist/chunk-9ve9jq72.js.map +0 -10
  125. package/dist/chunk-9xrsjeem.js +0 -12
  126. package/dist/chunk-9xrsjeem.js.map +0 -9
  127. package/dist/chunk-a9mvyp04.js +0 -87
  128. package/dist/chunk-a9mvyp04.js.map +0 -10
  129. package/dist/chunk-b3gbnrwe.js +0 -21
  130. package/dist/chunk-b3gbnrwe.js.map +0 -10
  131. package/dist/chunk-bgb8k1qs.js +0 -672
  132. package/dist/chunk-bgb8k1qs.js.map +0 -15
  133. package/dist/chunk-bmgqm774.js +0 -65
  134. package/dist/chunk-bmgqm774.js.map +0 -9
  135. package/dist/chunk-bxfghpma.js +0 -69
  136. package/dist/chunk-bxfghpma.js.map +0 -10
  137. package/dist/chunk-c1jfjnka.js +0 -74
  138. package/dist/chunk-c1jfjnka.js.map +0 -10
  139. package/dist/chunk-cbkrwmvh.js +0 -80
  140. package/dist/chunk-cbkrwmvh.js.map +0 -10
  141. package/dist/chunk-cdxd7sy2.js +0 -71
  142. package/dist/chunk-cdxd7sy2.js.map +0 -10
  143. package/dist/chunk-cg95827x.js +0 -21
  144. package/dist/chunk-cg95827x.js.map +0 -10
  145. package/dist/chunk-cm0g4q6w.js +0 -149
  146. package/dist/chunk-cm0g4q6w.js.map +0 -10
  147. package/dist/chunk-d7mwkzry.js +0 -261
  148. package/dist/chunk-d7mwkzry.js.map +0 -10
  149. package/dist/chunk-d9c0am65.js +0 -12
  150. package/dist/chunk-d9c0am65.js.map +0 -10
  151. package/dist/chunk-daqghmg8.js +0 -12
  152. package/dist/chunk-daqghmg8.js.map +0 -9
  153. package/dist/chunk-e3r9fxaa.js +0 -149
  154. package/dist/chunk-e3r9fxaa.js.map +0 -10
  155. package/dist/chunk-e8eecyrq.js +0 -244
  156. package/dist/chunk-e8eecyrq.js.map +0 -10
  157. package/dist/chunk-ex2hxe0v.js +0 -160
  158. package/dist/chunk-ex2hxe0v.js.map +0 -11
  159. package/dist/chunk-fak944et.js +0 -91
  160. package/dist/chunk-fak944et.js.map +0 -10
  161. package/dist/chunk-fygx2ymm.js +0 -118
  162. package/dist/chunk-fygx2ymm.js.map +0 -12
  163. package/dist/chunk-g15qj669.js +0 -271
  164. package/dist/chunk-g15qj669.js.map +0 -11
  165. package/dist/chunk-gd6wmknh.js +0 -121
  166. package/dist/chunk-gd6wmknh.js.map +0 -11
  167. package/dist/chunk-gf0ygptk.js +0 -85
  168. package/dist/chunk-gf0ygptk.js.map +0 -11
  169. package/dist/chunk-gytkmthr.js +0 -220
  170. package/dist/chunk-gytkmthr.js.map +0 -10
  171. package/dist/chunk-h5bbfn3n.js +0 -28
  172. package/dist/chunk-h5bbfn3n.js.map +0 -11
  173. package/dist/chunk-h6mye9r3.js +0 -93
  174. package/dist/chunk-h6mye9r3.js.map +0 -10
  175. package/dist/chunk-hcsmxw1v.js +0 -85
  176. package/dist/chunk-hcsmxw1v.js.map +0 -10
  177. package/dist/chunk-hyjs4bqs.js +0 -8
  178. package/dist/chunk-hyjs4bqs.js.map +0 -10
  179. package/dist/chunk-jn91vzkh.js +0 -66
  180. package/dist/chunk-jn91vzkh.js.map +0 -10
  181. package/dist/chunk-jpkjdgsk.js +0 -167
  182. package/dist/chunk-jpkjdgsk.js.map +0 -11
  183. package/dist/chunk-jwxt8gnp.js +0 -13
  184. package/dist/chunk-jwxt8gnp.js.map +0 -9
  185. package/dist/chunk-kk8w9rh5.js +0 -195
  186. package/dist/chunk-kk8w9rh5.js.map +0 -10
  187. package/dist/chunk-kwgh8rmg.js +0 -426
  188. package/dist/chunk-kwgh8rmg.js.map +0 -14
  189. package/dist/chunk-m97ze5hz.js +0 -46
  190. package/dist/chunk-m97ze5hz.js.map +0 -10
  191. package/dist/chunk-mbazhahf.js +0 -60
  192. package/dist/chunk-mbazhahf.js.map +0 -10
  193. package/dist/chunk-mgfwq18r.js +0 -15
  194. package/dist/chunk-mgfwq18r.js.map +0 -9
  195. package/dist/chunk-mtgf69xn.js +0 -88
  196. package/dist/chunk-mtgf69xn.js.map +0 -10
  197. package/dist/chunk-mtxzyxpg.js +0 -102
  198. package/dist/chunk-mtxzyxpg.js.map +0 -10
  199. package/dist/chunk-nehhtthw.js +0 -225
  200. package/dist/chunk-nehhtthw.js.map +0 -10
  201. package/dist/chunk-p5504p14.js +0 -16
  202. package/dist/chunk-p5504p14.js.map +0 -10
  203. package/dist/chunk-p5zgj77m.js +0 -184
  204. package/dist/chunk-p5zgj77m.js.map +0 -10
  205. package/dist/chunk-pnscgw95.js +0 -90
  206. package/dist/chunk-pnscgw95.js.map +0 -10
  207. package/dist/chunk-pvpp4pvs.js +0 -17
  208. package/dist/chunk-pvpp4pvs.js.map +0 -10
  209. package/dist/chunk-qh75agse.js +0 -95
  210. package/dist/chunk-qh75agse.js.map +0 -10
  211. package/dist/chunk-qxq2zcty.js +0 -52
  212. package/dist/chunk-qxq2zcty.js.map +0 -10
  213. package/dist/chunk-r6e8pytx.js +0 -22
  214. package/dist/chunk-r6e8pytx.js.map +0 -9
  215. package/dist/chunk-r7jmgqnw.js +0 -114
  216. package/dist/chunk-r7jmgqnw.js.map +0 -10
  217. package/dist/chunk-s6defjk2.js +0 -116
  218. package/dist/chunk-s6defjk2.js.map +0 -10
  219. package/dist/chunk-sd39p726.js +0 -619
  220. package/dist/chunk-sd39p726.js.map +0 -10
  221. package/dist/chunk-swrnzs4c.js +0 -63
  222. package/dist/chunk-swrnzs4c.js.map +0 -10
  223. package/dist/chunk-tfe3sb44.js +0 -33
  224. package/dist/chunk-tfe3sb44.js.map +0 -10
  225. package/dist/chunk-tjr0kcev.js +0 -41
  226. package/dist/chunk-tjr0kcev.js.map +0 -9
  227. package/dist/chunk-tx9edm1x.js +0 -34
  228. package/dist/chunk-tx9edm1x.js.map +0 -10
  229. package/dist/chunk-txhm2vb5.js +0 -18
  230. package/dist/chunk-txhm2vb5.js.map +0 -9
  231. package/dist/chunk-v5vmsxmy.js +0 -526
  232. package/dist/chunk-v5vmsxmy.js.map +0 -12
  233. package/dist/chunk-vjhxm8n2.js +0 -29
  234. package/dist/chunk-vjhxm8n2.js.map +0 -9
  235. package/dist/chunk-vkrpm7kc.js +0 -247
  236. package/dist/chunk-vkrpm7kc.js.map +0 -12
  237. package/dist/chunk-w3m4m5we.js +0 -4925
  238. package/dist/chunk-w3m4m5we.js.map +0 -12
  239. package/dist/chunk-wrxtn9ve.js +0 -18
  240. package/dist/chunk-wrxtn9ve.js.map +0 -10
  241. package/dist/chunk-x09cskqd.js +0 -377
  242. package/dist/chunk-x09cskqd.js.map +0 -10
  243. package/dist/chunk-xnt8c6h2.js +0 -576
  244. package/dist/chunk-xnt8c6h2.js.map +0 -10
  245. package/dist/chunk-xw0tx842.js +0 -13
  246. package/dist/chunk-xw0tx842.js.map +0 -9
  247. package/dist/chunk-xx5b6b9m.js +0 -69
  248. package/dist/chunk-xx5b6b9m.js.map +0 -10
  249. package/dist/chunk-xz1kdswj.js +0 -21
  250. package/dist/chunk-xz1kdswj.js.map +0 -9
  251. package/dist/chunk-y84qnsd3.js +0 -32
  252. package/dist/chunk-y84qnsd3.js.map +0 -10
  253. package/dist/chunk-ywjn0rad.js +0 -14
  254. package/dist/chunk-ywjn0rad.js.map +0 -9
  255. package/dist/chunk-z9nvhm6r.js +0 -13
  256. package/dist/chunk-z9nvhm6r.js.map +0 -9
  257. package/dist/chunk-zhmvdpk6.js +0 -15
  258. package/dist/chunk-zhmvdpk6.js.map +0 -9
  259. package/dist/chunk-zrg9d4zw.js +0 -784
  260. package/dist/chunk-zrg9d4zw.js.map +0 -10
@@ -1,14 +1,176 @@
1
1
  // @bun
2
- import {
3
- hasActiveStreamingSlotRegistry,
4
- runWithStreamingSlotRegistry
5
- } from "../chunk-c1jfjnka.js";
6
- import"../chunk-qxq2zcty.js";
7
- import"../chunk-bmgqm774.js";
2
+ var __create = Object.create;
3
+ var __getProtoOf = Object.getPrototypeOf;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ function __accessProp(key) {
8
+ return this[key];
9
+ }
10
+ var __toESMCache_node;
11
+ var __toESMCache_esm;
12
+ var __toESM = (mod, isNodeMode, target) => {
13
+ var canCache = mod != null && typeof mod === "object";
14
+ if (canCache) {
15
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
+ var cached = cache.get(mod);
17
+ if (cached)
18
+ return cached;
19
+ }
20
+ target = mod != null ? __create(__getProtoOf(mod)) : {};
21
+ const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
+ for (let key of __getOwnPropNames(mod))
23
+ if (!__hasOwnProp.call(to, key))
24
+ __defProp(to, key, {
25
+ get: __accessProp.bind(mod, key),
26
+ enumerable: true
27
+ });
28
+ if (canCache)
29
+ cache.set(mod, to);
30
+ return to;
31
+ };
32
+ var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
+ var __returnValue = (v) => v;
34
+ function __exportSetter(name, newValue) {
35
+ this[name] = __returnValue.bind(null, newValue);
36
+ }
37
+ var __export = (target, all) => {
38
+ for (var name in all)
39
+ __defProp(target, name, {
40
+ get: all[name],
41
+ enumerable: true,
42
+ configurable: true,
43
+ set: __exportSetter.bind(all, name)
44
+ });
45
+ };
46
+ var __legacyDecorateClassTS = function(decorators, target, key, desc) {
47
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
48
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
49
+ r = Reflect.decorate(decorators, target, key, desc);
50
+ else
51
+ for (var i = decorators.length - 1;i >= 0; i--)
52
+ if (d = decorators[i])
53
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
54
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
55
+ };
56
+ var __legacyMetadataTS = (k, v) => {
57
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
58
+ return Reflect.metadata(k, v);
59
+ };
60
+ var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
61
+ var __require = import.meta.require;
62
+
63
+ // src/core/streamingSlotRegistrar.ts
64
+ var STREAMING_SLOT_REGISTRAR_KEY = Symbol.for("absolutejs.streamingSlotRegistrar");
65
+ var STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotWarningController");
66
+ var STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotCollectionController");
67
+ var getRegisteredStreamingSlotRegistrar = () => {
68
+ const value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);
69
+ if (typeof value === "function" || value === null) {
70
+ return value;
71
+ }
72
+ return;
73
+ };
74
+ var isObjectRecord = (value) => Boolean(value) && typeof value === "object";
75
+ var isStreamingSlotWarningController = (value) => isObjectRecord(value) && ("maybeWarn" in value) && typeof value.maybeWarn === "function";
76
+ var isStreamingSlotCollectionController = (value) => isObjectRecord(value) && ("isCollecting" in value) && typeof value.isCollecting === "function";
77
+ var getWarningController = () => {
78
+ const value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);
79
+ if (value === null || typeof value === "undefined")
80
+ return;
81
+ return isStreamingSlotWarningController(value) ? value : undefined;
82
+ };
83
+ var getCollectionController = () => {
84
+ const value = Reflect.get(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY);
85
+ if (value === null || typeof value === "undefined")
86
+ return;
87
+ return isStreamingSlotCollectionController(value) ? value : undefined;
88
+ };
89
+ var hasRegisteredStreamingSlotRegistrar = () => typeof getRegisteredStreamingSlotRegistrar() === "function";
90
+ var isStreamingSlotCollectionActive = () => getCollectionController()?.isCollecting() === true;
91
+ var registerStreamingSlot = (slot) => {
92
+ getRegisteredStreamingSlotRegistrar()?.(slot);
93
+ };
94
+ var setStreamingSlotCollectionController = (controller) => {
95
+ Reflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);
96
+ };
97
+ var setStreamingSlotRegistrar = (nextRegistrar) => {
98
+ Reflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);
99
+ };
100
+ var setStreamingSlotWarningController = (controller) => {
101
+ Reflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);
102
+ };
103
+ var warnMissingStreamingSlotCollector = (primitiveName) => {
104
+ if (isStreamingSlotCollectionActive()) {
105
+ return;
106
+ }
107
+ getWarningController()?.maybeWarn(primitiveName);
108
+ };
109
+
110
+ // src/core/streamingSlotRegistry.ts
111
+ var STREAMING_SLOT_STORAGE_KEY = Symbol.for("absolutejs.streamingSlotAsyncLocalStorage");
112
+ var isObjectRecord2 = (value) => Boolean(value) && typeof value === "object";
113
+ var isAsyncLocalStorage = (value) => isObjectRecord2(value) && ("getStore" in value) && typeof value.getStore === "function" && ("run" in value) && typeof value.run === "function";
114
+ var getStorageGlobal = () => {
115
+ const value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);
116
+ if (value === null || typeof value === "undefined") {
117
+ return value;
118
+ }
119
+ return isAsyncLocalStorage(value) ? value : undefined;
120
+ };
121
+ var isServerRuntime = () => typeof process !== "undefined" && typeof process.versions?.node === "string";
122
+ var ensureAsyncLocalStorage = async () => {
123
+ const storage = getStorageGlobal();
124
+ if (typeof storage !== "undefined") {
125
+ return storage;
126
+ }
127
+ if (!isServerRuntime()) {
128
+ Reflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);
129
+ return getStorageGlobal();
130
+ }
131
+ const mod = await import("async_hooks");
132
+ Reflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, new mod.AsyncLocalStorage);
133
+ return getStorageGlobal();
134
+ };
135
+ var getActiveSlotStore = () => {
136
+ const storage = getStorageGlobal();
137
+ if (!storage)
138
+ return;
139
+ return storage.getStore();
140
+ };
141
+ var registerStreamingSlot2 = (slot) => {
142
+ const store = getActiveSlotStore();
143
+ if (!store)
144
+ return;
145
+ store.set(slot.id, slot);
146
+ };
147
+ setStreamingSlotRegistrar(registerStreamingSlot2);
148
+ setStreamingSlotCollectionController({
149
+ isCollecting: () => getActiveSlotStore() !== undefined
150
+ });
151
+ var hasActiveStreamingSlotRegistry = () => getActiveSlotStore() !== undefined;
152
+ var runWithStreamingSlotRegistry = async (task) => {
153
+ const storage = await ensureAsyncLocalStorage();
154
+ if (!storage) {
155
+ const slots = [];
156
+ return {
157
+ result: await task(),
158
+ slots
159
+ };
160
+ }
161
+ return storage.run(new Map, async () => {
162
+ const result = await task();
163
+ const store = storage.getStore();
164
+ return {
165
+ result,
166
+ slots: store ? [...store.values()] : []
167
+ };
168
+ });
169
+ };
8
170
  export {
9
171
  runWithStreamingSlotRegistry,
10
172
  hasActiveStreamingSlotRegistry
11
173
  };
12
174
 
13
- //# debugId=DFF1D5F475D796FC64756E2164756E21
175
+ //# debugId=1E0C8696BC3EED4B64756E2164756E21
14
176
  //# sourceMappingURL=streamingSlotRegistry.js.map
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": [],
3
+ "sources": ["../src/core/streamingSlotRegistrar.ts", "../src/core/streamingSlotRegistry.ts"],
4
4
  "sourcesContent": [
5
+ "import type { StreamingSlot } from '../utils/streamingSlots';\n\ntype StreamingSlotRegistrar = (slot: StreamingSlot) => void;\ntype StreamingSlotWarningController = {\n\tmaybeWarn(primitiveName: string): void;\n};\ntype StreamingSlotCollectionController = {\n\tisCollecting(): boolean;\n};\n\nconst STREAMING_SLOT_REGISTRAR_KEY = Symbol.for(\n\t'absolutejs.streamingSlotRegistrar'\n);\nconst STREAMING_SLOT_WARNING_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotWarningController'\n);\nconst STREAMING_SLOT_COLLECTION_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotCollectionController'\n);\n\nconst getRegisteredStreamingSlotRegistrar = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_REGISTRAR_KEY);\n\tif (typeof value === 'function' || value === null) {\n\t\treturn value;\n\t}\n\n\treturn undefined;\n};\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isStreamingSlotWarningController = (\n\tvalue: unknown\n): value is StreamingSlotWarningController =>\n\tisObjectRecord(value) &&\n\t'maybeWarn' in value &&\n\ttypeof value.maybeWarn === 'function';\n\nconst isStreamingSlotCollectionController = (\n\tvalue: unknown\n): value is StreamingSlotCollectionController =>\n\tisObjectRecord(value) &&\n\t'isCollecting' in value &&\n\ttypeof value.isCollecting === 'function';\n\nconst getWarningController = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotWarningController(value) ? value : undefined;\n};\n\nconst getCollectionController = () => {\n\tconst value = Reflect.get(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_COLLECTION_STORAGE_KEY\n\t);\n\tif (value === null || typeof value === 'undefined') return undefined;\n\n\treturn isStreamingSlotCollectionController(value) ? value : undefined;\n};\n\nexport const hasRegisteredStreamingSlotRegistrar = () =>\n\ttypeof getRegisteredStreamingSlotRegistrar() === 'function';\nexport const isStreamingSlotCollectionActive = () =>\n\tgetCollectionController()?.isCollecting() === true;\nexport const registerStreamingSlot = (slot: StreamingSlot) => {\n\tgetRegisteredStreamingSlotRegistrar()?.(slot);\n};\nexport const setStreamingSlotCollectionController = (\n\tcontroller: StreamingSlotCollectionController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_COLLECTION_STORAGE_KEY, controller);\n};\nexport const setStreamingSlotRegistrar = (\n\tnextRegistrar: StreamingSlotRegistrar | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_REGISTRAR_KEY, nextRegistrar);\n};\nexport const setStreamingSlotWarningController = (\n\tcontroller: StreamingSlotWarningController | null\n) => {\n\tReflect.set(globalThis, STREAMING_SLOT_WARNING_STORAGE_KEY, controller);\n};\nexport const warnMissingStreamingSlotCollector = (primitiveName: string) => {\n\tif (\n\t\tprocess.env.NODE_ENV === 'production' ||\n\t\tisStreamingSlotCollectionActive()\n\t) {\n\t\treturn;\n\t}\n\n\tgetWarningController()?.maybeWarn(primitiveName);\n};\n",
6
+ "import type { StreamingSlot } from '../utils/streamingSlots';\nimport {\n\tsetStreamingSlotCollectionController,\n\tsetStreamingSlotRegistrar\n} from './streamingSlotRegistrar';\n\ntype SlotStore = Map<string, StreamingSlot>;\ntype AsyncLocalStorageType =\n\timport('node:async_hooks').AsyncLocalStorage<SlotStore>;\n\nconst STREAMING_SLOT_STORAGE_KEY = Symbol.for(\n\t'absolutejs.streamingSlotAsyncLocalStorage'\n);\n\nconst isObjectRecord = (value: unknown): value is Record<string, unknown> =>\n\tBoolean(value) && typeof value === 'object';\n\nconst isAsyncLocalStorage = (value: unknown): value is AsyncLocalStorageType =>\n\tisObjectRecord(value) &&\n\t'getStore' in value &&\n\ttypeof value.getStore === 'function' &&\n\t'run' in value &&\n\ttypeof value.run === 'function';\n\nconst getStorageGlobal = () => {\n\tconst value = Reflect.get(globalThis, STREAMING_SLOT_STORAGE_KEY);\n\tif (value === null || typeof value === 'undefined') {\n\t\treturn value;\n\t}\n\n\treturn isAsyncLocalStorage(value) ? value : undefined;\n};\n\nconst isServerRuntime = () =>\n\ttypeof process !== 'undefined' &&\n\ttypeof process.versions?.node === 'string';\n\nconst ensureAsyncLocalStorage = async () => {\n\tconst storage = getStorageGlobal();\n\tif (typeof storage !== 'undefined') {\n\t\treturn storage;\n\t}\n\tif (!isServerRuntime()) {\n\t\tReflect.set(globalThis, STREAMING_SLOT_STORAGE_KEY, null);\n\n\t\treturn getStorageGlobal();\n\t}\n\n\tconst mod = await import('node:async_hooks');\n\tReflect.set(\n\t\tglobalThis,\n\t\tSTREAMING_SLOT_STORAGE_KEY,\n\t\tnew mod.AsyncLocalStorage<SlotStore>()\n\t);\n\n\treturn getStorageGlobal();\n};\n\nconst getActiveSlotStore = () => {\n\tconst storage = getStorageGlobal();\n\tif (!storage) return undefined;\n\n\treturn storage.getStore();\n};\n\nconst registerStreamingSlot = (slot: StreamingSlot) => {\n\tconst store = getActiveSlotStore();\n\tif (!store) return;\n\tstore.set(slot.id, slot);\n};\n\nsetStreamingSlotRegistrar(registerStreamingSlot);\nsetStreamingSlotCollectionController({\n\tisCollecting: () => getActiveSlotStore() !== undefined\n});\n\nexport const hasActiveStreamingSlotRegistry = () =>\n\tgetActiveSlotStore() !== undefined;\n\nexport const runWithStreamingSlotRegistry = async <T>(\n\ttask: () => Promise<T> | T\n) => {\n\tconst storage = await ensureAsyncLocalStorage();\n\tif (!storage) {\n\t\tconst slots: StreamingSlot[] = [];\n\n\t\treturn {\n\t\t\tresult: await task(),\n\t\t\tslots\n\t\t};\n\t}\n\n\treturn storage.run(new Map<string, StreamingSlot>(), async () => {\n\t\tconst result = await task();\n\t\tconst store = storage.getStore();\n\n\t\treturn {\n\t\t\tresult,\n\t\t\tslots: store ? [...store.values()] : []\n\t\t};\n\t});\n};\n"
5
7
  ],
6
- "mappings": "",
7
- "debugId": "DFF1D5F475D796FC64756E2164756E21",
8
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,IAAM,+BAA+B,OAAO,IAC3C,mCACD;AACA,IAAM,qCAAqC,OAAO,IACjD,2CACD;AACA,IAAM,wCAAwC,OAAO,IACpD,8CACD;AAEA,IAAM,sCAAsC,MAAM;AAAA,EACjD,MAAM,QAAQ,QAAQ,IAAI,YAAY,4BAA4B;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