@onequery/cli 0.1.41-win32-x64 → 0.1.42-darwin-arm64
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/package.json +3 -3
- package/vendor/{x86_64-pc-windows-msvc/onequery/onequery.exe → aarch64-apple-darwin/onequery/onequery} +0 -0
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/DialogTitle-M7sZ-HhE.js → aarch64-apple-darwin/runtime/web/assets/DialogTitle-CzRmdOOz.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/_authenticated-qXb4JoGl.js → aarch64-apple-darwin/runtime/web/assets/_authenticated-DE-fRDAy.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/_org_slug-CXdsucoF.js → aarch64-apple-darwin/runtime/web/assets/_org_slug-8Eun-zo1.js} +1 -1
- package/vendor/aarch64-apple-darwin/runtime/web/assets/alert-CgZYtErJ.js +1 -0
- package/vendor/aarch64-apple-darwin/runtime/web/assets/audit-ChUF-UD4.js +1 -0
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/auth-bootstrap-query-DlVmn2Fg.js → aarch64-apple-darwin/runtime/web/assets/auth-bootstrap-query-B7dkGOfQ.js} +1 -1
- package/vendor/aarch64-apple-darwin/runtime/web/assets/budget-DA47wojH.js +1 -0
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/callback-CmOV3PG1.js → aarch64-apple-darwin/runtime/web/assets/callback-CJcspPuI.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/checkbox-CJcCVDm9.js → aarch64-apple-darwin/runtime/web/assets/checkbox-DYtEYWlC.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/connect-database-AGEDWjtx.js → aarch64-apple-darwin/runtime/web/assets/connect-database-BRm1cHow.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/create-org-DRRUM53H.js → aarch64-apple-darwin/runtime/web/assets/create-org-D1xCoAP-.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/data-source-connection-form-DGwTOXJU.js → aarch64-apple-darwin/runtime/web/assets/data-source-connection-form-DPfvAEve.js} +2 -2
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/device-C7FtW1ZI.js → aarch64-apple-darwin/runtime/web/assets/device-CUOuLzJr.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/dropdown-menu-C9Dn5_Vs.js → aarch64-apple-darwin/runtime/web/assets/dropdown-menu-CrGReNWD.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/home-DsMx_Yb9.js → aarch64-apple-darwin/runtime/web/assets/home-BUn6Mfan.js} +1 -1
- package/vendor/aarch64-apple-darwin/runtime/web/assets/index-BBPJeil4.css +2 -0
- package/vendor/aarch64-apple-darwin/runtime/web/assets/index-ClzxEm7R.js +10 -0
- package/vendor/aarch64-apple-darwin/runtime/web/assets/integrations-MfPuDele.js +1 -0
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/invite._invitationId-CVlMJsPV.js → aarch64-apple-darwin/runtime/web/assets/invite._invitationId-BtGsgWJR.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/routes-CMAxnfup.js → aarch64-apple-darwin/runtime/web/assets/routes-Bfxhd-MC.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/select-D6km4Obp.js → aarch64-apple-darwin/runtime/web/assets/select-BRK_cJtj.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/settings-C6cYEB0P.js → aarch64-apple-darwin/runtime/web/assets/settings-DbZya6GZ.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/signin-0pmtfKmA.js → aarch64-apple-darwin/runtime/web/assets/signin-Bb-ElhcI.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/team-Bc87hpLk.js → aarch64-apple-darwin/runtime/web/assets/team-lu76z2PF.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/theme-toggle-CFUqhWNn.js → aarch64-apple-darwin/runtime/web/assets/theme-toggle-SKykt1po.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/use-optimistic-mutation-Cx_ughl1.js → aarch64-apple-darwin/runtime/web/assets/use-optimistic-mutation-Dd5ntQWa.js} +1 -1
- package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/useBaseQuery-PhIlqR9l.js → aarch64-apple-darwin/runtime/web/assets/useBaseQuery-DXS4_Zkx.js} +1 -1
- package/vendor/aarch64-apple-darwin/runtime/web/assets/useQuery-B9mB-acs.js +1 -0
- package/vendor/aarch64-apple-darwin/runtime/web/assets/useSuspenseQuery-Bq3OtiRW.js +1 -0
- package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/index.html +2 -2
- package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/server/onequery-server.mjs +105 -30
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/audit-BW0d65Q4.js +0 -1
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/budget-BGl-qO3N.js +0 -1
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/index-BS5Fb-IS.css +0 -2
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/index-e4SV9LPn.js +0 -10
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/integrations-BubROEys.js +0 -1
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/useQuery-BRVHrBi8.js +0 -1
- package/vendor/x86_64-pc-windows-msvc/runtime/web/assets/useSuspenseQuery-Bn7lFvcg.js +0 -1
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/20260327065242_curious_nightmare.sql +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/20260403103652_slippery_hellfire_club.sql +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/20260403112219_gigantic_namora.sql +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/20260420071232_previous_justin_hammer.sql +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/20260420093157_spooky_cassandra_nova.sql +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/20260420101631_even_ogun.sql +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/20260327065242_snapshot.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/20260403103652_snapshot.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/20260403112219_snapshot.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/20260420071232_snapshot.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/20260420093157_snapshot.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/20260420101631_snapshot.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/migrations/meta/_journal.json +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/pglite/initdb.wasm +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/pglite/pglite.data +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/pglite/pglite.wasm +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/sql-parser/sql_parser_wasm_bg.wasm +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/CompositeItem-D3nXGtvr.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/CompositeList-CX7HHxYw.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconArrowRight-DsOD7mDl.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconCheck-Gc24xPT2.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconChevronDown-B-39MA7-.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconCoins-C7Nn0L6R.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconHistory-BqAd-xl2.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconLoader2-B3B6M8nQ.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconPlus-C3-kRhGX.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/IconX-BQkA009b.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/Separator-vw4jPN_6.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/api-base-url-DIb6qukm.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/api-client-B2Cc7TWF.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/api-paths-Cjr2f6P6.js → aarch64-apple-darwin/runtime/web/assets/api-paths-DM-NAvAZ.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/app-routes-CnJncMlZ.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/auth-client-DF1BsKzX.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/avatar-B8g7WJsq.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/badge-C1_ZMBRy.js → aarch64-apple-darwin/runtime/web/assets/badge-CwG2ykXV.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/card-Bsy6azfK.js → aarch64-apple-darwin/runtime/web/assets/card-BWqhQk-T.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/compiler-runtime-DCc3R3Xn.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/createReactComponent-_L2mp4Ui.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/dist-DAhKd1f7.js → aarch64-apple-darwin/runtime/web/assets/dist-D0YU0n1N.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/empty-COnWCwda.js → aarch64-apple-darwin/runtime/web/assets/empty-nwzd6339.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/format-date-Ctrh7my1.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/getDisabledMountTransitionStyles-BYKRz4ha.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/getPseudoElementBounds-InhM-dWf.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/input-CG_cIxvO.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-cyrillic-ext-wght-normal-BOeWTOD4.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-cyrillic-wght-normal-DqGufNeO.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-greek-ext-wght-normal-DlzME5K_.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-greek-wght-normal-CkhJZR-_.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-latin-ext-wght-normal-DO1Apj_S.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-latin-wght-normal-Dx4kXJAl.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/inter-vietnamese-wght-normal-CBcvBZtf.woff2 +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/jsx-runtime-DG_AJzB_.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/label-CWOhoN_L.js → aarch64-apple-darwin/runtime/web/assets/label-DDLGZnWP.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/link-Cgvqhh5w.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/matchContext-CDajBC0L.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/organization-permissions-BQQ5PJbI.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/organization-query-keys-DwLucsD_.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/query-timing-LGzitMXx.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/queryOptions-BHw87wTZ.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/removable-BfDesq3B.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/schemas-n4sxh6jF.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/separator-CWltZvB_.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/src-DCIPwIx0.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/table-DCvfJyLS.js → aarch64-apple-darwin/runtime/web/assets/table-Bzsu823v.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/textarea-DiU04l_U.js → aarch64-apple-darwin/runtime/web/assets/textarea-eJnGRrvE.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/useBaseUiId-BLFGpnYJ.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/useCompositeItem-BsMHgRi0.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/useControlled-B8q0aJoo.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/useRender-B2c9_UYd.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/useRouterState-DpT8luFk.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/useValueChanged-CqxkrqWn.js → aarch64-apple-darwin/runtime/web/assets/useValueChanged-C3CBkPge.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/assets/utils-C8DGLIgm.js +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/xstate-react.esm-DhUG3dob.js → aarch64-apple-darwin/runtime/web/assets/xstate-react.esm-U3P0kbzA.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc/runtime/web/assets/zod-D58ea2dv.js → aarch64-apple-darwin/runtime/web/assets/zod-Ch0Zejov.js} +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/favicon.ico +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/amplitude/step1_settings_sidebar.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/amplitude/step2_projects.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/amplitude/step3_project_keys.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/amplitude/step4_api_keys.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/bigquery/step1_service_accounts.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/bigquery/step2_bigquery_roles.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/bigquery/step3_add_key_menu.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/bigquery/step4_create_json_key.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/ga4/step1_service_accounts.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/ga4/step2_create_json_key.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/ga4/step3_add_user_viewer.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/ga4/step4_property_details.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/github-token-guide/step1_signin.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/github-token-guide/step2_new_fine_grained_token_sanitized.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/github-token-guide/step3_permissions_configured_sanitized.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/github-token-guide/step4_token_created_sanitized.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/mixpanel/step1_service_accounts.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/mixpanel/step2_create_service_account.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/mixpanel/step3_credentials.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/mixpanel/step4_project_settings.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/postgresql/step1_create_user.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/postgresql/step2_connection.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/posthog/step1_project_settings.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/posthog/step2_personal_api_keys.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/posthog/step3_create_key_modal.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/rds/step1_connect.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/rds/step2_create_user.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/rds/step3_grant.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/rds/step4_info.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/sentry/step1_personal_tokens.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/sentry/step2_create_token_permissions.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/sentry/step3_organization_slug.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/images/sentry/step4_project_slug.png +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/linear.svg +0 -0
- /package/vendor/{x86_64-pc-windows-msvc → aarch64-apple-darwin}/runtime/web/onequery.svg +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{a as i,g as a,n as o,o as s,y as c}from"./createReactComponent-_L2mp4Ui.js";import{t as l}from"./utils-C8DGLIgm.js";import{t as u}from"./IconX-BQkA009b.js";import{A as d,E as f,T as p,b as m,m as h,o as g}from"./removable-BfDesq3B.js";import{c as _,l as v}from"./getDisabledMountTransitionStyles-BYKRz4ha.js";import{t as y}from"./useBaseUiId-BLFGpnYJ.js";import{c as b}from"./getPseudoElementBounds-InhM-dWf.js";import{
|
|
1
|
+
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{a as i,g as a,n as o,o as s,y as c}from"./createReactComponent-_L2mp4Ui.js";import{t as l}from"./utils-C8DGLIgm.js";import{t as u}from"./IconX-BQkA009b.js";import{A as d,E as f,T as p,b as m,m as h,o as g}from"./removable-BfDesq3B.js";import{c as _,l as v}from"./getDisabledMountTransitionStyles-BYKRz4ha.js";import{t as y}from"./useBaseUiId-BLFGpnYJ.js";import{c as b}from"./getPseudoElementBounds-InhM-dWf.js";import{G as x,K as S,U as C,V as w}from"./index-ClzxEm7R.js";import{a as T,c as E,i as D,n as O,o as k,r as A,s as j,t as M}from"./DialogTitle-CzRmdOOz.js";var N=class extends d{#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),p(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&h(t.mutationKey)!==h(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}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??S();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){g.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)})})}},P=e(t(),1);function F(e,t){let n=x(t),[r]=P.useState(()=>new N(n,e));P.useEffect(()=>{r.setOptions(e)},[r,e]);let i=P.useSyncExternalStore(P.useCallback(e=>r.subscribe(g.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=P.useCallback((e,t)=>{r.mutate(e,t).catch(m)},[r]);if(i.error&&f(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var I=P.forwardRef(function(e,t){let{render:n,className:r,disabled:o=!1,nativeButton:l=!0,id:u,payload:d,handle:f,...p}=e,m=E(!0),h=f?.store??m?.store;if(!h)throw Error(c(79));let g=y(u),x=h.useState(`floatingRootContext`),S=h.useState(`isOpenedByTrigger`,g),C=P.useRef(null),{registerTrigger:T,isMountedByThisTrigger:D}=w(g,C,h,{payload:d}),{getButtonProps:O,buttonRef:k}=a({disabled:o,native:l}),A=v([b(x,{enabled:x!=null})]),j=P.useMemo(()=>({disabled:o,open:S}),[o,S]),M=h.useState(`triggerProps`,D);return i(`button`,e,{state:j,ref:[k,t,T,C],props:[A.getReferenceProps(),M,{[s]:``,id:g},p,O],stateAttributesMapping:_})}),L=r(),R=n();function z(e){let t=(0,L.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(O,{"data-slot":`dialog`,...n}),t[2]=n,t[3]=r),r}function B(e){let t=(0,L.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(I,{"data-slot":`dialog-trigger`,...n}),t[2]=n,t[3]=r),r}function V(e){let t=(0,L.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,R.jsx)(A,{"data-slot":`dialog-portal`,...n}),t[2]=n,t[3]=r),r}function H(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(j,{"data-slot":`dialog-overlay`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function U(e){let t=(0,L.c)(20),n,r,i,a,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],s=t[5]):({className:r,children:n,showCloseButton:s,overlayClassName:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=s);let c=s===void 0?!0:s,d;t[6]===i?d=t[7]:(d=(0,R.jsx)(H,{className:i}),t[6]=i,t[7]=d);let f;t[8]===r?f=t[9]:(f=l(`bg-background data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 ring-foreground/10 grid max-w-[calc(100%-2rem)] gap-4 rounded-xl p-4 text-sm ring-1 duration-100 sm:max-w-sm fixed top-1/2 left-1/2 z-50 w-full -translate-x-1/2 -translate-y-1/2 outline-none`,r),t[8]=r,t[9]=f);let p;t[10]===c?p=t[11]:(p=c&&(0,R.jsxs)(k,{"data-slot":`dialog-close`,render:(0,R.jsx)(o,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`}),children:[(0,R.jsx)(u,{}),(0,R.jsx)(`span`,{className:`sr-only`,children:`Close`})]}),t[10]=c,t[11]=p);let m;t[12]!==n||t[13]!==a||t[14]!==f||t[15]!==p?(m=(0,R.jsxs)(D,{"data-slot":`dialog-content`,className:f,...a,children:[n,p]}),t[12]=n,t[13]=a,t[14]=f,t[15]=p,t[16]=m):m=t[16];let h;return t[17]!==d||t[18]!==m?(h=(0,R.jsxs)(V,{children:[d,m]}),t[17]=d,t[18]=m,t[19]=h):h=t[19],h}function W(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`gap-2 flex flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(`div`,{"data-slot":`dialog-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function G(e){let t=(0,L.c)(14),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,showCloseButton:a,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let s=a===void 0?!1:a,c;t[5]===r?c=t[6]:(c=l(`bg-muted/50 -mx-4 -mb-4 rounded-b-xl border-t p-4 flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,r),t[5]=r,t[6]=c);let u;t[7]===s?u=t[8]:(u=s&&(0,R.jsx)(k,{render:(0,R.jsx)(o,{variant:`outline`}),children:`Close`}),t[7]=s,t[8]=u);let d;return t[9]!==n||t[10]!==i||t[11]!==c||t[12]!==u?(d=(0,R.jsxs)(`div`,{"data-slot":`dialog-footer`,className:c,...i,children:[n,u]}),t[9]=n,t[10]=i,t[11]=c,t[12]=u,t[13]=d):d=t[13],d}function K(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`text-sm leading-none font-medium`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(M,{"data-slot":`dialog-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function q(e){let t=(0,L.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=l(`text-muted-foreground *:[a]:hover:text-foreground text-sm *:[a]:underline *:[a]:underline-offset-3`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,R.jsx)(T,{"data-slot":`dialog-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function J(e){let t=(0,L.c)(27),{mutationFn:n,queryKey:r,optimisticUpdate:i,onSuccess:a,onError:o,successMessage:s,errorMessage:c}=e,l=x(),u;t[0]!==c||t[1]!==o||t[2]!==l||t[3]!==r?(u=(e,t,n)=>{n?.previousData!==void 0&&l.setQueryData(r,n.previousData);let i=c??(e.message?e.message:`Operation failed`);C.error(i),o?.(e,t)},t[0]=c,t[1]=o,t[2]=l,t[3]=r,t[4]=u):u=t[4];let d;t[5]!==i||t[6]!==l||t[7]!==r?(d=async e=>{await l.cancelQueries({queryKey:r});let t=l.getQueryData(r);return t!==void 0&&l.setQueryData(r,t=>t===void 0?t:i(t,e)),{previousData:t}},t[5]=i,t[6]=l,t[7]=r,t[8]=d):d=t[8];let f;t[9]!==l||t[10]!==r?(f=()=>{l.invalidateQueries({queryKey:r})},t[9]=l,t[10]=r,t[11]=f):f=t[11];let p;t[12]!==a||t[13]!==s?(p=(e,t)=>{s&&C.success(s),a?.(e,t)},t[12]=a,t[13]=s,t[14]=p):p=t[14];let m;t[15]!==n||t[16]!==u||t[17]!==d||t[18]!==f||t[19]!==p?(m={mutationFn:n,onError:u,onMutate:d,onSettled:f,onSuccess:p},t[15]=n,t[16]=u,t[17]=d,t[18]=f,t[19]=p,t[20]=m):m=t[20];let h=F(m),g=h.mutate,_=h.mutateAsync,v;return t[21]!==h.isError||t[22]!==h.isPending||t[23]!==h.isSuccess||t[24]!==g||t[25]!==_?(v={isError:h.isError,isPending:h.isPending,isSuccess:h.isSuccess,mutate:g,mutateAsync:_},t[21]=h.isError,t[22]=h.isPending,t[23]=h.isSuccess,t[24]=g,t[25]=_,t[26]=v):v=t[26],v}function Y({mutationFn:e,queryKey:t,itemId:n,getId:r=e=>e.id,onSuccess:i,onError:a,successMessage:o,errorMessage:s=`Failed to delete`}){return J({errorMessage:s,mutationFn:async()=>e(),onError:a?e=>a(e):void 0,onSuccess:i?e=>i(e):void 0,optimisticUpdate:e=>e.filter(e=>r(e)!==n),queryKey:t,successMessage:o})}function X(e){let t=(0,L.c)(10),{mutationFn:n,queryKey:r,createOptimisticItem:i,onSuccess:a,onError:o,successMessage:s,errorMessage:c}=e,l;t[0]===i?l=t[1]:(l=(e,t)=>[...e,i(t)],t[0]=i,t[1]=l);let u;return t[2]!==c||t[3]!==n||t[4]!==o||t[5]!==a||t[6]!==r||t[7]!==s||t[8]!==l?(u={errorMessage:c,mutationFn:n,onError:o,onSuccess:a,optimisticUpdate:l,queryKey:r,successMessage:s},t[2]=c,t[3]=n,t[4]=o,t[5]=a,t[6]=r,t[7]=s,t[8]=l,t[9]=u):u=t[9],J(u)}export{q as a,K as c,U as i,B as l,Y as n,G as o,z as r,W as s,X as t,F as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{A as r,C as i,E as a,O as o,S as s,T as c,_ as l,b as u,c as d,g as f,k as p,o as m,s as h,w as g}from"./removable-BfDesq3B.js";import{
|
|
1
|
+
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{A as r,C as i,E as a,O as o,S as s,T as c,_ as l,b as u,c as d,g as f,k as p,o as m,s as h,w as g}from"./removable-BfDesq3B.js";import{G as _,q as v}from"./index-ClzxEm7R.js";var y=class extends r{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=h(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),x(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return S(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return S(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 i(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&&!c(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&C(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||g(this.options.staleTime,this.#t)!==g(t.staleTime,this.#t))&&this.#g();let a=this.#_();r&&(this.#t!==n||i(this.options.enabled,this.#t)!==i(t.enabled,this.#t)||a!==this.#p)&&this.#v(a)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return T(this,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),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.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);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(u)),t}#g(){this.#b();let e=g(this.options.staleTime,this.#t);if(f||this.#r.isStale||!l(e))return;let t=o(this.#r.dataUpdatedAt,e)+1;this.#d=p.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(f||i(this.options.enabled,this.#t)===!1||!l(this.#p)||this.#p===0)&&(this.#f=p.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d&&=(p.clearTimeout(this.#d),void 0)}#x(){this.#f&&=(p.clearInterval(this.#f),void 0)}createResult(e,t){let n=this.#t,r=this.options,a=this.#r,o=this.#i,c=this.#a,l=e===n?this.#n:e.state,{state:u}=e,d={...u},f=!1,p;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&x(e,t),o=i&&C(e,n,t,r);(a||o)&&(d={...d,...v(u.data,e.options)}),t._optimisticResults===`isRestoring`&&(d.fetchStatus=`idle`)}let{error:m,errorUpdatedAt:g,status:_}=d;p=d.data;let y=!1;if(t.placeholderData!==void 0&&p===void 0&&_===`pending`){let e;a?.isPlaceholderData&&t.placeholderData===c?.placeholderData?(e=a.data,y=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(_=`success`,p=s(a?.data,e,t),f=!0)}if(t.select&&p!==void 0&&!y)if(a&&p===o?.data&&t.select===this.#c)p=this.#l;else try{this.#c=t.select,p=t.select(p),p=s(a?.data,p,t),this.#l=p,this.#s=null}catch(e){this.#s=e}this.#s&&(m=this.#s,p=this.#l,g=Date.now(),_=`error`);let b=d.fetchStatus===`fetching`,S=_===`pending`,T=_===`error`,E=S&&b,D=p!==void 0,O={status:_,fetchStatus:d.fetchStatus,isPending:S,isSuccess:_===`success`,isError:T,isInitialLoading:E,isLoading:E,data:p,dataUpdatedAt:d.dataUpdatedAt,error:m,errorUpdatedAt:g,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>l.dataUpdateCount||d.errorUpdateCount>l.errorUpdateCount,isFetching:b,isRefetching:b&&!S,isLoadingError:T&&!D,isPaused:d.fetchStatus===`paused`,isPlaceholderData:f,isRefetchError:T&&D,isStale:w(e,t),refetch:this.refetch,promise:this.#o,isEnabled:i(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=O.data!==void 0,r=O.status===`error`&&!t,i=e=>{r?e.reject(O.error):t&&e.resolve(O.data)},a=()=>{i(this.#o=O.promise=h())},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||O.data!==o.value)&&a();break;case`rejected`:(!r||O.error!==o.reason)&&a();break}}return O}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!c(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);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)})})()}))}#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()}#C(e){m.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function b(e,t){return i(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status===`error`&&t.retryOnMount===!1)}function x(e,t){return b(e,t)||e.state.data!==void 0&&S(e,t,t.refetchOnMount)}function S(e,t,n){if(i(t.enabled,e)!==!1&&g(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&w(e,t)}return!1}function C(e,t,n,r){return(e!==t||i(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&w(e,n)}function w(e,t){return i(t.enabled,e)!==!1&&e.isStaleByTime(g(t.staleTime,e))}function T(e,t){return!c(e.getCurrentResult(),t)}var E=e(t(),1),D=E.createContext(!1),O=()=>E.useContext(D);D.Provider,n();function k(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var A=E.createContext(k()),j=()=>E.useContext(A),M=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?a(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},N=e=>{E.useEffect(()=>{e.clearReset()},[e])},P=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||a(n,[e.error,r])),F=(e,t)=>t.state.data===void 0,I=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))}},L=(e,t)=>e.isLoading&&e.isFetching&&!t,R=(e,t)=>e?.suspense&&t.isPending,z=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function B(e,t,n){let r=O(),i=j(),a=_(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash);o._optimisticResults=r?`isRestoring`:`optimistic`,I(o),M(o,i,s),N(i);let c=!a.getQueryCache().get(o.queryHash),[l]=E.useState(()=>new t(a,o)),d=l.getOptimisticResult(o),p=!r&&e.subscribed!==!1;if(E.useSyncExternalStore(E.useCallback(e=>{let t=p?l.subscribe(m.batchCalls(e)):u;return l.updateResult(),t},[l,p]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),E.useEffect(()=>{l.setOptions(o)},[o,l]),R(o,d))throw z(o,l,i);if(P({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!f&&L(d,r)&&(c?z(o,l,i):s?.promise)?.catch(u).finally(()=>{l.updateResult()}),o.notifyOnChangeProps?d:l.trackResult(d)}export{F as n,y as r,B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,t}from"./useBaseQuery-DXS4_Zkx.js";function n(n,r){return t(n,e,r)}export{n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./useBaseQuery-DXS4_Zkx.js";function r(r,i){return n({...r,enabled:!0,suspense:!0,throwOnError:e,placeholderData:void 0},t,i)}export{r as t};
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
})();
|
|
20
20
|
</script>
|
|
21
|
-
<script type="module" crossorigin src="/assets/index-
|
|
21
|
+
<script type="module" crossorigin src="/assets/index-ClzxEm7R.js"></script>
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/jsx-runtime-DG_AJzB_.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/useRouterState-DpT8luFk.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/link-Cgvqhh5w.js">
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/schemas-n4sxh6jF.js">
|
|
40
40
|
<link rel="modulepreload" crossorigin href="/assets/src-DCIPwIx0.js">
|
|
41
41
|
<link rel="modulepreload" crossorigin href="/assets/organization-permissions-BQQ5PJbI.js">
|
|
42
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
42
|
+
<link rel="stylesheet" crossorigin href="/assets/index-BBPJeil4.css">
|
|
43
43
|
</head>
|
|
44
44
|
<body>
|
|
45
45
|
<div id="root"></div>
|
|
@@ -121527,12 +121527,15 @@ const textEncoder = new TextEncoder();
|
|
|
121527
121527
|
const displayUnitSegmenter = typeof Intl !== "undefined" && typeof Intl.Segmenter === "function" ? new Intl.Segmenter(void 0, { granularity: "grapheme" }) : null;
|
|
121528
121528
|
function resolveQueryResultWindow(input) {
|
|
121529
121529
|
return {
|
|
121530
|
-
cellMaxChars: input.cellMaxChars
|
|
121531
|
-
maxBytes: input.maxBytes
|
|
121532
|
-
maxRows: input.maxRows
|
|
121533
|
-
timeoutMs: input.timeoutMs
|
|
121530
|
+
cellMaxChars: positiveQueryWindowValueOrDefault(input.cellMaxChars, CLI_DEFAULT_QUERY_CELL_MAX_CHARS),
|
|
121531
|
+
maxBytes: positiveQueryWindowValueOrDefault(input.maxBytes, CLI_DEFAULT_QUERY_MAX_BYTES),
|
|
121532
|
+
maxRows: positiveQueryWindowValueOrDefault(input.maxRows, CLI_DEFAULT_QUERY_MAX_ROWS),
|
|
121533
|
+
timeoutMs: positiveQueryWindowValueOrDefault(input.timeoutMs, CLI_DEFAULT_QUERY_TIMEOUT_MS)
|
|
121534
121534
|
};
|
|
121535
121535
|
}
|
|
121536
|
+
function positiveQueryWindowValueOrDefault(value, defaultValue) {
|
|
121537
|
+
return value !== void 0 && value > 0 ? value : defaultValue;
|
|
121538
|
+
}
|
|
121536
121539
|
function applyQueryResultWindow(input) {
|
|
121537
121540
|
let truncated = false;
|
|
121538
121541
|
let rows = input.rows;
|
|
@@ -121758,6 +121761,21 @@ function createCliConnectQueryFailureProblem(input) {
|
|
|
121758
121761
|
});
|
|
121759
121762
|
}
|
|
121760
121763
|
//#endregion
|
|
121764
|
+
//#region packages/cli-server/src/connect/service/query/request.ts
|
|
121765
|
+
function parseCliQueryRequest(query) {
|
|
121766
|
+
const cellMaxChars = isFieldSet(query, CliQueryRequestSchema.field.cellMaxChars) ? query.cellMaxChars : void 0;
|
|
121767
|
+
const maxBytes = isFieldSet(query, CliQueryRequestSchema.field.maxBytes) ? query.maxBytes : void 0;
|
|
121768
|
+
const maxRows = isFieldSet(query, CliQueryRequestSchema.field.maxRows) ? query.maxRows : void 0;
|
|
121769
|
+
const timeoutMs = isFieldSet(query, CliQueryRequestSchema.field.timeoutMs) ? query.timeoutMs : void 0;
|
|
121770
|
+
return {
|
|
121771
|
+
sql: query.sql,
|
|
121772
|
+
...cellMaxChars !== void 0 ? { cellMaxChars } : {},
|
|
121773
|
+
...maxBytes !== void 0 ? { maxBytes } : {},
|
|
121774
|
+
...maxRows !== void 0 ? { maxRows } : {},
|
|
121775
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {}
|
|
121776
|
+
};
|
|
121777
|
+
}
|
|
121778
|
+
//#endregion
|
|
121761
121779
|
//#region packages/cli-server/src/connect/service/query/context.ts
|
|
121762
121780
|
init_dist$3();
|
|
121763
121781
|
async function resolveCliQueryRequestState(request, context) {
|
|
@@ -121769,7 +121787,7 @@ async function resolveCliQueryRequestState(request, context) {
|
|
|
121769
121787
|
orgSlug: request.orgSlug,
|
|
121770
121788
|
session
|
|
121771
121789
|
}));
|
|
121772
|
-
const query = request.query;
|
|
121790
|
+
const query = parseCliQueryRequest(request.query);
|
|
121773
121791
|
return U$1.ok({
|
|
121774
121792
|
authorizedOrg,
|
|
121775
121793
|
c: requestContext.honoContext,
|
|
@@ -252643,14 +252661,7 @@ function parseConnectSourceCredentials(credentials) {
|
|
|
252643
252661
|
});
|
|
252644
252662
|
case "awsAthenaConnector": return U$1.ok({
|
|
252645
252663
|
provider: "aws_athena_connector",
|
|
252646
|
-
credentials:
|
|
252647
|
-
type: "aws_athena_connector",
|
|
252648
|
-
connectorId: kind.value.connectorId,
|
|
252649
|
-
database: kind.value.database,
|
|
252650
|
-
...kind.value.maxRows !== void 0 ? { maxRows: kind.value.maxRows } : {},
|
|
252651
|
-
...kind.value.timeoutMs !== void 0 ? { timeoutMs: kind.value.timeoutMs } : {},
|
|
252652
|
-
...kind.value.workgroup ? { workgroup: kind.value.workgroup } : {}
|
|
252653
|
-
}
|
|
252664
|
+
credentials: awsAthenaConnectorCredentialsFromMessage(kind.value)
|
|
252654
252665
|
});
|
|
252655
252666
|
case "ga": return googleAnalyticsCredentialsFromMessage(kind.value).map((parsed) => ({
|
|
252656
252667
|
provider: "ga",
|
|
@@ -252715,27 +252726,41 @@ function parseConnectSourceCredentials(credentials) {
|
|
|
252715
252726
|
}
|
|
252716
252727
|
}
|
|
252717
252728
|
function postgresCredentialsFromMessage(input) {
|
|
252729
|
+
const port = isFieldSet(input, ConnectSourcePostgresCredentialsSchema.field.port) ? input.port : void 0;
|
|
252718
252730
|
const sslMode = sslModeFromMessage(input.sslMode) ?? "prefer";
|
|
252719
252731
|
return {
|
|
252720
252732
|
database: input.database,
|
|
252721
252733
|
host: input.host,
|
|
252722
252734
|
password: input.password,
|
|
252723
|
-
port:
|
|
252735
|
+
port: port ?? 5432,
|
|
252724
252736
|
sslMode,
|
|
252725
252737
|
username: input.username
|
|
252726
252738
|
};
|
|
252727
252739
|
}
|
|
252728
252740
|
function mySqlCredentialsFromMessage(input) {
|
|
252741
|
+
const port = isFieldSet(input, ConnectSourceMySqlCredentialsSchema.field.port) ? input.port : void 0;
|
|
252729
252742
|
const sslMode = sslModeFromMessage(input.sslMode) ?? "prefer";
|
|
252730
252743
|
return {
|
|
252731
252744
|
database: input.database,
|
|
252732
252745
|
host: input.host,
|
|
252733
252746
|
password: input.password,
|
|
252734
|
-
port:
|
|
252747
|
+
port: port ?? 3306,
|
|
252735
252748
|
sslMode,
|
|
252736
252749
|
username: input.username
|
|
252737
252750
|
};
|
|
252738
252751
|
}
|
|
252752
|
+
function awsAthenaConnectorCredentialsFromMessage(input) {
|
|
252753
|
+
const maxRows = isFieldSet(input, ConnectSourceAwsAthenaConnectorCredentialsSchema.field.maxRows) ? input.maxRows : void 0;
|
|
252754
|
+
const timeoutMs = isFieldSet(input, ConnectSourceAwsAthenaConnectorCredentialsSchema.field.timeoutMs) ? input.timeoutMs : void 0;
|
|
252755
|
+
return {
|
|
252756
|
+
type: "aws_athena_connector",
|
|
252757
|
+
connectorId: input.connectorId,
|
|
252758
|
+
database: input.database,
|
|
252759
|
+
...maxRows !== void 0 ? { maxRows } : {},
|
|
252760
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
252761
|
+
...input.workgroup ? { workgroup: input.workgroup } : {}
|
|
252762
|
+
};
|
|
252763
|
+
}
|
|
252739
252764
|
function bigQueryCredentialsFromMessage(input) {
|
|
252740
252765
|
switch (input.auth.case) {
|
|
252741
252766
|
case "oauth": {
|
|
@@ -259933,11 +259958,26 @@ const AUDIT_ACTION_NAMES = [
|
|
|
259933
259958
|
"describe",
|
|
259934
259959
|
"invoke"
|
|
259935
259960
|
];
|
|
259961
|
+
const AUDIT_ACTION_NAMES_BY_FAMILY = {
|
|
259962
|
+
query_action: ["validate", "execute"],
|
|
259963
|
+
source_api_action: ["describe", "invoke"]
|
|
259964
|
+
};
|
|
259936
259965
|
const AUDIT_OUTCOMES = [
|
|
259937
259966
|
"pending",
|
|
259938
259967
|
"succeeded",
|
|
259939
259968
|
"failed"
|
|
259940
259969
|
];
|
|
259970
|
+
function isAuditActionNameCompatibleWithFamily(family, actionName) {
|
|
259971
|
+
if (!family || !actionName) return true;
|
|
259972
|
+
return AUDIT_ACTION_NAMES_BY_FAMILY[family].includes(actionName);
|
|
259973
|
+
}
|
|
259974
|
+
function sanitizeAuditSearch(search) {
|
|
259975
|
+
if (isAuditActionNameCompatibleWithFamily(search.family, search.actionName)) return search;
|
|
259976
|
+
return {
|
|
259977
|
+
...search,
|
|
259978
|
+
actionName: void 0
|
|
259979
|
+
};
|
|
259980
|
+
}
|
|
259941
259981
|
const AUDIT_QUERY_ACTION_PHASES = [
|
|
259942
259982
|
"load_source",
|
|
259943
259983
|
"validate_query",
|
|
@@ -260032,7 +260072,7 @@ const outcomeSearchSchema = preprocess$1((value) => {
|
|
|
260032
260072
|
const trimmed = value.trim();
|
|
260033
260073
|
return trimmed.length === 0 ? void 0 : trimmed;
|
|
260034
260074
|
}, _enum$2(AUDIT_OUTCOMES));
|
|
260035
|
-
const
|
|
260075
|
+
const auditSearchShape = {
|
|
260036
260076
|
actionName: actionNameSearchSchema.optional(),
|
|
260037
260077
|
cursor: cursorSearchSchema.optional(),
|
|
260038
260078
|
family: familySearchSchema.optional(),
|
|
@@ -260040,8 +260080,9 @@ const auditSearchSchema = object$1({
|
|
|
260040
260080
|
outcome: outcomeSearchSchema.optional(),
|
|
260041
260081
|
q: trimmedSearchStringSchema.optional(),
|
|
260042
260082
|
sourceKey: trimmedSearchStringSchema.optional()
|
|
260043
|
-
}
|
|
260044
|
-
const
|
|
260083
|
+
};
|
|
260084
|
+
const auditSearchSchema = object$1(auditSearchShape).transform(sanitizeAuditSearch);
|
|
260085
|
+
const auditListQueryShape = {
|
|
260045
260086
|
actionName: actionNameSearchSchema.optional(),
|
|
260046
260087
|
cursor: cursorSearchSchema.optional(),
|
|
260047
260088
|
family: familySearchSchema.optional(),
|
|
@@ -260049,7 +260090,8 @@ const auditListQuerySchema = object$1({
|
|
|
260049
260090
|
outcome: outcomeSearchSchema.optional(),
|
|
260050
260091
|
q: trimmedSearchStringSchema.optional(),
|
|
260051
260092
|
sourceKey: trimmedSearchStringSchema.optional()
|
|
260052
|
-
}
|
|
260093
|
+
};
|
|
260094
|
+
const auditListQuerySchema = object$1(auditListQueryShape).transform(sanitizeAuditSearch);
|
|
260053
260095
|
const auditOriginActorSchema = object$1({
|
|
260054
260096
|
authMode: string$3().nullable(),
|
|
260055
260097
|
email: string$3().nullable(),
|
|
@@ -260125,10 +260167,15 @@ const auditProjectedThroughSchema = object$1({
|
|
|
260125
260167
|
queryAction: string$3().nullable(),
|
|
260126
260168
|
sourceApiAction: string$3().nullable()
|
|
260127
260169
|
}).strict();
|
|
260170
|
+
const auditProjectionLagSchema = object$1({
|
|
260171
|
+
queryAction: boolean$4(),
|
|
260172
|
+
sourceApiAction: boolean$4()
|
|
260173
|
+
}).strict();
|
|
260128
260174
|
const auditListResponseSchema = object$1({
|
|
260129
260175
|
families: array$1(_enum$2(AUDIT_FAMILIES)),
|
|
260130
260176
|
items: array$1(auditListItemSchema),
|
|
260131
260177
|
nextCursor: string$3().nullable(),
|
|
260178
|
+
projectionLag: auditProjectionLagSchema,
|
|
260132
260179
|
projectedThrough: auditProjectedThroughSchema
|
|
260133
260180
|
}).strict();
|
|
260134
260181
|
//#endregion
|
|
@@ -260842,7 +260889,7 @@ function parseStoredQueryActionRow(row) {
|
|
|
260842
260889
|
actionName: row.actionName === "validate" || row.actionName === "execute" ? row.actionName : (() => {
|
|
260843
260890
|
throw new Error(`invalid query_action action name: ${row.actionName}`);
|
|
260844
260891
|
})(),
|
|
260845
|
-
completedAt: row.completedAt
|
|
260892
|
+
completedAt: row.completedAt,
|
|
260846
260893
|
failureCode: row.failureCode === null ? null : row.failureCode,
|
|
260847
260894
|
family: "query_action",
|
|
260848
260895
|
familyActionId: row.familyActionId,
|
|
@@ -260865,7 +260912,7 @@ function parseStoredSourceApiActionRow(row) {
|
|
|
260865
260912
|
actionName: row.actionName === "describe" || row.actionName === "invoke" ? row.actionName : (() => {
|
|
260866
260913
|
throw new Error(`invalid source_api_action action name: ${row.actionName}`);
|
|
260867
260914
|
})(),
|
|
260868
|
-
completedAt: row.completedAt
|
|
260915
|
+
completedAt: row.completedAt,
|
|
260869
260916
|
failureCode: row.failureCode === null ? null : row.failureCode,
|
|
260870
260917
|
family: "source_api_action",
|
|
260871
260918
|
familyActionId: row.familyActionId,
|
|
@@ -261078,26 +261125,50 @@ async function syncAuditFeedProjection(db) {
|
|
|
261078
261125
|
const sourceAdvanced = await db.transaction((tx) => advanceSourceApiActionProjectionBatch(tx));
|
|
261079
261126
|
if (!queryAdvanced && !sourceAdvanced) break;
|
|
261080
261127
|
}
|
|
261081
|
-
return loadAuditProjectedThrough(db);
|
|
261082
261128
|
}
|
|
261083
|
-
|
|
261084
|
-
|
|
261085
|
-
|
|
261086
|
-
|
|
261087
|
-
}
|
|
261129
|
+
function serializeAuditProjectedThrough(checkpoints) {
|
|
261130
|
+
return {
|
|
261131
|
+
queryAction: checkpoints.queryAction === null ? null : checkpoints.queryAction.toString(),
|
|
261132
|
+
sourceApiAction: checkpoints.sourceApiAction === null ? null : checkpoints.sourceApiAction.toString()
|
|
261133
|
+
};
|
|
261134
|
+
}
|
|
261135
|
+
function normalizeAuditProjectionCheckpointSnapshot(checkpoints) {
|
|
261136
|
+
return {
|
|
261137
|
+
queryAction: checkpoints.queryAction ?? 0n,
|
|
261138
|
+
sourceApiAction: checkpoints.sourceApiAction ?? 0n
|
|
261139
|
+
};
|
|
261140
|
+
}
|
|
261141
|
+
async function loadAuditProjectionCheckpointSnapshot(db) {
|
|
261088
261142
|
const checkpoints = {
|
|
261089
261143
|
queryAction: null,
|
|
261090
261144
|
sourceApiAction: null
|
|
261091
261145
|
};
|
|
261146
|
+
const rows = await db.select({
|
|
261147
|
+
family: auditProjectionCheckpoints.family,
|
|
261148
|
+
lastCommitPosition: auditProjectionCheckpoints.lastCommitPosition
|
|
261149
|
+
}).from(auditProjectionCheckpoints).where(eq(auditProjectionCheckpoints.projectionName, AUDIT_FEED_PROJECTION_NAME));
|
|
261092
261150
|
for (const row of rows) {
|
|
261093
261151
|
if (row.family === "query_action") {
|
|
261094
|
-
checkpoints.queryAction = row.lastCommitPosition
|
|
261152
|
+
checkpoints.queryAction = row.lastCommitPosition;
|
|
261095
261153
|
continue;
|
|
261096
261154
|
}
|
|
261097
|
-
if (row.family === "source_api_action") checkpoints.sourceApiAction = row.lastCommitPosition
|
|
261155
|
+
if (row.family === "source_api_action") checkpoints.sourceApiAction = row.lastCommitPosition;
|
|
261098
261156
|
}
|
|
261099
261157
|
return checkpoints;
|
|
261100
261158
|
}
|
|
261159
|
+
async function hasUnprojectedQueryActionEvents(db, lastCommitPosition, organizationId) {
|
|
261160
|
+
return (await db.select({ eventId: queryActionEvents.id }).from(queryActionEvents).innerJoin(workflowCommands, eq(workflowCommands.id, queryActionEvents.commandId)).where(and(gt(queryActionEvents.commitPosition, lastCommitPosition), eq(workflowCommands.organizationId, organizationId))).limit(1)).length > 0;
|
|
261161
|
+
}
|
|
261162
|
+
async function hasUnprojectedSourceApiActionEvents(db, lastCommitPosition, organizationId) {
|
|
261163
|
+
return (await db.select({ eventId: sourceApiActionEvents.id }).from(sourceApiActionEvents).innerJoin(workflowCommands, eq(workflowCommands.id, sourceApiActionEvents.commandId)).where(and(gt(sourceApiActionEvents.commitPosition, lastCommitPosition), eq(workflowCommands.organizationId, organizationId))).limit(1)).length > 0;
|
|
261164
|
+
}
|
|
261165
|
+
async function loadAuditProjectionLag(db, checkpoints, organizationId) {
|
|
261166
|
+
const [queryAction, sourceApiAction] = await Promise.all([hasUnprojectedQueryActionEvents(db, checkpoints.queryAction, organizationId), hasUnprojectedSourceApiActionEvents(db, checkpoints.sourceApiAction, organizationId)]);
|
|
261167
|
+
return {
|
|
261168
|
+
queryAction,
|
|
261169
|
+
sourceApiAction
|
|
261170
|
+
};
|
|
261171
|
+
}
|
|
261101
261172
|
function serializeAuditFeedItem(row) {
|
|
261102
261173
|
const originActor = auditOriginActorSchema.parse(row.originActorJson);
|
|
261103
261174
|
const target = auditTargetSchema.parse(row.targetJson);
|
|
@@ -261171,7 +261242,10 @@ function serializeAuditFeedItem(row) {
|
|
|
261171
261242
|
};
|
|
261172
261243
|
}
|
|
261173
261244
|
async function listAuditFeedPage(input) {
|
|
261174
|
-
|
|
261245
|
+
await syncAuditFeedProjection(input.db);
|
|
261246
|
+
const checkpointSnapshot = await loadAuditProjectionCheckpointSnapshot(input.db);
|
|
261247
|
+
const projectedThrough = serializeAuditProjectedThrough(checkpointSnapshot);
|
|
261248
|
+
const projectionLag = await loadAuditProjectionLag(input.db, normalizeAuditProjectionCheckpointSnapshot(checkpointSnapshot), input.organizationId);
|
|
261175
261249
|
const conditions = [eq(auditFeedEntries.organizationId, input.organizationId)];
|
|
261176
261250
|
if (input.query.family) conditions.push(eq(auditFeedEntries.family, input.query.family));
|
|
261177
261251
|
if (input.query.actionName) conditions.push(eq(auditFeedEntries.actionName, input.query.actionName));
|
|
@@ -261197,6 +261271,7 @@ async function listAuditFeedPage(input) {
|
|
|
261197
261271
|
familyActionId: lastRow.familyActionId,
|
|
261198
261272
|
startedAt: lastRow.startedAt
|
|
261199
261273
|
}) : null,
|
|
261274
|
+
projectionLag,
|
|
261200
261275
|
projectedThrough
|
|
261201
261276
|
});
|
|
261202
261277
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{a as i,o as a}from"./api-base-url-DIb6qukm.js";import{n as o,t as s}from"./createReactComponent-_L2mp4Ui.js";import{t as c}from"./IconArrowRight-DsOD7mDl.js";import{a as l,i as u,n as d,r as f,t as p}from"./select-D6km4Obp.js";import{t as m}from"./IconHistory-BqAd-xl2.js";import{t as h}from"./useSuspenseQuery-Bn7lFvcg.js";import{i as g,n as _,r as v,t as y}from"./index-e4SV9LPn.js";import{t as b}from"./input-CG_cIxvO.js";import{n as x}from"./format-date-Ctrh7my1.js";import{t as ee}from"./badge-C1_ZMBRy.js";import{a as S,i as C,n as w,r as T,t as E}from"./empty-COnWCwda.js";import{t as D}from"./label-CWOhoN_L.js";import{a as O,i as k,n as A,o as te,r as j,t as M}from"./table-DCvfJyLS.js";var N=s(`outline`,`arrow-left`,`ArrowLeft`,[[`path`,{d:`M5 12l14 0`,key:`svg-0`}],[`path`,{d:`M5 12l6 6`,key:`svg-1`}],[`path`,{d:`M5 12l6 -6`,key:`svg-2`}]]),ne=r(),P=e(t(),1),F=n(),I=i(`/_authenticated/$org_slug/audit`);function L(e){return e.split(`_`).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function re(e){let t=e.trim();return t.length>0?t:void 0}function R(e,t=160){return e.length<=t?e:`${e.slice(0,t-1)}…`}function ie(e){return e===`succeeded`?`secondary`:e===`pending`?`outline`:`destructive`}function ae(e){return e.originActor.email??`System`}function oe(e){return e.family===`query_action`?[e.metrics?.elapsedMs!==null&&e.metrics?.elapsedMs!==void 0?`${e.metrics.elapsedMs} ms`:null,e.metrics?.rowCount!==null&&e.metrics?.rowCount!==void 0?`${e.metrics.rowCount} rows`:null].filter(Boolean).join(` · `):[e.metrics?.pageCount!==null&&e.metrics?.pageCount!==void 0?`${e.metrics.pageCount} pages`:null,e.metrics?.httpStatus!==null&&e.metrics?.httpStatus!==void 0?`HTTP ${e.metrics.httpStatus}`:null].filter(Boolean).join(` · `)}function se(e){return e.family===`query_action`?R(e.preview?.queryText??e.subtitle):R([e.preview?.method,e.preview?.selector].filter(Boolean).join(` `)||e.subtitle)}function ce(e){let t=(0,ne.c)(74),{item:n}=e,r;t[0]===n?r=t[1]:(r=oe(n),t[0]=n,t[1]=r);let i=r,a;t[2]===n.startedAt?a=t[3]:(a=x(n.startedAt),t[2]=n.startedAt,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,F.jsx)(`div`,{className:`font-medium`,children:a}),t[4]=a,t[5]=o);let s;t[6]===n.originSurface?s=t[7]:(s=L(n.originSurface),t[6]=n.originSurface,t[7]=s);let c;t[8]===s?c=t[9]:(c=(0,F.jsxs)(`div`,{className:`text-muted-foreground mt-1 text-xs`,children:[`Started · `,s]}),t[8]=s,t[9]=c);let l;t[10]!==n.lastEventAt||t[11]!==n.startedAt?(l=n.lastEventAt===n.startedAt?null:(0,F.jsxs)(`div`,{className:`text-muted-foreground mt-1 text-xs`,children:[`Last event · `,x(n.lastEventAt)]}),t[10]=n.lastEventAt,t[11]=n.startedAt,t[12]=l):l=t[12];let u;t[13]!==o||t[14]!==c||t[15]!==l?(u=(0,F.jsx)(j,{className:`align-top`,children:(0,F.jsxs)(`div`,{className:`min-w-[170px]`,children:[o,c,l]})}),t[13]=o,t[14]=c,t[15]=l,t[16]=u):u=t[16];let d;t[17]===n?d=t[18]:(d=ae(n),t[17]=n,t[18]=d);let f;t[19]===d?f=t[20]:(f=(0,F.jsx)(`div`,{className:`font-medium`,children:d}),t[19]=d,t[20]=f);let p;t[21]===n.originActor.membershipRoles?p=t[22]:(p=n.originActor.membershipRoles.length>0?n.originActor.membershipRoles.map(L).join(`, `):`No membership roles recorded`,t[21]=n.originActor.membershipRoles,t[22]=p);let m;t[23]===p?m=t[24]:(m=(0,F.jsx)(`div`,{className:`text-muted-foreground mt-1 text-xs`,children:p}),t[23]=p,t[24]=m);let h;t[25]!==m||t[26]!==f?(h=(0,F.jsxs)(j,{className:`align-top whitespace-normal`,children:[f,m]}),t[25]=m,t[26]=f,t[27]=h):h=t[27];let g;t[28]===n.family?g=t[29]:(g=L(n.family),t[28]=n.family,t[29]=g);let _;t[30]===g?_=t[31]:(_=(0,F.jsx)(ee,{variant:`outline`,children:g}),t[30]=g,t[31]=_);let v;t[32]===n.title?v=t[33]:(v=(0,F.jsx)(`span`,{className:`font-medium`,children:n.title}),t[32]=n.title,t[33]=v);let y;t[34]!==_||t[35]!==v?(y=(0,F.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[_,v]}),t[34]=_,t[35]=v,t[36]=y):y=t[36];let b;t[37]===n.subtitle?b=t[38]:(b=(0,F.jsx)(`div`,{className:`text-muted-foreground mt-2 text-sm`,children:n.subtitle}),t[37]=n.subtitle,t[38]=b);let S;t[39]===n?S=t[40]:(S=se(n),t[39]=n,t[40]=S);let C;t[41]===S?C=t[42]:(C=(0,F.jsx)(`div`,{className:`text-muted-foreground mt-2 text-xs font-mono break-words`,children:S}),t[41]=S,t[42]=C);let w;t[43]!==y||t[44]!==b||t[45]!==C?(w=(0,F.jsxs)(j,{className:`min-w-[420px] align-top whitespace-normal`,children:[y,b,C]}),t[43]=y,t[44]=b,t[45]=C,t[46]=w):w=t[46];let T;t[47]===n.outcome?T=t[48]:(T=ie(n.outcome),t[47]=n.outcome,t[48]=T);let E;t[49]===n.outcome?E=t[50]:(E=L(n.outcome),t[49]=n.outcome,t[50]=E);let D;t[51]!==T||t[52]!==E?(D=(0,F.jsx)(ee,{variant:T,children:E}),t[51]=T,t[52]=E,t[53]=D):D=t[53];let O;t[54]===n.phase?O=t[55]:(O=L(n.phase),t[54]=n.phase,t[55]=O);let k;t[56]===O?k=t[57]:(k=(0,F.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:O}),t[56]=O,t[57]=k);let A;t[58]===n.lastEventType?A=t[59]:(A=L(n.lastEventType),t[58]=n.lastEventType,t[59]=A);let M;t[60]===A?M=t[61]:(M=(0,F.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:A}),t[60]=A,t[61]=M);let N;t[62]===i?N=t[63]:(N=i?(0,F.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:i}):null,t[62]=i,t[63]=N);let P;t[64]!==D||t[65]!==k||t[66]!==M||t[67]!==N?(P=(0,F.jsx)(j,{className:`align-top whitespace-normal`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[D,k,M,N]})}),t[64]=D,t[65]=k,t[66]=M,t[67]=N,t[68]=P):P=t[68];let I;return t[69]!==h||t[70]!==w||t[71]!==P||t[72]!==u?(I=(0,F.jsxs)(te,{children:[u,h,w,P]}),t[69]=h,t[70]=w,t[71]=P,t[72]=u,t[73]=I):I=t[73],I}function le(){let e=(0,ne.c)(93),t=a(),{organizationSlug:n,session:r}=I.useRouteContext(),i=I.useSearch(),s;e[0]!==n||e[1]!==i||e[2]!==r.user.id?(s=y(r.user.id,n,i),e[0]=n,e[1]=i,e[2]=r.user.id,e[3]=s):s=e[3];let{data:x,isFetching:ee}=h(s),[j,L]=(0,P.useState)(i.q??``),[R,ie]=(0,P.useState)(i.sourceKey??``),ae,oe;e[4]===i.q?(ae=e[5],oe=e[6]):(ae=()=>{L(i.q??``)},oe=[i.q],e[4]=i.q,e[5]=ae,e[6]=oe),(0,P.useEffect)(ae,oe);let se,ce;e[7]===i.sourceKey?(se=e[8],ce=e[9]):(se=()=>{ie(i.sourceKey??``)},ce=[i.sourceKey],e[7]=i.sourceKey,e[8]=se,e[9]=ce),(0,P.useEffect)(se,ce);let le;e[10]!==t||e[11]!==n?(le=function(e){(0,P.startTransition)(()=>{t({params:{org_slug:n},replace:!0,search:t=>({...t,limit:t.limit,...e}),to:`/$org_slug/audit`})})},e[10]=t,e[11]=n,e[12]=le):le=e[12];let z=le,me;e[13]!==j||e[14]!==R||e[15]!==z?(me=function(e){e.preventDefault(),z({cursor:void 0,q:re(j),sourceKey:re(R)})},e[13]=j,e[14]=R,e[15]=z,e[16]=me):me=e[16];let he=me,ge;e[17]!==t||e[18]!==n||e[19]!==i.limit?(ge=function(){L(``),ie(``),(0,P.startTransition)(()=>{t({params:{org_slug:n},replace:!0,search:{actionName:void 0,cursor:void 0,family:void 0,limit:i.limit,outcome:void 0,q:void 0,sourceKey:void 0},to:`/$org_slug/audit`})})},e[17]=t,e[18]=n,e[19]=i.limit,e[20]=ge):ge=e[20];let _e=ge,ve;e[21]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,F.jsxs)(`div`,{children:[(0,F.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Audit`}),(0,F.jsx)(`p`,{className:`text-muted-foreground mt-2`,children:`One row per audited action across query and source API workflows. Ordered by action start time so pagination stays stable while actions continue to evolve.`})]}),e[21]=ve):ve=e[21];let ye;e[22]===Symbol.for(`react.memo_cache_sentinel`)?(ye=(0,F.jsx)(D,{htmlFor:`audit-search`,children:`Search`}),e[22]=ye):ye=e[22];let be;e[23]===Symbol.for(`react.memo_cache_sentinel`)?(be=e=>L(e.target.value),e[23]=be):be=e[23];let B;e[24]===j?B=e[25]:(B=(0,F.jsxs)(`div`,{className:`space-y-2`,children:[ye,(0,F.jsx)(b,{id:`audit-search`,value:j,onChange:be,placeholder:`Actor, query text, operation, or title`})]}),e[24]=j,e[25]=B);let xe;e[26]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,F.jsx)(D,{htmlFor:`audit-source-key`,children:`Source Key`}),e[26]=xe):xe=e[26];let Se;e[27]===Symbol.for(`react.memo_cache_sentinel`)?(Se=e=>ie(e.target.value),e[27]=Se):Se=e[27];let V;e[28]===R?V=e[29]:(V=(0,F.jsxs)(`div`,{className:`space-y-2`,children:[xe,(0,F.jsx)(b,{id:`audit-source-key`,value:R,onChange:Se,placeholder:`warehouse`})]}),e[28]=R,e[29]=V);let Ce;e[30]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,F.jsx)(D,{htmlFor:`audit-outcome`,children:`Outcome`}),e[30]=Ce):Ce=e[30];let we=i.outcome??`all`,H;e[31]===z?H=e[32]:(H=e=>{z({cursor:void 0,outcome:e&&e!==`all`?e:void 0})},e[31]=z,e[32]=H);let Te;e[33]===Symbol.for(`react.memo_cache_sentinel`)?(Te=(0,F.jsx)(u,{id:`audit-outcome`,className:`w-full`,children:(0,F.jsx)(l,{})}),e[33]=Te):Te=e[33];let Ee;e[34]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,F.jsxs)(d,{children:[(0,F.jsx)(f,{value:`all`,children:`All outcomes`}),g.map(pe)]}),e[34]=Ee):Ee=e[34];let U;e[35]!==we||e[36]!==H?(U=(0,F.jsxs)(`div`,{className:`space-y-2`,children:[Ce,(0,F.jsxs)(p,{value:we,onValueChange:H,children:[Te,Ee]})]}),e[35]=we,e[36]=H,e[37]=U):U=e[37];let De;e[38]===Symbol.for(`react.memo_cache_sentinel`)?(De=(0,F.jsx)(D,{htmlFor:`audit-family`,children:`Family`}),e[38]=De):De=e[38];let Oe=i.family??`all`,W;e[39]===z?W=e[40]:(W=e=>{z({cursor:void 0,family:e&&e!==`all`?e:void 0})},e[39]=z,e[40]=W);let ke;e[41]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,F.jsx)(u,{id:`audit-family`,className:`w-full`,children:(0,F.jsx)(l,{})}),e[41]=ke):ke=e[41];let Ae;e[42]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=(0,F.jsxs)(d,{children:[(0,F.jsx)(f,{value:`all`,children:`All families`}),v.map(fe)]}),e[42]=Ae):Ae=e[42];let G;e[43]!==Oe||e[44]!==W?(G=(0,F.jsxs)(`div`,{className:`space-y-2`,children:[De,(0,F.jsxs)(p,{value:Oe,onValueChange:W,children:[ke,Ae]})]}),e[43]=Oe,e[44]=W,e[45]=G):G=e[45];let je;e[46]===Symbol.for(`react.memo_cache_sentinel`)?(je=(0,F.jsx)(D,{htmlFor:`audit-action-name`,children:`Action`}),e[46]=je):je=e[46];let Me=i.actionName??`all`,K;e[47]===z?K=e[48]:(K=e=>{z({actionName:e&&e!==`all`?e:void 0,cursor:void 0})},e[47]=z,e[48]=K);let Ne;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,F.jsx)(u,{id:`audit-action-name`,className:`w-full`,children:(0,F.jsx)(l,{})}),e[49]=Ne):Ne=e[49];let Pe;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=(0,F.jsxs)(d,{children:[(0,F.jsx)(f,{value:`all`,children:`All actions`}),_.map(de)]}),e[50]=Pe):Pe=e[50];let q;e[51]!==Me||e[52]!==K?(q=(0,F.jsxs)(`div`,{className:`space-y-2`,children:[je,(0,F.jsxs)(p,{value:Me,onValueChange:K,children:[Ne,Pe]})]}),e[51]=Me,e[52]=K,e[53]=q):q=e[53];let Fe;e[54]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=(0,F.jsx)(`div`,{className:`flex items-end`,children:(0,F.jsx)(o,{type:`submit`,className:`w-full lg:w-auto`,children:`Apply`})}),e[54]=Fe):Fe=e[54];let J;e[55]===_e?J=e[56]:(J=(0,F.jsx)(`div`,{className:`flex items-end`,children:(0,F.jsx)(o,{type:`button`,variant:`ghost`,className:`w-full lg:w-auto`,onClick:_e,children:`Clear`})}),e[55]=_e,e[56]=J);let Y;e[57]!==he||e[58]!==B||e[59]!==V||e[60]!==U||e[61]!==G||e[62]!==q||e[63]!==J?(Y=(0,F.jsxs)(`form`,{className:`grid gap-4 lg:grid-cols-[minmax(0,1.2fr)_minmax(0,0.8fr)_180px_180px_180px_auto_auto]`,onSubmit:he,children:[B,V,U,G,q,Fe,J]}),e[57]=he,e[58]=B,e[59]=V,e[60]=U,e[61]=G,e[62]=q,e[63]=J,e[64]=Y):Y=e[64];let Ie=i.cursor?` · viewing older results`:` · newest first`,Le=ee?` · updating`:``,X;e[65]!==x.items.length||e[66]!==Ie||e[67]!==Le?(X=(0,F.jsxs)(`p`,{className:`text-muted-foreground text-sm`,children:[x.items.length,` entries on this page`,Ie,Le]}),e[65]=x.items.length,e[66]=Ie,e[67]=Le,e[68]=X):X=e[68];let Z;e[69]!==i.cursor||e[70]!==z?(Z=i.cursor?(0,F.jsxs)(o,{type:`button`,variant:`outline`,onClick:()=>z({cursor:void 0}),children:[(0,F.jsx)(N,{size:16,stroke:2}),`Newest`]}):null,e[69]=i.cursor,e[70]=z,e[71]=Z):Z=e[71];let Q;e[72]!==x.nextCursor||e[73]!==z?(Q=()=>{x.nextCursor&&z({cursor:x.nextCursor})},e[72]=x.nextCursor,e[73]=z,e[74]=Q):Q=e[74];let Re=!x.nextCursor,ze;e[75]===Symbol.for(`react.memo_cache_sentinel`)?(ze=(0,F.jsx)(c,{size:16,stroke:2}),e[75]=ze):ze=e[75];let Be;e[76]!==Q||e[77]!==Re?(Be=(0,F.jsxs)(o,{type:`button`,variant:`outline`,onClick:Q,disabled:Re,children:[`Older`,ze]}),e[76]=Q,e[77]=Re,e[78]=Be):Be=e[78];let Ve;e[79]!==Z||e[80]!==Be?(Ve=(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[Z,Be]}),e[79]=Z,e[80]=Be,e[81]=Ve):Ve=e[81];let He;e[82]!==X||e[83]!==Ve?(He=(0,F.jsxs)(`div`,{className:`mt-4 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between`,children:[X,Ve]}),e[82]=X,e[83]=Ve,e[84]=He):He=e[84];let Ue;e[85]!==Y||e[86]!==He?(Ue=(0,F.jsxs)(`section`,{className:`rounded-xl border p-4`,children:[Y,He]}),e[85]=Y,e[86]=He,e[87]=Ue):Ue=e[87];let $;e[88]===x.items?$=e[89]:($=x.items.length===0?(0,F.jsx)(E,{className:`border`,children:(0,F.jsxs)(T,{children:[(0,F.jsx)(C,{variant:`icon`,children:(0,F.jsx)(m,{size:18,stroke:1.75})}),(0,F.jsx)(S,{children:`No audit entries matched these filters`}),(0,F.jsx)(w,{children:`Try clearing the filters or waiting for new workflow activity in this organization.`})]})}):(0,F.jsx)(`div`,{className:`rounded-md border`,children:(0,F.jsxs)(M,{children:[(0,F.jsx)(O,{children:(0,F.jsxs)(te,{children:[(0,F.jsx)(k,{children:`When`}),(0,F.jsx)(k,{children:`Actor`}),(0,F.jsx)(k,{children:`Activity`}),(0,F.jsx)(k,{children:`Status`})]})}),(0,F.jsx)(A,{children:x.items.map(ue)})]})}),e[88]=x.items,e[89]=$);let We;return e[90]!==Ue||e[91]!==$?(We=(0,F.jsxs)(`div`,{className:`space-y-8 p-8`,children:[ve,Ue,$]}),e[90]=Ue,e[91]=$,e[92]=We):We=e[92],We}function ue(e){return(0,F.jsx)(ce,{item:e},e.id)}function de(e){return(0,F.jsx)(f,{value:e,children:L(e)},e)}function fe(e){return(0,F.jsx)(f,{value:e,children:L(e)},e)}function pe(e){return(0,F.jsx)(f,{value:e,children:L(e)},e)}var z=le;export{z as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t,t as n}from"./jsx-runtime-DG_AJzB_.js";import{t as r}from"./compiler-runtime-DCc3R3Xn.js";import{a as i,o as a}from"./api-base-url-DIb6qukm.js";import{S as o,a as s,g as c,i as l,n as u,t as d,y as f}from"./createReactComponent-_L2mp4Ui.js";import{t as p}from"./utils-C8DGLIgm.js";import{t as m}from"./IconCheck-Gc24xPT2.js";import{t as h}from"./IconCoins-C7Nn0L6R.js";import{t as g}from"./IconLoader2-B3B6M8nQ.js";import{t as _}from"./useSuspenseQuery-Bn7lFvcg.js";import{n as v}from"./CompositeList-CX7HHxYw.js";import{d as y,n as b,t as x}from"./useBaseUiId-BLFGpnYJ.js";import{$ as S,A as C,H as w,O as T,S as E,W as D,a as O,b as k,c as A,d as ee,f as j,k as M,l as N,o as P,s as te,u as ne,x as re,y as ie}from"./index-e4SV9LPn.js";import{t as F}from"./input-CG_cIxvO.js";import{t as I}from"./useControlled-B8q0aJoo.js";import{t as L}from"./CompositeItem-D3nXGtvr.js";import{t as R}from"./badge-C1_ZMBRy.js";import{a as z,i as B,n as ae,r as oe,t as se}from"./empty-COnWCwda.js";import{t as ce}from"./label-CWOhoN_L.js";import{a as V,n as H,o as U,r as W,t as G}from"./card-Bsy6azfK.js";import{n as le}from"./textarea-DiU04l_U.js";import{a as ue,i as de,n as fe,o as K}from"./xstate-react.esm-DhUG3dob.js";import{n as pe,t as me}from"./dist-DAhKd1f7.js";var he=d(`outline`,`receipt-2`,`Receipt2`,[[`path`,{d:`M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2`,key:`svg-0`}],[`path`,{d:`M14 8h-2.5a1.5 1.5 0 0 0 0 3h1a1.5 1.5 0 0 1 0 3h-2.5m2 0v1.5m0 -9v1.5`,key:`svg-1`}]]),ge=d(`outline`,`stack-2`,`Stack2`,[[`path`,{d:`M12 4l-8 4l8 4l8 -4l-8 -4`,key:`svg-0`}],[`path`,{d:`M4 12l8 4l8 -4`,key:`svg-1`}],[`path`,{d:`M4 16l8 4l8 -4`,key:`svg-2`}]]),q=r(),J=e(t()),_e=new Intl.NumberFormat(`en-US`,{currency:`USD`,maximumFractionDigits:4,minimumFractionDigits:2,style:`currency`}),ve=new Intl.NumberFormat(`en-US`);function Y(e){return _e.format(e)}function ye(e){return ve.format(e)}function be(e){return e===null||!Number.isFinite(e)?``:Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,``)}function xe(e){let[t=``,...n]=e.replaceAll(/[^0-9.]/g,``).split(`.`);return n.length===0?t:`${t}.${n.join(``).slice(0,2)}`}function X(e){let t=e.trim();if(t.length===0)return null;if(!/^\d+(\.\d{0,2})?$/.test(t))return`invalid`;let n=Number(t);return!Number.isFinite(n)||n<0?`invalid`:n}function Se(e){return e===null?null:Math.round(e*100)}function Ce(e){return e.isPending||e.parsedBudgetInput===`invalid`?!0:Se(e.parsedBudgetInput)===Se(e.currentBudgetUsd)}function we(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleDateString(void 0,{day:`numeric`,month:`short`,timeZone:`UTC`})}function Te(e){let t=new Date(e);return Number.isNaN(t.getTime())?e:t.toLocaleString(void 0,{day:`numeric`,hour:`numeric`,minute:`2-digit`,month:`short`})}function Ee(e){return e<=0?`0%`:e<10?`${e.toFixed(1)}%`:`${Math.round(e)}%`}function De(e){return e.map((e,t)=>`${t===0?`M`:`L`}${e.x},${e.y}`).join(` `)}var Z=n();function Oe(e){let t=(0,q.c)(12),{title:n,description:r,children:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(U,{children:n}),t[0]=n,t[1]=a);let o;t[2]===r?o=t[3]:(o=(0,Z.jsx)(W,{children:r}),t[2]=r,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(V,{children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===i?c=t[8]:(c=(0,Z.jsx)(H,{children:i}),t[7]=i,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsxs)(G,{children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function ke(e){let t=(0,q.c)(10),{dailyCost:n,totalSpendUsd:r}=e,i,a;if(t[0]!==n||t[1]!==r){let e=j(n),o=e.reduce(Ae,0);i=`space-y-3`;let s;t[4]!==o||t[5]!==r?(s=e=>{let t=o<=0?0:Math.max(e.totalCostUsd/o*100,2);return(0,Z.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-4 text-sm`,children:[(0,Z.jsx)(`p`,{className:`min-w-0 font-medium`,children:we(e.date)}),(0,Z.jsxs)(`div`,{className:`text-right`,children:[(0,Z.jsx)(`p`,{className:`font-medium tabular-nums`,children:Y(e.totalCostUsd)}),(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[Ee(N(e.totalCostUsd,r)),` `,`of spend`]})]})]}),(0,Z.jsx)(`div`,{className:`h-2 rounded-full bg-muted/60`,children:(0,Z.jsx)(`div`,{className:`h-2 rounded-full bg-primary transition-all`,style:{width:`${t}%`}})})]},e.date)},t[4]=o,t[5]=r,t[6]=s):s=t[6],a=e.map(s),t[0]=n,t[1]=r,t[2]=i,t[3]=a}else i=t[2],a=t[3];let o;return t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(`div`,{className:i,children:a}),t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function Ae(e,t){return Math.max(e,t.totalCostUsd)}function je(e){let t=(0,q.c)(48),{dailyCost:n,monthlyBudgetUsd:r,totalSpendUsd:i}=e,a,o,s,c,l,u;if(t[0]!==n||t[1]!==r){let e=A({dailyCost:n,monthlyBudgetUsd:r}),i=e.reduce(Fe,100),d=Math.max(100,Math.ceil(i/25)*25),f=e.map((t,n)=>{let r=e.length===1?50:n/Math.max(e.length-1,1)*100,i=100-t.usagePercent/d*100;return{date:t.date,x:r,y:i}}),p=f.length===0?``:De(f),m=f.length===0?``:`${p} L${f.at(-1)?.x??0},100 L${f[0]?.x??0},100 Z`,h=100-100/d*100,g;t[8]===d?g=t[9]:(g=Array.from({length:4},(e,t)=>d/4*(t+1)),t[8]=d,t[9]=g);let _=g,v=e.length<=3?e:[e[0],e[Math.floor((e.length-1)/2)],e.at(-1)].filter(Pe);u=`space-y-4`,s=`rounded-lg border bg-muted/10 p-4`;let y,b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{children:`0%`}),b=(0,Z.jsx)(`span`,{children:`100% target`}),t[10]=y,t[11]=b):(y=t[10],b=t[11]);let x;t[12]===d?x=t[13]:(x=Math.round(d),t[12]=d,t[13]=x),t[14]===x?c=t[15]:(c=(0,Z.jsxs)(`div`,{className:`mb-3 flex items-center justify-between gap-3 text-xs text-muted-foreground`,children:[y,b,(0,Z.jsxs)(`span`,{children:[x,`% scale`]})]}),t[14]=x,t[15]=c);let S;t[16]!==_||t[17]!==d?(S=_.map(e=>{let t=100-e/d*100;return(0,Z.jsx)(`line`,{x1:`0`,y1:t,x2:`100`,y2:t,stroke:`var(--color-border)`,strokeDasharray:`2 3`,strokeWidth:`0.5`},e)}),t[16]=_,t[17]=d,t[18]=S):S=t[18];let C;t[19]===h?C=t[20]:(C=(0,Z.jsx)(`line`,{x1:`0`,y1:h,x2:`100`,y2:h,stroke:`var(--color-border)`,strokeDasharray:`4 3`,strokeWidth:`0.8`}),t[19]=h,t[20]=C);let w;t[21]===m?w=t[22]:(w=m.length>0?(0,Z.jsx)(`path`,{d:m,fill:`var(--color-chart-2)`,opacity:`0.18`}):null,t[21]=m,t[22]=w),l=(0,Z.jsx)(`div`,{className:`h-64 w-full`,children:(0,Z.jsxs)(`svg`,{viewBox:`0 0 100 100`,className:`h-full w-full overflow-visible`,role:`img`,"aria-label":`Budget usage percentage graph`,preserveAspectRatio:`none`,children:[S,C,w,p.length>0?(0,Z.jsx)(`path`,{d:p,fill:`none`,stroke:`var(--color-chart-2)`,strokeWidth:`1.8`,vectorEffect:`non-scaling-stroke`}):null,f.map(Ne)]})}),a=`mt-3 flex items-center justify-between gap-3 text-xs text-muted-foreground`,o=v.map(Me),t[0]=n,t[1]=r,t[2]=a,t[3]=o,t[4]=s,t[5]=c,t[6]=l,t[7]=u}else a=t[2],o=t[3],s=t[4],c=t[5],l=t[6],u=t[7];let d;t[23]!==a||t[24]!==o?(d=(0,Z.jsx)(`div`,{className:a,children:o}),t[23]=a,t[24]=o,t[25]=d):d=t[25];let f;t[26]!==s||t[27]!==c||t[28]!==l||t[29]!==d?(f=(0,Z.jsxs)(`div`,{className:s,children:[c,l,d]}),t[26]=s,t[27]=c,t[28]=l,t[29]=d,t[30]=f):f=t[30];let p;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Cumulative spend`}),t[31]=p):p=t[31];let m;t[32]===i?m=t[33]:(m=Y(i),t[32]=i,t[33]=m);let h;t[34]===m?h=t[35]:(h=(0,Z.jsxs)(`div`,{children:[p,(0,Z.jsx)(`p`,{className:`font-medium tabular-nums`,children:m})]}),t[34]=m,t[35]=h);let g;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`p`,{className:`text-muted-foreground`,children:`Limit`}),t[36]=g):g=t[36];let _;t[37]===r?_=t[38]:(_=Y(r),t[37]=r,t[38]=_);let v;t[39]===_?v=t[40]:(v=(0,Z.jsxs)(`div`,{className:`text-right`,children:[g,(0,Z.jsx)(`p`,{className:`font-medium tabular-nums`,children:_})]}),t[39]=_,t[40]=v);let y;t[41]!==h||t[42]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3 rounded-lg border bg-muted/15 p-3 text-sm`,children:[h,v]}),t[41]=h,t[42]=v,t[43]=y):y=t[43];let b;return t[44]!==y||t[45]!==u||t[46]!==f?(b=(0,Z.jsxs)(`div`,{className:u,children:[f,y]}),t[44]=y,t[45]=u,t[46]=f,t[47]=b):b=t[47],b}function Me(e){return(0,Z.jsx)(`span`,{children:we(e.date)},e.date)}function Ne(e){return(0,Z.jsx)(`circle`,{cx:e.x,cy:e.y,r:`1.6`,fill:`var(--color-chart-2)`},e.date)}function Pe(e){return e!==void 0}function Fe(e,t){return Math.max(e,t.usagePercent)}function Ie(e){let t=(0,q.c)(12),{data:n,budgetLimitState:r}=e;if(n.overview.queryCount===0){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(se,{className:`border`,children:(0,Z.jsxs)(oe,{children:[(0,Z.jsx)(B,{variant:`icon`,children:(0,Z.jsx)(h,{size:18,stroke:1.75})}),(0,Z.jsx)(z,{children:`No query-cost data yet`}),(0,Z.jsx)(ae,{children:"Run an agent workflow that executes database queries with stats enabled, then this dashboard will populate from `data_source_query_costs`."})]})}),t[0]=e):e=t[0],e}let i;t[1]!==r.kind||t[2]!==r.monthlyBudgetUsd||t[3]!==n.dailyCost||t[4]!==n.overview.totalCostUsd?(i=(0,Z.jsx)(Oe,{title:`Budget Usage`,description:`Cumulative spend as a percentage of your monthly budget.`,children:r.kind===`unlimited`?(0,Z.jsx)(`div`,{className:`flex h-72 items-center justify-center rounded-lg border border-dashed bg-muted/10 p-6 text-center text-sm text-muted-foreground`,children:`Set a monthly budget above to see how quickly the current window is consuming your monthly budget.`}):r.kind===`blocked`?(0,Z.jsxs)(`div`,{className:`flex h-72 items-center justify-center rounded-lg border border-dashed bg-muted/10 p-6 text-center text-sm text-muted-foreground`,children:[`Monthly budget is`,` `,Y(r.monthlyBudgetUsd),`. Increase the limit to chart usage against an available budget.`]}):(0,Z.jsx)(je,{dailyCost:n.dailyCost,monthlyBudgetUsd:r.monthlyBudgetUsd,totalSpendUsd:n.overview.totalCostUsd})}),t[1]=r.kind,t[2]=r.monthlyBudgetUsd,t[3]=n.dailyCost,t[4]=n.overview.totalCostUsd,t[5]=i):i=t[5];let a;t[6]!==n.dailyCost||t[7]!==n.overview.totalCostUsd?(a=(0,Z.jsx)(Oe,{title:`Daily Spend`,description:`Latest daily costs inside the selected reporting window.`,children:(0,Z.jsx)(ke,{dailyCost:n.dailyCost,totalSpendUsd:n.overview.totalCostUsd})}),t[6]=n.dailyCost,t[7]=n.overview.totalCostUsd,t[8]=a):a=t[8];let o;return t[9]!==i||t[10]!==a?(o=(0,Z.jsx)(`div`,{className:`space-y-4`,children:(0,Z.jsxs)(`div`,{className:`grid gap-4 xl:grid-cols-[1.1fr_0.9fr]`,children:[i,a]})}),t[9]=i,t[10]=a,t[11]=o):o=t[11],o}var Le=J.createContext(void 0);function Re(e=!0){let t=J.useContext(Le);if(t===void 0&&!e)throw Error(f(7));return t}var ze=J.forwardRef(function(e,t){let{className:n,defaultPressed:r=!1,disabled:i=!1,form:a,onPressedChange:l,pressed:u,render:d,type:f,value:p,nativeButton:m=!0,...h}=e,g=x(p||void 0),_=Re(),v=_?.value??[],S=_?void 0:r,C=(i||_?.disabled)??!1,[w,T]=I({controlled:_?v?.indexOf(g)>-1:u,default:S,name:`Toggle`,state:`pressed`}),E=o((e,t)=>{g&&_?.setGroupValue?.(g,e,t),l?.(e,t)}),{getButtonProps:D,buttonRef:O}=c({disabled:C,native:m}),k=J.useMemo(()=>({disabled:C,pressed:w}),[C,w]),A=[O,t],ee=[{"aria-pressed":w,onClick(e){let t=!w,n=b(y,e.nativeEvent);E(t,n),!n.isCanceled&&T(t)}},h,D],j=s(`button`,e,{enabled:!_,state:k,ref:A,props:ee});return _?(0,Z.jsx)(L,{tag:`button`,render:d,className:n,state:k,refs:A,props:ee}):j}),Be=function(e){return e.disabled=`data-disabled`,e.orientation=`data-orientation`,e.multiple=`data-multiple`,e}({}),Ve={multiple(e){return e?{[Be.multiple]:``}:null}},He=J.forwardRef(function(e,t){let{defaultValue:n,disabled:r=!1,loopFocus:i=!0,onValueChange:a,orientation:c=`horizontal`,multiple:l=!1,value:u,className:d,render:f,...p}=e,m=v(!0),h=J.useMemo(()=>{if(u===void 0)return n??[]},[u,n]),g=(m?.disabled??!1)||r,[_,y]=I({controlled:u,default:h,name:`ToggleGroup`,state:`value`}),b=o((e,t,n)=>{let r;if(l?(r=_.slice(),t?r.push(e):r.splice(_.indexOf(e),1)):r=t?[e]:[],Array.isArray(r)){if(a?.(r,n),n.isCanceled)return;y(r)}}),x=J.useMemo(()=>({disabled:g,multiple:l,orientation:c}),[g,c,l]),S=J.useMemo(()=>({disabled:g,orientation:c,setGroupValue:b,value:_}),[g,c,b,_]),C={role:`group`},w=s(`div`,e,{enabled:!!m,state:x,ref:t,props:[C,p],stateAttributesMapping:Ve});return(0,Z.jsx)(Le.Provider,{value:S,children:m?w:(0,Z.jsx)(le,{render:f,className:d,state:x,refs:[t],props:[C,p],stateAttributesMapping:Ve,loopFocus:i})})}),Ue=l(`hover:text-foreground aria-pressed:bg-muted focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive data-[state=on]:bg-muted gap-1 rounded-lg text-sm font-medium transition-all [&_svg:not([class*='size-'])]:size-4 group/toggle hover:bg-muted inline-flex items-center justify-center whitespace-nowrap outline-none focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,outline:`border-input hover:bg-muted border bg-transparent`},size:{default:`h-8 min-w-8 px-2`,sm:`h-7 min-w-7 rounded-[min(var(--radius-md),12px)] px-1.5 text-[0.8rem]`,lg:`h-9 min-w-9 px-2.5`}},defaultVariants:{variant:`default`,size:`default`}}),We=J.createContext({size:`default`,variant:`default`,spacing:0,orientation:`horizontal`});function Ge(e){let t=(0,q.c)(29),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({className:r,variant:c,size:a,spacing:o,orientation:s,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=o===void 0?0:o,u=s===void 0?`horizontal`:s,d;t[8]===l?d=t[9]:(d={"--gap":l},t[8]=l,t[9]=d);let f=d,m;t[10]===r?m=t[11]:(m=p(`rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] data-[orientation=vertical]:flex-col data-[orientation=vertical]:items-stretch`,r),t[10]=r,t[11]=m);let h;t[12]!==u||t[13]!==a||t[14]!==l||t[15]!==c?(h={variant:c,size:a,spacing:l,orientation:u},t[12]=u,t[13]=a,t[14]=l,t[15]=c,t[16]=h):h=t[16];let g;t[17]!==n||t[18]!==h?(g=(0,Z.jsx)(We.Provider,{value:h,children:n}),t[17]=n,t[18]=h,t[19]=g):g=t[19];let _;return t[20]!==u||t[21]!==i||t[22]!==a||t[23]!==l||t[24]!==f||t[25]!==m||t[26]!==g||t[27]!==c?(_=(0,Z.jsx)(He,{"data-slot":`toggle-group`,"data-variant":c,"data-size":a,"data-spacing":l,"data-orientation":u,style:f,className:m,...i,children:g}),t[20]=u,t[21]=i,t[22]=a,t[23]=l,t[24]=f,t[25]=m,t[26]=g,t[27]=c,t[28]=_):_=t[28],_}function Ke(e){let t=(0,q.c)(19),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:r,children:n,variant:a,size:o,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?`default`:a,c=o===void 0?`default`:o,l=J.useContext(We),u=l.variant||s,d=l.size||c,f=l.spacing,m;t[6]!==r||t[7]!==l.size||t[8]!==l.variant||t[9]!==c||t[10]!==s?(m=p(`group-data-[spacing=0]/toggle-group:rounded-none group-data-[spacing=0]/toggle-group:px-2 group-data-horizontal/toggle-group:data-[spacing=0]:first:rounded-l-lg group-data-vertical/toggle-group:data-[spacing=0]:first:rounded-t-lg group-data-horizontal/toggle-group:data-[spacing=0]:last:rounded-r-lg group-data-vertical/toggle-group:data-[spacing=0]:last:rounded-b-lg shrink-0 focus:z-10 focus-visible:z-10 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:border-l-0 group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:border-t-0 group-data-horizontal/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-l group-data-vertical/toggle-group:data-[spacing=0]:data-[variant=outline]:first:border-t`,Ue({variant:l.variant||s,size:l.size||c}),r),t[6]=r,t[7]=l.size,t[8]=l.variant,t[9]=c,t[10]=s,t[11]=m):m=t[11];let h;return t[12]!==n||t[13]!==l.spacing||t[14]!==i||t[15]!==u||t[16]!==d||t[17]!==m?(h=(0,Z.jsx)(ze,{"data-slot":`toggle-group-item`,"data-variant":u,"data-size":d,"data-spacing":f,className:m,...i,children:n}),t[12]=n,t[13]=l.spacing,t[14]=i,t[15]=u,t[16]=d,t[17]=m,t[18]=h):h=t[18],h}function qe(e){switch(e.kind){case`unlimited`:return`No budget set`;case`blocked`:return`No spend allowed`;case`limited`:return`${Y(e.monthlyBudgetUsd)} / month`}return e}function Je(e){let t=(0,q.c)(23),{budgetLimitState:n,generatedAt:r,isWindowChangePending:i,selectedDays:a,onWindowChange:o}=e,s;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(`h1`,{className:`text-3xl font-bold`,children:`Budget`}),t[0]=s):s=t[0];let c;t[1]===n?c=t[2]:(c=qe(n),t[1]=n,t[2]=c);let l;t[3]===c?l=t[4]:(l=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3`,children:[s,(0,Z.jsx)(R,{variant:`outline`,children:c})]}),t[3]=c,t[4]=l);let u;t[5]===r?u=t[6]:(u=Te(r),t[5]=r,t[6]=u);let d=i?` Refreshing selected window...`:``,f;t[7]!==u||t[8]!==d?(f=(0,Z.jsxs)(`p`,{className:`text-xs text-muted-foreground`,children:[`Updated `,u,d]}),t[7]=u,t[8]=d,t[9]=f):f=t[9];let p;t[10]!==l||t[11]!==f?(p=(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[l,f]}),t[10]=l,t[11]=f,t[12]=p):p=t[12];let m;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`p`,{className:`text-xs font-medium uppercase tracking-[0.18em] text-muted-foreground`,children:`Window`}),t[13]=m):m=t[13];let h=String(a),g;t[14]===h?g=t[15]:(g=[h],t[14]=h,t[15]=g);let _;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(_=P.map(Ye),t[16]=_):_=t[16];let v;t[17]!==o||t[18]!==g?(v=(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[m,(0,Z.jsx)(Ge,{value:g,onValueChange:o,variant:`outline`,size:`sm`,"aria-label":`Budget window`,children:_})]}),t[17]=o,t[18]=g,t[19]=v):v=t[19];let y;return t[20]!==v||t[21]!==p?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-4 xl:flex-row xl:items-end xl:justify-between`,children:[p,v]}),t[20]=v,t[21]=p,t[22]=y):y=t[22],y}function Ye(e){return(0,Z.jsxs)(Ke,{value:String(e),className:`min-w-20 justify-center`,children:[e,` days`]},e)}function Xe(e){let t=(0,q.c)(13),{children:n,tooltip:r}=e;if(!r)return n;let i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{children:n}),t[0]=n,t[1]=i);let a=`More information about ${n}`,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(S,{size:14,stroke:1.75}),t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=(0,Z.jsx)(C,{className:`inline-flex size-4 items-center justify-center rounded-full text-muted-foreground transition-colors hover:text-foreground`,"aria-label":a,children:o}),t[3]=a,t[4]=s);let c;t[5]===r?c=t[6]:(c=(0,Z.jsx)(M,{children:r}),t[5]=r,t[6]=c);let l;t[7]!==s||t[8]!==c?(l=(0,Z.jsxs)(T,{children:[s,c]}),t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;return t[10]!==i||t[11]!==l?(u=(0,Z.jsxs)(`span`,{className:`inline-flex items-center gap-1.5`,children:[i,l]}),t[10]=i,t[11]=l,t[12]=u):u=t[12],u}function Ze(e){let t=(0,q.c)(17),{title:n,value:r,description:i,icon:a}=e,o;t[0]===a?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`w-fit rounded-lg border bg-muted/30 p-2`,children:(0,Z.jsx)(a,{size:18,stroke:1.75})}),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Z.jsx)(W,{children:n}),t[2]=n,t[3]=s);let c;t[4]===r?c=t[5]:(c=(0,Z.jsx)(U,{className:`text-2xl`,children:r}),t[4]=r,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==o||t[10]!==l?(u=(0,Z.jsxs)(V,{className:`space-y-4`,children:[o,l]}),t[9]=o,t[10]=l,t[11]=u):u=t[11];let d;t[12]===i?d=t[13]:(d=(0,Z.jsx)(H,{className:`pt-0 text-sm text-muted-foreground`,children:i}),t[12]=i,t[13]=d);let f;return t[14]!==u||t[15]!==d?(f=(0,Z.jsxs)(G,{children:[u,d]}),t[14]=u,t[15]=d,t[16]=f):f=t[16],f}function Qe(e){let t=(0,q.c)(31),{budgetLimitState:n,overview:r,peakSpendDay:i}=e,a;t[0]!==n.budgetUsedPercent||t[1]!==n.kind?(a=n.kind===`unlimited`?`Not set`:n.kind===`blocked`?`Blocked`:Ee(n.budgetUsedPercent),t[0]=n.budgetUsedPercent,t[1]=n.kind,t[2]=a):a=t[2];let o=a,s;t[3]!==n.kind||t[4]!==n.monthlyBudgetUsd||t[5]!==r.totalCostUsd?(s=n.kind===`unlimited`?`Set a monthly budget to track percentage use.`:n.kind===`blocked`?`${Y(n.monthlyBudgetUsd)} monthly budget blocks new agent runs.`:`${Y(r.totalCostUsd)} of ${Y(n.monthlyBudgetUsd)} monthly budget used`,t[3]=n.kind,t[4]=n.monthlyBudgetUsd,t[5]=r.totalCostUsd,t[6]=s):s=t[6];let c=s,l;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Xe,{tooltip:`Uses actualCostUsd when available, and falls back to estimatedCostUsd when only estimated spend is recorded.`,children:`Observed Spend`}),t[7]=l):l=t[7];let u;t[8]===r.totalCostUsd?u=t[9]:(u=Y(r.totalCostUsd),t[8]=r.totalCostUsd,t[9]=u);let d;t[10]===r.activeConnectionCount?d=t[11]:(d=ye(r.activeConnectionCount),t[10]=r.activeConnectionCount,t[11]=d);let f;t[12]===r.activeProviderCount?f=t[13]:(f=ye(r.activeProviderCount),t[12]=r.activeProviderCount,t[13]=f);let p=`${d} connections across ${f} providers`,m;t[14]!==u||t[15]!==p?(m=(0,Z.jsx)(Ze,{title:l,value:u,description:p,icon:h}),t[14]=u,t[15]=p,t[16]=m):m=t[16];let g;t[17]!==c||t[18]!==o?(g=(0,Z.jsx)(Ze,{title:`Budget Used`,value:o,description:c,icon:he}),t[17]=c,t[18]=o,t[19]=g):g=t[19];let _;t[20]===i?_=t[21]:(_=i?Y(i.totalCostUsd):`No spend`,t[20]=i,t[21]=_);let v;t[22]===i?v=t[23]:(v=i?`${we(i.date)} recorded the highest spend.`:`No observed query spend in this window`,t[22]=i,t[23]=v);let y;t[24]!==_||t[25]!==v?(y=(0,Z.jsx)(Ze,{title:`Peak Spend Day`,value:_,description:v,icon:ge}),t[24]=_,t[25]=v,t[26]=y):y=t[26];let b;return t[27]!==y||t[28]!==m||t[29]!==g?(b=(0,Z.jsxs)(`div`,{className:`grid gap-4 md:grid-cols-2 xl:grid-cols-3`,children:[m,g,y]}),t[27]=y,t[28]=m,t[29]=g,t[30]=b):b=t[30],b}function $e(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`border-input dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-disabled:bg-input/50 dark:has-disabled:bg-input/80 h-8 rounded-lg border transition-colors has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot][aria-invalid=true]]:ring-[3px] has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,role:`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var et=l(`text-muted-foreground h-auto gap-2 py-1.5 text-sm font-medium group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4 flex cursor-text items-center justify-center select-none`,{variants:{align:{"inline-start":`pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem] order-first`,"inline-end":`pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem] order-last`,"block-start":`px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start`,"block-end":`px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start`}},defaultVariants:{align:`inline-start`}});function tt(e){let t=(0,q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=p(et({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{role:`group`,"data-slot":`input-group-addon`,"data-align":a,className:o,onClick:nt,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function nt(e){e.target.closest(`button`)||e.currentTarget.parentElement?.querySelector(`input`)?.focus()}l(`gap-2 text-sm shadow-none flex items-center`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function rt(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`text-muted-foreground gap-2 text-sm [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function it(e){let t=(0,q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=p(`rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent flex-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(F,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function at(e){let t=(0,q.c)(14),{status:n,className:r}=e;if(n===`idle`)return null;let i=n===`error`&&`text-destructive`,a;t[0]!==r||t[1]!==i?(a=p(`flex items-center gap-1.5 text-xs text-muted-foreground transition-opacity`,i,r),t[0]=r,t[1]=i,t[2]=a):a=t[2];let o;t[3]===n?o=t[4]:(o=n===`saving`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(g,{size:14,className:`animate-spin`}),(0,Z.jsx)(`span`,{children:`Saving...`})]}),t[3]=n,t[4]=o);let s;t[5]===n?s=t[6]:(s=n===`saved`&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(m,{size:14,className:`text-green-600`}),(0,Z.jsx)(`span`,{children:`Saved`})]}),t[5]=n,t[6]=s);let c;t[7]===n?c=t[8]:(c=n===`error`&&(0,Z.jsx)(`span`,{children:`Failed to save`}),t[7]=n,t[8]=c);let l;return t[9]!==a||t[10]!==o||t[11]!==s||t[12]!==c?(l=(0,Z.jsxs)(`div`,{className:a,children:[o,s,c]}),t[9]=a,t[10]=o,t[11]=s,t[12]=c,t[13]=l):l=t[13],l}function ot(e){let t=(0,q.c)(68),n;bb0:{switch(e.budgetLimitState.kind){case`unlimited`:{let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`rounded-lg border border-dashed bg-muted/10 p-4 text-sm text-muted-foreground`,children:`Set a limit to track usage.`}),t[0]=e):e=t[0],n=e;break bb0}case`blocked`:{let r;t[1]===e.budgetLimitState.monthlyBudgetUsd?r=t[2]:(r=Y(e.budgetLimitState.monthlyBudgetUsd),t[1]=e.budgetLimitState.monthlyBudgetUsd,t[2]=r);let i;t[3]===r?i=t[4]:(i=(0,Z.jsxs)(`div`,{className:`rounded-lg border border-dashed bg-muted/10 p-4 text-sm text-muted-foreground`,children:[`Monthly budget is`,` `,r,`. Agent runs are blocked until you raise the limit.`]}),t[3]=r,t[4]=i),n=i;break bb0}case`limited`:{let r=Math.min(e.budgetLimitState.budgetUsedPercent,100),i;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{children:(0,Z.jsx)(`p`,{className:`text-sm font-medium`,children:`Spend vs. limit`})}),t[5]=i):i=t[5];let a;t[6]===e.totalSpendUsd?a=t[7]:(a=Y(e.totalSpendUsd),t[6]=e.totalSpendUsd,t[7]=a);let o;t[8]===e.budgetLimitState.monthlyBudgetUsd?o=t[9]:(o=Y(e.budgetLimitState.monthlyBudgetUsd),t[8]=e.budgetLimitState.monthlyBudgetUsd,t[9]=o);let s;t[10]!==a||t[11]!==o?(s=(0,Z.jsxs)(`p`,{className:`font-medium tabular-nums`,children:[a,` /`,` `,o]}),t[10]=a,t[11]=o,t[12]=s):s=t[12];let c;t[13]!==e.budgetLimitState.isOverBudget||t[14]!==e.budgetLimitState.remainingBudgetUsd?(c=e.budgetLimitState.isOverBudget?`${Y(Math.abs(e.budgetLimitState.remainingBudgetUsd))} over`:`${Y(e.budgetLimitState.remainingBudgetUsd)} remaining`,t[13]=e.budgetLimitState.isOverBudget,t[14]=e.budgetLimitState.remainingBudgetUsd,t[15]=c):c=t[15];let l;t[16]===c?l=t[17]:(l=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:c}),t[16]=c,t[17]=l);let u;t[18]!==s||t[19]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between`,children:[i,(0,Z.jsxs)(`div`,{className:`text-right`,children:[s,l]})]}),t[18]=s,t[19]=l,t[20]=u):u=t[20];let d=`h-2 rounded-full transition-all ${e.budgetLimitState.isOverBudget?`bg-destructive`:`bg-primary`}`,f=`${r}%`,p;t[21]===f?p=t[22]:(p={width:f},t[21]=f,t[22]=p);let m;t[23]!==p||t[24]!==d?(m=(0,Z.jsx)(`div`,{className:`h-2 rounded-full bg-muted/60`,children:(0,Z.jsx)(`div`,{className:d,style:p})}),t[23]=p,t[24]=d,t[25]=m):m=t[25];let h;t[26]===e.budgetLimitState.budgetUsedPercent?h=t[27]:(h=Ee(e.budgetLimitState.budgetUsedPercent),t[26]=e.budgetLimitState.budgetUsedPercent,t[27]=h);let g;t[28]===h?g=t[29]:(g=(0,Z.jsxs)(`p`,{className:`text-sm text-muted-foreground`,children:[`Using`,` `,h,` of the limit.`]}),t[28]=h,t[29]=g);let _;t[30]!==m||t[31]!==g||t[32]!==u?(_=(0,Z.jsxs)(`div`,{className:`space-y-3 rounded-lg border bg-muted/15 p-4`,children:[u,m,g]}),t[30]=m,t[31]=g,t[32]=u,t[33]=_):_=t[33],n=_;break bb0}}n=e.budgetLimitState}let r=n,i;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{className:`space-y-1`,children:[(0,Z.jsx)(U,{children:`Spend Limit`}),(0,Z.jsx)(W,{children:`Cap monthly spend.`})]}),t[34]=i):i=t[34];let a;t[35]===e.saveStatus?a=t[36]:(a=(0,Z.jsx)(V,{className:`space-y-3`,children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 md:flex-row md:items-start md:justify-between`,children:[i,(0,Z.jsx)(at,{status:e.saveStatus})]})}),t[35]=e.saveStatus,t[36]=a);let o;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(ce,{htmlFor:`budget-target`,children:`Limit (USD)`}),t[37]=o):o=t[37];let s;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(tt,{align:`inline-start`,children:(0,Z.jsx)(rt,{children:`$`})}),t[38]=s):s=t[38];let c=!e.canEditBudget,l;t[39]===e?l=t[40]:(l=t=>e.onBudgetInputChange(xe(t.target.value)),t[39]=e,t[40]=l);let d;t[41]!==e.budgetInput||t[42]!==c||t[43]!==l?(d=(0,Z.jsxs)($e,{className:`flex-1`,children:[s,(0,Z.jsx)(it,{id:`budget-target`,inputMode:`decimal`,placeholder:`2500`,value:e.budgetInput,disabled:c,onChange:l})]}),t[41]=e.budgetInput,t[42]=c,t[43]=l,t[44]=d):d=t[44];let f=!e.canEditBudget||e.isSaveDisabled,p;t[45]!==e.onBudgetSave||t[46]!==f?(p=(0,Z.jsx)(u,{type:`button`,onClick:e.onBudgetSave,disabled:f,children:`Save`}),t[45]=e.onBudgetSave,t[46]=f,t[47]=p):p=t[47];let m=!e.canEditBudget||e.isSavePending||!e.hasBudgetConfigured&&e.budgetInput.length===0,h;t[48]!==e.onBudgetClear||t[49]!==m?(h=(0,Z.jsx)(u,{type:`button`,variant:`outline`,onClick:e.onBudgetClear,disabled:m,children:`Clear`}),t[48]=e.onBudgetClear,t[49]=m,t[50]=h):h=t[50];let g;t[51]!==h||t[52]!==p?(g=(0,Z.jsxs)(`div`,{className:`flex flex-wrap gap-2 xl:shrink-0`,children:[p,h]}),t[51]=h,t[52]=p,t[53]=g):g=t[53];let _;t[54]!==g||t[55]!==d?(_=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-3 xl:flex-row xl:items-center`,children:[d,g]}),t[54]=g,t[55]=d,t[56]=_):_=t[56];let v=e.canEditBudget?e.isBudgetInputInvalid?`Enter a valid non-negative USD amount.`:`Leave blank to clear the limit.`:`Only admins and owners can update the monthly spend limit.`,y;t[57]===v?y=t[58]:(y=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:v}),t[57]=v,t[58]=y);let b;t[59]!==_||t[60]!==y?(b=(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[o,_,y]}),t[59]=_,t[60]=y,t[61]=b):b=t[61];let x;t[62]!==r||t[63]!==b?(x=(0,Z.jsxs)(H,{className:`space-y-4`,children:[b,r]}),t[62]=r,t[63]=b,t[64]=x):x=t[64];let S;return t[65]!==x||t[66]!==a?(S=(0,Z.jsxs)(G,{children:[a,x]}),t[65]=x,t[66]=a,t[67]=S):S=t[67],S}var st=2e3,ct=3e3,lt=`Failed to save monthly budget`,Q={CLEAR:`budgetSettings/clear`,INPUT_CHANGED:`budgetSettings/inputChanged`,SAVE:`budgetSettings/save`,SAVE_FAILED:`budgetSettings/saveFailed`,SAVE_SUCCEEDED:`budgetSettings/saveSucceeded`,SETTINGS_SYNCED:`budgetSettings/settingsSynced`},$={EDITING:`editing`,ERROR:`error`,SAVED:`saved`,SAVING:`saving`},ut=class extends pe(`BudgetSaveError`)(){};function dt(e){return{budgetInput:be(e),nextSaveRequestId:1,pendingSaveRequest:null,persistedBudgetUsd:e}}function ft(e){let t=X(e.budgetInput);if(t===`invalid`)throw Error(`Budget input must be valid before saving`);return t}function pt(e){return!Ce({currentBudgetUsd:e.persistedBudgetUsd,isPending:!1,parsedBudgetInput:X(e.budgetInput)})}function mt(e){return e.persistedBudgetUsd!==null||e.budgetInput.trim().length>0}function ht(e){return e===$.SAVING?`saving`:e===$.SAVED?`saved`:e===$.ERROR?`error`:`idle`}async function gt(e){return me.tryPromise({try:()=>e.saveBudget(e.nextBudgetUsd),catch:t=>new ut({cause:t,message:e.errorMessage})})}function _t(e,t={}){let n=t.savedIdleDelayMs??st,r=t.errorIdleDelayMs??ct;return ue({actions:{clearPendingSaveRequest:K({pendingSaveRequest:()=>null}),updateBudgetInput:K({budgetInput:(e,t)=>t.value}),clearBudgetInput:K({budgetInput:()=>``}),syncBudgetFromSettings:K({persistedBudgetUsd:(e,t)=>t.monthlyBudgetUsd,budgetInput:(e,t)=>be(t.monthlyBudgetUsd)}),startSaveRequest:K(({context:e})=>({nextSaveRequestId:e.nextSaveRequestId+1,pendingSaveRequest:{nextBudgetUsd:ft(e),requestId:e.nextSaveRequestId}})),storePersistedBudget:K(({context:e,event:t})=>(de(t,Q.SAVE_SUCCEEDED),e.pendingSaveRequest?.requestId===t.requestId?{budgetInput:be(t.monthlyBudgetUsd),persistedBudgetUsd:t.monthlyBudgetUsd}:{}))},guards:{canSave:({context:e})=>pt(e),canClear:({context:e})=>mt(e),matchesPendingSaveRequest:({context:e,event:t})=>t.type!==Q.SAVE_FAILED&&t.type!==Q.SAVE_SUCCEEDED?!1:e.pendingSaveRequest?.requestId===t.requestId},types:{}}).createMachine({context:dt(e.initialBudgetUsd),id:`budgetSettings`,initial:$.EDITING,on:{[Q.SETTINGS_SYNCED]:{actions:{type:`syncBudgetFromSettings`,params:({event:e})=>({monthlyBudgetUsd:e.monthlyBudgetUsd})}}},states:{[$.EDITING]:{on:{[Q.INPUT_CHANGED]:{actions:{type:`updateBudgetInput`,params:({event:e})=>({value:e.value})}},[Q.SAVE]:{guard:`canSave`,actions:`startSaveRequest`,target:$.SAVING},[Q.CLEAR]:{guard:`canClear`,actions:[`clearBudgetInput`,`startSaveRequest`],target:$.SAVING}}},[$.SAVING]:{on:{[Q.INPUT_CHANGED]:{actions:{type:`updateBudgetInput`,params:({event:e})=>({value:e.value})}},[Q.SAVE_SUCCEEDED]:{actions:[`storePersistedBudget`,`clearPendingSaveRequest`],guard:`matchesPendingSaveRequest`,target:$.SAVED},[Q.SAVE_FAILED]:{actions:`clearPendingSaveRequest`,guard:`matchesPendingSaveRequest`,target:$.ERROR}}},[$.SAVED]:{after:{[n]:$.EDITING},on:{[Q.INPUT_CHANGED]:{target:$.EDITING,actions:{type:`updateBudgetInput`,params:({event:e})=>({value:e.value})}},[Q.SAVE]:{guard:`canSave`,actions:`startSaveRequest`,target:$.SAVING},[Q.CLEAR]:{guard:`canClear`,actions:[`clearBudgetInput`,`startSaveRequest`],target:$.SAVING}}},[$.ERROR]:{after:{[r]:$.EDITING},on:{[Q.INPUT_CHANGED]:{target:$.EDITING,actions:{type:`updateBudgetInput`,params:({event:e})=>({value:e.value})}},[Q.SAVE]:{guard:`canSave`,actions:`startSaveRequest`,target:$.SAVING},[Q.CLEAR]:{guard:`canClear`,actions:[`clearBudgetInput`,`startSaveRequest`],target:$.SAVING}}}}})}function vt(e){let t=(0,q.c)(41),n;t[0]===e.monthlyBudgetUsd?n=t[1]:(n=()=>_t({initialBudgetUsd:e.monthlyBudgetUsd}),t[0]=e.monthlyBudgetUsd,t[1]=n);let[r]=(0,J.useState)(n),[i,a]=fe(r),o=i.context.pendingSaveRequest,s;t[2]===i?s=t[3]:(s=i.matches($.SAVING),t[2]=i,t[3]=s);let c=s,l,u;t[4]!==e.monthlyBudgetUsd||t[5]!==a?(l=()=>{a({monthlyBudgetUsd:e.monthlyBudgetUsd,type:Q.SETTINGS_SYNCED})},u=[e.monthlyBudgetUsd,a],t[4]=e.monthlyBudgetUsd,t[5]=a,t[6]=l,t[7]=u):(l=t[6],u=t[7]),(0,J.useEffect)(l,u);let d,f;t[8]!==e.errorMessage||t[9]!==e.saveBudget||t[10]!==c||t[11]!==o||t[12]!==a?(d=()=>{if(!c||o===null)return;let t=!1;return gt({errorMessage:e.errorMessage??lt,nextBudgetUsd:o.nextBudgetUsd,saveBudget:e.saveBudget}).then(e=>{if(!t){if(e.isErr()){w.error(e.error.message),a({requestId:o.requestId,type:Q.SAVE_FAILED});return}a({monthlyBudgetUsd:e.value.monthlyBudgetUsd,requestId:o.requestId,type:Q.SAVE_SUCCEEDED})}}),()=>{t=!0}},f=[e.errorMessage,e.saveBudget,c,o,a],t[8]=e.errorMessage,t[9]=e.saveBudget,t[10]=c,t[11]=o,t[12]=a,t[13]=d,t[14]=f):(d=t[13],f=t[14]),(0,J.useEffect)(d,f);let p;t[15]===a?p=t[16]:(p=e=>{a({type:Q.INPUT_CHANGED,value:e})},t[15]=a,t[16]=p);let m=p,h;t[17]===a?h=t[18]:(h=()=>{a({type:Q.SAVE})},t[17]=a,t[18]=h);let g=h,_;t[19]===a?_=t[20]:(_=()=>{a({type:Q.CLEAR})},t[19]=a,t[20]=_);let v=_,y,b,x,S,C,T;if(t[21]!==v||t[22]!==i){let e=X(i.context.budgetInput);y=i.matches($.SAVING),T=i.context.budgetInput,b=v,x=i.context.persistedBudgetUsd!==null,S=e===`invalid`,C=Ce({parsedBudgetInput:e,currentBudgetUsd:i.context.persistedBudgetUsd,isPending:y}),t[21]=v,t[22]=i,t[23]=y,t[24]=b,t[25]=x,t[26]=S,t[27]=C,t[28]=T}else y=t[23],b=t[24],x=t[25],S=t[26],C=t[27],T=t[28];let E=String(i.value),D;t[29]===E?D=t[30]:(D=ht(E),t[29]=E,t[30]=D);let O;return t[31]!==y||t[32]!==g||t[33]!==m||t[34]!==b||t[35]!==x||t[36]!==S||t[37]!==C||t[38]!==D||t[39]!==T?(O={budgetInput:T,clear:b,hasBudgetConfigured:x,isBudgetInputInvalid:S,isSaveDisabled:C,isSavePending:y,save:g,saveStatus:D,setBudgetInput:m},t[31]=y,t[32]=g,t[33]=m,t[34]=b,t[35]=x,t[36]=S,t[37]=C,t[38]=D,t[39]=T,t[40]=O):O=t[40],O}var yt=i(`/_authenticated/$org_slug/budget`);function bt(){let e=(0,q.c)(57),t=a(),n=D(),{organizationId:r,organizationSlug:i,session:o}=yt.useRouteContext(),s=o.user.id,{days:c}=yt.useSearch(),l=(0,J.useDeferredValue)(c),u=l!==c,d;e[0]===i?d=e[1]:(d=re(i),e[0]=i,e[1]=d);let f=d,p;e[2]!==s||e[3]!==r?(p=ie(s,r),e[2]=s,e[3]=r,e[4]=p):p=e[4];let{data:m}=_(p),h;e[5]!==l||e[6]!==r?(h=O(r,l),e[5]=l,e[6]=r,e[7]=h):h=e[7];let{data:g}=_(h),{data:v}=_(f),y;e[8]!==s||e[9]!==m?(y=k({currentUserId:s,members:m}),e[8]=s,e[9]=m,e[10]=y):y=e[10];let{canUpdateOrganizationSettings:b}=y,x;e[11]===g.dailyCost?x=e[12]:(x=ee(g.dailyCost),e[11]=g.dailyCost,e[12]=x);let S=x,C=v.monthlyBudgetUsd,w;e[13]!==g.overview.totalCostUsd||e[14]!==C?(w=ne({monthlyBudgetUsd:C,totalSpendUsd:g.overview.totalCostUsd}),e[13]=g.overview.totalCostUsd,e[14]=C,e[15]=w):w=e[15];let T=w,A;e[16]!==i||e[17]!==n?(A=async e=>{let t=await E(i,{monthlyBudgetUsd:e});return n.setQueryData(re(i).queryKey,t),t},e[16]=i,e[17]=n,e[18]=A):A=e[18];let j=A,M;e[19]!==j||e[20]!==v.monthlyBudgetUsd?(M={errorMessage:`Failed to save monthly budget`,monthlyBudgetUsd:v.monthlyBudgetUsd,saveBudget:j},e[19]=j,e[20]=v.monthlyBudgetUsd,e[21]=M):M=e[21];let N=vt(M),P;e[22]!==t||e[23]!==i||e[24]!==c?(P=function(e){let n=e[0];if(!n)return;let r=Number(n),a=te.safeParse(r);!a.success||a.data===c||(0,J.startTransition)(()=>{t({params:{org_slug:i},replace:!0,search:{days:a.data},to:`/$org_slug/budget`})})},e[22]=t,e[23]=i,e[24]=c,e[25]=P):P=e[25];let F=P,I;e[26]!==T||e[27]!==g.generatedAt||e[28]!==F||e[29]!==u||e[30]!==c?(I=(0,Z.jsx)(Je,{budgetLimitState:T,generatedAt:g.generatedAt,isWindowChangePending:u,selectedDays:c,onWindowChange:F}),e[26]=T,e[27]=g.generatedAt,e[28]=F,e[29]=u,e[30]=c,e[31]=I):I=e[31];let L;e[32]!==T||e[33]!==N.budgetInput||e[34]!==N.clear||e[35]!==N.hasBudgetConfigured||e[36]!==N.isBudgetInputInvalid||e[37]!==N.isSaveDisabled||e[38]!==N.isSavePending||e[39]!==N.save||e[40]!==N.saveStatus||e[41]!==N.setBudgetInput||e[42]!==b||e[43]!==g.overview.totalCostUsd?(L=(0,Z.jsx)(ot,{budgetInput:N.budgetInput,onBudgetInputChange:N.setBudgetInput,onBudgetSave:N.save,onBudgetClear:N.clear,canEditBudget:b,saveStatus:N.saveStatus,isSavePending:N.isSavePending,isSaveDisabled:N.isSaveDisabled,hasBudgetConfigured:N.hasBudgetConfigured,isBudgetInputInvalid:N.isBudgetInputInvalid,budgetLimitState:T,totalSpendUsd:g.overview.totalCostUsd}),e[32]=T,e[33]=N.budgetInput,e[34]=N.clear,e[35]=N.hasBudgetConfigured,e[36]=N.isBudgetInputInvalid,e[37]=N.isSaveDisabled,e[38]=N.isSavePending,e[39]=N.save,e[40]=N.saveStatus,e[41]=N.setBudgetInput,e[42]=b,e[43]=g.overview.totalCostUsd,e[44]=L):L=e[44];let R;e[45]!==T||e[46]!==g.overview||e[47]!==S?(R=(0,Z.jsx)(Qe,{budgetLimitState:T,overview:g.overview,peakSpendDay:S}),e[45]=T,e[46]=g.overview,e[47]=S,e[48]=R):R=e[48];let z;e[49]!==T||e[50]!==g?(z=(0,Z.jsx)(Ie,{data:g,budgetLimitState:T}),e[49]=T,e[50]=g,e[51]=z):z=e[51];let B;return e[52]!==L||e[53]!==R||e[54]!==z||e[55]!==I?(B=(0,Z.jsxs)(`div`,{className:`space-y-8 p-8`,children:[I,L,R,z]}),e[52]=L,e[53]=R,e[54]=z,e[55]=I,e[56]=B):B=e[56],B}var xt=bt;export{xt as component};
|