@picked/client 0.0.1-dev.1788925875333 → 0.0.1-next.1
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/README.md +8 -0
- package/dist/cjs/index.js +1 -4
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
- package/dist/cjs/plugins/shopify/index.js +1 -0
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +733 -1814
- package/dist/esm/plugins/create-experience/index.js +398 -490
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
- package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
- package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
- package/dist/esm/plugins/shopify/index.js +59 -0
- package/dist/esm/plugins/single-page-app/index.js +35 -31
- package/dist/esm/plugins/window-object/index.js +9 -9
- package/dist/esm/server/index.js +89 -141
- package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
- package/dist/experience-instance-BA0EXYg5.js +712 -0
- package/dist/id-BKIWbSTy.cjs +1 -0
- package/dist/id-BW-g3y32.js +6 -0
- package/dist/logger-BsmHUUw1.cjs +1 -0
- package/dist/logger-C9a75KZn.js +5 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/object-JwZ58NOH.js +28 -0
- package/dist/storage-BPJwmlva.cjs +1 -0
- package/dist/storage-D87xFySf.js +85 -0
- package/dist/supports-BvrzQAVk.js +79 -0
- package/dist/supports-C0y3-V5V.cjs +1 -0
- package/dist/types/client.d.ts +23 -119
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -45
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +99 -152
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +8 -118
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +64 -96
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +7 -32
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +2 -41
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +7 -30
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts +9 -0
- package/dist/types/entities/project/project.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +21 -57
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -22
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +11 -13
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +184 -381
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +10 -0
- package/dist/types/ping.d.ts.map +1 -0
- package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/index.d.ts +2 -0
- package/dist/types/plugins/shopify/index.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts +3 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/shopify.d.ts +28 -0
- package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
- package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/server/index.d.ts +3 -18
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +6 -4
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +38 -83
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +2 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.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/logger.d.ts +1 -2
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +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 +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 +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -3
- 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/rules-logic.d.ts +3 -33
- 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/state-snaphot.d.ts +16 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/storage.d.ts +11 -374
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +0 -87
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/package.json +49 -182
- package/dist/.tsbuildinfo +0 -1
- package/dist/api-DbMJli3H.js +0 -22
- package/dist/api-qiqq8lgz.cjs +0 -1
- package/dist/cjs/form/index.js +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
- package/dist/cjs/plugins/telemetry/index.js +0 -1
- package/dist/cjs/plugins/web-components/index.js +0 -1
- package/dist/cjs/preview/index.js +0 -1
- package/dist/docs/_root.css +0 -101
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
- package/dist/docs/explanation/content-references.md +0 -99
- package/dist/docs/explanation/feature-flag-allocation.md +0 -218
- package/dist/docs/explanation/how-picked-works.md +0 -124
- package/dist/docs/explanation/how-pickedql-works.md +0 -76
- package/dist/docs/explanation/pages-and-flows.md +0 -64
- package/dist/docs/explanation/the-content-model.md +0 -87
- package/dist/docs/explanation/the-two-apis.md +0 -68
- package/dist/docs/explanation/why-server-side-rendering.md +0 -76
- package/dist/docs/explanation/workspaces-and-versions.md +0 -71
- package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
- package/dist/docs/how-to/analytics/index.md +0 -316
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
- package/dist/docs/how-to/authenticate-the-cli.md +0 -97
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
- package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
- package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
- package/dist/docs/how-to/build-a-flow.md +0 -83
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
- package/dist/docs/how-to/create-a-content-entry.md +0 -48
- package/dist/docs/how-to/create-a-project.md +0 -29
- package/dist/docs/how-to/create-an-experience.md +0 -42
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
- package/dist/docs/how-to/define-a-page-layout.md +0 -46
- package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
- package/dist/docs/how-to/install-the-gtm-template.md +0 -84
- package/dist/docs/how-to/install-the-sdk.md +0 -93
- package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
- package/dist/docs/how-to/invite-and-remove-members.md +0 -34
- package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
- package/dist/docs/how-to/preview-a-workspace.md +0 -28
- package/dist/docs/how-to/publish-a-workspace.md +0 -30
- package/dist/docs/how-to/read-a-feature-flag.md +0 -113
- package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
- package/dist/docs/how-to/register-a-component.md +0 -55
- package/dist/docs/how-to/register-an-action-handler.md +0 -67
- package/dist/docs/how-to/render-a-step-form.md +0 -131
- package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
- package/dist/docs/how-to/reuse-a-section.md +0 -53
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
- package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
- package/dist/docs/how-to/run-an-ab-test.md +0 -49
- package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
- package/dist/docs/how-to/server-render-a-page.md +0 -81
- package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
- package/dist/docs/how-to/set-up-mfa.md +0 -69
- package/dist/docs/how-to/switch-workspaces.md +0 -122
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
- package/dist/docs/how-to/validate-a-field.md +0 -52
- package/dist/docs/how-to/write-a-condition.md +0 -45
- package/dist/docs/how-to/write-a-predicate.md +0 -60
- package/dist/docs/index.md +0 -59
- package/dist/docs/reference/dashboard/actions.mdx +0 -53
- package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
- package/dist/docs/reference/dashboard/conditions.mdx +0 -42
- package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
- package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
- package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
- package/dist/docs/reference/dashboard/content/models.mdx +0 -108
- package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
- package/dist/docs/reference/dashboard/experiences.mdx +0 -51
- package/dist/docs/reference/dashboard/features.mdx +0 -154
- package/dist/docs/reference/dashboard/fields.mdx +0 -106
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
- package/dist/docs/reference/dashboard/projects.mdx +0 -44
- package/dist/docs/reference/dashboard/reports.mdx +0 -43
- package/dist/docs/reference/dashboard/steps.mdx +0 -37
- package/dist/docs/reference/dashboard/team-management.md +0 -29
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
- package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
- package/dist/docs/reference/delivery-api/experience-content.md +0 -152
- package/dist/docs/reference/delivery-api/index.md +0 -45
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
- package/dist/docs/reference/delivery-api/project-config.md +0 -65
- package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
- package/dist/docs/reference/glossary.md +0 -181
- package/dist/docs/reference/management-api/authentication.md +0 -74
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
- package/dist/docs/reference/management-api/error-handling.md +0 -233
- package/dist/docs/reference/management-api/pagination.md +0 -192
- package/dist/docs/reference/pickedql/data-sources.md +0 -174
- package/dist/docs/reference/pickedql/dimensions.md +0 -103
- package/dist/docs/reference/pickedql/filtering.md +0 -64
- package/dist/docs/reference/pickedql/index.md +0 -18
- package/dist/docs/reference/pickedql/schema.md +0 -172
- package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
- package/dist/docs/reference/sdk/actions.md +0 -30
- package/dist/docs/reference/sdk/analytics-events.md +0 -445
- package/dist/docs/reference/sdk/conditions.md +0 -147
- package/dist/docs/reference/sdk/content-security-policy.md +0 -21
- package/dist/docs/reference/sdk/content.md +0 -213
- package/dist/docs/reference/sdk/experiences.md +0 -51
- package/dist/docs/reference/sdk/features.md +0 -256
- package/dist/docs/reference/sdk/fields.md +0 -255
- package/dist/docs/reference/sdk/index.md +0 -68
- package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
- package/dist/docs/reference/sdk/plugins/index.md +0 -29
- package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
- package/dist/docs/reference/sdk/predicates.md +0 -43
- package/dist/docs/reference/sdk/ssr/index.md +0 -33
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
- package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -196
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -146
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -90
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -228
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
- package/dist/docs/tutorials/first-experience.mdx +0 -254
- package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
- package/dist/dom-BqcToNL0.js +0 -82
- package/dist/dom-DlLH3FxV.cjs +0 -1
- package/dist/emit-D-tLiWL1.cjs +0 -1
- package/dist/emit-Ds2EG7CB.js +0 -14
- package/dist/esm/form/index.js +0 -565
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
- package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
- package/dist/esm/plugins/history-browser-storage/index.js +0 -26
- package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
- package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
- package/dist/esm/plugins/telemetry/index.js +0 -100
- package/dist/esm/plugins/web-components/index.js +0 -19
- package/dist/esm/preview/index.js +0 -2
- package/dist/experience-instance-DGk11d8a.js +0 -563
- package/dist/experience-instance-Dej3P1sE.cjs +0 -1
- package/dist/id-Bo4RBeOs.js +0 -4
- package/dist/id-Js-62re-.cjs +0 -1
- package/dist/inert-script-report-B_bMPRzp.js +0 -18
- package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
- package/dist/logger-CSTvAyyB.cjs +0 -1
- package/dist/logger-DMN6TxJJ.js +0 -4
- package/dist/object-BUDGxEqy.js +0 -25
- package/dist/object-CIkt7Fkr.cjs +0 -1
- package/dist/plugin-BcLaCLm1.cjs +0 -1
- package/dist/plugin-De_BJSwE.js +0 -194
- package/dist/preview-channel-CSr96XAo.js +0 -98
- package/dist/preview-channel-Cx0e6fye.cjs +0 -1
- package/dist/protocol-Bb_vpLKE.cjs +0 -1
- package/dist/protocol-C5KkkiZc.js +0 -84
- package/dist/provider-C_9u0yGJ.cjs +0 -1
- package/dist/provider-ovM-CBX_.js +0 -98
- package/dist/registry-C1t8l3t9.cjs +0 -1
- package/dist/registry-CXZv0uLg.js +0 -18
- package/dist/rules-logic-CGZIYgAI.cjs +0 -1
- package/dist/rules-logic-HesIUCu6.js +0 -13
- package/dist/storage-1MW3-_As.js +0 -103
- package/dist/storage-DUw9UJ2h.cjs +0 -1
- package/dist/supports-CO9bJGNl.js +0 -92
- package/dist/supports-DBzjGaWD.cjs +0 -1
- package/dist/types/data-source/api.d.ts +0 -60
- package/dist/types/data-source/api.d.ts.map +0 -1
- package/dist/types/data-source/provider.d.ts +0 -103
- package/dist/types/data-source/provider.d.ts.map +0 -1
- package/dist/types/data-source/registry.d.ts +0 -26
- package/dist/types/data-source/registry.d.ts.map +0 -1
- package/dist/types/data-source/request-observer.d.ts +0 -62
- package/dist/types/data-source/request-observer.d.ts.map +0 -1
- package/dist/types/data-source/virtual-data.d.ts +0 -19
- package/dist/types/data-source/virtual-data.d.ts.map +0 -1
- package/dist/types/entities/action/action.d.ts +0 -85
- package/dist/types/entities/action/action.d.ts.map +0 -1
- package/dist/types/entities/component/lazyComponent.d.ts +0 -11
- package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -29
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/content/content.d.ts +0 -53
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/content/reference.d.ts +0 -101
- package/dist/types/entities/content/reference.d.ts.map +0 -1
- package/dist/types/entities/field/policies.d.ts +0 -35
- package/dist/types/entities/field/policies.d.ts.map +0 -1
- package/dist/types/entities/response/response-validation.d.ts +0 -75
- package/dist/types/entities/response/response-validation.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -46
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -56
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/form/build-responses.d.ts +0 -18
- package/dist/types/form/build-responses.d.ts.map +0 -1
- package/dist/types/form/create-field-evaluator.d.ts +0 -28
- package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
- package/dist/types/form/create-field-validation.d.ts +0 -60
- package/dist/types/form/create-field-validation.d.ts.map +0 -1
- package/dist/types/form/create-form.d.ts +0 -153
- package/dist/types/form/create-form.d.ts.map +0 -1
- package/dist/types/form/create-submit-pipeline.d.ts +0 -116
- package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
- package/dist/types/form/get-step-fields.d.ts +0 -19
- package/dist/types/form/get-step-fields.d.ts.map +0 -1
- package/dist/types/form/index.d.ts +0 -11
- package/dist/types/form/index.d.ts.map +0 -1
- package/dist/types/lifecycle/condition-selection.d.ts +0 -146
- package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -48
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -25
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
- package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/index.d.ts +0 -3
- package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/hash.d.ts +0 -105
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/emit.d.ts +0 -18
- package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/index.d.ts +0 -4
- package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
- package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
- package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
- package/dist/types/plugins/web-components/index.d.ts +0 -2
- package/dist/types/plugins/web-components/index.d.ts.map +0 -1
- package/dist/types/plugins/web-components/plugin.d.ts +0 -4
- package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
- package/dist/types/preview/index.d.ts +0 -18
- package/dist/types/preview/index.d.ts.map +0 -1
- package/dist/types/preview-bridge/index.d.ts +0 -14
- package/dist/types/preview-bridge/index.d.ts.map +0 -1
- package/dist/types/preview-channel.d.ts +0 -16
- package/dist/types/preview-channel.d.ts.map +0 -1
- package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
- package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
- package/dist/types/preview-receiver/index.d.ts +0 -32
- package/dist/types/preview-receiver/index.d.ts.map +0 -1
- package/dist/types/preview-receiver/protocol.d.ts +0 -69
- package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
- package/dist/types/schema-registry.d.ts +0 -206
- package/dist/types/schema-registry.d.ts.map +0 -1
- package/dist/types/server/serialize.d.ts +0 -87
- package/dist/types/server/serialize.d.ts.map +0 -1
- package/dist/types/typed-content.d.ts +0 -17
- package/dist/types/typed-content.d.ts.map +0 -1
- package/dist/types/utils/client-telemetry.d.ts +0 -25
- package/dist/types/utils/client-telemetry.d.ts.map +0 -1
- package/dist/types/utils/content-path.d.ts +0 -37
- package/dist/types/utils/content-path.d.ts.map +0 -1
- package/dist/types/utils/html-asset-value.d.ts +0 -20
- package/dist/types/utils/html-asset-value.d.ts.map +0 -1
- package/dist/types/utils/inert-script-report.d.ts +0 -40
- package/dist/types/utils/inert-script-report.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
- package/dist/types/utils/picked-config.d.ts +0 -39
- package/dist/types/utils/picked-config.d.ts.map +0 -1
- package/dist/types/utils/preview-session.d.ts +0 -12
- package/dist/types/utils/preview-session.d.ts.map +0 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
- package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
- package/dist/types/utils/render-string.d.ts +0 -24
- package/dist/types/utils/render-string.d.ts.map +0 -1
- package/dist/types/utils/user-timing.d.ts +0 -21
- package/dist/types/utils/user-timing.d.ts.map +0 -1
- package/dist/version-BvLZaTMC.cjs +0 -1
- package/dist/version-VvasRUfR.js +0 -256
- /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
package/dist/plugin-De_BJSwE.js
DELETED
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
import "./logger-DMN6TxJJ.js";
|
|
2
|
-
import { r as e } from "./version-VvasRUfR.js";
|
|
3
|
-
import "./api-DbMJli3H.js";
|
|
4
|
-
import { attach as t } from "effector";
|
|
5
|
-
//#region src/plugins/dynamic-experiences/hash.ts
|
|
6
|
-
function n(e) {
|
|
7
|
-
let t = 2166136261;
|
|
8
|
-
for (let n of e) t ^= n.codePointAt(0) ?? 0, t = Math.imul(t, 16777619);
|
|
9
|
-
return t >>> 0;
|
|
10
|
-
}
|
|
11
|
-
function r(e) {
|
|
12
|
-
let t = e;
|
|
13
|
-
return t ^= t >>> 16, t = Math.imul(t, 2246822507), t ^= t >>> 13, t = Math.imul(t, 3266489909), t ^= t >>> 16, t >>> 0;
|
|
14
|
-
}
|
|
15
|
-
function i(e, t) {
|
|
16
|
-
return r(n(`${e}:${t}`)) % 100;
|
|
17
|
-
}
|
|
18
|
-
function a(e, t) {
|
|
19
|
-
return t <= 0 ? !1 : t >= 100 || e < t;
|
|
20
|
-
}
|
|
21
|
-
var o = 4294967296;
|
|
22
|
-
function s(e, t, i) {
|
|
23
|
-
return (r(n(`${e}:${t}:${i}`)) + .5) / o;
|
|
24
|
-
}
|
|
25
|
-
function c(e, t, n) {
|
|
26
|
-
return n.weight <= 0 ? 0 : n.weight / -Math.log(s(e, t, n.key));
|
|
27
|
-
}
|
|
28
|
-
function l(e, t, n) {
|
|
29
|
-
let r = null, i = 0;
|
|
30
|
-
for (let a of n) {
|
|
31
|
-
let n = c(e, t, a);
|
|
32
|
-
n <= 0 || (n > i || n === i && r !== null && a.key < r.key) && (i = n, r = a);
|
|
33
|
-
}
|
|
34
|
-
return r;
|
|
35
|
-
}
|
|
36
|
-
//#endregion
|
|
37
|
-
//#region src/plugins/dynamic-experiences/plugin.ts
|
|
38
|
-
function u(e, t) {
|
|
39
|
-
if (Array.isArray(t.conditions)) for (let n of t.conditions) e.registerCondition(n);
|
|
40
|
-
}
|
|
41
|
-
function d(e, t) {
|
|
42
|
-
e.registerExperience({
|
|
43
|
-
id: t.id,
|
|
44
|
-
key: t.key,
|
|
45
|
-
name: t.name,
|
|
46
|
-
targets: t.targets,
|
|
47
|
-
nodes: t.nodes,
|
|
48
|
-
edges: t.edges,
|
|
49
|
-
condition: t.condition,
|
|
50
|
-
initializeOpen: t.initializeOpen,
|
|
51
|
-
componentName: t.componentName
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
function f(e) {
|
|
55
|
-
return typeof e != "object" || !e ? !1 : "id" in e && "key" in e && "type" in e && "name" in e;
|
|
56
|
-
}
|
|
57
|
-
function p(e, t) {
|
|
58
|
-
if (Array.isArray(t.fields)) for (let n of t.fields) f(n) && e.registerField(n);
|
|
59
|
-
}
|
|
60
|
-
function m(e, t) {
|
|
61
|
-
if (!Array.isArray(t.steps)) return;
|
|
62
|
-
let n = new Map(t.fields.map((e) => [e.id, e.key]));
|
|
63
|
-
for (let r of t.steps) {
|
|
64
|
-
let t = [];
|
|
65
|
-
for (let e of r.fieldIds ?? []) {
|
|
66
|
-
let i = n.get(e);
|
|
67
|
-
if (i === void 0) {
|
|
68
|
-
`${r.key}${e}`;
|
|
69
|
-
continue;
|
|
70
|
-
}
|
|
71
|
-
t.push(i);
|
|
72
|
-
}
|
|
73
|
-
let i = r.layoutContentId ? e.contents.getById(r.layoutContentId) : null;
|
|
74
|
-
e.registerStep({
|
|
75
|
-
id: r.id,
|
|
76
|
-
key: r.key,
|
|
77
|
-
name: r.name,
|
|
78
|
-
fieldKeys: t,
|
|
79
|
-
layoutName: r.layoutName,
|
|
80
|
-
...r.layoutContentId !== void 0 && {
|
|
81
|
-
layoutContentId: r.layoutContentId,
|
|
82
|
-
layoutContentStore: i
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
function h(e, t) {
|
|
88
|
-
if (Array.isArray(t.experiences)) for (let n of t.experiences) d(e, n);
|
|
89
|
-
}
|
|
90
|
-
function g(e, t, n) {
|
|
91
|
-
y(e, t, n.isPreview, n.sessionId), u(e, t), p(e, t), m(e, t), h(e, t);
|
|
92
|
-
}
|
|
93
|
-
function _(e) {
|
|
94
|
-
let t = e.searchParams["preview-token"];
|
|
95
|
-
if (t && t.length > 0) return t[0];
|
|
96
|
-
}
|
|
97
|
-
function v(t) {
|
|
98
|
-
let n = /* @__PURE__ */ new Map(), r = t.searchParams.feature;
|
|
99
|
-
if (!r) return n;
|
|
100
|
-
for (let t of r) {
|
|
101
|
-
let r = e(t);
|
|
102
|
-
r && n.set(r.id, r.bucket);
|
|
103
|
-
}
|
|
104
|
-
return n;
|
|
105
|
-
}
|
|
106
|
-
function y(e, t, n, r) {
|
|
107
|
-
let i = v(e);
|
|
108
|
-
for (let a of t.features) {
|
|
109
|
-
let t = i.get(a.id);
|
|
110
|
-
if (t !== void 0) {
|
|
111
|
-
b(e, a, t);
|
|
112
|
-
continue;
|
|
113
|
-
}
|
|
114
|
-
x(e, a, n, r);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
function b(e, t, n) {
|
|
118
|
-
e.registerFeature(t.id, {
|
|
119
|
-
key: `${n}`,
|
|
120
|
-
name: t.name,
|
|
121
|
-
enabled: !0,
|
|
122
|
-
weight: t.weight,
|
|
123
|
-
...t.valueType !== void 0 && { valueType: t.valueType },
|
|
124
|
-
...t.variants !== void 0 && { variants: t.variants },
|
|
125
|
-
storage: "session",
|
|
126
|
-
decide: () => n
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
function x(e, t, n, r) {
|
|
130
|
-
let o = t.id, s = t.variants;
|
|
131
|
-
e.registerFeature(o, {
|
|
132
|
-
key: `v${t.version}`,
|
|
133
|
-
name: t.name,
|
|
134
|
-
enabled: t.enabled,
|
|
135
|
-
weight: t.weight,
|
|
136
|
-
storage: n ? "session" : "local",
|
|
137
|
-
valueType: t.valueType,
|
|
138
|
-
variants: s,
|
|
139
|
-
decide: () => t.valueType === "text" ? !s || s.length === 0 ? (`${o}`, !1) : l(r, o, s)?.value ?? !1 : a(i(r, o), t.weight)
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function S(e, t) {
|
|
143
|
-
for (let n of [...t.references ?? [], ...t.content]) e.registerContent({
|
|
144
|
-
id: n.id,
|
|
145
|
-
contentModelKey: n.contentModelKey,
|
|
146
|
-
data: n.data
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
function C(e, t) {
|
|
150
|
-
let n = /* @__PURE__ */ new Map();
|
|
151
|
-
return (r, i) => {
|
|
152
|
-
let a = n.get(r.id);
|
|
153
|
-
if (a) return a;
|
|
154
|
-
let o = (async () => {
|
|
155
|
-
try {
|
|
156
|
-
let n = await t(r, i);
|
|
157
|
-
return n && S(e, n), n;
|
|
158
|
-
} finally {
|
|
159
|
-
n.delete(r.id);
|
|
160
|
-
}
|
|
161
|
-
})();
|
|
162
|
-
return n.set(r.id, o), o;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
function w(e, t) {
|
|
166
|
-
let n = new Set(t && Array.isArray(t.experiences) ? t.experiences.map((e) => e.id) : []);
|
|
167
|
-
return (t, r) => n.has(t.id) ? e(t, r) : Promise.resolve(null);
|
|
168
|
-
}
|
|
169
|
-
function T() {
|
|
170
|
-
return {
|
|
171
|
-
name: "dynamic-experiences",
|
|
172
|
-
setup: (e) => ({ onStart: t({
|
|
173
|
-
source: e.session.store.map((e) => e.id),
|
|
174
|
-
effect: async (t) => {
|
|
175
|
-
let n = _(e), r = n !== void 0, i = n === void 0 ? void 0 : { previewToken: n }, a = await e.getProjectConfig(n === void 0 ? void 0 : { previewToken: n }).catch((e) => null);
|
|
176
|
-
if (e.contentLoader = C(e, w((t) => e.getExperienceContent(t, i), a)), !a) return;
|
|
177
|
-
let o = e.seededVersionId;
|
|
178
|
-
if (o !== null && o !== a.versionId) {
|
|
179
|
-
e.versionSkew = {
|
|
180
|
-
seeded: o,
|
|
181
|
-
resolved: a.versionId
|
|
182
|
-
}, `${a.versionId}${o}`;
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
e.previewEmbedderOrigins = a.previewEmbedderOrigins ?? null, g(e, a, {
|
|
186
|
-
isPreview: r,
|
|
187
|
-
sessionId: t
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
}) })
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
//#endregion
|
|
194
|
-
export { g as n, T as t };
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./object-BUDGxEqy.js";
|
|
2
|
-
import { a as t, f as n } from "./supports-CO9bJGNl.js";
|
|
3
|
-
import { t as r } from "./inert-script-report-B_bMPRzp.js";
|
|
4
|
-
import { a as i, i as a, n as o, o as s, s as c } from "./protocol-C5KkkiZc.js";
|
|
5
|
-
//#region src/preview-bridge/index.ts
|
|
6
|
-
var l = "picked-preview:navigation", u = !1;
|
|
7
|
-
function d() {
|
|
8
|
-
return "*";
|
|
9
|
-
}
|
|
10
|
-
function f() {
|
|
11
|
-
let { href: e, pathname: t, search: n } = globalThis.location, r = {
|
|
12
|
-
type: l,
|
|
13
|
-
href: e,
|
|
14
|
-
pathname: t,
|
|
15
|
-
search: n
|
|
16
|
-
};
|
|
17
|
-
globalThis.parent.postMessage(r, d());
|
|
18
|
-
}
|
|
19
|
-
function p(e) {
|
|
20
|
-
return function(...t) {
|
|
21
|
-
e.apply(this, t), f();
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function m() {
|
|
25
|
-
if (u || !n()) return () => void 0;
|
|
26
|
-
u = !0, f();
|
|
27
|
-
let r = () => {
|
|
28
|
-
f();
|
|
29
|
-
};
|
|
30
|
-
return globalThis.addEventListener("popstate", r), t() && (e(globalThis.history, "pushState", p), e(globalThis.history, "replaceState", p)), () => {
|
|
31
|
-
u = !1, globalThis.removeEventListener("popstate", r);
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
//#endregion
|
|
35
|
-
//#region src/preview-receiver/index.ts
|
|
36
|
-
var h = 5e3, g = !1;
|
|
37
|
-
function _(e, t, n) {
|
|
38
|
-
if (e) {
|
|
39
|
-
e.postMessage(n);
|
|
40
|
-
return;
|
|
41
|
-
}
|
|
42
|
-
for (let e of t) globalThis.parent.postMessage(n, e);
|
|
43
|
-
}
|
|
44
|
-
function v(e) {
|
|
45
|
-
if (g) return () => void 0;
|
|
46
|
-
g = !0;
|
|
47
|
-
let t = null, n = !1, l = /* @__PURE__ */ new Map(), u = () => e.previewEmbedderOrigins ?? [], d = () => {
|
|
48
|
-
if (n) return;
|
|
49
|
-
let r = u();
|
|
50
|
-
if (r.length === 0) return;
|
|
51
|
-
n = !0;
|
|
52
|
-
let i = {
|
|
53
|
-
type: a,
|
|
54
|
-
protocolVersion: 1,
|
|
55
|
-
contentIds: Object.keys(e.contents.indexStore.getState())
|
|
56
|
-
};
|
|
57
|
-
_(t, r, i);
|
|
58
|
-
}, f = (n) => {
|
|
59
|
-
if (!s(n)) return;
|
|
60
|
-
let r = l.get(n.contentId);
|
|
61
|
-
if (r !== void 0 && n.seq > r + 1) {
|
|
62
|
-
let e = {
|
|
63
|
-
type: i,
|
|
64
|
-
contentId: n.contentId,
|
|
65
|
-
lastSeq: r
|
|
66
|
-
};
|
|
67
|
-
_(t, u(), e);
|
|
68
|
-
}
|
|
69
|
-
l.set(n.contentId, n.seq), n.ops.length > 0 && e.patchContent(n.contentId, (e) => c(e, n.ops));
|
|
70
|
-
}, p = (e) => {
|
|
71
|
-
if (!u().includes(e.origin)) return;
|
|
72
|
-
let n = e.ports.at(0);
|
|
73
|
-
n && !t && (t = n, t.onmessage = (e) => f(e.data), t.start()), f(e.data);
|
|
74
|
-
};
|
|
75
|
-
globalThis.addEventListener("message", p);
|
|
76
|
-
let m = r((e) => {
|
|
77
|
-
let n = u();
|
|
78
|
-
n.length !== 0 && _(t, n, {
|
|
79
|
-
type: o,
|
|
80
|
-
total: e
|
|
81
|
-
});
|
|
82
|
-
}), v = e.contents.indexStore.watch((e) => {
|
|
83
|
-
Object.keys(e).length > 0 && d();
|
|
84
|
-
}), y = setTimeout(d, h);
|
|
85
|
-
return () => {
|
|
86
|
-
g = !1, n = !1, clearTimeout(y), globalThis.removeEventListener("message", p), m(), v.unsubscribe(), t && (t.onmessage = null), t = null;
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
//#endregion
|
|
90
|
-
//#region src/preview-channel.ts
|
|
91
|
-
function y(e) {
|
|
92
|
-
let t = m(), n = v(e);
|
|
93
|
-
return () => {
|
|
94
|
-
t(), n();
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { y as initPreviewChannel };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./object-CIkt7Fkr.cjs"),t=require("./supports-DBzjGaWD.cjs"),n=require("./inert-script-report-ijRHPtcY.cjs"),r=require("./protocol-Bb_vpLKE.cjs");var i=`picked-preview:navigation`,a=!1;function o(){return`*`}function s(){let{href:e,pathname:t,search:n}=globalThis.location,r={type:i,href:e,pathname:t,search:n};globalThis.parent.postMessage(r,o())}function c(e){return function(...t){e.apply(this,t),s()}}function l(){if(a||!t.f())return()=>void 0;a=!0,s();let n=()=>{s()};return globalThis.addEventListener(`popstate`,n),t.a()&&(e.n(globalThis.history,`pushState`,c),e.n(globalThis.history,`replaceState`,c)),()=>{a=!1,globalThis.removeEventListener(`popstate`,n)}}var u=5e3,d=!1;function f(e,t,n){if(e){e.postMessage(n);return}for(let e of t)globalThis.parent.postMessage(n,e)}function p(e){if(d)return()=>void 0;d=!0;let t=null,i=!1,a=new Map,o=()=>e.previewEmbedderOrigins??[],s=()=>{if(i)return;let n=o();if(n.length===0)return;i=!0;let a={type:r.i,protocolVersion:1,contentIds:Object.keys(e.contents.indexStore.getState())};f(t,n,a)},c=n=>{if(!r.o(n))return;let i=a.get(n.contentId);if(i!==void 0&&n.seq>i+1){let e={type:r.a,contentId:n.contentId,lastSeq:i};f(t,o(),e)}a.set(n.contentId,n.seq),n.ops.length>0&&e.patchContent(n.contentId,e=>r.s(e,n.ops))},l=e=>{if(!o().includes(e.origin))return;let n=e.ports.at(0);n&&!t&&(t=n,t.onmessage=e=>c(e.data),t.start()),c(e.data)};globalThis.addEventListener(`message`,l);let p=n.t(e=>{let n=o();n.length!==0&&f(t,n,{type:r.n,total:e})}),m=e.contents.indexStore.watch(e=>{Object.keys(e).length>0&&s()}),h=setTimeout(s,u);return()=>{d=!1,i=!1,clearTimeout(h),globalThis.removeEventListener(`message`,l),p(),m.unsubscribe(),t&&(t.onmessage=null),t=null}}function m(e){let t=l(),n=p(e);return()=>{t(),n()}}exports.initPreviewChannel=m;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=/^[a-z][a-z0-9_]*$/,t=/^\d+$/,n=new Set([`__proto__`,`constructor`,`prototype`]);function r(r){let i=r.indexOf(`[`),a=i===-1?r:r.slice(0,i);if(!e.test(a)||n.has(a))return null;if(i===-1)return[a];let o=[a],s=r.slice(i);for(;s.length>0;){if(!s.startsWith(`[`))return null;let e=s.indexOf(`]`);if(e===-1)return null;let n=s.slice(1,e);if(!t.test(n))return null;o.push(Number(n)),s=s.slice(e+1)}return o}function i(e){if(typeof e!=`string`||e===``||e===`$`||!e.startsWith(`$.`))return[];let t=[];for(let n of e.slice(2).split(`.`)){let e=r(n);if(e===null)return[];t.push(...e)}return t}function a(e){let t=`$`;for(let n of e)t+=typeof n==`number`?`[${n}]`:`.${n}`;return t}function o(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function s(e,t,n){let[r,...i]=t;if(r===void 0)return n;if(typeof r==`number`){if(!Array.isArray(e)||r>=e.length)return e;let t=e[r],a=s(t,i,n);if(a===t)return e;let o=[...e];return o[r]=a,o}if(!o(e))return e;let a=e[r],c=i.length>0&&a===void 0&&typeof i[0]==`string`?s({},i,n):s(a,i,n);return c===a?e:{...e,[r]:c}}function c(e,t){let n=e;for(let e of t){let t=i(e.path);if(t.length===0)continue;let r=s(n,t,e.value);o(r)&&(n=r)}return n}var l=1,u=`picked-preview:ready`,d=`picked-preview:content-patch`,f=`picked-preview:resync`,p=`picked-preview:inert-scripts`;function m(e){return typeof e==`object`&&!!e&&`type`in e&&typeof Reflect.get(e,`type`)==`string`}function h(e){return typeof e!=`object`||!e?!1:typeof Reflect.get(e,`path`)==`string`&&`value`in e}function g(e){if(!m(e)||e.type!==`picked-preview:content-patch`)return!1;let t=Reflect.get(e,`contentId`),n=Reflect.get(e,`ops`),r=Reflect.get(e,`seq`);return typeof t==`string`&&t.length>0&&typeof r==`number`&&Number.isFinite(r)&&Array.isArray(n)&&n.every(h)}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
//#region src/utils/content-path.ts
|
|
2
|
-
var e = /^[a-z][a-z0-9_]*$/, t = /^\d+$/, n = /* @__PURE__ */ new Set([
|
|
3
|
-
"__proto__",
|
|
4
|
-
"constructor",
|
|
5
|
-
"prototype"
|
|
6
|
-
]);
|
|
7
|
-
function r(r) {
|
|
8
|
-
let i = r.indexOf("["), a = i === -1 ? r : r.slice(0, i);
|
|
9
|
-
if (!e.test(a) || n.has(a)) return null;
|
|
10
|
-
if (i === -1) return [a];
|
|
11
|
-
let o = [a], s = r.slice(i);
|
|
12
|
-
for (; s.length > 0;) {
|
|
13
|
-
if (!s.startsWith("[")) return null;
|
|
14
|
-
let e = s.indexOf("]");
|
|
15
|
-
if (e === -1) return null;
|
|
16
|
-
let n = s.slice(1, e);
|
|
17
|
-
if (!t.test(n)) return null;
|
|
18
|
-
o.push(Number(n)), s = s.slice(e + 1);
|
|
19
|
-
}
|
|
20
|
-
return o;
|
|
21
|
-
}
|
|
22
|
-
function i(e) {
|
|
23
|
-
if (typeof e != "string" || e === "" || e === "$" || !e.startsWith("$.")) return [];
|
|
24
|
-
let t = [];
|
|
25
|
-
for (let n of e.slice(2).split(".")) {
|
|
26
|
-
let e = r(n);
|
|
27
|
-
if (e === null) return [];
|
|
28
|
-
t.push(...e);
|
|
29
|
-
}
|
|
30
|
-
return t;
|
|
31
|
-
}
|
|
32
|
-
function a(e) {
|
|
33
|
-
let t = "$";
|
|
34
|
-
for (let n of e) t += typeof n == "number" ? `[${n}]` : `.${n}`;
|
|
35
|
-
return t;
|
|
36
|
-
}
|
|
37
|
-
//#endregion
|
|
38
|
-
//#region src/preview-receiver/apply-ops.ts
|
|
39
|
-
function o(e) {
|
|
40
|
-
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
41
|
-
}
|
|
42
|
-
function s(e, t, n) {
|
|
43
|
-
let [r, ...i] = t;
|
|
44
|
-
if (r === void 0) return n;
|
|
45
|
-
if (typeof r == "number") {
|
|
46
|
-
if (!Array.isArray(e) || r >= e.length) return e;
|
|
47
|
-
let t = e[r], a = s(t, i, n);
|
|
48
|
-
if (a === t) return e;
|
|
49
|
-
let o = [...e];
|
|
50
|
-
return o[r] = a, o;
|
|
51
|
-
}
|
|
52
|
-
if (!o(e)) return e;
|
|
53
|
-
let a = e[r], c = i.length > 0 && a === void 0 && typeof i[0] == "string" ? s({}, i, n) : s(a, i, n);
|
|
54
|
-
return c === a ? e : {
|
|
55
|
-
...e,
|
|
56
|
-
[r]: c
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function c(e, t) {
|
|
60
|
-
let n = e;
|
|
61
|
-
for (let e of t) {
|
|
62
|
-
let t = i(e.path);
|
|
63
|
-
if (t.length === 0) continue;
|
|
64
|
-
let r = s(n, t, e.value);
|
|
65
|
-
o(r) && (n = r);
|
|
66
|
-
}
|
|
67
|
-
return n;
|
|
68
|
-
}
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/preview-receiver/protocol.ts
|
|
71
|
-
var l = 1, u = "picked-preview:ready", d = "picked-preview:content-patch", f = "picked-preview:resync", p = "picked-preview:inert-scripts";
|
|
72
|
-
function m(e) {
|
|
73
|
-
return typeof e == "object" && !!e && "type" in e && typeof Reflect.get(e, "type") == "string";
|
|
74
|
-
}
|
|
75
|
-
function h(e) {
|
|
76
|
-
return typeof e != "object" || !e ? !1 : typeof Reflect.get(e, "path") == "string" && "value" in e;
|
|
77
|
-
}
|
|
78
|
-
function g(e) {
|
|
79
|
-
if (!m(e) || e.type !== "picked-preview:content-patch") return !1;
|
|
80
|
-
let t = Reflect.get(e, "contentId"), n = Reflect.get(e, "ops"), r = Reflect.get(e, "seq");
|
|
81
|
-
return typeof t == "string" && t.length > 0 && typeof r == "number" && Number.isFinite(r) && Array.isArray(n) && n.every(h);
|
|
82
|
-
}
|
|
83
|
-
//#endregion
|
|
84
|
-
export { f as a, a as c, u as i, i as l, p as n, g as o, l as r, c as s, d as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("./logger-CSTvAyyB.cjs");const e=require("./api-qiqq8lgz.cjs"),t=require("./registry-C1t8l3t9.cjs");function n(e,t){try{return e?.onRequest(t)??{}}catch{return{}}}function r(e,t,n){try{e.onSettled?.(t,n)}catch{}}async function i(e,t,i){let a=n(e?.(),t),o;try{let e=await i(a.headers,e=>{o=e});return r(a,e!==null,o),e}catch(e){throw r(a,!1,o),e}}var a=`bundle`,o=`api`;async function s(){try{let e=await import(`virtual:picked/data`);return t.r(e)?e:null}catch{return null}}function c(e){if(e===void 0||t.r(e))return e}function l(n){let{apiUrl:r,projectId:l,previewToken:u,signal:d,getRequestObserver:f}=n,p=!!u,m=p?o:n.mode,h=c(p?void 0:n.bundle),g=p?void 0:n.projectConfig,_=n.getContent,v={mode:m??o,manifest:null},y,b,x=new Map;function S(){if(m===o)return Promise.resolve(null);if(h)return Promise.resolve(h);let e=t.t();return e?Promise.resolve(e):(y??=s(),y)}function C(e){v.mode=e?a:o,v.manifest=e?e.manifestMetadata:null}async function w(){if(g)return C(await S()),g;let t=await S();return C(t),t?t.projectConfig:m===a?null:i(f,`project-config`,(t,n)=>e.n(r,l,{...u!==void 0&&{previewToken:u},...d!==void 0&&{signal:d},...t!==void 0&&{headers:t},...n!==void 0&&{onResponse:n}}))}async function T(t,n){let o=u===void 0?void 0:{previewToken:u};if(_)return _(t,o);let s=await S();if(C(s),s)try{return await s.experienceContent(t,o)}catch{return`${t.id}`,null}if(m===a)return null;let c=n??d;return i(f,`experience-content`,(n,i)=>e.t(r,l,t.id,{...u!==void 0&&{previewToken:u},...c!==void 0&&{signal:c},...n!==void 0&&{headers:n},...i!==void 0&&{onResponse:i}}))}return{meta:v,getProjectConfig:()=>(b??=w(),b),getContent:(e,t)=>{let n=x.get(e.id);if(n)return n;let r=T(e,t?.signal).finally(()=>{x.delete(e.id)});return x.set(e.id,r),r}}}exports.createPickedDataProvider=l;
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import "./logger-DMN6TxJJ.js";
|
|
2
|
-
import { n as e, t } from "./api-DbMJli3H.js";
|
|
3
|
-
import { r as n, t as r } from "./registry-CXZv0uLg.js";
|
|
4
|
-
//#region src/data-source/request-observer.ts
|
|
5
|
-
function i(e, t) {
|
|
6
|
-
try {
|
|
7
|
-
return e?.onRequest(t) ?? {};
|
|
8
|
-
} catch {
|
|
9
|
-
return {};
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
function a(e, t, n) {
|
|
13
|
-
try {
|
|
14
|
-
e.onSettled?.(t, n);
|
|
15
|
-
} catch {}
|
|
16
|
-
}
|
|
17
|
-
async function o(e, t, n) {
|
|
18
|
-
let r = i(e?.(), t), o;
|
|
19
|
-
try {
|
|
20
|
-
let e = await n(r.headers, (e) => {
|
|
21
|
-
o = e;
|
|
22
|
-
});
|
|
23
|
-
return a(r, e !== null, o), e;
|
|
24
|
-
} catch (e) {
|
|
25
|
-
throw a(r, !1, o), e;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
//#endregion
|
|
29
|
-
//#region src/data-source/provider.ts
|
|
30
|
-
var s = "bundle", c = "api";
|
|
31
|
-
async function l() {
|
|
32
|
-
try {
|
|
33
|
-
let e = await import("virtual:picked/data");
|
|
34
|
-
return n(e) ? e : null;
|
|
35
|
-
} catch {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
function u(e) {
|
|
40
|
-
if (e === void 0 || n(e)) return e;
|
|
41
|
-
}
|
|
42
|
-
function d(n) {
|
|
43
|
-
let { apiUrl: i, projectId: a, previewToken: d, signal: f, getRequestObserver: p } = n, m = !!d, h = m ? c : n.mode, g = u(m ? void 0 : n.bundle), _ = m ? void 0 : n.projectConfig, v = n.getContent, y = {
|
|
44
|
-
mode: h ?? c,
|
|
45
|
-
manifest: null
|
|
46
|
-
}, b, x, S = /* @__PURE__ */ new Map();
|
|
47
|
-
function C() {
|
|
48
|
-
if (h === c) return Promise.resolve(null);
|
|
49
|
-
if (g) return Promise.resolve(g);
|
|
50
|
-
let e = r();
|
|
51
|
-
return e ? Promise.resolve(e) : (b ??= l(), b);
|
|
52
|
-
}
|
|
53
|
-
function w(e) {
|
|
54
|
-
y.mode = e ? s : c, y.manifest = e ? e.manifestMetadata : null;
|
|
55
|
-
}
|
|
56
|
-
async function T() {
|
|
57
|
-
if (_) return w(await C()), _;
|
|
58
|
-
let t = await C();
|
|
59
|
-
return w(t), t ? t.projectConfig : h === s ? null : o(p, "project-config", (t, n) => e(i, a, {
|
|
60
|
-
...d !== void 0 && { previewToken: d },
|
|
61
|
-
...f !== void 0 && { signal: f },
|
|
62
|
-
...t !== void 0 && { headers: t },
|
|
63
|
-
...n !== void 0 && { onResponse: n }
|
|
64
|
-
}));
|
|
65
|
-
}
|
|
66
|
-
async function E(e, n) {
|
|
67
|
-
let r = d === void 0 ? void 0 : { previewToken: d };
|
|
68
|
-
if (v) return v(e, r);
|
|
69
|
-
let c = await C();
|
|
70
|
-
if (w(c), c) try {
|
|
71
|
-
return await c.experienceContent(e, r);
|
|
72
|
-
} catch {
|
|
73
|
-
return `${e.id}`, null;
|
|
74
|
-
}
|
|
75
|
-
if (h === s) return null;
|
|
76
|
-
let l = n ?? f;
|
|
77
|
-
return o(p, "experience-content", (n, r) => t(i, a, e.id, {
|
|
78
|
-
...d !== void 0 && { previewToken: d },
|
|
79
|
-
...l !== void 0 && { signal: l },
|
|
80
|
-
...n !== void 0 && { headers: n },
|
|
81
|
-
...r !== void 0 && { onResponse: r }
|
|
82
|
-
}));
|
|
83
|
-
}
|
|
84
|
-
return {
|
|
85
|
-
meta: y,
|
|
86
|
-
getProjectConfig: () => (x ??= T(), x),
|
|
87
|
-
getContent: (e, t) => {
|
|
88
|
-
let n = S.get(e.id);
|
|
89
|
-
if (n) return n;
|
|
90
|
-
let r = E(e, t?.signal).finally(() => {
|
|
91
|
-
S.delete(e.id);
|
|
92
|
-
});
|
|
93
|
-
return S.set(e.id, r), r;
|
|
94
|
-
}
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
export { d as createPickedDataProvider };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("./logger-CSTvAyyB.cjs");function e(e){if(typeof e!=`object`||!e||!(`projectConfig`in e)||!(`experienceContent`in e)||!(`manifestMetadata`in e))return!1;let{experienceContent:t}=e;return typeof t==`function`}var t=null;function n(n){e(n)&&(t=n)}function r(){return t}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "./logger-DMN6TxJJ.js";
|
|
2
|
-
//#region src/data-source/virtual-data.ts
|
|
3
|
-
function e(e) {
|
|
4
|
-
if (typeof e != "object" || !e || !("projectConfig" in e) || !("experienceContent" in e) || !("manifestMetadata" in e)) return !1;
|
|
5
|
-
let { experienceContent: t } = e;
|
|
6
|
-
return typeof t == "function";
|
|
7
|
-
}
|
|
8
|
-
//#endregion
|
|
9
|
-
//#region src/data-source/registry.ts
|
|
10
|
-
var t = null;
|
|
11
|
-
function n(n) {
|
|
12
|
-
e(n) && (t = n);
|
|
13
|
-
}
|
|
14
|
-
function r() {
|
|
15
|
-
return t;
|
|
16
|
-
}
|
|
17
|
-
//#endregion
|
|
18
|
-
export { n, e as r, r as t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./object-CIkt7Fkr.cjs");function t(t){return!e.t(t)}async function n(e,t,n){return await e.evaluateRuleLogicFx({rule:t,context:n})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return t}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./object-BUDGxEqy.js";
|
|
2
|
-
//#region src/utils/rules-logic.ts
|
|
3
|
-
function t(t) {
|
|
4
|
-
return !e(t);
|
|
5
|
-
}
|
|
6
|
-
async function n(e, t, n) {
|
|
7
|
-
return await e.evaluateRuleLogicFx({
|
|
8
|
-
rule: t,
|
|
9
|
-
context: n
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
export { t as n, n as t };
|
package/dist/storage-1MW3-_As.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
//#region src/utils/storage.ts
|
|
2
|
-
var e = (e) => btoa([...e].map((e) => String.fromCharCode(e.charCodeAt(0) ^ 7)).join("")).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
3
|
-
function t(t, n = "global", r) {
|
|
4
|
-
let i = "pckd";
|
|
5
|
-
if (n === "experience") {
|
|
6
|
-
if (!r) throw Error("Experience instance is required to scope storage to an experience");
|
|
7
|
-
i = `${i}:${r.experienceId}`;
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
_: `${i}:${e(t)}`,
|
|
11
|
-
scope: n
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
var n = /* @__PURE__ */ new Map();
|
|
15
|
-
function r(e, t) {
|
|
16
|
-
let r = n.get(e._);
|
|
17
|
-
r && r.forEach((n) => n(e, t));
|
|
18
|
-
}
|
|
19
|
-
function i(e, t, n, i) {
|
|
20
|
-
let a = n === "local" ? localStorage : sessionStorage, o = typeof t == "string" ? t : JSON.stringify(t);
|
|
21
|
-
if (a.setItem(e._, o), typeof i == "number") {
|
|
22
|
-
let t = new Date(Date.now() + i).toISOString();
|
|
23
|
-
a.setItem(`${e._}:expires-at`, t);
|
|
24
|
-
}
|
|
25
|
-
r(e, n);
|
|
26
|
-
}
|
|
27
|
-
function a(e, t) {
|
|
28
|
-
let n = t === "local" ? localStorage : sessionStorage;
|
|
29
|
-
n.removeItem(e._), n.removeItem(`${e._}:expires-at`), r(e, t);
|
|
30
|
-
}
|
|
31
|
-
function o(e, t, r, i) {
|
|
32
|
-
let a = t === "local" ? localStorage : sessionStorage;
|
|
33
|
-
function o(t) {
|
|
34
|
-
t.storageArea === a && t.key === e._ && i(r(e));
|
|
35
|
-
}
|
|
36
|
-
function s(e, n) {
|
|
37
|
-
n === t && i(r(e));
|
|
38
|
-
}
|
|
39
|
-
window.addEventListener("storage", o), n.has(e._) || n.set(e._, /* @__PURE__ */ new Set());
|
|
40
|
-
let c = n.get(e._);
|
|
41
|
-
return c && c.add(s), function() {
|
|
42
|
-
window.removeEventListener("storage", o);
|
|
43
|
-
let t = n.get(e._);
|
|
44
|
-
t && (t.delete(s), t.size === 0 && n.delete(e._));
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
function s(e, t) {
|
|
48
|
-
let n = t === "local" ? localStorage : sessionStorage, r = n.getItem(e._), c = n.getItem(`${e._}:expires-at`), l = (n, r) => i(e, n, t, r), u = () => a(e, t), d = (n) => o(e, t, (e) => s(e, t), n);
|
|
49
|
-
return c && /* @__PURE__ */ new Date() > new Date(c) ? (a(e, t), {
|
|
50
|
-
isSet: () => !1,
|
|
51
|
-
text: () => null,
|
|
52
|
-
json: () => null,
|
|
53
|
-
boolean: () => null,
|
|
54
|
-
set: l,
|
|
55
|
-
remove: u,
|
|
56
|
-
subscribe: d
|
|
57
|
-
}) : {
|
|
58
|
-
isSet() {
|
|
59
|
-
return r !== null;
|
|
60
|
-
},
|
|
61
|
-
text() {
|
|
62
|
-
return r;
|
|
63
|
-
},
|
|
64
|
-
json() {
|
|
65
|
-
return r ? JSON.parse(r) : null;
|
|
66
|
-
},
|
|
67
|
-
boolean() {
|
|
68
|
-
return r ? r === "true" : null;
|
|
69
|
-
},
|
|
70
|
-
set: l,
|
|
71
|
-
remove: u,
|
|
72
|
-
subscribe: d
|
|
73
|
-
};
|
|
74
|
-
}
|
|
75
|
-
var c = {
|
|
76
|
-
get(e) {
|
|
77
|
-
return s(e, "session");
|
|
78
|
-
},
|
|
79
|
-
set(e, t, n) {
|
|
80
|
-
i(e, t, "session", n);
|
|
81
|
-
},
|
|
82
|
-
remove(e) {
|
|
83
|
-
a(e, "session");
|
|
84
|
-
},
|
|
85
|
-
subscribe(e, t) {
|
|
86
|
-
return o(e, "session", this.get, t);
|
|
87
|
-
}
|
|
88
|
-
}, l = {
|
|
89
|
-
get(e) {
|
|
90
|
-
return s(e, "local");
|
|
91
|
-
},
|
|
92
|
-
set(e, t, n) {
|
|
93
|
-
i(e, t, "local", n);
|
|
94
|
-
},
|
|
95
|
-
remove(e) {
|
|
96
|
-
a(e, "local");
|
|
97
|
-
},
|
|
98
|
-
subscribe(e, t) {
|
|
99
|
-
return o(e, "local", this.get, t);
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
//#endregion
|
|
103
|
-
export { o as i, l as n, c as r, t };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=e=>btoa([...e].map(e=>String.fromCharCode(e.charCodeAt(0)^7)).join(``)).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=+$/,``);function t(t,n=`global`,r){let i=`pckd`;if(n===`experience`){if(!r)throw Error(`Experience instance is required to scope storage to an experience`);i=`${i}:${r.experienceId}`}return{_:`${i}:${e(t)}`,scope:n}}var n=new Map;function r(e,t){let r=n.get(e._);r&&r.forEach(n=>n(e,t))}function i(e,t,n,i){let a=n===`local`?localStorage:sessionStorage,o=typeof t==`string`?t:JSON.stringify(t);if(a.setItem(e._,o),typeof i==`number`){let t=new Date(Date.now()+i).toISOString();a.setItem(`${e._}:expires-at`,t)}r(e,n)}function a(e,t){let n=t===`local`?localStorage:sessionStorage;n.removeItem(e._),n.removeItem(`${e._}:expires-at`),r(e,t)}function o(e,t,r,i){let a=t===`local`?localStorage:sessionStorage;function o(t){t.storageArea===a&&t.key===e._&&i(r(e))}function s(e,n){n===t&&i(r(e))}window.addEventListener(`storage`,o),n.has(e._)||n.set(e._,new Set);let c=n.get(e._);return c&&c.add(s),function(){window.removeEventListener(`storage`,o);let t=n.get(e._);t&&(t.delete(s),t.size===0&&n.delete(e._))}}function s(e,t){let n=t===`local`?localStorage:sessionStorage,r=n.getItem(e._),c=n.getItem(`${e._}:expires-at`),l=(n,r)=>i(e,n,t,r),u=()=>a(e,t),d=n=>o(e,t,e=>s(e,t),n);return c&&new Date>new Date(c)?(a(e,t),{isSet:()=>!1,text:()=>null,json:()=>null,boolean:()=>null,set:l,remove:u,subscribe:d}):{isSet(){return r!==null},text(){return r},json(){return r?JSON.parse(r):null},boolean(){return r?r===`true`:null},set:l,remove:u,subscribe:d}}var c={get(e){return s(e,`session`)},set(e,t,n){i(e,t,`session`,n)},remove(e){a(e,`session`)},subscribe(e,t){return o(e,`session`,this.get,t)}},l={get(e){return s(e,`local`)},set(e,t,n){i(e,t,`local`,n)},remove(e){a(e,`local`)},subscribe(e,t){return o(e,`local`,this.get,t)}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return t}});
|