@picked/client 0.0.1-dev.1785305085063 → 0.0.1-dev.1785826066660

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 (188) hide show
  1. package/dist/.tsbuildinfo +1 -0
  2. package/dist/api-Djuh2gfe.cjs +1 -0
  3. package/dist/api-d0qKmzPH.js +38 -0
  4. package/dist/cjs/form/index.js +1 -1
  5. package/dist/cjs/index.js +2 -2
  6. package/dist/cjs/plugins/dom-observer/index.js +1 -1
  7. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  8. package/dist/cjs/server/index.js +1 -1
  9. package/dist/docs/actions.mdx +38 -18
  10. package/dist/docs/api/authentication.md +75 -48
  11. package/dist/docs/api/authorization-and-scopes.md +63 -47
  12. package/dist/docs/api/error-handling.md +70 -54
  13. package/dist/docs/api/index.md +41 -22
  14. package/dist/docs/api/pagination.md +30 -20
  15. package/dist/docs/api-keys.mdx +11 -6
  16. package/dist/docs/chrome-extension.md +22 -5
  17. package/dist/docs/conditions.mdx +32 -19
  18. package/dist/docs/content/asset-library.mdx +65 -34
  19. package/dist/docs/content/content-entries.mdx +8 -2
  20. package/dist/docs/content/layouts.mdx +45 -29
  21. package/dist/docs/content/pages.mdx +29 -14
  22. package/dist/docs/content/sections.mdx +19 -8
  23. package/dist/docs/delivery-api/experience-content.md +10 -5
  24. package/dist/docs/delivery-api/index.md +19 -12
  25. package/dist/docs/delivery-api/preview-caching-crawling.md +27 -14
  26. package/dist/docs/delivery-api/project-config.md +6 -4
  27. package/dist/docs/experiences.mdx +26 -10
  28. package/dist/docs/features.mdx +93 -22
  29. package/dist/docs/fields.mdx +42 -27
  30. package/dist/docs/flow-builder/building-flows.md +38 -20
  31. package/dist/docs/flow-builder/condition-builder.md +32 -21
  32. package/dist/docs/flow-builder/keyboard-shortcuts.md +18 -18
  33. package/dist/docs/flow-builder/nodes.md +26 -13
  34. package/dist/docs/flow-builder/overview.mdx +28 -15
  35. package/dist/docs/gtm-template.md +35 -26
  36. package/dist/docs/guides/build-a-personalized-page.mdx +36 -18
  37. package/dist/docs/image-optimisation-service.md +33 -17
  38. package/dist/docs/index.md +28 -17
  39. package/dist/docs/mcp.md +47 -39
  40. package/dist/docs/pickedql/data-sources.md +65 -43
  41. package/dist/docs/pickedql/dimensions.md +27 -12
  42. package/dist/docs/pickedql/examples.md +38 -26
  43. package/dist/docs/pickedql/filtering.md +10 -6
  44. package/dist/docs/pickedql/index.md +32 -14
  45. package/dist/docs/pickedql/schema.md +85 -76
  46. package/dist/docs/pickedql/virtual-functions.md +62 -36
  47. package/dist/docs/projects.mdx +14 -7
  48. package/dist/docs/reports.mdx +5 -3
  49. package/dist/docs/sdk/actions.md +33 -17
  50. package/dist/docs/sdk/conditions.md +8 -5
  51. package/dist/docs/sdk/content-security-policy.md +5 -4
  52. package/dist/docs/sdk/experiences.md +29 -11
  53. package/dist/docs/sdk/feature-allocation.md +161 -0
  54. package/dist/docs/sdk/features.md +181 -73
  55. package/dist/docs/sdk/fields.md +66 -42
  56. package/dist/docs/sdk/index.md +25 -10
  57. package/dist/docs/sdk/plugins/create-experience.md +18 -15
  58. package/dist/docs/sdk/plugins/dynamic-experiences.md +43 -17
  59. package/dist/docs/sdk/predicates.md +53 -37
  60. package/dist/docs/sdk/ssr/index.md +25 -8
  61. package/dist/docs/sdk/ssr/rendering-and-hydration.md +37 -16
  62. package/dist/docs/sdk/ssr/serialize.md +38 -20
  63. package/dist/docs/sdk/ssr/slots-and-placements.md +28 -10
  64. package/dist/docs/sdk/steps.md +100 -55
  65. package/dist/docs/steps.mdx +20 -11
  66. package/dist/docs/team-management.md +17 -11
  67. package/dist/docs/vite-plugin.md +26 -19
  68. package/dist/docs/workspace-versioning.mdx +14 -8
  69. package/dist/docs/workspaces.mdx +55 -24
  70. package/dist/{dom-BwmTHeT7.js → dom-BqcToNL0.js} +1 -3
  71. package/dist/{dom-CDrHc_j9.cjs → dom-DlLH3FxV.cjs} +1 -1
  72. package/dist/esm/form/index.js +2 -4
  73. package/dist/esm/index.js +376 -308
  74. package/dist/esm/plugins/dom-observer/index.js +1 -1
  75. package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
  76. package/dist/esm/preview/index.js +1 -1
  77. package/dist/esm/server/index.js +13 -11
  78. package/dist/{experience-instance-DOJShRk5.js → experience-instance-DGk11d8a.js} +3 -3
  79. package/dist/experience-instance-Dej3P1sE.cjs +1 -0
  80. package/dist/{plugin-CFXwbXeM.js → plugin-BVAFWjpT.js} +60 -55
  81. package/dist/plugin-BcCn2llk.cjs +1 -0
  82. package/dist/{preview-channel-DW9J8t4B.js → preview-channel-CSr96XAo.js} +1 -1
  83. package/dist/{protocol-DSqOlW2r.js → protocol-C5KkkiZc.js} +1 -1
  84. package/dist/types/client.d.ts +7 -6
  85. package/dist/types/entities/action/action.d.ts +5 -4
  86. package/dist/types/entities/action/action.d.ts.map +1 -1
  87. package/dist/types/entities/component/component.d.ts +6 -5
  88. package/dist/types/entities/component/component.d.ts.map +1 -1
  89. package/dist/types/entities/condition/condition.d.ts +5 -5
  90. package/dist/types/entities/content/content.d.ts +4 -3
  91. package/dist/types/entities/content/reference.d.ts +101 -0
  92. package/dist/types/entities/content/reference.d.ts.map +1 -0
  93. package/dist/types/entities/experience/experience.d.ts +11 -10
  94. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  95. package/dist/types/entities/experience-instance/experience-instance.d.ts +10 -9
  96. package/dist/types/entities/feature/feature.d.ts +3 -2
  97. package/dist/types/entities/feature/feature.d.ts.map +1 -1
  98. package/dist/types/entities/field/field.d.ts +7 -6
  99. package/dist/types/entities/framework/framework.d.ts +7 -6
  100. package/dist/types/entities/framework/framework.d.ts.map +1 -1
  101. package/dist/types/entities/history/history.d.ts +6 -6
  102. package/dist/types/entities/plugin/plugin.d.ts +3 -2
  103. package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
  104. package/dist/types/entities/predicate/predicate.d.ts +4 -3
  105. package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
  106. package/dist/types/entities/response/response-validation.d.ts +3 -2
  107. package/dist/types/entities/response/response.d.ts +12 -11
  108. package/dist/types/entities/session/session.d.ts +2 -1
  109. package/dist/types/entities/step/step.d.ts +6 -5
  110. package/dist/types/exports.d.ts +4 -1
  111. package/dist/types/exports.d.ts.map +1 -1
  112. package/dist/types/form/build-responses.d.ts +2 -1
  113. package/dist/types/form/create-field-evaluator.d.ts +4 -3
  114. package/dist/types/form/create-field-validation.d.ts +5 -4
  115. package/dist/types/form/create-form.d.ts +7 -6
  116. package/dist/types/form/create-submit-pipeline.d.ts +7 -6
  117. package/dist/types/form/get-step-fields.d.ts +3 -2
  118. package/dist/types/index.d.ts +1 -0
  119. package/dist/types/index.d.ts.map +1 -1
  120. package/dist/types/lifecycle/condition-selection.d.ts +14 -4
  121. package/dist/types/lifecycle/lifecycle.d.ts +4 -3
  122. package/dist/types/lifecycle/rules-logic.d.ts +4 -3
  123. package/dist/types/lifecycle/state-snapshot.d.ts +4 -3
  124. package/dist/types/picked.d.ts +64 -62
  125. package/dist/types/picked.d.ts.map +1 -1
  126. package/dist/types/ping.d.ts +1 -1
  127. package/dist/types/ping.d.ts.map +1 -1
  128. package/dist/types/plugins/create-experience/create-experience.d.ts +9 -8
  129. package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
  130. package/dist/types/plugins/create-experience/plugin.d.ts +3 -2
  131. package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
  132. package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
  133. package/dist/types/plugins/dom-observer/plugin.d.ts +1 -1
  134. package/dist/types/plugins/dynamic-experiences/hash.d.ts +40 -5
  135. package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +1 -1
  136. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +3 -3
  137. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  138. package/dist/types/plugins/dynamic-experiences/types.d.ts +18 -5
  139. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  140. package/dist/types/plugins/experience-browser-storage/plugin.d.ts +1 -1
  141. package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
  142. package/dist/types/plugins/history-browser-storage/plugin.d.ts +1 -1
  143. package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -1
  144. package/dist/types/plugins/responses-browser-storage/plugin.d.ts +1 -1
  145. package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -1
  146. package/dist/types/plugins/responses-indexeddb/plugin.d.ts +1 -1
  147. package/dist/types/plugins/single-page-app/plugin.d.ts +1 -1
  148. package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
  149. package/dist/types/plugins/web-components/plugin.d.ts +2 -1
  150. package/dist/types/plugins/window-object/plugin.d.ts +2 -2
  151. package/dist/types/preview-channel.d.ts +5 -1
  152. package/dist/types/preview-receiver/index.d.ts +18 -1
  153. package/dist/types/preview-receiver/protocol.d.ts +10 -1
  154. package/dist/types/server/index.d.ts +3 -3
  155. package/dist/types/server/serialize.d.ts +8 -3
  156. package/dist/types/server/serialize.d.ts.map +1 -1
  157. package/dist/types/utils/dom.d.ts +2 -1
  158. package/dist/types/utils/events.d.ts +6 -6
  159. package/dist/types/utils/events.d.ts.map +1 -1
  160. package/dist/types/utils/global-obj.d.ts +1 -1
  161. package/dist/types/utils/global-obj.d.ts.map +1 -1
  162. package/dist/types/utils/id.d.ts.map +1 -1
  163. package/dist/types/utils/logger.d.ts +2 -1
  164. package/dist/types/utils/logger.d.ts.map +1 -1
  165. package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +2 -1
  166. package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +2 -1
  167. package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
  168. package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
  169. package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
  170. package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
  171. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +1 -1
  172. package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
  173. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +1 -1
  174. package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
  175. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +1 -1
  176. package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
  177. package/dist/types/utils/nodes.d.ts +1 -1
  178. package/dist/types/utils/picked-config.d.ts +2 -1
  179. package/dist/types/utils/rehydrate-scripts.d.ts +6 -0
  180. package/dist/types/utils/rehydrate-scripts.d.ts.map +1 -1
  181. package/dist/types/utils/rules-logic.d.ts +6 -2
  182. package/dist/types/utils/storage.d.ts +1 -1
  183. package/dist/types/utils/storage.d.ts.map +1 -1
  184. package/package.json +22 -23
  185. package/dist/api-CPL40b7A.js +0 -40
  186. package/dist/api-Dz5rgRgQ.cjs +0 -1
  187. package/dist/experience-instance-DurC3pE-.cjs +0 -1
  188. package/dist/plugin-m4qekgtA.cjs +0 -1
package/dist/esm/index.js CHANGED
@@ -2,16 +2,16 @@ 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 _, i as v, r as ee, s as y, t as b } from "../dom-BwmTHeT7.js";
6
- import { l as x, n as S, r as C, u as w } from "../experience-instance-DOJShRk5.js";
5
+ import { a as _, i as v, r as ee, s as y, t as b } from "../dom-BqcToNL0.js";
6
+ import { l as x, n as S, r as C, u as w } from "../experience-instance-DGk11d8a.js";
7
7
  import { i as T, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
8
- import { n as te, r as ne } from "../api-CPL40b7A.js";
8
+ import { n as te, r as ne } from "../api-d0qKmzPH.js";
9
9
  import { t as re } from "../id-Bo4RBeOs.js";
10
10
  import { n as ie, r as ae, t as oe } from "../inert-script-report-B_bMPRzp.js";
11
- import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, sample as I } from "effector";
11
+ import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as se, sample as I } from "effector";
12
12
  import { createFactory as L, invoke as R } from "@withease/factories";
13
13
  //#region src/entities/experience/experience.ts
14
- var z = M("experience"), se = L(({ client: e, experience: r }) => {
14
+ var z = M("experience"), ce = L(({ client: e, experience: r }) => {
15
15
  let i = z.store(r), a = j(i, { merge(e, t) {
16
16
  return {
17
17
  ...e,
@@ -38,18 +38,18 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
38
38
  n ? e.experienceInstances.spawn(u, t, n) : e.experienceInstances.spawn(u, t);
39
39
  });
40
40
  }
41
- }), f = k({
42
- source: A({
43
- preconditionPassed: e.preconditionPassedStore,
44
- isUser: e.session.store.map((e) => e.isUser, { skipVoid: !1 }),
45
- config: o
46
- }),
41
+ }), f = A({
42
+ preconditionPassed: e.preconditionPassedStore,
43
+ isUser: e.session.store.map((e) => e.isUser, { skipVoid: !1 }),
44
+ config: o
45
+ }), p = k({
46
+ source: f,
47
47
  effect: async ({ preconditionPassed: i, isUser: a, config: o }) => {
48
48
  if (!i || !a) return !1;
49
49
  let { decisionLogic: s, targetSelectors: c } = o;
50
- return c.length === 0 || v(c, r.id).length < 1 ? !1 : s === void 0 ? !0 : t(s) ? await n(e, s) === !0 : !0;
50
+ return c.length === 0 || v(c, r.id).length < 1 ? !1 : s === void 0 || !t(s) || await n(e, s) === !0;
51
51
  }
52
- }), p = N(async () => {
52
+ }), m = N(async () => {
53
53
  if (!e.contentLoader) return !0;
54
54
  try {
55
55
  await e.contentLoader({
@@ -60,28 +60,28 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
60
60
  `${r.id}`;
61
61
  }
62
62
  return !0;
63
- }), m = P(), h = P(), g = z.createStore(void 0, { skipVoid: !1 }).on(m, (e, t) => t).on(h, (e, t) => t);
63
+ }), h = P(), g = P(), _ = z.createStore(void 0, { skipVoid: !1 }).on(h, (e, t) => t).on(g, (e, t) => t);
64
64
  return I({
65
- clock: m,
66
- target: f
65
+ clock: h,
66
+ target: p
67
67
  }), I({
68
- clock: f.doneData,
69
- source: g,
68
+ clock: p.doneData,
69
+ source: _,
70
70
  filter: (e, t) => t,
71
71
  fn: (e) => e,
72
72
  target: d
73
73
  }), I({
74
- clock: f.doneData,
74
+ clock: p.doneData,
75
75
  filter: Boolean,
76
- target: p
76
+ target: m
77
77
  }), I({
78
- clock: h,
79
- source: g,
78
+ clock: g,
79
+ source: _,
80
80
  fn: (e) => e,
81
81
  target: d
82
82
  }), I({
83
- clock: h,
84
- target: p
83
+ clock: g,
84
+ target: m
85
85
  }), u = {
86
86
  id: r.id,
87
87
  key: r.key,
@@ -92,23 +92,23 @@ var z = M("experience"), se = L(({ client: e, experience: r }) => {
92
92
  actions: l,
93
93
  merge: a.merge,
94
94
  initialiseFx: d,
95
- shouldInitialiseFx: f,
96
- initialiseRequested: m,
97
- initialiseDirectly: h,
98
- prepareExperienceContentFx: p
95
+ shouldInitialiseFx: p,
96
+ initialiseRequested: h,
97
+ initialiseDirectly: g,
98
+ prepareExperienceContentFx: m
99
99
  }, u;
100
100
  });
101
- function ce(e) {
102
- return R(se, e);
101
+ function le(e) {
102
+ return R(ce, e);
103
103
  }
104
- var le = L(({ client: e }) => {
104
+ var ue = L(({ client: e }) => {
105
105
  let t = z.store({}), n = j(t, { register(e, t) {
106
106
  return {
107
107
  ...e,
108
108
  [t.id]: t
109
109
  };
110
110
  } }), r = P(), i = N((t) => {
111
- n.register(ce({
111
+ n.register(le({
112
112
  client: e,
113
113
  experience: t
114
114
  }));
@@ -169,7 +169,7 @@ var le = L(({ client: e }) => {
169
169
  for (let e of i) e.open();
170
170
  return;
171
171
  }
172
- await c("key" in n ? {
172
+ let a = "key" in n ? {
173
173
  key: n.key,
174
174
  options: {
175
175
  ...n.options,
@@ -181,7 +181,8 @@ var le = L(({ client: e }) => {
181
181
  ...n.options,
182
182
  initialiseOpen: !0
183
183
  }
184
- });
184
+ };
185
+ await c(a);
185
186
  }
186
187
  }),
187
188
  listStore: a,
@@ -193,20 +194,20 @@ var le = L(({ client: e }) => {
193
194
  })
194
195
  };
195
196
  });
196
- function ue(e) {
197
- return R(le, e);
197
+ function de(e) {
198
+ return R(ue, e);
198
199
  }
199
- var de = async (e) => {
200
+ var fe = async (e) => {
200
201
  await e.experiences.initialiseExperiencesFx();
201
202
  };
202
203
  //#endregion
203
204
  //#region src/entities/plugin/plugin.ts
204
- function fe(e) {
205
+ function pe(e) {
205
206
  return N(async () => {
206
207
  await e();
207
208
  });
208
209
  }
209
- var pe = (e, t, n) => {
210
+ var me = (e, t, n) => {
210
211
  let r = t.name, i = t.setup(e);
211
212
  if (i) {
212
213
  let e = n[r] ?? {};
@@ -215,16 +216,16 @@ var pe = (e, t, n) => {
215
216
  ...i
216
217
  });
217
218
  }
218
- }, me = M("component"), he = L(({ client: e, component: t, name: n }) => ({
219
+ }, he = M("component"), ge = L(({ client: e, component: t, name: n }) => ({
219
220
  name: n,
220
221
  component: t,
221
222
  frameworkStore: e.frameworks.getByName(t.frameworkName)
222
223
  }));
223
- function ge(e) {
224
- return R(he, e);
224
+ function _e(e) {
225
+ return R(ge, e);
225
226
  }
226
- var _e = L(({ client: e }) => {
227
- let t = me.store({}), n = j(t, { register(e, t) {
227
+ var ve = L(({ client: e }) => {
228
+ let t = he.store({}), n = j(t, { register(e, t) {
228
229
  return {
229
230
  ...e,
230
231
  [t.name]: t
@@ -237,7 +238,7 @@ var _e = L(({ client: e }) => {
237
238
  fn: (e, { name: t }) => `Component '${t}' already registered. Registering again will override the previous registration.`
238
239
  }).watch((e) => /* @__PURE__ */ r("warn", e)), I({
239
240
  clock: i,
240
- fn: ({ name: t, component: n }) => ge({
241
+ fn: ({ name: t, component: n }) => _e({
241
242
  client: e,
242
243
  name: t,
243
244
  component: n
@@ -254,16 +255,16 @@ var _e = L(({ client: e }) => {
254
255
  listStore: a
255
256
  };
256
257
  });
257
- function ve(e) {
258
- return R(_e, e);
258
+ function ye(e) {
259
+ return R(ve, e);
259
260
  }
260
- var B = (e, t, n) => {
261
+ var be = (e, t, n) => {
261
262
  n.register({
262
263
  name: e,
263
264
  component: t
264
265
  });
265
- }, ye = M("framework"), be = L((e) => {
266
- let t = ye.store({}), n = j(t, { register(e, t) {
266
+ }, xe = M("framework"), Se = L((e) => {
267
+ let t = xe.store({}), n = j(t, { register(e, t) {
267
268
  return {
268
269
  ...e,
269
270
  [t.name]: t.framework
@@ -288,15 +289,15 @@ var B = (e, t, n) => {
288
289
  listStore: a
289
290
  };
290
291
  });
291
- function xe(e) {
292
- return R(be, e);
292
+ function Ce(e) {
293
+ return R(Se, e);
293
294
  }
294
- var Se = (e, t) => {
295
+ var we = (e, t) => {
295
296
  t.register({
296
297
  name: e.name,
297
298
  framework: e
298
299
  });
299
- }, Ce = L(({ client: e }) => {
300
+ }, Te = L(({ client: e }) => {
300
301
  let t = "window" in globalThis, n = {
301
302
  location: t ? globalThis.location : void 0,
302
303
  document: t ? globalThis.document : void 0,
@@ -310,84 +311,84 @@ var Se = (e, t) => {
310
311
  ...n
311
312
  }));
312
313
  });
313
- function we(e) {
314
- return R(Ce, e);
314
+ function Ee(e) {
315
+ return R(Te, e);
315
316
  }
316
317
  //#endregion
317
318
  //#region src/logic-engine.ts
318
- function Te(e) {
319
+ function De(e) {
319
320
  return typeof e == "number" && !isNaN(e);
320
321
  }
321
- function V(e) {
322
+ function B(e) {
322
323
  return typeof e == "string";
323
324
  }
324
- function H(e) {
325
+ function V(e) {
325
326
  return Array.isArray(e);
326
327
  }
327
- function Ee(e) {
328
+ function Oe(e) {
328
329
  return e instanceof Promise;
329
330
  }
330
- function De(e) {
331
+ function ke(e) {
331
332
  return typeof e == "object" && !!e && !Array.isArray(e) && Object.keys(e).length === 1;
332
333
  }
333
- function U(e) {
334
- if (Te(e)) return e;
334
+ function H(e) {
335
+ if (De(e)) return e;
335
336
  let t = parseFloat(`${e}`);
336
337
  return isNaN(t) ? 0 : t;
337
338
  }
338
- function W(e) {
339
+ function U(e) {
339
340
  return `${e}`;
340
341
  }
341
- var Oe = {
342
+ var Ae = {
342
343
  "==": (e, t) => e == t,
343
344
  "===": (e, t) => e === t,
344
345
  "!=": (e, t) => e != t,
345
346
  "!==": (e, t) => e !== t,
346
- ">": (e, t) => U(e) > U(t),
347
- ">=": (e, t) => U(e) >= U(t),
347
+ ">": (e, t) => H(e) > H(t),
348
+ ">=": (e, t) => H(e) >= H(t),
348
349
  "<": (e, t, n) => {
349
- let r = U(e), i = U(t);
350
+ let r = H(e), i = H(t);
350
351
  if (n === void 0) return r < i;
351
- let a = U(n);
352
+ let a = H(n);
352
353
  return r < i && i < a;
353
354
  },
354
355
  "<=": (e, t, n) => {
355
- let r = U(e), i = U(t);
356
+ let r = H(e), i = H(t);
356
357
  if (n === void 0) return r <= i;
357
- let a = U(n);
358
+ let a = H(n);
358
359
  return r <= i && i <= a;
359
360
  },
360
- "!!": async (e) => await K(e),
361
- "!": async (e) => !await K(e),
362
- "%": (e, t) => U(e) % U(t),
361
+ "!!": async (e) => await G(e),
362
+ "!": async (e) => !await G(e),
363
+ "%": (e, t) => H(e) % H(t),
363
364
  log: (e) => (console.log(e), e),
364
- in: (e, t) => t ? V(t) ? t.indexOf(W(e)) !== -1 : H(t) ? t.includes(e) : !1 : !1,
365
- cat: (...e) => e.map(W).join(""),
365
+ in: (e, t) => t ? B(t) ? t.indexOf(U(e)) !== -1 : V(t) ? t.includes(e) : !1 : !1,
366
+ cat: (...e) => e.map(U).join(""),
366
367
  substr: (e, t, n) => {
367
- let r = W(e), i = U(t);
368
+ let r = U(e), i = H(t);
368
369
  if (n === void 0) return r.substr(i);
369
- let a = U(n);
370
+ let a = H(n);
370
371
  if (a < 0) {
371
372
  let e = r.substr(i);
372
373
  return e.substr(0, e.length + a);
373
374
  }
374
375
  return r.substr(i, a);
375
376
  },
376
- "+": (...e) => e.reduce((e, t) => U(e) + U(t), 0),
377
- "*": (...e) => e.reduce((e, t) => U(e) * U(t), 1),
377
+ "+": (...e) => e.reduce((e, t) => H(e) + H(t), 0),
378
+ "*": (...e) => e.reduce((e, t) => H(e) * H(t), 1),
378
379
  "-": (e, t) => {
379
- let n = U(e);
380
- return t === void 0 ? -n : n - U(t);
380
+ let n = H(e);
381
+ return t === void 0 ? -n : n - H(t);
381
382
  },
382
- "/": (e, t) => U(e) / U(t),
383
- min: (...e) => Math.min(...e.map(U)),
384
- max: (...e) => Math.max(...e.map(U)),
385
- merge: (...e) => e.reduce((e, t) => H(t) ? e.concat(t) : e.concat([t]), []),
383
+ "/": (e, t) => H(e) / H(t),
384
+ min: (...e) => Math.min(...e.map(H)),
385
+ max: (...e) => Math.max(...e.map(H)),
386
+ merge: (...e) => e.reduce((e, t) => V(t) ? e.concat(t) : e.concat([t]), []),
386
387
  var(e, t) {
387
388
  let n = arguments.length > 1 ? t : null;
388
389
  if (e === "" || e === "." || e == null) return this;
389
390
  if (typeof e == "number" && Array.isArray(this)) return e >= 0 && e < this.length ? this[e] : n;
390
- let r = W(e);
391
+ let r = U(e);
391
392
  if (r === "" || r === ".") return this;
392
393
  let i = r.split("."), a = this;
393
394
  for (let e of i) {
@@ -400,126 +401,126 @@ var Oe = {
400
401
  return a === void 0 ? n : a;
401
402
  },
402
403
  async missing(...e) {
403
- let t = H(e[0]) ? e[0] : e, n = [];
404
+ let t = V(e[0]) ? e[0] : e, n = [];
404
405
  for (let e of t) {
405
- let t = await G({ var: e }, this);
406
+ let t = await W({ var: e }, this);
406
407
  (t === null || t === "") && n.push(`${e}`);
407
408
  }
408
409
  return n;
409
410
  },
410
411
  async missing_some(e, t) {
411
- let n = await G({ missing: t }, this);
412
- if (!H(n) || !H(t)) return [];
413
- let r = n.filter(V);
414
- return t.filter(V).length - r.length >= U(e) ? [] : r;
412
+ let n = await W({ missing: t }, this);
413
+ if (!V(n) || !V(t)) return [];
414
+ let r = n.filter(B);
415
+ return t.filter(B).length - r.length >= H(e) ? [] : r;
415
416
  },
416
417
  invoke(...e) {
417
418
  let [t, ...n] = e;
418
419
  return typeof t == "function" ? Reflect.apply(t, null, n) : null;
419
420
  },
420
- startsWith: (e, t) => V(e) && V(t) && e.startsWith(t),
421
- endsWith: (e, t) => V(e) && V(t) && e.endsWith(t),
421
+ startsWith: (e, t) => B(e) && B(t) && e.startsWith(t),
422
+ endsWith: (e, t) => B(e) && B(t) && e.endsWith(t),
422
423
  regexp_matches(e, t) {
423
424
  let n = e, r = "";
424
- if (H(e)) {
425
+ if (V(e)) {
425
426
  let [t, i] = e;
426
427
  n = t, r = i;
427
428
  }
428
- return !V(n) || !V(r) ? !1 : new RegExp(n, r).test(W(t));
429
+ return !B(n) || !B(r) ? !1 : new RegExp(n, r).test(U(t));
429
430
  },
430
431
  throw(e) {
431
- throw Error(W(e));
432
+ throw Error(U(e));
432
433
  }
433
434
  };
434
- async function G(e, t) {
435
+ async function W(e, t) {
435
436
  if (!e) return e;
436
- if (Ee(e)) return G(await e, t);
437
- if (H(e)) return Promise.all(e.map((e) => G(e, t)));
438
- if (!De(e)) return e;
439
- let n = ke(e), r = n ? e[n] ?? [] : [];
440
- switch (H(r) || (r = [r]), n) {
437
+ if (Oe(e)) return W(await e, t);
438
+ if (V(e)) return Promise.all(e.map((e) => W(e, t)));
439
+ if (!ke(e)) return e;
440
+ let n = je(e), r = n ? e[n] ?? [] : [];
441
+ switch (V(r) || (r = [r]), n) {
441
442
  case "if":
442
443
  case "?:":
443
- for (let e = 0; e < r.length - 1; e += 2) if (await K(await G(r[e], t))) return G(r[e + 1], t);
444
- return r.length % 2 == 1 ? G(r[r.length - 1], t) : null;
444
+ for (let e = 0; e < r.length - 1; e += 2) if (await G(await W(r[e], t))) return W(r[e + 1], t);
445
+ return r.length % 2 == 1 ? W(r[r.length - 1], t) : null;
445
446
  case "and": {
446
447
  let e = null;
447
- for (let n of r) if (e = await G(n, t), !await K(e)) return e;
448
+ for (let n of r) if (e = await W(n, t), !await G(e)) return e;
448
449
  return e;
449
450
  }
450
451
  case "or": {
451
452
  let e = null;
452
- for (let n of r) if (e = await G(n, t), await K(e)) return e;
453
+ for (let n of r) if (e = await W(n, t), await G(e)) return e;
453
454
  return e;
454
455
  }
455
456
  case "map": {
456
- let e = await G(r[0], t);
457
- return H(e) ? await Promise.all(e.map((e) => G(r[1], e))) : [];
457
+ let e = await W(r[0], t);
458
+ return V(e) ? await Promise.all(e.map((e) => W(r[1], e))) : [];
458
459
  }
459
460
  case "filter": {
460
- let e = await G(r[0], t);
461
- return H(e) ? (await Promise.all(e.map(async (e) => ({
461
+ let e = await W(r[0], t);
462
+ return V(e) ? (await Promise.all(e.map(async (e) => ({
462
463
  item: e,
463
- shouldInclude: await K(await G(r[1], e))
464
+ shouldInclude: await G(await W(r[1], e))
464
465
  })))).filter(({ shouldInclude: e }) => e).map(({ item: e }) => e) : [];
465
466
  }
466
467
  case "reduce": {
467
- let e = await G(r[0], t);
468
- if (!H(e)) return r.length > 2 ? await G(r[2], t) : null;
469
- let n = r[1], i = r.length > 2 ? await G(r[2], t) : null;
470
- for (let t of e) i = await G(n, {
468
+ let e = await W(r[0], t);
469
+ if (!V(e)) return r.length > 2 ? await W(r[2], t) : null;
470
+ let n = r[1], i = r.length > 2 ? await W(r[2], t) : null;
471
+ for (let t of e) i = await W(n, {
471
472
  current: t,
472
473
  accumulator: i
473
474
  });
474
475
  return i;
475
476
  }
476
477
  case "all": {
477
- let e = await G(r[0], t);
478
- if (!H(e) || e.length === 0) return !1;
479
- for (let t of e) if (!await K(await G(r[1], t))) return !1;
478
+ let e = await W(r[0], t);
479
+ if (!V(e) || e.length === 0) return !1;
480
+ for (let t of e) if (!await G(await W(r[1], t))) return !1;
480
481
  return !0;
481
482
  }
482
483
  case "some": {
483
- let e = await G(r[0], t);
484
- if (!H(e)) return !1;
485
- for (let t of e) if (await K(await G(r[1], t))) return !0;
484
+ let e = await W(r[0], t);
485
+ if (!V(e)) return !1;
486
+ for (let t of e) if (await G(await W(r[1], t))) return !0;
486
487
  return !1;
487
488
  }
488
489
  case "none": {
489
- let e = await G(r[0], t);
490
- if (!H(e)) return !0;
491
- for (let t of e) if (await K(await G(r[1], t))) return !1;
490
+ let e = await W(r[0], t);
491
+ if (!V(e)) return !0;
492
+ for (let t of e) if (await G(await W(r[1], t))) return !1;
492
493
  return !0;
493
494
  }
494
495
  case "catch": try {
495
- return await G(r[0], t);
496
+ return await W(r[0], t);
496
497
  } catch (e) {
497
- return De(e) ? await G(e, t) : r[1] ? await G(r[1], e) : e instanceof Error ? e.message : e;
498
+ return ke(e) ? await W(e, t) : r[1] ? await W(r[1], e) : e instanceof Error ? e.message : e;
498
499
  }
499
500
  }
500
- let i = await Promise.all(r.map((e) => G(e, t))), a = n ? Oe[n] : void 0;
501
+ let i = await Promise.all(r.map((e) => W(e, t))), a = n ? Ae[n] : void 0;
501
502
  if (!a) throw Error(`Unrecognized operation ${n}`);
502
503
  return a.apply(t, i);
503
504
  }
504
- async function K(e) {
505
- return Ee(e) ? K(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
505
+ async function G(e) {
506
+ return Oe(e) ? G(await e) : !(Array.isArray(e) && e.length === 0) && !!e;
506
507
  }
507
- function ke(e) {
508
+ function je(e) {
508
509
  return Object.keys(e)[0];
509
510
  }
510
511
  //#endregion
511
512
  //#region src/lifecycle/rules-logic.ts
512
- function Ae(e, t, n) {
513
+ function Me(e, t, n) {
513
514
  return new Proxy(Object.create(null), { get(r, i) {
514
515
  if (typeof i != "string") return;
515
516
  let a = e.find((e) => e.key === i);
516
- if (a !== void 0) return async () => n.has(i) ? !1 : await G(a.logic, {
517
+ if (a !== void 0) return async () => !n.has(i) && await W(a.logic, {
517
518
  ...t,
518
- conditions: Ae(e, t, new Set(n).add(i))
519
+ conditions: Me(e, t, new Set(n).add(i))
519
520
  }) === !0;
520
521
  } });
521
522
  }
522
- var je = L(({ client: e }) => k({
523
+ var Ne = L(({ client: e }) => k({
523
524
  source: {
524
525
  stateSnapshot: e.stateSnapshotStore,
525
526
  predicates: e.predicates.listStore,
@@ -556,21 +557,21 @@ var je = L(({ client: e }) => k({
556
557
  features: u,
557
558
  ...s
558
559
  };
559
- return await G(o, {
560
+ return await W(o, {
560
561
  ...d,
561
- conditions: Ae(a, d, /* @__PURE__ */ new Set())
562
+ conditions: Me(a, d, /* @__PURE__ */ new Set())
562
563
  });
563
564
  }
564
565
  }));
565
- function Me(e) {
566
- return R(je, e);
566
+ function Pe(e) {
567
+ return R(Ne, e);
567
568
  }
568
569
  //#endregion
569
570
  //#region src/ping.ts
570
- var Ne = 6e3, Pe = O("last_ping", "global"), Fe = async (e) => {
571
+ var Fe = 6e3, Ie = O("last_ping", "global"), Le = async (e) => {
571
572
  try {
572
- let t = Date.now(), n = E.get(Pe), r = 0;
573
- if (n.isSet() && (r = n.json() ?? 0), r && t - r < Ne) return !0;
573
+ let t = Date.now(), n = E.get(Ie), r = 0;
574
+ if (n.isSet() && (r = n.json() ?? 0), r && t - r < Fe) return !0;
574
575
  let i = {
575
576
  projectId: e.projectId,
576
577
  path: window.location.pathname
@@ -581,27 +582,27 @@ var Ne = 6e3, Pe = O("last_ping", "global"), Fe = async (e) => {
581
582
  } catch {
582
583
  return !1;
583
584
  }
584
- }, q = M("lifecycle"), Ie = L(({ client: e }) => {
585
- let t = q.store(!1), r = F(void 0, {
585
+ }, K = M("lifecycle"), Re = L(({ client: e }) => {
586
+ let t = K.store(!1), r = F(void 0, {
586
587
  skipVoid: !1,
587
- domain: q
588
+ domain: K
588
589
  }), i = F(void 0, {
589
590
  skipVoid: !1,
590
- domain: q
591
- }), a = q.store("idle"), o = q.store([]), s = F(void 0, {
591
+ domain: K
592
+ }), a = K.store("idle"), o = K.store([]), s = F(void 0, {
592
593
  skipVoid: !1,
593
- domain: q
594
+ domain: K
594
595
  }), l = F(void 0, {
595
596
  skipVoid: !1,
596
- domain: q
597
+ domain: K
597
598
  }), u = P(), d = P(), f = P(), p = P(), m = P(), h = P();
598
599
  o.on(p, (e, t) => [...e, t]), s.on(m, (e, t) => t), l.on(h, (e, t) => t), t.on(d, () => !0);
599
600
  let g = N(() => {
600
- Fe(e);
601
+ Le(e);
601
602
  }), _ = N(async () => {
602
603
  await ee();
603
604
  }), v = N(async () => {
604
- await de(e);
605
+ await fe(e);
605
606
  }), y = k({ effect: v }), b = k({
606
607
  source: o,
607
608
  effect: async (e) => {
@@ -670,19 +671,23 @@ var Ne = 6e3, Pe = O("last_ping", "global"), Fe = async (e) => {
670
671
  target: e.eventBus
671
672
  });
672
673
  let w = F(!1).on(_.done, () => !0), T = F(!1).on(f, () => !0), E = F(!1).on(y.done, () => !0), D = A(r, i, (e, t) => e === !0 && t === !0);
673
- return I({
674
+ I({
674
675
  clock: f,
675
676
  source: D,
676
677
  filter: (e) => e,
677
678
  fn: () => void 0,
678
679
  target: v
679
- }), I({
680
- clock: A(w, T, D, (e, t, n) => e && t && n),
680
+ });
681
+ let O = A(w, T, D, (e, t, n) => e && t && n);
682
+ I({
683
+ clock: O,
681
684
  filter: (e) => e,
682
685
  fn: () => void 0,
683
686
  target: y
684
- }), I({
685
- clock: A(w, T, D, E, (e, t, n, r) => e && t && (!n || r)),
687
+ });
688
+ let te = A(w, T, D, E, (e, t, n, r) => e && t && (!n || r));
689
+ return I({
690
+ clock: te,
686
691
  filter: (e) => e,
687
692
  fn: () => void 0,
688
693
  target: d
@@ -726,13 +731,13 @@ var Ne = 6e3, Pe = O("last_ping", "global"), Fe = async (e) => {
726
731
  setCondition: h
727
732
  };
728
733
  });
729
- function Le(e) {
730
- return R(Ie, e);
734
+ function ze(e) {
735
+ return R(Re, e);
731
736
  }
732
737
  //#endregion
733
738
  //#region src/entities/predicate/predicate.ts
734
- var Re = M("predicate"), ze = L(({ client: e }) => {
735
- let t = Re.store({}), n = j(t, { register(e, t) {
739
+ var Be = M("predicate"), Ve = L(({ client: e }) => {
740
+ let t = Be.store({}), n = j(t, { register(e, t) {
736
741
  return {
737
742
  ...e,
738
743
  [t.name]: {
@@ -790,16 +795,20 @@ var Re = M("predicate"), ze = L(({ client: e }) => {
790
795
  getEvokablePredicate: s
791
796
  };
792
797
  });
793
- function Be(e) {
794
- return R(ze, e);
798
+ function He(e) {
799
+ return R(Ve, e);
795
800
  }
796
- var Ve = (e, t, n) => {
801
+ var Ue = (e, t, n) => {
797
802
  n.register({
798
803
  name: e,
799
804
  predicate: t
800
805
  });
801
- }, He = M("feature"), Ue = L(({ client: e }) => {
802
- let t = He.store({}), n = He.store([]), i = j(t, { register(e, t) {
806
+ }, We = M("feature");
807
+ function q(e) {
808
+ return e?.enabled === !1;
809
+ }
810
+ var Ge = L(({ client: e }) => {
811
+ let t = We.store({}), n = We.store([]), i = j(t, { register(e, t) {
803
812
  return {
804
813
  ...e,
805
814
  [t.id]: t.feature
@@ -824,12 +833,13 @@ var Ve = (e, t, n) => {
824
833
  }),
825
834
  target: i.register
826
835
  });
827
- let o = N(async ({ id: e, key: t, storage: n = "local" }) => {
828
- let r = O(`feature:${e}:${t}`, "global"), i = (n === "session" ? D : E).get(r).boolean();
829
- return i === null ? null : {
836
+ let o = N(async ({ id: e, key: t, storage: n = "local", enabled: r }) => {
837
+ if (r === !1) return null;
838
+ let i = O(`feature:${e}:${t}`, "global"), a = (n === "session" ? D : E).get(i).boolean();
839
+ return a === null ? null : {
830
840
  id: e,
831
841
  key: t,
832
- bucket: i,
842
+ bucket: a,
833
843
  storage: n
834
844
  };
835
845
  }), s = N((e) => {
@@ -846,6 +856,12 @@ var Ve = (e, t, n) => {
846
856
  if (a) return a;
847
857
  let o = e[n];
848
858
  if (!o) throw Error(`Feature with id '${n}' not found`);
859
+ if (q(o.feature)) return {
860
+ id: o.id,
861
+ bucket: !1,
862
+ key: i,
863
+ storage: o.feature.storage
864
+ };
849
865
  let s = c.get(`${n}:${i}`);
850
866
  if (s !== void 0) {
851
867
  let e = await s;
@@ -874,13 +890,15 @@ var Ve = (e, t, n) => {
874
890
  return {
875
891
  id: t,
876
892
  key: n.feature.key,
877
- storage: n.feature.storage
893
+ storage: n.feature.storage,
894
+ enabled: n.feature.enabled
878
895
  };
879
896
  },
880
897
  target: o
881
898
  }), I({
882
899
  source: t,
883
900
  clock: l.doneData,
901
+ filter: (e, t) => !q(e[t.id]?.feature),
884
902
  fn: (e, t) => {
885
903
  let { id: n, bucket: r, storage: i } = t, a = e[n]?.feature.key;
886
904
  return a ? {
@@ -920,8 +938,11 @@ var Ve = (e, t, n) => {
920
938
  }));
921
939
  I({
922
940
  clock: l.doneData,
923
- source: { resolvedFeatures: n },
924
- filter: ({ resolvedFeatures: e }, { id: t, key: n }) => !e.some((e) => e.id === t && e.key === n),
941
+ source: {
942
+ resolvedFeatures: n,
943
+ allFeatures: t
944
+ },
945
+ filter: ({ resolvedFeatures: e, allFeatures: t }, { id: n, key: r }) => !q(t[n]?.feature) && !e.some((e) => e.id === n && e.key === r),
925
946
  fn: (e, t) => t,
926
947
  target: e.eventBus.prepend((e) => ({
927
948
  type: "feature_decide",
@@ -929,8 +950,11 @@ var Ve = (e, t, n) => {
929
950
  }))
930
951
  }), I({
931
952
  clock: [o.doneData, l.doneData],
932
- source: n,
933
- fn: (e, t) => !t || e.some((e) => e.id === t.id && e.key === t.key) ? e : [...e, t],
953
+ source: {
954
+ resolvedFeatures: n,
955
+ allFeatures: t
956
+ },
957
+ fn: ({ resolvedFeatures: e, allFeatures: t }, n) => !n || q(t[n.id]?.feature) || e.some((e) => e.id === n.id && e.key === n.key) ? e : [...e, n],
934
958
  target: n
935
959
  });
936
960
  function d(e) {
@@ -964,16 +988,16 @@ var Ve = (e, t, n) => {
964
988
  getEvokableFeature: p
965
989
  };
966
990
  });
967
- function We(e) {
968
- return R(Ue, e);
991
+ function Ke(e) {
992
+ return R(Ge, e);
969
993
  }
970
- var Ge = (e, t, n) => {
994
+ var qe = (e, t, n) => {
971
995
  n.register({
972
996
  id: e,
973
997
  feature: t
974
998
  });
975
999
  }, J = M("history");
976
- function Ke(e, t) {
1000
+ function Je(e, t) {
977
1001
  return {
978
1002
  id: re(`history-entry-${Date.now()}-${Math.random()}}`),
979
1003
  node: t,
@@ -981,9 +1005,9 @@ function Ke(e, t) {
981
1005
  experienceId: e
982
1006
  };
983
1007
  }
984
- var qe = L(() => {
1008
+ var Ye = L(() => {
985
1009
  let e = J.store({ entries: [] }), t = J.event(), n = J.event(), r = J.event(), i = J.event();
986
- e.on(t, (e, t) => ({ entries: [...e.entries, Ke(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Ke(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
1010
+ e.on(t, (e, t) => ({ entries: [...e.entries, Je(t.experienceId, t.node)] })), e.on(n, (e, t) => ({ entries: [...e.entries.slice(0, -1), Je(t.experienceId, t.node)] })), e.on(i, (e, t) => t);
987
1011
  function a(e, t) {
988
1012
  let n = {
989
1013
  lastStepIndex: -1,
@@ -1013,20 +1037,20 @@ var qe = L(() => {
1013
1037
  entriesStore: e.map((e) => e.entries)
1014
1038
  };
1015
1039
  });
1016
- function Je() {
1017
- return R(qe);
1040
+ function Xe() {
1041
+ return R(Ye);
1018
1042
  }
1019
1043
  //#endregion
1020
1044
  //#region src/utils/events.ts
1021
- var Ye = 0, Xe = (e) => {
1045
+ var Ze = 0, Qe = (e) => {
1022
1046
  let t = F([]);
1023
1047
  return t.on(e, (e, t) => [...e, {
1024
- id: Ye++,
1048
+ id: Ze++,
1025
1049
  at: /* @__PURE__ */ new Date(),
1026
1050
  payload: t
1027
1051
  }]), t;
1028
- }, Ze = M("field"), Qe = L(() => {
1029
- let e = Ze.store({}), t = j(e, {
1052
+ }, $e = M("field"), et = L(() => {
1053
+ let e = $e.store({}), t = j(e, {
1030
1054
  register(e, t) {
1031
1055
  return {
1032
1056
  ...e,
@@ -1074,13 +1098,13 @@ var Ye = 0, Xe = (e) => {
1074
1098
  getByName: c
1075
1099
  };
1076
1100
  });
1077
- function $e() {
1078
- return R(Qe);
1101
+ function tt() {
1102
+ return R(et);
1079
1103
  }
1080
1104
  //#endregion
1081
1105
  //#region src/entities/step/step.ts
1082
- var et = M("step"), tt = L(() => {
1083
- let e = et.store({}), t = j(e, { register(e, t) {
1106
+ var nt = M("step"), rt = L(() => {
1107
+ let e = nt.store({}), t = j(e, { register(e, t) {
1084
1108
  return {
1085
1109
  ...e,
1086
1110
  [t.step.id]: t.step
@@ -1104,16 +1128,16 @@ var et = M("step"), tt = L(() => {
1104
1128
  indexStore: e
1105
1129
  };
1106
1130
  });
1107
- function nt() {
1108
- return R(tt);
1131
+ function it() {
1132
+ return R(rt);
1109
1133
  }
1110
- function rt(e, t) {
1134
+ function at(e, t) {
1111
1135
  t.register(e);
1112
1136
  }
1113
1137
  //#endregion
1114
1138
  //#region src/entities/content/content.ts
1115
- var it = M("content"), at = L(() => {
1116
- let e = it.store({}), t = j(e, {
1139
+ var ot = M("content"), st = L(() => {
1140
+ let e = ot.store({}), t = j(e, {
1117
1141
  register(e, t) {
1118
1142
  return {
1119
1143
  ...e,
@@ -1154,16 +1178,16 @@ var it = M("content"), at = L(() => {
1154
1178
  indexStore: e
1155
1179
  };
1156
1180
  });
1157
- function ot() {
1158
- return R(at);
1181
+ function ct() {
1182
+ return R(st);
1159
1183
  }
1160
- function st(e, t) {
1184
+ function lt(e, t) {
1161
1185
  t.register(e);
1162
1186
  }
1163
1187
  //#endregion
1164
1188
  //#region src/entities/action/action.ts
1165
- var ct = M("action"), lt = L(({ client: e }) => {
1166
- let t = ct.store({}), n = j(t, { register(e, t) {
1189
+ var ut = M("action"), dt = L(({ client: e }) => {
1190
+ let t = ut.store({}), n = j(t, { register(e, t) {
1167
1191
  return {
1168
1192
  ...e,
1169
1193
  [t.key]: {
@@ -1221,10 +1245,10 @@ var ct = M("action"), lt = L(({ client: e }) => {
1221
1245
  getEvokableAction: s
1222
1246
  };
1223
1247
  });
1224
- function ut(e) {
1225
- return R(lt, e);
1248
+ function ft(e) {
1249
+ return R(dt, e);
1226
1250
  }
1227
- var dt = (e, t, n) => {
1251
+ var pt = (e, t, n) => {
1228
1252
  n.register({
1229
1253
  key: e,
1230
1254
  action: t
@@ -1243,35 +1267,35 @@ function Y(e, t, n, r) {
1243
1267
  function X(e) {
1244
1268
  return e === null || e === "" || Array.isArray(e) && !e.length;
1245
1269
  }
1246
- function ft(e) {
1270
+ function mt(e) {
1247
1271
  return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === null;
1248
1272
  }
1249
- function pt(e) {
1273
+ function ht(e) {
1250
1274
  try {
1251
1275
  return JSON.stringify(e), !0;
1252
1276
  } catch {
1253
1277
  return !1;
1254
1278
  }
1255
1279
  }
1256
- function mt(e, t) {
1280
+ function gt(e, t) {
1257
1281
  return t.find((t) => t.key === e) ?? null;
1258
1282
  }
1259
- function ht(e, t) {
1283
+ function _t(e, t) {
1260
1284
  return e.multiple && (typeof t == "string" || typeof t == "number" || typeof t == "boolean") ? [t] : t;
1261
1285
  }
1262
- function gt(e, t) {
1286
+ function vt(e, t) {
1263
1287
  if (e.type !== "object" || X(t)) return null;
1264
1288
  if (e.multiple) {
1265
1289
  if (!Array.isArray(t)) return Y(e, t, "This field expects multiple values", "Field expects an array of objects.");
1266
1290
  for (let n of t) {
1267
1291
  if (typeof n != "object" || !n) return Y(e, t, "This field expects object values", "Field expects an array of objects, but received non-object value.");
1268
- if (!pt(n)) return Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1292
+ if (!ht(n)) return Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1269
1293
  }
1270
1294
  return null;
1271
1295
  }
1272
- return Array.isArray(t) ? Y(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Y(e, t, "This field expects an object value", "Field expects an object value.") : pt(t) ? null : Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1296
+ return Array.isArray(t) ? Y(e, t, "This field expects a single value", "Field expects a single object, not an array.") : typeof t != "object" || !t ? Y(e, t, "This field expects an object value", "Field expects an object value.") : ht(t) ? null : Y(e, t, "This field contains non-serializable data", "Field value contains non-JSON-serializable data (functions, circular references, etc.).");
1273
1297
  }
1274
- function _t(e, t) {
1298
+ function yt(e, t) {
1275
1299
  if (X(t) || !Array.isArray(e.options) || e.options.length === 0) return null;
1276
1300
  let n = Array.isArray(t) ? t : [t];
1277
1301
  if (e.type === "object") {
@@ -1279,9 +1303,9 @@ function _t(e, t) {
1279
1303
  return n.every((e) => r.has(JSON.stringify(e))) ? null : Y(e, t, "This field expects a valid option", "Field expects a valid option from the defined choices.");
1280
1304
  }
1281
1305
  let r = e.options.map((e) => e.value);
1282
- return n.every((e) => !ft(e) || e === null ? !1 : r.includes(e)) ? null : Y(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1306
+ return n.every((e) => !mt(e) || e === null ? !1 : r.includes(e)) ? null : Y(e, t, "This field expects a valid option", `Field expects a valid option. Valid options are: ${r.join(", ")}`);
1283
1307
  }
1284
- async function vt(t, n, r, i) {
1308
+ async function bt(t, n, r, i) {
1285
1309
  if (n.validation && !e(n.validation) && !X(r)) {
1286
1310
  let e = i ? {
1287
1311
  $input: r,
@@ -1294,8 +1318,8 @@ async function vt(t, n, r, i) {
1294
1318
  }
1295
1319
  //#endregion
1296
1320
  //#region src/entities/response/response.ts
1297
- var yt = M("response"), bt = L(({ client: e }) => {
1298
- let t = yt.store({}), r = P(), i = P(), a = j(t, {
1321
+ var xt = M("response"), St = L(({ client: e }) => {
1322
+ let t = xt.store({}), r = P(), i = P(), a = j(t, {
1299
1323
  register(e, t) {
1300
1324
  return {
1301
1325
  ...e,
@@ -1334,7 +1358,7 @@ var yt = M("response"), bt = L(({ client: e }) => {
1334
1358
  ...t,
1335
1359
  ...n
1336
1360
  }, o = Object.entries(n), c = await Promise.allSettled(o.map(async ([t, n]) => {
1337
- let o = mt(t, e);
1361
+ let o = gt(t, e);
1338
1362
  if (!o) {
1339
1363
  r.push({
1340
1364
  fieldKey: t,
@@ -1344,17 +1368,17 @@ var yt = M("response"), bt = L(({ client: e }) => {
1344
1368
  });
1345
1369
  return;
1346
1370
  }
1347
- let c = ht(o, n), l = await vt(s, o, c, a);
1371
+ let c = _t(o, n), l = await bt(s, o, c, a);
1348
1372
  if (l) {
1349
1373
  r.push(l);
1350
1374
  return;
1351
1375
  }
1352
- let u = gt(o, c);
1376
+ let u = vt(o, c);
1353
1377
  if (u) {
1354
1378
  r.push(u);
1355
1379
  return;
1356
1380
  }
1357
- let d = _t(o, c);
1381
+ let d = yt(o, c);
1358
1382
  if (d) {
1359
1383
  r.push(d);
1360
1384
  return;
@@ -1433,13 +1457,13 @@ var yt = M("response"), bt = L(({ client: e }) => {
1433
1457
  getByFieldName: _
1434
1458
  };
1435
1459
  });
1436
- function xt(e) {
1437
- return R(bt, e);
1460
+ function Ct(e) {
1461
+ return R(St, e);
1438
1462
  }
1439
1463
  //#endregion
1440
1464
  //#region src/entities/condition/condition.ts
1441
- var St = M("condition"), Ct = L(() => {
1442
- let e = St.store({}), t = j(e, { register(e, t) {
1465
+ var wt = M("condition"), Tt = L(() => {
1466
+ let e = wt.store({}), t = j(e, { register(e, t) {
1443
1467
  return {
1444
1468
  ...e,
1445
1469
  [t.condition.id]: t.condition
@@ -1463,12 +1487,12 @@ var St = M("condition"), Ct = L(() => {
1463
1487
  indexStore: e
1464
1488
  };
1465
1489
  });
1466
- function wt() {
1467
- return R(Ct);
1490
+ function Et() {
1491
+ return R(Tt);
1468
1492
  }
1469
1493
  //#endregion
1470
1494
  //#region src/utils/api-url.ts
1471
- function Tt() {
1495
+ function Dt() {
1472
1496
  if (c()) {
1473
1497
  let e = [
1474
1498
  document.currentScript,
@@ -1483,7 +1507,7 @@ function Tt() {
1483
1507
  }
1484
1508
  //#endregion
1485
1509
  //#region src/utils/search-params.ts
1486
- function Et() {
1510
+ function Ot() {
1487
1511
  if (!s()) return {};
1488
1512
  let e = new URLSearchParams(window.location.search), t = {}, n = /* @__PURE__ */ new Set();
1489
1513
  for (let [t] of e.entries()) t.startsWith("picked-") && n.add(t);
@@ -1501,13 +1525,13 @@ function Et() {
1501
1525
  }
1502
1526
  //#endregion
1503
1527
  //#region src/entities/session/session.ts
1504
- var Dt = O("session", "global");
1505
- function Ot() {
1528
+ var kt = O("session", "global");
1529
+ function At() {
1506
1530
  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)}`;
1507
1531
  }
1508
- function kt() {
1532
+ function jt() {
1509
1533
  if (!m()) return null;
1510
- let e = E.get(Dt);
1534
+ let e = E.get(kt);
1511
1535
  if (!e.isSet()) return null;
1512
1536
  try {
1513
1537
  return e.json();
@@ -1515,8 +1539,8 @@ function kt() {
1515
1539
  return null;
1516
1540
  }
1517
1541
  }
1518
- var At = L(() => {
1519
- let e = kt(), t = { id: e?.id ?? Ot() };
1542
+ var Mt = L(() => {
1543
+ let e = jt(), t = { id: e?.id ?? At() };
1520
1544
  e?.isUser !== void 0 && (t.isUser = e.isUser), e?.identifiers && Object.keys(e.identifiers).length > 0 && (t.identifiers = e.identifiers);
1521
1545
  let n = F(t), r = j(n, {
1522
1546
  setIsUser: (e, t) => ({
@@ -1538,17 +1562,17 @@ var At = L(() => {
1538
1562
  let i = { id: e.id };
1539
1563
  return e.isUser !== void 0 && (i.isUser = e.isUser), Object.keys(r).length > 0 && (i.identifiers = r), i;
1540
1564
  }
1565
+ }), i = k({
1566
+ source: n,
1567
+ effect: (e) => {
1568
+ if (m()) try {
1569
+ E.get(kt).set(e);
1570
+ } catch {}
1571
+ }
1541
1572
  });
1542
1573
  return I({
1543
1574
  source: n,
1544
- target: k({
1545
- source: n,
1546
- effect: (e) => {
1547
- if (m()) try {
1548
- E.get(Dt).set(e);
1549
- } catch {}
1550
- }
1551
- })
1575
+ target: i
1552
1576
  }), {
1553
1577
  store: n,
1554
1578
  setIsUser: r.setIsUser,
@@ -1556,27 +1580,27 @@ var At = L(() => {
1556
1580
  removeIdentifier: r.removeIdentifier
1557
1581
  };
1558
1582
  });
1559
- function jt() {
1560
- return R(At, void 0);
1583
+ function Nt() {
1584
+ return R(Mt, void 0);
1561
1585
  }
1562
1586
  //#endregion
1563
1587
  //#region src/utils/picked-config.ts
1564
- function Mt() {
1588
+ function Pt() {
1565
1589
  if (s()) return globalThis.window.pickedConfig;
1566
1590
  }
1567
- function Nt() {
1568
- if (s()) return Mt()?.projectId;
1591
+ function Ft() {
1592
+ if (s()) return Pt()?.projectId;
1569
1593
  }
1570
- function Pt() {
1594
+ function It() {
1571
1595
  if (!c()) return;
1572
1596
  let e = document.getElementById("picked_script") || document.querySelector("script#picked") || document.getElementById("cvly");
1573
1597
  if (e) return e.dataset.projectid || e.getAttribute("project-id") || void 0;
1574
1598
  }
1575
- function Ft(e) {
1599
+ function Lt(e) {
1576
1600
  if (e.projectId) return e.projectId;
1577
- let t = Nt();
1601
+ let t = Ft();
1578
1602
  if (t) return t;
1579
- let n = Pt();
1603
+ let n = It();
1580
1604
  if (n) return n;
1581
1605
  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.");
1582
1606
  }
@@ -1585,7 +1609,7 @@ function Ft(e) {
1585
1609
  function Z(e) {
1586
1610
  return e == null || e === "" || Number.isNaN(e);
1587
1611
  }
1588
- var It = {
1612
+ var Rt = {
1589
1613
  default: (e, t) => Z(e) ? String(t ?? "") : String(e),
1590
1614
  append: (e, t) => t && !Z(e) ? `${e} ${t}` : e,
1591
1615
  prepend: (e, t) => t && !Z(e) ? `${t} ${e}` : e,
@@ -1606,24 +1630,24 @@ var It = {
1606
1630
  return e instanceof Set ? t.format(Array.from(e).map(String)) : e;
1607
1631
  }
1608
1632
  };
1609
- function Lt(e) {
1633
+ function zt(e) {
1610
1634
  return typeof e == "object" && !!e;
1611
1635
  }
1612
- function Rt(e, t) {
1636
+ function Bt(e, t) {
1613
1637
  let n = t;
1614
- for (let t of e.split(".")) if (Lt(n) && t in n) n = n[t];
1638
+ for (let t of e.split(".")) if (zt(n) && t in n) n = n[t];
1615
1639
  else return;
1616
1640
  return typeof n == "function" ? n() : n;
1617
1641
  }
1618
- function zt(e, t) {
1619
- let n = e.split("|").map((e) => e.trim()), r = Rt(n.shift() ?? "", t);
1642
+ function Vt(e, t) {
1643
+ let n = e.split("|").map((e) => e.trim()), r = Bt(n.shift() ?? "", t);
1620
1644
  for (let e of n) {
1621
- let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = It[i];
1645
+ let [t, ...n] = e.split(":"), i = t?.trim() ?? "", a = n.join(":").trim().replaceAll(/(?:^['"]|['"]$)/g, ""), o = Rt[i];
1622
1646
  o && (r = o(r, a));
1623
1647
  }
1624
1648
  return Z(r) ? "" : typeof r == "object" ? JSON.stringify(r) : String(r);
1625
1649
  }
1626
- function Bt(e, t) {
1650
+ function Ht(e, t) {
1627
1651
  let n = "", r = 0;
1628
1652
  for (; r < e.length;) if (e[r] === "{" && e[r + 1] === "{") {
1629
1653
  r += 2;
@@ -1635,19 +1659,19 @@ function Bt(e, t) {
1635
1659
  }
1636
1660
  i += e[r++];
1637
1661
  }
1638
- n += zt(i.trim(), t);
1662
+ n += Vt(i.trim(), t);
1639
1663
  } else n += e[r++];
1640
1664
  return n;
1641
1665
  }
1642
1666
  //#endregion
1643
1667
  //#region src/utils/preview-session.ts
1644
- var Q = "preview-token";
1645
- function Vt() {
1646
- return !s() || !h() ? !1 : !!Et()[Q]?.[0];
1668
+ var Ut = "preview-token";
1669
+ function Wt() {
1670
+ return !s() || !h() ? !1 : !!Ot()[Ut]?.[0];
1647
1671
  }
1648
1672
  //#endregion
1649
1673
  //#region src/picked.ts
1650
- var Ht = class {
1674
+ var Gt = class {
1651
1675
  static logger = r;
1652
1676
  options;
1653
1677
  dataSource = null;
@@ -1660,66 +1684,66 @@ var Ht = class {
1660
1684
  apiUrl;
1661
1685
  dashboardUrl;
1662
1686
  documentationSiteUrl;
1663
- session = jt();
1664
- searchParams = Et();
1665
- history = Je();
1666
- components = ve({ client: this });
1687
+ session = Nt();
1688
+ searchParams = Ot();
1689
+ history = Xe();
1690
+ components = ye({ client: this });
1667
1691
  experienceInstances = S({ client: this });
1668
- experiences = ue({ client: this });
1669
- frameworks = xe({ client: this });
1670
- predicates = Be({ client: this });
1671
- features = We({ client: this });
1672
- conditions = wt();
1673
- fields = $e();
1674
- responses = xt({ client: this });
1675
- steps = nt();
1676
- contents = ot();
1677
- actions = ut({ client: this });
1692
+ experiences = de({ client: this });
1693
+ frameworks = Ce({ client: this });
1694
+ predicates = He({ client: this });
1695
+ features = Ke({ client: this });
1696
+ conditions = Et();
1697
+ fields = tt();
1698
+ responses = Ct({ client: this });
1699
+ steps = it();
1700
+ contents = ct();
1701
+ actions = ft({ client: this });
1678
1702
  conditionResults = C();
1679
- stateSnapshotStore = we({ client: this });
1680
- evaluateRuleLogicFx = Me({ client: this });
1703
+ stateSnapshotStore = Ee({ client: this });
1704
+ evaluateRuleLogicFx = Pe({ client: this });
1681
1705
  start;
1682
1706
  readyStore;
1683
1707
  preconditionPassedStore;
1684
1708
  conditionPassedStore;
1685
1709
  lifecycleStageStore;
1686
- lifecycle = Le({ client: this });
1710
+ lifecycle = ze({ client: this });
1687
1711
  renderStringFx = k({
1688
1712
  source: this.responses.listStore,
1689
1713
  effect: (e, { template: t, context: n }) => {
1690
1714
  let r = {};
1691
1715
  for (let t of e) r[t.fieldKey] = t.value;
1692
- return Bt(t, {
1716
+ return Ht(t, {
1693
1717
  ...n,
1694
1718
  responses: r
1695
1719
  });
1696
1720
  }
1697
1721
  });
1698
1722
  constructor(e) {
1699
- this.events = Xe(this.eventBus), this.projectId = Ft(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Tt(), 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({
1723
+ this.events = Qe(this.eventBus), this.projectId = Lt(e), this.options = Object.freeze(e), this.apiUrl = e.apiUrl || Dt(), 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({
1700
1724
  type: "load",
1701
1725
  version: ne()
1702
1726
  }), this.maybeStartPreviewChannel();
1703
1727
  }
1704
1728
  maybeStartPreviewChannel() {
1705
- Vt() && import("../preview-channel-DW9J8t4B.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1729
+ Wt() && import("../preview-channel-CSr96XAo.js").then((e) => e.initPreviewChannel(this)).catch(() => void 0);
1706
1730
  }
1707
1731
  registerFramework = (e) => {
1708
- Se(e, this.frameworks);
1732
+ we(e, this.frameworks);
1709
1733
  };
1710
1734
  registerComponent = (e, t) => {
1711
- B(e, t, this.components);
1735
+ be(e, t, this.components);
1712
1736
  };
1713
1737
  registerPlugin = (e) => {
1714
- pe(this, e, this.plugins);
1738
+ me(this, e, this.plugins);
1715
1739
  let t = this.plugins[e.name];
1716
1740
  t?.onStart && this.lifecycle.registerPluginStartHook(t.onStart);
1717
1741
  };
1718
1742
  registerFeature = (e, t) => {
1719
- Ge(e, t, this.features);
1743
+ qe(e, t, this.features);
1720
1744
  };
1721
1745
  registerPredicate = (e, t) => {
1722
- Ve(e, t, this.predicates);
1746
+ Ue(e, t, this.predicates);
1723
1747
  };
1724
1748
  registerCondition = (e) => {
1725
1749
  this.conditions.register(e);
@@ -1728,19 +1752,19 @@ var Ht = class {
1728
1752
  this.fields.register(e);
1729
1753
  };
1730
1754
  registerStep = (e) => {
1731
- rt(e, this.steps);
1755
+ at(e, this.steps);
1732
1756
  };
1733
1757
  registerContent = (e) => {
1734
- st(e, this.contents);
1758
+ lt(e, this.contents);
1735
1759
  };
1736
1760
  patchContent = (e, t) => {
1737
1761
  this.contents.patch(e, t);
1738
1762
  };
1739
1763
  registerAction = (e, t) => {
1740
- dt(e, t, this.actions);
1764
+ pt(e, t, this.actions);
1741
1765
  };
1742
1766
  registerExperience = (e) => {
1743
- e.component && B(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1767
+ e.component && be(`experience:${e.id}`, e.component, this.components), this.experiences.register(e);
1744
1768
  };
1745
1769
  launchExperienceById = async (e, t) => {
1746
1770
  this.experiences.launch({
@@ -1822,11 +1846,19 @@ var Ht = class {
1822
1846
  });
1823
1847
  }
1824
1848
  getPluginConfig = (e) => this.plugins[e] ?? {};
1825
- }, Ut = "application/picked-javascript", Wt = "application/picked-module", Gt = "data-picked-hydrated";
1826
- async function $(e) {
1849
+ }, Kt = "application/picked-javascript", qt = "application/picked-module", Jt = "data-picked-hydrated";
1850
+ async function Yt(e) {
1827
1851
  if (!("document" in globalThis)) return;
1828
1852
  let t = "application/picked-module", n = "data-picked-hydrated";
1829
- function r(e, t) {
1853
+ function r(e) {
1854
+ try {
1855
+ Function(e.textContent);
1856
+ } catch (t) {
1857
+ return t instanceof SyntaxError && (console.error("[picked] Skipped a rehydrated inline script that failed to parse.", t), e.setAttribute(n, ""), !0);
1858
+ }
1859
+ return !1;
1860
+ }
1861
+ function i(e, t) {
1830
1862
  let r = document.createElement("script");
1831
1863
  for (let t of Array.from(e.attributes)) t.name !== "type" && r.setAttribute(t.name, t.value);
1832
1864
  t && r.setAttribute("type", t), r.setAttribute(n, ""), e.src ? r.async = !1 : r.textContent = e.textContent;
@@ -1835,37 +1867,73 @@ async function $(e) {
1835
1867
  }) : null;
1836
1868
  return e.src ? e.replaceWith(r) : (globalThis.__pickedEmbedScriptRoot = e.getRootNode(), e.replaceWith(r), globalThis.__pickedEmbedScriptRoot = null), i;
1837
1869
  }
1838
- let i = Array.from(e.querySelectorAll(`script[type="application/picked-javascript"]:not([${n}]), script[type="${t}"]:not([${n}])`)).filter((e) => e instanceof HTMLScriptElement);
1839
- for (let e of i) {
1870
+ let a = Array.from(e.querySelectorAll(`script[type="application/picked-javascript"]:not([${n}]), script[type="${t}"]:not([${n}])`)).filter((e) => e instanceof HTMLScriptElement);
1871
+ for (let e of a) {
1840
1872
  if (!e.isConnected) continue;
1841
- let n = r(e, e.getAttribute("type") === t ? "module" : null);
1842
- n && await n;
1873
+ let n = e.getAttribute("type") === t ? "module" : null;
1874
+ if (!e.src && n === null && r(e)) continue;
1875
+ let a = i(e, n);
1876
+ a && await a;
1843
1877
  }
1844
1878
  }
1845
- function Kt() {
1846
- return `<script>(${$.toString()})(document)<\/script>`;
1879
+ function Xt() {
1880
+ return `<script>(${Yt.toString()})(document)<\/script>`;
1847
1881
  }
1848
1882
  //#endregion
1849
1883
  //#region src/utils/html-asset-value.ts
1850
- function qt(e) {
1884
+ function Zt(e) {
1851
1885
  return typeof e == "object" && !!e && "id" in e && typeof e.id == "string" && "content" in e && (typeof e.content == "string" || e.content === null);
1852
1886
  }
1853
1887
  //#endregion
1854
1888
  //#region src/entities/component/lazyComponent.ts
1855
- function Jt(e) {
1889
+ function Qt(e) {
1856
1890
  return {
1857
1891
  $$type: "lazy-component",
1858
1892
  load: e
1859
1893
  };
1860
1894
  }
1861
- function Yt(e) {
1895
+ function $t(e) {
1862
1896
  return typeof e == "object" && !!e && "$$type" in e && e.$$type === "lazy-component";
1863
1897
  }
1864
1898
  //#endregion
1899
+ //#region src/entities/content/reference.ts
1900
+ function Q(e) {
1901
+ return typeof e == "object" && !!e && !Array.isArray(e) && "contentEntryId" in e && typeof e.contentEntryId == "string";
1902
+ }
1903
+ function $(e) {
1904
+ return Q(e) ? e.contentEntryId : null;
1905
+ }
1906
+ function en(e) {
1907
+ let t = Array.isArray(e) ? e : [e], n = [];
1908
+ for (let e of t) Q(e) && n.push(e.contentEntryId);
1909
+ return n;
1910
+ }
1911
+ function tn(e, t) {
1912
+ return t === null ? null : e[t] ?? null;
1913
+ }
1914
+ function nn(e, t) {
1915
+ let n = [];
1916
+ for (let r of t) {
1917
+ let t = e[r];
1918
+ t !== void 0 && n.push(t);
1919
+ }
1920
+ return n;
1921
+ }
1922
+ function rn(e, t) {
1923
+ if (se.store(t)) return A(t, e.indexStore, (e, t) => tn(t, $(e)));
1924
+ let n = $(t);
1925
+ return e.indexStore.map((e) => tn(e, n), { skipVoid: !1 });
1926
+ }
1927
+ function an(e, t) {
1928
+ if (se.store(t)) return A(t, e.indexStore, (e, t) => nn(t, en(e)));
1929
+ let n = en(t);
1930
+ return e.indexStore.map((e) => nn(e, n), { skipVoid: !1 });
1931
+ }
1932
+ //#endregion
1865
1933
  //#region src/exports.ts
1866
- var Xt = (e) => {
1867
- let t = new Ht(e);
1934
+ var on = (e) => {
1935
+ let t = new Gt(e);
1868
1936
  return u(t), t;
1869
1937
  };
1870
1938
  //#endregion
1871
- export { Gt as PICKED_HYDRATED_ATTR, Wt as PICKED_MODULE_SCRIPT_TYPE, Ut as PICKED_SCRIPT_TYPE, Q as PREVIEW_TOKEN_PARAM, Ht as Picked, Kt as buildRehydrateBootstrap, Xt as createClient, fe as createPluginEffect, O as createStorageKey, n as evaluateRuleLogic, Mt as getPickedConfig, qt as isHtmlAssetValue, h as isInsideIframe, Yt as isLazyLoader, _ as isPickedRoot, Vt as isPreviewSession, Jt as lazyComponent, E as localStore, oe as onInertScriptSubtrees, $ as rehydrateScripts, ie as reportInertScriptSubtrees, ae as resetInertScriptReport, D as sessionStore, T 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 };
1939
+ export { Jt as PICKED_HYDRATED_ATTR, qt as PICKED_MODULE_SCRIPT_TYPE, Kt as PICKED_SCRIPT_TYPE, Ut as PREVIEW_TOKEN_PARAM, Gt as Picked, Xt as buildRehydrateBootstrap, on as createClient, pe as createPluginEffect, O as createStorageKey, rn as deriveReference, an as deriveReferences, n as evaluateRuleLogic, Pt as getPickedConfig, Q as isContentReference, Zt as isHtmlAssetValue, h as isInsideIframe, $t as isLazyLoader, _ as isPickedRoot, Wt as isPreviewSession, Qt as lazyComponent, E as localStore, oe as onInertScriptSubtrees, $ as readReferenceId, en as readReferenceIds, Yt as rehydrateScripts, ie as reportInertScriptSubtrees, ae as resetInertScriptReport, D as sessionStore, T 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 };