@picked/client 0.0.1-dev.1773724362573 → 0.0.1-dev.1773804563218

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 (95) hide show
  1. package/dist/{api-Z3Hn2Kw-.cjs → api-C90ugp6M.cjs} +1 -1
  2. package/dist/{api-B3x8PEp4.js → api-CQ1Lb-dB.js} +1 -1
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/plugins/create-experience/index.js +1 -1
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  7. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  9. package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
  10. package/dist/cjs/plugins/single-page-app/index.js +1 -1
  11. package/dist/cjs/server/index.js +1 -1
  12. package/dist/esm/index.js +738 -742
  13. package/dist/esm/plugins/create-experience/index.js +359 -286
  14. package/dist/esm/plugins/dynamic-experiences/index.js +146 -80
  15. package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
  16. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  17. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  18. package/dist/esm/plugins/responses-indexeddb/index.js +46 -51
  19. package/dist/esm/plugins/single-page-app/index.js +24 -24
  20. package/dist/esm/server/index.js +1 -1
  21. package/dist/{experience-instance-DTyL1fNb.js → experience-instance-8P1fJuPC.js} +306 -312
  22. package/dist/experience-instance-Bi3-1tP5.cjs +1 -0
  23. package/dist/object-BbFTsGh3.cjs +1 -0
  24. package/dist/{object-CJssU1Pm.js → object-JwZ58NOH.js} +1 -1
  25. package/dist/storage-Be5xWNPC.cjs +1 -0
  26. package/dist/{storage-B2d81EOI.js → storage-Co_LbKr_.js} +30 -35
  27. package/dist/types/entities/action/action.d.ts +2 -5
  28. package/dist/types/entities/action/action.d.ts.map +1 -1
  29. package/dist/types/entities/condition/condition.d.ts +17 -0
  30. package/dist/types/entities/condition/condition.d.ts.map +1 -0
  31. package/dist/types/entities/experience/experience.d.ts +46 -31
  32. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  33. package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
  34. package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
  35. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  36. package/dist/types/entities/field/field.d.ts +23 -52
  37. package/dist/types/entities/field/field.d.ts.map +1 -1
  38. package/dist/types/entities/history/history.d.ts.map +1 -1
  39. package/dist/types/entities/project/project.d.ts.map +1 -1
  40. package/dist/types/entities/response/response.d.ts +9 -7
  41. package/dist/types/entities/response/response.d.ts.map +1 -1
  42. package/dist/types/entities/step/step.d.ts +20 -0
  43. package/dist/types/entities/step/step.d.ts.map +1 -0
  44. package/dist/types/index.d.ts +2 -1
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/types/logic-engine.d.ts +8 -2
  47. package/dist/types/logic-engine.d.ts.map +1 -1
  48. package/dist/types/picked.d.ts +41 -32
  49. package/dist/types/picked.d.ts.map +1 -1
  50. package/dist/types/plugins/create-experience/create-experience.d.ts +70 -39
  51. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  52. package/dist/types/plugins/create-experience/index.d.ts +1 -1
  53. package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
  54. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  55. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +20 -5
  56. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  57. package/dist/types/plugins/dynamic-experiences/types.d.ts +46 -0
  58. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  59. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -2
  60. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  61. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -2
  62. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  63. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -2
  64. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  65. package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
  66. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  67. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  68. package/dist/types/utils/dom.d.ts +3 -0
  69. package/dist/types/utils/dom.d.ts.map +1 -1
  70. package/dist/types/utils/events.d.ts +2 -2
  71. package/dist/types/utils/events.d.ts.map +1 -1
  72. package/dist/types/utils/global-obj.d.ts +1 -0
  73. package/dist/types/utils/global-obj.d.ts.map +1 -1
  74. package/dist/types/utils/indexed-db.d.ts +1 -2
  75. package/dist/types/utils/indexed-db.d.ts.map +1 -1
  76. package/dist/types/utils/key.d.ts +12 -0
  77. package/dist/types/utils/key.d.ts.map +1 -0
  78. package/dist/types/utils/logger.d.ts.map +1 -1
  79. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  80. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  81. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
  82. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  83. package/dist/types/utils/nodes.d.ts +2 -2
  84. package/dist/types/utils/nodes.d.ts.map +1 -1
  85. package/dist/types/utils/object.d.ts +8 -0
  86. package/dist/types/utils/object.d.ts.map +1 -1
  87. package/dist/types/utils/picked-config.d.ts +1 -1
  88. package/dist/types/utils/picked-config.d.ts.map +1 -1
  89. package/dist/types/utils/rules-logic.d.ts.map +1 -1
  90. package/dist/types/utils/search-params.d.ts.map +1 -1
  91. package/dist/types/utils/storage.d.ts.map +1 -1
  92. package/package.json +2 -16
  93. package/dist/experience-instance-BX0aqKsC.cjs +0 -1
  94. package/dist/object-mwaxtjLG.cjs +0 -1
  95. package/dist/storage-58NoTSsc.cjs +0 -1
@@ -1,15 +1,15 @@
1
- import { createDomain as kt, createEvent as b, combine as D, createApi as lt, createEffect as B, attach as O, sample as S, split as bt } from "effector";
1
+ import { createDomain as kt, createEvent as I, combine as R, createApi as lt, createEffect as $, attach as O, sample as m, split as bt } from "effector";
2
2
  import { createFactory as dt, invoke as pt } from "@withease/factories";
3
3
  import { a as vt, s as gt, j as At } from "./supports-8YT4QKI7.js";
4
- import { l as I } from "./logger-C9a75KZn.js";
5
- import { i as Ot } from "./object-CJssU1Pm.js";
4
+ import { l as E } from "./logger-C9a75KZn.js";
5
+ import { i as Ot } from "./object-JwZ58NOH.js";
6
6
  function Ft(t) {
7
7
  return typeof t == "number" && !isNaN(t);
8
8
  }
9
- function j(t) {
9
+ function K(t) {
10
10
  return typeof t == "string";
11
11
  }
12
- function E(t) {
12
+ function N(t) {
13
13
  return Array.isArray(t);
14
14
  }
15
15
  function mt(t) {
@@ -18,89 +18,88 @@ function mt(t) {
18
18
  function st(t) {
19
19
  return typeof t == "object" && t !== null && !Array.isArray(t) && Object.keys(t).length === 1;
20
20
  }
21
- function m(t) {
21
+ function g(t) {
22
22
  if (Ft(t)) return t;
23
23
  const e = parseFloat(`${t}`);
24
24
  return isNaN(e) ? 0 : e;
25
25
  }
26
- function R(t) {
26
+ function P(t) {
27
27
  return `${t}`;
28
28
  }
29
- const _t = {
29
+ const Bt = {
30
30
  // eslint-disable-next-line eqeqeq
31
31
  "==": (t, e) => t == e,
32
32
  "===": (t, e) => t === e,
33
33
  // eslint-disable-next-line eqeqeq
34
34
  "!=": (t, e) => t != e,
35
35
  "!==": (t, e) => t !== e,
36
- ">": (t, e) => m(t) > m(e),
37
- ">=": (t, e) => m(t) >= m(e),
36
+ ">": (t, e) => g(t) > g(e),
37
+ ">=": (t, e) => g(t) >= g(e),
38
38
  "<": (t, e, r) => {
39
- const n = m(t), s = m(e);
39
+ const n = g(t), s = g(e);
40
40
  if (r === void 0) return n < s;
41
- const a = m(r);
42
- return n < s && s < a;
41
+ const c = g(r);
42
+ return n < s && s < c;
43
43
  },
44
44
  "<=": (t, e, r) => {
45
- const n = m(t), s = m(e);
45
+ const n = g(t), s = g(e);
46
46
  if (r === void 0) return n <= s;
47
- const a = m(r);
48
- return n <= s && s <= a;
47
+ const c = g(r);
48
+ return n <= s && s <= c;
49
49
  },
50
50
  "!!": async (t) => await v(t),
51
51
  "!": async (t) => !await v(t),
52
- "%": (t, e) => m(t) % m(e),
52
+ "%": (t, e) => g(t) % g(e),
53
53
  // eslint-disable-next-line sonarjs/function-return-type
54
54
  log: (t) => (console.log(t), t),
55
- in: (t, e) => e ? j(e) ? e.indexOf(R(t)) !== -1 : E(e) ? e.includes(t) : !1 : !1,
56
- cat: (...t) => t.map(R).join(""),
55
+ in: (t, e) => e ? K(e) ? e.indexOf(P(t)) !== -1 : N(e) ? e.includes(t) : !1 : !1,
56
+ cat: (...t) => t.map(P).join(""),
57
57
  /* eslint-disable sonarjs/deprecation */
58
58
  substr: (t, e, r) => {
59
- const n = R(t), s = m(e);
59
+ const n = P(t), s = g(e);
60
60
  if (r === void 0) return n.substr(s);
61
- const a = m(r);
62
- if (a < 0) {
61
+ const c = g(r);
62
+ if (c < 0) {
63
63
  const o = n.substr(s);
64
- return o.substr(0, o.length + a);
64
+ return o.substr(0, o.length + c);
65
65
  }
66
- return n.substr(s, a);
66
+ return n.substr(s, c);
67
67
  },
68
68
  /* eslint-enable sonarjs/deprecation */
69
- "+": (...t) => t.reduce((e, r) => m(e) + m(r), 0),
70
- "*": (...t) => t.reduce((e, r) => m(e) * m(r), 1),
69
+ "+": (...t) => t.reduce((e, r) => g(e) + g(r), 0),
70
+ "*": (...t) => t.reduce((e, r) => g(e) * g(r), 1),
71
71
  "-": (t, e) => {
72
- const r = m(t);
73
- return e === void 0 ? -r : r - m(e);
72
+ const r = g(t);
73
+ return e === void 0 ? -r : r - g(e);
74
74
  },
75
- "/": (t, e) => m(t) / m(e),
76
- min: (...t) => Math.min(...t.map(m)),
77
- max: (...t) => Math.max(...t.map(m)),
78
- merge: (...t) => t.reduce((e, r) => E(r) ? e.concat(r) : e.concat([r]), []),
79
- // eslint-disable-next-line sonarjs/cognitive-complexity -- JSONLogic var operator requires complex path traversal logic
75
+ "/": (t, e) => g(t) / g(e),
76
+ min: (...t) => Math.min(...t.map(g)),
77
+ max: (...t) => Math.max(...t.map(g)),
78
+ merge: (...t) => t.reduce((e, r) => N(r) ? e.concat(r) : e.concat([r]), []),
80
79
  var(t, e) {
81
80
  const r = arguments.length > 1 ? e : null;
82
81
  if (t === "" || t === "." || t === null || t === void 0)
83
82
  return this;
84
83
  if (typeof t == "number" && Array.isArray(this))
85
84
  return t >= 0 && t < this.length ? this[t] : r;
86
- const n = R(t);
85
+ const n = P(t);
87
86
  if (n === "" || n === ".")
88
87
  return this;
89
88
  const s = n.split(".");
90
- let a = this;
89
+ let c = this;
91
90
  for (const o of s) {
92
- if (a == null)
91
+ if (c == null)
93
92
  return r;
94
- if (Array.isArray(a)) {
95
- const f = parseInt(o, 10);
96
- isNaN(f) ? a = a[o] : a = a[f];
93
+ if (Array.isArray(c)) {
94
+ const u = parseInt(o, 10);
95
+ isNaN(u) ? c = c[o] : c = c[u];
97
96
  } else
98
- a = a[o];
97
+ c = c[o];
99
98
  }
100
- return a !== void 0 ? a : r;
99
+ return c !== void 0 ? c : r;
101
100
  },
102
101
  async missing(...t) {
103
- const e = E(t[0]) ? t[0] : t, r = [];
102
+ const e = N(t[0]) ? t[0] : t, r = [];
104
103
  for (const n of e) {
105
104
  const s = await p({ var: n }, this);
106
105
  (s === null || s === "") && r.push(`${n}`);
@@ -109,9 +108,9 @@ const _t = {
109
108
  },
110
109
  async missing_some(t, e) {
111
110
  const r = await p({ missing: e }, this);
112
- if (!E(r) || !E(e)) return [];
113
- const n = r.filter(j);
114
- return e.filter(j).length - n.length >= m(t) ? [] : n;
111
+ if (!N(r) || !N(e)) return [];
112
+ const n = r.filter(K);
113
+ return e.filter(K).length - n.length >= g(t) ? [] : n;
115
114
  },
116
115
  /**
117
116
  * Invoke operator - executes a function with optional arguments
@@ -131,26 +130,26 @@ const _t = {
131
130
  },
132
131
  regexp_matches(t, e) {
133
132
  let r = t, n = "";
134
- if (E(t)) {
135
- const [a, o] = t;
136
- r = a, n = o;
133
+ if (N(t)) {
134
+ const [c, o] = t;
135
+ r = c, n = o;
137
136
  }
138
- return !j(r) || !j(n) ? !1 : new RegExp(r, n).test(R(e));
137
+ return !K(r) || !K(n) ? !1 : new RegExp(r, n).test(P(e));
139
138
  },
140
139
  throw(t) {
141
- throw new Error(R(t));
140
+ throw new Error(P(t));
142
141
  }
143
142
  };
144
143
  async function p(t, e) {
145
144
  if (!t) return t;
146
145
  if (mt(t))
147
146
  return p(await t, e);
148
- if (E(t))
147
+ if (N(t))
149
148
  return Promise.all(t.map((o) => p(o, e)));
150
149
  if (!st(t)) return t;
151
- const r = Bt(t);
150
+ const r = _t(t);
152
151
  let n = r ? t[r] ?? [] : [];
153
- switch (E(n) || (n = [n]), r) {
152
+ switch (N(n) || (n = [n]), r) {
154
153
  case "if":
155
154
  case "?:":
156
155
  for (let o = 0; o < n.length - 1; o += 2)
@@ -159,59 +158,59 @@ async function p(t, e) {
159
158
  return n.length % 2 === 1 ? p(n[n.length - 1], e) : null;
160
159
  case "and": {
161
160
  let o = null;
162
- for (const f of n)
163
- if (o = await p(f, e), !await v(o))
161
+ for (const u of n)
162
+ if (o = await p(u, e), !await v(o))
164
163
  return o;
165
164
  return o;
166
165
  }
167
166
  case "or": {
168
167
  let o = null;
169
- for (const f of n)
170
- if (o = await p(f, e), await v(o)) return o;
168
+ for (const u of n)
169
+ if (o = await p(u, e), await v(o)) return o;
171
170
  return o;
172
171
  }
173
172
  case "map": {
174
173
  const o = await p(n[0], e);
175
- return E(o) ? await Promise.all(o.map((f) => p(n[1], f))) : [];
174
+ return N(o) ? await Promise.all(o.map((u) => p(n[1], u))) : [];
176
175
  }
177
176
  case "filter": {
178
177
  const o = await p(n[0], e);
179
- return E(o) ? (await Promise.all(
178
+ return N(o) ? (await Promise.all(
180
179
  o.map(async (d) => {
181
- const g = await v(await p(n[1], d));
182
- return { item: d, shouldInclude: g };
180
+ const y = await v(await p(n[1], d));
181
+ return { item: d, shouldInclude: y };
183
182
  })
184
183
  )).filter(({ shouldInclude: d }) => d).map(({ item: d }) => d) : [];
185
184
  }
186
185
  case "reduce": {
187
186
  const o = await p(n[0], e);
188
- if (!E(o))
187
+ if (!N(o))
189
188
  return n.length > 2 ? await p(n[2], e) : null;
190
- const f = n[1];
191
- let g = n.length > 2 ? await p(n[2], e) : null;
192
- for (const x of o)
193
- g = await p(f, { current: x, accumulator: g });
194
- return g;
189
+ const u = n[1];
190
+ let y = n.length > 2 ? await p(n[2], e) : null;
191
+ for (const b of o)
192
+ y = await p(u, { current: b, accumulator: y });
193
+ return y;
195
194
  }
196
195
  case "all": {
197
196
  const o = await p(n[0], e);
198
- if (!E(o) || o.length === 0) return !1;
199
- for (const f of o)
200
- if (!await v(await p(n[1], f))) return !1;
197
+ if (!N(o) || o.length === 0) return !1;
198
+ for (const u of o)
199
+ if (!await v(await p(n[1], u))) return !1;
201
200
  return !0;
202
201
  }
203
202
  case "some": {
204
203
  const o = await p(n[0], e);
205
- if (!E(o)) return !1;
206
- for (const f of o)
207
- if (await v(await p(n[1], f))) return !0;
204
+ if (!N(o)) return !1;
205
+ for (const u of o)
206
+ if (await v(await p(n[1], u))) return !0;
208
207
  return !1;
209
208
  }
210
209
  case "none": {
211
210
  const o = await p(n[0], e);
212
- if (!E(o)) return !0;
213
- for (const f of o)
214
- if (await v(await p(n[1], f))) return !1;
211
+ if (!N(o)) return !0;
212
+ for (const u of o)
213
+ if (await v(await p(n[1], u))) return !1;
215
214
  return !0;
216
215
  }
217
216
  case "catch":
@@ -221,33 +220,31 @@ async function p(t, e) {
221
220
  return st(o) ? await p(o, e) : n[1] ? await p(n[1], o) : o instanceof Error ? o.message : o;
222
221
  }
223
222
  }
224
- const s = await Promise.all(n.map((o) => p(o, e))), a = r ? _t[r] : void 0;
225
- if (!a) throw new Error(`Unrecognized operation ${r}`);
226
- return a.apply(e, s);
223
+ const s = await Promise.all(n.map((o) => p(o, e))), c = r ? Bt[r] : void 0;
224
+ if (!c) throw new Error(`Unrecognized operation ${r}`);
225
+ return c.apply(e, s);
227
226
  }
228
227
  async function v(t) {
229
228
  return mt(t) ? v(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
230
229
  }
231
- function Bt(t) {
230
+ function _t(t) {
232
231
  return Object.keys(t)[0];
233
232
  }
234
233
  function $t(t) {
235
234
  return !Ot(t);
236
235
  }
237
- async function at(t, e, r) {
238
- const n = t.getStateSnapshot(), s = t.predicates.listStore.getState().reduce((d, g) => ({
239
- ...d,
240
- [g.name]: (...x) => g.predicate({ ...n, args: x })
241
- }), {}), a = t.features.listStore.getState().reduce((d, g) => ({
242
- ...d,
243
- [g.id]: async () => {
244
- const { bucket: x } = await g.getBucket();
245
- return x;
236
+ async function ct(t, e, r) {
237
+ const n = t.getStateSnapshot(), s = t.predicates.listStore.getState().reduce((u, d) => ({
238
+ ...u,
239
+ [d.name]: (...y) => d.predicate({ ...n, args: y })
240
+ }), {}), c = t.features.listStore.getState().reduce((u, d) => ({
241
+ ...u,
242
+ [d.id]: async () => {
243
+ const { bucket: y } = await d.getBucket();
244
+ return y;
246
245
  }
247
- }), {}), o = t.actions.listStore.getState().reduce((d, g) => ({
248
- ...d,
249
- [g.name]: (x) => g.action(x)
250
- }), {}), f = {
246
+ }), {}), o = {
247
+ ...r,
251
248
  responses: t.responses.getAllStore.getState(),
252
249
  location: typeof n.location == "object" ? {
253
250
  hash: n.location.hash,
@@ -261,11 +258,9 @@ async function at(t, e, r) {
261
258
  search: n.location.search
262
259
  } : void 0,
263
260
  predicates: s,
264
- features: a,
265
- actions: o,
266
- ...r
261
+ features: c
267
262
  };
268
- return await p(e, f);
263
+ return await p(e, o);
269
264
  }
270
265
  function Mt(t) {
271
266
  return !vt() || !gt() ? [] : Array.from(window.document.querySelectorAll(t)).filter(
@@ -293,7 +288,7 @@ function Dt(t, e) {
293
288
  });
294
289
  r.observe(document.body, { childList: !0, subtree: !0 });
295
290
  }
296
- const K = "picked-root", V = "picked-target", Rt = "picked-root";
291
+ const G = "picked-root", V = "picked-target", Rt = "picked-root";
297
292
  function ee(t, e) {
298
293
  return [
299
294
  ...t,
@@ -304,7 +299,7 @@ function ee(t, e) {
304
299
  }
305
300
  ].flatMap((n) => {
306
301
  const s = Mt(n.selector).filter(
307
- (a) => !Pt(a, e) && !Ct(a, e)
302
+ (c) => !Pt(c, e) && !Ct(c, e)
308
303
  );
309
304
  return {
310
305
  ...n,
@@ -322,11 +317,11 @@ function Pt(t, e) {
322
317
  return e ? t.classList.contains(`${V}-${e}`) : t.classList.contains(`${V}`);
323
318
  }
324
319
  function Ct(t, e) {
325
- return e ? t.classList.contains(`${K}-${e}`) : t.classList.contains(K);
320
+ return e ? t.classList.contains(`${G}-${e}`) : t.classList.contains(G);
326
321
  }
327
322
  function Ht(t) {
328
323
  const e = document.createElement("div");
329
- return e.style.display = "block", e.classList.add(K), e.classList.add(`${K}-${t}`), e;
324
+ return e.style.display = "block", e.classList.add(G), e.classList.add(`${G}-${t}`), e;
330
325
  }
331
326
  function jt(t, e, r) {
332
327
  let n;
@@ -347,7 +342,7 @@ function jt(t, e, r) {
347
342
  case "prepend":
348
343
  t.prepend(s);
349
344
  break;
350
- case "append":
345
+ default:
351
346
  t.append(s);
352
347
  break;
353
348
  }
@@ -355,10 +350,10 @@ function jt(t, e, r) {
355
350
  }
356
351
  return n;
357
352
  }
358
- function ct(t) {
353
+ function at(t) {
359
354
  return t.type === "conditional";
360
355
  }
361
- function P(t) {
356
+ function C(t) {
362
357
  return t.type === "step";
363
358
  }
364
359
  function ut(t) {
@@ -370,60 +365,60 @@ function Y(t) {
370
365
  function ft(t) {
371
366
  return t.type === "action";
372
367
  }
373
- const St = (t, e, r, n, s = /* @__PURE__ */ new Set()) => s.has(r.id) ? [] : (s.add(r.id), P(r) && !n ? [r] : e.filter((o) => o.sourceNodeId === r.id).flatMap((o) => {
374
- const f = t.find((d) => d.id === o.destinationNodeId);
375
- return f ? St(t, e, f, !1, s) : [];
376
- })), Ut = (t, e, r) => St(t, e, r, !0, /* @__PURE__ */ new Set()), yt = (t, e, r, n, s = /* @__PURE__ */ new Set()) => {
368
+ const St = (t, e, r, n, s = /* @__PURE__ */ new Set()) => s.has(r.id) ? [] : (s.add(r.id), C(r) && !n ? [r] : e.filter((o) => o.sourceNodeId === r.id).flatMap((o) => {
369
+ const u = t.find((d) => d.id === o.destinationNodeId);
370
+ return u ? St(t, e, u, !1, s) : [];
371
+ })), Kt = (t, e, r) => St(t, e, r, !0, /* @__PURE__ */ new Set()), yt = (t, e, r, n, s = /* @__PURE__ */ new Set()) => {
377
372
  if (s.has(r.id)) return [-1, -1];
378
373
  s.add(r.id);
379
- const a = e.filter((d) => d.sourceNodeId === r.id);
380
- if (a.length === 0) return [0, 0];
381
- let o = 1 / 0, f = -1 / 0;
382
- for (const d of a) {
383
- const g = t.find((M) => M.id === d.destinationNodeId);
384
- if (!g) continue;
385
- const [x, F] = yt(
374
+ const c = e.filter((d) => d.sourceNodeId === r.id);
375
+ if (c.length === 0) return [0, 0];
376
+ let o = 1 / 0, u = -1 / 0;
377
+ for (const d of c) {
378
+ const y = t.find((T) => T.id === d.destinationNodeId);
379
+ if (!y) continue;
380
+ const [b, F] = yt(
386
381
  t,
387
382
  e,
388
- g,
383
+ y,
389
384
  !1,
390
385
  new Set(s)
391
386
  );
392
- x !== -1 && (o = Math.min(o, x + 1), f = Math.max(f, F + 1));
387
+ b !== -1 && (o = Math.min(o, b + 1), u = Math.max(u, F + 1));
393
388
  }
394
- return o === 1 / 0 ? [-1, -1] : [o, f];
395
- }, Wt = (t, e, r) => yt(t, e, r, !0, /* @__PURE__ */ new Set()), ht = (t, e, r, n = /* @__PURE__ */ new Set()) => {
389
+ return o === 1 / 0 ? [-1, -1] : [o, u];
390
+ }, Ut = (t, e, r) => yt(t, e, r, !0, /* @__PURE__ */ new Set()), ht = (t, e, r, n = /* @__PURE__ */ new Set()) => {
396
391
  if (n.has(r.id)) return [-1, -1];
397
392
  if (n.add(r.id), r.type === "origin") return [0, 0];
398
- const s = e.filter((f) => f.destinationNodeId === r.id);
393
+ const s = e.filter((u) => u.destinationNodeId === r.id);
399
394
  if (s.length === 0) return [-1, -1];
400
- let a = 1 / 0, o = -1 / 0;
401
- for (const f of s) {
402
- const d = t.find((F) => F.id === f.sourceNodeId);
395
+ let c = 1 / 0, o = -1 / 0;
396
+ for (const u of s) {
397
+ const d = t.find((F) => F.id === u.sourceNodeId);
403
398
  if (!d) continue;
404
- const [g, x] = ht(
399
+ const [y, b] = ht(
405
400
  t,
406
401
  e,
407
402
  d,
408
403
  new Set(n)
409
404
  );
410
- g !== -1 && (a = Math.min(a, g + 1), o = Math.max(o, x + 1));
405
+ y !== -1 && (c = Math.min(c, y + 1), o = Math.max(o, b + 1));
411
406
  }
412
- return a === 1 / 0 ? [-1, -1] : [a, o];
413
- }, Gt = (t, e, r) => ht(t, e, r, /* @__PURE__ */ new Set()), wt = (t) => t.find((r) => r.type === "origin") || null, Z = (t, e, r) => {
407
+ return c === 1 / 0 ? [-1, -1] : [c, o];
408
+ }, Wt = (t, e, r) => ht(t, e, r, /* @__PURE__ */ new Set()), wt = (t) => t.find((r) => r.type === "origin") || null, Z = (t, e, r) => {
414
409
  if (!t)
415
410
  return wt(e);
416
- const n = r.find((a) => a.sourceNodeId === t.id);
411
+ const n = r.find((c) => c.sourceNodeId === t.id);
417
412
  if (!n)
418
413
  return null;
419
- const s = e.find((a) => a.id === n.destinationNodeId);
414
+ const s = e.find((c) => c.id === n.destinationNodeId);
420
415
  return s || null;
421
416
  };
422
- async function Kt(t, e, r, n) {
423
- const s = t ? "true" : "false", a = n.find(
417
+ async function Gt(t, e, r, n) {
418
+ const s = t ? "true" : "false", c = n.find(
424
419
  (o) => o.sourceNodeHandle === s && o.sourceNodeId === e
425
420
  );
426
- return r.find((o) => o.id === a?.destinationNodeId);
421
+ return r.find((o) => o.id === c?.destinationNodeId);
427
422
  }
428
423
  const tt = kt("experience-instance"), Vt = dt(
429
424
  ({
@@ -432,47 +427,47 @@ const tt = kt("experience-instance"), Vt = dt(
432
427
  target: r,
433
428
  options: n
434
429
  }) => {
435
- const s = b(), a = b(), o = b(), f = b(), d = b(), g = b(), x = e.componentStore, F = tt.store("transitioning"), M = t.history.entriesStore.map((i) => i.filter((l) => l.experienceId === e.id)), U = M.map((i) => i.filter((l) => P(l.node))), c = M.map((i) => i.at(-1)?.node || null), y = D(
436
- e.treeStore,
437
- c,
438
- ({ steps: i }, l) => i.find((u) => l && P(l) && u.id === l.stepId) || null
439
- ), N = D(
440
- e.treeStore,
430
+ const s = I(), c = I(), o = I(), u = I(), d = I(), y = I(), b = e.componentStore, F = tt.store("transitioning"), T = t.history.entriesStore.map((i) => i.filter((l) => l.experienceId === e.id)), U = T.map((i) => i.filter((l) => C(l.node))), a = T.map((i) => i.at(-1)?.node || null), S = R(
431
+ t.steps.listStore,
432
+ a,
433
+ (i, l) => i.find((f) => l && C(l) && f.key === l.stepKey) || null
434
+ ), x = R(
435
+ t.steps.listStore,
441
436
  U,
442
- ({ steps: i }, l) => {
443
- const u = l.at(-2);
444
- if (!u || !P(u.node))
437
+ (i, l) => {
438
+ const f = l.at(-2);
439
+ if (!f || !C(f.node))
445
440
  return null;
446
- const h = u.node;
447
- return i.find((_) => _.id === h.stepId) || null;
441
+ const h = f.node;
442
+ return i.find((B) => B.key === h.stepKey) || null;
448
443
  }
449
- ), T = D(
444
+ ), L = R(
450
445
  e.treeStore,
451
- c,
452
- ({ nodes: i, edges: l }, u) => u ? Ut(i, l, u) : []
453
- ), C = D(
446
+ a,
447
+ ({ nodes: i, edges: l }, f) => f ? Kt(i, l, f) : []
448
+ ), H = R(
454
449
  e.treeStore,
455
- c,
456
- ({ nodes: i, edges: l }, u) => u ? Gt(i, l, u) : [-1, -1]
457
- ), q = D(
450
+ a,
451
+ ({ nodes: i, edges: l }, f) => f ? Wt(i, l, f) : [-1, -1]
452
+ ), q = R(
458
453
  e.treeStore,
459
- c,
460
- ({ nodes: i, edges: l }, u) => u ? Wt(i, l, u) : [-1, -1]
461
- ), L = tt.store(!1), W = lt(L, {
454
+ a,
455
+ ({ nodes: i, edges: l }, f) => f ? Ut(i, l, f) : [-1, -1]
456
+ ), D = tt.store(!1), W = lt(D, {
462
457
  open: () => !0,
463
458
  close: () => !1,
464
459
  toggle: (i) => !i,
465
460
  set: (i, l) => l
466
- }), xt = B(async () => {
461
+ }), xt = $(async () => {
467
462
  t.history.back({ experienceId: e.id });
468
463
  }), Nt = O({
469
464
  source: e.treeStore,
470
465
  effect: async (i, l) => {
471
- const u = i.nodes.find((h) => P(h) && h.stepId === l);
472
- u && t.history.push({ experienceId: e.id, node: u });
466
+ const f = i.nodes.find((h) => C(h) && h.stepKey === l);
467
+ f && t.history.push({ experienceId: e.id, node: f });
473
468
  }
474
469
  }), et = O({
475
- source: c,
470
+ source: a,
476
471
  effect: (i) => {
477
472
  }
478
473
  }), z = O({
@@ -480,343 +475,342 @@ const tt = kt("experience-instance"), Vt = dt(
480
475
  effect: async ({ nodes: i }) => wt(i)
481
476
  }), X = O({
482
477
  source: e.treeStore,
483
- effect: async ({ nodes: i, edges: l }, u) => {
484
- if (Y(u))
485
- return Z(u, i, l);
478
+ effect: async ({ nodes: i, edges: l }, f) => {
479
+ if (Y(f))
480
+ return Z(f, i, l);
486
481
  }
487
482
  }), J = O({
488
483
  source: e.treeStore,
489
- effect: async ({ nodes: i, edges: l, conditionals: u }, h) => {
490
- if (!ct(h))
484
+ effect: async ({ nodes: i, edges: l, conditions: f }, h) => {
485
+ if (!at(h))
491
486
  return;
492
- const _ = u.find((A) => A.id === h.conditionalId);
493
- if (!_)
487
+ const B = h.conditionId ?? h.conditionalId, w = t.conditions.listStore.getState().find((_) => _.id === B)?.condition ?? f.find((_) => _.id === B)?.condition;
488
+ if (!w)
494
489
  return;
495
- const k = h.id, w = await at(t, _.condition);
496
- return Kt(!!w, k, i, l);
490
+ const A = await ct(t, w);
491
+ return Gt(!!A, h.id, i, l);
497
492
  }
498
493
  }), nt = O({
499
494
  source: e.treeStore,
500
- effect: async ({ nodes: i, edges: l }, u) => {
501
- if (!ft(u))
495
+ effect: async ({ nodes: i, edges: l }, f) => {
496
+ if (!ft(f))
502
497
  return;
503
- const h = u.action;
498
+ const h = f.action;
504
499
  if (!h) {
505
- I("warn", `Action node ${u.id} has no action name`);
500
+ E("warn", `Action node ${f.id} has no action name`);
506
501
  return;
507
502
  }
508
- const _ = t.actions.getByName(h).getState();
509
- if (!_) {
510
- I("warn", `Action '${h}' not registered on client`);
503
+ const B = t.actions.getByName(h).getState();
504
+ if (!B) {
505
+ E("warn", `Action '${h}' not registered on client`);
511
506
  const k = l.find(
512
- (w) => w.sourceNodeId === u.id && w.sourceNodeHandle === "false"
507
+ (w) => w.sourceNodeId === f.id && w.sourceNodeHandle === "false"
513
508
  );
514
509
  return k ? i.find((w) => w.id === k.destinationNodeId) : null;
515
510
  }
516
- if (typeof _.action != "function") {
517
- I("warn", `Action '${h}' is not a function`);
511
+ if (typeof B.action != "function") {
512
+ E("warn", `Action '${h}' is not a function`);
518
513
  const k = l.find(
519
- (w) => w.sourceNodeId === u.id && w.sourceNodeHandle === "false"
514
+ (w) => w.sourceNodeId === f.id && w.sourceNodeHandle === "false"
520
515
  );
521
516
  return k ? i.find((w) => w.id === k.destinationNodeId) : null;
522
517
  }
523
518
  try {
524
- I("info", `Executing action: ${h}`), await _.action(h);
519
+ E("info", `Executing action: ${h}`), await B.action(h);
525
520
  const k = l.find(
526
- (A) => A.sourceNodeId === u.id && A.sourceNodeHandle === "true"
521
+ (A) => A.sourceNodeId === f.id && A.sourceNodeHandle === "true"
527
522
  );
528
523
  if (!k)
529
- return I("warn", `No 'true' edge found for action node ${u.id}`), null;
524
+ return E("warn", `No 'true' edge found for action node ${f.id}`), null;
530
525
  const w = i.find((A) => A.id === k.destinationNodeId);
531
- return I("info", `Action '${h}' succeeded, moving to node ${w?.id}`), w || null;
526
+ return E("info", `Action '${h}' succeeded, moving to node ${w?.id}`), w || null;
532
527
  } catch (k) {
533
- I("warn", `Action '${h}' failed:`, k);
528
+ E("warn", `Action '${h}' failed:`, k);
534
529
  const w = l.find(
535
- (G) => G.sourceNodeId === u.id && G.sourceNodeHandle === "false"
530
+ (_) => _.sourceNodeId === f.id && _.sourceNodeHandle === "false"
536
531
  );
537
532
  if (!w)
538
- return I("warn", `No 'false' edge found for action node ${u.id}`), null;
539
- const A = i.find((G) => G.id === w.destinationNodeId);
540
- return I("info", `Action '${h}' failed, moving to node ${A?.id}`), A || null;
533
+ return E("warn", `No 'false' edge found for action node ${f.id}`), null;
534
+ const A = i.find((_) => _.id === w.destinationNodeId);
535
+ return E("info", `Action '${h}' failed, moving to node ${A?.id}`), A || null;
541
536
  }
542
537
  }
543
- }), Et = B((i) => {
538
+ }), Et = $((i) => {
544
539
  ut(i) && t.experiences.launch({ id: i.experienceId });
545
540
  }), rt = O({
546
- source: [c, e.treeStore],
547
- effect: async ([i, { nodes: l, edges: u }]) => Z(i, l, u)
548
- }), H = O({
549
- source: [c, e.treeStore],
550
- effect: async ([i, { nodes: l, edges: u }]) => Z(i, l, u)
551
- }), It = B((i) => {
541
+ source: [a, e.treeStore],
542
+ effect: async ([i, { nodes: l, edges: f }]) => Z(i, l, f)
543
+ }), j = O({
544
+ source: [a, e.treeStore],
545
+ effect: async ([i, { nodes: l, edges: f }]) => Z(i, l, f)
546
+ }), It = $((i) => {
552
547
  t.history.push({ experienceId: e.id, node: i });
553
548
  }), ot = O({
554
549
  source: e.configStore,
555
- effect: async ({ initializeOpenLogic: i }) => n?.initialiseOpen !== void 0 ? n.initialiseOpen : $t(i) ? !!await at(t, i) : i ?? !1
556
- }), $ = Object.freeze({
557
- // eslint-disable-next-line sonarjs/pseudo-random -- non-security use: generating a unique runtime ID for UI tracking
550
+ effect: async ({ initializeOpenLogic: i }) => n?.initialiseOpen !== void 0 ? n.initialiseOpen : $t(i) ? !!await ct(t, i) : i ?? !1
551
+ }), M = Object.freeze({
552
+ // eslint-disable-next-line sonarjs/pseudo-random -- instance ID is non-security-sensitive
558
553
  id: Math.random().toString(36).substring(7),
559
554
  // config
560
555
  experienceId: e.id,
561
556
  configStore: e.configStore,
562
557
  target: r,
563
- componentStore: x,
558
+ componentStore: b,
564
559
  // state
565
560
  stateStore: F,
566
561
  // open close
567
- isOpenStore: L,
562
+ isOpenStore: D,
568
563
  open: W.open,
569
564
  close: W.close,
570
565
  toggleOpen: W.toggle,
571
566
  setOpen: W.set,
572
567
  // nodes
573
568
  treeStore: e.treeStore,
574
- fieldsStore: e.fieldsStore,
575
- currentNodeStore: c,
576
- currentStepStore: y,
577
- previousStepStore: N,
578
- nextReachableStepNodesStore: T,
579
- stepsToOriginStore: C,
569
+ currentNodeStore: a,
570
+ currentStepStore: S,
571
+ previousStepStore: x,
572
+ nextReachableStepNodesStore: L,
573
+ stepsToOriginStore: H,
580
574
  stepsToLeafStore: q,
581
575
  // history
582
- goToNextStep: a,
576
+ goToNextStep: c,
583
577
  goToPreviousStep: o,
584
- goToStepById: f,
578
+ goToStepById: u,
585
579
  stepsHistoryStore: U
586
- }), Q = b(), it = b();
587
- return S({
588
- source: c,
580
+ }), Q = I(), it = I();
581
+ return m({
582
+ source: a,
589
583
  target: Q
590
- }), S({
584
+ }), m({
591
585
  clock: Q,
592
586
  filter: (i) => i === null,
593
587
  target: z
594
- }), S({
588
+ }), m({
595
589
  clock: Q,
596
590
  filter: (i) => i !== null,
597
591
  target: it
598
592
  }), bt({
599
593
  source: it,
600
- match: (i) => ct(i) ? "condition" : P(i) ? "step" : ut(i) ? "launchExperience" : Y(i) ? "origin" : ft(i) ? "action" : "other",
594
+ match: (i) => at(i) ? "condition" : C(i) ? "step" : ut(i) ? "launchExperience" : Y(i) ? "origin" : ft(i) ? "action" : "other",
601
595
  cases: {
602
596
  origin: X,
603
597
  condition: J,
604
598
  step: et,
605
599
  launchExperience: Et,
606
600
  action: nt,
607
- __: b()
601
+ __: I()
608
602
  }
609
- }), S({
603
+ }), m({
610
604
  clock: [
611
605
  J.doneData,
612
606
  X.doneData,
613
607
  z.doneData,
614
- H.doneData,
608
+ j.doneData,
615
609
  rt.doneData,
616
610
  nt.doneData
617
611
  ],
618
612
  filter: Boolean,
619
613
  target: It
620
- }), S({
621
- clock: a,
622
- target: H
623
- }), S({
624
- clock: a,
625
- source: y,
614
+ }), m({
615
+ clock: c,
616
+ target: j
617
+ }), m({
618
+ clock: c,
619
+ source: S,
626
620
  filter: Boolean,
627
621
  target: t.eventBus.prepend((i) => ({
628
622
  type: "step_submit",
629
623
  step: i,
630
- experience: $
624
+ experience: M
631
625
  }))
632
- }), S({
633
- clock: H.done,
634
- source: y,
626
+ }), m({
627
+ clock: j.done,
628
+ source: S,
635
629
  filter: Boolean,
636
630
  target: t.eventBus.prepend((i) => ({
637
631
  type: "step_submit_success",
638
632
  step: i,
639
- experience: $
633
+ experience: M
640
634
  }))
641
- }), S({
642
- clock: H.fail,
643
- source: y,
635
+ }), m({
636
+ clock: j.fail,
637
+ source: S,
644
638
  filter: Boolean,
645
639
  target: t.eventBus.prepend((i) => ({
646
640
  type: "step_submit_error",
647
641
  step: i,
648
- experience: $
642
+ experience: M
649
643
  }))
650
- }), S({
644
+ }), m({
651
645
  clock: o,
652
646
  target: xt
653
- }), S({ clock: f, target: Nt }), S({
654
- source: D([
647
+ }), m({ clock: u, target: Nt }), m({
648
+ source: R([
655
649
  J.pending,
656
650
  X.pending,
657
651
  z.pending,
658
- H.pending
652
+ j.pending
659
653
  ]),
660
654
  fn: (i) => i.some(Boolean) ? "transitioning" : "ready",
661
655
  target: F
662
- }), S({
656
+ }), m({
663
657
  clock: et.doneData,
664
- source: y,
658
+ source: S,
665
659
  filter: Boolean,
666
660
  target: t.eventBus.prepend((i) => ({
667
661
  type: "step_enter",
668
662
  step: i,
669
- experience: $
663
+ experience: M
670
664
  }))
671
- }), S({
672
- clock: g,
665
+ }), m({
666
+ clock: y,
673
667
  target: ot
674
- }), S({
668
+ }), m({
675
669
  source: ot.doneData,
676
670
  fn: Boolean,
677
- target: L
678
- }), S({
679
- source: c,
671
+ target: D
672
+ }), m({
673
+ source: a,
680
674
  clock: s,
681
675
  filter: (i) => i ? Y(i) : !0,
682
676
  target: rt
683
- }), S({
684
- source: L,
677
+ }), m({
678
+ source: D,
685
679
  filter: Boolean,
686
680
  target: s
687
- }), S({
688
- source: L,
681
+ }), m({
682
+ source: D,
689
683
  filter: Boolean,
690
684
  target: t.eventBus.prepend(() => ({
691
685
  type: "experience_open",
692
- experience: $
686
+ experience: M
693
687
  }))
694
- }), S({
695
- source: L,
688
+ }), m({
689
+ source: D,
696
690
  filter: (i) => !i,
697
691
  target: t.eventBus.prepend(() => ({
698
692
  type: "experience_close",
699
- experience: $
693
+ experience: M
700
694
  }))
701
- }), S({
695
+ }), m({
702
696
  clock: d,
703
- target: [g]
704
- }), d(), $;
697
+ target: [y]
698
+ }), d(), M;
705
699
  }
706
700
  );
707
701
  function qt(t) {
708
702
  return pt(Vt, t);
709
703
  }
710
704
  const zt = dt(({ client: t }) => {
711
- const e = tt.store({}), r = b(), n = b(), s = b(), a = lt(e, {
712
- register(c, y) {
713
- const N = [
714
- ...c[y.experienceId] ?? []
705
+ const e = tt.store({}), r = I(), n = I(), s = I(), c = lt(e, {
706
+ register(a, S) {
707
+ const x = [
708
+ ...a[S.experienceId] ?? []
715
709
  ];
716
- return N.push(y), {
717
- ...c,
718
- [y.experienceId]: N
710
+ return x.push(S), {
711
+ ...a,
712
+ [S.experienceId]: x
719
713
  };
720
714
  },
721
- unregister(c, y) {
722
- const N = y.experienceId, T = c[N]?.filter(
723
- (C) => C !== y
715
+ unregister(a, S) {
716
+ const x = S.experienceId, L = a[x]?.filter(
717
+ (H) => H !== S
724
718
  );
725
719
  return {
726
- ...c,
727
- [N]: T ?? []
720
+ ...a,
721
+ [x]: L ?? []
728
722
  };
729
723
  }
730
- }), o = B(
724
+ }), o = $(
731
725
  ({
732
- experience: c,
733
- target: y,
734
- options: N
735
- }) => qt({ client: t, experience: c, target: y, options: N })
736
- ), f = B((c) => {
737
- a.register(c);
738
- }), d = B(
739
- (c) => {
740
- c.target && Dt(c.target, () => {
741
- s(c);
726
+ experience: a,
727
+ target: S,
728
+ options: x
729
+ }) => qt({ client: t, experience: a, target: S, options: x })
730
+ ), u = $((a) => {
731
+ c.register(a);
732
+ }), d = $(
733
+ (a) => {
734
+ a.target && Dt(a.target, () => {
735
+ s(a);
742
736
  });
743
737
  }
744
- ), g = B((c) => {
745
- a.unregister(c);
746
- }), x = B((c) => {
747
- const y = c.componentStore.getState();
748
- if (!y) {
749
- I("warn", "No app component registered. Skipping init.");
738
+ ), y = $((a) => {
739
+ c.unregister(a);
740
+ }), b = $((a) => {
741
+ const S = a.componentStore.getState();
742
+ if (!S) {
743
+ E("warn", "No app component registered. Skipping init.");
750
744
  return;
751
745
  }
752
- const N = y.frameworkStore.getState();
753
- if (!N) {
754
- I(
746
+ const x = S.frameworkStore.getState();
747
+ if (!x) {
748
+ E(
755
749
  "error",
756
- `No framework registered for component '${y.name}'. Skipping rendering.`
750
+ `No framework registered for component '${S.name}'. Skipping rendering.`
757
751
  );
758
752
  return;
759
753
  }
760
- const T = c.target;
761
- if (!T) {
762
- I(
754
+ const L = a.target;
755
+ if (!L) {
756
+ E(
763
757
  "error",
764
- `No target element registered for experience '${c.experienceId}'. Skipping rendering.`
758
+ `No target element registered for experience '${a.experienceId}'. Skipping rendering.`
765
759
  );
766
760
  return;
767
761
  }
768
- const C = Lt(T);
762
+ const H = Lt(L);
769
763
  try {
770
- N.render(C, y.component, t, c);
764
+ x.render(H, S.component, t, a);
771
765
  } catch (q) {
772
- I("error", q);
766
+ E("error", q);
773
767
  }
774
768
  });
775
- S({
769
+ m({
776
770
  clock: r,
777
771
  target: o
778
- }), S({
772
+ }), m({
779
773
  clock: s,
780
- target: g
781
- }), S({
774
+ target: y
775
+ }), m({
782
776
  clock: o.doneData,
783
777
  target: [
784
- f,
778
+ u,
785
779
  d,
786
780
  n
787
781
  ]
788
- }), S({
782
+ }), m({
789
783
  clock: o.doneData,
790
- target: t.eventBus.prepend((c) => ({
784
+ target: t.eventBus.prepend((a) => ({
791
785
  type: "experience_initialize",
792
- experience: c
786
+ experience: a
793
787
  }))
794
- }), S({
788
+ }), m({
795
789
  clock: n,
796
- target: x
790
+ target: b
797
791
  });
798
- function F(c, y, N) {
799
- r({ experience: c, target: y, options: N });
792
+ function F(a, S, x) {
793
+ r({ experience: a, target: S, options: x });
800
794
  }
801
- const M = e.map((c) => Object.values(c).flat());
802
- function U(c) {
803
- return e.map((y) => y[c] || [], { skipVoid: !1 });
795
+ const T = e.map((a) => Object.values(a).flat());
796
+ function U(a) {
797
+ return e.map((S) => S[a] || [], { skipVoid: !1 });
804
798
  }
805
799
  return {
806
800
  spawn: F,
807
801
  getByExperienceId: U,
808
- listStore: M
802
+ listStore: T
809
803
  };
810
804
  });
811
805
  function oe(t) {
812
806
  return pt(zt, t);
813
807
  }
814
808
  export {
815
- P as a,
809
+ C as a,
816
810
  oe as b,
817
811
  ne as c,
818
812
  te as d,
819
- at as e,
813
+ ct as e,
820
814
  Ct as f,
821
815
  ee as g,
822
816
  qt as h,