@picked/client 0.0.1-dev.1773729274420 → 0.0.1-dev.1773807602703

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