tinybase 5.3.0 → 5.3.2
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/cjs/common/index.cjs +5 -7
- package/cjs/common/with-schemas/index.cjs +5 -7
- package/cjs/es6/common/index.cjs +5 -7
- package/cjs/es6/common/with-schemas/index.cjs +5 -7
- package/cjs/es6/index.cjs +18 -12
- package/cjs/es6/indexes/index.cjs +0 -6
- package/cjs/es6/indexes/with-schemas/index.cjs +0 -6
- package/cjs/es6/mergeable-store/index.cjs +17 -11
- package/cjs/es6/mergeable-store/with-schemas/index.cjs +17 -11
- package/cjs/es6/metrics/index.cjs +1 -1
- package/cjs/es6/metrics/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/common/index.cjs +1 -1
- package/cjs/es6/min/common/index.cjs.gz +0 -0
- package/cjs/es6/min/common/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/common/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/index.cjs +1 -1
- package/cjs/es6/min/index.cjs.gz +0 -0
- package/cjs/es6/min/indexes/index.cjs +1 -1
- package/cjs/es6/min/indexes/index.cjs.gz +0 -0
- package/cjs/es6/min/indexes/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/indexes/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/mergeable-store/index.cjs +1 -1
- package/cjs/es6/min/mergeable-store/index.cjs.gz +0 -0
- package/cjs/es6/min/mergeable-store/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/persisters/persister-pglite/index.cjs +1 -1
- package/cjs/es6/min/persisters/persister-pglite/index.cjs.gz +0 -0
- package/cjs/es6/min/persisters/persister-pglite/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/persisters/persister-pglite/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/store/index.cjs +1 -1
- package/cjs/es6/min/store/index.cjs.gz +0 -0
- package/cjs/es6/min/store/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/store/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-local/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-local/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-local/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-local/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/synchronizers/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/synchronizers/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/tools/index.cjs +1 -1
- package/cjs/es6/min/tools/index.cjs.gz +0 -0
- package/cjs/es6/min/tools/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/tools/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/index.cjs +1 -1
- package/cjs/es6/min/ui-react/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-dom/index.cjs +1 -1
- package/cjs/es6/min/ui-react-dom/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-dom/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react-dom/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-inspector/index.cjs +1 -1
- package/cjs/es6/min/ui-react-inspector/index.cjs.gz +0 -0
- package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/min/with-schemas/index.cjs +1 -1
- package/cjs/es6/min/with-schemas/index.cjs.gz +0 -0
- package/cjs/es6/persisters/persister-pglite/index.cjs +1 -1
- package/cjs/es6/persisters/persister-pglite/with-schemas/index.cjs +1 -1
- package/cjs/es6/queries/index.cjs +1 -1
- package/cjs/es6/queries/with-schemas/index.cjs +1 -1
- package/cjs/es6/store/index.cjs +0 -6
- package/cjs/es6/store/with-schemas/index.cjs +0 -6
- package/cjs/es6/synchronizers/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-broadcast-channel/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-local/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-local/with-schemas/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-ws-client/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-ws-server/index.cjs +5 -7
- package/cjs/es6/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +5 -7
- package/cjs/es6/synchronizers/with-schemas/index.cjs +5 -7
- package/cjs/es6/tools/index.cjs +7 -4
- package/cjs/es6/tools/with-schemas/index.cjs +7 -4
- package/cjs/es6/ui-react/index.cjs +101 -109
- package/cjs/es6/ui-react/with-schemas/index.cjs +101 -109
- package/cjs/es6/ui-react-dom/index.cjs +14 -8
- package/cjs/es6/ui-react-dom/with-schemas/index.cjs +14 -8
- package/cjs/es6/ui-react-inspector/index.cjs +18 -16
- package/cjs/es6/ui-react-inspector/with-schemas/index.cjs +18 -16
- package/cjs/es6/with-schemas/index.cjs +18 -12
- package/cjs/index.cjs +18 -12
- package/cjs/indexes/index.cjs +0 -6
- package/cjs/indexes/with-schemas/index.cjs +0 -6
- package/cjs/mergeable-store/index.cjs +17 -11
- package/cjs/mergeable-store/with-schemas/index.cjs +17 -11
- package/cjs/metrics/index.cjs +1 -1
- package/cjs/metrics/with-schemas/index.cjs +1 -1
- package/cjs/min/common/index.cjs +1 -1
- package/cjs/min/common/index.cjs.gz +0 -0
- package/cjs/min/common/with-schemas/index.cjs +1 -1
- package/cjs/min/common/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/index.cjs +1 -1
- package/cjs/min/index.cjs.gz +0 -0
- package/cjs/min/indexes/index.cjs +1 -1
- package/cjs/min/indexes/index.cjs.gz +0 -0
- package/cjs/min/indexes/with-schemas/index.cjs +1 -1
- package/cjs/min/indexes/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/mergeable-store/index.cjs +1 -1
- package/cjs/min/mergeable-store/index.cjs.gz +0 -0
- package/cjs/min/mergeable-store/with-schemas/index.cjs +1 -1
- package/cjs/min/mergeable-store/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/persisters/persister-pglite/index.cjs +1 -1
- package/cjs/min/persisters/persister-pglite/index.cjs.gz +0 -0
- package/cjs/min/persisters/persister-pglite/with-schemas/index.cjs +1 -1
- package/cjs/min/persisters/persister-pglite/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/store/index.cjs +1 -1
- package/cjs/min/store/index.cjs.gz +0 -0
- package/cjs/min/store/with-schemas/index.cjs +1 -1
- package/cjs/min/store/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/index.cjs +1 -1
- package/cjs/min/synchronizers/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-local/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-local/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-local/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-local/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-client/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-client/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-client/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-server/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/synchronizer-ws-server/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/synchronizers/with-schemas/index.cjs +1 -1
- package/cjs/min/synchronizers/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/tools/index.cjs +1 -1
- package/cjs/min/tools/index.cjs.gz +0 -0
- package/cjs/min/tools/with-schemas/index.cjs +1 -1
- package/cjs/min/tools/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react/index.cjs +1 -1
- package/cjs/min/ui-react/index.cjs.gz +0 -0
- package/cjs/min/ui-react/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react-dom/index.cjs +1 -1
- package/cjs/min/ui-react-dom/index.cjs.gz +0 -0
- package/cjs/min/ui-react-dom/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react-dom/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/ui-react-inspector/index.cjs +1 -1
- package/cjs/min/ui-react-inspector/index.cjs.gz +0 -0
- package/cjs/min/ui-react-inspector/with-schemas/index.cjs +1 -1
- package/cjs/min/ui-react-inspector/with-schemas/index.cjs.gz +0 -0
- package/cjs/min/with-schemas/index.cjs +1 -1
- package/cjs/min/with-schemas/index.cjs.gz +0 -0
- package/cjs/persisters/persister-pglite/index.cjs +1 -1
- package/cjs/persisters/persister-pglite/with-schemas/index.cjs +1 -1
- package/cjs/queries/index.cjs +1 -1
- package/cjs/queries/with-schemas/index.cjs +1 -1
- package/cjs/store/index.cjs +0 -6
- package/cjs/store/with-schemas/index.cjs +0 -6
- package/cjs/synchronizers/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-broadcast-channel/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-broadcast-channel/with-schemas/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-local/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-local/with-schemas/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-ws-client/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-ws-client/with-schemas/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-ws-server/index.cjs +5 -7
- package/cjs/synchronizers/synchronizer-ws-server/with-schemas/index.cjs +5 -7
- package/cjs/synchronizers/with-schemas/index.cjs +5 -7
- package/cjs/tools/index.cjs +7 -4
- package/cjs/tools/with-schemas/index.cjs +7 -4
- package/cjs/ui-react/index.cjs +97 -107
- package/cjs/ui-react/with-schemas/index.cjs +97 -107
- package/cjs/ui-react-dom/index.cjs +14 -8
- package/cjs/ui-react-dom/with-schemas/index.cjs +14 -8
- package/cjs/ui-react-inspector/index.cjs +18 -16
- package/cjs/ui-react-inspector/with-schemas/index.cjs +18 -16
- package/cjs/with-schemas/index.cjs +18 -12
- package/common/index.js +5 -7
- package/common/with-schemas/index.js +5 -7
- package/es6/common/index.js +5 -7
- package/es6/common/with-schemas/index.js +5 -7
- package/es6/index.js +18 -12
- package/es6/indexes/index.js +0 -6
- package/es6/indexes/with-schemas/index.js +0 -6
- package/es6/mergeable-store/index.js +17 -11
- package/es6/mergeable-store/with-schemas/index.js +17 -11
- package/es6/metrics/index.js +1 -1
- package/es6/metrics/with-schemas/index.js +1 -1
- package/es6/min/common/index.js +1 -1
- package/es6/min/common/index.js.gz +0 -0
- package/es6/min/common/with-schemas/index.js +1 -1
- package/es6/min/common/with-schemas/index.js.gz +0 -0
- package/es6/min/index.js +1 -1
- package/es6/min/index.js.gz +0 -0
- package/es6/min/indexes/index.js +1 -1
- package/es6/min/indexes/index.js.gz +0 -0
- package/es6/min/indexes/with-schemas/index.js +1 -1
- package/es6/min/indexes/with-schemas/index.js.gz +0 -0
- package/es6/min/mergeable-store/index.js +1 -1
- package/es6/min/mergeable-store/index.js.gz +0 -0
- package/es6/min/mergeable-store/with-schemas/index.js +1 -1
- package/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/es6/min/persisters/persister-pglite/index.js +1 -1
- package/es6/min/persisters/persister-pglite/index.js.gz +0 -0
- package/es6/min/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/es6/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
- package/es6/min/store/index.js +1 -1
- package/es6/min/store/index.js.gz +0 -0
- package/es6/min/store/with-schemas/index.js +1 -1
- package/es6/min/store/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/index.js +1 -1
- package/es6/min/synchronizers/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-local/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/es6/min/synchronizers/with-schemas/index.js +1 -1
- package/es6/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/es6/min/tools/index.js +1 -1
- package/es6/min/tools/index.js.gz +0 -0
- package/es6/min/tools/with-schemas/index.js +1 -1
- package/es6/min/tools/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react/index.js +1 -1
- package/es6/min/ui-react/index.js.gz +0 -0
- package/es6/min/ui-react/with-schemas/index.js +1 -1
- package/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react-dom/index.js +1 -1
- package/es6/min/ui-react-dom/index.js.gz +0 -0
- package/es6/min/ui-react-dom/with-schemas/index.js +1 -1
- package/es6/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/index.js +1 -1
- package/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/es6/min/with-schemas/index.js +1 -1
- package/es6/min/with-schemas/index.js.gz +0 -0
- package/es6/persisters/persister-pglite/index.js +1 -1
- package/es6/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/es6/queries/index.js +1 -1
- package/es6/queries/with-schemas/index.js +1 -1
- package/es6/store/index.js +0 -6
- package/es6/store/with-schemas/index.js +0 -6
- package/es6/synchronizers/index.js +5 -7
- package/es6/synchronizers/synchronizer-broadcast-channel/index.js +5 -7
- package/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -7
- package/es6/synchronizers/synchronizer-local/index.js +5 -7
- package/es6/synchronizers/synchronizer-local/with-schemas/index.js +5 -7
- package/es6/synchronizers/synchronizer-ws-client/index.js +5 -7
- package/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +5 -7
- package/es6/synchronizers/synchronizer-ws-server/index.js +5 -7
- package/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +5 -7
- package/es6/synchronizers/with-schemas/index.js +5 -7
- package/es6/tools/index.js +7 -4
- package/es6/tools/with-schemas/index.js +7 -4
- package/es6/ui-react/index.js +101 -109
- package/es6/ui-react/with-schemas/index.js +101 -109
- package/es6/ui-react-dom/index.js +14 -8
- package/es6/ui-react-dom/with-schemas/index.js +14 -8
- package/es6/ui-react-inspector/index.js +18 -16
- package/es6/ui-react-inspector/with-schemas/index.js +18 -16
- package/es6/with-schemas/index.js +18 -12
- package/index.js +18 -12
- package/indexes/index.js +0 -6
- package/indexes/with-schemas/index.js +0 -6
- package/mergeable-store/index.js +17 -11
- package/mergeable-store/with-schemas/index.js +17 -11
- package/metrics/index.js +1 -1
- package/metrics/with-schemas/index.js +1 -1
- package/min/common/index.js +1 -1
- package/min/common/index.js.gz +0 -0
- package/min/common/with-schemas/index.js +1 -1
- package/min/common/with-schemas/index.js.gz +0 -0
- package/min/index.js +1 -1
- package/min/index.js.gz +0 -0
- package/min/indexes/index.js +1 -1
- package/min/indexes/index.js.gz +0 -0
- package/min/indexes/with-schemas/index.js +1 -1
- package/min/indexes/with-schemas/index.js.gz +0 -0
- package/min/mergeable-store/index.js +1 -1
- package/min/mergeable-store/index.js.gz +0 -0
- package/min/mergeable-store/with-schemas/index.js +1 -1
- package/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/min/persisters/persister-pglite/index.js +1 -1
- package/min/persisters/persister-pglite/index.js.gz +0 -0
- package/min/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
- package/min/store/index.js +1 -1
- package/min/store/index.js.gz +0 -0
- package/min/store/with-schemas/index.js +1 -1
- package/min/store/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/index.js +1 -1
- package/min/synchronizers/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/index.js +1 -1
- package/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/min/synchronizers/with-schemas/index.js +1 -1
- package/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/min/tools/index.js +1 -1
- package/min/tools/index.js.gz +0 -0
- package/min/tools/with-schemas/index.js +1 -1
- package/min/tools/with-schemas/index.js.gz +0 -0
- package/min/ui-react/index.js +1 -1
- package/min/ui-react/index.js.gz +0 -0
- package/min/ui-react/with-schemas/index.js +1 -1
- package/min/ui-react/with-schemas/index.js.gz +0 -0
- package/min/ui-react-dom/index.js +1 -1
- package/min/ui-react-dom/index.js.gz +0 -0
- package/min/ui-react-dom/with-schemas/index.js +1 -1
- package/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/min/ui-react-inspector/index.js +1 -1
- package/min/ui-react-inspector/index.js.gz +0 -0
- package/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/min/with-schemas/index.js +1 -1
- package/min/with-schemas/index.js.gz +0 -0
- package/package.json +5 -5
- package/persisters/persister-pglite/index.js +1 -1
- package/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/queries/index.js +1 -1
- package/queries/with-schemas/index.js +1 -1
- package/readme.md +14 -14
- package/releases.md +24 -24
- package/store/index.js +0 -6
- package/store/with-schemas/index.js +0 -6
- package/synchronizers/index.js +5 -7
- package/synchronizers/synchronizer-broadcast-channel/index.js +5 -7
- package/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -7
- package/synchronizers/synchronizer-local/index.js +5 -7
- package/synchronizers/synchronizer-local/with-schemas/index.js +5 -7
- package/synchronizers/synchronizer-ws-client/index.js +5 -7
- package/synchronizers/synchronizer-ws-client/with-schemas/index.js +5 -7
- package/synchronizers/synchronizer-ws-server/index.js +5 -7
- package/synchronizers/synchronizer-ws-server/with-schemas/index.js +5 -7
- package/synchronizers/with-schemas/index.js +5 -7
- package/tools/index.js +7 -4
- package/tools/with-schemas/index.js +7 -4
- package/ui-react/index.js +97 -107
- package/ui-react/with-schemas/index.js +97 -107
- package/ui-react-dom/index.js +14 -8
- package/ui-react-dom/with-schemas/index.js +14 -8
- package/ui-react-inspector/index.js +18 -16
- package/ui-react-inspector/with-schemas/index.js +18 -16
- package/umd/common/index.js +5 -7
- package/umd/common/with-schemas/index.js +5 -7
- package/umd/es6/common/index.js +5 -7
- package/umd/es6/common/with-schemas/index.js +5 -7
- package/umd/es6/index.js +18 -12
- package/umd/es6/indexes/index.js +0 -6
- package/umd/es6/indexes/with-schemas/index.js +0 -6
- package/umd/es6/mergeable-store/index.js +17 -11
- package/umd/es6/mergeable-store/with-schemas/index.js +17 -11
- package/umd/es6/metrics/index.js +1 -1
- package/umd/es6/metrics/with-schemas/index.js +1 -1
- package/umd/es6/min/common/index.js +1 -1
- package/umd/es6/min/common/index.js.gz +0 -0
- package/umd/es6/min/common/with-schemas/index.js +1 -1
- package/umd/es6/min/common/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/index.js +1 -1
- package/umd/es6/min/index.js.gz +0 -0
- package/umd/es6/min/indexes/index.js +1 -1
- package/umd/es6/min/indexes/index.js.gz +0 -0
- package/umd/es6/min/indexes/with-schemas/index.js +1 -1
- package/umd/es6/min/indexes/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/mergeable-store/index.js +1 -1
- package/umd/es6/min/mergeable-store/index.js.gz +0 -0
- package/umd/es6/min/mergeable-store/with-schemas/index.js +1 -1
- package/umd/es6/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/persisters/persister-pglite/index.js +1 -1
- package/umd/es6/min/persisters/persister-pglite/index.js.gz +0 -0
- package/umd/es6/min/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/umd/es6/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/store/index.js +1 -1
- package/umd/es6/min/store/index.js.gz +0 -0
- package/umd/es6/min/store/with-schemas/index.js +1 -1
- package/umd/es6/min/store/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/index.js +1 -1
- package/umd/es6/min/synchronizers/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-local/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/synchronizers/with-schemas/index.js +1 -1
- package/umd/es6/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/tools/index.js +1 -1
- package/umd/es6/min/tools/index.js.gz +0 -0
- package/umd/es6/min/tools/with-schemas/index.js +1 -1
- package/umd/es6/min/tools/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react/index.js +1 -1
- package/umd/es6/min/ui-react/index.js.gz +0 -0
- package/umd/es6/min/ui-react/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react-dom/index.js +1 -1
- package/umd/es6/min/ui-react-dom/index.js.gz +0 -0
- package/umd/es6/min/ui-react-dom/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/ui-react-inspector/index.js +1 -1
- package/umd/es6/min/ui-react-inspector/index.js.gz +0 -0
- package/umd/es6/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/es6/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/umd/es6/min/with-schemas/index.js +1 -1
- package/umd/es6/min/with-schemas/index.js.gz +0 -0
- package/umd/es6/persisters/persister-pglite/index.js +1 -1
- package/umd/es6/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/umd/es6/queries/index.js +1 -1
- package/umd/es6/queries/with-schemas/index.js +1 -1
- package/umd/es6/store/index.js +0 -6
- package/umd/es6/store/with-schemas/index.js +0 -6
- package/umd/es6/synchronizers/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-broadcast-channel/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-local/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-local/with-schemas/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-ws-client/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-ws-client/with-schemas/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-ws-server/index.js +5 -7
- package/umd/es6/synchronizers/synchronizer-ws-server/with-schemas/index.js +5 -7
- package/umd/es6/synchronizers/with-schemas/index.js +5 -7
- package/umd/es6/tools/index.js +7 -4
- package/umd/es6/tools/with-schemas/index.js +7 -4
- package/umd/es6/ui-react/index.js +101 -118
- package/umd/es6/ui-react/with-schemas/index.js +101 -118
- package/umd/es6/ui-react-dom/index.js +14 -8
- package/umd/es6/ui-react-dom/with-schemas/index.js +14 -8
- package/umd/es6/ui-react-inspector/index.js +18 -16
- package/umd/es6/ui-react-inspector/with-schemas/index.js +18 -16
- package/umd/es6/with-schemas/index.js +18 -12
- package/umd/index.js +18 -12
- package/umd/indexes/index.js +0 -6
- package/umd/indexes/with-schemas/index.js +0 -6
- package/umd/mergeable-store/index.js +17 -11
- package/umd/mergeable-store/with-schemas/index.js +17 -11
- package/umd/metrics/index.js +1 -1
- package/umd/metrics/with-schemas/index.js +1 -1
- package/umd/min/common/index.js +1 -1
- package/umd/min/common/index.js.gz +0 -0
- package/umd/min/common/with-schemas/index.js +1 -1
- package/umd/min/common/with-schemas/index.js.gz +0 -0
- package/umd/min/index.js +1 -1
- package/umd/min/index.js.gz +0 -0
- package/umd/min/indexes/index.js +1 -1
- package/umd/min/indexes/index.js.gz +0 -0
- package/umd/min/indexes/with-schemas/index.js +1 -1
- package/umd/min/indexes/with-schemas/index.js.gz +0 -0
- package/umd/min/mergeable-store/index.js +1 -1
- package/umd/min/mergeable-store/index.js.gz +0 -0
- package/umd/min/mergeable-store/with-schemas/index.js +1 -1
- package/umd/min/mergeable-store/with-schemas/index.js.gz +0 -0
- package/umd/min/persisters/persister-pglite/index.js +1 -1
- package/umd/min/persisters/persister-pglite/index.js.gz +0 -0
- package/umd/min/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/umd/min/persisters/persister-pglite/with-schemas/index.js.gz +0 -0
- package/umd/min/store/index.js +1 -1
- package/umd/min/store/index.js.gz +0 -0
- package/umd/min/store/with-schemas/index.js +1 -1
- package/umd/min/store/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/index.js +1 -1
- package/umd/min/synchronizers/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-broadcast-channel/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-broadcast-channel/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-local/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-local/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-local/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-local/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-client/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-client/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-client/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-client/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-server/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server/index.js.gz +0 -0
- package/umd/min/synchronizers/synchronizer-ws-server/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/synchronizer-ws-server/with-schemas/index.js.gz +0 -0
- package/umd/min/synchronizers/with-schemas/index.js +1 -1
- package/umd/min/synchronizers/with-schemas/index.js.gz +0 -0
- package/umd/min/tools/index.js +1 -1
- package/umd/min/tools/index.js.gz +0 -0
- package/umd/min/tools/with-schemas/index.js +1 -1
- package/umd/min/tools/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react/index.js +1 -1
- package/umd/min/ui-react/index.js.gz +0 -0
- package/umd/min/ui-react/with-schemas/index.js +1 -1
- package/umd/min/ui-react/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react-dom/index.js +1 -1
- package/umd/min/ui-react-dom/index.js.gz +0 -0
- package/umd/min/ui-react-dom/with-schemas/index.js +1 -1
- package/umd/min/ui-react-dom/with-schemas/index.js.gz +0 -0
- package/umd/min/ui-react-inspector/index.js +1 -1
- package/umd/min/ui-react-inspector/index.js.gz +0 -0
- package/umd/min/ui-react-inspector/with-schemas/index.js +1 -1
- package/umd/min/ui-react-inspector/with-schemas/index.js.gz +0 -0
- package/umd/min/with-schemas/index.js +1 -1
- package/umd/min/with-schemas/index.js.gz +0 -0
- package/umd/persisters/persister-pglite/index.js +1 -1
- package/umd/persisters/persister-pglite/with-schemas/index.js +1 -1
- package/umd/queries/index.js +1 -1
- package/umd/queries/with-schemas/index.js +1 -1
- package/umd/store/index.js +0 -6
- package/umd/store/with-schemas/index.js +0 -6
- package/umd/synchronizers/index.js +5 -7
- package/umd/synchronizers/synchronizer-broadcast-channel/index.js +5 -7
- package/umd/synchronizers/synchronizer-broadcast-channel/with-schemas/index.js +5 -7
- package/umd/synchronizers/synchronizer-local/index.js +5 -7
- package/umd/synchronizers/synchronizer-local/with-schemas/index.js +5 -7
- package/umd/synchronizers/synchronizer-ws-client/index.js +5 -7
- package/umd/synchronizers/synchronizer-ws-client/with-schemas/index.js +5 -7
- package/umd/synchronizers/synchronizer-ws-server/index.js +5 -7
- package/umd/synchronizers/synchronizer-ws-server/with-schemas/index.js +5 -7
- package/umd/synchronizers/with-schemas/index.js +5 -7
- package/umd/tools/index.js +7 -4
- package/umd/tools/with-schemas/index.js +7 -4
- package/umd/ui-react/index.js +97 -110
- package/umd/ui-react/with-schemas/index.js +97 -110
- package/umd/ui-react-dom/index.js +14 -8
- package/umd/ui-react-dom/with-schemas/index.js +14 -8
- package/umd/ui-react-inspector/index.js +18 -16
- package/umd/ui-react-inspector/with-schemas/index.js +18 -16
- package/umd/with-schemas/index.js +18 -12
- package/with-schemas/index.js +18 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=Promise,t=globalThis,a=Math,s=a.floor,n=e=>null==e,o=(e,t,a)=>n(e)?a?.():t(e),r=e=>Array.isArray(e),i=e=>e.length,l=e=>{throw Error(e)},c=(e,t)=>e.forEach(t),u=(e
|
|
1
|
+
"use strict";const e=Promise,t=globalThis,a=Math,s=a.floor,n=e=>null==e,o=(e,t,a)=>n(e)?a?.():t(e),r=e=>Array.isArray(e),i=e=>e.length,l=e=>{throw Error(e)},c=(e,t)=>e.forEach(t),u=(e,...t)=>e.push(...t),g=e=>e.shift(),d=Object,y=e=>d.getPrototypeOf(e),f=d.entries,h=d.keys,p=d.freeze,w=(e,t)=>c(f(e),(([e,a])=>t(a,e))),v=e=>(e=>!n(e)&&o(y(e),(e=>e==d.prototype||n(y(e))),(()=>!0)))(e)&&0==(e=>i(h(e)))(e),b=(e,t,a)=>(((e,t)=>t in e)(e,t)||(e[t]=a()),e[t]),C=e=>n(e)||0==(e=>e?.size??0)(e),M=(e,t)=>e?.forEach(t),S=(e,t)=>e?.delete(t),A=e=>new Map(e),D=(e,t)=>e?.get(t),L=(e,t,a)=>n(a)?(S(e,t),e):e?.set(t,a),m=(e,t,a,s)=>{var n,o;return n=e,o=t,n?.has(o)?s?.(D(e,t)):L(e,t,a()),D(e,t)},H=(e,t,a,s,n=0)=>o((a?m:D)(e,t[n],n>i(t)-2?a:A),(o=>{if(n>i(t)-2)return s?.(o)&&L(e,t[n]),o;const r=H(o,t,a,s,n+1);return C(o)&&L(e,t[n]),r})),T=(e,t)=>t?[e,t]:[e],G=(e,t)=>((e??"")>(t??"")?e:t)??"",R=(e="")=>T(((e=[])=>d.fromEntries(e))(),e),z=e=>new Set(r(e)||n(e)?e:[e]),E=/^\d+$/,V=A(),P=A(),x=(e,t,a,s,d,y,f,h={},w=[])=>{let b,T,G,R=0,x=0,O=0;m(V,w,(()=>0)),m(P,w,(()=>[]));const $=A(),[j,k,F,N,U]=((e=1,t)=>1!=e&&t.isMergeable()?[1,t.getMergeableContent,t.getTransactionMergeableChanges,([[e],[t]])=>!v(e)||!v(t),t.setDefaultContent]:2!=e?[0,t.getContent,t.getTransactionChanges,([e,t])=>!v(e)||!v(t),t.setContent]:l("Store type not supported by this Persister"))(f,e),[q,B,I]=(()=>{let e;const[t,a]=(()=>{const e=[];let t=0;return[a=>(a?g(e):null)??""+t++,t=>{E.test(t)&&i(e)<1e3&&u(e,t)}]})(),s=A();return[(a,n,o,r=[],i=()=>[])=>{e??=_;const l=t(1);var c,u;return L(s,l,[a,n,o,r,i]),c=H(n,o??[""],z),u=l,c?.add(u),l},(t,a,...n)=>c(((e,t=[""])=>{const a=[],s=(e,n)=>n==i(t)?u(a,e):null===t[n]?M(e,(e=>s(e,n+1))):c([t[n],null],(t=>s(D(e,t),n+1)));return s(e,0),a})(t,a),(t=>M(t,(t=>D(s,t)[0](e,...a??[],...n))))),e=>o(D(s,e),(([,t,n])=>(H(t,n??[""],void 0,(t=>(S(t,e),C(t)?1:0))),L(s,e),a(e),n))),t=>o(D(s,t),(([t,,a=[],s,o])=>{const r=(...l)=>{const u=i(l);u==i(a)?t(e,...l,...o(l)):n(a[u])?c(s[u]?.(...l)??[],(e=>r(...l,e))):r(...l,a[u])};r()}))]})(),J=e=>{e!=R&&(R=e,B($,void 0,R))},K=t=>{(j&&r(t?.[0])?1===t?.[2]?e.applyMergeableChanges:e.setMergeableContent:1===t?.[2]?e.applyChanges:e.setContent)(t)},Q=async e=>(2!=R&&(J(1),x++,await Z((async()=>{try{const e=await t();r(e)?K(e):l("Content is not an array "+e)}catch(t){y?.(t),e&&U(e)}J(0)}))),_),W=()=>(T&&(d(T),T=void 0),_),X=async e=>(1!=R&&(J(2),O++,await Z((async()=>{try{await a(k,e)}catch(e){y?.(e)}J(0)}))),_),Y=()=>(o(G,e.delListener),G=void 0,_),Z=async(...e)=>(u(D(P,w),...e),await(async()=>{if(!D(V,w)){for(L(V,w,1);!n(b=g(D(P,w)));)try{await b()}catch(e){y?.(e)}L(V,w,0)}})(),_),_={load:Q,startAutoLoad:async e=>{await W().load(e);try{T=await s((async(e,t)=>{t||e?2!=R&&(J(1),x++,K(t??e),J(0)):await Q()}))}catch(e){y?.(e)}return _},stopAutoLoad:W,isAutoLoading:()=>!n(T),save:X,startAutoSave:async()=>(await Y().save(),G=e.addDidFinishTransactionListener((()=>{const e=F();N(e)&&X(e)})),_),stopAutoSave:Y,isAutoSaving:()=>!n(G),getStatus:()=>R,addStatusListener:e=>q(e,$),delListener:t=>(I(t),e),schedule:Z,getStore:()=>e,destroy:()=>(D(P,w).splice(0,void 0),W().stopAutoSave()),getStats:()=>({loads:x,saves:O}),...h};return p(_)},O=((e,t="")=>"-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".split(t,void 0))(),$=t.crypto?e=>t.crypto.getRandomValues(e):e=>(e=>e.map((()=>s(256*a.random()))))(e);exports.Message={Response:0,GetContentHashes:1,ContentHashes:2,ContentDiff:3,GetTableDiff:4,GetRowDiff:5,GetCellDiff:6,GetValueDiff:7},exports.createCustomSynchronizer=(t,a,s,r,i,l,c,u,g={})=>{let d,y=0,f=0;const h=A(),p=(e,t,s,n)=>{y++,l?.(e,t,s,n),a(e,t,s,n)},C=async(t,a,s="")=>new e(((e,n)=>{const o=((e=16)=>{return t=(e,t)=>e+O[63&t],$(new Uint8Array(e)).reduce(t,"");var t})(),r=setTimeout((()=>{S(h,o),n(`No response from ${t??"anyone"} to ${o}, `+a)}),1e3*i);L(h,o,[t,(t,a)=>{clearTimeout(r),S(h,o),e([t,a])}]),p(t,o,a,s)})),M=(e,[t,a])=>{w(t,(([t,a],s)=>{const n=b(e[0],s,R);w(t,(([e,t],a)=>{const s=b(n[0],a,R);w(e,(([e,t],a)=>s[0][a]=T(e,t))),s[1]=G(s[1],t)})),n[1]=G(n[1],a)})),e[1]=G(e[1],a)},m=async(e=null,a)=>{n(a)&&([a,e]=await C(e,1));const[s,o]=a,[r,i]=t.getMergeableContentHashes();let l=R();if(r!=s){const[a,s]=(await C(e,4,t.getMergeableTableHashes()))[0];if(l=a,!v(s)){const[a,n]=(await C(e,5,t.getMergeableRowHashes(s)))[0];if(M(l,a),!v(n)){const a=(await C(e,6,t.getMergeableCellHashes(n)))[0];M(l,a)}}}return[l,i==o?R():(await C(e,7,t.getMergeableValueHashes()))[0],1]},H=x(t,(async()=>{const e=await m();return v(e[0][0])&&v(e[1][0])?void 0:e}),(async(e,a)=>a?p(null,null,3,a):p(null,null,2,t.getMergeableContentHashes())),(e=>d=e),(()=>d=void 0),u,2,{startSync:async e=>await(await H.startAutoLoad(e)).startAutoSave(),stopSync:()=>H.stopAutoLoad().stopAutoSave(),destroy:()=>(r(),H.stopSync()),getSynchronizerStats:()=>({sends:y,receives:f}),...g});return s(((e,a,s,r)=>{f++,c?.(e,a,s,r),0==s?o(D(h,a),(([t,a])=>n(t)||t==e?a(r,e):0)):2==s&&H.isAutoLoading()?m(e,r).then((e=>{d?.(void 0,e)})):3==s&&H.isAutoLoading()?d?.(void 0,r):o(1==s&&H.isAutoSaving()?t.getMergeableContentHashes():4==s?t.getMergeableTableDiff(r):5==s?t.getMergeableRowDiff(r):6==s?t.getMergeableCellDiff(r):7==s?t.getMergeableValueDiff(r):void 0,(t=>{p(e,a,0,t)}))})),H};
|
|
Binary file
|
package/cjs/min/tools/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=e=>typeof e,l="tinybase",t="",a=",",n=e(t),d=e(!0),o=e(0),s="type",r="default",I="Listener",$="get",c="add",u="Has",i="Ids",b="Table",p=b+"s",C=b+i,h="Row",m=h+i,g="Sorted"+h+i,w="Cell",f=w+i,T="Value",y=T+"s",v=T+i,V=Promise,x=isFinite,R=e=>null==e,A=(e,l,t)=>R(e)?t?.():l(e),k=e=>e==n||e==d,S=l=>e(l)==n,P=e=>Array.isArray(e),O=(e,l,t)=>e.slice(l,t),E=e=>e.length,N=async e=>V.all(e),D=l=>{const t=e(l);return k(t)||t==o&&x(l)?t:void 0},L=(e,l)=>e.every(l),G=(e,l)=>e.sort(l),j=(e,l)=>e.forEach(l),H=(e,l=t)=>e.join(l),M=(e,l)=>e.map(l),J=(e,l)=>e.filter(l),z=(e,...l)=>e.push(...l),W=e=>e.pop(),B=(e,...l)=>e.unshift(...l),F=e=>e.shift(),U=Object,_=e=>U.getPrototypeOf(e),Z=U.entries,Q=e=>!R(e)&&A(_(e),(e=>e==U.prototype||R(_(e))),(()=>!0)),q=U.keys,K=U.freeze,X=(e,l)=>M(Z(e),(([e,t])=>l(t,e))),Y=e=>E(q(e)),ee=e=>Q(e)&&0==Y(e),le=(e,l)=>e?.has(l)??!1,te=e=>[...e?.values()??[]],ae=(e,l)=>e?.forEach(l),ne=(e,l)=>e?.delete(l),de=e=>new Map(e),oe=(e,l)=>e?.get(l),se=(e,l)=>ae(e,((e,t)=>l(t,e))),re=(e,l)=>M([...e?.entries()??[]],(([e,t])=>l(t,e))),Ie=(e,l,t)=>R(t)?(ne(e,l),e):e?.set(l,t),$e=(e,l,t,a)=>(le(e,l)||Ie(e,l,t()),oe(e,l)),ce=e=>e.toUpperCase(),ue=e=>e.toLowerCase(),ie="a ",be="A function for",pe=", and registers a listener so that any changes to that result will cause a re-render",Ce="Callback",he="Changes",me="Count",ge="Del",we="Deps",fe=we+"?: React.DependencyList",Te="doRollback?: DoRollback",ye="actions: () => Return, "+Te,ve="export",Ve="Id",xe="Invalid",Re="Json",Ae=ue(I),ke="?: ",Se=" | undefined",Pe="NonNullable",Oe="Partial",Ee="Props",Ne="Provider",De=`Registers a ${Ae} that will be called`,Le="Represents",Ge="rowId: "+Ve,je="Schema",He="Set",Me=", descending?: boolean, offset?: number, limit?: number",Je="[]",ze="the Store",We="Transaction",Be=ue(We),Fe="Execute a "+Be+" to make multiple mutations",Ue="Explicitly starts a "+Be,_e="Explicitly finishes a "+Be,Ze="the end of the "+Be,Qe="void",qe=" => "+Qe,Ke="WhenSet",Xe=" when setting it",Ye=ie+"string serialization of",el=" ",ll="Gets a callback that can ",tl="the ",al=" the schema for",nl=(e=0)=>e?"the existence of ":"",dl=(e=0,l=0,a=0)=>nl(a)+`the ${yl[e]}content of`+(l?el+ze:t),ol=(e=0,l,a=0,n=0)=>wl[l]+el+nl(n)+dl(e,1)+(a?" when setting it":t),sl=(e,l=0)=>Le+` a Row when ${l?"s":"g"}etting ${dl()} the '${e}' `+b,rl=(e,l,t=0)=>`Gets ${t?"sorted, paginated":"the"} Ids of the ${e}s in `+l,Il=(e,l)=>`Calls a function for each ${e} in `+l,$l=e=>"The props passed to a component that renders "+e,cl=e=>"A function that takes "+e,ul=(e,l=0,t=0)=>be+" listening to changes to "+nl(t)+Tl[e]+" in "+Tl[l],il=(e,l,a=0,n=0)=>De+" whenever "+nl(n)+Tl[e]+" in "+Tl[l]+" change"+(a?t:"s"),bl=e=>`the '${e}' `+b,pl=e=>"the specified Row in "+bl(e),Cl=(e,l=0,t=0)=>wl[l]+el+dl(0,0,t)+el+bl(e),hl=(e,l=0,t=0)=>wl[l]+` ${dl(0,0,t)} `+pl(e),ml=(e,l,t=0,a=0)=>wl[t]+el+nl(a)+`the '${l}' Cell for `+pl(e),gl=(e,l=0,t=0)=>wl[l]+el+nl(t)+`the '${e}' Value`,wl=["Gets","Checks existence of","Sets","Deletes","Sets part of",Le,"Gets "+Ye,"Sets "+Ye,De+" whenever",ll+"set",ll+"add",ll+"set part of",ll+"delete","Renders","Gets "+Ye+al,"Sets"+al,"Deletes"+al],fl=[$,"has","set","del","set","forEach",c,t],Tl=[ze,p,tl+b+el+i,ie+b,tl+h+el+i,ie+h,tl+w+el+i,ie+w,"invalid Cell changes",y,tl+T+el+i,ie+T,"invalid Value changes",tl+"sorted "+h+el+i,tl+w+el+i+" anywhere",tl+"number of Rows",ie+w+" anywhere"],yl=[t,"tabular ","keyed value "],vl=e=>new Set(P(e)||R(e)?e:[e]),Vl=(e,l)=>e?.add(l),xl=/[^A-Za-z]+/,Rl=/[^A-Za-z0-9]+/,Al=/^( *)\/\*\* *(.*?) *\*\/$/gm,kl=e=>e.includes(a),Sl=(e,l,t,a=1)=>{const n=`${l}${1==a?"":a}`;return le(e,n)?Sl(e,l,t,a+1):(Ie(e,n,t),n)},Pl=e=>e.replace(Al,((e,l,t)=>{const a=77-E(l);return`${l}/**\n${t.replace(RegExp(`([^\\n]{1,${a}})(\\s|$)`,"g"),l+" * $1\n")}${l} */`})),Ol=e=>e.flat(1e3),El=(e,l=0)=>H(M(e.split(Rl),((e,t)=>(t>0||l?ce:ue)(O(e,0,1))+O(e,1)))),Nl=e=>ce(H((e&&!xl.test(e[0])?e:" "+e).split(Rl),"_")),Dl=e=>`/** ${e}. */`,Ll=(...e)=>H(J(e,(e=>e)),", "),Gl=(...e)=>"{"+H(e,"; ")+"}",jl=(...e)=>Gl(...M(e,(e=>"readonly "+e))),Hl=()=>{const e=[de(),de(),de(),de()],l=de(),a=de(),n=e=>{const l=e.indexOf(" as ");return-1!=l?O(e,l+4):e};return[(...e)=>H(Ol(e),"\n"),(l,t,...a)=>j(a,(a=>j([0,1],(n=>(l??n)==n?Vl($e(e[n],t,vl),a):0)))),(e,a,n,d=t,o=1)=>Sl(l,e,[a,n,d,o]),(e,l,t)=>Sl(a,e,P(t)?[`(${l}) => {`,t,"}"]:[`(${l}) => ${t}`]),(e,l)=>oe(a,e)===l?e:Sl(a,e,l),(l=0)=>M([...G(re(e[l],((e,l)=>`import {${H(G(te(e),((e,l)=>n(e)>n(l)?1:-1)),", ")}} from '${l}';`)),((e,l)=>kl(e)!=kl(l)?kl(e)?-1:1:e>l?1:-1)),t],(e=>e.replace("{React}","React"))),()=>re(l,(([e,l,a,n],d)=>[Dl(l),`${n?ve+" ":t}type ${d}${a} = ${e};`,t])),()=>re(a,((e,l)=>(e=P(e)?e:[e],z(e,W(e)+";"),[`const ${l} = ${F(e)}`,e,t])))]},Ml=(e,l)=>{const t=new WeakMap;return l=>(t.has(l)||t.set(l,e(l)),t.get(l))},Jl=(e,l,t)=>[l=>X(e,((e,a)=>l(a,El(a,1),t(Nl(a),`'${a}'`)))),(l,a)=>X(e[l],((e,l)=>a(l,e[s],e[r],t(Nl(l),`'${l}'`),El(l,1)))),e=>X(l,((l,a)=>e(a,l[s],l[r],t(Nl(a),`'${a}'`),El(a,1))))],zl=(e,l,a,n)=>[(n,d)=>{const o=n+": "+d,s=e(p,Gl(...l((e=>`'${e}'?: {[rowId: Id]: `+Gl(...a(e,((e,l,a)=>`'${e}'${R(a)?"?":t}: ${l}`)))+"}"))),ol(1,5)),r=e(p+Ke,Gl(...l((e=>`'${e}'?: {[rowId: Id]: `+Gl(...a(e,((e,l)=>`'${e}'?: ${l}`)))+"}"))),ol(1,5,1)),$=e(b+Ve,"keyof "+s,"A "+b+" Id in "+ze),c=`<TId extends ${$}>`,i=e(b,Pe+`<${s}[TId]>`,"A "+b+" in "+ze,c),T=e(b+Ke,Pe+`<${r}[TId]>`,"A "+b+" in "+ze+Xe,c),y=e(h,i+"<TId>[Id]","A "+h+" in a "+b,c),v=e(h+Ke,T+"<TId>[Id]","A "+h+" in a "+b+Xe,c),V=e(w+Ve,`Extract<keyof ${y}<TId>, Id>`,"A "+w+" Id in a "+h,c),x=e(w,Pe+`<${s}[TId]>[Id][CId]`,"A "+w+" in a "+h,`<TId extends ${$}, CId extends ${V}<TId>>`),A=e("CellIdCellArray",`CId extends ${V}<TId> ? [cellId: CId, cell: ${x}<TId, CId>] : never`,w+" Ids and types in a "+h,`<TId extends ${$}, CId = ${V}<TId>>`,0),k=e(w+Ce,`(...[cellId, cell]: ${A}<TId>)`+qe,cl(ie+w+" Id, and "+w),c),S=e(h+Ce,"(rowId: Id, forEachCell: (cellCallback: CellCallback<TId>) "+qe+") "+qe,cl(ie+h+" Id, and a "+w+" iterator"),c),P=e(b+w+Ce,`(cellId: ${V}<TId>, count: number) `+qe,cl(ie+w+" Id, and count of how many times it appears"),c),O=e("TableIdForEachRowArray",`TId extends ${$} ? [tableId: TId, forEachRow: (rowCallback: ${S}<TId>)${qe}] : never`,b+" Ids and callback types",`<TId = ${$}>`,0),E=e(b+Ce,`(...[tableId, forEachRow]: ${O})`+qe,cl(ie+b+" Id, and a "+h+" iterator"),t),N=e("TableIdRowIdCellIdArray",`TId extends ${$} ? [tableId: TId, rowId: Id, cellId: ${V}<TId>] : never`,"Ids for GetCellChange",`<TId = ${$}>`,0),D=e("GetCellChange",`(...[tableId, rowId, cellId]: ${N}) => CellChange`,be+" returning information about any Cell's changes during a "+Be),L=e(u+p+I,`(${o}, hasTables: boolean)`+qe,ul(1,0,1)),G=e(p+I,`(${o}, getCellChange: ${D}${Se})`+qe,ul(1)),j=e(C+I,`(${o})`+qe,ul(2)),H=e(u+b+I,`(${o}, tableId: ${$}, hasTable: boolean)`+qe,ul(3,0,1)),M=e(b+I,`(${o}, tableId: ${$}, getCellChange: ${D}${Se})`+qe,ul(3)),J=e(b+f+I,`(${o}, tableId: ${$})`+qe,ul(14,3)),z=e("HasTableCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,"Cell args for HasTableCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),W=e("HasTableCellListenerArgsArrayOuter",`TId extends ${$} ? `+z+"<TId> : never","Table args for HasTableCellListener",`<TId = ${$}>`,0),B=e(u+b+w+I,`(...[${n}, tableId, cellId, hasTableCell]: `+W+")"+qe,ul(16,3,1)),F=e(h+"Count"+I,`(${o}, tableId: ${$})`+qe,ul(15,3)),U=e(m+I,`(${o}, tableId: ${$})`+qe,ul(4,3)),_=e(g+I,"("+Ll(o,"tableId: "+$,"cellId: Id"+Se,"descending: boolean","offset: number","limit: number"+Se,"sortedRowIds: Ids")+")"+qe,ul(13,3)),Z=e(u+h+I,"("+Ll(""+o,"tableId: "+$,Ge,"hasRow: boolean")+")"+qe,ul(5,3,1)),Q=e(h+I,"("+Ll(""+o,"tableId: "+$,Ge,`getCellChange: ${D}${Se}`)+")"+qe,ul(5,3)),q=e(f+I,"("+Ll(""+o,"tableId: "+$,Ge)+")"+qe,ul(6,5)),K=e("HasCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${Ge}, cellId: CId, hasCell: boolean] : never`,"Cell args for HasCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),X=e("HasCellListenerArgsArrayOuter",`TId extends ${$} ? `+K+"<TId> : never","Table args for HasCellListener",`<TId = ${$}>`,0),Y=e(u+w+I,`(...[${n}, tableId, rowId, cellId, hasCell]: `+X+")"+qe,ul(7,5,1)),ee=e("CellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${Ge}, cellId: CId, newCell: ${x}<TId, CId> ${Se}, oldCell: ${x}<TId, CId> ${Se}, getCellChange: ${D} ${Se}] : never`,"Cell args for CellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),le=e("CellListenerArgsArrayOuter",`TId extends ${$} ? `+ee+"<TId> : never","Table args for CellListener",`<TId = ${$}>`,0);return[s,r,$,i,T,y,v,V,x,k,S,P,E,L,G,j,H,M,J,B,F,U,_,Z,Q,q,Y,e(w+I,`(...[${n}, tableId, rowId, cellId, newCell, oldCell, getCellChange]: ${le})`+qe,ul(7,5)),e(xe+w+I,`(${o}, tableId: Id, ${Ge}, cellId: Id, invalidCells: any[])`+qe,ul(8))]},(l,a)=>{const d=l+": "+a,o=e(y,Gl(...n(((e,l,a)=>`'${e}'${R(a)?"?":t}: ${l}`))),ol(2,5)),s=e(y+Ke,Gl(...n(((e,l)=>`'${e}'?: ${l}`))),ol(2,5,1)),r=e(T+Ve,"keyof "+o,"A "+T+" Id in "+ze),$=e(T,Pe+`<${o}[VId]>`,"A "+T+" Id in "+ze,`<VId extends ${r}>`),c=e("ValueIdValueArray",`VId extends ${r} ? [valueId: VId, value: ${$}<VId>] : never`,T+" Ids and types in "+ze,`<VId = ${r}>`,0),i=e(T+Ce,`(...[valueId, value]: ${c})`+qe,cl(ie+T+" Id, and "+T)),b=e("GetValueChange",`(valueId: ${r}) => ValueChange`,be+" returning information about any Value's changes during a "+Be),p=e(u+y+I,`(${d}, hasValues: boolean)`+qe,ul(9,0,1)),C=e(y+I,`(${d}, getValueChange: ${b}${Se})`+qe,ul(9)),h=e(v+I,`(${d})`+qe,ul(10)),m=e(u+T+I,`(${d}, valueId: ValueId, hasValue: boolean)`+qe,ul(11,0,1)),g=e("ValueListenerArgsArray",`VId extends ${r} ? [${d}, valueId: VId, newValue: ${$}<VId> ${Se}, oldValue: ${$}<VId> ${Se}, getValueChange: ${b} ${Se}] : never`,"Value args for ValueListener",`<VId = ${r}>`,0);return[o,s,r,$,i,p,C,h,m,e(T+I,`(...[${l}, valueId, newValue, oldValue, getValueChange]: `+g+")"+qe,ul(11)),e(xe+T+I,`(${d}, valueId: Id, invalidValues: any[])`+qe,ul(12))]},(l,t)=>e(We+I,`(${l}: ${t})`+qe,be+" listening to the completion of a "+Be)],Wl=(e,l=t,a=t)=>`store.${e}(${l})`+(a?" as "+a:t),Bl=(e,l=t)=>`fluent(() => ${Wl(e,l)})`,Fl=(e,l=t,a=t)=>`store.${e}(${l?l+", ":t}proxy(listener)${a?", "+a:t})`,Ul=(e,a,n)=>{const[o,$,V,x,A,k,P,O]=Hl(),[E,N,D]=Jl(e,a,A),[L,G,M]=zl(V,E,N,D),J=de(),W=(e=0)=>re(J,(([l,a,n,d,o],s)=>{const r=e?[s+`: ${o}(${l}): ${a} => ${n},`]:[s+o+`(${l}): ${a};`];return e||B(r,Dl(d)),z(r,t),r})),F=(e,l,a,n,d,o=t)=>Sl(J,e,[l,a,n,d,o]),U=(e,l,a,n,d,o=t,s=t,r=t)=>F(fl[e]+l+(4==e?Oe:t)+a,o,n,(n==Q?Bl:Wl)(fl[e]+(4==e?Oe:t)+a,s,e?void 0:n),d,r),_=(e,l,a,n=t,d=t,o=1,s=t)=>F(c+e+I,(n?n+", ":t)+Ae+": "+l+(o?", mutator?: boolean":t),Ve,Fl(c+e+I,d,o?"mutator":t),a,s),Z=`./${El(n)}.d`,Q=El(n,1),q=El(Q),K=[],X=de();let Y=[],le=[];if($(1,Z,Q,`create${Q} as create${Q}Decl`),ee(e))$(null,l,p);else{$(0,l,"CellChange"),$(null,l,i);const[e,a,n,o,I,c,T,y,v,x,k,P,O,D,G,M,J,W,B,F,ee,le,ae,ne,se,re,$e,ce,ue]=L(q,Q),ie=de();E(((e,l)=>{const t=`<'${e}'>`,a=[V(l+b,o+t,Le+` the '${e}' `+b),V(l+b+Ke,I+t,Le+` the '${e}' `+b+Xe),V(l+h,c+t,sl(e)),V(l+h+Ke,T+t,sl(e,1)),V(l+w+Ve,y+t,`A Cell Id for the '${e}' `+b),V(l+w+Ce,x+t,cl(`a Cell Id and value from a Row in the '${e}' `+b)),V(l+h+Ce,k+t,cl(`a Row Id from the '${e}' Table, and a Cell iterator`)),V(l+b+w+Ce,P+t,cl(`a Cell Id from anywhere in the '${e}' Table, and a count of how many times it appears`))];Ie(ie,e,a),$(1,Z,...a)})),$(1,Z,e,a,n,y,O,D,G,M,J,W,B,F,ee,le,ae,ne,se,re,$e,ce,ue),Y=[e,a,n,y,D,G,M,J,W,B,F,ee,le,ae,ne,se,re,$e,ce,ie],j([[e],[d],[Q,"tables: "+a,"tables"],[Q]],(([e,l,a],n)=>U(n,t,p,e,ol(1,n),l,a))),U(0,t,C,n+Je,rl(b,ze)),U(5,t,b,Qe,Il(b,ze),"tableCallback: "+O,"tableCallback as any"),E(((e,l,a)=>{const[n,o,s,r,I,$,c,u]=oe(ie,e);j([[n],[d],[Q,"table: "+o,", table"],[Q]],(([n,d,o=t],s)=>U(s,l,b,n,Cl(e,s),d,a+o))),U(0,l,b+f,i,rl(w,"the whole of "+bl(e)),t,a),U(5,l,b+w,Qe,Il(b+w,"the whole of "+bl(e)),"tableCellCallback: "+u,a+", tableCellCallback as any"),U(0,l,h+me,"number","Gets the number of Rows in the "+bl(e),t,a),U(0,l,m,i,rl(h,bl(e)),t,a),U(0,l,g,i,rl(h,bl(e),1),"cellId?: "+I+Me,a+", cellId, descending, offset, limit"),U(5,l,h,Qe,Il(h,bl(e)),"rowCallback: "+c,a+", rowCallback as any"),j([[s],[d],[Q,", row: "+r,", row"],[Q],[Q,", partialRow: "+r,", partialRow"]],(([n,d=t,o=t],s)=>U(s,l,h,n,hl(e,s),Ge+d,a+", rowId"+o))),U(6,l,h,Ve+Se,"Add a new Row to "+bl(e),"row: "+r+", reuseIds?: boolean",a+", row, reuseIds"),U(0,l,f,I+Je,rl(w,pl(e)),Ge,a+", rowId"),U(5,l,w,Qe,Il(w,pl(e)),Ge+", cellCallback: "+$,a+", rowId, cellCallback as any"),N(e,((n,o,s,r,I)=>{const $="Map"+El(o,1);Ie(X,o,$);const c=o+(R(s)?Se:t);j([[c],[d],[Q,`, cell: ${o} | `+$,", cell as any"],[Q]],(([d,o=t,s=t],$)=>U($,l+I,w,d,ml(e,n,$),Ge+o,a+", rowId, "+r+s))),U(1,l+I,b+w,d,wl[1]+` the '${n}' Cell anywhere in `+bl(e),t,a+", "+r)}))})),U(0,t,p+Re,Re,ol(1,6)),U(2,t,p+Re,Q,ol(1,7),"tablesJson: "+Re,"tables"+Re),_(u+p,D,ol(1,8,0,1)+" changes"),_(p,G,ol(1,8)+" changes"),_(C,M,il(2,0,1)),_(u+b,J,il(3,0,0,1),`tableId: ${n} | null`,"tableId"),_(b,W,il(3,0),`tableId: ${n} | null`,"tableId"),_(b+f,B,il(14,3,1),`tableId: ${n} | null`,"tableId"),_(u+b+w,F,il(16,3,0,1),`tableId: ${n} | null, cellId: ${H(E((e=>oe(ie,e)?.[4]??t))," | ")} | null`,"tableId, cellId"),_(h+me,ee,il(15,3),`tableId: ${n} | null`,"tableId"),_(m,le,il(4,3,1),`tableId: ${n} | null`,"tableId"),_(g,ae,il(13,3,1),Ll("tableId: TId",`cellId: ${y}<TId>`+Se,"descending: boolean","offset: number","limit: number"+Se),Ll("tableId","cellId","descending","offset","limit"),1,"<TId extends TableId>"),_(u+h,ne,il(5,3,0,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(h,se,il(5,3),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(f,re,il(6,5,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(u+w,$e,il(7,5,0,1),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${H(E((e=>oe(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),_(w,ce,il(7,5),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${H(E((e=>oe(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),_(xe+w,ue,De+" whenever an invalid Cell change was attempted","tableId: IdOrNull, rowId: IdOrNull, cellId: IdOrNull","tableId, rowId, cellId"),$(1,Z,...te(X)),z(K,".set"+p+je+"({",Ol(E(((e,l,a)=>[`[${a}]: {`,...N(e,((e,l,a,n)=>`[${n}]: {[${A(Nl(s),`'${s}'`)}]: ${A(Nl(l),`'${l}'`)}${R(a)?t:`, [${A(Nl(r),`'${r}'`)}]: `+(S(a)?A(Nl(a),`'${a}'`):a)}},`)),"},"]))),"})")}if(ee(a))$(null,l,y);else{const[e,a,n,o,I,c,i,b,p,C,h]=G(q,Q);$(1,Z,e,a,n,I,c,i,b,p,C,h),le=[e,a,n,c,i,b,p,C],j([[e],[d],[Q,"values: "+a,"values"],[Q],[Q,"partialValues: "+a,"partialValues"]],(([e,l,a],n)=>U(n,t,y,e,ol(2,n),l,a))),U(0,t,v,n+Je,rl(T,ze)),U(5,t,T,"void",Il(T,ze),"valueCallback: "+I,"valueCallback as any"),D(((e,l,a,n,o)=>{const s="Map"+El(l,1);Ie(X,l,s),j([[l],[d],[Q,`value: ${l} | `+s,", value as any"],[Q]],(([l,a,d=t],s)=>U(s,o,T,l,gl(e,s),a,n+d)))})),U(0,t,y+Re,Re,ol(2,6)),U(2,t,y+Re,Q,ol(2,7),"valuesJson: "+Re,"values"+Re),_(u+y,c,ol(2,8,0,1)+" changes"),_(y,i,ol(2,8)+" changes"),_(v,b,il(10,0,1)),_(u+T,p,il(11,0,0,1),`valueId: ${n} | null`,"valueId"),_(T,C,il(11,0),`valueId: ${n} | null`,"valueId"),_(xe+T,h,De+" whenever an invalid Value change was attempted","valueId: IdOrNull","valueId"),$(1,Z,...te(X)),$(0,l,"ValueChange"),z(K,".set"+y+je+"({",D(((e,l,a,n)=>[`[${n}]: {[${A(Nl(s),`'${s}'`)}]: ${A(Nl(l),`'${l}'`)}${R(a)?t:`, [${A(Nl(r),`'${r}'`)}]: `+(S(a)?A(Nl(a),`'${a}'`):a)}},`])),"})")}U(0,t,"Content",`[${p}, ${y}]`,ol(0,0)),U(2,t,"Content",Q,ol(0,2),`[tables, values]: [${p}, ${y}]`,"[tables, values]"),U(7,t,"applyChanges",Q,`Applies a set of ${he} to the Store`,"changes: "+he,"changes"),se(X,((e,l)=>V(l,`(cell: ${e}${Se}) => `+e,`Takes a ${e} Cell value and returns another`))),$(null,l,"DoRollback",Ve,"IdOrNull",Re,"Store",he),U(0,t,Re,Re,ol(0,6)),U(2,t,Re,Q,ol(0,7),"tablesAndValuesJson: "+Re,"tablesAndValuesJson"),U(7,t,Be,"Return",Fe,ye,"actions, doRollback","<Return>"),U(7,t,"start"+We,Q,Ue),U(7,t,"finish"+We,Q,_e,Te,"doRollback");const ae=M(q,Q);return _("Start"+We,ae,De+" just before the start of the "+Be,t,t,0),_("WillFinish"+We,ae,De+" just before "+Ze,t,t,0),_("DidFinish"+We,ae,De+" just after "+Ze,t,t,0),U(7,t,"call"+I,Q,"Manually provoke a listener to be called","listenerId: Id","listenerId"),U(3,t,I,Q,"Remove a listener that was previously added to "+ze,"listenerId: Id","listenerId"),F("getStore",t,"Store","store",wl[0]+" the underlying Store object"),$(1,l,"createStore"),$(1,Z,Q,`create${Q} as create${Q}Decl`,ae),A("store",["createStore()",...K]),x("fluent","actions: () => Store",["actions();",`return ${q};`]),x("proxy","listener: any",`(_: Store, ...params: any[]) => listener(${q}, ...params)`),A(q,["{",...W(1),"}"]),[o(...k(0),...P(),ve+" interface "+Q+" {",...W(0),"}",t,Dl(`Creates a ${Q} object`),ve+" function create"+Q+"(): "+Q+";"),o(...k(1),ve+" const create"+Q+": typeof create"+Q+"Decl = () => {",...O(),`return Object.freeze(${q});`,"};"),Y,le]},_l=e=>$+e,Zl=e=>Ll(_l(e),_l(e)+we),Ql="debugIds?: boolean",ql="debugIds={debugIds}",Kl="then"+fe,Xl="Parameter",Yl=": (parameter: "+Xl+", store: Store) => ",et="const contextValue = useContext(Context);",lt=", based on a parameter",tt=": ",at="<"+Xl+",>",nt=Xl+"ized"+Ce+"<"+Xl+">",dt="rowId",ot="rowId={rowId}",st=", separator, debugIds",rt="separator?: ReactElement | string",It="then?: (store: Store",$t=Ll(It+")"+qe,Kl),ct="then, then"+we,ut=dt+tt+Ve,it="View",bt=(e,...l)=>Ll(...l,Ae+": "+e,Ae+fe,"mutator?: boolean"),pt=(...e)=>Ll(...e,Ae,Ae+we,"mutator"),Ct=(e,a,n,s,r)=>{const[$,c,V,x,A,k,S,P]=Hl(),[O,E,N]=Jl(e,a,A),D=`./${El(n)}.d`,L=`./${El(n)}-ui-react.d`,G="tinybase/ui-react",j=El(n,1),M=El(j),J=j+"Or"+j+Ve,W=M+"Or"+j+Ve,F=M+`={${M}}`,U=de(),_=(e,l,a,n,d,o=t)=>(c(1,L,e+" as "+e+"Decl"),Sl(U,e,[l,a,n,d,o])),Z=(e,l,a,n,d,o=t)=>_("use"+e,l,a,n,d,o),Q=(e,l,a,n,d=t,o=t,s=t,r=t,I=t)=>(c(1,G,`use${l} as use${l}Core`),Z(e,Ll(d,le,r),a,ae+`(${W}, use${l}Core, [`+(o||t)+(I?"], ["+I:t)+"]);",n,s)),q=(e,l,t,a)=>_(e,l,1,t,a),K=(e=0)=>re(U,(([l,a,n,d,o],s)=>{const r=e?[ve+` const ${s}: typeof ${s}Decl = ${o}(${l}): ${1==a?"any":a} =>`,n]:[ve+` function ${s}${o}(${l}): ${1==a?"ComponentReturnType":a};`];return e||B(r,Dl(d)),z(r,t),r}));c(null,l,Ve,"Store",Ce,Xl+"ized"+Ce),c(0,G,"ComponentReturnType"),c(1,G,"useCellIds"),c(null,G,"ExtraProps"),c(0,D,j);const X=V(J,j+" | "+Ve,`Used when you need to refer to a ${j} in a React hook or component`),Y=V(Ne+Ee,jl(M+ke+j,M+`ById?: {[${M}Id: Id]: ${j}}`),`Used with the ${Ne} component, so that a `+j+" can be passed into the context of an application");c(0,"react","ReactElement","ComponentType"),c(1,"react","React"),c(1,L,X,Y);const le=W+ke+X;A("{createContext, useContext, useMemo}","React"),A("Context",`createContext<[${j}?, {[${M}Id: Id]: ${j}}?]>([])`),Z("Create"+j,`create: () => ${j}, create`+fe,j,"\n// eslint-disable-next-line react-hooks/exhaustive-deps\nuseMemo(create, createDeps)",`Create a ${j} within a React application with convenient memoization`);const te=Z(j,"id?: Id",j+Se,["{",et,"return id == null ? contextValue[0] : contextValue[1]?.[id];","}"],`Get a reference to a ${j} from within a ${Ne} component context`),ae=x("useHook",W+`: ${X} | undefined, hook: (...params: any[]) => any, preParams: any[], postParams: any[] = []`,[`const ${M} = ${te}(${W} as Id);`,`return hook(...preParams, ((${W} == null || typeof ${W} == 'string')`,`? ${M} : ${W})?.getStore(), ...postParams)`]),ne=x("getProps","getProps: ((id: any) => ExtraProps) | undefined, id: Id","(getProps == null) ? ({} as ExtraProps) : getProps(id)"),se=x("wrap",Ll("children: any","separator?: any","encloseWithId?: boolean","id?: Id"),["const separated = separator==null || !Array.isArray(children)"," ? children"," : children.map((child, c) => (c > 0 ? [separator, child] : child));","return encloseWithId ? [id, ':{', separated, '}'] : separated;"]),Ie=x("useCustomOrDefaultCellIds",Ll("customCellIds: Ids | undefined","tableId: Id","rowId: Id",`${W}?: ${X} | undefined`),[`const defaultCellIds = ${ae}(${W}, useCellIds, [tableId, rowId]);`,"return customCellIds ?? defaultCellIds;"]),$e=A("NullComponent","() => null");if(!ee(e)){const[e,a,n,r,$,T,y,v,A,k,S,P,N,G,J,z,W,B,U,_]=s;c(null,D,e,a,n,$,T,y,v,A,k,S,P,N,G,J,z,W,U,B),c(0,D,r),c(1,D,j),c(null,l,i,"IdOrNull");const Z=x("tableView",`{${M}, rowComponent, getRowComponentProps, customCellIds`+st+"}: any, rowIds: Ids, tableId: Id, defaultRowComponent: React.ComponentType<any>",["const Row = rowComponent ?? defaultRowComponent;",`return ${se}(rowIds.map((rowId) => (`,"<Row","{..."+ne+"(getRowComponentProps, rowId)}","key={rowId}","tableId={tableId}",ot,"customCellIds={customCellIds}",F,ql,"/>","))",st,", tableId,",");"]),K=x("getDefaultTableComponent","tableId: Id",H(O(((e,l,t)=>`tableId == ${t} ? ${l}TableView : `)))+$e),X=x("getDefaultCellComponent","tableId: Id, cellId: Id",H(O(((e,l,t)=>`tableId == ${t} ? ${H(E(e,((e,t,a,n,d)=>`cellId == ${n} ? `+l+d+"CellView : ")))+$e} : `)))+$e);Q(u+p,u+p,d,ol(1,0,0,1)+pe),Q(p,p,e,ol(1,0)+pe);const Y=Q(C,C,n+Je,rl(b,ze)+pe);Q(He+p+Ce,He+p+Ce,nt,ol(1,9)+lt,Ll(_l(p)+Yl+a,_l(p)+fe),Zl(p),at,Ll(It,`tables: ${a})`+qe,Kl),ct),Q(ge+p+Ce,ge+p+Ce,Ce,ol(1,12),t,t,t,$t,ct);const ee=V(w+Ee,jl("tableId?: TId","rowId: Id","cellId?: CId",M+ke+j,Ql),$l(ie+w),`<TId extends ${n}, CId extends ${r}<TId>>`),le=V(h+Ee,jl("tableId?: TId","rowId: Id",M+ke+j,"cellComponents?: {readonly [CId in "+r+`<TId>]?: ComponentType<${ee}<TId, CId>>;}`,`getCellComponentProps?: (cellId: ${r}<TId>) => ExtraProps`,`customCellIds?: ${r}<TId>[]`,rt,Ql),$l(ie+h),`<TId extends ${n}>`),te=V(b+Ee,jl("tableId?: TId",M+ke+j,`rowComponent?: ComponentType<${le}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",rt,Ql),$l(ie+b),`<TId extends ${n}>`),ae=V("Sorted"+b+Ee,jl("tableId?: TId","cellId?: "+r+"<TId>","descending?: boolean","offset?: number","limit?: number",M+ke+j,`rowComponent?: ComponentType<${le}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",rt,Ql),$l(ie+"sorted "+b),`<TId extends ${n}>`),de=V(p+Ee,jl(M+ke+j,"tableComponents?: {readonly [TId in "+n+`]?: ComponentType<${te}<TId>>;}`,`getTableComponentProps?: (tableId: ${n}) => ExtraProps`,rt,Ql),$l(dl(1,1)));c(1,L,de,te,ae,le,ee),q(p+it,"{"+M+", tableComponents, getTableComponentProps"+st+"}: "+de,[se+`(${Y}(${M}).map((tableId) => {`,"const Table = (tableComponents?.[tableId] ?? "+K+"(tableId)) as React.ComponentType<TableProps<typeof tableId>>;","return <Table",`{...${ne}(getTableComponentProps, tableId)}`,"tableId={tableId}","key={tableId}",F,ql,"/>;","}), separator)"],ol(1,13)+pe),O(((e,l,a)=>{const[n,s,r,I,$]=oe(_,e);c(null,D,n,s,r,I,$),Q(u+l+b,u+b,d,Cl(e,0,1)+pe,t,a),Q(l+b,b,n,Cl(e)+pe,t,a),Q(l+b+f,b+f,i,rl(w,"the whole of "+bl(e))+pe,t,a),Q(l+h+me,h+me,o,"Gets the number of Rows in "+bl(e)+pe,t,a);const p=Q(l+m,m,i,rl(h,bl(e))+pe,t,a),C=Q(l+g,g,i,rl(h,bl(e),1)+pe,"cellId?: "+$+", descending?: boolean, offset?: number, limit?: number",a+", cellId, descending, offset, limit");Q(u+l+h,u+h,d,hl(e,0,1)+pe,ut,Ll(a,dt)),Q(l+h,h,r,hl(e)+pe,ut,Ll(a,dt)),Q(l+f,f,$+Je,rl(w,pl(e))+pe,ut,Ll(a,dt)),Q(He+l+b+Ce,He+b+Ce,nt,Cl(e,9)+lt,Ll(_l(b)+Yl+s,_l(b)+fe),Ll(a,Zl(b)),at,Ll(It,`table: ${s})`+qe,Kl),ct),Q(ge+l+b+Ce,ge+b+Ce,Ce,Cl(e,12),t,a,t,$t,ct),Q(He+l+h+Ce,He+h+Ce,nt,hl(e,9)+lt,Ll(ut,_l(h)+Yl+I,_l(h)+fe),Ll(a,dt,Zl(h)),at,Ll(It,`row: ${I})`+qe,Kl),ct),Q("Add"+l+h+Ce,"Add"+h+Ce,nt,hl(e,10)+lt,Ll(_l(h)+Yl+I,_l(h)+fe),Ll(a,Zl(h)),at,"then?: ("+Ll(ut+Se,"store: Store","row: "+I+")"+qe,"then"+fe)+", reuseRowIds?: boolean",ct+", reuseRowIds"),Q(He+l+Oe+h+Ce,He+Oe+h+Ce,nt,hl(e,11)+lt,Ll(ut,_l(Oe+h)+Yl+I,_l(Oe+h)+fe),Ll(a,dt,Zl(Oe+h)),at,Ll(It,`partialRow: ${I})`+qe,Kl),ct),Q(ge+l+h+Ce,ge+h+Ce,Ce,hl(e,12),ut,Ll(a,dt),t,$t,ct);const T=q(l+h+it,"{rowId, "+M+", cellComponents, getCellComponentProps, customCellIds"+st+`}: ${le}<'${e}'>`,[se+`(${Ie}(customCellIds, `+a+`, rowId, ${M}).map((cellId: ${$}) => {`,"const Cell = (cellComponents?.[cellId] ?? "+X+`(${a}, cellId)) as React.ComponentType<CellProps<typeof `+a+", typeof cellId>>;","return <Cell",`{...${ne}(getCellComponentProps, cellId)} `,"key={cellId}",`tableId={${a}}`,ot,"cellId={cellId}",F,ql,"/>;","})"+st+", rowId)"],hl(e,13)+pe);q(l+"Sorted"+b+it,"{cellId, descending, offset, limit, ...props}: "+ae+`<'${e}'>`,Z+"(props, "+C+`(cellId, descending, offset, limit, props.${M}), ${a}, ${T});`,Cl(e,13)+", sorted"+pe),q(l+b+it,`props: ${te}<'${e}'>`,Z+"(props, "+p+`(props.${M}), ${a}, ${T});`,Cl(e,13)+pe),E(e,((n,o,s,r,I)=>{const $="Map"+El(o,1);c(0,D,$),c(1,D,$),Q(u+l+I+b+w,u+b+w,d,`Gets ${nl(1)}the '${n}' Cell anywhere in `+bl(e)+pe,t,Ll(a,r)),Q(u+l+I+w,u+w,d,ml(e,n,0,1)+pe,ut,Ll(a,dt,r));const i=Q(l+I+w,w,o+(R(s)?Se:t),ml(e,n)+pe,ut,Ll(a,dt,r));Q(He+l+I+w+Ce,He+w+Ce,nt,ml(e,n,9)+lt,Ll(ut,_l(w)+Yl+o+" | "+$,_l(w)+fe),Ll(a,dt,r,Zl(w)),at,Ll(It,`cell: ${o} | ${$})`+qe,Kl),ct),Q(ge+l+I+w+Ce,ge+w+Ce,Ce,ml(e,n,12),Ll(ut,"forceDel?: boolean"),Ll(a,dt,r,"forceDel"),t,$t,ct),q(l+I+w+it,`{rowId, ${M}, debugIds}: `+ee+`<'${e}', '${n}'>`,[se+`('' + ${i}(rowId, `+M+`) ?? '', undefined, debugIds, ${r})`],ml(e,n,13)+pe)}))}));const re=H(O((e=>oe(_,e)?.[4]??t))," | ");Q(u+p+I,u+p+I,Qe,ol(1,8,0,1)+" changes",bt($),pt()),Q(p+I,p+I,Qe,ol(1,8)+" changes",bt(T),pt()),Q(C+I,C+I,Qe,il(2,0,1),bt(y),pt()),Q(u+b+I,u+b+I,Qe,il(3,0,0,1),bt(v,`tableId: ${n} | null`),pt("tableId")),Q(b+I,b+I,Qe,il(3,0),bt(A,`tableId: ${n} | null`),pt("tableId")),Q(b+f+I,b+f+I,Qe,il(14,3,1),bt(k,`tableId: ${n} | null`),pt("tableId")),Q(u+b+w+I,u+b+w+I,Qe,il(16,3,0,1),bt(S,`tableId: ${n} | null`,`cellId: ${re} | null`),pt("tableId","cellId")),Q(h+me+I,h+me+I,Qe,il(15,3),bt(P,`tableId: ${n} | null`),pt("tableId")),Q(m+I,m+I,Qe,il(4,3,1),bt(N,`tableId: ${n} | null`),pt("tableId")),Q(g+I,g+I,Qe,il(13,3,1),bt(G,`tableId: ${n} | null`,"cellId: "+re+Se,"descending: boolean","offset: number","limit: number"+Se),pt("tableId","cellId","descending","offset","limit")),Q(u+h+I,u+h+I,Qe,il(5,3,0,1),bt(J,`tableId: ${n} | null`,dt+": IdOrNull"),pt("tableId",dt)),Q(h+I,h+I,Qe,il(5,3),bt(z,`tableId: ${n} | null`,dt+": IdOrNull"),pt("tableId",dt)),Q(f+I,f+I,Qe,il(6,5,1),bt(W,`tableId: ${n} | null`,dt+": IdOrNull"),pt("tableId",dt)),Q(u+w+I,u+w+I,Qe,il(7,5,0,1),bt(B,`tableId: ${n} | null`,dt+": IdOrNull",`cellId: ${re} | null`),pt("tableId",dt,"cellId")),Q(w+I,w+I,Qe,il(7,5),bt(U,`tableId: ${n} | null`,dt+": IdOrNull",`cellId: ${re} | null`),pt("tableId",dt,"cellId"))}if(!ee(a)){const[e,l,a,n,o,s,$,i]=r;c(null,D,...r),c(1,D,j);const b=x("getDefaultValueComponent","valueId: Id",H(N(((e,l,t,a,n)=>`valueId == ${a} ? `+n+"ValueView : ")))+$e);Q(u+y,u+y,d,ol(2,0,0,1)+pe),Q(y,y,e,ol(2,0)+pe);const p=Q(v,v,a+Je,rl(T,ze)+pe);Q(He+y+Ce,He+y+Ce,nt,ol(2,9)+lt,Ll(_l(y)+Yl+l,_l(y)+fe),Zl(y),at,Ll(It,`values: ${l})`+qe,Kl),ct),Q(He+Oe+y+Ce,He+Oe+y+Ce,nt,ol(2,11)+lt,Ll(_l(Oe+y)+Yl+l,_l(Oe+y)+fe),Zl(Oe+y),at,Ll(It,`partialValues: ${l})`+qe,Kl),ct),Q(ge+y+Ce,ge+y+Ce,Ce,ol(2,12),t,t,t,$t,ct);const C=V(T+Ee,jl("valueId?: VId",M+ke+j,Ql),$l("a Value"),`<VId extends ${a}>`),h=V(y+Ee,jl(M+ke+j,"valueComponents?: {readonly [VId in "+a+`]?: ComponentType<${C}<VId>>;}`,`getValueComponentProps?: (valueId: ${a}) => ExtraProps`,rt,Ql),$l(dl(2,1)));c(1,L,h,C),q(y+it,"{"+M+", valueComponents, getValueComponentProps"+st+"}: "+h,[se+`(${p}(${M}).map((valueId) => {`,"const Value = valueComponents?.[valueId] ?? "+b+"(valueId);","return <Value",`{...${ne}(getValueComponentProps, valueId)}`,"key={valueId}",F,ql,"/>;","}), separator)"],ol(2,13)+pe),N(((e,l,a,n,o)=>{const s="Map"+El(l,1);c(0,D,s),c(1,D,s),Q(u+o+T,u+T,d,gl(e,0,1)+pe,t,n);const r=Q(o+T,T,l,gl(e)+pe,t,n);Q(He+o+T+Ce,He+T+Ce,nt,gl(e,9)+lt,Ll(_l(T)+Yl+l+" | "+s,_l(T)+fe),Ll(n,Zl(T)),at,Ll(It,`value: ${l} | ${s})`+qe,Kl),ct),Q(ge+o+T+Ce,ge+T+Ce,Ce,gl(e,12),t,n,t,$t,ct),q(o+T+it,`{${M}, debugIds}: ${C}<'${e}'>`,[se+`('' + ${r}(`+M+`) ?? '', undefined, debugIds, ${n})`],gl(e,13)+pe)})),Q(u+y+I,u+y+I,Qe,ol(2,8,0,1)+" changes",bt(n),pt()),Q(y+I,y+I,Qe,ol(2,8)+" changes",bt(o),pt()),Q(v+I,v+I,Qe,il(10,0,1),bt(s),pt()),Q(u+T+I,u+T+I,Qe,il(11,0,0,1),bt($,`valueId: ${a} | null`),pt("valueId")),Q(T+I,T+I,Qe,il(11,0),bt(i,`valueId: ${a} | null`),pt("valueId"))}return q(Ne,`{${M}, ${M}ById, children}: `+Y+" & {readonly children: React.ReactNode}",["{",et,"return (","<Context."+Ne,"value={useMemo(",`() => [${M} ?? contextValue[0], {...contextValue[1], ...${M}ById}],`,`[${M}, ${M}ById, contextValue],`,")}>","{children}",`</Context.${Ne}>`,");","}"],"Wraps part of an application in a context that provides default objects to be used by hooks and components within"),[$(...k(0),...S(),...K(0)),$(...k(1),...P(),...K(1))]},ht=(e,l,a)=>{if(ee(e)&&ee(l))return[t,t,t,t];const[n,d,o,s]=Ul(e,l,a);return[n,d,...Ct(e,l,a,o,s)]},mt=JSON.parse,gt="prettier/",wt=gt+"plugins/",ft={parser:"typescript",singleQuote:!0,trailingComma:"all",bracketSpacing:!1,jsdocSingleLineComment:!1},Tt=Ml((e=>{const l=()=>{const l=mt(e.getTablesSchemaJson());return!ee(l)||L(e.getTableIds(),(t=>{const a=e.getRowIds(t),n=de();if(L(a,(l=>L(e.getCellIds(t,l),(a=>{const d=e.getCell(t,l,a),o=$e(n,a,(()=>[D(d),de(),[0],0])),[s,r,[I]]=o,$=$e(r,d,(()=>0))+1;return $>I&&(o[2]=[$,d]),Ie(r,d,$),o[3]++,s==D(d)})))))return l[t]={},ae(n,(([e,,[,n],d],o)=>{l[t][o]={[s]:e,...d==E(a)?{[r]:n}:{}}})),1}))?l:{}},t=()=>{const l=mt(e.getValuesSchemaJson());return ee(l)&&e.forEachValue(((e,t)=>{l[e]={[s]:D(t)}})),l},a=e=>ht(l(),t(),e),n=async e=>{const l=["d.ts","ts","d.ts","tsx"],t=[];let n;try{n=(await import(gt+"standalone")).format,z(t,await import(wt+"estree"),await import(wt+"typescript"))}catch{n=async e=>e}return await N(M(a(e),(async(e,a)=>Pl(await n(e,{...ft,plugins:t,filepath:"_."+l[a]})))))};return K({getStoreStats:l=>{let t=0,a=0,n=0;const d={};return e.forEachTable(((e,o)=>{t++;let s=0,r=0;const I={};o(((e,t)=>{s++;let a=0;t((()=>a++)),r+=a,l&&(I[e]={rowCells:a})})),a+=s,n+=r,l&&(d[e]={tableRows:s,tableCells:r,rows:I})})),{totalTables:t,totalRows:a,totalCells:n,totalValues:E(e.getValueIds()),jsonLength:E(e.getJson()),...l?{detail:{tables:d}}:{}}},getStoreTablesSchema:l,getStoreValuesSchema:t,getStoreApi:a,getPrettyStoreApi:n,getStore:()=>e})}));exports.createTools=Tt;
|
|
1
|
+
"use strict";const e=e=>typeof e,l="tinybase",t="",a=",",n=e(t),d=e(!0),o=e(0),s="type",r="default",I="Listener",$="get",c="add",u="Has",i="Ids",b="Table",p=b+"s",C=b+i,h="Row",m=h+i,g="Sorted"+h+i,w="Cell",f=w+i,T="Value",y=T+"s",v=T+i,V="Transaction",x="Partial",R=(e,l=t,a)=>e.split(l,a),A=Promise,k=isFinite,S=e=>null==e,P=(e,l,t)=>S(e)?t?.():l(e),O=e=>e==n||e==d,E=l=>e(l)==n,N=e=>Array.isArray(e),D=(e,l,t)=>e.slice(l,t),L=e=>e.length,G=async e=>A.all(e),j=l=>{const t=e(l);return O(t)||t==o&&k(l)?t:void 0},H=(e,l)=>e.every(l),M=(e,l)=>e.sort(l),J=(e,l)=>e.forEach(l),z=(e,l=t)=>e.join(l),W=(e,l)=>e.map(l),B=(e,l)=>e.filter(l),F=(e,...l)=>e.push(...l),U=e=>e.pop(),_=(e,...l)=>e.unshift(...l),Z=e=>e.shift(),Q=Object,q=e=>Q.getPrototypeOf(e),K=Q.entries,X=e=>!S(e)&&P(q(e),(e=>e==Q.prototype||S(q(e))),(()=>!0)),Y=Q.keys,ee=Q.freeze,le=(e,l)=>W(K(e),(([e,t])=>l(t,e))),te=e=>L(Y(e)),ae=e=>X(e)&&0==te(e),ne=(e,l)=>e?.has(l)??!1,de=e=>[...e?.values()??[]],oe=(e,l)=>e?.forEach(l),se=(e,l)=>e?.delete(l),re=e=>new Map(e),Ie=(e,l)=>e?.get(l),$e=(e,l)=>oe(e,((e,t)=>l(t,e))),ce=(e,l)=>W([...e?.entries()??[]],(([e,t])=>l(t,e))),ue=(e,l,t)=>S(t)?(se(e,l),e):e?.set(l,t),ie=(e,l,t,a)=>(ne(e,l)||ue(e,l,t()),Ie(e,l)),be=e=>e.toUpperCase(),pe=e=>e.toLowerCase(),Ce="a ",he="A function for",me=", and registers a listener so that any changes to that result will cause a re-render",ge="Callback",we="Changes",fe="Count",Te="Del",ye="Deps",ve=ye+"?: React.DependencyList",Ve="doRollback?: DoRollback",xe="actions: () => Return, "+Ve,Re="export",Ae="Id",ke="Invalid",Se="Json",Pe=pe(I),Oe="?: ",Ee=" | undefined",Ne="NonNullable",De="Props",Le="Provider",Ge=`Registers a ${Pe} that will be called`,je="Represents",He="rowId: "+Ae,Me="Schema",Je="Set",ze=", descending?: boolean, offset?: number, limit?: number",We="[]",Be="the Store",Fe=pe(V),Ue="Execute a "+Fe+" to make multiple mutations",_e="Explicitly starts a "+Fe,Ze="Explicitly finishes a "+Fe,Qe="the end of the "+Fe,qe="void",Ke=" => "+qe,Xe="WhenSet",Ye=" when setting it",el=Ce+"string serialization of",ll=" ",tl="Gets a callback that can ",al="the ",nl=" the schema for",dl=(e=0)=>e?"the existence of ":"",ol=(e=0,l=0,a=0)=>dl(a)+`the ${vl[e]}content of`+(l?ll+Be:t),sl=(e=0,l,a=0,n=0)=>fl[l]+ll+dl(n)+ol(e,1)+(a?" when setting it":t),rl=(e,l=0)=>je+` a Row when ${l?"s":"g"}etting ${ol()} the '${e}' `+b,Il=(e,l,t=0)=>`Gets ${t?"sorted, paginated":"the"} Ids of the ${e}s in `+l,$l=(e,l)=>`Calls a function for each ${e} in `+l,cl=e=>"The props passed to a component that renders "+e,ul=e=>"A function that takes "+e,il=(e,l=0,t=0)=>he+" listening to changes to "+dl(t)+yl[e]+" in "+yl[l],bl=(e,l,a=0,n=0)=>Ge+" whenever "+dl(n)+yl[e]+" in "+yl[l]+" change"+(a?t:"s"),pl=e=>`the '${e}' `+b,Cl=e=>"the specified Row in "+pl(e),hl=(e,l=0,t=0)=>fl[l]+ll+ol(0,0,t)+ll+pl(e),ml=(e,l=0,t=0)=>fl[l]+` ${ol(0,0,t)} `+Cl(e),gl=(e,l,t=0,a=0)=>fl[t]+ll+dl(a)+`the '${l}' Cell for `+Cl(e),wl=(e,l=0,t=0)=>fl[l]+ll+dl(t)+`the '${e}' Value`,fl=["Gets","Checks existence of","Sets","Deletes","Sets part of",je,"Gets "+el,"Sets "+el,Ge+" whenever",tl+"set",tl+"add",tl+"set part of",tl+"delete","Renders","Gets "+el+nl,"Sets"+nl,"Deletes"+nl],Tl=[$,"has","set","del","set","forEach",c,t],yl=[Be,p,al+b+ll+i,Ce+b,al+h+ll+i,Ce+h,al+w+ll+i,Ce+w,"invalid Cell changes",y,al+T+ll+i,Ce+T,"invalid Value changes",al+"sorted "+h+ll+i,al+w+ll+i+" anywhere",al+"number of Rows",Ce+w+" anywhere"],vl=[t,"tabular ","keyed value "],Vl=e=>new Set(N(e)||S(e)?e:[e]),xl=(e,l)=>e?.add(l),Rl=/[^A-Za-z]+/,Al=/[^A-Za-z0-9]+/,kl=/^( *)\/\*\* *(.*?) *\*\/$/gm,Sl=e=>e.includes(a),Pl=(e,l,t,a=1)=>{const n=`${l}${1==a?"":a}`;return ne(e,n)?Pl(e,l,t,a+1):(ue(e,n,t),n)},Ol=e=>e.replace(kl,((e,l,t)=>{const a=77-L(l);return`${l}/**\n${t.replace(RegExp(`([^\\n]{1,${a}})(\\s|$)`,"g"),l+" * $1\n")}${l} */`})),El=e=>e.flat(1e3),Nl=(e,l=0)=>z(W(R(e,Al),((e,t)=>(t>0||l?be:pe)(D(e,0,1))+D(e,1)))),Dl=e=>be(z(R(e&&!Rl.test(e[0])?e:" "+e,Al),"_")),Ll=e=>`/** ${e}. */`,Gl=(...e)=>z(B(e,(e=>e)),", "),jl=(...e)=>"{"+z(e,"; ")+"}",Hl=(...e)=>jl(...W(e,(e=>"readonly "+e))),Ml=()=>{const e=[re(),re(),re(),re()],l=re(),a=re(),n=e=>{const l=e.indexOf(" as ");return-1!=l?D(e,l+4):e};return[(...e)=>z(El(e),"\n"),(l,t,...a)=>J(a,(a=>J([0,1],(n=>(l??n)==n?xl(ie(e[n],t,Vl),a):0)))),(e,a,n,d=t,o=1)=>Pl(l,e,[a,n,d,o]),(e,l,t)=>Pl(a,e,N(t)?[`(${l}) => {`,t,"}"]:[`(${l}) => ${t}`]),(e,l)=>Ie(a,e)===l?e:Pl(a,e,l),(l=0)=>W([...M(ce(e[l],((e,l)=>`import {${z(M(de(e),((e,l)=>n(e)>n(l)?1:-1)),", ")}} from '${l}';`)),((e,l)=>Sl(e)!=Sl(l)?Sl(e)?-1:1:e>l?1:-1)),t],(e=>e.replace("{React}","React"))),()=>ce(l,(([e,l,a,n],d)=>[Ll(l),`${n?Re+" ":t}type ${d}${a} = ${e};`,t])),()=>ce(a,((e,l)=>(e=N(e)?e:[e],F(e,U(e)+";"),[`const ${l} = ${Z(e)}`,e,t])))]},Jl=(e,l)=>{const t=new WeakMap;return l=>(t.has(l)||t.set(l,e(l)),t.get(l))},zl=(e,l,t)=>[l=>le(e,((e,a)=>l(a,Nl(a,1),t(Dl(a),`'${a}'`)))),(l,a)=>le(e[l],((e,l)=>a(l,e[s],e[r],t(Dl(l),`'${l}'`),Nl(l,1)))),e=>le(l,((l,a)=>e(a,l[s],l[r],t(Dl(a),`'${a}'`),Nl(a,1))))],Wl=(e,l,a,n)=>[(n,d)=>{const o=n+": "+d,s=e(p,jl(...l((e=>`'${e}'?: {[rowId: Id]: `+jl(...a(e,((e,l,a)=>`'${e}'${S(a)?"?":t}: ${l}`)))+"}"))),sl(1,5)),r=e(p+Xe,jl(...l((e=>`'${e}'?: {[rowId: Id]: `+jl(...a(e,((e,l)=>`'${e}'?: ${l}`)))+"}"))),sl(1,5,1)),$=e(b+Ae,"keyof "+s,"A "+b+" Id in "+Be),c=`<TId extends ${$}>`,i=e(b,Ne+`<${s}[TId]>`,"A "+b+" in "+Be,c),T=e(b+Xe,Ne+`<${r}[TId]>`,"A "+b+" in "+Be+Ye,c),y=e(h,i+"<TId>[Id]","A "+h+" in a "+b,c),v=e(h+Xe,T+"<TId>[Id]","A "+h+" in a "+b+Ye,c),V=e(w+Ae,`Extract<keyof ${y}<TId>, Id>`,"A "+w+" Id in a "+h,c),x=e(w,Ne+`<${s}[TId]>[Id][CId]`,"A "+w+" in a "+h,`<TId extends ${$}, CId extends ${V}<TId>>`),R=e("CellIdCellArray",`CId extends ${V}<TId> ? [cellId: CId, cell: ${x}<TId, CId>] : never`,w+" Ids and types in a "+h,`<TId extends ${$}, CId = ${V}<TId>>`,0),A=e(w+ge,`(...[cellId, cell]: ${R}<TId>)`+Ke,ul(Ce+w+" Id, and "+w),c),k=e(h+ge,"(rowId: Id, forEachCell: (cellCallback: CellCallback<TId>) "+Ke+") "+Ke,ul(Ce+h+" Id, and a "+w+" iterator"),c),P=e(b+w+ge,`(cellId: ${V}<TId>, count: number) `+Ke,ul(Ce+w+" Id, and count of how many times it appears"),c),O=e("TableIdForEachRowArray",`TId extends ${$} ? [tableId: TId, forEachRow: (rowCallback: ${k}<TId>)${Ke}] : never`,b+" Ids and callback types",`<TId = ${$}>`,0),E=e(b+ge,`(...[tableId, forEachRow]: ${O})`+Ke,ul(Ce+b+" Id, and a "+h+" iterator"),t),N=e("TableIdRowIdCellIdArray",`TId extends ${$} ? [tableId: TId, rowId: Id, cellId: ${V}<TId>] : never`,"Ids for GetCellChange",`<TId = ${$}>`,0),D=e("GetCellChange",`(...[tableId, rowId, cellId]: ${N}) => CellChange`,he+" returning information about any Cell's changes during a "+Fe),L=e(u+p+I,`(${o}, hasTables: boolean)`+Ke,il(1,0,1)),G=e(p+I,`(${o}, getCellChange: ${D}${Ee})`+Ke,il(1)),j=e(C+I,`(${o})`+Ke,il(2)),H=e(u+b+I,`(${o}, tableId: ${$}, hasTable: boolean)`+Ke,il(3,0,1)),M=e(b+I,`(${o}, tableId: ${$}, getCellChange: ${D}${Ee})`+Ke,il(3)),J=e(b+f+I,`(${o}, tableId: ${$})`+Ke,il(14,3)),z=e("HasTableCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,"Cell args for HasTableCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),W=e("HasTableCellListenerArgsArrayOuter",`TId extends ${$} ? `+z+"<TId> : never","Table args for HasTableCellListener",`<TId = ${$}>`,0),B=e(u+b+w+I,`(...[${n}, tableId, cellId, hasTableCell]: `+W+")"+Ke,il(16,3,1)),F=e(h+"Count"+I,`(${o}, tableId: ${$})`+Ke,il(15,3)),U=e(m+I,`(${o}, tableId: ${$})`+Ke,il(4,3)),_=e(g+I,"("+Gl(o,"tableId: "+$,"cellId: Id"+Ee,"descending: boolean","offset: number","limit: number"+Ee,"sortedRowIds: Ids")+")"+Ke,il(13,3)),Z=e(u+h+I,"("+Gl(""+o,"tableId: "+$,He,"hasRow: boolean")+")"+Ke,il(5,3,1)),Q=e(h+I,"("+Gl(""+o,"tableId: "+$,He,`getCellChange: ${D}${Ee}`)+")"+Ke,il(5,3)),q=e(f+I,"("+Gl(""+o,"tableId: "+$,He)+")"+Ke,il(6,5)),K=e("HasCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${He}, cellId: CId, hasCell: boolean] : never`,"Cell args for HasCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),X=e("HasCellListenerArgsArrayOuter",`TId extends ${$} ? `+K+"<TId> : never","Table args for HasCellListener",`<TId = ${$}>`,0),Y=e(u+w+I,`(...[${n}, tableId, rowId, cellId, hasCell]: `+X+")"+Ke,il(7,5,1)),ee=e("CellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${He}, cellId: CId, newCell: ${x}<TId, CId> ${Ee}, oldCell: ${x}<TId, CId> ${Ee}, getCellChange: ${D} ${Ee}] : never`,"Cell args for CellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),le=e("CellListenerArgsArrayOuter",`TId extends ${$} ? `+ee+"<TId> : never","Table args for CellListener",`<TId = ${$}>`,0);return[s,r,$,i,T,y,v,V,x,A,k,P,E,L,G,j,H,M,J,B,F,U,_,Z,Q,q,Y,e(w+I,`(...[${n}, tableId, rowId, cellId, newCell, oldCell, getCellChange]: ${le})`+Ke,il(7,5)),e(ke+w+I,`(${o}, tableId: Id, ${He}, cellId: Id, invalidCells: any[])`+Ke,il(8))]},(l,a)=>{const d=l+": "+a,o=e(y,jl(...n(((e,l,a)=>`'${e}'${S(a)?"?":t}: ${l}`))),sl(2,5)),s=e(y+Xe,jl(...n(((e,l)=>`'${e}'?: ${l}`))),sl(2,5,1)),r=e(T+Ae,"keyof "+o,"A "+T+" Id in "+Be),$=e(T,Ne+`<${o}[VId]>`,"A "+T+" Id in "+Be,`<VId extends ${r}>`),c=e("ValueIdValueArray",`VId extends ${r} ? [valueId: VId, value: ${$}<VId>] : never`,T+" Ids and types in "+Be,`<VId = ${r}>`,0),i=e(T+ge,`(...[valueId, value]: ${c})`+Ke,ul(Ce+T+" Id, and "+T)),b=e("GetValueChange",`(valueId: ${r}) => ValueChange`,he+" returning information about any Value's changes during a "+Fe),p=e(u+y+I,`(${d}, hasValues: boolean)`+Ke,il(9,0,1)),C=e(y+I,`(${d}, getValueChange: ${b}${Ee})`+Ke,il(9)),h=e(v+I,`(${d})`+Ke,il(10)),m=e(u+T+I,`(${d}, valueId: ValueId, hasValue: boolean)`+Ke,il(11,0,1)),g=e("ValueListenerArgsArray",`VId extends ${r} ? [${d}, valueId: VId, newValue: ${$}<VId> ${Ee}, oldValue: ${$}<VId> ${Ee}, getValueChange: ${b} ${Ee}] : never`,"Value args for ValueListener",`<VId = ${r}>`,0);return[o,s,r,$,i,p,C,h,m,e(T+I,`(...[${l}, valueId, newValue, oldValue, getValueChange]: `+g+")"+Ke,il(11)),e(ke+T+I,`(${d}, valueId: Id, invalidValues: any[])`+Ke,il(12))]},(l,t)=>e(V+I,`(${l}: ${t})`+Ke,he+" listening to the completion of a "+Fe)],Bl=(e,l=t,a=t)=>`store.${e}(${l})`+(a?" as "+a:t),Fl=(e,l=t)=>`fluent(() => ${Bl(e,l)})`,Ul=(e,l=t,a=t)=>`store.${e}(${l?l+", ":t}proxy(listener)${a?", "+a:t})`,_l=(e,a,n)=>{const[o,$,R,A,k,P,O,N]=Ml(),[D,L,G]=zl(e,a,k),[j,H,M]=Wl(R,D,L,G),W=re(),B=(e=0)=>ce(W,(([l,a,n,d,o],s)=>{const r=e?[s+`: ${o}(${l}): ${a} => ${n},`]:[s+o+`(${l}): ${a};`];return e||_(r,Ll(d)),F(r,t),r})),U=(e,l,a,n,d,o=t)=>Pl(W,e,[l,a,n,d,o]),Z=(e,l,a,n,d,o=t,s=t,r=t)=>U(Tl[e]+l+(4==e?x:t)+a,o,n,(n==K?Fl:Bl)(Tl[e]+(4==e?x:t)+a,s,e?void 0:n),d,r),Q=(e,l,a,n=t,d=t,o=1,s=t)=>U(c+e+I,(n?n+", ":t)+Pe+": "+l+(o?", mutator?: boolean":t),Ae,Ul(c+e+I,d,o?"mutator":t),a,s),q=`./${Nl(n)}.d`,K=Nl(n,1),X=Nl(K),Y=[],ee=re();let le=[],te=[];if($(1,q,K,`create${K} as create${K}Decl`),ae(e))$(null,l,p);else{$(0,l,"CellChange"),$(null,l,i);const[e,a,n,o,I,c,T,y,v,V,x,A,P,O,N,G,H,M,W,B,U,_,te,ae,ne,oe,se,$e,ce]=j(X,K),ie=re();D(((e,l)=>{const t=`<'${e}'>`,a=[R(l+b,o+t,je+` the '${e}' `+b),R(l+b+Xe,I+t,je+` the '${e}' `+b+Ye),R(l+h,c+t,rl(e)),R(l+h+Xe,T+t,rl(e,1)),R(l+w+Ae,y+t,`A Cell Id for the '${e}' `+b),R(l+w+ge,V+t,ul(`a Cell Id and value from a Row in the '${e}' `+b)),R(l+h+ge,x+t,ul(`a Row Id from the '${e}' Table, and a Cell iterator`)),R(l+b+w+ge,A+t,ul(`a Cell Id from anywhere in the '${e}' Table, and a count of how many times it appears`))];ue(ie,e,a),$(1,q,...a)})),$(1,q,e,a,n,y,P,O,N,G,H,M,W,B,U,_,te,ae,ne,oe,se,$e,ce),le=[e,a,n,y,O,N,G,H,M,W,B,U,_,te,ae,ne,oe,se,$e,ie],J([[e],[d],[K,"tables: "+a,"tables"],[K]],(([e,l,a],n)=>Z(n,t,p,e,sl(1,n),l,a))),Z(0,t,C,n+We,Il(b,Be)),Z(5,t,b,qe,$l(b,Be),"tableCallback: "+P,"tableCallback as any"),D(((e,l,a)=>{const[n,o,s,r,I,$,c,u]=Ie(ie,e);J([[n],[d],[K,"table: "+o,", table"],[K]],(([n,d,o=t],s)=>Z(s,l,b,n,hl(e,s),d,a+o))),Z(0,l,b+f,i,Il(w,"the whole of "+pl(e)),t,a),Z(5,l,b+w,qe,$l(b+w,"the whole of "+pl(e)),"tableCellCallback: "+u,a+", tableCellCallback as any"),Z(0,l,h+fe,"number","Gets the number of Rows in the "+pl(e),t,a),Z(0,l,m,i,Il(h,pl(e)),t,a),Z(0,l,g,i,Il(h,pl(e),1),"cellId?: "+I+ze,a+", cellId, descending, offset, limit"),Z(5,l,h,qe,$l(h,pl(e)),"rowCallback: "+c,a+", rowCallback as any"),J([[s],[d],[K,", row: "+r,", row"],[K],[K,", partialRow: "+r,", partialRow"]],(([n,d=t,o=t],s)=>Z(s,l,h,n,ml(e,s),He+d,a+", rowId"+o))),Z(6,l,h,Ae+Ee,"Add a new Row to "+pl(e),"row: "+r+", reuseIds?: boolean",a+", row, reuseIds"),Z(0,l,f,I+We,Il(w,Cl(e)),He,a+", rowId"),Z(5,l,w,qe,$l(w,Cl(e)),He+", cellCallback: "+$,a+", rowId, cellCallback as any"),L(e,((n,o,s,r,I)=>{const $="Map"+Nl(o,1);ue(ee,o,$);const c=o+(S(s)?Ee:t);J([[c],[d],[K,`, cell: ${o} | `+$,", cell as any"],[K]],(([d,o=t,s=t],$)=>Z($,l+I,w,d,gl(e,n,$),He+o,a+", rowId, "+r+s))),Z(1,l+I,b+w,d,fl[1]+` the '${n}' Cell anywhere in `+pl(e),t,a+", "+r)}))})),Z(0,t,p+Se,Se,sl(1,6)),Z(2,t,p+Se,K,sl(1,7),"tablesJson: "+Se,"tables"+Se),Q(u+p,O,sl(1,8,0,1)+" changes"),Q(p,N,sl(1,8)+" changes"),Q(C,G,bl(2,0,1)),Q(u+b,H,bl(3,0,0,1),`tableId: ${n} | null`,"tableId"),Q(b,M,bl(3,0),`tableId: ${n} | null`,"tableId"),Q(b+f,W,bl(14,3,1),`tableId: ${n} | null`,"tableId"),Q(u+b+w,B,bl(16,3,0,1),`tableId: ${n} | null, cellId: ${z(D((e=>Ie(ie,e)?.[4]??t))," | ")} | null`,"tableId, cellId"),Q(h+fe,U,bl(15,3),`tableId: ${n} | null`,"tableId"),Q(m,_,bl(4,3,1),`tableId: ${n} | null`,"tableId"),Q(g,te,bl(13,3,1),Gl("tableId: TId",`cellId: ${y}<TId>`+Ee,"descending: boolean","offset: number","limit: number"+Ee),Gl("tableId","cellId","descending","offset","limit"),1,"<TId extends TableId>"),Q(u+h,ae,bl(5,3,0,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Q(h,ne,bl(5,3),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Q(f,oe,bl(6,5,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Q(u+w,se,bl(7,5,0,1),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${z(D((e=>Ie(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),Q(w,$e,bl(7,5),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${z(D((e=>Ie(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),Q(ke+w,ce,Ge+" whenever an invalid Cell change was attempted","tableId: IdOrNull, rowId: IdOrNull, cellId: IdOrNull","tableId, rowId, cellId"),$(1,q,...de(ee)),F(Y,".set"+p+Me+"({",El(D(((e,l,a)=>[`[${a}]: {`,...L(e,((e,l,a,n)=>`[${n}]: {[${k(Dl(s),`'${s}'`)}]: ${k(Dl(l),`'${l}'`)}${S(a)?t:`, [${k(Dl(r),`'${r}'`)}]: `+(E(a)?k(Dl(a),`'${a}'`):a)}},`)),"},"]))),"})")}if(ae(a))$(null,l,y);else{const[e,a,n,o,I,c,i,b,p,C,h]=H(X,K);$(1,q,e,a,n,I,c,i,b,p,C,h),te=[e,a,n,c,i,b,p,C],J([[e],[d],[K,"values: "+a,"values"],[K],[K,"partialValues: "+a,"partialValues"]],(([e,l,a],n)=>Z(n,t,y,e,sl(2,n),l,a))),Z(0,t,v,n+We,Il(T,Be)),Z(5,t,T,"void",$l(T,Be),"valueCallback: "+I,"valueCallback as any"),G(((e,l,a,n,o)=>{const s="Map"+Nl(l,1);ue(ee,l,s),J([[l],[d],[K,`value: ${l} | `+s,", value as any"],[K]],(([l,a,d=t],s)=>Z(s,o,T,l,wl(e,s),a,n+d)))})),Z(0,t,y+Se,Se,sl(2,6)),Z(2,t,y+Se,K,sl(2,7),"valuesJson: "+Se,"values"+Se),Q(u+y,c,sl(2,8,0,1)+" changes"),Q(y,i,sl(2,8)+" changes"),Q(v,b,bl(10,0,1)),Q(u+T,p,bl(11,0,0,1),`valueId: ${n} | null`,"valueId"),Q(T,C,bl(11,0),`valueId: ${n} | null`,"valueId"),Q(ke+T,h,Ge+" whenever an invalid Value change was attempted","valueId: IdOrNull","valueId"),$(1,q,...de(ee)),$(0,l,"ValueChange"),F(Y,".set"+y+Me+"({",G(((e,l,a,n)=>[`[${n}]: {[${k(Dl(s),`'${s}'`)}]: ${k(Dl(l),`'${l}'`)}${S(a)?t:`, [${k(Dl(r),`'${r}'`)}]: `+(E(a)?k(Dl(a),`'${a}'`):a)}},`])),"})")}Z(0,t,"Content",`[${p}, ${y}]`,sl(0,0)),Z(2,t,"Content",K,sl(0,2),`[tables, values]: [${p}, ${y}]`,"[tables, values]"),Z(7,t,"applyChanges",K,`Applies a set of ${we} to the Store`,"changes: "+we,"changes"),$e(ee,((e,l)=>R(l,`(cell: ${e}${Ee}) => `+e,`Takes a ${e} Cell value and returns another`))),$(null,l,"DoRollback",Ae,"IdOrNull",Se,"Store",we),Z(0,t,Se,Se,sl(0,6)),Z(2,t,Se,K,sl(0,7),"tablesAndValuesJson: "+Se,"tablesAndValuesJson"),Z(7,t,Fe,"Return",Ue,xe,"actions, doRollback","<Return>"),Z(7,t,"start"+V,K,_e),Z(7,t,"finish"+V,K,Ze,Ve,"doRollback");const ne=M(X,K);return Q("Start"+V,ne,Ge+" just before the start of the "+Fe,t,t,0),Q("WillFinish"+V,ne,Ge+" just before "+Qe,t,t,0),Q("DidFinish"+V,ne,Ge+" just after "+Qe,t,t,0),Z(7,t,"call"+I,K,"Manually provoke a listener to be called","listenerId: Id","listenerId"),Z(3,t,I,K,"Remove a listener that was previously added to "+Be,"listenerId: Id","listenerId"),U("getStore",t,"Store","store",fl[0]+" the underlying Store object"),$(1,l,"createStore"),$(1,q,K,`create${K} as create${K}Decl`,ne),k("store",["createStore()",...Y]),A("fluent","actions: () => Store",["actions();",`return ${X};`]),A("proxy","listener: any",`(_: Store, ...params: any[]) => listener(${X}, ...params)`),k(X,["{",...B(1),"}"]),[o(...P(0),...O(),Re+" interface "+K+" {",...B(0),"}",t,Ll(`Creates a ${K} object`),Re+" function create"+K+"(): "+K+";"),o(...P(1),Re+" const create"+K+": typeof create"+K+"Decl = () => {",...N(),`return Object.freeze(${X});`,"};"),le,te]},Zl=e=>$+e,Ql=e=>Gl(Zl(e),Zl(e)+ye),ql="debugIds?: boolean",Kl="debugIds={debugIds}",Xl="then"+ve,Yl="Parameter",et=": (parameter: "+Yl+", store: Store) => ",lt="const contextValue = useContext(Context);",tt=", based on a parameter",at=": ",nt="<"+Yl+",>",dt=Yl+"ized"+ge+"<"+Yl+">",ot="rowId",st="rowId={rowId}",rt=", separator, debugIds",It="separator?: ReactElement | string",$t="then?: (store: Store",ct=Gl($t+")"+Ke,Xl),ut="then, then"+ye,it=ot+at+Ae,bt="View",pt=(e,...l)=>Gl(...l,Pe+": "+e,Pe+ve,"mutator?: boolean"),Ct=(...e)=>Gl(...e,Pe,Pe+ye,"mutator"),ht=(e,a,n,s,r)=>{const[$,c,V,R,A,k,P,O]=Ml(),[E,N,D]=zl(e,a,A),L=`./${Nl(n)}.d`,G=`./${Nl(n)}-ui-react.d`,j="tinybase/ui-react",H=Nl(n,1),M=Nl(H),J=H+"Or"+H+Ae,W=M+"Or"+H+Ae,B=M+`={${M}}`,U=re(),Z=(e,l,a,n,d,o=t)=>(c(1,G,e+" as "+e+"Decl"),Pl(U,e,[l,a,n,d,o])),Q=(e,l,a,n,d,o=t)=>Z("use"+e,l,a,n,d,o),q=(e,l,a,n,d=t,o=t,s=t,r=t,I=t)=>(c(1,j,`use${l} as use${l}Core`),Q(e,Gl(d,le,r),a,ne+`(${W}, use${l}Core, [`+(o||t)+(I?"], ["+I:t)+"]);",n,s)),K=(e,l,t,a)=>Z(e,l,1,t,a),X=(e=0)=>ce(U,(([l,a,n,d,o],s)=>{const r=e?[Re+` const ${s}: typeof ${s}Decl = ${o}(${l}): ${1==a?"any":a} =>`,n]:[Re+` function ${s}${o}(${l}): ${1==a?"ComponentReturnType":a};`];return e||_(r,Ll(d)),F(r,t),r}));c(null,l,Ae,"Store",ge,Yl+"ized"+ge),c(0,j,"ComponentReturnType"),c(1,j,"useCellIds"),c(null,j,"ExtraProps"),c(0,L,H);const Y=V(J,H+" | "+Ae,`Used when you need to refer to a ${H} in a React hook or component`),ee=V(Le+De,Hl(M+Oe+H,M+`ById?: {[${M}Id: Id]: ${H}}`),`Used with the ${Le} component, so that a `+H+" can be passed into the context of an application");c(0,"react","ReactElement","ComponentType"),c(1,"react","React"),c(1,G,Y,ee);const le=W+Oe+Y;A("{createContext, useContext, useMemo}","React"),A("Context",`createContext<[${H}?, {[${M}Id: Id]: ${H}}?]>([])`),Q("Create"+H,`create: () => ${H}, create`+ve,H,"\n// eslint-disable-next-line react-hooks/exhaustive-deps\nuseMemo(create, createDeps)",`Create a ${H} within a React application with convenient memoization`);const te=Q(H,"id?: Id",H+Ee,["{",lt,"return id == null ? contextValue[0] : contextValue[1]?.[id];","}"],`Get a reference to a ${H} from within a ${Le} component context`),ne=R("useHook",W+`: ${Y} | undefined, hook: (...params: any[]) => any, preParams: any[], postParams: any[] = []`,[`const ${M} = ${te}(${W} as Id);`,`return hook(...preParams, ((${W} == null || typeof ${W} == 'string')`,`? ${M} : ${W})?.getStore(), ...postParams)`]),de=R("getProps","getProps: ((id: any) => ExtraProps) | undefined, id: Id","(getProps == null) ? ({} as ExtraProps) : getProps(id)"),oe=R("wrap",Gl("children: any","separator?: any","encloseWithId?: boolean","id?: Id"),["const separated = separator==null || !Array.isArray(children)"," ? children"," : children.map((child, c) => (c > 0 ? [separator, child] : child));","return encloseWithId ? [id, ':{', separated, '}'] : separated;"]),se=R("useCustomOrDefaultCellIds",Gl("customCellIds: Ids | undefined","tableId: Id","rowId: Id",`${W}?: ${Y} | undefined`),[`const defaultCellIds = ${ne}(${W}, useCellIds, [tableId, rowId]);`,"return customCellIds ?? defaultCellIds;"]),$e=A("NullComponent","() => null");if(!ae(e)){const[e,a,n,r,$,T,y,v,A,k,P,O,D,j,J,W,F,U,_,Z]=s;c(null,L,e,a,n,$,T,y,v,A,k,P,O,D,j,J,W,F,_,U),c(0,L,r),c(1,L,H),c(null,l,i,"IdOrNull");const Q=R("tableView",`{${M}, rowComponent, getRowComponentProps, customCellIds`+rt+"}: any, rowIds: Ids, tableId: Id, defaultRowComponent: React.ComponentType<any>",["const Row = rowComponent ?? defaultRowComponent;",`return ${oe}(rowIds.map((rowId) => (`,"<Row","{..."+de+"(getRowComponentProps, rowId)}","key={rowId}","tableId={tableId}",st,"customCellIds={customCellIds}",B,Kl,"/>","))",rt,", tableId,",");"]),X=R("getDefaultTableComponent","tableId: Id",z(E(((e,l,t)=>`tableId == ${t} ? ${l}TableView : `)))+$e),Y=R("getDefaultCellComponent","tableId: Id, cellId: Id",z(E(((e,l,t)=>`tableId == ${t} ? ${z(N(e,((e,t,a,n,d)=>`cellId == ${n} ? `+l+d+"CellView : ")))+$e} : `)))+$e);q(u+p,u+p,d,sl(1,0,0,1)+me),q(p,p,e,sl(1,0)+me);const ee=q(C,C,n+We,Il(b,Be)+me);q(Je+p+ge,Je+p+ge,dt,sl(1,9)+tt,Gl(Zl(p)+et+a,Zl(p)+ve),Ql(p),nt,Gl($t,`tables: ${a})`+Ke,Xl),ut),q(Te+p+ge,Te+p+ge,ge,sl(1,12),t,t,t,ct,ut);const le=V(w+De,Hl("tableId?: TId","rowId: Id","cellId?: CId",M+Oe+H,ql),cl(Ce+w),`<TId extends ${n}, CId extends ${r}<TId>>`),te=V(h+De,Hl("tableId?: TId","rowId: Id",M+Oe+H,"cellComponents?: {readonly [CId in "+r+`<TId>]?: ComponentType<${le}<TId, CId>>;}`,`getCellComponentProps?: (cellId: ${r}<TId>) => ExtraProps`,`customCellIds?: ${r}<TId>[]`,It,ql),cl(Ce+h),`<TId extends ${n}>`),ae=V(b+De,Hl("tableId?: TId",M+Oe+H,`rowComponent?: ComponentType<${te}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",It,ql),cl(Ce+b),`<TId extends ${n}>`),ne=V("Sorted"+b+De,Hl("tableId?: TId","cellId?: "+r+"<TId>","descending?: boolean","offset?: number","limit?: number",M+Oe+H,`rowComponent?: ComponentType<${te}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",It,ql),cl(Ce+"sorted "+b),`<TId extends ${n}>`),re=V(p+De,Hl(M+Oe+H,"tableComponents?: {readonly [TId in "+n+`]?: ComponentType<${ae}<TId>>;}`,`getTableComponentProps?: (tableId: ${n}) => ExtraProps`,It,ql),cl(ol(1,1)));c(1,G,re,ae,ne,te,le),K(p+bt,"{"+M+", tableComponents, getTableComponentProps"+rt+"}: "+re,[oe+`(${ee}(${M}).map((tableId) => {`,"const Table = (tableComponents?.[tableId] ?? "+X+"(tableId)) as React.ComponentType<TableProps<typeof tableId>>;","return <Table",`{...${de}(getTableComponentProps, tableId)}`,"tableId={tableId}","key={tableId}",B,Kl,"/>;","}), separator)"],sl(1,13)+me),E(((e,l,a)=>{const[n,s,r,I,$]=Ie(Z,e);c(null,L,n,s,r,I,$),q(u+l+b,u+b,d,hl(e,0,1)+me,t,a),q(l+b,b,n,hl(e)+me,t,a),q(l+b+f,b+f,i,Il(w,"the whole of "+pl(e))+me,t,a),q(l+h+fe,h+fe,o,"Gets the number of Rows in "+pl(e)+me,t,a);const p=q(l+m,m,i,Il(h,pl(e))+me,t,a),C=q(l+g,g,i,Il(h,pl(e),1)+me,"cellId?: "+$+", descending?: boolean, offset?: number, limit?: number",a+", cellId, descending, offset, limit");q(u+l+h,u+h,d,ml(e,0,1)+me,it,Gl(a,ot)),q(l+h,h,r,ml(e)+me,it,Gl(a,ot)),q(l+f,f,$+We,Il(w,Cl(e))+me,it,Gl(a,ot)),q(Je+l+b+ge,Je+b+ge,dt,hl(e,9)+tt,Gl(Zl(b)+et+s,Zl(b)+ve),Gl(a,Ql(b)),nt,Gl($t,`table: ${s})`+Ke,Xl),ut),q(Te+l+b+ge,Te+b+ge,ge,hl(e,12),t,a,t,ct,ut),q(Je+l+h+ge,Je+h+ge,dt,ml(e,9)+tt,Gl(it,Zl(h)+et+I,Zl(h)+ve),Gl(a,ot,Ql(h)),nt,Gl($t,`row: ${I})`+Ke,Xl),ut),q("Add"+l+h+ge,"Add"+h+ge,dt,ml(e,10)+tt,Gl(Zl(h)+et+I,Zl(h)+ve),Gl(a,Ql(h)),nt,"then?: ("+Gl(it+Ee,"store: Store","row: "+I+")"+Ke,"then"+ve)+", reuseRowIds?: boolean",ut+", reuseRowIds"),q(Je+l+x+h+ge,Je+x+h+ge,dt,ml(e,11)+tt,Gl(it,Zl(x+h)+et+I,Zl(x+h)+ve),Gl(a,ot,Ql(x+h)),nt,Gl($t,`partialRow: ${I})`+Ke,Xl),ut),q(Te+l+h+ge,Te+h+ge,ge,ml(e,12),it,Gl(a,ot),t,ct,ut);const T=K(l+h+bt,"{rowId, "+M+", cellComponents, getCellComponentProps, customCellIds"+rt+`}: ${te}<'${e}'>`,[oe+`(${se}(customCellIds, `+a+`, rowId, ${M}).map((cellId: ${$}) => {`,"const Cell = (cellComponents?.[cellId] ?? "+Y+`(${a}, cellId)) as React.ComponentType<CellProps<typeof `+a+", typeof cellId>>;","return <Cell",`{...${de}(getCellComponentProps, cellId)} `,"key={cellId}",`tableId={${a}}`,st,"cellId={cellId}",B,Kl,"/>;","})"+rt+", rowId)"],ml(e,13)+me);K(l+"Sorted"+b+bt,"{cellId, descending, offset, limit, ...props}: "+ne+`<'${e}'>`,Q+"(props, "+C+`(cellId, descending, offset, limit, props.${M}), ${a}, ${T});`,hl(e,13)+", sorted"+me),K(l+b+bt,`props: ${ae}<'${e}'>`,Q+"(props, "+p+`(props.${M}), ${a}, ${T});`,hl(e,13)+me),N(e,((n,o,s,r,I)=>{const $="Map"+Nl(o,1);c(0,L,$),c(1,L,$),q(u+l+I+b+w,u+b+w,d,`Gets ${dl(1)}the '${n}' Cell anywhere in `+pl(e)+me,t,Gl(a,r)),q(u+l+I+w,u+w,d,gl(e,n,0,1)+me,it,Gl(a,ot,r));const i=q(l+I+w,w,o+(S(s)?Ee:t),gl(e,n)+me,it,Gl(a,ot,r));q(Je+l+I+w+ge,Je+w+ge,dt,gl(e,n,9)+tt,Gl(it,Zl(w)+et+o+" | "+$,Zl(w)+ve),Gl(a,ot,r,Ql(w)),nt,Gl($t,`cell: ${o} | ${$})`+Ke,Xl),ut),q(Te+l+I+w+ge,Te+w+ge,ge,gl(e,n,12),Gl(it,"forceDel?: boolean"),Gl(a,ot,r,"forceDel"),t,ct,ut),K(l+I+w+bt,`{rowId, ${M}, debugIds}: `+le+`<'${e}', '${n}'>`,[oe+`('' + ${i}(rowId, `+M+`) ?? '', undefined, debugIds, ${r})`],gl(e,n,13)+me)}))}));const ce=z(E((e=>Ie(Z,e)?.[4]??t))," | ");q(u+p+I,u+p+I,qe,sl(1,8,0,1)+" changes",pt($),Ct()),q(p+I,p+I,qe,sl(1,8)+" changes",pt(T),Ct()),q(C+I,C+I,qe,bl(2,0,1),pt(y),Ct()),q(u+b+I,u+b+I,qe,bl(3,0,0,1),pt(v,`tableId: ${n} | null`),Ct("tableId")),q(b+I,b+I,qe,bl(3,0),pt(A,`tableId: ${n} | null`),Ct("tableId")),q(b+f+I,b+f+I,qe,bl(14,3,1),pt(k,`tableId: ${n} | null`),Ct("tableId")),q(u+b+w+I,u+b+w+I,qe,bl(16,3,0,1),pt(P,`tableId: ${n} | null`,`cellId: ${ce} | null`),Ct("tableId","cellId")),q(h+fe+I,h+fe+I,qe,bl(15,3),pt(O,`tableId: ${n} | null`),Ct("tableId")),q(m+I,m+I,qe,bl(4,3,1),pt(D,`tableId: ${n} | null`),Ct("tableId")),q(g+I,g+I,qe,bl(13,3,1),pt(j,`tableId: ${n} | null`,"cellId: "+ce+Ee,"descending: boolean","offset: number","limit: number"+Ee),Ct("tableId","cellId","descending","offset","limit")),q(u+h+I,u+h+I,qe,bl(5,3,0,1),pt(J,`tableId: ${n} | null`,ot+": IdOrNull"),Ct("tableId",ot)),q(h+I,h+I,qe,bl(5,3),pt(W,`tableId: ${n} | null`,ot+": IdOrNull"),Ct("tableId",ot)),q(f+I,f+I,qe,bl(6,5,1),pt(F,`tableId: ${n} | null`,ot+": IdOrNull"),Ct("tableId",ot)),q(u+w+I,u+w+I,qe,bl(7,5,0,1),pt(U,`tableId: ${n} | null`,ot+": IdOrNull",`cellId: ${ce} | null`),Ct("tableId",ot,"cellId")),q(w+I,w+I,qe,bl(7,5),pt(_,`tableId: ${n} | null`,ot+": IdOrNull",`cellId: ${ce} | null`),Ct("tableId",ot,"cellId"))}if(!ae(a)){const[e,l,a,n,o,s,$,i]=r;c(null,L,...r),c(1,L,H);const b=R("getDefaultValueComponent","valueId: Id",z(D(((e,l,t,a,n)=>`valueId == ${a} ? `+n+"ValueView : ")))+$e);q(u+y,u+y,d,sl(2,0,0,1)+me),q(y,y,e,sl(2,0)+me);const p=q(v,v,a+We,Il(T,Be)+me);q(Je+y+ge,Je+y+ge,dt,sl(2,9)+tt,Gl(Zl(y)+et+l,Zl(y)+ve),Ql(y),nt,Gl($t,`values: ${l})`+Ke,Xl),ut),q(Je+x+y+ge,Je+x+y+ge,dt,sl(2,11)+tt,Gl(Zl(x+y)+et+l,Zl(x+y)+ve),Ql(x+y),nt,Gl($t,`partialValues: ${l})`+Ke,Xl),ut),q(Te+y+ge,Te+y+ge,ge,sl(2,12),t,t,t,ct,ut);const C=V(T+De,Hl("valueId?: VId",M+Oe+H,ql),cl("a Value"),`<VId extends ${a}>`),h=V(y+De,Hl(M+Oe+H,"valueComponents?: {readonly [VId in "+a+`]?: ComponentType<${C}<VId>>;}`,`getValueComponentProps?: (valueId: ${a}) => ExtraProps`,It,ql),cl(ol(2,1)));c(1,G,h,C),K(y+bt,"{"+M+", valueComponents, getValueComponentProps"+rt+"}: "+h,[oe+`(${p}(${M}).map((valueId) => {`,"const Value = valueComponents?.[valueId] ?? "+b+"(valueId);","return <Value",`{...${de}(getValueComponentProps, valueId)}`,"key={valueId}",B,Kl,"/>;","}), separator)"],sl(2,13)+me),D(((e,l,a,n,o)=>{const s="Map"+Nl(l,1);c(0,L,s),c(1,L,s),q(u+o+T,u+T,d,wl(e,0,1)+me,t,n);const r=q(o+T,T,l,wl(e)+me,t,n);q(Je+o+T+ge,Je+T+ge,dt,wl(e,9)+tt,Gl(Zl(T)+et+l+" | "+s,Zl(T)+ve),Gl(n,Ql(T)),nt,Gl($t,`value: ${l} | ${s})`+Ke,Xl),ut),q(Te+o+T+ge,Te+T+ge,ge,wl(e,12),t,n,t,ct,ut),K(o+T+bt,`{${M}, debugIds}: ${C}<'${e}'>`,[oe+`('' + ${r}(`+M+`) ?? '', undefined, debugIds, ${n})`],wl(e,13)+me)})),q(u+y+I,u+y+I,qe,sl(2,8,0,1)+" changes",pt(n),Ct()),q(y+I,y+I,qe,sl(2,8)+" changes",pt(o),Ct()),q(v+I,v+I,qe,bl(10,0,1),pt(s),Ct()),q(u+T+I,u+T+I,qe,bl(11,0,0,1),pt($,`valueId: ${a} | null`),Ct("valueId")),q(T+I,T+I,qe,bl(11,0),pt(i,`valueId: ${a} | null`),Ct("valueId"))}return K(Le,`{${M}, ${M}ById, children}: `+ee+" & {readonly children: React.ReactNode}",["{",lt,"return (","<Context."+Le,"value={useMemo(",`() => [${M} ?? contextValue[0], {...contextValue[1], ...${M}ById}],`,`[${M}, ${M}ById, contextValue],`,")}>","{children}",`</Context.${Le}>`,");","}"],"Wraps part of an application in a context that provides default objects to be used by hooks and components within"),[$(...k(0),...P(),...X(0)),$(...k(1),...O(),...X(1))]},mt=(e,l,a)=>{if(ae(e)&&ae(l))return[t,t,t,t];const[n,d,o,s]=_l(e,l,a);return[n,d,...ht(e,l,a,o,s)]},gt=JSON.parse,wt="prettier/",ft=wt+"plugins/",Tt={parser:"typescript",singleQuote:!0,trailingComma:"all",bracketSpacing:!1,jsdocSingleLineComment:!1},yt=Jl((e=>{const l=()=>{const l=gt(e.getTablesSchemaJson());return!ae(l)||H(e.getTableIds(),(t=>{const a=e.getRowIds(t),n=re();if(H(a,(l=>H(e.getCellIds(t,l),(a=>{const d=e.getCell(t,l,a),o=ie(n,a,(()=>[j(d),re(),[0],0])),[s,r,[I]]=o,$=ie(r,d,(()=>0))+1;return $>I&&(o[2]=[$,d]),ue(r,d,$),o[3]++,s==j(d)})))))return l[t]={},oe(n,(([e,,[,n],d],o)=>{l[t][o]={[s]:e,...d==L(a)?{[r]:n}:{}}})),1}))?l:{}},t=()=>{const l=gt(e.getValuesSchemaJson());return ae(l)&&e.forEachValue(((e,t)=>{l[e]={[s]:j(t)}})),l},a=e=>mt(l(),t(),e),n=async e=>{const l=["d.ts","ts","d.ts","tsx"],t=[];let n;try{n=(await import(wt+"standalone")).format,F(t,await import(ft+"estree"),await import(ft+"typescript"))}catch{n=async e=>e}return await G(W(a(e),(async(e,a)=>Ol(await n(e,{...Tt,plugins:t,filepath:"_."+l[a]})))))};return ee({getStoreStats:l=>{let t=0,a=0,n=0;const d={};return e.forEachTable(((e,o)=>{t++;let s=0,r=0;const I={};o(((e,t)=>{s++;let a=0;t((()=>a++)),r+=a,l&&(I[e]={rowCells:a})})),a+=s,n+=r,l&&(d[e]={tableRows:s,tableCells:r,rows:I})})),{totalTables:t,totalRows:a,totalCells:n,totalValues:L(e.getValueIds()),jsonLength:L(e.getJson()),...l?{detail:{tables:d}}:{}}},getStoreTablesSchema:l,getStoreValuesSchema:t,getStoreApi:a,getPrettyStoreApi:n,getStore:()=>e})}));exports.createTools=yt;
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=e=>typeof e,l="tinybase",t="",a=",",n=e(t),d=e(!0),o=e(0),s="type",r="default",I="Listener",$="get",c="add",u="Has",i="Ids",b="Table",p=b+"s",C=b+i,h="Row",m=h+i,g="Sorted"+h+i,w="Cell",f=w+i,T="Value",y=T+"s",v=T+i,V=Promise,x=isFinite,R=e=>null==e,A=(e,l,t)=>R(e)?t?.():l(e),k=e=>e==n||e==d,S=l=>e(l)==n,P=e=>Array.isArray(e),O=(e,l,t)=>e.slice(l,t),E=e=>e.length,N=async e=>V.all(e),D=l=>{const t=e(l);return k(t)||t==o&&x(l)?t:void 0},L=(e,l)=>e.every(l),G=(e,l)=>e.sort(l),j=(e,l)=>e.forEach(l),H=(e,l=t)=>e.join(l),M=(e,l)=>e.map(l),J=(e,l)=>e.filter(l),z=(e,...l)=>e.push(...l),W=e=>e.pop(),B=(e,...l)=>e.unshift(...l),F=e=>e.shift(),U=Object,_=e=>U.getPrototypeOf(e),Z=U.entries,Q=e=>!R(e)&&A(_(e),(e=>e==U.prototype||R(_(e))),(()=>!0)),q=U.keys,K=U.freeze,X=(e,l)=>M(Z(e),(([e,t])=>l(t,e))),Y=e=>E(q(e)),ee=e=>Q(e)&&0==Y(e),le=(e,l)=>e?.has(l)??!1,te=e=>[...e?.values()??[]],ae=(e,l)=>e?.forEach(l),ne=(e,l)=>e?.delete(l),de=e=>new Map(e),oe=(e,l)=>e?.get(l),se=(e,l)=>ae(e,((e,t)=>l(t,e))),re=(e,l)=>M([...e?.entries()??[]],(([e,t])=>l(t,e))),Ie=(e,l,t)=>R(t)?(ne(e,l),e):e?.set(l,t),$e=(e,l,t,a)=>(le(e,l)||Ie(e,l,t()),oe(e,l)),ce=e=>e.toUpperCase(),ue=e=>e.toLowerCase(),ie="a ",be="A function for",pe=", and registers a listener so that any changes to that result will cause a re-render",Ce="Callback",he="Changes",me="Count",ge="Del",we="Deps",fe=we+"?: React.DependencyList",Te="doRollback?: DoRollback",ye="actions: () => Return, "+Te,ve="export",Ve="Id",xe="Invalid",Re="Json",Ae=ue(I),ke="?: ",Se=" | undefined",Pe="NonNullable",Oe="Partial",Ee="Props",Ne="Provider",De=`Registers a ${Ae} that will be called`,Le="Represents",Ge="rowId: "+Ve,je="Schema",He="Set",Me=", descending?: boolean, offset?: number, limit?: number",Je="[]",ze="the Store",We="Transaction",Be=ue(We),Fe="Execute a "+Be+" to make multiple mutations",Ue="Explicitly starts a "+Be,_e="Explicitly finishes a "+Be,Ze="the end of the "+Be,Qe="void",qe=" => "+Qe,Ke="WhenSet",Xe=" when setting it",Ye=ie+"string serialization of",el=" ",ll="Gets a callback that can ",tl="the ",al=" the schema for",nl=(e=0)=>e?"the existence of ":"",dl=(e=0,l=0,a=0)=>nl(a)+`the ${yl[e]}content of`+(l?el+ze:t),ol=(e=0,l,a=0,n=0)=>wl[l]+el+nl(n)+dl(e,1)+(a?" when setting it":t),sl=(e,l=0)=>Le+` a Row when ${l?"s":"g"}etting ${dl()} the '${e}' `+b,rl=(e,l,t=0)=>`Gets ${t?"sorted, paginated":"the"} Ids of the ${e}s in `+l,Il=(e,l)=>`Calls a function for each ${e} in `+l,$l=e=>"The props passed to a component that renders "+e,cl=e=>"A function that takes "+e,ul=(e,l=0,t=0)=>be+" listening to changes to "+nl(t)+Tl[e]+" in "+Tl[l],il=(e,l,a=0,n=0)=>De+" whenever "+nl(n)+Tl[e]+" in "+Tl[l]+" change"+(a?t:"s"),bl=e=>`the '${e}' `+b,pl=e=>"the specified Row in "+bl(e),Cl=(e,l=0,t=0)=>wl[l]+el+dl(0,0,t)+el+bl(e),hl=(e,l=0,t=0)=>wl[l]+` ${dl(0,0,t)} `+pl(e),ml=(e,l,t=0,a=0)=>wl[t]+el+nl(a)+`the '${l}' Cell for `+pl(e),gl=(e,l=0,t=0)=>wl[l]+el+nl(t)+`the '${e}' Value`,wl=["Gets","Checks existence of","Sets","Deletes","Sets part of",Le,"Gets "+Ye,"Sets "+Ye,De+" whenever",ll+"set",ll+"add",ll+"set part of",ll+"delete","Renders","Gets "+Ye+al,"Sets"+al,"Deletes"+al],fl=[$,"has","set","del","set","forEach",c,t],Tl=[ze,p,tl+b+el+i,ie+b,tl+h+el+i,ie+h,tl+w+el+i,ie+w,"invalid Cell changes",y,tl+T+el+i,ie+T,"invalid Value changes",tl+"sorted "+h+el+i,tl+w+el+i+" anywhere",tl+"number of Rows",ie+w+" anywhere"],yl=[t,"tabular ","keyed value "],vl=e=>new Set(P(e)||R(e)?e:[e]),Vl=(e,l)=>e?.add(l),xl=/[^A-Za-z]+/,Rl=/[^A-Za-z0-9]+/,Al=/^( *)\/\*\* *(.*?) *\*\/$/gm,kl=e=>e.includes(a),Sl=(e,l,t,a=1)=>{const n=`${l}${1==a?"":a}`;return le(e,n)?Sl(e,l,t,a+1):(Ie(e,n,t),n)},Pl=e=>e.replace(Al,((e,l,t)=>{const a=77-E(l);return`${l}/**\n${t.replace(RegExp(`([^\\n]{1,${a}})(\\s|$)`,"g"),l+" * $1\n")}${l} */`})),Ol=e=>e.flat(1e3),El=(e,l=0)=>H(M(e.split(Rl),((e,t)=>(t>0||l?ce:ue)(O(e,0,1))+O(e,1)))),Nl=e=>ce(H((e&&!xl.test(e[0])?e:" "+e).split(Rl),"_")),Dl=e=>`/** ${e}. */`,Ll=(...e)=>H(J(e,(e=>e)),", "),Gl=(...e)=>"{"+H(e,"; ")+"}",jl=(...e)=>Gl(...M(e,(e=>"readonly "+e))),Hl=()=>{const e=[de(),de(),de(),de()],l=de(),a=de(),n=e=>{const l=e.indexOf(" as ");return-1!=l?O(e,l+4):e};return[(...e)=>H(Ol(e),"\n"),(l,t,...a)=>j(a,(a=>j([0,1],(n=>(l??n)==n?Vl($e(e[n],t,vl),a):0)))),(e,a,n,d=t,o=1)=>Sl(l,e,[a,n,d,o]),(e,l,t)=>Sl(a,e,P(t)?[`(${l}) => {`,t,"}"]:[`(${l}) => ${t}`]),(e,l)=>oe(a,e)===l?e:Sl(a,e,l),(l=0)=>M([...G(re(e[l],((e,l)=>`import {${H(G(te(e),((e,l)=>n(e)>n(l)?1:-1)),", ")}} from '${l}';`)),((e,l)=>kl(e)!=kl(l)?kl(e)?-1:1:e>l?1:-1)),t],(e=>e.replace("{React}","React"))),()=>re(l,(([e,l,a,n],d)=>[Dl(l),`${n?ve+" ":t}type ${d}${a} = ${e};`,t])),()=>re(a,((e,l)=>(e=P(e)?e:[e],z(e,W(e)+";"),[`const ${l} = ${F(e)}`,e,t])))]},Ml=(e,l)=>{const t=new WeakMap;return l=>(t.has(l)||t.set(l,e(l)),t.get(l))},Jl=(e,l,t)=>[l=>X(e,((e,a)=>l(a,El(a,1),t(Nl(a),`'${a}'`)))),(l,a)=>X(e[l],((e,l)=>a(l,e[s],e[r],t(Nl(l),`'${l}'`),El(l,1)))),e=>X(l,((l,a)=>e(a,l[s],l[r],t(Nl(a),`'${a}'`),El(a,1))))],zl=(e,l,a,n)=>[(n,d)=>{const o=n+": "+d,s=e(p,Gl(...l((e=>`'${e}'?: {[rowId: Id]: `+Gl(...a(e,((e,l,a)=>`'${e}'${R(a)?"?":t}: ${l}`)))+"}"))),ol(1,5)),r=e(p+Ke,Gl(...l((e=>`'${e}'?: {[rowId: Id]: `+Gl(...a(e,((e,l)=>`'${e}'?: ${l}`)))+"}"))),ol(1,5,1)),$=e(b+Ve,"keyof "+s,"A "+b+" Id in "+ze),c=`<TId extends ${$}>`,i=e(b,Pe+`<${s}[TId]>`,"A "+b+" in "+ze,c),T=e(b+Ke,Pe+`<${r}[TId]>`,"A "+b+" in "+ze+Xe,c),y=e(h,i+"<TId>[Id]","A "+h+" in a "+b,c),v=e(h+Ke,T+"<TId>[Id]","A "+h+" in a "+b+Xe,c),V=e(w+Ve,`Extract<keyof ${y}<TId>, Id>`,"A "+w+" Id in a "+h,c),x=e(w,Pe+`<${s}[TId]>[Id][CId]`,"A "+w+" in a "+h,`<TId extends ${$}, CId extends ${V}<TId>>`),A=e("CellIdCellArray",`CId extends ${V}<TId> ? [cellId: CId, cell: ${x}<TId, CId>] : never`,w+" Ids and types in a "+h,`<TId extends ${$}, CId = ${V}<TId>>`,0),k=e(w+Ce,`(...[cellId, cell]: ${A}<TId>)`+qe,cl(ie+w+" Id, and "+w),c),S=e(h+Ce,"(rowId: Id, forEachCell: (cellCallback: CellCallback<TId>) "+qe+") "+qe,cl(ie+h+" Id, and a "+w+" iterator"),c),P=e(b+w+Ce,`(cellId: ${V}<TId>, count: number) `+qe,cl(ie+w+" Id, and count of how many times it appears"),c),O=e("TableIdForEachRowArray",`TId extends ${$} ? [tableId: TId, forEachRow: (rowCallback: ${S}<TId>)${qe}] : never`,b+" Ids and callback types",`<TId = ${$}>`,0),E=e(b+Ce,`(...[tableId, forEachRow]: ${O})`+qe,cl(ie+b+" Id, and a "+h+" iterator"),t),N=e("TableIdRowIdCellIdArray",`TId extends ${$} ? [tableId: TId, rowId: Id, cellId: ${V}<TId>] : never`,"Ids for GetCellChange",`<TId = ${$}>`,0),D=e("GetCellChange",`(...[tableId, rowId, cellId]: ${N}) => CellChange`,be+" returning information about any Cell's changes during a "+Be),L=e(u+p+I,`(${o}, hasTables: boolean)`+qe,ul(1,0,1)),G=e(p+I,`(${o}, getCellChange: ${D}${Se})`+qe,ul(1)),j=e(C+I,`(${o})`+qe,ul(2)),H=e(u+b+I,`(${o}, tableId: ${$}, hasTable: boolean)`+qe,ul(3,0,1)),M=e(b+I,`(${o}, tableId: ${$}, getCellChange: ${D}${Se})`+qe,ul(3)),J=e(b+f+I,`(${o}, tableId: ${$})`+qe,ul(14,3)),z=e("HasTableCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,"Cell args for HasTableCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),W=e("HasTableCellListenerArgsArrayOuter",`TId extends ${$} ? `+z+"<TId> : never","Table args for HasTableCellListener",`<TId = ${$}>`,0),B=e(u+b+w+I,`(...[${n}, tableId, cellId, hasTableCell]: `+W+")"+qe,ul(16,3,1)),F=e(h+"Count"+I,`(${o}, tableId: ${$})`+qe,ul(15,3)),U=e(m+I,`(${o}, tableId: ${$})`+qe,ul(4,3)),_=e(g+I,"("+Ll(o,"tableId: "+$,"cellId: Id"+Se,"descending: boolean","offset: number","limit: number"+Se,"sortedRowIds: Ids")+")"+qe,ul(13,3)),Z=e(u+h+I,"("+Ll(""+o,"tableId: "+$,Ge,"hasRow: boolean")+")"+qe,ul(5,3,1)),Q=e(h+I,"("+Ll(""+o,"tableId: "+$,Ge,`getCellChange: ${D}${Se}`)+")"+qe,ul(5,3)),q=e(f+I,"("+Ll(""+o,"tableId: "+$,Ge)+")"+qe,ul(6,5)),K=e("HasCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${Ge}, cellId: CId, hasCell: boolean] : never`,"Cell args for HasCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),X=e("HasCellListenerArgsArrayOuter",`TId extends ${$} ? `+K+"<TId> : never","Table args for HasCellListener",`<TId = ${$}>`,0),Y=e(u+w+I,`(...[${n}, tableId, rowId, cellId, hasCell]: `+X+")"+qe,ul(7,5,1)),ee=e("CellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${Ge}, cellId: CId, newCell: ${x}<TId, CId> ${Se}, oldCell: ${x}<TId, CId> ${Se}, getCellChange: ${D} ${Se}] : never`,"Cell args for CellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),le=e("CellListenerArgsArrayOuter",`TId extends ${$} ? `+ee+"<TId> : never","Table args for CellListener",`<TId = ${$}>`,0);return[s,r,$,i,T,y,v,V,x,k,S,P,E,L,G,j,H,M,J,B,F,U,_,Z,Q,q,Y,e(w+I,`(...[${n}, tableId, rowId, cellId, newCell, oldCell, getCellChange]: ${le})`+qe,ul(7,5)),e(xe+w+I,`(${o}, tableId: Id, ${Ge}, cellId: Id, invalidCells: any[])`+qe,ul(8))]},(l,a)=>{const d=l+": "+a,o=e(y,Gl(...n(((e,l,a)=>`'${e}'${R(a)?"?":t}: ${l}`))),ol(2,5)),s=e(y+Ke,Gl(...n(((e,l)=>`'${e}'?: ${l}`))),ol(2,5,1)),r=e(T+Ve,"keyof "+o,"A "+T+" Id in "+ze),$=e(T,Pe+`<${o}[VId]>`,"A "+T+" Id in "+ze,`<VId extends ${r}>`),c=e("ValueIdValueArray",`VId extends ${r} ? [valueId: VId, value: ${$}<VId>] : never`,T+" Ids and types in "+ze,`<VId = ${r}>`,0),i=e(T+Ce,`(...[valueId, value]: ${c})`+qe,cl(ie+T+" Id, and "+T)),b=e("GetValueChange",`(valueId: ${r}) => ValueChange`,be+" returning information about any Value's changes during a "+Be),p=e(u+y+I,`(${d}, hasValues: boolean)`+qe,ul(9,0,1)),C=e(y+I,`(${d}, getValueChange: ${b}${Se})`+qe,ul(9)),h=e(v+I,`(${d})`+qe,ul(10)),m=e(u+T+I,`(${d}, valueId: ValueId, hasValue: boolean)`+qe,ul(11,0,1)),g=e("ValueListenerArgsArray",`VId extends ${r} ? [${d}, valueId: VId, newValue: ${$}<VId> ${Se}, oldValue: ${$}<VId> ${Se}, getValueChange: ${b} ${Se}] : never`,"Value args for ValueListener",`<VId = ${r}>`,0);return[o,s,r,$,i,p,C,h,m,e(T+I,`(...[${l}, valueId, newValue, oldValue, getValueChange]: `+g+")"+qe,ul(11)),e(xe+T+I,`(${d}, valueId: Id, invalidValues: any[])`+qe,ul(12))]},(l,t)=>e(We+I,`(${l}: ${t})`+qe,be+" listening to the completion of a "+Be)],Wl=(e,l=t,a=t)=>`store.${e}(${l})`+(a?" as "+a:t),Bl=(e,l=t)=>`fluent(() => ${Wl(e,l)})`,Fl=(e,l=t,a=t)=>`store.${e}(${l?l+", ":t}proxy(listener)${a?", "+a:t})`,Ul=(e,a,n)=>{const[o,$,V,x,A,k,P,O]=Hl(),[E,N,D]=Jl(e,a,A),[L,G,M]=zl(V,E,N,D),J=de(),W=(e=0)=>re(J,(([l,a,n,d,o],s)=>{const r=e?[s+`: ${o}(${l}): ${a} => ${n},`]:[s+o+`(${l}): ${a};`];return e||B(r,Dl(d)),z(r,t),r})),F=(e,l,a,n,d,o=t)=>Sl(J,e,[l,a,n,d,o]),U=(e,l,a,n,d,o=t,s=t,r=t)=>F(fl[e]+l+(4==e?Oe:t)+a,o,n,(n==Q?Bl:Wl)(fl[e]+(4==e?Oe:t)+a,s,e?void 0:n),d,r),_=(e,l,a,n=t,d=t,o=1,s=t)=>F(c+e+I,(n?n+", ":t)+Ae+": "+l+(o?", mutator?: boolean":t),Ve,Fl(c+e+I,d,o?"mutator":t),a,s),Z=`./${El(n)}.d`,Q=El(n,1),q=El(Q),K=[],X=de();let Y=[],le=[];if($(1,Z,Q,`create${Q} as create${Q}Decl`),ee(e))$(null,l,p);else{$(0,l,"CellChange"),$(null,l,i);const[e,a,n,o,I,c,T,y,v,x,k,P,O,D,G,M,J,W,B,F,ee,le,ae,ne,se,re,$e,ce,ue]=L(q,Q),ie=de();E(((e,l)=>{const t=`<'${e}'>`,a=[V(l+b,o+t,Le+` the '${e}' `+b),V(l+b+Ke,I+t,Le+` the '${e}' `+b+Xe),V(l+h,c+t,sl(e)),V(l+h+Ke,T+t,sl(e,1)),V(l+w+Ve,y+t,`A Cell Id for the '${e}' `+b),V(l+w+Ce,x+t,cl(`a Cell Id and value from a Row in the '${e}' `+b)),V(l+h+Ce,k+t,cl(`a Row Id from the '${e}' Table, and a Cell iterator`)),V(l+b+w+Ce,P+t,cl(`a Cell Id from anywhere in the '${e}' Table, and a count of how many times it appears`))];Ie(ie,e,a),$(1,Z,...a)})),$(1,Z,e,a,n,y,O,D,G,M,J,W,B,F,ee,le,ae,ne,se,re,$e,ce,ue),Y=[e,a,n,y,D,G,M,J,W,B,F,ee,le,ae,ne,se,re,$e,ce,ie],j([[e],[d],[Q,"tables: "+a,"tables"],[Q]],(([e,l,a],n)=>U(n,t,p,e,ol(1,n),l,a))),U(0,t,C,n+Je,rl(b,ze)),U(5,t,b,Qe,Il(b,ze),"tableCallback: "+O,"tableCallback as any"),E(((e,l,a)=>{const[n,o,s,r,I,$,c,u]=oe(ie,e);j([[n],[d],[Q,"table: "+o,", table"],[Q]],(([n,d,o=t],s)=>U(s,l,b,n,Cl(e,s),d,a+o))),U(0,l,b+f,i,rl(w,"the whole of "+bl(e)),t,a),U(5,l,b+w,Qe,Il(b+w,"the whole of "+bl(e)),"tableCellCallback: "+u,a+", tableCellCallback as any"),U(0,l,h+me,"number","Gets the number of Rows in the "+bl(e),t,a),U(0,l,m,i,rl(h,bl(e)),t,a),U(0,l,g,i,rl(h,bl(e),1),"cellId?: "+I+Me,a+", cellId, descending, offset, limit"),U(5,l,h,Qe,Il(h,bl(e)),"rowCallback: "+c,a+", rowCallback as any"),j([[s],[d],[Q,", row: "+r,", row"],[Q],[Q,", partialRow: "+r,", partialRow"]],(([n,d=t,o=t],s)=>U(s,l,h,n,hl(e,s),Ge+d,a+", rowId"+o))),U(6,l,h,Ve+Se,"Add a new Row to "+bl(e),"row: "+r+", reuseIds?: boolean",a+", row, reuseIds"),U(0,l,f,I+Je,rl(w,pl(e)),Ge,a+", rowId"),U(5,l,w,Qe,Il(w,pl(e)),Ge+", cellCallback: "+$,a+", rowId, cellCallback as any"),N(e,((n,o,s,r,I)=>{const $="Map"+El(o,1);Ie(X,o,$);const c=o+(R(s)?Se:t);j([[c],[d],[Q,`, cell: ${o} | `+$,", cell as any"],[Q]],(([d,o=t,s=t],$)=>U($,l+I,w,d,ml(e,n,$),Ge+o,a+", rowId, "+r+s))),U(1,l+I,b+w,d,wl[1]+` the '${n}' Cell anywhere in `+bl(e),t,a+", "+r)}))})),U(0,t,p+Re,Re,ol(1,6)),U(2,t,p+Re,Q,ol(1,7),"tablesJson: "+Re,"tables"+Re),_(u+p,D,ol(1,8,0,1)+" changes"),_(p,G,ol(1,8)+" changes"),_(C,M,il(2,0,1)),_(u+b,J,il(3,0,0,1),`tableId: ${n} | null`,"tableId"),_(b,W,il(3,0),`tableId: ${n} | null`,"tableId"),_(b+f,B,il(14,3,1),`tableId: ${n} | null`,"tableId"),_(u+b+w,F,il(16,3,0,1),`tableId: ${n} | null, cellId: ${H(E((e=>oe(ie,e)?.[4]??t))," | ")} | null`,"tableId, cellId"),_(h+me,ee,il(15,3),`tableId: ${n} | null`,"tableId"),_(m,le,il(4,3,1),`tableId: ${n} | null`,"tableId"),_(g,ae,il(13,3,1),Ll("tableId: TId",`cellId: ${y}<TId>`+Se,"descending: boolean","offset: number","limit: number"+Se),Ll("tableId","cellId","descending","offset","limit"),1,"<TId extends TableId>"),_(u+h,ne,il(5,3,0,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(h,se,il(5,3),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(f,re,il(6,5,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(u+w,$e,il(7,5,0,1),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${H(E((e=>oe(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),_(w,ce,il(7,5),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${H(E((e=>oe(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),_(xe+w,ue,De+" whenever an invalid Cell change was attempted","tableId: IdOrNull, rowId: IdOrNull, cellId: IdOrNull","tableId, rowId, cellId"),$(1,Z,...te(X)),z(K,".set"+p+je+"({",Ol(E(((e,l,a)=>[`[${a}]: {`,...N(e,((e,l,a,n)=>`[${n}]: {[${A(Nl(s),`'${s}'`)}]: ${A(Nl(l),`'${l}'`)}${R(a)?t:`, [${A(Nl(r),`'${r}'`)}]: `+(S(a)?A(Nl(a),`'${a}'`):a)}},`)),"},"]))),"})")}if(ee(a))$(null,l,y);else{const[e,a,n,o,I,c,i,b,p,C,h]=G(q,Q);$(1,Z,e,a,n,I,c,i,b,p,C,h),le=[e,a,n,c,i,b,p,C],j([[e],[d],[Q,"values: "+a,"values"],[Q],[Q,"partialValues: "+a,"partialValues"]],(([e,l,a],n)=>U(n,t,y,e,ol(2,n),l,a))),U(0,t,v,n+Je,rl(T,ze)),U(5,t,T,"void",Il(T,ze),"valueCallback: "+I,"valueCallback as any"),D(((e,l,a,n,o)=>{const s="Map"+El(l,1);Ie(X,l,s),j([[l],[d],[Q,`value: ${l} | `+s,", value as any"],[Q]],(([l,a,d=t],s)=>U(s,o,T,l,gl(e,s),a,n+d)))})),U(0,t,y+Re,Re,ol(2,6)),U(2,t,y+Re,Q,ol(2,7),"valuesJson: "+Re,"values"+Re),_(u+y,c,ol(2,8,0,1)+" changes"),_(y,i,ol(2,8)+" changes"),_(v,b,il(10,0,1)),_(u+T,p,il(11,0,0,1),`valueId: ${n} | null`,"valueId"),_(T,C,il(11,0),`valueId: ${n} | null`,"valueId"),_(xe+T,h,De+" whenever an invalid Value change was attempted","valueId: IdOrNull","valueId"),$(1,Z,...te(X)),$(0,l,"ValueChange"),z(K,".set"+y+je+"({",D(((e,l,a,n)=>[`[${n}]: {[${A(Nl(s),`'${s}'`)}]: ${A(Nl(l),`'${l}'`)}${R(a)?t:`, [${A(Nl(r),`'${r}'`)}]: `+(S(a)?A(Nl(a),`'${a}'`):a)}},`])),"})")}U(0,t,"Content",`[${p}, ${y}]`,ol(0,0)),U(2,t,"Content",Q,ol(0,2),`[tables, values]: [${p}, ${y}]`,"[tables, values]"),U(7,t,"applyChanges",Q,`Applies a set of ${he} to the Store`,"changes: "+he,"changes"),se(X,((e,l)=>V(l,`(cell: ${e}${Se}) => `+e,`Takes a ${e} Cell value and returns another`))),$(null,l,"DoRollback",Ve,"IdOrNull",Re,"Store",he),U(0,t,Re,Re,ol(0,6)),U(2,t,Re,Q,ol(0,7),"tablesAndValuesJson: "+Re,"tablesAndValuesJson"),U(7,t,Be,"Return",Fe,ye,"actions, doRollback","<Return>"),U(7,t,"start"+We,Q,Ue),U(7,t,"finish"+We,Q,_e,Te,"doRollback");const ae=M(q,Q);return _("Start"+We,ae,De+" just before the start of the "+Be,t,t,0),_("WillFinish"+We,ae,De+" just before "+Ze,t,t,0),_("DidFinish"+We,ae,De+" just after "+Ze,t,t,0),U(7,t,"call"+I,Q,"Manually provoke a listener to be called","listenerId: Id","listenerId"),U(3,t,I,Q,"Remove a listener that was previously added to "+ze,"listenerId: Id","listenerId"),F("getStore",t,"Store","store",wl[0]+" the underlying Store object"),$(1,l,"createStore"),$(1,Z,Q,`create${Q} as create${Q}Decl`,ae),A("store",["createStore()",...K]),x("fluent","actions: () => Store",["actions();",`return ${q};`]),x("proxy","listener: any",`(_: Store, ...params: any[]) => listener(${q}, ...params)`),A(q,["{",...W(1),"}"]),[o(...k(0),...P(),ve+" interface "+Q+" {",...W(0),"}",t,Dl(`Creates a ${Q} object`),ve+" function create"+Q+"(): "+Q+";"),o(...k(1),ve+" const create"+Q+": typeof create"+Q+"Decl = () => {",...O(),`return Object.freeze(${q});`,"};"),Y,le]},_l=e=>$+e,Zl=e=>Ll(_l(e),_l(e)+we),Ql="debugIds?: boolean",ql="debugIds={debugIds}",Kl="then"+fe,Xl="Parameter",Yl=": (parameter: "+Xl+", store: Store) => ",et="const contextValue = useContext(Context);",lt=", based on a parameter",tt=": ",at="<"+Xl+",>",nt=Xl+"ized"+Ce+"<"+Xl+">",dt="rowId",ot="rowId={rowId}",st=", separator, debugIds",rt="separator?: ReactElement | string",It="then?: (store: Store",$t=Ll(It+")"+qe,Kl),ct="then, then"+we,ut=dt+tt+Ve,it="View",bt=(e,...l)=>Ll(...l,Ae+": "+e,Ae+fe,"mutator?: boolean"),pt=(...e)=>Ll(...e,Ae,Ae+we,"mutator"),Ct=(e,a,n,s,r)=>{const[$,c,V,x,A,k,S,P]=Hl(),[O,E,N]=Jl(e,a,A),D=`./${El(n)}.d`,L=`./${El(n)}-ui-react.d`,G="tinybase/ui-react",j=El(n,1),M=El(j),J=j+"Or"+j+Ve,W=M+"Or"+j+Ve,F=M+`={${M}}`,U=de(),_=(e,l,a,n,d,o=t)=>(c(1,L,e+" as "+e+"Decl"),Sl(U,e,[l,a,n,d,o])),Z=(e,l,a,n,d,o=t)=>_("use"+e,l,a,n,d,o),Q=(e,l,a,n,d=t,o=t,s=t,r=t,I=t)=>(c(1,G,`use${l} as use${l}Core`),Z(e,Ll(d,le,r),a,ae+`(${W}, use${l}Core, [`+(o||t)+(I?"], ["+I:t)+"]);",n,s)),q=(e,l,t,a)=>_(e,l,1,t,a),K=(e=0)=>re(U,(([l,a,n,d,o],s)=>{const r=e?[ve+` const ${s}: typeof ${s}Decl = ${o}(${l}): ${1==a?"any":a} =>`,n]:[ve+` function ${s}${o}(${l}): ${1==a?"ComponentReturnType":a};`];return e||B(r,Dl(d)),z(r,t),r}));c(null,l,Ve,"Store",Ce,Xl+"ized"+Ce),c(0,G,"ComponentReturnType"),c(1,G,"useCellIds"),c(null,G,"ExtraProps"),c(0,D,j);const X=V(J,j+" | "+Ve,`Used when you need to refer to a ${j} in a React hook or component`),Y=V(Ne+Ee,jl(M+ke+j,M+`ById?: {[${M}Id: Id]: ${j}}`),`Used with the ${Ne} component, so that a `+j+" can be passed into the context of an application");c(0,"react","ReactElement","ComponentType"),c(1,"react","React"),c(1,L,X,Y);const le=W+ke+X;A("{createContext, useContext, useMemo}","React"),A("Context",`createContext<[${j}?, {[${M}Id: Id]: ${j}}?]>([])`),Z("Create"+j,`create: () => ${j}, create`+fe,j,"\n// eslint-disable-next-line react-hooks/exhaustive-deps\nuseMemo(create, createDeps)",`Create a ${j} within a React application with convenient memoization`);const te=Z(j,"id?: Id",j+Se,["{",et,"return id == null ? contextValue[0] : contextValue[1]?.[id];","}"],`Get a reference to a ${j} from within a ${Ne} component context`),ae=x("useHook",W+`: ${X} | undefined, hook: (...params: any[]) => any, preParams: any[], postParams: any[] = []`,[`const ${M} = ${te}(${W} as Id);`,`return hook(...preParams, ((${W} == null || typeof ${W} == 'string')`,`? ${M} : ${W})?.getStore(), ...postParams)`]),ne=x("getProps","getProps: ((id: any) => ExtraProps) | undefined, id: Id","(getProps == null) ? ({} as ExtraProps) : getProps(id)"),se=x("wrap",Ll("children: any","separator?: any","encloseWithId?: boolean","id?: Id"),["const separated = separator==null || !Array.isArray(children)"," ? children"," : children.map((child, c) => (c > 0 ? [separator, child] : child));","return encloseWithId ? [id, ':{', separated, '}'] : separated;"]),Ie=x("useCustomOrDefaultCellIds",Ll("customCellIds: Ids | undefined","tableId: Id","rowId: Id",`${W}?: ${X} | undefined`),[`const defaultCellIds = ${ae}(${W}, useCellIds, [tableId, rowId]);`,"return customCellIds ?? defaultCellIds;"]),$e=A("NullComponent","() => null");if(!ee(e)){const[e,a,n,r,$,T,y,v,A,k,S,P,N,G,J,z,W,B,U,_]=s;c(null,D,e,a,n,$,T,y,v,A,k,S,P,N,G,J,z,W,U,B),c(0,D,r),c(1,D,j),c(null,l,i,"IdOrNull");const Z=x("tableView",`{${M}, rowComponent, getRowComponentProps, customCellIds`+st+"}: any, rowIds: Ids, tableId: Id, defaultRowComponent: React.ComponentType<any>",["const Row = rowComponent ?? defaultRowComponent;",`return ${se}(rowIds.map((rowId) => (`,"<Row","{..."+ne+"(getRowComponentProps, rowId)}","key={rowId}","tableId={tableId}",ot,"customCellIds={customCellIds}",F,ql,"/>","))",st,", tableId,",");"]),K=x("getDefaultTableComponent","tableId: Id",H(O(((e,l,t)=>`tableId == ${t} ? ${l}TableView : `)))+$e),X=x("getDefaultCellComponent","tableId: Id, cellId: Id",H(O(((e,l,t)=>`tableId == ${t} ? ${H(E(e,((e,t,a,n,d)=>`cellId == ${n} ? `+l+d+"CellView : ")))+$e} : `)))+$e);Q(u+p,u+p,d,ol(1,0,0,1)+pe),Q(p,p,e,ol(1,0)+pe);const Y=Q(C,C,n+Je,rl(b,ze)+pe);Q(He+p+Ce,He+p+Ce,nt,ol(1,9)+lt,Ll(_l(p)+Yl+a,_l(p)+fe),Zl(p),at,Ll(It,`tables: ${a})`+qe,Kl),ct),Q(ge+p+Ce,ge+p+Ce,Ce,ol(1,12),t,t,t,$t,ct);const ee=V(w+Ee,jl("tableId?: TId","rowId: Id","cellId?: CId",M+ke+j,Ql),$l(ie+w),`<TId extends ${n}, CId extends ${r}<TId>>`),le=V(h+Ee,jl("tableId?: TId","rowId: Id",M+ke+j,"cellComponents?: {readonly [CId in "+r+`<TId>]?: ComponentType<${ee}<TId, CId>>;}`,`getCellComponentProps?: (cellId: ${r}<TId>) => ExtraProps`,`customCellIds?: ${r}<TId>[]`,rt,Ql),$l(ie+h),`<TId extends ${n}>`),te=V(b+Ee,jl("tableId?: TId",M+ke+j,`rowComponent?: ComponentType<${le}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",rt,Ql),$l(ie+b),`<TId extends ${n}>`),ae=V("Sorted"+b+Ee,jl("tableId?: TId","cellId?: "+r+"<TId>","descending?: boolean","offset?: number","limit?: number",M+ke+j,`rowComponent?: ComponentType<${le}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",rt,Ql),$l(ie+"sorted "+b),`<TId extends ${n}>`),de=V(p+Ee,jl(M+ke+j,"tableComponents?: {readonly [TId in "+n+`]?: ComponentType<${te}<TId>>;}`,`getTableComponentProps?: (tableId: ${n}) => ExtraProps`,rt,Ql),$l(dl(1,1)));c(1,L,de,te,ae,le,ee),q(p+it,"{"+M+", tableComponents, getTableComponentProps"+st+"}: "+de,[se+`(${Y}(${M}).map((tableId) => {`,"const Table = (tableComponents?.[tableId] ?? "+K+"(tableId)) as React.ComponentType<TableProps<typeof tableId>>;","return <Table",`{...${ne}(getTableComponentProps, tableId)}`,"tableId={tableId}","key={tableId}",F,ql,"/>;","}), separator)"],ol(1,13)+pe),O(((e,l,a)=>{const[n,s,r,I,$]=oe(_,e);c(null,D,n,s,r,I,$),Q(u+l+b,u+b,d,Cl(e,0,1)+pe,t,a),Q(l+b,b,n,Cl(e)+pe,t,a),Q(l+b+f,b+f,i,rl(w,"the whole of "+bl(e))+pe,t,a),Q(l+h+me,h+me,o,"Gets the number of Rows in "+bl(e)+pe,t,a);const p=Q(l+m,m,i,rl(h,bl(e))+pe,t,a),C=Q(l+g,g,i,rl(h,bl(e),1)+pe,"cellId?: "+$+", descending?: boolean, offset?: number, limit?: number",a+", cellId, descending, offset, limit");Q(u+l+h,u+h,d,hl(e,0,1)+pe,ut,Ll(a,dt)),Q(l+h,h,r,hl(e)+pe,ut,Ll(a,dt)),Q(l+f,f,$+Je,rl(w,pl(e))+pe,ut,Ll(a,dt)),Q(He+l+b+Ce,He+b+Ce,nt,Cl(e,9)+lt,Ll(_l(b)+Yl+s,_l(b)+fe),Ll(a,Zl(b)),at,Ll(It,`table: ${s})`+qe,Kl),ct),Q(ge+l+b+Ce,ge+b+Ce,Ce,Cl(e,12),t,a,t,$t,ct),Q(He+l+h+Ce,He+h+Ce,nt,hl(e,9)+lt,Ll(ut,_l(h)+Yl+I,_l(h)+fe),Ll(a,dt,Zl(h)),at,Ll(It,`row: ${I})`+qe,Kl),ct),Q("Add"+l+h+Ce,"Add"+h+Ce,nt,hl(e,10)+lt,Ll(_l(h)+Yl+I,_l(h)+fe),Ll(a,Zl(h)),at,"then?: ("+Ll(ut+Se,"store: Store","row: "+I+")"+qe,"then"+fe)+", reuseRowIds?: boolean",ct+", reuseRowIds"),Q(He+l+Oe+h+Ce,He+Oe+h+Ce,nt,hl(e,11)+lt,Ll(ut,_l(Oe+h)+Yl+I,_l(Oe+h)+fe),Ll(a,dt,Zl(Oe+h)),at,Ll(It,`partialRow: ${I})`+qe,Kl),ct),Q(ge+l+h+Ce,ge+h+Ce,Ce,hl(e,12),ut,Ll(a,dt),t,$t,ct);const T=q(l+h+it,"{rowId, "+M+", cellComponents, getCellComponentProps, customCellIds"+st+`}: ${le}<'${e}'>`,[se+`(${Ie}(customCellIds, `+a+`, rowId, ${M}).map((cellId: ${$}) => {`,"const Cell = (cellComponents?.[cellId] ?? "+X+`(${a}, cellId)) as React.ComponentType<CellProps<typeof `+a+", typeof cellId>>;","return <Cell",`{...${ne}(getCellComponentProps, cellId)} `,"key={cellId}",`tableId={${a}}`,ot,"cellId={cellId}",F,ql,"/>;","})"+st+", rowId)"],hl(e,13)+pe);q(l+"Sorted"+b+it,"{cellId, descending, offset, limit, ...props}: "+ae+`<'${e}'>`,Z+"(props, "+C+`(cellId, descending, offset, limit, props.${M}), ${a}, ${T});`,Cl(e,13)+", sorted"+pe),q(l+b+it,`props: ${te}<'${e}'>`,Z+"(props, "+p+`(props.${M}), ${a}, ${T});`,Cl(e,13)+pe),E(e,((n,o,s,r,I)=>{const $="Map"+El(o,1);c(0,D,$),c(1,D,$),Q(u+l+I+b+w,u+b+w,d,`Gets ${nl(1)}the '${n}' Cell anywhere in `+bl(e)+pe,t,Ll(a,r)),Q(u+l+I+w,u+w,d,ml(e,n,0,1)+pe,ut,Ll(a,dt,r));const i=Q(l+I+w,w,o+(R(s)?Se:t),ml(e,n)+pe,ut,Ll(a,dt,r));Q(He+l+I+w+Ce,He+w+Ce,nt,ml(e,n,9)+lt,Ll(ut,_l(w)+Yl+o+" | "+$,_l(w)+fe),Ll(a,dt,r,Zl(w)),at,Ll(It,`cell: ${o} | ${$})`+qe,Kl),ct),Q(ge+l+I+w+Ce,ge+w+Ce,Ce,ml(e,n,12),Ll(ut,"forceDel?: boolean"),Ll(a,dt,r,"forceDel"),t,$t,ct),q(l+I+w+it,`{rowId, ${M}, debugIds}: `+ee+`<'${e}', '${n}'>`,[se+`('' + ${i}(rowId, `+M+`) ?? '', undefined, debugIds, ${r})`],ml(e,n,13)+pe)}))}));const re=H(O((e=>oe(_,e)?.[4]??t))," | ");Q(u+p+I,u+p+I,Qe,ol(1,8,0,1)+" changes",bt($),pt()),Q(p+I,p+I,Qe,ol(1,8)+" changes",bt(T),pt()),Q(C+I,C+I,Qe,il(2,0,1),bt(y),pt()),Q(u+b+I,u+b+I,Qe,il(3,0,0,1),bt(v,`tableId: ${n} | null`),pt("tableId")),Q(b+I,b+I,Qe,il(3,0),bt(A,`tableId: ${n} | null`),pt("tableId")),Q(b+f+I,b+f+I,Qe,il(14,3,1),bt(k,`tableId: ${n} | null`),pt("tableId")),Q(u+b+w+I,u+b+w+I,Qe,il(16,3,0,1),bt(S,`tableId: ${n} | null`,`cellId: ${re} | null`),pt("tableId","cellId")),Q(h+me+I,h+me+I,Qe,il(15,3),bt(P,`tableId: ${n} | null`),pt("tableId")),Q(m+I,m+I,Qe,il(4,3,1),bt(N,`tableId: ${n} | null`),pt("tableId")),Q(g+I,g+I,Qe,il(13,3,1),bt(G,`tableId: ${n} | null`,"cellId: "+re+Se,"descending: boolean","offset: number","limit: number"+Se),pt("tableId","cellId","descending","offset","limit")),Q(u+h+I,u+h+I,Qe,il(5,3,0,1),bt(J,`tableId: ${n} | null`,dt+": IdOrNull"),pt("tableId",dt)),Q(h+I,h+I,Qe,il(5,3),bt(z,`tableId: ${n} | null`,dt+": IdOrNull"),pt("tableId",dt)),Q(f+I,f+I,Qe,il(6,5,1),bt(W,`tableId: ${n} | null`,dt+": IdOrNull"),pt("tableId",dt)),Q(u+w+I,u+w+I,Qe,il(7,5,0,1),bt(B,`tableId: ${n} | null`,dt+": IdOrNull",`cellId: ${re} | null`),pt("tableId",dt,"cellId")),Q(w+I,w+I,Qe,il(7,5),bt(U,`tableId: ${n} | null`,dt+": IdOrNull",`cellId: ${re} | null`),pt("tableId",dt,"cellId"))}if(!ee(a)){const[e,l,a,n,o,s,$,i]=r;c(null,D,...r),c(1,D,j);const b=x("getDefaultValueComponent","valueId: Id",H(N(((e,l,t,a,n)=>`valueId == ${a} ? `+n+"ValueView : ")))+$e);Q(u+y,u+y,d,ol(2,0,0,1)+pe),Q(y,y,e,ol(2,0)+pe);const p=Q(v,v,a+Je,rl(T,ze)+pe);Q(He+y+Ce,He+y+Ce,nt,ol(2,9)+lt,Ll(_l(y)+Yl+l,_l(y)+fe),Zl(y),at,Ll(It,`values: ${l})`+qe,Kl),ct),Q(He+Oe+y+Ce,He+Oe+y+Ce,nt,ol(2,11)+lt,Ll(_l(Oe+y)+Yl+l,_l(Oe+y)+fe),Zl(Oe+y),at,Ll(It,`partialValues: ${l})`+qe,Kl),ct),Q(ge+y+Ce,ge+y+Ce,Ce,ol(2,12),t,t,t,$t,ct);const C=V(T+Ee,jl("valueId?: VId",M+ke+j,Ql),$l("a Value"),`<VId extends ${a}>`),h=V(y+Ee,jl(M+ke+j,"valueComponents?: {readonly [VId in "+a+`]?: ComponentType<${C}<VId>>;}`,`getValueComponentProps?: (valueId: ${a}) => ExtraProps`,rt,Ql),$l(dl(2,1)));c(1,L,h,C),q(y+it,"{"+M+", valueComponents, getValueComponentProps"+st+"}: "+h,[se+`(${p}(${M}).map((valueId) => {`,"const Value = valueComponents?.[valueId] ?? "+b+"(valueId);","return <Value",`{...${ne}(getValueComponentProps, valueId)}`,"key={valueId}",F,ql,"/>;","}), separator)"],ol(2,13)+pe),N(((e,l,a,n,o)=>{const s="Map"+El(l,1);c(0,D,s),c(1,D,s),Q(u+o+T,u+T,d,gl(e,0,1)+pe,t,n);const r=Q(o+T,T,l,gl(e)+pe,t,n);Q(He+o+T+Ce,He+T+Ce,nt,gl(e,9)+lt,Ll(_l(T)+Yl+l+" | "+s,_l(T)+fe),Ll(n,Zl(T)),at,Ll(It,`value: ${l} | ${s})`+qe,Kl),ct),Q(ge+o+T+Ce,ge+T+Ce,Ce,gl(e,12),t,n,t,$t,ct),q(o+T+it,`{${M}, debugIds}: ${C}<'${e}'>`,[se+`('' + ${r}(`+M+`) ?? '', undefined, debugIds, ${n})`],gl(e,13)+pe)})),Q(u+y+I,u+y+I,Qe,ol(2,8,0,1)+" changes",bt(n),pt()),Q(y+I,y+I,Qe,ol(2,8)+" changes",bt(o),pt()),Q(v+I,v+I,Qe,il(10,0,1),bt(s),pt()),Q(u+T+I,u+T+I,Qe,il(11,0,0,1),bt($,`valueId: ${a} | null`),pt("valueId")),Q(T+I,T+I,Qe,il(11,0),bt(i,`valueId: ${a} | null`),pt("valueId"))}return q(Ne,`{${M}, ${M}ById, children}: `+Y+" & {readonly children: React.ReactNode}",["{",et,"return (","<Context."+Ne,"value={useMemo(",`() => [${M} ?? contextValue[0], {...contextValue[1], ...${M}ById}],`,`[${M}, ${M}ById, contextValue],`,")}>","{children}",`</Context.${Ne}>`,");","}"],"Wraps part of an application in a context that provides default objects to be used by hooks and components within"),[$(...k(0),...S(),...K(0)),$(...k(1),...P(),...K(1))]},ht=(e,l,a)=>{if(ee(e)&&ee(l))return[t,t,t,t];const[n,d,o,s]=Ul(e,l,a);return[n,d,...Ct(e,l,a,o,s)]},mt=JSON.parse,gt="prettier/",wt=gt+"plugins/",ft={parser:"typescript",singleQuote:!0,trailingComma:"all",bracketSpacing:!1,jsdocSingleLineComment:!1},Tt=Ml((e=>{const l=()=>{const l=mt(e.getTablesSchemaJson());return!ee(l)||L(e.getTableIds(),(t=>{const a=e.getRowIds(t),n=de();if(L(a,(l=>L(e.getCellIds(t,l),(a=>{const d=e.getCell(t,l,a),o=$e(n,a,(()=>[D(d),de(),[0],0])),[s,r,[I]]=o,$=$e(r,d,(()=>0))+1;return $>I&&(o[2]=[$,d]),Ie(r,d,$),o[3]++,s==D(d)})))))return l[t]={},ae(n,(([e,,[,n],d],o)=>{l[t][o]={[s]:e,...d==E(a)?{[r]:n}:{}}})),1}))?l:{}},t=()=>{const l=mt(e.getValuesSchemaJson());return ee(l)&&e.forEachValue(((e,t)=>{l[e]={[s]:D(t)}})),l},a=e=>ht(l(),t(),e),n=async e=>{const l=["d.ts","ts","d.ts","tsx"],t=[];let n;try{n=(await import(gt+"standalone")).format,z(t,await import(wt+"estree"),await import(wt+"typescript"))}catch{n=async e=>e}return await N(M(a(e),(async(e,a)=>Pl(await n(e,{...ft,plugins:t,filepath:"_."+l[a]})))))};return K({getStoreStats:l=>{let t=0,a=0,n=0;const d={};return e.forEachTable(((e,o)=>{t++;let s=0,r=0;const I={};o(((e,t)=>{s++;let a=0;t((()=>a++)),r+=a,l&&(I[e]={rowCells:a})})),a+=s,n+=r,l&&(d[e]={tableRows:s,tableCells:r,rows:I})})),{totalTables:t,totalRows:a,totalCells:n,totalValues:E(e.getValueIds()),jsonLength:E(e.getJson()),...l?{detail:{tables:d}}:{}}},getStoreTablesSchema:l,getStoreValuesSchema:t,getStoreApi:a,getPrettyStoreApi:n,getStore:()=>e})}));exports.createTools=Tt;
|
|
1
|
+
"use strict";const e=e=>typeof e,l="tinybase",t="",a=",",n=e(t),d=e(!0),o=e(0),s="type",r="default",I="Listener",$="get",c="add",u="Has",i="Ids",b="Table",p=b+"s",C=b+i,h="Row",m=h+i,g="Sorted"+h+i,w="Cell",f=w+i,T="Value",y=T+"s",v=T+i,V="Transaction",x="Partial",R=(e,l=t,a)=>e.split(l,a),A=Promise,k=isFinite,S=e=>null==e,P=(e,l,t)=>S(e)?t?.():l(e),O=e=>e==n||e==d,E=l=>e(l)==n,N=e=>Array.isArray(e),D=(e,l,t)=>e.slice(l,t),L=e=>e.length,G=async e=>A.all(e),j=l=>{const t=e(l);return O(t)||t==o&&k(l)?t:void 0},H=(e,l)=>e.every(l),M=(e,l)=>e.sort(l),J=(e,l)=>e.forEach(l),z=(e,l=t)=>e.join(l),W=(e,l)=>e.map(l),B=(e,l)=>e.filter(l),F=(e,...l)=>e.push(...l),U=e=>e.pop(),_=(e,...l)=>e.unshift(...l),Z=e=>e.shift(),Q=Object,q=e=>Q.getPrototypeOf(e),K=Q.entries,X=e=>!S(e)&&P(q(e),(e=>e==Q.prototype||S(q(e))),(()=>!0)),Y=Q.keys,ee=Q.freeze,le=(e,l)=>W(K(e),(([e,t])=>l(t,e))),te=e=>L(Y(e)),ae=e=>X(e)&&0==te(e),ne=(e,l)=>e?.has(l)??!1,de=e=>[...e?.values()??[]],oe=(e,l)=>e?.forEach(l),se=(e,l)=>e?.delete(l),re=e=>new Map(e),Ie=(e,l)=>e?.get(l),$e=(e,l)=>oe(e,((e,t)=>l(t,e))),ce=(e,l)=>W([...e?.entries()??[]],(([e,t])=>l(t,e))),ue=(e,l,t)=>S(t)?(se(e,l),e):e?.set(l,t),ie=(e,l,t,a)=>(ne(e,l)||ue(e,l,t()),Ie(e,l)),be=e=>e.toUpperCase(),pe=e=>e.toLowerCase(),Ce="a ",he="A function for",me=", and registers a listener so that any changes to that result will cause a re-render",ge="Callback",we="Changes",fe="Count",Te="Del",ye="Deps",ve=ye+"?: React.DependencyList",Ve="doRollback?: DoRollback",xe="actions: () => Return, "+Ve,Re="export",Ae="Id",ke="Invalid",Se="Json",Pe=pe(I),Oe="?: ",Ee=" | undefined",Ne="NonNullable",De="Props",Le="Provider",Ge=`Registers a ${Pe} that will be called`,je="Represents",He="rowId: "+Ae,Me="Schema",Je="Set",ze=", descending?: boolean, offset?: number, limit?: number",We="[]",Be="the Store",Fe=pe(V),Ue="Execute a "+Fe+" to make multiple mutations",_e="Explicitly starts a "+Fe,Ze="Explicitly finishes a "+Fe,Qe="the end of the "+Fe,qe="void",Ke=" => "+qe,Xe="WhenSet",Ye=" when setting it",el=Ce+"string serialization of",ll=" ",tl="Gets a callback that can ",al="the ",nl=" the schema for",dl=(e=0)=>e?"the existence of ":"",ol=(e=0,l=0,a=0)=>dl(a)+`the ${vl[e]}content of`+(l?ll+Be:t),sl=(e=0,l,a=0,n=0)=>fl[l]+ll+dl(n)+ol(e,1)+(a?" when setting it":t),rl=(e,l=0)=>je+` a Row when ${l?"s":"g"}etting ${ol()} the '${e}' `+b,Il=(e,l,t=0)=>`Gets ${t?"sorted, paginated":"the"} Ids of the ${e}s in `+l,$l=(e,l)=>`Calls a function for each ${e} in `+l,cl=e=>"The props passed to a component that renders "+e,ul=e=>"A function that takes "+e,il=(e,l=0,t=0)=>he+" listening to changes to "+dl(t)+yl[e]+" in "+yl[l],bl=(e,l,a=0,n=0)=>Ge+" whenever "+dl(n)+yl[e]+" in "+yl[l]+" change"+(a?t:"s"),pl=e=>`the '${e}' `+b,Cl=e=>"the specified Row in "+pl(e),hl=(e,l=0,t=0)=>fl[l]+ll+ol(0,0,t)+ll+pl(e),ml=(e,l=0,t=0)=>fl[l]+` ${ol(0,0,t)} `+Cl(e),gl=(e,l,t=0,a=0)=>fl[t]+ll+dl(a)+`the '${l}' Cell for `+Cl(e),wl=(e,l=0,t=0)=>fl[l]+ll+dl(t)+`the '${e}' Value`,fl=["Gets","Checks existence of","Sets","Deletes","Sets part of",je,"Gets "+el,"Sets "+el,Ge+" whenever",tl+"set",tl+"add",tl+"set part of",tl+"delete","Renders","Gets "+el+nl,"Sets"+nl,"Deletes"+nl],Tl=[$,"has","set","del","set","forEach",c,t],yl=[Be,p,al+b+ll+i,Ce+b,al+h+ll+i,Ce+h,al+w+ll+i,Ce+w,"invalid Cell changes",y,al+T+ll+i,Ce+T,"invalid Value changes",al+"sorted "+h+ll+i,al+w+ll+i+" anywhere",al+"number of Rows",Ce+w+" anywhere"],vl=[t,"tabular ","keyed value "],Vl=e=>new Set(N(e)||S(e)?e:[e]),xl=(e,l)=>e?.add(l),Rl=/[^A-Za-z]+/,Al=/[^A-Za-z0-9]+/,kl=/^( *)\/\*\* *(.*?) *\*\/$/gm,Sl=e=>e.includes(a),Pl=(e,l,t,a=1)=>{const n=`${l}${1==a?"":a}`;return ne(e,n)?Pl(e,l,t,a+1):(ue(e,n,t),n)},Ol=e=>e.replace(kl,((e,l,t)=>{const a=77-L(l);return`${l}/**\n${t.replace(RegExp(`([^\\n]{1,${a}})(\\s|$)`,"g"),l+" * $1\n")}${l} */`})),El=e=>e.flat(1e3),Nl=(e,l=0)=>z(W(R(e,Al),((e,t)=>(t>0||l?be:pe)(D(e,0,1))+D(e,1)))),Dl=e=>be(z(R(e&&!Rl.test(e[0])?e:" "+e,Al),"_")),Ll=e=>`/** ${e}. */`,Gl=(...e)=>z(B(e,(e=>e)),", "),jl=(...e)=>"{"+z(e,"; ")+"}",Hl=(...e)=>jl(...W(e,(e=>"readonly "+e))),Ml=()=>{const e=[re(),re(),re(),re()],l=re(),a=re(),n=e=>{const l=e.indexOf(" as ");return-1!=l?D(e,l+4):e};return[(...e)=>z(El(e),"\n"),(l,t,...a)=>J(a,(a=>J([0,1],(n=>(l??n)==n?xl(ie(e[n],t,Vl),a):0)))),(e,a,n,d=t,o=1)=>Pl(l,e,[a,n,d,o]),(e,l,t)=>Pl(a,e,N(t)?[`(${l}) => {`,t,"}"]:[`(${l}) => ${t}`]),(e,l)=>Ie(a,e)===l?e:Pl(a,e,l),(l=0)=>W([...M(ce(e[l],((e,l)=>`import {${z(M(de(e),((e,l)=>n(e)>n(l)?1:-1)),", ")}} from '${l}';`)),((e,l)=>Sl(e)!=Sl(l)?Sl(e)?-1:1:e>l?1:-1)),t],(e=>e.replace("{React}","React"))),()=>ce(l,(([e,l,a,n],d)=>[Ll(l),`${n?Re+" ":t}type ${d}${a} = ${e};`,t])),()=>ce(a,((e,l)=>(e=N(e)?e:[e],F(e,U(e)+";"),[`const ${l} = ${Z(e)}`,e,t])))]},Jl=(e,l)=>{const t=new WeakMap;return l=>(t.has(l)||t.set(l,e(l)),t.get(l))},zl=(e,l,t)=>[l=>le(e,((e,a)=>l(a,Nl(a,1),t(Dl(a),`'${a}'`)))),(l,a)=>le(e[l],((e,l)=>a(l,e[s],e[r],t(Dl(l),`'${l}'`),Nl(l,1)))),e=>le(l,((l,a)=>e(a,l[s],l[r],t(Dl(a),`'${a}'`),Nl(a,1))))],Wl=(e,l,a,n)=>[(n,d)=>{const o=n+": "+d,s=e(p,jl(...l((e=>`'${e}'?: {[rowId: Id]: `+jl(...a(e,((e,l,a)=>`'${e}'${S(a)?"?":t}: ${l}`)))+"}"))),sl(1,5)),r=e(p+Xe,jl(...l((e=>`'${e}'?: {[rowId: Id]: `+jl(...a(e,((e,l)=>`'${e}'?: ${l}`)))+"}"))),sl(1,5,1)),$=e(b+Ae,"keyof "+s,"A "+b+" Id in "+Be),c=`<TId extends ${$}>`,i=e(b,Ne+`<${s}[TId]>`,"A "+b+" in "+Be,c),T=e(b+Xe,Ne+`<${r}[TId]>`,"A "+b+" in "+Be+Ye,c),y=e(h,i+"<TId>[Id]","A "+h+" in a "+b,c),v=e(h+Xe,T+"<TId>[Id]","A "+h+" in a "+b+Ye,c),V=e(w+Ae,`Extract<keyof ${y}<TId>, Id>`,"A "+w+" Id in a "+h,c),x=e(w,Ne+`<${s}[TId]>[Id][CId]`,"A "+w+" in a "+h,`<TId extends ${$}, CId extends ${V}<TId>>`),R=e("CellIdCellArray",`CId extends ${V}<TId> ? [cellId: CId, cell: ${x}<TId, CId>] : never`,w+" Ids and types in a "+h,`<TId extends ${$}, CId = ${V}<TId>>`,0),A=e(w+ge,`(...[cellId, cell]: ${R}<TId>)`+Ke,ul(Ce+w+" Id, and "+w),c),k=e(h+ge,"(rowId: Id, forEachCell: (cellCallback: CellCallback<TId>) "+Ke+") "+Ke,ul(Ce+h+" Id, and a "+w+" iterator"),c),P=e(b+w+ge,`(cellId: ${V}<TId>, count: number) `+Ke,ul(Ce+w+" Id, and count of how many times it appears"),c),O=e("TableIdForEachRowArray",`TId extends ${$} ? [tableId: TId, forEachRow: (rowCallback: ${k}<TId>)${Ke}] : never`,b+" Ids and callback types",`<TId = ${$}>`,0),E=e(b+ge,`(...[tableId, forEachRow]: ${O})`+Ke,ul(Ce+b+" Id, and a "+h+" iterator"),t),N=e("TableIdRowIdCellIdArray",`TId extends ${$} ? [tableId: TId, rowId: Id, cellId: ${V}<TId>] : never`,"Ids for GetCellChange",`<TId = ${$}>`,0),D=e("GetCellChange",`(...[tableId, rowId, cellId]: ${N}) => CellChange`,he+" returning information about any Cell's changes during a "+Fe),L=e(u+p+I,`(${o}, hasTables: boolean)`+Ke,il(1,0,1)),G=e(p+I,`(${o}, getCellChange: ${D}${Ee})`+Ke,il(1)),j=e(C+I,`(${o})`+Ke,il(2)),H=e(u+b+I,`(${o}, tableId: ${$}, hasTable: boolean)`+Ke,il(3,0,1)),M=e(b+I,`(${o}, tableId: ${$}, getCellChange: ${D}${Ee})`+Ke,il(3)),J=e(b+f+I,`(${o}, tableId: ${$})`+Ke,il(14,3)),z=e("HasTableCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,"Cell args for HasTableCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),W=e("HasTableCellListenerArgsArrayOuter",`TId extends ${$} ? `+z+"<TId> : never","Table args for HasTableCellListener",`<TId = ${$}>`,0),B=e(u+b+w+I,`(...[${n}, tableId, cellId, hasTableCell]: `+W+")"+Ke,il(16,3,1)),F=e(h+"Count"+I,`(${o}, tableId: ${$})`+Ke,il(15,3)),U=e(m+I,`(${o}, tableId: ${$})`+Ke,il(4,3)),_=e(g+I,"("+Gl(o,"tableId: "+$,"cellId: Id"+Ee,"descending: boolean","offset: number","limit: number"+Ee,"sortedRowIds: Ids")+")"+Ke,il(13,3)),Z=e(u+h+I,"("+Gl(""+o,"tableId: "+$,He,"hasRow: boolean")+")"+Ke,il(5,3,1)),Q=e(h+I,"("+Gl(""+o,"tableId: "+$,He,`getCellChange: ${D}${Ee}`)+")"+Ke,il(5,3)),q=e(f+I,"("+Gl(""+o,"tableId: "+$,He)+")"+Ke,il(6,5)),K=e("HasCellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${He}, cellId: CId, hasCell: boolean] : never`,"Cell args for HasCellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),X=e("HasCellListenerArgsArrayOuter",`TId extends ${$} ? `+K+"<TId> : never","Table args for HasCellListener",`<TId = ${$}>`,0),Y=e(u+w+I,`(...[${n}, tableId, rowId, cellId, hasCell]: `+X+")"+Ke,il(7,5,1)),ee=e("CellListenerArgsArrayInner",`CId extends ${V}<TId> ? [${o}, tableId: TId, ${He}, cellId: CId, newCell: ${x}<TId, CId> ${Ee}, oldCell: ${x}<TId, CId> ${Ee}, getCellChange: ${D} ${Ee}] : never`,"Cell args for CellListener",`<TId extends ${$}, CId = ${V}<TId>>`,0),le=e("CellListenerArgsArrayOuter",`TId extends ${$} ? `+ee+"<TId> : never","Table args for CellListener",`<TId = ${$}>`,0);return[s,r,$,i,T,y,v,V,x,A,k,P,E,L,G,j,H,M,J,B,F,U,_,Z,Q,q,Y,e(w+I,`(...[${n}, tableId, rowId, cellId, newCell, oldCell, getCellChange]: ${le})`+Ke,il(7,5)),e(ke+w+I,`(${o}, tableId: Id, ${He}, cellId: Id, invalidCells: any[])`+Ke,il(8))]},(l,a)=>{const d=l+": "+a,o=e(y,jl(...n(((e,l,a)=>`'${e}'${S(a)?"?":t}: ${l}`))),sl(2,5)),s=e(y+Xe,jl(...n(((e,l)=>`'${e}'?: ${l}`))),sl(2,5,1)),r=e(T+Ae,"keyof "+o,"A "+T+" Id in "+Be),$=e(T,Ne+`<${o}[VId]>`,"A "+T+" Id in "+Be,`<VId extends ${r}>`),c=e("ValueIdValueArray",`VId extends ${r} ? [valueId: VId, value: ${$}<VId>] : never`,T+" Ids and types in "+Be,`<VId = ${r}>`,0),i=e(T+ge,`(...[valueId, value]: ${c})`+Ke,ul(Ce+T+" Id, and "+T)),b=e("GetValueChange",`(valueId: ${r}) => ValueChange`,he+" returning information about any Value's changes during a "+Fe),p=e(u+y+I,`(${d}, hasValues: boolean)`+Ke,il(9,0,1)),C=e(y+I,`(${d}, getValueChange: ${b}${Ee})`+Ke,il(9)),h=e(v+I,`(${d})`+Ke,il(10)),m=e(u+T+I,`(${d}, valueId: ValueId, hasValue: boolean)`+Ke,il(11,0,1)),g=e("ValueListenerArgsArray",`VId extends ${r} ? [${d}, valueId: VId, newValue: ${$}<VId> ${Ee}, oldValue: ${$}<VId> ${Ee}, getValueChange: ${b} ${Ee}] : never`,"Value args for ValueListener",`<VId = ${r}>`,0);return[o,s,r,$,i,p,C,h,m,e(T+I,`(...[${l}, valueId, newValue, oldValue, getValueChange]: `+g+")"+Ke,il(11)),e(ke+T+I,`(${d}, valueId: Id, invalidValues: any[])`+Ke,il(12))]},(l,t)=>e(V+I,`(${l}: ${t})`+Ke,he+" listening to the completion of a "+Fe)],Bl=(e,l=t,a=t)=>`store.${e}(${l})`+(a?" as "+a:t),Fl=(e,l=t)=>`fluent(() => ${Bl(e,l)})`,Ul=(e,l=t,a=t)=>`store.${e}(${l?l+", ":t}proxy(listener)${a?", "+a:t})`,_l=(e,a,n)=>{const[o,$,R,A,k,P,O,N]=Ml(),[D,L,G]=zl(e,a,k),[j,H,M]=Wl(R,D,L,G),W=re(),B=(e=0)=>ce(W,(([l,a,n,d,o],s)=>{const r=e?[s+`: ${o}(${l}): ${a} => ${n},`]:[s+o+`(${l}): ${a};`];return e||_(r,Ll(d)),F(r,t),r})),U=(e,l,a,n,d,o=t)=>Pl(W,e,[l,a,n,d,o]),Z=(e,l,a,n,d,o=t,s=t,r=t)=>U(Tl[e]+l+(4==e?x:t)+a,o,n,(n==K?Fl:Bl)(Tl[e]+(4==e?x:t)+a,s,e?void 0:n),d,r),Q=(e,l,a,n=t,d=t,o=1,s=t)=>U(c+e+I,(n?n+", ":t)+Pe+": "+l+(o?", mutator?: boolean":t),Ae,Ul(c+e+I,d,o?"mutator":t),a,s),q=`./${Nl(n)}.d`,K=Nl(n,1),X=Nl(K),Y=[],ee=re();let le=[],te=[];if($(1,q,K,`create${K} as create${K}Decl`),ae(e))$(null,l,p);else{$(0,l,"CellChange"),$(null,l,i);const[e,a,n,o,I,c,T,y,v,V,x,A,P,O,N,G,H,M,W,B,U,_,te,ae,ne,oe,se,$e,ce]=j(X,K),ie=re();D(((e,l)=>{const t=`<'${e}'>`,a=[R(l+b,o+t,je+` the '${e}' `+b),R(l+b+Xe,I+t,je+` the '${e}' `+b+Ye),R(l+h,c+t,rl(e)),R(l+h+Xe,T+t,rl(e,1)),R(l+w+Ae,y+t,`A Cell Id for the '${e}' `+b),R(l+w+ge,V+t,ul(`a Cell Id and value from a Row in the '${e}' `+b)),R(l+h+ge,x+t,ul(`a Row Id from the '${e}' Table, and a Cell iterator`)),R(l+b+w+ge,A+t,ul(`a Cell Id from anywhere in the '${e}' Table, and a count of how many times it appears`))];ue(ie,e,a),$(1,q,...a)})),$(1,q,e,a,n,y,P,O,N,G,H,M,W,B,U,_,te,ae,ne,oe,se,$e,ce),le=[e,a,n,y,O,N,G,H,M,W,B,U,_,te,ae,ne,oe,se,$e,ie],J([[e],[d],[K,"tables: "+a,"tables"],[K]],(([e,l,a],n)=>Z(n,t,p,e,sl(1,n),l,a))),Z(0,t,C,n+We,Il(b,Be)),Z(5,t,b,qe,$l(b,Be),"tableCallback: "+P,"tableCallback as any"),D(((e,l,a)=>{const[n,o,s,r,I,$,c,u]=Ie(ie,e);J([[n],[d],[K,"table: "+o,", table"],[K]],(([n,d,o=t],s)=>Z(s,l,b,n,hl(e,s),d,a+o))),Z(0,l,b+f,i,Il(w,"the whole of "+pl(e)),t,a),Z(5,l,b+w,qe,$l(b+w,"the whole of "+pl(e)),"tableCellCallback: "+u,a+", tableCellCallback as any"),Z(0,l,h+fe,"number","Gets the number of Rows in the "+pl(e),t,a),Z(0,l,m,i,Il(h,pl(e)),t,a),Z(0,l,g,i,Il(h,pl(e),1),"cellId?: "+I+ze,a+", cellId, descending, offset, limit"),Z(5,l,h,qe,$l(h,pl(e)),"rowCallback: "+c,a+", rowCallback as any"),J([[s],[d],[K,", row: "+r,", row"],[K],[K,", partialRow: "+r,", partialRow"]],(([n,d=t,o=t],s)=>Z(s,l,h,n,ml(e,s),He+d,a+", rowId"+o))),Z(6,l,h,Ae+Ee,"Add a new Row to "+pl(e),"row: "+r+", reuseIds?: boolean",a+", row, reuseIds"),Z(0,l,f,I+We,Il(w,Cl(e)),He,a+", rowId"),Z(5,l,w,qe,$l(w,Cl(e)),He+", cellCallback: "+$,a+", rowId, cellCallback as any"),L(e,((n,o,s,r,I)=>{const $="Map"+Nl(o,1);ue(ee,o,$);const c=o+(S(s)?Ee:t);J([[c],[d],[K,`, cell: ${o} | `+$,", cell as any"],[K]],(([d,o=t,s=t],$)=>Z($,l+I,w,d,gl(e,n,$),He+o,a+", rowId, "+r+s))),Z(1,l+I,b+w,d,fl[1]+` the '${n}' Cell anywhere in `+pl(e),t,a+", "+r)}))})),Z(0,t,p+Se,Se,sl(1,6)),Z(2,t,p+Se,K,sl(1,7),"tablesJson: "+Se,"tables"+Se),Q(u+p,O,sl(1,8,0,1)+" changes"),Q(p,N,sl(1,8)+" changes"),Q(C,G,bl(2,0,1)),Q(u+b,H,bl(3,0,0,1),`tableId: ${n} | null`,"tableId"),Q(b,M,bl(3,0),`tableId: ${n} | null`,"tableId"),Q(b+f,W,bl(14,3,1),`tableId: ${n} | null`,"tableId"),Q(u+b+w,B,bl(16,3,0,1),`tableId: ${n} | null, cellId: ${z(D((e=>Ie(ie,e)?.[4]??t))," | ")} | null`,"tableId, cellId"),Q(h+fe,U,bl(15,3),`tableId: ${n} | null`,"tableId"),Q(m,_,bl(4,3,1),`tableId: ${n} | null`,"tableId"),Q(g,te,bl(13,3,1),Gl("tableId: TId",`cellId: ${y}<TId>`+Ee,"descending: boolean","offset: number","limit: number"+Ee),Gl("tableId","cellId","descending","offset","limit"),1,"<TId extends TableId>"),Q(u+h,ae,bl(5,3,0,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Q(h,ne,bl(5,3),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Q(f,oe,bl(6,5,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Q(u+w,se,bl(7,5,0,1),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${z(D((e=>Ie(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),Q(w,$e,bl(7,5),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${z(D((e=>Ie(ie,e)?.[4]??t))," | ")} | null`,"tableId, rowId, cellId"),Q(ke+w,ce,Ge+" whenever an invalid Cell change was attempted","tableId: IdOrNull, rowId: IdOrNull, cellId: IdOrNull","tableId, rowId, cellId"),$(1,q,...de(ee)),F(Y,".set"+p+Me+"({",El(D(((e,l,a)=>[`[${a}]: {`,...L(e,((e,l,a,n)=>`[${n}]: {[${k(Dl(s),`'${s}'`)}]: ${k(Dl(l),`'${l}'`)}${S(a)?t:`, [${k(Dl(r),`'${r}'`)}]: `+(E(a)?k(Dl(a),`'${a}'`):a)}},`)),"},"]))),"})")}if(ae(a))$(null,l,y);else{const[e,a,n,o,I,c,i,b,p,C,h]=H(X,K);$(1,q,e,a,n,I,c,i,b,p,C,h),te=[e,a,n,c,i,b,p,C],J([[e],[d],[K,"values: "+a,"values"],[K],[K,"partialValues: "+a,"partialValues"]],(([e,l,a],n)=>Z(n,t,y,e,sl(2,n),l,a))),Z(0,t,v,n+We,Il(T,Be)),Z(5,t,T,"void",$l(T,Be),"valueCallback: "+I,"valueCallback as any"),G(((e,l,a,n,o)=>{const s="Map"+Nl(l,1);ue(ee,l,s),J([[l],[d],[K,`value: ${l} | `+s,", value as any"],[K]],(([l,a,d=t],s)=>Z(s,o,T,l,wl(e,s),a,n+d)))})),Z(0,t,y+Se,Se,sl(2,6)),Z(2,t,y+Se,K,sl(2,7),"valuesJson: "+Se,"values"+Se),Q(u+y,c,sl(2,8,0,1)+" changes"),Q(y,i,sl(2,8)+" changes"),Q(v,b,bl(10,0,1)),Q(u+T,p,bl(11,0,0,1),`valueId: ${n} | null`,"valueId"),Q(T,C,bl(11,0),`valueId: ${n} | null`,"valueId"),Q(ke+T,h,Ge+" whenever an invalid Value change was attempted","valueId: IdOrNull","valueId"),$(1,q,...de(ee)),$(0,l,"ValueChange"),F(Y,".set"+y+Me+"({",G(((e,l,a,n)=>[`[${n}]: {[${k(Dl(s),`'${s}'`)}]: ${k(Dl(l),`'${l}'`)}${S(a)?t:`, [${k(Dl(r),`'${r}'`)}]: `+(E(a)?k(Dl(a),`'${a}'`):a)}},`])),"})")}Z(0,t,"Content",`[${p}, ${y}]`,sl(0,0)),Z(2,t,"Content",K,sl(0,2),`[tables, values]: [${p}, ${y}]`,"[tables, values]"),Z(7,t,"applyChanges",K,`Applies a set of ${we} to the Store`,"changes: "+we,"changes"),$e(ee,((e,l)=>R(l,`(cell: ${e}${Ee}) => `+e,`Takes a ${e} Cell value and returns another`))),$(null,l,"DoRollback",Ae,"IdOrNull",Se,"Store",we),Z(0,t,Se,Se,sl(0,6)),Z(2,t,Se,K,sl(0,7),"tablesAndValuesJson: "+Se,"tablesAndValuesJson"),Z(7,t,Fe,"Return",Ue,xe,"actions, doRollback","<Return>"),Z(7,t,"start"+V,K,_e),Z(7,t,"finish"+V,K,Ze,Ve,"doRollback");const ne=M(X,K);return Q("Start"+V,ne,Ge+" just before the start of the "+Fe,t,t,0),Q("WillFinish"+V,ne,Ge+" just before "+Qe,t,t,0),Q("DidFinish"+V,ne,Ge+" just after "+Qe,t,t,0),Z(7,t,"call"+I,K,"Manually provoke a listener to be called","listenerId: Id","listenerId"),Z(3,t,I,K,"Remove a listener that was previously added to "+Be,"listenerId: Id","listenerId"),U("getStore",t,"Store","store",fl[0]+" the underlying Store object"),$(1,l,"createStore"),$(1,q,K,`create${K} as create${K}Decl`,ne),k("store",["createStore()",...Y]),A("fluent","actions: () => Store",["actions();",`return ${X};`]),A("proxy","listener: any",`(_: Store, ...params: any[]) => listener(${X}, ...params)`),k(X,["{",...B(1),"}"]),[o(...P(0),...O(),Re+" interface "+K+" {",...B(0),"}",t,Ll(`Creates a ${K} object`),Re+" function create"+K+"(): "+K+";"),o(...P(1),Re+" const create"+K+": typeof create"+K+"Decl = () => {",...N(),`return Object.freeze(${X});`,"};"),le,te]},Zl=e=>$+e,Ql=e=>Gl(Zl(e),Zl(e)+ye),ql="debugIds?: boolean",Kl="debugIds={debugIds}",Xl="then"+ve,Yl="Parameter",et=": (parameter: "+Yl+", store: Store) => ",lt="const contextValue = useContext(Context);",tt=", based on a parameter",at=": ",nt="<"+Yl+",>",dt=Yl+"ized"+ge+"<"+Yl+">",ot="rowId",st="rowId={rowId}",rt=", separator, debugIds",It="separator?: ReactElement | string",$t="then?: (store: Store",ct=Gl($t+")"+Ke,Xl),ut="then, then"+ye,it=ot+at+Ae,bt="View",pt=(e,...l)=>Gl(...l,Pe+": "+e,Pe+ve,"mutator?: boolean"),Ct=(...e)=>Gl(...e,Pe,Pe+ye,"mutator"),ht=(e,a,n,s,r)=>{const[$,c,V,R,A,k,P,O]=Ml(),[E,N,D]=zl(e,a,A),L=`./${Nl(n)}.d`,G=`./${Nl(n)}-ui-react.d`,j="tinybase/ui-react",H=Nl(n,1),M=Nl(H),J=H+"Or"+H+Ae,W=M+"Or"+H+Ae,B=M+`={${M}}`,U=re(),Z=(e,l,a,n,d,o=t)=>(c(1,G,e+" as "+e+"Decl"),Pl(U,e,[l,a,n,d,o])),Q=(e,l,a,n,d,o=t)=>Z("use"+e,l,a,n,d,o),q=(e,l,a,n,d=t,o=t,s=t,r=t,I=t)=>(c(1,j,`use${l} as use${l}Core`),Q(e,Gl(d,le,r),a,ne+`(${W}, use${l}Core, [`+(o||t)+(I?"], ["+I:t)+"]);",n,s)),K=(e,l,t,a)=>Z(e,l,1,t,a),X=(e=0)=>ce(U,(([l,a,n,d,o],s)=>{const r=e?[Re+` const ${s}: typeof ${s}Decl = ${o}(${l}): ${1==a?"any":a} =>`,n]:[Re+` function ${s}${o}(${l}): ${1==a?"ComponentReturnType":a};`];return e||_(r,Ll(d)),F(r,t),r}));c(null,l,Ae,"Store",ge,Yl+"ized"+ge),c(0,j,"ComponentReturnType"),c(1,j,"useCellIds"),c(null,j,"ExtraProps"),c(0,L,H);const Y=V(J,H+" | "+Ae,`Used when you need to refer to a ${H} in a React hook or component`),ee=V(Le+De,Hl(M+Oe+H,M+`ById?: {[${M}Id: Id]: ${H}}`),`Used with the ${Le} component, so that a `+H+" can be passed into the context of an application");c(0,"react","ReactElement","ComponentType"),c(1,"react","React"),c(1,G,Y,ee);const le=W+Oe+Y;A("{createContext, useContext, useMemo}","React"),A("Context",`createContext<[${H}?, {[${M}Id: Id]: ${H}}?]>([])`),Q("Create"+H,`create: () => ${H}, create`+ve,H,"\n// eslint-disable-next-line react-hooks/exhaustive-deps\nuseMemo(create, createDeps)",`Create a ${H} within a React application with convenient memoization`);const te=Q(H,"id?: Id",H+Ee,["{",lt,"return id == null ? contextValue[0] : contextValue[1]?.[id];","}"],`Get a reference to a ${H} from within a ${Le} component context`),ne=R("useHook",W+`: ${Y} | undefined, hook: (...params: any[]) => any, preParams: any[], postParams: any[] = []`,[`const ${M} = ${te}(${W} as Id);`,`return hook(...preParams, ((${W} == null || typeof ${W} == 'string')`,`? ${M} : ${W})?.getStore(), ...postParams)`]),de=R("getProps","getProps: ((id: any) => ExtraProps) | undefined, id: Id","(getProps == null) ? ({} as ExtraProps) : getProps(id)"),oe=R("wrap",Gl("children: any","separator?: any","encloseWithId?: boolean","id?: Id"),["const separated = separator==null || !Array.isArray(children)"," ? children"," : children.map((child, c) => (c > 0 ? [separator, child] : child));","return encloseWithId ? [id, ':{', separated, '}'] : separated;"]),se=R("useCustomOrDefaultCellIds",Gl("customCellIds: Ids | undefined","tableId: Id","rowId: Id",`${W}?: ${Y} | undefined`),[`const defaultCellIds = ${ne}(${W}, useCellIds, [tableId, rowId]);`,"return customCellIds ?? defaultCellIds;"]),$e=A("NullComponent","() => null");if(!ae(e)){const[e,a,n,r,$,T,y,v,A,k,P,O,D,j,J,W,F,U,_,Z]=s;c(null,L,e,a,n,$,T,y,v,A,k,P,O,D,j,J,W,F,_,U),c(0,L,r),c(1,L,H),c(null,l,i,"IdOrNull");const Q=R("tableView",`{${M}, rowComponent, getRowComponentProps, customCellIds`+rt+"}: any, rowIds: Ids, tableId: Id, defaultRowComponent: React.ComponentType<any>",["const Row = rowComponent ?? defaultRowComponent;",`return ${oe}(rowIds.map((rowId) => (`,"<Row","{..."+de+"(getRowComponentProps, rowId)}","key={rowId}","tableId={tableId}",st,"customCellIds={customCellIds}",B,Kl,"/>","))",rt,", tableId,",");"]),X=R("getDefaultTableComponent","tableId: Id",z(E(((e,l,t)=>`tableId == ${t} ? ${l}TableView : `)))+$e),Y=R("getDefaultCellComponent","tableId: Id, cellId: Id",z(E(((e,l,t)=>`tableId == ${t} ? ${z(N(e,((e,t,a,n,d)=>`cellId == ${n} ? `+l+d+"CellView : ")))+$e} : `)))+$e);q(u+p,u+p,d,sl(1,0,0,1)+me),q(p,p,e,sl(1,0)+me);const ee=q(C,C,n+We,Il(b,Be)+me);q(Je+p+ge,Je+p+ge,dt,sl(1,9)+tt,Gl(Zl(p)+et+a,Zl(p)+ve),Ql(p),nt,Gl($t,`tables: ${a})`+Ke,Xl),ut),q(Te+p+ge,Te+p+ge,ge,sl(1,12),t,t,t,ct,ut);const le=V(w+De,Hl("tableId?: TId","rowId: Id","cellId?: CId",M+Oe+H,ql),cl(Ce+w),`<TId extends ${n}, CId extends ${r}<TId>>`),te=V(h+De,Hl("tableId?: TId","rowId: Id",M+Oe+H,"cellComponents?: {readonly [CId in "+r+`<TId>]?: ComponentType<${le}<TId, CId>>;}`,`getCellComponentProps?: (cellId: ${r}<TId>) => ExtraProps`,`customCellIds?: ${r}<TId>[]`,It,ql),cl(Ce+h),`<TId extends ${n}>`),ae=V(b+De,Hl("tableId?: TId",M+Oe+H,`rowComponent?: ComponentType<${te}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",It,ql),cl(Ce+b),`<TId extends ${n}>`),ne=V("Sorted"+b+De,Hl("tableId?: TId","cellId?: "+r+"<TId>","descending?: boolean","offset?: number","limit?: number",M+Oe+H,`rowComponent?: ComponentType<${te}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",It,ql),cl(Ce+"sorted "+b),`<TId extends ${n}>`),re=V(p+De,Hl(M+Oe+H,"tableComponents?: {readonly [TId in "+n+`]?: ComponentType<${ae}<TId>>;}`,`getTableComponentProps?: (tableId: ${n}) => ExtraProps`,It,ql),cl(ol(1,1)));c(1,G,re,ae,ne,te,le),K(p+bt,"{"+M+", tableComponents, getTableComponentProps"+rt+"}: "+re,[oe+`(${ee}(${M}).map((tableId) => {`,"const Table = (tableComponents?.[tableId] ?? "+X+"(tableId)) as React.ComponentType<TableProps<typeof tableId>>;","return <Table",`{...${de}(getTableComponentProps, tableId)}`,"tableId={tableId}","key={tableId}",B,Kl,"/>;","}), separator)"],sl(1,13)+me),E(((e,l,a)=>{const[n,s,r,I,$]=Ie(Z,e);c(null,L,n,s,r,I,$),q(u+l+b,u+b,d,hl(e,0,1)+me,t,a),q(l+b,b,n,hl(e)+me,t,a),q(l+b+f,b+f,i,Il(w,"the whole of "+pl(e))+me,t,a),q(l+h+fe,h+fe,o,"Gets the number of Rows in "+pl(e)+me,t,a);const p=q(l+m,m,i,Il(h,pl(e))+me,t,a),C=q(l+g,g,i,Il(h,pl(e),1)+me,"cellId?: "+$+", descending?: boolean, offset?: number, limit?: number",a+", cellId, descending, offset, limit");q(u+l+h,u+h,d,ml(e,0,1)+me,it,Gl(a,ot)),q(l+h,h,r,ml(e)+me,it,Gl(a,ot)),q(l+f,f,$+We,Il(w,Cl(e))+me,it,Gl(a,ot)),q(Je+l+b+ge,Je+b+ge,dt,hl(e,9)+tt,Gl(Zl(b)+et+s,Zl(b)+ve),Gl(a,Ql(b)),nt,Gl($t,`table: ${s})`+Ke,Xl),ut),q(Te+l+b+ge,Te+b+ge,ge,hl(e,12),t,a,t,ct,ut),q(Je+l+h+ge,Je+h+ge,dt,ml(e,9)+tt,Gl(it,Zl(h)+et+I,Zl(h)+ve),Gl(a,ot,Ql(h)),nt,Gl($t,`row: ${I})`+Ke,Xl),ut),q("Add"+l+h+ge,"Add"+h+ge,dt,ml(e,10)+tt,Gl(Zl(h)+et+I,Zl(h)+ve),Gl(a,Ql(h)),nt,"then?: ("+Gl(it+Ee,"store: Store","row: "+I+")"+Ke,"then"+ve)+", reuseRowIds?: boolean",ut+", reuseRowIds"),q(Je+l+x+h+ge,Je+x+h+ge,dt,ml(e,11)+tt,Gl(it,Zl(x+h)+et+I,Zl(x+h)+ve),Gl(a,ot,Ql(x+h)),nt,Gl($t,`partialRow: ${I})`+Ke,Xl),ut),q(Te+l+h+ge,Te+h+ge,ge,ml(e,12),it,Gl(a,ot),t,ct,ut);const T=K(l+h+bt,"{rowId, "+M+", cellComponents, getCellComponentProps, customCellIds"+rt+`}: ${te}<'${e}'>`,[oe+`(${se}(customCellIds, `+a+`, rowId, ${M}).map((cellId: ${$}) => {`,"const Cell = (cellComponents?.[cellId] ?? "+Y+`(${a}, cellId)) as React.ComponentType<CellProps<typeof `+a+", typeof cellId>>;","return <Cell",`{...${de}(getCellComponentProps, cellId)} `,"key={cellId}",`tableId={${a}}`,st,"cellId={cellId}",B,Kl,"/>;","})"+rt+", rowId)"],ml(e,13)+me);K(l+"Sorted"+b+bt,"{cellId, descending, offset, limit, ...props}: "+ne+`<'${e}'>`,Q+"(props, "+C+`(cellId, descending, offset, limit, props.${M}), ${a}, ${T});`,hl(e,13)+", sorted"+me),K(l+b+bt,`props: ${ae}<'${e}'>`,Q+"(props, "+p+`(props.${M}), ${a}, ${T});`,hl(e,13)+me),N(e,((n,o,s,r,I)=>{const $="Map"+Nl(o,1);c(0,L,$),c(1,L,$),q(u+l+I+b+w,u+b+w,d,`Gets ${dl(1)}the '${n}' Cell anywhere in `+pl(e)+me,t,Gl(a,r)),q(u+l+I+w,u+w,d,gl(e,n,0,1)+me,it,Gl(a,ot,r));const i=q(l+I+w,w,o+(S(s)?Ee:t),gl(e,n)+me,it,Gl(a,ot,r));q(Je+l+I+w+ge,Je+w+ge,dt,gl(e,n,9)+tt,Gl(it,Zl(w)+et+o+" | "+$,Zl(w)+ve),Gl(a,ot,r,Ql(w)),nt,Gl($t,`cell: ${o} | ${$})`+Ke,Xl),ut),q(Te+l+I+w+ge,Te+w+ge,ge,gl(e,n,12),Gl(it,"forceDel?: boolean"),Gl(a,ot,r,"forceDel"),t,ct,ut),K(l+I+w+bt,`{rowId, ${M}, debugIds}: `+le+`<'${e}', '${n}'>`,[oe+`('' + ${i}(rowId, `+M+`) ?? '', undefined, debugIds, ${r})`],gl(e,n,13)+me)}))}));const ce=z(E((e=>Ie(Z,e)?.[4]??t))," | ");q(u+p+I,u+p+I,qe,sl(1,8,0,1)+" changes",pt($),Ct()),q(p+I,p+I,qe,sl(1,8)+" changes",pt(T),Ct()),q(C+I,C+I,qe,bl(2,0,1),pt(y),Ct()),q(u+b+I,u+b+I,qe,bl(3,0,0,1),pt(v,`tableId: ${n} | null`),Ct("tableId")),q(b+I,b+I,qe,bl(3,0),pt(A,`tableId: ${n} | null`),Ct("tableId")),q(b+f+I,b+f+I,qe,bl(14,3,1),pt(k,`tableId: ${n} | null`),Ct("tableId")),q(u+b+w+I,u+b+w+I,qe,bl(16,3,0,1),pt(P,`tableId: ${n} | null`,`cellId: ${ce} | null`),Ct("tableId","cellId")),q(h+fe+I,h+fe+I,qe,bl(15,3),pt(O,`tableId: ${n} | null`),Ct("tableId")),q(m+I,m+I,qe,bl(4,3,1),pt(D,`tableId: ${n} | null`),Ct("tableId")),q(g+I,g+I,qe,bl(13,3,1),pt(j,`tableId: ${n} | null`,"cellId: "+ce+Ee,"descending: boolean","offset: number","limit: number"+Ee),Ct("tableId","cellId","descending","offset","limit")),q(u+h+I,u+h+I,qe,bl(5,3,0,1),pt(J,`tableId: ${n} | null`,ot+": IdOrNull"),Ct("tableId",ot)),q(h+I,h+I,qe,bl(5,3),pt(W,`tableId: ${n} | null`,ot+": IdOrNull"),Ct("tableId",ot)),q(f+I,f+I,qe,bl(6,5,1),pt(F,`tableId: ${n} | null`,ot+": IdOrNull"),Ct("tableId",ot)),q(u+w+I,u+w+I,qe,bl(7,5,0,1),pt(U,`tableId: ${n} | null`,ot+": IdOrNull",`cellId: ${ce} | null`),Ct("tableId",ot,"cellId")),q(w+I,w+I,qe,bl(7,5),pt(_,`tableId: ${n} | null`,ot+": IdOrNull",`cellId: ${ce} | null`),Ct("tableId",ot,"cellId"))}if(!ae(a)){const[e,l,a,n,o,s,$,i]=r;c(null,L,...r),c(1,L,H);const b=R("getDefaultValueComponent","valueId: Id",z(D(((e,l,t,a,n)=>`valueId == ${a} ? `+n+"ValueView : ")))+$e);q(u+y,u+y,d,sl(2,0,0,1)+me),q(y,y,e,sl(2,0)+me);const p=q(v,v,a+We,Il(T,Be)+me);q(Je+y+ge,Je+y+ge,dt,sl(2,9)+tt,Gl(Zl(y)+et+l,Zl(y)+ve),Ql(y),nt,Gl($t,`values: ${l})`+Ke,Xl),ut),q(Je+x+y+ge,Je+x+y+ge,dt,sl(2,11)+tt,Gl(Zl(x+y)+et+l,Zl(x+y)+ve),Ql(x+y),nt,Gl($t,`partialValues: ${l})`+Ke,Xl),ut),q(Te+y+ge,Te+y+ge,ge,sl(2,12),t,t,t,ct,ut);const C=V(T+De,Hl("valueId?: VId",M+Oe+H,ql),cl("a Value"),`<VId extends ${a}>`),h=V(y+De,Hl(M+Oe+H,"valueComponents?: {readonly [VId in "+a+`]?: ComponentType<${C}<VId>>;}`,`getValueComponentProps?: (valueId: ${a}) => ExtraProps`,It,ql),cl(ol(2,1)));c(1,G,h,C),K(y+bt,"{"+M+", valueComponents, getValueComponentProps"+rt+"}: "+h,[oe+`(${p}(${M}).map((valueId) => {`,"const Value = valueComponents?.[valueId] ?? "+b+"(valueId);","return <Value",`{...${de}(getValueComponentProps, valueId)}`,"key={valueId}",B,Kl,"/>;","}), separator)"],sl(2,13)+me),D(((e,l,a,n,o)=>{const s="Map"+Nl(l,1);c(0,L,s),c(1,L,s),q(u+o+T,u+T,d,wl(e,0,1)+me,t,n);const r=q(o+T,T,l,wl(e)+me,t,n);q(Je+o+T+ge,Je+T+ge,dt,wl(e,9)+tt,Gl(Zl(T)+et+l+" | "+s,Zl(T)+ve),Gl(n,Ql(T)),nt,Gl($t,`value: ${l} | ${s})`+Ke,Xl),ut),q(Te+o+T+ge,Te+T+ge,ge,wl(e,12),t,n,t,ct,ut),K(o+T+bt,`{${M}, debugIds}: ${C}<'${e}'>`,[oe+`('' + ${r}(`+M+`) ?? '', undefined, debugIds, ${n})`],wl(e,13)+me)})),q(u+y+I,u+y+I,qe,sl(2,8,0,1)+" changes",pt(n),Ct()),q(y+I,y+I,qe,sl(2,8)+" changes",pt(o),Ct()),q(v+I,v+I,qe,bl(10,0,1),pt(s),Ct()),q(u+T+I,u+T+I,qe,bl(11,0,0,1),pt($,`valueId: ${a} | null`),Ct("valueId")),q(T+I,T+I,qe,bl(11,0),pt(i,`valueId: ${a} | null`),Ct("valueId"))}return K(Le,`{${M}, ${M}ById, children}: `+ee+" & {readonly children: React.ReactNode}",["{",lt,"return (","<Context."+Le,"value={useMemo(",`() => [${M} ?? contextValue[0], {...contextValue[1], ...${M}ById}],`,`[${M}, ${M}ById, contextValue],`,")}>","{children}",`</Context.${Le}>`,");","}"],"Wraps part of an application in a context that provides default objects to be used by hooks and components within"),[$(...k(0),...P(),...X(0)),$(...k(1),...O(),...X(1))]},mt=(e,l,a)=>{if(ae(e)&&ae(l))return[t,t,t,t];const[n,d,o,s]=_l(e,l,a);return[n,d,...ht(e,l,a,o,s)]},gt=JSON.parse,wt="prettier/",ft=wt+"plugins/",Tt={parser:"typescript",singleQuote:!0,trailingComma:"all",bracketSpacing:!1,jsdocSingleLineComment:!1},yt=Jl((e=>{const l=()=>{const l=gt(e.getTablesSchemaJson());return!ae(l)||H(e.getTableIds(),(t=>{const a=e.getRowIds(t),n=re();if(H(a,(l=>H(e.getCellIds(t,l),(a=>{const d=e.getCell(t,l,a),o=ie(n,a,(()=>[j(d),re(),[0],0])),[s,r,[I]]=o,$=ie(r,d,(()=>0))+1;return $>I&&(o[2]=[$,d]),ue(r,d,$),o[3]++,s==j(d)})))))return l[t]={},oe(n,(([e,,[,n],d],o)=>{l[t][o]={[s]:e,...d==L(a)?{[r]:n}:{}}})),1}))?l:{}},t=()=>{const l=gt(e.getValuesSchemaJson());return ae(l)&&e.forEachValue(((e,t)=>{l[e]={[s]:j(t)}})),l},a=e=>mt(l(),t(),e),n=async e=>{const l=["d.ts","ts","d.ts","tsx"],t=[];let n;try{n=(await import(wt+"standalone")).format,F(t,await import(ft+"estree"),await import(ft+"typescript"))}catch{n=async e=>e}return await G(W(a(e),(async(e,a)=>Ol(await n(e,{...Tt,plugins:t,filepath:"_."+l[a]})))))};return ee({getStoreStats:l=>{let t=0,a=0,n=0;const d={};return e.forEachTable(((e,o)=>{t++;let s=0,r=0;const I={};o(((e,t)=>{s++;let a=0;t((()=>a++)),r+=a,l&&(I[e]={rowCells:a})})),a+=s,n+=r,l&&(d[e]={tableRows:s,tableCells:r,rows:I})})),{totalTables:t,totalRows:a,totalCells:n,totalValues:L(e.getValueIds()),jsonLength:L(e.getJson()),...l?{detail:{tables:d}}:{}}},getStoreTablesSchema:l,getStoreValuesSchema:t,getStoreApi:a,getPrettyStoreApi:n,getStore:()=>e})}));exports.createTools=yt;
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),u="Listener",n="Result",i="Has",l="Ids",p="Table",d=p+"s",a=p+l,x="Row",c=x+"Count",I=x+l,C="Sorted"+x+l,b="Cell",w=b+l,R="Value",k=R+"s",h=R+l,y="Status",S=globalThis,L=e=>null==e,g=(e,s,t)=>L(e)?t?.():s(e),m=e=>s(e)==r,V=e=>s(e)==o,T=e=>e.length,P=()=>{},v=(e,s)=>e.every(s),f=(e,s)=>T(e)===T(s)&&v(e,((e,t)=>s[t]===e)),B=(e,s)=>e.map(s),M=(e,s,t)=>e.with(s,t),q=Object,H=e=>q.getPrototypeOf(e),z=q.entries,Q=e=>!L(e)&&g(H(e),(e=>e==q.prototype||L(H(e))),(()=>!0)),O=q.keys,D=(e,s)=>g(e,(e=>e[s])),F=(e,s)=>s in e,E=(e,s)=>{const t=z(e);return T(t)===T(O(s))&&v(t,(([e,t])=>Q(t)?!!Q(s[e])&&E(s[e],t):s[e]===t))},{createContext:A,useContext:G,useEffect:W}=e;var j=(e=>(e[e.Store=0]="Store",e[e.Metrics=1]="Metrics",e[e.Indexes=2]="Indexes",e[e.Relationships=3]="Relationships",e[e.Queries=4]="Queries",e[e.Checkpoints=5]="Checkpoints",e[e.Persister=6]="Persister",e[e.Synchronizer=7]="Synchronizer",e))(j||{});const U=(K=()=>A([]),F(_=S,J="tinybase_uirc")||(_[J]=K()),_[J]);var _,J,K;const N=(e,s)=>{const t=G(U);return L(e)?t[2*s]:m(e)?D(t[2*s+1]??{},e):e},X=(e,s)=>{const t=N(e,s);return L(e)||m(e)?t:e},Y=(e,s,t)=>{const{16:r,17:o}=G(U);W((()=>(r?.(t,e,s),()=>o?.(t,e))),[r,e,s,t,o])},Z=e=>O(G(U)[2*e+1]??{}),$=e=>X(e,0),ee=e=>X(e,1),se=e=>X(e,2),te=e=>X(e,3),re=e=>X(e,4),oe=e=>X(e,5),ue=e=>X(e,6),ne=e=>X(e,7),ie=e=>e.toLowerCase();ie(u);const le="Transaction";ie(le);const{useCallback:pe,useEffect:de,useMemo:ae,useLayoutEffect:xe,useRef:ce,useState:Ie,useSyncExternalStore:Ce}=e,be=[],we=[{},[],[be,void 0,be],void 0,!1,0],Re=[E,f,([e,s,t],[r,o,u])=>s===o&&f(e,r)&&f(t,u)],ke=(e,s)=>e===s,he=(e,s,t=be)=>{const[,r]=Ie(),[o,u]=Ie();return de((()=>{const t=e?s(e):void 0;return u(t),r([]),t?.destroy}),[e,...t]),o},ye=(e,s,...t)=>{const r=e?.["add"+s+u]?.(...t);return()=>e?.delListener(r)},Se=(e,s,r,o=be)=>{const u=ce(we[r]),n=pe((()=>{const t=s?.[(4==r?"has":"get")+e]?.(...o)??we[r];return(Re[r]??ke)(t,u.current)?u.current:u.current=t}),[s,r,e,...o]),l=pe((u=>ye(s,(4==r?i:t)+e,...o,u)),[s,r,e,...o]);return Ce(l,n,n)},Le=(e,s,t,r=be,o=be,...u)=>xe((()=>ye(s,e,...o,t,...u)),[s,e,...o,...r,...u]),ge=(e,s,t,r=be,o=P,u=be,...n)=>{const i=$(e);return pe((e=>g(i,(r=>g(t(e,r),(t=>o(r["set"+s](...me(n,r,e),t),t)))))),[i,s,...r,...u,...Ve(n)])},me=(e,s,t)=>B(e,(e=>V(e)?e(t,s):e)),Ve=e=>{return s=e=>!V(e),e.filter(s);var s},Te=(e,s,t=P,r=be,...o)=>{const u=$(e);return pe((e=>t(u?.["del"+s](...me(o,u,e)))),[u,s,...r,...Ve(o)])},Pe=(e,s,t)=>{const r=oe(e);return pe((()=>r?.[s](t)),[r,s,t])},ve=e=>Se(a,$(e),1),fe=(e,s)=>Se(I,$(s),1,[e]),Be=(e,s,t,r=0,o,u)=>Se(C,$(u),1,[e,s,t,r,o]),Me=(e,s,t)=>Se(w,$(t),1,[e,s]),qe=(e,s,t,r)=>Se(b,$(r),3,[e,s,t]),He=e=>Se(h,$(e),1),ze=(e,s)=>Se(R,$(s),3,[e]),Qe=(e,s)=>Se("Metric",ee(s),3,[e]),Oe=(e,s)=>Se("SliceIds",se(s),1,[e]),De=(e,s,t)=>Se("Slice"+I,se(t),1,[e,s]),Fe=(e,s,t)=>Se("RemoteRowId",te(t),3,[e,s]),Ee=(e,s,t)=>Se("Local"+I,te(t),1,[e,s]),Ae=(e,s,t)=>Se("Linked"+I,te(t),1,[e,s]),Ge=(e,s)=>Se(n+I,re(s),1,[e]),We=(e,s,t,r=0,o,u)=>Se(n+C,re(u),1,[e,s,t,r,o]),je=(e,s,t)=>Se(n+w,re(t),1,[e,s]),Ue=(e,s,t,r)=>Se(n+b,re(r),3,[e,s,t]),_e=e=>Se("CheckpointIds",oe(e),2),Je=(e,s)=>Se("Checkpoint",oe(s),3,[e]),Ke=e=>Pe(e,"goBackward"),Ne=e=>Pe(e,"goForward"),{PureComponent:Xe,Fragment:Ye,createElement:Ze,useCallback:$e,useLayoutEffect:es,useRef:ss,useState:ts}=e,rs=(e,...s)=>L(e)?{}:e(...s),os=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:us,useContext:ns,useMemo:is,useState:ls}=e,ps=(e,s,t,r,o)=>[t??s[2*e],{...s[2*e+1],...r,...o[e]}],ds=({tableId:e,store:s,rowComponent:t=bs,getRowComponentProps:r,customCellIds:o,separator:u,debugIds:n},i)=>Is(B(i,(u=>Ze(t,{...rs(r,u),key:u,tableId:e,rowId:u,customCellIds:o,store:s,debugIds:n}))),u,n,e),as=({queryId:e,queries:s,resultRowComponent:t=ys,getResultRowComponentProps:r,separator:o,debugIds:u},n)=>Is(B(n,(o=>Ze(t,{...rs(r,o),key:o,queryId:e,rowId:o,queries:s,debugIds:u}))),o,u,e),xs=({relationshipId:e,relationships:s,rowComponent:t=bs,getRowComponentProps:r,separator:o,debugIds:u},n,i)=>{const[l,p,d]=os(te(s),e),a=n(e,i,l);return Is(B(a,(e=>Ze(t,{...rs(r,e),key:e,tableId:d,rowId:e,store:p,debugIds:u}))),o,u,i)},cs=e=>({checkpoints:s,checkpointComponent:t=Ss,getCheckpointComponentProps:r,separator:o,debugIds:u})=>{const n=oe(s);return Is(B(e(_e(n)),(e=>Ze(t,{...rs(r,e),key:e,checkpoints:n,checkpointId:e,debugIds:u}))),o)},Is=(e,s,t,r)=>{const o=L(s)||!Array.isArray(e)?e:B(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Cs=({tableId:e,rowId:s,cellId:r,store:o,debugIds:u})=>Is(t+(qe(e,s,r,o)??t),void 0,u,r),bs=({tableId:e,rowId:s,store:t,cellComponent:r=Cs,getCellComponentProps:o,customCellIds:u,separator:n,debugIds:i})=>Is(B(((e,s,t,r)=>{const o=Me(s,t,r);return e??o})(u,e,s,t),(u=>Ze(r,{...rs(o,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:i}))),n,i,s),ws=e=>ds(e,fe(e.tableId,e.store)),Rs=({valueId:e,store:s,debugIds:r})=>Is(t+(ze(e,s)??t),void 0,r,e),ks=({indexId:e,sliceId:s,indexes:t,rowComponent:r=bs,getRowComponentProps:o,separator:u,debugIds:n})=>{const[i,l,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(se(t),e),d=De(e,s,i);return Is(B(d,(e=>Ze(r,{...rs(o,e),key:e,tableId:p,rowId:e,store:l,debugIds:n}))),u,n,s)},hs=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:u})=>Is(t+(Ue(e,s,r,o)??t),void 0,u,r),ys=({queryId:e,rowId:s,queries:t,resultCellComponent:r=hs,getResultCellComponentProps:o,separator:u,debugIds:n})=>Is(B(je(e,s,t),(u=>Ze(r,{...rs(o,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:n}))),u,n,s),Ss=({checkpoints:e,checkpointId:s,debugIds:r})=>Is(Je(s,e)??t,void 0,r,s),Ls=cs((e=>e[0])),gs=cs((e=>L(e[1])?[]:[e[1]])),ms=cs((e=>e[2]));exports.BackwardCheckpointsView=Ls,exports.CellView=Cs,exports.CheckpointView=Ss,exports.CurrentCheckpointView=gs,exports.ForwardCheckpointsView=ms,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ks,getSliceComponentProps:r,separator:o,debugIds:u})=>Is(B(Oe(e,s),(o=>Ze(t,{...rs(r,o),key:o,indexId:e,sliceId:o,indexes:s,debugIds:u}))),o,u,e),exports.LinkedRowsView=e=>xs(e,Ae,e.firstRowId),exports.LocalRowsView=e=>xs(e,Ee,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>Is(Qe(e,s)??t,void 0,r,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:u,relationships:n,relationshipsById:i,queries:l,queriesById:p,checkpoints:d,checkpointsById:a,persister:x,persistersById:c,synchronizer:I,synchronizersById:C,children:b})=>{const w=ns(U),[R,k]=ls((()=>B([,,,,,,,,].fill(0),((e,s)=>({}))))),h=us(((e,s,t)=>k((r=>D(r[e],s)==t?r:M(r,e,{...r[e],[s]:t})))),[]),y=us(((e,s)=>k((t=>F(t[e],s)?M(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return Ze(U.Provider,{value:is((()=>[...ps(j.Store,w,e,s,R),...ps(j.Metrics,w,t,r,R),...ps(j.Indexes,w,o,u,R),...ps(j.Relationships,w,n,i,R),...ps(j.Queries,w,l,p,R),...ps(j.Checkpoints,w,d,a,R),...ps(j.Persister,w,x,c,R),...ps(j.Synchronizer,w,I,C,R),h,y]),[R,e,s,t,r,o,u,n,i,l,p,d,a,x,c,I,C,w,h,y])},b)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=bs,getRowComponentProps:o,debugIds:u})=>{const[n,i,,l]=os(te(t),e),p=Fe(e,s,n);return Is(L(l)||L(p)?null:Ze(r,{...rs(o,p),key:p,tableId:l,rowId:p,store:i,debugIds:u}),void 0,u,s)},exports.ResultCellView=hs,exports.ResultRowView=ys,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>as(o,We(o.queryId,e,s,t,r,o.queries)),exports.ResultTableView=e=>as(e,Ge(e.queryId,e.queries)),exports.RowView=bs,exports.SliceView=ks,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>ds(o,Be(o.tableId,e,s,t,r,o.store)),exports.TableView=ws,exports.TablesView=({store:e,tableComponent:s=ws,getTableComponentProps:t,separator:r,debugIds:o})=>Is(B(ve(e),(r=>Ze(s,{...rs(t,r),key:r,tableId:r,store:e,debugIds:o}))),r),exports.ValueView=Rs,exports.ValuesView=({store:e,valueComponent:s=Rs,getValueComponentProps:t,separator:r,debugIds:o})=>Is(B(He(e),(r=>Ze(s,{...rs(t,r),key:r,valueId:r,store:e,debugIds:o}))),r),exports.useAddRowCallback=(e,s,t=be,r,o=P,u=be,n=!0)=>{const i=$(r);return pe((t=>g(i,(r=>g(s(t,r),(s=>o(r.addRow(V(e)?e(t,r):e,s,n),r,s)))))),[i,e,...t,...u,n])},exports.useCell=qe,exports.useCellIds=Me,exports.useCellIdsListener=(e,s,t,r,o,u)=>Le(w,$(u),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,u,n)=>Le(b,$(n),r,o,[e,s,t],u),exports.useCheckpoint=Je,exports.useCheckpointIds=_e,exports.useCheckpointIdsListener=(e,s,t)=>Le("CheckpointIds",oe(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>Le("Checkpoint",oe(r),s,t,[e]),exports.useCheckpoints=e=>N(e,5),exports.useCheckpointsIds=()=>Z(5),exports.useCheckpointsOrCheckpointsById=oe,exports.useCreateCheckpoints=(e,s,t)=>he(e,s,t),exports.useCreateIndexes=(e,s,t)=>he(e,s,t),exports.useCreateMergeableStore=(e,s=be)=>ae(e,s),exports.useCreateMetrics=(e,s,t)=>he(e,s,t),exports.useCreatePersister=(e,s,t=be,r,o=be,u,n=be)=>{const[,i]=Ie(),[l,p]=Ie();return de((()=>{(async()=>{const t=e?await s(e):void 0;p(t),t&&r&&(async()=>{await r(t),i([])})()})()}),[e,...t,...o]),de((()=>()=>{l&&(l.destroy(),u?.(l))}),[l,...n]),l},exports.useCreateQueries=(e,s,t)=>he(e,s,t),exports.useCreateRelationships=(e,s,t)=>he(e,s,t),exports.useCreateStore=(e,s=be)=>ae(e,s),exports.useCreateSynchronizer=(e,s,t=be,r,o=be)=>{const[u,n]=Ie();return de((()=>{(async()=>{const t=e?await s(e):void 0;n(t)})()}),[e,...t]),de((()=>()=>{u&&(u.destroy(),r?.(u))}),[u,...o]),u},exports.useDelCellCallback=(e,s,t,r,o,u,n)=>Te(o,b,u,n,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Te(t,x,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Te(s,p,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Te(e,d,s,t),exports.useDelValueCallback=(e,s,t,r)=>Te(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Te(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>Le("DidFinish"+le,$(t),e,s),exports.useGoBackwardCallback=Ke,exports.useGoForwardCallback=Ne,exports.useGoToCallback=(e,s=be,t,r=P,o=be)=>{const u=oe(t);return pe((s=>g(u,(t=>g(e(s),(e=>r(t.goTo(e),e)))))),[u,...s,...o])},exports.useHasCell=(e,s,t,r)=>Se(b,$(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,u,n)=>Le(i+b,$(n),r,o,[e,s,t],u),exports.useHasRow=(e,s,t)=>Se(x,$(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,u)=>Le(i+x,$(u),t,r,[e,s],o),exports.useHasTable=(e,s)=>Se(p,$(s),4,[e]),exports.useHasTableCell=(e,s,t)=>Se(p+b,$(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,u)=>Le(i+p+b,$(u),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>Le(i+p,$(o),s,t,[e],r),exports.useHasTables=e=>Se(d,$(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>Le(i+d,$(r),e,s,[],t),exports.useHasValue=(e,s)=>Se(R,$(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>Le(i+R,$(o),s,t,[e],r),exports.useHasValues=e=>Se(k,$(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>Le(i+k,$(r),e,s,[],t),exports.useIndexIds=e=>Se("IndexIds",se(e),1),exports.useIndexes=e=>N(e,2),exports.useIndexesIds=()=>Z(2),exports.useIndexesOrIndexesById=se,exports.useLinkedRowIds=Ae,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>Le("Linked"+I,te(o),t,r,[e,s]),exports.useLocalRowIds=Ee,exports.useLocalRowIdsListener=(e,s,t,r,o)=>Le("Local"+I,te(o),t,r,[e,s]),exports.useMetric=Qe,exports.useMetricIds=e=>Se("MetricIds",ee(e),1),exports.useMetricListener=(e,s,t,r)=>Le("Metric",ee(r),s,t,[e]),exports.useMetrics=e=>N(e,1),exports.useMetricsIds=()=>Z(1),exports.useMetricsOrMetricsById=ee,exports.usePersister=e=>N(e,6),exports.usePersisterIds=()=>Z(6),exports.usePersisterOrPersisterById=ue,exports.usePersisterStatus=e=>Se(y,ue(e),5,[]),exports.usePersisterStatusListener=(e,s,t)=>Le(y,ue(t),e,s,[]),exports.useProvideCheckpoints=(e,s)=>Y(e,s,5),exports.useProvideIndexes=(e,s)=>Y(e,s,2),exports.useProvideMetrics=(e,s)=>Y(e,s,1),exports.useProvidePersister=(e,s)=>Y(e,s,6),exports.useProvideQueries=(e,s)=>Y(e,s,4),exports.useProvideRelationships=(e,s)=>Y(e,s,3),exports.useProvideStore=(e,s)=>Y(e,s,0),exports.useProvideSynchronizer=(e,s)=>Y(e,s,7),exports.useQueries=e=>N(e,4),exports.useQueriesIds=()=>Z(4),exports.useQueriesOrQueriesById=re,exports.useQueryIds=e=>Se("QueryIds",re(e),1),exports.useRedoInformation=e=>{const s=oe(e),[,,[r]]=_e(s);return[!L(r),Ne(s),r,g(r,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>Se("RelationshipIds",te(e),1),exports.useRelationships=e=>N(e,3),exports.useRelationshipsIds=()=>Z(3),exports.useRelationshipsOrRelationshipsById=te,exports.useRemoteRowId=Fe,exports.useRemoteRowIdListener=(e,s,t,r,o)=>Le("RemoteRowId",te(o),t,r,[e,s]),exports.useResultCell=Ue,exports.useResultCellIds=je,exports.useResultCellIdsListener=(e,s,t,r,o)=>Le(n+w,re(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,u)=>Le(n+b,re(u),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>Se(n+x,re(t),0,[e,s]),exports.useResultRowCount=(e,s)=>Se(n+c,re(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>Le(n+c,re(r),s,t,[e]),exports.useResultRowIds=Ge,exports.useResultRowIdsListener=(e,s,t,r)=>Le(n+I,re(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>Le(n+x,re(o),t,r,[e,s]),exports.useResultSortedRowIds=We,exports.useResultSortedRowIdsListener=(e,s,t,r,o,u,i,l)=>Le(n+C,re(l),u,i,[e,s,t,r,o]),exports.useResultTable=(e,s)=>Se(n+p,re(s),0,[e]),exports.useResultTableCellIds=(e,s)=>Se(n+p+w,re(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>Le(n+p+w,re(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>Le(n+p,re(r),s,t,[e]),exports.useRow=(e,s,t)=>Se(x,$(t),0,[e,s]),exports.useRowCount=(e,s)=>Se(c,$(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>Le(c,$(o),s,t,[e],r),exports.useRowIds=fe,exports.useRowIdsListener=(e,s,t,r,o)=>Le(I,$(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,u)=>Le(x,$(u),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,u,n,i)=>ge(u,b,r,o,n,i,e,s,t),exports.useSetCheckpointCallback=(e=P,s=be,t,r=P,o=be)=>{const u=oe(t);return pe((s=>g(u,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[u,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,u,n)=>ge(o,"PartialRow",t,r,u,n,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>ge(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,u,n)=>ge(o,x,t,r,u,n,e,s),exports.useSetTableCallback=(e,s,t,r,o,u)=>ge(r,p,s,t,o,u,e),exports.useSetTablesCallback=(e,s,t,r,o)=>ge(t,d,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,u)=>ge(r,R,s,t,o,u,e),exports.useSetValuesCallback=(e,s,t,r,o)=>ge(t,k,e,s,r,o),exports.useSliceIds=Oe,exports.useSliceIdsListener=(e,s,t,r)=>Le("SliceIds",se(r),s,t,[e]),exports.useSliceRowIds=De,exports.useSliceRowIdsListener=(e,s,t,r,o)=>Le("Slice"+I,se(o),t,r,[e,s]),exports.useSortedRowIds=Be,exports.useSortedRowIdsListener=(e,s,t,r,o,u,n,i,l)=>Le(C,$(l),u,n,[e,s,t,r,o],i),exports.useStartTransactionListener=(e,s,t)=>Le("Start"+le,$(t),e,s),exports.useStore=e=>N(e,0),exports.useStoreIds=()=>Z(0),exports.useStoreOrStoreById=$,exports.useSynchronizer=e=>N(e,7),exports.useSynchronizerIds=()=>Z(7),exports.useSynchronizerOrSynchronizerById=ne,exports.useSynchronizerStatus=e=>Se(y,ne(e),5,[]),exports.useSynchronizerStatusListener=(e,s,t)=>Le(y,ne(t),e,s,[]),exports.useTable=(e,s)=>Se(p,$(s),0,[e]),exports.useTableCellIds=(e,s)=>Se(p+w,$(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>Le(p+w,$(o),s,t,[e],r),exports.useTableIds=ve,exports.useTableIdsListener=(e,s,t,r)=>Le(a,$(r),e,s,be,t),exports.useTableListener=(e,s,t,r,o)=>Le(p,$(o),s,t,[e],r),exports.useTables=e=>Se(d,$(e),0),exports.useTablesListener=(e,s,t,r)=>Le(d,$(r),e,s,be,t),exports.useUndoInformation=e=>{const s=oe(e),[r,o]=_e(s);return[(u=r,!(0==T(u))),Ke(s),o,g(o,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=ze,exports.useValueIds=He,exports.useValueIdsListener=(e,s,t,r)=>Le(h,$(r),e,s,be,t),exports.useValueListener=(e,s,t,r,o)=>Le(R,$(o),s,t,[e],r),exports.useValues=e=>Se(k,$(e),0),exports.useValuesListener=(e,s,t,r)=>Le(k,$(r),e,s,be,t),exports.useWillFinishTransactionListener=(e,s,t)=>Le("WillFinish"+le,$(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),u="Result",n="Has",l="Ids",p="Table",i=p+"s",d=p+l,a="Row",x=a+"Count",c=a+l,I="Sorted"+a+l,C="Cell",b=C+l,w="Value",R=w+"s",k=w+l,y="Transaction",h="Partial",g="Finish",L="Status",S="Metric",m="Slice",V="RemoteRowId",T="Local",P="Linked",v="Checkpoint",B=globalThis,q=e=>null==e,f=(e,s,t)=>q(e)?t?.():s(e),H=e=>s(e)==r,M=e=>s(e)==o,z=e=>e.length,O=()=>{},D=(e,s)=>e.every(s),Q=(e,s)=>z(e)===z(s)&&D(e,((e,t)=>s[t]===e)),F=(e,s)=>e.map(s),E=(e,s,t)=>e.with(s,t),{PureComponent:A,Fragment:G,createContext:W,createElement:j,useCallback:U,useContext:_,useEffect:J,useLayoutEffect:K,useMemo:N,useRef:X,useState:Y,useSyncExternalStore:Z}=e,$=(e,...s)=>q(e)?{}:e(...s),ee=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],se=Object,te=e=>se.getPrototypeOf(e),re=se.entries,oe=e=>!q(e)&&f(te(e),(e=>e==se.prototype||q(te(e))),(()=>!0)),ue=se.keys,ne=(e,s)=>f(e,(e=>e[s])),le=(e,s)=>s in e,pe=(e,s)=>{const t=re(e);return z(t)===z(ue(s))&&D(t,(([e,t])=>oe(t)?!!oe(s[e])&&pe(s[e],t):s[e]===t))},ie=(xe=()=>W([]),le(de=B,ae="tinybase_uirc")||(de[ae]=xe()),de[ae]);var de,ae,xe;const ce=(e,s)=>{const t=_(ie);return q(e)?t[2*s]:H(e)?ne(t[2*s+1]??{},e):e},Ie=(e,s)=>{const t=ce(e,s);return q(e)||H(e)?t:e},Ce=(e,s,t)=>{const{16:r,17:o}=_(ie);J((()=>(r?.(t,e,s),()=>o?.(t,e))),[r,e,s,t,o])},be=e=>ue(_(ie)[2*e+1]??{}),we=e=>Ie(e,0),Re=e=>Ie(e,1),ke=e=>Ie(e,2),ye=e=>Ie(e,3),he=e=>Ie(e,4),ge=e=>Ie(e,5),Le=e=>Ie(e,6),Se=e=>Ie(e,7),me=[],Ve=[{},[],[me,void 0,me],void 0,!1,0],Te=[pe,Q,([e,s,t],[r,o,u])=>s===o&&Q(e,r)&&Q(t,u)],Pe=(e,s)=>e===s,ve=(e,s,t=me)=>{const[,r]=Y(),[o,u]=Y();return J((()=>{const t=e?s(e):void 0;return u(t),r([]),t?.destroy}),[e,...t]),o},Be=(e,s,...t)=>{const r=e?.["add"+s+"Listener"]?.(...t);return()=>e?.delListener(r)},qe=(e,s,r,o=me)=>{const u=X(Ve[r]),l=U((()=>{const t=s?.[(4==r?"has":"get")+e]?.(...o)??Ve[r];return(Te[r]??Pe)(t,u.current)?u.current:u.current=t}),[s,r,e,...o]),p=U((u=>Be(s,(4==r?n:t)+e,...o,u)),[s,r,e,...o]);return Z(p,l,l)},fe=(e,s,t,r=me,o=me,...u)=>K((()=>Be(s,e,...o,t,...u)),[s,e,...o,...r,...u]),He=(e,s,t,r=me,o=O,u=me,...n)=>{const l=we(e);return U((e=>f(l,(r=>f(t(e,r),(t=>o(r["set"+s](...Me(n,r,e),t),t)))))),[l,s,...r,...u,...ze(n)])},Me=(e,s,t)=>F(e,(e=>M(e)?e(t,s):e)),ze=e=>{return s=e=>!M(e),e.filter(s);var s},Oe=(e,s,t=O,r=me,...o)=>{const u=we(e);return U((e=>t(u?.["del"+s](...Me(o,u,e)))),[u,s,...r,...ze(o)])},De=(e,s,t)=>{const r=ge(e);return U((()=>r?.[s](t)),[r,s,t])},Qe=e=>qe(d,we(e),1),Fe=(e,s)=>qe(c,we(s),1,[e]),Ee=(e,s,t,r=0,o,u)=>qe(I,we(u),1,[e,s,t,r,o]),Ae=(e,s,t)=>qe(b,we(t),1,[e,s]),Ge=(e,s,t,r)=>qe(C,we(r),3,[e,s,t]),We=e=>qe(k,we(e),1),je=(e,s)=>qe(w,we(s),3,[e]),Ue=(e,s)=>qe(S,Re(s),3,[e]),_e=(e,s)=>qe(m+l,ke(s),1,[e]),Je=(e,s,t)=>qe(m+c,ke(t),1,[e,s]),Ke=(e,s,t)=>qe(V,ye(t),3,[e,s]),Ne=(e,s,t)=>qe(T+c,ye(t),1,[e,s]),Xe=(e,s,t)=>qe(P+c,ye(t),1,[e,s]),Ye=(e,s)=>qe(u+c,he(s),1,[e]),Ze=(e,s,t,r=0,o,n)=>qe(u+I,he(n),1,[e,s,t,r,o]),$e=(e,s,t)=>qe(u+b,he(t),1,[e,s]),es=(e,s,t,r)=>qe(u+C,he(r),3,[e,s,t]),ss=e=>qe(v+l,ge(e),2),ts=(e,s)=>qe(v,ge(s),3,[e]),rs=e=>De(e,"goBackward"),os=e=>De(e,"goForward"),us=(e,s,t,r,o)=>[t??s[2*e],{...s[2*e+1],...r,...o[e]}],ns=({tableId:e,store:s,rowComponent:t=xs,getRowComponentProps:r,customCellIds:o,separator:u,debugIds:n},l)=>ds(F(l,(u=>j(t,{...$(r,u),key:u,tableId:e,rowId:u,customCellIds:o,store:s,debugIds:n}))),u,n,e),ls=({queryId:e,queries:s,resultRowComponent:t=ws,getResultRowComponentProps:r,separator:o,debugIds:u},n)=>ds(F(n,(o=>j(t,{...$(r,o),key:o,queryId:e,rowId:o,queries:s,debugIds:u}))),o,u,e),ps=({relationshipId:e,relationships:s,rowComponent:t=xs,getRowComponentProps:r,separator:o,debugIds:u},n,l)=>{const[p,i,d]=ee(ye(s),e),a=n(e,l,p);return ds(F(a,(e=>j(t,{...$(r,e),key:e,tableId:d,rowId:e,store:i,debugIds:u}))),o,u,l)},is=e=>({checkpoints:s,checkpointComponent:t=Rs,getCheckpointComponentProps:r,separator:o,debugIds:u})=>{const n=ge(s);return ds(F(e(ss(n)),(e=>j(t,{...$(r,e),key:e,checkpoints:n,checkpointId:e,debugIds:u}))),o)},ds=(e,s,t,r)=>{const o=q(s)||!Array.isArray(e)?e:F(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},as=({tableId:e,rowId:s,cellId:r,store:o,debugIds:u})=>ds(t+(Ge(e,s,r,o)??t),void 0,u,r),xs=({tableId:e,rowId:s,store:t,cellComponent:r=as,getCellComponentProps:o,customCellIds:u,separator:n,debugIds:l})=>ds(F(((e,s,t,r)=>{const o=Ae(s,t,r);return e??o})(u,e,s,t),(u=>j(r,{...$(o,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:l}))),n,l,s),cs=e=>ns(e,Fe(e.tableId,e.store)),Is=({valueId:e,store:s,debugIds:r})=>ds(t+(je(e,s)??t),void 0,r,e),Cs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=xs,getRowComponentProps:o,separator:u,debugIds:n})=>{const[l,p,i]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(ke(t),e),d=Je(e,s,l);return ds(F(d,(e=>j(r,{...$(o,e),key:e,tableId:i,rowId:e,store:p,debugIds:n}))),u,n,s)},bs=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:u})=>ds(t+(es(e,s,r,o)??t),void 0,u,r),ws=({queryId:e,rowId:s,queries:t,resultCellComponent:r=bs,getResultCellComponentProps:o,separator:u,debugIds:n})=>ds(F($e(e,s,t),(u=>j(r,{...$(o,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:n}))),u,n,s),Rs=({checkpoints:e,checkpointId:s,debugIds:r})=>ds(ts(s,e)??t,void 0,r,s),ks=is((e=>e[0])),ys=is((e=>q(e[1])?[]:[e[1]])),hs=is((e=>e[2]));exports.BackwardCheckpointsView=ks,exports.CellView=as,exports.CheckpointView=Rs,exports.CurrentCheckpointView=ys,exports.ForwardCheckpointsView=hs,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Cs,getSliceComponentProps:r,separator:o,debugIds:u})=>ds(F(_e(e,s),(o=>j(t,{...$(r,o),key:o,indexId:e,sliceId:o,indexes:s,debugIds:u}))),o,u,e),exports.LinkedRowsView=e=>ps(e,Xe,e.firstRowId),exports.LocalRowsView=e=>ps(e,Ne,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>ds(Ue(e,s)??t,void 0,r,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:u,relationships:n,relationshipsById:l,queries:p,queriesById:i,checkpoints:d,checkpointsById:a,persister:x,persistersById:c,synchronizer:I,synchronizersById:C,children:b})=>{const w=_(ie),[R,k]=Y((()=>F([,,,,,,,,].fill(0),((e,s)=>({}))))),y=U(((e,s,t)=>k((r=>ne(r[e],s)==t?r:E(r,e,{...r[e],[s]:t})))),[]),h=U(((e,s)=>k((t=>le(t[e],s)?E(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return j(ie.Provider,{value:N((()=>[...us(0,w,e,s,R),...us(1,w,t,r,R),...us(2,w,o,u,R),...us(3,w,n,l,R),...us(4,w,p,i,R),...us(5,w,d,a,R),...us(6,w,x,c,R),...us(7,w,I,C,R),y,h]),[R,e,s,t,r,o,u,n,l,p,i,d,a,x,c,I,C,w,y,h])},b)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=xs,getRowComponentProps:o,debugIds:u})=>{const[n,l,,p]=ee(ye(t),e),i=Ke(e,s,n);return ds(q(p)||q(i)?null:j(r,{...$(o,i),key:i,tableId:p,rowId:i,store:l,debugIds:u}),void 0,u,s)},exports.ResultCellView=bs,exports.ResultRowView=ws,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>ls(o,Ze(o.queryId,e,s,t,r,o.queries)),exports.ResultTableView=e=>ls(e,Ye(e.queryId,e.queries)),exports.RowView=xs,exports.SliceView=Cs,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>ns(o,Ee(o.tableId,e,s,t,r,o.store)),exports.TableView=cs,exports.TablesView=({store:e,tableComponent:s=cs,getTableComponentProps:t,separator:r,debugIds:o})=>ds(F(Qe(e),(r=>j(s,{...$(t,r),key:r,tableId:r,store:e,debugIds:o}))),r),exports.ValueView=Is,exports.ValuesView=({store:e,valueComponent:s=Is,getValueComponentProps:t,separator:r,debugIds:o})=>ds(F(We(e),(r=>j(s,{...$(t,r),key:r,valueId:r,store:e,debugIds:o}))),r),exports.useAddRowCallback=(e,s,t=me,r,o=O,u=me,n=!0)=>{const l=we(r);return U((t=>f(l,(r=>f(s(t,r),(s=>o(r.addRow(M(e)?e(t,r):e,s,n),r,s)))))),[l,e,...t,...u,n])},exports.useCell=Ge,exports.useCellIds=Ae,exports.useCellIdsListener=(e,s,t,r,o,u)=>fe(b,we(u),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,u,n)=>fe(C,we(n),r,o,[e,s,t],u),exports.useCheckpoint=ts,exports.useCheckpointIds=ss,exports.useCheckpointIdsListener=(e,s,t)=>fe(v+l,ge(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>fe(v,ge(r),s,t,[e]),exports.useCheckpoints=e=>ce(e,5),exports.useCheckpointsIds=()=>be(5),exports.useCheckpointsOrCheckpointsById=ge,exports.useCreateCheckpoints=(e,s,t)=>ve(e,s,t),exports.useCreateIndexes=(e,s,t)=>ve(e,s,t),exports.useCreateMergeableStore=(e,s=me)=>N(e,s),exports.useCreateMetrics=(e,s,t)=>ve(e,s,t),exports.useCreatePersister=(e,s,t=me,r,o=me,u,n=me)=>{const[,l]=Y(),[p,i]=Y();return J((()=>{(async()=>{const t=e?await s(e):void 0;i(t),t&&r&&(async()=>{await r(t),l([])})()})()}),[e,...t,...o]),J((()=>()=>{p&&(p.destroy(),u?.(p))}),[p,...n]),p},exports.useCreateQueries=(e,s,t)=>ve(e,s,t),exports.useCreateRelationships=(e,s,t)=>ve(e,s,t),exports.useCreateStore=(e,s=me)=>N(e,s),exports.useCreateSynchronizer=(e,s,t=me,r,o=me)=>{const[u,n]=Y();return J((()=>{(async()=>{const t=e?await s(e):void 0;n(t)})()}),[e,...t]),J((()=>()=>{u&&(u.destroy(),r?.(u))}),[u,...o]),u},exports.useDelCellCallback=(e,s,t,r,o,u,n)=>Oe(o,C,u,n,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Oe(t,a,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Oe(s,p,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Oe(e,i,s,t),exports.useDelValueCallback=(e,s,t,r)=>Oe(s,w,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Oe(e,R,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>fe("Did"+g+y,we(t),e,s),exports.useGoBackwardCallback=rs,exports.useGoForwardCallback=os,exports.useGoToCallback=(e,s=me,t,r=O,o=me)=>{const u=ge(t);return U((s=>f(u,(t=>f(e(s),(e=>r(t.goTo(e),e)))))),[u,...s,...o])},exports.useHasCell=(e,s,t,r)=>qe(C,we(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,u,l)=>fe(n+C,we(l),r,o,[e,s,t],u),exports.useHasRow=(e,s,t)=>qe(a,we(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,u)=>fe(n+a,we(u),t,r,[e,s],o),exports.useHasTable=(e,s)=>qe(p,we(s),4,[e]),exports.useHasTableCell=(e,s,t)=>qe(p+C,we(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,u)=>fe(n+p+C,we(u),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>fe(n+p,we(o),s,t,[e],r),exports.useHasTables=e=>qe(i,we(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>fe(n+i,we(r),e,s,[],t),exports.useHasValue=(e,s)=>qe(w,we(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>fe(n+w,we(o),s,t,[e],r),exports.useHasValues=e=>qe(R,we(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>fe(n+R,we(r),e,s,[],t),exports.useIndexIds=e=>qe("Index"+l,ke(e),1),exports.useIndexes=e=>ce(e,2),exports.useIndexesIds=()=>be(2),exports.useIndexesOrIndexesById=ke,exports.useLinkedRowIds=Xe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>fe(P+c,ye(o),t,r,[e,s]),exports.useLocalRowIds=Ne,exports.useLocalRowIdsListener=(e,s,t,r,o)=>fe(T+c,ye(o),t,r,[e,s]),exports.useMetric=Ue,exports.useMetricIds=e=>qe(S+l,Re(e),1),exports.useMetricListener=(e,s,t,r)=>fe(S,Re(r),s,t,[e]),exports.useMetrics=e=>ce(e,1),exports.useMetricsIds=()=>be(1),exports.useMetricsOrMetricsById=Re,exports.usePersister=e=>ce(e,6),exports.usePersisterIds=()=>be(6),exports.usePersisterOrPersisterById=Le,exports.usePersisterStatus=e=>qe(L,Le(e),5,[]),exports.usePersisterStatusListener=(e,s,t)=>fe(L,Le(t),e,s,[]),exports.useProvideCheckpoints=(e,s)=>Ce(e,s,5),exports.useProvideIndexes=(e,s)=>Ce(e,s,2),exports.useProvideMetrics=(e,s)=>Ce(e,s,1),exports.useProvidePersister=(e,s)=>Ce(e,s,6),exports.useProvideQueries=(e,s)=>Ce(e,s,4),exports.useProvideRelationships=(e,s)=>Ce(e,s,3),exports.useProvideStore=(e,s)=>Ce(e,s,0),exports.useProvideSynchronizer=(e,s)=>Ce(e,s,7),exports.useQueries=e=>ce(e,4),exports.useQueriesIds=()=>be(4),exports.useQueriesOrQueriesById=he,exports.useQueryIds=e=>qe("Query"+l,he(e),1),exports.useRedoInformation=e=>{const s=ge(e),[,,[r]]=ss(s);return[!q(r),os(s),r,f(r,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>qe("Relationship"+l,ye(e),1),exports.useRelationships=e=>ce(e,3),exports.useRelationshipsIds=()=>be(3),exports.useRelationshipsOrRelationshipsById=ye,exports.useRemoteRowId=Ke,exports.useRemoteRowIdListener=(e,s,t,r,o)=>fe(V,ye(o),t,r,[e,s]),exports.useResultCell=es,exports.useResultCellIds=$e,exports.useResultCellIdsListener=(e,s,t,r,o)=>fe(u+b,he(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,n)=>fe(u+C,he(n),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>qe(u+a,he(t),0,[e,s]),exports.useResultRowCount=(e,s)=>qe(u+x,he(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>fe(u+x,he(r),s,t,[e]),exports.useResultRowIds=Ye,exports.useResultRowIdsListener=(e,s,t,r)=>fe(u+c,he(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>fe(u+a,he(o),t,r,[e,s]),exports.useResultSortedRowIds=Ze,exports.useResultSortedRowIdsListener=(e,s,t,r,o,n,l,p)=>fe(u+I,he(p),n,l,[e,s,t,r,o]),exports.useResultTable=(e,s)=>qe(u+p,he(s),0,[e]),exports.useResultTableCellIds=(e,s)=>qe(u+p+b,he(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>fe(u+p+b,he(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>fe(u+p,he(r),s,t,[e]),exports.useRow=(e,s,t)=>qe(a,we(t),0,[e,s]),exports.useRowCount=(e,s)=>qe(x,we(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>fe(x,we(o),s,t,[e],r),exports.useRowIds=Fe,exports.useRowIdsListener=(e,s,t,r,o)=>fe(c,we(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,u)=>fe(a,we(u),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,u,n,l)=>He(u,C,r,o,n,l,e,s,t),exports.useSetCheckpointCallback=(e=O,s=me,t,r=O,o=me)=>{const u=ge(t);return U((s=>f(u,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[u,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,u,n)=>He(o,h+a,t,r,u,n,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>He(t,h+R,e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,u,n)=>He(o,a,t,r,u,n,e,s),exports.useSetTableCallback=(e,s,t,r,o,u)=>He(r,p,s,t,o,u,e),exports.useSetTablesCallback=(e,s,t,r,o)=>He(t,i,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,u)=>He(r,w,s,t,o,u,e),exports.useSetValuesCallback=(e,s,t,r,o)=>He(t,R,e,s,r,o),exports.useSliceIds=_e,exports.useSliceIdsListener=(e,s,t,r)=>fe(m+l,ke(r),s,t,[e]),exports.useSliceRowIds=Je,exports.useSliceRowIdsListener=(e,s,t,r,o)=>fe(m+c,ke(o),t,r,[e,s]),exports.useSortedRowIds=Ee,exports.useSortedRowIdsListener=(e,s,t,r,o,u,n,l,p)=>fe(I,we(p),u,n,[e,s,t,r,o],l),exports.useStartTransactionListener=(e,s,t)=>fe("Start"+y,we(t),e,s),exports.useStore=e=>ce(e,0),exports.useStoreIds=()=>be(0),exports.useStoreOrStoreById=we,exports.useSynchronizer=e=>ce(e,7),exports.useSynchronizerIds=()=>be(7),exports.useSynchronizerOrSynchronizerById=Se,exports.useSynchronizerStatus=e=>qe(L,Se(e),5,[]),exports.useSynchronizerStatusListener=(e,s,t)=>fe(L,Se(t),e,s,[]),exports.useTable=(e,s)=>qe(p,we(s),0,[e]),exports.useTableCellIds=(e,s)=>qe(p+b,we(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>fe(p+b,we(o),s,t,[e],r),exports.useTableIds=Qe,exports.useTableIdsListener=(e,s,t,r)=>fe(d,we(r),e,s,me,t),exports.useTableListener=(e,s,t,r,o)=>fe(p,we(o),s,t,[e],r),exports.useTables=e=>qe(i,we(e),0),exports.useTablesListener=(e,s,t,r)=>fe(i,we(r),e,s,me,t),exports.useUndoInformation=e=>{const s=ge(e),[r,o]=ss(s);return[(u=r,!(0==z(u))),rs(s),o,f(o,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=je,exports.useValueIds=We,exports.useValueIdsListener=(e,s,t,r)=>fe(k,we(r),e,s,me,t),exports.useValueListener=(e,s,t,r,o)=>fe(w,we(o),s,t,[e],r),exports.useValues=e=>qe(R,we(e),0),exports.useValuesListener=(e,s,t,r)=>fe(R,we(r),e,s,me,t),exports.useWillFinishTransactionListener=(e,s,t)=>fe("Will"+g+y,we(t),e,s);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),u="Listener",n="Result",i="Has",l="Ids",p="Table",d=p+"s",a=p+l,x="Row",c=x+"Count",I=x+l,C="Sorted"+x+l,b="Cell",w=b+l,R="Value",k=R+"s",h=R+l,y="Status",S=globalThis,L=e=>null==e,g=(e,s,t)=>L(e)?t?.():s(e),m=e=>s(e)==r,V=e=>s(e)==o,T=e=>e.length,P=()=>{},v=(e,s)=>e.every(s),f=(e,s)=>T(e)===T(s)&&v(e,((e,t)=>s[t]===e)),B=(e,s)=>e.map(s),M=(e,s,t)=>e.with(s,t),q=Object,H=e=>q.getPrototypeOf(e),z=q.entries,Q=e=>!L(e)&&g(H(e),(e=>e==q.prototype||L(H(e))),(()=>!0)),O=q.keys,D=(e,s)=>g(e,(e=>e[s])),F=(e,s)=>s in e,E=(e,s)=>{const t=z(e);return T(t)===T(O(s))&&v(t,(([e,t])=>Q(t)?!!Q(s[e])&&E(s[e],t):s[e]===t))},{createContext:A,useContext:G,useEffect:W}=e;var j=(e=>(e[e.Store=0]="Store",e[e.Metrics=1]="Metrics",e[e.Indexes=2]="Indexes",e[e.Relationships=3]="Relationships",e[e.Queries=4]="Queries",e[e.Checkpoints=5]="Checkpoints",e[e.Persister=6]="Persister",e[e.Synchronizer=7]="Synchronizer",e))(j||{});const U=(K=()=>A([]),F(_=S,J="tinybase_uirc")||(_[J]=K()),_[J]);var _,J,K;const N=(e,s)=>{const t=G(U);return L(e)?t[2*s]:m(e)?D(t[2*s+1]??{},e):e},X=(e,s)=>{const t=N(e,s);return L(e)||m(e)?t:e},Y=(e,s,t)=>{const{16:r,17:o}=G(U);W((()=>(r?.(t,e,s),()=>o?.(t,e))),[r,e,s,t,o])},Z=e=>O(G(U)[2*e+1]??{}),$=e=>X(e,0),ee=e=>X(e,1),se=e=>X(e,2),te=e=>X(e,3),re=e=>X(e,4),oe=e=>X(e,5),ue=e=>X(e,6),ne=e=>X(e,7),ie=e=>e.toLowerCase();ie(u);const le="Transaction";ie(le);const{useCallback:pe,useEffect:de,useMemo:ae,useLayoutEffect:xe,useRef:ce,useState:Ie,useSyncExternalStore:Ce}=e,be=[],we=[{},[],[be,void 0,be],void 0,!1,0],Re=[E,f,([e,s,t],[r,o,u])=>s===o&&f(e,r)&&f(t,u)],ke=(e,s)=>e===s,he=(e,s,t=be)=>{const[,r]=Ie(),[o,u]=Ie();return de((()=>{const t=e?s(e):void 0;return u(t),r([]),t?.destroy}),[e,...t]),o},ye=(e,s,...t)=>{const r=e?.["add"+s+u]?.(...t);return()=>e?.delListener(r)},Se=(e,s,r,o=be)=>{const u=ce(we[r]),n=pe((()=>{const t=s?.[(4==r?"has":"get")+e]?.(...o)??we[r];return(Re[r]??ke)(t,u.current)?u.current:u.current=t}),[s,r,e,...o]),l=pe((u=>ye(s,(4==r?i:t)+e,...o,u)),[s,r,e,...o]);return Ce(l,n,n)},Le=(e,s,t,r=be,o=be,...u)=>xe((()=>ye(s,e,...o,t,...u)),[s,e,...o,...r,...u]),ge=(e,s,t,r=be,o=P,u=be,...n)=>{const i=$(e);return pe((e=>g(i,(r=>g(t(e,r),(t=>o(r["set"+s](...me(n,r,e),t),t)))))),[i,s,...r,...u,...Ve(n)])},me=(e,s,t)=>B(e,(e=>V(e)?e(t,s):e)),Ve=e=>{return s=e=>!V(e),e.filter(s);var s},Te=(e,s,t=P,r=be,...o)=>{const u=$(e);return pe((e=>t(u?.["del"+s](...me(o,u,e)))),[u,s,...r,...Ve(o)])},Pe=(e,s,t)=>{const r=oe(e);return pe((()=>r?.[s](t)),[r,s,t])},ve=e=>Se(a,$(e),1),fe=(e,s)=>Se(I,$(s),1,[e]),Be=(e,s,t,r=0,o,u)=>Se(C,$(u),1,[e,s,t,r,o]),Me=(e,s,t)=>Se(w,$(t),1,[e,s]),qe=(e,s,t,r)=>Se(b,$(r),3,[e,s,t]),He=e=>Se(h,$(e),1),ze=(e,s)=>Se(R,$(s),3,[e]),Qe=(e,s)=>Se("Metric",ee(s),3,[e]),Oe=(e,s)=>Se("SliceIds",se(s),1,[e]),De=(e,s,t)=>Se("Slice"+I,se(t),1,[e,s]),Fe=(e,s,t)=>Se("RemoteRowId",te(t),3,[e,s]),Ee=(e,s,t)=>Se("Local"+I,te(t),1,[e,s]),Ae=(e,s,t)=>Se("Linked"+I,te(t),1,[e,s]),Ge=(e,s)=>Se(n+I,re(s),1,[e]),We=(e,s,t,r=0,o,u)=>Se(n+C,re(u),1,[e,s,t,r,o]),je=(e,s,t)=>Se(n+w,re(t),1,[e,s]),Ue=(e,s,t,r)=>Se(n+b,re(r),3,[e,s,t]),_e=e=>Se("CheckpointIds",oe(e),2),Je=(e,s)=>Se("Checkpoint",oe(s),3,[e]),Ke=e=>Pe(e,"goBackward"),Ne=e=>Pe(e,"goForward"),{PureComponent:Xe,Fragment:Ye,createElement:Ze,useCallback:$e,useLayoutEffect:es,useRef:ss,useState:ts}=e,rs=(e,...s)=>L(e)?{}:e(...s),os=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],{useCallback:us,useContext:ns,useMemo:is,useState:ls}=e,ps=(e,s,t,r,o)=>[t??s[2*e],{...s[2*e+1],...r,...o[e]}],ds=({tableId:e,store:s,rowComponent:t=bs,getRowComponentProps:r,customCellIds:o,separator:u,debugIds:n},i)=>Is(B(i,(u=>Ze(t,{...rs(r,u),key:u,tableId:e,rowId:u,customCellIds:o,store:s,debugIds:n}))),u,n,e),as=({queryId:e,queries:s,resultRowComponent:t=ys,getResultRowComponentProps:r,separator:o,debugIds:u},n)=>Is(B(n,(o=>Ze(t,{...rs(r,o),key:o,queryId:e,rowId:o,queries:s,debugIds:u}))),o,u,e),xs=({relationshipId:e,relationships:s,rowComponent:t=bs,getRowComponentProps:r,separator:o,debugIds:u},n,i)=>{const[l,p,d]=os(te(s),e),a=n(e,i,l);return Is(B(a,(e=>Ze(t,{...rs(r,e),key:e,tableId:d,rowId:e,store:p,debugIds:u}))),o,u,i)},cs=e=>({checkpoints:s,checkpointComponent:t=Ss,getCheckpointComponentProps:r,separator:o,debugIds:u})=>{const n=oe(s);return Is(B(e(_e(n)),(e=>Ze(t,{...rs(r,e),key:e,checkpoints:n,checkpointId:e,debugIds:u}))),o)},Is=(e,s,t,r)=>{const o=L(s)||!Array.isArray(e)?e:B(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},Cs=({tableId:e,rowId:s,cellId:r,store:o,debugIds:u})=>Is(t+(qe(e,s,r,o)??t),void 0,u,r),bs=({tableId:e,rowId:s,store:t,cellComponent:r=Cs,getCellComponentProps:o,customCellIds:u,separator:n,debugIds:i})=>Is(B(((e,s,t,r)=>{const o=Me(s,t,r);return e??o})(u,e,s,t),(u=>Ze(r,{...rs(o,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:i}))),n,i,s),ws=e=>ds(e,fe(e.tableId,e.store)),Rs=({valueId:e,store:s,debugIds:r})=>Is(t+(ze(e,s)??t),void 0,r,e),ks=({indexId:e,sliceId:s,indexes:t,rowComponent:r=bs,getRowComponentProps:o,separator:u,debugIds:n})=>{const[i,l,p]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(se(t),e),d=De(e,s,i);return Is(B(d,(e=>Ze(r,{...rs(o,e),key:e,tableId:p,rowId:e,store:l,debugIds:n}))),u,n,s)},hs=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:u})=>Is(t+(Ue(e,s,r,o)??t),void 0,u,r),ys=({queryId:e,rowId:s,queries:t,resultCellComponent:r=hs,getResultCellComponentProps:o,separator:u,debugIds:n})=>Is(B(je(e,s,t),(u=>Ze(r,{...rs(o,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:n}))),u,n,s),Ss=({checkpoints:e,checkpointId:s,debugIds:r})=>Is(Je(s,e)??t,void 0,r,s),Ls=cs((e=>e[0])),gs=cs((e=>L(e[1])?[]:[e[1]])),ms=cs((e=>e[2]));exports.BackwardCheckpointsView=Ls,exports.CellView=Cs,exports.CheckpointView=Ss,exports.CurrentCheckpointView=gs,exports.ForwardCheckpointsView=ms,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=ks,getSliceComponentProps:r,separator:o,debugIds:u})=>Is(B(Oe(e,s),(o=>Ze(t,{...rs(r,o),key:o,indexId:e,sliceId:o,indexes:s,debugIds:u}))),o,u,e),exports.LinkedRowsView=e=>xs(e,Ae,e.firstRowId),exports.LocalRowsView=e=>xs(e,Ee,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>Is(Qe(e,s)??t,void 0,r,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:u,relationships:n,relationshipsById:i,queries:l,queriesById:p,checkpoints:d,checkpointsById:a,persister:x,persistersById:c,synchronizer:I,synchronizersById:C,children:b})=>{const w=ns(U),[R,k]=ls((()=>B([,,,,,,,,].fill(0),((e,s)=>({}))))),h=us(((e,s,t)=>k((r=>D(r[e],s)==t?r:M(r,e,{...r[e],[s]:t})))),[]),y=us(((e,s)=>k((t=>F(t[e],s)?M(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return Ze(U.Provider,{value:is((()=>[...ps(j.Store,w,e,s,R),...ps(j.Metrics,w,t,r,R),...ps(j.Indexes,w,o,u,R),...ps(j.Relationships,w,n,i,R),...ps(j.Queries,w,l,p,R),...ps(j.Checkpoints,w,d,a,R),...ps(j.Persister,w,x,c,R),...ps(j.Synchronizer,w,I,C,R),h,y]),[R,e,s,t,r,o,u,n,i,l,p,d,a,x,c,I,C,w,h,y])},b)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=bs,getRowComponentProps:o,debugIds:u})=>{const[n,i,,l]=os(te(t),e),p=Fe(e,s,n);return Is(L(l)||L(p)?null:Ze(r,{...rs(o,p),key:p,tableId:l,rowId:p,store:i,debugIds:u}),void 0,u,s)},exports.ResultCellView=hs,exports.ResultRowView=ys,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>as(o,We(o.queryId,e,s,t,r,o.queries)),exports.ResultTableView=e=>as(e,Ge(e.queryId,e.queries)),exports.RowView=bs,exports.SliceView=ks,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>ds(o,Be(o.tableId,e,s,t,r,o.store)),exports.TableView=ws,exports.TablesView=({store:e,tableComponent:s=ws,getTableComponentProps:t,separator:r,debugIds:o})=>Is(B(ve(e),(r=>Ze(s,{...rs(t,r),key:r,tableId:r,store:e,debugIds:o}))),r),exports.ValueView=Rs,exports.ValuesView=({store:e,valueComponent:s=Rs,getValueComponentProps:t,separator:r,debugIds:o})=>Is(B(He(e),(r=>Ze(s,{...rs(t,r),key:r,valueId:r,store:e,debugIds:o}))),r),exports.useAddRowCallback=(e,s,t=be,r,o=P,u=be,n=!0)=>{const i=$(r);return pe((t=>g(i,(r=>g(s(t,r),(s=>o(r.addRow(V(e)?e(t,r):e,s,n),r,s)))))),[i,e,...t,...u,n])},exports.useCell=qe,exports.useCellIds=Me,exports.useCellIdsListener=(e,s,t,r,o,u)=>Le(w,$(u),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,u,n)=>Le(b,$(n),r,o,[e,s,t],u),exports.useCheckpoint=Je,exports.useCheckpointIds=_e,exports.useCheckpointIdsListener=(e,s,t)=>Le("CheckpointIds",oe(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>Le("Checkpoint",oe(r),s,t,[e]),exports.useCheckpoints=e=>N(e,5),exports.useCheckpointsIds=()=>Z(5),exports.useCheckpointsOrCheckpointsById=oe,exports.useCreateCheckpoints=(e,s,t)=>he(e,s,t),exports.useCreateIndexes=(e,s,t)=>he(e,s,t),exports.useCreateMergeableStore=(e,s=be)=>ae(e,s),exports.useCreateMetrics=(e,s,t)=>he(e,s,t),exports.useCreatePersister=(e,s,t=be,r,o=be,u,n=be)=>{const[,i]=Ie(),[l,p]=Ie();return de((()=>{(async()=>{const t=e?await s(e):void 0;p(t),t&&r&&(async()=>{await r(t),i([])})()})()}),[e,...t,...o]),de((()=>()=>{l&&(l.destroy(),u?.(l))}),[l,...n]),l},exports.useCreateQueries=(e,s,t)=>he(e,s,t),exports.useCreateRelationships=(e,s,t)=>he(e,s,t),exports.useCreateStore=(e,s=be)=>ae(e,s),exports.useCreateSynchronizer=(e,s,t=be,r,o=be)=>{const[u,n]=Ie();return de((()=>{(async()=>{const t=e?await s(e):void 0;n(t)})()}),[e,...t]),de((()=>()=>{u&&(u.destroy(),r?.(u))}),[u,...o]),u},exports.useDelCellCallback=(e,s,t,r,o,u,n)=>Te(o,b,u,n,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Te(t,x,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Te(s,p,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Te(e,d,s,t),exports.useDelValueCallback=(e,s,t,r)=>Te(s,R,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Te(e,k,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>Le("DidFinish"+le,$(t),e,s),exports.useGoBackwardCallback=Ke,exports.useGoForwardCallback=Ne,exports.useGoToCallback=(e,s=be,t,r=P,o=be)=>{const u=oe(t);return pe((s=>g(u,(t=>g(e(s),(e=>r(t.goTo(e),e)))))),[u,...s,...o])},exports.useHasCell=(e,s,t,r)=>Se(b,$(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,u,n)=>Le(i+b,$(n),r,o,[e,s,t],u),exports.useHasRow=(e,s,t)=>Se(x,$(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,u)=>Le(i+x,$(u),t,r,[e,s],o),exports.useHasTable=(e,s)=>Se(p,$(s),4,[e]),exports.useHasTableCell=(e,s,t)=>Se(p+b,$(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,u)=>Le(i+p+b,$(u),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>Le(i+p,$(o),s,t,[e],r),exports.useHasTables=e=>Se(d,$(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>Le(i+d,$(r),e,s,[],t),exports.useHasValue=(e,s)=>Se(R,$(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>Le(i+R,$(o),s,t,[e],r),exports.useHasValues=e=>Se(k,$(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>Le(i+k,$(r),e,s,[],t),exports.useIndexIds=e=>Se("IndexIds",se(e),1),exports.useIndexes=e=>N(e,2),exports.useIndexesIds=()=>Z(2),exports.useIndexesOrIndexesById=se,exports.useLinkedRowIds=Ae,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>Le("Linked"+I,te(o),t,r,[e,s]),exports.useLocalRowIds=Ee,exports.useLocalRowIdsListener=(e,s,t,r,o)=>Le("Local"+I,te(o),t,r,[e,s]),exports.useMetric=Qe,exports.useMetricIds=e=>Se("MetricIds",ee(e),1),exports.useMetricListener=(e,s,t,r)=>Le("Metric",ee(r),s,t,[e]),exports.useMetrics=e=>N(e,1),exports.useMetricsIds=()=>Z(1),exports.useMetricsOrMetricsById=ee,exports.usePersister=e=>N(e,6),exports.usePersisterIds=()=>Z(6),exports.usePersisterOrPersisterById=ue,exports.usePersisterStatus=e=>Se(y,ue(e),5,[]),exports.usePersisterStatusListener=(e,s,t)=>Le(y,ue(t),e,s,[]),exports.useProvideCheckpoints=(e,s)=>Y(e,s,5),exports.useProvideIndexes=(e,s)=>Y(e,s,2),exports.useProvideMetrics=(e,s)=>Y(e,s,1),exports.useProvidePersister=(e,s)=>Y(e,s,6),exports.useProvideQueries=(e,s)=>Y(e,s,4),exports.useProvideRelationships=(e,s)=>Y(e,s,3),exports.useProvideStore=(e,s)=>Y(e,s,0),exports.useProvideSynchronizer=(e,s)=>Y(e,s,7),exports.useQueries=e=>N(e,4),exports.useQueriesIds=()=>Z(4),exports.useQueriesOrQueriesById=re,exports.useQueryIds=e=>Se("QueryIds",re(e),1),exports.useRedoInformation=e=>{const s=oe(e),[,,[r]]=_e(s);return[!L(r),Ne(s),r,g(r,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>Se("RelationshipIds",te(e),1),exports.useRelationships=e=>N(e,3),exports.useRelationshipsIds=()=>Z(3),exports.useRelationshipsOrRelationshipsById=te,exports.useRemoteRowId=Fe,exports.useRemoteRowIdListener=(e,s,t,r,o)=>Le("RemoteRowId",te(o),t,r,[e,s]),exports.useResultCell=Ue,exports.useResultCellIds=je,exports.useResultCellIdsListener=(e,s,t,r,o)=>Le(n+w,re(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,u)=>Le(n+b,re(u),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>Se(n+x,re(t),0,[e,s]),exports.useResultRowCount=(e,s)=>Se(n+c,re(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>Le(n+c,re(r),s,t,[e]),exports.useResultRowIds=Ge,exports.useResultRowIdsListener=(e,s,t,r)=>Le(n+I,re(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>Le(n+x,re(o),t,r,[e,s]),exports.useResultSortedRowIds=We,exports.useResultSortedRowIdsListener=(e,s,t,r,o,u,i,l)=>Le(n+C,re(l),u,i,[e,s,t,r,o]),exports.useResultTable=(e,s)=>Se(n+p,re(s),0,[e]),exports.useResultTableCellIds=(e,s)=>Se(n+p+w,re(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>Le(n+p+w,re(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>Le(n+p,re(r),s,t,[e]),exports.useRow=(e,s,t)=>Se(x,$(t),0,[e,s]),exports.useRowCount=(e,s)=>Se(c,$(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>Le(c,$(o),s,t,[e],r),exports.useRowIds=fe,exports.useRowIdsListener=(e,s,t,r,o)=>Le(I,$(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,u)=>Le(x,$(u),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,u,n,i)=>ge(u,b,r,o,n,i,e,s,t),exports.useSetCheckpointCallback=(e=P,s=be,t,r=P,o=be)=>{const u=oe(t);return pe((s=>g(u,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[u,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,u,n)=>ge(o,"PartialRow",t,r,u,n,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>ge(t,"PartialValues",e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,u,n)=>ge(o,x,t,r,u,n,e,s),exports.useSetTableCallback=(e,s,t,r,o,u)=>ge(r,p,s,t,o,u,e),exports.useSetTablesCallback=(e,s,t,r,o)=>ge(t,d,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,u)=>ge(r,R,s,t,o,u,e),exports.useSetValuesCallback=(e,s,t,r,o)=>ge(t,k,e,s,r,o),exports.useSliceIds=Oe,exports.useSliceIdsListener=(e,s,t,r)=>Le("SliceIds",se(r),s,t,[e]),exports.useSliceRowIds=De,exports.useSliceRowIdsListener=(e,s,t,r,o)=>Le("Slice"+I,se(o),t,r,[e,s]),exports.useSortedRowIds=Be,exports.useSortedRowIdsListener=(e,s,t,r,o,u,n,i,l)=>Le(C,$(l),u,n,[e,s,t,r,o],i),exports.useStartTransactionListener=(e,s,t)=>Le("Start"+le,$(t),e,s),exports.useStore=e=>N(e,0),exports.useStoreIds=()=>Z(0),exports.useStoreOrStoreById=$,exports.useSynchronizer=e=>N(e,7),exports.useSynchronizerIds=()=>Z(7),exports.useSynchronizerOrSynchronizerById=ne,exports.useSynchronizerStatus=e=>Se(y,ne(e),5,[]),exports.useSynchronizerStatusListener=(e,s,t)=>Le(y,ne(t),e,s,[]),exports.useTable=(e,s)=>Se(p,$(s),0,[e]),exports.useTableCellIds=(e,s)=>Se(p+w,$(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>Le(p+w,$(o),s,t,[e],r),exports.useTableIds=ve,exports.useTableIdsListener=(e,s,t,r)=>Le(a,$(r),e,s,be,t),exports.useTableListener=(e,s,t,r,o)=>Le(p,$(o),s,t,[e],r),exports.useTables=e=>Se(d,$(e),0),exports.useTablesListener=(e,s,t,r)=>Le(d,$(r),e,s,be,t),exports.useUndoInformation=e=>{const s=oe(e),[r,o]=_e(s);return[(u=r,!(0==T(u))),Ke(s),o,g(o,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=ze,exports.useValueIds=He,exports.useValueIdsListener=(e,s,t,r)=>Le(h,$(r),e,s,be,t),exports.useValueListener=(e,s,t,r,o)=>Le(R,$(o),s,t,[e],r),exports.useValues=e=>Se(k,$(e),0),exports.useValuesListener=(e,s,t,r)=>Le(k,$(r),e,s,be,t),exports.useWillFinishTransactionListener=(e,s,t)=>Le("WillFinish"+le,$(t),e,s);
|
|
1
|
+
"use strict";var e=require("react");const s=e=>typeof e,t="",r=s(t),o=s(s),u="Result",n="Has",l="Ids",p="Table",i=p+"s",d=p+l,a="Row",x=a+"Count",c=a+l,I="Sorted"+a+l,C="Cell",b=C+l,w="Value",R=w+"s",k=w+l,y="Transaction",h="Partial",g="Finish",L="Status",S="Metric",m="Slice",V="RemoteRowId",T="Local",P="Linked",v="Checkpoint",B=globalThis,q=e=>null==e,f=(e,s,t)=>q(e)?t?.():s(e),H=e=>s(e)==r,M=e=>s(e)==o,z=e=>e.length,O=()=>{},D=(e,s)=>e.every(s),Q=(e,s)=>z(e)===z(s)&&D(e,((e,t)=>s[t]===e)),F=(e,s)=>e.map(s),E=(e,s,t)=>e.with(s,t),{PureComponent:A,Fragment:G,createContext:W,createElement:j,useCallback:U,useContext:_,useEffect:J,useLayoutEffect:K,useMemo:N,useRef:X,useState:Y,useSyncExternalStore:Z}=e,$=(e,...s)=>q(e)?{}:e(...s),ee=(e,s)=>[e,e?.getStore(),e?.getLocalTableId(s),e?.getRemoteTableId(s)],se=Object,te=e=>se.getPrototypeOf(e),re=se.entries,oe=e=>!q(e)&&f(te(e),(e=>e==se.prototype||q(te(e))),(()=>!0)),ue=se.keys,ne=(e,s)=>f(e,(e=>e[s])),le=(e,s)=>s in e,pe=(e,s)=>{const t=re(e);return z(t)===z(ue(s))&&D(t,(([e,t])=>oe(t)?!!oe(s[e])&&pe(s[e],t):s[e]===t))},ie=(xe=()=>W([]),le(de=B,ae="tinybase_uirc")||(de[ae]=xe()),de[ae]);var de,ae,xe;const ce=(e,s)=>{const t=_(ie);return q(e)?t[2*s]:H(e)?ne(t[2*s+1]??{},e):e},Ie=(e,s)=>{const t=ce(e,s);return q(e)||H(e)?t:e},Ce=(e,s,t)=>{const{16:r,17:o}=_(ie);J((()=>(r?.(t,e,s),()=>o?.(t,e))),[r,e,s,t,o])},be=e=>ue(_(ie)[2*e+1]??{}),we=e=>Ie(e,0),Re=e=>Ie(e,1),ke=e=>Ie(e,2),ye=e=>Ie(e,3),he=e=>Ie(e,4),ge=e=>Ie(e,5),Le=e=>Ie(e,6),Se=e=>Ie(e,7),me=[],Ve=[{},[],[me,void 0,me],void 0,!1,0],Te=[pe,Q,([e,s,t],[r,o,u])=>s===o&&Q(e,r)&&Q(t,u)],Pe=(e,s)=>e===s,ve=(e,s,t=me)=>{const[,r]=Y(),[o,u]=Y();return J((()=>{const t=e?s(e):void 0;return u(t),r([]),t?.destroy}),[e,...t]),o},Be=(e,s,...t)=>{const r=e?.["add"+s+"Listener"]?.(...t);return()=>e?.delListener(r)},qe=(e,s,r,o=me)=>{const u=X(Ve[r]),l=U((()=>{const t=s?.[(4==r?"has":"get")+e]?.(...o)??Ve[r];return(Te[r]??Pe)(t,u.current)?u.current:u.current=t}),[s,r,e,...o]),p=U((u=>Be(s,(4==r?n:t)+e,...o,u)),[s,r,e,...o]);return Z(p,l,l)},fe=(e,s,t,r=me,o=me,...u)=>K((()=>Be(s,e,...o,t,...u)),[s,e,...o,...r,...u]),He=(e,s,t,r=me,o=O,u=me,...n)=>{const l=we(e);return U((e=>f(l,(r=>f(t(e,r),(t=>o(r["set"+s](...Me(n,r,e),t),t)))))),[l,s,...r,...u,...ze(n)])},Me=(e,s,t)=>F(e,(e=>M(e)?e(t,s):e)),ze=e=>{return s=e=>!M(e),e.filter(s);var s},Oe=(e,s,t=O,r=me,...o)=>{const u=we(e);return U((e=>t(u?.["del"+s](...Me(o,u,e)))),[u,s,...r,...ze(o)])},De=(e,s,t)=>{const r=ge(e);return U((()=>r?.[s](t)),[r,s,t])},Qe=e=>qe(d,we(e),1),Fe=(e,s)=>qe(c,we(s),1,[e]),Ee=(e,s,t,r=0,o,u)=>qe(I,we(u),1,[e,s,t,r,o]),Ae=(e,s,t)=>qe(b,we(t),1,[e,s]),Ge=(e,s,t,r)=>qe(C,we(r),3,[e,s,t]),We=e=>qe(k,we(e),1),je=(e,s)=>qe(w,we(s),3,[e]),Ue=(e,s)=>qe(S,Re(s),3,[e]),_e=(e,s)=>qe(m+l,ke(s),1,[e]),Je=(e,s,t)=>qe(m+c,ke(t),1,[e,s]),Ke=(e,s,t)=>qe(V,ye(t),3,[e,s]),Ne=(e,s,t)=>qe(T+c,ye(t),1,[e,s]),Xe=(e,s,t)=>qe(P+c,ye(t),1,[e,s]),Ye=(e,s)=>qe(u+c,he(s),1,[e]),Ze=(e,s,t,r=0,o,n)=>qe(u+I,he(n),1,[e,s,t,r,o]),$e=(e,s,t)=>qe(u+b,he(t),1,[e,s]),es=(e,s,t,r)=>qe(u+C,he(r),3,[e,s,t]),ss=e=>qe(v+l,ge(e),2),ts=(e,s)=>qe(v,ge(s),3,[e]),rs=e=>De(e,"goBackward"),os=e=>De(e,"goForward"),us=(e,s,t,r,o)=>[t??s[2*e],{...s[2*e+1],...r,...o[e]}],ns=({tableId:e,store:s,rowComponent:t=xs,getRowComponentProps:r,customCellIds:o,separator:u,debugIds:n},l)=>ds(F(l,(u=>j(t,{...$(r,u),key:u,tableId:e,rowId:u,customCellIds:o,store:s,debugIds:n}))),u,n,e),ls=({queryId:e,queries:s,resultRowComponent:t=ws,getResultRowComponentProps:r,separator:o,debugIds:u},n)=>ds(F(n,(o=>j(t,{...$(r,o),key:o,queryId:e,rowId:o,queries:s,debugIds:u}))),o,u,e),ps=({relationshipId:e,relationships:s,rowComponent:t=xs,getRowComponentProps:r,separator:o,debugIds:u},n,l)=>{const[p,i,d]=ee(ye(s),e),a=n(e,l,p);return ds(F(a,(e=>j(t,{...$(r,e),key:e,tableId:d,rowId:e,store:i,debugIds:u}))),o,u,l)},is=e=>({checkpoints:s,checkpointComponent:t=Rs,getCheckpointComponentProps:r,separator:o,debugIds:u})=>{const n=ge(s);return ds(F(e(ss(n)),(e=>j(t,{...$(r,e),key:e,checkpoints:n,checkpointId:e,debugIds:u}))),o)},ds=(e,s,t,r)=>{const o=q(s)||!Array.isArray(e)?e:F(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},as=({tableId:e,rowId:s,cellId:r,store:o,debugIds:u})=>ds(t+(Ge(e,s,r,o)??t),void 0,u,r),xs=({tableId:e,rowId:s,store:t,cellComponent:r=as,getCellComponentProps:o,customCellIds:u,separator:n,debugIds:l})=>ds(F(((e,s,t,r)=>{const o=Ae(s,t,r);return e??o})(u,e,s,t),(u=>j(r,{...$(o,u),key:u,tableId:e,rowId:s,cellId:u,store:t,debugIds:l}))),n,l,s),cs=e=>ns(e,Fe(e.tableId,e.store)),Is=({valueId:e,store:s,debugIds:r})=>ds(t+(je(e,s)??t),void 0,r,e),Cs=({indexId:e,sliceId:s,indexes:t,rowComponent:r=xs,getRowComponentProps:o,separator:u,debugIds:n})=>{const[l,p,i]=((e,s)=>[e,e?.getStore(),e?.getTableId(s)])(ke(t),e),d=Je(e,s,l);return ds(F(d,(e=>j(r,{...$(o,e),key:e,tableId:i,rowId:e,store:p,debugIds:n}))),u,n,s)},bs=({queryId:e,rowId:s,cellId:r,queries:o,debugIds:u})=>ds(t+(es(e,s,r,o)??t),void 0,u,r),ws=({queryId:e,rowId:s,queries:t,resultCellComponent:r=bs,getResultCellComponentProps:o,separator:u,debugIds:n})=>ds(F($e(e,s,t),(u=>j(r,{...$(o,u),key:u,queryId:e,rowId:s,cellId:u,queries:t,debugIds:n}))),u,n,s),Rs=({checkpoints:e,checkpointId:s,debugIds:r})=>ds(ts(s,e)??t,void 0,r,s),ks=is((e=>e[0])),ys=is((e=>q(e[1])?[]:[e[1]])),hs=is((e=>e[2]));exports.BackwardCheckpointsView=ks,exports.CellView=as,exports.CheckpointView=Rs,exports.CurrentCheckpointView=ys,exports.ForwardCheckpointsView=hs,exports.IndexView=({indexId:e,indexes:s,sliceComponent:t=Cs,getSliceComponentProps:r,separator:o,debugIds:u})=>ds(F(_e(e,s),(o=>j(t,{...$(r,o),key:o,indexId:e,sliceId:o,indexes:s,debugIds:u}))),o,u,e),exports.LinkedRowsView=e=>ps(e,Xe,e.firstRowId),exports.LocalRowsView=e=>ps(e,Ne,e.remoteRowId),exports.MetricView=({metricId:e,metrics:s,debugIds:r})=>ds(Ue(e,s)??t,void 0,r,e),exports.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:u,relationships:n,relationshipsById:l,queries:p,queriesById:i,checkpoints:d,checkpointsById:a,persister:x,persistersById:c,synchronizer:I,synchronizersById:C,children:b})=>{const w=_(ie),[R,k]=Y((()=>F([,,,,,,,,].fill(0),((e,s)=>({}))))),y=U(((e,s,t)=>k((r=>ne(r[e],s)==t?r:E(r,e,{...r[e],[s]:t})))),[]),h=U(((e,s)=>k((t=>le(t[e],s)?E(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return j(ie.Provider,{value:N((()=>[...us(0,w,e,s,R),...us(1,w,t,r,R),...us(2,w,o,u,R),...us(3,w,n,l,R),...us(4,w,p,i,R),...us(5,w,d,a,R),...us(6,w,x,c,R),...us(7,w,I,C,R),y,h]),[R,e,s,t,r,o,u,n,l,p,i,d,a,x,c,I,C,w,y,h])},b)},exports.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=xs,getRowComponentProps:o,debugIds:u})=>{const[n,l,,p]=ee(ye(t),e),i=Ke(e,s,n);return ds(q(p)||q(i)?null:j(r,{...$(o,i),key:i,tableId:p,rowId:i,store:l,debugIds:u}),void 0,u,s)},exports.ResultCellView=bs,exports.ResultRowView=ws,exports.ResultSortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>ls(o,Ze(o.queryId,e,s,t,r,o.queries)),exports.ResultTableView=e=>ls(e,Ye(e.queryId,e.queries)),exports.RowView=xs,exports.SliceView=Cs,exports.SortedTableView=({cellId:e,descending:s,offset:t,limit:r,...o})=>ns(o,Ee(o.tableId,e,s,t,r,o.store)),exports.TableView=cs,exports.TablesView=({store:e,tableComponent:s=cs,getTableComponentProps:t,separator:r,debugIds:o})=>ds(F(Qe(e),(r=>j(s,{...$(t,r),key:r,tableId:r,store:e,debugIds:o}))),r),exports.ValueView=Is,exports.ValuesView=({store:e,valueComponent:s=Is,getValueComponentProps:t,separator:r,debugIds:o})=>ds(F(We(e),(r=>j(s,{...$(t,r),key:r,valueId:r,store:e,debugIds:o}))),r),exports.useAddRowCallback=(e,s,t=me,r,o=O,u=me,n=!0)=>{const l=we(r);return U((t=>f(l,(r=>f(s(t,r),(s=>o(r.addRow(M(e)?e(t,r):e,s,n),r,s)))))),[l,e,...t,...u,n])},exports.useCell=Ge,exports.useCellIds=Ae,exports.useCellIdsListener=(e,s,t,r,o,u)=>fe(b,we(u),t,r,[e,s],o),exports.useCellListener=(e,s,t,r,o,u,n)=>fe(C,we(n),r,o,[e,s,t],u),exports.useCheckpoint=ts,exports.useCheckpointIds=ss,exports.useCheckpointIdsListener=(e,s,t)=>fe(v+l,ge(t),e,s),exports.useCheckpointListener=(e,s,t,r)=>fe(v,ge(r),s,t,[e]),exports.useCheckpoints=e=>ce(e,5),exports.useCheckpointsIds=()=>be(5),exports.useCheckpointsOrCheckpointsById=ge,exports.useCreateCheckpoints=(e,s,t)=>ve(e,s,t),exports.useCreateIndexes=(e,s,t)=>ve(e,s,t),exports.useCreateMergeableStore=(e,s=me)=>N(e,s),exports.useCreateMetrics=(e,s,t)=>ve(e,s,t),exports.useCreatePersister=(e,s,t=me,r,o=me,u,n=me)=>{const[,l]=Y(),[p,i]=Y();return J((()=>{(async()=>{const t=e?await s(e):void 0;i(t),t&&r&&(async()=>{await r(t),l([])})()})()}),[e,...t,...o]),J((()=>()=>{p&&(p.destroy(),u?.(p))}),[p,...n]),p},exports.useCreateQueries=(e,s,t)=>ve(e,s,t),exports.useCreateRelationships=(e,s,t)=>ve(e,s,t),exports.useCreateStore=(e,s=me)=>N(e,s),exports.useCreateSynchronizer=(e,s,t=me,r,o=me)=>{const[u,n]=Y();return J((()=>{(async()=>{const t=e?await s(e):void 0;n(t)})()}),[e,...t]),J((()=>()=>{u&&(u.destroy(),r?.(u))}),[u,...o]),u},exports.useDelCellCallback=(e,s,t,r,o,u,n)=>Oe(o,C,u,n,e,s,t,r),exports.useDelRowCallback=(e,s,t,r,o)=>Oe(t,a,r,o,e,s),exports.useDelTableCallback=(e,s,t,r)=>Oe(s,p,t,r,e),exports.useDelTablesCallback=(e,s,t)=>Oe(e,i,s,t),exports.useDelValueCallback=(e,s,t,r)=>Oe(s,w,t,r,e),exports.useDelValuesCallback=(e,s,t)=>Oe(e,R,s,t),exports.useDidFinishTransactionListener=(e,s,t)=>fe("Did"+g+y,we(t),e,s),exports.useGoBackwardCallback=rs,exports.useGoForwardCallback=os,exports.useGoToCallback=(e,s=me,t,r=O,o=me)=>{const u=ge(t);return U((s=>f(u,(t=>f(e(s),(e=>r(t.goTo(e),e)))))),[u,...s,...o])},exports.useHasCell=(e,s,t,r)=>qe(C,we(r),4,[e,s,t]),exports.useHasCellListener=(e,s,t,r,o,u,l)=>fe(n+C,we(l),r,o,[e,s,t],u),exports.useHasRow=(e,s,t)=>qe(a,we(t),4,[e,s]),exports.useHasRowListener=(e,s,t,r,o,u)=>fe(n+a,we(u),t,r,[e,s],o),exports.useHasTable=(e,s)=>qe(p,we(s),4,[e]),exports.useHasTableCell=(e,s,t)=>qe(p+C,we(t),4,[e,s]),exports.useHasTableCellListener=(e,s,t,r,o,u)=>fe(n+p+C,we(u),t,r,[e,s],o),exports.useHasTableListener=(e,s,t,r,o)=>fe(n+p,we(o),s,t,[e],r),exports.useHasTables=e=>qe(i,we(e),4,[]),exports.useHasTablesListener=(e,s,t,r)=>fe(n+i,we(r),e,s,[],t),exports.useHasValue=(e,s)=>qe(w,we(s),4,[e]),exports.useHasValueListener=(e,s,t,r,o)=>fe(n+w,we(o),s,t,[e],r),exports.useHasValues=e=>qe(R,we(e),4,[]),exports.useHasValuesListener=(e,s,t,r)=>fe(n+R,we(r),e,s,[],t),exports.useIndexIds=e=>qe("Index"+l,ke(e),1),exports.useIndexes=e=>ce(e,2),exports.useIndexesIds=()=>be(2),exports.useIndexesOrIndexesById=ke,exports.useLinkedRowIds=Xe,exports.useLinkedRowIdsListener=(e,s,t,r,o)=>fe(P+c,ye(o),t,r,[e,s]),exports.useLocalRowIds=Ne,exports.useLocalRowIdsListener=(e,s,t,r,o)=>fe(T+c,ye(o),t,r,[e,s]),exports.useMetric=Ue,exports.useMetricIds=e=>qe(S+l,Re(e),1),exports.useMetricListener=(e,s,t,r)=>fe(S,Re(r),s,t,[e]),exports.useMetrics=e=>ce(e,1),exports.useMetricsIds=()=>be(1),exports.useMetricsOrMetricsById=Re,exports.usePersister=e=>ce(e,6),exports.usePersisterIds=()=>be(6),exports.usePersisterOrPersisterById=Le,exports.usePersisterStatus=e=>qe(L,Le(e),5,[]),exports.usePersisterStatusListener=(e,s,t)=>fe(L,Le(t),e,s,[]),exports.useProvideCheckpoints=(e,s)=>Ce(e,s,5),exports.useProvideIndexes=(e,s)=>Ce(e,s,2),exports.useProvideMetrics=(e,s)=>Ce(e,s,1),exports.useProvidePersister=(e,s)=>Ce(e,s,6),exports.useProvideQueries=(e,s)=>Ce(e,s,4),exports.useProvideRelationships=(e,s)=>Ce(e,s,3),exports.useProvideStore=(e,s)=>Ce(e,s,0),exports.useProvideSynchronizer=(e,s)=>Ce(e,s,7),exports.useQueries=e=>ce(e,4),exports.useQueriesIds=()=>be(4),exports.useQueriesOrQueriesById=he,exports.useQueryIds=e=>qe("Query"+l,he(e),1),exports.useRedoInformation=e=>{const s=ge(e),[,,[r]]=ss(s);return[!q(r),os(s),r,f(r,(e=>s?.getCheckpoint(e)))??t]},exports.useRelationshipIds=e=>qe("Relationship"+l,ye(e),1),exports.useRelationships=e=>ce(e,3),exports.useRelationshipsIds=()=>be(3),exports.useRelationshipsOrRelationshipsById=ye,exports.useRemoteRowId=Ke,exports.useRemoteRowIdListener=(e,s,t,r,o)=>fe(V,ye(o),t,r,[e,s]),exports.useResultCell=es,exports.useResultCellIds=$e,exports.useResultCellIdsListener=(e,s,t,r,o)=>fe(u+b,he(o),t,r,[e,s]),exports.useResultCellListener=(e,s,t,r,o,n)=>fe(u+C,he(n),r,o,[e,s,t]),exports.useResultRow=(e,s,t)=>qe(u+a,he(t),0,[e,s]),exports.useResultRowCount=(e,s)=>qe(u+x,he(s),5,[e]),exports.useResultRowCountListener=(e,s,t,r)=>fe(u+x,he(r),s,t,[e]),exports.useResultRowIds=Ye,exports.useResultRowIdsListener=(e,s,t,r)=>fe(u+c,he(r),s,t,[e]),exports.useResultRowListener=(e,s,t,r,o)=>fe(u+a,he(o),t,r,[e,s]),exports.useResultSortedRowIds=Ze,exports.useResultSortedRowIdsListener=(e,s,t,r,o,n,l,p)=>fe(u+I,he(p),n,l,[e,s,t,r,o]),exports.useResultTable=(e,s)=>qe(u+p,he(s),0,[e]),exports.useResultTableCellIds=(e,s)=>qe(u+p+b,he(s),1,[e]),exports.useResultTableCellIdsListener=(e,s,t,r)=>fe(u+p+b,he(r),s,t,[e]),exports.useResultTableListener=(e,s,t,r)=>fe(u+p,he(r),s,t,[e]),exports.useRow=(e,s,t)=>qe(a,we(t),0,[e,s]),exports.useRowCount=(e,s)=>qe(x,we(s),5,[e]),exports.useRowCountListener=(e,s,t,r,o)=>fe(x,we(o),s,t,[e],r),exports.useRowIds=Fe,exports.useRowIdsListener=(e,s,t,r,o)=>fe(c,we(o),s,t,[e],r),exports.useRowListener=(e,s,t,r,o,u)=>fe(a,we(u),t,r,[e,s],o),exports.useSetCellCallback=(e,s,t,r,o,u,n,l)=>He(u,C,r,o,n,l,e,s,t),exports.useSetCheckpointCallback=(e=O,s=me,t,r=O,o=me)=>{const u=ge(t);return U((s=>f(u,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[u,...s,...o])},exports.useSetPartialRowCallback=(e,s,t,r,o,u,n)=>He(o,h+a,t,r,u,n,e,s),exports.useSetPartialValuesCallback=(e,s,t,r,o)=>He(t,h+R,e,s,r,o),exports.useSetRowCallback=(e,s,t,r,o,u,n)=>He(o,a,t,r,u,n,e,s),exports.useSetTableCallback=(e,s,t,r,o,u)=>He(r,p,s,t,o,u,e),exports.useSetTablesCallback=(e,s,t,r,o)=>He(t,i,e,s,r,o),exports.useSetValueCallback=(e,s,t,r,o,u)=>He(r,w,s,t,o,u,e),exports.useSetValuesCallback=(e,s,t,r,o)=>He(t,R,e,s,r,o),exports.useSliceIds=_e,exports.useSliceIdsListener=(e,s,t,r)=>fe(m+l,ke(r),s,t,[e]),exports.useSliceRowIds=Je,exports.useSliceRowIdsListener=(e,s,t,r,o)=>fe(m+c,ke(o),t,r,[e,s]),exports.useSortedRowIds=Ee,exports.useSortedRowIdsListener=(e,s,t,r,o,u,n,l,p)=>fe(I,we(p),u,n,[e,s,t,r,o],l),exports.useStartTransactionListener=(e,s,t)=>fe("Start"+y,we(t),e,s),exports.useStore=e=>ce(e,0),exports.useStoreIds=()=>be(0),exports.useStoreOrStoreById=we,exports.useSynchronizer=e=>ce(e,7),exports.useSynchronizerIds=()=>be(7),exports.useSynchronizerOrSynchronizerById=Se,exports.useSynchronizerStatus=e=>qe(L,Se(e),5,[]),exports.useSynchronizerStatusListener=(e,s,t)=>fe(L,Se(t),e,s,[]),exports.useTable=(e,s)=>qe(p,we(s),0,[e]),exports.useTableCellIds=(e,s)=>qe(p+b,we(s),1,[e]),exports.useTableCellIdsListener=(e,s,t,r,o)=>fe(p+b,we(o),s,t,[e],r),exports.useTableIds=Qe,exports.useTableIdsListener=(e,s,t,r)=>fe(d,we(r),e,s,me,t),exports.useTableListener=(e,s,t,r,o)=>fe(p,we(o),s,t,[e],r),exports.useTables=e=>qe(i,we(e),0),exports.useTablesListener=(e,s,t,r)=>fe(i,we(r),e,s,me,t),exports.useUndoInformation=e=>{const s=ge(e),[r,o]=ss(s);return[(u=r,!(0==z(u))),rs(s),o,f(o,(e=>s?.getCheckpoint(e)))??t];var u},exports.useValue=je,exports.useValueIds=We,exports.useValueIdsListener=(e,s,t,r)=>fe(k,we(r),e,s,me,t),exports.useValueListener=(e,s,t,r,o)=>fe(w,we(o),s,t,[e],r),exports.useValues=e=>qe(R,we(e),0),exports.useValuesListener=(e,s,t,r)=>fe(R,we(r),e,s,me,t),exports.useWillFinishTransactionListener=(e,s,t)=>fe("Will"+g+y,we(t),e,s);
|
|
Binary file
|