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
|
-
var e,l;e=this,l=function(e){"use strict";const l=e=>typeof e,t="tinybase",a="",n=",",o=l(a),d=l(!0),r=l(0),s="type",I="default",u="Listener",c="get",$="add",i="Has",b="Ids",p="Table",C=p+"s",h=p+b,m="Row",f=m+b,g="Sorted"+m+b,w="Cell",y=w+b,v="Value",T=v+"s",x=v+b;var V=(e,l,t)=>new Promise(((a,n)=>{var o=e=>{try{r(t.next(e))}catch(e){n(e)}},d=e=>{try{r(t.throw(e))}catch(e){n(e)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(o,d);r((t=t.apply(e,l)).next())}));const R=Promise,P=isFinite,A=e=>null==e,k=(e,l,t)=>A(e)?null==t?void 0:t():l(e),S=e=>e==o||e==d,O=e=>l(e)==o,E=e=>Array.isArray(e),D=(e,l,t)=>e.slice(l,t),N=e=>e.length,L=e=>V(void 0,null,(function*(){return R.all(e)})),j=e=>{const t=l(e);return S(t)||t==r&&P(e)?t:void 0},G=(e,l)=>e.every(l),H=(e,l)=>e.sort(l),M=(e,l)=>e.forEach(l),J=(e,l=a)=>e.join(l),z=(e,l)=>e.map(l),W=(e,l)=>e.filter(l),B=(e,...l)=>e.push(...l),F=e=>e.pop(),U=(e,...l)=>e.unshift(...l),_=e=>e.shift(),Z=Object,Q=e=>Z.getPrototypeOf(e),q=Z.entries,K=e=>!A(e)&&k(Q(e),(e=>e==Z.prototype||A(Q(e))),(()=>!0)),X=Z.keys,Y=Z.freeze,ee=(e,l)=>z(q(e),(([e,t])=>l(t,e))),le=e=>N(X(e)),te=e=>K(e)&&0==le(e),ae=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},ne=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},oe=(e,l)=>null==e?void 0:e.forEach(l),de=(e,l)=>null==e?void 0:e.delete(l),re=e=>new Map(e),se=(e,l)=>null==e?void 0:e.get(l),Ie=(e,l)=>oe(e,((e,t)=>l(t,e))),ue=(e,l)=>{var t;return z([...null!=(t=null==e?void 0:e.entries())?t:[]],(([e,t])=>l(t,e)))},ce=(e,l,t)=>A(t)?(de(e,l),e):null==e?void 0:e.set(l,t),$e=(e,l,t,a)=>(ae(e,l)||ce(e,l,t()),se(e,l)),ie=e=>e.toUpperCase(),be=e=>e.toLowerCase(),pe="a ",Ce="A function for",he=", and registers a listener so that any changes to that result will cause a re-render",me="Callback",fe="Changes",ge="Count",we="Del",ye="Deps",ve=ye+"?: React.DependencyList",Te="doRollback?: DoRollback",xe="actions: () => Return, "+Te,Ve="export",Re="Id",Pe="Invalid",Ae="Json",ke=be(u),Se="?: ",Oe=" | undefined",Ee="NonNullable",De="Partial",Ne="Props",Le="Provider",je=`Registers a ${ke} that will be called`,Ge="Represents",He="rowId: "+Re,Me="Schema",Je="Set",ze=", descending?: boolean, offset?: number, limit?: number",We="[]",Be="the Store",Fe="Transaction",Ue=be(Fe),_e="Execute a "+Ue+" to make multiple mutations",Ze="Explicitly starts a "+Ue,Qe="Explicitly finishes a "+Ue,qe="the end of the "+Ue,Ke="void",Xe=" => "+Ke,Ye="WhenSet",el=" when setting it",ll=pe+"string serialization of",tl=" ",al="Gets a callback that can ",nl="the ",ol=" the schema for",dl=(e=0)=>e?"the existence of ":"",rl=(e=0,l=0,t=0)=>dl(t)+`the ${xl[e]}content of`+(l?tl+Be:a),sl=(e=0,l,t=0,n=0)=>yl[l]+tl+dl(n)+rl(e,1)+(t?" when setting it":a),Il=(e,l=0)=>Ge+` a Row when ${l?"s":"g"}etting ${rl()} the '${e}' `+p,ul=(e,l,t=0)=>`Gets ${t?"sorted, paginated":"the"} Ids of the ${e}s in `+l,cl=(e,l)=>`Calls a function for each ${e} in `+l,$l=e=>"The props passed to a component that renders "+e,il=e=>"A function that takes "+e,bl=(e,l=0,t=0)=>Ce+" listening to changes to "+dl(t)+Tl[e]+" in "+Tl[l],pl=(e,l,t=0,n=0)=>je+" whenever "+dl(n)+Tl[e]+" in "+Tl[l]+" change"+(t?a:"s"),Cl=e=>`the '${e}' `+p,hl=e=>"the specified Row in "+Cl(e),ml=(e,l=0,t=0)=>yl[l]+tl+rl(0,0,t)+tl+Cl(e),fl=(e,l=0,t=0)=>yl[l]+` ${rl(0,0,t)} `+hl(e),gl=(e,l,t=0,a=0)=>yl[t]+tl+dl(a)+`the '${l}' Cell for `+hl(e),wl=(e,l=0,t=0)=>yl[l]+tl+dl(t)+`the '${e}' Value`,yl=["Gets","Checks existence of","Sets","Deletes","Sets part of",Ge,"Gets "+ll,"Sets "+ll,je+" whenever",al+"set",al+"add",al+"set part of",al+"delete","Renders","Gets "+ll+ol,"Sets"+ol,"Deletes"+ol],vl=[c,"has","set","del","set","forEach",$,a],Tl=[Be,C,nl+p+tl+b,pe+p,nl+m+tl+b,pe+m,nl+w+tl+b,pe+w,"invalid Cell changes",T,nl+v+tl+b,pe+v,"invalid Value changes",nl+"sorted "+m+tl+b,nl+w+tl+b+" anywhere",nl+"number of Rows",pe+w+" anywhere"],xl=[a,"tabular ","keyed value "],Vl=e=>new Set(E(e)||A(e)?e:[e]),Rl=(e,l)=>null==e?void 0:e.add(l),Pl=/[^A-Za-z]+/,Al=/[^A-Za-z0-9]+/,kl=/^( *)\/\*\* *(.*?) *\*\/$/gm,Sl=e=>e.includes(n),Ol=(e,l,t,a=1)=>{const n=`${l}${1==a?"":a}`;return ae(e,n)?Ol(e,l,t,a+1):(ce(e,n,t),n)},El=e=>e.replace(kl,((e,l,t)=>{const a=77-N(l);return`${l}/**\n${t.replace(RegExp(`([^\\n]{1,${a}})(\\s|$)`,"g"),l+" * $1\n")}${l} */`})),Dl=e=>e.flat(1e3),Nl=(e,l=0)=>J(z(e.split(Al),((e,t)=>(t>0||l?ie:be)(D(e,0,1))+D(e,1)))),Ll=e=>ie(J((e&&!Pl.test(e[0])?e:" "+e).split(Al),"_")),jl=e=>`/** ${e}. */`,Gl=(...e)=>J(W(e,(e=>e)),", "),Hl=(...e)=>"{"+J(e,"; ")+"}",Ml=(...e)=>Hl(...z(e,(e=>"readonly "+e))),Jl=()=>{const e=[re(),re(),re(),re()],l=re(),t=re(),n=e=>{const l=e.indexOf(" as ");return-1!=l?D(e,l+4):e};return[(...e)=>J(Dl(e),"\n"),(l,t,...a)=>M(a,(a=>M([0,1],(n=>(null!=l?l:n)==n?Rl($e(e[n],t,Vl),a):0)))),(e,t,n,o=a,d=1)=>Ol(l,e,[t,n,o,d]),(e,l,a)=>Ol(t,e,E(a)?[`(${l}) => {`,a,"}"]:[`(${l}) => ${a}`]),(e,l)=>se(t,e)===l?e:Ol(t,e,l),(l=0)=>z([...H(ue(e[l],((e,l)=>`import {${J(H(ne(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)),a],(e=>e.replace("{React}","React"))),()=>ue(l,(([e,l,t,n],o)=>[jl(l),`${n?Ve+" ":a}type ${o}${t} = ${e};`,a])),()=>ue(t,((e,l)=>(e=E(e)?e:[e],B(e,F(e)+";"),[`const ${l} = ${_(e)}`,e,a])))]},zl=(e,l)=>{const t=new WeakMap;return l=>(t.has(l)||t.set(l,e(l)),t.get(l))},Wl=(e,l,t)=>[l=>ee(e,((e,a)=>l(a,Nl(a,1),t(Ll(a),`'${a}'`)))),(l,a)=>ee(e[l],((e,l)=>a(l,e[s],e[I],t(Ll(l),`'${l}'`),Nl(l,1)))),e=>ee(l,((l,a)=>e(a,l[s],l[I],t(Ll(a),`'${a}'`),Nl(a,1))))],Bl=(e,l,t,n)=>[(n,o)=>{const d=n+": "+o,r=e(C,Hl(...l((e=>`'${e}'?: {[rowId: Id]: `+Hl(...t(e,((e,l,t)=>`'${e}'${A(t)?"?":a}: ${l}`)))+"}"))),sl(1,5)),s=e(C+Ye,Hl(...l((e=>`'${e}'?: {[rowId: Id]: `+Hl(...t(e,((e,l)=>`'${e}'?: ${l}`)))+"}"))),sl(1,5,1)),I=e(p+Re,"keyof "+r,"A "+p+" Id in "+Be),c=`<TId extends ${I}>`,$=e(p,Ee+`<${r}[TId]>`,"A "+p+" in "+Be,c),b=e(p+Ye,Ee+`<${s}[TId]>`,"A "+p+" in "+Be+el,c),v=e(m,$+"<TId>[Id]","A "+m+" in a "+p,c),T=e(m+Ye,b+"<TId>[Id]","A "+m+" in a "+p+el,c),x=e(w+Re,`Extract<keyof ${v}<TId>, Id>`,"A "+w+" Id in a "+m,c),V=e(w,Ee+`<${r}[TId]>[Id][CId]`,"A "+w+" in a "+m,`<TId extends ${I}, CId extends ${x}<TId>>`),R=e("CellIdCellArray",`CId extends ${x}<TId> ? [cellId: CId, cell: ${V}<TId, CId>] : never`,w+" Ids and types in a "+m,`<TId extends ${I}, CId = ${x}<TId>>`,0),P=e(w+me,`(...[cellId, cell]: ${R}<TId>)`+Xe,il(pe+w+" Id, and "+w),c),k=e(m+me,"(rowId: Id, forEachCell: (cellCallback: CellCallback<TId>) "+Xe+") "+Xe,il(pe+m+" Id, and a "+w+" iterator"),c),S=e(p+w+me,`(cellId: ${x}<TId>, count: number) `+Xe,il(pe+w+" Id, and count of how many times it appears"),c),O=e("TableIdForEachRowArray",`TId extends ${I} ? [tableId: TId, forEachRow: (rowCallback: ${k}<TId>)${Xe}] : never`,p+" Ids and callback types",`<TId = ${I}>`,0),E=e(p+me,`(...[tableId, forEachRow]: ${O})`+Xe,il(pe+p+" Id, and a "+m+" iterator"),a),D=e("TableIdRowIdCellIdArray",`TId extends ${I} ? [tableId: TId, rowId: Id, cellId: ${x}<TId>] : never`,"Ids for GetCellChange",`<TId = ${I}>`,0),N=e("GetCellChange",`(...[tableId, rowId, cellId]: ${D}) => CellChange`,Ce+" returning information about any Cell's changes during a "+Ue),L=e(i+C+u,`(${d}, hasTables: boolean)`+Xe,bl(1,0,1)),j=e(C+u,`(${d}, getCellChange: ${N}${Oe})`+Xe,bl(1)),G=e(h+u,`(${d})`+Xe,bl(2)),H=e(i+p+u,`(${d}, tableId: ${I}, hasTable: boolean)`+Xe,bl(3,0,1)),M=e(p+u,`(${d}, tableId: ${I}, getCellChange: ${N}${Oe})`+Xe,bl(3)),J=e(p+y+u,`(${d}, tableId: ${I})`+Xe,bl(14,3)),z=e("HasTableCellListenerArgsArrayInner",`CId extends ${x}<TId> ? [${d}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,"Cell args for HasTableCellListener",`<TId extends ${I}, CId = ${x}<TId>>`,0),W=e("HasTableCellListenerArgsArrayOuter",`TId extends ${I} ? `+z+"<TId> : never","Table args for HasTableCellListener",`<TId = ${I}>`,0),B=e(i+p+w+u,`(...[${n}, tableId, cellId, hasTableCell]: `+W+")"+Xe,bl(16,3,1)),F=e(m+"Count"+u,`(${d}, tableId: ${I})`+Xe,bl(15,3)),U=e(f+u,`(${d}, tableId: ${I})`+Xe,bl(4,3)),_=e(g+u,"("+Gl(d,"tableId: "+I,"cellId: Id"+Oe,"descending: boolean","offset: number","limit: number"+Oe,"sortedRowIds: Ids")+")"+Xe,bl(13,3)),Z=e(i+m+u,"("+Gl(""+d,"tableId: "+I,He,"hasRow: boolean")+")"+Xe,bl(5,3,1)),Q=e(m+u,"("+Gl(""+d,"tableId: "+I,He,`getCellChange: ${N}${Oe}`)+")"+Xe,bl(5,3)),q=e(y+u,"("+Gl(""+d,"tableId: "+I,He)+")"+Xe,bl(6,5)),K=e("HasCellListenerArgsArrayInner",`CId extends ${x}<TId> ? [${d}, tableId: TId, ${He}, cellId: CId, hasCell: boolean] : never`,"Cell args for HasCellListener",`<TId extends ${I}, CId = ${x}<TId>>`,0),X=e("HasCellListenerArgsArrayOuter",`TId extends ${I} ? `+K+"<TId> : never","Table args for HasCellListener",`<TId = ${I}>`,0),Y=e(i+w+u,`(...[${n}, tableId, rowId, cellId, hasCell]: `+X+")"+Xe,bl(7,5,1)),ee=e("CellListenerArgsArrayInner",`CId extends ${x}<TId> ? [${d}, tableId: TId, ${He}, cellId: CId, newCell: ${V}<TId, CId> ${Oe}, oldCell: ${V}<TId, CId> ${Oe}, getCellChange: ${N} ${Oe}] : never`,"Cell args for CellListener",`<TId extends ${I}, CId = ${x}<TId>>`,0),le=e("CellListenerArgsArrayOuter",`TId extends ${I} ? `+ee+"<TId> : never","Table args for CellListener",`<TId = ${I}>`,0);return[r,s,I,$,b,v,T,x,V,P,k,S,E,L,j,G,H,M,J,B,F,U,_,Z,Q,q,Y,e(w+u,`(...[${n}, tableId, rowId, cellId, newCell, oldCell, getCellChange]: ${le})`+Xe,bl(7,5)),e(Pe+w+u,`(${d}, tableId: Id, ${He}, cellId: Id, invalidCells: any[])`+Xe,bl(8))]},(l,t)=>{const o=l+": "+t,d=e(T,Hl(...n(((e,l,t)=>`'${e}'${A(t)?"?":a}: ${l}`))),sl(2,5)),r=e(T+Ye,Hl(...n(((e,l)=>`'${e}'?: ${l}`))),sl(2,5,1)),s=e(v+Re,"keyof "+d,"A "+v+" Id in "+Be),I=e(v,Ee+`<${d}[VId]>`,"A "+v+" Id in "+Be,`<VId extends ${s}>`),c=e("ValueIdValueArray",`VId extends ${s} ? [valueId: VId, value: ${I}<VId>] : never`,v+" Ids and types in "+Be,`<VId = ${s}>`,0),$=e(v+me,`(...[valueId, value]: ${c})`+Xe,il(pe+v+" Id, and "+v)),b=e("GetValueChange",`(valueId: ${s}) => ValueChange`,Ce+" returning information about any Value's changes during a "+Ue),p=e(i+T+u,`(${o}, hasValues: boolean)`+Xe,bl(9,0,1)),C=e(T+u,`(${o}, getValueChange: ${b}${Oe})`+Xe,bl(9)),h=e(x+u,`(${o})`+Xe,bl(10)),m=e(i+v+u,`(${o}, valueId: ValueId, hasValue: boolean)`+Xe,bl(11,0,1)),f=e("ValueListenerArgsArray",`VId extends ${s} ? [${o}, valueId: VId, newValue: ${I}<VId> ${Oe}, oldValue: ${I}<VId> ${Oe}, getValueChange: ${b} ${Oe}] : never`,"Value args for ValueListener",`<VId = ${s}>`,0);return[d,r,s,I,$,p,C,h,m,e(v+u,`(...[${l}, valueId, newValue, oldValue, getValueChange]: `+f+")"+Xe,bl(11)),e(Pe+v+u,`(${o}, valueId: Id, invalidValues: any[])`+Xe,bl(12))]},(l,t)=>e(Fe+u,`(${l}: ${t})`+Xe,Ce+" listening to the completion of a "+Ue)],Fl=(e,l=a,t=a)=>`store.${e}(${l})`+(t?" as "+t:a),Ul=(e,l=a)=>`fluent(() => ${Fl(e,l)})`,_l=(e,l=a,t=a)=>`store.${e}(${l?l+", ":a}proxy(listener)${t?", "+t:a})`,Zl=(e,l,n)=>{const[o,r,c,V,R,P,k,S]=Jl(),[E,D,N]=Wl(e,l,R),[L,j,G]=Bl(c,E,D,N),H=re(),z=(e=0)=>ue(H,(([l,t,n,o,d],r)=>{const s=e?[r+`: ${d}(${l}): ${t} => ${n},`]:[r+d+`(${l}): ${t};`];return e||U(s,jl(o)),B(s,a),s})),W=(e,l,t,n,o,d=a)=>Ol(H,e,[l,t,n,o,d]),F=(e,l,t,n,o,d=a,r=a,s=a)=>W(vl[e]+l+(4==e?De:a)+t,d,n,(n==Q?Ul:Fl)(vl[e]+(4==e?De:a)+t,r,e?void 0:n),o,s),_=(e,l,t,n=a,o=a,d=1,r=a)=>W($+e+u,(n?n+", ":a)+ke+": "+l+(d?", mutator?: boolean":a),Re,_l($+e+u,o,d?"mutator":a),t,r),Z=`./${Nl(n)}.d`,Q=Nl(n,1),q=Nl(Q),K=[],X=re();let Y=[],ee=[];if(r(1,Z,Q,`create${Q} as create${Q}Decl`),te(e))r(null,t,C);else{r(0,t,"CellChange"),r(null,t,b);const[e,l,n,o,u,$,v,T,x,V,P,k,S,N,j,G,H,z,W,U,ee,le,te,ae,oe,de,Ie,ue,$e]=L(q,Q),ie=re();E(((e,l)=>{const t=`<'${e}'>`,a=[c(l+p,o+t,Ge+` the '${e}' `+p),c(l+p+Ye,u+t,Ge+` the '${e}' `+p+el),c(l+m,$+t,Il(e)),c(l+m+Ye,v+t,Il(e,1)),c(l+w+Re,T+t,`A Cell Id for the '${e}' `+p),c(l+w+me,V+t,il(`a Cell Id and value from a Row in the '${e}' `+p)),c(l+m+me,P+t,il(`a Row Id from the '${e}' Table, and a Cell iterator`)),c(l+p+w+me,k+t,il(`a Cell Id from anywhere in the '${e}' Table, and a count of how many times it appears`))];ce(ie,e,a),r(1,Z,...a)})),r(1,Z,e,l,n,T,S,N,j,G,H,z,W,U,ee,le,te,ae,oe,de,Ie,ue,$e),Y=[e,l,n,T,N,j,G,H,z,W,U,ee,le,te,ae,oe,de,Ie,ue,ie],M([[e],[d],[Q,"tables: "+l,"tables"],[Q]],(([e,l,t],n)=>F(n,a,C,e,sl(1,n),l,t))),F(0,a,h,n+We,ul(p,Be)),F(5,a,p,Ke,cl(p,Be),"tableCallback: "+S,"tableCallback as any"),E(((e,l,t)=>{const[n,o,r,s,I,u,c,$]=se(ie,e);M([[n],[d],[Q,"table: "+o,", table"],[Q]],(([n,o,d=a],r)=>F(r,l,p,n,ml(e,r),o,t+d))),F(0,l,p+y,b,ul(w,"the whole of "+Cl(e)),a,t),F(5,l,p+w,Ke,cl(p+w,"the whole of "+Cl(e)),"tableCellCallback: "+$,t+", tableCellCallback as any"),F(0,l,m+ge,"number","Gets the number of Rows in the "+Cl(e),a,t),F(0,l,f,b,ul(m,Cl(e)),a,t),F(0,l,g,b,ul(m,Cl(e),1),"cellId?: "+I+ze,t+", cellId, descending, offset, limit"),F(5,l,m,Ke,cl(m,Cl(e)),"rowCallback: "+c,t+", rowCallback as any"),M([[r],[d],[Q,", row: "+s,", row"],[Q],[Q,", partialRow: "+s,", partialRow"]],(([n,o=a,d=a],r)=>F(r,l,m,n,fl(e,r),He+o,t+", rowId"+d))),F(6,l,m,Re+Oe,"Add a new Row to "+Cl(e),"row: "+s+", reuseIds?: boolean",t+", row, reuseIds"),F(0,l,y,I+We,ul(w,hl(e)),He,t+", rowId"),F(5,l,w,Ke,cl(w,hl(e)),He+", cellCallback: "+u,t+", rowId, cellCallback as any"),D(e,((n,o,r,s,I)=>{const u="Map"+Nl(o,1);ce(X,o,u);const c=o+(A(r)?Oe:a);M([[c],[d],[Q,`, cell: ${o} | `+u,", cell as any"],[Q]],(([o,d=a,r=a],u)=>F(u,l+I,w,o,gl(e,n,u),He+d,t+", rowId, "+s+r))),F(1,l+I,p+w,d,yl[1]+` the '${n}' Cell anywhere in `+Cl(e),a,t+", "+s)}))})),F(0,a,C+Ae,Ae,sl(1,6)),F(2,a,C+Ae,Q,sl(1,7),"tablesJson: "+Ae,"tables"+Ae),_(i+C,N,sl(1,8,0,1)+" changes"),_(C,j,sl(1,8)+" changes"),_(h,G,pl(2,0,1)),_(i+p,H,pl(3,0,0,1),`tableId: ${n} | null`,"tableId"),_(p,z,pl(3,0),`tableId: ${n} | null`,"tableId"),_(p+y,W,pl(14,3,1),`tableId: ${n} | null`,"tableId"),_(i+p+w,U,pl(16,3,0,1),`tableId: ${n} | null, cellId: ${J(E((e=>{var l,t;return null!=(t=null==(l=se(ie,e))?void 0:l[4])?t:a}))," | ")} | null`,"tableId, cellId"),_(m+ge,ee,pl(15,3),`tableId: ${n} | null`,"tableId"),_(f,le,pl(4,3,1),`tableId: ${n} | null`,"tableId"),_(g,te,pl(13,3,1),Gl("tableId: TId",`cellId: ${T}<TId>`+Oe,"descending: boolean","offset: number","limit: number"+Oe),Gl("tableId","cellId","descending","offset","limit"),1,"<TId extends TableId>"),_(i+m,ae,pl(5,3,0,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(m,oe,pl(5,3),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(y,de,pl(6,5,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),_(i+w,Ie,pl(7,5,0,1),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${J(E((e=>{var l,t;return null!=(t=null==(l=se(ie,e))?void 0:l[4])?t:a}))," | ")} | null`,"tableId, rowId, cellId"),_(w,ue,pl(7,5),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${J(E((e=>{var l,t;return null!=(t=null==(l=se(ie,e))?void 0:l[4])?t:a}))," | ")} | null`,"tableId, rowId, cellId"),_(Pe+w,$e,je+" whenever an invalid Cell change was attempted","tableId: IdOrNull, rowId: IdOrNull, cellId: IdOrNull","tableId, rowId, cellId"),r(1,Z,...ne(X)),B(K,".set"+C+Me+"({",Dl(E(((e,l,t)=>[`[${t}]: {`,...D(e,((e,l,t,n)=>`[${n}]: {[${R(Ll(s),`'${s}'`)}]: ${R(Ll(l),`'${l}'`)}${A(t)?a:`, [${R(Ll(I),`'${I}'`)}]: `+(O(t)?R(Ll(t),`'${t}'`):t)}},`)),"},"]))),"})")}if(te(l))r(null,t,T);else{const[e,l,n,o,u,c,$,b,p,C,h]=j(q,Q);r(1,Z,e,l,n,u,c,$,b,p,C,h),ee=[e,l,n,c,$,b,p,C],M([[e],[d],[Q,"values: "+l,"values"],[Q],[Q,"partialValues: "+l,"partialValues"]],(([e,l,t],n)=>F(n,a,T,e,sl(2,n),l,t))),F(0,a,x,n+We,ul(v,Be)),F(5,a,v,"void",cl(v,Be),"valueCallback: "+u,"valueCallback as any"),N(((e,l,t,n,o)=>{const r="Map"+Nl(l,1);ce(X,l,r),M([[l],[d],[Q,`value: ${l} | `+r,", value as any"],[Q]],(([l,t,d=a],r)=>F(r,o,v,l,wl(e,r),t,n+d)))})),F(0,a,T+Ae,Ae,sl(2,6)),F(2,a,T+Ae,Q,sl(2,7),"valuesJson: "+Ae,"values"+Ae),_(i+T,c,sl(2,8,0,1)+" changes"),_(T,$,sl(2,8)+" changes"),_(x,b,pl(10,0,1)),_(i+v,p,pl(11,0,0,1),`valueId: ${n} | null`,"valueId"),_(v,C,pl(11,0),`valueId: ${n} | null`,"valueId"),_(Pe+v,h,je+" whenever an invalid Value change was attempted","valueId: IdOrNull","valueId"),r(1,Z,...ne(X)),r(0,t,"ValueChange"),B(K,".set"+T+Me+"({",N(((e,l,t,n)=>[`[${n}]: {[${R(Ll(s),`'${s}'`)}]: ${R(Ll(l),`'${l}'`)}${A(t)?a:`, [${R(Ll(I),`'${I}'`)}]: `+(O(t)?R(Ll(t),`'${t}'`):t)}},`])),"})")}F(0,a,"Content",`[${C}, ${T}]`,sl(0,0)),F(2,a,"Content",Q,sl(0,2),`[tables, values]: [${C}, ${T}]`,"[tables, values]"),F(7,a,"applyChanges",Q,`Applies a set of ${fe} to the Store`,"changes: "+fe,"changes"),Ie(X,((e,l)=>c(l,`(cell: ${e}${Oe}) => `+e,`Takes a ${e} Cell value and returns another`))),r(null,t,"DoRollback",Re,"IdOrNull",Ae,"Store",fe),F(0,a,Ae,Ae,sl(0,6)),F(2,a,Ae,Q,sl(0,7),"tablesAndValuesJson: "+Ae,"tablesAndValuesJson"),F(7,a,Ue,"Return",_e,xe,"actions, doRollback","<Return>"),F(7,a,"start"+Fe,Q,Ze),F(7,a,"finish"+Fe,Q,Qe,Te,"doRollback");const le=G(q,Q);return _("Start"+Fe,le,je+" just before the start of the "+Ue,a,a,0),_("WillFinish"+Fe,le,je+" just before "+qe,a,a,0),_("DidFinish"+Fe,le,je+" just after "+qe,a,a,0),F(7,a,"call"+u,Q,"Manually provoke a listener to be called","listenerId: Id","listenerId"),F(3,a,u,Q,"Remove a listener that was previously added to "+Be,"listenerId: Id","listenerId"),W("getStore",a,"Store","store",yl[0]+" the underlying Store object"),r(1,t,"createStore"),r(1,Z,Q,`create${Q} as create${Q}Decl`,le),R("store",["createStore()",...K]),V("fluent","actions: () => Store",["actions();",`return ${q};`]),V("proxy","listener: any",`(_: Store, ...params: any[]) => listener(${q}, ...params)`),R(q,["{",...z(1),"}"]),[o(...P(0),...k(),Ve+" interface "+Q+" {",...z(0),"}",a,jl(`Creates a ${Q} object`),Ve+" function create"+Q+"(): "+Q+";"),o(...P(1),Ve+" const create"+Q+": typeof create"+Q+"Decl = () => {",...S(),`return Object.freeze(${q});`,"};"),Y,ee]},Ql=e=>c+e,ql=e=>Gl(Ql(e),Ql(e)+ye),Kl="debugIds?: boolean",Xl="debugIds={debugIds}",Yl="then"+ve,et="Parameter",lt=": (parameter: "+et+", store: Store) => ",tt="const contextValue = useContext(Context);",at=", based on a parameter",nt=": ",ot="<"+et+",>",dt=et+"ized"+me+"<"+et+">",rt="rowId",st="rowId={rowId}",It=", separator, debugIds",ut="separator?: ReactElement | string",ct="then?: (store: Store",$t=Gl(ct+")"+Xe,Yl),it="then, then"+ye,bt=rt+nt+Re,pt="View",Ct=(e,...l)=>Gl(...l,ke+": "+e,ke+ve,"mutator?: boolean"),ht=(...e)=>Gl(...e,ke,ke+ye,"mutator"),mt=(e,l,n,o,s)=>{const[I,c,$,V,R,P,k,S]=Jl(),[O,E,D]=Wl(e,l,R),N=`./${Nl(n)}.d`,L=`./${Nl(n)}-ui-react.d`,j="tinybase/ui-react",G=Nl(n,1),H=Nl(G),M=G+"Or"+G+Re,z=H+"Or"+G+Re,W=H+`={${H}}`,F=re(),_=(e,l,t,n,o,d=a)=>(c(1,L,e+" as "+e+"Decl"),Ol(F,e,[l,t,n,o,d])),Z=(e,l,t,n,o,d=a)=>_("use"+e,l,t,n,o,d),Q=(e,l,t,n,o=a,d=a,r=a,s=a,I=a)=>(c(1,j,`use${l} as use${l}Core`),Z(e,Gl(o,ee,s),t,ae+`(${z}, use${l}Core, [`+(d||a)+(I?"], ["+I:a)+"]);",n,r)),q=(e,l,t,a)=>_(e,l,1,t,a),K=(e=0)=>ue(F,(([l,t,n,o,d],r)=>{const s=e?[Ve+` const ${r}: typeof ${r}Decl = ${d}(${l}): ${1==t?"any":t} =>`,n]:[Ve+` function ${r}${d}(${l}): ${1==t?"ComponentReturnType":t};`];return e||U(s,jl(o)),B(s,a),s}));c(null,t,Re,"Store",me,et+"ized"+me),c(0,j,"ComponentReturnType"),c(1,j,"useCellIds"),c(null,j,"ExtraProps"),c(0,N,G);const X=$(M,G+" | "+Re,`Used when you need to refer to a ${G} in a React hook or component`),Y=$(Le+Ne,Ml(H+Se+G,H+`ById?: {[${H}Id: Id]: ${G}}`),`Used with the ${Le} component, so that a `+G+" can be passed into the context of an application");c(0,"react","ReactElement","ComponentType"),c(1,"react","React"),c(1,L,X,Y);const ee=z+Se+X;R("{createContext, useContext, useMemo}","React"),R("Context",`createContext<[${G}?, {[${H}Id: Id]: ${G}}?]>([])`),Z("Create"+G,`create: () => ${G}, create`+ve,G,"\n// eslint-disable-next-line react-hooks/exhaustive-deps\nuseMemo(create, createDeps)",`Create a ${G} within a React application with convenient memoization`);const le=Z(G,"id?: Id",G+Oe,["{",tt,"return id == null ? contextValue[0] : contextValue[1]?.[id];","}"],`Get a reference to a ${G} from within a ${Le} component context`),ae=V("useHook",z+`: ${X} | undefined, hook: (...params: any[]) => any, preParams: any[], postParams: any[] = []`,[`const ${H} = ${le}(${z} as Id);`,`return hook(...preParams, ((${z} == null || typeof ${z} == 'string')`,`? ${H} : ${z})?.getStore(), ...postParams)`]),ne=V("getProps","getProps: ((id: any) => ExtraProps) | undefined, id: Id","(getProps == null) ? ({} as ExtraProps) : getProps(id)"),oe=V("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;"]),de=V("useCustomOrDefaultCellIds",Gl("customCellIds: Ids | undefined","tableId: Id","rowId: Id",`${z}?: ${X} | undefined`),[`const defaultCellIds = ${ae}(${z}, useCellIds, [tableId, rowId]);`,"return customCellIds ?? defaultCellIds;"]),Ie=R("NullComponent","() => null");if(!te(e)){const[e,l,n,s,I,v,T,x,R,P,k,S,D,j,M,z,B,F,U,_]=o;c(null,N,e,l,n,I,v,T,x,R,P,k,S,D,j,M,z,B,U,F),c(0,N,s),c(1,N,G),c(null,t,b,"IdOrNull");const Z=V("tableView",`{${H}, rowComponent, getRowComponentProps, customCellIds`+It+"}: any, rowIds: Ids, tableId: Id, defaultRowComponent: React.ComponentType<any>",["const Row = rowComponent ?? defaultRowComponent;",`return ${oe}(rowIds.map((rowId) => (`,"<Row","{..."+ne+"(getRowComponentProps, rowId)}","key={rowId}","tableId={tableId}",st,"customCellIds={customCellIds}",W,Xl,"/>","))",It,", tableId,",");"]),K=V("getDefaultTableComponent","tableId: Id",J(O(((e,l,t)=>`tableId == ${t} ? ${l}TableView : `)))+Ie),X=V("getDefaultCellComponent","tableId: Id, cellId: Id",J(O(((e,l,t)=>`tableId == ${t} ? ${J(E(e,((e,t,a,n,o)=>`cellId == ${n} ? `+l+o+"CellView : ")))+Ie} : `)))+Ie);Q(i+C,i+C,d,sl(1,0,0,1)+he),Q(C,C,e,sl(1,0)+he);const Y=Q(h,h,n+We,ul(p,Be)+he);Q(Je+C+me,Je+C+me,dt,sl(1,9)+at,Gl(Ql(C)+lt+l,Ql(C)+ve),ql(C),ot,Gl(ct,`tables: ${l})`+Xe,Yl),it),Q(we+C+me,we+C+me,me,sl(1,12),a,a,a,$t,it);const ee=$(w+Ne,Ml("tableId?: TId","rowId: Id","cellId?: CId",H+Se+G,Kl),$l(pe+w),`<TId extends ${n}, CId extends ${s}<TId>>`),le=$(m+Ne,Ml("tableId?: TId","rowId: Id",H+Se+G,"cellComponents?: {readonly [CId in "+s+`<TId>]?: ComponentType<${ee}<TId, CId>>;}`,`getCellComponentProps?: (cellId: ${s}<TId>) => ExtraProps`,`customCellIds?: ${s}<TId>[]`,ut,Kl),$l(pe+m),`<TId extends ${n}>`),te=$(p+Ne,Ml("tableId?: TId",H+Se+G,`rowComponent?: ComponentType<${le}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",ut,Kl),$l(pe+p),`<TId extends ${n}>`),ae=$("Sorted"+p+Ne,Ml("tableId?: TId","cellId?: "+s+"<TId>","descending?: boolean","offset?: number","limit?: number",H+Se+G,`rowComponent?: ComponentType<${le}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",ut,Kl),$l(pe+"sorted "+p),`<TId extends ${n}>`),re=$(C+Ne,Ml(H+Se+G,"tableComponents?: {readonly [TId in "+n+`]?: ComponentType<${te}<TId>>;}`,`getTableComponentProps?: (tableId: ${n}) => ExtraProps`,ut,Kl),$l(rl(1,1)));c(1,L,re,te,ae,le,ee),q(C+pt,"{"+H+", tableComponents, getTableComponentProps"+It+"}: "+re,[oe+`(${Y}(${H}).map((tableId) => {`,"const Table = (tableComponents?.[tableId] ?? "+K+"(tableId)) as React.ComponentType<TableProps<typeof tableId>>;","return <Table",`{...${ne}(getTableComponentProps, tableId)}`,"tableId={tableId}","key={tableId}",W,Xl,"/>;","}), separator)"],sl(1,13)+he),O(((e,l,t)=>{const[n,o,s,I,u]=se(_,e);c(null,N,n,o,s,I,u),Q(i+l+p,i+p,d,ml(e,0,1)+he,a,t),Q(l+p,p,n,ml(e)+he,a,t),Q(l+p+y,p+y,b,ul(w,"the whole of "+Cl(e))+he,a,t),Q(l+m+ge,m+ge,r,"Gets the number of Rows in "+Cl(e)+he,a,t);const $=Q(l+f,f,b,ul(m,Cl(e))+he,a,t),C=Q(l+g,g,b,ul(m,Cl(e),1)+he,"cellId?: "+u+", descending?: boolean, offset?: number, limit?: number",t+", cellId, descending, offset, limit");Q(i+l+m,i+m,d,fl(e,0,1)+he,bt,Gl(t,rt)),Q(l+m,m,s,fl(e)+he,bt,Gl(t,rt)),Q(l+y,y,u+We,ul(w,hl(e))+he,bt,Gl(t,rt)),Q(Je+l+p+me,Je+p+me,dt,ml(e,9)+at,Gl(Ql(p)+lt+o,Ql(p)+ve),Gl(t,ql(p)),ot,Gl(ct,`table: ${o})`+Xe,Yl),it),Q(we+l+p+me,we+p+me,me,ml(e,12),a,t,a,$t,it),Q(Je+l+m+me,Je+m+me,dt,fl(e,9)+at,Gl(bt,Ql(m)+lt+I,Ql(m)+ve),Gl(t,rt,ql(m)),ot,Gl(ct,`row: ${I})`+Xe,Yl),it),Q("Add"+l+m+me,"Add"+m+me,dt,fl(e,10)+at,Gl(Ql(m)+lt+I,Ql(m)+ve),Gl(t,ql(m)),ot,"then?: ("+Gl(bt+Oe,"store: Store","row: "+I+")"+Xe,"then"+ve)+", reuseRowIds?: boolean",it+", reuseRowIds"),Q(Je+l+De+m+me,Je+De+m+me,dt,fl(e,11)+at,Gl(bt,Ql(De+m)+lt+I,Ql(De+m)+ve),Gl(t,rt,ql(De+m)),ot,Gl(ct,`partialRow: ${I})`+Xe,Yl),it),Q(we+l+m+me,we+m+me,me,fl(e,12),bt,Gl(t,rt),a,$t,it);const h=q(l+m+pt,"{rowId, "+H+", cellComponents, getCellComponentProps, customCellIds"+It+`}: ${le}<'${e}'>`,[oe+`(${de}(customCellIds, `+t+`, rowId, ${H}).map((cellId: ${u}) => {`,"const Cell = (cellComponents?.[cellId] ?? "+X+`(${t}, cellId)) as React.ComponentType<CellProps<typeof `+t+", typeof cellId>>;","return <Cell",`{...${ne}(getCellComponentProps, cellId)} `,"key={cellId}",`tableId={${t}}`,st,"cellId={cellId}",W,Xl,"/>;","})"+It+", rowId)"],fl(e,13)+he);q(l+"Sorted"+p+pt,"{cellId, descending, offset, limit, ...props}: "+ae+`<'${e}'>`,Z+"(props, "+C+`(cellId, descending, offset, limit, props.${H}), ${t}, ${h});`,ml(e,13)+", sorted"+he),q(l+p+pt,`props: ${te}<'${e}'>`,Z+"(props, "+$+`(props.${H}), ${t}, ${h});`,ml(e,13)+he),E(e,((n,o,r,s,I)=>{const u="Map"+Nl(o,1);c(0,N,u),c(1,N,u),Q(i+l+I+p+w,i+p+w,d,`Gets ${dl(1)}the '${n}' Cell anywhere in `+Cl(e)+he,a,Gl(t,s)),Q(i+l+I+w,i+w,d,gl(e,n,0,1)+he,bt,Gl(t,rt,s));const $=Q(l+I+w,w,o+(A(r)?Oe:a),gl(e,n)+he,bt,Gl(t,rt,s));Q(Je+l+I+w+me,Je+w+me,dt,gl(e,n,9)+at,Gl(bt,Ql(w)+lt+o+" | "+u,Ql(w)+ve),Gl(t,rt,s,ql(w)),ot,Gl(ct,`cell: ${o} | ${u})`+Xe,Yl),it),Q(we+l+I+w+me,we+w+me,me,gl(e,n,12),Gl(bt,"forceDel?: boolean"),Gl(t,rt,s,"forceDel"),a,$t,it),q(l+I+w+pt,`{rowId, ${H}, debugIds}: `+ee+`<'${e}', '${n}'>`,[oe+`('' + ${$}(rowId, `+H+`) ?? '', undefined, debugIds, ${s})`],gl(e,n,13)+he)}))}));const ue=J(O((e=>{var l,t;return null!=(t=null==(l=se(_,e))?void 0:l[4])?t:a}))," | ");Q(i+C+u,i+C+u,Ke,sl(1,8,0,1)+" changes",Ct(I),ht()),Q(C+u,C+u,Ke,sl(1,8)+" changes",Ct(v),ht()),Q(h+u,h+u,Ke,pl(2,0,1),Ct(T),ht()),Q(i+p+u,i+p+u,Ke,pl(3,0,0,1),Ct(x,`tableId: ${n} | null`),ht("tableId")),Q(p+u,p+u,Ke,pl(3,0),Ct(R,`tableId: ${n} | null`),ht("tableId")),Q(p+y+u,p+y+u,Ke,pl(14,3,1),Ct(P,`tableId: ${n} | null`),ht("tableId")),Q(i+p+w+u,i+p+w+u,Ke,pl(16,3,0,1),Ct(k,`tableId: ${n} | null`,`cellId: ${ue} | null`),ht("tableId","cellId")),Q(m+ge+u,m+ge+u,Ke,pl(15,3),Ct(S,`tableId: ${n} | null`),ht("tableId")),Q(f+u,f+u,Ke,pl(4,3,1),Ct(D,`tableId: ${n} | null`),ht("tableId")),Q(g+u,g+u,Ke,pl(13,3,1),Ct(j,`tableId: ${n} | null`,"cellId: "+ue+Oe,"descending: boolean","offset: number","limit: number"+Oe),ht("tableId","cellId","descending","offset","limit")),Q(i+m+u,i+m+u,Ke,pl(5,3,0,1),Ct(M,`tableId: ${n} | null`,rt+": IdOrNull"),ht("tableId",rt)),Q(m+u,m+u,Ke,pl(5,3),Ct(z,`tableId: ${n} | null`,rt+": IdOrNull"),ht("tableId",rt)),Q(y+u,y+u,Ke,pl(6,5,1),Ct(B,`tableId: ${n} | null`,rt+": IdOrNull"),ht("tableId",rt)),Q(i+w+u,i+w+u,Ke,pl(7,5,0,1),Ct(F,`tableId: ${n} | null`,rt+": IdOrNull",`cellId: ${ue} | null`),ht("tableId",rt,"cellId")),Q(w+u,w+u,Ke,pl(7,5),Ct(U,`tableId: ${n} | null`,rt+": IdOrNull",`cellId: ${ue} | null`),ht("tableId",rt,"cellId"))}if(!te(l)){const[e,l,t,n,o,r,I,b]=s;c(null,N,...s),c(1,N,G);const p=V("getDefaultValueComponent","valueId: Id",J(D(((e,l,t,a,n)=>`valueId == ${a} ? `+n+"ValueView : ")))+Ie);Q(i+T,i+T,d,sl(2,0,0,1)+he),Q(T,T,e,sl(2,0)+he);const C=Q(x,x,t+We,ul(v,Be)+he);Q(Je+T+me,Je+T+me,dt,sl(2,9)+at,Gl(Ql(T)+lt+l,Ql(T)+ve),ql(T),ot,Gl(ct,`values: ${l})`+Xe,Yl),it),Q(Je+De+T+me,Je+De+T+me,dt,sl(2,11)+at,Gl(Ql(De+T)+lt+l,Ql(De+T)+ve),ql(De+T),ot,Gl(ct,`partialValues: ${l})`+Xe,Yl),it),Q(we+T+me,we+T+me,me,sl(2,12),a,a,a,$t,it);const h=$(v+Ne,Ml("valueId?: VId",H+Se+G,Kl),$l("a Value"),`<VId extends ${t}>`),m=$(T+Ne,Ml(H+Se+G,"valueComponents?: {readonly [VId in "+t+`]?: ComponentType<${h}<VId>>;}`,`getValueComponentProps?: (valueId: ${t}) => ExtraProps`,ut,Kl),$l(rl(2,1)));c(1,L,m,h),q(T+pt,"{"+H+", valueComponents, getValueComponentProps"+It+"}: "+m,[oe+`(${C}(${H}).map((valueId) => {`,"const Value = valueComponents?.[valueId] ?? "+p+"(valueId);","return <Value",`{...${ne}(getValueComponentProps, valueId)}`,"key={valueId}",W,Xl,"/>;","}), separator)"],sl(2,13)+he),D(((e,l,t,n,o)=>{const r="Map"+Nl(l,1);c(0,N,r),c(1,N,r),Q(i+o+v,i+v,d,wl(e,0,1)+he,a,n);const s=Q(o+v,v,l,wl(e)+he,a,n);Q(Je+o+v+me,Je+v+me,dt,wl(e,9)+at,Gl(Ql(v)+lt+l+" | "+r,Ql(v)+ve),Gl(n,ql(v)),ot,Gl(ct,`value: ${l} | ${r})`+Xe,Yl),it),Q(we+o+v+me,we+v+me,me,wl(e,12),a,n,a,$t,it),q(o+v+pt,`{${H}, debugIds}: ${h}<'${e}'>`,[oe+`('' + ${s}(`+H+`) ?? '', undefined, debugIds, ${n})`],wl(e,13)+he)})),Q(i+T+u,i+T+u,Ke,sl(2,8,0,1)+" changes",Ct(n),ht()),Q(T+u,T+u,Ke,sl(2,8)+" changes",Ct(o),ht()),Q(x+u,x+u,Ke,pl(10,0,1),Ct(r),ht()),Q(i+v+u,i+v+u,Ke,pl(11,0,0,1),Ct(I,`valueId: ${t} | null`),ht("valueId")),Q(v+u,v+u,Ke,pl(11,0),Ct(b,`valueId: ${t} | null`),ht("valueId"))}return q(Le,`{${H}, ${H}ById, children}: `+Y+" & {readonly children: React.ReactNode}",["{",tt,"return (","<Context."+Le,"value={useMemo(",`() => [${H} ?? contextValue[0], {...contextValue[1], ...${H}ById}],`,`[${H}, ${H}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"),[I(...P(0),...k(),...K(0)),I(...P(1),...S(),...K(1))]},ft=(e,l,t)=>{if(te(e)&&te(l))return[a,a,a,a];const[n,o,d,r]=Zl(e,l,t);return[n,o,...mt(e,l,t,d,r)]},gt=JSON.parse;var wt=Object.defineProperty,yt=Object.defineProperties,vt=Object.getOwnPropertyDescriptors,Tt=Object.getOwnPropertySymbols,xt=Object.prototype.hasOwnProperty,Vt=Object.prototype.propertyIsEnumerable,Rt=(e,l,t)=>l in e?wt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,Pt=(e,l)=>{for(var t in l||(l={}))xt.call(l,t)&&Rt(e,t,l[t]);if(Tt)for(var t of Tt(l))Vt.call(l,t)&&Rt(e,t,l[t]);return e},At=(e,l)=>yt(e,vt(l)),kt=(e,l,t)=>new Promise(((a,n)=>{var o=e=>{try{r(t.next(e))}catch(e){n(e)}},d=e=>{try{r(t.throw(e))}catch(e){n(e)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(o,d);r((t=t.apply(e,l)).next())}));const St="prettier/",Ot=St+"plugins/",Et={parser:"typescript",singleQuote:!0,trailingComma:"all",bracketSpacing:!1,jsdocSingleLineComment:!1},Dt=zl((e=>{const l=()=>{const l=gt(e.getTablesSchemaJson());return!te(l)||G(e.getTableIds(),(t=>{const a=e.getRowIds(t),n=re();if(G(a,(l=>G(e.getCellIds(t,l),(a=>{const o=e.getCell(t,l,a),d=$e(n,a,(()=>[j(o),re(),[0],0])),[r,s,[I]]=d,u=$e(s,o,(()=>0))+1;return u>I&&(d[2]=[u,o]),ce(s,o,u),d[3]++,r==j(o)})))))return l[t]={},oe(n,(([e,,[,n],o],d)=>{l[t][d]=Pt({[s]:e},o==N(a)?{[I]:n}:{})})),1}))?l:{}},t=()=>{const l=gt(e.getValuesSchemaJson());return te(l)&&e.forEachValue(((e,t)=>{l[e]={[s]:j(t)}})),l},a=e=>ft(l(),t(),e),n=e=>kt(void 0,null,(function*(){const l=["d.ts","ts","d.ts","tsx"],t=[];let n;try{n=(yield import(St+"standalone")).format,B(t,yield import(Ot+"estree"),yield import(Ot+"typescript"))}catch(e){n=e=>kt(void 0,null,(function*(){return e}))}return yield L(z(a(e),((e,a)=>kt(void 0,null,(function*(){return El(yield n(e,At(Pt({},Et),{plugins:t,filepath:"_."+l[a]})))})))))}));return Y({getStoreStats:l=>{let t=0,a=0,n=0;const o={};return e.forEachTable(((e,d)=>{t++;let r=0,s=0;const I={};d(((e,t)=>{r++;let a=0;t((()=>a++)),s+=a,l&&(I[e]={rowCells:a})})),a+=r,n+=s,l&&(o[e]={tableRows:r,tableCells:s,rows:I})})),Pt({totalTables:t,totalRows:a,totalCells:n,totalValues:N(e.getValueIds()),jsonLength:N(e.getJson())},l?{detail:{tables:o}}:{})},getStoreTablesSchema:l,getStoreValuesSchema:t,getStoreApi:a,getPrettyStoreApi:n,getStore:()=>e})}));e.createTools=Dt},"object"==typeof exports&&"undefined"!=typeof module?l(exports):"function"==typeof define&&define.amd?define(["exports"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseTools={});
|
|
1
|
+
var e,l;e=this,l=function(e){"use strict";const l=e=>typeof e,t="tinybase",a="",n=",",o=l(a),d=l(!0),r=l(0),s="type",I="default",u="Listener",c="get",$="add",i="Has",b="Ids",p="Table",C=p+"s",h=p+b,m="Row",f=m+b,g="Sorted"+m+b,w="Cell",y=w+b,v="Value",T=v+"s",x=v+b,V="Transaction",R="Partial",P=(e,l=a,t)=>e.split(l,t);var A=(e,l,t)=>new Promise(((a,n)=>{var o=e=>{try{r(t.next(e))}catch(e){n(e)}},d=e=>{try{r(t.throw(e))}catch(e){n(e)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(o,d);r((t=t.apply(e,l)).next())}));const k=Promise,S=isFinite,O=e=>null==e,E=(e,l,t)=>O(e)?null==t?void 0:t():l(e),D=e=>e==o||e==d,N=e=>l(e)==o,L=e=>Array.isArray(e),j=(e,l,t)=>e.slice(l,t),G=e=>e.length,H=e=>A(void 0,null,(function*(){return k.all(e)})),M=e=>{const t=l(e);return D(t)||t==r&&S(e)?t:void 0},J=(e,l)=>e.every(l),z=(e,l)=>e.sort(l),W=(e,l)=>e.forEach(l),B=(e,l=a)=>e.join(l),F=(e,l)=>e.map(l),U=(e,l)=>e.filter(l),_=(e,...l)=>e.push(...l),Z=e=>e.pop(),Q=(e,...l)=>e.unshift(...l),q=e=>e.shift(),K=Object,X=e=>K.getPrototypeOf(e),Y=K.entries,ee=e=>!O(e)&&E(X(e),(e=>e==K.prototype||O(X(e))),(()=>!0)),le=K.keys,te=K.freeze,ae=(e,l)=>F(Y(e),(([e,t])=>l(t,e))),ne=e=>G(le(e)),oe=e=>ee(e)&&0==ne(e),de=(e,l)=>{var t;return null!=(t=null==e?void 0:e.has(l))&&t},re=e=>{var l;return[...null!=(l=null==e?void 0:e.values())?l:[]]},se=(e,l)=>null==e?void 0:e.forEach(l),Ie=(e,l)=>null==e?void 0:e.delete(l),ue=e=>new Map(e),ce=(e,l)=>null==e?void 0:e.get(l),$e=(e,l)=>se(e,((e,t)=>l(t,e))),ie=(e,l)=>{var t;return F([...null!=(t=null==e?void 0:e.entries())?t:[]],(([e,t])=>l(t,e)))},be=(e,l,t)=>O(t)?(Ie(e,l),e):null==e?void 0:e.set(l,t),pe=(e,l,t,a)=>(de(e,l)||be(e,l,t()),ce(e,l)),Ce=e=>e.toUpperCase(),he=e=>e.toLowerCase(),me="a ",fe="A function for",ge=", and registers a listener so that any changes to that result will cause a re-render",we="Callback",ye="Changes",ve="Count",Te="Del",xe="Deps",Ve=xe+"?: React.DependencyList",Re="doRollback?: DoRollback",Pe="actions: () => Return, "+Re,Ae="export",ke="Id",Se="Invalid",Oe="Json",Ee=he(u),De="?: ",Ne=" | undefined",Le="NonNullable",je="Props",Ge="Provider",He=`Registers a ${Ee} that will be called`,Me="Represents",Je="rowId: "+ke,ze="Schema",We="Set",Be=", descending?: boolean, offset?: number, limit?: number",Fe="[]",Ue="the Store",_e=he(V),Ze="Execute a "+_e+" to make multiple mutations",Qe="Explicitly starts a "+_e,qe="Explicitly finishes a "+_e,Ke="the end of the "+_e,Xe="void",Ye=" => "+Xe,el="WhenSet",ll=" when setting it",tl=me+"string serialization of",al=" ",nl="Gets a callback that can ",ol="the ",dl=" the schema for",rl=(e=0)=>e?"the existence of ":"",sl=(e=0,l=0,t=0)=>rl(t)+`the ${Vl[e]}content of`+(l?al+Ue:a),Il=(e=0,l,t=0,n=0)=>vl[l]+al+rl(n)+sl(e,1)+(t?" when setting it":a),ul=(e,l=0)=>Me+` a Row when ${l?"s":"g"}etting ${sl()} the '${e}' `+p,cl=(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,il=e=>"The props passed to a component that renders "+e,bl=e=>"A function that takes "+e,pl=(e,l=0,t=0)=>fe+" listening to changes to "+rl(t)+xl[e]+" in "+xl[l],Cl=(e,l,t=0,n=0)=>He+" whenever "+rl(n)+xl[e]+" in "+xl[l]+" change"+(t?a:"s"),hl=e=>`the '${e}' `+p,ml=e=>"the specified Row in "+hl(e),fl=(e,l=0,t=0)=>vl[l]+al+sl(0,0,t)+al+hl(e),gl=(e,l=0,t=0)=>vl[l]+` ${sl(0,0,t)} `+ml(e),wl=(e,l,t=0,a=0)=>vl[t]+al+rl(a)+`the '${l}' Cell for `+ml(e),yl=(e,l=0,t=0)=>vl[l]+al+rl(t)+`the '${e}' Value`,vl=["Gets","Checks existence of","Sets","Deletes","Sets part of",Me,"Gets "+tl,"Sets "+tl,He+" whenever",nl+"set",nl+"add",nl+"set part of",nl+"delete","Renders","Gets "+tl+dl,"Sets"+dl,"Deletes"+dl],Tl=[c,"has","set","del","set","forEach",$,a],xl=[Ue,C,ol+p+al+b,me+p,ol+m+al+b,me+m,ol+w+al+b,me+w,"invalid Cell changes",T,ol+v+al+b,me+v,"invalid Value changes",ol+"sorted "+m+al+b,ol+w+al+b+" anywhere",ol+"number of Rows",me+w+" anywhere"],Vl=[a,"tabular ","keyed value "],Rl=e=>new Set(L(e)||O(e)?e:[e]),Pl=(e,l)=>null==e?void 0:e.add(l),Al=/[^A-Za-z]+/,kl=/[^A-Za-z0-9]+/,Sl=/^( *)\/\*\* *(.*?) *\*\/$/gm,Ol=e=>e.includes(n),El=(e,l,t,a=1)=>{const n=`${l}${1==a?"":a}`;return de(e,n)?El(e,l,t,a+1):(be(e,n,t),n)},Dl=e=>e.replace(Sl,((e,l,t)=>{const a=77-G(l);return`${l}/**\n${t.replace(RegExp(`([^\\n]{1,${a}})(\\s|$)`,"g"),l+" * $1\n")}${l} */`})),Nl=e=>e.flat(1e3),Ll=(e,l=0)=>B(F(P(e,kl),((e,t)=>(t>0||l?Ce:he)(j(e,0,1))+j(e,1)))),jl=e=>Ce(B(P(e&&!Al.test(e[0])?e:" "+e,kl),"_")),Gl=e=>`/** ${e}. */`,Hl=(...e)=>B(U(e,(e=>e)),", "),Ml=(...e)=>"{"+B(e,"; ")+"}",Jl=(...e)=>Ml(...F(e,(e=>"readonly "+e))),zl=()=>{const e=[ue(),ue(),ue(),ue()],l=ue(),t=ue(),n=e=>{const l=e.indexOf(" as ");return-1!=l?j(e,l+4):e};return[(...e)=>B(Nl(e),"\n"),(l,t,...a)=>W(a,(a=>W([0,1],(n=>(null!=l?l:n)==n?Pl(pe(e[n],t,Rl),a):0)))),(e,t,n,o=a,d=1)=>El(l,e,[t,n,o,d]),(e,l,a)=>El(t,e,L(a)?[`(${l}) => {`,a,"}"]:[`(${l}) => ${a}`]),(e,l)=>ce(t,e)===l?e:El(t,e,l),(l=0)=>F([...z(ie(e[l],((e,l)=>`import {${B(z(re(e),((e,l)=>n(e)>n(l)?1:-1)),", ")}} from '${l}';`)),((e,l)=>Ol(e)!=Ol(l)?Ol(e)?-1:1:e>l?1:-1)),a],(e=>e.replace("{React}","React"))),()=>ie(l,(([e,l,t,n],o)=>[Gl(l),`${n?Ae+" ":a}type ${o}${t} = ${e};`,a])),()=>ie(t,((e,l)=>(e=L(e)?e:[e],_(e,Z(e)+";"),[`const ${l} = ${q(e)}`,e,a])))]},Wl=(e,l)=>{const t=new WeakMap;return l=>(t.has(l)||t.set(l,e(l)),t.get(l))},Bl=(e,l,t)=>[l=>ae(e,((e,a)=>l(a,Ll(a,1),t(jl(a),`'${a}'`)))),(l,a)=>ae(e[l],((e,l)=>a(l,e[s],e[I],t(jl(l),`'${l}'`),Ll(l,1)))),e=>ae(l,((l,a)=>e(a,l[s],l[I],t(jl(a),`'${a}'`),Ll(a,1))))],Fl=(e,l,t,n)=>[(n,o)=>{const d=n+": "+o,r=e(C,Ml(...l((e=>`'${e}'?: {[rowId: Id]: `+Ml(...t(e,((e,l,t)=>`'${e}'${O(t)?"?":a}: ${l}`)))+"}"))),Il(1,5)),s=e(C+el,Ml(...l((e=>`'${e}'?: {[rowId: Id]: `+Ml(...t(e,((e,l)=>`'${e}'?: ${l}`)))+"}"))),Il(1,5,1)),I=e(p+ke,"keyof "+r,"A "+p+" Id in "+Ue),c=`<TId extends ${I}>`,$=e(p,Le+`<${r}[TId]>`,"A "+p+" in "+Ue,c),b=e(p+el,Le+`<${s}[TId]>`,"A "+p+" in "+Ue+ll,c),v=e(m,$+"<TId>[Id]","A "+m+" in a "+p,c),T=e(m+el,b+"<TId>[Id]","A "+m+" in a "+p+ll,c),x=e(w+ke,`Extract<keyof ${v}<TId>, Id>`,"A "+w+" Id in a "+m,c),V=e(w,Le+`<${r}[TId]>[Id][CId]`,"A "+w+" in a "+m,`<TId extends ${I}, CId extends ${x}<TId>>`),R=e("CellIdCellArray",`CId extends ${x}<TId> ? [cellId: CId, cell: ${V}<TId, CId>] : never`,w+" Ids and types in a "+m,`<TId extends ${I}, CId = ${x}<TId>>`,0),P=e(w+we,`(...[cellId, cell]: ${R}<TId>)`+Ye,bl(me+w+" Id, and "+w),c),A=e(m+we,"(rowId: Id, forEachCell: (cellCallback: CellCallback<TId>) "+Ye+") "+Ye,bl(me+m+" Id, and a "+w+" iterator"),c),k=e(p+w+we,`(cellId: ${x}<TId>, count: number) `+Ye,bl(me+w+" Id, and count of how many times it appears"),c),S=e("TableIdForEachRowArray",`TId extends ${I} ? [tableId: TId, forEachRow: (rowCallback: ${A}<TId>)${Ye}] : never`,p+" Ids and callback types",`<TId = ${I}>`,0),E=e(p+we,`(...[tableId, forEachRow]: ${S})`+Ye,bl(me+p+" Id, and a "+m+" iterator"),a),D=e("TableIdRowIdCellIdArray",`TId extends ${I} ? [tableId: TId, rowId: Id, cellId: ${x}<TId>] : never`,"Ids for GetCellChange",`<TId = ${I}>`,0),N=e("GetCellChange",`(...[tableId, rowId, cellId]: ${D}) => CellChange`,fe+" returning information about any Cell's changes during a "+_e),L=e(i+C+u,`(${d}, hasTables: boolean)`+Ye,pl(1,0,1)),j=e(C+u,`(${d}, getCellChange: ${N}${Ne})`+Ye,pl(1)),G=e(h+u,`(${d})`+Ye,pl(2)),H=e(i+p+u,`(${d}, tableId: ${I}, hasTable: boolean)`+Ye,pl(3,0,1)),M=e(p+u,`(${d}, tableId: ${I}, getCellChange: ${N}${Ne})`+Ye,pl(3)),J=e(p+y+u,`(${d}, tableId: ${I})`+Ye,pl(14,3)),z=e("HasTableCellListenerArgsArrayInner",`CId extends ${x}<TId> ? [${d}, tableId: TId, cellId: CId, hasTableCell: boolean] : never`,"Cell args for HasTableCellListener",`<TId extends ${I}, CId = ${x}<TId>>`,0),W=e("HasTableCellListenerArgsArrayOuter",`TId extends ${I} ? `+z+"<TId> : never","Table args for HasTableCellListener",`<TId = ${I}>`,0),B=e(i+p+w+u,`(...[${n}, tableId, cellId, hasTableCell]: `+W+")"+Ye,pl(16,3,1)),F=e(m+"Count"+u,`(${d}, tableId: ${I})`+Ye,pl(15,3)),U=e(f+u,`(${d}, tableId: ${I})`+Ye,pl(4,3)),_=e(g+u,"("+Hl(d,"tableId: "+I,"cellId: Id"+Ne,"descending: boolean","offset: number","limit: number"+Ne,"sortedRowIds: Ids")+")"+Ye,pl(13,3)),Z=e(i+m+u,"("+Hl(""+d,"tableId: "+I,Je,"hasRow: boolean")+")"+Ye,pl(5,3,1)),Q=e(m+u,"("+Hl(""+d,"tableId: "+I,Je,`getCellChange: ${N}${Ne}`)+")"+Ye,pl(5,3)),q=e(y+u,"("+Hl(""+d,"tableId: "+I,Je)+")"+Ye,pl(6,5)),K=e("HasCellListenerArgsArrayInner",`CId extends ${x}<TId> ? [${d}, tableId: TId, ${Je}, cellId: CId, hasCell: boolean] : never`,"Cell args for HasCellListener",`<TId extends ${I}, CId = ${x}<TId>>`,0),X=e("HasCellListenerArgsArrayOuter",`TId extends ${I} ? `+K+"<TId> : never","Table args for HasCellListener",`<TId = ${I}>`,0),Y=e(i+w+u,`(...[${n}, tableId, rowId, cellId, hasCell]: `+X+")"+Ye,pl(7,5,1)),ee=e("CellListenerArgsArrayInner",`CId extends ${x}<TId> ? [${d}, tableId: TId, ${Je}, cellId: CId, newCell: ${V}<TId, CId> ${Ne}, oldCell: ${V}<TId, CId> ${Ne}, getCellChange: ${N} ${Ne}] : never`,"Cell args for CellListener",`<TId extends ${I}, CId = ${x}<TId>>`,0),le=e("CellListenerArgsArrayOuter",`TId extends ${I} ? `+ee+"<TId> : never","Table args for CellListener",`<TId = ${I}>`,0);return[r,s,I,$,b,v,T,x,V,P,A,k,E,L,j,G,H,M,J,B,F,U,_,Z,Q,q,Y,e(w+u,`(...[${n}, tableId, rowId, cellId, newCell, oldCell, getCellChange]: ${le})`+Ye,pl(7,5)),e(Se+w+u,`(${d}, tableId: Id, ${Je}, cellId: Id, invalidCells: any[])`+Ye,pl(8))]},(l,t)=>{const o=l+": "+t,d=e(T,Ml(...n(((e,l,t)=>`'${e}'${O(t)?"?":a}: ${l}`))),Il(2,5)),r=e(T+el,Ml(...n(((e,l)=>`'${e}'?: ${l}`))),Il(2,5,1)),s=e(v+ke,"keyof "+d,"A "+v+" Id in "+Ue),I=e(v,Le+`<${d}[VId]>`,"A "+v+" Id in "+Ue,`<VId extends ${s}>`),c=e("ValueIdValueArray",`VId extends ${s} ? [valueId: VId, value: ${I}<VId>] : never`,v+" Ids and types in "+Ue,`<VId = ${s}>`,0),$=e(v+we,`(...[valueId, value]: ${c})`+Ye,bl(me+v+" Id, and "+v)),b=e("GetValueChange",`(valueId: ${s}) => ValueChange`,fe+" returning information about any Value's changes during a "+_e),p=e(i+T+u,`(${o}, hasValues: boolean)`+Ye,pl(9,0,1)),C=e(T+u,`(${o}, getValueChange: ${b}${Ne})`+Ye,pl(9)),h=e(x+u,`(${o})`+Ye,pl(10)),m=e(i+v+u,`(${o}, valueId: ValueId, hasValue: boolean)`+Ye,pl(11,0,1)),f=e("ValueListenerArgsArray",`VId extends ${s} ? [${o}, valueId: VId, newValue: ${I}<VId> ${Ne}, oldValue: ${I}<VId> ${Ne}, getValueChange: ${b} ${Ne}] : never`,"Value args for ValueListener",`<VId = ${s}>`,0);return[d,r,s,I,$,p,C,h,m,e(v+u,`(...[${l}, valueId, newValue, oldValue, getValueChange]: `+f+")"+Ye,pl(11)),e(Se+v+u,`(${o}, valueId: Id, invalidValues: any[])`+Ye,pl(12))]},(l,t)=>e(V+u,`(${l}: ${t})`+Ye,fe+" listening to the completion of a "+_e)],Ul=(e,l=a,t=a)=>`store.${e}(${l})`+(t?" as "+t:a),_l=(e,l=a)=>`fluent(() => ${Ul(e,l)})`,Zl=(e,l=a,t=a)=>`store.${e}(${l?l+", ":a}proxy(listener)${t?", "+t:a})`,Ql=(e,l,n)=>{const[o,r,c,P,A,k,S,E]=zl(),[D,L,j]=Bl(e,l,A),[G,H,M]=Fl(c,D,L,j),J=ue(),z=(e=0)=>ie(J,(([l,t,n,o,d],r)=>{const s=e?[r+`: ${d}(${l}): ${t} => ${n},`]:[r+d+`(${l}): ${t};`];return e||Q(s,Gl(o)),_(s,a),s})),F=(e,l,t,n,o,d=a)=>El(J,e,[l,t,n,o,d]),U=(e,l,t,n,o,d=a,r=a,s=a)=>F(Tl[e]+l+(4==e?R:a)+t,d,n,(n==K?_l:Ul)(Tl[e]+(4==e?R:a)+t,r,e?void 0:n),o,s),Z=(e,l,t,n=a,o=a,d=1,r=a)=>F($+e+u,(n?n+", ":a)+Ee+": "+l+(d?", mutator?: boolean":a),ke,Zl($+e+u,o,d?"mutator":a),t,r),q=`./${Ll(n)}.d`,K=Ll(n,1),X=Ll(K),Y=[],ee=ue();let le=[],te=[];if(r(1,q,K,`create${K} as create${K}Decl`),oe(e))r(null,t,C);else{r(0,t,"CellChange"),r(null,t,b);const[e,l,n,o,u,$,v,T,x,V,R,P,k,S,E,j,H,M,J,z,F,Q,te,ae,ne,oe,de,se,Ie]=G(X,K),$e=ue();D(((e,l)=>{const t=`<'${e}'>`,a=[c(l+p,o+t,Me+` the '${e}' `+p),c(l+p+el,u+t,Me+` the '${e}' `+p+ll),c(l+m,$+t,ul(e)),c(l+m+el,v+t,ul(e,1)),c(l+w+ke,T+t,`A Cell Id for the '${e}' `+p),c(l+w+we,V+t,bl(`a Cell Id and value from a Row in the '${e}' `+p)),c(l+m+we,R+t,bl(`a Row Id from the '${e}' Table, and a Cell iterator`)),c(l+p+w+we,P+t,bl(`a Cell Id from anywhere in the '${e}' Table, and a count of how many times it appears`))];be($e,e,a),r(1,q,...a)})),r(1,q,e,l,n,T,k,S,E,j,H,M,J,z,F,Q,te,ae,ne,oe,de,se,Ie),le=[e,l,n,T,S,E,j,H,M,J,z,F,Q,te,ae,ne,oe,de,se,$e],W([[e],[d],[K,"tables: "+l,"tables"],[K]],(([e,l,t],n)=>U(n,a,C,e,Il(1,n),l,t))),U(0,a,h,n+Fe,cl(p,Ue)),U(5,a,p,Xe,$l(p,Ue),"tableCallback: "+k,"tableCallback as any"),D(((e,l,t)=>{const[n,o,r,s,I,u,c,$]=ce($e,e);W([[n],[d],[K,"table: "+o,", table"],[K]],(([n,o,d=a],r)=>U(r,l,p,n,fl(e,r),o,t+d))),U(0,l,p+y,b,cl(w,"the whole of "+hl(e)),a,t),U(5,l,p+w,Xe,$l(p+w,"the whole of "+hl(e)),"tableCellCallback: "+$,t+", tableCellCallback as any"),U(0,l,m+ve,"number","Gets the number of Rows in the "+hl(e),a,t),U(0,l,f,b,cl(m,hl(e)),a,t),U(0,l,g,b,cl(m,hl(e),1),"cellId?: "+I+Be,t+", cellId, descending, offset, limit"),U(5,l,m,Xe,$l(m,hl(e)),"rowCallback: "+c,t+", rowCallback as any"),W([[r],[d],[K,", row: "+s,", row"],[K],[K,", partialRow: "+s,", partialRow"]],(([n,o=a,d=a],r)=>U(r,l,m,n,gl(e,r),Je+o,t+", rowId"+d))),U(6,l,m,ke+Ne,"Add a new Row to "+hl(e),"row: "+s+", reuseIds?: boolean",t+", row, reuseIds"),U(0,l,y,I+Fe,cl(w,ml(e)),Je,t+", rowId"),U(5,l,w,Xe,$l(w,ml(e)),Je+", cellCallback: "+u,t+", rowId, cellCallback as any"),L(e,((n,o,r,s,I)=>{const u="Map"+Ll(o,1);be(ee,o,u);const c=o+(O(r)?Ne:a);W([[c],[d],[K,`, cell: ${o} | `+u,", cell as any"],[K]],(([o,d=a,r=a],u)=>U(u,l+I,w,o,wl(e,n,u),Je+d,t+", rowId, "+s+r))),U(1,l+I,p+w,d,vl[1]+` the '${n}' Cell anywhere in `+hl(e),a,t+", "+s)}))})),U(0,a,C+Oe,Oe,Il(1,6)),U(2,a,C+Oe,K,Il(1,7),"tablesJson: "+Oe,"tables"+Oe),Z(i+C,S,Il(1,8,0,1)+" changes"),Z(C,E,Il(1,8)+" changes"),Z(h,j,Cl(2,0,1)),Z(i+p,H,Cl(3,0,0,1),`tableId: ${n} | null`,"tableId"),Z(p,M,Cl(3,0),`tableId: ${n} | null`,"tableId"),Z(p+y,J,Cl(14,3,1),`tableId: ${n} | null`,"tableId"),Z(i+p+w,z,Cl(16,3,0,1),`tableId: ${n} | null, cellId: ${B(D((e=>{var l,t;return null!=(t=null==(l=ce($e,e))?void 0:l[4])?t:a}))," | ")} | null`,"tableId, cellId"),Z(m+ve,F,Cl(15,3),`tableId: ${n} | null`,"tableId"),Z(f,Q,Cl(4,3,1),`tableId: ${n} | null`,"tableId"),Z(g,te,Cl(13,3,1),Hl("tableId: TId",`cellId: ${T}<TId>`+Ne,"descending: boolean","offset: number","limit: number"+Ne),Hl("tableId","cellId","descending","offset","limit"),1,"<TId extends TableId>"),Z(i+m,ae,Cl(5,3,0,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Z(m,ne,Cl(5,3),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Z(y,oe,Cl(6,5,1),`tableId: ${n} | null, rowId: IdOrNull`,"tableId, rowId"),Z(i+w,de,Cl(7,5,0,1),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${B(D((e=>{var l,t;return null!=(t=null==(l=ce($e,e))?void 0:l[4])?t:a}))," | ")} | null`,"tableId, rowId, cellId"),Z(w,se,Cl(7,5),`tableId: ${n} | null, rowId: IdOrNull, cellId: ${B(D((e=>{var l,t;return null!=(t=null==(l=ce($e,e))?void 0:l[4])?t:a}))," | ")} | null`,"tableId, rowId, cellId"),Z(Se+w,Ie,He+" whenever an invalid Cell change was attempted","tableId: IdOrNull, rowId: IdOrNull, cellId: IdOrNull","tableId, rowId, cellId"),r(1,q,...re(ee)),_(Y,".set"+C+ze+"({",Nl(D(((e,l,t)=>[`[${t}]: {`,...L(e,((e,l,t,n)=>`[${n}]: {[${A(jl(s),`'${s}'`)}]: ${A(jl(l),`'${l}'`)}${O(t)?a:`, [${A(jl(I),`'${I}'`)}]: `+(N(t)?A(jl(t),`'${t}'`):t)}},`)),"},"]))),"})")}if(oe(l))r(null,t,T);else{const[e,l,n,o,u,c,$,b,p,C,h]=H(X,K);r(1,q,e,l,n,u,c,$,b,p,C,h),te=[e,l,n,c,$,b,p,C],W([[e],[d],[K,"values: "+l,"values"],[K],[K,"partialValues: "+l,"partialValues"]],(([e,l,t],n)=>U(n,a,T,e,Il(2,n),l,t))),U(0,a,x,n+Fe,cl(v,Ue)),U(5,a,v,"void",$l(v,Ue),"valueCallback: "+u,"valueCallback as any"),j(((e,l,t,n,o)=>{const r="Map"+Ll(l,1);be(ee,l,r),W([[l],[d],[K,`value: ${l} | `+r,", value as any"],[K]],(([l,t,d=a],r)=>U(r,o,v,l,yl(e,r),t,n+d)))})),U(0,a,T+Oe,Oe,Il(2,6)),U(2,a,T+Oe,K,Il(2,7),"valuesJson: "+Oe,"values"+Oe),Z(i+T,c,Il(2,8,0,1)+" changes"),Z(T,$,Il(2,8)+" changes"),Z(x,b,Cl(10,0,1)),Z(i+v,p,Cl(11,0,0,1),`valueId: ${n} | null`,"valueId"),Z(v,C,Cl(11,0),`valueId: ${n} | null`,"valueId"),Z(Se+v,h,He+" whenever an invalid Value change was attempted","valueId: IdOrNull","valueId"),r(1,q,...re(ee)),r(0,t,"ValueChange"),_(Y,".set"+T+ze+"({",j(((e,l,t,n)=>[`[${n}]: {[${A(jl(s),`'${s}'`)}]: ${A(jl(l),`'${l}'`)}${O(t)?a:`, [${A(jl(I),`'${I}'`)}]: `+(N(t)?A(jl(t),`'${t}'`):t)}},`])),"})")}U(0,a,"Content",`[${C}, ${T}]`,Il(0,0)),U(2,a,"Content",K,Il(0,2),`[tables, values]: [${C}, ${T}]`,"[tables, values]"),U(7,a,"applyChanges",K,`Applies a set of ${ye} to the Store`,"changes: "+ye,"changes"),$e(ee,((e,l)=>c(l,`(cell: ${e}${Ne}) => `+e,`Takes a ${e} Cell value and returns another`))),r(null,t,"DoRollback",ke,"IdOrNull",Oe,"Store",ye),U(0,a,Oe,Oe,Il(0,6)),U(2,a,Oe,K,Il(0,7),"tablesAndValuesJson: "+Oe,"tablesAndValuesJson"),U(7,a,_e,"Return",Ze,Pe,"actions, doRollback","<Return>"),U(7,a,"start"+V,K,Qe),U(7,a,"finish"+V,K,qe,Re,"doRollback");const ae=M(X,K);return Z("Start"+V,ae,He+" just before the start of the "+_e,a,a,0),Z("WillFinish"+V,ae,He+" just before "+Ke,a,a,0),Z("DidFinish"+V,ae,He+" just after "+Ke,a,a,0),U(7,a,"call"+u,K,"Manually provoke a listener to be called","listenerId: Id","listenerId"),U(3,a,u,K,"Remove a listener that was previously added to "+Ue,"listenerId: Id","listenerId"),F("getStore",a,"Store","store",vl[0]+" the underlying Store object"),r(1,t,"createStore"),r(1,q,K,`create${K} as create${K}Decl`,ae),A("store",["createStore()",...Y]),P("fluent","actions: () => Store",["actions();",`return ${X};`]),P("proxy","listener: any",`(_: Store, ...params: any[]) => listener(${X}, ...params)`),A(X,["{",...z(1),"}"]),[o(...k(0),...S(),Ae+" interface "+K+" {",...z(0),"}",a,Gl(`Creates a ${K} object`),Ae+" function create"+K+"(): "+K+";"),o(...k(1),Ae+" const create"+K+": typeof create"+K+"Decl = () => {",...E(),`return Object.freeze(${X});`,"};"),le,te]},ql=e=>c+e,Kl=e=>Hl(ql(e),ql(e)+xe),Xl="debugIds?: boolean",Yl="debugIds={debugIds}",et="then"+Ve,lt="Parameter",tt=": (parameter: "+lt+", store: Store) => ",at="const contextValue = useContext(Context);",nt=", based on a parameter",ot=": ",dt="<"+lt+",>",rt=lt+"ized"+we+"<"+lt+">",st="rowId",It="rowId={rowId}",ut=", separator, debugIds",ct="separator?: ReactElement | string",$t="then?: (store: Store",it=Hl($t+")"+Ye,et),bt="then, then"+xe,pt=st+ot+ke,Ct="View",ht=(e,...l)=>Hl(...l,Ee+": "+e,Ee+Ve,"mutator?: boolean"),mt=(...e)=>Hl(...e,Ee,Ee+xe,"mutator"),ft=(e,l,n,o,s)=>{const[I,c,$,V,P,A,k,S]=zl(),[E,D,N]=Bl(e,l,P),L=`./${Ll(n)}.d`,j=`./${Ll(n)}-ui-react.d`,G="tinybase/ui-react",H=Ll(n,1),M=Ll(H),J=H+"Or"+H+ke,z=M+"Or"+H+ke,W=M+`={${M}}`,F=ue(),U=(e,l,t,n,o,d=a)=>(c(1,j,e+" as "+e+"Decl"),El(F,e,[l,t,n,o,d])),Z=(e,l,t,n,o,d=a)=>U("use"+e,l,t,n,o,d),q=(e,l,t,n,o=a,d=a,r=a,s=a,I=a)=>(c(1,G,`use${l} as use${l}Core`),Z(e,Hl(o,le,s),t,ae+`(${z}, use${l}Core, [`+(d||a)+(I?"], ["+I:a)+"]);",n,r)),K=(e,l,t,a)=>U(e,l,1,t,a),X=(e=0)=>ie(F,(([l,t,n,o,d],r)=>{const s=e?[Ae+` const ${r}: typeof ${r}Decl = ${d}(${l}): ${1==t?"any":t} =>`,n]:[Ae+` function ${r}${d}(${l}): ${1==t?"ComponentReturnType":t};`];return e||Q(s,Gl(o)),_(s,a),s}));c(null,t,ke,"Store",we,lt+"ized"+we),c(0,G,"ComponentReturnType"),c(1,G,"useCellIds"),c(null,G,"ExtraProps"),c(0,L,H);const Y=$(J,H+" | "+ke,`Used when you need to refer to a ${H} in a React hook or component`),ee=$(Ge+je,Jl(M+De+H,M+`ById?: {[${M}Id: Id]: ${H}}`),`Used with the ${Ge} 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,j,Y,ee);const le=z+De+Y;P("{createContext, useContext, useMemo}","React"),P("Context",`createContext<[${H}?, {[${M}Id: Id]: ${H}}?]>([])`),Z("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=Z(H,"id?: Id",H+Ne,["{",at,"return id == null ? contextValue[0] : contextValue[1]?.[id];","}"],`Get a reference to a ${H} from within a ${Ge} component context`),ae=V("useHook",z+`: ${Y} | undefined, hook: (...params: any[]) => any, preParams: any[], postParams: any[] = []`,[`const ${M} = ${te}(${z} as Id);`,`return hook(...preParams, ((${z} == null || typeof ${z} == 'string')`,`? ${M} : ${z})?.getStore(), ...postParams)`]),ne=V("getProps","getProps: ((id: any) => ExtraProps) | undefined, id: Id","(getProps == null) ? ({} as ExtraProps) : getProps(id)"),de=V("wrap",Hl("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;"]),re=V("useCustomOrDefaultCellIds",Hl("customCellIds: Ids | undefined","tableId: Id","rowId: Id",`${z}?: ${Y} | undefined`),[`const defaultCellIds = ${ae}(${z}, useCellIds, [tableId, rowId]);`,"return customCellIds ?? defaultCellIds;"]),se=P("NullComponent","() => null");if(!oe(e)){const[e,l,n,s,I,v,T,x,P,A,k,S,N,G,J,z,F,U,_,Z]=o;c(null,L,e,l,n,I,v,T,x,P,A,k,S,N,G,J,z,F,_,U),c(0,L,s),c(1,L,H),c(null,t,b,"IdOrNull");const Q=V("tableView",`{${M}, rowComponent, getRowComponentProps, customCellIds`+ut+"}: any, rowIds: Ids, tableId: Id, defaultRowComponent: React.ComponentType<any>",["const Row = rowComponent ?? defaultRowComponent;",`return ${de}(rowIds.map((rowId) => (`,"<Row","{..."+ne+"(getRowComponentProps, rowId)}","key={rowId}","tableId={tableId}",It,"customCellIds={customCellIds}",W,Yl,"/>","))",ut,", tableId,",");"]),X=V("getDefaultTableComponent","tableId: Id",B(E(((e,l,t)=>`tableId == ${t} ? ${l}TableView : `)))+se),Y=V("getDefaultCellComponent","tableId: Id, cellId: Id",B(E(((e,l,t)=>`tableId == ${t} ? ${B(D(e,((e,t,a,n,o)=>`cellId == ${n} ? `+l+o+"CellView : ")))+se} : `)))+se);q(i+C,i+C,d,Il(1,0,0,1)+ge),q(C,C,e,Il(1,0)+ge);const ee=q(h,h,n+Fe,cl(p,Ue)+ge);q(We+C+we,We+C+we,rt,Il(1,9)+nt,Hl(ql(C)+tt+l,ql(C)+Ve),Kl(C),dt,Hl($t,`tables: ${l})`+Ye,et),bt),q(Te+C+we,Te+C+we,we,Il(1,12),a,a,a,it,bt);const le=$(w+je,Jl("tableId?: TId","rowId: Id","cellId?: CId",M+De+H,Xl),il(me+w),`<TId extends ${n}, CId extends ${s}<TId>>`),te=$(m+je,Jl("tableId?: TId","rowId: Id",M+De+H,"cellComponents?: {readonly [CId in "+s+`<TId>]?: ComponentType<${le}<TId, CId>>;}`,`getCellComponentProps?: (cellId: ${s}<TId>) => ExtraProps`,`customCellIds?: ${s}<TId>[]`,ct,Xl),il(me+m),`<TId extends ${n}>`),ae=$(p+je,Jl("tableId?: TId",M+De+H,`rowComponent?: ComponentType<${te}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",ct,Xl),il(me+p),`<TId extends ${n}>`),oe=$("Sorted"+p+je,Jl("tableId?: TId","cellId?: "+s+"<TId>","descending?: boolean","offset?: number","limit?: number",M+De+H,`rowComponent?: ComponentType<${te}<TId>>`,"getRowComponentProps?: (rowId: Id) => ExtraProps","customCellIds?: CellId<TId>[]",ct,Xl),il(me+"sorted "+p),`<TId extends ${n}>`),Ie=$(C+je,Jl(M+De+H,"tableComponents?: {readonly [TId in "+n+`]?: ComponentType<${ae}<TId>>;}`,`getTableComponentProps?: (tableId: ${n}) => ExtraProps`,ct,Xl),il(sl(1,1)));c(1,j,Ie,ae,oe,te,le),K(C+Ct,"{"+M+", tableComponents, getTableComponentProps"+ut+"}: "+Ie,[de+`(${ee}(${M}).map((tableId) => {`,"const Table = (tableComponents?.[tableId] ?? "+X+"(tableId)) as React.ComponentType<TableProps<typeof tableId>>;","return <Table",`{...${ne}(getTableComponentProps, tableId)}`,"tableId={tableId}","key={tableId}",W,Yl,"/>;","}), separator)"],Il(1,13)+ge),E(((e,l,t)=>{const[n,o,s,I,u]=ce(Z,e);c(null,L,n,o,s,I,u),q(i+l+p,i+p,d,fl(e,0,1)+ge,a,t),q(l+p,p,n,fl(e)+ge,a,t),q(l+p+y,p+y,b,cl(w,"the whole of "+hl(e))+ge,a,t),q(l+m+ve,m+ve,r,"Gets the number of Rows in "+hl(e)+ge,a,t);const $=q(l+f,f,b,cl(m,hl(e))+ge,a,t),C=q(l+g,g,b,cl(m,hl(e),1)+ge,"cellId?: "+u+", descending?: boolean, offset?: number, limit?: number",t+", cellId, descending, offset, limit");q(i+l+m,i+m,d,gl(e,0,1)+ge,pt,Hl(t,st)),q(l+m,m,s,gl(e)+ge,pt,Hl(t,st)),q(l+y,y,u+Fe,cl(w,ml(e))+ge,pt,Hl(t,st)),q(We+l+p+we,We+p+we,rt,fl(e,9)+nt,Hl(ql(p)+tt+o,ql(p)+Ve),Hl(t,Kl(p)),dt,Hl($t,`table: ${o})`+Ye,et),bt),q(Te+l+p+we,Te+p+we,we,fl(e,12),a,t,a,it,bt),q(We+l+m+we,We+m+we,rt,gl(e,9)+nt,Hl(pt,ql(m)+tt+I,ql(m)+Ve),Hl(t,st,Kl(m)),dt,Hl($t,`row: ${I})`+Ye,et),bt),q("Add"+l+m+we,"Add"+m+we,rt,gl(e,10)+nt,Hl(ql(m)+tt+I,ql(m)+Ve),Hl(t,Kl(m)),dt,"then?: ("+Hl(pt+Ne,"store: Store","row: "+I+")"+Ye,"then"+Ve)+", reuseRowIds?: boolean",bt+", reuseRowIds"),q(We+l+R+m+we,We+R+m+we,rt,gl(e,11)+nt,Hl(pt,ql(R+m)+tt+I,ql(R+m)+Ve),Hl(t,st,Kl(R+m)),dt,Hl($t,`partialRow: ${I})`+Ye,et),bt),q(Te+l+m+we,Te+m+we,we,gl(e,12),pt,Hl(t,st),a,it,bt);const h=K(l+m+Ct,"{rowId, "+M+", cellComponents, getCellComponentProps, customCellIds"+ut+`}: ${te}<'${e}'>`,[de+`(${re}(customCellIds, `+t+`, rowId, ${M}).map((cellId: ${u}) => {`,"const Cell = (cellComponents?.[cellId] ?? "+Y+`(${t}, cellId)) as React.ComponentType<CellProps<typeof `+t+", typeof cellId>>;","return <Cell",`{...${ne}(getCellComponentProps, cellId)} `,"key={cellId}",`tableId={${t}}`,It,"cellId={cellId}",W,Yl,"/>;","})"+ut+", rowId)"],gl(e,13)+ge);K(l+"Sorted"+p+Ct,"{cellId, descending, offset, limit, ...props}: "+oe+`<'${e}'>`,Q+"(props, "+C+`(cellId, descending, offset, limit, props.${M}), ${t}, ${h});`,fl(e,13)+", sorted"+ge),K(l+p+Ct,`props: ${ae}<'${e}'>`,Q+"(props, "+$+`(props.${M}), ${t}, ${h});`,fl(e,13)+ge),D(e,((n,o,r,s,I)=>{const u="Map"+Ll(o,1);c(0,L,u),c(1,L,u),q(i+l+I+p+w,i+p+w,d,`Gets ${rl(1)}the '${n}' Cell anywhere in `+hl(e)+ge,a,Hl(t,s)),q(i+l+I+w,i+w,d,wl(e,n,0,1)+ge,pt,Hl(t,st,s));const $=q(l+I+w,w,o+(O(r)?Ne:a),wl(e,n)+ge,pt,Hl(t,st,s));q(We+l+I+w+we,We+w+we,rt,wl(e,n,9)+nt,Hl(pt,ql(w)+tt+o+" | "+u,ql(w)+Ve),Hl(t,st,s,Kl(w)),dt,Hl($t,`cell: ${o} | ${u})`+Ye,et),bt),q(Te+l+I+w+we,Te+w+we,we,wl(e,n,12),Hl(pt,"forceDel?: boolean"),Hl(t,st,s,"forceDel"),a,it,bt),K(l+I+w+Ct,`{rowId, ${M}, debugIds}: `+le+`<'${e}', '${n}'>`,[de+`('' + ${$}(rowId, `+M+`) ?? '', undefined, debugIds, ${s})`],wl(e,n,13)+ge)}))}));const ue=B(E((e=>{var l,t;return null!=(t=null==(l=ce(Z,e))?void 0:l[4])?t:a}))," | ");q(i+C+u,i+C+u,Xe,Il(1,8,0,1)+" changes",ht(I),mt()),q(C+u,C+u,Xe,Il(1,8)+" changes",ht(v),mt()),q(h+u,h+u,Xe,Cl(2,0,1),ht(T),mt()),q(i+p+u,i+p+u,Xe,Cl(3,0,0,1),ht(x,`tableId: ${n} | null`),mt("tableId")),q(p+u,p+u,Xe,Cl(3,0),ht(P,`tableId: ${n} | null`),mt("tableId")),q(p+y+u,p+y+u,Xe,Cl(14,3,1),ht(A,`tableId: ${n} | null`),mt("tableId")),q(i+p+w+u,i+p+w+u,Xe,Cl(16,3,0,1),ht(k,`tableId: ${n} | null`,`cellId: ${ue} | null`),mt("tableId","cellId")),q(m+ve+u,m+ve+u,Xe,Cl(15,3),ht(S,`tableId: ${n} | null`),mt("tableId")),q(f+u,f+u,Xe,Cl(4,3,1),ht(N,`tableId: ${n} | null`),mt("tableId")),q(g+u,g+u,Xe,Cl(13,3,1),ht(G,`tableId: ${n} | null`,"cellId: "+ue+Ne,"descending: boolean","offset: number","limit: number"+Ne),mt("tableId","cellId","descending","offset","limit")),q(i+m+u,i+m+u,Xe,Cl(5,3,0,1),ht(J,`tableId: ${n} | null`,st+": IdOrNull"),mt("tableId",st)),q(m+u,m+u,Xe,Cl(5,3),ht(z,`tableId: ${n} | null`,st+": IdOrNull"),mt("tableId",st)),q(y+u,y+u,Xe,Cl(6,5,1),ht(F,`tableId: ${n} | null`,st+": IdOrNull"),mt("tableId",st)),q(i+w+u,i+w+u,Xe,Cl(7,5,0,1),ht(U,`tableId: ${n} | null`,st+": IdOrNull",`cellId: ${ue} | null`),mt("tableId",st,"cellId")),q(w+u,w+u,Xe,Cl(7,5),ht(_,`tableId: ${n} | null`,st+": IdOrNull",`cellId: ${ue} | null`),mt("tableId",st,"cellId"))}if(!oe(l)){const[e,l,t,n,o,r,I,b]=s;c(null,L,...s),c(1,L,H);const p=V("getDefaultValueComponent","valueId: Id",B(N(((e,l,t,a,n)=>`valueId == ${a} ? `+n+"ValueView : ")))+se);q(i+T,i+T,d,Il(2,0,0,1)+ge),q(T,T,e,Il(2,0)+ge);const C=q(x,x,t+Fe,cl(v,Ue)+ge);q(We+T+we,We+T+we,rt,Il(2,9)+nt,Hl(ql(T)+tt+l,ql(T)+Ve),Kl(T),dt,Hl($t,`values: ${l})`+Ye,et),bt),q(We+R+T+we,We+R+T+we,rt,Il(2,11)+nt,Hl(ql(R+T)+tt+l,ql(R+T)+Ve),Kl(R+T),dt,Hl($t,`partialValues: ${l})`+Ye,et),bt),q(Te+T+we,Te+T+we,we,Il(2,12),a,a,a,it,bt);const h=$(v+je,Jl("valueId?: VId",M+De+H,Xl),il("a Value"),`<VId extends ${t}>`),m=$(T+je,Jl(M+De+H,"valueComponents?: {readonly [VId in "+t+`]?: ComponentType<${h}<VId>>;}`,`getValueComponentProps?: (valueId: ${t}) => ExtraProps`,ct,Xl),il(sl(2,1)));c(1,j,m,h),K(T+Ct,"{"+M+", valueComponents, getValueComponentProps"+ut+"}: "+m,[de+`(${C}(${M}).map((valueId) => {`,"const Value = valueComponents?.[valueId] ?? "+p+"(valueId);","return <Value",`{...${ne}(getValueComponentProps, valueId)}`,"key={valueId}",W,Yl,"/>;","}), separator)"],Il(2,13)+ge),N(((e,l,t,n,o)=>{const r="Map"+Ll(l,1);c(0,L,r),c(1,L,r),q(i+o+v,i+v,d,yl(e,0,1)+ge,a,n);const s=q(o+v,v,l,yl(e)+ge,a,n);q(We+o+v+we,We+v+we,rt,yl(e,9)+nt,Hl(ql(v)+tt+l+" | "+r,ql(v)+Ve),Hl(n,Kl(v)),dt,Hl($t,`value: ${l} | ${r})`+Ye,et),bt),q(Te+o+v+we,Te+v+we,we,yl(e,12),a,n,a,it,bt),K(o+v+Ct,`{${M}, debugIds}: ${h}<'${e}'>`,[de+`('' + ${s}(`+M+`) ?? '', undefined, debugIds, ${n})`],yl(e,13)+ge)})),q(i+T+u,i+T+u,Xe,Il(2,8,0,1)+" changes",ht(n),mt()),q(T+u,T+u,Xe,Il(2,8)+" changes",ht(o),mt()),q(x+u,x+u,Xe,Cl(10,0,1),ht(r),mt()),q(i+v+u,i+v+u,Xe,Cl(11,0,0,1),ht(I,`valueId: ${t} | null`),mt("valueId")),q(v+u,v+u,Xe,Cl(11,0),ht(b,`valueId: ${t} | null`),mt("valueId"))}return K(Ge,`{${M}, ${M}ById, children}: `+ee+" & {readonly children: React.ReactNode}",["{",at,"return (","<Context."+Ge,"value={useMemo(",`() => [${M} ?? contextValue[0], {...contextValue[1], ...${M}ById}],`,`[${M}, ${M}ById, contextValue],`,")}>","{children}",`</Context.${Ge}>`,");","}"],"Wraps part of an application in a context that provides default objects to be used by hooks and components within"),[I(...A(0),...k(),...X(0)),I(...A(1),...S(),...X(1))]},gt=(e,l,t)=>{if(oe(e)&&oe(l))return[a,a,a,a];const[n,o,d,r]=Ql(e,l,t);return[n,o,...ft(e,l,t,d,r)]},wt=JSON.parse;var yt=Object.defineProperty,vt=Object.defineProperties,Tt=Object.getOwnPropertyDescriptors,xt=Object.getOwnPropertySymbols,Vt=Object.prototype.hasOwnProperty,Rt=Object.prototype.propertyIsEnumerable,Pt=(e,l,t)=>l in e?yt(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,At=(e,l)=>{for(var t in l||(l={}))Vt.call(l,t)&&Pt(e,t,l[t]);if(xt)for(var t of xt(l))Rt.call(l,t)&&Pt(e,t,l[t]);return e},kt=(e,l)=>vt(e,Tt(l)),St=(e,l,t)=>new Promise(((a,n)=>{var o=e=>{try{r(t.next(e))}catch(e){n(e)}},d=e=>{try{r(t.throw(e))}catch(e){n(e)}},r=e=>e.done?a(e.value):Promise.resolve(e.value).then(o,d);r((t=t.apply(e,l)).next())}));const Ot="prettier/",Et=Ot+"plugins/",Dt={parser:"typescript",singleQuote:!0,trailingComma:"all",bracketSpacing:!1,jsdocSingleLineComment:!1},Nt=Wl((e=>{const l=()=>{const l=wt(e.getTablesSchemaJson());return!oe(l)||J(e.getTableIds(),(t=>{const a=e.getRowIds(t),n=ue();if(J(a,(l=>J(e.getCellIds(t,l),(a=>{const o=e.getCell(t,l,a),d=pe(n,a,(()=>[M(o),ue(),[0],0])),[r,s,[I]]=d,u=pe(s,o,(()=>0))+1;return u>I&&(d[2]=[u,o]),be(s,o,u),d[3]++,r==M(o)})))))return l[t]={},se(n,(([e,,[,n],o],d)=>{l[t][d]=At({[s]:e},o==G(a)?{[I]:n}:{})})),1}))?l:{}},t=()=>{const l=wt(e.getValuesSchemaJson());return oe(l)&&e.forEachValue(((e,t)=>{l[e]={[s]:M(t)}})),l},a=e=>gt(l(),t(),e),n=e=>St(void 0,null,(function*(){const l=["d.ts","ts","d.ts","tsx"],t=[];let n;try{n=(yield import(Ot+"standalone")).format,_(t,yield import(Et+"estree"),yield import(Et+"typescript"))}catch(e){n=e=>St(void 0,null,(function*(){return e}))}return yield H(F(a(e),((e,a)=>St(void 0,null,(function*(){return Dl(yield n(e,kt(At({},Dt),{plugins:t,filepath:"_."+l[a]})))})))))}));return te({getStoreStats:l=>{let t=0,a=0,n=0;const o={};return e.forEachTable(((e,d)=>{t++;let r=0,s=0;const I={};d(((e,t)=>{r++;let a=0;t((()=>a++)),s+=a,l&&(I[e]={rowCells:a})})),a+=r,n+=s,l&&(o[e]={tableRows:r,tableCells:s,rows:I})})),At({totalTables:t,totalRows:a,totalCells:n,totalValues:G(e.getValueIds()),jsonLength:G(e.getJson())},l?{detail:{tables:o}}:{})},getStoreTablesSchema:l,getStoreValuesSchema:t,getStoreApi:a,getPrettyStoreApi:n,getStore:()=>e})}));e.createTools=Nt},"object"==typeof exports&&"undefined"!=typeof module?l(exports):"function"==typeof define&&define.amd?define(["exports"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseTools={});
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,r="",o=t(r),l=t(t),n="Listener",u="Result",i="Has",d="Ids",a="Table",c=a+"s",I=a+d,p="Row",C=p+"Count",b=p+d,w="Sorted"+p+d,R="Cell",y=R+d,h="Value",k=h+"s",v=h+d,g="Status",S=globalThis,L=e=>null==e,m=(e,s,t)=>L(e)?null==t?void 0:t():s(e),f=e=>t(e)==o,P=e=>t(e)==l,T=e=>e.length,V=()=>{},x=(e,s)=>e.every(s),O=(e,s)=>T(e)===T(s)&&x(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)&&m(H(e),(e=>e==q.prototype||L(H(e))),(()=>!0)),D=q.keys,j=(e,s)=>m(e,(e=>e[s])),F=(e,s)=>s in e,E=(e,s)=>{const t=z(e);return T(t)===T(D(s))&&x(t,(([e,t])=>Q(t)?!!Q(s[e])&&E(s[e],t):s[e]===t))},{createContext:A,useContext:G,useEffect:U}=s;var W=(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))(W||{});const _=(N=()=>A([]),F(J=S,K="tinybase_uirc")||(J[K]=N()),J[K]);var J,K,N;const X=(e,s)=>{var t;const r=G(_);return L(e)?r[2*s]:f(e)?j(null!=(t=r[2*s+1])?t:{},e):e},Y=(e,s)=>{const t=X(e,s);return L(e)||f(e)?t:e},Z=(e,s,t)=>{const{16:r,17:o}=G(_);U((()=>(null==r||r(t,e,s),()=>null==o?void 0:o(t,e))),[r,e,s,t,o])},$=e=>{var s;return D(null!=(s=G(_)[2*e+1])?s:{})},ee=e=>Y(e,0),se=e=>Y(e,1),te=e=>Y(e,2),re=e=>Y(e,3),oe=e=>Y(e,4),le=e=>Y(e,5),ne=e=>Y(e,6),ue=e=>Y(e,7),ie=e=>e.toLowerCase();ie(n);const de="Transaction";ie(de);var ae=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{u(t.next(e))}catch(e){o(e)}},n=e=>{try{u(t.throw(e))}catch(e){o(e)}},u=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,n);u((t=t.apply(e,s)).next())}));const{useCallback:ce,useEffect:Ie,useMemo:pe,useLayoutEffect:Ce,useRef:be,useState:we,useSyncExternalStore:Re}=s,ye=[],he=[{},[],[ye,void 0,ye],void 0,!1,0],ke=[E,O,([e,s,t],[r,o,l])=>s===o&&O(e,r)&&O(t,l)],ve=(e,s)=>e===s,ge=(e,s,t=ye)=>{const[,r]=we(),[o,l]=we();return Ie((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},Se=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+n])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},Le=(e,s,t,o=ye)=>{const l=be(he[t]),n=ce((()=>{var r,n,u;const i=null!=(n=null==(r=null==s?void 0:s[(4==t?"has":"get")+e])?void 0:r.call(s,...o))?n:he[t];return(null!=(u=ke[t])?u:ve)(i,l.current)?l.current:l.current=i}),[s,t,e,...o]),u=ce((l=>Se(s,(4==t?i:r)+e,...o,l)),[s,t,e,...o]);return Re(u,n,n)},me=(e,s,t,r=ye,o=ye,...l)=>Ce((()=>Se(s,e,...o,t,...l)),[s,e,...o,...r,...l]),fe=(e,s,t,r=ye,o=V,l=ye,...n)=>{const u=ee(e);return ce((e=>m(u,(r=>m(t(e,r),(t=>o(r["set"+s](...Pe(n,r,e),t),t)))))),[u,s,...r,...l,...Te(n)])},Pe=(e,s,t)=>B(e,(e=>P(e)?e(t,s):e)),Te=e=>{return s=e=>!P(e),e.filter(s);var s},Ve=(e,s,t=V,r=ye,...o)=>{const l=ee(e);return ce((e=>t(null==l?void 0:l["del"+s](...Pe(o,l,e)))),[l,s,...r,...Te(o)])},xe=(e,s,t)=>{const r=le(e);return ce((()=>null==r?void 0:r[s](t)),[r,s,t])},Oe=e=>Le(I,ee(e),1),Be=(e,s)=>Le(b,ee(s),1,[e]),Me=(e,s,t,r=0,o,l)=>Le(w,ee(l),1,[e,s,t,r,o]),qe=(e,s,t)=>Le(y,ee(t),1,[e,s]),He=(e,s,t,r)=>Le(R,ee(r),3,[e,s,t]),ze=e=>Le(v,ee(e),1),Qe=(e,s)=>Le(h,ee(s),3,[e]),De=(e,s)=>Le("Metric",se(s),3,[e]),je=(e,s)=>Le("SliceIds",te(s),1,[e]),Fe=(e,s,t)=>Le("Slice"+b,te(t),1,[e,s]),Ee=(e,s,t)=>Le("RemoteRowId",re(t),3,[e,s]),Ae=(e,s,t)=>Le("Local"+b,re(t),1,[e,s]),Ge=(e,s,t)=>Le("Linked"+b,re(t),1,[e,s]),Ue=(e,s)=>Le(u+b,oe(s),1,[e]),We=(e,s,t,r=0,o,l)=>Le(u+w,oe(l),1,[e,s,t,r,o]),_e=(e,s,t)=>Le(u+y,oe(t),1,[e,s]),Je=(e,s,t,r)=>Le(u+R,oe(r),3,[e,s,t]),Ke=e=>Le("CheckpointIds",le(e),2),Ne=(e,s)=>Le("Checkpoint",le(s),3,[e]),Xe=e=>xe(e,"goBackward"),Ye=e=>xe(e,"goForward"),{PureComponent:Ze,Fragment:$e,createElement:es,useCallback:ss,useLayoutEffect:ts,useRef:rs,useState:os}=s,ls=(e,...s)=>L(e)?{}:e(...s),ns=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var us=Object.defineProperty,is=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,ps=(e,s,t)=>s in e?us(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,Cs=(e,s)=>{for(var t in s||(s={}))cs.call(s,t)&&ps(e,t,s[t]);if(as)for(var t of as(s))Is.call(s,t)&&ps(e,t,s[t]);return e},bs=(e,s)=>is(e,ds(s)),ws=(e,s)=>{var t={};for(var r in e)cs.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&as)for(var r of as(e))s.indexOf(r)<0&&Is.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:Rs,useContext:ys,useMemo:hs,useState:ks}=s,vs=(e,s,t,r,o)=>[null!=t?t:s[2*e],Cs(Cs(Cs({},s[2*e+1]),r),o[e])],gs=({tableId:e,store:s,rowComponent:t=Ts,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:n},u)=>fs(B(u,(l=>es(t,bs(Cs({},ls(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:n})))),l,n,e),Ss=({queryId:e,queries:s,resultRowComponent:t=Ms,getResultRowComponentProps:r,separator:o,debugIds:l},n)=>fs(B(n,(o=>es(t,bs(Cs({},ls(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),Ls=({relationshipId:e,relationships:s,rowComponent:t=Ts,getRowComponentProps:r,separator:o,debugIds:l},n,u)=>{const[i,d,a]=ns(re(s),e),c=n(e,u,i);return fs(B(c,(e=>es(t,bs(Cs({},ls(r,e)),{key:e,tableId:a,rowId:e,store:d,debugIds:l})))),o,l,u)},ms=e=>({checkpoints:s,checkpointComponent:t=qs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const n=le(s);return fs(B(e(Ke(n)),(e=>es(t,bs(Cs({},ls(r,e)),{key:e,checkpoints:n,checkpointId:e,debugIds:l})))),o)},fs=(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},Ps=({tableId:e,rowId:s,cellId:t,store:o,debugIds:l})=>{var n;return fs(r+(null!=(n=He(e,s,t,o))?n:r),void 0,l,t)},Ts=({tableId:e,rowId:s,store:t,cellComponent:r=Ps,getCellComponentProps:o,customCellIds:l,separator:n,debugIds:u})=>fs(B(((e,s,t,r)=>{const o=qe(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>es(r,bs(Cs({},ls(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:u})))),n,u,s),Vs=e=>gs(e,Be(e.tableId,e.store)),xs=({valueId:e,store:s,debugIds:t})=>{var o;return fs(r+(null!=(o=Qe(e,s))?o:r),void 0,t,e)},Os=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Ts,getRowComponentProps:o,separator:l,debugIds:n})=>{const[u,i,d]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(te(t),e),a=Fe(e,s,u);return fs(B(a,(e=>es(r,bs(Cs({},ls(o,e)),{key:e,tableId:d,rowId:e,store:i,debugIds:n})))),l,n,s)},Bs=({queryId:e,rowId:s,cellId:t,queries:o,debugIds:l})=>{var n;return fs(r+(null!=(n=Je(e,s,t,o))?n:r),void 0,l,t)},Ms=({queryId:e,rowId:s,queries:t,resultCellComponent:r=Bs,getResultCellComponentProps:o,separator:l,debugIds:n})=>fs(B(_e(e,s,t),(l=>es(r,bs(Cs({},ls(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:n})))),l,n,s),qs=({checkpoints:e,checkpointId:s,debugIds:t})=>{var o;return fs(null!=(o=Ne(s,e))?o:r,void 0,t,s)},Hs=ms((e=>e[0])),zs=ms((e=>L(e[1])?[]:[e[1]])),Qs=ms((e=>e[2]));e.BackwardCheckpointsView=Hs,e.CellView=Ps,e.CheckpointView=qs,e.CurrentCheckpointView=zs,e.ForwardCheckpointsView=Qs,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=Os,getSliceComponentProps:r,separator:o,debugIds:l})=>fs(B(je(e,s),(o=>es(t,bs(Cs({},ls(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),e.LinkedRowsView=e=>Ls(e,Ge,e.firstRowId),e.LocalRowsView=e=>Ls(e,Ae,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var o;return fs(null!=(o=De(e,s))?o:r,void 0,t,e)},e.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:n,relationshipsById:u,queries:i,queriesById:d,checkpoints:a,checkpointsById:c,persister:I,persistersById:p,synchronizer:C,synchronizersById:b,children:w})=>{const R=ys(_),[y,h]=ks((()=>B([,,,,,,,,].fill(0),((e,s)=>({}))))),k=Rs(((e,s,t)=>h((r=>j(r[e],s)==t?r:M(r,e,bs(Cs({},r[e]),{[s]:t}))))),[]),v=Rs(((e,s)=>h((t=>F(t[e],s)?M(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return es(_.Provider,{value:hs((()=>[...vs(W.Store,R,e,s,y),...vs(W.Metrics,R,t,r,y),...vs(W.Indexes,R,o,l,y),...vs(W.Relationships,R,n,u,y),...vs(W.Queries,R,i,d,y),...vs(W.Checkpoints,R,a,c,y),...vs(W.Persister,R,I,p,y),...vs(W.Synchronizer,R,C,b,y),k,v]),[y,e,s,t,r,o,l,n,u,i,d,a,c,I,p,C,b,R,k,v])},w)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Ts,getRowComponentProps:o,debugIds:l})=>{const[n,u,,i]=ns(re(t),e),d=Ee(e,s,n);return fs(L(i)||L(d)?null:es(r,bs(Cs({},ls(o,d)),{key:d,tableId:i,rowId:d,store:u,debugIds:l})),void 0,l,s)},e.ResultCellView=Bs,e.ResultRowView=Ms,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,n=ws(s,["cellId","descending","offset","limit"]);return Ss(n,We(n.queryId,t,r,o,l,n.queries))},e.ResultTableView=e=>Ss(e,Ue(e.queryId,e.queries)),e.RowView=Ts,e.SliceView=Os,e.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,n=ws(s,["cellId","descending","offset","limit"]);return gs(n,Me(n.tableId,t,r,o,l,n.store))},e.TableView=Vs,e.TablesView=({store:e,tableComponent:s=Vs,getTableComponentProps:t,separator:r,debugIds:o})=>fs(B(Oe(e),(r=>es(s,bs(Cs({},ls(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),e.ValueView=xs,e.ValuesView=({store:e,valueComponent:s=xs,getValueComponentProps:t,separator:r,debugIds:o})=>fs(B(ze(e),(r=>es(s,bs(Cs({},ls(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),e.useAddRowCallback=(e,s,t=ye,r,o=V,l=ye,n=!0)=>{const u=ee(r);return ce((t=>m(u,(r=>m(s(t,r),(s=>o(r.addRow(P(e)?e(t,r):e,s,n),r,s)))))),[u,e,...t,...l,n])},e.useCell=He,e.useCellIds=qe,e.useCellIdsListener=(e,s,t,r,o,l)=>me(y,ee(l),t,r,[e,s],o),e.useCellListener=(e,s,t,r,o,l,n)=>me(R,ee(n),r,o,[e,s,t],l),e.useCheckpoint=Ne,e.useCheckpointIds=Ke,e.useCheckpointIdsListener=(e,s,t)=>me("CheckpointIds",le(t),e,s),e.useCheckpointListener=(e,s,t,r)=>me("Checkpoint",le(r),s,t,[e]),e.useCheckpoints=e=>X(e,5),e.useCheckpointsIds=()=>$(5),e.useCheckpointsOrCheckpointsById=le,e.useCreateCheckpoints=(e,s,t)=>ge(e,s,t),e.useCreateIndexes=(e,s,t)=>ge(e,s,t),e.useCreateMergeableStore=(e,s=ye)=>pe(e,s),e.useCreateMetrics=(e,s,t)=>ge(e,s,t),e.useCreatePersister=(e,s,t=ye,r,o=ye,l,n=ye)=>{const[,u]=we(),[i,d]=we();return Ie((()=>{ae(void 0,null,(function*(){const t=e?yield s(e):void 0;d(t),t&&r&&ae(void 0,null,(function*(){yield r(t),u([])}))}))}),[e,...t,...o]),Ie((()=>()=>{i&&(i.destroy(),null==l||l(i))}),[i,...n]),i},e.useCreateQueries=(e,s,t)=>ge(e,s,t),e.useCreateRelationships=(e,s,t)=>ge(e,s,t),e.useCreateStore=(e,s=ye)=>pe(e,s),e.useCreateSynchronizer=(e,s,t=ye,r,o=ye)=>{const[l,n]=we();return Ie((()=>{ae(void 0,null,(function*(){const t=e?yield s(e):void 0;n(t)}))}),[e,...t]),Ie((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},e.useDelCellCallback=(e,s,t,r,o,l,n)=>Ve(o,R,l,n,e,s,t,r),e.useDelRowCallback=(e,s,t,r,o)=>Ve(t,p,r,o,e,s),e.useDelTableCallback=(e,s,t,r)=>Ve(s,a,t,r,e),e.useDelTablesCallback=(e,s,t)=>Ve(e,c,s,t),e.useDelValueCallback=(e,s,t,r)=>Ve(s,h,t,r,e),e.useDelValuesCallback=(e,s,t)=>Ve(e,k,s,t),e.useDidFinishTransactionListener=(e,s,t)=>me("DidFinish"+de,ee(t),e,s),e.useGoBackwardCallback=Xe,e.useGoForwardCallback=Ye,e.useGoToCallback=(e,s=ye,t,r=V,o=ye)=>{const l=le(t);return ce((s=>m(l,(t=>m(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},e.useHasCell=(e,s,t,r)=>Le(R,ee(r),4,[e,s,t]),e.useHasCellListener=(e,s,t,r,o,l,n)=>me(i+R,ee(n),r,o,[e,s,t],l),e.useHasRow=(e,s,t)=>Le(p,ee(t),4,[e,s]),e.useHasRowListener=(e,s,t,r,o,l)=>me(i+p,ee(l),t,r,[e,s],o),e.useHasTable=(e,s)=>Le(a,ee(s),4,[e]),e.useHasTableCell=(e,s,t)=>Le(a+R,ee(t),4,[e,s]),e.useHasTableCellListener=(e,s,t,r,o,l)=>me(i+a+R,ee(l),t,r,[e,s],o),e.useHasTableListener=(e,s,t,r,o)=>me(i+a,ee(o),s,t,[e],r),e.useHasTables=e=>Le(c,ee(e),4,[]),e.useHasTablesListener=(e,s,t,r)=>me(i+c,ee(r),e,s,[],t),e.useHasValue=(e,s)=>Le(h,ee(s),4,[e]),e.useHasValueListener=(e,s,t,r,o)=>me(i+h,ee(o),s,t,[e],r),e.useHasValues=e=>Le(k,ee(e),4,[]),e.useHasValuesListener=(e,s,t,r)=>me(i+k,ee(r),e,s,[],t),e.useIndexIds=e=>Le("IndexIds",te(e),1),e.useIndexes=e=>X(e,2),e.useIndexesIds=()=>$(2),e.useIndexesOrIndexesById=te,e.useLinkedRowIds=Ge,e.useLinkedRowIdsListener=(e,s,t,r,o)=>me("Linked"+b,re(o),t,r,[e,s]),e.useLocalRowIds=Ae,e.useLocalRowIdsListener=(e,s,t,r,o)=>me("Local"+b,re(o),t,r,[e,s]),e.useMetric=De,e.useMetricIds=e=>Le("MetricIds",se(e),1),e.useMetricListener=(e,s,t,r)=>me("Metric",se(r),s,t,[e]),e.useMetrics=e=>X(e,1),e.useMetricsIds=()=>$(1),e.useMetricsOrMetricsById=se,e.usePersister=e=>X(e,6),e.usePersisterIds=()=>$(6),e.usePersisterOrPersisterById=ne,e.usePersisterStatus=e=>Le(g,ne(e),5,[]),e.usePersisterStatusListener=(e,s,t)=>me(g,ne(t),e,s,[]),e.useProvideCheckpoints=(e,s)=>Z(e,s,5),e.useProvideIndexes=(e,s)=>Z(e,s,2),e.useProvideMetrics=(e,s)=>Z(e,s,1),e.useProvidePersister=(e,s)=>Z(e,s,6),e.useProvideQueries=(e,s)=>Z(e,s,4),e.useProvideRelationships=(e,s)=>Z(e,s,3),e.useProvideStore=(e,s)=>Z(e,s,0),e.useProvideSynchronizer=(e,s)=>Z(e,s,7),e.useQueries=e=>X(e,4),e.useQueriesIds=()=>$(4),e.useQueriesOrQueriesById=oe,e.useQueryIds=e=>Le("QueryIds",oe(e),1),e.useRedoInformation=e=>{var s;const t=le(e),[,,[o]]=Ke(t);return[!L(o),Ye(t),o,null!=(s=m(o,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r]},e.useRelationshipIds=e=>Le("RelationshipIds",re(e),1),e.useRelationships=e=>X(e,3),e.useRelationshipsIds=()=>$(3),e.useRelationshipsOrRelationshipsById=re,e.useRemoteRowId=Ee,e.useRemoteRowIdListener=(e,s,t,r,o)=>me("RemoteRowId",re(o),t,r,[e,s]),e.useResultCell=Je,e.useResultCellIds=_e,e.useResultCellIdsListener=(e,s,t,r,o)=>me(u+y,oe(o),t,r,[e,s]),e.useResultCellListener=(e,s,t,r,o,l)=>me(u+R,oe(l),r,o,[e,s,t]),e.useResultRow=(e,s,t)=>Le(u+p,oe(t),0,[e,s]),e.useResultRowCount=(e,s)=>Le(u+C,oe(s),5,[e]),e.useResultRowCountListener=(e,s,t,r)=>me(u+C,oe(r),s,t,[e]),e.useResultRowIds=Ue,e.useResultRowIdsListener=(e,s,t,r)=>me(u+b,oe(r),s,t,[e]),e.useResultRowListener=(e,s,t,r,o)=>me(u+p,oe(o),t,r,[e,s]),e.useResultSortedRowIds=We,e.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,i)=>me(u+w,oe(i),l,n,[e,s,t,r,o]),e.useResultTable=(e,s)=>Le(u+a,oe(s),0,[e]),e.useResultTableCellIds=(e,s)=>Le(u+a+y,oe(s),1,[e]),e.useResultTableCellIdsListener=(e,s,t,r)=>me(u+a+y,oe(r),s,t,[e]),e.useResultTableListener=(e,s,t,r)=>me(u+a,oe(r),s,t,[e]),e.useRow=(e,s,t)=>Le(p,ee(t),0,[e,s]),e.useRowCount=(e,s)=>Le(C,ee(s),5,[e]),e.useRowCountListener=(e,s,t,r,o)=>me(C,ee(o),s,t,[e],r),e.useRowIds=Be,e.useRowIdsListener=(e,s,t,r,o)=>me(b,ee(o),s,t,[e],r),e.useRowListener=(e,s,t,r,o,l)=>me(p,ee(l),t,r,[e,s],o),e.useSetCellCallback=(e,s,t,r,o,l,n,u)=>fe(l,R,r,o,n,u,e,s,t),e.useSetCheckpointCallback=(e=V,s=ye,t,r=V,o=ye)=>{const l=le(t);return ce((s=>m(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},e.useSetPartialRowCallback=(e,s,t,r,o,l,n)=>fe(o,"PartialRow",t,r,l,n,e,s),e.useSetPartialValuesCallback=(e,s,t,r,o)=>fe(t,"PartialValues",e,s,r,o),e.useSetRowCallback=(e,s,t,r,o,l,n)=>fe(o,p,t,r,l,n,e,s),e.useSetTableCallback=(e,s,t,r,o,l)=>fe(r,a,s,t,o,l,e),e.useSetTablesCallback=(e,s,t,r,o)=>fe(t,c,e,s,r,o),e.useSetValueCallback=(e,s,t,r,o,l)=>fe(r,h,s,t,o,l,e),e.useSetValuesCallback=(e,s,t,r,o)=>fe(t,k,e,s,r,o),e.useSliceIds=je,e.useSliceIdsListener=(e,s,t,r)=>me("SliceIds",te(r),s,t,[e]),e.useSliceRowIds=Fe,e.useSliceRowIdsListener=(e,s,t,r,o)=>me("Slice"+b,te(o),t,r,[e,s]),e.useSortedRowIds=Me,e.useSortedRowIdsListener=(e,s,t,r,o,l,n,u,i)=>me(w,ee(i),l,n,[e,s,t,r,o],u),e.useStartTransactionListener=(e,s,t)=>me("Start"+de,ee(t),e,s),e.useStore=e=>X(e,0),e.useStoreIds=()=>$(0),e.useStoreOrStoreById=ee,e.useSynchronizer=e=>X(e,7),e.useSynchronizerIds=()=>$(7),e.useSynchronizerOrSynchronizerById=ue,e.useSynchronizerStatus=e=>Le(g,ue(e),5,[]),e.useSynchronizerStatusListener=(e,s,t)=>me(g,ue(t),e,s,[]),e.useTable=(e,s)=>Le(a,ee(s),0,[e]),e.useTableCellIds=(e,s)=>Le(a+y,ee(s),1,[e]),e.useTableCellIdsListener=(e,s,t,r,o)=>me(a+y,ee(o),s,t,[e],r),e.useTableIds=Oe,e.useTableIdsListener=(e,s,t,r)=>me(I,ee(r),e,s,ye,t),e.useTableListener=(e,s,t,r,o)=>me(a,ee(o),s,t,[e],r),e.useTables=e=>Le(c,ee(e),0),e.useTablesListener=(e,s,t,r)=>me(c,ee(r),e,s,ye,t),e.useUndoInformation=e=>{var s;const t=le(e),[o,l]=Ke(t);return[(n=o,!(0==T(n))),Xe(t),l,null!=(s=m(l,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r];var n},e.useValue=Qe,e.useValueIds=ze,e.useValueIdsListener=(e,s,t,r)=>me(v,ee(r),e,s,ye,t),e.useValueListener=(e,s,t,r,o)=>me(h,ee(o),s,t,[e],r),e.useValues=e=>Le(k,ee(e),0),e.useValuesListener=(e,s,t,r)=>me(k,ee(r),e,s,ye,t),e.useWillFinishTransactionListener=(e,s,t)=>me("WillFinish"+de,ee(t),e,s)},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
|
|
1
|
+
var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,r="",o=t(r),l=t(t),u="Result",n="Has",i="Ids",d="Table",a=d+"s",c=d+i,I="Row",p=I+"Count",b=I+i,C="Sorted"+I+i,w="Cell",R=w+i,y="Value",v=y+"s",h=y+i,k="Transaction",g="Partial",m="Finish",L="Status",S="Metric",f="Slice",T="RemoteRowId",P="Local",V="Linked",x="Checkpoint",O=globalThis,B=e=>null==e,q=(e,s,t)=>B(e)?null==t?void 0:t():s(e),H=e=>t(e)==o,M=e=>t(e)==l,z=e=>e.length,D=()=>{},j=(e,s)=>e.every(s),Q=(e,s)=>z(e)===z(s)&&j(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:U,createElement:W,useCallback:_,useContext:J,useEffect:K,useLayoutEffect:N,useMemo:X,useRef:Y,useState:Z,useSyncExternalStore:$}=s,ee=(e,...s)=>B(e)?{}:e(...s),se=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)],te=Object,re=e=>te.getPrototypeOf(e),oe=te.entries,le=e=>!B(e)&&q(re(e),(e=>e==te.prototype||B(re(e))),(()=>!0)),ue=te.keys,ne=(e,s)=>q(e,(e=>e[s])),ie=(e,s)=>s in e,de=(e,s)=>{const t=oe(e);return z(t)===z(ue(s))&&j(t,(([e,t])=>le(t)?!!le(s[e])&&de(s[e],t):s[e]===t))},ae=(pe=()=>U([]),ie(ce=O,Ie="tinybase_uirc")||(ce[Ie]=pe()),ce[Ie]);var ce,Ie,pe;const be=(e,s)=>{var t;const r=J(ae);return B(e)?r[2*s]:H(e)?ne(null!=(t=r[2*s+1])?t:{},e):e},Ce=(e,s)=>{const t=be(e,s);return B(e)||H(e)?t:e},we=(e,s,t)=>{const{16:r,17:o}=J(ae);K((()=>(null==r||r(t,e,s),()=>null==o?void 0:o(t,e))),[r,e,s,t,o])},Re=e=>{var s;return ue(null!=(s=J(ae)[2*e+1])?s:{})},ye=e=>Ce(e,0),ve=e=>Ce(e,1),he=e=>Ce(e,2),ke=e=>Ce(e,3),ge=e=>Ce(e,4),me=e=>Ce(e,5),Le=e=>Ce(e,6),Se=e=>Ce(e,7);var fe=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const Te=[],Pe=[{},[],[Te,void 0,Te],void 0,!1,0],Ve=[de,Q,([e,s,t],[r,o,l])=>s===o&&Q(e,r)&&Q(t,l)],xe=(e,s)=>e===s,Oe=(e,s,t=Te)=>{const[,r]=Z(),[o,l]=Z();return K((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},Be=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+"Listener"])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},qe=(e,s,t,o=Te)=>{const l=Y(Pe[t]),u=_((()=>{var r,u,n;const i=null!=(u=null==(r=null==s?void 0:s[(4==t?"has":"get")+e])?void 0:r.call(s,...o))?u:Pe[t];return(null!=(n=Ve[t])?n:xe)(i,l.current)?l.current:l.current=i}),[s,t,e,...o]),i=_((l=>Be(s,(4==t?n:r)+e,...o,l)),[s,t,e,...o]);return $(i,u,u)},He=(e,s,t,r=Te,o=Te,...l)=>N((()=>Be(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Me=(e,s,t,r=Te,o=D,l=Te,...u)=>{const n=ye(e);return _((e=>q(n,(r=>q(t(e,r),(t=>o(r["set"+s](...ze(u,r,e),t),t)))))),[n,s,...r,...l,...De(u)])},ze=(e,s,t)=>F(e,(e=>M(e)?e(t,s):e)),De=e=>{return s=e=>!M(e),e.filter(s);var s},je=(e,s,t=D,r=Te,...o)=>{const l=ye(e);return _((e=>t(null==l?void 0:l["del"+s](...ze(o,l,e)))),[l,s,...r,...De(o)])},Qe=(e,s,t)=>{const r=me(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},Fe=e=>qe(c,ye(e),1),Ee=(e,s)=>qe(b,ye(s),1,[e]),Ae=(e,s,t,r=0,o,l)=>qe(C,ye(l),1,[e,s,t,r,o]),Ge=(e,s,t)=>qe(R,ye(t),1,[e,s]),Ue=(e,s,t,r)=>qe(w,ye(r),3,[e,s,t]),We=e=>qe(h,ye(e),1),_e=(e,s)=>qe(y,ye(s),3,[e]),Je=(e,s)=>qe(S,ve(s),3,[e]),Ke=(e,s)=>qe(f+i,he(s),1,[e]),Ne=(e,s,t)=>qe(f+b,he(t),1,[e,s]),Xe=(e,s,t)=>qe(T,ke(t),3,[e,s]),Ye=(e,s,t)=>qe(P+b,ke(t),1,[e,s]),Ze=(e,s,t)=>qe(V+b,ke(t),1,[e,s]),$e=(e,s)=>qe(u+b,ge(s),1,[e]),es=(e,s,t,r=0,o,l)=>qe(u+C,ge(l),1,[e,s,t,r,o]),ss=(e,s,t)=>qe(u+R,ge(t),1,[e,s]),ts=(e,s,t,r)=>qe(u+w,ge(r),3,[e,s,t]),rs=e=>qe(x+i,me(e),2),os=(e,s)=>qe(x,me(s),3,[e]),ls=e=>Qe(e,"goBackward"),us=e=>Qe(e,"goForward");var ns=Object.defineProperty,is=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,ps=(e,s,t)=>s in e?ns(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,bs=(e,s)=>{for(var t in s||(s={}))cs.call(s,t)&&ps(e,t,s[t]);if(as)for(var t of as(s))Is.call(s,t)&&ps(e,t,s[t]);return e},Cs=(e,s)=>is(e,ds(s)),ws=(e,s)=>{var t={};for(var r in e)cs.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&as)for(var r of as(e))s.indexOf(r)<0&&Is.call(e,r)&&(t[r]=e[r]);return t};const Rs=(e,s,t,r,o)=>[null!=t?t:s[2*e],bs(bs(bs({},s[2*e+1]),r),o[e])],ys=({tableId:e,store:s,rowComponent:t=Ls,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>gs(F(n,(l=>W(t,Cs(bs({},ee(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),vs=({queryId:e,queries:s,resultRowComponent:t=Vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>gs(F(u,(o=>W(t,Cs(bs({},ee(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),hs=({relationshipId:e,relationships:s,rowComponent:t=Ls,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[i,d,a]=se(ke(s),e),c=u(e,n,i);return gs(F(c,(e=>W(t,Cs(bs({},ee(r,e)),{key:e,tableId:a,rowId:e,store:d,debugIds:l})))),o,l,n)},ks=e=>({checkpoints:s,checkpointComponent:t=xs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=me(s);return gs(F(e(rs(u)),(e=>W(t,Cs(bs({},ee(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},gs=(e,s,t,r)=>{const o=B(s)||!Array.isArray(e)?e:F(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},ms=({tableId:e,rowId:s,cellId:t,store:o,debugIds:l})=>{var u;return gs(r+(null!=(u=Ue(e,s,t,o))?u:r),void 0,l,t)},Ls=({tableId:e,rowId:s,store:t,cellComponent:r=ms,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>gs(F(((e,s,t,r)=>{const o=Ge(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>W(r,Cs(bs({},ee(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),Ss=e=>ys(e,Ee(e.tableId,e.store)),fs=({valueId:e,store:s,debugIds:t})=>{var o;return gs(r+(null!=(o=_e(e,s))?o:r),void 0,t,e)},Ts=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Ls,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,i,d]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(he(t),e),a=Ne(e,s,n);return gs(F(a,(e=>W(r,Cs(bs({},ee(o,e)),{key:e,tableId:d,rowId:e,store:i,debugIds:u})))),l,u,s)},Ps=({queryId:e,rowId:s,cellId:t,queries:o,debugIds:l})=>{var u;return gs(r+(null!=(u=ts(e,s,t,o))?u:r),void 0,l,t)},Vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=Ps,getResultCellComponentProps:o,separator:l,debugIds:u})=>gs(F(ss(e,s,t),(l=>W(r,Cs(bs({},ee(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),xs=({checkpoints:e,checkpointId:s,debugIds:t})=>{var o;return gs(null!=(o=os(s,e))?o:r,void 0,t,s)},Os=ks((e=>e[0])),Bs=ks((e=>B(e[1])?[]:[e[1]])),qs=ks((e=>e[2]));e.BackwardCheckpointsView=Os,e.CellView=ms,e.CheckpointView=xs,e.CurrentCheckpointView=Bs,e.ForwardCheckpointsView=qs,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=Ts,getSliceComponentProps:r,separator:o,debugIds:l})=>gs(F(Ke(e,s),(o=>W(t,Cs(bs({},ee(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),e.LinkedRowsView=e=>hs(e,Ze,e.firstRowId),e.LocalRowsView=e=>hs(e,Ye,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var o;return gs(null!=(o=Je(e,s))?o:r,void 0,t,e)},e.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:i,queriesById:d,checkpoints:a,checkpointsById:c,persister:I,persistersById:p,synchronizer:b,synchronizersById:C,children:w})=>{const R=J(ae),[y,v]=Z((()=>F([,,,,,,,,].fill(0),((e,s)=>({}))))),h=_(((e,s,t)=>v((r=>ne(r[e],s)==t?r:E(r,e,Cs(bs({},r[e]),{[s]:t}))))),[]),k=_(((e,s)=>v((t=>ie(t[e],s)?E(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return W(ae.Provider,{value:X((()=>[...Rs(0,R,e,s,y),...Rs(1,R,t,r,y),...Rs(2,R,o,l,y),...Rs(3,R,u,n,y),...Rs(4,R,i,d,y),...Rs(5,R,a,c,y),...Rs(6,R,I,p,y),...Rs(7,R,b,C,y),h,k]),[y,e,s,t,r,o,l,u,n,i,d,a,c,I,p,b,C,R,h,k])},w)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Ls,getRowComponentProps:o,debugIds:l})=>{const[u,n,,i]=se(ke(t),e),d=Xe(e,s,u);return gs(B(i)||B(d)?null:W(r,Cs(bs({},ee(o,d)),{key:d,tableId:i,rowId:d,store:n,debugIds:l})),void 0,l,s)},e.ResultCellView=Ps,e.ResultRowView=Vs,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ws(s,["cellId","descending","offset","limit"]);return vs(u,es(u.queryId,t,r,o,l,u.queries))},e.ResultTableView=e=>vs(e,$e(e.queryId,e.queries)),e.RowView=Ls,e.SliceView=Ts,e.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ws(s,["cellId","descending","offset","limit"]);return ys(u,Ae(u.tableId,t,r,o,l,u.store))},e.TableView=Ss,e.TablesView=({store:e,tableComponent:s=Ss,getTableComponentProps:t,separator:r,debugIds:o})=>gs(F(Fe(e),(r=>W(s,Cs(bs({},ee(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),e.ValueView=fs,e.ValuesView=({store:e,valueComponent:s=fs,getValueComponentProps:t,separator:r,debugIds:o})=>gs(F(We(e),(r=>W(s,Cs(bs({},ee(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),e.useAddRowCallback=(e,s,t=Te,r,o=D,l=Te,u=!0)=>{const n=ye(r);return _((t=>q(n,(r=>q(s(t,r),(s=>o(r.addRow(M(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},e.useCell=Ue,e.useCellIds=Ge,e.useCellIdsListener=(e,s,t,r,o,l)=>He(R,ye(l),t,r,[e,s],o),e.useCellListener=(e,s,t,r,o,l,u)=>He(w,ye(u),r,o,[e,s,t],l),e.useCheckpoint=os,e.useCheckpointIds=rs,e.useCheckpointIdsListener=(e,s,t)=>He(x+i,me(t),e,s),e.useCheckpointListener=(e,s,t,r)=>He(x,me(r),s,t,[e]),e.useCheckpoints=e=>be(e,5),e.useCheckpointsIds=()=>Re(5),e.useCheckpointsOrCheckpointsById=me,e.useCreateCheckpoints=(e,s,t)=>Oe(e,s,t),e.useCreateIndexes=(e,s,t)=>Oe(e,s,t),e.useCreateMergeableStore=(e,s=Te)=>X(e,s),e.useCreateMetrics=(e,s,t)=>Oe(e,s,t),e.useCreatePersister=(e,s,t=Te,r,o=Te,l,u=Te)=>{const[,n]=Z(),[i,d]=Z();return K((()=>{fe(void 0,null,(function*(){const t=e?yield s(e):void 0;d(t),t&&r&&fe(void 0,null,(function*(){yield r(t),n([])}))}))}),[e,...t,...o]),K((()=>()=>{i&&(i.destroy(),null==l||l(i))}),[i,...u]),i},e.useCreateQueries=(e,s,t)=>Oe(e,s,t),e.useCreateRelationships=(e,s,t)=>Oe(e,s,t),e.useCreateStore=(e,s=Te)=>X(e,s),e.useCreateSynchronizer=(e,s,t=Te,r,o=Te)=>{const[l,u]=Z();return K((()=>{fe(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),K((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},e.useDelCellCallback=(e,s,t,r,o,l,u)=>je(o,w,l,u,e,s,t,r),e.useDelRowCallback=(e,s,t,r,o)=>je(t,I,r,o,e,s),e.useDelTableCallback=(e,s,t,r)=>je(s,d,t,r,e),e.useDelTablesCallback=(e,s,t)=>je(e,a,s,t),e.useDelValueCallback=(e,s,t,r)=>je(s,y,t,r,e),e.useDelValuesCallback=(e,s,t)=>je(e,v,s,t),e.useDidFinishTransactionListener=(e,s,t)=>He("Did"+m+k,ye(t),e,s),e.useGoBackwardCallback=ls,e.useGoForwardCallback=us,e.useGoToCallback=(e,s=Te,t,r=D,o=Te)=>{const l=me(t);return _((s=>q(l,(t=>q(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},e.useHasCell=(e,s,t,r)=>qe(w,ye(r),4,[e,s,t]),e.useHasCellListener=(e,s,t,r,o,l,u)=>He(n+w,ye(u),r,o,[e,s,t],l),e.useHasRow=(e,s,t)=>qe(I,ye(t),4,[e,s]),e.useHasRowListener=(e,s,t,r,o,l)=>He(n+I,ye(l),t,r,[e,s],o),e.useHasTable=(e,s)=>qe(d,ye(s),4,[e]),e.useHasTableCell=(e,s,t)=>qe(d+w,ye(t),4,[e,s]),e.useHasTableCellListener=(e,s,t,r,o,l)=>He(n+d+w,ye(l),t,r,[e,s],o),e.useHasTableListener=(e,s,t,r,o)=>He(n+d,ye(o),s,t,[e],r),e.useHasTables=e=>qe(a,ye(e),4,[]),e.useHasTablesListener=(e,s,t,r)=>He(n+a,ye(r),e,s,[],t),e.useHasValue=(e,s)=>qe(y,ye(s),4,[e]),e.useHasValueListener=(e,s,t,r,o)=>He(n+y,ye(o),s,t,[e],r),e.useHasValues=e=>qe(v,ye(e),4,[]),e.useHasValuesListener=(e,s,t,r)=>He(n+v,ye(r),e,s,[],t),e.useIndexIds=e=>qe("Index"+i,he(e),1),e.useIndexes=e=>be(e,2),e.useIndexesIds=()=>Re(2),e.useIndexesOrIndexesById=he,e.useLinkedRowIds=Ze,e.useLinkedRowIdsListener=(e,s,t,r,o)=>He(V+b,ke(o),t,r,[e,s]),e.useLocalRowIds=Ye,e.useLocalRowIdsListener=(e,s,t,r,o)=>He(P+b,ke(o),t,r,[e,s]),e.useMetric=Je,e.useMetricIds=e=>qe(S+i,ve(e),1),e.useMetricListener=(e,s,t,r)=>He(S,ve(r),s,t,[e]),e.useMetrics=e=>be(e,1),e.useMetricsIds=()=>Re(1),e.useMetricsOrMetricsById=ve,e.usePersister=e=>be(e,6),e.usePersisterIds=()=>Re(6),e.usePersisterOrPersisterById=Le,e.usePersisterStatus=e=>qe(L,Le(e),5,[]),e.usePersisterStatusListener=(e,s,t)=>He(L,Le(t),e,s,[]),e.useProvideCheckpoints=(e,s)=>we(e,s,5),e.useProvideIndexes=(e,s)=>we(e,s,2),e.useProvideMetrics=(e,s)=>we(e,s,1),e.useProvidePersister=(e,s)=>we(e,s,6),e.useProvideQueries=(e,s)=>we(e,s,4),e.useProvideRelationships=(e,s)=>we(e,s,3),e.useProvideStore=(e,s)=>we(e,s,0),e.useProvideSynchronizer=(e,s)=>we(e,s,7),e.useQueries=e=>be(e,4),e.useQueriesIds=()=>Re(4),e.useQueriesOrQueriesById=ge,e.useQueryIds=e=>qe("Query"+i,ge(e),1),e.useRedoInformation=e=>{var s;const t=me(e),[,,[o]]=rs(t);return[!B(o),us(t),o,null!=(s=q(o,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r]},e.useRelationshipIds=e=>qe("Relationship"+i,ke(e),1),e.useRelationships=e=>be(e,3),e.useRelationshipsIds=()=>Re(3),e.useRelationshipsOrRelationshipsById=ke,e.useRemoteRowId=Xe,e.useRemoteRowIdListener=(e,s,t,r,o)=>He(T,ke(o),t,r,[e,s]),e.useResultCell=ts,e.useResultCellIds=ss,e.useResultCellIdsListener=(e,s,t,r,o)=>He(u+R,ge(o),t,r,[e,s]),e.useResultCellListener=(e,s,t,r,o,l)=>He(u+w,ge(l),r,o,[e,s,t]),e.useResultRow=(e,s,t)=>qe(u+I,ge(t),0,[e,s]),e.useResultRowCount=(e,s)=>qe(u+p,ge(s),5,[e]),e.useResultRowCountListener=(e,s,t,r)=>He(u+p,ge(r),s,t,[e]),e.useResultRowIds=$e,e.useResultRowIdsListener=(e,s,t,r)=>He(u+b,ge(r),s,t,[e]),e.useResultRowListener=(e,s,t,r,o)=>He(u+I,ge(o),t,r,[e,s]),e.useResultSortedRowIds=es,e.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,i)=>He(u+C,ge(i),l,n,[e,s,t,r,o]),e.useResultTable=(e,s)=>qe(u+d,ge(s),0,[e]),e.useResultTableCellIds=(e,s)=>qe(u+d+R,ge(s),1,[e]),e.useResultTableCellIdsListener=(e,s,t,r)=>He(u+d+R,ge(r),s,t,[e]),e.useResultTableListener=(e,s,t,r)=>He(u+d,ge(r),s,t,[e]),e.useRow=(e,s,t)=>qe(I,ye(t),0,[e,s]),e.useRowCount=(e,s)=>qe(p,ye(s),5,[e]),e.useRowCountListener=(e,s,t,r,o)=>He(p,ye(o),s,t,[e],r),e.useRowIds=Ee,e.useRowIdsListener=(e,s,t,r,o)=>He(b,ye(o),s,t,[e],r),e.useRowListener=(e,s,t,r,o,l)=>He(I,ye(l),t,r,[e,s],o),e.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Me(l,w,r,o,u,n,e,s,t),e.useSetCheckpointCallback=(e=D,s=Te,t,r=D,o=Te)=>{const l=me(t);return _((s=>q(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},e.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Me(o,g+I,t,r,l,u,e,s),e.useSetPartialValuesCallback=(e,s,t,r,o)=>Me(t,g+v,e,s,r,o),e.useSetRowCallback=(e,s,t,r,o,l,u)=>Me(o,I,t,r,l,u,e,s),e.useSetTableCallback=(e,s,t,r,o,l)=>Me(r,d,s,t,o,l,e),e.useSetTablesCallback=(e,s,t,r,o)=>Me(t,a,e,s,r,o),e.useSetValueCallback=(e,s,t,r,o,l)=>Me(r,y,s,t,o,l,e),e.useSetValuesCallback=(e,s,t,r,o)=>Me(t,v,e,s,r,o),e.useSliceIds=Ke,e.useSliceIdsListener=(e,s,t,r)=>He(f+i,he(r),s,t,[e]),e.useSliceRowIds=Ne,e.useSliceRowIdsListener=(e,s,t,r,o)=>He(f+b,he(o),t,r,[e,s]),e.useSortedRowIds=Ae,e.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,i)=>He(C,ye(i),l,u,[e,s,t,r,o],n),e.useStartTransactionListener=(e,s,t)=>He("Start"+k,ye(t),e,s),e.useStore=e=>be(e,0),e.useStoreIds=()=>Re(0),e.useStoreOrStoreById=ye,e.useSynchronizer=e=>be(e,7),e.useSynchronizerIds=()=>Re(7),e.useSynchronizerOrSynchronizerById=Se,e.useSynchronizerStatus=e=>qe(L,Se(e),5,[]),e.useSynchronizerStatusListener=(e,s,t)=>He(L,Se(t),e,s,[]),e.useTable=(e,s)=>qe(d,ye(s),0,[e]),e.useTableCellIds=(e,s)=>qe(d+R,ye(s),1,[e]),e.useTableCellIdsListener=(e,s,t,r,o)=>He(d+R,ye(o),s,t,[e],r),e.useTableIds=Fe,e.useTableIdsListener=(e,s,t,r)=>He(c,ye(r),e,s,Te,t),e.useTableListener=(e,s,t,r,o)=>He(d,ye(o),s,t,[e],r),e.useTables=e=>qe(a,ye(e),0),e.useTablesListener=(e,s,t,r)=>He(a,ye(r),e,s,Te,t),e.useUndoInformation=e=>{var s;const t=me(e),[o,l]=rs(t);return[(u=o,!(0==z(u))),ls(t),l,null!=(s=q(l,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r];var u},e.useValue=_e,e.useValueIds=We,e.useValueIdsListener=(e,s,t,r)=>He(h,ye(r),e,s,Te,t),e.useValueListener=(e,s,t,r,o)=>He(y,ye(o),s,t,[e],r),e.useValues=e=>qe(v,ye(e),0),e.useValuesListener=(e,s,t,r)=>He(v,ye(r),e,s,Te,t),e.useWillFinishTransactionListener=(e,s,t)=>He("Will"+m+k,ye(t),e,s)},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,r="",o=t(r),l=t(t),n="Listener",u="Result",i="Has",d="Ids",a="Table",c=a+"s",I=a+d,p="Row",C=p+"Count",b=p+d,w="Sorted"+p+d,R="Cell",y=R+d,h="Value",k=h+"s",v=h+d,g="Status",S=globalThis,L=e=>null==e,m=(e,s,t)=>L(e)?null==t?void 0:t():s(e),f=e=>t(e)==o,P=e=>t(e)==l,T=e=>e.length,V=()=>{},x=(e,s)=>e.every(s),O=(e,s)=>T(e)===T(s)&&x(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)&&m(H(e),(e=>e==q.prototype||L(H(e))),(()=>!0)),D=q.keys,j=(e,s)=>m(e,(e=>e[s])),F=(e,s)=>s in e,E=(e,s)=>{const t=z(e);return T(t)===T(D(s))&&x(t,(([e,t])=>Q(t)?!!Q(s[e])&&E(s[e],t):s[e]===t))},{createContext:A,useContext:G,useEffect:U}=s;var W=(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))(W||{});const _=(N=()=>A([]),F(J=S,K="tinybase_uirc")||(J[K]=N()),J[K]);var J,K,N;const X=(e,s)=>{var t;const r=G(_);return L(e)?r[2*s]:f(e)?j(null!=(t=r[2*s+1])?t:{},e):e},Y=(e,s)=>{const t=X(e,s);return L(e)||f(e)?t:e},Z=(e,s,t)=>{const{16:r,17:o}=G(_);U((()=>(null==r||r(t,e,s),()=>null==o?void 0:o(t,e))),[r,e,s,t,o])},$=e=>{var s;return D(null!=(s=G(_)[2*e+1])?s:{})},ee=e=>Y(e,0),se=e=>Y(e,1),te=e=>Y(e,2),re=e=>Y(e,3),oe=e=>Y(e,4),le=e=>Y(e,5),ne=e=>Y(e,6),ue=e=>Y(e,7),ie=e=>e.toLowerCase();ie(n);const de="Transaction";ie(de);var ae=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{u(t.next(e))}catch(e){o(e)}},n=e=>{try{u(t.throw(e))}catch(e){o(e)}},u=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,n);u((t=t.apply(e,s)).next())}));const{useCallback:ce,useEffect:Ie,useMemo:pe,useLayoutEffect:Ce,useRef:be,useState:we,useSyncExternalStore:Re}=s,ye=[],he=[{},[],[ye,void 0,ye],void 0,!1,0],ke=[E,O,([e,s,t],[r,o,l])=>s===o&&O(e,r)&&O(t,l)],ve=(e,s)=>e===s,ge=(e,s,t=ye)=>{const[,r]=we(),[o,l]=we();return Ie((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},Se=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+n])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},Le=(e,s,t,o=ye)=>{const l=be(he[t]),n=ce((()=>{var r,n,u;const i=null!=(n=null==(r=null==s?void 0:s[(4==t?"has":"get")+e])?void 0:r.call(s,...o))?n:he[t];return(null!=(u=ke[t])?u:ve)(i,l.current)?l.current:l.current=i}),[s,t,e,...o]),u=ce((l=>Se(s,(4==t?i:r)+e,...o,l)),[s,t,e,...o]);return Re(u,n,n)},me=(e,s,t,r=ye,o=ye,...l)=>Ce((()=>Se(s,e,...o,t,...l)),[s,e,...o,...r,...l]),fe=(e,s,t,r=ye,o=V,l=ye,...n)=>{const u=ee(e);return ce((e=>m(u,(r=>m(t(e,r),(t=>o(r["set"+s](...Pe(n,r,e),t),t)))))),[u,s,...r,...l,...Te(n)])},Pe=(e,s,t)=>B(e,(e=>P(e)?e(t,s):e)),Te=e=>{return s=e=>!P(e),e.filter(s);var s},Ve=(e,s,t=V,r=ye,...o)=>{const l=ee(e);return ce((e=>t(null==l?void 0:l["del"+s](...Pe(o,l,e)))),[l,s,...r,...Te(o)])},xe=(e,s,t)=>{const r=le(e);return ce((()=>null==r?void 0:r[s](t)),[r,s,t])},Oe=e=>Le(I,ee(e),1),Be=(e,s)=>Le(b,ee(s),1,[e]),Me=(e,s,t,r=0,o,l)=>Le(w,ee(l),1,[e,s,t,r,o]),qe=(e,s,t)=>Le(y,ee(t),1,[e,s]),He=(e,s,t,r)=>Le(R,ee(r),3,[e,s,t]),ze=e=>Le(v,ee(e),1),Qe=(e,s)=>Le(h,ee(s),3,[e]),De=(e,s)=>Le("Metric",se(s),3,[e]),je=(e,s)=>Le("SliceIds",te(s),1,[e]),Fe=(e,s,t)=>Le("Slice"+b,te(t),1,[e,s]),Ee=(e,s,t)=>Le("RemoteRowId",re(t),3,[e,s]),Ae=(e,s,t)=>Le("Local"+b,re(t),1,[e,s]),Ge=(e,s,t)=>Le("Linked"+b,re(t),1,[e,s]),Ue=(e,s)=>Le(u+b,oe(s),1,[e]),We=(e,s,t,r=0,o,l)=>Le(u+w,oe(l),1,[e,s,t,r,o]),_e=(e,s,t)=>Le(u+y,oe(t),1,[e,s]),Je=(e,s,t,r)=>Le(u+R,oe(r),3,[e,s,t]),Ke=e=>Le("CheckpointIds",le(e),2),Ne=(e,s)=>Le("Checkpoint",le(s),3,[e]),Xe=e=>xe(e,"goBackward"),Ye=e=>xe(e,"goForward"),{PureComponent:Ze,Fragment:$e,createElement:es,useCallback:ss,useLayoutEffect:ts,useRef:rs,useState:os}=s,ls=(e,...s)=>L(e)?{}:e(...s),ns=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)];var us=Object.defineProperty,is=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,ps=(e,s,t)=>s in e?us(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,Cs=(e,s)=>{for(var t in s||(s={}))cs.call(s,t)&&ps(e,t,s[t]);if(as)for(var t of as(s))Is.call(s,t)&&ps(e,t,s[t]);return e},bs=(e,s)=>is(e,ds(s)),ws=(e,s)=>{var t={};for(var r in e)cs.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&as)for(var r of as(e))s.indexOf(r)<0&&Is.call(e,r)&&(t[r]=e[r]);return t};const{useCallback:Rs,useContext:ys,useMemo:hs,useState:ks}=s,vs=(e,s,t,r,o)=>[null!=t?t:s[2*e],Cs(Cs(Cs({},s[2*e+1]),r),o[e])],gs=({tableId:e,store:s,rowComponent:t=Ts,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:n},u)=>fs(B(u,(l=>es(t,bs(Cs({},ls(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:n})))),l,n,e),Ss=({queryId:e,queries:s,resultRowComponent:t=Ms,getResultRowComponentProps:r,separator:o,debugIds:l},n)=>fs(B(n,(o=>es(t,bs(Cs({},ls(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),Ls=({relationshipId:e,relationships:s,rowComponent:t=Ts,getRowComponentProps:r,separator:o,debugIds:l},n,u)=>{const[i,d,a]=ns(re(s),e),c=n(e,u,i);return fs(B(c,(e=>es(t,bs(Cs({},ls(r,e)),{key:e,tableId:a,rowId:e,store:d,debugIds:l})))),o,l,u)},ms=e=>({checkpoints:s,checkpointComponent:t=qs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const n=le(s);return fs(B(e(Ke(n)),(e=>es(t,bs(Cs({},ls(r,e)),{key:e,checkpoints:n,checkpointId:e,debugIds:l})))),o)},fs=(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},Ps=({tableId:e,rowId:s,cellId:t,store:o,debugIds:l})=>{var n;return fs(r+(null!=(n=He(e,s,t,o))?n:r),void 0,l,t)},Ts=({tableId:e,rowId:s,store:t,cellComponent:r=Ps,getCellComponentProps:o,customCellIds:l,separator:n,debugIds:u})=>fs(B(((e,s,t,r)=>{const o=qe(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>es(r,bs(Cs({},ls(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:u})))),n,u,s),Vs=e=>gs(e,Be(e.tableId,e.store)),xs=({valueId:e,store:s,debugIds:t})=>{var o;return fs(r+(null!=(o=Qe(e,s))?o:r),void 0,t,e)},Os=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Ts,getRowComponentProps:o,separator:l,debugIds:n})=>{const[u,i,d]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(te(t),e),a=Fe(e,s,u);return fs(B(a,(e=>es(r,bs(Cs({},ls(o,e)),{key:e,tableId:d,rowId:e,store:i,debugIds:n})))),l,n,s)},Bs=({queryId:e,rowId:s,cellId:t,queries:o,debugIds:l})=>{var n;return fs(r+(null!=(n=Je(e,s,t,o))?n:r),void 0,l,t)},Ms=({queryId:e,rowId:s,queries:t,resultCellComponent:r=Bs,getResultCellComponentProps:o,separator:l,debugIds:n})=>fs(B(_e(e,s,t),(l=>es(r,bs(Cs({},ls(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:n})))),l,n,s),qs=({checkpoints:e,checkpointId:s,debugIds:t})=>{var o;return fs(null!=(o=Ne(s,e))?o:r,void 0,t,s)},Hs=ms((e=>e[0])),zs=ms((e=>L(e[1])?[]:[e[1]])),Qs=ms((e=>e[2]));e.BackwardCheckpointsView=Hs,e.CellView=Ps,e.CheckpointView=qs,e.CurrentCheckpointView=zs,e.ForwardCheckpointsView=Qs,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=Os,getSliceComponentProps:r,separator:o,debugIds:l})=>fs(B(je(e,s),(o=>es(t,bs(Cs({},ls(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),e.LinkedRowsView=e=>Ls(e,Ge,e.firstRowId),e.LocalRowsView=e=>Ls(e,Ae,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var o;return fs(null!=(o=De(e,s))?o:r,void 0,t,e)},e.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:n,relationshipsById:u,queries:i,queriesById:d,checkpoints:a,checkpointsById:c,persister:I,persistersById:p,synchronizer:C,synchronizersById:b,children:w})=>{const R=ys(_),[y,h]=ks((()=>B([,,,,,,,,].fill(0),((e,s)=>({}))))),k=Rs(((e,s,t)=>h((r=>j(r[e],s)==t?r:M(r,e,bs(Cs({},r[e]),{[s]:t}))))),[]),v=Rs(((e,s)=>h((t=>F(t[e],s)?M(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return es(_.Provider,{value:hs((()=>[...vs(W.Store,R,e,s,y),...vs(W.Metrics,R,t,r,y),...vs(W.Indexes,R,o,l,y),...vs(W.Relationships,R,n,u,y),...vs(W.Queries,R,i,d,y),...vs(W.Checkpoints,R,a,c,y),...vs(W.Persister,R,I,p,y),...vs(W.Synchronizer,R,C,b,y),k,v]),[y,e,s,t,r,o,l,n,u,i,d,a,c,I,p,C,b,R,k,v])},w)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Ts,getRowComponentProps:o,debugIds:l})=>{const[n,u,,i]=ns(re(t),e),d=Ee(e,s,n);return fs(L(i)||L(d)?null:es(r,bs(Cs({},ls(o,d)),{key:d,tableId:i,rowId:d,store:u,debugIds:l})),void 0,l,s)},e.ResultCellView=Bs,e.ResultRowView=Ms,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,n=ws(s,["cellId","descending","offset","limit"]);return Ss(n,We(n.queryId,t,r,o,l,n.queries))},e.ResultTableView=e=>Ss(e,Ue(e.queryId,e.queries)),e.RowView=Ts,e.SliceView=Os,e.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,n=ws(s,["cellId","descending","offset","limit"]);return gs(n,Me(n.tableId,t,r,o,l,n.store))},e.TableView=Vs,e.TablesView=({store:e,tableComponent:s=Vs,getTableComponentProps:t,separator:r,debugIds:o})=>fs(B(Oe(e),(r=>es(s,bs(Cs({},ls(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),e.ValueView=xs,e.ValuesView=({store:e,valueComponent:s=xs,getValueComponentProps:t,separator:r,debugIds:o})=>fs(B(ze(e),(r=>es(s,bs(Cs({},ls(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),e.useAddRowCallback=(e,s,t=ye,r,o=V,l=ye,n=!0)=>{const u=ee(r);return ce((t=>m(u,(r=>m(s(t,r),(s=>o(r.addRow(P(e)?e(t,r):e,s,n),r,s)))))),[u,e,...t,...l,n])},e.useCell=He,e.useCellIds=qe,e.useCellIdsListener=(e,s,t,r,o,l)=>me(y,ee(l),t,r,[e,s],o),e.useCellListener=(e,s,t,r,o,l,n)=>me(R,ee(n),r,o,[e,s,t],l),e.useCheckpoint=Ne,e.useCheckpointIds=Ke,e.useCheckpointIdsListener=(e,s,t)=>me("CheckpointIds",le(t),e,s),e.useCheckpointListener=(e,s,t,r)=>me("Checkpoint",le(r),s,t,[e]),e.useCheckpoints=e=>X(e,5),e.useCheckpointsIds=()=>$(5),e.useCheckpointsOrCheckpointsById=le,e.useCreateCheckpoints=(e,s,t)=>ge(e,s,t),e.useCreateIndexes=(e,s,t)=>ge(e,s,t),e.useCreateMergeableStore=(e,s=ye)=>pe(e,s),e.useCreateMetrics=(e,s,t)=>ge(e,s,t),e.useCreatePersister=(e,s,t=ye,r,o=ye,l,n=ye)=>{const[,u]=we(),[i,d]=we();return Ie((()=>{ae(void 0,null,(function*(){const t=e?yield s(e):void 0;d(t),t&&r&&ae(void 0,null,(function*(){yield r(t),u([])}))}))}),[e,...t,...o]),Ie((()=>()=>{i&&(i.destroy(),null==l||l(i))}),[i,...n]),i},e.useCreateQueries=(e,s,t)=>ge(e,s,t),e.useCreateRelationships=(e,s,t)=>ge(e,s,t),e.useCreateStore=(e,s=ye)=>pe(e,s),e.useCreateSynchronizer=(e,s,t=ye,r,o=ye)=>{const[l,n]=we();return Ie((()=>{ae(void 0,null,(function*(){const t=e?yield s(e):void 0;n(t)}))}),[e,...t]),Ie((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},e.useDelCellCallback=(e,s,t,r,o,l,n)=>Ve(o,R,l,n,e,s,t,r),e.useDelRowCallback=(e,s,t,r,o)=>Ve(t,p,r,o,e,s),e.useDelTableCallback=(e,s,t,r)=>Ve(s,a,t,r,e),e.useDelTablesCallback=(e,s,t)=>Ve(e,c,s,t),e.useDelValueCallback=(e,s,t,r)=>Ve(s,h,t,r,e),e.useDelValuesCallback=(e,s,t)=>Ve(e,k,s,t),e.useDidFinishTransactionListener=(e,s,t)=>me("DidFinish"+de,ee(t),e,s),e.useGoBackwardCallback=Xe,e.useGoForwardCallback=Ye,e.useGoToCallback=(e,s=ye,t,r=V,o=ye)=>{const l=le(t);return ce((s=>m(l,(t=>m(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},e.useHasCell=(e,s,t,r)=>Le(R,ee(r),4,[e,s,t]),e.useHasCellListener=(e,s,t,r,o,l,n)=>me(i+R,ee(n),r,o,[e,s,t],l),e.useHasRow=(e,s,t)=>Le(p,ee(t),4,[e,s]),e.useHasRowListener=(e,s,t,r,o,l)=>me(i+p,ee(l),t,r,[e,s],o),e.useHasTable=(e,s)=>Le(a,ee(s),4,[e]),e.useHasTableCell=(e,s,t)=>Le(a+R,ee(t),4,[e,s]),e.useHasTableCellListener=(e,s,t,r,o,l)=>me(i+a+R,ee(l),t,r,[e,s],o),e.useHasTableListener=(e,s,t,r,o)=>me(i+a,ee(o),s,t,[e],r),e.useHasTables=e=>Le(c,ee(e),4,[]),e.useHasTablesListener=(e,s,t,r)=>me(i+c,ee(r),e,s,[],t),e.useHasValue=(e,s)=>Le(h,ee(s),4,[e]),e.useHasValueListener=(e,s,t,r,o)=>me(i+h,ee(o),s,t,[e],r),e.useHasValues=e=>Le(k,ee(e),4,[]),e.useHasValuesListener=(e,s,t,r)=>me(i+k,ee(r),e,s,[],t),e.useIndexIds=e=>Le("IndexIds",te(e),1),e.useIndexes=e=>X(e,2),e.useIndexesIds=()=>$(2),e.useIndexesOrIndexesById=te,e.useLinkedRowIds=Ge,e.useLinkedRowIdsListener=(e,s,t,r,o)=>me("Linked"+b,re(o),t,r,[e,s]),e.useLocalRowIds=Ae,e.useLocalRowIdsListener=(e,s,t,r,o)=>me("Local"+b,re(o),t,r,[e,s]),e.useMetric=De,e.useMetricIds=e=>Le("MetricIds",se(e),1),e.useMetricListener=(e,s,t,r)=>me("Metric",se(r),s,t,[e]),e.useMetrics=e=>X(e,1),e.useMetricsIds=()=>$(1),e.useMetricsOrMetricsById=se,e.usePersister=e=>X(e,6),e.usePersisterIds=()=>$(6),e.usePersisterOrPersisterById=ne,e.usePersisterStatus=e=>Le(g,ne(e),5,[]),e.usePersisterStatusListener=(e,s,t)=>me(g,ne(t),e,s,[]),e.useProvideCheckpoints=(e,s)=>Z(e,s,5),e.useProvideIndexes=(e,s)=>Z(e,s,2),e.useProvideMetrics=(e,s)=>Z(e,s,1),e.useProvidePersister=(e,s)=>Z(e,s,6),e.useProvideQueries=(e,s)=>Z(e,s,4),e.useProvideRelationships=(e,s)=>Z(e,s,3),e.useProvideStore=(e,s)=>Z(e,s,0),e.useProvideSynchronizer=(e,s)=>Z(e,s,7),e.useQueries=e=>X(e,4),e.useQueriesIds=()=>$(4),e.useQueriesOrQueriesById=oe,e.useQueryIds=e=>Le("QueryIds",oe(e),1),e.useRedoInformation=e=>{var s;const t=le(e),[,,[o]]=Ke(t);return[!L(o),Ye(t),o,null!=(s=m(o,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r]},e.useRelationshipIds=e=>Le("RelationshipIds",re(e),1),e.useRelationships=e=>X(e,3),e.useRelationshipsIds=()=>$(3),e.useRelationshipsOrRelationshipsById=re,e.useRemoteRowId=Ee,e.useRemoteRowIdListener=(e,s,t,r,o)=>me("RemoteRowId",re(o),t,r,[e,s]),e.useResultCell=Je,e.useResultCellIds=_e,e.useResultCellIdsListener=(e,s,t,r,o)=>me(u+y,oe(o),t,r,[e,s]),e.useResultCellListener=(e,s,t,r,o,l)=>me(u+R,oe(l),r,o,[e,s,t]),e.useResultRow=(e,s,t)=>Le(u+p,oe(t),0,[e,s]),e.useResultRowCount=(e,s)=>Le(u+C,oe(s),5,[e]),e.useResultRowCountListener=(e,s,t,r)=>me(u+C,oe(r),s,t,[e]),e.useResultRowIds=Ue,e.useResultRowIdsListener=(e,s,t,r)=>me(u+b,oe(r),s,t,[e]),e.useResultRowListener=(e,s,t,r,o)=>me(u+p,oe(o),t,r,[e,s]),e.useResultSortedRowIds=We,e.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,i)=>me(u+w,oe(i),l,n,[e,s,t,r,o]),e.useResultTable=(e,s)=>Le(u+a,oe(s),0,[e]),e.useResultTableCellIds=(e,s)=>Le(u+a+y,oe(s),1,[e]),e.useResultTableCellIdsListener=(e,s,t,r)=>me(u+a+y,oe(r),s,t,[e]),e.useResultTableListener=(e,s,t,r)=>me(u+a,oe(r),s,t,[e]),e.useRow=(e,s,t)=>Le(p,ee(t),0,[e,s]),e.useRowCount=(e,s)=>Le(C,ee(s),5,[e]),e.useRowCountListener=(e,s,t,r,o)=>me(C,ee(o),s,t,[e],r),e.useRowIds=Be,e.useRowIdsListener=(e,s,t,r,o)=>me(b,ee(o),s,t,[e],r),e.useRowListener=(e,s,t,r,o,l)=>me(p,ee(l),t,r,[e,s],o),e.useSetCellCallback=(e,s,t,r,o,l,n,u)=>fe(l,R,r,o,n,u,e,s,t),e.useSetCheckpointCallback=(e=V,s=ye,t,r=V,o=ye)=>{const l=le(t);return ce((s=>m(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},e.useSetPartialRowCallback=(e,s,t,r,o,l,n)=>fe(o,"PartialRow",t,r,l,n,e,s),e.useSetPartialValuesCallback=(e,s,t,r,o)=>fe(t,"PartialValues",e,s,r,o),e.useSetRowCallback=(e,s,t,r,o,l,n)=>fe(o,p,t,r,l,n,e,s),e.useSetTableCallback=(e,s,t,r,o,l)=>fe(r,a,s,t,o,l,e),e.useSetTablesCallback=(e,s,t,r,o)=>fe(t,c,e,s,r,o),e.useSetValueCallback=(e,s,t,r,o,l)=>fe(r,h,s,t,o,l,e),e.useSetValuesCallback=(e,s,t,r,o)=>fe(t,k,e,s,r,o),e.useSliceIds=je,e.useSliceIdsListener=(e,s,t,r)=>me("SliceIds",te(r),s,t,[e]),e.useSliceRowIds=Fe,e.useSliceRowIdsListener=(e,s,t,r,o)=>me("Slice"+b,te(o),t,r,[e,s]),e.useSortedRowIds=Me,e.useSortedRowIdsListener=(e,s,t,r,o,l,n,u,i)=>me(w,ee(i),l,n,[e,s,t,r,o],u),e.useStartTransactionListener=(e,s,t)=>me("Start"+de,ee(t),e,s),e.useStore=e=>X(e,0),e.useStoreIds=()=>$(0),e.useStoreOrStoreById=ee,e.useSynchronizer=e=>X(e,7),e.useSynchronizerIds=()=>$(7),e.useSynchronizerOrSynchronizerById=ue,e.useSynchronizerStatus=e=>Le(g,ue(e),5,[]),e.useSynchronizerStatusListener=(e,s,t)=>me(g,ue(t),e,s,[]),e.useTable=(e,s)=>Le(a,ee(s),0,[e]),e.useTableCellIds=(e,s)=>Le(a+y,ee(s),1,[e]),e.useTableCellIdsListener=(e,s,t,r,o)=>me(a+y,ee(o),s,t,[e],r),e.useTableIds=Oe,e.useTableIdsListener=(e,s,t,r)=>me(I,ee(r),e,s,ye,t),e.useTableListener=(e,s,t,r,o)=>me(a,ee(o),s,t,[e],r),e.useTables=e=>Le(c,ee(e),0),e.useTablesListener=(e,s,t,r)=>me(c,ee(r),e,s,ye,t),e.useUndoInformation=e=>{var s;const t=le(e),[o,l]=Ke(t);return[(n=o,!(0==T(n))),Xe(t),l,null!=(s=m(l,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r];var n},e.useValue=Qe,e.useValueIds=ze,e.useValueIdsListener=(e,s,t,r)=>me(v,ee(r),e,s,ye,t),e.useValueListener=(e,s,t,r,o)=>me(h,ee(o),s,t,[e],r),e.useValues=e=>Le(k,ee(e),0),e.useValuesListener=(e,s,t,r)=>me(k,ee(r),e,s,ye,t),e.useWillFinishTransactionListener=(e,s,t)=>me("WillFinish"+de,ee(t),e,s)},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
|
|
1
|
+
var e,s;e=this,s=function(e,s){"use strict";const t=e=>typeof e,r="",o=t(r),l=t(t),u="Result",n="Has",i="Ids",d="Table",a=d+"s",c=d+i,I="Row",p=I+"Count",b=I+i,C="Sorted"+I+i,w="Cell",R=w+i,y="Value",v=y+"s",h=y+i,k="Transaction",g="Partial",m="Finish",L="Status",S="Metric",f="Slice",T="RemoteRowId",P="Local",V="Linked",x="Checkpoint",O=globalThis,B=e=>null==e,q=(e,s,t)=>B(e)?null==t?void 0:t():s(e),H=e=>t(e)==o,M=e=>t(e)==l,z=e=>e.length,D=()=>{},j=(e,s)=>e.every(s),Q=(e,s)=>z(e)===z(s)&&j(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:U,createElement:W,useCallback:_,useContext:J,useEffect:K,useLayoutEffect:N,useMemo:X,useRef:Y,useState:Z,useSyncExternalStore:$}=s,ee=(e,...s)=>B(e)?{}:e(...s),se=(e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(s),null==e?void 0:e.getRemoteTableId(s)],te=Object,re=e=>te.getPrototypeOf(e),oe=te.entries,le=e=>!B(e)&&q(re(e),(e=>e==te.prototype||B(re(e))),(()=>!0)),ue=te.keys,ne=(e,s)=>q(e,(e=>e[s])),ie=(e,s)=>s in e,de=(e,s)=>{const t=oe(e);return z(t)===z(ue(s))&&j(t,(([e,t])=>le(t)?!!le(s[e])&&de(s[e],t):s[e]===t))},ae=(pe=()=>U([]),ie(ce=O,Ie="tinybase_uirc")||(ce[Ie]=pe()),ce[Ie]);var ce,Ie,pe;const be=(e,s)=>{var t;const r=J(ae);return B(e)?r[2*s]:H(e)?ne(null!=(t=r[2*s+1])?t:{},e):e},Ce=(e,s)=>{const t=be(e,s);return B(e)||H(e)?t:e},we=(e,s,t)=>{const{16:r,17:o}=J(ae);K((()=>(null==r||r(t,e,s),()=>null==o?void 0:o(t,e))),[r,e,s,t,o])},Re=e=>{var s;return ue(null!=(s=J(ae)[2*e+1])?s:{})},ye=e=>Ce(e,0),ve=e=>Ce(e,1),he=e=>Ce(e,2),ke=e=>Ce(e,3),ge=e=>Ce(e,4),me=e=>Ce(e,5),Le=e=>Ce(e,6),Se=e=>Ce(e,7);var fe=(e,s,t)=>new Promise(((r,o)=>{var l=e=>{try{n(t.next(e))}catch(e){o(e)}},u=e=>{try{n(t.throw(e))}catch(e){o(e)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(l,u);n((t=t.apply(e,s)).next())}));const Te=[],Pe=[{},[],[Te,void 0,Te],void 0,!1,0],Ve=[de,Q,([e,s,t],[r,o,l])=>s===o&&Q(e,r)&&Q(t,l)],xe=(e,s)=>e===s,Oe=(e,s,t=Te)=>{const[,r]=Z(),[o,l]=Z();return K((()=>{const t=e?s(e):void 0;return l(t),r([]),null==t?void 0:t.destroy}),[e,...t]),o},Be=(e,s,...t)=>{var r;const o=null==(r=null==e?void 0:e["add"+s+"Listener"])?void 0:r.call(e,...t);return()=>null==e?void 0:e.delListener(o)},qe=(e,s,t,o=Te)=>{const l=Y(Pe[t]),u=_((()=>{var r,u,n;const i=null!=(u=null==(r=null==s?void 0:s[(4==t?"has":"get")+e])?void 0:r.call(s,...o))?u:Pe[t];return(null!=(n=Ve[t])?n:xe)(i,l.current)?l.current:l.current=i}),[s,t,e,...o]),i=_((l=>Be(s,(4==t?n:r)+e,...o,l)),[s,t,e,...o]);return $(i,u,u)},He=(e,s,t,r=Te,o=Te,...l)=>N((()=>Be(s,e,...o,t,...l)),[s,e,...o,...r,...l]),Me=(e,s,t,r=Te,o=D,l=Te,...u)=>{const n=ye(e);return _((e=>q(n,(r=>q(t(e,r),(t=>o(r["set"+s](...ze(u,r,e),t),t)))))),[n,s,...r,...l,...De(u)])},ze=(e,s,t)=>F(e,(e=>M(e)?e(t,s):e)),De=e=>{return s=e=>!M(e),e.filter(s);var s},je=(e,s,t=D,r=Te,...o)=>{const l=ye(e);return _((e=>t(null==l?void 0:l["del"+s](...ze(o,l,e)))),[l,s,...r,...De(o)])},Qe=(e,s,t)=>{const r=me(e);return _((()=>null==r?void 0:r[s](t)),[r,s,t])},Fe=e=>qe(c,ye(e),1),Ee=(e,s)=>qe(b,ye(s),1,[e]),Ae=(e,s,t,r=0,o,l)=>qe(C,ye(l),1,[e,s,t,r,o]),Ge=(e,s,t)=>qe(R,ye(t),1,[e,s]),Ue=(e,s,t,r)=>qe(w,ye(r),3,[e,s,t]),We=e=>qe(h,ye(e),1),_e=(e,s)=>qe(y,ye(s),3,[e]),Je=(e,s)=>qe(S,ve(s),3,[e]),Ke=(e,s)=>qe(f+i,he(s),1,[e]),Ne=(e,s,t)=>qe(f+b,he(t),1,[e,s]),Xe=(e,s,t)=>qe(T,ke(t),3,[e,s]),Ye=(e,s,t)=>qe(P+b,ke(t),1,[e,s]),Ze=(e,s,t)=>qe(V+b,ke(t),1,[e,s]),$e=(e,s)=>qe(u+b,ge(s),1,[e]),es=(e,s,t,r=0,o,l)=>qe(u+C,ge(l),1,[e,s,t,r,o]),ss=(e,s,t)=>qe(u+R,ge(t),1,[e,s]),ts=(e,s,t,r)=>qe(u+w,ge(r),3,[e,s,t]),rs=e=>qe(x+i,me(e),2),os=(e,s)=>qe(x,me(s),3,[e]),ls=e=>Qe(e,"goBackward"),us=e=>Qe(e,"goForward");var ns=Object.defineProperty,is=Object.defineProperties,ds=Object.getOwnPropertyDescriptors,as=Object.getOwnPropertySymbols,cs=Object.prototype.hasOwnProperty,Is=Object.prototype.propertyIsEnumerable,ps=(e,s,t)=>s in e?ns(e,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[s]=t,bs=(e,s)=>{for(var t in s||(s={}))cs.call(s,t)&&ps(e,t,s[t]);if(as)for(var t of as(s))Is.call(s,t)&&ps(e,t,s[t]);return e},Cs=(e,s)=>is(e,ds(s)),ws=(e,s)=>{var t={};for(var r in e)cs.call(e,r)&&s.indexOf(r)<0&&(t[r]=e[r]);if(null!=e&&as)for(var r of as(e))s.indexOf(r)<0&&Is.call(e,r)&&(t[r]=e[r]);return t};const Rs=(e,s,t,r,o)=>[null!=t?t:s[2*e],bs(bs(bs({},s[2*e+1]),r),o[e])],ys=({tableId:e,store:s,rowComponent:t=Ls,getRowComponentProps:r,customCellIds:o,separator:l,debugIds:u},n)=>gs(F(n,(l=>W(t,Cs(bs({},ee(r,l)),{key:l,tableId:e,rowId:l,customCellIds:o,store:s,debugIds:u})))),l,u,e),vs=({queryId:e,queries:s,resultRowComponent:t=Vs,getResultRowComponentProps:r,separator:o,debugIds:l},u)=>gs(F(u,(o=>W(t,Cs(bs({},ee(r,o)),{key:o,queryId:e,rowId:o,queries:s,debugIds:l})))),o,l,e),hs=({relationshipId:e,relationships:s,rowComponent:t=Ls,getRowComponentProps:r,separator:o,debugIds:l},u,n)=>{const[i,d,a]=se(ke(s),e),c=u(e,n,i);return gs(F(c,(e=>W(t,Cs(bs({},ee(r,e)),{key:e,tableId:a,rowId:e,store:d,debugIds:l})))),o,l,n)},ks=e=>({checkpoints:s,checkpointComponent:t=xs,getCheckpointComponentProps:r,separator:o,debugIds:l})=>{const u=me(s);return gs(F(e(rs(u)),(e=>W(t,Cs(bs({},ee(r,e)),{key:e,checkpoints:u,checkpointId:e,debugIds:l})))),o)},gs=(e,s,t,r)=>{const o=B(s)||!Array.isArray(e)?e:F(e,((e,t)=>t>0?[s,e]:e));return t?[r,":{",o,"}"]:o},ms=({tableId:e,rowId:s,cellId:t,store:o,debugIds:l})=>{var u;return gs(r+(null!=(u=Ue(e,s,t,o))?u:r),void 0,l,t)},Ls=({tableId:e,rowId:s,store:t,cellComponent:r=ms,getCellComponentProps:o,customCellIds:l,separator:u,debugIds:n})=>gs(F(((e,s,t,r)=>{const o=Ge(s,t,r);return null!=e?e:o})(l,e,s,t),(l=>W(r,Cs(bs({},ee(o,l)),{key:l,tableId:e,rowId:s,cellId:l,store:t,debugIds:n})))),u,n,s),Ss=e=>ys(e,Ee(e.tableId,e.store)),fs=({valueId:e,store:s,debugIds:t})=>{var o;return gs(r+(null!=(o=_e(e,s))?o:r),void 0,t,e)},Ts=({indexId:e,sliceId:s,indexes:t,rowComponent:r=Ls,getRowComponentProps:o,separator:l,debugIds:u})=>{const[n,i,d]=((e,s)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(s)])(he(t),e),a=Ne(e,s,n);return gs(F(a,(e=>W(r,Cs(bs({},ee(o,e)),{key:e,tableId:d,rowId:e,store:i,debugIds:u})))),l,u,s)},Ps=({queryId:e,rowId:s,cellId:t,queries:o,debugIds:l})=>{var u;return gs(r+(null!=(u=ts(e,s,t,o))?u:r),void 0,l,t)},Vs=({queryId:e,rowId:s,queries:t,resultCellComponent:r=Ps,getResultCellComponentProps:o,separator:l,debugIds:u})=>gs(F(ss(e,s,t),(l=>W(r,Cs(bs({},ee(o,l)),{key:l,queryId:e,rowId:s,cellId:l,queries:t,debugIds:u})))),l,u,s),xs=({checkpoints:e,checkpointId:s,debugIds:t})=>{var o;return gs(null!=(o=os(s,e))?o:r,void 0,t,s)},Os=ks((e=>e[0])),Bs=ks((e=>B(e[1])?[]:[e[1]])),qs=ks((e=>e[2]));e.BackwardCheckpointsView=Os,e.CellView=ms,e.CheckpointView=xs,e.CurrentCheckpointView=Bs,e.ForwardCheckpointsView=qs,e.IndexView=({indexId:e,indexes:s,sliceComponent:t=Ts,getSliceComponentProps:r,separator:o,debugIds:l})=>gs(F(Ke(e,s),(o=>W(t,Cs(bs({},ee(r,o)),{key:o,indexId:e,sliceId:o,indexes:s,debugIds:l})))),o,l,e),e.LinkedRowsView=e=>hs(e,Ze,e.firstRowId),e.LocalRowsView=e=>hs(e,Ye,e.remoteRowId),e.MetricView=({metricId:e,metrics:s,debugIds:t})=>{var o;return gs(null!=(o=Je(e,s))?o:r,void 0,t,e)},e.Provider=({store:e,storesById:s,metrics:t,metricsById:r,indexes:o,indexesById:l,relationships:u,relationshipsById:n,queries:i,queriesById:d,checkpoints:a,checkpointsById:c,persister:I,persistersById:p,synchronizer:b,synchronizersById:C,children:w})=>{const R=J(ae),[y,v]=Z((()=>F([,,,,,,,,].fill(0),((e,s)=>({}))))),h=_(((e,s,t)=>v((r=>ne(r[e],s)==t?r:E(r,e,Cs(bs({},r[e]),{[s]:t}))))),[]),k=_(((e,s)=>v((t=>ie(t[e],s)?E(t,e,((e,s)=>(delete e[s],e))(t[e],s)):t))),[]);return W(ae.Provider,{value:X((()=>[...Rs(0,R,e,s,y),...Rs(1,R,t,r,y),...Rs(2,R,o,l,y),...Rs(3,R,u,n,y),...Rs(4,R,i,d,y),...Rs(5,R,a,c,y),...Rs(6,R,I,p,y),...Rs(7,R,b,C,y),h,k]),[y,e,s,t,r,o,l,u,n,i,d,a,c,I,p,b,C,R,h,k])},w)},e.RemoteRowView=({relationshipId:e,localRowId:s,relationships:t,rowComponent:r=Ls,getRowComponentProps:o,debugIds:l})=>{const[u,n,,i]=se(ke(t),e),d=Xe(e,s,u);return gs(B(i)||B(d)?null:W(r,Cs(bs({},ee(o,d)),{key:d,tableId:i,rowId:d,store:n,debugIds:l})),void 0,l,s)},e.ResultCellView=Ps,e.ResultRowView=Vs,e.ResultSortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ws(s,["cellId","descending","offset","limit"]);return vs(u,es(u.queryId,t,r,o,l,u.queries))},e.ResultTableView=e=>vs(e,$e(e.queryId,e.queries)),e.RowView=Ls,e.SliceView=Ts,e.SortedTableView=e=>{var s=e,{cellId:t,descending:r,offset:o,limit:l}=s,u=ws(s,["cellId","descending","offset","limit"]);return ys(u,Ae(u.tableId,t,r,o,l,u.store))},e.TableView=Ss,e.TablesView=({store:e,tableComponent:s=Ss,getTableComponentProps:t,separator:r,debugIds:o})=>gs(F(Fe(e),(r=>W(s,Cs(bs({},ee(t,r)),{key:r,tableId:r,store:e,debugIds:o})))),r),e.ValueView=fs,e.ValuesView=({store:e,valueComponent:s=fs,getValueComponentProps:t,separator:r,debugIds:o})=>gs(F(We(e),(r=>W(s,Cs(bs({},ee(t,r)),{key:r,valueId:r,store:e,debugIds:o})))),r),e.useAddRowCallback=(e,s,t=Te,r,o=D,l=Te,u=!0)=>{const n=ye(r);return _((t=>q(n,(r=>q(s(t,r),(s=>o(r.addRow(M(e)?e(t,r):e,s,u),r,s)))))),[n,e,...t,...l,u])},e.useCell=Ue,e.useCellIds=Ge,e.useCellIdsListener=(e,s,t,r,o,l)=>He(R,ye(l),t,r,[e,s],o),e.useCellListener=(e,s,t,r,o,l,u)=>He(w,ye(u),r,o,[e,s,t],l),e.useCheckpoint=os,e.useCheckpointIds=rs,e.useCheckpointIdsListener=(e,s,t)=>He(x+i,me(t),e,s),e.useCheckpointListener=(e,s,t,r)=>He(x,me(r),s,t,[e]),e.useCheckpoints=e=>be(e,5),e.useCheckpointsIds=()=>Re(5),e.useCheckpointsOrCheckpointsById=me,e.useCreateCheckpoints=(e,s,t)=>Oe(e,s,t),e.useCreateIndexes=(e,s,t)=>Oe(e,s,t),e.useCreateMergeableStore=(e,s=Te)=>X(e,s),e.useCreateMetrics=(e,s,t)=>Oe(e,s,t),e.useCreatePersister=(e,s,t=Te,r,o=Te,l,u=Te)=>{const[,n]=Z(),[i,d]=Z();return K((()=>{fe(void 0,null,(function*(){const t=e?yield s(e):void 0;d(t),t&&r&&fe(void 0,null,(function*(){yield r(t),n([])}))}))}),[e,...t,...o]),K((()=>()=>{i&&(i.destroy(),null==l||l(i))}),[i,...u]),i},e.useCreateQueries=(e,s,t)=>Oe(e,s,t),e.useCreateRelationships=(e,s,t)=>Oe(e,s,t),e.useCreateStore=(e,s=Te)=>X(e,s),e.useCreateSynchronizer=(e,s,t=Te,r,o=Te)=>{const[l,u]=Z();return K((()=>{fe(void 0,null,(function*(){const t=e?yield s(e):void 0;u(t)}))}),[e,...t]),K((()=>()=>{l&&(l.destroy(),null==r||r(l))}),[l,...o]),l},e.useDelCellCallback=(e,s,t,r,o,l,u)=>je(o,w,l,u,e,s,t,r),e.useDelRowCallback=(e,s,t,r,o)=>je(t,I,r,o,e,s),e.useDelTableCallback=(e,s,t,r)=>je(s,d,t,r,e),e.useDelTablesCallback=(e,s,t)=>je(e,a,s,t),e.useDelValueCallback=(e,s,t,r)=>je(s,y,t,r,e),e.useDelValuesCallback=(e,s,t)=>je(e,v,s,t),e.useDidFinishTransactionListener=(e,s,t)=>He("Did"+m+k,ye(t),e,s),e.useGoBackwardCallback=ls,e.useGoForwardCallback=us,e.useGoToCallback=(e,s=Te,t,r=D,o=Te)=>{const l=me(t);return _((s=>q(l,(t=>q(e(s),(e=>r(t.goTo(e),e)))))),[l,...s,...o])},e.useHasCell=(e,s,t,r)=>qe(w,ye(r),4,[e,s,t]),e.useHasCellListener=(e,s,t,r,o,l,u)=>He(n+w,ye(u),r,o,[e,s,t],l),e.useHasRow=(e,s,t)=>qe(I,ye(t),4,[e,s]),e.useHasRowListener=(e,s,t,r,o,l)=>He(n+I,ye(l),t,r,[e,s],o),e.useHasTable=(e,s)=>qe(d,ye(s),4,[e]),e.useHasTableCell=(e,s,t)=>qe(d+w,ye(t),4,[e,s]),e.useHasTableCellListener=(e,s,t,r,o,l)=>He(n+d+w,ye(l),t,r,[e,s],o),e.useHasTableListener=(e,s,t,r,o)=>He(n+d,ye(o),s,t,[e],r),e.useHasTables=e=>qe(a,ye(e),4,[]),e.useHasTablesListener=(e,s,t,r)=>He(n+a,ye(r),e,s,[],t),e.useHasValue=(e,s)=>qe(y,ye(s),4,[e]),e.useHasValueListener=(e,s,t,r,o)=>He(n+y,ye(o),s,t,[e],r),e.useHasValues=e=>qe(v,ye(e),4,[]),e.useHasValuesListener=(e,s,t,r)=>He(n+v,ye(r),e,s,[],t),e.useIndexIds=e=>qe("Index"+i,he(e),1),e.useIndexes=e=>be(e,2),e.useIndexesIds=()=>Re(2),e.useIndexesOrIndexesById=he,e.useLinkedRowIds=Ze,e.useLinkedRowIdsListener=(e,s,t,r,o)=>He(V+b,ke(o),t,r,[e,s]),e.useLocalRowIds=Ye,e.useLocalRowIdsListener=(e,s,t,r,o)=>He(P+b,ke(o),t,r,[e,s]),e.useMetric=Je,e.useMetricIds=e=>qe(S+i,ve(e),1),e.useMetricListener=(e,s,t,r)=>He(S,ve(r),s,t,[e]),e.useMetrics=e=>be(e,1),e.useMetricsIds=()=>Re(1),e.useMetricsOrMetricsById=ve,e.usePersister=e=>be(e,6),e.usePersisterIds=()=>Re(6),e.usePersisterOrPersisterById=Le,e.usePersisterStatus=e=>qe(L,Le(e),5,[]),e.usePersisterStatusListener=(e,s,t)=>He(L,Le(t),e,s,[]),e.useProvideCheckpoints=(e,s)=>we(e,s,5),e.useProvideIndexes=(e,s)=>we(e,s,2),e.useProvideMetrics=(e,s)=>we(e,s,1),e.useProvidePersister=(e,s)=>we(e,s,6),e.useProvideQueries=(e,s)=>we(e,s,4),e.useProvideRelationships=(e,s)=>we(e,s,3),e.useProvideStore=(e,s)=>we(e,s,0),e.useProvideSynchronizer=(e,s)=>we(e,s,7),e.useQueries=e=>be(e,4),e.useQueriesIds=()=>Re(4),e.useQueriesOrQueriesById=ge,e.useQueryIds=e=>qe("Query"+i,ge(e),1),e.useRedoInformation=e=>{var s;const t=me(e),[,,[o]]=rs(t);return[!B(o),us(t),o,null!=(s=q(o,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r]},e.useRelationshipIds=e=>qe("Relationship"+i,ke(e),1),e.useRelationships=e=>be(e,3),e.useRelationshipsIds=()=>Re(3),e.useRelationshipsOrRelationshipsById=ke,e.useRemoteRowId=Xe,e.useRemoteRowIdListener=(e,s,t,r,o)=>He(T,ke(o),t,r,[e,s]),e.useResultCell=ts,e.useResultCellIds=ss,e.useResultCellIdsListener=(e,s,t,r,o)=>He(u+R,ge(o),t,r,[e,s]),e.useResultCellListener=(e,s,t,r,o,l)=>He(u+w,ge(l),r,o,[e,s,t]),e.useResultRow=(e,s,t)=>qe(u+I,ge(t),0,[e,s]),e.useResultRowCount=(e,s)=>qe(u+p,ge(s),5,[e]),e.useResultRowCountListener=(e,s,t,r)=>He(u+p,ge(r),s,t,[e]),e.useResultRowIds=$e,e.useResultRowIdsListener=(e,s,t,r)=>He(u+b,ge(r),s,t,[e]),e.useResultRowListener=(e,s,t,r,o)=>He(u+I,ge(o),t,r,[e,s]),e.useResultSortedRowIds=es,e.useResultSortedRowIdsListener=(e,s,t,r,o,l,n,i)=>He(u+C,ge(i),l,n,[e,s,t,r,o]),e.useResultTable=(e,s)=>qe(u+d,ge(s),0,[e]),e.useResultTableCellIds=(e,s)=>qe(u+d+R,ge(s),1,[e]),e.useResultTableCellIdsListener=(e,s,t,r)=>He(u+d+R,ge(r),s,t,[e]),e.useResultTableListener=(e,s,t,r)=>He(u+d,ge(r),s,t,[e]),e.useRow=(e,s,t)=>qe(I,ye(t),0,[e,s]),e.useRowCount=(e,s)=>qe(p,ye(s),5,[e]),e.useRowCountListener=(e,s,t,r,o)=>He(p,ye(o),s,t,[e],r),e.useRowIds=Ee,e.useRowIdsListener=(e,s,t,r,o)=>He(b,ye(o),s,t,[e],r),e.useRowListener=(e,s,t,r,o,l)=>He(I,ye(l),t,r,[e,s],o),e.useSetCellCallback=(e,s,t,r,o,l,u,n)=>Me(l,w,r,o,u,n,e,s,t),e.useSetCheckpointCallback=(e=D,s=Te,t,r=D,o=Te)=>{const l=me(t);return _((s=>q(l,(t=>{const o=e(s);r(t.addCheckpoint(o),t,o)}))),[l,...s,...o])},e.useSetPartialRowCallback=(e,s,t,r,o,l,u)=>Me(o,g+I,t,r,l,u,e,s),e.useSetPartialValuesCallback=(e,s,t,r,o)=>Me(t,g+v,e,s,r,o),e.useSetRowCallback=(e,s,t,r,o,l,u)=>Me(o,I,t,r,l,u,e,s),e.useSetTableCallback=(e,s,t,r,o,l)=>Me(r,d,s,t,o,l,e),e.useSetTablesCallback=(e,s,t,r,o)=>Me(t,a,e,s,r,o),e.useSetValueCallback=(e,s,t,r,o,l)=>Me(r,y,s,t,o,l,e),e.useSetValuesCallback=(e,s,t,r,o)=>Me(t,v,e,s,r,o),e.useSliceIds=Ke,e.useSliceIdsListener=(e,s,t,r)=>He(f+i,he(r),s,t,[e]),e.useSliceRowIds=Ne,e.useSliceRowIdsListener=(e,s,t,r,o)=>He(f+b,he(o),t,r,[e,s]),e.useSortedRowIds=Ae,e.useSortedRowIdsListener=(e,s,t,r,o,l,u,n,i)=>He(C,ye(i),l,u,[e,s,t,r,o],n),e.useStartTransactionListener=(e,s,t)=>He("Start"+k,ye(t),e,s),e.useStore=e=>be(e,0),e.useStoreIds=()=>Re(0),e.useStoreOrStoreById=ye,e.useSynchronizer=e=>be(e,7),e.useSynchronizerIds=()=>Re(7),e.useSynchronizerOrSynchronizerById=Se,e.useSynchronizerStatus=e=>qe(L,Se(e),5,[]),e.useSynchronizerStatusListener=(e,s,t)=>He(L,Se(t),e,s,[]),e.useTable=(e,s)=>qe(d,ye(s),0,[e]),e.useTableCellIds=(e,s)=>qe(d+R,ye(s),1,[e]),e.useTableCellIdsListener=(e,s,t,r,o)=>He(d+R,ye(o),s,t,[e],r),e.useTableIds=Fe,e.useTableIdsListener=(e,s,t,r)=>He(c,ye(r),e,s,Te,t),e.useTableListener=(e,s,t,r,o)=>He(d,ye(o),s,t,[e],r),e.useTables=e=>qe(a,ye(e),0),e.useTablesListener=(e,s,t,r)=>He(a,ye(r),e,s,Te,t),e.useUndoInformation=e=>{var s;const t=me(e),[o,l]=rs(t);return[(u=o,!(0==z(u))),ls(t),l,null!=(s=q(l,(e=>null==t?void 0:t.getCheckpoint(e))))?s:r];var u},e.useValue=_e,e.useValueIds=We,e.useValueIdsListener=(e,s,t,r)=>He(h,ye(r),e,s,Te,t),e.useValueListener=(e,s,t,r,o)=>He(y,ye(o),s,t,[e],r),e.useValues=e=>qe(v,ye(e),0),e.useValuesListener=(e,s,t,r)=>He(v,ye(r),e,s,Te,t),e.useWillFinishTransactionListener=(e,s,t)=>He("Will"+m+k,ye(t),e,s)},"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("react")):"function"==typeof define&&define.amd?define(["exports","react"],s):s((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReact={},e.React);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,
|
|
1
|
+
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s=n(""),a=n(!0),o=n(0),u="Value",r="currentTarget",i="value",d=Math.min,c=isFinite,m=e=>null==e,b=(e,l,t,n)=>e==s?l:e==o?t:n,{PureComponent:I,Fragment:C,createContext:p,createElement:h,useCallback:y,useContext:f,useEffect:g,useLayoutEffect:v,useMemo:w,useRef:T,useState:R,useSyncExternalStore:k}=t,S=(e,...l)=>m(e)?{}:e(...l),O=(e,l)=>e.map(l),N=Object,V=N.entries,x=(e=[])=>N.fromEntries(e),q=(e,l)=>O(V(e),(([e,t])=>l(t,e)));var P=Object.defineProperty,j=Object.defineProperties,E=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,D=(e,l,t)=>l in e?P(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,F=(e,l)=>{for(var t in l||(l={}))B.call(l,t)&&D(e,t,l[t]);if(H)for(var t of H(l))A.call(l,t)&&D(e,t,l[t]);return e},L=(e,l)=>j(e,E(l)),M=(e,l)=>{var t={};for(var n in e)B.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&H)for(var n of H(e))l.indexOf(n)<0&&A.call(e,n)&&(t[n]=e[n]);return t};const U="editable",$=(e,t)=>O(l.useTableCellIds(e,t),(l=>e+"."+l)),z=(e,l,t)=>{const n=y(e,l);return t?n:void 0},G=(...e)=>w((()=>e),e),J=(e,l)=>w((()=>({store:e,tableId:l})),[e,l]),K=(e,l)=>w((()=>({queries:e,queryId:l})),[e,l]),Q=(e,l=!1,t,n=0,s,a,o,u)=>{const[[r,i,d],c]=R([e,l,n]),m=y((e=>{c(e),null==u||u(e)}),[u]),b=z((e=>m([e,e==r&&!i,d])),[m,r,i,d],t),I=y((e=>m([r,i,e])),[m,r,i]),C=!0===o?te:o;return[[r,i,d],b,w((()=>!1===o?null:h(C,{offset:d,limit:s,total:a,onChange:I})),[o,C,d,s,a,I])]},W=(e,l,t)=>w((()=>{const a=null!=l?l:e;return o=Array.isArray(a)?x(O(a,(e=>[e,e]))):a,u=(e,l)=>F(F({},{label:l,component:t}),n(e)==s?{label:e}:e),x(q(o,((e,l)=>[l,u(e,l)])));var o,u}),[l,t,e]),X=({className:e,headerRow:l,idColumn:t,params:[n,s,a,o,u,r]})=>h("table",{className:e},r?h("caption",null,r):null,!1===l?null:h("thead",null,h("tr",null,!1===t?null:h(Y,{sort:null!=o?o:[],label:"Id",onClick:u}),q(n,(({label:e},l)=>h(Y,{key:l,cellId:l,label:e,sort:null!=o?o:[],onClick:u}))))),h("tbody",null,O(a,(e=>h("tr",{key:e},!1===t?null:h("th",null,e),q(n,(({component:l,getComponentProps:t},n)=>h("td",{key:n},h(l,L(F(F({},S(t,e,n)),s),{rowId:e,cellId:n})))))))))),Y=({cellId:e,sort:[l,t],label:n=(null!=e?e:""),onClick:s})=>h("th",{onClick:z((()=>null==s?void 0:s(e)),[s,e],s),className:m(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},m(t)||l!=e?null:(t?"↓":"↑")+" ",n),Z=({localRowId:e,params:[t,n,s,a,o,u,r]})=>{const i=l.useRemoteRowId(o,e,u);return h("tr",null,!1===t?null:h(C,null,h("th",null,e),h("th",null,i)),q(n,(({component:l,getComponentProps:t},n)=>{const[o,u]=((e,l="",t)=>e.split(l,t))(n,".",2),d=o===s?e:o===a?i:null;return m(d)?null:h("td",{key:n},h(l,L(F({},S(t,d,u)),{store:r,tableId:o,rowId:d,cellId:u})))})))},_=({thing:e,onThingChange:l,className:t,hasSchema:u,showType:d=!0})=>{const[m,I]=R(),[C,p]=R(),[f,g]=R(),[v,w]=R(),[T,k]=R();C!==e&&(I((e=>{const l=n(e);return(e=>e==s||e==a)(l)||l==o&&c(e)?l:void 0})(e)),p(e),g(e+""),w(Number(e)||0),k(!!e));const S=y(((e,t)=>{t(e),p(e),l(e)}),[l]),O=y((()=>{if(!(null==u?void 0:u())){const e=b(m,o,a,s),t=b(e,f,v,T);I(e),p(t),l(t)}}),[u,l,f,v,T,m]);return h("div",{className:t},d?h("button",{className:m,onClick:O},m):null,b(m,h("input",{key:m,value:f,onChange:y((e=>S(e[r][i]+"",g)),[S])}),h("input",{key:m,type:"number",value:v,onChange:y((e=>S(Number(e[r][i]||0),w)),[S])}),h("input",{key:m,type:"checkbox",checked:T,onChange:y((e=>S(!!e[r].checked,k)),[S])})))},ee=({tableId:e,rowId:t,cellId:n,store:s,className:a,showType:o})=>{var u;return h(_,{thing:l.useCell(e,t,n,s),onThingChange:l.useSetCellCallback(e,t,n,(e=>e),[],s),className:null!=a?a:U+"Cell",showType:o,hasSchema:null==(u=l.useStoreOrStoreById(s))?void 0:u.hasTablesSchema})},le=({valueId:e,store:t,className:n,showType:s})=>{var a;return h(_,{thing:l.useValue(e,t),onThingChange:l.useSetValueCallback(e,(e=>e),[],t),className:null!=n?n:U+u,showType:s,hasSchema:null==(a=l.useStoreOrStoreById(t))?void 0:a.hasValuesSchema})},te=({onChange:e,total:l,offset:t=0,limit:n=l,singular:s="row",plural:a=s+"s"})=>{(t>l||t<0)&&(t=0,e(0));const o=z((()=>e(t-n)),[e,t,n],t>0),u=z((()=>e(t+n)),[e,t,n],t+n<l);return h(C,null,l>n&&h(C,null,h("button",{className:"previous",disabled:0==t,onClick:o},"←"),h("button",{className:"next",disabled:t+n>=l,onClick:u},"→"),t+1," to ",d(l,t+n)," of "),l," ",1!=l?a:s)};e.EditableCellView=ee,e.EditableValueView=le,e.RelationshipInHtmlTable=({relationshipId:e,relationships:t,editable:n,customCells:s,className:a,headerRow:o,idColumn:u=!0})=>{const[r,i,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(l.useRelationshipsOrRelationshipsById(t),e),m=W([...$(d,i),...$(c,i)],s,n?ee:l.CellView),b=G(u,m,d,c,e,r,i);return h("table",{className:a},!1===o?null:h("thead",null,h("tr",null,!1===u?null:h(C,null,h("th",null,d,".Id"),h("th",null,c,".Id")),q(m,(({label:e},l)=>h("th",{key:l},e))))),h("tbody",null,O(l.useRowIds(d,i),(e=>h(Z,{key:e,localRowId:e,params:b})))))},e.ResultSortedTableInHtmlTable=e=>{var t=e,{queryId:n,cellId:s,descending:a,offset:o,limit:u,queries:r,sortOnClick:i,paginator:d=!1,customCells:c,onChange:m}=t,b=M(t,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[I,C,p]=Q(s,a,i,o,u,l.useResultRowCount(n,r),d,m);return h(X,L(F({},b),{params:G(W(l.useResultTableCellIds(n,r),c,l.ResultCellView),K(r,n),l.useResultSortedRowIds(n,...I,u,r),I,C,p)}))},e.ResultTableInHtmlTable=e=>{var t=e,{queryId:n,queries:s,customCells:a}=t,o=M(t,["queryId","queries","customCells"]);return h(X,L(F({},o),{params:G(W(l.useResultTableCellIds(n,s),a,l.ResultCellView),K(s,n),l.useResultRowIds(n,s))}))},e.SliceInHtmlTable=e=>{var t=e,{indexId:n,sliceId:s,indexes:a,editable:o,customCells:u}=t,r=M(t,["indexId","sliceId","indexes","editable","customCells"]);const[i,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(l.useIndexesOrIndexesById(a),n);return h(X,L(F({},r),{params:G(W(l.useTableCellIds(c,d),u,o?ee:l.CellView),J(d,c),l.useSliceRowIds(n,s,i))}))},e.SortedTableInHtmlTable=e=>{var t=e,{tableId:n,cellId:s,descending:a,offset:o,limit:u,store:r,editable:i,sortOnClick:d,paginator:c=!1,onChange:m,customCells:b}=t,I=M(t,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[C,p,y]=Q(s,a,d,o,u,l.useRowCount(n,r),c,m);return h(X,L(F({},I),{params:G(W(l.useTableCellIds(n,r),b,i?ee:l.CellView),J(r,n),l.useSortedRowIds(n,...C,u,r),C,p,y)}))},e.SortedTablePaginator=te,e.TableInHtmlTable=e=>{var t=e,{tableId:n,store:s,editable:a,customCells:o}=t,u=M(t,["tableId","store","editable","customCells"]);return h(X,L(F({},u),{params:G(W(l.useTableCellIds(n,s),o,a?ee:l.CellView),J(s,n),l.useRowIds(n,s))}))},e.ValuesInHtmlTable=({store:e,editable:t=!1,valueComponent:n=(t?le:l.ValueView),getValueComponentProps:s,className:a,headerRow:o,idColumn:r})=>h("table",{className:a},!1===o?null:h("thead",null,h("tr",null,!1===r?null:h("th",null,"Id"),h("th",null,u))),h("tbody",null,O(l.useValueIds(e),(l=>h("tr",{key:l},!1===r?null:h("th",null,l),h("td",null,h(n,L(F({},S(s,l)),{valueId:l,store:e}))))))))},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("../ui-react/index.js"),require("react")):"function"==typeof define&&define.amd?define(["exports","../ui-react","react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.TinyBaseUiReact,e.React);
|
|
Binary file
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,
|
|
1
|
+
var e,l;e=this,l=function(e,l,t){"use strict";const n=e=>typeof e,s=n(""),a=n(!0),o=n(0),u="Value",r="currentTarget",i="value",d=Math.min,c=isFinite,m=e=>null==e,b=(e,l,t,n)=>e==s?l:e==o?t:n,{PureComponent:I,Fragment:C,createContext:p,createElement:h,useCallback:y,useContext:f,useEffect:g,useLayoutEffect:v,useMemo:w,useRef:T,useState:R,useSyncExternalStore:k}=t,S=(e,...l)=>m(e)?{}:e(...l),O=(e,l)=>e.map(l),N=Object,V=N.entries,x=(e=[])=>N.fromEntries(e),q=(e,l)=>O(V(e),(([e,t])=>l(t,e)));var P=Object.defineProperty,j=Object.defineProperties,E=Object.getOwnPropertyDescriptors,H=Object.getOwnPropertySymbols,B=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,D=(e,l,t)=>l in e?P(e,l,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[l]=t,F=(e,l)=>{for(var t in l||(l={}))B.call(l,t)&&D(e,t,l[t]);if(H)for(var t of H(l))A.call(l,t)&&D(e,t,l[t]);return e},L=(e,l)=>j(e,E(l)),M=(e,l)=>{var t={};for(var n in e)B.call(e,n)&&l.indexOf(n)<0&&(t[n]=e[n]);if(null!=e&&H)for(var n of H(e))l.indexOf(n)<0&&A.call(e,n)&&(t[n]=e[n]);return t};const U="editable",$=(e,t)=>O(l.useTableCellIds(e,t),(l=>e+"."+l)),z=(e,l,t)=>{const n=y(e,l);return t?n:void 0},G=(...e)=>w((()=>e),e),J=(e,l)=>w((()=>({store:e,tableId:l})),[e,l]),K=(e,l)=>w((()=>({queries:e,queryId:l})),[e,l]),Q=(e,l=!1,t,n=0,s,a,o,u)=>{const[[r,i,d],c]=R([e,l,n]),m=y((e=>{c(e),null==u||u(e)}),[u]),b=z((e=>m([e,e==r&&!i,d])),[m,r,i,d],t),I=y((e=>m([r,i,e])),[m,r,i]),C=!0===o?te:o;return[[r,i,d],b,w((()=>!1===o?null:h(C,{offset:d,limit:s,total:a,onChange:I})),[o,C,d,s,a,I])]},W=(e,l,t)=>w((()=>{const a=null!=l?l:e;return o=Array.isArray(a)?x(O(a,(e=>[e,e]))):a,u=(e,l)=>F(F({},{label:l,component:t}),n(e)==s?{label:e}:e),x(q(o,((e,l)=>[l,u(e,l)])));var o,u}),[l,t,e]),X=({className:e,headerRow:l,idColumn:t,params:[n,s,a,o,u,r]})=>h("table",{className:e},r?h("caption",null,r):null,!1===l?null:h("thead",null,h("tr",null,!1===t?null:h(Y,{sort:null!=o?o:[],label:"Id",onClick:u}),q(n,(({label:e},l)=>h(Y,{key:l,cellId:l,label:e,sort:null!=o?o:[],onClick:u}))))),h("tbody",null,O(a,(e=>h("tr",{key:e},!1===t?null:h("th",null,e),q(n,(({component:l,getComponentProps:t},n)=>h("td",{key:n},h(l,L(F(F({},S(t,e,n)),s),{rowId:e,cellId:n})))))))))),Y=({cellId:e,sort:[l,t],label:n=(null!=e?e:""),onClick:s})=>h("th",{onClick:z((()=>null==s?void 0:s(e)),[s,e],s),className:m(t)||l!=e?void 0:`sorted ${t?"de":"a"}scending`},m(t)||l!=e?null:(t?"↓":"↑")+" ",n),Z=({localRowId:e,params:[t,n,s,a,o,u,r]})=>{const i=l.useRemoteRowId(o,e,u);return h("tr",null,!1===t?null:h(C,null,h("th",null,e),h("th",null,i)),q(n,(({component:l,getComponentProps:t},n)=>{const[o,u]=((e,l="",t)=>e.split(l,t))(n,".",2),d=o===s?e:o===a?i:null;return m(d)?null:h("td",{key:n},h(l,L(F({},S(t,d,u)),{store:r,tableId:o,rowId:d,cellId:u})))})))},_=({thing:e,onThingChange:l,className:t,hasSchema:u,showType:d=!0})=>{const[m,I]=R(),[C,p]=R(),[f,g]=R(),[v,w]=R(),[T,k]=R();C!==e&&(I((e=>{const l=n(e);return(e=>e==s||e==a)(l)||l==o&&c(e)?l:void 0})(e)),p(e),g(e+""),w(Number(e)||0),k(!!e));const S=y(((e,t)=>{t(e),p(e),l(e)}),[l]),O=y((()=>{if(!(null==u?void 0:u())){const e=b(m,o,a,s),t=b(e,f,v,T);I(e),p(t),l(t)}}),[u,l,f,v,T,m]);return h("div",{className:t},d?h("button",{className:m,onClick:O},m):null,b(m,h("input",{key:m,value:f,onChange:y((e=>S(e[r][i]+"",g)),[S])}),h("input",{key:m,type:"number",value:v,onChange:y((e=>S(Number(e[r][i]||0),w)),[S])}),h("input",{key:m,type:"checkbox",checked:T,onChange:y((e=>S(!!e[r].checked,k)),[S])})))},ee=({tableId:e,rowId:t,cellId:n,store:s,className:a,showType:o})=>{var u;return h(_,{thing:l.useCell(e,t,n,s),onThingChange:l.useSetCellCallback(e,t,n,(e=>e),[],s),className:null!=a?a:U+"Cell",showType:o,hasSchema:null==(u=l.useStoreOrStoreById(s))?void 0:u.hasTablesSchema})},le=({valueId:e,store:t,className:n,showType:s})=>{var a;return h(_,{thing:l.useValue(e,t),onThingChange:l.useSetValueCallback(e,(e=>e),[],t),className:null!=n?n:U+u,showType:s,hasSchema:null==(a=l.useStoreOrStoreById(t))?void 0:a.hasValuesSchema})},te=({onChange:e,total:l,offset:t=0,limit:n=l,singular:s="row",plural:a=s+"s"})=>{(t>l||t<0)&&(t=0,e(0));const o=z((()=>e(t-n)),[e,t,n],t>0),u=z((()=>e(t+n)),[e,t,n],t+n<l);return h(C,null,l>n&&h(C,null,h("button",{className:"previous",disabled:0==t,onClick:o},"←"),h("button",{className:"next",disabled:t+n>=l,onClick:u},"→"),t+1," to ",d(l,t+n)," of "),l," ",1!=l?a:s)};e.EditableCellView=ee,e.EditableValueView=le,e.RelationshipInHtmlTable=({relationshipId:e,relationships:t,editable:n,customCells:s,className:a,headerRow:o,idColumn:u=!0})=>{const[r,i,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getLocalTableId(l),null==e?void 0:e.getRemoteTableId(l)])(l.useRelationshipsOrRelationshipsById(t),e),m=W([...$(d,i),...$(c,i)],s,n?ee:l.CellView),b=G(u,m,d,c,e,r,i);return h("table",{className:a},!1===o?null:h("thead",null,h("tr",null,!1===u?null:h(C,null,h("th",null,d,".Id"),h("th",null,c,".Id")),q(m,(({label:e},l)=>h("th",{key:l},e))))),h("tbody",null,O(l.useRowIds(d,i),(e=>h(Z,{key:e,localRowId:e,params:b})))))},e.ResultSortedTableInHtmlTable=e=>{var t=e,{queryId:n,cellId:s,descending:a,offset:o,limit:u,queries:r,sortOnClick:i,paginator:d=!1,customCells:c,onChange:m}=t,b=M(t,["queryId","cellId","descending","offset","limit","queries","sortOnClick","paginator","customCells","onChange"]);const[I,C,p]=Q(s,a,i,o,u,l.useResultRowCount(n,r),d,m);return h(X,L(F({},b),{params:G(W(l.useResultTableCellIds(n,r),c,l.ResultCellView),K(r,n),l.useResultSortedRowIds(n,...I,u,r),I,C,p)}))},e.ResultTableInHtmlTable=e=>{var t=e,{queryId:n,queries:s,customCells:a}=t,o=M(t,["queryId","queries","customCells"]);return h(X,L(F({},o),{params:G(W(l.useResultTableCellIds(n,s),a,l.ResultCellView),K(s,n),l.useResultRowIds(n,s))}))},e.SliceInHtmlTable=e=>{var t=e,{indexId:n,sliceId:s,indexes:a,editable:o,customCells:u}=t,r=M(t,["indexId","sliceId","indexes","editable","customCells"]);const[i,d,c]=((e,l)=>[e,null==e?void 0:e.getStore(),null==e?void 0:e.getTableId(l)])(l.useIndexesOrIndexesById(a),n);return h(X,L(F({},r),{params:G(W(l.useTableCellIds(c,d),u,o?ee:l.CellView),J(d,c),l.useSliceRowIds(n,s,i))}))},e.SortedTableInHtmlTable=e=>{var t=e,{tableId:n,cellId:s,descending:a,offset:o,limit:u,store:r,editable:i,sortOnClick:d,paginator:c=!1,onChange:m,customCells:b}=t,I=M(t,["tableId","cellId","descending","offset","limit","store","editable","sortOnClick","paginator","onChange","customCells"]);const[C,p,y]=Q(s,a,d,o,u,l.useRowCount(n,r),c,m);return h(X,L(F({},I),{params:G(W(l.useTableCellIds(n,r),b,i?ee:l.CellView),J(r,n),l.useSortedRowIds(n,...C,u,r),C,p,y)}))},e.SortedTablePaginator=te,e.TableInHtmlTable=e=>{var t=e,{tableId:n,store:s,editable:a,customCells:o}=t,u=M(t,["tableId","store","editable","customCells"]);return h(X,L(F({},u),{params:G(W(l.useTableCellIds(n,s),o,a?ee:l.CellView),J(s,n),l.useRowIds(n,s))}))},e.ValuesInHtmlTable=({store:e,editable:t=!1,valueComponent:n=(t?le:l.ValueView),getValueComponentProps:s,className:a,headerRow:o,idColumn:r})=>h("table",{className:a},!1===o?null:h("thead",null,h("tr",null,!1===r?null:h("th",null,"Id"),h("th",null,u))),h("tbody",null,O(l.useValueIds(e),(l=>h("tr",{key:l},!1===r?null:h("th",null,l),h("td",null,h(n,L(F({},S(s,l)),{valueId:l,store:e}))))))))},"object"==typeof exports&&"undefined"!=typeof module?l(exports,require("../../ui-react/with-schemas/index.js"),require("react")):"function"==typeof define&&define.amd?define(["exports","../ui-react","react"],l):l((e="undefined"!=typeof globalThis?globalThis:e||self).TinyBaseUiReactDom={},e.TinyBaseUiReact,e.React);
|
|
Binary file
|