@protobase/ui 0.115.1 → 0.117.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account/messages.d.ts +2 -2
- package/dist/app/app.js +84 -50
- package/dist/app/bottom-bar-from-meta.d.ts +8 -2
- package/dist/app/bottom-bar-from-meta.js +23 -11
- package/dist/app/charts/messages.d.ts +2 -2
- package/dist/app/confirm-sign-in-messages.d.ts +2 -2
- package/dist/app/conversation/thread-state.d.ts +1 -1
- package/dist/app/create/messages.d.ts +2 -2
- package/dist/app/delete/messages.d.ts +2 -2
- package/dist/app/displays/messages.d.ts +2 -2
- package/dist/app/embedded-list/messages.d.ts +2 -2
- package/dist/app/export/export-dialog.js +1 -1
- package/dist/app/export/messages.d.ts +2 -2
- package/dist/app/field-types/workflow/definition.d.ts +1 -1
- package/dist/app/field-types/workflow/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-page/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-run/messages.d.ts +2 -2
- package/dist/app/field-types/workflow-status/messages.d.ts +2 -2
- package/dist/app/file-viewers/messages.d.ts +2 -2
- package/dist/app/gallery/lightbox.js +1 -1
- package/dist/app/gallery/messages.d.ts +2 -2
- package/dist/app/hand-order/messages.d.ts +2 -2
- package/dist/app/history/messages.d.ts +2 -2
- package/dist/app/import/import-dialog.js +1 -1
- package/dist/app/import/messages.d.ts +2 -2
- package/dist/app/import/new-table/import-table-dialog.js +1 -1
- package/dist/app/list-messages.d.ts +2 -2
- package/dist/app/list-page.js +1 -1
- package/dist/app/messages.d.ts +2 -2
- package/dist/app/pages/action-inputs/action-inputs-dialog.js +1 -1
- package/dist/app/pages/messages.d.ts +2 -2
- package/dist/app/pages/record-actions.js +1 -1
- package/dist/app/record-chart/messages.d.ts +2 -2
- package/dist/app/record-messages.d.ts +2 -2
- package/dist/app/record-row/messages.d.ts +2 -2
- package/dist/app/refresh-mark.js +46 -10
- package/dist/app/related-cards/messages.d.ts +2 -2
- package/dist/app/runtime/messages.d.ts +2 -2
- package/dist/app/saved/messages.d.ts +2 -2
- package/dist/app/saved/use-favorite.d.ts +1 -1
- package/dist/app/searches/messages.d.ts +2 -2
- package/dist/app/searches/update-search-dialog.js +1 -1
- package/dist/app/searches/use-save-search.d.ts +1 -1
- package/dist/app-shell/account-entry.d.ts +17 -0
- package/dist/app-shell/account-entry.js +40 -0
- package/dist/app-shell/app-shell.d.ts +13 -1
- package/dist/app-shell/app-shell.js +80 -10
- package/dist/app-shell/back-target.d.ts +3 -2
- package/dist/app-shell/back-target.js +4 -3
- package/dist/app-shell/bottom-bar.d.ts +15 -3
- package/dist/app-shell/bottom-bar.js +70 -42
- package/dist/app-shell/brand-bar.d.ts +15 -0
- package/dist/app-shell/brand-bar.js +19 -0
- package/dist/app-shell/brand-status-bar.d.ts +8 -0
- package/dist/app-shell/brand-status-bar.js +27 -0
- package/dist/app-shell/breadcrumb.d.ts +4 -2
- package/dist/app-shell/breadcrumb.js +45 -37
- package/dist/app-shell/drawer.d.ts +2 -1
- package/dist/app-shell/drawer.js +22 -5
- package/dist/app-shell/global-search.d.ts +3 -1
- package/dist/app-shell/global-search.js +4 -4
- package/dist/app-shell/index.js +2 -2
- package/dist/app-shell/leading-slot.d.ts +9 -0
- package/dist/app-shell/leading-slot.js +10 -0
- package/dist/app-shell/logo.js +2 -1
- package/dist/app-shell/menu-page.d.ts +19 -0
- package/dist/app-shell/menu-page.js +29 -0
- package/dist/app-shell/messages.d.ts +2 -2
- package/dist/app-shell/more-page.d.ts +45 -0
- package/dist/app-shell/more-page.js +30 -0
- package/dist/app-shell/native-tab-bar.d.ts +47 -0
- package/dist/app-shell/native-tab-bar.js +45 -0
- package/dist/app-shell/page-scroll.d.ts +3 -2
- package/dist/app-shell/page-scroll.js +5 -3
- package/dist/app-shell/profile-menu.d.ts +5 -1
- package/dist/app-shell/profile-menu.js +138 -117
- package/dist/app-shell/sidebar.d.ts +12 -1
- package/dist/app-shell/sidebar.js +20 -10
- package/dist/app-shell/tab-icon.d.ts +7 -0
- package/dist/app-shell/tab-icon.js +38 -0
- package/dist/app-shell/top-bar.d.ts +19 -3
- package/dist/app-shell/top-bar.js +104 -60
- package/dist/app-shell/use-native-bottom-bar.d.ts +16 -0
- package/dist/app-shell/use-native-bottom-bar.js +62 -0
- package/dist/assistant-dock/messages.d.ts +2 -2
- package/dist/auth/messages.d.ts +2 -2
- package/dist/calls/call-guests-panel.js +2 -2
- package/dist/calls/messages.d.ts +2 -2
- package/dist/carousel/messages.d.ts +2 -2
- package/dist/chat/messages.d.ts +2 -2
- package/dist/data-grid/column-spec.d.ts +1 -1
- package/dist/data-grid/header-menu.js +33 -28
- package/dist/data-grid/messages.d.ts +2 -2
- package/dist/data-grid/row-menu.js +38 -33
- package/dist/filter-panel/messages.d.ts +2 -2
- package/dist/focus-page/bar-actions.js +1 -1
- package/dist/forms/messages.d.ts +2 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +5 -4
- package/dist/inline-child-table/messages.d.ts +2 -2
- package/dist/invitations/messages.d.ts +2 -2
- package/dist/locale/en.js +7 -0
- package/dist/locale/en.json.d.ts +7 -0
- package/dist/locale/messages.d.ts +14 -0
- package/dist/locale/nl.js +7 -0
- package/dist/mocks/orders.d.ts +1 -1
- package/dist/notifications/bell/messages.d.ts +2 -2
- package/dist/notifications/bell/notification-bell.js +40 -35
- package/dist/organizations/messages.d.ts +2 -2
- package/dist/package.js +1 -1
- package/dist/primitives/avatar.d.ts +1 -1
- package/dist/primitives/avatar.js +2 -1
- package/dist/primitives/drawer-math.d.ts +39 -0
- package/dist/primitives/drawer-math.js +43 -0
- package/dist/primitives/menu-select.js +51 -44
- package/dist/primitives/menu-surface.d.ts +22 -0
- package/dist/primitives/menu-surface.js +29 -0
- package/dist/primitives/popover-menu.js +1 -0
- package/dist/primitives/sheet-drag.d.ts +5 -5
- package/dist/primitives/sheet-drag.js +10 -16
- package/dist/primitives/sheet.d.ts +5 -2
- package/dist/primitives/sheet.js +9 -6
- package/dist/primitives/use-drawer-drag.d.ts +34 -0
- package/dist/primitives/use-drawer-drag.js +103 -0
- package/dist/primitives/use-sheet-drag.d.ts +2 -2
- package/dist/primitives/use-sheet-drag.js +10 -9
- package/dist/record-view/action-menu.js +45 -40
- package/dist/shell/assets/{account-page-ZqwlW9hk.js → account-page-dcJyxP-d.js} +2 -2
- package/dist/shell/assets/app-BAQxWF5r.css +2 -0
- package/dist/shell/assets/app-DTl8rg8j.js +34 -0
- package/dist/shell/assets/{assistant-shell-B7BpQefx.js → assistant-shell-Bw1jJrLm.js} +2 -2
- package/dist/shell/assets/board-display-DDFDZzOk.js +2 -0
- package/dist/shell/assets/{calendar-display-BCHxv33y.js → calendar-display-B0R6JkIL.js} +2 -2
- package/dist/shell/assets/call-rings-CzvSKlfI.js +2 -0
- package/dist/shell/assets/{calls-BgQWuG_K.js → calls-BgwbMyeR.js} +2 -2
- package/dist/shell/assets/{circle-alert-GOsvVcfy.js → circle-alert-CANqQIsU.js} +2 -2
- package/dist/shell/assets/composed-page-gwTeW0b3.js +2 -0
- package/dist/shell/assets/{composer-section-f4ZiGN6b.js → composer-section-gsOgYgY2.js} +2 -2
- package/dist/shell/assets/{connect-route-DBl0vKRP.js → connect-route-CtL1EJIN.js} +2 -2
- package/dist/shell/assets/{copy-field-DyW5ue6m.js → copy-field-CamvXHHQ.js} +2 -2
- package/dist/shell/assets/create-route-Cx8yqS-H.js +2 -0
- package/dist/shell/assets/{custom-step-container-field-51YbUUBp.js → custom-step-container-field-0-Q_RuZy.js} +4 -4
- package/dist/shell/assets/embedded-list-56J4XDiR.js +3 -0
- package/dist/shell/assets/en-CtEQkQWj.js +2 -0
- package/dist/shell/assets/{export-dialog-Da8MFuqi.js → export-dialog-CEp2g6vx.js} +2 -2
- package/dist/shell/assets/export-worker-DlWkifnE.js +15 -0
- package/dist/shell/assets/{graph-view-d6QFVrkz.js → graph-view-CgjfBK_g.js} +2 -2
- package/dist/shell/assets/{group-donut-yTquvFkE.js → group-donut-DGZUg_gn.js} +2 -2
- package/dist/shell/assets/{guest-call-page-CZRLRnx2.js → guest-call-page-BhTshbrl.js} +3 -3
- package/dist/shell/assets/{html-viewer-DBmUOsJ3.js → html-viewer-GD1mwLEo.js} +2 -2
- package/dist/shell/assets/{import-dialog-ggSlUxm7.js → import-dialog-ByRCf2Cp.js} +2 -2
- package/dist/shell/assets/import-table-dialog-CiDY_0RT.js +2 -0
- package/dist/shell/assets/{index-BAGIbxUE.js → index-PtDa8a1m.js} +1 -1
- package/dist/shell/assets/invitations-page-Bh-RCnnl.js +2 -0
- package/dist/shell/assets/{layout-grid-Dn4qEC5I.js → layout-grid-DJrFC12w.js} +2 -2
- package/dist/shell/assets/{legend-item-CjJUgSsw.js → legend-item-YdN_NHUz.js} +2 -2
- package/dist/shell/assets/{lib-vis.gl-react-maplibre-CdxVSk--.js → lib-vis.gl-react-maplibre-1cv426UN.js} +2 -2
- package/dist/shell/assets/list-page-BU1MrXbN.js +4 -0
- package/dist/shell/assets/maplibre-BedvDUG2.js +2 -0
- package/dist/shell/assets/{markdown-content-DX4_Buag.js → markdown-content-BlKajH2l.js} +2 -2
- package/dist/shell/assets/members-page-BYUO0Dq2.js +2 -0
- package/dist/shell/assets/{messages-Ct70wtYc.js → messages-DQ0cj-Ao.js} +2 -2
- package/dist/shell/assets/nl-9OWL4NdF.js +2 -0
- package/dist/shell/assets/organization-page-BrC1nHC-.js +2 -0
- package/dist/shell/assets/organizations-page-CaUeWdr4.js +2 -0
- package/dist/shell/assets/parse-worker-NutG5-Js.js +35 -0
- package/dist/shell/assets/{pending-invitation-row-BO7g_HOR.js → pending-invitation-row-juUdWvG6.js} +2 -2
- package/dist/shell/assets/{period-chart-DuwFRt6t.js → period-chart-BUZhUb5l.js} +2 -2
- package/dist/shell/assets/{person-row-BEVXbR43.js → person-row-DH3JhMfz.js} +2 -2
- package/dist/shell/assets/public-form-page-d3TamPPE.js +2 -0
- package/dist/shell/assets/record-lines-NtlHP9Lz.js +2 -0
- package/dist/shell/assets/{record-map-ysuwoP8e.js → record-map-BDXoF9AS.js} +2 -2
- package/dist/shell/assets/{record-opens-DLhF2J0q.js → record-opens-C1KgR6ff.js} +2 -2
- package/dist/shell/assets/record-page-D88DdoET.js +3 -0
- package/dist/shell/assets/record-preview-BT9_Hdcn.js +2 -0
- package/dist/shell/assets/{records-map-D_rSUmg1.js → records-map-BjHcY5gU.js} +2 -2
- package/dist/shell/assets/render-node-v6KfRocH.js +3 -0
- package/dist/shell/assets/reorder-button-B3GeKMOJ.js +2 -0
- package/dist/shell/assets/{run-trace-view-ygx54CFl.js → run-trace-view-Ddc0SELh.js} +2 -2
- package/dist/shell/assets/{runner-install-field-CqATImuc.js → runner-install-field-CiD9Pw1j.js} +2 -2
- package/dist/shell/assets/{runtime-update-Db162XI2.js → runtime-update-CoXcnfxB.js} +2 -2
- package/dist/shell/assets/shared-protobase-ui-CwLnXvxx.js +1 -0
- package/dist/shell/assets/sheet-source-DbJu1SrV.js +3 -0
- package/dist/shell/assets/sign-in-policy-page-B40iAeJa.js +2 -0
- package/dist/shell/assets/start-block-queries-C_udrEM9.js +2 -0
- package/dist/shell/assets/step-catalog-7obnZV6X.js +2 -0
- package/dist/shell/assets/{step-panel-gkiXwLZN.js → step-panel-BM_xu6Yy.js} +2 -2
- package/dist/shell/assets/timeline-display-CdLfWAbQ.js +2 -0
- package/dist/shell/assets/{trash-DfUQvtnQ.js → trash-BHo3HvFy.js} +2 -2
- package/dist/shell/assets/{update-set-CXnC4u8b.js → update-set-DTikSoau.js} +2 -2
- package/dist/shell/assets/use-calendar-move-Bhha2yOp.js +2 -0
- package/dist/shell/assets/{use-display-rows-DgbmFYc7.js → use-display-rows-CS_0O_UE.js} +2 -2
- package/dist/shell/assets/{use-paged-search-DfHM-bt_.js → use-paged-search-ChxCRCpF.js} +2 -2
- package/dist/shell/assets/{use-run-trace-Boc0Dt3j.js → use-run-trace-BfRRgSgG.js} +2 -2
- package/dist/shell/assets/{use-workflow-page-BtLkA5E8.js → use-workflow-page-CTdBd8_8.js} +2 -2
- package/dist/shell/assets/{use-workflow-types-CeXlzawJ.js → use-workflow-types-cZQ59ATf.js} +2 -2
- package/dist/shell/assets/{vendor-DQHyyBk1.js → vendor-t7Q7QbPu.js} +2 -2
- package/dist/shell/assets/{workflow-canvas-Pq3WUUPt.js → workflow-canvas-B0kWJeH0.js} +4 -4
- package/dist/shell/assets/{workflow-field-ApOGZcSb.js → workflow-field-DXIk6V2Y.js} +3 -3
- package/dist/shell/assets/{workflow-graph-editor-s14bAl5F.js → workflow-graph-editor-Cem4aY2u.js} +2 -2
- package/dist/shell/assets/{workflow-run-field-CxEHxP9x.js → workflow-run-field-BeMn3eOH.js} +3 -3
- package/dist/shell/assets/workflow-status-field-0wvGDiva.js +2 -0
- package/dist/shell/assets/workflow-workbench-qT5c0xnH.js +4 -0
- package/dist/shell/index.html +5 -5
- package/dist/shell/protobase.shell.json +3 -3
- package/dist/shell/protobase.sw.js +2 -2
- package/dist/shell-source-maps/assets/{account-page-ZqwlW9hk.js.map → account-page-dcJyxP-d.js.map} +1 -1
- package/dist/shell-source-maps/assets/app-DTl8rg8j.js.map +1 -0
- package/dist/shell-source-maps/assets/{assistant-shell-B7BpQefx.js.map → assistant-shell-Bw1jJrLm.js.map} +1 -1
- package/dist/shell-source-maps/assets/{board-display-DkUlCdNw.js.map → board-display-DDFDZzOk.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calendar-display-BCHxv33y.js.map → calendar-display-B0R6JkIL.js.map} +1 -1
- package/dist/shell-source-maps/assets/{call-rings-DAUYubKB.js.map → call-rings-CzvSKlfI.js.map} +1 -1
- package/dist/shell-source-maps/assets/{calls-BgQWuG_K.js.map → calls-BgwbMyeR.js.map} +1 -1
- package/dist/shell-source-maps/assets/{circle-alert-GOsvVcfy.js.map → circle-alert-CANqQIsU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composed-page-BaecAyUt.js.map → composed-page-gwTeW0b3.js.map} +1 -1
- package/dist/shell-source-maps/assets/{composer-section-f4ZiGN6b.js.map → composer-section-gsOgYgY2.js.map} +1 -1
- package/dist/shell-source-maps/assets/{connect-route-DBl0vKRP.js.map → connect-route-CtL1EJIN.js.map} +1 -1
- package/dist/shell-source-maps/assets/{copy-field-DyW5ue6m.js.map → copy-field-CamvXHHQ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{create-route-C-2_HhMU.js.map → create-route-Cx8yqS-H.js.map} +1 -1
- package/dist/shell-source-maps/assets/{custom-step-container-field-51YbUUBp.js.map → custom-step-container-field-0-Q_RuZy.js.map} +1 -1
- package/dist/shell-source-maps/assets/embedded-list-56J4XDiR.js.map +1 -0
- package/dist/shell-source-maps/assets/en-CtEQkQWj.js.map +1 -0
- package/dist/shell-source-maps/assets/{export-dialog-Da8MFuqi.js.map → export-dialog-CEp2g6vx.js.map} +1 -1
- package/dist/shell-source-maps/assets/export-worker-DlWkifnE.js.map +1 -0
- package/dist/shell-source-maps/assets/{graph-view-d6QFVrkz.js.map → graph-view-CgjfBK_g.js.map} +1 -1
- package/dist/shell-source-maps/assets/{group-donut-yTquvFkE.js.map → group-donut-DGZUg_gn.js.map} +1 -1
- package/dist/shell-source-maps/assets/{guest-call-page-CZRLRnx2.js.map → guest-call-page-BhTshbrl.js.map} +1 -1
- package/dist/shell-source-maps/assets/{html-viewer-DBmUOsJ3.js.map → html-viewer-GD1mwLEo.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-dialog-ggSlUxm7.js.map → import-dialog-ByRCf2Cp.js.map} +1 -1
- package/dist/shell-source-maps/assets/{import-table-dialog-B_LVBAyn.js.map → import-table-dialog-CiDY_0RT.js.map} +1 -1
- package/dist/shell-source-maps/assets/{invitations-page-CdI3jnMc.js.map → invitations-page-Bh-RCnnl.js.map} +1 -1
- package/dist/shell-source-maps/assets/{layout-grid-Dn4qEC5I.js.map → layout-grid-DJrFC12w.js.map} +1 -1
- package/dist/shell-source-maps/assets/{legend-item-CjJUgSsw.js.map → legend-item-YdN_NHUz.js.map} +1 -1
- package/dist/shell-source-maps/assets/{lib-vis.gl-react-maplibre-CdxVSk--.js.map → lib-vis.gl-react-maplibre-1cv426UN.js.map} +1 -1
- package/dist/shell-source-maps/assets/{list-page-DjCEQgcK.js.map → list-page-BU1MrXbN.js.map} +1 -1
- package/dist/shell-source-maps/assets/{maplibre-CaDAFMUv.js.map → maplibre-BedvDUG2.js.map} +1 -1
- package/dist/shell-source-maps/assets/{markdown-content-DX4_Buag.js.map → markdown-content-BlKajH2l.js.map} +1 -1
- package/dist/shell-source-maps/assets/{members-page-DbhRf_Ir.js.map → members-page-BYUO0Dq2.js.map} +1 -1
- package/dist/shell-source-maps/assets/{messages-Ct70wtYc.js.map → messages-DQ0cj-Ao.js.map} +1 -1
- package/dist/shell-source-maps/assets/nl-9OWL4NdF.js.map +1 -0
- package/dist/shell-source-maps/assets/{organization-page-BzqYb0dI.js.map → organization-page-BrC1nHC-.js.map} +1 -1
- package/dist/shell-source-maps/assets/{organizations-page-Pkf_qkKQ.js.map → organizations-page-CaUeWdr4.js.map} +1 -1
- package/dist/shell-source-maps/assets/parse-worker-NutG5-Js.js.map +1 -0
- package/dist/shell-source-maps/assets/{pending-invitation-row-BO7g_HOR.js.map → pending-invitation-row-juUdWvG6.js.map} +1 -1
- package/dist/shell-source-maps/assets/{period-chart-DuwFRt6t.js.map → period-chart-BUZhUb5l.js.map} +1 -1
- package/dist/shell-source-maps/assets/{person-row-BEVXbR43.js.map → person-row-DH3JhMfz.js.map} +1 -1
- package/dist/shell-source-maps/assets/{public-form-page-BB1S8Xz-.js.map → public-form-page-d3TamPPE.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-lines-DH2WXKw7.js.map → record-lines-NtlHP9Lz.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-map-ysuwoP8e.js.map → record-map-BDXoF9AS.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-opens-DLhF2J0q.js.map → record-opens-C1KgR6ff.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-page-BVYzIF9Z.js.map → record-page-D88DdoET.js.map} +1 -1
- package/dist/shell-source-maps/assets/{record-preview-DWMs-hhQ.js.map → record-preview-BT9_Hdcn.js.map} +1 -1
- package/dist/shell-source-maps/assets/{records-map-D_rSUmg1.js.map → records-map-BjHcY5gU.js.map} +1 -1
- package/dist/shell-source-maps/assets/{render-node-BAePC3l_.js.map → render-node-v6KfRocH.js.map} +1 -1
- package/dist/shell-source-maps/assets/{reorder-button-C3r76tJu.js.map → reorder-button-B3GeKMOJ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{run-trace-view-ygx54CFl.js.map → run-trace-view-Ddc0SELh.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runner-install-field-CqATImuc.js.map → runner-install-field-CiD9Pw1j.js.map} +1 -1
- package/dist/shell-source-maps/assets/{runtime-update-Db162XI2.js.map → runtime-update-CoXcnfxB.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sheet-source-Dm00KLZc.js.map → sheet-source-DbJu1SrV.js.map} +1 -1
- package/dist/shell-source-maps/assets/{sign-in-policy-page-C2uInopq.js.map → sign-in-policy-page-B40iAeJa.js.map} +1 -1
- package/dist/shell-source-maps/assets/{start-block-queries-jNww7Vs5.js.map → start-block-queries-C_udrEM9.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-catalog-Dv2NgEcj.js.map → step-catalog-7obnZV6X.js.map} +1 -1
- package/dist/shell-source-maps/assets/{step-panel-gkiXwLZN.js.map → step-panel-BM_xu6Yy.js.map} +1 -1
- package/dist/shell-source-maps/assets/{timeline-display-DRsyatGd.js.map → timeline-display-CdLfWAbQ.js.map} +1 -1
- package/dist/shell-source-maps/assets/{trash-DfUQvtnQ.js.map → trash-BHo3HvFy.js.map} +1 -1
- package/dist/shell-source-maps/assets/{update-set-CXnC4u8b.js.map → update-set-DTikSoau.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-calendar-move-BEV_Fhxn.js.map → use-calendar-move-Bhha2yOp.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-display-rows-DgbmFYc7.js.map → use-display-rows-CS_0O_UE.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-paged-search-DfHM-bt_.js.map → use-paged-search-ChxCRCpF.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-run-trace-Boc0Dt3j.js.map → use-run-trace-BfRRgSgG.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-page-BtLkA5E8.js.map → use-workflow-page-CTdBd8_8.js.map} +1 -1
- package/dist/shell-source-maps/assets/{use-workflow-types-CeXlzawJ.js.map → use-workflow-types-cZQ59ATf.js.map} +1 -1
- package/dist/shell-source-maps/assets/{vendor-DQHyyBk1.js.map → vendor-t7Q7QbPu.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-canvas-Pq3WUUPt.js.map → workflow-canvas-B0kWJeH0.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-field-ApOGZcSb.js.map → workflow-field-DXIk6V2Y.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-graph-editor-s14bAl5F.js.map → workflow-graph-editor-Cem4aY2u.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-run-field-CxEHxP9x.js.map → workflow-run-field-BeMn3eOH.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-status-field-DXe1sQIj.js.map → workflow-status-field-0wvGDiva.js.map} +1 -1
- package/dist/shell-source-maps/assets/{workflow-workbench-PmFBx_IG.js.map → workflow-workbench-qT5c0xnH.js.map} +1 -1
- package/dist/status/messages.d.ts +2 -2
- package/dist/status/status-dialog.js +1 -1
- package/dist/theme.css +6 -0
- package/dist/tokens.css +10 -10
- package/dist/users/messages.d.ts +2 -2
- package/package.json +5 -5
- package/dist/shell/assets/app-B62bQR9g.js +0 -34
- package/dist/shell/assets/app-BdzxOK1l.css +0 -2
- package/dist/shell/assets/board-display-DkUlCdNw.js +0 -2
- package/dist/shell/assets/call-rings-DAUYubKB.js +0 -2
- package/dist/shell/assets/composed-page-BaecAyUt.js +0 -2
- package/dist/shell/assets/create-route-C-2_HhMU.js +0 -2
- package/dist/shell/assets/embedded-list-BBrpHnq2.js +0 -3
- package/dist/shell/assets/en-B0Sx6LpA.js +0 -2
- package/dist/shell/assets/export-worker-DnXy8F95.js +0 -15
- package/dist/shell/assets/import-table-dialog-B_LVBAyn.js +0 -2
- package/dist/shell/assets/invitations-page-CdI3jnMc.js +0 -2
- package/dist/shell/assets/list-page-DjCEQgcK.js +0 -4
- package/dist/shell/assets/maplibre-CaDAFMUv.js +0 -2
- package/dist/shell/assets/members-page-DbhRf_Ir.js +0 -2
- package/dist/shell/assets/nl-DD4sTnQJ.js +0 -2
- package/dist/shell/assets/organization-page-BzqYb0dI.js +0 -2
- package/dist/shell/assets/organizations-page-Pkf_qkKQ.js +0 -2
- package/dist/shell/assets/parse-worker-BYXW4dAv.js +0 -35
- package/dist/shell/assets/public-form-page-BB1S8Xz-.js +0 -2
- package/dist/shell/assets/record-lines-DH2WXKw7.js +0 -2
- package/dist/shell/assets/record-page-BVYzIF9Z.js +0 -3
- package/dist/shell/assets/record-preview-DWMs-hhQ.js +0 -2
- package/dist/shell/assets/render-node-BAePC3l_.js +0 -3
- package/dist/shell/assets/reorder-button-C3r76tJu.js +0 -2
- package/dist/shell/assets/shared-protobase-ui-BSmHN3g_.js +0 -1
- package/dist/shell/assets/sheet-source-Dm00KLZc.js +0 -3
- package/dist/shell/assets/sign-in-policy-page-C2uInopq.js +0 -2
- package/dist/shell/assets/start-block-queries-jNww7Vs5.js +0 -2
- package/dist/shell/assets/step-catalog-Dv2NgEcj.js +0 -2
- package/dist/shell/assets/timeline-display-DRsyatGd.js +0 -2
- package/dist/shell/assets/use-calendar-move-BEV_Fhxn.js +0 -2
- package/dist/shell/assets/workflow-status-field-DXe1sQIj.js +0 -2
- package/dist/shell/assets/workflow-workbench-PmFBx_IG.js +0 -4
- package/dist/shell-source-maps/assets/app-B62bQR9g.js.map +0 -1
- package/dist/shell-source-maps/assets/embedded-list-BBrpHnq2.js.map +0 -1
- package/dist/shell-source-maps/assets/en-B0Sx6LpA.js.map +0 -1
- package/dist/shell-source-maps/assets/export-worker-DnXy8F95.js.map +0 -1
- package/dist/shell-source-maps/assets/nl-DD4sTnQJ.js.map +0 -1
- package/dist/shell-source-maps/assets/parse-worker-BYXW4dAv.js.map +0 -1
|
@@ -11,5 +11,5 @@
|
|
|
11
11
|
Try polyfilling it using "@formatjs/intl-pluralrules"
|
|
12
12
|
`,`MISSING_INTL_API`,o);let e=typeof l==`bigint`?Number(l):l,r=n.getPluralRules(t,{type:c.pluralType}).select(e-(c.offset||0));a=(Object.prototype.hasOwnProperty.call(c.options,r)?c.options[r]:void 0)||c.options.other}if(!a)throw new Yr(c.value,l,Object.keys(c.options),o);let u=typeof l==`bigint`?Number(l):l;s.push(...ei(a.value,t,n,r,i,u-(c.offset||0)));continue}}return Qr(s)}function ti(e,t){return t?{...e,...t,...Object.keys(e).reduce((n,r)=>(n[r]={...e[r],...t[r]},n),{})}:e}function ni(e,t){return t?Object.keys(e).reduce((n,r)=>(n[r]=ti(e[r],t[r]),n),{...e}):e}function ri(e){return{create(){return{get(t){return e[t]},set(t,n){e[t]=n}}}}}function ii(e={number:{},dateTime:{},pluralRules:{}}){return{getNumberFormat:Bn((...e)=>new Intl.NumberFormat(...e),{cache:ri(e.number),strategy:Zn.variadic}),getDateTimeFormat:Bn((...e)=>new Intl.DateTimeFormat(...e),{cache:ri(e.dateTime),strategy:Zn.variadic}),getPluralRules:Bn((...e)=>new Intl.PluralRules(...e),{cache:ri(e.pluralRules),strategy:Zn.variadic})}}var ai=class e{constructor(t,n=e.defaultLocale,r,i){if(this.formatterCache={number:{},dateTime:{},pluralRules:{}},this.format=(e=>{let t=this.formatToParts(e);if(t.length===1)return t[0].value;let n=t.reduce((e,t)=>(!e.length||t.type!==0||typeof e[e.length-1]!=`string`?e.push(t.value):e[e.length-1]+=t.value,e),[]);return n.length<=1?n[0]||``:n}),this.formatToParts=(e=>ei(this.ast,this.locales,this.formatters,this.formats,e,void 0,this.message)),this.resolvedOptions=()=>({locale:this.resolvedLocale?.toString()||Intl.NumberFormat.supportedLocalesOf(this.locales)[0]}),this.getAst=()=>this.ast,this.locales=n,this.resolvedLocale=e.resolveLocale(n),typeof t==`string`){if(this.message=t,!e.__parse)throw TypeError("IntlMessageFormat.__parse must be set to process `message` of type `string`");let{...n}=i||{};this.ast=e.__parse(t,{...n,locale:this.resolvedLocale})}else this.ast=t;if(!Array.isArray(this.ast))throw TypeError(`A message must be provided as a String or AST.`);this.formats=ni(e.formats,r),this.formatters=i&&i.formatters||ii(this.formatterCache)}static{this.memoizedDefaultLocale=null}static get defaultLocale(){return e.memoizedDefaultLocale||=new Intl.NumberFormat().resolvedOptions().locale,e.memoizedDefaultLocale}static{this.resolveLocale=e=>{if(Intl.Locale===void 0)return;let t=Intl.NumberFormat.supportedLocalesOf(e);return t.length>0?new Intl.Locale(t[0]):new Intl.Locale(typeof e==`string`?e:e[0])}}static{this.__parse=qr}static{this.formats={number:{integer:{maximumFractionDigits:0},currency:{style:`currency`},percent:{style:`percent`}},date:{short:{month:`numeric`,day:`numeric`,year:`2-digit`},medium:{month:`short`,day:`numeric`,year:`numeric`},long:{month:`long`,day:`numeric`,year:`numeric`},full:{weekday:`long`,month:`long`,day:`numeric`,year:`numeric`}},time:{short:{hour:`numeric`,minute:`numeric`},medium:{hour:`numeric`,minute:`numeric`,second:`numeric`},long:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`},full:{hour:`numeric`,minute:`numeric`,second:`numeric`,timeZoneName:`short`}}}}},oi=`modulepreload`,si=function(e){return`/`+e},ci={},li=function(e){return e.pathname.endsWith(`.css`)},ui=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=si(t,n);let r=s(t);if(r.href in ci)return;ci[r.href]=!0;let i=li(r);if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let o=document.createElement(`link`);if(o.rel=i?`stylesheet`:oi,i||(o.as=`script`),o.crossOrigin=``,o.href=r.href,a&&o.setAttribute(`nonce`,a),document.head.appendChild(o),i)return new Promise((e,t)=>{o.addEventListener(`load`,e),o.addEventListener(`error`,()=>t(Error(`Unable to preload CSS for ${r}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function di(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var fi=di({CHALLENGE_NOT_FOUND:`Challenge not found`,YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:`You are not allowed to register this passkey`,FAILED_TO_VERIFY_REGISTRATION:`Failed to verify registration`,PASSKEY_NOT_FOUND:`Passkey not found`,AUTHENTICATION_FAILED:`Authentication failed`,UNABLE_TO_CREATE_SESSION:`Unable to create session`,USER_NOT_FOUND:`User not found`,FAILED_TO_UPDATE_PASSKEY:`Failed to update passkey`,PREVIOUSLY_REGISTERED:`Previously registered`,REGISTRATION_CANCELLED:`Registration cancelled`,AUTH_CANCELLED:`Auth cancelled`,UNKNOWN_ERROR:`Unknown error`,SESSION_REQUIRED:`Passkey registration requires an authenticated session`,RESOLVE_USER_REQUIRED:`Passkey registration requires either an authenticated session or a resolveUser callback when requireSession is false`,RESOLVED_USER_INVALID:`Resolved user is invalid`}),pi=`1.7.12`;function H(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function mi(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function hi(){return gi.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var gi={stubThis:e=>e};function _i(e){let{id:t}=e;return{...e,id:mi(t),transports:e.transports}}function vi(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var U=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function yi({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new U({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new U({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new U({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new U({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new U({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new U({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new U({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new U({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!vi(t))return new U({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new U({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new U({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new U({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var bi=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},xi=[`cross-platform`,`platform`];function Si(e){if(e&&!(xi.indexOf(e)<0))return e}async function Ci(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!hi())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:mi(t.challenge),user:{...t.user,id:mi(t.user.id)},excludeCredentials:t.excludeCredentials?.map(_i)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=bi.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw yi({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){wi(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=H(e))}catch(e){wi(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=H(c.getAuthenticatorData())}catch(e){wi(`getAuthenticatorData()`,e)}return{id:o,rawId:H(s),response:{attestationObject:H(c.attestationObject),clientDataJSON:H(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:Si(a.authenticatorAttachment)}}function wi(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function Ti(){if(!hi())return Ei.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?Ei.stubThis(new Promise(e=>e(!1))):Ei.stubThis(e.isConditionalMediationAvailable())}var Ei={stubThis:e=>e};function Di({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new U({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new U({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!vi(t))return new U({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new U({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new U({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function Oi(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!hi())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(_i));let a={...t,challenge:mi(t.challenge),allowCredentials:i},o={};if(n){if(!await Ti())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=bi.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw Di({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=H(u.userHandle)),{id:c,rawId:H(l),response:{authenticatorData:H(u.authenticatorData),clientDataJSON:H(u.clientDataJSON),signature:H(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:Si(s.authenticatorAttachment)}}var ki=`1.7.12`,Ai=Symbol.for(`better-auth:broadcast-channel`),ji=()=>Math.floor(Date.now()/1e3),Mi=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(typeof window<`u`)try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:ji()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function Ni(e=`better-auth.message`){return globalThis[Ai]||(globalThis[Ai]=new Mi(e)),globalThis[Ai]}var W=[],Pi=0,Fi=null,Ii=4,Li=globalThis.nanostoresGlobal||={epoch:0},Ri=()=>{let e,t;for(;Pi<W.length;){t=Pi,Pi+=Ii;let n=Fi?.get(W[t]);if(n){if(!n.has(W[t+1]))continue;n.clear()}try{W[t](W[t+1].value,W[t+2],W[t+3])}catch(t){e=t}}if(W.length=Pi=0,e)throw e},zi=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{Fi?.get(e)?.delete(n);for(let t=Pi;t<W.length;)W[t]===e&&W[t+1]===n?W.splice(t,Ii):t+=Ii;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){Li.epoch++;let i=!W.length&&!0;for(let i of t)W.push(i,n,e,r);i&&Ri()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},Bi=2,Vi=5,Hi=6,Ui=10,Wi=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Ui]||(e.events[n+Ui]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);~i&&(r.splice(i,1),r.length||(e.events[n+Ui](),delete e.events[n+Ui]))}),Gi=(e,t)=>Wi(e,t,Bi,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Ki=1e3,qi=(e,t)=>Wi(e,n=>{let r=t(n);r&&e.events[Hi].push(r)},Vi,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Hi]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Hi])t();e.events[Hi]=[]}},Ki)},()=>{e.listen=n,e.off=r}});function Ji(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Yi(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Yi(e[n],t[n]))return!1;return!0}if(Ji(e)&&Ji(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!Yi(e[r],t[r]))return!1;return!0}return!1}function Xi(e,t){return Gi(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var Zi=Symbol.for(`better-auth:focus-manager`),Qi=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function $i(){return globalThis[Zi]||(globalThis[Zi]=new Qi),globalThis[Zi]}var ea=Symbol.for(`better-auth:online-manager`),ta=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function na(){return globalThis[ea]||(globalThis[ea]=new ta),globalThis[ea]}var ra={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},ia=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,aa={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},oa=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function sa(e){return e instanceof Date&&!isNaN(e.getTime())}function ca(e){let t=oa.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return sa(f)?f:null}function la(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in aa)return aa[s];if(!ia.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(ra).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=ca(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function ua(e,t={strict:!0}){return la(e,t)}var da=Symbol.for(`better-auth:auth-query`);function fa(e){let t=zi(e);return Object.defineProperty(t,da,{value:!0}),t}var pa=()=>typeof window>`u`;function ma(e,t){return Yi(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var ha=(e,t,n,r)=>{let i=fa({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>o(e)});qi(i,()=>Xi(i,ma));let a=0,o=async e=>{let o=++a;return new Promise(s=>{let c=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...c,query:{...c?.query,...e?.query},async onSuccess(e){if(o===a){let t=i.get(),n=t.data!=null&&e.data!=null&&Yi(t.data,e.data)?t.data:e.data;i.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}await c?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(!(n&&r<n)){if(o===a){let t=e.error.status===401;i.set({error:e.error,data:t?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}await c?.onError?.(e)}},async onRequest(e){if(o===a){let e=i.get();i.set({isPending:e.data===null,data:e.data,error:null,isRefetching:!0,refetch:i.value.refetch})}await c?.onRequest?.(e)}}).catch(e=>{o===a&&i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{s(void 0)})})};e=Array.isArray(e)?e:[e];let s=!1,c=!1,l=!1,u=()=>{if(s){l=!0;return}s=!0,o().finally(()=>{s=!1;let e=l&&c;l=!1,e&&u()})};return qi(i,()=>{if(pa())return;c=!0;let t=!1,n,r=e.map(e=>e.listen(()=>{t?o():(t=!0,clearTimeout(n),u())}));return n=setTimeout(()=>{t=!0,u()},0),()=>{c=!1;for(let e of r)e();clearTimeout(n)}}),i},ga=()=>Math.floor(Date.now()/1e3),_a=5;function va(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||na().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=ga(),t();return}if(e?.event===`visibilitychange`){if(ga()-c.lastSessionRequest<_a)return;c.lastSessionRequest=ga(),t();return}t()}},d=e=>{Ni().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=Ni().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=$i().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=na().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=Ni().setup(),c.cleanupFocusSetup=$i().setup(),c.cleanupOnlineSetup=na().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var ya=Object.create(null),ba=e=>({}),G=new Proxy(ya,{get(e,t){return ba()[t]??ya[t]},has(e,t){return t in ba()||t in ya},set(e,t,n){let r=ba(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=ba(!0);return delete n[t],!0},ownKeys(){let e=ba(!0);return Object.keys(e)}});G.NODE_ENV;function K(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return K(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return K(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return K(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return K(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return K(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return K(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return K(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function xa(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function Sa(e){let t=e.split(`
|
|
13
13
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
14
|
-
at `))}function Ca(e,t){class n extends e{#e;constructor(...e){if(xa()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Sa(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var wa={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Ca(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:wa[e]){if(super(t?.message,t&&`cause`in t?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,t&&`cause`in t){let{cause:e,...n}=t;this.body=Object.defineProperty(n,"cause",{value:e,writable:!0,configurable:!0});return}this.body=t}},Error);var Ta=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Ea=47;function Da(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Ea;)t--;return t===e.length?e:e.slice(0,t)}function Oa(e){try{return(Da(new URL(e).pathname)||`/`)!==`/`}catch{throw new Ta(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function ka(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Ta(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Ta?t:new Ta(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Aa(e,t=`/api/auth`){if(ka(e),Oa(e))return e;let n=Da(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function ja(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Ma(e,t,n,r,i){if(e)return Aa(e,t);if(r!==!1){let e=G.BETTER_AUTH_URL||G.NEXT_PUBLIC_BETTER_AUTH_URL||G.PUBLIC_BETTER_AUTH_URL||G.NUXT_PUBLIC_BETTER_AUTH_URL||G.NUXT_PUBLIC_AUTH_URL||(G.BASE_URL===`/`?void 0:G.BASE_URL);if(e)return Aa(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&ja(o,`proto`)&&ja(a,`host`))try{return Aa(`${o}://${a}`,t)}catch{}if(n){let e=Na(n.url);if(!e)throw new Ta(`Could not get origin from request. Please provide a valid base URL.`);return Aa(e,t)}if(typeof window<`u`&&window.location)return Aa(window.location.origin,t)}function Na(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Pa=[`javascript:`,`data:`,`vbscript:`];function Fa(e){let t;try{t=new URL(e)}catch{return!0}return!Pa.includes(t.protocol)}var Ia={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Fa(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},La=()=>typeof window>`u`,Ra=Ki;function za(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function Ba(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Va(e){return!e||e.session===null&&e.user===null?null:e}function Ha(e,t){return Yi(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Ua(e,t){let n=zi(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=fa({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});Xi(s,Ha);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=Ba(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=Ba(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=Va(i),u=s.value,d=u.data!=null&&l!=null&&Yi(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+Ra,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return qi(s,()=>{let e;La()||(e=setTimeout(()=>{d()},0));let r=va({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function Wa(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Ga(e,t,n=`.`,r){if(!Wa(t))return Ga(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:Wa(a)&&Wa(i[t])?Ga(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function Ka(e){return(...t)=>t.reduce((t,n)=>Ga(t,n,``,e),{})}var qa=Ka(),Ja=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Ya=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Xa=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Za=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function Qa(e){if(typeof e==`number`)return new Xa({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Xa(e);case`exponential`:return new Za(e);default:throw Error(`Invalid retry strategy`)}}var $a=[`get`,`post`,`put`,`patch`,`delete`];function eo(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return $a.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var to=e=>e===`.`||e===`..`,no=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function ro(e,t){let n=t.get(e);if(n===void 0)return no(e);if(to(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function io(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=eo(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>ro(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var ao=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},oo=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function so(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return oo.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function co(e){try{return JSON.parse(e),!0}catch{return!1}}function lo(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function uo(e){try{return JSON.parse(e)}catch{return e}}function fo(e){return typeof e==`function`}function po(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&fo(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&fo(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function mo(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function ho(e){let t=new Headers(mo(e?.headers,await ao(e)));if(!t.has(`content-type`)){let n=go(e?.body);n&&t.set(`content-type`,n)}return t}function go(e){return lo(e)?`application/json`:null}function _o(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function vo(e,t){let{body:n}=e;return n?!lo(n)||typeof n==`string`?n:_o(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function yo(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=eo(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function bo(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var xo=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function So(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new xo(n.issues);return n.value}function Co(e){"@babel/helpers - typeof";return Co=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Co(e)}function wo(e,t){if(Co(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Co(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function To(e){var t=wo(e,`string`);return Co(t)==`symbol`?t:t+``}function Eo(e,t,n){return(t=To(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Do(Object(n),!0).forEach(function(t){Eo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Oo=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await Ya(e,t),o=po(a),s=new AbortController,c=a.signal??s.signal,l=io(i,a),u=await ho(a),d=vo(a,u),f=yo(i,a),p=q(q({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=bo(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e(q(q({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=so(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??uo)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await So(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e(q(q({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??uo,b=await h.text(),x=co(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:q(q({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e(q(q({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=Qa(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Oo(e,q(q({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new Ja(h.status,h.statusText,x?S:b);return{data:null,error:q(q({},S),{},{status:h.status,statusText:h.statusText})}},ko=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=q(q({},n),e.query!==void 0&&{query:q(q({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=eo(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await So(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=q(q(q(q({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await So(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=q({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=q(q({},t),i.query)}i=q(q({},i),{},{body:o.input?await So(o.input,n?.body):n?.body,params:o.params?await So(o.params,n?.params):n?.params})}return{url:t,options:i}}}return q({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),Ao=e=>{async function t(t,n){let r=q(q(q({},e),n),{},{headers:mo(e?.headers,n?.headers),plugins:[...e?.plugins||[],ko(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Oo(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Oo(t,r)}return t},jo=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Mo=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,No=(e,t)=>{let n=`credentials`in Request.prototype,r=Ma(e?.baseURL,e?.basePath,void 0,t)??jo(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Ao({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?ua(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Ia],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Ua(d,e),h=!1,g=e=>{h||e===null||(h=!0,za(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:Mo,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=qa(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function Po(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Io=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Lo=/['\u2019]/g;function Ro(e){return e.replace(Lo,``).match(Io)??[]}function zo(e){return Ro(e).map(e=>e.toLowerCase()).join(`-`)}function Bo(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Vo(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Po(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(zo).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Bo(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Ho(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,atomListeners:o,$store:s}=No(e),c={};for(let[e,t]of Object.entries(r))c[`use${Fo(e)}`]=t;return Vo({...n,...c,hydrateSession:i,$fetch:a,$store:s},a,t,r,o)}var Uo=(e,{$listPasskeys:t,$store:n})=>({signIn:{passkey:async(r,i)=>{let a=await e(`/passkey/generate-authenticate-options`,{method:`GET`,throw:!1});if(!a.data)return a;let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s;try{s=await Oi({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof U?e.code:`AUTH_CANCELLED`,message:fi.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}try{let{clientExtensionResults:a,...o}=s,c=await e(`/passkey/verify-authentication`,{body:{response:o},...r?.fetchOptions,...i,method:`POST`,throw:!1});return t.set(Math.random()),n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...c,webauthn:{response:s,clientExtensionResults:a}}:c}catch(e){return console.error(`[Better Auth] Error verifying passkey`,e),{data:null,error:{code:`AUTH_CANCELLED`,message:fi.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}}},passkey:{addPasskey:async(r,i)=>{let a=await e(`/passkey/generate-register-options`,{method:`GET`,query:{...r?.authenticatorAttachment&&{authenticatorAttachment:r.authenticatorAttachment},...r?.name&&{name:r.name},...r?.context&&{context:r.context}},throw:!1});if(!a.data)return a;try{let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s=await Ci({optionsJSON:{...a.data,extensions:o},useAutoRegister:r?.useAutoRegister}),{clientExtensionResults:c,...l}=s,u=await e(`/passkey/verify-registration`,{...r?.fetchOptions,...i,body:{response:l,name:r?.name,...r?.createSession&&{createSession:!0}},method:`POST`,throw:!1});return u.data?(t.set(Math.random()),u.data.session&&n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...u,webauthn:{response:s,clientExtensionResults:c}}:u):u}catch(e){return e instanceof U?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:fi.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:fi.REGISTRATION_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:e.code,message:e.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:`UNKNOWN_ERROR`,message:e instanceof Error?e.message:fi.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),Wo=()=>{let e=zi();return{id:`passkey`,version:pi,$InferServerPlugin:{},getActions:(t,n)=>Uo(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:ha(e,`/passkey/list-user-passkeys`,t,{method:`GET`}),$listPasskeys:e}},pathMethods:{"/passkey/register":`POST`,"/passkey/authenticate":`POST`},atomListeners:[{matcher(e){return e===`/passkey/verify-registration`||e===`/passkey/delete-passkey`||e===`/passkey/update-passkey`||e===`/sign-out`},signal:`$listPasskeys`},{matcher:e=>e===`/passkey/verify-authentication`,signal:`$sessionSignal`}],$ERROR_CODES:fi}},Go=di({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`}),Ko=()=>({id:`email-otp`,version:ki,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/email-otp/verify-email`||e===`/sign-in/email-otp`||e===`/email-otp/request-email-change`,signal:`$sessionSignal`}],$ERROR_CODES:Go}),qo=e=>{let t=e?.jwks?.jwksPath??`/jwks`;return{id:`better-auth-client`,version:ki,$InferServerPlugin:{},pathMethods:{[t]:`GET`},getActions:(e,n,r)=>({jwks:async n=>await e(t,{method:`GET`,...n})})}},Jo=di({OTP_NOT_ENABLED:`OTP not enabled`,OTP_NOT_CONFIGURED:`OTP is not available`,OTP_HAS_EXPIRED:`OTP has expired`,TOTP_NOT_ENABLED:`TOTP not enabled`,TOTP_ALREADY_ENABLED:`TOTP is already enabled`,TOTP_NOT_CONFIGURED:`TOTP is not available`,TWO_FACTOR_NOT_ENABLED:`Two factor isn't enabled`,BACKUP_CODES_NOT_ENABLED:`Backup codes aren't enabled`,INVALID_BACKUP_CODE:`Invalid backup code`,INVALID_CODE:`Invalid code`,TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:`Too many attempts. Please request a new code.`,ACCOUNT_TEMPORARILY_LOCKED:`Too many failed verification attempts. Your account is temporarily locked. Please try again later.`,INVALID_TWO_FACTOR_COOKIE:`Invalid two factor cookie`}),Yo=e=>({id:`two-factor`,version:ki,$InferServerPlugin:{},atomListeners:[{matcher:e=>e.startsWith(`/two-factor/`),signal:`$sessionSignal`}],pathMethods:{"/two-factor/disable":`POST`,"/two-factor/enable":`POST`,"/two-factor/send-otp":`POST`,"/two-factor/generate-backup-codes":`POST`,"/two-factor/get-totp-uri":`POST`,"/two-factor/verify-totp":`POST`,"/two-factor/verify-otp":`POST`,"/two-factor/verify-backup-code":`POST`},fetchPlugins:[{id:`two-factor`,name:`two-factor`,hooks:{async onSuccess(t){if(t.data?.twoFactorRedirect){if(e?.onTwoFactorRedirect){await e.onTwoFactorRedirect({twoFactorMethods:t.data.twoFactorMethods});return}e?.twoFactorPage&&typeof window<`u`&&Fa(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:Jo}),J=e(n(),1),Xo=e(r(),1),Zo=J.createContext(void 0),Qo=e=>{let t=J.useContext(Zo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},$o=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Xo.jsx)(Zo.Provider,{value:e,children:t})),es={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ts=new class{#e=es;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ns(e){setTimeout(e,0)}var rs=typeof window>`u`||`Deno`in globalThis;function Y(){}function is(e,t){return typeof e==`function`?e(t):e}function as(e){return typeof e==`number`&&e>=0&&e!==1/0}function os(e,t){return Math.max(e+(t||0)-Date.now(),0)}function X(e,t){return typeof e==`function`?e(t):e}function ss(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ls(o,t.options))return!1}else if(!ds(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function cs(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(us(t.options.mutationKey)!==us(a))return!1}else if(!ds(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ls(e,t){return(t?.queryKeyHashFn||us)(e)}function us(e){return JSON.stringify(e,(e,t)=>gs(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ds(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ds(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ds(e[r],t[r]))return!1;return!0}return!1}var fs=Object.prototype.hasOwnProperty;function ps(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=hs(e)&&hs(t);if(!r&&!(gs(e)&&gs(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:fs.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ps(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ms(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function hs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gs(e){if(!_s(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!_s(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function _s(e){return Object.prototype.toString.call(e)===`[object Object]`}function vs(e){return new Promise(t=>{ts.setTimeout(t,e)})}function ys(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ps(e,t)}function bs(e){return e}function xs(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ss(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Cs=Symbol();function ws(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Cs?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ts(e,t){return typeof e==`function`?e(...t):!!e}function Es(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ds=()=>rs,Os=()=>Ds(),ks=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},As=new class extends ks{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function js(e){let t;if(e.then(e=>(t=e,e),Y)?.catch?.(Y),t!==void 0)return{data:t}}function Ms(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function Ns(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(Y),r}function Ps(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:Ns(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function Fs(e){return e.state.isPaused}function Is(e){return e.state.status===`success`}function Ls(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??Fs,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[Ms(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Is,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[Ps(e,o,a)]:[])}}function Rs(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?js(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l,...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l}});c&&!d&&!h&&!g&&l>m.state.dataUpdatedAt&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(Y)})}var zs=ns;function Bs(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=zs,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Z=Bs(),Vs=new class extends ks{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Hs(e){return Math.min(1e3*2**e,3e4)}function Us(e){return(e??`online`)!==`online`||Vs.isOnline()}var Ws=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Gs(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Y);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ws(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>As.isFocused()&&(e.networkMode===`always`||Vs.isOnline())&&e.canRun(),p=()=>Us(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Os()?0:3),a=e.retryDelay??Hs,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),vs(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Ks=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),as(this.gcTime)&&(this.#e=ts.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Os()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(ts.clearTimeout(this.#e),this.#e=void 0)}};function qs(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Es(e,()=>t.signal,()=>n=!0)},u=ws(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ss:xs;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ys:Js,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Js(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Js(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ys(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Xs(e,t){return t?Js(e,t)!=null:!1}function Zs(e,t){return!t||!e.getPreviousPageParam?!1:Ys(e,t)!=null}var Qs=class extends Ks{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=tc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=tc(this.options);e.data!==void 0&&(this.setState(ec(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ys(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Y).catch(Y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>X(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>X(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!os(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ws(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?qs(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Gs({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ws&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ws){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...$s(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ec(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Z.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function $s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Us(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ec(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function tc(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var nc=class extends ks{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ic(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ac(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ac(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof X(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ms(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&oc(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||X(this.options.staleTime,this.#t)!==X(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ms(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Y)),t}#h(e){return!Os()&&X(this.options.enabled,this.#t)!==!1&&as(e)}#g(){this.#b();let e=X(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=os(this.#r.dataUpdatedAt,e)+1;this.#u=ts.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return X(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=ts.setInterval(()=>{(this.options.refetchIntervalInBackground||As.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(ts.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(ts.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ic(e,t),o=i&&oc(e,n,t,r);(a||o)&&(l={...l,...$s(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ys(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ys(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:sc(e,t),refetch:this.refetch,isEnabled:X(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ms(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Z.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function rc(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||X(t.retryOnMount,e)!==!1)}function ic(e,t){return rc(e,t)||e.state.data!==void 0&&ac(e,t,t.refetchOnMount)}function ac(e,t,n){if(X(t.enabled,e)!==!1&&X(t.staleTime,e)!==`static`){let r=X(n,e);return r===`always`||r!==!1&&sc(e,t)}return!1}function oc(e,t,n,r){return(e!==t||X(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&sc(e,n)}function sc(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(X(t.staleTime,e))}var cc=class extends nc{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Xs(t,n.data),hasPreviousPage:Zs(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},lc=class extends Ks{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||uc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Gs({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Z.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function uc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var dc=class extends ks{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new lc({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=fc(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=fc(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=fc(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=fc(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Z.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>cs(t,e))}findAll(e={}){return this.getAll().filter(t=>cs(e,t))}notify(e){Z.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Z.batch(()=>Promise.all(e.map(e=>e.continue().catch(Y))))}};function fc(e){return e.options.scope?.id}var pc=class extends ks{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ms(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&us(t.mutationKey)!==us(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??uc();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Z.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function mc(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var hc=class extends ks{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Z.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ms(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(mc(e,n).forEach(e=>{e.destroy()}),mc(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=ps(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new nc(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Z.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},gc=class extends ks{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ls(r,t),a=this.get(i);return a||(a=new Qs({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Z.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ss(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ss(e,t)):t}notify(e){Z.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Z.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Z.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_c=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new gc,this.#t=e.mutationCache||new dc,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=As.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Vs.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(X(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=is(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Z.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Z.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Z.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Z.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Y).catch(Y)}invalidateQueries(e,t={}){return Z.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Z.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Y)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Y)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(X(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(X(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Y).catch(Y)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Y).catch(Y)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Vs.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(us(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ds(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(us(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ds(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ls(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Cs&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},vc=J.createContext(!1),yc=()=>J.useContext(vc);vc.Provider;function bc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xc=J.createContext(bc()),Sc=()=>J.useContext(xc),Cc=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Ts(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},wc=e=>{J.useEffect(()=>{e.clearReset()},[e])},Tc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ts(n,[e.error,r])),Ec=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Dc=(e,t)=>e?.suspense&&t.isPending,Oc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kc({queries:e,...t},n){let r=Qo(n),i=yc(),a=Sc(),o=t.subscribed!==!1,s=J.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Ec(e);let t=r.getQueryCache().get(e.queryHash);Cc(e,a,t)}),wc(a);let[c]=J.useState(()=>new hc(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;J.useSyncExternalStore(J.useCallback(e=>f?c.subscribe(Z.batchCalls(e)):Y,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),J.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Dc(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Dc(n,e)?Oc(n,new nc(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Tc({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function Ac(e,t,n){let r=yc(),i=Sc(),a=Qo(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ec(o),Cc(o,i,s),wc(i);let[l]=J.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(J.useSyncExternalStore(J.useCallback(e=>{let t=d?l.subscribe(Z.batchCalls(e)):Y;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),J.useEffect(()=>{l.setOptions(o)},[o,l]),Dc(o,u))throw Oc(o,l,i);if(Tc({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function jc(e,t){return Ac(e,nc,t)}function Mc(e,t){let n=Qo(t),r=n.getQueryCache();return J.useSyncExternalStore(J.useCallback(e=>r.subscribe(Z.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Nc(e,t){let n=Qo(t),[r]=J.useState(()=>new pc(n,e));J.useEffect(()=>{r.setOptions(e)},[r,e]);let i=J.useSyncExternalStore(J.useCallback(e=>r.subscribe(Z.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=J.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Y)},[r]);if(i.error&&Ts(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Pc(e,t){return Ac(e,cc,t)}var Fc=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(Fc||{}),Ic=[0,1],Lc=[1,0],Rc=[2,3],zc=[3,2],Bc={L:Ic,M:Lc,Q:Rc,H:zc},Vc=/^\d*$/,Hc=/^[A-Z0-9 $%*+./:-]*$/,Uc=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,Wc=1,Gc=40,Kc=3,qc=3,Jc=40,Yc=10,Xc=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Zc=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],Qc=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<Wc||e>Gc)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,Fc.Timing),this.setFunctionModule(e,6,e%2==0,Fc.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,$(r,e));this.setFunctionModule(8,7,$(r,6)),this.setFunctionModule(8,8,$(r,7)),this.setFunctionModule(7,8,$(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,$(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,$(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,$(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=$(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,Fc.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,Fc.Alignment)}setFunctionModule(e,t,n,r=Fc.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==pl(t,n))throw RangeError(`Invalid argument`);let r=Zc[n[0]][t],i=Xc[n[0]][t],a=Math.floor(fl(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=ml(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=hl(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(fl(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=$(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=Kc:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Jc),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Jc}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=Kc:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Jc),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Jc}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=qc)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*Yc,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function Q(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function $(e,t){return!!(e>>>t&1)}var $c=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},el=[1,10,12,14],tl=[2,9,11,13],nl=[4,8,16,16];function rl(e,t){return e[Math.floor((t+7)/17)+1]}function il(e){let t=[];for(let n of e)Q(n,8,t);return new $c(nl,e.length,t)}function al(e){if(!cl(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);Q(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new $c(el,e.length,t)}function ol(e){if(!ll(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=Uc.indexOf(e.charAt(n))*45;r+=Uc.indexOf(e.charAt(n+1)),Q(r,11,t)}return n<e.length&&Q(Uc.indexOf(e.charAt(n)),6,t),new $c(tl,e.length,t)}function sl(e){return e===``?[]:cl(e)?[al(e)]:ll(e)?[ol(e)]:[il(dl(e))]}function cl(e){return Vc.test(e)}function ll(e){return Hc.test(e)}function ul(e,t){let n=0;for(let r of e){let e=rl(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function dl(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function fl(e){if(e<Wc||e>Gc)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function pl(e,t){return Math.floor(fl(e)/8)-Xc[t[0]][e]*Zc[t[0]][e]}function ml(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=gl(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=gl(n,2)}return t}function hl(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=gl(t,e))}return n}function gl(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function _l(e,t,n=1,r=40,i=-1,a=!0){if(!(Wc<=n&&n<=r&&r<=Gc)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=pl(o,t)*8,i=ul(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[Lc,Rc,zc])a&&s<=pl(o,e)*8&&(t=e);let c=[];for(let t of e){Q(t.mode[0],4,c),Q(t.numChars,rl(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=pl(o,t)*8;Q(0,Math.min(4,l-c.length),c),Q(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)Q(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new Qc(o,t,u,i)}function vl(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?sl(e):Array.isArray(e)?[il(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=_l(c,Bc[n],i,a,o,r),u=yl({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function yl(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=Fc.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}function bl(e){let{PI:t,min:n,max:r,cos:i,round:a}=Math,o=e[0]|e[1]<<8|e[2]<<16,s=e[3]|e[4]<<8,c=(o&63)/63,l=(o>>6&63)/31.5-1,u=(o>>12&63)/31.5-1,d=(o>>18&31)/31,f=o>>23,p=(s>>3&63)/63,m=(s>>9&63)/63,h=s>>15,g=r(3,h?f?5:7:s&7),_=r(3,h?s&7:f?5:7),v=f?(e[5]&15)/15:1,y=(e[5]>>4)/15,b=f?6:5,x=0,S=(t,n,r)=>{let i=[];for(let a=0;a<n;a++)for(let o=+!a;o*n<t*(n-a);o++)i.push(((e[b+(x>>1)]>>((x++&1)<<2)&15)/7.5-1)*r);return i},C=S(g,_,d),w=S(3,3,p*1.25),ee=S(3,3,m*1.25),te=f&&S(5,5,y),T=xl(e),ne=a(T>1?32:32*T),re=a(T>1?32/T:32),E=new Uint8Array(ne*re*4),D=[],O=[];for(let e=0,a=0;e<re;e++)for(let o=0;o<ne;o++,a+=4){let s=c,d=l,p=u,m=v;for(let e=0,n=r(g,f?5:3);e<n;e++)D[e]=i(t/ne*(o+.5)*e);for(let n=0,a=r(_,f?5:3);n<a;n++)O[n]=i(t/re*(e+.5)*n);for(let e=0,t=0;e<_;e++)for(let n=+!e,r=O[e]*2;n*_<g*(_-e);n++,t++)s+=C[t]*D[n]*r;for(let e=0,t=0;e<3;e++)for(let n=+!e,r=O[e]*2;n<3-e;n++,t++){let e=D[n]*r;d+=w[t]*e,p+=ee[t]*e}if(f)for(let e=0,t=0;e<5;e++)for(let n=+!e,r=O[e]*2;n<5-e;n++,t++)m+=te[t]*D[n]*r;let h=s-2/3*d,y=(3*s-h+p)/2,b=y-p;E[a]=r(0,255*n(1,y)),E[a+1]=r(0,255*n(1,b)),E[a+2]=r(0,255*n(1,h)),E[a+3]=r(0,255*n(1,m))}return{w:ne,h:re,rgba:E}}function xl(e){let t=e[3],n=e[2]&128,r=e[4]&128;return(r?n?5:7:t&7)/(r?t&7:n?5:7)}function Sl(e,t,n){let r=e*4+1,i=6+t*(5+r),a=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,e>>8,e&255,0,0,t>>8,t&255,8,6,0,0,0,0,0,0,0,i>>>24,i>>16&255,i>>8&255,i&255,73,68,65,84,120,1],o=[0,498536548,997073096,651767980,1994146192,1802195444,1303535960,1342533948,-306674912,-267414716,-690576408,-882789492,-1687895376,-2032938284,-1609899400,-1111625188],s=1,c=0;for(let e=0,i=0,o=r-1;e<t;e++,o+=r-1)for(a.push(e+1<t?0:1,r&255,r>>8,~r&255,r>>8^255,0),c=(c+s)%65521;i<o;i++){let e=n[i]&255;a.push(e),s=(s+e)%65521,c=(c+s)%65521}a.push(c>>8,c&255,s>>8,s&255,0,0,0,0,0,0,0,0,73,69,78,68,174,66,96,130);for(let[e,t]of[[12,29],[37,41+i]]){let n=-1;for(let r=e;r<t;r++)n^=a[r],n=n>>>4^o[n&15],n=n>>>4^o[n&15];n=~n,a[t++]=n>>>24,a[t++]=n>>16&255,a[t++]=n>>8&255,a[t++]=n&255}return`data:image/png;base64,`+btoa(String.fromCharCode(...a))}function Cl(e){let t=bl(e);return Sl(t.w,t.h,t.rgba)}export{Ae as A,ai as C,Bt as D,Ht as E,Ze as O,ui as S,jn as T,Ko as _,Mc as a,Oi as b,_c as c,As as d,bs as f,qo as g,Yo as h,Nc as i,st as j,Rt as k,Ls as l,Qo as m,vl as n,jc as o,$o as p,Pc as r,kc as s,Cl as t,Rs as u,Wo as v,In as w,U as x,Ho as y};
|
|
15
|
-
//# debugId=
|
|
14
|
+
at `))}function Ca(e,t){class n extends e{#e;constructor(...e){if(xa()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=Sa(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var wa={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};Ca(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:wa[e]){if(super(t?.message,t&&`cause`in t?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,t&&`cause`in t){let{cause:e,...n}=t;this.body=Object.defineProperty(n,"cause",{value:e,writable:!0,configurable:!0});return}this.body=t}},Error);var Ta=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},Ea=47;function Da(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===Ea;)t--;return t===e.length?e:e.slice(0,t)}function Oa(e){try{return(Da(new URL(e).pathname)||`/`)!==`/`}catch{throw new Ta(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function ka(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new Ta(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof Ta?t:new Ta(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Aa(e,t=`/api/auth`){if(ka(e),Oa(e))return e;let n=Da(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function ja(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function Ma(e,t,n,r,i){if(e)return Aa(e,t);if(r!==!1){let e=G.BETTER_AUTH_URL||G.NEXT_PUBLIC_BETTER_AUTH_URL||G.PUBLIC_BETTER_AUTH_URL||G.NUXT_PUBLIC_BETTER_AUTH_URL||G.NUXT_PUBLIC_AUTH_URL||(G.BASE_URL===`/`?void 0:G.BASE_URL);if(e)return Aa(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&ja(o,`proto`)&&ja(a,`host`))try{return Aa(`${o}://${a}`,t)}catch{}if(n){let e=Na(n.url);if(!e)throw new Ta(`Could not get origin from request. Please provide a valid base URL.`);return Aa(e,t)}if(typeof window<`u`&&window.location)return Aa(window.location.origin,t)}function Na(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Pa=[`javascript:`,`data:`,`vbscript:`];function Fa(e){let t;try{t=new URL(e)}catch{return!0}return!Pa.includes(t.protocol)}var Ia={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Fa(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},La=()=>typeof window>`u`,Ra=Ki;function za(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function Ba(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Va(e){return!e||e.session===null&&e.user===null?null:e}function Ha(e,t){return Yi(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Ua(e,t){let n=zi(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=fa({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});Xi(s,Ha);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=Ba(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=Ba(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=Va(i),u=s.value,d=u.data!=null&&l!=null&&Yi(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+Ra,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return qi(s,()=>{let e;La()||(e=setTimeout(()=>{d()},0));let r=va({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function Wa(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Ga(e,t,n=`.`,r){if(!Wa(t))return Ga(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:Wa(a)&&Wa(i[t])?Ga(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function Ka(e){return(...t)=>t.reduce((t,n)=>Ga(t,n,``,e),{})}var qa=Ka(),Ja=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Ya=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let t=await i.init?.call(i,e.toString(),n);n=t.options||n,e=t.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Xa=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Za=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function Qa(e){if(typeof e==`number`)return new Xa({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Xa(e);case`exponential`:return new Za(e);default:throw Error(`Invalid retry strategy`)}}var $a=[`get`,`post`,`put`,`patch`,`delete`];function eo(e){if(!e.startsWith(`@`))return{method:void 0,path:e};let t=e.indexOf(`/`),n=e.slice(1,t===-1?void 0:t);return $a.includes(n)?{method:n,path:t===-1?e:e.slice(t+1)}:{method:void 0,path:e}}var to=e=>e===`.`||e===`..`,no=e=>e.split(`:`).map(e=>encodeURIComponent(e)).join(`:`);function ro(e,t){let n=t.get(e);if(n===void 0)return no(e);if(to(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function io(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``,{path:o}=eo(e);o!==e&&(e=`/${o}`),a.endsWith(`/`)||(a+=`/`);let[s,c]=e.replace(a,``).split(`?`),l=new URLSearchParams(c);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)l.append(e,n);continue}else n=JSON.stringify(t);l.set(e,n)}let u=new Map;if(r){if(Array.isArray(r)){let e=s.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];u.set(n,String(e))}}else for(let[e,t]of Object.entries(r))u.set(`:${e}`,String(t))}s=s.split(`/`).map(e=>ro(e,u)).join(`/`),s=s.replace(/^\/+/,``);let d=l.toString();return d=d.length>0?`?${d}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${s}${d}`,a):`${a}${s}${d}`}var ao=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},oo=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function so(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return oo.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function co(e){try{return JSON.parse(e),!0}catch{return!1}}function lo(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function uo(e){try{return JSON.parse(e)}catch{return e}}function fo(e){return typeof e==`function`}function po(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&fo(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&fo(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function mo(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function ho(e){let t=new Headers(mo(e?.headers,await ao(e)));if(!t.has(`content-type`)){let n=go(e?.body);n&&t.set(`content-type`,n)}return t}function go(e){return lo(e)?`application/json`:null}function _o(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function vo(e,t){let{body:n}=e;return n?!lo(n)||typeof n==`string`?n:_o(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function yo(e,t){if(t?.method)return t.method.toUpperCase();let{method:n}=eo(e);return n?n.toUpperCase():t?.body?`POST`:`GET`}function bo(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var xo=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function So(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new xo(n.issues);return n.value}function Co(e){"@babel/helpers - typeof";return Co=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},Co(e)}function wo(e,t){if(Co(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(Co(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function To(e){var t=wo(e,`string`);return Co(t)==`symbol`?t:t+``}function Eo(e,t,n){return(t=To(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Do(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function q(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Do(Object(n),!0).forEach(function(t){Eo(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Do(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var Oo=async(e,t)=>{var n;let{hooks:r,url:i,options:a}=await Ya(e,t),o=po(a),s=new AbortController,c=a.signal??s.signal,l=io(i,a),u=await ho(a),d=vo(a,u),f=yo(i,a),p=q(q({},a),{},{url:l,headers:u,body:d,method:f,signal:c});for(let e of r.onRequest)if(e){let t=await e(p);typeof t==`object`&&t&&Object.assign(p,t)}(`pipeTo`in p&&typeof p.pipeTo==`function`||typeof(t==null||(n=t.body)==null?void 0:n.pipe)==`function`)&&(`duplex`in p||(p.duplex=`half`));let{clearTimeout:m}=bo(a,s),h=await o(p.url,p);m();let g={response:h,request:p};for(let e of r.onResponse)if(e){var _;let n=await e(q(q({},g),{},{response:t!=null&&(_=t.hookOptions)!=null&&_.cloneResponse?h.clone():h}));n instanceof Response?h=n:typeof n==`object`&&n&&(h=n.response)}if(h.ok){if(p.method===`HEAD`)return{data:``,error:null};let e=so(h),n={data:null,response:h,request:p};if(e===`json`||e===`text`){let e=await h.text();n.data=await(p.jsonParser??uo)(e)}else n.data=await h[e]();p?.output&&p.output&&!p.disableValidation&&(n.data=await So(p.output,n.data));for(let e of r.onSuccess)if(e){var v;await e(q(q({},n),{},{response:t!=null&&(v=t.hookOptions)!=null&&v.cloneResponse?h.clone():h}))}return t?.throw?n.data:{data:n.data,error:null}}let y=t?.jsonParser??uo,b=await h.text(),x=co(b),S=x?await y(b):null,C={response:h,responseText:b,request:p,error:q(q({},S),{},{status:h.status,statusText:h.statusText})};for(let e of r.onError)if(e){var w;await e(q(q({},C),{},{response:t!=null&&(w=t.hookOptions)!=null&&w.cloneResponse?h.clone():h}))}if(t?.retry){let n=Qa(t.retry),i=t.retryAttempt??0;if(await n.shouldAttemptRetry(i,h)){for(let e of r.onRetry)e&&await e(g);let a=n.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await Oo(e,q(q({},t),{},{retryAttempt:i+1}))}}if(t?.throw)throw new Ja(h.status,h.statusText,x?S:b);return{data:null,error:q(q({},S),{},{status:h.status,statusText:h.statusText})}},ko=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){var r;let i=q(q({},n),e.query!==void 0&&{query:q(q({},e.query),n?.query)}),a=((r=e.plugins)==null||(r=r.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1))==null?void 0:r.schema)||e.schema;if(a){let r=t;a.config?.prefix&&r.startsWith(a.config.prefix)&&(r=r.replace(a.config.prefix,``),a.config.baseURL&&(t=t.replace(a.config.prefix,a.config.baseURL))),a.config?.baseURL&&r.startsWith(a.config.baseURL)&&(r=r.replace(a.config.baseURL,``)),r.startsWith(`/`)&&r.charAt(1)===`@`&&(r=r.substring(1));let o=a.schema[r];if(o){let{method:a,path:s}=eo(r);a&&(t=t.slice(0,t.length-r.length)+s);let c=n?.headers;if(o.headers&&!n?.disableValidation){let e={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((t,n)=>{e[n.toLowerCase()]=t});else if(typeof n.headers==`object`)for(let[t,r]of Object.entries(n.headers))r!=null&&(e[t.toLowerCase()]=r)}let t=await So(o.headers,e),r={};for(let[e,n]of Object.entries(t))r[e.toLowerCase()]=n;c=r}let l=o.method??a;if(i=q(q(q(q({},i),l!==void 0&&{method:l}),o.output!==void 0&&{output:o.output}),c!==void 0&&{headers:c}),!n?.disableValidation){if(o.query&&(i.query=await So(o.query,n?.query),i.query!==null&&typeof i.query==`object`)){let t=q({},e.query);for(let e of Object.keys(t))n?.query&&Object.prototype.hasOwnProperty.call(n.query,e)&&(t[e]=n.query[e]);i.query=q(q({},t),i.query)}i=q(q({},i),{},{body:o.input?await So(o.input,n?.body):n?.body,params:o.params?await So(o.params,n?.params):n?.params})}return{url:t,options:i}}}return q({url:t},(n!==void 0||e.query!==void 0)&&{options:i})}}),Ao=e=>{async function t(t,n){let r=q(q(q({},e),n),{},{headers:mo(e?.headers,n?.headers),plugins:[...e?.plugins||[],ko(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await Oo(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await Oo(t,r)}return t},jo=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},Mo=e=>e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`,No=(e,t)=>{let n=`credentials`in Request.prototype,r=Ma(e?.baseURL,e?.basePath,void 0,t)??jo(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=Ao({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?ua(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Ia],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Ua(d,e),h=!1,g=e=>{h||e===null||(h=!0,za(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher:Mo,callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=qa(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function Po(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Fo(e){return e.charAt(0).toUpperCase()+e.slice(1)}var Io=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Lo=/['\u2019]/g;function Ro(e){return e.replace(Lo,``).match(Io)??[]}function zo(e){return Ro(e).map(e=>e.toLowerCase()).join(`-`)}function Bo(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function Vo(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Po(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(zo).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Bo(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Ho(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,atomListeners:o,$store:s}=No(e),c={};for(let[e,t]of Object.entries(r))c[`use${Fo(e)}`]=t;return Vo({...n,...c,hydrateSession:i,$fetch:a,$store:s},a,t,r,o)}var Uo=(e,{$listPasskeys:t,$store:n})=>({signIn:{passkey:async(r,i)=>{let a=await e(`/passkey/generate-authenticate-options`,{method:`GET`,throw:!1});if(!a.data)return a;let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s;try{s=await Oi({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof U?e.code:`AUTH_CANCELLED`,message:fi.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}try{let{clientExtensionResults:a,...o}=s,c=await e(`/passkey/verify-authentication`,{body:{response:o},...r?.fetchOptions,...i,method:`POST`,throw:!1});return t.set(Math.random()),n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...c,webauthn:{response:s,clientExtensionResults:a}}:c}catch(e){return console.error(`[Better Auth] Error verifying passkey`,e),{data:null,error:{code:`AUTH_CANCELLED`,message:fi.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}}},passkey:{addPasskey:async(r,i)=>{let a=await e(`/passkey/generate-register-options`,{method:`GET`,query:{...r?.authenticatorAttachment&&{authenticatorAttachment:r.authenticatorAttachment},...r?.name&&{name:r.name},...r?.context&&{context:r.context}},throw:!1});if(!a.data)return a;try{let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s=await Ci({optionsJSON:{...a.data,extensions:o},useAutoRegister:r?.useAutoRegister}),{clientExtensionResults:c,...l}=s,u=await e(`/passkey/verify-registration`,{...r?.fetchOptions,...i,body:{response:l,name:r?.name,...r?.createSession&&{createSession:!0}},method:`POST`,throw:!1});return u.data?(t.set(Math.random()),u.data.session&&n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...u,webauthn:{response:s,clientExtensionResults:c}}:u):u}catch(e){return e instanceof U?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:fi.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:fi.REGISTRATION_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:e.code,message:e.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:`UNKNOWN_ERROR`,message:e instanceof Error?e.message:fi.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),Wo=()=>{let e=zi();return{id:`passkey`,version:pi,$InferServerPlugin:{},getActions:(t,n)=>Uo(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:ha(e,`/passkey/list-user-passkeys`,t,{method:`GET`}),$listPasskeys:e}},pathMethods:{"/passkey/register":`POST`,"/passkey/authenticate":`POST`},atomListeners:[{matcher(e){return e===`/passkey/verify-registration`||e===`/passkey/delete-passkey`||e===`/passkey/update-passkey`||e===`/sign-out`},signal:`$listPasskeys`},{matcher:e=>e===`/passkey/verify-authentication`,signal:`$sessionSignal`}],$ERROR_CODES:fi}},Go=di({OTP_EXPIRED:`OTP expired`,INVALID_OTP:`Invalid OTP`,TOO_MANY_ATTEMPTS:`Too many attempts`}),Ko=()=>({id:`email-otp`,version:ki,$InferServerPlugin:{},atomListeners:[{matcher:e=>e===`/email-otp/verify-email`||e===`/sign-in/email-otp`||e===`/email-otp/request-email-change`,signal:`$sessionSignal`}],$ERROR_CODES:Go}),qo=e=>{let t=e?.jwks?.jwksPath??`/jwks`;return{id:`better-auth-client`,version:ki,$InferServerPlugin:{},pathMethods:{[t]:`GET`},getActions:(e,n,r)=>({jwks:async n=>await e(t,{method:`GET`,...n})})}},Jo=di({OTP_NOT_ENABLED:`OTP not enabled`,OTP_NOT_CONFIGURED:`OTP is not available`,OTP_HAS_EXPIRED:`OTP has expired`,TOTP_NOT_ENABLED:`TOTP not enabled`,TOTP_ALREADY_ENABLED:`TOTP is already enabled`,TOTP_NOT_CONFIGURED:`TOTP is not available`,TWO_FACTOR_NOT_ENABLED:`Two factor isn't enabled`,BACKUP_CODES_NOT_ENABLED:`Backup codes aren't enabled`,INVALID_BACKUP_CODE:`Invalid backup code`,INVALID_CODE:`Invalid code`,TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:`Too many attempts. Please request a new code.`,ACCOUNT_TEMPORARILY_LOCKED:`Too many failed verification attempts. Your account is temporarily locked. Please try again later.`,INVALID_TWO_FACTOR_COOKIE:`Invalid two factor cookie`}),Yo=e=>({id:`two-factor`,version:ki,$InferServerPlugin:{},atomListeners:[{matcher:e=>e.startsWith(`/two-factor/`),signal:`$sessionSignal`}],pathMethods:{"/two-factor/disable":`POST`,"/two-factor/enable":`POST`,"/two-factor/send-otp":`POST`,"/two-factor/generate-backup-codes":`POST`,"/two-factor/get-totp-uri":`POST`,"/two-factor/verify-totp":`POST`,"/two-factor/verify-otp":`POST`,"/two-factor/verify-backup-code":`POST`},fetchPlugins:[{id:`two-factor`,name:`two-factor`,hooks:{async onSuccess(t){if(t.data?.twoFactorRedirect){if(e?.onTwoFactorRedirect){await e.onTwoFactorRedirect({twoFactorMethods:t.data.twoFactorMethods});return}e?.twoFactorPage&&typeof window<`u`&&Fa(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:Jo}),J=e(n(),1),Xo=e(r(),1),Zo=J.createContext(void 0),Qo=e=>{let t=J.useContext(Zo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},$o=({client:e,children:t})=>(J.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,Xo.jsx)(Zo.Provider,{value:e,children:t})),es={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},ts=new class{#e=es;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function ns(e){setTimeout(e,0)}var rs=typeof window>`u`||`Deno`in globalThis;function Y(){}function is(e,t){return typeof e==`function`?e(t):e}function as(e){return typeof e==`number`&&e>=0&&e!==1/0}function os(e,t){return Math.max(e+(t||0)-Date.now(),0)}function X(e,t){return typeof e==`function`?e(t):e}function ss(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ls(o,t.options))return!1}else if(!ds(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function cs(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(us(t.options.mutationKey)!==us(a))return!1}else if(!ds(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ls(e,t){return(t?.queryKeyHashFn||us)(e)}function us(e){return JSON.stringify(e,(e,t)=>gs(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ds(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){if(t.length>e.length)return!1;for(let n=0;n<t.length;n++)if(!ds(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!ds(e[r],t[r]))return!1;return!0}return!1}var fs=Object.prototype.hasOwnProperty;function ps(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=hs(e)&&hs(t);if(!r&&!(gs(e)&&gs(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:fs.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ps(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ms(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function hs(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function gs(e){if(!_s(e))return!1;let t=Object.getPrototypeOf(e),n=t?.constructor;if(n===void 0)return!0;if(typeof n!=`function`)return!1;let r=n.prototype;return!(!_s(r)||!r.hasOwnProperty(`isPrototypeOf`)||t!==Object.prototype)}function _s(e){return Object.prototype.toString.call(e)===`[object Object]`}function vs(e){return new Promise(t=>{ts.setTimeout(t,e)})}function ys(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ps(e,t)}function bs(e){return e}function xs(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ss(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Cs=Symbol();function ws(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Cs?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ts(e,t){return typeof e==`function`?e(...t):!!e}function Es(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ds=()=>rs,Os=()=>Ds(),ks=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},As=new class extends ks{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function js(e){let t;if(e.then(e=>(t=e,e),Y)?.catch?.(Y),t!==void 0)return{data:t}}function Ms(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function Ns(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(Y),r}function Ps(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:Ns(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function Fs(e){return e.state.isPaused}function Is(e){return e.state.status===`success`}function Ls(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??Fs,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[Ms(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Is,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[Ps(e,o,a)]:[])}}function Rs(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?js(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l,...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l}});c&&!d&&!h&&!g&&l>m.state.dataUpdatedAt&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(Y)})}var zs=ns;function Bs(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=zs,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Z=Bs(),Vs=new class extends ks{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Hs(e){return Math.min(1e3*2**e,3e4)}function Us(e){return(e??`online`)!==`online`||Vs.isOnline()}var Ws=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Gs(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(Y);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Ws(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>As.isFocused()&&(e.networkMode===`always`||Vs.isOnline())&&e.canRun(),p=()=>Us(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Os()?0:3),a=e.retryDelay??Hs,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),vs(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Ks=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),as(this.gcTime)&&(this.#e=ts.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Os()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(ts.clearTimeout(this.#e),this.#e=void 0)}};function qs(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Es(e,()=>t.signal,()=>n=!0)},u=ws(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ss:xs;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?Ys:Js,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Js(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Js(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function Ys(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}function Xs(e,t){return t?Js(e,t)!=null:!1}function Zs(e,t){return!t||!e.getPreviousPageParam?!1:Ys(e,t)!=null}var Qs=class extends Ks{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=tc(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=tc(this.options);e.data!==void 0&&(this.setState(ec(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=ys(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Y).catch(Y):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>X(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Cs||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>X(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!os(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ws(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?qs(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Gs({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Ws&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Ws){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...$s(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...ec(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Z.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function $s(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Us(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function ec(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function tc(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var nc=class extends ks{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),ic(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ac(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ac(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof X(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ms(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&oc(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||X(this.options.staleTime,this.#t)!==X(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||X(this.options.enabled,this.#t)!==X(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ms(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Y)),t}#h(e){return!Os()&&X(this.options.enabled,this.#t)!==!1&&as(e)}#g(){this.#b();let e=X(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=os(this.#r.dataUpdatedAt,e)+1;this.#u=ts.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return X(this.options.refetchInterval,this.#t)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=ts.setInterval(()=>{(this.options.refetchIntervalInBackground||As.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(ts.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(ts.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&ic(e,t),o=i&&oc(e,n,t,r);(a||o)&&(l={...l,...$s(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=ys(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=ys(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:sc(e,t),refetch:this.refetch,isEnabled:X(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ms(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Z.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function rc(e,t){return X(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||X(t.retryOnMount,e)!==!1)}function ic(e,t){return rc(e,t)||e.state.data!==void 0&&ac(e,t,t.refetchOnMount)}function ac(e,t,n){if(X(t.enabled,e)!==!1&&X(t.staleTime,e)!==`static`){let r=X(n,e);return r===`always`||r!==!1&&sc(e,t)}return!1}function oc(e,t,n,r){return(e!==t||X(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&sc(e,n)}function sc(e,t){return X(t.enabled,e)!==!1&&e.isStaleByTime(X(t.staleTime,e))}var cc=class extends nc{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type=`infinite`,super.setOptions(e)}getOptimisticResult(e){return e._type=`infinite`,super.getOptimisticResult(e)}fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`forward`}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:`backward`}}})}createResult(e,t){let{state:n}=e,r=super.createResult(e,t),{isFetching:i,isRefetching:a,isError:o,isRefetchError:s}=r,c=n.fetchMeta?.fetchMore?.direction,l=o&&c===`forward`,u=i&&c===`forward`,d=o&&c===`backward`,f=i&&c===`backward`;return{...r,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:Xs(t,n.data),hasPreviousPage:Zs(t,n.data),isFetchNextPageError:l,isFetchingNextPage:u,isFetchPreviousPageError:d,isFetchingPreviousPage:f,isRefetchError:s&&!l&&!d,isRefetching:a&&!u&&!f}}},lc=class extends Ks{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||uc(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Gs({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Z.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function uc(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var dc=class extends ks{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new lc({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=fc(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=fc(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=fc(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=fc(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Z.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>cs(t,e))}findAll(e={}){return this.getAll().filter(t=>cs(e,t))}notify(e){Z.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Z.batch(()=>Promise.all(e.map(e=>e.continue().catch(Y))))}};function fc(e){return e.options.scope?.id}var pc=class extends ks{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ms(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&us(t.mutationKey)!==us(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??uc();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Z.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}};function mc(e,t){let n=new Set(t);return e.filter(e=>!n.has(e))}var hc=class extends ks{#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=[];constructor(e,t,n){super(),this.#e=e,this.#r=n,this.#n=[],this.#i=[],this.#t=[],this.setQueries(t)}onSubscribe(){this.listeners.size===1&&this.#i.forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,this.#i.forEach(e=>{e.destroy()})}setQueries(e,t){this.#n=e,this.#r=t,Z.batch(()=>{let e=this.#i,t=this.#p(this.#n);t.forEach(e=>e.observer.setOptions(e.defaultedQueryOptions));let n=t.map(e=>e.observer),r=n.map(e=>e.getCurrentResult()),i=e.length!==n.length,a=n.some((t,n)=>t!==e[n]),o=i||a,s=o?!0:r.some((e,t)=>{let n=this.#t[t];return!n||!ms(e,n)});(o||s)&&(o&&(this.#l=t,this.#i=n),this.#t=r,this.hasListeners()&&(o&&(mc(e,n).forEach(e=>{e.destroy()}),mc(n,e).forEach(e=>{e.subscribe(t=>{this.#m(e,t)})})),this.#h()))})}getCurrentResult(){return this.#t}getQueries(){return this.#i.map(e=>e.getCurrentQuery())}getObservers(){return this.#i}getOptimisticResult(e,t){let n=this.#p(e),r=n.map(e=>e.observer.getOptimisticResult(e.defaultedQueryOptions)),i=n.map(e=>e.defaultedQueryOptions.queryHash);return[r,e=>this.#d(e??r,t,i),()=>this.#u(r,n)]}#u(e,t){let n=new Set;return t.map((r,i)=>{let a=e[i];return r.defaultedQueryOptions.notifyOnChangeProps?a:r.observer.trackResult(a,e=>{n.has(e)||(n.add(e),t.forEach(t=>{t.observer.trackProp(e)}))})})}#d(e,t,n){if(t){let r=this.#c,i=n!==void 0&&r!==void 0&&(r.length!==n.length||n.some((e,t)=>e!==r[t]));return(this.#t!==this.#s||i||t!==this.#o)&&(this.#o=t,this.#s=this.#t,n!==void 0&&(this.#c=n),this.#a=ps(this.#a,t(e))),this.#a}return e}#f(){return!this.#r?.combine||this.#i.some((e,t)=>e.options.suspense&&this.#t[t]?.data===void 0)}#p(e){let t=new Map;this.#i.forEach(e=>{let n=e.options.queryHash;if(!n)return;let r=t.get(n);r?r.push(e):t.set(n,[e])});let n=[];return e.forEach(e=>{let r=this.#e.defaultQueryOptions(e),i=t.get(r.queryHash)?.shift()??new nc(this.#e,r);n.push({defaultedQueryOptions:r,observer:i})}),n}#m(e,t){let n=this.#i.indexOf(e);n!==-1&&(this.#t=this.#t.slice(),this.#t[n]=t,this.#h())}#h(){if(this.hasListeners()){let e=this.#f(),t=this.#a,n=e?t:this.#d(this.#u(this.#t,this.#l),this.#r?.combine);(e||t!==n)&&Z.batch(()=>{this.listeners.forEach(e=>{e(this.#t)})})}}},gc=class extends ks{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ls(r,t),a=this.get(i);return a||(a=new Qs({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){this.#e.get(e.queryHash)===e&&(e.destroy(),this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Z.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ss(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ss(e,t)):t}notify(e){Z.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Z.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Z.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},_c=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new gc,this.#t=e.mutationCache||new dc,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=As.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Vs.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(X(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=is(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Z.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Z.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Z.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Z.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Y).catch(Y)}invalidateQueries(e,t={}){return Z.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Z.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Y)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Y)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(X(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(X(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Y).catch(Y)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Y).catch(Y)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Vs.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(us(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ds(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(us(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ds(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ls(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Cs&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},vc=J.createContext(!1),yc=()=>J.useContext(vc);vc.Provider;function bc(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var xc=J.createContext(bc()),Sc=()=>J.useContext(xc),Cc=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Ts(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},wc=e=>{J.useEffect(()=>{e.clearReset()},[e])},Tc=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ts(n,[e.error,r])),Ec=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Dc=(e,t)=>e?.suspense&&t.isPending,Oc=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function kc({queries:e,...t},n){let r=Qo(n),i=yc(),a=Sc(),o=t.subscribed!==!1,s=J.useMemo(()=>e.map(e=>{let t=r.defaultQueryOptions(e);return t._optimisticResults=i?`isRestoring`:o?`optimistic`:void 0,t}),[e,r,i,o]);s.forEach(e=>{Ec(e);let t=r.getQueryCache().get(e.queryHash);Cc(e,a,t)}),wc(a);let[c]=J.useState(()=>new hc(r,s,t)),[l,u,d]=c.getOptimisticResult(s,t.combine),f=!i&&o;J.useSyncExternalStore(J.useCallback(e=>f?c.subscribe(Z.batchCalls(e)):Y,[c,f]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),J.useEffect(()=>{c.setQueries(s,t)},[s,t,c]);let p=l.some((e,t)=>Dc(s[t],e))?l.flatMap((e,t)=>{let n=s[t];return n&&Dc(n,e)?Oc(n,new nc(r,n),a):[]}):[];if(p.length>0)throw Promise.all(p);let m=l.find((e,t)=>{let n=s[t];return n&&Tc({result:e,errorResetBoundary:a,throwOnError:n.throwOnError,query:r.getQueryCache().get(n.queryHash),suspense:n.suspense})});if(m)throw m.error;return u(d())}function Ac(e,t,n){let r=yc(),i=Sc(),a=Qo(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Ec(o),Cc(o,i,s),wc(i);let[l]=J.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(J.useSyncExternalStore(J.useCallback(e=>{let t=d?l.subscribe(Z.batchCalls(e)):Y;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),J.useEffect(()=>{l.setOptions(o)},[o,l]),Dc(o,u))throw Oc(o,l,i);if(Tc({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function jc(e,t){return Ac(e,nc,t)}function Mc(e,t){let n=Qo(t),r=n.getQueryCache();return J.useSyncExternalStore(J.useCallback(e=>r.subscribe(Z.batchCalls(e)),[r]),()=>n.isFetching(e),()=>n.isFetching(e))}function Nc(e,t){let n=Qo(t),[r]=J.useState(()=>new pc(n,e));J.useEffect(()=>{r.setOptions(e)},[r,e]);let i=J.useSyncExternalStore(J.useCallback(e=>r.subscribe(Z.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=J.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(Y)},[r]);if(i.error&&Ts(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}function Pc(e,t){return Ac(e,cc,t)}var Fc=(e=>(e[e.Border=-1]=`Border`,e[e.Data=0]=`Data`,e[e.Function=1]=`Function`,e[e.Position=2]=`Position`,e[e.Timing=3]=`Timing`,e[e.Alignment=4]=`Alignment`,e))(Fc||{}),Ic=[0,1],Lc=[1,0],Rc=[2,3],zc=[3,2],Bc={L:Ic,M:Lc,Q:Rc,H:zc},Vc=/^\d*$/,Hc=/^[A-Z0-9 $%*+./:-]*$/,Uc=`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:`,Wc=1,Gc=40,Kc=3,qc=3,Jc=40,Yc=10,Xc=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Zc=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],Qc=class{constructor(e,t,n,r){if(this.version=e,this.ecc=t,e<Wc||e>Gc)throw RangeError(`Version value out of range`);if(r<-1||r>7)throw RangeError(`Mask value out of range`);this.size=e*4+17;let i=Array.from({length:this.size}).fill(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.types.push(i.map(()=>0));this.drawFunctionPatterns();let a=this.addEccAndInterleave(n);if(this.drawCodewords(a),r===-1){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);let n=this.getPenaltyScore();n<e&&(r=t,e=n),this.applyMask(t)}}this.mask=r,this.applyMask(r),this.drawFormatBits(r)}size;mask;modules=[];types=[];getModule(e,t){return e>=0&&e<this.size&&t>=0&&t<this.size&&this.modules[t][e]}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0,Fc.Timing),this.setFunctionModule(e,6,e%2==0,Fc.Timing);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);let e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)n===0&&r===0||n===0&&r===t-1||n===t-1&&r===0||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){let t=this.ecc[1]<<3|e,n=t;for(let e=0;e<10;e++)n=n<<1^(n>>>9)*1335;let r=(t<<10|n)^21522;for(let e=0;e<=5;e++)this.setFunctionModule(8,e,$(r,e));this.setFunctionModule(8,7,$(r,6)),this.setFunctionModule(8,8,$(r,7)),this.setFunctionModule(7,8,$(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,$(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,$(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,$(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^(e>>>11)*7973;let t=this.version<<12|e;for(let e=0;e<18;e++){let n=$(t,e),r=this.size-11+e%3,i=Math.floor(e/3);this.setFunctionModule(r,i,n),this.setFunctionModule(i,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){let i=Math.max(Math.abs(r),Math.abs(n)),a=e+r,o=t+n;a>=0&&a<this.size&&o>=0&&o<this.size&&this.setFunctionModule(a,o,i!==2&&i!==4,Fc.Position)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,Math.max(Math.abs(r),Math.abs(n))!==1,Fc.Alignment)}setFunctionModule(e,t,n,r=Fc.Function){this.modules[t][e]=n,this.types[t][e]=r}addEccAndInterleave(e){let t=this.version,n=this.ecc;if(e.length!==pl(t,n))throw RangeError(`Invalid argument`);let r=Zc[n[0]][t],i=Xc[n[0]][t],a=Math.floor(fl(t)/8),o=r-a%r,s=Math.floor(a/r),c=[],l=ml(i);for(let t=0,n=0;t<r;t++){let r=e.slice(n,n+s-i+(t<o?0:1));n+=r.length;let a=hl(r,l);t<o&&r.push(0),c.push(r.concat(a))}let u=[];for(let e=0;e<c[0].length;e++)c.forEach((t,n)=>{(e!==s-i||n>=o)&&u.push(t[e])});return u}drawCodewords(e){if(e.length!==Math.floor(fl(this.version)/8))throw RangeError(`Invalid argument`);let t=0;for(let n=this.size-1;n>=1;n-=2){n===6&&(n=5);for(let r=0;r<this.size;r++)for(let i=0;i<2;i++){let a=n-i,o=n+1&2?r:this.size-1-r;!this.types[o][a]&&t<e.length*8&&(this.modules[o][a]=$(e[t>>>3],7-(t&7)),t++)}}}applyMask(e){if(e<0||e>7)throw RangeError(`Mask value out of range`);for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw Error(`Unreachable`)}!this.types[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[t][a]===n?(r++,r===5?e+=Kc:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Jc),n=this.modules[t][a],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Jc}for(let t=0;t<this.size;t++){let n=!1,r=0,i=[0,0,0,0,0,0,0];for(let a=0;a<this.size;a++)this.modules[a][t]===n?(r++,r===5?e+=Kc:r>5&&e++):(this.finderPenaltyAddHistory(r,i),n||(e+=this.finderPenaltyCountPatterns(i)*Jc),n=this.modules[a][t],r=1);e+=this.finderPenaltyTerminateAndCount(n,r,i)*Jc}for(let t=0;t<this.size-1;t++)for(let n=0;n<this.size-1;n++){let r=this.modules[t][n];r===this.modules[t][n+1]&&r===this.modules[t+1][n]&&r===this.modules[t+1][n+1]&&(e+=qc)}let t=0;for(let e of this.modules)t=e.reduce((e,t)=>e+ +!!t,t);let n=this.size*this.size,r=Math.ceil(Math.abs(t*20-n*10)/n)-1;return e+=r*Yc,e}getAlignmentPatternPositions(){if(this.version===1)return[];{let e=Math.floor(this.version/7)+2,t=this.version===32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}finderPenaltyCountPatterns(e){let t=e[1],n=t>0&&e[2]===t&&e[3]===t*3&&e[4]===t&&e[5]===t;return(n&&e[0]>=t*4&&e[6]>=t?1:0)+(n&&e[6]>=t*4&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){t[0]===0&&(e+=this.size),t.pop(),t.unshift(e)}};function Q(e,t,n){if(t<0||t>31||e>>>t)throw RangeError(`Value out of range`);for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function $(e,t){return!!(e>>>t&1)}var $c=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw RangeError(`Invalid argument`);this.bitData=n.slice()}getData(){return this.bitData.slice()}},el=[1,10,12,14],tl=[2,9,11,13],nl=[4,8,16,16];function rl(e,t){return e[Math.floor((t+7)/17)+1]}function il(e){let t=[];for(let n of e)Q(n,8,t);return new $c(nl,e.length,t)}function al(e){if(!cl(e))throw RangeError(`String contains non-numeric characters`);let t=[];for(let n=0;n<e.length;){let r=Math.min(e.length-n,3);Q(Number.parseInt(e.substring(n,n+r),10),r*3+1,t),n+=r}return new $c(el,e.length,t)}function ol(e){if(!ll(e))throw RangeError(`String contains unencodable characters in alphanumeric mode`);let t=[],n=0;for(;n+2<=e.length;n+=2){let r=Uc.indexOf(e.charAt(n))*45;r+=Uc.indexOf(e.charAt(n+1)),Q(r,11,t)}return n<e.length&&Q(Uc.indexOf(e.charAt(n)),6,t),new $c(tl,e.length,t)}function sl(e){return e===``?[]:cl(e)?[al(e)]:ll(e)?[ol(e)]:[il(dl(e))]}function cl(e){return Vc.test(e)}function ll(e){return Hc.test(e)}function ul(e,t){let n=0;for(let r of e){let e=rl(r.mode,t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}function dl(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)e.charAt(n)===`%`?(t.push(Number.parseInt(e.substring(n+1,n+3),16)),n+=2):t.push(e.charCodeAt(n));return t}function fl(e){if(e<Wc||e>Gc)throw RangeError(`Version number out of range`);let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}function pl(e,t){return Math.floor(fl(e)/8)-Xc[t[0]][e]*Zc[t[0]][e]}function ml(e){if(e<1||e>255)throw RangeError(`Degree out of range`);let t=[];for(let n=0;n<e-1;n++)t.push(0);t.push(1);let n=1;for(let r=0;r<e;r++){for(let e=0;e<t.length;e++)t[e]=gl(t[e],n),e+1<t.length&&(t[e]^=t[e+1]);n=gl(n,2)}return t}function hl(e,t){let n=t.map(e=>0);for(let r of e){let e=r^n.shift();n.push(0),t.forEach((t,r)=>n[r]^=gl(t,e))}return n}function gl(e,t){if(e>>>8||t>>>8)throw RangeError(`Byte out of range`);let n=0;for(let r=7;r>=0;r--)n=n<<1^(n>>>7)*285,n^=(t>>>r&1)*e;return n}function _l(e,t,n=1,r=40,i=-1,a=!0){if(!(Wc<=n&&n<=r&&r<=Gc)||i<-1||i>7)throw RangeError(`Invalid value`);let o,s;for(o=n;;o++){let n=pl(o,t)*8,i=ul(e,o);if(i<=n){s=i;break}if(o>=r)throw RangeError(`Data too long`)}for(let e of[Lc,Rc,zc])a&&s<=pl(o,e)*8&&(t=e);let c=[];for(let t of e){Q(t.mode[0],4,c),Q(t.numChars,rl(t.mode,o),c);for(let e of t.getData())c.push(e)}let l=pl(o,t)*8;Q(0,Math.min(4,l-c.length),c),Q(0,(8-c.length%8)%8,c);for(let e=236;c.length<l;e^=253)Q(e,8,c);let u=Array.from({length:Math.ceil(c.length/8)},()=>0);return c.forEach((e,t)=>u[t>>>3]|=e<<7-(t&7)),new Qc(o,t,u,i)}function vl(e,t){let{ecc:n=`L`,boostEcc:r=!1,minVersion:i=1,maxVersion:a=40,maskPattern:o=-1,border:s=1}=t||{},c=typeof e==`string`?sl(e):Array.isArray(e)?[il(e)]:void 0;if(!c)throw Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);let l=_l(c,Bc[n],i,a,o,r),u=yl({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},s);return t?.invert&&(u.data=u.data.map(e=>e.map(e=>!e))),t?.onEncoded?.(u),u}function yl(e,t=1){if(!t)return e;let{size:n}=e,r=n+t*2;e.size=r,e.data.forEach(e=>{for(let n=0;n<t;n++)e.unshift(!1),e.push(!1)});for(let n=0;n<t;n++)e.data.unshift(Array.from({length:r},e=>!1)),e.data.push(Array.from({length:r},e=>!1));let i=Fc.Border;e.types.forEach(e=>{for(let n=0;n<t;n++)e.unshift(i),e.push(i)});for(let n=0;n<t;n++)e.types.unshift(Array.from({length:r},e=>i)),e.types.push(Array.from({length:r},e=>i));return e}function bl(e){let{PI:t,min:n,max:r,cos:i,round:a}=Math,o=e[0]|e[1]<<8|e[2]<<16,s=e[3]|e[4]<<8,c=(o&63)/63,l=(o>>6&63)/31.5-1,u=(o>>12&63)/31.5-1,d=(o>>18&31)/31,f=o>>23,p=(s>>3&63)/63,m=(s>>9&63)/63,h=s>>15,g=r(3,h?f?5:7:s&7),_=r(3,h?s&7:f?5:7),v=f?(e[5]&15)/15:1,y=(e[5]>>4)/15,b=f?6:5,x=0,S=(t,n,r)=>{let i=[];for(let a=0;a<n;a++)for(let o=+!a;o*n<t*(n-a);o++)i.push(((e[b+(x>>1)]>>((x++&1)<<2)&15)/7.5-1)*r);return i},C=S(g,_,d),w=S(3,3,p*1.25),ee=S(3,3,m*1.25),te=f&&S(5,5,y),T=xl(e),ne=a(T>1?32:32*T),re=a(T>1?32/T:32),E=new Uint8Array(ne*re*4),D=[],O=[];for(let e=0,a=0;e<re;e++)for(let o=0;o<ne;o++,a+=4){let s=c,d=l,p=u,m=v;for(let e=0,n=r(g,f?5:3);e<n;e++)D[e]=i(t/ne*(o+.5)*e);for(let n=0,a=r(_,f?5:3);n<a;n++)O[n]=i(t/re*(e+.5)*n);for(let e=0,t=0;e<_;e++)for(let n=+!e,r=O[e]*2;n*_<g*(_-e);n++,t++)s+=C[t]*D[n]*r;for(let e=0,t=0;e<3;e++)for(let n=+!e,r=O[e]*2;n<3-e;n++,t++){let e=D[n]*r;d+=w[t]*e,p+=ee[t]*e}if(f)for(let e=0,t=0;e<5;e++)for(let n=+!e,r=O[e]*2;n<5-e;n++,t++)m+=te[t]*D[n]*r;let h=s-2/3*d,y=(3*s-h+p)/2,b=y-p;E[a]=r(0,255*n(1,y)),E[a+1]=r(0,255*n(1,b)),E[a+2]=r(0,255*n(1,h)),E[a+3]=r(0,255*n(1,m))}return{w:ne,h:re,rgba:E}}function xl(e){let t=e[3],n=e[2]&128,r=e[4]&128;return(r?n?5:7:t&7)/(r?t&7:n?5:7)}function Sl(e,t,n){let r=e*4+1,i=6+t*(5+r),a=[137,80,78,71,13,10,26,10,0,0,0,13,73,72,68,82,0,0,e>>8,e&255,0,0,t>>8,t&255,8,6,0,0,0,0,0,0,0,i>>>24,i>>16&255,i>>8&255,i&255,73,68,65,84,120,1],o=[0,498536548,997073096,651767980,1994146192,1802195444,1303535960,1342533948,-306674912,-267414716,-690576408,-882789492,-1687895376,-2032938284,-1609899400,-1111625188],s=1,c=0;for(let e=0,i=0,o=r-1;e<t;e++,o+=r-1)for(a.push(e+1<t?0:1,r&255,r>>8,~r&255,r>>8^255,0),c=(c+s)%65521;i<o;i++){let e=n[i]&255;a.push(e),s=(s+e)%65521,c=(c+s)%65521}a.push(c>>8,c&255,s>>8,s&255,0,0,0,0,0,0,0,0,73,69,78,68,174,66,96,130);for(let[e,t]of[[12,29],[37,41+i]]){let n=-1;for(let r=e;r<t;r++)n^=a[r],n=n>>>4^o[n&15],n=n>>>4^o[n&15];n=~n,a[t++]=n>>>24,a[t++]=n>>16&255,a[t++]=n>>8&255,a[t++]=n&255}return`data:image/png;base64,`+btoa(String.fromCharCode(...a))}function Cl(e){let t=bl(e);return Sl(t.w,t.h,t.rgba)}export{Rt as A,ui as C,Ht as D,jn as E,st as M,Bt as O,U as S,In as T,qo as _,Mc as a,Ho as b,_c as c,As as d,bs as f,Yo as g,Qo as h,Nc as i,Ae as j,Ze as k,Ls as l,$o as m,vl as n,jc as o,Zo as p,Pc as r,kc as s,Cl as t,Rs as u,Ko as v,ai as w,Oi as x,Wo as y};
|
|
15
|
+
//# debugId=2ded0ed0-6cfb-42ee-ac18-81fde6e1e398
|