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

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