@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.
- package/dist/{api-DuHeVrL4.js → api-GlH9T8_1.js} +1 -1
- package/dist/{api-47L967ES.cjs → api-GvmToTw0.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +738 -741
- package/dist/esm/plugins/create-experience/index.js +360 -286
- package/dist/esm/plugins/dynamic-experiences/index.js +145 -78
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-indexeddb/index.js +46 -51
- package/dist/esm/plugins/single-page-app/index.js +24 -24
- package/dist/esm/server/index.js +7 -7
- package/dist/experience-instance-CxiOyYPf.cjs +1 -0
- package/dist/{experience-instance-DTyL1fNb.js → experience-instance-DCknHRkX.js} +328 -349
- package/dist/nodes-DQt4TfuO.js +26 -0
- package/dist/nodes-DsL8kMSX.cjs +1 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/{object-CJssU1Pm.js → object-JwZ58NOH.js} +1 -1
- package/dist/storage-Be5xWNPC.cjs +1 -0
- package/dist/{storage-B2d81EOI.js → storage-Co_LbKr_.js} +30 -35
- package/dist/types/entities/action/action.d.ts +2 -5
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/condition/condition.d.ts +17 -0
- package/dist/types/entities/condition/condition.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +48 -31
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -2
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +23 -52
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +9 -7
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +20 -0
- package/dist/types/entities/step/step.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +8 -2
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +41 -32
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +70 -43
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +1 -1
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +20 -5
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +46 -0
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -2
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -2
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +3 -0
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +2 -2
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +1 -0
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/key.d.ts +12 -0
- package/dist/types/utils/key.d.ts.map +1 -0
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +3 -3
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +7 -2
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/picked-config.d.ts +1 -1
- package/dist/types/utils/picked-config.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/package.json +2 -16
- package/dist/experience-instance-BX0aqKsC.cjs +0 -1
- package/dist/object-mwaxtjLG.cjs +0 -1
- package/dist/storage-58NoTSsc.cjs +0 -1
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { createDomain as
|
|
2
|
-
import { createFactory as
|
|
3
|
-
import { a as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
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
|
|
10
|
+
function U(t) {
|
|
10
11
|
return typeof t == "string";
|
|
11
12
|
}
|
|
12
|
-
function
|
|
13
|
+
function N(t) {
|
|
13
14
|
return Array.isArray(t);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function St(t) {
|
|
16
17
|
return t instanceof Promise;
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function ft(t) {
|
|
19
20
|
return typeof t == "object" && t !== null && !Array.isArray(t) && Object.keys(t).length === 1;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
if (
|
|
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
|
|
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) =>
|
|
37
|
-
">=": (t, e) =>
|
|
37
|
+
">": (t, e) => g(t) > g(e),
|
|
38
|
+
">=": (t, e) => g(t) >= g(e),
|
|
38
39
|
"<": (t, e, r) => {
|
|
39
|
-
const n =
|
|
40
|
+
const n = g(t), s = g(e);
|
|
40
41
|
if (r === void 0) return n < s;
|
|
41
|
-
const a =
|
|
42
|
+
const a = g(r);
|
|
42
43
|
return n < s && s < a;
|
|
43
44
|
},
|
|
44
45
|
"<=": (t, e, r) => {
|
|
45
|
-
const n =
|
|
46
|
+
const n = g(t), s = g(e);
|
|
46
47
|
if (r === void 0) return n <= s;
|
|
47
|
-
const a =
|
|
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) =>
|
|
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 ?
|
|
56
|
-
cat: (...t) => t.map(
|
|
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 =
|
|
60
|
+
const n = P(t), s = g(e);
|
|
60
61
|
if (r === void 0) return n.substr(s);
|
|
61
|
-
const a =
|
|
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) =>
|
|
70
|
-
"*": (...t) => t.reduce((e, r) =>
|
|
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 =
|
|
73
|
-
return e === void 0 ? -r : r -
|
|
73
|
+
const r = g(t);
|
|
74
|
+
return e === void 0 ? -r : r - g(e);
|
|
74
75
|
},
|
|
75
|
-
"/": (t, e) =>
|
|
76
|
-
min: (...t) => Math.min(...t.map(
|
|
77
|
-
max: (...t) => Math.max(...t.map(
|
|
78
|
-
merge: (...t) => t.reduce((e, 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 =
|
|
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
|
|
96
|
-
isNaN(
|
|
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 =
|
|
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 (!
|
|
113
|
-
const n = r.filter(
|
|
114
|
-
return e.filter(
|
|
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 (
|
|
134
|
+
if (N(t)) {
|
|
135
135
|
const [a, o] = t;
|
|
136
136
|
r = a, n = o;
|
|
137
137
|
}
|
|
138
|
-
return !
|
|
138
|
+
return !U(r) || !U(n) ? !1 : new RegExp(r, n).test(P(e));
|
|
139
139
|
},
|
|
140
140
|
throw(t) {
|
|
141
|
-
throw new Error(
|
|
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 (
|
|
146
|
+
if (St(t))
|
|
147
147
|
return p(await t, e);
|
|
148
|
-
if (
|
|
148
|
+
if (N(t))
|
|
149
149
|
return Promise.all(t.map((o) => p(o, e)));
|
|
150
|
-
if (!
|
|
151
|
-
const r =
|
|
150
|
+
if (!ft(t)) return t;
|
|
151
|
+
const r = $t(t);
|
|
152
152
|
let n = r ? t[r] ?? [] : [];
|
|
153
|
-
switch (
|
|
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
|
|
163
|
-
if (o = await p(
|
|
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
|
|
170
|
-
if (o = await p(
|
|
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
|
|
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
|
|
179
|
+
return N(o) ? (await Promise.all(
|
|
180
180
|
o.map(async (d) => {
|
|
181
|
-
const
|
|
182
|
-
return { item: d, shouldInclude:
|
|
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 (!
|
|
188
|
+
if (!N(o))
|
|
189
189
|
return n.length > 2 ? await p(n[2], e) : null;
|
|
190
|
-
const
|
|
191
|
-
let
|
|
192
|
-
for (const
|
|
193
|
-
|
|
194
|
-
return
|
|
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 (!
|
|
199
|
-
for (const
|
|
200
|
-
if (!await v(await p(n[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 (!
|
|
206
|
-
for (const
|
|
207
|
-
if (await v(await p(n[1],
|
|
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 (!
|
|
213
|
-
for (const
|
|
214
|
-
if (await v(await p(n[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
|
|
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
|
|
229
|
+
return St(t) ? v(await t) : !(Array.isArray(t) && t.length === 0) && !!t;
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function $t(t) {
|
|
232
232
|
return Object.keys(t)[0];
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
return !
|
|
234
|
+
function Mt(t) {
|
|
235
|
+
return !Ft(t);
|
|
236
236
|
}
|
|
237
|
-
async function
|
|
238
|
-
const n = t.getStateSnapshot(), s = t.predicates.listStore.getState().reduce((
|
|
239
|
-
...
|
|
240
|
-
[
|
|
241
|
-
}), {}), a = t.features.listStore.getState().reduce((
|
|
242
|
-
...
|
|
243
|
-
[
|
|
244
|
-
const { bucket:
|
|
245
|
-
return
|
|
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 =
|
|
248
|
-
...
|
|
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,
|
|
264
|
+
return await p(e, o);
|
|
269
265
|
}
|
|
270
|
-
function
|
|
271
|
-
return !
|
|
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
|
|
276
|
-
function
|
|
277
|
-
if (!
|
|
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:
|
|
275
|
+
return t.attachShadow({ mode: Lt });
|
|
280
276
|
}
|
|
281
|
-
function
|
|
277
|
+
function ne() {
|
|
282
278
|
return new Promise((t, e) => {
|
|
283
|
-
if (!
|
|
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
|
|
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
|
|
297
|
-
function
|
|
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: `${
|
|
298
|
+
selector: `${Pt}[experience-id="${e}"]`,
|
|
303
299
|
placement: "replace"
|
|
304
300
|
}
|
|
305
301
|
].flatMap((n) => {
|
|
306
|
-
const s =
|
|
307
|
-
(a) => !
|
|
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
|
|
316
|
-
return t.flatMap((r) => r.elements.map((n) =>
|
|
311
|
+
function oe(t, e) {
|
|
312
|
+
return t.flatMap((r) => r.elements.map((n) => Ut(n, r.placement, e)));
|
|
317
313
|
}
|
|
318
|
-
function
|
|
314
|
+
function ie(t, e) {
|
|
319
315
|
t.classList.add(V), t.classList.add(`${V}-${e}`);
|
|
320
316
|
}
|
|
321
|
-
function
|
|
317
|
+
function Ct(t, e) {
|
|
322
318
|
return e ? t.classList.contains(`${V}-${e}`) : t.classList.contains(`${V}`);
|
|
323
319
|
}
|
|
324
|
-
function
|
|
325
|
-
return e ? t.classList.contains(`${
|
|
320
|
+
function Ht(t, e) {
|
|
321
|
+
return e ? t.classList.contains(`${G}-${e}`) : t.classList.contains(G);
|
|
326
322
|
}
|
|
327
|
-
function
|
|
323
|
+
function jt(t) {
|
|
328
324
|
const e = document.createElement("div");
|
|
329
|
-
return e.style.display = "block", e.classList.add(
|
|
325
|
+
return e.style.display = "block", e.classList.add(G), e.classList.add(`${G}-${t}`), e;
|
|
330
326
|
}
|
|
331
|
-
function
|
|
327
|
+
function Ut(t, e, r) {
|
|
332
328
|
let n;
|
|
333
|
-
const s =
|
|
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
|
-
|
|
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
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
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,
|
|
362
|
+
let o = 1 / 0, u = -1 / 0;
|
|
382
363
|
for (const d of a) {
|
|
383
|
-
const
|
|
384
|
-
if (!
|
|
385
|
-
const [
|
|
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
|
-
|
|
369
|
+
h,
|
|
389
370
|
!1,
|
|
390
371
|
new Set(s)
|
|
391
372
|
);
|
|
392
|
-
|
|
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,
|
|
395
|
-
}, Wt = (t, e, r) => yt(t, e, r, !0, /* @__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((
|
|
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
|
|
402
|
-
const d = t.find((F) => F.id ===
|
|
382
|
+
for (const u of s) {
|
|
383
|
+
const d = t.find((F) => F.id === u.sourceNodeId);
|
|
403
384
|
if (!d) continue;
|
|
404
|
-
const [
|
|
385
|
+
const [h, b] = wt(
|
|
405
386
|
t,
|
|
406
387
|
e,
|
|
407
388
|
d,
|
|
408
389
|
new Set(n)
|
|
409
390
|
);
|
|
410
|
-
|
|
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) =>
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
436
|
-
|
|
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
|
-
(
|
|
439
|
-
),
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
(
|
|
443
|
-
const
|
|
444
|
-
if (!
|
|
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
|
|
447
|
-
return i.find((
|
|
427
|
+
const y = f.node;
|
|
428
|
+
return i.find((B) => B.key === Y(y)) || null;
|
|
448
429
|
}
|
|
449
|
-
),
|
|
430
|
+
), L = R(
|
|
450
431
|
e.treeStore,
|
|
451
432
|
c,
|
|
452
|
-
({ nodes: i, edges: l },
|
|
453
|
-
),
|
|
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 },
|
|
457
|
-
), q =
|
|
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 },
|
|
461
|
-
),
|
|
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
|
-
}),
|
|
447
|
+
}), Nt = $(async () => {
|
|
467
448
|
t.history.back({ experienceId: e.id });
|
|
468
|
-
}),
|
|
449
|
+
}), Et = O({
|
|
469
450
|
source: e.treeStore,
|
|
470
451
|
effect: async (i, l) => {
|
|
471
|
-
const
|
|
472
|
-
|
|
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
|
-
}),
|
|
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 }) =>
|
|
461
|
+
effect: async ({ nodes: i }) => xt(i)
|
|
481
462
|
}), X = O({
|
|
482
463
|
source: e.treeStore,
|
|
483
|
-
effect: async ({ nodes: i, edges: l },
|
|
484
|
-
if (
|
|
485
|
-
return
|
|
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,
|
|
490
|
-
if (!
|
|
470
|
+
effect: async ({ nodes: i, edges: l, conditions: f }, y) => {
|
|
471
|
+
if (!at(y))
|
|
491
472
|
return;
|
|
492
|
-
const
|
|
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
|
|
496
|
-
return
|
|
476
|
+
const A = await lt(t, w);
|
|
477
|
+
return Vt(!!A, y.id, i, l);
|
|
497
478
|
}
|
|
498
|
-
}),
|
|
479
|
+
}), rt = O({
|
|
499
480
|
source: e.treeStore,
|
|
500
|
-
effect: async ({ nodes: i, edges: l },
|
|
501
|
-
if (!
|
|
481
|
+
effect: async ({ nodes: i, edges: l }, f) => {
|
|
482
|
+
if (!ct(f))
|
|
502
483
|
return;
|
|
503
|
-
const
|
|
504
|
-
if (!
|
|
505
|
-
|
|
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
|
|
509
|
-
if (!
|
|
510
|
-
|
|
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 ===
|
|
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
|
|
517
|
-
|
|
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 ===
|
|
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
|
-
|
|
505
|
+
E("info", `Executing action: ${y}`), await B.action(y);
|
|
525
506
|
const k = l.find(
|
|
526
|
-
(A) => A.sourceNodeId ===
|
|
507
|
+
(A) => A.sourceNodeId === f.id && A.sourceNodeHandle === "true"
|
|
527
508
|
);
|
|
528
509
|
if (!k)
|
|
529
|
-
return
|
|
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
|
|
512
|
+
return E("info", `Action '${y}' succeeded, moving to node ${w?.id}`), w || null;
|
|
532
513
|
} catch (k) {
|
|
533
|
-
|
|
514
|
+
E("warn", `Action '${y}' failed:`, k);
|
|
534
515
|
const w = l.find(
|
|
535
|
-
(
|
|
516
|
+
(_) => _.sourceNodeId === f.id && _.sourceNodeHandle === "false"
|
|
536
517
|
);
|
|
537
518
|
if (!w)
|
|
538
|
-
return
|
|
539
|
-
const A = i.find((
|
|
540
|
-
return
|
|
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
|
-
}),
|
|
524
|
+
}), It = $((i) => {
|
|
544
525
|
ut(i) && t.experiences.launch({ id: i.experienceId });
|
|
545
|
-
}),
|
|
526
|
+
}), ot = O({
|
|
546
527
|
source: [c, e.treeStore],
|
|
547
|
-
effect: async ([i, { nodes: l, edges:
|
|
548
|
-
}),
|
|
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:
|
|
551
|
-
}),
|
|
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
|
-
}),
|
|
534
|
+
}), it = O({
|
|
554
535
|
source: e.configStore,
|
|
555
|
-
effect: async ({ initializeOpenLogic: i }) => n?.initialiseOpen !== void 0 ? n.initialiseOpen :
|
|
556
|
-
}),
|
|
557
|
-
// eslint-disable-next-line sonarjs/pseudo-random --
|
|
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:
|
|
544
|
+
componentStore: b,
|
|
564
545
|
// state
|
|
565
546
|
stateStore: F,
|
|
566
547
|
// open close
|
|
567
|
-
isOpenStore:
|
|
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:
|
|
577
|
-
previousStepStore:
|
|
578
|
-
nextReachableStepNodesStore:
|
|
579
|
-
stepsToOriginStore:
|
|
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:
|
|
585
|
-
stepsHistoryStore:
|
|
586
|
-
}), Q =
|
|
587
|
-
return
|
|
564
|
+
goToStepById: u,
|
|
565
|
+
stepsHistoryStore: K
|
|
566
|
+
}), Q = I(), st = I();
|
|
567
|
+
return m({
|
|
588
568
|
source: c,
|
|
589
569
|
target: Q
|
|
590
|
-
}),
|
|
570
|
+
}), m({
|
|
591
571
|
clock: Q,
|
|
592
572
|
filter: (i) => i === null,
|
|
593
573
|
target: z
|
|
594
|
-
}),
|
|
574
|
+
}), m({
|
|
595
575
|
clock: Q,
|
|
596
576
|
filter: (i) => i !== null,
|
|
597
|
-
target:
|
|
598
|
-
}),
|
|
599
|
-
source:
|
|
600
|
-
match: (i) =>
|
|
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:
|
|
605
|
-
launchExperience:
|
|
606
|
-
action:
|
|
607
|
-
__:
|
|
584
|
+
step: nt,
|
|
585
|
+
launchExperience: It,
|
|
586
|
+
action: rt,
|
|
587
|
+
__: I()
|
|
608
588
|
}
|
|
609
|
-
}),
|
|
589
|
+
}), m({
|
|
610
590
|
clock: [
|
|
611
591
|
J.doneData,
|
|
612
592
|
X.doneData,
|
|
613
593
|
z.doneData,
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
594
|
+
j.doneData,
|
|
595
|
+
ot.doneData,
|
|
596
|
+
rt.doneData
|
|
617
597
|
],
|
|
618
598
|
filter: Boolean,
|
|
619
|
-
target:
|
|
620
|
-
}),
|
|
599
|
+
target: kt
|
|
600
|
+
}), m({
|
|
621
601
|
clock: a,
|
|
622
|
-
target:
|
|
623
|
-
}),
|
|
602
|
+
target: j
|
|
603
|
+
}), m({
|
|
624
604
|
clock: a,
|
|
625
|
-
source:
|
|
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
|
-
}),
|
|
633
|
-
clock:
|
|
634
|
-
source:
|
|
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
|
-
}),
|
|
642
|
-
clock:
|
|
643
|
-
source:
|
|
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
|
-
}),
|
|
630
|
+
}), m({
|
|
651
631
|
clock: o,
|
|
652
|
-
target:
|
|
653
|
-
}),
|
|
654
|
-
source:
|
|
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
|
-
|
|
638
|
+
j.pending
|
|
659
639
|
]),
|
|
660
640
|
fn: (i) => i.some(Boolean) ? "transitioning" : "ready",
|
|
661
641
|
target: F
|
|
662
|
-
}),
|
|
663
|
-
clock:
|
|
664
|
-
source:
|
|
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
|
-
}),
|
|
672
|
-
clock:
|
|
673
|
-
target:
|
|
674
|
-
}),
|
|
675
|
-
source:
|
|
651
|
+
}), m({
|
|
652
|
+
clock: h,
|
|
653
|
+
target: it
|
|
654
|
+
}), m({
|
|
655
|
+
source: it.doneData,
|
|
676
656
|
fn: Boolean,
|
|
677
|
-
target:
|
|
678
|
-
}),
|
|
657
|
+
target: D
|
|
658
|
+
}), m({
|
|
679
659
|
source: c,
|
|
680
660
|
clock: s,
|
|
681
|
-
filter: (i) => i ?
|
|
682
|
-
target:
|
|
683
|
-
}),
|
|
684
|
-
source:
|
|
661
|
+
filter: (i) => i ? Z(i) : !0,
|
|
662
|
+
target: ot
|
|
663
|
+
}), m({
|
|
664
|
+
source: D,
|
|
685
665
|
filter: Boolean,
|
|
686
666
|
target: s
|
|
687
|
-
}),
|
|
688
|
-
source:
|
|
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
|
-
}),
|
|
695
|
-
source:
|
|
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
|
-
}),
|
|
681
|
+
}), m({
|
|
702
682
|
clock: d,
|
|
703
|
-
target: [
|
|
704
|
-
}), d(),
|
|
683
|
+
target: [h]
|
|
684
|
+
}), d(), M;
|
|
705
685
|
}
|
|
706
686
|
);
|
|
707
|
-
function
|
|
708
|
-
return
|
|
687
|
+
function zt(t) {
|
|
688
|
+
return gt(qt, t);
|
|
709
689
|
}
|
|
710
|
-
const
|
|
711
|
-
const e =
|
|
712
|
-
register(c,
|
|
713
|
-
const
|
|
714
|
-
...c[
|
|
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
|
|
696
|
+
return x.push(S), {
|
|
717
697
|
...c,
|
|
718
|
-
[
|
|
698
|
+
[S.experienceId]: x
|
|
719
699
|
};
|
|
720
700
|
},
|
|
721
|
-
unregister(c,
|
|
722
|
-
const
|
|
723
|
-
(
|
|
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
|
-
[
|
|
707
|
+
[x]: L ?? []
|
|
728
708
|
};
|
|
729
709
|
}
|
|
730
|
-
}), o =
|
|
710
|
+
}), o = $(
|
|
731
711
|
({
|
|
732
712
|
experience: c,
|
|
733
|
-
target:
|
|
734
|
-
options:
|
|
735
|
-
}) =>
|
|
736
|
-
),
|
|
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 =
|
|
718
|
+
}), d = $(
|
|
739
719
|
(c) => {
|
|
740
|
-
c.target &&
|
|
720
|
+
c.target && Rt(c.target, () => {
|
|
741
721
|
s(c);
|
|
742
722
|
});
|
|
743
723
|
}
|
|
744
|
-
),
|
|
724
|
+
), h = $((c) => {
|
|
745
725
|
a.unregister(c);
|
|
746
|
-
}),
|
|
747
|
-
const
|
|
748
|
-
if (!
|
|
749
|
-
|
|
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
|
|
753
|
-
if (!
|
|
754
|
-
|
|
732
|
+
const x = S.frameworkStore.getState();
|
|
733
|
+
if (!x) {
|
|
734
|
+
E(
|
|
755
735
|
"error",
|
|
756
|
-
`No framework registered for component '${
|
|
736
|
+
`No framework registered for component '${S.name}'. Skipping rendering.`
|
|
757
737
|
);
|
|
758
738
|
return;
|
|
759
739
|
}
|
|
760
|
-
const
|
|
761
|
-
if (!
|
|
762
|
-
|
|
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
|
|
748
|
+
const H = Dt(L);
|
|
769
749
|
try {
|
|
770
|
-
|
|
750
|
+
x.render(H, S.component, t, c);
|
|
771
751
|
} catch (q) {
|
|
772
|
-
|
|
752
|
+
E("error", q);
|
|
773
753
|
}
|
|
774
754
|
});
|
|
775
|
-
|
|
755
|
+
m({
|
|
776
756
|
clock: r,
|
|
777
757
|
target: o
|
|
778
|
-
}),
|
|
758
|
+
}), m({
|
|
779
759
|
clock: s,
|
|
780
|
-
target:
|
|
781
|
-
}),
|
|
760
|
+
target: h
|
|
761
|
+
}), m({
|
|
782
762
|
clock: o.doneData,
|
|
783
763
|
target: [
|
|
784
|
-
|
|
764
|
+
u,
|
|
785
765
|
d,
|
|
786
766
|
n
|
|
787
767
|
]
|
|
788
|
-
}),
|
|
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
|
-
}),
|
|
774
|
+
}), m({
|
|
795
775
|
clock: n,
|
|
796
|
-
target:
|
|
776
|
+
target: b
|
|
797
777
|
});
|
|
798
|
-
function F(c,
|
|
799
|
-
r({ experience: c, target:
|
|
778
|
+
function F(c, S, x) {
|
|
779
|
+
r({ experience: c, target: S, options: x });
|
|
800
780
|
}
|
|
801
|
-
const
|
|
802
|
-
function
|
|
803
|
-
return e.map((
|
|
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:
|
|
808
|
-
listStore:
|
|
787
|
+
getByExperienceId: K,
|
|
788
|
+
listStore: T
|
|
809
789
|
};
|
|
810
790
|
});
|
|
811
|
-
function
|
|
812
|
-
return
|
|
791
|
+
function se(t) {
|
|
792
|
+
return gt(Xt, t);
|
|
813
793
|
}
|
|
814
794
|
export {
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
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
|
};
|