@hiai-gg/docsmint 2.2.3 → 2.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -8
- package/dist/backend/index.js +60080 -40793
- package/dist/frontend/CategoryDialog-CtBDBrmR.js +603 -0
- package/dist/frontend/ConfirmDialog-B7rUgX7M.js +219 -0
- package/dist/frontend/CreateSnapshotDialog-bUKdc0Zb.js +219 -0
- package/dist/frontend/DatePicker-CKTDDpVx.js +291 -0
- package/dist/frontend/DeleteDialog-D28HGxN7.js +175 -0
- package/dist/frontend/FolderNode-CVd22MJS.js +291 -0
- package/dist/frontend/FolderTreeSelector-DObSptCD.js +102 -0
- package/dist/frontend/HiAiEditor--V0-gKwv.js +3266 -0
- package/dist/frontend/HiaiDocsExtensionProvider-B1bCAtpa.js +13 -0
- package/dist/frontend/{Icon-CiHcxcpv.js → Icon-DNapb_KY.js} +3 -2
- package/dist/frontend/SettingsDialog-CN-PrNpM.js +979 -0
- package/dist/frontend/ShareDialog-UO_6vvoT.js +272 -0
- package/dist/frontend/Sidebar-CAxrqTAQ.js +2169 -0
- package/dist/frontend/TagCreateDialog-BdWu4bPX.js +268 -0
- package/dist/frontend/{action_cancel-BdsWzQKU.js → action_cancel-DxbRD-bG.js} +1 -1
- package/dist/frontend/{action_close-CVhfLPRQ.js → action_close-Ct6lVumm.js} +1 -1
- package/dist/frontend/{action_create-ByaroO1_.js → action_create-DKOlnVyX.js} +1 -1
- package/dist/frontend/{action_delete-SRloglWY.js → action_delete-DRb7fBnB.js} +1 -1
- package/dist/frontend/{action_go_to-DO1bicF-.js → action_go_to-D0fF5t1d.js} +1 -1
- package/dist/frontend/{action_loading-iQ0KsN6i.js → action_loading-YGvDyzYG.js} +1 -1
- package/dist/frontend/{action_save-DeqrZQwV.js → action_save-BHYTeFmm.js} +1 -1
- package/dist/frontend/api/categories.js +1 -1
- package/dist/frontend/api/settings.js +1 -1
- package/dist/frontend/api/tags.js +1 -1
- package/dist/frontend/app-shell.js +177 -176
- package/dist/frontend/{auth-client-Dx7d9Tzo.js → auth-client-DahfoSYo.js} +297 -277
- package/dist/frontend/{bundle-mjs-clTO1WW-.js → bundle-mjs-654jE5XN.js} +397 -300
- package/dist/frontend/{camera-DsdOPOcD.js → camera-C6JuKKhr.js} +9 -8
- package/dist/frontend/{categories-CusvHb5Y.js → categories-CUfKlgrs.js} +1 -1
- package/dist/frontend/{categories_update_error-Cn8DBBHv.js → categories_update_error-BrLD-j9s.js} +1 -1
- package/dist/frontend/check-B_e1XqT2.js +25 -0
- package/dist/frontend/chevron-down-BsnN2mp2.js +25 -0
- package/dist/frontend/circle-check-CJH5zxd9.js +29 -0
- package/dist/frontend/clock-CU0gCiiM.js +29 -0
- package/dist/frontend/collaboration.js +113 -113
- package/dist/frontend/components/category-dialog.js +1 -1
- package/dist/frontend/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend/components/delete-dialog.js +1 -1
- package/dist/frontend/components/editor/compact-editor.js +5 -4
- package/dist/frontend/components/editor/document-editor.js +1 -1
- package/dist/frontend/components/editor/document-title.js +3 -2
- package/dist/frontend/components/editor/docx-serializer.js +8359 -12358
- package/dist/frontend/components/editor/extensions.js +1 -1
- package/dist/frontend/components/editor/markdown-toggle.js +33 -32
- package/dist/frontend/components/editor/markdown.js +1 -1
- package/dist/frontend/components/folder-node.js +1 -1
- package/dist/frontend/components/folder-tree-selector.js +1 -1
- package/dist/frontend/components/save-as-dialog.js +168 -167
- package/dist/frontend/components/settings.js +1 -1
- package/dist/frontend/components/share-dialog.js +1 -1
- package/dist/frontend/components/sidebar.js +1 -1
- package/dist/frontend/components/tag-create-dialog.js +1 -1
- package/dist/frontend/components/version-history.js +252 -251
- package/dist/frontend/{copy-Bag46YaR.js → copy-DYNRCHgk.js} +9 -8
- package/dist/frontend/dashboard.js +1301 -1300
- package/dist/frontend/db-yN0Vve_2.js +4296 -0
- package/dist/frontend/{dialog-C0Bpok1d.js → dialog-Dqp04jso.js} +11 -10
- package/dist/frontend/dist-4xBCgXNT.js +40 -0
- package/dist/frontend/{dist-DjId3RKL.js → dist-BaAULhmK.js} +3 -9
- package/dist/frontend/dist-C1oIyJLI.js +302 -0
- package/dist/frontend/dndzone-CWg1kmdZ.js +1483 -0
- package/dist/frontend/{doc_title_label-BOuZzvqv.js → doc_title_label-BPlghiRM.js} +1 -1
- package/dist/frontend/{doc_title_placeholder-ZxpdWWEn.js → doc_title_placeholder-D-LfSoC5.js} +1 -1
- package/dist/frontend/dropdown-menu-HePwCxoQ.js +1429 -0
- package/dist/frontend/{editorExtensions-DbiFj4tn.js → editorExtensions-QKIFSqEG.js} +9 -9
- package/dist/frontend/{editor_markdown_placeholder-BztIY9Ci.js → editor_markdown_placeholder-BXRPm7JG.js} +1 -1
- package/dist/frontend/{ellipsis-vertical-Oymsv1R4.js → ellipsis-vertical-CR25MyeP.js} +9 -8
- package/dist/frontend/{error_dismiss-C651ZdWI.js → error_dismiss-Ckia7GQe.js} +1 -1
- package/dist/frontend/{error_generic-BlWqOE-a.js → error_generic-gyQMdET_.js} +1 -1
- package/dist/frontend/extension.js +1 -1
- package/dist/frontend/{folder-BpmB_sAy.js → folder-BpA690ie.js} +4 -3
- package/dist/frontend/{folders_rename-Cxbg5GIw.js → folders_rename-BHa_gSXw.js} +1 -1
- package/dist/frontend/frontend.css +1 -1
- package/dist/frontend/i18n.js +29 -29
- package/dist/frontend/{identity-B7HeOzDJ.js → identity-ndFYB8Nt.js} +1 -1
- package/dist/frontend/{input-CbeB9220.js → input-Cv3qF4J3.js} +9 -8
- package/dist/frontend/label-DXjefKfF.js +30 -0
- package/dist/frontend/{lib-CITdCbKa.js → lib-DJthN0w9.js} +7108 -5196
- package/dist/frontend/loader-circle-CvWX1HHL.js +25 -0
- package/dist/frontend/{markdown-6E9TWC6V.js → markdown-CksQVQ6a.js} +2 -2
- package/dist/frontend/offline/identity.js +1 -1
- package/dist/frontend/popper-layer-force-mount-DS--Cvfo.js +3493 -0
- package/dist/frontend/rolldown-runtime-DKYsOz5J.js +19 -0
- package/dist/frontend/{rotate-ccw-DAUX7np7.js → rotate-ccw-Box7QP5X.js} +9 -8
- package/dist/frontend/{runtime-CGUiMzK6.js → runtime-CJv8UGYl.js} +1 -4
- package/dist/frontend/{schemas-YXxhj5o8.js → schemas-BYbeR0Ky.js} +11 -11
- package/dist/frontend/{scroll_to_top_aria-lJc2RSx_.js → scroll_to_top_aria-CP7_oyCo.js} +1 -1
- package/dist/frontend/search.js +650 -649
- package/dist/frontend/{search_title-BETwQYJq.js → search_title-C2aOzN_J.js} +1 -1
- package/dist/frontend/select-value-DAMTi0zc.js +1473 -0
- package/dist/frontend/{settings-DyePuqjp.js → settings-DTsCVJEi.js} +1 -1
- package/dist/frontend/{share-context-C2xyVP9M.js → share-context-CtRMIIhL.js} +15 -14
- package/dist/frontend/{share_copied-BuAnmpbz.js → share_copied-BHb_9sOo.js} +1 -1
- package/dist/frontend/{share_toggle_password-LEYUeHWr.js → share_toggle_password-DjCMq4Eq.js} +1 -1
- package/dist/frontend/shared-document.js +49 -48
- package/dist/frontend/{sidebar_uncategorized-C5PGOflV.js → sidebar_uncategorized-BJSB_sc9.js} +1 -1
- package/dist/frontend/{sort_relevance-DpCVLby_.js → sort_relevance-CXuNTq6L.js} +1 -1
- package/dist/frontend/{tag-Wdfe0rKU.js → tag-BPOFgBQw.js} +4 -3
- package/dist/frontend/tag-store.svelte-DyqQNx7H.js +28 -0
- package/dist/frontend/{tags-DlDVothf.js → tags-DwilrkrM.js} +1 -1
- package/dist/frontend/{tags_load_error-BINNpPPV.js → tags_load_error-BOyuQEGc.js} +1 -1
- package/dist/frontend/{tags_new-Dw0Uy43-.js → tags_new-CGF3Hi1j.js} +1 -1
- package/dist/frontend/textarea-DDdgNvnf.js +23 -0
- package/dist/frontend/theme.js +1 -1
- package/dist/frontend/{theme.svelte-BiXvrqwh.js → theme.svelte-Dx01qWc3.js} +2 -2
- package/dist/frontend/{theme_system-YIfa_2Xt.js → theme_system-Bt9ItDgj.js} +1 -1
- package/dist/frontend/utils/dndzone.js +1 -1
- package/dist/frontend/{utils-CnAmIMwr.js → utils-BQMesoNf.js} +1 -1
- package/dist/frontend/utils-BavN35Bw.js +6 -0
- package/dist/frontend/utils.js +1 -1
- package/dist/frontend/{version_create_snapshot-D8xjbuCq.js → version_create_snapshot-BvoOuUeh.js} +1 -1
- package/dist/frontend/{version_restored_from-DYFFSuQj.js → version_restored_from-BIEEKFbx.js} +1 -1
- package/dist/frontend/{version_snapshot_label_placeholder-BhKq1NQ7.js → version_snapshot_label_placeholder-h9r2_0u3.js} +1 -1
- package/dist/frontend/{weekday_we-BxbzNVWR.js → weekday_we-DsuVW6rh.js} +1 -1
- package/dist/frontend/x-hIpDH7DU.js +25 -0
- package/dist/frontend/{yjs-BbwnvxgY.js → yjs--VgxqIlB.js} +607 -628
- package/dist/frontend-ssr/api/categories.js +1 -1
- package/dist/frontend-ssr/api/settings.js +1 -1
- package/dist/frontend-ssr/api/tags.js +1 -1
- package/dist/frontend-ssr/app-shell.js +11 -11
- package/dist/frontend-ssr/assets/{CategoryDialog-2CCX508O.js → CategoryDialog-DRItbO_9.js} +13 -13
- package/dist/frontend-ssr/assets/{ConfirmDialog-Cc6lcY1N.js → ConfirmDialog-B0NXRrel.js} +8 -8
- package/dist/frontend-ssr/assets/{CreateSnapshotDialog-BB8fXF9W.js → CreateSnapshotDialog-nj8PjuON.js} +7 -7
- package/dist/frontend-ssr/assets/{DatePicker-CfzKzipR.js → DatePicker-CdUKLPtP.js} +8 -8
- package/dist/frontend-ssr/assets/{DeleteDialog-DRU4UgOW.js → DeleteDialog-B83NoxAg.js} +3 -3
- package/dist/frontend-ssr/assets/{FolderNode-CyOrLJ2Y.js → FolderNode-CSeC3051.js} +10 -10
- package/dist/frontend-ssr/assets/{FolderTreeSelector-D0reTdFS.js → FolderTreeSelector-Dh-ViJPU.js} +4 -4
- package/dist/frontend-ssr/assets/{HiAiEditor-BQGlGd3z.js → HiAiEditor-DB2PjHm9.js} +41 -41
- package/dist/frontend-ssr/assets/{Icon-CrIRbT5O.js → Icon-CBEeswQ2.js} +4 -4
- package/dist/frontend-ssr/assets/{SettingsDialog-BpHY3IMb.js → SettingsDialog-kc3O9PXG.js} +21 -21
- package/dist/frontend-ssr/assets/{ShareDialog-CY40nWZJ.js → ShareDialog-Dmrj55QP.js} +4 -4
- package/dist/frontend-ssr/assets/{Sidebar-dTp4DyW4.js → Sidebar-CDQcIuyv.js} +45 -45
- package/dist/frontend-ssr/assets/{TagCreateDialog-C2tpdEuj.js → TagCreateDialog-CP-yYfpQ.js} +11 -11
- package/dist/frontend-ssr/assets/{action_cancel-CsBbxW0m.js → action_cancel-B8i5P3wt.js} +1 -1
- package/dist/frontend-ssr/assets/{action_close-lFKBqBwg.js → action_close-DPgIB-cY.js} +1 -1
- package/dist/frontend-ssr/assets/{action_create-BV4ZOcQW.js → action_create-DAlNPFeN.js} +1 -1
- package/dist/frontend-ssr/assets/{action_delete-CNmRhKQP.js → action_delete-C6lsQCtY.js} +1 -1
- package/dist/frontend-ssr/assets/{action_go_to-tN5I26xM.js → action_go_to-C6tegi-k.js} +1 -1
- package/dist/frontend-ssr/assets/{action_save-YCfMiKb4.js → action_save-BQCej1sh.js} +1 -1
- package/dist/frontend-ssr/assets/{auth-client-BnnnJDAb.js → auth-client-CwXGsJIQ.js} +44 -38
- package/dist/frontend-ssr/assets/{camera-OYNSMvMd.js → camera-kjjsHmQu.js} +2 -2
- package/dist/frontend-ssr/assets/{categories_update_error-Bfx5vtvt.js → categories_update_error-Kq8q_FJp.js} +1 -1
- package/dist/frontend-ssr/assets/{chevron-down-DB6YsSbQ.js → chevron-down-DPc-Owbl.js} +2 -2
- package/dist/frontend-ssr/assets/{chevron-right-DOt2uY6b.js → chevron-right-C-jY4mqk.js} +2 -2
- package/dist/frontend-ssr/assets/{circle-check-DQhTm9YR.js → circle-check-CnueRXrc.js} +2 -2
- package/dist/frontend-ssr/assets/{clock-B08dVWtf.js → clock-CoRtIDhT.js} +2 -2
- package/dist/frontend-ssr/assets/{copy-2jsznHar.js → copy-CDNZIGVg.js} +2 -2
- package/dist/frontend-ssr/assets/{db-BEKLU5Fc.js → db-NhMsSg1f.js} +1 -1
- package/dist/frontend-ssr/assets/{dialog-C6U-DqLr.js → dialog-B09MN2S-.js} +9 -9
- package/dist/frontend-ssr/assets/{dist-DqXTz_zE.js → dist-D4MAfF0i.js} +13 -13
- package/dist/frontend-ssr/assets/{dist-ip9bPdma.js → dist-cDG_u5EF.js} +8 -8
- package/dist/frontend-ssr/assets/{dndzone-C7KnICM0.js → dndzone-DyM8UtoT.js} +378 -216
- package/dist/frontend-ssr/assets/{doc_title_label-CE_l-Gum.js → doc_title_label-BqCuH3eY.js} +1 -1
- package/dist/frontend-ssr/assets/{doc_title_placeholder-7_i7PtG6.js → doc_title_placeholder-C3tGSpRB.js} +1 -1
- package/dist/frontend-ssr/assets/dropdown-menu-C9H45F9X.js +1721 -0
- package/dist/frontend-ssr/assets/{editor_markdown_placeholder-CAeLJjFT.js → editor_markdown_placeholder-Cxa5uq87.js} +1 -1
- package/dist/frontend-ssr/assets/{editor_toolbar_undo-CVCfQIS1.js → editor_toolbar_undo-D-gLz88j.js} +1 -1
- package/dist/frontend-ssr/assets/{ellipsis-vertical-IFHt2NM1.js → ellipsis-vertical-oBvMj3Jm.js} +2 -2
- package/dist/frontend-ssr/assets/{error_generic-BB80i0Vk.js → error_generic-BSoVZ_4p.js} +1 -1
- package/dist/frontend-ssr/assets/{folder-CXa1_bm5.js → folder-Ptjeaody.js} +2 -2
- package/dist/frontend-ssr/assets/{folders_rename-ydbfwQlj.js → folders_rename-DBtQcf2R.js} +1 -1
- package/dist/frontend-ssr/assets/{identity-DTz1SQwC.js → identity-CigCqYEA.js} +1 -1
- package/dist/frontend-ssr/assets/{input-Bxw9sFF0.js → input-Cc45dG_S.js} +2 -2
- package/dist/frontend-ssr/assets/{label-CMWedjs6.js → label-C1_J2397.js} +2 -2
- package/dist/frontend-ssr/assets/{loader-circle-zbKj9Qb-.js → loader-circle-CK3McH5n.js} +2 -2
- package/dist/frontend-ssr/assets/{markdown-BmIhDQp7.js → markdown-WQsa_gay.js} +1 -1
- package/dist/frontend-ssr/assets/{popper-layer-force-mount-CSHZsG2E.js → popper-layer-force-mount-CGKwdZaZ.js} +1448 -2402
- package/dist/frontend-ssr/assets/{rotate-ccw-B7SaTFWf.js → rotate-ccw-B1lCxJ5d.js} +2 -2
- package/dist/frontend-ssr/assets/{runtime-BX6-jTn_.js → runtime-CoxALrm1.js} +2 -28
- package/dist/frontend-ssr/assets/{scroll_to_top_aria-CAYSiGHO.js → scroll_to_top_aria-CmLwsPln.js} +1 -1
- package/dist/frontend-ssr/assets/{search_title-C7NVXXq3.js → search_title-CZIl0wkq.js} +1 -1
- package/dist/frontend-ssr/assets/{search_toggle_filters-Bq_YVD8s.js → search_toggle_filters-BG-CRM9G.js} +1 -1
- package/dist/frontend-ssr/assets/{select-value-TgslfiUB.js → select-value-BeUHHkLq.js} +157 -66
- package/dist/frontend-ssr/assets/{settings-B1MA_FjO.js → settings-BqyemuQv.js} +1 -1
- package/dist/frontend-ssr/assets/{share-context-RVh8AExX.js → share-context-BM1sUnlP.js} +15 -15
- package/dist/frontend-ssr/assets/{share_copied-CrwEwkb3.js → share_copied-BVGtm9Ud.js} +1 -1
- package/dist/frontend-ssr/assets/{share_toggle_password-Co56z0Ha.js → share_toggle_password-z0gwy0TG.js} +1 -1
- package/dist/frontend-ssr/assets/{sidebar_uncategorized-COWdmZ3d.js → sidebar_uncategorized-rpbsgLVr.js} +1 -1
- package/dist/frontend-ssr/assets/{tag-BGhtDKpP.js → tag-D_ZqINN3.js} +3 -3
- package/dist/frontend-ssr/assets/{tags_load_error-DW4FbHvr.js → tags_load_error-DvhlyMMY.js} +1 -1
- package/dist/frontend-ssr/assets/{tags_new-Dr3ByMPZ.js → tags_new-DStxzBII.js} +1 -1
- package/dist/frontend-ssr/assets/{textarea-Bz5Tz4rw.js → textarea-S9uzw6je.js} +2 -2
- package/dist/frontend-ssr/assets/{theme.svelte-CdHah46l.js → theme.svelte-CqAzqvik.js} +2 -2
- package/dist/frontend-ssr/assets/{theme_system-E97FASeq.js → theme_system-DjbsL0RQ.js} +1 -1
- package/dist/frontend-ssr/assets/{utils-DF6CmRDX.js → utils-DF93j6z-.js} +1 -1
- package/dist/frontend-ssr/assets/{version_create_snapshot-DeeYB7bb.js → version_create_snapshot-SwYsTZ56.js} +1 -1
- package/dist/frontend-ssr/assets/{version_restored_from-CTt2LM4A.js → version_restored_from-pYBnudye.js} +1 -1
- package/dist/frontend-ssr/assets/{version_snapshot_label_placeholder-BbGD9YuN.js → version_snapshot_label_placeholder-DtDnHip8.js} +1 -1
- package/dist/frontend-ssr/assets/{weekday_we-BzGQ-iFc.js → weekday_we-CV1TMROW.js} +1 -1
- package/dist/frontend-ssr/components/category-dialog.js +1 -1
- package/dist/frontend-ssr/components/create-snapshot-dialog.js +1 -1
- package/dist/frontend-ssr/components/delete-dialog.js +1 -1
- package/dist/frontend-ssr/components/editor/compact-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-editor.js +1 -1
- package/dist/frontend-ssr/components/editor/document-title.js +2 -2
- package/dist/frontend-ssr/components/editor/extensions.js +1 -1
- package/dist/frontend-ssr/components/editor/markdown-toggle.js +3 -3
- package/dist/frontend-ssr/components/editor/markdown.js +1 -1
- package/dist/frontend-ssr/components/folder-node.js +1 -1
- package/dist/frontend-ssr/components/folder-tree-selector.js +1 -1
- package/dist/frontend-ssr/components/save-as-dialog.js +10 -10
- package/dist/frontend-ssr/components/settings.js +1 -1
- package/dist/frontend-ssr/components/share-dialog.js +1 -1
- package/dist/frontend-ssr/components/sidebar.js +1 -1
- package/dist/frontend-ssr/components/tag-create-dialog.js +1 -1
- package/dist/frontend-ssr/components/version-history.js +17 -17
- package/dist/frontend-ssr/dashboard.js +61 -158
- package/dist/frontend-ssr/extension.js +1 -1
- package/dist/frontend-ssr/i18n.js +31 -31
- package/dist/frontend-ssr/offline/identity.js +1 -1
- package/dist/frontend-ssr/search.js +13 -13
- package/dist/frontend-ssr/shared-document.js +1 -1
- package/dist/frontend-ssr/theme.js +1 -1
- package/dist/frontend-ssr/utils/dndzone.js +1 -1
- package/dist/lifecycle-runtime.js +17768 -11203
- package/dist/mcp-cli.js +1 -1
- package/dist/mcp-server.js +1 -1
- package/package.json +13 -13
- package/packages/cli/src/index.ts +1 -1
- package/server.json +2 -2
- package/dist/frontend/CategoryDialog-CVJi5PJu.js +0 -602
- package/dist/frontend/ConfirmDialog-0JwB8mKN.js +0 -218
- package/dist/frontend/CreateSnapshotDialog-BLrtuYs5.js +0 -218
- package/dist/frontend/DatePicker-BwSb8TRv.js +0 -326
- package/dist/frontend/DeleteDialog-s7Dr6bXg.js +0 -174
- package/dist/frontend/FolderNode-Ds0LDfK3.js +0 -290
- package/dist/frontend/FolderTreeSelector-BR3lYmPU.js +0 -101
- package/dist/frontend/HiAiEditor-BHz46Iqd.js +0 -3078
- package/dist/frontend/HiaiDocsExtensionProvider-A2nGddUR.js +0 -12
- package/dist/frontend/SettingsDialog-BvS74JZu.js +0 -978
- package/dist/frontend/ShareDialog-Bo50h_Oe.js +0 -271
- package/dist/frontend/Sidebar-DerKtpWB.js +0 -2168
- package/dist/frontend/TagCreateDialog-DhKfsfv3.js +0 -267
- package/dist/frontend/check-DiMZRkKS.js +0 -24
- package/dist/frontend/chevron-down-CxFrMFDJ.js +0 -24
- package/dist/frontend/circle-check-B4F_qgPx.js +0 -28
- package/dist/frontend/clock-dcpueRk-.js +0 -28
- package/dist/frontend/db-B1ZV452J.js +0 -3792
- package/dist/frontend/dist-BlcV_BOY.js +0 -39
- package/dist/frontend/dist-Dl9qg10h.js +0 -301
- package/dist/frontend/dndzone-B9jA0yIS.js +0 -1372
- package/dist/frontend/dropdown-menu-B3nk2aM-.js +0 -482
- package/dist/frontend/label-CfBWf3gI.js +0 -29
- package/dist/frontend/loader-circle-skKwfRCB.js +0 -24
- package/dist/frontend/popper-layer-force-mount-BG0eyrCk.js +0 -4255
- package/dist/frontend/rolldown-runtime-CwxnZyOB.js +0 -22
- package/dist/frontend/select-value-BY5Hw6Rl.js +0 -1412
- package/dist/frontend/tag-store.svelte-C9VYWqLQ.js +0 -28
- package/dist/frontend/textarea-D6emvAwM.js +0 -22
- package/dist/frontend/utils-DH0uqK40.js +0 -6
- package/dist/frontend/x-CBUgPygC.js +0 -24
- package/dist/frontend-ssr/assets/dropdown-menu-BS5fcN9l.js +0 -446
- package/dist/frontend-ssr/assets/{HiaiDocsExtensionProvider-D6cGL-9s.js → HiaiDocsExtensionProvider-BdfQP817.js} +1 -1
- package/dist/frontend-ssr/assets/{categories-bBPviKjl.js → categories-CMmudpEk.js} +1 -1
- package/dist/frontend-ssr/assets/{editorExtensions-2O7O2Nhv.js → editorExtensions-DOPTTKUS.js} +2 -2
- package/dist/frontend-ssr/assets/{tag-store.svelte-CUUgAaDD.js → tag-store.svelte-Djpf1W0n.js} +1 -1
- package/dist/frontend-ssr/assets/{tags-C7u-LBsl.js → tags-GQOEtqET.js} +1 -1
|
@@ -0,0 +1,4296 @@
|
|
|
1
|
+
import { r as e, t } from "./rolldown-runtime-DKYsOz5J.js";
|
|
2
|
+
import { i as n } from "./identity-ndFYB8Nt.js";
|
|
3
|
+
// ../node_modules/.bun/dexie@4.4.7/node_modules/dexie/import-wrapper.mjs
|
|
4
|
+
var r = /* @__PURE__ */ e((/* @__PURE__ */ t(((e, t, n) => {
|
|
5
|
+
var r;
|
|
6
|
+
(function(n, i) {
|
|
7
|
+
typeof e == "object" && t !== void 0 ? t.exports = i() : typeof r == "function" && r.amd ? r(i) : (n = typeof globalThis < "u" ? globalThis : n || self, n.Dexie = i());
|
|
8
|
+
})(n, (function() {
|
|
9
|
+
var e = function(t, n) {
|
|
10
|
+
return e = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
|
|
11
|
+
e.__proto__ = t;
|
|
12
|
+
} || function(e, t) {
|
|
13
|
+
for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
|
|
14
|
+
}, e(t, n);
|
|
15
|
+
};
|
|
16
|
+
function t(t, n) {
|
|
17
|
+
if (typeof n != "function" && n !== null) throw TypeError("Class extends value " + String(n) + " is not a constructor or null");
|
|
18
|
+
e(t, n);
|
|
19
|
+
function r() {
|
|
20
|
+
this.constructor = t;
|
|
21
|
+
}
|
|
22
|
+
t.prototype = n === null ? Object.create(n) : (r.prototype = n.prototype, new r());
|
|
23
|
+
}
|
|
24
|
+
var n = function() {
|
|
25
|
+
return n = Object.assign || function(e) {
|
|
26
|
+
for (var t, n = 1, r = arguments.length; n < r; n++) for (var i in t = arguments[n], t) Object.prototype.hasOwnProperty.call(t, i) && (e[i] = t[i]);
|
|
27
|
+
return e;
|
|
28
|
+
}, n.apply(this, arguments);
|
|
29
|
+
};
|
|
30
|
+
function r(e, t, n) {
|
|
31
|
+
if (n || arguments.length === 2) for (var r = 0, i = t.length, a; r < i; r++) (a || !(r in t)) && (a ||= Array.prototype.slice.call(t, 0, r), a[r] = t[r]);
|
|
32
|
+
return e.concat(a || Array.prototype.slice.call(t));
|
|
33
|
+
}
|
|
34
|
+
var i = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, a = Object.keys, o = Array.isArray;
|
|
35
|
+
typeof Promise < "u" && !i.Promise && (i.Promise = Promise);
|
|
36
|
+
function s(e, t) {
|
|
37
|
+
return typeof t == "object" && a(t).forEach(function(n) {
|
|
38
|
+
e[n] = t[n];
|
|
39
|
+
}), e;
|
|
40
|
+
}
|
|
41
|
+
var c = Object.getPrototypeOf, l = {}.hasOwnProperty;
|
|
42
|
+
function u(e, t) {
|
|
43
|
+
return l.call(e, t);
|
|
44
|
+
}
|
|
45
|
+
function d(e, t) {
|
|
46
|
+
typeof t == "function" && (t = t(c(e))), (typeof Reflect > "u" ? a : Reflect.ownKeys)(t).forEach(function(n) {
|
|
47
|
+
p(e, n, t[n]);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
var f = Object.defineProperty;
|
|
51
|
+
function p(e, t, n, r) {
|
|
52
|
+
f(e, t, s(n && u(n, "get") && typeof n.get == "function" ? {
|
|
53
|
+
get: n.get,
|
|
54
|
+
set: n.set,
|
|
55
|
+
configurable: !0
|
|
56
|
+
} : {
|
|
57
|
+
value: n,
|
|
58
|
+
configurable: !0,
|
|
59
|
+
writable: !0
|
|
60
|
+
}, r));
|
|
61
|
+
}
|
|
62
|
+
function m(e) {
|
|
63
|
+
return { from: function(t) {
|
|
64
|
+
return e.prototype = Object.create(t.prototype), p(e.prototype, "constructor", e), { extend: d.bind(null, e.prototype) };
|
|
65
|
+
} };
|
|
66
|
+
}
|
|
67
|
+
var h = Object.getOwnPropertyDescriptor;
|
|
68
|
+
function g(e, t) {
|
|
69
|
+
var n = h(e, t), r;
|
|
70
|
+
return n || (r = c(e)) && g(r, t);
|
|
71
|
+
}
|
|
72
|
+
var _ = [].slice;
|
|
73
|
+
function v(e, t, n) {
|
|
74
|
+
return _.call(e, t, n);
|
|
75
|
+
}
|
|
76
|
+
function y(e, t) {
|
|
77
|
+
return t(e);
|
|
78
|
+
}
|
|
79
|
+
function b(e) {
|
|
80
|
+
if (!e) throw Error("Assertion Failed");
|
|
81
|
+
}
|
|
82
|
+
function x(e) {
|
|
83
|
+
i.setImmediate ? setImmediate(e) : setTimeout(e, 0);
|
|
84
|
+
}
|
|
85
|
+
function S(e, t) {
|
|
86
|
+
return e.reduce(function(e, n, r) {
|
|
87
|
+
var i = t(n, r);
|
|
88
|
+
return i && (e[i[0]] = i[1]), e;
|
|
89
|
+
}, {});
|
|
90
|
+
}
|
|
91
|
+
function C(e, t) {
|
|
92
|
+
if (typeof t == "string" && u(e, t)) return e[t];
|
|
93
|
+
if (!t) return e;
|
|
94
|
+
if (typeof t != "string") {
|
|
95
|
+
for (var n = [], r = 0, i = t.length; r < i; ++r) {
|
|
96
|
+
var a = C(e, t[r]);
|
|
97
|
+
n.push(a);
|
|
98
|
+
}
|
|
99
|
+
return n;
|
|
100
|
+
}
|
|
101
|
+
var o = t.indexOf(".");
|
|
102
|
+
if (o !== -1) {
|
|
103
|
+
var s = e[t.substr(0, o)];
|
|
104
|
+
return s == null ? void 0 : C(s, t.substr(o + 1));
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function w(e, t, n) {
|
|
108
|
+
if (e && t !== void 0 && !("isFrozen" in Object && Object.isFrozen(e))) {
|
|
109
|
+
if (typeof t != "string" && "length" in t) {
|
|
110
|
+
b(typeof n != "string" && "length" in n);
|
|
111
|
+
for (var r = 0, i = t.length; r < i; ++r) w(e, t[r], n[r]);
|
|
112
|
+
} else {
|
|
113
|
+
var a = t.indexOf(".");
|
|
114
|
+
if (a !== -1) {
|
|
115
|
+
var s = t.substr(0, a), c = t.substr(a + 1);
|
|
116
|
+
if (c === "") n === void 0 ? o(e) && !isNaN(parseInt(s)) ? e.splice(s, 1) : delete e[s] : e[s] = n;
|
|
117
|
+
else {
|
|
118
|
+
var l = e[s];
|
|
119
|
+
if (!l || !u(e, s)) {
|
|
120
|
+
if (n === void 0) return;
|
|
121
|
+
l = e[s] = {};
|
|
122
|
+
}
|
|
123
|
+
w(l, c, n);
|
|
124
|
+
}
|
|
125
|
+
} else n === void 0 ? o(e) && !isNaN(parseInt(t)) ? e.splice(t, 1) : delete e[t] : e[t] = n;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
function ee(e, t) {
|
|
130
|
+
typeof t == "string" ? w(e, t, void 0) : "length" in t && [].map.call(t, function(t) {
|
|
131
|
+
w(e, t, void 0);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function te(e) {
|
|
135
|
+
var t = {};
|
|
136
|
+
for (var n in e) u(e, n) && (t[n] = e[n]);
|
|
137
|
+
return t;
|
|
138
|
+
}
|
|
139
|
+
var ne = [].concat;
|
|
140
|
+
function re(e) {
|
|
141
|
+
return ne.apply([], e);
|
|
142
|
+
}
|
|
143
|
+
var ie = "BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(re([
|
|
144
|
+
8,
|
|
145
|
+
16,
|
|
146
|
+
32,
|
|
147
|
+
64
|
|
148
|
+
].map(function(e) {
|
|
149
|
+
return [
|
|
150
|
+
"Int",
|
|
151
|
+
"Uint",
|
|
152
|
+
"Float"
|
|
153
|
+
].map(function(t) {
|
|
154
|
+
return t + e + "Array";
|
|
155
|
+
});
|
|
156
|
+
}))).filter(function(e) {
|
|
157
|
+
return i[e];
|
|
158
|
+
}), ae = new Set(ie.map(function(e) {
|
|
159
|
+
return i[e];
|
|
160
|
+
}));
|
|
161
|
+
function oe(e) {
|
|
162
|
+
var t = {};
|
|
163
|
+
for (var n in e) if (u(e, n)) {
|
|
164
|
+
var r = e[n];
|
|
165
|
+
t[n] = !r || typeof r != "object" || ae.has(r.constructor) ? r : oe(r);
|
|
166
|
+
}
|
|
167
|
+
return t;
|
|
168
|
+
}
|
|
169
|
+
var se = null;
|
|
170
|
+
function T(e) {
|
|
171
|
+
se = /* @__PURE__ */ new WeakMap();
|
|
172
|
+
var t = ce(e);
|
|
173
|
+
return se = null, t;
|
|
174
|
+
}
|
|
175
|
+
function ce(e) {
|
|
176
|
+
if (!e || typeof e != "object") return e;
|
|
177
|
+
var t = se.get(e);
|
|
178
|
+
if (t) return t;
|
|
179
|
+
if (o(e)) {
|
|
180
|
+
t = [], se.set(e, t);
|
|
181
|
+
for (var n = 0, r = e.length; n < r; ++n) t.push(ce(e[n]));
|
|
182
|
+
} else if (ae.has(e.constructor)) t = e;
|
|
183
|
+
else {
|
|
184
|
+
var i = c(e);
|
|
185
|
+
for (var a in t = i === Object.prototype ? {} : Object.create(i), se.set(e, t), e) u(e, a) && (t[a] = ce(e[a]));
|
|
186
|
+
}
|
|
187
|
+
return t;
|
|
188
|
+
}
|
|
189
|
+
var le = {}.toString;
|
|
190
|
+
function ue(e) {
|
|
191
|
+
return le.call(e).slice(8, -1);
|
|
192
|
+
}
|
|
193
|
+
var de = typeof Symbol < "u" ? Symbol.iterator : "@@iterator", fe = typeof de == "symbol" ? function(e) {
|
|
194
|
+
var t;
|
|
195
|
+
return e != null && (t = e[de]) && t.apply(e);
|
|
196
|
+
} : function() {
|
|
197
|
+
return null;
|
|
198
|
+
};
|
|
199
|
+
function E(e, t) {
|
|
200
|
+
var n = e.indexOf(t);
|
|
201
|
+
return n >= 0 && e.splice(n, 1), n >= 0;
|
|
202
|
+
}
|
|
203
|
+
var pe = {};
|
|
204
|
+
function D(e) {
|
|
205
|
+
var t, n, r, i;
|
|
206
|
+
if (arguments.length === 1) {
|
|
207
|
+
if (o(e)) return e.slice();
|
|
208
|
+
if (this === pe && typeof e == "string") return [e];
|
|
209
|
+
if (i = fe(e)) {
|
|
210
|
+
for (n = []; r = i.next(), !r.done;) n.push(r.value);
|
|
211
|
+
return n;
|
|
212
|
+
}
|
|
213
|
+
if (e == null) return [e];
|
|
214
|
+
if (t = e.length, typeof t == "number") {
|
|
215
|
+
for (n = Array(t); t--;) n[t] = e[t];
|
|
216
|
+
return n;
|
|
217
|
+
}
|
|
218
|
+
return [e];
|
|
219
|
+
}
|
|
220
|
+
for (t = arguments.length, n = Array(t); t--;) n[t] = arguments[t];
|
|
221
|
+
return n;
|
|
222
|
+
}
|
|
223
|
+
var me = typeof Symbol < "u" ? function(e) {
|
|
224
|
+
return e[Symbol.toStringTag] === "AsyncFunction";
|
|
225
|
+
} : function() {
|
|
226
|
+
return !1;
|
|
227
|
+
}, he = [
|
|
228
|
+
"Modify",
|
|
229
|
+
"Bulk",
|
|
230
|
+
"OpenFailed",
|
|
231
|
+
"VersionChange",
|
|
232
|
+
"Schema",
|
|
233
|
+
"Upgrade",
|
|
234
|
+
"InvalidTable",
|
|
235
|
+
"MissingAPI",
|
|
236
|
+
"NoSuchDatabase",
|
|
237
|
+
"InvalidArgument",
|
|
238
|
+
"SubTransaction",
|
|
239
|
+
"Unsupported",
|
|
240
|
+
"Internal",
|
|
241
|
+
"DatabaseClosed",
|
|
242
|
+
"PrematureCommit",
|
|
243
|
+
"ForeignAwait"
|
|
244
|
+
], ge = [
|
|
245
|
+
"Unknown",
|
|
246
|
+
"Constraint",
|
|
247
|
+
"Data",
|
|
248
|
+
"TransactionInactive",
|
|
249
|
+
"ReadOnly",
|
|
250
|
+
"Version",
|
|
251
|
+
"NotFound",
|
|
252
|
+
"InvalidState",
|
|
253
|
+
"InvalidAccess",
|
|
254
|
+
"Abort",
|
|
255
|
+
"Timeout",
|
|
256
|
+
"QuotaExceeded",
|
|
257
|
+
"Syntax",
|
|
258
|
+
"DataClone"
|
|
259
|
+
], _e = he.concat(ge), ve = {
|
|
260
|
+
VersionChanged: "Database version changed by other database connection",
|
|
261
|
+
DatabaseClosed: "Database has been closed",
|
|
262
|
+
Abort: "Transaction aborted",
|
|
263
|
+
TransactionInactive: "Transaction has already completed or failed",
|
|
264
|
+
MissingAPI: "IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"
|
|
265
|
+
};
|
|
266
|
+
function ye(e, t) {
|
|
267
|
+
this.name = e, this.message = t;
|
|
268
|
+
}
|
|
269
|
+
m(ye).from(Error).extend({ toString: function() {
|
|
270
|
+
return this.name + ": " + this.message;
|
|
271
|
+
} });
|
|
272
|
+
function be(e, t) {
|
|
273
|
+
return e + ". Errors: " + Object.keys(t).map(function(e) {
|
|
274
|
+
return t[e].toString();
|
|
275
|
+
}).filter(function(e, t, n) {
|
|
276
|
+
return n.indexOf(e) === t;
|
|
277
|
+
}).join("\n");
|
|
278
|
+
}
|
|
279
|
+
function xe(e, t, n, r) {
|
|
280
|
+
this.failures = t, this.failedKeys = r, this.successCount = n, this.message = be(e, t);
|
|
281
|
+
}
|
|
282
|
+
m(xe).from(ye);
|
|
283
|
+
function Se(e, t) {
|
|
284
|
+
this.name = "BulkError", this.failures = Object.keys(t).map(function(e) {
|
|
285
|
+
return t[e];
|
|
286
|
+
}), this.failuresByPos = t, this.message = be(e, this.failures);
|
|
287
|
+
}
|
|
288
|
+
m(Se).from(ye);
|
|
289
|
+
var Ce = _e.reduce(function(e, t) {
|
|
290
|
+
return e[t] = t + "Error", e;
|
|
291
|
+
}, {}), we = ye, O = _e.reduce(function(e, t) {
|
|
292
|
+
var n = t + "Error";
|
|
293
|
+
function r(e, r) {
|
|
294
|
+
this.name = n, e ? typeof e == "string" ? (this.message = `${e}${r ? "\n " + r : ""}`, this.inner = r || null) : typeof e == "object" && (this.message = `${e.name} ${e.message}`, this.inner = e) : (this.message = ve[t] || n, this.inner = null);
|
|
295
|
+
}
|
|
296
|
+
return m(r).from(we), e[t] = r, e;
|
|
297
|
+
}, {});
|
|
298
|
+
O.Syntax = SyntaxError, O.Type = TypeError, O.Range = RangeError;
|
|
299
|
+
var Te = ge.reduce(function(e, t) {
|
|
300
|
+
return e[t + "Error"] = O[t], e;
|
|
301
|
+
}, {}), Ee = _e.reduce(function(e, t) {
|
|
302
|
+
return [
|
|
303
|
+
"Syntax",
|
|
304
|
+
"Type",
|
|
305
|
+
"Range"
|
|
306
|
+
].indexOf(t) === -1 && (e[t + "Error"] = O[t]), e;
|
|
307
|
+
}, {});
|
|
308
|
+
Ee.ModifyError = xe, Ee.DexieError = ye, Ee.BulkError = Se;
|
|
309
|
+
function k() {}
|
|
310
|
+
function De(e) {
|
|
311
|
+
return e;
|
|
312
|
+
}
|
|
313
|
+
function Oe(e, t) {
|
|
314
|
+
return e == null || e === De ? t : function(n) {
|
|
315
|
+
return t(e(n));
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
function A(e, t) {
|
|
319
|
+
return function() {
|
|
320
|
+
e.apply(this, arguments), t.apply(this, arguments);
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
function ke(e, t) {
|
|
324
|
+
return e === k ? t : function() {
|
|
325
|
+
var n = e.apply(this, arguments);
|
|
326
|
+
n !== void 0 && (arguments[0] = n);
|
|
327
|
+
var r = this.onsuccess, i = this.onerror;
|
|
328
|
+
this.onsuccess = null, this.onerror = null;
|
|
329
|
+
var a = t.apply(this, arguments);
|
|
330
|
+
return r && (this.onsuccess = this.onsuccess ? A(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? A(i, this.onerror) : i), a === void 0 ? n : a;
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function Ae(e, t) {
|
|
334
|
+
return e === k ? t : function() {
|
|
335
|
+
e.apply(this, arguments);
|
|
336
|
+
var n = this.onsuccess, r = this.onerror;
|
|
337
|
+
this.onsuccess = this.onerror = null, t.apply(this, arguments), n && (this.onsuccess = this.onsuccess ? A(n, this.onsuccess) : n), r && (this.onerror = this.onerror ? A(r, this.onerror) : r);
|
|
338
|
+
};
|
|
339
|
+
}
|
|
340
|
+
function je(e, t) {
|
|
341
|
+
return e === k ? t : function() {
|
|
342
|
+
var n = e.apply(this, arguments);
|
|
343
|
+
s(arguments[0], n);
|
|
344
|
+
var r = this.onsuccess, i = this.onerror;
|
|
345
|
+
this.onsuccess = null, this.onerror = null;
|
|
346
|
+
var a = t.apply(this, arguments);
|
|
347
|
+
return r && (this.onsuccess = this.onsuccess ? A(r, this.onsuccess) : r), i && (this.onerror = this.onerror ? A(i, this.onerror) : i), n === void 0 ? a === void 0 ? void 0 : a : s(n, a);
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function Me(e, t) {
|
|
351
|
+
return e === k ? t : function() {
|
|
352
|
+
return t.apply(this, arguments) !== !1 && e.apply(this, arguments);
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
function Ne(e, t) {
|
|
356
|
+
return e === k ? t : function() {
|
|
357
|
+
var n = e.apply(this, arguments);
|
|
358
|
+
if (n && typeof n.then == "function") {
|
|
359
|
+
for (var r = this, i = arguments.length, a = Array(i); i--;) a[i] = arguments[i];
|
|
360
|
+
return n.then(function() {
|
|
361
|
+
return t.apply(r, a);
|
|
362
|
+
});
|
|
363
|
+
}
|
|
364
|
+
return t.apply(this, arguments);
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
var j = typeof location < "u" && /^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);
|
|
368
|
+
function Pe(e, t) {
|
|
369
|
+
j = e;
|
|
370
|
+
}
|
|
371
|
+
var Fe = {}, Ie = 100, Le = typeof Promise > "u" ? [] : (function() {
|
|
372
|
+
var e = Promise.resolve();
|
|
373
|
+
if (typeof crypto > "u" || !crypto.subtle) return [
|
|
374
|
+
e,
|
|
375
|
+
c(e),
|
|
376
|
+
e
|
|
377
|
+
];
|
|
378
|
+
var t = crypto.subtle.digest("SHA-512", new Uint8Array([0]));
|
|
379
|
+
return [
|
|
380
|
+
t,
|
|
381
|
+
c(t),
|
|
382
|
+
e
|
|
383
|
+
];
|
|
384
|
+
})(), Re = Le[0], ze = Le[1], Be = Le[2], Ve = ze && ze.then, He = Re && Re.constructor, Ue = !!Be;
|
|
385
|
+
function We() {
|
|
386
|
+
queueMicrotask(ot);
|
|
387
|
+
}
|
|
388
|
+
var Ge = function(e, t) {
|
|
389
|
+
Ze.push([e, t]), qe &&= (We(), !1);
|
|
390
|
+
}, Ke = !0, qe = !0, Je = [], Ye = [], Xe = De, M = {
|
|
391
|
+
id: "global",
|
|
392
|
+
global: !0,
|
|
393
|
+
ref: 0,
|
|
394
|
+
unhandleds: [],
|
|
395
|
+
onunhandled: k,
|
|
396
|
+
pgp: !1,
|
|
397
|
+
env: {},
|
|
398
|
+
finalize: k
|
|
399
|
+
}, N = M, Ze = [], P = 0, Qe = [];
|
|
400
|
+
function F(e) {
|
|
401
|
+
if (typeof this != "object") throw TypeError("Promises must be constructed via new");
|
|
402
|
+
this._listeners = [], this._lib = !1;
|
|
403
|
+
var t = this._PSD = N;
|
|
404
|
+
if (typeof e != "function") {
|
|
405
|
+
if (e !== Fe) throw TypeError("Not a function");
|
|
406
|
+
this._state = arguments[1], this._value = arguments[2], this._state === !1 && nt(this, this._value);
|
|
407
|
+
} else this._state = null, this._value = null, ++t.ref, tt(this, e);
|
|
408
|
+
}
|
|
409
|
+
var $e = {
|
|
410
|
+
get: function() {
|
|
411
|
+
var e = N, t = _t;
|
|
412
|
+
function n(n, r) {
|
|
413
|
+
var i = this, a = !e.global && (e !== N || t !== _t), o = a && !z(), s = new F(function(t, s) {
|
|
414
|
+
it(i, new et(wt(n, e, a, o), wt(r, e, a, o), t, s, e));
|
|
415
|
+
});
|
|
416
|
+
return this._consoleTask && (s._consoleTask = this._consoleTask), s;
|
|
417
|
+
}
|
|
418
|
+
return n.prototype = Fe, n;
|
|
419
|
+
},
|
|
420
|
+
set: function(e) {
|
|
421
|
+
p(this, "then", e && e.prototype === Fe ? $e : {
|
|
422
|
+
get: function() {
|
|
423
|
+
return e;
|
|
424
|
+
},
|
|
425
|
+
set: $e.set
|
|
426
|
+
});
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
d(F.prototype, {
|
|
430
|
+
then: $e,
|
|
431
|
+
_then: function(e, t) {
|
|
432
|
+
it(this, new et(null, null, e, t, N));
|
|
433
|
+
},
|
|
434
|
+
catch: function(e) {
|
|
435
|
+
if (arguments.length === 1) return this.then(null, e);
|
|
436
|
+
var t = arguments[0], n = arguments[1];
|
|
437
|
+
return typeof t == "function" ? this.then(null, function(e) {
|
|
438
|
+
return e instanceof t ? n(e) : pt(e);
|
|
439
|
+
}) : this.then(null, function(e) {
|
|
440
|
+
return e && e.name === t ? n(e) : pt(e);
|
|
441
|
+
});
|
|
442
|
+
},
|
|
443
|
+
finally: function(e) {
|
|
444
|
+
return this.then(function(t) {
|
|
445
|
+
return F.resolve(e()).then(function() {
|
|
446
|
+
return t;
|
|
447
|
+
});
|
|
448
|
+
}, function(t) {
|
|
449
|
+
return F.resolve(e()).then(function() {
|
|
450
|
+
return pt(t);
|
|
451
|
+
});
|
|
452
|
+
});
|
|
453
|
+
},
|
|
454
|
+
timeout: function(e, t) {
|
|
455
|
+
var n = this;
|
|
456
|
+
return e < 1e400 ? new F(function(r, i) {
|
|
457
|
+
var a = setTimeout(function() {
|
|
458
|
+
return i(new O.Timeout(t));
|
|
459
|
+
}, e);
|
|
460
|
+
n.then(r, i).finally(clearTimeout.bind(null, a));
|
|
461
|
+
}) : this;
|
|
462
|
+
}
|
|
463
|
+
}), typeof Symbol < "u" && Symbol.toStringTag && p(F.prototype, Symbol.toStringTag, "Dexie.Promise"), M.env = Ct();
|
|
464
|
+
function et(e, t, n, r, i) {
|
|
465
|
+
this.onFulfilled = typeof e == "function" ? e : null, this.onRejected = typeof t == "function" ? t : null, this.resolve = n, this.reject = r, this.psd = i;
|
|
466
|
+
}
|
|
467
|
+
d(F, {
|
|
468
|
+
all: function() {
|
|
469
|
+
var e = D.apply(null, arguments).map(bt);
|
|
470
|
+
return new F(function(t, n) {
|
|
471
|
+
e.length === 0 && t([]);
|
|
472
|
+
var r = e.length;
|
|
473
|
+
e.forEach(function(i, a) {
|
|
474
|
+
return F.resolve(i).then(function(n) {
|
|
475
|
+
e[a] = n, --r || t(e);
|
|
476
|
+
}, n);
|
|
477
|
+
});
|
|
478
|
+
});
|
|
479
|
+
},
|
|
480
|
+
resolve: function(e) {
|
|
481
|
+
return e instanceof F ? e : e && typeof e.then == "function" ? new F(function(t, n) {
|
|
482
|
+
e.then(t, n);
|
|
483
|
+
}) : new F(Fe, !0, e);
|
|
484
|
+
},
|
|
485
|
+
reject: pt,
|
|
486
|
+
race: function() {
|
|
487
|
+
var e = D.apply(null, arguments).map(bt);
|
|
488
|
+
return new F(function(t, n) {
|
|
489
|
+
e.map(function(e) {
|
|
490
|
+
return F.resolve(e).then(t, n);
|
|
491
|
+
});
|
|
492
|
+
});
|
|
493
|
+
},
|
|
494
|
+
PSD: {
|
|
495
|
+
get: function() {
|
|
496
|
+
return N;
|
|
497
|
+
},
|
|
498
|
+
set: function(e) {
|
|
499
|
+
return N = e;
|
|
500
|
+
}
|
|
501
|
+
},
|
|
502
|
+
totalEchoes: { get: function() {
|
|
503
|
+
return _t;
|
|
504
|
+
} },
|
|
505
|
+
newPSD: R,
|
|
506
|
+
usePSD: V,
|
|
507
|
+
scheduler: {
|
|
508
|
+
get: function() {
|
|
509
|
+
return Ge;
|
|
510
|
+
},
|
|
511
|
+
set: function(e) {
|
|
512
|
+
Ge = e;
|
|
513
|
+
}
|
|
514
|
+
},
|
|
515
|
+
rejectionMapper: {
|
|
516
|
+
get: function() {
|
|
517
|
+
return Xe;
|
|
518
|
+
},
|
|
519
|
+
set: function(e) {
|
|
520
|
+
Xe = e;
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
follow: function(e, t) {
|
|
524
|
+
return new F(function(n, r) {
|
|
525
|
+
return R(function(t, n) {
|
|
526
|
+
var r = N;
|
|
527
|
+
r.unhandleds = [], r.onunhandled = n, r.finalize = A(function() {
|
|
528
|
+
var e = this;
|
|
529
|
+
ut(function() {
|
|
530
|
+
e.unhandleds.length === 0 ? t() : n(e.unhandleds[0]);
|
|
531
|
+
});
|
|
532
|
+
}, r.finalize), e();
|
|
533
|
+
}, t, n, r);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
}), He && (He.allSettled && p(F, "allSettled", function() {
|
|
537
|
+
var e = D.apply(null, arguments).map(bt);
|
|
538
|
+
return new F(function(t) {
|
|
539
|
+
e.length === 0 && t([]);
|
|
540
|
+
var n = e.length, r = Array(n);
|
|
541
|
+
e.forEach(function(e, i) {
|
|
542
|
+
return F.resolve(e).then(function(e) {
|
|
543
|
+
return r[i] = {
|
|
544
|
+
status: "fulfilled",
|
|
545
|
+
value: e
|
|
546
|
+
};
|
|
547
|
+
}, function(e) {
|
|
548
|
+
return r[i] = {
|
|
549
|
+
status: "rejected",
|
|
550
|
+
reason: e
|
|
551
|
+
};
|
|
552
|
+
}).then(function() {
|
|
553
|
+
return --n || t(r);
|
|
554
|
+
});
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
}), He.any && typeof AggregateError < "u" && p(F, "any", function() {
|
|
558
|
+
var e = D.apply(null, arguments).map(bt);
|
|
559
|
+
return new F(function(t, n) {
|
|
560
|
+
e.length === 0 && n(/* @__PURE__ */ AggregateError([]));
|
|
561
|
+
var r = e.length, i = Array(r);
|
|
562
|
+
e.forEach(function(e, a) {
|
|
563
|
+
return F.resolve(e).then(function(e) {
|
|
564
|
+
return t(e);
|
|
565
|
+
}, function(e) {
|
|
566
|
+
i[a] = e, --r || n(AggregateError(i));
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
});
|
|
570
|
+
}), He.withResolvers && (F.withResolvers = He.withResolvers));
|
|
571
|
+
function tt(e, t) {
|
|
572
|
+
try {
|
|
573
|
+
t(function(t) {
|
|
574
|
+
if (e._state === null) {
|
|
575
|
+
if (t === e) throw TypeError("A promise cannot be resolved with itself.");
|
|
576
|
+
var n = e._lib && st();
|
|
577
|
+
t && typeof t.then == "function" ? tt(e, function(e, n) {
|
|
578
|
+
t instanceof F ? t._then(e, n) : t.then(e, n);
|
|
579
|
+
}) : (e._state = !0, e._value = t, rt(e)), n && ct();
|
|
580
|
+
}
|
|
581
|
+
}, nt.bind(null, e));
|
|
582
|
+
} catch (t) {
|
|
583
|
+
nt(e, t);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
function nt(e, t) {
|
|
587
|
+
if (Ye.push(t), e._state === null) {
|
|
588
|
+
var n = e._lib && st();
|
|
589
|
+
t = Xe(t), e._state = !1, e._value = t, dt(e), rt(e), n && ct();
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
function rt(e) {
|
|
593
|
+
var t = e._listeners;
|
|
594
|
+
e._listeners = [];
|
|
595
|
+
for (var n = 0, r = t.length; n < r; ++n) it(e, t[n]);
|
|
596
|
+
var i = e._PSD;
|
|
597
|
+
--i.ref || i.finalize(), P === 0 && (++P, Ge(function() {
|
|
598
|
+
--P === 0 && lt();
|
|
599
|
+
}, []));
|
|
600
|
+
}
|
|
601
|
+
function it(e, t) {
|
|
602
|
+
if (e._state === null) e._listeners.push(t);
|
|
603
|
+
else {
|
|
604
|
+
var n = e._state ? t.onFulfilled : t.onRejected;
|
|
605
|
+
if (n === null) return (e._state ? t.resolve : t.reject)(e._value);
|
|
606
|
+
++t.psd.ref, ++P, Ge(at, [
|
|
607
|
+
n,
|
|
608
|
+
e,
|
|
609
|
+
t
|
|
610
|
+
]);
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
function at(e, t, n) {
|
|
614
|
+
try {
|
|
615
|
+
var r, i = t._value;
|
|
616
|
+
!t._state && Ye.length && (Ye = []), r = j && t._consoleTask ? t._consoleTask.run(function() {
|
|
617
|
+
return e(i);
|
|
618
|
+
}) : e(i), !t._state && Ye.indexOf(i) === -1 && ft(t), n.resolve(r);
|
|
619
|
+
} catch (e) {
|
|
620
|
+
n.reject(e);
|
|
621
|
+
} finally {
|
|
622
|
+
--P === 0 && lt(), --n.psd.ref || n.psd.finalize();
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
function ot() {
|
|
626
|
+
V(M, function() {
|
|
627
|
+
st() && ct();
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
function st() {
|
|
631
|
+
var e = Ke;
|
|
632
|
+
return Ke = !1, qe = !1, e;
|
|
633
|
+
}
|
|
634
|
+
function ct() {
|
|
635
|
+
var e, t, n;
|
|
636
|
+
do
|
|
637
|
+
for (; Ze.length > 0;) for (e = Ze, Ze = [], n = e.length, t = 0; t < n; ++t) {
|
|
638
|
+
var r = e[t];
|
|
639
|
+
r[0].apply(null, r[1]);
|
|
640
|
+
}
|
|
641
|
+
while (Ze.length > 0);
|
|
642
|
+
Ke = !0, qe = !0;
|
|
643
|
+
}
|
|
644
|
+
function lt() {
|
|
645
|
+
var e = Je;
|
|
646
|
+
Je = [], e.forEach(function(e) {
|
|
647
|
+
e._PSD.onunhandled.call(null, e._value, e);
|
|
648
|
+
});
|
|
649
|
+
for (var t = Qe.slice(0), n = t.length; n;) t[--n]();
|
|
650
|
+
}
|
|
651
|
+
function ut(e) {
|
|
652
|
+
function t() {
|
|
653
|
+
e(), Qe.splice(Qe.indexOf(t), 1);
|
|
654
|
+
}
|
|
655
|
+
Qe.push(t), ++P, Ge(function() {
|
|
656
|
+
--P === 0 && lt();
|
|
657
|
+
}, []);
|
|
658
|
+
}
|
|
659
|
+
function dt(e) {
|
|
660
|
+
Je.some(function(t) {
|
|
661
|
+
return t._value === e._value;
|
|
662
|
+
}) || Je.push(e);
|
|
663
|
+
}
|
|
664
|
+
function ft(e) {
|
|
665
|
+
for (var t = Je.length; t;) if (Je[--t]._value === e._value) {
|
|
666
|
+
Je.splice(t, 1);
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
function pt(e) {
|
|
671
|
+
return new F(Fe, !1, e);
|
|
672
|
+
}
|
|
673
|
+
function I(e, t) {
|
|
674
|
+
var n = N;
|
|
675
|
+
return function() {
|
|
676
|
+
var r = st(), i = N;
|
|
677
|
+
try {
|
|
678
|
+
return B(n, !0), e.apply(this, arguments);
|
|
679
|
+
} catch (e) {
|
|
680
|
+
t && t(e);
|
|
681
|
+
} finally {
|
|
682
|
+
B(i, !1), r && ct();
|
|
683
|
+
}
|
|
684
|
+
};
|
|
685
|
+
}
|
|
686
|
+
var L = {
|
|
687
|
+
awaits: 0,
|
|
688
|
+
echoes: 0,
|
|
689
|
+
id: 0
|
|
690
|
+
}, mt = 0, ht = [], gt = 0, _t = 0, vt = 0;
|
|
691
|
+
function R(e, t, n, r) {
|
|
692
|
+
var i = N, a = Object.create(i);
|
|
693
|
+
a.parent = i, a.ref = 0, a.global = !1, a.id = ++vt, M.env, a.env = Ue ? {
|
|
694
|
+
Promise: F,
|
|
695
|
+
PromiseProp: {
|
|
696
|
+
value: F,
|
|
697
|
+
configurable: !0,
|
|
698
|
+
writable: !0
|
|
699
|
+
},
|
|
700
|
+
all: F.all,
|
|
701
|
+
race: F.race,
|
|
702
|
+
allSettled: F.allSettled,
|
|
703
|
+
any: F.any,
|
|
704
|
+
resolve: F.resolve,
|
|
705
|
+
reject: F.reject
|
|
706
|
+
} : {}, t && s(a, t), ++i.ref, a.finalize = function() {
|
|
707
|
+
--this.parent.ref || this.parent.finalize();
|
|
708
|
+
};
|
|
709
|
+
var o = V(a, e, n, r);
|
|
710
|
+
return a.ref === 0 && a.finalize(), o;
|
|
711
|
+
}
|
|
712
|
+
function yt() {
|
|
713
|
+
return L.id ||= ++mt, ++L.awaits, L.echoes += Ie, L.id;
|
|
714
|
+
}
|
|
715
|
+
function z() {
|
|
716
|
+
return L.awaits ? (--L.awaits === 0 && (L.id = 0), L.echoes = L.awaits * Ie, !0) : !1;
|
|
717
|
+
}
|
|
718
|
+
("" + Ve).indexOf("[native code]") === -1 && (yt = z = k);
|
|
719
|
+
function bt(e) {
|
|
720
|
+
return L.echoes && e && e.constructor === He ? (yt(), e.then(function(e) {
|
|
721
|
+
return z(), e;
|
|
722
|
+
}, function(e) {
|
|
723
|
+
return z(), H(e);
|
|
724
|
+
})) : e;
|
|
725
|
+
}
|
|
726
|
+
function xt(e) {
|
|
727
|
+
++_t, L.echoes && --L.echoes !== 0 || (L.echoes = L.awaits = L.id = 0), ht.push(N), B(e, !0);
|
|
728
|
+
}
|
|
729
|
+
function St() {
|
|
730
|
+
var e = ht[ht.length - 1];
|
|
731
|
+
ht.pop(), B(e, !1);
|
|
732
|
+
}
|
|
733
|
+
function B(e, t) {
|
|
734
|
+
var n = N;
|
|
735
|
+
if ((t ? L.echoes && (!gt++ || e !== N) : gt && (!--gt || e !== N)) && queueMicrotask(t ? xt.bind(null, e) : St), e !== N && (N = e, n === M && (M.env = Ct()), Ue)) {
|
|
736
|
+
var r = M.env.Promise, a = e.env;
|
|
737
|
+
(n.global || e.global) && (Object.defineProperty(i, "Promise", a.PromiseProp), r.all = a.all, r.race = a.race, r.resolve = a.resolve, r.reject = a.reject, a.allSettled && (r.allSettled = a.allSettled), a.any && (r.any = a.any));
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
function Ct() {
|
|
741
|
+
var e = i.Promise;
|
|
742
|
+
return Ue ? {
|
|
743
|
+
Promise: e,
|
|
744
|
+
PromiseProp: Object.getOwnPropertyDescriptor(i, "Promise"),
|
|
745
|
+
all: e.all,
|
|
746
|
+
race: e.race,
|
|
747
|
+
allSettled: e.allSettled,
|
|
748
|
+
any: e.any,
|
|
749
|
+
resolve: e.resolve,
|
|
750
|
+
reject: e.reject
|
|
751
|
+
} : {};
|
|
752
|
+
}
|
|
753
|
+
function V(e, t, n, r, i) {
|
|
754
|
+
var a = N;
|
|
755
|
+
try {
|
|
756
|
+
return B(e, !0), t(n, r, i);
|
|
757
|
+
} finally {
|
|
758
|
+
B(a, !1);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
function wt(e, t, n, r) {
|
|
762
|
+
return typeof e == "function" ? function() {
|
|
763
|
+
var i = N;
|
|
764
|
+
n && yt(), B(t, !0);
|
|
765
|
+
try {
|
|
766
|
+
return e.apply(this, arguments);
|
|
767
|
+
} finally {
|
|
768
|
+
B(i, !1), r && queueMicrotask(z);
|
|
769
|
+
}
|
|
770
|
+
} : e;
|
|
771
|
+
}
|
|
772
|
+
function Tt(e) {
|
|
773
|
+
Promise === He && L.echoes === 0 ? gt === 0 ? e() : enqueueNativeMicroTask(e) : setTimeout(e, 0);
|
|
774
|
+
}
|
|
775
|
+
var H = F.reject;
|
|
776
|
+
function Et(e, t, n, r) {
|
|
777
|
+
if (!e.idbdb || !e._state.openComplete && !N.letThrough && !e._vip) {
|
|
778
|
+
if (e._state.openComplete) return H(new O.DatabaseClosed(e._state.dbOpenError));
|
|
779
|
+
if (!e._state.isBeingOpened) {
|
|
780
|
+
if (!e._state.autoOpen) return H(new O.DatabaseClosed());
|
|
781
|
+
e.open().catch(k);
|
|
782
|
+
}
|
|
783
|
+
return e._state.dbReadyPromise.then(function() {
|
|
784
|
+
return Et(e, t, n, r);
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
var i = e._createTransaction(t, n, e._dbSchema);
|
|
788
|
+
try {
|
|
789
|
+
i.create(), e._state.PR1398_maxLoop = 3;
|
|
790
|
+
} catch (i) {
|
|
791
|
+
return i.name === Ce.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), e.close({ disableAutoOpen: !1 }), e.open().then(function() {
|
|
792
|
+
return Et(e, t, n, r);
|
|
793
|
+
})) : H(i);
|
|
794
|
+
}
|
|
795
|
+
return i._promise(t, function(e, t) {
|
|
796
|
+
return R(function() {
|
|
797
|
+
return N.trans = i, r(e, t, i);
|
|
798
|
+
});
|
|
799
|
+
}).then(function(e) {
|
|
800
|
+
if (t === "readwrite") try {
|
|
801
|
+
i.idbtrans.commit();
|
|
802
|
+
} catch {}
|
|
803
|
+
return t === "readonly" ? e : i._completion.then(function() {
|
|
804
|
+
return e;
|
|
805
|
+
});
|
|
806
|
+
});
|
|
807
|
+
}
|
|
808
|
+
var Dt = "4.4.7", U = "", Ot = -1e400, W = "Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.", kt = "String expected.", At = 1e3, jt = "__dbnames", Mt = "readonly", Nt = "readwrite";
|
|
809
|
+
function G(e, t) {
|
|
810
|
+
return e ? t ? function() {
|
|
811
|
+
return e.apply(this, arguments) && t.apply(this, arguments);
|
|
812
|
+
} : e : t;
|
|
813
|
+
}
|
|
814
|
+
var Pt = {
|
|
815
|
+
type: 3,
|
|
816
|
+
lower: -1e400,
|
|
817
|
+
lowerOpen: !1,
|
|
818
|
+
upper: [[]],
|
|
819
|
+
upperOpen: !1
|
|
820
|
+
};
|
|
821
|
+
function Ft(e) {
|
|
822
|
+
return typeof e == "string" && !/\./.test(e) ? function(t) {
|
|
823
|
+
return t[e] === void 0 && e in t && (t = T(t), delete t[e]), t;
|
|
824
|
+
} : function(e) {
|
|
825
|
+
return e;
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
function It() {
|
|
829
|
+
throw O.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.");
|
|
830
|
+
}
|
|
831
|
+
function K(e, t) {
|
|
832
|
+
try {
|
|
833
|
+
var n = zt(e), r = zt(t);
|
|
834
|
+
if (n !== r) return n === "Array" ? 1 : r === "Array" ? -1 : n === "binary" ? 1 : r === "binary" ? -1 : n === "string" ? 1 : r === "string" ? -1 : n === "Date" ? 1 : r === "Date" ? -1 : NaN;
|
|
835
|
+
switch (n) {
|
|
836
|
+
case "number":
|
|
837
|
+
case "Date":
|
|
838
|
+
case "string": return e > t ? 1 : e < t ? -1 : 0;
|
|
839
|
+
case "binary": return Rt(Bt(e), Bt(t));
|
|
840
|
+
case "Array": return Lt(e, t);
|
|
841
|
+
}
|
|
842
|
+
} catch {}
|
|
843
|
+
return NaN;
|
|
844
|
+
}
|
|
845
|
+
function Lt(e, t) {
|
|
846
|
+
for (var n = e.length, r = t.length, i = n < r ? n : r, a = 0; a < i; ++a) {
|
|
847
|
+
var o = K(e[a], t[a]);
|
|
848
|
+
if (o !== 0) return o;
|
|
849
|
+
}
|
|
850
|
+
return n === r ? 0 : n < r ? -1 : 1;
|
|
851
|
+
}
|
|
852
|
+
function Rt(e, t) {
|
|
853
|
+
for (var n = e.length, r = t.length, i = n < r ? n : r, a = 0; a < i; ++a) if (e[a] !== t[a]) return e[a] < t[a] ? -1 : 1;
|
|
854
|
+
return n === r ? 0 : n < r ? -1 : 1;
|
|
855
|
+
}
|
|
856
|
+
function zt(e) {
|
|
857
|
+
var t = typeof e;
|
|
858
|
+
if (t !== "object") return t;
|
|
859
|
+
if (ArrayBuffer.isView(e)) return "binary";
|
|
860
|
+
var n = ue(e);
|
|
861
|
+
return n === "ArrayBuffer" ? "binary" : n;
|
|
862
|
+
}
|
|
863
|
+
function Bt(e) {
|
|
864
|
+
return e instanceof Uint8Array ? e : ArrayBuffer.isView(e) ? new Uint8Array(e.buffer, e.byteOffset, e.byteLength) : new Uint8Array(e);
|
|
865
|
+
}
|
|
866
|
+
function Vt(e, t, n) {
|
|
867
|
+
var r = e.schema.yProps;
|
|
868
|
+
return r ? (t && n.numFailures > 0 && (t = t.filter(function(e, t) {
|
|
869
|
+
return !n.failures[t];
|
|
870
|
+
})), Promise.all(r.map(function(n) {
|
|
871
|
+
var r = n.updatesTable;
|
|
872
|
+
return t ? e.db.table(r).where("k").anyOf(t).delete() : e.db.table(r).clear();
|
|
873
|
+
})).then(function() {
|
|
874
|
+
return n;
|
|
875
|
+
})) : n;
|
|
876
|
+
}
|
|
877
|
+
var Ht = function() {
|
|
878
|
+
function e(e) {
|
|
879
|
+
this["@@propmod"] = e;
|
|
880
|
+
}
|
|
881
|
+
return e.prototype.execute = function(e) {
|
|
882
|
+
var t = this["@@propmod"];
|
|
883
|
+
if (t.add !== void 0) {
|
|
884
|
+
var n = t.add;
|
|
885
|
+
if (o(n)) return r(r([], o(e) ? e : [], !0), n, !0).sort();
|
|
886
|
+
if (typeof n == "number") return (Number(e) || 0) + n;
|
|
887
|
+
if (typeof n == "bigint") try {
|
|
888
|
+
return BigInt(e) + n;
|
|
889
|
+
} catch {
|
|
890
|
+
return BigInt(0) + n;
|
|
891
|
+
}
|
|
892
|
+
throw TypeError(`Invalid term ${n}`);
|
|
893
|
+
}
|
|
894
|
+
if (t.remove !== void 0) {
|
|
895
|
+
var i = t.remove;
|
|
896
|
+
if (o(i)) return o(e) ? e.filter(function(e) {
|
|
897
|
+
return !i.includes(e);
|
|
898
|
+
}).sort() : [];
|
|
899
|
+
if (typeof i == "number") return Number(e) - i;
|
|
900
|
+
if (typeof i == "bigint") try {
|
|
901
|
+
return BigInt(e) - i;
|
|
902
|
+
} catch {
|
|
903
|
+
return BigInt(0) - i;
|
|
904
|
+
}
|
|
905
|
+
throw TypeError(`Invalid subtrahend ${i}`);
|
|
906
|
+
}
|
|
907
|
+
var a = t.replacePrefix?.[0];
|
|
908
|
+
return a && typeof e == "string" && e.startsWith(a) ? t.replacePrefix[1] + e.substring(a.length) : e;
|
|
909
|
+
}, e;
|
|
910
|
+
}();
|
|
911
|
+
function Ut(e, t) {
|
|
912
|
+
for (var n = a(t), r = n.length, i = !1, o = 0; o < r; ++o) {
|
|
913
|
+
var s = n[o], c = t[s], l = C(e, s);
|
|
914
|
+
c instanceof Ht ? (w(e, s, c.execute(l)), i = !0) : l !== c && (w(e, s, c), i = !0);
|
|
915
|
+
}
|
|
916
|
+
return i;
|
|
917
|
+
}
|
|
918
|
+
var Wt = function() {
|
|
919
|
+
function e() {}
|
|
920
|
+
return e.prototype._trans = function(e, t, n) {
|
|
921
|
+
var r = this._tx || N.trans, i = this.name, a = j && typeof console < "u" && console.createTask && console.createTask(`Dexie: ${e === "readonly" ? "read" : "write"} ${this.name}`);
|
|
922
|
+
function o(e, n, r) {
|
|
923
|
+
if (!r.schema[i]) throw new O.NotFound("Table " + i + " not part of transaction");
|
|
924
|
+
return t(r.idbtrans, r);
|
|
925
|
+
}
|
|
926
|
+
var s = st();
|
|
927
|
+
try {
|
|
928
|
+
var c = r && r.db._novip === this.db._novip ? r === N.trans ? r._promise(e, o, n) : R(function() {
|
|
929
|
+
return r._promise(e, o, n);
|
|
930
|
+
}, {
|
|
931
|
+
trans: r,
|
|
932
|
+
transless: N.transless || N
|
|
933
|
+
}) : Et(this.db, e, [this.name], o);
|
|
934
|
+
return a && (c._consoleTask = a, c = c.catch(function(e) {
|
|
935
|
+
return console.trace(e), H(e);
|
|
936
|
+
})), c;
|
|
937
|
+
} finally {
|
|
938
|
+
s && ct();
|
|
939
|
+
}
|
|
940
|
+
}, e.prototype.get = function(e, t) {
|
|
941
|
+
var n = this;
|
|
942
|
+
return e && e.constructor === Object ? this.where(e).first(t) : e == null ? H(new O.Type("Invalid argument to Table.get()")) : this._trans("readonly", function(t) {
|
|
943
|
+
return n.core.get({
|
|
944
|
+
trans: t,
|
|
945
|
+
key: e
|
|
946
|
+
}).then(function(e) {
|
|
947
|
+
return n.hook.reading.fire(e);
|
|
948
|
+
});
|
|
949
|
+
}).then(t);
|
|
950
|
+
}, e.prototype.where = function(e) {
|
|
951
|
+
if (typeof e == "string") return new this.db.WhereClause(this, e);
|
|
952
|
+
if (o(e)) return new this.db.WhereClause(this, `[${e.join("+")}]`);
|
|
953
|
+
var t = a(e);
|
|
954
|
+
if (t.length === 1) return this.where(t[0]).equals(e[t[0]]);
|
|
955
|
+
var n = this.schema.indexes.concat(this.schema.primKey).filter(function(e) {
|
|
956
|
+
if (e.compound && t.every(function(t) {
|
|
957
|
+
return e.keyPath.indexOf(t) >= 0;
|
|
958
|
+
})) {
|
|
959
|
+
for (var n = 0; n < t.length; ++n) if (t.indexOf(e.keyPath[n]) === -1) return !1;
|
|
960
|
+
return !0;
|
|
961
|
+
}
|
|
962
|
+
return !1;
|
|
963
|
+
}).sort(function(e, t) {
|
|
964
|
+
return e.keyPath.length - t.keyPath.length;
|
|
965
|
+
})[0];
|
|
966
|
+
if (n && this.db._maxKey !== U) {
|
|
967
|
+
var r = n.keyPath.slice(0, t.length);
|
|
968
|
+
return this.where(r).equals(r.map(function(t) {
|
|
969
|
+
return e[t];
|
|
970
|
+
}));
|
|
971
|
+
}
|
|
972
|
+
!n && j && console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit from a compound index [${t.join("+")}]`);
|
|
973
|
+
var i = this.schema.idxByName;
|
|
974
|
+
function s(e, t) {
|
|
975
|
+
return K(e, t) === 0;
|
|
976
|
+
}
|
|
977
|
+
var c = t.reduce(function(t, n) {
|
|
978
|
+
var r = t[0], a = t[1], c = i[n], l = e[n];
|
|
979
|
+
return [r || c, r || !c ? G(a, c && c.multi ? function(e) {
|
|
980
|
+
var t = C(e, n);
|
|
981
|
+
return o(t) && t.some(function(e) {
|
|
982
|
+
return s(l, e);
|
|
983
|
+
});
|
|
984
|
+
} : function(e) {
|
|
985
|
+
return s(l, C(e, n));
|
|
986
|
+
}) : a];
|
|
987
|
+
}, [null, null]), l = c[0], u = c[1];
|
|
988
|
+
return l ? this.where(l.name).equals(e[l.keyPath]).filter(u) : n ? this.filter(u) : this.where(t).equals("");
|
|
989
|
+
}, e.prototype.filter = function(e) {
|
|
990
|
+
return this.toCollection().and(e);
|
|
991
|
+
}, e.prototype.count = function(e) {
|
|
992
|
+
return this.toCollection().count(e);
|
|
993
|
+
}, e.prototype.offset = function(e) {
|
|
994
|
+
return this.toCollection().offset(e);
|
|
995
|
+
}, e.prototype.limit = function(e) {
|
|
996
|
+
return this.toCollection().limit(e);
|
|
997
|
+
}, e.prototype.each = function(e) {
|
|
998
|
+
return this.toCollection().each(e);
|
|
999
|
+
}, e.prototype.toArray = function(e) {
|
|
1000
|
+
return this.toCollection().toArray(e);
|
|
1001
|
+
}, e.prototype.toCollection = function() {
|
|
1002
|
+
return new this.db.Collection(new this.db.WhereClause(this));
|
|
1003
|
+
}, e.prototype.orderBy = function(e) {
|
|
1004
|
+
return new this.db.Collection(new this.db.WhereClause(this, o(e) ? `[${e.join("+")}]` : e));
|
|
1005
|
+
}, e.prototype.reverse = function() {
|
|
1006
|
+
return this.toCollection().reverse();
|
|
1007
|
+
}, e.prototype.mapToClass = function(e) {
|
|
1008
|
+
var n = this, r = n.db, i = n.name;
|
|
1009
|
+
this.schema.mappedClass = e, e.prototype instanceof It && (e = function(e) {
|
|
1010
|
+
t(n, e);
|
|
1011
|
+
function n() {
|
|
1012
|
+
return e !== null && e.apply(this, arguments) || this;
|
|
1013
|
+
}
|
|
1014
|
+
return Object.defineProperty(n.prototype, "db", {
|
|
1015
|
+
get: function() {
|
|
1016
|
+
return r;
|
|
1017
|
+
},
|
|
1018
|
+
enumerable: !1,
|
|
1019
|
+
configurable: !0
|
|
1020
|
+
}), n.prototype.table = function() {
|
|
1021
|
+
return i;
|
|
1022
|
+
}, n;
|
|
1023
|
+
}(e));
|
|
1024
|
+
for (var a = /* @__PURE__ */ new Set(), o = e.prototype; o; o = c(o)) Object.getOwnPropertyNames(o).forEach(function(e) {
|
|
1025
|
+
return a.add(e);
|
|
1026
|
+
});
|
|
1027
|
+
var s = function(t) {
|
|
1028
|
+
if (!t) return t;
|
|
1029
|
+
var n = Object.create(e.prototype);
|
|
1030
|
+
for (var r in t) if (!a.has(r)) try {
|
|
1031
|
+
n[r] = t[r];
|
|
1032
|
+
} catch {}
|
|
1033
|
+
return n;
|
|
1034
|
+
};
|
|
1035
|
+
return this.schema.readHook && this.hook.reading.unsubscribe(this.schema.readHook), this.schema.readHook = s, this.hook("reading", s), e;
|
|
1036
|
+
}, e.prototype.defineClass = function() {
|
|
1037
|
+
function e(e) {
|
|
1038
|
+
s(this, e);
|
|
1039
|
+
}
|
|
1040
|
+
return this.mapToClass(e);
|
|
1041
|
+
}, e.prototype.add = function(e, t) {
|
|
1042
|
+
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, o = e;
|
|
1043
|
+
return a && i && (o = Ft(a)(e)), this._trans("readwrite", function(e) {
|
|
1044
|
+
return n.core.mutate({
|
|
1045
|
+
trans: e,
|
|
1046
|
+
type: "add",
|
|
1047
|
+
keys: t == null ? null : [t],
|
|
1048
|
+
values: [o]
|
|
1049
|
+
});
|
|
1050
|
+
}).then(function(e) {
|
|
1051
|
+
return e.numFailures ? F.reject(e.failures[0]) : e.lastResult;
|
|
1052
|
+
}).then(function(t) {
|
|
1053
|
+
if (a) try {
|
|
1054
|
+
w(e, a, t);
|
|
1055
|
+
} catch {}
|
|
1056
|
+
return t;
|
|
1057
|
+
});
|
|
1058
|
+
}, e.prototype.upsert = function(e, t) {
|
|
1059
|
+
var n = this, r = this.schema.primKey.keyPath;
|
|
1060
|
+
return this._trans("readwrite", function(i) {
|
|
1061
|
+
return n.core.get({
|
|
1062
|
+
trans: i,
|
|
1063
|
+
key: e
|
|
1064
|
+
}).then(function(a) {
|
|
1065
|
+
var o = a ?? {};
|
|
1066
|
+
return Ut(o, t), r && w(o, r, e), n.core.mutate({
|
|
1067
|
+
trans: i,
|
|
1068
|
+
type: "put",
|
|
1069
|
+
values: [o],
|
|
1070
|
+
keys: [e],
|
|
1071
|
+
upsert: !0,
|
|
1072
|
+
updates: {
|
|
1073
|
+
keys: [e],
|
|
1074
|
+
changeSpecs: [t]
|
|
1075
|
+
}
|
|
1076
|
+
}).then(function(e) {
|
|
1077
|
+
return e.numFailures ? F.reject(e.failures[0]) : !!a;
|
|
1078
|
+
});
|
|
1079
|
+
});
|
|
1080
|
+
});
|
|
1081
|
+
}, e.prototype.update = function(e, t) {
|
|
1082
|
+
if (typeof e == "object" && !o(e)) {
|
|
1083
|
+
var n = C(e, this.schema.primKey.keyPath);
|
|
1084
|
+
return n === void 0 ? H(new O.InvalidArgument("Given object does not contain its primary key")) : this.where(":id").equals(n).modify(t);
|
|
1085
|
+
}
|
|
1086
|
+
return this.where(":id").equals(e).modify(t);
|
|
1087
|
+
}, e.prototype.put = function(e, t) {
|
|
1088
|
+
var n = this, r = this.schema.primKey, i = r.auto, a = r.keyPath, o = e;
|
|
1089
|
+
return a && i && (o = Ft(a)(e)), this._trans("readwrite", function(e) {
|
|
1090
|
+
return n.core.mutate({
|
|
1091
|
+
trans: e,
|
|
1092
|
+
type: "put",
|
|
1093
|
+
values: [o],
|
|
1094
|
+
keys: t == null ? null : [t]
|
|
1095
|
+
});
|
|
1096
|
+
}).then(function(e) {
|
|
1097
|
+
return e.numFailures ? F.reject(e.failures[0]) : e.lastResult;
|
|
1098
|
+
}).then(function(t) {
|
|
1099
|
+
if (a) try {
|
|
1100
|
+
w(e, a, t);
|
|
1101
|
+
} catch {}
|
|
1102
|
+
return t;
|
|
1103
|
+
});
|
|
1104
|
+
}, e.prototype.delete = function(e) {
|
|
1105
|
+
var t = this;
|
|
1106
|
+
return this._trans("readwrite", function(n) {
|
|
1107
|
+
return t.core.mutate({
|
|
1108
|
+
trans: n,
|
|
1109
|
+
type: "delete",
|
|
1110
|
+
keys: [e]
|
|
1111
|
+
}).then(function(n) {
|
|
1112
|
+
return Vt(t, [e], n);
|
|
1113
|
+
}).then(function(e) {
|
|
1114
|
+
return e.numFailures ? F.reject(e.failures[0]) : void 0;
|
|
1115
|
+
});
|
|
1116
|
+
});
|
|
1117
|
+
}, e.prototype.clear = function() {
|
|
1118
|
+
var e = this;
|
|
1119
|
+
return this._trans("readwrite", function(t) {
|
|
1120
|
+
return e.core.mutate({
|
|
1121
|
+
trans: t,
|
|
1122
|
+
type: "deleteRange",
|
|
1123
|
+
range: Pt
|
|
1124
|
+
}).then(function(t) {
|
|
1125
|
+
return Vt(e, null, t);
|
|
1126
|
+
});
|
|
1127
|
+
}).then(function(e) {
|
|
1128
|
+
return e.numFailures ? F.reject(e.failures[0]) : void 0;
|
|
1129
|
+
});
|
|
1130
|
+
}, e.prototype.bulkGet = function(e) {
|
|
1131
|
+
var t = this;
|
|
1132
|
+
return this._trans("readonly", function(n) {
|
|
1133
|
+
return t.core.getMany({
|
|
1134
|
+
keys: e,
|
|
1135
|
+
trans: n
|
|
1136
|
+
}).then(function(e) {
|
|
1137
|
+
return e.map(function(e) {
|
|
1138
|
+
return t.hook.reading.fire(e);
|
|
1139
|
+
});
|
|
1140
|
+
});
|
|
1141
|
+
});
|
|
1142
|
+
}, e.prototype.bulkAdd = function(e, t, n) {
|
|
1143
|
+
var r = this, i = Array.isArray(t) ? t : void 0;
|
|
1144
|
+
n ||= i ? void 0 : t;
|
|
1145
|
+
var a = n ? n.allKeys : void 0;
|
|
1146
|
+
return this._trans("readwrite", function(t) {
|
|
1147
|
+
var n = r.schema.primKey, o = n.auto, s = n.keyPath;
|
|
1148
|
+
if (s && i) throw new O.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");
|
|
1149
|
+
if (i && i.length !== e.length) throw new O.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1150
|
+
var c = e.length, l = s && o ? e.map(Ft(s)) : e;
|
|
1151
|
+
return r.core.mutate({
|
|
1152
|
+
trans: t,
|
|
1153
|
+
type: "add",
|
|
1154
|
+
keys: i,
|
|
1155
|
+
values: l,
|
|
1156
|
+
wantResults: a
|
|
1157
|
+
}).then(function(e) {
|
|
1158
|
+
var t = e.numFailures, n = e.results, i = e.lastResult, o = e.failures, s = a ? n : i;
|
|
1159
|
+
if (t === 0) return s;
|
|
1160
|
+
throw new Se(`${r.name}.bulkAdd(): ${t} of ${c} operations failed`, o);
|
|
1161
|
+
});
|
|
1162
|
+
});
|
|
1163
|
+
}, e.prototype.bulkPut = function(e, t, n) {
|
|
1164
|
+
var r = this, i = Array.isArray(t) ? t : void 0;
|
|
1165
|
+
n ||= i ? void 0 : t;
|
|
1166
|
+
var a = n ? n.allKeys : void 0;
|
|
1167
|
+
return this._trans("readwrite", function(t) {
|
|
1168
|
+
var n = r.schema.primKey, o = n.auto, s = n.keyPath;
|
|
1169
|
+
if (s && i) throw new O.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");
|
|
1170
|
+
if (i && i.length !== e.length) throw new O.InvalidArgument("Arguments objects and keys must have the same length");
|
|
1171
|
+
var c = e.length, l = s && o ? e.map(Ft(s)) : e;
|
|
1172
|
+
return r.core.mutate({
|
|
1173
|
+
trans: t,
|
|
1174
|
+
type: "put",
|
|
1175
|
+
keys: i,
|
|
1176
|
+
values: l,
|
|
1177
|
+
wantResults: a
|
|
1178
|
+
}).then(function(e) {
|
|
1179
|
+
var t = e.numFailures, n = e.results, i = e.lastResult, o = e.failures, s = a ? n : i;
|
|
1180
|
+
if (t === 0) return s;
|
|
1181
|
+
throw new Se(`${r.name}.bulkPut(): ${t} of ${c} operations failed`, o);
|
|
1182
|
+
});
|
|
1183
|
+
});
|
|
1184
|
+
}, e.prototype.bulkUpdate = function(e) {
|
|
1185
|
+
var t = this, n = e.map(function(e) {
|
|
1186
|
+
return e.key;
|
|
1187
|
+
}), r = e.map(function(e) {
|
|
1188
|
+
return e.changes;
|
|
1189
|
+
}), i = [];
|
|
1190
|
+
return this._trans("readwrite", function(a) {
|
|
1191
|
+
var o = t.core;
|
|
1192
|
+
return o.getMany({
|
|
1193
|
+
trans: a,
|
|
1194
|
+
keys: n,
|
|
1195
|
+
cache: "clone"
|
|
1196
|
+
}).then(function(s) {
|
|
1197
|
+
var c = o.schema.primaryKey, l = c.outbound, u = c.extractKey, d = [], f = [];
|
|
1198
|
+
e.forEach(function(e, t) {
|
|
1199
|
+
var n = e.key, r = e.changes, a = s[t];
|
|
1200
|
+
if (a) {
|
|
1201
|
+
for (var o = 0, c = Object.keys(r); o < c.length; o++) {
|
|
1202
|
+
var p = c[o];
|
|
1203
|
+
w(a, p, r[p]);
|
|
1204
|
+
}
|
|
1205
|
+
if (!l && K(u(a), n) !== 0) throw new O.Constraint("Cannot update primary key in bulkUpdate()");
|
|
1206
|
+
i.push(t), d.push(n), f.push(a);
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
var p = d.length;
|
|
1210
|
+
return o.mutate({
|
|
1211
|
+
trans: a,
|
|
1212
|
+
type: "put",
|
|
1213
|
+
keys: d,
|
|
1214
|
+
values: f,
|
|
1215
|
+
updates: {
|
|
1216
|
+
keys: n,
|
|
1217
|
+
changeSpecs: r
|
|
1218
|
+
}
|
|
1219
|
+
}).then(function(e) {
|
|
1220
|
+
var n = e.numFailures, r = e.failures;
|
|
1221
|
+
if (n === 0) return p;
|
|
1222
|
+
for (var a = 0, o = Object.keys(r); a < o.length; a++) {
|
|
1223
|
+
var s = o[a], c = i[Number(s)];
|
|
1224
|
+
if (c != null) {
|
|
1225
|
+
var l = r[s];
|
|
1226
|
+
delete r[s], r[c] = l;
|
|
1227
|
+
}
|
|
1228
|
+
}
|
|
1229
|
+
throw new Se(`${t.name}.bulkUpdate(): ${n} of ${p} operations failed`, r);
|
|
1230
|
+
});
|
|
1231
|
+
});
|
|
1232
|
+
});
|
|
1233
|
+
}, e.prototype.bulkDelete = function(e) {
|
|
1234
|
+
var t = this, n = e.length;
|
|
1235
|
+
return this._trans("readwrite", function(n) {
|
|
1236
|
+
return t.core.mutate({
|
|
1237
|
+
trans: n,
|
|
1238
|
+
type: "delete",
|
|
1239
|
+
keys: e
|
|
1240
|
+
}).then(function(n) {
|
|
1241
|
+
return Vt(t, e, n);
|
|
1242
|
+
});
|
|
1243
|
+
}).then(function(e) {
|
|
1244
|
+
var r = e.numFailures, i = e.lastResult, a = e.failures;
|
|
1245
|
+
if (r === 0) return i;
|
|
1246
|
+
throw new Se(`${t.name}.bulkDelete(): ${r} of ${n} operations failed`, a);
|
|
1247
|
+
});
|
|
1248
|
+
}, e;
|
|
1249
|
+
}();
|
|
1250
|
+
function Gt(e) {
|
|
1251
|
+
var t = {}, n = function(n, r) {
|
|
1252
|
+
if (r) {
|
|
1253
|
+
for (var i = arguments.length, a = Array(i - 1); --i;) a[i - 1] = arguments[i];
|
|
1254
|
+
return t[n].subscribe.apply(null, a), e;
|
|
1255
|
+
}
|
|
1256
|
+
if (typeof n == "string") return t[n];
|
|
1257
|
+
};
|
|
1258
|
+
n.addEventType = s;
|
|
1259
|
+
for (var r = 1, i = arguments.length; r < i; ++r) s(arguments[r]);
|
|
1260
|
+
return n;
|
|
1261
|
+
function s(e, r, i) {
|
|
1262
|
+
if (typeof e == "object") return c(e);
|
|
1263
|
+
r ||= Me, i ||= k;
|
|
1264
|
+
var a = {
|
|
1265
|
+
subscribers: [],
|
|
1266
|
+
fire: i,
|
|
1267
|
+
subscribe: function(e) {
|
|
1268
|
+
a.subscribers.indexOf(e) === -1 && (a.subscribers.push(e), a.fire = r(a.fire, e));
|
|
1269
|
+
},
|
|
1270
|
+
unsubscribe: function(e) {
|
|
1271
|
+
a.subscribers = a.subscribers.filter(function(t) {
|
|
1272
|
+
return t !== e;
|
|
1273
|
+
}), a.fire = a.subscribers.reduce(r, i);
|
|
1274
|
+
}
|
|
1275
|
+
};
|
|
1276
|
+
return t[e] = n[e] = a, a;
|
|
1277
|
+
}
|
|
1278
|
+
function c(e) {
|
|
1279
|
+
a(e).forEach(function(t) {
|
|
1280
|
+
var n = e[t];
|
|
1281
|
+
if (o(n)) s(t, e[t][0], e[t][1]);
|
|
1282
|
+
else if (n === "asap") var r = s(t, De, function() {
|
|
1283
|
+
for (var e = arguments.length, t = Array(e); e--;) t[e] = arguments[e];
|
|
1284
|
+
r.subscribers.forEach(function(e) {
|
|
1285
|
+
x(function() {
|
|
1286
|
+
e.apply(null, t);
|
|
1287
|
+
});
|
|
1288
|
+
});
|
|
1289
|
+
});
|
|
1290
|
+
else throw new O.InvalidArgument("Invalid event config");
|
|
1291
|
+
});
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
function Kt(e, t) {
|
|
1295
|
+
return m(t).from({ prototype: e }), t;
|
|
1296
|
+
}
|
|
1297
|
+
function qt(e) {
|
|
1298
|
+
return Kt(Wt.prototype, function(t, n, r) {
|
|
1299
|
+
this.db = e, this._tx = r, this.name = t, this.schema = n, this.hook = e._allTables[t] ? e._allTables[t].hook : Gt(null, {
|
|
1300
|
+
creating: [ke, k],
|
|
1301
|
+
reading: [Oe, De],
|
|
1302
|
+
updating: [je, k],
|
|
1303
|
+
deleting: [Ae, k]
|
|
1304
|
+
});
|
|
1305
|
+
});
|
|
1306
|
+
}
|
|
1307
|
+
function Jt(e, t) {
|
|
1308
|
+
return !(e.filter || e.algorithm || e.or) && (t ? e.justLimit : !e.replayFilter);
|
|
1309
|
+
}
|
|
1310
|
+
function Yt(e, t) {
|
|
1311
|
+
e.filter = G(e.filter, t);
|
|
1312
|
+
}
|
|
1313
|
+
function Xt(e, t, n) {
|
|
1314
|
+
var r = e.replayFilter;
|
|
1315
|
+
e.replayFilter = r ? function() {
|
|
1316
|
+
return G(r(), t());
|
|
1317
|
+
} : t, e.justLimit = n && !r;
|
|
1318
|
+
}
|
|
1319
|
+
function Zt(e, t) {
|
|
1320
|
+
e.isMatch = G(e.isMatch, t);
|
|
1321
|
+
}
|
|
1322
|
+
function Qt(e, t) {
|
|
1323
|
+
if (e.isPrimKey) return t.primaryKey;
|
|
1324
|
+
var n = t.getIndexByKeyPath(e.index);
|
|
1325
|
+
if (!n) throw new O.Schema("KeyPath " + e.index + " on object store " + t.name + " is not indexed");
|
|
1326
|
+
return n;
|
|
1327
|
+
}
|
|
1328
|
+
function $t(e, t, n) {
|
|
1329
|
+
var r = Qt(e, t.schema);
|
|
1330
|
+
return t.openCursor({
|
|
1331
|
+
trans: n,
|
|
1332
|
+
values: !e.keysOnly,
|
|
1333
|
+
reverse: e.dir === "prev",
|
|
1334
|
+
unique: !!e.unique,
|
|
1335
|
+
query: {
|
|
1336
|
+
index: r,
|
|
1337
|
+
range: e.range
|
|
1338
|
+
}
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
function en(e, t, n, r) {
|
|
1342
|
+
var i = e.replayFilter ? G(e.filter, e.replayFilter()) : e.filter;
|
|
1343
|
+
if (e.or) {
|
|
1344
|
+
var a = {}, o = function(e, n, r) {
|
|
1345
|
+
if (!i || i(n, r, function(e) {
|
|
1346
|
+
return n.stop(e);
|
|
1347
|
+
}, function(e) {
|
|
1348
|
+
return n.fail(e);
|
|
1349
|
+
})) {
|
|
1350
|
+
var o = n.primaryKey, s = "" + o;
|
|
1351
|
+
s === "[object ArrayBuffer]" && (s = "" + new Uint8Array(o)), u(a, s) || (a[s] = !0, t(e, n, r));
|
|
1352
|
+
}
|
|
1353
|
+
};
|
|
1354
|
+
return Promise.all([e.or._iterate(o, n), tn($t(e, r, n), e.algorithm, o, !e.keysOnly && e.valueMapper)]);
|
|
1355
|
+
}
|
|
1356
|
+
return tn($t(e, r, n), G(e.algorithm, i), t, !e.keysOnly && e.valueMapper);
|
|
1357
|
+
}
|
|
1358
|
+
function tn(e, t, n, r) {
|
|
1359
|
+
var i = I(r ? function(e, t, i) {
|
|
1360
|
+
return n(r(e), t, i);
|
|
1361
|
+
} : n);
|
|
1362
|
+
return e.then(function(e) {
|
|
1363
|
+
if (e) return e.start(function() {
|
|
1364
|
+
var n = function() {
|
|
1365
|
+
return e.continue();
|
|
1366
|
+
};
|
|
1367
|
+
(!t || t(e, function(e) {
|
|
1368
|
+
return n = e;
|
|
1369
|
+
}, function(t) {
|
|
1370
|
+
e.stop(t), n = k;
|
|
1371
|
+
}, function(t) {
|
|
1372
|
+
e.fail(t), n = k;
|
|
1373
|
+
})) && i(e.value, e, function(e) {
|
|
1374
|
+
return n = e;
|
|
1375
|
+
}), n();
|
|
1376
|
+
});
|
|
1377
|
+
});
|
|
1378
|
+
}
|
|
1379
|
+
var nn = function() {
|
|
1380
|
+
function e() {}
|
|
1381
|
+
return e.prototype._read = function(e, t) {
|
|
1382
|
+
var n = this._ctx;
|
|
1383
|
+
return n.error ? n.table._trans(null, H.bind(null, n.error)) : n.table._trans("readonly", e).then(t);
|
|
1384
|
+
}, e.prototype._write = function(e) {
|
|
1385
|
+
var t = this._ctx;
|
|
1386
|
+
return t.error ? t.table._trans(null, H.bind(null, t.error)) : t.table._trans("readwrite", e, "locked");
|
|
1387
|
+
}, e.prototype._addAlgorithm = function(e) {
|
|
1388
|
+
var t = this._ctx;
|
|
1389
|
+
t.algorithm = G(t.algorithm, e);
|
|
1390
|
+
}, e.prototype._iterate = function(e, t) {
|
|
1391
|
+
return en(this._ctx, e, t, this._ctx.table.core);
|
|
1392
|
+
}, e.prototype.clone = function(e) {
|
|
1393
|
+
var t = Object.create(this.constructor.prototype), n = Object.create(this._ctx);
|
|
1394
|
+
return e && s(n, e), t._ctx = n, t;
|
|
1395
|
+
}, e.prototype.raw = function() {
|
|
1396
|
+
return this._ctx.valueMapper = null, this;
|
|
1397
|
+
}, e.prototype.each = function(e) {
|
|
1398
|
+
var t = this._ctx;
|
|
1399
|
+
return this._read(function(n) {
|
|
1400
|
+
return en(t, e, n, t.table.core);
|
|
1401
|
+
});
|
|
1402
|
+
}, e.prototype.count = function(e) {
|
|
1403
|
+
var t = this;
|
|
1404
|
+
return this._read(function(e) {
|
|
1405
|
+
var n = t._ctx, r = n.table.core;
|
|
1406
|
+
if (Jt(n, !0)) return r.count({
|
|
1407
|
+
trans: e,
|
|
1408
|
+
query: {
|
|
1409
|
+
index: Qt(n, r.schema),
|
|
1410
|
+
range: n.range
|
|
1411
|
+
}
|
|
1412
|
+
}).then(function(e) {
|
|
1413
|
+
return Math.min(e, n.limit);
|
|
1414
|
+
});
|
|
1415
|
+
var i = 0;
|
|
1416
|
+
return en(n, function() {
|
|
1417
|
+
return ++i, !1;
|
|
1418
|
+
}, e, r).then(function() {
|
|
1419
|
+
return i;
|
|
1420
|
+
});
|
|
1421
|
+
}).then(e);
|
|
1422
|
+
}, e.prototype.sortBy = function(e, t) {
|
|
1423
|
+
var n = e.split(".").reverse(), r = n[0], i = n.length - 1;
|
|
1424
|
+
function a(e, t) {
|
|
1425
|
+
return t ? a(e[n[t]], t - 1) : e[r];
|
|
1426
|
+
}
|
|
1427
|
+
var o = this._ctx.dir === "next" ? 1 : -1;
|
|
1428
|
+
function s(e, t) {
|
|
1429
|
+
return K(a(e, i), a(t, i)) * o;
|
|
1430
|
+
}
|
|
1431
|
+
return this.toArray(function(e) {
|
|
1432
|
+
return e.slice().sort(s);
|
|
1433
|
+
}).then(t);
|
|
1434
|
+
}, e.prototype.toArray = function(e) {
|
|
1435
|
+
var t = this;
|
|
1436
|
+
return this._read(function(e) {
|
|
1437
|
+
var n = t._ctx;
|
|
1438
|
+
if (Jt(n, !0) && n.limit > 0) {
|
|
1439
|
+
var r = n.valueMapper, i = Qt(n, n.table.core.schema);
|
|
1440
|
+
return n.table.core.query({
|
|
1441
|
+
trans: e,
|
|
1442
|
+
limit: n.limit,
|
|
1443
|
+
values: !0,
|
|
1444
|
+
direction: n.dir === "prev" ? "prev" : void 0,
|
|
1445
|
+
query: {
|
|
1446
|
+
index: i,
|
|
1447
|
+
range: n.range
|
|
1448
|
+
}
|
|
1449
|
+
}).then(function(e) {
|
|
1450
|
+
var t = e.result;
|
|
1451
|
+
return r ? t.map(r) : t;
|
|
1452
|
+
});
|
|
1453
|
+
}
|
|
1454
|
+
var a = [];
|
|
1455
|
+
return en(n, function(e) {
|
|
1456
|
+
return a.push(e);
|
|
1457
|
+
}, e, n.table.core).then(function() {
|
|
1458
|
+
return a;
|
|
1459
|
+
});
|
|
1460
|
+
}, e);
|
|
1461
|
+
}, e.prototype.offset = function(e) {
|
|
1462
|
+
var t = this._ctx;
|
|
1463
|
+
return e <= 0 || (t.offset += e, Jt(t) ? Xt(t, function() {
|
|
1464
|
+
var t = e;
|
|
1465
|
+
return function(e, n) {
|
|
1466
|
+
return t === 0 ? !0 : t === 1 ? (--t, !1) : (n(function() {
|
|
1467
|
+
e.advance(t), t = 0;
|
|
1468
|
+
}), !1);
|
|
1469
|
+
};
|
|
1470
|
+
}) : Xt(t, function() {
|
|
1471
|
+
var t = e;
|
|
1472
|
+
return function() {
|
|
1473
|
+
return --t < 0;
|
|
1474
|
+
};
|
|
1475
|
+
})), this;
|
|
1476
|
+
}, e.prototype.limit = function(e) {
|
|
1477
|
+
return this._ctx.limit = Math.min(this._ctx.limit, e), Xt(this._ctx, function() {
|
|
1478
|
+
var t = e;
|
|
1479
|
+
return function(e, n, r) {
|
|
1480
|
+
return --t <= 0 && n(r), t >= 0;
|
|
1481
|
+
};
|
|
1482
|
+
}, !0), this;
|
|
1483
|
+
}, e.prototype.until = function(e, t) {
|
|
1484
|
+
return Yt(this._ctx, function(n, r, i) {
|
|
1485
|
+
return !e(n.value) || (r(i), t);
|
|
1486
|
+
}), this;
|
|
1487
|
+
}, e.prototype.first = function(e) {
|
|
1488
|
+
return this.limit(1).toArray(function(e) {
|
|
1489
|
+
return e[0];
|
|
1490
|
+
}).then(e);
|
|
1491
|
+
}, e.prototype.last = function(e) {
|
|
1492
|
+
return this.reverse().first(e);
|
|
1493
|
+
}, e.prototype.filter = function(e) {
|
|
1494
|
+
return Yt(this._ctx, function(t) {
|
|
1495
|
+
return e(t.value);
|
|
1496
|
+
}), Zt(this._ctx, e), this;
|
|
1497
|
+
}, e.prototype.and = function(e) {
|
|
1498
|
+
return this.filter(e);
|
|
1499
|
+
}, e.prototype.or = function(e) {
|
|
1500
|
+
return new this.db.WhereClause(this._ctx.table, e, this);
|
|
1501
|
+
}, e.prototype.reverse = function() {
|
|
1502
|
+
return this._ctx.dir = this._ctx.dir === "prev" ? "next" : "prev", this._ondirectionchange && this._ondirectionchange(this._ctx.dir), this;
|
|
1503
|
+
}, e.prototype.desc = function() {
|
|
1504
|
+
return this.reverse();
|
|
1505
|
+
}, e.prototype.eachKey = function(e) {
|
|
1506
|
+
var t = this._ctx;
|
|
1507
|
+
return t.keysOnly = !t.isMatch, this.each(function(t, n) {
|
|
1508
|
+
e(n.key, n);
|
|
1509
|
+
});
|
|
1510
|
+
}, e.prototype.eachUniqueKey = function(e) {
|
|
1511
|
+
return this._ctx.unique = "unique", this.eachKey(e);
|
|
1512
|
+
}, e.prototype.eachPrimaryKey = function(e) {
|
|
1513
|
+
var t = this._ctx;
|
|
1514
|
+
return t.keysOnly = !t.isMatch, this.each(function(t, n) {
|
|
1515
|
+
e(n.primaryKey, n);
|
|
1516
|
+
});
|
|
1517
|
+
}, e.prototype.keys = function(e) {
|
|
1518
|
+
var t = this._ctx;
|
|
1519
|
+
t.keysOnly = !t.isMatch;
|
|
1520
|
+
var n = [];
|
|
1521
|
+
return this.each(function(e, t) {
|
|
1522
|
+
n.push(t.key);
|
|
1523
|
+
}).then(function() {
|
|
1524
|
+
return n;
|
|
1525
|
+
}).then(e);
|
|
1526
|
+
}, e.prototype.primaryKeys = function(e) {
|
|
1527
|
+
var t = this._ctx;
|
|
1528
|
+
if (Jt(t, !0) && t.limit > 0) return this._read(function(e) {
|
|
1529
|
+
var n = Qt(t, t.table.core.schema);
|
|
1530
|
+
return t.table.core.query({
|
|
1531
|
+
trans: e,
|
|
1532
|
+
values: !1,
|
|
1533
|
+
limit: t.limit,
|
|
1534
|
+
direction: t.dir === "prev" ? "prev" : void 0,
|
|
1535
|
+
query: {
|
|
1536
|
+
index: n,
|
|
1537
|
+
range: t.range
|
|
1538
|
+
}
|
|
1539
|
+
});
|
|
1540
|
+
}).then(function(e) {
|
|
1541
|
+
return e.result;
|
|
1542
|
+
}).then(e);
|
|
1543
|
+
t.keysOnly = !t.isMatch;
|
|
1544
|
+
var n = [];
|
|
1545
|
+
return this.each(function(e, t) {
|
|
1546
|
+
n.push(t.primaryKey);
|
|
1547
|
+
}).then(function() {
|
|
1548
|
+
return n;
|
|
1549
|
+
}).then(e);
|
|
1550
|
+
}, e.prototype.uniqueKeys = function(e) {
|
|
1551
|
+
return this._ctx.unique = "unique", this.keys(e);
|
|
1552
|
+
}, e.prototype.firstKey = function(e) {
|
|
1553
|
+
return this.limit(1).keys(function(e) {
|
|
1554
|
+
return e[0];
|
|
1555
|
+
}).then(e);
|
|
1556
|
+
}, e.prototype.lastKey = function(e) {
|
|
1557
|
+
return this.reverse().firstKey(e);
|
|
1558
|
+
}, e.prototype.distinct = function() {
|
|
1559
|
+
var e = this._ctx, t = e.index && e.table.schema.idxByName[e.index];
|
|
1560
|
+
if (!t || !t.multi) return this;
|
|
1561
|
+
var n = {};
|
|
1562
|
+
return Yt(this._ctx, function(e) {
|
|
1563
|
+
var t = e.primaryKey.toString(), r = u(n, t);
|
|
1564
|
+
return n[t] = !0, !r;
|
|
1565
|
+
}), this;
|
|
1566
|
+
}, e.prototype.modify = function(e) {
|
|
1567
|
+
var t = this, n = this._ctx;
|
|
1568
|
+
return this._write(function(r) {
|
|
1569
|
+
var i = typeof e == "function" ? e : function(t) {
|
|
1570
|
+
return Ut(t, e);
|
|
1571
|
+
}, o = n.table.core, s = o.schema.primaryKey, c = s.outbound, l = s.extractKey, u = 200, d = t.db._options.modifyChunkSize;
|
|
1572
|
+
d && (u = typeof d == "object" ? d[o.name] || d["*"] || 200 : d);
|
|
1573
|
+
var f = [], p = 0, m = [], h = function(e, t) {
|
|
1574
|
+
var n = t.failures, r = t.numFailures;
|
|
1575
|
+
p += e - r;
|
|
1576
|
+
for (var i = 0, o = a(n); i < o.length; i++) {
|
|
1577
|
+
var s = o[i];
|
|
1578
|
+
f.push(n[s]);
|
|
1579
|
+
}
|
|
1580
|
+
}, g = e === rn;
|
|
1581
|
+
return t.clone().primaryKeys().then(function(t) {
|
|
1582
|
+
var a = Jt(n) && n.limit === 1e400 && (typeof e != "function" || g) && {
|
|
1583
|
+
index: n.index,
|
|
1584
|
+
range: n.range
|
|
1585
|
+
}, s = function(d) {
|
|
1586
|
+
var f = Math.min(u, t.length - d), p = t.slice(d, d + f);
|
|
1587
|
+
return (g ? Promise.resolve([]) : o.getMany({
|
|
1588
|
+
trans: r,
|
|
1589
|
+
keys: p,
|
|
1590
|
+
cache: "immutable"
|
|
1591
|
+
})).then(function(m) {
|
|
1592
|
+
var _ = [], v = [], y = c ? [] : null, b = g ? p : [];
|
|
1593
|
+
if (!g) for (var x = 0; x < f; ++x) {
|
|
1594
|
+
var S = m[x], C = {
|
|
1595
|
+
value: T(S),
|
|
1596
|
+
primKey: t[d + x]
|
|
1597
|
+
};
|
|
1598
|
+
i.call(C, C.value, C) !== !1 && (C.value == null ? b.push(t[d + x]) : !c && K(l(S), l(C.value)) !== 0 ? (b.push(t[d + x]), _.push(C.value)) : (v.push(C.value), c && y.push(t[d + x])));
|
|
1599
|
+
}
|
|
1600
|
+
return Promise.resolve(_.length > 0 && o.mutate({
|
|
1601
|
+
trans: r,
|
|
1602
|
+
type: "add",
|
|
1603
|
+
values: _
|
|
1604
|
+
}).then(function(e) {
|
|
1605
|
+
for (var t in e.failures) b.splice(parseInt(t), 1);
|
|
1606
|
+
h(_.length, e);
|
|
1607
|
+
})).then(function() {
|
|
1608
|
+
return (v.length > 0 || a && typeof e == "object") && o.mutate({
|
|
1609
|
+
trans: r,
|
|
1610
|
+
type: "put",
|
|
1611
|
+
keys: y,
|
|
1612
|
+
values: v,
|
|
1613
|
+
criteria: a,
|
|
1614
|
+
changeSpec: typeof e != "function" && e,
|
|
1615
|
+
isAdditionalChunk: d > 0
|
|
1616
|
+
}).then(function(e) {
|
|
1617
|
+
return h(v.length, e);
|
|
1618
|
+
});
|
|
1619
|
+
}).then(function() {
|
|
1620
|
+
return (b.length > 0 || a && g) && o.mutate({
|
|
1621
|
+
trans: r,
|
|
1622
|
+
type: "delete",
|
|
1623
|
+
keys: b,
|
|
1624
|
+
criteria: a,
|
|
1625
|
+
isAdditionalChunk: d > 0
|
|
1626
|
+
}).then(function(e) {
|
|
1627
|
+
return Vt(n.table, b, e);
|
|
1628
|
+
}).then(function(e) {
|
|
1629
|
+
return h(b.length, e);
|
|
1630
|
+
});
|
|
1631
|
+
}).then(function() {
|
|
1632
|
+
return t.length > d + f && s(d + u);
|
|
1633
|
+
});
|
|
1634
|
+
});
|
|
1635
|
+
};
|
|
1636
|
+
return s(0).then(function() {
|
|
1637
|
+
if (f.length > 0) throw new xe("Error modifying one or more objects", f, p, m);
|
|
1638
|
+
return t.length;
|
|
1639
|
+
});
|
|
1640
|
+
});
|
|
1641
|
+
});
|
|
1642
|
+
}, e.prototype.delete = function() {
|
|
1643
|
+
var e = this._ctx, t = e.range;
|
|
1644
|
+
return Jt(e) && !e.table.schema.yProps && (e.isPrimKey || t.type === 3) ? this._write(function(n) {
|
|
1645
|
+
var r = e.table.core.schema.primaryKey, i = t;
|
|
1646
|
+
return e.table.core.count({
|
|
1647
|
+
trans: n,
|
|
1648
|
+
query: {
|
|
1649
|
+
index: r,
|
|
1650
|
+
range: i
|
|
1651
|
+
}
|
|
1652
|
+
}).then(function(t) {
|
|
1653
|
+
return e.table.core.mutate({
|
|
1654
|
+
trans: n,
|
|
1655
|
+
type: "deleteRange",
|
|
1656
|
+
range: i
|
|
1657
|
+
}).then(function(e) {
|
|
1658
|
+
var n = e.failures, r = e.numFailures;
|
|
1659
|
+
if (r) throw new xe("Could not delete some values", Object.keys(n).map(function(e) {
|
|
1660
|
+
return n[e];
|
|
1661
|
+
}), t - r);
|
|
1662
|
+
return t - r;
|
|
1663
|
+
});
|
|
1664
|
+
});
|
|
1665
|
+
}) : this.modify(rn);
|
|
1666
|
+
}, e;
|
|
1667
|
+
}(), rn = function(e, t) {
|
|
1668
|
+
return t.value = null;
|
|
1669
|
+
};
|
|
1670
|
+
function an(e) {
|
|
1671
|
+
return Kt(nn.prototype, function(t, n) {
|
|
1672
|
+
this.db = e;
|
|
1673
|
+
var r = Pt, i = null;
|
|
1674
|
+
if (n) try {
|
|
1675
|
+
r = n();
|
|
1676
|
+
} catch (e) {
|
|
1677
|
+
i = e;
|
|
1678
|
+
}
|
|
1679
|
+
var a = t._ctx, o = a.table, s = o.hook.reading.fire;
|
|
1680
|
+
this._ctx = {
|
|
1681
|
+
table: o,
|
|
1682
|
+
index: a.index,
|
|
1683
|
+
isPrimKey: !a.index || o.schema.primKey.keyPath && a.index === o.schema.primKey.name,
|
|
1684
|
+
range: r,
|
|
1685
|
+
keysOnly: !1,
|
|
1686
|
+
dir: "next",
|
|
1687
|
+
unique: "",
|
|
1688
|
+
algorithm: null,
|
|
1689
|
+
filter: null,
|
|
1690
|
+
replayFilter: null,
|
|
1691
|
+
justLimit: !0,
|
|
1692
|
+
isMatch: null,
|
|
1693
|
+
offset: 0,
|
|
1694
|
+
limit: 1e400,
|
|
1695
|
+
error: i,
|
|
1696
|
+
or: a.or,
|
|
1697
|
+
valueMapper: s === De ? null : s
|
|
1698
|
+
};
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
function on(e, t) {
|
|
1702
|
+
return e < t ? -1 : e === t ? 0 : 1;
|
|
1703
|
+
}
|
|
1704
|
+
function sn(e, t) {
|
|
1705
|
+
return e > t ? -1 : e === t ? 0 : 1;
|
|
1706
|
+
}
|
|
1707
|
+
function q(e, t, n) {
|
|
1708
|
+
var r = e instanceof mn ? new e.Collection(e) : e;
|
|
1709
|
+
return r._ctx.error = n ? new n(t) : TypeError(t), r;
|
|
1710
|
+
}
|
|
1711
|
+
function cn(e) {
|
|
1712
|
+
var t = new e.Collection(e, function() {
|
|
1713
|
+
return pn("");
|
|
1714
|
+
});
|
|
1715
|
+
return t._addAlgorithm(function() {
|
|
1716
|
+
return !1;
|
|
1717
|
+
}), t;
|
|
1718
|
+
}
|
|
1719
|
+
function ln(e) {
|
|
1720
|
+
return e === "next" ? function(e) {
|
|
1721
|
+
return e.toUpperCase();
|
|
1722
|
+
} : function(e) {
|
|
1723
|
+
return e.toLowerCase();
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
function un(e) {
|
|
1727
|
+
return e === "next" ? function(e) {
|
|
1728
|
+
return e.toLowerCase();
|
|
1729
|
+
} : function(e) {
|
|
1730
|
+
return e.toUpperCase();
|
|
1731
|
+
};
|
|
1732
|
+
}
|
|
1733
|
+
function dn(e, t, n, r, i, a) {
|
|
1734
|
+
for (var o = Math.min(e.length, r.length), s = -1, c = 0; c < o; ++c) {
|
|
1735
|
+
var l = t[c];
|
|
1736
|
+
if (l !== r[c]) return i(e[c], n[c]) < 0 ? e.substr(0, c) + n[c] + n.substr(c + 1) : i(e[c], r[c]) < 0 ? e.substr(0, c) + r[c] + n.substr(c + 1) : s >= 0 ? e.substr(0, s) + t[s] + n.substr(s + 1) : null;
|
|
1737
|
+
i(e[c], l) < 0 && (s = c);
|
|
1738
|
+
}
|
|
1739
|
+
return o < r.length && a === "next" ? e + n.substr(e.length) : o < e.length && a === "prev" ? e.substr(0, n.length) : s < 0 ? null : e.substr(0, s) + r[s] + n.substr(s + 1);
|
|
1740
|
+
}
|
|
1741
|
+
function fn(e, t, n, r) {
|
|
1742
|
+
var i, a, o, s, c, l, u, d = n.length;
|
|
1743
|
+
if (!n.every(function(e) {
|
|
1744
|
+
return typeof e == "string";
|
|
1745
|
+
})) return q(e, kt);
|
|
1746
|
+
function f(e) {
|
|
1747
|
+
i = ln(e), a = un(e), o = e === "next" ? on : sn;
|
|
1748
|
+
var t = n.map(function(e) {
|
|
1749
|
+
return {
|
|
1750
|
+
lower: a(e),
|
|
1751
|
+
upper: i(e)
|
|
1752
|
+
};
|
|
1753
|
+
}).sort(function(e, t) {
|
|
1754
|
+
return o(e.lower, t.lower);
|
|
1755
|
+
});
|
|
1756
|
+
s = t.map(function(e) {
|
|
1757
|
+
return e.upper;
|
|
1758
|
+
}), c = t.map(function(e) {
|
|
1759
|
+
return e.lower;
|
|
1760
|
+
}), l = e, u = e === "next" ? "" : r;
|
|
1761
|
+
}
|
|
1762
|
+
f("next");
|
|
1763
|
+
var p = new e.Collection(e, function() {
|
|
1764
|
+
return J(s[0], c[d - 1] + r);
|
|
1765
|
+
});
|
|
1766
|
+
p._ondirectionchange = function(e) {
|
|
1767
|
+
f(e);
|
|
1768
|
+
};
|
|
1769
|
+
var m = 0;
|
|
1770
|
+
return p._addAlgorithm(function(e, n, r) {
|
|
1771
|
+
var i = e.key;
|
|
1772
|
+
if (typeof i != "string") return !1;
|
|
1773
|
+
var f = a(i);
|
|
1774
|
+
if (t(f, c, m)) return !0;
|
|
1775
|
+
for (var p = null, h = m; h < d; ++h) {
|
|
1776
|
+
var g = dn(i, f, s[h], c[h], o, l);
|
|
1777
|
+
g === null && p === null ? m = h + 1 : (p === null || o(p, g) > 0) && (p = g);
|
|
1778
|
+
}
|
|
1779
|
+
return n(p === null ? r : function() {
|
|
1780
|
+
e.continue(p + u);
|
|
1781
|
+
}), !1;
|
|
1782
|
+
}), p;
|
|
1783
|
+
}
|
|
1784
|
+
function J(e, t, n, r) {
|
|
1785
|
+
return {
|
|
1786
|
+
type: 2,
|
|
1787
|
+
lower: e,
|
|
1788
|
+
upper: t,
|
|
1789
|
+
lowerOpen: n,
|
|
1790
|
+
upperOpen: r
|
|
1791
|
+
};
|
|
1792
|
+
}
|
|
1793
|
+
function pn(e) {
|
|
1794
|
+
return {
|
|
1795
|
+
type: 1,
|
|
1796
|
+
lower: e,
|
|
1797
|
+
upper: e
|
|
1798
|
+
};
|
|
1799
|
+
}
|
|
1800
|
+
var mn = function() {
|
|
1801
|
+
function e() {}
|
|
1802
|
+
return Object.defineProperty(e.prototype, "Collection", {
|
|
1803
|
+
get: function() {
|
|
1804
|
+
return this._ctx.table.db.Collection;
|
|
1805
|
+
},
|
|
1806
|
+
enumerable: !1,
|
|
1807
|
+
configurable: !0
|
|
1808
|
+
}), e.prototype.between = function(e, t, n, r) {
|
|
1809
|
+
n = n !== !1, r = r === !0;
|
|
1810
|
+
try {
|
|
1811
|
+
return this._cmp(e, t) > 0 || this._cmp(e, t) === 0 && (n || r) && !(n && r) ? cn(this) : new this.Collection(this, function() {
|
|
1812
|
+
return J(e, t, !n, !r);
|
|
1813
|
+
});
|
|
1814
|
+
} catch {
|
|
1815
|
+
return q(this, W);
|
|
1816
|
+
}
|
|
1817
|
+
}, e.prototype.equals = function(e) {
|
|
1818
|
+
return e == null ? q(this, W) : new this.Collection(this, function() {
|
|
1819
|
+
return pn(e);
|
|
1820
|
+
});
|
|
1821
|
+
}, e.prototype.above = function(e) {
|
|
1822
|
+
return e == null ? q(this, W) : new this.Collection(this, function() {
|
|
1823
|
+
return J(e, void 0, !0);
|
|
1824
|
+
});
|
|
1825
|
+
}, e.prototype.aboveOrEqual = function(e) {
|
|
1826
|
+
return e == null ? q(this, W) : new this.Collection(this, function() {
|
|
1827
|
+
return J(e, void 0, !1);
|
|
1828
|
+
});
|
|
1829
|
+
}, e.prototype.below = function(e) {
|
|
1830
|
+
return e == null ? q(this, W) : new this.Collection(this, function() {
|
|
1831
|
+
return J(void 0, e, !1, !0);
|
|
1832
|
+
});
|
|
1833
|
+
}, e.prototype.belowOrEqual = function(e) {
|
|
1834
|
+
return e == null ? q(this, W) : new this.Collection(this, function() {
|
|
1835
|
+
return J(void 0, e);
|
|
1836
|
+
});
|
|
1837
|
+
}, e.prototype.startsWith = function(e) {
|
|
1838
|
+
return typeof e == "string" ? this.between(e, e + U, !0, !0) : q(this, kt);
|
|
1839
|
+
}, e.prototype.startsWithIgnoreCase = function(e) {
|
|
1840
|
+
return e === "" ? this.startsWith(e) : fn(this, function(e, t) {
|
|
1841
|
+
return e.indexOf(t[0]) === 0;
|
|
1842
|
+
}, [e], U);
|
|
1843
|
+
}, e.prototype.equalsIgnoreCase = function(e) {
|
|
1844
|
+
return fn(this, function(e, t) {
|
|
1845
|
+
return e === t[0];
|
|
1846
|
+
}, [e], "");
|
|
1847
|
+
}, e.prototype.anyOfIgnoreCase = function() {
|
|
1848
|
+
var e = D.apply(pe, arguments);
|
|
1849
|
+
return e.length === 0 ? cn(this) : fn(this, function(e, t) {
|
|
1850
|
+
return t.indexOf(e) !== -1;
|
|
1851
|
+
}, e, "");
|
|
1852
|
+
}, e.prototype.startsWithAnyOfIgnoreCase = function() {
|
|
1853
|
+
var e = D.apply(pe, arguments);
|
|
1854
|
+
return e.length === 0 ? cn(this) : fn(this, function(e, t) {
|
|
1855
|
+
return t.some(function(t) {
|
|
1856
|
+
return e.indexOf(t) === 0;
|
|
1857
|
+
});
|
|
1858
|
+
}, e, U);
|
|
1859
|
+
}, e.prototype.anyOf = function() {
|
|
1860
|
+
var e = this, t = D.apply(pe, arguments), n = this._cmp;
|
|
1861
|
+
try {
|
|
1862
|
+
t.sort(n);
|
|
1863
|
+
} catch {
|
|
1864
|
+
return q(this, W);
|
|
1865
|
+
}
|
|
1866
|
+
if (t.length === 0) return cn(this);
|
|
1867
|
+
var r = new this.Collection(this, function() {
|
|
1868
|
+
return J(t[0], t[t.length - 1]);
|
|
1869
|
+
});
|
|
1870
|
+
r._ondirectionchange = function(r) {
|
|
1871
|
+
n = r === "next" ? e._ascending : e._descending, t.sort(n);
|
|
1872
|
+
};
|
|
1873
|
+
var i = 0;
|
|
1874
|
+
return r._addAlgorithm(function(e, r, a) {
|
|
1875
|
+
for (var o = e.key; n(o, t[i]) > 0;) if (++i, i === t.length) return r(a), !1;
|
|
1876
|
+
return n(o, t[i]) === 0 || (r(function() {
|
|
1877
|
+
e.continue(t[i]);
|
|
1878
|
+
}), !1);
|
|
1879
|
+
}), r;
|
|
1880
|
+
}, e.prototype.notEqual = function(e) {
|
|
1881
|
+
return this.inAnyRange([[Ot, e], [e, this.db._maxKey]], {
|
|
1882
|
+
includeLowers: !1,
|
|
1883
|
+
includeUppers: !1
|
|
1884
|
+
});
|
|
1885
|
+
}, e.prototype.noneOf = function() {
|
|
1886
|
+
var e = D.apply(pe, arguments);
|
|
1887
|
+
if (e.length === 0) return new this.Collection(this);
|
|
1888
|
+
try {
|
|
1889
|
+
e.sort(this._ascending);
|
|
1890
|
+
} catch {
|
|
1891
|
+
return q(this, W);
|
|
1892
|
+
}
|
|
1893
|
+
var t = e.reduce(function(e, t) {
|
|
1894
|
+
return e ? e.concat([[e[e.length - 1][1], t]]) : [[Ot, t]];
|
|
1895
|
+
}, null);
|
|
1896
|
+
return t.push([e[e.length - 1], this.db._maxKey]), this.inAnyRange(t, {
|
|
1897
|
+
includeLowers: !1,
|
|
1898
|
+
includeUppers: !1
|
|
1899
|
+
});
|
|
1900
|
+
}, e.prototype.inAnyRange = function(e, t) {
|
|
1901
|
+
var n = this, r = this._cmp, i = this._ascending, a = this._descending, o = this._min, s = this._max;
|
|
1902
|
+
if (e.length === 0) return cn(this);
|
|
1903
|
+
if (!e.every(function(e) {
|
|
1904
|
+
return e[0] !== void 0 && e[1] !== void 0 && i(e[0], e[1]) <= 0;
|
|
1905
|
+
})) return q(this, "First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower", O.InvalidArgument);
|
|
1906
|
+
var c = !t || t.includeLowers !== !1, l = t && t.includeUppers === !0;
|
|
1907
|
+
function u(e, t) {
|
|
1908
|
+
for (var n = 0, i = e.length; n < i; ++n) {
|
|
1909
|
+
var a = e[n];
|
|
1910
|
+
if (r(t[0], a[1]) < 0 && r(t[1], a[0]) > 0) {
|
|
1911
|
+
a[0] = o(a[0], t[0]), a[1] = s(a[1], t[1]);
|
|
1912
|
+
break;
|
|
1913
|
+
}
|
|
1914
|
+
}
|
|
1915
|
+
return n === i && e.push(t), e;
|
|
1916
|
+
}
|
|
1917
|
+
var d = i;
|
|
1918
|
+
function f(e, t) {
|
|
1919
|
+
return d(e[0], t[0]);
|
|
1920
|
+
}
|
|
1921
|
+
var p;
|
|
1922
|
+
try {
|
|
1923
|
+
p = e.reduce(u, []), p.sort(f);
|
|
1924
|
+
} catch {
|
|
1925
|
+
return q(this, W);
|
|
1926
|
+
}
|
|
1927
|
+
var m = 0, h = l ? function(e) {
|
|
1928
|
+
return i(e, p[m][1]) > 0;
|
|
1929
|
+
} : function(e) {
|
|
1930
|
+
return i(e, p[m][1]) >= 0;
|
|
1931
|
+
}, g = c ? function(e) {
|
|
1932
|
+
return a(e, p[m][0]) > 0;
|
|
1933
|
+
} : function(e) {
|
|
1934
|
+
return a(e, p[m][0]) >= 0;
|
|
1935
|
+
};
|
|
1936
|
+
function _(e) {
|
|
1937
|
+
return !h(e) && !g(e);
|
|
1938
|
+
}
|
|
1939
|
+
var v = h, y = new this.Collection(this, function() {
|
|
1940
|
+
return J(p[0][0], p[p.length - 1][1], !c, !l);
|
|
1941
|
+
});
|
|
1942
|
+
return y._ondirectionchange = function(e) {
|
|
1943
|
+
e === "next" ? (v = h, d = i) : (v = g, d = a), p.sort(f);
|
|
1944
|
+
}, y._addAlgorithm(function(e, t, r) {
|
|
1945
|
+
for (var a = e.key; v(a);) if (++m, m === p.length) return t(r), !1;
|
|
1946
|
+
return _(a) ? !0 : (n._cmp(a, p[m][1]) === 0 || n._cmp(a, p[m][0]) === 0 || t(function() {
|
|
1947
|
+
d === i ? e.continue(p[m][0]) : e.continue(p[m][1]);
|
|
1948
|
+
}), !1);
|
|
1949
|
+
}), y;
|
|
1950
|
+
}, e.prototype.startsWithAnyOf = function() {
|
|
1951
|
+
var e = D.apply(pe, arguments);
|
|
1952
|
+
return e.every(function(e) {
|
|
1953
|
+
return typeof e == "string";
|
|
1954
|
+
}) ? e.length === 0 ? cn(this) : this.inAnyRange(e.map(function(e) {
|
|
1955
|
+
return [e, e + U];
|
|
1956
|
+
})) : q(this, "startsWithAnyOf() only works with strings");
|
|
1957
|
+
}, e;
|
|
1958
|
+
}();
|
|
1959
|
+
function hn(e) {
|
|
1960
|
+
return Kt(mn.prototype, function(t, n, r) {
|
|
1961
|
+
if (this.db = e, this._ctx = {
|
|
1962
|
+
table: t,
|
|
1963
|
+
index: n === ":id" ? null : n,
|
|
1964
|
+
or: r
|
|
1965
|
+
}, this._cmp = this._ascending = K, this._descending = function(e, t) {
|
|
1966
|
+
return K(t, e);
|
|
1967
|
+
}, this._max = function(e, t) {
|
|
1968
|
+
return K(e, t) > 0 ? e : t;
|
|
1969
|
+
}, this._min = function(e, t) {
|
|
1970
|
+
return K(e, t) < 0 ? e : t;
|
|
1971
|
+
}, this._IDBKeyRange = e._deps.IDBKeyRange, !this._IDBKeyRange) throw new O.MissingAPI();
|
|
1972
|
+
});
|
|
1973
|
+
}
|
|
1974
|
+
function Y(e) {
|
|
1975
|
+
return I(function(t) {
|
|
1976
|
+
return gn(t), e(t.target.error), !1;
|
|
1977
|
+
});
|
|
1978
|
+
}
|
|
1979
|
+
function gn(e) {
|
|
1980
|
+
e.stopPropagation && e.stopPropagation(), e.preventDefault && e.preventDefault();
|
|
1981
|
+
}
|
|
1982
|
+
var _n = "storagemutated", vn = "x-storagemutated-1", X = Gt(null, _n), yn = function() {
|
|
1983
|
+
function e() {}
|
|
1984
|
+
return e.prototype._lock = function() {
|
|
1985
|
+
return b(!N.global), ++this._reculock, this._reculock === 1 && !N.global && (N.lockOwnerFor = this), this;
|
|
1986
|
+
}, e.prototype._unlock = function() {
|
|
1987
|
+
if (b(!N.global), --this._reculock === 0) for (N.global || (N.lockOwnerFor = null); this._blockedFuncs.length > 0 && !this._locked();) {
|
|
1988
|
+
var e = this._blockedFuncs.shift();
|
|
1989
|
+
try {
|
|
1990
|
+
V(e[1], e[0]);
|
|
1991
|
+
} catch {}
|
|
1992
|
+
}
|
|
1993
|
+
return this;
|
|
1994
|
+
}, e.prototype._locked = function() {
|
|
1995
|
+
return this._reculock && N.lockOwnerFor !== this;
|
|
1996
|
+
}, e.prototype.create = function(e) {
|
|
1997
|
+
var t = this;
|
|
1998
|
+
if (!this.mode) return this;
|
|
1999
|
+
var n = this.db.idbdb, r = this.db._state.dbOpenError;
|
|
2000
|
+
if (b(!this.idbtrans), !e && !n) switch (r && r.name) {
|
|
2001
|
+
case "DatabaseClosedError": throw new O.DatabaseClosed(r);
|
|
2002
|
+
case "MissingAPIError": throw new O.MissingAPI(r.message, r);
|
|
2003
|
+
default: throw new O.OpenFailed(r);
|
|
2004
|
+
}
|
|
2005
|
+
if (!this.active) throw new O.TransactionInactive();
|
|
2006
|
+
return b(this._completion._state === null), e = this.idbtrans = e || (this.db.core ? this.db.core.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability }) : n.transaction(this.storeNames, this.mode, { durability: this.chromeTransactionDurability })), e.onerror = I(function(n) {
|
|
2007
|
+
gn(n), t._reject(e.error);
|
|
2008
|
+
}), e.onabort = I(function(n) {
|
|
2009
|
+
gn(n), t.active && t._reject(new O.Abort(e.error)), t.active = !1, t.on("abort").fire(n);
|
|
2010
|
+
}), e.oncomplete = I(function() {
|
|
2011
|
+
t.active = !1, t._resolve(), "mutatedParts" in e && X.storagemutated.fire(e.mutatedParts);
|
|
2012
|
+
}), this;
|
|
2013
|
+
}, e.prototype._promise = function(e, t, n) {
|
|
2014
|
+
var r = this;
|
|
2015
|
+
if (e === "readwrite" && this.mode !== "readwrite") return H(new O.ReadOnly("Transaction is readonly"));
|
|
2016
|
+
if (!this.active) return H(new O.TransactionInactive());
|
|
2017
|
+
if (this._locked()) return new F(function(i, a) {
|
|
2018
|
+
r._blockedFuncs.push([function() {
|
|
2019
|
+
r._promise(e, t, n).then(i, a);
|
|
2020
|
+
}, N]);
|
|
2021
|
+
});
|
|
2022
|
+
if (n) return R(function() {
|
|
2023
|
+
var e = new F(function(e, n) {
|
|
2024
|
+
r._lock();
|
|
2025
|
+
var i = t(e, n, r);
|
|
2026
|
+
i && i.then && i.then(e, n);
|
|
2027
|
+
});
|
|
2028
|
+
return e.finally(function() {
|
|
2029
|
+
return r._unlock();
|
|
2030
|
+
}), e._lib = !0, e;
|
|
2031
|
+
});
|
|
2032
|
+
var i = new F(function(e, n) {
|
|
2033
|
+
var i = t(e, n, r);
|
|
2034
|
+
i && i.then && i.then(e, n);
|
|
2035
|
+
});
|
|
2036
|
+
return i._lib = !0, i;
|
|
2037
|
+
}, e.prototype._root = function() {
|
|
2038
|
+
return this.parent ? this.parent._root() : this;
|
|
2039
|
+
}, e.prototype.waitFor = function(e) {
|
|
2040
|
+
var t = this._root(), n = F.resolve(e);
|
|
2041
|
+
if (t._waitingFor) t._waitingFor = t._waitingFor.then(function() {
|
|
2042
|
+
return n;
|
|
2043
|
+
});
|
|
2044
|
+
else {
|
|
2045
|
+
t._waitingFor = n, t._waitingQueue = [];
|
|
2046
|
+
var r = t.idbtrans.objectStore(t.storeNames[0]);
|
|
2047
|
+
(function e() {
|
|
2048
|
+
for (++t._spinCount; t._waitingQueue.length;) t._waitingQueue.shift()();
|
|
2049
|
+
t._waitingFor && (r.get(-1e400).onsuccess = e);
|
|
2050
|
+
})();
|
|
2051
|
+
}
|
|
2052
|
+
var i = t._waitingFor;
|
|
2053
|
+
return new F(function(e, r) {
|
|
2054
|
+
n.then(function(n) {
|
|
2055
|
+
return t._waitingQueue.push(I(e.bind(null, n)));
|
|
2056
|
+
}, function(e) {
|
|
2057
|
+
return t._waitingQueue.push(I(r.bind(null, e)));
|
|
2058
|
+
}).finally(function() {
|
|
2059
|
+
t._waitingFor === i && (t._waitingFor = null);
|
|
2060
|
+
});
|
|
2061
|
+
});
|
|
2062
|
+
}, e.prototype.abort = function() {
|
|
2063
|
+
this.active && (this.active = !1, this.idbtrans && this.idbtrans.abort(), this._reject(new O.Abort()));
|
|
2064
|
+
}, e.prototype.table = function(e) {
|
|
2065
|
+
var t = this._memoizedTables ||= {};
|
|
2066
|
+
if (u(t, e)) return t[e];
|
|
2067
|
+
var n = this.schema[e];
|
|
2068
|
+
if (!n) throw new O.NotFound("Table " + e + " not part of transaction");
|
|
2069
|
+
var r = new this.db.Table(e, n, this);
|
|
2070
|
+
return r.core = this.db.core.table(e), t[e] = r, r;
|
|
2071
|
+
}, e;
|
|
2072
|
+
}();
|
|
2073
|
+
function bn(e) {
|
|
2074
|
+
return Kt(yn.prototype, function(t, n, r, i, a) {
|
|
2075
|
+
var o = this;
|
|
2076
|
+
t !== "readonly" && n.forEach(function(e) {
|
|
2077
|
+
var t = r[e]?.yProps;
|
|
2078
|
+
t && (n = n.concat(t.map(function(e) {
|
|
2079
|
+
return e.updatesTable;
|
|
2080
|
+
})));
|
|
2081
|
+
}), this.db = e, this.mode = t, this.storeNames = n, this.schema = r, this.chromeTransactionDurability = i, this.idbtrans = null, this.on = Gt(this, "complete", "error", "abort"), this.parent = a || null, this.active = !0, this._reculock = 0, this._blockedFuncs = [], this._resolve = null, this._reject = null, this._waitingFor = null, this._waitingQueue = null, this._spinCount = 0, this._completion = new F(function(e, t) {
|
|
2082
|
+
o._resolve = e, o._reject = t;
|
|
2083
|
+
}), this._completion.then(function() {
|
|
2084
|
+
o.active = !1, o.on.complete.fire();
|
|
2085
|
+
}, function(e) {
|
|
2086
|
+
var t = o.active;
|
|
2087
|
+
return o.active = !1, o.on.error.fire(e), o.parent ? o.parent._reject(e) : t && o.idbtrans && o.idbtrans.abort(), H(e);
|
|
2088
|
+
});
|
|
2089
|
+
});
|
|
2090
|
+
}
|
|
2091
|
+
function xn(e, t, n, r, i, a, o, s) {
|
|
2092
|
+
return {
|
|
2093
|
+
name: e,
|
|
2094
|
+
keyPath: t,
|
|
2095
|
+
unique: n,
|
|
2096
|
+
multi: r,
|
|
2097
|
+
auto: i,
|
|
2098
|
+
compound: a,
|
|
2099
|
+
src: (n && !o ? "&" : "") + (r ? "*" : "") + (i ? "++" : "") + Sn(t),
|
|
2100
|
+
type: s
|
|
2101
|
+
};
|
|
2102
|
+
}
|
|
2103
|
+
function Sn(e) {
|
|
2104
|
+
return typeof e == "string" ? e : e ? "[" + [].join.call(e, "+") + "]" : "";
|
|
2105
|
+
}
|
|
2106
|
+
function Cn(e, t, n) {
|
|
2107
|
+
return {
|
|
2108
|
+
name: e,
|
|
2109
|
+
primKey: t,
|
|
2110
|
+
indexes: n,
|
|
2111
|
+
mappedClass: null,
|
|
2112
|
+
idxByName: S(n, function(e) {
|
|
2113
|
+
return [e.name, e];
|
|
2114
|
+
})
|
|
2115
|
+
};
|
|
2116
|
+
}
|
|
2117
|
+
function wn(e) {
|
|
2118
|
+
return e.length === 1 ? e[0] : e;
|
|
2119
|
+
}
|
|
2120
|
+
var Tn = function(e) {
|
|
2121
|
+
try {
|
|
2122
|
+
return e.only([[]]), Tn = function() {
|
|
2123
|
+
return [[]];
|
|
2124
|
+
}, [[]];
|
|
2125
|
+
} catch {
|
|
2126
|
+
return Tn = function() {
|
|
2127
|
+
return U;
|
|
2128
|
+
}, U;
|
|
2129
|
+
}
|
|
2130
|
+
};
|
|
2131
|
+
function En(e) {
|
|
2132
|
+
return e == null ? function() {} : typeof e == "string" ? Dn(e) : function(t) {
|
|
2133
|
+
return C(t, e);
|
|
2134
|
+
};
|
|
2135
|
+
}
|
|
2136
|
+
function Dn(e) {
|
|
2137
|
+
return e.split(".").length === 1 ? function(t) {
|
|
2138
|
+
return t[e];
|
|
2139
|
+
} : function(t) {
|
|
2140
|
+
return C(t, e);
|
|
2141
|
+
};
|
|
2142
|
+
}
|
|
2143
|
+
function On(e) {
|
|
2144
|
+
return [].slice.call(e);
|
|
2145
|
+
}
|
|
2146
|
+
var kn = 0;
|
|
2147
|
+
function An(e) {
|
|
2148
|
+
return e == null ? ":id" : typeof e == "string" ? e : `[${e.join("+")}]`;
|
|
2149
|
+
}
|
|
2150
|
+
function jn(e, t, n) {
|
|
2151
|
+
function r(e, t) {
|
|
2152
|
+
var n = On(e.objectStoreNames), r = n.length > 0 ? t.objectStore(n[0]) : {};
|
|
2153
|
+
return {
|
|
2154
|
+
schema: {
|
|
2155
|
+
name: e.name,
|
|
2156
|
+
tables: n.map(function(e) {
|
|
2157
|
+
return t.objectStore(e);
|
|
2158
|
+
}).map(function(e) {
|
|
2159
|
+
var t = e.keyPath, n = e.autoIncrement, r = o(t), i = t == null, a = {}, s = {
|
|
2160
|
+
name: e.name,
|
|
2161
|
+
primaryKey: {
|
|
2162
|
+
name: null,
|
|
2163
|
+
isPrimaryKey: !0,
|
|
2164
|
+
outbound: i,
|
|
2165
|
+
compound: r,
|
|
2166
|
+
keyPath: t,
|
|
2167
|
+
autoIncrement: n,
|
|
2168
|
+
unique: !0,
|
|
2169
|
+
extractKey: En(t)
|
|
2170
|
+
},
|
|
2171
|
+
indexes: On(e.indexNames).map(function(t) {
|
|
2172
|
+
return e.index(t);
|
|
2173
|
+
}).map(function(e) {
|
|
2174
|
+
var t = e.name, n = e.unique, r = e.multiEntry, i = e.keyPath, s = {
|
|
2175
|
+
name: t,
|
|
2176
|
+
compound: o(i),
|
|
2177
|
+
keyPath: i,
|
|
2178
|
+
unique: n,
|
|
2179
|
+
multiEntry: r,
|
|
2180
|
+
extractKey: En(i)
|
|
2181
|
+
};
|
|
2182
|
+
return a[An(i)] = s, s;
|
|
2183
|
+
}),
|
|
2184
|
+
getIndexByKeyPath: function(e) {
|
|
2185
|
+
return a[An(e)];
|
|
2186
|
+
}
|
|
2187
|
+
};
|
|
2188
|
+
return a[":id"] = s.primaryKey, t != null && (a[An(t)] = s.primaryKey), s;
|
|
2189
|
+
})
|
|
2190
|
+
},
|
|
2191
|
+
hasGetAll: n.length > 0 && "getAll" in r && !(typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604),
|
|
2192
|
+
hasIdb3Features: "getAllRecords" in r
|
|
2193
|
+
};
|
|
2194
|
+
}
|
|
2195
|
+
function i(e) {
|
|
2196
|
+
if (e.type === 3) return null;
|
|
2197
|
+
if (e.type === 4) throw Error("Cannot convert never type to IDBKeyRange");
|
|
2198
|
+
var n = e.lower, r = e.upper, i = e.lowerOpen, a = e.upperOpen;
|
|
2199
|
+
return n === void 0 ? r === void 0 ? null : t.upperBound(r, !!a) : r === void 0 ? t.lowerBound(n, !!i) : t.bound(n, r, !!i, !!a);
|
|
2200
|
+
}
|
|
2201
|
+
function a(e) {
|
|
2202
|
+
var t = e.name;
|
|
2203
|
+
function n(e) {
|
|
2204
|
+
var n = e.trans, r = e.type, a = e.keys, o = e.values, s = e.range;
|
|
2205
|
+
return new Promise(function(e, c) {
|
|
2206
|
+
e = I(e);
|
|
2207
|
+
var l = n.objectStore(t), u = l.keyPath == null, d = r === "put" || r === "add";
|
|
2208
|
+
if (!d && r !== "delete" && r !== "deleteRange") throw Error("Invalid operation type: " + r);
|
|
2209
|
+
var f = (a || o || { length: 1 }).length;
|
|
2210
|
+
if (a && o && a.length !== o.length) throw Error("Given keys array must have same length as given values array.");
|
|
2211
|
+
if (f === 0) return e({
|
|
2212
|
+
numFailures: 0,
|
|
2213
|
+
failures: {},
|
|
2214
|
+
results: [],
|
|
2215
|
+
lastResult: void 0
|
|
2216
|
+
});
|
|
2217
|
+
var p, m = [], h = [], g = 0, _ = function(e) {
|
|
2218
|
+
++g, gn(e);
|
|
2219
|
+
};
|
|
2220
|
+
if (r === "deleteRange") {
|
|
2221
|
+
if (s.type === 4) return e({
|
|
2222
|
+
numFailures: g,
|
|
2223
|
+
failures: h,
|
|
2224
|
+
results: [],
|
|
2225
|
+
lastResult: void 0
|
|
2226
|
+
});
|
|
2227
|
+
s.type === 3 ? m.push(p = l.clear()) : m.push(p = l.delete(i(s)));
|
|
2228
|
+
} else {
|
|
2229
|
+
var v = d ? u ? [o, a] : [o, null] : [a, null], y = v[0], b = v[1];
|
|
2230
|
+
if (d) for (var x = 0; x < f; ++x) m.push(p = b && b[x] !== void 0 ? l[r](y[x], b[x]) : l[r](y[x])), p.onerror = _;
|
|
2231
|
+
else for (var x = 0; x < f; ++x) m.push(p = l[r](y[x])), p.onerror = _;
|
|
2232
|
+
}
|
|
2233
|
+
var S = function(t) {
|
|
2234
|
+
var n = t.target.result;
|
|
2235
|
+
m.forEach(function(e, t) {
|
|
2236
|
+
return e.error != null && (h[t] = e.error);
|
|
2237
|
+
}), e({
|
|
2238
|
+
numFailures: g,
|
|
2239
|
+
failures: h,
|
|
2240
|
+
results: r === "delete" ? a : m.map(function(e) {
|
|
2241
|
+
return e.result;
|
|
2242
|
+
}),
|
|
2243
|
+
lastResult: n
|
|
2244
|
+
});
|
|
2245
|
+
};
|
|
2246
|
+
p.onerror = function(e) {
|
|
2247
|
+
_(e), S(e);
|
|
2248
|
+
}, p.onsuccess = S;
|
|
2249
|
+
});
|
|
2250
|
+
}
|
|
2251
|
+
function r(e) {
|
|
2252
|
+
var n = e.trans, r = e.values, a = e.query, o = e.reverse, s = e.unique;
|
|
2253
|
+
return new Promise(function(e, c) {
|
|
2254
|
+
e = I(e);
|
|
2255
|
+
var l = a.index, u = a.range, d = n.objectStore(t), f = l.isPrimaryKey ? d : d.index(l.name), p = o ? s ? "prevunique" : "prev" : s ? "nextunique" : "next", m = r || !("openKeyCursor" in f) ? f.openCursor(i(u), p) : f.openKeyCursor(i(u), p);
|
|
2256
|
+
m.onerror = Y(c), m.onsuccess = I(function(t) {
|
|
2257
|
+
var r = m.result;
|
|
2258
|
+
if (!r) e(null);
|
|
2259
|
+
else {
|
|
2260
|
+
r.___id = ++kn, r.done = !1;
|
|
2261
|
+
var i = r.continue.bind(r), a = r.continuePrimaryKey;
|
|
2262
|
+
a &&= a.bind(r);
|
|
2263
|
+
var o = r.advance.bind(r), s = function() {
|
|
2264
|
+
throw Error("Cursor not started");
|
|
2265
|
+
}, l = function() {
|
|
2266
|
+
throw Error("Cursor not stopped");
|
|
2267
|
+
};
|
|
2268
|
+
r.trans = n, r.stop = r.continue = r.continuePrimaryKey = r.advance = s, r.fail = I(c), r.next = function() {
|
|
2269
|
+
var e = this, t = 1;
|
|
2270
|
+
return this.start(function() {
|
|
2271
|
+
return t-- ? e.continue() : e.stop();
|
|
2272
|
+
}).then(function() {
|
|
2273
|
+
return e;
|
|
2274
|
+
});
|
|
2275
|
+
}, r.start = function(e) {
|
|
2276
|
+
var t = new Promise(function(e, t) {
|
|
2277
|
+
e = I(e), m.onerror = Y(t), r.fail = t, r.stop = function(t) {
|
|
2278
|
+
r.stop = r.continue = r.continuePrimaryKey = r.advance = l, e(t);
|
|
2279
|
+
};
|
|
2280
|
+
}), n = function() {
|
|
2281
|
+
if (m.result) try {
|
|
2282
|
+
e();
|
|
2283
|
+
} catch (e) {
|
|
2284
|
+
r.fail(e);
|
|
2285
|
+
}
|
|
2286
|
+
else r.done = !0, r.start = function() {
|
|
2287
|
+
throw Error("Cursor behind last entry");
|
|
2288
|
+
}, r.stop();
|
|
2289
|
+
};
|
|
2290
|
+
return m.onsuccess = I(function(e) {
|
|
2291
|
+
m.onsuccess = n, n();
|
|
2292
|
+
}), r.continue = i, r.continuePrimaryKey = a, r.advance = o, n(), t;
|
|
2293
|
+
}, e(r);
|
|
2294
|
+
}
|
|
2295
|
+
}, c);
|
|
2296
|
+
});
|
|
2297
|
+
}
|
|
2298
|
+
function a(e, n) {
|
|
2299
|
+
return function(r) {
|
|
2300
|
+
return new Promise(function(a, o) {
|
|
2301
|
+
a = I(a);
|
|
2302
|
+
var s = r.trans, c = r.values, l = r.limit, u = r.query, d = r.direction ?? "next", f = l === 1e400 ? void 0 : l, p = u.index, m = u.range, h = s.objectStore(t), g = p.isPrimaryKey ? h : h.index(p.name), _ = i(m);
|
|
2303
|
+
if (l === 0) return a({ result: [] });
|
|
2304
|
+
if (n) {
|
|
2305
|
+
var v = {
|
|
2306
|
+
query: _,
|
|
2307
|
+
count: f,
|
|
2308
|
+
direction: d
|
|
2309
|
+
}, y = c ? g.getAll(v) : g.getAllKeys(v);
|
|
2310
|
+
y.onsuccess = function(e) {
|
|
2311
|
+
return a({ result: e.target.result });
|
|
2312
|
+
}, y.onerror = Y(o);
|
|
2313
|
+
} else if (e && d === "next") {
|
|
2314
|
+
var y = c ? g.getAll(_, f) : g.getAllKeys(_, f);
|
|
2315
|
+
y.onsuccess = function(e) {
|
|
2316
|
+
return a({ result: e.target.result });
|
|
2317
|
+
}, y.onerror = Y(o);
|
|
2318
|
+
} else {
|
|
2319
|
+
var b = 0, x = c || !("openKeyCursor" in g) ? g.openCursor(_, d) : g.openKeyCursor(_, d), S = [];
|
|
2320
|
+
x.onsuccess = function() {
|
|
2321
|
+
var e = x.result;
|
|
2322
|
+
if (!e || (S.push(c ? e.value : e.primaryKey), ++b === l)) return a({ result: S });
|
|
2323
|
+
e.continue();
|
|
2324
|
+
}, x.onerror = Y(o);
|
|
2325
|
+
}
|
|
2326
|
+
});
|
|
2327
|
+
};
|
|
2328
|
+
}
|
|
2329
|
+
return {
|
|
2330
|
+
name: t,
|
|
2331
|
+
schema: e,
|
|
2332
|
+
mutate: n,
|
|
2333
|
+
getMany: function(e) {
|
|
2334
|
+
var n = e.trans, r = e.keys;
|
|
2335
|
+
return new Promise(function(e, i) {
|
|
2336
|
+
e = I(e);
|
|
2337
|
+
for (var a = n.objectStore(t), o = r.length, s = Array(o), c = 0, l = 0, u, d = function(t) {
|
|
2338
|
+
var n = t.target;
|
|
2339
|
+
s[n._pos] = n.result, ++l === c && e(s);
|
|
2340
|
+
}, f = Y(i), p = 0; p < o; ++p) r[p] != null && (u = a.get(r[p]), u._pos = p, u.onsuccess = d, u.onerror = f, ++c);
|
|
2341
|
+
c === 0 && e(s);
|
|
2342
|
+
});
|
|
2343
|
+
},
|
|
2344
|
+
get: function(e) {
|
|
2345
|
+
var n = e.trans, r = e.key;
|
|
2346
|
+
return new Promise(function(e, i) {
|
|
2347
|
+
e = I(e);
|
|
2348
|
+
var a = n.objectStore(t).get(r);
|
|
2349
|
+
a.onsuccess = function(t) {
|
|
2350
|
+
return e(t.target.result);
|
|
2351
|
+
}, a.onerror = Y(i);
|
|
2352
|
+
});
|
|
2353
|
+
},
|
|
2354
|
+
query: a(l, u),
|
|
2355
|
+
openCursor: r,
|
|
2356
|
+
count: function(e) {
|
|
2357
|
+
var n = e.query, r = e.trans, a = n.index, o = n.range;
|
|
2358
|
+
return new Promise(function(e, n) {
|
|
2359
|
+
var s = r.objectStore(t), c = a.isPrimaryKey ? s : s.index(a.name), l = i(o), u = l ? c.count(l) : c.count();
|
|
2360
|
+
u.onsuccess = I(function(t) {
|
|
2361
|
+
return e(t.target.result);
|
|
2362
|
+
}), u.onerror = Y(n);
|
|
2363
|
+
});
|
|
2364
|
+
}
|
|
2365
|
+
};
|
|
2366
|
+
}
|
|
2367
|
+
var s = r(e, n), c = s.schema, l = s.hasGetAll, u = s.hasIdb3Features, d = c.tables.map(function(e) {
|
|
2368
|
+
return a(e);
|
|
2369
|
+
}), f = {};
|
|
2370
|
+
return d.forEach(function(e) {
|
|
2371
|
+
return f[e.name] = e;
|
|
2372
|
+
}), {
|
|
2373
|
+
stack: "dbcore",
|
|
2374
|
+
transaction: e.transaction.bind(e),
|
|
2375
|
+
table: function(e) {
|
|
2376
|
+
if (!f[e]) throw Error(`Table '${e}' not found`);
|
|
2377
|
+
return f[e];
|
|
2378
|
+
},
|
|
2379
|
+
MIN_KEY: -1e400,
|
|
2380
|
+
MAX_KEY: Tn(t),
|
|
2381
|
+
schema: c
|
|
2382
|
+
};
|
|
2383
|
+
}
|
|
2384
|
+
function Mn(e, t) {
|
|
2385
|
+
return t.reduce(function(e, t) {
|
|
2386
|
+
var r = t.create;
|
|
2387
|
+
return n(n({}, e), r(e));
|
|
2388
|
+
}, e);
|
|
2389
|
+
}
|
|
2390
|
+
function Nn(e, t, n, r) {
|
|
2391
|
+
var i = n.IDBKeyRange;
|
|
2392
|
+
return n.indexedDB, { dbcore: Mn(jn(t, i, r), e.dbcore) };
|
|
2393
|
+
}
|
|
2394
|
+
function Pn(e, t) {
|
|
2395
|
+
var n = t.db;
|
|
2396
|
+
e.core = Nn(e._middlewares, n, e._deps, t).dbcore, e.tables.forEach(function(t) {
|
|
2397
|
+
var n = t.name;
|
|
2398
|
+
e.core.schema.tables.some(function(e) {
|
|
2399
|
+
return e.name === n;
|
|
2400
|
+
}) && (t.core = e.core.table(n), e[n] instanceof e.Table && (e[n].core = t.core));
|
|
2401
|
+
});
|
|
2402
|
+
}
|
|
2403
|
+
function Fn(e, t, n, r) {
|
|
2404
|
+
n.forEach(function(n) {
|
|
2405
|
+
var i = r[n];
|
|
2406
|
+
t.forEach(function(t) {
|
|
2407
|
+
var r = g(t, n);
|
|
2408
|
+
(!r || "value" in r && r.value === void 0) && (t === e.Transaction.prototype || t instanceof e.Transaction ? p(t, n, {
|
|
2409
|
+
get: function() {
|
|
2410
|
+
return this.table(n);
|
|
2411
|
+
},
|
|
2412
|
+
set: function(e) {
|
|
2413
|
+
f(this, n, {
|
|
2414
|
+
value: e,
|
|
2415
|
+
writable: !0,
|
|
2416
|
+
configurable: !0,
|
|
2417
|
+
enumerable: !0
|
|
2418
|
+
});
|
|
2419
|
+
}
|
|
2420
|
+
}) : t[n] = new e.Table(n, i));
|
|
2421
|
+
});
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
function In(e, t) {
|
|
2425
|
+
t.forEach(function(t) {
|
|
2426
|
+
for (var n in t) t[n] instanceof e.Table && delete t[n];
|
|
2427
|
+
});
|
|
2428
|
+
}
|
|
2429
|
+
function Ln(e, t) {
|
|
2430
|
+
return e._cfg.version - t._cfg.version;
|
|
2431
|
+
}
|
|
2432
|
+
function Rn(e, t, n, r) {
|
|
2433
|
+
var i = e._dbSchema;
|
|
2434
|
+
n.objectStoreNames.contains("$meta") && !i.$meta && (i.$meta = Cn("$meta", Zn("")[0], []), e._storeNames.push("$meta"));
|
|
2435
|
+
var o = e._createTransaction("readwrite", e._storeNames, i);
|
|
2436
|
+
o.create(n), o._completion.catch(r);
|
|
2437
|
+
var s = o._reject.bind(o), c = N.transless || N;
|
|
2438
|
+
R(function() {
|
|
2439
|
+
if (N.trans = o, N.transless = c, t === 0) a(i).forEach(function(e) {
|
|
2440
|
+
Un(n, e, i[e].primKey, i[e].indexes);
|
|
2441
|
+
}), Pn(e, n), F.follow(function() {
|
|
2442
|
+
return e.on.populate.fire(o);
|
|
2443
|
+
}).catch(s);
|
|
2444
|
+
else return Pn(e, n), Bn(e, o, t).then(function(t) {
|
|
2445
|
+
return Vn(e, t, o, n);
|
|
2446
|
+
}).catch(s);
|
|
2447
|
+
});
|
|
2448
|
+
}
|
|
2449
|
+
function zn(e, t) {
|
|
2450
|
+
Wn(e._dbSchema, t), t.db.version % 10 == 0 && !t.objectStoreNames.contains("$meta") && t.db.createObjectStore("$meta").add(Math.ceil(t.db.version / 10 - 1), "version");
|
|
2451
|
+
var n = qn(e, e.idbdb, t);
|
|
2452
|
+
Xn(e, e._dbSchema, t);
|
|
2453
|
+
for (var r = Hn(n, e._dbSchema), i = function(e) {
|
|
2454
|
+
if (e.change.length || e.recreate) return console.warn(`Unable to patch indexes of table ${e.name} because it has changes on the type of index or primary key.`), { value: void 0 };
|
|
2455
|
+
var n = t.objectStore(e.name);
|
|
2456
|
+
e.add.forEach(function(t) {
|
|
2457
|
+
j && console.debug(`Dexie upgrade patch: Creating missing index ${e.name}.${t.src}`), Kn(n, t);
|
|
2458
|
+
});
|
|
2459
|
+
}, a = 0, o = r.change; a < o.length; a++) {
|
|
2460
|
+
var s = i(o[a]);
|
|
2461
|
+
if (typeof s == "object") return s.value;
|
|
2462
|
+
}
|
|
2463
|
+
}
|
|
2464
|
+
function Bn(e, t, n) {
|
|
2465
|
+
return t.storeNames.includes("$meta") ? t.table("$meta").get("version").then(function(e) {
|
|
2466
|
+
return e ?? n;
|
|
2467
|
+
}) : F.resolve(n);
|
|
2468
|
+
}
|
|
2469
|
+
function Vn(e, t, n, r) {
|
|
2470
|
+
var i = [], o = e._versions, s = e._dbSchema = qn(e, e.idbdb, r), c = o.filter(function(e) {
|
|
2471
|
+
return e._cfg.version >= t;
|
|
2472
|
+
});
|
|
2473
|
+
if (c.length === 0) return F.resolve();
|
|
2474
|
+
c.forEach(function(o) {
|
|
2475
|
+
i.push(function() {
|
|
2476
|
+
var i = s, c = o._cfg.dbschema;
|
|
2477
|
+
Xn(e, i, r), Xn(e, c, r), s = e._dbSchema = c;
|
|
2478
|
+
var l = Hn(i, c);
|
|
2479
|
+
l.add.forEach(function(e) {
|
|
2480
|
+
Un(r, e[0], e[1].primKey, e[1].indexes);
|
|
2481
|
+
}), l.change.forEach(function(e) {
|
|
2482
|
+
if (e.recreate) throw new O.Upgrade("Not yet support for changing primary key");
|
|
2483
|
+
var t = r.objectStore(e.name);
|
|
2484
|
+
e.add.forEach(function(e) {
|
|
2485
|
+
return Kn(t, e);
|
|
2486
|
+
}), e.change.forEach(function(e) {
|
|
2487
|
+
t.deleteIndex(e.name), Kn(t, e);
|
|
2488
|
+
}), e.del.forEach(function(e) {
|
|
2489
|
+
return t.deleteIndex(e);
|
|
2490
|
+
});
|
|
2491
|
+
});
|
|
2492
|
+
var u = o._cfg.contentUpgrade;
|
|
2493
|
+
if (u && o._cfg.version > t) {
|
|
2494
|
+
Pn(e, r), n._memoizedTables = {};
|
|
2495
|
+
var d = te(c);
|
|
2496
|
+
l.del.forEach(function(e) {
|
|
2497
|
+
d[e] = i[e];
|
|
2498
|
+
}), In(e, [e.Transaction.prototype]), Fn(e, [e.Transaction.prototype], a(d), d), n.schema = d;
|
|
2499
|
+
var f = me(u);
|
|
2500
|
+
f && yt();
|
|
2501
|
+
var p, m = F.follow(function() {
|
|
2502
|
+
if (p = u(n), p && f) {
|
|
2503
|
+
var e = z.bind(null, null);
|
|
2504
|
+
p.then(e, e);
|
|
2505
|
+
}
|
|
2506
|
+
});
|
|
2507
|
+
return p && typeof p.then == "function" ? F.resolve(p) : m.then(function() {
|
|
2508
|
+
return p;
|
|
2509
|
+
});
|
|
2510
|
+
}
|
|
2511
|
+
}), i.push(function(t) {
|
|
2512
|
+
Gn(o._cfg.dbschema, t), In(e, [e.Transaction.prototype]), Fn(e, [e.Transaction.prototype], e._storeNames, e._dbSchema), n.schema = e._dbSchema;
|
|
2513
|
+
}), i.push(function(t) {
|
|
2514
|
+
e.idbdb.objectStoreNames.contains("$meta") && (Math.ceil(e.idbdb.version / 10) === o._cfg.version ? (e.idbdb.deleteObjectStore("$meta"), delete e._dbSchema.$meta, e._storeNames = e._storeNames.filter(function(e) {
|
|
2515
|
+
return e !== "$meta";
|
|
2516
|
+
})) : t.objectStore("$meta").put(o._cfg.version, "version"));
|
|
2517
|
+
});
|
|
2518
|
+
});
|
|
2519
|
+
function l() {
|
|
2520
|
+
return i.length ? F.resolve(i.shift()(n.idbtrans)).then(l) : F.resolve();
|
|
2521
|
+
}
|
|
2522
|
+
return l().then(function() {
|
|
2523
|
+
Wn(s, r);
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
function Hn(e, t) {
|
|
2527
|
+
var n = {
|
|
2528
|
+
del: [],
|
|
2529
|
+
add: [],
|
|
2530
|
+
change: []
|
|
2531
|
+
}, r;
|
|
2532
|
+
for (r in e) t[r] || n.del.push(r);
|
|
2533
|
+
for (r in t) {
|
|
2534
|
+
var i = e[r], a = t[r];
|
|
2535
|
+
if (!i) n.add.push([r, a]);
|
|
2536
|
+
else {
|
|
2537
|
+
var o = {
|
|
2538
|
+
name: r,
|
|
2539
|
+
def: a,
|
|
2540
|
+
recreate: !1,
|
|
2541
|
+
del: [],
|
|
2542
|
+
add: [],
|
|
2543
|
+
change: []
|
|
2544
|
+
};
|
|
2545
|
+
if ("" + (i.primKey.keyPath || "") != "" + (a.primKey.keyPath || "") || i.primKey.auto !== a.primKey.auto) o.recreate = !0, n.change.push(o);
|
|
2546
|
+
else {
|
|
2547
|
+
var s = i.idxByName, c = a.idxByName, l = void 0;
|
|
2548
|
+
for (l in s) c[l] || o.del.push(l);
|
|
2549
|
+
for (l in c) {
|
|
2550
|
+
var u = s[l], d = c[l];
|
|
2551
|
+
u ? u.src !== d.src && o.change.push(d) : o.add.push(d);
|
|
2552
|
+
}
|
|
2553
|
+
(o.del.length > 0 || o.add.length > 0 || o.change.length > 0) && n.change.push(o);
|
|
2554
|
+
}
|
|
2555
|
+
}
|
|
2556
|
+
}
|
|
2557
|
+
return n;
|
|
2558
|
+
}
|
|
2559
|
+
function Un(e, t, n, r) {
|
|
2560
|
+
var i = e.db.createObjectStore(t, n.keyPath ? {
|
|
2561
|
+
keyPath: n.keyPath,
|
|
2562
|
+
autoIncrement: n.auto
|
|
2563
|
+
} : { autoIncrement: n.auto });
|
|
2564
|
+
return r.forEach(function(e) {
|
|
2565
|
+
return Kn(i, e);
|
|
2566
|
+
}), i;
|
|
2567
|
+
}
|
|
2568
|
+
function Wn(e, t) {
|
|
2569
|
+
a(e).forEach(function(n) {
|
|
2570
|
+
t.db.objectStoreNames.contains(n) || (j && console.debug("Dexie: Creating missing table", n), Un(t, n, e[n].primKey, e[n].indexes));
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
function Gn(e, t) {
|
|
2574
|
+
[].slice.call(t.db.objectStoreNames).forEach(function(n) {
|
|
2575
|
+
return e[n] == null && t.db.deleteObjectStore(n);
|
|
2576
|
+
});
|
|
2577
|
+
}
|
|
2578
|
+
function Kn(e, t) {
|
|
2579
|
+
e.createIndex(t.name, t.keyPath, {
|
|
2580
|
+
unique: t.unique,
|
|
2581
|
+
multiEntry: t.multi
|
|
2582
|
+
});
|
|
2583
|
+
}
|
|
2584
|
+
function qn(e, t, n) {
|
|
2585
|
+
var r = {};
|
|
2586
|
+
return v(t.objectStoreNames, 0).forEach(function(e) {
|
|
2587
|
+
for (var t = n.objectStore(e), i = t.keyPath, a = xn(Sn(i), i || "", !0, !1, !!t.autoIncrement, i && typeof i != "string", !0), o = [], s = 0; s < t.indexNames.length; ++s) {
|
|
2588
|
+
var c = t.index(t.indexNames[s]);
|
|
2589
|
+
i = c.keyPath;
|
|
2590
|
+
var l = xn(c.name, i, !!c.unique, !!c.multiEntry, !1, i && typeof i != "string", !1);
|
|
2591
|
+
o.push(l);
|
|
2592
|
+
}
|
|
2593
|
+
r[e] = Cn(e, a, o);
|
|
2594
|
+
}), r;
|
|
2595
|
+
}
|
|
2596
|
+
function Jn(e, t, n) {
|
|
2597
|
+
e.verno = t.version / 10;
|
|
2598
|
+
var r = e._dbSchema = qn(e, t, n);
|
|
2599
|
+
e._storeNames = v(t.objectStoreNames, 0), Fn(e, [e._allTables], a(r), r);
|
|
2600
|
+
}
|
|
2601
|
+
function Yn(e, t) {
|
|
2602
|
+
var n = Hn(qn(e, e.idbdb, t), e._dbSchema);
|
|
2603
|
+
return !(n.add.length || n.change.some(function(e) {
|
|
2604
|
+
return e.add.length || e.change.length;
|
|
2605
|
+
}));
|
|
2606
|
+
}
|
|
2607
|
+
function Xn(e, t, n) {
|
|
2608
|
+
for (var r = n.db.objectStoreNames, a = 0; a < r.length; ++a) {
|
|
2609
|
+
var o = r[a], s = n.objectStore(o);
|
|
2610
|
+
e._hasGetAll = "getAll" in s;
|
|
2611
|
+
for (var c = 0; c < s.indexNames.length; ++c) {
|
|
2612
|
+
var l = s.indexNames[c], u = s.index(l).keyPath, d = typeof u == "string" ? u : "[" + v(u).join("+") + "]";
|
|
2613
|
+
if (t[o]) {
|
|
2614
|
+
var f = t[o].idxByName[d];
|
|
2615
|
+
f && (f.name = l, delete t[o].idxByName[d], t[o].idxByName[l] = f);
|
|
2616
|
+
}
|
|
2617
|
+
}
|
|
2618
|
+
}
|
|
2619
|
+
typeof navigator < "u" && /Safari/.test(navigator.userAgent) && !/(Chrome\/|Edge\/)/.test(navigator.userAgent) && i.WorkerGlobalScope && i instanceof i.WorkerGlobalScope && [].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1] < 604 && (e._hasGetAll = !1);
|
|
2620
|
+
}
|
|
2621
|
+
function Zn(e) {
|
|
2622
|
+
return e.split(",").map(function(e, t) {
|
|
2623
|
+
var n = e.split(":"), r = n[1]?.trim();
|
|
2624
|
+
e = n[0].trim();
|
|
2625
|
+
var i = e.replace(/([&*]|\+\+)/g, ""), a = /^\[/.test(i) ? i.match(/^\[(.*)\]$/)[1].split("+") : i;
|
|
2626
|
+
return xn(i, a || null, /\&/.test(e), /\*/.test(e), /\+\+/.test(e), o(a), t === 0, r);
|
|
2627
|
+
});
|
|
2628
|
+
}
|
|
2629
|
+
var Qn = function() {
|
|
2630
|
+
function e() {}
|
|
2631
|
+
return e.prototype._createTableSchema = function(e, t, n) {
|
|
2632
|
+
return Cn(e, t, n);
|
|
2633
|
+
}, e.prototype._parseIndexSyntax = function(e) {
|
|
2634
|
+
return Zn(e);
|
|
2635
|
+
}, e.prototype._parseStoresSpec = function(e, t) {
|
|
2636
|
+
var n = this;
|
|
2637
|
+
a(e).forEach(function(r) {
|
|
2638
|
+
if (e[r] !== null) {
|
|
2639
|
+
var i = n._parseIndexSyntax(e[r]), a = i.shift();
|
|
2640
|
+
if (!a) throw new O.Schema("Invalid schema for table " + r + ": " + e[r]);
|
|
2641
|
+
if (a.unique = !0, a.multi) throw new O.Schema("Primary key cannot be multiEntry*");
|
|
2642
|
+
i.forEach(function(e) {
|
|
2643
|
+
if (e.auto) throw new O.Schema("Only primary key can be marked as autoIncrement (++)");
|
|
2644
|
+
if (!e.keyPath) throw new O.Schema("Index must have a name and cannot be an empty string");
|
|
2645
|
+
}), t[r] = n._createTableSchema(r, a, i);
|
|
2646
|
+
}
|
|
2647
|
+
});
|
|
2648
|
+
}, e.prototype.stores = function(e) {
|
|
2649
|
+
var t = this.db;
|
|
2650
|
+
this._cfg.storesSource = this._cfg.storesSource ? s(this._cfg.storesSource, e) : e;
|
|
2651
|
+
var n = t._versions, r = {}, i = {};
|
|
2652
|
+
return n.forEach(function(e) {
|
|
2653
|
+
s(r, e._cfg.storesSource), i = e._cfg.dbschema = {}, e._parseStoresSpec(r, i);
|
|
2654
|
+
}), t._dbSchema = i, In(t, [
|
|
2655
|
+
t._allTables,
|
|
2656
|
+
t,
|
|
2657
|
+
t.Transaction.prototype
|
|
2658
|
+
]), Fn(t, [
|
|
2659
|
+
t._allTables,
|
|
2660
|
+
t,
|
|
2661
|
+
t.Transaction.prototype,
|
|
2662
|
+
this._cfg.tables
|
|
2663
|
+
], a(i), i), t._storeNames = a(i), this;
|
|
2664
|
+
}, e.prototype.upgrade = function(e) {
|
|
2665
|
+
return this._cfg.contentUpgrade = Ne(this._cfg.contentUpgrade || k, e), this;
|
|
2666
|
+
}, e;
|
|
2667
|
+
}();
|
|
2668
|
+
function $n(e) {
|
|
2669
|
+
return Kt(Qn.prototype, function(t) {
|
|
2670
|
+
this.db = e, this._cfg = {
|
|
2671
|
+
version: t,
|
|
2672
|
+
storesSource: null,
|
|
2673
|
+
dbschema: {},
|
|
2674
|
+
tables: {},
|
|
2675
|
+
contentUpgrade: null
|
|
2676
|
+
};
|
|
2677
|
+
});
|
|
2678
|
+
}
|
|
2679
|
+
var er = tr();
|
|
2680
|
+
function tr() {
|
|
2681
|
+
if (typeof FinalizationRegistry < "u" && typeof WeakRef < "u") {
|
|
2682
|
+
var e = /* @__PURE__ */ new Set(), t = new FinalizationRegistry(function(t) {
|
|
2683
|
+
e.delete(t);
|
|
2684
|
+
}), n = function() {
|
|
2685
|
+
return Array.from(e).map(function(e) {
|
|
2686
|
+
return e.deref();
|
|
2687
|
+
}).filter(function(e) {
|
|
2688
|
+
return e !== void 0;
|
|
2689
|
+
});
|
|
2690
|
+
}, r = function(n) {
|
|
2691
|
+
var r = new WeakRef(n._novip);
|
|
2692
|
+
if (e.add(r), t.register(n._novip, r, r), e.size > n._options.maxConnections) {
|
|
2693
|
+
var i = e.values().next().value;
|
|
2694
|
+
e.delete(i), t.unregister(i);
|
|
2695
|
+
}
|
|
2696
|
+
}, i = function(n) {
|
|
2697
|
+
if (n) for (var r = e.values(), i = r.next(); !i.done;) {
|
|
2698
|
+
var a = i.value;
|
|
2699
|
+
if (a.deref() === n._novip) {
|
|
2700
|
+
e.delete(a), t.unregister(a);
|
|
2701
|
+
return;
|
|
2702
|
+
}
|
|
2703
|
+
i = r.next();
|
|
2704
|
+
}
|
|
2705
|
+
};
|
|
2706
|
+
return {
|
|
2707
|
+
toArray: n,
|
|
2708
|
+
add: r,
|
|
2709
|
+
remove: i
|
|
2710
|
+
};
|
|
2711
|
+
}
|
|
2712
|
+
var a = [], n = function() {
|
|
2713
|
+
return a;
|
|
2714
|
+
}, r = function(e) {
|
|
2715
|
+
a.push(e._novip);
|
|
2716
|
+
}, i = function(e) {
|
|
2717
|
+
if (e) {
|
|
2718
|
+
var t = a.indexOf(e._novip);
|
|
2719
|
+
t !== -1 && a.splice(t, 1);
|
|
2720
|
+
}
|
|
2721
|
+
};
|
|
2722
|
+
return {
|
|
2723
|
+
toArray: n,
|
|
2724
|
+
add: r,
|
|
2725
|
+
remove: i
|
|
2726
|
+
};
|
|
2727
|
+
}
|
|
2728
|
+
function nr(e, t) {
|
|
2729
|
+
var n = e._dbNamesDB;
|
|
2730
|
+
return n || (n = e._dbNamesDB = new Q(jt, {
|
|
2731
|
+
addons: [],
|
|
2732
|
+
indexedDB: e,
|
|
2733
|
+
IDBKeyRange: t
|
|
2734
|
+
}), n.version(1).stores({ dbnames: "name" })), n.table("dbnames");
|
|
2735
|
+
}
|
|
2736
|
+
function rr(e) {
|
|
2737
|
+
return e && typeof e.databases == "function";
|
|
2738
|
+
}
|
|
2739
|
+
function ir(e) {
|
|
2740
|
+
var t = e.indexedDB, n = e.IDBKeyRange;
|
|
2741
|
+
return rr(t) ? Promise.resolve(t.databases()).then(function(e) {
|
|
2742
|
+
return e.map(function(e) {
|
|
2743
|
+
return e.name;
|
|
2744
|
+
}).filter(function(e) {
|
|
2745
|
+
return e !== jt;
|
|
2746
|
+
});
|
|
2747
|
+
}) : nr(t, n).toCollection().primaryKeys();
|
|
2748
|
+
}
|
|
2749
|
+
function ar(e, t) {
|
|
2750
|
+
var n = e.indexedDB, r = e.IDBKeyRange;
|
|
2751
|
+
!rr(n) && t !== jt && nr(n, r).put({ name: t }).catch(k);
|
|
2752
|
+
}
|
|
2753
|
+
function or(e, t) {
|
|
2754
|
+
var n = e.indexedDB, r = e.IDBKeyRange;
|
|
2755
|
+
!rr(n) && t !== jt && nr(n, r).delete(t).catch(k);
|
|
2756
|
+
}
|
|
2757
|
+
function sr(e) {
|
|
2758
|
+
return R(function() {
|
|
2759
|
+
return N.letThrough = !0, e();
|
|
2760
|
+
});
|
|
2761
|
+
}
|
|
2762
|
+
function cr() {
|
|
2763
|
+
if (navigator.userAgentData || !/Safari\//.test(navigator.userAgent) || /Chrom(e|ium)\//.test(navigator.userAgent) || !indexedDB.databases) return Promise.resolve();
|
|
2764
|
+
var e;
|
|
2765
|
+
return new Promise(function(t) {
|
|
2766
|
+
var n = function() {
|
|
2767
|
+
return indexedDB.databases().finally(t);
|
|
2768
|
+
};
|
|
2769
|
+
e = setInterval(n, 100), n();
|
|
2770
|
+
}).finally(function() {
|
|
2771
|
+
return clearInterval(e);
|
|
2772
|
+
});
|
|
2773
|
+
}
|
|
2774
|
+
var lr;
|
|
2775
|
+
function ur(e) {
|
|
2776
|
+
return !("from" in e);
|
|
2777
|
+
}
|
|
2778
|
+
var Z = function(e, t) {
|
|
2779
|
+
if (this) s(this, arguments.length ? {
|
|
2780
|
+
d: 1,
|
|
2781
|
+
from: e,
|
|
2782
|
+
to: arguments.length > 1 ? t : e
|
|
2783
|
+
} : { d: 0 });
|
|
2784
|
+
else {
|
|
2785
|
+
var n = new Z();
|
|
2786
|
+
return e && "d" in e && s(n, e), n;
|
|
2787
|
+
}
|
|
2788
|
+
};
|
|
2789
|
+
d(Z.prototype, (lr = {
|
|
2790
|
+
add: function(e) {
|
|
2791
|
+
return fr(this, e), this;
|
|
2792
|
+
},
|
|
2793
|
+
addKey: function(e) {
|
|
2794
|
+
return dr(this, e, e), this;
|
|
2795
|
+
},
|
|
2796
|
+
addKeys: function(e) {
|
|
2797
|
+
var t = this;
|
|
2798
|
+
return e.forEach(function(e) {
|
|
2799
|
+
return dr(t, e, e);
|
|
2800
|
+
}), this;
|
|
2801
|
+
},
|
|
2802
|
+
hasKey: function(e) {
|
|
2803
|
+
var t = mr(this).next(e).value;
|
|
2804
|
+
return t && K(t.from, e) <= 0 && K(t.to, e) >= 0;
|
|
2805
|
+
}
|
|
2806
|
+
}, lr[de] = function() {
|
|
2807
|
+
return mr(this);
|
|
2808
|
+
}, lr));
|
|
2809
|
+
function dr(e, t, n) {
|
|
2810
|
+
var r = K(t, n);
|
|
2811
|
+
if (!isNaN(r)) {
|
|
2812
|
+
if (r > 0) throw RangeError();
|
|
2813
|
+
if (ur(e)) return s(e, {
|
|
2814
|
+
from: t,
|
|
2815
|
+
to: n,
|
|
2816
|
+
d: 1
|
|
2817
|
+
});
|
|
2818
|
+
var i = e.l, a = e.r;
|
|
2819
|
+
if (K(n, e.from) < 0) return i ? dr(i, t, n) : e.l = {
|
|
2820
|
+
from: t,
|
|
2821
|
+
to: n,
|
|
2822
|
+
d: 1,
|
|
2823
|
+
l: null,
|
|
2824
|
+
r: null
|
|
2825
|
+
}, hr(e);
|
|
2826
|
+
if (K(t, e.to) > 0) return a ? dr(a, t, n) : e.r = {
|
|
2827
|
+
from: t,
|
|
2828
|
+
to: n,
|
|
2829
|
+
d: 1,
|
|
2830
|
+
l: null,
|
|
2831
|
+
r: null
|
|
2832
|
+
}, hr(e);
|
|
2833
|
+
K(t, e.from) < 0 && (e.from = t, e.l = null, e.d = a ? a.d + 1 : 1), K(n, e.to) > 0 && (e.to = n, e.r = null, e.d = e.l ? e.l.d + 1 : 1);
|
|
2834
|
+
var o = !e.r;
|
|
2835
|
+
i && !e.l && fr(e, i), a && o && fr(e, a);
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
function fr(e, t) {
|
|
2839
|
+
function n(e, t) {
|
|
2840
|
+
var r = t.from, i = t.to, a = t.l, o = t.r;
|
|
2841
|
+
dr(e, r, i), a && n(e, a), o && n(e, o);
|
|
2842
|
+
}
|
|
2843
|
+
ur(t) || n(e, t);
|
|
2844
|
+
}
|
|
2845
|
+
function pr(e, t) {
|
|
2846
|
+
var n = mr(t), r = n.next();
|
|
2847
|
+
if (r.done) return !1;
|
|
2848
|
+
for (var i = r.value, a = mr(e), o = a.next(i.from), s = o.value; !r.done && !o.done;) {
|
|
2849
|
+
if (K(s.from, i.to) <= 0 && K(s.to, i.from) >= 0) return !0;
|
|
2850
|
+
K(i.from, s.from) < 0 ? i = (r = n.next(s.from)).value : s = (o = a.next(i.from)).value;
|
|
2851
|
+
}
|
|
2852
|
+
return !1;
|
|
2853
|
+
}
|
|
2854
|
+
function mr(e) {
|
|
2855
|
+
var t = ur(e) ? null : {
|
|
2856
|
+
s: 0,
|
|
2857
|
+
n: e
|
|
2858
|
+
};
|
|
2859
|
+
return { next: function(e) {
|
|
2860
|
+
for (var n = arguments.length > 0; t;) switch (t.s) {
|
|
2861
|
+
case 0: if (t.s = 1, n) for (; t.n.l && K(e, t.n.from) < 0;) t = {
|
|
2862
|
+
up: t,
|
|
2863
|
+
n: t.n.l,
|
|
2864
|
+
s: 1
|
|
2865
|
+
};
|
|
2866
|
+
else for (; t.n.l;) t = {
|
|
2867
|
+
up: t,
|
|
2868
|
+
n: t.n.l,
|
|
2869
|
+
s: 1
|
|
2870
|
+
};
|
|
2871
|
+
case 1: if (t.s = 2, !n || K(e, t.n.to) <= 0) return {
|
|
2872
|
+
value: t.n,
|
|
2873
|
+
done: !1
|
|
2874
|
+
};
|
|
2875
|
+
case 2: if (t.n.r) {
|
|
2876
|
+
t.s = 3, t = {
|
|
2877
|
+
up: t,
|
|
2878
|
+
n: t.n.r,
|
|
2879
|
+
s: 0
|
|
2880
|
+
};
|
|
2881
|
+
continue;
|
|
2882
|
+
}
|
|
2883
|
+
case 3: t = t.up;
|
|
2884
|
+
}
|
|
2885
|
+
return { done: !0 };
|
|
2886
|
+
} };
|
|
2887
|
+
}
|
|
2888
|
+
function hr(e) {
|
|
2889
|
+
var t = (e.r?.d || 0) - (e.l?.d || 0), r = t > 1 ? "r" : t < -1 ? "l" : "";
|
|
2890
|
+
if (r) {
|
|
2891
|
+
var i = r === "r" ? "l" : "r", a = n({}, e), o = e[r];
|
|
2892
|
+
e.from = o.from, e.to = o.to, e[r] = o[r], a[r] = o[i], e[i] = a, a.d = gr(a);
|
|
2893
|
+
}
|
|
2894
|
+
e.d = gr(e);
|
|
2895
|
+
}
|
|
2896
|
+
function gr(e) {
|
|
2897
|
+
var t = e.r, n = e.l;
|
|
2898
|
+
return (t ? n ? Math.max(t.d, n.d) : t.d : n ? n.d : 0) + 1;
|
|
2899
|
+
}
|
|
2900
|
+
function _r(e, t) {
|
|
2901
|
+
return a(t).forEach(function(n) {
|
|
2902
|
+
e[n] ? fr(e[n], t[n]) : e[n] = oe(t[n]);
|
|
2903
|
+
}), e;
|
|
2904
|
+
}
|
|
2905
|
+
function vr(e, t) {
|
|
2906
|
+
return e.all || t.all || Object.keys(e).some(function(n) {
|
|
2907
|
+
return t[n] && pr(t[n], e[n]);
|
|
2908
|
+
});
|
|
2909
|
+
}
|
|
2910
|
+
var yr = {}, br = {}, xr = !1;
|
|
2911
|
+
function Sr(e, t) {
|
|
2912
|
+
_r(br, e), xr || (xr = !0, setTimeout(function() {
|
|
2913
|
+
xr = !1;
|
|
2914
|
+
var e = br;
|
|
2915
|
+
br = {}, Cr(e, !1);
|
|
2916
|
+
}, 0));
|
|
2917
|
+
}
|
|
2918
|
+
function Cr(e, t) {
|
|
2919
|
+
t === void 0 && (t = !1);
|
|
2920
|
+
var n = /* @__PURE__ */ new Set();
|
|
2921
|
+
if (e.all) for (var r = 0, i = Object.values(yr); r < i.length; r++) {
|
|
2922
|
+
var a = i[r];
|
|
2923
|
+
wr(a, e, n, t);
|
|
2924
|
+
}
|
|
2925
|
+
else for (var o in e) {
|
|
2926
|
+
var s = /^idb\:\/\/(.*)\/(.*)\//.exec(o);
|
|
2927
|
+
if (s) {
|
|
2928
|
+
var a = yr[`idb://${s[1]}/${s[2]}`];
|
|
2929
|
+
a && wr(a, e, n, t);
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
n.forEach(function(e) {
|
|
2933
|
+
return e();
|
|
2934
|
+
});
|
|
2935
|
+
}
|
|
2936
|
+
function wr(e, t, n, r) {
|
|
2937
|
+
for (var i = [], a = 0, o = Object.entries(e.queries.query); a < o.length; a++) {
|
|
2938
|
+
for (var s = o[a], c = s[0], l = s[1], u = [], d = 0, f = l; d < f.length; d++) {
|
|
2939
|
+
var p = f[d];
|
|
2940
|
+
vr(t, p.obsSet) ? p.subscribers.forEach(function(e) {
|
|
2941
|
+
return n.add(e);
|
|
2942
|
+
}) : r && u.push(p);
|
|
2943
|
+
}
|
|
2944
|
+
r && i.push([c, u]);
|
|
2945
|
+
}
|
|
2946
|
+
if (r) for (var m = 0, h = i; m < h.length; m++) {
|
|
2947
|
+
var g = h[m], c = g[0], u = g[1];
|
|
2948
|
+
e.queries.query[c] = u;
|
|
2949
|
+
}
|
|
2950
|
+
}
|
|
2951
|
+
function Tr(e) {
|
|
2952
|
+
var t = e._state, n = e._deps.indexedDB;
|
|
2953
|
+
if (t.isBeingOpened || e.idbdb) return t.dbReadyPromise.then(function() {
|
|
2954
|
+
return t.dbOpenError ? H(t.dbOpenError) : e;
|
|
2955
|
+
});
|
|
2956
|
+
t.isBeingOpened = !0, t.dbOpenError = null, t.openComplete = !1;
|
|
2957
|
+
var r = t.openCanceller, a = Math.round(e.verno * 10), o = !1;
|
|
2958
|
+
function s() {
|
|
2959
|
+
if (t.openCanceller !== r) throw new O.DatabaseClosed("db.open() was cancelled");
|
|
2960
|
+
}
|
|
2961
|
+
var c = t.dbReadyResolve, l = null, u = !1, d = function() {
|
|
2962
|
+
return new F(function(r, i) {
|
|
2963
|
+
if (s(), !n) throw new O.MissingAPI();
|
|
2964
|
+
var c = e.name, f = t.autoSchema || !a ? n.open(c) : n.open(c, a);
|
|
2965
|
+
if (!f) throw new O.MissingAPI();
|
|
2966
|
+
f.onerror = Y(i), f.onblocked = I(e._fireOnBlocked), f.onupgradeneeded = I(function(r) {
|
|
2967
|
+
if (l = f.transaction, t.autoSchema && !e._options.allowEmptyDB) {
|
|
2968
|
+
f.onerror = gn, l.abort(), f.result.close();
|
|
2969
|
+
var a = n.deleteDatabase(c);
|
|
2970
|
+
a.onsuccess = a.onerror = I(function() {
|
|
2971
|
+
i(new O.NoSuchDatabase(`Database ${c} doesnt exist`));
|
|
2972
|
+
});
|
|
2973
|
+
} else {
|
|
2974
|
+
l.onerror = Y(i);
|
|
2975
|
+
var s = r.oldVersion > 2 ** 62 ? 0 : r.oldVersion;
|
|
2976
|
+
u = s < 1, e.idbdb = f.result, o && zn(e, l), Rn(e, s / 10, l, i);
|
|
2977
|
+
}
|
|
2978
|
+
}, i), f.onsuccess = I(function() {
|
|
2979
|
+
l = null;
|
|
2980
|
+
var n = e.idbdb = f.result, i = v(n.objectStoreNames);
|
|
2981
|
+
if (i.length > 0) try {
|
|
2982
|
+
var s = n.transaction(wn(i), "readonly");
|
|
2983
|
+
if (t.autoSchema) Jn(e, n, s);
|
|
2984
|
+
else if (Xn(e, e._dbSchema, s), !Yn(e, s) && !o) return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."), n.close(), a = n.version + 1, o = !0, r(d());
|
|
2985
|
+
Pn(e, s);
|
|
2986
|
+
} catch {}
|
|
2987
|
+
er.add(e), n.onversionchange = I(function(n) {
|
|
2988
|
+
t.vcFired = !0, e.on("versionchange").fire(n);
|
|
2989
|
+
}), n.onclose = I(function() {
|
|
2990
|
+
e.close({ disableAutoOpen: !1 });
|
|
2991
|
+
}), u && ar(e._deps, c), r();
|
|
2992
|
+
}, i);
|
|
2993
|
+
}).catch(function(e) {
|
|
2994
|
+
switch (e?.name) {
|
|
2995
|
+
case "UnknownError":
|
|
2996
|
+
if (t.PR1398_maxLoop > 0) return t.PR1398_maxLoop--, console.warn("Dexie: Workaround for Chrome UnknownError on open()"), d();
|
|
2997
|
+
break;
|
|
2998
|
+
case "VersionError": if (a > 0) return a = 0, d();
|
|
2999
|
+
}
|
|
3000
|
+
return F.reject(e);
|
|
3001
|
+
});
|
|
3002
|
+
}, f = typeof navigator < "u" && !!n && n === i.indexedDB;
|
|
3003
|
+
return F.race([r, (f ? cr() : F.resolve()).then(d)]).then(function() {
|
|
3004
|
+
return s(), t.onReadyBeingFired = [], F.resolve(sr(function() {
|
|
3005
|
+
return e.on.ready.fire(e.vip);
|
|
3006
|
+
})).then(function n() {
|
|
3007
|
+
if (t.onReadyBeingFired.length > 0) {
|
|
3008
|
+
var r = t.onReadyBeingFired.reduce(Ne, k);
|
|
3009
|
+
return t.onReadyBeingFired = [], F.resolve(sr(function() {
|
|
3010
|
+
return r(e.vip);
|
|
3011
|
+
})).then(n);
|
|
3012
|
+
}
|
|
3013
|
+
});
|
|
3014
|
+
}).finally(function() {
|
|
3015
|
+
t.openCanceller === r && (t.onReadyBeingFired = null, t.isBeingOpened = !1);
|
|
3016
|
+
}).catch(function(n) {
|
|
3017
|
+
t.dbOpenError = n;
|
|
3018
|
+
try {
|
|
3019
|
+
l && l.abort();
|
|
3020
|
+
} catch {}
|
|
3021
|
+
return r === t.openCanceller && e._close(), H(n);
|
|
3022
|
+
}).finally(function() {
|
|
3023
|
+
t.openComplete = !0, c();
|
|
3024
|
+
}).then(function() {
|
|
3025
|
+
if (u) {
|
|
3026
|
+
var t = {};
|
|
3027
|
+
e.tables.forEach(function(n) {
|
|
3028
|
+
n.schema.indexes.forEach(function(r) {
|
|
3029
|
+
r.name && (t[`idb://${e.name}/${n.name}/${r.name}`] = new Z(-1e400, [[[]]]));
|
|
3030
|
+
}), t[`idb://${e.name}/${n.name}/`] = t[`idb://${e.name}/${n.name}/:dels`] = new Z(-1e400, [[[]]]);
|
|
3031
|
+
}), X(_n).fire(t), Cr(t, !0);
|
|
3032
|
+
}
|
|
3033
|
+
return e;
|
|
3034
|
+
});
|
|
3035
|
+
}
|
|
3036
|
+
function Er(e) {
|
|
3037
|
+
var t = function(t) {
|
|
3038
|
+
return e.next(t);
|
|
3039
|
+
}, n = function(t) {
|
|
3040
|
+
return e.throw(t);
|
|
3041
|
+
}, r = a(t), i = a(n);
|
|
3042
|
+
function a(e) {
|
|
3043
|
+
return function(t) {
|
|
3044
|
+
var n = e(t), a = n.value;
|
|
3045
|
+
return n.done ? a : !a || typeof a.then != "function" ? o(a) ? Promise.all(a).then(r, i) : r(a) : a.then(r, i);
|
|
3046
|
+
};
|
|
3047
|
+
}
|
|
3048
|
+
return a(t)();
|
|
3049
|
+
}
|
|
3050
|
+
function Dr(e, t, n) {
|
|
3051
|
+
var r = arguments.length;
|
|
3052
|
+
if (r < 2) throw new O.InvalidArgument("Too few arguments");
|
|
3053
|
+
for (var i = Array(r - 1); --r;) i[r - 1] = arguments[r];
|
|
3054
|
+
return n = i.pop(), [
|
|
3055
|
+
e,
|
|
3056
|
+
re(i),
|
|
3057
|
+
n
|
|
3058
|
+
];
|
|
3059
|
+
}
|
|
3060
|
+
function Or(e, t, n, r, i) {
|
|
3061
|
+
return F.resolve().then(function() {
|
|
3062
|
+
var a = N.transless || N, o = e._createTransaction(t, n, e._dbSchema, r);
|
|
3063
|
+
o.explicit = !0;
|
|
3064
|
+
var s = {
|
|
3065
|
+
trans: o,
|
|
3066
|
+
transless: a
|
|
3067
|
+
};
|
|
3068
|
+
if (r) o.idbtrans = r.idbtrans;
|
|
3069
|
+
else try {
|
|
3070
|
+
o.create(), o.idbtrans._explicit = !0, e._state.PR1398_maxLoop = 3;
|
|
3071
|
+
} catch (r) {
|
|
3072
|
+
return r.name === Ce.InvalidState && e.isOpen() && --e._state.PR1398_maxLoop > 0 ? (console.warn("Dexie: Need to reopen db"), e.close({ disableAutoOpen: !1 }), e.open().then(function() {
|
|
3073
|
+
return Or(e, t, n, null, i);
|
|
3074
|
+
})) : H(r);
|
|
3075
|
+
}
|
|
3076
|
+
var c = me(i);
|
|
3077
|
+
c && yt();
|
|
3078
|
+
var l, u = F.follow(function() {
|
|
3079
|
+
if (l = i.call(o, o), l) {
|
|
3080
|
+
if (c) {
|
|
3081
|
+
var e = z.bind(null, null);
|
|
3082
|
+
l.then(e, e);
|
|
3083
|
+
} else typeof l.next == "function" && typeof l.throw == "function" && (l = Er(l));
|
|
3084
|
+
}
|
|
3085
|
+
}, s);
|
|
3086
|
+
return (l && typeof l.then == "function" ? F.resolve(l).then(function(e) {
|
|
3087
|
+
return o.active ? e : H(new O.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"));
|
|
3088
|
+
}) : u.then(function() {
|
|
3089
|
+
return l;
|
|
3090
|
+
})).then(function(e) {
|
|
3091
|
+
return r && o._resolve(), o._completion.then(function() {
|
|
3092
|
+
return e;
|
|
3093
|
+
});
|
|
3094
|
+
}).catch(function(e) {
|
|
3095
|
+
return o._reject(e), H(e);
|
|
3096
|
+
});
|
|
3097
|
+
});
|
|
3098
|
+
}
|
|
3099
|
+
function kr(e, t, n) {
|
|
3100
|
+
for (var r = o(e) ? e.slice() : [e], i = 0; i < n; ++i) r.push(t);
|
|
3101
|
+
return r;
|
|
3102
|
+
}
|
|
3103
|
+
function Ar(e) {
|
|
3104
|
+
return n(n({}, e), { table: function(t) {
|
|
3105
|
+
var r = e.table(t), i = r.schema, a = Object.create(null), o = [];
|
|
3106
|
+
function s(e, t, r) {
|
|
3107
|
+
var i = An(e), c = a[i] = a[i] || [], l = e == null ? 0 : typeof e == "string" ? 1 : e.length, u = t > 0, d = n(n({}, r), {
|
|
3108
|
+
name: u ? `${i}(virtual-from:${r.name})` : r.name,
|
|
3109
|
+
lowLevelIndex: r,
|
|
3110
|
+
isVirtual: u,
|
|
3111
|
+
keyTail: t,
|
|
3112
|
+
keyLength: l,
|
|
3113
|
+
extractKey: En(e),
|
|
3114
|
+
unique: !u && r.unique
|
|
3115
|
+
});
|
|
3116
|
+
return c.push(d), d.isPrimaryKey || o.push(d), l > 1 && s(l === 2 ? e[0] : e.slice(0, l - 1), t + 1, r), c.sort(function(e, t) {
|
|
3117
|
+
return e.keyTail - t.keyTail;
|
|
3118
|
+
}), d;
|
|
3119
|
+
}
|
|
3120
|
+
var c = s(i.primaryKey.keyPath, 0, i.primaryKey);
|
|
3121
|
+
a[":id"] = [c];
|
|
3122
|
+
for (var l = 0, u = i.indexes; l < u.length; l++) {
|
|
3123
|
+
var d = u[l];
|
|
3124
|
+
s(d.keyPath, 0, d);
|
|
3125
|
+
}
|
|
3126
|
+
function f(e) {
|
|
3127
|
+
var t = a[An(e)];
|
|
3128
|
+
return t && t[0];
|
|
3129
|
+
}
|
|
3130
|
+
function p(t, n) {
|
|
3131
|
+
return {
|
|
3132
|
+
type: t.type === 1 ? 2 : t.type,
|
|
3133
|
+
lower: kr(t.lower, t.lowerOpen ? e.MAX_KEY : e.MIN_KEY, n),
|
|
3134
|
+
lowerOpen: !0,
|
|
3135
|
+
upper: kr(t.upper, t.upperOpen ? e.MIN_KEY : e.MAX_KEY, n),
|
|
3136
|
+
upperOpen: !0
|
|
3137
|
+
};
|
|
3138
|
+
}
|
|
3139
|
+
function m(e) {
|
|
3140
|
+
var t = e.query.index;
|
|
3141
|
+
return t.isVirtual ? n(n({}, e), { query: {
|
|
3142
|
+
index: t.lowLevelIndex,
|
|
3143
|
+
range: p(e.query.range, t.keyTail)
|
|
3144
|
+
} }) : e;
|
|
3145
|
+
}
|
|
3146
|
+
return n(n({}, r), {
|
|
3147
|
+
schema: n(n({}, i), {
|
|
3148
|
+
primaryKey: c,
|
|
3149
|
+
indexes: o,
|
|
3150
|
+
getIndexByKeyPath: f
|
|
3151
|
+
}),
|
|
3152
|
+
count: function(e) {
|
|
3153
|
+
return r.count(m(e));
|
|
3154
|
+
},
|
|
3155
|
+
query: function(e) {
|
|
3156
|
+
return r.query(m(e));
|
|
3157
|
+
},
|
|
3158
|
+
openCursor: function(t) {
|
|
3159
|
+
var n = t.query.index, i = n.keyTail, a = n.isVirtual, o = n.keyLength;
|
|
3160
|
+
if (!a) return r.openCursor(t);
|
|
3161
|
+
function s(n) {
|
|
3162
|
+
function r(r) {
|
|
3163
|
+
r == null ? t.unique ? n.continue(n.key.slice(0, o).concat(t.reverse ? e.MIN_KEY : e.MAX_KEY, i)) : n.continue() : n.continue(kr(r, t.reverse ? e.MAX_KEY : e.MIN_KEY, i));
|
|
3164
|
+
}
|
|
3165
|
+
return Object.create(n, {
|
|
3166
|
+
continue: { value: r },
|
|
3167
|
+
continuePrimaryKey: { value: function(t, r) {
|
|
3168
|
+
n.continuePrimaryKey(kr(t, e.MAX_KEY, i), r);
|
|
3169
|
+
} },
|
|
3170
|
+
primaryKey: { get: function() {
|
|
3171
|
+
return n.primaryKey;
|
|
3172
|
+
} },
|
|
3173
|
+
key: { get: function() {
|
|
3174
|
+
var e = n.key;
|
|
3175
|
+
return o === 1 ? e[0] : e.slice(0, o);
|
|
3176
|
+
} },
|
|
3177
|
+
value: { get: function() {
|
|
3178
|
+
return n.value;
|
|
3179
|
+
} }
|
|
3180
|
+
});
|
|
3181
|
+
}
|
|
3182
|
+
return r.openCursor(m(t)).then(function(e) {
|
|
3183
|
+
return e && s(e);
|
|
3184
|
+
});
|
|
3185
|
+
}
|
|
3186
|
+
});
|
|
3187
|
+
} });
|
|
3188
|
+
}
|
|
3189
|
+
var jr = {
|
|
3190
|
+
stack: "dbcore",
|
|
3191
|
+
name: "VirtualIndexMiddleware",
|
|
3192
|
+
level: 1,
|
|
3193
|
+
create: Ar
|
|
3194
|
+
};
|
|
3195
|
+
function Mr(e, t, n, r) {
|
|
3196
|
+
return n ||= {}, r ||= "", a(e).forEach(function(i) {
|
|
3197
|
+
if (!u(t, i)) n[r + i] = void 0;
|
|
3198
|
+
else {
|
|
3199
|
+
var a = e[i], o = t[i];
|
|
3200
|
+
if (typeof a == "object" && typeof o == "object" && a && o) {
|
|
3201
|
+
var s = ue(a);
|
|
3202
|
+
s === ue(o) ? s === "Object" ? Mr(a, o, n, r + i + ".") : a !== o && (n[r + i] = t[i]) : n[r + i] = t[i];
|
|
3203
|
+
} else a !== o && (n[r + i] = t[i]);
|
|
3204
|
+
}
|
|
3205
|
+
}), a(t).forEach(function(i) {
|
|
3206
|
+
u(e, i) || (n[r + i] = t[i]);
|
|
3207
|
+
}), n;
|
|
3208
|
+
}
|
|
3209
|
+
function Nr(e, t) {
|
|
3210
|
+
return t.type === "delete" ? t.keys : t.keys || t.values.map(e.extractKey);
|
|
3211
|
+
}
|
|
3212
|
+
var Pr = {
|
|
3213
|
+
stack: "dbcore",
|
|
3214
|
+
name: "HooksMiddleware",
|
|
3215
|
+
level: 2,
|
|
3216
|
+
create: function(e) {
|
|
3217
|
+
return n(n({}, e), { table: function(t) {
|
|
3218
|
+
var i = e.table(t), a = i.schema.primaryKey;
|
|
3219
|
+
return n(n({}, i), { mutate: function(e) {
|
|
3220
|
+
var o = N.trans, s = o.table(t).hook, c = s.deleting, l = s.creating, d = s.updating;
|
|
3221
|
+
switch (e.type) {
|
|
3222
|
+
case "add":
|
|
3223
|
+
if (l.fire === k) break;
|
|
3224
|
+
return o._promise("readwrite", function() {
|
|
3225
|
+
return f(e);
|
|
3226
|
+
}, !0);
|
|
3227
|
+
case "put":
|
|
3228
|
+
if (l.fire === k && d.fire === k) break;
|
|
3229
|
+
return o._promise("readwrite", function() {
|
|
3230
|
+
return f(e);
|
|
3231
|
+
}, !0);
|
|
3232
|
+
case "delete":
|
|
3233
|
+
if (c.fire === k) break;
|
|
3234
|
+
return o._promise("readwrite", function() {
|
|
3235
|
+
return f(e);
|
|
3236
|
+
}, !0);
|
|
3237
|
+
case "deleteRange":
|
|
3238
|
+
if (c.fire === k) break;
|
|
3239
|
+
return o._promise("readwrite", function() {
|
|
3240
|
+
return p(e);
|
|
3241
|
+
}, !0);
|
|
3242
|
+
}
|
|
3243
|
+
return i.mutate(e);
|
|
3244
|
+
function f(e) {
|
|
3245
|
+
var t = N.trans, o = e.keys || Nr(a, e);
|
|
3246
|
+
if (!o) throw Error("Keys missing");
|
|
3247
|
+
return e = e.type === "add" || e.type === "put" ? n(n({}, e), { keys: o }) : n({}, e), e.type !== "delete" && (e.values = r([], e.values, !0)), e.keys && (e.keys = r([], e.keys, !0)), Fr(i, e, o).then(function(n) {
|
|
3248
|
+
var r = o.map(function(r, i) {
|
|
3249
|
+
var o = n[i], s = {
|
|
3250
|
+
onerror: null,
|
|
3251
|
+
onsuccess: null
|
|
3252
|
+
};
|
|
3253
|
+
if (e.type === "delete") c.fire.call(s, r, o, t);
|
|
3254
|
+
else if (e.type === "add" || o === void 0) {
|
|
3255
|
+
var f = l.fire.call(s, r, e.values[i], t);
|
|
3256
|
+
r == null && f != null && (r = f, e.keys[i] = r, a.outbound || w(e.values[i], a.keyPath, r));
|
|
3257
|
+
} else {
|
|
3258
|
+
var p = Mr(o, e.values[i]), m = d.fire.call(s, p, r, o, t);
|
|
3259
|
+
if (m) {
|
|
3260
|
+
var h = e.values[i];
|
|
3261
|
+
Object.keys(m).forEach(function(e) {
|
|
3262
|
+
u(h, e) ? h[e] = m[e] : w(h, e, m[e]);
|
|
3263
|
+
});
|
|
3264
|
+
}
|
|
3265
|
+
}
|
|
3266
|
+
return s;
|
|
3267
|
+
});
|
|
3268
|
+
return i.mutate(e).then(function(t) {
|
|
3269
|
+
for (var i = t.failures, a = t.results, s = t.numFailures, c = t.lastResult, l = 0; l < o.length; ++l) {
|
|
3270
|
+
var u = a ? a[l] : o[l], d = r[l];
|
|
3271
|
+
u == null ? d.onerror && d.onerror(i[l]) : d.onsuccess && d.onsuccess(e.type === "put" && n[l] ? e.values[l] : u);
|
|
3272
|
+
}
|
|
3273
|
+
return {
|
|
3274
|
+
failures: i,
|
|
3275
|
+
results: a,
|
|
3276
|
+
numFailures: s,
|
|
3277
|
+
lastResult: c
|
|
3278
|
+
};
|
|
3279
|
+
}).catch(function(e) {
|
|
3280
|
+
return r.forEach(function(t) {
|
|
3281
|
+
return t.onerror && t.onerror(e);
|
|
3282
|
+
}), Promise.reject(e);
|
|
3283
|
+
});
|
|
3284
|
+
});
|
|
3285
|
+
}
|
|
3286
|
+
function p(e) {
|
|
3287
|
+
return m(e.trans, e.range, 1e4);
|
|
3288
|
+
}
|
|
3289
|
+
function m(e, t, r) {
|
|
3290
|
+
return i.query({
|
|
3291
|
+
trans: e,
|
|
3292
|
+
values: !1,
|
|
3293
|
+
query: {
|
|
3294
|
+
index: a,
|
|
3295
|
+
range: t
|
|
3296
|
+
},
|
|
3297
|
+
limit: r
|
|
3298
|
+
}).then(function(i) {
|
|
3299
|
+
var a = i.result;
|
|
3300
|
+
return f({
|
|
3301
|
+
type: "delete",
|
|
3302
|
+
keys: a,
|
|
3303
|
+
trans: e
|
|
3304
|
+
}).then(function(i) {
|
|
3305
|
+
return i.numFailures > 0 ? Promise.reject(i.failures[0]) : a.length < r ? {
|
|
3306
|
+
failures: [],
|
|
3307
|
+
numFailures: 0,
|
|
3308
|
+
lastResult: void 0
|
|
3309
|
+
} : m(e, n(n({}, t), {
|
|
3310
|
+
lower: a[a.length - 1],
|
|
3311
|
+
lowerOpen: !0
|
|
3312
|
+
}), r);
|
|
3313
|
+
});
|
|
3314
|
+
});
|
|
3315
|
+
}
|
|
3316
|
+
} });
|
|
3317
|
+
} });
|
|
3318
|
+
}
|
|
3319
|
+
};
|
|
3320
|
+
function Fr(e, t, n) {
|
|
3321
|
+
return t.type === "add" ? Promise.resolve([]) : e.getMany({
|
|
3322
|
+
trans: t.trans,
|
|
3323
|
+
keys: n,
|
|
3324
|
+
cache: "immutable"
|
|
3325
|
+
});
|
|
3326
|
+
}
|
|
3327
|
+
function Ir(e, t, n) {
|
|
3328
|
+
try {
|
|
3329
|
+
if (!t || t.keys.length < e.length) return null;
|
|
3330
|
+
for (var r = [], i = 0, a = 0; i < t.keys.length && a < e.length; ++i) K(t.keys[i], e[a]) === 0 && (r.push(n ? T(t.values[i]) : t.values[i]), ++a);
|
|
3331
|
+
return r.length === e.length ? r : null;
|
|
3332
|
+
} catch {
|
|
3333
|
+
return null;
|
|
3334
|
+
}
|
|
3335
|
+
}
|
|
3336
|
+
var Lr = {
|
|
3337
|
+
stack: "dbcore",
|
|
3338
|
+
level: -1,
|
|
3339
|
+
create: function(e) {
|
|
3340
|
+
return { table: function(t) {
|
|
3341
|
+
var r = e.table(t);
|
|
3342
|
+
return n(n({}, r), {
|
|
3343
|
+
getMany: function(e) {
|
|
3344
|
+
if (!e.cache) return r.getMany(e);
|
|
3345
|
+
var t = Ir(e.keys, e.trans._cache, e.cache === "clone");
|
|
3346
|
+
return t ? F.resolve(t) : r.getMany(e).then(function(t) {
|
|
3347
|
+
return e.trans._cache = {
|
|
3348
|
+
keys: e.keys,
|
|
3349
|
+
values: e.cache === "clone" ? T(t) : t
|
|
3350
|
+
}, t;
|
|
3351
|
+
});
|
|
3352
|
+
},
|
|
3353
|
+
mutate: function(e) {
|
|
3354
|
+
return e.type !== "add" && (e.trans._cache = null), r.mutate(e);
|
|
3355
|
+
}
|
|
3356
|
+
});
|
|
3357
|
+
} };
|
|
3358
|
+
}
|
|
3359
|
+
};
|
|
3360
|
+
function Rr(e, t) {
|
|
3361
|
+
return e.trans.mode === "readonly" && !!e.subscr && !e.trans.explicit && e.trans.db._options.cache !== "disabled" && !t.schema.primaryKey.outbound;
|
|
3362
|
+
}
|
|
3363
|
+
function zr(e, t) {
|
|
3364
|
+
switch (e) {
|
|
3365
|
+
case "query": return t.values && !t.unique;
|
|
3366
|
+
case "get":
|
|
3367
|
+
case "getMany":
|
|
3368
|
+
case "count":
|
|
3369
|
+
case "openCursor": return !1;
|
|
3370
|
+
}
|
|
3371
|
+
}
|
|
3372
|
+
var Br = {
|
|
3373
|
+
stack: "dbcore",
|
|
3374
|
+
level: 0,
|
|
3375
|
+
name: "Observability",
|
|
3376
|
+
create: function(e) {
|
|
3377
|
+
var t = e.schema.name, r = new Z(e.MIN_KEY, e.MAX_KEY);
|
|
3378
|
+
return n(n({}, e), {
|
|
3379
|
+
transaction: function(t, n, r) {
|
|
3380
|
+
if (N.subscr && n !== "readonly") throw new O.ReadOnly(`Readwrite transaction in liveQuery context. Querier source: ${N.querier}`);
|
|
3381
|
+
return e.transaction(t, n, r);
|
|
3382
|
+
},
|
|
3383
|
+
table: function(i) {
|
|
3384
|
+
var s = e.table(i), c = s.schema, l = c.primaryKey, u = c.indexes, d = l.extractKey, f = l.outbound, p = l.autoIncrement && u.filter(function(e) {
|
|
3385
|
+
return e.compound && e.keyPath.includes(l.keyPath);
|
|
3386
|
+
}), m = n(n({}, s), { mutate: function(n) {
|
|
3387
|
+
var a = n.trans, u = n.mutatedParts ||= {}, d = function(e) {
|
|
3388
|
+
var n = `idb://${t}/${i}/${e}`;
|
|
3389
|
+
return u[n] || (u[n] = new Z());
|
|
3390
|
+
}, f = d(""), m = d(":dels"), h = n.type, g = n.type === "deleteRange" ? [n.range] : n.type === "delete" ? [n.keys] : n.values.length < 50 ? [Nr(l, n).filter(function(e) {
|
|
3391
|
+
return e != null;
|
|
3392
|
+
}), n.values] : [], _ = g[0], v = g[1], y = n.trans._cache;
|
|
3393
|
+
if (o(_)) {
|
|
3394
|
+
f.addKeys(_);
|
|
3395
|
+
var b = h === "delete" || _.length === v.length ? Ir(_, y) : null;
|
|
3396
|
+
b || m.addKeys(_), (b || v) && Vr(d, c, b, v);
|
|
3397
|
+
} else if (_) {
|
|
3398
|
+
var x = {
|
|
3399
|
+
from: _.lower ?? e.MIN_KEY,
|
|
3400
|
+
to: _.upper ?? e.MAX_KEY
|
|
3401
|
+
};
|
|
3402
|
+
m.add(x), f.add(x);
|
|
3403
|
+
} else f.add(r), m.add(r), c.indexes.forEach(function(e) {
|
|
3404
|
+
return d(e.name).add(r);
|
|
3405
|
+
});
|
|
3406
|
+
return s.mutate(n).then(function(e) {
|
|
3407
|
+
return _ && (n.type === "add" || n.type === "put") && (f.addKeys(e.results), p && p.forEach(function(t) {
|
|
3408
|
+
for (var r = n.values.map(function(e) {
|
|
3409
|
+
return t.extractKey(e);
|
|
3410
|
+
}), i = t.keyPath.findIndex(function(e) {
|
|
3411
|
+
return e === l.keyPath;
|
|
3412
|
+
}), a = 0, o = e.results.length; a < o; ++a) r[a][i] = e.results[a];
|
|
3413
|
+
d(t.name).addKeys(r);
|
|
3414
|
+
})), a.mutatedParts = _r(a.mutatedParts || {}, u), e;
|
|
3415
|
+
});
|
|
3416
|
+
} }), h = function(t) {
|
|
3417
|
+
var n = t.query, r = n.index, i = n.range;
|
|
3418
|
+
return [r, new Z(i.lower ?? e.MIN_KEY, i.upper ?? e.MAX_KEY)];
|
|
3419
|
+
}, g = {
|
|
3420
|
+
get: function(e) {
|
|
3421
|
+
return [l, new Z(e.key)];
|
|
3422
|
+
},
|
|
3423
|
+
getMany: function(e) {
|
|
3424
|
+
return [l, new Z().addKeys(e.keys)];
|
|
3425
|
+
},
|
|
3426
|
+
count: h,
|
|
3427
|
+
query: h,
|
|
3428
|
+
openCursor: h
|
|
3429
|
+
};
|
|
3430
|
+
return a(g).forEach(function(e) {
|
|
3431
|
+
m[e] = function(a) {
|
|
3432
|
+
var o = N.subscr, c = !!o, l = Rr(N, s) && zr(e, a) ? a.obsSet = {} : o;
|
|
3433
|
+
if (c) {
|
|
3434
|
+
var u = function(e) {
|
|
3435
|
+
var n = `idb://${t}/${i}/${e}`;
|
|
3436
|
+
return l[n] || (l[n] = new Z());
|
|
3437
|
+
}, p = u(""), m = u(":dels"), h = g[e](a), _ = h[0], v = h[1];
|
|
3438
|
+
if (e === "query" && _.isPrimaryKey && !a.values ? m.add(v) : u(_.name || "").add(v), !_.isPrimaryKey) {
|
|
3439
|
+
if (e === "count") m.add(r);
|
|
3440
|
+
else {
|
|
3441
|
+
var y = e === "query" && f && a.values && s.query(n(n({}, a), { values: !1 }));
|
|
3442
|
+
return s[e].apply(this, arguments).then(function(t) {
|
|
3443
|
+
if (e === "query") {
|
|
3444
|
+
if (f && a.values) return y.then(function(e) {
|
|
3445
|
+
var n = e.result;
|
|
3446
|
+
return p.addKeys(n), t;
|
|
3447
|
+
});
|
|
3448
|
+
var n = a.values ? t.result.map(d) : t.result;
|
|
3449
|
+
a.values ? p.addKeys(n) : m.addKeys(n);
|
|
3450
|
+
} else if (e === "openCursor") {
|
|
3451
|
+
var r = t, i = a.values;
|
|
3452
|
+
return r && Object.create(r, {
|
|
3453
|
+
key: { get: function() {
|
|
3454
|
+
return m.addKey(r.primaryKey), r.key;
|
|
3455
|
+
} },
|
|
3456
|
+
primaryKey: { get: function() {
|
|
3457
|
+
var e = r.primaryKey;
|
|
3458
|
+
return m.addKey(e), e;
|
|
3459
|
+
} },
|
|
3460
|
+
value: { get: function() {
|
|
3461
|
+
return i && p.addKey(r.primaryKey), r.value;
|
|
3462
|
+
} }
|
|
3463
|
+
});
|
|
3464
|
+
}
|
|
3465
|
+
return t;
|
|
3466
|
+
});
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
}
|
|
3470
|
+
return s[e].apply(this, arguments);
|
|
3471
|
+
};
|
|
3472
|
+
}), m;
|
|
3473
|
+
}
|
|
3474
|
+
});
|
|
3475
|
+
}
|
|
3476
|
+
};
|
|
3477
|
+
function Vr(e, t, n, r) {
|
|
3478
|
+
function i(t) {
|
|
3479
|
+
var i = e(t.name || "");
|
|
3480
|
+
function a(e) {
|
|
3481
|
+
return e == null ? null : t.extractKey(e);
|
|
3482
|
+
}
|
|
3483
|
+
var s = function(e) {
|
|
3484
|
+
return t.multiEntry && o(e) ? e.forEach(function(e) {
|
|
3485
|
+
return i.addKey(e);
|
|
3486
|
+
}) : i.addKey(e);
|
|
3487
|
+
};
|
|
3488
|
+
(n || r).forEach(function(e, t) {
|
|
3489
|
+
var i = n && a(n[t]), o = r && a(r[t]);
|
|
3490
|
+
K(i, o) !== 0 && (i != null && s(i), o != null && s(o));
|
|
3491
|
+
});
|
|
3492
|
+
}
|
|
3493
|
+
t.indexes.forEach(i);
|
|
3494
|
+
}
|
|
3495
|
+
function Hr(e, t, r) {
|
|
3496
|
+
if (r.numFailures === 0) return t;
|
|
3497
|
+
if (t.type === "deleteRange") return null;
|
|
3498
|
+
var i = t.keys ? t.keys.length : "values" in t && t.values ? t.values.length : 1;
|
|
3499
|
+
if (r.numFailures === i) return null;
|
|
3500
|
+
var a = n({}, t);
|
|
3501
|
+
return o(a.keys) && (a.keys = a.keys.filter(function(e, t) {
|
|
3502
|
+
return !(t in r.failures);
|
|
3503
|
+
})), "values" in a && o(a.values) && (a.values = a.values.filter(function(e, t) {
|
|
3504
|
+
return !(t in r.failures);
|
|
3505
|
+
})), a;
|
|
3506
|
+
}
|
|
3507
|
+
function Ur(e, t) {
|
|
3508
|
+
return t.lower === void 0 ? !0 : t.lowerOpen ? K(e, t.lower) > 0 : K(e, t.lower) >= 0;
|
|
3509
|
+
}
|
|
3510
|
+
function Wr(e, t) {
|
|
3511
|
+
return t.upper === void 0 ? !0 : t.upperOpen ? K(e, t.upper) < 0 : K(e, t.upper) <= 0;
|
|
3512
|
+
}
|
|
3513
|
+
function Gr(e, t) {
|
|
3514
|
+
return Ur(e, t) && Wr(e, t);
|
|
3515
|
+
}
|
|
3516
|
+
function Kr(e, t, n, r, i, a) {
|
|
3517
|
+
if (!n || n.length === 0) return e;
|
|
3518
|
+
var s = t.query.index, c = s.multiEntry, l = t.query.range, u = r.schema.primaryKey.extractKey, d = s.extractKey, f = (s.lowLevelIndex || s).extractKey, p = n.reduce(function(e, n) {
|
|
3519
|
+
var r = e, i = [];
|
|
3520
|
+
if (n.type === "add" || n.type === "put") for (var a = new Z(), s = n.values.length - 1; s >= 0; --s) {
|
|
3521
|
+
var f = n.values[s], p = u(f);
|
|
3522
|
+
if (!a.hasKey(p)) {
|
|
3523
|
+
var m = d(f);
|
|
3524
|
+
(c && o(m) ? m.some(function(e) {
|
|
3525
|
+
return Gr(e, l);
|
|
3526
|
+
}) : Gr(m, l)) && (a.addKey(p), i.push(f));
|
|
3527
|
+
}
|
|
3528
|
+
}
|
|
3529
|
+
switch (n.type) {
|
|
3530
|
+
case "add":
|
|
3531
|
+
var h = new Z().addKeys(t.values ? e.map(function(e) {
|
|
3532
|
+
return u(e);
|
|
3533
|
+
}) : e);
|
|
3534
|
+
r = e.concat(t.values ? i.filter(function(e) {
|
|
3535
|
+
var t = u(e);
|
|
3536
|
+
return !h.hasKey(t) && (h.addKey(t), !0);
|
|
3537
|
+
}) : i.map(function(e) {
|
|
3538
|
+
return u(e);
|
|
3539
|
+
}).filter(function(e) {
|
|
3540
|
+
return !h.hasKey(e) && (h.addKey(e), !0);
|
|
3541
|
+
}));
|
|
3542
|
+
break;
|
|
3543
|
+
case "put":
|
|
3544
|
+
var g = new Z().addKeys(n.values.map(function(e) {
|
|
3545
|
+
return u(e);
|
|
3546
|
+
}));
|
|
3547
|
+
r = e.filter(function(e) {
|
|
3548
|
+
return !g.hasKey(t.values ? u(e) : e);
|
|
3549
|
+
}).concat(t.values ? i : i.map(function(e) {
|
|
3550
|
+
return u(e);
|
|
3551
|
+
}));
|
|
3552
|
+
break;
|
|
3553
|
+
case "delete":
|
|
3554
|
+
var _ = new Z().addKeys(n.keys);
|
|
3555
|
+
r = e.filter(function(e) {
|
|
3556
|
+
return !_.hasKey(t.values ? u(e) : e);
|
|
3557
|
+
});
|
|
3558
|
+
break;
|
|
3559
|
+
case "deleteRange":
|
|
3560
|
+
var v = n.range;
|
|
3561
|
+
r = e.filter(function(e) {
|
|
3562
|
+
return !Gr(u(e), v);
|
|
3563
|
+
});
|
|
3564
|
+
}
|
|
3565
|
+
return r;
|
|
3566
|
+
}, e);
|
|
3567
|
+
if (p === e) return e;
|
|
3568
|
+
var m = function(e, t) {
|
|
3569
|
+
return K(f(e), f(t)) || K(u(e), u(t));
|
|
3570
|
+
};
|
|
3571
|
+
return p.sort(t.direction === "prev" || t.direction === "prevunique" ? function(e, t) {
|
|
3572
|
+
return m(t, e);
|
|
3573
|
+
} : m), t.limit && t.limit < 1e400 && (p.length > t.limit ? p.length = t.limit : e.length === t.limit && p.length < t.limit && (i.dirty = !0)), a ? Object.freeze(p) : p;
|
|
3574
|
+
}
|
|
3575
|
+
function qr(e, t) {
|
|
3576
|
+
return K(e.lower, t.lower) === 0 && K(e.upper, t.upper) === 0 && !!e.lowerOpen == !!t.lowerOpen && !!e.upperOpen == !!t.upperOpen;
|
|
3577
|
+
}
|
|
3578
|
+
function Jr(e, t, n, r) {
|
|
3579
|
+
if (e === void 0) return t === void 0 ? 0 : -1;
|
|
3580
|
+
if (t === void 0) return 1;
|
|
3581
|
+
var i = K(e, t);
|
|
3582
|
+
if (i === 0) {
|
|
3583
|
+
if (n && r) return 0;
|
|
3584
|
+
if (n) return 1;
|
|
3585
|
+
if (r) return -1;
|
|
3586
|
+
}
|
|
3587
|
+
return i;
|
|
3588
|
+
}
|
|
3589
|
+
function Yr(e, t, n, r) {
|
|
3590
|
+
if (e === void 0) return t === void 0 ? 0 : 1;
|
|
3591
|
+
if (t === void 0) return -1;
|
|
3592
|
+
var i = K(e, t);
|
|
3593
|
+
if (i === 0) {
|
|
3594
|
+
if (n && r) return 0;
|
|
3595
|
+
if (n) return -1;
|
|
3596
|
+
if (r) return 1;
|
|
3597
|
+
}
|
|
3598
|
+
return i;
|
|
3599
|
+
}
|
|
3600
|
+
function Xr(e, t) {
|
|
3601
|
+
return Jr(e.lower, t.lower, e.lowerOpen, t.lowerOpen) <= 0 && Yr(e.upper, t.upper, e.upperOpen, t.upperOpen) >= 0;
|
|
3602
|
+
}
|
|
3603
|
+
function Zr(e, t, n, r) {
|
|
3604
|
+
var i = yr[`idb://${e}/${t}`];
|
|
3605
|
+
if (!i) return [];
|
|
3606
|
+
var a = i.queries[n];
|
|
3607
|
+
if (!a) return [
|
|
3608
|
+
null,
|
|
3609
|
+
!1,
|
|
3610
|
+
i,
|
|
3611
|
+
null
|
|
3612
|
+
];
|
|
3613
|
+
var o = a[(r.query ? r.query.index.name : null) || ""];
|
|
3614
|
+
if (!o) return [
|
|
3615
|
+
null,
|
|
3616
|
+
!1,
|
|
3617
|
+
i,
|
|
3618
|
+
null
|
|
3619
|
+
];
|
|
3620
|
+
switch (n) {
|
|
3621
|
+
case "query":
|
|
3622
|
+
var s = r.direction ?? "next", c = o.find(function(e) {
|
|
3623
|
+
return e.req.limit === r.limit && e.req.values === r.values && (e.req.direction ?? "next") === s && qr(e.req.query.range, r.query.range);
|
|
3624
|
+
});
|
|
3625
|
+
return c ? [
|
|
3626
|
+
c,
|
|
3627
|
+
!0,
|
|
3628
|
+
i,
|
|
3629
|
+
o
|
|
3630
|
+
] : [
|
|
3631
|
+
o.find(function(e) {
|
|
3632
|
+
return ("limit" in e.req ? e.req.limit : 1e400) >= r.limit && (e.req.direction ?? "next") === s && (!r.values || e.req.values) && Xr(e.req.query.range, r.query.range);
|
|
3633
|
+
}),
|
|
3634
|
+
!1,
|
|
3635
|
+
i,
|
|
3636
|
+
o
|
|
3637
|
+
];
|
|
3638
|
+
case "count":
|
|
3639
|
+
var l = o.find(function(e) {
|
|
3640
|
+
return qr(e.req.query.range, r.query.range);
|
|
3641
|
+
});
|
|
3642
|
+
return [
|
|
3643
|
+
l,
|
|
3644
|
+
!!l,
|
|
3645
|
+
i,
|
|
3646
|
+
o
|
|
3647
|
+
];
|
|
3648
|
+
}
|
|
3649
|
+
}
|
|
3650
|
+
function Qr(e, t, n, r) {
|
|
3651
|
+
e.subscribers.add(n), r.addEventListener("abort", function() {
|
|
3652
|
+
e.subscribers.delete(n), e.subscribers.size === 0 && $r(e, t);
|
|
3653
|
+
});
|
|
3654
|
+
}
|
|
3655
|
+
function $r(e, t) {
|
|
3656
|
+
setTimeout(function() {
|
|
3657
|
+
e.subscribers.size === 0 && E(t, e);
|
|
3658
|
+
}, 3e3);
|
|
3659
|
+
}
|
|
3660
|
+
var ei = {
|
|
3661
|
+
stack: "dbcore",
|
|
3662
|
+
level: 0,
|
|
3663
|
+
name: "Cache",
|
|
3664
|
+
create: function(e) {
|
|
3665
|
+
var t = e.schema.name;
|
|
3666
|
+
return n(n({}, e), {
|
|
3667
|
+
transaction: function(n, r, i) {
|
|
3668
|
+
var a = e.transaction(n, r, i);
|
|
3669
|
+
if (r === "readwrite") {
|
|
3670
|
+
var o = new AbortController(), s = o.signal, c = function(i) {
|
|
3671
|
+
return function() {
|
|
3672
|
+
if (o.abort(), r === "readwrite") {
|
|
3673
|
+
for (var s = /* @__PURE__ */ new Set(), c = 0, l = n; c < l.length; c++) {
|
|
3674
|
+
var u = l[c], d = yr[`idb://${t}/${u}`];
|
|
3675
|
+
if (d) {
|
|
3676
|
+
var f = e.table(u), p = d.optimisticOps.filter(function(e) {
|
|
3677
|
+
return e.trans === a;
|
|
3678
|
+
});
|
|
3679
|
+
if (a._explicit && i && a.mutatedParts) for (var m = 0, h = Object.values(d.queries.query); m < h.length; m++) for (var g = h[m], _ = 0, v = g.slice(); _ < v.length; _++) {
|
|
3680
|
+
var y = v[_];
|
|
3681
|
+
vr(y.obsSet, a.mutatedParts) && (E(g, y), y.subscribers.forEach(function(e) {
|
|
3682
|
+
return s.add(e);
|
|
3683
|
+
}));
|
|
3684
|
+
}
|
|
3685
|
+
else if (p.length > 0) {
|
|
3686
|
+
d.optimisticOps = d.optimisticOps.filter(function(e) {
|
|
3687
|
+
return e.trans !== a;
|
|
3688
|
+
});
|
|
3689
|
+
for (var b = 0, x = Object.values(d.queries.query); b < x.length; b++) for (var g = x[b], S = 0, C = g.slice(); S < C.length; S++) {
|
|
3690
|
+
var y = C[S];
|
|
3691
|
+
if (y.res != null && a.mutatedParts) {
|
|
3692
|
+
if (i && !y.dirty) {
|
|
3693
|
+
var w = Object.isFrozen(y.res), ee = Kr(y.res, y.req, p, f, y, w);
|
|
3694
|
+
y.dirty ? (E(g, y), y.subscribers.forEach(function(e) {
|
|
3695
|
+
return s.add(e);
|
|
3696
|
+
})) : ee !== y.res && (y.res = ee, y.promise = F.resolve({ result: ee }));
|
|
3697
|
+
} else y.dirty && E(g, y), y.subscribers.forEach(function(e) {
|
|
3698
|
+
return s.add(e);
|
|
3699
|
+
});
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3702
|
+
}
|
|
3703
|
+
}
|
|
3704
|
+
}
|
|
3705
|
+
s.forEach(function(e) {
|
|
3706
|
+
return e();
|
|
3707
|
+
});
|
|
3708
|
+
}
|
|
3709
|
+
};
|
|
3710
|
+
};
|
|
3711
|
+
a.addEventListener("abort", c(!1), { signal: s }), a.addEventListener("error", c(!1), { signal: s }), a.addEventListener("complete", c(!0), { signal: s });
|
|
3712
|
+
}
|
|
3713
|
+
return a;
|
|
3714
|
+
},
|
|
3715
|
+
table: function(r) {
|
|
3716
|
+
var i = e.table(r), a = i.schema.primaryKey;
|
|
3717
|
+
return n(n({}, i), {
|
|
3718
|
+
mutate: function(e) {
|
|
3719
|
+
var o = N.trans;
|
|
3720
|
+
if (a.outbound || o.db._options.cache === "disabled" || o.explicit || o.idbtrans.mode !== "readwrite") return i.mutate(e);
|
|
3721
|
+
var s = yr[`idb://${t}/${r}`];
|
|
3722
|
+
if (!s) return i.mutate(e);
|
|
3723
|
+
var c = i.mutate(e);
|
|
3724
|
+
return (e.type === "add" || e.type === "put") && (e.values.length >= 50 || Nr(a, e).some(function(e) {
|
|
3725
|
+
return e == null;
|
|
3726
|
+
})) ? c.then(function(t) {
|
|
3727
|
+
var r = Hr(s, n(n({}, e), { values: e.values.map(function(e, r) {
|
|
3728
|
+
if (t.failures[r]) return e;
|
|
3729
|
+
var i = a.keyPath?.includes(".") ? T(e) : n({}, e);
|
|
3730
|
+
return w(i, a.keyPath, t.results[r]), i;
|
|
3731
|
+
}) }), t);
|
|
3732
|
+
s.optimisticOps.push(r), queueMicrotask(function() {
|
|
3733
|
+
return e.mutatedParts && Sr(e.mutatedParts);
|
|
3734
|
+
});
|
|
3735
|
+
}) : (s.optimisticOps.push(e), e.mutatedParts && Sr(e.mutatedParts), c.then(function(t) {
|
|
3736
|
+
if (t.numFailures > 0) {
|
|
3737
|
+
E(s.optimisticOps, e);
|
|
3738
|
+
var n = Hr(s, e, t);
|
|
3739
|
+
n && s.optimisticOps.push(n), e.mutatedParts && Sr(e.mutatedParts);
|
|
3740
|
+
}
|
|
3741
|
+
}), c.catch(function() {
|
|
3742
|
+
E(s.optimisticOps, e), e.mutatedParts && Sr(e.mutatedParts);
|
|
3743
|
+
})), c;
|
|
3744
|
+
},
|
|
3745
|
+
query: function(e) {
|
|
3746
|
+
if (!Rr(N, i) || !zr("query", e)) return i.query(e);
|
|
3747
|
+
var n = N.trans?.db._options.cache === "immutable", a = N, o = a.requery, s = a.signal, c = Zr(t, r, "query", e), l = c[0], u = c[1], d = c[2], f = c[3];
|
|
3748
|
+
if (l && u) l.obsSet = e.obsSet;
|
|
3749
|
+
else {
|
|
3750
|
+
var p = i.query(e).then(function(e) {
|
|
3751
|
+
var t = e.result;
|
|
3752
|
+
if (l && (l.res = t), n) {
|
|
3753
|
+
for (var r = 0, i = t.length; r < i; ++r) Object.freeze(t[r]);
|
|
3754
|
+
Object.freeze(t);
|
|
3755
|
+
}
|
|
3756
|
+
return e;
|
|
3757
|
+
}).catch(function(e) {
|
|
3758
|
+
return f && l && E(f, l), Promise.reject(e);
|
|
3759
|
+
});
|
|
3760
|
+
l = {
|
|
3761
|
+
obsSet: e.obsSet,
|
|
3762
|
+
promise: p,
|
|
3763
|
+
subscribers: /* @__PURE__ */ new Set(),
|
|
3764
|
+
type: "query",
|
|
3765
|
+
req: e,
|
|
3766
|
+
dirty: !1
|
|
3767
|
+
}, f ? f.push(l) : (f = [l], d ||= yr[`idb://${t}/${r}`] = {
|
|
3768
|
+
queries: {
|
|
3769
|
+
query: {},
|
|
3770
|
+
count: {}
|
|
3771
|
+
},
|
|
3772
|
+
objs: /* @__PURE__ */ new Map(),
|
|
3773
|
+
optimisticOps: [],
|
|
3774
|
+
unsignaledParts: {}
|
|
3775
|
+
}, d.queries.query[e.query.index.name || ""] = f);
|
|
3776
|
+
}
|
|
3777
|
+
return Qr(l, f, o, s), l.promise.then(function(t) {
|
|
3778
|
+
var r = Kr(t.result, e, d?.optimisticOps, i, l, n);
|
|
3779
|
+
return { result: n ? r : T(r) };
|
|
3780
|
+
});
|
|
3781
|
+
}
|
|
3782
|
+
});
|
|
3783
|
+
}
|
|
3784
|
+
});
|
|
3785
|
+
}
|
|
3786
|
+
};
|
|
3787
|
+
function ti(e, t) {
|
|
3788
|
+
return new Proxy(e, { get: function(e, n, r) {
|
|
3789
|
+
return n === "db" ? t : Reflect.get(e, n, r);
|
|
3790
|
+
} });
|
|
3791
|
+
}
|
|
3792
|
+
var Q = function() {
|
|
3793
|
+
function e(t, r) {
|
|
3794
|
+
var i = this;
|
|
3795
|
+
this._middlewares = {}, this.verno = 0;
|
|
3796
|
+
var a = e.dependencies;
|
|
3797
|
+
this._options = r = n({
|
|
3798
|
+
addons: e.addons,
|
|
3799
|
+
autoOpen: !0,
|
|
3800
|
+
indexedDB: a.indexedDB,
|
|
3801
|
+
IDBKeyRange: a.IDBKeyRange,
|
|
3802
|
+
cache: "cloned",
|
|
3803
|
+
maxConnections: At
|
|
3804
|
+
}, r), this._deps = {
|
|
3805
|
+
indexedDB: r.indexedDB,
|
|
3806
|
+
IDBKeyRange: r.IDBKeyRange
|
|
3807
|
+
};
|
|
3808
|
+
var o = r.addons;
|
|
3809
|
+
this._dbSchema = {}, this._versions = [], this._storeNames = [], this._allTables = {}, this.idbdb = null, this._novip = this;
|
|
3810
|
+
var s = {
|
|
3811
|
+
dbOpenError: null,
|
|
3812
|
+
isBeingOpened: !1,
|
|
3813
|
+
onReadyBeingFired: null,
|
|
3814
|
+
openComplete: !1,
|
|
3815
|
+
dbReadyResolve: k,
|
|
3816
|
+
dbReadyPromise: null,
|
|
3817
|
+
cancelOpen: k,
|
|
3818
|
+
openCanceller: null,
|
|
3819
|
+
autoSchema: !0,
|
|
3820
|
+
PR1398_maxLoop: 3,
|
|
3821
|
+
autoOpen: r.autoOpen
|
|
3822
|
+
};
|
|
3823
|
+
s.dbReadyPromise = new F(function(e) {
|
|
3824
|
+
s.dbReadyResolve = e;
|
|
3825
|
+
}), s.openCanceller = new F(function(e, t) {
|
|
3826
|
+
s.cancelOpen = t;
|
|
3827
|
+
}), this._state = s, this.name = t, this.on = Gt(this, "populate", "blocked", "versionchange", "close", { ready: [Ne, k] }), this.once = function(e, t) {
|
|
3828
|
+
var n = function() {
|
|
3829
|
+
var r = [...arguments];
|
|
3830
|
+
i.on(e).unsubscribe(n), t.apply(i, r);
|
|
3831
|
+
};
|
|
3832
|
+
return i.on(e, n);
|
|
3833
|
+
}, this.on.ready.subscribe = y(this.on.ready.subscribe, function(t) {
|
|
3834
|
+
return function(n, r) {
|
|
3835
|
+
e.vip(function() {
|
|
3836
|
+
var e = i._state;
|
|
3837
|
+
if (e.openComplete) e.dbOpenError || F.resolve().then(n), r && t(n);
|
|
3838
|
+
else if (e.onReadyBeingFired) e.onReadyBeingFired.push(n), r && t(n);
|
|
3839
|
+
else {
|
|
3840
|
+
t(n);
|
|
3841
|
+
var a = i;
|
|
3842
|
+
r || t(function e() {
|
|
3843
|
+
a.on.ready.unsubscribe(n), a.on.ready.unsubscribe(e);
|
|
3844
|
+
});
|
|
3845
|
+
}
|
|
3846
|
+
});
|
|
3847
|
+
};
|
|
3848
|
+
}), this.Collection = an(this), this.Table = qt(this), this.Transaction = bn(this), this.Version = $n(this), this.WhereClause = hn(this), this.on("versionchange", function(e) {
|
|
3849
|
+
e.newVersion > 0 ? console.warn(`Another connection wants to upgrade database '${i.name}'. Closing db now to resume the upgrade.`) : console.warn(`Another connection wants to delete database '${i.name}'. Closing db now to resume the delete request.`), i.close({ disableAutoOpen: !1 });
|
|
3850
|
+
}), this.on("blocked", function(e) {
|
|
3851
|
+
!e.newVersion || e.newVersion < e.oldVersion ? console.warn(`Dexie.delete('${i.name}') was blocked`) : console.warn(`Upgrade '${i.name}' blocked by other connection holding version ${e.oldVersion / 10}`);
|
|
3852
|
+
}), this._maxKey = Tn(r.IDBKeyRange), this._createTransaction = function(e, t, n, r) {
|
|
3853
|
+
return new i.Transaction(e, t, n, i._options.chromeTransactionDurability, r);
|
|
3854
|
+
}, this._fireOnBlocked = function(e) {
|
|
3855
|
+
i.on("blocked").fire(e), er.toArray().filter(function(e) {
|
|
3856
|
+
return e.name === i.name && e !== i && !e._state.vcFired;
|
|
3857
|
+
}).map(function(t) {
|
|
3858
|
+
return t.on("versionchange").fire(e);
|
|
3859
|
+
});
|
|
3860
|
+
}, this.use(Lr), this.use(ei), this.use(Br), this.use(jr), this.use(Pr);
|
|
3861
|
+
var c = new Proxy(this, { get: function(e, t, n) {
|
|
3862
|
+
if (t === "_vip") return !0;
|
|
3863
|
+
if (t === "table") return function(e) {
|
|
3864
|
+
return ti(i.table(e), c);
|
|
3865
|
+
};
|
|
3866
|
+
var r = Reflect.get(e, t, n);
|
|
3867
|
+
return r instanceof Wt ? ti(r, c) : t === "tables" ? r.map(function(e) {
|
|
3868
|
+
return ti(e, c);
|
|
3869
|
+
}) : t === "_createTransaction" ? function() {
|
|
3870
|
+
return ti(r.apply(this, arguments), c);
|
|
3871
|
+
} : r;
|
|
3872
|
+
} });
|
|
3873
|
+
this.vip = c, o.forEach(function(e) {
|
|
3874
|
+
return e(i);
|
|
3875
|
+
});
|
|
3876
|
+
}
|
|
3877
|
+
return e.prototype.version = function(e) {
|
|
3878
|
+
if (isNaN(e) || e < .1) throw new O.Type("Given version is not a positive number");
|
|
3879
|
+
if (e = Math.round(e * 10) / 10, this.idbdb || this._state.isBeingOpened) throw new O.Schema("Cannot add version when database is open");
|
|
3880
|
+
this.verno = Math.max(this.verno, e);
|
|
3881
|
+
var t = this._versions, n = t.filter(function(t) {
|
|
3882
|
+
return t._cfg.version === e;
|
|
3883
|
+
})[0];
|
|
3884
|
+
return n || (n = new this.Version(e), t.push(n), t.sort(Ln), n.stores({}), this._state.autoSchema = !1, n);
|
|
3885
|
+
}, e.prototype._whenReady = function(e) {
|
|
3886
|
+
var t = this;
|
|
3887
|
+
return this.idbdb && (this._state.openComplete || N.letThrough || this._vip) ? e() : new F(function(e, n) {
|
|
3888
|
+
if (t._state.openComplete) return n(new O.DatabaseClosed(t._state.dbOpenError));
|
|
3889
|
+
if (!t._state.isBeingOpened) {
|
|
3890
|
+
if (!t._state.autoOpen) {
|
|
3891
|
+
n(new O.DatabaseClosed());
|
|
3892
|
+
return;
|
|
3893
|
+
}
|
|
3894
|
+
t.open().catch(k);
|
|
3895
|
+
}
|
|
3896
|
+
t._state.dbReadyPromise.then(e, n);
|
|
3897
|
+
}).then(e);
|
|
3898
|
+
}, e.prototype.use = function(e) {
|
|
3899
|
+
var t = e.stack, n = e.create, r = e.level, i = e.name;
|
|
3900
|
+
i && this.unuse({
|
|
3901
|
+
stack: t,
|
|
3902
|
+
name: i
|
|
3903
|
+
});
|
|
3904
|
+
var a = this._middlewares[t] || (this._middlewares[t] = []);
|
|
3905
|
+
return a.push({
|
|
3906
|
+
stack: t,
|
|
3907
|
+
create: n,
|
|
3908
|
+
level: r ?? 10,
|
|
3909
|
+
name: i
|
|
3910
|
+
}), a.sort(function(e, t) {
|
|
3911
|
+
return e.level - t.level;
|
|
3912
|
+
}), this;
|
|
3913
|
+
}, e.prototype.unuse = function(e) {
|
|
3914
|
+
var t = e.stack, n = e.name, r = e.create;
|
|
3915
|
+
return t && this._middlewares[t] && (this._middlewares[t] = this._middlewares[t].filter(function(e) {
|
|
3916
|
+
return r ? e.create !== r : n ? e.name !== n : !1;
|
|
3917
|
+
})), this;
|
|
3918
|
+
}, e.prototype.open = function() {
|
|
3919
|
+
var e = this;
|
|
3920
|
+
return V(M, function() {
|
|
3921
|
+
return Tr(e);
|
|
3922
|
+
});
|
|
3923
|
+
}, e.prototype._close = function() {
|
|
3924
|
+
this.on.close.fire(new CustomEvent("close"));
|
|
3925
|
+
var e = this._state;
|
|
3926
|
+
if (er.remove(this), this.idbdb) {
|
|
3927
|
+
try {
|
|
3928
|
+
this.idbdb.close();
|
|
3929
|
+
} catch {}
|
|
3930
|
+
this.idbdb = null;
|
|
3931
|
+
}
|
|
3932
|
+
e.isBeingOpened || (e.dbReadyPromise = new F(function(t) {
|
|
3933
|
+
e.dbReadyResolve = t;
|
|
3934
|
+
}), e.openCanceller = new F(function(t, n) {
|
|
3935
|
+
e.cancelOpen = n;
|
|
3936
|
+
}));
|
|
3937
|
+
}, e.prototype.close = function(e) {
|
|
3938
|
+
var t = (e === void 0 ? { disableAutoOpen: !0 } : e).disableAutoOpen, n = this._state;
|
|
3939
|
+
t ? (n.isBeingOpened && n.cancelOpen(new O.DatabaseClosed()), this._close(), n.autoOpen = !1, n.dbOpenError = new O.DatabaseClosed()) : (this._close(), n.autoOpen = this._options.autoOpen || n.isBeingOpened, n.openComplete = !1, n.dbOpenError = null);
|
|
3940
|
+
}, e.prototype.delete = function(e) {
|
|
3941
|
+
var t = this;
|
|
3942
|
+
e === void 0 && (e = { disableAutoOpen: !0 });
|
|
3943
|
+
var n = arguments.length > 0 && typeof arguments[0] != "object", r = this._state;
|
|
3944
|
+
return new F(function(i, a) {
|
|
3945
|
+
var o = function() {
|
|
3946
|
+
t.close(e);
|
|
3947
|
+
var n = t._deps.indexedDB.deleteDatabase(t.name);
|
|
3948
|
+
n.onsuccess = I(function() {
|
|
3949
|
+
or(t._deps, t.name), i();
|
|
3950
|
+
}), n.onerror = Y(a), n.onblocked = t._fireOnBlocked;
|
|
3951
|
+
};
|
|
3952
|
+
if (n) throw new O.InvalidArgument("Invalid closeOptions argument to db.delete()");
|
|
3953
|
+
r.isBeingOpened ? r.dbReadyPromise.then(o) : o();
|
|
3954
|
+
});
|
|
3955
|
+
}, e.prototype.backendDB = function() {
|
|
3956
|
+
return this.idbdb;
|
|
3957
|
+
}, e.prototype.isOpen = function() {
|
|
3958
|
+
return this.idbdb !== null;
|
|
3959
|
+
}, e.prototype.hasBeenClosed = function() {
|
|
3960
|
+
var e = this._state.dbOpenError;
|
|
3961
|
+
return e && e.name === "DatabaseClosedError";
|
|
3962
|
+
}, e.prototype.hasFailed = function() {
|
|
3963
|
+
return this._state.dbOpenError !== null;
|
|
3964
|
+
}, e.prototype.dynamicallyOpened = function() {
|
|
3965
|
+
return this._state.autoSchema;
|
|
3966
|
+
}, Object.defineProperty(e.prototype, "tables", {
|
|
3967
|
+
get: function() {
|
|
3968
|
+
var e = this;
|
|
3969
|
+
return a(this._allTables).map(function(t) {
|
|
3970
|
+
return e._allTables[t];
|
|
3971
|
+
});
|
|
3972
|
+
},
|
|
3973
|
+
enumerable: !1,
|
|
3974
|
+
configurable: !0
|
|
3975
|
+
}), e.prototype.transaction = function() {
|
|
3976
|
+
var e = Dr.apply(this, arguments);
|
|
3977
|
+
return this._transaction.apply(this, e);
|
|
3978
|
+
}, e.prototype._transaction = function(e, t, n) {
|
|
3979
|
+
var r = this, i = N.trans;
|
|
3980
|
+
i && i.db === this && e.indexOf("!") === -1 || (i = null);
|
|
3981
|
+
var a = e.indexOf("?") !== -1;
|
|
3982
|
+
e = e.replace("!", "").replace("?", "");
|
|
3983
|
+
var o, s;
|
|
3984
|
+
try {
|
|
3985
|
+
if (s = t.map(function(e) {
|
|
3986
|
+
var t = e instanceof r.Table ? e.name : e;
|
|
3987
|
+
if (typeof t != "string") throw TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");
|
|
3988
|
+
return t;
|
|
3989
|
+
}), e == "r" || e === Mt) o = Mt;
|
|
3990
|
+
else if (e == "rw" || e == Nt) o = Nt;
|
|
3991
|
+
else throw new O.InvalidArgument("Invalid transaction mode: " + e);
|
|
3992
|
+
if (i) {
|
|
3993
|
+
if (i.mode === Mt && o === Nt) {
|
|
3994
|
+
if (a) i = null;
|
|
3995
|
+
else throw new O.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");
|
|
3996
|
+
}
|
|
3997
|
+
i && s.forEach(function(e) {
|
|
3998
|
+
if (i && i.storeNames.indexOf(e) === -1) {
|
|
3999
|
+
if (a) i = null;
|
|
4000
|
+
else throw new O.SubTransaction("Table " + e + " not included in parent transaction.");
|
|
4001
|
+
}
|
|
4002
|
+
}), a && i && !i.active && (i = null);
|
|
4003
|
+
}
|
|
4004
|
+
} catch (e) {
|
|
4005
|
+
return i ? i._promise(null, function(t, n) {
|
|
4006
|
+
n(e);
|
|
4007
|
+
}) : H(e);
|
|
4008
|
+
}
|
|
4009
|
+
var c = Or.bind(null, this, o, s, i, n);
|
|
4010
|
+
return i ? i._promise(o, c, "lock") : N.trans ? V(N.transless, function() {
|
|
4011
|
+
return r._whenReady(c);
|
|
4012
|
+
}) : this._whenReady(c);
|
|
4013
|
+
}, e.prototype.table = function(e) {
|
|
4014
|
+
if (!u(this._allTables, e)) throw new O.InvalidTable(`Table ${e} does not exist`);
|
|
4015
|
+
return this._allTables[e];
|
|
4016
|
+
}, e;
|
|
4017
|
+
}(), ni = typeof Symbol < "u" && "observable" in Symbol ? Symbol.observable : "@@observable", ri = function() {
|
|
4018
|
+
function e(e) {
|
|
4019
|
+
this._subscribe = e;
|
|
4020
|
+
}
|
|
4021
|
+
return e.prototype.subscribe = function(e, t, n) {
|
|
4022
|
+
return this._subscribe(!e || typeof e == "function" ? {
|
|
4023
|
+
next: e,
|
|
4024
|
+
error: t,
|
|
4025
|
+
complete: n
|
|
4026
|
+
} : e);
|
|
4027
|
+
}, e.prototype[ni] = function() {
|
|
4028
|
+
return this;
|
|
4029
|
+
}, e;
|
|
4030
|
+
}(), ii;
|
|
4031
|
+
try {
|
|
4032
|
+
ii = {
|
|
4033
|
+
indexedDB: i.indexedDB || i.mozIndexedDB || i.webkitIndexedDB || i.msIndexedDB,
|
|
4034
|
+
IDBKeyRange: i.IDBKeyRange || i.webkitIDBKeyRange
|
|
4035
|
+
};
|
|
4036
|
+
} catch {
|
|
4037
|
+
ii = {
|
|
4038
|
+
indexedDB: null,
|
|
4039
|
+
IDBKeyRange: null
|
|
4040
|
+
};
|
|
4041
|
+
}
|
|
4042
|
+
function ai(e) {
|
|
4043
|
+
var t = !1, n, r = new ri(function(r) {
|
|
4044
|
+
var i = me(e);
|
|
4045
|
+
function a(t) {
|
|
4046
|
+
var n = st();
|
|
4047
|
+
try {
|
|
4048
|
+
i && yt();
|
|
4049
|
+
var r = R(e, t);
|
|
4050
|
+
return i && (r = r.finally(z)), r;
|
|
4051
|
+
} finally {
|
|
4052
|
+
n && ct();
|
|
4053
|
+
}
|
|
4054
|
+
}
|
|
4055
|
+
var o = !1, s, c = {}, l = {}, u = {
|
|
4056
|
+
get closed() {
|
|
4057
|
+
return o;
|
|
4058
|
+
},
|
|
4059
|
+
unsubscribe: function() {
|
|
4060
|
+
o || (o = !0, s && s.abort(), d && X.storagemutated.unsubscribe(m));
|
|
4061
|
+
}
|
|
4062
|
+
};
|
|
4063
|
+
r.start && r.start(u);
|
|
4064
|
+
var d = !1, f = function() {
|
|
4065
|
+
return Tt(h);
|
|
4066
|
+
};
|
|
4067
|
+
function p() {
|
|
4068
|
+
return vr(l, c);
|
|
4069
|
+
}
|
|
4070
|
+
var m = function(e) {
|
|
4071
|
+
_r(c, e), p() && f();
|
|
4072
|
+
}, h = function() {
|
|
4073
|
+
if (!o && ii.indexedDB) {
|
|
4074
|
+
c = {};
|
|
4075
|
+
var i = {};
|
|
4076
|
+
s && s.abort(), s = new AbortController();
|
|
4077
|
+
var u = {
|
|
4078
|
+
subscr: i,
|
|
4079
|
+
signal: s.signal,
|
|
4080
|
+
requery: f,
|
|
4081
|
+
querier: e,
|
|
4082
|
+
trans: null
|
|
4083
|
+
}, h = a(u);
|
|
4084
|
+
d ||= (X.storagemutated.subscribe(m), !0), Promise.resolve(h).then(function(e) {
|
|
4085
|
+
t = !0, n = e, o || u.signal.aborted || (p() ? f() : (l = i, p() ? f() : (c = {}, Tt(function() {
|
|
4086
|
+
return !o && r.next && r.next(e);
|
|
4087
|
+
}))));
|
|
4088
|
+
}, function(e) {
|
|
4089
|
+
o || u.signal.aborted || (t = !1, ["DatabaseClosedError", "AbortError"].includes(e?.name) || o || Tt(function() {
|
|
4090
|
+
o || r.error && r.error(e);
|
|
4091
|
+
}));
|
|
4092
|
+
});
|
|
4093
|
+
}
|
|
4094
|
+
};
|
|
4095
|
+
return setTimeout(f, 0), u;
|
|
4096
|
+
});
|
|
4097
|
+
return r.hasValue = function() {
|
|
4098
|
+
return t;
|
|
4099
|
+
}, r.getValue = function() {
|
|
4100
|
+
return n;
|
|
4101
|
+
}, r;
|
|
4102
|
+
}
|
|
4103
|
+
var oi = Q;
|
|
4104
|
+
d(oi, n(n({}, Ee), {
|
|
4105
|
+
delete: function(e) {
|
|
4106
|
+
return new oi(e, { addons: [] }).delete();
|
|
4107
|
+
},
|
|
4108
|
+
exists: function(e) {
|
|
4109
|
+
return new oi(e, { addons: [] }).open().then(function(e) {
|
|
4110
|
+
return e.close(), !0;
|
|
4111
|
+
}).catch("NoSuchDatabaseError", function() {
|
|
4112
|
+
return !1;
|
|
4113
|
+
});
|
|
4114
|
+
},
|
|
4115
|
+
getDatabaseNames: function(e) {
|
|
4116
|
+
try {
|
|
4117
|
+
return ir(oi.dependencies).then(e);
|
|
4118
|
+
} catch {
|
|
4119
|
+
return H(new O.MissingAPI());
|
|
4120
|
+
}
|
|
4121
|
+
},
|
|
4122
|
+
defineClass: function() {
|
|
4123
|
+
function e(e) {
|
|
4124
|
+
s(this, e);
|
|
4125
|
+
}
|
|
4126
|
+
return e;
|
|
4127
|
+
},
|
|
4128
|
+
ignoreTransaction: function(e) {
|
|
4129
|
+
return N.trans ? V(N.transless || M, e) : e();
|
|
4130
|
+
},
|
|
4131
|
+
vip: sr,
|
|
4132
|
+
async: function(e) {
|
|
4133
|
+
return function() {
|
|
4134
|
+
try {
|
|
4135
|
+
var t = Er(e.apply(this, arguments));
|
|
4136
|
+
return !t || typeof t.then != "function" ? F.resolve(t) : t;
|
|
4137
|
+
} catch (e) {
|
|
4138
|
+
return H(e);
|
|
4139
|
+
}
|
|
4140
|
+
};
|
|
4141
|
+
},
|
|
4142
|
+
spawn: function(e, t, n) {
|
|
4143
|
+
try {
|
|
4144
|
+
var r = Er(e.apply(n, t || []));
|
|
4145
|
+
return !r || typeof r.then != "function" ? F.resolve(r) : r;
|
|
4146
|
+
} catch (e) {
|
|
4147
|
+
return H(e);
|
|
4148
|
+
}
|
|
4149
|
+
},
|
|
4150
|
+
currentTransaction: { get: function() {
|
|
4151
|
+
return N.trans || null;
|
|
4152
|
+
} },
|
|
4153
|
+
waitFor: function(e, t) {
|
|
4154
|
+
var n = F.resolve(typeof e == "function" ? oi.ignoreTransaction(e) : e).timeout(t || 6e4);
|
|
4155
|
+
return N.trans ? N.trans.waitFor(n) : n;
|
|
4156
|
+
},
|
|
4157
|
+
Promise: F,
|
|
4158
|
+
debug: {
|
|
4159
|
+
get: function() {
|
|
4160
|
+
return j;
|
|
4161
|
+
},
|
|
4162
|
+
set: function(e) {
|
|
4163
|
+
Pe(e);
|
|
4164
|
+
}
|
|
4165
|
+
},
|
|
4166
|
+
derive: m,
|
|
4167
|
+
extend: s,
|
|
4168
|
+
props: d,
|
|
4169
|
+
override: y,
|
|
4170
|
+
Events: Gt,
|
|
4171
|
+
on: X,
|
|
4172
|
+
liveQuery: ai,
|
|
4173
|
+
extendObservabilitySet: _r,
|
|
4174
|
+
getByKeyPath: C,
|
|
4175
|
+
setByKeyPath: w,
|
|
4176
|
+
delByKeyPath: ee,
|
|
4177
|
+
shallowClone: te,
|
|
4178
|
+
deepClone: T,
|
|
4179
|
+
getObjectDiff: Mr,
|
|
4180
|
+
cmp: K,
|
|
4181
|
+
asap: x,
|
|
4182
|
+
minKey: Ot,
|
|
4183
|
+
addons: [],
|
|
4184
|
+
connections: { get: er.toArray },
|
|
4185
|
+
errnames: Ce,
|
|
4186
|
+
dependencies: ii,
|
|
4187
|
+
cache: yr,
|
|
4188
|
+
semVer: Dt,
|
|
4189
|
+
version: Dt.split(".").map(function(e) {
|
|
4190
|
+
return parseInt(e);
|
|
4191
|
+
}).reduce(function(e, t, n) {
|
|
4192
|
+
return e + t / 10 ** (n * 2);
|
|
4193
|
+
})
|
|
4194
|
+
})), oi.maxKey = Tn(oi.dependencies.IDBKeyRange), typeof dispatchEvent < "u" && typeof addEventListener < "u" && (X(_n, function(e) {
|
|
4195
|
+
if (!$) {
|
|
4196
|
+
var t = new CustomEvent(vn, { detail: e });
|
|
4197
|
+
$ = !0, dispatchEvent(t), $ = !1;
|
|
4198
|
+
}
|
|
4199
|
+
}), addEventListener(vn, function(e) {
|
|
4200
|
+
var t = e.detail;
|
|
4201
|
+
$ || si(t);
|
|
4202
|
+
}));
|
|
4203
|
+
function si(e) {
|
|
4204
|
+
var t = $;
|
|
4205
|
+
try {
|
|
4206
|
+
$ = !0, X.storagemutated.fire(e), Cr(e, !0);
|
|
4207
|
+
} finally {
|
|
4208
|
+
$ = t;
|
|
4209
|
+
}
|
|
4210
|
+
}
|
|
4211
|
+
var $ = !1, ci, li = function() {};
|
|
4212
|
+
typeof BroadcastChannel < "u" && (li = function() {
|
|
4213
|
+
ci = new BroadcastChannel(vn), ci.onmessage = function(e) {
|
|
4214
|
+
return e.data && si(e.data);
|
|
4215
|
+
};
|
|
4216
|
+
}, li(), typeof ci.unref == "function" && ci.unref(), X(_n, function(e) {
|
|
4217
|
+
$ || ci.postMessage(e);
|
|
4218
|
+
})), typeof addEventListener < "u" && (addEventListener("pagehide", function(e) {
|
|
4219
|
+
if (!Q.disableBfCache && e.persisted) {
|
|
4220
|
+
j && console.debug("Dexie: handling persisted pagehide"), ci?.close();
|
|
4221
|
+
for (var t = 0, n = er.toArray(); t < n.length; t++) n[t].close({ disableAutoOpen: !1 });
|
|
4222
|
+
}
|
|
4223
|
+
}), addEventListener("pageshow", function(e) {
|
|
4224
|
+
!Q.disableBfCache && e.persisted && (j && console.debug("Dexie: handling persisted pageshow"), li(), si({ all: new Z(-1e400, [[]]) }));
|
|
4225
|
+
}));
|
|
4226
|
+
function ui(e) {
|
|
4227
|
+
return new Ht({ add: e });
|
|
4228
|
+
}
|
|
4229
|
+
function di(e) {
|
|
4230
|
+
return new Ht({ remove: e });
|
|
4231
|
+
}
|
|
4232
|
+
function fi(e, t) {
|
|
4233
|
+
return new Ht({ replacePrefix: [e, t] });
|
|
4234
|
+
}
|
|
4235
|
+
return F.rejectionMapper = function(e, t) {
|
|
4236
|
+
if (!e || e instanceof ye || e instanceof TypeError || e instanceof SyntaxError || !e.name || !Te[e.name]) return e;
|
|
4237
|
+
var n = new Te[e.name](t || e.message, e);
|
|
4238
|
+
return "stack" in e && p(n, "stack", { get: function() {
|
|
4239
|
+
return this.inner.stack;
|
|
4240
|
+
} }), n;
|
|
4241
|
+
}, Pe(j), n(Q, /* @__PURE__ */ Object.freeze({
|
|
4242
|
+
__proto__: null,
|
|
4243
|
+
DEFAULT_MAX_CONNECTIONS: At,
|
|
4244
|
+
Dexie: Q,
|
|
4245
|
+
Entity: It,
|
|
4246
|
+
PropModification: Ht,
|
|
4247
|
+
RangeSet: Z,
|
|
4248
|
+
add: ui,
|
|
4249
|
+
cmp: K,
|
|
4250
|
+
default: Q,
|
|
4251
|
+
liveQuery: ai,
|
|
4252
|
+
mergeRanges: fr,
|
|
4253
|
+
rangesOverlap: pr,
|
|
4254
|
+
remove: di,
|
|
4255
|
+
replacePrefix: fi
|
|
4256
|
+
}), { default: Q }), Q;
|
|
4257
|
+
}));
|
|
4258
|
+
})))(), 1), i = Symbol.for("Dexie"), a = globalThis[i] || (globalThis[i] = r.default);
|
|
4259
|
+
if (r.default.semVer !== a.semVer) throw Error(`Two different versions of Dexie loaded in the same app: ${r.default.semVer} and ${a.semVer}`);
|
|
4260
|
+
var { liveQuery: o, mergeRanges: s, rangesOverlap: c, RangeSet: l, cmp: u, Entity: d, PropModification: f, replacePrefix: p, add: m, remove: h, DexieYProvider: g } = a, _ = class extends a {
|
|
4261
|
+
documents;
|
|
4262
|
+
folders;
|
|
4263
|
+
drafts;
|
|
4264
|
+
mutationQueue;
|
|
4265
|
+
metadata;
|
|
4266
|
+
constructor(e) {
|
|
4267
|
+
super(n(e)), this.version(1).stores({
|
|
4268
|
+
documents: "id, ownerId, tenantId, folderId, updatedAt",
|
|
4269
|
+
folders: "id, ownerId, tenantId, parentId, name",
|
|
4270
|
+
drafts: "docId, ownerId, tenantId, updatedAt",
|
|
4271
|
+
mutationQueue: "++id, docId, op, status",
|
|
4272
|
+
metadata: "key"
|
|
4273
|
+
}), this.version(2).stores({
|
|
4274
|
+
documents: "id, ownerId, tenantId, folderId, updatedAt",
|
|
4275
|
+
folders: "id, ownerId, tenantId, parentId, name",
|
|
4276
|
+
drafts: "docId, ownerId, tenantId, updatedAt",
|
|
4277
|
+
mutationQueue: "++id, docId, op, status, createdAt",
|
|
4278
|
+
metadata: "key"
|
|
4279
|
+
}), this.version(3).stores({
|
|
4280
|
+
documents: "id, ownerId, tenantId, folderId, updatedAt",
|
|
4281
|
+
folders: "id, ownerId, tenantId, parentId, name",
|
|
4282
|
+
drafts: "docId, ownerId, tenantId, updatedAt",
|
|
4283
|
+
mutationQueue: null,
|
|
4284
|
+
metadata: "key"
|
|
4285
|
+
});
|
|
4286
|
+
}
|
|
4287
|
+
}, v = /* @__PURE__ */ new Map();
|
|
4288
|
+
function y(e) {
|
|
4289
|
+
let t = n(e), r = v.get(t);
|
|
4290
|
+
return r || (r = new _(e), v.set(t, r)), r;
|
|
4291
|
+
}
|
|
4292
|
+
async function b(e) {
|
|
4293
|
+
let t = n(e), r = v.get(t);
|
|
4294
|
+
r ? (await r.delete(), v.delete(t)) : await a.delete(t);
|
|
4295
|
+
}
|
|
4296
|
+
export { y as n, b as t };
|