@warp-drive-mirror/react 5.8.0-alpha.4 → 5.8.0-alpha.40

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.
@@ -0,0 +1,290 @@
1
+ import { Signal } from 'signal-polyfill';
2
+ import { createContext, useMemo, useSyncExternalStore } from 'react';
3
+ import { jsxDEV } from 'react/jsx-dev-runtime';
4
+
5
+ /*
6
+ These are the runtime implementations for the javascript macros that have
7
+ runtime implementations.
8
+
9
+ Not every macro has a runtime implementation, some only make sense in the
10
+ build and always run there.
11
+
12
+ Even when we have runtime implementations, we are still careful to emit static
13
+ errors during the build wherever possible, and runtime errors when necessary,
14
+ so that you're not surprised when you switch from runtime-mode to compile-time
15
+ mode.
16
+ */
17
+
18
+ // This is here as a compile target for `getConfig` and `getOwnConfig` when
19
+ // we're in runtime mode. This is not public API to call from your own code.
20
+ function config(packageRoot) {
21
+ return runtimeConfig.packages[packageRoot];
22
+ }
23
+ function getGlobalConfig() {
24
+ return runtimeConfig.global;
25
+ }
26
+ const runtimeConfig = initializeRuntimeMacrosConfig();
27
+
28
+ // this exists to be targeted by our babel plugin
29
+ function initializeRuntimeMacrosConfig() {
30
+ return {
31
+ "packages": {},
32
+ "global": {
33
+ "@embroider/macros": {
34
+ "isTesting": false
35
+ },
36
+ "WarpDrive": {
37
+ "debug": {
38
+ "DEBUG_RELATIONSHIP_NOTIFICATIONS": false,
39
+ "LOG_CACHE": false,
40
+ "LOG_CACHE_POLICY": false,
41
+ "LOG_GRAPH": false,
42
+ "LOG_IDENTIFIERS": false,
43
+ "LOG_INSTANCE_CACHE": false,
44
+ "LOG_METRIC_COUNTS": false,
45
+ "LOG_MUTATIONS": false,
46
+ "LOG_NOTIFICATIONS": false,
47
+ "LOG_OPERATIONS": false,
48
+ "LOG_PAYLOADS": false,
49
+ "LOG_REACT_SIGNAL_INTEGRATION": false,
50
+ "LOG_REQUESTS": false,
51
+ "LOG_REQUEST_STATUS": false,
52
+ "__INTERNAL_LOG_NATIVE_MAP_SET_COUNTS": false
53
+ },
54
+ "polyfillUUID": false,
55
+ "includeDataAdapter": true,
56
+ "compatWith": "99.0",
57
+ "deprecations": {
58
+ "DEPRECATE_CATCH_ALL": false,
59
+ "DEPRECATE_COMPUTED_CHAINS": false,
60
+ "DEPRECATE_EMBER_INFLECTOR": false,
61
+ "DEPRECATE_LEGACY_IMPORTS": false,
62
+ "DEPRECATE_MANY_ARRAY_DUPLICATES": false,
63
+ "DEPRECATE_NON_STRICT_ID": false,
64
+ "DEPRECATE_NON_STRICT_TYPES": false,
65
+ "DEPRECATE_NON_UNIQUE_PAYLOADS": false,
66
+ "DEPRECATE_RELATIONSHIP_REMOTE_UPDATE_CLEARING_LOCAL_STATE": false,
67
+ "DEPRECATE_STORE_EXTENDS_EMBER_OBJECT": false,
68
+ "DEPRECATE_TRACKING_PACKAGE": false,
69
+ "DISABLE_7X_DEPRECATIONS": false,
70
+ "ENABLE_LEGACY_REQUEST_METHODS": false,
71
+ "ENABLE_LEGACY_SCHEMA_SERVICE": false
72
+ },
73
+ "features": {
74
+ "ENFORCE_STRICT_RESOURCE_FINALIZATION": false,
75
+ "JSON_API_CACHE_VALIDATION_ERRORS": false,
76
+ "SAMPLE_FEATURE_FLAG": null
77
+ },
78
+ "activeLogging": {
79
+ "DEBUG_RELATIONSHIP_NOTIFICATIONS": true,
80
+ "LOG_CACHE": true,
81
+ "LOG_CACHE_POLICY": true,
82
+ "LOG_GRAPH": true,
83
+ "LOG_IDENTIFIERS": true,
84
+ "LOG_INSTANCE_CACHE": true,
85
+ "LOG_METRIC_COUNTS": true,
86
+ "LOG_MUTATIONS": true,
87
+ "LOG_NOTIFICATIONS": true,
88
+ "LOG_OPERATIONS": true,
89
+ "LOG_PAYLOADS": true,
90
+ "LOG_REACT_SIGNAL_INTEGRATION": true,
91
+ "LOG_REQUESTS": true,
92
+ "LOG_REQUEST_STATUS": true,
93
+ "__INTERNAL_LOG_NATIVE_MAP_SET_COUNTS": true
94
+ },
95
+ "env": {
96
+ "TESTING": true,
97
+ "PRODUCTION": false,
98
+ "DEBUG": true,
99
+ "IS_RECORDING": false,
100
+ "IS_CI": true,
101
+ "SHOULD_RECORD": false
102
+ }
103
+ }
104
+ }
105
+ };
106
+ }
107
+ function updaterMethods() {
108
+ return {
109
+ config,
110
+ getGlobalConfig,
111
+ setConfig(packageRoot, value) {
112
+ runtimeConfig.packages[packageRoot] = value;
113
+ },
114
+ setGlobalConfig(key, value) {
115
+ runtimeConfig.global[key] = value;
116
+ }
117
+ };
118
+ }
119
+
120
+ // this is how runtime config can get injected at boot. I'm not sure yet if this
121
+ // should be public API, but we certainly need it internally to set things like
122
+ // the global fastboot.isRunning.
123
+ //
124
+ // consumers of this API push a function onto
125
+ // window._embroider_macros_runtime_config. The function is given four methods
126
+ // which allow it to read and write the per-package and global configs. The
127
+ // reason for allowing both read & write is that merging strategies are up to
128
+ // each consumers -- read first, then merge, then write.
129
+ //
130
+ // For an example user of this API, see where we generate
131
+ // embroider_macros_fastboot_init.js' in @embroider/core.
132
+ let updaters = typeof window !== 'undefined' ? window._embroider_macros_runtime_config : undefined;
133
+ if (updaters) {
134
+ let methods = updaterMethods();
135
+ for (let updater of updaters) {
136
+ updater(methods);
137
+ }
138
+ }
139
+ var _jsxFileName = "/home/runner/work/warp-drive/warp-drive/warp-drive-packages/react/src/-private/reactive-context.tsx";
140
+ let nextFlush = null;
141
+ let watchers = [];
142
+ let watcherId = 0;
143
+ function clearWatcher(state) {
144
+ state.watcher.unwatch(...Signal.subtle.introspectSources(state.watcher));
145
+ }
146
+ function flush(state) {
147
+ state.pending = false;
148
+ if (state.destroyed) {
149
+ {
150
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
151
+ console.log(`[WarpDrive] Detected Watcher Destroyed During Notify Flush, clearing signals`);
152
+ }
153
+ }
154
+ state.snapshot = null;
155
+ clearWatcher(state);
156
+ return;
157
+ }
158
+ {
159
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
160
+ console.log(`[WarpDrive] Notifying React That WatcherContext:${state.watcherId} Has Updated`);
161
+ console.log("all signals", new Set(Signal.subtle.introspectSources(state.watcher)));
162
+ console.log("dirty signals", new Set(state.watcher.getPending()));
163
+ }
164
+ } // any time signals have changed, we notify React that our store has updated
165
+ state.snapshot = {
166
+ watcher: state.watcher
167
+ };
168
+ if (state.notifyReact) state.notifyReact();
169
+
170
+ // tell the Watcher to start watching for changes again
171
+ // by signaling that notifications have been flushed.
172
+ state.watcher.watch();
173
+ }
174
+ function _createWatcher() {
175
+ const id = watcherId++;
176
+ {
177
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
178
+ console.log(`[WarpDrive] Creating a WatcherContext:${id}`);
179
+ }
180
+ }
181
+ const state = {
182
+ watcherId: id,
183
+ pending: false,
184
+ destroyed: false,
185
+ notifyReact: null,
186
+ watcher: null,
187
+ // the extra wrapper returned here ensures that the context value for the watcher
188
+ // changes causing a re-render when the watcher is updated.
189
+ snapshot: null
190
+ };
191
+ state.watcher = new Signal.subtle.Watcher((...args) => {
192
+ {
193
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
194
+ console.log(`watcher ${state.watcherId} notified`, args, state.watcher);
195
+ }
196
+ }
197
+ if (!state.pending && !state.destroyed) {
198
+ watchers.push(state);
199
+ state.pending = true;
200
+ if (!nextFlush) {
201
+ nextFlush = new Promise(resolve => {
202
+ queueMicrotask(() => {
203
+ queueMicrotask(() => {
204
+ queueMicrotask(() => {
205
+ watchers.forEach(flush);
206
+ {
207
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
208
+ console.log("Flushed watcher:", watchers.map(w => w.watcherId));
209
+ }
210
+ }
211
+ watchers = [];
212
+ nextFlush = null;
213
+ resolve();
214
+ });
215
+ });
216
+ });
217
+ });
218
+ }
219
+ } else if (state.destroyed) {
220
+ {
221
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
222
+ console.log(`[WarpDrive] Detected Watcher Destroyed During Notify, clearing signals`);
223
+ }
224
+ } // if we are destroyed, we clear the watcher signals
225
+ // so that it does not continue to watch for changes.
226
+ state.snapshot = null;
227
+ clearWatcher(state);
228
+ }
229
+ });
230
+
231
+ // The watcher won't begin watching until we call `watcher.watch()`
232
+ state.watcher.watch();
233
+ state.snapshot = {
234
+ watcher: state.watcher
235
+ };
236
+ return state;
237
+ }
238
+ function useWatcher() {
239
+ const state = useMemo(_createWatcher, []);
240
+ return useSyncExternalStore(notifyChanged => {
241
+ {
242
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
243
+ console.log(`[WarpDrive] Subscribing to Watcher`);
244
+ }
245
+ }
246
+ state.destroyed = false;
247
+ state.notifyReact = notifyChanged;
248
+
249
+ // The watcher won't begin watching until we call `watcher.watch()`
250
+ state.watcher.watch();
251
+ return () => {
252
+ {
253
+ if (getGlobalConfig().WarpDriveMirror.debug.LOG_REACT_SIGNAL_INTEGRATION || globalThis.getWarpDriveRuntimeConfig().debug.LOG_REACT_SIGNAL_INTEGRATION) {
254
+ console.log(`[WarpDrive] Deactivating Watcher Subscription`);
255
+ }
256
+ }
257
+ state.destroyed = true;
258
+ state.notifyReact = null;
259
+ };
260
+ }, () => state.snapshot);
261
+ }
262
+
263
+ /**
264
+ * @category Contexts
265
+ */
266
+ const WatcherContext = /*#__PURE__*/createContext(null);
267
+
268
+ /**
269
+ *
270
+ * @category Components
271
+ */
272
+ function ReactiveContext({
273
+ children
274
+ }) {
275
+ const watcher = useWatcher();
276
+ /**
277
+ * Unlike other frameworks, React does not have a built-in way to provide
278
+ * a context value other than by rendering an extra component.
279
+ *
280
+ */
281
+ return /*#__PURE__*/jsxDEV(WatcherContext, {
282
+ value: watcher,
283
+ children: children
284
+ }, void 0, false, {
285
+ fileName: _jsxFileName,
286
+ lineNumber: 159,
287
+ columnNumber: 10
288
+ }, this);
289
+ }
290
+ export { ReactiveContext as R, WatcherContext as W, getGlobalConfig as g };
@@ -0,0 +1,323 @@
1
+ import { R as ReactiveContext } from "./reactive-context-sqyJMb7I.js";
2
+ export { W as WatcherContext } from "./reactive-context-sqyJMb7I.js";
3
+ import '@warp-drive-mirror/core';
4
+ import { useMemo, createContext, use, useRef, useEffect } from 'react';
5
+ import { jsxDEV, Fragment } from 'react/jsx-dev-runtime';
6
+ import { DISPOSE, createRequestSubscription, signal } from '@warp-drive-mirror/core/store/-private';
7
+ import '@warp-drive-mirror/core/request';
8
+ var _jsxFileName$1 = "/home/runner/work/warp-drive/warp-drive/warp-drive-packages/react/src/-private/store-provider.tsx";
9
+ const StoreContext = /*#__PURE__*/createContext(null);
10
+
11
+ /**
12
+ * @category Hooks
13
+ */
14
+ function useStore() {
15
+ const store = use(StoreContext);
16
+ (test => {
17
+ if (!test) {
18
+ throw new Error("No Store provided via context. Please ensure you are using <StoreProvider> to provide a Store instance.");
19
+ }
20
+ })(store);
21
+ return store;
22
+ }
23
+ /**
24
+ * @category Components
25
+ */
26
+ function StoreProvider($props) {
27
+ const store = useMemo(() => "store" in $props ? $props.store : new $props.Store(), ["store" in $props ? $props.store : $props.Store]);
28
+ return /*#__PURE__*/jsxDEV(StoreContext, {
29
+ value: store,
30
+ children: $props.children
31
+ }, void 0, false, {
32
+ fileName: _jsxFileName$1,
33
+ lineNumber: 34,
34
+ columnNumber: 10
35
+ }, this);
36
+ }
37
+ const deferred = /* @__PURE__ */new WeakMap();
38
+ function deferDecorator(proto, prop, desc) {
39
+ let map = deferred.get(proto);
40
+ if (!map) {
41
+ map = /* @__PURE__ */new Map();
42
+ deferred.set(proto, map);
43
+ }
44
+ map.set(prop, desc);
45
+ }
46
+ function findDeferredDecorator(target, prop) {
47
+ var _a;
48
+ let cursor = target.prototype;
49
+ while (cursor) {
50
+ let desc = (_a = deferred.get(cursor)) == null ? void 0 : _a.get(prop);
51
+ if (desc) {
52
+ return desc;
53
+ }
54
+ cursor = cursor.prototype;
55
+ }
56
+ }
57
+ function decorateFieldV2(prototype, prop, decorators, initializer) {
58
+ let desc = {
59
+ configurable: true,
60
+ enumerable: true,
61
+ writable: true,
62
+ initializer: null
63
+ };
64
+ if (initializer) {
65
+ desc.initializer = initializer;
66
+ }
67
+ for (let decorator of decorators) {
68
+ desc = decorator(prototype, prop, desc) || desc;
69
+ }
70
+ if (desc.initializer === void 0) {
71
+ Object.defineProperty(prototype, prop, desc);
72
+ } else {
73
+ deferDecorator(prototype, prop, desc);
74
+ }
75
+ }
76
+ function initializeDeferredDecorator(target, prop) {
77
+ let desc = findDeferredDecorator(target.constructor, prop);
78
+ if (desc) {
79
+ Object.defineProperty(target, prop, {
80
+ enumerable: desc.enumerable,
81
+ configurable: desc.configurable,
82
+ writable: desc.writable,
83
+ value: desc.initializer ? desc.initializer.call(target) : void 0
84
+ });
85
+ }
86
+ }
87
+ var _jsxFileName = "/home/runner/work/warp-drive/warp-drive/warp-drive-packages/react/src/-private/request.tsx";
88
+ const IdleBlockMissingError = new Error("No idle block provided for <Request> component, and no query or request was provided.");
89
+ class ReactiveArgs {
90
+ static {
91
+ decorateFieldV2(this.prototype, "request", [signal]);
92
+ }
93
+ #request = (initializeDeferredDecorator(this, "request"), void 0);
94
+ static {
95
+ decorateFieldV2(this.prototype, "query", [signal]);
96
+ }
97
+ #query = (initializeDeferredDecorator(this, "query"), void 0);
98
+ static {
99
+ decorateFieldV2(this.prototype, "autorefresh", [signal]);
100
+ }
101
+ #autorefresh = (initializeDeferredDecorator(this, "autorefresh"), void 0);
102
+ static {
103
+ decorateFieldV2(this.prototype, "autorefreshThreshold", [signal]);
104
+ }
105
+ #autorefreshThreshold = (initializeDeferredDecorator(this, "autorefreshThreshold"), void 0);
106
+ static {
107
+ decorateFieldV2(this.prototype, "autorefreshBehavior", [signal]);
108
+ }
109
+ #autorefreshBehavior = (initializeDeferredDecorator(this, "autorefreshBehavior"), void 0);
110
+ }
111
+ const DefaultChrome = ({
112
+ children
113
+ }) => {
114
+ return /*#__PURE__*/jsxDEV(Fragment, {
115
+ children: children
116
+ }, void 0, false);
117
+ };
118
+ function Throw({
119
+ error
120
+ }) {
121
+ throw error;
122
+ }
123
+
124
+ /**
125
+ * The `<Request />` component is a powerful tool for managing data fetching and
126
+ * state in your React application. It provides a declarative approach to reactive
127
+ * control-flow for managing requests and state in your application.
128
+ *
129
+ * The `<Request />` component is ideal for handling "boundaries", outside which some
130
+ * state is still allowed to be unresolved and within which it MUST be resolved.
131
+ *
132
+ * ## Request States
133
+ *
134
+ * `<Request />` has five states, only one of which will be active and rendered at a time.
135
+ *
136
+ * - `idle`: The component is waiting to be given a request to monitor
137
+ * - `loading`: The request is in progress
138
+ * - `error`: The request failed
139
+ * - `content`: The request succeeded
140
+ * - `cancelled`: The request was cancelled
141
+ *
142
+ * Additionally, the `content` state has a `refresh` method that can be used to
143
+ * refresh the request in the background, which is available as a sub-state of
144
+ * the `content` state.
145
+ *
146
+ * ### Example Usage
147
+ *
148
+ * ```tsx
149
+ * import { Request } from "@warp-drive-mirror/react";
150
+ *
151
+ * export function UserPreview($props: { id: string | null }) {
152
+ * return (
153
+ * <Request
154
+ * query={findRecord('user', $props.id)}
155
+ * states={{
156
+ * idle: () => <div>Waiting for User Selection</div>,
157
+ * loading: ({ state }) => <div>Loading user data...</div>,
158
+ * cancelled: ({ error, features }) => (
159
+ * <div>
160
+ * <p>Request Cancelled</p>
161
+ * <p><button onClick={features.retry}>Start Again?</button></p>
162
+ * </div>
163
+ * ),
164
+ * error: ({ error, features }) => (
165
+ * <div>
166
+ * <p>Error: {error.message}</p>
167
+ * <p><button onClick={features.retry}>Try Again?</button></p>
168
+ * </div>
169
+ * ),
170
+ * content: ({ result, features }) => (
171
+ * <div>
172
+ * <h2>User Details</h2>
173
+ * <p>ID: {result.id}</p>
174
+ * <p>Name: {result.name}</p>
175
+ * </div>
176
+ * ),
177
+ * }}
178
+ * />
179
+ * );
180
+ * }
181
+ *
182
+ * ```
183
+ *
184
+ * @category Components
185
+ */
186
+ function Request($props) {
187
+ return /*#__PURE__*/jsxDEV(ReactiveContext, {
188
+ children: /*#__PURE__*/jsxDEV(InternalRequest, {
189
+ ...$props
190
+ }, void 0, false, {
191
+ fileName: _jsxFileName,
192
+ lineNumber: 172,
193
+ columnNumber: 7
194
+ }, this)
195
+ }, void 0, false, {
196
+ fileName: _jsxFileName,
197
+ lineNumber: 171,
198
+ columnNumber: 5
199
+ }, this);
200
+ }
201
+ function isStrictModeRender() {
202
+ const count = useRef(0);
203
+
204
+ // in debug we need to skip every second invocation
205
+ {
206
+ if (count.current++ % 2 === 1) {
207
+ return true;
208
+ }
209
+ }
210
+ return false;
211
+ }
212
+ function InternalRequest($props) {
213
+ const isStrict = isStrictModeRender();
214
+ const store = $props.store ?? useStore();
215
+ const Chrome = $props.chrome ?? DefaultChrome;
216
+ const sink = useRef(null);
217
+ const args = useRef(null);
218
+ if (!args.current) {
219
+ args.current = new ReactiveArgs();
220
+ }
221
+ Object.assign(args.current, $props);
222
+ if (sink.current && (sink.current.store !== store || $props.subscription)) {
223
+ sink.current[DISPOSE]();
224
+ sink.current = null;
225
+ }
226
+ if (!sink.current && !$props.subscription) {
227
+ sink.current = createRequestSubscription(store, args.current);
228
+ }
229
+ const initialized = useRef(null);
230
+ const effect = () => {
231
+ if (sink.current && (!initialized.current || initialized.current.disposable !== sink.current)) {
232
+ initialized.current = {
233
+ disposable: sink.current,
234
+ dispose: () => {
235
+ sink.current?.[DISPOSE]();
236
+ initialized.current = null;
237
+ sink.current = null;
238
+ }
239
+ };
240
+ }
241
+ return sink.current ? initialized.current.dispose : undefined;
242
+ };
243
+ let maybeEffect = effect;
244
+ {
245
+ if (isStrict) {
246
+ maybeEffect = () => {
247
+ if (initialized.current) {
248
+ return effect();
249
+ }
250
+ return () => {
251
+ // initialize our actual effect
252
+ effect();
253
+ // in strict mode we don't want to run the teardown
254
+ // for the second invocation
255
+ };
256
+ };
257
+ }
258
+ }
259
+ useEffect(maybeEffect, [sink.current]);
260
+ const state = $props.subscription ?? sink.current;
261
+ const slots = $props.states;
262
+ return /*#__PURE__*/jsxDEV(Chrome, {
263
+ state: state.isIdle ? null : state.reqState,
264
+ features: state.contentFeatures,
265
+ children:
266
+ // prettier-ignore
267
+ state.isIdle && slots.idle ? /*#__PURE__*/jsxDEV(slots.idle, {}, void 0, false, {
268
+ fileName: _jsxFileName,
269
+ lineNumber: 256,
270
+ columnNumber: 38
271
+ }, this) : state.isIdle ? /*#__PURE__*/jsxDEV(Throw, {
272
+ error: IdleBlockMissingError
273
+ }, void 0, false, {
274
+ fileName: _jsxFileName,
275
+ lineNumber: 257,
276
+ columnNumber: 28
277
+ }, this) : state.reqState.isLoading ? slots.loading ? /*#__PURE__*/jsxDEV(slots.loading, {
278
+ state: state.reqState.loadingState
279
+ }, void 0, false, {
280
+ fileName: _jsxFileName,
281
+ lineNumber: 258,
282
+ columnNumber: 56
283
+ }, this) : '' : state.reqState.isCancelled && slots.cancelled ? /*#__PURE__*/jsxDEV(slots.cancelled, {
284
+ error: state.reqState.reason,
285
+ features: state.errorFeatures
286
+ }, void 0, false, {
287
+ fileName: _jsxFileName,
288
+ lineNumber: 259,
289
+ columnNumber: 61
290
+ }, this) : state.reqState.isError && slots.error ? /*#__PURE__*/jsxDEV(slots.error, {
291
+ error: state.reqState.reason,
292
+ features: state.errorFeatures
293
+ }, void 0, false, {
294
+ fileName: _jsxFileName,
295
+ lineNumber: 260,
296
+ columnNumber: 53
297
+ }, this) : state.reqState.isSuccess ? slots.content ? /*#__PURE__*/jsxDEV(slots.content, {
298
+ result: state.reqState.value,
299
+ features: state.contentFeatures
300
+ }, void 0, false, {
301
+ fileName: _jsxFileName,
302
+ lineNumber: 261,
303
+ columnNumber: 56
304
+ }, this) : /*#__PURE__*/jsxDEV(Throw, {
305
+ error: new Error('No content block provided for <Request> component.')
306
+ }, void 0, false, {
307
+ fileName: _jsxFileName,
308
+ lineNumber: 261,
309
+ columnNumber: 139
310
+ }, this) : !state.reqState.isCancelled ? /*#__PURE__*/jsxDEV(Throw, {
311
+ error: state.reqState.reason
312
+ }, void 0, false, {
313
+ fileName: _jsxFileName,
314
+ lineNumber: 262,
315
+ columnNumber: 43
316
+ }, this) : '' // never
317
+ }, void 0, false, {
318
+ fileName: _jsxFileName,
319
+ lineNumber: 253,
320
+ columnNumber: 5
321
+ }, this);
322
+ }
323
+ export { ReactiveContext, Request, StoreProvider, Throw, useStore };