tekivex-ui 2.5.15 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/charts.cjs +1 -1
- package/dist/charts.js +22 -553
- package/dist/chunk-B3ph66Zb.js +1 -0
- package/dist/chunk-Bc16rJT-.js +1 -0
- package/dist/chunk-Dike2DLU.js +3 -0
- package/dist/chunk-DjxOP8W4.js +1 -0
- package/dist/chunk-DkoFTL1O.js +1 -0
- package/dist/chunk-DmRB1Blb.js +1 -0
- package/dist/chunk-DnCXUUx5.js +1 -0
- package/dist/chunk-LWkKqC8d.js +1 -0
- package/dist/chunk-PJ50l0JC.js +1 -0
- package/dist/headless.cjs +1 -1
- package/dist/headless.js +1 -442
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.js +1 -733
- package/dist/index.cjs +1 -152
- package/dist/index.d.ts +4 -2
- package/dist/index.js +429 -16786
- package/dist/quantum.cjs +1 -89
- package/dist/quantum.js +74 -2551
- package/dist/realtime.cjs +1 -23
- package/dist/realtime.js +1 -804
- package/dist/src/a11y/index.d.ts +0 -1
- package/dist/src/charts/TkxAreaChart.d.ts +0 -5
- package/dist/src/charts/TkxBarChart.d.ts +0 -3
- package/dist/src/charts/TkxDonutChart.d.ts +0 -5
- package/dist/src/charts/TkxLineChart.d.ts +0 -1
- package/dist/src/charts/TkxPieChart.d.ts +0 -3
- package/dist/src/charts/TkxRadarChart.d.ts +0 -3
- package/dist/src/charts/TkxScatterChart.d.ts +0 -2
- package/dist/src/charts/index.d.ts +0 -1
- package/dist/src/charts/shared.d.ts +0 -3
- package/dist/src/components/TkxAIChatBubble.d.ts +0 -9
- package/dist/src/components/TkxAIConfidenceBar.d.ts +0 -6
- package/dist/src/components/TkxAIThinking.d.ts +0 -6
- package/dist/src/components/TkxAccordion.d.ts +0 -1
- package/dist/src/components/TkxAffix.d.ts +0 -1
- package/dist/src/components/TkxAlert.d.ts +0 -1
- package/dist/src/components/TkxAnchor.d.ts +0 -1
- package/dist/src/components/TkxAppBar.d.ts +0 -1
- package/dist/src/components/TkxAutocomplete.d.ts +0 -1
- package/dist/src/components/TkxAvatar.d.ts +0 -1
- package/dist/src/components/TkxBadge.d.ts +0 -1
- package/dist/src/components/TkxBottomNav.d.ts +0 -1
- package/dist/src/components/TkxBreadcrumb.d.ts +0 -1
- package/dist/src/components/TkxButton.d.ts +0 -1
- package/dist/src/components/TkxCard.d.ts +0 -1
- package/dist/src/components/TkxCarousel.d.ts +0 -1
- package/dist/src/components/TkxCascader.d.ts +0 -1
- package/dist/src/components/TkxChat.d.ts +0 -1
- package/dist/src/components/TkxCheckbox.d.ts +0 -1
- package/dist/src/components/TkxClock.d.ts +0 -1
- package/dist/src/components/TkxColorPicker.d.ts +0 -1
- package/dist/src/components/TkxCommand.d.ts +0 -1
- package/dist/src/components/TkxConfigProvider.d.ts +0 -30
- package/dist/src/components/TkxDataGrid.d.ts +0 -15
- package/dist/src/components/TkxDatePicker.d.ts +0 -1
- package/dist/src/components/TkxDivider.d.ts +0 -1
- package/dist/src/components/TkxDrawer.d.ts +0 -1
- package/dist/src/components/TkxDropdown.d.ts +0 -1
- package/dist/src/components/TkxEmpty.d.ts +0 -1
- package/dist/src/components/TkxFileUpload.d.ts +0 -1
- package/dist/src/components/TkxForm.d.ts +0 -35
- package/dist/src/components/TkxIcon.d.ts +0 -1
- package/dist/src/components/TkxImage.d.ts +0 -1
- package/dist/src/components/TkxInput.d.ts +1 -1
- package/dist/src/components/TkxLayout.d.ts +0 -22
- package/dist/src/components/TkxList.d.ts +0 -1
- package/dist/src/components/TkxLiveFeed.d.ts +0 -1
- package/dist/src/components/TkxLiveLog.d.ts +0 -1
- package/dist/src/components/TkxLiveMetrics.d.ts +0 -1
- package/dist/src/components/TkxLogo.d.ts +0 -1
- package/dist/src/components/TkxMarkdown.d.ts +0 -10
- package/dist/src/components/TkxMasonry.d.ts +0 -1
- package/dist/src/components/TkxMentions.d.ts +0 -1
- package/dist/src/components/TkxMenu.d.ts +0 -1
- package/dist/src/components/TkxModal.d.ts +0 -1
- package/dist/src/components/TkxNumberInput.d.ts +0 -1
- package/dist/src/components/TkxOTP.d.ts +0 -1
- package/dist/src/components/TkxOrgChart.d.ts +32 -0
- package/dist/src/components/TkxPagination.d.ts +0 -1
- package/dist/src/components/TkxPlayground.d.ts +0 -13
- package/dist/src/components/TkxPopover.d.ts +0 -1
- package/dist/src/components/TkxProgress.d.ts +0 -1
- package/dist/src/components/TkxQRCode.d.ts +0 -1
- package/dist/src/components/TkxQuantumForm.d.ts +0 -1
- package/dist/src/components/TkxRadio.d.ts +0 -1
- package/dist/src/components/TkxRating.d.ts +0 -1
- package/dist/src/components/TkxRealTimeChart.d.ts +0 -1
- package/dist/src/components/TkxResult.d.ts +0 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts +0 -1
- package/dist/src/components/TkxSegmented.d.ts +0 -1
- package/dist/src/components/TkxSelect.d.ts +0 -3
- package/dist/src/components/TkxSkeleton.d.ts +0 -1
- package/dist/src/components/TkxSlider.d.ts +0 -1
- package/dist/src/components/TkxSnackbar.d.ts +0 -1
- package/dist/src/components/TkxSpeedDial.d.ts +0 -1
- package/dist/src/components/TkxSpin.d.ts +0 -1
- package/dist/src/components/TkxStatistic.d.ts +0 -1
- package/dist/src/components/TkxStepper.d.ts +0 -1
- package/dist/src/components/TkxTable.d.ts +0 -1
- package/dist/src/components/TkxTabs.d.ts +0 -1
- package/dist/src/components/TkxTag.d.ts +0 -1
- package/dist/src/components/TkxThemeBuilder.d.ts +0 -1
- package/dist/src/components/TkxTimeline.d.ts +0 -1
- package/dist/src/components/TkxToast.d.ts +0 -1
- package/dist/src/components/TkxToggle.d.ts +0 -1
- package/dist/src/components/TkxToolbar.d.ts +0 -1
- package/dist/src/components/TkxTooltip.d.ts +0 -1
- package/dist/src/components/TkxTour.d.ts +0 -1
- package/dist/src/components/TkxTransferList.d.ts +0 -1
- package/dist/src/components/TkxTreeView.d.ts +0 -1
- package/dist/src/components/TkxTypography.d.ts +0 -1
- package/dist/src/components/TkxVideoPlayer.d.ts +0 -1
- package/dist/src/components/TkxWatermark.d.ts +0 -1
- package/dist/src/components/index.d.ts +1 -1
- package/dist/src/engine/css.d.ts +0 -1
- package/dist/src/engine/index.d.ts +0 -1
- package/dist/src/engine/quantum-ai.d.ts +0 -73
- package/dist/src/engine/quantum.d.ts +0 -1
- package/dist/src/engine/security.d.ts +45 -9
- package/dist/src/engine/tkx.d.ts +0 -53
- package/dist/src/engine/wcag.d.ts +0 -1
- package/dist/src/headless/index.d.ts +0 -1
- package/dist/src/headless/useControllable.d.ts +0 -15
- package/dist/src/headless/useDebounce.d.ts +0 -12
- package/dist/src/headless/useDisclosure.d.ts +0 -13
- package/dist/src/headless/useFormState.d.ts +0 -13
- package/dist/src/headless/useInfiniteQuery.d.ts +0 -11
- package/dist/src/headless/useIntersectionObserver.d.ts +0 -10
- package/dist/src/headless/useListSelection.d.ts +0 -9
- package/dist/src/headless/useLocalStorage.d.ts +0 -8
- package/dist/src/headless/useMediaQuery.d.ts +0 -10
- package/dist/src/headless/useRovingTabIndex.d.ts +0 -15
- package/dist/src/headless/useSSE.d.ts +0 -9
- package/dist/src/headless/useThrottle.d.ts +0 -7
- package/dist/src/headless/useWebSocket.d.ts +0 -9
- package/dist/src/hooks/index.d.ts +0 -1
- package/dist/src/i18n/I18nProvider.d.ts +0 -1
- package/dist/src/i18n/index.d.ts +0 -1
- package/dist/src/quantum/index.d.ts +0 -1
- package/dist/src/realtime/index.d.ts +0 -1
- package/dist/src/themes/index.d.ts +0 -1
- package/package.json +5 -3
- package/dist/TkxForm-BaO4wvXt.js +0 -320
- package/dist/TkxForm-M6ttomry.cjs +0 -12
- package/dist/chunk-Bmb41Sf3.cjs +0 -1
- package/dist/hooks-6pRsPOyG.js +0 -58
- package/dist/hooks-mivgRljH.cjs +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/src/a11y/index.d.ts.map +0 -1
- package/dist/src/charts/TkxAreaChart.d.ts.map +0 -1
- package/dist/src/charts/TkxBarChart.d.ts.map +0 -1
- package/dist/src/charts/TkxDonutChart.d.ts.map +0 -1
- package/dist/src/charts/TkxLineChart.d.ts.map +0 -1
- package/dist/src/charts/TkxPieChart.d.ts.map +0 -1
- package/dist/src/charts/TkxRadarChart.d.ts.map +0 -1
- package/dist/src/charts/TkxScatterChart.d.ts.map +0 -1
- package/dist/src/charts/index.d.ts.map +0 -1
- package/dist/src/charts/shared.d.ts.map +0 -1
- package/dist/src/components/TkxAIChatBubble.d.ts.map +0 -1
- package/dist/src/components/TkxAIConfidenceBar.d.ts.map +0 -1
- package/dist/src/components/TkxAIThinking.d.ts.map +0 -1
- package/dist/src/components/TkxAccordion.d.ts.map +0 -1
- package/dist/src/components/TkxAffix.d.ts.map +0 -1
- package/dist/src/components/TkxAlert.d.ts.map +0 -1
- package/dist/src/components/TkxAnchor.d.ts.map +0 -1
- package/dist/src/components/TkxAppBar.d.ts.map +0 -1
- package/dist/src/components/TkxAutocomplete.d.ts.map +0 -1
- package/dist/src/components/TkxAvatar.d.ts.map +0 -1
- package/dist/src/components/TkxBadge.d.ts.map +0 -1
- package/dist/src/components/TkxBottomNav.d.ts.map +0 -1
- package/dist/src/components/TkxBreadcrumb.d.ts.map +0 -1
- package/dist/src/components/TkxButton.d.ts.map +0 -1
- package/dist/src/components/TkxCard.d.ts.map +0 -1
- package/dist/src/components/TkxCarousel.d.ts.map +0 -1
- package/dist/src/components/TkxCascader.d.ts.map +0 -1
- package/dist/src/components/TkxChat.d.ts.map +0 -1
- package/dist/src/components/TkxCheckbox.d.ts.map +0 -1
- package/dist/src/components/TkxClock.d.ts.map +0 -1
- package/dist/src/components/TkxColorPicker.d.ts.map +0 -1
- package/dist/src/components/TkxCommand.d.ts.map +0 -1
- package/dist/src/components/TkxConfigProvider.d.ts.map +0 -1
- package/dist/src/components/TkxDataGrid.d.ts.map +0 -1
- package/dist/src/components/TkxDatePicker.d.ts.map +0 -1
- package/dist/src/components/TkxDivider.d.ts.map +0 -1
- package/dist/src/components/TkxDrawer.d.ts.map +0 -1
- package/dist/src/components/TkxDropdown.d.ts.map +0 -1
- package/dist/src/components/TkxEmpty.d.ts.map +0 -1
- package/dist/src/components/TkxFileUpload.d.ts.map +0 -1
- package/dist/src/components/TkxForm.d.ts.map +0 -1
- package/dist/src/components/TkxIcon.d.ts.map +0 -1
- package/dist/src/components/TkxImage.d.ts.map +0 -1
- package/dist/src/components/TkxInput.d.ts.map +0 -1
- package/dist/src/components/TkxLayout.d.ts.map +0 -1
- package/dist/src/components/TkxList.d.ts.map +0 -1
- package/dist/src/components/TkxLiveFeed.d.ts.map +0 -1
- package/dist/src/components/TkxLiveLog.d.ts.map +0 -1
- package/dist/src/components/TkxLiveMetrics.d.ts.map +0 -1
- package/dist/src/components/TkxLogo.d.ts.map +0 -1
- package/dist/src/components/TkxMarkdown.d.ts.map +0 -1
- package/dist/src/components/TkxMasonry.d.ts.map +0 -1
- package/dist/src/components/TkxMentions.d.ts.map +0 -1
- package/dist/src/components/TkxMenu.d.ts.map +0 -1
- package/dist/src/components/TkxModal.d.ts.map +0 -1
- package/dist/src/components/TkxNumberInput.d.ts.map +0 -1
- package/dist/src/components/TkxOTP.d.ts.map +0 -1
- package/dist/src/components/TkxPagination.d.ts.map +0 -1
- package/dist/src/components/TkxPlayground.d.ts.map +0 -1
- package/dist/src/components/TkxPopover.d.ts.map +0 -1
- package/dist/src/components/TkxProgress.d.ts.map +0 -1
- package/dist/src/components/TkxQRCode.d.ts.map +0 -1
- package/dist/src/components/TkxQuantumForm.d.ts.map +0 -1
- package/dist/src/components/TkxRadio.d.ts.map +0 -1
- package/dist/src/components/TkxRating.d.ts.map +0 -1
- package/dist/src/components/TkxRealTimeChart.d.ts.map +0 -1
- package/dist/src/components/TkxResult.d.ts.map +0 -1
- package/dist/src/components/TkxRichTextDisplay.d.ts.map +0 -1
- package/dist/src/components/TkxSegmented.d.ts.map +0 -1
- package/dist/src/components/TkxSelect.d.ts.map +0 -1
- package/dist/src/components/TkxSkeleton.d.ts.map +0 -1
- package/dist/src/components/TkxSlider.d.ts.map +0 -1
- package/dist/src/components/TkxSnackbar.d.ts.map +0 -1
- package/dist/src/components/TkxSpeedDial.d.ts.map +0 -1
- package/dist/src/components/TkxSpin.d.ts.map +0 -1
- package/dist/src/components/TkxStatistic.d.ts.map +0 -1
- package/dist/src/components/TkxStepper.d.ts.map +0 -1
- package/dist/src/components/TkxTable.d.ts.map +0 -1
- package/dist/src/components/TkxTabs.d.ts.map +0 -1
- package/dist/src/components/TkxTag.d.ts.map +0 -1
- package/dist/src/components/TkxThemeBuilder.d.ts.map +0 -1
- package/dist/src/components/TkxTimeline.d.ts.map +0 -1
- package/dist/src/components/TkxToast.d.ts.map +0 -1
- package/dist/src/components/TkxToggle.d.ts.map +0 -1
- package/dist/src/components/TkxToolbar.d.ts.map +0 -1
- package/dist/src/components/TkxTooltip.d.ts.map +0 -1
- package/dist/src/components/TkxTour.d.ts.map +0 -1
- package/dist/src/components/TkxTransferList.d.ts.map +0 -1
- package/dist/src/components/TkxTreeView.d.ts.map +0 -1
- package/dist/src/components/TkxTypography.d.ts.map +0 -1
- package/dist/src/components/TkxVideoPlayer.d.ts.map +0 -1
- package/dist/src/components/TkxWatermark.d.ts.map +0 -1
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/engine/css.d.ts.map +0 -1
- package/dist/src/engine/index.d.ts.map +0 -1
- package/dist/src/engine/quantum-ai.d.ts.map +0 -1
- package/dist/src/engine/quantum.d.ts.map +0 -1
- package/dist/src/engine/security.d.ts.map +0 -1
- package/dist/src/engine/tkx.d.ts.map +0 -1
- package/dist/src/engine/wcag.d.ts.map +0 -1
- package/dist/src/headless/index.d.ts.map +0 -1
- package/dist/src/headless/useControllable.d.ts.map +0 -1
- package/dist/src/headless/useDebounce.d.ts.map +0 -1
- package/dist/src/headless/useDisclosure.d.ts.map +0 -1
- package/dist/src/headless/useFormState.d.ts.map +0 -1
- package/dist/src/headless/useInfiniteQuery.d.ts.map +0 -1
- package/dist/src/headless/useIntersectionObserver.d.ts.map +0 -1
- package/dist/src/headless/useListSelection.d.ts.map +0 -1
- package/dist/src/headless/useLocalStorage.d.ts.map +0 -1
- package/dist/src/headless/useMediaQuery.d.ts.map +0 -1
- package/dist/src/headless/useRovingTabIndex.d.ts.map +0 -1
- package/dist/src/headless/useSSE.d.ts.map +0 -1
- package/dist/src/headless/useThrottle.d.ts.map +0 -1
- package/dist/src/headless/useWebSocket.d.ts.map +0 -1
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/i18n/I18nProvider.d.ts.map +0 -1
- package/dist/src/i18n/index.d.ts.map +0 -1
- package/dist/src/quantum/index.d.ts.map +0 -1
- package/dist/src/realtime/index.d.ts.map +0 -1
- package/dist/src/themes/index.d.ts.map +0 -1
- package/dist/themes-BbJanqiC.js +0 -498
- package/dist/themes-CMq2vWXj.cjs +0 -2
- package/dist/tkx-BoP5V5zy.cjs +0 -4
- package/dist/tkx-mOKMzvUK.js +0 -1174
- package/src/a11y/index.tsx +0 -87
- package/src/charts/TkxAreaChart.tsx +0 -121
- package/src/charts/TkxBarChart.tsx +0 -117
- package/src/charts/TkxDonutChart.tsx +0 -164
- package/src/charts/TkxLineChart.tsx +0 -137
- package/src/charts/TkxPieChart.tsx +0 -103
- package/src/charts/TkxRadarChart.tsx +0 -92
- package/src/charts/TkxScatterChart.tsx +0 -104
- package/src/charts/index.ts +0 -22
- package/src/charts/shared.ts +0 -47
- package/src/components/TkxAIChatBubble.tsx +0 -256
- package/src/components/TkxAIConfidenceBar.tsx +0 -133
- package/src/components/TkxAIThinking.tsx +0 -193
- package/src/components/TkxAccordion.tsx +0 -590
- package/src/components/TkxAffix.tsx +0 -140
- package/src/components/TkxAlert.tsx +0 -94
- package/src/components/TkxAnchor.tsx +0 -195
- package/src/components/TkxAppBar.tsx +0 -262
- package/src/components/TkxAutocomplete.tsx +0 -455
- package/src/components/TkxAvatar.tsx +0 -103
- package/src/components/TkxBadge.tsx +0 -75
- package/src/components/TkxBottomNav.tsx +0 -241
- package/src/components/TkxBreadcrumb.tsx +0 -324
- package/src/components/TkxButton.tsx +0 -155
- package/src/components/TkxCard.tsx +0 -96
- package/src/components/TkxCarousel.tsx +0 -554
- package/src/components/TkxCascader.tsx +0 -278
- package/src/components/TkxChat.tsx +0 -356
- package/src/components/TkxCheckbox.tsx +0 -220
- package/src/components/TkxClock.tsx +0 -603
- package/src/components/TkxColorPicker.tsx +0 -635
- package/src/components/TkxCommand.tsx +0 -646
- package/src/components/TkxConfigProvider.tsx +0 -460
- package/src/components/TkxDataGrid.tsx +0 -941
- package/src/components/TkxDatePicker.tsx +0 -1625
- package/src/components/TkxDivider.tsx +0 -51
- package/src/components/TkxDrawer.tsx +0 -236
- package/src/components/TkxDropdown.tsx +0 -804
- package/src/components/TkxEmpty.tsx +0 -221
- package/src/components/TkxFileUpload.tsx +0 -373
- package/src/components/TkxForm.tsx +0 -683
- package/src/components/TkxIcon.tsx +0 -685
- package/src/components/TkxImage.tsx +0 -279
- package/src/components/TkxInput.tsx +0 -103
- package/src/components/TkxLayout.tsx +0 -649
- package/src/components/TkxList.tsx +0 -244
- package/src/components/TkxLiveFeed.tsx +0 -331
- package/src/components/TkxLiveLog.tsx +0 -472
- package/src/components/TkxLiveMetrics.tsx +0 -315
- package/src/components/TkxLogo.tsx +0 -299
- package/src/components/TkxMarkdown.tsx +0 -855
- package/src/components/TkxMasonry.tsx +0 -178
- package/src/components/TkxMentions.tsx +0 -212
- package/src/components/TkxMenu.tsx +0 -1044
- package/src/components/TkxModal.tsx +0 -122
- package/src/components/TkxNumberInput.tsx +0 -410
- package/src/components/TkxOTP.tsx +0 -297
- package/src/components/TkxPagination.tsx +0 -390
- package/src/components/TkxPlayground.tsx +0 -845
- package/src/components/TkxPopover.tsx +0 -297
- package/src/components/TkxProgress.tsx +0 -114
- package/src/components/TkxQRCode.tsx +0 -176
- package/src/components/TkxQuantumForm.tsx +0 -594
- package/src/components/TkxRadio.tsx +0 -286
- package/src/components/TkxRating.tsx +0 -288
- package/src/components/TkxRealTimeChart.tsx +0 -383
- package/src/components/TkxResult.tsx +0 -130
- package/src/components/TkxRichTextDisplay.tsx +0 -396
- package/src/components/TkxSegmented.tsx +0 -171
- package/src/components/TkxSelect.tsx +0 -1130
- package/src/components/TkxSkeleton.tsx +0 -107
- package/src/components/TkxSlider.tsx +0 -495
- package/src/components/TkxSnackbar.tsx +0 -316
- package/src/components/TkxSpeedDial.tsx +0 -397
- package/src/components/TkxSpin.tsx +0 -263
- package/src/components/TkxStatistic.tsx +0 -263
- package/src/components/TkxStepper.tsx +0 -487
- package/src/components/TkxTable.tsx +0 -424
- package/src/components/TkxTabs.tsx +0 -126
- package/src/components/TkxTag.tsx +0 -321
- package/src/components/TkxThemeBuilder.tsx +0 -687
- package/src/components/TkxTimeline.tsx +0 -305
- package/src/components/TkxToast.tsx +0 -287
- package/src/components/TkxToggle.tsx +0 -95
- package/src/components/TkxToolbar.tsx +0 -262
- package/src/components/TkxTooltip.tsx +0 -85
- package/src/components/TkxTour.tsx +0 -241
- package/src/components/TkxTransferList.tsx +0 -489
- package/src/components/TkxTreeView.tsx +0 -423
- package/src/components/TkxTypography.tsx +0 -267
- package/src/components/TkxVideoPlayer.tsx +0 -1015
- package/src/components/TkxWatermark.tsx +0 -145
- package/src/components/index.ts +0 -80
- package/src/engine/css.ts +0 -126
- package/src/engine/index.ts +0 -12
- package/src/engine/quantum-ai.ts +0 -1045
- package/src/engine/quantum.ts +0 -207
- package/src/engine/security.ts +0 -232
- package/src/engine/tkx.ts +0 -1084
- package/src/engine/wcag.ts +0 -276
- package/src/headless/index.ts +0 -52
- package/src/headless/useControllable.ts +0 -42
- package/src/headless/useDebounce.ts +0 -37
- package/src/headless/useDisclosure.ts +0 -30
- package/src/headless/useFormState.ts +0 -113
- package/src/headless/useInfiniteQuery.ts +0 -155
- package/src/headless/useIntersectionObserver.ts +0 -53
- package/src/headless/useListSelection.ts +0 -103
- package/src/headless/useLocalStorage.ts +0 -48
- package/src/headless/useMediaQuery.ts +0 -39
- package/src/headless/useRovingTabIndex.ts +0 -86
- package/src/headless/useSSE.ts +0 -167
- package/src/headless/useThrottle.ts +0 -48
- package/src/headless/useWebSocket.ts +0 -231
- package/src/hooks/index.ts +0 -122
- package/src/i18n/I18nProvider.tsx +0 -36
- package/src/i18n/index.ts +0 -877
- package/src/quantum/index.ts +0 -39
- package/src/realtime/index.ts +0 -21
- package/src/styles/global.css +0 -167
- package/src/themes/index.ts +0 -294
package/dist/quantum.js
CHANGED
|
@@ -1,2551 +1,74 @@
|
|
|
1
|
-
import { f as e } from "./themes-BbJanqiC.js";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
this.qubits = Array.from({ length: e }, () => new f());
|
|
76
|
-
}
|
|
77
|
-
get size() {
|
|
78
|
-
return this.qubits.length;
|
|
79
|
-
}
|
|
80
|
-
getQubit(e) {
|
|
81
|
-
return this.qubits[e];
|
|
82
|
-
}
|
|
83
|
-
superpose() {
|
|
84
|
-
this.qubits = this.qubits.map((e) => e.hadamard());
|
|
85
|
-
}
|
|
86
|
-
cnot(e, t) {
|
|
87
|
-
let n = this.qubits[e], r = this.qubits[t], i = n.expectation();
|
|
88
|
-
this.qubits[t] = r.ry(Math.PI * i);
|
|
89
|
-
}
|
|
90
|
-
rotate(e, t) {
|
|
91
|
-
this.qubits[e] = this.qubits[e].ry(t);
|
|
92
|
-
}
|
|
93
|
-
measure() {
|
|
94
|
-
return this.qubits.map((e) => e.measure());
|
|
95
|
-
}
|
|
96
|
-
probs() {
|
|
97
|
-
return this.qubits.map((e) => e.expectation());
|
|
98
|
-
}
|
|
99
|
-
}, m = class {
|
|
100
|
-
constructor(e = 1, t = .995, n = .3, r = 1e-6) {
|
|
101
|
-
this.temperature = e, this.coolingRate = t, this.tunnelingStrength = n, this.minTemp = r;
|
|
102
|
-
}
|
|
103
|
-
anneal(e, t, n, r = 1e3) {
|
|
104
|
-
let i = e, a = t(i), o = i, s = a, c = this.temperature, l = 0, u = 0;
|
|
105
|
-
for (let e = 0; e < r && c > this.minTemp; e++) {
|
|
106
|
-
let e = n(i), r = t(e), d = r - a, f = !1;
|
|
107
|
-
if (d <= 0) f = !0;
|
|
108
|
-
else {
|
|
109
|
-
let e = Math.exp(-d / c), t = Math.sqrt(2 * Math.abs(d)), n = Math.abs(d), r = Math.exp(-2 * t * Math.sqrt(n) * this.tunnelingStrength);
|
|
110
|
-
Math.random() < e + r && (f = !0, Math.random() < r / (e + r + 1e-10) && u++);
|
|
111
|
-
}
|
|
112
|
-
f && (i = e, a = r, l++, a < s && (o = i, s = a)), c *= this.coolingRate;
|
|
113
|
-
}
|
|
114
|
-
return {
|
|
115
|
-
state: o,
|
|
116
|
-
energy: s,
|
|
117
|
-
iterations: r,
|
|
118
|
-
accepted: l,
|
|
119
|
-
tunnels: u
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
}, h = class {
|
|
123
|
-
constructor(e, t) {
|
|
124
|
-
let n = Math.sqrt(2 / (e + t));
|
|
125
|
-
this.weights = Array.from({ length: e }, () => Array.from({ length: t }, () => (Math.random() * 2 - 1) * n)), this.visibleBias = Array.from({ length: e }, () => 0), this.hiddenBias = Array.from({ length: t }, () => 0);
|
|
126
|
-
}
|
|
127
|
-
sigmoid(e) {
|
|
128
|
-
let t = (Math.random() - .5) * .1;
|
|
129
|
-
return 1 / (1 + Math.exp(-(e + t)));
|
|
130
|
-
}
|
|
131
|
-
sample(e) {
|
|
132
|
-
return +(Math.random() < e);
|
|
133
|
-
}
|
|
134
|
-
energy(e, t) {
|
|
135
|
-
let n = this.visibleBias.reduce((t, n, r) => t + n * e[r], 0), r = this.hiddenBias.reduce((e, n, r) => e + n * t[r], 0), i = 0;
|
|
136
|
-
for (let n = 0; n < e.length; n++) for (let r = 0; r < t.length; r++) i += e[n] * this.weights[n][r] * t[r];
|
|
137
|
-
return -(n + r + i);
|
|
138
|
-
}
|
|
139
|
-
hiddenProbs(e) {
|
|
140
|
-
return this.hiddenBias.map((t, n) => {
|
|
141
|
-
let r = t + e.reduce((e, t, r) => e + this.weights[r][n] * t, 0);
|
|
142
|
-
return this.sigmoid(r);
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
visibleProbs(e) {
|
|
146
|
-
return this.visibleBias.map((t, n) => {
|
|
147
|
-
let r = t + e.reduce((e, t, r) => e + this.weights[n][r] * t, 0);
|
|
148
|
-
return this.sigmoid(r);
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
gibbs(e, t = 1) {
|
|
152
|
-
let n = [...e], r = [];
|
|
153
|
-
for (let e = 0; e < t; e++) r = this.hiddenProbs(n).map((e) => this.sample(e)), n = this.visibleProbs(r).map((e) => this.sample(e));
|
|
154
|
-
return {
|
|
155
|
-
visible: n,
|
|
156
|
-
hidden: r
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
trainCD1(e, t = .01) {
|
|
160
|
-
let n = this.visibleBias.length, r = this.hiddenBias.length, i = Array.from({ length: n }, () => Array(r).fill(0)), a = Array(n).fill(0), o = Array(r).fill(0);
|
|
161
|
-
for (let t of e) {
|
|
162
|
-
let e = this.hiddenProbs(t), s = e.map((e) => this.sample(e)), c = this.visibleProbs(s).map((e) => this.sample(e)), l = this.hiddenProbs(c);
|
|
163
|
-
for (let o = 0; o < n; o++) {
|
|
164
|
-
for (let n = 0; n < r; n++) i[o][n] += t[o] * e[n] - c[o] * l[n];
|
|
165
|
-
a[o] += t[o] - c[o];
|
|
166
|
-
}
|
|
167
|
-
for (let t = 0; t < r; t++) o[t] += e[t] - l[t];
|
|
168
|
-
}
|
|
169
|
-
let s = e.length;
|
|
170
|
-
for (let e = 0; e < n; e++) {
|
|
171
|
-
for (let n = 0; n < r; n++) this.weights[e][n] += t * i[e][n] / s;
|
|
172
|
-
this.visibleBias[e] += t * a[e] / s;
|
|
173
|
-
}
|
|
174
|
-
for (let e = 0; e < r; e++) this.hiddenBias[e] += t * o[e] / s;
|
|
175
|
-
}
|
|
176
|
-
infer(e) {
|
|
177
|
-
let t = this.hiddenProbs(e), n = t.map((e) => this.sample(e));
|
|
178
|
-
return {
|
|
179
|
-
hidden: t,
|
|
180
|
-
visible: this.visibleProbs(n),
|
|
181
|
-
energy: this.energy(e, n),
|
|
182
|
-
iterations: 1
|
|
183
|
-
};
|
|
184
|
-
}
|
|
185
|
-
}, g = class {
|
|
186
|
-
amplify(e, t, n = .5) {
|
|
187
|
-
let r = e.length;
|
|
188
|
-
if (r === 0) return [];
|
|
189
|
-
let i = e.map(t), a = i.filter((e) => e > n).length, o = Math.max(1, a), s = Array(r).fill(1 / Math.sqrt(r)), c = Math.max(1, Math.floor(Math.PI / 4 * Math.sqrt(r / o)));
|
|
190
|
-
for (let e = 0; e < c; e++) {
|
|
191
|
-
for (let e = 0; e < r; e++) i[e] > n && (s[e] = -s[e]);
|
|
192
|
-
let e = s.reduce((e, t) => e + t, 0) / r;
|
|
193
|
-
s = s.map((t) => 2 * e - t);
|
|
194
|
-
}
|
|
195
|
-
return e.map((e, t) => ({
|
|
196
|
-
index: t,
|
|
197
|
-
amplitude: s[t],
|
|
198
|
-
probability: s[t] * s[t],
|
|
199
|
-
classicalSimilarity: i[t],
|
|
200
|
-
combined: s[t] * s[t] * .6 + i[t] * .4
|
|
201
|
-
})).sort((e, t) => t.combined - e.combined);
|
|
202
|
-
}
|
|
203
|
-
}, _ = [
|
|
204
|
-
{
|
|
205
|
-
keywords: [
|
|
206
|
-
"email",
|
|
207
|
-
"e-mail",
|
|
208
|
-
"mail"
|
|
209
|
-
],
|
|
210
|
-
type: "email",
|
|
211
|
-
validations: [
|
|
212
|
-
{
|
|
213
|
-
rule: "required",
|
|
214
|
-
message: "Email is required"
|
|
215
|
-
},
|
|
216
|
-
{
|
|
217
|
-
rule: "pattern",
|
|
218
|
-
value: "^[^@]+@[^@]+\\.[^@]+$",
|
|
219
|
-
message: "Enter a valid email address"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
rule: "maxLength",
|
|
223
|
-
value: 254,
|
|
224
|
-
message: "Email too long"
|
|
225
|
-
}
|
|
226
|
-
],
|
|
227
|
-
placeholder: "you@example.com",
|
|
228
|
-
label: "Email Address",
|
|
229
|
-
confidence: .98
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
keywords: [
|
|
233
|
-
"password",
|
|
234
|
-
"passwd",
|
|
235
|
-
"pwd",
|
|
236
|
-
"pass"
|
|
237
|
-
],
|
|
238
|
-
type: "password",
|
|
239
|
-
validations: [
|
|
240
|
-
{
|
|
241
|
-
rule: "required",
|
|
242
|
-
message: "Password is required"
|
|
243
|
-
},
|
|
244
|
-
{
|
|
245
|
-
rule: "minLength",
|
|
246
|
-
value: 8,
|
|
247
|
-
message: "Password must be at least 8 characters"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
rule: "pattern",
|
|
251
|
-
value: "(?=.*[A-Z])(?=.*[0-9])",
|
|
252
|
-
message: "Include uppercase and a number"
|
|
253
|
-
}
|
|
254
|
-
],
|
|
255
|
-
placeholder: "••••••••",
|
|
256
|
-
label: "Password",
|
|
257
|
-
confidence: .97
|
|
258
|
-
},
|
|
259
|
-
{
|
|
260
|
-
keywords: [
|
|
261
|
-
"confirm_password",
|
|
262
|
-
"confirmpassword",
|
|
263
|
-
"confirm_pass",
|
|
264
|
-
"repassword",
|
|
265
|
-
"password2",
|
|
266
|
-
"repeat_password"
|
|
267
|
-
],
|
|
268
|
-
type: "password",
|
|
269
|
-
validations: [{
|
|
270
|
-
rule: "required",
|
|
271
|
-
message: "Please confirm your password"
|
|
272
|
-
}, {
|
|
273
|
-
rule: "match",
|
|
274
|
-
value: "password",
|
|
275
|
-
message: "Passwords do not match"
|
|
276
|
-
}],
|
|
277
|
-
placeholder: "••••••••",
|
|
278
|
-
label: "Confirm Password",
|
|
279
|
-
confidence: .95
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
keywords: [
|
|
283
|
-
"phone",
|
|
284
|
-
"mobile",
|
|
285
|
-
"cell",
|
|
286
|
-
"tel",
|
|
287
|
-
"telephone",
|
|
288
|
-
"contact_number"
|
|
289
|
-
],
|
|
290
|
-
type: "tel",
|
|
291
|
-
validations: [{
|
|
292
|
-
rule: "pattern",
|
|
293
|
-
value: "^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$",
|
|
294
|
-
message: "Enter a valid phone number"
|
|
295
|
-
}],
|
|
296
|
-
placeholder: "+1 (555) 000-0000",
|
|
297
|
-
label: "Phone Number",
|
|
298
|
-
confidence: .93
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
keywords: ["age"],
|
|
302
|
-
type: "number",
|
|
303
|
-
validations: [
|
|
304
|
-
{
|
|
305
|
-
rule: "min",
|
|
306
|
-
value: 0,
|
|
307
|
-
message: "Age cannot be negative"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
rule: "max",
|
|
311
|
-
value: 150,
|
|
312
|
-
message: "Enter a valid age"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
rule: "integer",
|
|
316
|
-
message: "Age must be a whole number"
|
|
317
|
-
}
|
|
318
|
-
],
|
|
319
|
-
placeholder: "25",
|
|
320
|
-
label: "Age",
|
|
321
|
-
confidence: .9
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
keywords: [
|
|
325
|
-
"price",
|
|
326
|
-
"amount",
|
|
327
|
-
"cost",
|
|
328
|
-
"fee",
|
|
329
|
-
"payment",
|
|
330
|
-
"salary",
|
|
331
|
-
"wage",
|
|
332
|
-
"total"
|
|
333
|
-
],
|
|
334
|
-
type: "number",
|
|
335
|
-
validations: [{
|
|
336
|
-
rule: "min",
|
|
337
|
-
value: 0,
|
|
338
|
-
message: "Amount cannot be negative"
|
|
339
|
-
}, {
|
|
340
|
-
rule: "pattern",
|
|
341
|
-
value: "^\\d+(\\.\\d{1,2})?$",
|
|
342
|
-
message: "Enter a valid amount (e.g. 9.99)"
|
|
343
|
-
}],
|
|
344
|
-
placeholder: "0.00",
|
|
345
|
-
label: "Amount",
|
|
346
|
-
confidence: .88
|
|
347
|
-
},
|
|
348
|
-
{
|
|
349
|
-
keywords: [
|
|
350
|
-
"url",
|
|
351
|
-
"website",
|
|
352
|
-
"site",
|
|
353
|
-
"link",
|
|
354
|
-
"homepage",
|
|
355
|
-
"web"
|
|
356
|
-
],
|
|
357
|
-
type: "url",
|
|
358
|
-
validations: [{
|
|
359
|
-
rule: "pattern",
|
|
360
|
-
value: "https?://.+",
|
|
361
|
-
message: "Enter a valid URL starting with http:// or https://"
|
|
362
|
-
}],
|
|
363
|
-
placeholder: "https://example.com",
|
|
364
|
-
label: "Website URL",
|
|
365
|
-
confidence: .92
|
|
366
|
-
},
|
|
367
|
-
{
|
|
368
|
-
keywords: [
|
|
369
|
-
"zip",
|
|
370
|
-
"zipcode",
|
|
371
|
-
"postal",
|
|
372
|
-
"postcode",
|
|
373
|
-
"pin_code"
|
|
374
|
-
],
|
|
375
|
-
type: "text",
|
|
376
|
-
validations: [{
|
|
377
|
-
rule: "pattern",
|
|
378
|
-
value: "^[0-9]{5}(-[0-9]{4})?$",
|
|
379
|
-
message: "Enter a valid ZIP code (e.g. 12345)"
|
|
380
|
-
}],
|
|
381
|
-
placeholder: "12345",
|
|
382
|
-
label: "ZIP / Postal Code",
|
|
383
|
-
confidence: .91
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
keywords: [
|
|
387
|
-
"date",
|
|
388
|
-
"dob",
|
|
389
|
-
"birthday",
|
|
390
|
-
"birth_date",
|
|
391
|
-
"birthdate",
|
|
392
|
-
"born"
|
|
393
|
-
],
|
|
394
|
-
type: "date",
|
|
395
|
-
validations: [{
|
|
396
|
-
rule: "required",
|
|
397
|
-
message: "Date is required"
|
|
398
|
-
}],
|
|
399
|
-
placeholder: "YYYY-MM-DD",
|
|
400
|
-
label: "Date of Birth",
|
|
401
|
-
confidence: .89
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
keywords: [
|
|
405
|
-
"first_name",
|
|
406
|
-
"firstname",
|
|
407
|
-
"fname",
|
|
408
|
-
"given_name"
|
|
409
|
-
],
|
|
410
|
-
type: "text",
|
|
411
|
-
validations: [{
|
|
412
|
-
rule: "minLength",
|
|
413
|
-
value: 2,
|
|
414
|
-
message: "First name too short"
|
|
415
|
-
}, {
|
|
416
|
-
rule: "maxLength",
|
|
417
|
-
value: 50,
|
|
418
|
-
message: "First name too long"
|
|
419
|
-
}],
|
|
420
|
-
placeholder: "Jane",
|
|
421
|
-
label: "First Name",
|
|
422
|
-
confidence: .9
|
|
423
|
-
},
|
|
424
|
-
{
|
|
425
|
-
keywords: [
|
|
426
|
-
"last_name",
|
|
427
|
-
"lastname",
|
|
428
|
-
"lname",
|
|
429
|
-
"surname",
|
|
430
|
-
"family_name"
|
|
431
|
-
],
|
|
432
|
-
type: "text",
|
|
433
|
-
validations: [{
|
|
434
|
-
rule: "minLength",
|
|
435
|
-
value: 2,
|
|
436
|
-
message: "Last name too short"
|
|
437
|
-
}, {
|
|
438
|
-
rule: "maxLength",
|
|
439
|
-
value: 50,
|
|
440
|
-
message: "Last name too long"
|
|
441
|
-
}],
|
|
442
|
-
placeholder: "Doe",
|
|
443
|
-
label: "Last Name",
|
|
444
|
-
confidence: .9
|
|
445
|
-
},
|
|
446
|
-
{
|
|
447
|
-
keywords: [
|
|
448
|
-
"name",
|
|
449
|
-
"full_name",
|
|
450
|
-
"fullname",
|
|
451
|
-
"display_name"
|
|
452
|
-
],
|
|
453
|
-
type: "text",
|
|
454
|
-
validations: [{
|
|
455
|
-
rule: "minLength",
|
|
456
|
-
value: 2,
|
|
457
|
-
message: "Name too short"
|
|
458
|
-
}, {
|
|
459
|
-
rule: "maxLength",
|
|
460
|
-
value: 100,
|
|
461
|
-
message: "Name too long"
|
|
462
|
-
}],
|
|
463
|
-
placeholder: "Jane Doe",
|
|
464
|
-
label: "Full Name",
|
|
465
|
-
confidence: .85
|
|
466
|
-
},
|
|
467
|
-
{
|
|
468
|
-
keywords: [
|
|
469
|
-
"username",
|
|
470
|
-
"user_name",
|
|
471
|
-
"handle",
|
|
472
|
-
"login",
|
|
473
|
-
"loginname"
|
|
474
|
-
],
|
|
475
|
-
type: "text",
|
|
476
|
-
validations: [
|
|
477
|
-
{
|
|
478
|
-
rule: "minLength",
|
|
479
|
-
value: 3,
|
|
480
|
-
message: "Username must be at least 3 characters"
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
rule: "maxLength",
|
|
484
|
-
value: 32,
|
|
485
|
-
message: "Username too long"
|
|
486
|
-
},
|
|
487
|
-
{
|
|
488
|
-
rule: "pattern",
|
|
489
|
-
value: "^[a-zA-Z0-9_.-]+$",
|
|
490
|
-
message: "Only letters, numbers, _, - and . allowed"
|
|
491
|
-
}
|
|
492
|
-
],
|
|
493
|
-
placeholder: "cooluser42",
|
|
494
|
-
label: "Username",
|
|
495
|
-
confidence: .94
|
|
496
|
-
},
|
|
497
|
-
{
|
|
498
|
-
keywords: [
|
|
499
|
-
"bio",
|
|
500
|
-
"biography",
|
|
501
|
-
"about",
|
|
502
|
-
"description",
|
|
503
|
-
"summary",
|
|
504
|
-
"details"
|
|
505
|
-
],
|
|
506
|
-
type: "textarea",
|
|
507
|
-
validations: [{
|
|
508
|
-
rule: "maxLength",
|
|
509
|
-
value: 500,
|
|
510
|
-
message: "Bio must be under 500 characters"
|
|
511
|
-
}],
|
|
512
|
-
placeholder: "Tell us about yourself...",
|
|
513
|
-
label: "Bio",
|
|
514
|
-
confidence: .87
|
|
515
|
-
},
|
|
516
|
-
{
|
|
517
|
-
keywords: [
|
|
518
|
-
"message",
|
|
519
|
-
"comment",
|
|
520
|
-
"feedback",
|
|
521
|
-
"note",
|
|
522
|
-
"notes",
|
|
523
|
-
"remarks",
|
|
524
|
-
"body"
|
|
525
|
-
],
|
|
526
|
-
type: "textarea",
|
|
527
|
-
validations: [{
|
|
528
|
-
rule: "minLength",
|
|
529
|
-
value: 10,
|
|
530
|
-
message: "Message too short"
|
|
531
|
-
}, {
|
|
532
|
-
rule: "maxLength",
|
|
533
|
-
value: 2e3,
|
|
534
|
-
message: "Message too long"
|
|
535
|
-
}],
|
|
536
|
-
placeholder: "Write your message here...",
|
|
537
|
-
label: "Message",
|
|
538
|
-
confidence: .86
|
|
539
|
-
},
|
|
540
|
-
{
|
|
541
|
-
keywords: [
|
|
542
|
-
"search",
|
|
543
|
-
"query",
|
|
544
|
-
"q",
|
|
545
|
-
"keyword",
|
|
546
|
-
"find"
|
|
547
|
-
],
|
|
548
|
-
type: "search",
|
|
549
|
-
validations: [],
|
|
550
|
-
placeholder: "Search...",
|
|
551
|
-
label: "Search",
|
|
552
|
-
confidence: .9
|
|
553
|
-
},
|
|
554
|
-
{
|
|
555
|
-
keywords: [
|
|
556
|
-
"otp",
|
|
557
|
-
"one_time_password",
|
|
558
|
-
"verification_code",
|
|
559
|
-
"pin",
|
|
560
|
-
"code"
|
|
561
|
-
],
|
|
562
|
-
type: "text",
|
|
563
|
-
validations: [
|
|
564
|
-
{
|
|
565
|
-
rule: "minLength",
|
|
566
|
-
value: 4,
|
|
567
|
-
message: "Code too short"
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
rule: "maxLength",
|
|
571
|
-
value: 8,
|
|
572
|
-
message: "Code too long"
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
rule: "pattern",
|
|
576
|
-
value: "^[0-9]+$",
|
|
577
|
-
message: "Code must be numeric"
|
|
578
|
-
}
|
|
579
|
-
],
|
|
580
|
-
placeholder: "123456",
|
|
581
|
-
label: "Verification Code",
|
|
582
|
-
confidence: .92
|
|
583
|
-
},
|
|
584
|
-
{
|
|
585
|
-
keywords: [
|
|
586
|
-
"color",
|
|
587
|
-
"colour",
|
|
588
|
-
"hex_color",
|
|
589
|
-
"brand_color"
|
|
590
|
-
],
|
|
591
|
-
type: "color",
|
|
592
|
-
validations: [],
|
|
593
|
-
placeholder: "#3b82f6",
|
|
594
|
-
label: "Color",
|
|
595
|
-
confidence: .95
|
|
596
|
-
},
|
|
597
|
-
{
|
|
598
|
-
keywords: [
|
|
599
|
-
"address",
|
|
600
|
-
"street",
|
|
601
|
-
"street_address",
|
|
602
|
-
"addr"
|
|
603
|
-
],
|
|
604
|
-
type: "text",
|
|
605
|
-
validations: [{
|
|
606
|
-
rule: "maxLength",
|
|
607
|
-
value: 200,
|
|
608
|
-
message: "Address too long"
|
|
609
|
-
}],
|
|
610
|
-
placeholder: "123 Main Street",
|
|
611
|
-
label: "Street Address",
|
|
612
|
-
confidence: .87
|
|
613
|
-
},
|
|
614
|
-
{
|
|
615
|
-
keywords: [
|
|
616
|
-
"city",
|
|
617
|
-
"town",
|
|
618
|
-
"municipality"
|
|
619
|
-
],
|
|
620
|
-
type: "text",
|
|
621
|
-
validations: [{
|
|
622
|
-
rule: "maxLength",
|
|
623
|
-
value: 100,
|
|
624
|
-
message: "City name too long"
|
|
625
|
-
}],
|
|
626
|
-
placeholder: "San Francisco",
|
|
627
|
-
label: "City",
|
|
628
|
-
confidence: .89
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
keywords: [
|
|
632
|
-
"country",
|
|
633
|
-
"nation",
|
|
634
|
-
"country_code"
|
|
635
|
-
],
|
|
636
|
-
type: "text",
|
|
637
|
-
validations: [],
|
|
638
|
-
placeholder: "United States",
|
|
639
|
-
label: "Country",
|
|
640
|
-
confidence: .88
|
|
641
|
-
},
|
|
642
|
-
{
|
|
643
|
-
keywords: [
|
|
644
|
-
"company",
|
|
645
|
-
"organization",
|
|
646
|
-
"org",
|
|
647
|
-
"employer",
|
|
648
|
-
"company_name"
|
|
649
|
-
],
|
|
650
|
-
type: "text",
|
|
651
|
-
validations: [{
|
|
652
|
-
rule: "maxLength",
|
|
653
|
-
value: 200,
|
|
654
|
-
message: "Company name too long"
|
|
655
|
-
}],
|
|
656
|
-
placeholder: "Acme Inc.",
|
|
657
|
-
label: "Company",
|
|
658
|
-
confidence: .87
|
|
659
|
-
}
|
|
660
|
-
];
|
|
661
|
-
function v(e) {
|
|
662
|
-
let t = e.toLowerCase().replace(/[\s-]/g, "_"), n = new g().amplify(_, (e) => {
|
|
663
|
-
let n = 0;
|
|
664
|
-
for (let r of e.keywords) t === r ? n = Math.max(n, 1) : t.includes(r) || r.includes(t) ? n = Math.max(n, .8) : r.split("_").some((e) => t.includes(e)) && (n = Math.max(n, .5));
|
|
665
|
-
return n;
|
|
666
|
-
}, .3);
|
|
667
|
-
if (n.length > 0 && n[0].combined > .1) {
|
|
668
|
-
let e = _[n[0].index];
|
|
669
|
-
return {
|
|
670
|
-
type: e.type,
|
|
671
|
-
validations: e.validations,
|
|
672
|
-
placeholder: e.placeholder,
|
|
673
|
-
confidence: Math.min(e.confidence * n[0].combined * 2, .99),
|
|
674
|
-
label: e.label
|
|
675
|
-
};
|
|
676
|
-
}
|
|
677
|
-
return {
|
|
678
|
-
type: "text",
|
|
679
|
-
validations: [{
|
|
680
|
-
rule: "maxLength",
|
|
681
|
-
value: 255,
|
|
682
|
-
message: "Input too long"
|
|
683
|
-
}],
|
|
684
|
-
placeholder: e.replace(/_/g, " "),
|
|
685
|
-
confidence: .3,
|
|
686
|
-
label: e.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase())
|
|
687
|
-
};
|
|
688
|
-
}
|
|
689
|
-
function y(e, t, n) {
|
|
690
|
-
let r = t / 100, i = n / 100, a = r * Math.min(i, 1 - i), o = (t) => {
|
|
691
|
-
let n = (t + e / 30) % 12, r = i - a * Math.max(Math.min(n - 3, 9 - n, 1), -1);
|
|
692
|
-
return Math.round(255 * r).toString(16).padStart(2, "0");
|
|
693
|
-
};
|
|
694
|
-
return `#${o(0)}${o(8)}${o(4)}`;
|
|
695
|
-
}
|
|
696
|
-
function b(e) {
|
|
697
|
-
let t = e.replace("#", ""), n = t.length === 3 ? t.split("").map((e) => e + e).join("") : t;
|
|
698
|
-
return [
|
|
699
|
-
parseInt(n.slice(0, 2), 16),
|
|
700
|
-
parseInt(n.slice(2, 4), 16),
|
|
701
|
-
parseInt(n.slice(4, 6), 16)
|
|
702
|
-
];
|
|
703
|
-
}
|
|
704
|
-
function x(e) {
|
|
705
|
-
let [t, n, r] = b(e).map((e) => {
|
|
706
|
-
let t = e / 255;
|
|
707
|
-
return t <= .03928 ? t / 12.92 : ((t + .055) / 1.055) ** 2.4;
|
|
708
|
-
});
|
|
709
|
-
return .2126 * t + .7152 * n + .0722 * r;
|
|
710
|
-
}
|
|
711
|
-
function S(e, t) {
|
|
712
|
-
let n = x(e), r = x(t), i = Math.max(n, r), a = Math.min(n, r);
|
|
713
|
-
return (i + .05) / (a + .05);
|
|
714
|
-
}
|
|
715
|
-
function C(e, t) {
|
|
716
|
-
let n = (e) => y(e.h, e.s, e.l), r = t ? e.text.l - 20 : e.text.l + 15;
|
|
717
|
-
return {
|
|
718
|
-
primary: n(e.primary),
|
|
719
|
-
secondary: n(e.secondary),
|
|
720
|
-
background: n(e.bg),
|
|
721
|
-
surface: n(e.surface),
|
|
722
|
-
text: n(e.text),
|
|
723
|
-
textMuted: y(e.text.h, Math.max(0, e.text.s - 10), Math.max(20, Math.min(85, r))),
|
|
724
|
-
border: n(e.border),
|
|
725
|
-
error: t ? "#f87171" : "#dc2626",
|
|
726
|
-
warning: t ? "#fbbf24" : "#d97706",
|
|
727
|
-
success: t ? "#34d399" : "#059669",
|
|
728
|
-
accent: n(e.accent)
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
function w(e, t) {
|
|
732
|
-
let n = 0, r = (e) => y(e.h, e.s, e.l), i = r(e.text), a = r(e.bg), o = r(e.surface), s = r(e.primary), c = S(i, a), l = S(i, o), u = S(s, a);
|
|
733
|
-
c < 4.5 && (n += (4.5 - c) * 10), l < 4.5 && (n += (4.5 - l) * 8), u < 3 && (n += (3 - u) * 5);
|
|
734
|
-
let d = Math.abs((e.secondary.h - e.primary.h + 360) % 360 - 137.508);
|
|
735
|
-
n += d * .05;
|
|
736
|
-
let f = Math.abs((e.accent.h - e.primary.h + 360) % 360 - 120);
|
|
737
|
-
n += f * .03;
|
|
738
|
-
let p = (e.primary.s + e.secondary.s) / 2;
|
|
739
|
-
p < 20 && (n += (20 - p) * .5), p > 90 && (n += (p - 90) * .5);
|
|
740
|
-
let m = e.bg.l;
|
|
741
|
-
t ? (m > 25 && (n += (m - 25) * 2), m < 3 && (n += (3 - m) * 2), e.text.l < 70 && (n += (70 - e.text.l) * 1.5)) : (m < 90 && (n += (90 - m) * 2), m > 100 && (n += (m - 100) * 2), e.text.l > 30 && (n += (e.text.l - 30) * 1.5));
|
|
742
|
-
let h = Math.abs(e.surface.l - e.bg.l);
|
|
743
|
-
return h < 2 && (n += (2 - h) * 2), h > 12 && (n += (h - 12) * 1), n;
|
|
744
|
-
}
|
|
745
|
-
function T(e, t, n) {
|
|
746
|
-
return Math.max(t, Math.min(n, e));
|
|
747
|
-
}
|
|
748
|
-
function E(e, t, n = 800) {
|
|
749
|
-
let r = t ? {
|
|
750
|
-
primary: {
|
|
751
|
-
h: e,
|
|
752
|
-
s: 70,
|
|
753
|
-
l: 55
|
|
754
|
-
},
|
|
755
|
-
secondary: {
|
|
756
|
-
h: (e + 137.5) % 360,
|
|
757
|
-
s: 65,
|
|
758
|
-
l: 50
|
|
759
|
-
},
|
|
760
|
-
bg: {
|
|
761
|
-
h: e,
|
|
762
|
-
s: 10,
|
|
763
|
-
l: 8
|
|
764
|
-
},
|
|
765
|
-
surface: {
|
|
766
|
-
h: e,
|
|
767
|
-
s: 10,
|
|
768
|
-
l: 13
|
|
769
|
-
},
|
|
770
|
-
text: {
|
|
771
|
-
h: e,
|
|
772
|
-
s: 15,
|
|
773
|
-
l: 90
|
|
774
|
-
},
|
|
775
|
-
border: {
|
|
776
|
-
h: e,
|
|
777
|
-
s: 15,
|
|
778
|
-
l: 22
|
|
779
|
-
},
|
|
780
|
-
accent: {
|
|
781
|
-
h: (e + 120) % 360,
|
|
782
|
-
s: 75,
|
|
783
|
-
l: 60
|
|
784
|
-
}
|
|
785
|
-
} : {
|
|
786
|
-
primary: {
|
|
787
|
-
h: e,
|
|
788
|
-
s: 65,
|
|
789
|
-
l: 40
|
|
790
|
-
},
|
|
791
|
-
secondary: {
|
|
792
|
-
h: (e + 137.5) % 360,
|
|
793
|
-
s: 55,
|
|
794
|
-
l: 38
|
|
795
|
-
},
|
|
796
|
-
bg: {
|
|
797
|
-
h: e,
|
|
798
|
-
s: 15,
|
|
799
|
-
l: 97
|
|
800
|
-
},
|
|
801
|
-
surface: {
|
|
802
|
-
h: e,
|
|
803
|
-
s: 12,
|
|
804
|
-
l: 100
|
|
805
|
-
},
|
|
806
|
-
text: {
|
|
807
|
-
h: e,
|
|
808
|
-
s: 15,
|
|
809
|
-
l: 12
|
|
810
|
-
},
|
|
811
|
-
border: {
|
|
812
|
-
h: e,
|
|
813
|
-
s: 12,
|
|
814
|
-
l: 85
|
|
815
|
-
},
|
|
816
|
-
accent: {
|
|
817
|
-
h: (e + 120) % 360,
|
|
818
|
-
s: 70,
|
|
819
|
-
l: 42
|
|
820
|
-
}
|
|
821
|
-
};
|
|
822
|
-
return C(new m(1.5, .994, .35, 1e-5).anneal(r, (e) => w(e, t), (e) => {
|
|
823
|
-
let t = [
|
|
824
|
-
"primary",
|
|
825
|
-
"secondary",
|
|
826
|
-
"bg",
|
|
827
|
-
"surface",
|
|
828
|
-
"text",
|
|
829
|
-
"border",
|
|
830
|
-
"accent"
|
|
831
|
-
], n = t[Math.floor(Math.random() * t.length)], r = [
|
|
832
|
-
"h",
|
|
833
|
-
"s",
|
|
834
|
-
"l"
|
|
835
|
-
], i = r[Math.floor(Math.random() * r.length)], a = (Math.random() - .5) * (i === "h" ? 30 : 15), o = {
|
|
836
|
-
...e,
|
|
837
|
-
[n]: { ...e[n] }
|
|
838
|
-
};
|
|
839
|
-
return i === "h" ? o[n] = {
|
|
840
|
-
...o[n],
|
|
841
|
-
h: (e[n].h + a + 360) % 360
|
|
842
|
-
} : i === "s" ? o[n] = {
|
|
843
|
-
...o[n],
|
|
844
|
-
s: T(e[n].s + a, 0, 100)
|
|
845
|
-
} : o[n] = {
|
|
846
|
-
...o[n],
|
|
847
|
-
l: T(e[n].l + a, 0, 100)
|
|
848
|
-
}, o;
|
|
849
|
-
}, n).state, t);
|
|
850
|
-
}
|
|
851
|
-
var D = {
|
|
852
|
-
qubit() {
|
|
853
|
-
return new f();
|
|
854
|
-
},
|
|
855
|
-
register(e) {
|
|
856
|
-
return new p(e);
|
|
857
|
-
},
|
|
858
|
-
annealer(e, t, n) {
|
|
859
|
-
return new m(e, t, n);
|
|
860
|
-
},
|
|
861
|
-
qbm(e, t) {
|
|
862
|
-
return new h(e, t);
|
|
863
|
-
},
|
|
864
|
-
amplifier() {
|
|
865
|
-
return new g();
|
|
866
|
-
},
|
|
867
|
-
inferField: v,
|
|
868
|
-
optimizeTheme: E,
|
|
869
|
-
contrast: S,
|
|
870
|
-
hslToHex: y
|
|
871
|
-
};
|
|
872
|
-
//#endregion
|
|
873
|
-
//#region src/components/TkxQuantumForm.tsx
|
|
874
|
-
function O(e, t, n, r) {
|
|
875
|
-
let i = n.trim();
|
|
876
|
-
switch (e) {
|
|
877
|
-
case "required": return i !== "";
|
|
878
|
-
case "email":
|
|
879
|
-
case "pattern":
|
|
880
|
-
if (typeof t == "string") try {
|
|
881
|
-
return i === "" || new RegExp(t).test(i);
|
|
882
|
-
} catch {
|
|
883
|
-
return !0;
|
|
884
|
-
}
|
|
885
|
-
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(i);
|
|
886
|
-
case "phone": return i === "" || /^\+?[\d\s\-()]{7,15}$/.test(i);
|
|
887
|
-
case "url": return i === "" || /^https?:\/\/.+/.test(i);
|
|
888
|
-
case "minLength":
|
|
889
|
-
case "min": {
|
|
890
|
-
let e = Number(t ?? 0);
|
|
891
|
-
return i === "" || (isNaN(Number(i)) ? i.length >= e : Number(i) >= e);
|
|
892
|
-
}
|
|
893
|
-
case "maxLength":
|
|
894
|
-
case "max": {
|
|
895
|
-
let e = Number(t ?? Infinity);
|
|
896
|
-
return i === "" || (isNaN(Number(i)) ? i.length <= e : Number(i) <= e);
|
|
897
|
-
}
|
|
898
|
-
case "integer": return i === "" || /^\d+$/.test(i);
|
|
899
|
-
case "alphanumeric": return i === "" || /^[a-zA-Z0-9]+$/.test(i);
|
|
900
|
-
case "match": return i === (r[typeof t == "string" ? t : "password"] ?? "");
|
|
901
|
-
default: return !0;
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
function k({ phase: e, collapsed: t, primaryColor: n, borderColor: r }) {
|
|
905
|
-
let i = t ? 0 : e, a = t ? 0 : e * 1.618, o = 12 + 10 * Math.sin(i) * Math.cos(a), s = 12 - 10 * Math.cos(i);
|
|
906
|
-
return /* @__PURE__ */ u("svg", {
|
|
907
|
-
width: "24",
|
|
908
|
-
height: "24",
|
|
909
|
-
viewBox: "0 0 24 24",
|
|
910
|
-
"aria-hidden": "true",
|
|
911
|
-
style: {
|
|
912
|
-
flexShrink: 0,
|
|
913
|
-
opacity: t ? .4 : 1,
|
|
914
|
-
transition: "opacity 0.6s"
|
|
915
|
-
},
|
|
916
|
-
children: [
|
|
917
|
-
/* @__PURE__ */ l("circle", {
|
|
918
|
-
cx: 12,
|
|
919
|
-
cy: 12,
|
|
920
|
-
r: 10,
|
|
921
|
-
fill: "none",
|
|
922
|
-
stroke: r,
|
|
923
|
-
strokeWidth: "0.8"
|
|
924
|
-
}),
|
|
925
|
-
/* @__PURE__ */ l("ellipse", {
|
|
926
|
-
cx: 12,
|
|
927
|
-
cy: 12,
|
|
928
|
-
rx: 10,
|
|
929
|
-
ry: 10 * .3,
|
|
930
|
-
fill: "none",
|
|
931
|
-
stroke: r,
|
|
932
|
-
strokeWidth: "0.5",
|
|
933
|
-
strokeDasharray: "2 2"
|
|
934
|
-
}),
|
|
935
|
-
/* @__PURE__ */ l("line", {
|
|
936
|
-
x1: 12,
|
|
937
|
-
y1: 2,
|
|
938
|
-
x2: 12,
|
|
939
|
-
y2: 22,
|
|
940
|
-
stroke: r,
|
|
941
|
-
strokeWidth: "0.5"
|
|
942
|
-
}),
|
|
943
|
-
/* @__PURE__ */ l("line", {
|
|
944
|
-
x1: 12,
|
|
945
|
-
y1: 12,
|
|
946
|
-
x2: o,
|
|
947
|
-
y2: s,
|
|
948
|
-
stroke: n,
|
|
949
|
-
strokeWidth: "1.5",
|
|
950
|
-
style: { transition: t ? "all 0.6s ease-out" : "none" }
|
|
951
|
-
}),
|
|
952
|
-
/* @__PURE__ */ l("circle", {
|
|
953
|
-
cx: o,
|
|
954
|
-
cy: s,
|
|
955
|
-
r: "2",
|
|
956
|
-
fill: n,
|
|
957
|
-
style: { transition: t ? "all 0.6s ease-out" : "none" }
|
|
958
|
-
})
|
|
959
|
-
]
|
|
960
|
-
});
|
|
961
|
-
}
|
|
962
|
-
function A({ confidence: e, theme: t }) {
|
|
963
|
-
let n = Math.round(e * 100), r = n >= 80 ? t.success : n >= 60 ? t.warning : t.danger;
|
|
964
|
-
return /* @__PURE__ */ u("span", {
|
|
965
|
-
style: {
|
|
966
|
-
display: "inline-flex",
|
|
967
|
-
alignItems: "center",
|
|
968
|
-
gap: "2px",
|
|
969
|
-
fontSize: "10px",
|
|
970
|
-
fontWeight: 600,
|
|
971
|
-
padding: "1px 5px",
|
|
972
|
-
borderRadius: "999px",
|
|
973
|
-
backgroundColor: `${r}22`,
|
|
974
|
-
color: r,
|
|
975
|
-
border: `1px solid ${r}44`,
|
|
976
|
-
marginLeft: "6px",
|
|
977
|
-
verticalAlign: "middle",
|
|
978
|
-
letterSpacing: "0.03em"
|
|
979
|
-
},
|
|
980
|
-
children: [
|
|
981
|
-
"⚛ ",
|
|
982
|
-
n,
|
|
983
|
-
"%"
|
|
984
|
-
]
|
|
985
|
-
});
|
|
986
|
-
}
|
|
987
|
-
function j({ config: e, intel: t, qubitPhase: r, value: i, error: a, touched: o, showConfidence: s, showQuantumState: c, collapsed: d, onChange: f, onBlur: p, theme: m, mounted: h, index: g }) {
|
|
988
|
-
let _ = e.type ?? t.type, v = e.label ?? t.label, y = e.placeholder ?? t.placeholder, b = e.required === void 0 ? t.validations.some((e) => e.rule === "required") : e.required, x = n(v), S = _ === "textarea", C = o && a !== "", w = `qf-${e.name}`, T = {
|
|
989
|
-
width: "100%",
|
|
990
|
-
padding: "9px 12px",
|
|
991
|
-
border: `1.5px solid ${C ? m.danger : m.border}`,
|
|
992
|
-
borderRadius: "8px",
|
|
993
|
-
backgroundColor: m.surface,
|
|
994
|
-
color: m.text,
|
|
995
|
-
fontSize: "14px",
|
|
996
|
-
fontFamily: "inherit",
|
|
997
|
-
outline: "none",
|
|
998
|
-
boxSizing: "border-box",
|
|
999
|
-
transition: "border-color 0.15s, box-shadow 0.15s",
|
|
1000
|
-
resize: S ? "vertical" : void 0,
|
|
1001
|
-
minHeight: S ? "80px" : void 0
|
|
1002
|
-
};
|
|
1003
|
-
return /* @__PURE__ */ u("div", {
|
|
1004
|
-
style: {
|
|
1005
|
-
display: "flex",
|
|
1006
|
-
flexDirection: "column",
|
|
1007
|
-
gap: "4px",
|
|
1008
|
-
opacity: +!!h,
|
|
1009
|
-
transform: h ? "scaleY(1)" : "scaleY(0.92)",
|
|
1010
|
-
transition: `opacity 0.35s ease ${g * 60}ms, transform 0.35s ease ${g * 60}ms`,
|
|
1011
|
-
transformOrigin: "top"
|
|
1012
|
-
},
|
|
1013
|
-
children: [
|
|
1014
|
-
/* @__PURE__ */ u("div", {
|
|
1015
|
-
style: {
|
|
1016
|
-
display: "flex",
|
|
1017
|
-
alignItems: "center",
|
|
1018
|
-
gap: "4px"
|
|
1019
|
-
},
|
|
1020
|
-
children: [
|
|
1021
|
-
c && /* @__PURE__ */ l(k, {
|
|
1022
|
-
phase: r,
|
|
1023
|
-
collapsed: d,
|
|
1024
|
-
primaryColor: m.primary,
|
|
1025
|
-
borderColor: m.border
|
|
1026
|
-
}),
|
|
1027
|
-
/* @__PURE__ */ u("label", {
|
|
1028
|
-
htmlFor: w,
|
|
1029
|
-
style: {
|
|
1030
|
-
fontSize: "13px",
|
|
1031
|
-
fontWeight: 500,
|
|
1032
|
-
color: m.text,
|
|
1033
|
-
cursor: "pointer"
|
|
1034
|
-
},
|
|
1035
|
-
children: [x, b && /* @__PURE__ */ l("span", {
|
|
1036
|
-
"aria-hidden": "true",
|
|
1037
|
-
style: {
|
|
1038
|
-
color: m.danger,
|
|
1039
|
-
marginLeft: "3px"
|
|
1040
|
-
},
|
|
1041
|
-
children: "*"
|
|
1042
|
-
})]
|
|
1043
|
-
}),
|
|
1044
|
-
s && /* @__PURE__ */ l(A, {
|
|
1045
|
-
confidence: t.confidence,
|
|
1046
|
-
theme: m
|
|
1047
|
-
})
|
|
1048
|
-
]
|
|
1049
|
-
}),
|
|
1050
|
-
S ? /* @__PURE__ */ l("textarea", {
|
|
1051
|
-
id: w,
|
|
1052
|
-
value: i,
|
|
1053
|
-
onChange: (e) => f(e.target.value),
|
|
1054
|
-
onBlur: p,
|
|
1055
|
-
placeholder: y,
|
|
1056
|
-
"aria-invalid": C,
|
|
1057
|
-
"aria-required": b,
|
|
1058
|
-
style: T
|
|
1059
|
-
}) : /* @__PURE__ */ l("input", {
|
|
1060
|
-
id: w,
|
|
1061
|
-
type: _,
|
|
1062
|
-
value: i,
|
|
1063
|
-
onChange: (e) => f(e.target.value),
|
|
1064
|
-
onBlur: p,
|
|
1065
|
-
placeholder: y,
|
|
1066
|
-
"aria-invalid": C,
|
|
1067
|
-
"aria-required": b,
|
|
1068
|
-
style: T
|
|
1069
|
-
}),
|
|
1070
|
-
C && /* @__PURE__ */ u("span", {
|
|
1071
|
-
role: "alert",
|
|
1072
|
-
style: {
|
|
1073
|
-
fontSize: "12px",
|
|
1074
|
-
color: m.danger,
|
|
1075
|
-
display: "flex",
|
|
1076
|
-
alignItems: "center",
|
|
1077
|
-
gap: "4px"
|
|
1078
|
-
},
|
|
1079
|
-
children: [/* @__PURE__ */ l("svg", {
|
|
1080
|
-
width: "12",
|
|
1081
|
-
height: "12",
|
|
1082
|
-
viewBox: "0 0 24 24",
|
|
1083
|
-
fill: "currentColor",
|
|
1084
|
-
"aria-hidden": "true",
|
|
1085
|
-
children: /* @__PURE__ */ l("path", { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" })
|
|
1086
|
-
}), n(a)]
|
|
1087
|
-
})
|
|
1088
|
-
]
|
|
1089
|
-
});
|
|
1090
|
-
}
|
|
1091
|
-
function M(e) {
|
|
1092
|
-
let t = 2166136261;
|
|
1093
|
-
for (let n = 0; n < e.length; n++) t ^= e.charCodeAt(n), t = Math.imul(t, 16777619) >>> 0;
|
|
1094
|
-
return (t & 65535) / 65535 * Math.PI * 2;
|
|
1095
|
-
}
|
|
1096
|
-
function N({ fields: r, onSubmit: o, submitLabel: d = "Submit", layout: f = "vertical", showConfidence: p = !0, showQuantumState: m = !1 }) {
|
|
1097
|
-
let h = e(), g = r.map((e) => v(e.name)), [_, y] = s(() => Object.fromEntries(r.map((e) => [e.name, ""]))), [b, x] = s({}), [S, C] = s({}), [w, T] = s(!1), [E, D] = s(!1), [k, A] = s(!1);
|
|
1098
|
-
a(() => {
|
|
1099
|
-
let e = requestAnimationFrame(() => D(!0));
|
|
1100
|
-
return () => cancelAnimationFrame(e);
|
|
1101
|
-
}, []);
|
|
1102
|
-
let N = i((e, t) => {
|
|
1103
|
-
let n = r.find((t) => t.name === e), i = g[r.findIndex((t) => t.name === e)];
|
|
1104
|
-
if (!n || !i) return "";
|
|
1105
|
-
let a = t[e] ?? "";
|
|
1106
|
-
for (let { rule: e, value: r, message: o } of i.validations) if (!(e === "required" && n.required === !1) && !O(e, r, a, t)) return o;
|
|
1107
|
-
return "";
|
|
1108
|
-
}, [r]), P = i((e) => {
|
|
1109
|
-
let t = {};
|
|
1110
|
-
for (let n of r) {
|
|
1111
|
-
let r = N(n.name, e);
|
|
1112
|
-
r && (t[n.name] = r);
|
|
1113
|
-
}
|
|
1114
|
-
return t;
|
|
1115
|
-
}, [r, N]), F = i((e, t) => {
|
|
1116
|
-
y((n) => {
|
|
1117
|
-
let i = {
|
|
1118
|
-
...n,
|
|
1119
|
-
[e]: t
|
|
1120
|
-
};
|
|
1121
|
-
if (S[e] && (x((t) => ({
|
|
1122
|
-
...t,
|
|
1123
|
-
[e]: N(e, i)
|
|
1124
|
-
})), e === "password")) {
|
|
1125
|
-
let e = r.find((e) => [
|
|
1126
|
-
"confirmpassword",
|
|
1127
|
-
"confirm_password",
|
|
1128
|
-
"passwordconfirm"
|
|
1129
|
-
].includes(e.name.toLowerCase().replace(/[\s_-]/g, "")))?.name;
|
|
1130
|
-
e && S[e] && x((t) => ({
|
|
1131
|
-
...t,
|
|
1132
|
-
[e]: N(e, i)
|
|
1133
|
-
}));
|
|
1134
|
-
}
|
|
1135
|
-
return i;
|
|
1136
|
-
}), A(!0);
|
|
1137
|
-
}, [
|
|
1138
|
-
r,
|
|
1139
|
-
S,
|
|
1140
|
-
N
|
|
1141
|
-
]), I = i((e) => {
|
|
1142
|
-
C((t) => ({
|
|
1143
|
-
...t,
|
|
1144
|
-
[e]: !0
|
|
1145
|
-
})), x((t) => ({
|
|
1146
|
-
...t,
|
|
1147
|
-
[e]: N(e, _)
|
|
1148
|
-
}));
|
|
1149
|
-
}, [_, N]), L = i(async (e) => {
|
|
1150
|
-
e.preventDefault(), C(Object.fromEntries(r.map((e) => [e.name, !0])));
|
|
1151
|
-
let t = P(_);
|
|
1152
|
-
if (x(t), !(Object.keys(t).length > 0)) {
|
|
1153
|
-
T(!0);
|
|
1154
|
-
try {
|
|
1155
|
-
await o(_);
|
|
1156
|
-
} finally {
|
|
1157
|
-
T(!1);
|
|
1158
|
-
}
|
|
1159
|
-
}
|
|
1160
|
-
}, [
|
|
1161
|
-
r,
|
|
1162
|
-
_,
|
|
1163
|
-
P,
|
|
1164
|
-
o
|
|
1165
|
-
]), R = g.length > 0 ? Math.round(g.reduce((e, t) => e + t.confidence, 0) / g.length * 100) : 0, z = R >= 80 ? h.success : R >= 60 ? h.warning : h.danger, B = f === "horizontal";
|
|
1166
|
-
return /* @__PURE__ */ u("form", {
|
|
1167
|
-
onSubmit: L,
|
|
1168
|
-
noValidate: !0,
|
|
1169
|
-
className: t("w-full"),
|
|
1170
|
-
style: {
|
|
1171
|
-
backgroundColor: h.surface,
|
|
1172
|
-
border: `1px solid ${h.border}`,
|
|
1173
|
-
borderRadius: "12px",
|
|
1174
|
-
padding: "24px",
|
|
1175
|
-
position: "relative",
|
|
1176
|
-
boxSizing: "border-box"
|
|
1177
|
-
},
|
|
1178
|
-
children: [
|
|
1179
|
-
/* @__PURE__ */ l("span", {
|
|
1180
|
-
"aria-label": "Powered by Quantum AI",
|
|
1181
|
-
style: {
|
|
1182
|
-
position: "absolute",
|
|
1183
|
-
top: "16px",
|
|
1184
|
-
right: "16px",
|
|
1185
|
-
fontSize: "10px",
|
|
1186
|
-
fontWeight: 700,
|
|
1187
|
-
padding: "3px 8px",
|
|
1188
|
-
borderRadius: "999px",
|
|
1189
|
-
backgroundColor: `${h.primary}20`,
|
|
1190
|
-
color: h.primary,
|
|
1191
|
-
border: `1px solid ${h.primary}44`,
|
|
1192
|
-
letterSpacing: "0.04em",
|
|
1193
|
-
userSelect: "none"
|
|
1194
|
-
},
|
|
1195
|
-
children: "⚛ Quantum AI"
|
|
1196
|
-
}),
|
|
1197
|
-
p && /* @__PURE__ */ u("div", {
|
|
1198
|
-
style: {
|
|
1199
|
-
marginBottom: "20px",
|
|
1200
|
-
paddingRight: "100px"
|
|
1201
|
-
},
|
|
1202
|
-
children: [/* @__PURE__ */ u("div", {
|
|
1203
|
-
style: {
|
|
1204
|
-
display: "flex",
|
|
1205
|
-
alignItems: "center",
|
|
1206
|
-
justifyContent: "space-between",
|
|
1207
|
-
marginBottom: "4px"
|
|
1208
|
-
},
|
|
1209
|
-
children: [/* @__PURE__ */ l("span", {
|
|
1210
|
-
style: {
|
|
1211
|
-
fontSize: "11px",
|
|
1212
|
-
color: h.textMuted,
|
|
1213
|
-
fontWeight: 500
|
|
1214
|
-
},
|
|
1215
|
-
children: "Form Intelligence Confidence"
|
|
1216
|
-
}), /* @__PURE__ */ u("span", {
|
|
1217
|
-
style: {
|
|
1218
|
-
fontSize: "11px",
|
|
1219
|
-
fontWeight: 700,
|
|
1220
|
-
color: z
|
|
1221
|
-
},
|
|
1222
|
-
children: [R, "%"]
|
|
1223
|
-
})]
|
|
1224
|
-
}), /* @__PURE__ */ l("div", {
|
|
1225
|
-
style: {
|
|
1226
|
-
height: "4px",
|
|
1227
|
-
borderRadius: "4px",
|
|
1228
|
-
backgroundColor: h.border,
|
|
1229
|
-
overflow: "hidden"
|
|
1230
|
-
},
|
|
1231
|
-
children: /* @__PURE__ */ l("div", { style: {
|
|
1232
|
-
height: "100%",
|
|
1233
|
-
width: `${R}%`,
|
|
1234
|
-
backgroundColor: z,
|
|
1235
|
-
borderRadius: "4px",
|
|
1236
|
-
transition: "width 0.8s ease"
|
|
1237
|
-
} })
|
|
1238
|
-
})]
|
|
1239
|
-
}),
|
|
1240
|
-
/* @__PURE__ */ l("div", {
|
|
1241
|
-
style: {
|
|
1242
|
-
display: "grid",
|
|
1243
|
-
gridTemplateColumns: B ? "repeat(auto-fill, minmax(260px, 1fr))" : "1fr",
|
|
1244
|
-
gap: "16px",
|
|
1245
|
-
marginBottom: "20px"
|
|
1246
|
-
},
|
|
1247
|
-
children: r.map((e, t) => /* @__PURE__ */ l(j, {
|
|
1248
|
-
config: e,
|
|
1249
|
-
intel: g[t],
|
|
1250
|
-
qubitPhase: M(e.name),
|
|
1251
|
-
value: _[e.name] ?? "",
|
|
1252
|
-
error: b[e.name] ?? "",
|
|
1253
|
-
touched: S[e.name] ?? !1,
|
|
1254
|
-
showConfidence: p,
|
|
1255
|
-
showQuantumState: m,
|
|
1256
|
-
collapsed: k,
|
|
1257
|
-
onChange: (t) => F(e.name, t),
|
|
1258
|
-
onBlur: () => I(e.name),
|
|
1259
|
-
theme: h,
|
|
1260
|
-
mounted: E,
|
|
1261
|
-
index: t
|
|
1262
|
-
}, e.name))
|
|
1263
|
-
}),
|
|
1264
|
-
/* @__PURE__ */ l("button", {
|
|
1265
|
-
type: "submit",
|
|
1266
|
-
disabled: w,
|
|
1267
|
-
style: {
|
|
1268
|
-
width: "100%",
|
|
1269
|
-
padding: "10px 20px",
|
|
1270
|
-
borderRadius: "8px",
|
|
1271
|
-
border: "none",
|
|
1272
|
-
backgroundColor: w ? `${h.primary}88` : h.primary,
|
|
1273
|
-
color: h.bg,
|
|
1274
|
-
fontSize: "14px",
|
|
1275
|
-
fontWeight: 700,
|
|
1276
|
-
fontFamily: "inherit",
|
|
1277
|
-
cursor: w ? "not-allowed" : "pointer",
|
|
1278
|
-
transition: "background-color 0.15s, opacity 0.15s",
|
|
1279
|
-
display: "flex",
|
|
1280
|
-
alignItems: "center",
|
|
1281
|
-
justifyContent: "center",
|
|
1282
|
-
gap: "8px"
|
|
1283
|
-
},
|
|
1284
|
-
children: w ? /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ u("svg", {
|
|
1285
|
-
width: "14",
|
|
1286
|
-
height: "14",
|
|
1287
|
-
viewBox: "0 0 24 24",
|
|
1288
|
-
fill: "none",
|
|
1289
|
-
stroke: "currentColor",
|
|
1290
|
-
strokeWidth: "2.5",
|
|
1291
|
-
style: { animation: "qf-spin 0.8s linear infinite" },
|
|
1292
|
-
"aria-hidden": "true",
|
|
1293
|
-
children: [/* @__PURE__ */ l("circle", {
|
|
1294
|
-
cx: "12",
|
|
1295
|
-
cy: "12",
|
|
1296
|
-
r: "10",
|
|
1297
|
-
strokeOpacity: "0.25"
|
|
1298
|
-
}), /* @__PURE__ */ l("path", { d: "M12 2a10 10 0 0 1 10 10" })]
|
|
1299
|
-
}), "Processing…"] }) : n(d)
|
|
1300
|
-
}),
|
|
1301
|
-
/* @__PURE__ */ l("style", { children: "@keyframes qf-spin { to { transform: rotate(360deg); } }" })
|
|
1302
|
-
]
|
|
1303
|
-
});
|
|
1304
|
-
}
|
|
1305
|
-
N.displayName = "TkxQuantumForm";
|
|
1306
|
-
//#endregion
|
|
1307
|
-
//#region src/components/TkxThemeBuilder.tsx
|
|
1308
|
-
function P(e) {
|
|
1309
|
-
return e ? {
|
|
1310
|
-
primary: "#00f5d4",
|
|
1311
|
-
secondary: "#7b2ff7",
|
|
1312
|
-
background: "#0a0a0f",
|
|
1313
|
-
surface: "#12121a",
|
|
1314
|
-
text: "#e8e8f4",
|
|
1315
|
-
textMuted: "#8888aa",
|
|
1316
|
-
border: "#2a2a3e",
|
|
1317
|
-
error: "#f87171",
|
|
1318
|
-
warning: "#fbbf24",
|
|
1319
|
-
success: "#34d399",
|
|
1320
|
-
accent: "#ff6b6b"
|
|
1321
|
-
} : {
|
|
1322
|
-
primary: "#0d7c5f",
|
|
1323
|
-
secondary: "#6930c3",
|
|
1324
|
-
background: "#f8f6f1",
|
|
1325
|
-
surface: "#ffffff",
|
|
1326
|
-
text: "#1a1815",
|
|
1327
|
-
textMuted: "#6b6560",
|
|
1328
|
-
border: "#ddd8cc",
|
|
1329
|
-
error: "#dc2626",
|
|
1330
|
-
warning: "#d97706",
|
|
1331
|
-
success: "#059669",
|
|
1332
|
-
accent: "#e05a00"
|
|
1333
|
-
};
|
|
1334
|
-
}
|
|
1335
|
-
function F({ points: e, primary: t }) {
|
|
1336
|
-
if (e.length < 2) return /* @__PURE__ */ l("div", {
|
|
1337
|
-
style: {
|
|
1338
|
-
height: 48,
|
|
1339
|
-
display: "flex",
|
|
1340
|
-
alignItems: "center",
|
|
1341
|
-
justifyContent: "center",
|
|
1342
|
-
color: "#888",
|
|
1343
|
-
fontSize: 12
|
|
1344
|
-
},
|
|
1345
|
-
children: "Waiting for data..."
|
|
1346
|
-
});
|
|
1347
|
-
let n = Math.max(...e.map((e) => e.energy)), r = Math.min(...e.map((e) => e.energy)), i = n - r || 1, a = e[e.length - 1].iteration || 1;
|
|
1348
|
-
return /* @__PURE__ */ u("svg", {
|
|
1349
|
-
width: 280,
|
|
1350
|
-
height: 48,
|
|
1351
|
-
style: { display: "block" },
|
|
1352
|
-
children: [
|
|
1353
|
-
/* @__PURE__ */ l("polyline", {
|
|
1354
|
-
points: e.map((e) => {
|
|
1355
|
-
let t = e.iteration / a * 280, n = 48 - (e.energy - r) / i * 44 - 2;
|
|
1356
|
-
return `${t.toFixed(1)},${n.toFixed(1)}`;
|
|
1357
|
-
}).join(" "),
|
|
1358
|
-
fill: "none",
|
|
1359
|
-
stroke: t,
|
|
1360
|
-
strokeWidth: 1.5,
|
|
1361
|
-
strokeLinecap: "round",
|
|
1362
|
-
strokeLinejoin: "round",
|
|
1363
|
-
opacity: .9
|
|
1364
|
-
}),
|
|
1365
|
-
/* @__PURE__ */ u("text", {
|
|
1366
|
-
x: 2,
|
|
1367
|
-
y: 10,
|
|
1368
|
-
fontSize: 9,
|
|
1369
|
-
fill: "#888",
|
|
1370
|
-
children: ["E=", n.toFixed(1)]
|
|
1371
|
-
}),
|
|
1372
|
-
/* @__PURE__ */ u("text", {
|
|
1373
|
-
x: 2,
|
|
1374
|
-
y: 46,
|
|
1375
|
-
fontSize: 9,
|
|
1376
|
-
fill: "#888",
|
|
1377
|
-
children: ["E=", r.toFixed(1)]
|
|
1378
|
-
})
|
|
1379
|
-
]
|
|
1380
|
-
});
|
|
1381
|
-
}
|
|
1382
|
-
function I({ label: e, value: t, onChange: n, text: r, border: i }) {
|
|
1383
|
-
return /* @__PURE__ */ u("div", {
|
|
1384
|
-
style: {
|
|
1385
|
-
display: "flex",
|
|
1386
|
-
alignItems: "center",
|
|
1387
|
-
gap: 8,
|
|
1388
|
-
marginBottom: 6
|
|
1389
|
-
},
|
|
1390
|
-
children: [
|
|
1391
|
-
/* @__PURE__ */ l("input", {
|
|
1392
|
-
type: "color",
|
|
1393
|
-
value: t,
|
|
1394
|
-
onChange: (e) => n(e.target.value),
|
|
1395
|
-
style: {
|
|
1396
|
-
width: 32,
|
|
1397
|
-
height: 32,
|
|
1398
|
-
border: `1px solid ${i}`,
|
|
1399
|
-
borderRadius: 6,
|
|
1400
|
-
padding: 2,
|
|
1401
|
-
cursor: "pointer",
|
|
1402
|
-
background: "transparent"
|
|
1403
|
-
}
|
|
1404
|
-
}),
|
|
1405
|
-
/* @__PURE__ */ l("div", { style: {
|
|
1406
|
-
width: 60,
|
|
1407
|
-
height: 28,
|
|
1408
|
-
borderRadius: 6,
|
|
1409
|
-
background: t,
|
|
1410
|
-
border: `1px solid ${i}`
|
|
1411
|
-
} }),
|
|
1412
|
-
/* @__PURE__ */ l("span", {
|
|
1413
|
-
style: {
|
|
1414
|
-
flex: 1,
|
|
1415
|
-
fontSize: 13,
|
|
1416
|
-
color: r,
|
|
1417
|
-
fontFamily: "monospace"
|
|
1418
|
-
},
|
|
1419
|
-
children: e
|
|
1420
|
-
}),
|
|
1421
|
-
/* @__PURE__ */ l("code", {
|
|
1422
|
-
style: {
|
|
1423
|
-
fontSize: 12,
|
|
1424
|
-
color: r,
|
|
1425
|
-
opacity: .7,
|
|
1426
|
-
fontFamily: "monospace"
|
|
1427
|
-
},
|
|
1428
|
-
children: t
|
|
1429
|
-
})
|
|
1430
|
-
]
|
|
1431
|
-
});
|
|
1432
|
-
}
|
|
1433
|
-
function L({ label: e, ratio: t }) {
|
|
1434
|
-
let n = t >= 4.5, r = t >= 4.5, i = t >= 7;
|
|
1435
|
-
return /* @__PURE__ */ u("div", {
|
|
1436
|
-
style: {
|
|
1437
|
-
display: "flex",
|
|
1438
|
-
alignItems: "center",
|
|
1439
|
-
gap: 6,
|
|
1440
|
-
marginBottom: 4
|
|
1441
|
-
},
|
|
1442
|
-
children: [
|
|
1443
|
-
/* @__PURE__ */ l("span", {
|
|
1444
|
-
style: {
|
|
1445
|
-
fontSize: 11,
|
|
1446
|
-
opacity: .8,
|
|
1447
|
-
minWidth: 140
|
|
1448
|
-
},
|
|
1449
|
-
children: e
|
|
1450
|
-
}),
|
|
1451
|
-
/* @__PURE__ */ u("span", {
|
|
1452
|
-
style: {
|
|
1453
|
-
fontSize: 12,
|
|
1454
|
-
fontWeight: 600
|
|
1455
|
-
},
|
|
1456
|
-
children: [t.toFixed(2), ":1"]
|
|
1457
|
-
}),
|
|
1458
|
-
/* @__PURE__ */ l("span", {
|
|
1459
|
-
style: {
|
|
1460
|
-
fontSize: 11,
|
|
1461
|
-
color: r ? "#22c55e" : "#ef4444"
|
|
1462
|
-
},
|
|
1463
|
-
children: r ? "✓ AA" : "✗ AA"
|
|
1464
|
-
}),
|
|
1465
|
-
/* @__PURE__ */ l("span", {
|
|
1466
|
-
style: {
|
|
1467
|
-
fontSize: 11,
|
|
1468
|
-
color: i ? "#22c55e" : "#888"
|
|
1469
|
-
},
|
|
1470
|
-
children: i ? "✓ AAA" : "— AAA"
|
|
1471
|
-
}),
|
|
1472
|
-
/* @__PURE__ */ l("span", {
|
|
1473
|
-
style: { fontSize: 13 },
|
|
1474
|
-
children: n ? "✅" : "❌"
|
|
1475
|
-
})
|
|
1476
|
-
]
|
|
1477
|
-
});
|
|
1478
|
-
}
|
|
1479
|
-
function R({ onThemeChange: n, initialHue: r = 210, initialMode: a = "dark" }) {
|
|
1480
|
-
let c = e(), [d, f] = s(a), [p, m] = s(r), [h, g] = s(() => P(a === "dark")), [_, v] = s(!1), [y, b] = s([]), [x, S] = s(!1), C = o(null), w = d === "dark", T = i((e, t) => {
|
|
1481
|
-
g((r) => {
|
|
1482
|
-
let i = {
|
|
1483
|
-
...r,
|
|
1484
|
-
[e]: t
|
|
1485
|
-
};
|
|
1486
|
-
return n?.(i), i;
|
|
1487
|
-
});
|
|
1488
|
-
}, [n]), E = i(() => {
|
|
1489
|
-
if (_) return;
|
|
1490
|
-
v(!0), b([]);
|
|
1491
|
-
let e = 0, t = [], r = () => {
|
|
1492
|
-
e += 60, D.optimizeTheme(p, w, e);
|
|
1493
|
-
let i = e / 600, a = 50 * (1 - i) + 2, o = (Math.random() - .5) * 8 * (1 - i * .8);
|
|
1494
|
-
if (t.push({
|
|
1495
|
-
iteration: e,
|
|
1496
|
-
energy: Math.max(0, a + o)
|
|
1497
|
-
}), b([...t]), e < 600) C.current = window.setTimeout(r, 40);
|
|
1498
|
-
else {
|
|
1499
|
-
let e = D.optimizeTheme(p, w, 1e3);
|
|
1500
|
-
g(e), n?.(e), v(!1);
|
|
1501
|
-
}
|
|
1502
|
-
};
|
|
1503
|
-
C.current = window.setTimeout(r, 16);
|
|
1504
|
-
}, [
|
|
1505
|
-
p,
|
|
1506
|
-
w,
|
|
1507
|
-
_,
|
|
1508
|
-
n
|
|
1509
|
-
]), O = i(() => {
|
|
1510
|
-
let e = d === "dark" ? "light" : "dark";
|
|
1511
|
-
f(e);
|
|
1512
|
-
let t = P(e === "dark");
|
|
1513
|
-
g(t), n?.(t);
|
|
1514
|
-
}, [d, n]), k = i(() => {
|
|
1515
|
-
let e = `export const myTheme = {\n${Object.entries(h).map(([e, t]) => ` ${e}: '${t}',`).join("\n")}\n};`;
|
|
1516
|
-
typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(e).then(() => {
|
|
1517
|
-
S(!0), setTimeout(() => S(!1), 2e3);
|
|
1518
|
-
});
|
|
1519
|
-
}, [h]), A = [
|
|
1520
|
-
{
|
|
1521
|
-
label: "Text on Background",
|
|
1522
|
-
fg: h.text,
|
|
1523
|
-
bg: h.background
|
|
1524
|
-
},
|
|
1525
|
-
{
|
|
1526
|
-
label: "Text on Surface",
|
|
1527
|
-
fg: h.text,
|
|
1528
|
-
bg: h.surface
|
|
1529
|
-
},
|
|
1530
|
-
{
|
|
1531
|
-
label: "Primary on Background",
|
|
1532
|
-
fg: h.primary,
|
|
1533
|
-
bg: h.background
|
|
1534
|
-
},
|
|
1535
|
-
{
|
|
1536
|
-
label: "TextMuted on Background",
|
|
1537
|
-
fg: h.textMuted,
|
|
1538
|
-
bg: h.background
|
|
1539
|
-
}
|
|
1540
|
-
], j = "linear-gradient(to right," + [
|
|
1541
|
-
"hsl(0,80%,55%)",
|
|
1542
|
-
"hsl(30,80%,55%)",
|
|
1543
|
-
"hsl(60,80%,55%)",
|
|
1544
|
-
"hsl(90,80%,55%)",
|
|
1545
|
-
"hsl(120,80%,55%)",
|
|
1546
|
-
"hsl(150,80%,55%)",
|
|
1547
|
-
"hsl(180,80%,55%)",
|
|
1548
|
-
"hsl(210,80%,55%)",
|
|
1549
|
-
"hsl(240,80%,55%)",
|
|
1550
|
-
"hsl(270,80%,55%)",
|
|
1551
|
-
"hsl(300,80%,55%)",
|
|
1552
|
-
"hsl(330,80%,55%)",
|
|
1553
|
-
"hsl(360,80%,55%)"
|
|
1554
|
-
].join(",") + ")", M = {
|
|
1555
|
-
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
1556
|
-
background: h.background,
|
|
1557
|
-
color: h.text,
|
|
1558
|
-
border: `1px solid ${h.border}`,
|
|
1559
|
-
borderRadius: 12,
|
|
1560
|
-
padding: 20,
|
|
1561
|
-
maxWidth: 900,
|
|
1562
|
-
display: "grid",
|
|
1563
|
-
gridTemplateColumns: "1fr 1fr",
|
|
1564
|
-
gap: 20
|
|
1565
|
-
}, N = {
|
|
1566
|
-
background: h.surface,
|
|
1567
|
-
border: `1px solid ${h.border}`,
|
|
1568
|
-
borderRadius: 8,
|
|
1569
|
-
padding: 16
|
|
1570
|
-
}, R = {
|
|
1571
|
-
fontSize: 13,
|
|
1572
|
-
fontWeight: 700,
|
|
1573
|
-
textTransform: "uppercase",
|
|
1574
|
-
letterSpacing: "0.08em",
|
|
1575
|
-
color: h.primary,
|
|
1576
|
-
marginBottom: 12,
|
|
1577
|
-
marginTop: 0
|
|
1578
|
-
}, z = {
|
|
1579
|
-
padding: "8px 16px",
|
|
1580
|
-
borderRadius: 8,
|
|
1581
|
-
border: "none",
|
|
1582
|
-
cursor: "pointer",
|
|
1583
|
-
fontWeight: 600,
|
|
1584
|
-
fontSize: 13,
|
|
1585
|
-
transition: "opacity 0.15s"
|
|
1586
|
-
}, B = t;
|
|
1587
|
-
return /* @__PURE__ */ u("div", {
|
|
1588
|
-
style: M,
|
|
1589
|
-
children: [
|
|
1590
|
-
/* @__PURE__ */ u("div", {
|
|
1591
|
-
style: {
|
|
1592
|
-
display: "flex",
|
|
1593
|
-
flexDirection: "column",
|
|
1594
|
-
gap: 16
|
|
1595
|
-
},
|
|
1596
|
-
children: [
|
|
1597
|
-
/* @__PURE__ */ u("div", {
|
|
1598
|
-
style: {
|
|
1599
|
-
display: "flex",
|
|
1600
|
-
alignItems: "center",
|
|
1601
|
-
justifyContent: "space-between",
|
|
1602
|
-
gridColumn: "1/-1"
|
|
1603
|
-
},
|
|
1604
|
-
children: [/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("h2", {
|
|
1605
|
-
style: {
|
|
1606
|
-
margin: 0,
|
|
1607
|
-
fontSize: 18,
|
|
1608
|
-
fontWeight: 700
|
|
1609
|
-
},
|
|
1610
|
-
children: "Theme Builder"
|
|
1611
|
-
}), /* @__PURE__ */ l("p", {
|
|
1612
|
-
style: {
|
|
1613
|
-
margin: "2px 0 0",
|
|
1614
|
-
fontSize: 12,
|
|
1615
|
-
color: h.textMuted
|
|
1616
|
-
},
|
|
1617
|
-
children: "Quantum-powered color optimization"
|
|
1618
|
-
})] }), /* @__PURE__ */ l("button", {
|
|
1619
|
-
onClick: O,
|
|
1620
|
-
style: {
|
|
1621
|
-
...z,
|
|
1622
|
-
background: h.surface,
|
|
1623
|
-
color: h.text,
|
|
1624
|
-
border: `1px solid ${h.border}`
|
|
1625
|
-
},
|
|
1626
|
-
children: w ? "☀ Light" : "🌙 Dark"
|
|
1627
|
-
})]
|
|
1628
|
-
}),
|
|
1629
|
-
/* @__PURE__ */ u("div", {
|
|
1630
|
-
style: N,
|
|
1631
|
-
children: [/* @__PURE__ */ l("p", {
|
|
1632
|
-
style: R,
|
|
1633
|
-
children: "Base Hue"
|
|
1634
|
-
}), /* @__PURE__ */ u("div", {
|
|
1635
|
-
style: {
|
|
1636
|
-
display: "flex",
|
|
1637
|
-
alignItems: "center",
|
|
1638
|
-
gap: 10
|
|
1639
|
-
},
|
|
1640
|
-
children: [
|
|
1641
|
-
/* @__PURE__ */ l("div", { style: {
|
|
1642
|
-
width: 24,
|
|
1643
|
-
height: 24,
|
|
1644
|
-
borderRadius: "50%",
|
|
1645
|
-
background: `hsl(${p},70%,55%)`,
|
|
1646
|
-
border: `2px solid ${h.border}`,
|
|
1647
|
-
flexShrink: 0
|
|
1648
|
-
} }),
|
|
1649
|
-
/* @__PURE__ */ l("input", {
|
|
1650
|
-
type: "range",
|
|
1651
|
-
min: 0,
|
|
1652
|
-
max: 360,
|
|
1653
|
-
value: p,
|
|
1654
|
-
onChange: (e) => m(Number(e.target.value)),
|
|
1655
|
-
style: {
|
|
1656
|
-
flex: 1,
|
|
1657
|
-
height: 16,
|
|
1658
|
-
borderRadius: 8,
|
|
1659
|
-
background: j,
|
|
1660
|
-
outline: "none",
|
|
1661
|
-
border: "none",
|
|
1662
|
-
cursor: "pointer",
|
|
1663
|
-
appearance: "none",
|
|
1664
|
-
WebkitAppearance: "none"
|
|
1665
|
-
}
|
|
1666
|
-
}),
|
|
1667
|
-
/* @__PURE__ */ u("span", {
|
|
1668
|
-
style: {
|
|
1669
|
-
fontSize: 13,
|
|
1670
|
-
fontFamily: "monospace",
|
|
1671
|
-
minWidth: 32
|
|
1672
|
-
},
|
|
1673
|
-
children: [p, "°"]
|
|
1674
|
-
})
|
|
1675
|
-
]
|
|
1676
|
-
})]
|
|
1677
|
-
}),
|
|
1678
|
-
/* @__PURE__ */ u("div", {
|
|
1679
|
-
style: N,
|
|
1680
|
-
children: [/* @__PURE__ */ u("div", {
|
|
1681
|
-
style: {
|
|
1682
|
-
display: "flex",
|
|
1683
|
-
alignItems: "center",
|
|
1684
|
-
gap: 8,
|
|
1685
|
-
marginBottom: 10
|
|
1686
|
-
},
|
|
1687
|
-
children: [/* @__PURE__ */ l("button", {
|
|
1688
|
-
onClick: E,
|
|
1689
|
-
disabled: _,
|
|
1690
|
-
style: {
|
|
1691
|
-
...z,
|
|
1692
|
-
background: _ ? h.border : h.primary,
|
|
1693
|
-
color: w ? "#000" : "#fff",
|
|
1694
|
-
opacity: _ ? .7 : 1,
|
|
1695
|
-
flex: 1
|
|
1696
|
-
},
|
|
1697
|
-
children: _ ? "⟳ Optimizing..." : "⚛ Generate with Quantum Annealing"
|
|
1698
|
-
}), /* @__PURE__ */ l("div", {
|
|
1699
|
-
style: {
|
|
1700
|
-
padding: "3px 8px",
|
|
1701
|
-
background: h.primary + "22",
|
|
1702
|
-
border: `1px solid ${h.primary}44`,
|
|
1703
|
-
borderRadius: 20,
|
|
1704
|
-
fontSize: 10,
|
|
1705
|
-
color: h.primary,
|
|
1706
|
-
fontWeight: 700,
|
|
1707
|
-
whiteSpace: "nowrap"
|
|
1708
|
-
},
|
|
1709
|
-
children: "⚛ Quantum Annealing"
|
|
1710
|
-
})]
|
|
1711
|
-
}), (_ || y.length > 0) && /* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
1712
|
-
style: {
|
|
1713
|
-
fontSize: 11,
|
|
1714
|
-
color: h.textMuted,
|
|
1715
|
-
margin: "0 0 4px"
|
|
1716
|
-
},
|
|
1717
|
-
children: "Energy landscape (lower = better palette)"
|
|
1718
|
-
}), /* @__PURE__ */ l(F, {
|
|
1719
|
-
points: y,
|
|
1720
|
-
primary: h.primary
|
|
1721
|
-
})] })]
|
|
1722
|
-
}),
|
|
1723
|
-
/* @__PURE__ */ u("div", {
|
|
1724
|
-
style: N,
|
|
1725
|
-
children: [/* @__PURE__ */ l("p", {
|
|
1726
|
-
style: R,
|
|
1727
|
-
children: "Color Tokens"
|
|
1728
|
-
}), Object.keys(h).map((e) => /* @__PURE__ */ l(I, {
|
|
1729
|
-
label: e,
|
|
1730
|
-
value: h[e],
|
|
1731
|
-
onChange: (t) => T(e, t),
|
|
1732
|
-
text: h.text,
|
|
1733
|
-
border: h.border
|
|
1734
|
-
}, e))]
|
|
1735
|
-
}),
|
|
1736
|
-
/* @__PURE__ */ l("button", {
|
|
1737
|
-
onClick: k,
|
|
1738
|
-
style: {
|
|
1739
|
-
...z,
|
|
1740
|
-
background: h.accent,
|
|
1741
|
-
color: "#fff",
|
|
1742
|
-
width: "100%"
|
|
1743
|
-
},
|
|
1744
|
-
children: x ? "✓ Copied to Clipboard!" : "⬇ Export Theme"
|
|
1745
|
-
})
|
|
1746
|
-
]
|
|
1747
|
-
}),
|
|
1748
|
-
/* @__PURE__ */ u("div", {
|
|
1749
|
-
style: {
|
|
1750
|
-
display: "flex",
|
|
1751
|
-
flexDirection: "column",
|
|
1752
|
-
gap: 16
|
|
1753
|
-
},
|
|
1754
|
-
children: [
|
|
1755
|
-
/* @__PURE__ */ u("div", {
|
|
1756
|
-
style: N,
|
|
1757
|
-
children: [
|
|
1758
|
-
/* @__PURE__ */ l("p", {
|
|
1759
|
-
style: R,
|
|
1760
|
-
children: "Live Preview"
|
|
1761
|
-
}),
|
|
1762
|
-
/* @__PURE__ */ u("div", {
|
|
1763
|
-
style: { marginBottom: 12 },
|
|
1764
|
-
children: [/* @__PURE__ */ l("p", {
|
|
1765
|
-
style: {
|
|
1766
|
-
fontSize: 11,
|
|
1767
|
-
color: h.textMuted,
|
|
1768
|
-
margin: "0 0 6px"
|
|
1769
|
-
},
|
|
1770
|
-
children: "Buttons"
|
|
1771
|
-
}), /* @__PURE__ */ u("div", {
|
|
1772
|
-
style: {
|
|
1773
|
-
display: "flex",
|
|
1774
|
-
gap: 8,
|
|
1775
|
-
flexWrap: "wrap"
|
|
1776
|
-
},
|
|
1777
|
-
children: [
|
|
1778
|
-
/* @__PURE__ */ l("button", {
|
|
1779
|
-
style: {
|
|
1780
|
-
padding: "8px 16px",
|
|
1781
|
-
borderRadius: 8,
|
|
1782
|
-
border: "none",
|
|
1783
|
-
background: h.primary,
|
|
1784
|
-
color: w ? "#000" : "#fff",
|
|
1785
|
-
fontWeight: 600,
|
|
1786
|
-
fontSize: 13,
|
|
1787
|
-
cursor: "pointer"
|
|
1788
|
-
},
|
|
1789
|
-
children: "Primary"
|
|
1790
|
-
}),
|
|
1791
|
-
/* @__PURE__ */ l("button", {
|
|
1792
|
-
style: {
|
|
1793
|
-
padding: "8px 16px",
|
|
1794
|
-
borderRadius: 8,
|
|
1795
|
-
border: "none",
|
|
1796
|
-
background: h.secondary,
|
|
1797
|
-
color: "#fff",
|
|
1798
|
-
fontWeight: 600,
|
|
1799
|
-
fontSize: 13,
|
|
1800
|
-
cursor: "pointer"
|
|
1801
|
-
},
|
|
1802
|
-
children: "Secondary"
|
|
1803
|
-
}),
|
|
1804
|
-
/* @__PURE__ */ l("button", {
|
|
1805
|
-
style: {
|
|
1806
|
-
padding: "8px 16px",
|
|
1807
|
-
borderRadius: 8,
|
|
1808
|
-
border: `1px solid ${h.border}`,
|
|
1809
|
-
background: "transparent",
|
|
1810
|
-
color: h.text,
|
|
1811
|
-
fontWeight: 600,
|
|
1812
|
-
fontSize: 13,
|
|
1813
|
-
cursor: "pointer"
|
|
1814
|
-
},
|
|
1815
|
-
children: "Outline"
|
|
1816
|
-
})
|
|
1817
|
-
]
|
|
1818
|
-
})]
|
|
1819
|
-
}),
|
|
1820
|
-
/* @__PURE__ */ u("div", {
|
|
1821
|
-
style: { marginBottom: 12 },
|
|
1822
|
-
children: [/* @__PURE__ */ l("p", {
|
|
1823
|
-
style: {
|
|
1824
|
-
fontSize: 11,
|
|
1825
|
-
color: h.textMuted,
|
|
1826
|
-
margin: "0 0 6px"
|
|
1827
|
-
},
|
|
1828
|
-
children: "Card"
|
|
1829
|
-
}), /* @__PURE__ */ u("div", {
|
|
1830
|
-
style: {
|
|
1831
|
-
background: h.surface,
|
|
1832
|
-
border: `1px solid ${h.border}`,
|
|
1833
|
-
borderRadius: 8,
|
|
1834
|
-
padding: 12
|
|
1835
|
-
},
|
|
1836
|
-
children: [
|
|
1837
|
-
/* @__PURE__ */ l("div", {
|
|
1838
|
-
style: {
|
|
1839
|
-
fontSize: 14,
|
|
1840
|
-
fontWeight: 700,
|
|
1841
|
-
marginBottom: 4
|
|
1842
|
-
},
|
|
1843
|
-
children: "Card Title"
|
|
1844
|
-
}),
|
|
1845
|
-
/* @__PURE__ */ l("div", {
|
|
1846
|
-
style: {
|
|
1847
|
-
fontSize: 12,
|
|
1848
|
-
color: h.textMuted,
|
|
1849
|
-
lineHeight: 1.4
|
|
1850
|
-
},
|
|
1851
|
-
children: "Sample card with surface background and muted text content."
|
|
1852
|
-
}),
|
|
1853
|
-
/* @__PURE__ */ u("div", {
|
|
1854
|
-
style: {
|
|
1855
|
-
marginTop: 8,
|
|
1856
|
-
display: "flex",
|
|
1857
|
-
gap: 6
|
|
1858
|
-
},
|
|
1859
|
-
children: [/* @__PURE__ */ l("span", {
|
|
1860
|
-
style: {
|
|
1861
|
-
padding: "2px 8px",
|
|
1862
|
-
borderRadius: 20,
|
|
1863
|
-
background: h.primary + "33",
|
|
1864
|
-
color: h.primary,
|
|
1865
|
-
fontSize: 11,
|
|
1866
|
-
fontWeight: 600
|
|
1867
|
-
},
|
|
1868
|
-
children: "Tag"
|
|
1869
|
-
}), /* @__PURE__ */ l("span", {
|
|
1870
|
-
style: {
|
|
1871
|
-
padding: "2px 8px",
|
|
1872
|
-
borderRadius: 20,
|
|
1873
|
-
background: h.accent + "33",
|
|
1874
|
-
color: h.accent,
|
|
1875
|
-
fontSize: 11,
|
|
1876
|
-
fontWeight: 600
|
|
1877
|
-
},
|
|
1878
|
-
children: "Accent"
|
|
1879
|
-
})]
|
|
1880
|
-
})
|
|
1881
|
-
]
|
|
1882
|
-
})]
|
|
1883
|
-
}),
|
|
1884
|
-
/* @__PURE__ */ u("div", {
|
|
1885
|
-
style: { marginBottom: 12 },
|
|
1886
|
-
children: [/* @__PURE__ */ l("p", {
|
|
1887
|
-
style: {
|
|
1888
|
-
fontSize: 11,
|
|
1889
|
-
color: h.textMuted,
|
|
1890
|
-
margin: "0 0 6px"
|
|
1891
|
-
},
|
|
1892
|
-
children: "Input"
|
|
1893
|
-
}), /* @__PURE__ */ l("input", {
|
|
1894
|
-
type: "text",
|
|
1895
|
-
placeholder: "Type something...",
|
|
1896
|
-
readOnly: !0,
|
|
1897
|
-
style: {
|
|
1898
|
-
width: "100%",
|
|
1899
|
-
padding: "8px 12px",
|
|
1900
|
-
borderRadius: 8,
|
|
1901
|
-
border: `1px solid ${h.border}`,
|
|
1902
|
-
background: h.background,
|
|
1903
|
-
color: h.text,
|
|
1904
|
-
fontSize: 13,
|
|
1905
|
-
outline: "none",
|
|
1906
|
-
boxSizing: "border-box"
|
|
1907
|
-
}
|
|
1908
|
-
})]
|
|
1909
|
-
}),
|
|
1910
|
-
/* @__PURE__ */ u("div", {
|
|
1911
|
-
style: { marginBottom: 12 },
|
|
1912
|
-
children: [/* @__PURE__ */ l("p", {
|
|
1913
|
-
style: {
|
|
1914
|
-
fontSize: 11,
|
|
1915
|
-
color: h.textMuted,
|
|
1916
|
-
margin: "0 0 6px"
|
|
1917
|
-
},
|
|
1918
|
-
children: "Progress"
|
|
1919
|
-
}), /* @__PURE__ */ l("div", {
|
|
1920
|
-
style: {
|
|
1921
|
-
height: 8,
|
|
1922
|
-
borderRadius: 4,
|
|
1923
|
-
background: h.border,
|
|
1924
|
-
overflow: "hidden"
|
|
1925
|
-
},
|
|
1926
|
-
children: /* @__PURE__ */ l("div", { style: {
|
|
1927
|
-
height: "100%",
|
|
1928
|
-
width: "68%",
|
|
1929
|
-
background: `linear-gradient(to right, ${h.primary}, ${h.accent})`,
|
|
1930
|
-
borderRadius: 4,
|
|
1931
|
-
transition: "width 0.4s ease"
|
|
1932
|
-
} })
|
|
1933
|
-
})]
|
|
1934
|
-
}),
|
|
1935
|
-
/* @__PURE__ */ u("div", { children: [/* @__PURE__ */ l("p", {
|
|
1936
|
-
style: {
|
|
1937
|
-
fontSize: 11,
|
|
1938
|
-
color: h.textMuted,
|
|
1939
|
-
margin: "0 0 6px"
|
|
1940
|
-
},
|
|
1941
|
-
children: "Status Badges"
|
|
1942
|
-
}), /* @__PURE__ */ l("div", {
|
|
1943
|
-
style: {
|
|
1944
|
-
display: "flex",
|
|
1945
|
-
gap: 6,
|
|
1946
|
-
flexWrap: "wrap"
|
|
1947
|
-
},
|
|
1948
|
-
children: [
|
|
1949
|
-
{
|
|
1950
|
-
label: "Error",
|
|
1951
|
-
color: h.error
|
|
1952
|
-
},
|
|
1953
|
-
{
|
|
1954
|
-
label: "Warning",
|
|
1955
|
-
color: h.warning
|
|
1956
|
-
},
|
|
1957
|
-
{
|
|
1958
|
-
label: "Success",
|
|
1959
|
-
color: h.success
|
|
1960
|
-
}
|
|
1961
|
-
].map(({ label: e, color: t }) => /* @__PURE__ */ l("span", {
|
|
1962
|
-
style: {
|
|
1963
|
-
padding: "3px 10px",
|
|
1964
|
-
borderRadius: 4,
|
|
1965
|
-
background: t + "22",
|
|
1966
|
-
color: t,
|
|
1967
|
-
border: `1px solid ${t}44`,
|
|
1968
|
-
fontSize: 11,
|
|
1969
|
-
fontWeight: 700
|
|
1970
|
-
},
|
|
1971
|
-
children: e
|
|
1972
|
-
}, e))
|
|
1973
|
-
})] })
|
|
1974
|
-
]
|
|
1975
|
-
}),
|
|
1976
|
-
/* @__PURE__ */ u("div", {
|
|
1977
|
-
style: N,
|
|
1978
|
-
children: [
|
|
1979
|
-
/* @__PURE__ */ l("p", {
|
|
1980
|
-
style: R,
|
|
1981
|
-
children: "WCAG Contrast Check"
|
|
1982
|
-
}),
|
|
1983
|
-
A.map((e) => /* @__PURE__ */ l(L, {
|
|
1984
|
-
label: e.label,
|
|
1985
|
-
ratio: D.contrast(e.fg, e.bg)
|
|
1986
|
-
}, e.label)),
|
|
1987
|
-
/* @__PURE__ */ l("p", {
|
|
1988
|
-
style: {
|
|
1989
|
-
fontSize: 10,
|
|
1990
|
-
color: h.textMuted,
|
|
1991
|
-
marginTop: 8,
|
|
1992
|
-
marginBottom: 0
|
|
1993
|
-
},
|
|
1994
|
-
children: "AA requires 4.5:1 (normal text). AAA requires 7:1."
|
|
1995
|
-
})
|
|
1996
|
-
]
|
|
1997
|
-
}),
|
|
1998
|
-
/* @__PURE__ */ u("div", {
|
|
1999
|
-
style: N,
|
|
2000
|
-
children: [/* @__PURE__ */ l("p", {
|
|
2001
|
-
style: R,
|
|
2002
|
-
children: "Color Palette"
|
|
2003
|
-
}), /* @__PURE__ */ l("div", {
|
|
2004
|
-
style: {
|
|
2005
|
-
display: "flex",
|
|
2006
|
-
gap: 4,
|
|
2007
|
-
flexWrap: "wrap"
|
|
2008
|
-
},
|
|
2009
|
-
children: Object.entries(h).map(([e, t]) => /* @__PURE__ */ l("div", {
|
|
2010
|
-
title: `${e}: ${t}`,
|
|
2011
|
-
style: {
|
|
2012
|
-
width: 36,
|
|
2013
|
-
height: 36,
|
|
2014
|
-
borderRadius: 6,
|
|
2015
|
-
background: t,
|
|
2016
|
-
border: `2px solid ${h.border}`,
|
|
2017
|
-
cursor: "default",
|
|
2018
|
-
flexShrink: 0
|
|
2019
|
-
}
|
|
2020
|
-
}, e))
|
|
2021
|
-
})]
|
|
2022
|
-
})
|
|
2023
|
-
]
|
|
2024
|
-
}),
|
|
2025
|
-
typeof B == "function" && null,
|
|
2026
|
-
typeof c.bg == "string" && null
|
|
2027
|
-
]
|
|
2028
|
-
});
|
|
2029
|
-
}
|
|
2030
|
-
//#endregion
|
|
2031
|
-
//#region src/components/TkxPlayground.tsx
|
|
2032
|
-
var z = [
|
|
2033
|
-
"fetch(",
|
|
2034
|
-
"XMLHttpRequest",
|
|
2035
|
-
"navigator.sendBeacon",
|
|
2036
|
-
"document.cookie",
|
|
2037
|
-
"localStorage",
|
|
2038
|
-
"sessionStorage",
|
|
2039
|
-
"indexedDB",
|
|
2040
|
-
"WebSocket",
|
|
2041
|
-
"EventSource",
|
|
2042
|
-
"import(",
|
|
2043
|
-
"eval(",
|
|
2044
|
-
"new Function(",
|
|
2045
|
-
"postMessage",
|
|
2046
|
-
"window.open",
|
|
2047
|
-
"location.href",
|
|
2048
|
-
"location.replace",
|
|
2049
|
-
"location.assign",
|
|
2050
|
-
"document.write",
|
|
2051
|
-
"crypto.subtle"
|
|
2052
|
-
];
|
|
2053
|
-
function B(e, t) {
|
|
2054
|
-
let n = [...z, ...t ?? []], r = e.toLowerCase();
|
|
2055
|
-
for (let e of n) if (r.includes(e.toLowerCase())) return e;
|
|
2056
|
-
return null;
|
|
2057
|
-
}
|
|
2058
|
-
var V = [
|
|
2059
|
-
{
|
|
2060
|
-
label: "Hello World",
|
|
2061
|
-
code: "<div style={{ padding: 24, fontFamily: 'sans-serif', color: '#e8e8f4' }}>\n <h2 style={{ margin: 0 }}>👋 Hello, TkxPlayground!</h2>\n <p style={{ marginTop: 8, opacity: 0.7 }}>Edit the code on the left to see live updates.</p>\n</div>"
|
|
2062
|
-
},
|
|
2063
|
-
{
|
|
2064
|
-
label: "Button Styles",
|
|
2065
|
-
code: "<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', padding: 24 }}>\n {['primary', 'success', 'danger', 'warning', 'info'].map(color => (\n <button\n key={color}\n style={{\n padding: '8px 18px',\n borderRadius: 8,\n border: 'none',\n background: color === 'primary' ? '#00f5d4' : color === 'success' ? '#06d6a0' : color === 'danger' ? '#f72585' : color === 'warning' ? '#ffbe0b' : '#3a86ff',\n color: '#0a0a0f',\n fontWeight: 700,\n cursor: 'pointer',\n textTransform: 'capitalize',\n }}\n >\n {color}\n </button>\n ))}\n</div>"
|
|
2066
|
-
},
|
|
2067
|
-
{
|
|
2068
|
-
label: "Card Grid",
|
|
2069
|
-
code: "<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16, padding: 24 }}>\n {['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta'].map(name => (\n <div key={name} style={{\n background: '#1a1a2e',\n borderRadius: 10,\n border: '1px solid #2a2a3e',\n padding: '16px',\n }}>\n <div style={{ fontWeight: 700, color: '#00f5d4', marginBottom: 4 }}>{name}</div>\n <div style={{ fontSize: 12, color: '#8888aa' }}>Quantum module {name.toLowerCase()}</div>\n </div>\n ))}\n</div>"
|
|
2070
|
-
},
|
|
2071
|
-
{
|
|
2072
|
-
label: "Animated Counter",
|
|
2073
|
-
code: "(() => {\n const [count, setCount] = React.useState(0);\n return (\n <div style={{ padding: 32, textAlign: 'center', fontFamily: 'sans-serif' }}>\n <div style={{ fontSize: 64, fontWeight: 900, color: '#00f5d4', marginBottom: 16 }}>\n {count}\n </div>\n <div style={{ display: 'flex', gap: 12, justifyContent: 'center' }}>\n <button onClick={() => setCount(c => c - 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>−</button>\n <button onClick={() => setCount(0)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#8888aa', cursor: 'pointer' }}>Reset</button>\n <button onClick={() => setCount(c => c + 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>+</button>\n </div>\n </div>\n );\n})()"
|
|
2074
|
-
},
|
|
2075
|
-
{
|
|
2076
|
-
label: "Data Table",
|
|
2077
|
-
code: "(() => {\n const rows = [\n { id: 1, name: 'Hydrogen', symbol: 'H', mass: 1.008 },\n { id: 2, name: 'Helium', symbol: 'He', mass: 4.003 },\n { id: 3, name: 'Lithium', symbol: 'Li', mass: 6.941 },\n { id: 4, name: 'Carbon', symbol: 'C', mass: 12.011 },\n { id: 5, name: 'Nitrogen', symbol: 'N', mass: 14.007 },\n ];\n const cell = { padding: '8px 14px', borderBottom: '1px solid #2a2a3e', color: '#e8e8f4', fontSize: 13 };\n const hcell = { ...cell, color: '#8888aa', fontWeight: 600, fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.06em' };\n return (\n <div style={{ padding: 16 }}>\n <table style={{ width: '100%', borderCollapse: 'collapse', fontFamily: 'sans-serif' }}>\n <thead>\n <tr>{['ID','Element','Symbol','Atomic Mass'].map(h => <th key={h} style={hcell}>{h}</th>)}</tr>\n </thead>\n <tbody>\n {rows.map(r => (\n <tr key={r.id} style={{ transition: 'background 0.15s' }}>\n <td style={cell}>{r.id}</td>\n <td style={cell}>{r.name}</td>\n <td style={{ ...cell, color: '#00f5d4', fontWeight: 700 }}>{r.symbol}</td>\n <td style={cell}>{r.mass}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n})()"
|
|
2078
|
-
}
|
|
2079
|
-
], H = class extends r.Component {
|
|
2080
|
-
constructor(e) {
|
|
2081
|
-
super(e), this.state = { hasError: !1 };
|
|
2082
|
-
}
|
|
2083
|
-
static getDerivedStateFromError() {
|
|
2084
|
-
return { hasError: !0 };
|
|
2085
|
-
}
|
|
2086
|
-
componentDidCatch(e) {
|
|
2087
|
-
this.props.onError(e.message);
|
|
2088
|
-
}
|
|
2089
|
-
componentDidUpdate(e) {
|
|
2090
|
-
e.children !== this.props.children && this.state.hasError && this.setState({ hasError: !1 });
|
|
2091
|
-
}
|
|
2092
|
-
render() {
|
|
2093
|
-
return this.state.hasError ? null : this.props.children;
|
|
2094
|
-
}
|
|
2095
|
-
};
|
|
2096
|
-
function U() {
|
|
2097
|
-
return typeof window > "u" ? null : window.Babel ?? null;
|
|
2098
|
-
}
|
|
2099
|
-
function W(e, t, n) {
|
|
2100
|
-
let i = performance.now();
|
|
2101
|
-
try {
|
|
2102
|
-
let a = e.trim();
|
|
2103
|
-
if (n?.strictMode !== !1) {
|
|
2104
|
-
let e = B(a, n?.forbiddenTokens);
|
|
2105
|
-
if (e) {
|
|
2106
|
-
let t = parseFloat((performance.now() - i).toFixed(2));
|
|
2107
|
-
return {
|
|
2108
|
-
element: null,
|
|
2109
|
-
error: `Blocked by playground strictMode: code contains "${e}". This token is disallowed because playground snippets run in the page's JavaScript context. If you trust the source, pass strictMode={false} to <TkxPlayground>.`,
|
|
2110
|
-
renderMs: t
|
|
2111
|
-
};
|
|
2112
|
-
}
|
|
2113
|
-
}
|
|
2114
|
-
let o = `
|
|
2115
|
-
function PlaygroundRoot() {
|
|
2116
|
-
${a.startsWith("<") || a.startsWith("(") ? `return (${a});` : a}
|
|
2117
|
-
}
|
|
2118
|
-
`, s = U();
|
|
2119
|
-
s && (o = s.transform(o, {
|
|
2120
|
-
presets: ["react"],
|
|
2121
|
-
filename: "playground.jsx"
|
|
2122
|
-
}).code ?? o);
|
|
2123
|
-
let c = Function("React", "imports", `
|
|
2124
|
-
"use strict";
|
|
2125
|
-
const { ${Object.keys(t).join(", ")} } = imports;
|
|
2126
|
-
${o}
|
|
2127
|
-
return PlaygroundRoot;
|
|
2128
|
-
`)(r, t);
|
|
2129
|
-
return {
|
|
2130
|
-
element: r.createElement(c),
|
|
2131
|
-
error: null,
|
|
2132
|
-
renderMs: parseFloat((performance.now() - i).toFixed(2))
|
|
2133
|
-
};
|
|
2134
|
-
} catch (e) {
|
|
2135
|
-
let t = parseFloat((performance.now() - i).toFixed(2));
|
|
2136
|
-
return {
|
|
2137
|
-
element: null,
|
|
2138
|
-
error: e instanceof Error ? e.message : String(e),
|
|
2139
|
-
renderMs: t
|
|
2140
|
-
};
|
|
2141
|
-
}
|
|
2142
|
-
}
|
|
2143
|
-
function G({ code: e, lineHeight: t }) {
|
|
2144
|
-
let n = e.split("\n");
|
|
2145
|
-
return /* @__PURE__ */ l("div", {
|
|
2146
|
-
"aria-hidden": "true",
|
|
2147
|
-
style: {
|
|
2148
|
-
position: "absolute",
|
|
2149
|
-
top: 0,
|
|
2150
|
-
left: 0,
|
|
2151
|
-
width: "36px",
|
|
2152
|
-
padding: "12px 0",
|
|
2153
|
-
textAlign: "right",
|
|
2154
|
-
paddingRight: "8px",
|
|
2155
|
-
userSelect: "none",
|
|
2156
|
-
pointerEvents: "none",
|
|
2157
|
-
fontSize: "12px",
|
|
2158
|
-
lineHeight: `${t}px`,
|
|
2159
|
-
color: "#555577",
|
|
2160
|
-
fontFamily: "\"Fira Code\", \"Cascadia Code\", \"Consolas\", monospace",
|
|
2161
|
-
boxSizing: "border-box"
|
|
2162
|
-
},
|
|
2163
|
-
children: n.map((e, t) => /* @__PURE__ */ l("div", { children: t + 1 }, t))
|
|
2164
|
-
});
|
|
2165
|
-
}
|
|
2166
|
-
var K = /* @__PURE__ */ "TkxButton.TkxInput.TkxCard.TkxModal.TkxTable.TkxSelect.TkxCheckbox.TkxRadio.TkxSwitch.TkxSlider.TkxBadge.TkxAlert.TkxToast.TkxTooltip.TkxPopover.TkxTabs.TkxAccordion.TkxDrawer.TkxDropdown.TkxMenu.TkxForm.TkxDataGrid.TkxChart.TkxSpinner.TkxSkeleton.TkxAvatar.TkxTag.TkxDivider.TkxProgress.TkxStatistic.TkxQuantumForm.TkxPlayground".split("."), q = new g();
|
|
2167
|
-
function J(e) {
|
|
2168
|
-
let t = e.match(/([A-Z][a-zA-Z0-9]*)$/);
|
|
2169
|
-
return t ? t[1] : "";
|
|
2170
|
-
}
|
|
2171
|
-
function Y(e, t = 4) {
|
|
2172
|
-
if (!e || e.length < 2) return [];
|
|
2173
|
-
let n = e.toLowerCase();
|
|
2174
|
-
return q.amplify(K, (e) => {
|
|
2175
|
-
let t = e.toLowerCase();
|
|
2176
|
-
if (t.startsWith(n)) return 1;
|
|
2177
|
-
if (t.includes(n)) return .7;
|
|
2178
|
-
let r = 0;
|
|
2179
|
-
for (let e = 0; e < n.length - 1; e++) t.includes(n.slice(e, e + 2)) && (r += .15);
|
|
2180
|
-
return Math.min(r, .5);
|
|
2181
|
-
}, .1).slice(0, t).map((e) => ({
|
|
2182
|
-
name: K[e.index] ?? "",
|
|
2183
|
-
amplitude: parseFloat(e.combined.toFixed(3))
|
|
2184
|
-
})).filter((e) => e.name !== "");
|
|
2185
|
-
}
|
|
2186
|
-
function X({ defaultCode: t, examples: n, height: r = 480, imports: c = {}, strictMode: d = !0, forbiddenTokens: f }) {
|
|
2187
|
-
let p = e(), m = [...V, ...n ?? []], h = t ?? V[0].code, [g, _] = s(h), [v, y] = s({
|
|
2188
|
-
element: null,
|
|
2189
|
-
error: null,
|
|
2190
|
-
renderMs: 0
|
|
2191
|
-
}), [b, x] = s(null), [S, C] = s([]), [w, T] = s(!1), [E, D] = s(0), O = o(null), k = o(null), A = i((e) => {
|
|
2192
|
-
x(null), y(W(e, c, {
|
|
2193
|
-
strictMode: d,
|
|
2194
|
-
forbiddenTokens: f
|
|
2195
|
-
}));
|
|
2196
|
-
}, [
|
|
2197
|
-
c,
|
|
2198
|
-
d,
|
|
2199
|
-
f
|
|
2200
|
-
]);
|
|
2201
|
-
a(() => (k.current && clearTimeout(k.current), k.current = setTimeout(() => A(g), 300), () => {
|
|
2202
|
-
k.current && clearTimeout(k.current);
|
|
2203
|
-
}), [g, A]), a(() => {
|
|
2204
|
-
A(h);
|
|
2205
|
-
}, []);
|
|
2206
|
-
let j = i((e) => {
|
|
2207
|
-
let t = e.target.value;
|
|
2208
|
-
_(t);
|
|
2209
|
-
let n = J(t);
|
|
2210
|
-
n.length >= 2 ? C(Y(n, 4)) : C([]);
|
|
2211
|
-
}, []), M = i((e) => {
|
|
2212
|
-
let t = m[e];
|
|
2213
|
-
t && (D(e), _(t.code), C([]));
|
|
2214
|
-
}, [m]), N = i(async () => {
|
|
2215
|
-
try {
|
|
2216
|
-
await navigator.clipboard.writeText(g), T(!0), setTimeout(() => T(!1), 1500);
|
|
2217
|
-
} catch {}
|
|
2218
|
-
}, [g]), P = i(() => {
|
|
2219
|
-
_(h), D(0), C([]);
|
|
2220
|
-
}, [h]), F = i((e) => {
|
|
2221
|
-
let t = J(g);
|
|
2222
|
-
t && _((n) => n.slice(0, n.lastIndexOf(t)) + e), C([]);
|
|
2223
|
-
}, [g]), I = v.error !== null || b !== null, L = v.error ?? b ?? "", R = p.bg, z = p.surfaceAlt, B = p.border, U = p.surface, K = {
|
|
2224
|
-
width: "50%",
|
|
2225
|
-
display: "flex",
|
|
2226
|
-
flexDirection: "column",
|
|
2227
|
-
borderRight: `1px solid ${B}`,
|
|
2228
|
-
position: "relative"
|
|
2229
|
-
}, q = {
|
|
2230
|
-
display: "flex",
|
|
2231
|
-
alignItems: "center",
|
|
2232
|
-
gap: "6px",
|
|
2233
|
-
padding: "6px 10px",
|
|
2234
|
-
borderBottom: `1px solid ${B}`,
|
|
2235
|
-
backgroundColor: p.surface,
|
|
2236
|
-
flexWrap: "wrap"
|
|
2237
|
-
}, X = {
|
|
2238
|
-
padding: "3px 10px",
|
|
2239
|
-
borderRadius: "6px",
|
|
2240
|
-
border: `1px solid ${B}`,
|
|
2241
|
-
backgroundColor: "transparent",
|
|
2242
|
-
color: p.textMuted,
|
|
2243
|
-
fontSize: "11px",
|
|
2244
|
-
fontWeight: 600,
|
|
2245
|
-
cursor: "pointer",
|
|
2246
|
-
fontFamily: "inherit",
|
|
2247
|
-
transition: "color 0.15s, border-color 0.15s"
|
|
2248
|
-
};
|
|
2249
|
-
return /* @__PURE__ */ u("div", {
|
|
2250
|
-
style: {
|
|
2251
|
-
display: "flex",
|
|
2252
|
-
flexDirection: "column",
|
|
2253
|
-
border: `1px solid ${B}`,
|
|
2254
|
-
borderRadius: "12px",
|
|
2255
|
-
overflow: "hidden",
|
|
2256
|
-
backgroundColor: R,
|
|
2257
|
-
fontFamily: "inherit",
|
|
2258
|
-
boxSizing: "border-box",
|
|
2259
|
-
position: "relative"
|
|
2260
|
-
},
|
|
2261
|
-
children: [
|
|
2262
|
-
/* @__PURE__ */ u("div", {
|
|
2263
|
-
style: {
|
|
2264
|
-
display: "flex",
|
|
2265
|
-
alignItems: "center",
|
|
2266
|
-
justifyContent: "space-between",
|
|
2267
|
-
padding: "8px 14px",
|
|
2268
|
-
borderBottom: `1px solid ${B}`,
|
|
2269
|
-
backgroundColor: p.surface
|
|
2270
|
-
},
|
|
2271
|
-
children: [/* @__PURE__ */ l("span", {
|
|
2272
|
-
style: {
|
|
2273
|
-
fontSize: "12px",
|
|
2274
|
-
fontWeight: 700,
|
|
2275
|
-
color: p.primary,
|
|
2276
|
-
letterSpacing: "0.05em"
|
|
2277
|
-
},
|
|
2278
|
-
children: "⚛ TkxPlayground"
|
|
2279
|
-
}), /* @__PURE__ */ l("span", {
|
|
2280
|
-
style: {
|
|
2281
|
-
fontSize: "10px",
|
|
2282
|
-
color: p.textMuted
|
|
2283
|
-
},
|
|
2284
|
-
children: "Live JSX Preview"
|
|
2285
|
-
})]
|
|
2286
|
-
}),
|
|
2287
|
-
/* @__PURE__ */ l("div", {
|
|
2288
|
-
style: {
|
|
2289
|
-
display: "flex",
|
|
2290
|
-
gap: "4px",
|
|
2291
|
-
padding: "6px 10px",
|
|
2292
|
-
borderBottom: `1px solid ${B}`,
|
|
2293
|
-
backgroundColor: p.surface,
|
|
2294
|
-
overflowX: "auto"
|
|
2295
|
-
},
|
|
2296
|
-
children: m.map((e, t) => /* @__PURE__ */ l("button", {
|
|
2297
|
-
onClick: () => M(t),
|
|
2298
|
-
style: {
|
|
2299
|
-
padding: "3px 10px",
|
|
2300
|
-
borderRadius: "6px",
|
|
2301
|
-
border: `1px solid ${t === E ? p.primary : B}`,
|
|
2302
|
-
backgroundColor: t === E ? `${p.primary}20` : "transparent",
|
|
2303
|
-
color: t === E ? p.primary : p.textMuted,
|
|
2304
|
-
fontSize: "11px",
|
|
2305
|
-
fontWeight: t === E ? 700 : 400,
|
|
2306
|
-
cursor: "pointer",
|
|
2307
|
-
whiteSpace: "nowrap",
|
|
2308
|
-
fontFamily: "inherit",
|
|
2309
|
-
transition: "all 0.15s"
|
|
2310
|
-
},
|
|
2311
|
-
children: e.label
|
|
2312
|
-
}, t))
|
|
2313
|
-
}),
|
|
2314
|
-
/* @__PURE__ */ u("div", {
|
|
2315
|
-
style: {
|
|
2316
|
-
display: "flex",
|
|
2317
|
-
height: `${r}px`
|
|
2318
|
-
},
|
|
2319
|
-
children: [/* @__PURE__ */ u("div", {
|
|
2320
|
-
style: K,
|
|
2321
|
-
children: [
|
|
2322
|
-
/* @__PURE__ */ u("div", {
|
|
2323
|
-
style: q,
|
|
2324
|
-
children: [
|
|
2325
|
-
/* @__PURE__ */ l("span", {
|
|
2326
|
-
style: {
|
|
2327
|
-
fontSize: "11px",
|
|
2328
|
-
color: p.textMuted,
|
|
2329
|
-
marginRight: "auto"
|
|
2330
|
-
},
|
|
2331
|
-
children: "editor.tsx"
|
|
2332
|
-
}),
|
|
2333
|
-
/* @__PURE__ */ l("button", {
|
|
2334
|
-
onClick: N,
|
|
2335
|
-
style: X,
|
|
2336
|
-
title: "Copy code",
|
|
2337
|
-
children: w ? "✓ Copied" : "⎘ Copy"
|
|
2338
|
-
}),
|
|
2339
|
-
/* @__PURE__ */ l("button", {
|
|
2340
|
-
onClick: P,
|
|
2341
|
-
style: X,
|
|
2342
|
-
title: "Reset to default",
|
|
2343
|
-
children: "↺ Reset"
|
|
2344
|
-
})
|
|
2345
|
-
]
|
|
2346
|
-
}),
|
|
2347
|
-
/* @__PURE__ */ u("div", {
|
|
2348
|
-
style: {
|
|
2349
|
-
position: "relative",
|
|
2350
|
-
flex: 1,
|
|
2351
|
-
overflow: "hidden"
|
|
2352
|
-
},
|
|
2353
|
-
children: [/* @__PURE__ */ l(G, {
|
|
2354
|
-
code: g,
|
|
2355
|
-
lineHeight: 18
|
|
2356
|
-
}), /* @__PURE__ */ l("textarea", {
|
|
2357
|
-
ref: O,
|
|
2358
|
-
value: g,
|
|
2359
|
-
onChange: j,
|
|
2360
|
-
spellCheck: !1,
|
|
2361
|
-
autoCorrect: "off",
|
|
2362
|
-
autoCapitalize: "off",
|
|
2363
|
-
style: {
|
|
2364
|
-
position: "absolute",
|
|
2365
|
-
top: 0,
|
|
2366
|
-
left: 0,
|
|
2367
|
-
width: "100%",
|
|
2368
|
-
height: "100%",
|
|
2369
|
-
padding: "12px 12px 12px 44px",
|
|
2370
|
-
margin: 0,
|
|
2371
|
-
border: "none",
|
|
2372
|
-
outline: "none",
|
|
2373
|
-
resize: "none",
|
|
2374
|
-
backgroundColor: R,
|
|
2375
|
-
color: p.text,
|
|
2376
|
-
fontSize: "12px",
|
|
2377
|
-
lineHeight: "18px",
|
|
2378
|
-
fontFamily: "\"Fira Code\", \"Cascadia Code\", \"Consolas\", \"Courier New\", monospace",
|
|
2379
|
-
boxSizing: "border-box",
|
|
2380
|
-
overflowY: "auto",
|
|
2381
|
-
tabSize: 2
|
|
2382
|
-
}
|
|
2383
|
-
})]
|
|
2384
|
-
}),
|
|
2385
|
-
S.length > 0 && /* @__PURE__ */ u("div", {
|
|
2386
|
-
style: {
|
|
2387
|
-
position: "absolute",
|
|
2388
|
-
bottom: "40px",
|
|
2389
|
-
left: "44px",
|
|
2390
|
-
zIndex: 10,
|
|
2391
|
-
backgroundColor: p.surface,
|
|
2392
|
-
border: `1px solid ${p.primary}44`,
|
|
2393
|
-
borderRadius: "8px",
|
|
2394
|
-
overflow: "hidden",
|
|
2395
|
-
boxShadow: "0 4px 16px rgba(0,0,0,0.3)",
|
|
2396
|
-
minWidth: "180px"
|
|
2397
|
-
},
|
|
2398
|
-
children: [/* @__PURE__ */ l("div", {
|
|
2399
|
-
style: {
|
|
2400
|
-
padding: "4px 10px 4px",
|
|
2401
|
-
fontSize: "10px",
|
|
2402
|
-
color: p.primary,
|
|
2403
|
-
fontWeight: 700,
|
|
2404
|
-
borderBottom: `1px solid ${B}`,
|
|
2405
|
-
letterSpacing: "0.05em"
|
|
2406
|
-
},
|
|
2407
|
-
children: "⚛ Quantum Suggestions"
|
|
2408
|
-
}), S.map((e) => /* @__PURE__ */ u("button", {
|
|
2409
|
-
onClick: () => F(e.name),
|
|
2410
|
-
style: {
|
|
2411
|
-
display: "flex",
|
|
2412
|
-
alignItems: "center",
|
|
2413
|
-
justifyContent: "space-between",
|
|
2414
|
-
width: "100%",
|
|
2415
|
-
padding: "6px 10px",
|
|
2416
|
-
border: "none",
|
|
2417
|
-
backgroundColor: "transparent",
|
|
2418
|
-
color: p.text,
|
|
2419
|
-
fontSize: "12px",
|
|
2420
|
-
fontFamily: "\"Fira Code\", monospace",
|
|
2421
|
-
cursor: "pointer",
|
|
2422
|
-
textAlign: "left",
|
|
2423
|
-
gap: "12px"
|
|
2424
|
-
},
|
|
2425
|
-
children: [/* @__PURE__ */ l("span", { children: e.name }), /* @__PURE__ */ u("span", {
|
|
2426
|
-
style: {
|
|
2427
|
-
fontSize: "10px",
|
|
2428
|
-
color: p.textMuted,
|
|
2429
|
-
flexShrink: 0
|
|
2430
|
-
},
|
|
2431
|
-
children: [Math.round(e.amplitude * 100), "%"]
|
|
2432
|
-
})]
|
|
2433
|
-
}, e.name))]
|
|
2434
|
-
})
|
|
2435
|
-
]
|
|
2436
|
-
}), /* @__PURE__ */ u("div", {
|
|
2437
|
-
style: {
|
|
2438
|
-
width: "50%",
|
|
2439
|
-
display: "flex",
|
|
2440
|
-
flexDirection: "column"
|
|
2441
|
-
},
|
|
2442
|
-
children: [/* @__PURE__ */ l("div", {
|
|
2443
|
-
style: {
|
|
2444
|
-
padding: "6px 10px",
|
|
2445
|
-
borderBottom: `1px solid ${B}`,
|
|
2446
|
-
backgroundColor: p.surface,
|
|
2447
|
-
fontSize: "11px",
|
|
2448
|
-
color: p.textMuted,
|
|
2449
|
-
fontWeight: 600
|
|
2450
|
-
},
|
|
2451
|
-
children: "Preview"
|
|
2452
|
-
}), /* @__PURE__ */ l("div", {
|
|
2453
|
-
style: {
|
|
2454
|
-
flex: 1,
|
|
2455
|
-
overflow: "auto",
|
|
2456
|
-
backgroundColor: z,
|
|
2457
|
-
position: "relative"
|
|
2458
|
-
},
|
|
2459
|
-
children: I ? /* @__PURE__ */ u("div", {
|
|
2460
|
-
style: {
|
|
2461
|
-
padding: "16px",
|
|
2462
|
-
color: p.danger,
|
|
2463
|
-
fontFamily: "\"Fira Code\", monospace",
|
|
2464
|
-
fontSize: "12px",
|
|
2465
|
-
lineHeight: 1.6,
|
|
2466
|
-
whiteSpace: "pre-wrap",
|
|
2467
|
-
wordBreak: "break-word"
|
|
2468
|
-
},
|
|
2469
|
-
children: [/* @__PURE__ */ u("div", {
|
|
2470
|
-
style: {
|
|
2471
|
-
marginBottom: "8px",
|
|
2472
|
-
fontWeight: 700,
|
|
2473
|
-
display: "flex",
|
|
2474
|
-
alignItems: "center",
|
|
2475
|
-
gap: "6px"
|
|
2476
|
-
},
|
|
2477
|
-
children: [/* @__PURE__ */ l("svg", {
|
|
2478
|
-
width: "14",
|
|
2479
|
-
height: "14",
|
|
2480
|
-
viewBox: "0 0 24 24",
|
|
2481
|
-
fill: "currentColor",
|
|
2482
|
-
"aria-hidden": "true",
|
|
2483
|
-
children: /* @__PURE__ */ l("path", { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z" })
|
|
2484
|
-
}), "Runtime Error"]
|
|
2485
|
-
}), L]
|
|
2486
|
-
}) : /* @__PURE__ */ l(H, {
|
|
2487
|
-
onError: x,
|
|
2488
|
-
children: /* @__PURE__ */ l("div", {
|
|
2489
|
-
style: { minHeight: "100%" },
|
|
2490
|
-
children: v.element
|
|
2491
|
-
})
|
|
2492
|
-
})
|
|
2493
|
-
})]
|
|
2494
|
-
})]
|
|
2495
|
-
}),
|
|
2496
|
-
/* @__PURE__ */ u("div", {
|
|
2497
|
-
style: {
|
|
2498
|
-
display: "flex",
|
|
2499
|
-
alignItems: "center",
|
|
2500
|
-
gap: "16px",
|
|
2501
|
-
padding: "4px 12px",
|
|
2502
|
-
backgroundColor: U,
|
|
2503
|
-
borderTop: `1px solid ${B}`,
|
|
2504
|
-
fontSize: "11px",
|
|
2505
|
-
color: p.textMuted
|
|
2506
|
-
},
|
|
2507
|
-
children: [
|
|
2508
|
-
/* @__PURE__ */ u("span", {
|
|
2509
|
-
style: {
|
|
2510
|
-
display: "flex",
|
|
2511
|
-
alignItems: "center",
|
|
2512
|
-
gap: "4px",
|
|
2513
|
-
color: I ? p.danger : p.success,
|
|
2514
|
-
fontWeight: 600
|
|
2515
|
-
},
|
|
2516
|
-
children: [/* @__PURE__ */ l("span", { style: {
|
|
2517
|
-
width: "6px",
|
|
2518
|
-
height: "6px",
|
|
2519
|
-
borderRadius: "50%",
|
|
2520
|
-
backgroundColor: I ? p.danger : p.success,
|
|
2521
|
-
display: "inline-block"
|
|
2522
|
-
} }), I ? "Error" : "OK"]
|
|
2523
|
-
}),
|
|
2524
|
-
/* @__PURE__ */ u("span", { children: [
|
|
2525
|
-
"⏱ ",
|
|
2526
|
-
v.renderMs,
|
|
2527
|
-
" ms"
|
|
2528
|
-
] }),
|
|
2529
|
-
/* @__PURE__ */ u("span", { children: [g.split("\n").length, " lines"] }),
|
|
2530
|
-
/* @__PURE__ */ u("span", { children: [g.length, " chars"] }),
|
|
2531
|
-
S.length > 0 && /* @__PURE__ */ u("span", {
|
|
2532
|
-
style: {
|
|
2533
|
-
marginLeft: "auto",
|
|
2534
|
-
color: p.primary,
|
|
2535
|
-
fontWeight: 600
|
|
2536
|
-
},
|
|
2537
|
-
children: [
|
|
2538
|
-
"⚛ ",
|
|
2539
|
-
S.length,
|
|
2540
|
-
" suggestion",
|
|
2541
|
-
S.length > 1 ? "s" : ""
|
|
2542
|
-
]
|
|
2543
|
-
})
|
|
2544
|
-
]
|
|
2545
|
-
})
|
|
2546
|
-
]
|
|
2547
|
-
});
|
|
2548
|
-
}
|
|
2549
|
-
X.displayName = "TkxPlayground";
|
|
2550
|
-
//#endregion
|
|
2551
|
-
export { g as AmplitudeAmplifier, D as QuantumAI, m as QuantumAnnealer, h as QuantumBoltzmannMachine, p as QuantumRegister, f as Qubit, X as TkxPlayground, N as TkxQuantumForm, R as TkxThemeBuilder, y as hslToHex, v as inferFieldIntelligence, E as optimizeThemeColors };
|
|
1
|
+
import{f as e}from"./chunk-PJ50l0JC.js";import{E as t,a as n}from"./chunk-DnCXUUx5.js";import r,{useCallback as o,useEffect as i,useRef as a,useState as l}from"react";import{Fragment as s,jsx as d,jsxs as c}from"react/jsx-runtime";var p=class e{constructor(e,t){this.re=e,this.im=t}add(t){return new e(this.re+t.re,this.im+t.im)}sub(t){return new e(this.re-t.re,this.im-t.im)}mul(t){return new e(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)}scale(t){return new e(this.re*t,this.im*t)}conjugate(){return new e(this.re,-this.im)}magnitudeSquared(){return this.re*this.re+this.im*this.im}magnitude(){return Math.sqrt(this.magnitudeSquared())}static fromPolar(t,n){return new e(t*Math.cos(n),t*Math.sin(n))}static zero(){return new e(0,0)}static one(){return new e(1,0)}},h=class e{constructor(e=p.one(),t=p.zero()){this.alpha=e,this.beta=t,this.normalize()}normalize(){const e=Math.sqrt(this.alpha.magnitudeSquared()+this.beta.magnitudeSquared());e>0&&(this.alpha=this.alpha.scale(1/e),this.beta=this.beta.scale(1/e))}hadamard(){const t=1/Math.SQRT2;return new e(this.alpha.add(this.beta).scale(t),this.alpha.sub(this.beta).scale(t))}ry(t){const n=Math.cos(t/2),r=Math.sin(t/2);return new e(this.alpha.scale(n).sub(this.beta.scale(r)),this.alpha.scale(r).add(this.beta.scale(n)))}phase(t){const n=p.fromPolar(1,t);return new e(this.alpha,this.beta.mul(n))}measure(){const e=this.beta.magnitudeSquared();return Math.random()<e?1:0}expectation(){return this.beta.magnitudeSquared()}getAlpha(){return this.alpha}getBeta(){return this.beta}},u=class{constructor(e){this.qubits=Array.from({length:e},()=>new h)}get size(){return this.qubits.length}getQubit(e){return this.qubits[e]}superpose(){this.qubits=this.qubits.map(e=>e.hadamard())}cnot(e,t){const n=this.qubits[e],r=this.qubits[t],o=n.expectation();this.qubits[t]=r.ry(Math.PI*o)}rotate(e,t){this.qubits[e]=this.qubits[e].ry(t)}measure(){return this.qubits.map(e=>e.measure())}probs(){return this.qubits.map(e=>e.expectation())}},g=class{constructor(e=1,t=.995,n=.3,r=1e-6){this.temperature=e,this.coolingRate=t,this.tunnelingStrength=n,this.minTemp=r}anneal(e,t,n,r=1e3){let o=e,i=t(o),a=o,l=i,s=this.temperature,d=0,c=0;for(let p=0;p<r&&s>this.minTemp;p++){const e=n(o),r=t(e),p=r-i;let h=!1;if(p<=0)h=!0;else{const e=Math.exp(-p/s),t=Math.sqrt(2*Math.abs(p)),n=Math.abs(p),r=Math.exp(-2*t*Math.sqrt(n)*this.tunnelingStrength);Math.random()<e+r&&(h=!0,Math.random()<r/(e+r+1e-10)&&c++)}h&&(o=e,i=r,d++,i<l&&(a=o,l=i)),s*=this.coolingRate}return{state:a,energy:l,iterations:r,accepted:d,tunnels:c}}},m=class{constructor(e,t){const n=Math.sqrt(2/(e+t));this.weights=Array.from({length:e},()=>Array.from({length:t},()=>(2*Math.random()-1)*n)),this.visibleBias=Array.from({length:e},()=>0),this.hiddenBias=Array.from({length:t},()=>0)}sigmoid(e){const t=.1*(Math.random()-.5);return 1/(1+Math.exp(-(e+t)))}sample(e){return Math.random()<e?1:0}energy(e,t){const n=this.visibleBias.reduce((t,n,r)=>t+n*e[r],0),r=this.hiddenBias.reduce((e,n,r)=>e+n*t[r],0);let o=0;for(let i=0;i<e.length;i++)for(let n=0;n<t.length;n++)o+=e[i]*this.weights[i][n]*t[n];return-(n+r+o)}hiddenProbs(e){return this.hiddenBias.map((t,n)=>{const r=t+e.reduce((e,t,r)=>e+this.weights[r][n]*t,0);return this.sigmoid(r)})}visibleProbs(e){return this.visibleBias.map((t,n)=>{const r=t+e.reduce((e,t,r)=>e+this.weights[n][r]*t,0);return this.sigmoid(r)})}gibbs(e,t=1){let n=[...e],r=[];for(let o=0;o<t;o++)r=this.hiddenProbs(n).map(e=>this.sample(e)),n=this.visibleProbs(r).map(e=>this.sample(e));return{visible:n,hidden:r}}trainCD1(e,t=.01){const n=this.visibleBias.length,r=this.hiddenBias.length,o=Array.from({length:n},()=>Array(r).fill(0)),i=Array(n).fill(0),a=Array(r).fill(0);for(const s of e){const e=this.hiddenProbs(s),t=e.map(e=>this.sample(e)),l=this.visibleProbs(t).map(e=>this.sample(e)),d=this.hiddenProbs(l);for(let a=0;a<n;a++){for(let t=0;t<r;t++)o[a][t]+=s[a]*e[t]-l[a]*d[t];i[a]+=s[a]-l[a]}for(let n=0;n<r;n++)a[n]+=e[n]-d[n]}const l=e.length;for(let s=0;s<n;s++){for(let e=0;e<r;e++)this.weights[s][e]+=t*o[s][e]/l;this.visibleBias[s]+=t*i[s]/l}for(let s=0;s<r;s++)this.hiddenBias[s]+=t*a[s]/l}infer(e){const t=this.hiddenProbs(e),n=t.map(e=>this.sample(e));return{hidden:t,visible:this.visibleProbs(n),energy:this.energy(e,n),iterations:1}}},f=class{amplify(e,t,n=.5){const r=e.length;if(0===r)return[];const o=e.map(t),i=o.filter(e=>e>n).length,a=Math.max(1,i);let l=Array(r).fill(1/Math.sqrt(r));const s=Math.max(1,Math.floor(Math.PI/4*Math.sqrt(r/a)));for(let d=0;d<s;d++){for(let t=0;t<r;t++)o[t]>n&&(l[t]=-l[t]);const e=l.reduce((e,t)=>e+t,0)/r;l=l.map(t=>2*e-t)}return e.map((e,t)=>({index:t,amplitude:l[t],probability:l[t]*l[t],classicalSimilarity:o[t],combined:l[t]*l[t]*.6+.4*o[t]})).sort((e,t)=>t.combined-e.combined)}},y=[{keywords:["email","e-mail","mail"],type:"email",validations:[{rule:"required",message:"Email is required"},{rule:"pattern",value:"^[^@]+@[^@]+\\.[^@]+$",message:"Enter a valid email address"},{rule:"maxLength",value:254,message:"Email too long"}],placeholder:"you@example.com",label:"Email Address",confidence:.98},{keywords:["password","passwd","pwd","pass"],type:"password",validations:[{rule:"required",message:"Password is required"},{rule:"minLength",value:8,message:"Password must be at least 8 characters"},{rule:"pattern",value:"(?=.*[A-Z])(?=.*[0-9])",message:"Include uppercase and a number"}],placeholder:"••••••••",label:"Password",confidence:.97},{keywords:["confirm_password","confirmpassword","confirm_pass","repassword","password2","repeat_password"],type:"password",validations:[{rule:"required",message:"Please confirm your password"},{rule:"match",value:"password",message:"Passwords do not match"}],placeholder:"••••••••",label:"Confirm Password",confidence:.95},{keywords:["phone","mobile","cell","tel","telephone","contact_number"],type:"tel",validations:[{rule:"pattern",value:"^[+]?[(]?[0-9]{3}[)]?[-\\s.]?[0-9]{3}[-\\s.]?[0-9]{4,6}$",message:"Enter a valid phone number"}],placeholder:"+1 (555) 000-0000",label:"Phone Number",confidence:.93},{keywords:["age"],type:"number",validations:[{rule:"min",value:0,message:"Age cannot be negative"},{rule:"max",value:150,message:"Enter a valid age"},{rule:"integer",message:"Age must be a whole number"}],placeholder:"25",label:"Age",confidence:.9},{keywords:["price","amount","cost","fee","payment","salary","wage","total"],type:"number",validations:[{rule:"min",value:0,message:"Amount cannot be negative"},{rule:"pattern",value:"^\\d+(\\.\\d{1,2})?$",message:"Enter a valid amount (e.g. 9.99)"}],placeholder:"0.00",label:"Amount",confidence:.88},{keywords:["url","website","site","link","homepage","web"],type:"url",validations:[{rule:"pattern",value:"https?://.+",message:"Enter a valid URL starting with http:// or https://"}],placeholder:"https://example.com",label:"Website URL",confidence:.92},{keywords:["zip","zipcode","postal","postcode","pin_code"],type:"text",validations:[{rule:"pattern",value:"^[0-9]{5}(-[0-9]{4})?$",message:"Enter a valid ZIP code (e.g. 12345)"}],placeholder:"12345",label:"ZIP / Postal Code",confidence:.91},{keywords:["date","dob","birthday","birth_date","birthdate","born"],type:"date",validations:[{rule:"required",message:"Date is required"}],placeholder:"YYYY-MM-DD",label:"Date of Birth",confidence:.89},{keywords:["first_name","firstname","fname","given_name"],type:"text",validations:[{rule:"minLength",value:2,message:"First name too short"},{rule:"maxLength",value:50,message:"First name too long"}],placeholder:"Jane",label:"First Name",confidence:.9},{keywords:["last_name","lastname","lname","surname","family_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Last name too short"},{rule:"maxLength",value:50,message:"Last name too long"}],placeholder:"Doe",label:"Last Name",confidence:.9},{keywords:["name","full_name","fullname","display_name"],type:"text",validations:[{rule:"minLength",value:2,message:"Name too short"},{rule:"maxLength",value:100,message:"Name too long"}],placeholder:"Jane Doe",label:"Full Name",confidence:.85},{keywords:["username","user_name","handle","login","loginname"],type:"text",validations:[{rule:"minLength",value:3,message:"Username must be at least 3 characters"},{rule:"maxLength",value:32,message:"Username too long"},{rule:"pattern",value:"^[a-zA-Z0-9_.-]+$",message:"Only letters, numbers, _, - and . allowed"}],placeholder:"cooluser42",label:"Username",confidence:.94},{keywords:["bio","biography","about","description","summary","details"],type:"textarea",validations:[{rule:"maxLength",value:500,message:"Bio must be under 500 characters"}],placeholder:"Tell us about yourself...",label:"Bio",confidence:.87},{keywords:["message","comment","feedback","note","notes","remarks","body"],type:"textarea",validations:[{rule:"minLength",value:10,message:"Message too short"},{rule:"maxLength",value:2e3,message:"Message too long"}],placeholder:"Write your message here...",label:"Message",confidence:.86},{keywords:["search","query","q","keyword","find"],type:"search",validations:[],placeholder:"Search...",label:"Search",confidence:.9},{keywords:["otp","one_time_password","verification_code","pin","code"],type:"text",validations:[{rule:"minLength",value:4,message:"Code too short"},{rule:"maxLength",value:8,message:"Code too long"},{rule:"pattern",value:"^[0-9]+$",message:"Code must be numeric"}],placeholder:"123456",label:"Verification Code",confidence:.92},{keywords:["color","colour","hex_color","brand_color"],type:"color",validations:[],placeholder:"#3b82f6",label:"Color",confidence:.95},{keywords:["address","street","street_address","addr"],type:"text",validations:[{rule:"maxLength",value:200,message:"Address too long"}],placeholder:"123 Main Street",label:"Street Address",confidence:.87},{keywords:["city","town","municipality"],type:"text",validations:[{rule:"maxLength",value:100,message:"City name too long"}],placeholder:"San Francisco",label:"City",confidence:.89},{keywords:["country","nation","country_code"],type:"text",validations:[],placeholder:"United States",label:"Country",confidence:.88},{keywords:["company","organization","org","employer","company_name"],type:"text",validations:[{rule:"maxLength",value:200,message:"Company name too long"}],placeholder:"Acme Inc.",label:"Company",confidence:.87}];function x(e){const t=e.toLowerCase().replace(/[\s-]/g,"_"),n=(new f).amplify(y,e=>{let n=0;for(const r of e.keywords)t===r?n=Math.max(n,1):t.includes(r)||r.includes(t)?n=Math.max(n,.8):r.split("_").some(e=>t.includes(e))&&(n=Math.max(n,.5));return n},.3);if(n.length>0&&n[0].combined>.1){const e=y[n[0].index];return{type:e.type,validations:e.validations,placeholder:e.placeholder,confidence:Math.min(e.confidence*n[0].combined*2,.99),label:e.label}}return{type:"text",validations:[{rule:"maxLength",value:255,message:"Input too long"}],placeholder:e.replace(/_/g," "),confidence:.3,label:e.replace(/_/g," ").replace(/\b\w/g,e=>e.toUpperCase())}}function b(e,t,n){const r=n/100,o=t/100*Math.min(r,1-r),i=t=>{const n=(t+e/30)%12,i=r-o*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*i).toString(16).padStart(2,"0")};return`#${i(0)}${i(8)}${i(4)}`}function v(e){const[t,n,r]=function(e){const t=e.replace("#",""),n=3===t.length?t.split("").map(e=>e+e).join(""):t;return[parseInt(n.slice(0,2),16),parseInt(n.slice(2,4),16),parseInt(n.slice(4,6),16)]}(e).map(e=>{const t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4});return.2126*t+.7152*n+.0722*r}function k(e,t){const n=v(e),r=v(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function w(e,t,n){return Math.max(t,Math.min(n,e))}function S(e,t,n=800){const r=t?{primary:{h:e,s:70,l:55},secondary:{h:(e+137.5)%360,s:65,l:50},bg:{h:e,s:10,l:8},surface:{h:e,s:10,l:13},text:{h:e,s:15,l:90},border:{h:e,s:15,l:22},accent:{h:(e+120)%360,s:75,l:60}}:{primary:{h:e,s:65,l:40},secondary:{h:(e+137.5)%360,s:55,l:38},bg:{h:e,s:15,l:97},surface:{h:e,s:12,l:100},text:{h:e,s:15,l:12},border:{h:e,s:12,l:85},accent:{h:(e+120)%360,s:70,l:42}};return function(e,t){const n=e=>b(e.h,e.s,e.l),r=t?e.text.l-20:e.text.l+15;return{primary:n(e.primary),secondary:n(e.secondary),background:n(e.bg),surface:n(e.surface),text:n(e.text),textMuted:b(e.text.h,Math.max(0,e.text.s-10),Math.max(20,Math.min(85,r))),border:n(e.border),error:t?"#f87171":"#dc2626",warning:t?"#fbbf24":"#d97706",success:t?"#34d399":"#059669",accent:n(e.accent)}}(new g(1.5,.994,.35,1e-5).anneal(r,e=>function(e,t){let n=0;const r=e=>b(e.h,e.s,e.l),o=r(e.text),i=r(e.bg),a=r(e.surface),l=r(e.primary),s=k(o,i),d=k(o,a),c=k(l,i);s<4.5&&(n+=10*(4.5-s)),d<4.5&&(n+=8*(4.5-d)),c<3&&(n+=5*(3-c)),n+=.05*Math.abs((e.secondary.h-e.primary.h+360)%360-137.508),n+=.03*Math.abs((e.accent.h-e.primary.h+360)%360-120);const p=(e.primary.s+e.secondary.s)/2;p<20&&(n+=.5*(20-p)),p>90&&(n+=.5*(p-90));const h=e.bg.l;t?(h>25&&(n+=2*(h-25)),h<3&&(n+=2*(3-h)),e.text.l<70&&(n+=1.5*(70-e.text.l))):(h<90&&(n+=2*(90-h)),h>100&&(n+=2*(h-100)),e.text.l>30&&(n+=1.5*(e.text.l-30)));const u=Math.abs(e.surface.l-e.bg.l);return u<2&&(n+=2*(2-u)),u>12&&(n+=1*(u-12)),n}(e,t),e=>{const t=["primary","secondary","bg","surface","text","border","accent"],n=t[Math.floor(Math.random()*t.length)],r=["h","s","l"],o=r[Math.floor(Math.random()*r.length)],i=(Math.random()-.5)*("h"===o?30:15),a={...e,[n]:{...e[n]}};return a[n]="h"===o?{...a[n],h:(e[n].h+i+360)%360}:"s"===o?{...a[n],s:w(e[n].s+i,0,100)}:{...a[n],l:w(e[n].l+i,0,100)},a},n).state,t)}var C={qubit:()=>new h,register:e=>new u(e),annealer:(e,t,n)=>new g(e,t,n),qbm:(e,t)=>new m(e,t),amplifier:()=>new f,inferField:x,optimizeTheme:S,contrast:k,hslToHex:b};function M(e,t,n,r){const o=n.trim();switch(e){case"required":return""!==o;case"email":case"pattern":if("string"==typeof t)try{return""===o||new RegExp(t).test(o)}catch{return!0}return/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o);case"phone":return""===o||/^\+?[\d\s\-()]{7,15}$/.test(o);case"url":return""===o||/^https?:\/\/.+/.test(o);case"minLength":case"min":{const e=Number(t??0);return""===o||(isNaN(Number(o))?o.length>=e:Number(o)>=e)}case"maxLength":case"max":{const e=Number(t??1/0);return""===o||(isNaN(Number(o))?o.length<=e:Number(o)<=e)}case"integer":return""===o||/^\d+$/.test(o);case"alphanumeric":return""===o||/^[a-zA-Z0-9]+$/.test(o);case"match":return o===(r["string"==typeof t?t:"password"]??"");default:return!0}}function z({phase:e,collapsed:t,primaryColor:n,borderColor:r}){const o=12,i=t?0:e,a=t?0:1.618*e,l=o+10*Math.sin(i)*Math.cos(a),s=12-10*Math.cos(i);/* @__PURE__ */
|
|
2
|
+
return c("svg",{width:"24",height:"24",viewBox:"0 0 24 24","aria-hidden":"true",style:{flexShrink:0,opacity:t?.4:1,transition:"opacity 0.6s"},children:[
|
|
3
|
+
/* @__PURE__ */d("circle",{cx:o,cy:12,r:10,fill:"none",stroke:r,strokeWidth:"0.8"}),
|
|
4
|
+
/* @__PURE__ */d("ellipse",{cx:o,cy:12,rx:10,ry:3,fill:"none",stroke:r,strokeWidth:"0.5",strokeDasharray:"2 2"}),
|
|
5
|
+
/* @__PURE__ */d("line",{x1:o,y1:2,x2:o,y2:22,stroke:r,strokeWidth:"0.5"}),
|
|
6
|
+
/* @__PURE__ */d("line",{x1:o,y1:12,x2:l,y2:s,stroke:n,strokeWidth:"1.5",style:{transition:t?"all 0.6s ease-out":"none"}}),
|
|
7
|
+
/* @__PURE__ */d("circle",{cx:l,cy:s,r:"2",fill:n,style:{transition:t?"all 0.6s ease-out":"none"}})]})}function T({confidence:e,theme:t}){const n=Math.round(100*e),r=n>=80?t.success:n>=60?t.warning:t.danger;/* @__PURE__ */
|
|
8
|
+
return c("span",{style:{display:"inline-flex",alignItems:"center",gap:"2px",fontSize:"10px",fontWeight:600,padding:"1px 5px",borderRadius:"999px",backgroundColor:`${r}22`,color:r,border:`1px solid ${r}44`,marginLeft:"6px",verticalAlign:"middle",letterSpacing:"0.03em"},children:["⚛ ",n,"%"]})}function $({config:e,intel:n,qubitPhase:r,value:o,error:i,touched:a,showConfidence:l,showQuantumState:s,collapsed:p,onChange:h,onBlur:u,theme:g,mounted:m,index:f}){const y=e.type??n.type,x=e.label??n.label,b=e.placeholder??n.placeholder,v=void 0!==e.required?e.required:n.validations.some(e=>"required"===e.rule),k=t(x),w="textarea"===y,S=a&&""!==i,C=`qf-${e.name}`,M={width:"100%",padding:"9px 12px",border:`1.5px solid ${S?g.danger:g.border}`,borderRadius:"8px",backgroundColor:g.surface,color:g.text,fontSize:"14px",fontFamily:"inherit",outline:"none",boxSizing:"border-box",transition:"border-color 0.15s, box-shadow 0.15s",resize:w?"vertical":void 0,minHeight:w?"80px":void 0};/* @__PURE__ */
|
|
9
|
+
return c("div",{style:{display:"flex",flexDirection:"column",gap:"4px",opacity:m?1:0,transform:m?"scaleY(1)":"scaleY(0.92)",transition:`opacity 0.35s ease ${60*f}ms, transform 0.35s ease ${60*f}ms`,transformOrigin:"top"},children:[
|
|
10
|
+
/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[s&&/* @__PURE__ */d(z,{phase:r,collapsed:p,primaryColor:g.primary,borderColor:g.border}),
|
|
11
|
+
/* @__PURE__ */c("label",{htmlFor:C,style:{fontSize:"13px",fontWeight:500,color:g.text,cursor:"pointer"},children:[k,v&&/* @__PURE__ */d("span",{"aria-hidden":"true",style:{color:g.danger,marginLeft:"3px"},children:"*"})]}),l&&/* @__PURE__ */d(T,{confidence:n.confidence,theme:g})]}),w?/* @__PURE__ */d("textarea",{id:C,value:o,onChange:e=>h(e.target.value),onBlur:u,placeholder:b,"aria-invalid":S,"aria-required":v,style:M}):/* @__PURE__ */d("input",{id:C,type:y,value:o,onChange:e=>h(e.target.value),onBlur:u,placeholder:b,"aria-invalid":S,"aria-required":v,style:M}),S&&/* @__PURE__ */c("span",{role:"alert",style:{fontSize:"12px",color:g.danger,display:"flex",alignItems:"center",gap:"4px"},children:[/* @__PURE__ */d("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */d("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),t(i)]})]})}function A(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return(65535&t)/65535*Math.PI*2}function W({fields:r,onSubmit:a,submitLabel:p="Submit",layout:h="vertical",showConfidence:u=!0,showQuantumState:g=!1}){const m=e(),f=r.map(e=>x(e.name)),[y,b]=l(()=>Object.fromEntries(r.map(e=>[e.name,""]))),[v,k]=l({}),[w,S]=l({}),[C,z]=l(!1),[T,W]=l(!1),[R,B]=l(!1);i(()=>{const e=requestAnimationFrame(()=>W(!0));return()=>cancelAnimationFrame(e)},[]);const F=o((e,t)=>{const n=r.find(t=>t.name===e),o=f[r.findIndex(t=>t.name===e)];if(!n||!o)return"";const i=t[e]??"";for(const{rule:r,value:a,message:l}of o.validations)if(("required"!==r||!1!==n.required)&&!M(r,a,i,t))return l;return""},[r]),L=o(e=>{const t={};for(const n of r){const r=F(n.name,e);r&&(t[n.name]=r)}return t},[r,F]),I=o((e,t)=>{b(n=>{const o={...n,[e]:t};if(w[e]&&(k(t=>({...t,[e]:F(e,o)})),"password"===e)){const e=r.find(e=>["confirmpassword","confirm_password","passwordconfirm"].includes(e.name.toLowerCase().replace(/[\s_-]/g,"")))?.name;e&&w[e]&&k(t=>({...t,[e]:F(e,o)}))}return o}),B(!0)},[r,w,F]),P=o(e=>{S(t=>({...t,[e]:!0})),k(t=>({...t,[e]:F(e,y)}))},[y,F]),E=o(async e=>{e.preventDefault(),S(Object.fromEntries(r.map(e=>[e.name,!0])));const t=L(y);if(k(t),!(Object.keys(t).length>0)){z(!0);try{await a(y)}finally{z(!1)}}},[r,y,L,a]),_=f.length>0?Math.round(f.reduce((e,t)=>e+t.confidence,0)/f.length*100):0,q=_>=80?m.success:_>=60?m.warning:m.danger,D="horizontal"===h;/* @__PURE__ */
|
|
12
|
+
return c("form",{onSubmit:E,noValidate:!0,className:n("w-full"),style:{backgroundColor:m.surface,border:`1px solid ${m.border}`,borderRadius:"12px",padding:"24px",position:"relative",boxSizing:"border-box"},children:[
|
|
13
|
+
/* @__PURE__ */d("span",{"aria-label":"Powered by Quantum AI",style:{position:"absolute",top:"16px",right:"16px",fontSize:"10px",fontWeight:700,padding:"3px 8px",borderRadius:"999px",backgroundColor:`${m.primary}20`,color:m.primary,border:`1px solid ${m.primary}44`,letterSpacing:"0.04em",userSelect:"none"},children:"⚛ Quantum AI"}),u&&/* @__PURE__ */c("div",{style:{marginBottom:"20px",paddingRight:"100px"},children:[/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",marginBottom:"4px"},children:[/* @__PURE__ */d("span",{style:{fontSize:"11px",color:m.textMuted,fontWeight:500},children:"Form Intelligence Confidence"}),/* @__PURE__ */c("span",{style:{fontSize:"11px",fontWeight:700,color:q},children:[_,"%"]})]}),/* @__PURE__ */d("div",{style:{height:"4px",borderRadius:"4px",backgroundColor:m.border,overflow:"hidden"},children:/* @__PURE__ */d("div",{style:{height:"100%",width:`${_}%`,backgroundColor:q,borderRadius:"4px",transition:"width 0.8s ease"}})})]}),
|
|
14
|
+
/* @__PURE__ */d("div",{style:{display:"grid",gridTemplateColumns:D?"repeat(auto-fill, minmax(260px, 1fr))":"1fr",gap:"16px",marginBottom:"20px"},children:r.map((e,t)=>/* @__PURE__ */d($,{config:e,intel:f[t],qubitPhase:A(e.name),value:y[e.name]??"",error:v[e.name]??"",touched:w[e.name]??!1,showConfidence:u,showQuantumState:g,collapsed:R,onChange:t=>I(e.name,t),onBlur:()=>P(e.name),theme:m,mounted:T,index:t},e.name))}),
|
|
15
|
+
/* @__PURE__ */d("button",{type:"submit",disabled:C,style:{width:"100%",padding:"10px 20px",borderRadius:"8px",border:"none",backgroundColor:C?`${m.primary}88`:m.primary,color:m.bg,fontSize:"14px",fontWeight:700,fontFamily:"inherit",cursor:C?"not-allowed":"pointer",transition:"background-color 0.15s, opacity 0.15s",display:"flex",alignItems:"center",justifyContent:"center",gap:"8px"},children:C?/* @__PURE__ */c(s,{children:[/* @__PURE__ */c("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2.5",style:{animation:"qf-spin 0.8s linear infinite"},"aria-hidden":"true",children:[/* @__PURE__ */d("circle",{cx:"12",cy:"12",r:"10",strokeOpacity:"0.25"}),/* @__PURE__ */d("path",{d:"M12 2a10 10 0 0 1 10 10"})]}),"Processing…"]}):t(p)}),
|
|
16
|
+
/* @__PURE__ */d("style",{children:"@keyframes qf-spin { to { transform: rotate(360deg); } }"})]})}function R(e){return e?{primary:"#00f5d4",secondary:"#7b2ff7",background:"#0a0a0f",surface:"#12121a",text:"#e8e8f4",textMuted:"#8888aa",border:"#2a2a3e",error:"#f87171",warning:"#fbbf24",success:"#34d399",accent:"#ff6b6b"}:{primary:"#0d7c5f",secondary:"#6930c3",background:"#f8f6f1",surface:"#ffffff",text:"#1a1815",textMuted:"#6b6560",border:"#ddd8cc",error:"#dc2626",warning:"#d97706",success:"#059669",accent:"#e05a00"}}function B({points:e,primary:t}){if(e.length<2)/* @__PURE__ */return d("div",{style:{height:48,display:"flex",alignItems:"center",justifyContent:"center",color:"#888",fontSize:12},children:"Waiting for data..."});const n=Math.max(...e.map(e=>e.energy)),r=Math.min(...e.map(e=>e.energy)),o=n-r||1,i=e[e.length-1].iteration||1;/* @__PURE__ */
|
|
17
|
+
return c("svg",{width:280,height:48,style:{display:"block"},children:[
|
|
18
|
+
/* @__PURE__ */d("polyline",{points:e.map(e=>{const t=e.iteration/i*280,n=48-(e.energy-r)/o*44-2;return`${t.toFixed(1)},${n.toFixed(1)}`}).join(" "),fill:"none",stroke:t,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",opacity:.9}),
|
|
19
|
+
/* @__PURE__ */c("text",{x:2,y:10,fontSize:9,fill:"#888",children:["E=",n.toFixed(1)]}),
|
|
20
|
+
/* @__PURE__ */c("text",{x:2,y:46,fontSize:9,fill:"#888",children:["E=",r.toFixed(1)]})]})}function F({label:e,value:t,onChange:n,text:r,border:o}){/* @__PURE__ */
|
|
21
|
+
return c("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:6},children:[
|
|
22
|
+
/* @__PURE__ */d("input",{type:"color",value:t,onChange:e=>n(e.target.value),style:{width:32,height:32,border:`1px solid ${o}`,borderRadius:6,padding:2,cursor:"pointer",background:"transparent"}}),
|
|
23
|
+
/* @__PURE__ */d("div",{style:{width:60,height:28,borderRadius:6,background:t,border:`1px solid ${o}`}}),
|
|
24
|
+
/* @__PURE__ */d("span",{style:{flex:1,fontSize:13,color:r,fontFamily:"monospace"},children:e}),
|
|
25
|
+
/* @__PURE__ */d("code",{style:{fontSize:12,color:r,opacity:.7,fontFamily:"monospace"},children:t})]})}function L({label:e,ratio:t}){const n=t>=4.5,r=t>=4.5,o=t>=7;/* @__PURE__ */
|
|
26
|
+
return c("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:4},children:[
|
|
27
|
+
/* @__PURE__ */d("span",{style:{fontSize:11,opacity:.8,minWidth:140},children:e}),
|
|
28
|
+
/* @__PURE__ */c("span",{style:{fontSize:12,fontWeight:600},children:[t.toFixed(2),":1"]}),
|
|
29
|
+
/* @__PURE__ */d("span",{style:{fontSize:11,color:r?"#22c55e":"#ef4444"},children:r?"✓ AA":"✗ AA"}),
|
|
30
|
+
/* @__PURE__ */d("span",{style:{fontSize:11,color:o?"#22c55e":"#888"},children:o?"✓ AAA":"— AAA"}),
|
|
31
|
+
/* @__PURE__ */d("span",{style:{fontSize:13},children:n?"✅":"❌"})]})}function I({onThemeChange:t,initialHue:r=210,initialMode:i="dark"}){const s=e(),[p,h]=l(i),[u,g]=l(r),[m,f]=l(()=>R("dark"===i)),[y,x]=l(!1),[b,v]=l([]),[k,w]=l(!1),S=a(null),M="dark"===p,z=o((e,n)=>{f(r=>{const o={...r,[e]:n};return t?.(o),o})},[t]),T=o(()=>{if(y)return;x(!0),v([]);let e=0;const n=[],r=()=>{e+=60,C.optimizeTheme(u,M,e);const o=e/600,i=50*(1-o)+2,a=8*(Math.random()-.5)*(1-.8*o);if(n.push({iteration:e,energy:Math.max(0,i+a)}),v([...n]),e<600)S.current=window.setTimeout(r,40);else{const e=C.optimizeTheme(u,M,1e3);f(e),t?.(e),x(!1)}};S.current=window.setTimeout(r,16)},[u,M,y,t]),$=o(()=>{const e="dark"===p?"light":"dark";h(e);const n=R("dark"===e);f(n),t?.(n)},[p,t]),A=o(()=>{const e=`export const myTheme = {\n${Object.entries(m).map(([e,t])=>` ${e}: '${t}',`).join("\n")}\n};`;"undefined"!=typeof navigator&&navigator.clipboard&&navigator.clipboard.writeText(e).then(()=>{w(!0),setTimeout(()=>w(!1),2e3)})},[m]),W=[{label:"Text on Background",fg:m.text,bg:m.background},{label:"Text on Surface",fg:m.text,bg:m.surface},{label:"Primary on Background",fg:m.primary,bg:m.background},{label:"TextMuted on Background",fg:m.textMuted,bg:m.background}],I="linear-gradient(to right,"+["hsl(0,80%,55%)","hsl(30,80%,55%)","hsl(60,80%,55%)","hsl(90,80%,55%)","hsl(120,80%,55%)","hsl(150,80%,55%)","hsl(180,80%,55%)","hsl(210,80%,55%)","hsl(240,80%,55%)","hsl(270,80%,55%)","hsl(300,80%,55%)","hsl(330,80%,55%)","hsl(360,80%,55%)"].join(",")+")",P={fontFamily:"system-ui, -apple-system, sans-serif",background:m.background,color:m.text,border:`1px solid ${m.border}`,borderRadius:12,padding:20,maxWidth:900,display:"grid",gridTemplateColumns:"1fr 1fr",gap:20},E={background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:16},_={fontSize:13,fontWeight:700,textTransform:"uppercase",letterSpacing:"0.08em",color:m.primary,marginBottom:12,marginTop:0},q={padding:"8px 16px",borderRadius:8,border:"none",cursor:"pointer",fontWeight:600,fontSize:13,transition:"opacity 0.15s"},D=n;/* @__PURE__ */
|
|
32
|
+
return c("div",{style:P,children:[
|
|
33
|
+
/* @__PURE__ */c("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
|
|
34
|
+
/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gridColumn:"1/-1"},children:[/* @__PURE__ */c("div",{children:[/* @__PURE__ */d("h2",{style:{margin:0,fontSize:18,fontWeight:700},children:"Theme Builder"}),/* @__PURE__ */d("p",{style:{margin:"2px 0 0",fontSize:12,color:m.textMuted},children:"Quantum-powered color optimization"})]}),/* @__PURE__ */d("button",{onClick:$,style:{...q,background:m.surface,color:m.text,border:`1px solid ${m.border}`},children:M?"☀ Light":"🌙 Dark"})]}),
|
|
35
|
+
/* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */d("p",{style:_,children:"Base Hue"}),/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:10},children:[
|
|
36
|
+
/* @__PURE__ */d("div",{style:{width:24,height:24,borderRadius:"50%",background:`hsl(${u},70%,55%)`,border:`2px solid ${m.border}`,flexShrink:0}}),
|
|
37
|
+
/* @__PURE__ */d("input",{type:"range",min:0,max:360,value:u,onChange:e=>g(Number(e.target.value)),style:{flex:1,height:16,borderRadius:8,background:I,outline:"none",border:"none",cursor:"pointer",appearance:"none",WebkitAppearance:"none"}}),
|
|
38
|
+
/* @__PURE__ */c("span",{style:{fontSize:13,fontFamily:"monospace",minWidth:32},children:[u,"°"]})]})]}),
|
|
39
|
+
/* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:8,marginBottom:10},children:[/* @__PURE__ */d("button",{onClick:T,disabled:y,style:{...q,background:y?m.border:m.primary,color:M?"#000":"#fff",opacity:y?.7:1,flex:1},children:y?"⟳ Optimizing...":"⚛ Generate with Quantum Annealing"}),/* @__PURE__ */d("div",{style:{padding:"3px 8px",background:m.primary+"22",border:`1px solid ${m.primary}44`,borderRadius:20,fontSize:10,color:m.primary,fontWeight:700,whiteSpace:"nowrap"},children:"⚛ Quantum Annealing"})]}),(y||b.length>0)&&/* @__PURE__ */c("div",{children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 4px"},children:"Energy landscape (lower = better palette)"}),/* @__PURE__ */d(B,{points:b,primary:m.primary})]})]}),
|
|
40
|
+
/* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */d("p",{style:_,children:"Color Tokens"}),Object.keys(m).map(e=>/* @__PURE__ */d(F,{label:e,value:m[e],onChange:t=>z(e,t),text:m.text,border:m.border},e))]}),
|
|
41
|
+
/* @__PURE__ */d("button",{onClick:A,style:{...q,background:m.accent,color:"#fff",width:"100%"},children:k?"✓ Copied to Clipboard!":"⬇ Export Theme"})]}),
|
|
42
|
+
/* @__PURE__ */c("div",{style:{display:"flex",flexDirection:"column",gap:16},children:[
|
|
43
|
+
/* @__PURE__ */c("div",{style:E,children:[
|
|
44
|
+
/* @__PURE__ */d("p",{style:_,children:"Live Preview"}),
|
|
45
|
+
/* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Buttons"}),/* @__PURE__ */c("div",{style:{display:"flex",gap:8,flexWrap:"wrap"},children:[
|
|
46
|
+
/* @__PURE__ */d("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:m.primary,color:M?"#000":"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Primary"}),
|
|
47
|
+
/* @__PURE__ */d("button",{style:{padding:"8px 16px",borderRadius:8,border:"none",background:m.secondary,color:"#fff",fontWeight:600,fontSize:13,cursor:"pointer"},children:"Secondary"}),
|
|
48
|
+
/* @__PURE__ */d("button",{style:{padding:"8px 16px",borderRadius:8,border:`1px solid ${m.border}`,background:"transparent",color:m.text,fontWeight:600,fontSize:13,cursor:"pointer"},children:"Outline"})]})]}),
|
|
49
|
+
/* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Card"}),/* @__PURE__ */c("div",{style:{background:m.surface,border:`1px solid ${m.border}`,borderRadius:8,padding:12},children:[
|
|
50
|
+
/* @__PURE__ */d("div",{style:{fontSize:14,fontWeight:700,marginBottom:4},children:"Card Title"}),
|
|
51
|
+
/* @__PURE__ */d("div",{style:{fontSize:12,color:m.textMuted,lineHeight:1.4},children:"Sample card with surface background and muted text content."}),
|
|
52
|
+
/* @__PURE__ */c("div",{style:{marginTop:8,display:"flex",gap:6},children:[/* @__PURE__ */d("span",{style:{padding:"2px 8px",borderRadius:20,background:m.primary+"33",color:m.primary,fontSize:11,fontWeight:600},children:"Tag"}),/* @__PURE__ */d("span",{style:{padding:"2px 8px",borderRadius:20,background:m.accent+"33",color:m.accent,fontSize:11,fontWeight:600},children:"Accent"})]})]})]}),
|
|
53
|
+
/* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Input"}),/* @__PURE__ */d("input",{type:"text",placeholder:"Type something...",readOnly:!0,style:{width:"100%",padding:"8px 12px",borderRadius:8,border:`1px solid ${m.border}`,background:m.background,color:m.text,fontSize:13,outline:"none",boxSizing:"border-box"}})]}),
|
|
54
|
+
/* @__PURE__ */c("div",{style:{marginBottom:12},children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Progress"}),/* @__PURE__ */d("div",{style:{height:8,borderRadius:4,background:m.border,overflow:"hidden"},children:/* @__PURE__ */d("div",{style:{height:"100%",width:"68%",background:`linear-gradient(to right, ${m.primary}, ${m.accent})`,borderRadius:4,transition:"width 0.4s ease"}})})]}),
|
|
55
|
+
/* @__PURE__ */c("div",{children:[/* @__PURE__ */d("p",{style:{fontSize:11,color:m.textMuted,margin:"0 0 6px"},children:"Status Badges"}),/* @__PURE__ */d("div",{style:{display:"flex",gap:6,flexWrap:"wrap"},children:[{label:"Error",color:m.error},{label:"Warning",color:m.warning},{label:"Success",color:m.success}].map(({label:e,color:t})=>/* @__PURE__ */d("span",{style:{padding:"3px 10px",borderRadius:4,background:t+"22",color:t,border:`1px solid ${t}44`,fontSize:11,fontWeight:700},children:e},e))})]})]}),
|
|
56
|
+
/* @__PURE__ */c("div",{style:E,children:[
|
|
57
|
+
/* @__PURE__ */d("p",{style:_,children:"WCAG Contrast Check"}),W.map(e=>/* @__PURE__ */d(L,{label:e.label,ratio:C.contrast(e.fg,e.bg)},e.label)),
|
|
58
|
+
/* @__PURE__ */d("p",{style:{fontSize:10,color:m.textMuted,marginTop:8,marginBottom:0},children:"AA requires 4.5:1 (normal text). AAA requires 7:1."})]}),
|
|
59
|
+
/* @__PURE__ */c("div",{style:E,children:[/* @__PURE__ */d("p",{style:_,children:"Color Palette"}),/* @__PURE__ */d("div",{style:{display:"flex",gap:4,flexWrap:"wrap"},children:Object.entries(m).map(([e,t])=>/* @__PURE__ */d("div",{title:`${e}: ${t}`,style:{width:36,height:36,borderRadius:6,background:t,border:`2px solid ${m.border}`,cursor:"default",flexShrink:0}},e))})]})]}),"function"==typeof D&&null,"string"==typeof s.bg&&null]})}W.displayName="TkxQuantumForm";var P=["fetch(","XMLHttpRequest","navigator.sendBeacon","document.cookie","localStorage","sessionStorage","indexedDB","WebSocket","EventSource","import(","eval(","new Function(","postMessage","window.open","location.href","location.replace","location.assign","document.write","crypto.subtle"],E=[{label:"Hello World",code:"<div style={{ padding: 24, fontFamily: 'sans-serif', color: '#e8e8f4' }}>\n <h2 style={{ margin: 0 }}>👋 Hello, TkxPlayground!</h2>\n <p style={{ marginTop: 8, opacity: 0.7 }}>Edit the code on the left to see live updates.</p>\n</div>"},{label:"Button Styles",code:"<div style={{ display: 'flex', gap: 12, flexWrap: 'wrap', padding: 24 }}>\n {['primary', 'success', 'danger', 'warning', 'info'].map(color => (\n <button\n key={color}\n style={{\n padding: '8px 18px',\n borderRadius: 8,\n border: 'none',\n background: color === 'primary' ? '#00f5d4' : color === 'success' ? '#06d6a0' : color === 'danger' ? '#f72585' : color === 'warning' ? '#ffbe0b' : '#3a86ff',\n color: '#0a0a0f',\n fontWeight: 700,\n cursor: 'pointer',\n textTransform: 'capitalize',\n }}\n >\n {color}\n </button>\n ))}\n</div>"},{label:"Card Grid",code:"<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 16, padding: 24 }}>\n {['Alpha', 'Beta', 'Gamma', 'Delta', 'Epsilon', 'Zeta'].map(name => (\n <div key={name} style={{\n background: '#1a1a2e',\n borderRadius: 10,\n border: '1px solid #2a2a3e',\n padding: '16px',\n }}>\n <div style={{ fontWeight: 700, color: '#00f5d4', marginBottom: 4 }}>{name}</div>\n <div style={{ fontSize: 12, color: '#8888aa' }}>Quantum module {name.toLowerCase()}</div>\n </div>\n ))}\n</div>"},{label:"Animated Counter",code:"(() => {\n const [count, setCount] = React.useState(0);\n return (\n <div style={{ padding: 32, textAlign: 'center', fontFamily: 'sans-serif' }}>\n <div style={{ fontSize: 64, fontWeight: 900, color: '#00f5d4', marginBottom: 16 }}>\n {count}\n </div>\n <div style={{ display: 'flex', gap: 12, justifyContent: 'center' }}>\n <button onClick={() => setCount(c => c - 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>−</button>\n <button onClick={() => setCount(0)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#8888aa', cursor: 'pointer' }}>Reset</button>\n <button onClick={() => setCount(c => c + 1)} style={{ padding: '8px 20px', borderRadius: 8, border: '1px solid #2a2a3e', background: '#1a1a2e', color: '#e8e8f4', fontSize: 20, cursor: 'pointer' }}>+</button>\n </div>\n </div>\n );\n})()"},{label:"Data Table",code:"(() => {\n const rows = [\n { id: 1, name: 'Hydrogen', symbol: 'H', mass: 1.008 },\n { id: 2, name: 'Helium', symbol: 'He', mass: 4.003 },\n { id: 3, name: 'Lithium', symbol: 'Li', mass: 6.941 },\n { id: 4, name: 'Carbon', symbol: 'C', mass: 12.011 },\n { id: 5, name: 'Nitrogen', symbol: 'N', mass: 14.007 },\n ];\n const cell = { padding: '8px 14px', borderBottom: '1px solid #2a2a3e', color: '#e8e8f4', fontSize: 13 };\n const hcell = { ...cell, color: '#8888aa', fontWeight: 600, fontSize: 11, textTransform: 'uppercase', letterSpacing: '0.06em' };\n return (\n <div style={{ padding: 16 }}>\n <table style={{ width: '100%', borderCollapse: 'collapse', fontFamily: 'sans-serif' }}>\n <thead>\n <tr>{['ID','Element','Symbol','Atomic Mass'].map(h => <th key={h} style={hcell}>{h}</th>)}</tr>\n </thead>\n <tbody>\n {rows.map(r => (\n <tr key={r.id} style={{ transition: 'background 0.15s' }}>\n <td style={cell}>{r.id}</td>\n <td style={cell}>{r.name}</td>\n <td style={{ ...cell, color: '#00f5d4', fontWeight: 700 }}>{r.symbol}</td>\n <td style={cell}>{r.mass}</td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n );\n})()"}],_=class extends r.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(){return{hasError:!0}}componentDidCatch(e){this.props.onError(e.message)}componentDidUpdate(e){e.children!==this.props.children&&this.state.hasError&&this.setState({hasError:!1})}render(){return this.state.hasError?null:this.props.children}};function q({code:e,lineHeight:t}){const n=e.split("\n");/* @__PURE__ */
|
|
60
|
+
return d("div",{"aria-hidden":"true",style:{position:"absolute",top:0,left:0,width:"36px",padding:"12px 0",textAlign:"right",paddingRight:"8px",userSelect:"none",pointerEvents:"none",fontSize:"12px",lineHeight:`${t}px`,color:"#555577",fontFamily:'"Fira Code", "Cascadia Code", "Consolas", monospace',boxSizing:"border-box"},children:n.map((e,t)=>/* @__PURE__ */d("div",{children:t+1},t))})}var D=["TkxButton","TkxInput","TkxCard","TkxModal","TkxTable","TkxSelect","TkxCheckbox","TkxRadio","TkxSwitch","TkxSlider","TkxBadge","TkxAlert","TkxToast","TkxTooltip","TkxPopover","TkxTabs","TkxAccordion","TkxDrawer","TkxDropdown","TkxMenu","TkxForm","TkxDataGrid","TkxChart","TkxSpinner","TkxSkeleton","TkxAvatar","TkxTag","TkxDivider","TkxProgress","TkxStatistic","TkxQuantumForm","TkxPlayground"],N=new f;function j(e){const t=e.match(/([A-Z][a-zA-Z0-9]*)$/);return t?t[1]:""}function H({defaultCode:t,examples:n,height:s=480,imports:p={},strictMode:h=!0,forbiddenTokens:u}){const g=e(),m=[...E,...n??[]],f=t??E[0].code,[y,x]=l(f),[b,v]=l({element:null,error:null,renderMs:0}),[k,w]=l(null),[S,C]=l([]),[M,z]=l(!1),[T,$]=l(0),A=a(null),W=a(null),R=o(e=>{w(null),v(function(e,t,n){const o=performance.now();try{const i=e.trim();if(!1!==n?.strictMode){const e=function(e,t){const n=[...P,...t??[]],r=e.toLowerCase();for(const o of n)if(r.includes(o.toLowerCase()))return o;return null}(i,n?.forbiddenTokens);if(e)return{element:null,error:`Blocked by playground strictMode: code contains "${e}". This token is disallowed because playground snippets run in the page's JavaScript context. If you trust the source, pass strictMode={false} to <TkxPlayground>.`,renderMs:parseFloat((performance.now()-o).toFixed(2))}}let a=`\n function PlaygroundRoot() {\n ${i.startsWith("<")||i.startsWith("(")?`return (${i});`:i}\n }\n `;const l="undefined"==typeof window?null:window.Babel??null;l&&(a=l.transform(a,{presets:["react"],filename:"playground.jsx"}).code??a);const s=new Function("React","imports",`\n "use strict";\n const { ${Object.keys(t).join(", ")} } = imports;\n ${a}\n return PlaygroundRoot;\n `)(r,t);return{element:r.createElement(s),error:null,renderMs:parseFloat((performance.now()-o).toFixed(2))}}catch(i){const e=parseFloat((performance.now()-o).toFixed(2));return{element:null,error:i instanceof Error?i.message:String(i),renderMs:e}}}(e,p,{strictMode:h,forbiddenTokens:u}))},[p,h,u]);i(()=>(W.current&&clearTimeout(W.current),W.current=setTimeout(()=>R(y),300),()=>{W.current&&clearTimeout(W.current)}),[y,R]),i(()=>{R(f)},[]);const B=o(e=>{const t=e.target.value;x(t);const n=j(t);n.length>=2?C(function(e,t=4){if(!e||e.length<2)return[];const n=e.toLowerCase();return N.amplify(D,e=>{const t=e.toLowerCase();if(t.startsWith(n))return 1;if(t.includes(n))return.7;let r=0;for(let o=0;o<n.length-1;o++)t.includes(n.slice(o,o+2))&&(r+=.15);return Math.min(r,.5)},.1).slice(0,t).map(e=>({name:D[e.index]??"",amplitude:parseFloat(e.combined.toFixed(3))})).filter(e=>""!==e.name)}(n,4)):C([])},[]),F=o(e=>{const t=m[e];t&&($(e),x(t.code),C([]))},[m]),L=o(async()=>{try{await navigator.clipboard.writeText(y),z(!0),setTimeout(()=>z(!1),1500)}catch{}},[y]),I=o(()=>{x(f),$(0),C([])},[f]),H=o(e=>{const t=j(y);t&&x(n=>n.slice(0,n.lastIndexOf(t))+e),C([])},[y]),O=null!==b.error||null!==k,Q=b.error??k??"",Z=g.bg,U=g.surfaceAlt,Y=g.border,G=g.surface,J={width:"50%",display:"flex",flexDirection:"column",borderRight:`1px solid ${Y}`,position:"relative"},V={display:"flex",alignItems:"center",gap:"6px",padding:"6px 10px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface,flexWrap:"wrap"},X={padding:"3px 10px",borderRadius:"6px",border:`1px solid ${Y}`,backgroundColor:"transparent",color:g.textMuted,fontSize:"11px",fontWeight:600,cursor:"pointer",fontFamily:"inherit",transition:"color 0.15s, border-color 0.15s"};/* @__PURE__ */
|
|
61
|
+
return c("div",{style:{display:"flex",flexDirection:"column",border:`1px solid ${Y}`,borderRadius:"12px",overflow:"hidden",backgroundColor:Z,fontFamily:"inherit",boxSizing:"border-box",position:"relative"},children:[
|
|
62
|
+
/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 14px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface},children:[/* @__PURE__ */d("span",{style:{fontSize:"12px",fontWeight:700,color:g.primary,letterSpacing:"0.05em"},children:"⚛ TkxPlayground"}),/* @__PURE__ */d("span",{style:{fontSize:"10px",color:g.textMuted},children:"Live JSX Preview"})]}),
|
|
63
|
+
/* @__PURE__ */d("div",{style:{display:"flex",gap:"4px",padding:"6px 10px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface,overflowX:"auto"},children:m.map((e,t)=>/* @__PURE__ */d("button",{onClick:()=>F(t),style:{padding:"3px 10px",borderRadius:"6px",border:`1px solid ${t===T?g.primary:Y}`,backgroundColor:t===T?`${g.primary}20`:"transparent",color:t===T?g.primary:g.textMuted,fontSize:"11px",fontWeight:t===T?700:400,cursor:"pointer",whiteSpace:"nowrap",fontFamily:"inherit",transition:"all 0.15s"},children:e.label},t))}),
|
|
64
|
+
/* @__PURE__ */c("div",{style:{display:"flex",height:`${s}px`},children:[/* @__PURE__ */c("div",{style:J,children:[
|
|
65
|
+
/* @__PURE__ */c("div",{style:V,children:[
|
|
66
|
+
/* @__PURE__ */d("span",{style:{fontSize:"11px",color:g.textMuted,marginRight:"auto"},children:"editor.tsx"}),
|
|
67
|
+
/* @__PURE__ */d("button",{onClick:L,style:X,title:"Copy code",children:M?"✓ Copied":"⎘ Copy"}),
|
|
68
|
+
/* @__PURE__ */d("button",{onClick:I,style:X,title:"Reset to default",children:"↺ Reset"})]}),
|
|
69
|
+
/* @__PURE__ */c("div",{style:{position:"relative",flex:1,overflow:"hidden"},children:[/* @__PURE__ */d(q,{code:y,lineHeight:18}),/* @__PURE__ */d("textarea",{ref:A,value:y,onChange:B,spellCheck:!1,autoCorrect:"off",autoCapitalize:"off",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",padding:"12px 12px 12px 44px",margin:0,border:"none",outline:"none",resize:"none",backgroundColor:Z,color:g.text,fontSize:"12px",lineHeight:"18px",fontFamily:'"Fira Code", "Cascadia Code", "Consolas", "Courier New", monospace',boxSizing:"border-box",overflowY:"auto",tabSize:2}})]}),S.length>0&&/* @__PURE__ */c("div",{style:{position:"absolute",bottom:"40px",left:"44px",zIndex:10,backgroundColor:g.surface,border:`1px solid ${g.primary}44`,borderRadius:"8px",overflow:"hidden",boxShadow:"0 4px 16px rgba(0,0,0,0.3)",minWidth:"180px"},children:[/* @__PURE__ */d("div",{style:{padding:"4px 10px 4px",fontSize:"10px",color:g.primary,fontWeight:700,borderBottom:`1px solid ${Y}`,letterSpacing:"0.05em"},children:"⚛ Quantum Suggestions"}),S.map(e=>/* @__PURE__ */c("button",{onClick:()=>H(e.name),style:{display:"flex",alignItems:"center",justifyContent:"space-between",width:"100%",padding:"6px 10px",border:"none",backgroundColor:"transparent",color:g.text,fontSize:"12px",fontFamily:'"Fira Code", monospace',cursor:"pointer",textAlign:"left",gap:"12px"},children:[/* @__PURE__ */d("span",{children:e.name}),/* @__PURE__ */c("span",{style:{fontSize:"10px",color:g.textMuted,flexShrink:0},children:[Math.round(100*e.amplitude),"%"]})]},e.name))]})]}),/* @__PURE__ */c("div",{style:{width:"50%",display:"flex",flexDirection:"column"},children:[/* @__PURE__ */d("div",{style:{padding:"6px 10px",borderBottom:`1px solid ${Y}`,backgroundColor:g.surface,fontSize:"11px",color:g.textMuted,fontWeight:600},children:"Preview"}),/* @__PURE__ */d("div",{style:{flex:1,overflow:"auto",backgroundColor:U,position:"relative"},children:O?/* @__PURE__ */c("div",{style:{padding:"16px",color:g.danger,fontFamily:'"Fira Code", monospace',fontSize:"12px",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:[/* @__PURE__ */c("div",{style:{marginBottom:"8px",fontWeight:700,display:"flex",alignItems:"center",gap:"6px"},children:[/* @__PURE__ */d("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:/* @__PURE__ */d("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"})}),"Runtime Error"]}),Q]}):/* @__PURE__ */d(_,{onError:w,children:/* @__PURE__ */d("div",{style:{minHeight:"100%"},children:b.element})})})]})]}),
|
|
70
|
+
/* @__PURE__ */c("div",{style:{display:"flex",alignItems:"center",gap:"16px",padding:"4px 12px",backgroundColor:G,borderTop:`1px solid ${Y}`,fontSize:"11px",color:g.textMuted},children:[
|
|
71
|
+
/* @__PURE__ */c("span",{style:{display:"flex",alignItems:"center",gap:"4px",color:O?g.danger:g.success,fontWeight:600},children:[/* @__PURE__ */d("span",{style:{width:"6px",height:"6px",borderRadius:"50%",backgroundColor:O?g.danger:g.success,display:"inline-block"}}),O?"Error":"OK"]}),
|
|
72
|
+
/* @__PURE__ */c("span",{children:["⏱ ",b.renderMs," ms"]}),
|
|
73
|
+
/* @__PURE__ */c("span",{children:[y.split("\n").length," lines"]}),
|
|
74
|
+
/* @__PURE__ */c("span",{children:[y.length," chars"]}),S.length>0&&/* @__PURE__ */c("span",{style:{marginLeft:"auto",color:g.primary,fontWeight:600},children:["⚛ ",S.length," suggestion",S.length>1?"s":""]})]})]})}H.displayName="TkxPlayground";export{f as AmplitudeAmplifier,C as QuantumAI,g as QuantumAnnealer,m as QuantumBoltzmannMachine,u as QuantumRegister,h as Qubit,H as TkxPlayground,W as TkxQuantumForm,I as TkxThemeBuilder,b as hslToHex,x as inferFieldIntelligence,S as optimizeThemeColors};
|