xstate 5.0.0-beta.30 → 5.0.0-beta.31

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 (42) hide show
  1. package/actions/dist/xstate-actions.cjs.js +3 -3
  2. package/actions/dist/xstate-actions.development.cjs.js +3 -3
  3. package/actions/dist/xstate-actions.development.esm.js +3 -3
  4. package/actions/dist/xstate-actions.esm.js +3 -3
  5. package/actions/dist/xstate-actions.umd.min.js +1 -1
  6. package/actions/dist/xstate-actions.umd.min.js.map +1 -1
  7. package/actors/dist/xstate-actors.cjs.js +8 -12
  8. package/actors/dist/xstate-actors.development.cjs.js +8 -12
  9. package/actors/dist/xstate-actors.development.esm.js +8 -12
  10. package/actors/dist/xstate-actors.esm.js +8 -12
  11. package/actors/dist/xstate-actors.umd.min.js +1 -1
  12. package/actors/dist/xstate-actors.umd.min.js.map +1 -1
  13. package/dist/declarations/src/Machine.d.ts +2 -2
  14. package/dist/declarations/src/StateNode.d.ts +2 -2
  15. package/dist/declarations/src/actors/callback.d.ts +1 -1
  16. package/dist/declarations/src/spawn.d.ts +3 -0
  17. package/dist/declarations/src/types.d.ts +17 -42
  18. package/dist/declarations/src/utils.d.ts +4 -4
  19. package/dist/{interpreter-a2c1e529.cjs.js → interpreter-05e11c15.cjs.js} +2 -2
  20. package/dist/{interpreter-7f1dc557.development.cjs.js → interpreter-a2236840.development.cjs.js} +3 -3
  21. package/dist/{interpreter-b8f53c4b.esm.js → interpreter-d5fa7ce0.esm.js} +2 -2
  22. package/dist/{interpreter-945c4b96.development.esm.js → interpreter-e4d2487f.development.esm.js} +3 -3
  23. package/dist/{raise-0b7dde8b.esm.js → raise-6a68d0cc.esm.js} +49 -22
  24. package/dist/{raise-6e4f5cf7.development.esm.js → raise-6fbd4513.development.esm.js} +49 -22
  25. package/dist/{raise-e79b1f86.cjs.js → raise-90808d65.cjs.js} +49 -22
  26. package/dist/{raise-7cae872b.development.cjs.js → raise-b4bfe138.development.cjs.js} +49 -22
  27. package/dist/{send-19a256f0.development.cjs.js → send-4163d2af.development.cjs.js} +52 -20
  28. package/dist/{send-e7063201.cjs.js → send-72e85cc6.cjs.js} +52 -20
  29. package/dist/{send-a1d772da.development.esm.js → send-7baeedcb.development.esm.js} +52 -20
  30. package/dist/{send-f4fb3ba5.esm.js → send-e5f0f3f6.esm.js} +52 -20
  31. package/dist/xstate.cjs.js +4 -4
  32. package/dist/xstate.development.cjs.js +7 -4
  33. package/dist/xstate.development.esm.js +10 -7
  34. package/dist/xstate.esm.js +7 -7
  35. package/dist/xstate.umd.min.js +1 -1
  36. package/dist/xstate.umd.min.js.map +1 -1
  37. package/guards/dist/xstate-guards.cjs.js +2 -2
  38. package/guards/dist/xstate-guards.development.cjs.js +2 -2
  39. package/guards/dist/xstate-guards.development.esm.js +2 -2
  40. package/guards/dist/xstate-guards.esm.js +2 -2
  41. package/guards/dist/xstate-guards.umd.min.js.map +1 -1
  42. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
- import { j as cloneState, e as evaluateGuard } from './raise-6e4f5cf7.development.esm.js';
2
- import { f as ActorStatus, k as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, y as XSTATE_ERROR } from './interpreter-945c4b96.development.esm.js';
1
+ import { j as cloneState, e as evaluateGuard } from './raise-6fbd4513.development.esm.js';
2
+ import { f as ActorStatus, k as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, y as XSTATE_ERROR } from './interpreter-e4d2487f.development.esm.js';
3
3
 
4
4
  function createSpawner(actorContext, {
5
5
  machine,
@@ -17,7 +17,7 @@ function createSpawner(actorContext, {
17
17
  const input = 'input' in options ? options.input : referenced.input;
18
18
 
19
19
  // TODO: this should also receive `src`
20
- const actor = createActor(referenced.src, {
20
+ const actorRef = createActor(referenced.src, {
21
21
  id: options.id,
22
22
  parent: actorContext.self,
23
23
  input: typeof input === 'function' ? input({
@@ -27,16 +27,48 @@ function createSpawner(actorContext, {
27
27
  }) : input,
28
28
  systemId
29
29
  });
30
- spawnedChildren[actor.id] = actor;
31
- return actor;
30
+ spawnedChildren[actorRef.id] = actorRef;
31
+ if (options.syncSnapshot) {
32
+ actorRef.subscribe({
33
+ next: snapshot => {
34
+ if (snapshot.status === 'active') {
35
+ actorContext.self.send({
36
+ type: `xstate.snapshot.${actorRef.id}`,
37
+ snapshot
38
+ });
39
+ }
40
+ },
41
+ error: () => {
42
+ /* TODO */
43
+ }
44
+ });
45
+ }
46
+ return actorRef;
32
47
  } else {
33
48
  // TODO: this should also receive `src`
34
- return createActor(src, {
49
+ const actorRef = createActor(src, {
35
50
  id: options.id,
36
51
  parent: actorContext.self,
37
52
  input: options.input,
38
53
  systemId
39
54
  });
55
+ if (options.syncSnapshot) {
56
+ actorRef.subscribe({
57
+ next: snapshot => {
58
+ if (snapshot.status === 'active') {
59
+ actorContext.self.send({
60
+ type: `xstate.snapshot.${actorRef.id}`,
61
+ snapshot,
62
+ id: actorRef.id
63
+ });
64
+ }
65
+ },
66
+ error: () => {
67
+ /* TODO */
68
+ }
69
+ });
70
+ }
71
+ return actorRef;
40
72
  }
41
73
  };
42
74
  return (src, options) => {
@@ -57,7 +89,7 @@ function createSpawner(actorContext, {
57
89
  };
58
90
  }
59
91
 
60
- function resolve$4(actorContext, state, actionArgs, {
92
+ function resolveAssign(actorContext, state, actionArgs, {
61
93
  assignment
62
94
  }) {
63
95
  if (!state.context) {
@@ -103,11 +135,11 @@ function assign(assignment) {
103
135
  }
104
136
  assign.type = 'xstate.assign';
105
137
  assign.assignment = assignment;
106
- assign.resolve = resolve$4;
138
+ assign.resolve = resolveAssign;
107
139
  return assign;
108
140
  }
109
141
 
110
- function resolve$3(_, state, actionArgs, {
142
+ function resolveChoose(_, state, actionArgs, {
111
143
  branches
112
144
  }) {
113
145
  const matchedActions = branches.find(condition => {
@@ -123,11 +155,11 @@ function choose(branches) {
123
155
  }
124
156
  choose.type = 'xstate.choose';
125
157
  choose.branches = branches;
126
- choose.resolve = resolve$3;
158
+ choose.resolve = resolveChoose;
127
159
  return choose;
128
160
  }
129
161
 
130
- function resolve$2(_, state, actionArgs, {
162
+ function resolveLog(_, state, actionArgs, {
131
163
  value,
132
164
  label
133
165
  }) {
@@ -136,7 +168,7 @@ function resolve$2(_, state, actionArgs, {
136
168
  label
137
169
  }];
138
170
  }
139
- function execute$1({
171
+ function executeLog({
140
172
  logger
141
173
  }, {
142
174
  value,
@@ -171,12 +203,12 @@ function log(value = ({
171
203
  log.type = 'xstate.log';
172
204
  log.value = value;
173
205
  log.label = label;
174
- log.resolve = resolve$2;
175
- log.execute = execute$1;
206
+ log.resolve = resolveLog;
207
+ log.execute = executeLog;
176
208
  return log;
177
209
  }
178
210
 
179
- function resolve$1(_, state, args, {
211
+ function resolvePure(_, state, args, {
180
212
  get
181
213
  }) {
182
214
  return [state, undefined, toArray(get({
@@ -192,7 +224,7 @@ function pure(getActions) {
192
224
  }
193
225
  pure.type = 'xstate.pure';
194
226
  pure.get = getActions;
195
- pure.resolve = resolve$1;
227
+ pure.resolve = resolvePure;
196
228
  return pure;
197
229
  }
198
230
 
@@ -231,7 +263,7 @@ let SpecialTargets = /*#__PURE__*/function (SpecialTargets) {
231
263
  return SpecialTargets;
232
264
  }({});
233
265
 
234
- function resolve(actorContext, state, args, {
266
+ function resolveSendTo(actorContext, state, args, {
235
267
  to,
236
268
  event: eventOrExpr,
237
269
  id,
@@ -276,7 +308,7 @@ function resolve(actorContext, state, args, {
276
308
  delay: resolvedDelay
277
309
  }];
278
310
  }
279
- function execute(actorContext, params) {
311
+ function executeSendTo(actorContext, params) {
280
312
  if (typeof params.delay === 'number') {
281
313
  actorContext.self.delaySend(params);
282
314
  return;
@@ -309,8 +341,8 @@ function sendTo(to, eventOrExpr, options) {
309
341
  sendTo.event = eventOrExpr;
310
342
  sendTo.id = options?.id;
311
343
  sendTo.delay = options?.delay;
312
- sendTo.resolve = resolve;
313
- sendTo.execute = execute;
344
+ sendTo.resolve = resolveSendTo;
345
+ sendTo.execute = executeSendTo;
314
346
  return sendTo;
315
347
  }
316
348
 
@@ -1,5 +1,5 @@
1
- import { j as cloneState, e as evaluateGuard } from './raise-0b7dde8b.esm.js';
2
- import { f as ActorStatus, k as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, y as XSTATE_ERROR } from './interpreter-b8f53c4b.esm.js';
1
+ import { j as cloneState, e as evaluateGuard } from './raise-6a68d0cc.esm.js';
2
+ import { f as ActorStatus, k as createErrorActorEvent, r as resolveReferencedActor, d as createActor, t as toArray, y as XSTATE_ERROR } from './interpreter-d5fa7ce0.esm.js';
3
3
 
4
4
  function createSpawner(actorContext, {
5
5
  machine,
@@ -17,7 +17,7 @@ function createSpawner(actorContext, {
17
17
  const input = 'input' in options ? options.input : referenced.input;
18
18
 
19
19
  // TODO: this should also receive `src`
20
- const actor = createActor(referenced.src, {
20
+ const actorRef = createActor(referenced.src, {
21
21
  id: options.id,
22
22
  parent: actorContext.self,
23
23
  input: typeof input === 'function' ? input({
@@ -27,16 +27,48 @@ function createSpawner(actorContext, {
27
27
  }) : input,
28
28
  systemId
29
29
  });
30
- spawnedChildren[actor.id] = actor;
31
- return actor;
30
+ spawnedChildren[actorRef.id] = actorRef;
31
+ if (options.syncSnapshot) {
32
+ actorRef.subscribe({
33
+ next: snapshot => {
34
+ if (snapshot.status === 'active') {
35
+ actorContext.self.send({
36
+ type: `xstate.snapshot.${actorRef.id}`,
37
+ snapshot
38
+ });
39
+ }
40
+ },
41
+ error: () => {
42
+ /* TODO */
43
+ }
44
+ });
45
+ }
46
+ return actorRef;
32
47
  } else {
33
48
  // TODO: this should also receive `src`
34
- return createActor(src, {
49
+ const actorRef = createActor(src, {
35
50
  id: options.id,
36
51
  parent: actorContext.self,
37
52
  input: options.input,
38
53
  systemId
39
54
  });
55
+ if (options.syncSnapshot) {
56
+ actorRef.subscribe({
57
+ next: snapshot => {
58
+ if (snapshot.status === 'active') {
59
+ actorContext.self.send({
60
+ type: `xstate.snapshot.${actorRef.id}`,
61
+ snapshot,
62
+ id: actorRef.id
63
+ });
64
+ }
65
+ },
66
+ error: () => {
67
+ /* TODO */
68
+ }
69
+ });
70
+ }
71
+ return actorRef;
40
72
  }
41
73
  };
42
74
  return (src, options) => {
@@ -57,7 +89,7 @@ function createSpawner(actorContext, {
57
89
  };
58
90
  }
59
91
 
60
- function resolve$4(actorContext, state, actionArgs, {
92
+ function resolveAssign(actorContext, state, actionArgs, {
61
93
  assignment
62
94
  }) {
63
95
  if (!state.context) {
@@ -100,11 +132,11 @@ function assign(assignment) {
100
132
  }
101
133
  assign.type = 'xstate.assign';
102
134
  assign.assignment = assignment;
103
- assign.resolve = resolve$4;
135
+ assign.resolve = resolveAssign;
104
136
  return assign;
105
137
  }
106
138
 
107
- function resolve$3(_, state, actionArgs, {
139
+ function resolveChoose(_, state, actionArgs, {
108
140
  branches
109
141
  }) {
110
142
  const matchedActions = branches.find(condition => {
@@ -117,11 +149,11 @@ function choose(branches) {
117
149
  }
118
150
  choose.type = 'xstate.choose';
119
151
  choose.branches = branches;
120
- choose.resolve = resolve$3;
152
+ choose.resolve = resolveChoose;
121
153
  return choose;
122
154
  }
123
155
 
124
- function resolve$2(_, state, actionArgs, {
156
+ function resolveLog(_, state, actionArgs, {
125
157
  value,
126
158
  label
127
159
  }) {
@@ -130,7 +162,7 @@ function resolve$2(_, state, actionArgs, {
130
162
  label
131
163
  }];
132
164
  }
133
- function execute$1({
165
+ function executeLog({
134
166
  logger
135
167
  }, {
136
168
  value,
@@ -162,12 +194,12 @@ function log(value = ({
162
194
  log.type = 'xstate.log';
163
195
  log.value = value;
164
196
  log.label = label;
165
- log.resolve = resolve$2;
166
- log.execute = execute$1;
197
+ log.resolve = resolveLog;
198
+ log.execute = executeLog;
167
199
  return log;
168
200
  }
169
201
 
170
- function resolve$1(_, state, args, {
202
+ function resolvePure(_, state, args, {
171
203
  get
172
204
  }) {
173
205
  return [state, undefined, toArray(get({
@@ -180,7 +212,7 @@ function pure(getActions) {
180
212
  }
181
213
  pure.type = 'xstate.pure';
182
214
  pure.get = getActions;
183
- pure.resolve = resolve$1;
215
+ pure.resolve = resolvePure;
184
216
  return pure;
185
217
  }
186
218
 
@@ -219,7 +251,7 @@ let SpecialTargets = /*#__PURE__*/function (SpecialTargets) {
219
251
  return SpecialTargets;
220
252
  }({});
221
253
 
222
- function resolve(actorContext, state, args, {
254
+ function resolveSendTo(actorContext, state, args, {
223
255
  to,
224
256
  event: eventOrExpr,
225
257
  id,
@@ -264,7 +296,7 @@ function resolve(actorContext, state, args, {
264
296
  delay: resolvedDelay
265
297
  }];
266
298
  }
267
- function execute(actorContext, params) {
299
+ function executeSendTo(actorContext, params) {
268
300
  if (typeof params.delay === 'number') {
269
301
  actorContext.self.delaySend(params);
270
302
  return;
@@ -294,8 +326,8 @@ function sendTo(to, eventOrExpr, options) {
294
326
  sendTo.event = eventOrExpr;
295
327
  sendTo.id = options?.id;
296
328
  sendTo.delay = options?.delay;
297
- sendTo.resolve = resolve;
298
- sendTo.execute = execute;
329
+ sendTo.resolve = resolveSendTo;
330
+ sendTo.execute = executeSendTo;
299
331
  return sendTo;
300
332
  }
301
333
 
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var actors_dist_xstateActors = require('../actors/dist/xstate-actors.cjs.js');
6
- var interpreter = require('./interpreter-a2c1e529.cjs.js');
7
- var guards_dist_xstateGuards = require('./raise-e79b1f86.cjs.js');
8
- var send = require('./send-e7063201.cjs.js');
6
+ var interpreter = require('./interpreter-05e11c15.cjs.js');
7
+ var guards_dist_xstateGuards = require('./raise-90808d65.cjs.js');
8
+ var send = require('./send-72e85cc6.cjs.js');
9
9
  require('../dev/dist/xstate-dev.cjs.js');
10
10
 
11
11
  class SimulatedClock {
@@ -187,7 +187,7 @@ class StateNode {
187
187
  this.entry = interpreter.toArray(this.config.entry).slice();
188
188
  this.exit = interpreter.toArray(this.config.exit).slice();
189
189
  this.meta = this.config.meta;
190
- this.output = this.type === 'final' ? this.config.output : undefined;
190
+ this.output = this.type === 'final' || !this.parent ? this.config.output : undefined;
191
191
  this.tags = interpreter.toArray(config.tags).slice();
192
192
  }
193
193
  _initialize() {
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var actors_dist_xstateActors = require('../actors/dist/xstate-actors.development.cjs.js');
6
- var interpreter = require('./interpreter-7f1dc557.development.cjs.js');
7
- var guards_dist_xstateGuards = require('./raise-7cae872b.development.cjs.js');
8
- var send = require('./send-19a256f0.development.cjs.js');
6
+ var interpreter = require('./interpreter-a2236840.development.cjs.js');
7
+ var guards_dist_xstateGuards = require('./raise-b4bfe138.development.cjs.js');
8
+ var send = require('./send-4163d2af.development.cjs.js');
9
9
  require('../dev/dist/xstate-dev.development.cjs.js');
10
10
 
11
11
  class SimulatedClock {
@@ -187,7 +187,7 @@ class StateNode {
187
187
  this.entry = interpreter.toArray(this.config.entry).slice();
188
188
  this.exit = interpreter.toArray(this.config.exit).slice();
189
189
  this.meta = this.config.meta;
190
- this.output = this.type === 'final' ? this.config.output : undefined;
190
+ this.output = this.type === 'final' || !this.parent ? this.config.output : undefined;
191
191
  this.tags = interpreter.toArray(config.tags).slice();
192
192
  }
193
193
  _initialize() {
@@ -415,6 +415,9 @@ class StateMachine {
415
415
  this.root._initialize();
416
416
  this.states = this.root.states; // TODO: remove!
417
417
  this.events = this.root.events;
418
+ if (!this.root.output && Object.values(this.states).some(state => state.type === 'final' && !!state.output)) {
419
+ console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
420
+ }
418
421
  }
419
422
 
420
423
  /**
@@ -1,10 +1,10 @@
1
1
  export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.development.esm.js';
2
- import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, e as matchesState } from './interpreter-945c4b96.development.esm.js';
3
- export { A as Actor, f as ActorStatus, I as InterpreterStatus, d as createActor, g as interpret, e as matchesState, p as pathToStateValue, h as toObserver } from './interpreter-945c4b96.development.esm.js';
4
- import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as isAtomicStateNode, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-6e4f5cf7.development.esm.js';
5
- export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, y as stateIn, B as stop } from './raise-6e4f5cf7.development.esm.js';
6
- import { a as assign } from './send-a1d772da.development.esm.js';
7
- export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-a1d772da.development.esm.js';
2
+ import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, e as matchesState } from './interpreter-e4d2487f.development.esm.js';
3
+ export { A as Actor, f as ActorStatus, I as InterpreterStatus, d as createActor, g as interpret, e as matchesState, p as pathToStateValue, h as toObserver } from './interpreter-e4d2487f.development.esm.js';
4
+ import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as isAtomicStateNode, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-6fbd4513.development.esm.js';
5
+ export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, y as stateIn, B as stop } from './raise-6fbd4513.development.esm.js';
6
+ import { a as assign } from './send-7baeedcb.development.esm.js';
7
+ export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-7baeedcb.development.esm.js';
8
8
  import '../dev/dist/xstate-dev.development.esm.js';
9
9
 
10
10
  class SimulatedClock {
@@ -186,7 +186,7 @@ class StateNode {
186
186
  this.entry = toArray(this.config.entry).slice();
187
187
  this.exit = toArray(this.config.exit).slice();
188
188
  this.meta = this.config.meta;
189
- this.output = this.type === 'final' ? this.config.output : undefined;
189
+ this.output = this.type === 'final' || !this.parent ? this.config.output : undefined;
190
190
  this.tags = toArray(config.tags).slice();
191
191
  }
192
192
  _initialize() {
@@ -414,6 +414,9 @@ class StateMachine {
414
414
  this.root._initialize();
415
415
  this.states = this.root.states; // TODO: remove!
416
416
  this.events = this.root.events;
417
+ if (!this.root.output && Object.values(this.states).some(state => state.type === 'final' && !!state.output)) {
418
+ console.warn('Missing `machine.output` declaration (top-level final state with output detected)');
419
+ }
417
420
  }
418
421
 
419
422
  /**
@@ -1,10 +1,10 @@
1
1
  export { createEmptyActor, fromCallback, fromEventObservable, fromObservable, fromPromise, fromTransition } from '../actors/dist/xstate-actors.esm.js';
2
- import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, e as matchesState } from './interpreter-b8f53c4b.esm.js';
3
- export { A as Actor, f as ActorStatus, I as InterpreterStatus, d as createActor, g as interpret, e as matchesState, p as pathToStateValue, h as toObserver } from './interpreter-b8f53c4b.esm.js';
4
- import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as isAtomicStateNode, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-0b7dde8b.esm.js';
5
- export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, y as stateIn, B as stop } from './raise-0b7dde8b.esm.js';
6
- import { a as assign } from './send-f4fb3ba5.esm.js';
7
- export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-f4fb3ba5.esm.js';
2
+ import { S as STATE_DELIMITER, m as mapValues, t as toArray, a as toTransitionConfigArray, N as NULL_EVENT, c as createInvokeId, i as isErrorActorEvent, b as createInitEvent, r as resolveReferencedActor, d as createActor, e as matchesState } from './interpreter-d5fa7ce0.esm.js';
3
+ export { A as Actor, f as ActorStatus, I as InterpreterStatus, d as createActor, g as interpret, e as matchesState, p as pathToStateValue, h as toObserver } from './interpreter-d5fa7ce0.esm.js';
4
+ import { f as formatTransitions, a as formatTransition, m as memo, e as evaluateGuard, g as getDelayedTransitions, b as formatInitialTransition, c as getCandidates, d as getConfiguration, h as getStateNodes, r as resolveStateValue, i as isInFinalState, S as State, j as cloneState, k as macrostep, t as transitionNode, l as getInitialConfiguration, n as resolveActionsAndContext, o as microstep, p as isAtomicStateNode, q as isStateId, s as getStateNodeByPath, u as getPersistedState } from './raise-6a68d0cc.esm.js';
5
+ export { S as State, v as and, z as cancel, h as getStateNodes, w as not, x as or, A as raise, y as stateIn, B as stop } from './raise-6a68d0cc.esm.js';
6
+ import { a as assign } from './send-e5f0f3f6.esm.js';
7
+ export { S as SpecialTargets, a as assign, c as choose, e as escalate, f as forwardTo, l as log, p as pure, s as sendParent, b as sendTo } from './send-e5f0f3f6.esm.js';
8
8
  import '../dev/dist/xstate-dev.esm.js';
9
9
 
10
10
  class SimulatedClock {
@@ -186,7 +186,7 @@ class StateNode {
186
186
  this.entry = toArray(this.config.entry).slice();
187
187
  this.exit = toArray(this.config.exit).slice();
188
188
  this.meta = this.config.meta;
189
- this.output = this.type === 'final' ? this.config.output : undefined;
189
+ this.output = this.type === 'final' || !this.parent ? this.config.output : undefined;
190
190
  this.tags = toArray(config.tags).slice();
191
191
  }
192
192
  _initialize() {