@picked/client 0.0.1-dev.1783642866820 → 0.0.1-dev.1784003142683
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-4pMvd_kR.js → api-CsddE4DI.js} +1 -1
- package/dist/{api-BXhgvSc-.cjs → api-U2LgcKqF.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dom-observer/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/actions.mdx +6 -6
- package/dist/docs/sdk/actions.md +17 -5
- package/dist/{dom-BwmTHeT7.js → dom-CZyRgp2P.js} +17 -12
- package/dist/dom-CdxDV3e-.cjs +1 -0
- package/dist/esm/index.js +491 -383
- package/dist/esm/plugins/dom-observer/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/plugins/history-browser-storage/index.js +33 -11
- package/dist/esm/server/index.js +2 -2
- package/dist/experience-instance-BWL-yghq.cjs +1 -0
- package/dist/{experience-instance-pTMwxW1R.js → experience-instance-QSrdjfn6.js} +254 -233
- package/dist/{plugin-DDe5zJhy.cjs → plugin-CWvFEvt5.cjs} +1 -1
- package/dist/{plugin-DfzEBtiA.js → plugin-CnCP2N-8.js} +1 -1
- package/dist/types/entities/action/action.d.ts +8 -7
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +2 -2
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +23 -0
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +43 -12
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +1 -0
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/lifecycle/condition-selection.d.ts.map +1 -1
- package/dist/types/picked.d.ts +14 -10
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts +17 -0
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +94 -0
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -2
- package/package.json +2 -2
- package/dist/dom-CDrHc_j9.cjs +0 -1
- package/dist/experience-instance-DunhI3b8.cjs +0 -1
package/dist/esm/index.js
CHANGED
|
@@ -2,16 +2,25 @@ import { t as e } from "../object-BUDGxEqy.js";
|
|
|
2
2
|
import { n as t, t as n } from "../rules-logic-HesIUCu6.js";
|
|
3
3
|
import { t as r } from "../logger-DMN6TxJJ.js";
|
|
4
4
|
import { a as i, c as a, d as o, f as s, i as c, l, m as u, n as d, o as f, r as p, s as m, t as h, u as g } from "../supports-CO9bJGNl.js";
|
|
5
|
-
import { a as _,
|
|
6
|
-
import { l as
|
|
7
|
-
import { i as
|
|
8
|
-
import { n as te, r as ne } from "../api-
|
|
5
|
+
import { a as _, c as v, i as y, o as b, r as ee, t as x } from "../dom-CZyRgp2P.js";
|
|
6
|
+
import { l as S, n as C, r as w, u as T } from "../experience-instance-QSrdjfn6.js";
|
|
7
|
+
import { i as E, n as D, r as O, t as k } from "../storage-1MW3-_As.js";
|
|
8
|
+
import { n as te, r as ne } from "../api-CsddE4DI.js";
|
|
9
9
|
import { t as re } from "../id-Bo4RBeOs.js";
|
|
10
|
-
import { attach as
|
|
11
|
-
import { createFactory as
|
|
10
|
+
import { attach as A, combine as j, createApi as M, createDomain as N, createEffect as P, createEvent as F, createStore as I, sample as L } from "effector";
|
|
11
|
+
import { createFactory as R, invoke as z } from "@withease/factories";
|
|
12
12
|
//#region src/entities/experience/experience.ts
|
|
13
|
-
var
|
|
14
|
-
|
|
13
|
+
var B = N("experience");
|
|
14
|
+
function ie(e, t, n) {
|
|
15
|
+
let r = new Set(t.filter((e) => e.elements.length > 0).map((e) => e.selector));
|
|
16
|
+
for (let t of e) {
|
|
17
|
+
if (t.placement !== "replace" || r.has(t.selector)) continue;
|
|
18
|
+
let e = y(t.selector);
|
|
19
|
+
!e || e === n || `${t.selector}${e}${n}`;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
var ae = R(({ client: e, experience: r }) => {
|
|
23
|
+
let i = B.store(r), a = M(i, { merge(e, t) {
|
|
15
24
|
return {
|
|
16
25
|
...e,
|
|
17
26
|
...t.experience
|
|
@@ -21,24 +30,24 @@ var z = M("experience"), ie = L(({ client: e, experience: r }) => {
|
|
|
21
30
|
decisionLogic: e.condition,
|
|
22
31
|
targetSelectors: e.targets,
|
|
23
32
|
initializeOpenLogic: e.initializeOpen
|
|
24
|
-
})), s =
|
|
25
|
-
let r = e.nodes.filter(
|
|
33
|
+
})), s = j(i, e.components.listStore, (e, t) => (e.componentName ? t.find((t) => t.name === e.componentName) : void 0) || t.find((t) => t.name === `experience:${e.id}`) || t.find((e) => e.name === "experience"), { skipVoid: !1 }), c = j(i, e.steps.indexStore, e.conditions.indexStore, (e, t, n) => {
|
|
34
|
+
let r = e.nodes.filter(T).map((e) => t[e.stepId]).filter((e) => e !== void 0), i = e.nodes.filter(S).map((e) => n[e.conditionId]).filter((e) => e !== void 0);
|
|
26
35
|
return {
|
|
27
36
|
steps: r,
|
|
28
37
|
nodes: e.nodes,
|
|
29
38
|
edges: e.edges,
|
|
30
39
|
conditions: i
|
|
31
40
|
};
|
|
32
|
-
}), l = r.actions ?? [], u, d =
|
|
41
|
+
}), l = r.actions ?? [], u, d = A({
|
|
33
42
|
source: o,
|
|
34
43
|
effect: (t, n) => {
|
|
35
|
-
let i =
|
|
36
|
-
i.forEach(({ elements: e }) => e.forEach((e) =>
|
|
44
|
+
let i = _(t.targetSelectors, r.id);
|
|
45
|
+
i.forEach(({ elements: e }) => e.forEach((e) => v(e, r.id))), x(i, r.id, r.key).forEach((t) => {
|
|
37
46
|
n ? e.experienceInstances.spawn(u, t, n) : e.experienceInstances.spawn(u, t);
|
|
38
|
-
});
|
|
47
|
+
}), ie(t.targetSelectors, i, r.id);
|
|
39
48
|
}
|
|
40
|
-
}), f =
|
|
41
|
-
source:
|
|
49
|
+
}), f = A({
|
|
50
|
+
source: j({
|
|
42
51
|
preconditionPassed: e.preconditionPassedStore,
|
|
43
52
|
isUser: e.session.store.map((e) => e.isUser, { skipVoid: !1 }),
|
|
44
53
|
config: o
|
|
@@ -46,9 +55,9 @@ var z = M("experience"), ie = L(({ client: e, experience: r }) => {
|
|
|
46
55
|
effect: async ({ preconditionPassed: i, isUser: a, config: o }) => {
|
|
47
56
|
if (!i || !a) return !1;
|
|
48
57
|
let { decisionLogic: s, targetSelectors: c } = o;
|
|
49
|
-
return c.length === 0 ||
|
|
58
|
+
return c.length === 0 || _(c, r.id).length < 1 ? !1 : s === void 0 ? !0 : t(s) ? await n(e, s) === !0 : !0;
|
|
50
59
|
}
|
|
51
|
-
}), p =
|
|
60
|
+
}), p = P(async () => {
|
|
52
61
|
if (!e.contentLoader) return !0;
|
|
53
62
|
try {
|
|
54
63
|
await e.contentLoader({
|
|
@@ -59,26 +68,26 @@ var z = M("experience"), ie = L(({ client: e, experience: r }) => {
|
|
|
59
68
|
`${r.id}`;
|
|
60
69
|
}
|
|
61
70
|
return !0;
|
|
62
|
-
}), m =
|
|
63
|
-
return
|
|
71
|
+
}), m = F(), h = F(), g = B.createStore(void 0, { skipVoid: !1 }).on(m, (e, t) => t).on(h, (e, t) => t);
|
|
72
|
+
return L({
|
|
64
73
|
clock: m,
|
|
65
74
|
target: f
|
|
66
|
-
}),
|
|
75
|
+
}), L({
|
|
67
76
|
clock: f.doneData,
|
|
68
77
|
source: g,
|
|
69
78
|
filter: (e, t) => t,
|
|
70
79
|
fn: (e) => e,
|
|
71
80
|
target: d
|
|
72
|
-
}),
|
|
81
|
+
}), L({
|
|
73
82
|
clock: f.doneData,
|
|
74
83
|
filter: Boolean,
|
|
75
84
|
target: p
|
|
76
|
-
}),
|
|
85
|
+
}), L({
|
|
77
86
|
clock: h,
|
|
78
87
|
source: g,
|
|
79
88
|
fn: (e) => e,
|
|
80
89
|
target: d
|
|
81
|
-
}),
|
|
90
|
+
}), L({
|
|
82
91
|
clock: h,
|
|
83
92
|
target: p
|
|
84
93
|
}), u = {
|
|
@@ -97,22 +106,60 @@ var z = M("experience"), ie = L(({ client: e, experience: r }) => {
|
|
|
97
106
|
prepareExperienceContentFx: p
|
|
98
107
|
}, u;
|
|
99
108
|
});
|
|
100
|
-
function
|
|
101
|
-
return
|
|
109
|
+
function oe(e) {
|
|
110
|
+
return z(ae, e);
|
|
111
|
+
}
|
|
112
|
+
var se = 5e3;
|
|
113
|
+
function ce(e, t) {
|
|
114
|
+
return new Promise((n) => {
|
|
115
|
+
let r = setTimeout(n, t);
|
|
116
|
+
e.then(() => {
|
|
117
|
+
clearTimeout(r), n();
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function le(e) {
|
|
122
|
+
return e.configStore.getState().targetSelectors.filter((e) => e.placement === "replace").map((e) => e.selector);
|
|
123
|
+
}
|
|
124
|
+
function ue(e) {
|
|
125
|
+
let t = /* @__PURE__ */ new Map();
|
|
126
|
+
for (let n of e) for (let e of le(n)) t.set(e, (t.get(e) ?? 0) + 1);
|
|
127
|
+
let n = [], r = [];
|
|
128
|
+
for (let i of e) le(i).some((e) => (t.get(e) ?? 0) > 1) ? n.push(i) : r.push(i);
|
|
129
|
+
return {
|
|
130
|
+
serialised: n,
|
|
131
|
+
parallel: r
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
async function de(e) {
|
|
135
|
+
let t;
|
|
136
|
+
try {
|
|
137
|
+
let n = new Promise((n) => {
|
|
138
|
+
t = e.initialiseFx.finally.watch(() => n());
|
|
139
|
+
});
|
|
140
|
+
await e.shouldInitialiseFx() && await ce(n, se);
|
|
141
|
+
} catch {
|
|
142
|
+
`${e.id}`;
|
|
143
|
+
} finally {
|
|
144
|
+
t?.();
|
|
145
|
+
}
|
|
102
146
|
}
|
|
103
|
-
|
|
104
|
-
let t
|
|
147
|
+
async function fe(e) {
|
|
148
|
+
for (let t of e) await de(t);
|
|
149
|
+
}
|
|
150
|
+
var pe = R(({ client: e }) => {
|
|
151
|
+
let t = B.store({}), n = M(t, { register(e, t) {
|
|
105
152
|
return {
|
|
106
153
|
...e,
|
|
107
154
|
[t.id]: t
|
|
108
155
|
};
|
|
109
|
-
} }), r =
|
|
110
|
-
n.register(
|
|
156
|
+
} }), r = F(), i = P((t) => {
|
|
157
|
+
n.register(oe({
|
|
111
158
|
client: e,
|
|
112
159
|
experience: t
|
|
113
160
|
}));
|
|
114
161
|
});
|
|
115
|
-
|
|
162
|
+
L({
|
|
116
163
|
clock: r,
|
|
117
164
|
source: t,
|
|
118
165
|
filter: (e, t) => e[t.id] !== void 0,
|
|
@@ -125,7 +172,7 @@ var oe = L(({ client: e }) => {
|
|
|
125
172
|
experience: t,
|
|
126
173
|
strategy: "override"
|
|
127
174
|
});
|
|
128
|
-
}),
|
|
175
|
+
}), L({
|
|
129
176
|
clock: r,
|
|
130
177
|
source: t,
|
|
131
178
|
filter: (e, t) => e[t.id] === void 0,
|
|
@@ -139,7 +186,7 @@ var oe = L(({ client: e }) => {
|
|
|
139
186
|
function s(e) {
|
|
140
187
|
return t.map((t) => Object.values(t).find((t) => t.key === e) ?? t[e], { skipVoid: !1 });
|
|
141
188
|
}
|
|
142
|
-
let c =
|
|
189
|
+
let c = A({
|
|
143
190
|
source: t,
|
|
144
191
|
effect: (e, t) => {
|
|
145
192
|
let n = "key" in t ? Object.values(e).find((e) => e.key === t.key) : e[t.id];
|
|
@@ -157,7 +204,7 @@ var oe = L(({ client: e }) => {
|
|
|
157
204
|
getById: o,
|
|
158
205
|
getByKey: s,
|
|
159
206
|
launch: c,
|
|
160
|
-
open:
|
|
207
|
+
open: A({
|
|
161
208
|
source: {
|
|
162
209
|
experiences: t,
|
|
163
210
|
instances: e.experienceInstances.listStore
|
|
@@ -184,28 +231,29 @@ var oe = L(({ client: e }) => {
|
|
|
184
231
|
}
|
|
185
232
|
}),
|
|
186
233
|
listStore: a,
|
|
187
|
-
initialiseExperiencesFx:
|
|
234
|
+
initialiseExperiencesFx: A({
|
|
188
235
|
source: a,
|
|
189
|
-
effect: (e) => {
|
|
190
|
-
|
|
236
|
+
effect: async (e) => {
|
|
237
|
+
let { serialised: t, parallel: n } = ue(e);
|
|
238
|
+
await Promise.all([fe(t), ...n.map((e) => de(e))]);
|
|
191
239
|
}
|
|
192
240
|
})
|
|
193
241
|
};
|
|
194
242
|
});
|
|
195
|
-
function
|
|
196
|
-
return
|
|
243
|
+
function me(e) {
|
|
244
|
+
return z(pe, e);
|
|
197
245
|
}
|
|
198
|
-
var
|
|
246
|
+
var he = async (e) => {
|
|
199
247
|
await e.experiences.initialiseExperiencesFx();
|
|
200
248
|
};
|
|
201
249
|
//#endregion
|
|
202
250
|
//#region src/entities/plugin/plugin.ts
|
|
203
|
-
function
|
|
204
|
-
return
|
|
251
|
+
function ge(e) {
|
|
252
|
+
return P(async () => {
|
|
205
253
|
await e();
|
|
206
254
|
});
|
|
207
255
|
}
|
|
208
|
-
var
|
|
256
|
+
var _e = (e, t, n) => {
|
|
209
257
|
let r = t.name, i = t.setup(e);
|
|
210
258
|
if (i) {
|
|
211
259
|
let e = n[r] ?? {};
|
|
@@ -214,29 +262,29 @@ var ue = (e, t, n) => {
|
|
|
214
262
|
...i
|
|
215
263
|
});
|
|
216
264
|
}
|
|
217
|
-
},
|
|
265
|
+
}, ve = N("component"), ye = R(({ client: e, component: t, name: n }) => ({
|
|
218
266
|
name: n,
|
|
219
267
|
component: t,
|
|
220
268
|
frameworkStore: e.frameworks.getByName(t.frameworkName)
|
|
221
269
|
}));
|
|
222
|
-
function
|
|
223
|
-
return
|
|
270
|
+
function be(e) {
|
|
271
|
+
return z(ye, e);
|
|
224
272
|
}
|
|
225
|
-
var
|
|
226
|
-
let t =
|
|
273
|
+
var xe = R(({ client: e }) => {
|
|
274
|
+
let t = ve.store({}), n = M(t, { register(e, t) {
|
|
227
275
|
return {
|
|
228
276
|
...e,
|
|
229
277
|
[t.name]: t
|
|
230
278
|
};
|
|
231
|
-
} }), i =
|
|
232
|
-
|
|
279
|
+
} }), i = F();
|
|
280
|
+
L({
|
|
233
281
|
clock: i,
|
|
234
282
|
source: t,
|
|
235
283
|
filter: (e, { name: t }) => e[t] !== void 0,
|
|
236
284
|
fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
|
|
237
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
285
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
238
286
|
clock: i,
|
|
239
|
-
fn: ({ name: t, component: n }) =>
|
|
287
|
+
fn: ({ name: t, component: n }) => be({
|
|
240
288
|
client: e,
|
|
241
289
|
name: t,
|
|
242
290
|
component: n
|
|
@@ -253,27 +301,27 @@ var me = L(({ client: e }) => {
|
|
|
253
301
|
listStore: a
|
|
254
302
|
};
|
|
255
303
|
});
|
|
256
|
-
function
|
|
257
|
-
return
|
|
304
|
+
function Se(e) {
|
|
305
|
+
return z(xe, e);
|
|
258
306
|
}
|
|
259
|
-
var
|
|
307
|
+
var Ce = (e, t, n) => {
|
|
260
308
|
n.register({
|
|
261
309
|
name: e,
|
|
262
310
|
component: t
|
|
263
311
|
});
|
|
264
|
-
},
|
|
265
|
-
let t =
|
|
312
|
+
}, we = N("framework"), Te = R((e) => {
|
|
313
|
+
let t = we.store({}), n = M(t, { register(e, t) {
|
|
266
314
|
return {
|
|
267
315
|
...e,
|
|
268
316
|
[t.name]: t.framework
|
|
269
317
|
};
|
|
270
|
-
} }), i =
|
|
271
|
-
|
|
318
|
+
} }), i = F();
|
|
319
|
+
L({
|
|
272
320
|
clock: i,
|
|
273
321
|
source: t,
|
|
274
322
|
filter: (e, { name: t }) => e[t] !== void 0,
|
|
275
323
|
fn: (e, { name: t }) => `Framework '${t}' already registered. Registering again will override the previous registration.`
|
|
276
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
324
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
277
325
|
clock: i,
|
|
278
326
|
target: n.register
|
|
279
327
|
});
|
|
@@ -287,34 +335,34 @@ var B = (e, t, n) => {
|
|
|
287
335
|
listStore: a
|
|
288
336
|
};
|
|
289
337
|
});
|
|
290
|
-
function
|
|
291
|
-
return
|
|
338
|
+
function Ee(e) {
|
|
339
|
+
return z(Te, e);
|
|
292
340
|
}
|
|
293
|
-
var
|
|
341
|
+
var De = (e, t) => {
|
|
294
342
|
t.register({
|
|
295
343
|
name: e.name,
|
|
296
344
|
framework: e
|
|
297
345
|
});
|
|
298
|
-
},
|
|
346
|
+
}, Oe = R(({ client: e }) => {
|
|
299
347
|
let t = "window" in globalThis, n = {
|
|
300
348
|
location: t ? globalThis.location : void 0,
|
|
301
349
|
document: t ? globalThis.document : void 0,
|
|
302
350
|
sessionStorage: t ? globalThis.sessionStorage : void 0,
|
|
303
351
|
localStorage: t ? globalThis.localStorage : void 0
|
|
304
352
|
};
|
|
305
|
-
return
|
|
353
|
+
return j(e.responses.listStore, e.fields.listStore, (t, r) => Object.freeze({
|
|
306
354
|
client: e,
|
|
307
355
|
responses: t,
|
|
308
356
|
fields: r,
|
|
309
357
|
...n
|
|
310
358
|
}));
|
|
311
359
|
});
|
|
312
|
-
function
|
|
313
|
-
return
|
|
360
|
+
function ke(e) {
|
|
361
|
+
return z(Oe, e);
|
|
314
362
|
}
|
|
315
363
|
//#endregion
|
|
316
364
|
//#region src/logic-engine.ts
|
|
317
|
-
function
|
|
365
|
+
function Ae(e) {
|
|
318
366
|
return typeof e == "number" && !isNaN(e);
|
|
319
367
|
}
|
|
320
368
|
function V(e) {
|
|
@@ -323,70 +371,70 @@ function V(e) {
|
|
|
323
371
|
function H(e) {
|
|
324
372
|
return Array.isArray(e);
|
|
325
373
|
}
|
|
326
|
-
function
|
|
374
|
+
function je(e) {
|
|
327
375
|
return e instanceof Promise;
|
|
328
376
|
}
|
|
329
|
-
function
|
|
377
|
+
function Me(e) {
|
|
330
378
|
return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
|
|
331
379
|
}
|
|
332
|
-
function
|
|
333
|
-
if (
|
|
380
|
+
function U(e) {
|
|
381
|
+
if (Ae(e)) return e;
|
|
334
382
|
let t = parseFloat(`${e}`);
|
|
335
383
|
return isNaN(t) ? 0 : t;
|
|
336
384
|
}
|
|
337
|
-
function
|
|
385
|
+
function W(e) {
|
|
338
386
|
return `${e}`;
|
|
339
387
|
}
|
|
340
|
-
var
|
|
388
|
+
var Ne = {
|
|
341
389
|
"==": (e, t) => e == t,
|
|
342
390
|
"===": (e, t) => e === t,
|
|
343
391
|
"!=": (e, t) => e != t,
|
|
344
392
|
"!==": (e, t) => e !== t,
|
|
345
|
-
">": (e, t) =>
|
|
346
|
-
">=": (e, t) =>
|
|
393
|
+
">": (e, t) => U(e) > U(t),
|
|
394
|
+
">=": (e, t) => U(e) >= U(t),
|
|
347
395
|
"<": (e, t, n) => {
|
|
348
|
-
let r =
|
|
396
|
+
let r = U(e), i = U(t);
|
|
349
397
|
if (n === void 0) return r < i;
|
|
350
|
-
let a =
|
|
398
|
+
let a = U(n);
|
|
351
399
|
return r < i && i < a;
|
|
352
400
|
},
|
|
353
401
|
"<=": (e, t, n) => {
|
|
354
|
-
let r =
|
|
402
|
+
let r = U(e), i = U(t);
|
|
355
403
|
if (n === void 0) return r <= i;
|
|
356
|
-
let a =
|
|
404
|
+
let a = U(n);
|
|
357
405
|
return r <= i && i <= a;
|
|
358
406
|
},
|
|
359
|
-
"!!": async (e) => await
|
|
360
|
-
"!": async (e) => !await
|
|
361
|
-
"%": (e, t) =>
|
|
407
|
+
"!!": async (e) => await K(e),
|
|
408
|
+
"!": async (e) => !await K(e),
|
|
409
|
+
"%": (e, t) => U(e) % U(t),
|
|
362
410
|
log: (e) => (console.log(e), e),
|
|
363
|
-
in: (e, t) => t ? V(t) ? t.indexOf(
|
|
364
|
-
cat: (...e) => e.map(
|
|
411
|
+
in: (e, t) => t ? V(t) ? t.indexOf(W(e)) !== -1 : H(t) ? t.includes(e) : !1 : !1,
|
|
412
|
+
cat: (...e) => e.map(W).join(""),
|
|
365
413
|
substr: (e, t, n) => {
|
|
366
|
-
let r =
|
|
414
|
+
let r = W(e), i = U(t);
|
|
367
415
|
if (n === void 0) return r.substr(i);
|
|
368
|
-
let a =
|
|
416
|
+
let a = U(n);
|
|
369
417
|
if (a < 0) {
|
|
370
418
|
let e = r.substr(i);
|
|
371
419
|
return e.substr(0, e.length + a);
|
|
372
420
|
}
|
|
373
421
|
return r.substr(i, a);
|
|
374
422
|
},
|
|
375
|
-
"+": (...e) => e.reduce((e, t) =>
|
|
376
|
-
"*": (...e) => e.reduce((e, t) =>
|
|
423
|
+
"+": (...e) => e.reduce((e, t) => U(e) + U(t), 0),
|
|
424
|
+
"*": (...e) => e.reduce((e, t) => U(e) * U(t), 1),
|
|
377
425
|
"-": (e, t) => {
|
|
378
|
-
let n =
|
|
379
|
-
return t === void 0 ? -n : n -
|
|
426
|
+
let n = U(e);
|
|
427
|
+
return t === void 0 ? -n : n - U(t);
|
|
380
428
|
},
|
|
381
|
-
"/": (e, t) =>
|
|
382
|
-
min: (...e) => Math.min(...e.map(
|
|
383
|
-
max: (...e) => Math.max(...e.map(
|
|
429
|
+
"/": (e, t) => U(e) / U(t),
|
|
430
|
+
min: (...e) => Math.min(...e.map(U)),
|
|
431
|
+
max: (...e) => Math.max(...e.map(U)),
|
|
384
432
|
merge: (...e) => e.reduce((e, t) => H(t) ? e.concat(t) : e.concat([t]), []),
|
|
385
433
|
var(e, t) {
|
|
386
434
|
let n = arguments.length > 1 ? t : null;
|
|
387
435
|
if (e === "" || e === "." || e == null) return this;
|
|
388
436
|
if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
|
|
389
|
-
let r =
|
|
437
|
+
let r = W(e);
|
|
390
438
|
if (r === "" || r === ".") return this;
|
|
391
439
|
let i = r.split("."), a = this;
|
|
392
440
|
for (let e of i) {
|
|
@@ -401,16 +449,16 @@ var we = {
|
|
|
401
449
|
async missing(...e) {
|
|
402
450
|
let t = H(e[0]) ? e[0] : e, n = [];
|
|
403
451
|
for (let e of t) {
|
|
404
|
-
let t = await
|
|
452
|
+
let t = await G({ var: e }, this);
|
|
405
453
|
(t === null || t === "") && n.push(`${e}`);
|
|
406
454
|
}
|
|
407
455
|
return n;
|
|
408
456
|
},
|
|
409
457
|
async missing_some(e, t) {
|
|
410
|
-
let n = await
|
|
458
|
+
let n = await G({ missing: t }, this);
|
|
411
459
|
if (!H(n) || !H(t)) return [];
|
|
412
460
|
let r = n.filter(V);
|
|
413
|
-
return t.filter(V).length - r.length >=
|
|
461
|
+
return t.filter(V).length - r.length >= U(e) ? [] : r;
|
|
414
462
|
},
|
|
415
463
|
invoke(...e) {
|
|
416
464
|
let [t, ...n] = e;
|
|
@@ -424,101 +472,101 @@ var we = {
|
|
|
424
472
|
let [t, i] = e;
|
|
425
473
|
n = t, r = i;
|
|
426
474
|
}
|
|
427
|
-
return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(
|
|
475
|
+
return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(W(t));
|
|
428
476
|
},
|
|
429
477
|
throw(e) {
|
|
430
|
-
throw Error(
|
|
478
|
+
throw Error(W(e));
|
|
431
479
|
}
|
|
432
480
|
};
|
|
433
|
-
async function
|
|
481
|
+
async function G(e, t) {
|
|
434
482
|
if (!e) return e;
|
|
435
|
-
if (
|
|
436
|
-
if (H(e)) return Promise.all(e.map((e) =>
|
|
437
|
-
if (!
|
|
438
|
-
let n =
|
|
483
|
+
if (je(e)) return G(await e, t);
|
|
484
|
+
if (H(e)) return Promise.all(e.map((e) => G(e, t)));
|
|
485
|
+
if (!Me(e)) return e;
|
|
486
|
+
let n = Pe(e), r = n ? e[n] ?? [] : [];
|
|
439
487
|
switch (H(r) || (r = [r]), n) {
|
|
440
488
|
case "if":
|
|
441
489
|
case "?:":
|
|
442
|
-
for (let e = 0; e < r.length - 1; e += 2) if (await
|
|
443
|
-
return r.length % 2 == 1 ?
|
|
490
|
+
for (let e = 0; e < r.length - 1; e += 2) if (await K(await G(r[e], t))) return G(r[e + 1], t);
|
|
491
|
+
return r.length % 2 == 1 ? G(r[r.length - 1], t) : null;
|
|
444
492
|
case "and": {
|
|
445
493
|
let e = null;
|
|
446
|
-
for (let n of r) if (e = await
|
|
494
|
+
for (let n of r) if (e = await G(n, t), !await K(e)) return e;
|
|
447
495
|
return e;
|
|
448
496
|
}
|
|
449
497
|
case "or": {
|
|
450
498
|
let e = null;
|
|
451
|
-
for (let n of r) if (e = await
|
|
499
|
+
for (let n of r) if (e = await G(n, t), await K(e)) return e;
|
|
452
500
|
return e;
|
|
453
501
|
}
|
|
454
502
|
case "map": {
|
|
455
|
-
let e = await
|
|
456
|
-
return H(e) ? await Promise.all(e.map((e) =>
|
|
503
|
+
let e = await G(r[0], t);
|
|
504
|
+
return H(e) ? await Promise.all(e.map((e) => G(r[1], e))) : [];
|
|
457
505
|
}
|
|
458
506
|
case "filter": {
|
|
459
|
-
let e = await
|
|
507
|
+
let e = await G(r[0], t);
|
|
460
508
|
return H(e) ? (await Promise.all(e.map(async (e) => ({
|
|
461
509
|
item: e,
|
|
462
|
-
shouldInclude: await
|
|
510
|
+
shouldInclude: await K(await G(r[1], e))
|
|
463
511
|
})))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
|
|
464
512
|
}
|
|
465
513
|
case "reduce": {
|
|
466
|
-
let e = await
|
|
467
|
-
if (!H(e)) return r.length > 2 ? await
|
|
468
|
-
let n = r[1], i = r.length > 2 ? await
|
|
469
|
-
for (let t of e) i = await
|
|
514
|
+
let e = await G(r[0], t);
|
|
515
|
+
if (!H(e)) return r.length > 2 ? await G(r[2], t) : null;
|
|
516
|
+
let n = r[1], i = r.length > 2 ? await G(r[2], t) : null;
|
|
517
|
+
for (let t of e) i = await G(n, {
|
|
470
518
|
current: t,
|
|
471
519
|
accumulator: i
|
|
472
520
|
});
|
|
473
521
|
return i;
|
|
474
522
|
}
|
|
475
523
|
case "all": {
|
|
476
|
-
let e = await
|
|
524
|
+
let e = await G(r[0], t);
|
|
477
525
|
if (!H(e) || e.length === 0) return !1;
|
|
478
|
-
for (let t of e) if (!await
|
|
526
|
+
for (let t of e) if (!await K(await G(r[1], t))) return !1;
|
|
479
527
|
return !0;
|
|
480
528
|
}
|
|
481
529
|
case "some": {
|
|
482
|
-
let e = await
|
|
530
|
+
let e = await G(r[0], t);
|
|
483
531
|
if (!H(e)) return !1;
|
|
484
|
-
for (let t of e) if (await
|
|
532
|
+
for (let t of e) if (await K(await G(r[1], t))) return !0;
|
|
485
533
|
return !1;
|
|
486
534
|
}
|
|
487
535
|
case "none": {
|
|
488
|
-
let e = await
|
|
536
|
+
let e = await G(r[0], t);
|
|
489
537
|
if (!H(e)) return !0;
|
|
490
|
-
for (let t of e) if (await
|
|
538
|
+
for (let t of e) if (await K(await G(r[1], t))) return !1;
|
|
491
539
|
return !0;
|
|
492
540
|
}
|
|
493
541
|
case "catch": try {
|
|
494
|
-
return await
|
|
542
|
+
return await G(r[0], t);
|
|
495
543
|
} catch (e) {
|
|
496
|
-
return
|
|
544
|
+
return Me(e) ? await G(e, t) : r[1] ? await G(r[1], e) : e instanceof Error ? e.message : e;
|
|
497
545
|
}
|
|
498
546
|
}
|
|
499
|
-
let i = await Promise.all(r.map((e) =>
|
|
547
|
+
let i = await Promise.all(r.map((e) => G(e, t))), a = n ? Ne[n] : void 0;
|
|
500
548
|
if (!a) throw Error(`Unrecognized operation ${n}`);
|
|
501
549
|
return a.apply(t, i);
|
|
502
550
|
}
|
|
503
|
-
async function
|
|
504
|
-
return
|
|
551
|
+
async function K(e) {
|
|
552
|
+
return je(e) ? K(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
|
|
505
553
|
}
|
|
506
|
-
function
|
|
554
|
+
function Pe(e) {
|
|
507
555
|
return Object.keys(e)[0];
|
|
508
556
|
}
|
|
509
557
|
//#endregion
|
|
510
558
|
//#region src/lifecycle/rules-logic.ts
|
|
511
|
-
function
|
|
559
|
+
function q(e, t, n) {
|
|
512
560
|
return new Proxy(Object.create(null), { get(r, i) {
|
|
513
561
|
if (typeof i != "string") return;
|
|
514
562
|
let a = e.find((e) => e.key === i);
|
|
515
|
-
if (a !== void 0) return async () => n.has(i) ? !1 : await
|
|
563
|
+
if (a !== void 0) return async () => n.has(i) ? !1 : await G(a.logic, {
|
|
516
564
|
...t,
|
|
517
|
-
conditions:
|
|
565
|
+
conditions: q(e, t, new Set(n).add(i))
|
|
518
566
|
}) === !0;
|
|
519
567
|
} });
|
|
520
568
|
}
|
|
521
|
-
var
|
|
569
|
+
var Fe = R(({ client: e }) => A({
|
|
522
570
|
source: {
|
|
523
571
|
stateSnapshot: e.stateSnapshotStore,
|
|
524
572
|
predicates: e.predicates.listStore,
|
|
@@ -555,21 +603,21 @@ var De = L(({ client: e }) => k({
|
|
|
555
603
|
features: u,
|
|
556
604
|
...s
|
|
557
605
|
};
|
|
558
|
-
return await
|
|
606
|
+
return await G(o, {
|
|
559
607
|
...d,
|
|
560
|
-
conditions:
|
|
608
|
+
conditions: q(a, d, /* @__PURE__ */ new Set())
|
|
561
609
|
});
|
|
562
610
|
}
|
|
563
611
|
}));
|
|
564
|
-
function
|
|
565
|
-
return
|
|
612
|
+
function Ie(e) {
|
|
613
|
+
return z(Fe, e);
|
|
566
614
|
}
|
|
567
615
|
//#endregion
|
|
568
616
|
//#region src/ping.ts
|
|
569
|
-
var
|
|
617
|
+
var Le = 6e3, Re = k("last_ping", "global"), ze = async (e) => {
|
|
570
618
|
try {
|
|
571
|
-
let t = Date.now(), n =
|
|
572
|
-
if (n.isSet() && (r = n.json() ?? 0), r && t - r <
|
|
619
|
+
let t = Date.now(), n = D.get(Re), r = 0;
|
|
620
|
+
if (n.isSet() && (r = n.json() ?? 0), r && t - r < Le) return !0;
|
|
573
621
|
let i = {
|
|
574
622
|
projectId: e.projectId,
|
|
575
623
|
path: window.location.pathname
|
|
@@ -580,120 +628,120 @@ var ke = 6e3, Ae = O("last_ping", "global"), je = async (e) => {
|
|
|
580
628
|
} catch {
|
|
581
629
|
return !1;
|
|
582
630
|
}
|
|
583
|
-
}, J =
|
|
584
|
-
let t = J.store(!1), r =
|
|
631
|
+
}, J = N("lifecycle"), Be = R(({ client: e }) => {
|
|
632
|
+
let t = J.store(!1), r = I(void 0, {
|
|
585
633
|
skipVoid: !1,
|
|
586
634
|
domain: J
|
|
587
|
-
}), i =
|
|
635
|
+
}), i = I(void 0, {
|
|
588
636
|
skipVoid: !1,
|
|
589
637
|
domain: J
|
|
590
|
-
}), a = J.store("idle"), o = J.store([]), s =
|
|
638
|
+
}), a = J.store("idle"), o = J.store([]), s = I(void 0, {
|
|
591
639
|
skipVoid: !1,
|
|
592
640
|
domain: J
|
|
593
|
-
}), l =
|
|
641
|
+
}), l = I(void 0, {
|
|
594
642
|
skipVoid: !1,
|
|
595
643
|
domain: J
|
|
596
|
-
}), u =
|
|
644
|
+
}), u = F(), d = F(), f = F(), p = F(), m = F(), h = F();
|
|
597
645
|
o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
|
|
598
|
-
let g =
|
|
599
|
-
|
|
600
|
-
}), _ =
|
|
646
|
+
let g = P(() => {
|
|
647
|
+
ze(e);
|
|
648
|
+
}), _ = P(async () => {
|
|
601
649
|
await ee();
|
|
602
|
-
}), v =
|
|
603
|
-
await
|
|
604
|
-
}), y =
|
|
650
|
+
}), v = P(async () => {
|
|
651
|
+
await he(e);
|
|
652
|
+
}), y = A({ effect: v }), b = A({
|
|
605
653
|
source: o,
|
|
606
654
|
effect: async (e) => {
|
|
607
655
|
for (let t of e) await t();
|
|
608
656
|
}
|
|
609
|
-
}), x =
|
|
657
|
+
}), x = A({
|
|
610
658
|
source: s,
|
|
611
659
|
effect: async (t) => t === void 0 ? !0 : typeof t == "boolean" ? t : await n(e, t) === !0
|
|
612
|
-
}), S =
|
|
660
|
+
}), S = A({
|
|
613
661
|
source: l,
|
|
614
662
|
effect: async (t) => t === void 0 ? !0 : typeof t == "boolean" ? t : await n(e, t) === !0
|
|
615
|
-
}), C =
|
|
663
|
+
}), C = L({
|
|
616
664
|
clock: u,
|
|
617
665
|
source: a,
|
|
618
666
|
filter: (e) => e === "idle" && c(),
|
|
619
667
|
fn: () => void 0
|
|
620
668
|
});
|
|
621
|
-
|
|
669
|
+
L({
|
|
622
670
|
clock: C,
|
|
623
671
|
fn: () => "starting",
|
|
624
672
|
target: a
|
|
625
|
-
}),
|
|
673
|
+
}), L({
|
|
626
674
|
clock: C,
|
|
627
675
|
target: g
|
|
628
|
-
}),
|
|
676
|
+
}), L({
|
|
629
677
|
clock: C,
|
|
630
678
|
target: b
|
|
631
|
-
}),
|
|
679
|
+
}), L({
|
|
632
680
|
clock: C,
|
|
633
681
|
target: _
|
|
634
|
-
}),
|
|
682
|
+
}), L({
|
|
635
683
|
clock: b.done,
|
|
636
684
|
target: x
|
|
637
|
-
}),
|
|
685
|
+
}), L({
|
|
638
686
|
clock: x.doneData,
|
|
639
687
|
target: r
|
|
640
|
-
}),
|
|
688
|
+
}), L({
|
|
641
689
|
clock: S.doneData,
|
|
642
690
|
target: i
|
|
643
|
-
}),
|
|
691
|
+
}), L({
|
|
644
692
|
clock: x.doneData,
|
|
645
693
|
filter: (e) => e,
|
|
646
694
|
target: S
|
|
647
|
-
}),
|
|
695
|
+
}), L({
|
|
648
696
|
clock: S.doneData,
|
|
649
697
|
target: e.session.setIsUser
|
|
650
|
-
}),
|
|
698
|
+
}), L({
|
|
651
699
|
clock: S.doneData,
|
|
652
700
|
fn: (e) => ({
|
|
653
701
|
type: "user_decide",
|
|
654
702
|
value: e
|
|
655
703
|
}),
|
|
656
704
|
target: e.eventBus
|
|
657
|
-
}),
|
|
705
|
+
}), L({
|
|
658
706
|
clock: x.doneData,
|
|
659
707
|
filter: (e) => !e,
|
|
660
708
|
fn: () => void 0,
|
|
661
709
|
target: f
|
|
662
|
-
}),
|
|
710
|
+
}), L({
|
|
663
711
|
clock: S.doneData,
|
|
664
712
|
fn: () => void 0,
|
|
665
713
|
target: f
|
|
666
|
-
}),
|
|
714
|
+
}), L({
|
|
667
715
|
clock: f,
|
|
668
716
|
fn: () => ({ type: "initialize" }),
|
|
669
717
|
target: e.eventBus
|
|
670
718
|
});
|
|
671
|
-
let w =
|
|
672
|
-
return
|
|
719
|
+
let w = I(!1).on(_.done, () => !0), T = I(!1).on(f, () => !0), E = I(!1).on(y.done, () => !0), D = j(r, i, (e, t) => e === !0 && t === !0);
|
|
720
|
+
return L({
|
|
673
721
|
clock: f,
|
|
674
722
|
source: D,
|
|
675
723
|
filter: (e) => e,
|
|
676
724
|
fn: () => void 0,
|
|
677
725
|
target: v
|
|
678
|
-
}),
|
|
679
|
-
clock:
|
|
726
|
+
}), L({
|
|
727
|
+
clock: j(w, T, D, (e, t, n) => e && t && n),
|
|
680
728
|
filter: (e) => e,
|
|
681
729
|
fn: () => void 0,
|
|
682
730
|
target: y
|
|
683
|
-
}),
|
|
684
|
-
clock:
|
|
731
|
+
}), L({
|
|
732
|
+
clock: j(w, T, D, E, (e, t, n, r) => e && t && (!n || r)),
|
|
685
733
|
filter: (e) => e,
|
|
686
734
|
fn: () => void 0,
|
|
687
735
|
target: d
|
|
688
|
-
}),
|
|
736
|
+
}), L({
|
|
689
737
|
clock: d,
|
|
690
738
|
fn: () => "ready",
|
|
691
739
|
target: a
|
|
692
|
-
}),
|
|
740
|
+
}), L({
|
|
693
741
|
clock: d,
|
|
694
742
|
fn: () => ({ type: "ready" }),
|
|
695
743
|
target: e.eventBus
|
|
696
|
-
}),
|
|
744
|
+
}), L({
|
|
697
745
|
clock: d,
|
|
698
746
|
source: e.session.store,
|
|
699
747
|
fn: ({ id: e, isUser: t, identifiers: n }) => ({
|
|
@@ -703,7 +751,7 @@ var ke = 6e3, Ae = O("last_ping", "global"), je = async (e) => {
|
|
|
703
751
|
identifiers: n
|
|
704
752
|
}),
|
|
705
753
|
target: e.eventBus
|
|
706
|
-
}),
|
|
754
|
+
}), L({
|
|
707
755
|
clock: [
|
|
708
756
|
b.fail,
|
|
709
757
|
x.fail,
|
|
@@ -725,13 +773,13 @@ var ke = 6e3, Ae = O("last_ping", "global"), je = async (e) => {
|
|
|
725
773
|
setCondition: h
|
|
726
774
|
};
|
|
727
775
|
});
|
|
728
|
-
function
|
|
729
|
-
return
|
|
776
|
+
function Ve(e) {
|
|
777
|
+
return z(Be, e);
|
|
730
778
|
}
|
|
731
779
|
//#endregion
|
|
732
780
|
//#region src/entities/predicate/predicate.ts
|
|
733
|
-
var
|
|
734
|
-
let t =
|
|
781
|
+
var He = N("predicate"), Ue = R(({ client: e }) => {
|
|
782
|
+
let t = He.store({}), n = M(t, { register(e, t) {
|
|
735
783
|
return {
|
|
736
784
|
...e,
|
|
737
785
|
[t.name]: {
|
|
@@ -739,13 +787,13 @@ var Pe = M("predicate"), Fe = L(({ client: e }) => {
|
|
|
739
787
|
predicate: t.predicate
|
|
740
788
|
}
|
|
741
789
|
};
|
|
742
|
-
} }), i =
|
|
743
|
-
|
|
790
|
+
} }), i = F();
|
|
791
|
+
L({
|
|
744
792
|
clock: i,
|
|
745
793
|
source: t,
|
|
746
794
|
filter: (e, { name: t }) => e[t] !== void 0,
|
|
747
795
|
fn: (e, { name: t }) => `Predicate '${t}' already registered. Registering again will override the previous registration.`
|
|
748
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
796
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
749
797
|
clock: i,
|
|
750
798
|
fn: ({ name: e, predicate: t }) => Object.freeze({
|
|
751
799
|
name: e,
|
|
@@ -758,7 +806,7 @@ var Pe = M("predicate"), Fe = L(({ client: e }) => {
|
|
|
758
806
|
return t.map((t) => t[e]?.predicate, { skipVoid: !1 });
|
|
759
807
|
}
|
|
760
808
|
function s(t) {
|
|
761
|
-
let n =
|
|
809
|
+
let n = I(() => void 0, { skipVoid: !1 }), r = A({
|
|
762
810
|
source: {
|
|
763
811
|
predicate: o(t),
|
|
764
812
|
snapshot: e.stateSnapshotStore
|
|
@@ -770,13 +818,13 @@ var Pe = M("predicate"), Fe = L(({ client: e }) => {
|
|
|
770
818
|
});
|
|
771
819
|
}
|
|
772
820
|
});
|
|
773
|
-
return
|
|
821
|
+
return L({
|
|
774
822
|
source: {
|
|
775
823
|
responses: e.responses.listStore,
|
|
776
824
|
fields: e.fields.listStore
|
|
777
825
|
},
|
|
778
826
|
target: r
|
|
779
|
-
}),
|
|
827
|
+
}), L({
|
|
780
828
|
clock: r.doneData,
|
|
781
829
|
filter: (e) => e !== void 0,
|
|
782
830
|
target: n
|
|
@@ -789,27 +837,27 @@ var Pe = M("predicate"), Fe = L(({ client: e }) => {
|
|
|
789
837
|
getEvokablePredicate: s
|
|
790
838
|
};
|
|
791
839
|
});
|
|
792
|
-
function
|
|
793
|
-
return
|
|
840
|
+
function We(e) {
|
|
841
|
+
return z(Ue, e);
|
|
794
842
|
}
|
|
795
|
-
var
|
|
843
|
+
var Ge = (e, t, n) => {
|
|
796
844
|
n.register({
|
|
797
845
|
name: e,
|
|
798
846
|
predicate: t
|
|
799
847
|
});
|
|
800
|
-
},
|
|
801
|
-
let t =
|
|
848
|
+
}, Ke = N("feature"), qe = R(({ client: e }) => {
|
|
849
|
+
let t = Ke.store({}), n = Ke.store([]), i = M(t, { register(e, t) {
|
|
802
850
|
return {
|
|
803
851
|
...e,
|
|
804
852
|
[t.id]: t.feature
|
|
805
853
|
};
|
|
806
|
-
} }), a =
|
|
807
|
-
|
|
854
|
+
} }), a = F();
|
|
855
|
+
L({
|
|
808
856
|
clock: a,
|
|
809
857
|
source: t,
|
|
810
858
|
filter: (e, { id: t }) => e[t] !== void 0,
|
|
811
859
|
fn: (e, { id: t }) => `Feature '${t}' already registered. Registering again will override the previous registration.`
|
|
812
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
860
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
813
861
|
clock: a,
|
|
814
862
|
fn: ({ id: e, feature: t }) => Object.freeze({
|
|
815
863
|
id: e,
|
|
@@ -823,19 +871,19 @@ var Le = (e, t, n) => {
|
|
|
823
871
|
}),
|
|
824
872
|
target: i.register
|
|
825
873
|
});
|
|
826
|
-
let o =
|
|
827
|
-
let r =
|
|
874
|
+
let o = P(async ({ id: e, key: t, storage: n = "local" }) => {
|
|
875
|
+
let r = k(`feature:${e}:${t}`, "global"), i = (n === "session" ? O : D).get(r).boolean();
|
|
828
876
|
return i === null ? null : {
|
|
829
877
|
id: e,
|
|
830
878
|
key: t,
|
|
831
879
|
bucket: i,
|
|
832
880
|
storage: n
|
|
833
881
|
};
|
|
834
|
-
}), s =
|
|
882
|
+
}), s = P((e) => {
|
|
835
883
|
if (!e) return null;
|
|
836
|
-
let t =
|
|
837
|
-
(e.storage === "session" ?
|
|
838
|
-
}), c = /* @__PURE__ */ new Map(), l =
|
|
884
|
+
let t = k(`feature:${e.id}:${e.key}`, "global");
|
|
885
|
+
(e.storage === "session" ? O : D).set(t, e.bucket);
|
|
886
|
+
}), c = /* @__PURE__ */ new Map(), l = A({
|
|
839
887
|
source: {
|
|
840
888
|
allFeaturesStore: t,
|
|
841
889
|
resolvedFeaturesStore: n
|
|
@@ -866,7 +914,7 @@ var Le = (e, t, n) => {
|
|
|
866
914
|
};
|
|
867
915
|
}
|
|
868
916
|
});
|
|
869
|
-
|
|
917
|
+
L({
|
|
870
918
|
clock: i.register,
|
|
871
919
|
fn: (e) => {
|
|
872
920
|
let { id: t, feature: n } = e;
|
|
@@ -877,7 +925,7 @@ var Le = (e, t, n) => {
|
|
|
877
925
|
};
|
|
878
926
|
},
|
|
879
927
|
target: o
|
|
880
|
-
}),
|
|
928
|
+
}), L({
|
|
881
929
|
source: t,
|
|
882
930
|
clock: l.doneData,
|
|
883
931
|
fn: (e, t) => {
|
|
@@ -891,7 +939,7 @@ var Le = (e, t, n) => {
|
|
|
891
939
|
},
|
|
892
940
|
target: s
|
|
893
941
|
});
|
|
894
|
-
let u =
|
|
942
|
+
let u = j({
|
|
895
943
|
allFeaturesStore: t,
|
|
896
944
|
resolvedFeaturesStore: n
|
|
897
945
|
}).map(({ allFeaturesStore: e, resolvedFeaturesStore: t }) => Object.values(e).map((e) => {
|
|
@@ -913,7 +961,7 @@ var Le = (e, t, n) => {
|
|
|
913
961
|
isResolved: !1
|
|
914
962
|
};
|
|
915
963
|
}));
|
|
916
|
-
|
|
964
|
+
L({
|
|
917
965
|
clock: l.doneData,
|
|
918
966
|
source: { resolvedFeatures: n },
|
|
919
967
|
filter: ({ resolvedFeatures: e }, { id: t, key: n }) => !e.some((e) => e.id === t && e.key === n),
|
|
@@ -922,7 +970,7 @@ var Le = (e, t, n) => {
|
|
|
922
970
|
type: "feature_decide",
|
|
923
971
|
feature: e
|
|
924
972
|
}))
|
|
925
|
-
}),
|
|
973
|
+
}), L({
|
|
926
974
|
clock: [o.doneData, l.doneData],
|
|
927
975
|
source: n,
|
|
928
976
|
fn: (e, t) => !t || e.some((e) => e.id === t.id && e.key === t.key) ? e : [...e, t],
|
|
@@ -935,17 +983,17 @@ var Le = (e, t, n) => {
|
|
|
935
983
|
return t.map((t) => t[e], { skipVoid: !1 });
|
|
936
984
|
}
|
|
937
985
|
function p(e) {
|
|
938
|
-
let t =
|
|
986
|
+
let t = I(async () => void 0, { skipVoid: !1 }), r = A({
|
|
939
987
|
source: d(e),
|
|
940
988
|
effect: async (e) => {
|
|
941
989
|
if (e) return async () => (await e.getBucket()).bucket;
|
|
942
990
|
}
|
|
943
991
|
});
|
|
944
|
-
return
|
|
992
|
+
return L({
|
|
945
993
|
source: n,
|
|
946
994
|
filter: (t) => t.some((t) => t.id === e),
|
|
947
995
|
target: r
|
|
948
|
-
}),
|
|
996
|
+
}), L({
|
|
949
997
|
clock: r.doneData,
|
|
950
998
|
filter: (e) => e !== void 0,
|
|
951
999
|
target: t
|
|
@@ -959,69 +1007,115 @@ var Le = (e, t, n) => {
|
|
|
959
1007
|
getEvokableFeature: p
|
|
960
1008
|
};
|
|
961
1009
|
});
|
|
962
|
-
function
|
|
963
|
-
return
|
|
1010
|
+
function Je(e) {
|
|
1011
|
+
return z(qe, e);
|
|
964
1012
|
}
|
|
965
|
-
var
|
|
1013
|
+
var Ye = (e, t, n) => {
|
|
966
1014
|
n.register({
|
|
967
1015
|
id: e,
|
|
968
1016
|
feature: t
|
|
969
1017
|
});
|
|
970
|
-
}, Y =
|
|
971
|
-
function
|
|
1018
|
+
}, Y = N("history");
|
|
1019
|
+
function X(e, t, n) {
|
|
972
1020
|
return {
|
|
973
|
-
id: re(
|
|
974
|
-
node:
|
|
1021
|
+
id: re("history-entry"),
|
|
1022
|
+
node: n,
|
|
975
1023
|
at: Date.now(),
|
|
976
|
-
|
|
1024
|
+
instanceId: e,
|
|
1025
|
+
experienceId: t
|
|
977
1026
|
};
|
|
978
1027
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1028
|
+
function Xe(e) {
|
|
1029
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
1030
|
+
let n = e[t];
|
|
1031
|
+
if (n && T(n.node)) return e.slice(0, t + 1);
|
|
1032
|
+
}
|
|
1033
|
+
return [];
|
|
1034
|
+
}
|
|
1035
|
+
var Ze = R(() => {
|
|
1036
|
+
let e = Y.store([]), t = Y.event(), n = Y.event(), r = Y.event(), i = Y.event(), a = Y.event(), o = Y.event(), s = Y.event(), c = Y.event();
|
|
1037
|
+
e.on(t, (e, t) => [...e, X(t.instanceId ?? t.experienceId, t.experienceId, t.node)]), e.on(n, (e, t) => {
|
|
1038
|
+
let n = t.instanceId ?? t.experienceId, r = X(n, t.experienceId, t.node), i = -1;
|
|
1039
|
+
for (let t = e.length - 1; t >= 0; t--) if (e[t]?.instanceId === n) {
|
|
1040
|
+
i = t;
|
|
1041
|
+
break;
|
|
1042
|
+
}
|
|
1043
|
+
return i === -1 ? [...e, r] : [
|
|
1044
|
+
...e.slice(0, i),
|
|
1045
|
+
r,
|
|
1046
|
+
...e.slice(i + 1)
|
|
1047
|
+
];
|
|
1048
|
+
}), e.on(r, (e, t) => {
|
|
1049
|
+
let n = (e) => (t.instanceId === void 0 || e.instanceId === t.instanceId) && (t.experienceId === void 0 || e.experienceId === t.experienceId), r = 0, i = -1;
|
|
1050
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
1051
|
+
let a = e[t];
|
|
1052
|
+
if (!(!a || !n(a) || !T(a.node)) && ++r === 2) {
|
|
1053
|
+
i = t;
|
|
992
1054
|
break;
|
|
993
1055
|
}
|
|
994
1056
|
}
|
|
1057
|
+
return i === -1 ? e : e.filter((e, t) => !n(e) || t <= i);
|
|
1058
|
+
}), e.on(i, (e, { entries: t }) => t.map((e) => ({
|
|
1059
|
+
...e,
|
|
1060
|
+
instanceId: e.instanceId ?? e.experienceId
|
|
1061
|
+
}))), e.on(a, (e, { snapshots: t }) => {
|
|
1062
|
+
let n = new Set(e.map((e) => e.experienceId)), r = [];
|
|
1063
|
+
for (let e of Object.keys(t)) {
|
|
1064
|
+
if (n.has(e)) continue;
|
|
1065
|
+
let i = t[e];
|
|
1066
|
+
i && r.push(...i);
|
|
1067
|
+
}
|
|
1068
|
+
return r.length === 0 ? e : [...e, ...r];
|
|
1069
|
+
}), e.on(c, (e, t) => [...e, ...t]), e.on(s, (e, { instanceId: t }) => {
|
|
1070
|
+
let n = e.filter((e) => e.instanceId !== t);
|
|
1071
|
+
return n.length === e.length ? e : n;
|
|
1072
|
+
});
|
|
1073
|
+
let l = e.map((e) => {
|
|
1074
|
+
let t = /* @__PURE__ */ new Map();
|
|
1075
|
+
for (let n of e) t.set(n.experienceId, n.instanceId);
|
|
1076
|
+
let n = {};
|
|
1077
|
+
for (let r of e) {
|
|
1078
|
+
if (t.get(r.experienceId) !== r.instanceId) continue;
|
|
1079
|
+
let e = n[r.experienceId] ?? [];
|
|
1080
|
+
e.push(r), n[r.experienceId] = e;
|
|
1081
|
+
}
|
|
995
1082
|
return n;
|
|
996
|
-
}
|
|
997
|
-
return
|
|
998
|
-
|
|
999
|
-
|
|
1083
|
+
});
|
|
1084
|
+
return L({
|
|
1085
|
+
clock: o,
|
|
1086
|
+
source: l,
|
|
1087
|
+
fn: (e, { instanceId: t, experienceId: n }) => Xe(e[n] ?? []).map((e) => ({
|
|
1000
1088
|
...e,
|
|
1001
|
-
|
|
1002
|
-
|
|
1089
|
+
id: re("history-entry"),
|
|
1090
|
+
instanceId: t
|
|
1091
|
+
})),
|
|
1092
|
+
target: c
|
|
1003
1093
|
}), {
|
|
1004
1094
|
push: t,
|
|
1005
1095
|
replace: n,
|
|
1006
1096
|
back: r,
|
|
1007
1097
|
restore: i,
|
|
1008
|
-
|
|
1098
|
+
restoreSnapshots: a,
|
|
1099
|
+
seedInstanceFromSnapshot: o,
|
|
1100
|
+
clearForInstance: s,
|
|
1101
|
+
entriesStore: e,
|
|
1102
|
+
snapshotStore: l
|
|
1009
1103
|
};
|
|
1010
1104
|
});
|
|
1011
|
-
function
|
|
1012
|
-
return
|
|
1105
|
+
function Qe() {
|
|
1106
|
+
return z(Ze);
|
|
1013
1107
|
}
|
|
1014
1108
|
//#endregion
|
|
1015
1109
|
//#region src/utils/events.ts
|
|
1016
|
-
var
|
|
1017
|
-
let t =
|
|
1110
|
+
var $e = 0, et = (e) => {
|
|
1111
|
+
let t = I([]);
|
|
1018
1112
|
return t.on(e, (e, t) => [...e, {
|
|
1019
|
-
id:
|
|
1113
|
+
id: $e++,
|
|
1020
1114
|
at: /* @__PURE__ */ new Date(),
|
|
1021
1115
|
payload: t
|
|
1022
1116
|
}]), t;
|
|
1023
|
-
},
|
|
1024
|
-
let e =
|
|
1117
|
+
}, tt = N("field"), nt = R(() => {
|
|
1118
|
+
let e = tt.store({}), t = M(e, {
|
|
1025
1119
|
register(e, t) {
|
|
1026
1120
|
return {
|
|
1027
1121
|
...e,
|
|
@@ -1069,13 +1163,13 @@ var Ge = 0, Ke = (e) => {
|
|
|
1069
1163
|
getByName: c
|
|
1070
1164
|
};
|
|
1071
1165
|
});
|
|
1072
|
-
function
|
|
1073
|
-
return
|
|
1166
|
+
function rt() {
|
|
1167
|
+
return z(nt);
|
|
1074
1168
|
}
|
|
1075
1169
|
//#endregion
|
|
1076
1170
|
//#region src/entities/step/step.ts
|
|
1077
|
-
var
|
|
1078
|
-
let e =
|
|
1171
|
+
var it = N("step"), at = R(() => {
|
|
1172
|
+
let e = it.store({}), t = M(e, { register(e, t) {
|
|
1079
1173
|
return {
|
|
1080
1174
|
...e,
|
|
1081
1175
|
[t.step.id]: t.step
|
|
@@ -1099,16 +1193,16 @@ var Xe = M("step"), Ze = L(() => {
|
|
|
1099
1193
|
indexStore: e
|
|
1100
1194
|
};
|
|
1101
1195
|
});
|
|
1102
|
-
function
|
|
1103
|
-
return
|
|
1196
|
+
function ot() {
|
|
1197
|
+
return z(at);
|
|
1104
1198
|
}
|
|
1105
|
-
function
|
|
1199
|
+
function st(e, t) {
|
|
1106
1200
|
t.register(e);
|
|
1107
1201
|
}
|
|
1108
1202
|
//#endregion
|
|
1109
1203
|
//#region src/entities/content/content.ts
|
|
1110
|
-
var
|
|
1111
|
-
let e =
|
|
1204
|
+
var ct = N("content"), lt = R(() => {
|
|
1205
|
+
let e = ct.store({}), t = M(e, { register(e, t) {
|
|
1112
1206
|
return {
|
|
1113
1207
|
...e,
|
|
1114
1208
|
[t.content.id]: t.content
|
|
@@ -1128,16 +1222,16 @@ var et = M("content"), tt = L(() => {
|
|
|
1128
1222
|
indexStore: e
|
|
1129
1223
|
};
|
|
1130
1224
|
});
|
|
1131
|
-
function
|
|
1132
|
-
return
|
|
1225
|
+
function ut() {
|
|
1226
|
+
return z(lt);
|
|
1133
1227
|
}
|
|
1134
|
-
function
|
|
1228
|
+
function dt(e, t) {
|
|
1135
1229
|
t.register(e);
|
|
1136
1230
|
}
|
|
1137
1231
|
//#endregion
|
|
1138
1232
|
//#region src/entities/action/action.ts
|
|
1139
|
-
var
|
|
1140
|
-
let t =
|
|
1233
|
+
var ft = N("action"), pt = R(({ client: e }) => {
|
|
1234
|
+
let t = ft.store({}), n = M(t, { register(e, t) {
|
|
1141
1235
|
return {
|
|
1142
1236
|
...e,
|
|
1143
1237
|
[t.key]: {
|
|
@@ -1145,13 +1239,13 @@ var it = M("action"), at = L(({ client: e }) => {
|
|
|
1145
1239
|
action: t.action
|
|
1146
1240
|
}
|
|
1147
1241
|
};
|
|
1148
|
-
} }), i =
|
|
1149
|
-
|
|
1242
|
+
} }), i = F();
|
|
1243
|
+
L({
|
|
1150
1244
|
clock: i,
|
|
1151
1245
|
source: t,
|
|
1152
1246
|
filter: (e, { key: t }) => e[t] !== void 0,
|
|
1153
1247
|
fn: (e, { key: t }) => `Action '${t}' already registered. Registering again will override the previous registration.`
|
|
1154
|
-
}).watch((e) => /* @__PURE__ */ r("warn", e)),
|
|
1248
|
+
}).watch((e) => /* @__PURE__ */ r("warn", e)), L({
|
|
1155
1249
|
clock: i,
|
|
1156
1250
|
fn: ({ key: e, action: t }) => Object.freeze({
|
|
1157
1251
|
key: e,
|
|
@@ -1164,7 +1258,7 @@ var it = M("action"), at = L(({ client: e }) => {
|
|
|
1164
1258
|
return t.map((t) => t[e]?.action, { skipVoid: !1 });
|
|
1165
1259
|
}
|
|
1166
1260
|
function s(t, n) {
|
|
1167
|
-
let r =
|
|
1261
|
+
let r = I(() => void 0, { skipVoid: !1 }), i = n ? { experience: n.experience } : null, a = A({
|
|
1168
1262
|
source: {
|
|
1169
1263
|
action: o(t),
|
|
1170
1264
|
snapshot: e.stateSnapshotStore
|
|
@@ -1176,13 +1270,13 @@ var it = M("action"), at = L(({ client: e }) => {
|
|
|
1176
1270
|
}, i);
|
|
1177
1271
|
}
|
|
1178
1272
|
});
|
|
1179
|
-
return
|
|
1273
|
+
return L({
|
|
1180
1274
|
source: {
|
|
1181
1275
|
responses: e.responses.listStore,
|
|
1182
1276
|
fields: e.fields.listStore
|
|
1183
1277
|
},
|
|
1184
1278
|
target: a
|
|
1185
|
-
}),
|
|
1279
|
+
}), L({
|
|
1186
1280
|
clock: a.doneData,
|
|
1187
1281
|
filter: (e) => e !== void 0,
|
|
1188
1282
|
target: r
|
|
@@ -1195,10 +1289,10 @@ var it = M("action"), at = L(({ client: e }) => {
|
|
|
1195
1289
|
getEvokableAction: s
|
|
1196
1290
|
};
|
|
1197
1291
|
});
|
|
1198
|
-
function
|
|
1199
|
-
return
|
|
1292
|
+
function mt(e) {
|
|
1293
|
+
return z(pt, e);
|
|
1200
1294
|
}
|
|
1201
|
-
var
|
|
1295
|
+
var ht = (e, t, n) => {
|
|
1202
1296
|
n.register({
|
|
1203
1297
|
key: e,
|
|
1204
1298
|
action: t
|
|
@@ -1206,7 +1300,7 @@ var st = (e, t, n) => {
|
|
|
1206
1300
|
};
|
|
1207
1301
|
//#endregion
|
|
1208
1302
|
//#region src/entities/response/response-validation.ts
|
|
1209
|
-
function
|
|
1303
|
+
function Z(e, t, n, r) {
|
|
1210
1304
|
return {
|
|
1211
1305
|
fieldKey: e.key,
|
|
1212
1306
|
userMessage: n,
|
|
@@ -1214,62 +1308,62 @@ function X(e, t, n, r) {
|
|
|
1214
1308
|
value: t
|
|
1215
1309
|
};
|
|
1216
1310
|
}
|
|
1217
|
-
function
|
|
1311
|
+
function Q(e) {
|
|
1218
1312
|
return e === null || e === "" || Array.isArray(e) && !e.length;
|
|
1219
1313
|
}
|
|
1220
|
-
function
|
|
1314
|
+
function gt(e) {
|
|
1221
1315
|
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
|
|
1222
1316
|
}
|
|
1223
|
-
function
|
|
1317
|
+
function _t(e) {
|
|
1224
1318
|
try {
|
|
1225
1319
|
return JSON.stringify(e), !0;
|
|
1226
1320
|
} catch {
|
|
1227
1321
|
return !1;
|
|
1228
1322
|
}
|
|
1229
1323
|
}
|
|
1230
|
-
function
|
|
1324
|
+
function vt(e, t) {
|
|
1231
1325
|
return t.find((t) => t.key === e) ?? null;
|
|
1232
1326
|
}
|
|
1233
|
-
function
|
|
1327
|
+
function yt(e, t) {
|
|
1234
1328
|
return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
|
|
1235
1329
|
}
|
|
1236
|
-
function
|
|
1237
|
-
if (e.type !== "object" ||
|
|
1330
|
+
function bt(e, t) {
|
|
1331
|
+
if (e.type !== "object" || Q(t)) return null;
|
|
1238
1332
|
if (e.multiple) {
|
|
1239
|
-
if (!Array.isArray(t)) return
|
|
1333
|
+
if (!Array.isArray(t)) return Z(e, t, "This field expects multiple values", "Field expects an array of objects.");
|
|
1240
1334
|
for (let n of t) {
|
|
1241
|
-
if (typeof n != "object" || !n) return
|
|
1242
|
-
if (!
|
|
1335
|
+
if (typeof n != "object" || !n) return Z(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
|
|
1336
|
+
if (!_t(n)) return Z(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1243
1337
|
}
|
|
1244
1338
|
return null;
|
|
1245
1339
|
}
|
|
1246
|
-
return Array.isArray(t) ?
|
|
1340
|
+
return Array.isArray(t) ? Z(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Z(e, t, "This field expects an object value", "Field expects an object value.") : _t(t) ? null : Z(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
|
|
1247
1341
|
}
|
|
1248
|
-
function
|
|
1249
|
-
if (
|
|
1342
|
+
function xt(e, t) {
|
|
1343
|
+
if (Q(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
|
|
1250
1344
|
let n = Array.isArray(t) ? t : [t];
|
|
1251
1345
|
if (e.type === "object") {
|
|
1252
1346
|
let r = new Set(e.options.map((e) => JSON.stringify(e.value)));
|
|
1253
|
-
return n.every((e) => r.has(JSON.stringify(e))) ? null :
|
|
1347
|
+
return n.every((e) => r.has(JSON.stringify(e))) ? null : Z(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
|
|
1254
1348
|
}
|
|
1255
1349
|
let r = e.options.map((e) => e.value);
|
|
1256
|
-
return n.every((e) => !
|
|
1350
|
+
return n.every((e) => !gt(e) || e === null ? !1 : r.includes(e)) ? null : Z(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
|
|
1257
1351
|
}
|
|
1258
|
-
async function
|
|
1259
|
-
if (n.validation && !e(n.validation) && !
|
|
1352
|
+
async function St(t, n, r, i) {
|
|
1353
|
+
if (n.validation && !e(n.validation) && !Q(r)) {
|
|
1260
1354
|
let e = i ? {
|
|
1261
1355
|
$input: r,
|
|
1262
1356
|
responses: i
|
|
1263
1357
|
} : { $input: r }, a = await t(n.validation, e);
|
|
1264
|
-
if (typeof a == "string") return
|
|
1265
|
-
if (a === !1) return
|
|
1358
|
+
if (typeof a == "string") return Z(n, r, a, `Field validation resulted in an error: ${a}.`);
|
|
1359
|
+
if (a === !1) return Z(n, r, "This field is invalid", "Field validation resulted in an unspecified error.");
|
|
1266
1360
|
}
|
|
1267
|
-
return n.required &&
|
|
1361
|
+
return n.required && Q(r) ? Z(n, r, "This field is required", "Field is required.") : !n.multiple && Array.isArray(r) && r.length > 1 ? Z(n, r, "This field expects a single response", "Field expects a single response.") : null;
|
|
1268
1362
|
}
|
|
1269
1363
|
//#endregion
|
|
1270
1364
|
//#region src/entities/response/response.ts
|
|
1271
|
-
var
|
|
1272
|
-
let t =
|
|
1365
|
+
var Ct = N("response"), wt = R(({ client: e }) => {
|
|
1366
|
+
let t = Ct.store({}), r = F(), i = F(), a = M(t, {
|
|
1273
1367
|
register(e, t) {
|
|
1274
1368
|
return {
|
|
1275
1369
|
...e,
|
|
@@ -1298,7 +1392,7 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1298
1392
|
});
|
|
1299
1393
|
} else a.registerBatch(e);
|
|
1300
1394
|
}
|
|
1301
|
-
let s = (t, r) => n(e, t, r), c =
|
|
1395
|
+
let s = (t, r) => n(e, t, r), c = A({
|
|
1302
1396
|
source: {
|
|
1303
1397
|
allFields: e.fields.listStore,
|
|
1304
1398
|
existingResponses: t
|
|
@@ -1308,7 +1402,7 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1308
1402
|
...t,
|
|
1309
1403
|
...n
|
|
1310
1404
|
}, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
|
|
1311
|
-
let o =
|
|
1405
|
+
let o = vt(t, e);
|
|
1312
1406
|
if (!o) {
|
|
1313
1407
|
r.push({
|
|
1314
1408
|
fieldKey: t,
|
|
@@ -1318,17 +1412,17 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1318
1412
|
});
|
|
1319
1413
|
return;
|
|
1320
1414
|
}
|
|
1321
|
-
let c =
|
|
1415
|
+
let c = yt(o, n), l = await St(s, o, c, a);
|
|
1322
1416
|
if (l) {
|
|
1323
1417
|
r.push(l);
|
|
1324
1418
|
return;
|
|
1325
1419
|
}
|
|
1326
|
-
let u =
|
|
1420
|
+
let u = bt(o, c);
|
|
1327
1421
|
if (u) {
|
|
1328
1422
|
r.push(u);
|
|
1329
1423
|
return;
|
|
1330
1424
|
}
|
|
1331
|
-
let d =
|
|
1425
|
+
let d = xt(o, c);
|
|
1332
1426
|
if (d) {
|
|
1333
1427
|
r.push(d);
|
|
1334
1428
|
return;
|
|
@@ -1356,7 +1450,7 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1356
1450
|
async function l(e) {
|
|
1357
1451
|
return c(e);
|
|
1358
1452
|
}
|
|
1359
|
-
let u =
|
|
1453
|
+
let u = A({
|
|
1360
1454
|
source: t,
|
|
1361
1455
|
effect: async (e, t) => {
|
|
1362
1456
|
let { responsesToCommit: n, validationErrors: r } = await c(t);
|
|
@@ -1371,7 +1465,7 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1371
1465
|
value: t
|
|
1372
1466
|
})));
|
|
1373
1467
|
function m(e) {
|
|
1374
|
-
return
|
|
1468
|
+
return j({
|
|
1375
1469
|
f: e,
|
|
1376
1470
|
s: t
|
|
1377
1471
|
}, ({ f: e, s: t }) => {
|
|
@@ -1388,16 +1482,30 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1388
1482
|
function _(t) {
|
|
1389
1483
|
return m(e.fields.getByName(t));
|
|
1390
1484
|
}
|
|
1391
|
-
|
|
1485
|
+
L({
|
|
1392
1486
|
clock: r,
|
|
1393
1487
|
target: a.clearAll
|
|
1394
|
-
}),
|
|
1488
|
+
}), L({
|
|
1395
1489
|
clock: i,
|
|
1396
1490
|
target: a.clear
|
|
1397
|
-
})
|
|
1491
|
+
});
|
|
1492
|
+
let v = A({
|
|
1493
|
+
source: e.experiences.listStore,
|
|
1494
|
+
effect: (e, t) => {
|
|
1495
|
+
let n = e.find((e) => e.id === t);
|
|
1496
|
+
if (!n) return;
|
|
1497
|
+
let { steps: r } = n.treeStore.getState(), a = r.flatMap((e) => e.fieldKeys);
|
|
1498
|
+
for (let e of a) i(e);
|
|
1499
|
+
}
|
|
1500
|
+
});
|
|
1501
|
+
function y(e) {
|
|
1502
|
+
v(e);
|
|
1503
|
+
}
|
|
1504
|
+
return {
|
|
1398
1505
|
register: o,
|
|
1399
1506
|
clearAll: r,
|
|
1400
1507
|
clear: i,
|
|
1508
|
+
clearByExperience: y,
|
|
1401
1509
|
commit: d,
|
|
1402
1510
|
getResponsesToCommit: l,
|
|
1403
1511
|
listStore: p,
|
|
@@ -1407,13 +1515,13 @@ var ht = M("response"), gt = L(({ client: e }) => {
|
|
|
1407
1515
|
getByFieldName: _
|
|
1408
1516
|
};
|
|
1409
1517
|
});
|
|
1410
|
-
function
|
|
1411
|
-
return
|
|
1518
|
+
function Tt(e) {
|
|
1519
|
+
return z(wt, e);
|
|
1412
1520
|
}
|
|
1413
1521
|
//#endregion
|
|
1414
1522
|
//#region src/entities/condition/condition.ts
|
|
1415
|
-
var
|
|
1416
|
-
let e =
|
|
1523
|
+
var Et = N("condition"), Dt = R(() => {
|
|
1524
|
+
let e = Et.store({}), t = M(e, { register(e, t) {
|
|
1417
1525
|
return {
|
|
1418
1526
|
...e,
|
|
1419
1527
|
[t.condition.id]: t.condition
|
|
@@ -1437,12 +1545,12 @@ var vt = M("condition"), yt = L(() => {
|
|
|
1437
1545
|
indexStore: e
|
|
1438
1546
|
};
|
|
1439
1547
|
});
|
|
1440
|
-
function
|
|
1441
|
-
return
|
|
1548
|
+
function Ot() {
|
|
1549
|
+
return z(Dt);
|
|
1442
1550
|
}
|
|
1443
1551
|
//#endregion
|
|
1444
1552
|
//#region src/utils/api-url.ts
|
|
1445
|
-
function
|
|
1553
|
+
function kt() {
|
|
1446
1554
|
if (c()) {
|
|
1447
1555
|
let e = [
|
|
1448
1556
|
document.currentScript,
|
|
@@ -1457,7 +1565,7 @@ function xt() {
|
|
|
1457
1565
|
}
|
|
1458
1566
|
//#endregion
|
|
1459
1567
|
//#region src/utils/search-params.ts
|
|
1460
|
-
function
|
|
1568
|
+
function At() {
|
|
1461
1569
|
if (!s()) return {};
|
|
1462
1570
|
let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
|
|
1463
1571
|
for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
|
|
@@ -1465,23 +1573,23 @@ function St() {
|
|
|
1465
1573
|
let n = r.replace("picked-", "");
|
|
1466
1574
|
t[n] = e.getAll(r);
|
|
1467
1575
|
}
|
|
1468
|
-
let r =
|
|
1469
|
-
if (n.size > 0)
|
|
1576
|
+
let r = k("s");
|
|
1577
|
+
if (n.size > 0) O.set(r, t);
|
|
1470
1578
|
else {
|
|
1471
|
-
let e =
|
|
1579
|
+
let e = O.get(r);
|
|
1472
1580
|
if (e) return e.json() || {};
|
|
1473
1581
|
}
|
|
1474
1582
|
return t;
|
|
1475
1583
|
}
|
|
1476
1584
|
//#endregion
|
|
1477
1585
|
//#region src/entities/session/session.ts
|
|
1478
|
-
var
|
|
1479
|
-
function
|
|
1586
|
+
var jt = k("session", "global");
|
|
1587
|
+
function Mt() {
|
|
1480
1588
|
return p() ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}-${Math.random().toString(36).substring(2, 15)}`;
|
|
1481
1589
|
}
|
|
1482
|
-
function
|
|
1590
|
+
function Nt() {
|
|
1483
1591
|
if (!m()) return null;
|
|
1484
|
-
let e =
|
|
1592
|
+
let e = D.get(jt);
|
|
1485
1593
|
if (!e.isSet()) return null;
|
|
1486
1594
|
try {
|
|
1487
1595
|
return e.json();
|
|
@@ -1489,10 +1597,10 @@ function Tt() {
|
|
|
1489
1597
|
return null;
|
|
1490
1598
|
}
|
|
1491
1599
|
}
|
|
1492
|
-
var
|
|
1493
|
-
let e =
|
|
1600
|
+
var Pt = R(() => {
|
|
1601
|
+
let e = Nt(), t = { id: e?.id ?? Mt() };
|
|
1494
1602
|
e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
|
|
1495
|
-
let n =
|
|
1603
|
+
let n = I(t), r = M(n, {
|
|
1496
1604
|
setIsUser: (e, t) => ({
|
|
1497
1605
|
...e,
|
|
1498
1606
|
isUser: t
|
|
@@ -1513,13 +1621,13 @@ var Et = L(() => {
|
|
|
1513
1621
|
return e.isUser !== void 0 && (i.isUser = e.isUser), Object.keys(r).length > 0 && (i.identifiers = r), i;
|
|
1514
1622
|
}
|
|
1515
1623
|
});
|
|
1516
|
-
return
|
|
1624
|
+
return L({
|
|
1517
1625
|
source: n,
|
|
1518
|
-
target:
|
|
1626
|
+
target: A({
|
|
1519
1627
|
source: n,
|
|
1520
1628
|
effect: (e) => {
|
|
1521
1629
|
if (m()) try {
|
|
1522
|
-
|
|
1630
|
+
D.get(jt).set(e);
|
|
1523
1631
|
} catch {}
|
|
1524
1632
|
}
|
|
1525
1633
|
})
|
|
@@ -1530,39 +1638,39 @@ var Et = L(() => {
|
|
|
1530
1638
|
removeIdentifier: r.removeIdentifier
|
|
1531
1639
|
};
|
|
1532
1640
|
});
|
|
1533
|
-
function
|
|
1534
|
-
return
|
|
1641
|
+
function Ft() {
|
|
1642
|
+
return z(Pt, void 0);
|
|
1535
1643
|
}
|
|
1536
1644
|
//#endregion
|
|
1537
1645
|
//#region src/utils/picked-config.ts
|
|
1538
|
-
function
|
|
1646
|
+
function It() {
|
|
1539
1647
|
if (s()) return globalThis.window.pickedConfig;
|
|
1540
1648
|
}
|
|
1541
|
-
function
|
|
1542
|
-
if (s()) return
|
|
1649
|
+
function Lt() {
|
|
1650
|
+
if (s()) return It()?.projectId;
|
|
1543
1651
|
}
|
|
1544
|
-
function
|
|
1652
|
+
function Rt() {
|
|
1545
1653
|
if (!c()) return;
|
|
1546
1654
|
let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
|
|
1547
1655
|
if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
|
|
1548
1656
|
}
|
|
1549
|
-
function
|
|
1657
|
+
function zt(e) {
|
|
1550
1658
|
if (e.projectId) return e.projectId;
|
|
1551
|
-
let t =
|
|
1659
|
+
let t = Lt();
|
|
1552
1660
|
if (t) return t;
|
|
1553
|
-
let n =
|
|
1661
|
+
let n = Rt();
|
|
1554
1662
|
if (n) return n;
|
|
1555
1663
|
throw Error("projectId is required. You can provide it via one of:\n (1) createClient({ projectId }) options;\n (2) window.pickedConfig = { projectId };\n (3) a <script> tag with id 'picked_script', 'picked', or 'cvly' that includes a data-projectid (or project-id) attribute.");
|
|
1556
1664
|
}
|
|
1557
1665
|
//#endregion
|
|
1558
1666
|
//#region src/utils/render-string.ts
|
|
1559
|
-
function
|
|
1667
|
+
function $(e) {
|
|
1560
1668
|
return e == null || e === "" || Number.isNaN(e);
|
|
1561
1669
|
}
|
|
1562
|
-
var
|
|
1563
|
-
default: (e, t) =>
|
|
1564
|
-
append: (e, t) => t &&
|
|
1565
|
-
prepend: (e, t) => t &&
|
|
1670
|
+
var Bt = {
|
|
1671
|
+
default: (e, t) => $(e) ? String(t ?? "") : String(e),
|
|
1672
|
+
append: (e, t) => t && !$(e) ? `${e} ${t}` : e,
|
|
1673
|
+
prepend: (e, t) => t && !$(e) ? `${t} ${e}` : e,
|
|
1566
1674
|
upper: (e) => typeof e == "string" ? e.toUpperCase() : e,
|
|
1567
1675
|
lower: (e) => typeof e == "string" ? e.toLowerCase() : e,
|
|
1568
1676
|
capitalize: (e) => typeof e == "string" ? e.charAt(0).toUpperCase() + e.slice(1) : e,
|
|
@@ -1580,24 +1688,24 @@ var Mt = {
|
|
|
1580
1688
|
return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
|
|
1581
1689
|
}
|
|
1582
1690
|
};
|
|
1583
|
-
function
|
|
1691
|
+
function Vt(e) {
|
|
1584
1692
|
return typeof e == "object" && !!e;
|
|
1585
1693
|
}
|
|
1586
|
-
function
|
|
1694
|
+
function Ht(e, t) {
|
|
1587
1695
|
let n = t;
|
|
1588
|
-
for (let t of e.split(".")) if (
|
|
1696
|
+
for (let t of e.split(".")) if (Vt(n) && t in n) n = n[t];
|
|
1589
1697
|
else return;
|
|
1590
1698
|
return typeof n == "function" ? n() : n;
|
|
1591
1699
|
}
|
|
1592
|
-
function
|
|
1593
|
-
let n = e.split("|").map((e) => e.trim()), r =
|
|
1700
|
+
function Ut(e, t) {
|
|
1701
|
+
let n = e.split("|").map((e) => e.trim()), r = Ht(n.shift() ?? "", t);
|
|
1594
1702
|
for (let e of n) {
|
|
1595
|
-
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o =
|
|
1703
|
+
let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Bt[i];
|
|
1596
1704
|
o && (r = o(r, a));
|
|
1597
1705
|
}
|
|
1598
|
-
return
|
|
1706
|
+
return $(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
|
|
1599
1707
|
}
|
|
1600
|
-
function
|
|
1708
|
+
function Wt(e, t) {
|
|
1601
1709
|
let n = "", r = 0;
|
|
1602
1710
|
for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
|
|
1603
1711
|
r += 2;
|
|
@@ -1609,61 +1717,61 @@ function It(e, t) {
|
|
|
1609
1717
|
}
|
|
1610
1718
|
i += e[r++];
|
|
1611
1719
|
}
|
|
1612
|
-
n +=
|
|
1720
|
+
n += Ut(i.trim(), t);
|
|
1613
1721
|
} else n += e[r++];
|
|
1614
1722
|
return n;
|
|
1615
1723
|
}
|
|
1616
1724
|
//#endregion
|
|
1617
1725
|
//#region src/picked.ts
|
|
1618
|
-
var
|
|
1726
|
+
var Gt = class {
|
|
1619
1727
|
static logger = r;
|
|
1620
1728
|
options;
|
|
1621
1729
|
dataSource = null;
|
|
1622
1730
|
contentLoader;
|
|
1623
1731
|
plugins = {};
|
|
1624
|
-
eventBus =
|
|
1732
|
+
eventBus = F();
|
|
1625
1733
|
events;
|
|
1626
1734
|
projectId;
|
|
1627
1735
|
apiUrl;
|
|
1628
1736
|
dashboardUrl;
|
|
1629
1737
|
documentationSiteUrl;
|
|
1630
|
-
session =
|
|
1631
|
-
searchParams =
|
|
1632
|
-
history =
|
|
1633
|
-
components =
|
|
1634
|
-
experienceInstances =
|
|
1635
|
-
experiences =
|
|
1636
|
-
frameworks =
|
|
1637
|
-
predicates =
|
|
1638
|
-
features =
|
|
1639
|
-
conditions =
|
|
1640
|
-
fields =
|
|
1641
|
-
responses =
|
|
1642
|
-
steps =
|
|
1643
|
-
contents =
|
|
1644
|
-
actions =
|
|
1645
|
-
conditionResults =
|
|
1646
|
-
stateSnapshotStore =
|
|
1647
|
-
evaluateRuleLogicFx =
|
|
1738
|
+
session = Ft();
|
|
1739
|
+
searchParams = At();
|
|
1740
|
+
history = Qe();
|
|
1741
|
+
components = Se({ client: this });
|
|
1742
|
+
experienceInstances = C({ client: this });
|
|
1743
|
+
experiences = me({ client: this });
|
|
1744
|
+
frameworks = Ee({ client: this });
|
|
1745
|
+
predicates = We({ client: this });
|
|
1746
|
+
features = Je({ client: this });
|
|
1747
|
+
conditions = Ot();
|
|
1748
|
+
fields = rt();
|
|
1749
|
+
responses = Tt({ client: this });
|
|
1750
|
+
steps = ot();
|
|
1751
|
+
contents = ut();
|
|
1752
|
+
actions = mt({ client: this });
|
|
1753
|
+
conditionResults = w();
|
|
1754
|
+
stateSnapshotStore = ke({ client: this });
|
|
1755
|
+
evaluateRuleLogicFx = Ie({ client: this });
|
|
1648
1756
|
start;
|
|
1649
1757
|
readyStore;
|
|
1650
1758
|
preconditionPassedStore;
|
|
1651
1759
|
conditionPassedStore;
|
|
1652
1760
|
lifecycleStageStore;
|
|
1653
|
-
lifecycle =
|
|
1654
|
-
renderStringFx =
|
|
1761
|
+
lifecycle = Ve({ client: this });
|
|
1762
|
+
renderStringFx = A({
|
|
1655
1763
|
source: this.responses.listStore,
|
|
1656
1764
|
effect: (e, { template: t, context: n }) => {
|
|
1657
1765
|
let r = {};
|
|
1658
1766
|
for (let t of e) r[t.fieldKey] = t.value;
|
|
1659
|
-
return
|
|
1767
|
+
return Wt(t, {
|
|
1660
1768
|
...n,
|
|
1661
1769
|
responses: r
|
|
1662
1770
|
});
|
|
1663
1771
|
}
|
|
1664
1772
|
});
|
|
1665
1773
|
constructor(e) {
|
|
1666
|
-
this.events =
|
|
1774
|
+
this.events = et(this.eventBus), this.projectId = zt(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || kt(), this.dashboardUrl = e.dashboardUrl ?? "https://dashboard.picked.app", this.documentationSiteUrl = e.documentationSiteUrl ?? "https://docs.picked.app", this.start = this.lifecycle.start, this.readyStore = this.lifecycle.readyStore, this.preconditionPassedStore = this.lifecycle.preconditionPassedStore, this.conditionPassedStore = this.lifecycle.conditionPassedStore, this.lifecycleStageStore = this.lifecycle.lifecycleStageStore, this.setupPlugins(), this.setupFeatures(), this.setupPredicates(), this.setupActions(), this.setupComponents(), this.lifecycle.setPrecondition(e.precondition), this.lifecycle.setCondition(e.condition), this.eventBus({
|
|
1667
1775
|
type: "load",
|
|
1668
1776
|
version: ne()
|
|
1669
1777
|
}), this.maybeStartPreviewBridge();
|
|
@@ -1672,21 +1780,21 @@ var $ = class {
|
|
|
1672
1780
|
!s() || !h() || this.searchParams["preview-token"]?.[0] && import("../preview-bridge-D76l-dPy.js").then((e) => e.initPreviewBridge()).catch(() => void 0);
|
|
1673
1781
|
}
|
|
1674
1782
|
registerFramework = (e) => {
|
|
1675
|
-
|
|
1783
|
+
De(e, this.frameworks);
|
|
1676
1784
|
};
|
|
1677
1785
|
registerComponent = (e, t) => {
|
|
1678
|
-
|
|
1786
|
+
Ce(e, t, this.components);
|
|
1679
1787
|
};
|
|
1680
1788
|
registerPlugin = (e) => {
|
|
1681
|
-
|
|
1789
|
+
_e(this, e, this.plugins);
|
|
1682
1790
|
let t = this.plugins[e.name];
|
|
1683
1791
|
t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
|
|
1684
1792
|
};
|
|
1685
1793
|
registerFeature = (e, t) => {
|
|
1686
|
-
|
|
1794
|
+
Ye(e, t, this.features);
|
|
1687
1795
|
};
|
|
1688
1796
|
registerPredicate = (e, t) => {
|
|
1689
|
-
|
|
1797
|
+
Ge(e, t, this.predicates);
|
|
1690
1798
|
};
|
|
1691
1799
|
registerCondition = (e) => {
|
|
1692
1800
|
this.conditions.register(e);
|
|
@@ -1695,16 +1803,16 @@ var $ = class {
|
|
|
1695
1803
|
this.fields.register(e);
|
|
1696
1804
|
};
|
|
1697
1805
|
registerStep = (e) => {
|
|
1698
|
-
|
|
1806
|
+
st(e, this.steps);
|
|
1699
1807
|
};
|
|
1700
1808
|
registerContent = (e) => {
|
|
1701
|
-
|
|
1809
|
+
dt(e, this.contents);
|
|
1702
1810
|
};
|
|
1703
1811
|
registerAction = (e, t) => {
|
|
1704
|
-
|
|
1812
|
+
ht(e, t, this.actions);
|
|
1705
1813
|
};
|
|
1706
1814
|
registerExperience = (e) => {
|
|
1707
|
-
e.component &&
|
|
1815
|
+
e.component && Ce(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
|
|
1708
1816
|
};
|
|
1709
1817
|
launchExperienceById = async (e, t) => {
|
|
1710
1818
|
this.experiences.launch({
|
|
@@ -1789,20 +1897,20 @@ var $ = class {
|
|
|
1789
1897
|
};
|
|
1790
1898
|
//#endregion
|
|
1791
1899
|
//#region src/entities/component/lazyComponent.ts
|
|
1792
|
-
function
|
|
1900
|
+
function Kt(e) {
|
|
1793
1901
|
return {
|
|
1794
1902
|
$$type: "lazy-component",
|
|
1795
1903
|
load: e
|
|
1796
1904
|
};
|
|
1797
1905
|
}
|
|
1798
|
-
function
|
|
1906
|
+
function qt(e) {
|
|
1799
1907
|
return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
|
|
1800
1908
|
}
|
|
1801
1909
|
//#endregion
|
|
1802
1910
|
//#region src/exports.ts
|
|
1803
|
-
var
|
|
1804
|
-
let t = new
|
|
1911
|
+
var Jt = (e) => {
|
|
1912
|
+
let t = new Gt(e);
|
|
1805
1913
|
return u(t), t;
|
|
1806
1914
|
};
|
|
1807
1915
|
//#endregion
|
|
1808
|
-
export {
|
|
1916
|
+
export { Gt as Picked, Jt as createClient, ge as createPluginEffect, k as createStorageKey, n as evaluateRuleLogic, It as getPickedConfig, h as isInsideIframe, qt as isLazyLoader, b as isPickedRoot, Kt as lazyComponent, D as localStore, O as sessionStore, E as subscribe, d as supportsCookies, p as supportsCryptoRandomUUID, c as supportsDocument, i as supportsHistory, f as supportsIntersectionObserver, m as supportsLocalStorage, a as supportsLocation, l as supportsSessionStorage, g as supportsShadowRoot, o as supportsWebComponents, s as supportsWindow };
|