@picked/client 0.0.1-dev.1773724362573 → 0.0.1-dev.1773804563218
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{api-Z3Hn2Kw-.cjs → api-C90ugp6M.cjs} +1 -1
- package/dist/{api-B3x8PEp4.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 -39
- 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
|
@@ -1,137 +1,203 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { c as
|
|
1
|
+
import { a as m } from "../../../api-CQ1Lb-dB.js";
|
|
2
|
+
import { c as _ } from "../../../api-CQ1Lb-dB.js";
|
|
3
3
|
import { l as a } from "../../../logger-C9a75KZn.js";
|
|
4
|
-
function
|
|
5
|
-
let
|
|
6
|
-
for (let
|
|
7
|
-
|
|
8
|
-
return
|
|
4
|
+
function y(n) {
|
|
5
|
+
let e = 2166136261;
|
|
6
|
+
for (let t = 0; t < n.length; t++)
|
|
7
|
+
e ^= n.charCodeAt(t), e = Math.imul(e, 16777619);
|
|
8
|
+
return e >>> 0;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function h(n) {
|
|
11
|
+
return y(n) % 100;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
return
|
|
13
|
+
function w(n, e) {
|
|
14
|
+
return e <= 0 ? !1 : e >= 100 ? !0 : n < e;
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return typeof
|
|
16
|
+
function v(n) {
|
|
17
|
+
return typeof n != "object" || n === null || !("id" in n && "name" in n && "enabled" in n && "weight" in n && "version" in n) ? !1 : typeof n.id == "string" && typeof n.name == "string" && typeof n.enabled == "boolean" && typeof n.weight == "number" && typeof n.version == "number";
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
return typeof
|
|
19
|
+
function g(n) {
|
|
20
|
+
return typeof n != "object" || n === null || !("features" in n) || !Array.isArray(n.features) ? !1 : n.features.every(v);
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
if (r && r.length > 0)
|
|
25
|
-
return r[0];
|
|
22
|
+
function j(n) {
|
|
23
|
+
return typeof n != "object" || n === null ? !1 : "id" in n && "name" in n && "nodes" in n && "edges" in n && typeof n.id == "string" && typeof n.name == "string" && Array.isArray(n.nodes) && Array.isArray(n.edges);
|
|
26
24
|
}
|
|
27
|
-
function
|
|
28
|
-
const
|
|
29
|
-
if (!n)
|
|
30
|
-
return r;
|
|
25
|
+
function C(n, e) {
|
|
26
|
+
const t = /* @__PURE__ */ new Set(), i = [];
|
|
31
27
|
for (const o of n) {
|
|
32
|
-
|
|
33
|
-
|
|
28
|
+
if (o.type !== "conditional")
|
|
29
|
+
continue;
|
|
30
|
+
const r = o.conditionId ?? o.conditionalId;
|
|
31
|
+
if (!r || t.has(r))
|
|
32
|
+
continue;
|
|
33
|
+
t.add(r);
|
|
34
|
+
const s = e.get(r);
|
|
35
|
+
if (!s) {
|
|
36
|
+
a("warn", `Condition with id '${r}' not found in project conditions`);
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
i.push({ id: s.id, label: s.name, condition: s.condition });
|
|
40
|
+
}
|
|
41
|
+
return i;
|
|
42
|
+
}
|
|
43
|
+
function c(n, e) {
|
|
44
|
+
if (e.conditions)
|
|
45
|
+
for (const t of e.conditions)
|
|
46
|
+
n.registerCondition(t);
|
|
47
|
+
}
|
|
48
|
+
function b(n, e, t) {
|
|
49
|
+
if (!j(e)) {
|
|
50
|
+
a("warn", `Skipping invalid experience payload: ${JSON.stringify(e)}`);
|
|
51
|
+
return;
|
|
34
52
|
}
|
|
35
|
-
|
|
53
|
+
const i = e.componentName ? n.components.listStore.getState().find((o) => o.name === e.componentName)?.component : void 0;
|
|
54
|
+
n.registerExperience({
|
|
55
|
+
id: e.id,
|
|
56
|
+
key: e.key,
|
|
57
|
+
name: e.name,
|
|
58
|
+
targets: e.targets ?? [],
|
|
59
|
+
steps: e.nodes.filter((o) => o.type === "step").map((o) => o.stepKey),
|
|
60
|
+
nodes: e.nodes,
|
|
61
|
+
edges: e.edges,
|
|
62
|
+
conditions: C(e.nodes, t),
|
|
63
|
+
actions: e.actions,
|
|
64
|
+
condition: e.condition,
|
|
65
|
+
initializeOpen: e.initializeOpen,
|
|
66
|
+
component: i
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function f(n, e) {
|
|
70
|
+
if (e.fields)
|
|
71
|
+
for (const t of e.fields)
|
|
72
|
+
n.registerField(t);
|
|
73
|
+
}
|
|
74
|
+
function u(n, e) {
|
|
75
|
+
if (e.steps)
|
|
76
|
+
for (const t of e.steps)
|
|
77
|
+
n.registerStep(t);
|
|
78
|
+
}
|
|
79
|
+
function d(n, e) {
|
|
80
|
+
const t = /* @__PURE__ */ new Map();
|
|
81
|
+
if (e.conditions)
|
|
82
|
+
for (const i of e.conditions)
|
|
83
|
+
t.set(i.id, i);
|
|
84
|
+
if (e.experiences)
|
|
85
|
+
for (const i of e.experiences)
|
|
86
|
+
b(n, i, t);
|
|
87
|
+
}
|
|
88
|
+
function S(n) {
|
|
89
|
+
const e = n.searchParams["preview-token"];
|
|
90
|
+
if (e && e.length > 0)
|
|
91
|
+
return e[0];
|
|
36
92
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
93
|
+
function k(n) {
|
|
94
|
+
const e = /* @__PURE__ */ new Set(), t = n.searchParams.feature;
|
|
39
95
|
if (!t)
|
|
96
|
+
return e;
|
|
97
|
+
for (const i of t) {
|
|
98
|
+
const o = i.indexOf(":");
|
|
99
|
+
o > 0 && e.add(i.substring(0, o));
|
|
100
|
+
}
|
|
101
|
+
return e;
|
|
102
|
+
}
|
|
103
|
+
function l(n, e, t) {
|
|
104
|
+
const i = k(n), o = n.session?.id;
|
|
105
|
+
if (!o)
|
|
40
106
|
throw new Error("Session ID is required for feature registration");
|
|
41
|
-
const
|
|
42
|
-
for (const s of
|
|
43
|
-
|
|
44
|
-
}
|
|
45
|
-
function
|
|
46
|
-
|
|
47
|
-
key: `v${
|
|
48
|
-
name:
|
|
49
|
-
storage:
|
|
50
|
-
decide: () =>
|
|
107
|
+
const r = h(o);
|
|
108
|
+
for (const s of e.features)
|
|
109
|
+
i.has(s.id) || I(n, s, t, r);
|
|
110
|
+
}
|
|
111
|
+
function I(n, e, t, i) {
|
|
112
|
+
n.registerFeature(e.id, {
|
|
113
|
+
key: `v${e.version}`,
|
|
114
|
+
name: e.name,
|
|
115
|
+
storage: t ? "session" : "local",
|
|
116
|
+
decide: () => e.enabled ? w(i, e.weight) : !1
|
|
51
117
|
});
|
|
52
118
|
}
|
|
53
|
-
function
|
|
54
|
-
let
|
|
119
|
+
function P() {
|
|
120
|
+
let n;
|
|
55
121
|
try {
|
|
56
|
-
|
|
122
|
+
n = __PICKED_PROJECT_CONFIG__;
|
|
57
123
|
} catch {
|
|
58
124
|
return;
|
|
59
125
|
}
|
|
60
|
-
if (
|
|
126
|
+
if (n === void 0)
|
|
61
127
|
return;
|
|
62
|
-
let
|
|
63
|
-
if (typeof
|
|
128
|
+
let e;
|
|
129
|
+
if (typeof n == "string")
|
|
64
130
|
try {
|
|
65
|
-
|
|
131
|
+
e = JSON.parse(n);
|
|
66
132
|
} catch {
|
|
67
133
|
a("warn", "Build-time project config is not valid JSON");
|
|
68
134
|
return;
|
|
69
135
|
}
|
|
70
136
|
else
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
return
|
|
137
|
+
e = n;
|
|
138
|
+
if (g(e))
|
|
139
|
+
return e;
|
|
74
140
|
a("warn", "Build-time project config has invalid shape, falling back to runtime fetch");
|
|
75
141
|
}
|
|
76
|
-
function
|
|
142
|
+
function F(n) {
|
|
77
143
|
try {
|
|
78
|
-
const
|
|
79
|
-
return
|
|
144
|
+
const e = new URL(n).hostname;
|
|
145
|
+
return e === "localhost" || e === "127.0.0.1" || e === "::1";
|
|
80
146
|
} catch {
|
|
81
147
|
return !1;
|
|
82
148
|
}
|
|
83
149
|
}
|
|
84
|
-
function
|
|
85
|
-
if (typeof
|
|
150
|
+
function E(n) {
|
|
151
|
+
if (typeof n != "object" || n === null || !("cause" in n))
|
|
86
152
|
return !1;
|
|
87
|
-
const { cause:
|
|
88
|
-
return typeof
|
|
153
|
+
const { cause: e } = n;
|
|
154
|
+
return typeof e != "object" || e === null || !("code" in e) ? !1 : e.code === "ECONNREFUSED";
|
|
89
155
|
}
|
|
90
|
-
async function
|
|
91
|
-
const
|
|
92
|
-
let
|
|
156
|
+
async function p(n, e, t) {
|
|
157
|
+
const i = t?.previewToken ? `projects/${e}?preview_token=${encodeURIComponent(t.previewToken)}` : `projects/${e}`;
|
|
158
|
+
let o;
|
|
93
159
|
try {
|
|
94
|
-
|
|
160
|
+
o = await m(n, i, t?.headers);
|
|
95
161
|
} catch (s) {
|
|
96
|
-
return
|
|
162
|
+
return F(n) && E(s) || a("warn", "Failed to fetch project config", s), null;
|
|
97
163
|
}
|
|
98
|
-
if (!
|
|
99
|
-
return a("warn", `Project config request failed with status ${
|
|
100
|
-
let
|
|
164
|
+
if (!o.ok)
|
|
165
|
+
return a("warn", `Project config request failed with status ${o.status.toString()}`), null;
|
|
166
|
+
let r;
|
|
101
167
|
try {
|
|
102
|
-
|
|
168
|
+
r = await o.json();
|
|
103
169
|
} catch {
|
|
104
170
|
return a("warn", "Failed to parse project config response"), null;
|
|
105
171
|
}
|
|
106
|
-
return
|
|
172
|
+
return g(r) ? r : (a("warn", "Invalid project config response shape"), null);
|
|
107
173
|
}
|
|
108
|
-
function
|
|
174
|
+
function N(n) {
|
|
109
175
|
return {
|
|
110
176
|
name: "dynamic-experiences",
|
|
111
|
-
setup: (
|
|
112
|
-
const
|
|
177
|
+
setup: (e) => {
|
|
178
|
+
const t = n?.apiUrl ?? e.apiUrl;
|
|
113
179
|
return {
|
|
114
180
|
onStart: async () => {
|
|
115
|
-
const
|
|
116
|
-
if (
|
|
117
|
-
const s = await
|
|
118
|
-
s &&
|
|
181
|
+
const i = S(e);
|
|
182
|
+
if (i) {
|
|
183
|
+
const s = await p(t, e.projectId, { previewToken: i });
|
|
184
|
+
s && (l(e, s, !0), c(e, s), f(e, s), u(e, s), d(e, s));
|
|
119
185
|
return;
|
|
120
186
|
}
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
|
|
187
|
+
const o = n?.projectConfig ?? P();
|
|
188
|
+
if (o) {
|
|
189
|
+
l(e, o, !1), c(e, o), f(e, o), u(e, o), d(e, o);
|
|
124
190
|
return;
|
|
125
191
|
}
|
|
126
|
-
const
|
|
127
|
-
|
|
192
|
+
const r = await p(t, e.projectId);
|
|
193
|
+
r && (l(e, r, !1), c(e, r), f(e, r), u(e, r), d(e, r));
|
|
128
194
|
}
|
|
129
195
|
};
|
|
130
196
|
}
|
|
131
197
|
};
|
|
132
198
|
}
|
|
133
199
|
export {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
200
|
+
_ as createClientHeaders,
|
|
201
|
+
N as dynamicExperiencesPlugin,
|
|
202
|
+
p as fetchProject
|
|
137
203
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEffect as n, sample as i } from "effector";
|
|
2
|
-
import { c, l as g, s as S } from "../../../storage-
|
|
2
|
+
import { c, l as g, s as S } from "../../../storage-Co_LbKr_.js";
|
|
3
3
|
import { l as f } from "../../../logger-C9a75KZn.js";
|
|
4
4
|
const y = ({
|
|
5
5
|
storage: a = "local"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEffect as s, sample as r } from "effector";
|
|
2
|
-
import { c as l, l as y, s as g } from "../../../storage-
|
|
2
|
+
import { c as l, l as y, s as g } from "../../../storage-Co_LbKr_.js";
|
|
3
3
|
const a = l("history", "global"), f = ({
|
|
4
4
|
storage: i = "local"
|
|
5
5
|
} = {}) => ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEffect as i, attach as f, sample as c } from "effector";
|
|
2
|
-
import { c as u, l as g, s as d } from "../../../storage-
|
|
2
|
+
import { c as u, l as g, s as d } from "../../../storage-Co_LbKr_.js";
|
|
3
3
|
const p = u("responses", "global"), S = (r, s) => {
|
|
4
4
|
const o = {};
|
|
5
5
|
return Object.entries(r).forEach(([t, n]) => {
|
|
@@ -1,91 +1,86 @@
|
|
|
1
1
|
import { createEffect as u, sample as d } from "effector";
|
|
2
2
|
const x = "picked";
|
|
3
|
-
async function p(
|
|
4
|
-
const { storeName:
|
|
5
|
-
return new Promise((a,
|
|
3
|
+
async function p(r) {
|
|
4
|
+
const { storeName: o, version: c = 1, keyPath: n = "id" } = r;
|
|
5
|
+
return new Promise((a, t) => {
|
|
6
6
|
const e = indexedDB.open(x, c);
|
|
7
7
|
e.onupgradeneeded = () => {
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
}, e.onsuccess = () => a(e.result), e.onerror = () =>
|
|
8
|
+
const s = e.result;
|
|
9
|
+
s.objectStoreNames.contains(o) || s.createObjectStore(o, n ? { keyPath: n } : void 0);
|
|
10
|
+
}, e.onsuccess = () => a(e.result), e.onerror = () => t(new Error(e.error?.message));
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
|
-
async function g(
|
|
13
|
+
async function g(r, o) {
|
|
14
14
|
return new Promise((c, n) => {
|
|
15
|
-
const e =
|
|
15
|
+
const e = r.transaction(o, "readonly").objectStore(o).getAll();
|
|
16
16
|
e.onsuccess = () => c(e.result), e.onerror = () => n(new Error(e.error?.message));
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
|
-
async function y(
|
|
19
|
+
async function y(r, o, c) {
|
|
20
20
|
return new Promise((n, a) => {
|
|
21
|
-
const
|
|
22
|
-
|
|
21
|
+
const s = r.transaction(o, "readwrite").objectStore(o).put(c);
|
|
22
|
+
s.onsuccess = () => n(), s.onerror = () => a(new Error(s.error?.message));
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
|
-
async function
|
|
25
|
+
async function b(r, o, c) {
|
|
26
26
|
return new Promise((n, a) => {
|
|
27
|
-
const
|
|
28
|
-
|
|
27
|
+
const s = r.transaction(o, "readwrite").objectStore(o).delete(c);
|
|
28
|
+
s.onsuccess = () => n(), s.onerror = () => a(new Error(s.error?.message));
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
|
-
async function
|
|
31
|
+
async function S(r, o) {
|
|
32
32
|
return new Promise((c, n) => {
|
|
33
|
-
const e =
|
|
33
|
+
const e = r.transaction(o, "readwrite").objectStore(o).clear();
|
|
34
34
|
e.onsuccess = () => c(), e.onerror = () => n(new Error(e.error?.message));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
|
-
const l = "responses",
|
|
37
|
+
const l = "responses", m = { storeName: l, keyPath: "fieldId" }, I = () => ({
|
|
38
38
|
name: "responses-indexdb-plugin",
|
|
39
|
-
setup: (
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
(i, { fieldId:
|
|
39
|
+
setup: (r) => {
|
|
40
|
+
const o = u(async () => {
|
|
41
|
+
const t = await p(m), s = (await g(t, l)).reduce(
|
|
42
|
+
(i, { fieldId: w, value: f }) => (i[w] = f, i),
|
|
43
43
|
{}
|
|
44
44
|
);
|
|
45
|
-
await
|
|
45
|
+
await r.responses.commit(s);
|
|
46
46
|
}), c = u(
|
|
47
|
-
async (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
);
|
|
56
|
-
})
|
|
57
|
-
);
|
|
47
|
+
async (t) => {
|
|
48
|
+
t.forEach((e) => {
|
|
49
|
+
p(m).then((s) => {
|
|
50
|
+
y(s, l, e);
|
|
51
|
+
}).catch((s) => {
|
|
52
|
+
console.error("Failed to store response in IndexedDB:", s);
|
|
53
|
+
});
|
|
54
|
+
});
|
|
58
55
|
}
|
|
59
56
|
), n = u(async () => {
|
|
60
|
-
const
|
|
61
|
-
await
|
|
62
|
-
}), a = u(async (
|
|
63
|
-
const e = await p(
|
|
64
|
-
await
|
|
57
|
+
const t = await p(m);
|
|
58
|
+
await S(t, l);
|
|
59
|
+
}), a = u(async (t) => {
|
|
60
|
+
const e = await p(m);
|
|
61
|
+
await b(e, l, t);
|
|
65
62
|
});
|
|
66
63
|
d({
|
|
67
|
-
source:
|
|
68
|
-
filter: (
|
|
69
|
-
target:
|
|
64
|
+
source: r.eventBus,
|
|
65
|
+
filter: (t) => t.type === "load",
|
|
66
|
+
target: o
|
|
70
67
|
}), d({
|
|
71
|
-
clock:
|
|
72
|
-
source: { responses:
|
|
73
|
-
fn: ({ responses:
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
);
|
|
77
|
-
return r.filter((i) => o.has(i.fieldId));
|
|
68
|
+
clock: r.responses.listStore,
|
|
69
|
+
source: { responses: r.responses.listStore, fields: r.fields.listStore },
|
|
70
|
+
fn: ({ responses: t, fields: e }) => {
|
|
71
|
+
const s = e.filter((i) => !i.policies?.doNotStoreValue);
|
|
72
|
+
return t.filter((i) => s.some((w) => w.id === i.fieldId));
|
|
78
73
|
},
|
|
79
74
|
target: c
|
|
80
75
|
}), d({
|
|
81
|
-
clock:
|
|
76
|
+
clock: r.responses.clearAll,
|
|
82
77
|
target: n
|
|
83
78
|
}), d({
|
|
84
|
-
clock:
|
|
79
|
+
clock: r.responses.clear,
|
|
85
80
|
target: a
|
|
86
81
|
});
|
|
87
82
|
}
|
|
88
83
|
});
|
|
89
84
|
export {
|
|
90
|
-
|
|
85
|
+
I as responsesIndexedDBPlugin
|
|
91
86
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { p as
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
const
|
|
1
|
+
import { a as f, G as c, f as m } from "../../../supports-8YT4QKI7.js";
|
|
2
|
+
import { p as a } from "../../../object-JwZ58NOH.js";
|
|
3
|
+
const o = c;
|
|
4
|
+
let s;
|
|
5
|
+
const d = (r) => ({
|
|
6
6
|
name: "single-page-app",
|
|
7
|
-
setup: (
|
|
8
|
-
|
|
7
|
+
setup: (n) => {
|
|
8
|
+
r.instrumentHistory && f() && h(() => {
|
|
9
9
|
requestAnimationFrame(() => {
|
|
10
|
-
|
|
10
|
+
n.start();
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
function
|
|
16
|
-
if (
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
}), !
|
|
15
|
+
function h(r) {
|
|
16
|
+
if (o.addEventListener("popstate", () => {
|
|
17
|
+
const e = o.location.href, t = s;
|
|
18
|
+
s = e, t !== e && r();
|
|
19
|
+
}), !m())
|
|
20
20
|
return;
|
|
21
|
-
function e
|
|
22
|
-
return function(...
|
|
23
|
-
const
|
|
24
|
-
if (
|
|
25
|
-
const
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
28
|
-
|
|
21
|
+
function n(e) {
|
|
22
|
+
return function(...t) {
|
|
23
|
+
const i = t.length > 2 ? t[2] : void 0;
|
|
24
|
+
if (i) {
|
|
25
|
+
const u = s, p = String(i);
|
|
26
|
+
if (s = p, u === p)
|
|
27
|
+
return e.apply(this, t);
|
|
28
|
+
r();
|
|
29
29
|
}
|
|
30
|
-
return
|
|
30
|
+
return e.apply(this, t);
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
a(o.history, "pushState", n), a(o.history, "replaceState", n);
|
|
34
34
|
}
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
d as singlePageAppPlugin
|
|
37
37
|
};
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEvent as i, createStore as v, createEffect as C, sample as n, attach as S } from "effector";
|
|
2
|
-
import { h as F } from "../../experience-instance-
|
|
2
|
+
import { h as F } from "../../experience-instance-8P1fJuPC.js";
|
|
3
3
|
function R() {
|
|
4
4
|
let c, p;
|
|
5
5
|
return {
|