@hanzo/ui 5.3.39 → 5.3.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/billing/index.js +3 -0
- package/dist/billing/index.mjs +3 -0
- package/dist/navigation/hanzo-shell.js +3 -0
- package/dist/navigation/hanzo-shell.mjs +3 -0
- package/dist/navigation/index.js +2 -2
- package/dist/navigation/index.mjs +2 -2
- package/dist/tailwind/index.js +1 -2
- package/dist/types/index.js +1 -2
- package/dist/util/index.js +1 -80
- package/package.json +14 -3
- package/dist/assets/ai-icons.d.ts +0 -28
- package/dist/assets/ai-icons.d.ts.map +0 -1
- package/dist/assets/ai-icons.js +0 -60
- package/dist/assets/crypto.d.ts +0 -7
- package/dist/assets/crypto.d.ts.map +0 -1
- package/dist/assets/crypto.js +0 -4
- package/dist/assets/file-type-icon.d.ts +0 -7
- package/dist/assets/file-type-icon.d.ts.map +0 -1
- package/dist/assets/file-type-icon.js +0 -36
- package/dist/assets/file.d.ts +0 -5
- package/dist/assets/file.d.ts.map +0 -1
- package/dist/assets/file.js +0 -29
- package/dist/assets/general.d.ts +0 -220
- package/dist/assets/general.d.ts.map +0 -1
- package/dist/assets/general.js +0 -136
- package/dist/assets/hanzo-logo.d.ts +0 -4
- package/dist/assets/hanzo-logo.d.ts.map +0 -1
- package/dist/assets/hanzo-logo.js +0 -3
- package/dist/assets/index.d.ts +0 -7
- package/dist/assets/index.d.ts.map +0 -1
- package/dist/assets/index.js +0 -23
- package/dist/assets/llm-provider.d.ts +0 -64
- package/dist/assets/llm-provider.d.ts.map +0 -1
- package/dist/assets/llm-provider.js +0 -90
- package/dist/components/cal-embed.d.ts +0 -11
- package/dist/components/cal-embed.d.ts.map +0 -1
- package/dist/components/cal-embed.js +0 -38
- package/dist/components/index.d.ts +0 -3
- package/dist/components/index.d.ts.map +0 -1
- package/dist/components/index.js +0 -7
- package/dist/frameworks/core/index.d.ts +0 -4
- package/dist/frameworks/core/index.d.ts.map +0 -1
- package/dist/frameworks/core/index.js +0 -5
- package/dist/frameworks/core/styles.d.ts +0 -12
- package/dist/frameworks/core/styles.d.ts.map +0 -1
- package/dist/frameworks/core/styles.js +0 -11
- package/dist/frameworks/core/types.d.ts +0 -17
- package/dist/frameworks/core/types.d.ts.map +0 -1
- package/dist/frameworks/core/types.js +0 -11
- package/dist/frameworks/core/utils/index.d.ts +0 -19
- package/dist/frameworks/core/utils/index.d.ts.map +0 -1
- package/dist/frameworks/core/utils/index.js +0 -49
- package/dist/frameworks/react/components/button.d.ts +0 -8
- package/dist/frameworks/react/components/button.d.ts.map +0 -1
- package/dist/frameworks/react/components/button.js +0 -8
- package/dist/frameworks/react/components/index.d.ts +0 -2
- package/dist/frameworks/react/components/index.d.ts.map +0 -1
- package/dist/frameworks/react/components/index.js +0 -4
- package/dist/frameworks/react/hooks/index.d.ts +0 -2
- package/dist/frameworks/react/hooks/index.d.ts.map +0 -1
- package/dist/frameworks/react/hooks/index.js +0 -5
- package/dist/frameworks/react/index.d.ts +0 -5
- package/dist/frameworks/react/index.d.ts.map +0 -1
- package/dist/frameworks/react/index.js +0 -7
- package/dist/frameworks/react/utils/index.d.ts +0 -2
- package/dist/frameworks/react/utils/index.d.ts.map +0 -1
- package/dist/frameworks/react/utils/index.js +0 -2
- package/dist/frameworks/react-native/components.d.ts +0 -17
- package/dist/frameworks/react-native/components.d.ts.map +0 -1
- package/dist/frameworks/react-native/components.js +0 -17
- package/dist/frameworks/react-native/hooks.d.ts +0 -10
- package/dist/frameworks/react-native/hooks.d.ts.map +0 -1
- package/dist/frameworks/react-native/hooks.js +0 -9
- package/dist/frameworks/react-native/index.d.ts +0 -5
- package/dist/frameworks/react-native/index.d.ts.map +0 -1
- package/dist/frameworks/react-native/index.js +0 -7
- package/dist/frameworks/react-native/utils.d.ts +0 -7
- package/dist/frameworks/react-native/utils.d.ts.map +0 -1
- package/dist/frameworks/react-native/utils.js +0 -9
- package/dist/frameworks/svelte/components.d.ts +0 -15
- package/dist/frameworks/svelte/components.d.ts.map +0 -1
- package/dist/frameworks/svelte/components.js +0 -16
- package/dist/frameworks/svelte/index.d.ts +0 -5
- package/dist/frameworks/svelte/index.d.ts.map +0 -1
- package/dist/frameworks/svelte/index.js +0 -7
- package/dist/frameworks/svelte/stores.d.ts +0 -13
- package/dist/frameworks/svelte/stores.d.ts.map +0 -1
- package/dist/frameworks/svelte/stores.js +0 -9
- package/dist/frameworks/svelte/utils.d.ts +0 -7
- package/dist/frameworks/svelte/utils.d.ts.map +0 -1
- package/dist/frameworks/svelte/utils.js +0 -8
- package/dist/frameworks/vue/components.d.ts +0 -15
- package/dist/frameworks/vue/components.d.ts.map +0 -1
- package/dist/frameworks/vue/components.js +0 -16
- package/dist/frameworks/vue/composables.d.ts +0 -16
- package/dist/frameworks/vue/composables.d.ts.map +0 -1
- package/dist/frameworks/vue/composables.js +0 -14
- package/dist/frameworks/vue/index.d.ts +0 -5
- package/dist/frameworks/vue/index.d.ts.map +0 -1
- package/dist/frameworks/vue/index.js +0 -7
- package/dist/frameworks/vue/utils.d.ts +0 -7
- package/dist/frameworks/vue/utils.d.ts.map +0 -1
- package/dist/frameworks/vue/utils.js +0 -8
- package/dist/helpers/file.d.ts +0 -7
- package/dist/helpers/file.d.ts.map +0 -1
- package/dist/helpers/file.js +0 -30
- package/dist/helpers/memoization.d.ts +0 -9
- package/dist/helpers/memoization.d.ts.map +0 -1
- package/dist/helpers/memoization.js +0 -24
- package/dist/primitives/accordion.d.ts +0 -27
- package/dist/primitives/accordion.d.ts.map +0 -1
- package/dist/primitives/accordion.js +0 -12
- package/dist/primitives/action-button.d.ts +0 -10
- package/dist/primitives/action-button.d.ts.map +0 -1
- package/dist/primitives/action-button.js +0 -14
- package/dist/primitives/alert-dialog.d.ts +0 -57
- package/dist/primitives/alert-dialog.d.ts.map +0 -1
- package/dist/primitives/alert-dialog.js +0 -25
- package/dist/primitives/alert.d.ts +0 -11
- package/dist/primitives/alert.d.ts.map +0 -1
- package/dist/primitives/alert.js +0 -32
- package/dist/primitives/apply-typography.d.ts +0 -8
- package/dist/primitives/apply-typography.d.ts.map +0 -1
- package/dist/primitives/apply-typography.js +0 -36
- package/dist/primitives/aspect-ratio.d.ts +0 -4
- package/dist/primitives/aspect-ratio.d.ts.map +0 -1
- package/dist/primitives/aspect-ratio.js +0 -4
- package/dist/primitives/avatar.d.ts +0 -25
- package/dist/primitives/avatar.d.ts.map +0 -1
- package/dist/primitives/avatar.js +0 -10
- package/dist/primitives/badge.d.ts +0 -11
- package/dist/primitives/badge.d.ts.map +0 -1
- package/dist/primitives/badge.js +0 -28
- package/dist/primitives/breadcrumb.d.ts +0 -51
- package/dist/primitives/breadcrumb.d.ts.map +0 -1
- package/dist/primitives/breadcrumb.js +0 -22
- package/dist/primitives/breakpoint-indicator.d.ts +0 -4
- package/dist/primitives/breakpoint-indicator.d.ts.map +0 -1
- package/dist/primitives/breakpoint-indicator.js +0 -7
- package/dist/primitives/button-group.d.ts +0 -12
- package/dist/primitives/button-group.d.ts.map +0 -1
- package/dist/primitives/button-group.js +0 -28
- package/dist/primitives/button.d.ts +0 -14
- package/dist/primitives/button.d.ts.map +0 -1
- package/dist/primitives/button.js +0 -41
- package/dist/primitives/cal-embed.d.ts +0 -11
- package/dist/primitives/cal-embed.d.ts.map +0 -1
- package/dist/primitives/cal-embed.js +0 -38
- package/dist/primitives/calendar.d.ts +0 -11
- package/dist/primitives/calendar.d.ts.map +0 -1
- package/dist/primitives/calendar.js +0 -58
- package/dist/primitives/card.d.ts +0 -10
- package/dist/primitives/card.d.ts.map +0 -1
- package/dist/primitives/card.js +0 -24
- package/dist/primitives/carousel.d.ts +0 -19
- package/dist/primitives/carousel.d.ts.map +0 -1
- package/dist/primitives/carousel.js +0 -95
- package/dist/primitives/chart.d.ts +0 -41
- package/dist/primitives/chart.d.ts.map +0 -1
- package/dist/primitives/chart.js +0 -128
- package/dist/primitives/charts/area/chart-area-axes.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-axes.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-axes.js +0 -31
- package/dist/primitives/charts/area/chart-area-default.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-default.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-default.js +0 -27
- package/dist/primitives/charts/area/chart-area-gradient.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-gradient.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-gradient.js +0 -31
- package/dist/primitives/charts/area/chart-area-icons.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-icons.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-icons.js +0 -33
- package/dist/primitives/charts/area/chart-area-interactive.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-interactive.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-interactive.js +0 -143
- package/dist/primitives/charts/area/chart-area-legend.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-legend.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-legend.js +0 -31
- package/dist/primitives/charts/area/chart-area-linear.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-linear.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-linear.js +0 -27
- package/dist/primitives/charts/area/chart-area-stacked-expand.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-stacked-expand.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-stacked-expand.js +0 -36
- package/dist/primitives/charts/area/chart-area-stacked.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-stacked.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-stacked.js +0 -31
- package/dist/primitives/charts/area/chart-area-step.d.ts +0 -3
- package/dist/primitives/charts/area/chart-area-step.d.ts.map +0 -1
- package/dist/primitives/charts/area/chart-area-step.js +0 -28
- package/dist/primitives/charts/area/index.d.ts +0 -11
- package/dist/primitives/charts/area/index.d.ts.map +0 -1
- package/dist/primitives/charts/area/index.js +0 -11
- package/dist/primitives/charts/bar/chart-bar-active.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-active.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-active.js +0 -44
- package/dist/primitives/charts/bar/chart-bar-default.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-default.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-default.js +0 -24
- package/dist/primitives/charts/bar/chart-bar-horizontal.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-horizontal.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-horizontal.js +0 -26
- package/dist/primitives/charts/bar/chart-bar-interactive.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-interactive.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-interactive.js +0 -139
- package/dist/primitives/charts/bar/chart-bar-label-custom.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-label-custom.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-label-custom.js +0 -33
- package/dist/primitives/charts/bar/chart-bar-label.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-label.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-label.js +0 -26
- package/dist/primitives/charts/bar/chart-bar-mixed.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-mixed.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-mixed.js +0 -44
- package/dist/primitives/charts/bar/chart-bar-multiple.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-multiple.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-multiple.js +0 -28
- package/dist/primitives/charts/bar/chart-bar-negative.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-negative.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-negative.js +0 -25
- package/dist/primitives/charts/bar/chart-bar-stacked.d.ts +0 -3
- package/dist/primitives/charts/bar/chart-bar-stacked.d.ts.map +0 -1
- package/dist/primitives/charts/bar/chart-bar-stacked.js +0 -28
- package/dist/primitives/charts/bar/index.d.ts +0 -11
- package/dist/primitives/charts/bar/index.d.ts.map +0 -1
- package/dist/primitives/charts/bar/index.js +0 -11
- package/dist/primitives/charts/index.d.ts +0 -8
- package/dist/primitives/charts/index.d.ts.map +0 -1
- package/dist/primitives/charts/index.js +0 -11
- package/dist/primitives/charts/line/chart-line-default.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-default.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-default.js +0 -27
- package/dist/primitives/charts/line/chart-line-dots-colors.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-dots-colors.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-dots-colors.js +0 -49
- package/dist/primitives/charts/line/chart-line-dots-custom.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-dots-custom.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-dots-custom.js +0 -34
- package/dist/primitives/charts/line/chart-line-dots.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-dots.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-dots.js +0 -35
- package/dist/primitives/charts/line/chart-line-interactive.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-interactive.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-interactive.js +0 -139
- package/dist/primitives/charts/line/chart-line-label-custom.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-label-custom.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-label-custom.js +0 -51
- package/dist/primitives/charts/line/chart-line-label.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-label.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-label.js +0 -36
- package/dist/primitives/charts/line/chart-line-linear.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-linear.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-linear.js +0 -27
- package/dist/primitives/charts/line/chart-line-multiple.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-multiple.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-multiple.js +0 -31
- package/dist/primitives/charts/line/chart-line-step.d.ts +0 -3
- package/dist/primitives/charts/line/chart-line-step.d.ts.map +0 -1
- package/dist/primitives/charts/line/chart-line-step.js +0 -27
- package/dist/primitives/charts/line/index.d.ts +0 -11
- package/dist/primitives/charts/line/index.d.ts.map +0 -1
- package/dist/primitives/charts/line/index.js +0 -11
- package/dist/primitives/charts/pie/chart-pie-donut-active.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-donut-active.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-donut-active.js +0 -42
- package/dist/primitives/charts/pie/chart-pie-donut-text.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-donut-text.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-donut-text.js +0 -50
- package/dist/primitives/charts/pie/chart-pie-donut.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-donut.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-donut.js +0 -42
- package/dist/primitives/charts/pie/chart-pie-interactive.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-interactive.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-interactive.js +0 -65
- package/dist/primitives/charts/pie/chart-pie-label-custom.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-label-custom.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-label-custom.js +0 -44
- package/dist/primitives/charts/pie/chart-pie-label-list.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-label-list.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-label-list.js +0 -42
- package/dist/primitives/charts/pie/chart-pie-label.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-label.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-label.js +0 -42
- package/dist/primitives/charts/pie/chart-pie-legend.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-legend.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-legend.js +0 -41
- package/dist/primitives/charts/pie/chart-pie-separator-none.d.ts +0 -3
- package/dist/primitives/charts/pie/chart-pie-separator-none.d.ts.map +0 -1
- package/dist/primitives/charts/pie/chart-pie-separator-none.js +0 -42
- package/dist/primitives/charts/pie/index.d.ts +0 -10
- package/dist/primitives/charts/pie/index.d.ts.map +0 -1
- package/dist/primitives/charts/pie/index.js +0 -10
- package/dist/primitives/charts/radar/chart-radar-default.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-default.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-default.js +0 -24
- package/dist/primitives/charts/radar/chart-radar-dots.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-dots.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-dots.js +0 -27
- package/dist/primitives/charts/radar/chart-radar-grid-circle-fill.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-grid-circle-fill.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-grid-circle-fill.js +0 -24
- package/dist/primitives/charts/radar/chart-radar-grid-circle-no-lines.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-grid-circle-no-lines.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-grid-circle-no-lines.js +0 -27
- package/dist/primitives/charts/radar/chart-radar-grid-circle.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-grid-circle.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-grid-circle.js +0 -27
- package/dist/primitives/charts/radar/chart-radar-grid-custom.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-grid-custom.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-grid-custom.js +0 -24
- package/dist/primitives/charts/radar/chart-radar-grid-fill.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-grid-fill.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-grid-fill.js +0 -24
- package/dist/primitives/charts/radar/chart-radar-grid-none.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-grid-none.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-grid-none.js +0 -27
- package/dist/primitives/charts/radar/chart-radar-icons.d.ts +0 -3
- package/dist/primitives/charts/radar/chart-radar-icons.d.ts.map +0 -1
- package/dist/primitives/charts/radar/chart-radar-icons.js +0 -33
- package/dist/primitives/charts/radar/index.d.ts +0 -10
- package/dist/primitives/charts/radar/index.d.ts.map +0 -1
- package/dist/primitives/charts/radar/index.js +0 -10
- package/dist/primitives/charts/radial/chart-radial-grid.d.ts +0 -3
- package/dist/primitives/charts/radial/chart-radial-grid.d.ts.map +0 -1
- package/dist/primitives/charts/radial/chart-radial-grid.js +0 -42
- package/dist/primitives/charts/radial/chart-radial-label.d.ts +0 -3
- package/dist/primitives/charts/radial/chart-radial-label.d.ts.map +0 -1
- package/dist/primitives/charts/radial/chart-radial-label.js +0 -42
- package/dist/primitives/charts/radial/chart-radial-shape.d.ts +0 -3
- package/dist/primitives/charts/radial/chart-radial-shape.d.ts.map +0 -1
- package/dist/primitives/charts/radial/chart-radial-shape.js +0 -26
- package/dist/primitives/charts/radial/chart-radial-simple.d.ts +0 -3
- package/dist/primitives/charts/radial/chart-radial-simple.d.ts.map +0 -1
- package/dist/primitives/charts/radial/chart-radial-simple.js +0 -42
- package/dist/primitives/charts/radial/chart-radial-stacked.d.ts +0 -3
- package/dist/primitives/charts/radial/chart-radial-stacked.d.ts.map +0 -1
- package/dist/primitives/charts/radial/chart-radial-stacked.js +0 -26
- package/dist/primitives/charts/radial/chart-radial-text.d.ts +0 -3
- package/dist/primitives/charts/radial/chart-radial-text.d.ts.map +0 -1
- package/dist/primitives/charts/radial/chart-radial-text.js +0 -26
- package/dist/primitives/charts/radial/index.d.ts +0 -7
- package/dist/primitives/charts/radial/index.d.ts.map +0 -1
- package/dist/primitives/charts/radial/index.js +0 -7
- package/dist/primitives/charts/tooltip/chart-tooltip-advanced.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-advanced.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-advanced.js +0 -34
- package/dist/primitives/charts/tooltip/chart-tooltip-default.d.ts +0 -5
- package/dist/primitives/charts/tooltip/chart-tooltip-default.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-default.js +0 -33
- package/dist/primitives/charts/tooltip/chart-tooltip-formatter.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-formatter.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-formatter.js +0 -32
- package/dist/primitives/charts/tooltip/chart-tooltip-icons.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-icons.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-icons.js +0 -34
- package/dist/primitives/charts/tooltip/chart-tooltip-indicator-line.d.ts +0 -5
- package/dist/primitives/charts/tooltip/chart-tooltip-indicator-line.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-indicator-line.js +0 -33
- package/dist/primitives/charts/tooltip/chart-tooltip-indicator-none.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-indicator-none.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-indicator-none.js +0 -31
- package/dist/primitives/charts/tooltip/chart-tooltip-label-custom.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-label-custom.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-label-custom.js +0 -34
- package/dist/primitives/charts/tooltip/chart-tooltip-label-formatter.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-label-formatter.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-label-formatter.js +0 -37
- package/dist/primitives/charts/tooltip/chart-tooltip-label-none.d.ts +0 -3
- package/dist/primitives/charts/tooltip/chart-tooltip-label-none.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/chart-tooltip-label-none.js +0 -31
- package/dist/primitives/charts/tooltip/index.d.ts +0 -10
- package/dist/primitives/charts/tooltip/index.d.ts.map +0 -1
- package/dist/primitives/charts/tooltip/index.js +0 -10
- package/dist/primitives/chat/chat-input-area.d.ts +0 -24
- package/dist/primitives/chat/chat-input-area.d.ts.map +0 -1
- package/dist/primitives/chat/chat-input-area.js +0 -23
- package/dist/primitives/chat/chat-input.d.ts +0 -13
- package/dist/primitives/chat/chat-input.d.ts.map +0 -1
- package/dist/primitives/chat/chat-input.js +0 -33
- package/dist/primitives/chat/json-form.d.ts +0 -4
- package/dist/primitives/chat/json-form.d.ts.map +0 -1
- package/dist/primitives/chat/json-form.js +0 -6
- package/dist/primitives/checkbox.d.ts +0 -12
- package/dist/primitives/checkbox.d.ts.map +0 -1
- package/dist/primitives/checkbox.js +0 -8
- package/dist/primitives/collapsible.d.ts +0 -6
- package/dist/primitives/collapsible.d.ts.map +0 -1
- package/dist/primitives/collapsible.js +0 -5
- package/dist/primitives/combobox.d.ts +0 -42
- package/dist/primitives/combobox.d.ts.map +0 -1
- package/dist/primitives/combobox.js +0 -49
- package/dist/primitives/command.d.ts +0 -39
- package/dist/primitives/command.d.ts.map +0 -1
- package/dist/primitives/command.js +0 -28
- package/dist/primitives/context-menu.d.ts +0 -54
- package/dist/primitives/context-menu.d.ts.map +0 -1
- package/dist/primitives/context-menu.js +0 -32
- package/dist/primitives/copy-to-clipboard-icon.d.ts +0 -15
- package/dist/primitives/copy-to-clipboard-icon.d.ts.map +0 -1
- package/dist/primitives/copy-to-clipboard-icon.js +0 -21
- package/dist/primitives/dialog-video-controller.d.ts +0 -4
- package/dist/primitives/dialog-video-controller.d.ts.map +0 -1
- package/dist/primitives/dialog-video-controller.js +0 -23
- package/dist/primitives/dialog.d.ts +0 -18
- package/dist/primitives/dialog.d.ts.map +0 -1
- package/dist/primitives/dialog.js +0 -37
- package/dist/primitives/dot-pattern.d.ts +0 -14
- package/dist/primitives/dot-pattern.d.ts.map +0 -1
- package/dist/primitives/dot-pattern.js +0 -8
- package/dist/primitives/dots-loader.d.ts +0 -5
- package/dist/primitives/dots-loader.d.ts.map +0 -1
- package/dist/primitives/dots-loader.js +0 -5
- package/dist/primitives/drawer.d.ts +0 -38
- package/dist/primitives/drawer.d.ts.map +0 -1
- package/dist/primitives/drawer.js +0 -22
- package/dist/primitives/dropdown-menu.d.ts +0 -52
- package/dist/primitives/dropdown-menu.d.ts.map +0 -1
- package/dist/primitives/dropdown-menu.js +0 -34
- package/dist/primitives/empty.d.ts +0 -12
- package/dist/primitives/empty.d.ts.map +0 -1
- package/dist/primitives/empty.js +0 -33
- package/dist/primitives/error-message.d.ts +0 -7
- package/dist/primitives/error-message.d.ts.map +0 -1
- package/dist/primitives/error-message.js +0 -5
- package/dist/primitives/field.d.ts +0 -10
- package/dist/primitives/field.d.ts.map +0 -1
- package/dist/primitives/field.js +0 -16
- package/dist/primitives/file-uploader.d.ts +0 -20
- package/dist/primitives/file-uploader.d.ts.map +0 -1
- package/dist/primitives/file-uploader.js +0 -68
- package/dist/primitives/form.d.ts +0 -40
- package/dist/primitives/form.d.ts.map +0 -1
- package/dist/primitives/form.js +0 -67
- package/dist/primitives/hover-card.d.ts +0 -10
- package/dist/primitives/hover-card.d.ts.map +0 -1
- package/dist/primitives/hover-card.js +0 -8
- package/dist/primitives/icons/github.d.ts +0 -5
- package/dist/primitives/icons/github.d.ts.map +0 -1
- package/dist/primitives/icons/github.js +0 -3
- package/dist/primitives/icons/index.d.ts +0 -5
- package/dist/primitives/icons/index.d.ts.map +0 -1
- package/dist/primitives/icons/index.js +0 -4
- package/dist/primitives/icons/youtube-logo.d.ts +0 -5
- package/dist/primitives/icons/youtube-logo.d.ts.map +0 -1
- package/dist/primitives/icons/youtube-logo.js +0 -33
- package/dist/primitives/index-blocks.d.ts +0 -5
- package/dist/primitives/index-blocks.d.ts.map +0 -1
- package/dist/primitives/index-blocks.js +0 -6
- package/dist/primitives/index-common.d.ts +0 -75
- package/dist/primitives/index-common.d.ts.map +0 -1
- package/dist/primitives/index-common.js +0 -82
- package/dist/primitives/index-core.d.ts +0 -29
- package/dist/primitives/index-core.d.ts.map +0 -1
- package/dist/primitives/index-core.js +0 -30
- package/dist/primitives/index-next.d.ts +0 -3
- package/dist/primitives/index-next.d.ts.map +0 -1
- package/dist/primitives/index-next.js +0 -4
- package/dist/primitives/index-standard.d.ts +0 -79
- package/dist/primitives/index-standard.d.ts.map +0 -1
- package/dist/primitives/index-standard.js +0 -98
- package/dist/primitives/input-group.d.ts +0 -17
- package/dist/primitives/input-group.d.ts.map +0 -1
- package/dist/primitives/input-group.js +0 -61
- package/dist/primitives/input-otp.d.ts +0 -35
- package/dist/primitives/input-otp.d.ts.map +0 -1
- package/dist/primitives/input-otp.js +0 -19
- package/dist/primitives/input.d.ts +0 -15
- package/dist/primitives/input.d.ts.map +0 -1
- package/dist/primitives/input.js +0 -43
- package/dist/primitives/item.d.ts +0 -24
- package/dist/primitives/item.d.ts.map +0 -1
- package/dist/primitives/item.js +0 -67
- package/dist/primitives/kbd.d.ts +0 -5
- package/dist/primitives/kbd.d.ts.map +0 -1
- package/dist/primitives/kbd.js +0 -9
- package/dist/primitives/label.d.ts +0 -11
- package/dist/primitives/label.d.ts.map +0 -1
- package/dist/primitives/label.js +0 -9
- package/dist/primitives/list-adaptor.d.ts +0 -10
- package/dist/primitives/list-adaptor.d.ts.map +0 -1
- package/dist/primitives/list-adaptor.js +0 -1
- package/dist/primitives/list-box.d.ts +0 -12
- package/dist/primitives/list-box.d.ts.map +0 -1
- package/dist/primitives/list-box.js +0 -10
- package/dist/primitives/loading-spinner.d.ts +0 -6
- package/dist/primitives/loading-spinner.d.ts.map +0 -1
- package/dist/primitives/loading-spinner.js +0 -7
- package/dist/primitives/markdown-preview.d.ts +0 -129
- package/dist/primitives/markdown-preview.d.ts.map +0 -1
- package/dist/primitives/markdown-preview.js +0 -165
- package/dist/primitives/menubar.d.ts +0 -29
- package/dist/primitives/menubar.d.ts.map +0 -1
- package/dist/primitives/menubar.js +0 -46
- package/dist/primitives/mermaid.d.ts +0 -8
- package/dist/primitives/mermaid.d.ts.map +0 -1
- package/dist/primitives/mermaid.js +0 -112
- package/dist/primitives/native-select.d.ts +0 -9
- package/dist/primitives/native-select.d.ts.map +0 -1
- package/dist/primitives/native-select.js +0 -14
- package/dist/primitives/navigation-menu.d.ts +0 -13
- package/dist/primitives/navigation-menu.d.ts.map +0 -1
- package/dist/primitives/navigation-menu.js +0 -29
- package/dist/primitives/next/image.d.ts +0 -12
- package/dist/primitives/next/image.d.ts.map +0 -1
- package/dist/primitives/next/image.js +0 -40
- package/dist/primitives/next/index.d.ts +0 -8
- package/dist/primitives/next/index.d.ts.map +0 -1
- package/dist/primitives/next/index.js +0 -7
- package/dist/primitives/next/inline-icon.d.ts +0 -14
- package/dist/primitives/next/inline-icon.d.ts.map +0 -1
- package/dist/primitives/next/inline-icon.js +0 -13
- package/dist/primitives/next/link-element.d.ts +0 -24
- package/dist/primitives/next/link-element.d.ts.map +0 -1
- package/dist/primitives/next/link-element.js +0 -47
- package/dist/primitives/next/mdx-link.d.ts +0 -4
- package/dist/primitives/next/mdx-link.d.ts.map +0 -1
- package/dist/primitives/next/mdx-link.js +0 -10
- package/dist/primitives/next/media-stack.d.ts +0 -9
- package/dist/primitives/next/media-stack.d.ts.map +0 -1
- package/dist/primitives/next/media-stack.js +0 -20
- package/dist/primitives/next/nav-items.d.ts +0 -11
- package/dist/primitives/next/nav-items.d.ts.map +0 -1
- package/dist/primitives/next/nav-items.js +0 -22
- package/dist/primitives/next/youtube-embed.d.ts +0 -12
- package/dist/primitives/next/youtube-embed.d.ts.map +0 -1
- package/dist/primitives/next/youtube-embed.js +0 -16
- package/dist/primitives/popover.d.ts +0 -12
- package/dist/primitives/popover.d.ts.map +0 -1
- package/dist/primitives/popover.js +0 -10
- package/dist/primitives/pretty-json-print.d.ts +0 -5
- package/dist/primitives/pretty-json-print.d.ts.map +0 -1
- package/dist/primitives/pretty-json-print.js +0 -22
- package/dist/primitives/progress.d.ts +0 -9
- package/dist/primitives/progress.d.ts.map +0 -1
- package/dist/primitives/progress.js +0 -7
- package/dist/primitives/prompt-textarea.d.ts +0 -19
- package/dist/primitives/prompt-textarea.d.ts.map +0 -1
- package/dist/primitives/prompt-textarea.js +0 -30
- package/dist/primitives/radio-group.d.ts +0 -12
- package/dist/primitives/radio-group.d.ts.map +0 -1
- package/dist/primitives/radio-group.js +0 -14
- package/dist/primitives/resizable.d.ts +0 -8
- package/dist/primitives/resizable.d.ts.map +0 -1
- package/dist/primitives/resizable.js +0 -8
- package/dist/primitives/scroll-area.d.ts +0 -14
- package/dist/primitives/scroll-area.d.ts.map +0 -1
- package/dist/primitives/scroll-area.js +0 -10
- package/dist/primitives/search-input.d.ts +0 -14
- package/dist/primitives/search-input.d.ts.map +0 -1
- package/dist/primitives/search-input.js +0 -16
- package/dist/primitives/select.d.ts +0 -27
- package/dist/primitives/select.d.ts.map +0 -1
- package/dist/primitives/select.js +0 -21
- package/dist/primitives/separator.d.ts +0 -9
- package/dist/primitives/separator.d.ts.map +0 -1
- package/dist/primitives/separator.js +0 -7
- package/dist/primitives/sheet.d.ts +0 -41
- package/dist/primitives/sheet.d.ts.map +0 -1
- package/dist/primitives/sheet.js +0 -35
- package/dist/primitives/skeleton.d.ts +0 -5
- package/dist/primitives/skeleton.d.ts.map +0 -1
- package/dist/primitives/skeleton.js +0 -7
- package/dist/primitives/slider.d.ts +0 -6
- package/dist/primitives/slider.d.ts.map +0 -1
- package/dist/primitives/slider.js +0 -15
- package/dist/primitives/sonner.d.ts +0 -6
- package/dist/primitives/sonner.d.ts.map +0 -1
- package/dist/primitives/sonner.js +0 -17
- package/dist/primitives/spinner.d.ts +0 -3
- package/dist/primitives/spinner.d.ts.map +0 -1
- package/dist/primitives/spinner.js +0 -7
- package/dist/primitives/step-indicator.d.ts +0 -10
- package/dist/primitives/step-indicator.d.ts.map +0 -1
- package/dist/primitives/step-indicator.js +0 -13
- package/dist/primitives/stepper.d.ts +0 -49
- package/dist/primitives/stepper.d.ts.map +0 -1
- package/dist/primitives/stepper.js +0 -75
- package/dist/primitives/switch.d.ts +0 -9
- package/dist/primitives/switch.d.ts.map +0 -1
- package/dist/primitives/switch.js +0 -7
- package/dist/primitives/table.d.ts +0 -35
- package/dist/primitives/table.d.ts.map +0 -1
- package/dist/primitives/table.js +0 -19
- package/dist/primitives/tabs.d.ts +0 -12
- package/dist/primitives/tabs.d.ts.map +0 -1
- package/dist/primitives/tabs.js +0 -35
- package/dist/primitives/text-area.d.ts +0 -6
- package/dist/primitives/text-area.d.ts.map +0 -1
- package/dist/primitives/text-area.js +0 -10
- package/dist/primitives/text-link.d.ts +0 -6
- package/dist/primitives/text-link.d.ts.map +0 -1
- package/dist/primitives/text-link.js +0 -5
- package/dist/primitives/textarea.d.ts +0 -13
- package/dist/primitives/textarea.d.ts.map +0 -1
- package/dist/primitives/textarea.js +0 -28
- package/dist/primitives/textfield.d.ts +0 -33
- package/dist/primitives/textfield.d.ts.map +0 -1
- package/dist/primitives/textfield.js +0 -9
- package/dist/primitives/toast.d.ts +0 -6
- package/dist/primitives/toast.d.ts.map +0 -1
- package/dist/primitives/toast.js +0 -13
- package/dist/primitives/toggle-group.d.ts +0 -14
- package/dist/primitives/toggle-group.d.ts.map +0 -1
- package/dist/primitives/toggle-group.js +0 -20
- package/dist/primitives/toggle.d.ts +0 -13
- package/dist/primitives/toggle.d.ts.map +0 -1
- package/dist/primitives/toggle.js +0 -24
- package/dist/primitives/tooltip.d.ts +0 -15
- package/dist/primitives/tooltip.d.ts.map +0 -1
- package/dist/primitives/tooltip.js +0 -11
- package/dist/primitives/video-player.d.ts +0 -7
- package/dist/primitives/video-player.d.ts.map +0 -1
- package/dist/primitives/video-player.js +0 -7
- package/dist/primitives/youtube-pip-player.d.ts +0 -33
- package/dist/primitives/youtube-pip-player.d.ts.map +0 -1
- package/dist/primitives/youtube-pip-player.js +0 -253
- package/dist/src/3d/button.d.ts +0 -27
- package/dist/src/3d/button.d.ts.map +0 -1
- package/dist/src/3d/button.js +0 -181
- package/dist/src/3d/card.d.ts +0 -29
- package/dist/src/3d/card.d.ts.map +0 -1
- package/dist/src/3d/card.js +0 -117
- package/dist/src/3d/carousel.d.ts +0 -26
- package/dist/src/3d/carousel.d.ts.map +0 -1
- package/dist/src/3d/carousel.js +0 -171
- package/dist/src/3d/grid.d.ts +0 -49
- package/dist/src/3d/grid.d.ts.map +0 -1
- package/dist/src/3d/grid.js +0 -126
- package/dist/src/3d/index.d.ts +0 -7
- package/dist/src/3d/index.d.ts.map +0 -1
- package/dist/src/3d/index.js +0 -7
- package/dist/src/3d/marquee.d.ts +0 -37
- package/dist/src/3d/marquee.d.ts.map +0 -1
- package/dist/src/3d/marquee.js +0 -208
- package/dist/src/3d/pin.d.ts +0 -8
- package/dist/src/3d/pin.d.ts.map +0 -1
- package/dist/src/3d/pin.js +0 -9
- package/dist/src/avatar.d.ts +0 -2
- package/dist/src/avatar.d.ts.map +0 -1
- package/dist/src/avatar.js +0 -1
- package/dist/src/badge.d.ts +0 -2
- package/dist/src/badge.d.ts.map +0 -1
- package/dist/src/badge.js +0 -1
- package/dist/src/billing/components/account-members.d.ts +0 -10
- package/dist/src/billing/components/account-members.d.ts.map +0 -1
- package/dist/src/billing/components/account-members.js +0 -63
- package/dist/src/billing/components/account-switcher.d.ts +0 -9
- package/dist/src/billing/components/account-switcher.d.ts.map +0 -1
- package/dist/src/billing/components/account-switcher.js +0 -52
- package/dist/src/billing/components/animated-card.d.ts +0 -9
- package/dist/src/billing/components/animated-card.d.ts.map +0 -1
- package/dist/src/billing/components/animated-card.js +0 -161
- package/dist/src/billing/components/billing-settings.d.ts +0 -26
- package/dist/src/billing/components/billing-settings.d.ts.map +0 -1
- package/dist/src/billing/components/billing-settings.js +0 -23
- package/dist/src/billing/components/billing-workspace.d.ts +0 -28
- package/dist/src/billing/components/billing-workspace.d.ts.map +0 -1
- package/dist/src/billing/components/billing-workspace.js +0 -22
- package/dist/src/billing/components/business-profile-panel.d.ts +0 -7
- package/dist/src/billing/components/business-profile-panel.d.ts.map +0 -1
- package/dist/src/billing/components/business-profile-panel.js +0 -45
- package/dist/src/billing/components/card-form.d.ts +0 -18
- package/dist/src/billing/components/card-form.d.ts.map +0 -1
- package/dist/src/billing/components/card-form.js +0 -139
- package/dist/src/billing/components/cost-explorer.d.ts +0 -7
- package/dist/src/billing/components/cost-explorer.d.ts.map +0 -1
- package/dist/src/billing/components/cost-explorer.js +0 -73
- package/dist/src/billing/components/credits-panel.d.ts +0 -8
- package/dist/src/billing/components/credits-panel.d.ts.map +0 -1
- package/dist/src/billing/components/credits-panel.js +0 -58
- package/dist/src/billing/components/guided-setup.d.ts +0 -13
- package/dist/src/billing/components/guided-setup.d.ts.map +0 -1
- package/dist/src/billing/components/guided-setup.js +0 -44
- package/dist/src/billing/components/index.d.ts +0 -47
- package/dist/src/billing/components/index.d.ts.map +0 -1
- package/dist/src/billing/components/index.js +0 -23
- package/dist/src/billing/components/invoice-manager.d.ts +0 -10
- package/dist/src/billing/components/invoice-manager.d.ts.map +0 -1
- package/dist/src/billing/components/invoice-manager.js +0 -131
- package/dist/src/billing/components/invoices-payments.d.ts +0 -7
- package/dist/src/billing/components/invoices-payments.d.ts.map +0 -1
- package/dist/src/billing/components/invoices-payments.js +0 -44
- package/dist/src/billing/components/overview-dashboard.d.ts +0 -31
- package/dist/src/billing/components/overview-dashboard.d.ts.map +0 -1
- package/dist/src/billing/components/overview-dashboard.js +0 -105
- package/dist/src/billing/components/payment-manager.d.ts +0 -13
- package/dist/src/billing/components/payment-manager.d.ts.map +0 -1
- package/dist/src/billing/components/payment-manager.js +0 -330
- package/dist/src/billing/components/promotions-panel.d.ts +0 -7
- package/dist/src/billing/components/promotions-panel.d.ts.map +0 -1
- package/dist/src/billing/components/promotions-panel.js +0 -48
- package/dist/src/billing/components/spend-alerts.d.ts +0 -9
- package/dist/src/billing/components/spend-alerts.d.ts.map +0 -1
- package/dist/src/billing/components/spend-alerts.js +0 -99
- package/dist/src/billing/components/square-card-form.d.ts +0 -32
- package/dist/src/billing/components/square-card-form.d.ts.map +0 -1
- package/dist/src/billing/components/square-card-form.js +0 -179
- package/dist/src/billing/components/status-bar.d.ts +0 -12
- package/dist/src/billing/components/status-bar.d.ts.map +0 -1
- package/dist/src/billing/components/status-bar.js +0 -32
- package/dist/src/billing/components/subscription-portal.d.ts +0 -17
- package/dist/src/billing/components/subscription-portal.d.ts.map +0 -1
- package/dist/src/billing/components/subscription-portal.js +0 -185
- package/dist/src/billing/components/support-tiers-panel.d.ts +0 -6
- package/dist/src/billing/components/support-tiers-panel.d.ts.map +0 -1
- package/dist/src/billing/components/support-tiers-panel.js +0 -90
- package/dist/src/billing/components/tax-compliance-panel.d.ts +0 -8
- package/dist/src/billing/components/tax-compliance-panel.d.ts.map +0 -1
- package/dist/src/billing/components/tax-compliance-panel.js +0 -41
- package/dist/src/billing/components/transactions-panel.d.ts +0 -8
- package/dist/src/billing/components/transactions-panel.d.ts.map +0 -1
- package/dist/src/billing/components/transactions-panel.js +0 -64
- package/dist/src/billing/components/usage-panel.d.ts +0 -7
- package/dist/src/billing/components/usage-panel.d.ts.map +0 -1
- package/dist/src/billing/components/usage-panel.js +0 -64
- package/dist/src/billing/index.d.ts +0 -7
- package/dist/src/billing/index.d.ts.map +0 -1
- package/dist/src/billing/index.js +0 -8
- package/dist/src/billing/types/index.d.ts +0 -312
- package/dist/src/billing/types/index.d.ts.map +0 -1
- package/dist/src/billing/types/index.js +0 -1
- package/dist/src/button.d.ts +0 -2
- package/dist/src/button.d.ts.map +0 -1
- package/dist/src/button.js +0 -1
- package/dist/src/calendar-ext/index.d.ts +0 -4
- package/dist/src/calendar-ext/index.d.ts.map +0 -1
- package/dist/src/calendar-ext/index.js +0 -7
- package/dist/src/charts/index.d.ts +0 -65
- package/dist/src/charts/index.d.ts.map +0 -1
- package/dist/src/charts/index.js +0 -76
- package/dist/src/desktop/hooks.d.ts +0 -75
- package/dist/src/desktop/hooks.d.ts.map +0 -1
- package/dist/src/desktop/hooks.js +0 -194
- package/dist/src/desktop/index.d.ts +0 -7
- package/dist/src/desktop/index.d.ts.map +0 -1
- package/dist/src/desktop/index.js +0 -8
- package/dist/src/desktop/spotlight.d.ts +0 -24
- package/dist/src/desktop/spotlight.d.ts.map +0 -1
- package/dist/src/desktop/spotlight.js +0 -126
- package/dist/src/desktop/window.d.ts +0 -34
- package/dist/src/desktop/window.d.ts.map +0 -1
- package/dist/src/desktop/window.js +0 -114
- package/dist/src/device/index.d.ts +0 -2
- package/dist/src/device/index.d.ts.map +0 -1
- package/dist/src/device/index.js +0 -1
- package/dist/src/dock/basic.d.ts +0 -20
- package/dist/src/dock/basic.d.ts.map +0 -1
- package/dist/src/dock/basic.js +0 -50
- package/dist/src/dock/index.d.ts +0 -6
- package/dist/src/dock/index.d.ts.map +0 -1
- package/dist/src/dock/index.js +0 -6
- package/dist/src/dock/limelight-nav.d.ts +0 -10
- package/dist/src/dock/limelight-nav.d.ts.map +0 -1
- package/dist/src/dock/limelight-nav.js +0 -25
- package/dist/src/dock/macos.d.ts +0 -17
- package/dist/src/dock/macos.d.ts.map +0 -1
- package/dist/src/dock/macos.js +0 -38
- package/dist/src/dock/menu.d.ts +0 -14
- package/dist/src/dock/menu.d.ts.map +0 -1
- package/dist/src/dock/menu.js +0 -10
- package/dist/src/dock/message.d.ts +0 -15
- package/dist/src/dock/message.d.ts.map +0 -1
- package/dist/src/dock/message.js +0 -21
- package/dist/src/form/form.d.ts +0 -24
- package/dist/src/form/form.d.ts.map +0 -1
- package/dist/src/form/form.js +0 -66
- package/dist/src/form/index.d.ts +0 -2
- package/dist/src/form/index.d.ts.map +0 -1
- package/dist/src/form/index.js +0 -2
- package/dist/src/hooks/index.d.ts +0 -8
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/hooks/index.js +0 -7
- package/dist/src/hooks/use-click-away.d.ts +0 -3
- package/dist/src/hooks/use-click-away.d.ts.map +0 -1
- package/dist/src/hooks/use-click-away.js +0 -23
- package/dist/src/hooks/use-combined-refs.d.ts +0 -4
- package/dist/src/hooks/use-combined-refs.d.ts.map +0 -1
- package/dist/src/hooks/use-combined-refs.js +0 -18
- package/dist/src/hooks/use-copy-clipboard.d.ts +0 -10
- package/dist/src/hooks/use-copy-clipboard.d.ts.map +0 -1
- package/dist/src/hooks/use-copy-clipboard.js +0 -21
- package/dist/src/hooks/use-debounce.d.ts +0 -2
- package/dist/src/hooks/use-debounce.d.ts.map +0 -1
- package/dist/src/hooks/use-debounce.js +0 -13
- package/dist/src/hooks/use-fill-ids.d.ts +0 -9
- package/dist/src/hooks/use-fill-ids.d.ts.map +0 -1
- package/dist/src/hooks/use-fill-ids.js +0 -20
- package/dist/src/hooks/use-map.d.ts +0 -2
- package/dist/src/hooks/use-map.d.ts.map +0 -1
- package/dist/src/hooks/use-map.js +0 -20
- package/dist/src/hooks/use-measure.d.ts +0 -9
- package/dist/src/hooks/use-measure.d.ts.map +0 -1
- package/dist/src/hooks/use-measure.js +0 -25
- package/dist/src/hooks/use-reverse-video-playback.d.ts +0 -2
- package/dist/src/hooks/use-reverse-video-playback.d.ts.map +0 -1
- package/dist/src/hooks/use-reverse-video-playback.js +0 -41
- package/dist/src/hooks/use-scroll-restoration.d.ts +0 -9
- package/dist/src/hooks/use-scroll-restoration.d.ts.map +0 -1
- package/dist/src/hooks/use-scroll-restoration.js +0 -36
- package/dist/src/kanban/index.d.ts +0 -3
- package/dist/src/kanban/index.d.ts.map +0 -1
- package/dist/src/kanban/index.js +0 -4
- package/dist/src/mcp/enhanced-server.d.ts +0 -41
- package/dist/src/mcp/enhanced-server.d.ts.map +0 -1
- package/dist/src/mcp/enhanced-server.js +0 -1128
- package/dist/src/mcp/index.d.ts +0 -40
- package/dist/src/mcp/index.d.ts.map +0 -1
- package/dist/src/mcp/index.js +0 -436
- package/dist/src/mermaid/index.d.ts +0 -3
- package/dist/src/mermaid/index.d.ts.map +0 -1
- package/dist/src/mermaid/index.js +0 -3
- package/dist/src/models/ModelCard.d.ts +0 -25
- package/dist/src/models/ModelCard.d.ts.map +0 -1
- package/dist/src/models/ModelCard.js +0 -73
- package/dist/src/models/ModelLibrary.d.ts +0 -41
- package/dist/src/models/ModelLibrary.d.ts.map +0 -1
- package/dist/src/models/ModelLibrary.js +0 -63
- package/dist/src/models/ModelTable.d.ts +0 -17
- package/dist/src/models/ModelTable.d.ts.map +0 -1
- package/dist/src/models/ModelTable.js +0 -35
- package/dist/src/models/ZenEnso.d.ts +0 -17
- package/dist/src/models/ZenEnso.d.ts.map +0 -1
- package/dist/src/models/ZenEnso.js +0 -50
- package/dist/src/models/index.d.ts +0 -23
- package/dist/src/models/index.d.ts.map +0 -1
- package/dist/src/models/index.js +0 -18
- package/dist/src/models/types.d.ts +0 -40
- package/dist/src/models/types.d.ts.map +0 -1
- package/dist/src/models/types.js +0 -7
- package/dist/src/navigation/advanced-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/advanced-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/advanced-navigation-bar.js +0 -4
- package/dist/src/navigation/ai-model-selector-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/ai-model-selector-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/ai-model-selector-navigation-bar.js +0 -4
- package/dist/src/navigation/app-switcher-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/app-switcher-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/app-switcher-navigation-bar.js +0 -4
- package/dist/src/navigation/breadcrumb-and-filters-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/breadcrumb-and-filters-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/breadcrumb-and-filters-navigation-bar.js +0 -4
- package/dist/src/navigation/breadcrumb-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/breadcrumb-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/breadcrumb-navigation-bar.js +0 -4
- package/dist/src/navigation/centered-logo-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/centered-logo-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/centered-logo-navigation-bar.js +0 -4
- package/dist/src/navigation/collaboration-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/collaboration-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/collaboration-navigation-bar.js +0 -4
- package/dist/src/navigation/communication-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/communication-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/communication-navigation-bar.js +0 -4
- package/dist/src/navigation/context-switcher-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/context-switcher-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/context-switcher-navigation-bar.js +0 -4
- package/dist/src/navigation/dashboard-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/dashboard-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/dashboard-navigation-bar.js +0 -4
- package/dist/src/navigation/e-commerce-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/e-commerce-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/e-commerce-navigation-bar.js +0 -4
- package/dist/src/navigation/hanzo-shell/AppSwitcher.d.ts +0 -8
- package/dist/src/navigation/hanzo-shell/AppSwitcher.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/AppSwitcher.js +0 -19
- package/dist/src/navigation/hanzo-shell/BeamAvatar.d.ts +0 -9
- package/dist/src/navigation/hanzo-shell/BeamAvatar.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/BeamAvatar.js +0 -38
- package/dist/src/navigation/hanzo-shell/HanzoCommandPalette.d.ts +0 -28
- package/dist/src/navigation/hanzo-shell/HanzoCommandPalette.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/HanzoCommandPalette.js +0 -124
- package/dist/src/navigation/hanzo-shell/HanzoHeader.d.ts +0 -37
- package/dist/src/navigation/hanzo-shell/HanzoHeader.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/HanzoHeader.js +0 -43
- package/dist/src/navigation/hanzo-shell/HanzoMark.d.ts +0 -17
- package/dist/src/navigation/hanzo-shell/HanzoMark.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/HanzoMark.js +0 -57
- package/dist/src/navigation/hanzo-shell/UserAvatar.d.ts +0 -15
- package/dist/src/navigation/hanzo-shell/UserAvatar.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/UserAvatar.js +0 -44
- package/dist/src/navigation/hanzo-shell/UserOrgDropdown.d.ts +0 -11
- package/dist/src/navigation/hanzo-shell/UserOrgDropdown.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/UserOrgDropdown.js +0 -26
- package/dist/src/navigation/hanzo-shell/index.d.ts +0 -14
- package/dist/src/navigation/hanzo-shell/index.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/index.js +0 -9
- package/dist/src/navigation/hanzo-shell/types.d.ts +0 -49
- package/dist/src/navigation/hanzo-shell/types.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/types.js +0 -32
- package/dist/src/navigation/hanzo-shell/useHanzoAuth.d.ts +0 -16
- package/dist/src/navigation/hanzo-shell/useHanzoAuth.d.ts.map +0 -1
- package/dist/src/navigation/hanzo-shell/useHanzoAuth.js +0 -93
- package/dist/src/navigation/icon-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/icon-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/icon-navigation-bar.js +0 -4
- package/dist/src/navigation/index.d.ts +0 -21
- package/dist/src/navigation/index.d.ts.map +0 -1
- package/dist/src/navigation/index.js +0 -21
- package/dist/src/navigation/search-and-toggle-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/search-and-toggle-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/search-and-toggle-navigation-bar.js +0 -4
- package/dist/src/navigation/simple-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/simple-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/simple-navigation-bar.js +0 -4
- package/dist/src/navigation/status-dashboard-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/status-dashboard-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/status-dashboard-navigation-bar.js +0 -4
- package/dist/src/navigation/team-switcher-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/team-switcher-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/team-switcher-navigation-bar.js +0 -4
- package/dist/src/navigation/two-tier-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/two-tier-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/two-tier-navigation-bar.js +0 -4
- package/dist/src/navigation/underline-navigation-bar.d.ts +0 -2
- package/dist/src/navigation/underline-navigation-bar.d.ts.map +0 -1
- package/dist/src/navigation/underline-navigation-bar.js +0 -4
- package/dist/src/pattern/grid.d.ts +0 -111
- package/dist/src/pattern/grid.d.ts.map +0 -1
- package/dist/src/pattern/grid.js +0 -126
- package/dist/src/pattern/index.d.ts +0 -3
- package/dist/src/pattern/index.d.ts.map +0 -1
- package/dist/src/pattern/index.js +0 -2
- package/dist/src/project/gantt.d.ts +0 -13
- package/dist/src/project/gantt.d.ts.map +0 -1
- package/dist/src/project/gantt.js +0 -9
- package/dist/src/project/index.d.ts +0 -4
- package/dist/src/project/index.d.ts.map +0 -1
- package/dist/src/project/index.js +0 -7
- package/dist/src/project/kanban.d.ts +0 -36
- package/dist/src/project/kanban.d.ts.map +0 -1
- package/dist/src/project/kanban.js +0 -259
- package/dist/src/project/list.d.ts +0 -5
- package/dist/src/project/list.d.ts.map +0 -1
- package/dist/src/project/list.js +0 -8
- package/dist/src/registry/api.d.ts +0 -38
- package/dist/src/registry/api.d.ts.map +0 -1
- package/dist/src/registry/api.js +0 -129
- package/dist/src/registry/index.d.ts +0 -354
- package/dist/src/registry/index.d.ts.map +0 -1
- package/dist/src/registry/index.js +0 -45
- package/dist/src/spline/index.d.ts +0 -3
- package/dist/src/spline/index.d.ts.map +0 -1
- package/dist/src/spline/index.js +0 -4
- package/dist/src/spline/media-stack.d.ts +0 -15
- package/dist/src/spline/media-stack.d.ts.map +0 -1
- package/dist/src/spline/media-stack.js +0 -33
- package/dist/src/spline/player.d.ts +0 -15
- package/dist/src/spline/player.d.ts.map +0 -1
- package/dist/src/spline/player.js +0 -12
- package/dist/src/ui/announcement.d.ts +0 -9
- package/dist/src/ui/announcement.d.ts.map +0 -1
- package/dist/src/ui/announcement.js +0 -18
- package/dist/src/ui/avatar-group.d.ts +0 -12
- package/dist/src/ui/avatar-group.d.ts.map +0 -1
- package/dist/src/ui/avatar-group.js +0 -12
- package/dist/src/ui/banner.d.ts +0 -11
- package/dist/src/ui/banner.d.ts.map +0 -1
- package/dist/src/ui/banner.js +0 -25
- package/dist/src/ui/cursor.d.ts +0 -9
- package/dist/src/ui/cursor.d.ts.map +0 -1
- package/dist/src/ui/cursor.js +0 -24
- package/dist/src/ui/index.d.ts +0 -18
- package/dist/src/ui/index.d.ts.map +0 -1
- package/dist/src/ui/index.js +0 -10
- package/dist/src/ui/marquee.d.ts +0 -10
- package/dist/src/ui/marquee.d.ts.map +0 -1
- package/dist/src/ui/marquee.js +0 -14
- package/dist/src/ui/pill.d.ts +0 -11
- package/dist/src/ui/pill.d.ts.map +0 -1
- package/dist/src/ui/pill.js +0 -25
- package/dist/src/ui/spinner.d.ts +0 -3
- package/dist/src/ui/spinner.d.ts.map +0 -1
- package/dist/src/ui/spinner.js +0 -7
- package/dist/src/ui/tags.d.ts +0 -13
- package/dist/src/ui/tags.d.ts.map +0 -1
- package/dist/src/ui/tags.js +0 -11
- package/dist/src/ui/ticker.d.ts +0 -10
- package/dist/src/ui/ticker.d.ts.map +0 -1
- package/dist/src/ui/ticker.js +0 -12
- package/dist/src/utils.d.ts +0 -5
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js +0 -16
- package/dist/style/theme-provider.d.ts +0 -5
- package/dist/style/theme-provider.d.ts.map +0 -1
- package/dist/style/theme-provider.js +0 -8
- package/dist/tailwind/colors.tailwind.d.ts +0 -53
- package/dist/tailwind/colors.tailwind.d.ts.map +0 -1
- package/dist/tailwind/colors.tailwind.js +0 -52
- package/dist/tailwind/fontFamily.tailwind.d.ts +0 -9
- package/dist/tailwind/fontFamily.tailwind.d.ts.map +0 -1
- package/dist/tailwind/fontFamily.tailwind.js +0 -7
- package/dist/tailwind/fontSize.tailwind.d.ts +0 -37
- package/dist/tailwind/fontSize.tailwind.d.ts.map +0 -1
- package/dist/tailwind/fontSize.tailwind.js +0 -13
- package/dist/tailwind/index.d.ts +0 -4
- package/dist/tailwind/index.d.ts.map +0 -1
- package/dist/tailwind/safelist.tailwind.d.ts +0 -9
- package/dist/tailwind/safelist.tailwind.d.ts.map +0 -1
- package/dist/tailwind/safelist.tailwind.js +0 -25
- package/dist/tailwind/screens.tailwind.d.ts +0 -10
- package/dist/tailwind/screens.tailwind.d.ts.map +0 -1
- package/dist/tailwind/screens.tailwind.js +0 -8
- package/dist/tailwind/spacing.tailwind.d.ts +0 -59
- package/dist/tailwind/spacing.tailwind.d.ts.map +0 -1
- package/dist/tailwind/spacing.tailwind.js +0 -62
- package/dist/tailwind/tailwind.config.hanzo-preset.d.ts +0 -1299
- package/dist/tailwind/tailwind.config.hanzo-preset.d.ts.map +0 -1
- package/dist/tailwind/tailwind.config.hanzo-preset.js +0 -911
- package/dist/tailwind/tw-font-desc.d.ts +0 -7
- package/dist/tailwind/tw-font-desc.d.ts.map +0 -1
- package/dist/tailwind/tw-font-desc.js +0 -6
- package/dist/tailwind/z-index.tailwind.d.ts +0 -51
- package/dist/tailwind/z-index.tailwind.d.ts.map +0 -1
- package/dist/tailwind/z-index.tailwind.js +0 -67
- package/dist/types/animation-def.d.ts +0 -3
- package/dist/types/animation-def.d.ts.map +0 -1
- package/dist/types/animation-def.js +0 -1
- package/dist/types/breakpoints.d.ts +0 -5
- package/dist/types/breakpoints.d.ts.map +0 -1
- package/dist/types/breakpoints.js +0 -4
- package/dist/types/bullet-item.d.ts +0 -7
- package/dist/types/bullet-item.d.ts.map +0 -1
- package/dist/types/bullet-item.js +0 -1
- package/dist/types/button-def.d.ts +0 -30
- package/dist/types/button-def.d.ts.map +0 -1
- package/dist/types/button-def.js +0 -1
- package/dist/types/dimensions.d.ts +0 -6
- package/dist/types/dimensions.d.ts.map +0 -1
- package/dist/types/dimensions.js +0 -1
- package/dist/types/grid-def.d.ts +0 -37
- package/dist/types/grid-def.d.ts.map +0 -1
- package/dist/types/grid-def.js +0 -33
- package/dist/types/image-def.d.ts +0 -28
- package/dist/types/image-def.d.ts.map +0 -1
- package/dist/types/image-def.js +0 -1
- package/dist/types/index.d.ts +0 -15
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/link-def.d.ts +0 -45
- package/dist/types/link-def.d.ts.map +0 -1
- package/dist/types/link-def.js +0 -1
- package/dist/types/media-stack-def.d.ts +0 -26
- package/dist/types/media-stack-def.d.ts.map +0 -1
- package/dist/types/media-stack-def.js +0 -1
- package/dist/types/t-shirt-size.d.ts +0 -3
- package/dist/types/t-shirt-size.d.ts.map +0 -1
- package/dist/types/t-shirt-size.js +0 -1
- package/dist/types/tshirt-dimensions.d.ts +0 -13
- package/dist/types/tshirt-dimensions.d.ts.map +0 -1
- package/dist/types/tshirt-dimensions.js +0 -1
- package/dist/types/video-def.d.ts +0 -10
- package/dist/types/video-def.d.ts.map +0 -1
- package/dist/types/video-def.js +0 -1
- package/dist/util/blob.d.ts +0 -3
- package/dist/util/blob.d.ts.map +0 -1
- package/dist/util/blob.js +0 -23
- package/dist/util/copy-to-clipboard.d.ts +0 -2
- package/dist/util/copy-to-clipboard.d.ts.map +0 -1
- package/dist/util/copy-to-clipboard.js +0 -18
- package/dist/util/create-shadow-root.d.ts +0 -8
- package/dist/util/create-shadow-root.d.ts.map +0 -1
- package/dist/util/create-shadow-root.js +0 -18
- package/dist/util/date.d.ts +0 -29
- package/dist/util/date.d.ts.map +0 -1
- package/dist/util/date.js +0 -60
- package/dist/util/debounce.d.ts +0 -2
- package/dist/util/debounce.d.ts.map +0 -1
- package/dist/util/debounce.js +0 -11
- package/dist/util/file.d.ts +0 -4
- package/dist/util/file.d.ts.map +0 -1
- package/dist/util/file.js +0 -13
- package/dist/util/format-and-abbreviate-as-currency.d.ts +0 -18
- package/dist/util/format-and-abbreviate-as-currency.d.ts.map +0 -1
- package/dist/util/format-and-abbreviate-as-currency.js +0 -91
- package/dist/util/format-text.d.ts +0 -8
- package/dist/util/format-text.d.ts.map +0 -1
- package/dist/util/format-text.js +0 -26
- package/dist/util/format-to-max-char.d.ts +0 -12
- package/dist/util/format-to-max-char.d.ts.map +0 -1
- package/dist/util/format-to-max-char.js +0 -57
- package/dist/util/index-client.d.ts +0 -3
- package/dist/util/index-client.d.ts.map +0 -1
- package/dist/util/index-client.js +0 -3
- package/dist/util/index.d.ts +0 -37
- package/dist/util/index.d.ts.map +0 -1
- package/dist/util/number-abbreviate.d.ts +0 -10
- package/dist/util/number-abbreviate.d.ts.map +0 -1
- package/dist/util/number-abbreviate.js +0 -30
- package/dist/util/specifier.d.ts +0 -8
- package/dist/util/specifier.d.ts.map +0 -1
- package/dist/util/specifier.js +0 -31
- package/dist/util/spread-to-transform.d.ts +0 -8
- package/dist/util/spread-to-transform.d.ts.map +0 -1
- package/dist/util/spread-to-transform.js +0 -19
- package/dist/util/step-animation.d.ts +0 -6
- package/dist/util/step-animation.d.ts.map +0 -1
- package/dist/util/step-animation.js +0 -60
- package/dist/util/timing.d.ts +0 -2
- package/dist/util/timing.d.ts.map +0 -1
- package/dist/util/timing.js +0 -3
- package/dist/util/toasts.d.ts +0 -3
- package/dist/util/toasts.d.ts.map +0 -1
- package/dist/util/toasts.js +0 -10
- package/dist/util/two-way-map.d.ts +0 -9
- package/dist/util/two-way-map.d.ts.map +0 -1
- package/dist/util/two-way-map.js +0 -16
- package/dist/util/use-mobile.d.ts +0 -2
- package/dist/util/use-mobile.d.ts.map +0 -1
- package/dist/util/use-mobile.js +0 -15
- package/dist/utils.d.ts +0 -4
- package/dist/utils.d.ts.map +0 -1
- package/dist/utils.js +0 -7
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import*as F from'react';import {useState,useMemo,useRef,useEffect}from'react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {ConnectButton}from'@rainbow-me/rainbowkit';import {useAccount,useChainId}from'wagmi';var Qt=Object.defineProperty;var d=(e,t)=>Qt(e,"name",{value:t,configurable:true});function Ke(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,maximumFractionDigits:0}).format(e)}d(Ke,"formatCurrency");function Qe(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(e)}d(Qe,"formatDate");var Nt={active:{label:"Active",className:"bg-emerald-500/10 text-emerald-500 ring-emerald-500/20"},canceled:{label:"Canceled",className:"bg-rose-500/10 text-rose-500 ring-rose-500/20"},past_due:{label:"Past due",className:"bg-amber-500/10 text-amber-500 ring-amber-500/20"},trialing:{label:"Trialing",className:"bg-sky-500/10 text-sky-500 ring-sky-500/20"},unpaid:{label:"Unpaid",className:"bg-rose-500/10 text-rose-500 ring-rose-500/20"},incomplete:{label:"Incomplete",className:"bg-text-dim/10 text-text-muted ring-text-dim/20"}};function ot(e){let{subscription:t,availablePlans:r,usageMetrics:a=[],retentionOffers:i=[],subscriptionHistory:x=[],onUpgrade:o,onDowngrade:b,onCancel:c,onApplyDiscount:n,defaultView:s="overview"}=e,[m,y]=F.useState(s),[R,w]=F.useState(null),[A,C]=F.useState(""),[v,l]=F.useState(false),[f,p]=F.useState(null),[D,$]=F.useState(false),[_,h]=F.useState(""),[N,T]=F.useState(false),j=F.useMemo(()=>r.find(u=>u.id===t.planId),[r,t.planId]),ye=F.useCallback(async u=>{if(u.externalUrl){window.open(u.externalUrl,"_blank","noopener,noreferrer");return}if(u.id!==j?.id){w(u.id);try{!j||u.price>=(j?.price??0)?await o?.(u.id):await b?.(u.id);}finally{w(null);}}},[j,b,o]),Ce=F.useCallback(async()=>{if(!(!n||!A.trim())){l(true),p(null);try{let u=await n(A.trim());if(u&&u.valid){let X=u.kind==="percent"?`${u.value}% off`:`${Ke(u.value)} off`;p({success:!0,message:`Applied: ${u.name||u.code} (${X})`}),C("");}else p({success:!1,message:"Invalid or expired discount code"});}catch(u){p({success:false,message:u instanceof Error?u.message:"Failed to apply code"});}finally{l(false);}}},[n,A]),Me=F.useCallback(async()=>{if(!(!c||!_.trim())){T(true);try{await c(_.trim()),$(!1),h("");}finally{T(false);}}},[c,_]);return jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:"overflow-hidden rounded-2xl border border-border bg-bg-card p-6",children:[jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[jsxs("div",{className:"space-y-2",children:[jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-text-muted",children:"Subscription"}),jsx("h2",{className:"text-2xl font-semibold text-text",children:j?.name??"No active plan"}),jsx("p",{className:"text-sm text-text-secondary",children:t.id?`Billing period ends on ${Qe(t.currentPeriodEnd)}`:"Select a plan to get started"}),t.discount&&jsxs("p",{className:"text-sm text-emerald-500",children:["Discount: ",t.discount.name||t.discount.code," (",t.discount.kind==="percent"?`${t.discount.value}% off`:`${Ke(t.discount.value)} off`,t.discount.duration==="repeating"&&t.discount.durationInMonths?` for ${t.discount.durationInMonths} months`:t.discount.duration==="forever"?" forever":"",")"]})]}),t.id&&jsx("span",{className:`inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold ring-1 ${Nt[t.status].className}`,children:Nt[t.status].label})]}),jsxs("div",{className:"mt-6 flex flex-wrap gap-2 rounded-xl border border-border bg-bg-elevated p-1",children:[jsx("button",{type:"button",onClick:()=>y("overview"),className:`rounded-lg px-3 py-1.5 text-sm transition ${m==="overview"?"bg-text text-bg":"text-text-muted hover:bg-bg-card hover:text-text"}`,children:"Overview"}),jsx("button",{type:"button",onClick:()=>y("plans"),className:`rounded-lg px-3 py-1.5 text-sm transition ${m==="plans"?"bg-text text-bg":"text-text-muted hover:bg-bg-card hover:text-text"}`,children:"Plans"}),jsx("button",{type:"button",onClick:()=>y("history"),className:`rounded-lg px-3 py-1.5 text-sm transition ${m==="history"?"bg-text text-bg":"text-text-muted hover:bg-bg-card hover:text-text"}`,children:"History"})]})]}),m==="overview"&&jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[jsxs("div",{className:"rounded-xl border border-border bg-bg-card p-4",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Current spend"}),jsxs("p",{className:"mt-2 text-2xl font-semibold text-text",children:[Ke(j?.price??0),jsxs("span",{className:"text-sm font-normal text-text-muted",children:["/",j?.billingPeriod??"monthly"]})]})]}),jsxs("div",{className:"rounded-xl border border-border bg-bg-card p-4",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Next invoice"}),jsx("p",{className:"mt-2 text-lg font-semibold text-text",children:t.id?Qe(t.currentPeriodEnd):"\u2014"})]}),jsxs("div",{className:"rounded-xl border border-border bg-bg-card p-4",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Status"}),jsx("p",{className:"mt-2 text-lg font-semibold text-text",children:t.cancelAtPeriodEnd?"Cancels at period end":t.id?"Auto-renewing":"No subscription"})]}),n&&t.id&&jsxs("div",{className:"md:col-span-3 rounded-xl border border-border bg-bg-card p-4",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Discount code"}),jsxs("div",{className:"mt-3 flex gap-2",children:[jsx("input",{value:A,onChange:u=>{C(u.target.value.toUpperCase()),p(null);},placeholder:"Enter promo code",className:"flex-1 rounded-lg border border-border bg-bg-input px-3 py-2 text-sm font-mono uppercase text-text outline-none transition focus:border-brand"}),jsx("button",{type:"button",disabled:!A.trim()||v,onClick:Ce,className:"rounded-lg bg-text px-4 py-2 text-sm font-medium text-bg transition hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60",children:v?"Applying\u2026":"Apply"})]}),f&&jsx("p",{className:`mt-2 text-sm ${f.success?"text-success":"text-danger"}`,children:f.message})]}),a.length>0&&jsxs("div",{className:"md:col-span-3 rounded-xl border border-border bg-bg-card p-4",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Usage metrics"}),jsx("div",{className:"mt-3 grid gap-3 md:grid-cols-2 xl:grid-cols-4",children:a.map(u=>{let X=u.limit&&u.limit>0?Math.min(u.current/u.limit*100,100):0;return jsxs("div",{className:"rounded-lg border border-border p-3",children:[jsx("p",{className:"text-sm text-text-secondary",children:u.label}),jsxs("p",{className:"mt-1 text-lg font-semibold text-text",children:[u.current.toLocaleString(),u.unit?` ${u.unit}`:""]}),u.limit?jsxs(Fragment,{children:[jsxs("p",{className:"text-xs text-text-muted",children:["of ",u.limit.toLocaleString()," ",u.unit??""]}),jsx("div",{className:"mt-2 h-2 rounded-full bg-bg-elevated",children:jsx("div",{className:"h-2 rounded-full bg-brand transition-all",style:{width:`${X}%`}})})]}):null]},u.id)})})]}),i.length>0&&jsxs("div",{className:"md:col-span-3 rounded-xl border border-warning/30 bg-warning/5 p-4",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-warning",children:"Retention offers"}),jsx("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:i.map(u=>jsxs("div",{className:"rounded-lg border border-warning/30 bg-bg-card p-3",children:[jsx("p",{className:"font-medium text-text",children:u.title}),jsx("p",{className:"mt-1 text-sm text-text-secondary",children:u.description}),jsxs("p",{className:"mt-2 text-sm font-semibold text-warning",children:["Save ",u.discount,"% for ",u.durationMonths," months"]})]},u.id))})]}),t.id&&t.status==="active"&&!t.cancelAtPeriodEnd&&c&&jsx("div",{className:"md:col-span-3",children:D?jsxs("div",{className:"rounded-xl border border-rose-500/30 bg-rose-500/5 p-4",children:[jsx("p",{className:"text-sm font-medium text-rose-400",children:"Cancel subscription"}),jsxs("p",{className:"mt-1 text-sm text-text-muted",children:["Your subscription will remain active until ",Qe(t.currentPeriodEnd),"."]}),jsx("textarea",{value:_,onChange:u=>h(u.target.value),placeholder:"Why are you canceling? (required)",rows:2,className:"mt-3 w-full rounded-lg border border-rose-500/30 bg-bg-input px-3 py-2 text-sm text-text outline-none transition focus:border-rose-500"}),jsxs("div",{className:"mt-3 flex gap-2",children:[jsx("button",{type:"button",disabled:!_.trim()||N,onClick:Me,className:"rounded-lg bg-rose-600 px-4 py-2 text-sm font-medium text-white transition hover:bg-rose-500 disabled:cursor-not-allowed disabled:opacity-60",children:N?"Canceling\u2026":"Confirm cancellation"}),jsx("button",{type:"button",onClick:()=>{$(false),h("");},className:"rounded-lg border border-border px-4 py-2 text-sm font-medium text-text-secondary transition hover:bg-bg-elevated",children:"Keep subscription"})]})]}):jsx("button",{type:"button",onClick:()=>$(true),className:"text-sm text-text-muted transition hover:text-rose-500",children:"Cancel subscription"})})]}),m==="plans"&&jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:r.map(u=>{let X=u.id===t.planId,Le=R===u.id,Ge=u.price===0,st=(u.trialDays??0)>0,_e=!!u.externalUrl||u.contactSales,Gt=Ge?"Free":`$${u.price}/mo`,Kt=X?"Current plan":Le?"Applying\u2026":_e?u.contactSales?"Contact Sales \u2192":"Get started \u2192":st&&!t.id?`Start ${u.trialDays}-day free trial`:j&&u.price<(j?.price??0)?"Downgrade":"Upgrade";return jsxs("div",{className:`relative flex flex-col rounded-2xl border p-5 transition ${u.highlighted&&!X?"border-white/[0.2] bg-[#141419]":X?"border-white/[0.25] bg-[#141419]":"border-white/[0.08] bg-[#141419]"}`,children:[u.highlighted&&!X&&jsx("div",{className:"absolute -top-px left-0 right-0 h-px rounded-t-2xl bg-gradient-to-r from-transparent via-white/40 to-transparent"}),jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsx("p",{className:"text-[15px] font-semibold text-white",children:u.name}),u.badge?jsx("span",{className:`rounded-full px-2 py-1 text-[11px] font-semibold flex-shrink-0 ${X?"bg-white/10 text-white/60":u.contactSales?"bg-amber-500/15 text-amber-400":st?"bg-sky-500/15 text-sky-400":"bg-white/[0.07] text-white/40"}`,children:u.badge}):null]}),jsxs("div",{className:"mt-4",children:[jsxs("p",{className:"text-2xl font-bold text-white",children:[_e&&!Ge?`$${Ke(u.price).replace("$","").split(".")[0]}`:Gt,!Ge&&!_e&&jsx("span",{className:"text-sm font-normal text-white/40",children:"/mo"}),_e&&!Ge&&jsx("span",{className:"text-sm font-normal text-white/40",children:"/mo+"})]}),u.annualPrice&&!X&&jsxs("p",{className:"mt-0.5 text-[12px] text-emerald-400",children:["$",u.annualPrice,"/yr ","\u2014"," save $",u.price*12-u.annualPrice]}),(u.trialCreditCents??0)>0&&!X&&jsxs("p",{className:"mt-0.5 text-[12px] text-emerald-400",children:["+$",(u.trialCreditCents/100).toFixed(0)," credit included"]})]}),jsx("p",{className:"mt-3 text-[13px] leading-relaxed text-white/40",children:u.description}),jsx("ul",{className:"mt-4 flex-1 space-y-1.5",children:u.features.map(ht=>jsxs("li",{className:"flex items-start gap-2 text-[13px] text-white/50",children:[jsx("span",{className:"mt-0.5 flex-shrink-0 text-white/30",children:jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M20 6L9 17l-5-5"})})}),ht]},ht))}),jsx("button",{type:"button",disabled:X||Le,onClick:()=>ye(u),className:`mt-5 w-full rounded-xl px-3 py-2.5 text-sm font-semibold transition active:scale-[0.98] ${X?"cursor-not-allowed bg-white/[0.06] text-white/30":Le?"cursor-wait bg-white/[0.06] text-white/30":u.highlighted?"bg-white text-black hover:bg-white/90":_e?"bg-white/[0.08] text-white/70 hover:bg-white/[0.12] hover:text-white":st&&!t.id?"bg-sky-500/20 text-sky-300 hover:bg-sky-500/30":"bg-white/[0.08] text-white/70 hover:bg-white/[0.12] hover:text-white"}`,children:Kt})]},u.id)})}),m==="history"&&jsxs("div",{className:"rounded-xl border border-border bg-bg-card",children:[jsx("div",{className:"border-b border-border px-4 py-3",children:jsx("h3",{className:"text-sm font-semibold text-text",children:"Subscription timeline"})}),x.length===0?jsx("div",{className:"p-6 text-sm text-text-muted",children:"No history entries yet."}):jsx("div",{className:"divide-y divide-border",children:x.map(u=>jsxs("div",{className:"flex flex-wrap items-start justify-between gap-2 px-4 py-3",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text",children:u.action}),jsx("p",{className:"text-sm text-text-secondary",children:u.details}),u.fromPlan||u.toPlan?jsxs("p",{className:"text-xs text-text-muted",children:[u.fromPlan??"\u2014"," ","\u2192"," ",u.toPlan??"\u2014"]}):null]}),jsx("p",{className:"text-xs text-text-muted",children:Qe(u.date)})]},u.id))})]})]})}d(ot,"SubscriptionPortal");function Zt(e){return e.startsWith("4")?"visa":/^5[1-5]/.test(e)||/^2[2-7]/.test(e)?"mastercard":/^3[47]/.test(e)?"amex":/^6(?:011|5)/.test(e)?"discover":"unknown"}d(Zt,"detectNetwork");function Jt(){return jsx("svg",{viewBox:"0 0 60 20",width:"60",height:"20","aria-label":"Visa",children:jsx("text",{x:"0",y:"16",fontFamily:"Arial Black, sans-serif",fontWeight:"900",fontSize:"18",fill:"white",letterSpacing:"-1",children:"VISA"})})}d(Jt,"VisaLogo");function ea(){return jsxs("svg",{viewBox:"0 0 48 30",width:"48",height:"30","aria-label":"Mastercard",children:[jsx("circle",{cx:"15",cy:"15",r:"14",fill:"#eb001b",opacity:"0.9"}),jsx("circle",{cx:"33",cy:"15",r:"14",fill:"#f79e1b",opacity:"0.9"}),jsx("path",{d:"M24 4.8a14 14 0 0 1 0 20.4A14 14 0 0 1 24 4.8z",fill:"#ff5f00",opacity:"0.9"})]})}d(ea,"MastercardLogo");function ta(){return jsxs("svg",{viewBox:"0 0 70 20",width:"70",height:"20","aria-label":"American Express",children:[jsx("text",{x:"0",y:"15",fontFamily:"Arial, sans-serif",fontWeight:"700",fontSize:"13",fill:"white",letterSpacing:"0.5",children:"AMERICAN"}),jsx("text",{x:"0",y:"28",fontFamily:"Arial, sans-serif",fontWeight:"700",fontSize:"13",fill:"white",letterSpacing:"0.5",children:"EXPRESS"})]})}d(ta,"AmexLogo");function aa(){return jsxs("svg",{viewBox:"0 0 80 22",width:"80",height:"22","aria-label":"Discover",children:[jsx("text",{x:"0",y:"16",fontFamily:"Arial, sans-serif",fontWeight:"700",fontSize:"14",fill:"white",children:"DISCOVER"}),jsx("circle",{cx:"72",cy:"11",r:"9",fill:"#f76f20"})]})}d(aa,"DiscoverLogo");function wt({network:e}){return e==="visa"?jsx(Jt,{}):e==="mastercard"?jsx(ea,{}):e==="amex"?jsx(ta,{}):e==="discover"?jsx(aa,{}):null}d(wt,"NetworkLogo");function ra(){return jsxs("svg",{width:"44",height:"34",viewBox:"0 0 44 34",fill:"none","aria-hidden":"true",children:[jsx("rect",{x:"0.5",y:"0.5",width:"43",height:"33",rx:"5.5",fill:"#c8a951",stroke:"#b8993e"}),jsx("rect",{x:"14",y:"0.5",width:"16",height:"33",fill:"#b8993e",opacity:"0.5"}),jsx("rect",{x:"0.5",y:"11",width:"43",height:"12",fill:"#b8993e",opacity:"0.5"}),jsx("rect",{x:"14",y:"11",width:"16",height:"12",fill:"#c8a951",opacity:"0.8"}),jsx("line",{x1:"14",y1:"0.5",x2:"14",y2:"33.5",stroke:"#a08030",strokeWidth:"0.5"}),jsx("line",{x1:"30",y1:"0.5",x2:"30",y2:"33.5",stroke:"#a08030",strokeWidth:"0.5"}),jsx("line",{x1:"0.5",y1:"11",x2:"43.5",y2:"11",stroke:"#a08030",strokeWidth:"0.5"}),jsx("line",{x1:"0.5",y1:"23",x2:"43.5",y2:"23",stroke:"#a08030",strokeWidth:"0.5"})]})}d(ra,"ChipIcon");function sa(e,t){let r=t==="amex"?15:16,a=e.padEnd(r,"\u2022");return t==="amex"?`${a.slice(0,4)} ${a.slice(4,10)} ${a.slice(10,15)}`:[a.slice(0,4),a.slice(4,8),a.slice(8,12),a.slice(12,16)].map((x,o)=>o<3?x.replace(/\d/g,"\u2022"):x).join(" ")}d(sa,"maskNumber");function nt({number:e,name:t,expiry:r,cvv:a,cvvFocused:i}){let x=e.replace(/\D/g,""),o=Zt(x),b=sa(x,o),c=t.trim()||"YOUR NAME",n=r||"MM/YY",s=a?a.replace(/./g,"\u2022"):"\u2022\u2022\u2022",m={perspective:"1000px",width:"340px",height:"215px"},y={position:"relative",width:"100%",height:"100%",transformStyle:"preserve-3d",transition:"transform 0.6s cubic-bezier(0.4, 0, 0.2, 1)",transform:i?"rotateY(180deg)":"rotateY(0deg)"},R={position:"absolute",inset:0,backfaceVisibility:"hidden",WebkitBackfaceVisibility:"hidden",borderRadius:"16px",overflow:"hidden"},w={...R,background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%)",boxShadow:"0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08)"},A={...R,background:"linear-gradient(135deg, #12121f 0%, #1a1a2e 100%)",boxShadow:"0 20px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.08)",transform:"rotateY(180deg)"};return jsx("div",{style:m,role:"img","aria-label":"Payment card preview",children:jsxs("div",{style:y,children:[jsxs("div",{style:w,children:[jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(135deg, rgba(255,255,255,0.12) 0%, transparent 50%)",pointerEvents:"none"}}),jsxs("div",{style:{position:"absolute",top:"22px",left:"22px",right:"22px",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[jsx(ra,{}),jsx(wt,{network:o})]}),jsx("div",{style:{position:"absolute",top:"50%",left:"22px",right:"22px",transform:"translateY(-50%)",fontFamily:"ui-monospace, SFMono-Regular, Menlo, monospace",fontSize:"18px",fontWeight:"600",letterSpacing:"0.18em",color:"rgba(255,255,255,0.92)",textShadow:"0 1px 3px rgba(0,0,0,0.4)"},children:b}),jsxs("div",{style:{position:"absolute",bottom:"22px",left:"22px",right:"22px",display:"flex",alignItems:"flex-end",justifyContent:"space-between"},children:[jsxs("div",{children:[jsx("div",{style:{fontSize:"9px",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:"3px"},children:"Card holder"}),jsx("div",{style:{fontSize:"13px",fontWeight:"600",color:"rgba(255,255,255,0.9)",textTransform:"uppercase",letterSpacing:"0.05em",maxWidth:"180px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c})]}),jsxs("div",{style:{textAlign:"right"},children:[jsx("div",{style:{fontSize:"9px",color:"rgba(255,255,255,0.5)",textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:"3px"},children:"Expires"}),jsx("div",{style:{fontFamily:"ui-monospace, monospace",fontSize:"13px",fontWeight:"600",color:"rgba(255,255,255,0.9)"},children:n})]})]})]}),jsxs("div",{style:A,children:[jsx("div",{style:{position:"absolute",top:"40px",left:0,right:0,height:"46px",background:"linear-gradient(180deg, #1a1a1a 0%, #111 50%, #1a1a1a 100%)"}}),jsxs("div",{style:{position:"absolute",top:"108px",left:"22px",right:"22px",display:"flex",alignItems:"center",gap:"12px"},children:[jsx("div",{style:{flex:1,height:"40px",background:"repeating-linear-gradient(90deg, #e8e0d0 0px, #e8e0d0 8px, #d4cabb 8px, #d4cabb 10px)",borderRadius:"4px",display:"flex",alignItems:"center",paddingLeft:"8px"},children:jsx("span",{style:{fontFamily:"cursive, serif",fontSize:"12px",color:"#555",opacity:.6},children:"Authorized signature"})}),jsxs("div",{style:{width:"60px",height:"40px",background:"white",borderRadius:"4px",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",boxShadow:i?"0 0 0 2px #6366f1, 0 0 12px rgba(99,102,241,0.4)":"none",transition:"box-shadow 0.3s ease"},children:[jsx("span",{style:{fontSize:"9px",color:"#888",marginBottom:"2px"},children:"CVV"}),jsx("span",{style:{fontFamily:"ui-monospace, monospace",fontSize:"14px",fontWeight:"700",color:"#111",letterSpacing:"0.1em"},children:s})]})]}),jsx("div",{style:{position:"absolute",bottom:"18px",right:"22px",opacity:.7},children:jsx(wt,{network:o})})]})]})})}d(nt,"AnimatedCard");var la={bitcoin:"Bitcoin (BTC)",ethereum:"Ethereum (ETH)",solana:"Solana (SOL)",usdc:"USDC"},da={1:"Ethereum",137:"Polygon",10:"Optimism",42161:"Arbitrum",8453:"Base",43114:"Avalanche",56:"BSC"};function ca(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"Card"}d(ca,"formatCardBrand");function ma(e){if(e.type==="card")return `${ca(e.card?.brand||"")} \u2022\u2022\u2022\u2022 ${e.card?.last4||"\u2022\u2022\u2022\u2022"}`;if(e.type==="crypto"){let t=e.crypto?.network??"ethereum",r=la[t]??t,a=e.crypto?.walletAddress??"",i=a.length>12?`${a.slice(0,6)}\u2026${a.slice(-4)}`:a;return `${r} ${i}`}return e.type==="wire"?e.wire?.bankName??"Wire transfer":e.type==="bank_account"||e.type==="sepa_debit"?`${e.bank_account?.bankName||"Bank account"} \u2022\u2022\u2022\u2022 ${e.bank_account?.last4||"\u2022\u2022\u2022\u2022"}`:e.type}d(ma,"methodDisplay");function ua(e){switch(e){case "card":return "\u{1F4B3}";case "crypto":return "\u{1F517}";case "wire":return "\u{1F3E6}";case "bank_account":case "sepa_debit":return "\u{1F3DB}\uFE0F";default:return "\u{1F4B0}"}}d(ua,"methodIcon");function St(e){if(e.type!=="card")return null;let t=e.card?.exp_month,r=e.card?.exp_year;return !t||!r?null:`${String(t).padStart(2,"0")}/${String(r).slice(-2)}`}d(St,"methodExpiration");function pa(e){if(e.type==="crypto")return e.crypto?.label||"Crypto wallet";if(e.type==="wire"){let t=[];return e.wire?.swift&&t.push(`SWIFT: ${e.wire.swift}`),e.wire?.country&&t.push(e.wire.country),t.join(" \xB7 ")||"Wire transfer"}return null}d(pa,"methodSubtext");function xa(e,t,r){navigator.clipboard.writeText(e).then(()=>{r(`${t} copied`),setTimeout(()=>r(""),2e3);});}d(xa,"copyToClipboard");var ba="flex-1 rounded-lg px-3 py-2 text-sm font-medium transition",ga="bg-bg-elevated text-text",fa="text-text-muted hover:text-text-secondary",De="w-full rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text outline-none transition placeholder:text-text-dim focus:border-brand focus:ring-1 focus:ring-brand",it="w-full rounded-lg bg-text px-4 py-2.5 text-sm font-medium text-bg transition hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60";function lt(e){let{paymentMethods:t,initialMethods:r,onAdd:a,onRemove:i,onSetDefault:x,onMethodAdded:o,onMethodRemoved:b,onDefaultChanged:c}=e,[n,s]=F.useState(t&&t.length>0?t:r||[]),[m,y]=F.useState(null),[R,w]=F.useState(false),[A,C]=F.useState("card"),[v,l]=F.useState(null),[f,p]=F.useState(null);F.useEffect(()=>{t&&s(t);},[t]);let D=F.useCallback(async h=>{try{await a?.(h),s(N=>[...N,h]),o?.(h),w(!1),p(null),l("Payment method added"),setTimeout(()=>l(null),3e3);}catch(N){p(N instanceof Error?N.message:"Failed to add payment method");}},[a,o]),$=F.useCallback(async h=>{y(h);try{await i?.(h),s(N=>N.filter(T=>T.id!==h)),b?.(h);}finally{y(null);}},[b,i]),_=F.useCallback(async h=>{y(h);try{await x?.(h),s(N=>N.map(T=>({...T,is_default:T.id===h,isDefault:T.id===h}))),c?.(h);}finally{y(null);}},[c,x]);return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Payment methods"}),jsx("p",{className:"text-sm text-text-muted",children:"Add a card, crypto wallet, or bank wire transfer"})]}),jsx("button",{type:"button",onClick:()=>{w(h=>!h),p(null);},className:"rounded-lg bg-text px-3 py-2 text-sm font-medium text-bg transition hover:opacity-80",children:R?"Cancel":"Add method"})]}),R&&jsxs("div",{className:"border-b border-border p-4",children:[jsx("div",{className:"mb-4 flex gap-1 rounded-xl bg-bg p-1",children:[["card","Card"],["crypto","Crypto"],["wire","Bank Wire"]].map(([h,N])=>jsx("button",{type:"button",onClick:()=>{C(h),p(null);},className:`${ba} ${A===h?ga:fa}`,children:N},h))}),A==="card"&&jsx(ya,{onAdd:D,setError:p}),A==="crypto"&&jsx(ha,{onAdd:D,setError:p}),A==="wire"&&jsx(wa,{onAdd:D}),f&&jsx("p",{className:"mt-3 text-sm text-danger",children:f})]}),v&&jsx("div",{className:"border-b border-border px-4 py-2",children:jsx("p",{className:"text-sm text-success",children:v})}),jsx("div",{className:"divide-y divide-border",children:n.length===0?jsx("div",{className:"p-6 text-sm text-text-muted",children:"No payment methods on file."}):n.map(h=>{let N=h.is_default||h.isDefault,T=m===h.id,j=pa(h);return jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 p-4",children:[jsxs("div",{className:"flex items-start gap-3",children:[jsx("span",{className:"mt-0.5 text-lg",children:ua(h.type)}),jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text",children:ma(h)}),jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-text-muted",children:[jsxs("span",{children:["Added ",new Date(h.created_at).toLocaleDateString("en-US")]}),St(h)?jsxs("span",{children:["Expires ",St(h)]}):null,j?jsx("span",{children:j}):null,N&&jsx("span",{className:"rounded-full bg-brand px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide text-brand-foreground",children:"Default"})]})]})]}),jsxs("div",{className:"flex items-center gap-2",children:[!N&&jsx("button",{type:"button",disabled:T,onClick:()=>_(h.id),className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:T?"Saving\u2026":"Set default"}),jsx("button",{type:"button",disabled:T,onClick:()=>$(h.id),className:"rounded-md border border-rose-500/30 px-3 py-1.5 text-xs font-medium text-rose-500 transition hover:bg-rose-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:T?"Removing\u2026":"Remove"})]})]},h.id)})})]})})}d(lt,"PaymentMethodManager");function va(e){return e.startsWith("4")?"visa":/^5[1-5]/.test(e)||/^2[2-7]/.test(e)?"mastercard":/^3[47]/.test(e)?"amex":/^6(?:011|5)/.test(e)?"discover":""}d(va,"detectBrandPM");function ya({onAdd:e,setError:t}){let[r,a]=F.useState(""),[i,x]=F.useState(""),[o,b]=F.useState(""),[c,n]=F.useState(""),[s,m]=F.useState(""),[y,R]=F.useState(false),[w,A]=F.useState(false),C=r.replace(/\D/g,""),l=va(C)==="amex"?4:3,f=F.useMemo(()=>typeof window<"u"?localStorage.getItem("hanzo-auth-token")??void 0:void 0,[]),p=F.useCallback(async $=>{if($.preventDefault(),t(""),C.length<13){t("Invalid card number");return}if(!o.includes("/")){t("Invalid expiry");return}let[_,h]=o.split("/");if(!_||!h||_.length!==2||h.length!==2){t("Invalid expiry");return}if(c.length<3){t("Invalid CVC");return}if(!i.trim()){t("Name required");return}R(true);try{let N=process.env.NEXT_PUBLIC_COMMERCE_API??"https://api.hanzo.ai/api/v1",T={"Content-Type":"application/json"};f&&(T.Authorization=`Bearer ${f}`);let j=await fetch(`${N}/billing/card/tokenize`,{method:"POST",headers:T,body:JSON.stringify({number:C,expiry_month:_,expiry_year:`20${h}`,cvc:c,name:i.trim(),zip:s.trim()})});if(!j.ok){let Me=await j.json().catch(()=>({}));throw new Error(Me.error??`Error ${j.status}`)}let ye=await j.json(),Ce={id:`pm_${Math.random().toString(36).slice(2,12)}`,type:"card",is_default:!1,isDefault:!1,created_at:new Date().toISOString(),card:{brand:ye.brand,last4:ye.last4,exp_month:parseInt(_,10),exp_year:parseInt(`20${h}`,10),funding:"credit"},billing_details:{name:i.trim()},_sourceToken:ye.token};await e(Ce);}catch(N){t(N instanceof Error?N.message:"Card error");}finally{R(false);}},[C,o,c,i,s,f,e,t]),D=!y&&C.length>=13&&!!o&&!!c&&!!i.trim();return jsxs("form",{onSubmit:p,className:"space-y-4",children:[jsx("div",{style:{display:"flex",justifyContent:"center",padding:"8px 0"},children:jsx(nt,{number:C,name:i,expiry:o.replace("/",""),cvv:c,cvvFocused:w})}),jsx("input",{type:"text",inputMode:"numeric",autoComplete:"cc-number",placeholder:"Card number",value:r,onChange:$=>{let _=$.target.value.replace(/\D/g,"").slice(0,16);a(_.replace(/(.{4})/g,"$1 ").trim());},className:De,disabled:y,maxLength:19}),jsx("input",{type:"text",autoComplete:"cc-name",placeholder:"Cardholder name",value:i,onChange:$=>x($.target.value),className:De,disabled:y}),jsxs("div",{className:"grid grid-cols-2 gap-3",children:[jsx("input",{type:"text",inputMode:"numeric",autoComplete:"cc-exp",placeholder:"MM/YY",value:o,onChange:$=>{let _=$.target.value.replace(/\D/g,"").slice(0,4);b(_.length>=3?_.slice(0,2)+"/"+_.slice(2):_);},className:De,disabled:y,maxLength:5}),jsx("input",{type:"password",inputMode:"numeric",autoComplete:"cc-csc",placeholder:"CVC",value:c,onChange:$=>n($.target.value.replace(/\D/g,"").slice(0,l)),onFocus:()=>A(true),onBlur:()=>A(false),className:De,disabled:y,maxLength:l})]}),jsx("input",{type:"text",autoComplete:"postal-code",placeholder:"ZIP (optional)",value:s,onChange:$=>m($.target.value.slice(0,10)),className:De,disabled:y}),jsx("button",{type:"submit",className:it,disabled:!D,children:y?"Processing...":"Save card"}),jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",color:"rgba(255,255,255,0.3)"},children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Secured by Hanzo Commerce ","\xB7"," PCI DSS compliant"]})]})}d(ya,"CardForm");function ha({onAdd:e,setError:t}){let{address:r,isConnected:a}=useAccount(),i=useChainId(),[x,o]=F.useState(""),[b,c]=F.useState(false),n=da[i]??`Chain ${i}`,s=F.useCallback(async()=>{if(r){c(true);try{let m={id:`pm_${Math.random().toString(36).slice(2,12)}`,type:"crypto",is_default:!1,isDefault:!1,created_at:new Date().toISOString(),crypto:{network:"ethereum",walletAddress:r,label:x||`${n} wallet`},billing_details:{}};await e(m);}catch(m){t(m instanceof Error?m.message:"Failed to save wallet");}finally{c(false);}}},[r,i,n,x,e,t]);return jsxs("div",{className:"space-y-3",children:[jsx("p",{className:"text-xs text-text-muted",children:"Connect your wallet to save it as a payment method. Supports Ethereum, Polygon, Arbitrum, Optimism, Base, Avalanche, BSC, and more."}),jsx("div",{className:"flex justify-center",children:jsx(ConnectButton,{showBalance:false})}),a&&r&&jsxs("div",{className:"space-y-3",children:[jsxs("div",{className:"rounded-lg border border-border bg-bg p-3",children:[jsx("div",{className:"flex items-center justify-between",children:jsxs("p",{className:"text-xs text-text-dim",children:["Connected on ",n]})}),jsx("p",{className:"mt-1 font-mono text-sm text-text break-all",children:r})]}),jsx("input",{value:x,onChange:m=>o(m.target.value),placeholder:`Label (e.g. "My ${n} wallet")`,className:De}),jsx("button",{type:"button",disabled:b,onClick:s,className:it,children:b?"Saving wallet\u2026":"Save wallet as payment method"})]}),jsx("p",{className:"text-xs text-text-dim",children:"Non-EVM chains (Solana, TON, Bitcoin) coming soon."})]})}d(ha,"CryptoForm");var Na=[{label:"Beneficiary Bank",value:"Bank of America, NA 222 Broadway, New York, NY 10038"},{label:"Beneficiary",value:"Hanzo, Inc, 4811 Mastin Street, Merriam, KS 66203"},{label:"Routing \u2014 ACH",value:"113000023 / 111000025"},{label:"Routing \u2014 Wire",value:"026009593"},{label:"SWIFT",value:"BOFAUS3N"},{label:"Reference",value:"Hanzo"}];function wa({onAdd:e}){let[t,r]=F.useState(""),[a,i]=F.useState(false),x=F.useCallback(async()=>{i(true);try{let o={id:`pm_${Math.random().toString(36).slice(2,12)}`,type:"wire",is_default:!1,isDefault:!1,created_at:new Date().toISOString(),wire:{bankName:"Bank of America",accountHolder:"Hanzo, Inc",routingNumber:"026009593",swift:"BOFAUS3N",country:"US"},billing_details:{}};await e(o);}finally{i(false);}},[e]);return jsxs("div",{className:"space-y-3",children:[jsx("p",{className:"text-xs text-text-muted",children:"Send a wire transfer to the account below. Click any field to copy."}),jsx("div",{className:"space-y-2",children:Na.map(({label:o,value:b})=>jsxs("button",{type:"button",onClick:()=>xa(b,o,r),className:"w-full rounded-lg border border-border bg-bg p-3 text-left transition hover:border-border-strong group",children:[jsx("p",{className:"text-[11px] uppercase tracking-wide text-text-dim",children:o}),jsxs("div",{className:"mt-0.5 flex items-center justify-between",children:[jsx("p",{className:"text-sm text-text",children:b}),jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"shrink-0 text-text-dim group-hover:text-text-muted",children:[jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2",ry:"2"}),jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]})]})]},o))}),t&&jsx("p",{className:"text-xs text-success",children:t}),jsx("button",{type:"button",disabled:a,onClick:x,className:it,children:a?"Saving\u2026":"Confirm wire sent"})]})}d(wa,"WireForm");function Ct(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}d(Ct,"formatCurrency");function Pt(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(e)}d(Pt,"formatDate");function kt(e){return typeof e.breakdown?.totalCents=="number"?e.breakdown.totalCents/100:typeof e.total=="number"?e.total:e.amount}d(kt,"invoiceAmount");var Ue={paid:{label:"Paid",className:"bg-emerald-500/10 text-emerald-500 ring-emerald-500/20"},pending:{label:"Pending",className:"bg-amber-500/10 text-amber-500 ring-amber-500/20"},unpaid:{label:"Unpaid",className:"bg-rose-500/10 text-rose-500 ring-rose-500/20"},failed:{label:"Failed",className:"bg-rose-500/10 text-rose-500 ring-rose-500/20"},refunded:{label:"Refunded",className:"bg-sky-500/10 text-sky-500 ring-sky-500/20"},void:{label:"Void",className:"bg-text-dim/10 text-text-muted ring-text-dim/20"}},Sa=["all","paid","pending","unpaid","failed","refunded","void"];function dt(e){let{invoices:t=[],onDownload:r,onFilter:a,defaultView:i="table",pageSize:x=10}=e,[o,b]=F.useState(i),[c,n]=F.useState(""),[s,m]=F.useState("all"),[y,R]=F.useState(1),[w,A]=F.useState(null),C=F.useMemo(()=>{let p=c.trim().toLowerCase();return t.filter(D=>s!=="all"&&D.status!==s?false:p?[D.invoiceNumber,D.number??"",D.id,D.status].join(" ").toLowerCase().includes(p):true).sort((D,$)=>$.date.getTime()-D.date.getTime())},[t,c,s]),v=Math.max(1,Math.ceil(C.length/x)),l=F.useMemo(()=>{let D=(Math.min(y,v)-1)*x;return C.slice(D,D+x)},[C,y,x,v]);F.useEffect(()=>{a?.({status:s==="all"?void 0:s,search:c.trim()||void 0});},[a,c,s]),F.useEffect(()=>{y>v&&R(v);},[y,v]);let f=F.useCallback(async p=>{if(r){A(p.id);try{await r(p);}finally{A(null);}}},[r]);return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Invoice history"}),jsxs("p",{className:"text-sm text-text-muted",children:[C.length," invoice(s) matching current filters"]})]}),jsxs("div",{className:"inline-flex rounded-lg border border-border p-1",children:[jsx("button",{type:"button",onClick:()=>b("table"),className:`rounded-md px-3 py-1.5 text-sm transition ${o==="table"?"bg-text text-bg":"text-text-muted hover:bg-bg-elevated"}`,children:"Table"}),jsx("button",{type:"button",onClick:()=>b("grid"),className:`rounded-md px-3 py-1.5 text-sm transition ${o==="grid"?"bg-text text-bg":"text-text-muted hover:bg-bg-elevated"}`,children:"Grid"})]})]}),jsxs("div",{className:"flex flex-wrap gap-3 border-b border-border p-4",children:[jsx("input",{type:"search",value:c,onChange:p=>{n(p.target.value),R(1);},placeholder:"Search invoices by id, number, or status",className:"min-w-[250px] flex-1 rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text outline-none transition focus:border-brand"}),jsx("select",{value:s,onChange:p=>{m(p.target.value),R(1);},className:"rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text-secondary outline-none transition focus:border-brand",children:Sa.map(p=>jsx("option",{value:p,children:p==="all"?"All statuses":Ue[p].label},p))})]}),o==="table"?jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[720px]",children:[jsx("thead",{className:"bg-bg-elevated",children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Invoice"}),jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Date"}),jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Amount"}),jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Status"}),jsx("th",{className:"px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Actions"})]})}),jsx("tbody",{className:"divide-y divide-border",children:l.length===0?jsx("tr",{children:jsx("td",{colSpan:5,className:"px-4 py-10 text-center text-sm text-text-muted",children:"No invoices found."})}):l.map(p=>jsxs("tr",{children:[jsx("td",{className:"px-4 py-3 text-sm text-text",children:p.number||p.invoiceNumber||p.id}),jsx("td",{className:"px-4 py-3 text-sm text-text-secondary",children:Pt(p.date)}),jsx("td",{className:"px-4 py-3 text-sm font-medium text-text",children:Ct(kt(p),p.currency||"USD")}),jsx("td",{className:"px-4 py-3 text-sm",children:jsx("span",{className:`inline-flex rounded-full px-2 py-1 text-xs font-semibold ring-1 ${Ue[p.status].className}`,children:Ue[p.status].label})}),jsx("td",{className:"px-4 py-3 text-right",children:jsx("button",{type:"button",disabled:!r||w===p.id,onClick:()=>f(p),className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:w===p.id?"Downloading\u2026":"Download PDF"})})]},p.id))})]})}):jsx("div",{className:"grid gap-3 p-4 md:grid-cols-2 xl:grid-cols-3",children:l.length===0?jsx("div",{className:"md:col-span-2 xl:col-span-3 rounded-lg border border-border p-8 text-center text-sm text-text-muted",children:"No invoices found."}):l.map(p=>jsxs("div",{className:"rounded-lg border border-border bg-bg-card p-4",children:[jsxs("div",{className:"flex items-start justify-between gap-3",children:[jsx("p",{className:"font-medium text-text",children:p.number||p.invoiceNumber||p.id}),jsx("span",{className:`inline-flex rounded-full px-2 py-1 text-xs font-semibold ring-1 ${Ue[p.status].className}`,children:Ue[p.status].label})]}),jsxs("p",{className:"mt-2 text-sm text-text-muted",children:["Issued ",Pt(p.date)]}),jsx("p",{className:"mt-2 text-xl font-semibold text-text",children:Ct(kt(p),p.currency||"USD")}),jsx("button",{type:"button",disabled:!r||w===p.id,onClick:()=>f(p),className:"mt-4 w-full rounded-md border border-border px-3 py-2 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:w===p.id?"Downloading\u2026":"Download PDF"})]},p.id))}),jsxs("div",{className:"flex items-center justify-between border-t border-border p-4",children:[jsxs("p",{className:"text-xs text-text-muted",children:["Page ",Math.min(y,v)," of ",v]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",onClick:()=>R(p=>Math.max(1,p-1)),disabled:y<=1,className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:"Previous"}),jsx("button",{type:"button",onClick:()=>R(p=>Math.min(v,p+1)),disabled:y>=v,className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:"Next"})]})]})]})})}d(dt,"InvoiceManager");var ce="w-full rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text outline-none transition focus:border-brand";function ze(e){let{profile:t,onSave:r}=e,[a,i]=F.useState(t),[x,o]=F.useState(false);F.useEffect(()=>{i(t);},[t]);let b=(a.contacts||[]).some(n=>n.role==="finance"||n.role==="legal"),c=F.useCallback(async()=>{if(r){o(true);try{await r(a);}finally{o(false);}}},[a,r]);return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Business profile"}),jsx("p",{className:"text-sm text-text-muted",children:"Keep your legal and support details accurate for invoices, tax, and compliance workflows."})]}),jsxs("div",{className:"grid gap-4 p-4 md:grid-cols-2",children:[jsxs("label",{className:"space-y-1 text-sm",children:[jsx("span",{className:"font-medium text-text-secondary",children:"Legal name"}),jsx("input",{value:a.legalName,onChange:n=>i(s=>({...s,legalName:n.target.value})),className:ce})]}),jsxs("label",{className:"space-y-1 text-sm",children:[jsx("span",{className:"font-medium text-text-secondary",children:"Display name"}),jsx("input",{value:a.displayName,onChange:n=>i(s=>({...s,displayName:n.target.value})),className:ce})]}),jsxs("label",{className:"space-y-1 text-sm",children:[jsx("span",{className:"font-medium text-text-secondary",children:"Website"}),jsx("input",{value:a.website||"",onChange:n=>i(s=>({...s,website:n.target.value})),className:ce})]}),jsxs("label",{className:"space-y-1 text-sm",children:[jsx("span",{className:"font-medium text-text-secondary",children:"Support email"}),jsx("input",{value:a.supportEmail||"",onChange:n=>i(s=>({...s,supportEmail:n.target.value})),className:ce})]}),jsxs("label",{className:"space-y-1 text-sm",children:[jsx("span",{className:"font-medium text-text-secondary",children:"Statement descriptor"}),jsx("input",{value:a.statementDescriptor||"",onChange:n=>i(s=>({...s,statementDescriptor:n.target.value})),className:ce})]}),jsxs("label",{className:"space-y-1 text-sm",children:[jsx("span",{className:"font-medium text-text-secondary",children:"Tax ID"}),jsx("input",{value:a.taxId||"",onChange:n=>i(s=>({...s,taxId:n.target.value})),className:ce})]})]}),jsxs("div",{className:"border-t border-border bg-bg-elevated p-4",children:[jsx("p",{className:"mb-2 text-sm font-medium text-text-secondary",children:"Registered address"}),jsxs("div",{className:"grid gap-3 md:grid-cols-2",children:[jsx("input",{value:a.registeredAddress.line1,onChange:n=>i(s=>({...s,registeredAddress:{...s.registeredAddress,line1:n.target.value}})),placeholder:"Line 1",className:`${ce} text-sm`}),jsx("input",{value:a.registeredAddress.line2||"",onChange:n=>i(s=>({...s,registeredAddress:{...s.registeredAddress,line2:n.target.value}})),placeholder:"Line 2",className:`${ce} text-sm`}),jsx("input",{value:a.registeredAddress.city,onChange:n=>i(s=>({...s,registeredAddress:{...s.registeredAddress,city:n.target.value}})),placeholder:"City",className:`${ce} text-sm`}),jsx("input",{value:a.registeredAddress.state||"",onChange:n=>i(s=>({...s,registeredAddress:{...s.registeredAddress,state:n.target.value}})),placeholder:"State/Province",className:`${ce} text-sm`}),jsx("input",{value:a.registeredAddress.zip,onChange:n=>i(s=>({...s,registeredAddress:{...s.registeredAddress,zip:n.target.value}})),placeholder:"Postal code",className:`${ce} text-sm`}),jsx("input",{value:a.registeredAddress.country,onChange:n=>i(s=>({...s,registeredAddress:{...s.registeredAddress,country:n.target.value}})),placeholder:"Country",className:`${ce} text-sm`})]})]}),jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-border p-4",children:[jsx("p",{className:"text-xs text-text-muted",children:b?"Finance and legal contacts are configured.":"Tip: add at least one finance or legal contact for smooth audits."}),jsx("button",{type:"button",onClick:c,disabled:!r||x,className:"rounded-lg bg-text px-3 py-2 text-sm font-medium text-bg transition hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60",children:x?"Saving\u2026":"Save profile"})]})]})})}d(ze,"BusinessProfilePanel");var At={complete:{label:"Complete",className:"bg-emerald-500/10 text-emerald-500 ring-emerald-500/20"},required:{label:"Required",className:"bg-rose-500/10 text-rose-500 ring-rose-500/20"},review:{label:"Review",className:"bg-amber-500/10 text-amber-500 ring-amber-500/20"},blocked:{label:"Blocked",className:"bg-text-dim/10 text-text-muted ring-text-dim/20"}};function Oe(e){let{taxSettings:t,complianceItems:r,onToggleAutomaticTax:a}=e,[i,x]=F.useState(t.automaticCollection),[o,b]=F.useState(false);F.useEffect(()=>{x(t.automaticCollection);},[t.automaticCollection]);let c=F.useCallback(async()=>{let n=!i;x(n),b(true);try{await a?.(n);}finally{b(false);}},[i,a]);return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"grid gap-4 xl:grid-cols-5",children:[jsxs("div",{className:"xl:col-span-2 overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Tax settings"}),jsx("p",{className:"text-sm text-text-muted",children:"Manage registrations, nexus, and tax collection behavior"})]}),jsxs("div",{className:"space-y-4 p-4",children:[jsxs("div",{className:"flex items-start justify-between gap-4 rounded-lg border border-border p-3",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text",children:"Automatic tax"}),jsx("p",{className:"text-xs text-text-muted",children:"Calculate and collect tax where required"})]}),jsx("button",{type:"button",onClick:c,disabled:o,className:`relative inline-flex h-6 w-11 items-center rounded-full transition ${i?"bg-brand":"bg-border-strong"}`,children:jsx("span",{className:`inline-block h-4 w-4 transform rounded-full bg-white transition ${i?"translate-x-6":"translate-x-1"}`})})]}),jsxs("div",{children:[jsx("p",{className:"mb-2 text-sm font-medium text-text",children:"Registrations"}),jsx("div",{className:"space-y-2",children:t.registrations.length===0?jsx("p",{className:"rounded-lg border border-dashed border-border p-3 text-sm text-text-muted",children:"No tax registrations configured."}):t.registrations.map(n=>jsxs("div",{className:"rounded-lg border border-border p-3",children:[jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsx("p",{className:"text-sm font-medium text-text",children:n.region}),jsx("span",{className:"rounded-full bg-bg-elevated px-2 py-1 text-[10px] font-semibold uppercase tracking-wide text-text-secondary",children:n.status})]}),jsxs("p",{className:"mt-1 text-xs text-text-muted",children:[n.type.toUpperCase()," ","\xB7"," ",n.registrationId]})]},n.id))})]})]})]}),jsxs("div",{className:"xl:col-span-3 overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Compliance checklist"}),jsx("p",{className:"text-sm text-text-muted",children:"Track KYC/KYB, tax filings, and policy requirements"})]}),jsx("div",{className:"divide-y divide-border",children:r.length===0?jsx("div",{className:"p-6 text-sm text-text-muted",children:"No compliance tasks yet."}):r.map(n=>jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 p-4",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text",children:n.title}),jsx("p",{className:"mt-1 text-sm text-text-secondary",children:n.description}),jsxs("p",{className:"mt-1 text-xs text-text-muted",children:["Category: ",n.category.toUpperCase(),n.owner?` \xB7 Owner: ${n.owner}`:""]})]}),jsxs("div",{className:"flex flex-col items-end gap-2",children:[jsx("span",{className:`inline-flex rounded-full px-2 py-1 text-xs font-semibold ring-1 ${At[n.status].className}`,children:At[n.status].label}),n.actionLabel?jsx("button",{type:"button",className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated",children:n.actionLabel}):null]})]},n.id))})]})]})})}d(Oe,"TaxCompliancePanel");var Ca=[{id:"overview",label:"Overview"},{id:"payment",label:"Payment methods"},{id:"invoices",label:"Invoices"},{id:"business",label:"Business info"},{id:"compliance",label:"Tax & compliance"}];function Pa(e){let{subscription:t,plans:r,usageMetrics:a,retentionOffers:i,subscriptionHistory:x,paymentMethods:o,invoices:b,businessProfile:c,taxSettings:n,complianceItems:s,defaultTab:m="overview",onUpgrade:y,onDowngrade:R,onCancel:w,onAcceptOffer:A,onAddPaymentMethod:C,onRemovePaymentMethod:v,onSetDefaultPaymentMethod:l,onDownloadInvoice:f,onSaveBusinessProfile:p,onToggleAutomaticTax:D}=e,[$,_]=F.useState(m);return jsxs("div",{className:"space-y-4",children:[jsxs("div",{className:"overflow-hidden rounded-2xl border border-zinc-200 bg-gradient-to-b from-zinc-50 to-white",children:[jsxs("div",{className:"border-b border-zinc-200 px-4 py-4",children:[jsx("h2",{className:"text-2xl font-semibold text-zinc-900",children:"Billing workspace"}),jsx("p",{className:"text-sm text-zinc-500",children:"Run subscription, invoicing, payment, business profile, and compliance operations from one surface."})]}),jsx("div",{className:"flex flex-wrap gap-2 p-3",children:Ca.map(h=>jsx("button",{type:"button",onClick:()=>_(h.id),className:`rounded-lg px-3 py-1.5 text-sm transition ${$===h.id?"bg-zinc-900 text-white":"text-zinc-600 hover:bg-zinc-100"}`,children:h.label},h.id))})]}),$==="overview"?jsx(ot,{subscription:t,availablePlans:r,usageMetrics:a,retentionOffers:i,subscriptionHistory:x,onUpgrade:y,onDowngrade:R,onCancel:w,onAcceptOffer:A}):null,$==="payment"?jsx(lt,{paymentMethods:o,onAdd:C,onRemove:v,onSetDefault:l}):null,$==="invoices"?jsx(dt,{invoices:b,onDownload:f}):null,$==="business"?jsx(ze,{profile:c,onSave:p}):null,$==="compliance"?jsx(Oe,{taxSettings:n,complianceItems:s,onToggleAutomaticTax:D}):null]})}d(Pa,"BillingWorkspace");function ka(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}).format(e)}d(ka,"formatCurrency");function It(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(e))}d(It,"formatDate");function mt(e){let{alerts:t,onCreateAlert:r,onUpdateAlert:a,onDeleteAlert:i}=e,[x,o]=F.useState(false),[b,c]=F.useState(null),[n,s]=F.useState(""),[m,y]=F.useState(""),[R,w]=F.useState(false),[A,C]=F.useState(null),[v,l]=F.useState(null),f=n.trim().length>0&&parseFloat(m)>0,p=F.useCallback(()=>{s(""),y(""),c(null),o(false),l(null);},[]),D=F.useCallback(async()=>{if(!(!f||!r)){w(true),l(null);try{await r(n.trim(),parseFloat(m)),p();}catch(N){l(N instanceof Error?N.message:"Failed to create alert");}finally{w(false);}}},[f,r,n,m,p]),$=F.useCallback(async()=>{if(!(!f||!b||!a)){w(true),l(null);try{await a(b,n.trim(),parseFloat(m)),p();}catch(N){l(N instanceof Error?N.message:"Failed to update alert");}finally{w(false);}}},[f,b,a,n,m,p]),_=F.useCallback(async N=>{if(i){C(N);try{await i(N);}finally{C(null);}}},[i]),h=F.useCallback(N=>{c(N.id),s(N.title),y(String(N.threshold)),o(true),l(null);},[]);return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Spend alerts"}),jsx("p",{className:"text-sm text-text-muted",children:"Get notified when your spending crosses a threshold. Alerts check every 90 minutes."})]}),jsx("button",{type:"button",onClick:()=>{x?p():o(true);},className:"rounded-lg bg-text px-3 py-2 text-sm font-medium text-bg transition hover:opacity-80",children:x?"Cancel":"New alert"})]}),x&&jsxs("div",{className:"border-b border-border p-4",children:[jsxs("div",{className:"grid gap-3 md:grid-cols-3",children:[jsx("input",{value:n,onChange:N=>s(N.target.value),placeholder:"Alert name (e.g. Monthly budget)",className:"rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text outline-none transition focus:border-brand md:col-span-2"}),jsxs("div",{className:"flex gap-2",children:[jsxs("div",{className:"relative flex-1",children:[jsx("span",{className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-sm text-text-dim",children:"$"}),jsx("input",{type:"number",min:"1",step:"1",value:m,onChange:N=>y(N.target.value),placeholder:"Threshold",className:"w-full rounded-lg border border-border bg-bg-input py-2 pl-7 pr-3 text-sm text-text outline-none transition focus:border-brand"})]}),jsx("button",{type:"button",disabled:!f||R,onClick:b?$:D,className:"rounded-lg bg-text px-4 py-2 text-sm font-medium text-bg transition hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60",children:R?"Saving...":b?"Update":"Create"})]})]}),v&&jsx("p",{className:"mt-2 text-sm text-danger",children:v})]}),jsx("div",{className:"divide-y divide-border",children:t.length===0?jsx("div",{className:"p-6 text-sm text-text-muted",children:"No spend alerts configured."}):t.map(N=>{let T=A===N.id;return jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 p-4",children:[jsxs("div",{children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("p",{className:"text-sm font-medium text-text",children:N.title}),N.triggeredAt&&jsx("span",{className:"rounded-full bg-amber-500/10 px-2 py-0.5 text-[10px] font-semibold text-amber-500 ring-1 ring-amber-500/20",children:"Triggered"})]}),jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-text-muted",children:[jsxs("span",{children:["Threshold: ",ka(N.threshold,N.currency)]}),jsxs("span",{children:["Created ",It(N.createdAt)]}),N.triggeredAt&&jsxs("span",{children:["Triggered ",It(N.triggeredAt)]})]})]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",onClick:()=>h(N),disabled:T,className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:"Edit"}),jsx("button",{type:"button",onClick:()=>_(N.id),disabled:T,className:"rounded-md border border-rose-500/30 px-3 py-1.5 text-xs font-medium text-rose-500 transition hover:bg-rose-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:T?"Deleting...":"Delete"})]})]},N.id)})})]})})}d(mt,"SpendAlertsPanel");function Tt(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}d(Tt,"formatCurrency");function Mt(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:e.toLocaleString()}d(Mt,"formatNumber");function Dt(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric"}).format(new Date(e))}d(Dt,"formatDate");var Aa={ai:"\u{1F916}",storage:"\u{1F4BE}",network:"\u{1F310}",network_egress:"\u{1F4E4}",gpu:"\u26A1",api_calls:"\u{1F4E1}"},Ra={ai:"bg-violet-500",storage:"bg-blue-500",network:"bg-emerald-500",network_egress:"bg-teal-500",gpu:"bg-amber-500",api_calls:"bg-indigo-500"};function Ia({record:e}){let t=e.limit&&e.limit>0?Math.min(e.current/e.limit*100,100):null,r=Aa[e.meterId]??"\u{1F4CA}",a=Ra[e.meterId]??"bg-brand",i=t!==null&&t>=100,x=t!==null&&t>=80&&t<100;return jsxs("div",{className:"rounded-lg border border-border bg-bg-card p-4",children:[jsxs("div",{className:"flex items-start justify-between gap-2",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-lg",children:r}),jsx("p",{className:"text-sm font-medium text-text",children:e.label})]}),e.cost>0&&jsx("span",{className:"rounded-full bg-bg-elevated px-2 py-0.5 text-xs font-medium text-text-secondary",children:Tt(e.cost)})]}),jsxs("div",{className:"mt-3",children:[jsxs("div",{className:"flex items-end justify-between",children:[jsxs("p",{className:"text-2xl font-semibold text-text",children:[Mt(e.current),jsx("span",{className:"ml-1 text-sm font-normal text-text-muted",children:e.unit})]}),e.limit&&e.limit>0&&jsxs("p",{className:"text-xs text-text-muted",children:["of ",Mt(e.limit)," ",e.unit]})]}),t!==null&&jsxs("div",{className:"mt-2",children:[jsx("div",{className:"h-2 rounded-full bg-bg-elevated",children:jsx("div",{className:`h-2 rounded-full transition-all ${i?"bg-danger":x?"bg-warning":a}`,style:{width:`${Math.min(t,100)}%`}})}),jsx("p",{className:`mt-1 text-xs ${i?"text-danger font-medium":x?"text-warning":"text-text-muted"}`,children:i?`${(t-100).toFixed(0)}% over limit`:`${t.toFixed(0)}% used`})]})]})]})}d(Ia,"UsageMeter");function Ma(e){let{usage:t,loading:r=false}=e;if(r)return jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card p-8 text-center",children:[jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-text-dim border-t-brand"}),jsx("p",{className:"mt-3 text-sm text-text-muted",children:"Loading usage data..."})]});if(!t||t.records.length===0)return jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Usage"}),jsx("p",{className:"text-sm text-text-muted",children:"Current billing period resource consumption"})]}),jsx("div",{className:"p-6 text-sm text-text-muted",children:"No usage data available for this period."})]});let a=t.period.start&&t.period.end?`${Dt(t.period.start)} \u2013 ${Dt(t.period.end)}`:"Current period";return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3 border-b border-border p-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Usage"}),jsx("p",{className:"text-sm text-text-muted",children:a})]}),jsxs("div",{className:"text-right",children:[jsx("p",{className:"text-xs uppercase tracking-wide text-text-muted",children:"Total cost"}),jsx("p",{className:"mt-1 text-xl font-semibold text-text",children:Tt(t.totalCost,t.currency)})]})]}),jsx("div",{className:"grid gap-4 p-4 md:grid-cols-2 xl:grid-cols-3",children:t.records.map(i=>jsx(Ia,{record:i},i.meterId))})]})})}d(Ma,"UsagePanel");function Xe(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}d(Xe,"formatCurrency");function Da(e){let t=new Date(e).getTime()-Date.now();if(t<=0)return "Expired";let r=Math.floor(t/(1e3*60*60*24)),a=Math.floor(t%(1e3*60*60*24)/(1e3*60*60));if(r>0)return `${r}d ${a}h remaining`;let i=Math.floor(t%(1e3*60*60)/(1e3*60));return `${a}h ${i}m remaining`}d(Da,"formatCountdown");function Bt(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(new Date(e))}d(Bt,"formatDate");function Ta({creditGrants:e,creditBalance:t=0,onClaimStarterCredit:r}){let[a,i]=F.useState(false),[x,o]=F.useState(null),b=e.some(m=>m.name.toLowerCase().includes("starter")&&m.active),c=e.filter(m=>m.active&&!m.voided),n=e.filter(m=>!m.active||m.voided),s=F.useCallback(async()=>{if(r){i(true),o(null);try{await r();}catch(m){o(m instanceof Error?m.message:"Failed to claim credit");}finally{i(false);}}},[r]);return jsxs("div",{className:"space-y-4",children:[jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Credits"}),jsx("p",{className:"text-sm text-text-muted",children:"View your credit grants, starter credits, and promotional balances"})]}),jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 p-4",children:[jsxs("div",{children:[jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-text-muted",children:"Total credit balance"}),jsx("p",{className:"mt-1 text-3xl font-bold text-text",children:Xe(t/100)})]}),r&&!b&&jsx("button",{type:"button",disabled:a,onClick:s,className:"rounded-lg bg-brand px-5 py-2.5 text-sm font-semibold text-brand-foreground transition hover:bg-brand-hover active:scale-[0.97] disabled:cursor-not-allowed disabled:opacity-60",children:a?"Claiming...":"Claim $5 Starter Credit"})]}),x&&jsx("div",{className:"border-t border-border px-4 py-2",children:jsx("p",{className:"text-sm text-danger",children:x})})]}),c.length>0&&jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsx("div",{className:"border-b border-border px-4 py-3",children:jsx("h4",{className:"text-sm font-semibold text-text",children:"Active credits"})}),jsx("div",{className:"divide-y divide-border",children:c.map(m=>{let y=m.amountCents>0?Math.round(m.remainingCents/m.amountCents*100):0;return jsxs("div",{className:"p-4",children:[jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text",children:m.name}),jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-2 text-xs text-text-muted",children:[jsxs("span",{children:[Xe(m.remainingCents/100,m.currency)," of ",Xe(m.amountCents/100,m.currency)," remaining"]}),m.createdAt&&jsxs("span",{children:["Granted ",Bt(m.createdAt)]})]})]}),m.expiresAt&&jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${new Date(m.expiresAt).getTime()-Date.now()<10080*60*1e3?"bg-warning/10 text-warning":"bg-bg-elevated text-text-muted"}`,children:Da(m.expiresAt)})]}),jsxs("div",{className:"mt-3",children:[jsx("div",{className:"h-2 rounded-full bg-bg-elevated",children:jsx("div",{className:"h-2 rounded-full bg-brand transition-all",style:{width:`${y}%`}})}),jsxs("p",{className:"mt-1 text-xs text-text-dim",children:[y,"% remaining"]})]})]},m.id)})})]}),n.length>0&&jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsx("div",{className:"border-b border-border px-4 py-3",children:jsx("h4",{className:"text-sm font-semibold text-text-muted",children:"Expired / used credits"})}),jsx("div",{className:"divide-y divide-border",children:n.map(m=>jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 px-4 py-3 opacity-60",children:[jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text-muted",children:m.name}),jsxs("p",{className:"text-xs text-text-dim",children:[Xe(m.amountCents/100,m.currency)," ",m.voided?"Voided":"Expired"]})]}),m.expiresAt&&jsxs("p",{className:"text-xs text-text-dim",children:["Expired ",Bt(m.expiresAt)]})]},m.id))})]}),e.length===0&&jsxs("div",{className:"rounded-xl border border-dashed border-border p-8 text-center",children:[jsx("p",{className:"text-sm text-text-muted",children:"No credit grants yet."}),r&&!b&&jsx("p",{className:"mt-2 text-xs text-text-dim",children:"Claim your $5 starter credit above to get started."})]})]})}d(Ta,"CreditsPanel");function Et(e,t="USD"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t,minimumFractionDigits:2}).format(e)}d(Et,"formatCurrency");function Ba(e){return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}).format(new Date(e))}d(Ba,"formatDate");var $t={deposit:{label:"Deposit",color:"text-emerald-500"},withdraw:{label:"Withdrawal",color:"text-rose-500"},hold:{label:"Hold",color:"text-amber-500"},"hold-removed":{label:"Hold Released",color:"text-sky-500"},transfer:{label:"Transfer",color:"text-violet-500"}},Ea=["all","deposit","withdraw","hold","hold-removed","transfer"];function $a({transactions:e,loading:t=false,pageSize:r=20}){let[a,i]=F.useState("all"),[x,o]=F.useState(1),b=F.useMemo(()=>a==="all"?e:e.filter(s=>s.type===a),[e,a]),c=Math.max(1,Math.ceil(b.length/r)),n=F.useMemo(()=>{let m=(Math.min(x,c)-1)*r;return b.slice(m,m+r)},[b,x,r,c]);return F.useEffect(()=>{x>c&&o(c);},[x,c]),t?jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card p-8 text-center",children:[jsx("div",{className:"mx-auto h-6 w-6 animate-spin rounded-full border-2 border-text-dim border-t-brand"}),jsx("p",{className:"mt-3 text-sm text-text-muted",children:"Loading transactions..."})]}):jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-border p-4",children:[jsxs("div",{children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Transactions"}),jsxs("p",{className:"text-sm text-text-muted",children:[b.length," transaction(s)"]})]}),jsx("select",{value:a,onChange:s=>{i(s.target.value),o(1);},className:"rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text-secondary outline-none transition focus:border-brand",children:Ea.map(s=>jsx("option",{value:s,children:s==="all"?"All types":$t[s].label},s))})]}),jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full min-w-[640px]",children:[jsx("thead",{className:"bg-bg-elevated",children:jsxs("tr",{children:[jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Date"}),jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Type"}),jsx("th",{className:"px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Amount"}),jsx("th",{className:"px-4 py-3 text-left text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Description"}),jsx("th",{className:"px-4 py-3 text-right text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Balance"})]})}),jsx("tbody",{className:"divide-y divide-border",children:n.length===0?jsx("tr",{children:jsx("td",{colSpan:5,className:"px-4 py-10 text-center text-sm text-text-muted",children:"No transactions found."})}):n.map(s=>{let m=$t[s.type]??{label:s.type,color:"text-text-muted"},y=s.type==="deposit"||s.type==="hold-removed";return jsxs("tr",{children:[jsx("td",{className:"px-4 py-3 text-sm text-text-secondary",children:Ba(s.createdAt)}),jsx("td",{className:"px-4 py-3 text-sm",children:jsx("span",{className:`font-medium ${m.color}`,children:m.label})}),jsxs("td",{className:`px-4 py-3 text-right text-sm font-medium ${y?"text-emerald-500":"text-rose-500"}`,children:[y?"+":"-",Et(Math.abs(s.amountCents)/100,s.currency)]}),jsx("td",{className:"px-4 py-3 text-sm text-text-muted",children:s.description||"\u2014"}),jsx("td",{className:"px-4 py-3 text-right text-sm text-text-secondary",children:s.balanceAfter!=null?Et(s.balanceAfter/100,s.currency):"\u2014"})]},s.id)})})]})}),c>1&&jsxs("div",{className:"flex items-center justify-between border-t border-border p-4",children:[jsxs("p",{className:"text-xs text-text-muted",children:["Page ",Math.min(x,c)," of ",c]}),jsxs("div",{className:"flex items-center gap-2",children:[jsx("button",{type:"button",onClick:()=>o(s=>Math.max(1,s-1)),disabled:x<=1,className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:"Previous"}),jsx("button",{type:"button",onClick:()=>o(s=>Math.min(c,s+1)),disabled:x>=c,className:"rounded-md border border-border px-3 py-1.5 text-xs font-medium text-text-secondary transition hover:bg-bg-elevated disabled:cursor-not-allowed disabled:opacity-60",children:"Next"})]})]})]})})}d($a,"TransactionsPanel");function Ft(e){return e.kind==="percent"?`${e.value}% off`:`$${e.value} off`}d(Ft,"formatDiscount");function ut({discount:e,onApplyDiscount:t}){let[r,a]=F.useState(""),[i,x]=F.useState(false),[o,b]=F.useState(null),c=F.useCallback(async()=>{if(!(!t||!r.trim())){x(true),b(null);try{let n=await t(r.trim());n&&n.valid?(b({success:!0,message:`Applied: ${n.name||n.code} (${Ft(n)})`}),a("")):b({success:!1,message:"Invalid or expired code"});}catch(n){b({success:false,message:n instanceof Error?n.message:"Failed to apply code"});}finally{x(false);}}},[t,r]);return jsxs("div",{className:"space-y-4",children:[e&&jsxs("div",{className:"overflow-hidden rounded-xl border border-emerald-500/30 bg-emerald-500/5",children:[jsx("div",{className:"border-b border-emerald-500/20 px-4 py-3",children:jsx("h4",{className:"text-sm font-semibold text-emerald-500",children:"Active discount"})}),jsxs("div",{className:"p-4",children:[jsx("p",{className:"text-lg font-semibold text-text",children:e.name||e.code||"Discount"}),jsxs("p",{className:"mt-1 text-sm text-text-secondary",children:[Ft(e),e.duration==="repeating"&&e.durationInMonths?` for ${e.durationInMonths} months`:e.duration==="forever"?" forever":e.duration==="once"?" (one-time)":""]})]})]}),jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Promotions & Discounts"}),jsx("p",{className:"text-sm text-text-muted",children:"Enter a promo code, referral code, or discount code to apply to your subscription."})]}),jsxs("div",{className:"p-4",children:[jsxs("div",{className:"flex gap-2",children:[jsx("input",{value:r,onChange:n=>{a(n.target.value.toUpperCase()),b(null);},placeholder:"Enter promo code",className:"flex-1 rounded-lg border border-border bg-bg-input px-3 py-2 text-sm font-mono uppercase text-text outline-none transition placeholder:text-text-dim focus:border-brand"}),jsx("button",{type:"button",disabled:!r.trim()||i||!t,onClick:c,className:"rounded-lg bg-text px-5 py-2 text-sm font-medium text-bg transition hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60",children:i?"Applying...":"Apply"})]}),o&&jsx("p",{className:`mt-2 text-sm ${o.success?"text-success":"text-danger"}`,children:o.message})]})]}),jsxs("div",{className:"rounded-xl border border-dashed border-border p-6 text-center",children:[jsx("p",{className:"text-sm text-text-muted",children:"Watch for promotional offers, seasonal discounts, and referral bonuses."}),jsx("p",{className:"mt-1 text-xs text-text-dim",children:"Credits and promotions are applied automatically at billing time."})]})]})}d(ut,"PromotionsPanel");var Fa=[{id:"community",name:"Community",price:0,billingPeriod:"monthly",features:["Community forum access","Public documentation","GitHub issues","72-hour response SLA"]},{id:"priority",name:"Priority",price:99,billingPeriod:"monthly",highlighted:true,features:["Email support","Dedicated support channel","24-hour response SLA","Priority bug fixes","Quarterly architecture review"]},{id:"enterprise",name:"Enterprise",price:499,billingPeriod:"monthly",features:["Dedicated support engineer","Slack/Teams integration","4-hour response SLA","Custom SLAs available","Onboarding assistance","Monthly strategy calls"]}];function La(e){return e===0?"Free":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0}).format(e)}d(La,"formatCurrency");function pt({currentTier:e,onSubscribe:t}){let[r,a]=F.useState(null),i=F.useCallback(async o=>{if(t){a(o);try{await t(o);}finally{a(null);}}},[t]),x=e??"community";return jsxs("div",{className:"space-y-4",children:[jsx("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Support plans"}),jsx("p",{className:"text-sm text-text-muted",children:"Choose the level of support that fits your needs. Upgrade anytime."})]})}),jsx("div",{className:"grid gap-4 md:grid-cols-3",children:Fa.map(o=>{let b=o.id===x,c=r===o.id;return jsxs("div",{className:`relative rounded-xl border p-5 transition ${o.highlighted&&!b?"border-2 border-brand bg-bg-card":b?"border-brand bg-brand/10":"border-border bg-bg-card"}`,children:[o.highlighted&&!b&&jsx("span",{className:"absolute -top-3 left-4 rounded-full bg-brand px-3 py-0.5 text-xs font-semibold text-brand-foreground",children:"Recommended"}),jsx("p",{className:"text-lg font-semibold text-text",children:o.name}),jsxs("p",{className:"mt-2 text-2xl font-bold text-text",children:[La(o.price),o.price>0&&jsxs("span",{className:"text-sm font-normal text-text-muted",children:["/",o.billingPeriod]})]}),jsx("ul",{className:"mt-4 space-y-2 text-sm text-text-secondary",children:o.features.map(n=>jsxs("li",{className:"flex items-start gap-2",children:[jsx("span",{className:"mt-0.5 text-emerald-500",children:"\u2713"}),n]},n))}),jsx("button",{type:"button",disabled:b||c||!t,onClick:()=>i(o.id),className:`mt-5 w-full rounded-lg px-3 py-2 text-sm font-medium transition ${b?"cursor-not-allowed bg-bg-elevated text-text-dim":c?"cursor-wait bg-bg-elevated text-text-muted":o.highlighted?"bg-brand text-brand-foreground hover:bg-brand-hover active:scale-[0.97]":"bg-text text-bg hover:opacity-80"}`,children:b?"Current plan":c?"Subscribing...":o.price===0?"Downgrade":"Upgrade"})]},o.id)})})]})}d(pt,"SupportTiersPanel");function Lt(e){switch(e){case "owner":return "bg-brand/20 text-brand";case "admin":return "bg-amber-500/20 text-amber-400";case "viewer":return "bg-text-dim/20 text-text-muted"}}d(Lt,"roleBadgeClass");function _t(e){return "bg-text-dim/20 text-text-muted"}d(_t,"planBadgeClass");function Ut(e,t){return new Intl.NumberFormat("en-US",{style:"currency",currency:t.toUpperCase(),minimumFractionDigits:2}).format(e/100)}d(Ut,"formatBalance");function _a({accounts:e,activeAccountId:t,onSwitch:r,onCreate:a}){let[i,x]=F.useState(false),o=F.useRef(null);F.useEffect(()=>{function c(n){o.current&&!o.current.contains(n.target)&&x(false);}if(d(c,"handleClick"),i)return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[i]);let b=e.find(c=>c.id===t)??e[0]??null;return e.length===0&&!a?null:jsxs("div",{ref:o,className:"relative mb-4",children:[jsxs("button",{type:"button",onClick:()=>x(c=>!c),className:"flex w-full items-center justify-between rounded-xl border border-border bg-bg-card px-4 py-3 text-left transition hover:bg-bg-elevated",children:[b?jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-brand/20 text-sm font-bold text-brand",children:b.orgName.charAt(0).toUpperCase()}),jsxs("div",{children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-semibold text-text",children:b.name}),jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${_t(b.plan)}`,children:b.plan}),jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${Lt(b.role)}`,children:b.role})]}),jsxs("span",{className:"text-xs text-text-muted",children:[b.orgName," \xB7 ",Ut(b.balance,b.currency)]})]})]}):jsx("span",{className:"text-sm text-text-muted",children:"No billing account"}),jsx("svg",{className:`h-4 w-4 text-text-muted transition-transform ${i?"rotate-180":""}`,fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19 9l-7 7-7-7"})})]}),i&&jsxs("div",{className:"absolute left-0 right-0 z-50 mt-1 overflow-hidden rounded-xl border border-border bg-bg-card shadow-lg",children:[jsx("div",{className:"max-h-72 overflow-y-auto divide-y divide-border",children:e.map(c=>{let n=c.id===t;return jsxs("button",{type:"button",onClick:()=>{r(c.id),x(false);},className:`flex w-full items-center gap-3 px-4 py-3 text-left transition hover:bg-bg-elevated ${n?"bg-bg-elevated":""}`,children:[jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-brand/20 text-sm font-bold text-brand",children:c.orgName.charAt(0).toUpperCase()}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-2",children:[jsx("span",{className:"text-sm font-medium text-text truncate",children:c.name}),jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${_t(c.plan)}`,children:c.plan}),jsx("span",{className:`shrink-0 rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${Lt(c.role)}`,children:c.role})]}),jsxs("span",{className:"text-xs text-text-muted",children:[c.orgName," \xB7 ",Ut(c.balance,c.currency)]})]}),n&&jsx("svg",{className:"h-4 w-4 shrink-0 text-brand",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5 13l4 4L19 7"})})]},c.id)})}),a&&jsx("div",{className:"border-t border-border p-2",children:jsxs("button",{type:"button",onClick:()=>{a(),x(false);},className:"flex w-full items-center gap-2 rounded-lg px-3 py-2 text-sm text-text-muted transition hover:bg-bg-elevated hover:text-text",children:[jsx("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4v16m8-8H4"})}),"Create billing account"]})})]})]})}d(_a,"AccountSwitcher");var zt=["owner","admin","viewer"];function Ua(e){switch(e){case "owner":return "bg-brand/20 text-brand";case "admin":return "bg-amber-500/20 text-amber-400";case "viewer":return "bg-text-dim/20 text-text-muted"}}d(Ua,"roleBadgeClass");var Ot="rounded-lg border border-border bg-bg-input px-3 py-2 text-sm text-text outline-none transition focus:border-brand";function xt({members:e,userRole:t,onInvite:r,onChangeRole:a,onRemove:i}){let x=t==="owner"||t==="admin",[o,b]=F.useState(""),[c,n]=F.useState("viewer"),[s,m]=F.useState(false),[y,R]=F.useState(null),w=F.useCallback(async()=>{if(!(!o.includes("@")||!r)){m(true);try{await r(o,c),b(""),n("viewer");}finally{m(false);}}},[o,c,r]),A=F.useCallback(async(v,l)=>{if(a){R(v);try{await a(v,l);}finally{R(null);}}},[a]),C=F.useCallback(async v=>{if(i){R(v);try{await i(v);}finally{R(null);}}},[i]);return jsx("div",{className:"space-y-4",children:jsxs("div",{className:"overflow-hidden rounded-xl border border-border bg-bg-card",children:[jsxs("div",{className:"border-b border-border p-4",children:[jsx("h3",{className:"text-lg font-semibold text-text",children:"Team members"}),jsx("p",{className:"text-sm text-text-muted",children:x?"Manage who has access to this billing account.":"View members of this billing account."})]}),x&&r&&jsxs("div",{className:"flex flex-wrap items-end gap-3 border-b border-border p-4",children:[jsxs("div",{className:"flex-1 min-w-[200px]",children:[jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Email address"}),jsx("input",{type:"email",value:o,onChange:v=>b(v.target.value),placeholder:"colleague@company.com",className:`${Ot} w-full`})]}),jsxs("div",{className:"w-32",children:[jsx("label",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Role"}),jsx("select",{value:c,onChange:v=>n(v.target.value),className:`${Ot} w-full`,children:zt.map(v=>jsx("option",{value:v,children:v.charAt(0).toUpperCase()+v.slice(1)},v))})]}),jsx("button",{type:"button",disabled:!o.includes("@")||s,onClick:w,className:"rounded-lg bg-text px-4 py-2 text-sm font-medium text-bg transition hover:opacity-80 disabled:cursor-not-allowed disabled:opacity-60",children:s?"Inviting...":"Invite"})]}),jsx("div",{className:"divide-y divide-border",children:e.length===0?jsx("div",{className:"p-6 text-sm text-text-muted",children:"No members yet."}):e.map(v=>{let l=y===v.id;return jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 p-4",children:[jsxs("div",{className:"flex items-center gap-3",children:[jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-brand/20 text-sm font-bold text-brand",children:(v.name||v.email).charAt(0).toUpperCase()}),jsxs("div",{children:[jsx("p",{className:"text-sm font-medium text-text",children:v.name||v.email}),jsxs("div",{className:"flex items-center gap-2 text-xs text-text-muted",children:[jsx("span",{children:v.email}),jsx("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ${Ua(v.role)}`,children:v.role}),jsxs("span",{children:["Joined ",new Date(v.addedAt).toLocaleDateString("en-US")]})]})]})]}),x&&jsxs("div",{className:"flex items-center gap-2",children:[jsx("select",{value:v.role,onChange:f=>A(v.id,f.target.value),disabled:l,className:"rounded-md border border-border bg-bg-input px-2 py-1 text-xs text-text outline-none transition focus:border-brand disabled:cursor-not-allowed disabled:opacity-60",children:zt.map(f=>jsx("option",{value:f,children:f.charAt(0).toUpperCase()+f.slice(1)},f))}),jsx("button",{type:"button",disabled:l,onClick:()=>C(v.id),className:"rounded-md border border-rose-500/30 px-3 py-1.5 text-xs font-medium text-rose-500 transition hover:bg-rose-500/10 disabled:cursor-not-allowed disabled:opacity-60",children:l?"Removing...":"Remove"})]})]},v.id)})})]})})}d(xt,"AccountMembers");function za(e,t="usd"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}d(za,"fmt");function Oa(e){return e.toLocaleDateString("en-US",{month:"short",day:"numeric"})}d(Oa,"fmtDate");function Wa({subscription:e,currentPlan:t,mtdSpend:r,currency:a,paymentMethods:i,onNavigate:x}){let o=t?.name??"Pay-as-you-go",b=!!e.id&&e.status==="active",c=e.currentPeriodEnd?Oa(new Date(e.currentPeriodEnd)):null,n=i.find(w=>w.is_default||w.isDefault),s=i.length>0,m=e.status==="past_due",y,R;return s?b?(y="View costs",R="usage"):(y="Choose a plan",R="overview"):(y="Add payment method",R="invoices:payment-methods"),jsx("div",{className:"rounded-2xl border border-border bg-bg-card p-1",children:jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 divide-x divide-border",children:[jsxs("div",{className:"p-4",children:[jsx("p",{className:"text-[11px] uppercase tracking-wide text-text-dim mb-1",children:"Plan"}),jsx("p",{className:"text-sm font-semibold text-text",children:o}),c&&b&&jsxs("p",{className:"text-xs text-text-muted mt-0.5",children:[e.cancelAt?"Cancels":"Renews"," ",c]})]}),jsxs("div",{className:"p-4",children:[jsx("p",{className:"text-[11px] uppercase tracking-wide text-text-dim mb-1",children:"This Period"}),jsx("p",{className:"text-sm font-semibold text-text",children:za(r,a)}),jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"Month-to-date"})]}),jsxs("div",{className:"p-4",children:[jsx("p",{className:"text-[11px] uppercase tracking-wide text-text-dim mb-1",children:"Payment"}),m?jsx("p",{className:"text-sm font-semibold text-warning",children:"Past due"}):s?jsx("p",{className:"text-sm font-semibold text-text",children:n?.card?`${n.card.brand} \xB7\xB7\xB7\xB7${n.card.last4}`:"Active"}):jsx("p",{className:"text-sm font-semibold text-danger",children:"No payment method"}),s&&!m&&jsx("p",{className:"text-xs text-success mt-0.5",children:"Healthy"})]}),jsx("div",{className:"p-4 flex items-center justify-center",children:jsx("button",{type:"button",onClick:()=>x(R),className:"w-full rounded-lg bg-brand px-4 py-2 text-sm font-medium text-brand-foreground transition hover:bg-brand-hover",children:y})})]})})}d(Wa,"StatusBar");function Je(e,t="usd"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}d(Je,"fmt");function gt(e){return e>=1e9?`${(e/1e9).toFixed(1)}B`:e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(0)}K`:String(e)}d(gt,"fmtTokens");function Wt(e){let t=new Date(e).getTime()-Date.now();return Math.max(0,Math.ceil(t/(1e3*60*60*24)))}d(Wt,"daysUntil");function $e({children:e,delay:t=0,className:r=""}){let a=useRef(null);return useEffect(()=>{let i=a.current;if(!i)return;i.style.opacity="0",i.style.transform="translateY(10px)";let x=setTimeout(()=>{i.style.transition="opacity 0.4s ease, transform 0.4s ease",i.style.opacity="1",i.style.transform="translateY(0)";},t);return ()=>clearTimeout(x)},[t]),jsx("div",{ref:a,className:r,children:e})}d($e,"FadeIn");function ja({value:e,duration:t=1200}){let[r,a]=F.useState(0),i=useRef(0);return useEffect(()=>{let x=i.current,o=e;if(x===o)return;let b=Date.now(),c=d(()=>{let n=Date.now()-b,s=Math.min(n/t,1),m=1-Math.pow(1-s,3);a(Math.round(x+(o-x)*m)),s<1?requestAnimationFrame(c):i.current=o;},"tick");requestAnimationFrame(c);},[e,t]),jsx(Fragment,{children:gt(r)})}d(ja,"AnimatedNumber");var bt={developer:{label:"Developer",color:"text-white/50",glow:""},pro:{label:"Pro",color:"text-sky-400",glow:"shadow-[0_0_20px_rgba(56,189,248,0.15)]"},team:{label:"Team",color:"text-violet-400",glow:"shadow-[0_0_20px_rgba(167,139,250,0.15)]"},enterprise:{label:"Enterprise",color:"text-amber-400",glow:"shadow-[0_0_20px_rgba(251,191,36,0.15)]"},custom:{label:"Custom",color:"text-emerald-400",glow:"shadow-[0_0_20px_rgba(52,211,153,0.15)]"}};function qa(e){let t=e.plans.find(l=>l.id===e.subscription.planId),r=e.plans.find(l=>l.id==="pro")??e.plans[1],a=e.usage?.totalCost??0,i=e.usage?.currency??"usd",x=e.subscription.currentPeriodEnd,o=Wt(x),b=(e.balance?.available??0)/100,c=e.paymentMethods.find(l=>l.is_default||l.isDefault)??e.paymentMethods[0],n=!!e.subscription.id&&e.subscription.status==="active",s=e.subscription.status==="trialing",m=s?Wt(e.subscription.currentPeriodEnd):0,R=e.usage?.records.find(l=>l.meterId==="ai"||l.unit?.toLowerCase().includes("token"))?.current??0,A=e.usage?.records.find(l=>l.meterId==="api_calls")?.current??0,C=t?bt[t.id]??bt.developer:bt.developer,v=F.useMemo(()=>Array.from({length:28},(l,f)=>a>0?Math.max((f*137+17)%100,4):f%3===0?2:1),[a]);return jsxs("div",{className:"space-y-5",children:[s&&jsx($e,{delay:0,children:jsxs("div",{className:"rounded-2xl border border-sky-500/25 bg-sky-500/[0.05] p-5 flex items-center justify-between gap-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-sm font-semibold text-sky-400",children:["Free trial active ","\xB7"," ",m," day",m!==1?"s":""," left"]}),jsx("p",{className:"text-[13px] text-white/50 mt-1",children:"Add a payment method to continue after your trial ends."})]}),jsx("button",{type:"button",onClick:()=>e.onNavigate("payment"),className:"rounded-full bg-sky-500 px-5 py-2 text-sm font-semibold text-white transition hover:bg-sky-400 active:scale-[0.97] flex-shrink-0",children:"Add payment"})]})}),jsx($e,{delay:0,children:jsx("div",{className:`rounded-2xl border border-white/[0.08] bg-[#141419] overflow-hidden transition-all ${C.glow}`,children:jsxs("div",{className:"p-6",children:[jsxs("div",{className:"flex items-start justify-between mb-5",children:[jsxs("div",{children:[jsxs("div",{className:"flex items-center gap-2.5 mb-1",children:[jsxs("span",{className:`text-[11px] font-semibold uppercase tracking-widest ${C.color}`,children:[C.label," Plan"]}),n&&jsx("span",{className:"rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-semibold text-emerald-400",children:"Active"})]}),jsx("h2",{className:"text-2xl font-bold text-white",children:R>0?jsxs(Fragment,{children:[jsx(ja,{value:R})," tokens"]}):e.usageLoading?"Loading\u2026":"\u2014 tokens"}),jsx("p",{className:"text-[13px] text-white/40 mt-1",children:"processed this billing period"})]}),jsxs("div",{className:"text-right",children:[jsx("p",{className:"text-[11px] text-white/30 mb-1",children:"API spend"}),jsx("p",{className:"text-xl font-semibold text-white tabular-nums",children:Je(a,i)}),jsxs("p",{className:"text-[12px] text-white/30 mt-1",children:[o,"d until renewal"]})]})]}),jsx("div",{className:"h-10 flex items-end gap-[2px]",children:v.map((l,f)=>jsx("div",{className:`flex-1 rounded-sm transition-all duration-700 ${a>0?"bg-white/[0.12]":"bg-white/[0.04]"}`,style:{height:`${l}%`,transitionDelay:`${f*20}ms`}},f))}),jsxs("div",{className:"mt-5 grid grid-cols-3 gap-3",children:[jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-3",children:[jsx("p",{className:"text-[11px] text-white/30 mb-1",children:"Tokens / period"}),jsx("p",{className:"text-base font-semibold text-white tabular-nums",children:R>0?gt(R):"\u2014"})]}),jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-3",children:[jsx("p",{className:"text-[11px] text-white/30 mb-1",children:"API calls"}),jsx("p",{className:"text-base font-semibold text-white tabular-nums",children:A>0?gt(A):"\u2014"})]}),jsxs("div",{className:"rounded-xl border border-white/[0.06] bg-white/[0.02] p-3",children:[jsx("p",{className:"text-[11px] text-white/30 mb-1",children:"Credits left"}),jsx("p",{className:"text-base font-semibold text-white tabular-nums",children:Je(b)})]})]})]})})}),!n&&!s&&r&&jsx($e,{delay:60,children:jsxs("div",{className:"relative overflow-hidden rounded-2xl border border-white/[0.12] bg-gradient-to-br from-[#1a1a2e] to-[#141419] p-6",children:[jsx("div",{className:"pointer-events-none absolute -top-12 left-1/2 h-32 w-64 -translate-x-1/2 rounded-full bg-sky-500/10 blur-2xl"}),jsxs("div",{className:"relative",children:[jsxs("div",{className:"flex items-center gap-2 mb-2",children:[jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-sky-400",children:jsx("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"})}),jsx("span",{className:"text-sm font-semibold text-sky-400",children:"Unlock the full Hanzo AI suite"})]}),jsxs("p",{className:"text-[22px] font-bold text-white mb-1",children:["All AI models. One plan. ",jsx("span",{className:"text-sky-400",children:"$20/mo."})]}),jsxs("p",{className:"text-[13px] text-white/50 mb-5",children:["14+ Zen AI models ","\xB7"," 1M+ token context ","\xB7"," Unlimited chat ","\xB7"," MCP tools ","\xB7"," Priority inference",r.trialDays?` \xB7 ${r.trialDays}-day free trial`:""]}),jsxs("div",{className:"flex items-center gap-3",children:[jsx("button",{type:"button",onClick:()=>e.onUpgrade?.(r.id),className:"rounded-full bg-white px-6 py-2.5 text-sm font-bold text-black transition hover:bg-white/90 active:scale-[0.97]",children:r.trialDays?`Start ${r.trialDays}-day free trial`:"Upgrade to Unified AI"}),jsxs("button",{type:"button",onClick:()=>e.onNavigate("pricing"),className:"text-sm text-white/40 transition hover:text-white/70",children:["View all plans ","\u2192"]})]}),(r.annualPrice??0)>0&&jsxs("p",{className:"mt-3 text-[12px] text-emerald-400",children:["Or go annual for $",r.annualPrice,"/yr ","\u2014"," save $",r.price*12-r.annualPrice]})]})]})}),jsx($e,{delay:80,children:jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[jsxs("button",{type:"button",onClick:()=>e.onNavigate("credits"),className:"rounded-2xl border border-white/[0.08] bg-[#141419] p-5 text-left transition-all hover:border-white/[0.14] hover:bg-[#16161c] group active:scale-[0.99]",children:[jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsx("p",{className:"text-[11px] uppercase tracking-widest text-white/30",children:"Credit Balance"}),jsx("div",{className:"text-white/20 group-hover:text-white/40 transition-colors",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("circle",{cx:"8",cy:"8",r:"6"}),jsx("path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18"})]})})]}),jsx("p",{className:"text-2xl font-bold text-white tabular-nums",children:Je(b)}),jsxs("p",{className:"text-[13px] text-white/35 mt-1.5 group-hover:text-white/50 transition-colors",children:[e.creditGrants.filter(l=>l.active&&!l.voided).length," active grant",e.creditGrants.filter(l=>l.active&&!l.voided).length!==1?"s":""]})]}),jsxs("button",{type:"button",onClick:()=>e.onNavigate("pricing"),className:"rounded-2xl border border-white/[0.08] bg-[#141419] p-5 text-left transition-all hover:border-white/[0.14] hover:bg-[#16161c] group active:scale-[0.99]",children:[jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsx("p",{className:"text-[11px] uppercase tracking-widest text-white/30",children:"AI Plan"}),jsx("div",{className:"text-white/20 group-hover:text-white/40 transition-colors",children:jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"})})})]}),jsx("p",{className:`text-2xl font-bold ${C.color||"text-white"}`,children:t?.name??"Developer"}),jsx("p",{className:"text-[13px] text-white/35 mt-1.5 group-hover:text-white/50 transition-colors",children:s?`Trial \xB7 ${m}d left`:n?"Active":"Upgrade to unlock all \u2192"})]}),jsxs("button",{type:"button",onClick:()=>e.onNavigate("payment"),className:"rounded-2xl border border-white/[0.08] bg-[#141419] p-5 text-left transition-all hover:border-white/[0.14] hover:bg-[#16161c] group active:scale-[0.99]",children:[jsxs("div",{className:"flex items-center justify-between mb-3",children:[jsx("p",{className:"text-[11px] uppercase tracking-widest text-white/30",children:"Payment"}),jsx("div",{className:"text-white/20 group-hover:text-white/40 transition-colors",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("rect",{x:"2",y:"5",width:"20",height:"14",rx:"2"}),jsx("path",{d:"M2 10h20"})]})})]}),jsx("p",{className:"text-2xl font-bold text-white",children:c?.card?`\u2022\u2022\u2022\u2022 ${c.card.last4}`:c?c.type:"\u2014"}),jsx("p",{className:"text-[13px] text-white/35 mt-1.5 group-hover:text-white/50 transition-colors",children:c?.card?c.card.brand:c?"Active":"Add a payment method"})]})]})}),jsx($e,{delay:120,children:jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-[#141419] overflow-hidden",children:[jsx("div",{className:"px-6 py-4 border-b border-white/[0.06]",children:jsx("h3",{className:"text-[14px] font-semibold text-white",children:"Quick access"})}),jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-6 divide-x divide-y divide-white/[0.05]",children:[{label:"Usage",icon:jsx("path",{d:"M3 3v18h18"}),section:"usage"},{label:"Invoices",icon:jsxs(Fragment,{children:[jsx("path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"}),jsx("path",{d:"M8 7h8"}),jsx("path",{d:"M8 11h8"})]}),section:"invoices"},{label:"Plans",icon:jsx("path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"}),section:"pricing"},{label:"Credits",icon:jsxs(Fragment,{children:[jsx("circle",{cx:"8",cy:"8",r:"6"}),jsx("path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18"})]}),section:"credits"},{label:"Alerts",icon:jsxs(Fragment,{children:[jsx("path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9"}),jsx("path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0"})]}),section:"alerts"},{label:"Team",icon:jsxs(Fragment,{children:[jsx("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),jsx("circle",{cx:"9",cy:"7",r:"4"})]}),section:"team"}].map(l=>jsxs("button",{type:"button",onClick:()=>e.onNavigate(l.section),className:"flex flex-col items-center gap-2 px-4 py-5 text-left transition-colors hover:bg-white/[0.03] group",children:[jsx("div",{className:"text-white/25 group-hover:text-white/50 transition-colors",children:jsx("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:l.icon})}),jsx("p",{className:"text-[12px] font-medium text-white/35 group-hover:text-white/60 transition-colors",children:l.label})]},l.section))})]})}),e.invoices.length>0&&jsx($e,{delay:160,children:jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-[#141419] overflow-hidden",children:[jsxs("div",{className:"px-6 py-4 border-b border-white/[0.06] flex items-center justify-between",children:[jsx("h3",{className:"text-[14px] font-semibold text-white",children:"Recent invoices"}),jsxs("button",{type:"button",onClick:()=>e.onNavigate("invoices"),className:"text-[12px] text-white/35 hover:text-white/60 transition-colors",children:["View all ","\u2192"]})]}),jsx("div",{className:"divide-y divide-white/[0.04]",children:e.invoices.slice(0,3).map(l=>jsxs("div",{className:"flex items-center justify-between px-6 py-3.5 hover:bg-white/[0.02] transition-colors",children:[jsxs("div",{children:[jsxs("p",{className:"text-[13px] text-white/70",children:["#",l.invoiceNumber||l.number||l.id.slice(0,10)]}),jsx("p",{className:"text-[12px] text-white/30",children:new Date(l.date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})})]}),jsxs("div",{className:"text-right",children:[jsx("p",{className:"text-[13px] font-semibold text-white tabular-nums",children:Je(l.total,l.currency)}),jsx("span",{className:`text-[11px] font-medium ${l.status==="paid"?"text-emerald-400":l.status==="failed"?"text-red-400":"text-amber-400"}`,children:l.status.charAt(0).toUpperCase()+l.status.slice(1)})]})]},l.id))})]})})]})}d(qa,"OverviewDashboard");function at(e,t="usd"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}d(at,"fmt");var vt={ai:"LLM / Chat",api_calls:"API Requests",storage:"Storage",gpu:"GPU Compute",network:"Network",network_egress:"Egress"},Ha={ai:"bg-violet-500",api_calls:"bg-indigo-500",storage:"bg-blue-500",gpu:"bg-amber-500",network:"bg-emerald-500",network_egress:"bg-teal-500"};function Va({usage:e,usageLoading:t}){let[r,a]=useState("30d"),[i,x]=useState("all"),[o,b]=useState("cost"),[c,n]=useState(false),s=e?.records??[],m=e?.totalCost??0,y=e?.currency??"usd",R=useMemo(()=>{let l=new Set(s.map(f=>f.meterId));return Array.from(l)},[s]),w=useMemo(()=>{let l=i==="all"?s:s.filter(f=>f.meterId===i);return l=[...l].sort((f,p)=>{let D=0;return o==="cost"?D=f.cost-p.cost:o==="usage"?D=f.current-p.current:D=f.label.localeCompare(p.label),c?D:-D}),l},[s,i,o,c]),A=useMemo(()=>[...s].sort((l,f)=>f.cost-l.cost).slice(0,5),[s]),C=d(l=>{o===l?n(!c):(b(l),n(false));},"handleSort"),v=d(l=>o===l?c?" \u2191":" \u2193":"","sortIndicator");return t?jsx("div",{className:"flex items-center justify-center py-16",children:jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-text-dim border-t-brand"})}):jsxs("div",{className:"space-y-6",children:[jsxs("div",{className:"flex flex-wrap items-center gap-3 rounded-xl border border-border bg-bg-card p-4",children:[jsx("div",{className:"flex gap-1 rounded-lg bg-bg p-0.5",children:["7d","30d","90d"].map(l=>jsx("button",{type:"button",onClick:()=>a(l),className:`rounded-md px-3 py-1.5 text-xs font-medium transition ${r===l?"bg-bg-elevated text-text":"text-text-muted hover:text-text"}`,children:l},l))}),jsxs("select",{value:i,onChange:l=>x(l.target.value),className:"rounded-lg border border-border bg-bg-input px-3 py-1.5 text-xs text-text outline-none",children:[jsx("option",{value:"all",children:"All products"}),R.map(l=>jsx("option",{value:l,children:vt[l]??l},l))]}),jsx("select",{disabled:true,className:"rounded-lg border border-border bg-bg-input px-3 py-1.5 text-xs text-text-dim opacity-50 cursor-not-allowed",children:jsx("option",{children:"Model (coming soon)"})}),jsx("select",{disabled:true,className:"rounded-lg border border-border bg-bg-input px-3 py-1.5 text-xs text-text-dim opacity-50 cursor-not-allowed",children:jsx("option",{children:"Project (coming soon)"})})]}),jsxs("div",{className:"rounded-xl border border-border bg-bg-card p-6",children:[jsxs("div",{className:"flex items-end justify-between mb-4",children:[jsxs("div",{children:[jsxs("p",{className:"text-xs uppercase tracking-wide text-text-dim",children:["Total Cost (",r,")"]}),jsx("p",{className:"text-3xl font-bold text-text mt-1",children:at(m,y)})]}),e?.period&&jsxs("p",{className:"text-xs text-text-muted",children:[new Date(e.period.start).toLocaleDateString()," ","\u2014"," ",new Date(e.period.end).toLocaleDateString()]})]}),jsx("div",{className:"flex items-center justify-center h-32 rounded-lg bg-bg border border-dashed border-border",children:jsxs("p",{className:"text-xs text-text-dim",children:["Cost trend chart ","\u2014"," coming soon"]})})]}),A.length>0&&jsxs("div",{children:[jsx("h3",{className:"text-xs font-medium uppercase tracking-wide text-text-dim mb-3",children:"Top Drivers"}),jsx("div",{className:"space-y-2",children:A.map(l=>{let f=m>0?l.cost/m*100:0,p=Ha[l.meterId]??"bg-gray-500";return jsxs("div",{className:"flex items-center gap-3",children:[jsx("span",{className:"w-24 shrink-0 text-xs text-text-muted truncate",children:vt[l.meterId]??l.label}),jsx("div",{className:"flex-1 h-4 rounded bg-bg-elevated overflow-hidden",children:jsx("div",{className:`h-full rounded ${p} transition-all`,style:{width:`${f}%`}})}),jsx("span",{className:"w-20 shrink-0 text-right text-xs font-medium text-text",children:at(l.cost)}),jsxs("span",{className:"w-12 shrink-0 text-right text-[11px] text-text-muted",children:[f.toFixed(1),"%"]})]},l.meterId)})})]}),jsx("div",{className:"rounded-xl border border-border overflow-hidden",children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:"bg-bg-elevated text-xs uppercase tracking-wide text-text-muted",children:[jsxs("th",{className:"px-4 py-3 text-left cursor-pointer select-none",onClick:()=>C("label"),children:["Product",v("label")]}),jsx("th",{className:"px-4 py-3 text-left",children:"Meter"}),jsxs("th",{className:"px-4 py-3 text-right cursor-pointer select-none",onClick:()=>C("usage"),children:["Usage",v("usage")]}),jsxs("th",{className:"px-4 py-3 text-right cursor-pointer select-none",onClick:()=>C("cost"),children:["Cost",v("cost")]}),jsx("th",{className:"px-4 py-3 text-right",children:"% of Total"})]})}),jsx("tbody",{className:"divide-y divide-border",children:w.length===0?jsx("tr",{children:jsx("td",{colSpan:5,className:"px-4 py-8 text-center text-text-muted text-sm",children:"No usage data for this period."})}):w.map(l=>{let f=m>0?l.cost/m*100:0;return jsxs("tr",{className:"hover:bg-bg-card transition-colors",children:[jsx("td",{className:"px-4 py-3 text-text font-medium",children:vt[l.meterId]??l.label}),jsx("td",{className:"px-4 py-3 text-text-muted",children:l.meterId}),jsxs("td",{className:"px-4 py-3 text-right text-text",children:[l.current.toLocaleString()," ",l.unit,l.limit?jsxs("span",{className:"text-text-dim",children:[" / ",l.limit.toLocaleString()]}):null]}),jsx("td",{className:"px-4 py-3 text-right text-text font-medium",children:at(l.cost)}),jsxs("td",{className:"px-4 py-3 text-right text-text-muted",children:[f.toFixed(1),"%"]})]},l.meterId)})}),w.length>0&&jsx("tfoot",{children:jsxs("tr",{className:"bg-bg-elevated font-medium",children:[jsx("td",{colSpan:3,className:"px-4 py-3 text-xs uppercase tracking-wide text-text-muted",children:"Total"}),jsx("td",{className:"px-4 py-3 text-right text-text",children:at(m,y)}),jsx("td",{className:"px-4 py-3 text-right text-text-muted",children:"100%"})]})})]})})]})}d(Va,"CostExplorer");function Qa(e,t="usd"){return new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e)}d(Qa,"fmt");function Xa(e){return new Date(e).toLocaleDateString("en-US",{day:"numeric",month:"short",year:"numeric"})}d(Xa,"fmtDate");var qe=20;function Za({children:e,delay:t=0}){let r=useRef(null);return useEffect(()=>{let a=r.current;if(!a)return;a.style.opacity="0",a.style.transform="translateY(8px)";let i=setTimeout(()=>{a.style.transition="opacity 0.4s ease, transform 0.4s ease",a.style.opacity="1",a.style.transform="translateY(0)";},t);return ()=>clearTimeout(i)},[t]),jsx("div",{ref:r,children:e})}d(Za,"FadeIn");function Ja(e){let[t,r]=useState(0),{invoices:a}=e,i=Math.ceil(a.length/qe),x=a.slice(t*qe,(t+1)*qe);return jsx(Za,{delay:0,children:jsxs("div",{className:"rounded-2xl border border-white/[0.08] bg-[#141419] overflow-hidden",children:[jsx("div",{className:"px-6 py-5",children:jsx("h3",{className:"text-[15px] font-semibold text-white",children:"All invoices"})}),jsx("div",{className:"border-t border-white/[0.06]",children:a.length===0?jsxs("div",{className:"py-20 flex flex-col items-center justify-center gap-3",children:[jsx("div",{className:"flex h-14 w-14 items-center justify-center rounded-2xl border border-white/[0.08] bg-white/[0.03] text-white/20",children:jsxs("svg",{width:"28",height:"28",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[jsx("path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z"}),jsx("path",{d:"M8 7h8"}),jsx("path",{d:"M8 11h8"}),jsx("path",{d:"M8 15h4"})]})}),jsxs("div",{className:"text-center",children:[jsx("p",{className:"text-sm font-medium text-white/40",children:"No invoices yet"}),jsx("p",{className:"mt-1 text-[13px] text-white/25",children:"Invoices appear here once you subscribe or make a purchase."})]})]}):jsxs(Fragment,{children:[jsx("div",{className:"overflow-x-auto",children:jsxs("table",{className:"w-full text-sm",children:[jsx("thead",{children:jsxs("tr",{className:"border-b border-white/[0.06] text-left",children:[jsx("th",{className:"px-6 py-3 text-[13px] font-medium text-white/40",children:"Invoice #"}),jsx("th",{className:"px-6 py-3 text-[13px] font-medium text-white/40",children:"Date"}),jsx("th",{className:"px-6 py-3 text-[13px] font-medium text-white/40",children:"Type"}),jsx("th",{className:"px-6 py-3 text-[13px] font-medium text-white/40 text-right",children:"Amount"}),jsx("th",{className:"px-6 py-3 text-[13px] font-medium text-white/40 text-right",children:"Status"})]})}),jsx("tbody",{children:x.map((o,b)=>jsxs("tr",{className:"group border-b border-white/[0.04] last:border-0 hover:bg-white/[0.02] transition-colors cursor-pointer",onClick:()=>e.onDownloadInvoice?.(o),children:[jsxs("td",{className:"px-6 py-4 text-[13px] text-white font-medium",children:["#",o.invoiceNumber||o.number||o.id.slice(0,15)]}),jsx("td",{className:"px-6 py-4 text-[13px] text-white/50",children:Xa(o.date)}),jsx("td",{className:"px-6 py-4 text-[13px] text-white/50",children:o.items?.length===1?"Single Purchase":"Monthly Invoice"}),jsx("td",{className:"px-6 py-4 text-[13px] text-white font-semibold text-right tabular-nums",children:Qa(o.total,o.currency)}),jsx("td",{className:"px-6 py-4 text-right",children:jsx(er,{status:o.status})})]},o.id))})]})}),i>1&&jsxs("div",{className:"border-t border-white/[0.06] px-6 py-3 flex items-center justify-between bg-white/[0.02]",children:[jsxs("p",{className:"text-[13px] text-white/30",children:["Showing ",t*qe+1,"\u2013",Math.min((t+1)*qe,a.length)," of ",a.length]}),jsxs("div",{className:"flex gap-1.5",children:[jsx("button",{type:"button",disabled:t===0,onClick:()=>r(o=>o-1),className:"rounded-full border border-white/[0.1] px-3.5 py-1.5 text-[13px] font-medium text-white/70 transition-all hover:bg-white/[0.05] hover:border-white/[0.2] disabled:opacity-30 disabled:cursor-not-allowed active:scale-[0.97]",children:"Previous"}),jsx("button",{type:"button",disabled:t>=i-1,onClick:()=>r(o=>o+1),className:"rounded-full border border-white/[0.1] px-3.5 py-1.5 text-[13px] font-medium text-white/70 transition-all hover:bg-white/[0.05] hover:border-white/[0.2] disabled:opacity-30 disabled:cursor-not-allowed active:scale-[0.97]",children:"Next"})]})]})]})})]})})}d(Ja,"InvoicesPayments");function er({status:e}){return jsx("span",{className:`inline-flex items-center rounded-full px-3 py-1 text-[12px] font-medium transition-colors ${e==="paid"||e==="active"?"bg-white/[0.08] text-white/80":e==="failed"||e==="uncollectible"?"bg-red-500/15 text-red-400":"bg-amber-500/15 text-amber-400"}`,children:e.charAt(0).toUpperCase()+e.slice(1)})}d(er,"StatusBadge");var rr=[{id:"alerts",label:"Spend Alerts"},{id:"team",label:"Team"},{id:"business",label:"Business Info"},{id:"tax",label:"Tax & Compliance"},{id:"support",label:"Support"},{id:"promotions",label:"Promotions"}];function sr(e){let[t,r]=useState(e.defaultSubTab??"alerts");return jsxs("div",{children:[jsx("div",{className:"mb-6 flex flex-wrap gap-1 rounded-xl bg-bg-card p-1 border border-border",children:rr.map(a=>jsx("button",{type:"button",onClick:()=>r(a.id),className:`rounded-lg px-3 py-2 text-sm font-medium transition ${t===a.id?"bg-bg-elevated text-text":"text-text-muted hover:text-text-secondary"}`,children:a.label},a.id))}),t==="alerts"&&jsx(mt,{alerts:e.spendAlerts,onCreateAlert:e.onCreateSpendAlert,onUpdateAlert:e.onUpdateSpendAlert,onDeleteAlert:e.onDeleteSpendAlert}),t==="team"&&jsx(xt,{members:e.accountMembers,userRole:e.userRole,onInvite:e.onInviteMember,onChangeRole:e.onChangeMemberRole,onRemove:e.onRemoveMember}),t==="business"&&jsx(ze,{profile:e.businessProfile,onSave:e.onSaveBusinessProfile}),t==="tax"&&jsx(Oe,{taxSettings:e.taxSettings,complianceItems:e.complianceItems,onToggleAutomaticTax:e.onToggleAutomaticTax}),t==="support"&&jsx(pt,{currentTier:e.currentSupportTier,onSubscribe:e.onSubscribeSupport}),t==="promotions"&&jsx(ut,{discount:e.discount??null,onApplyDiscount:e.onApplyDiscount})]})}d(sr,"BillingSettings");function nr(e){let t=[{label:"Add a payment method",description:"Required to activate your account and start using Hanzo services.",done:e.hasPaymentMethod,required:true,action:e.onAddPaymentMethod,actionLabel:"Add payment method"},{label:"Pick a billing mode",description:"Choose a monthly plan for predictable costs, or pay-as-you-go for flexible usage.",done:e.hasSubscription,required:true,action:e.onPickPlan,actionLabel:"Choose plan"},{label:"Set a spend limit",description:"Prevent surprise bills by setting a monthly budget with automatic alerts.",done:e.hasSpendAlert,required:false,action:e.onSetSpendLimit,actionLabel:"Set limit"},{label:"Buy credits",description:"Pre-pay for usage at a discount. Credits are applied before card charges.",done:e.hasCredits,required:false,action:e.onBuyCredits,actionLabel:"Buy credits"}],r=t.filter(a=>a.done).length;return jsx("div",{className:"mx-auto max-w-lg py-8",children:jsxs("div",{className:"rounded-2xl border border-border bg-bg-card p-8",children:[jsx("h2",{className:"text-lg font-semibold text-text mb-1",children:"Get billing ready"}),jsxs("p",{className:"text-sm text-text-muted mb-6",children:["Complete these steps to activate your account. ",r," of ",t.length," done."]}),jsx("div",{className:"h-1.5 rounded-full bg-bg-elevated mb-8 overflow-hidden",children:jsx("div",{className:"h-full rounded-full bg-success transition-all duration-500",style:{width:`${r/t.length*100}%`}})}),jsx("div",{className:"space-y-4",children:t.map((a,i)=>jsxs("div",{className:`flex items-start gap-4 rounded-xl border p-4 transition ${a.done?"border-success/20 bg-success/5":"border-border bg-bg"}`,children:[jsx("div",{className:`mt-0.5 flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${a.done?"bg-success text-white":"bg-bg-elevated text-text-muted border border-border"}`,children:a.done?jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:jsx("polyline",{points:"20 6 9 17 4 12"})}):i+1}),jsxs("div",{className:"flex-1 min-w-0",children:[jsxs("div",{className:"flex items-center gap-2 mb-0.5",children:[jsx("p",{className:`text-sm font-medium ${a.done?"text-success":"text-text"}`,children:a.label}),!a.required&&!a.done&&jsx("span",{className:"text-[10px] uppercase tracking-wider text-text-dim",children:"Optional"})]}),jsx("p",{className:"text-xs text-text-muted",children:a.description})]}),!a.done&&jsx("button",{type:"button",onClick:a.action,className:"shrink-0 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-text transition hover:bg-bg-elevated",children:a.actionLabel})]},a.label))}),jsx("div",{className:"mt-6 text-center",children:jsx("button",{type:"button",onClick:e.onDismiss,className:"text-sm text-text-muted transition hover:text-text",children:"Skip setup"})})]})})}d(nr,"GuidedSetup");function ir(e){return e.replace(/\D/g,"").slice(0,16).replace(/(.{4})/g,"$1 ").trim()}d(ir,"formatCardNumber");function lr(e){let t=e.replace(/\D/g,"").slice(0,4);return t.length>=3?t.slice(0,2)+"/"+t.slice(2):t}d(lr,"formatExpiry");function dr(e){return e.startsWith("4")?"visa":/^5[1-5]/.test(e)||/^2[2-7]/.test(e)?"mastercard":/^3[47]/.test(e)?"amex":/^6(?:011|5)/.test(e)?"discover":""}d(dr,"detectBrand");var cr={width:"100%",background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.10)",borderRadius:"8px",padding:"10px 12px",color:"#fafafa",fontSize:"14px",fontFamily:"ui-sans-serif, system-ui, sans-serif",outline:"none",transition:"border-color 0.2s",boxSizing:"border-box"},mr={borderColor:"rgba(255,255,255,0.35)"},Ve={display:"block",fontSize:"12px",fontWeight:500,color:"rgba(255,255,255,0.5)",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},ur=process.env.NEXT_PUBLIC_COMMERCE_API??"https://api.hanzo.ai/api/v1";function pr({onSuccess:e,apiBaseUrl:t,authToken:r,disabled:a}){let[i,x]=F.useState(""),[o,b]=F.useState(""),[c,n]=F.useState(""),[s,m]=F.useState(""),[y,R]=F.useState(""),[w,A]=F.useState(null),[C,v]=F.useState(false),[l,f]=F.useState(null),p=i.replace(/\D/g,""),D=dr(p),$=D==="amex"?4:3,_=F.useCallback(async T=>{if(T.preventDefault(),A(null),p.length<13){A("Invalid card number");return}if(!c.includes("/")){A("Invalid expiry (MM/YY)");return}let[j,ye]=c.split("/");if(!j||!ye||j.length!==2||ye.length!==2){A("Invalid expiry");return}if(s.length<3){A("Invalid CVC");return}if(!o.trim()){A("Cardholder name is required");return}v(true);try{let Ce=t??ur,Me={"Content-Type":"application/json"};r&&(Me.Authorization=`Bearer ${r}`);let u=await fetch(`${Ce}/billing/card/tokenize`,{method:"POST",headers:Me,body:JSON.stringify({number:p,expiry_month:j,expiry_year:`20${ye}`,cvc:s,name:o.trim(),zip:y.trim()})});if(!u.ok){let Le=await u.json().catch(()=>({}));throw new Error(Le.error??`Tokenization failed (${u.status})`)}let X=await u.json();await e(X);}catch(Ce){A(Ce instanceof Error?Ce.message:"Card processing error");}finally{v(false);}},[p,c,s,o,y,t,r,e]),h=d(T=>({...cr,...l===T?mr:{}}),"fieldStyle"),N=!a&&!C&&p.length>=13&&!!c&&!!s&&!!o.trim();return jsxs("form",{onSubmit:_,style:{display:"flex",flexDirection:"column",gap:"12px"},children:[jsxs("div",{children:[jsx("label",{style:Ve,children:"Card number"}),jsxs("div",{style:{position:"relative"},children:[jsx("input",{type:"text",inputMode:"numeric",autoComplete:"cc-number",placeholder:"1234 5678 9012 3456",value:i,onChange:T=>x(ir(T.target.value)),onFocus:()=>f("number"),onBlur:()=>f(null),style:{...h("number"),paddingRight:D?"44px":"12px"},disabled:a||C,maxLength:19}),D&&jsx("span",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",fontSize:"11px",fontWeight:600,color:"rgba(255,255,255,0.5)",textTransform:"uppercase"},children:D})]})]}),jsxs("div",{children:[jsx("label",{style:Ve,children:"Cardholder name"}),jsx("input",{type:"text",autoComplete:"cc-name",placeholder:"Jane Smith",value:o,onChange:T=>b(T.target.value),onFocus:()=>f("name"),onBlur:()=>f(null),style:h("name"),disabled:a||C})]}),jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[jsxs("div",{children:[jsx("label",{style:Ve,children:"Expiry"}),jsx("input",{type:"text",inputMode:"numeric",autoComplete:"cc-exp",placeholder:"MM/YY",value:c,onChange:T=>n(lr(T.target.value)),onFocus:()=>f("expiry"),onBlur:()=>f(null),style:h("expiry"),disabled:a||C,maxLength:5})]}),jsxs("div",{children:[jsx("label",{style:Ve,children:D==="amex"?"CID (4 digits)":"CVC"}),jsx("input",{type:"password",inputMode:"numeric",autoComplete:"cc-csc",placeholder:D==="amex"?"1234":"123",value:s,onChange:T=>m(T.target.value.replace(/\D/g,"").slice(0,$)),onFocus:()=>f("cvc"),onBlur:()=>f(null),style:h("cvc"),disabled:a||C,maxLength:$})]})]}),jsxs("div",{children:[jsxs("label",{style:Ve,children:["ZIP / Postal code"," ",jsx("span",{style:{color:"rgba(255,255,255,0.25)"},children:"(optional)"})]}),jsx("input",{type:"text",autoComplete:"postal-code",placeholder:"10001",value:y,onChange:T=>R(T.target.value.slice(0,10)),onFocus:()=>f("zip"),onBlur:()=>f(null),style:h("zip"),disabled:a||C})]}),w&&jsx("p",{style:{margin:0,fontSize:"13px",color:"#f87171"},children:w}),jsx("button",{type:"submit",disabled:!N,style:{width:"100%",borderRadius:"8px",border:"none",backgroundColor:N?"rgb(250,250,250)":"rgba(250,250,250,0.3)",color:N?"rgb(9,9,11)":"rgba(9,9,11,0.5)",padding:"10px 16px",fontSize:"14px",fontWeight:500,cursor:N?"pointer":"not-allowed",transition:"opacity 0.15s"},children:C?"Processing...":"Save card"}),jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",color:"rgba(255,255,255,0.3)"},children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Encrypted \xB7 PCI-compliant \xB7 Powered by Hanzo Commerce"]})]})}d(pr,"CardForm");var Ht=process.env.NEXT_PUBLIC_SQUARE_APPLICATION_ID??"",Vt=process.env.NEXT_PUBLIC_SQUARE_LOCATION_ID??"",xr=process.env.NEXT_PUBLIC_SQUARE_ENVIRONMENT??"sandbox",Yt=xr==="production"?"https://web.squarecdn.com/v1/square.js":"https://sandbox.web.squarecdn.com/v1/square.js",Ye=null;function br(){return Ye||(typeof window<"u"&&window.Square?Ye=Promise.resolve():(Ye=new Promise((e,t)=>{let r=document.querySelector(`script[src="${Yt}"]`);if(r){r.addEventListener("load",()=>e());return}let a=document.createElement("script");a.src=Yt,a.async=true,a.onload=()=>e(),a.onerror=()=>t(new Error("Failed to load Square Web Payments SDK")),document.head.appendChild(a);}),Ye))}d(br,"loadSquareScript");var gr={".input-wrapper":{backgroundColor:"transparent"},input:{backgroundColor:"transparent",color:"#fafafa",fontFamily:"ui-sans-serif, system-ui, sans-serif",fontSize:"14px"},"input::placeholder":{color:"#52525b"},".message-text":{color:"#f87171"},".message-icon":{color:"#f87171"}},yt="sq-card-container";function fr({onToken:e,onCvvFocus:t,disabled:r}){let a=F.useRef(null),[i,x]=F.useState(true),[o,b]=F.useState(false),[c,n]=F.useState(null),[s,m]=F.useState(false),y=F.useRef(true);F.useEffect(()=>{y.current=true;let w=null;async function A(){try{if(await br(),!y.current)return;if(!window.Square)throw new Error("Square SDK not available");if(!Ht)throw new Error("NEXT_PUBLIC_SQUARE_APPLICATION_ID is not set");if(!Vt)throw new Error("NEXT_PUBLIC_SQUARE_LOCATION_ID is not set");w=await(await window.Square.payments(Ht,Vt)).card({style:gr}),await w.attach(`#${yt}`),y.current?(a.current=w,m(!0)):await w.destroy();}catch(C){y.current&&n(C instanceof Error?C.message:"Failed to initialize payment form");}finally{y.current&&x(false);}}return d(A,"init"),A(),()=>{y.current=false,a.current?.destroy().catch(()=>{}),a.current=null;}},[]);let R=F.useCallback(async()=>{if(!(!a.current||!s||o||r)){b(true),n(null);try{let w=await a.current.tokenize();if(w.status==="OK"&&w.token)await e(w.token);else {let A=w.errors?.map(C=>C.message).join("; ")??"Tokenization failed";n(A);}}catch(w){n(w instanceof Error?w.message:"Payment processing error");}finally{y.current&&b(false);}}},[e,s,o,r]);return F.useEffect(()=>{if(!t)return;let w=document.getElementById(yt);if(!w)return;let A=null;function C(){w.querySelectorAll("iframe").forEach(f=>{let p=f.getAttribute("name")??f.id??"";if((p.toLowerCase().includes("cvv")||p.toLowerCase().includes("cvc"))&&A!==f){A=f;try{f.contentWindow?.document.body?.addEventListener("focus",()=>t(!0),!0),f.contentWindow?.document.body?.addEventListener("blur",()=>t(!1),!0);}catch{}}});}d(C,"findAndAttach");let v=new MutationObserver(C);return v.observe(w,{childList:true,subtree:true}),C(),()=>v.disconnect()},[t,s]),jsxs("div",{className:"space-y-3",children:[jsx("div",{id:yt,style:{minHeight:i?"120px":void 0,borderRadius:"8px",border:"1px solid rgba(255,255,255,0.1)",backgroundColor:"rgba(255,255,255,0.04)",padding:"12px",transition:"border-color 0.2s"},children:i&&jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"96px"},children:[jsx("div",{style:{width:"20px",height:"20px",border:"2px solid rgba(255,255,255,0.15)",borderTopColor:"rgba(255,255,255,0.7)",borderRadius:"50%",animation:"spin 0.8s linear infinite"}}),jsx("style",{children:"@keyframes spin { to { transform: rotate(360deg); } }"})]})}),c&&jsx("p",{className:"text-sm",style:{color:"#f87171"},children:c}),jsx("button",{type:"button",disabled:!s||o||!!r,onClick:R,style:{width:"100%",borderRadius:"8px",backgroundColor:s&&!o&&!r?"rgb(250,250,250)":"rgba(250,250,250,0.3)",color:s&&!o&&!r?"rgb(9,9,11)":"rgba(9,9,11,0.5)",padding:"10px 16px",fontSize:"14px",fontWeight:"500",cursor:s&&!o&&!r?"pointer":"not-allowed",border:"none",transition:"opacity 0.15s"},children:o?"Processing\u2026":"Add card"}),jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"11px",color:"rgba(255,255,255,0.35)"},children:[jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[jsx("rect",{x:"3",y:"11",width:"18",height:"11",rx:"2"}),jsx("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]}),"Secured by Square ","\u2014"," PCI DSS compliant tokenization"]})]})}d(fr,"SquareCardForm");
|
|
3
|
+
export{xt as AccountMembers,_a as AccountSwitcher,nt as AnimatedCard,sr as BillingSettings,Pa as BillingWorkspace,ze as BusinessProfilePanel,pr as CardForm,Va as CostExplorer,Ta as CreditsPanel,nr as GuidedSetup,dt as InvoiceManager,Ja as InvoicesPayments,qa as OverviewDashboard,lt as PaymentMethodManager,ut as PromotionsPanel,mt as SpendAlertsPanel,fr as SquareCardForm,Wa as StatusBar,ot as SubscriptionPortal,pt as SupportTiersPanel,Oe as TaxCompliancePanel,$a as TransactionsPanel,Ma as UsagePanel};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
'use strict';var react=require('react'),jsxRuntime=require('react/jsx-runtime');var he=Object.defineProperty;var s=(t,e)=>he(t,"name",{value:e,configurable:true});function ge({x:t,y:e,onClose:n}){let r=react.useRef(null);react.useEffect(()=>{let i=s(d=>{r.current&&!r.current.contains(d.target)&&n();},"handler"),h=s(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",i),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",h);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],o='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxRuntime.jsxs("div",{ref:r,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:e,left:t},children:[jsxRuntime.jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsxRuntime.jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(i=>i.action==="copy-svg"?jsxRuntime.jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(o).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsxRuntime.jsx("a",{href:i.href,role:"menuitem",target:i.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:i.label},i.label))]})}s(ge,"BrandContextMenu");function G({size:t=22,className:e="",brandMenu:n=true,animate:r=true}){let[l,o]=react.useState(null),[i,h]=react.useState(false),d=react.useCallback(p=>{n&&(p.preventDefault(),o({x:p.clientX,y:p.clientY}));},[n]);return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("svg",{width:t,height:t,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:e,style:r?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:i?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),onContextMenu:d,children:[jsxRuntime.jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsxRuntime.jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsxRuntime.jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsxRuntime.jsx(ge,{x:l.x,y:l.y,onClose:()=>o(null)})]})}s(G,"HanzoMark");var U=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://hanzo.chat",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"},{id:"storage",label:"Storage",href:"https://hanzo.space",description:"S3 object storage"}],S={hanzo:{id:"hanzo",iam:"https://hanzo.id",billing:"https://billing.hanzo.ai",console:"https://console.hanzo.ai",chat:"https://hanzo.chat",platform:"https://platform.hanzo.ai",storage:"https://hanzo.space",s3:"https://s3.hanzo.ai"},lux:{id:"lux",iam:"https://lux.id",billing:"https://billing.lux.network",console:"https://console.lux.network",chat:"https://chat.lux.network",platform:"https://platform.lux.network",storage:"https://storage.lux.network",s3:"https://s3.lux.network"},zoo:{id:"zoo",iam:"https://zoo.id",billing:"https://billing.zoo.ngo",console:"https://console.zoo.ngo",chat:"https://chat.zoo.ngo",platform:"https://platform.zoo.ngo",storage:"https://storage.zoo.ngo",s3:"https://s3.zoo.ngo"},pars:{id:"pars",iam:"https://pars.id",billing:"https://billing.pars.ai",console:"https://console.pars.ai",chat:"https://chat.pars.ai",platform:"https://platform.pars.ai",storage:"https://storage.pars.ai",s3:"https://s3.pars.ai"}};function K(t){let e=S[t]||S.hanzo;return [{id:"account",label:"Account",href:`${e.iam}/account`,description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:e.billing,description:"Subscriptions & usage"},{id:"console",label:"Console",href:e.console,description:"API keys & projects"},{id:"chat",label:"Chat",href:e.chat,description:"AI chat & models"},{id:"platform",label:"Platform",href:e.platform,description:"Deploy & scale services"},{id:"storage",label:"Storage",href:e.storage,description:"S3 object storage"}]}s(K,"getAppsForOrg");function W({apps:t=U,currentAppId:e}){let[n,r]=react.useState(false),l=react.useRef(null);return react.useEffect(()=>{let o=s(i=>{l.current&&!l.current.contains(i.target)&&r(false);},"handler");return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),jsxRuntime.jsxs("div",{ref:l,className:"relative",children:[jsxRuntime.jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsxRuntime.jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsxRuntime.jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxRuntime.jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),t.filter(o=>o.id!==e).map(o=>jsxRuntime.jsxs("a",{href:o.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>r(false),children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium text-white/80",children:o.label}),o.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/30",children:o.description})]},o.id))]})]})}s(W,"AppSwitcher");var ye=["#0A0310","#49007E","#FF005B","#FF7D10","#FFB238"];function ke(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return Math.abs(e)}s(ke,"hashStr");function M(t,e,n){return t%(e*(n+1))%e}s(M,"getUnit");function ze(t,e){return M(t,2,e)===0}s(ze,"getBoolean");function ie(t,e,n){return n[M(t,n.length,e)]}s(ie,"getRandomColor");function Ne(t){let e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e*.299+n*.587+r*.114>128?"#000":"#fff"}s(Ne,"getContrast");function q({name:t,size:e=40,colors:n=ye,className:r,square:l=false}){let o=ke(t),i=ie(o,0,n),h=Ne(i),d=ze(o,2),f=M(o,3,7),p=M(o,5,8),c=M(o,10,9),u=c>6?c-10:c,g=M(o,5,10)>3?M(o,5,10)-5:M(o,5,10);return jsxRuntime.jsxs("svg",{viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:e,height:e,className:r,style:l?void 0:{borderRadius:"50%"},children:[jsxRuntime.jsx("mask",{id:`beam-${o}`,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36,children:jsxRuntime.jsx("rect",{width:36,height:36,rx:l?void 0:72,fill:"#fff"})}),jsxRuntime.jsxs("g",{mask:`url(#beam-${o})`,children:[jsxRuntime.jsx("rect",{width:36,height:36,fill:i}),jsxRuntime.jsx("rect",{x:0,y:0,width:36,height:36,transform:`translate(${u} ${g}) rotate(${c} 18 18)`,fill:ie(o,1,n),rx:6}),jsxRuntime.jsxs("g",{transform:`translate(${u} ${g}) rotate(${c} 18 18)`,children:[d?jsxRuntime.jsx("path",{d:`M15 ${19+f}c2 1 4 1 6 0`,stroke:h,fill:"none",strokeLinecap:"round"}):jsxRuntime.jsx("path",{d:`M13 ${19+f}a1 .75 0 0 0 10 0`,fill:h}),jsxRuntime.jsx("rect",{x:14-p,y:14,width:1.5,height:2,rx:1,fill:h}),jsxRuntime.jsx("rect",{x:20+p,y:14,width:1.5,height:2,rx:1,fill:h})]})]})]})}s(q,"BeamAvatar");async function Ae(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(l=>l.toString(16).padStart(2,"0")).join("")}s(Ae,"sha256");function Se(t,e){let[n,r]=react.useState(null);return react.useMemo(()=>{if(!t){r(null);return}let l=t.trim().toLowerCase();Ae(l).then(o=>{r(`https://www.gravatar.com/avatar/${o}?s=${e||80}&d=404`);});},[t,e]),n}s(Se,"useGravatarUrl");function Q({src:t,email:e,name:n,size:r=40,colors:l,className:o}){let[i,h]=react.useState(false),[d,f]=react.useState(false),p=Se(e,r*2),c=`rounded-full object-cover ${o||""}`,u={width:r,height:r};return t&&!i?jsxRuntime.jsx("img",{src:t,alt:n||e||"avatar",className:c,style:u,onError:()=>h(true)}):p&&!d?jsxRuntime.jsx("img",{src:p,alt:n||e||"avatar",className:c,style:u,onError:()=>f(true)}):jsxRuntime.jsx(q,{name:n||e||"user",size:r,colors:l,className:o})}s(Q,"UserAvatar");function ee({user:t,organizations:e=[],currentOrgId:n,onOrgSwitch:r,onSignOut:l}){let[o,i]=react.useState(false),h=react.useRef(null);if(react.useEffect(()=>{let c=s(u=>{h.current&&!h.current.contains(u.target)&&i(false);},"handler");return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),!t)return null;let d=e.find(c=>c.id===n),f=d?.slug||"hanzo",p=S[f]||S.hanzo;return jsxRuntime.jsxs("div",{ref:h,className:"relative",children:[jsxRuntime.jsxs("button",{type:"button",onClick:()=>i(c=>!c),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsx(Q,{src:t.avatar,email:t.email,name:t.name,size:28}),jsxRuntime.jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[t.name&&jsxRuntime.jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:t.name}),jsxRuntime.jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:t.email})]}),jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsxRuntime.jsx("path",{d:"M6 9l6 6 6-6"})})]}),o&&jsxRuntime.jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsxRuntime.jsx("p",{className:"text-[13px] font-medium text-white/80",children:t.name||"User"}),jsxRuntime.jsx("p",{className:"text-[11px] text-white/40",children:t.email}),d&&jsxRuntime.jsx("p",{className:"mt-0.5 text-[10px] font-medium text-white/25 uppercase tracking-wider",children:d.name})]}),e.length>0&&jsxRuntime.jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsxRuntime.jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),e.map(c=>jsxRuntime.jsxs("button",{type:"button",onClick:()=>{r?.(c.id),i(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"text-[13px] text-white/70",children:c.name}),c.role&&jsxRuntime.jsx("span",{className:"text-[10px] text-white/25 capitalize",children:c.role})]}),c.id===n&&jsxRuntime.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsxRuntime.jsx("polyline",{points:"20 6 9 17 4 12"})})]},c.id))]}),jsxRuntime.jsxs("div",{className:"p-2",children:[jsxRuntime.jsx("a",{href:`${p.iam}/account`,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Account settings"}),jsxRuntime.jsx("a",{href:p.billing,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Billing"}),jsxRuntime.jsx("button",{type:"button",onClick:()=>{i(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}s(ee,"UserOrgDropdown");function Pe({className:t}){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsxRuntime.jsx("path",{d:"M21 2v6h-6"}),jsxRuntime.jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),jsxRuntime.jsx("path",{d:"M3 22v-6h6"}),jsxRuntime.jsx("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"})]})}s(Pe,"HardRefreshIcon");function Le({className:t}){return jsxRuntime.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsxRuntime.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),jsxRuntime.jsx("circle",{cx:"12",cy:"12",r:"3"})]})}s(Le,"SettingsIcon");async function Ee(){try{if(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(t=>{let e=t.split("=")[0].trim();if(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;let n=location.hostname.split(".");if(n.length>2){let r="."+n.slice(-2).join(".");document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${r}`;}}}),"caches"in window){let t=await caches.keys();await Promise.all(t.map(e=>caches.delete(e)));}if("serviceWorker"in navigator){let t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(e=>e.unregister()));}if("indexedDB"in window&&indexedDB.databases)try{(await indexedDB.databases()).forEach(e=>{e.name&&indexedDB.deleteDatabase(e.name);});}catch{}}catch{}location.reload();}s(Ee,"hardRefresh");function Ie({currentApp:t,currentAppId:e,user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i,apps:h,headerRight:d,settingsHref:f,onSettingsClick:p,hideHardRefresh:c,hideSettings:u}){let[g,P]=react.useState(false),L=r?.find(k=>k.id===l)?.slug||"hanzo",m=h||K(L),H=S[L]||S.hanzo,V=react.useCallback(()=>{P(true),Ee();},[]),y=react.useCallback(()=>{p?p():window.location.href=f||`${H.iam}/account`;},[p,f,H.iam]);return jsxRuntime.jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxRuntime.jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsxRuntime.jsx("a",{href:`${H.iam}/account`,className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Account",children:jsxRuntime.jsx(G,{size:22,brandMenu:true,animate:true})}),jsxRuntime.jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsxRuntime.jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:t}),jsxRuntime.jsx(W,{apps:m,currentAppId:e})]}),jsxRuntime.jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[d,!c&&jsxRuntime.jsx("button",{type:"button",onClick:V,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hard refresh \u2014 clear all storage, cookies, cache and reload",title:"Hard refresh",children:jsxRuntime.jsx(Pe,{className:g?"animate-spin":""})}),!u&&jsxRuntime.jsx("button",{type:"button",onClick:y,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Settings",title:"Settings",children:jsxRuntime.jsx(Le,{})}),jsxRuntime.jsx(ee,{user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i})]})]})}s(Ie,"HanzoHeader");var ce="hanzo-auth-token",ne="hanzo-user",pe="hanzo-auth-expires",Ue="https://iam.hanzo.ai",Be={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function $e(){let[t,e]=react.useState(void 0),[n,r]=react.useState([]),[l,o]=react.useState(void 0),[i,h]=react.useState(null),[d,f]=react.useState(true),p=react.useCallback(async()=>{try{let g=localStorage.getItem(ce),P=localStorage.getItem(pe);if(!g||P&&Date.now()>Number(P)){f(!1);return}h(g);let E=localStorage.getItem(ne);if(E)try{let m=JSON.parse(E);m?.email&&e({id:m.id,name:m.displayName||m.name,email:m.email,avatar:m.avatar});}catch{}let L=await fetch(`${Ue}/api/userinfo`,{headers:{Authorization:`Bearer ${g}`}});if(L.ok){let m=await L.json(),H={id:m.sub||m.id,name:m.name||m.displayName,email:m.email,avatar:m.picture||m.avatar};e(H),localStorage.setItem(ne,JSON.stringify(m));let y=(m.groups||[]).map(k=>{let I=k.toLowerCase().replace(/^\//,""),R=Be[I];return R?{id:I,name:R.name,slug:R.slug}:null}).filter(Boolean);y.length===0&&H.email&&y.push({id:"personal",name:"Personal",slug:"personal"}),r(y),o(y[0]?.id);}}catch{}finally{f(false);}},[]);react.useEffect(()=>{p();},[p]);let c=react.useCallback(()=>{localStorage.removeItem(ce),localStorage.removeItem(ne),localStorage.removeItem(pe),window.location.href="https://hanzo.id";},[]),u=react.useCallback(g=>{o(g);},[]);return {user:t,organizations:n,currentOrgId:l,token:i,loading:d,signOut:c,switchOrg:u}}s($e,"useHanzoAuth");function Ve(t,e){return t.filter(n=>n.id!==e).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}s(Ve,"buildCrossAppCommands");function Te({commands:t=[],apps:e,currentAppId:n,open:r,onOpenChange:l,onNavigate:o}){var ae;let[i,h]=react.useState(false),d=r??i,f=react.useCallback(a=>{l?l(a):h(a);},[l]),[p,c]=react.useState(""),[u,g]=react.useState(0),P=react.useRef(null),E=react.useRef(null),L=Ve(e??U,n),m=[...t,...L],H=p.toLowerCase(),V=H?m.filter(a=>a.title.toLowerCase().includes(H)||a.description?.toLowerCase().includes(H)||a.keywords?.some(z=>z.includes(H))):m,y={};for(let a of V)(y[ae=a.category]??(y[ae]=[])).push(a);let k=Object.values(y).flat();react.useEffect(()=>g(0),[p]),react.useEffect(()=>{d&&(c(""),g(0),requestAnimationFrame(()=>P.current?.focus()));},[d]),react.useEffect(()=>{let a=s(z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),f(!d));},"handler");return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d,f]);let I=react.useCallback(a=>{a.action?a.action():a.href&&(o?o(a.href,a.external):a.external?window.open(a.href,"_blank"):window.location.href=a.href),f(false);},[o,f]),R=react.useCallback(a=>{a.key==="ArrowDown"?(a.preventDefault(),g(z=>(z+1)%(k.length||1))):a.key==="ArrowUp"?(a.preventDefault(),g(z=>(z-1+(k.length||1))%(k.length||1))):a.key==="Enter"&&k[u]?(a.preventDefault(),I(k[u])):a.key==="Escape"&&f(false);},[k,u,I,f]);return react.useEffect(()=>{E.current?.querySelector(`[data-idx="${u}"]`)?.scrollIntoView({block:"nearest"});},[u]),d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>f(false)}),jsxRuntime.jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxRuntime.jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsxRuntime.jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsxRuntime.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsxRuntime.jsx("input",{ref:P,type:"text",value:p,onChange:a=>c(a.target.value),onKeyDown:R,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsxRuntime.jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsxRuntime.jsx("div",{ref:E,className:"max-h-[400px] overflow-y-auto py-1",children:k.length===0?jsxRuntime.jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",p,"\u201D"]}):Object.entries(y).map(([a,z])=>jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:a}),z.map(D=>{let Z=k.indexOf(D),F=Z===u;return jsxRuntime.jsxs("button",{"data-idx":Z,onClick:()=>I(D),onMouseEnter:()=>g(Z),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${F?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[D.icon&&jsxRuntime.jsx("span",{className:`w-5 h-5 flex items-center justify-center ${F?"text-white/70":"text-white/25"}`,children:D.icon}),jsxRuntime.jsxs("div",{className:"flex-1 min-w-0",children:[jsxRuntime.jsx("span",{className:"text-[13px] font-medium truncate block",children:D.title}),D.description&&jsxRuntime.jsx("span",{className:"text-[11px] text-white/25 truncate block",children:D.description})]}),F&&jsxRuntime.jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},D.id)})]},a))}),jsxRuntime.jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxRuntime.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxRuntime.jsxs("span",{className:"flex items-center gap-1",children:[jsxRuntime.jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsxRuntime.jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}s(Te,"HanzoCommandPalette");
|
|
3
|
+
exports.AppSwitcher=W;exports.BeamAvatar=q;exports.DEFAULT_HANZO_APPS=U;exports.HanzoCommandPalette=Te;exports.HanzoHeader=Ie;exports.HanzoMark=G;exports.ORG_DOMAINS=S;exports.UserAvatar=Q;exports.UserOrgDropdown=ee;exports.getAppsForOrg=K;exports.useHanzoAuth=$e;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {useState,useCallback,useRef,useEffect,useMemo}from'react';import {jsxs,Fragment,jsx}from'react/jsx-runtime';var he=Object.defineProperty;var s=(t,e)=>he(t,"name",{value:e,configurable:true});function ge({x:t,y:e,onClose:n}){let r=useRef(null);useEffect(()=>{let i=s(d=>{r.current&&!r.current.contains(d.target)&&n();},"handler"),h=s(d=>{d.key==="Escape"&&n();},"escape");return document.addEventListener("mousedown",i),document.addEventListener("keydown",h),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("keydown",h);}},[n]);let l=[{label:"Brand Guidelines",href:"https://hanzo.ai/brand"},{label:"Press Kit",href:"https://hanzo.ai/press"},{label:"Download Logo",href:"https://hanzo.ai/brand#download"},{label:"Copy SVG",action:"copy-svg"},{label:"hanzo.ai \u2192",href:"https://hanzo.ai"}],o='<svg viewBox="0 0 67 67" xmlns="http://www.w3.org/2000/svg"><path d="M22.21 67V44.6369H0V67H22.21Z" fill="#ffffff"/><path d="M0 44.6369L22.21 46.8285V44.6369H0Z" fill="#DDDDDD"/><path d="M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" fill="#ffffff"/><path d="M22.21 0H0V22.3184H22.21V0Z" fill="#ffffff"/><path d="M66.7198 0H44.5098V22.3184H66.7198V0Z" fill="#ffffff"/><path d="M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" fill="#DDDDDD"/><path d="M66.7198 67V44.6369H44.5098V67H66.7198Z" fill="#ffffff"/></svg>';return jsxs("div",{ref:r,role:"menu",className:"fixed z-[9999] min-w-[180px] rounded-xl border border-white/[0.08] bg-[#111113] py-1.5 shadow-2xl shadow-black/60",style:{top:e,left:t},children:[jsx("div",{className:"border-b border-white/[0.06] px-3 pb-2 pt-1",children:jsx("p",{className:"text-[10px] font-semibold uppercase tracking-widest text-white/30",children:"Hanzo Brand"})}),l.map(i=>i.action==="copy-svg"?jsx("button",{type:"button",role:"menuitem",onClick:()=>{navigator.clipboard.writeText(o).catch(()=>{}),n();},className:"flex w-full items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors text-left",children:"Copy SVG"},"copy"):jsx("a",{href:i.href,role:"menuitem",target:i.href?.startsWith("https")?"_blank":void 0,rel:"noopener noreferrer",onClick:n,className:"flex items-center px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.05] hover:text-white/90 transition-colors",children:i.label},i.label))]})}s(ge,"BrandContextMenu");function G({size:t=22,className:e="",brandMenu:n=true,animate:r=true}){let[l,o]=useState(null),[i,h]=useState(false),d=useCallback(p=>{n&&(p.preventDefault(),o({x:p.clientX,y:p.clientY}));},[n]);return jsxs(Fragment,{children:[jsxs("svg",{width:t,height:t,viewBox:"0 0 67 67",xmlns:"http://www.w3.org/2000/svg","aria-label":"Hanzo",className:e,style:r?{transition:"transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.2s ease",transform:i?"scale(1.12) perspective(80px) rotateY(-6deg)":"scale(1) perspective(80px) rotateY(0deg)",transformOrigin:"center center"}:{},onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),onContextMenu:d,children:[jsx("path",{d:"M22.21 67V44.6369H0V67H22.21Z",fill:"#ffffff"}),jsx("path",{d:"M0 44.6369L22.21 46.8285V44.6369H0Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",fill:"#ffffff"}),jsx("path",{d:"M22.21 0H0V22.3184H22.21V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.7198 0H44.5098V22.3184H66.7198V0Z",fill:"#ffffff"}),jsx("path",{d:"M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z",fill:"#DDDDDD"}),jsx("path",{d:"M66.7198 67V44.6369H44.5098V67H66.7198Z",fill:"#ffffff"})]}),l&&jsx(ge,{x:l.x,y:l.y,onClose:()=>o(null)})]})}s(G,"HanzoMark");var U=[{id:"account",label:"Account",href:"https://hanzo.id/account",description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:"https://billing.hanzo.ai",description:"Subscriptions & usage"},{id:"console",label:"Console",href:"https://console.hanzo.ai",description:"API keys & projects"},{id:"chat",label:"Chat",href:"https://hanzo.chat",description:"AI chat & models"},{id:"platform",label:"Platform",href:"https://platform.hanzo.ai",description:"Deploy & scale services"},{id:"storage",label:"Storage",href:"https://hanzo.space",description:"S3 object storage"}],S={hanzo:{id:"hanzo",iam:"https://hanzo.id",billing:"https://billing.hanzo.ai",console:"https://console.hanzo.ai",chat:"https://hanzo.chat",platform:"https://platform.hanzo.ai",storage:"https://hanzo.space",s3:"https://s3.hanzo.ai"},lux:{id:"lux",iam:"https://lux.id",billing:"https://billing.lux.network",console:"https://console.lux.network",chat:"https://chat.lux.network",platform:"https://platform.lux.network",storage:"https://storage.lux.network",s3:"https://s3.lux.network"},zoo:{id:"zoo",iam:"https://zoo.id",billing:"https://billing.zoo.ngo",console:"https://console.zoo.ngo",chat:"https://chat.zoo.ngo",platform:"https://platform.zoo.ngo",storage:"https://storage.zoo.ngo",s3:"https://s3.zoo.ngo"},pars:{id:"pars",iam:"https://pars.id",billing:"https://billing.pars.ai",console:"https://console.pars.ai",chat:"https://chat.pars.ai",platform:"https://platform.pars.ai",storage:"https://storage.pars.ai",s3:"https://s3.pars.ai"}};function K(t){let e=S[t]||S.hanzo;return [{id:"account",label:"Account",href:`${e.iam}/account`,description:"Profile, orgs & referrals"},{id:"billing",label:"Billing",href:e.billing,description:"Subscriptions & usage"},{id:"console",label:"Console",href:e.console,description:"API keys & projects"},{id:"chat",label:"Chat",href:e.chat,description:"AI chat & models"},{id:"platform",label:"Platform",href:e.platform,description:"Deploy & scale services"},{id:"storage",label:"Storage",href:e.storage,description:"S3 object storage"}]}s(K,"getAppsForOrg");function W({apps:t=U,currentAppId:e}){let[n,r]=useState(false),l=useRef(null);return useEffect(()=>{let o=s(i=>{l.current&&!l.current.contains(i.target)&&r(false);},"handler");return document.addEventListener("mousedown",o),()=>document.removeEventListener("mousedown",o)},[]),jsxs("div",{ref:l,className:"relative",children:[jsx("button",{type:"button",onClick:()=>r(o=>!o),className:"flex h-8 w-8 items-center justify-center rounded-lg text-white/40 hover:bg-white/[0.06] hover:text-white/70 transition-colors","aria-label":"Switch app",title:"Switch app",children:jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"currentColor",children:[jsx("rect",{x:"1",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"1",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"6",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"1",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"6",y:"11",width:"4",height:"4",rx:"1"}),jsx("rect",{x:"11",y:"11",width:"4",height:"4",rx:"1"})]})}),n&&jsxs("div",{className:"absolute left-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] p-2 shadow-2xl",children:[jsx("p",{className:"px-2 pb-1.5 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Hanzo Apps"}),t.filter(o=>o.id!==e).map(o=>jsxs("a",{href:o.href,className:"flex flex-col gap-0.5 rounded-lg px-3 py-2.5 hover:bg-white/[0.06] transition-colors",onClick:()=>r(false),children:[jsx("span",{className:"text-[13px] font-medium text-white/80",children:o.label}),o.description&&jsx("span",{className:"text-[11px] text-white/30",children:o.description})]},o.id))]})]})}s(W,"AppSwitcher");var ye=["#0A0310","#49007E","#FF005B","#FF7D10","#FFB238"];function ke(t){let e=0;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n)|0;return Math.abs(e)}s(ke,"hashStr");function M(t,e,n){return t%(e*(n+1))%e}s(M,"getUnit");function ze(t,e){return M(t,2,e)===0}s(ze,"getBoolean");function ie(t,e,n){return n[M(t,n.length,e)]}s(ie,"getRandomColor");function Ne(t){let e=parseInt(t.slice(1,3),16),n=parseInt(t.slice(3,5),16),r=parseInt(t.slice(5,7),16);return e*.299+n*.587+r*.114>128?"#000":"#fff"}s(Ne,"getContrast");function q({name:t,size:e=40,colors:n=ye,className:r,square:l=false}){let o=ke(t),i=ie(o,0,n),h=Ne(i),d=ze(o,2),f=M(o,3,7),p=M(o,5,8),c=M(o,10,9),u=c>6?c-10:c,g=M(o,5,10)>3?M(o,5,10)-5:M(o,5,10);return jsxs("svg",{viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:e,height:e,className:r,style:l?void 0:{borderRadius:"50%"},children:[jsx("mask",{id:`beam-${o}`,maskUnits:"userSpaceOnUse",x:0,y:0,width:36,height:36,children:jsx("rect",{width:36,height:36,rx:l?void 0:72,fill:"#fff"})}),jsxs("g",{mask:`url(#beam-${o})`,children:[jsx("rect",{width:36,height:36,fill:i}),jsx("rect",{x:0,y:0,width:36,height:36,transform:`translate(${u} ${g}) rotate(${c} 18 18)`,fill:ie(o,1,n),rx:6}),jsxs("g",{transform:`translate(${u} ${g}) rotate(${c} 18 18)`,children:[d?jsx("path",{d:`M15 ${19+f}c2 1 4 1 6 0`,stroke:h,fill:"none",strokeLinecap:"round"}):jsx("path",{d:`M13 ${19+f}a1 .75 0 0 0 10 0`,fill:h}),jsx("rect",{x:14-p,y:14,width:1.5,height:2,rx:1,fill:h}),jsx("rect",{x:20+p,y:14,width:1.5,height:2,rx:1,fill:h})]})]})]})}s(q,"BeamAvatar");async function Ae(t){let n=new TextEncoder().encode(t),r=await crypto.subtle.digest("SHA-256",n);return Array.from(new Uint8Array(r)).map(l=>l.toString(16).padStart(2,"0")).join("")}s(Ae,"sha256");function Se(t,e){let[n,r]=useState(null);return useMemo(()=>{if(!t){r(null);return}let l=t.trim().toLowerCase();Ae(l).then(o=>{r(`https://www.gravatar.com/avatar/${o}?s=${e||80}&d=404`);});},[t,e]),n}s(Se,"useGravatarUrl");function Q({src:t,email:e,name:n,size:r=40,colors:l,className:o}){let[i,h]=useState(false),[d,f]=useState(false),p=Se(e,r*2),c=`rounded-full object-cover ${o||""}`,u={width:r,height:r};return t&&!i?jsx("img",{src:t,alt:n||e||"avatar",className:c,style:u,onError:()=>h(true)}):p&&!d?jsx("img",{src:p,alt:n||e||"avatar",className:c,style:u,onError:()=>f(true)}):jsx(q,{name:n||e||"user",size:r,colors:l,className:o})}s(Q,"UserAvatar");function ee({user:t,organizations:e=[],currentOrgId:n,onOrgSwitch:r,onSignOut:l}){let[o,i]=useState(false),h=useRef(null);if(useEffect(()=>{let c=s(u=>{h.current&&!h.current.contains(u.target)&&i(false);},"handler");return document.addEventListener("mousedown",c),()=>document.removeEventListener("mousedown",c)},[]),!t)return null;let d=e.find(c=>c.id===n),f=d?.slug||"hanzo",p=S[f]||S.hanzo;return jsxs("div",{ref:h,className:"relative",children:[jsxs("button",{type:"button",onClick:()=>i(c=>!c),className:"flex items-center gap-2 rounded-lg px-2 py-1.5 hover:bg-white/[0.06] transition-colors",children:[jsx(Q,{src:t.avatar,email:t.email,name:t.name,size:28}),jsxs("div",{className:"hidden flex-col items-start sm:flex",children:[t.name&&jsx("span",{className:"text-[12px] font-medium text-white/70 leading-none",children:t.name}),jsx("span",{className:"text-[11px] text-white/30 leading-none mt-0.5",children:t.email})]}),jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/30 hidden sm:block",children:jsx("path",{d:"M6 9l6 6 6-6"})})]}),o&&jsxs("div",{className:"absolute right-0 top-10 z-50 w-64 rounded-xl border border-white/[0.08] bg-[#0e0e13] shadow-2xl",children:[jsxs("div",{className:"border-b border-white/[0.06] px-4 py-3",children:[jsx("p",{className:"text-[13px] font-medium text-white/80",children:t.name||"User"}),jsx("p",{className:"text-[11px] text-white/40",children:t.email}),d&&jsx("p",{className:"mt-0.5 text-[10px] font-medium text-white/25 uppercase tracking-wider",children:d.name})]}),e.length>0&&jsxs("div",{className:"border-b border-white/[0.06] p-2",children:[jsx("p",{className:"px-2 pb-1 pt-0.5 text-[10px] font-medium uppercase tracking-wider text-white/30",children:"Organizations"}),e.map(c=>jsxs("button",{type:"button",onClick:()=>{r?.(c.id),i(false);},className:"flex w-full items-center justify-between rounded-lg px-3 py-2 text-left hover:bg-white/[0.06] transition-colors",children:[jsxs("div",{className:"flex flex-col",children:[jsx("span",{className:"text-[13px] text-white/70",children:c.name}),c.role&&jsx("span",{className:"text-[10px] text-white/25 capitalize",children:c.role})]}),c.id===n&&jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",strokeLinecap:"round",strokeLinejoin:"round",className:"text-white/50",children:jsx("polyline",{points:"20 6 9 17 4 12"})})]},c.id))]}),jsxs("div",{className:"p-2",children:[jsx("a",{href:`${p.iam}/account`,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Account settings"}),jsx("a",{href:p.billing,className:"flex items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/60 hover:bg-white/[0.06] hover:text-white/80 transition-colors",onClick:()=>i(false),children:"Billing"}),jsx("button",{type:"button",onClick:()=>{i(false),l?.();},className:"flex w-full items-center gap-2.5 rounded-lg px-3 py-2 text-[13px] text-white/40 hover:bg-white/[0.06] hover:text-red-400/70 transition-colors",children:"Sign out"})]})]})]})}s(ee,"UserOrgDropdown");function Pe({className:t}){return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsx("path",{d:"M21 2v6h-6"}),jsx("path",{d:"M3 12a9 9 0 0 1 15-6.7L21 8"}),jsx("path",{d:"M3 22v-6h6"}),jsx("path",{d:"M21 12a9 9 0 0 1-15 6.7L3 16"})]})}s(Pe,"HardRefreshIcon");function Le({className:t}){return jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:t,children:[jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),jsx("circle",{cx:"12",cy:"12",r:"3"})]})}s(Le,"SettingsIcon");async function Ee(){try{if(localStorage.clear(),sessionStorage.clear(),document.cookie.split(";").forEach(t=>{let e=t.split("=")[0].trim();if(e){document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/`,document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${location.hostname}`;let n=location.hostname.split(".");if(n.length>2){let r="."+n.slice(-2).join(".");document.cookie=`${e}=;expires=Thu, 01 Jan 1970 00:00:00 GMT;path=/;domain=${r}`;}}}),"caches"in window){let t=await caches.keys();await Promise.all(t.map(e=>caches.delete(e)));}if("serviceWorker"in navigator){let t=await navigator.serviceWorker.getRegistrations();await Promise.all(t.map(e=>e.unregister()));}if("indexedDB"in window&&indexedDB.databases)try{(await indexedDB.databases()).forEach(e=>{e.name&&indexedDB.deleteDatabase(e.name);});}catch{}}catch{}location.reload();}s(Ee,"hardRefresh");function Ie({currentApp:t,currentAppId:e,user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i,apps:h,headerRight:d,settingsHref:f,onSettingsClick:p,hideHardRefresh:c,hideSettings:u}){let[g,P]=useState(false),L=r?.find(k=>k.id===l)?.slug||"hanzo",m=h||K(L),H=S[L]||S.hanzo,V=useCallback(()=>{P(true),Ee();},[]),y=useCallback(()=>{p?p():window.location.href=f||`${H.iam}/account`;},[p,f,H.iam]);return jsxs("header",{className:"sticky top-0 z-50 flex h-14 w-full items-center justify-between border-b border-white/[0.07] bg-[#09090b]/90 px-4 backdrop-blur-xl",role:"banner",children:[jsxs("div",{className:"flex min-w-0 items-center gap-2.5",children:[jsx("a",{href:`${H.iam}/account`,className:"flex-shrink-0 rounded focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Account",children:jsx(G,{size:22,brandMenu:true,animate:true})}),jsx("span",{className:"select-none text-white/[0.15]",children:"/"}),jsx("span",{className:"truncate text-[13px] font-medium text-white/50",children:t}),jsx(W,{apps:m,currentAppId:e})]}),jsxs("div",{className:"flex flex-shrink-0 items-center gap-1",children:[d,!c&&jsx("button",{type:"button",onClick:V,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Hard refresh \u2014 clear all storage, cookies, cache and reload",title:"Hard refresh",children:jsx(Pe,{className:g?"animate-spin":""})}),!u&&jsx("button",{type:"button",onClick:y,className:"flex items-center justify-center rounded-lg p-2 text-white/30 hover:bg-white/[0.06] hover:text-white/60 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20","aria-label":"Settings",title:"Settings",children:jsx(Le,{})}),jsx(ee,{user:n,organizations:r,currentOrgId:l,onOrgSwitch:o,onSignOut:i})]})]})}s(Ie,"HanzoHeader");var ce="hanzo-auth-token",ne="hanzo-user",pe="hanzo-auth-expires",Ue="https://iam.hanzo.ai",Be={hanzo:{name:"Hanzo AI",slug:"hanzo"},lux:{name:"Lux Network",slug:"lux"},zoo:{name:"Zoo Labs",slug:"zoo"},pars:{name:"Pars",slug:"pars"}};function $e(){let[t,e]=useState(void 0),[n,r]=useState([]),[l,o]=useState(void 0),[i,h]=useState(null),[d,f]=useState(true),p=useCallback(async()=>{try{let g=localStorage.getItem(ce),P=localStorage.getItem(pe);if(!g||P&&Date.now()>Number(P)){f(!1);return}h(g);let E=localStorage.getItem(ne);if(E)try{let m=JSON.parse(E);m?.email&&e({id:m.id,name:m.displayName||m.name,email:m.email,avatar:m.avatar});}catch{}let L=await fetch(`${Ue}/api/userinfo`,{headers:{Authorization:`Bearer ${g}`}});if(L.ok){let m=await L.json(),H={id:m.sub||m.id,name:m.name||m.displayName,email:m.email,avatar:m.picture||m.avatar};e(H),localStorage.setItem(ne,JSON.stringify(m));let y=(m.groups||[]).map(k=>{let I=k.toLowerCase().replace(/^\//,""),R=Be[I];return R?{id:I,name:R.name,slug:R.slug}:null}).filter(Boolean);y.length===0&&H.email&&y.push({id:"personal",name:"Personal",slug:"personal"}),r(y),o(y[0]?.id);}}catch{}finally{f(false);}},[]);useEffect(()=>{p();},[p]);let c=useCallback(()=>{localStorage.removeItem(ce),localStorage.removeItem(ne),localStorage.removeItem(pe),window.location.href="https://hanzo.id";},[]),u=useCallback(g=>{o(g);},[]);return {user:t,organizations:n,currentOrgId:l,token:i,loading:d,signOut:c,switchOrg:u}}s($e,"useHanzoAuth");function Ve(t,e){return t.filter(n=>n.id!==e).map(n=>({id:`app-${n.id}`,title:n.label,description:n.description,href:n.href,category:"Hanzo Apps",external:true,keywords:[n.id,n.label.toLowerCase()]}))}s(Ve,"buildCrossAppCommands");function Te({commands:t=[],apps:e,currentAppId:n,open:r,onOpenChange:l,onNavigate:o}){var ae;let[i,h]=useState(false),d=r??i,f=useCallback(a=>{l?l(a):h(a);},[l]),[p,c]=useState(""),[u,g]=useState(0),P=useRef(null),E=useRef(null),L=Ve(e??U,n),m=[...t,...L],H=p.toLowerCase(),V=H?m.filter(a=>a.title.toLowerCase().includes(H)||a.description?.toLowerCase().includes(H)||a.keywords?.some(z=>z.includes(H))):m,y={};for(let a of V)(y[ae=a.category]??(y[ae]=[])).push(a);let k=Object.values(y).flat();useEffect(()=>g(0),[p]),useEffect(()=>{d&&(c(""),g(0),requestAnimationFrame(()=>P.current?.focus()));},[d]),useEffect(()=>{let a=s(z=>{(z.metaKey||z.ctrlKey)&&z.key==="k"&&(z.preventDefault(),f(!d));},"handler");return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[d,f]);let I=useCallback(a=>{a.action?a.action():a.href&&(o?o(a.href,a.external):a.external?window.open(a.href,"_blank"):window.location.href=a.href),f(false);},[o,f]),R=useCallback(a=>{a.key==="ArrowDown"?(a.preventDefault(),g(z=>(z+1)%(k.length||1))):a.key==="ArrowUp"?(a.preventDefault(),g(z=>(z-1+(k.length||1))%(k.length||1))):a.key==="Enter"&&k[u]?(a.preventDefault(),I(k[u])):a.key==="Escape"&&f(false);},[k,u,I,f]);return useEffect(()=>{E.current?.querySelector(`[data-idx="${u}"]`)?.scrollIntoView({block:"nearest"});},[u]),d?jsxs(Fragment,{children:[jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[100]",onClick:()=>f(false)}),jsx("div",{className:"fixed top-[15%] left-1/2 -translate-x-1/2 w-full max-w-xl z-[101]",children:jsxs("div",{className:"bg-[#111113] border border-white/[0.08] rounded-xl shadow-2xl overflow-hidden",children:[jsxs("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-white/[0.07]",children:[jsx("svg",{className:"w-4 h-4 text-white/30",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),jsx("input",{ref:P,type:"text",value:p,onChange:a=>c(a.target.value),onKeyDown:R,placeholder:"Search commands...",className:"flex-1 bg-transparent text-white text-[13px] placeholder-white/30 outline-none"}),jsx("kbd",{className:"px-1.5 py-0.5 text-[10px] font-mono bg-white/[0.06] rounded text-white/30",children:"ESC"})]}),jsx("div",{ref:E,className:"max-h-[400px] overflow-y-auto py-1",children:k.length===0?jsxs("div",{className:"px-4 py-8 text-center text-white/30 text-[13px]",children:["No results for \u201C",p,"\u201D"]}):Object.entries(y).map(([a,z])=>jsxs("div",{children:[jsx("div",{className:"px-4 py-2 text-[10px] font-semibold text-white/25 uppercase tracking-widest",children:a}),z.map(D=>{let Z=k.indexOf(D),F=Z===u;return jsxs("button",{"data-idx":Z,onClick:()=>I(D),onMouseEnter:()=>g(Z),className:`w-full flex items-center gap-3 px-4 py-2 text-left transition-colors ${F?"bg-white/[0.06] text-white":"text-white/50 hover:bg-white/[0.03]"}`,children:[D.icon&&jsx("span",{className:`w-5 h-5 flex items-center justify-center ${F?"text-white/70":"text-white/25"}`,children:D.icon}),jsxs("div",{className:"flex-1 min-w-0",children:[jsx("span",{className:"text-[13px] font-medium truncate block",children:D.title}),D.description&&jsx("span",{className:"text-[11px] text-white/25 truncate block",children:D.description})]}),F&&jsx("span",{className:"text-white/25 text-[11px]",children:"\u21B5"})]},D.id)})]},a))}),jsxs("div",{className:"px-4 py-2 border-t border-white/[0.07] flex items-center justify-between",children:[jsxs("div",{className:"flex items-center gap-4 text-[10px] text-white/20",children:[jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2191"}),jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u2193"}),"navigate"]}),jsxs("span",{className:"flex items-center gap-1",children:[jsx("kbd",{className:"px-1 py-0.5 bg-white/[0.06] rounded text-[9px]",children:"\u21B5"}),"select"]})]}),jsx("span",{className:"text-[10px] text-white/20",children:"\u2318K"})]})]})})]}):null}s(Te,"HanzoCommandPalette");
|
|
3
|
+
export{W as AppSwitcher,q as BeamAvatar,U as DEFAULT_HANZO_APPS,Te as HanzoCommandPalette,Ie as HanzoHeader,G as HanzoMark,S as ORG_DOMAINS,Q as UserAvatar,ee as UserOrgDropdown,K as getAppsForOrg,$e as useHanzoAuth};
|