@picked/client 0.0.1-dev.1773729274420 → 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.
- package/dist/{api-47L967ES.cjs → api-C90ugp6M.cjs} +1 -1
- package/dist/{api-DuHeVrL4.js → api-CQ1Lb-dB.js} +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 -742
- package/dist/esm/plugins/create-experience/index.js +359 -286
- package/dist/esm/plugins/dynamic-experiences/index.js +146 -80
- 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 +1 -1
- package/dist/{experience-instance-DTyL1fNb.js → experience-instance-8P1fJuPC.js} +306 -312
- package/dist/experience-instance-Bi3-1tP5.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 +46 -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 +2 -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
package/dist/esm/index.js
CHANGED
|
@@ -1,144 +1,154 @@
|
|
|
1
|
-
import { createDomain as
|
|
2
|
-
import { createFactory as
|
|
3
|
-
import { g as
|
|
4
|
-
import { f as
|
|
5
|
-
import { l as
|
|
6
|
-
import { c as
|
|
7
|
-
import { a as
|
|
8
|
-
import { p as
|
|
9
|
-
import { g as
|
|
10
|
-
import { i as
|
|
11
|
-
import { s as H, a as G, b as pe, c as
|
|
12
|
-
import { e as
|
|
13
|
-
const
|
|
1
|
+
import { createDomain as j, createApi as w, attach as V, combine as A, createStore as L, createEffect as C, sample as v, createEvent as D } from "effector";
|
|
2
|
+
import { createFactory as k, invoke as b } from "@withease/factories";
|
|
3
|
+
import { g as Z, t as ne, c as se, i as ie, e as _, a as oe, b as ae, d as ce } from "../experience-instance-8P1fJuPC.js";
|
|
4
|
+
import { f as Ht } from "../experience-instance-8P1fJuPC.js";
|
|
5
|
+
import { l as F } from "../logger-C9a75KZn.js";
|
|
6
|
+
import { c as z, l as R, s as M } from "../storage-Co_LbKr_.js";
|
|
7
|
+
import { a as Jt } from "../storage-Co_LbKr_.js";
|
|
8
|
+
import { p as ue, g as de } from "../api-CQ1Lb-dB.js";
|
|
9
|
+
import { g as le } from "../id-BW-g3y32.js";
|
|
10
|
+
import { i as fe } from "../object-JwZ58NOH.js";
|
|
11
|
+
import { s as H, a as G, b as pe, c as ge, d as me } from "../supports-8YT4QKI7.js";
|
|
12
|
+
import { e as Kt, f as Wt, g as Yt, h as Qt, i as Xt, j as Zt, k as er } from "../supports-8YT4QKI7.js";
|
|
13
|
+
const U = j("experience"), ye = k(
|
|
14
14
|
({ client: t, experience: e }) => {
|
|
15
|
-
const r =
|
|
16
|
-
merge(
|
|
15
|
+
const r = U.store(e), n = w(r, {
|
|
16
|
+
merge(p, f) {
|
|
17
17
|
return {
|
|
18
|
-
...
|
|
19
|
-
...
|
|
18
|
+
...p,
|
|
19
|
+
...f.experience
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
}),
|
|
23
|
-
name:
|
|
24
|
-
decisionLogic:
|
|
25
|
-
targetSelectors:
|
|
22
|
+
}), i = r.map((p) => ({
|
|
23
|
+
name: p.name,
|
|
24
|
+
decisionLogic: p.condition,
|
|
25
|
+
targetSelectors: p.targets,
|
|
26
26
|
initializeOpenLogic: e.initializeOpen
|
|
27
|
-
})),
|
|
28
|
-
|
|
27
|
+
})), u = e.component ? {
|
|
28
|
+
name: `experience:${e.id}`,
|
|
29
|
+
component: e.component,
|
|
30
|
+
frameworkStore: t.frameworks.getByName(e.component.frameworkName)
|
|
31
|
+
} : void 0, s = t.components.listStore.map(
|
|
32
|
+
(p) => u || (e.componentName ? p.find((f) => f.name === e.componentName) : void 0) || p.find((f) => f.name === `experience:${e.id}`) || p.find((f) => f.name === "experience"),
|
|
29
33
|
{ skipVoid: !1 }
|
|
30
|
-
),
|
|
31
|
-
steps:
|
|
32
|
-
nodes:
|
|
33
|
-
edges:
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
), o = r.map((p) => ({
|
|
35
|
+
steps: p.steps,
|
|
36
|
+
nodes: p.nodes,
|
|
37
|
+
edges: p.edges,
|
|
38
|
+
// eslint-disable-next-line sonarjs/deprecation -- backwards-compat fallback for conditionals
|
|
39
|
+
conditions: p.conditions ?? p.conditionals ?? []
|
|
40
|
+
})), l = e.actions ?? [];
|
|
36
41
|
return {
|
|
37
42
|
id: e.id,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
key: e.key,
|
|
44
|
+
name: e.name,
|
|
45
|
+
configStore: i,
|
|
46
|
+
treeStore: o,
|
|
47
|
+
componentStore: s,
|
|
48
|
+
actions: l,
|
|
43
49
|
merge: n.merge
|
|
44
50
|
};
|
|
45
51
|
}
|
|
46
52
|
);
|
|
47
53
|
function he(t) {
|
|
48
|
-
return
|
|
54
|
+
return b(ye, t);
|
|
49
55
|
}
|
|
50
|
-
const
|
|
51
|
-
const e =
|
|
52
|
-
register(f,
|
|
56
|
+
const Se = k(({ client: t }) => {
|
|
57
|
+
const e = U.store({}), r = U.store({}), n = w(e, {
|
|
58
|
+
register(f, h) {
|
|
53
59
|
return {
|
|
54
60
|
...f,
|
|
55
|
-
[
|
|
61
|
+
[h.id]: h
|
|
56
62
|
};
|
|
57
63
|
}
|
|
64
|
+
}), i = w(r, {
|
|
65
|
+
register(f, { key: h, id: S }) {
|
|
66
|
+
return { ...f, [h]: S };
|
|
67
|
+
}
|
|
58
68
|
});
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
if (
|
|
62
|
-
|
|
69
|
+
function u(f) {
|
|
70
|
+
const h = e.getState()[f.id];
|
|
71
|
+
if (h) {
|
|
72
|
+
h.merge({ experience: f, strategy: "override" }), f.key && i.register({ key: f.key, id: f.id });
|
|
63
73
|
return;
|
|
64
74
|
}
|
|
65
|
-
const
|
|
66
|
-
|
|
75
|
+
const S = he({ client: t, experience: f });
|
|
76
|
+
n.register(S), f.key && i.register({ key: f.key, id: f.id });
|
|
67
77
|
}
|
|
68
|
-
const
|
|
69
|
-
function
|
|
70
|
-
return e
|
|
78
|
+
const s = e.map((f) => Object.values(f));
|
|
79
|
+
function o(f) {
|
|
80
|
+
return A(e, r, (h, S) => h[f] ?? h[S[f] ?? ""], { skipVoid: !1 });
|
|
71
81
|
}
|
|
72
|
-
const
|
|
73
|
-
source: e,
|
|
74
|
-
effect: async (f, { id:
|
|
75
|
-
const
|
|
76
|
-
if (!
|
|
77
|
-
|
|
82
|
+
const l = V({
|
|
83
|
+
source: { experiences: e, keys: r },
|
|
84
|
+
effect: async ({ experiences: f, keys: h }, { id: S, options: g }) => {
|
|
85
|
+
const a = f[S] ?? f[h[S] ?? ""];
|
|
86
|
+
if (!a) {
|
|
87
|
+
F("warn", `Experience with id '${S}' not found.`);
|
|
78
88
|
return;
|
|
79
89
|
}
|
|
80
|
-
if (
|
|
81
|
-
|
|
90
|
+
if (g?.bypassCondition) {
|
|
91
|
+
N(t, a, g);
|
|
82
92
|
return;
|
|
83
93
|
}
|
|
84
|
-
await
|
|
94
|
+
await ee(t, a) && N(t, a, g);
|
|
85
95
|
}
|
|
86
|
-
}),
|
|
87
|
-
source: t.experienceInstances.listStore,
|
|
88
|
-
effect: (f, { id:
|
|
89
|
-
const
|
|
90
|
-
if (
|
|
91
|
-
for (const
|
|
92
|
-
|
|
96
|
+
}), p = V({
|
|
97
|
+
source: { instances: t.experienceInstances.listStore, keys: r },
|
|
98
|
+
effect: ({ instances: f, keys: h }, { id: S, options: g }) => {
|
|
99
|
+
const a = h[S] ?? S, c = f.filter((d) => d.experienceId === a);
|
|
100
|
+
if (c.length > 0)
|
|
101
|
+
for (const d of c)
|
|
102
|
+
d.open();
|
|
93
103
|
else
|
|
94
|
-
|
|
104
|
+
l({ id: a, options: { ...g, initialiseOpen: !0 } });
|
|
95
105
|
}
|
|
96
106
|
});
|
|
97
107
|
return {
|
|
98
108
|
/** Registers an experience in the index. If an experience with the same ID already exists, it is merged. */
|
|
99
|
-
register:
|
|
100
|
-
/** Returns a derived store for an experience by its ID. The store value is `undefined` when no match exists. */
|
|
101
|
-
get:
|
|
109
|
+
register: u,
|
|
110
|
+
/** Returns a derived store for an experience by its ID or key. The store value is `undefined` when no match exists. */
|
|
111
|
+
get: o,
|
|
102
112
|
/** @deprecated Use `experiences.get(id)` instead. */
|
|
103
|
-
getById:
|
|
104
|
-
/** Effector effect that launches an experience by ID, creating instances for each DOM target. */
|
|
105
|
-
launch:
|
|
113
|
+
getById: o,
|
|
114
|
+
/** Effector effect that launches an experience by ID or key, creating instances for each DOM target. */
|
|
115
|
+
launch: l,
|
|
106
116
|
/** Effector effect that opens an experience's existing instances, or launches it with `initialiseOpen` if none exist. */
|
|
107
|
-
open:
|
|
117
|
+
open: p,
|
|
108
118
|
/** Derived store containing all registered experiences as an array. */
|
|
109
|
-
listStore:
|
|
119
|
+
listStore: s
|
|
110
120
|
};
|
|
111
121
|
});
|
|
112
|
-
function
|
|
113
|
-
return
|
|
122
|
+
function ke(t) {
|
|
123
|
+
return b(Se, t);
|
|
114
124
|
}
|
|
115
|
-
const
|
|
125
|
+
const be = (t, e) => {
|
|
116
126
|
e.register(t);
|
|
117
|
-
},
|
|
118
|
-
const { targetSelectors: n } = e.configStore.getState(),
|
|
119
|
-
|
|
120
|
-
({ elements:
|
|
121
|
-
), se(
|
|
122
|
-
r ? t.experienceInstances.spawn(e,
|
|
127
|
+
}, N = (t, e, r) => {
|
|
128
|
+
const { targetSelectors: n } = e.configStore.getState(), i = Z(n, e.id);
|
|
129
|
+
i.forEach(
|
|
130
|
+
({ elements: s }) => s.forEach((o) => ne(o, e.id))
|
|
131
|
+
), se(i, e.id).forEach((s) => {
|
|
132
|
+
r ? t.experienceInstances.spawn(e, s, r) : t.experienceInstances.spawn(e, s);
|
|
123
133
|
});
|
|
124
|
-
},
|
|
134
|
+
}, K = async (t) => {
|
|
125
135
|
await Promise.all(
|
|
126
136
|
t.experiences.listStore.getState().map(async (e) => {
|
|
127
|
-
await
|
|
137
|
+
await ee(t, e) && N(t, e);
|
|
128
138
|
})
|
|
129
139
|
);
|
|
130
|
-
},
|
|
140
|
+
}, ee = async (t, e) => {
|
|
131
141
|
if (!t.preconditionPassed || !t.session?.isUser)
|
|
132
142
|
return !1;
|
|
133
143
|
const { decisionLogic: r, targetSelectors: n } = e.configStore.getState();
|
|
134
|
-
return
|
|
135
|
-
},
|
|
136
|
-
const n = e.name,
|
|
137
|
-
if (
|
|
138
|
-
const
|
|
139
|
-
r[n] = Object.freeze({ ...
|
|
144
|
+
return Z(n, e.id).length < 1 || n.length === 0 ? !1 : r === void 0 ? !0 : ie(r) ? await _(t, r) === !0 : !0;
|
|
145
|
+
}, we = (t, e, r) => {
|
|
146
|
+
const n = e.name, i = e.setup(t);
|
|
147
|
+
if (i) {
|
|
148
|
+
const u = r[n] ?? {};
|
|
149
|
+
r[n] = Object.freeze({ ...u, ...i });
|
|
140
150
|
}
|
|
141
|
-
},
|
|
151
|
+
}, Ie = j("component"), ve = k(
|
|
142
152
|
({ client: t, component: e, name: r }) => {
|
|
143
153
|
const n = t.frameworks.getByName(e.frameworkName);
|
|
144
154
|
return {
|
|
@@ -148,89 +158,89 @@ const Se = (t, e) => {
|
|
|
148
158
|
};
|
|
149
159
|
}
|
|
150
160
|
);
|
|
151
|
-
function
|
|
152
|
-
return
|
|
161
|
+
function Fe(t) {
|
|
162
|
+
return b(ve, t);
|
|
153
163
|
}
|
|
154
|
-
const
|
|
155
|
-
const e =
|
|
156
|
-
register(
|
|
164
|
+
const je = k(({ client: t }) => {
|
|
165
|
+
const e = Ie.store({}), r = w(e, {
|
|
166
|
+
register(s, o) {
|
|
157
167
|
return {
|
|
158
|
-
...
|
|
159
|
-
[
|
|
168
|
+
...s,
|
|
169
|
+
[o.name]: o
|
|
160
170
|
};
|
|
161
171
|
}
|
|
162
172
|
});
|
|
163
|
-
function n(
|
|
164
|
-
e.getState()[
|
|
173
|
+
function n(s, o) {
|
|
174
|
+
e.getState()[s] && F(
|
|
165
175
|
"warn",
|
|
166
|
-
`Component '${
|
|
176
|
+
`Component '${s}' already registered. Registering again will override the previous registration.`
|
|
167
177
|
);
|
|
168
|
-
const
|
|
169
|
-
r.register(
|
|
178
|
+
const p = Fe({ client: t, name: s, component: o });
|
|
179
|
+
r.register(p);
|
|
170
180
|
}
|
|
171
|
-
const
|
|
172
|
-
function
|
|
173
|
-
return e.map((
|
|
181
|
+
const i = e.map((s) => Object.values(s));
|
|
182
|
+
function u(s) {
|
|
183
|
+
return e.map((o) => o[s], { skipVoid: !1 });
|
|
174
184
|
}
|
|
175
185
|
return {
|
|
176
186
|
register: n,
|
|
177
|
-
getByName:
|
|
178
|
-
listStore:
|
|
187
|
+
getByName: u,
|
|
188
|
+
listStore: i
|
|
179
189
|
};
|
|
180
190
|
});
|
|
181
|
-
function
|
|
182
|
-
return
|
|
191
|
+
function Ee(t) {
|
|
192
|
+
return b(je, t);
|
|
183
193
|
}
|
|
184
|
-
const
|
|
194
|
+
const W = (t, e, r) => {
|
|
185
195
|
r.register(t, e);
|
|
186
|
-
},
|
|
187
|
-
const e =
|
|
188
|
-
register(
|
|
196
|
+
}, xe = j("framework"), Pe = k(({ client: t }) => {
|
|
197
|
+
const e = xe.store({}), r = w(e, {
|
|
198
|
+
register(s, o) {
|
|
189
199
|
return {
|
|
190
|
-
...
|
|
191
|
-
[
|
|
200
|
+
...s,
|
|
201
|
+
[o.name]: o.framework
|
|
192
202
|
};
|
|
193
203
|
}
|
|
194
204
|
});
|
|
195
|
-
function n(
|
|
196
|
-
e.getState()[
|
|
205
|
+
function n(s, o) {
|
|
206
|
+
e.getState()[s] && F(
|
|
197
207
|
"warn",
|
|
198
|
-
`Framework '${
|
|
199
|
-
), r.register({ name:
|
|
208
|
+
`Framework '${s}' already registered. Registering again will override the previous registration.`
|
|
209
|
+
), r.register({ name: s, framework: o });
|
|
200
210
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
203
|
-
return e.map((
|
|
211
|
+
const i = e.map((s) => Object.values(s));
|
|
212
|
+
function u(s) {
|
|
213
|
+
return e.map((o) => o[s], { skipVoid: !1 });
|
|
204
214
|
}
|
|
205
215
|
return {
|
|
206
216
|
register: n,
|
|
207
|
-
getByName:
|
|
208
|
-
listStore:
|
|
217
|
+
getByName: u,
|
|
218
|
+
listStore: i
|
|
209
219
|
};
|
|
210
220
|
});
|
|
211
221
|
function Ae(t) {
|
|
212
|
-
return
|
|
222
|
+
return b(Pe, t);
|
|
213
223
|
}
|
|
214
|
-
const
|
|
224
|
+
const Be = (t, e) => {
|
|
215
225
|
e.register(t.name, t);
|
|
216
|
-
}, $e = 6e3,
|
|
226
|
+
}, $e = 6e3, ze = z("last_ping", "global"), Ce = async (t) => {
|
|
217
227
|
try {
|
|
218
|
-
const e = Date.now(), r =
|
|
228
|
+
const e = Date.now(), r = R.get(ze);
|
|
219
229
|
let n = 0;
|
|
220
230
|
if (r.isSet() && (n = r.json() ?? 0), n && e - n < $e)
|
|
221
231
|
return !0;
|
|
222
|
-
const
|
|
232
|
+
const i = {
|
|
223
233
|
projectId: t.projectId,
|
|
224
234
|
path: window.location.pathname
|
|
225
|
-
},
|
|
226
|
-
|
|
227
|
-
const
|
|
228
|
-
return
|
|
235
|
+
}, u = {}, o = document.getElementById("picked_script")?.dataset.verceltoken;
|
|
236
|
+
o && (u["x-vercel-protection-bypass"] = o);
|
|
237
|
+
const p = (await ue(t.apiUrl, "ping", i, u)).ok;
|
|
238
|
+
return p && r.set(e), p;
|
|
229
239
|
} catch (e) {
|
|
230
|
-
return
|
|
240
|
+
return F("error", e), !1;
|
|
231
241
|
}
|
|
232
242
|
};
|
|
233
|
-
function
|
|
243
|
+
function te(t) {
|
|
234
244
|
const e = typeof window < "u", r = {
|
|
235
245
|
client: t,
|
|
236
246
|
responses: t.responses.listStore.getState(),
|
|
@@ -242,685 +252,663 @@ function ee(t) {
|
|
|
242
252
|
};
|
|
243
253
|
return Object.freeze(r);
|
|
244
254
|
}
|
|
245
|
-
const
|
|
246
|
-
const e =
|
|
247
|
-
register(
|
|
255
|
+
const Oe = j("predicate"), Re = k(({ client: t }) => {
|
|
256
|
+
const e = Oe.store({}), r = w(e, {
|
|
257
|
+
register(o, l) {
|
|
248
258
|
return {
|
|
249
|
-
...
|
|
250
|
-
[
|
|
251
|
-
name:
|
|
252
|
-
predicate:
|
|
259
|
+
...o,
|
|
260
|
+
[l.name]: {
|
|
261
|
+
name: l.name,
|
|
262
|
+
predicate: l.predicate
|
|
253
263
|
}
|
|
254
264
|
};
|
|
255
265
|
}
|
|
256
266
|
});
|
|
257
|
-
function n(
|
|
258
|
-
e.getState()[
|
|
267
|
+
function n(o, l) {
|
|
268
|
+
e.getState()[o] && F(
|
|
259
269
|
"warn",
|
|
260
|
-
`Predicate '${
|
|
261
|
-
), r.register(Object.freeze({ name:
|
|
270
|
+
`Predicate '${o}' already registered. Registering again will override the previous registration.`
|
|
271
|
+
), r.register(Object.freeze({ name: o, predicate: l }));
|
|
262
272
|
}
|
|
263
|
-
const
|
|
264
|
-
function
|
|
265
|
-
return e.map((
|
|
273
|
+
const i = e.map((o) => Object.values(o));
|
|
274
|
+
function u(o) {
|
|
275
|
+
return e.map((l) => l[o]?.predicate, { skipVoid: !1 });
|
|
266
276
|
}
|
|
267
|
-
function
|
|
268
|
-
const
|
|
277
|
+
function s(o) {
|
|
278
|
+
const l = L(() => {
|
|
269
279
|
}, {
|
|
270
280
|
skipVoid: !1
|
|
271
|
-
}),
|
|
272
|
-
const
|
|
273
|
-
if (!
|
|
281
|
+
}), p = C(async () => {
|
|
282
|
+
const f = u(o).getState();
|
|
283
|
+
if (!f)
|
|
274
284
|
return;
|
|
275
|
-
const
|
|
276
|
-
return (...
|
|
285
|
+
const h = te(t);
|
|
286
|
+
return (...S) => f({ ...h, args: S });
|
|
277
287
|
});
|
|
278
|
-
return
|
|
288
|
+
return v({
|
|
279
289
|
source: { responses: t.responses.listStore, fields: t.fields.listStore },
|
|
280
|
-
target:
|
|
281
|
-
}),
|
|
282
|
-
clock:
|
|
283
|
-
filter: (
|
|
284
|
-
target:
|
|
285
|
-
}),
|
|
290
|
+
target: p
|
|
291
|
+
}), v({
|
|
292
|
+
clock: p.doneData,
|
|
293
|
+
filter: (f) => f !== void 0,
|
|
294
|
+
target: l
|
|
295
|
+
}), p(), l;
|
|
286
296
|
}
|
|
287
297
|
return {
|
|
288
298
|
register: n,
|
|
289
|
-
getByName:
|
|
290
|
-
listStore:
|
|
291
|
-
getEvokablePredicate:
|
|
299
|
+
getByName: u,
|
|
300
|
+
listStore: i,
|
|
301
|
+
getEvokablePredicate: s
|
|
292
302
|
};
|
|
293
303
|
});
|
|
294
304
|
function Me(t) {
|
|
295
|
-
return
|
|
305
|
+
return b(Re, t);
|
|
296
306
|
}
|
|
297
|
-
const
|
|
307
|
+
const Ve = (t, e, r) => {
|
|
298
308
|
r.register(t, e);
|
|
299
|
-
},
|
|
300
|
-
const e =
|
|
301
|
-
register(
|
|
309
|
+
}, Y = j("feature"), De = k(({ client: t }) => {
|
|
310
|
+
const e = Y.store({}), r = Y.store([]), n = w(e, {
|
|
311
|
+
register(g, a) {
|
|
302
312
|
return {
|
|
303
|
-
...
|
|
304
|
-
[
|
|
313
|
+
...g,
|
|
314
|
+
[a.id]: a.feature
|
|
305
315
|
};
|
|
306
316
|
}
|
|
307
317
|
});
|
|
308
|
-
function
|
|
309
|
-
e.getState()[
|
|
318
|
+
function i(g, a) {
|
|
319
|
+
e.getState()[g] && F(
|
|
310
320
|
"warn",
|
|
311
|
-
`Feature '${
|
|
321
|
+
`Feature '${g}' already registered. Registering again will override the previous registration.`
|
|
312
322
|
);
|
|
313
|
-
const
|
|
314
|
-
id:
|
|
323
|
+
const d = {
|
|
324
|
+
id: g,
|
|
315
325
|
feature: {
|
|
316
|
-
...
|
|
317
|
-
id:
|
|
326
|
+
...a,
|
|
327
|
+
id: g
|
|
318
328
|
}
|
|
319
329
|
};
|
|
320
330
|
n.register(
|
|
321
331
|
Object.freeze({
|
|
322
|
-
id:
|
|
323
|
-
feature:
|
|
332
|
+
id: g,
|
|
333
|
+
feature: d
|
|
324
334
|
})
|
|
325
335
|
);
|
|
326
336
|
}
|
|
327
|
-
const
|
|
337
|
+
const u = C(
|
|
328
338
|
async ({
|
|
329
|
-
id:
|
|
330
|
-
key:
|
|
331
|
-
storage:
|
|
339
|
+
id: g,
|
|
340
|
+
key: a,
|
|
341
|
+
storage: c = "local"
|
|
332
342
|
}) => {
|
|
333
|
-
const
|
|
334
|
-
return
|
|
343
|
+
const d = z(`feature:${g}:${a}`, "global"), y = (c === "session" ? M : R).get(d).boolean();
|
|
344
|
+
return y === null ? null : { id: g, key: a, bucket: y, storage: c };
|
|
335
345
|
}
|
|
336
|
-
),
|
|
337
|
-
if (!
|
|
346
|
+
), s = C((g) => {
|
|
347
|
+
if (!g)
|
|
338
348
|
return null;
|
|
339
|
-
const
|
|
340
|
-
(
|
|
341
|
-
}),
|
|
349
|
+
const a = z(`feature:${g.id}:${g.key}`, "global");
|
|
350
|
+
(g.storage === "session" ? M : R).set(a, g.bucket);
|
|
351
|
+
}), o = /* @__PURE__ */ new Map(), l = V({
|
|
342
352
|
source: { allFeaturesStore: e, resolvedFeaturesStore: r },
|
|
343
|
-
effect: async ({ allFeaturesStore:
|
|
344
|
-
const
|
|
345
|
-
(
|
|
353
|
+
effect: async ({ allFeaturesStore: g, resolvedFeaturesStore: a }, { id: c, decide: d, key: m }) => {
|
|
354
|
+
const y = a.find(
|
|
355
|
+
(P) => P.id === c && P.key === m
|
|
346
356
|
);
|
|
347
|
-
if (
|
|
348
|
-
return
|
|
349
|
-
const
|
|
350
|
-
if (!
|
|
351
|
-
throw new Error(`Feature with id '${
|
|
352
|
-
const
|
|
353
|
-
if (
|
|
354
|
-
const
|
|
355
|
-
return { id:
|
|
357
|
+
if (y)
|
|
358
|
+
return y;
|
|
359
|
+
const I = g[c];
|
|
360
|
+
if (!I)
|
|
361
|
+
throw new Error(`Feature with id '${c}' not found`);
|
|
362
|
+
const E = o.get(`${c}:${m}`);
|
|
363
|
+
if (E !== void 0) {
|
|
364
|
+
const P = await E;
|
|
365
|
+
return { id: I.id, bucket: P, key: m, storage: I.feature.storage };
|
|
356
366
|
}
|
|
357
|
-
const
|
|
358
|
-
|
|
359
|
-
const
|
|
360
|
-
return { id:
|
|
367
|
+
const x = d();
|
|
368
|
+
o.set(`${c}:${m}`, x);
|
|
369
|
+
const B = await x;
|
|
370
|
+
return { id: I.id, bucket: B, key: m, storage: I.feature.storage };
|
|
361
371
|
}
|
|
362
372
|
});
|
|
363
|
-
|
|
373
|
+
v({
|
|
364
374
|
clock: n.register,
|
|
365
|
-
fn: (
|
|
366
|
-
const { id:
|
|
367
|
-
return { id:
|
|
375
|
+
fn: (g) => {
|
|
376
|
+
const { id: a, feature: c } = g;
|
|
377
|
+
return { id: a, key: c.feature.key, storage: c.feature.storage };
|
|
368
378
|
},
|
|
369
|
-
target:
|
|
370
|
-
}),
|
|
379
|
+
target: u
|
|
380
|
+
}), v({
|
|
371
381
|
source: e,
|
|
372
|
-
clock:
|
|
373
|
-
fn: (
|
|
374
|
-
const { id:
|
|
375
|
-
return
|
|
382
|
+
clock: l.doneData,
|
|
383
|
+
fn: (g, a) => {
|
|
384
|
+
const { id: c, bucket: d, storage: m } = a, y = g[c]?.feature.key;
|
|
385
|
+
return y ? { key: y, id: c, bucket: d, storage: m } : null;
|
|
376
386
|
},
|
|
377
|
-
target:
|
|
387
|
+
target: s
|
|
378
388
|
});
|
|
379
|
-
const
|
|
389
|
+
const p = A({ allFeaturesStore: e, resolvedFeaturesStore: r }).map(
|
|
380
390
|
({
|
|
381
|
-
allFeaturesStore:
|
|
382
|
-
resolvedFeaturesStore:
|
|
383
|
-
}) => Object.values(
|
|
384
|
-
const
|
|
385
|
-
(
|
|
391
|
+
allFeaturesStore: g,
|
|
392
|
+
resolvedFeaturesStore: a
|
|
393
|
+
}) => Object.values(g).map((c) => {
|
|
394
|
+
const d = a.find(
|
|
395
|
+
(m) => m.id === c.id && m.key === c.feature.key
|
|
386
396
|
);
|
|
387
|
-
return
|
|
388
|
-
id:
|
|
389
|
-
name:
|
|
390
|
-
key:
|
|
391
|
-
getBucket: () => ({ id:
|
|
397
|
+
return d ? {
|
|
398
|
+
id: c.id,
|
|
399
|
+
name: c.feature.name,
|
|
400
|
+
key: c.feature.key,
|
|
401
|
+
getBucket: () => ({ id: c.id, bucket: d.bucket }),
|
|
392
402
|
isResolved: !0
|
|
393
403
|
} : {
|
|
394
|
-
id:
|
|
395
|
-
name:
|
|
396
|
-
key:
|
|
397
|
-
getBucket: async () => await
|
|
404
|
+
id: c.id,
|
|
405
|
+
name: c.feature.name,
|
|
406
|
+
key: c.feature.key,
|
|
407
|
+
getBucket: async () => await l(c.feature),
|
|
398
408
|
isResolved: !1
|
|
399
409
|
};
|
|
400
410
|
})
|
|
401
411
|
);
|
|
402
|
-
|
|
403
|
-
clock:
|
|
412
|
+
v({
|
|
413
|
+
clock: l.doneData,
|
|
404
414
|
source: { resolvedFeatures: r },
|
|
405
|
-
filter: ({ resolvedFeatures:
|
|
406
|
-
(
|
|
415
|
+
filter: ({ resolvedFeatures: g }, { id: a, key: c }) => !g.some(
|
|
416
|
+
(m) => m.id === a && m.key === c
|
|
407
417
|
),
|
|
408
|
-
fn: (
|
|
409
|
-
target: t.eventBus.prepend((
|
|
418
|
+
fn: (g, a) => a,
|
|
419
|
+
target: t.eventBus.prepend((g) => ({
|
|
410
420
|
type: "feature_decide",
|
|
411
|
-
feature:
|
|
421
|
+
feature: g
|
|
412
422
|
}))
|
|
413
|
-
}),
|
|
414
|
-
clock: [
|
|
423
|
+
}), v({
|
|
424
|
+
clock: [u.doneData, l.doneData],
|
|
415
425
|
source: r,
|
|
416
|
-
fn: (
|
|
417
|
-
(
|
|
418
|
-
) ?
|
|
426
|
+
fn: (g, a) => !a || g.some(
|
|
427
|
+
(d) => d.id === a.id && d.key === a.key
|
|
428
|
+
) ? g : [...g, a],
|
|
419
429
|
target: r
|
|
420
430
|
});
|
|
421
|
-
function
|
|
422
|
-
return
|
|
431
|
+
function f(g) {
|
|
432
|
+
return p.map((a) => a.find((c) => c.id === g));
|
|
423
433
|
}
|
|
424
|
-
function
|
|
425
|
-
return e.map((
|
|
434
|
+
function h(g) {
|
|
435
|
+
return e.map((a) => a[g], { skipVoid: !1 });
|
|
426
436
|
}
|
|
427
|
-
function
|
|
428
|
-
const
|
|
437
|
+
function S(g) {
|
|
438
|
+
const a = L(
|
|
429
439
|
async () => {
|
|
430
440
|
},
|
|
431
441
|
{ skipVoid: !1 }
|
|
432
|
-
),
|
|
433
|
-
const
|
|
434
|
-
if (
|
|
435
|
-
return async () => (await
|
|
442
|
+
), c = C(async () => {
|
|
443
|
+
const d = f(g).getState();
|
|
444
|
+
if (d)
|
|
445
|
+
return async () => (await d.getBucket()).bucket;
|
|
436
446
|
});
|
|
437
|
-
return
|
|
447
|
+
return v({
|
|
438
448
|
source: r,
|
|
439
|
-
filter: (
|
|
440
|
-
target:
|
|
441
|
-
}),
|
|
442
|
-
clock:
|
|
443
|
-
filter: (
|
|
444
|
-
target:
|
|
445
|
-
}),
|
|
449
|
+
filter: (d) => d.some((m) => m.id === g),
|
|
450
|
+
target: c
|
|
451
|
+
}), v({
|
|
452
|
+
clock: c.doneData,
|
|
453
|
+
filter: (d) => d !== void 0,
|
|
454
|
+
target: a
|
|
455
|
+
}), c(), a;
|
|
446
456
|
}
|
|
447
457
|
return {
|
|
448
|
-
register:
|
|
449
|
-
getById:
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
getEvokableFeature: m
|
|
458
|
+
register: i,
|
|
459
|
+
getById: f,
|
|
460
|
+
getByName: h,
|
|
461
|
+
listStore: p,
|
|
462
|
+
getEvokableFeature: S
|
|
454
463
|
};
|
|
455
464
|
});
|
|
456
465
|
function Ue(t) {
|
|
457
|
-
return
|
|
466
|
+
return b(De, t);
|
|
458
467
|
}
|
|
459
|
-
const
|
|
468
|
+
const Ne = (t, e, r) => {
|
|
460
469
|
r.register(t, e);
|
|
461
|
-
},
|
|
462
|
-
function
|
|
470
|
+
}, $ = j("history");
|
|
471
|
+
function Q(t, e) {
|
|
463
472
|
return {
|
|
464
473
|
// eslint-disable-next-line sonarjs/pseudo-random
|
|
465
|
-
id:
|
|
474
|
+
id: le(`history-entry-${Date.now()}-${Math.random()}}`),
|
|
466
475
|
node: e,
|
|
467
476
|
at: Date.now(),
|
|
468
477
|
experienceId: t
|
|
469
478
|
};
|
|
470
479
|
}
|
|
471
|
-
const
|
|
472
|
-
const t =
|
|
473
|
-
t.on(e, (
|
|
474
|
-
entries: [...
|
|
475
|
-
})), t.on(r, (
|
|
480
|
+
const Te = k(() => {
|
|
481
|
+
const t = $.store({ entries: [] }), e = $.event(), r = $.event(), n = $.event(), i = $.event();
|
|
482
|
+
t.on(e, (s, o) => ({
|
|
483
|
+
entries: [...s.entries, Q(o.experienceId, o.node)]
|
|
484
|
+
})), t.on(r, (s, o) => ({
|
|
476
485
|
entries: [
|
|
477
|
-
...
|
|
478
|
-
|
|
486
|
+
...s.entries.slice(0, -1),
|
|
487
|
+
Q(o.experienceId, o.node)
|
|
479
488
|
]
|
|
480
|
-
})), t.on(
|
|
481
|
-
function
|
|
482
|
-
const
|
|
483
|
-
for (let
|
|
484
|
-
const
|
|
485
|
-
if (!(!
|
|
486
|
-
if (
|
|
487
|
-
|
|
489
|
+
})), t.on(i, (s, o) => o);
|
|
490
|
+
function u(s, o) {
|
|
491
|
+
const l = { lastStepIndex: -1, secondLastStepIndex: -1 };
|
|
492
|
+
for (let p = s.length - 1; p >= 0; p--) {
|
|
493
|
+
const f = s[p], h = f?.node;
|
|
494
|
+
if (!(!h || !oe(h)) && !(o && f?.experienceId !== o))
|
|
495
|
+
if (l.lastStepIndex === -1)
|
|
496
|
+
l.lastStepIndex = p;
|
|
488
497
|
else {
|
|
489
|
-
|
|
498
|
+
l.secondLastStepIndex = p;
|
|
490
499
|
break;
|
|
491
500
|
}
|
|
492
501
|
}
|
|
493
|
-
return
|
|
502
|
+
return l;
|
|
494
503
|
}
|
|
495
|
-
return t.on(n, (
|
|
496
|
-
const { secondLastStepIndex:
|
|
504
|
+
return t.on(n, (s, o) => {
|
|
505
|
+
const { secondLastStepIndex: l } = u(s.entries, o.experienceId), p = l !== -1 ? s.entries.slice(0, l + 1) : s.entries;
|
|
497
506
|
return {
|
|
498
|
-
...
|
|
499
|
-
entries:
|
|
507
|
+
...s,
|
|
508
|
+
entries: p
|
|
500
509
|
};
|
|
501
510
|
}), {
|
|
502
511
|
push: e,
|
|
503
512
|
replace: r,
|
|
504
513
|
back: n,
|
|
505
|
-
restore:
|
|
506
|
-
entriesStore: t.map((
|
|
514
|
+
restore: i,
|
|
515
|
+
entriesStore: t.map((s) => s.entries)
|
|
507
516
|
};
|
|
508
517
|
});
|
|
509
|
-
function
|
|
510
|
-
return
|
|
518
|
+
function Le() {
|
|
519
|
+
return b(Te);
|
|
511
520
|
}
|
|
512
|
-
let
|
|
513
|
-
const
|
|
514
|
-
const e =
|
|
515
|
-
return
|
|
521
|
+
let _e = 0;
|
|
522
|
+
const He = (t) => {
|
|
523
|
+
const e = L([]);
|
|
524
|
+
return v({
|
|
516
525
|
clock: t,
|
|
517
526
|
source: e,
|
|
518
527
|
fn: (r, n) => [
|
|
519
528
|
...r,
|
|
520
529
|
{
|
|
521
|
-
id:
|
|
530
|
+
id: _e++,
|
|
522
531
|
at: /* @__PURE__ */ new Date(),
|
|
523
532
|
payload: n
|
|
524
533
|
}
|
|
525
534
|
],
|
|
526
535
|
target: e
|
|
527
536
|
}), e;
|
|
528
|
-
},
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
(e) => typeof e == "object" && e !== null && "id" in e && "label" in e && "value" in e
|
|
532
|
-
);
|
|
533
|
-
}
|
|
534
|
-
function V(t, e) {
|
|
535
|
-
const r = Array.isArray(t.options) ? t.options : null, n = e ?? { status: "idle", options: r };
|
|
536
|
-
return {
|
|
537
|
-
...t,
|
|
538
|
-
...n,
|
|
539
|
-
options: n.options ?? r
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
const Ge = I(({ client: t }) => {
|
|
543
|
-
const e = U.store({}), r = j(e, {
|
|
544
|
-
register(s, i) {
|
|
537
|
+
}, Ge = j("field"), Je = k(() => {
|
|
538
|
+
const t = Ge.store({}), e = w(t, {
|
|
539
|
+
register(l, p) {
|
|
545
540
|
return {
|
|
546
|
-
...
|
|
547
|
-
[
|
|
541
|
+
...l,
|
|
542
|
+
[p.field.id]: p.field
|
|
548
543
|
};
|
|
549
|
-
},
|
|
550
|
-
updateById(s, i) {
|
|
551
|
-
const o = s[i.fieldId];
|
|
552
|
-
return o ? { ...s, [i.fieldId]: Object.assign({}, o, i.updates) } : s;
|
|
553
544
|
}
|
|
554
545
|
});
|
|
555
|
-
function
|
|
556
|
-
|
|
557
|
-
}
|
|
558
|
-
function a(s, i) {
|
|
559
|
-
r.updateById({ fieldId: s, updates: i });
|
|
546
|
+
function r(l) {
|
|
547
|
+
e.register({ field: l });
|
|
560
548
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
return E(e, l, (i, o) => {
|
|
568
|
-
const g = i[s];
|
|
569
|
-
return g ? V(g, o[s]) : null;
|
|
549
|
+
function n(l, p) {
|
|
550
|
+
const f = t.getState()[l] ?? null;
|
|
551
|
+
if (!f)
|
|
552
|
+
return;
|
|
553
|
+
const h = Object.assign({}, f, {
|
|
554
|
+
...p
|
|
570
555
|
});
|
|
556
|
+
e.register({ field: { ...h } });
|
|
571
557
|
}
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
return g ? V(g, o[g.id]) : null;
|
|
576
|
-
});
|
|
558
|
+
const i = t.map((l) => Object.values(l));
|
|
559
|
+
function u(l) {
|
|
560
|
+
return t.map((p) => p[l] ?? null);
|
|
577
561
|
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
...s,
|
|
603
|
-
[i]: { status: "resolved", options: o }
|
|
604
|
-
})), l.on(d.fail, (s, { params: { fieldId: i } }) => ({
|
|
605
|
-
...s,
|
|
606
|
-
[i]: { status: "error", options: null, error: "Failed to resolve field options" }
|
|
607
|
-
}));
|
|
608
|
-
const h = P();
|
|
609
|
-
l.on(h, (s, i) => ({
|
|
610
|
-
...s,
|
|
611
|
-
[i]: { status: "waiting", options: null }
|
|
612
|
-
}));
|
|
613
|
-
const y = P();
|
|
614
|
-
t && w({
|
|
615
|
-
clock: y,
|
|
616
|
-
source: {
|
|
617
|
-
states: l,
|
|
618
|
-
fields: e
|
|
619
|
-
},
|
|
620
|
-
filter: ({ states: s }, { fieldId: i, force: o }) => {
|
|
621
|
-
if (o) return !0;
|
|
622
|
-
const g = s[i];
|
|
623
|
-
return !g || g.status === "idle";
|
|
624
|
-
},
|
|
625
|
-
fn: ({ fields: s }, { fieldId: i, context: o }) => {
|
|
626
|
-
const g = s[i] ?? null;
|
|
562
|
+
function s(l) {
|
|
563
|
+
return t.map((p) => Object.values(p).find((f) => f.key === l) ?? null);
|
|
564
|
+
}
|
|
565
|
+
function o(l) {
|
|
566
|
+
return t.map((p) => Object.values(p).find((f) => f.name === l) ?? null);
|
|
567
|
+
}
|
|
568
|
+
return {
|
|
569
|
+
register: r,
|
|
570
|
+
update: n,
|
|
571
|
+
// eslint-disable-next-line sonarjs/deprecation -- returned for backwards compatibility; callers should use getByKey
|
|
572
|
+
getById: u,
|
|
573
|
+
getByKey: s,
|
|
574
|
+
listStore: i,
|
|
575
|
+
getByName: o
|
|
576
|
+
};
|
|
577
|
+
});
|
|
578
|
+
function qe() {
|
|
579
|
+
return b(Je);
|
|
580
|
+
}
|
|
581
|
+
const Ke = (t, e) => {
|
|
582
|
+
e.register(t);
|
|
583
|
+
}, We = j("step"), Ye = k(() => {
|
|
584
|
+
const t = We.store({}), e = w(t, {
|
|
585
|
+
register(u, s) {
|
|
627
586
|
return {
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
context: o
|
|
587
|
+
...u,
|
|
588
|
+
[s.step.id]: s.step
|
|
631
589
|
};
|
|
632
|
-
}
|
|
633
|
-
target: d
|
|
590
|
+
}
|
|
634
591
|
});
|
|
635
|
-
function
|
|
636
|
-
|
|
592
|
+
function r(u) {
|
|
593
|
+
e.register({ step: u });
|
|
637
594
|
}
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
595
|
+
const n = t.map((u) => Object.values(u));
|
|
596
|
+
function i(u) {
|
|
597
|
+
return t.map((s) => s[u] ?? null);
|
|
641
598
|
}
|
|
642
599
|
return {
|
|
643
|
-
register:
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
listStore: p,
|
|
647
|
-
getByName: f,
|
|
648
|
-
resolve: m,
|
|
649
|
-
resolveAll: c,
|
|
650
|
-
setWaiting: h
|
|
600
|
+
register: r,
|
|
601
|
+
getById: i,
|
|
602
|
+
listStore: n
|
|
651
603
|
};
|
|
652
604
|
});
|
|
653
|
-
function
|
|
654
|
-
return
|
|
605
|
+
function Qe() {
|
|
606
|
+
return b(Ye);
|
|
655
607
|
}
|
|
656
|
-
|
|
608
|
+
function Xe(t, e) {
|
|
657
609
|
e.register(t);
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
|
|
610
|
+
}
|
|
611
|
+
const Ze = j("action"), et = k(() => {
|
|
612
|
+
const t = Ze.store({}), e = w(t, {
|
|
613
|
+
register(s, o) {
|
|
661
614
|
return {
|
|
662
|
-
...
|
|
663
|
-
[
|
|
664
|
-
name:
|
|
665
|
-
action:
|
|
615
|
+
...s,
|
|
616
|
+
[o.name]: {
|
|
617
|
+
name: o.name,
|
|
618
|
+
action: o.action
|
|
666
619
|
}
|
|
667
620
|
};
|
|
668
621
|
}
|
|
669
622
|
});
|
|
670
|
-
function
|
|
671
|
-
|
|
623
|
+
function r(s, o) {
|
|
624
|
+
e.register({ name: s, action: o });
|
|
672
625
|
}
|
|
673
|
-
const
|
|
674
|
-
function
|
|
675
|
-
return
|
|
626
|
+
const n = t.map((s) => Object.values(s));
|
|
627
|
+
function i(s) {
|
|
628
|
+
return t.map((o) => o[s], { skipVoid: !1 });
|
|
676
629
|
}
|
|
677
|
-
function
|
|
678
|
-
return
|
|
679
|
-
(
|
|
680
|
-
const
|
|
681
|
-
return
|
|
630
|
+
function u(s) {
|
|
631
|
+
return t.map(
|
|
632
|
+
(o) => {
|
|
633
|
+
const l = o[s];
|
|
634
|
+
return l ? l.action : void 0;
|
|
682
635
|
},
|
|
683
636
|
{ skipVoid: !1 }
|
|
684
637
|
);
|
|
685
638
|
}
|
|
686
639
|
return {
|
|
687
|
-
register:
|
|
688
|
-
getByName:
|
|
689
|
-
listStore:
|
|
690
|
-
getEvokableAction:
|
|
640
|
+
register: r,
|
|
641
|
+
getByName: i,
|
|
642
|
+
listStore: n,
|
|
643
|
+
getEvokableAction: u
|
|
691
644
|
};
|
|
692
645
|
});
|
|
693
|
-
function
|
|
694
|
-
return
|
|
646
|
+
function tt() {
|
|
647
|
+
return b(et);
|
|
695
648
|
}
|
|
696
|
-
const
|
|
649
|
+
const rt = (t, e, r) => {
|
|
697
650
|
r.register(t, e);
|
|
698
651
|
};
|
|
699
|
-
function
|
|
652
|
+
function T(t) {
|
|
700
653
|
return typeof t > "u" || t === null || t === "" || Array.isArray(t) && !t.length;
|
|
701
654
|
}
|
|
702
|
-
function
|
|
655
|
+
function nt(t) {
|
|
703
656
|
return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || t === null;
|
|
704
657
|
}
|
|
705
|
-
function
|
|
658
|
+
function X(t) {
|
|
706
659
|
try {
|
|
707
660
|
return JSON.stringify(t), !0;
|
|
708
661
|
} catch {
|
|
709
662
|
return !1;
|
|
710
663
|
}
|
|
711
664
|
}
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
665
|
+
function st(t, e) {
|
|
666
|
+
return e.find((r) => r.id === t) ?? e.find((r) => r.key === t) ?? null;
|
|
667
|
+
}
|
|
668
|
+
function it(t, e) {
|
|
669
|
+
return t.multiple && (typeof e == "string" || typeof e == "number" || typeof e == "boolean") ? [e] : e;
|
|
670
|
+
}
|
|
671
|
+
function ot(t, e, r) {
|
|
672
|
+
if (t.type !== "object" || T(r)) return null;
|
|
673
|
+
if (t.multiple) {
|
|
674
|
+
if (!Array.isArray(r))
|
|
715
675
|
return {
|
|
716
|
-
|
|
676
|
+
fieldId: e,
|
|
677
|
+
userMessage: "This field expects multiple values",
|
|
678
|
+
systemMessage: "Field expects an array of objects.",
|
|
679
|
+
value: r
|
|
680
|
+
};
|
|
681
|
+
for (const n of r) {
|
|
682
|
+
if (typeof n != "object" || n === null)
|
|
683
|
+
return {
|
|
684
|
+
fieldId: e,
|
|
685
|
+
userMessage: "This field expects object values",
|
|
686
|
+
systemMessage: "Field expects an array of objects, but received non-object value.",
|
|
687
|
+
value: r
|
|
688
|
+
};
|
|
689
|
+
if (!X(n))
|
|
690
|
+
return {
|
|
691
|
+
fieldId: e,
|
|
692
|
+
userMessage: "This field contains non-serializable data",
|
|
693
|
+
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
694
|
+
value: r
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
return null;
|
|
698
|
+
}
|
|
699
|
+
return Array.isArray(r) ? {
|
|
700
|
+
fieldId: e,
|
|
701
|
+
userMessage: "This field expects a single value",
|
|
702
|
+
systemMessage: "Field expects a single object, not an array.",
|
|
703
|
+
value: r
|
|
704
|
+
} : typeof r != "object" || r === null ? {
|
|
705
|
+
fieldId: e,
|
|
706
|
+
userMessage: "This field expects an object value",
|
|
707
|
+
systemMessage: "Field expects an object value.",
|
|
708
|
+
value: r
|
|
709
|
+
} : X(r) ? null : {
|
|
710
|
+
fieldId: e,
|
|
711
|
+
userMessage: "This field contains non-serializable data",
|
|
712
|
+
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
713
|
+
value: r
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
function at(t, e, r) {
|
|
717
|
+
if (!Array.isArray(t.options) || t.options.length === 0) return null;
|
|
718
|
+
const n = Array.isArray(r) ? r : [r];
|
|
719
|
+
if (t.type === "object") {
|
|
720
|
+
const s = t.options.map((l) => JSON.stringify(l.value));
|
|
721
|
+
return n.every((l) => s.includes(JSON.stringify(l))) ? null : {
|
|
722
|
+
fieldId: e,
|
|
723
|
+
userMessage: "This field expects a valid option",
|
|
724
|
+
systemMessage: "Field expects a valid option from the defined choices.",
|
|
725
|
+
value: r
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
const i = t.options.map((s) => s.value);
|
|
729
|
+
return n.every((s) => !nt(s) || s === null ? !1 : i.includes(s)) ? null : {
|
|
730
|
+
fieldId: e,
|
|
731
|
+
userMessage: "This field expects a valid option",
|
|
732
|
+
systemMessage: `Field expects a valid option. Valid options are: ${i.join(", ")}`,
|
|
733
|
+
value: r
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
const ct = j("response"), ut = k(({ client: t }) => {
|
|
737
|
+
const e = ct.store({}), r = D(), n = D(), i = w(e, {
|
|
738
|
+
register(a, c) {
|
|
739
|
+
return {
|
|
740
|
+
...a,
|
|
717
741
|
[c.fieldId]: c.response
|
|
718
742
|
};
|
|
719
743
|
},
|
|
720
|
-
registerBatch(
|
|
744
|
+
registerBatch(a, c) {
|
|
721
745
|
return {
|
|
722
|
-
...
|
|
746
|
+
...a,
|
|
723
747
|
...c
|
|
724
748
|
};
|
|
725
749
|
},
|
|
726
|
-
clear(
|
|
727
|
-
|
|
728
|
-
return i;
|
|
750
|
+
clear(a, c) {
|
|
751
|
+
return Object.fromEntries(Object.entries(a).filter(([d]) => d !== c));
|
|
729
752
|
},
|
|
730
753
|
clearAll() {
|
|
731
754
|
return {};
|
|
732
755
|
}
|
|
733
756
|
});
|
|
734
|
-
function
|
|
735
|
-
if (typeof
|
|
757
|
+
function u(a, c) {
|
|
758
|
+
if (typeof a == "string") {
|
|
736
759
|
if (c === void 0)
|
|
737
760
|
throw new Error("Response is required when registering a single field");
|
|
738
|
-
|
|
761
|
+
i.register({ fieldId: a, response: c });
|
|
739
762
|
} else
|
|
740
|
-
|
|
763
|
+
i.registerBatch(a);
|
|
741
764
|
}
|
|
742
|
-
async function
|
|
743
|
-
|
|
765
|
+
async function s(a, c, d) {
|
|
766
|
+
if (a.validation && !fe(a.validation) && !T(d)) {
|
|
767
|
+
const m = await _(t, a.validation, { $input: d });
|
|
768
|
+
if (typeof m == "string")
|
|
769
|
+
return {
|
|
770
|
+
fieldId: c,
|
|
771
|
+
userMessage: m,
|
|
772
|
+
systemMessage: `Field validation resulted in an error: ${m}.`,
|
|
773
|
+
value: d
|
|
774
|
+
};
|
|
775
|
+
if (m === !1)
|
|
776
|
+
return {
|
|
777
|
+
fieldId: c,
|
|
778
|
+
userMessage: "This field is invalid",
|
|
779
|
+
systemMessage: "Field validation resulted in an unspecified error.",
|
|
780
|
+
value: d
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
return a.required && T(d) ? {
|
|
784
|
+
fieldId: c,
|
|
785
|
+
userMessage: "This field is required",
|
|
786
|
+
systemMessage: "Field is required.",
|
|
787
|
+
value: d
|
|
788
|
+
} : !a.multiple && Array.isArray(d) && d.length > 1 ? {
|
|
789
|
+
fieldId: c,
|
|
790
|
+
userMessage: "This field expects a single response",
|
|
791
|
+
systemMessage: "Field expects a single response.",
|
|
792
|
+
value: d
|
|
793
|
+
} : null;
|
|
794
|
+
}
|
|
795
|
+
async function o(a) {
|
|
796
|
+
const c = [], d = {}, m = t.fields.listStore.getState();
|
|
744
797
|
return await Promise.allSettled(
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
const g = t.fields.getById(s).getState();
|
|
749
|
-
if (!g) {
|
|
798
|
+
Object.entries(a).map(async ([y, I]) => {
|
|
799
|
+
const E = st(y, m);
|
|
800
|
+
if (!E) {
|
|
750
801
|
c.push({
|
|
751
|
-
fieldId:
|
|
752
|
-
userMessage: `Field '${
|
|
753
|
-
systemMessage: `No field with ID '${
|
|
754
|
-
value:
|
|
802
|
+
fieldId: y,
|
|
803
|
+
userMessage: `Field '${y}' not found`,
|
|
804
|
+
systemMessage: `No field with ID or key '${y}' exists. Available field IDs are: ${m.map((re) => re.id).join(",")}.`,
|
|
805
|
+
value: I
|
|
755
806
|
});
|
|
756
807
|
return;
|
|
757
808
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
responses: v
|
|
762
|
-
});
|
|
763
|
-
if (typeof S == "string") {
|
|
764
|
-
c.push({
|
|
765
|
-
fieldId: s,
|
|
766
|
-
userMessage: S,
|
|
767
|
-
systemMessage: `Field validation resulted in an error: ${S}.`,
|
|
768
|
-
value: o
|
|
769
|
-
});
|
|
770
|
-
return;
|
|
771
|
-
}
|
|
772
|
-
if (S === !1) {
|
|
773
|
-
c.push({
|
|
774
|
-
fieldId: s,
|
|
775
|
-
userMessage: "This field is invalid",
|
|
776
|
-
systemMessage: "Field validation resulted in an unspecified error.",
|
|
777
|
-
value: o
|
|
778
|
-
});
|
|
779
|
-
return;
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
if (g.required && N(o)) {
|
|
783
|
-
c.push({
|
|
784
|
-
fieldId: s,
|
|
785
|
-
userMessage: "This field is required",
|
|
786
|
-
systemMessage: "Field is required.",
|
|
787
|
-
value: o
|
|
788
|
-
});
|
|
809
|
+
const x = E.id, B = it(E, I), P = await s(E, x, B);
|
|
810
|
+
if (P) {
|
|
811
|
+
c.push(P);
|
|
789
812
|
return;
|
|
790
813
|
}
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
userMessage: "This field expects a single response",
|
|
795
|
-
systemMessage: "Field expects a single response.",
|
|
796
|
-
value: o
|
|
797
|
-
});
|
|
814
|
+
const J = ot(E, x, B);
|
|
815
|
+
if (J) {
|
|
816
|
+
c.push(J);
|
|
798
817
|
return;
|
|
799
818
|
}
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
if (!Array.isArray(o)) {
|
|
803
|
-
c.push({
|
|
804
|
-
fieldId: s,
|
|
805
|
-
userMessage: "This field expects multiple values",
|
|
806
|
-
systemMessage: "Field expects an array of objects.",
|
|
807
|
-
value: o
|
|
808
|
-
});
|
|
809
|
-
return;
|
|
810
|
-
}
|
|
811
|
-
for (const v of o) {
|
|
812
|
-
if (typeof v != "object" || v === null) {
|
|
813
|
-
c.push({
|
|
814
|
-
fieldId: s,
|
|
815
|
-
userMessage: "This field expects object values",
|
|
816
|
-
systemMessage: "Field expects an array of objects, but received non-object value.",
|
|
817
|
-
value: o
|
|
818
|
-
});
|
|
819
|
-
return;
|
|
820
|
-
}
|
|
821
|
-
if (!Y(v)) {
|
|
822
|
-
c.push({
|
|
823
|
-
fieldId: s,
|
|
824
|
-
userMessage: "This field contains non-serializable data",
|
|
825
|
-
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
826
|
-
value: o
|
|
827
|
-
});
|
|
828
|
-
return;
|
|
829
|
-
}
|
|
830
|
-
}
|
|
831
|
-
} else {
|
|
832
|
-
if (Array.isArray(o)) {
|
|
833
|
-
c.push({
|
|
834
|
-
fieldId: s,
|
|
835
|
-
userMessage: "This field expects a single value",
|
|
836
|
-
systemMessage: "Field expects a single object, not an array.",
|
|
837
|
-
value: o
|
|
838
|
-
});
|
|
839
|
-
return;
|
|
840
|
-
}
|
|
841
|
-
if (typeof o != "object" || o === null) {
|
|
842
|
-
c.push({
|
|
843
|
-
fieldId: s,
|
|
844
|
-
userMessage: "This field expects an object value",
|
|
845
|
-
systemMessage: "Field expects an object value.",
|
|
846
|
-
value: o
|
|
847
|
-
});
|
|
848
|
-
return;
|
|
849
|
-
}
|
|
850
|
-
if (!Y(o)) {
|
|
851
|
-
c.push({
|
|
852
|
-
fieldId: s,
|
|
853
|
-
userMessage: "This field contains non-serializable data",
|
|
854
|
-
systemMessage: "Field value contains non-JSON-serializable data (functions, circular references, etc.).",
|
|
855
|
-
value: o
|
|
856
|
-
});
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
if (Array.isArray(g.options) && g.options.length > 0) {
|
|
861
|
-
const v = Array.isArray(o) ? o : [o];
|
|
862
|
-
if (g.type === "object") {
|
|
863
|
-
const S = g.options.map((k) => JSON.stringify(k.value));
|
|
864
|
-
v.every((k) => S.includes(JSON.stringify(k))) || c.push({
|
|
865
|
-
fieldId: s,
|
|
866
|
-
userMessage: "This field expects a valid option",
|
|
867
|
-
systemMessage: "Field expects a valid option from the defined choices.",
|
|
868
|
-
value: o
|
|
869
|
-
});
|
|
870
|
-
} else {
|
|
871
|
-
const S = g.options.map((k) => k.value);
|
|
872
|
-
v.every((k) => !Xe(k) || k === null ? !1 : S.includes(k)) || c.push({
|
|
873
|
-
fieldId: s,
|
|
874
|
-
userMessage: "This field expects a valid option",
|
|
875
|
-
systemMessage: `Field expects a valid option. Valid options are: ${S.join(", ")}`,
|
|
876
|
-
value: o
|
|
877
|
-
});
|
|
878
|
-
}
|
|
879
|
-
}
|
|
819
|
+
const q = at(E, x, B);
|
|
820
|
+
q && c.push(q), d[x] = I;
|
|
880
821
|
})
|
|
881
|
-
), { responsesToCommit:
|
|
822
|
+
), { responsesToCommit: d, validationErrors: c };
|
|
882
823
|
}
|
|
883
|
-
async function
|
|
884
|
-
const { responsesToCommit: c, validationErrors:
|
|
885
|
-
return
|
|
824
|
+
async function l(a) {
|
|
825
|
+
const { responsesToCommit: c, validationErrors: d } = await o(a);
|
|
826
|
+
return d.length ? { errors: d } : (i.registerBatch(c), { errors: [] });
|
|
886
827
|
}
|
|
887
|
-
const
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
828
|
+
const p = e.map((a) => a), f = A(
|
|
829
|
+
{ responses: e, fields: t.fields.listStore },
|
|
830
|
+
({ responses: a, fields: c }) => Object.entries(a).map(([d, m]) => {
|
|
831
|
+
const y = c.find((I) => I.id === d);
|
|
832
|
+
return {
|
|
833
|
+
fieldId: d,
|
|
834
|
+
fieldKey: y?.key ?? d,
|
|
835
|
+
value: m
|
|
836
|
+
};
|
|
837
|
+
})
|
|
838
|
+
);
|
|
839
|
+
function h(a) {
|
|
840
|
+
const c = t.fields.listStore.map(
|
|
841
|
+
(m) => m.find((y) => y.id === a) ?? null
|
|
842
|
+
), d = e.map((m) => m[a] ?? null);
|
|
843
|
+
return A({ f: c, r: d }, ({ f: m, r: y }) => y !== null ? y : m?.defaultValue ? m.defaultValue : null);
|
|
844
|
+
}
|
|
845
|
+
function S(a) {
|
|
846
|
+
const c = t.fields.getByKey(a);
|
|
847
|
+
return A({ f: c, s: e }, ({ f: d, s: m }) => {
|
|
848
|
+
const y = d ? m[d.id] ?? null : null;
|
|
849
|
+
return y || (d?.defaultValue ? d.defaultValue : null);
|
|
850
|
+
});
|
|
894
851
|
}
|
|
895
|
-
function
|
|
896
|
-
const c = t.fields.getByName(
|
|
897
|
-
return
|
|
898
|
-
const
|
|
899
|
-
return
|
|
852
|
+
function g(a) {
|
|
853
|
+
const c = t.fields.getByName(a);
|
|
854
|
+
return A({ f: c, s: e }, ({ f: d, s: m }) => {
|
|
855
|
+
const y = d && m[d.id] || null;
|
|
856
|
+
return y || (d?.defaultValue ? d.defaultValue : null);
|
|
900
857
|
});
|
|
901
858
|
}
|
|
902
|
-
return
|
|
859
|
+
return v({
|
|
903
860
|
clock: r,
|
|
904
|
-
target:
|
|
905
|
-
}),
|
|
861
|
+
target: i.clearAll
|
|
862
|
+
}), v({
|
|
906
863
|
clock: n,
|
|
907
|
-
target:
|
|
864
|
+
target: i.clear
|
|
908
865
|
}), {
|
|
909
|
-
register:
|
|
866
|
+
register: u,
|
|
910
867
|
clearAll: r,
|
|
911
868
|
clear: n,
|
|
912
|
-
commit:
|
|
913
|
-
getResponsesToCommit:
|
|
914
|
-
listStore:
|
|
915
|
-
getAllStore:
|
|
869
|
+
commit: l,
|
|
870
|
+
getResponsesToCommit: o,
|
|
871
|
+
listStore: f,
|
|
872
|
+
getAllStore: p,
|
|
873
|
+
// eslint-disable-next-line sonarjs/deprecation -- returned for backwards compatibility; callers should use getByFieldKey
|
|
916
874
|
getByFieldId: h,
|
|
917
|
-
|
|
875
|
+
getByFieldKey: S,
|
|
876
|
+
getByFieldName: g
|
|
877
|
+
};
|
|
878
|
+
});
|
|
879
|
+
function dt(t) {
|
|
880
|
+
return b(ut, t);
|
|
881
|
+
}
|
|
882
|
+
const lt = j("condition"), ft = k(() => {
|
|
883
|
+
const t = lt.store({}), e = w(t, {
|
|
884
|
+
register(s, o) {
|
|
885
|
+
return {
|
|
886
|
+
...s,
|
|
887
|
+
[o.condition.id]: o.condition
|
|
888
|
+
};
|
|
889
|
+
}
|
|
890
|
+
});
|
|
891
|
+
function r(s) {
|
|
892
|
+
e.register({ condition: s });
|
|
893
|
+
}
|
|
894
|
+
const n = t.map((s) => Object.values(s));
|
|
895
|
+
function i(s) {
|
|
896
|
+
return t.map((o) => o[s] ?? null);
|
|
897
|
+
}
|
|
898
|
+
function u(s) {
|
|
899
|
+
return t.map((o) => Object.values(o).find((l) => l.key === s) ?? null);
|
|
900
|
+
}
|
|
901
|
+
return {
|
|
902
|
+
register: r,
|
|
903
|
+
getById: i,
|
|
904
|
+
getByKey: u,
|
|
905
|
+
listStore: n
|
|
918
906
|
};
|
|
919
907
|
});
|
|
920
|
-
function
|
|
921
|
-
return
|
|
908
|
+
function pt() {
|
|
909
|
+
return b(ft);
|
|
922
910
|
}
|
|
923
|
-
function
|
|
911
|
+
function gt() {
|
|
924
912
|
if (H()) {
|
|
925
913
|
const t = [
|
|
926
914
|
document.currentScript,
|
|
@@ -935,69 +923,69 @@ function rt() {
|
|
|
935
923
|
}
|
|
936
924
|
return "https://api.picked.app";
|
|
937
925
|
}
|
|
938
|
-
function
|
|
926
|
+
function mt() {
|
|
939
927
|
if (!G())
|
|
940
928
|
return {};
|
|
941
929
|
const t = new URLSearchParams(window.location.search), e = {}, r = /* @__PURE__ */ new Set();
|
|
942
|
-
for (const [
|
|
943
|
-
|
|
944
|
-
for (const
|
|
945
|
-
const
|
|
946
|
-
e[
|
|
930
|
+
for (const [i] of t.entries())
|
|
931
|
+
i.startsWith("picked-") && r.add(i);
|
|
932
|
+
for (const i of r) {
|
|
933
|
+
const u = i.replace("picked-", "");
|
|
934
|
+
e[u] = t.getAll(i);
|
|
947
935
|
}
|
|
948
|
-
const n =
|
|
936
|
+
const n = z("s");
|
|
949
937
|
if (r.size > 0)
|
|
950
|
-
|
|
938
|
+
M.set(n, e);
|
|
951
939
|
else {
|
|
952
|
-
const
|
|
953
|
-
if (
|
|
954
|
-
return
|
|
940
|
+
const i = M.get(n);
|
|
941
|
+
if (i)
|
|
942
|
+
return i.json() || {};
|
|
955
943
|
}
|
|
956
944
|
return e;
|
|
957
945
|
}
|
|
958
|
-
function
|
|
959
|
-
if (
|
|
946
|
+
function yt() {
|
|
947
|
+
if (ge())
|
|
960
948
|
return crypto.randomUUID();
|
|
961
949
|
const t = Date.now().toString(36), e = Math.random().toString(36).substring(2, 15), r = Math.random().toString(36).substring(2, 15), n = Math.random().toString(36).substring(2, 15);
|
|
962
950
|
return `${t}-${e}-${r}-${n}`;
|
|
963
951
|
}
|
|
964
|
-
const
|
|
965
|
-
const t =
|
|
952
|
+
const ht = z("session", "global"), St = () => {
|
|
953
|
+
const t = R.get(ht);
|
|
966
954
|
let e;
|
|
967
955
|
t.isSet() && (e = t.json());
|
|
968
|
-
const r = (
|
|
969
|
-
id:
|
|
970
|
-
isUser:
|
|
971
|
-
identifiers:
|
|
956
|
+
const r = (i) => t.set({
|
|
957
|
+
id: i.id,
|
|
958
|
+
isUser: i.isUser,
|
|
959
|
+
identifiers: i.identifiers
|
|
972
960
|
}), n = {
|
|
973
|
-
id: e?.id ??
|
|
961
|
+
id: e?.id ?? yt(),
|
|
974
962
|
isUser: e?.isUser ?? void 0,
|
|
975
963
|
identifiers: e?.identifiers ?? void 0,
|
|
976
|
-
setIsUser(
|
|
977
|
-
this.isUser =
|
|
964
|
+
setIsUser(i) {
|
|
965
|
+
this.isUser = i, r(this);
|
|
978
966
|
},
|
|
979
|
-
setIdentifier(
|
|
980
|
-
this.identifiers = { ...this.identifiers, [
|
|
967
|
+
setIdentifier(i, u) {
|
|
968
|
+
this.identifiers = { ...this.identifiers, [i]: u }, r(this);
|
|
981
969
|
},
|
|
982
|
-
removeIdentifier(
|
|
970
|
+
removeIdentifier(i) {
|
|
983
971
|
this.identifiers && (this.identifiers = Object.fromEntries(
|
|
984
|
-
Object.entries(this.identifiers).filter(([
|
|
972
|
+
Object.entries(this.identifiers).filter(([u]) => u !== i)
|
|
985
973
|
), this.identifiers = Object.keys(this.identifiers).length ? this.identifiers : void 0, r(this));
|
|
986
974
|
}
|
|
987
975
|
};
|
|
988
976
|
return r(n), n;
|
|
989
|
-
},
|
|
990
|
-
function
|
|
977
|
+
}, kt = () => pe() ? St() : null;
|
|
978
|
+
function bt() {
|
|
991
979
|
if (G())
|
|
992
980
|
return globalThis.window.pickedConfig;
|
|
993
981
|
}
|
|
994
|
-
function
|
|
982
|
+
function wt() {
|
|
995
983
|
if (!G())
|
|
996
984
|
return;
|
|
997
|
-
const t =
|
|
985
|
+
const t = bt(), e = t?.organizationId, r = t?.projectId;
|
|
998
986
|
return e && r ? { organizationId: e, projectId: r } : void 0;
|
|
999
987
|
}
|
|
1000
|
-
function
|
|
988
|
+
function It() {
|
|
1001
989
|
if (!H())
|
|
1002
990
|
return;
|
|
1003
991
|
const t = document.getElementById("picked_script") || document.querySelector("script#picked") || // legacy support for 'cvly' script tag
|
|
@@ -1007,16 +995,16 @@ function dt() {
|
|
|
1007
995
|
const e = t.dataset.organizationid || t.getAttribute("organization-id"), r = t.dataset.projectid || t.getAttribute("project-id");
|
|
1008
996
|
return e && r ? { organizationId: e, projectId: r } : void 0;
|
|
1009
997
|
}
|
|
1010
|
-
function
|
|
998
|
+
function vt(t) {
|
|
1011
999
|
const { organizationId: e, projectId: r } = t;
|
|
1012
1000
|
if (e && r)
|
|
1013
1001
|
return { organizationId: e, projectId: r };
|
|
1014
|
-
const n =
|
|
1002
|
+
const n = wt();
|
|
1015
1003
|
if (n)
|
|
1016
1004
|
return n;
|
|
1017
|
-
const
|
|
1018
|
-
if (
|
|
1019
|
-
return
|
|
1005
|
+
const i = It();
|
|
1006
|
+
if (i)
|
|
1007
|
+
return i;
|
|
1020
1008
|
throw new Error(
|
|
1021
1009
|
`organizationId and projectId are required. You can provide them via one of:
|
|
1022
1010
|
(1) createClient({ organizationId, projectId }) options;
|
|
@@ -1024,13 +1012,13 @@ function lt(t) {
|
|
|
1024
1012
|
(3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes data-organizationid/data-projectid (or organization-id/project-id) attributes.`
|
|
1025
1013
|
);
|
|
1026
1014
|
}
|
|
1027
|
-
function
|
|
1015
|
+
function O(t) {
|
|
1028
1016
|
return t == null || t === "" || Number.isNaN(t);
|
|
1029
1017
|
}
|
|
1030
|
-
const
|
|
1031
|
-
default: (t, e) =>
|
|
1032
|
-
append: (t, e) => e && !
|
|
1033
|
-
prepend: (t, e) => e && !
|
|
1018
|
+
const Ft = {
|
|
1019
|
+
default: (t, e) => O(t) ? String(e ?? "") : String(t),
|
|
1020
|
+
append: (t, e) => e && !O(t) ? `${t} ${e}` : t,
|
|
1021
|
+
prepend: (t, e) => e && !O(t) ? `${e} ${t}` : t,
|
|
1034
1022
|
upper: (t) => typeof t == "string" ? t.toUpperCase() : t,
|
|
1035
1023
|
lower: (t) => typeof t == "string" ? t.toLowerCase() : t,
|
|
1036
1024
|
capitalize: (t) => typeof t == "string" ? t.charAt(0).toUpperCase() + t.slice(1) : t,
|
|
@@ -1041,59 +1029,59 @@ const pt = {
|
|
|
1041
1029
|
if (Array.isArray(t))
|
|
1042
1030
|
return e.format(t.map(String));
|
|
1043
1031
|
if (t instanceof Map) {
|
|
1044
|
-
const r = Array.from(t.entries()).map(([n,
|
|
1032
|
+
const r = Array.from(t.entries()).map(([n, i]) => `${n}: ${i}`);
|
|
1045
1033
|
return e.format(r);
|
|
1046
1034
|
}
|
|
1047
1035
|
return t instanceof Set ? e.format(Array.from(t).map(String)) : t;
|
|
1048
1036
|
}
|
|
1049
1037
|
};
|
|
1050
|
-
function
|
|
1038
|
+
function jt(t) {
|
|
1051
1039
|
return typeof t == "object" && t !== null;
|
|
1052
1040
|
}
|
|
1053
|
-
function
|
|
1041
|
+
function Et(t, e) {
|
|
1054
1042
|
let r = e;
|
|
1055
1043
|
for (const n of t.split("."))
|
|
1056
|
-
if (
|
|
1044
|
+
if (jt(r) && n in r)
|
|
1057
1045
|
r = r[n];
|
|
1058
1046
|
else
|
|
1059
1047
|
return;
|
|
1060
1048
|
return typeof r == "function" ? r() : r;
|
|
1061
1049
|
}
|
|
1062
|
-
function
|
|
1063
|
-
const r = t.split("|").map((
|
|
1064
|
-
let
|
|
1065
|
-
for (const
|
|
1066
|
-
const [
|
|
1067
|
-
|
|
1050
|
+
function xt(t, e) {
|
|
1051
|
+
const r = t.split("|").map((u) => u.trim()), n = r.shift() ?? "";
|
|
1052
|
+
let i = Et(n, e);
|
|
1053
|
+
for (const u of r) {
|
|
1054
|
+
const [s, ...o] = u.split(":"), l = s?.trim() ?? "", p = o.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), f = Ft[l];
|
|
1055
|
+
f && (i = f(i, p));
|
|
1068
1056
|
}
|
|
1069
|
-
return
|
|
1057
|
+
return O(i) ? "" : typeof i == "object" ? JSON.stringify(i) : String(i);
|
|
1070
1058
|
}
|
|
1071
|
-
function
|
|
1059
|
+
function Pt(t, e) {
|
|
1072
1060
|
let r = "", n = 0;
|
|
1073
1061
|
for (; n < t.length; )
|
|
1074
1062
|
if (t[n] === "{" && t[n + 1] === "{") {
|
|
1075
1063
|
n += 2;
|
|
1076
|
-
let
|
|
1064
|
+
let i = "";
|
|
1077
1065
|
for (; n < t.length; ) {
|
|
1078
1066
|
if (t[n] === "}" && t[n + 1] === "}") {
|
|
1079
1067
|
n += 2;
|
|
1080
1068
|
break;
|
|
1081
1069
|
}
|
|
1082
|
-
|
|
1070
|
+
i += t[n++];
|
|
1083
1071
|
}
|
|
1084
|
-
r +=
|
|
1072
|
+
r += xt(i.trim(), e);
|
|
1085
1073
|
} else
|
|
1086
1074
|
r += t[n++];
|
|
1087
1075
|
return r;
|
|
1088
1076
|
}
|
|
1089
|
-
class
|
|
1090
|
-
static logger =
|
|
1077
|
+
class At {
|
|
1078
|
+
static logger = F;
|
|
1091
1079
|
options;
|
|
1092
1080
|
isReady = !1;
|
|
1093
1081
|
project;
|
|
1094
1082
|
plugins = {};
|
|
1095
1083
|
pluginStartHooks = [];
|
|
1096
|
-
eventBus =
|
|
1084
|
+
eventBus = D();
|
|
1097
1085
|
events;
|
|
1098
1086
|
organizationId;
|
|
1099
1087
|
projectId;
|
|
@@ -1104,24 +1092,26 @@ class yt {
|
|
|
1104
1092
|
precondition;
|
|
1105
1093
|
condition;
|
|
1106
1094
|
preconditionPassed;
|
|
1107
|
-
searchParams =
|
|
1108
|
-
history =
|
|
1109
|
-
components =
|
|
1110
|
-
experienceInstances =
|
|
1111
|
-
experiences =
|
|
1095
|
+
searchParams = mt();
|
|
1096
|
+
history = Le();
|
|
1097
|
+
components = Ee({ client: this });
|
|
1098
|
+
experienceInstances = ae({ client: this });
|
|
1099
|
+
experiences = ke({ client: this });
|
|
1112
1100
|
frameworks = Ae({ client: this });
|
|
1113
1101
|
predicates = Me({ client: this });
|
|
1114
1102
|
features = Ue({ client: this });
|
|
1115
|
-
|
|
1116
|
-
fields =
|
|
1117
|
-
|
|
1103
|
+
conditions = pt();
|
|
1104
|
+
fields = qe();
|
|
1105
|
+
responses = dt({ client: this });
|
|
1106
|
+
steps = Qe();
|
|
1107
|
+
actions = tt();
|
|
1118
1108
|
constructor(e) {
|
|
1119
|
-
|
|
1120
|
-
const { organizationId: r, projectId: n } =
|
|
1121
|
-
this.organizationId = r, this.projectId = n, this.options = Object.freeze(e), this.apiUrl = e.apiUrl ||
|
|
1109
|
+
F("info", "Picked client initializing."), this.events = He(this.eventBus);
|
|
1110
|
+
const { organizationId: r, projectId: n } = vt(e);
|
|
1111
|
+
this.organizationId = r, this.projectId = n, this.options = Object.freeze(e), this.apiUrl = e.apiUrl || gt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.session = kt(), this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.precondition = e.precondition, this.condition = e.condition, this.eventBus({ type: "load", version: de() }), F("info", "Picked client initialized.");
|
|
1122
1112
|
}
|
|
1123
1113
|
start = () => {
|
|
1124
|
-
|
|
1114
|
+
Ce(this), (async () => {
|
|
1125
1115
|
if (!H())
|
|
1126
1116
|
return;
|
|
1127
1117
|
await this.runPluginStartHooks();
|
|
@@ -1129,44 +1119,50 @@ class yt {
|
|
|
1129
1119
|
this.preconditionPassed = r;
|
|
1130
1120
|
let n;
|
|
1131
1121
|
r && (n = await this.evaluateGate(this.condition));
|
|
1132
|
-
const
|
|
1122
|
+
const i = r && n === !0;
|
|
1133
1123
|
if (typeof n == "boolean" && this.session) {
|
|
1134
|
-
const
|
|
1135
|
-
this.session.setIsUser(
|
|
1124
|
+
const u = n;
|
|
1125
|
+
this.session.setIsUser(u), this.eventBus({ type: "user_decide", value: u });
|
|
1136
1126
|
}
|
|
1137
|
-
if (this.eventBus({ type: "initialize" }),
|
|
1138
|
-
const { id:
|
|
1139
|
-
this.eventBus({ type: "session", id:
|
|
1127
|
+
if (this.eventBus({ type: "initialize" }), i && K(this), await ce(), i && K(this), this.eventBus({ type: "ready" }), this.isReady = !0, this.session) {
|
|
1128
|
+
const { id: u, isUser: s, identifiers: o } = this.session;
|
|
1129
|
+
this.eventBus({ type: "session", id: u, isUser: s, identifiers: o });
|
|
1140
1130
|
}
|
|
1141
1131
|
})();
|
|
1142
1132
|
};
|
|
1143
1133
|
registerFramework = (e) => {
|
|
1144
|
-
|
|
1134
|
+
Be(e, this.frameworks);
|
|
1145
1135
|
};
|
|
1146
1136
|
registerComponent = (e, r) => {
|
|
1147
|
-
|
|
1137
|
+
W(e, r, this.components);
|
|
1148
1138
|
};
|
|
1149
1139
|
registerPlugin = (e) => {
|
|
1150
|
-
|
|
1140
|
+
we(this, e, this.plugins);
|
|
1151
1141
|
const r = this.plugins[e.name];
|
|
1152
1142
|
r?.onStart && this.pluginStartHooks.push(r.onStart);
|
|
1153
1143
|
};
|
|
1154
1144
|
registerFeature = (e, r) => {
|
|
1155
|
-
|
|
1145
|
+
Ne(e, r, this.features);
|
|
1156
1146
|
};
|
|
1157
1147
|
registerPredicate = (e, r) => {
|
|
1158
|
-
|
|
1148
|
+
Ve(e, r, this.predicates);
|
|
1149
|
+
};
|
|
1150
|
+
registerCondition = (e) => {
|
|
1151
|
+
this.conditions.register(e);
|
|
1159
1152
|
};
|
|
1160
1153
|
registerField = (e) => {
|
|
1161
|
-
|
|
1154
|
+
Ke(e, this.fields);
|
|
1155
|
+
};
|
|
1156
|
+
registerStep = (e) => {
|
|
1157
|
+
Xe(e, this.steps);
|
|
1162
1158
|
};
|
|
1163
1159
|
registerAction = (e, r) => {
|
|
1164
|
-
|
|
1160
|
+
rt(e, r, this.actions);
|
|
1165
1161
|
};
|
|
1166
1162
|
registerExperience = (e) => {
|
|
1167
|
-
e.component &&
|
|
1163
|
+
e.component && W(`experience:${e.id}`, e.component, this.components), be(e, this.experiences);
|
|
1168
1164
|
};
|
|
1169
|
-
getStateSnapshot = () =>
|
|
1165
|
+
getStateSnapshot = () => te(this);
|
|
1170
1166
|
/** @deprecated Use `client.experiences.launch({ id: experienceId })` instead. */
|
|
1171
1167
|
launchExperienceById = async (e, r) => {
|
|
1172
1168
|
this.experiences.launch({ id: e, options: r });
|
|
@@ -1180,7 +1176,7 @@ class yt {
|
|
|
1180
1176
|
await e();
|
|
1181
1177
|
}
|
|
1182
1178
|
async evaluateGate(e) {
|
|
1183
|
-
return e === void 0 ? !0 : typeof e == "boolean" ? e : await
|
|
1179
|
+
return e === void 0 ? !0 : typeof e == "boolean" ? e : await _(this, e) === !0;
|
|
1184
1180
|
}
|
|
1185
1181
|
setupPlugins() {
|
|
1186
1182
|
this.options.plugins?.forEach((e) => {
|
|
@@ -1201,20 +1197,20 @@ class yt {
|
|
|
1201
1197
|
setupFeatures() {
|
|
1202
1198
|
const e = this.options.features;
|
|
1203
1199
|
e && (Object.entries(e).forEach(([r, n]) => {
|
|
1204
|
-
const
|
|
1205
|
-
this.registerFeature(r,
|
|
1200
|
+
const i = typeof n == "function" ? n() : n;
|
|
1201
|
+
this.registerFeature(r, i);
|
|
1206
1202
|
}), this.searchParams.feature && this.searchParams.feature.forEach((r) => {
|
|
1207
1203
|
try {
|
|
1208
|
-
const [n,
|
|
1209
|
-
if (!n || !
|
|
1204
|
+
const [n, i] = r.split(":");
|
|
1205
|
+
if (!n || !i)
|
|
1210
1206
|
return;
|
|
1211
|
-
let
|
|
1212
|
-
|
|
1213
|
-
key: `${
|
|
1207
|
+
let u = i;
|
|
1208
|
+
u === "true" && (u = !0), u === "false" && (u = !1), this.registerFeature(n, {
|
|
1209
|
+
key: `${u}`,
|
|
1214
1210
|
// use the assigned bucket value as the key
|
|
1215
1211
|
name: n,
|
|
1216
|
-
// eslint-disable-next-line sonarjs/function-return-type
|
|
1217
|
-
decide: () =>
|
|
1212
|
+
// eslint-disable-next-line sonarjs/function-return-type -- feature decide returns either string bucket or boolean; union return is intentional
|
|
1213
|
+
decide: () => u,
|
|
1218
1214
|
storage: "session"
|
|
1219
1215
|
});
|
|
1220
1216
|
} catch {
|
|
@@ -1225,7 +1221,7 @@ class yt {
|
|
|
1225
1221
|
const e = this.options.predicates;
|
|
1226
1222
|
e && Object.entries(e).forEach(([r, n]) => {
|
|
1227
1223
|
if (typeof n != "function") {
|
|
1228
|
-
|
|
1224
|
+
F("warn", `Predicate "${r}" is not a function.`);
|
|
1229
1225
|
return;
|
|
1230
1226
|
}
|
|
1231
1227
|
this.registerPredicate(r, n);
|
|
@@ -1235,7 +1231,7 @@ class yt {
|
|
|
1235
1231
|
const e = this.options.actions;
|
|
1236
1232
|
e && Object.entries(e).forEach(([r, n]) => {
|
|
1237
1233
|
if (typeof n != "function") {
|
|
1238
|
-
|
|
1234
|
+
F("warn", `Action "${r}" is not a function.`);
|
|
1239
1235
|
return;
|
|
1240
1236
|
}
|
|
1241
1237
|
this.registerAction(r, n);
|
|
@@ -1291,47 +1287,47 @@ class yt {
|
|
|
1291
1287
|
* // => "Fruits: apple, banana, and cherry"
|
|
1292
1288
|
*/
|
|
1293
1289
|
renderString = (e, r) => {
|
|
1294
|
-
const n = this.responses.listStore.getState().reduce((
|
|
1295
|
-
return
|
|
1290
|
+
const n = this.responses.listStore.getState().reduce((i, u) => (i[u.fieldId] = u.value, i), {});
|
|
1291
|
+
return Pt(e, {
|
|
1296
1292
|
...r,
|
|
1297
1293
|
responses: n
|
|
1298
1294
|
});
|
|
1299
1295
|
};
|
|
1300
1296
|
}
|
|
1301
|
-
function
|
|
1297
|
+
function Ut(t) {
|
|
1302
1298
|
return {
|
|
1303
1299
|
$$type: "lazy-component",
|
|
1304
1300
|
load: t
|
|
1305
1301
|
};
|
|
1306
1302
|
}
|
|
1307
|
-
function
|
|
1303
|
+
function Nt(t) {
|
|
1308
1304
|
return typeof t == "object" && t !== null && "$$type" in t && t.$$type === "lazy-component";
|
|
1309
1305
|
}
|
|
1310
|
-
const
|
|
1311
|
-
const e = new
|
|
1312
|
-
return
|
|
1306
|
+
const Tt = (t) => {
|
|
1307
|
+
const e = new At(t);
|
|
1308
|
+
return me(e), e;
|
|
1313
1309
|
};
|
|
1314
1310
|
export {
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1311
|
+
At as Picked,
|
|
1312
|
+
Tt as createClient,
|
|
1313
|
+
z as createStorageKey,
|
|
1314
|
+
_ as evaluateRuleLogic,
|
|
1315
|
+
bt as getPickedConfig,
|
|
1316
|
+
Nt as isLazyLoader,
|
|
1317
|
+
Ht as isPickedRoot,
|
|
1318
|
+
Ut as lazyComponent,
|
|
1319
|
+
R as localStore,
|
|
1320
|
+
M as sessionStore,
|
|
1321
|
+
Jt as subscribe,
|
|
1322
|
+
Kt as supportsCookies,
|
|
1323
|
+
ge as supportsCryptoRandomUUID,
|
|
1328
1324
|
H as supportsDocument,
|
|
1329
|
-
|
|
1330
|
-
|
|
1325
|
+
Wt as supportsHistory,
|
|
1326
|
+
Yt as supportsIntersectionObserver,
|
|
1331
1327
|
pe as supportsLocalStorage,
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1328
|
+
Qt as supportsLocation,
|
|
1329
|
+
Xt as supportsSessionStorage,
|
|
1330
|
+
Zt as supportsShadowRoot,
|
|
1331
|
+
er as supportsWebComponents,
|
|
1336
1332
|
G as supportsWindow
|
|
1337
1333
|
};
|