@dialecte/core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/hub.worker-B1HcVDhn.js +2 -0
- package/dist/diagnostics/diagnostics.d.ts +4 -0
- package/dist/diagnostics/diagnostics.d.ts.map +1 -1
- package/dist/diagnostics/types.d.ts +6 -1
- package/dist/diagnostics/types.d.ts.map +1 -1
- package/dist/dialecte/create-dialecte-project.d.ts +11 -0
- package/dist/dialecte/create-dialecte-project.d.ts.map +1 -0
- package/dist/dialecte/create-project-factory.d.ts +14 -0
- package/dist/dialecte/create-project-factory.d.ts.map +1 -0
- package/dist/dialecte/define-dialecte.d.ts +12 -0
- package/dist/dialecte/define-dialecte.d.ts.map +1 -0
- package/dist/dialecte/dialecte.constants.d.ts +4 -0
- package/dist/dialecte/dialecte.constants.d.ts.map +1 -0
- package/dist/dialecte/dialecte.types.d.ts +75 -0
- package/dist/dialecte/dialecte.types.d.ts.map +1 -0
- package/dist/dialecte/index.d.ts +4 -0
- package/dist/dialecte/index.d.ts.map +1 -0
- package/dist/{project-DIKdMMHx.js → dialecte-gIPrRzni.js} +8031 -8457
- package/dist/document/bind-extensions.d.ts +4 -1
- package/dist/document/bind-extensions.d.ts.map +1 -1
- package/dist/document/document.d.ts +58 -5
- package/dist/document/document.d.ts.map +1 -1
- package/dist/document/progress/progress.types.d.ts +21 -4
- package/dist/document/progress/progress.types.d.ts.map +1 -1
- package/dist/document/query/find/ancestor/find-ancestor.d.ts +2 -0
- package/dist/document/query/find/ancestor/find-ancestor.d.ts.map +1 -1
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts +4 -0
- package/dist/document/query/find/by-attribute/find-by-attributes.d.ts.map +1 -1
- package/dist/document/query/find/descendant/find-descendant.d.ts +2 -0
- package/dist/document/query/find/descendant/find-descendant.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attribute.d.ts +4 -0
- package/dist/document/query/get/attribute/get-attribute.d.ts.map +1 -1
- package/dist/document/query/get/attribute/get-attributes.d.ts +4 -0
- package/dist/document/query/get/attribute/get-attributes.d.ts.map +1 -1
- package/dist/document/query/get/definition/get-definition.d.ts +2 -0
- package/dist/document/query/get/definition/get-definition.d.ts.map +1 -1
- package/dist/document/query/get/record/get-child.d.ts +2 -0
- package/dist/document/query/get/record/get-child.d.ts.map +1 -1
- package/dist/document/query/get/record/get-children.d.ts +2 -0
- package/dist/document/query/get/record/get-children.d.ts.map +1 -1
- package/dist/document/query/get/record/get-record.d.ts +2 -0
- package/dist/document/query/get/record/get-record.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records-by-tagname.d.ts +2 -0
- package/dist/document/query/get/record/get-records-by-tagname.d.ts.map +1 -1
- package/dist/document/query/get/record/get-records.d.ts +2 -0
- package/dist/document/query/get/record/get-records.d.ts.map +1 -1
- package/dist/document/query/get/record/load-live-records.d.ts +2 -0
- package/dist/document/query/get/record/load-live-records.d.ts.map +1 -1
- package/dist/document/query/get/record/resolve-record.d.ts +2 -0
- package/dist/document/query/get/record/resolve-record.d.ts.map +1 -1
- package/dist/document/query/get/record/staged-lookup.d.ts +4 -0
- package/dist/document/query/get/record/staged-lookup.d.ts.map +1 -1
- package/dist/document/query/get/tree/get-tree.d.ts +6 -0
- package/dist/document/query/get/tree/get-tree.d.ts.map +1 -1
- package/dist/document/query/main.d.ts +50 -15
- package/dist/document/query/main.d.ts.map +1 -1
- package/dist/document/query/snapshot/collect-snapshot.d.ts +2 -0
- package/dist/document/query/snapshot/collect-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/get-snapshot.d.ts +2 -0
- package/dist/document/query/snapshot/get-snapshot.d.ts.map +1 -1
- package/dist/document/query/snapshot/records-to-tree.d.ts +2 -0
- package/dist/document/query/snapshot/records-to-tree.d.ts.map +1 -1
- package/dist/document/query/tree-filter/omit.d.ts +8 -0
- package/dist/document/query/tree-filter/omit.d.ts.map +1 -1
- package/dist/document/query/tree-filter/order.d.ts +5 -2
- package/dist/document/query/tree-filter/order.d.ts.map +1 -1
- package/dist/document/query/tree-filter/unwrap.d.ts +2 -0
- package/dist/document/query/tree-filter/unwrap.d.ts.map +1 -1
- package/dist/document/staged-operations.d.ts +5 -1
- package/dist/document/staged-operations.d.ts.map +1 -1
- package/dist/document/transaction/clone/clone.d.ts +2 -0
- package/dist/document/transaction/clone/clone.d.ts.map +1 -1
- package/dist/document/transaction/commit/commit.d.ts.map +1 -1
- package/dist/document/transaction/commit/merge-operations.d.ts +1 -1
- package/dist/document/transaction/commit/merge-operations.d.ts.map +1 -1
- package/dist/document/transaction/commit/summarize-operations.d.ts +16 -0
- package/dist/document/transaction/commit/summarize-operations.d.ts.map +1 -0
- package/dist/document/transaction/commit/summarize-operations.types.d.ts +17 -0
- package/dist/document/transaction/commit/summarize-operations.types.d.ts.map +1 -0
- package/dist/document/transaction/create/create.d.ts +2 -0
- package/dist/document/transaction/create/create.d.ts.map +1 -1
- package/dist/document/transaction/guard.d.ts +5 -0
- package/dist/document/transaction/guard.d.ts.map +1 -1
- package/dist/document/transaction/index.d.ts +2 -0
- package/dist/document/transaction/index.d.ts.map +1 -1
- package/dist/document/transaction/main.d.ts +46 -16
- package/dist/document/transaction/main.d.ts.map +1 -1
- package/dist/document/transaction/stage-operations.d.ts.map +1 -1
- package/dist/document/transaction/update/update.d.ts +2 -0
- package/dist/document/transaction/update/update.d.ts.map +1 -1
- package/dist/document/types.d.ts +3 -5
- package/dist/document/types.d.ts.map +1 -1
- package/dist/engine-store-CIEqgPUb.js +348 -0
- package/dist/engine.constants-DBMjMmV9.js +98 -0
- package/dist/engine.d.ts +9 -0
- package/dist/engine.d.ts.map +1 -0
- package/dist/engine.js +15805 -0
- package/dist/errors/codes.d.ts +451 -0
- package/dist/errors/codes.d.ts.map +1 -1
- package/dist/errors/errors.constants.d.ts +3 -0
- package/dist/errors/errors.constants.d.ts.map +1 -0
- package/dist/errors/errors.d.ts +10 -0
- package/dist/errors/errors.d.ts.map +1 -1
- package/dist/errors/types.d.ts +14 -0
- package/dist/errors/types.d.ts.map +1 -1
- package/dist/helpers/assert-fixed.d.ts +3 -1
- package/dist/helpers/assert-fixed.d.ts.map +1 -1
- package/dist/helpers/assert-xml-characters.d.ts +35 -0
- package/dist/helpers/assert-xml-characters.d.ts.map +1 -0
- package/dist/helpers/assert-xml-characters.types.d.ts +26 -0
- package/dist/helpers/assert-xml-characters.types.d.ts.map +1 -0
- package/dist/helpers/assert-xsi-type.d.ts +4 -0
- package/dist/helpers/assert-xsi-type.d.ts.map +1 -1
- package/dist/helpers/converter.d.ts +21 -6
- package/dist/helpers/converter.d.ts.map +1 -1
- package/dist/helpers/evaluate-expectations.d.ts +21 -0
- package/dist/helpers/evaluate-expectations.d.ts.map +1 -0
- package/dist/helpers/evaluate-expectations.types.d.ts +31 -0
- package/dist/helpers/evaluate-expectations.types.d.ts.map +1 -0
- package/dist/helpers/guard.d.ts +24 -4
- package/dist/helpers/guard.d.ts.map +1 -1
- package/dist/helpers/index.d.ts +2 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/merge-extensions.d.ts +2 -0
- package/dist/helpers/merge-extensions.d.ts.map +1 -1
- package/dist/helpers/read-attributes.d.ts +4 -0
- package/dist/helpers/read-attributes.d.ts.map +1 -1
- package/dist/helpers/standardizing.d.ts +10 -0
- package/dist/helpers/standardizing.d.ts.map +1 -1
- package/dist/helpers/strip-attributes.d.ts +2 -0
- package/dist/helpers/strip-attributes.d.ts.map +1 -1
- package/dist/helpers-DVShv41E.js +489 -0
- package/dist/helpers.js +3 -439
- package/dist/in-process-link-DBeAOZRp.js +2791 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -12
- package/dist/perf/create-perf.d.ts +8 -1
- package/dist/perf/create-perf.d.ts.map +1 -1
- package/dist/perf/index.d.ts +1 -1
- package/dist/perf/index.d.ts.map +1 -1
- package/dist/perf/noop-perf.d.ts.map +1 -1
- package/dist/perf/perf.types.d.ts +65 -6
- package/dist/perf/perf.types.d.ts.map +1 -1
- package/dist/project/index.d.ts +7 -5
- package/dist/project/index.d.ts.map +1 -1
- package/dist/project/io/export-blob.d.ts +5 -2
- package/dist/project/io/export-blob.d.ts.map +1 -1
- package/dist/project/io/export-document.d.ts +5 -4
- package/dist/project/io/export-document.d.ts.map +1 -1
- package/dist/project/io/index.d.ts +1 -1
- package/dist/project/io/index.d.ts.map +1 -1
- package/dist/project/io/init-empty-document.d.ts +2 -0
- package/dist/project/io/init-empty-document.d.ts.map +1 -1
- package/dist/project/io/run-export.d.ts +19 -0
- package/dist/project/io/run-export.d.ts.map +1 -0
- package/dist/project/io/run-export.types.d.ts +45 -0
- package/dist/project/io/run-export.types.d.ts.map +1 -0
- package/dist/project/io/run-import.d.ts +15 -0
- package/dist/project/io/run-import.d.ts.map +1 -0
- package/dist/project/io/run-import.types.d.ts +19 -0
- package/dist/project/io/run-import.types.d.ts.map +1 -0
- package/dist/project/io/store-runtime.constants.d.ts +6 -0
- package/dist/project/io/store-runtime.constants.d.ts.map +1 -0
- package/dist/project/io/store-runtime.d.ts +12 -0
- package/dist/project/io/store-runtime.d.ts.map +1 -0
- package/dist/project/io/store-runtime.types.d.ts +18 -0
- package/dist/project/io/store-runtime.types.d.ts.map +1 -0
- package/dist/project/project-channel.d.ts +11 -0
- package/dist/project/project-channel.d.ts.map +1 -0
- package/dist/project/project.constants.d.ts +12 -0
- package/dist/project/project.constants.d.ts.map +1 -0
- package/dist/project/project.d.ts +315 -31
- package/dist/project/project.d.ts.map +1 -1
- package/dist/project/state/document-lifecycle.d.ts +0 -12
- package/dist/project/state/document-lifecycle.d.ts.map +1 -1
- package/dist/project/state/document-state.d.ts +4 -0
- package/dist/project/state/document-state.d.ts.map +1 -1
- package/dist/project/types.d.ts +126 -60
- package/dist/project/types.d.ts.map +1 -1
- package/dist/project-key-Ch34EtFa.js +1435 -0
- package/dist/rolldown-runtime-CYdcPHCu.js +12 -0
- package/dist/running-operations-vnijBvn7.js +76 -0
- package/dist/same-json-value-C6kUaoyt.js +1603 -0
- package/dist/sqlite.d.ts +5 -0
- package/dist/sqlite.d.ts.map +1 -0
- package/dist/sqlite.js +2671 -0
- package/dist/sqlite3.wasm +0 -0
- package/dist/store/apply-record-patch.d.ts +13 -0
- package/dist/store/apply-record-patch.d.ts.map +1 -0
- package/dist/store/closing-connections.d.ts +7 -0
- package/dist/store/closing-connections.d.ts.map +1 -0
- package/dist/store/closing-connections.types.d.ts +13 -0
- package/dist/store/closing-connections.types.d.ts.map +1 -0
- package/dist/store/commit-progress.d.ts +10 -0
- package/dist/store/commit-progress.d.ts.map +1 -0
- package/dist/store/compare-by-id.d.ts +10 -0
- package/dist/store/compare-by-id.d.ts.map +1 -0
- package/dist/store/document-path.constants.d.ts +20 -0
- package/dist/store/document-path.constants.d.ts.map +1 -0
- package/dist/store/document-path.d.ts +75 -0
- package/dist/store/document-path.d.ts.map +1 -0
- package/dist/store/document-path.types.d.ts +11 -0
- package/dist/store/document-path.types.d.ts.map +1 -0
- package/dist/store/engine/client/check-engine-wire.d.ts +8 -0
- package/dist/store/engine/client/check-engine-wire.d.ts.map +1 -0
- package/dist/store/engine/client/client.constants.d.ts +30 -0
- package/dist/store/engine/client/client.constants.d.ts.map +1 -0
- package/dist/store/engine/client/client.types.d.ts +200 -0
- package/dist/store/engine/client/client.types.d.ts.map +1 -0
- package/dist/store/engine/client/engine-client.d.ts +15 -0
- package/dist/store/engine/client/engine-client.d.ts.map +1 -0
- package/dist/store/engine/client/engine-control.d.ts +16 -0
- package/dist/store/engine/client/engine-control.d.ts.map +1 -0
- package/dist/store/engine/client/heartbeat-watch.d.ts +17 -0
- package/dist/store/engine/client/heartbeat-watch.d.ts.map +1 -0
- package/dist/store/engine/client/hub-connector.d.ts +11 -0
- package/dist/store/engine/client/hub-connector.d.ts.map +1 -0
- package/dist/store/engine/client/hub-connector.types.d.ts +25 -0
- package/dist/store/engine/client/hub-connector.types.d.ts.map +1 -0
- package/dist/store/engine/client/worker-connector.d.ts +32 -0
- package/dist/store/engine/client/worker-connector.d.ts.map +1 -0
- package/dist/store/engine/creation-refusal.d.ts +10 -0
- package/dist/store/engine/creation-refusal.d.ts.map +1 -0
- package/dist/store/engine/dialecte-refusal.d.ts +18 -0
- package/dist/store/engine/dialecte-refusal.d.ts.map +1 -0
- package/dist/store/engine/engine-store.d.ts +163 -0
- package/dist/store/engine/engine-store.d.ts.map +1 -0
- package/dist/store/engine/engine-store.types.d.ts +53 -0
- package/dist/store/engine/engine-store.types.d.ts.map +1 -0
- package/dist/store/engine/engine.constants.d.ts +14 -0
- package/dist/store/engine/engine.constants.d.ts.map +1 -0
- package/dist/store/engine/engine.types.d.ts +165 -0
- package/dist/store/engine/engine.types.d.ts.map +1 -0
- package/dist/store/engine/host/engine-wire.d.ts +19 -0
- package/dist/store/engine/host/engine-wire.d.ts.map +1 -0
- package/dist/store/engine/host/heartbeat.d.ts +33 -0
- package/dist/store/engine/host/heartbeat.d.ts.map +1 -0
- package/dist/store/engine/host/host.constants.d.ts +13 -0
- package/dist/store/engine/host/host.constants.d.ts.map +1 -0
- package/dist/store/engine/host/host.types.d.ts +65 -0
- package/dist/store/engine/host/host.types.d.ts.map +1 -0
- package/dist/store/engine/host/store-events.d.ts +14 -0
- package/dist/store/engine/host/store-events.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.constants.d.ts +27 -0
- package/dist/store/engine/hub/hub-client.constants.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.d.ts +46 -0
- package/dist/store/engine/hub/hub-client.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-client.types.d.ts +208 -0
- package/dist/store/engine/hub/hub-client.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-protocol.types.d.ts +193 -0
- package/dist/store/engine/hub/hub-protocol.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-router.d.ts +9 -0
- package/dist/store/engine/hub/hub-router.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-shell.d.ts +13 -0
- package/dist/store/engine/hub/hub-shell.d.ts.map +1 -0
- package/dist/store/engine/hub/hub-shell.types.d.ts +64 -0
- package/dist/store/engine/hub/hub-shell.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.constants.d.ts +33 -0
- package/dist/store/engine/hub/hub.constants.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.types.d.ts +305 -0
- package/dist/store/engine/hub/hub.types.d.ts.map +1 -0
- package/dist/store/engine/hub/hub.worker.d.ts +2 -0
- package/dist/store/engine/hub/hub.worker.d.ts.map +1 -0
- package/dist/store/engine/hub/realm-host.d.ts +10 -0
- package/dist/store/engine/hub/realm-host.d.ts.map +1 -0
- package/dist/store/engine/hub/realm-host.types.d.ts +78 -0
- package/dist/store/engine/hub/realm-host.types.d.ts.map +1 -0
- package/dist/store/engine/project-key.d.ts +15 -0
- package/dist/store/engine/project-key.d.ts.map +1 -0
- package/dist/store/engine/wire/error-envelope.d.ts +25 -0
- package/dist/store/engine/wire/error-envelope.d.ts.map +1 -0
- package/dist/store/engine/wire/wire-values.d.ts +33 -0
- package/dist/store/engine/wire/wire-values.d.ts.map +1 -0
- package/dist/store/engine/wire/wire.constants.d.ts +116 -0
- package/dist/store/engine/wire/wire.constants.d.ts.map +1 -0
- package/dist/store/engine/wire/wire.types.d.ts +119 -0
- package/dist/store/engine/wire/wire.types.d.ts.map +1 -0
- package/dist/store/hub-public.d.ts +33 -0
- package/dist/store/hub-public.d.ts.map +1 -0
- package/dist/store/ignore-destroy-outcome.d.ts +6 -0
- package/dist/store/ignore-destroy-outcome.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-state.d.ts +46 -0
- package/dist/store/in-memory/in-memory-state.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-store.constants.d.ts +7 -0
- package/dist/store/in-memory/in-memory-store.constants.d.ts.map +1 -0
- package/dist/store/in-memory/in-memory-store.d.ts +105 -17
- package/dist/store/in-memory/in-memory-store.d.ts.map +1 -1
- package/dist/store/in-memory/types.d.ts +55 -1
- package/dist/store/in-memory/types.d.ts.map +1 -1
- package/dist/store/index.d.ts +8 -2
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/json-values.constants.d.ts +18 -0
- package/dist/store/json-values.constants.d.ts.map +1 -0
- package/dist/store/json-values.d.ts +40 -0
- package/dist/store/json-values.d.ts.map +1 -0
- package/dist/store/json-values.types.d.ts +18 -0
- package/dist/store/json-values.types.d.ts.map +1 -0
- package/dist/store/local/dexie-store.constants.d.ts +20 -0
- package/dist/store/local/dexie-store.constants.d.ts.map +1 -0
- package/dist/store/local/dexie-store.d.ts +134 -5
- package/dist/store/local/dexie-store.d.ts.map +1 -1
- package/dist/store/local/types.d.ts +6 -0
- package/dist/store/local/types.d.ts.map +1 -1
- package/dist/store/lost-write.d.ts +32 -0
- package/dist/store/lost-write.d.ts.map +1 -0
- package/dist/store/lost-write.types.d.ts +4 -0
- package/dist/store/lost-write.types.d.ts.map +1 -0
- package/dist/store/open-connections.d.ts +4 -0
- package/dist/store/open-connections.d.ts.map +1 -0
- package/dist/store/open-connections.types.d.ts +17 -0
- package/dist/store/open-connections.types.d.ts.map +1 -0
- package/dist/store/own-import.d.ts +10 -0
- package/dist/store/own-import.d.ts.map +1 -0
- package/dist/store/project-name.d.ts +10 -0
- package/dist/store/project-name.d.ts.map +1 -0
- package/dist/store/resolve-store.d.ts +28 -4
- package/dist/store/resolve-store.d.ts.map +1 -1
- package/dist/store/running-operations.d.ts +7 -0
- package/dist/store/running-operations.d.ts.map +1 -0
- package/dist/store/running-operations.types.d.ts +10 -0
- package/dist/store/running-operations.types.d.ts.map +1 -0
- package/dist/store/same-json-value.d.ts +9 -0
- package/dist/store/same-json-value.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/in-process-link.d.ts +20 -0
- package/dist/store/sqlite/adapter/in-process-link.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/in-process-link.types.d.ts +21 -0
- package/dist/store/sqlite/adapter/in-process-link.types.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/realm-storage.d.ts +10 -0
- package/dist/store/sqlite/adapter/realm-storage.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-connector.d.ts +14 -0
- package/dist/store/sqlite/adapter/sqlite-connector.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-engine-settings.d.ts +4 -0
- package/dist/store/sqlite/adapter/sqlite-engine-settings.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts +8 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts +5 -0
- package/dist/store/sqlite/adapter/sqlite-hub-spawner.types.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts +8 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.d.ts.map +1 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts +5 -0
- package/dist/store/sqlite/adapter/sqlite-worker-connector.types.d.ts.map +1 -0
- package/dist/store/sqlite/engine/blobs.d.ts +55 -0
- package/dist/store/sqlite/engine/blobs.d.ts.map +1 -0
- package/dist/store/sqlite/engine/bulk-insert.d.ts +31 -0
- package/dist/store/sqlite/engine/bulk-insert.d.ts.map +1 -0
- package/dist/store/sqlite/engine/commit.d.ts +20 -0
- package/dist/store/sqlite/engine/commit.d.ts.map +1 -0
- package/dist/store/sqlite/engine/device-cache.d.ts +13 -0
- package/dist/store/sqlite/engine/device-cache.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine-errors.d.ts +26 -0
- package/dist/store/sqlite/engine/engine-errors.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine.constants.d.ts +144 -0
- package/dist/store/sqlite/engine/engine.constants.d.ts.map +1 -0
- package/dist/store/sqlite/engine/engine.types.d.ts +361 -0
- package/dist/store/sqlite/engine/engine.types.d.ts.map +1 -0
- package/dist/store/sqlite/engine/history.d.ts +114 -0
- package/dist/store/sqlite/engine/history.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-queue.d.ts +7 -0
- package/dist/store/sqlite/engine/import-queue.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-target.d.ts +23 -0
- package/dist/store/sqlite/engine/import-target.d.ts.map +1 -0
- package/dist/store/sqlite/engine/import-window.d.ts +23 -0
- package/dist/store/sqlite/engine/import-window.d.ts.map +1 -0
- package/dist/store/sqlite/engine/reclaim.d.ts +13 -0
- package/dist/store/sqlite/engine/reclaim.d.ts.map +1 -0
- package/dist/store/sqlite/engine/records.d.ts +117 -0
- package/dist/store/sqlite/engine/records.d.ts.map +1 -0
- package/dist/store/sqlite/engine/registry.d.ts +76 -0
- package/dist/store/sqlite/engine/registry.d.ts.map +1 -0
- package/dist/store/sqlite/engine/schema.d.ts +57 -0
- package/dist/store/sqlite/engine/schema.d.ts.map +1 -0
- package/dist/store/sqlite/engine/sqlite-engine.d.ts +14 -0
- package/dist/store/sqlite/engine/sqlite-engine.d.ts.map +1 -0
- package/dist/store/sqlite/engine/transaction.d.ts +12 -0
- package/dist/store/sqlite/engine/transaction.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.constants.d.ts +12 -0
- package/dist/store/sqlite/list-projects.constants.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.d.ts +22 -0
- package/dist/store/sqlite/list-projects.d.ts.map +1 -0
- package/dist/store/sqlite/list-projects.types.d.ts +28 -0
- package/dist/store/sqlite/list-projects.types.d.ts.map +1 -0
- package/dist/store/sqlite/load-sqlite.d.ts +11 -0
- package/dist/store/sqlite/load-sqlite.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/close-engine.d.ts +18 -0
- package/dist/store/sqlite/runtime/close-engine.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/install-pool.d.ts +94 -0
- package/dist/store/sqlite/runtime/install-pool.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/pool-header.d.ts +13 -0
- package/dist/store/sqlite/runtime/pool-header.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/progress-beat.d.ts +13 -0
- package/dist/store/sqlite/runtime/progress-beat.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/runtime.constants.d.ts +57 -0
- package/dist/store/sqlite/runtime/runtime.constants.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/runtime.types.d.ts +56 -0
- package/dist/store/sqlite/runtime/runtime.types.d.ts.map +1 -0
- package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts +16 -0
- package/dist/store/sqlite/runtime/serve-dialecte-engine.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-store-of.d.ts +7 -0
- package/dist/store/sqlite/sqlite-store-of.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-text.d.ts +20 -0
- package/dist/store/sqlite/sqlite-text.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite-wasm-url.d.ts +9 -0
- package/dist/store/sqlite/sqlite-wasm-url.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite.constants.d.ts +15 -0
- package/dist/store/sqlite/sqlite.constants.d.ts.map +1 -0
- package/dist/store/sqlite/sqlite.types.d.ts +36 -0
- package/dist/store/sqlite/sqlite.types.d.ts.map +1 -0
- package/dist/store/sqlite-storage.constants.d.ts +14 -0
- package/dist/store/sqlite-storage.constants.d.ts.map +1 -0
- package/dist/store/sqlite-storage.d.ts +22 -0
- package/dist/store/sqlite-storage.d.ts.map +1 -0
- package/dist/store/sqlite-storage.types.d.ts +24 -0
- package/dist/store/sqlite-storage.types.d.ts.map +1 -0
- package/dist/store/store-errors.d.ts +51 -0
- package/dist/store/store-errors.d.ts.map +1 -0
- package/dist/store/store.constants.d.ts +15 -3
- package/dist/store/store.constants.d.ts.map +1 -1
- package/dist/store/store.types.d.ts +280 -16
- package/dist/store/store.types.d.ts.map +1 -1
- package/dist/store/stored-record.d.ts +16 -0
- package/dist/store/stored-record.d.ts.map +1 -0
- package/dist/store/unfinished-imports.d.ts +15 -0
- package/dist/store/unfinished-imports.d.ts.map +1 -0
- package/dist/store/write-outcome.d.ts +34 -0
- package/dist/store/write-outcome.d.ts.map +1 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.constants.d.ts +7 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.constants.d.ts.map +1 -0
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts +19 -18
- package/dist/test/assert-valid-xml/assert-valid-xml.d.ts.map +1 -1
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts +8 -4
- package/dist/test/assert-valid-xml/assert-valid-xml.types.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.constants.d.ts +25 -0
- package/dist/test/assert-xml/assert-xml.constants.d.ts.map +1 -0
- package/dist/test/assert-xml/assert-xml.d.ts +23 -34
- package/dist/test/assert-xml/assert-xml.d.ts.map +1 -1
- package/dist/test/assert-xml/assert-xml.types.d.ts +48 -0
- package/dist/test/assert-xml/assert-xml.types.d.ts.map +1 -0
- package/dist/test/assert-xml/describe-nearby.d.ts +16 -0
- package/dist/test/assert-xml/describe-nearby.d.ts.map +1 -0
- package/dist/test/assert-xml/describe-node-place.d.ts +15 -0
- package/dist/test/assert-xml/describe-node-place.d.ts.map +1 -0
- package/dist/test/assert-xml/index.d.ts +1 -1
- package/dist/test/assert-xml/index.d.ts.map +1 -1
- package/dist/test/assert-xml/query-failure-message.d.ts +24 -0
- package/dist/test/assert-xml/query-failure-message.d.ts.map +1 -0
- package/dist/test/assert-xml/read-xpath-step.d.ts +8 -0
- package/dist/test/assert-xml/read-xpath-step.d.ts.map +1 -0
- package/dist/test/assert-xml/xpath-parser.d.ts +2 -1
- package/dist/test/assert-xml/xpath-parser.d.ts.map +1 -1
- package/dist/test/config.d.ts +5 -0
- package/dist/test/config.d.ts.map +1 -1
- package/dist/test/constant.d.ts +2 -0
- package/dist/test/constant.d.ts.map +1 -1
- package/dist/test/create-test-dialecte.d.ts +32 -37
- package/dist/test/create-test-dialecte.d.ts.map +1 -1
- package/dist/test/create-test-dialecte.types.d.ts +99 -0
- package/dist/test/create-test-dialecte.types.d.ts.map +1 -0
- package/dist/test/create-test-helpers-internal.types.d.ts +19 -0
- package/dist/test/create-test-helpers-internal.types.d.ts.map +1 -0
- package/dist/test/create-test-helpers.d.ts +13 -0
- package/dist/test/create-test-helpers.d.ts.map +1 -0
- package/dist/test/create-test-helpers.types.d.ts +50 -0
- package/dist/test/create-test-helpers.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-constraint.d.ts +3 -0
- package/dist/test/fixtures/test-entry-scan-constraint.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-edges.types.d.ts +10 -0
- package/dist/test/fixtures/test-entry-scan-edges.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-recursive.d.ts +4 -0
- package/dist/test/fixtures/test-entry-scan-recursive.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-recursive.types.d.ts +15 -0
- package/dist/test/fixtures/test-entry-scan-recursive.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-shapes.d.ts +14 -0
- package/dist/test/fixtures/test-entry-scan-shapes.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-shapes.types.d.ts +14 -0
- package/dist/test/fixtures/test-entry-scan-shapes.types.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan-tree.d.ts +3 -0
- package/dist/test/fixtures/test-entry-scan-tree.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan.d.ts +5 -0
- package/dist/test/fixtures/test-entry-scan.d.ts.map +1 -0
- package/dist/test/fixtures/test-entry-scan.types.d.ts +5 -0
- package/dist/test/fixtures/test-entry-scan.types.d.ts.map +1 -0
- package/dist/test/generated/definition.generated.d.ts +5 -0
- package/dist/test/generated/definition.generated.d.ts.map +1 -1
- package/dist/test/in-memory-storage.setup.d.ts +2 -0
- package/dist/test/in-memory-storage.setup.d.ts.map +1 -0
- package/dist/test/index.d.ts +6 -0
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/normalize-uuids.constants.d.ts +3 -0
- package/dist/test/normalize-uuids.constants.d.ts.map +1 -0
- package/dist/test/normalize-uuids.d.ts +12 -0
- package/dist/test/normalize-uuids.d.ts.map +1 -1
- package/dist/test/run-test-cases.d.ts +30 -11
- package/dist/test/run-test-cases.d.ts.map +1 -1
- package/dist/test/run-test-cases.type.d.ts +16 -0
- package/dist/test/run-test-cases.type.d.ts.map +1 -1
- package/dist/test/sqlite-storage.setup.d.ts +1 -0
- package/dist/test/sqlite-storage.setup.d.ts.map +1 -0
- package/dist/test/test-dialecte-setup.d.ts +31 -0
- package/dist/test/test-dialecte-setup.d.ts.map +1 -0
- package/dist/test/test-dialecte-setup.types.d.ts +29 -0
- package/dist/test/test-dialecte-setup.types.d.ts.map +1 -0
- package/dist/test/test-dialecte.d.ts +2722 -0
- package/dist/test/test-dialecte.d.ts.map +1 -0
- package/dist/test/test-dialecte.types.d.ts +3 -0
- package/dist/test/test-dialecte.types.d.ts.map +1 -0
- package/dist/test/test-dialecte.worker.d.ts +2 -0
- package/dist/test/test-dialecte.worker.d.ts.map +1 -0
- package/dist/test/test-entry-environment.constants.d.ts +27 -0
- package/dist/test/test-entry-environment.constants.d.ts.map +1 -0
- package/dist/test/test-record.d.ts +49 -1
- package/dist/test/test-record.d.ts.map +1 -1
- package/dist/test/test-storage/index.d.ts +5 -0
- package/dist/test/test-storage/index.d.ts.map +1 -0
- package/dist/test/test-storage/read-test-storage.d.ts +4 -0
- package/dist/test/test-storage/read-test-storage.d.ts.map +1 -0
- package/dist/test/test-storage/resolve-test-storage.d.ts +9 -0
- package/dist/test/test-storage/resolve-test-storage.d.ts.map +1 -0
- package/dist/test/test-storage/test-storage.constants.d.ts +9 -0
- package/dist/test/test-storage/test-storage.constants.d.ts.map +1 -0
- package/dist/test/test-storage/test-storage.types.d.ts +15 -0
- package/dist/test/test-storage/test-storage.types.d.ts.map +1 -0
- package/dist/test/test-storage/test-store-for.d.ts +19 -0
- package/dist/test/test-storage/test-store-for.d.ts.map +1 -0
- package/dist/test/test-storage/use-test-storage.d.ts +14 -0
- package/dist/test/test-storage/use-test-storage.d.ts.map +1 -0
- package/dist/test/test-timing.constants.d.ts +15 -0
- package/dist/test/test-timing.constants.d.ts.map +1 -0
- package/dist/test/xml/engine-console.d.ts +6 -0
- package/dist/test/xml/engine-console.d.ts.map +1 -0
- package/dist/test/xml/engine.d.ts +3 -0
- package/dist/test/xml/engine.d.ts.map +1 -0
- package/dist/test/xml/index.d.ts +8 -0
- package/dist/test/xml/index.d.ts.map +1 -0
- package/dist/test/xml/malformed-xml-error.d.ts +5 -0
- package/dist/test/xml/malformed-xml-error.d.ts.map +1 -0
- package/dist/test/xml/print-node.d.ts +7 -0
- package/dist/test/xml/print-node.d.ts.map +1 -0
- package/dist/test/xml/select-nodes.d.ts +14 -0
- package/dist/test/xml/select-nodes.d.ts.map +1 -0
- package/dist/test/xml/with-xml-document.constants.d.ts +7 -0
- package/dist/test/xml/with-xml-document.constants.d.ts.map +1 -0
- package/dist/test/xml/with-xml-document.d.ts +14 -0
- package/dist/test/xml/with-xml-document.d.ts.map +1 -0
- package/dist/test/xml/xml-query-refused-error.d.ts +13 -0
- package/dist/test/xml/xml-query-refused-error.d.ts.map +1 -0
- package/dist/test/xml/xml.constants.d.ts +16 -0
- package/dist/test/xml/xml.constants.d.ts.map +1 -0
- package/dist/test/xml/xml.types.d.ts +31 -0
- package/dist/test/xml/xml.types.d.ts.map +1 -0
- package/dist/test/xsd/test-ext.xsd +226 -0
- package/dist/test/xsd/test.xsd +528 -0
- package/dist/test.js +3427 -406
- package/dist/types/dialecte-config.d.ts +6 -0
- package/dist/types/dialecte-config.d.ts.map +1 -1
- package/dist/types/io.d.ts +5 -0
- package/dist/types/io.d.ts.map +1 -1
- package/dist/utils/attribute-rules.d.ts +16 -1
- package/dist/utils/attribute-rules.d.ts.map +1 -1
- package/dist/utils/child-occurrences.constants.d.ts +4 -0
- package/dist/utils/child-occurrences.constants.d.ts.map +1 -0
- package/dist/utils/child-occurrences.d.ts +17 -0
- package/dist/utils/child-occurrences.d.ts.map +1 -0
- package/dist/utils/child-occurrences.types.d.ts +6 -0
- package/dist/utils/child-occurrences.types.d.ts.map +1 -0
- package/dist/utils/datatype.d.ts +4 -0
- package/dist/utils/datatype.d.ts.map +1 -1
- package/dist/utils/format-xml.d.ts +4 -0
- package/dist/utils/format-xml.d.ts.map +1 -1
- package/dist/utils/index.d.ts +5 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/invariant.d.ts +2 -0
- package/dist/utils/invariant.d.ts.map +1 -1
- package/dist/utils/namespaces.d.ts +15 -1
- package/dist/utils/namespaces.d.ts.map +1 -1
- package/dist/utils/order-children.d.ts +14 -3
- package/dist/utils/order-children.d.ts.map +1 -1
- package/dist/utils/order-children.types.d.ts +10 -0
- package/dist/utils/order-children.types.d.ts.map +1 -0
- package/dist/utils/particle-occurrences.d.ts +4 -0
- package/dist/utils/particle-occurrences.d.ts.map +1 -0
- package/dist/utils/required-choices.d.ts +17 -0
- package/dist/utils/required-choices.d.ts.map +1 -0
- package/dist/utils/required-choices.types.d.ts +15 -0
- package/dist/utils/required-choices.types.d.ts.map +1 -0
- package/dist/utils/resolve-definition.d.ts +4 -0
- package/dist/utils/resolve-definition.d.ts.map +1 -1
- package/dist/utils/save-to-disk.constants.d.ts +3 -0
- package/dist/utils/save-to-disk.constants.d.ts.map +1 -0
- package/dist/utils/save-to-disk.d.ts +17 -5
- package/dist/utils/save-to-disk.d.ts.map +1 -1
- package/dist/utils/save-to-disk.types.d.ts +17 -0
- package/dist/utils/save-to-disk.types.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.constants.d.ts +5 -0
- package/dist/utils/seeded-uuid.constants.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.d.ts +15 -0
- package/dist/utils/seeded-uuid.d.ts.map +1 -0
- package/dist/utils/seeded-uuid.types.d.ts +8 -0
- package/dist/utils/seeded-uuid.types.d.ts.map +1 -0
- package/dist/utils/tell-listener.constants.d.ts +9 -0
- package/dist/utils/tell-listener.constants.d.ts.map +1 -0
- package/dist/utils/tell-listener.d.ts +24 -0
- package/dist/utils/tell-listener.d.ts.map +1 -0
- package/dist/utils/xml-characters.constants.d.ts +9 -0
- package/dist/utils/xml-characters.constants.d.ts.map +1 -0
- package/dist/utils/xml-characters.d.ts +8 -0
- package/dist/utils/xml-characters.d.ts.map +1 -0
- package/dist/utils/xml-whitespace.constants.d.ts +8 -0
- package/dist/utils/xml-whitespace.constants.d.ts.map +1 -0
- package/dist/utils/xml-whitespace.d.ts +19 -0
- package/dist/utils/xml-whitespace.d.ts.map +1 -0
- package/dist/utils/xsi-type.d.ts +4 -0
- package/dist/utils/xsi-type.d.ts.map +1 -1
- package/dist/utils/yield-to-queue.d.ts +6 -0
- package/dist/utils/yield-to-queue.d.ts.map +1 -0
- package/dist/utils-USNkj4sT.js +1275 -0
- package/dist/utils.js +1 -2
- package/dist/xml/build/document-root.d.ts +7 -0
- package/dist/xml/build/document-root.d.ts.map +1 -0
- package/dist/xml/build/index.d.ts +0 -5
- package/dist/xml/build/index.d.ts.map +1 -1
- package/dist/xml/build/record-element.d.ts +15 -0
- package/dist/xml/build/record-element.d.ts.map +1 -0
- package/dist/xml/build/record-element.types.d.ts +12 -0
- package/dist/xml/build/record-element.types.d.ts.map +1 -0
- package/dist/xml/build/write-xml-records.d.ts +7 -0
- package/dist/xml/build/write-xml-records.d.ts.map +1 -0
- package/dist/xml/build/write-xml-records.types.d.ts +11 -0
- package/dist/xml/build/write-xml-records.types.d.ts.map +1 -0
- package/dist/xml/build/xml-element.d.ts +79 -0
- package/dist/xml/build/xml-element.d.ts.map +1 -0
- package/dist/xml/build/xml-element.types.d.ts +34 -0
- package/dist/xml/build/xml-element.types.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.constants.d.ts +24 -0
- package/dist/xml/build/xml-writer.constants.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.d.ts +40 -0
- package/dist/xml/build/xml-writer.d.ts.map +1 -0
- package/dist/xml/build/xml-writer.types.d.ts +34 -0
- package/dist/xml/build/xml-writer.types.d.ts.map +1 -0
- package/dist/xml/dom/index.d.ts +3 -0
- package/dist/xml/dom/index.d.ts.map +1 -0
- package/dist/xml/dom/xml-document-from-file.d.ts +10 -0
- package/dist/xml/dom/xml-document-from-file.d.ts.map +1 -0
- package/dist/xml/dom/xml-document-from-file.types.d.ts +5 -0
- package/dist/xml/dom/xml-document-from-file.types.d.ts.map +1 -0
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.d.ts.map +1 -1
- package/dist/xml/inspect-xml.d.ts +2 -0
- package/dist/xml/inspect-xml.d.ts.map +1 -1
- package/dist/xml/parse/index.d.ts +1 -1
- package/dist/xml/parse/index.d.ts.map +1 -1
- package/dist/xml/parse/parse-xml-document.constants.d.ts +5 -0
- package/dist/xml/parse/parse-xml-document.constants.d.ts.map +1 -0
- package/dist/xml/parse/parse-xml-document.d.ts +13 -2
- package/dist/xml/parse/parse-xml-document.d.ts.map +1 -1
- package/dist/xml/parse/parse-xml-document.types.d.ts +7 -2
- package/dist/xml/parse/parse-xml-document.types.d.ts.map +1 -1
- package/dist/xml/parse/parser.constants.d.ts +7 -0
- package/dist/xml/parse/parser.constants.d.ts.map +1 -0
- package/dist/xml/parse/parser.d.ts.map +1 -1
- package/package.json +88 -8
- package/skills/dialecte/SKILL.md +276 -0
- package/skills/dialecte/references/api.json +1830 -0
- package/skills/dialecte/references/api.md +557 -0
- package/skills/dialecte/references/core-api.md +204 -0
- package/skills/dialecte/references/testing.md +116 -0
- package/skills/dialecte-contributing/SKILL.md +328 -0
- package/skills/dialecte-contributing/references/code-rules.md +108 -0
- package/skills/dialecte-contributing/references/landing-changes.md +83 -0
- package/skills/dialecte-contributing/references/perf.md +39 -0
- package/skills/dialecte-contributing/references/traps.md +89 -0
- package/skills/dialecte-lot/SKILL.md +471 -0
- package/skills/dialecte-lot/references/briefs.md +152 -0
- package/skills/dialecte-lot/references/model-tiers.md +52 -0
- package/skills/dialecte-lot/references/retro.md +51 -0
- package/dist/project/io/import-document.d.ts +0 -7
- package/dist/project/io/import-document.d.ts.map +0 -1
- package/dist/test/assert-xml/types.d.ts +0 -2
- package/dist/test/assert-xml/types.d.ts.map +0 -1
- package/dist/utils-DJN0Md0v.js +0 -624
- package/dist/xml/build/build-xml-document.d.ts +0 -10
- package/dist/xml/build/build-xml-document.d.ts.map +0 -1
- package/dist/xml/build/build-xml-document.types.d.ts +0 -22
- package/dist/xml/build/build-xml-document.types.d.ts.map +0 -1
- package/dist/xml/build/download-file.d.ts +0 -7
- package/dist/xml/build/download-file.d.ts.map +0 -1
- package/dist/xml/build/formatter.d.ts +0 -2
- package/dist/xml/build/formatter.d.ts.map +0 -1
- package/dist/xml/build/serialize.d.ts +0 -11
- package/dist/xml/build/serialize.d.ts.map +0 -1
- package/dist/xml/build/serialize.types.d.ts +0 -12
- package/dist/xml/build/serialize.types.d.ts.map +0 -1
|
@@ -0,0 +1,1603 @@
|
|
|
1
|
+
import { n as e, t } from "./rolldown-runtime-CYdcPHCu.js";
|
|
2
|
+
import { G as n, V as r, W as i, f as a, j as o, k as s, z as c } from "./utils-USNkj4sT.js";
|
|
3
|
+
import { D as l, N as u, O as d, _ as f, c as p, g as m, h, l as g, m as _, s as v, u as y, w as b, x, y as S } from "./project-key-Ch34EtFa.js";
|
|
4
|
+
import { l as C } from "./helpers-DVShv41E.js";
|
|
5
|
+
// src/store/write-outcome.ts
|
|
6
|
+
function w(e) {
|
|
7
|
+
let { documents: t, writeId: n, isRunning: r } = e, i = t.find((e) => e.writeId === n);
|
|
8
|
+
return i ? i.status === "importing" ? r?.({ writeId: n }) === !1 ? "not-applied" : "running" : "applied" : "not-applied";
|
|
9
|
+
}
|
|
10
|
+
function T(e) {
|
|
11
|
+
let { documents: t, writeId: n, committed: r, isRunning: i } = e, a = w({
|
|
12
|
+
documents: t,
|
|
13
|
+
writeId: n,
|
|
14
|
+
isRunning: i
|
|
15
|
+
});
|
|
16
|
+
return a === "not-applied" ? r ? "applied" : "not-applied" : a;
|
|
17
|
+
}
|
|
18
|
+
// src/store/document-path.constants.ts
|
|
19
|
+
var E = "/", D = 255, O = 1024, k = /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u, A = [
|
|
20
|
+
"name",
|
|
21
|
+
"path",
|
|
22
|
+
"metadata"
|
|
23
|
+
], j = ".xml";
|
|
24
|
+
// src/store/document-path.ts
|
|
25
|
+
function M(e) {
|
|
26
|
+
let { path: t } = e, n = B({ path: t });
|
|
27
|
+
n !== void 0 && l({
|
|
28
|
+
path: t,
|
|
29
|
+
reason: n
|
|
30
|
+
});
|
|
31
|
+
let r = t.split("/");
|
|
32
|
+
return {
|
|
33
|
+
folders: r,
|
|
34
|
+
fileName: r.pop()
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function N(e) {
|
|
38
|
+
let { extensions: t } = e;
|
|
39
|
+
return t.includes(".xml") ? t : [...t, j];
|
|
40
|
+
}
|
|
41
|
+
function P(e) {
|
|
42
|
+
let { path: t, extensions: n } = e, { fileName: r } = M({ path: t }), i = r.lastIndexOf(".");
|
|
43
|
+
return (i < 1 || i === r.length - 1) && l({
|
|
44
|
+
path: t,
|
|
45
|
+
reason: "its file name has no extension after a name"
|
|
46
|
+
}), n && !n.some((e) => r.toLowerCase().endsWith(e)) && l({
|
|
47
|
+
path: t,
|
|
48
|
+
reason: `its extension is not one the document's config reads (${n.join(", ")})`
|
|
49
|
+
}), {
|
|
50
|
+
name: r.slice(0, i),
|
|
51
|
+
extension: r.slice(i)
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
function F(e) {
|
|
55
|
+
let { name: t, extension: n, path: r } = e.document;
|
|
56
|
+
if (r === void 0) return;
|
|
57
|
+
let { fileName: i } = M({ path: r });
|
|
58
|
+
(typeof t != "string" || typeof n != "string") && l({
|
|
59
|
+
path: r,
|
|
60
|
+
reason: "a path names a file of a name and an extension that are strings"
|
|
61
|
+
}), (t === "" || i !== `${t}${n}`) && l({
|
|
62
|
+
path: r,
|
|
63
|
+
reason: `it does not end with the document's file name ${JSON.stringify(`${t}${n}`)}`
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function I(e) {
|
|
67
|
+
let { document: t } = e, n = Object.fromEntries(A.filter((t) => e.updates[t] !== void 0).map((t) => [t, e.updates[t]])), r = {
|
|
68
|
+
...t,
|
|
69
|
+
...n
|
|
70
|
+
};
|
|
71
|
+
if (n.path !== void 0) {
|
|
72
|
+
let { fileName: e } = M({ path: n.path }), { extension: i } = t;
|
|
73
|
+
e.endsWith(i) && e.length !== i.length || l({
|
|
74
|
+
path: n.path,
|
|
75
|
+
reason: `it does not end with the document's extension ${JSON.stringify(i)}`
|
|
76
|
+
}), r.name = n.name ?? e.slice(0, e.length - i.length);
|
|
77
|
+
} else if (n.name !== void 0 && t.path !== void 0) {
|
|
78
|
+
let { folders: e } = M({ path: t.path });
|
|
79
|
+
r.path = [...e, `${n.name}${t.extension}`].join("/");
|
|
80
|
+
}
|
|
81
|
+
return (n.path !== void 0 || n.name !== void 0) && F({ document: r }), r;
|
|
82
|
+
}
|
|
83
|
+
function L(e) {
|
|
84
|
+
let { document: t, documents: n } = e;
|
|
85
|
+
F({ document: t });
|
|
86
|
+
let { id: r, path: i } = t;
|
|
87
|
+
if (i === void 0) return;
|
|
88
|
+
let a = R({
|
|
89
|
+
path: i,
|
|
90
|
+
documents: n,
|
|
91
|
+
documentId: r
|
|
92
|
+
});
|
|
93
|
+
a !== void 0 && d({
|
|
94
|
+
documentId: r,
|
|
95
|
+
path: i,
|
|
96
|
+
takenBy: a
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function R(e) {
|
|
100
|
+
let { path: t, documents: n, documentId: r } = e;
|
|
101
|
+
return n.find((e) => e.id !== r && e.path !== void 0 && z({
|
|
102
|
+
path: t,
|
|
103
|
+
other: e.path
|
|
104
|
+
}))?.id;
|
|
105
|
+
}
|
|
106
|
+
function z(e) {
|
|
107
|
+
let { path: t, other: n } = e;
|
|
108
|
+
return t === n || t.startsWith(`${n}/`) || n.startsWith(`${t}/`);
|
|
109
|
+
}
|
|
110
|
+
function B(e) {
|
|
111
|
+
let { path: t } = e;
|
|
112
|
+
if (typeof t != "string") return "it is not a string";
|
|
113
|
+
if (t.includes("\\")) return "it holds a backslash, a folder separator on Windows";
|
|
114
|
+
if (k.test(t)) return "it holds an invisible format, separator or control character (Unicode Cc, Cf, Zl or Zp)";
|
|
115
|
+
if (!t.isWellFormed()) return `it is ${u}`;
|
|
116
|
+
if (t.normalize("NFC") !== t) return "it is not in Unicode NFC";
|
|
117
|
+
let n = t.split("/");
|
|
118
|
+
if (n.some((e) => e === "")) return "it holds an empty folder or file name";
|
|
119
|
+
if (n.some((e) => e === "." || e === "..")) return "it holds a folder or file name \".\" or \"..\"";
|
|
120
|
+
let r = new TextEncoder();
|
|
121
|
+
if (n.some((e) => r.encode(e).length > 255)) return "it holds a folder or file name of more than 255 bytes (UTF-8)";
|
|
122
|
+
if (r.encode(t).length > 1024) return `it is more than ${O} bytes long (UTF-8)`;
|
|
123
|
+
}
|
|
124
|
+
// src/store/stored-record.ts
|
|
125
|
+
function V(e) {
|
|
126
|
+
let { record: t } = e, { id: n, tagName: r, namespace: i, attributes: a, value: o, parent: s, children: c } = t;
|
|
127
|
+
return {
|
|
128
|
+
id: n,
|
|
129
|
+
tagName: r,
|
|
130
|
+
namespace: {
|
|
131
|
+
prefix: i.prefix,
|
|
132
|
+
uri: i.uri
|
|
133
|
+
},
|
|
134
|
+
attributes: a,
|
|
135
|
+
value: o,
|
|
136
|
+
parent: s === null ? null : {
|
|
137
|
+
id: s.id,
|
|
138
|
+
tagName: s.tagName
|
|
139
|
+
},
|
|
140
|
+
children: c
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
function H(e) {
|
|
144
|
+
return b({ value: e.records }).map((e) => V({ record: e }));
|
|
145
|
+
}
|
|
146
|
+
// src/store/apply-record-patch.ts
|
|
147
|
+
function U(e) {
|
|
148
|
+
let { record: t, patch: n } = e, { recordId: r, attributes: i, children: a, removeAttributes: o, ...s } = n, c = { ...t };
|
|
149
|
+
for (let [e, t] of Object.entries(s)) t !== void 0 && Object.assign(c, { [e]: t });
|
|
150
|
+
return i && (c.attributes = W({
|
|
151
|
+
held: t.attributes,
|
|
152
|
+
given: i,
|
|
153
|
+
key: "name"
|
|
154
|
+
})), o?.length && (c.attributes = c.attributes.filter((e) => !o.includes(e.name))), a && (c.children = W({
|
|
155
|
+
held: t.children,
|
|
156
|
+
given: a,
|
|
157
|
+
key: "id"
|
|
158
|
+
})), V({ record: c });
|
|
159
|
+
}
|
|
160
|
+
function W(e) {
|
|
161
|
+
let { held: t, given: n, key: r } = e, i = [...t];
|
|
162
|
+
for (let e of n) {
|
|
163
|
+
let t = i.findIndex((t) => t[r] === e[r]);
|
|
164
|
+
t >= 0 ? i[t] = e : i.push(e);
|
|
165
|
+
}
|
|
166
|
+
return i;
|
|
167
|
+
}
|
|
168
|
+
// src/store/commit-progress.ts
|
|
169
|
+
function G(e) {
|
|
170
|
+
let { onProgress: t, parts: n } = e, r = n.reduce((e, t) => e + t, 0), i = 0, a = {};
|
|
171
|
+
for (let e of n) i += e, S({
|
|
172
|
+
listener: function(e) {
|
|
173
|
+
return t?.(e, r);
|
|
174
|
+
},
|
|
175
|
+
value: i,
|
|
176
|
+
of: f.commitProgress,
|
|
177
|
+
call: a
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
// src/xml/dom/xml-document-from-file.ts
|
|
181
|
+
async function K(e) {
|
|
182
|
+
let { file: t } = e, n = await t.text(), r = new DOMParser().parseFromString(n, "application/xml"), a = r.getElementsByTagName("parsererror")[0];
|
|
183
|
+
return a && i("PARSE_ERROR", { detail: a.textContent?.trim() || "The file is not well-formed XML" }), r;
|
|
184
|
+
}
|
|
185
|
+
// __vite-browser-external
|
|
186
|
+
var ee = /* @__PURE__ */ t(((e, t) => {
|
|
187
|
+
t.exports = {};
|
|
188
|
+
})), q = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t, n) => {
|
|
189
|
+
(function(e) {
|
|
190
|
+
e.parser = function(e, t) {
|
|
191
|
+
return new n(e, t);
|
|
192
|
+
}, e.SAXParser = n, e.SAXStream = u, e.createStream = c, e.MAX_BUFFER_LENGTH = 65536;
|
|
193
|
+
var t = [
|
|
194
|
+
"comment",
|
|
195
|
+
"sgmlDecl",
|
|
196
|
+
"textNode",
|
|
197
|
+
"tagName",
|
|
198
|
+
"doctype",
|
|
199
|
+
"procInstName",
|
|
200
|
+
"procInstBody",
|
|
201
|
+
"entity",
|
|
202
|
+
"attribName",
|
|
203
|
+
"attribValue",
|
|
204
|
+
"cdata",
|
|
205
|
+
"script"
|
|
206
|
+
];
|
|
207
|
+
e.EVENTS = [
|
|
208
|
+
"text",
|
|
209
|
+
"processinginstruction",
|
|
210
|
+
"sgmldeclaration",
|
|
211
|
+
"doctype",
|
|
212
|
+
"comment",
|
|
213
|
+
"opentagstart",
|
|
214
|
+
"attribute",
|
|
215
|
+
"opentag",
|
|
216
|
+
"closetag",
|
|
217
|
+
"opencdata",
|
|
218
|
+
"cdata",
|
|
219
|
+
"closecdata",
|
|
220
|
+
"error",
|
|
221
|
+
"end",
|
|
222
|
+
"ready",
|
|
223
|
+
"script",
|
|
224
|
+
"opennamespace",
|
|
225
|
+
"closenamespace"
|
|
226
|
+
];
|
|
227
|
+
function n(t, r) {
|
|
228
|
+
if (!(this instanceof n)) return new n(t, r);
|
|
229
|
+
var a = this;
|
|
230
|
+
i(a), a.q = a.c = "", a.bufferCheckPosition = e.MAX_BUFFER_LENGTH, a.encoding = null, a.opt = r || {}, a.opt.lowercase = a.opt.lowercase || a.opt.lowercasetags, a.looseCase = a.opt.lowercase ? "toLowerCase" : "toUpperCase", a.opt.maxEntityCount = a.opt.maxEntityCount || 512, a.opt.maxEntityDepth = a.opt.maxEntityDepth || 4, a.entityCount = a.entityDepth = 0, a.tags = [], a.closed = a.closedRoot = a.sawRoot = !1, a.tag = a.error = null, a.strict = !!t, a.noscript = !!(t || a.opt.noscript), a.state = T.BEGIN, a.strictEntities = a.opt.strictEntities, a.ENTITIES = a.strictEntities ? Object.create(e.XML_ENTITIES) : Object.create(e.ENTITIES), a.attribList = [], a.opt.xmlns && (a.ns = Object.create(h)), a.opt.unquotedAttributeValues === void 0 && (a.opt.unquotedAttributeValues = !t), a.trackPosition = a.opt.position !== !1, a.trackPosition && (a.position = a.line = a.column = 0), D(a, "onready");
|
|
231
|
+
}
|
|
232
|
+
Object.create || (Object.create = function(e) {
|
|
233
|
+
function t() {}
|
|
234
|
+
return t.prototype = e, new t();
|
|
235
|
+
}), Object.keys || (Object.keys = function(e) {
|
|
236
|
+
var t = [];
|
|
237
|
+
for (var n in e) e.hasOwnProperty(n) && t.push(n);
|
|
238
|
+
return t;
|
|
239
|
+
});
|
|
240
|
+
function r(n) {
|
|
241
|
+
for (var r = Math.max(e.MAX_BUFFER_LENGTH, 10), i = 0, a = 0, o = t.length; a < o; a++) {
|
|
242
|
+
var s = n[t[a]].length;
|
|
243
|
+
if (s > r) switch (t[a]) {
|
|
244
|
+
case "textNode":
|
|
245
|
+
N(n);
|
|
246
|
+
break;
|
|
247
|
+
case "cdata":
|
|
248
|
+
M(n, "oncdata", n.cdata), n.cdata = "";
|
|
249
|
+
break;
|
|
250
|
+
case "script":
|
|
251
|
+
M(n, "onscript", n.script), n.script = "";
|
|
252
|
+
break;
|
|
253
|
+
default: F(n, "Max buffer length exceeded: " + t[a]);
|
|
254
|
+
}
|
|
255
|
+
i = Math.max(i, s);
|
|
256
|
+
}
|
|
257
|
+
n.bufferCheckPosition = e.MAX_BUFFER_LENGTH - i + n.position;
|
|
258
|
+
}
|
|
259
|
+
function i(e) {
|
|
260
|
+
for (var n = 0, r = t.length; n < r; n++) e[t[n]] = "";
|
|
261
|
+
}
|
|
262
|
+
function a(e) {
|
|
263
|
+
N(e), e.cdata !== "" && (M(e, "oncdata", e.cdata), e.cdata = ""), e.script !== "" && (M(e, "onscript", e.script), e.script = "");
|
|
264
|
+
}
|
|
265
|
+
n.prototype = {
|
|
266
|
+
end: function() {
|
|
267
|
+
I(this);
|
|
268
|
+
},
|
|
269
|
+
write: K,
|
|
270
|
+
resume: function() {
|
|
271
|
+
return this.error = null, this;
|
|
272
|
+
},
|
|
273
|
+
close: function() {
|
|
274
|
+
return this.write(null);
|
|
275
|
+
},
|
|
276
|
+
flush: function() {
|
|
277
|
+
a(this);
|
|
278
|
+
}
|
|
279
|
+
};
|
|
280
|
+
var o;
|
|
281
|
+
try {
|
|
282
|
+
o = ee().Stream;
|
|
283
|
+
} catch {
|
|
284
|
+
o = function() {};
|
|
285
|
+
}
|
|
286
|
+
o ||= function() {};
|
|
287
|
+
var s = e.EVENTS.filter(function(e) {
|
|
288
|
+
return e !== "error" && e !== "end";
|
|
289
|
+
});
|
|
290
|
+
function c(e, t) {
|
|
291
|
+
return new u(e, t);
|
|
292
|
+
}
|
|
293
|
+
function l(e, t) {
|
|
294
|
+
if (e.length >= 2) {
|
|
295
|
+
if (e[0] === 255 && e[1] === 254) return "utf-16le";
|
|
296
|
+
if (e[0] === 254 && e[1] === 255) return "utf-16be";
|
|
297
|
+
}
|
|
298
|
+
return e.length >= 3 && e[0] === 239 && e[1] === 187 && e[2] === 191 ? "utf8" : e.length >= 4 ? e[0] === 60 && e[1] === 0 && e[2] === 63 && e[3] === 0 ? "utf-16le" : e[0] === 0 && e[1] === 60 && e[2] === 0 && e[3] === 63 ? "utf-16be" : "utf8" : t ? "utf8" : null;
|
|
299
|
+
}
|
|
300
|
+
function u(e, t) {
|
|
301
|
+
if (!(this instanceof u)) return new u(e, t);
|
|
302
|
+
o.apply(this), this._parser = new n(e, t), this.writable = !0, this.readable = !0;
|
|
303
|
+
var r = this;
|
|
304
|
+
this._parser.onend = function() {
|
|
305
|
+
r.emit("end");
|
|
306
|
+
}, this._parser.onerror = function(e) {
|
|
307
|
+
r.emit("error", e), r._parser.error = null;
|
|
308
|
+
}, this._decoder = null, this._decoderBuffer = null, s.forEach(function(e) {
|
|
309
|
+
Object.defineProperty(r, "on" + e, {
|
|
310
|
+
get: function() {
|
|
311
|
+
return r._parser["on" + e];
|
|
312
|
+
},
|
|
313
|
+
set: function(t) {
|
|
314
|
+
if (!t) return r.removeAllListeners(e), r._parser["on" + e] = t, t;
|
|
315
|
+
r.on(e, t);
|
|
316
|
+
},
|
|
317
|
+
enumerable: !0,
|
|
318
|
+
configurable: !1
|
|
319
|
+
});
|
|
320
|
+
});
|
|
321
|
+
}
|
|
322
|
+
u.prototype = Object.create(o.prototype, { constructor: { value: u } }), u.prototype._decodeBuffer = function(e, t) {
|
|
323
|
+
if (this._decoderBuffer &&= (e = Buffer.concat([this._decoderBuffer, e]), null), !this._decoder) {
|
|
324
|
+
var n = l(e, t);
|
|
325
|
+
if (!n) return this._decoderBuffer = e, "";
|
|
326
|
+
this._parser.encoding = n, this._decoder = new TextDecoder(n);
|
|
327
|
+
}
|
|
328
|
+
return this._decoder.decode(e, { stream: !t });
|
|
329
|
+
}, u.prototype.write = function(e) {
|
|
330
|
+
if (typeof Buffer == "function" && typeof Buffer.isBuffer == "function" && Buffer.isBuffer(e)) e = this._decodeBuffer(e, !1);
|
|
331
|
+
else if (this._decoderBuffer) {
|
|
332
|
+
var t = this._decodeBuffer(Buffer.alloc(0), !0);
|
|
333
|
+
t && (this._parser.write(t), this.emit("data", t));
|
|
334
|
+
}
|
|
335
|
+
return this._parser.write(e.toString()), this.emit("data", e), !0;
|
|
336
|
+
}, u.prototype.end = function(e) {
|
|
337
|
+
if (e && e.length && this.write(e), this._decoderBuffer) {
|
|
338
|
+
var t = this._decodeBuffer(Buffer.alloc(0), !0);
|
|
339
|
+
t && (this._parser.write(t), this.emit("data", t));
|
|
340
|
+
} else if (this._decoder) {
|
|
341
|
+
var n = this._decoder.decode();
|
|
342
|
+
n && (this._parser.write(n), this.emit("data", n));
|
|
343
|
+
}
|
|
344
|
+
return this._parser.end(), !0;
|
|
345
|
+
}, u.prototype.on = function(e, t) {
|
|
346
|
+
var n = this;
|
|
347
|
+
return !n._parser["on" + e] && s.indexOf(e) !== -1 && (n._parser["on" + e] = function() {
|
|
348
|
+
var t = arguments.length === 1 ? [arguments[0]] : Array.apply(null, arguments);
|
|
349
|
+
t.splice(0, 0, e), n.emit.apply(n, t);
|
|
350
|
+
}), o.prototype.on.call(n, e, t);
|
|
351
|
+
};
|
|
352
|
+
var d = "[CDATA[", f = "DOCTYPE", p = "http://www.w3.org/XML/1998/namespace", m = "http://www.w3.org/2000/xmlns/", h = {
|
|
353
|
+
xml: p,
|
|
354
|
+
xmlns: m
|
|
355
|
+
}, g = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, _ = /[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/, v = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/, y = /[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;
|
|
356
|
+
function b(e) {
|
|
357
|
+
return e === " " || e === "\n" || e === "\r" || e === " ";
|
|
358
|
+
}
|
|
359
|
+
function x(e) {
|
|
360
|
+
return e === "\"" || e === "'";
|
|
361
|
+
}
|
|
362
|
+
function S(e) {
|
|
363
|
+
return e === ">" || b(e);
|
|
364
|
+
}
|
|
365
|
+
function C(e, t) {
|
|
366
|
+
return e.test(t);
|
|
367
|
+
}
|
|
368
|
+
function w(e, t) {
|
|
369
|
+
return !C(e, t);
|
|
370
|
+
}
|
|
371
|
+
var T = 0;
|
|
372
|
+
for (var E in e.STATE = {
|
|
373
|
+
BEGIN: T++,
|
|
374
|
+
BEGIN_WHITESPACE: T++,
|
|
375
|
+
TEXT: T++,
|
|
376
|
+
TEXT_ENTITY: T++,
|
|
377
|
+
OPEN_WAKA: T++,
|
|
378
|
+
SGML_DECL: T++,
|
|
379
|
+
SGML_DECL_QUOTED: T++,
|
|
380
|
+
DOCTYPE: T++,
|
|
381
|
+
DOCTYPE_QUOTED: T++,
|
|
382
|
+
DOCTYPE_DTD: T++,
|
|
383
|
+
DOCTYPE_DTD_QUOTED: T++,
|
|
384
|
+
COMMENT_STARTING: T++,
|
|
385
|
+
COMMENT: T++,
|
|
386
|
+
COMMENT_ENDING: T++,
|
|
387
|
+
COMMENT_ENDED: T++,
|
|
388
|
+
CDATA: T++,
|
|
389
|
+
CDATA_ENDING: T++,
|
|
390
|
+
CDATA_ENDING_2: T++,
|
|
391
|
+
PROC_INST: T++,
|
|
392
|
+
PROC_INST_BODY: T++,
|
|
393
|
+
PROC_INST_ENDING: T++,
|
|
394
|
+
OPEN_TAG: T++,
|
|
395
|
+
OPEN_TAG_SLASH: T++,
|
|
396
|
+
ATTRIB: T++,
|
|
397
|
+
ATTRIB_NAME: T++,
|
|
398
|
+
ATTRIB_NAME_SAW_WHITE: T++,
|
|
399
|
+
ATTRIB_VALUE: T++,
|
|
400
|
+
ATTRIB_VALUE_QUOTED: T++,
|
|
401
|
+
ATTRIB_VALUE_CLOSED: T++,
|
|
402
|
+
ATTRIB_VALUE_UNQUOTED: T++,
|
|
403
|
+
ATTRIB_VALUE_ENTITY_Q: T++,
|
|
404
|
+
ATTRIB_VALUE_ENTITY_U: T++,
|
|
405
|
+
CLOSE_TAG: T++,
|
|
406
|
+
CLOSE_TAG_SAW_WHITE: T++,
|
|
407
|
+
SCRIPT: T++,
|
|
408
|
+
SCRIPT_ENDING: T++
|
|
409
|
+
}, e.XML_ENTITIES = {
|
|
410
|
+
amp: "&",
|
|
411
|
+
gt: ">",
|
|
412
|
+
lt: "<",
|
|
413
|
+
quot: "\"",
|
|
414
|
+
apos: "'"
|
|
415
|
+
}, e.ENTITIES = {
|
|
416
|
+
amp: "&",
|
|
417
|
+
gt: ">",
|
|
418
|
+
lt: "<",
|
|
419
|
+
quot: "\"",
|
|
420
|
+
apos: "'",
|
|
421
|
+
AElig: 198,
|
|
422
|
+
Aacute: 193,
|
|
423
|
+
Acirc: 194,
|
|
424
|
+
Agrave: 192,
|
|
425
|
+
Aring: 197,
|
|
426
|
+
Atilde: 195,
|
|
427
|
+
Auml: 196,
|
|
428
|
+
Ccedil: 199,
|
|
429
|
+
ETH: 208,
|
|
430
|
+
Eacute: 201,
|
|
431
|
+
Ecirc: 202,
|
|
432
|
+
Egrave: 200,
|
|
433
|
+
Euml: 203,
|
|
434
|
+
Iacute: 205,
|
|
435
|
+
Icirc: 206,
|
|
436
|
+
Igrave: 204,
|
|
437
|
+
Iuml: 207,
|
|
438
|
+
Ntilde: 209,
|
|
439
|
+
Oacute: 211,
|
|
440
|
+
Ocirc: 212,
|
|
441
|
+
Ograve: 210,
|
|
442
|
+
Oslash: 216,
|
|
443
|
+
Otilde: 213,
|
|
444
|
+
Ouml: 214,
|
|
445
|
+
THORN: 222,
|
|
446
|
+
Uacute: 218,
|
|
447
|
+
Ucirc: 219,
|
|
448
|
+
Ugrave: 217,
|
|
449
|
+
Uuml: 220,
|
|
450
|
+
Yacute: 221,
|
|
451
|
+
aacute: 225,
|
|
452
|
+
acirc: 226,
|
|
453
|
+
aelig: 230,
|
|
454
|
+
agrave: 224,
|
|
455
|
+
aring: 229,
|
|
456
|
+
atilde: 227,
|
|
457
|
+
auml: 228,
|
|
458
|
+
ccedil: 231,
|
|
459
|
+
eacute: 233,
|
|
460
|
+
ecirc: 234,
|
|
461
|
+
egrave: 232,
|
|
462
|
+
eth: 240,
|
|
463
|
+
euml: 235,
|
|
464
|
+
iacute: 237,
|
|
465
|
+
icirc: 238,
|
|
466
|
+
igrave: 236,
|
|
467
|
+
iuml: 239,
|
|
468
|
+
ntilde: 241,
|
|
469
|
+
oacute: 243,
|
|
470
|
+
ocirc: 244,
|
|
471
|
+
ograve: 242,
|
|
472
|
+
oslash: 248,
|
|
473
|
+
otilde: 245,
|
|
474
|
+
ouml: 246,
|
|
475
|
+
szlig: 223,
|
|
476
|
+
thorn: 254,
|
|
477
|
+
uacute: 250,
|
|
478
|
+
ucirc: 251,
|
|
479
|
+
ugrave: 249,
|
|
480
|
+
uuml: 252,
|
|
481
|
+
yacute: 253,
|
|
482
|
+
yuml: 255,
|
|
483
|
+
copy: 169,
|
|
484
|
+
reg: 174,
|
|
485
|
+
nbsp: 160,
|
|
486
|
+
iexcl: 161,
|
|
487
|
+
cent: 162,
|
|
488
|
+
pound: 163,
|
|
489
|
+
curren: 164,
|
|
490
|
+
yen: 165,
|
|
491
|
+
brvbar: 166,
|
|
492
|
+
sect: 167,
|
|
493
|
+
uml: 168,
|
|
494
|
+
ordf: 170,
|
|
495
|
+
laquo: 171,
|
|
496
|
+
not: 172,
|
|
497
|
+
shy: 173,
|
|
498
|
+
macr: 175,
|
|
499
|
+
deg: 176,
|
|
500
|
+
plusmn: 177,
|
|
501
|
+
sup1: 185,
|
|
502
|
+
sup2: 178,
|
|
503
|
+
sup3: 179,
|
|
504
|
+
acute: 180,
|
|
505
|
+
micro: 181,
|
|
506
|
+
para: 182,
|
|
507
|
+
middot: 183,
|
|
508
|
+
cedil: 184,
|
|
509
|
+
ordm: 186,
|
|
510
|
+
raquo: 187,
|
|
511
|
+
frac14: 188,
|
|
512
|
+
frac12: 189,
|
|
513
|
+
frac34: 190,
|
|
514
|
+
iquest: 191,
|
|
515
|
+
times: 215,
|
|
516
|
+
divide: 247,
|
|
517
|
+
OElig: 338,
|
|
518
|
+
oelig: 339,
|
|
519
|
+
Scaron: 352,
|
|
520
|
+
scaron: 353,
|
|
521
|
+
Yuml: 376,
|
|
522
|
+
fnof: 402,
|
|
523
|
+
circ: 710,
|
|
524
|
+
tilde: 732,
|
|
525
|
+
Alpha: 913,
|
|
526
|
+
Beta: 914,
|
|
527
|
+
Gamma: 915,
|
|
528
|
+
Delta: 916,
|
|
529
|
+
Epsilon: 917,
|
|
530
|
+
Zeta: 918,
|
|
531
|
+
Eta: 919,
|
|
532
|
+
Theta: 920,
|
|
533
|
+
Iota: 921,
|
|
534
|
+
Kappa: 922,
|
|
535
|
+
Lambda: 923,
|
|
536
|
+
Mu: 924,
|
|
537
|
+
Nu: 925,
|
|
538
|
+
Xi: 926,
|
|
539
|
+
Omicron: 927,
|
|
540
|
+
Pi: 928,
|
|
541
|
+
Rho: 929,
|
|
542
|
+
Sigma: 931,
|
|
543
|
+
Tau: 932,
|
|
544
|
+
Upsilon: 933,
|
|
545
|
+
Phi: 934,
|
|
546
|
+
Chi: 935,
|
|
547
|
+
Psi: 936,
|
|
548
|
+
Omega: 937,
|
|
549
|
+
alpha: 945,
|
|
550
|
+
beta: 946,
|
|
551
|
+
gamma: 947,
|
|
552
|
+
delta: 948,
|
|
553
|
+
epsilon: 949,
|
|
554
|
+
zeta: 950,
|
|
555
|
+
eta: 951,
|
|
556
|
+
theta: 952,
|
|
557
|
+
iota: 953,
|
|
558
|
+
kappa: 954,
|
|
559
|
+
lambda: 955,
|
|
560
|
+
mu: 956,
|
|
561
|
+
nu: 957,
|
|
562
|
+
xi: 958,
|
|
563
|
+
omicron: 959,
|
|
564
|
+
pi: 960,
|
|
565
|
+
rho: 961,
|
|
566
|
+
sigmaf: 962,
|
|
567
|
+
sigma: 963,
|
|
568
|
+
tau: 964,
|
|
569
|
+
upsilon: 965,
|
|
570
|
+
phi: 966,
|
|
571
|
+
chi: 967,
|
|
572
|
+
psi: 968,
|
|
573
|
+
omega: 969,
|
|
574
|
+
thetasym: 977,
|
|
575
|
+
upsih: 978,
|
|
576
|
+
piv: 982,
|
|
577
|
+
ensp: 8194,
|
|
578
|
+
emsp: 8195,
|
|
579
|
+
thinsp: 8201,
|
|
580
|
+
zwnj: 8204,
|
|
581
|
+
zwj: 8205,
|
|
582
|
+
lrm: 8206,
|
|
583
|
+
rlm: 8207,
|
|
584
|
+
ndash: 8211,
|
|
585
|
+
mdash: 8212,
|
|
586
|
+
lsquo: 8216,
|
|
587
|
+
rsquo: 8217,
|
|
588
|
+
sbquo: 8218,
|
|
589
|
+
ldquo: 8220,
|
|
590
|
+
rdquo: 8221,
|
|
591
|
+
bdquo: 8222,
|
|
592
|
+
dagger: 8224,
|
|
593
|
+
Dagger: 8225,
|
|
594
|
+
bull: 8226,
|
|
595
|
+
hellip: 8230,
|
|
596
|
+
permil: 8240,
|
|
597
|
+
prime: 8242,
|
|
598
|
+
Prime: 8243,
|
|
599
|
+
lsaquo: 8249,
|
|
600
|
+
rsaquo: 8250,
|
|
601
|
+
oline: 8254,
|
|
602
|
+
frasl: 8260,
|
|
603
|
+
euro: 8364,
|
|
604
|
+
image: 8465,
|
|
605
|
+
weierp: 8472,
|
|
606
|
+
real: 8476,
|
|
607
|
+
trade: 8482,
|
|
608
|
+
alefsym: 8501,
|
|
609
|
+
larr: 8592,
|
|
610
|
+
uarr: 8593,
|
|
611
|
+
rarr: 8594,
|
|
612
|
+
darr: 8595,
|
|
613
|
+
harr: 8596,
|
|
614
|
+
crarr: 8629,
|
|
615
|
+
lArr: 8656,
|
|
616
|
+
uArr: 8657,
|
|
617
|
+
rArr: 8658,
|
|
618
|
+
dArr: 8659,
|
|
619
|
+
hArr: 8660,
|
|
620
|
+
forall: 8704,
|
|
621
|
+
part: 8706,
|
|
622
|
+
exist: 8707,
|
|
623
|
+
empty: 8709,
|
|
624
|
+
nabla: 8711,
|
|
625
|
+
isin: 8712,
|
|
626
|
+
notin: 8713,
|
|
627
|
+
ni: 8715,
|
|
628
|
+
prod: 8719,
|
|
629
|
+
sum: 8721,
|
|
630
|
+
minus: 8722,
|
|
631
|
+
lowast: 8727,
|
|
632
|
+
radic: 8730,
|
|
633
|
+
prop: 8733,
|
|
634
|
+
infin: 8734,
|
|
635
|
+
ang: 8736,
|
|
636
|
+
and: 8743,
|
|
637
|
+
or: 8744,
|
|
638
|
+
cap: 8745,
|
|
639
|
+
cup: 8746,
|
|
640
|
+
int: 8747,
|
|
641
|
+
there4: 8756,
|
|
642
|
+
sim: 8764,
|
|
643
|
+
cong: 8773,
|
|
644
|
+
asymp: 8776,
|
|
645
|
+
ne: 8800,
|
|
646
|
+
equiv: 8801,
|
|
647
|
+
le: 8804,
|
|
648
|
+
ge: 8805,
|
|
649
|
+
sub: 8834,
|
|
650
|
+
sup: 8835,
|
|
651
|
+
nsub: 8836,
|
|
652
|
+
sube: 8838,
|
|
653
|
+
supe: 8839,
|
|
654
|
+
oplus: 8853,
|
|
655
|
+
otimes: 8855,
|
|
656
|
+
perp: 8869,
|
|
657
|
+
sdot: 8901,
|
|
658
|
+
lceil: 8968,
|
|
659
|
+
rceil: 8969,
|
|
660
|
+
lfloor: 8970,
|
|
661
|
+
rfloor: 8971,
|
|
662
|
+
lang: 9001,
|
|
663
|
+
rang: 9002,
|
|
664
|
+
loz: 9674,
|
|
665
|
+
spades: 9824,
|
|
666
|
+
clubs: 9827,
|
|
667
|
+
hearts: 9829,
|
|
668
|
+
diams: 9830
|
|
669
|
+
}, Object.keys(e.ENTITIES).forEach(function(t) {
|
|
670
|
+
var n = e.ENTITIES[t], r = typeof n == "number" ? String.fromCharCode(n) : n;
|
|
671
|
+
e.ENTITIES[t] = r;
|
|
672
|
+
}), e.STATE) e.STATE[e.STATE[E]] = E;
|
|
673
|
+
T = e.STATE;
|
|
674
|
+
function D(e, t, n) {
|
|
675
|
+
e[t] && e[t](n);
|
|
676
|
+
}
|
|
677
|
+
function O(e) {
|
|
678
|
+
var t = e && e.match(/(?:^|\s)encoding\s*=\s*(['"])([^'"]+)\1/i);
|
|
679
|
+
return t ? t[2] : null;
|
|
680
|
+
}
|
|
681
|
+
function k(e) {
|
|
682
|
+
return e ? e.toLowerCase().replace(/[^a-z0-9]/g, "") : null;
|
|
683
|
+
}
|
|
684
|
+
function A(e, t) {
|
|
685
|
+
let n = k(e), r = k(t);
|
|
686
|
+
return !n || !r ? !0 : r === "utf16" ? n === "utf16le" || n === "utf16be" : n === r;
|
|
687
|
+
}
|
|
688
|
+
function j(e, t) {
|
|
689
|
+
if (e.strict && e.encoding && t && t.name === "xml") {
|
|
690
|
+
var n = O(t.body);
|
|
691
|
+
n && !A(e.encoding, n) && L(e, "XML declaration encoding " + n + " does not match detected stream encoding " + e.encoding.toUpperCase());
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
function M(e, t, n) {
|
|
695
|
+
e.textNode && N(e), D(e, t, n);
|
|
696
|
+
}
|
|
697
|
+
function N(e) {
|
|
698
|
+
e.textNode = P(e.opt, e.textNode), e.textNode && D(e, "ontext", e.textNode), e.textNode = "";
|
|
699
|
+
}
|
|
700
|
+
function P(e, t) {
|
|
701
|
+
return e.trim && (t = t.trim()), e.normalize && (t = t.replace(/\s+/g, " ")), t;
|
|
702
|
+
}
|
|
703
|
+
function F(e, t) {
|
|
704
|
+
return N(e), e.trackPosition && (t += "\nLine: " + e.line + "\nColumn: " + e.column + "\nChar: " + e.c), t = Error(t), e.error = t, D(e, "onerror", t), e;
|
|
705
|
+
}
|
|
706
|
+
function I(e) {
|
|
707
|
+
return e.sawRoot && !e.closedRoot && L(e, "Unclosed root tag"), e.state !== T.BEGIN && e.state !== T.BEGIN_WHITESPACE && e.state !== T.TEXT && F(e, "Unexpected end"), N(e), e.c = "", e.closed = !0, D(e, "onend"), n.call(e, e.strict, e.opt), e;
|
|
708
|
+
}
|
|
709
|
+
function L(e, t) {
|
|
710
|
+
if (typeof e != "object" || !(e instanceof n)) throw Error("bad call to strictFail");
|
|
711
|
+
e.strict && F(e, t);
|
|
712
|
+
}
|
|
713
|
+
function R(e) {
|
|
714
|
+
e.strict || (e.tagName = e.tagName[e.looseCase]());
|
|
715
|
+
var t = e.tags[e.tags.length - 1] || e, n = e.tag = {
|
|
716
|
+
name: e.tagName,
|
|
717
|
+
attributes: {}
|
|
718
|
+
};
|
|
719
|
+
e.opt.xmlns && (n.ns = t.ns), e.attribList.length = 0, M(e, "onopentagstart", n);
|
|
720
|
+
}
|
|
721
|
+
function z(e, t) {
|
|
722
|
+
var n = e.indexOf(":") < 0 ? ["", e] : e.split(":"), r = n[0], i = n[1];
|
|
723
|
+
return t && e === "xmlns" && (r = "xmlns", i = ""), {
|
|
724
|
+
prefix: r,
|
|
725
|
+
local: i
|
|
726
|
+
};
|
|
727
|
+
}
|
|
728
|
+
function B(e) {
|
|
729
|
+
if (e.strict || (e.attribName = e.attribName[e.looseCase]()), e.attribList.indexOf(e.attribName) !== -1 || e.tag.attributes.hasOwnProperty(e.attribName)) e.attribName = e.attribValue = "";
|
|
730
|
+
else {
|
|
731
|
+
if (e.opt.xmlns) {
|
|
732
|
+
var t = z(e.attribName, !0), n = t.prefix, r = t.local;
|
|
733
|
+
if (n === "xmlns") {
|
|
734
|
+
if (r === "xml" && e.attribValue !== p) L(e, "xml: prefix must be bound to " + p + "\nActual: " + e.attribValue);
|
|
735
|
+
else if (r === "xmlns" && e.attribValue !== m) L(e, "xmlns: prefix must be bound to " + m + "\nActual: " + e.attribValue);
|
|
736
|
+
else {
|
|
737
|
+
var i = e.tag, a = e.tags[e.tags.length - 1] || e;
|
|
738
|
+
i.ns === a.ns && (i.ns = Object.create(a.ns)), i.ns[r] = e.attribValue;
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
e.attribList.push([e.attribName, e.attribValue]);
|
|
742
|
+
} else e.tag.attributes[e.attribName] = e.attribValue, M(e, "onattribute", {
|
|
743
|
+
name: e.attribName,
|
|
744
|
+
value: e.attribValue
|
|
745
|
+
});
|
|
746
|
+
e.attribName = e.attribValue = "";
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
function V(e, t) {
|
|
750
|
+
if (e.opt.xmlns) {
|
|
751
|
+
var n = e.tag, r = z(e.tagName);
|
|
752
|
+
n.prefix = r.prefix, n.local = r.local, n.uri = n.ns[r.prefix] || "", n.prefix && !n.uri && (L(e, "Unbound namespace prefix: " + JSON.stringify(e.tagName)), n.uri = r.prefix);
|
|
753
|
+
var i = e.tags[e.tags.length - 1] || e;
|
|
754
|
+
n.ns && i.ns !== n.ns && Object.keys(n.ns).forEach(function(t) {
|
|
755
|
+
M(e, "onopennamespace", {
|
|
756
|
+
prefix: t,
|
|
757
|
+
uri: n.ns[t]
|
|
758
|
+
});
|
|
759
|
+
});
|
|
760
|
+
for (var a = 0, o = e.attribList.length; a < o; a++) {
|
|
761
|
+
var s = e.attribList[a], c = s[0], l = s[1], u = z(c, !0), d = u.prefix, f = u.local, p = d === "" ? "" : n.ns[d] || "", m = {
|
|
762
|
+
name: c,
|
|
763
|
+
value: l,
|
|
764
|
+
prefix: d,
|
|
765
|
+
local: f,
|
|
766
|
+
uri: p
|
|
767
|
+
};
|
|
768
|
+
d && d !== "xmlns" && !p && (L(e, "Unbound namespace prefix: " + JSON.stringify(d)), m.uri = d), e.tag.attributes[c] = m, M(e, "onattribute", m);
|
|
769
|
+
}
|
|
770
|
+
e.attribList.length = 0;
|
|
771
|
+
}
|
|
772
|
+
e.tag.isSelfClosing = !!t, e.sawRoot = !0, e.tags.push(e.tag), M(e, "onopentag", e.tag), t || (e.state = !e.noscript && e.tagName.toLowerCase() === "script" ? T.SCRIPT : T.TEXT, e.tag = null, e.tagName = ""), e.attribName = e.attribValue = "", e.attribList.length = 0;
|
|
773
|
+
}
|
|
774
|
+
function H(e) {
|
|
775
|
+
if (!e.tagName) L(e, "Weird empty close tag."), e.textNode += "</>", e.state = T.TEXT;
|
|
776
|
+
else {
|
|
777
|
+
if (e.script) {
|
|
778
|
+
if (e.tagName !== "script") {
|
|
779
|
+
e.script += "</" + e.tagName + ">", e.tagName = "", e.state = T.SCRIPT;
|
|
780
|
+
return;
|
|
781
|
+
}
|
|
782
|
+
M(e, "onscript", e.script), e.script = "";
|
|
783
|
+
}
|
|
784
|
+
var t = e.tags.length, n = e.tagName;
|
|
785
|
+
e.strict || (n = n[e.looseCase]());
|
|
786
|
+
for (var r = n; t-- && e.tags[t].name !== r;) L(e, "Unexpected close tag");
|
|
787
|
+
if (t < 0) L(e, "Unmatched closing tag: " + e.tagName), e.textNode += "</" + e.tagName + ">", e.state = T.TEXT;
|
|
788
|
+
else {
|
|
789
|
+
e.tagName = n;
|
|
790
|
+
for (var i = e.tags.length; i-- > t;) {
|
|
791
|
+
var a = e.tag = e.tags.pop();
|
|
792
|
+
e.tagName = e.tag.name, M(e, "onclosetag", e.tagName);
|
|
793
|
+
var o = {};
|
|
794
|
+
for (var s in a.ns) o[s] = a.ns[s];
|
|
795
|
+
var c = e.tags[e.tags.length - 1] || e;
|
|
796
|
+
e.opt.xmlns && a.ns !== c.ns && Object.keys(a.ns).forEach(function(t) {
|
|
797
|
+
var n = a.ns[t];
|
|
798
|
+
M(e, "onclosenamespace", {
|
|
799
|
+
prefix: t,
|
|
800
|
+
uri: n
|
|
801
|
+
});
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
t === 0 && (e.closedRoot = !0), e.tagName = e.attribValue = e.attribName = "", e.attribList.length = 0, e.state = T.TEXT;
|
|
805
|
+
}
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
function U(e) {
|
|
809
|
+
var t = e.entity, n = t.toLowerCase(), r, i = "";
|
|
810
|
+
return e.ENTITIES[t] ? e.ENTITIES[t] : e.ENTITIES[n] ? e.ENTITIES[n] : (t = n, t.charAt(0) === "#" && (t.charAt(1) === "x" ? (t = t.slice(2), r = parseInt(t, 16), i = r.toString(16)) : (t = t.slice(1), r = parseInt(t, 10), i = r.toString(10))), t = t.replace(/^0+/, ""), isNaN(r) || i.toLowerCase() !== t || r < 0 || r > 1114111 ? (L(e, "Invalid character entity"), "&" + e.entity + ";") : String.fromCodePoint(r));
|
|
811
|
+
}
|
|
812
|
+
function W(e, t) {
|
|
813
|
+
t === "<" ? (e.state = T.OPEN_WAKA, e.startTagPosition = e.position) : b(t) || (L(e, "Non-whitespace before first tag."), e.textNode = t, e.state = T.TEXT);
|
|
814
|
+
}
|
|
815
|
+
function G(e, t) {
|
|
816
|
+
var n = "";
|
|
817
|
+
return t < e.length && (n = e.charAt(t)), n;
|
|
818
|
+
}
|
|
819
|
+
function K(t) {
|
|
820
|
+
var n = this;
|
|
821
|
+
if (this.error) throw this.error;
|
|
822
|
+
if (n.closed) return F(n, "Cannot write after close. Assign an onready handler.");
|
|
823
|
+
if (t === null) return I(n);
|
|
824
|
+
typeof t == "object" && (t = t.toString());
|
|
825
|
+
for (var i = 0, a = ""; a = G(t, i++), n.c = a, a;) switch (n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++), n.state) {
|
|
826
|
+
case T.BEGIN:
|
|
827
|
+
if (n.state = T.BEGIN_WHITESPACE, a === "") continue;
|
|
828
|
+
W(n, a);
|
|
829
|
+
continue;
|
|
830
|
+
case T.BEGIN_WHITESPACE:
|
|
831
|
+
W(n, a);
|
|
832
|
+
continue;
|
|
833
|
+
case T.TEXT:
|
|
834
|
+
if (n.sawRoot && !n.closedRoot) {
|
|
835
|
+
for (var o = i - 1; a && a !== "<" && a !== "&";) a = G(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
|
|
836
|
+
n.textNode += t.substring(o, i - 1);
|
|
837
|
+
}
|
|
838
|
+
a === "<" && !(n.sawRoot && n.closedRoot && !n.strict) ? (n.state = T.OPEN_WAKA, n.startTagPosition = n.position) : (b(a) || n.sawRoot && !n.closedRoot || L(n, "Text data outside of root node."), a === "&" ? n.state = T.TEXT_ENTITY : n.textNode += a);
|
|
839
|
+
continue;
|
|
840
|
+
case T.SCRIPT:
|
|
841
|
+
a === "<" ? n.state = T.SCRIPT_ENDING : n.script += a;
|
|
842
|
+
continue;
|
|
843
|
+
case T.SCRIPT_ENDING:
|
|
844
|
+
a === "/" ? n.state = T.CLOSE_TAG : (n.script += "<" + a, n.state = T.SCRIPT);
|
|
845
|
+
continue;
|
|
846
|
+
case T.OPEN_WAKA:
|
|
847
|
+
if (a === "!") n.state = T.SGML_DECL, n.sgmlDecl = "";
|
|
848
|
+
else if (!b(a)) {
|
|
849
|
+
if (C(g, a)) n.state = T.OPEN_TAG, n.tagName = a;
|
|
850
|
+
else if (a === "/") n.state = T.CLOSE_TAG, n.tagName = "";
|
|
851
|
+
else if (a === "?") n.state = T.PROC_INST, n.procInstName = n.procInstBody = "";
|
|
852
|
+
else {
|
|
853
|
+
if (L(n, "Unencoded <"), n.startTagPosition + 1 < n.position) {
|
|
854
|
+
var s = n.position - n.startTagPosition;
|
|
855
|
+
a = Array(s).join(" ") + a;
|
|
856
|
+
}
|
|
857
|
+
n.textNode += "<" + a, n.state = T.TEXT;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
continue;
|
|
861
|
+
case T.SGML_DECL:
|
|
862
|
+
if (n.sgmlDecl + a === "--") {
|
|
863
|
+
n.state = T.COMMENT, n.comment = "", n.sgmlDecl = "";
|
|
864
|
+
continue;
|
|
865
|
+
}
|
|
866
|
+
n.doctype && n.doctype !== !0 && n.sgmlDecl ? (n.state = T.DOCTYPE_DTD, n.doctype += "<!" + n.sgmlDecl + a, n.sgmlDecl = "") : (n.sgmlDecl + a).toUpperCase() === d ? (M(n, "onopencdata"), n.state = T.CDATA, n.sgmlDecl = "", n.cdata = "") : (n.sgmlDecl + a).toUpperCase() === f ? (n.state = T.DOCTYPE, (n.doctype || n.sawRoot) && L(n, "Inappropriately located doctype declaration"), n.doctype = "", n.sgmlDecl = "") : a === ">" ? (M(n, "onsgmldeclaration", n.sgmlDecl), n.sgmlDecl = "", n.state = T.TEXT) : (x(a) && (n.state = T.SGML_DECL_QUOTED), n.sgmlDecl += a);
|
|
867
|
+
continue;
|
|
868
|
+
case T.SGML_DECL_QUOTED:
|
|
869
|
+
a === n.q && (n.state = T.SGML_DECL, n.q = ""), n.sgmlDecl += a;
|
|
870
|
+
continue;
|
|
871
|
+
case T.DOCTYPE:
|
|
872
|
+
a === ">" ? (n.state = T.TEXT, M(n, "ondoctype", n.doctype), n.doctype = !0) : (n.doctype += a, a === "[" ? n.state = T.DOCTYPE_DTD : x(a) && (n.state = T.DOCTYPE_QUOTED, n.q = a));
|
|
873
|
+
continue;
|
|
874
|
+
case T.DOCTYPE_QUOTED:
|
|
875
|
+
n.doctype += a, a === n.q && (n.q = "", n.state = T.DOCTYPE);
|
|
876
|
+
continue;
|
|
877
|
+
case T.DOCTYPE_DTD:
|
|
878
|
+
a === "]" ? (n.doctype += a, n.state = T.DOCTYPE) : a === "<" ? (n.state = T.OPEN_WAKA, n.startTagPosition = n.position) : x(a) ? (n.doctype += a, n.state = T.DOCTYPE_DTD_QUOTED, n.q = a) : n.doctype += a;
|
|
879
|
+
continue;
|
|
880
|
+
case T.DOCTYPE_DTD_QUOTED:
|
|
881
|
+
n.doctype += a, a === n.q && (n.state = T.DOCTYPE_DTD, n.q = "");
|
|
882
|
+
continue;
|
|
883
|
+
case T.COMMENT:
|
|
884
|
+
a === "-" ? n.state = T.COMMENT_ENDING : n.comment += a;
|
|
885
|
+
continue;
|
|
886
|
+
case T.COMMENT_ENDING:
|
|
887
|
+
a === "-" ? (n.state = T.COMMENT_ENDED, n.comment = P(n.opt, n.comment), n.comment && M(n, "oncomment", n.comment), n.comment = "") : (n.comment += "-" + a, n.state = T.COMMENT);
|
|
888
|
+
continue;
|
|
889
|
+
case T.COMMENT_ENDED:
|
|
890
|
+
a === ">" ? n.state = n.doctype && n.doctype !== !0 ? T.DOCTYPE_DTD : T.TEXT : (L(n, "Malformed comment"), n.comment += "--" + a, n.state = T.COMMENT);
|
|
891
|
+
continue;
|
|
892
|
+
case T.CDATA:
|
|
893
|
+
for (var o = i - 1; a && a !== "]";) a = G(t, i++), a && n.trackPosition && (n.position++, a === "\n" ? (n.line++, n.column = 0) : n.column++);
|
|
894
|
+
n.cdata += t.substring(o, i - 1), a === "]" && (n.state = T.CDATA_ENDING);
|
|
895
|
+
continue;
|
|
896
|
+
case T.CDATA_ENDING:
|
|
897
|
+
a === "]" ? n.state = T.CDATA_ENDING_2 : (n.cdata += "]" + a, n.state = T.CDATA);
|
|
898
|
+
continue;
|
|
899
|
+
case T.CDATA_ENDING_2:
|
|
900
|
+
a === ">" ? (n.cdata && M(n, "oncdata", n.cdata), M(n, "onclosecdata"), n.cdata = "", n.state = T.TEXT) : a === "]" ? n.cdata += "]" : (n.cdata += "]]" + a, n.state = T.CDATA);
|
|
901
|
+
continue;
|
|
902
|
+
case T.PROC_INST:
|
|
903
|
+
a === "?" ? n.state = T.PROC_INST_ENDING : b(a) ? n.state = T.PROC_INST_BODY : n.procInstName += a;
|
|
904
|
+
continue;
|
|
905
|
+
case T.PROC_INST_BODY:
|
|
906
|
+
if (!n.procInstBody && b(a)) continue;
|
|
907
|
+
a === "?" ? n.state = T.PROC_INST_ENDING : n.procInstBody += a;
|
|
908
|
+
continue;
|
|
909
|
+
case T.PROC_INST_ENDING:
|
|
910
|
+
if (a === ">") {
|
|
911
|
+
let e = {
|
|
912
|
+
name: n.procInstName,
|
|
913
|
+
body: n.procInstBody
|
|
914
|
+
};
|
|
915
|
+
j(n, e), M(n, "onprocessinginstruction", e), n.procInstName = n.procInstBody = "", n.state = T.TEXT;
|
|
916
|
+
} else n.procInstBody += "?" + a, n.state = T.PROC_INST_BODY;
|
|
917
|
+
continue;
|
|
918
|
+
case T.OPEN_TAG:
|
|
919
|
+
C(_, a) ? n.tagName += a : (R(n), a === ">" ? V(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : (b(a) || L(n, "Invalid character in tag name"), n.state = T.ATTRIB));
|
|
920
|
+
continue;
|
|
921
|
+
case T.OPEN_TAG_SLASH:
|
|
922
|
+
a === ">" ? (V(n, !0), H(n)) : (L(n, "Forward-slash in opening tag not followed by >"), n.state = T.ATTRIB);
|
|
923
|
+
continue;
|
|
924
|
+
case T.ATTRIB:
|
|
925
|
+
if (b(a)) continue;
|
|
926
|
+
a === ">" ? V(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : C(g, a) ? (n.attribName = a, n.attribValue = "", n.state = T.ATTRIB_NAME) : L(n, "Invalid attribute name");
|
|
927
|
+
continue;
|
|
928
|
+
case T.ATTRIB_NAME:
|
|
929
|
+
a === "=" ? n.state = T.ATTRIB_VALUE : a === ">" ? (L(n, "Attribute without value"), n.attribValue = n.attribName, B(n), V(n)) : b(a) ? n.state = T.ATTRIB_NAME_SAW_WHITE : C(_, a) ? n.attribName += a : L(n, "Invalid attribute name");
|
|
930
|
+
continue;
|
|
931
|
+
case T.ATTRIB_NAME_SAW_WHITE:
|
|
932
|
+
if (a === "=") n.state = T.ATTRIB_VALUE;
|
|
933
|
+
else if (b(a)) continue;
|
|
934
|
+
else L(n, "Attribute without value"), n.tag.attributes[n.attribName] = "", n.attribValue = "", M(n, "onattribute", {
|
|
935
|
+
name: n.attribName,
|
|
936
|
+
value: ""
|
|
937
|
+
}), n.attribName = "", a === ">" ? V(n) : C(g, a) ? (n.attribName = a, n.state = T.ATTRIB_NAME) : (L(n, "Invalid attribute name"), n.state = T.ATTRIB);
|
|
938
|
+
continue;
|
|
939
|
+
case T.ATTRIB_VALUE:
|
|
940
|
+
if (b(a)) continue;
|
|
941
|
+
x(a) ? (n.q = a, n.state = T.ATTRIB_VALUE_QUOTED) : (n.opt.unquotedAttributeValues || F(n, "Unquoted attribute value"), n.state = T.ATTRIB_VALUE_UNQUOTED, n.attribValue = a);
|
|
942
|
+
continue;
|
|
943
|
+
case T.ATTRIB_VALUE_QUOTED:
|
|
944
|
+
if (a !== n.q) {
|
|
945
|
+
a === "&" ? n.state = T.ATTRIB_VALUE_ENTITY_Q : n.attribValue += a;
|
|
946
|
+
continue;
|
|
947
|
+
}
|
|
948
|
+
B(n), n.q = "", n.state = T.ATTRIB_VALUE_CLOSED;
|
|
949
|
+
continue;
|
|
950
|
+
case T.ATTRIB_VALUE_CLOSED:
|
|
951
|
+
b(a) ? n.state = T.ATTRIB : a === ">" ? V(n) : a === "/" ? n.state = T.OPEN_TAG_SLASH : C(g, a) ? (L(n, "No whitespace between attributes"), n.attribName = a, n.attribValue = "", n.state = T.ATTRIB_NAME) : L(n, "Invalid attribute name");
|
|
952
|
+
continue;
|
|
953
|
+
case T.ATTRIB_VALUE_UNQUOTED:
|
|
954
|
+
if (!S(a)) {
|
|
955
|
+
a === "&" ? n.state = T.ATTRIB_VALUE_ENTITY_U : n.attribValue += a;
|
|
956
|
+
continue;
|
|
957
|
+
}
|
|
958
|
+
B(n), a === ">" ? V(n) : n.state = T.ATTRIB;
|
|
959
|
+
continue;
|
|
960
|
+
case T.CLOSE_TAG:
|
|
961
|
+
if (n.tagName) a === ">" ? H(n) : C(_, a) ? n.tagName += a : n.script ? (n.script += "</" + n.tagName + a, n.tagName = "", n.state = T.SCRIPT) : (b(a) || L(n, "Invalid tagname in closing tag"), n.state = T.CLOSE_TAG_SAW_WHITE);
|
|
962
|
+
else {
|
|
963
|
+
if (b(a)) continue;
|
|
964
|
+
w(g, a) ? n.script ? (n.script += "</" + a, n.state = T.SCRIPT) : L(n, "Invalid tagname in closing tag.") : n.tagName = a;
|
|
965
|
+
}
|
|
966
|
+
continue;
|
|
967
|
+
case T.CLOSE_TAG_SAW_WHITE:
|
|
968
|
+
if (b(a)) continue;
|
|
969
|
+
a === ">" ? H(n) : L(n, "Invalid characters in closing tag");
|
|
970
|
+
continue;
|
|
971
|
+
case T.TEXT_ENTITY:
|
|
972
|
+
case T.ATTRIB_VALUE_ENTITY_Q:
|
|
973
|
+
case T.ATTRIB_VALUE_ENTITY_U:
|
|
974
|
+
var c, l;
|
|
975
|
+
switch (n.state) {
|
|
976
|
+
case T.TEXT_ENTITY:
|
|
977
|
+
c = T.TEXT, l = "textNode";
|
|
978
|
+
break;
|
|
979
|
+
case T.ATTRIB_VALUE_ENTITY_Q:
|
|
980
|
+
c = T.ATTRIB_VALUE_QUOTED, l = "attribValue";
|
|
981
|
+
break;
|
|
982
|
+
case T.ATTRIB_VALUE_ENTITY_U: c = T.ATTRIB_VALUE_UNQUOTED, l = "attribValue";
|
|
983
|
+
}
|
|
984
|
+
if (a === ";") {
|
|
985
|
+
var u = U(n);
|
|
986
|
+
n.opt.unparsedEntities && !Object.values(e.XML_ENTITIES).includes(u) ? ((n.entityCount += 1) > n.opt.maxEntityCount && F(n, "Parsed entity count exceeds max entity count"), (n.entityDepth += 1) > n.opt.maxEntityDepth && F(n, "Parsed entity depth exceeds max entity depth"), n.entity = "", n.state = c, n.write(u), --n.entityDepth) : (n[l] += u, n.entity = "", n.state = c);
|
|
987
|
+
} else C(n.entity.length ? y : v, a) ? n.entity += a : (L(n, "Invalid character in entity name"), n[l] += "&" + n.entity + a, n.entity = "", n.state = c);
|
|
988
|
+
continue;
|
|
989
|
+
default: throw Error(n, "Unknown state: " + n.state);
|
|
990
|
+
}
|
|
991
|
+
return n.position >= n.bufferCheckPosition && r(n), n;
|
|
992
|
+
}
|
|
993
|
+
/* istanbul ignore next */
|
|
994
|
+
String.fromCodePoint || (function() {
|
|
995
|
+
var e = String.fromCharCode, t = Math.floor, n = function() {
|
|
996
|
+
var n = 16384, r = [], i, a, o = -1, s = arguments.length;
|
|
997
|
+
if (!s) return "";
|
|
998
|
+
for (var c = ""; ++o < s;) {
|
|
999
|
+
var l = Number(arguments[o]);
|
|
1000
|
+
if (!isFinite(l) || l < 0 || l > 1114111 || t(l) !== l) throw RangeError("Invalid code point: " + l);
|
|
1001
|
+
l <= 65535 ? r.push(l) : (l -= 65536, i = (l >> 10) + 55296, a = l % 1024 + 56320, r.push(i, a)), (o + 1 === s || r.length > n) && (c += e.apply(null, r), r.length = 0);
|
|
1002
|
+
}
|
|
1003
|
+
return c;
|
|
1004
|
+
};
|
|
1005
|
+
/* istanbul ignore next */
|
|
1006
|
+
Object.defineProperty ? Object.defineProperty(String, "fromCodePoint", {
|
|
1007
|
+
value: n,
|
|
1008
|
+
configurable: !0,
|
|
1009
|
+
writable: !0
|
|
1010
|
+
}) : String.fromCodePoint = n;
|
|
1011
|
+
})();
|
|
1012
|
+
})(e === void 0 ? n.sax = {} : e);
|
|
1013
|
+
})))(), 1);
|
|
1014
|
+
function te(e, t) {
|
|
1015
|
+
let n = new Set(t.elements), r = {};
|
|
1016
|
+
for (let e of t.elements) r[e] = void 0;
|
|
1017
|
+
let a = q.parser(!0, {
|
|
1018
|
+
xmlns: !0,
|
|
1019
|
+
position: !1
|
|
1020
|
+
}), o = null;
|
|
1021
|
+
a.onopentag = (e) => {
|
|
1022
|
+
let t = e, i = t.local;
|
|
1023
|
+
if (!n.has(i)) return;
|
|
1024
|
+
let a = {};
|
|
1025
|
+
for (let e of Object.values(t.attributes)) {
|
|
1026
|
+
let t = e.prefix === "xmlns" && e.local === "" ? "xmlns" : e.prefix ? e.local : e.name;
|
|
1027
|
+
a[t] = e.value;
|
|
1028
|
+
}
|
|
1029
|
+
r[i] = {
|
|
1030
|
+
namespace: t.uri,
|
|
1031
|
+
attributes: a,
|
|
1032
|
+
value: "",
|
|
1033
|
+
children: []
|
|
1034
|
+
}, n.delete(i), o = i;
|
|
1035
|
+
}, a.ontext = (e) => {
|
|
1036
|
+
o && r[o] && (r[o].value += e);
|
|
1037
|
+
}, a.oncdata = a.ontext, a.onclosetag = (e) => {
|
|
1038
|
+
if (o === e && (o = null), n.size === 0) throw J;
|
|
1039
|
+
};
|
|
1040
|
+
try {
|
|
1041
|
+
a.write(e).close();
|
|
1042
|
+
} catch (e) {
|
|
1043
|
+
e !== J && i("PARSE_ERROR", {
|
|
1044
|
+
detail: String(e),
|
|
1045
|
+
cause: e instanceof Error ? e : void 0
|
|
1046
|
+
});
|
|
1047
|
+
}
|
|
1048
|
+
return r;
|
|
1049
|
+
}
|
|
1050
|
+
var J = Symbol("inspectXml:earlyExit"), Y = class {
|
|
1051
|
+
constructor() {
|
|
1052
|
+
this.pendingChildren = /* @__PURE__ */ new Map();
|
|
1053
|
+
}
|
|
1054
|
+
registerPendingChild(e, t) {
|
|
1055
|
+
let n = this.pendingChildren.get(e);
|
|
1056
|
+
n ? n.push(t) : this.pendingChildren.set(e, [t]);
|
|
1057
|
+
}
|
|
1058
|
+
resolveChildrenForBatch(e) {
|
|
1059
|
+
for (let t of e) {
|
|
1060
|
+
let e = this.pendingChildren.get(t.id);
|
|
1061
|
+
e && e.length > 0 && (t.children.push(...e), this.pendingChildren.delete(t.id));
|
|
1062
|
+
}
|
|
1063
|
+
return e;
|
|
1064
|
+
}
|
|
1065
|
+
get pendingCount() {
|
|
1066
|
+
return this.pendingChildren.size;
|
|
1067
|
+
}
|
|
1068
|
+
};
|
|
1069
|
+
// src/xml/parse/guards.ts
|
|
1070
|
+
function ne(e) {
|
|
1071
|
+
return "prefix" in e && "uri" in e && !!e.prefix && !!e.uri;
|
|
1072
|
+
}
|
|
1073
|
+
// src/xml/parse/parser.constants.ts
|
|
1074
|
+
var re = {
|
|
1075
|
+
lowercase: !1,
|
|
1076
|
+
trim: !1,
|
|
1077
|
+
normalize: !1,
|
|
1078
|
+
position: !1,
|
|
1079
|
+
xmlns: !0
|
|
1080
|
+
};
|
|
1081
|
+
// src/xml/parse/parser.ts
|
|
1082
|
+
function ie(e) {
|
|
1083
|
+
let { dialecteConfig: t, useCustomRecordsIds: n, session: r, hooks: i, importSession: a, perf: o = m } = e, s = {
|
|
1084
|
+
defaultNamespace: null,
|
|
1085
|
+
stack: [],
|
|
1086
|
+
recordsBatch: [],
|
|
1087
|
+
sawRoot: !1
|
|
1088
|
+
}, c = q.parser(!0, re), l = a?.recordTagNames && new Set(a.recordTagNames);
|
|
1089
|
+
c.onopentag = (e) => {
|
|
1090
|
+
ae({
|
|
1091
|
+
node: e,
|
|
1092
|
+
state: s,
|
|
1093
|
+
dialecteConfig: t,
|
|
1094
|
+
useCustomRecordsIds: n
|
|
1095
|
+
});
|
|
1096
|
+
}, c.ontext = (e) => {
|
|
1097
|
+
oe({
|
|
1098
|
+
text: e,
|
|
1099
|
+
state: s
|
|
1100
|
+
});
|
|
1101
|
+
}, c.oncdata = (e) => {
|
|
1102
|
+
X({
|
|
1103
|
+
text: e,
|
|
1104
|
+
state: s
|
|
1105
|
+
});
|
|
1106
|
+
}, c.onclosetag = () => {
|
|
1107
|
+
ce({
|
|
1108
|
+
state: s,
|
|
1109
|
+
hooks: i,
|
|
1110
|
+
importSession: a,
|
|
1111
|
+
sessionTags: l,
|
|
1112
|
+
session: r,
|
|
1113
|
+
dialecteConfig: t,
|
|
1114
|
+
perf: o
|
|
1115
|
+
});
|
|
1116
|
+
}, c.onerror = le;
|
|
1117
|
+
function u() {
|
|
1118
|
+
let e = s.recordsBatch;
|
|
1119
|
+
return s.recordsBatch = [], e;
|
|
1120
|
+
}
|
|
1121
|
+
function d() {
|
|
1122
|
+
return s.recordsBatch.length;
|
|
1123
|
+
}
|
|
1124
|
+
return {
|
|
1125
|
+
parser: c,
|
|
1126
|
+
drainBatch: u,
|
|
1127
|
+
getSize: d
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
function ae(e) {
|
|
1131
|
+
let { node: t, state: n, dialecteConfig: r, useCustomRecordsIds: a } = e, o = ue(t);
|
|
1132
|
+
n.stack.length === 0 && (n.sawRoot && i("PARSE_ERROR", {
|
|
1133
|
+
detail: `XML parsing error: a second root element <${t.name}> after the root was closed`,
|
|
1134
|
+
meta: {
|
|
1135
|
+
reason: "second-root",
|
|
1136
|
+
tagName: t.name
|
|
1137
|
+
}
|
|
1138
|
+
}), n.sawRoot = !0), n.defaultNamespace ||= de({
|
|
1139
|
+
element: t,
|
|
1140
|
+
defaultNamespace: r.namespaces.default,
|
|
1141
|
+
rootElementName: r.rootElementName
|
|
1142
|
+
});
|
|
1143
|
+
let c = fe(t, n.defaultNamespace), l = he({
|
|
1144
|
+
attributes: t.attributes,
|
|
1145
|
+
useCustomRecordsIds: a,
|
|
1146
|
+
tagName: o
|
|
1147
|
+
}), u = ge({
|
|
1148
|
+
attributes: t.attributes,
|
|
1149
|
+
useCustomRecordsIds: a
|
|
1150
|
+
}), d = {
|
|
1151
|
+
id: l,
|
|
1152
|
+
tagName: o,
|
|
1153
|
+
namespace: c,
|
|
1154
|
+
attributes: s({
|
|
1155
|
+
dialecteConfig: r,
|
|
1156
|
+
attributes: pe(u),
|
|
1157
|
+
namespaceOf: (e) => t.ns[e]
|
|
1158
|
+
}),
|
|
1159
|
+
value: "",
|
|
1160
|
+
parent: me(n.stack),
|
|
1161
|
+
children: []
|
|
1162
|
+
};
|
|
1163
|
+
n.stack.push(d);
|
|
1164
|
+
}
|
|
1165
|
+
function oe(e) {
|
|
1166
|
+
let { state: t } = e;
|
|
1167
|
+
X({
|
|
1168
|
+
text: c({ text: e.text }),
|
|
1169
|
+
state: t
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
function X(e) {
|
|
1173
|
+
let { text: t, state: n } = e;
|
|
1174
|
+
t && n.stack.length > 0 && (n.stack[n.stack.length - 1].value += t);
|
|
1175
|
+
}
|
|
1176
|
+
function se(e) {
|
|
1177
|
+
let { record: t } = e, n = g({ record: t });
|
|
1178
|
+
if (!n) return;
|
|
1179
|
+
let r = p({
|
|
1180
|
+
place: n,
|
|
1181
|
+
element: `<${t.tagName}>`
|
|
1182
|
+
});
|
|
1183
|
+
Z({
|
|
1184
|
+
character: n.character,
|
|
1185
|
+
where: r
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
function Z(e) {
|
|
1189
|
+
let { character: t, where: n } = e;
|
|
1190
|
+
i("PARSE_ERROR", {
|
|
1191
|
+
detail: `XML parsing error: ${n} holds ${t}, a character XML does not allow (as written or as a character reference)`,
|
|
1192
|
+
meta: {
|
|
1193
|
+
reason: "not-xml-character",
|
|
1194
|
+
character: t
|
|
1195
|
+
}
|
|
1196
|
+
});
|
|
1197
|
+
}
|
|
1198
|
+
function ce(e) {
|
|
1199
|
+
let { state: t, hooks: n, importSession: r, sessionTags: i, session: a, dialecteConfig: o, perf: s = m } = e, c = t.stack.pop();
|
|
1200
|
+
if (!c) return;
|
|
1201
|
+
let l = s.time("import::standardize", () => C({
|
|
1202
|
+
dialecteConfig: o,
|
|
1203
|
+
hooks: n,
|
|
1204
|
+
record: c
|
|
1205
|
+
})), u = r?.beforeImportRecord;
|
|
1206
|
+
u && (!i || i.has(l.tagName)) && s.time("import::hooks.record", () => u({
|
|
1207
|
+
record: l,
|
|
1208
|
+
ancestry: t.stack
|
|
1209
|
+
})), se({ record: l });
|
|
1210
|
+
let d = t.stack[t.stack.length - 1];
|
|
1211
|
+
d ? d.children.push({
|
|
1212
|
+
id: l.id,
|
|
1213
|
+
tagName: l.tagName
|
|
1214
|
+
}) : l.parent && a.registerPendingChild(l.parent.id, {
|
|
1215
|
+
id: l.id,
|
|
1216
|
+
tagName: l.tagName
|
|
1217
|
+
}), t.recordsBatch.push(l);
|
|
1218
|
+
}
|
|
1219
|
+
function le(e) {
|
|
1220
|
+
i("PARSE_ERROR", {
|
|
1221
|
+
detail: `XML parsing error: ${e.message}`,
|
|
1222
|
+
meta: {
|
|
1223
|
+
reason: "malformed-xml",
|
|
1224
|
+
parser: e.message
|
|
1225
|
+
}
|
|
1226
|
+
});
|
|
1227
|
+
}
|
|
1228
|
+
function ue(e) {
|
|
1229
|
+
return e.local;
|
|
1230
|
+
}
|
|
1231
|
+
function de(e) {
|
|
1232
|
+
let { element: t, defaultNamespace: n, rootElementName: r } = e;
|
|
1233
|
+
return a(t.name === r, { detail: `Expected root element <${r}>, got <${t.name}>` }), t.attributes?.xmlns?.value ? {
|
|
1234
|
+
prefix: "",
|
|
1235
|
+
uri: t.attributes.xmlns.value
|
|
1236
|
+
} : n;
|
|
1237
|
+
}
|
|
1238
|
+
function fe(e, t) {
|
|
1239
|
+
return ne(e) ? {
|
|
1240
|
+
prefix: e.prefix,
|
|
1241
|
+
uri: e.uri
|
|
1242
|
+
} : t;
|
|
1243
|
+
}
|
|
1244
|
+
function pe(e) {
|
|
1245
|
+
return e.map((e) => {
|
|
1246
|
+
let t = e.prefix && e.uri ? {
|
|
1247
|
+
prefix: e.prefix,
|
|
1248
|
+
uri: e.uri
|
|
1249
|
+
} : void 0;
|
|
1250
|
+
return {
|
|
1251
|
+
name: e.prefix === "xmlns" && e.local === "" ? "xmlns" : t ? e.local : e.name,
|
|
1252
|
+
value: e.value,
|
|
1253
|
+
...t && { namespace: t }
|
|
1254
|
+
};
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1257
|
+
function me(e) {
|
|
1258
|
+
if (e.length === 0) return null;
|
|
1259
|
+
let t = e[e.length - 1];
|
|
1260
|
+
return t ? {
|
|
1261
|
+
id: t.id,
|
|
1262
|
+
tagName: t.tagName
|
|
1263
|
+
} : null;
|
|
1264
|
+
}
|
|
1265
|
+
function he(e) {
|
|
1266
|
+
let { attributes: t, useCustomRecordsIds: n, tagName: r } = e, i = t[o];
|
|
1267
|
+
if (!n || !i || !i.value) return crypto.randomUUID();
|
|
1268
|
+
let a = y({ text: i.value });
|
|
1269
|
+
return a && Z({
|
|
1270
|
+
character: a,
|
|
1271
|
+
where: `The attribute ${o} of <${r}>`
|
|
1272
|
+
}), i.value;
|
|
1273
|
+
}
|
|
1274
|
+
function ge(e) {
|
|
1275
|
+
let { attributes: t, useCustomRecordsIds: n } = e;
|
|
1276
|
+
return n ? Object.values(t).filter((e) => e.name !== o) : Object.values(t);
|
|
1277
|
+
}
|
|
1278
|
+
// src/xml/parse/parse-xml-document.ts
|
|
1279
|
+
async function Q(e, t = {}) {
|
|
1280
|
+
let { documentId: n, configKey: r, store: i, config: o, useCustomRecordsIds: s = !1, chunkOptions: c, hooks: l, perf: u = m } = e, { file: d } = e, f = N({ extensions: o.io.supportedFileExtensions });
|
|
1281
|
+
if (a(f.some((e) => d.name.toLowerCase().endsWith(e)), {
|
|
1282
|
+
key: "ASSERTION_FAILED",
|
|
1283
|
+
detail: `Unsupported file type: ${d.name}`
|
|
1284
|
+
}), d.size === 0) return {
|
|
1285
|
+
documentId: n,
|
|
1286
|
+
recordCount: 0,
|
|
1287
|
+
diagnostics: []
|
|
1288
|
+
};
|
|
1289
|
+
let p = l?.beforeImport;
|
|
1290
|
+
if (p) {
|
|
1291
|
+
let e = p(await d.text());
|
|
1292
|
+
d = new File([e], d.name, { type: d.type });
|
|
1293
|
+
}
|
|
1294
|
+
let h = c?.chunkSize ?? 32768, g = c?.batchSize ?? 2e3, _ = new Y(), v = l?.createImportSession?.({
|
|
1295
|
+
documentId: n,
|
|
1296
|
+
configKey: r
|
|
1297
|
+
}), y = ie({
|
|
1298
|
+
dialecteConfig: o,
|
|
1299
|
+
useCustomRecordsIds: s,
|
|
1300
|
+
session: _,
|
|
1301
|
+
hooks: l,
|
|
1302
|
+
importSession: v,
|
|
1303
|
+
perf: u
|
|
1304
|
+
}), b = await _e({
|
|
1305
|
+
file: d,
|
|
1306
|
+
sax: y,
|
|
1307
|
+
session: _,
|
|
1308
|
+
store: i,
|
|
1309
|
+
documentId: n,
|
|
1310
|
+
chunkSize: h,
|
|
1311
|
+
batchSize: g,
|
|
1312
|
+
perf: u,
|
|
1313
|
+
control: t
|
|
1314
|
+
}), { recordDelta: x, diagnostics: S } = await ve({
|
|
1315
|
+
importSession: v,
|
|
1316
|
+
store: i,
|
|
1317
|
+
documentId: n,
|
|
1318
|
+
file: d,
|
|
1319
|
+
perf: u,
|
|
1320
|
+
signal: t.signal
|
|
1321
|
+
});
|
|
1322
|
+
return {
|
|
1323
|
+
documentId: n,
|
|
1324
|
+
recordCount: b + x,
|
|
1325
|
+
diagnostics: S
|
|
1326
|
+
};
|
|
1327
|
+
}
|
|
1328
|
+
async function _e(e) {
|
|
1329
|
+
let { file: t, sax: n, session: r, store: i, documentId: a, chunkSize: o, batchSize: s, perf: c, control: l } = e, u = {
|
|
1330
|
+
sax: n,
|
|
1331
|
+
session: r,
|
|
1332
|
+
store: i,
|
|
1333
|
+
documentId: a,
|
|
1334
|
+
file: t,
|
|
1335
|
+
perf: c,
|
|
1336
|
+
control: l
|
|
1337
|
+
}, d = 0, f = 0, p = t.stream().getReader(), m = new TextDecoder(), h = /* @__PURE__ */ new Uint8Array(), g = !1;
|
|
1338
|
+
for (; !g;) {
|
|
1339
|
+
let e = await p.read();
|
|
1340
|
+
if (g = e.done, e.value) {
|
|
1341
|
+
let r = h.length === 0 ? e.value : xe(h, e.value), i = 0;
|
|
1342
|
+
for (; i + o <= r.length;) {
|
|
1343
|
+
let e = c.time("import::decode", () => m.decode(r.subarray(i, i + o), { stream: !0 }));
|
|
1344
|
+
i += o, f += o, c.time("import::parse", () => n.parser.write(e)), d += await Se({
|
|
1345
|
+
...u,
|
|
1346
|
+
threshold: s,
|
|
1347
|
+
progress: {
|
|
1348
|
+
phase: "storing",
|
|
1349
|
+
bytesRead: f,
|
|
1350
|
+
totalBytes: t.size
|
|
1351
|
+
}
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
h = i < r.length ? r.slice(i) : /* @__PURE__ */ new Uint8Array();
|
|
1355
|
+
}
|
|
1356
|
+
if (g) {
|
|
1357
|
+
if (h.length > 0) {
|
|
1358
|
+
let e = c.time("import::decode", () => m.decode(h));
|
|
1359
|
+
f += h.length, c.time("import::parse", () => n.parser.write(e));
|
|
1360
|
+
}
|
|
1361
|
+
c.time("import::parse", () => n.parser.close()), d += await Se({
|
|
1362
|
+
...u,
|
|
1363
|
+
threshold: 0,
|
|
1364
|
+
progress: {
|
|
1365
|
+
phase: "storing",
|
|
1366
|
+
bytesRead: f,
|
|
1367
|
+
totalBytes: t.size
|
|
1368
|
+
}
|
|
1369
|
+
});
|
|
1370
|
+
}
|
|
1371
|
+
}
|
|
1372
|
+
return d;
|
|
1373
|
+
}
|
|
1374
|
+
async function ve(e) {
|
|
1375
|
+
let { importSession: t, store: n, documentId: r, file: i, perf: a, signal: o } = e;
|
|
1376
|
+
if ($({
|
|
1377
|
+
signal: o,
|
|
1378
|
+
file: i
|
|
1379
|
+
}), !t?.afterImport) return {
|
|
1380
|
+
recordDelta: 0,
|
|
1381
|
+
diagnostics: []
|
|
1382
|
+
};
|
|
1383
|
+
a.start("import::hooks.after");
|
|
1384
|
+
let s;
|
|
1385
|
+
try {
|
|
1386
|
+
s = await t.afterImport();
|
|
1387
|
+
} finally {
|
|
1388
|
+
a.stop("import::hooks.after");
|
|
1389
|
+
}
|
|
1390
|
+
let { creates: c, updates: l, deletes: u, diagnostics: d = [] } = s;
|
|
1391
|
+
if (ye({ diagnostics: d }), be({
|
|
1392
|
+
creates: c,
|
|
1393
|
+
updates: l
|
|
1394
|
+
}), c?.length || l?.length || u?.length) {
|
|
1395
|
+
$({
|
|
1396
|
+
signal: o,
|
|
1397
|
+
file: i
|
|
1398
|
+
}), a.start("import::writes.after");
|
|
1399
|
+
try {
|
|
1400
|
+
await n.writeSession(r, {
|
|
1401
|
+
creates: c,
|
|
1402
|
+
updates: l,
|
|
1403
|
+
deletes: u
|
|
1404
|
+
});
|
|
1405
|
+
} finally {
|
|
1406
|
+
a.stop("import::writes.after");
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
return {
|
|
1410
|
+
recordDelta: (c?.length ?? 0) - (u?.length ?? 0),
|
|
1411
|
+
diagnostics: d
|
|
1412
|
+
};
|
|
1413
|
+
}
|
|
1414
|
+
function ye(e) {
|
|
1415
|
+
try {
|
|
1416
|
+
x({ value: e.diagnostics });
|
|
1417
|
+
} catch (e) {
|
|
1418
|
+
i("STORE_VALUE_NOT_JSON", {
|
|
1419
|
+
detail: `A diagnostic of the import session: ${n(e)?.detail ?? String(e)}`,
|
|
1420
|
+
cause: e instanceof Error ? e : void 0
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
}
|
|
1424
|
+
function be(e) {
|
|
1425
|
+
let { creates: t = [], updates: n = [] } = e;
|
|
1426
|
+
for (let e of t) v({ record: e });
|
|
1427
|
+
for (let e of n) v({ record: {
|
|
1428
|
+
...e,
|
|
1429
|
+
id: e.recordId
|
|
1430
|
+
} });
|
|
1431
|
+
}
|
|
1432
|
+
function $(e) {
|
|
1433
|
+
let { signal: t, file: n } = e;
|
|
1434
|
+
t?.aborted && i("IMPORT_ABORTED", {
|
|
1435
|
+
detail: `The import of "${n.name}" was aborted`,
|
|
1436
|
+
meta: { fileName: n.name }
|
|
1437
|
+
});
|
|
1438
|
+
}
|
|
1439
|
+
function xe(e, t) {
|
|
1440
|
+
let n = new Uint8Array(e.length + t.length);
|
|
1441
|
+
return n.set(e), n.set(t, e.length), n;
|
|
1442
|
+
}
|
|
1443
|
+
async function Se(e) {
|
|
1444
|
+
let { sax: t, session: n, store: r, documentId: i, file: a, threshold: o, perf: s, control: c, progress: l } = e;
|
|
1445
|
+
if (t.getSize() < o) return 0;
|
|
1446
|
+
$({
|
|
1447
|
+
signal: c.signal,
|
|
1448
|
+
file: a
|
|
1449
|
+
}), s.start("import::insert");
|
|
1450
|
+
let u;
|
|
1451
|
+
try {
|
|
1452
|
+
let e = n.resolveChildrenForBatch(t.drainBatch());
|
|
1453
|
+
await r.bulkWrite(i, { creates: e }), u = e.length;
|
|
1454
|
+
} finally {
|
|
1455
|
+
s.stop("import::insert");
|
|
1456
|
+
}
|
|
1457
|
+
return S({
|
|
1458
|
+
listener: c.onProgress,
|
|
1459
|
+
value: l,
|
|
1460
|
+
of: f.importProgress,
|
|
1461
|
+
call: c
|
|
1462
|
+
}), u;
|
|
1463
|
+
}
|
|
1464
|
+
// src/project/io/run-import.ts
|
|
1465
|
+
async function Ce(e, t = {}) {
|
|
1466
|
+
let { runtime: i, file: a, options: o, writeId: s } = e, c = e.perf ?? h({
|
|
1467
|
+
enabled: i.perf ?? !1,
|
|
1468
|
+
timeline: !1
|
|
1469
|
+
});
|
|
1470
|
+
$({
|
|
1471
|
+
signal: t.signal,
|
|
1472
|
+
file: a
|
|
1473
|
+
});
|
|
1474
|
+
let { configKey: l, config: u } = _({
|
|
1475
|
+
configs: i.configs,
|
|
1476
|
+
defaultConfigKey: i.defaultConfigKey,
|
|
1477
|
+
configKey: o?.configKey
|
|
1478
|
+
}), d = {
|
|
1479
|
+
id: crypto.randomUUID(),
|
|
1480
|
+
...we({
|
|
1481
|
+
file: a,
|
|
1482
|
+
path: o?.path,
|
|
1483
|
+
config: u
|
|
1484
|
+
}),
|
|
1485
|
+
configKey: l,
|
|
1486
|
+
createdAt: Date.now(),
|
|
1487
|
+
metadata: o?.metadata,
|
|
1488
|
+
status: "importing",
|
|
1489
|
+
writeId: s,
|
|
1490
|
+
...o?.path !== void 0 && { path: o.path }
|
|
1491
|
+
};
|
|
1492
|
+
c.start("import");
|
|
1493
|
+
let f;
|
|
1494
|
+
try {
|
|
1495
|
+
f = await Te({
|
|
1496
|
+
...e,
|
|
1497
|
+
control: t,
|
|
1498
|
+
registered: d,
|
|
1499
|
+
config: u,
|
|
1500
|
+
perf: c
|
|
1501
|
+
});
|
|
1502
|
+
} catch (e) {
|
|
1503
|
+
throw n(e) ? e : r("IMPORT_FAILED", {
|
|
1504
|
+
detail: e instanceof Error ? e.message : String(e),
|
|
1505
|
+
cause: e instanceof Error ? e : void 0
|
|
1506
|
+
});
|
|
1507
|
+
} finally {
|
|
1508
|
+
c.stop("import");
|
|
1509
|
+
}
|
|
1510
|
+
return {
|
|
1511
|
+
...f,
|
|
1512
|
+
...i.perf && { perf: c.snapshot() }
|
|
1513
|
+
};
|
|
1514
|
+
}
|
|
1515
|
+
function we(e) {
|
|
1516
|
+
let { file: t, path: n, config: r } = e, i = N({ extensions: r.io.supportedFileExtensions });
|
|
1517
|
+
return n === void 0 ? {
|
|
1518
|
+
name: t.name.replace(/\.[^.]+$/, "") || "untitled",
|
|
1519
|
+
extension: t.name.includes(".") ? `.${t.name.split(".").pop()}` : i[0]
|
|
1520
|
+
} : P({
|
|
1521
|
+
path: n,
|
|
1522
|
+
extensions: i
|
|
1523
|
+
});
|
|
1524
|
+
}
|
|
1525
|
+
async function Te(e) {
|
|
1526
|
+
let { store: t, runtime: n, file: r, options: a, control: o, registered: s, config: c, perf: l } = e;
|
|
1527
|
+
l.start("import::register");
|
|
1528
|
+
try {
|
|
1529
|
+
await t.registerDocument(s);
|
|
1530
|
+
} finally {
|
|
1531
|
+
l.stop("import::register");
|
|
1532
|
+
}
|
|
1533
|
+
try {
|
|
1534
|
+
let e = await Q({
|
|
1535
|
+
file: r,
|
|
1536
|
+
documentId: s.id,
|
|
1537
|
+
configKey: s.configKey,
|
|
1538
|
+
store: t,
|
|
1539
|
+
config: c,
|
|
1540
|
+
useCustomRecordsIds: a?.useCustomRecordsIds,
|
|
1541
|
+
chunkOptions: a?.chunkOptions,
|
|
1542
|
+
hooks: n.hooks,
|
|
1543
|
+
perf: l
|
|
1544
|
+
}, o);
|
|
1545
|
+
$({
|
|
1546
|
+
signal: o.signal,
|
|
1547
|
+
file: r
|
|
1548
|
+
}), l.start("import::finalize");
|
|
1549
|
+
try {
|
|
1550
|
+
await t.getDocument(s.id) || i("DOCUMENT_NOT_REGISTERED", {
|
|
1551
|
+
detail: `Document "${s.id}" of "${r.name}" was removed while it imported`,
|
|
1552
|
+
meta: { documentId: s.id }
|
|
1553
|
+
}), await t.markReady(s.id);
|
|
1554
|
+
} finally {
|
|
1555
|
+
l.stop("import::finalize");
|
|
1556
|
+
}
|
|
1557
|
+
return {
|
|
1558
|
+
record: {
|
|
1559
|
+
...s,
|
|
1560
|
+
status: "ready"
|
|
1561
|
+
},
|
|
1562
|
+
recordCount: e.recordCount,
|
|
1563
|
+
diagnostics: e.diagnostics
|
|
1564
|
+
};
|
|
1565
|
+
} catch (e) {
|
|
1566
|
+
throw await Ee({
|
|
1567
|
+
store: t,
|
|
1568
|
+
documentId: s.id
|
|
1569
|
+
}), e;
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
async function Ee(e) {
|
|
1573
|
+
let { store: t, documentId: n } = e;
|
|
1574
|
+
try {
|
|
1575
|
+
await t.removeDocument(n);
|
|
1576
|
+
} catch {}
|
|
1577
|
+
}
|
|
1578
|
+
// src/project/io/store-runtime.constants.ts
|
|
1579
|
+
var De = {
|
|
1580
|
+
import: "IMPORT_FAILED",
|
|
1581
|
+
export: "ASSERTION_FAILED"
|
|
1582
|
+
};
|
|
1583
|
+
// src/project/io/store-runtime.ts
|
|
1584
|
+
function Oe(e) {
|
|
1585
|
+
let { runtime: t, storeName: n, operation: r } = e;
|
|
1586
|
+
return t || i(De[r], { detail: `Store "${n}" has no dialecte to ${r} with: build it with a runtime` }), t;
|
|
1587
|
+
}
|
|
1588
|
+
// src/store/compare-by-id.ts
|
|
1589
|
+
function ke(e, t) {
|
|
1590
|
+
return e.id < t.id ? -1 : +(e.id > t.id);
|
|
1591
|
+
}
|
|
1592
|
+
// src/store/same-json-value.ts
|
|
1593
|
+
function Ae(e) {
|
|
1594
|
+
return je({ value: e.first }) === je({ value: e.second });
|
|
1595
|
+
}
|
|
1596
|
+
function je(e) {
|
|
1597
|
+
return JSON.stringify(e.value, function(e, t) {
|
|
1598
|
+
return typeof t != "object" || !t || Array.isArray(t) ? t : Object.fromEntries(Object.entries(t).sort(function([e], [t]) {
|
|
1599
|
+
return e < t ? -1 : +(e > t);
|
|
1600
|
+
}));
|
|
1601
|
+
});
|
|
1602
|
+
}
|
|
1603
|
+
export { A as C, E as S, T, N as _, Q as a, O as b, te as c, U as d, H as f, R as g, M as h, Ce as i, K as l, L as m, ke as n, $ as o, I as p, Oe as r, Y as s, Ae as t, G as u, P as v, w, D as x, k as y };
|