From 417172411a12b0a37047974ad3c66443675eb328 Mon Sep 17 00:00:00 2001 From: Brian Cooper Date: Thu, 11 Jan 2024 15:39:44 -0500 Subject: [PATCH] replace all COLORS with LEGACY_COLORS --- api-client/src/protocols/utils.ts | 4 +- app/src/App/DesktopApp.tsx | 4 +- app/src/App/Navbar.tsx | 46 +++++----- app/src/App/OnDeviceDisplayApp.tsx | 6 +- app/src/App/OnDeviceDisplayAppFallback.tsx | 4 +- .../BorderRadius/BorderRadius.stories.tsx | 4 +- .../DesignTokens/Colors/Colors.stories.tsx | 8 +- .../DesignTokens/Spacing/Spacing.stories.tsx | 4 +- app/src/atoms/Banner/index.tsx | 24 +++--- app/src/atoms/Chip/Chip.stories.tsx | 4 +- app/src/atoms/Chip/__tests__/Chip.test.tsx | 54 ++++++------ app/src/atoms/Chip/index.tsx | 32 +++---- app/src/atoms/GlobalStyle/index.ts | 4 +- app/src/atoms/InlineNotification/index.tsx | 18 ++-- app/src/atoms/InputField/index.tsx | 26 +++--- app/src/atoms/InstrumentContainer/index.tsx | 4 +- app/src/atoms/Interstitial/Interstitial.tsx | 8 +- .../Interstitial/InterstitiallTitleBar.tsx | 8 +- app/src/atoms/Link/ExternalLink.stories.tsx | 4 +- .../Link/__tests__/ExternalLink.test.tsx | 4 +- .../ListItem/__tests__/ListItem.test.tsx | 10 +-- app/src/atoms/ListItem/index.tsx | 10 +-- app/src/atoms/MenuList/DropdownMenu.tsx | 6 +- app/src/atoms/MenuList/MenuItem.tsx | 22 ++--- app/src/atoms/MenuList/OverflowBtn.tsx | 18 ++-- .../MenuList/__tests__/OverflowBtn.test.tsx | 10 +-- app/src/atoms/MenuList/hooks.tsx | 4 +- app/src/atoms/MenuList/index.tsx | 4 +- .../atoms/ProgressBar/ProgressBar.stories.tsx | 4 +- .../__tests__/ProgressBar.test.tsx | 14 ++-- app/src/atoms/ProgressBar/index.tsx | 6 +- app/src/atoms/SelectField/Select.tsx | 28 +++---- app/src/atoms/SelectField/index.tsx | 4 +- app/src/atoms/Skeleton/index.tsx | 6 +- .../__tests__/SleepScreen.test.tsx | 4 +- app/src/atoms/SleepScreen/index.tsx | 4 +- app/src/atoms/Slideout/Slideout.stories.tsx | 4 +- app/src/atoms/Slideout/index.tsx | 12 +-- app/src/atoms/Snackbar/index.tsx | 6 +- .../atoms/StatusLabel/StatusLabel.stories.tsx | 18 ++-- .../__tests__/StatusLabel.test.tsx | 20 ++--- app/src/atoms/StatusLabel/index.tsx | 4 +- app/src/atoms/StepMeter/index.tsx | 6 +- app/src/atoms/Toast/index.tsx | 24 +++--- app/src/atoms/Tooltip/Tooltip.stories.tsx | 4 +- .../atoms/Tooltip/__tests__/Tooltip.test.tsx | 6 +- app/src/atoms/Tooltip/index.tsx | 4 +- .../atoms/buttons/FloatingActionButton.tsx | 12 +-- app/src/atoms/buttons/LargeButton.tsx | 32 +++---- app/src/atoms/buttons/MediumButton.tsx | 58 ++++++------- app/src/atoms/buttons/QuaternaryButton.tsx | 8 +- app/src/atoms/buttons/RadioButton.tsx | 16 ++-- app/src/atoms/buttons/SmallButton.tsx | 52 ++++++------ app/src/atoms/buttons/SubmitPrimaryButton.tsx | 16 ++-- app/src/atoms/buttons/TabbedButton.tsx | 24 +++--- app/src/atoms/buttons/TertiaryButton.tsx | 16 ++-- app/src/atoms/buttons/ToggleButton.tsx | 18 ++-- .../__tests__/FloatingActionButton.test.tsx | 10 +-- .../buttons/__tests__/LargeButton.test.tsx | 8 +- .../buttons/__tests__/MediumButton.test.tsx | 14 ++-- .../__tests__/QuaternaryButton.test.tsx | 14 ++-- .../buttons/__tests__/RadioButton.test.tsx | 10 +-- .../buttons/__tests__/SmallButton.test.tsx | 12 +-- .../__tests__/SubmitPrimaryButton.test.tsx | 16 ++-- .../buttons/__tests__/TabbedButton.test.tsx | 18 ++-- .../buttons/__tests__/TertiaryButton.test.tsx | 22 ++--- .../buttons/__tests__/ToggleButton.test.tsx | 18 ++-- app/src/atoms/buttons/constants.ts | 4 +- app/src/atoms/structure/Divider.tsx | 4 +- .../structure/__tests__/Divider.test.tsx | 8 +- .../atoms/structure/__tests__/Line.test.tsx | 8 +- app/src/molecules/BackgroundOverlay/index.tsx | 4 +- .../CardButton/__tests__/CardButton.test.tsx | 4 +- app/src/molecules/CardButton/index.tsx | 24 +++--- .../molecules/CollapsibleSection/index.tsx | 6 +- app/src/molecules/GenericWizardTile/index.tsx | 6 +- .../InProgressModal/InProgressModal.tsx | 6 +- app/src/molecules/InfoMessage/index.tsx | 8 +- .../molecules/InstrumentCard/MenuOverlay.tsx | 4 +- app/src/molecules/InstrumentCard/index.tsx | 6 +- .../JogControls/ControlContainer.tsx | 4 +- .../JogControls/DirectionControl.tsx | 84 +++++++++---------- .../molecules/JogControls/StepSizeControl.tsx | 42 +++++----- .../JogControls/TouchControlButton.tsx | 12 +-- .../LegacyModal/LegacyModal.stories.tsx | 4 +- .../LegacyModal/LegacyModalHeader.tsx | 6 +- .../LegacyModal/LegacyModalShell.tsx | 12 +-- .../__tests__/LegacyModal.test.tsx | 12 +-- .../__tests__/LegacyModalHeader.test.tsx | 16 ++-- app/src/molecules/LegacyModal/index.tsx | 10 +-- .../molecules/MiniCard/MiniCard.stories.tsx | 4 +- .../MiniCard/__tests__/MiniCard.test.tsx | 22 ++--- app/src/molecules/MiniCard/index.tsx | 24 +++--- app/src/molecules/Modal/Modal.stories.tsx | 4 +- app/src/molecules/Modal/Modal.tsx | 6 +- .../molecules/Modal/ModalHeader.stories.tsx | 12 +-- app/src/molecules/Modal/ModalHeader.tsx | 6 +- .../molecules/Modal/SmallModalChildren.tsx | 6 +- .../Modal/__tests__/ModalHeader.test.tsx | 6 +- .../ModuleIcon/__tests__/ModuleIcon.test.tsx | 6 +- app/src/molecules/ModuleIcon/index.tsx | 6 +- .../NavTab/__tests__/NavTab.test.tsx | 10 +-- app/src/molecules/NavTab/index.tsx | 8 +- .../__tests__/ODDBackButton.test.tsx | 4 +- app/src/molecules/ODDBackButton/index.tsx | 4 +- .../SimpleWizardBody.stories.tsx | 6 +- .../__tests__/SimpleWizardBody.test.tsx | 4 +- .../molecules/ToggleGroup/useToggleGroup.tsx | 24 +++--- app/src/molecules/UploadInput/index.tsx | 16 ++-- app/src/molecules/WizardHeader/index.tsx | 8 +- .../WizardRequiredEquipmentList/index.tsx | 8 +- .../AddCustomLabwareSlideout/index.tsx | 4 +- .../AppSettings/ConnectRobotSlideout.tsx | 6 +- .../AppSettings/ManualIpHostnameForm.tsx | 18 ++-- .../AppSettings/ManualIpHostnameItem.tsx | 12 +-- .../LabwareOffsetTable.tsx | 4 +- app/src/organisms/Breadcrumbs/index.tsx | 8 +- .../CalibrationPanels/ChooseTipRack.tsx | 4 +- .../CompleteConfirmation.tsx | 4 +- .../CalibrationPanels/ConfirmExit.tsx | 4 +- .../CalibrationPanels/LoadingState.tsx | 4 +- .../CalibrationPanels/NeedHelpLink.tsx | 4 +- .../organisms/CalibrationStatusCard/index.tsx | 18 ++-- .../organisms/CalibrationTaskList/index.tsx | 24 +++--- .../ChangePipette/CheckPipettesButton.tsx | 4 +- .../ChangePipette/ConfirmPipette.tsx | 6 +- app/src/organisms/ChangePipette/ExitModal.tsx | 4 +- .../organisms/ChangePipette/Instructions.tsx | 4 +- .../CalibrationHealthCheckResults.tsx | 12 +-- .../ResultsSummary/CalibrationResult.tsx | 4 +- .../ResultsSummary/RenderMountInformation.tsx | 4 +- .../ResultsSummary/RenderResult.tsx | 6 +- .../CalibrationHealthCheckResults.test.tsx | 8 +- .../__tests__/RenderResult.test.tsx | 6 +- app/src/organisms/ChildNavigation/index.tsx | 10 +-- .../ChooseProtocolSlideout/index.tsx | 14 ++-- .../AvailableRobotOption.tsx | 8 +- .../organisms/ChooseRobotSlideout/index.tsx | 14 ++-- .../AddFixtureModal.tsx | 20 ++--- .../DeckFixtureSetupInstructionsModal.tsx | 4 +- .../DeviceDetailsDeckConfiguration/index.tsx | 8 +- .../Devices/CalibrationStatusBanner.tsx | 4 +- .../HeaterShakerIsRunningModal/index.tsx | 4 +- .../HeaterShakerModuleCard.tsx | 8 +- .../Devices/HistoricalProtocolRun.tsx | 6 +- .../HistoricalProtocolRunOffsetDrawer.tsx | 10 +-- .../HistoricalProtocolRunOverflowMenu.tsx | 6 +- .../Devices/InstrumentsAndModules.tsx | 4 +- app/src/organisms/Devices/ModuleInfo.tsx | 14 ++-- .../PipetteCard/AboutPipetteSlideout.tsx | 6 +- .../PipetteCard/PipetteOverflowMenu.tsx | 4 +- .../organisms/Devices/PipetteCard/index.tsx | 6 +- .../Devices/ProtocolRun/EmptySetupStep.tsx | 4 +- .../ProtocolRun/LabwareInfoOverlay.tsx | 8 +- .../Devices/ProtocolRun/ProtocolRunHeader.tsx | 12 +-- .../ProtocolRun/ProtocolRunModuleControls.tsx | 4 +- .../Devices/ProtocolRun/ProtocolRunSetup.tsx | 12 +-- .../Devices/ProtocolRun/RunFailedModal.tsx | 4 +- .../ProtocolRun/SetupCalibrationItem.tsx | 14 ++-- .../ProtocolRun/SetupDeckCalibration.tsx | 4 +- .../SetupInstrumentCalibration.tsx | 4 +- .../SetupLabware/CurrentOffsetsModal.tsx | 4 +- .../SetupLabware/LabwareListItem.tsx | 14 ++-- .../CurrentOffsetsTable.tsx | 4 +- .../SetupLabwarePositionCheck/index.tsx | 4 +- .../SetupLiquids/LiquidDetailCard.tsx | 34 ++++---- .../LiquidsLabwareDetailsModal.tsx | 12 +-- .../SetupLiquids/SetupLiquidsList.tsx | 20 ++--- .../__tests__/LiquidDetailCard.test.tsx | 4 +- .../LocationConflictModal.tsx | 14 ++-- .../SetupModuleAndDeck/NotConfiguredModal.tsx | 4 +- .../SetupModuleAndDeck/SetupFixtureList.tsx | 22 ++--- .../SetupModuleAndDeck/SetupModulesList.tsx | 30 +++---- .../SetupPipetteCalibrationItem.tsx | 4 +- .../Devices/ProtocolRun/SetupStep.tsx | 14 ++-- .../ProtocolRun/SetupTipLengthCalibration.tsx | 4 +- .../SetupTipLengthCalibrationButton.tsx | 4 +- .../organisms/Devices/RecentProtocolRuns.tsx | 6 +- app/src/organisms/Devices/RobotCard.tsx | 8 +- .../organisms/Devices/RobotOverflowMenu.tsx | 4 +- app/src/organisms/Devices/RobotOverview.tsx | 10 +-- .../Devices/RobotOverviewOverflowMenu.tsx | 4 +- .../DeviceResetSlideout.tsx | 8 +- .../RenameRobotSlideout.tsx | 6 +- .../AdvancedTab/DisplayRobotName.tsx | 4 +- .../AdvancedTab/RobotServerVersion.tsx | 4 +- .../RobotSettings/RobotSettingsNetworking.tsx | 24 +++--- .../RobotUpdateProgressModal.tsx | 8 +- .../organisms/Devices/RobotStatusHeader.tsx | 6 +- .../DropTipWizard/BeforeBeginning.tsx | 20 ++--- .../DropTipWizard/ChooseLocation.tsx | 4 +- .../DropTipWizard/ExitConfirmation.tsx | 4 +- .../organisms/DropTipWizard/JogToPosition.tsx | 6 +- app/src/organisms/DropTipWizard/Success.tsx | 4 +- .../DropTipWizard/TipsAttachedModal.tsx | 4 +- app/src/organisms/DropTipWizard/index.tsx | 6 +- .../EmergencyStop/EstopMissingModal.tsx | 4 +- .../EmergencyStop/EstopPressedModal.tsx | 6 +- .../UpdateInProgressModal.tsx | 6 +- .../FirmwareUpdateModal/UpdateNeededModal.tsx | 4 +- .../UpdateResultsModal.tsx | 10 +-- .../organisms/FirmwareUpdateModal/index.tsx | 8 +- .../GripperCard/AboutGripperSlideout.tsx | 6 +- .../GripperWizardFlows/BeforeBeginning.tsx | 4 +- .../GripperWizardFlows/ExitConfirmation.tsx | 4 +- .../GripperWizardFlows/MountGripper.tsx | 6 +- .../organisms/GripperWizardFlows/MovePin.tsx | 4 +- .../organisms/GripperWizardFlows/Success.tsx | 4 +- .../GripperWizardFlows/UnmountGripper.tsx | 6 +- .../organisms/GripperWizardFlows/index.tsx | 4 +- app/src/organisms/InstrumentInfo/index.tsx | 6 +- .../InstrumentMountItem/LabeledMount.tsx | 8 +- .../ProtocolInstrumentMountItem.tsx | 10 +-- .../InterventionCommandMessage.tsx | 6 +- .../LabwareDisabledOverlay.tsx | 6 +- .../MoveLabwareInterventionContent.tsx | 12 +-- .../PauseInterventionContent.tsx | 6 +- app/src/organisms/InterventionModal/index.tsx | 20 ++--- .../LabwareCard/CustomLabwareOverflowMenu.tsx | 4 +- app/src/organisms/LabwareCard/index.tsx | 16 ++-- .../LabwareDetails/ManufacturerDetails.tsx | 4 +- .../StyledComponents/LabeledValue.tsx | 4 +- app/src/organisms/LabwareDetails/index.tsx | 18 ++-- app/src/organisms/LabwareOffsetTabs/index.tsx | 4 +- .../LabwarePositionCheck/ExitConfirmation.tsx | 6 +- .../LabwarePositionCheck/FatalErrorModal.tsx | 4 +- .../IntroScreen/index.tsx | 6 +- .../LabwarePositionCheck/JogToWell.tsx | 8 +- .../LabwarePositionCheck/LiveOffsetValue.tsx | 4 +- .../LabwarePositionCheck/ResultsSummary.tsx | 8 +- .../RobotMotionLoader.tsx | 4 +- .../LabwarePositionCheck/TipConfirmation.tsx | 4 +- .../ModuleCard/AboutModuleSlideout.tsx | 6 +- .../ModuleCard/FirmwareUpdateFailedModal.tsx | 4 +- .../ModuleCard/HeaterShakerModuleData.tsx | 32 +++---- .../ModuleCard/HeaterShakerSlideout.tsx | 4 +- .../ModuleCard/MagneticModuleData.tsx | 6 +- .../ModuleCard/MagneticModuleSlideout.tsx | 8 +- .../ModuleCard/TemperatureModuleData.tsx | 18 ++-- .../ModuleCard/TemperatureModuleSlideout.tsx | 4 +- .../ModuleCard/TestShakeSlideout.tsx | 10 +-- .../ModuleCard/ThermocyclerModuleData.tsx | 36 ++++---- .../ModuleCard/ThermocyclerModuleSlideout.tsx | 4 +- .../__tests__/HeaterShakerModuleData.test.tsx | 14 ++-- .../__tests__/ThermocyclerModuleData.test.tsx | 2 +- app/src/organisms/ModuleCard/index.tsx | 8 +- .../organisms/ModuleWizardFlows/Success.tsx | 4 +- app/src/organisms/ModuleWizardFlows/index.tsx | 4 +- .../organisms/Navigation/NavigationMenu.tsx | 6 +- .../RestartRobotConfirmationModal.tsx | 4 +- app/src/organisms/Navigation/index.tsx | 20 ++--- .../AlternativeSecurityTypeModal.tsx | 4 +- .../NetworkSettings/ConnectingNetwork.tsx | 6 +- .../NetworkSettings/DisplaySearchNetwork.tsx | 6 +- .../NetworkSettings/DisplayWifiList.tsx | 24 +++--- .../NetworkSettings/FailedToConnect.tsx | 6 +- .../SelectAuthenticationType.tsx | 6 +- .../organisms/NetworkSettings/SetWifiCred.tsx | 8 +- .../organisms/NetworkSettings/SetWifiSsid.tsx | 10 +-- .../NetworkSettings/WifiConnectionDetails.tsx | 6 +- .../__tests__/DisplaySearchNetwork.test.tsx | 4 +- .../NameRobot/ConfirmRobotName.tsx | 4 +- .../RobotDashboard/EmptyRecentRun.tsx | 6 +- .../RobotDashboard/RecentRunProtocolCard.tsx | 16 ++-- .../RobotDashboard/ServerInitializing.tsx | 8 +- .../__tests__/RecentRunProtocolCard.test.tsx | 6 +- .../RunningProtocol/CancelingRunModal.tsx | 6 +- .../RunningProtocol/ConfirmCancelRunModal.tsx | 4 +- .../CurrentRunningProtocolCommand.tsx | 8 +- .../RunningProtocol/PlayPauseButton.tsx | 20 ++--- .../RunningProtocol/RunFailedModal.tsx | 8 +- .../RunningProtocolCommandList.tsx | 8 +- .../RunningProtocol/StopButton.tsx | 20 ++--- .../organisms/OpenDoorAlertModal/index.tsx | 6 +- .../PipetteWizardFlows/AttachProbe.tsx | 4 +- .../PipetteWizardFlows/BeforeBeginning.tsx | 4 +- .../organisms/PipetteWizardFlows/Carriage.tsx | 4 +- .../PipetteWizardFlows/ChoosePipette.tsx | 26 +++--- .../PipetteWizardFlows/DetachPipette.tsx | 8 +- .../PipetteWizardFlows/ExitModal.tsx | 4 +- .../PipetteWizardFlows/MountingPlate.tsx | 4 +- .../PipetteWizardFlows/ProbeNotAttached.tsx | 6 +- .../organisms/PipetteWizardFlows/Results.tsx | 14 ++-- .../PipetteWizardFlows/UnskippableModal.tsx | 4 +- .../__tests__/ChoosePipette.test.tsx | 10 +-- .../__tests__/Results.test.tsx | 10 +-- .../ProtocolLabwareDetails.tsx | 6 +- .../ProtocolLiquidsDetails.tsx | 4 +- .../ProtocolDetails/ProtocolStats.tsx | 6 +- .../RobotConfigurationDetails.tsx | 6 +- app/src/organisms/ProtocolDetails/index.tsx | 38 ++++----- .../ProtocolSetupInstruments/index.tsx | 4 +- .../organisms/ProtocolSetupLabware/index.tsx | 24 +++--- .../ProtocolSetupLiquids/LiquidDetails.tsx | 6 +- .../organisms/ProtocolSetupLiquids/index.tsx | 8 +- .../FixtureTable.tsx | 6 +- .../ModuleTable.tsx | 10 +-- .../SetupInstructionsModal.tsx | 6 +- .../ConfirmDeleteProtocolModal.tsx | 4 +- .../ProtocolsLanding/ProtocolCard.tsx | 20 ++--- .../ProtocolsLanding/ProtocolList.tsx | 14 ++-- .../ProtocolsLanding/ProtocolOverflowMenu.tsx | 4 +- .../ProtocolsLanding/ProtocolUploadInput.tsx | 4 +- .../ModuleCalibrationItems.tsx | 4 +- .../ModuleCalibrationOverflowMenu.tsx | 4 +- .../CalibrationDetails/OverflowMenu.tsx | 4 +- .../PipetteOffsetCalibrationItems.tsx | 4 +- .../TipLengthCalibrationItems.tsx | 4 +- .../DeckCalibrationConfirmModal.tsx | 6 +- .../RobotSettingsDeckCalibration.tsx | 4 +- .../RobotSettingsGripperCalibration.tsx | 6 +- .../RobotSettingsDashboard/DeviceReset.tsx | 16 ++-- .../EthernetConnectionDetails.tsx | 8 +- .../NetworkSettings/NetworkDetailsModal.tsx | 6 +- .../NetworkSettings/WifiConnectionDetails.tsx | 10 +-- .../NetworkSettings/index.tsx | 10 +-- .../RobotSystemVersion.tsx | 4 +- .../RobotSettingsDashboard/TextSize.tsx | 6 +- .../TouchscreenBrightness.tsx | 10 +-- .../RobotSettingsDashboard/UpdateChannel.tsx | 10 +-- app/src/organisms/RobotSetupHeader/index.tsx | 4 +- .../RunDetails/ConfirmCancelModal.tsx | 4 +- app/src/organisms/RunPreview/index.tsx | 20 ++--- app/src/organisms/RunProgressMeter/Tick.tsx | 6 +- app/src/organisms/RunProgressMeter/index.tsx | 10 +-- .../organisms/TakeoverModal/TakeoverModal.tsx | 8 +- app/src/organisms/TaskList/index.tsx | 42 +++++----- app/src/organisms/UpdateAppModal/index.tsx | 4 +- .../UpdateRobotSoftware/CheckUpdates.tsx | 6 +- .../CompleteUpdateSoftware.tsx | 6 +- .../ErrorUpdateSoftware.tsx | 8 +- .../UpdateRobotSoftware/NoUpdateFound.tsx | 6 +- .../UpdateRobotSoftware/UpdateSoftware.tsx | 6 +- .../__tests__/UpdateSoftware.test.tsx | 4 +- .../pages/AppSettings/AdvancedSettings.tsx | 16 ++-- app/src/pages/AppSettings/GeneralSettings.tsx | 4 +- app/src/pages/AppSettings/index.tsx | 6 +- .../DisplayConnectionStatus.tsx | 8 +- app/src/pages/ConnectViaUSB/index.tsx | 16 ++-- .../DeviceDetails/DeviceDetailsComponent.tsx | 6 +- .../pages/Devices/DevicesLanding/index.tsx | 4 +- .../Devices/ProtocolRunDetails/index.tsx | 20 ++--- app/src/pages/Devices/RobotSettings/index.tsx | 6 +- app/src/pages/EmergencyStop/index.tsx | 8 +- app/src/pages/InitialLoadingScreen/index.tsx | 6 +- .../InstrumentDetailOverflowMenu.tsx | 4 +- app/src/pages/InstrumentDetail/index.tsx | 10 +-- .../PipetteRecalibrationODDWarning.tsx | 6 +- app/src/pages/Labware/index.tsx | 14 ++-- app/src/pages/NameRobot/index.tsx | 10 +-- app/src/pages/NetworkSetupMenu/index.tsx | 6 +- .../DeleteProtocolConfirmationModal.tsx | 8 +- .../pages/ProtocolDashboard/NoProtocols.tsx | 6 +- .../ProtocolDashboard/PinnedProtocol.tsx | 8 +- .../pages/ProtocolDashboard/ProtocolCard.tsx | 14 ++-- app/src/pages/ProtocolDashboard/index.tsx | 6 +- .../pages/ProtocolDetails/EmptySection.tsx | 6 +- app/src/pages/ProtocolDetails/Hardware.tsx | 10 +-- app/src/pages/ProtocolDetails/Labware.tsx | 12 +-- app/src/pages/ProtocolDetails/Liquids.tsx | 12 +-- app/src/pages/ProtocolDetails/index.tsx | 12 +-- app/src/pages/ProtocolSetup/Buttons.tsx | 56 ++++++------- app/src/pages/ProtocolSetup/index.tsx | 26 +++--- .../RobotDashboard/AnalyticsOptInModal.tsx | 4 +- app/src/pages/RobotDashboard/WelcomeModal.tsx | 4 +- app/src/pages/RobotDashboard/index.tsx | 4 +- .../RobotSettingButton.tsx | 12 +-- .../RobotSettingsList.tsx | 10 +-- app/src/pages/RunSummary/index.tsx | 30 +++---- app/src/pages/RunningProtocol/index.tsx | 4 +- app/src/pages/Welcome/index.tsx | 4 +- .../__tests__/CheckboxField.test.tsx | 20 ++--- components/src/atoms/CheckboxField/index.tsx | 28 +++---- components/src/atoms/StepMeter/index.tsx | 6 +- .../src/atoms/buttons/AlertPrimaryButton.tsx | 8 +- .../src/atoms/buttons/PrimaryButton.tsx | 14 ++-- .../src/atoms/buttons/SecondaryButton.tsx | 10 +-- .../__tests__/AlertPrimaryButton.test.tsx | 4 +- .../buttons/__tests__/PrimaryButton.test.tsx | 24 +++--- .../__tests__/SecondaryButton.test.tsx | 12 +-- .../src/hardware-sim/BaseDeck/BaseDeck.tsx | 12 +-- .../src/hardware-sim/BaseDeck/SlotClip.tsx | 4 +- .../BaseDeck/WasteChuteFixture.tsx | 8 +- .../BaseDeck/WasteChuteStagingAreaFixture.tsx | 8 +- .../src/hardware-sim/Deck/FlexTrash.tsx | 6 +- .../hardware-sim/Deck/MoveLabwareOnDeck.tsx | 16 ++-- .../DeckConfigurator/EmptyConfigFixture.tsx | 20 ++--- .../StagingAreaConfigFixture.tsx | 14 ++-- .../TrashBinConfigFixture.tsx | 12 +-- .../WasteChuteConfigFixture.tsx | 14 ++-- .../hardware-sim/DeckConfigurator/index.tsx | 8 +- .../Labware/labwareInternals/FilledWells.tsx | 4 +- .../labwareInternals/LabwareOutline.tsx | 8 +- .../labwareInternals/StaticLabware.tsx | 4 +- .../Labware/labwareInternals/StrokedWells.tsx | 4 +- .../Labware/labwareInternals/StyledWells.tsx | 16 ++-- .../Labware/labwareInternals/Well.tsx | 6 +- .../Labware/labwareInternals/WellLabels.tsx | 4 +- .../src/hardware-sim/Module/HeaterShaker.tsx | 8 +- .../src/hardware-sim/Module/MagneticBlock.tsx | 6 +- .../src/hardware-sim/Module/Temperature.tsx | 10 +-- .../Module/Thermocycler/ThermocyclerGEN1.tsx | 12 +-- .../Module/Thermocycler/ThermocyclerGEN2.tsx | 20 ++--- .../Module/Thermocycler/index.tsx | 8 +- .../hardware-sim/ProtocolDeck/LabwareInfo.tsx | 4 +- .../src/hooks/useSelectDeckLocation/index.tsx | 24 +++--- components/src/icons/IconList.stories.tsx | 10 +-- components/src/modals/BaseModal.tsx | 4 +- components/src/modals/ModalShell.tsx | 12 +-- .../__tests__/LocationIcon.test.tsx | 4 +- .../src/molecules/LocationIcon/index.tsx | 6 +- components/src/molecules/RoundTab.tsx | 14 ++-- components/src/ui-style-constants/index.ts | 2 +- .../src/ui-style-constants/typography.ts | 14 ++-- .../gravimetric/daily_setup.py | 14 ++-- .../tools/plot/plotly-2.12.1.min.js | 2 +- protocol-designer/src/atoms/Slideout.tsx | 12 +-- .../src/components/ColorPicker/index.tsx | 4 +- .../components/DeckSetup/FlexModuleTag.tsx | 8 +- .../LabwareOverlays/EditLabwareOffDeck.tsx | 6 +- .../src/components/DeckSetup/Ot2ModuleTag.tsx | 6 +- .../src/components/DeckSetup/index.tsx | 10 +-- .../components/LiquidsPage/LiquidEditForm.tsx | 8 +- .../src/components/OffDeckLabwareSlideout.tsx | 6 +- .../CreateFileWizard/EquipmentOption.tsx | 8 +- .../modals/CreateFileWizard/InputField.tsx | 24 +++--- .../CreateFileWizard/PipetteTipsTile.tsx | 18 ++-- .../modals/CreateFileWizard/RobotTypeTile.tsx | 24 +++--- .../modals/CreateFileWizard/WizardHeader.tsx | 8 +- .../__tests__/EquipmentOption.test.tsx | 8 +- .../__tests__/RobotTypeTile.test.tsx | 6 +- .../src/components/modules/FlexSlotMap.tsx | 10 +-- .../src/components/swatchColors.ts | 6 +- 433 files changed, 2164 insertions(+), 2164 deletions(-) diff --git a/api-client/src/protocols/utils.ts b/api-client/src/protocols/utils.ts index 76f120b6c07..a639535e631 100644 --- a/api-client/src/protocols/utils.ts +++ b/api-client/src/protocols/utils.ts @@ -1,7 +1,7 @@ // set of functions that parse details out of a protocol record and it's internals import reduce from 'lodash/reduce' -import { COLORS } from '@opentrons/components/src/ui-style-constants' +import { LEGACY_COLORS } from '@opentrons/components/src/ui-style-constants' import { getLabwareDefURI } from '@opentrons/shared-data' import type { Liquid, @@ -254,7 +254,7 @@ export function parseLiquidsInLoadOrder( ...liquid, displayColor: liquid.displayColor ?? - COLORS.liquidColors[index % COLORS.liquidColors.length], + LEGACY_COLORS.liquidColors[index % LEGACY_COLORS.liquidColors.length], } }) diff --git a/app/src/App/DesktopApp.tsx b/app/src/App/DesktopApp.tsx index 05da8bdb524..360c43b1423 100644 --- a/app/src/App/DesktopApp.tsx +++ b/app/src/App/DesktopApp.tsx @@ -3,7 +3,7 @@ import { Redirect, Route, Switch, useRouteMatch } from 'react-router-dom' import { Box, - COLORS, + LEGACY_COLORS, OVERFLOW_AUTO, POSITION_RELATIVE, } from '@opentrons/components' @@ -118,7 +118,7 @@ export const DesktopApp = (): JSX.Element => { position={POSITION_RELATIVE} width="100%" height="100%" - backgroundColor={COLORS.fundamentalsBackground} + backgroundColor={LEGACY_COLORS.fundamentalsBackground} overflow={OVERFLOW_AUTO} > diff --git a/app/src/App/Navbar.tsx b/app/src/App/Navbar.tsx index 3af5d5461cd..cbc7bfc196b 100644 --- a/app/src/App/Navbar.tsx +++ b/app/src/App/Navbar.tsx @@ -6,7 +6,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_START, ALIGN_STRETCH, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, FLEX_NONE, Flex, @@ -30,18 +30,18 @@ import type { RouteProps } from './types' const SALESFORCE_HELP_LINK = 'https://support.opentrons.com/s/' const NavbarLink = styled(NavLink)` - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; align-self: ${ALIGN_STRETCH}; - background-color: ${COLORS.darkBlackEnabled}; + background-color: ${LEGACY_COLORS.darkBlackEnabled}; &:hover { - background-color: ${COLORS.darkBlackHover}; + background-color: ${LEGACY_COLORS.darkBlackHover}; } &:focus-visible { - box-shadow: inset 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: inset 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; outline: none; - background-color: ${COLORS.darkGreyHover}; + background-color: ${LEGACY_COLORS.darkGreyHover}; } &:focus-visible.active { @@ -50,26 +50,26 @@ const NavbarLink = styled(NavLink)` } &:active { - background-color: ${COLORS.darkBlackEnabled}; + background-color: ${LEGACY_COLORS.darkBlackEnabled}; } &.active { - background-color: ${COLORS.darkBlackSelected}; + background-color: ${LEGACY_COLORS.darkBlackSelected}; } &.active:has(svg) { - background-color: ${COLORS.darkBlackEnabled}; + background-color: ${LEGACY_COLORS.darkBlackEnabled}; } ` const NavIconLink = styled(NavLink)` &.active > svg { - color: ${COLORS.medGreyEnabled}; - background-color: ${COLORS.darkBlackSelected}; + color: ${LEGACY_COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.darkBlackSelected}; } ` const IconLink = styled(Link)` &.active > svg { - color: ${COLORS.medGreyEnabled}; - background-color: ${COLORS.darkBlackSelected}; + color: ${LEGACY_COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.darkBlackSelected}; } ` @@ -78,27 +78,27 @@ const NavbarIcon = styled(Icon)` height: ${SIZE_2}; padding: ${SPACING.spacing6}; border-radius: 50%; - color: ${COLORS.medGreyEnabled}; - background-color: ${COLORS.transparent}; + color: ${LEGACY_COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.transparent}; &:hover { - background-color: ${COLORS.darkBlackHover}; + background-color: ${LEGACY_COLORS.darkBlackHover}; } &:focus-visible { - box-shadow: inset 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: inset 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; outline: none; - background-color: ${COLORS.darkGreyHover}; + background-color: ${LEGACY_COLORS.darkGreyHover}; } &:active { - color: ${COLORS.medGreyEnabled}; - background-color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.darkBlackEnabled}; } &.active { - color: ${COLORS.medGreyEnabled}; - background-color: ${COLORS.darkBlackSelected}; + color: ${LEGACY_COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.darkBlackSelected}; } ` @@ -113,7 +113,7 @@ export function Navbar({ routes }: { routes: RouteProps[] }): JSX.Element { ) return ( { position: ${POSITION_RELATIVE}; width: 100%; height: 100%; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; overflow-y: ${OVERFLOW_AUTO}; &::-webkit-scrollbar { @@ -256,7 +256,7 @@ export const OnDeviceDisplayApp = (): JSX.Element => { } &::-webkit-scrollbar-thumb { - background: ${COLORS.darkBlack40}; + background: ${LEGACY_COLORS.darkBlack40}; border-radius: 11px; } ` diff --git a/app/src/App/OnDeviceDisplayAppFallback.tsx b/app/src/App/OnDeviceDisplayAppFallback.tsx index c822b189193..457406d72b0 100644 --- a/app/src/App/OnDeviceDisplayAppFallback.tsx +++ b/app/src/App/OnDeviceDisplayAppFallback.tsx @@ -12,7 +12,7 @@ import { Flex, JUSTIFY_CENTER, SPACING, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { StyledText } from '../atoms/text' @@ -39,7 +39,7 @@ export function OnDeviceDisplayAppFallback({ const modalHeader: ModalHeaderBaseProps = { title: t('error_boundary_title'), iconName: 'ot-alert', - iconColor: COLORS.red2, + iconColor: LEGACY_COLORS.red2, } // immediately report to robot logs that something fatal happened diff --git a/app/src/DesignTokens/BorderRadius/BorderRadius.stories.tsx b/app/src/DesignTokens/BorderRadius/BorderRadius.stories.tsx index da7f396ede8..109a103d9b0 100644 --- a/app/src/DesignTokens/BorderRadius/BorderRadius.stories.tsx +++ b/app/src/DesignTokens/BorderRadius/BorderRadius.stories.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, SPACING, TYPOGRAPHY, @@ -48,7 +48,7 @@ const Template: Story = args => { diff --git a/app/src/DesignTokens/Colors/Colors.stories.tsx b/app/src/DesignTokens/Colors/Colors.stories.tsx index 431375bc82c..99324d89f6e 100644 --- a/app/src/DesignTokens/Colors/Colors.stories.tsx +++ b/app/src/DesignTokens/Colors/Colors.stories.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, SPACING, @@ -51,7 +51,7 @@ const Template: Story = args => { } const handleClick = (colorName: string): void => { - navigator.clipboard.writeText(`COLORS.${colorName}`) + navigator.clipboard.writeText(`LEGACY_COLORS.${colorName}`) setCopiedColor(colorName) setTimeout(() => { setCopiedColor(null) @@ -79,7 +79,7 @@ const Template: Story = args => { borderRadius={BORDERS.borderRadiusSize2} onClick={() => handleClick(color[0])} style={{ cursor: 'pointer' }} - border={`2px solid ${COLORS.darkBlackEnabled}`} + border={`2px solid ${LEGACY_COLORS.darkBlackEnabled}`} > = args => { } export const AllColors = Template.bind({}) -const allColors = Object.entries(COLORS) +const allColors = Object.entries(LEGACY_COLORS) AllColors.args = { colors: allColors, } diff --git a/app/src/DesignTokens/Spacing/Spacing.stories.tsx b/app/src/DesignTokens/Spacing/Spacing.stories.tsx index 6856b696365..b2fe2c2cc26 100644 --- a/app/src/DesignTokens/Spacing/Spacing.stories.tsx +++ b/app/src/DesignTokens/Spacing/Spacing.stories.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, SPACING, TYPOGRAPHY, @@ -51,7 +51,7 @@ const Template: Story = args => { ))} diff --git a/app/src/atoms/Banner/index.tsx b/app/src/atoms/Banner/index.tsx index b042f2dcb3d..983dcfca806 100644 --- a/app/src/atoms/Banner/index.tsx +++ b/app/src/atoms/Banner/index.tsx @@ -4,7 +4,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, Flex, Icon, @@ -49,28 +49,28 @@ const BANNER_PROPS_BY_TYPE: Record< > = { success: { icon: { name: 'check-circle' }, - backgroundColor: COLORS.successBackgroundLight, - color: COLORS.successEnabled, + backgroundColor: LEGACY_COLORS.successBackgroundLight, + color: LEGACY_COLORS.successEnabled, }, error: { icon: { name: 'alert-circle' }, - backgroundColor: COLORS.errorBackgroundLight, - color: COLORS.errorEnabled, + backgroundColor: LEGACY_COLORS.errorBackgroundLight, + color: LEGACY_COLORS.errorEnabled, }, warning: { icon: { name: 'alert-circle' }, - backgroundColor: COLORS.warningBackgroundLight, - color: COLORS.warningEnabled, + backgroundColor: LEGACY_COLORS.warningBackgroundLight, + color: LEGACY_COLORS.warningEnabled, }, updating: { icon: { name: 'ot-spinner' }, - backgroundColor: COLORS.darkGreyDisabled, - color: COLORS.darkGreyEnabled, + backgroundColor: LEGACY_COLORS.darkGreyDisabled, + color: LEGACY_COLORS.darkGreyEnabled, }, informing: { icon: { name: 'information' }, - backgroundColor: COLORS.fundamentalsBackground, - color: COLORS.darkGreyEnabled, + backgroundColor: LEGACY_COLORS.fundamentalsBackground, + color: LEGACY_COLORS.darkGreyEnabled, }, } @@ -106,7 +106,7 @@ export function Banner(props: BannerProps): JSX.Element { font-size: 1.25rem; font-weight: ${TYPOGRAPHY.fontWeightSemiBold}; border: none; - background-color: ${COLORS.yellow3}; + background-color: ${LEGACY_COLORS.yellow3}; border-radius: ${BORDERS.borderRadiusSize3}; line-height: 1.5rem; } diff --git a/app/src/atoms/Chip/Chip.stories.tsx b/app/src/atoms/Chip/Chip.stories.tsx index 1ac28f769a4..21d8ffce58b 100644 --- a/app/src/atoms/Chip/Chip.stories.tsx +++ b/app/src/atoms/Chip/Chip.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { Flex, COLORS, SPACING } from '@opentrons/components' +import { Flex, LEGACY_COLORS, SPACING } from '@opentrons/components' import { touchScreenViewport } from '../../DesignTokens/constants' import { Chip } from '.' import type { Story, Meta } from '@storybook/react' @@ -18,7 +18,7 @@ interface ChipStorybookProps extends React.ComponentProps { const Template: Story = ({ ...args }) => ( diff --git a/app/src/atoms/Chip/__tests__/Chip.test.tsx b/app/src/atoms/Chip/__tests__/Chip.test.tsx index e2d635ce238..74b1d81705a 100644 --- a/app/src/atoms/Chip/__tests__/Chip.test.tsx +++ b/app/src/atoms/Chip/__tests__/Chip.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { BORDERS, COLORS, renderWithProviders } from '@opentrons/components' +import { BORDERS, LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { Chip } from '..' @@ -19,8 +19,8 @@ describe('Chip', () => { const [{ getByTestId, getByText, queryByLabelText }] = render(props) const chip = getByTestId('Chip_basic') const chipText = getByText('mockBasic') - expect(chip).toHaveStyle(`background-color: ${COLORS.darkBlack20}`) - expect(chipText).toHaveStyle(`color: ${COLORS.darkBlack90}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.darkBlack20}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.darkBlack90}`) expect(queryByLabelText('icon_mockBasic')).not.toBeInTheDocument() }) @@ -32,11 +32,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_success') const chipText = getByText('mockSuccess') - expect(chip).toHaveStyle(`background-color: ${COLORS.green3}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.green3}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.green1}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.green1}`) const icon = getByLabelText('icon_mockSuccess') - expect(icon).toHaveStyle(`color: ${COLORS.green1}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.green1}`) }) it('should render text, icon, no bgcolor with success colors and bg false', () => { @@ -48,11 +48,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_success') const chipText = getByText('mockSuccess') - expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.transparent}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.green1}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.green1}`) const icon = getByLabelText('icon_mockSuccess') - expect(icon).toHaveStyle(`color: ${COLORS.green1}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.green1}`) }) it('should render text, icon, bgcolor with warning colors', () => { @@ -63,11 +63,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_warning') const chipText = getByText('mockWarning') - expect(chip).toHaveStyle(`background-color: ${COLORS.yellow3}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.yellow3}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.yellow1}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.yellow1}`) const icon = getByLabelText('icon_mockWarning') - expect(icon).toHaveStyle(`color: ${COLORS.yellow1}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.yellow1}`) }) it('should render text, icon, no bgcolor with warning colors and bg false', () => { @@ -79,11 +79,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_warning') const chipText = getByText('mockWarning') - expect(chip).toHaveStyle(`background-color: ${String(COLORS.transparent)}`) + expect(chip).toHaveStyle(`background-color: ${String(LEGACY_COLORS.transparent)}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${String(COLORS.yellow1)}`) + expect(chipText).toHaveStyle(`color: ${String(LEGACY_COLORS.yellow1)}`) const icon = getByLabelText('icon_mockWarning') - expect(icon).toHaveStyle(`color: ${String(COLORS.yellow1)}`) + expect(icon).toHaveStyle(`color: ${String(LEGACY_COLORS.yellow1)}`) }) it('should render text, icon, bgcolor with neutral colors', () => { @@ -94,11 +94,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_neutral') const chipText = getByText('mockNeutral') - expect(chip).toHaveStyle(`background-color: ${COLORS.darkBlack20}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.darkBlack20}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.darkBlack70}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.darkBlack70}`) const icon = getByLabelText('icon_mockNeutral') - expect(icon).toHaveStyle(`color: ${COLORS.darkBlack90}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.darkBlack90}`) }) it('should render text, icon, no bgcolor with neutral colors and bg false', () => { @@ -110,11 +110,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_neutral') const chipText = getByText('mockNeutral') - expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.transparent}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.darkBlack70}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.darkBlack70}`) const icon = getByLabelText('icon_mockNeutral') - expect(icon).toHaveStyle(`color: ${COLORS.darkBlack90}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.darkBlack90}`) }) it('should render text, icon, bgcolor with error colors', () => { @@ -125,11 +125,11 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_error') const chipText = getByText('mockError') - expect(chip).toHaveStyle(`background-color: ${COLORS.red3}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.red3}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.red1}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.red1}`) const icon = getByLabelText('icon_mockError') - expect(icon).toHaveStyle(`color: ${COLORS.red1}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.red1}`) }) it('should render text, icon, no bgcolor with error colors and bg false', () => { @@ -141,10 +141,10 @@ describe('Chip', () => { const [{ getByTestId, getByText, getByLabelText }] = render(props) const chip = getByTestId('Chip_error') const chipText = getByText('mockError') - expect(chip).toHaveStyle(`background-color: ${COLORS.transparent}`) + expect(chip).toHaveStyle(`background-color: ${LEGACY_COLORS.transparent}`) expect(chip).toHaveStyle(`border-radius: ${BORDERS.borderRadiusSize5}`) - expect(chipText).toHaveStyle(`color: ${COLORS.red1}`) + expect(chipText).toHaveStyle(`color: ${LEGACY_COLORS.red1}`) const icon = getByLabelText('icon_mockError') - expect(icon).toHaveStyle(`color: ${COLORS.red1}`) + expect(icon).toHaveStyle(`color: ${LEGACY_COLORS.red1}`) }) }) diff --git a/app/src/atoms/Chip/index.tsx b/app/src/atoms/Chip/index.tsx index 2b5523649b9..54aef2fb492 100644 --- a/app/src/atoms/Chip/index.tsx +++ b/app/src/atoms/Chip/index.tsx @@ -8,7 +8,7 @@ import { SPACING, TYPOGRAPHY, Icon, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { StyledText } from '../text' @@ -39,34 +39,34 @@ const CHIP_PROPS_BY_TYPE: Record< } > = { basic: { - backgroundColor: COLORS.darkBlack20, + backgroundColor: LEGACY_COLORS.darkBlack20, borderRadius: BORDERS.borderRadiusSize1, - textColor: COLORS.darkBlack90, + textColor: LEGACY_COLORS.darkBlack90, }, error: { - backgroundColor: COLORS.red3, + backgroundColor: LEGACY_COLORS.red3, borderRadius: BORDERS.borderRadiusSize5, - iconColor: COLORS.red1, - textColor: COLORS.red1, + iconColor: LEGACY_COLORS.red1, + textColor: LEGACY_COLORS.red1, }, neutral: { - backgroundColor: COLORS.darkBlack20, + backgroundColor: LEGACY_COLORS.darkBlack20, borderRadius: BORDERS.borderRadiusSize5, - iconColor: COLORS.darkBlack90, - textColor: COLORS.darkBlack70, + iconColor: LEGACY_COLORS.darkBlack90, + textColor: LEGACY_COLORS.darkBlack70, }, success: { - backgroundColor: COLORS.green3, + backgroundColor: LEGACY_COLORS.green3, borderRadius: BORDERS.borderRadiusSize5, - iconColor: COLORS.green1, + iconColor: LEGACY_COLORS.green1, iconName: 'ot-check', - textColor: COLORS.green1, + textColor: LEGACY_COLORS.green1, }, warning: { - backgroundColor: COLORS.yellow3, + backgroundColor: LEGACY_COLORS.yellow3, borderRadius: BORDERS.borderRadiusSize5, - iconColor: COLORS.yellow1, - textColor: COLORS.yellow1, + iconColor: LEGACY_COLORS.yellow1, + textColor: LEGACY_COLORS.yellow1, }, } @@ -79,7 +79,7 @@ export function Chip({ }: ChipProps): JSX.Element { const backgroundColor = background === false && type !== 'basic' - ? COLORS.transparent + ? LEGACY_COLORS.transparent : CHIP_PROPS_BY_TYPE[type].backgroundColor const icon = iconName ?? CHIP_PROPS_BY_TYPE[type].iconName ?? 'ot-alert' return ( diff --git a/app/src/atoms/GlobalStyle/index.ts b/app/src/atoms/GlobalStyle/index.ts index e39c351fbe6..206ac78250c 100644 --- a/app/src/atoms/GlobalStyle/index.ts +++ b/app/src/atoms/GlobalStyle/index.ts @@ -1,5 +1,5 @@ import { createGlobalStyle } from 'styled-components' -import { COLORS } from '@opentrons/components' +import { LEGACY_COLORS } from '@opentrons/components' import 'typeface-open-sans' import '@fontsource/dejavu-sans' import '@fontsource/public-sans' @@ -25,7 +25,7 @@ export const GlobalStyle = createGlobalStyle<{ isOnDevice?: boolean }>` body { width: 100%; height: 100%; - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; } a { diff --git a/app/src/atoms/InlineNotification/index.tsx b/app/src/atoms/InlineNotification/index.tsx index 3367104392b..8b30a3b1fcd 100644 --- a/app/src/atoms/InlineNotification/index.tsx +++ b/app/src/atoms/InlineNotification/index.tsx @@ -6,7 +6,7 @@ import { Flex, DIRECTION_ROW, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, BORDERS, @@ -36,23 +36,23 @@ const INLINE_NOTIFICATION_PROPS_BY_TYPE: Record< > = { alert: { icon: { name: 'ot-alert' }, - backgroundColor: COLORS.yellow3, - color: COLORS.yellow2, + backgroundColor: LEGACY_COLORS.yellow3, + color: LEGACY_COLORS.yellow2, }, error: { icon: { name: 'ot-alert' }, - backgroundColor: COLORS.red3, - color: COLORS.red2, + backgroundColor: LEGACY_COLORS.red3, + color: LEGACY_COLORS.red2, }, neutral: { icon: { name: 'information' }, - backgroundColor: COLORS.darkBlack20, - color: COLORS.darkBlackEnabled, + backgroundColor: LEGACY_COLORS.darkBlack20, + color: LEGACY_COLORS.darkBlackEnabled, }, success: { icon: { name: 'ot-check' }, - backgroundColor: COLORS.green3, - color: COLORS.green2, + backgroundColor: LEGACY_COLORS.green3, + color: LEGACY_COLORS.green2, }, } diff --git a/app/src/atoms/InputField/index.tsx b/app/src/atoms/InputField/index.tsx index 58eb8945db3..39ee64b13ef 100644 --- a/app/src/atoms/InputField/index.tsx +++ b/app/src/atoms/InputField/index.tsx @@ -5,7 +5,7 @@ import { ALIGN_CENTER, BORDERS, COLOR_WARNING_DARK, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DISPLAY_INLINE_BLOCK, Flex, @@ -71,7 +71,7 @@ export function InputField(props: InputFieldProps): JSX.Element { lineHeight={1} fontSize={TYPOGRAPHY.fontSizeP} fontWeight={TYPOGRAPHY.fontWeightRegular} - color={props.error != null ? COLOR_WARNING_DARK : COLORS.darkBlackEnabled} + color={props.error != null ? COLOR_WARNING_DARK : LEGACY_COLORS.darkBlackEnabled} opacity={props.disabled ?? false ? 0.5 : ''} > @@ -86,20 +86,20 @@ function Input(props: InputFieldProps): JSX.Element { const INPUT_FIELD = css` display: flex; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; border-radius: ${SPACING.spacing4}; padding: ${SPACING.spacing8}; border: 1px ${BORDERS.styleSolid} - ${error ? COLORS.errorEnabled : COLORS.medGreyEnabled}; + ${error ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.medGreyEnabled}; font-size: ${TYPOGRAPHY.fontSizeP}; &:active { - border: 1px ${BORDERS.styleSolid} ${COLORS.darkGreyEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.darkGreyEnabled}; } & input { border-radius: inherit; - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; border: none; flex: 1 1 auto; width: 100%; @@ -111,13 +111,13 @@ function Input(props: InputFieldProps): JSX.Element { &:hover { border: 1px ${BORDERS.styleSolid} - ${error ? COLORS.errorEnabled : COLORS.medGreyHover}; + ${error ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.medGreyHover}; } &:focus { - border: 1px ${BORDERS.styleSolid} ${COLORS.blueEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.blueEnabled}; } &:disabled { - border: 1px ${BORDERS.styleSolid} ${COLORS.darkGreyDisabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.darkGreyDisabled}; } input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { @@ -134,10 +134,10 @@ function Input(props: InputFieldProps): JSX.Element { ` const ERROR_TEXT_STYLE = css` - color: ${COLORS.errorEnabled}; + color: ${LEGACY_COLORS.errorEnabled}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { font-size: ${TYPOGRAPHY.fontSize22}; - color: ${COLORS.red2}; + color: ${LEGACY_COLORS.red2}; } ` @@ -155,7 +155,7 @@ function Input(props: InputFieldProps): JSX.Element { display={DISPLAY_INLINE_BLOCK} textAlign={TEXT_ALIGN_RIGHT} alignSelf={ALIGN_CENTER} - color={COLORS.darkGreyEnabled} + color={LEGACY_COLORS.darkGreyEnabled} fontSize={TYPOGRAPHY.fontSizeLabel} > {props.units} @@ -163,7 +163,7 @@ function Input(props: InputFieldProps): JSX.Element { )} - + - + )} diff --git a/app/src/atoms/Link/ExternalLink.stories.tsx b/app/src/atoms/Link/ExternalLink.stories.tsx index 73c7e7c2dd6..4d1af5070ec 100644 --- a/app/src/atoms/Link/ExternalLink.stories.tsx +++ b/app/src/atoms/Link/ExternalLink.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { Flex, COLORS } from '@opentrons/components' +import { Flex, LEGACY_COLORS } from '@opentrons/components' import { ExternalLink } from './ExternalLink' import type { Story, Meta } from '@storybook/react' @@ -10,7 +10,7 @@ export default { } as Meta const Template: Story> = args => ( - + ) diff --git a/app/src/atoms/Link/__tests__/ExternalLink.test.tsx b/app/src/atoms/Link/__tests__/ExternalLink.test.tsx index a4bbd1ab0e8..a6b7d2e0797 100644 --- a/app/src/atoms/Link/__tests__/ExternalLink.test.tsx +++ b/app/src/atoms/Link/__tests__/ExternalLink.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { ExternalLink } from '../ExternalLink' const TEST_URL = 'https://opentrons.com' @@ -25,7 +25,7 @@ describe('ExternalLink', () => { const link = getByText('Test Link') expect(link).toHaveAttribute('href', 'https://opentrons.com') expect(link).toHaveAttribute('target', '_blank') - expect(link).toHaveStyle(`color: ${String(COLORS.blueEnabled)}`) + expect(link).toHaveStyle(`color: ${String(LEGACY_COLORS.blueEnabled)}`) }) it('renders open-in-new icon', () => { diff --git a/app/src/atoms/ListItem/__tests__/ListItem.test.tsx b/app/src/atoms/ListItem/__tests__/ListItem.test.tsx index 0f17babdf1b..051ea9191dd 100644 --- a/app/src/atoms/ListItem/__tests__/ListItem.test.tsx +++ b/app/src/atoms/ListItem/__tests__/ListItem.test.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { BORDERS, - COLORS, + LEGACY_COLORS, renderWithProviders, SPACING, } from '@opentrons/components' @@ -26,7 +26,7 @@ describe('ListItem', () => { const [{ getByText, getByTestId }] = render(props) getByText('mock listitem content') const listItem = getByTestId('ListItem_error') - expect(listItem).toHaveStyle(`backgroundColor: ${COLORS.red3}`) + expect(listItem).toHaveStyle(`backgroundColor: ${LEGACY_COLORS.red3}`) expect(listItem).toHaveStyle( `padding: ${SPACING.spacing16} ${SPACING.spacing24}` ) @@ -37,7 +37,7 @@ describe('ListItem', () => { const [{ getByText, getByTestId }] = render(props) getByText('mock listitem content') const listItem = getByTestId('ListItem_noActive') - expect(listItem).toHaveStyle(`backgroundColor: ${COLORS.light1}`) + expect(listItem).toHaveStyle(`backgroundColor: ${LEGACY_COLORS.light1}`) expect(listItem).toHaveStyle( `padding: ${SPACING.spacing16} ${SPACING.spacing24}` ) @@ -48,7 +48,7 @@ describe('ListItem', () => { const [{ getByText, getByTestId }] = render(props) getByText('mock listitem content') const listItem = getByTestId('ListItem_success') - expect(listItem).toHaveStyle(`backgroundColor: ${COLORS.green3}`) + expect(listItem).toHaveStyle(`backgroundColor: ${LEGACY_COLORS.green3}`) expect(listItem).toHaveStyle( `padding: ${SPACING.spacing16} ${SPACING.spacing24}` ) @@ -59,7 +59,7 @@ describe('ListItem', () => { const [{ getByText, getByTestId }] = render(props) getByText('mock listitem content') const listItem = getByTestId('ListItem_warning') - expect(listItem).toHaveStyle(`backgroundColor: ${COLORS.yellow3}`) + expect(listItem).toHaveStyle(`backgroundColor: ${LEGACY_COLORS.yellow3}`) expect(listItem).toHaveStyle( `padding: ${SPACING.spacing16} ${SPACING.spacing24}` ) diff --git a/app/src/atoms/ListItem/index.tsx b/app/src/atoms/ListItem/index.tsx index 1ce33bb9cb2..c6ed0697c1a 100644 --- a/app/src/atoms/ListItem/index.tsx +++ b/app/src/atoms/ListItem/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { BORDERS, COLORS, Flex, SPACING } from '@opentrons/components' +import { BORDERS, LEGACY_COLORS, Flex, SPACING } from '@opentrons/components' import type { StyleProps } from '@opentrons/components' @@ -18,16 +18,16 @@ const LISTITEM_PROPS_BY_TYPE: Record< { backgroundColor: string } > = { error: { - backgroundColor: COLORS.red3, + backgroundColor: LEGACY_COLORS.red3, }, noActive: { - backgroundColor: COLORS.light1, + backgroundColor: LEGACY_COLORS.light1, }, success: { - backgroundColor: COLORS.green3, + backgroundColor: LEGACY_COLORS.green3, }, warning: { - backgroundColor: COLORS.yellow3, + backgroundColor: LEGACY_COLORS.yellow3, }, } diff --git a/app/src/atoms/MenuList/DropdownMenu.tsx b/app/src/atoms/MenuList/DropdownMenu.tsx index 5c1fb657cec..77d50853c9a 100644 --- a/app/src/atoms/MenuList/DropdownMenu.tsx +++ b/app/src/atoms/MenuList/DropdownMenu.tsx @@ -3,7 +3,7 @@ import { css } from 'styled-components' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, POSITION_ABSOLUTE, DIRECTION_COLUMN, @@ -50,7 +50,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element { border={BORDERS.lineBorder} borderRadius={BORDERS.radiusRoundEdge} padding={SPACING.spacing8} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} css={css` cursor: pointer; `} @@ -68,7 +68,7 @@ export function DropdownMenu(props: DropdownMenuProps): JSX.Element { borderRadius={BORDERS.radiusSoftCorners} boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="8.5rem" left={SPACING.spacing16} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/atoms/MenuList/MenuItem.tsx b/app/src/atoms/MenuList/MenuItem.tsx index 603be766a31..e3cf5b40a10 100644 --- a/app/src/atoms/MenuList/MenuItem.tsx +++ b/app/src/atoms/MenuList/MenuItem.tsx @@ -1,7 +1,7 @@ import styled from 'styled-components' import { SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, ALIGN_CENTER, RESPONSIVENESS, @@ -15,19 +15,19 @@ interface ButtonProps extends StyleProps { export const MenuItem = styled.button` text-align: ${TYPOGRAPHY.textAlignLeft}; font-size: ${TYPOGRAPHY.fontSizeP}; - background-color: ${COLORS.transparent}; - color: ${COLORS.darkBlackEnabled}; + background-color: ${LEGACY_COLORS.transparent}; + color: ${LEGACY_COLORS.darkBlackEnabled}; padding: ${SPACING.spacing8} ${SPACING.spacing12} ${SPACING.spacing8} ${SPACING.spacing12}; &:hover, &:active { - background-color: ${COLORS.lightBlue}; + background-color: ${LEGACY_COLORS.lightBlue}; } &:disabled { - background-color: ${COLORS.transparent}; - color: ${COLORS.black}${COLORS.opacity50HexCode}; + background-color: ${LEGACY_COLORS.transparent}; + color: ${LEGACY_COLORS.black}${LEGACY_COLORS.opacity50HexCode}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { @@ -35,22 +35,22 @@ export const MenuItem = styled.button` text-align: ${TYPOGRAPHY.textAlignCenter}; font-size: ${TYPOGRAPHY.fontSize28}; background-color: ${({ isAlert }) => - isAlert ? COLORS.errorEnabled : COLORS.transparent}; + isAlert ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.transparent}; color: ${({ isAlert }) => - isAlert ? COLORS.white : COLORS.darkBlackEnabled}; + isAlert ? LEGACY_COLORS.white : LEGACY_COLORS.darkBlackEnabled}; padding: ${SPACING.spacing24}; height: 5.5rem; line-height: ${TYPOGRAPHY.lineHeight36}; &:hover, &:active { background-color: ${({ isAlert }) => - isAlert ? COLORS.errorEnabled : COLORS.darkBlack20}; + isAlert ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.darkBlack20}; } &:disabled { background-color: ${({ isAlert }) => - isAlert ? COLORS.errorEnabled : COLORS.transparent}; - color: ${({ isAlert }) => (isAlert ? COLORS.white : COLORS.darkBlack60)}; + isAlert ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.transparent}; + color: ${({ isAlert }) => (isAlert ? LEGACY_COLORS.white : LEGACY_COLORS.darkBlack60)}; } } ` diff --git a/app/src/atoms/MenuList/OverflowBtn.tsx b/app/src/atoms/MenuList/OverflowBtn.tsx index c1acb16d2be..c6713e43272 100644 --- a/app/src/atoms/MenuList/OverflowBtn.tsx +++ b/app/src/atoms/MenuList/OverflowBtn.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { Btn, COLORS, SPACING } from '@opentrons/components' +import { Btn, LEGACY_COLORS, SPACING } from '@opentrons/components' export const OverflowBtn = React.forwardRef( ( @@ -14,33 +14,33 @@ export const OverflowBtn = React.forwardRef( max-height: ${SPACING.spacing32}; &:hover { - background-color: ${COLORS.lightGreyHover}; + background-color: ${LEGACY_COLORS.lightGreyHover}; } &:hover circle { - fill: ${COLORS.darkBlackEnabled}; + fill: ${LEGACY_COLORS.darkBlackEnabled}; } &:active, &:focus { - background-color: ${COLORS.lightGreyPressed}; + background-color: ${LEGACY_COLORS.lightGreyPressed}; } &:active circle, &:focus circle { - fill: ${COLORS.darkGreyPressed}; + fill: ${LEGACY_COLORS.darkGreyPressed}; } &:focus-visible { - box-shadow: ${`0 0 0 3px ${COLORS.warningEnabled}`}; + box-shadow: ${`0 0 0 3px ${LEGACY_COLORS.warningEnabled}`}; background-color: ${'transparent'}; } &:focus-visible circle { - fill: ${COLORS.darkGreyHover}; + fill: ${LEGACY_COLORS.darkGreyHover}; } &:disabled circle { - fill: ${COLORS.successDisabled}; + fill: ${LEGACY_COLORS.successDisabled}; } &:disabled { background-color: transparent; @@ -53,7 +53,7 @@ export const OverflowBtn = React.forwardRef( width="19" height="31" viewBox="0 0 19 31" - fill={COLORS.darkGreyEnabled} + fill={LEGACY_COLORS.darkGreyEnabled} xmlns="http://www.w3.org/2000/svg" > diff --git a/app/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx b/app/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx index 0ca1c115d33..8cdee7b82ac 100644 --- a/app/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx +++ b/app/src/atoms/MenuList/__tests__/OverflowBtn.test.tsx @@ -1,7 +1,7 @@ import 'jest-styled-components' import * as React from 'react' import { fireEvent } from '@testing-library/react' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { OverflowBtn } from '../OverflowBtn' const render = (props: React.ComponentProps) => { @@ -27,7 +27,7 @@ describe('OverflowBtn', () => { expect(getByRole('button')).toHaveStyleRule( 'background-color', - `${String(COLORS.lightGreyHover)}`, + `${String(LEGACY_COLORS.lightGreyHover)}`, { modifier: ':hover', } @@ -41,7 +41,7 @@ describe('OverflowBtn', () => { expect(getByRole('button')).toHaveStyleRule( 'background-color', - `${String(COLORS.lightGreyPressed)}`, + `${String(LEGACY_COLORS.lightGreyPressed)}`, { modifier: ':active', } @@ -55,7 +55,7 @@ describe('OverflowBtn', () => { expect(getByRole('button')).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.fundamentalsFocus)}`, + `0 0 0 3px ${String(LEGACY_COLORS.fundamentalsFocus)}`, { modifier: ':focus-visible', } @@ -69,7 +69,7 @@ describe('OverflowBtn', () => { expect(getByRole('button')).toHaveStyleRule( 'fill', - `${String(COLORS.successDisabled)}`, + `${String(LEGACY_COLORS.successDisabled)}`, { modifier: ':disabled circle', } diff --git a/app/src/atoms/MenuList/hooks.tsx b/app/src/atoms/MenuList/hooks.tsx index dde7ef99bf3..00b87347a51 100644 --- a/app/src/atoms/MenuList/hooks.tsx +++ b/app/src/atoms/MenuList/hooks.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { COLORS, Overlay } from '@opentrons/components' +import { LEGACY_COLORS, Overlay } from '@opentrons/components' interface MenuHandleClickOutside { menuOverlay: JSX.Element @@ -28,7 +28,7 @@ export function useMenuHandleClickOutside(): MenuHandleClickOutside { {showOverflowMenu ? ( ) : null} diff --git a/app/src/atoms/MenuList/index.tsx b/app/src/atoms/MenuList/index.tsx index 4d06e8f5de5..422cfa93af9 100644 --- a/app/src/atoms/MenuList/index.tsx +++ b/app/src/atoms/MenuList/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, DIRECTION_COLUMN, Flex, @@ -38,7 +38,7 @@ export const MenuList = (props: MenuListProps): JSX.Element | null => { zIndex={10} boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.6rem" right={`calc(50% + ${SPACING.spacing4})`} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/atoms/ProgressBar/ProgressBar.stories.tsx b/app/src/atoms/ProgressBar/ProgressBar.stories.tsx index 3982c6a5b21..38c614c5548 100644 --- a/app/src/atoms/ProgressBar/ProgressBar.stories.tsx +++ b/app/src/atoms/ProgressBar/ProgressBar.stories.tsx @@ -4,7 +4,7 @@ import { Flex, DIRECTION_COLUMN, SPACING, - COLORS, + LEGACY_COLORS, SecondaryButton, } from '@opentrons/components' @@ -33,7 +33,7 @@ const Template: Story> = args => { {'Add 5% to the current progress every 0.2 sec'} diff --git a/app/src/atoms/ProgressBar/__tests__/ProgressBar.test.tsx b/app/src/atoms/ProgressBar/__tests__/ProgressBar.test.tsx index a02a016d04c..d63f0b06776 100644 --- a/app/src/atoms/ProgressBar/__tests__/ProgressBar.test.tsx +++ b/app/src/atoms/ProgressBar/__tests__/ProgressBar.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { ProgressBar } from '..' const render = (props: React.ComponentProps) => { @@ -24,7 +24,7 @@ describe('ProgressBar', () => { const [{ getByTestId }] = render(props) const container = getByTestId('ProgressBar_Container') const bar = getByTestId('ProgressBar_Bar') - expect(container).toHaveStyle(`background: ${COLORS.white}`) + expect(container).toHaveStyle(`background: ${LEGACY_COLORS.white}`) expect(bar).toHaveStyle('width: 0%') }) @@ -32,7 +32,7 @@ describe('ProgressBar', () => { props.percentComplete = 50 const [{ getByTestId }] = render(props) const bar = getByTestId('ProgressBar_Bar') - expect(bar).toHaveStyle(`background: ${COLORS.blueEnabled}`) + expect(bar).toHaveStyle(`background: ${LEGACY_COLORS.blueEnabled}`) expect(bar).toHaveStyle('width: 50%') }) @@ -40,19 +40,19 @@ describe('ProgressBar', () => { props.percentComplete = 100 const [{ getByTestId }] = render(props) const bar = getByTestId('ProgressBar_Bar') - expect(bar).toHaveStyle(`background: ${COLORS.blueEnabled}`) + expect(bar).toHaveStyle(`background: ${LEGACY_COLORS.blueEnabled}`) expect(bar).toHaveStyle('width: 100%') }) it('renders LinerProgress Bar at 50% + red width', () => { props.percentComplete = 50 props.innerStyles = css` - background: ${COLORS.errorEnabled}; + background: ${LEGACY_COLORS.errorEnabled}; ` const [{ getByTestId }] = render(props) const bar = getByTestId('ProgressBar_Bar') - expect(bar).not.toHaveStyle(`background: ${COLORS.blueEnabled}`) - expect(bar).toHaveStyle(`background: ${COLORS.errorEnabled}`) + expect(bar).not.toHaveStyle(`background: ${LEGACY_COLORS.blueEnabled}`) + expect(bar).toHaveStyle(`background: ${LEGACY_COLORS.errorEnabled}`) expect(bar).toHaveStyle('width: 50%') }) }) diff --git a/app/src/atoms/ProgressBar/index.tsx b/app/src/atoms/ProgressBar/index.tsx index 6450d602612..1b97a219383 100644 --- a/app/src/atoms/ProgressBar/index.tsx +++ b/app/src/atoms/ProgressBar/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { COLORS, Box } from '@opentrons/components' +import { LEGACY_COLORS, Box } from '@opentrons/components' import type { FlattenSimpleInterpolation } from 'styled-components' @@ -26,7 +26,7 @@ export function ProgressBar({ const LINER_PROGRESS_CONTAINER_STYLE = css` height: 0.5rem; - background: ${COLORS.white}; + background: ${LEGACY_COLORS.white}; padding: 0; width: 100%; margin: 0; @@ -38,7 +38,7 @@ export function ProgressBar({ const LINER_PROGRESS_FILLER_STYLE = css` height: 0.5rem; width: ${progress}; - background: ${COLORS.blueEnabled}; + background: ${LEGACY_COLORS.blueEnabled}; transition: width 0.5s ease-in-out; webkit-transition: width 0.5s ease-in-out; moz-transition: width 0.5s ease-in-out; diff --git a/app/src/atoms/SelectField/Select.tsx b/app/src/atoms/SelectField/Select.tsx index c24729f3d25..782b009e48e 100644 --- a/app/src/atoms/SelectField/Select.tsx +++ b/app/src/atoms/SelectField/Select.tsx @@ -3,7 +3,7 @@ import ReactSelect, { components, DropdownIndicatorProps } from 'react-select' import { BORDERS, Box, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, Icon, POSITION_ABSOLUTE, @@ -43,15 +43,15 @@ export function Select(props: SelectComponentProps): JSX.Element { border: BORDERS.lineBorder, width: props.width != null ? props.width : 'auto', height: SPACING.spacing16, - borderColor: COLORS.medGreyEnabled, + borderColor: LEGACY_COLORS.medGreyEnabled, boxShadow: 'none', padding: SPACING.spacing6, flexDirection: DIRECTION_ROW, '&:hover': { - borderColor: COLORS.medGreyHover, + borderColor: LEGACY_COLORS.medGreyHover, }, '&:active': { - borderColor: COLORS.medGreyHover, + borderColor: LEGACY_COLORS.medGreyHover, }, }), container: (styles: CSSObjectWithLabel) => ({ @@ -62,7 +62,7 @@ export function Select(props: SelectComponentProps): JSX.Element { group: NO_STYLE_FN, groupHeading: (styles: CSSObjectWithLabel) => ({ ...styles, - color: COLORS.darkBlackEnabled, + color: LEGACY_COLORS.darkBlackEnabled, fontWeight: TYPOGRAPHY.fontWeightSemiBold, fontSize: TYPOGRAPHY.fontSizeP, }), @@ -80,7 +80,7 @@ export function Select(props: SelectComponentProps): JSX.Element { loadingMessage: NO_STYLE_FN, menu: (styles: CSSObjectWithLabel) => ({ ...styles, - backgroundColor: COLORS.white, + backgroundColor: LEGACY_COLORS.white, width: props.width != null ? props.width : 'auto', boxShadowcha: '0px 1px 3px rgba(0, 0, 0, 0.2)', borderRadius: '4px 4px 0px 0px', @@ -102,27 +102,27 @@ export function Select(props: SelectComponentProps): JSX.Element { noOptionsMessage: (styles: CSSObjectWithLabel) => ({ ...styles, padding: SPACING.spacing6, - color: COLORS.darkBlackEnabled, + color: LEGACY_COLORS.darkBlackEnabled, }), option: (styles: CSSObjectWithLabel, state: OptionProps) => ({ ...styles, color: Boolean(state.isDisabled) - ? COLORS.darkGreyDisabled - : COLORS.darkBlackEnabled, + ? LEGACY_COLORS.darkGreyDisabled + : LEGACY_COLORS.darkBlackEnabled, backgroundColor: Boolean(state.isSelected) - ? COLORS.lightBlue - : COLORS.white, + ? LEGACY_COLORS.lightBlue + : LEGACY_COLORS.white, '&:hover': { - backgroundColor: COLORS.lightBlue, + backgroundColor: LEGACY_COLORS.lightBlue, }, '&:active': { - backgroundColor: COLORS.lightBlue, + backgroundColor: LEGACY_COLORS.lightBlue, }, }), placeholder: (styles: CSSObjectWithLabel) => ({ ...styles, marginLeft: SPACING.spacing8, - color: COLORS.darkBlackEnabled, + color: LEGACY_COLORS.darkBlackEnabled, fontSize: TYPOGRAPHY.fontSizeP, marginTop: '0.2rem', }), diff --git a/app/src/atoms/SelectField/index.tsx b/app/src/atoms/SelectField/index.tsx index 1ec659acbe5..cd6e0d97811 100644 --- a/app/src/atoms/SelectField/index.tsx +++ b/app/src/atoms/SelectField/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import find from 'lodash/find' import { Select } from './Select' -import { COLORS, Flex, TYPOGRAPHY } from '@opentrons/components' +import { LEGACY_COLORS, Flex, TYPOGRAPHY } from '@opentrons/components' import { css } from 'styled-components' import type { SelectProps, SelectOption } from './Select' @@ -45,7 +45,7 @@ export interface SelectFieldProps { const CAPTION_STYLE = css` font-size: ${TYPOGRAPHY.fontSizeCaption}; &.error { - color: ${COLORS.errorEnabled}; + color: ${LEGACY_COLORS.errorEnabled}; font-weight: ${TYPOGRAPHY.fontWeightSemiBold}; } ` diff --git a/app/src/atoms/Skeleton/index.tsx b/app/src/atoms/Skeleton/index.tsx index 2513d21e1a0..5cddcfdf6e9 100644 --- a/app/src/atoms/Skeleton/index.tsx +++ b/app/src/atoms/Skeleton/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { BORDERS, Box, COLORS } from '@opentrons/components' +import { BORDERS, Box, LEGACY_COLORS } from '@opentrons/components' interface SkeletonProps { width: string @@ -16,9 +16,9 @@ export const Skeleton = (props: SkeletonProps): JSX.Element => { animation: shimmer 2s infinite linear; background: linear-gradient( to right, - ${COLORS.medGreyEnabled} 1%, + ${LEGACY_COLORS.medGreyEnabled} 1%, #e3e3e366 25%, - ${COLORS.medGreyEnabled} 40% + ${LEGACY_COLORS.medGreyEnabled} 40% ); background-size: ${backgroundSize}; width: ${width}; diff --git a/app/src/atoms/SleepScreen/__tests__/SleepScreen.test.tsx b/app/src/atoms/SleepScreen/__tests__/SleepScreen.test.tsx index 08ceb7a2c1c..12f89712f92 100644 --- a/app/src/atoms/SleepScreen/__tests__/SleepScreen.test.tsx +++ b/app/src/atoms/SleepScreen/__tests__/SleepScreen.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { SleepScreen } from '..' @@ -14,6 +14,6 @@ describe('SleepScreen', () => { const touchScreen = getByTestId('Touchscreen_SleepScreen') expect(touchScreen).toHaveStyle('width: 100vw') expect(touchScreen).toHaveStyle('height: 100vh') - expect(touchScreen).toHaveStyle(`background-color: ${COLORS.black}`) + expect(touchScreen).toHaveStyle(`background-color: ${LEGACY_COLORS.black}`) }) }) diff --git a/app/src/atoms/SleepScreen/index.tsx b/app/src/atoms/SleepScreen/index.tsx index c1e4ba0a96c..1cd3d49967f 100644 --- a/app/src/atoms/SleepScreen/index.tsx +++ b/app/src/atoms/SleepScreen/index.tsx @@ -1,13 +1,13 @@ import * as React from 'react' -import { Flex, COLORS } from '@opentrons/components' +import { Flex, LEGACY_COLORS } from '@opentrons/components' export function SleepScreen(): JSX.Element { return ( ) diff --git a/app/src/atoms/Slideout/Slideout.stories.tsx b/app/src/atoms/Slideout/Slideout.stories.tsx index 5d0823c2577..4dea0f8d985 100644 --- a/app/src/atoms/Slideout/Slideout.stories.tsx +++ b/app/src/atoms/Slideout/Slideout.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { TYPOGRAPHY, PrimaryBtn, COLORS, SPACING } from '@opentrons/components' +import { TYPOGRAPHY, PrimaryBtn, LEGACY_COLORS, SPACING } from '@opentrons/components' import { Slideout } from './index' import { StyledText } from '../text' @@ -26,7 +26,7 @@ const Children = ( diff --git a/app/src/atoms/Slideout/index.tsx b/app/src/atoms/Slideout/index.tsx index 2db12659541..ceb8a50dd43 100644 --- a/app/src/atoms/Slideout/index.tsx +++ b/app/src/atoms/Slideout/index.tsx @@ -10,7 +10,7 @@ import { SPACING, JUSTIFY_SPACE_BETWEEN, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, Overlay, POSITION_FIXED, TYPOGRAPHY, @@ -99,10 +99,10 @@ const CLOSE_ICON_STYLE = css` border-radius: 50%; &:hover { - background: ${COLORS.lightGreyHover}; + background: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background: ${COLORS.lightGreyPressed}; + background: ${LEGACY_COLORS.lightGreyPressed}; } ` @@ -145,7 +145,7 @@ export const Slideout = (props: SlideoutProps): JSX.Element => { css={` ${isExpanded ?? false ? OVERLAY_IN_STYLE : overlayOutStyle} `} - backgroundColor={COLORS.darkBlackEnabled} + backgroundColor={LEGACY_COLORS.darkBlackEnabled} /> { position={POSITION_FIXED} right="0" top="0" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} boxShadow="0px 3px 6px rgba(0, 0, 0, 0.23)" height="100%" > @@ -195,7 +195,7 @@ export const Slideout = (props: SlideoutProps): JSX.Element => { ) : ( <>{title} )} - + > = args => ( export const Active = Template.bind({}) Active.args = { status: 'Heating', - backgroundColor: COLORS.medBlue, - iconColor: COLORS.blueEnabled, + backgroundColor: LEGACY_COLORS.medBlue, + iconColor: LEGACY_COLORS.blueEnabled, pulse: true, } export const Holding = Template.bind({}) Holding.args = { status: 'Holding at target', - backgroundColor: COLORS.medBlue, - iconColor: COLORS.blueEnabled, + backgroundColor: LEGACY_COLORS.medBlue, + iconColor: LEGACY_COLORS.blueEnabled, pulse: false, } export const Idle = Template.bind({}) Idle.args = { status: 'Idle', - backgroundColor: COLORS.medGreyEnabled, - iconColor: COLORS.darkGreyEnabled, + backgroundColor: LEGACY_COLORS.medGreyEnabled, + iconColor: LEGACY_COLORS.darkGreyEnabled, pulse: true, } export const Error = Template.bind({}) Error.args = { status: 'Error', - backgroundColor: COLORS.warningBackgroundLight, - iconColor: COLORS.warningEnabled, + backgroundColor: LEGACY_COLORS.warningBackgroundLight, + iconColor: LEGACY_COLORS.warningEnabled, pulse: true, } diff --git a/app/src/atoms/StatusLabel/__tests__/StatusLabel.test.tsx b/app/src/atoms/StatusLabel/__tests__/StatusLabel.test.tsx index f9752e876b0..cb194ac3305 100644 --- a/app/src/atoms/StatusLabel/__tests__/StatusLabel.test.tsx +++ b/app/src/atoms/StatusLabel/__tests__/StatusLabel.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { C_SKY_BLUE, COLORS, renderWithProviders } from '@opentrons/components' +import { C_SKY_BLUE, LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { StatusLabel } from '..' const render = (props: React.ComponentProps) => { @@ -13,7 +13,7 @@ describe('StatusLabel', () => { props = { status: 'Engaged', backgroundColor: C_SKY_BLUE, - iconColor: COLORS.blueEnabled, + iconColor: LEGACY_COLORS.blueEnabled, id: 'engaged_status', showIcon: true, } @@ -26,7 +26,7 @@ describe('StatusLabel', () => { props = { status: 'Disengaged', backgroundColor: C_SKY_BLUE, - iconColor: COLORS.blueEnabled, + iconColor: LEGACY_COLORS.blueEnabled, } const { getByText } = render(props) expect(getByText('Disengaged')).toHaveStyle('backgroundColor: C_SKY_BLUE') @@ -35,9 +35,9 @@ describe('StatusLabel', () => { it('renders an idle status label with a gray background and text', () => { props = { status: 'Idle', - backgroundColor: COLORS.medGreyEnabled, - iconColor: COLORS.darkGrey, - textColor: COLORS.darkBlackEnabled, + backgroundColor: LEGACY_COLORS.medGreyEnabled, + iconColor: LEGACY_COLORS.darkGrey, + textColor: LEGACY_COLORS.darkBlackEnabled, showIcon: false, } const { getByText } = render(props) @@ -49,7 +49,7 @@ describe('StatusLabel', () => { props = { status: 'holding at target', backgroundColor: C_SKY_BLUE, - iconColor: COLORS.blueEnabled, + iconColor: LEGACY_COLORS.blueEnabled, } const { getByText } = render(props) expect(getByText('Holding at target')).toHaveStyle( @@ -61,7 +61,7 @@ describe('StatusLabel', () => { props = { status: 'cooling', backgroundColor: C_SKY_BLUE, - iconColor: COLORS.blueEnabled, + iconColor: LEGACY_COLORS.blueEnabled, } const { getByText } = render(props) expect(getByText('Cooling')).toHaveStyle('backgroundColor: C_SKY_BLUE') @@ -71,7 +71,7 @@ describe('StatusLabel', () => { props = { status: 'heating', backgroundColor: C_SKY_BLUE, - iconColor: COLORS.blueEnabled, + iconColor: LEGACY_COLORS.blueEnabled, } const { getByText } = render(props) expect(getByText('Heating')).toHaveStyle('backgroundColor: C_SKY_BLUE') @@ -81,7 +81,7 @@ describe('StatusLabel', () => { props = { status: 'Engaged', backgroundColor: C_SKY_BLUE, - iconColor: COLORS.blueEnabled, + iconColor: LEGACY_COLORS.blueEnabled, pulse: true, } const { getByTestId } = render(props) diff --git a/app/src/atoms/StatusLabel/index.tsx b/app/src/atoms/StatusLabel/index.tsx index e35cbcaac4c..6baa9ce37bd 100644 --- a/app/src/atoms/StatusLabel/index.tsx +++ b/app/src/atoms/StatusLabel/index.tsx @@ -6,7 +6,7 @@ import { Icon, ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, } from '@opentrons/components' @@ -74,7 +74,7 @@ export const StatusLabel = (props: StatusLabelProps): JSX.Element | null => { {capitalize(status)} diff --git a/app/src/atoms/StepMeter/index.tsx b/app/src/atoms/StepMeter/index.tsx index 0d9774bd363..6aa04c85a9b 100644 --- a/app/src/atoms/StepMeter/index.tsx +++ b/app/src/atoms/StepMeter/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { css } from 'styled-components' import { Box, - COLORS, + LEGACY_COLORS, SPACING, POSITION_RELATIVE, POSITION_ABSOLUTE, @@ -27,7 +27,7 @@ export const StepMeter = (props: StepMeterProps): JSX.Element => { const StepMeterContainer = css` position: ${POSITION_RELATIVE}; height: ${SPACING.spacing4}; - background-color: ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.medGreyEnabled}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { height: ${SPACING.spacing12}; } @@ -44,7 +44,7 @@ export const StepMeter = (props: StepMeterProps): JSX.Element => { position: ${POSITION_ABSOLUTE}; top: 0; height: 100%; - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; width: ${percentComplete}%; transform: translateX(0); transition: ${prevPercentComplete.current <= percentComplete diff --git a/app/src/atoms/Toast/index.tsx b/app/src/atoms/Toast/index.tsx index 7787f1cfe1d..fc39a3147fd 100644 --- a/app/src/atoms/Toast/index.tsx +++ b/app/src/atoms/Toast/index.tsx @@ -14,7 +14,7 @@ import { Link, ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, JUSTIFY_SPACE_BETWEEN, @@ -189,7 +189,7 @@ export function Toast(props: ToastProps): JSX.Element { const ODD_ANIMATION_NONE = css`` const TEXT_STYLE = css` - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; font-size: ${showODDStyle ? TYPOGRAPHY.fontSize22 : TYPOGRAPHY.fontSizeP}; font-weight: ${showODDStyle ? TYPOGRAPHY.fontWeightSemiBold @@ -227,30 +227,30 @@ export function Toast(props: ToastProps): JSX.Element { } = { [ERROR_TOAST]: { iconName: 'ot-alert', - color: `${showODDStyle ? COLORS.red2 : COLORS.errorEnabled}`, + color: `${showODDStyle ? LEGACY_COLORS.red2 : LEGACY_COLORS.errorEnabled}`, backgroundColor: `${ - showODDStyle ? COLORS.red4 : COLORS.errorBackgroundLight + showODDStyle ? LEGACY_COLORS.red4 : LEGACY_COLORS.errorBackgroundLight }`, }, [INFO_TOAST]: { iconName: 'information', - color: `${showODDStyle ? COLORS.grey2 : COLORS.darkGreyEnabled}`, + color: `${showODDStyle ? LEGACY_COLORS.grey2 : LEGACY_COLORS.darkGreyEnabled}`, backgroundColor: `${ - showODDStyle ? COLORS.grey4 : COLORS.darkGreyDisabled + showODDStyle ? LEGACY_COLORS.grey4 : LEGACY_COLORS.darkGreyDisabled }`, }, [SUCCESS_TOAST]: { iconName: 'ot-check', - color: `${showODDStyle ? COLORS.green2 : COLORS.successEnabled}`, + color: `${showODDStyle ? LEGACY_COLORS.green2 : LEGACY_COLORS.successEnabled}`, backgroundColor: `${ - showODDStyle ? COLORS.green4 : COLORS.successBackgroundLight + showODDStyle ? LEGACY_COLORS.green4 : LEGACY_COLORS.successBackgroundLight }`, }, [WARNING_TOAST]: { iconName: 'ot-alert', - color: `${showODDStyle ? COLORS.yellow2 : COLORS.warningEnabled}`, + color: `${showODDStyle ? LEGACY_COLORS.yellow2 : LEGACY_COLORS.warningEnabled}`, backgroundColor: `${ - showODDStyle ? COLORS.yellow4 : COLORS.warningBackgroundLight + showODDStyle ? LEGACY_COLORS.yellow4 : LEGACY_COLORS.warningBackgroundLight }`, }, } @@ -358,7 +358,7 @@ export function Toast(props: ToastProps): JSX.Element { > {headingText.length > 0 ? ( onCloseHandler()}> diff --git a/app/src/atoms/Tooltip/__tests__/Tooltip.test.tsx b/app/src/atoms/Tooltip/__tests__/Tooltip.test.tsx index 889e969ec82..2b7b01e3955 100644 --- a/app/src/atoms/Tooltip/__tests__/Tooltip.test.tsx +++ b/app/src/atoms/Tooltip/__tests__/Tooltip.test.tsx @@ -3,7 +3,7 @@ import { renderWithProviders, TOOLTIP_TOP, SPACING, - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, } from '@opentrons/components' import { Tooltip } from '..' @@ -57,9 +57,9 @@ describe('Tooltip', () => { expect(tooltip).toHaveStyle('position: absolute') expect(tooltip).toHaveStyle('left: 0.25rem') expect(tooltip).toHaveStyle( - `background: ${String(COLORS.darkBlackEnabled)}` + `background: ${String(LEGACY_COLORS.darkBlackEnabled)}` ) - expect(tooltip).toHaveStyle(`color: ${String(COLORS.white)}`) + expect(tooltip).toHaveStyle(`color: ${String(LEGACY_COLORS.white)}`) expect(tooltip).toHaveStyle('width: 8.75rem') expect(tooltip).toHaveStyle('font-size: 0.625rem') expect(tooltip).toHaveAttribute('role', 'tooltip') diff --git a/app/src/atoms/Tooltip/index.tsx b/app/src/atoms/Tooltip/index.tsx index 7de7c1a6da7..cb68af40446 100644 --- a/app/src/atoms/Tooltip/index.tsx +++ b/app/src/atoms/Tooltip/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { - COLORS, + LEGACY_COLORS, TYPOGRAPHY, Tooltip as SharedTooltip, } from '@opentrons/components' @@ -21,7 +21,7 @@ export function Tooltip(props: TooltipProps): JSX.Element { return ( = { secondary: { - defaultColor: COLORS.darkBlackEnabled, - defaultBackgroundColor: COLORS.mediumBlueEnabled, - activeBackgroundColor: COLORS.mediumBluePressed, - iconColor: COLORS.blueEnabled, + defaultColor: LEGACY_COLORS.darkBlackEnabled, + defaultBackgroundColor: LEGACY_COLORS.mediumBlueEnabled, + activeBackgroundColor: LEGACY_COLORS.mediumBluePressed, + iconColor: LEGACY_COLORS.blueEnabled, }, alert: { - defaultColor: COLORS.red1, - defaultBackgroundColor: COLORS.red3, - activeBackgroundColor: COLORS.red3Pressed, - iconColor: COLORS.red1, + defaultColor: LEGACY_COLORS.red1, + defaultBackgroundColor: LEGACY_COLORS.red3, + activeBackgroundColor: LEGACY_COLORS.red3Pressed, + iconColor: LEGACY_COLORS.red1, }, primary: { - defaultColor: COLORS.white, - defaultBackgroundColor: COLORS.blueEnabled, - activeBackgroundColor: COLORS.bluePressed, - iconColor: COLORS.white, + defaultColor: LEGACY_COLORS.white, + defaultBackgroundColor: LEGACY_COLORS.blueEnabled, + activeBackgroundColor: LEGACY_COLORS.bluePressed, + iconColor: LEGACY_COLORS.white, }, } @@ -97,8 +97,8 @@ export function LargeButton(props: LargeButtonProps): JSX.Element { } &:disabled { - background-color: ${COLORS.darkBlack20}; - color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.darkBlack20}; + color: ${LEGACY_COLORS.darkBlack60}; } ` return ( @@ -122,7 +122,7 @@ export function LargeButton(props: LargeButtonProps): JSX.Element { aria-label={`${iconName} icon`} color={ disabled - ? COLORS.darkBlack60 + ? LEGACY_COLORS.darkBlack60 : LARGE_BUTTON_PROPS_BY_TYPE[buttonType].iconColor } size="5rem" diff --git a/app/src/atoms/buttons/MediumButton.tsx b/app/src/atoms/buttons/MediumButton.tsx index f29f17df636..1b63b000319 100644 --- a/app/src/atoms/buttons/MediumButton.tsx +++ b/app/src/atoms/buttons/MediumButton.tsx @@ -4,7 +4,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, Icon, SPACING, @@ -58,48 +58,48 @@ export function MediumButton(props: MediumButtonProps): JSX.Element { alert: { // TODO(ew, 3/22/23): replaces these hex codes with the color constants activeBackgroundColor: '#b91f20', - defaultBackgroundColor: COLORS.red2, - defaultColor: COLORS.white, - disabledBackgroundColor: COLORS.darkBlack20, - iconColor: COLORS.white, + defaultBackgroundColor: LEGACY_COLORS.red2, + defaultColor: LEGACY_COLORS.white, + disabledBackgroundColor: LEGACY_COLORS.darkBlack20, + iconColor: LEGACY_COLORS.white, }, alertSecondary: { // TODO(ew, 3/22/23): replaces these hex codes with the color constants activeBackgroundColor: '#ccabac', - defaultBackgroundColor: COLORS.red3, - defaultColor: COLORS.red1, - disabledBackgroundColor: COLORS.darkBlack20, - iconColor: COLORS.red1, + defaultBackgroundColor: LEGACY_COLORS.red3, + defaultColor: LEGACY_COLORS.red1, + disabledBackgroundColor: LEGACY_COLORS.darkBlack20, + iconColor: LEGACY_COLORS.red1, }, primary: { // TODO(ew, 3/22/23): replaces these hex codes with the color constants activeBackgroundColor: '#045dd0', - defaultBackgroundColor: COLORS.blueEnabled, - defaultColor: COLORS.white, - disabledBackgroundColor: COLORS.darkBlack20, - iconColor: COLORS.white, + defaultBackgroundColor: LEGACY_COLORS.blueEnabled, + defaultColor: LEGACY_COLORS.white, + disabledBackgroundColor: LEGACY_COLORS.darkBlack20, + iconColor: LEGACY_COLORS.white, }, secondary: { // TODO(ew, 3/22/23): replaces these hex codes with the color constants activeBackgroundColor: '#94afd4', - defaultBackgroundColor: COLORS.mediumBlueEnabled, - defaultColor: COLORS.darkBlackEnabled, - disabledBackgroundColor: COLORS.darkBlack20, - iconColor: COLORS.blueEnabled, + defaultBackgroundColor: LEGACY_COLORS.mediumBlueEnabled, + defaultColor: LEGACY_COLORS.darkBlackEnabled, + disabledBackgroundColor: LEGACY_COLORS.darkBlack20, + iconColor: LEGACY_COLORS.blueEnabled, }, tertiaryHigh: { - activeBackgroundColor: COLORS.darkBlack20, - defaultBackgroundColor: COLORS.white, - defaultColor: COLORS.darkBlack100, - disabledBackgroundColor: COLORS.transparent, - iconColor: COLORS.darkBlack100, + activeBackgroundColor: LEGACY_COLORS.darkBlack20, + defaultBackgroundColor: LEGACY_COLORS.white, + defaultColor: LEGACY_COLORS.darkBlack100, + disabledBackgroundColor: LEGACY_COLORS.transparent, + iconColor: LEGACY_COLORS.darkBlack100, }, tertiaryLowLight: { - activeBackgroundColor: COLORS.darkBlack20, - defaultBackgroundColor: COLORS.white, - defaultColor: COLORS.darkBlack70, - disabledBackgroundColor: COLORS.transparent, - iconColor: COLORS.darkBlack70, + activeBackgroundColor: LEGACY_COLORS.darkBlack20, + defaultBackgroundColor: LEGACY_COLORS.white, + defaultColor: LEGACY_COLORS.darkBlack70, + disabledBackgroundColor: LEGACY_COLORS.transparent, + iconColor: LEGACY_COLORS.darkBlack70, }, } @@ -137,7 +137,7 @@ export function MediumButton(props: MediumButtonProps): JSX.Element { &:disabled { background-color: ${MEDIUM_BUTTON_PROPS_BY_TYPE[buttonType] .disabledBackgroundColor}; - color: ${COLORS.darkBlack60}; + color: ${LEGACY_COLORS.darkBlack60}; } ` return ( @@ -162,7 +162,7 @@ export function MediumButton(props: MediumButtonProps): JSX.Element { aria-label={`${iconName ?? 'play'} icon`} color={ disabled - ? COLORS.darkBlack60 + ? LEGACY_COLORS.darkBlack60 : MEDIUM_BUTTON_PROPS_BY_TYPE[buttonType].iconColor } size={SPACING.spacing40} diff --git a/app/src/atoms/buttons/QuaternaryButton.tsx b/app/src/atoms/buttons/QuaternaryButton.tsx index a5ebdd1bc80..9c9dd640c9c 100644 --- a/app/src/atoms/buttons/QuaternaryButton.tsx +++ b/app/src/atoms/buttons/QuaternaryButton.tsx @@ -2,17 +2,17 @@ import styled from 'styled-components' import { NewSecondaryBtn, SPACING, - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, styleProps, } from '@opentrons/components' export const QuaternaryButton = styled(NewSecondaryBtn)` - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; border-radius: ${BORDERS.radiusRoundEdge}; box-shadow: none; - color: ${COLORS.blueEnabled}; + color: ${LEGACY_COLORS.blueEnabled}; overflow: no-wrap; padding-left: ${SPACING.spacing16}; padding-right: ${SPACING.spacing16}; @@ -27,7 +27,7 @@ export const QuaternaryButton = styled(NewSecondaryBtn)` box-shadow: 0 0 0; } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.warningEnabled}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.warningEnabled}; } &:disabled { diff --git a/app/src/atoms/buttons/RadioButton.tsx b/app/src/atoms/buttons/RadioButton.tsx index b2751dd7fa1..8d11a2d9a53 100644 --- a/app/src/atoms/buttons/RadioButton.tsx +++ b/app/src/atoms/buttons/RadioButton.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import styled, { css } from 'styled-components' import { TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, BORDERS, Flex, @@ -40,25 +40,25 @@ export function RadioButton(props: RadioButtonProps): JSX.Element { ` const AVAILABLE_BUTTON_STYLE = css` - background: ${COLORS.mediumBlueEnabled}; + background: ${LEGACY_COLORS.mediumBlueEnabled}; &:active { - background-color: ${COLORS.mediumBluePressed}; + background-color: ${LEGACY_COLORS.mediumBluePressed}; } ` const SELECTED_BUTTON_STYLE = css` - background: ${COLORS.blueEnabled}; - color: ${COLORS.white}; + background: ${LEGACY_COLORS.blueEnabled}; + color: ${LEGACY_COLORS.white}; &:active { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } ` const DISABLED_BUTTON_STYLE = css` - background-color: ${COLORS.darkBlack20}; - color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.darkBlack20}; + color: ${LEGACY_COLORS.darkBlack60}; cursor: not-allowed; ` diff --git a/app/src/atoms/buttons/SmallButton.tsx b/app/src/atoms/buttons/SmallButton.tsx index c40ff4df4bd..d7ee562187b 100644 --- a/app/src/atoms/buttons/SmallButton.tsx +++ b/app/src/atoms/buttons/SmallButton.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { css } from 'styled-components' import { TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, BORDERS, Btn, @@ -58,39 +58,39 @@ export function SmallButton(props: SmallButtonProps): JSX.Element { } > = { secondary: { - defaultColor: COLORS.darkBlackEnabled, - defaultBackgroundColor: COLORS.mediumBlueEnabled, - activeBackgroundColor: COLORS.mediumBluePressed, - disabledBackgroundColor: `${COLORS.darkBlack20}`, - disabledColor: `${COLORS.darkBlack60}`, + defaultColor: LEGACY_COLORS.darkBlackEnabled, + defaultBackgroundColor: LEGACY_COLORS.mediumBlueEnabled, + activeBackgroundColor: LEGACY_COLORS.mediumBluePressed, + disabledBackgroundColor: `${LEGACY_COLORS.darkBlack20}`, + disabledColor: `${LEGACY_COLORS.darkBlack60}`, }, alert: { - defaultColor: COLORS.white, - defaultBackgroundColor: COLORS.red2, - activeBackgroundColor: COLORS.red2Pressed, - disabledBackgroundColor: `${COLORS.darkBlack20}`, - disabledColor: `${COLORS.darkBlack60}`, + defaultColor: LEGACY_COLORS.white, + defaultBackgroundColor: LEGACY_COLORS.red2, + activeBackgroundColor: LEGACY_COLORS.red2Pressed, + disabledBackgroundColor: `${LEGACY_COLORS.darkBlack20}`, + disabledColor: `${LEGACY_COLORS.darkBlack60}`, }, primary: { - defaultColor: COLORS.white, - defaultBackgroundColor: COLORS.blueEnabled, - activeBackgroundColor: COLORS.bluePressed, - disabledBackgroundColor: `${COLORS.darkBlack20}`, - disabledColor: `${COLORS.darkBlack60}`, + defaultColor: LEGACY_COLORS.white, + defaultBackgroundColor: LEGACY_COLORS.blueEnabled, + activeBackgroundColor: LEGACY_COLORS.bluePressed, + disabledBackgroundColor: `${LEGACY_COLORS.darkBlack20}`, + disabledColor: `${LEGACY_COLORS.darkBlack60}`, }, tertiaryHighLight: { - defaultColor: COLORS.darkBlackEnabled, - defaultBackgroundColor: `${COLORS.blueEnabled}${COLORS.opacity0HexCode}`, - activeBackgroundColor: `${COLORS.darkBlack20}`, - disabledBackgroundColor: `${COLORS.blueEnabled}${COLORS.opacity0HexCode}`, - disabledColor: `${COLORS.darkBlack60}`, + defaultColor: LEGACY_COLORS.darkBlackEnabled, + defaultBackgroundColor: `${LEGACY_COLORS.blueEnabled}${LEGACY_COLORS.opacity0HexCode}`, + activeBackgroundColor: `${LEGACY_COLORS.darkBlack20}`, + disabledBackgroundColor: `${LEGACY_COLORS.blueEnabled}${LEGACY_COLORS.opacity0HexCode}`, + disabledColor: `${LEGACY_COLORS.darkBlack60}`, }, tertiaryLowLight: { - defaultColor: `${COLORS.darkBlack70}`, - defaultBackgroundColor: ` ${COLORS.blueEnabled}${COLORS.opacity0HexCode}`, - activeBackgroundColor: `${COLORS.darkBlack20}`, - disabledBackgroundColor: `${COLORS.blueEnabled}${COLORS.opacity0HexCode}`, - disabledColor: `${COLORS.darkBlack60}`, + defaultColor: `${LEGACY_COLORS.darkBlack70}`, + defaultBackgroundColor: ` ${LEGACY_COLORS.blueEnabled}${LEGACY_COLORS.opacity0HexCode}`, + activeBackgroundColor: `${LEGACY_COLORS.darkBlack20}`, + disabledBackgroundColor: `${LEGACY_COLORS.blueEnabled}${LEGACY_COLORS.opacity0HexCode}`, + disabledColor: `${LEGACY_COLORS.darkBlack60}`, }, } diff --git a/app/src/atoms/buttons/SubmitPrimaryButton.tsx b/app/src/atoms/buttons/SubmitPrimaryButton.tsx index 191bad8cd17..b04993c88cd 100644 --- a/app/src/atoms/buttons/SubmitPrimaryButton.tsx +++ b/app/src/atoms/buttons/SubmitPrimaryButton.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { css } from 'styled-components' import { SPACING, - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, styleProps, @@ -18,10 +18,10 @@ export const SubmitPrimaryButton = ( props: SubmitPrimaryButtonProps ): JSX.Element => { const SUBMIT_INPUT_STYLE = css` - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; padding: ${SPACING.spacing8} ${SPACING.spacing16}; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; ${TYPOGRAPHY.pSemiBold} width: 100%; border: none; @@ -29,21 +29,21 @@ export const SubmitPrimaryButton = ( ${styleProps} &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.warningEnabled}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.warningEnabled}; } &:hover { - background-color: ${COLORS.blueHover}; + background-color: ${LEGACY_COLORS.blueHover}; box-shadow: 0 0 0; } &:active { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } &:disabled { - background-color: ${COLORS.darkGreyDisabled}; - color: ${COLORS.successDisabled}; + background-color: ${LEGACY_COLORS.darkGreyDisabled}; + color: ${LEGACY_COLORS.successDisabled}; } ` return diff --git a/app/src/atoms/buttons/TabbedButton.tsx b/app/src/atoms/buttons/TabbedButton.tsx index 6ad4fec5035..a84ee6c7713 100644 --- a/app/src/atoms/buttons/TabbedButton.tsx +++ b/app/src/atoms/buttons/TabbedButton.tsx @@ -2,39 +2,39 @@ import styled, { css } from 'styled-components' import { Btn, BORDERS, - COLORS, + LEGACY_COLORS, SPACING, styleProps, TYPOGRAPHY, } from '@opentrons/components' const SELECTED_STYLE = css` - background-color: ${COLORS.highlightPurple1}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.highlightPurple1}; + color: ${LEGACY_COLORS.white}; &:focus, &:hover { - background-color: ${COLORS.highlightPurple1}; + background-color: ${LEGACY_COLORS.highlightPurple1}; box-shadow: none; } &:active { - background-color: ${COLORS.highlightPurple1Pressed}; + background-color: ${LEGACY_COLORS.highlightPurple1Pressed}; } ` const UNSELECTED_STYLE = css` - background-color: ${COLORS.highlightPurple2}; - color: ${COLORS.darkBlack100}; + background-color: ${LEGACY_COLORS.highlightPurple2}; + color: ${LEGACY_COLORS.darkBlack100}; &:focus, &:hover { - background-color: ${COLORS.highlightPurple2}; + background-color: ${LEGACY_COLORS.highlightPurple2}; box-shadow: none; } &:active { - background-color: ${COLORS.highlightPurple2Pressed}; + background-color: ${LEGACY_COLORS.highlightPurple2Pressed}; } ` @@ -58,11 +58,11 @@ export const TabbedButton = styled(Btn)` ${styleProps} &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; } &:disabled { - background-color: ${COLORS.darkBlack20}; - color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.darkBlack20}; + color: ${LEGACY_COLORS.darkBlack60}; } `} ` diff --git a/app/src/atoms/buttons/TertiaryButton.tsx b/app/src/atoms/buttons/TertiaryButton.tsx index 04704261b77..a78b3ff23d3 100644 --- a/app/src/atoms/buttons/TertiaryButton.tsx +++ b/app/src/atoms/buttons/TertiaryButton.tsx @@ -2,17 +2,17 @@ import styled from 'styled-components' import { NewPrimaryBtn, SPACING, - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, styleProps, } from '@opentrons/components' export const TertiaryButton = styled(NewPrimaryBtn)` - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; border-radius: ${BORDERS.radiusRoundEdge}; box-shadow: none; - color: ${COLORS.fundamentalsBackground}; + color: ${LEGACY_COLORS.fundamentalsBackground}; overflow: no-wrap; padding-left: ${SPACING.spacing16}; padding-right: ${SPACING.spacing16}; @@ -23,20 +23,20 @@ export const TertiaryButton = styled(NewPrimaryBtn)` ${styleProps} &:hover { - background-color: ${COLORS.blueHover}; + background-color: ${LEGACY_COLORS.blueHover}; box-shadow: none; } &:active { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; } &:disabled { - background-color: ${COLORS.darkGreyDisabled}; - color: ${COLORS.errorDisabled}; + background-color: ${LEGACY_COLORS.darkGreyDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; } ` diff --git a/app/src/atoms/buttons/ToggleButton.tsx b/app/src/atoms/buttons/ToggleButton.tsx index c72346bb001..e02855240b7 100644 --- a/app/src/atoms/buttons/ToggleButton.tsx +++ b/app/src/atoms/buttons/ToggleButton.tsx @@ -1,39 +1,39 @@ import * as React from 'react' import { css } from 'styled-components' -import { Btn, Icon, COLORS, SIZE_1, SIZE_2 } from '@opentrons/components' +import { Btn, Icon, LEGACY_COLORS, SIZE_1, SIZE_2 } from '@opentrons/components' import type { StyleProps } from '@opentrons/components' const TOGGLE_DISABLED_STYLES = css` - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { - color: ${COLORS.darkGreyHover}; + color: ${LEGACY_COLORS.darkGreyHover}; } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.warningEnabled}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.warningEnabled}; } &:disabled { - color: ${COLORS.darkGreyDisabled}; + color: ${LEGACY_COLORS.darkGreyDisabled}; } ` const TOGGLE_ENABLED_STYLES = css` - color: ${COLORS.blueEnabled}; + color: ${LEGACY_COLORS.blueEnabled}; &:hover { - color: ${COLORS.blueHover}; + color: ${LEGACY_COLORS.blueHover}; } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.warningEnabled}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.warningEnabled}; } &:disabled { - color: ${COLORS.darkGreyDisabled}; + color: ${LEGACY_COLORS.darkGreyDisabled}; } ` diff --git a/app/src/atoms/buttons/__tests__/FloatingActionButton.test.tsx b/app/src/atoms/buttons/__tests__/FloatingActionButton.test.tsx index 55e04d8bfea..7e2f01ddbbd 100644 --- a/app/src/atoms/buttons/__tests__/FloatingActionButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/FloatingActionButton.test.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { renderWithProviders, BORDERS, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, } from '@opentrons/components' @@ -33,7 +33,7 @@ describe('FloatingActionButton', () => { expect(button).toHaveStyle( `padding: ${SPACING.spacing12} ${SPACING.spacing24}` ) - expect(button).toHaveStyle(`background-color: ${COLORS.highlightPurple1}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.highlightPurple1}`) expect(button).toHaveStyle(`font-size: ${TYPOGRAPHY.fontSize28}`) expect(button).toHaveStyle(`font-weight: ${TYPOGRAPHY.fontWeightSemiBold}`) expect(button).toHaveStyle(`line-height: ${TYPOGRAPHY.lineHeight36}`) @@ -42,7 +42,7 @@ describe('FloatingActionButton', () => { `text-transform: ${TYPOGRAPHY.textTransformNone}` ) expect(button).toHaveStyle(`box-shadow: ${BORDERS.shadowBig}`) - expect(button).toHaveStyle(`color: ${COLORS.white}`) + expect(button).toHaveStyle(`color: ${LEGACY_COLORS.white}`) }) it('renders unselected floating action button with text and disabled', () => { @@ -59,7 +59,7 @@ describe('FloatingActionButton', () => { const button = getByRole('button') expect(button).toHaveStyleRule( 'background-color', - `${COLORS.highlightPurple1Pressed}`, + `${LEGACY_COLORS.highlightPurple1Pressed}`, { modifier: ':active', } @@ -71,7 +71,7 @@ describe('FloatingActionButton', () => { const button = getByRole('button') expect(button).toHaveStyleRule( 'border-color', - `${COLORS.fundamentalsFocus}`, + `${LEGACY_COLORS.fundamentalsFocus}`, { modifier: ':focus-visible', } diff --git a/app/src/atoms/buttons/__tests__/LargeButton.test.tsx b/app/src/atoms/buttons/__tests__/LargeButton.test.tsx index 058a12886c8..ae9dc23d620 100644 --- a/app/src/atoms/buttons/__tests__/LargeButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/LargeButton.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { fireEvent, screen } from '@testing-library/react' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { LargeButton } from '../LargeButton' @@ -22,7 +22,7 @@ describe('LargeButton', () => { fireEvent.click(screen.getByText('large button')) expect(props.onClick).toHaveBeenCalled() expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.blueEnabled}` + `background-color: ${LEGACY_COLORS.blueEnabled}` ) }) it('renders the alert button', () => { @@ -32,7 +32,7 @@ describe('LargeButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.red3}` + `background-color: ${LEGACY_COLORS.red3}` ) }) it('renders the secondary button', () => { @@ -42,7 +42,7 @@ describe('LargeButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.mediumBlueEnabled}` + `background-color: ${LEGACY_COLORS.mediumBlueEnabled}` ) }) it('renders the button as disabled', () => { diff --git a/app/src/atoms/buttons/__tests__/MediumButton.test.tsx b/app/src/atoms/buttons/__tests__/MediumButton.test.tsx index af83fdbb4f5..9bcbfbe5353 100644 --- a/app/src/atoms/buttons/__tests__/MediumButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/MediumButton.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { fireEvent, screen } from '@testing-library/react' -import { renderWithProviders, COLORS, BORDERS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, BORDERS } from '@opentrons/components' import { MediumButton } from '../MediumButton' @@ -22,7 +22,7 @@ describe('MediumButton', () => { fireEvent.click(screen.getByText('Medium button')) expect(props.onClick).toHaveBeenCalled() expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.blueEnabled}` + `background-color: ${LEGACY_COLORS.blueEnabled}` ) }) it('renders the alert button', () => { @@ -32,7 +32,7 @@ describe('MediumButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.red2}` + `background-color: ${LEGACY_COLORS.red2}` ) }) it('renders the secondary button', () => { @@ -42,7 +42,7 @@ describe('MediumButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.mediumBlueEnabled}` + `background-color: ${LEGACY_COLORS.mediumBlueEnabled}` ) }) it('renders the secondary alert button', () => { @@ -52,7 +52,7 @@ describe('MediumButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.red3}` + `background-color: ${LEGACY_COLORS.red3}` ) }) it('renders the tertiary high button', () => { @@ -62,7 +62,7 @@ describe('MediumButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.white}` + `background-color: ${LEGACY_COLORS.white}` ) }) it('renders the tertiary low light button', () => { @@ -72,7 +72,7 @@ describe('MediumButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.white}` + `background-color: ${LEGACY_COLORS.white}` ) }) it('renders the button as disabled', () => { diff --git a/app/src/atoms/buttons/__tests__/QuaternaryButton.test.tsx b/app/src/atoms/buttons/__tests__/QuaternaryButton.test.tsx index 91a93db092a..1238dd4d11a 100644 --- a/app/src/atoms/buttons/__tests__/QuaternaryButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/QuaternaryButton.test.tsx @@ -2,7 +2,7 @@ import 'jest-styled-components' import * as React from 'react' import { renderWithProviders, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, BORDERS, @@ -26,12 +26,12 @@ describe('QuaternaryButton', () => { it('renders secondary tertiary button with text', () => { const { getByText } = render(props) const button = getByText('secondary tertiary button') - expect(button).toHaveStyle(`background-color: ${String(COLORS.white)}`) + expect(button).toHaveStyle(`background-color: ${String(LEGACY_COLORS.white)}`) expect(button).toHaveStyle( `border-radius: ${String(BORDERS.radiusRoundEdge)}` ) expect(button).toHaveStyle('box-shadow: none') - expect(button).toHaveStyle(`color: ${String(COLORS.blueEnabled)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.blueEnabled)}`) expect(button).toHaveStyle( `padding: ${SPACING.spacing8} ${SPACING.spacing16} ${SPACING.spacing8} ${SPACING.spacing16}` ) @@ -72,7 +72,7 @@ describe('QuaternaryButton', () => { const button = getByText('secondary tertiary button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.warningEnabled)}`, + `0 0 0 3px ${String(LEGACY_COLORS.warningEnabled)}`, { modifier: ':focus-visible', } @@ -80,10 +80,10 @@ describe('QuaternaryButton', () => { }) it('renders secondary tertiary button with text and different background color', () => { - props.color = COLORS.errorEnabled + props.color = LEGACY_COLORS.errorEnabled const { getByText } = render(props) const button = getByText('secondary tertiary button') - expect(button).toHaveStyle(`background-color: ${String(COLORS.white)}`) - expect(button).toHaveStyle(`color: ${String(COLORS.errorEnabled)}`) + expect(button).toHaveStyle(`background-color: ${String(LEGACY_COLORS.white)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.errorEnabled)}`) }) }) diff --git a/app/src/atoms/buttons/__tests__/RadioButton.test.tsx b/app/src/atoms/buttons/__tests__/RadioButton.test.tsx index b03dd301c78..e9dc1d105a9 100644 --- a/app/src/atoms/buttons/__tests__/RadioButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/RadioButton.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { renderWithProviders, COLORS, SPACING } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, SPACING } from '@opentrons/components' import { RadioButton } from '..' @@ -23,7 +23,7 @@ describe('RadioButton', () => { } const { getByRole } = render(props) const label = getByRole('label') - expect(label).toHaveStyle(`background-color: ${COLORS.mediumBlueEnabled}`) + expect(label).toHaveStyle(`background-color: ${LEGACY_COLORS.mediumBlueEnabled}`) expect(label).toHaveStyle(`padding: ${SPACING.spacing24}`) }) it('renders the large selected button', () => { @@ -34,7 +34,7 @@ describe('RadioButton', () => { } const { getByRole } = render(props) const label = getByRole('label') - expect(label).toHaveStyle(`background-color: ${COLORS.blueEnabled}`) + expect(label).toHaveStyle(`background-color: ${LEGACY_COLORS.blueEnabled}`) expect(label).toHaveStyle(`padding: ${SPACING.spacing24}`) }) it('renders the small button', () => { @@ -44,7 +44,7 @@ describe('RadioButton', () => { } const { getByRole } = render(props) const label = getByRole('label') - expect(label).toHaveStyle(`background-color: ${COLORS.mediumBlueEnabled}`) + expect(label).toHaveStyle(`background-color: ${LEGACY_COLORS.mediumBlueEnabled}`) expect(label).toHaveStyle(`padding: ${SPACING.spacing20}`) }) it('renders the small selected button', () => { @@ -55,7 +55,7 @@ describe('RadioButton', () => { } const { getByRole } = render(props) const label = getByRole('label') - expect(label).toHaveStyle(`background-color: ${COLORS.blueEnabled}`) + expect(label).toHaveStyle(`background-color: ${LEGACY_COLORS.blueEnabled}`) expect(label).toHaveStyle(`padding: ${SPACING.spacing20}`) }) }) diff --git a/app/src/atoms/buttons/__tests__/SmallButton.test.tsx b/app/src/atoms/buttons/__tests__/SmallButton.test.tsx index 1e0d5fdf9f6..c1735640a5d 100644 --- a/app/src/atoms/buttons/__tests__/SmallButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/SmallButton.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { fireEvent, screen } from '@testing-library/react' -import { renderWithProviders, COLORS, BORDERS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, BORDERS } from '@opentrons/components' import { SmallButton } from '../SmallButton' @@ -22,7 +22,7 @@ describe('SmallButton', () => { fireEvent.click(screen.getByText('small button')) expect(props.onClick).toHaveBeenCalled() expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.blueEnabled}` + `background-color: ${LEGACY_COLORS.blueEnabled}` ) expect(screen.getByRole('button')).toHaveStyle( `border-radius: ${BORDERS.borderRadiusSize4}` @@ -35,7 +35,7 @@ describe('SmallButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.red2}` + `background-color: ${LEGACY_COLORS.red2}` ) }) it('renders the secondary button', () => { @@ -45,7 +45,7 @@ describe('SmallButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `background-color: ${COLORS.mediumBlueEnabled}` + `background-color: ${LEGACY_COLORS.mediumBlueEnabled}` ) }) it('renders the tertiary high light button', () => { @@ -55,7 +55,7 @@ describe('SmallButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `color: ${COLORS.darkBlackEnabled}` + `color: ${LEGACY_COLORS.darkBlackEnabled}` ) }) it('renders the tertiary low light', () => { @@ -65,7 +65,7 @@ describe('SmallButton', () => { } render(props) expect(screen.getByRole('button')).toHaveStyle( - `color: ${COLORS.darkBlackEnabled}${COLORS.opacity70HexCode}` + `color: ${LEGACY_COLORS.darkBlackEnabled}${LEGACY_COLORS.opacity70HexCode}` ) }) it('renders the button as disabled', () => { diff --git a/app/src/atoms/buttons/__tests__/SubmitPrimaryButton.test.tsx b/app/src/atoms/buttons/__tests__/SubmitPrimaryButton.test.tsx index 5ceffe87b28..a84cdc6529a 100644 --- a/app/src/atoms/buttons/__tests__/SubmitPrimaryButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/SubmitPrimaryButton.test.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { fireEvent } from '@testing-library/react' import { renderWithProviders, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, BORDERS, @@ -33,7 +33,7 @@ describe('SubmitPrimaryButton', () => { const { getByText } = render(props) const button = getByText('submit primary button') expect(button).toHaveStyle( - `background-color: ${String(COLORS.blueEnabled)}` + `background-color: ${String(LEGACY_COLORS.blueEnabled)}` ) expect(button).toHaveStyle( `border-radius: ${String(BORDERS.radiusSoftCorners)}` @@ -41,7 +41,7 @@ describe('SubmitPrimaryButton', () => { expect(button).toHaveStyle( `padding: ${SPACING.spacing8} ${SPACING.spacing16}` ) - expect(button).toHaveStyle(`color: ${String(COLORS.white)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.white)}`) expect(button).toHaveStyle(`font-size: ${String(TYPOGRAPHY.fontSizeP)}`) expect(button).toHaveStyle( `font-weight: ${String(TYPOGRAPHY.fontWeightSemiBold)}` @@ -64,9 +64,9 @@ describe('SubmitPrimaryButton', () => { const button = getByText('submit primary button') expect(button).toBeDisabled() expect(button).toHaveStyle( - `background-color: ${String(COLORS.darkGreyDisabled)}` + `background-color: ${String(LEGACY_COLORS.darkGreyDisabled)}` ) - expect(button).toHaveStyle(`color: ${String(COLORS.successDisabled)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.successDisabled)}`) }) it('calls mock function when clicking the button', () => { @@ -81,7 +81,7 @@ describe('SubmitPrimaryButton', () => { const button = getByText('submit primary button') expect(button).toHaveStyleRule( 'background-color', - `${String(COLORS.blueHover)}`, + `${String(LEGACY_COLORS.blueHover)}`, { modifier: ':hover', } @@ -96,7 +96,7 @@ describe('SubmitPrimaryButton', () => { const button = getByText('submit primary button') expect(button).toHaveStyleRule( 'background-color', - `${String(COLORS.bluePressed)}`, + `${String(LEGACY_COLORS.bluePressed)}`, { modifier: ':active', } @@ -108,7 +108,7 @@ describe('SubmitPrimaryButton', () => { const button = getByText('submit primary button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.warningEnabled)}`, + `0 0 0 3px ${String(LEGACY_COLORS.warningEnabled)}`, { modifier: ':focus-visible', } diff --git a/app/src/atoms/buttons/__tests__/TabbedButton.test.tsx b/app/src/atoms/buttons/__tests__/TabbedButton.test.tsx index 74e7b169cbd..1bacaccc983 100644 --- a/app/src/atoms/buttons/__tests__/TabbedButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/TabbedButton.test.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { renderWithProviders, BORDERS, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, } from '@opentrons/components' @@ -27,7 +27,7 @@ describe('Unselected TabbedButton', () => { const { getByText } = render(props) const button = getByText('tabbed button') expect(button).toHaveStyle( - `background-color: ${String(COLORS.highlightPurple2)}` + `background-color: ${String(LEGACY_COLORS.highlightPurple2)}` ) expect(button).toHaveStyle( `padding: ${SPACING.spacing16} ${SPACING.spacing24}` @@ -46,7 +46,7 @@ describe('Unselected TabbedButton', () => { `text-transform: ${String(TYPOGRAPHY.textTransformNone)}` ) expect(button).toHaveStyle(`box-shadow: none`) - expect(button).toHaveStyle(`color: ${String(COLORS.darkBlack100)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.darkBlack100)}`) }) it('renders unselected tabbed button with text and disabled', () => { @@ -63,7 +63,7 @@ describe('Unselected TabbedButton', () => { const button = getByText('tabbed button') expect(button).toHaveStyleRule( 'background-color', - `${String(COLORS.highlightPurple2Pressed)}`, + `${String(LEGACY_COLORS.highlightPurple2Pressed)}`, { modifier: ':active', } @@ -83,7 +83,7 @@ describe('Unselected TabbedButton', () => { const button = getByText('tabbed button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.fundamentalsFocus)}`, + `0 0 0 3px ${String(LEGACY_COLORS.fundamentalsFocus)}`, { modifier: ':focus-visible', } @@ -105,7 +105,7 @@ describe('Selected TabbedButton', () => { const { getByText } = render(props) const button = getByText('tabbed button') expect(button).toHaveStyle( - `background-color: ${String(COLORS.highlightPurple1)}` + `background-color: ${String(LEGACY_COLORS.highlightPurple1)}` ) expect(button).toHaveStyle( `padding: ${SPACING.spacing16} ${SPACING.spacing24}` @@ -124,7 +124,7 @@ describe('Selected TabbedButton', () => { `text-transform: ${String(TYPOGRAPHY.textTransformNone)}` ) expect(button).toHaveStyle(`box-shadow: none`) - expect(button).toHaveStyle(`color: ${String(COLORS.white)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.white)}`) }) it('renders selected tabbed button with text and disabled', () => { @@ -141,7 +141,7 @@ describe('Selected TabbedButton', () => { const button = getByText('tabbed button') expect(button).toHaveStyleRule( 'background-color', - `${String(COLORS.highlightPurple1Pressed)}`, + `${String(LEGACY_COLORS.highlightPurple1Pressed)}`, { modifier: ':active', } @@ -161,7 +161,7 @@ describe('Selected TabbedButton', () => { const button = getByText('tabbed button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.fundamentalsFocus)}`, + `0 0 0 3px ${String(LEGACY_COLORS.fundamentalsFocus)}`, { modifier: ':focus-visible', } diff --git a/app/src/atoms/buttons/__tests__/TertiaryButton.test.tsx b/app/src/atoms/buttons/__tests__/TertiaryButton.test.tsx index d7ac4dd6dc0..eb78014bb11 100644 --- a/app/src/atoms/buttons/__tests__/TertiaryButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/TertiaryButton.test.tsx @@ -2,7 +2,7 @@ import 'jest-styled-components' import * as React from 'react' import { renderWithProviders, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, BORDERS, @@ -26,7 +26,7 @@ describe('TertiaryButton', () => { const { getByText } = render(props) const button = getByText('tertiary button') expect(button).toHaveStyle( - `background-color: ${String(COLORS.blueEnabled)}` + `background-color: ${String(LEGACY_COLORS.blueEnabled)}` ) expect(button).toHaveStyle( `padding: ${SPACING.spacing8} ${SPACING.spacing16} ${SPACING.spacing8} ${SPACING.spacing16}` @@ -48,7 +48,7 @@ describe('TertiaryButton', () => { expect(button).toHaveStyle('overflow: no-wrap') expect(button).toHaveStyle('white-space: nowrap') expect(button).toHaveStyle( - `color: ${String(COLORS.fundamentalsBackground)}` + `color: ${String(LEGACY_COLORS.fundamentalsBackground)}` ) }) @@ -58,9 +58,9 @@ describe('TertiaryButton', () => { const button = getByText('tertiary button') expect(button).toBeDisabled() expect(button).toHaveStyle( - `background-color: ${String(COLORS.darkGreyDisabled)}` + `background-color: ${String(LEGACY_COLORS.darkGreyDisabled)}` ) - expect(button).toHaveStyle(`color: ${String(COLORS.errorDisabled)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.errorDisabled)}`) }) it('applies the correct states to the button - hover', () => { @@ -68,7 +68,7 @@ describe('TertiaryButton', () => { const button = getByText('tertiary button') expect(button).toHaveStyleRule( 'background-color', - `${String(COLORS.blueHover)}`, + `${String(LEGACY_COLORS.blueHover)}`, { modifier: ':hover', } @@ -83,7 +83,7 @@ describe('TertiaryButton', () => { const button = getByText('tertiary button') expect(button).toHaveStyleRule( 'background-color', - `${String(COLORS.bluePressed)}`, + `${String(LEGACY_COLORS.bluePressed)}`, { modifier: ':active', } @@ -95,7 +95,7 @@ describe('TertiaryButton', () => { const button = getByText('tertiary button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.warningEnabled)}`, + `0 0 0 3px ${String(LEGACY_COLORS.warningEnabled)}`, { modifier: ':focus-visible', } @@ -103,14 +103,14 @@ describe('TertiaryButton', () => { }) it('renders tertiary button with text and different background color', () => { - props.backgroundColor = COLORS.errorEnabled + props.backgroundColor = LEGACY_COLORS.errorEnabled const { getByText } = render(props) const button = getByText('tertiary button') expect(button).toHaveStyle( - `background-color: ${String(COLORS.errorEnabled)}` + `background-color: ${String(LEGACY_COLORS.errorEnabled)}` ) expect(button).toHaveStyle( - `color: ${String(COLORS.fundamentalsBackground)}` + `color: ${String(LEGACY_COLORS.fundamentalsBackground)}` ) }) }) diff --git a/app/src/atoms/buttons/__tests__/ToggleButton.test.tsx b/app/src/atoms/buttons/__tests__/ToggleButton.test.tsx index 88410aa8747..9bd68dcd5e8 100644 --- a/app/src/atoms/buttons/__tests__/ToggleButton.test.tsx +++ b/app/src/atoms/buttons/__tests__/ToggleButton.test.tsx @@ -1,7 +1,7 @@ import 'jest-styled-components' import * as React from 'react' import { fireEvent } from '@testing-library/react' -import { renderWithProviders, COLORS, SIZE_2 } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, SIZE_2 } from '@opentrons/components' import { ToggleButton } from '..' @@ -27,7 +27,7 @@ describe('ToggleButton', () => { it('renders toggle button - on', () => { const { getByLabelText } = render(props) const button = getByLabelText('toggle button') - expect(button).toHaveStyle(`color: ${String(COLORS.blueEnabled)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.blueEnabled)}`) expect(button).toHaveStyle(`height: ${String(SIZE_2)}`) expect(button).toHaveStyle(`width: ${String(SIZE_2)}`) expect(button).toHaveAttribute('aria-checked', 'true') @@ -36,7 +36,7 @@ describe('ToggleButton', () => { it('applies the correct states to the toggle on- hover', () => { const { getByLabelText } = render(props) const button = getByLabelText('toggle button') - expect(button).toHaveStyleRule('color', `${String(COLORS.blueHover)}`, { + expect(button).toHaveStyleRule('color', `${String(LEGACY_COLORS.blueHover)}`, { modifier: ':hover', }) }) @@ -46,7 +46,7 @@ describe('ToggleButton', () => { const button = getByLabelText('toggle button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.warningEnabled)}`, + `0 0 0 3px ${String(LEGACY_COLORS.warningEnabled)}`, { modifier: ':focus-visible', } @@ -59,7 +59,7 @@ describe('ToggleButton', () => { const button = getByLabelText('toggle button') expect(button).toHaveStyleRule( 'color', - `${String(COLORS.darkGreyDisabled)}`, + `${String(LEGACY_COLORS.darkGreyDisabled)}`, { modifier: ':disabled', } @@ -77,7 +77,7 @@ describe('ToggleButton', () => { props.toggledOn = false const { getByLabelText } = render(props) const button = getByLabelText('toggle button') - expect(button).toHaveStyle(`color: ${String(COLORS.darkGreyEnabled)}`) + expect(button).toHaveStyle(`color: ${String(LEGACY_COLORS.darkGreyEnabled)}`) expect(button).toHaveStyle(`height: ${String(SIZE_2)}`) expect(button).toHaveStyle(`width: ${String(SIZE_2)}`) expect(button).toHaveAttribute('aria-checked', 'false') @@ -87,7 +87,7 @@ describe('ToggleButton', () => { props.toggledOn = false const { getByLabelText } = render(props) const button = getByLabelText('toggle button') - expect(button).toHaveStyleRule('color', `${String(COLORS.darkGreyHover)}`, { + expect(button).toHaveStyleRule('color', `${String(LEGACY_COLORS.darkGreyHover)}`, { modifier: ':hover', }) }) @@ -98,7 +98,7 @@ describe('ToggleButton', () => { const button = getByLabelText('toggle button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.warningEnabled)}`, + `0 0 0 3px ${String(LEGACY_COLORS.warningEnabled)}`, { modifier: ':focus-visible', } @@ -112,7 +112,7 @@ describe('ToggleButton', () => { const button = getByLabelText('toggle button') expect(button).toHaveStyleRule( 'color', - `${String(COLORS.darkGreyDisabled)}`, + `${String(LEGACY_COLORS.darkGreyDisabled)}`, { modifier: ':disabled', } diff --git a/app/src/atoms/buttons/constants.ts b/app/src/atoms/buttons/constants.ts index fb4bf596435..fb4d4de3b77 100644 --- a/app/src/atoms/buttons/constants.ts +++ b/app/src/atoms/buttons/constants.ts @@ -1,3 +1,3 @@ -import { SPACING, COLORS } from '@opentrons/components' +import { SPACING, LEGACY_COLORS } from '@opentrons/components' -export const ODD_FOCUS_VISIBLE = `0 0 0 ${SPACING.spacing4} ${COLORS.fundamentalsFocus}` +export const ODD_FOCUS_VISIBLE = `0 0 0 ${SPACING.spacing4} ${LEGACY_COLORS.fundamentalsFocus}` diff --git a/app/src/atoms/structure/Divider.tsx b/app/src/atoms/structure/Divider.tsx index babca8b86b9..ac4ec4f2fc7 100644 --- a/app/src/atoms/structure/Divider.tsx +++ b/app/src/atoms/structure/Divider.tsx @@ -1,12 +1,12 @@ import * as React from 'react' -import { Box, COLORS, SPACING } from '@opentrons/components' +import { Box, LEGACY_COLORS, SPACING } from '@opentrons/components' type Props = React.ComponentProps export function Divider(props: Props): JSX.Element { return ( ) => { @@ -19,7 +19,7 @@ describe('Divider', () => { const { getByTestId } = render(props) const divider = getByTestId('divider') expect(divider).toHaveStyle( - `borderBottom: 1px solid ${String(COLORS.medGreyEnabled)}` + `borderBottom: 1px solid ${String(LEGACY_COLORS.medGreyEnabled)}` ) expect(divider).toHaveStyle('width: 80%') expect(divider).toHaveStyle(`margin-top: ${SPACING.spacing4}`) @@ -30,13 +30,13 @@ describe('Divider', () => { props = { ...props, width: '100%', - color: COLORS.blueEnabled, + color: LEGACY_COLORS.blueEnabled, marginY: 0, paddingX: SPACING.spacing4, } const { getByTestId } = render(props) const divider = getByTestId('divider') - expect(divider).toHaveStyle(`color: ${String(COLORS.blueEnabled)}`) + expect(divider).toHaveStyle(`color: ${String(LEGACY_COLORS.blueEnabled)}`) expect(divider).toHaveStyle('width: 100%') expect(divider).toHaveStyle('margin-top: 0') expect(divider).toHaveStyle('margin-bottom: 0') diff --git a/app/src/atoms/structure/__tests__/Line.test.tsx b/app/src/atoms/structure/__tests__/Line.test.tsx index 4e007d66a81..393ab3f29d0 100644 --- a/app/src/atoms/structure/__tests__/Line.test.tsx +++ b/app/src/atoms/structure/__tests__/Line.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { renderWithProviders, SPACING, COLORS } from '@opentrons/components' +import { renderWithProviders, SPACING, LEGACY_COLORS } from '@opentrons/components' import { Line } from '../index' const render = (props: React.ComponentProps) => { @@ -20,7 +20,7 @@ describe('Line', () => { const line = getByTestId('line') expect(line).toHaveStyle('width: 100%') expect(line).toHaveStyle( - `borderBottom: 1px solid ${String(COLORS.medGreyEnabled)}` + `borderBottom: 1px solid ${String(LEGACY_COLORS.medGreyEnabled)}` ) }) @@ -28,13 +28,13 @@ describe('Line', () => { props = { ...props, width: '80%', - color: COLORS.blueEnabled, + color: LEGACY_COLORS.blueEnabled, marginY: 0, paddingX: SPACING.spacing4, } const { getByTestId } = render(props) const line = getByTestId('line') - expect(line).toHaveStyle(`color: ${String(COLORS.blueEnabled)}`) + expect(line).toHaveStyle(`color: ${String(LEGACY_COLORS.blueEnabled)}`) expect(line).toHaveStyle('width: 80%') expect(line).toHaveStyle('margin-top: 0') expect(line).toHaveStyle('margin-bottom: 0') diff --git a/app/src/molecules/BackgroundOverlay/index.tsx b/app/src/molecules/BackgroundOverlay/index.tsx index b60c20f0738..8d36199d0c3 100644 --- a/app/src/molecules/BackgroundOverlay/index.tsx +++ b/app/src/molecules/BackgroundOverlay/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { COLORS, Flex, POSITION_FIXED } from '@opentrons/components' +import { LEGACY_COLORS, Flex, POSITION_FIXED } from '@opentrons/components' export interface BackgroundOverlayProps extends React.ComponentProps { @@ -19,7 +19,7 @@ export function BackgroundOverlay(props: BackgroundOverlayProps): JSX.Element { top="0" bottom="0" zIndex="3" - backgroundColor={COLORS.darkBlack60} + backgroundColor={LEGACY_COLORS.darkBlack60} onClick={onClick} {...flexProps} /> diff --git a/app/src/molecules/CardButton/__tests__/CardButton.test.tsx b/app/src/molecules/CardButton/__tests__/CardButton.test.tsx index 53174b54c11..3f060e1e96c 100644 --- a/app/src/molecules/CardButton/__tests__/CardButton.test.tsx +++ b/app/src/molecules/CardButton/__tests__/CardButton.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { fireEvent } from '@testing-library/react' import { MemoryRouter } from 'react-router-dom' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { i18n } from '../../../i18n' import { CardButton } from '..' @@ -49,7 +49,7 @@ describe('CardButton', () => { getByText('Find a network in your lab or enter your own.') expect(getByTestId('cardButton_icon_wifi')).toBeInTheDocument() const button = getByRole('button') - expect(button).toHaveStyle(`background-color: ${COLORS.mediumBlueEnabled}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.mediumBlueEnabled}`) }) it('renders the button as disabled', () => { diff --git a/app/src/molecules/CardButton/index.tsx b/app/src/molecules/CardButton/index.tsx index 847eceacf6b..b24901dbb79 100644 --- a/app/src/molecules/CardButton/index.tsx +++ b/app/src/molecules/CardButton/index.tsx @@ -6,7 +6,7 @@ import { DIRECTION_COLUMN, ALIGN_CENTER, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, Icon, Btn, @@ -27,29 +27,29 @@ const CARD_BUTTON_STYLE = css` box-shadow: none; &:focus { - background-color: ${COLORS.mediumBluePressed}; + background-color: ${LEGACY_COLORS.mediumBluePressed}; box-shadow: none; } &:hover { border: none; box-shadow: none; - background-color: ${COLORS.mediumBlueEnabled}; - color: ${COLORS.darkBlackEnabled}; + background-color: ${LEGACY_COLORS.mediumBlueEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.mediumBlueEnabled}; + background-color: ${LEGACY_COLORS.mediumBlueEnabled}; } &:active { - background-color: ${COLORS.mediumBluePressed}; + background-color: ${LEGACY_COLORS.mediumBluePressed}; } &:disabled { - background-color: ${COLORS.darkBlack20}; - color: ${COLORS.darkBlack70}; + background-color: ${LEGACY_COLORS.darkBlack20}; + color: ${LEGACY_COLORS.darkBlack70}; } ` @@ -83,20 +83,20 @@ export function CardButton(props: CardButtonProps): JSX.Element { onClick={() => history.push(destinationPath)} width="100%" css={CARD_BUTTON_STYLE} - backgroundColor={disabled ? COLORS.darkBlack20 : COLORS.mediumBlueEnabled} + backgroundColor={disabled ? LEGACY_COLORS.darkBlack20 : LEGACY_COLORS.mediumBlueEnabled} disabled={disabled} > {title} @@ -110,7 +110,7 @@ export function CardButton(props: CardButtonProps): JSX.Element { {description} diff --git a/app/src/molecules/CollapsibleSection/index.tsx b/app/src/molecules/CollapsibleSection/index.tsx index cec85f2e734..22db365c99c 100644 --- a/app/src/molecules/CollapsibleSection/index.tsx +++ b/app/src/molecules/CollapsibleSection/index.tsx @@ -8,7 +8,7 @@ import { Icon, JUSTIFY_SPACE_BETWEEN, StyleProps, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, } from '@opentrons/components' import { StyledText } from '../../atoms/text' @@ -16,10 +16,10 @@ import { StyledText } from '../../atoms/text' const ACCORDION_STYLE = css` border-radius: 50%; &:hover { - background: ${COLORS.lightGreyHover}; + background: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background: ${COLORS.lightGreyPressed}; + background: ${LEGACY_COLORS.lightGreyPressed}; } ` diff --git a/app/src/molecules/GenericWizardTile/index.tsx b/app/src/molecules/GenericWizardTile/index.tsx index 17ebc46a595..9f296768262 100644 --- a/app/src/molecules/GenericWizardTile/index.tsx +++ b/app/src/molecules/GenericWizardTile/index.tsx @@ -9,7 +9,7 @@ import { JUSTIFY_SPACE_BETWEEN, DIRECTION_ROW, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, Btn, JUSTIFY_FLEX_END, JUSTIFY_START, @@ -40,7 +40,7 @@ const CAPITALIZE_FIRST_LETTER_STYLE = css` ` const GO_BACK_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { opacity: 70%; @@ -59,7 +59,7 @@ const GO_BACK_BUTTON_STYLE = css` ` const GO_BACK_BUTTON_DISABLED_STYLE = css` ${TYPOGRAPHY.pSemiBold}; - color: ${COLORS.darkBlack70}; + color: ${LEGACY_COLORS.darkBlack70}; ` const Title = styled.h1` ${TYPOGRAPHY.h1Default}; diff --git a/app/src/molecules/InProgressModal/InProgressModal.tsx b/app/src/molecules/InProgressModal/InProgressModal.tsx index 54e4e5ebb13..ba12eab776f 100644 --- a/app/src/molecules/InProgressModal/InProgressModal.tsx +++ b/app/src/molecules/InProgressModal/InProgressModal.tsx @@ -3,7 +3,7 @@ import { css } from 'styled-components' import { useSelector } from 'react-redux' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, TYPOGRAPHY, SPACING, @@ -49,10 +49,10 @@ const MODAL_STYLE = css` } ` const SPINNER_STYLE = css` - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; opacity: 100%; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; opacity: 70%; } ` diff --git a/app/src/molecules/InfoMessage/index.tsx b/app/src/molecules/InfoMessage/index.tsx index c85d33c179f..3fb295320cd 100644 --- a/app/src/molecules/InfoMessage/index.tsx +++ b/app/src/molecules/InfoMessage/index.tsx @@ -5,7 +5,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, SIZE_1, @@ -23,7 +23,7 @@ export interface InfoMessageProps { export function InfoMessage({ title, body }: InfoMessageProps): JSX.Element { return ( {title} diff --git a/app/src/molecules/InstrumentCard/MenuOverlay.tsx b/app/src/molecules/InstrumentCard/MenuOverlay.tsx index 650b0e83290..54d6cc615ae 100644 --- a/app/src/molecules/InstrumentCard/MenuOverlay.tsx +++ b/app/src/molecules/InstrumentCard/MenuOverlay.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { Flex, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, POSITION_ABSOLUTE, } from '@opentrons/components' @@ -31,7 +31,7 @@ export function MenuOverlay(props: MenuOverlayProps): JSX.Element { return ( diff --git a/app/src/molecules/JogControls/ControlContainer.tsx b/app/src/molecules/JogControls/ControlContainer.tsx index daa0bc0a7af..d721ffa672f 100644 --- a/app/src/molecules/JogControls/ControlContainer.tsx +++ b/app/src/molecules/JogControls/ControlContainer.tsx @@ -2,7 +2,7 @@ import React from 'react' import { css } from 'styled-components' import { BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_CENTER, Flex, @@ -17,7 +17,7 @@ interface ControlContainerProps extends StyleProps { } const CONTROL_CHILDREN_STYLES = css` - background-color: ${COLORS.fundamentalsBackground}; + background-color: ${LEGACY_COLORS.fundamentalsBackground}; border-radius: ${BORDERS.radiusSoftCorners}; padding: ${SPACING.spacing16}; width: 100%; diff --git a/app/src/molecules/JogControls/DirectionControl.tsx b/app/src/molecules/JogControls/DirectionControl.tsx index 720cc11323c..f25b8fb0c35 100644 --- a/app/src/molecules/JogControls/DirectionControl.tsx +++ b/app/src/molecules/JogControls/DirectionControl.tsx @@ -11,7 +11,7 @@ import { ALIGN_CENTER, JUSTIFY_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, DIRECTION_COLUMN, @@ -170,45 +170,45 @@ const PLANE_BUTTONS_STYLE = css` const DEFAULT_BUTTON_STYLE = css` display: flex; - border: 1px ${COLORS.white} solid; + border: 1px ${LEGACY_COLORS.white} solid; justify-content: ${JUSTIFY_FLEX_START}; align-items: ${ALIGN_CENTER}; - background-color: ${COLORS.white}; - color: ${COLORS.black}; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.black}; grid-gap: ${SPACING.spacing8}; padding: ${SPACING.spacing8}; &:focus { - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; } &:hover { - background-color: ${COLORS.white}; - color: ${COLORS.black}; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.black}; box-shadow: 0 0 0; - border: 1px ${COLORS.lightGreyHover} solid; + border: 1px ${LEGACY_COLORS.lightGreyHover} solid; } &:active { - background-color: ${COLORS.white}; - color: ${COLORS.blueEnabled}; - border: 1px ${COLORS.blueEnabled} solid; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.blueEnabled}; + border: 1px ${LEGACY_COLORS.blueEnabled} solid; } &:disabled { - background-color: ${COLORS.white}; - color: ${COLORS.errorDisabled}; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.errorDisabled}; } ` const ACTIVE_BUTTON_STYLE = css` ${DEFAULT_BUTTON_STYLE} - color: ${COLORS.blueEnabled}; - border: 1px ${COLORS.blueEnabled} solid; + color: ${LEGACY_COLORS.blueEnabled}; + border: 1px ${LEGACY_COLORS.blueEnabled} solid; &:hover { - color: ${COLORS.bluePressed}; - border: 1px ${COLORS.bluePressed} solid; + color: ${LEGACY_COLORS.bluePressed}; + border: 1px ${LEGACY_COLORS.bluePressed} solid; } ` @@ -266,7 +266,7 @@ export function DirectionControl(props: DirectionControlProps): JSX.Element { {subtitle} @@ -330,8 +330,8 @@ const ARROW_GRID_STYLES = css` } ` const ARROW_BUTTON_STYLES = css` - color: ${COLORS.darkGreyEnabled}; - background-color: ${COLORS.white}; + color: ${LEGACY_COLORS.darkGreyEnabled}; + background-color: ${LEGACY_COLORS.white}; border: ${BORDERS.lineBorder}; width: 2.75rem; @@ -341,25 +341,25 @@ const ARROW_BUTTON_STYLES = css` align-items: ${ALIGN_CENTER}; justify-content: ${JUSTIFY_CENTER}; &:hover { - background-color: ${COLORS.white}; - color: ${COLORS.darkGreyHover}; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.darkGreyHover}; box-shadow: 0 0 0; - border: 1px ${COLORS.lightGreyHover} solid; + border: 1px ${LEGACY_COLORS.lightGreyHover} solid; } &:active { - background-color: ${COLORS.white}; - color: ${COLORS.darkGreyPressed}; - border: 1px ${COLORS.lightGreyHover} solid; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.darkGreyPressed}; + border: 1px ${LEGACY_COLORS.lightGreyHover} solid; } &:focus { - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; } &:disabled { - background-color: ${COLORS.white}; - color: ${COLORS.darkGreyDisabled}; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.darkGreyDisabled}; } @media (max-width: 750px) { @@ -369,29 +369,29 @@ const ARROW_BUTTON_STYLES = css` @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { width: 125px; height: 125px; - background-color: ${COLORS.light1}; - color: ${COLORS.darkBlackEnabled}; + background-color: ${LEGACY_COLORS.light1}; + color: ${LEGACY_COLORS.darkBlackEnabled}; border-radius: ${BORDERS.borderRadiusSize4}; &:hover { - background-color: ${COLORS.light1Pressed}; - color: ${COLORS.darkBlackHover}; - border: 1px ${COLORS.transparent} solid; + background-color: ${LEGACY_COLORS.light1Pressed}; + color: ${LEGACY_COLORS.darkBlackHover}; + border: 1px ${LEGACY_COLORS.transparent} solid; } &:active { - background-color: ${COLORS.light1Pressed}; - color: ${COLORS.darkGreyPressed}; + background-color: ${LEGACY_COLORS.light1Pressed}; + color: ${LEGACY_COLORS.darkGreyPressed}; } &:focus { - background-color: ${COLORS.light1Pressed}; + background-color: ${LEGACY_COLORS.light1Pressed}; } &:disabled { - background-color: ${COLORS.darkBlack20}; - color: ${COLORS.darkBlack40}; - border: 1px ${COLORS.transparent} solid; + background-color: ${LEGACY_COLORS.darkBlack20}; + color: ${LEGACY_COLORS.darkBlack40}; + border: 1px ${LEGACY_COLORS.transparent} solid; } } ` @@ -457,7 +457,7 @@ export function TouchDirectionControl( {CONTROLS_CONTENTS_BY_PLANE[plane].title} diff --git a/app/src/molecules/JogControls/StepSizeControl.tsx b/app/src/molecules/JogControls/StepSizeControl.tsx index 09db9e8215c..c5900ab66d4 100644 --- a/app/src/molecules/JogControls/StepSizeControl.tsx +++ b/app/src/molecules/JogControls/StepSizeControl.tsx @@ -4,7 +4,7 @@ import styled, { css } from 'styled-components' import { HandleKeypress, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, Icon, DIRECTION_COLUMN, @@ -47,41 +47,41 @@ const BUTTON_WRAPPER_STYLE = css` ` const DEFAULT_BUTTON_STYLE = css` - background-color: ${COLORS.white}; - border: 1px ${COLORS.white} solid; + background-color: ${LEGACY_COLORS.white}; + border: 1px ${LEGACY_COLORS.white} solid; height: 3.62rem; - color: ${COLORS.black}; + color: ${LEGACY_COLORS.black}; &:focus { - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; } &:hover { - background-color: ${COLORS.white}; - color: ${COLORS.black}; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.black}; box-shadow: 0 0 0; - border: 1px ${COLORS.lightGreyHover} solid; + border: 1px ${LEGACY_COLORS.lightGreyHover} solid; } &:active { - background-color: ${COLORS.white}; - color: ${COLORS.blueEnabled}; - border: 1px ${COLORS.blueEnabled} solid; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.blueEnabled}; + border: 1px ${LEGACY_COLORS.blueEnabled} solid; } &:disabled { background-color: inherit; - color: ${COLORS.errorDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; } ` const ACTIVE_BUTTON_STYLE = css` ${DEFAULT_BUTTON_STYLE} - color: ${COLORS.blueEnabled}; - border: 1px ${COLORS.blueEnabled} solid; + color: ${LEGACY_COLORS.blueEnabled}; + border: 1px ${LEGACY_COLORS.blueEnabled} solid; &:hover { - color: ${COLORS.blueHover}; - border: 1px ${COLORS.blueHover} solid; + color: ${LEGACY_COLORS.blueHover}; + border: 1px ${LEGACY_COLORS.blueHover} solid; } ` interface StepSizeControlProps { @@ -133,7 +133,7 @@ export function StepSizeControl(props: StepSizeControlProps): JSX.Element { {JUMP_SIZE_SUBTITLE} @@ -153,7 +153,7 @@ export function StepSizeControl(props: StepSizeControlProps): JSX.Element { > {t(stepSizeTranslationKeyByStep[stepSize])} {`${stepSize} mm`} @@ -173,7 +173,7 @@ export function TouchStepSizeControl(props: StepSizeControlProps): JSX.Element { {t(stepSizeTranslationKeyByStep[stepSize])} {`${stepSize} mm`} diff --git a/app/src/molecules/JogControls/TouchControlButton.tsx b/app/src/molecules/JogControls/TouchControlButton.tsx index c1490726c5a..16ac5469fdc 100644 --- a/app/src/molecules/JogControls/TouchControlButton.tsx +++ b/app/src/molecules/JogControls/TouchControlButton.tsx @@ -1,11 +1,11 @@ import styled from 'styled-components' -import { COLORS, SPACING, BORDERS } from '@opentrons/components' +import { LEGACY_COLORS, SPACING, BORDERS } from '@opentrons/components' import { ODD_FOCUS_VISIBLE } from '../../atoms/buttons/constants' export const TouchControlButton = styled.button<{ selected: boolean }>` background-color: ${({ selected }) => - selected ? COLORS.blueEnabled : COLORS.mediumBlueEnabled}; + selected ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.mediumBlueEnabled}; cursor: default; border-radius: ${BORDERS.borderRadiusSize4}; box-shadow: none; @@ -13,23 +13,23 @@ export const TouchControlButton = styled.button<{ selected: boolean }>` &:focus { background-color: ${({ selected }) => - selected ? COLORS.bluePressed : COLORS.mediumBluePressed}; + selected ? LEGACY_COLORS.bluePressed : LEGACY_COLORS.mediumBluePressed}; box-shadow: none; } &:hover { border: none; box-shadow: none; background-color: ${({ selected }) => - selected ? COLORS.blueEnabled : COLORS.mediumBlueEnabled}; + selected ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.mediumBlueEnabled}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; background-color: ${({ selected }) => - selected ? COLORS.blueEnabled : COLORS.mediumBlueEnabled}; + selected ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.mediumBlueEnabled}; } &:active { background-color: ${({ selected }) => - selected ? COLORS.bluePressed : COLORS.mediumBluePressed}; + selected ? LEGACY_COLORS.bluePressed : LEGACY_COLORS.mediumBluePressed}; } ` diff --git a/app/src/molecules/LegacyModal/LegacyModal.stories.tsx b/app/src/molecules/LegacyModal/LegacyModal.stories.tsx index b10c032e852..17205f5c8d4 100644 --- a/app/src/molecules/LegacyModal/LegacyModal.stories.tsx +++ b/app/src/molecules/LegacyModal/LegacyModal.stories.tsx @@ -4,7 +4,7 @@ import { LegacyModal } from './index' import { StyledText } from '../../atoms/text' import type { Story, Meta } from '@storybook/react' -import { COLORS, PrimaryBtn, SPACING, TYPOGRAPHY } from '@opentrons/components' +import { LEGACY_COLORS, PrimaryBtn, SPACING, TYPOGRAPHY } from '@opentrons/components' export default { title: 'App/Molecules/LegacyModal', @@ -26,7 +26,7 @@ const Children = ( diff --git a/app/src/molecules/LegacyModal/LegacyModalHeader.tsx b/app/src/molecules/LegacyModal/LegacyModalHeader.tsx index b1ef7f5d680..e9d21d59790 100644 --- a/app/src/molecules/LegacyModal/LegacyModalHeader.tsx +++ b/app/src/molecules/LegacyModal/LegacyModalHeader.tsx @@ -9,7 +9,7 @@ import { JUSTIFY_SPACE_BETWEEN, SPACING, JUSTIFY_CENTER, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { StyledText } from '../../atoms/text' @@ -33,11 +33,11 @@ const closeIconStyles = css` width: 1.625rem; height: 1.625rem; &:hover { - background-color: ${COLORS.lightGreyHover}; + background-color: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background-color: ${COLORS.lightGreyPressed}; + background-color: ${LEGACY_COLORS.lightGreyPressed}; } ` diff --git a/app/src/molecules/LegacyModal/LegacyModalShell.tsx b/app/src/molecules/LegacyModal/LegacyModalShell.tsx index ae14f8dcc82..e04a3de76f8 100644 --- a/app/src/molecules/LegacyModal/LegacyModalShell.tsx +++ b/app/src/molecules/LegacyModal/LegacyModalShell.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import styled from 'styled-components' import { StyleProps, - COLORS, + LEGACY_COLORS, POSITION_FIXED, POSITION_ABSOLUTE, ALIGN_CENTER, @@ -82,11 +82,11 @@ const Overlay = styled.div` top: 0; bottom: 0; z-index: 1; - background-color: ${COLORS.backgroundOverlay}; + background-color: ${LEGACY_COLORS.backgroundOverlay}; cursor: default; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { - background-color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.darkBlack60}; } ` const ContentArea = styled.div<{ zIndex: string | number }>` @@ -114,7 +114,7 @@ const ModalArea = styled.div< border-radius: ${BORDERS.radiusSoftCorners}; box-shadow: ${BORDERS.smallDropShadow}; height: ${({ isFullPage }) => (isFullPage ? '100%' : 'auto')}; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { border-radius: ${BORDERS.borderRadiusSize4}; } @@ -122,12 +122,12 @@ const ModalArea = styled.div< ` const Footer = styled.div` - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; position: ${POSITION_STICKY}; bottom: 0; ` const Header = styled.div` - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; position: ${POSITION_STICKY}; top: 0; ` diff --git a/app/src/molecules/LegacyModal/__tests__/LegacyModal.test.tsx b/app/src/molecules/LegacyModal/__tests__/LegacyModal.test.tsx index aea194c8c5c..d01bb3350c0 100644 --- a/app/src/molecules/LegacyModal/__tests__/LegacyModal.test.tsx +++ b/app/src/molecules/LegacyModal/__tests__/LegacyModal.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { LegacyModal } from '..' @@ -24,7 +24,7 @@ describe('LegacyModal', () => { expect(queryByTestId('Modal_header_icon')).not.toBeInTheDocument() getByText('mock info modal') expect(getByTestId('Modal_header')).toHaveStyle( - `background-color: ${COLORS.white}` + `background-color: ${LEGACY_COLORS.white}` ) }) @@ -33,9 +33,9 @@ describe('LegacyModal', () => { const [{ getByTestId }] = render(props) const headerIcon = getByTestId('Modal_header_icon') expect(headerIcon).toBeInTheDocument() - expect(headerIcon).toHaveStyle(`color: ${COLORS.warningEnabled}`) + expect(headerIcon).toHaveStyle(`color: ${LEGACY_COLORS.warningEnabled}`) expect(getByTestId('Modal_header')).toHaveStyle( - `background-color: ${COLORS.white}` + `background-color: ${LEGACY_COLORS.white}` ) }) @@ -44,9 +44,9 @@ describe('LegacyModal', () => { const [{ getByTestId }] = render(props) const headerIcon = getByTestId('Modal_header_icon') expect(headerIcon).toBeInTheDocument() - expect(headerIcon).toHaveStyle(`color: ${COLORS.errorEnabled}`) + expect(headerIcon).toHaveStyle(`color: ${LEGACY_COLORS.errorEnabled}`) expect(getByTestId('Modal_header')).toHaveStyle( - `background-color: ${COLORS.white}` + `background-color: ${LEGACY_COLORS.white}` ) }) }) diff --git a/app/src/molecules/LegacyModal/__tests__/LegacyModalHeader.test.tsx b/app/src/molecules/LegacyModal/__tests__/LegacyModalHeader.test.tsx index cfdcd9b28ab..73e92015758 100644 --- a/app/src/molecules/LegacyModal/__tests__/LegacyModalHeader.test.tsx +++ b/app/src/molecules/LegacyModal/__tests__/LegacyModalHeader.test.tsx @@ -4,7 +4,7 @@ import * as React from 'react' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, JUSTIFY_CENTER, renderWithProviders, SPACING, @@ -25,28 +25,28 @@ describe('LegacyModalHeader', () => { props = { onClose: mockClose, title: 'mock modal header title', - backgroundColor: COLORS.white, - color: COLORS.darkBlackEnabled, + backgroundColor: LEGACY_COLORS.white, + color: LEGACY_COLORS.darkBlackEnabled, } }) it('should render text and close icon', () => { render(props) const title = screen.getByText('mock modal header title') - expect(title).toHaveStyle(`color: ${COLORS.darkBlackEnabled}`) + expect(title).toHaveStyle(`color: ${LEGACY_COLORS.darkBlackEnabled}`) screen.getByTestId('ModalHeader_icon_close_mock modal header title') }) it('should render text, icon, and close icon', () => { props.icon = { name: 'ot-alert', - color: COLORS.darkBlackEnabled, + color: LEGACY_COLORS.darkBlackEnabled, size: '1.25rem', marginRight: SPACING.spacing8, } render(props) expect(screen.getByTestId('Modal_header_icon')).toHaveStyle( - `color: ${COLORS.darkBlackEnabled}` + `color: ${LEGACY_COLORS.darkBlackEnabled}` ) expect(screen.getByTestId('Modal_header_icon')).toHaveStyle( `width: 1.25rem` @@ -72,14 +72,14 @@ describe('LegacyModalHeader', () => { expect(closeIcon).toHaveStyle('border-radius: 0.875rem') expect(closeIcon).toHaveStyleRule( 'background-color', - COLORS.lightGreyHover, + LEGACY_COLORS.lightGreyHover, { modifier: ':hover', } ) expect(closeIcon).toHaveStyleRule( 'background-color', - COLORS.lightGreyPressed, + LEGACY_COLORS.lightGreyPressed, { modifier: ':active', } diff --git a/app/src/molecules/LegacyModal/index.tsx b/app/src/molecules/LegacyModal/index.tsx index 3a49ced1e0d..b734597ff06 100644 --- a/app/src/molecules/LegacyModal/index.tsx +++ b/app/src/molecules/LegacyModal/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { SPACING, COLORS, Box } from '@opentrons/components' +import { SPACING, LEGACY_COLORS, Box } from '@opentrons/components' import { LegacyModalHeader } from './LegacyModalHeader' import { LegacyModalShell } from './LegacyModalShell' import type { IconProps, StyleProps } from '@opentrons/components' @@ -35,10 +35,10 @@ export const LegacyModal = (props: LegacyModalProps): JSX.Element => { let iconColor: string = '' switch (type) { case 'warning': - iconColor = COLORS.warningEnabled + iconColor = LEGACY_COLORS.warningEnabled break case 'error': - iconColor = COLORS.errorEnabled + iconColor = LEGACY_COLORS.errorEnabled break } return iconColor @@ -56,8 +56,8 @@ export const LegacyModal = (props: LegacyModalProps): JSX.Element => { onClose={onClose} title={title} icon={['error', 'warning'].includes(type) ? modalIcon : undefined} - color={COLORS.darkBlackEnabled} - backgroundColor={COLORS.white} + color={LEGACY_COLORS.darkBlackEnabled} + backgroundColor={LEGACY_COLORS.white} /> ) diff --git a/app/src/molecules/MiniCard/MiniCard.stories.tsx b/app/src/molecules/MiniCard/MiniCard.stories.tsx index e75c6ed097b..fb51a152405 100644 --- a/app/src/molecules/MiniCard/MiniCard.stories.tsx +++ b/app/src/molecules/MiniCard/MiniCard.stories.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { SPACING, Box, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, Flex, ALIGN_CENTER, @@ -34,7 +34,7 @@ const Template: Story> = args => { const Children = ( - + { it('renders the correct style unselectedOptionStyles', () => { const { getByText } = render(props) const miniCard = getByText('mock mini card') - expect(miniCard).toHaveStyle(`background-color: ${String(COLORS.white)}`) + expect(miniCard).toHaveStyle(`background-color: ${String(LEGACY_COLORS.white)}`) expect(miniCard).toHaveStyle( - `border: 1px solid ${String(COLORS.medGreyEnabled)}` + `border: 1px solid ${String(LEGACY_COLORS.medGreyEnabled)}` ) expect(miniCard).toHaveStyle( `border-radius: ${String(BORDERS.radiusSoftCorners)}` @@ -45,10 +45,10 @@ describe('MiniCard', () => { const { getByText } = render(props) const miniCard = getByText('mock mini card') expect(miniCard).toHaveStyle( - `background-color: ${String(COLORS.lightBlue)}` + `background-color: ${String(LEGACY_COLORS.lightBlue)}` ) expect(miniCard).toHaveStyle( - `border: 1px solid ${String(COLORS.blueEnabled)}` + `border: 1px solid ${String(LEGACY_COLORS.blueEnabled)}` ) expect(miniCard).toHaveStyle( `border-radius: ${String(BORDERS.radiusSoftCorners)}` @@ -58,14 +58,14 @@ describe('MiniCard', () => { expect(miniCard).toHaveStyle(`cursor: pointer`) expect(miniCard).toHaveStyleRule( 'border', - `1px solid ${String(COLORS.blueEnabled)}`, + `1px solid ${String(LEGACY_COLORS.blueEnabled)}`, { modifier: ':hover', } ) expect(miniCard).toHaveStyleRule( 'background-color', - `${String(COLORS.lightBlue)}`, + `${String(LEGACY_COLORS.lightBlue)}`, { modifier: ':hover', } @@ -78,10 +78,10 @@ describe('MiniCard', () => { const { getByText } = render(props) const miniCard = getByText('mock mini card') expect(miniCard).toHaveStyle( - `background-color: ${String(COLORS.errorBackgroundLight)}` + `background-color: ${String(LEGACY_COLORS.errorBackgroundLight)}` ) expect(miniCard).toHaveStyle( - `border: 1px solid ${String(COLORS.errorEnabled)}` + `border: 1px solid ${String(LEGACY_COLORS.errorEnabled)}` ) expect(miniCard).toHaveStyle( `border-radius: ${String(BORDERS.radiusSoftCorners)}` @@ -91,14 +91,14 @@ describe('MiniCard', () => { expect(miniCard).toHaveStyle(`cursor: pointer`) expect(miniCard).toHaveStyleRule( 'border', - `1px solid ${String(COLORS.errorEnabled)}`, + `1px solid ${String(LEGACY_COLORS.errorEnabled)}`, { modifier: ':hover', } ) expect(miniCard).toHaveStyleRule( 'background-color', - `${String(COLORS.errorBackgroundLight)}`, + `${String(LEGACY_COLORS.errorBackgroundLight)}`, { modifier: ':hover', } diff --git a/app/src/molecules/MiniCard/index.tsx b/app/src/molecules/MiniCard/index.tsx index e2fb7777dd1..066db8688be 100644 --- a/app/src/molecules/MiniCard/index.tsx +++ b/app/src/molecules/MiniCard/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { SPACING, Flex, COLORS, BORDERS } from '@opentrons/components' +import { SPACING, Flex, LEGACY_COLORS, BORDERS } from '@opentrons/components' import type { StyleProps } from '@opentrons/components' @@ -11,36 +11,36 @@ interface MiniCardProps extends StyleProps { isError?: boolean } const unselectedOptionStyles = css` - background-color: ${COLORS.white}; - border: 1px solid ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.white}; + border: 1px solid ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; padding: ${SPACING.spacing8}; width: 100%; cursor: pointer; &:hover { - border: 1px solid ${COLORS.medGreyHover}; + border: 1px solid ${LEGACY_COLORS.medGreyHover}; } ` const selectedOptionStyles = css` ${unselectedOptionStyles} - border: 1px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.lightBlue}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; &:hover { - border: 1px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.lightBlue}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; } ` const errorOptionStyles = css` ${selectedOptionStyles} - border: 1px solid ${COLORS.errorEnabled}; - background-color: ${COLORS.errorBackgroundLight}; + border: 1px solid ${LEGACY_COLORS.errorEnabled}; + background-color: ${LEGACY_COLORS.errorBackgroundLight}; &:hover { - border: 1px solid ${COLORS.errorEnabled}; - background-color: ${COLORS.errorBackgroundLight}; + border: 1px solid ${LEGACY_COLORS.errorEnabled}; + background-color: ${LEGACY_COLORS.errorBackgroundLight}; } ` diff --git a/app/src/molecules/Modal/Modal.stories.tsx b/app/src/molecules/Modal/Modal.stories.tsx index 5295090666f..10c3be9d9a8 100644 --- a/app/src/molecules/Modal/Modal.stories.tsx +++ b/app/src/molecules/Modal/Modal.stories.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { COLORS, Flex, BORDERS, SPACING } from '@opentrons/components' +import { LEGACY_COLORS, Flex, BORDERS, SPACING } from '@opentrons/components' import { touchScreenViewport } from '../../DesignTokens/constants' import { Modal } from './Modal' import type { Story, Meta } from '@storybook/react' @@ -26,7 +26,7 @@ Default.args = { title: 'Header', hasExitIcon: true, iconName: 'information', - iconColor: COLORS.black, + iconColor: LEGACY_COLORS.black, }, children: ( ) : null} ) => { @@ -23,12 +23,12 @@ describe('ModalHeader', () => { ...props, hasExitIcon: true, iconName: 'information', - iconColor: COLORS.black, + iconColor: LEGACY_COLORS.black, onClick: jest.fn(), } render(props) expect(screen.getByLabelText('icon_information')).toHaveStyle( - `color: ${COLORS.black}` + `color: ${LEGACY_COLORS.black}` ) fireEvent.click(screen.getByLabelText('closeIcon')) expect(props.onClick).toHaveBeenCalled() diff --git a/app/src/molecules/ModuleIcon/__tests__/ModuleIcon.test.tsx b/app/src/molecules/ModuleIcon/__tests__/ModuleIcon.test.tsx index 8c7dd92763b..ca2ed02bd66 100644 --- a/app/src/molecules/ModuleIcon/__tests__/ModuleIcon.test.tsx +++ b/app/src/molecules/ModuleIcon/__tests__/ModuleIcon.test.tsx @@ -1,6 +1,6 @@ import 'jest-styled-components' import * as React from 'react' -import { renderWithProviders, COLORS, SPACING } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, SPACING } from '@opentrons/components' import { ModuleIcon } from '../' @@ -55,14 +55,14 @@ describe('ModuleIcon', () => { it('renders SharedIcon with correct style', () => { const { getByTestId } = render(props) const module = getByTestId('ModuleIcon_ot-temperature-v2') - expect(module).toHaveStyle(`color: ${String(COLORS.darkGreyEnabled)}`) + expect(module).toHaveStyle(`color: ${String(LEGACY_COLORS.darkGreyEnabled)}`) expect(module).toHaveStyle(`height: ${SPACING.spacing16}`) expect(module).toHaveStyle(`width: ${SPACING.spacing16}`) expect(module).toHaveStyle(`margin-left: ${SPACING.spacing2}`) expect(module).toHaveStyle(`margin-right: ${SPACING.spacing2}`) expect(module).toHaveStyleRule( 'color', - `${String(COLORS.darkBlackEnabled)}`, + `${String(LEGACY_COLORS.darkBlackEnabled)}`, { modifier: ':hover', } diff --git a/app/src/molecules/ModuleIcon/index.tsx b/app/src/molecules/ModuleIcon/index.tsx index eb6de984104..d6aac9feed5 100644 --- a/app/src/molecules/ModuleIcon/index.tsx +++ b/app/src/molecules/ModuleIcon/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { css } from 'styled-components' import { - COLORS, + LEGACY_COLORS, Flex, ModuleIcon as SharedModuleIcon, POSITION_RELATIVE, @@ -14,7 +14,7 @@ import type { AttachedModule } from '../../redux/modules/types' const MODULE_ICON_STYLE = css` &:hover { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; } ` interface ModuleIconProps { @@ -33,7 +33,7 @@ export function ModuleIcon(props: ModuleIconProps): JSX.Element { moduleType={module.moduleType} size={SPACING.spacing16} marginX={SPACING.spacing2} - color={COLORS.darkGreyEnabled} + color={LEGACY_COLORS.darkGreyEnabled} css={MODULE_ICON_STYLE} /> diff --git a/app/src/molecules/NavTab/__tests__/NavTab.test.tsx b/app/src/molecules/NavTab/__tests__/NavTab.test.tsx index 9fad7a4f89e..f7f49e13dc7 100644 --- a/app/src/molecules/NavTab/__tests__/NavTab.test.tsx +++ b/app/src/molecules/NavTab/__tests__/NavTab.test.tsx @@ -4,7 +4,7 @@ import { MemoryRouter } from 'react-router-dom' import { renderWithProviders, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, BORDERS, } from '@opentrons/components' @@ -44,11 +44,11 @@ describe('NavTab', () => { expect(tab).toHaveStyle( `font-weight: ${String(TYPOGRAPHY.fontWeightSemiBold)}` ) - expect(tab).toHaveStyle(`color: ${String(COLORS.darkGreyEnabled)}`) + expect(tab).toHaveStyle(`color: ${String(LEGACY_COLORS.darkGreyEnabled)}`) fireEvent.click(tab) - expect(tab).toHaveStyle(`color: ${String(COLORS.darkBlackEnabled)}`) + expect(tab).toHaveStyle(`color: ${String(LEGACY_COLORS.darkBlackEnabled)}`) expect(tab).toHaveStyle( - `border-bottom-color: ${String(COLORS.blueEnabled)}` + `border-bottom-color: ${String(LEGACY_COLORS.blueEnabled)}` ) expect(tab).toHaveStyle(`border-bottom-width: 2px`) expect(tab).toHaveStyle( @@ -68,7 +68,7 @@ describe('NavTab', () => { expect(tab).toHaveStyle( `font-weight: ${String(TYPOGRAPHY.fontWeightSemiBold)}` ) - expect(tab).toHaveStyle(`color: ${String(COLORS.errorDisabled)}`) + expect(tab).toHaveStyle(`color: ${String(LEGACY_COLORS.errorDisabled)}`) }) it('renders navtab when pass to / as to', () => { diff --git a/app/src/molecules/NavTab/index.tsx b/app/src/molecules/NavTab/index.tsx index 4508165ea1c..3bd8e0290b7 100644 --- a/app/src/molecules/NavTab/index.tsx +++ b/app/src/molecules/NavTab/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { NavLink } from 'react-router-dom' import styled from 'styled-components' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '@opentrons/components' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '@opentrons/components' interface NavTabProps { to: string @@ -13,17 +13,17 @@ interface NavTabProps { const StyledNavLink = styled(NavLink)>` padding: 0 ${SPACING.spacing4} ${SPACING.spacing8}; ${TYPOGRAPHY.labelSemiBold} - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &.active { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; ${BORDERS.tabBorder} } ` const DisabledNavLink = styled.span` padding: 0 ${SPACING.spacing4} ${SPACING.spacing8}; ${TYPOGRAPHY.labelSemiBold} - color: ${COLORS.errorDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; ` export function NavTab({ diff --git a/app/src/molecules/ODDBackButton/__tests__/ODDBackButton.test.tsx b/app/src/molecules/ODDBackButton/__tests__/ODDBackButton.test.tsx index b57ff06f10e..608e531be8f 100644 --- a/app/src/molecules/ODDBackButton/__tests__/ODDBackButton.test.tsx +++ b/app/src/molecules/ODDBackButton/__tests__/ODDBackButton.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { fireEvent, screen } from '@testing-library/react' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { ODDBackButton } from '..' const render = (props: React.ComponentProps) => { @@ -26,7 +26,7 @@ describe('ODDBackButton', () => { screen.getByText('button label') expect(screen.getByTestId('back_icon')).toBeInTheDocument() const button = screen.getByRole('button') - expect(button).toHaveStyle(`background-color: ${COLORS.transparent}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.transparent}`) fireEvent.click(button) expect(props.onClick).toHaveBeenCalled() }) diff --git a/app/src/molecules/ODDBackButton/index.tsx b/app/src/molecules/ODDBackButton/index.tsx index 2ae66c94768..64036edd19b 100644 --- a/app/src/molecules/ODDBackButton/index.tsx +++ b/app/src/molecules/ODDBackButton/index.tsx @@ -5,7 +5,7 @@ import { Flex, Icon, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, } from '@opentrons/components' @@ -21,7 +21,7 @@ export function ODDBackButton( > = args => ( export const AlertIcon = Template.bind({}) AlertIcon.args = { - iconColor: COLORS.errorEnabled, + iconColor: LEGACY_COLORS.errorEnabled, header: 'Pipette still detected', subHeader: 'Are you sure you want to exit before detaching your pipette?', isSuccess: false, @@ -43,7 +43,7 @@ AlertIcon.args = { export const SuccessIcon = Template.bind({}) SuccessIcon.args = { - iconColor: COLORS.successEnabled, + iconColor: LEGACY_COLORS.successEnabled, header: 'Pipette still detected', subHeader: 'Are you sure you want to exit before detaching your pipette?', isSuccess: true, diff --git a/app/src/molecules/SimpleWizardBody/__tests__/SimpleWizardBody.test.tsx b/app/src/molecules/SimpleWizardBody/__tests__/SimpleWizardBody.test.tsx index 27f0bef3357..7283b7885ef 100644 --- a/app/src/molecules/SimpleWizardBody/__tests__/SimpleWizardBody.test.tsx +++ b/app/src/molecules/SimpleWizardBody/__tests__/SimpleWizardBody.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { Skeleton } from '../../../atoms/Skeleton' import { getIsOnDevice } from '../../../redux/config' import { SimpleWizardBody } from '..' @@ -19,7 +19,7 @@ describe('SimpleWizardBody', () => { let props: React.ComponentProps beforeEach(() => { props = { - iconColor: COLORS.errorText, + iconColor: LEGACY_COLORS.errorText, children:
children
, header: 'header', subHeader: 'subheader', diff --git a/app/src/molecules/ToggleGroup/useToggleGroup.tsx b/app/src/molecules/ToggleGroup/useToggleGroup.tsx index 6e2f349df11..79f00858ec0 100644 --- a/app/src/molecules/ToggleGroup/useToggleGroup.tsx +++ b/app/src/molecules/ToggleGroup/useToggleGroup.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { css } from 'styled-components' import { BORDERS, - COLORS, + LEGACY_COLORS, Flex, SPACING, PrimaryButton, @@ -25,23 +25,23 @@ const BUTTON_GROUP_STYLES = css` padding-bottom: 8px; &:focus { box-shadow: none; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; } &:hover { - background-color: ${COLORS.fundamentalsBackground}; - color: ${COLORS.black}; + background-color: ${LEGACY_COLORS.fundamentalsBackground}; + color: ${LEGACY_COLORS.black}; box-shadow: 0 0 0; } &.active { - background-color: ${COLORS.blueEnabled}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.blueEnabled}; + color: ${LEGACY_COLORS.white}; } &:disabled { background-color: inherit; - color: ${COLORS.errorDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; } } @@ -59,17 +59,17 @@ const BUTTON_GROUP_STYLES = css` const ACTIVE_STYLE = css` padding-left: ${SPACING.spacing8}; padding-right: ${SPACING.spacing8}; - background-color: ${COLORS.blueEnabled}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.blueEnabled}; + color: ${LEGACY_COLORS.white}; pointer-events: none; ` const DEFAULT_STYLE = css` padding-left: ${SPACING.spacing8}; padding-right: ${SPACING.spacing8}; - background-color: ${COLORS.white}; - color: ${COLORS.black}; - border: 1px ${COLORS.medGreyEnabled} solid; + background-color: ${LEGACY_COLORS.white}; + color: ${LEGACY_COLORS.black}; + border: 1px ${LEGACY_COLORS.medGreyEnabled} solid; ` export const useToggleGroup = ( diff --git a/app/src/molecules/UploadInput/index.tsx b/app/src/molecules/UploadInput/index.tsx index d3fe7571d93..207f62068b3 100644 --- a/app/src/molecules/UploadInput/index.tsx +++ b/app/src/molecules/UploadInput/index.tsx @@ -6,7 +6,7 @@ import { Flex, SPACING, BORDERS, - COLORS, + LEGACY_COLORS, SIZE_3, DIRECTION_COLUMN, ALIGN_CENTER, @@ -23,20 +23,20 @@ const StyledLabel = styled.label` align-items: ${ALIGN_CENTER}; width: 100%; padding: ${SPACING.spacing32}; - border: 2px dashed ${COLORS.medGreyEnabled}; + border: 2px dashed ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; text-align: center; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; &:hover, &:focus-within { - background-color: ${COLORS.lightBlue}; - border: 2px dashed ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; + border: 2px dashed ${LEGACY_COLORS.blueEnabled}; } ` const DRAG_OVER_STYLES = css` - background-color: ${COLORS.lightBlue}; - border: 2px dashed ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; + border: 2px dashed ${LEGACY_COLORS.blueEnabled}; ` const StyledInput = styled.input` @@ -120,7 +120,7 @@ export function UploadInput(props: UploadInputProps): JSX.Element | null { > diff --git a/app/src/molecules/WizardHeader/index.tsx b/app/src/molecules/WizardHeader/index.tsx index 146b3c85932..51d34e68112 100644 --- a/app/src/molecules/WizardHeader/index.tsx +++ b/app/src/molecules/WizardHeader/index.tsx @@ -8,7 +8,7 @@ import { Flex, JUSTIFY_SPACE_BETWEEN, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, RESPONSIVENESS, BORDERS, @@ -28,7 +28,7 @@ interface WizardHeaderProps { const EXIT_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; text-transform: ${TYPOGRAPHY.textTransformCapitalize}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { opacity: 70%; @@ -46,7 +46,7 @@ const EXIT_BUTTON_STYLE = css` } ` const BOX_STYLE = css` - background-color: ${COLORS.white} @media + background-color: ${LEGACY_COLORS.white} @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { border-radius: ${BORDERS.borderRadiusSize4}; } @@ -89,7 +89,7 @@ export const WizardHeader = (props: WizardHeaderProps): JSX.Element => {
{currentStep != null && totalSteps != null && currentStep > 0 ? ( - + {t('step', { current: currentStep, max: totalSteps })} ) : null} diff --git a/app/src/molecules/WizardRequiredEquipmentList/index.tsx b/app/src/molecules/WizardRequiredEquipmentList/index.tsx index 8d7bdac460c..47db7da6d0a 100644 --- a/app/src/molecules/WizardRequiredEquipmentList/index.tsx +++ b/app/src/molecules/WizardRequiredEquipmentList/index.tsx @@ -9,7 +9,7 @@ import { JUSTIFY_CENTER, JUSTIFY_SPACE_BETWEEN, SPACING, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_AROUND, TYPOGRAPHY, Box, @@ -71,7 +71,7 @@ export function WizardRequiredEquipmentList( {/* do not show divider after the last equipment in the list */} {index + 1 === Object.keys(equipmentList).length ? null : ( )} @@ -98,7 +98,7 @@ export function WizardRequiredEquipmentList( {footer} @@ -160,7 +160,7 @@ function RequiredEquipmentCard(props: RequiredEquipmentCardProps): JSX.Element { > {displayName} {subtitle != null ? ( - + {subtitle} ) : null} diff --git a/app/src/organisms/AddCustomLabwareSlideout/index.tsx b/app/src/organisms/AddCustomLabwareSlideout/index.tsx index da7f363c175..418fafec331 100644 --- a/app/src/organisms/AddCustomLabwareSlideout/index.tsx +++ b/app/src/organisms/AddCustomLabwareSlideout/index.tsx @@ -4,7 +4,7 @@ import { useTranslation, Trans } from 'react-i18next' import { Flex, Link, - COLORS, + LEGACY_COLORS, SPACING, DIRECTION_COLUMN, ALIGN_CENTER, @@ -65,7 +65,7 @@ export function AddCustomLabwareSlideout( components={{ a: ( dispatch(addCustomLabware())} role="button" /> diff --git a/app/src/organisms/AppSettings/ConnectRobotSlideout.tsx b/app/src/organisms/AppSettings/ConnectRobotSlideout.tsx index dd49d17f28a..d03e833aa31 100644 --- a/app/src/organisms/AppSettings/ConnectRobotSlideout.tsx +++ b/app/src/organisms/AppSettings/ConnectRobotSlideout.tsx @@ -9,7 +9,7 @@ import { DIRECTION_ROW, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, Icon, Link, PrimaryButton, @@ -105,7 +105,7 @@ export function ConnectRobotSlideout({ {t('searching')} @@ -118,7 +118,7 @@ export function ConnectRobotSlideout({ <> {t('discovery_timeout')} diff --git a/app/src/organisms/AppSettings/ManualIpHostnameForm.tsx b/app/src/organisms/AppSettings/ManualIpHostnameForm.tsx index 5abfd633962..f5a220ccf71 100644 --- a/app/src/organisms/AppSettings/ManualIpHostnameForm.tsx +++ b/app/src/organisms/AppSettings/ManualIpHostnameForm.tsx @@ -9,7 +9,7 @@ import { DIRECTION_COLUMN, TYPOGRAPHY, SPACING, - COLORS, + LEGACY_COLORS, SIZE_2, BORDERS, } from '@opentrons/components' @@ -32,18 +32,18 @@ const StyledInput = styled.input` width: 100%; flex: 6; margin: ${SPACING.spacing4} 0; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; border-radius: ${SPACING.spacing4}; - border: 1px ${BORDERS.styleSolid} ${COLORS.medGreyEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.medGreyEnabled}; height: ${SIZE_2}; font-size: ${TYPOGRAPHY.fontSizeP}; &:active { - border: 1px ${BORDERS.styleSolid} ${COLORS.darkGreyEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.darkGreyEnabled}; } &:hover { - border: 1px ${BORDERS.styleSolid} ${COLORS.blueEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.blueEnabled}; } &:focus-visible { @@ -51,7 +51,7 @@ const StyledInput = styled.input` } &:disabled { - border: 1px ${BORDERS.styleSolid} ${COLORS.darkGreyDisabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.darkGreyDisabled}; } ` @@ -79,7 +79,7 @@ export function ManualIpHostnameForm({ const ip = values.ip.trim() const inputForm = document.getElementById('ip') if (inputForm != null) - inputForm.style.border = `1px solid ${String(COLORS.medGreyEnabled)}` + inputForm.style.border = `1px solid ${String(LEGACY_COLORS.medGreyEnabled)}` addManualIpAndHostname(ip) resetForm() setMostRecentAddition(ip) @@ -92,7 +92,7 @@ export function ManualIpHostnameForm({ errors.ip = t('add_ip_error') const inputForm = document.getElementById('ip') if (inputForm != null) - inputForm.style.border = `1px solid ${String(COLORS.errorEnabled)}` + inputForm.style.border = `1px solid ${String(LEGACY_COLORS.errorEnabled)}` } return errors }, @@ -128,7 +128,7 @@ export function ManualIpHostnameForm({ {formik.errors.ip} diff --git a/app/src/organisms/AppSettings/ManualIpHostnameItem.tsx b/app/src/organisms/AppSettings/ManualIpHostnameItem.tsx index 2f5e2aba108..09810d8de43 100644 --- a/app/src/organisms/AppSettings/ManualIpHostnameItem.tsx +++ b/app/src/organisms/AppSettings/ManualIpHostnameItem.tsx @@ -5,7 +5,7 @@ import styled, { css } from 'styled-components' import { Btn, Icon, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, Flex, JUSTIFY_FLEX_START, @@ -28,10 +28,10 @@ const CLOSE_ICON_STYLE = css` border-radius: 50%; &:hover { - background: ${COLORS.lightGreyHover}; + background: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background: ${COLORS.lightGreyPressed}; + background: ${LEGACY_COLORS.lightGreyPressed}; } ` interface IpHostnameItemProps { @@ -84,7 +84,7 @@ export function ManualIpHostnameItem({ as="p" data-testid="ip-hostname" color={ - discovered ? COLORS.darkBlackEnabled : COLORS.successDisabled + discovered ? LEGACY_COLORS.darkBlackEnabled : LEGACY_COLORS.successDisabled } > {candidate} @@ -92,7 +92,7 @@ export function ManualIpHostnameItem({ 1 ? ( - + {t('calibration_on_opentrons_tips_is_important')} diff --git a/app/src/organisms/CalibrationPanels/CompleteConfirmation.tsx b/app/src/organisms/CalibrationPanels/CompleteConfirmation.tsx index 18a35bcc6c7..676da874ab1 100644 --- a/app/src/organisms/CalibrationPanels/CompleteConfirmation.tsx +++ b/app/src/organisms/CalibrationPanels/CompleteConfirmation.tsx @@ -9,7 +9,7 @@ import { SPACING, SIZE_3, JUSTIFY_CENTER, - COLORS, + LEGACY_COLORS, ALIGN_STRETCH, PrimaryButton, TYPOGRAPHY, @@ -44,7 +44,7 @@ export function CompleteConfirmation( {visualAid != null ? ( visualAid ) : ( - + )} {t('flow_complete', { flowName })} diff --git a/app/src/organisms/CalibrationPanels/ConfirmExit.tsx b/app/src/organisms/CalibrationPanels/ConfirmExit.tsx index abff685f924..c64043e9094 100644 --- a/app/src/organisms/CalibrationPanels/ConfirmExit.tsx +++ b/app/src/organisms/CalibrationPanels/ConfirmExit.tsx @@ -9,7 +9,7 @@ import { DIRECTION_COLUMN, JUSTIFY_SPACE_BETWEEN, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, AlertPrimaryButton, SecondaryButton, } from '@opentrons/components' @@ -43,7 +43,7 @@ export function ConfirmExit(props: ConfirmExitProps): JSX.Element { {heading != null ? ( diff --git a/app/src/organisms/CalibrationPanels/LoadingState.tsx b/app/src/organisms/CalibrationPanels/LoadingState.tsx index 8f6ed2e913e..7f6635dfad9 100644 --- a/app/src/organisms/CalibrationPanels/LoadingState.tsx +++ b/app/src/organisms/CalibrationPanels/LoadingState.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { Icon, Flex, - COLORS, + LEGACY_COLORS, SIZE_4, JUSTIFY_CENTER, ALIGN_CENTER, @@ -28,7 +28,7 @@ export function LoadingState(props: LoadingStateProps): JSX.Element { name="ot-spinner" spin size={SIZE_4} - color={COLORS.darkGreyEnabled} + color={LEGACY_COLORS.darkGreyEnabled} /> {header != null ? {header} : null} {body != null ? {body} : null} diff --git a/app/src/organisms/CalibrationPanels/NeedHelpLink.tsx b/app/src/organisms/CalibrationPanels/NeedHelpLink.tsx index cff91296dd4..80b3c704c90 100644 --- a/app/src/organisms/CalibrationPanels/NeedHelpLink.tsx +++ b/app/src/organisms/CalibrationPanels/NeedHelpLink.tsx @@ -4,7 +4,7 @@ import { Flex, Link, Icon, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, SIZE_1, ALIGN_CENTER, @@ -23,7 +23,7 @@ export function NeedHelpLink(props: NeedHelpLinkProps): JSX.Element { return ( diff --git a/app/src/organisms/CalibrationTaskList/index.tsx b/app/src/organisms/CalibrationTaskList/index.tsx index fad79643dea..a28685f0aba 100644 --- a/app/src/organisms/CalibrationTaskList/index.tsx +++ b/app/src/organisms/CalibrationTaskList/index.tsx @@ -5,7 +5,7 @@ import { useHistory } from 'react-router-dom' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -90,20 +90,20 @@ export function CalibrationTaskList({ }, [activeIndex, hasLaunchedWizard]) // start off assuming we are missing calibrations - let statusLabelBackgroundColor: string = COLORS.errorEnabled - let statusLabelIconColor: string = COLORS.errorEnabled + let statusLabelBackgroundColor: string = LEGACY_COLORS.errorEnabled + let statusLabelIconColor: string = LEGACY_COLORS.errorEnabled let statusLabelText = t('missing_calibration_data') // if the tasklist is empty, though, all calibrations are good if (taskListStatus === 'complete') { - statusLabelBackgroundColor = COLORS.successEnabled - statusLabelIconColor = COLORS.successEnabled + statusLabelBackgroundColor = LEGACY_COLORS.successEnabled + statusLabelIconColor = LEGACY_COLORS.successEnabled statusLabelText = t('calibration_complete') // if we have tasks and they are all marked bad, then we should // strongly suggest they re-do those calibrations } else if (taskListStatus === 'bad') { - statusLabelBackgroundColor = COLORS.warningEnabled - statusLabelIconColor = COLORS.warningEnabled + statusLabelBackgroundColor = LEGACY_COLORS.warningEnabled + statusLabelIconColor = LEGACY_COLORS.warningEnabled statusLabelText = t('calibration_recommended') } @@ -114,7 +114,7 @@ export function CalibrationTaskList({ history.push(`/devices/${robotName}/robot-settings/calibration`) } fullPage - backgroundColor={COLORS.fundamentalsBackground} + backgroundColor={LEGACY_COLORS.fundamentalsBackground} childrenPadding={`${SPACING.spacing16} ${SPACING.spacing24} ${SPACING.spacing24} ${SPACING.spacing4}`} css={css` width: 50rem; @@ -133,9 +133,9 @@ export function CalibrationTaskList({ alignItems={ALIGN_CENTER} > {exitBeforeDeckConfigCompletion ? ( - + ) : ( - + )} {exitBeforeDeckConfigCompletion @@ -166,10 +166,10 @@ export function CalibrationTaskList({ diff --git a/app/src/organisms/ChangePipette/CheckPipettesButton.tsx b/app/src/organisms/ChangePipette/CheckPipettesButton.tsx index d27342a2d0a..89623ed3efa 100644 --- a/app/src/organisms/ChangePipette/CheckPipettesButton.tsx +++ b/app/src/organisms/ChangePipette/CheckPipettesButton.tsx @@ -6,7 +6,7 @@ import { Icon, DIRECTION_ROW, Flex, - COLORS, + LEGACY_COLORS, ALIGN_CENTER, SPACING, SIZE_1, @@ -87,7 +87,7 @@ export function CheckPipettesButton( > {body} diff --git a/app/src/organisms/ChangePipette/ConfirmPipette.tsx b/app/src/organisms/ChangePipette/ConfirmPipette.tsx index 0e6e46211a1..bfe63fb339a 100644 --- a/app/src/organisms/ChangePipette/ConfirmPipette.tsx +++ b/app/src/organisms/ChangePipette/ConfirmPipette.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { - COLORS, + LEGACY_COLORS, SPACING, TEXT_TRANSFORM_CAPITALIZE, TYPOGRAPHY, @@ -125,8 +125,8 @@ export function ConfirmPipette(props: ConfirmPipetteProps): JSX.Element { diff --git a/app/src/organisms/CheckCalibration/ResultsSummary/CalibrationResult.tsx b/app/src/organisms/CheckCalibration/ResultsSummary/CalibrationResult.tsx index d22c452cfc3..29c83419a58 100644 --- a/app/src/organisms/CheckCalibration/ResultsSummary/CalibrationResult.tsx +++ b/app/src/organisms/CheckCalibration/ResultsSummary/CalibrationResult.tsx @@ -7,7 +7,7 @@ import { DIRECTION_ROW, JUSTIFY_SPACE_BETWEEN, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, BORDERS, SPACING, } from '@opentrons/components' @@ -16,7 +16,7 @@ import { StyledText } from '../../../atoms/text' import { RenderResult } from './RenderResult' export const RESULT_SUMMARY_STYLE = css` - border: 1px solid ${COLORS.medGreyEnabled}; + border: 1px solid ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; ` diff --git a/app/src/organisms/CheckCalibration/ResultsSummary/RenderMountInformation.tsx b/app/src/organisms/CheckCalibration/ResultsSummary/RenderMountInformation.tsx index 56f979d7af3..c96a8dd925d 100644 --- a/app/src/organisms/CheckCalibration/ResultsSummary/RenderMountInformation.tsx +++ b/app/src/organisms/CheckCalibration/ResultsSummary/RenderMountInformation.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, DIRECTION_COLUMN, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, } from '@opentrons/components' import { getPipetteModelSpecs } from '@opentrons/shared-data' @@ -32,7 +32,7 @@ export const RenderMountInformation = ({ {`${mount} MOUNT`} {pipette != null ? ( diff --git a/app/src/organisms/CheckCalibration/ResultsSummary/RenderResult.tsx b/app/src/organisms/CheckCalibration/ResultsSummary/RenderResult.tsx index 44e891c5ab9..8f93829b575 100644 --- a/app/src/organisms/CheckCalibration/ResultsSummary/RenderResult.tsx +++ b/app/src/organisms/CheckCalibration/ResultsSummary/RenderResult.tsx @@ -4,7 +4,7 @@ import { Flex, ALIGN_CENTER, Icon, - COLORS, + LEGACY_COLORS, SPACING, SIZE_1, } from '@opentrons/components' @@ -20,7 +20,7 @@ export const RenderResult = ({ isBadCal }: RenderResultProps): JSX.Element => { return ( {isBadCal ? t('recalibration_recommended') : t('good_calibration')} @@ -28,7 +28,7 @@ export const RenderResult = ({ isBadCal }: RenderResultProps): JSX.Element => { diff --git a/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/CalibrationHealthCheckResults.test.tsx b/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/CalibrationHealthCheckResults.test.tsx index f2746a7c439..78cfb5706e4 100644 --- a/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/CalibrationHealthCheckResults.test.tsx +++ b/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/CalibrationHealthCheckResults.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { renderWithProviders, COLORS, TYPOGRAPHY } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, TYPOGRAPHY } from '@opentrons/components' import { i18n } from '../../../../i18n' import { CalibrationHealthCheckResults } from '../CalibrationHealthCheckResults' @@ -23,12 +23,12 @@ describe('CalibrationHealthCheckResults', () => { const { getByText, getByTestId } = render(props) getByText('Calibration Health Check Results') const statusLabel = getByText('Calibration complete') - expect(statusLabel).toHaveStyle(`color: ${String(COLORS.darkBlackEnabled)}`) + expect(statusLabel).toHaveStyle(`color: ${String(LEGACY_COLORS.darkBlackEnabled)}`) expect(statusLabel).toHaveStyle( `font-weight: ${String(TYPOGRAPHY.fontWeightSemiBold)}` ) expect(getByTestId('status_circle')).toHaveStyle( - `color: ${String(COLORS.successEnabled)}` + `color: ${String(LEGACY_COLORS.successEnabled)}` ) expect(getByTestId('status_circle')).toHaveStyle(`height: 0.3125rem`) expect(getByTestId('status_circle')).toHaveStyle(`width: 0.3125rem`) @@ -39,7 +39,7 @@ describe('CalibrationHealthCheckResults', () => { const { getByText, getByTestId } = render(props) getByText('Calibration recommended') expect(getByTestId('status_circle')).toHaveStyle( - `color: ${String(COLORS.warningEnabled)}` + `color: ${String(LEGACY_COLORS.warningEnabled)}` ) }) }) diff --git a/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/RenderResult.test.tsx b/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/RenderResult.test.tsx index 36b8e3ff04c..492a3622106 100644 --- a/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/RenderResult.test.tsx +++ b/app/src/organisms/CheckCalibration/ResultsSummary/__tests__/RenderResult.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { renderWithProviders, COLORS, SIZE_1 } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS, SIZE_1 } from '@opentrons/components' import { i18n } from '../../../../i18n' import { RenderResult } from '../RenderResult' @@ -23,7 +23,7 @@ describe('RenderResult', () => { const { getByText, getByTestId } = render(props) getByText('Good calibration') const icon = getByTestId('RenderResult_icon') - expect(icon).toHaveStyle(`color: ${String(COLORS.successEnabled)}`) + expect(icon).toHaveStyle(`color: ${String(LEGACY_COLORS.successEnabled)}`) expect(icon).toHaveStyle(`height: ${String(SIZE_1)}`) expect(icon).toHaveStyle(`width: ${String(SIZE_1)}`) }) @@ -33,7 +33,7 @@ describe('RenderResult', () => { const { getByText, getByTestId } = render(props) getByText('Recalibration recommended') const icon = getByTestId('RenderResult_icon') - expect(icon).toHaveStyle(`color: ${String(COLORS.warningEnabled)}`) + expect(icon).toHaveStyle(`color: ${String(LEGACY_COLORS.warningEnabled)}`) expect(icon).toHaveStyle(`height: ${String(SIZE_1)}`) expect(icon).toHaveStyle(`width: ${String(SIZE_1)}`) }) diff --git a/app/src/organisms/ChildNavigation/index.tsx b/app/src/organisms/ChildNavigation/index.tsx index 09dcd3b2fa9..8a5965cdae8 100644 --- a/app/src/organisms/ChildNavigation/index.tsx +++ b/app/src/organisms/ChildNavigation/index.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, Flex, Icon, @@ -61,14 +61,14 @@ export function ChildNavigation({ top="0" left="0" width="100%" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} > - + {header} @@ -104,11 +104,11 @@ export function ChildNavigation({ const IconButton = styled('button')` border-radius: ${SPACING.spacing4}; max-height: 100%; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:disabled { background-color: transparent; diff --git a/app/src/organisms/ChooseProtocolSlideout/index.tsx b/app/src/organisms/ChooseProtocolSlideout/index.tsx index db6a00c9345..28528cda907 100644 --- a/app/src/organisms/ChooseProtocolSlideout/index.tsx +++ b/app/src/organisms/ChooseProtocolSlideout/index.tsx @@ -20,7 +20,7 @@ import { DISPLAY_BLOCK, Icon, PrimaryButton, - COLORS, + LEGACY_COLORS, ProtocolDeck, } from '@opentrons/components' @@ -215,7 +215,7 @@ function StoredProtocolList(props: StoredProtocolListProps): JSX.Element { ) : null} @@ -252,7 +252,7 @@ function StoredProtocolList(props: StoredProtocolListProps): JSX.Element { {runCreationError != null && isSelected ? ( - + ) : null} @@ -152,11 +152,11 @@ export function AvailableRobotOption( {isSelectedRobotOnDifferentSoftwareVersion && isSelected ? ( a { - color: ${COLORS.errorText}; + color: ${LEGACY_COLORS.errorText}; text-decoration: ${TYPOGRAPHY.textDecorationUnderline}; } `} diff --git a/app/src/organisms/ChooseRobotSlideout/index.tsx b/app/src/organisms/ChooseRobotSlideout/index.tsx index 763730ec8c1..ffd60ab27c3 100644 --- a/app/src/organisms/ChooseRobotSlideout/index.tsx +++ b/app/src/organisms/ChooseRobotSlideout/index.tsx @@ -9,7 +9,7 @@ import { Icon, Flex, Link, - COLORS, + LEGACY_COLORS, BORDERS, DIRECTION_COLUMN, DISPLAY_INLINE_BLOCK, @@ -184,7 +184,7 @@ export function ChooseRobotSlideout( {t('app_settings:searching')} @@ -193,7 +193,7 @@ export function ChooseRobotSlideout( name="ot-spinner" spin size="1.25rem" - color={COLORS.darkGreyEnabled} + color={LEGACY_COLORS.darkGreyEnabled} /> ) : ( @@ -212,7 +212,7 @@ export function ChooseRobotSlideout( css={css` ${BORDERS.cardOutlineBorder} &:hover { - border-color: ${COLORS.medGreyEnabled}; + border-color: ${LEGACY_COLORS.medGreyEnabled}; } `} flexDirection={DIRECTION_COLUMN} @@ -251,7 +251,7 @@ export function ChooseRobotSlideout( {runCreationError != null && isSelected && ( - + {showIdleOnly ? t('unavailable_or_busy_robot_not_listed', { count: unavailableCount + reducerBusyCount, diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx index 8ffb8c4e5b2..3aa977e8dd1 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/AddFixtureModal.tsx @@ -6,7 +6,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -215,7 +215,7 @@ export function AddFixtureModal({ alignItems={ALIGN_CENTER} justifyContent={JUSTIFY_SPACE_BETWEEN} padding={`${SPACING.spacing8} ${SPACING.spacing16}`} - backgroundColor={COLORS.medGreyEnabled} + backgroundColor={LEGACY_COLORS.medGreyEnabled} borderRadius={BORDERS.borderRadiusSize1} > @@ -251,39 +251,39 @@ export function AddFixtureModal({ } const FIXTURE_BUTTON_STYLE = css` - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; cursor: default; border-radius: ${BORDERS.borderRadiusSize3}; box-shadow: none; &:focus { - background-color: ${COLORS.light1Pressed}; + background-color: ${LEGACY_COLORS.light1Pressed}; box-shadow: none; } &:hover { border: none; box-shadow: none; - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; } &:active { - background-color: ${COLORS.light1Pressed}; + background-color: ${LEGACY_COLORS.light1Pressed}; } &:disabled { - background-color: ${COLORS.light1}; - color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.light1}; + color: ${LEGACY_COLORS.darkBlack60}; } ` const GO_BACK_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { opacity: 70%; diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx index a68690f1bdc..aa6869b94d9 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/DeckFixtureSetupInstructionsModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { ALIGN_FLEX_END, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -36,7 +36,7 @@ export function DeckFixtureSetupInstructionsModal({ const modalHeader: ModalHeaderBaseProps = { title: t('deck_fixture_setup_instructions'), iconName: 'information', - iconColor: COLORS.darkBlack100, + iconColor: LEGACY_COLORS.darkBlack100, hasExitIcon: true, onClick: () => setShowSetupInstructionsModal(false), } diff --git a/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx b/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx index 79736e1afa2..0e12daf99e8 100644 --- a/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx +++ b/app/src/organisms/DeviceDetailsDeckConfiguration/index.tsx @@ -6,7 +6,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DeckConfigurator, DIRECTION_COLUMN, DIRECTION_ROW, @@ -112,7 +112,7 @@ export function DeviceDetailsDeckConfiguration({ ) : null} ( {t('heater_shaker_is_shaking')} diff --git a/app/src/organisms/Devices/HeaterShakerWizard/HeaterShakerModuleCard.tsx b/app/src/organisms/Devices/HeaterShakerWizard/HeaterShakerModuleCard.tsx index ede66bcdfcb..09aefaa8a32 100644 --- a/app/src/organisms/Devices/HeaterShakerWizard/HeaterShakerModuleCard.tsx +++ b/app/src/organisms/Devices/HeaterShakerWizard/HeaterShakerModuleCard.tsx @@ -9,7 +9,7 @@ import { DIRECTION_COLUMN, SPACING, ALIGN_FLEX_START, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { getModuleDisplayName } from '@opentrons/shared-data' import { StyledText } from '../../../atoms/text' @@ -30,7 +30,7 @@ export const HeaterShakerModuleCard = ( return ( {getModuleDisplayName(module.moduleModel)} diff --git a/app/src/organisms/Devices/HistoricalProtocolRun.tsx b/app/src/organisms/Devices/HistoricalProtocolRun.tsx index 2d86cce40df..70488a33655 100644 --- a/app/src/organisms/Devices/HistoricalProtocolRun.tsx +++ b/app/src/organisms/Devices/HistoricalProtocolRun.tsx @@ -8,7 +8,7 @@ import { Box, Icon, SPACING, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_AROUND, ALIGN_CENTER, BORDERS, @@ -68,7 +68,7 @@ export function HistoricalProtocolRun( padding={SPACING.spacing8} borderTop={BORDERS.lineBorder} backgroundColor={ - run.status === 'running' ? COLORS.lightBlue : COLORS.white + run.status === 'running' ? LEGACY_COLORS.lightBlue : LEGACY_COLORS.white } width="100%" > @@ -129,7 +129,7 @@ export function HistoricalProtocolRun( {runStatus === 'running' && ( @@ -82,7 +82,7 @@ export function HistoricalProtocolRunOffsetDrawer( return ( @@ -143,7 +143,7 @@ export function HistoricalProtocolRunOffsetDrawer( key={index} justifyContent={JUSTIFY_FLEX_START} padding={SPACING.spacing8} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} marginY={SPACING.spacing8} > diff --git a/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx b/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx index 9c44ef4511f..10b0bc61c7f 100644 --- a/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx +++ b/app/src/organisms/Devices/HistoricalProtocolRunOverflowMenu.tsx @@ -10,7 +10,7 @@ import { ALIGN_FLEX_END, DIRECTION_COLUMN, POSITION_RELATIVE, - COLORS, + LEGACY_COLORS, useOnClickOutside, useHoverTooltip, Box, @@ -155,7 +155,7 @@ function MenuDropdown(props: MenuDropdownProps): JSX.Element { borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.3rem" right={0} flexDirection={DIRECTION_COLUMN} @@ -189,7 +189,7 @@ function MenuDropdown(props: MenuDropdownProps): JSX.Element { diff --git a/app/src/organisms/Devices/InstrumentsAndModules.tsx b/app/src/organisms/Devices/InstrumentsAndModules.tsx index 25007ca3d87..274f681b954 100644 --- a/app/src/organisms/Devices/InstrumentsAndModules.tsx +++ b/app/src/organisms/Devices/InstrumentsAndModules.tsx @@ -13,7 +13,7 @@ import { ModalShell, ALIGN_CENTER, ALIGN_FLEX_START, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_CENTER, SIZE_3, @@ -302,7 +302,7 @@ export function InstrumentsAndModules({ {/* TODO(bh, 2022-10-20): insert "offline" image when provided by illustrator */} {t('offline_instruments_and_modules')} diff --git a/app/src/organisms/Devices/ModuleInfo.tsx b/app/src/organisms/Devices/ModuleInfo.tsx index 2c84f16afff..fddd547d29c 100644 --- a/app/src/organisms/Devices/ModuleInfo.tsx +++ b/app/src/organisms/Devices/ModuleInfo.tsx @@ -5,7 +5,7 @@ import { Icon, RobotCoordsForeignObject, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, JUSTIFY_CENTER, @@ -63,8 +63,8 @@ export const ModuleInfo = (props: ModuleInfoProps): JSX.Element => { padding: SPACING.spacing16, backgroundColor: moduleDef.moduleType === THERMOCYCLER_MODULE_TYPE - ? COLORS.white - : COLORS.transparent, + ? LEGACY_COLORS.white + : LEGACY_COLORS.transparent, }} > { {!isAttached ? t('module_not_connected') : t('module_connected')} @@ -92,13 +92,13 @@ export const ModuleInfo = (props: ModuleInfoProps): JSX.Element => { ) : null} {getModuleDisplayName(moduleModel)} {i18n.format(t('current_version'), 'upperCase')} @@ -73,7 +73,7 @@ export const AboutPipetteSlideout = ( {i18n.format(t('serial_number'), 'upperCase')} diff --git a/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx b/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx index f28dd30ac87..18e51b694c3 100644 --- a/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx +++ b/app/src/organisms/Devices/PipetteCard/PipetteOverflowMenu.tsx @@ -5,7 +5,7 @@ import { Flex, POSITION_RELATIVE, POSITION_ABSOLUTE, - COLORS, + LEGACY_COLORS, SPACING, DIRECTION_COLUMN, } from '@opentrons/components' @@ -65,7 +65,7 @@ export const PipetteOverflowMenu = ( borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.6rem" right={`calc(50% + ${SPACING.spacing4})`} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/Devices/PipetteCard/index.tsx b/app/src/organisms/Devices/PipetteCard/index.tsx index 22291f7f903..1f85eede709 100644 --- a/app/src/organisms/Devices/PipetteCard/index.tsx +++ b/app/src/organisms/Devices/PipetteCard/index.tsx @@ -10,7 +10,7 @@ import { DIRECTION_COLUMN, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, useOnClickOutside, InstrumentDiagram, BORDERS, @@ -182,7 +182,7 @@ export const PipetteCard = (props: PipetteCardProps): JSX.Element => { } return ( { ) : null} + {label} diff --git a/app/src/organisms/Devices/ProtocolRun/LabwareInfoOverlay.tsx b/app/src/organisms/Devices/ProtocolRun/LabwareInfoOverlay.tsx index 3f8bd38d635..b9dd35aabbd 100644 --- a/app/src/organisms/Devices/ProtocolRun/LabwareInfoOverlay.tsx +++ b/app/src/organisms/Devices/ProtocolRun/LabwareInfoOverlay.tsx @@ -7,7 +7,7 @@ import { Flex, RobotCoordsForeignDiv, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, DISPLAY_FLEX, DIRECTION_COLUMN, @@ -47,11 +47,11 @@ const LabwareInfo = (props: LabwareInfoProps): JSX.Element | null => { return ( { {displayName ?? definitionDisplayName} {props.labwareHasLiquid && ( - + )} {vector != null && ( diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx index 6ab42b04935..5b338c0fdf4 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunHeader.tsx @@ -41,7 +41,7 @@ import { JUSTIFY_SPACE_BETWEEN, SIZE_1, BORDERS, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, PrimaryButton, @@ -312,7 +312,7 @@ export function ProtocolRunHeader({ ) : null} {displayName} @@ -412,7 +412,7 @@ export function ProtocolRunHeader({ {runStatus != null ? ( {t('connect_modules_to_see_controls')} diff --git a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx index 2734b4ee6e9..ed7316375b2 100644 --- a/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx +++ b/app/src/organisms/Devices/ProtocolRun/ProtocolRunSetup.tsx @@ -7,7 +7,7 @@ import { } from '@opentrons/api-client' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -252,7 +252,7 @@ export function ProtocolRunSetup({ ) : null} {analysisErrors != null && analysisErrors?.length > 0 ? ( - + {t('protocol_analysis_failed')} ) : ( @@ -313,7 +313,7 @@ export function ProtocolRunSetup({ )} ) : ( - + {t('loading_data')} )} @@ -372,15 +372,15 @@ function StepRightElement(props: StepRightElementProps): JSX.Element | null { size="1rem" color={ calibrationStatus?.complete - ? COLORS.successEnabled - : COLORS.warningEnabled + ? LEGACY_COLORS.successEnabled + : LEGACY_COLORS.warningEnabled } marginRight={SPACING.spacing8} name={calibrationStatus?.complete ? 'ot-check' : 'alert-circle'} id="RunSetupCard_calibrationIcon" /> {label != null && ( )} {title != null && ( - + {title} )} - + {calibrationDataNotAvailableText ?? subText ?? calibratedText} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupDeckCalibration.tsx b/app/src/organisms/Devices/ProtocolRun/SetupDeckCalibration.tsx index 73d2d2c3ad6..0db3257b70c 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupDeckCalibration.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupDeckCalibration.tsx @@ -8,7 +8,7 @@ import { DIRECTION_COLUMN, DIRECTION_ROW, JUSTIFY_SPACE_BETWEEN, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, } from '@opentrons/components' @@ -47,7 +47,7 @@ export function SetupDeckCalibration({ justifyContent={JUSTIFY_SPACE_BETWEEN} > diff --git a/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx b/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx index f83fed73fe6..238e0e7c07d 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupInstrumentCalibration.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, DIRECTION_COLUMN, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, } from '@opentrons/components' @@ -63,7 +63,7 @@ export function SetupInstrumentCalibration({ )} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx index 6abbbbc23a8..69d19fba8ad 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/CurrentOffsetsModal.tsx @@ -14,7 +14,7 @@ import { DIRECTION_COLUMN, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_BETWEEN, } from '@opentrons/components' @@ -48,7 +48,7 @@ const OffsetTableHeader = styled('th')` padding: ${SPACING.spacing4}; ` const OffsetTableRow = styled('tr')` - background-color: ${COLORS.fundamentalsBackground}; + background-color: ${LEGACY_COLORS.fundamentalsBackground}; padding: ${SPACING.spacing8}; ` diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx index b82c3d7b302..35e779692ab 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabware/LabwareListItem.tsx @@ -6,7 +6,7 @@ import { Flex, SPACING, Icon, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, DIRECTION_COLUMN, TYPOGRAPHY, @@ -56,7 +56,7 @@ const LabwareRow = styled.div` grid-template-columns: 1fr 6fr 5.9fr; border-style: ${BORDERS.styleSolid}; border-width: 1px; - border-color: ${COLORS.medGreyEnabled}; + border-color: ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; padding: ${SPACING.spacing16}; ` @@ -161,10 +161,10 @@ export function LabwareListItem( extraAttentionText = ( setSecureLabwareModalType(moduleType)} @@ -190,7 +190,7 @@ export function LabwareListItem( case HEATERSHAKER_MODULE_TYPE: isHeaterShakerInProtocol = true extraAttentionText = ( - + {t('heater_shaker_labware_list_view')} ) @@ -271,7 +271,7 @@ export function LabwareListItem( {labwareDisplayName} - + {nickName} @@ -293,7 +293,7 @@ export function LabwareListItem( {nestedLabwareInfo.nestedLabwareDisplayName} - + {nestedLabwareInfo.nestedLabwareNickName} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/CurrentOffsetsTable.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/CurrentOffsetsTable.tsx index c78d3b0b154..25f69917497 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/CurrentOffsetsTable.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/CurrentOffsetsTable.tsx @@ -13,7 +13,7 @@ import { DIRECTION_COLUMN, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_BETWEEN, } from '@opentrons/components' @@ -45,7 +45,7 @@ const OffsetTableHeader = styled('th')` padding: ${SPACING.spacing4}; ` const OffsetTableRow = styled('tr')` - background-color: ${COLORS.fundamentalsBackground}; + background-color: ${LEGACY_COLORS.fundamentalsBackground}; padding: ${SPACING.spacing8}; ` diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx index 71d0e55f4a3..b639ffd3161 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLabwarePositionCheck/index.tsx @@ -11,7 +11,7 @@ import { useHoverTooltip, SecondaryButton, PrimaryButton, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { useRunQuery, useProtocolQuery } from '@opentrons/react-api-client' import { useMostRecentCompletedAnalysis } from '../../../LabwarePositionCheck/useMostRecentCompletedAnalysis' @@ -99,7 +99,7 @@ export function SetupLabwarePositionCheck( diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx index 30ead6fc1aa..20c344d620d 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/LiquidDetailCard.tsx @@ -6,7 +6,7 @@ import { ALIGN_CENTER, BORDERS, Box, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -30,13 +30,13 @@ import { getWellRangeForLiquidLabwarePair } from './utils' const LIQUID_CARD_STYLE = css` ${BORDERS.cardOutlineBorder} &:hover { - border: 1px solid ${COLORS.medGreyHover}; + border: 1px solid ${LEGACY_COLORS.medGreyHover}; cursor: pointer; } ` const LIQUID_CARD_ODD_STYLE = css` - border-color: ${COLORS.medGreyEnabled}; - border: ${SPACING.spacing4} solid ${COLORS.medGreyEnabled}; + border-color: ${LEGACY_COLORS.medGreyEnabled}; + border: ${SPACING.spacing4} solid ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.borderRadiusSize3}; ` interface LiquidDetailCardProps { @@ -66,8 +66,8 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { const { t } = useTranslation('protocol_setup') const ACTIVE_STYLE = css` - background-color: ${isOnDevice ? COLORS.medBlue : COLORS.lightBlue}; - border: ${isOnDevice ? SPACING.spacing4 : `1px`} solid ${COLORS.blueEnabled}; + background-color: ${isOnDevice ? LEGACY_COLORS.medBlue : LEGACY_COLORS.lightBlue}; + border: ${isOnDevice ? SPACING.spacing4 : `1px`} solid ${LEGACY_COLORS.blueEnabled}; border-radius: ${isOnDevice ? BORDERS.borderRadiusSize3 : 0}; ` const volumePerWellRange = getWellRangeForLiquidLabwarePair( @@ -87,7 +87,7 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { setSelectedValue(liquidId)} width="19.875rem" minHeight="max-content" @@ -99,7 +99,7 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { padding={SPACING.spacing8} height="3rem" width="3rem" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} justifyContent={JUSTIFY_CENTER} alignItems={ALIGN_CENTER} > @@ -116,12 +116,12 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { {description != null ? description : null} {selectedValue === liquidId ? ( <> - + {well.wellName} {well.volume} {MICRO_LITERS} @@ -181,7 +181,7 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { css={selectedValue === liquidId ? ACTIVE_STYLE : LIQUID_CARD_STYLE} borderRadius={BORDERS.radiusSoftCorners} padding={SPACING.spacing16} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} onClick={handleSelectedValue} width="10.3rem" minHeight="max-content" @@ -196,7 +196,7 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { padding={SPACING.spacing8} height="max-content" width="max-content" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} > @@ -207,12 +207,12 @@ export function LiquidDetailCard(props: LiquidDetailCardProps): JSX.Element { > {displayName} - + {description != null ? description : null} @@ -193,14 +193,14 @@ export const LiquidsLabwareDetailsModal = ( {t('slot_number')} {slotName} @@ -212,14 +212,14 @@ export const LiquidsLabwareDetailsModal = ( {t('labware_name')} {labwareName} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx index 8538ec7ae10..aee30119b38 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupLiquids/SetupLiquidsList.tsx @@ -10,7 +10,7 @@ import { Flex, SPACING, Icon, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, DIRECTION_COLUMN, TYPOGRAPHY, @@ -52,7 +52,7 @@ const HIDE_SCROLLBAR = css` const LIQUID_BORDER_STYLE = css` border-style: ${BORDERS.styleSolid}; border-width: 1px; - border-color: ${COLORS.medGreyEnabled}; + border-color: ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; ` @@ -113,11 +113,11 @@ export function LiquidsListItem(props: LiquidsListItemProps): JSX.Element { &:hover { cursor: pointer; - border: 1px solid ${COLORS.medGreyHover}; + border: 1px solid ${LEGACY_COLORS.medGreyHover}; } ` const LIQUID_CARD_ITEM_STYLE = css` - border: 1px solid ${COLORS.white}; + border: 1px solid ${LEGACY_COLORS.white}; &:hover { cursor: pointer; ${BORDERS.cardOutlineBorder} @@ -132,7 +132,7 @@ export function LiquidsListItem(props: LiquidsListItemProps): JSX.Element { css={LIQUID_CARD_STYLE} padding={SPACING.spacing16} onClick={handleSetOpenItem} - backgroundColor={openItem ? COLORS.fundamentalsBackground : COLORS.white} + backgroundColor={openItem ? LEGACY_COLORS.fundamentalsBackground : LEGACY_COLORS.white} data-testid="LiquidsListItem_Row" > @@ -235,7 +235,7 @@ export function LiquidsListItem(props: LiquidsListItemProps): JSX.Element { {moduleModel != null ? t('on_adapter_in_mod', { @@ -296,7 +296,7 @@ export const LiquidsListItemDetails = ( css={LIQUID_BORDER_STYLE} padding={SPACING.spacing12} height="max-content" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} > @@ -311,14 +311,14 @@ export const LiquidsListItemDetails = ( {description != null ? description : null} { getAllByText(nestedTextMatcher('100 µL')) getAllByText(nestedTextMatcher('total volume')) expect(getByLabelText('liquidBox_odd')).toHaveStyle( - `border: ${SPACING.spacing4} solid ${COLORS.medGreyEnabled}` + `border: ${SPACING.spacing4} solid ${LEGACY_COLORS.medGreyEnabled}` ) }) }) diff --git a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx index be6b12b1d90..82a3c03def7 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupModuleAndDeck/LocationConflictModal.tsx @@ -13,7 +13,7 @@ import { SecondaryButton, Icon, DIRECTION_ROW, - COLORS, + LEGACY_COLORS, JUSTIFY_END, ALIGN_CENTER, Box, @@ -117,7 +117,7 @@ export const LocationConflictModal = ( hasExitIcon: true, onClick: onCloseClick, iconName: 'ot-alert', - iconColor: COLORS.warningEnabled, + iconColor: LEGACY_COLORS.warningEnabled, }} > @@ -150,7 +150,7 @@ export const LocationConflictModal = ( > - + {t('deck_conflict')} @@ -243,7 +243,7 @@ export const LocationConflictModal = ( > ) } else { statusLabel = ( ) } @@ -166,11 +166,11 @@ export function FixtureListItem({ ) : null} {t('no_usb_connection_required')} @@ -319,9 +319,9 @@ export function ModulesListItem({ let renderModuleStatus: JSX.Element = ( ) @@ -351,9 +351,9 @@ export function ModulesListItem({ renderModuleStatus = ( ) } @@ -383,11 +383,11 @@ export function ModulesListItem({ ) : null} {showModuleSetupModal && heaterShakerModuleFromProtocol != null ? ( {description} @@ -105,7 +105,7 @@ export function SetupStep({ {rightElement} diff --git a/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx b/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx index 765456d9c5f..99b6e440933 100644 --- a/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx +++ b/app/src/organisms/Devices/ProtocolRun/SetupTipLengthCalibrationButton.tsx @@ -11,7 +11,7 @@ import { SIZE_4, TEXT_ALIGN_CENTER, TOOLTIP_LEFT, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, } from '@opentrons/components' import { @@ -89,7 +89,7 @@ export function SetupTipLengthCalibrationButton({ const recalibrateLink = disableRecalibrate ? ( <> diff --git a/app/src/organisms/Devices/RecentProtocolRuns.tsx b/app/src/organisms/Devices/RecentProtocolRuns.tsx index b2bbfafc71c..f00d84ecbb8 100644 --- a/app/src/organisms/Devices/RecentProtocolRuns.tsx +++ b/app/src/organisms/Devices/RecentProtocolRuns.tsx @@ -9,7 +9,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_SPACE_AROUND, SIZE_4, @@ -42,7 +42,7 @@ export function RecentProtocolRuns({ return ( {t('modules')} @@ -185,7 +185,7 @@ function AttachedInstruments(props: { robotName: string }): JSX.Element { gridGap={SPACING.spacing4} minWidth="24rem" > - + {t('shared:instruments')} diff --git a/app/src/organisms/Devices/RobotOverflowMenu.tsx b/app/src/organisms/Devices/RobotOverflowMenu.tsx index 920ca366a23..6544eaf7ef8 100644 --- a/app/src/organisms/Devices/RobotOverflowMenu.tsx +++ b/app/src/organisms/Devices/RobotOverflowMenu.tsx @@ -5,7 +5,7 @@ import { Link } from 'react-router-dom' import { Flex, - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, DIRECTION_COLUMN, POSITION_RELATIVE, @@ -158,7 +158,7 @@ export function RobotOverflowMenu(props: RobotOverflowMenuProps): JSX.Element { borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.25rem" right="0" flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/Devices/RobotOverview.tsx b/app/src/organisms/Devices/RobotOverview.tsx index 0b03bb8a43e..4c250aa86a5 100644 --- a/app/src/organisms/Devices/RobotOverview.tsx +++ b/app/src/organisms/Devices/RobotOverview.tsx @@ -8,7 +8,7 @@ import { ALIGN_CENTER, ALIGN_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, JUSTIFY_SPACE_BETWEEN, @@ -87,7 +87,7 @@ export function RobotOverview({ <> {t('lights')} diff --git a/app/src/organisms/Devices/RobotOverviewOverflowMenu.tsx b/app/src/organisms/Devices/RobotOverviewOverflowMenu.tsx index 36da498324e..6f2ed07ef41 100644 --- a/app/src/organisms/Devices/RobotOverviewOverflowMenu.tsx +++ b/app/src/organisms/Devices/RobotOverviewOverflowMenu.tsx @@ -5,7 +5,7 @@ import { useDispatch, useSelector } from 'react-redux' import { BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, POSITION_ABSOLUTE, @@ -112,7 +112,7 @@ export const RobotOverviewOverflowMenu = ( borderRadius={BORDERS.radiusSoftCorners} boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.25rem" right={0} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx index 94b06376f56..788662a999d 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/DeviceResetSlideout.tsx @@ -8,7 +8,7 @@ import { BORDERS, Box, CheckboxField, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -168,17 +168,17 @@ export function DeviceResetSlideout({ {t('resets_cannot_be_undone')} diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/RenameRobotSlideout.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/RenameRobotSlideout.tsx index 8d9ef166665..3cbccf05bbb 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/RenameRobotSlideout.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/AdvancedTabSlideouts/RenameRobotSlideout.tsx @@ -8,7 +8,7 @@ import { DIRECTION_COLUMN, TYPOGRAPHY, SPACING, - COLORS, + LEGACY_COLORS, PrimaryButton, } from '@opentrons/components' import { useUpdateRobotNameMutation } from '@opentrons/react-api-client' @@ -170,13 +170,13 @@ export function RenameRobotSlideout({ value={formik.values.newRobotName} error={formik.errors.newRobotName && ' '} /> - + {t('characters_max')} {formik.errors.newRobotName && ( {formik.errors.newRobotName} diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/DisplayRobotName.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/DisplayRobotName.tsx index c254407690d..f455cd4e05b 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/DisplayRobotName.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/DisplayRobotName.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_BETWEEN, Box, SPACING, @@ -54,7 +54,7 @@ export function DisplayRobotName({ > {t('robot_name')} - + {robotName} diff --git a/app/src/organisms/Devices/RobotSettings/AdvancedTab/RobotServerVersion.tsx b/app/src/organisms/Devices/RobotSettings/AdvancedTab/RobotServerVersion.tsx index 4ab2fa7d979..4aec38c555f 100644 --- a/app/src/organisms/Devices/RobotSettings/AdvancedTab/RobotServerVersion.tsx +++ b/app/src/organisms/Devices/RobotSettings/AdvancedTab/RobotServerVersion.tsx @@ -8,7 +8,7 @@ import { Box, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, Link, JUSTIFY_FLEX_END, } from '@opentrons/components' @@ -82,7 +82,7 @@ export function RobotServerVersion({ {t('up_to_date')} diff --git a/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx b/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx index beb960ac507..033e90fba6e 100644 --- a/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx +++ b/app/src/organisms/Devices/RobotSettings/RobotSettingsNetworking.tsx @@ -9,7 +9,7 @@ import { Icon, useInterval, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, SPACING, SecondaryButton, @@ -110,7 +110,7 @@ export function RobotSettingsNetworking({ @@ -154,7 +154,7 @@ export function RobotSettingsNetworking({ {t('wireless_ip')} - + {wifi?.ipAddress} @@ -165,7 +165,7 @@ export function RobotSettingsNetworking({ {t('wireless_subnet_mask')} - + {wifi?.subnetMask} @@ -177,7 +177,7 @@ export function RobotSettingsNetworking({ {t('wireless_mac_address')} - + {wifi?.macAddress} @@ -195,7 +195,7 @@ export function RobotSettingsNetworking({ @@ -223,7 +223,7 @@ export function RobotSettingsNetworking({ {t('wired_ip')} - + {ethernet?.ipAddress} @@ -234,7 +234,7 @@ export function RobotSettingsNetworking({ {t('wired_subnet_mask')} - + {ethernet?.subnetMask} @@ -245,13 +245,13 @@ export function RobotSettingsNetworking({ {t('wired_mac_address')} - + {ethernet?.macAddress}
) : ( - + {isFlex ? t('not_connected_via_ethernet') : t('not_connected_via_wired_usb')} @@ -287,7 +287,7 @@ export function RobotSettingsNetworking({ @@ -305,7 +305,7 @@ export function RobotSettingsNetworking({
- + {isFlexConnectedViaUSB ? t('directly_connected_to_this_computer') : t('not_connected_via_usb')} diff --git a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx index 1c0333a508d..808cbbda89e 100644 --- a/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx +++ b/app/src/organisms/Devices/RobotSettings/UpdateBuildroot/RobotUpdateProgressModal.tsx @@ -9,7 +9,7 @@ import { NewPrimaryBtn, JUSTIFY_FLEX_END, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, SPACING, BORDERS, @@ -37,11 +37,11 @@ const UPDATE_PROGRESS_BAR_STYLE = css` margin-top: ${SPACING.spacing24}; margin-bottom: ${SPACING.spacing24}; border-radius: ${BORDERS.borderRadiusSize3}; - background: ${COLORS.medGreyEnabled}; + background: ${LEGACY_COLORS.medGreyEnabled}; width: 17.12rem; ` const UPDATE_TEXT_STYLE = css` - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; font-size: 0.8rem; ` const HIDDEN_CSS = css` @@ -217,7 +217,7 @@ function SuccessOrError({ errorMessage }: SuccessOrErrorProps): JSX.Element { ) diff --git a/app/src/organisms/Devices/RobotStatusHeader.tsx b/app/src/organisms/Devices/RobotStatusHeader.tsx index e2223fc33c1..ab85467d761 100644 --- a/app/src/organisms/Devices/RobotStatusHeader.tsx +++ b/app/src/organisms/Devices/RobotStatusHeader.tsx @@ -13,7 +13,7 @@ import { useHoverTooltip, useInterval, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_SPACE_BETWEEN, SPACING, @@ -153,7 +153,7 @@ export function RobotStatusHeader(props: RobotStatusHeaderProps): JSX.Element { diff --git a/app/src/organisms/DropTipWizard/BeforeBeginning.tsx b/app/src/organisms/DropTipWizard/BeforeBeginning.tsx index b5e2a6b00ca..231df703917 100644 --- a/app/src/organisms/DropTipWizard/BeforeBeginning.tsx +++ b/app/src/organisms/DropTipWizard/BeforeBeginning.tsx @@ -8,7 +8,7 @@ import { DIRECTION_COLUMN, TYPOGRAPHY, DIRECTION_ROW, - COLORS, + LEGACY_COLORS, BORDERS, JUSTIFY_CENTER, ALIGN_CENTER, @@ -185,8 +185,8 @@ export const BeforeBeginning = ( } const UNSELECTED_OPTIONS_STYLE = css` - background-color: ${COLORS.white}; - border: 1px solid ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.white}; + border: 1px solid ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; height: 12.5625rem; width: 14.5625rem; @@ -197,13 +197,13 @@ const UNSELECTED_OPTIONS_STYLE = css` grid-gap: ${SPACING.spacing8} &:hover { - border: 1px solid ${COLORS.medGreyHover}; + border: 1px solid ${LEGACY_COLORS.medGreyHover}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { flex-direction: ${DIRECTION_ROW}; justify-content: ${JUSTIFY_FLEX_START}; - background-color: ${COLORS.mediumBlueEnabled}; + background-color: ${LEGACY_COLORS.mediumBlueEnabled}; border-width: 0; border-radius: ${BORDERS.borderRadiusSize4}; padding: ${SPACING.spacing24}; @@ -217,20 +217,20 @@ const UNSELECTED_OPTIONS_STYLE = css` ` const SELECTED_OPTIONS_STYLE = css` ${UNSELECTED_OPTIONS_STYLE} - border: 1px solid ${COLORS.blueEnabled}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; &:hover { - border: 1px solid ${COLORS.blueEnabled}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { border-width: 0px; - background-color: ${COLORS.blueEnabled}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.blueEnabled}; + color: ${LEGACY_COLORS.white}; &:hover { border-width: 0px; - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; } } ` diff --git a/app/src/organisms/DropTipWizard/ChooseLocation.tsx b/app/src/organisms/DropTipWizard/ChooseLocation.tsx index d4919f803d4..59dc6a12f4e 100644 --- a/app/src/organisms/DropTipWizard/ChooseLocation.tsx +++ b/app/src/organisms/DropTipWizard/ChooseLocation.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import { Btn, Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, RESPONSIVENESS, @@ -171,7 +171,7 @@ const TILE_CONTAINER_STYLE = css` ` const GO_BACK_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { opacity: 70%; diff --git a/app/src/organisms/DropTipWizard/ExitConfirmation.tsx b/app/src/organisms/DropTipWizard/ExitConfirmation.tsx index 42f1a6f2d7d..5d5a2188778 100644 --- a/app/src/organisms/DropTipWizard/ExitConfirmation.tsx +++ b/app/src/organisms/DropTipWizard/ExitConfirmation.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux' import { useTranslation } from 'react-i18next' import { Flex, - COLORS, + LEGACY_COLORS, SPACING, AlertPrimaryButton, SecondaryButton, @@ -33,7 +33,7 @@ export function ExitConfirmation(props: ExitConfirmationProps): JSX.Element { return ( diff --git a/app/src/organisms/DropTipWizard/JogToPosition.tsx b/app/src/organisms/DropTipWizard/JogToPosition.tsx index a7814aff5d2..3bcffe3f1d1 100644 --- a/app/src/organisms/DropTipWizard/JogToPosition.tsx +++ b/app/src/organisms/DropTipWizard/JogToPosition.tsx @@ -15,7 +15,7 @@ import { ALIGN_FLEX_START, JUSTIFY_FLEX_END, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, TEXT_ALIGN_CENTER, Icon, ALIGN_FLEX_END, @@ -71,7 +71,7 @@ const ConfirmPosition = (props: ConfirmPositionProps): JSX.Element | null => { @@ -108,7 +108,7 @@ const ConfirmPosition = (props: ConfirmPositionProps): JSX.Element | null => { } else { return ( { return ( diff --git a/app/src/organisms/DropTipWizard/TipsAttachedModal.tsx b/app/src/organisms/DropTipWizard/TipsAttachedModal.tsx index e23aa9eb80d..64358665857 100644 --- a/app/src/organisms/DropTipWizard/TipsAttachedModal.tsx +++ b/app/src/organisms/DropTipWizard/TipsAttachedModal.tsx @@ -3,7 +3,7 @@ import { capitalize } from 'lodash' import NiceModal, { useModal } from '@ebay/nice-modal-react' import { Trans, useTranslation } from 'react-i18next' -import { Flex, COLORS, SPACING, DIRECTION_COLUMN } from '@opentrons/components' +import { Flex, LEGACY_COLORS, SPACING, DIRECTION_COLUMN } from '@opentrons/components' import { useCloseCurrentRun } from '../ProtocolUpload/hooks' import { SmallButton } from '../../atoms/buttons' @@ -48,7 +48,7 @@ const TipsAttachedModal = NiceModal.create( const tipsAttachedHeader: ModalHeaderBaseProps = { title: t('tips_are_attached'), iconName: 'ot-alert', - iconColor: COLORS.yellow2, + iconColor: LEGACY_COLORS.yellow2, } const is96Channel = instrumentModelSpecs.channels === 96 diff --git a/app/src/organisms/DropTipWizard/index.tsx b/app/src/organisms/DropTipWizard/index.tsx index e2829b40a61..5510ce8847f 100644 --- a/app/src/organisms/DropTipWizard/index.tsx +++ b/app/src/organisms/DropTipWizard/index.tsx @@ -7,7 +7,7 @@ import { Flex, DIRECTION_COLUMN, POSITION_ABSOLUTE, - COLORS, + LEGACY_COLORS, BORDERS, } from '@opentrons/components' import { @@ -351,7 +351,7 @@ export const DropTipWizardComponent = ( modalContent = ( @@ -524,7 +524,7 @@ export const DropTipWizardComponent = ( boxShadow={BORDERS.shadowSmall} borderRadius={BORDERS.borderRadiusSize4} position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} > {wizardHeader} {modalContent} diff --git a/app/src/organisms/EmergencyStop/EstopMissingModal.tsx b/app/src/organisms/EmergencyStop/EstopMissingModal.tsx index 9b7d1c00977..d09c68c8e91 100644 --- a/app/src/organisms/EmergencyStop/EstopMissingModal.tsx +++ b/app/src/organisms/EmergencyStop/EstopMissingModal.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux' import { useTranslation } from 'react-i18next' import { - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, SPACING, @@ -69,7 +69,7 @@ function TouchscreenModal({ const modalHeader: ModalHeaderBaseProps = { title: t('estop_missing'), iconName: 'ot-alert', - iconColor: COLORS.red2, + iconColor: LEGACY_COLORS.red2, } const modalProps = { header: { ...modalHeader }, diff --git a/app/src/organisms/EmergencyStop/EstopPressedModal.tsx b/app/src/organisms/EmergencyStop/EstopPressedModal.tsx index 4c573d4aa6a..2a11d1d114a 100644 --- a/app/src/organisms/EmergencyStop/EstopPressedModal.tsx +++ b/app/src/organisms/EmergencyStop/EstopPressedModal.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux' import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -78,7 +78,7 @@ function TouchscreenModal({ const modalHeader: ModalHeaderBaseProps = { title: t('estop_pressed'), iconName: 'ot-alert', - iconColor: COLORS.red2, + iconColor: LEGACY_COLORS.red2, } const modalProps = { header: { ...modalHeader }, @@ -169,7 +169,7 @@ function DesktopModal({ {isEngaged ? t('estop_engaged') : t('estop_disengaged')} - + {t('estop_pressed_description')} diff --git a/app/src/organisms/FirmwareUpdateModal/UpdateInProgressModal.tsx b/app/src/organisms/FirmwareUpdateModal/UpdateInProgressModal.tsx index c0cfee1e3ca..b04dcf636ce 100644 --- a/app/src/organisms/FirmwareUpdateModal/UpdateInProgressModal.tsx +++ b/app/src/organisms/FirmwareUpdateModal/UpdateInProgressModal.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, SPACING, @@ -21,7 +21,7 @@ interface UpdateInProgressModalProps { } const OUTER_STYLES = css` - background: ${COLORS.medGreyEnabled}; + background: ${LEGACY_COLORS.medGreyEnabled}; width: 100%; ` @@ -36,7 +36,7 @@ export function UpdateInProgressModal( diff --git a/app/src/organisms/FirmwareUpdateModal/index.tsx b/app/src/organisms/FirmwareUpdateModal/index.tsx index 1fb98a7901a..d92e8a66c26 100644 --- a/app/src/organisms/FirmwareUpdateModal/index.tsx +++ b/app/src/organisms/FirmwareUpdateModal/index.tsx @@ -10,7 +10,7 @@ import { RESPONSIVENESS, JUSTIFY_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { useInstrumentsQuery, @@ -57,15 +57,15 @@ const MODAL_STYLE = css` ` const OUTER_STYLES = css` border-radius: ${BORDERS.borderRadiusSize4}; - background: ${COLORS.medGreyEnabled}; + background: ${LEGACY_COLORS.medGreyEnabled}; width: 13.374rem; ` const SPINNER_STYLE = css` - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; opacity: 100%; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; opacity: 70%; } ` diff --git a/app/src/organisms/GripperCard/AboutGripperSlideout.tsx b/app/src/organisms/GripperCard/AboutGripperSlideout.tsx index 17691324083..669999c5f66 100644 --- a/app/src/organisms/GripperCard/AboutGripperSlideout.tsx +++ b/app/src/organisms/GripperCard/AboutGripperSlideout.tsx @@ -6,7 +6,7 @@ import { SPACING, PrimaryButton, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { StyledText } from '../../atoms/text' import { Slideout } from '../../atoms/Slideout' @@ -45,7 +45,7 @@ export const AboutGripperSlideout = ( {i18n.format(t('current_version'), 'upperCase')} @@ -61,7 +61,7 @@ export const AboutGripperSlideout = ( {i18n.format(t('serial_number'), 'upperCase')} diff --git a/app/src/organisms/GripperWizardFlows/BeforeBeginning.tsx b/app/src/organisms/GripperWizardFlows/BeforeBeginning.tsx index 60702fc724c..dab88905d99 100644 --- a/app/src/organisms/GripperWizardFlows/BeforeBeginning.tsx +++ b/app/src/organisms/GripperWizardFlows/BeforeBeginning.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { UseMutateFunction } from 'react-query' import { Trans, useTranslation } from 'react-i18next' -import { COLORS } from '@opentrons/components' +import { LEGACY_COLORS } from '@opentrons/components' import { EXTENSION } from '@opentrons/shared-data' import { StyledText } from '../../atoms/text' import { GenericWizardTile } from '../../molecules/GenericWizardTile' @@ -126,7 +126,7 @@ export const BeforeBeginning = ( return errorMessage != null ? ( diff --git a/app/src/organisms/GripperWizardFlows/ExitConfirmation.tsx b/app/src/organisms/GripperWizardFlows/ExitConfirmation.tsx index 7c2d08fae14..557fbb99e94 100644 --- a/app/src/organisms/GripperWizardFlows/ExitConfirmation.tsx +++ b/app/src/organisms/GripperWizardFlows/ExitConfirmation.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux' import { useTranslation } from 'react-i18next' import { Flex, - COLORS, + LEGACY_COLORS, SPACING, AlertPrimaryButton, SecondaryButton, @@ -44,7 +44,7 @@ export function ExitConfirmation(props: ExitConfirmationProps): JSX.Element { return ( { return errorMessage != null ? ( diff --git a/app/src/organisms/GripperWizardFlows/index.tsx b/app/src/organisms/GripperWizardFlows/index.tsx index f0001723c6f..83cc8f8678c 100644 --- a/app/src/organisms/GripperWizardFlows/index.tsx +++ b/app/src/organisms/GripperWizardFlows/index.tsx @@ -7,7 +7,7 @@ import { Flex, DIRECTION_COLUMN, POSITION_ABSOLUTE, - COLORS, + LEGACY_COLORS, BORDERS, } from '@opentrons/components' import { @@ -359,7 +359,7 @@ export const GripperWizard = ( boxShadow={BORDERS.shadowSmall} borderRadius={BORDERS.borderRadiusSize4} position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} > {wizardHeader} {modalContent} diff --git a/app/src/organisms/InstrumentInfo/index.tsx b/app/src/organisms/InstrumentInfo/index.tsx index 386a0d492c4..4869b3b94b0 100644 --- a/app/src/organisms/InstrumentInfo/index.tsx +++ b/app/src/organisms/InstrumentInfo/index.tsx @@ -5,7 +5,7 @@ import { DIRECTION_COLUMN, Flex, BORDERS, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_BETWEEN, SPACING, TYPOGRAPHY, @@ -185,7 +185,7 @@ function InfoItem(props: InfoItemProps): JSX.Element { return ( diff --git a/app/src/organisms/InstrumentMountItem/LabeledMount.tsx b/app/src/organisms/InstrumentMountItem/LabeledMount.tsx index b148e751cc7..2b097abb3d4 100644 --- a/app/src/organisms/InstrumentMountItem/LabeledMount.tsx +++ b/app/src/organisms/InstrumentMountItem/LabeledMount.tsx @@ -7,7 +7,7 @@ import { SPACING, TEXT_TRANSFORM_CAPITALIZE, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_BETWEEN, Icon, DIRECTION_COLUMN, @@ -25,10 +25,10 @@ const MountButton = styled.button<{ isAttached: boolean }>` padding: ${SPACING.spacing24}; border-radius: ${BORDERS.borderRadiusSize3}; background-color: ${({ isAttached }) => - isAttached ? COLORS.green3 : COLORS.light1}; + isAttached ? LEGACY_COLORS.green3 : LEGACY_COLORS.light1}; &:active { background-color: ${({ isAttached }) => - isAttached ? COLORS.green3Pressed : COLORS.light1Pressed}; + isAttached ? LEGACY_COLORS.green3Pressed : LEGACY_COLORS.light1Pressed}; } ` interface LabeledMountProps { @@ -69,7 +69,7 @@ export function LabeledMount(props: LabeledMountProps): JSX.Element { ` padding: ${SPACING.spacing16} ${SPACING.spacing24}; border-radius: ${BORDERS.borderRadiusSize3}; background-color: ${({ isReady }) => - isReady ? COLORS.green3 : COLORS.yellow3}; + isReady ? LEGACY_COLORS.green3 : LEGACY_COLORS.yellow3}; &:active { background-color: ${({ isReady }) => - isReady ? COLORS.green3Pressed : COLORS.yellow3Pressed}; + isReady ? LEGACY_COLORS.green3Pressed : LEGACY_COLORS.yellow3Pressed}; } ` interface ProtocolInstrumentMountItemProps { @@ -130,10 +130,10 @@ export function ProtocolInstrumentMountItem( {i18n.format( t(isAttachedWithCal ? 'calibrated' : 'no_data'), diff --git a/app/src/organisms/InterventionModal/InterventionCommandMessage.tsx b/app/src/organisms/InterventionModal/InterventionCommandMessage.tsx index 36582eb2524..b286ca86ba8 100644 --- a/app/src/organisms/InterventionModal/InterventionCommandMessage.tsx +++ b/app/src/organisms/InterventionModal/InterventionCommandMessage.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { css } from 'styled-components' import { - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, RESPONSIVENESS, @@ -24,11 +24,11 @@ const INTERVENTION_COMMAND_STYLE = css` const INTERVENTION_COMMAND_NOTES_STYLE = css` ${TYPOGRAPHY.h6Default} - color: ${COLORS.errorDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; text-transform: ${TEXT_TRANSFORM_UPPERCASE}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { ${TYPOGRAPHY.smallBodyTextBold} - color: ${COLORS.darkBlack100}; + color: ${LEGACY_COLORS.darkBlack100}; text-transform: ${TEXT_TRANSFORM_CAPITALIZE}; } ` diff --git a/app/src/organisms/InterventionModal/LabwareDisabledOverlay.tsx b/app/src/organisms/InterventionModal/LabwareDisabledOverlay.tsx index c9a2ad6ef9d..77846d4fa84 100644 --- a/app/src/organisms/InterventionModal/LabwareDisabledOverlay.tsx +++ b/app/src/organisms/InterventionModal/LabwareDisabledOverlay.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { COLORS } from '@opentrons/components' +import { LEGACY_COLORS } from '@opentrons/components' import type { LabwareDefinition2 } from '@opentrons/shared-data' @@ -19,7 +19,7 @@ export function LabwareDisabledOverlay({ width={definition.dimensions.xDimension} height={definition.dimensions.yDimension} rx={6} - fill={COLORS.white} + fill={LEGACY_COLORS.white} fillOpacity={0.9} /> diff --git a/app/src/organisms/InterventionModal/MoveLabwareInterventionContent.tsx b/app/src/organisms/InterventionModal/MoveLabwareInterventionContent.tsx index 958a296d657..5f7e4d97be6 100644 --- a/app/src/organisms/InterventionModal/MoveLabwareInterventionContent.tsx +++ b/app/src/organisms/InterventionModal/MoveLabwareInterventionContent.tsx @@ -7,7 +7,7 @@ import { ALIGN_CENTER, Icon, SPACING, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, TYPOGRAPHY, BORDERS, @@ -54,10 +54,10 @@ const LABWARE_DESCRIPTION_STYLE = css` flex-direction: ${DIRECTION_COLUMN}; grid-gap: ${SPACING.spacing8}; padding: ${SPACING.spacing16}; - background-color: ${COLORS.fundamentalsBackground}; + background-color: ${LEGACY_COLORS.fundamentalsBackground}; border-radius: ${BORDERS.radiusSoftCorners}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; border-radius: ${BORDERS.borderRadiusSize3}; } ` @@ -70,10 +70,10 @@ const LABWARE_NAME_TITLE_STYLE = css` ` const LABWARE_NAME_STYLE = css` - color: ${COLORS.errorDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { ${TYPOGRAPHY.bodyTextBold} - color: ${COLORS.darkBlack100}; + color: ${LEGACY_COLORS.darkBlack100}; } ` @@ -192,7 +192,7 @@ export function MoveLabwareInterventionContent({ diff --git a/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx b/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx index a0f321f9463..eb4f168a685 100644 --- a/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx +++ b/app/src/organisms/LabwareCard/CustomLabwareOverflowMenu.tsx @@ -10,7 +10,7 @@ import { Icon, useConditionalConfirm, SPACING, - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, AlertPrimaryButton, DIRECTION_COLUMN, @@ -111,7 +111,7 @@ export function CustomLabwareOverflowMenu( borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top={SPACING.spacing32} right={0} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/LabwareCard/index.tsx b/app/src/organisms/LabwareCard/index.tsx index dbc90285ecc..0b5744d048b 100644 --- a/app/src/organisms/LabwareCard/index.tsx +++ b/app/src/organisms/LabwareCard/index.tsx @@ -12,7 +12,7 @@ import { SPACING, TYPOGRAPHY, BORDERS, - COLORS, + LEGACY_COLORS, JUSTIFY_SPACE_BETWEEN, DIRECTION_COLUMN, ALIGN_FLEX_END, @@ -38,8 +38,8 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element { return ( {t('custom_def')} @@ -86,7 +86,7 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element { ) : ( @@ -104,7 +104,7 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element { {t('api_name')} @@ -131,14 +131,14 @@ export function LabwareCard(props: LabwareCardProps): JSX.Element { {t('date_added')} {format(new Date(modified), 'MM/dd/yyyy')} diff --git a/app/src/organisms/LabwareDetails/ManufacturerDetails.tsx b/app/src/organisms/LabwareDetails/ManufacturerDetails.tsx index acb59d4438e..df298346720 100644 --- a/app/src/organisms/LabwareDetails/ManufacturerDetails.tsx +++ b/app/src/organisms/LabwareDetails/ManufacturerDetails.tsx @@ -5,7 +5,7 @@ import { Box, Icon, Link, - COLORS, + LEGACY_COLORS, SPACING, DIRECTION_COLUMN, DIRECTION_ROW, @@ -29,7 +29,7 @@ export function ManufacturerDetails( return ( - + {label} {value} diff --git a/app/src/organisms/LabwareDetails/index.tsx b/app/src/organisms/LabwareDetails/index.tsx index 2005c1b8a62..430c5523ccf 100644 --- a/app/src/organisms/LabwareDetails/index.tsx +++ b/app/src/organisms/LabwareDetails/index.tsx @@ -9,7 +9,7 @@ import { Icon, Flex, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, BORDERS, DIRECTION_COLUMN, @@ -40,21 +40,21 @@ const CLOSE_ICON_STYLE = css` border-radius: 50%; &:hover { - background: ${COLORS.lightGreyHover}; + background: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background: ${COLORS.lightGreyPressed}; + background: ${LEGACY_COLORS.lightGreyPressed}; } ` const COPY_ICON_STYLE = css` transform: translateY(${SPACING.spacing4}); &:hover { - color: ${COLORS.blueEnabled}; + color: ${LEGACY_COLORS.blueEnabled}; } &:active, &:focus { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; } ` @@ -123,7 +123,7 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { {!isCustomDefinition && ( {' '} @@ -145,7 +145,7 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { > {t('last_updated')} {format(new Date(modified), 'MM/dd/yyyy')} @@ -163,7 +163,7 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { @@ -175,7 +175,7 @@ export function LabwareDetails(props: LabwareDetailsProps): JSX.Element { aria-label="copy" > - + {apiName} diff --git a/app/src/organisms/LabwareOffsetTabs/index.tsx b/app/src/organisms/LabwareOffsetTabs/index.tsx index beb72102901..72479bcabbf 100644 --- a/app/src/organisms/LabwareOffsetTabs/index.tsx +++ b/app/src/organisms/LabwareOffsetTabs/index.tsx @@ -5,7 +5,7 @@ import { DIRECTION_COLUMN, SPACING, Box, - COLORS, + LEGACY_COLORS, BORDERS, RoundTab, } from '@opentrons/components' @@ -64,7 +64,7 @@ export function LabwareOffsetTabs({ { alignItems={ALIGN_CENTER} paddingX={SPACING.spacing32} > - + {isOnDevice ? ( <> @@ -140,5 +140,5 @@ const ConfirmationBodyODD = styled.h1` @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { ${TYPOGRAPHY.level4HeaderRegular} } - color: ${COLORS.darkBlack70}; + color: ${LEGACY_COLORS.darkBlack70}; ` diff --git a/app/src/organisms/LabwarePositionCheck/FatalErrorModal.tsx b/app/src/organisms/LabwarePositionCheck/FatalErrorModal.tsx index 6989dca48c9..21415bacd25 100644 --- a/app/src/organisms/LabwarePositionCheck/FatalErrorModal.tsx +++ b/app/src/organisms/LabwarePositionCheck/FatalErrorModal.tsx @@ -3,7 +3,7 @@ import styled from 'styled-components' import { useTranslation } from 'react-i18next' import { Icon, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, PrimaryButton, @@ -52,7 +52,7 @@ export function FatalErrorModal(props: FatalErrorModalProps): JSX.Element { diff --git a/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx b/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx index d5cf8dc0ee6..8b00cc5b7e8 100644 --- a/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx +++ b/app/src/organisms/LabwarePositionCheck/IntroScreen/index.tsx @@ -20,7 +20,7 @@ import { ALIGN_CENTER, Box, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -139,7 +139,7 @@ export const IntroScreen = (props: { const VIEW_OFFSETS_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; font-size: ${TYPOGRAPHY.fontSize22}; &:hover { opacity: 100%; @@ -167,7 +167,7 @@ function ViewOffsets(props: ViewOffsetsProps): JSX.Element { css={VIEW_OFFSETS_BUTTON_STYLE} aria-label="show labware offsets" > - + {i18n.format(t('view_current_offsets'), 'capitalize')} diff --git a/app/src/organisms/LabwarePositionCheck/JogToWell.tsx b/app/src/organisms/LabwarePositionCheck/JogToWell.tsx index 4e91343b85a..cf40e4ba282 100644 --- a/app/src/organisms/LabwarePositionCheck/JogToWell.tsx +++ b/app/src/organisms/LabwarePositionCheck/JogToWell.tsx @@ -11,7 +11,7 @@ import { ALIGN_CENTER, DIRECTION_COLUMN, SPACING, - COLORS, + LEGACY_COLORS, WELL_LABEL_OPTIONS, ALIGN_FLEX_START, PrimaryButton, @@ -104,7 +104,7 @@ export const JogToWell = (props: JogToWellProps): JSX.Element | null => { } const wellStroke: WellStroke = wellsToHighlight.reduce( - (acc, wellName) => ({ ...acc, [wellName]: COLORS.blueEnabled }), + (acc, wellName) => ({ ...acc, [wellName]: LEGACY_COLORS.blueEnabled }), {} ) @@ -144,8 +144,8 @@ export const JogToWell = (props: JogToWellProps): JSX.Element | null => { wellStroke={wellStroke} wellLabelOption={WELL_LABEL_OPTIONS.SHOW_LABEL_OUTSIDE} highlightedWellLabels={{ wells: wellsToHighlight }} - labwareStroke={COLORS.medGreyEnabled} - wellLabelColor={COLORS.medGreyEnabled} + labwareStroke={LEGACY_COLORS.medGreyEnabled} + wellLabelColor={LEGACY_COLORS.medGreyEnabled} /> {header != null ? {header} : null} {body != null ? {body} : null} diff --git a/app/src/organisms/LabwarePositionCheck/TipConfirmation.tsx b/app/src/organisms/LabwarePositionCheck/TipConfirmation.tsx index 16a00fa61de..af0e63d98b9 100644 --- a/app/src/organisms/LabwarePositionCheck/TipConfirmation.tsx +++ b/app/src/organisms/LabwarePositionCheck/TipConfirmation.tsx @@ -7,7 +7,7 @@ import { JUSTIFY_SPACE_BETWEEN, SPACING, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, JUSTIFY_FLEX_END, } from '@opentrons/components' import { useTranslation } from 'react-i18next' @@ -35,7 +35,7 @@ export function TipConfirmation(props: TipConfirmationProps): JSX.Element { return isOnDevice ? ( {i18n.format(t('current_version'), 'upperCase')} @@ -117,7 +117,7 @@ export const AboutModuleSlideout = ( diff --git a/app/src/organisms/ModuleCard/HeaterShakerModuleData.tsx b/app/src/organisms/ModuleCard/HeaterShakerModuleData.tsx index a62755ccf79..2a3361ef4d3 100644 --- a/app/src/organisms/ModuleCard/HeaterShakerModuleData.tsx +++ b/app/src/organisms/ModuleCard/HeaterShakerModuleData.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, SPACING, Icon, @@ -36,35 +36,35 @@ export const HeaterShakerModuleData = ( status: SpeedStatus | TemperatureStatus ): { backgroundColor: string; iconColor: string; textColor: string } => { const StatusLabelProps = { - backgroundColor: COLORS.medGreyEnabled, - iconColor: COLORS.darkGreyEnabled, - textColor: COLORS.bluePressed, + backgroundColor: LEGACY_COLORS.medGreyEnabled, + iconColor: LEGACY_COLORS.darkGreyEnabled, + textColor: LEGACY_COLORS.bluePressed, pulse: false, } switch (status) { case 'idle': { - StatusLabelProps.backgroundColor = COLORS.medGreyEnabled - StatusLabelProps.iconColor = COLORS.darkGreyEnabled - StatusLabelProps.textColor = COLORS.darkBlackEnabled + StatusLabelProps.backgroundColor = LEGACY_COLORS.medGreyEnabled + StatusLabelProps.iconColor = LEGACY_COLORS.darkGreyEnabled + StatusLabelProps.textColor = LEGACY_COLORS.darkBlackEnabled break } case 'holding at target': { - StatusLabelProps.backgroundColor = COLORS.medBlue - StatusLabelProps.iconColor = COLORS.blueEnabled + StatusLabelProps.backgroundColor = LEGACY_COLORS.medBlue + StatusLabelProps.iconColor = LEGACY_COLORS.blueEnabled break } case 'error': { - StatusLabelProps.backgroundColor = COLORS.warningBackgroundLight - StatusLabelProps.iconColor = COLORS.warningEnabled - StatusLabelProps.textColor = COLORS.warningText + StatusLabelProps.backgroundColor = LEGACY_COLORS.warningBackgroundLight + StatusLabelProps.iconColor = LEGACY_COLORS.warningEnabled + StatusLabelProps.textColor = LEGACY_COLORS.warningText break } case 'heating': case 'cooling': case 'slowing down': case 'speeding up': { - StatusLabelProps.backgroundColor = COLORS.blueEnabled + '1A' + StatusLabelProps.backgroundColor = LEGACY_COLORS.blueEnabled + '1A' StatusLabelProps.pulse = true break } @@ -114,7 +114,7 @@ export const HeaterShakerModuleData = ( > {t('set_block_temp')} diff --git a/app/src/organisms/ModuleCard/MagneticModuleData.tsx b/app/src/organisms/ModuleCard/MagneticModuleData.tsx index a2fc7178d19..25eec703160 100644 --- a/app/src/organisms/ModuleCard/MagneticModuleData.tsx +++ b/app/src/organisms/ModuleCard/MagneticModuleData.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' -import { COLORS, TYPOGRAPHY } from '@opentrons/components' +import { LEGACY_COLORS, TYPOGRAPHY } from '@opentrons/components' import { MAGNETIC_MODULE_V1, MAGNETIC_MODULE_V2, @@ -25,8 +25,8 @@ export const MagneticModuleData = ( <> {t('set_engage_height')} diff --git a/app/src/organisms/ModuleCard/TemperatureModuleData.tsx b/app/src/organisms/ModuleCard/TemperatureModuleData.tsx index 6cafe0a4b1e..03df73158e4 100644 --- a/app/src/organisms/ModuleCard/TemperatureModuleData.tsx +++ b/app/src/organisms/ModuleCard/TemperatureModuleData.tsx @@ -4,7 +4,7 @@ import { DIRECTION_COLUMN, Flex, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, } from '@opentrons/components' import { StatusLabel } from '../../atoms/StatusLabel' @@ -23,25 +23,25 @@ export const TemperatureModuleData = ( const { moduleStatus, targetTemp, currentTemp } = props const { t } = useTranslation('device_details') - let backgroundColor: string = COLORS.medGreyEnabled - let iconColor: string = COLORS.darkGreyEnabled + let backgroundColor: string = LEGACY_COLORS.medGreyEnabled + let iconColor: string = LEGACY_COLORS.darkGreyEnabled let textColor let pulse switch (moduleStatus) { case 'idle': { - backgroundColor = COLORS.medGreyEnabled - iconColor = COLORS.darkGreyEnabled - textColor = COLORS.darkBlackEnabled + backgroundColor = LEGACY_COLORS.medGreyEnabled + iconColor = LEGACY_COLORS.darkGreyEnabled + textColor = LEGACY_COLORS.darkBlackEnabled break } case 'holding at target': { - backgroundColor = COLORS.medBlue - iconColor = COLORS.blueEnabled + backgroundColor = LEGACY_COLORS.medBlue + iconColor = LEGACY_COLORS.blueEnabled break } case 'cooling': case 'heating': { - backgroundColor = COLORS.medBlue + backgroundColor = LEGACY_COLORS.medBlue pulse = true break } diff --git a/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx b/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx index 0b02270c931..0b6ba1d3bd6 100644 --- a/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx +++ b/app/src/organisms/ModuleCard/TemperatureModuleSlideout.tsx @@ -5,7 +5,7 @@ import { Flex, TYPOGRAPHY, SPACING, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, } from '@opentrons/components' import { @@ -95,7 +95,7 @@ export const TemperatureModuleSlideout = ( {t('set_temperature')} diff --git a/app/src/organisms/ModuleCard/TestShakeSlideout.tsx b/app/src/organisms/ModuleCard/TestShakeSlideout.tsx index 62343841bce..2406c8df6f6 100644 --- a/app/src/organisms/ModuleCard/TestShakeSlideout.tsx +++ b/app/src/organisms/ModuleCard/TestShakeSlideout.tsx @@ -6,7 +6,7 @@ import { Flex, TYPOGRAPHY, SPACING, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Icon, DIRECTION_ROW, @@ -168,14 +168,14 @@ export const TestShakeSlideout = ( - + ) : null} - + diff --git a/app/src/organisms/ModuleCard/ThermocyclerModuleData.tsx b/app/src/organisms/ModuleCard/ThermocyclerModuleData.tsx index 1117b509b01..f28fbe19fd6 100644 --- a/app/src/organisms/ModuleCard/ThermocyclerModuleData.tsx +++ b/app/src/organisms/ModuleCard/ThermocyclerModuleData.tsx @@ -6,7 +6,7 @@ import { TYPOGRAPHY, FONT_WEIGHT_REGULAR, DIRECTION_COLUMN, - COLORS, + LEGACY_COLORS, SPACING, WRAP, Box, @@ -34,35 +34,35 @@ export const ThermocyclerModuleData = ( textColor: string } => { const StatusLabelProps = { - backgroundColor: COLORS.medGreyEnabled, - iconColor: COLORS.darkGreyEnabled, - textColor: COLORS.bluePressed, + backgroundColor: LEGACY_COLORS.medGreyEnabled, + iconColor: LEGACY_COLORS.darkGreyEnabled, + textColor: LEGACY_COLORS.bluePressed, pulse: false, } switch (status) { case 'idle': { - StatusLabelProps.backgroundColor = COLORS.medGreyEnabled - StatusLabelProps.iconColor = COLORS.darkGreyEnabled - StatusLabelProps.textColor = COLORS.darkBlackEnabled + StatusLabelProps.backgroundColor = LEGACY_COLORS.medGreyEnabled + StatusLabelProps.iconColor = LEGACY_COLORS.darkGreyEnabled + StatusLabelProps.textColor = LEGACY_COLORS.darkBlackEnabled break } case 'holding at target': { - StatusLabelProps.backgroundColor = COLORS.medBlue - StatusLabelProps.iconColor = COLORS.blueEnabled + StatusLabelProps.backgroundColor = LEGACY_COLORS.medBlue + StatusLabelProps.iconColor = LEGACY_COLORS.blueEnabled break } case 'cooling': case 'heating': { - StatusLabelProps.backgroundColor = COLORS.medBlue - StatusLabelProps.iconColor = COLORS.darkGreyEnabled + StatusLabelProps.backgroundColor = LEGACY_COLORS.medBlue + StatusLabelProps.iconColor = LEGACY_COLORS.darkGreyEnabled StatusLabelProps.pulse = true break } case 'error': { - StatusLabelProps.backgroundColor = COLORS.warningBackgroundLight - StatusLabelProps.iconColor = COLORS.warningEnabled - StatusLabelProps.textColor = COLORS.warningText + StatusLabelProps.backgroundColor = LEGACY_COLORS.warningBackgroundLight + StatusLabelProps.iconColor = LEGACY_COLORS.warningEnabled + StatusLabelProps.textColor = LEGACY_COLORS.warningText } } return StatusLabelProps @@ -77,7 +77,7 @@ export const ThermocyclerModuleData = ( > @@ -88,8 +88,8 @@ export const ThermocyclerModuleData = ( {t(isSecondaryTemp ? 'set_lid_temperature' : 'set_block_temperature')} diff --git a/app/src/organisms/ModuleCard/__tests__/HeaterShakerModuleData.test.tsx b/app/src/organisms/ModuleCard/__tests__/HeaterShakerModuleData.test.tsx index cca89a616a4..1efb40bb8d9 100644 --- a/app/src/organisms/ModuleCard/__tests__/HeaterShakerModuleData.test.tsx +++ b/app/src/organisms/ModuleCard/__tests__/HeaterShakerModuleData.test.tsx @@ -39,7 +39,7 @@ describe('HeaterShakerModuleData', () => { it('renders an idle status', () => { const { getByText } = render(props) expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.medGreyEnabled' + 'backgroundColor: LEGACY_COLORS.medGreyEnabled' ) }) @@ -79,7 +79,7 @@ describe('HeaterShakerModuleData', () => { } const { getByText } = render(props) expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.blueEnabled' + 'backgroundColor: LEGACY_COLORS.blueEnabled' ) }) @@ -101,7 +101,7 @@ describe('HeaterShakerModuleData', () => { getByText('Target: 200 rpm') getByText('Current: 200 rpm') expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.blueEnabled' + 'backgroundColor: LEGACY_COLORS.blueEnabled' ) }) @@ -123,7 +123,7 @@ describe('HeaterShakerModuleData', () => { getByText('Target: N/A') getByText('Current: 0 rpm') expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.medGreyEnabled' + 'backgroundColor: LEGACY_COLORS.medGreyEnabled' ) }) @@ -145,7 +145,7 @@ describe('HeaterShakerModuleData', () => { getByText('Target: 200 rpm') getByText('Current: 200 rpm') expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.warningBackgroundLight' + 'backgroundColor: LEGACY_COLORS.warningBackgroundLight' ) }) @@ -167,7 +167,7 @@ describe('HeaterShakerModuleData', () => { getByText('Target: N/A') getByText('Current: 0 rpm') expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.medGreyEnabled' + 'backgroundColor: LEGACY_COLORS.medGreyEnabled' ) }) @@ -187,7 +187,7 @@ describe('HeaterShakerModuleData', () => { } const { getByText } = render(props) expect(getByText('Mock StatusLabel')).toHaveStyle( - 'backgroundColor: COLORS.blueEnabled' + 'backgroundColor: LEGACY_COLORS.blueEnabled' ) }) diff --git a/app/src/organisms/ModuleCard/__tests__/ThermocyclerModuleData.test.tsx b/app/src/organisms/ModuleCard/__tests__/ThermocyclerModuleData.test.tsx index 9c760fc47e1..1879a639b12 100644 --- a/app/src/organisms/ModuleCard/__tests__/ThermocyclerModuleData.test.tsx +++ b/app/src/organisms/ModuleCard/__tests__/ThermocyclerModuleData.test.tsx @@ -105,7 +105,7 @@ describe('ThermocyclerModuleData', () => { const { getByTestId } = render(props) expect(getByTestId('status_label_heating_blockStatus')).toHaveStyle( - 'backgroundColor: COLORS.warningBackgroundLight' + 'backgroundColor: LEGACY_COLORS.warningBackgroundLight' ) }) diff --git a/app/src/organisms/ModuleCard/index.tsx b/app/src/organisms/ModuleCard/index.tsx index 230ca1cb9ee..84e6fc398c2 100644 --- a/app/src/organisms/ModuleCard/index.tsx +++ b/app/src/organisms/ModuleCard/index.tsx @@ -15,7 +15,7 @@ import { useOnClickOutside, IconProps, useHoverTooltip, - COLORS, + LEGACY_COLORS, Icon, ModuleIcon, } from '@opentrons/components' @@ -245,7 +245,7 @@ export const ModuleCard = (props: ModuleCardProps): JSX.Element | null => { return ( { <> { moduleType={module.moduleType} size="1rem" marginRight={SPACING.spacing2} - color={COLORS.darkGreyEnabled} + color={LEGACY_COLORS.darkGreyEnabled} /> {getModuleDisplayName(module.moduleModel)} diff --git a/app/src/organisms/ModuleWizardFlows/Success.tsx b/app/src/organisms/ModuleWizardFlows/Success.tsx index 16b8273214f..74b86b4a21b 100644 --- a/app/src/organisms/ModuleWizardFlows/Success.tsx +++ b/app/src/organisms/ModuleWizardFlows/Success.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { css } from 'styled-components' import { getModuleDisplayName } from '@opentrons/shared-data' import { - COLORS, + LEGACY_COLORS, JUSTIFY_FLEX_END, PrimaryButton, RESPONSIVENESS, @@ -44,7 +44,7 @@ export const Success = ( diff --git a/app/src/organisms/ModuleWizardFlows/index.tsx b/app/src/organisms/ModuleWizardFlows/index.tsx index 98c4e3941b7..0ca641ae74b 100644 --- a/app/src/organisms/ModuleWizardFlows/index.tsx +++ b/app/src/organisms/ModuleWizardFlows/index.tsx @@ -5,7 +5,7 @@ import { useDeleteMaintenanceRunMutation, useCurrentMaintenanceRun, } from '@opentrons/react-api-client' -import { COLORS } from '@opentrons/components' +import { LEGACY_COLORS } from '@opentrons/components' import { CreateCommand, getModuleType, @@ -235,7 +235,7 @@ export const ModuleWizardFlows = ( modalContent = ( () diff --git a/app/src/organisms/Navigation/index.tsx b/app/src/organisms/Navigation/index.tsx index 2c1bbe9b414..30bc66f138d 100644 --- a/app/src/organisms/Navigation/index.tsx +++ b/app/src/organisms/Navigation/index.tsx @@ -7,7 +7,7 @@ import { Icon, Flex, Box, - COLORS, + LEGACY_COLORS, SPACING, DIRECTION_ROW, ALIGN_CENTER, @@ -89,7 +89,7 @@ export function Navigation(props: NavigationProps): JSX.Element { paddingX={SPACING.spacing40} top="0" width="100%" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} boxShadow={isScrolled ? BORDERS.shadowBig : ''} gridGap={SPACING.spacing24} aria-label="Navigation_container" @@ -105,7 +105,7 @@ export function Navigation(props: NavigationProps): JSX.Element { aria-label="network icon" name={icon} size="2.5rem" - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} /> )} @@ -122,7 +122,7 @@ export function Navigation(props: NavigationProps): JSX.Element { name="overflow-btn-touchscreen" height="3.75rem" width="3rem" - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} /> @@ -147,17 +147,17 @@ const NavigationLink = (props: { to: string; name: string }): JSX.Element => ( const TouchNavLink = styled(NavLink)` ${TYPOGRAPHY.level3HeaderSemiBold} - color: ${COLORS.darkBlack70}; + color: ${LEGACY_COLORS.darkBlack70}; height: 3.5rem; display: flex; flex-direction: ${DIRECTION_COLUMN}; align-items: ${ALIGN_CENTER}; white-space: nowrap; &.active { - color: ${COLORS.black}; + color: ${LEGACY_COLORS.black}; } &.active > div { - background-color: ${COLORS.highlightPurple1}; + background-color: ${LEGACY_COLORS.highlightPurple1}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { @@ -168,14 +168,14 @@ const TouchNavLink = styled(NavLink)` const IconButton = styled('button')` border-radius: ${SPACING.spacing4}; max-height: 100%; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; &:active { - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:disabled { background-color: transparent; diff --git a/app/src/organisms/NetworkSettings/AlternativeSecurityTypeModal.tsx b/app/src/organisms/NetworkSettings/AlternativeSecurityTypeModal.tsx index e0d226c76ac..7331c91db72 100644 --- a/app/src/organisms/NetworkSettings/AlternativeSecurityTypeModal.tsx +++ b/app/src/organisms/NetworkSettings/AlternativeSecurityTypeModal.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { useHistory } from 'react-router-dom' import { - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, JUSTIFY_CENTER, @@ -56,7 +56,7 @@ export function AlternativeSecurityTypeModal({ {t('alternative_security_types_description')} diff --git a/app/src/organisms/NetworkSettings/ConnectingNetwork.tsx b/app/src/organisms/NetworkSettings/ConnectingNetwork.tsx index 31491e399de..458239b60b6 100644 --- a/app/src/organisms/NetworkSettings/ConnectingNetwork.tsx +++ b/app/src/organisms/NetworkSettings/ConnectingNetwork.tsx @@ -6,7 +6,7 @@ import { DIRECTION_COLUMN, ALIGN_CENTER, JUSTIFY_CENTER, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, Icon, @@ -25,7 +25,7 @@ export function ConnectingNetwork({ return ( diff --git a/app/src/organisms/NetworkSettings/DisplaySearchNetwork.tsx b/app/src/organisms/NetworkSettings/DisplaySearchNetwork.tsx index 85f3722e138..bec52e927a3 100644 --- a/app/src/organisms/NetworkSettings/DisplaySearchNetwork.tsx +++ b/app/src/organisms/NetworkSettings/DisplaySearchNetwork.tsx @@ -8,7 +8,7 @@ import { JUSTIFY_CENTER, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, BORDERS, } from '@opentrons/components' @@ -19,7 +19,7 @@ export function DisplaySearchNetwork(): JSX.Element { return ( diff --git a/app/src/organisms/NetworkSettings/DisplayWifiList.tsx b/app/src/organisms/NetworkSettings/DisplayWifiList.tsx index 43714fad3bf..8abf3c77435 100644 --- a/app/src/organisms/NetworkSettings/DisplayWifiList.tsx +++ b/app/src/organisms/NetworkSettings/DisplayWifiList.tsx @@ -7,7 +7,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, DISPLAY_FLEX, @@ -31,31 +31,31 @@ const NETWORK_ROW_STYLE = css` align-items: ${ALIGN_CENTER}; grid-gap: ${SPACING.spacing16}; - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; margin-bottom: ${SPACING.spacing8}; border-radius: ${BORDERS.borderRadiusSize4}; &:hover { border: none; box-shadow: none; - background-color: ${COLORS.light1}; - color: ${COLORS.darkBlack100}; + background-color: ${LEGACY_COLORS.light1}; + color: ${LEGACY_COLORS.darkBlack100}; } &:focus { - background-color: ${COLORS.light1Pressed}; - color: ${COLORS.darkBlack100}; + background-color: ${LEGACY_COLORS.light1Pressed}; + color: ${LEGACY_COLORS.darkBlack100}; box-shadow: none; } &:active { - background-color: ${COLORS.light1Pressed}; - color: ${COLORS.darkBlack100}; + background-color: ${LEGACY_COLORS.light1Pressed}; + color: ${LEGACY_COLORS.darkBlack100}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; } &:disabled { - color: ${COLORS.darkBlack60}; + color: ${LEGACY_COLORS.darkBlack60}; } ` @@ -106,16 +106,16 @@ export function DisplayWifiList({ display="flex" onClick={handleJoinAnotherNetwork} height="5rem" - backgroundColor={COLORS.light1} + backgroundColor={LEGACY_COLORS.light1} borderRadius={BORDERS.borderRadiusSize4} - color={COLORS.black} + color={LEGACY_COLORS.black} css={NETWORK_ROW_STYLE} padding={`${SPACING.spacing20} ${SPACING.spacing32}`} flexDirection={DIRECTION_ROW} alignItems={ALIGN_CENTER} gridGap={SPACING.spacing4} > - + {t('join_other_network')} {list != null && list.length > 0 ? null : } diff --git a/app/src/organisms/NetworkSettings/FailedToConnect.tsx b/app/src/organisms/NetworkSettings/FailedToConnect.tsx index 85726031f3d..e15eb70a374 100644 --- a/app/src/organisms/NetworkSettings/FailedToConnect.tsx +++ b/app/src/organisms/NetworkSettings/FailedToConnect.tsx @@ -6,7 +6,7 @@ import { DIRECTION_COLUMN, ALIGN_CENTER, JUSTIFY_CENTER, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, Icon, @@ -39,7 +39,7 @@ export function FailedToConnect({ @@ -51,7 +51,7 @@ export function FailedToConnect({ {t('your_mac_address_is', { macAddress: wifi?.macAddress })} @@ -121,7 +121,7 @@ export function SelectAuthenticationType({ {t('need_another_security_type')} diff --git a/app/src/organisms/NetworkSettings/SetWifiCred.tsx b/app/src/organisms/NetworkSettings/SetWifiCred.tsx index abd2d935492..0318f909e95 100644 --- a/app/src/organisms/NetworkSettings/SetWifiCred.tsx +++ b/app/src/organisms/NetworkSettings/SetWifiCred.tsx @@ -7,7 +7,7 @@ import { BORDERS, Box, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -30,14 +30,14 @@ const SSID_INPUT_FIELD_STYLE = css` font-size: ${TYPOGRAPHY.fontSize28}; line-height: ${TYPOGRAPHY.lineHeight36}; font-weight: ${TYPOGRAPHY.fontWeightRegular}; - color: ${COLORS.darkBlack100}; + color: ${LEGACY_COLORS.darkBlack100}; padding-left: ${SPACING.spacing24}; box-sizing: border-box; width: 42.625rem; &:focus { - border: 3px solid ${COLORS.blueEnabled}; - filter: drop-shadow(0px 0px 10px ${COLORS.blueEnabled}); + border: 3px solid ${LEGACY_COLORS.blueEnabled}; + filter: drop-shadow(0px 0px 10px ${LEGACY_COLORS.blueEnabled}); border-radius: ${BORDERS.borderRadiusSize1}; } ` diff --git a/app/src/organisms/NetworkSettings/SetWifiSsid.tsx b/app/src/organisms/NetworkSettings/SetWifiSsid.tsx index 857a8b34483..2f96386d0bb 100644 --- a/app/src/organisms/NetworkSettings/SetWifiSsid.tsx +++ b/app/src/organisms/NetworkSettings/SetWifiSsid.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, POSITION_FIXED, @@ -24,13 +24,13 @@ const SSID_INPUT_FIELD_STYLE = css` font-size: ${TYPOGRAPHY.fontSize28}; line-height: ${TYPOGRAPHY.lineHeight36}; font-weight: ${TYPOGRAPHY.fontWeightRegular}; - color: ${COLORS.darkBlack100}; + color: ${LEGACY_COLORS.darkBlack100}; padding-left: ${SPACING.spacing24}; box-sizing: border-box; &:focus { - border: 3px solid ${COLORS.blueEnabled}; - filter: drop-shadow(0px 0px 10px ${COLORS.blueEnabled}); + border: 3px solid ${LEGACY_COLORS.blueEnabled}; + filter: drop-shadow(0px 0px 10px ${LEGACY_COLORS.blueEnabled}); border-radius: ${BORDERS.borderRadiusSize1}; } ` @@ -61,7 +61,7 @@ export function SetWifiSsid({ {t('enter_network_name')} diff --git a/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx b/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx index 27e6c0ebcae..f364c467a1a 100644 --- a/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx +++ b/app/src/organisms/NetworkSettings/WifiConnectionDetails.tsx @@ -9,7 +9,7 @@ import { DIRECTION_ROW, SPACING, Icon, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, ALIGN_CENTER, JUSTIFY_CENTER, @@ -116,12 +116,12 @@ const DisplayConnectionStatus = ({ flex="1" flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing32} - backgroundColor={COLORS.green3} + backgroundColor={LEGACY_COLORS.green3} borderRadius={BORDERS.borderRadiusSize3} alignItems={ALIGN_CENTER} justifyContent={JUSTIFY_CENTER} > - + {t('successfully_connected_to_network', { ssid })} diff --git a/app/src/organisms/NetworkSettings/__tests__/DisplaySearchNetwork.test.tsx b/app/src/organisms/NetworkSettings/__tests__/DisplaySearchNetwork.test.tsx index d35925d97bb..bbde6e95ba6 100644 --- a/app/src/organisms/NetworkSettings/__tests__/DisplaySearchNetwork.test.tsx +++ b/app/src/organisms/NetworkSettings/__tests__/DisplaySearchNetwork.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { i18n } from '../../../i18n' import { DisplaySearchNetwork } from '../DisplaySearchNetwork' @@ -16,7 +16,7 @@ describe('SearchNetwork', () => { const [{ getByText, getByTestId }] = render() getByText('Searching for networks...') expect(getByTestId('Display-Search-Network-text')).toHaveStyle( - `background-color: ${COLORS.white}` + `background-color: ${LEGACY_COLORS.white}` ) }) }) diff --git a/app/src/organisms/OnDeviceDisplay/NameRobot/ConfirmRobotName.tsx b/app/src/organisms/OnDeviceDisplay/NameRobot/ConfirmRobotName.tsx index 22562bf09ac..411323d9138 100644 --- a/app/src/organisms/OnDeviceDisplay/NameRobot/ConfirmRobotName.tsx +++ b/app/src/organisms/OnDeviceDisplay/NameRobot/ConfirmRobotName.tsx @@ -9,7 +9,7 @@ import { ALIGN_CENTER, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { StyledText } from '../../../atoms/text' @@ -61,7 +61,7 @@ export function ConfirmRobotName({ fontWeight={TYPOGRAPHY.fontWeightRegular} marginTop={SPACING.spacing12} marginBottom={SPACING.spacing40} - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} > {t('your_robot_is_ready_to_go')} diff --git a/app/src/organisms/OnDeviceDisplay/RobotDashboard/EmptyRecentRun.tsx b/app/src/organisms/OnDeviceDisplay/RobotDashboard/EmptyRecentRun.tsx index 6f644092d64..750ce97669f 100644 --- a/app/src/organisms/OnDeviceDisplay/RobotDashboard/EmptyRecentRun.tsx +++ b/app/src/organisms/OnDeviceDisplay/RobotDashboard/EmptyRecentRun.tsx @@ -5,7 +5,7 @@ import { Flex, DIRECTION_COLUMN, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, JUSTIFY_CENTER, SPACING, TYPOGRAPHY, @@ -21,7 +21,7 @@ export function EmptyRecentRun(): JSX.Element { return ( {t('no_recent_runs_description')} diff --git a/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx b/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx index 0d9390886b1..f6820bae20f 100644 --- a/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx +++ b/app/src/organisms/OnDeviceDisplay/RobotDashboard/RecentRunProtocolCard.tsx @@ -7,7 +7,7 @@ import { formatDistance } from 'date-fns' import { Flex, Icon, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, DIRECTION_COLUMN, @@ -91,8 +91,8 @@ export function ProtocolWithLastRun({ flex: 1 0 0; &:active { background-color: ${isReadyToBeReRun - ? COLORS.green3Pressed - : COLORS.yellow3Pressed}; + ? LEGACY_COLORS.green3Pressed + : LEGACY_COLORS.yellow3Pressed}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; @@ -102,8 +102,8 @@ export function ProtocolWithLastRun({ const PROTOCOL_CARD_CLICKED_STYLE = css` flex: 1 0 0; background-color: ${isReadyToBeReRun - ? COLORS.green3Pressed - : COLORS.yellow3Pressed}; + ? LEGACY_COLORS.green3Pressed + : LEGACY_COLORS.yellow3Pressed}; &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; } @@ -157,7 +157,7 @@ export function ProtocolWithLastRun({ flexDirection={DIRECTION_COLUMN} padding={SPACING.spacing24} gridGap={SPACING.spacing24} - backgroundColor={isReadyToBeReRun ? COLORS.green3 : COLORS.yellow3} + backgroundColor={isReadyToBeReRun ? LEGACY_COLORS.green3 : LEGACY_COLORS.yellow3} width="25.8125rem" height="24.5rem" borderRadius={BORDERS.borderRadiusSize4} @@ -176,7 +176,7 @@ export function ProtocolWithLastRun({ aria-label="icon_ot-spinner" spin={true} size="2.5rem" - color={COLORS.darkBlack100} + color={LEGACY_COLORS.darkBlack100} /> )} @@ -194,7 +194,7 @@ export function ProtocolWithLastRun({ fontSize={TYPOGRAPHY.fontSize22} fontWeight={TYPOGRAPHY.fontWeightRegular} lineHeight={TYPOGRAPHY.lineHeight28} - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} > {i18n.format( `${terminationTypeMap[runData.status] ?? ''} ${formattedLastRunTime}`, diff --git a/app/src/organisms/OnDeviceDisplay/RobotDashboard/ServerInitializing.tsx b/app/src/organisms/OnDeviceDisplay/RobotDashboard/ServerInitializing.tsx index dc38804d42b..592f65084a7 100644 --- a/app/src/organisms/OnDeviceDisplay/RobotDashboard/ServerInitializing.tsx +++ b/app/src/organisms/OnDeviceDisplay/RobotDashboard/ServerInitializing.tsx @@ -5,7 +5,7 @@ import { Flex, DIRECTION_COLUMN, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, JUSTIFY_CENTER, TYPOGRAPHY, BORDERS, @@ -20,18 +20,18 @@ export function ServerInitializing(): JSX.Element { return ( - + {t('robot_initializing')} diff --git a/app/src/organisms/OnDeviceDisplay/RobotDashboard/__tests__/RecentRunProtocolCard.test.tsx b/app/src/organisms/OnDeviceDisplay/RobotDashboard/__tests__/RecentRunProtocolCard.test.tsx index 111573f954a..9bafd56c49f 100644 --- a/app/src/organisms/OnDeviceDisplay/RobotDashboard/__tests__/RecentRunProtocolCard.test.tsx +++ b/app/src/organisms/OnDeviceDisplay/RobotDashboard/__tests__/RecentRunProtocolCard.test.tsx @@ -6,7 +6,7 @@ import { MemoryRouter } from 'react-router-dom' import { useAllRunsQuery, useProtocolQuery } from '@opentrons/react-api-client' import { RUN_STATUS_FAILED } from '@opentrons/api-client' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { i18n } from '../../../../i18n' import { Skeleton } from '../../../../atoms/Skeleton' @@ -209,7 +209,7 @@ describe('RecentRunProtocolCard', () => { it('when tapping a card, mock functions is called and loading state is activated', () => { const [{ getByLabelText }] = render(props) const button = getByLabelText('RecentRunProtocolCard') - expect(button).toHaveStyle(`background-color: ${COLORS.green3}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.green3}`) fireEvent.click(button) expect(mockTrackEvent).toHaveBeenCalledWith({ name: 'proceedToRun', @@ -218,7 +218,7 @@ describe('RecentRunProtocolCard', () => { // TODO(BC, 08/30/23): reintroduce check for tracking when tracking is reintroduced lazily // expect(mockTrackProtocolRunEvent).toBeCalledWith({ name: 'runAgain' }) getByLabelText('icon_ot-spinner') - expect(button).toHaveStyle(`background-color: ${COLORS.green3Pressed}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.green3Pressed}`) }) it('should render the skeleton when react query is loading', () => { diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/CancelingRunModal.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/CancelingRunModal.tsx index 3efc1890237..3cfa30946ce 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/CancelingRunModal.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/CancelingRunModal.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -24,7 +24,7 @@ export function CancelingRunModal(): JSX.Element { flexDirection={DIRECTION_COLUMN} justifyContent={JUSTIFY_CENTER} alignItems={ALIGN_CENTER} - backgroundColor={COLORS.darkBlack20} + backgroundColor={LEGACY_COLORS.darkBlack20} borderRadius={BORDERS.borderRadiusSize3} width="41.625rem" height="17.25rem" @@ -34,7 +34,7 @@ export function CancelingRunModal(): JSX.Element { name="ot-spinner" spin size="3.75rem" - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} aria-label="CancelingRunModal_icon" /> diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx index 1b6996ba885..20cfb8129c0 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/ConfirmCancelRunModal.tsx @@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom' import { RUN_STATUS_STOPPED } from '@opentrons/api-client' import { - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -53,7 +53,7 @@ export function ConfirmCancelRunModal({ title: t('cancel_run_modal_heading'), hasExitIcon: false, iconName: 'ot-alert', - iconColor: COLORS.yellow2, + iconColor: LEGACY_COLORS.yellow2, } const handleCancelRun = (): void => { diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/CurrentRunningProtocolCommand.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/CurrentRunningProtocolCommand.tsx index 39af6821128..0fc568f65ce 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/CurrentRunningProtocolCommand.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/CurrentRunningProtocolCommand.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, SPACING, TYPOGRAPHY, @@ -55,7 +55,7 @@ to { ` const TITLE_TEXT_STYLE = css` - color: ${COLORS.darkBlack70}; + color: ${LEGACY_COLORS.darkBlack70}; font-size: 1.75rem; font-weight: ${TYPOGRAPHY.fontWeightSemiBold}; line-height: 2.25rem; @@ -71,7 +71,7 @@ const RUN_TIMER_STYLE = css` font-size: 2rem; font-weight: ${TYPOGRAPHY.fontWeightBold}; line-height: 2.625rem; - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; ` const COMMAND_ROW_STYLE_ANIMATED = css` @@ -225,7 +225,7 @@ export function CurrentRunningProtocolCommand({ - + ) } diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunFailedModal.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunFailedModal.tsx index b83493f03e8..5980227a8ee 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunFailedModal.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunFailedModal.tsx @@ -6,7 +6,7 @@ import { css } from 'styled-components' import { ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, OVERFLOW_AUTO, @@ -89,7 +89,7 @@ export function RunFailedModal({ flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing8} maxHeight="11rem" - backgroundColor={COLORS.light1} + backgroundColor={LEGACY_COLORS.light1} borderRadius={BORDERS.borderRadiusSize3} padding={`${SPACING.spacing16} ${SPACING.spacing20}`} > @@ -126,7 +126,7 @@ const SCROLL_BAR_STYLE = css` &::-webkit-scrollbar { width: 0.75rem; - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; } &::-webkit-scrollbar-track { @@ -135,7 +135,7 @@ const SCROLL_BAR_STYLE = css` } &::-webkit-scrollbar-thumb { - background: ${COLORS.darkBlack40}; + background: ${LEGACY_COLORS.darkBlack40}; border-radius: 11px; } ` diff --git a/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunningProtocolCommandList.tsx b/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunningProtocolCommandList.tsx index 90f1e2f2261..dcf8cdf010d 100644 --- a/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunningProtocolCommandList.tsx +++ b/app/src/organisms/OnDeviceDisplay/RunningProtocol/RunningProtocolCommandList.tsx @@ -7,7 +7,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -39,7 +39,7 @@ import type { TrackProtocolRunEvent } from '../../Devices/hooks' import type { RobotAnalyticsData } from '../../../redux/analytics/types' const TITLE_TEXT_STYLE = css` - color: ${COLORS.darkBlack70}; + color: ${LEGACY_COLORS.darkBlack70}; font-size: ${TYPOGRAPHY.fontSize28}; font-weight: ${TYPOGRAPHY.fontWeightSemiBold}; line-height: ${TYPOGRAPHY.lineHeight36}; @@ -217,8 +217,8 @@ export function RunningProtocolCommandList({ {(command, index) => { const backgroundColor = index === currentRunCommandIndex - ? COLORS.mediumBlueEnabled - : COLORS.light1 + ? LEGACY_COLORS.mediumBlueEnabled + : LEGACY_COLORS.light1 return ( - + ) } diff --git a/app/src/organisms/OpenDoorAlertModal/index.tsx b/app/src/organisms/OpenDoorAlertModal/index.tsx index 5c2d152a971..aab65747bd9 100644 --- a/app/src/organisms/OpenDoorAlertModal/index.tsx +++ b/app/src/organisms/OpenDoorAlertModal/index.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -21,7 +21,7 @@ export function OpenDoorAlertModal(): JSX.Element { {t('close_door_to_resume')} diff --git a/app/src/organisms/PipetteWizardFlows/AttachProbe.tsx b/app/src/organisms/PipetteWizardFlows/AttachProbe.tsx index 22ac3b36217..4c3f5eeeaaa 100644 --- a/app/src/organisms/PipetteWizardFlows/AttachProbe.tsx +++ b/app/src/organisms/PipetteWizardFlows/AttachProbe.tsx @@ -4,7 +4,7 @@ import { Trans, useTranslation } from 'react-i18next' import { Flex, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, RESPONSIVENESS, } from '@opentrons/components' @@ -186,7 +186,7 @@ export const AttachProbe = (props: AttachProbeProps): JSX.Element | null => { return errorMessage != null ? ( diff --git a/app/src/organisms/PipetteWizardFlows/Carriage.tsx b/app/src/organisms/PipetteWizardFlows/Carriage.tsx index cf3e1f50eb2..cf025955841 100644 --- a/app/src/organisms/PipetteWizardFlows/Carriage.tsx +++ b/app/src/organisms/PipetteWizardFlows/Carriage.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { Trans, useTranslation } from 'react-i18next' import capitalize from 'lodash/capitalize' -import { COLORS, SPACING, PrimaryButton } from '@opentrons/components' +import { LEGACY_COLORS, SPACING, PrimaryButton } from '@opentrons/components' import { StyledText } from '../../atoms/text' import { SmallButton } from '../../atoms/buttons' import { GenericWizardTile } from '../../molecules/GenericWizardTile' @@ -46,7 +46,7 @@ export const Carriage = (props: PipetteWizardStepProps): JSX.Element | null => { return errorMessage != null ? ( diff --git a/app/src/organisms/PipetteWizardFlows/ChoosePipette.tsx b/app/src/organisms/PipetteWizardFlows/ChoosePipette.tsx index 12ef48c2d3f..f8717222fdb 100644 --- a/app/src/organisms/PipetteWizardFlows/ChoosePipette.tsx +++ b/app/src/organisms/PipetteWizardFlows/ChoosePipette.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import startCase from 'lodash/startCase' import { BORDERS, - COLORS, + LEGACY_COLORS, Flex, SPACING, TYPOGRAPHY, @@ -48,8 +48,8 @@ import type { PipetteMount } from '@opentrons/shared-data' import type { SelectablePipettes } from './types' const UNSELECTED_OPTIONS_STYLE = css` - background-color: ${COLORS.white}; - border: 1px solid ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.white}; + border: 1px solid ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; height: 14.5625rem; width: 14.5625rem; @@ -60,13 +60,13 @@ const UNSELECTED_OPTIONS_STYLE = css` grid-gap: ${SPACING.spacing8} &:hover { - border: 1px solid ${COLORS.medGreyHover}; + border: 1px solid ${LEGACY_COLORS.medGreyHover}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { flex-direction: ${DIRECTION_ROW}; justify-content: ${JUSTIFY_FLEX_START}; - background-color: ${COLORS.mediumBlueEnabled}; + background-color: ${LEGACY_COLORS.mediumBlueEnabled}; border-width: 0; border-radius: ${BORDERS.borderRadiusSize4}; padding: ${SPACING.spacing24}; @@ -80,22 +80,22 @@ const UNSELECTED_OPTIONS_STYLE = css` ` const SELECTED_OPTIONS_STYLE = css` ${UNSELECTED_OPTIONS_STYLE} - border: 1px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.lightBlue}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; &:hover { - border: 1px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.lightBlue}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { border-width: 0px; - background-color: ${COLORS.blueEnabled}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.blueEnabled}; + color: ${LEGACY_COLORS.white}; &:hover { border-width: 0px; - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; } } ` @@ -147,7 +147,7 @@ export const ChoosePipette = (props: ChoosePipetteProps): JSX.Element => { flexDirection={DIRECTION_COLUMN} width="100%" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} > {showExitConfirmation ? ( { if (showPipetteStillAttached) { return ( @@ -213,7 +213,7 @@ export const DetachPipette = (props: DetachPipetteProps): JSX.Element => { return errorMessage != null ? ( diff --git a/app/src/organisms/PipetteWizardFlows/ExitModal.tsx b/app/src/organisms/PipetteWizardFlows/ExitModal.tsx index 54a95b95c1a..c4ae5ebfe68 100644 --- a/app/src/organisms/PipetteWizardFlows/ExitModal.tsx +++ b/app/src/organisms/PipetteWizardFlows/ExitModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import capitalize from 'lodash/capitalize' import { useTranslation } from 'react-i18next' import { - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, SecondaryButton, @@ -42,7 +42,7 @@ export function ExitModal(props: ExitModalProps): JSX.Element { return ( 2 ? t('something_seems_wrong') : undefined} - iconColor={COLORS.errorEnabled} + iconColor={LEGACY_COLORS.errorEnabled} isSuccess={false} > { : null const [numberOfTryAgains, setNumberOfTryAgains] = React.useState(0) let header: string = 'unknown results screen' - let iconColor: string = COLORS.successEnabled + let iconColor: string = LEGACY_COLORS.successEnabled let isSuccess: boolean = true let buttonText: string = i18n.format(t('shared:exit'), 'capitalize') let subHeader @@ -99,12 +99,12 @@ export const Results = (props: ResultsProps): JSX.Element => { ) { header = i18n.format(t('wrong_pip'), 'capitalize') buttonText = i18n.format(t('detach_and_retry'), 'capitalize') - iconColor = COLORS.errorEnabled + iconColor = LEGACY_COLORS.errorEnabled isSuccess = false } else { // attachment flow fail header = i18n.format(t('pipette_failed_to_attach'), 'capitalize') - iconColor = COLORS.errorEnabled + iconColor = LEGACY_COLORS.errorEnabled isSuccess = false } break @@ -112,7 +112,7 @@ export const Results = (props: ResultsProps): JSX.Element => { case FLOWS.DETACH: { if (attachedPipettes[mount] != null) { header = t('pipette_failed_to_detach', { pipetteName: pipetteName }) - iconColor = COLORS.errorEnabled + iconColor = LEGACY_COLORS.errorEnabled isSuccess = false } else { header = i18n.format(t('pipette_detached'), 'capitalize') @@ -248,7 +248,7 @@ export const Results = (props: ResultsProps): JSX.Element => { ) { const GO_BACK_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { opacity: 70%; @@ -301,7 +301,7 @@ export const Results = (props: ResultsProps): JSX.Element => { return ( diff --git a/app/src/organisms/PipetteWizardFlows/UnskippableModal.tsx b/app/src/organisms/PipetteWizardFlows/UnskippableModal.tsx index 84a0ebc0c21..46979b6a1a3 100644 --- a/app/src/organisms/PipetteWizardFlows/UnskippableModal.tsx +++ b/app/src/organisms/PipetteWizardFlows/UnskippableModal.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, SecondaryButton, @@ -22,7 +22,7 @@ export function UnskippableModal(props: UnskippableModalProps): JSX.Element { const { t, i18n } = useTranslation(['pipette_wizard_flows', 'shared']) return ( { // Single and 8-Channel pipettes are selected first by default expect(singleMountPipettes).toHaveStyle( - `background-color: ${COLORS.lightBlue}` + `background-color: ${LEGACY_COLORS.lightBlue}` ) - expect(ninetySixPipette).toHaveStyle(`background-color: ${COLORS.white}`) + expect(ninetySixPipette).toHaveStyle(`background-color: ${LEGACY_COLORS.white}`) // Selecting 96-Channel called setSelectedPipette prop fireEvent.click(ninetySixPipette) @@ -138,9 +138,9 @@ describe('ChoosePipette', () => { const ninetySixPipette = screen.getByRole('radio', { name: '96-Channel pipette 96-Channel pipette', }) - expect(singleMountPipettes).toHaveStyle(`background-color: ${COLORS.white}`) + expect(singleMountPipettes).toHaveStyle(`background-color: ${LEGACY_COLORS.white}`) expect(ninetySixPipette).toHaveStyle( - `background-color: ${COLORS.lightBlue}` + `background-color: ${LEGACY_COLORS.lightBlue}` ) }) it('renders the correct text for the 96 channel button when there is a left pipette attached', () => { diff --git a/app/src/organisms/PipetteWizardFlows/__tests__/Results.test.tsx b/app/src/organisms/PipetteWizardFlows/__tests__/Results.test.tsx index 6ea5b608af5..b07d5e4fe45 100644 --- a/app/src/organisms/PipetteWizardFlows/__tests__/Results.test.tsx +++ b/app/src/organisms/PipetteWizardFlows/__tests__/Results.test.tsx @@ -5,7 +5,7 @@ import { NINETY_SIX_CHANNEL, SINGLE_MOUNT_PIPETTES, } from '@opentrons/shared-data' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { useInstrumentsQuery } from '@opentrons/react-api-client' import { mockAttachedPipetteInformation } from '../../../redux/pipettes/__fixtures__' import { i18n } from '../../../i18n' @@ -150,7 +150,7 @@ describe('Results', () => { render(props) screen.getByText('Unable to detect pipette') expect(screen.getByLabelText('ot-alert')).toHaveStyle( - `color: ${String(COLORS.errorEnabled)}` + `color: ${String(LEGACY_COLORS.errorEnabled)}` ) fireEvent.click(screen.getByRole('button', { name: 'Try again' })) await act(() => pipettePromise) @@ -180,7 +180,7 @@ describe('Results', () => { render(props) screen.getByText('Flex 1-Channel 1000 μL still attached') expect(screen.getByLabelText('ot-alert')).toHaveStyle( - `color: ${String(COLORS.errorEnabled)}` + `color: ${String(LEGACY_COLORS.errorEnabled)}` ) screen.getByRole('button', { name: 'Try again' }) }) @@ -215,7 +215,7 @@ describe('Results', () => { render(props) screen.getByText('Flex 1-Channel 1000 μL still attached') expect(screen.getByLabelText('ot-alert')).toHaveStyle( - `color: ${String(COLORS.errorEnabled)}` + `color: ${String(LEGACY_COLORS.errorEnabled)}` ) fireEvent.click(screen.getByRole('button', { name: 'Try again' })) await act(() => pipettePromise) @@ -304,7 +304,7 @@ describe('Results', () => { render(props) screen.getByText('Unable to detect pipette') expect(screen.getByLabelText('ot-alert')).toHaveStyle( - `color: ${String(COLORS.errorEnabled)}` + `color: ${String(LEGACY_COLORS.errorEnabled)}` ) fireEvent.click(screen.getByRole('button', { name: 'Try again' })) await act(() => pipettePromise) diff --git a/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx b/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx index 13459af3cbf..d04d7a1c4ee 100644 --- a/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx +++ b/app/src/organisms/ProtocolDetails/ProtocolLabwareDetails.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -118,7 +118,7 @@ export const ProtocolLabwareDetailItem = ( > {namespace === 'opentrons' ? ( { {description} diff --git a/app/src/organisms/ProtocolDetails/index.tsx b/app/src/organisms/ProtocolDetails/index.tsx index 4e21f6dd283..259d558b804 100644 --- a/app/src/organisms/ProtocolDetails/index.tsx +++ b/app/src/organisms/ProtocolDetails/index.tsx @@ -17,7 +17,7 @@ import { Link, ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, DISPLAY_FLEX, @@ -84,16 +84,16 @@ const GRID_STYLE = css` const ZOOM_ICON_STYLE = css` border-radius: ${BORDERS.radiusSoftCorners}; &:hover { - background: ${COLORS.lightGreyHover}; + background: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background: ${COLORS.lightGreyPressed}; + background: ${LEGACY_COLORS.lightGreyPressed}; } &:disabled { - background: ${COLORS.white}; + background: ${LEGACY_COLORS.white}; } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; } ` @@ -327,9 +327,9 @@ export function ProtocolDetails( const deckMap = const deckViewByAnalysisStatus = { - missing: , - loading: , - error: , + missing: , + loading: , + error: , complete: ( {deckMap} @@ -386,8 +386,8 @@ export function ProtocolDetails( /> - + {t('creation_method')} @@ -434,7 +434,7 @@ export function ProtocolDetails( flexDirection={DIRECTION_COLUMN} data-testid="ProtocolDetails_lastUpdated" > - + {t('last_updated')} @@ -447,7 +447,7 @@ export function ProtocolDetails( flexDirection={DIRECTION_COLUMN} data-testid="ProtocolDetails_lastAnalyzed" > - + {t('last_analyzed')} @@ -477,7 +477,7 @@ export function ProtocolDetails( flexDirection={DIRECTION_COLUMN} data-testid="ProtocolDetails_author" > - + {t('org_or_author')} - + {t('description')} {analysisStatus === 'loading' ? ( @@ -534,8 +534,8 @@ export function ProtocolDetails( - + {deckViewByAnalysisStatus[analysisStatus]} @@ -615,7 +615,7 @@ export function ProtocolDetails( )} {getLabwareDisplayName(selectedLabware)} - + {selectedLabware.nickName} {selectedLabwareLocation != null && selectedLabwareLocation !== 'offDeck' && @@ -275,7 +275,7 @@ export function ProtocolSetupLabware({ > @@ -546,7 +546,7 @@ function RowLabware({ return ( {getLabwareDisplayName(definition)} - + {nickName} {nestedLabwareInfo != null ? ( @@ -586,7 +586,7 @@ function RowLabware({ {nestedLabwareInfo.nestedLabwareDisplayName} - + {nestedLabwareInfo.nestedLabwareNickName} diff --git a/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx b/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx index aa0e45555b1..044cf3c137b 100644 --- a/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx +++ b/app/src/organisms/ProtocolSetupLiquids/LiquidDetails.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import styled from 'styled-components' import { useTranslation } from 'react-i18next' import { - COLORS, + LEGACY_COLORS, Flex, SPACING, TYPOGRAPHY, @@ -25,7 +25,7 @@ const Table = styled('table')` width: 100%; border-spacing: 0 ${BORDERS.borderRadiusSize2}; text-align: ${TYPOGRAPHY.textAlignLeft}; - color: ${COLORS.darkBlack90}; + color: ${LEGACY_COLORS.darkBlack90}; ` const TableHeader = styled('th')` text-transform: ${TYPOGRAPHY.textTransformCapitalize}; @@ -41,7 +41,7 @@ const TableRow = styled('tr')` const TableDatum = styled('td')` z-index: 2; padding: ${SPACING.spacing8} ${SPACING.spacing20}; - background-color: ${COLORS.light2}; + background-color: ${LEGACY_COLORS.light2}; font-size: ${TYPOGRAPHY.fontSize22}; white-space: break-spaces; text-overflow: ${WRAP}; diff --git a/app/src/organisms/ProtocolSetupLiquids/index.tsx b/app/src/organisms/ProtocolSetupLiquids/index.tsx index 7386ea69045..c4b08632a54 100644 --- a/app/src/organisms/ProtocolSetupLiquids/index.tsx +++ b/app/src/organisms/ProtocolSetupLiquids/index.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -77,7 +77,7 @@ export function LiquidsList(props: LiquidsListProps): JSX.Element { return ( @@ -115,7 +115,7 @@ export function LiquidsList(props: LiquidsListProps): JSX.Element { 0 ? ( {t('setup_instructions_description')} diff --git a/app/src/organisms/ProtocolsLanding/ConfirmDeleteProtocolModal.tsx b/app/src/organisms/ProtocolsLanding/ConfirmDeleteProtocolModal.tsx index a31d8a28f6b..b5aca3500b5 100644 --- a/app/src/organisms/ProtocolsLanding/ConfirmDeleteProtocolModal.tsx +++ b/app/src/organisms/ProtocolsLanding/ConfirmDeleteProtocolModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, TYPOGRAPHY, SPACING, @@ -44,7 +44,7 @@ export function ConfirmDeleteProtocolModal( {t('shared:cancel')} {t('yes_delete_this_protocol')} diff --git a/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx b/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx index 384a12521ad..af453bdb034 100644 --- a/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx +++ b/app/src/organisms/ProtocolsLanding/ProtocolCard.tsx @@ -19,7 +19,7 @@ import { ModuleIcon, ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_FLEX_END, POSITION_ABSOLUTE, @@ -91,7 +91,7 @@ export function ProtocolCard(props: ProtocolCardProps): JSX.Element | null { return ( , loading: , - error: , + error: , complete: mostRecentAnalysis != null ? ( ) : ( - + ), }[analysisStatus] } @@ -203,7 +203,7 @@ function AnalysisInfo(props: AnalysisInfoProps): JSX.Element { {/* data section */} {analysisStatus === 'loading' ? ( - + {t('loading_data')} ) : ( @@ -216,7 +216,7 @@ function AnalysisInfo(props: AnalysisInfoProps): JSX.Element { flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing4} > - + {t('robot')} @@ -230,7 +230,7 @@ function AnalysisInfo(props: AnalysisInfoProps): JSX.Element { data-testid={`ProtocolCard_instruments_${protocolDisplayName}`} minWidth="10.625rem" > - + {t('shared:instruments')} { @@ -275,14 +275,14 @@ function AnalysisInfo(props: AnalysisInfoProps): JSX.Element { > {requiredModuleTypes.length > 0 ? ( <> - + {t('modules')} {requiredModuleTypes.map((moduleType, index) => ( - + {`${t('updated')} ${format( new Date(modified), 'M/d/yy HH:mm' diff --git a/app/src/organisms/ProtocolsLanding/ProtocolList.tsx b/app/src/organisms/ProtocolsLanding/ProtocolList.tsx index 0ca88e3093c..ece926172b0 100644 --- a/app/src/organisms/ProtocolsLanding/ProtocolList.tsx +++ b/app/src/organisms/ProtocolsLanding/ProtocolList.tsx @@ -14,7 +14,7 @@ import { TYPOGRAPHY, BORDERS, POSITION_ABSOLUTE, - COLORS, + LEGACY_COLORS, SecondaryButton, DIRECTION_COLUMN, Overlay, @@ -39,14 +39,14 @@ import type { ProtocolSort } from './hooks' import type { Dispatch } from '../../redux/types' const SORT_BY_BUTTON_STYLE = css` - background-color: ${COLORS.transparent}; + background-color: ${LEGACY_COLORS.transparent}; cursor: pointer; &:hover { - background-color: ${COLORS.medGreyHover}; + background-color: ${LEGACY_COLORS.medGreyHover}; } &:active, &:focus { - background-color: ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.medGreyEnabled}; } ` const FLEX = 'Flex' @@ -161,7 +161,7 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { {t('shared:sort_by')} @@ -197,7 +197,7 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { borderRadius={BORDERS.radiusSoftCorners} boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="3.25rem" right="7rem" flexDirection={DIRECTION_COLUMN} @@ -225,7 +225,7 @@ export function ProtocolList(props: ProtocolListProps): JSX.Element | null { {showSortByMenu ? ( ) : null} setShowImportProtocolSlideout(true)}> diff --git a/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx b/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx index bf3f61d9006..d9093178392 100644 --- a/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx +++ b/app/src/organisms/ProtocolsLanding/ProtocolOverflowMenu.tsx @@ -4,7 +4,7 @@ import { useDispatch } from 'react-redux' import { Flex, - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, DIRECTION_COLUMN, POSITION_RELATIVE, @@ -123,7 +123,7 @@ export function ProtocolOverflowMenu( borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.25rem" right="0" flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/ProtocolsLanding/ProtocolUploadInput.tsx b/app/src/organisms/ProtocolsLanding/ProtocolUploadInput.tsx index 181da16300f..5b0303038ae 100644 --- a/app/src/organisms/ProtocolsLanding/ProtocolUploadInput.tsx +++ b/app/src/organisms/ProtocolsLanding/ProtocolUploadInput.tsx @@ -6,7 +6,7 @@ import { DIRECTION_COLUMN, ALIGN_CENTER, Link, - COLORS, + LEGACY_COLORS, SPACING, } from '@opentrons/components' import { StyledText } from '../../atoms/text' @@ -59,7 +59,7 @@ export function ProtocolUploadInput( t={t} i18nKey="shared:drag_and_drop" components={{ - a: , + a: , }} /> diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationItems.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationItems.tsx index a25fc72ae73..e4736fc4c0a 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationItems.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationItems.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import styled, { css } from 'styled-components' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '@opentrons/components' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '@opentrons/components' import { getModuleDisplayName } from '@opentrons/shared-data/js/modules' import { StyledText } from '../../../atoms/text' @@ -95,6 +95,6 @@ const StyledTableCell = styled.td` ` const BODY_STYLE = css` - box-shadow: 0 0 0 1px ${COLORS.medGreyEnabled}; + box-shadow: 0 0 0 1px ${LEGACY_COLORS.medGreyEnabled}; border-radius: 3px; ` diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx index 3d5aee1d574..487e4007b54 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/ModuleCalibrationOverflowMenu.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, DIRECTION_COLUMN, POSITION_RELATIVE, @@ -112,7 +112,7 @@ export function ModuleCalibrationOverflowMenu({ borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.3rem" right="0" width="max-content" diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/OverflowMenu.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/OverflowMenu.tsx index e875945a263..35ccaf6e65f 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/OverflowMenu.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/OverflowMenu.tsx @@ -4,7 +4,7 @@ import { saveAs } from 'file-saver' import { Flex, - COLORS, + LEGACY_COLORS, POSITION_ABSOLUTE, DIRECTION_COLUMN, POSITION_RELATIVE, @@ -194,7 +194,7 @@ export function OverflowMenu({ borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.3rem" right={0} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx index 2c66040d1ed..4561780b924 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/PipetteOffsetCalibrationItems.tsx @@ -7,7 +7,7 @@ import { Flex, ALIGN_CENTER, SPACING, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, BORDERS, } from '@opentrons/components' @@ -45,7 +45,7 @@ const StyledTableCell = styled.td` ` const BODY_STYLE = css` - box-shadow: 0 0 0 1px ${COLORS.medGreyEnabled}; + box-shadow: 0 0 0 1px ${LEGACY_COLORS.medGreyEnabled}; border-radius: 3px; ` interface PipetteOffsetCalibrationItemsProps { diff --git a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx index 70e64d7c4db..abcac76f3f3 100644 --- a/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx +++ b/app/src/organisms/RobotSettingsCalibration/CalibrationDetails/TipLengthCalibrationItems.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' import styled, { css } from 'styled-components' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '@opentrons/components' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '@opentrons/components' import { StyledText } from '../../../atoms/text' import { useAttachedPipettes } from '../../../organisms/Devices/hooks' @@ -35,7 +35,7 @@ const StyledTableCell = styled.td` ` const BODY_STYLE = css` - box-shadow: 0 0 0 1px ${COLORS.medGreyEnabled}; + box-shadow: 0 0 0 1px ${LEGACY_COLORS.medGreyEnabled}; border-radius: 3px; ` interface TipLengthCalibrationItemsProps { diff --git a/app/src/organisms/RobotSettingsCalibration/DeckCalibrationConfirmModal.tsx b/app/src/organisms/RobotSettingsCalibration/DeckCalibrationConfirmModal.tsx index beb3457a714..9144baa1621 100644 --- a/app/src/organisms/RobotSettingsCalibration/DeckCalibrationConfirmModal.tsx +++ b/app/src/organisms/RobotSettingsCalibration/DeckCalibrationConfirmModal.tsx @@ -5,7 +5,7 @@ import { DIRECTION_COLUMN, JUSTIFY_FLEX_END, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, PrimaryButton, SPACING, @@ -48,14 +48,14 @@ export function DeckCalibrationConfirmModal({ onClick={cancel} textTransform={TYPOGRAPHY.textTransformCapitalize} marginRight={SPACING.spacing24} - color={COLORS.blueEnabled} + color={LEGACY_COLORS.blueEnabled} css={TYPOGRAPHY.fontSizeP} fontWeight={TYPOGRAPHY.fontWeightSemiBold} > {t('shared:cancel')} {t('deck_calibration_description')} - + {deckLastModified} diff --git a/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx b/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx index 4787e6851fa..b5ade6fbc10 100644 --- a/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx +++ b/app/src/organisms/RobotSettingsCalibration/RobotSettingsGripperCalibration.tsx @@ -5,7 +5,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_END, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, POSITION_ABSOLUTE, @@ -41,7 +41,7 @@ const StyledTableCell = styled.td` ` const BODY_STYLE = css` - box-shadow: 0 0 0 1px ${COLORS.medGreyEnabled}; + box-shadow: 0 0 0 1px ${LEGACY_COLORS.medGreyEnabled}; border-radius: 3px; ` @@ -137,7 +137,7 @@ export function RobotSettingsGripperCalibration( borderRadius="4px 4px 0px 0px" boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="2.3rem" right={0} flexDirection={DIRECTION_COLUMN} diff --git a/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx b/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx index 032d5bd9343..eda8d23113a 100644 --- a/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx +++ b/app/src/organisms/RobotSettingsDashboard/DeviceReset.tsx @@ -7,7 +7,7 @@ import { Flex, DIRECTION_COLUMN, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, BORDERS, useConditionalConfirm, @@ -42,9 +42,9 @@ const OptionLabel = styled.label` padding: ${SPACING.spacing16} ${SPACING.spacing24}; border-radius: ${BORDERS.borderRadiusSize4}; color: ${({ isSelected }) => - isSelected === true ? COLORS.white : COLORS.darkBlack100}; + isSelected === true ? LEGACY_COLORS.white : LEGACY_COLORS.darkBlack100}; background: ${({ isSelected }) => - isSelected === true ? COLORS.blueEnabled : COLORS.mediumBlueEnabled}; + isSelected === true ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.mediumBlueEnabled}; ` interface DeviceResetProps { @@ -231,8 +231,8 @@ export function DeviceReset({ as="p" color={ resetOptions[option.id] ?? false - ? COLORS.white - : COLORS.darkBlack70 + ? LEGACY_COLORS.white + : LEGACY_COLORS.darkBlack70 } > {subText} @@ -283,8 +283,8 @@ export function DeviceReset({ ((resetOptions.authorizedKeys ?? false) && (resetOptions.onDeviceDisplay ?? false)) || isEveryOptionSelected(resetOptions) - ? COLORS.white - : COLORS.darkBlack70 + ? LEGACY_COLORS.white + : LEGACY_COLORS.darkBlack70 } > {t('clear_all_stored_data_description')} @@ -325,7 +325,7 @@ export const ConfirmClearDataModal = ({ title: t('confirm_device_reset_heading'), hasExitIcon: false, iconName: 'ot-alert', - iconColor: COLORS.yellow2, + iconColor: LEGACY_COLORS.yellow2, } return ( diff --git a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx index 10e686403b6..f4982f1bcbf 100644 --- a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx +++ b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/WifiConnectionDetails.tsx @@ -6,7 +6,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, DISPLAY_FLEX, @@ -79,7 +79,7 @@ export function WifiConnectionDetails({ {t('connected_network')} @@ -87,7 +87,7 @@ export function WifiConnectionDetails({ display={DISPLAY_FLEX} width="100%" padding={SPACING.spacing24} - backgroundColor={COLORS.green3} + backgroundColor={LEGACY_COLORS.green3} borderRadius={BORDERS.borderRadiusSize3} onClick={() => setShowNetworkDetailModal(true)} alignItems={ALIGN_CENTER} @@ -124,7 +124,7 @@ export function WifiConnectionDetails({ size="2.5rem" name="info" aria-label={`${activeSsid}_info_icon`} - color={COLORS.darkBlack100} + color={LEGACY_COLORS.darkBlack100} /> {t('view_details')} @@ -138,7 +138,7 @@ export function WifiConnectionDetails({ diff --git a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/index.tsx b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/index.tsx index ba6912a08d2..230781097fc 100644 --- a/app/src/organisms/RobotSettingsDashboard/NetworkSettings/index.tsx +++ b/app/src/organisms/RobotSettingsDashboard/NetworkSettings/index.tsx @@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, Icon, Btn, DIRECTION_ROW, @@ -43,7 +43,7 @@ export function NetworkSettings({ } const handleButtonBackgroundColor = (isConnected: boolean): string => - isConnected ? COLORS.green3 : COLORS.light1 + isConnected ? LEGACY_COLORS.green3 : LEGACY_COLORS.light1 const handleChipText = (isConnected: boolean): string => isConnected ? t('connected') : t('not_connected') @@ -102,8 +102,8 @@ function NetworkSettingButton({ const PUSHED_STATE_STYLE = css` &:active { background-color: ${chipType === 'success' - ? COLORS.green3Pressed - : COLORS.darkBlack40}; + ? LEGACY_COLORS.green3Pressed + : LEGACY_COLORS.darkBlack40}; } ` @@ -135,7 +135,7 @@ function NetworkSettingButton({ fontSize={TYPOGRAPHY.fontSize28} lineHeight={TYPOGRAPHY.lineHeight36} fontWeight={TYPOGRAPHY.fontWeightRegular} - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} > {networkName} diff --git a/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx b/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx index 955179bc069..c462289cf2e 100644 --- a/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx +++ b/app/src/organisms/RobotSettingsDashboard/RobotSystemVersion.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -79,7 +79,7 @@ export function RobotSystemVersion({ {t('view_latest_release_notes_at', { url: GITHUB_URL })} - props.isActive ? COLORS.highlightPurple1 : COLORS.highlightPurple2}; + props.isActive ? LEGACY_COLORS.highlightPurple1 : LEGACY_COLORS.highlightPurple2}; ` interface TextSizeProps { @@ -62,7 +62,7 @@ export function TextSize({ setCurrentOption }: TextSizeProps): JSX.Element { textSize="1.375rem" lineHeight="1.75rem" fontWeight={TYPOGRAPHY.fontWeightRegular} - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} textAlign={TYPOGRAPHY.textAlignCenter} > {t('text_size_description')} diff --git a/app/src/organisms/RobotSettingsDashboard/TouchscreenBrightness.tsx b/app/src/organisms/RobotSettingsDashboard/TouchscreenBrightness.tsx index 1f86e05c4b3..247cc90688e 100644 --- a/app/src/organisms/RobotSettingsDashboard/TouchscreenBrightness.tsx +++ b/app/src/organisms/RobotSettingsDashboard/TouchscreenBrightness.tsx @@ -8,7 +8,7 @@ import { ALIGN_CENTER, BORDERS, Box, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -37,7 +37,7 @@ const BrightnessTile = styled(Box)` height: 8.75rem; border-radius: ${BORDERS.borderRadiusSize2}; background: ${(props: BrightnessTileProps) => - props.isActive ? COLORS.blueEnabled : COLORS.mediumBlueEnabled}; + props.isActive ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.mediumBlueEnabled}; ` // Note The actual brightness is Bright 1 <---> 6 Dark which is opposite to the UI @@ -122,14 +122,14 @@ export function TouchscreenBrightness({ const IconButton = styled('button')` border-radius: 50%; max-height: 100%; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; &:active { - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:disabled { background-color: transparent; diff --git a/app/src/organisms/RobotSettingsDashboard/UpdateChannel.tsx b/app/src/organisms/RobotSettingsDashboard/UpdateChannel.tsx index 11cc7b06553..9da354ca223 100644 --- a/app/src/organisms/RobotSettingsDashboard/UpdateChannel.tsx +++ b/app/src/organisms/RobotSettingsDashboard/UpdateChannel.tsx @@ -8,7 +8,7 @@ import { SPACING, DIRECTION_COLUMN, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, BORDERS, } from '@opentrons/components' @@ -36,8 +36,8 @@ const SettingButtonLabel = styled.label` border-radius: ${BORDERS.borderRadiusSize4}; cursor: pointer; background: ${({ isSelected }) => - isSelected === true ? COLORS.blueEnabled : COLORS.mediumBlueEnabled}; - color: ${({ isSelected }) => isSelected === true && COLORS.white}; + isSelected === true ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.mediumBlueEnabled}; + color: ${({ isSelected }) => isSelected === true && LEGACY_COLORS.white}; ` interface UpdateChannelProps { @@ -113,8 +113,8 @@ export function UpdateChannel({ fontWeight={TYPOGRAPHY.fontWeightRegular} color={ radio.value === channel - ? COLORS.white - : COLORS.darkBlack70 + ? LEGACY_COLORS.white + : LEGACY_COLORS.darkBlack70 } > {t('alpha_description')} diff --git a/app/src/organisms/RobotSetupHeader/index.tsx b/app/src/organisms/RobotSetupHeader/index.tsx index f0961407c87..e439f96e878 100644 --- a/app/src/organisms/RobotSetupHeader/index.tsx +++ b/app/src/organisms/RobotSetupHeader/index.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { ALIGN_CENTER, Btn, - COLORS, + LEGACY_COLORS, Flex, Icon, JUSTIFY_CENTER, @@ -49,7 +49,7 @@ export function RobotSetupHeader({ position={POSITION_ABSOLUTE} left="0" > - + ) : null} diff --git a/app/src/organisms/RunDetails/ConfirmCancelModal.tsx b/app/src/organisms/RunDetails/ConfirmCancelModal.tsx index 46f2dcd1e1e..047642f3963 100644 --- a/app/src/organisms/RunDetails/ConfirmCancelModal.tsx +++ b/app/src/organisms/RunDetails/ConfirmCancelModal.tsx @@ -9,7 +9,7 @@ import { DIRECTION_COLUMN, JUSTIFY_FLEX_END, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, ALIGN_CENTER, } from '@opentrons/components' import { @@ -88,7 +88,7 @@ export function ConfirmCancelModal( )} {t('run_preview')} - + {t('steps_total', { count: robotSideAnalysis.commands.length })} @@ -92,14 +92,14 @@ export const RunPreviewComponent = ( {(command, index) => { const isCurrent = index === currentRunCommandIndex const borderColor = isCurrent - ? COLORS.blueEnabled - : COLORS.transparent + ? LEGACY_COLORS.blueEnabled + : LEGACY_COLORS.transparent const backgroundColor = isCurrent - ? COLORS.lightBlue - : COLORS.fundamentalsBackground + ? LEGACY_COLORS.lightBlue + : LEGACY_COLORS.fundamentalsBackground const contentColor = isCurrent - ? COLORS.darkBlackEnabled - : COLORS.darkGreyEnabled + ? LEGACY_COLORS.darkBlackEnabled + : LEGACY_COLORS.darkGreyEnabled return ( diff --git a/app/src/organisms/TakeoverModal/TakeoverModal.tsx b/app/src/organisms/TakeoverModal/TakeoverModal.tsx index 87c26e5b6dc..a2e58231e28 100644 --- a/app/src/organisms/TakeoverModal/TakeoverModal.tsx +++ b/app/src/organisms/TakeoverModal/TakeoverModal.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -36,7 +36,7 @@ export function TakeoverModal(props: TakeoverModalProps): JSX.Element { const terminateHeader: ModalHeaderBaseProps = { title: t('terminate') + '?', iconName: 'ot-alert', - iconColor: COLORS.yellow2, + iconColor: LEGACY_COLORS.yellow2, } return ( @@ -76,10 +76,10 @@ export function TakeoverModal(props: TakeoverModalProps): JSX.Element { > diff --git a/app/src/organisms/TaskList/index.tsx b/app/src/organisms/TaskList/index.tsx index ea5966b3097..63ded4d8782 100644 --- a/app/src/organisms/TaskList/index.tsx +++ b/app/src/organisms/TaskList/index.tsx @@ -7,7 +7,7 @@ import { ALIGN_CENTER, ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, FLEX_NONE, @@ -55,7 +55,7 @@ function ProgressTrackerItem({ borderLeft={BORDERS.lineBorder} borderColor={ isTaskListComplete || isPastTask || isActiveTaskWithSubtasks - ? COLORS.blueEnabled + ? LEGACY_COLORS.blueEnabled : '' } marginTop={`-${SPACING.spacing12}`} @@ -78,8 +78,8 @@ function ProgressTrackerItem({ name="ot-check" color={ isTaskListComplete || isPastTask - ? COLORS.blueEnabled - : COLORS.medGreyHover + ? LEGACY_COLORS.blueEnabled + : LEGACY_COLORS.medGreyHover } /> ) : ( @@ -88,9 +88,9 @@ function ProgressTrackerItem({ alignItems={ALIGN_CENTER} justifyContent={JUSTIFY_CENTER} backgroundColor={ - isFutureTask ? COLORS.medGreyHover : COLORS.blueEnabled + isFutureTask ? LEGACY_COLORS.medGreyHover : LEGACY_COLORS.blueEnabled } - color={COLORS.white} + color={LEGACY_COLORS.white} margin={SPACING.spacing16} height="1.25rem" width="1.25rem" @@ -144,17 +144,17 @@ function ProgressTrackerItem({ backgroundColor={ // is in the past or list is complete isTaskListComplete || isPastSubTask - ? COLORS.blueEnabled + ? LEGACY_COLORS.blueEnabled : subTask.isComplete === true - ? COLORS.medGreyHover + ? LEGACY_COLORS.medGreyHover : 'initial' } border={BORDERS.lineBorder} borderColor={ - isFutureSubTask ? COLORS.medGreyHover : COLORS.blueEnabled + isFutureSubTask ? LEGACY_COLORS.medGreyHover : LEGACY_COLORS.blueEnabled } borderWidth={SPACING.spacing2} - color={COLORS.white} + color={LEGACY_COLORS.white} margin={SPACING.spacing16} height="0.75rem" width="0.75rem" @@ -167,10 +167,10 @@ function ProgressTrackerItem({ borderColor={ // do not show the subtask connector if it's the final subtask of the task list isFinalSubTaskOfTaskList - ? COLORS.transparent + ? LEGACY_COLORS.transparent : isTaskListComplete || isPastSubTask - ? COLORS.blueEnabled - : COLORS.medGreyEnabled + ? LEGACY_COLORS.blueEnabled + : LEGACY_COLORS.medGreyEnabled } marginTop={`-${SPACING.spacing8}`} marginBottom={ @@ -219,7 +219,7 @@ function SubTask({ return ( {description} {footer != null ? ( - + @@ -361,7 +361,7 @@ function Task({ flexDirection={DIRECTION_COLUMN} padding={SPACING.spacing16} backgroundColor={ - isActiveTask && !isTaskOpen ? COLORS.lightBlue : COLORS.white + isActiveTask && !isTaskOpen ? LEGACY_COLORS.lightBlue : LEGACY_COLORS.white } border={ isActiveTask && !isTaskOpen @@ -393,8 +393,8 @@ function Task({ {markedBad === true && ( @@ -404,7 +404,7 @@ function Task({ {description} {footer != null ? ( - + - + {t('checking_for_updates')} diff --git a/app/src/organisms/UpdateRobotSoftware/CompleteUpdateSoftware.tsx b/app/src/organisms/UpdateRobotSoftware/CompleteUpdateSoftware.tsx index 2887bee9c69..00c18e0d65e 100644 --- a/app/src/organisms/UpdateRobotSoftware/CompleteUpdateSoftware.tsx +++ b/app/src/organisms/UpdateRobotSoftware/CompleteUpdateSoftware.tsx @@ -5,7 +5,7 @@ import { Flex, DIRECTION_COLUMN, SPACING, - COLORS, + LEGACY_COLORS, ALIGN_CENTER, JUSTIFY_CENTER, Box, @@ -28,7 +28,7 @@ export function CompleteUpdateSoftware({ {t('update_complete')} diff --git a/app/src/organisms/UpdateRobotSoftware/ErrorUpdateSoftware.tsx b/app/src/organisms/UpdateRobotSoftware/ErrorUpdateSoftware.tsx index d8028301c7e..9f5a24da60d 100644 --- a/app/src/organisms/UpdateRobotSoftware/ErrorUpdateSoftware.tsx +++ b/app/src/organisms/UpdateRobotSoftware/ErrorUpdateSoftware.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, Icon, DIRECTION_COLUMN, ALIGN_CENTER, @@ -33,14 +33,14 @@ export function ErrorUpdateSoftware({ > - + {t('software_update_error')} diff --git a/app/src/organisms/UpdateRobotSoftware/NoUpdateFound.tsx b/app/src/organisms/UpdateRobotSoftware/NoUpdateFound.tsx index 912b152b934..6447f18e68f 100644 --- a/app/src/organisms/UpdateRobotSoftware/NoUpdateFound.tsx +++ b/app/src/organisms/UpdateRobotSoftware/NoUpdateFound.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, Icon, DIRECTION_COLUMN, ALIGN_CENTER, @@ -31,7 +31,7 @@ export function NoUpdateFound(props: NoUpdateFoundProps): JSX.Element { > diff --git a/app/src/organisms/UpdateRobotSoftware/UpdateSoftware.tsx b/app/src/organisms/UpdateRobotSoftware/UpdateSoftware.tsx index 58f835fbbf5..b2fb1ffea5a 100644 --- a/app/src/organisms/UpdateRobotSoftware/UpdateSoftware.tsx +++ b/app/src/organisms/UpdateRobotSoftware/UpdateSoftware.tsx @@ -5,7 +5,7 @@ import { ALIGN_CENTER, BORDERS, Box, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, JUSTIFY_CENTER, @@ -43,7 +43,7 @@ export function UpdateSoftware({ return ( {renderText()} diff --git a/app/src/organisms/UpdateRobotSoftware/__tests__/UpdateSoftware.test.tsx b/app/src/organisms/UpdateRobotSoftware/__tests__/UpdateSoftware.test.tsx index 35023254bdd..fbf65170e1a 100644 --- a/app/src/organisms/UpdateRobotSoftware/__tests__/UpdateSoftware.test.tsx +++ b/app/src/organisms/UpdateRobotSoftware/__tests__/UpdateSoftware.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { renderWithProviders, COLORS } from '@opentrons/components' +import { renderWithProviders, LEGACY_COLORS } from '@opentrons/components' import { i18n } from '../../../i18n' import { UpdateSoftware } from '../UpdateSoftware' @@ -21,7 +21,7 @@ describe('UpdateSoftware', () => { const [{ getByText, getByTestId }] = render(props) getByText('Downloading software...') const bar = getByTestId('ProgressBar_Bar') - expect(bar).toHaveStyle(`background: ${String(COLORS.blueEnabled)}`) + expect(bar).toHaveStyle(`background: ${String(LEGACY_COLORS.blueEnabled)}`) expect(bar).toHaveStyle('width: 50%') }) it('should render text and progressbar - sending software', () => { diff --git a/app/src/pages/AppSettings/AdvancedSettings.tsx b/app/src/pages/AppSettings/AdvancedSettings.tsx index 2100d73d3c6..6d221c60070 100644 --- a/app/src/pages/AppSettings/AdvancedSettings.tsx +++ b/app/src/pages/AppSettings/AdvancedSettings.tsx @@ -12,7 +12,7 @@ import { SPACING_AUTO, ALIGN_CENTER, JUSTIFY_SPACE_BETWEEN, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, DIRECTION_COLUMN, @@ -211,7 +211,7 @@ export function AdvancedSettings(): JSX.Element { @@ -275,7 +275,7 @@ export function AdvancedSettings(): JSX.Element { {t('additional_folder_location')} @@ -284,7 +284,7 @@ export function AdvancedSettings(): JSX.Element { dispatch(CustomLabware.openCustomLabwareDirectory()) } @@ -435,7 +435,7 @@ export function AdvancedSettings(): JSX.Element { {t('override_path')} @@ -444,7 +444,7 @@ export function AdvancedSettings(): JSX.Element { dispatch(ProtocolAnalysis.openPythonInterpreterDirectory()) } @@ -561,14 +561,14 @@ export function AdvancedSettings(): JSX.Element { {driverOutdated && ( - + {t('usb_to_ethernet_adapter_toast_message')} diff --git a/app/src/pages/AppSettings/GeneralSettings.tsx b/app/src/pages/AppSettings/GeneralSettings.tsx index c92daad5db1..9ab87df5a46 100644 --- a/app/src/pages/AppSettings/GeneralSettings.tsx +++ b/app/src/pages/AppSettings/GeneralSettings.tsx @@ -14,7 +14,7 @@ import { JUSTIFY_SPACE_BETWEEN, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, ALIGN_START, DIRECTION_COLUMN, } from '@opentrons/components' @@ -174,7 +174,7 @@ export function GeneralSettings(): JSX.Element { {t('up_to_date')} diff --git a/app/src/pages/AppSettings/index.tsx b/app/src/pages/AppSettings/index.tsx index 93b787779ab..a8ba8f7e853 100644 --- a/app/src/pages/AppSettings/index.tsx +++ b/app/src/pages/AppSettings/index.tsx @@ -10,7 +10,7 @@ import { ALIGN_START, DIRECTION_ROW, SPACING, - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, } from '@opentrons/components' @@ -47,10 +47,10 @@ export function AppSettings(): JSX.Element { return ( diff --git a/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx b/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx index 2d48c93b414..161707be28d 100644 --- a/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx +++ b/app/src/pages/ConnectViaEthernet/DisplayConnectionStatus.tsx @@ -5,7 +5,7 @@ import { useHistory } from 'react-router-dom' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -34,7 +34,7 @@ export function DisplayConnectionStatus({ {t('ethernet_connection_description')} diff --git a/app/src/pages/ConnectViaUSB/index.tsx b/app/src/pages/ConnectViaUSB/index.tsx index 1a352d4053d..d787a9f905e 100644 --- a/app/src/pages/ConnectViaUSB/index.tsx +++ b/app/src/pages/ConnectViaUSB/index.tsx @@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, JUSTIFY_CENTER, ALIGN_CENTER, @@ -70,7 +70,7 @@ export function ConnectViaUSB(): JSX.Element { - + {t('find_your_robot')} @@ -104,7 +104,7 @@ export function ConnectViaUSB(): JSX.Element { ) : ( - + {t('connect_via_usb_description_1')} - + {t('connect_via_usb_description_2')} - + {t('connect_via_usb_description_3')} diff --git a/app/src/pages/Devices/DeviceDetails/DeviceDetailsComponent.tsx b/app/src/pages/Devices/DeviceDetails/DeviceDetailsComponent.tsx index 47333226f01..2413adfcafd 100644 --- a/app/src/pages/Devices/DeviceDetails/DeviceDetailsComponent.tsx +++ b/app/src/pages/Devices/DeviceDetails/DeviceDetailsComponent.tsx @@ -3,7 +3,7 @@ import { useEstopQuery } from '@opentrons/react-api-client' import { ALIGN_CENTER, Box, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, SPACING, @@ -48,8 +48,8 @@ export function DeviceDetailsComponent({ ) : null} @@ -238,8 +238,8 @@ function PageContents(props: PageContentsProps): JSX.Element { diff --git a/app/src/pages/EmergencyStop/index.tsx b/app/src/pages/EmergencyStop/index.tsx index 03d6fe2ed0d..1bc99bf949d 100644 --- a/app/src/pages/EmergencyStop/index.tsx +++ b/app/src/pages/EmergencyStop/index.tsx @@ -6,7 +6,7 @@ import { Icon, Flex, SPACING, - COLORS, + LEGACY_COLORS, BORDERS, DIRECTION_COLUMN, JUSTIFY_CENTER, @@ -57,7 +57,7 @@ export function EmergencyStop(): JSX.Element { flexDirection={DIRECTION_COLUMN} padding={`${SPACING.spacing40} ${SPACING.spacing80}`} backgroundColor={ - isEstopConnected ? COLORS.green3 : COLORS.darkBlack20 + isEstopConnected ? LEGACY_COLORS.green3 : LEGACY_COLORS.darkBlack20 } borderRadius={BORDERS.borderRadiusSize3} alignItems={ALIGN_CENTER} @@ -74,7 +74,7 @@ export function EmergencyStop(): JSX.Element { @@ -87,7 +87,7 @@ export function EmergencyStop(): JSX.Element { {t('e_stop_not_connected')} diff --git a/app/src/pages/InitialLoadingScreen/index.tsx b/app/src/pages/InitialLoadingScreen/index.tsx index 4f519b6e40f..bda38b3ead9 100644 --- a/app/src/pages/InitialLoadingScreen/index.tsx +++ b/app/src/pages/InitialLoadingScreen/index.tsx @@ -3,7 +3,7 @@ import { Redirect } from 'react-router-dom' import { useSelector } from 'react-redux' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -35,7 +35,7 @@ export function InitialLoadingScreen(): JSX.Element { return ( {targetPath != null && } diff --git a/app/src/pages/InstrumentDetail/InstrumentDetailOverflowMenu.tsx b/app/src/pages/InstrumentDetail/InstrumentDetailOverflowMenu.tsx index af5a89e1dd6..2b465907fec 100644 --- a/app/src/pages/InstrumentDetail/InstrumentDetailOverflowMenu.tsx +++ b/app/src/pages/InstrumentDetail/InstrumentDetailOverflowMenu.tsx @@ -7,7 +7,7 @@ import { Icon, SPACING, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { SINGLE_MOUNT_PIPETTES, @@ -96,7 +96,7 @@ const InstrumentDetailsOverflowMenu = NiceModal.create( { name="overflow-btn-touchscreen" height="3.75rem" width="3rem" - color={COLORS.darkBlack70} + color={LEGACY_COLORS.darkBlack70} /> @@ -78,14 +78,14 @@ export const InstrumentDetail = (): JSX.Element => { const IconButton = styled('button')` border-radius: ${SPACING.spacing4}; max-height: 100%; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; &:active { - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.darkBlack20}; + background-color: ${LEGACY_COLORS.darkBlack20}; } &:disabled { background-color: transparent; diff --git a/app/src/pages/InstrumentsDashboard/PipetteRecalibrationODDWarning.tsx b/app/src/pages/InstrumentsDashboard/PipetteRecalibrationODDWarning.tsx index f44d75dd1f3..bc07dd8c328 100644 --- a/app/src/pages/InstrumentsDashboard/PipetteRecalibrationODDWarning.tsx +++ b/app/src/pages/InstrumentsDashboard/PipetteRecalibrationODDWarning.tsx @@ -4,7 +4,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, Flex, Icon, JUSTIFY_FLEX_START, @@ -23,7 +23,7 @@ export const PipetteRecalibrationODDWarning = (): JSX.Element | null => { justifyContent={JUSTIFY_SPACE_BETWEEN} alignItems={ALIGN_CENTER} borderRadius={BORDERS.borderRadiusSize3} - backgroundColor={COLORS.yellow3} + backgroundColor={LEGACY_COLORS.yellow3} padding={`${SPACING.spacing12} ${SPACING.spacing16}`} height="5.76rem" width="60rem" @@ -31,7 +31,7 @@ export const PipetteRecalibrationODDWarning = (): JSX.Element | null => { {t('shared:sort_by')} @@ -194,7 +194,7 @@ export function Labware(): JSX.Element { borderRadius={BORDERS.radiusSoftCorners} boxShadow="0px 1px 3px rgba(0, 0, 0, 0.2)" position={POSITION_ABSOLUTE} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} top="8.5rem" right={SPACING.spacing2} flexDirection={DIRECTION_COLUMN} @@ -238,7 +238,7 @@ export function Labware(): JSX.Element { > {t('create_new_def')} diff --git a/app/src/pages/NameRobot/index.tsx b/app/src/pages/NameRobot/index.tsx index 7e778652457..2bf1e76998a 100644 --- a/app/src/pages/NameRobot/index.tsx +++ b/app/src/pages/NameRobot/index.tsx @@ -16,7 +16,7 @@ import { JUSTIFY_CENTER, POSITION_RELATIVE, POSITION_ABSOLUTE, - COLORS, + LEGACY_COLORS, TYPOGRAPHY, Icon, Btn, @@ -179,7 +179,7 @@ export function NameRobot(): JSX.Element { } }} > - + @@ -224,7 +224,7 @@ export function NameRobot(): JSX.Element { {t('name_your_robot_description')} @@ -243,7 +243,7 @@ export function NameRobot(): JSX.Element { {t('name_rule_description')} @@ -252,7 +252,7 @@ export function NameRobot(): JSX.Element { {formik.errors.newRobotName} diff --git a/app/src/pages/NetworkSetupMenu/index.tsx b/app/src/pages/NetworkSetupMenu/index.tsx index 38f126305b4..08ab6501a74 100644 --- a/app/src/pages/NetworkSetupMenu/index.tsx +++ b/app/src/pages/NetworkSetupMenu/index.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_CENTER, ALIGN_CENTER, @@ -57,7 +57,7 @@ export function NetworkSetupMenu(): JSX.Element { {t('choose_network_type')} @@ -70,7 +70,7 @@ export function NetworkSetupMenu(): JSX.Element { {t('network_setup_menu_description')} diff --git a/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx b/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx index f64f3471b3f..f69c34eb21f 100644 --- a/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx +++ b/app/src/pages/ProtocolDashboard/DeleteProtocolConfirmationModal.tsx @@ -6,7 +6,7 @@ import styled from 'styled-components' import { deleteProtocol, deleteRun, getProtocol } from '@opentrons/api-client' import { Flex, - COLORS, + LEGACY_COLORS, SPACING, TYPOGRAPHY, DIRECTION_ROW, @@ -37,7 +37,7 @@ export function DeleteProtocolConfirmationModal({ const modalHeader: ModalHeaderBaseProps = { title: t('delete_this_protocol'), iconName: 'ot-alert', - iconColor: COLORS.yellow2, + iconColor: LEGACY_COLORS.yellow2, } const host = useHost() const queryClient = useQueryClient() @@ -128,11 +128,11 @@ const ProtocolNameText = styled.span` font-weight: ${TYPOGRAPHY.fontWeightBold}; font-size: ${TYPOGRAPHY.fontSize22}; line-height: ${TYPOGRAPHY.lineHeight28}; - color: ${COLORS.darkBlack90}; + color: ${LEGACY_COLORS.darkBlack90}; ` const AdditionalText = styled.span` font-weight: ${TYPOGRAPHY.fontWeightRegular}; font-size: ${TYPOGRAPHY.fontSize22}; line-height: ${TYPOGRAPHY.lineHeight28}; - color: ${COLORS.darkBlack90}; + color: ${LEGACY_COLORS.darkBlack90}; ` diff --git a/app/src/pages/ProtocolDashboard/NoProtocols.tsx b/app/src/pages/ProtocolDashboard/NoProtocols.tsx index a4987026d11..917b8a40f63 100644 --- a/app/src/pages/ProtocolDashboard/NoProtocols.tsx +++ b/app/src/pages/ProtocolDashboard/NoProtocols.tsx @@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, JUSTIFY_CENTER, @@ -21,7 +21,7 @@ export function NoProtocols(): JSX.Element { return ( {t('nothing_here_yet')} - + {t('send_a_protocol_to_store')} diff --git a/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx b/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx index 1b824274ac4..7cbb36e9660 100644 --- a/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx +++ b/app/src/pages/ProtocolDashboard/PinnedProtocol.tsx @@ -7,7 +7,7 @@ import styled, { css } from 'styled-components' import { ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -95,14 +95,14 @@ export function PinnedProtocol(props: { const PUSHED_STATE_STYLE = css` &:active { - background-color: ${longpress.isLongPressed ? '' : COLORS.darkBlack40}; + background-color: ${longpress.isLongPressed ? '' : LEGACY_COLORS.darkBlack40}; } ` return ( {lastRun !== undefined diff --git a/app/src/pages/ProtocolDashboard/ProtocolCard.tsx b/app/src/pages/ProtocolDashboard/ProtocolCard.tsx index fca8db7fe72..d57de60920b 100644 --- a/app/src/pages/ProtocolDashboard/ProtocolCard.tsx +++ b/app/src/pages/ProtocolDashboard/ProtocolCard.tsx @@ -10,7 +10,7 @@ import { ALIGN_CENTER, ALIGN_END, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -146,15 +146,15 @@ export function ProtocolCard(props: { background-color: ${longpress.isLongPressed ? '' : isFailedAnalysis - ? COLORS.red3Pressed - : COLORS.darkBlack40}; + ? LEGACY_COLORS.red3Pressed + : LEGACY_COLORS.darkBlack40}; } ` return ( {isFailedAnalysis ? ( @@ -204,7 +204,7 @@ export function ProtocolCard(props: { - + {lastRun != null ? formatDistance(new Date(lastRun), new Date(), { addSuffix: true, @@ -213,7 +213,7 @@ export function ProtocolCard(props: { - + {formatTimeWithUtcLabel(protocol.createdAt)} {longpress.isLongPressed && !isFailedAnalysis && ( diff --git a/app/src/pages/ProtocolDashboard/index.tsx b/app/src/pages/ProtocolDashboard/index.tsx index fd11c3e2192..43d2adc80a0 100644 --- a/app/src/pages/ProtocolDashboard/index.tsx +++ b/app/src/pages/ProtocolDashboard/index.tsx @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux' import { useTranslation } from 'react-i18next' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -161,7 +161,7 @@ export function ProtocolDashboard(): JSX.Element { {t('pinned_protocols')} @@ -177,7 +177,7 @@ export function ProtocolDashboard(): JSX.Element { <> { return ( { diff --git a/app/src/pages/ProtocolDetails/Hardware.tsx b/app/src/pages/ProtocolDetails/Hardware.tsx index 83cf3c87a77..e3297c731af 100644 --- a/app/src/pages/ProtocolDetails/Hardware.tsx +++ b/app/src/pages/ProtocolDetails/Hardware.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, Flex, LocationIcon, ModuleIcon, @@ -41,8 +41,8 @@ const TableHeader = styled('th')` ` const TableRow = styled('tr')` - background-color: ${COLORS.light1}; - border: 1px ${COLORS.white} solid; + background-color: ${LEGACY_COLORS.light1}; + border: 1px ${LEGACY_COLORS.white} solid; height: 4.75rem; ` @@ -102,7 +102,7 @@ export const Hardware = (props: { protocolId: string }): JSX.Element => { @@ -112,7 +112,7 @@ export const Hardware = (props: { protocolId: string }): JSX.Element => { diff --git a/app/src/pages/ProtocolDetails/Labware.tsx b/app/src/pages/ProtocolDetails/Labware.tsx index cd9b247a2af..81f62827625 100644 --- a/app/src/pages/ProtocolDetails/Labware.tsx +++ b/app/src/pages/ProtocolDetails/Labware.tsx @@ -4,7 +4,7 @@ import styled from 'styled-components' import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_ROW, Flex, Icon, @@ -32,8 +32,8 @@ const TableHeader = styled('th')` ` const TableRow = styled('tr')` - background-color: ${COLORS.light1}; - border: 1px ${COLORS.white} solid; + background-color: ${LEGACY_COLORS.light1}; + border: 1px ${LEGACY_COLORS.white} solid; height: 4.75rem; ` @@ -77,7 +77,7 @@ export const Labware = (props: { protocolId: string }): JSX.Element => { { { > {definition?.namespace === 'opentrons' ? ( { { {i18n.format(liquid.displayName, 'titleCase')} - + {i18n.format(liquid.description, 'titleCase')} @@ -132,7 +132,7 @@ export const Liquids = (props: { protocolId: string }): JSX.Element => { @@ -107,7 +107,7 @@ const ProtocolHeader = ({ onClick={() => history.push('/protocols')} width="3rem" > - + { {description ?? i18n.format(t('no_summary'), 'capitalize')} - + ) } @@ -119,27 +119,27 @@ export function CloseButton({ onClose }: CloseButtonProps): JSX.Element { const CLOSE_BUTTON_STYLE = css` -webkit-tap-highlight-color: transparent; &:focus { - background-color: ${COLORS.red2Pressed}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.red2Pressed}; + color: ${LEGACY_COLORS.white}; } &:hover { - background-color: ${COLORS.red2}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.red2}; + color: ${LEGACY_COLORS.white}; } &:focus-visible { box-shadow: ${ODD_FOCUS_VISIBLE}; - background-color: ${COLORS.red2}; + background-color: ${LEGACY_COLORS.red2}; } &:active { - background-color: ${COLORS.red2Pressed}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.red2Pressed}; + color: ${LEGACY_COLORS.white}; } &:disabled { - background-color: ${COLORS.darkBlack20}; - color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.darkBlack20}; + color: ${LEGACY_COLORS.darkBlack60}; } ` diff --git a/app/src/pages/ProtocolSetup/index.tsx b/app/src/pages/ProtocolSetup/index.tsx index 8573051d40e..10124d19f83 100644 --- a/app/src/pages/ProtocolSetup/index.tsx +++ b/app/src/pages/ProtocolSetup/index.tsx @@ -11,7 +11,7 @@ import { ALIGN_CENTER, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, Icon, @@ -118,9 +118,9 @@ export function ProtocolSetupStep({ disabledReason, }: ProtocolSetupStepProps): JSX.Element { const backgroundColorByStepStatus = { - ready: COLORS.green3, - 'not ready': COLORS.yellow3, - general: COLORS.light1, + ready: LEGACY_COLORS.green3, + 'not ready': LEGACY_COLORS.yellow3, + general: LEGACY_COLORS.light1, } const { makeSnackbar } = useToaster() @@ -134,13 +134,13 @@ export function ProtocolSetupStep({ if (!disabled) { switch (status) { case 'general': - backgroundColor = COLORS.darkBlack40 + backgroundColor = LEGACY_COLORS.darkBlack40 break case 'ready': - backgroundColor = COLORS.green3Pressed + backgroundColor = LEGACY_COLORS.green3Pressed break default: - backgroundColor = COLORS.yellow3Pressed + backgroundColor = LEGACY_COLORS.yellow3Pressed } } else backgroundColor = '' @@ -160,7 +160,7 @@ export function ProtocolSetupStep({ {status !== 'general' && !disabled ? ( @@ -177,7 +177,7 @@ export function ProtocolSetupStep({ {title} @@ -185,7 +185,7 @@ export function ProtocolSetupStep({ {detail} {subDetail != null && detail != null ?
: null} @@ -590,7 +590,7 @@ function PrepareToRun({ padding={`${SPACING.spacing32} ${SPACING.spacing40} ${SPACING.spacing40}`} position={POSITION_STICKY} top={0} - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} overflowY="auto" marginX={`-${SPACING.spacing32}`} > @@ -607,7 +607,7 @@ function PrepareToRun({
diff --git a/app/src/pages/RobotDashboard/AnalyticsOptInModal.tsx b/app/src/pages/RobotDashboard/AnalyticsOptInModal.tsx index 295cd6bcc0b..4bc1e1ae24f 100644 --- a/app/src/pages/RobotDashboard/AnalyticsOptInModal.tsx +++ b/app/src/pages/RobotDashboard/AnalyticsOptInModal.tsx @@ -4,7 +4,7 @@ import { useDispatch, useSelector } from 'react-redux' import { Flex, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, SPACING, @@ -64,7 +64,7 @@ export function AnalyticsOptInModal({ gridGap={SPACING.spacing12} paddingBottom={SPACING.spacing32} > - + {t('opt_in_description')}
diff --git a/app/src/pages/RobotDashboard/WelcomeModal.tsx b/app/src/pages/RobotDashboard/WelcomeModal.tsx index 6bc4fed3a4a..bdd809f2df6 100644 --- a/app/src/pages/RobotDashboard/WelcomeModal.tsx +++ b/app/src/pages/RobotDashboard/WelcomeModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { useTranslation } from 'react-i18next' import { - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, JUSTIFY_CENTER, @@ -77,7 +77,7 @@ export function WelcomeModal({ {t('welcome_modal_description')} diff --git a/app/src/pages/RobotDashboard/index.tsx b/app/src/pages/RobotDashboard/index.tsx index d06fe9bb0cf..037e82c7e40 100644 --- a/app/src/pages/RobotDashboard/index.tsx +++ b/app/src/pages/RobotDashboard/index.tsx @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next' import { useSelector } from 'react-redux' import { - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Flex, SPACING, @@ -66,7 +66,7 @@ export function RobotDashboard(): JSX.Element { {t('run_again')} diff --git a/app/src/pages/RobotSettingsDashboard/RobotSettingButton.tsx b/app/src/pages/RobotSettingsDashboard/RobotSettingButton.tsx index 98a57a6681c..e2282d507b6 100644 --- a/app/src/pages/RobotSettingsDashboard/RobotSettingButton.tsx +++ b/app/src/pages/RobotSettingsDashboard/RobotSettingButton.tsx @@ -6,7 +6,7 @@ import { ALIGN_FLEX_START, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, DISPLAY_FLEX, @@ -25,12 +25,12 @@ import type { IconName } from '@opentrons/components' const SETTING_BUTTON_STYLE = css` width: 100%; margin-bottom: ${SPACING.spacing8}; - background-color: ${COLORS.light1}; + background-color: ${LEGACY_COLORS.light1}; padding: ${SPACING.spacing20} ${SPACING.spacing24}; border-radius: ${BORDERS.borderRadiusSize4}; &:active { - background-color: ${COLORS.darkBlack40}; + background-color: ${LEGACY_COLORS.darkBlack40}; } ` @@ -69,7 +69,7 @@ export function RobotSettingButton({ whiteSpace="nowrap" > {iconName != null ? ( - + ) : null} {settingInfo != null ? ( - + )} diff --git a/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx b/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx index 905f5518943..0342395f482 100644 --- a/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx +++ b/app/src/pages/RobotSettingsDashboard/RobotSettingsList.tsx @@ -8,7 +8,7 @@ import { DIRECTION_COLUMN, SPACING, Btn, - COLORS, + LEGACY_COLORS, BORDERS, DISPLAY_FLEX, DIRECTION_ROW, @@ -118,7 +118,7 @@ export function RobotSettingsList(props: RobotSettingsListProps): JSX.Element { hug={true} /> ) : null} - +
} /> @@ -206,7 +206,7 @@ function FeatureFlags(): JSX.Element { key={flag} width="100%" marginBottom={SPACING.spacing8} - backgroundColor={COLORS.light1} + backgroundColor={LEGACY_COLORS.light1} padding={`${SPACING.spacing20} ${SPACING.spacing24}`} borderRadius={BORDERS.borderRadiusSize4} display={DISPLAY_FLEX} @@ -223,7 +223,7 @@ function FeatureFlags(): JSX.Element { gridGap={SPACING.spacing24} alignItems={ALIGN_CENTER} > - + diff --git a/app/src/pages/RunSummary/index.tsx b/app/src/pages/RunSummary/index.tsx index 6b7a06ac62d..6c6be942c5f 100644 --- a/app/src/pages/RunSummary/index.tsx +++ b/app/src/pages/RunSummary/index.tsx @@ -10,7 +10,7 @@ import { ALIGN_STRETCH, BORDERS, Btn, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, DISPLAY_FLEX, @@ -212,7 +212,7 @@ export function RunSummary(): JSX.Element { aria-label="icon_ot-spinner" spin={true} size="2.5rem" - color={COLORS.white} + color={LEGACY_COLORS.white} /> ) @@ -238,14 +238,14 @@ export function RunSummary(): JSX.Element { flexDirection={DIRECTION_COLUMN} gridGap={SPACING.spacing40} padding={SPACING.spacing40} - backgroundColor={didRunSucceed ? COLORS.green2 : COLORS.red2} + backgroundColor={didRunSucceed ? LEGACY_COLORS.green2 : LEGACY_COLORS.red2} > {didRunSucceed @@ -283,7 +283,7 @@ export function RunSummary(): JSX.Element { name={didRunSucceed ? 'ot-check' : 'ot-alert'} size="2rem" color={ - didRunSucceed ? COLORS.successEnabled : COLORS.errorEnabled + didRunSucceed ? LEGACY_COLORS.successEnabled : LEGACY_COLORS.errorEnabled } /> {headerText} @@ -358,7 +358,7 @@ const SplashHeader = styled.h1` text-align: ${TYPOGRAPHY.textAlignLeft}; font-size: 80px; line-height: 94px; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; ` const SplashBody = styled.h4` display: -webkit-box; @@ -371,7 +371,7 @@ const SplashBody = styled.h4` text-transform: ${TYPOGRAPHY.textTransformCapitalize}; font-size: ${TYPOGRAPHY.fontSize32}; line-height: ${TYPOGRAPHY.lineHeight42}; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; ` const SummaryHeader = styled.h4` @@ -388,7 +388,7 @@ const SplashFrame = styled(Flex)` flex-direction: ${DIRECTION_COLUMN}; justify-content: ${JUSTIFY_CENTER}; align-items: ${ALIGN_CENTER}; - border: ${BORDERS.borderRadiusSize2} solid ${COLORS.white}${COLORS.opacity20HexCode}; + border: ${BORDERS.borderRadiusSize2} solid ${LEGACY_COLORS.white}${LEGACY_COLORS.opacity20HexCode}; border-radius: ${BORDERS.borderRadiusSize3}; grid-gap: ${SPACING.spacing40}; ` @@ -398,7 +398,7 @@ const ProtocolName = styled.h4` text-align: ${TYPOGRAPHY.textAlignLeft}; font-size: ${TYPOGRAPHY.fontSize28}; line-height: ${TYPOGRAPHY.lineHeight36}; - color: ${COLORS.darkBlack70}; + color: ${LEGACY_COLORS.darkBlack70}; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; @@ -416,7 +416,7 @@ const SummaryDatum = styled.div` height: 44px; background: #d6d6d6; border-radius: 4px; - color: ${COLORS.darkBlack90}; + color: ${LEGACY_COLORS.darkBlack90}; font-size: ${TYPOGRAPHY.fontSize22}; line-height: ${TYPOGRAPHY.lineHeight28}; font-weight: ${TYPOGRAPHY.fontWeightRegular}; @@ -429,17 +429,17 @@ const DURATION_TEXT_STYLE = css` ` const RUN_AGAIN_CLICKED_STYLE = css` - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; &:focus { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } &:hover { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } &:focus-visible { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } &:active { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } ` diff --git a/app/src/pages/RunningProtocol/index.tsx b/app/src/pages/RunningProtocol/index.tsx index 48a55430427..39f62c098e9 100644 --- a/app/src/pages/RunningProtocol/index.tsx +++ b/app/src/pages/RunningProtocol/index.tsx @@ -5,7 +5,7 @@ import { useSelector } from 'react-redux' import { ALIGN_CENTER, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DIRECTION_ROW, Flex, @@ -64,7 +64,7 @@ const Bullet = styled.div` border-radius: 50%; z-index: 2; background: ${(props: BulletProps) => - props.isActive ? COLORS.darkBlack60 : COLORS.darkBlack40}; + props.isActive ? LEGACY_COLORS.darkBlack60 : LEGACY_COLORS.darkBlack40}; transform: ${(props: BulletProps) => props.isActive ? 'scale(2)' : 'scale(1)'}; ` diff --git a/app/src/pages/Welcome/index.tsx b/app/src/pages/Welcome/index.tsx index 4f534b1a0fc..b74a6df004e 100644 --- a/app/src/pages/Welcome/index.tsx +++ b/app/src/pages/Welcome/index.tsx @@ -4,7 +4,7 @@ import { useHistory } from 'react-router-dom' import { Flex, SPACING, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, JUSTIFY_CENTER, TYPOGRAPHY, @@ -36,7 +36,7 @@ export function Welcome(): JSX.Element { diff --git a/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx b/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx index f1487c3e1ba..5be5bac0763 100644 --- a/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx +++ b/components/src/atoms/CheckboxField/__tests__/CheckboxField.test.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { fireEvent } from '@testing-library/react' import { ALIGN_CENTER, JUSTIFY_CENTER } from '../../../styles' import { renderWithProviders } from '../../../testing/utils' -import { COLORS, TYPOGRAPHY, SPACING } from '../../../ui-style-constants' +import { LEGACY_COLORS, TYPOGRAPHY, SPACING } from '../../../ui-style-constants' import { CheckboxField } from '..' @@ -40,7 +40,7 @@ describe('CheckboxField', () => { // INNER_STYLE_NO_VALUE expect(checkBoxIcon).toHaveStyle(`width: 1.25rem`) expect(checkBoxIcon).toHaveStyle(`min-width: 1.25rem`) - expect(checkBoxIcon).toHaveStyle(`color: ${String(COLORS.darkGreyEnabled)}`) + expect(checkBoxIcon).toHaveStyle(`color: ${String(LEGACY_COLORS.darkGreyEnabled)}`) expect(checkBoxIcon).toHaveStyle(`display: flex`) expect(checkBoxIcon).toHaveStyle(`border-radius: 1px`) expect(checkBoxIcon).toHaveStyle( @@ -52,26 +52,26 @@ describe('CheckboxField', () => { }) expect(checkBoxIcon).toHaveStyleRule( 'color', - `${String(COLORS.darkGreyHover)}`, + `${String(LEGACY_COLORS.darkGreyHover)}`, { modifier: ':hover', } ) expect(checkBoxIcon).toHaveStyleRule( 'color', - `${String(COLORS.darkGreyPressed)}`, + `${String(LEGACY_COLORS.darkGreyPressed)}`, { modifier: ':active', } ) expect(checkBoxIcon).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${String(COLORS.fundamentalsFocus)}`, + `0 0 0 3px ${String(LEGACY_COLORS.fundamentalsFocus)}`, { modifier: ':focus' } ) expect(checkBoxIcon).toHaveStyleRule( 'color', - `${String(COLORS.darkGreyPressed)}`, + `${String(LEGACY_COLORS.darkGreyPressed)}`, { modifier: ':disabled', } @@ -82,7 +82,7 @@ describe('CheckboxField', () => { // expect(checkBoxLabel).toHaveStyle('@apply --font-form-default') // expect(checkBoxLabel).toHaveStyle('font-size: 0.75rem') // expect(checkBoxLabel).toHaveStyle('font-weight: 400') - // expect(checkBoxLabel).toHaveStyle(`color: ${COLORS.darkBlackEnabled}`) + // expect(checkBoxLabel).toHaveStyle(`color: ${LEGACY_COLORS.darkBlackEnabled}`) // expect(checkBoxLabel).toHaveStyle('display: flex') // expect(checkBoxLabel).toHaveStyle(`align-items: ${ALIGN_CENTER}`) // expect(checkBoxLabel).toHaveStyle('line-height: 1') @@ -106,7 +106,7 @@ describe('CheckboxField', () => { `font-weight: ${String(TYPOGRAPHY.fontWeightRegular)}` ) expect(checkBoxFieldBox).toHaveStyle( - `color: ${String(COLORS.darkBlackEnabled)}` + `color: ${String(LEGACY_COLORS.darkBlackEnabled)}` ) expect(checkBoxFieldBox).toHaveStyle(`flex: 0 0 auto`) expect(checkBoxFieldBox).toHaveStyle( @@ -124,7 +124,7 @@ describe('CheckboxField', () => { const checkBoxIcon = getByTestId('CheckboxField_icon') expect(checkBoxIcon).toHaveStyle(`width: 1.25rem`) expect(checkBoxIcon).toHaveStyle(`min-width: 1.25rem`) - expect(checkBoxIcon).toHaveStyle(`color: ${String(COLORS.blueEnabled)}`) + expect(checkBoxIcon).toHaveStyle(`color: ${String(LEGACY_COLORS.blueEnabled)}`) expect(checkBoxIcon).toHaveStyle(`display: flex`) expect(checkBoxIcon).toHaveStyle(`border-radius: 1px`) expect(checkBoxIcon).toHaveStyle( @@ -139,7 +139,7 @@ describe('CheckboxField', () => { const checkBoxIcon = getByTestId('CheckboxField_icon') expect(checkBoxIcon).toHaveStyle(`width: 1.25rem`) expect(checkBoxIcon).toHaveStyle(`min-width: 1.25rem`) - expect(checkBoxIcon).toHaveStyle(`color: ${String(COLORS.darkGreyEnabled)}`) + expect(checkBoxIcon).toHaveStyle(`color: ${String(LEGACY_COLORS.darkGreyEnabled)}`) expect(checkBoxIcon).toHaveStyle(`display: flex`) expect(checkBoxIcon).toHaveStyle(`border-radius: 1px`) expect(checkBoxIcon).toHaveStyle( diff --git a/components/src/atoms/CheckboxField/index.tsx b/components/src/atoms/CheckboxField/index.tsx index 0f10c9ec596..b8eca4e8514 100644 --- a/components/src/atoms/CheckboxField/index.tsx +++ b/components/src/atoms/CheckboxField/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' +import { LEGACY_COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' import { Flex, Box } from '../../primitives' import { Icon } from '../../icons' import { ALIGN_CENTER, JUSTIFY_CENTER, SIZE_1 } from '../../styles' @@ -45,7 +45,7 @@ const OUTER_STYLE = css` const INNER_STYLE_VALUE = css` width: ${SPACING.spacing20}; min-width: ${SPACING.spacing20}; - color: ${COLORS.blueEnabled}; + color: ${LEGACY_COLORS.blueEnabled}; display: flex; border-radius: 1px; justify-content: ${JUSTIFY_CENTER}; @@ -53,25 +53,25 @@ const INNER_STYLE_VALUE = css` &:hover { cursor: pointer; - color: ${COLORS.blueHover}; + color: ${LEGACY_COLORS.blueHover}; } &:active { - color: ${COLORS.bluePressed}; + color: ${LEGACY_COLORS.bluePressed}; } &:focus { - box-shadow: 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; } &:disabled { - color: ${COLORS.bluePressed}; + color: ${LEGACY_COLORS.bluePressed}; } ` const INNER_STYLE_NO_VALUE = css` width: ${SPACING.spacing20}; min-width: ${SPACING.spacing20}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; display: flex; border-radius: 1px; justify-content: ${JUSTIFY_CENTER}; @@ -79,26 +79,26 @@ const INNER_STYLE_NO_VALUE = css` &:hover { cursor: pointer; - color: ${COLORS.darkGreyHover}; + color: ${LEGACY_COLORS.darkGreyHover}; } &:active { - color: ${COLORS.darkGreyPressed}; + color: ${LEGACY_COLORS.darkGreyPressed}; } &:focus { - box-shadow: 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; } &:disabled { - color: ${COLORS.darkGreyPressed}; + color: ${LEGACY_COLORS.darkGreyPressed}; } ` const LABEL_TEXT_STYLE = css` font-size: ${TYPOGRAPHY.fontSizeP}; font-weight: ${TYPOGRAPHY.fontWeightRegular}; - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; flex: 0 0 auto; padding: ${SPACING.spacing8} ${SPACING.spacing8}; @@ -126,13 +126,13 @@ export function CheckboxField(props: CheckboxFieldProps): JSX.Element { alignItems={ALIGN_CENTER} justifyContent={JUSTIFY_CENTER} borderRadius="2px" - backgroundColor={COLORS.darkGreyDisabled} + backgroundColor={LEGACY_COLORS.darkGreyDisabled} size={SIZE_1} > ) : ( diff --git a/components/src/atoms/StepMeter/index.tsx b/components/src/atoms/StepMeter/index.tsx index 1dddf1b1299..33ff5db1a42 100644 --- a/components/src/atoms/StepMeter/index.tsx +++ b/components/src/atoms/StepMeter/index.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { css } from 'styled-components' import { Box } from '../../primitives' -import { COLORS, RESPONSIVENESS, SPACING } from '../../ui-style-constants' +import { LEGACY_COLORS, RESPONSIVENESS, SPACING } from '../../ui-style-constants' import { POSITION_ABSOLUTE, POSITION_RELATIVE } from '../../styles' interface StepMeterProps { @@ -22,7 +22,7 @@ export const StepMeter = (props: StepMeterProps): JSX.Element => { const StepMeterContainer = css` position: ${POSITION_RELATIVE}; height: ${SPACING.spacing4}; - background-color: ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.medGreyEnabled}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { height: ${SPACING.spacing12}; } @@ -31,7 +31,7 @@ export const StepMeter = (props: StepMeterProps): JSX.Element => { position: ${POSITION_ABSOLUTE}; top: 0; height: 100%; - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; width: ${percentComplete}; webkit-transition: width 0.5s ease-in-out; moz-transition: width 0.5s ease-in-out; diff --git a/components/src/atoms/buttons/AlertPrimaryButton.tsx b/components/src/atoms/buttons/AlertPrimaryButton.tsx index 143f13ca391..0cfdc8defd1 100644 --- a/components/src/atoms/buttons/AlertPrimaryButton.tsx +++ b/components/src/atoms/buttons/AlertPrimaryButton.tsx @@ -1,9 +1,9 @@ import styled from 'styled-components' -import { COLORS, BORDERS, TYPOGRAPHY, SPACING } from '../../ui-style-constants' +import { LEGACY_COLORS, BORDERS, TYPOGRAPHY, SPACING } from '../../ui-style-constants' import { NewAlertPrimaryBtn, styleProps } from '../../primitives' export const AlertPrimaryButton = styled(NewAlertPrimaryBtn)` - background-color: ${COLORS.errorEnabled}; + background-color: ${LEGACY_COLORS.errorEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; padding-left: ${SPACING.spacing16}; padding-right: ${SPACING.spacing16}; @@ -18,7 +18,7 @@ export const AlertPrimaryButton = styled(NewAlertPrimaryBtn)` } &:disabled { - background-color: ${COLORS.darkGreyDisabled}; - color: ${COLORS.errorDisabled}; + background-color: ${LEGACY_COLORS.darkGreyDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; } ` diff --git a/components/src/atoms/buttons/PrimaryButton.tsx b/components/src/atoms/buttons/PrimaryButton.tsx index 2ddd9df94d3..8c4261c6f61 100644 --- a/components/src/atoms/buttons/PrimaryButton.tsx +++ b/components/src/atoms/buttons/PrimaryButton.tsx @@ -1,9 +1,9 @@ import styled from 'styled-components' -import { COLORS, BORDERS, TYPOGRAPHY, SPACING } from '../../ui-style-constants' +import { LEGACY_COLORS, BORDERS, TYPOGRAPHY, SPACING } from '../../ui-style-constants' import { NewPrimaryBtn, styleProps } from '../../primitives' export const PrimaryButton = styled(NewPrimaryBtn)` - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; box-shadow: none; padding-left: ${SPACING.spacing16}; @@ -16,20 +16,20 @@ export const PrimaryButton = styled(NewPrimaryBtn)` &:hover, &:focus { - background-color: ${COLORS.blueHover}; + background-color: ${LEGACY_COLORS.blueHover}; box-shadow: none; } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.warningEnabled}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.warningEnabled}; } &:active { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } &:disabled { - background-color: ${COLORS.darkGreyDisabled}; - color: ${COLORS.errorDisabled}; + background-color: ${LEGACY_COLORS.darkGreyDisabled}; + color: ${LEGACY_COLORS.errorDisabled}; } ` diff --git a/components/src/atoms/buttons/SecondaryButton.tsx b/components/src/atoms/buttons/SecondaryButton.tsx index 5f071aa117e..f2622ba9d11 100644 --- a/components/src/atoms/buttons/SecondaryButton.tsx +++ b/components/src/atoms/buttons/SecondaryButton.tsx @@ -1,5 +1,5 @@ import styled from 'styled-components' -import { COLORS, BORDERS, TYPOGRAPHY, SPACING } from '../../ui-style-constants' +import { LEGACY_COLORS, BORDERS, TYPOGRAPHY, SPACING } from '../../ui-style-constants' import { isntStyleProp, styleProps } from '../../primitives' import type { StyleProps } from '../../index' @@ -14,14 +14,14 @@ export const SecondaryButton = styled.button.withConfig({ appearance: none; cursor: pointer; color: ${props => - props.isDangerous ? COLORS.errorText : COLORS.blueEnabled}; + props.isDangerous ? LEGACY_COLORS.errorText : LEGACY_COLORS.blueEnabled}; border: ${BORDERS.lineBorder}; border-color: ${props => - props.isDangerous ? COLORS.errorEnabled : 'initial'}; + props.isDangerous ? LEGACY_COLORS.errorEnabled : 'initial'}; border-radius: ${BORDERS.radiusSoftCorners}; padding: ${SPACING.spacing8} ${SPACING.spacing16}; text-transform: ${TYPOGRAPHY.textTransformNone}; - background-color: ${COLORS.transparent}; + background-color: ${LEGACY_COLORS.transparent}; ${TYPOGRAPHY.pSemiBold} &:hover, @@ -35,7 +35,7 @@ export const SecondaryButton = styled.button.withConfig({ } &:focus-visible { - box-shadow: 0 0 0 3px ${COLORS.fundamentalsFocus}; + box-shadow: 0 0 0 3px ${LEGACY_COLORS.fundamentalsFocus}; } &:active { diff --git a/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx b/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx index 30c56f0e936..2ab04397843 100644 --- a/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/AlertPrimaryButton.test.tsx @@ -2,7 +2,7 @@ import 'jest-styled-components' import * as React from 'react' import { renderWithProviders } from '../../../testing/utils' import { - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, SPACING, @@ -26,7 +26,7 @@ describe('AlertPrimaryButton', () => { it('renders alert primary button with text', () => { const { getByText } = render(props) const button = getByText('alert primary button') - expect(button).toHaveStyle(`background-color: ${COLORS.errorEnabled}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.errorEnabled}`) expect(button).toHaveStyle( `padding: ${SPACING.spacing8} ${SPACING.spacing16} ${SPACING.spacing8} ${SPACING.spacing16}` ) diff --git a/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx b/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx index 5edc100c259..754ec0df1d4 100644 --- a/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/PrimaryButton.test.tsx @@ -2,7 +2,7 @@ import 'jest-styled-components' import * as React from 'react' import { renderWithProviders } from '../../../testing/utils' import { - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, SPACING, @@ -25,7 +25,7 @@ describe('PrimaryButton', () => { it('renders primary button with text', () => { const { getByText } = render(props) const button = getByText('primary button') - expect(button).toHaveStyle(`background-color: ${COLORS.blueEnabled}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.blueEnabled}`) expect(button).toHaveStyle( `padding: ${SPACING.spacing8} ${SPACING.spacing16} ${SPACING.spacing8} ${SPACING.spacing16}` ) @@ -37,7 +37,7 @@ describe('PrimaryButton', () => { `text-transform: ${TYPOGRAPHY.textTransformNone}` ) expect(button).toHaveStyle(`box-shadow: none`) - expect(button).toHaveStyle(`color: ${COLORS.white}`) + expect(button).toHaveStyle(`color: ${LEGACY_COLORS.white}`) }) it('renders primary button with text and disabled', () => { @@ -45,14 +45,14 @@ describe('PrimaryButton', () => { const { getByText } = render(props) const button = getByText('primary button') expect(button).toBeDisabled() - expect(button).toHaveStyle(`background-color: ${COLORS.darkGreyDisabled}`) - expect(button).toHaveStyle(`color: ${COLORS.errorDisabled}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.darkGreyDisabled}`) + expect(button).toHaveStyle(`color: ${LEGACY_COLORS.errorDisabled}`) }) it('applies the correct states to the button - focus', () => { const { getByText } = render(props) const button = getByText('primary button') - expect(button).toHaveStyleRule('background-color', `${COLORS.blueHover}`, { + expect(button).toHaveStyleRule('background-color', `${LEGACY_COLORS.blueHover}`, { modifier: ':focus', }) }) @@ -60,7 +60,7 @@ describe('PrimaryButton', () => { it('applies the correct states to the button - hover', () => { const { getByText } = render(props) const button = getByText('primary button') - expect(button).toHaveStyleRule('background-color', `${COLORS.blueHover}`, { + expect(button).toHaveStyleRule('background-color', `${LEGACY_COLORS.blueHover}`, { modifier: ':hover', }) }) @@ -70,7 +70,7 @@ describe('PrimaryButton', () => { const button = getByText('primary button') expect(button).toHaveStyleRule( 'background-color', - `${COLORS.bluePressed}`, + `${LEGACY_COLORS.bluePressed}`, { modifier: ':active', } @@ -82,7 +82,7 @@ describe('PrimaryButton', () => { const button = getByText('primary button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${COLORS.warningEnabled}`, + `0 0 0 3px ${LEGACY_COLORS.warningEnabled}`, { modifier: ':focus-visible', } @@ -90,10 +90,10 @@ describe('PrimaryButton', () => { }) it('renders primary button with text and different background color', () => { - props.backgroundColor = COLORS.errorEnabled + props.backgroundColor = LEGACY_COLORS.errorEnabled const { getByText } = render(props) const button = getByText('primary button') - expect(button).toHaveStyle(`background-color: ${COLORS.errorEnabled}`) - expect(button).toHaveStyle(`color: ${COLORS.white}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.errorEnabled}`) + expect(button).toHaveStyle(`color: ${LEGACY_COLORS.white}`) }) }) diff --git a/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx b/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx index babf1ded4db..43c3e10c617 100644 --- a/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx +++ b/components/src/atoms/buttons/__tests__/SecondaryButton.test.tsx @@ -2,7 +2,7 @@ import 'jest-styled-components' import * as React from 'react' import { renderWithProviders } from '../../../testing/utils' import { - COLORS, + LEGACY_COLORS, BORDERS, TYPOGRAPHY, SPACING, @@ -26,7 +26,7 @@ describe('SecondaryButton', () => { it('renders primary button with text', () => { const { getByText } = render(props) const button = getByText('secondary button') - expect(button).toHaveStyle(`background-color: ${COLORS.transparent}`) + expect(button).toHaveStyle(`background-color: ${LEGACY_COLORS.transparent}`) expect(button).toHaveStyle( `padding: ${SPACING.spacing8} ${SPACING.spacing16}` ) @@ -37,7 +37,7 @@ describe('SecondaryButton', () => { expect(button).toHaveStyle( `text-transform: ${TYPOGRAPHY.textTransformNone}` ) - expect(button).toHaveStyle(`color: ${COLORS.blueEnabled}`) + expect(button).toHaveStyle(`color: ${LEGACY_COLORS.blueEnabled}`) }) it('renders secondary button with text and disabled', () => { @@ -64,7 +64,7 @@ describe('SecondaryButton', () => { const button = getByText('secondary button') expect(button).toHaveStyleRule( 'box-shadow', - `0 0 0 3px ${COLORS.warningEnabled}`, + `0 0 0 3px ${LEGACY_COLORS.warningEnabled}`, { modifier: ':focus-visible', } @@ -72,9 +72,9 @@ describe('SecondaryButton', () => { }) it('renders secondary button with text and different background color', () => { - props.color = COLORS.errorEnabled + props.color = LEGACY_COLORS.errorEnabled const { getByText } = render(props) const button = getByText('secondary button') - expect(button).toHaveStyle(`color: ${COLORS.errorEnabled}`) + expect(button).toHaveStyle(`color: ${LEGACY_COLORS.errorEnabled}`) }) }) diff --git a/components/src/hardware-sim/BaseDeck/BaseDeck.tsx b/components/src/hardware-sim/BaseDeck/BaseDeck.tsx index 6030da22221..fd4596b95b2 100644 --- a/components/src/hardware-sim/BaseDeck/BaseDeck.tsx +++ b/components/src/hardware-sim/BaseDeck/BaseDeck.tsx @@ -22,7 +22,7 @@ import { LabwareRender } from '../Labware' import { FlexTrash } from '../Deck/FlexTrash' import { DeckFromLayers } from '../Deck/DeckFromLayers' import { SlotLabels } from '../Deck' -import { COLORS } from '../../ui-style-constants' +import { LEGACY_COLORS } from '../../ui-style-constants' import { Svg } from '../../primitives' import { SingleSlotFixture } from './SingleSlotFixture' @@ -84,9 +84,9 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element { robotType, modulesOnDeck = [], labwareOnDeck = [], - lightFill = COLORS.light1, - mediumFill = COLORS.grey2, - darkFill = COLORS.darkBlack70, + lightFill = LEGACY_COLORS.light1, + mediumFill = LEGACY_COLORS.grey2, + darkFill = LEGACY_COLORS.darkBlack70, deckLayerBlocklist = [], deckConfig, showExpansion = true, @@ -141,7 +141,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element { {showSlotLabels ? ( 0 || wasteChuteStagingAreaFixtures.length > 0 @@ -172,7 +172,7 @@ export function BaseDeck(props: BaseDeckProps): JSX.Element { ): JSX.Element { return ( diff --git a/components/src/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.tsx b/components/src/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.tsx index c75effcfa50..e33311747b6 100644 --- a/components/src/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.tsx +++ b/components/src/hardware-sim/BaseDeck/WasteChuteStagingAreaFixture.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { WASTE_CHUTE_CUTOUT } from '@opentrons/shared-data' -import { COLORS } from '../../ui-style-constants' +import { LEGACY_COLORS } from '../../ui-style-constants' import { SlotBase } from './SlotBase' import { SlotClip } from './SlotClip' import { WasteChute } from './WasteChuteFixture' @@ -26,9 +26,9 @@ export function WasteChuteStagingAreaFixture( const { cutoutId, deckDefinition, - fixtureBaseColor = COLORS.light1, - slotClipColor = COLORS.darkBlack70, - wasteChuteColor = COLORS.grey2, + fixtureBaseColor = LEGACY_COLORS.light1, + slotClipColor = LEGACY_COLORS.darkBlack70, + wasteChuteColor = LEGACY_COLORS.grey2, ...restProps } = props diff --git a/components/src/hardware-sim/Deck/FlexTrash.tsx b/components/src/hardware-sim/Deck/FlexTrash.tsx index 43dea6b56e3..08f9ddf0808 100644 --- a/components/src/hardware-sim/Deck/FlexTrash.tsx +++ b/components/src/hardware-sim/Deck/FlexTrash.tsx @@ -8,7 +8,7 @@ import { import { Icon } from '../../icons' import { Flex, Text } from '../../primitives' import { ALIGN_CENTER, JUSTIFY_CENTER } from '../../styles' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' import { RobotCoordsForeignObject } from './RobotCoordsForeignObject' import trashDef from '@opentrons/shared-data/labware/definitions/2/opentrons_1_trash_3200ml_fixed/1.json' @@ -98,7 +98,7 @@ export const FlexTrash = ({ > {rotateDegrees === '180' ? ( {rotateDegrees === '0' ? ( - + Trash bin ) : null} diff --git a/components/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx b/components/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx index 5aa94680cb4..d7e260684fb 100644 --- a/components/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx +++ b/components/src/hardware-sim/Deck/MoveLabwareOnDeck.tsx @@ -11,7 +11,7 @@ import { LoadedLabware, } from '@opentrons/shared-data' -import { COLORS } from '../../ui-style-constants' +import { LEGACY_COLORS } from '../../ui-style-constants' import { IDENTITY_AFFINE_TRANSFORM, multiplyMatrices } from '../utils' import { BaseDeck } from '../BaseDeck' @@ -233,8 +233,8 @@ export function MoveLabwareOnDeck( x={OUTLINE_THICKNESS_MM} y={OUTLINE_THICKNESS_MM} strokeWidth={OUTLINE_THICKNESS_MM} - stroke={COLORS.blueEnabled} - fill={COLORS.white} + stroke={LEGACY_COLORS.blueEnabled} + fill={LEGACY_COLORS.white} width={ movedLabwareDef.dimensions.xDimension - 2 * OUTLINE_THICKNESS_MM } @@ -256,7 +256,7 @@ export function MoveLabwareOnDeck( ) : ( handleClickAdd(fixtureLocation)} > - + ) @@ -66,26 +66,26 @@ const EMPTY_CONFIG_STYLE = css` display: ${DISPLAY_FLEX}; align-items: ${ALIGN_CENTER}; justify-content: ${JUSTIFY_CENTER}; - background-color: ${COLORS.mediumBlueEnabled}; - border: 3px dashed ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.mediumBlueEnabled}; + border: 3px dashed ${LEGACY_COLORS.blueEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; width: 100%; &:active { - border: 3px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.mediumBluePressed}; + border: 3px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.mediumBluePressed}; } &:focus { - border: 3px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.mediumBluePressed}; + border: 3px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.mediumBluePressed}; } &:hover { - background-color: ${COLORS.mediumBluePressed}; + background-color: ${LEGACY_COLORS.mediumBluePressed}; } &:focus-visible { - border: 3px solid ${COLORS.fundamentalsFocus}; + border: 3px solid ${LEGACY_COLORS.fundamentalsFocus}; } ` diff --git a/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx index 5a0478dde6a..6055337aa1c 100644 --- a/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/StagingAreaConfigFixture.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { Icon } from '../../icons' import { Btn, Text } from '../../primitives' import { ALIGN_CENTER, DISPLAY_FLEX, JUSTIFY_CENTER } from '../../styles' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' import { RobotCoordsForeignObject } from '../Deck/RobotCoordsForeignObject' import { FIXTURE_HEIGHT, @@ -67,7 +67,7 @@ export function StagingAreaConfigFixture( {STAGING_AREA_DISPLAY_NAME} {handleClickRemove != null ? ( - + ) : null} @@ -77,9 +77,9 @@ export function StagingAreaConfigFixture( const STAGING_AREA_CONFIG_STYLE_READ_ONLY = css` display: ${DISPLAY_FLEX}; align-items: ${ALIGN_CENTER}; - background-color: ${COLORS.grey2}; + background-color: ${LEGACY_COLORS.grey2}; border-radius: ${BORDERS.borderRadiusSize1}; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; grid-gap: ${SPACING.spacing8}; justify-content: ${JUSTIFY_CENTER}; width: 100%; @@ -89,14 +89,14 @@ const STAGING_AREA_CONFIG_STYLE_EDITABLE = css` ${STAGING_AREA_CONFIG_STYLE_READ_ONLY} &:active { - background-color: ${COLORS.darkBlack90}; + background-color: ${LEGACY_COLORS.darkBlack90}; } &:hover { - background-color: ${COLORS.grey1}; + background-color: ${LEGACY_COLORS.grey1}; } &:focus-visible { - border: 3px solid ${COLORS.fundamentalsFocus}; + border: 3px solid ${LEGACY_COLORS.fundamentalsFocus}; } ` diff --git a/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx index 900cbdf526f..ffe80614c15 100644 --- a/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/TrashBinConfigFixture.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { Icon } from '../../icons' import { Btn, Text } from '../../primitives' import { ALIGN_CENTER, DISPLAY_FLEX, JUSTIFY_CENTER } from '../../styles' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' import { RobotCoordsForeignObject } from '../Deck/RobotCoordsForeignObject' import { FIXTURE_HEIGHT, @@ -72,7 +72,7 @@ export function TrashBinConfigFixture( {TRASH_BIN_DISPLAY_NAME} {handleClickRemove != null ? ( - + ) : null} @@ -82,9 +82,9 @@ export function TrashBinConfigFixture( const TRASH_BIN_CONFIG_STYLE_READ_ONLY = css` display: ${DISPLAY_FLEX}; align-items: ${ALIGN_CENTER}; - background-color: ${COLORS.grey2}; + background-color: ${LEGACY_COLORS.grey2}; border-radius: ${BORDERS.borderRadiusSize1}; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; justify-content: ${JUSTIFY_CENTER}; grid-gap: ${SPACING.spacing8}; width: 100%; @@ -94,11 +94,11 @@ const TRASH_BIN_CONFIG_STYLE_EDTIABLE = css` ${TRASH_BIN_CONFIG_STYLE_READ_ONLY} &:active { - background-color: ${COLORS.darkBlack90}; + background-color: ${LEGACY_COLORS.darkBlack90}; } &:hover { - background-color: ${COLORS.grey1}; + background-color: ${LEGACY_COLORS.grey1}; } &:focus-visible { diff --git a/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx b/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx index 851a2c2bc8c..e40518a2660 100644 --- a/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx +++ b/components/src/hardware-sim/DeckConfigurator/WasteChuteConfigFixture.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { Icon } from '../../icons' import { Btn, Text } from '../../primitives' import { ALIGN_CENTER, DISPLAY_FLEX, JUSTIFY_CENTER } from '../../styles' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' import { RobotCoordsForeignObject } from '../Deck/RobotCoordsForeignObject' import { WASTE_CHUTE_DISPLAY_NAME, @@ -76,7 +76,7 @@ export function WasteChuteConfigFixture( {WASTE_CHUTE_DISPLAY_NAME} {handleClickRemove != null ? ( - + ) : null} @@ -86,9 +86,9 @@ export function WasteChuteConfigFixture( const WASTE_CHUTE_CONFIG_STYLE_READ_ONLY = css` display: ${DISPLAY_FLEX}; align-items: ${ALIGN_CENTER}; - background-color: ${COLORS.grey2}; + background-color: ${LEGACY_COLORS.grey2}; border-radius: ${BORDERS.borderRadiusSize1}; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; justify-content: ${JUSTIFY_CENTER}; grid-gap: ${SPACING.spacing8}; width: 100%; @@ -98,14 +98,14 @@ const WASTE_CHUTE_CONFIG_STYLE_EDITABLE = css` ${WASTE_CHUTE_CONFIG_STYLE_READ_ONLY} &:active { - background-color: ${COLORS.darkBlack90}; + background-color: ${LEGACY_COLORS.darkBlack90}; } &:hover { - background-color: ${COLORS.grey1}; + background-color: ${LEGACY_COLORS.grey1}; } &:focus-visible { - border: 3px solid ${COLORS.fundamentalsFocus}; + border: 3px solid ${LEGACY_COLORS.fundamentalsFocus}; } ` diff --git a/components/src/hardware-sim/DeckConfigurator/index.tsx b/components/src/hardware-sim/DeckConfigurator/index.tsx index f592b76d489..a55ff6daebe 100644 --- a/components/src/hardware-sim/DeckConfigurator/index.tsx +++ b/components/src/hardware-sim/DeckConfigurator/index.tsx @@ -10,7 +10,7 @@ import { WASTE_CHUTE_STAGING_AREA_FIXTURES, } from '@opentrons/shared-data' -import { COLORS } from '../../ui-style-constants' +import { LEGACY_COLORS } from '../../ui-style-constants' import { SingleSlotFixture } from '../BaseDeck/SingleSlotFixture' import { SlotLabels } from '../Deck' import { RobotCoordinateSpace } from '../RobotCoordinateSpace' @@ -37,8 +37,8 @@ export function DeckConfigurator(props: DeckConfiguratorProps): JSX.Element { deckConfig, handleClickAdd, handleClickRemove, - lightFill = COLORS.light1, - darkFill = COLORS.darkBlackEnabled, + lightFill = LEGACY_COLORS.light1, + darkFill = LEGACY_COLORS.darkBlackEnabled, readOnly = false, showExpansion = true, children, @@ -95,7 +95,7 @@ export function DeckConfigurator(props: DeckConfiguratorProps): JSX.Element { key={cutout.id} cutoutId={cutout.id as CutoutId} deckDefinition={deckDef} - slotClipColor={COLORS.transparent} + slotClipColor={LEGACY_COLORS.transparent} fixtureBaseColor={lightFill} showExpansion={showExpansion} /> diff --git a/components/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx b/components/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx index d84f3fc49d0..3f963f18d9e 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/FilledWells.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import map from 'lodash/map' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' import { Well } from './Well' import type { LabwareDefinition2 } from '@opentrons/shared-data' import type { CSSProperties } from 'styled-components' @@ -23,7 +23,7 @@ function FilledWellsComponent(props: FilledWellsProps): JSX.Element { wellName={wellName} well={definition.wells[wellName]} fill={color} - stroke={COLORS.black} + stroke={LEGACY_COLORS.black} strokeWidth="0.6" /> ) diff --git a/components/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx b/components/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx index b0b95390d95..d23cb97619d 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/LabwareOutline.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { SLOT_RENDER_WIDTH, SLOT_RENDER_HEIGHT } from '@opentrons/shared-data' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' import type { CSSProperties } from 'styled-components' import type { LabwareDefinition2 } from '@opentrons/shared-data' @@ -36,7 +36,7 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element { dimensions = { xDimension: width, yDimension: height }, } = definition ?? {} - const backgroundFill = parameters.isTiprack ? '#CCCCCC' : COLORS.white + const backgroundFill = parameters.isTiprack ? '#CCCCCC' : LEGACY_COLORS.white return ( <> {highlight ? ( @@ -59,7 +59,7 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element { borderThickness={1.5 * OUTLINE_THICKNESS_MM} xDimension={dimensions.xDimension} yDimension={dimensions.yDimension} - stroke={COLORS.blueEnabled} + stroke={LEGACY_COLORS.blueEnabled} fill={backgroundFill} rx="4" ry="4" @@ -70,7 +70,7 @@ export function LabwareOutline(props: LabwareOutlineProps): JSX.Element { borderThickness={OUTLINE_THICKNESS_MM} xDimension={dimensions.xDimension} yDimension={dimensions.yDimension} - stroke={stroke ?? (parameters.isTiprack ? '#979797' : COLORS.black)} + stroke={stroke ?? (parameters.isTiprack ? '#979797' : LEGACY_COLORS.black)} fill={backgroundFill} /> )} diff --git a/components/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx b/components/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx index a609038422c..a2cb6eba6d7 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/StaticLabware.tsx @@ -9,7 +9,7 @@ import { Well } from './Well' import type { LabwareDefinition2, LabwareWell } from '@opentrons/shared-data' import type { WellMouseEvent } from './types' import { STYLE_BY_WELL_CONTENTS } from './StyledWells' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' export interface StaticLabwareProps { /** Labware definition to render */ @@ -44,7 +44,7 @@ const TipDecoration = React.memo(function TipDecoration(props: { const LabwareDetailGroup = styled.g` fill: none; - stroke: ${COLORS.black}; + stroke: ${LEGACY_COLORS.black}; stroke-width: 1; ` diff --git a/components/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx b/components/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx index a4220711c4d..a2ebd007ac5 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/StrokedWells.tsx @@ -3,7 +3,7 @@ import map from 'lodash/map' import { Well } from './Well' import type { LabwareDefinition2 } from '@opentrons/shared-data' import type { CSSProperties } from 'styled-components' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' export interface StrokedWellProps { definition: LabwareDefinition2 @@ -23,7 +23,7 @@ export function StrokedWellsComponent(props: StrokedWellProps): JSX.Element { wellName={wellName} well={definition.wells[wellName]} stroke={color} - fill={COLORS.white} + fill={LEGACY_COLORS.white} strokeWidth="0.6" /> ) diff --git a/components/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx b/components/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx index ff1a37d7b82..51015c9d5a4 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/StyledWells.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import { Well } from './Well' import type { LabwareDefinition2 } from '@opentrons/shared-data' import type { WellGroup } from './types' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' type WellContents = | 'tipPresent' @@ -25,8 +25,8 @@ export const STYLE_BY_WELL_CONTENTS: { } } = { highlightedWell: { - stroke: COLORS.blueEnabled, - fill: `${COLORS.blueEnabled}33`, // 20% opacity + stroke: LEGACY_COLORS.blueEnabled, + fill: `${LEGACY_COLORS.blueEnabled}33`, // 20% opacity strokeWidth: 1, }, disabledWell: { @@ -35,8 +35,8 @@ export const STYLE_BY_WELL_CONTENTS: { strokeWidth: 0.6, }, selectedWell: { - stroke: COLORS.blueEnabled, - fill: COLORS.transparent, + stroke: LEGACY_COLORS.blueEnabled, + fill: LEGACY_COLORS.transparent, strokeWidth: 1, }, tipMissing: { @@ -45,13 +45,13 @@ export const STYLE_BY_WELL_CONTENTS: { strokeWidth: 0.6, }, tipPresent: { - fill: COLORS.white, + fill: LEGACY_COLORS.white, stroke: '#A4A4A4', // LEGACY --c-near-black strokeWidth: 0.6, }, defaultWell: { - fill: COLORS.white, - stroke: COLORS.black, + fill: LEGACY_COLORS.white, + stroke: LEGACY_COLORS.black, strokeWidth: 0.6, }, } diff --git a/components/src/hardware-sim/Labware/labwareInternals/Well.tsx b/components/src/hardware-sim/Labware/labwareInternals/Well.tsx index 26fb56fdf66..549cac004b6 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/Well.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/Well.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import type { LabwareWell } from '@opentrons/shared-data' import type { WellMouseEvent } from './types' import type { StyleProps } from '../../../primitives' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' export const INTERACTIVE_WELL_DATA_ATTRIBUTE = 'data-wellname' export interface WellProps extends StyleProps { @@ -23,9 +23,9 @@ export function WellComponent(props: WellProps): JSX.Element { const { well, wellName, - stroke = COLORS.black, + stroke = LEGACY_COLORS.black, strokeWidth = 1, - fill = COLORS.white, + fill = LEGACY_COLORS.white, onMouseEnterWell, onMouseLeaveWell, } = props diff --git a/components/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx b/components/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx index e2f2446eb6f..d4da0297881 100644 --- a/components/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx +++ b/components/src/hardware-sim/Labware/labwareInternals/WellLabels.tsx @@ -4,7 +4,7 @@ import { RobotCoordsText } from '../../Deck' import { WellLabelOption, WELL_LABEL_OPTIONS } from '../LabwareRender' import type { LabwareDefinition2 } from '@opentrons/shared-data' import type { HighlightedWellLabels } from './types' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' // magic layout numbers to make the letters close to the edges of the labware const LETTER_COLUMN_X_INSIDE = 4 @@ -61,7 +61,7 @@ const Labels = (props: { NUMBER_COLUMN_Y_FROM_TOP } style={{ - color: COLORS.darkGrey, // LEGACY --c-font-dark + color: LEGACY_COLORS.darkGrey, // LEGACY --c-font-dark fontSize: '0.2rem', // LEGACY --fs-micro textAnchor: 'middle', dominantBaseline: diff --git a/components/src/hardware-sim/Module/HeaterShaker.tsx b/components/src/hardware-sim/Module/HeaterShaker.tsx index d40bc37f493..847c3731649 100644 --- a/components/src/hardware-sim/Module/HeaterShaker.tsx +++ b/components/src/hardware-sim/Module/HeaterShaker.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { COLORS } from '../../ui-style-constants' +import { LEGACY_COLORS } from '../../ui-style-constants' export interface HeaterShakerVizProps { targetTemp: number | null @@ -8,8 +8,8 @@ export interface HeaterShakerVizProps { export function HeaterShaker(props: HeaterShakerVizProps): JSX.Element { const { targetTemp } = props - let ledLightColor: string = COLORS.white - if (targetTemp != null) ledLightColor = COLORS.red4 + let ledLightColor: string = LEGACY_COLORS.white + if (targetTemp != null) ledLightColor = LEGACY_COLORS.red4 return ( @@ -47,7 +47,7 @@ export function HeaterShaker(props: HeaterShakerVizProps): JSX.Element { diff --git a/components/src/hardware-sim/Module/MagneticBlock.tsx b/components/src/hardware-sim/Module/MagneticBlock.tsx index bd8fa375c1e..4ce002d2e5d 100644 --- a/components/src/hardware-sim/Module/MagneticBlock.tsx +++ b/components/src/hardware-sim/Module/MagneticBlock.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { COLORS } from '../../ui-style-constants' +import { LEGACY_COLORS } from '../../ui-style-constants' export function MagneticBlock(): JSX.Element { return ( @@ -8,7 +8,7 @@ export function MagneticBlock(): JSX.Element { diff --git a/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.tsx b/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.tsx index b9950d7b8c7..9ac3f495569 100644 --- a/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.tsx +++ b/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN1.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' interface ThermocyclerGEN1Props { lidMotorState: 'open' | 'closed' @@ -23,7 +23,7 @@ export function ThermocyclerGEN1(props: ThermocyclerGEN1Props): JSX.Element { @@ -41,7 +41,7 @@ function ClosedThermocyclerGEN1Layers(): JSX.Element { @@ -77,7 +77,7 @@ function OpenThermocyclerGEN1Layers(): JSX.Element { @@ -97,7 +97,7 @@ function OpenThermocyclerGEN1Layers(): JSX.Element { @@ -227,7 +227,7 @@ function OpenThermocyclerGEN1Layers(): JSX.Element { diff --git a/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.tsx b/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.tsx index dad53b87981..d5c9e72fd71 100644 --- a/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.tsx +++ b/components/src/hardware-sim/Module/Thermocycler/ThermocyclerGEN2.tsx @@ -1,6 +1,6 @@ import * as React from 'react' -import { COLORS } from '../../../ui-style-constants' +import { LEGACY_COLORS } from '../../../ui-style-constants' interface ThermocyclerGEN2Props { lidMotorState: 'open' | 'closed' @@ -34,7 +34,7 @@ function ClosedThermocyclerGEN2Layers(props: { return ( @@ -80,7 +80,7 @@ function ClosedThermocyclerGEN2Layers(props: { @@ -135,11 +135,11 @@ function OpenThermocyclerGEN2Layers(): JSX.Element { height="203.4" > @@ -135,9 +135,9 @@ export function DeckLocationSelect({ - + Selected @@ -156,7 +156,7 @@ export function DeckLocationSelect({ !isDisabled && setSelectedLocation != null && @@ -174,7 +174,7 @@ export function DeckLocationSelect({ robotType={robotType} slotBaseColor={fill} slotName={slot.id} - slotClipColor={COLORS.white} + slotClipColor={LEGACY_COLORS.white} onClick={() => !isDisabled && setSelectedLocation != null && @@ -204,7 +204,7 @@ export function DeckLocationSelect({ innerDivProps={INNER_DIV_PROPS} > ) : null} - + ) } diff --git a/components/src/icons/IconList.stories.tsx b/components/src/icons/IconList.stories.tsx index 7e4b3bda085..ccefc3f03ab 100644 --- a/components/src/icons/IconList.stories.tsx +++ b/components/src/icons/IconList.stories.tsx @@ -7,7 +7,7 @@ import { WRAP, TYPOGRAPHY, ALIGN_CENTER, - COLORS, + LEGACY_COLORS, SPACING, BORDERS, } from '@opentrons/components' @@ -81,8 +81,8 @@ const Template: Story> = args => { onClick={() => handleCopy(name, index)} border={ selectedIcon === name - ? `2px solid ${COLORS.blueEnabled}` - : `2px solid ${COLORS.darkBlackEnabled}` + ? `2px solid ${LEGACY_COLORS.blueEnabled}` + : `2px solid ${LEGACY_COLORS.darkBlackEnabled}` } > @@ -95,7 +95,7 @@ const Template: Story> = args => { {showText ? ( - {'copied'} + {'copied'} ) : null} @@ -105,5 +105,5 @@ const Template: Story> = args => { } export const IconList = Template.bind({}) IconList.args = { - backgroundColor: COLORS.blueEnabled, + backgroundColor: LEGACY_COLORS.blueEnabled, } diff --git a/components/src/modals/BaseModal.tsx b/components/src/modals/BaseModal.tsx index 6e309b45484..57eea1c3d70 100644 --- a/components/src/modals/BaseModal.tsx +++ b/components/src/modals/BaseModal.tsx @@ -2,7 +2,7 @@ import * as React from 'react' import * as Styles from '../styles' import { Box, Flex } from '../primitives' -import { COLORS, SPACING } from '../ui-style-constants' +import { LEGACY_COLORS, SPACING } from '../ui-style-constants' import type { StyleProps } from '../primitives' import { POSITION_FIXED } from '../styles' @@ -73,7 +73,7 @@ export interface BaseModalProps extends StyleProps { */ export function BaseModal(props: BaseModalProps): JSX.Element { const { - overlayColor = COLORS.backgroundOverlay, + overlayColor = LEGACY_COLORS.backgroundOverlay, onOutsideClick, zIndex = 10, header, diff --git a/components/src/modals/ModalShell.tsx b/components/src/modals/ModalShell.tsx index 0eb80cfa074..96cac8f8a51 100644 --- a/components/src/modals/ModalShell.tsx +++ b/components/src/modals/ModalShell.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import styled from 'styled-components' -import { BORDERS, COLORS, RESPONSIVENESS, SPACING } from '../ui-style-constants' +import { BORDERS, LEGACY_COLORS, RESPONSIVENESS, SPACING } from '../ui-style-constants' import { StyleProps, styleProps } from '../primitives' import { POSITION_FIXED, @@ -77,11 +77,11 @@ const Overlay = styled.div` top: 0; bottom: 0; z-index: 1; - background-color: ${COLORS.backgroundOverlay}; + background-color: ${LEGACY_COLORS.backgroundOverlay}; cursor: default; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { - background-color: ${COLORS.darkBlack60}; + background-color: ${LEGACY_COLORS.darkBlack60}; } ` const ContentArea = styled.div<{ zIndex: string | number }>` @@ -109,17 +109,17 @@ const ModalArea = styled.div< border-radius: ${BORDERS.radiusSoftCorners}; box-shadow: ${BORDERS.smallDropShadow}; height: ${({ isFullPage }) => (isFullPage ? '100%' : 'auto')}; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; ${styleProps}; ` const Footer = styled.div` - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; position: ${POSITION_STICKY}; bottom: 0; ` const Header = styled.div` - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; position: ${POSITION_STICKY}; top: 0; ` diff --git a/components/src/molecules/LocationIcon/__tests__/LocationIcon.test.tsx b/components/src/molecules/LocationIcon/__tests__/LocationIcon.test.tsx index 785304a7c96..f975a237c81 100644 --- a/components/src/molecules/LocationIcon/__tests__/LocationIcon.test.tsx +++ b/components/src/molecules/LocationIcon/__tests__/LocationIcon.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import { renderWithProviders } from '../../../testing/utils' -import { BORDERS, COLORS, SPACING } from '../../../ui-style-constants' +import { BORDERS, LEGACY_COLORS, SPACING } from '../../../ui-style-constants' import { LocationIcon } from '..' @@ -24,7 +24,7 @@ describe('LocationIcon', () => { expect(locationIcon).toHaveStyle(`padding: ${SPACING.spacing4} 0.375rem`) expect(locationIcon).toHaveStyle('height: 2rem') expect(locationIcon).toHaveStyle('width: max-content') - expect(locationIcon).toHaveStyle(`border: 2px solid ${COLORS.darkBlack100}`) + expect(locationIcon).toHaveStyle(`border: 2px solid ${LEGACY_COLORS.darkBlack100}`) expect(locationIcon).toHaveStyle( `border-radius: ${BORDERS.borderRadiusSize3}` ) diff --git a/components/src/molecules/LocationIcon/index.tsx b/components/src/molecules/LocationIcon/index.tsx index 4bb33b3ca34..aeb4c35cb53 100644 --- a/components/src/molecules/LocationIcon/index.tsx +++ b/components/src/molecules/LocationIcon/index.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { Icon } from '../../icons' import { Flex, Text } from '../../primitives' import { ALIGN_CENTER } from '../../styles' -import { BORDERS, COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' +import { BORDERS, LEGACY_COLORS, SPACING, TYPOGRAPHY } from '../../ui-style-constants' import type { IconName } from '../../icons' import type { StyleProps } from '../../primitives' @@ -31,7 +31,7 @@ const LOCATION_ICON_STYLE = css<{ width?: string }>` align-items: ${ALIGN_CENTER}; - border: 2px solid ${props => props.color ?? COLORS.darkBlack100}; + border: 2px solid ${props => props.color ?? LEGACY_COLORS.darkBlack100}; border-radius: ${BORDERS.borderRadiusSize3}; height: ${props => props.height ?? SPACING.spacing32}; width: ${props => props.width ?? 'max-content'}; @@ -63,7 +63,7 @@ export function LocationIcon({ ) : ( diff --git a/components/src/molecules/RoundTab.tsx b/components/src/molecules/RoundTab.tsx index 613253cdb39..95362e1b3f1 100644 --- a/components/src/molecules/RoundTab.tsx +++ b/components/src/molecules/RoundTab.tsx @@ -1,6 +1,6 @@ import * as React from 'react' import { css } from 'styled-components' -import { TYPOGRAPHY, BORDERS, SPACING, COLORS } from '../ui-style-constants' +import { TYPOGRAPHY, BORDERS, SPACING, LEGACY_COLORS } from '../ui-style-constants' import { POSITION_RELATIVE, POSITION_ABSOLUTE, @@ -20,28 +20,28 @@ const defaultTabStyle = css` ` const inactiveTabStyle = css` - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { - color: ${COLORS.darkGreyEnabled}; - background-color: ${COLORS.fundamentalsBackgroundShade}; + color: ${LEGACY_COLORS.darkGreyEnabled}; + background-color: ${LEGACY_COLORS.fundamentalsBackgroundShade}; } ` const currentTabStyle = css` ${TYPOGRAPHY.pSemiBold} - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; border-top: ${BORDERS.lineBorder}; border-left: ${BORDERS.lineBorder}; border-right: ${BORDERS.lineBorder}; - color: ${COLORS.blueEnabled}; + color: ${LEGACY_COLORS.blueEnabled}; /* extend below the tab when active to flow into the content */ &:after { position: ${POSITION_ABSOLUTE}; display: ${DISPLAY_BLOCK}; content: ''; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; top: 100; left: 0; height: ${SIZE_1}; diff --git a/components/src/ui-style-constants/index.ts b/components/src/ui-style-constants/index.ts index ee2a09868de..4edb46ba293 100644 --- a/components/src/ui-style-constants/index.ts +++ b/components/src/ui-style-constants/index.ts @@ -1,5 +1,5 @@ export * as BORDERS from './borders' -export * as COLORS from './colors' +export * as LEGACY_COLORS from './colors' export * as RESPONSIVENESS from './responsiveness' export * as TYPOGRAPHY from './typography' export * as SPACING from './spacing' diff --git a/components/src/ui-style-constants/typography.ts b/components/src/ui-style-constants/typography.ts index 582e749c1da..79f1b4a8235 100644 --- a/components/src/ui-style-constants/typography.ts +++ b/components/src/ui-style-constants/typography.ts @@ -1,5 +1,5 @@ import { css } from 'styled-components' -import { COLORS } from './' +import { LEGACY_COLORS } from './' // Font Sizes export const fontSize80 = '5rem' // 80px @@ -125,7 +125,7 @@ export const linkPSemiBold = css` font-size: ${fontSizeP}; font-weight: ${fontWeightSemiBold}; line-height: ${lineHeight20}; - color: ${COLORS.blueEnabled}; + color: ${LEGACY_COLORS.blueEnabled}; &:hover { opacity: 70%; @@ -233,9 +233,9 @@ export const darkLinkH4SemiBold = css` font-size: ${fontSizeH4}; font-weight: ${fontWeightSemiBold}; line-height: ${lineHeight20}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; } ` @@ -243,9 +243,9 @@ export const darkLinkLabelSemiBold = css` font-size: ${fontSizeLabel}; font-weight: ${fontWeightSemiBold}; line-height: ${lineHeight20}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; } ` @@ -253,6 +253,6 @@ export const darkLinkLabelSemiBoldDisabled = css` font-size: ${fontSizeLabel}; font-weight: ${fontWeightSemiBold}; line-height: ${lineHeight20}; - color: ${COLORS.medGreyHover}; + color: ${LEGACY_COLORS.medGreyHover}; cursor: not-allowed; ` diff --git a/hardware-testing/hardware_testing/gravimetric/daily_setup.py b/hardware-testing/hardware_testing/gravimetric/daily_setup.py index bc13dc9d0bf..4325e1c803e 100644 --- a/hardware-testing/hardware_testing/gravimetric/daily_setup.py +++ b/hardware-testing/hardware_testing/gravimetric/daily_setup.py @@ -29,7 +29,7 @@ WALKING_SECONDS = 15 -COLORS = { +LEGACY_COLORS = { "white": StatusBarState.IDLE, "green": StatusBarState.RUNNING, "yellow": StatusBarState.SOFTWARE_ERROR, @@ -42,12 +42,12 @@ "disco-quick": StatusBarState.DISCO, } COLOR_STATES = { - "idle": COLORS["white"], - "interact": COLORS["white-pulsing"], - "stable": COLORS["yellow"], - "walking": COLORS["blue-pulsing"], - "fail": COLORS["red-flashing"], - "pass": COLORS["green"], + "idle": LEGACY_COLORS["white"], + "interact": LEGACY_COLORS["white-pulsing"], + "stable": LEGACY_COLORS["yellow"], + "walking": LEGACY_COLORS["blue-pulsing"], + "fail": LEGACY_COLORS["red-flashing"], + "pass": LEGACY_COLORS["green"], } diff --git a/hardware-testing/hardware_testing/tools/plot/plotly-2.12.1.min.js b/hardware-testing/hardware_testing/tools/plot/plotly-2.12.1.min.js index 159d3e4d7d1..4526b7d3c0f 100644 --- a/hardware-testing/hardware_testing/tools/plot/plotly-2.12.1.min.js +++ b/hardware-testing/hardware_testing/tools/plot/plotly-2.12.1.min.js @@ -41,7 +41,7 @@ var n,i=t("./lib/build-log"),a=t("./lib/epsilon"),o=t("./lib/intersecter"),s=t(" * @author Feross Aboukhadijeh * @license MIT */ -"use strict";var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=function(t){+t!=t&&(t=0);return a.alloc(+t)},r.INSPECT_MAX_BYTES=50;function i(t){if(t>2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=i(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(i)return n?-1:D(t).length;e=(""+e).toLowerCase(),i=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),N(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},a.prototype.compare=function(t,e,r,n,i){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:4}],4:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}},{}],5:[function(t,e,r){var n,i,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,u=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&d())}function d(){if(!f){var t=l(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++h1)for(var r=1;r0?c=c.ushln(f):f<0&&(u=u.ushln(-f));return s(c,u)}},{"./div":17,"./is-rat":19,"./lib/is-bn":23,"./lib/num-to-bn":24,"./lib/rationalize":25,"./lib/str-to-bn":26}],19:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":23}],20:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":33}],21:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":32,"double-bits":64}],23:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":33}],24:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":33,"double-bits":64}],25:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":20,"./num-to-bn":24}],26:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":33}],27:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":25}],28:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":20}],29:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":25}],30:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":21,"./lib/ctz":22}],31:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function s(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function l(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,i,a){return l(t,e,r,i,a,n)},gt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},lt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},le:function(t,e,r,n,i){return l(t,e,r,n,i,o)},eq:function(t,e,r,n,i){return l(t,e,r,n,i,s)}}},{}],32:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],33:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t("buffer").Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],p=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,P=0|o[7],I=8191&P,O=P>>>13,z=0|o[8],D=8191&z,R=z>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(d,q)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,J)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(O,U)|0,a=Math.imul(O,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(O,q)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(D,q)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Pt=(c+(n=n+Math.imul(L,dt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,dt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(O,dt)|0))<<13)|0;c=((a=a+Math.imul(O,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht);var Ot=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var zt=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(N,dt)|0))<<13)|0;return c=((a=Math.imul(N,mt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=It,l[17]=Ot,l[18]=zt,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=p),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(x,y),x.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return v[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,T),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:2}],34:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,h,p))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,p,0,c,d,m):o(u,r,n,s,h,p,c,d,m),i.free(d),i.free(m))}i.free(h),i.free(p)}return f}}}function u(t,e){n.push([t,e])}function f(t){return n=[],c(t,t,u,!0),n}function h(t,e){return n=[],c(t,e,u,!1),n}},{"./lib/intersect":37,"./lib/sweep":41,"typedarray-pool":308}],36:[function(t,e,r){"use strict";function n(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var f=2*t,h=n,p=f*n;hc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var f=2*t,h=n,p=f*n;h0;){var L=6*(S-=1),C=v[L],P=v[L+1],I=v[L+2],O=v[L+3],z=v[L+4],D=v[L+5],R=2*S,F=y[R],B=y[R+1],N=1&D,j=!!(16&D),U=u,V=w,H=k,q=A;if(N&&(U=k,V=A,H=u,q=w),!(2&D&&(I=p(t,C,P,I,U,V,B),P>=I)||4&D&&(P=d(t,C,P,I,U,V,F))>=I)){var G=I-P,Y=z-O;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(M=l.scanComplete(t,C,e,P,I,U,V,O,z,H,q)))return M;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(M=o(t,C,e,N,P,I,U,V,O,z,H,q)))return M;continue}if(t*G*Y<1<<22){if(void 0!==(M=l.scanBipartite(t,C,e,N,P,I,U,V,O,z,H,q)))return M;continue}}var W=f(t,C,P,I,U,V,F,B);if(P=p0)&&!(p1>=hi)"),h=u("lo===p0"),p=u("lo>>1,f=2*t,h=u,p=o[f*u+e];for(;l=y?(h=v,p=y):g>=b?(h=m,p=g):(h=x,p=b):y>=b?(h=v,p=y):b>=g?(h=m,p=g):(h=x,p=b);for(var _=f*(c-1),w=f*h,T=0;Tr&&i[f+e]>c;--u,f-=o){for(var h=f,p=f+o,d=0;dh;++h,l+=s){if(i[l+f]===o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"loh;++h,l+=s){if(i[l+f]p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=t+e,h=r;n>h;++h,l+=s){if(i[l+f]<=o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=t+e,h=r;n>h;++h,l+=s){if(i[l+f]<=o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"lop;++p,l+=s){var d=i[l+f],m=i[l+h];if(dg;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=e,h=t+e,p=r;n>p;++p,l+=s){var d=i[l+f],m=i[l+h];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,f=r,h=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+h],g=i[c+p];if(!(m>=o||s>=g))if(f===d)f+=1,u+=l;else{for(var v=0;l>v;++v){var y=i[c+v];i[c+v]=i[u],i[u++]=y}var x=a[d];a[d]=a[f],a[f++]=x}}return f}}},{}],40:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var f=(r-e+1)/6|0,h=e+f,p=r-f,d=e+r>>1,m=d-f,g=d+f,v=h,y=m,x=d,b=g,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var A=u[2*y],M=u[2*y+1],S=u[2*b],E=u[2*b+1],L=2*v,C=2*x,P=2*_,I=2*h,O=2*d,z=2*p,D=0;D<2;++D){var R=u[L+D],F=u[C+D],B=u[P+D];u[I+D]=R,u[O+D]=F,u[z+D]=B}a(m,e,u),a(g,r,u);for(var N=w;N<=T;++N)if(c(N,A,M,u))N!==w&&i(N,w,u),++w;else if(!c(N,S,E,u))for(;;){if(c(T,S,E,u)){c(T,A,M,u)?(o(N,w,T,u),++w,--T):(i(N,T,u),--T);break}if(--Tt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(h,M);var S=0,E=0;for(w=0;w=1<<28)p(l,c,E--,L=L-(1<<28)|0);else if(L>=0)p(o,s,S--,L);else if(L<=-(1<<28)){L=-L-(1<<28)|0;for(var C=0;C>>1;a(h,E);var L=0,C=0,P=0;for(k=0;k>1==h[2*k+3]>>1&&(O=2,k+=1),I<0){for(var z=-(I>>1)-1,D=0;D>1)-1;0===O?p(o,s,L--,z):1===O?p(l,c,C--,z):2===O&&p(u,f,P--,z)}}},scanBipartite:function(t,e,r,n,i,l,c,u,f,m,g,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=i;k>>1;a(h,E);var L=0;for(k=0;k=1<<28?(P=!n,A-=1<<28):(P=!!n,A-=1),P)d(o,s,L++,A);else{var I=v[A],O=x*A,z=g[O+e+1],D=g[O+e+1+t];t:for(var R=0;R>>1;a(h,w);var T=0;for(y=0;y=1<<28)o[T++]=x-(1<<28);else{var A=p[x-=1],M=m*x,S=f[M+e+1],E=f[M+e+1+t];t:for(var L=0;L=0;--L)if(o[L]===x){for(O=L+1;O0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,f=-1,l=o[s],1);d=0||(e.flip(s,p),i(t,e,r,u,s,f),i(t,e,r,s,f,u),i(t,e,r,f,p,u),i(t,e,r,p,u,f)))}}},{"binary-search-bounds":31,"robust-in-sphere":282}],44:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var m=h[3*p+d];m>=0&&0===c[m]&&(f[3*p+d]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);var d=f.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],v=[],y=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,A]):e.push([M,E]),M=E}i?e.push([M,_,A]):e.push([M,_])}return h}(t,e,h,g,r));return v(e,y,r),!!y||(h.length>0||g.length>0)}},{"./lib/rat-seg-intersect":51,"big-rat":18,"big-rat/cmp":16,"big-rat/to-float":30,"box-intersect":35,nextafter:260,"rat-vec":273,"robust-segment-intersect":287,"union-find":309}],51:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var p=s(t,r),d=u(f,p),m=i(d,h),g=c(a,m);return l(t,g)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":17,"big-rat/mul":27,"big-rat/sign":28,"big-rat/sub":29,"rat-vec/add":272,"rat-vec/muls":274,"rat-vec/sub":275}],52:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],53:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,f,h,p,d,m;t||(t={});p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");u=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>p+1)throw new Error(f+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":284,"robust-product":285,"robust-sum":289,signum:55,"two-sum":307}],55:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],56:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],p=t[3],d=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+p-(d+m+g+v)||n(u,f,h,p)-n(d,m,g,v,d)||n(u+f,u+h,u+p,f+h,f+p,h+p)-n(d+m,d+g,d+v,m+g,m+v,g+v)||n(u+f+h,u+f+p,u+h+p,f+h+p)-n(d+m+g,d+m+v,d+g+v,m+g+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],60:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":10,"incremental-convex-hull":233}],62:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+f*r[p]+h*n[p];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],63:[function(t,e,r){"use strict";var n=t("incremental-convex-hull"),i=t("uniq");function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){h=(b=_[u])[0];b[0]=b[1],b[1]=h}return _}},{"incremental-convex-hull":233,uniq:310}],64:[function(t,e,r){(function(t){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:3}],65:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(c[h-1],u[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":31,"cubic-hermite":62}],69:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||m,null)};function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left)if(i=u(t,e,r,n.left))return i;if(i=r(n.key,n.value))return i}if(n.right)return u(t,e,r,n.right)}function f(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=f(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return f(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(1===h._color||1===i._color)break;var p=l[f-2];if(p.left===h)if(h.left===i){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=h.right,h._color=1,h.right=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(m=l[f-3]).left===p?m.left=h:m.right=h;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else{if(!(d=p.right)||0!==d._color){if(h.right=i.left,p._color=0,p.left=i.right,i._color=1,i.left=h,i.right=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(m=l[f-3]).left===p?m.left=i:m.right=i;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else if(h.right===i){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=h.left,h._color=1,h.left=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(m=l[f-3]).right===p?m.right=h:m.left=h;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;if(h.left=i.right,p._color=0,p.right=i.left,i._color=1,i.right=h,i.left=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(m=l[f-3]).right===p?m.right=i:m.left=i;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var p=h.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function m(t,e){return te?1:0}Object.defineProperty(p,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new h(this.tree,this._stack.slice())},p.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=i(n)).right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=i(n)).left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=a(0,n));r.right=a(0,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=i(n)).right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=a(0,n));r.left=a(0,n);continue}var c;n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),p.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(p,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),p.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},p.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(p,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],70:[function(t,e,r){"use strict";e.exports=function(t,e){var r=new u(t);return r.update(e),r};var n=t("./lib/text.js"),i=t("./lib/lines.js"),a=t("./lib/background.js"),o=t("./lib/cube.js"),s=t("./lib/ticks.js"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var f=u.prototype;function h(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,f=!1;if("bounds"in t)for(var h=t.bounds,p=0;p<2;++p)for(var d=0;d<3;++d)h[p][d]!==this.bounds[p][d]&&(f=!0),this.bounds[p][d]=h[p][d];if("ticks"in t){r=t.ticks,u=!0,this.autoTicks=!1;for(p=0;p<3;++p)this.tickSpacing[p]=0}else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(p=0;p<3;++p)r[p].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var m=l("labels");l("labelFont")&&(m=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor"),this._text?this._text&&(m||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var p=[new h,new h,new h];function d(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var f=a,h=s,p=o,d=l;c&1<0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var m=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),f=u.cubeEdges,h=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=f[A],this.lastCubeProps.axis[A]=h[A];var M=p;for(A=0;A<3;++A)d(p[A],A,this.bounds,f,h);e=this.gl;var S,E=m;for(A=0;A<3;++A)this.backgroundEnable[A]?E[A]=h[A]:E[A]=0;this._background.draw(r,n,i,a,E,this.backgroundColor),this._lines.bind(r,n,i,this);for(A=0;A<3;++A){var L=[0,0,0];h[A]>0?L[A]=a[1][A]:L[A]=a[0][A];for(var C=0;C<2;++C){var P=(A+1+C)%3,I=(A+1+(1^C))%3;this.gridEnable[P]&&this._lines.drawGrid(P,I,this.bounds,L,this.gridColor[P],this.gridWidth[P]*this.pixelRatio)}for(C=0;C<2;++C){P=(A+1+C)%3,I=(A+1+(1^C))%3;this.zeroEnable[I]&&Math.min(a[0][I],a[1][I])<=0&&Math.max(a[0][I],a[1][I])>=0&&this._lines.drawZero(P,I,this.bounds,L,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var O=c(v,M[A].primalMinor),z=c(y,M[A].mirrorMinor),D=this.lineTickLength;for(C=0;C<3;++C){var R=k/r[5*C];O[C]*=D[C]*R,z[C]*=D[C]*R}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,O,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var F,B;function N(t){(B=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(A=0;A<3;++A){var U=M[A].primalMinor,V=M[A].mirrorMinor,H=c(x,M[A].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[A]&&(H[C]+=k*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var q=[0,0,0];if(q[A]=1,this.tickEnable[A]){-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,F=1,"auto"===(S=[this.tickAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]),B=[0,0,0],j(A,U,V);for(C=0;C<3;++C)H[C]+=k*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],H,this.tickColor[A],q,B,S)}if(this.labelEnable[A]){F=0,B=[0,0,0],this.labels[A].length>4&&(N(A),F=1),"auto"===(S=[this.labelAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(C=0;C<3;++C)H[C]+=k*U[C]*this.labelPad[C]/r[5*C];H[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],H,this.labelColor[A],[0,0,0],B,S)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":71,"./lib/cube.js":72,"./lib/lines.js":73,"./lib/text.js":75,"./lib/ticks.js":76}],71:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[c]=d;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":74,"gl-buffer":78,"gl-vao":150}],72:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],h(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((N=R^1<c[B][0]&&(B=N)}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=g,H=w;for(A=0;A<3;++A)V[A]=H&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":132,glslify:231}],75:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var p=new c(t,h,u,f);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var u=c.prototype,f=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=u.positions,p=u.cells,d=0,m=p.length;d=0;--v){var y=h[g[v]];o.push(f*y[0],-f*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],79:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,f=1/0,h=-1/0,p=null,d=null,m=[],g=1/0,v=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(g=Math.min(g,_),v=!1):v=!0}v||(p=x,d=b),m.push(b)}var w=[s,c,f],T=[l,u,h];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(g)||(g=1),a.vectorScale=g;var A=t.coneSize||.5;t.absoluteConeSize&&(A=t.absoluteConeSize*k),a.coneScale=A;y=0;for(var M=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=m(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var f=i(t),p=i(t),g=i(t),v=i(t),y=i(t),x=a(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new h(t,u,s,l,f,p,y,g,v,x,r.traceType||"cone");return b.update(e),b}},{colormap:53,"gl-buffer":78,"gl-mat4/invert":98,"gl-mat4/multiply":100,"gl-shader":132,"gl-texture2d":146,"gl-vao":150,ndarray:259}],81:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:231}],82:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],83:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":82}],84:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[n],a=0;a0)(m=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,m[0],m[1],m[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,m),o+=2+f(i,m,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":85,"gl-buffer":78,"gl-vao":150}],85:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":132,glslify:231}],86:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;"stencil"in n&&(g=!!n.stencil);return new d(t,e,r,h,f,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var c,u,f,p,d=t.colorLevels||[0],m=t.colorValues||[0,0,0,1],g=d.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=o[0],f=v[2]=r[r.length-1],p=v[3]=o[o.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=o[0]+(o[1]-o[0])/2,f=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=v[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-c),x=1/(p-u),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),k=a.mallocFloat32(2*w),A=a.mallocUint8(2*w),M=a.mallocUint32(w),S=0,E=l?b-1:b,L=l?_-1:_,C=0;C max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":132,glslify:231}],91:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new v(e,r,o,s,l,d);return m.update(t),m};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),c=t("ndarray"),u=t("./lib/shaders"),f=u.createShader,h=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;v+=g[f]}if(Math.abs(v-1)>.001)return null;return[h,s(t,g),g]}},{barycentric:14,"polytope-closest-point/lib/closest_point_2d.js":270}],111:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:231}],112:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),m=t("./lib/closest-point"),g=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_,T,k,A,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function M(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function P(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ai[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t]&&T&&(u[1^t]-=M*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),u[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=M*p*m[t+2],ki[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t+2]&&T&&(u[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),m.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),m.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],m=a[o+2]-f,g=i[o],v=i[o+2]-g;p[o]=2*l/u*m/v,h[o]=2*(s-c)/u*m/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var m=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(m,e[1],m,e[3],p[d],h[d]):o.drawLine(e[0],m,e[2],m,p[d],h[d])}}for(d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":7,"has-passive-events":232,"mouse-change":247,"mouse-event-offset":248,"mouse-wheel":250,"right-now":278}],120:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":132,glslify:231}],121:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("gl-mat4/ortho"),p=t("./lib/shader"),d=t("is-mobile")({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=i(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],L=[],C=[],P=[],I=!0,O=!0,z=new Array(16),D=new Array(16),R={view:null,projection:z,model:D,_ortho:!1},F=(O=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:A,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,O=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function U(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}N.autoResize&&U();function V(){for(var t=E.length,e=P.length,n=0;n0&&0===C[e-1];)C.pop(),P.pop().dispose()}function H(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}window.addEventListener("resize",U),N.update=function(t){N._stopped||(t=t||{},I=!0,O=!0)},N.add=function(t){N._stopped||(t.axes=A,E.push(t),L.push(-1),I=!0,O=!0,V())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),L.pop(),I=!0,O=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",H),N.mouseListener.enabled=!1,!N.contextLost)){A.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:231}],123:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":122,"gl-buffer":78,"gl-shader":132,"typedarray-pool":308}],124:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],p=r[0],d=r[1],m=r[2],g=r[3];(a=c*p+u*d+f*m+h*g)<0&&(a=-a,p=-p,d=-d,m=-m,g=-g);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],125:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],126:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return v(t,f)},r.createOrtho=function(t){return v(t,h)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,m)},r.createPickProject=function(t){return v(t,g)}},{"gl-shader":132,glslify:231}],128:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),c=t("./lib/glyphs"),u=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function m(t){return!0===t||t>1?1:t}function g(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new d(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),m=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new g(e,r,n,o,f,h,p,d,m,s,c,u);return v.update(t),v};var v=g.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=f.slice(),k=[0,0,0],A=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function L(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||f,u=r.view||f,h=r.projection||f,d=e.axesBounds,m=function(t){for(var e=A,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=m,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(a[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var v=T,L=0;L<16;++L)v[L]=0;for(L=0;L<4;++L)v[5*L]=1;v[5*g]=0,i[g]<0?v[12+g]=d[0][g]:v[12+g]=d[1][g],s(v,c,v),l.model=v;var C=(g+1)%3,P=(g+2)%3,I=M(x),O=M(b);I[C]=1,O[P]=1;var z=p(0,0,0,S(_,I)),D=p(0,0,0,S(w,O));if(Math.abs(z[1])>Math.abs(D[1])){var R=z;z=D,D=R,R=I,I=O,O=R;var F=C;C=P,P=F}z[0]<0&&(I[C]=-1),D[1]>0&&(O[P]=-1);var B=0,N=0;for(L=0;L<4;++L)B+=Math.pow(c[4*C+L],2),N+=Math.pow(c[4*P+L],2);I[C]/=Math.sqrt(B),O[P]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=O,l.fragClipBounds[0]=E(k,m[0],g,-1e8),l.fragClipBounds[1]=E(k,m[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&L(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var a;a=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},v.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},v.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=m(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=m(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else{i=[],a=[];for(n=0;n0){var O=0,z=x,D=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;f[T]=Math.max(f[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(N=I(h,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n0?1-M[0][0]:Y<0?1+M[1][0]:1,W*=W>0?1-M[0][1]:W<0?1+M[1][1]:1],Z=k.cells||[],J=k.positions||[];for(T=0;T0){var v=r*u;o.drawBox(f-v,h-v,p+v,h+v,a),o.drawBox(f-v,d-v,p+v,d+v,a),o.drawBox(f-v,h-v,f+v,d+v,a),o.drawBox(p-v,h-v,p+v,d+v,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":129,"gl-buffer":78,"gl-shader":132}],131:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A=0;)M+=1;_[y]=M}var S=new Array(r.length);function E(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var d;if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,p,i,d,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+g+"fv"](s[u],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((g=v.charCodeAt(v.length-1)-48)<2||g>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+g+"iv"](s[u],f);break;case"v":t["uniform"+g+"fv"](s[u],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e,n){if("object"==typeof n){var c=u(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(f=n,function(t,e,r){return t.getUniform(e.program,r[f])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var f}function u(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:231}],143:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(h[T],p[T],p[k],p[k],h[k],h[T]),f.push(y,v,v,v,y,y),d.push(m,g,g,g,m,m);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=h;h=p,p=M;var S=y;y=v,v=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(t,r,a,o)})),f=[],h=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||x>p-1)return n.create();var b,_,w,T,k,A,M=a[0][d],S=a[0][v],E=a[1][m],L=a[1][y],C=a[2][g],P=(o-M)/(S-M),I=(c-E)/(L-E),O=(u-C)/(a[2][x]-C);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(O)||(O=.5),r.reversedX&&(d=f-1-d,v=f-1-v),r.reversedY&&(m=h-1-m,y=h-1-y),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,A=x,w=m*p,T=y*p,b=d*p*h,_=v*p*h;break;case 4:k=g,A=x,b=d*p,_=v*p,w=m*p*f,T=y*p*f;break;case 3:w=m,T=y,k=g*h,A=x*h,b=d*h*p,_=v*h*p;break;case 2:w=m,T=y,b=d*h,_=v*h,k=g*h*f,A=x*h*f;break;case 1:b=d,_=v,k=g*f,A=x*f,w=m*f*p,T=y*f*p;break;default:b=d,_=v,w=m*f,T=y*f,k=g*f*h,A=x*f*h}var z=i[b+w+k],D=i[b+w+A],R=i[b+T+k],F=i[b+T+A],B=i[_+w+k],N=i[_+w+A],j=i[_+T+k],U=i[_+T+A],V=n.create(),H=n.create(),q=n.create(),G=n.create();n.lerp(V,z,B,P),n.lerp(H,D,N,P),n.lerp(q,R,j,P),n.lerp(G,F,U,P);var Y=n.create(),W=n.create();n.lerp(Y,V,q,I),n.lerp(W,H,G,I);var X=n.create();return n.lerp(X,Y,W,O),X}(e,t,p)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},k=10*n.distance(e[0],e[1])/i,A=k*k,M=1,S=0,E=r.length;E>1&&(M=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lS&&(S=F),D.push(F),g.push({points:P,velocities:I,divergences:D});for(var B=0;B<100*i&&P.lengthA&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,C),O=d(N),n.squaredDistance(z,N)-A>-1e-4*A){P.push(N),z=N,I.push(O);R=m(N,O),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F)}C=N}}var U=o(g,t.colormap,S,M);return f?U.tubeScale=f:(0===S&&(S=1),U.tubeScale=.5*u*M/S),U};var u=t("./lib/shaders"),f=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":142,"gl-cone3d":79,"gl-vec3":169,"gl-vec4":205}],144:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":132,glslify:231}],145:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new M(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,f,h,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||"jet",g.update(v),g};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),m=t("binary-search-bounds"),g=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function A(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function M(t,e,r,n,i,a,o,l,c,u,h,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=M.prototype;S.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],L={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||E,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var P={model:w,view:w,projection:w,inverseModel:w.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=w.slice(),O=[1,0,0,0,1,0,0,0,1];function z(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=O,n.vertexColor=this.vertexColor;var s=I;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=C(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var p=i+u,d=s+h,g=f*(h?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*g;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=m.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=R(t.contourWidth,Number)),"showContour"in t&&(this.showContour=R(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=R(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(v=0;v<2;++v)if(c.shape[v]!==a[v])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=f(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;oi||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function p(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=p.prototype;function m(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function g(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}function y(t,e,r,n,i,a){var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new p(t,o,r,n,i,a)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=m(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var u,h,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];h=a.malloc(v,r);var x=n(h,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):f(x,e),u=h.subarray(0,v)}var b=g(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||a.free(h),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,u){var h=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,g=0,v=m(p,u.stride.slice());"float32"===h?d=t.FLOAT:"float64"===h?(d=t.FLOAT,v=!1,h="float32"):"uint8"===h?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,h="uint8");if(2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s);if(g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,u):i.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],147:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":162,"./fromValues":168,"./normalize":179}],153:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],154:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],155:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],156:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],157:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],158:[function(t,e,r){e.exports=t("./distance")},{"./distance":159}],159:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],160:[function(t,e,r){e.exports=t("./divide")},{"./divide":161}],161:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],162:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],163:[function(t,e,r){e.exports=1e-6},{}],164:[function(t,e,r){e.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":163}],165:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],166:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],167:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],180:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],181:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},{}],182:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},{}],183:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},{}],184:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],185:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],186:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],187:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],188:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":190}],189:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":191}],190:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],191:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],192:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":193}],193:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],194:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],195:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],196:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t}},{}],197:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],198:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],199:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],200:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],201:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],202:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],203:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],204:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],205:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":197,"./clone":198,"./copy":199,"./create":200,"./distance":201,"./divide":202,"./dot":203,"./fromValues":204,"./inverse":206,"./length":207,"./lerp":208,"./max":209,"./min":210,"./multiply":211,"./negate":212,"./normalize":213,"./random":214,"./scale":215,"./scaleAndAdd":216,"./set":217,"./squaredDistance":218,"./squaredLength":219,"./subtract":220,"./transformMat4":221,"./transformQuat":222}],206:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],207:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],208:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],209:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],210:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],211:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],212:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],213:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],214:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":213,"./scale":215}],215:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],216:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],217:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],218:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],219:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],220:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],221:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],222:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t[3]=e[3],t}},{}],223:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return A(r),v+=r.length,(p=p.slice(r.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function O(){return"."===e||/[eE]/.test(e)?(p.push(e),h=5,r=e,u+1):"x"===e&&1===p.length&&"0"===p[0]?(h=11,p.push(e),r=e,u+1):/[^\d]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function z(){return"f"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function D(){if(/[^\d\w_]/.test(e)){var t=p.join("");return h=k[t]?8:T[t]?7:6,A(p.join("")),h=999,u}return p.push(e),r=e,u+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":226,"./lib/builtins-300es":225,"./lib/literals":228,"./lib/literals-300es":227,"./lib/operators":229}],225:[function(t,e,r){var n=t("./builtins");n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":226}],226:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],227:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":228}],228:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],229:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],230:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":224}],231:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var p=this.orient();if(a[u]=h,p<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var p=(e=f.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var v=d[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,T[m]=v,w[g]=-1,T[g]=e,d[g]=k,k.flip();for(b=0;b<=n;++b){var M=w[b];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,L=0;L<=n;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new o(S,k,b))}}}}}}h.sort(s);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":284,"simplicial-complex":293}],234:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new v(null);return new v(g(t))};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function h(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},a.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":31}],235:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r2147483647)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return o(t,e,r)}function o(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|f(t,e),n=i(r),o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return c(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(B(t,ArrayBuffer)||t&&B(t.buffer,ArrayBuffer))return function(t,e,r){if(e<0||t.byteLength=2147483647)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+2147483647..toString(16)+" bytes");return 0|t}function f(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||B(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return D(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return R(t).length;default:if(i)return n?-1:D(t).length;e=(""+e).toLowerCase(),i=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return M(this,e,r);case"utf8":case"utf-8":return T(this,e,r);case"ascii":return k(this,e,r);case"latin1":case"binary":return A(this,e,r);case"base64":return w(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function p(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function d(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),N(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):m(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,i){var a,o=1,s=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function c(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i){var u=-1;for(a=r;as&&(r=s-l),a=r;a>=0;a--){for(var f=!0,h=0;hi&&(n=i):n=i;var a=e.length;n>a/2&&(n=a/2);for(var o=0;o>8,i=r%256,a.push(i),a.push(n);return a}(e,t.length-r),t,r,n)}function w(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function T(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i239?4:c>223?3:c>191?2:1;if(i+f<=r)switch(f){case 1:c<128&&(u=c);break;case 2:128==(192&(a=t[i+1]))&&(l=(31&c)<<6|63&a)>127&&(u=l);break;case 3:a=t[i+1],o=t[i+2],128==(192&a)&&128==(192&o)&&(l=(15&c)<<12|(63&a)<<6|63&o)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=t[i+1],o=t[i+2],s=t[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(l=(15&c)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,f=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),i+=f}return function(t){var e=t.length;if(e<=4096)return String.fromCharCode.apply(String,t);var r="",n=0;for(;ne&&(t+=" ... "),""},a.prototype.compare=function(t,e,r,n,i){if(B(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),l=Math.min(o,s),c=this.slice(n,i),u=t.slice(e,r),f=0;f>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return g(this,t,e,r);case"utf8":case"utf-8":return v(this,t,e,r);case"ascii":return y(this,t,e,r);case"latin1":case"binary":return x(this,t,e,r);case"base64":return b(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function k(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;in)&&(r=n);for(var i="",a=e;ar)throw new RangeError("Trying to access beyond buffer length")}function L(t,e,r,n,i,o){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||et.length)throw new RangeError("Index out of range")}function C(t,e,r,n,i,a){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function P(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,4),n.write(t,e,r,i,23,4),r+4}function I(t,e,r,i,a){return e=+e,r>>>=0,a||C(t,0,r,8),n.write(t,e,r,i,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||E(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=this[t],i=1,a=0;++a=(i*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||E(t,e,this.length);for(var n=e,i=1,a=this[t+--n];n>0&&(i*=256);)a+=this[t+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*e)),a},a.prototype.readInt8=function(t,e){return t>>>=0,e||E(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||E(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||E(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||E(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||E(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){(t=+t,e>>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[e]=255&t;++a>>=0,r>>>=0,n)||L(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[e+i]=255&t;--i>=0&&(a*=256);)this[e+i]=t/a&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=0,o=1,s=0;for(this[e]=255&t;++a>0)-s&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var a=r-1,o=1,s=0;for(this[e+a]=255&t;--a>=0&&(o*=256);)t<0&&0===s&&0!==this[e+a+1]&&(s=1),this[e+a]=(t/o>>0)-s&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return P(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return P(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return I(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return I(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e=0;--o)t[o+e]=this[o+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return i},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t&&(t&=255);if(e<0||this.length>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(e-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;a.push(r)}else if(r<2048){if((e-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function R(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function F(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function B(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function N(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":1,buffer:3,ieee754:4}],4:[function(t,e,r){r.read=function(t,e,r,n,i){var a,o,s=8*i-n-1,l=(1<>1,u=-7,f=r?i-1:0,h=r?-1:1,p=t[e+f];for(f+=h,a=p&(1<<-u)-1,p>>=-u,u+=s;u>0;a=256*a+t[e+f],f+=h,u-=8);for(o=a&(1<<-u)-1,a>>=-u,u+=n;u>0;o=256*o+t[e+f],f+=h,u-=8);if(0===a)a=1-c;else{if(a===l)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=c}return(p?-1:1)*o*Math.pow(2,a-n)},r.write=function(t,e,r,n,i,a){var o,s,l,c=8*a-i-1,u=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,d=n?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),(e+=o+f>=1?h/l:h*Math.pow(2,1-f))*l>=2&&(o++,l/=2),o+f>=u?(s=0,o=u):o+f>=1?(s=(e*l-1)*Math.pow(2,i),o+=f):(s=e*Math.pow(2,f-1)*Math.pow(2,i),o=0));i>=8;t[r+p]=255&s,p+=d,s/=256,i-=8);for(o=o<0;t[r+p]=255&o,p+=d,o/=256,c-=8);t[r+p-d]|=128*m}},{}],5:[function(t,e,r){var n,i,a=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function l(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var c,u=[],f=!1,h=-1;function p(){f&&c&&(f=!1,c.length?u=c.concat(u):h=-1,u.length&&d())}function d(){if(!f){var t=l(p);f=!0;for(var e=u.length;e;){for(c=u,u=[];++h1)for(var r=1;r0?c=c.ushln(f):f<0&&(u=u.ushln(-f));return s(c,u)}},{"./div":17,"./is-rat":19,"./lib/is-bn":23,"./lib/num-to-bn":24,"./lib/rationalize":25,"./lib/str-to-bn":26}],19:[function(t,e,r){"use strict";var n=t("./lib/is-bn");e.exports=function(t){return Array.isArray(t)&&2===t.length&&n(t[0])&&n(t[1])}},{"./lib/is-bn":23}],20:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return t.cmp(new n(0))}},{"bn.js":33}],21:[function(t,e,r){"use strict";var n=t("./bn-sign");e.exports=function(t){var e=t.length,r=t.words,i=0;if(1===e)i=r[0];else if(2===e)i=r[0]+67108864*r[1];else for(var a=0;a20)return 52;return r+32}},{"bit-twiddle":32,"double-bits":64}],23:[function(t,e,r){"use strict";t("bn.js");e.exports=function(t){return t&&"object"==typeof t&&Boolean(t.words)}},{"bn.js":33}],24:[function(t,e,r){"use strict";var n=t("bn.js"),i=t("double-bits");e.exports=function(t){var e=i.exponent(t);return e<52?new n(t):new n(t*Math.pow(2,52-e)).ushln(e-52)}},{"bn.js":33,"double-bits":64}],25:[function(t,e,r){"use strict";var n=t("./num-to-bn"),i=t("./bn-sign");e.exports=function(t,e){var r=i(t),a=i(e);if(0===r)return[n(0),n(1)];if(0===a)return[n(0),n(0)];a<0&&(t=t.neg(),e=e.neg());var o=t.gcd(e);if(o.cmpn(1))return[t.div(o),e.div(o)];return[t,e]}},{"./bn-sign":20,"./num-to-bn":24}],26:[function(t,e,r){"use strict";var n=t("bn.js");e.exports=function(t){return new n(t)}},{"bn.js":33}],27:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[0]),t[1].mul(e[1]))}},{"./lib/rationalize":25}],28:[function(t,e,r){"use strict";var n=t("./lib/bn-sign");e.exports=function(t){return n(t[0])*n(t[1])}},{"./lib/bn-sign":20}],29:[function(t,e,r){"use strict";var n=t("./lib/rationalize");e.exports=function(t,e){return n(t[0].mul(e[1]).sub(t[1].mul(e[0])),t[1].mul(e[1]))}},{"./lib/rationalize":25}],30:[function(t,e,r){"use strict";var n=t("./lib/bn-to-num"),i=t("./lib/ctz");e.exports=function(t){var e=t[0],r=t[1];if(0===e.cmpn(0))return 0;var a=e.abs().divmod(r.abs()),o=a.div,s=n(o),l=a.mod,c=e.negative!==r.negative?-1:1;if(0===l.cmpn(0))return c*s;if(s){var u=i(s)+4,f=n(l.ushln(u).divRound(r));return c*(s+f*Math.pow(2,-u))}var h=r.bitLength()-l.bitLength()+53;f=n(l.ushln(h).divRound(r));return h<1023?c*f*Math.pow(2,-h):(f*=Math.pow(2,-1023),c*f*Math.pow(2,1023-h))}},{"./lib/bn-to-num":21,"./lib/ctz":22}],31:[function(t,e,r){"use strict";function n(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>=0?(a=o,i=o-1):n=o+1}return a}function i(t,e,r,n,i){for(var a=i+1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)>0?(a=o,i=o-1):n=o+1}return a}function a(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<0?(a=o,n=o+1):i=o-1}return a}function o(t,e,r,n,i){for(var a=n-1;n<=i;){var o=n+i>>>1,s=t[o];(void 0!==r?r(s,e):s-e)<=0?(a=o,n=o+1):i=o-1}return a}function s(t,e,r,n,i){for(;n<=i;){var a=n+i>>>1,o=t[a],s=void 0!==r?r(o,e):o-e;if(0===s)return a;s<=0?n=a+1:i=a-1}return-1}function l(t,e,r,n,i,a){return"function"==typeof r?a(t,e,r,void 0===n?0:0|n,void 0===i?t.length-1:0|i):a(t,e,void 0,void 0===r?0:0|r,void 0===n?t.length-1:0|n)}e.exports={ge:function(t,e,r,i,a){return l(t,e,r,i,a,n)},gt:function(t,e,r,n,a){return l(t,e,r,n,a,i)},lt:function(t,e,r,n,i){return l(t,e,r,n,i,a)},le:function(t,e,r,n,i){return l(t,e,r,n,i,o)},eq:function(t,e,r,n,i){return l(t,e,r,n,i,s)}}},{}],32:[function(t,e,r){"use strict";function n(t){var e=32;return(t&=-t)&&e--,65535&t&&(e-=16),16711935&t&&(e-=8),252645135&t&&(e-=4),858993459&t&&(e-=2),1431655765&t&&(e-=1),e}r.INT_BITS=32,r.INT_MAX=2147483647,r.INT_MIN=-1<<31,r.sign=function(t){return(t>0)-(t<0)},r.abs=function(t){var e=t>>31;return(t^e)-e},r.min=function(t,e){return e^(t^e)&-(t65535)<<4,e|=r=((t>>>=e)>255)<<3,e|=r=((t>>>=r)>15)<<2,(e|=r=((t>>>=r)>3)<<1)|(t>>>=r)>>1},r.log10=function(t){return t>=1e9?9:t>=1e8?8:t>=1e7?7:t>=1e6?6:t>=1e5?5:t>=1e4?4:t>=1e3?3:t>=100?2:t>=10?1:0},r.popCount=function(t){return 16843009*((t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135)>>>24},r.countTrailingZeros=n,r.nextPow2=function(t){return t+=0===t,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)+1},r.prevPow2=function(t){return t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,(t|=t>>>16)-(t>>>1)},r.parity=function(t){return t^=t>>>16,t^=t>>>8,t^=t>>>4,27030>>>(t&=15)&1};var i=new Array(256);!function(t){for(var e=0;e<256;++e){var r=e,n=e,i=7;for(r>>>=1;r;r>>>=1)n<<=1,n|=1&r,--i;t[e]=n<>>8&255]<<16|i[t>>>16&255]<<8|i[t>>>24&255]},r.interleave2=function(t,e){return(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t&=65535)|t<<8))|t<<4))|t<<2))|t<<1))|(e=1431655765&((e=858993459&((e=252645135&((e=16711935&((e&=65535)|e<<8))|e<<4))|e<<2))|e<<1))<<1},r.deinterleave2=function(t,e){return(t=65535&((t=16711935&((t=252645135&((t=858993459&((t=t>>>e&1431655765)|t>>>1))|t>>>2))|t>>>4))|t>>>16))<<16>>16},r.interleave3=function(t,e,r){return t=1227133513&((t=3272356035&((t=251719695&((t=4278190335&((t&=1023)|t<<16))|t<<8))|t<<4))|t<<2),(t|=(e=1227133513&((e=3272356035&((e=251719695&((e=4278190335&((e&=1023)|e<<16))|e<<8))|e<<4))|e<<2))<<1)|(r=1227133513&((r=3272356035&((r=251719695&((r=4278190335&((r&=1023)|r<<16))|r<<8))|r<<4))|r<<2))<<2},r.deinterleave3=function(t,e){return(t=1023&((t=4278190335&((t=251719695&((t=3272356035&((t=t>>>e&1227133513)|t>>>2))|t>>>4))|t>>>8))|t>>>16))<<22>>22},r.nextCombination=function(t){var e=t|t-1;return e+1|(~e&-~e)-1>>>n(t)+1}},{}],33:[function(t,e,r){!function(e,r){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function a(t,e,r){if(a.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var o;"object"==typeof e?e.exports=a:r.BN=a,a.BN=a,a.wordSize=26;try{o="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:t("buffer").Buffer}catch(t){}function s(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function l(t,e,r){var n=s(t,r);return r-1>=e&&(n|=s(t,r-1)<<4),n}function c(t,e,r,n){for(var i=0,a=Math.min(t.length,r),o=e;o=49?s-49+10:s>=17?s-17+10:s}return i}a.isBN=function(t){return t instanceof a||null!==t&&"object"==typeof t&&t.constructor.wordSize===a.wordSize&&Array.isArray(t.words)},a.max=function(t,e){return t.cmp(e)>0?t:e},a.min=function(t,e){return t.cmp(e)<0?t:e},a.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)o=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[a]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this.strip()},a.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var n=0;n=e;n-=2)i=l(t,e,n)<=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(t.length-e)%2==0?e+1:e;n=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this.strip()},a.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var a=t.length-r,o=a%n,s=Math.min(a,a-o)+r,l=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},a.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},a.prototype.inspect=function(){return(this.red?""};var u=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],a=0|e.words[0],o=i*a,s=67108863&o,l=o/67108864|0;r.words[0]=s;for(var c=1;c>>26,f=67108863&l,h=Math.min(c,e.length-1),p=Math.max(0,c-t.length+1);p<=h;p++){var d=c-p|0;u+=(o=(i=0|t.words[d])*(a=0|e.words[p])+f)/67108864|0,f=67108863&o}r.words[c]=0|f,l=0|u}return 0!==l?r.words[c]=0|l:r.length--,r.strip()}a.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var i=0,a=0,o=0;o>>24-i&16777215)||o!==this.length-1?u[6-l.length]+l+r:l+r,(i+=2)>=26&&(i-=26,o--)}for(0!==a&&(r=a.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var c=f[t],p=h[t];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var m=d.modn(p).toString(t);r=(d=d.idivn(p)).isZero()?m+r:u[c-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},a.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},a.prototype.toJSON=function(){return this.toString(16)},a.prototype.toBuffer=function(t,e){return n(void 0!==o),this.toArrayLike(o,t,e)},a.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},a.prototype.toArrayLike=function(t,e,r){var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var o,s,l="le"===e,c=new t(a),u=this.clone();if(l){for(s=0;!u.isZero();s++)o=u.andln(255),u.iushrn(8),c[s]=o;for(;s=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},a.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},a.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},a.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},a.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},a.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},a.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},a.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var n=0;nt.length?this.clone().ixor(t):t.clone().ixor(this)},a.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},a.prototype.inotn=function(t){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},a.prototype.notn=function(t){return this.clone().inotn(t)},a.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,n=this);for(var i=0,a=0;a>>26;for(;0!==i&&a>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;at.length?this.clone().iadd(t):t.clone().iadd(this)},a.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=this);for(var a=0,o=0;o>26,this.words[o]=67108863&e;for(;0!==a&&o>26,this.words[o]=67108863&e;if(0===a&&o>>13,p=0|o[1],d=8191&p,m=p>>>13,g=0|o[2],v=8191&g,y=g>>>13,x=0|o[3],b=8191&x,_=x>>>13,w=0|o[4],T=8191&w,k=w>>>13,A=0|o[5],M=8191&A,S=A>>>13,E=0|o[6],L=8191&E,C=E>>>13,P=0|o[7],I=8191&P,O=P>>>13,z=0|o[8],D=8191&z,R=z>>>13,F=0|o[9],B=8191&F,N=F>>>13,j=0|s[0],U=8191&j,V=j>>>13,H=0|s[1],q=8191&H,G=H>>>13,Y=0|s[2],W=8191&Y,X=Y>>>13,Z=0|s[3],J=8191&Z,K=Z>>>13,Q=0|s[4],$=8191&Q,tt=Q>>>13,et=0|s[5],rt=8191&et,nt=et>>>13,it=0|s[6],at=8191&it,ot=it>>>13,st=0|s[7],lt=8191&st,ct=st>>>13,ut=0|s[8],ft=8191&ut,ht=ut>>>13,pt=0|s[9],dt=8191&pt,mt=pt>>>13;r.negative=t.negative^e.negative,r.length=19;var gt=(c+(n=Math.imul(f,U))|0)+((8191&(i=(i=Math.imul(f,V))+Math.imul(h,U)|0))<<13)|0;c=((a=Math.imul(h,V))+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(d,U),i=(i=Math.imul(d,V))+Math.imul(m,U)|0,a=Math.imul(m,V);var vt=(c+(n=n+Math.imul(f,q)|0)|0)+((8191&(i=(i=i+Math.imul(f,G)|0)+Math.imul(h,q)|0))<<13)|0;c=((a=a+Math.imul(h,G)|0)+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(v,U),i=(i=Math.imul(v,V))+Math.imul(y,U)|0,a=Math.imul(y,V),n=n+Math.imul(d,q)|0,i=(i=i+Math.imul(d,G)|0)+Math.imul(m,q)|0,a=a+Math.imul(m,G)|0;var yt=(c+(n=n+Math.imul(f,W)|0)|0)+((8191&(i=(i=i+Math.imul(f,X)|0)+Math.imul(h,W)|0))<<13)|0;c=((a=a+Math.imul(h,X)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(b,U),i=(i=Math.imul(b,V))+Math.imul(_,U)|0,a=Math.imul(_,V),n=n+Math.imul(v,q)|0,i=(i=i+Math.imul(v,G)|0)+Math.imul(y,q)|0,a=a+Math.imul(y,G)|0,n=n+Math.imul(d,W)|0,i=(i=i+Math.imul(d,X)|0)+Math.imul(m,W)|0,a=a+Math.imul(m,X)|0;var xt=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,K)|0)+Math.imul(h,J)|0))<<13)|0;c=((a=a+Math.imul(h,K)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,V))+Math.imul(k,U)|0,a=Math.imul(k,V),n=n+Math.imul(b,q)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(_,q)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(v,W)|0,i=(i=i+Math.imul(v,X)|0)+Math.imul(y,W)|0,a=a+Math.imul(y,X)|0,n=n+Math.imul(d,J)|0,i=(i=i+Math.imul(d,K)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,K)|0;var bt=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,tt)|0)+Math.imul(h,$)|0))<<13)|0;c=((a=a+Math.imul(h,tt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(M,U),i=(i=Math.imul(M,V))+Math.imul(S,U)|0,a=Math.imul(S,V),n=n+Math.imul(T,q)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(k,q)|0,a=a+Math.imul(k,G)|0,n=n+Math.imul(b,W)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(v,J)|0,i=(i=i+Math.imul(v,K)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,K)|0,n=n+Math.imul(d,$)|0,i=(i=i+Math.imul(d,tt)|0)+Math.imul(m,$)|0,a=a+Math.imul(m,tt)|0;var _t=(c+(n=n+Math.imul(f,rt)|0)|0)+((8191&(i=(i=i+Math.imul(f,nt)|0)+Math.imul(h,rt)|0))<<13)|0;c=((a=a+Math.imul(h,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(L,U),i=(i=Math.imul(L,V))+Math.imul(C,U)|0,a=Math.imul(C,V),n=n+Math.imul(M,q)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(S,q)|0,a=a+Math.imul(S,G)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,K)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,K)|0,n=n+Math.imul(v,$)|0,i=(i=i+Math.imul(v,tt)|0)+Math.imul(y,$)|0,a=a+Math.imul(y,tt)|0,n=n+Math.imul(d,rt)|0,i=(i=i+Math.imul(d,nt)|0)+Math.imul(m,rt)|0,a=a+Math.imul(m,nt)|0;var wt=(c+(n=n+Math.imul(f,at)|0)|0)+((8191&(i=(i=i+Math.imul(f,ot)|0)+Math.imul(h,at)|0))<<13)|0;c=((a=a+Math.imul(h,ot)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(I,U),i=(i=Math.imul(I,V))+Math.imul(O,U)|0,a=Math.imul(O,V),n=n+Math.imul(L,q)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(C,q)|0,a=a+Math.imul(C,G)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(S,W)|0,a=a+Math.imul(S,X)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,K)|0,n=n+Math.imul(b,$)|0,i=(i=i+Math.imul(b,tt)|0)+Math.imul(_,$)|0,a=a+Math.imul(_,tt)|0,n=n+Math.imul(v,rt)|0,i=(i=i+Math.imul(v,nt)|0)+Math.imul(y,rt)|0,a=a+Math.imul(y,nt)|0,n=n+Math.imul(d,at)|0,i=(i=i+Math.imul(d,ot)|0)+Math.imul(m,at)|0,a=a+Math.imul(m,ot)|0;var Tt=(c+(n=n+Math.imul(f,lt)|0)|0)+((8191&(i=(i=i+Math.imul(f,ct)|0)+Math.imul(h,lt)|0))<<13)|0;c=((a=a+Math.imul(h,ct)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(D,U),i=(i=Math.imul(D,V))+Math.imul(R,U)|0,a=Math.imul(R,V),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,G)|0)+Math.imul(O,q)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(L,W)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(C,W)|0,a=a+Math.imul(C,X)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(S,J)|0,a=a+Math.imul(S,K)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(k,$)|0,a=a+Math.imul(k,tt)|0,n=n+Math.imul(b,rt)|0,i=(i=i+Math.imul(b,nt)|0)+Math.imul(_,rt)|0,a=a+Math.imul(_,nt)|0,n=n+Math.imul(v,at)|0,i=(i=i+Math.imul(v,ot)|0)+Math.imul(y,at)|0,a=a+Math.imul(y,ot)|0,n=n+Math.imul(d,lt)|0,i=(i=i+Math.imul(d,ct)|0)+Math.imul(m,lt)|0,a=a+Math.imul(m,ct)|0;var kt=(c+(n=n+Math.imul(f,ft)|0)|0)+((8191&(i=(i=i+Math.imul(f,ht)|0)+Math.imul(h,ft)|0))<<13)|0;c=((a=a+Math.imul(h,ht)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,n=Math.imul(B,U),i=(i=Math.imul(B,V))+Math.imul(N,U)|0,a=Math.imul(N,V),n=n+Math.imul(D,q)|0,i=(i=i+Math.imul(D,G)|0)+Math.imul(R,q)|0,a=a+Math.imul(R,G)|0,n=n+Math.imul(I,W)|0,i=(i=i+Math.imul(I,X)|0)+Math.imul(O,W)|0,a=a+Math.imul(O,X)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,K)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,K)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(S,$)|0,a=a+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(k,rt)|0,a=a+Math.imul(k,nt)|0,n=n+Math.imul(b,at)|0,i=(i=i+Math.imul(b,ot)|0)+Math.imul(_,at)|0,a=a+Math.imul(_,ot)|0,n=n+Math.imul(v,lt)|0,i=(i=i+Math.imul(v,ct)|0)+Math.imul(y,lt)|0,a=a+Math.imul(y,ct)|0,n=n+Math.imul(d,ft)|0,i=(i=i+Math.imul(d,ht)|0)+Math.imul(m,ft)|0,a=a+Math.imul(m,ht)|0;var At=(c+(n=n+Math.imul(f,dt)|0)|0)+((8191&(i=(i=i+Math.imul(f,mt)|0)+Math.imul(h,dt)|0))<<13)|0;c=((a=a+Math.imul(h,mt)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,G))+Math.imul(N,q)|0,a=Math.imul(N,G),n=n+Math.imul(D,W)|0,i=(i=i+Math.imul(D,X)|0)+Math.imul(R,W)|0,a=a+Math.imul(R,X)|0,n=n+Math.imul(I,J)|0,i=(i=i+Math.imul(I,K)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,K)|0,n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(C,$)|0,a=a+Math.imul(C,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(S,rt)|0,a=a+Math.imul(S,nt)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ot)|0)+Math.imul(k,at)|0,a=a+Math.imul(k,ot)|0,n=n+Math.imul(b,lt)|0,i=(i=i+Math.imul(b,ct)|0)+Math.imul(_,lt)|0,a=a+Math.imul(_,ct)|0,n=n+Math.imul(v,ft)|0,i=(i=i+Math.imul(v,ht)|0)+Math.imul(y,ft)|0,a=a+Math.imul(y,ht)|0;var Mt=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,mt)|0)+Math.imul(m,dt)|0))<<13)|0;c=((a=a+Math.imul(m,mt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(B,W),i=(i=Math.imul(B,X))+Math.imul(N,W)|0,a=Math.imul(N,X),n=n+Math.imul(D,J)|0,i=(i=i+Math.imul(D,K)|0)+Math.imul(R,J)|0,a=a+Math.imul(R,K)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,tt)|0)+Math.imul(O,$)|0,a=a+Math.imul(O,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(C,rt)|0,a=a+Math.imul(C,nt)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ot)|0)+Math.imul(S,at)|0,a=a+Math.imul(S,ot)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,ct)|0)+Math.imul(k,lt)|0,a=a+Math.imul(k,ct)|0,n=n+Math.imul(b,ft)|0,i=(i=i+Math.imul(b,ht)|0)+Math.imul(_,ft)|0,a=a+Math.imul(_,ht)|0;var St=(c+(n=n+Math.imul(v,dt)|0)|0)+((8191&(i=(i=i+Math.imul(v,mt)|0)+Math.imul(y,dt)|0))<<13)|0;c=((a=a+Math.imul(y,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(B,J),i=(i=Math.imul(B,K))+Math.imul(N,J)|0,a=Math.imul(N,K),n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,tt)|0)+Math.imul(R,$)|0,a=a+Math.imul(R,tt)|0,n=n+Math.imul(I,rt)|0,i=(i=i+Math.imul(I,nt)|0)+Math.imul(O,rt)|0,a=a+Math.imul(O,nt)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ot)|0)+Math.imul(C,at)|0,a=a+Math.imul(C,ot)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,ct)|0)+Math.imul(S,lt)|0,a=a+Math.imul(S,ct)|0,n=n+Math.imul(T,ft)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(k,ft)|0,a=a+Math.imul(k,ht)|0;var Et=(c+(n=n+Math.imul(b,dt)|0)|0)+((8191&(i=(i=i+Math.imul(b,mt)|0)+Math.imul(_,dt)|0))<<13)|0;c=((a=a+Math.imul(_,mt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(B,$),i=(i=Math.imul(B,tt))+Math.imul(N,$)|0,a=Math.imul(N,tt),n=n+Math.imul(D,rt)|0,i=(i=i+Math.imul(D,nt)|0)+Math.imul(R,rt)|0,a=a+Math.imul(R,nt)|0,n=n+Math.imul(I,at)|0,i=(i=i+Math.imul(I,ot)|0)+Math.imul(O,at)|0,a=a+Math.imul(O,ot)|0,n=n+Math.imul(L,lt)|0,i=(i=i+Math.imul(L,ct)|0)+Math.imul(C,lt)|0,a=a+Math.imul(C,ct)|0,n=n+Math.imul(M,ft)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(S,ft)|0,a=a+Math.imul(S,ht)|0;var Lt=(c+(n=n+Math.imul(T,dt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(k,dt)|0))<<13)|0;c=((a=a+Math.imul(k,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(B,rt),i=(i=Math.imul(B,nt))+Math.imul(N,rt)|0,a=Math.imul(N,nt),n=n+Math.imul(D,at)|0,i=(i=i+Math.imul(D,ot)|0)+Math.imul(R,at)|0,a=a+Math.imul(R,ot)|0,n=n+Math.imul(I,lt)|0,i=(i=i+Math.imul(I,ct)|0)+Math.imul(O,lt)|0,a=a+Math.imul(O,ct)|0,n=n+Math.imul(L,ft)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(C,ft)|0,a=a+Math.imul(C,ht)|0;var Ct=(c+(n=n+Math.imul(M,dt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(S,dt)|0))<<13)|0;c=((a=a+Math.imul(S,mt)|0)+(i>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,n=Math.imul(B,at),i=(i=Math.imul(B,ot))+Math.imul(N,at)|0,a=Math.imul(N,ot),n=n+Math.imul(D,lt)|0,i=(i=i+Math.imul(D,ct)|0)+Math.imul(R,lt)|0,a=a+Math.imul(R,ct)|0,n=n+Math.imul(I,ft)|0,i=(i=i+Math.imul(I,ht)|0)+Math.imul(O,ft)|0,a=a+Math.imul(O,ht)|0;var Pt=(c+(n=n+Math.imul(L,dt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(C,dt)|0))<<13)|0;c=((a=a+Math.imul(C,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(B,lt),i=(i=Math.imul(B,ct))+Math.imul(N,lt)|0,a=Math.imul(N,ct),n=n+Math.imul(D,ft)|0,i=(i=i+Math.imul(D,ht)|0)+Math.imul(R,ft)|0,a=a+Math.imul(R,ht)|0;var It=(c+(n=n+Math.imul(I,dt)|0)|0)+((8191&(i=(i=i+Math.imul(I,mt)|0)+Math.imul(O,dt)|0))<<13)|0;c=((a=a+Math.imul(O,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(B,ft),i=(i=Math.imul(B,ht))+Math.imul(N,ft)|0,a=Math.imul(N,ht);var Ot=(c+(n=n+Math.imul(D,dt)|0)|0)+((8191&(i=(i=i+Math.imul(D,mt)|0)+Math.imul(R,dt)|0))<<13)|0;c=((a=a+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863;var zt=(c+(n=Math.imul(B,dt))|0)+((8191&(i=(i=Math.imul(B,mt))+Math.imul(N,dt)|0))<<13)|0;return c=((a=Math.imul(N,mt))+(i>>>13)|0)+(zt>>>26)|0,zt&=67108863,l[0]=gt,l[1]=vt,l[2]=yt,l[3]=xt,l[4]=bt,l[5]=_t,l[6]=wt,l[7]=Tt,l[8]=kt,l[9]=At,l[10]=Mt,l[11]=St,l[12]=Et,l[13]=Lt,l[14]=Ct,l[15]=Pt,l[16]=It,l[17]=Ot,l[18]=zt,0!==c&&(l[19]=c,r.length++),r};function m(t,e,r){return(new g).mulp(t,e,r)}function g(t,e){this.x=t,this.y=e}Math.imul||(d=p),a.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(this,t,e):r<63?p(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,a=0;a>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r.strip()}(this,t,e):m(this,t,e)},g.prototype.makeRBT=function(t){for(var e=new Array(t),r=a.prototype._countBits(t)-1,n=0;n>=1;return n},g.prototype.permute=function(t,e,r,n,i,a){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&a,a>>>=13;for(o=2*e;o>=26,e+=i/67108864|0,e+=a>>>26,this.words[r]=67108863&a}return 0!==e&&(this.words[r]=e,this.length++),this},a.prototype.muln=function(t){return this.clone().imuln(t)},a.prototype.sqr=function(){return this.mul(this)},a.prototype.isqr=function(){return this.imul(this.clone())},a.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>i}return e}(t);if(0===e.length)return new a(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(t-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(e=0;e>>26-r}o&&(this.words[e]=o,this.length++)}if(0!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var a=t%26,o=Math.min((t-a)/26,this.length),s=67108863^67108863>>>a<o)for(this.length-=o,c=0;c=0&&(0!==u||c>=i);c--){var f=0|this.words[c];this.words[c]=u<<26-a|f>>>a,u=f&s}return l&&0!==u&&(l.words[l.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},a.prototype.ishrn=function(t,e,r){return n(0===this.negative),this.iushrn(t,e,r)},a.prototype.shln=function(t){return this.clone().ishln(t)},a.prototype.ushln=function(t){return this.clone().iushln(t)},a.prototype.shrn=function(t){return this.clone().ishrn(t)},a.prototype.ushrn=function(t){return this.clone().iushrn(t)},a.prototype.testn=function(t){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var i=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},a.prototype.isubn=function(t){if(n("number"==typeof t),n(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(l/67108864|0),this.words[i+r]=67108863&a}for(;i>26,this.words[i+r]=67108863&a;if(0===s)return this.strip();for(n(-1===s),s=0,i=0;i>26,this.words[i]=67108863&a;return this.negative=1,this.strip()},a.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,o=0|i.words[i.length-1];0!==(r=26-this._countBits(o))&&(i=i.ushln(r),n.iushln(r),o=0|i.words[i.length-1]);var s,l=n.length-i.length;if("mod"!==e){(s=new a(null)).length=l+1,s.words=new Array(s.length);for(var c=0;c=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/o|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},a.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new a(0),mod:new a(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,e),"mod"!==e&&(i=s.div.neg()),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(t)),{div:i,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),e),"mod"!==e&&(i=s.div.neg()),{div:i,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),e),"div"!==e&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.cmp(t)<0?{div:new a(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new a(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new a(this.modn(t.words[0]))}:this._wordDiv(t,e);var i,o,s},a.prototype.div=function(t){return this.divmod(t,"div",!1).div},a.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},a.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},a.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,n=t.ushrn(1),i=t.andln(1),a=r.cmp(n);return a<0||1===i&&0===a?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},a.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},a.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},a.prototype.divn=function(t){return this.clone().idivn(t)},a.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new a(1),o=new a(0),s=new a(0),l=new a(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var u=r.clone(),f=e.clone();!e.isZero();){for(var h=0,p=1;0==(e.words[0]&p)&&h<26;++h,p<<=1);if(h>0)for(e.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(u),o.isub(f)),i.iushrn(1),o.iushrn(1);for(var d=0,m=1;0==(r.words[0]&m)&&d<26;++d,m<<=1);if(d>0)for(r.iushrn(d);d-- >0;)(s.isOdd()||l.isOdd())&&(s.iadd(u),l.isub(f)),s.iushrn(1),l.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(s),o.isub(l)):(r.isub(e),s.isub(i),l.isub(o))}return{a:s,b:l,gcd:r.iushln(c)}},a.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,o=new a(1),s=new a(0),l=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,u=1;0==(e.words[0]&u)&&c<26;++c,u<<=1);if(c>0)for(e.iushrn(c);c-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var f=0,h=1;0==(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(l),s.iushrn(1);e.cmp(r)>=0?(e.isub(r),o.isub(s)):(r.isub(e),s.isub(o))}return(i=0===e.cmpn(1)?o:s).cmpn(0)<0&&i.iadd(t),i},a.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var a=e;e=r,r=a}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},a.prototype.invm=function(t){return this.egcd(t).a.umod(t)},a.prototype.isEven=function(){return 0==(1&this.words[0])},a.prototype.isOdd=function(){return 1==(1&this.words[0])},a.prototype.andln=function(t){return this.words[0]&t},a.prototype.bincn=function(t){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},a.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},a.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(e=1);break}}return e},a.prototype.gtn=function(t){return 1===this.cmpn(t)},a.prototype.gt=function(t){return 1===this.cmp(t)},a.prototype.gten=function(t){return this.cmpn(t)>=0},a.prototype.gte=function(t){return this.cmp(t)>=0},a.prototype.ltn=function(t){return-1===this.cmpn(t)},a.prototype.lt=function(t){return-1===this.cmp(t)},a.prototype.lten=function(t){return this.cmpn(t)<=0},a.prototype.lte=function(t){return this.cmp(t)<=0},a.prototype.eqn=function(t){return 0===this.cmpn(t)},a.prototype.eq=function(t){return 0===this.cmp(t)},a.red=function(t){return new T(t)},a.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},a.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},a.prototype._forceRed=function(t){return this.red=t,this},a.prototype.forceRed=function(t){return n(!this.red,"Already a number in reduction context"),this._forceRed(t)},a.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},a.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},a.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},a.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},a.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},a.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},a.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},a.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},a.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},a.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},a.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},a.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},a.prototype.redPow=function(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(t,e){this.name=t,this.p=new a(e,16),this.n=this.p.bitLength(),this.k=new a(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=a._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function k(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new a(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var t=new a(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var n=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(x,y),x.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=a}i>>>=22,t.words[n-10]=i,0===i&&t.length>10?t.length-=10:t.length-=9},x.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},a._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new x;else if("p224"===t)e=new b;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return v[t]=e,e},T.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new a(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var s=new a(1).toRed(this),l=s.redNeg(),c=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new a(2*u*u).toRed(this);0!==this.pow(u,c).cmp(l);)u.redIAdd(l);for(var f=this.pow(u,i),h=this.pow(t,i.addn(1).iushrn(1)),p=this.pow(t,i),d=o;0!==p.cmp(s);){for(var m=p,g=0;0!==m.cmp(s);g++)m=m.redSqr();n(g=0;n--){for(var c=e.words[n],u=l-1;u>=0;u--){var f=c>>u&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==o?(o<<=1,o|=f,(4===++s||0===n&&0===u)&&(i=this.mul(i,r[o]),s=0,o=0)):s=0}l=26}return i},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},a.mont=function(t){return new k(t)},i(k,T),k.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},k.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},k.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new a(0)._forceRed(this);var r=t.mul(e),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},k.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===e||e,this)},{buffer:2}],34:[function(t,e,r){"use strict";e.exports=function(t){var e,r,n,i=t.length,a=0;for(e=0;e>>1;if(!(u<=0)){var f,h=i.mallocDouble(2*u*s),p=i.mallocInt32(s);if((s=l(t,u,h,p))>0){if(1===u&&n)a.init(s),f=a.sweepComplete(u,r,0,s,h,p,0,s,h,p);else{var d=i.mallocDouble(2*u*c),m=i.mallocInt32(c);(c=l(e,u,d,m))>0&&(a.init(s+c),f=1===u?a.sweepBipartite(u,r,0,s,h,p,0,c,d,m):o(u,r,n,s,h,p,c,d,m),i.free(d),i.free(m))}i.free(h),i.free(p)}return f}}}function u(t,e){n.push([t,e])}function f(t){return n=[],c(t,t,u,!0),n}function h(t,e){return n=[],c(t,e,u,!1),n}},{"./lib/intersect":37,"./lib/sweep":41,"typedarray-pool":308}],36:[function(t,e,r){"use strict";function n(t){return t?function(t,e,r,n,i,a,o,s,l,c,u){return i-n>l-s?function(t,e,r,n,i,a,o,s,l,c,u){for(var f=2*t,h=n,p=f*n;hc-l?n?function(t,e,r,n,i,a,o,s,l,c,u){for(var f=2*t,h=n,p=f*n;h0;){var L=6*(S-=1),C=v[L],P=v[L+1],I=v[L+2],O=v[L+3],z=v[L+4],D=v[L+5],R=2*S,F=y[R],B=y[R+1],N=1&D,j=!!(16&D),U=u,V=w,H=k,q=A;if(N&&(U=k,V=A,H=u,q=w),!(2&D&&(I=p(t,C,P,I,U,V,B),P>=I)||4&D&&(P=d(t,C,P,I,U,V,F))>=I)){var G=I-P,Y=z-O;if(j){if(t*G*(G+Y)<1<<22){if(void 0!==(M=l.scanComplete(t,C,e,P,I,U,V,O,z,H,q)))return M;continue}}else{if(t*Math.min(G,Y)<128){if(void 0!==(M=o(t,C,e,N,P,I,U,V,O,z,H,q)))return M;continue}if(t*G*Y<1<<22){if(void 0!==(M=l.scanBipartite(t,C,e,N,P,I,U,V,O,z,H,q)))return M;continue}}var W=f(t,C,P,I,U,V,F,B);if(P=p0)&&!(p1>=hi)"),h=u("lo===p0"),p=u("lo>>1,f=2*t,h=u,p=o[f*u+e];for(;l=y?(h=v,p=y):g>=b?(h=m,p=g):(h=x,p=b):y>=b?(h=v,p=y):b>=g?(h=m,p=g):(h=x,p=b);for(var _=f*(c-1),w=f*h,T=0;Tr&&i[f+e]>c;--u,f-=o){for(var h=f,p=f+o,d=0;dh;++h,l+=s){if(i[l+f]===o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"loh;++h,l+=s){if(i[l+f]p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"lo<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=t+e,h=r;n>h;++h,l+=s){if(i[l+f]<=o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"hi<=p0":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=t+e,h=r;n>h;++h,l+=s){if(i[l+f]<=o)if(u===h)u+=1,c+=s;else{for(var p=0;s>p;++p){var d=i[l+p];i[l+p]=i[c],i[c++]=d}var m=a[h];a[h]=a[u],a[u++]=m}}return u},"lop;++p,l+=s){var d=i[l+f],m=i[l+h];if(dg;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"lo<=p0&&p0<=hi":function(t,e,r,n,i,a,o){for(var s=2*t,l=s*r,c=l,u=r,f=e,h=t+e,p=r;n>p;++p,l+=s){var d=i[l+f],m=i[l+h];if(d<=o&&o<=m)if(u===p)u+=1,c+=s;else{for(var g=0;s>g;++g){var v=i[l+g];i[l+g]=i[c],i[c++]=v}var y=a[p];a[p]=a[u],a[u++]=y}}return u},"!(lo>=p0)&&!(p1>=hi)":function(t,e,r,n,i,a,o,s){for(var l=2*t,c=l*r,u=c,f=r,h=e,p=t+e,d=r;n>d;++d,c+=l){var m=i[c+h],g=i[c+p];if(!(m>=o||s>=g))if(f===d)f+=1,u+=l;else{for(var v=0;l>v;++v){var y=i[c+v];i[c+v]=i[u],i[u++]=y}var x=a[d];a[d]=a[f],a[f++]=x}}return f}}},{}],40:[function(t,e,r){"use strict";e.exports=function(t,e){e<=128?n(0,e-1,t):function t(e,r,u){var f=(r-e+1)/6|0,h=e+f,p=r-f,d=e+r>>1,m=d-f,g=d+f,v=h,y=m,x=d,b=g,_=p,w=e+1,T=r-1,k=0;l(v,y,u)&&(k=v,v=y,y=k);l(b,_,u)&&(k=b,b=_,_=k);l(v,x,u)&&(k=v,v=x,x=k);l(y,x,u)&&(k=y,y=x,x=k);l(v,b,u)&&(k=v,v=b,b=k);l(x,b,u)&&(k=x,x=b,b=k);l(y,_,u)&&(k=y,y=_,_=k);l(y,x,u)&&(k=y,y=x,x=k);l(b,_,u)&&(k=b,b=_,_=k);for(var A=u[2*y],M=u[2*y+1],S=u[2*b],E=u[2*b+1],L=2*v,C=2*x,P=2*_,I=2*h,O=2*d,z=2*p,D=0;D<2;++D){var R=u[L+D],F=u[C+D],B=u[P+D];u[I+D]=R,u[O+D]=F,u[z+D]=B}a(m,e,u),a(g,r,u);for(var N=w;N<=T;++N)if(c(N,A,M,u))N!==w&&i(N,w,u),++w;else if(!c(N,S,E,u))for(;;){if(c(T,S,E,u)){c(T,A,M,u)?(o(N,w,T,u),++w,--T):(i(N,T,u),--T);break}if(--Tt;){var c=r[l-2],u=r[l-1];if(cr[e+1])}function c(t,e,r,n){var i=n[t*=2];return i>>1;a(h,M);var S=0,E=0;for(w=0;w=1<<28)p(l,c,E--,L=L-(1<<28)|0);else if(L>=0)p(o,s,S--,L);else if(L<=-(1<<28)){L=-L-(1<<28)|0;for(var C=0;C>>1;a(h,E);var L=0,C=0,P=0;for(k=0;k>1==h[2*k+3]>>1&&(O=2,k+=1),I<0){for(var z=-(I>>1)-1,D=0;D>1)-1;0===O?p(o,s,L--,z):1===O?p(l,c,C--,z):2===O&&p(u,f,P--,z)}}},scanBipartite:function(t,e,r,n,i,l,c,u,f,m,g,v){var y=0,x=2*t,b=e,_=e+t,w=1,T=1;n?T=1<<28:w=1<<28;for(var k=i;k>>1;a(h,E);var L=0;for(k=0;k=1<<28?(P=!n,A-=1<<28):(P=!!n,A-=1),P)d(o,s,L++,A);else{var I=v[A],O=x*A,z=g[O+e+1],D=g[O+e+1+t];t:for(var R=0;R>>1;a(h,w);var T=0;for(y=0;y=1<<28)o[T++]=x-(1<<28);else{var A=p[x-=1],M=m*x,S=f[M+e+1],E=f[M+e+1+t];t:for(var L=0;L=0;--L)if(o[L]===x){for(O=L+1;O0;){for(var p=r.pop(),d=(s=r.pop(),u=-1,f=-1,l=o[s],1);d=0||(e.flip(s,p),i(t,e,r,u,s,f),i(t,e,r,s,f,u),i(t,e,r,f,p,u),i(t,e,r,p,u,f)))}}},{"binary-search-bounds":31,"robust-in-sphere":282}],44:[function(t,e,r){"use strict";var n,i=t("binary-search-bounds");function a(t,e,r,n,i,a,o){this.cells=t,this.neighbor=e,this.flags=n,this.constraint=r,this.active=i,this.next=a,this.boundary=o}function o(t,e){return t[0]-e[0]||t[1]-e[1]||t[2]-e[2]}e.exports=function(t,e,r){var n=function(t,e){for(var r=t.cells(),n=r.length,i=0;i0||l.length>0;){for(;s.length>0;){var p=s.pop();if(c[p]!==-i){c[p]=i;u[p];for(var d=0;d<3;++d){var m=h[3*p+d];m>=0&&0===c[m]&&(f[3*p+d]?l.push(m):(s.push(m),c[m]=i))}}}var g=l;l=s,s=g,l.length=0,i=-i}var v=function(t,e,r){for(var n=0,i=0;i1&&i(r[h[p-2]],r[h[p-1]],a)>0;)t.push([h[p-1],h[p-2],o]),p-=1;h.length=p,h.push(o);var d=f.upperIds;for(p=d.length;p>1&&i(r[d[p-2]],r[d[p-1]],a)<0;)t.push([d[p-2],d[p-1],o]),p-=1;d.length=p,d.push(o)}}function u(t,e){var r;return(r=t.a[0]d[0]&&i.push(new o(d,p,2,l),new o(p,d,1,l))}i.sort(s);for(var m=i[0].a[0]-(1+Math.abs(i[0].a[0]))*Math.pow(2,-52),g=[new a([m,1],[m,0],-1,[],[],[],[])],v=[],y=(l=0,i.length);l=0}}(),a.removeTriangle=function(t,e,r){var n=this.stars;o(n[t],e,r),o(n[e],r,t),o(n[r],t,e)},a.addTriangle=function(t,e,r){var n=this.stars;n[t].push(e,r),n[e].push(r,t),n[r].push(t,e)},a.opposite=function(t,e){for(var r=this.stars[e],n=1,i=r.length;ne[2]?1:0)}function v(t,e,r){if(0!==t.length){if(e)for(var n=0;n=0;--a){var x=e[u=(S=n[a])[0]],b=x[0],_=x[1],w=t[b],T=t[_];if((w[0]-T[0]||w[1]-T[1])<0){var k=b;b=_,_=k}x[0]=b;var A,M=x[1]=S[1];for(i&&(A=x[2]);a>0&&n[a-1][0]===u;){var S,E=(S=n[--a])[1];i?e.push([M,E,A]):e.push([M,E]),M=E}i?e.push([M,_,A]):e.push([M,_])}return h}(t,e,h,g,r));return v(e,y,r),!!y||(h.length>0||g.length>0)}},{"./lib/rat-seg-intersect":51,"big-rat":18,"big-rat/cmp":16,"big-rat/to-float":30,"box-intersect":35,nextafter:260,"rat-vec":273,"robust-segment-intersect":287,"union-find":309}],51:[function(t,e,r){"use strict";e.exports=function(t,e,r,n){var a=s(e,t),f=s(n,r),h=u(a,f);if(0===o(h))return null;var p=s(t,r),d=u(f,p),m=i(d,h),g=c(a,m);return l(t,g)};var n=t("big-rat/mul"),i=t("big-rat/div"),a=t("big-rat/sub"),o=t("big-rat/sign"),s=t("rat-vec/sub"),l=t("rat-vec/add"),c=t("rat-vec/muls");function u(t,e){return a(n(t[0],e[1]),n(t[1],e[0]))}},{"big-rat/div":17,"big-rat/mul":27,"big-rat/sign":28,"big-rat/sub":29,"rat-vec/add":272,"rat-vec/muls":274,"rat-vec/sub":275}],52:[function(t,e,r){e.exports={jet:[{index:0,rgb:[0,0,131]},{index:.125,rgb:[0,60,170]},{index:.375,rgb:[5,255,255]},{index:.625,rgb:[255,255,0]},{index:.875,rgb:[250,0,0]},{index:1,rgb:[128,0,0]}],hsv:[{index:0,rgb:[255,0,0]},{index:.169,rgb:[253,255,2]},{index:.173,rgb:[247,255,2]},{index:.337,rgb:[0,252,4]},{index:.341,rgb:[0,252,10]},{index:.506,rgb:[1,249,255]},{index:.671,rgb:[2,0,253]},{index:.675,rgb:[8,0,253]},{index:.839,rgb:[255,0,251]},{index:.843,rgb:[255,0,245]},{index:1,rgb:[255,0,6]}],hot:[{index:0,rgb:[0,0,0]},{index:.3,rgb:[230,0,0]},{index:.6,rgb:[255,210,0]},{index:1,rgb:[255,255,255]}],spring:[{index:0,rgb:[255,0,255]},{index:1,rgb:[255,255,0]}],summer:[{index:0,rgb:[0,128,102]},{index:1,rgb:[255,255,102]}],autumn:[{index:0,rgb:[255,0,0]},{index:1,rgb:[255,255,0]}],winter:[{index:0,rgb:[0,0,255]},{index:1,rgb:[0,255,128]}],bone:[{index:0,rgb:[0,0,0]},{index:.376,rgb:[84,84,116]},{index:.753,rgb:[169,200,200]},{index:1,rgb:[255,255,255]}],copper:[{index:0,rgb:[0,0,0]},{index:.804,rgb:[255,160,102]},{index:1,rgb:[255,199,127]}],greys:[{index:0,rgb:[0,0,0]},{index:1,rgb:[255,255,255]}],yignbu:[{index:0,rgb:[8,29,88]},{index:.125,rgb:[37,52,148]},{index:.25,rgb:[34,94,168]},{index:.375,rgb:[29,145,192]},{index:.5,rgb:[65,182,196]},{index:.625,rgb:[127,205,187]},{index:.75,rgb:[199,233,180]},{index:.875,rgb:[237,248,217]},{index:1,rgb:[255,255,217]}],greens:[{index:0,rgb:[0,68,27]},{index:.125,rgb:[0,109,44]},{index:.25,rgb:[35,139,69]},{index:.375,rgb:[65,171,93]},{index:.5,rgb:[116,196,118]},{index:.625,rgb:[161,217,155]},{index:.75,rgb:[199,233,192]},{index:.875,rgb:[229,245,224]},{index:1,rgb:[247,252,245]}],yiorrd:[{index:0,rgb:[128,0,38]},{index:.125,rgb:[189,0,38]},{index:.25,rgb:[227,26,28]},{index:.375,rgb:[252,78,42]},{index:.5,rgb:[253,141,60]},{index:.625,rgb:[254,178,76]},{index:.75,rgb:[254,217,118]},{index:.875,rgb:[255,237,160]},{index:1,rgb:[255,255,204]}],bluered:[{index:0,rgb:[0,0,255]},{index:1,rgb:[255,0,0]}],rdbu:[{index:0,rgb:[5,10,172]},{index:.35,rgb:[106,137,247]},{index:.5,rgb:[190,190,190]},{index:.6,rgb:[220,170,132]},{index:.7,rgb:[230,145,90]},{index:1,rgb:[178,10,28]}],picnic:[{index:0,rgb:[0,0,255]},{index:.1,rgb:[51,153,255]},{index:.2,rgb:[102,204,255]},{index:.3,rgb:[153,204,255]},{index:.4,rgb:[204,204,255]},{index:.5,rgb:[255,255,255]},{index:.6,rgb:[255,204,255]},{index:.7,rgb:[255,153,255]},{index:.8,rgb:[255,102,204]},{index:.9,rgb:[255,102,102]},{index:1,rgb:[255,0,0]}],rainbow:[{index:0,rgb:[150,0,90]},{index:.125,rgb:[0,0,200]},{index:.25,rgb:[0,25,255]},{index:.375,rgb:[0,152,255]},{index:.5,rgb:[44,255,150]},{index:.625,rgb:[151,255,0]},{index:.75,rgb:[255,234,0]},{index:.875,rgb:[255,111,0]},{index:1,rgb:[255,0,0]}],portland:[{index:0,rgb:[12,51,131]},{index:.25,rgb:[10,136,186]},{index:.5,rgb:[242,211,56]},{index:.75,rgb:[242,143,56]},{index:1,rgb:[217,30,30]}],blackbody:[{index:0,rgb:[0,0,0]},{index:.2,rgb:[230,0,0]},{index:.4,rgb:[230,210,0]},{index:.7,rgb:[255,255,255]},{index:1,rgb:[160,200,255]}],earth:[{index:0,rgb:[0,0,130]},{index:.1,rgb:[0,180,180]},{index:.2,rgb:[40,210,40]},{index:.4,rgb:[230,230,50]},{index:.6,rgb:[120,70,20]},{index:1,rgb:[255,255,255]}],electric:[{index:0,rgb:[0,0,0]},{index:.15,rgb:[30,0,100]},{index:.4,rgb:[120,0,100]},{index:.6,rgb:[160,90,0]},{index:.8,rgb:[230,200,0]},{index:1,rgb:[255,250,220]}],alpha:[{index:0,rgb:[255,255,255,0]},{index:1,rgb:[255,255,255,1]}],viridis:[{index:0,rgb:[68,1,84]},{index:.13,rgb:[71,44,122]},{index:.25,rgb:[59,81,139]},{index:.38,rgb:[44,113,142]},{index:.5,rgb:[33,144,141]},{index:.63,rgb:[39,173,129]},{index:.75,rgb:[92,200,99]},{index:.88,rgb:[170,220,50]},{index:1,rgb:[253,231,37]}],inferno:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[31,12,72]},{index:.25,rgb:[85,15,109]},{index:.38,rgb:[136,34,106]},{index:.5,rgb:[186,54,85]},{index:.63,rgb:[227,89,51]},{index:.75,rgb:[249,140,10]},{index:.88,rgb:[249,201,50]},{index:1,rgb:[252,255,164]}],magma:[{index:0,rgb:[0,0,4]},{index:.13,rgb:[28,16,68]},{index:.25,rgb:[79,18,123]},{index:.38,rgb:[129,37,129]},{index:.5,rgb:[181,54,122]},{index:.63,rgb:[229,80,100]},{index:.75,rgb:[251,135,97]},{index:.88,rgb:[254,194,135]},{index:1,rgb:[252,253,191]}],plasma:[{index:0,rgb:[13,8,135]},{index:.13,rgb:[75,3,161]},{index:.25,rgb:[125,3,168]},{index:.38,rgb:[168,34,150]},{index:.5,rgb:[203,70,121]},{index:.63,rgb:[229,107,93]},{index:.75,rgb:[248,148,65]},{index:.88,rgb:[253,195,40]},{index:1,rgb:[240,249,33]}],warm:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[172,0,187]},{index:.25,rgb:[219,0,170]},{index:.38,rgb:[255,0,130]},{index:.5,rgb:[255,63,74]},{index:.63,rgb:[255,123,0]},{index:.75,rgb:[234,176,0]},{index:.88,rgb:[190,228,0]},{index:1,rgb:[147,255,0]}],cool:[{index:0,rgb:[125,0,179]},{index:.13,rgb:[116,0,218]},{index:.25,rgb:[98,74,237]},{index:.38,rgb:[68,146,231]},{index:.5,rgb:[0,204,197]},{index:.63,rgb:[0,247,146]},{index:.75,rgb:[0,255,88]},{index:.88,rgb:[40,255,8]},{index:1,rgb:[147,255,0]}],"rainbow-soft":[{index:0,rgb:[125,0,179]},{index:.1,rgb:[199,0,180]},{index:.2,rgb:[255,0,121]},{index:.3,rgb:[255,108,0]},{index:.4,rgb:[222,194,0]},{index:.5,rgb:[150,255,0]},{index:.6,rgb:[0,255,55]},{index:.7,rgb:[0,246,150]},{index:.8,rgb:[50,167,222]},{index:.9,rgb:[103,51,235]},{index:1,rgb:[124,0,186]}],bathymetry:[{index:0,rgb:[40,26,44]},{index:.13,rgb:[59,49,90]},{index:.25,rgb:[64,76,139]},{index:.38,rgb:[63,110,151]},{index:.5,rgb:[72,142,158]},{index:.63,rgb:[85,174,163]},{index:.75,rgb:[120,206,163]},{index:.88,rgb:[187,230,172]},{index:1,rgb:[253,254,204]}],cdom:[{index:0,rgb:[47,15,62]},{index:.13,rgb:[87,23,86]},{index:.25,rgb:[130,28,99]},{index:.38,rgb:[171,41,96]},{index:.5,rgb:[206,67,86]},{index:.63,rgb:[230,106,84]},{index:.75,rgb:[242,149,103]},{index:.88,rgb:[249,193,135]},{index:1,rgb:[254,237,176]}],chlorophyll:[{index:0,rgb:[18,36,20]},{index:.13,rgb:[25,63,41]},{index:.25,rgb:[24,91,59]},{index:.38,rgb:[13,119,72]},{index:.5,rgb:[18,148,80]},{index:.63,rgb:[80,173,89]},{index:.75,rgb:[132,196,122]},{index:.88,rgb:[175,221,162]},{index:1,rgb:[215,249,208]}],density:[{index:0,rgb:[54,14,36]},{index:.13,rgb:[89,23,80]},{index:.25,rgb:[110,45,132]},{index:.38,rgb:[120,77,178]},{index:.5,rgb:[120,113,213]},{index:.63,rgb:[115,151,228]},{index:.75,rgb:[134,185,227]},{index:.88,rgb:[177,214,227]},{index:1,rgb:[230,241,241]}],"freesurface-blue":[{index:0,rgb:[30,4,110]},{index:.13,rgb:[47,14,176]},{index:.25,rgb:[41,45,236]},{index:.38,rgb:[25,99,212]},{index:.5,rgb:[68,131,200]},{index:.63,rgb:[114,156,197]},{index:.75,rgb:[157,181,203]},{index:.88,rgb:[200,208,216]},{index:1,rgb:[241,237,236]}],"freesurface-red":[{index:0,rgb:[60,9,18]},{index:.13,rgb:[100,17,27]},{index:.25,rgb:[142,20,29]},{index:.38,rgb:[177,43,27]},{index:.5,rgb:[192,87,63]},{index:.63,rgb:[205,125,105]},{index:.75,rgb:[216,162,148]},{index:.88,rgb:[227,199,193]},{index:1,rgb:[241,237,236]}],oxygen:[{index:0,rgb:[64,5,5]},{index:.13,rgb:[106,6,15]},{index:.25,rgb:[144,26,7]},{index:.38,rgb:[168,64,3]},{index:.5,rgb:[188,100,4]},{index:.63,rgb:[206,136,11]},{index:.75,rgb:[220,174,25]},{index:.88,rgb:[231,215,44]},{index:1,rgb:[248,254,105]}],par:[{index:0,rgb:[51,20,24]},{index:.13,rgb:[90,32,35]},{index:.25,rgb:[129,44,34]},{index:.38,rgb:[159,68,25]},{index:.5,rgb:[182,99,19]},{index:.63,rgb:[199,134,22]},{index:.75,rgb:[212,171,35]},{index:.88,rgb:[221,210,54]},{index:1,rgb:[225,253,75]}],phase:[{index:0,rgb:[145,105,18]},{index:.13,rgb:[184,71,38]},{index:.25,rgb:[186,58,115]},{index:.38,rgb:[160,71,185]},{index:.5,rgb:[110,97,218]},{index:.63,rgb:[50,123,164]},{index:.75,rgb:[31,131,110]},{index:.88,rgb:[77,129,34]},{index:1,rgb:[145,105,18]}],salinity:[{index:0,rgb:[42,24,108]},{index:.13,rgb:[33,50,162]},{index:.25,rgb:[15,90,145]},{index:.38,rgb:[40,118,137]},{index:.5,rgb:[59,146,135]},{index:.63,rgb:[79,175,126]},{index:.75,rgb:[120,203,104]},{index:.88,rgb:[193,221,100]},{index:1,rgb:[253,239,154]}],temperature:[{index:0,rgb:[4,35,51]},{index:.13,rgb:[23,51,122]},{index:.25,rgb:[85,59,157]},{index:.38,rgb:[129,79,143]},{index:.5,rgb:[175,95,130]},{index:.63,rgb:[222,112,101]},{index:.75,rgb:[249,146,66]},{index:.88,rgb:[249,196,65]},{index:1,rgb:[232,250,91]}],turbidity:[{index:0,rgb:[34,31,27]},{index:.13,rgb:[65,50,41]},{index:.25,rgb:[98,69,52]},{index:.38,rgb:[131,89,57]},{index:.5,rgb:[161,112,59]},{index:.63,rgb:[185,140,66]},{index:.75,rgb:[202,174,88]},{index:.88,rgb:[216,209,126]},{index:1,rgb:[233,246,171]}],"velocity-blue":[{index:0,rgb:[17,32,64]},{index:.13,rgb:[35,52,116]},{index:.25,rgb:[29,81,156]},{index:.38,rgb:[31,113,162]},{index:.5,rgb:[50,144,169]},{index:.63,rgb:[87,173,176]},{index:.75,rgb:[149,196,189]},{index:.88,rgb:[203,221,211]},{index:1,rgb:[254,251,230]}],"velocity-green":[{index:0,rgb:[23,35,19]},{index:.13,rgb:[24,64,38]},{index:.25,rgb:[11,95,45]},{index:.38,rgb:[39,123,35]},{index:.5,rgb:[95,146,12]},{index:.63,rgb:[152,165,18]},{index:.75,rgb:[201,186,69]},{index:.88,rgb:[233,216,137]},{index:1,rgb:[255,253,205]}],cubehelix:[{index:0,rgb:[0,0,0]},{index:.07,rgb:[22,5,59]},{index:.13,rgb:[60,4,105]},{index:.2,rgb:[109,1,135]},{index:.27,rgb:[161,0,147]},{index:.33,rgb:[210,2,142]},{index:.4,rgb:[251,11,123]},{index:.47,rgb:[255,29,97]},{index:.53,rgb:[255,54,69]},{index:.6,rgb:[255,85,46]},{index:.67,rgb:[255,120,34]},{index:.73,rgb:[255,157,37]},{index:.8,rgb:[241,191,57]},{index:.87,rgb:[224,220,93]},{index:.93,rgb:[218,241,142]},{index:1,rgb:[227,253,198]}]}},{}],53:[function(t,e,r){"use strict";var n=t("./colorScale"),i=t("lerp");function a(t){return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function o(t){for(var e,r="#",n=0;n<3;++n)r+=("00"+(e=(e=t[n]).toString(16))).substr(e.length);return r}function s(t){return"rgba("+t.join(",")+")"}e.exports=function(t){var e,r,l,c,u,f,h,p,d,m;t||(t={});p=(t.nshades||72)-1,h=t.format||"hex",(f=t.colormap)||(f="jet");if("string"==typeof f){if(f=f.toLowerCase(),!n[f])throw Error(f+" not a supported colorscale");u=n[f]}else{if(!Array.isArray(f))throw Error("unsupported colormap option",f);u=f.slice()}if(u.length>p+1)throw new Error(f+" map requires nshades to be at least size "+u.length);d=Array.isArray(t.alpha)?2!==t.alpha.length?[1,1]:t.alpha.slice():"number"==typeof t.alpha?[t.alpha,t.alpha]:[1,1];e=u.map((function(t){return Math.round(t.index*p)})),d[0]=Math.min(Math.max(d[0],0),1),d[1]=Math.min(Math.max(d[1],0),1);var g=u.map((function(t,e){var r=u[e].index,n=u[e].rgb.slice();return 4===n.length&&n[3]>=0&&n[3]<=1||(n[3]=d[0]+(d[1]-d[0])*r),n})),v=[];for(m=0;m0||l(t,e,a)?-1:1:0===s?c>0||l(t,e,r)?1:-1:i(c-s)}var h=n(t,e,r);return h>0?o>0&&n(t,e,a)>0?1:-1:h<0?o>0||n(t,e,a)>0?1:-1:n(t,e,a)>0||l(t,e,r)?1:-1};var n=t("robust-orientation"),i=t("signum"),a=t("two-sum"),o=t("robust-product"),s=t("robust-sum");function l(t,e,r){var n=a(t[0],-e[0]),i=a(t[1],-e[1]),l=a(r[0],-e[0]),c=a(r[1],-e[1]),u=s(o(n,l),o(i,c));return u[u.length-1]>=0}},{"robust-orientation":284,"robust-product":285,"robust-sum":289,signum:55,"two-sum":307}],55:[function(t,e,r){"use strict";e.exports=function(t){return t<0?-1:t>0?1:0}},{}],56:[function(t,e,r){e.exports=function(t,e){var r=t.length,a=t.length-e.length;if(a)return a;switch(r){case 0:return 0;case 1:return t[0]-e[0];case 2:return t[0]+t[1]-e[0]-e[1]||n(t[0],t[1])-n(e[0],e[1]);case 3:var o=t[0]+t[1],s=e[0]+e[1];if(a=o+t[2]-(s+e[2]))return a;var l=n(t[0],t[1]),c=n(e[0],e[1]);return n(l,t[2])-n(c,e[2])||n(l+t[2],o)-n(c+e[2],s);case 4:var u=t[0],f=t[1],h=t[2],p=t[3],d=e[0],m=e[1],g=e[2],v=e[3];return u+f+h+p-(d+m+g+v)||n(u,f,h,p)-n(d,m,g,v,d)||n(u+f,u+h,u+p,f+h,f+p,h+p)-n(d+m,d+g,d+v,m+g,m+v,g+v)||n(u+f+h,u+f+p,u+h+p,f+h+p)-n(d+m+g,d+m+v,d+g+v,m+g+v);default:for(var y=t.slice().sort(i),x=e.slice().sort(i),b=0;bt[r][0]&&(r=n);return er?[[r],[e]]:[[e]]}},{}],60:[function(t,e,r){"use strict";e.exports=function(t){var e=n(t),r=e.length;if(r<=2)return[];for(var i=new Array(r),a=e[r-1],o=0;o=e[l]&&(s+=1);a[o]=s}}return t}(n(a,!0),r)}};var n=t("incremental-convex-hull"),i=t("affine-hull")},{"affine-hull":10,"incremental-convex-hull":233}],62:[function(t,e,r){"use strict";e.exports=function(t,e,r,n,i,a){var o=i-1,s=i*i,l=o*o,c=(1+2*i)*l,u=i*l,f=s*(3-2*i),h=s*o;if(t.length){a||(a=new Array(t.length));for(var p=t.length-1;p>=0;--p)a[p]=c*t[p]+u*e[p]+f*r[p]+h*n[p];return a}return c*t+u*e+f*r+h*n},e.exports.derivative=function(t,e,r,n,i,a){var o=6*i*i-6*i,s=3*i*i-4*i+1,l=-6*i*i+6*i,c=3*i*i-2*i;if(t.length){a||(a=new Array(t.length));for(var u=t.length-1;u>=0;--u)a[u]=o*t[u]+s*e[u]+l*r[u]+c*n[u];return a}return o*t+s*e+l*r[u]+c*n}},{}],63:[function(t,e,r){"use strict";var n=t("incremental-convex-hull"),i=t("uniq");function a(t,e){this.point=t,this.index=e}function o(t,e){for(var r=t.point,n=e.point,i=r.length,a=0;a=2)return!1;t[r]=n}return!0})):_.filter((function(t){for(var e=0;e<=s;++e){var r=v[t[e]];if(r<0)return!1;t[e]=r}return!0}));if(1&s)for(u=0;u<_.length;++u){h=(b=_[u])[0];b[0]=b[1],b[1]=h}return _}},{"incremental-convex-hull":233,uniq:310}],64:[function(t,e,r){(function(t){(function(){var r=!1;if("undefined"!=typeof Float64Array){var n=new Float64Array(1),i=new Uint32Array(n.buffer);if(n[0]=1,r=!0,1072693248===i[1]){e.exports=function(t){return n[0]=t,[i[0],i[1]]},e.exports.pack=function(t,e){return i[0]=t,i[1]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[0]},e.exports.hi=function(t){return n[0]=t,i[1]}}else if(1072693248===i[0]){e.exports=function(t){return n[0]=t,[i[1],i[0]]},e.exports.pack=function(t,e){return i[1]=t,i[0]=e,n[0]},e.exports.lo=function(t){return n[0]=t,i[1]},e.exports.hi=function(t){return n[0]=t,i[0]}}else r=!1}if(!r){var a=new t(8);e.exports=function(t){return a.writeDoubleLE(t,0,!0),[a.readUInt32LE(0,!0),a.readUInt32LE(4,!0)]},e.exports.pack=function(t,e){return a.writeUInt32LE(t,0,!0),a.writeUInt32LE(e,4,!0),a.readDoubleLE(0,!0)},e.exports.lo=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(0,!0)},e.exports.hi=function(t){return a.writeDoubleLE(t,0,!0),a.readUInt32LE(4,!0)}}e.exports.sign=function(t){return e.exports.hi(t)>>>31},e.exports.exponent=function(t){return(e.exports.hi(t)<<1>>>21)-1023},e.exports.fraction=function(t){var r=e.exports.lo(t),n=e.exports.hi(t),i=1048575&n;return 2146435072&n&&(i+=1<<20),[r,i]},e.exports.denormalized=function(t){return!(2146435072&e.exports.hi(t))}}).call(this)}).call(this,t("buffer").Buffer)},{buffer:3}],65:[function(t,e,r){"use strict";e.exports=function(t,e){switch(void 0===e&&(e=0),typeof t){case"number":if(t>0)return function(t,e){var r,n;for(r=new Array(t),n=0;n=r-1){h=l.length-1;var d=t-e[r-1];for(p=0;p=r-1)for(var u=s.length-1,f=(e[r-1],0);f=0;--r)if(t[--e])return!1;return!0},s.jump=function(t){var e=this.lastT(),r=this.dimension;if(!(t0;--f)n.push(a(l[f-1],c[f-1],arguments[f])),i.push(0)}},s.push=function(t){var e=this.lastT(),r=this.dimension;if(!(t1e-6?1/s:0;this._time.push(t);for(var h=r;h>0;--h){var p=a(c[h-1],u[h-1],arguments[h]);n.push(p),i.push((p-n[o++])*f)}}},s.set=function(t){var e=this.dimension;if(!(t0;--l)r.push(a(o[l-1],s[l-1],arguments[l])),n.push(0)}},s.move=function(t){var e=this.lastT(),r=this.dimension;if(!(t<=e||arguments.length!==r+1)){var n=this._state,i=this._velocity,o=n.length-this.dimension,s=this.bounds,l=s[0],c=s[1],u=t-e,f=u>1e-6?1/u:0;this._time.push(t);for(var h=r;h>0;--h){var p=arguments[h];n.push(a(l[h-1],c[h-1],n[o++]+p)),i.push(p*f)}}},s.idle=function(t){var e=this.lastT();if(!(t=0;--f)n.push(a(l[f],c[f],n[o]+u*i[o])),i.push(0),o+=1}}},{"binary-search-bounds":31,"cubic-hermite":62}],69:[function(t,e,r){"use strict";e.exports=function(t){return new s(t||m,null)};function n(t,e,r,n,i,a){this._color=t,this.key=e,this.value=r,this.left=n,this.right=i,this._count=a}function i(t){return new n(t._color,t.key,t.value,t.left,t.right,t._count)}function a(t,e){return new n(t,e.key,e.value,e.left,e.right,e._count)}function o(t){t._count=1+(t.left?t.left._count:0)+(t.right?t.right._count:0)}function s(t,e){this._compare=t,this.root=e}var l=s.prototype;function c(t,e){var r;if(e.left&&(r=c(t,e.left)))return r;return(r=t(e.key,e.value))||(e.right?c(t,e.right):void 0)}function u(t,e,r,n){if(e(t,n.key)<=0){var i;if(n.left)if(i=u(t,e,r,n.left))return i;if(i=r(n.key,n.value))return i}if(n.right)return u(t,e,r,n.right)}function f(t,e,r,n,i){var a,o=r(t,i.key),s=r(e,i.key);if(o<=0){if(i.left&&(a=f(t,e,r,n,i.left)))return a;if(s>0&&(a=n(i.key,i.value)))return a}if(s>0&&i.right)return f(t,e,r,n,i.right)}function h(t,e){this.tree=t,this._stack=e}Object.defineProperty(l,"keys",{get:function(){var t=[];return this.forEach((function(e,r){t.push(e)})),t}}),Object.defineProperty(l,"values",{get:function(){var t=[];return this.forEach((function(e,r){t.push(r)})),t}}),Object.defineProperty(l,"length",{get:function(){return this.root?this.root._count:0}}),l.insert=function(t,e){for(var r=this._compare,i=this.root,l=[],c=[];i;){var u=r(t,i.key);l.push(i),c.push(u),i=u<=0?i.left:i.right}l.push(new n(0,t,e,null,null,1));for(var f=l.length-2;f>=0;--f){i=l[f];c[f]<=0?l[f]=new n(i._color,i.key,i.value,l[f+1],i.right,i._count+1):l[f]=new n(i._color,i.key,i.value,i.left,l[f+1],i._count+1)}for(f=l.length-1;f>1;--f){var h=l[f-1];i=l[f];if(1===h._color||1===i._color)break;var p=l[f-2];if(p.left===h)if(h.left===i){if(!(d=p.right)||0!==d._color){if(p._color=0,p.left=h.right,h._color=1,h.right=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(m=l[f-3]).left===p?m.left=h:m.right=h;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else{if(!(d=p.right)||0!==d._color){if(h.right=i.left,p._color=0,p.left=i.right,i._color=1,i.left=h,i.right=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(m=l[f-3]).left===p?m.left=i:m.right=i;break}h._color=1,p.right=a(1,d),p._color=0,f-=1}else if(h.right===i){if(!(d=p.left)||0!==d._color){if(p._color=0,p.right=h.left,h._color=1,h.left=p,l[f-2]=h,l[f-1]=i,o(p),o(h),f>=3)(m=l[f-3]).right===p?m.right=h:m.left=h;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}else{var d;if(!(d=p.left)||0!==d._color){var m;if(h.left=i.right,p._color=0,p.right=i.left,i._color=1,i.right=h,i.left=p,l[f-2]=i,l[f-1]=h,o(p),o(h),o(i),f>=3)(m=l[f-3]).right===p?m.right=i:m.left=i;break}h._color=1,p.left=a(1,d),p._color=0,f-=1}}return l[0]._color=1,new s(r,l[0])},l.forEach=function(t,e,r){if(this.root)switch(arguments.length){case 1:return c(t,this.root);case 2:return u(e,this._compare,t,this.root);case 3:if(this._compare(e,r)>=0)return;return f(e,r,this._compare,t,this.root)}},Object.defineProperty(l,"begin",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.left;return new h(this,t)}}),Object.defineProperty(l,"end",{get:function(){for(var t=[],e=this.root;e;)t.push(e),e=e.right;return new h(this,t)}}),l.at=function(t){if(t<0)return new h(this,[]);for(var e=this.root,r=[];;){if(r.push(e),e.left){if(t=e.right._count)break;e=e.right}return new h(this,[])},l.ge=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<=0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},l.gt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a<0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},l.lt=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>0&&(i=n.length),r=a<=0?r.left:r.right}return n.length=i,new h(this,n)},l.le=function(t){for(var e=this._compare,r=this.root,n=[],i=0;r;){var a=e(t,r.key);n.push(r),a>=0&&(i=n.length),r=a<0?r.left:r.right}return n.length=i,new h(this,n)},l.find=function(t){for(var e=this._compare,r=this.root,n=[];r;){var i=e(t,r.key);if(n.push(r),0===i)return new h(this,n);r=i<=0?r.left:r.right}return new h(this,[])},l.remove=function(t){var e=this.find(t);return e?e.remove():this},l.get=function(t){for(var e=this._compare,r=this.root;r;){var n=e(t,r.key);if(0===n)return r.value;r=n<=0?r.left:r.right}};var p=h.prototype;function d(t,e){t.key=e.key,t.value=e.value,t.left=e.left,t.right=e.right,t._color=e._color,t._count=e._count}function m(t,e){return te?1:0}Object.defineProperty(p,"valid",{get:function(){return this._stack.length>0}}),Object.defineProperty(p,"node",{get:function(){return this._stack.length>0?this._stack[this._stack.length-1]:null},enumerable:!0}),p.clone=function(){return new h(this.tree,this._stack.slice())},p.remove=function(){var t=this._stack;if(0===t.length)return this.tree;var e=new Array(t.length),r=t[t.length-1];e[e.length-1]=new n(r._color,r.key,r.value,r.left,r.right,r._count);for(var l=t.length-2;l>=0;--l){(r=t[l]).left===t[l+1]?e[l]=new n(r._color,r.key,r.value,e[l+1],r.right,r._count):e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count)}if((r=e[e.length-1]).left&&r.right){var c=e.length;for(r=r.left;r.right;)e.push(r),r=r.right;var u=e[c-1];e.push(new n(r._color,u.key,u.value,r.left,r.right,r._count)),e[c-1].key=r.key,e[c-1].value=r.value;for(l=e.length-2;l>=c;--l)r=e[l],e[l]=new n(r._color,r.key,r.value,r.left,e[l+1],r._count);e[c-1].left=e[c]}if(0===(r=e[e.length-1])._color){var f=e[e.length-2];f.left===r?f.left=null:f.right===r&&(f.right=null),e.pop();for(l=0;l=0;--l){if(e=t[l],0===l)return void(e._color=1);if((r=t[l-1]).left===e){if((n=r.right).right&&0===n.right._color){if(s=(n=r.right=i(n)).right=i(n.right),r.right=n.left,n.left=r,n.right=s,n._color=r._color,e._color=1,r._color=1,s._color=1,o(r),o(n),l>1)(c=t[l-2]).left===r?c.left=n:c.right=n;return void(t[l-1]=n)}if(n.left&&0===n.left._color){if(s=(n=r.right=i(n)).left=i(n.left),r.right=s.left,n.left=s.right,s.left=r,s.right=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).left===r?c.left=s:c.right=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.right=a(0,n));r.right=a(0,n);continue}n=i(n),r.right=n.left,n.left=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).left===r?c.left=n:c.right=n),t[l-1]=n,t[l]=r,l+11)(c=t[l-2]).right===r?c.right=n:c.left=n;return void(t[l-1]=n)}if(n.right&&0===n.right._color){if(s=(n=r.left=i(n)).right=i(n.right),r.left=s.right,n.right=s.left,s.right=r,s.left=n,s._color=r._color,r._color=1,n._color=1,e._color=1,o(r),o(n),o(s),l>1)(c=t[l-2]).right===r?c.right=s:c.left=s;return void(t[l-1]=s)}if(1===n._color){if(0===r._color)return r._color=1,void(r.left=a(0,n));r.left=a(0,n);continue}var c;n=i(n),r.left=n.right,n.right=r,n._color=r._color,r._color=0,o(r),o(n),l>1&&((c=t[l-2]).right===r?c.right=n:c.left=n),t[l-1]=n,t[l]=r,l+10)return this._stack[this._stack.length-1].key},enumerable:!0}),Object.defineProperty(p,"value",{get:function(){if(this._stack.length>0)return this._stack[this._stack.length-1].value},enumerable:!0}),Object.defineProperty(p,"index",{get:function(){var t=0,e=this._stack;if(0===e.length){var r=this.tree.root;return r?r._count:0}e[e.length-1].left&&(t=e[e.length-1].left._count);for(var n=e.length-2;n>=0;--n)e[n+1]===e[n].right&&(++t,e[n].left&&(t+=e[n].left._count));return t},enumerable:!0}),p.next=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.right)for(e=e.right;e;)t.push(e),e=e.left;else for(t.pop();t.length>0&&t[t.length-1].right===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(p,"hasNext",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].right)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].left===t[e])return!0;return!1}}),p.update=function(t){var e=this._stack;if(0===e.length)throw new Error("Can't update empty node!");var r=new Array(e.length),i=e[e.length-1];r[r.length-1]=new n(i._color,i.key,t,i.left,i.right,i._count);for(var a=e.length-2;a>=0;--a)(i=e[a]).left===e[a+1]?r[a]=new n(i._color,i.key,i.value,r[a+1],i.right,i._count):r[a]=new n(i._color,i.key,i.value,i.left,r[a+1],i._count);return new s(this.tree._compare,r[0])},p.prev=function(){var t=this._stack;if(0!==t.length){var e=t[t.length-1];if(e.left)for(e=e.left;e;)t.push(e),e=e.right;else for(t.pop();t.length>0&&t[t.length-1].left===e;)e=t[t.length-1],t.pop()}},Object.defineProperty(p,"hasPrev",{get:function(){var t=this._stack;if(0===t.length)return!1;if(t[t.length-1].left)return!0;for(var e=t.length-1;e>0;--e)if(t[e-1].right===t[e])return!0;return!1}})},{}],70:[function(t,e,r){"use strict";e.exports=function(t,e){var r=new u(t);return r.update(e),r};var n=t("./lib/text.js"),i=t("./lib/lines.js"),a=t("./lib/background.js"),o=t("./lib/cube.js"),s=t("./lib/ticks.js"),l=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]);function c(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}function u(t){this.gl=t,this.pixelRatio=1,this.bounds=[[-10,-10,-10],[10,10,10]],this.ticks=[[],[],[]],this.autoTicks=!0,this.tickSpacing=[1,1,1],this.tickEnable=[!0,!0,!0],this.tickFont=["sans-serif","sans-serif","sans-serif"],this.tickSize=[12,12,12],this.tickAngle=[0,0,0],this.tickAlign=["auto","auto","auto"],this.tickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.tickPad=[10,10,10],this.lastCubeProps={cubeEdges:[0,0,0],axis:[0,0,0]},this.labels=["x","y","z"],this.labelEnable=[!0,!0,!0],this.labelFont="sans-serif",this.labelSize=[20,20,20],this.labelAngle=[0,0,0],this.labelAlign=["auto","auto","auto"],this.labelColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.labelPad=[10,10,10],this.lineEnable=[!0,!0,!0],this.lineMirror=[!1,!1,!1],this.lineWidth=[1,1,1],this.lineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.lineTickEnable=[!0,!0,!0],this.lineTickMirror=[!1,!1,!1],this.lineTickLength=[0,0,0],this.lineTickWidth=[1,1,1],this.lineTickColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.gridEnable=[!0,!0,!0],this.gridWidth=[1,1,1],this.gridColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroEnable=[!0,!0,!0],this.zeroLineColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.zeroLineWidth=[2,2,2],this.backgroundEnable=[!1,!1,!1],this.backgroundColor=[[.8,.8,.8,.5],[.8,.8,.8,.5],[.8,.8,.8,.5]],this._firstInit=!0,this._text=null,this._lines=null,this._background=a(t)}var f=u.prototype;function h(){this.primalOffset=[0,0,0],this.primalMinor=[0,0,0],this.mirrorOffset=[0,0,0],this.mirrorMinor=[0,0,0]}f.update=function(t){function e(e,r,n){if(n in t){var i,a=t[n],o=this[n];(e?Array.isArray(a)&&Array.isArray(a[0]):Array.isArray(a))?this[n]=i=[r(a[0]),r(a[1]),r(a[2])]:this[n]=i=[r(a),r(a),r(a)];for(var s=0;s<3;++s)if(i[s]!==o[s])return!0}return!1}t=t||{};var r,a=e.bind(this,!1,Number),o=e.bind(this,!1,Boolean),l=e.bind(this,!1,String),c=e.bind(this,!0,(function(t){if(Array.isArray(t)){if(3===t.length)return[+t[0],+t[1],+t[2],1];if(4===t.length)return[+t[0],+t[1],+t[2],+t[3]]}return[0,0,0,1]})),u=!1,f=!1;if("bounds"in t)for(var h=t.bounds,p=0;p<2;++p)for(var d=0;d<3;++d)h[p][d]!==this.bounds[p][d]&&(f=!0),this.bounds[p][d]=h[p][d];if("ticks"in t){r=t.ticks,u=!0,this.autoTicks=!1;for(p=0;p<3;++p)this.tickSpacing[p]=0}else a("tickSpacing")&&(this.autoTicks=!0,f=!0);if(this._firstInit&&("ticks"in t||"tickSpacing"in t||(this.autoTicks=!0),f=!0,u=!0,this._firstInit=!1),f&&this.autoTicks&&(r=s.create(this.bounds,this.tickSpacing),u=!0),u){for(p=0;p<3;++p)r[p].sort((function(t,e){return t.x-e.x}));s.equal(r,this.ticks)?u=!1:this.ticks=r}o("tickEnable"),l("tickFont")&&(u=!0),a("tickSize"),a("tickAngle"),a("tickPad"),c("tickColor");var m=l("labels");l("labelFont")&&(m=!0),o("labelEnable"),a("labelSize"),a("labelPad"),c("labelColor"),o("lineEnable"),o("lineMirror"),a("lineWidth"),c("lineColor"),o("lineTickEnable"),o("lineTickMirror"),a("lineTickLength"),a("lineTickWidth"),c("lineTickColor"),o("gridEnable"),a("gridWidth"),c("gridColor"),o("zeroEnable"),c("zeroLineColor"),a("zeroLineWidth"),o("backgroundEnable"),c("backgroundColor"),this._text?this._text&&(m||u)&&this._text.update(this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont):this._text=n(this.gl,this.bounds,this.labels,this.labelFont,this.ticks,this.tickFont),this._lines&&u&&(this._lines.dispose(),this._lines=null),this._lines||(this._lines=i(this.gl,this.bounds,this.ticks))};var p=[new h,new h,new h];function d(t,e,r,n,i){for(var a=t.primalOffset,o=t.primalMinor,s=t.mirrorOffset,l=t.mirrorMinor,c=n[e],u=0;u<3;++u)if(e!==u){var f=a,h=s,p=o,d=l;c&1<0?(p[u]=-1,d[u]=0):(p[u]=0,d[u]=1)}}var m=[0,0,0],g={model:l,view:l,projection:l,_ortho:!1};f.isOpaque=function(){return!0},f.isTransparent=function(){return!1},f.drawTransparent=function(t){};var v=[0,0,0],y=[0,0,0],x=[0,0,0];f.draw=function(t){t=t||g;for(var e=this.gl,r=t.model||l,n=t.view||l,i=t.projection||l,a=this.bounds,s=t._ortho||!1,u=o(r,n,i,a,s),f=u.cubeEdges,h=u.axis,b=n[12],_=n[13],w=n[14],T=n[15],k=(s?2:1)*this.pixelRatio*(i[3]*b+i[7]*_+i[11]*w+i[15]*T)/e.drawingBufferHeight,A=0;A<3;++A)this.lastCubeProps.cubeEdges[A]=f[A],this.lastCubeProps.axis[A]=h[A];var M=p;for(A=0;A<3;++A)d(p[A],A,this.bounds,f,h);e=this.gl;var S,E=m;for(A=0;A<3;++A)this.backgroundEnable[A]?E[A]=h[A]:E[A]=0;this._background.draw(r,n,i,a,E,this.backgroundColor),this._lines.bind(r,n,i,this);for(A=0;A<3;++A){var L=[0,0,0];h[A]>0?L[A]=a[1][A]:L[A]=a[0][A];for(var C=0;C<2;++C){var P=(A+1+C)%3,I=(A+1+(1^C))%3;this.gridEnable[P]&&this._lines.drawGrid(P,I,this.bounds,L,this.gridColor[P],this.gridWidth[P]*this.pixelRatio)}for(C=0;C<2;++C){P=(A+1+C)%3,I=(A+1+(1^C))%3;this.zeroEnable[I]&&Math.min(a[0][I],a[1][I])<=0&&Math.max(a[0][I],a[1][I])>=0&&this._lines.drawZero(P,I,this.bounds,L,this.zeroLineColor[I],this.zeroLineWidth[I]*this.pixelRatio)}}for(A=0;A<3;++A){this.lineEnable[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].primalOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio),this.lineMirror[A]&&this._lines.drawAxisLine(A,this.bounds,M[A].mirrorOffset,this.lineColor[A],this.lineWidth[A]*this.pixelRatio);var O=c(v,M[A].primalMinor),z=c(y,M[A].mirrorMinor),D=this.lineTickLength;for(C=0;C<3;++C){var R=k/r[5*C];O[C]*=D[C]*R,z[C]*=D[C]*R}this.lineTickEnable[A]&&this._lines.drawAxisTicks(A,M[A].primalOffset,O,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio),this.lineTickMirror[A]&&this._lines.drawAxisTicks(A,M[A].mirrorOffset,z,this.lineTickColor[A],this.lineTickWidth[A]*this.pixelRatio)}this._lines.unbind(),this._text.bind(r,n,i,this.pixelRatio);var F,B;function N(t){(B=[0,0,0])[t]=1}function j(t,e,r){var n=(t+1)%3,i=(t+2)%3,a=e[n],o=e[i],s=r[n],l=r[i];a>0&&l>0||a>0&&l<0||a<0&&l>0||a<0&&l<0?N(n):(o>0&&s>0||o>0&&s<0||o<0&&s>0||o<0&&s<0)&&N(i)}for(A=0;A<3;++A){var U=M[A].primalMinor,V=M[A].mirrorMinor,H=c(x,M[A].primalOffset);for(C=0;C<3;++C)this.lineTickEnable[A]&&(H[C]+=k*U[C]*Math.max(this.lineTickLength[C],0)/r[5*C]);var q=[0,0,0];if(q[A]=1,this.tickEnable[A]){-3600===this.tickAngle[A]?(this.tickAngle[A]=0,this.tickAlign[A]="auto"):this.tickAlign[A]=-1,F=1,"auto"===(S=[this.tickAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]),B=[0,0,0],j(A,U,V);for(C=0;C<3;++C)H[C]+=k*U[C]*this.tickPad[C]/r[5*C];this._text.drawTicks(A,this.tickSize[A],this.tickAngle[A],H,this.tickColor[A],q,B,S)}if(this.labelEnable[A]){F=0,B=[0,0,0],this.labels[A].length>4&&(N(A),F=1),"auto"===(S=[this.labelAlign[A],.5,F])[0]?S[0]=0:S[0]=parseInt(""+S[0]);for(C=0;C<3;++C)H[C]+=k*U[C]*this.labelPad[C]/r[5*C];H[A]+=.5*(a[0][A]+a[1][A]),this._text.drawLabel(A,this.labelSize[A],this.labelAngle[A],H,this.labelColor[A],[0,0,0],B,S)}}this._text.unbind()},f.dispose=function(){this._text.dispose(),this._lines.dispose(),this._background.dispose(),this._lines=null,this._text=null,this._background=null,this.gl=null}},{"./lib/background.js":71,"./lib/cube.js":72,"./lib/lines.js":73,"./lib/text.js":75,"./lib/ticks.js":76}],71:[function(t,e,r){"use strict";e.exports=function(t){for(var e=[],r=[],s=0,l=0;l<3;++l)for(var c=(l+1)%3,u=(l+2)%3,f=[0,0,0],h=[0,0,0],p=-1;p<=1;p+=2){r.push(s,s+2,s+1,s+1,s+2,s+3),f[l]=p,h[l]=p;for(var d=-1;d<=1;d+=2){f[c]=d;for(var m=-1;m<=1;m+=2)f[u]=m,e.push(f[0],f[1],f[2],h[0],h[1],h[2]),s+=1}var g=c;c=u,u=g}var v=n(t,new Float32Array(e)),y=n(t,new Uint16Array(r),t.ELEMENT_ARRAY_BUFFER),x=i(t,[{buffer:v,type:t.FLOAT,size:3,offset:0,stride:24},{buffer:v,type:t.FLOAT,size:3,offset:12,stride:24}],y),b=a(t);return b.attributes.position.location=0,b.attributes.normal.location=1,new o(t,v,x,b)};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders").bg;function o(t,e,r,n){this.gl=t,this.buffer=e,this.vao=r,this.shader=n}var s=o.prototype;s.draw=function(t,e,r,n,i,a){for(var o=!1,s=0;s<3;++s)o=o||i[s];if(o){var l=this.gl;l.enable(l.POLYGON_OFFSET_FILL),l.polygonOffset(1,2),this.shader.bind(),this.shader.uniforms={model:t,view:e,projection:r,bounds:n,enable:i,colors:a},this.vao.bind(),this.vao.draw(this.gl.TRIANGLES,36),this.vao.unbind(),l.disable(l.POLYGON_OFFSET_FILL)}},s.dispose=function(){this.vao.dispose(),this.buffer.dispose(),this.shader.dispose()}},{"./shaders":74,"gl-buffer":78,"gl-vao":150}],72:[function(t,e,r){"use strict";e.exports=function(t,e,r,a,p){i(s,e,t),i(s,r,s);for(var y=0,x=0;x<2;++x){u[2]=a[x][2];for(var b=0;b<2;++b){u[1]=a[b][1];for(var _=0;_<2;++_)u[0]=a[_][0],h(l[y],u,s),y+=1}}var w=-1;for(x=0;x<8;++x){for(var T=l[x][3],k=0;k<3;++k)c[x][k]=l[x][k]/T;p&&(c[x][2]*=-1),T<0&&(w<0||c[x][2]E&&(w|=1<E&&(w|=1<c[x][1])&&(R=x);var F=-1;for(x=0;x<3;++x){if((N=R^1<c[B][0]&&(B=N)}var j=m;j[0]=j[1]=j[2]=0,j[n.log2(F^R)]=R&F,j[n.log2(R^B)]=R&B;var U=7^B;U===w||U===D?(U=7^F,j[n.log2(B^U)]=U&B):j[n.log2(F^U)]=U&F;var V=g,H=w;for(A=0;A<3;++A)V[A]=H&1< HALF_PI) && (b <= ONE_AND_HALF_PI)) ?\n b - PI :\n b;\n}\n\nfloat look_horizontal_or_vertical(float a, float ratio) {\n // ratio controls the ratio between being horizontal to (vertical + horizontal)\n // if ratio is set to 0.5 then it is 50%, 50%.\n // when using a higher ratio e.g. 0.75 the result would\n // likely be more horizontal than vertical.\n\n float b = positive_angle(a);\n\n return\n (b < ( ratio) * HALF_PI) ? 0.0 :\n (b < (2.0 - ratio) * HALF_PI) ? -HALF_PI :\n (b < (2.0 + ratio) * HALF_PI) ? 0.0 :\n (b < (4.0 - ratio) * HALF_PI) ? HALF_PI :\n 0.0;\n}\n\nfloat roundTo(float a, float b) {\n return float(b * floor((a + 0.5 * b) / b));\n}\n\nfloat look_round_n_directions(float a, int n) {\n float b = positive_angle(a);\n float div = TWO_PI / float(n);\n float c = roundTo(b, div);\n return look_upwards(c);\n}\n\nfloat applyAlignOption(float rawAngle, float delta) {\n return\n (option > 2) ? look_round_n_directions(rawAngle + delta, option) : // option 3-n: round to n directions\n (option == 2) ? look_horizontal_or_vertical(rawAngle + delta, hv_ratio) : // horizontal or vertical\n (option == 1) ? rawAngle + delta : // use free angle, and flip to align with one direction of the axis\n (option == 0) ? look_upwards(rawAngle) : // use free angle, and stay upwards\n (option ==-1) ? 0.0 : // useful for backward compatibility, all texts remains horizontal\n rawAngle; // otherwise return back raw input angle\n}\n\nbool isAxisTitle = (axis.x == 0.0) &&\n (axis.y == 0.0) &&\n (axis.z == 0.0);\n\nvoid main() {\n //Compute world offset\n float axisDistance = position.z;\n vec3 dataPosition = axisDistance * axis + offset;\n\n float beta = angle; // i.e. user defined attributes for each tick\n\n float axisAngle;\n float clipAngle;\n float flip;\n\n if (enableAlign) {\n axisAngle = (isAxisTitle) ? HALF_PI :\n computeViewAngle(dataPosition, dataPosition + axis);\n clipAngle = computeViewAngle(dataPosition, dataPosition + alignDir);\n\n axisAngle += (sin(axisAngle) < 0.0) ? PI : 0.0;\n clipAngle += (sin(clipAngle) < 0.0) ? PI : 0.0;\n\n flip = (dot(vec2(cos(axisAngle), sin(axisAngle)),\n vec2(sin(clipAngle),-cos(clipAngle))) > 0.0) ? 1.0 : 0.0;\n\n beta += applyAlignOption(clipAngle, flip * PI);\n }\n\n //Compute plane offset\n vec2 planeCoord = position.xy * pixelScale;\n\n mat2 planeXform = scale * mat2(\n cos(beta), sin(beta),\n -sin(beta), cos(beta)\n );\n\n vec2 viewOffset = 2.0 * planeXform * planeCoord / resolution;\n\n //Compute clip position\n vec3 clipPosition = project(dataPosition);\n\n //Apply text offset in clip coordinates\n clipPosition += vec3(viewOffset, 0.0);\n\n //Done\n gl_Position = vec4(clipPosition, 1.0);\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 color;\nvoid main() {\n gl_FragColor = color;\n}"]);r.text=function(t){return i(t,s,l,null,[{name:"position",type:"vec3"}])};var c=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec3 normal;\n\nuniform mat4 model, view, projection;\nuniform vec3 enable;\nuniform vec3 bounds[2];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n\n vec3 signAxis = sign(bounds[1] - bounds[0]);\n\n vec3 realNormal = signAxis * normal;\n\n if(dot(realNormal, enable) > 0.0) {\n vec3 minRange = min(bounds[0], bounds[1]);\n vec3 maxRange = max(bounds[0], bounds[1]);\n vec3 nPosition = mix(minRange, maxRange, 0.5 * (position + 1.0));\n gl_Position = projection * view * model * vec4(nPosition, 1.0);\n } else {\n gl_Position = vec4(0,0,0,0);\n }\n\n colorChannel = abs(realNormal);\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec4 colors[3];\n\nvarying vec3 colorChannel;\n\nvoid main() {\n gl_FragColor = colorChannel.x * colors[0] +\n colorChannel.y * colors[1] +\n colorChannel.z * colors[2];\n}"]);r.bg=function(t){return i(t,c,u,null,[{name:"position",type:"vec3"},{name:"normal",type:"vec3"}])}},{"gl-shader":132,glslify:231}],75:[function(t,e,r){(function(r){(function(){"use strict";e.exports=function(t,e,r,a,s,l){var u=n(t),f=i(t,[{buffer:u,size:3}]),h=o(t);h.attributes.position.location=0;var p=new c(t,h,u,f);return p.update(e,r,a,s,l),p};var n=t("gl-buffer"),i=t("gl-vao"),a=t("vectorize-text"),o=t("./shaders").text,s=window||r.global||{},l=s.__TEXT_CACHE||{};s.__TEXT_CACHE={};function c(t,e,r,n){this.gl=t,this.shader=e,this.buffer=r,this.vao=n,this.tickOffset=this.tickCount=this.labelOffset=this.labelCount=null}var u=c.prototype,f=[0,0];u.bind=function(t,e,r,n){this.vao.bind(),this.shader.bind();var i=this.shader.uniforms;i.model=t,i.view=e,i.projection=r,i.pixelScale=n,f[0]=this.gl.drawingBufferWidth,f[1]=this.gl.drawingBufferHeight,this.shader.uniforms.resolution=f},u.unbind=function(){this.vao.unbind()},u.update=function(t,e,r,n,i){var o=[];function s(t,e,r,n,i,s){var c=l[r];c||(c=l[r]={});var u=c[e];u||(u=c[e]=function(t,e){try{return a(t,e)}catch(e){return console.warn('error vectorizing text:"'+t+'" error:',e),{cells:[],positions:[]}}}(e,{triangles:!0,font:r,textAlign:"center",textBaseline:"middle",lineSpacing:i,styletags:s}));for(var f=(n||12)/12,h=u.positions,p=u.cells,d=0,m=p.length;d=0;--v){var y=h[g[v]];o.push(f*y[0],-f*y[1],t)}}for(var c=[0,0,0],u=[0,0,0],f=[0,0,0],h=[0,0,0],p={breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},d=0;d<3;++d){f[d]=o.length/3|0,s(.5*(t[0][d]+t[1][d]),e[d],r[d],12,1.25,p),h[d]=(o.length/3|0)-f[d],c[d]=o.length/3|0;for(var m=0;m=0&&(i=r.length-n-1);var a=Math.pow(10,i),o=Math.round(t*e*a),s=o+"";if(s.indexOf("e")>=0)return s;var l=o/a,c=o%a;o<0?(l=0|-Math.ceil(l),c=0|-c):(l=0|Math.floor(l),c|=0);var u=""+l;if(o<0&&(u="-"+u),i){for(var f=""+c;f.length=t[0][i];--o)a.push({x:o*e[i],text:n(e[i],o)});r.push(a)}return r},r.equal=function(t,e){for(var r=0;r<3;++r){if(t[r].length!==e[r].length)return!1;for(var n=0;nr)throw new Error("gl-buffer: If resizing buffer, must not specify offset");return t.bufferSubData(e,a,i),r}function u(t,e){for(var r=n.malloc(t.length,e),i=t.length,a=0;a=0;--n){if(e[n]!==r)return!1;r*=t[n]}return!0}(t.shape,t.stride))0===t.offset&&t.data.length===t.shape[0]?this.length=c(this.gl,this.type,this.length,this.usage,t.data,e):this.length=c(this.gl,this.type,this.length,this.usage,t.data.subarray(t.offset,t.shape[0]),e);else{var s=n.malloc(t.size,r),l=a(s,t.shape);i.assign(l,t),this.length=c(this.gl,this.type,this.length,this.usage,e<0?s:s.subarray(0,t.size),e),n.free(s)}}else if(Array.isArray(t)){var f;f=this.type===this.gl.ELEMENT_ARRAY_BUFFER?u(t,"uint16"):u(t,"float32"),this.length=c(this.gl,this.type,this.length,this.usage,e<0?f:f.subarray(0,t.length),e),n.free(f)}else if("object"==typeof t&&"number"==typeof t.length)this.length=c(this.gl,this.type,this.length,this.usage,t,e);else{if("number"!=typeof t&&void 0!==t)throw new Error("gl-buffer: Invalid data type");if(e>=0)throw new Error("gl-buffer: Cannot specify offset when resizing buffer");(t|=0)<=0&&(t=1),this.gl.bufferData(this.type,0|t,this.usage),this.length=t}},e.exports=function(t,e,r,n){if(r=r||t.ARRAY_BUFFER,n=n||t.DYNAMIC_DRAW,r!==t.ARRAY_BUFFER&&r!==t.ELEMENT_ARRAY_BUFFER)throw new Error("gl-buffer: Invalid type for webgl buffer, must be either gl.ARRAY_BUFFER or gl.ELEMENT_ARRAY_BUFFER");if(n!==t.DYNAMIC_DRAW&&n!==t.STATIC_DRAW&&n!==t.STREAM_DRAW)throw new Error("gl-buffer: Invalid usage for buffer, must be either gl.DYNAMIC_DRAW, gl.STATIC_DRAW or gl.STREAM_DRAW");var i=t.createBuffer(),a=new s(t,r,i,0,n);return a.update(e),a}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],79:[function(t,e,r){"use strict";var n=t("gl-vec3");e.exports=function(t,e){var r=t.positions,i=t.vectors,a={positions:[],vertexIntensity:[],vertexIntensityBounds:t.vertexIntensityBounds,vectors:[],cells:[],coneOffset:t.coneOffset,colormap:t.colormap};if(0===t.positions.length)return e&&(e[0]=[0,0,0],e[1]=[0,0,0]),a;for(var o=0,s=1/0,l=-1/0,c=1/0,u=-1/0,f=1/0,h=-1/0,p=null,d=null,m=[],g=1/0,v=!1,y=0;yo&&(o=n.length(b)),y){var _=2*n.distance(p,x)/(n.length(d)+n.length(b));_?(g=Math.min(g,_),v=!1):v=!0}v||(p=x,d=b),m.push(b)}var w=[s,c,f],T=[l,u,h];e&&(e[0]=w,e[1]=T),0===o&&(o=1);var k=1/o;isFinite(g)||(g=1),a.vectorScale=g;var A=t.coneSize||.5;t.absoluteConeSize&&(A=t.absoluteConeSize*k),a.coneScale=A;y=0;for(var M=0;y=1},p.isTransparent=function(){return this.opacity<1},p.pickSlots=1,p.setPickBase=function(t){this.pickId=t},p.update=function(t){t=t||{};var e=this.gl;this.dirty=!0,"lightPosition"in t&&(this.lightPosition=t.lightPosition),"opacity"in t&&(this.opacity=t.opacity),"ambient"in t&&(this.ambientLight=t.ambient),"diffuse"in t&&(this.diffuseLight=t.diffuse),"specular"in t&&(this.specularLight=t.specular),"roughness"in t&&(this.roughness=t.roughness),"fresnel"in t&&(this.fresnel=t.fresnel),void 0!==t.tubeScale&&(this.tubeScale=t.tubeScale),void 0!==t.vectorScale&&(this.vectorScale=t.vectorScale),void 0!==t.coneScale&&(this.coneScale=t.coneScale),void 0!==t.coneOffset&&(this.coneOffset=t.coneOffset),t.colormap&&(this.texture.shape=[256,256],this.texture.minFilter=e.LINEAR_MIPMAP_LINEAR,this.texture.magFilter=e.LINEAR,this.texture.setPixels(function(t){for(var e=u({colormap:t,nshades:256,format:"rgba"}),r=new Uint8Array(1024),n=0;n<256;++n){for(var i=e[n],a=0;a<3;++a)r[4*n+a]=i[a];r[4*n+3]=255*i[3]}return c(r,[256,256,4],[4,0,1])}(t.colormap)),this.texture.generateMipmap());var r=t.cells,n=t.positions,i=t.vectors;if(n&&r&&i){var a=[],o=[],s=[],l=[],f=[];this.cells=r,this.positions=n,this.vectors=i;var h=t.meshColor||[1,1,1,1],p=t.vertexIntensity,d=1/0,m=-1/0;if(p)if(t.vertexIntensityBounds)d=+t.vertexIntensityBounds[0],m=+t.vertexIntensityBounds[1];else for(var g=0;g0){var m=this.triShader;m.bind(),m.uniforms=c,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()}},p.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||f,n=t.view||f,i=t.projection||f,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s={model:r,view:n,projection:i,clipBounds:a,tubeScale:this.tubeScale,vectorScale:this.vectorScale,coneScale:this.coneScale,coneOffset:this.coneOffset,pickId:this.pickId/255},l=this.pickShader;l.bind(),l.uniforms=s,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind())},p.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions[r[1]].slice(0,3),i={position:n,dataCoordinate:n,index:Math.floor(r[1]/48)};return"cone"===this.traceType?i.index=Math.floor(r[1]/48):"streamtube"===this.traceType&&(i.intensity=this.intensity[r[1]],i.velocity=this.vectors[r[1]].slice(0,3),i.divergence=this.vectors[r[1]][3],i.index=e),i},p.dispose=function(){this.texture.dispose(),this.triShader.dispose(),this.pickShader.dispose(),this.triangleVAO.dispose(),this.trianglePositions.dispose(),this.triangleVectors.dispose(),this.triangleColors.dispose(),this.triangleUVs.dispose(),this.triangleIds.dispose()},e.exports=function(t,e,r){var n=r.shaders;1===arguments.length&&(t=(e=t).gl);var s=d(t,n),l=m(t,n),u=o(t,c(new Uint8Array([255,255,255,255]),[1,1,4]));u.generateMipmap(),u.minFilter=t.LINEAR_MIPMAP_LINEAR,u.magFilter=t.LINEAR;var f=i(t),p=i(t),g=i(t),v=i(t),y=i(t),x=a(t,[{buffer:f,type:t.FLOAT,size:4},{buffer:y,type:t.UNSIGNED_BYTE,size:4,normalized:!0},{buffer:g,type:t.FLOAT,size:4},{buffer:v,type:t.FLOAT,size:2},{buffer:p,type:t.FLOAT,size:4}]),b=new h(t,u,s,l,f,p,y,g,v,x,r.traceType||"cone");return b.update(e),b}},{colormap:53,"gl-buffer":78,"gl-mat4/invert":98,"gl-mat4/multiply":100,"gl-shader":132,"gl-texture2d":146,"gl-vao":150,ndarray:259}],81:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec3 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, coneScale, coneOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * conePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(conePosition, 1.0);\n vec4 t_position = view * conePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = conePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the cone vertex and normal at the given index.\n//\n// The returned vertex is for a cone with its top at origin and height of 1.0,\n// pointing in the direction of the vector attribute.\n//\n// Each cone is made up of a top vertex, a center base vertex and base perimeter vertices.\n// These vertices are used to make up the triangles of the cone by the following:\n// segment + 0 top vertex\n// segment + 1 perimeter vertex a+1\n// segment + 2 perimeter vertex a\n// segment + 3 center base vertex\n// segment + 4 perimeter vertex a\n// segment + 5 perimeter vertex a+1\n// Where segment is the number of the radial segment * 6 and a is the angle at that radial segment.\n// To go from index to segment, floor(index / 6)\n// To go from segment to angle, 2*pi * (segment/segmentCount)\n// To go from index to segment index, index - (segment*6)\n//\nvec3 getConePosition(vec3 d, float rawIndex, float coneOffset, out vec3 normal) {\n\n const float segmentCount = 8.0;\n\n float index = rawIndex - floor(rawIndex /\n (segmentCount * 6.0)) *\n (segmentCount * 6.0);\n\n float segment = floor(0.001 + index/6.0);\n float segmentIndex = index - (segment*6.0);\n\n normal = -normalize(d);\n\n if (segmentIndex > 2.99 && segmentIndex < 3.01) {\n return mix(vec3(0.0), -d, coneOffset);\n }\n\n float nextAngle = (\n (segmentIndex > 0.99 && segmentIndex < 1.01) ||\n (segmentIndex > 4.99 && segmentIndex < 5.01)\n ) ? 1.0 : 0.0;\n float angle = 2.0 * 3.14159 * ((segment + nextAngle) / segmentCount);\n\n vec3 v1 = mix(d, vec3(0.0), coneOffset);\n vec3 v2 = v1 - d;\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d)*0.25;\n vec3 y = v * sin(angle) * length(d)*0.25;\n vec3 v3 = v2 + x + y;\n if (segmentIndex < 3.0) {\n vec3 tx = u * sin(angle);\n vec3 ty = v * -cos(angle);\n vec3 tangent = tx + ty;\n normal = normalize(cross(v3 - v1, tangent));\n }\n\n if (segmentIndex == 0.0) {\n return mix(d, vec3(0.0), coneOffset);\n }\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float vectorScale, coneScale, coneOffset;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getConePosition(mat3(model) * ((vectorScale * coneScale) * vector.xyz), position.w, coneOffset, normal);\n vec4 conePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n gl_Position = projection * view * conePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec3"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec3"}]}},{glslify:231}],82:[function(t,e,r){e.exports={0:"NONE",1:"ONE",2:"LINE_LOOP",3:"LINE_STRIP",4:"TRIANGLES",5:"TRIANGLE_STRIP",6:"TRIANGLE_FAN",256:"DEPTH_BUFFER_BIT",512:"NEVER",513:"LESS",514:"EQUAL",515:"LEQUAL",516:"GREATER",517:"NOTEQUAL",518:"GEQUAL",519:"ALWAYS",768:"SRC_COLOR",769:"ONE_MINUS_SRC_COLOR",770:"SRC_ALPHA",771:"ONE_MINUS_SRC_ALPHA",772:"DST_ALPHA",773:"ONE_MINUS_DST_ALPHA",774:"DST_COLOR",775:"ONE_MINUS_DST_COLOR",776:"SRC_ALPHA_SATURATE",1024:"STENCIL_BUFFER_BIT",1028:"FRONT",1029:"BACK",1032:"FRONT_AND_BACK",1280:"INVALID_ENUM",1281:"INVALID_VALUE",1282:"INVALID_OPERATION",1285:"OUT_OF_MEMORY",1286:"INVALID_FRAMEBUFFER_OPERATION",2304:"CW",2305:"CCW",2849:"LINE_WIDTH",2884:"CULL_FACE",2885:"CULL_FACE_MODE",2886:"FRONT_FACE",2928:"DEPTH_RANGE",2929:"DEPTH_TEST",2930:"DEPTH_WRITEMASK",2931:"DEPTH_CLEAR_VALUE",2932:"DEPTH_FUNC",2960:"STENCIL_TEST",2961:"STENCIL_CLEAR_VALUE",2962:"STENCIL_FUNC",2963:"STENCIL_VALUE_MASK",2964:"STENCIL_FAIL",2965:"STENCIL_PASS_DEPTH_FAIL",2966:"STENCIL_PASS_DEPTH_PASS",2967:"STENCIL_REF",2968:"STENCIL_WRITEMASK",2978:"VIEWPORT",3024:"DITHER",3042:"BLEND",3088:"SCISSOR_BOX",3089:"SCISSOR_TEST",3106:"COLOR_CLEAR_VALUE",3107:"COLOR_WRITEMASK",3317:"UNPACK_ALIGNMENT",3333:"PACK_ALIGNMENT",3379:"MAX_TEXTURE_SIZE",3386:"MAX_VIEWPORT_DIMS",3408:"SUBPIXEL_BITS",3410:"RED_BITS",3411:"GREEN_BITS",3412:"BLUE_BITS",3413:"ALPHA_BITS",3414:"DEPTH_BITS",3415:"STENCIL_BITS",3553:"TEXTURE_2D",4352:"DONT_CARE",4353:"FASTEST",4354:"NICEST",5120:"BYTE",5121:"UNSIGNED_BYTE",5122:"SHORT",5123:"UNSIGNED_SHORT",5124:"INT",5125:"UNSIGNED_INT",5126:"FLOAT",5386:"INVERT",5890:"TEXTURE",6401:"STENCIL_INDEX",6402:"DEPTH_COMPONENT",6406:"ALPHA",6407:"RGB",6408:"RGBA",6409:"LUMINANCE",6410:"LUMINANCE_ALPHA",7680:"KEEP",7681:"REPLACE",7682:"INCR",7683:"DECR",7936:"VENDOR",7937:"RENDERER",7938:"VERSION",9728:"NEAREST",9729:"LINEAR",9984:"NEAREST_MIPMAP_NEAREST",9985:"LINEAR_MIPMAP_NEAREST",9986:"NEAREST_MIPMAP_LINEAR",9987:"LINEAR_MIPMAP_LINEAR",10240:"TEXTURE_MAG_FILTER",10241:"TEXTURE_MIN_FILTER",10242:"TEXTURE_WRAP_S",10243:"TEXTURE_WRAP_T",10497:"REPEAT",10752:"POLYGON_OFFSET_UNITS",16384:"COLOR_BUFFER_BIT",32769:"CONSTANT_COLOR",32770:"ONE_MINUS_CONSTANT_COLOR",32771:"CONSTANT_ALPHA",32772:"ONE_MINUS_CONSTANT_ALPHA",32773:"BLEND_COLOR",32774:"FUNC_ADD",32777:"BLEND_EQUATION_RGB",32778:"FUNC_SUBTRACT",32779:"FUNC_REVERSE_SUBTRACT",32819:"UNSIGNED_SHORT_4_4_4_4",32820:"UNSIGNED_SHORT_5_5_5_1",32823:"POLYGON_OFFSET_FILL",32824:"POLYGON_OFFSET_FACTOR",32854:"RGBA4",32855:"RGB5_A1",32873:"TEXTURE_BINDING_2D",32926:"SAMPLE_ALPHA_TO_COVERAGE",32928:"SAMPLE_COVERAGE",32936:"SAMPLE_BUFFERS",32937:"SAMPLES",32938:"SAMPLE_COVERAGE_VALUE",32939:"SAMPLE_COVERAGE_INVERT",32968:"BLEND_DST_RGB",32969:"BLEND_SRC_RGB",32970:"BLEND_DST_ALPHA",32971:"BLEND_SRC_ALPHA",33071:"CLAMP_TO_EDGE",33170:"GENERATE_MIPMAP_HINT",33189:"DEPTH_COMPONENT16",33306:"DEPTH_STENCIL_ATTACHMENT",33635:"UNSIGNED_SHORT_5_6_5",33648:"MIRRORED_REPEAT",33901:"ALIASED_POINT_SIZE_RANGE",33902:"ALIASED_LINE_WIDTH_RANGE",33984:"TEXTURE0",33985:"TEXTURE1",33986:"TEXTURE2",33987:"TEXTURE3",33988:"TEXTURE4",33989:"TEXTURE5",33990:"TEXTURE6",33991:"TEXTURE7",33992:"TEXTURE8",33993:"TEXTURE9",33994:"TEXTURE10",33995:"TEXTURE11",33996:"TEXTURE12",33997:"TEXTURE13",33998:"TEXTURE14",33999:"TEXTURE15",34e3:"TEXTURE16",34001:"TEXTURE17",34002:"TEXTURE18",34003:"TEXTURE19",34004:"TEXTURE20",34005:"TEXTURE21",34006:"TEXTURE22",34007:"TEXTURE23",34008:"TEXTURE24",34009:"TEXTURE25",34010:"TEXTURE26",34011:"TEXTURE27",34012:"TEXTURE28",34013:"TEXTURE29",34014:"TEXTURE30",34015:"TEXTURE31",34016:"ACTIVE_TEXTURE",34024:"MAX_RENDERBUFFER_SIZE",34041:"DEPTH_STENCIL",34055:"INCR_WRAP",34056:"DECR_WRAP",34067:"TEXTURE_CUBE_MAP",34068:"TEXTURE_BINDING_CUBE_MAP",34069:"TEXTURE_CUBE_MAP_POSITIVE_X",34070:"TEXTURE_CUBE_MAP_NEGATIVE_X",34071:"TEXTURE_CUBE_MAP_POSITIVE_Y",34072:"TEXTURE_CUBE_MAP_NEGATIVE_Y",34073:"TEXTURE_CUBE_MAP_POSITIVE_Z",34074:"TEXTURE_CUBE_MAP_NEGATIVE_Z",34076:"MAX_CUBE_MAP_TEXTURE_SIZE",34338:"VERTEX_ATTRIB_ARRAY_ENABLED",34339:"VERTEX_ATTRIB_ARRAY_SIZE",34340:"VERTEX_ATTRIB_ARRAY_STRIDE",34341:"VERTEX_ATTRIB_ARRAY_TYPE",34342:"CURRENT_VERTEX_ATTRIB",34373:"VERTEX_ATTRIB_ARRAY_POINTER",34466:"NUM_COMPRESSED_TEXTURE_FORMATS",34467:"COMPRESSED_TEXTURE_FORMATS",34660:"BUFFER_SIZE",34661:"BUFFER_USAGE",34816:"STENCIL_BACK_FUNC",34817:"STENCIL_BACK_FAIL",34818:"STENCIL_BACK_PASS_DEPTH_FAIL",34819:"STENCIL_BACK_PASS_DEPTH_PASS",34877:"BLEND_EQUATION_ALPHA",34921:"MAX_VERTEX_ATTRIBS",34922:"VERTEX_ATTRIB_ARRAY_NORMALIZED",34930:"MAX_TEXTURE_IMAGE_UNITS",34962:"ARRAY_BUFFER",34963:"ELEMENT_ARRAY_BUFFER",34964:"ARRAY_BUFFER_BINDING",34965:"ELEMENT_ARRAY_BUFFER_BINDING",34975:"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING",35040:"STREAM_DRAW",35044:"STATIC_DRAW",35048:"DYNAMIC_DRAW",35632:"FRAGMENT_SHADER",35633:"VERTEX_SHADER",35660:"MAX_VERTEX_TEXTURE_IMAGE_UNITS",35661:"MAX_COMBINED_TEXTURE_IMAGE_UNITS",35663:"SHADER_TYPE",35664:"FLOAT_VEC2",35665:"FLOAT_VEC3",35666:"FLOAT_VEC4",35667:"INT_VEC2",35668:"INT_VEC3",35669:"INT_VEC4",35670:"BOOL",35671:"BOOL_VEC2",35672:"BOOL_VEC3",35673:"BOOL_VEC4",35674:"FLOAT_MAT2",35675:"FLOAT_MAT3",35676:"FLOAT_MAT4",35678:"SAMPLER_2D",35680:"SAMPLER_CUBE",35712:"DELETE_STATUS",35713:"COMPILE_STATUS",35714:"LINK_STATUS",35715:"VALIDATE_STATUS",35716:"INFO_LOG_LENGTH",35717:"ATTACHED_SHADERS",35718:"ACTIVE_UNIFORMS",35719:"ACTIVE_UNIFORM_MAX_LENGTH",35720:"SHADER_SOURCE_LENGTH",35721:"ACTIVE_ATTRIBUTES",35722:"ACTIVE_ATTRIBUTE_MAX_LENGTH",35724:"SHADING_LANGUAGE_VERSION",35725:"CURRENT_PROGRAM",36003:"STENCIL_BACK_REF",36004:"STENCIL_BACK_VALUE_MASK",36005:"STENCIL_BACK_WRITEMASK",36006:"FRAMEBUFFER_BINDING",36007:"RENDERBUFFER_BINDING",36048:"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE",36049:"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME",36050:"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL",36051:"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE",36053:"FRAMEBUFFER_COMPLETE",36054:"FRAMEBUFFER_INCOMPLETE_ATTACHMENT",36055:"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT",36057:"FRAMEBUFFER_INCOMPLETE_DIMENSIONS",36061:"FRAMEBUFFER_UNSUPPORTED",36064:"COLOR_ATTACHMENT0",36096:"DEPTH_ATTACHMENT",36128:"STENCIL_ATTACHMENT",36160:"FRAMEBUFFER",36161:"RENDERBUFFER",36162:"RENDERBUFFER_WIDTH",36163:"RENDERBUFFER_HEIGHT",36164:"RENDERBUFFER_INTERNAL_FORMAT",36168:"STENCIL_INDEX8",36176:"RENDERBUFFER_RED_SIZE",36177:"RENDERBUFFER_GREEN_SIZE",36178:"RENDERBUFFER_BLUE_SIZE",36179:"RENDERBUFFER_ALPHA_SIZE",36180:"RENDERBUFFER_DEPTH_SIZE",36181:"RENDERBUFFER_STENCIL_SIZE",36194:"RGB565",36336:"LOW_FLOAT",36337:"MEDIUM_FLOAT",36338:"HIGH_FLOAT",36339:"LOW_INT",36340:"MEDIUM_INT",36341:"HIGH_INT",36346:"SHADER_COMPILER",36347:"MAX_VERTEX_UNIFORM_VECTORS",36348:"MAX_VARYING_VECTORS",36349:"MAX_FRAGMENT_UNIFORM_VECTORS",37440:"UNPACK_FLIP_Y_WEBGL",37441:"UNPACK_PREMULTIPLY_ALPHA_WEBGL",37442:"CONTEXT_LOST_WEBGL",37443:"UNPACK_LEGACY_COLORSPACE_CONVERSION_WEBGL",37444:"BROWSER_DEFAULT_WEBGL"}},{}],83:[function(t,e,r){var n=t("./1.0/numbers");e.exports=function(t){return n[t]}},{"./1.0/numbers":82}],84:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=n(e),o=i(e,[{buffer:r,type:e.FLOAT,size:3,offset:0,stride:40},{buffer:r,type:e.FLOAT,size:4,offset:12,stride:40},{buffer:r,type:e.FLOAT,size:3,offset:28,stride:40}]),l=a(e);l.attributes.position.location=0,l.attributes.color.location=1,l.attributes.offset.location=2;var c=new s(e,r,o,l);return c.update(t),c};var n=t("gl-buffer"),i=t("gl-vao"),a=t("./shaders/index"),o=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function s(t,e,r,n){this.gl=t,this.shader=n,this.buffer=e,this.vao=r,this.pixelRatio=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lineWidth=[1,1,1],this.capSize=[10,10,10],this.lineCount=[0,0,0],this.lineOffset=[0,0,0],this.opacity=1,this.hasAlpha=!1}var l=s.prototype;function c(t,e){for(var r=0;r<3;++r)t[0][r]=Math.min(t[0][r],e[r]),t[1][r]=Math.max(t[1][r],e[r])}l.isOpaque=function(){return!this.hasAlpha},l.isTransparent=function(){return this.hasAlpha},l.drawTransparent=l.draw=function(t){var e=this.gl,r=this.shader.uniforms;this.shader.bind();var n=r.view=t.view||o,i=r.projection=t.projection||o;r.model=t.model||o,r.clipBounds=this.clipBounds,r.opacity=this.opacity;var a=n[12],s=n[13],l=n[14],c=n[15],u=(t._ortho||!1?2:1)*this.pixelRatio*(i[3]*a+i[7]*s+i[11]*l+i[15]*c)/e.drawingBufferHeight;this.vao.bind();for(var f=0;f<3;++f)e.lineWidth(this.lineWidth[f]*this.pixelRatio),r.capSize=this.capSize[f]*u,this.lineCount[f]&&e.drawArrays(e.LINES,this.lineOffset[f],this.lineCount[f]);this.vao.unbind()};var u=function(){for(var t=new Array(3),e=0;e<3;++e){for(var r=[],n=1;n<=2;++n)for(var i=-1;i<=1;i+=2){var a=[0,0,0];a[(n+e)%3]=i,r.push(a)}t[e]=r}return t}();function f(t,e,r,n){for(var i=u[n],a=0;a0)(m=u.slice())[s]+=p[1][s],i.push(u[0],u[1],u[2],d[0],d[1],d[2],d[3],0,0,0,m[0],m[1],m[2],d[0],d[1],d[2],d[3],0,0,0),c(this.bounds,m),o+=2+f(i,m,d,s)}}this.lineCount[s]=o-this.lineOffset[s]}this.buffer.update(i)}},l.dispose=function(){this.shader.dispose(),this.buffer.dispose(),this.vao.dispose()}},{"./shaders/index":85,"gl-buffer":78,"gl-vao":150}],85:[function(t,e,r){"use strict";var n=t("glslify"),i=t("gl-shader"),a=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, offset;\nattribute vec4 color;\nuniform mat4 model, view, projection;\nuniform float capSize;\nvarying vec4 fragColor;\nvarying vec3 fragPosition;\n\nvoid main() {\n vec4 worldPosition = model * vec4(position, 1.0);\n worldPosition = (worldPosition / worldPosition.w) + vec4(capSize * offset, 0.0);\n gl_Position = projection * view * worldPosition;\n fragColor = color;\n fragPosition = position;\n}"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float opacity;\nvarying vec3 fragPosition;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], fragPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n gl_FragColor = opacity * fragColor;\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"offset",type:"vec3"}])}},{"gl-shader":132,glslify:231}],86:[function(t,e,r){"use strict";var n=t("gl-texture2d");e.exports=function(t,e,r,n){i||(i=t.FRAMEBUFFER_UNSUPPORTED,a=t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT,o=t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS,s=t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT);var c=t.getExtension("WEBGL_draw_buffers");!l&&c&&function(t,e){var r=t.getParameter(e.MAX_COLOR_ATTACHMENTS_WEBGL);l=new Array(r+1);for(var n=0;n<=r;++n){for(var i=new Array(r),a=0;au||r<0||r>u)throw new Error("gl-fbo: Parameters are too large for FBO");var f=1;if("color"in(n=n||{})){if((f=Math.max(0|n.color,0))<0)throw new Error("gl-fbo: Must specify a nonnegative number of colors");if(f>1){if(!c)throw new Error("gl-fbo: Multiple draw buffer extension not supported");if(f>t.getParameter(c.MAX_COLOR_ATTACHMENTS_WEBGL))throw new Error("gl-fbo: Context does not support "+f+" draw buffers")}}var h=t.UNSIGNED_BYTE,p=t.getExtension("OES_texture_float");if(n.float&&f>0){if(!p)throw new Error("gl-fbo: Context does not support floating point textures");h=t.FLOAT}else n.preferFloat&&f>0&&p&&(h=t.FLOAT);var m=!0;"depth"in n&&(m=!!n.depth);var g=!1;"stencil"in n&&(g=!!n.stencil);return new d(t,e,r,h,f,m,g,c)};var i,a,o,s,l=null;function c(t){return[t.getParameter(t.FRAMEBUFFER_BINDING),t.getParameter(t.RENDERBUFFER_BINDING),t.getParameter(t.TEXTURE_BINDING_2D)]}function u(t,e){t.bindFramebuffer(t.FRAMEBUFFER,e[0]),t.bindRenderbuffer(t.RENDERBUFFER,e[1]),t.bindTexture(t.TEXTURE_2D,e[2])}function f(t){switch(t){case i:throw new Error("gl-fbo: Framebuffer unsupported");case a:throw new Error("gl-fbo: Framebuffer incomplete attachment");case o:throw new Error("gl-fbo: Framebuffer incomplete dimensions");case s:throw new Error("gl-fbo: Framebuffer incomplete missing attachment");default:throw new Error("gl-fbo: Framebuffer failed for unspecified reason")}}function h(t,e,r,i,a,o){if(!i)return null;var s=n(t,e,r,a,i);return s.magFilter=t.NEAREST,s.minFilter=t.NEAREST,s.mipSamples=1,s.bind(),t.framebufferTexture2D(t.FRAMEBUFFER,o,t.TEXTURE_2D,s.handle,0),s}function p(t,e,r,n,i){var a=t.createRenderbuffer();return t.bindRenderbuffer(t.RENDERBUFFER,a),t.renderbufferStorage(t.RENDERBUFFER,n,e,r),t.framebufferRenderbuffer(t.FRAMEBUFFER,i,t.RENDERBUFFER,a),a}function d(t,e,r,n,i,a,o,s){this.gl=t,this._shape=[0|e,0|r],this._destroyed=!1,this._ext=s,this.color=new Array(i);for(var d=0;d1&&s.drawBuffersWEBGL(l[o]);var y=r.getExtension("WEBGL_depth_texture");y?d?t.depth=h(r,i,a,y.UNSIGNED_INT_24_8_WEBGL,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m&&(t.depth=h(r,i,a,r.UNSIGNED_SHORT,r.DEPTH_COMPONENT,r.DEPTH_ATTACHMENT)):m&&d?t._depth_rb=p(r,i,a,r.DEPTH_STENCIL,r.DEPTH_STENCIL_ATTACHMENT):m?t._depth_rb=p(r,i,a,r.DEPTH_COMPONENT16,r.DEPTH_ATTACHMENT):d&&(t._depth_rb=p(r,i,a,r.STENCIL_INDEX,r.STENCIL_ATTACHMENT));var x=r.checkFramebufferStatus(r.FRAMEBUFFER);if(x!==r.FRAMEBUFFER_COMPLETE){t._destroyed=!0,r.bindFramebuffer(r.FRAMEBUFFER,null),r.deleteFramebuffer(t.handle),t.handle=null,t.depth&&(t.depth.dispose(),t.depth=null),t._depth_rb&&(r.deleteRenderbuffer(t._depth_rb),t._depth_rb=null);for(v=0;vi||r<0||r>i)throw new Error("gl-fbo: Can't resize FBO, invalid dimensions");t._shape[0]=e,t._shape[1]=r;for(var a=c(n),o=0;o>8*p&255;this.pickOffset=r,i.bind();var d=i.uniforms;d.viewTransform=t,d.pickOffset=e,d.shape=this.shape;var m=i.attributes;return this.positionBuffer.bind(),m.position.pointer(),this.weightBuffer.bind(),m.weight.pointer(s.UNSIGNED_BYTE,!1),this.idBuffer.bind(),m.pickId.pointer(s.UNSIGNED_BYTE,!1),s.drawArrays(s.TRIANGLES,0,o),r+this.shape[0]*this.shape[1]}}}(),f.pick=function(t,e,r){var n=this.pickOffset,i=this.shape[0]*this.shape[1];if(r=n+i)return null;var a=r-n,o=this.xData,s=this.yData;return{object:this,pointId:a,dataCoord:[o[a%this.shape[0]],s[a/this.shape[0]|0]]}},f.update=function(t){var e=(t=t||{}).shape||[0,0],r=t.x||i(e[0]),o=t.y||i(e[1]),s=t.z||new Float32Array(e[0]*e[1]),l=!1!==t.zsmooth;this.xData=r,this.yData=o;var c,u,f,p,d=t.colorLevels||[0],m=t.colorValues||[0,0,0,1],g=d.length,v=this.bounds;l?(c=v[0]=r[0],u=v[1]=o[0],f=v[2]=r[r.length-1],p=v[3]=o[o.length-1]):(c=v[0]=r[0]+(r[1]-r[0])/2,u=v[1]=o[0]+(o[1]-o[0])/2,f=v[2]=r[r.length-1]+(r[r.length-1]-r[r.length-2])/2,p=v[3]=o[o.length-1]+(o[o.length-1]-o[o.length-2])/2);var y=1/(f-c),x=1/(p-u),b=e[0],_=e[1];this.shape=[b,_];var w=(l?(b-1)*(_-1):b*_)*(h.length>>>1);this.numVertices=w;for(var T=a.mallocUint8(4*w),k=a.mallocFloat32(2*w),A=a.mallocUint8(2*w),M=a.mallocUint32(w),S=0,E=l?b-1:b,L=l?_-1:_,C=0;C max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D dashTexture;\nuniform float dashScale;\nuniform float opacity;\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (\n outOfRange(clipBounds[0], clipBounds[1], worldPosition) ||\n fragColor.a * opacity == 0.\n ) discard;\n\n float dashWeight = texture2D(dashTexture, vec2(dashScale * pixelArcLength, 0)).r;\n if(dashWeight < 0.5) {\n discard;\n }\n gl_FragColor = fragColor * opacity;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\n#define FLOAT_MAX 1.70141184e38\n#define FLOAT_MIN 1.17549435e-38\n\n// https://github.com/mikolalysenko/glsl-read-float/blob/master/index.glsl\nvec4 packFloat(float v) {\n float av = abs(v);\n\n //Handle special cases\n if(av < FLOAT_MIN) {\n return vec4(0.0, 0.0, 0.0, 0.0);\n } else if(v > FLOAT_MAX) {\n return vec4(127.0, 128.0, 0.0, 0.0) / 255.0;\n } else if(v < -FLOAT_MAX) {\n return vec4(255.0, 128.0, 0.0, 0.0) / 255.0;\n }\n\n vec4 c = vec4(0,0,0,0);\n\n //Compute exponent and mantissa\n float e = floor(log2(av));\n float m = av * pow(2.0, -e) - 1.0;\n\n //Unpack mantissa\n c[1] = floor(128.0 * m);\n m -= c[1] / 128.0;\n c[2] = floor(32768.0 * m);\n m -= c[2] / 32768.0;\n c[3] = floor(8388608.0 * m);\n\n //Unpack exponent\n float ebias = e + 127.0;\n c[0] = floor(ebias / 2.0);\n ebias -= c[0] * 2.0;\n c[1] += floor(ebias) * 128.0;\n\n //Unpack sign bit\n c[0] += 128.0 * step(0.0, -v);\n\n //Scale back to range\n return c / 255.0;\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform float pickId;\nuniform vec3 clipBounds[2];\n\nvarying vec3 worldPosition;\nvarying float pixelArcLength;\nvarying vec4 fragColor;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], worldPosition)) discard;\n\n gl_FragColor = vec4(pickId/255.0, packFloat(pixelArcLength).xyz);\n}"]),l=[{name:"position",type:"vec3"},{name:"nextPosition",type:"vec3"},{name:"arcLength",type:"float"},{name:"lineWidth",type:"float"},{name:"color",type:"vec4"}];r.createShader=function(t){return i(t,a,o,null,l)},r.createPickShader=function(t){return i(t,a,s,null,l)}},{"gl-shader":132,glslify:231}],91:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl||t.scene&&t.scene.gl,r=f(e);r.attributes.position.location=0,r.attributes.nextPosition.location=1,r.attributes.arcLength.location=2,r.attributes.lineWidth.location=3,r.attributes.color.location=4;var o=h(e);o.attributes.position.location=0,o.attributes.nextPosition.location=1,o.attributes.arcLength.location=2,o.attributes.lineWidth.location=3,o.attributes.color.location=4;for(var s=n(e),l=i(e,[{buffer:s,size:3,offset:0,stride:48},{buffer:s,size:3,offset:12,stride:48},{buffer:s,size:1,offset:24,stride:48},{buffer:s,size:1,offset:28,stride:48},{buffer:s,size:4,offset:32,stride:48}]),u=c(new Array(1024),[256,1,4]),p=0;p<1024;++p)u.data[p]=255;var d=a(e,u);d.wrap=e.REPEAT;var m=new v(e,r,o,s,l,d);return m.update(t),m};var n=t("gl-buffer"),i=t("gl-vao"),a=t("gl-texture2d"),o=new Uint8Array(4),s=new Float32Array(o.buffer);var l=t("binary-search-bounds"),c=t("ndarray"),u=t("./lib/shaders"),f=u.createShader,h=u.createPickShader,p=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function d(t,e){for(var r=0,n=0;n<3;++n){var i=t[n]-e[n];r+=i*i}return Math.sqrt(r)}function m(t){for(var e=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],r=0;r<3;++r)e[0][r]=Math.max(t[0][r],e[0][r]),e[1][r]=Math.min(t[1][r],e[1][r]);return e}function g(t,e,r,n){this.arcLength=t,this.position=e,this.index=r,this.dataCoordinate=n}function v(t,e,r,n,i,a){this.gl=t,this.shader=e,this.pickShader=r,this.buffer=n,this.vao=i,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.points=[],this.arcLength=[],this.vertexCount=0,this.bounds=[[0,0,0],[0,0,0]],this.pickId=0,this.lineWidth=1,this.texture=a,this.dashScale=1,this.opacity=1,this.hasAlpha=!1,this.dirty=!0,this.pixelRatio=1}var y=v.prototype;y.isTransparent=function(){return this.hasAlpha},y.isOpaque=function(){return!this.hasAlpha},y.pickSlots=1,y.setPickBase=function(t){this.pickId=t},y.drawTransparent=y.draw=function(t){if(this.vertexCount){var e=this.gl,r=this.shader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,clipBounds:m(this.clipBounds),dashTexture:this.texture.bind(),dashScale:this.dashScale/this.arcLength[this.arcLength.length-1],opacity:this.opacity,screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.drawPick=function(t){if(this.vertexCount){var e=this.gl,r=this.pickShader,n=this.vao;r.bind(),r.uniforms={model:t.model||p,view:t.view||p,projection:t.projection||p,pickId:this.pickId,clipBounds:m(this.clipBounds),screenShape:[e.drawingBufferWidth,e.drawingBufferHeight],pixelRatio:this.pixelRatio},n.bind(),n.draw(e.TRIANGLE_STRIP,this.vertexCount),n.unbind()}},y.update=function(t){var e,r;this.dirty=!0;var n=!!t.connectGaps;"dashScale"in t&&(this.dashScale=t.dashScale),this.hasAlpha=!1,"opacity"in t&&(this.opacity=+t.opacity,this.opacity<1&&(this.hasAlpha=!0));var i=[],a=[],o=[],s=0,u=0,f=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],h=t.position||t.positions;if(h){var p=t.color||t.colors||[0,0,0,1],m=t.lineWidth||1,g=!1;t:for(e=1;e0){for(var w=0;w<24;++w)i.push(i[i.length-12]);u+=2,g=!0}continue t}f[0][r]=Math.min(f[0][r],b[r],_[r]),f[1][r]=Math.max(f[1][r],b[r],_[r])}Array.isArray(p[0])?(v=p.length>e-1?p[e-1]:p.length>0?p[p.length-1]:[0,0,0,1],y=p.length>e?p[e]:p.length>0?p[p.length-1]:[0,0,0,1]):v=y=p,3===v.length&&(v=[v[0],v[1],v[2],1]),3===y.length&&(y=[y[0],y[1],y[2],1]),!this.hasAlpha&&v[3]<1&&(this.hasAlpha=!0),x=Array.isArray(m)?m.length>e-1?m[e-1]:m.length>0?m[m.length-1]:[0,0,0,1]:m;var T=s;if(s+=d(b,_),g){for(r=0;r<2;++r)i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3]);u+=2,g=!1}i.push(b[0],b[1],b[2],_[0],_[1],_[2],T,x,v[0],v[1],v[2],v[3],b[0],b[1],b[2],_[0],_[1],_[2],T,-x,v[0],v[1],v[2],v[3],_[0],_[1],_[2],b[0],b[1],b[2],s,-x,y[0],y[1],y[2],y[3],_[0],_[1],_[2],b[0],b[1],b[2],s,x,y[0],y[1],y[2],y[3]),u+=4}}if(this.buffer.update(i),a.push(s),o.push(h[h.length-1].slice()),this.bounds=f,this.vertexCount=u,this.points=o,this.arcLength=a,"dashes"in t){var k=t.dashes.slice();for(k.unshift(0),e=1;e1.0001)return null;v+=g[f]}if(Math.abs(v-1)>.001)return null;return[h,s(t,g),g]}},{barycentric:14,"polytope-closest-point/lib/closest_point_2d.js":270}],111:[function(t,e,r){var n=t("glslify"),i=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position, normal;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model\n , view\n , projection\n , inverseModel;\nuniform vec3 eyePosition\n , lightPosition;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvec4 project(vec3 p) {\n return projection * view * model * vec4(p, 1.0);\n}\n\nvoid main() {\n gl_Position = project(position);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * vec4(position , 1.0);\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n f_color = color;\n f_data = position;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\n//#pragma glslify: beckmann = require(glsl-specular-beckmann) // used in gl-surface3d\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness\n , fresnel\n , kambient\n , kdiffuse\n , kspecular;\nuniform sampler2D texture;\n\nvarying vec3 f_normal\n , f_lightDirection\n , f_eyeDirection\n , f_data;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (f_color.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], f_data)\n ) discard;\n\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n //float specular = max(0.0, beckmann(L, V, N, roughness)); // used in gl-surface3d\n\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = vec4(f_color.rgb, 1.0) * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * f_color.a;\n}\n"]),o=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\n\nuniform mat4 model, view, projection;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_color = color;\n f_data = position;\n f_uv = uv;\n}"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec3 f_data;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_data)) discard;\n\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),l=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 uv;\nattribute float pointSize;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0 ,0.0 ,0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n }\n gl_PointSize = pointSize;\n f_color = color;\n f_uv = uv;\n}"]),c=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform sampler2D texture;\nuniform float opacity;\n\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n vec2 pointR = gl_PointCoord.xy - vec2(0.5, 0.5);\n if(dot(pointR, pointR) > 0.25) {\n discard;\n }\n gl_FragColor = f_color * texture2D(texture, f_uv) * opacity;\n}"]),u=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n f_id = id;\n f_position = position;\n}"]),f=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]),h=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute float pointSize;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0.0, 0.0, 0.0, 0.0);\n } else {\n gl_Position = projection * view * model * vec4(position, 1.0);\n gl_PointSize = pointSize;\n }\n f_id = id;\n f_position = position;\n}"]),p=n(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec3 position;\n\nuniform mat4 model, view, projection;\n\nvoid main() {\n gl_Position = projection * view * model * vec4(position, 1.0);\n}"]),d=n(["precision highp float;\n#define GLSLIFY 1\n\nuniform vec3 contourColor;\n\nvoid main() {\n gl_FragColor = vec4(contourColor, 1.0);\n}\n"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec3"},{name:"normal",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.wireShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"}]},r.pointShader={vertex:l,fragment:c,attributes:[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"pointSize",type:"float"}]},r.pickShader={vertex:u,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"id",type:"vec4"}]},r.pointPickShader={vertex:h,fragment:f,attributes:[{name:"position",type:"vec3"},{name:"pointSize",type:"float"},{name:"id",type:"vec4"}]},r.contourShader={vertex:p,fragment:d,attributes:[{name:"position",type:"vec3"}]}},{glslify:231}],112:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("normals"),l=t("gl-mat4/multiply"),c=t("gl-mat4/invert"),u=t("ndarray"),f=t("colormap"),h=t("simplicial-complex-contour"),p=t("typedarray-pool"),d=t("./lib/shaders"),m=t("./lib/closest-point"),g=d.meshShader,v=d.wireShader,y=d.pointShader,x=d.pickShader,b=d.pointPickShader,_=d.contourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function T(t,e,r,n,i,a,o,s,l,c,u,f,h,p,d,m,g,v,y,x,b,_,T,k,A,M,S){this.gl=t,this.pixelRatio=1,this.cells=[],this.positions=[],this.intensity=[],this.texture=e,this.dirty=!0,this.triShader=r,this.lineShader=n,this.pointShader=i,this.pickShader=a,this.pointPickShader=o,this.contourShader=s,this.trianglePositions=l,this.triangleColors=u,this.triangleNormals=h,this.triangleUVs=f,this.triangleIds=c,this.triangleVAO=p,this.triangleCount=0,this.lineWidth=1,this.edgePositions=d,this.edgeColors=g,this.edgeUVs=v,this.edgeIds=m,this.edgeVAO=y,this.edgeCount=0,this.pointPositions=x,this.pointColors=_,this.pointUVs=T,this.pointSizes=k,this.pointIds=b,this.pointVAO=A,this.pointCount=0,this.contourLineWidth=1,this.contourPositions=M,this.contourVAO=S,this.contourCount=0,this.contourColor=[0,0,0],this.contourEnable=!0,this.pickVertex=!0,this.pickId=1,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.lightPosition=[1e5,1e5,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.opacity=1,this.hasAlpha=!1,this.opacityscale=!1,this._model=w,this._view=w,this._projection=w,this._resolution=[1,1]}var k=T.prototype;function A(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}function M(t){var e=n(t,g.vertex,g.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.normal.location=4,e}function S(t){var e=n(t,v.vertex,v.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e}function E(t){var e=n(t,y.vertex,y.fragment);return e.attributes.position.location=0,e.attributes.color.location=2,e.attributes.uv.location=3,e.attributes.pointSize.location=4,e}function L(t){var e=n(t,x.vertex,x.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e}function C(t){var e=n(t,b.vertex,b.fragment);return e.attributes.position.location=0,e.attributes.id.location=1,e.attributes.pointSize.location=4,e}function P(t){var e=n(t,_.vertex,_.fragment);return e.attributes.position.location=0,e}k.isOpaque=function(){return!this.hasAlpha},k.isTransparent=function(){return this.hasAlpha},k.pickSlots=1,k.setPickBase=function(t){this.pickId=t},k.highlight=function(t){if(t&&this.contourEnable){for(var e=h(this.cells,this.intensity,t.intensity),r=e.cells,n=e.vertexIds,i=e.vertexWeights,a=r.length,o=p.mallocFloat32(6*a),s=0,l=0;l0&&((f=this.triShader).bind(),f.uniforms=s,this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind());this.edgeCount>0&&this.lineWidth>0&&((f=this.lineShader).bind(),f.uniforms=s,this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind());this.pointCount>0&&((f=this.pointShader).bind(),f.uniforms=s,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind());this.contourEnable&&this.contourCount>0&&this.contourLineWidth>0&&((f=this.contourShader).bind(),f.uniforms=s,this.contourVAO.bind(),e.drawArrays(e.LINES,0,this.contourCount),this.contourVAO.unbind())},k.drawPick=function(t){t=t||{};for(var e=this.gl,r=t.model||w,n=t.view||w,i=t.projection||w,a=[[-1e6,-1e6,-1e6],[1e6,1e6,1e6]],o=0;o<3;++o)a[0][o]=Math.max(a[0][o],this.clipBounds[0][o]),a[1][o]=Math.min(a[1][o],this.clipBounds[1][o]);this._model=[].slice.call(r),this._view=[].slice.call(n),this._projection=[].slice.call(i),this._resolution=[e.drawingBufferWidth,e.drawingBufferHeight];var s,l={model:r,view:n,projection:i,clipBounds:a,pickId:this.pickId/255};((s=this.pickShader).bind(),s.uniforms=l,this.triangleCount>0&&(this.triangleVAO.bind(),e.drawArrays(e.TRIANGLES,0,3*this.triangleCount),this.triangleVAO.unbind()),this.edgeCount>0&&(this.edgeVAO.bind(),e.lineWidth(this.lineWidth*this.pixelRatio),e.drawArrays(e.LINES,0,2*this.edgeCount),this.edgeVAO.unbind()),this.pointCount>0)&&((s=this.pointPickShader).bind(),s.uniforms=l,this.pointVAO.bind(),e.drawArrays(e.POINTS,0,this.pointCount),this.pointVAO.unbind())},k.pick=function(t){if(!t)return null;if(t.id!==this.pickId)return null;for(var e=t.value[0]+256*t.value[1]+65536*t.value[2],r=this.cells[e],n=this.positions,i=new Array(r.length),a=0;ai[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t],r.uniforms.angle=v[t],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t]&&T&&(u[1^t]-=M*p*x[t],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t],r.uniforms.angle=_[t],a.drawArrays(a.TRIANGLES,w,T)),u[1^t]=M*s[2+(1^t)]-1,d[t+2]&&(u[1^t]+=M*p*m[t+2],ki[k]&&(r.uniforms.dataAxis=c,r.uniforms.screenOffset=u,r.uniforms.color=g[t+2],r.uniforms.angle=v[t+2],a.drawArrays(a.TRIANGLES,i[k],i[A]-i[k]))),y[t+2]&&T&&(u[1^t]+=M*p*x[t+2],r.uniforms.dataAxis=f,r.uniforms.screenOffset=u,r.uniforms.color=b[t+2],r.uniforms.angle=_[t+2],a.drawArrays(a.TRIANGLES,w,T))}),m.drawTitle=function(){var t=[0,0],e=[0,0];return function(){var r=this.plot,n=this.shader,i=r.gl,a=r.screenBox,o=r.titleCenter,s=r.titleAngle,l=r.titleColor,c=r.pixelRatio;if(this.titleCount){for(var u=0;u<2;++u)e[u]=2*(o[u]*c-a[u])/(a[2+u]-a[u])-1;n.bind(),n.uniforms.dataAxis=t,n.uniforms.screenOffset=e,n.uniforms.angle=s,n.uniforms.color=l,i.drawArrays(i.TRIANGLES,this.titleOffset,this.titleCount)}}}(),m.bind=(h=[0,0],p=[0,0],d=[0,0],function(){var t=this.plot,e=this.shader,r=t._tickBounds,n=t.dataBox,i=t.screenBox,a=t.viewBox;e.bind();for(var o=0;o<2;++o){var s=r[o],l=r[o+2]-s,c=.5*(n[o+2]+n[o]),u=n[o+2]-n[o],f=a[o],m=a[o+2]-f,g=i[o],v=i[o+2]-g;p[o]=2*l/u*m/v,h[o]=2*(s-c)/u*m/v}d[1]=2*t.pixelRatio/(i[3]-i[1]),d[0]=d[1]*(i[3]-i[1])/(i[2]-i[0]),e.uniforms.dataScale=p,e.uniforms.dataShift=h,e.uniforms.textScale=d,this.vbo.bind(),e.attributes.textCoordinate.pointer()}),m.update=function(t){var e,r,n,i,o,s=[],l=t.ticks,c=t.bounds;for(o=0;o<2;++o){var u=[Math.floor(s.length/3)],f=[-1/0],h=l[o];for(e=0;e=0){var m=e[d]-n[d]*(e[d+2]-e[d])/(n[d+2]-n[d]);0===d?o.drawLine(m,e[1],m,e[3],p[d],h[d]):o.drawLine(e[0],m,e[2],m,p[d],h[d])}}for(d=0;d=0;--t)this.objects[t].dispose();this.objects.length=0;for(t=this.overlays.length-1;t>=0;--t)this.overlays[t].dispose();this.overlays.length=0,this.gl=null},c.addObject=function(t){this.objects.indexOf(t)<0&&(this.objects.push(t),this.setDirty())},c.removeObject=function(t){for(var e=this.objects,r=0;rMath.abs(e))c.rotate(a,0,0,-t*r*Math.PI*d.rotateSpeed/window.innerWidth);else if(!d._ortho){var o=-d.zoomSpeed*i*e/window.innerHeight*(a-c.lastT())/20;c.pan(a,0,0,f*(Math.exp(o)-1))}}}),!0)},d.enableMouseListeners(),d};var n=t("right-now"),i=t("3d-view"),a=t("mouse-change"),o=t("mouse-wheel"),s=t("mouse-event-offset"),l=t("has-passive-events")},{"3d-view":7,"has-passive-events":232,"mouse-change":247,"mouse-event-offset":248,"mouse-wheel":250,"right-now":278}],120:[function(t,e,r){var n=t("glslify"),i=t("gl-shader"),a=n(["precision mediump float;\n#define GLSLIFY 1\nattribute vec2 position;\nvarying vec2 uv;\nvoid main() {\n uv = position;\n gl_Position = vec4(position, 0, 1);\n}"]),o=n(["precision mediump float;\n#define GLSLIFY 1\n\nuniform sampler2D accumBuffer;\nvarying vec2 uv;\n\nvoid main() {\n vec4 accum = texture2D(accumBuffer, 0.5 * (uv + 1.0));\n gl_FragColor = min(vec4(1,1,1,1), accum);\n}"]);e.exports=function(t){return i(t,a,o,null,[{name:"position",type:"vec2"}])}},{"gl-shader":132,glslify:231}],121:[function(t,e,r){"use strict";var n=t("./camera.js"),i=t("gl-axes3d"),a=t("gl-axes3d/properties"),o=t("gl-spikes3d"),s=t("gl-select-static"),l=t("gl-fbo"),c=t("a-big-triangle"),u=t("mouse-change"),f=t("gl-mat4/perspective"),h=t("gl-mat4/ortho"),p=t("./lib/shader"),d=t("is-mobile")({tablet:!0,featureDetect:!0});function m(){this.mouse=[-1,-1],this.screen=null,this.distance=1/0,this.index=null,this.dataCoordinate=null,this.dataPosition=null,this.object=null,this.data=null}function g(t){var e=Math.round(Math.log(Math.abs(t))/Math.log(10));if(e<0){var r=Math.round(Math.pow(10,-e));return Math.ceil(t*r)/r}if(e>0){r=Math.round(Math.pow(10,e));return Math.ceil(t/r)*r}return Math.ceil(t)}function v(t){return"boolean"!=typeof t||t}e.exports={createScene:function(t){(t=t||{}).camera=t.camera||{};var e=t.canvas;if(!e){if(e=document.createElement("canvas"),t.container)t.container.appendChild(e);else document.body.appendChild(e)}var r=t.gl;r||(t.glOptions&&(d=!!t.glOptions.preserveDrawingBuffer),r=function(t,e){var r=null;try{(r=t.getContext("webgl",e))||(r=t.getContext("experimental-webgl",e))}catch(t){return null}return r}(e,t.glOptions||{premultipliedAlpha:!0,antialias:!0,preserveDrawingBuffer:d}));if(!r)throw new Error("webgl not supported");var y=t.bounds||[[-10,-10,-10],[10,10,10]],x=new m,b=l(r,r.drawingBufferWidth,r.drawingBufferHeight,{preferFloat:!d}),_=p(r),w=t.cameraObject&&!0===t.cameraObject._ortho||t.camera.projection&&"orthographic"===t.camera.projection.type||!1,T={eye:t.camera.eye||[2,0,0],center:t.camera.center||[0,0,0],up:t.camera.up||[0,1,0],zoomMin:t.camera.zoomMax||.1,zoomMax:t.camera.zoomMin||100,mode:t.camera.mode||"turntable",_ortho:w},k=t.axes||{},A=i(r,k);A.enable=!k.disable;var M=t.spikes||{},S=o(r,M),E=[],L=[],C=[],P=[],I=!0,O=!0,z=new Array(16),D=new Array(16),R={view:null,projection:z,model:D,_ortho:!1},F=(O=!0,[r.drawingBufferWidth,r.drawingBufferHeight]),B=t.cameraObject||n(e,T),N={gl:r,contextLost:!1,pixelRatio:t.pixelRatio||1,canvas:e,selection:x,camera:B,axes:A,axesPixels:null,spikes:S,bounds:y,objects:E,shape:F,aspect:t.aspectRatio||[1,1,1],pickRadius:t.pickRadius||10,zNear:t.zNear||.01,zFar:t.zFar||1e3,fovy:t.fovy||Math.PI/4,clearColor:t.clearColor||[0,0,0,0],autoResize:v(t.autoResize),autoBounds:v(t.autoBounds),autoScale:!!t.autoScale,autoCenter:v(t.autoCenter),clipToBounds:v(t.clipToBounds),snapToData:!!t.snapToData,onselect:t.onselect||null,onrender:t.onrender||null,onclick:t.onclick||null,cameraParams:R,oncontextloss:null,mouseListener:null,_stopped:!1,getAspectratio:function(){return{x:this.aspect[0],y:this.aspect[1],z:this.aspect[2]}},setAspectratio:function(t){this.aspect[0]=t.x,this.aspect[1]=t.y,this.aspect[2]=t.z,O=!0},setBounds:function(t,e){this.bounds[0][t]=e.min,this.bounds[1][t]=e.max},setClearColor:function(t){this.clearColor=t},clearRGBA:function(){this.gl.clearColor(this.clearColor[0],this.clearColor[1],this.clearColor[2],this.clearColor[3]),this.gl.clear(this.gl.COLOR_BUFFER_BIT|this.gl.DEPTH_BUFFER_BIT)}},j=[r.drawingBufferWidth/N.pixelRatio|0,r.drawingBufferHeight/N.pixelRatio|0];function U(){if(!N._stopped&&N.autoResize){var t=e.parentNode,r=1,n=1;t&&t!==document.body?(r=t.clientWidth,n=t.clientHeight):(r=window.innerWidth,n=window.innerHeight);var i=0|Math.ceil(r*N.pixelRatio),a=0|Math.ceil(n*N.pixelRatio);if(i!==e.width||a!==e.height){e.width=i,e.height=a;var o=e.style;o.position=o.position||"absolute",o.left="0px",o.top="0px",o.width=r+"px",o.height=n+"px",I=!0}}}N.autoResize&&U();function V(){for(var t=E.length,e=P.length,n=0;n0&&0===C[e-1];)C.pop(),P.pop().dispose()}function H(){if(N.contextLost)return!0;r.isContextLost()&&(N.contextLost=!0,N.mouseListener.enabled=!1,N.selection.object=null,N.oncontextloss&&N.oncontextloss())}window.addEventListener("resize",U),N.update=function(t){N._stopped||(t=t||{},I=!0,O=!0)},N.add=function(t){N._stopped||(t.axes=A,E.push(t),L.push(-1),I=!0,O=!0,V())},N.remove=function(t){if(!N._stopped){var e=E.indexOf(t);e<0||(E.splice(e,1),L.pop(),I=!0,O=!0,V())}},N.dispose=function(){if(!N._stopped&&(N._stopped=!0,window.removeEventListener("resize",U),e.removeEventListener("webglcontextlost",H),N.mouseListener.enabled=!1,!N.contextLost)){A.dispose(),S.dispose();for(var t=0;tx.distance)continue;for(var c=0;c 1.0) {\n discard;\n }\n baseColor = mix(borderColor, color, step(radius, centerFraction));\n gl_FragColor = vec4(baseColor.rgb * baseColor.a, baseColor.a);\n }\n}\n"]),r.pickVertex=n(["precision mediump float;\n#define GLSLIFY 1\n\nattribute vec2 position;\nattribute vec4 pickId;\n\nuniform mat3 matrix;\nuniform float pointSize;\nuniform vec4 pickOffset;\n\nvarying vec4 fragId;\n\nvoid main() {\n vec3 hgPosition = matrix * vec3(position, 1);\n gl_Position = vec4(hgPosition.xy, 0, hgPosition.z);\n gl_PointSize = pointSize;\n\n vec4 id = pickId + pickOffset;\n id.y += floor(id.x / 256.0);\n id.x -= floor(id.x / 256.0) * 256.0;\n\n id.z += floor(id.y / 256.0);\n id.y -= floor(id.y / 256.0) * 256.0;\n\n id.w += floor(id.z / 256.0);\n id.z -= floor(id.z / 256.0) * 256.0;\n\n fragId = id;\n}\n"]),r.pickFragment=n(["precision mediump float;\n#define GLSLIFY 1\n\nvarying vec4 fragId;\n\nvoid main() {\n float radius = length(2.0 * gl_PointCoord.xy - 1.0);\n if(radius > 1.0) {\n discard;\n }\n gl_FragColor = fragId / 255.0;\n}\n"])},{glslify:231}],123:[function(t,e,r){"use strict";var n=t("gl-shader"),i=t("gl-buffer"),a=t("typedarray-pool"),o=t("./lib/shader");function s(t,e,r,n,i){this.plot=t,this.offsetBuffer=e,this.pickBuffer=r,this.shader=n,this.pickShader=i,this.sizeMin=.5,this.sizeMinCap=2,this.sizeMax=20,this.areaRatio=1,this.pointCount=0,this.color=[1,0,0,1],this.borderColor=[0,0,0,1],this.blend=!1,this.pickOffset=0,this.points=null}e.exports=function(t,e){var r=t.gl,a=i(r),l=i(r),c=n(r,o.pointVertex,o.pointFragment),u=n(r,o.pickVertex,o.pickFragment),f=new s(t,a,l,c,u);return f.update(e),t.addObject(f),f};var l,c,u=s.prototype;u.dispose=function(){this.shader.dispose(),this.pickShader.dispose(),this.offsetBuffer.dispose(),this.pickBuffer.dispose(),this.plot.removeObject(this)},u.update=function(t){var e;function r(e,r){return e in t?t[e]:r}t=t||{},this.sizeMin=r("sizeMin",.5),this.sizeMax=r("sizeMax",20),this.color=r("color",[1,0,0,1]).slice(),this.areaRatio=r("areaRatio",1),this.borderColor=r("borderColor",[0,0,0,1]).slice(),this.blend=r("blend",!1);var n=t.positions.length>>>1,i=t.positions instanceof Float32Array,o=t.idToIndex instanceof Int32Array&&t.idToIndex.length>=n,s=t.positions,l=i?s:a.mallocFloat32(s.length),c=o?t.idToIndex:a.mallocInt32(n);if(i||l.set(s),!o)for(l.set(s),e=0;e>>1;for(r=0;r=e[0]&&a<=e[2]&&o>=e[1]&&o<=e[3]&&n++}return n}(this.points,i),u=this.plot.pickPixelRatio*Math.max(Math.min(this.sizeMinCap,this.sizeMin),Math.min(this.sizeMax,this.sizeMax/Math.pow(s,.33333)));l[0]=2/a,l[4]=2/o,l[6]=-2*i[0]/a-1,l[7]=-2*i[1]/o-1,this.offsetBuffer.bind(),r.bind(),r.attributes.position.pointer(),r.uniforms.matrix=l,r.uniforms.color=this.color,r.uniforms.borderColor=this.borderColor,r.uniforms.pointCloud=u<5,r.uniforms.pointSize=u,r.uniforms.centerFraction=Math.min(1,Math.max(0,Math.sqrt(1-this.areaRatio))),e&&(c[0]=255&t,c[1]=t>>8&255,c[2]=t>>16&255,c[3]=t>>24&255,this.pickBuffer.bind(),r.attributes.pickId.pointer(n.UNSIGNED_BYTE),r.uniforms.pickOffset=c,this.pickOffset=t);var f=n.getParameter(n.BLEND),h=n.getParameter(n.DITHER);return f&&!this.blend&&n.disable(n.BLEND),h&&n.disable(n.DITHER),n.drawArrays(n.POINTS,0,this.pointCount),f&&!this.blend&&n.enable(n.BLEND),h&&n.enable(n.DITHER),t+this.pointCount}),u.draw=u.unifiedDraw,u.drawPick=u.unifiedDraw,u.pick=function(t,e,r){var n=this.pickOffset,i=this.pointCount;if(r=n+i)return null;var a=r-n,o=this.points;return{object:this,pointId:a,dataCoord:[o[2*a],o[2*a+1]]}}},{"./lib/shader":122,"gl-buffer":78,"gl-shader":132,"typedarray-pool":308}],124:[function(t,e,r){e.exports=function(t,e,r,n){var i,a,o,s,l,c=e[0],u=e[1],f=e[2],h=e[3],p=r[0],d=r[1],m=r[2],g=r[3];(a=c*p+u*d+f*m+h*g)<0&&(a=-a,p=-p,d=-d,m=-m,g=-g);1-a>1e-6?(i=Math.acos(a),o=Math.sin(i),s=Math.sin((1-n)*i)/o,l=Math.sin(n*i)/o):(s=1-n,l=n);return t[0]=s*c+l*p,t[1]=s*u+l*d,t[2]=s*f+l*m,t[3]=s*h+l*g,t}},{}],125:[function(t,e,r){"use strict";e.exports=function(t){return t||0===t?t.toString():""}},{}],126:[function(t,e,r){"use strict";var n=t("vectorize-text");e.exports=function(t,e,r){var a=i[e];a||(a=i[e]={});if(t in a)return a[t];var o={textAlign:"center",textBaseline:"middle",lineHeight:1,font:e,lineSpacing:1.25,styletags:{breaklines:!0,bolds:!0,italics:!0,subscripts:!0,superscripts:!0},triangles:!0},s=n(t,o);o.triangles=!1;var l,c,u=n(t,o);if(r&&1!==r){for(l=0;l max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform vec4 highlightId;\nuniform float highlightScale;\nuniform mat4 model, view, projection;\nuniform vec3 clipBounds[2];\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = 1.0;\n if(distance(highlightId, id) < 0.0001) {\n scale = highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1);\n vec4 viewPosition = view * worldPosition;\n viewPosition = viewPosition / viewPosition.w;\n vec4 clipPosition = projection * (viewPosition + scale * vec4(glyph.x, -glyph.y, 0, 0));\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float highlightScale, pixelRatio;\nuniform vec4 highlightId;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float scale = pixelRatio;\n if(distance(highlightId.bgr, id.bgr) < 0.001) {\n scale *= highlightScale;\n }\n\n vec4 worldPosition = model * vec4(position, 1.0);\n vec4 viewPosition = view * worldPosition;\n vec4 clipPosition = projection * viewPosition;\n clipPosition /= clipPosition.w;\n\n gl_Position = clipPosition + vec4(screenSize * scale * vec2(glyph.x, -glyph.y), 0.0, 0.0);\n interpColor = color;\n pickId = id;\n dataCoordinate = position;\n }\n}"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nattribute vec3 position;\nattribute vec4 color;\nattribute vec2 glyph;\nattribute vec4 id;\n\nuniform float highlightScale;\nuniform vec4 highlightId;\nuniform vec3 axes[2];\nuniform mat4 model, view, projection;\nuniform vec2 screenSize;\nuniform vec3 clipBounds[2];\nuniform float scale, pixelRatio;\n\nvarying vec4 interpColor;\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], position)) {\n\n gl_Position = vec4(0,0,0,0);\n } else {\n float lscale = pixelRatio * scale;\n if(distance(highlightId, id) < 0.0001) {\n lscale *= highlightScale;\n }\n\n vec4 clipCenter = projection * view * model * vec4(position, 1);\n vec3 dataPosition = position + 0.5*lscale*(axes[0] * glyph.x + axes[1] * glyph.y) * clipCenter.w * screenSize.y;\n vec4 clipPosition = projection * view * model * vec4(dataPosition, 1);\n\n gl_Position = clipPosition;\n interpColor = color;\n pickId = id;\n dataCoordinate = dataPosition;\n }\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float opacity;\n\nvarying vec4 interpColor;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (\n outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate) ||\n interpColor.a * opacity == 0.\n ) discard;\n gl_FragColor = interpColor * opacity;\n}\n"]),c=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 fragClipBounds[2];\nuniform float pickGroup;\n\nvarying vec4 pickId;\nvarying vec3 dataCoordinate;\n\nvoid main() {\n if (outOfRange(fragClipBounds[0], fragClipBounds[1], dataCoordinate)) discard;\n\n gl_FragColor = vec4(pickGroup, pickId.bgr);\n}"]),u=[{name:"position",type:"vec3"},{name:"color",type:"vec4"},{name:"glyph",type:"vec2"},{name:"id",type:"vec4"}],f={vertex:a,fragment:l,attributes:u},h={vertex:o,fragment:l,attributes:u},p={vertex:s,fragment:l,attributes:u},d={vertex:a,fragment:c,attributes:u},m={vertex:o,fragment:c,attributes:u},g={vertex:s,fragment:c,attributes:u};function v(t,e){var r=n(t,e),i=r.attributes;return i.position.location=0,i.color.location=1,i.glyph.location=2,i.id.location=3,r}r.createPerspective=function(t){return v(t,f)},r.createOrtho=function(t){return v(t,h)},r.createProject=function(t){return v(t,p)},r.createPickPerspective=function(t){return v(t,d)},r.createPickOrtho=function(t){return v(t,m)},r.createPickProject=function(t){return v(t,g)}},{"gl-shader":132,glslify:231}],128:[function(t,e,r){"use strict";var n=t("is-string-blank"),i=t("gl-buffer"),a=t("gl-vao"),o=t("typedarray-pool"),s=t("gl-mat4/multiply"),l=t("./lib/shaders"),c=t("./lib/glyphs"),u=t("./lib/get-simple-string"),f=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];function h(t,e){var r=t[0],n=t[1],i=t[2],a=t[3];return t[0]=e[0]*r+e[4]*n+e[8]*i+e[12]*a,t[1]=e[1]*r+e[5]*n+e[9]*i+e[13]*a,t[2]=e[2]*r+e[6]*n+e[10]*i+e[14]*a,t[3]=e[3]*r+e[7]*n+e[11]*i+e[15]*a,t}function p(t,e,r,n){return h(n,n),h(n,n),h(n,n)}function d(t,e){this.index=t,this.dataCoordinate=this.position=e}function m(t){return!0===t||t>1?1:t}function g(t,e,r,n,i,a,o,s,l,c,u,f){this.gl=t,this.pixelRatio=1,this.shader=e,this.orthoShader=r,this.projectShader=n,this.pointBuffer=i,this.colorBuffer=a,this.glyphBuffer=o,this.idBuffer=s,this.vao=l,this.vertexCount=0,this.lineVertexCount=0,this.opacity=1,this.hasAlpha=!1,this.lineWidth=0,this.projectScale=[2/3,2/3,2/3],this.projectOpacity=[1,1,1],this.projectHasAlpha=!1,this.pickId=0,this.pickPerspectiveShader=c,this.pickOrthoShader=u,this.pickProjectShader=f,this.points=[],this._selectResult=new d(0,[0,0,0]),this.useOrtho=!0,this.bounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.axesProject=[!0,!0,!0],this.axesBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.highlightId=[1,1,1,1],this.highlightScale=2,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.dirty=!0}e.exports=function(t){var e=t.gl,r=l.createPerspective(e),n=l.createOrtho(e),o=l.createProject(e),s=l.createPickPerspective(e),c=l.createPickOrtho(e),u=l.createPickProject(e),f=i(e),h=i(e),p=i(e),d=i(e),m=a(e,[{buffer:f,size:3,type:e.FLOAT},{buffer:h,size:4,type:e.FLOAT},{buffer:p,size:2,type:e.FLOAT},{buffer:d,size:4,type:e.UNSIGNED_BYTE,normalized:!0}]),v=new g(e,r,n,o,f,h,p,d,m,s,c,u);return v.update(t),v};var v=g.prototype;v.pickSlots=1,v.setPickBase=function(t){this.pickId=t},v.isTransparent=function(){if(this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&this.projectHasAlpha)return!0;return!1},v.isOpaque=function(){if(!this.hasAlpha)return!0;for(var t=0;t<3;++t)if(this.axesProject[t]&&!this.projectHasAlpha)return!0;return!1};var y=[0,0],x=[0,0,0],b=[0,0,0],_=[0,0,0,1],w=[0,0,0,1],T=f.slice(),k=[0,0,0],A=[[0,0,0],[0,0,0]];function M(t){return t[0]=t[1]=t[2]=0,t}function S(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=1,t}function E(t,e,r,n){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[r]=n,t}function L(t,e,r,n){var i,a=e.axesProject,o=e.gl,l=t.uniforms,c=r.model||f,u=r.view||f,h=r.projection||f,d=e.axesBounds,m=function(t){for(var e=A,r=0;r<2;++r)for(var n=0;n<3;++n)e[r][n]=Math.max(Math.min(t[r][n],1e8),-1e8);return e}(e.clipBounds);i=e.axes&&e.axes.lastCubeProps?e.axes.lastCubeProps.axis:[1,1,1],y[0]=2/o.drawingBufferWidth,y[1]=2/o.drawingBufferHeight,t.bind(),l.view=u,l.projection=h,l.screenSize=y,l.highlightId=e.highlightId,l.highlightScale=e.highlightScale,l.clipBounds=m,l.pickGroup=e.pickId/255,l.pixelRatio=n;for(var g=0;g<3;++g)if(a[g]){l.scale=e.projectScale[g],l.opacity=e.projectOpacity[g];for(var v=T,L=0;L<16;++L)v[L]=0;for(L=0;L<4;++L)v[5*L]=1;v[5*g]=0,i[g]<0?v[12+g]=d[0][g]:v[12+g]=d[1][g],s(v,c,v),l.model=v;var C=(g+1)%3,P=(g+2)%3,I=M(x),O=M(b);I[C]=1,O[P]=1;var z=p(0,0,0,S(_,I)),D=p(0,0,0,S(w,O));if(Math.abs(z[1])>Math.abs(D[1])){var R=z;z=D,D=R,R=I,I=O,O=R;var F=C;C=P,P=F}z[0]<0&&(I[C]=-1),D[1]>0&&(O[P]=-1);var B=0,N=0;for(L=0;L<4;++L)B+=Math.pow(c[4*C+L],2),N+=Math.pow(c[4*P+L],2);I[C]/=Math.sqrt(B),O[P]/=Math.sqrt(N),l.axes[0]=I,l.axes[1]=O,l.fragClipBounds[0]=E(k,m[0],g,-1e8),l.fragClipBounds[1]=E(k,m[1],g,1e8),e.vao.bind(),e.vao.draw(o.TRIANGLES,e.vertexCount),e.lineWidth>0&&(o.lineWidth(e.lineWidth*n),e.vao.draw(o.LINES,e.lineVertexCount,e.vertexCount)),e.vao.unbind()}}var C=[[-1e8,-1e8,-1e8],[1e8,1e8,1e8]];function P(t,e,r,n,i,a,o){var s=r.gl;if((a===r.projectHasAlpha||o)&&L(e,r,n,i),a===r.hasAlpha||o){t.bind();var l=t.uniforms;l.model=n.model||f,l.view=n.view||f,l.projection=n.projection||f,y[0]=2/s.drawingBufferWidth,y[1]=2/s.drawingBufferHeight,l.screenSize=y,l.highlightId=r.highlightId,l.highlightScale=r.highlightScale,l.fragClipBounds=C,l.clipBounds=r.axes.bounds,l.opacity=r.opacity,l.pickGroup=r.pickId/255,l.pixelRatio=i,r.vao.bind(),r.vao.draw(s.TRIANGLES,r.vertexCount),r.lineWidth>0&&(s.lineWidth(r.lineWidth*i),r.vao.draw(s.LINES,r.lineVertexCount,r.vertexCount)),r.vao.unbind()}}function I(t,e,r,i){var a;a=Array.isArray(t)?e=this.pointCount||e<0)return null;var r=this.points[e],n=this._selectResult;n.index=e;for(var i=0;i<3;++i)n.position[i]=n.dataCoordinate[i]=r[i];return n},v.highlight=function(t){if(t){var e=t.index,r=255&e,n=e>>8&255,i=e>>16&255;this.highlightId=[r/255,n/255,i/255,0]}else this.highlightId=[1,1,1,1]},v.update=function(t){if("perspective"in(t=t||{})&&(this.useOrtho=!t.perspective),"orthographic"in t&&(this.useOrtho=!!t.orthographic),"lineWidth"in t&&(this.lineWidth=t.lineWidth),"project"in t)if(Array.isArray(t.project))this.axesProject=t.project;else{var e=!!t.project;this.axesProject=[e,e,e]}if("projectScale"in t)if(Array.isArray(t.projectScale))this.projectScale=t.projectScale.slice();else{var r=+t.projectScale;this.projectScale=[r,r,r]}if(this.projectHasAlpha=!1,"projectOpacity"in t){if(Array.isArray(t.projectOpacity))this.projectOpacity=t.projectOpacity.slice();else{r=+t.projectOpacity;this.projectOpacity=[r,r,r]}for(var n=0;n<3;++n)this.projectOpacity[n]=m(this.projectOpacity[n]),this.projectOpacity[n]<1&&(this.projectHasAlpha=!0)}this.hasAlpha=!1,"opacity"in t&&(this.opacity=m(t.opacity),this.opacity<1&&(this.hasAlpha=!0)),this.dirty=!0;var i,a,s=t.position,l=t.font||"normal",c=t.alignment||[0,0];if(2===c.length)i=c[0],a=c[1];else{i=[],a=[];for(n=0;n0){var O=0,z=x,D=[0,0,0,1],R=[0,0,0,1],F=Array.isArray(p)&&Array.isArray(p[0]),B=Array.isArray(v)&&Array.isArray(v[0]);t:for(n=0;n<_;++n){y+=1;for(w=s[n],T=0;T<3;++T){if(isNaN(w[T])||!isFinite(w[T]))continue t;f[T]=Math.max(f[T],w[T]),u[T]=Math.min(u[T],w[T])}k=(N=I(h,n,l,this.pixelRatio)).mesh,A=N.lines,M=N.bounds;var N,j=N.visible;if(j)if(Array.isArray(p)){if(3===(U=F?n0?1-M[0][0]:Y<0?1+M[1][0]:1,W*=W>0?1-M[0][1]:W<0?1+M[1][1]:1],Z=k.cells||[],J=k.positions||[];for(T=0;T0){var v=r*u;o.drawBox(f-v,h-v,p+v,h+v,a),o.drawBox(f-v,d-v,p+v,d+v,a),o.drawBox(f-v,h-v,f+v,d+v,a),o.drawBox(p-v,h-v,p+v,d+v,a)}}}},s.update=function(t){t=t||{},this.innerFill=!!t.innerFill,this.outerFill=!!t.outerFill,this.innerColor=(t.innerColor||[0,0,0,.5]).slice(),this.outerColor=(t.outerColor||[0,0,0,.5]).slice(),this.borderColor=(t.borderColor||[0,0,0,1]).slice(),this.borderWidth=t.borderWidth||0,this.selectBox=(t.selectBox||this.selectBox).slice()},s.dispose=function(){this.boxBuffer.dispose(),this.boxShader.dispose(),this.plot.removeOverlay(this)}},{"./lib/shaders":129,"gl-buffer":78,"gl-shader":132}],131:[function(t,e,r){"use strict";e.exports=function(t,e){var r=e[0],a=e[1],o=n(t,r,a,{}),s=i.mallocUint8(r*a*4);return new l(t,o,s)};var n=t("gl-fbo"),i=t("typedarray-pool"),a=t("ndarray"),o=t("bit-twiddle").nextPow2;function s(t,e,r,n,i){this.coord=[t,e],this.id=r,this.value=n,this.distance=i}function l(t,e,r){this.gl=t,this.fbo=e,this.buffer=r,this._readTimeout=null;var n=this;this._readCallback=function(){n.gl&&(e.bind(),t.readPixels(0,0,e.shape[0],e.shape[1],t.RGBA,t.UNSIGNED_BYTE,n.buffer),n._readTimeout=null)}}var c=l.prototype;Object.defineProperty(c,"shape",{get:function(){return this.gl?this.fbo.shape.slice():[0,0]},set:function(t){if(this.gl){this.fbo.shape=t;var e=this.fbo.shape[0],r=this.fbo.shape[1];if(r*e*4>this.buffer.length){i.free(this.buffer);for(var n=this.buffer=i.mallocUint8(o(r*e*4)),a=0;ar)for(t=r;te)for(t=e;t=0){for(var T=0|w.type.charAt(w.type.length-1),k=new Array(T),A=0;A=0;)M+=1;_[y]=M}var S=new Array(r.length);function E(){h.program=o.program(p,h._vref,h._fref,b,_);for(var t=0;t=0){if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);s(t,e,p[0],i,d,a,f)}else{if(!(h.indexOf("mat")>=0))throw new n("","Unknown data type for attribute "+f+": "+h);var d;if((d=h.charCodeAt(h.length-1)-48)<2||d>4)throw new n("","Invalid data type for attribute "+f+": "+h);l(t,e,p,i,d,a,f)}}}return a};var n=t("./GLError");function i(t,e,r,n,i,a){this._gl=t,this._wrapper=e,this._index=r,this._locations=n,this._dimension=i,this._constFunc=a}var a=i.prototype;a.pointer=function(t,e,r,n){var i=this._gl,a=this._locations[this._index];i.vertexAttribPointer(a,this._dimension,t||i.FLOAT,!!e,r||0,n||0),i.enableVertexAttribArray(a)},a.set=function(t,e,r,n){return this._constFunc(this._locations[this._index],t,e,r,n)},Object.defineProperty(a,"location",{get:function(){return this._locations[this._index]},set:function(t){return t!==this._locations[this._index]&&(this._locations[this._index]=0|t,this._wrapper.program=null),0|t}});var o=[function(t,e,r){return void 0===r.length?t.vertexAttrib1f(e,r):t.vertexAttrib1fv(e,r)},function(t,e,r,n){return void 0===r.length?t.vertexAttrib2f(e,r,n):t.vertexAttrib2fv(e,r)},function(t,e,r,n,i){return void 0===r.length?t.vertexAttrib3f(e,r,n,i):t.vertexAttrib3fv(e,r)},function(t,e,r,n,i,a){return void 0===r.length?t.vertexAttrib4f(e,r,n,i,a):t.vertexAttrib4fv(e,r)}];function s(t,e,r,n,a,s,l){var c=o[a],u=new i(t,e,r,n,a,c);Object.defineProperty(s,l,{set:function(e){return t.disableVertexAttribArray(n[r]),c(t,n[r],e),e},get:function(){return u},enumerable:!0})}function l(t,e,r,n,i,a,o){for(var l=new Array(i),c=new Array(i),u=0;u4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+v);t["uniformMatrix"+g+"fv"](s[u],!1,f);break}throw new i("","Unknown uniform data type for "+name+": "+v)}if((g=v.charCodeAt(v.length-1)-48)<2||g>4)throw new i("","Invalid data type");switch(v.charAt(0)){case"b":case"i":t["uniform"+g+"iv"](s[u],f);break;case"v":t["uniform"+g+"fv"](s[u],f);break;default:throw new i("","Unrecognized data type for vector "+name+": "+v)}}}}}}function c(t,e,n){if("object"==typeof n){var c=u(n);Object.defineProperty(t,e,{get:a(c),set:l(n),enumerable:!0,configurable:!1})}else s[n]?Object.defineProperty(t,e,{get:(f=n,function(t,e,r){return t.getUniform(e.program,r[f])}),set:l(n),enumerable:!0,configurable:!1}):t[e]=function(t){switch(t){case"bool":return!1;case"int":case"sampler2D":case"samplerCube":case"float":return 0;default:var e=t.indexOf("vec");if(0<=e&&e<=1&&t.length===4+e){if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid data type");return"b"===t.charAt(0)?o(r,!1):o(r,0)}if(0===t.indexOf("mat")&&4===t.length){var r;if((r=t.charCodeAt(t.length-1)-48)<2||r>4)throw new i("","Invalid uniform dimension type for matrix "+name+": "+t);return o(r*r,0)}throw new i("","Unknown uniform data type for "+name+": "+t)}}(r[n].type);var f}function u(t){var e;if(Array.isArray(t)){e=new Array(t.length);for(var r=0;r1){s[0]in a||(a[s[0]]=[]),a=a[s[0]];for(var l=1;l1)for(var l=0;l 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 color, position;\nattribute vec2 uv;\n\nuniform float vectorScale, tubeScale;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 eyePosition, lightPosition;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n // Scale the vector magnitude to stay constant with\n // model & view changes.\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * tubePosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n f_lightDirection = lightPosition - cameraCoordinate.xyz;\n f_eyeDirection = eyePosition - cameraCoordinate.xyz;\n f_normal = normalize((vec4(normal, 0.0) * inverseModel).xyz);\n\n // vec4 m_position = model * vec4(tubePosition, 1.0);\n vec4 t_position = view * tubePosition;\n gl_Position = projection * t_position;\n\n f_color = color;\n f_data = tubePosition.xyz;\n f_position = position.xyz;\n f_uv = uv;\n}\n"]),a=n(["#extension GL_OES_standard_derivatives : enable\n\nprecision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat cookTorranceSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness,\n float fresnel) {\n\n float VdotN = max(dot(viewDirection, surfaceNormal), 0.0);\n float LdotN = max(dot(lightDirection, surfaceNormal), 0.0);\n\n //Half angle vector\n vec3 H = normalize(lightDirection + viewDirection);\n\n //Geometric term\n float NdotH = max(dot(surfaceNormal, H), 0.0);\n float VdotH = max(dot(viewDirection, H), 0.000001);\n float LdotH = max(dot(lightDirection, H), 0.000001);\n float G1 = (2.0 * NdotH * VdotN) / VdotH;\n float G2 = (2.0 * NdotH * LdotN) / LdotH;\n float G = min(1.0, min(G1, G2));\n \n //Distribution term\n float D = beckmannDistribution(NdotH, roughness);\n\n //Fresnel term\n float F = pow(1.0 - VdotN, fresnel);\n\n //Multiply terms and done\n return G * F * D / max(3.14159265 * VdotN, 0.000001);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform sampler2D texture;\n\nvarying vec3 f_normal, f_lightDirection, f_eyeDirection, f_data, f_position;\nvarying vec4 f_color;\nvarying vec2 f_uv;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n vec3 N = normalize(f_normal);\n vec3 L = normalize(f_lightDirection);\n vec3 V = normalize(f_eyeDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = min(1.0, max(0.0, cookTorranceSpecular(L, V, N, roughness, fresnel)));\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n vec4 surfaceColor = f_color * texture2D(texture, f_uv);\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = litColor * opacity;\n}\n"]),o=n(["precision highp float;\n\nprecision highp float;\n#define GLSLIFY 1\n\nvec3 getOrthogonalVector(vec3 v) {\n // Return up-vector for only-z vector.\n // Return ax + by + cz = 0, a point that lies on the plane that has v as a normal and that isn't (0,0,0).\n // From the above if-statement we have ||a|| > 0 U ||b|| > 0.\n // Assign z = 0, x = -b, y = a:\n // a*-b + b*a + c*0 = -ba + ba + 0 = 0\n if (v.x*v.x > v.z*v.z || v.y*v.y > v.z*v.z) {\n return normalize(vec3(-v.y, v.x, 0.0));\n } else {\n return normalize(vec3(0.0, v.z, -v.y));\n }\n}\n\n// Calculate the tube vertex and normal at the given index.\n//\n// The returned vertex is for a tube ring with its center at origin, radius of length(d), pointing in the direction of d.\n//\n// Each tube segment is made up of a ring of vertices.\n// These vertices are used to make up the triangles of the tube by connecting them together in the vertex array.\n// The indexes of tube segments run from 0 to 8.\n//\nvec3 getTubePosition(vec3 d, float index, out vec3 normal) {\n float segmentCount = 8.0;\n\n float angle = 2.0 * 3.14159 * (index / segmentCount);\n\n vec3 u = getOrthogonalVector(d);\n vec3 v = normalize(cross(u, d));\n\n vec3 x = u * cos(angle) * length(d);\n vec3 y = v * sin(angle) * length(d);\n vec3 v3 = x + y;\n\n normal = normalize(v3);\n\n return v3;\n}\n\nattribute vec4 vector;\nattribute vec4 position;\nattribute vec4 id;\n\nuniform mat4 model, view, projection;\nuniform float tubeScale;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n vec3 normal;\n vec3 XYZ = getTubePosition(mat3(model) * (tubeScale * vector.w * normalize(vector.xyz)), position.w, normal);\n vec4 tubePosition = model * vec4(position.xyz, 1.0) + vec4(XYZ, 0.0);\n\n gl_Position = projection * view * tubePosition;\n f_id = id;\n f_position = position.xyz;\n}\n"]),s=n(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying vec3 f_position;\nvarying vec4 f_id;\n\nvoid main() {\n if (outOfRange(clipBounds[0], clipBounds[1], f_position)) discard;\n\n gl_FragColor = vec4(pickId, f_id.xyz);\n}"]);r.meshShader={vertex:i,fragment:a,attributes:[{name:"position",type:"vec4"},{name:"color",type:"vec4"},{name:"uv",type:"vec2"},{name:"vector",type:"vec4"}]},r.pickShader={vertex:o,fragment:s,attributes:[{name:"position",type:"vec4"},{name:"id",type:"vec4"},{name:"vector",type:"vec4"}]}},{glslify:231}],143:[function(t,e,r){"use strict";var n=t("gl-vec3"),i=t("gl-vec4"),a=["xyz","xzy","yxz","yzx","zxy","zyx"],o=function(t,e,r,a){for(var o=0,s=0;s0)for(T=0;T<8;T++){var k=(T+1)%8;c.push(h[T],p[T],p[k],p[k],h[k],h[T]),f.push(y,v,v,v,y,y),d.push(m,g,g,g,m,m);var A=c.length;u.push([A-6,A-5,A-4],[A-3,A-2,A-1])}var M=h;h=p,p=M;var S=y;y=v,v=S;var E=m;m=g,g=E}return{positions:c,cells:u,vectors:f,vertexIntensity:d}}(t,r,a,o)})),f=[],h=[],p=[],d=[];for(s=0;se)return r-1}return r},l=function(t,e,r){return tr?r:t},c=function(t){var e=1/0;t.sort((function(t,e){return t-e}));for(var r=t.length,n=1;nf-1||y>h-1||x>p-1)return n.create();var b,_,w,T,k,A,M=a[0][d],S=a[0][v],E=a[1][m],L=a[1][y],C=a[2][g],P=(o-M)/(S-M),I=(c-E)/(L-E),O=(u-C)/(a[2][x]-C);switch(isFinite(P)||(P=.5),isFinite(I)||(I=.5),isFinite(O)||(O=.5),r.reversedX&&(d=f-1-d,v=f-1-v),r.reversedY&&(m=h-1-m,y=h-1-y),r.reversedZ&&(g=p-1-g,x=p-1-x),r.filled){case 5:k=g,A=x,w=m*p,T=y*p,b=d*p*h,_=v*p*h;break;case 4:k=g,A=x,b=d*p,_=v*p,w=m*p*f,T=y*p*f;break;case 3:w=m,T=y,k=g*h,A=x*h,b=d*h*p,_=v*h*p;break;case 2:w=m,T=y,b=d*h,_=v*h,k=g*h*f,A=x*h*f;break;case 1:b=d,_=v,k=g*f,A=x*f,w=m*f*p,T=y*f*p;break;default:b=d,_=v,w=m*f,T=y*f,k=g*f*h,A=x*f*h}var z=i[b+w+k],D=i[b+w+A],R=i[b+T+k],F=i[b+T+A],B=i[_+w+k],N=i[_+w+A],j=i[_+T+k],U=i[_+T+A],V=n.create(),H=n.create(),q=n.create(),G=n.create();n.lerp(V,z,B,P),n.lerp(H,D,N,P),n.lerp(q,R,j,P),n.lerp(G,F,U,P);var Y=n.create(),W=n.create();n.lerp(Y,V,q,I),n.lerp(W,H,G,I);var X=n.create();return n.lerp(X,Y,W,O),X}(e,t,p)},m=t.getDivergence||function(t,e){var r=n.create(),i=1e-4;n.add(r,t,[i,0,0]);var a=d(r);n.subtract(a,a,e),n.scale(a,a,1/i),n.add(r,t,[0,i,0]);var o=d(r);n.subtract(o,o,e),n.scale(o,o,1/i),n.add(r,t,[0,0,i]);var s=d(r);return n.subtract(s,s,e),n.scale(s,s,1/i),n.add(r,a,o),n.add(r,r,s),r},g=[],v=e[0][0],y=e[0][1],x=e[0][2],b=e[1][0],_=e[1][1],w=e[1][2],T=function(t){var e=t[0],r=t[1],n=t[2];return!(eb||r_||nw)},k=10*n.distance(e[0],e[1])/i,A=k*k,M=1,S=0,E=r.length;E>1&&(M=function(t){for(var e=[],r=[],n=[],i={},a={},o={},s=t.length,l=0;lS&&(S=F),D.push(F),g.push({points:P,velocities:I,divergences:D});for(var B=0;B<100*i&&P.lengthA&&n.scale(N,N,k/Math.sqrt(j)),n.add(N,N,C),O=d(N),n.squaredDistance(z,N)-A>-1e-4*A){P.push(N),z=N,I.push(O);R=m(N,O),F=n.length(R);isFinite(F)&&F>S&&(S=F),D.push(F)}C=N}}var U=o(g,t.colormap,S,M);return f?U.tubeScale=f:(0===S&&(S=1),U.tubeScale=.5*u*M/S),U};var u=t("./lib/shaders"),f=t("gl-cone3d").createMesh;e.exports.createTubeMesh=function(t,e){return f(t,e,{shaders:u,traceType:"streamtube"})}},{"./lib/shaders":142,"gl-cone3d":79,"gl-vec3":169,"gl-vec4":205}],144:[function(t,e,r){var n=t("gl-shader"),i=t("glslify"),a=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute vec3 f;\nattribute vec3 normal;\n\nuniform vec3 objectOffset;\nuniform mat4 model, view, projection, inverseModel;\nuniform vec3 lightPosition, eyePosition;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 localCoordinate = vec3(uv.zw, f.x);\n worldCoordinate = objectOffset + localCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n vec4 clipPosition = projection * view * worldPosition;\n gl_Position = clipPosition;\n kill = f.y;\n value = f.z;\n planeCoordinate = uv.xy;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Lighting geometry parameters\n vec4 cameraCoordinate = view * worldPosition;\n cameraCoordinate.xyz /= cameraCoordinate.w;\n lightDirection = lightPosition - cameraCoordinate.xyz;\n eyeDirection = eyePosition - cameraCoordinate.xyz;\n surfaceNormal = normalize((vec4(normal,0) * inverseModel).xyz);\n}\n"]),o=i(["precision highp float;\n#define GLSLIFY 1\n\nfloat beckmannDistribution(float x, float roughness) {\n float NdotH = max(x, 0.0001);\n float cos2Alpha = NdotH * NdotH;\n float tan2Alpha = (cos2Alpha - 1.0) / cos2Alpha;\n float roughness2 = roughness * roughness;\n float denom = 3.141592653589793 * roughness2 * cos2Alpha * cos2Alpha;\n return exp(tan2Alpha / roughness2) / denom;\n}\n\nfloat beckmannSpecular(\n vec3 lightDirection,\n vec3 viewDirection,\n vec3 surfaceNormal,\n float roughness) {\n return beckmannDistribution(dot(surfaceNormal, normalize(lightDirection + viewDirection)), roughness);\n}\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec3 lowerBound, upperBound;\nuniform float contourTint;\nuniform vec4 contourColor;\nuniform sampler2D colormap;\nuniform vec3 clipBounds[2];\nuniform float roughness, fresnel, kambient, kdiffuse, kspecular, opacity;\nuniform float vertexColor;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n if (\n kill > 0.0 ||\n vColor.a == 0.0 ||\n outOfRange(clipBounds[0], clipBounds[1], worldCoordinate)\n ) discard;\n\n vec3 N = normalize(surfaceNormal);\n vec3 V = normalize(eyeDirection);\n vec3 L = normalize(lightDirection);\n\n if(gl_FrontFacing) {\n N = -N;\n }\n\n float specular = max(beckmannSpecular(L, V, N, roughness), 0.);\n float diffuse = min(kambient + kdiffuse * max(dot(N, L), 0.0), 1.0);\n\n //decide how to interpolate color \u2014 in vertex or in fragment\n vec4 surfaceColor =\n step(vertexColor, .5) * texture2D(colormap, vec2(value, value)) +\n step(.5, vertexColor) * vColor;\n\n vec4 litColor = surfaceColor.a * vec4(diffuse * surfaceColor.rgb + kspecular * vec3(1,1,1) * specular, 1.0);\n\n gl_FragColor = mix(litColor, contourColor, contourTint) * opacity;\n}\n"]),s=i(["precision highp float;\n#define GLSLIFY 1\n\nattribute vec4 uv;\nattribute float f;\n\nuniform vec3 objectOffset;\nuniform mat3 permutation;\nuniform mat4 model, view, projection;\nuniform float height, zOffset;\nuniform sampler2D colormap;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 lightDirection, eyeDirection, surfaceNormal;\nvarying vec4 vColor;\n\nvoid main() {\n vec3 dataCoordinate = permutation * vec3(uv.xy, height);\n worldCoordinate = objectOffset + dataCoordinate;\n vec4 worldPosition = model * vec4(worldCoordinate, 1.0);\n\n vec4 clipPosition = projection * view * worldPosition;\n clipPosition.z += zOffset;\n\n gl_Position = clipPosition;\n value = f + objectOffset.z;\n kill = -1.0;\n planeCoordinate = uv.zw;\n\n vColor = texture2D(colormap, vec2(value, value));\n\n //Don't do lighting for contours\n surfaceNormal = vec3(1,0,0);\n eyeDirection = vec3(0,1,0);\n lightDirection = vec3(0,0,1);\n}\n"]),l=i(["precision highp float;\n#define GLSLIFY 1\n\nbool outOfRange(float a, float b, float p) {\n return ((p > max(a, b)) || \n (p < min(a, b)));\n}\n\nbool outOfRange(vec2 a, vec2 b, vec2 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y));\n}\n\nbool outOfRange(vec3 a, vec3 b, vec3 p) {\n return (outOfRange(a.x, b.x, p.x) ||\n outOfRange(a.y, b.y, p.y) ||\n outOfRange(a.z, b.z, p.z));\n}\n\nbool outOfRange(vec4 a, vec4 b, vec4 p) {\n return outOfRange(a.xyz, b.xyz, p.xyz);\n}\n\nuniform vec2 shape;\nuniform vec3 clipBounds[2];\nuniform float pickId;\n\nvarying float value, kill;\nvarying vec3 worldCoordinate;\nvarying vec2 planeCoordinate;\nvarying vec3 surfaceNormal;\n\nvec2 splitFloat(float v) {\n float vh = 255.0 * v;\n float upper = floor(vh);\n float lower = fract(vh);\n return vec2(upper / 255.0, floor(lower * 16.0) / 16.0);\n}\n\nvoid main() {\n if ((kill > 0.0) ||\n (outOfRange(clipBounds[0], clipBounds[1], worldCoordinate))) discard;\n\n vec2 ux = splitFloat(planeCoordinate.x / shape.x);\n vec2 uy = splitFloat(planeCoordinate.y / shape.y);\n gl_FragColor = vec4(pickId, ux.x, uy.x, ux.y + (uy.y/16.0));\n}\n"]);r.createShader=function(t){var e=n(t,a,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createPickShader=function(t){var e=n(t,a,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"vec3"},{name:"normal",type:"vec3"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e.attributes.normal.location=2,e},r.createContourShader=function(t){var e=n(t,s,o,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e},r.createPickContourShader=function(t){var e=n(t,s,l,null,[{name:"uv",type:"vec4"},{name:"f",type:"float"}]);return e.attributes.uv.location=0,e.attributes.f.location=1,e}},{"gl-shader":132,glslify:231}],145:[function(t,e,r){"use strict";e.exports=function(t){var e=t.gl,r=y(e),n=b(e),s=x(e),l=_(e),c=i(e),u=a(e,[{buffer:c,size:4,stride:40,offset:0},{buffer:c,size:3,stride:40,offset:16},{buffer:c,size:3,stride:40,offset:28}]),f=i(e),h=a(e,[{buffer:f,size:4,stride:20,offset:0},{buffer:f,size:1,stride:20,offset:16}]),p=i(e),d=a(e,[{buffer:p,size:2,type:e.FLOAT}]),m=o(e,1,256,e.RGBA,e.UNSIGNED_BYTE);m.minFilter=e.LINEAR,m.magFilter=e.LINEAR;var g=new M(e,[0,0],[[0,0,0],[0,0,0]],r,n,c,u,m,s,l,f,h,p,d,[0,0,0]),v={levels:[[],[],[]]};for(var w in t)v[w]=t[w];return v.colormap=v.colormap||"jet",g.update(v),g};var n=t("bit-twiddle"),i=t("gl-buffer"),a=t("gl-vao"),o=t("gl-texture2d"),s=t("typedarray-pool"),l=t("colormap"),c=t("ndarray-ops"),u=t("ndarray-pack"),f=t("ndarray"),h=t("surface-nets"),p=t("gl-mat4/multiply"),d=t("gl-mat4/invert"),m=t("binary-search-bounds"),g=t("ndarray-gradient"),v=t("./lib/shaders"),y=v.createShader,x=v.createContourShader,b=v.createPickShader,_=v.createPickContourShader,w=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],T=[[0,0],[0,1],[1,0],[1,1],[1,0],[0,1]],k=[[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0],[0,0,0,0,0,0,0,0,0]];function A(t,e,r,n,i){this.position=t,this.index=e,this.uv=r,this.level=n,this.dataCoordinate=i}!function(){for(var t=0;t<3;++t){var e=k[t],r=(t+2)%3;e[(t+1)%3+0]=1,e[r+3]=1,e[t+6]=1}}();function M(t,e,r,n,i,a,o,l,c,u,h,p,d,m,g){this.gl=t,this.shape=e,this.bounds=r,this.objectOffset=g,this.intensityBounds=[],this._shader=n,this._pickShader=i,this._coordinateBuffer=a,this._vao=o,this._colorMap=l,this._contourShader=c,this._contourPickShader=u,this._contourBuffer=h,this._contourVAO=p,this._contourOffsets=[[],[],[]],this._contourCounts=[[],[],[]],this._vertexCount=0,this._pickResult=new A([0,0,0],[0,0],[0,0],[0,0,0],[0,0,0]),this._dynamicBuffer=d,this._dynamicVAO=m,this._dynamicOffsets=[0,0,0],this._dynamicCounts=[0,0,0],this.contourWidth=[1,1,1],this.contourLevels=[[1],[1],[1]],this.contourTint=[0,0,0],this.contourColor=[[.5,.5,.5,1],[.5,.5,.5,1],[.5,.5,.5,1]],this.showContour=!0,this.showSurface=!0,this.enableHighlight=[!0,!0,!0],this.highlightColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.highlightTint=[1,1,1],this.highlightLevel=[-1,-1,-1],this.enableDynamic=[!0,!0,!0],this.dynamicLevel=[NaN,NaN,NaN],this.dynamicColor=[[0,0,0,1],[0,0,0,1],[0,0,0,1]],this.dynamicTint=[1,1,1],this.dynamicWidth=[1,1,1],this.axesBounds=[[1/0,1/0,1/0],[-1/0,-1/0,-1/0]],this.surfaceProject=[!1,!1,!1],this.contourProject=[[!1,!1,!1],[!1,!1,!1],[!1,!1,!1]],this.colorBounds=[!1,!1],this._field=[f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0]),f(s.mallocFloat(1024),[0,0])],this.pickId=1,this.clipBounds=[[-1/0,-1/0,-1/0],[1/0,1/0,1/0]],this.snapToData=!1,this.pixelRatio=1,this.opacity=1,this.lightPosition=[10,1e4,0],this.ambientLight=.8,this.diffuseLight=.8,this.specularLight=2,this.roughness=.5,this.fresnel=1.5,this.vertexColor=0,this.dirty=!0}var S=M.prototype;S.genColormap=function(t,e){var r=!1,n=u([l({colormap:t,nshades:256,format:"rgba"}).map((function(t,n){var i=e?function(t,e){if(!e)return 1;if(!e.length)return 1;for(var r=0;rt&&r>0){var n=(e[r][0]-t)/(e[r][0]-e[r-1][0]);return e[r][1]*(1-n)+n*e[r-1][1]}}return 1}(n/255,e):t[3];return i<1&&(r=!0),[t[0],t[1],t[2],255*i]}))]);return c.divseq(n,255),this.hasAlphaScale=r,n},S.isTransparent=function(){return this.opacity<1||this.hasAlphaScale},S.isOpaque=function(){return!this.isTransparent()},S.pickSlots=1,S.setPickBase=function(t){this.pickId=t};var E=[0,0,0],L={showSurface:!1,showContour:!1,projections:[w.slice(),w.slice(),w.slice()],clipBounds:[[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]],[[0,0,0],[0,0,0]]]};function C(t,e){var r,n,i,a=e.axes&&e.axes.lastCubeProps.axis||E,o=e.showSurface,s=e.showContour;for(r=0;r<3;++r)for(o=o||e.surfaceProject[r],n=0;n<3;++n)s=s||e.contourProject[r][n];for(r=0;r<3;++r){var l=L.projections[r];for(n=0;n<16;++n)l[n]=0;for(n=0;n<4;++n)l[5*n]=1;l[5*r]=0,l[12+r]=e.axesBounds[+(a[r]>0)][r],p(l,t.model,l);var c=L.clipBounds[r];for(i=0;i<2;++i)for(n=0;n<3;++n)c[i][n]=t.clipBounds[i][n];c[0][r]=-1e8,c[1][r]=1e8}return L.showSurface=o,L.showContour=s,L}var P={model:w,view:w,projection:w,inverseModel:w.slice(),lowerBound:[0,0,0],upperBound:[0,0,0],colorMap:0,clipBounds:[[0,0,0],[0,0,0]],height:0,contourTint:0,contourColor:[0,0,0,1],permutation:[1,0,0,0,1,0,0,0,1],zOffset:-1e-4,objectOffset:[0,0,0],kambient:1,kdiffuse:1,kspecular:1,lightPosition:[1e3,1e3,1e3],eyePosition:[0,0,0],roughness:1,fresnel:1,opacity:1,vertexColor:0},I=w.slice(),O=[1,0,0,0,1,0,0,0,1];function z(t,e){t=t||{};var r=this.gl;r.disable(r.CULL_FACE),this._colorMap.bind(0);var n=P;n.model=t.model||w,n.view=t.view||w,n.projection=t.projection||w,n.lowerBound=[this.bounds[0][0],this.bounds[0][1],this.colorBounds[0]||this.bounds[0][2]],n.upperBound=[this.bounds[1][0],this.bounds[1][1],this.colorBounds[1]||this.bounds[1][2]],n.objectOffset=this.objectOffset,n.contourColor=this.contourColor[0],n.inverseModel=d(n.inverseModel,n.model);for(var i=0;i<2;++i)for(var a=n.clipBounds[i],o=0;o<3;++o)a[o]=Math.min(Math.max(this.clipBounds[i][o],-1e8),1e8);n.kambient=this.ambientLight,n.kdiffuse=this.diffuseLight,n.kspecular=this.specularLight,n.roughness=this.roughness,n.fresnel=this.fresnel,n.opacity=this.opacity,n.height=0,n.permutation=O,n.vertexColor=this.vertexColor;var s=I;for(p(s,n.view,n.model),p(s,n.projection,s),d(s,s),i=0;i<3;++i)n.eyePosition[i]=s[12+i]/s[15];var l=s[15];for(i=0;i<3;++i)l+=this.lightPosition[i]*s[4*i+3];for(i=0;i<3;++i){var c=s[12+i];for(o=0;o<3;++o)c+=s[4*o+i]*this.lightPosition[o];n.lightPosition[i]=c/l}var u=C(n,this);if(u.showSurface){for(this._shader.bind(),this._shader.uniforms=n,this._vao.bind(),this.showSurface&&this._vertexCount&&this._vao.draw(r.TRIANGLES,this._vertexCount),i=0;i<3;++i)this.surfaceProject[i]&&this.vertexCount&&(this._shader.uniforms.model=u.projections[i],this._shader.uniforms.clipBounds=u.clipBounds[i],this._vao.draw(r.TRIANGLES,this._vertexCount));this._vao.unbind()}if(u.showContour){var f=this._contourShader;n.kambient=1,n.kdiffuse=0,n.kspecular=0,n.opacity=1,f.bind(),f.uniforms=n;var h=this._contourVAO;for(h.bind(),i=0;i<3;++i)for(f.uniforms.permutation=k[i],r.lineWidth(this.contourWidth[i]*this.pixelRatio),o=0;o>4)/16)/255,i=Math.floor(n),a=n-i,o=e[1]*(t.value[1]+(15&t.value[2])/16)/255,s=Math.floor(o),l=o-s;i+=1,s+=1;var c=r.position;c[0]=c[1]=c[2]=0;for(var u=0;u<2;++u)for(var f=u?a:1-a,h=0;h<2;++h)for(var p=i+u,d=s+h,g=f*(h?l:1-l),v=0;v<3;++v)c[v]+=this._field[v].get(p,d)*g;for(var y=this._pickResult.level,x=0;x<3;++x)if(y[x]=m.le(this.contourLevels[x],c[x]),y[x]<0)this.contourLevels[x].length>0&&(y[x]=0);else if(y[x]Math.abs(_-c[x])&&(y[x]+=1)}for(r.index[0]=a<.5?i:i+1,r.index[1]=l<.5?s:s+1,r.uv[0]=n/e[0],r.uv[1]=o/e[1],v=0;v<3;++v)r.dataCoordinate[v]=this._field[v].get(r.index[0],r.index[1]);return r},S.padField=function(t,e){var r=e.shape.slice(),n=t.shape.slice();c.assign(t.lo(1,1).hi(r[0],r[1]),e),c.assign(t.lo(1).hi(r[0],1),e.hi(r[0],1)),c.assign(t.lo(1,n[1]-1).hi(r[0],1),e.lo(0,r[1]-1).hi(r[0],1)),c.assign(t.lo(0,1).hi(1,r[1]),e.hi(1)),c.assign(t.lo(n[0]-1,1).hi(1,r[1]),e.lo(r[0]-1)),t.set(0,0,e.get(0,0)),t.set(0,n[1]-1,e.get(0,r[1]-1)),t.set(n[0]-1,0,e.get(r[0]-1,0)),t.set(n[0]-1,n[1]-1,e.get(r[0]-1,r[1]-1))},S.update=function(t){t=t||{},this.objectOffset=t.objectOffset||this.objectOffset,this.dirty=!0,"contourWidth"in t&&(this.contourWidth=R(t.contourWidth,Number)),"showContour"in t&&(this.showContour=R(t.showContour,Boolean)),"showSurface"in t&&(this.showSurface=!!t.showSurface),"contourTint"in t&&(this.contourTint=R(t.contourTint,Boolean)),"contourColor"in t&&(this.contourColor=B(t.contourColor)),"contourProject"in t&&(this.contourProject=R(t.contourProject,(function(t){return R(t,Boolean)}))),"surfaceProject"in t&&(this.surfaceProject=t.surfaceProject),"dynamicColor"in t&&(this.dynamicColor=B(t.dynamicColor)),"dynamicTint"in t&&(this.dynamicTint=R(t.dynamicTint,Number)),"dynamicWidth"in t&&(this.dynamicWidth=R(t.dynamicWidth,Number)),"opacity"in t&&(this.opacity=t.opacity),"opacityscale"in t&&(this.opacityscale=t.opacityscale),"colorBounds"in t&&(this.colorBounds=t.colorBounds),"vertexColor"in t&&(this.vertexColor=t.vertexColor?1:0),"colormap"in t&&this._colorMap.setPixels(this.genColormap(t.colormap,this.opacityscale));var e=t.field||t.coords&&t.coords[2]||null,r=!1;if(e||(e=this._field[2].shape[0]||this._field[2].shape[2]?this._field[2].lo(1,1).hi(this._field[2].shape[0]-2,this._field[2].shape[1]-2):this._field[2].hi(0,0)),"field"in t||"coords"in t){var i=(e.shape[0]+2)*(e.shape[1]+2);i>this._field[2].data.length&&(s.freeFloat(this._field[2].data),this._field[2].data=s.mallocFloat(n.nextPow2(i))),this._field[2]=f(this._field[2].data,[e.shape[0]+2,e.shape[1]+2]),this.padField(this._field[2],e),this.shape=e.shape.slice();for(var a=this.shape,o=0;o<2;++o)this._field[2].size>this._field[o].data.length&&(s.freeFloat(this._field[o].data),this._field[o].data=s.mallocFloat(this._field[2].size)),this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2]);if(t.coords){var l=t.coords;if(!Array.isArray(l)||3!==l.length)throw new Error("gl-surface: invalid coordinates for x/y");for(o=0;o<2;++o){var c=l[o];for(v=0;v<2;++v)if(c.shape[v]!==a[v])throw new Error("gl-surface: coords have incorrect shape");this.padField(this._field[o],c)}}else if(t.ticks){var u=t.ticks;if(!Array.isArray(u)||2!==u.length)throw new Error("gl-surface: invalid ticks");for(o=0;o<2;++o){var p=u[o];if((Array.isArray(p)||p.length)&&(p=f(p)),p.shape[0]!==a[o])throw new Error("gl-surface: invalid tick length");var d=f(p.data,a);d.stride[o]=p.stride[0],d.stride[1^o]=0,this.padField(this._field[o],d)}}else{for(o=0;o<2;++o){var m=[0,0];m[o]=1,this._field[o]=f(this._field[o].data,[a[0]+2,a[1]+2],m,0)}this._field[0].set(0,0,0);for(var v=0;v0){for(var xt=0;xt<5;++xt)Q.pop();U-=1}continue t}Q.push(nt[0],nt[1],ot[0],ot[1],nt[2]),U+=1}}rt.push(U)}this._contourOffsets[$]=et,this._contourCounts[$]=rt}var bt=s.mallocFloat(Q.length);for(o=0;oi||r<0||r>i)throw new Error("gl-texture2d: Invalid texture size");return t._shape=[e,r],t.bind(),n.texImage2D(n.TEXTURE_2D,0,t.format,e,r,0,t.format,t.type,null),t._mipLevels=[0],t}function p(t,e,r,n,i,a){this.gl=t,this.handle=e,this.format=i,this.type=a,this._shape=[r,n],this._mipLevels=[0],this._magFilter=t.NEAREST,this._minFilter=t.NEAREST,this._wrapS=t.CLAMP_TO_EDGE,this._wrapT=t.CLAMP_TO_EDGE,this._anisoSamples=1;var o=this,s=[this._wrapS,this._wrapT];Object.defineProperties(s,[{get:function(){return o._wrapS},set:function(t){return o.wrapS=t}},{get:function(){return o._wrapT},set:function(t){return o.wrapT=t}}]),this._wrapVector=s;var l=[this._shape[0],this._shape[1]];Object.defineProperties(l,[{get:function(){return o._shape[0]},set:function(t){return o.width=t}},{get:function(){return o._shape[1]},set:function(t){return o.height=t}}]),this._shapeVector=l}var d=p.prototype;function m(t,e){return 3===t.length?1===e[2]&&e[1]===t[0]*t[2]&&e[0]===t[2]:1===e[0]&&e[1]===t[0]}function g(t){var e=t.createTexture();return t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.NEAREST),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),e}function v(t,e,r,n,i){var a=t.getParameter(t.MAX_TEXTURE_SIZE);if(e<0||e>a||r<0||r>a)throw new Error("gl-texture2d: Invalid texture shape");if(i===t.FLOAT&&!t.getExtension("OES_texture_float"))throw new Error("gl-texture2d: Floating point textures not supported on this platform");var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,n,e,r,0,n,i,null),new p(t,o,e,r,n,i)}function y(t,e,r,n,i,a){var o=g(t);return t.texImage2D(t.TEXTURE_2D,0,i,i,a,e),new p(t,o,r,n,i,a)}function x(t,e){var r=e.dtype,o=e.shape.slice(),s=t.getParameter(t.MAX_TEXTURE_SIZE);if(o[0]<0||o[0]>s||o[1]<0||o[1]>s)throw new Error("gl-texture2d: Invalid texture size");var l=m(o,e.stride.slice()),c=0;"float32"===r?c=t.FLOAT:"float64"===r?(c=t.FLOAT,l=!1,r="float32"):"uint8"===r?c=t.UNSIGNED_BYTE:(c=t.UNSIGNED_BYTE,l=!1,r="uint8");var u,h,d=0;if(2===o.length)d=t.LUMINANCE,o=[o[0],o[1],1],e=n(e.data,o,[e.stride[0],e.stride[1],1],e.offset);else{if(3!==o.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===o[2])d=t.ALPHA;else if(2===o[2])d=t.LUMINANCE_ALPHA;else if(3===o[2])d=t.RGB;else{if(4!==o[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");d=t.RGBA}}c!==t.FLOAT||t.getExtension("OES_texture_float")||(c=t.UNSIGNED_BYTE,l=!1);var v=e.size;if(l)u=0===e.offset&&e.data.length===v?e.data:e.data.subarray(e.offset,e.offset+v);else{var y=[o[2],o[2]*o[0],1];h=a.malloc(v,r);var x=n(h,o,y,0);"float32"!==r&&"float64"!==r||c!==t.UNSIGNED_BYTE?i.assign(x,e):f(x,e),u=h.subarray(0,v)}var b=g(t);return t.texImage2D(t.TEXTURE_2D,0,d,o[0],o[1],0,d,c,u),l||a.free(h),new p(t,b,o[0],o[1],d,c)}Object.defineProperties(d,{minFilter:{get:function(){return this._minFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,t),this._minFilter=t}},magFilter:{get:function(){return this._magFilter},set:function(t){this.bind();var e=this.gl;if(this.type===e.FLOAT&&o.indexOf(t)>=0&&(e.getExtension("OES_texture_float_linear")||(t=e.NEAREST)),s.indexOf(t)<0)throw new Error("gl-texture2d: Unknown filter mode "+t);return e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,t),this._magFilter=t}},mipSamples:{get:function(){return this._anisoSamples},set:function(t){var e=this._anisoSamples;if(this._anisoSamples=0|Math.max(t,1),e!==this._anisoSamples){var r=this.gl.getExtension("EXT_texture_filter_anisotropic");r&&this.gl.texParameterf(this.gl.TEXTURE_2D,r.TEXTURE_MAX_ANISOTROPY_EXT,this._anisoSamples)}return this._anisoSamples}},wrapS:{get:function(){return this._wrapS},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_S,t),this._wrapS=t}},wrapT:{get:function(){return this._wrapT},set:function(t){if(this.bind(),l.indexOf(t)<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);return this.gl.texParameteri(this.gl.TEXTURE_2D,this.gl.TEXTURE_WRAP_T,t),this._wrapT=t}},wrap:{get:function(){return this._wrapVector},set:function(t){if(Array.isArray(t)||(t=[t,t]),2!==t.length)throw new Error("gl-texture2d: Must specify wrap mode for rows and columns");for(var e=0;e<2;++e)if(l.indexOf(t[e])<0)throw new Error("gl-texture2d: Unknown wrap mode "+t);this._wrapS=t[0],this._wrapT=t[1];var r=this.gl;return this.bind(),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_S,this._wrapS),r.texParameteri(r.TEXTURE_2D,r.TEXTURE_WRAP_T,this._wrapT),t}},shape:{get:function(){return this._shapeVector},set:function(t){if(Array.isArray(t)){if(2!==t.length)throw new Error("gl-texture2d: Invalid texture shape")}else t=[0|t,0|t];return h(this,0|t[0],0|t[1]),[0|t[0],0|t[1]]}},width:{get:function(){return this._shape[0]},set:function(t){return h(this,t|=0,this._shape[1]),t}},height:{get:function(){return this._shape[1]},set:function(t){return t|=0,h(this,this._shape[0],t),t}}}),d.bind=function(t){var e=this.gl;return void 0!==t&&e.activeTexture(e.TEXTURE0+(0|t)),e.bindTexture(e.TEXTURE_2D,this.handle),void 0!==t?0|t:e.getParameter(e.ACTIVE_TEXTURE)-e.TEXTURE0},d.dispose=function(){this.gl.deleteTexture(this.handle)},d.generateMipmap=function(){this.bind(),this.gl.generateMipmap(this.gl.TEXTURE_2D);for(var t=Math.min(this._shape[0],this._shape[1]),e=0;t>0;++e,t>>>=1)this._mipLevels.indexOf(e)<0&&this._mipLevels.push(e)},d.setPixels=function(t,e,r,o){var s=this.gl;this.bind(),Array.isArray(e)?(o=r,r=0|e[1],e=0|e[0]):(e=e||0,r=r||0),o=o||0;var l=u(t)?t:t.raw;if(l){this._mipLevels.indexOf(o)<0?(s.texImage2D(s.TEXTURE_2D,0,this.format,this.format,this.type,l),this._mipLevels.push(o)):s.texSubImage2D(s.TEXTURE_2D,o,e,r,this.format,this.type,l)}else{if(!(t.shape&&t.stride&&t.data))throw new Error("gl-texture2d: Unsupported data type");if(t.shape.length<2||e+t.shape[1]>this._shape[1]>>>o||r+t.shape[0]>this._shape[0]>>>o||e<0||r<0)throw new Error("gl-texture2d: Texture dimensions are out of bounds");!function(t,e,r,o,s,l,c,u){var h=u.dtype,p=u.shape.slice();if(p.length<2||p.length>3)throw new Error("gl-texture2d: Invalid ndarray, must be 2d or 3d");var d=0,g=0,v=m(p,u.stride.slice());"float32"===h?d=t.FLOAT:"float64"===h?(d=t.FLOAT,v=!1,h="float32"):"uint8"===h?d=t.UNSIGNED_BYTE:(d=t.UNSIGNED_BYTE,v=!1,h="uint8");if(2===p.length)g=t.LUMINANCE,p=[p[0],p[1],1],u=n(u.data,p,[u.stride[0],u.stride[1],1],u.offset);else{if(3!==p.length)throw new Error("gl-texture2d: Invalid shape for texture");if(1===p[2])g=t.ALPHA;else if(2===p[2])g=t.LUMINANCE_ALPHA;else if(3===p[2])g=t.RGB;else{if(4!==p[2])throw new Error("gl-texture2d: Invalid shape for pixel coords");g=t.RGBA}p[2]}g!==t.LUMINANCE&&g!==t.ALPHA||s!==t.LUMINANCE&&s!==t.ALPHA||(g=s);if(g!==s)throw new Error("gl-texture2d: Incompatible texture format for setPixels");var y=u.size,x=c.indexOf(o)<0;x&&c.push(o);if(d===l&&v)0===u.offset&&u.data.length===y?x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data):x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,u.data.subarray(u.offset,u.offset+y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,u.data.subarray(u.offset,u.offset+y));else{var b;b=l===t.FLOAT?a.mallocFloat32(y):a.mallocUint8(y);var _=n(b,p,[p[2],p[2]*p[0],1]);d===t.FLOAT&&l===t.UNSIGNED_BYTE?f(_,u):i.assign(_,u),x?t.texImage2D(t.TEXTURE_2D,o,s,p[0],p[1],0,s,l,b.subarray(0,y)):t.texSubImage2D(t.TEXTURE_2D,o,e,r,p[0],p[1],s,l,b.subarray(0,y)),l===t.FLOAT?a.freeFloat32(b):a.freeUint8(b)}}(s,e,r,o,this.format,this.type,this._mipLevels,t)}}},{ndarray:259,"ndarray-ops":254,"typedarray-pool":308}],147:[function(t,e,r){"use strict";e.exports=function(t,e,r){e?e.bind():t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,null);var n=0|t.getParameter(t.MAX_VERTEX_ATTRIBS);if(r){if(r.length>n)throw new Error("gl-vao: Too many vertex attributes");for(var i=0;i1?0:Math.acos(s)};var n=t("./fromValues"),i=t("./normalize"),a=t("./dot")},{"./dot":162,"./fromValues":168,"./normalize":179}],153:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.ceil(e[0]),t[1]=Math.ceil(e[1]),t[2]=Math.ceil(e[2]),t}},{}],154:[function(t,e,r){e.exports=function(t){var e=new Float32Array(3);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e}},{}],155:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t}},{}],156:[function(t,e,r){e.exports=function(){var t=new Float32Array(3);return t[0]=0,t[1]=0,t[2]=0,t}},{}],157:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2];return t[0]=i*l-a*s,t[1]=a*o-n*l,t[2]=n*s-i*o,t}},{}],158:[function(t,e,r){e.exports=t("./distance")},{"./distance":159}],159:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return Math.sqrt(r*r+n*n+i*i)}},{}],160:[function(t,e,r){e.exports=t("./divide")},{"./divide":161}],161:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t}},{}],162:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}},{}],163:[function(t,e,r){e.exports=1e-6},{}],164:[function(t,e,r){e.exports=function(t,e){var r=t[0],i=t[1],a=t[2],o=e[0],s=e[1],l=e[2];return Math.abs(r-o)<=n*Math.max(1,Math.abs(r),Math.abs(o))&&Math.abs(i-s)<=n*Math.max(1,Math.abs(i),Math.abs(s))&&Math.abs(a-l)<=n*Math.max(1,Math.abs(a),Math.abs(l))};var n=t("./epsilon")},{"./epsilon":163}],165:[function(t,e,r){e.exports=function(t,e){return t[0]===e[0]&&t[1]===e[1]&&t[2]===e[2]}},{}],166:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.floor(e[0]),t[1]=Math.floor(e[1]),t[2]=Math.floor(e[2]),t}},{}],167:[function(t,e,r){e.exports=function(t,e,r,i,a,o){var s,l;e||(e=3);r||(r=0);l=i?Math.min(i*e+r,t.length):t.length;for(s=r;s0&&(a=1/Math.sqrt(a),t[0]=e[0]*a,t[1]=e[1]*a,t[2]=e[2]*a);return t}},{}],180:[function(t,e,r){e.exports=function(t,e){e=e||1;var r=2*Math.random()*Math.PI,n=2*Math.random()-1,i=Math.sqrt(1-n*n)*e;return t[0]=Math.cos(r)*i,t[1]=Math.sin(r)*i,t[2]=n*e,t}},{}],181:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[1],a=r[2],o=e[1]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=e[0],t[1]=i+o*c-s*l,t[2]=a+o*l+s*c,t}},{}],182:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[2],o=e[0]-i,s=e[2]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+s*l+o*c,t[1]=e[1],t[2]=a+s*c-o*l,t}},{}],183:[function(t,e,r){e.exports=function(t,e,r,n){var i=r[0],a=r[1],o=e[0]-i,s=e[1]-a,l=Math.sin(n),c=Math.cos(n);return t[0]=i+o*c-s*l,t[1]=a+o*l+s*c,t[2]=e[2],t}},{}],184:[function(t,e,r){e.exports=function(t,e){return t[0]=Math.round(e[0]),t[1]=Math.round(e[1]),t[2]=Math.round(e[2]),t}},{}],185:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t}},{}],186:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t}},{}],187:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e,t[1]=r,t[2]=n,t}},{}],188:[function(t,e,r){e.exports=t("./squaredDistance")},{"./squaredDistance":190}],189:[function(t,e,r){e.exports=t("./squaredLength")},{"./squaredLength":191}],190:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2];return r*r+n*n+i*i}},{}],191:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2];return e*e+r*r+n*n}},{}],192:[function(t,e,r){e.exports=t("./subtract")},{"./subtract":193}],193:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t}},{}],194:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2];return t[0]=n*r[0]+i*r[3]+a*r[6],t[1]=n*r[1]+i*r[4]+a*r[7],t[2]=n*r[2]+i*r[5]+a*r[8],t}},{}],195:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[3]*n+r[7]*i+r[11]*a+r[15];return o=o||1,t[0]=(r[0]*n+r[4]*i+r[8]*a+r[12])/o,t[1]=(r[1]*n+r[5]*i+r[9]*a+r[13])/o,t[2]=(r[2]*n+r[6]*i+r[10]*a+r[14])/o,t}},{}],196:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t}},{}],197:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t[2]=e[2]+r[2],t[3]=e[3]+r[3],t}},{}],198:[function(t,e,r){e.exports=function(t){var e=new Float32Array(4);return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}},{}],199:[function(t,e,r){e.exports=function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}},{}],200:[function(t,e,r){e.exports=function(){var t=new Float32Array(4);return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t}},{}],201:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return Math.sqrt(r*r+n*n+i*i+a*a)}},{}],202:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]/r[0],t[1]=e[1]/r[1],t[2]=e[2]/r[2],t[3]=e[3]/r[3],t}},{}],203:[function(t,e,r){e.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]+t[3]*e[3]}},{}],204:[function(t,e,r){e.exports=function(t,e,r,n){var i=new Float32Array(4);return i[0]=t,i[1]=e,i[2]=r,i[3]=n,i}},{}],205:[function(t,e,r){e.exports={create:t("./create"),clone:t("./clone"),fromValues:t("./fromValues"),copy:t("./copy"),set:t("./set"),add:t("./add"),subtract:t("./subtract"),multiply:t("./multiply"),divide:t("./divide"),min:t("./min"),max:t("./max"),scale:t("./scale"),scaleAndAdd:t("./scaleAndAdd"),distance:t("./distance"),squaredDistance:t("./squaredDistance"),length:t("./length"),squaredLength:t("./squaredLength"),negate:t("./negate"),inverse:t("./inverse"),normalize:t("./normalize"),dot:t("./dot"),lerp:t("./lerp"),random:t("./random"),transformMat4:t("./transformMat4"),transformQuat:t("./transformQuat")}},{"./add":197,"./clone":198,"./copy":199,"./create":200,"./distance":201,"./divide":202,"./dot":203,"./fromValues":204,"./inverse":206,"./length":207,"./lerp":208,"./max":209,"./min":210,"./multiply":211,"./negate":212,"./normalize":213,"./random":214,"./scale":215,"./scaleAndAdd":216,"./set":217,"./squaredDistance":218,"./squaredLength":219,"./subtract":220,"./transformMat4":221,"./transformQuat":222}],206:[function(t,e,r){e.exports=function(t,e){return t[0]=1/e[0],t[1]=1/e[1],t[2]=1/e[2],t[3]=1/e[3],t}},{}],207:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return Math.sqrt(e*e+r*r+n*n+i*i)}},{}],208:[function(t,e,r){e.exports=function(t,e,r,n){var i=e[0],a=e[1],o=e[2],s=e[3];return t[0]=i+n*(r[0]-i),t[1]=a+n*(r[1]-a),t[2]=o+n*(r[2]-o),t[3]=s+n*(r[3]-s),t}},{}],209:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t[2]=Math.max(e[2],r[2]),t[3]=Math.max(e[3],r[3]),t}},{}],210:[function(t,e,r){e.exports=function(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t[2]=Math.min(e[2],r[2]),t[3]=Math.min(e[3],r[3]),t}},{}],211:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r[0],t[1]=e[1]*r[1],t[2]=e[2]*r[2],t[3]=e[3]*r[3],t}},{}],212:[function(t,e,r){e.exports=function(t,e){return t[0]=-e[0],t[1]=-e[1],t[2]=-e[2],t[3]=-e[3],t}},{}],213:[function(t,e,r){e.exports=function(t,e){var r=e[0],n=e[1],i=e[2],a=e[3],o=r*r+n*n+i*i+a*a;o>0&&(o=1/Math.sqrt(o),t[0]=r*o,t[1]=n*o,t[2]=i*o,t[3]=a*o);return t}},{}],214:[function(t,e,r){var n=t("./normalize"),i=t("./scale");e.exports=function(t,e){return e=e||1,t[0]=Math.random(),t[1]=Math.random(),t[2]=Math.random(),t[3]=Math.random(),n(t,t),i(t,t,e),t}},{"./normalize":213,"./scale":215}],215:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t[2]=e[2]*r,t[3]=e[3]*r,t}},{}],216:[function(t,e,r){e.exports=function(t,e,r,n){return t[0]=e[0]+r[0]*n,t[1]=e[1]+r[1]*n,t[2]=e[2]+r[2]*n,t[3]=e[3]+r[3]*n,t}},{}],217:[function(t,e,r){e.exports=function(t,e,r,n,i){return t[0]=e,t[1]=r,t[2]=n,t[3]=i,t}},{}],218:[function(t,e,r){e.exports=function(t,e){var r=e[0]-t[0],n=e[1]-t[1],i=e[2]-t[2],a=e[3]-t[3];return r*r+n*n+i*i+a*a}},{}],219:[function(t,e,r){e.exports=function(t){var e=t[0],r=t[1],n=t[2],i=t[3];return e*e+r*r+n*n+i*i}},{}],220:[function(t,e,r){e.exports=function(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t[2]=e[2]-r[2],t[3]=e[3]-r[3],t}},{}],221:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=e[3];return t[0]=r[0]*n+r[4]*i+r[8]*a+r[12]*o,t[1]=r[1]*n+r[5]*i+r[9]*a+r[13]*o,t[2]=r[2]*n+r[6]*i+r[10]*a+r[14]*o,t[3]=r[3]*n+r[7]*i+r[11]*a+r[15]*o,t}},{}],222:[function(t,e,r){e.exports=function(t,e,r){var n=e[0],i=e[1],a=e[2],o=r[0],s=r[1],l=r[2],c=r[3],u=c*n+s*a-l*i,f=c*i+l*n-o*a,h=c*a+o*i-s*n,p=-o*n-s*i-l*a;return t[0]=u*c+p*-o+f*-l-h*-s,t[1]=f*c+p*-s+h*-o-u*-l,t[2]=h*c+p*-l+u*-s-f*-o,t[3]=e[3],t}},{}],223:[function(t,e,r){var n=t("glsl-tokenizer"),i=t("atob-lite");e.exports=function(t){for(var e=Array.isArray(t)?t:n(t),r=0;r0)continue;r=t.slice(0,1).join("")}return A(r),v+=r.length,(p=p.slice(r.length)).length}}function I(){return/[^a-fA-F0-9]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function O(){return"."===e||/[eE]/.test(e)?(p.push(e),h=5,r=e,u+1):"x"===e&&1===p.length&&"0"===p[0]?(h=11,p.push(e),r=e,u+1):/[^\d]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function z(){return"f"===e&&(p.push(e),r=e,u+=1),/[eE]/.test(e)?(p.push(e),r=e,u+1):("-"!==e&&"+"!==e||!/[eE]/.test(r))&&/[^\d]/.test(e)?(A(p.join("")),h=999,u):(p.push(e),r=e,u+1)}function D(){if(/[^\d\w_]/.test(e)){var t=p.join("");return h=k[t]?8:T[t]?7:6,A(p.join("")),h=999,u}return p.push(e),r=e,u+1}};var n=t("./lib/literals"),i=t("./lib/operators"),a=t("./lib/builtins"),o=t("./lib/literals-300es"),s=t("./lib/builtins-300es"),l=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"]},{"./lib/builtins":226,"./lib/builtins-300es":225,"./lib/literals":228,"./lib/literals-300es":227,"./lib/operators":229}],225:[function(t,e,r){var n=t("./builtins");n=n.slice().filter((function(t){return!/^(gl\_|texture)/.test(t)})),e.exports=n.concat(["gl_VertexID","gl_InstanceID","gl_Position","gl_PointSize","gl_FragCoord","gl_FrontFacing","gl_FragDepth","gl_PointCoord","gl_MaxVertexAttribs","gl_MaxVertexUniformVectors","gl_MaxVertexOutputVectors","gl_MaxFragmentInputVectors","gl_MaxVertexTextureImageUnits","gl_MaxCombinedTextureImageUnits","gl_MaxTextureImageUnits","gl_MaxFragmentUniformVectors","gl_MaxDrawBuffers","gl_MinProgramTexelOffset","gl_MaxProgramTexelOffset","gl_DepthRangeParameters","gl_DepthRange","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"])},{"./builtins":226}],226:[function(t,e,r){e.exports=["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT"]},{}],227:[function(t,e,r){var n=t("./literals");e.exports=n.slice().concat(["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray"])},{"./literals":228}],228:[function(t,e,r){e.exports=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","uint","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"]},{}],229:[function(t,e,r){e.exports=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"]},{}],230:[function(t,e,r){var n=t("./index");e.exports=function(t,e){var r=n(e),i=[];return i=(i=i.concat(r(t))).concat(r(null))}},{"./index":224}],231:[function(t,e,r){e.exports=function(t){"string"==typeof t&&(t=[t]);for(var e=[].slice.call(arguments,1),r=[],n=0;n0;)for(var s=(t=o.pop()).adjacent,l=0;l<=r;++l){var c=s[l];if(c.boundary&&!(c.lastVisited<=-n)){for(var u=c.vertices,f=0;f<=r;++f){var h=u[f];i[f]=h<0?e:a[h]}var p=this.orient();if(p>0)return c;c.lastVisited=-n,0===p&&o.push(c)}}return null},u.walk=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,a=this.tuple,o=e?this.interior.length*Math.random()|0:this.interior.length-1,s=this.interior[o];t:for(;!s.boundary;){for(var l=s.vertices,c=s.adjacent,u=0;u<=n;++u)a[u]=i[l[u]];s.lastVisited=r;for(u=0;u<=n;++u){var f=c[u];if(!(f.lastVisited>=r)){var h=a[u];a[u]=t;var p=this.orient();if(a[u]=h,p<0){s=f;continue t}f.boundary?f.lastVisited=-r:f.lastVisited=r}}return}return s},u.addPeaks=function(t,e){var r=this.vertices.length-1,n=this.dimension,i=this.vertices,l=this.tuple,c=this.interior,u=this.simplices,f=[e];e.lastVisited=r,e.vertices[e.vertices.indexOf(-1)]=r,e.boundary=!1,c.push(e);for(var h=[];f.length>0;){var p=(e=f.pop()).vertices,d=e.adjacent,m=p.indexOf(r);if(!(m<0))for(var g=0;g<=n;++g)if(g!==m){var v=d[g];if(v.boundary&&!(v.lastVisited>=r)){var y=v.vertices;if(v.lastVisited!==-r){for(var x=0,b=0;b<=n;++b)y[b]<0?(x=b,l[b]=t):l[b]=i[y[b]];if(this.orient()>0){y[x]=r,v.boundary=!1,c.push(v),f.push(v),v.lastVisited=r;continue}v.lastVisited=-r}var _=v.adjacent,w=p.slice(),T=d.slice(),k=new a(w,T,!0);u.push(k);var A=_.indexOf(e);if(!(A<0)){_[A]=k,T[m]=v,w[g]=-1,T[g]=e,d[g]=k,k.flip();for(b=0;b<=n;++b){var M=w[b];if(!(M<0||M===r)){for(var S=new Array(n-1),E=0,L=0;L<=n;++L){var C=w[L];C<0||L===b||(S[E++]=C)}h.push(new o(S,k,b))}}}}}}h.sort(s);for(g=0;g+1=0?o[l++]=s[u]:c=1&u;if(c===(1&t)){var f=o[0];o[0]=o[1],o[1]=f}e.push(o)}}return e}},{"robust-orientation":284,"simplicial-complex":293}],234:[function(t,e,r){"use strict";var n=t("binary-search-bounds");function i(t,e,r,n,i){this.mid=t,this.left=e,this.right=r,this.leftPoints=n,this.rightPoints=i,this.count=(e?e.count:0)+(r?r.count:0)+n.length}e.exports=function(t){if(!t||0===t.length)return new v(null);return new v(g(t))};var a=i.prototype;function o(t,e){t.mid=e.mid,t.left=e.left,t.right=e.right,t.leftPoints=e.leftPoints,t.rightPoints=e.rightPoints,t.count=e.count}function s(t,e){var r=g(e);t.mid=r.mid,t.left=r.left,t.right=r.right,t.leftPoints=r.leftPoints,t.rightPoints=r.rightPoints,t.count=r.count}function l(t,e){var r=t.intervals([]);r.push(e),s(t,r)}function c(t,e){var r=t.intervals([]),n=r.indexOf(e);return n<0?0:(r.splice(n,1),s(t,r),1)}function u(t,e,r){for(var n=0;n=0&&t[n][1]>=e;--n){var i=r(t[n]);if(i)return i}}function h(t,e){for(var r=0;r>1],a=[],o=[],s=[];for(r=0;r3*(e+1)?l(this,t):this.left.insert(t):this.left=g([t]);else if(t[0]>this.mid)this.right?4*(this.right.count+1)>3*(e+1)?l(this,t):this.right.insert(t):this.right=g([t]);else{var r=n.ge(this.leftPoints,t,d),i=n.ge(this.rightPoints,t,m);this.leftPoints.splice(r,0,t),this.rightPoints.splice(i,0,t)}},a.remove=function(t){var e=this.count-this.leftPoints;if(t[1]3*(e-1)?c(this,t):2===(s=this.left.remove(t))?(this.left=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(t[0]>this.mid)return this.right?4*(this.left?this.left.count:0)>3*(e-1)?c(this,t):2===(s=this.right.remove(t))?(this.right=null,this.count-=1,1):(1===s&&(this.count-=1),s):0;if(1===this.count)return this.leftPoints[0]===t?2:0;if(1===this.leftPoints.length&&this.leftPoints[0]===t){if(this.left&&this.right){for(var r=this,i=this.left;i.right;)r=i,i=i.right;if(r===this)i.right=this.right;else{var a=this.left,s=this.right;r.count-=i.count,r.right=i.left,i.left=a,i.right=s}o(this,i),this.count=(this.left?this.left.count:0)+(this.right?this.right.count:0)+this.leftPoints.length}else this.left?o(this,this.left):o(this,this.right);return 1}for(a=n.ge(this.leftPoints,t,d);athis.mid){var r;if(this.right)if(r=this.right.queryPoint(t,e))return r;return f(this.rightPoints,t,e)}return h(this.leftPoints,e)},a.queryInterval=function(t,e,r){var n;if(tthis.mid&&this.right&&(n=this.right.queryInterval(t,e,r)))return n;return ethis.mid?f(this.rightPoints,t,r):h(this.leftPoints,r)};var y=v.prototype;y.insert=function(t){this.root?this.root.insert(t):this.root=new i(t[0],null,null,[t],[t])},y.remove=function(t){if(this.root){var e=this.root.remove(t);return 2===e&&(this.root=null),0!==e}return!1},y.queryPoint=function(t,e){if(this.root)return this.root.queryPoint(t,e)},y.queryInterval=function(t,e,r){if(t<=e&&this.root)return this.root.queryInterval(t,e,r)},Object.defineProperty(y,"count",{get:function(){return this.root?this.root.count:0}}),Object.defineProperty(y,"intervals",{get:function(){return this.root?this.root.intervals([]):[]}})},{"binary-search-bounds":31}],235:[function(t,e,r){"use strict";e.exports=function(t){for(var e=new Array(t),r=0;r { css={` ${isExpanded ?? false ? OVERLAY_IN_STYLE : overlayOutStyle} `} - backgroundColor={COLORS.transparent} + backgroundColor={LEGACY_COLORS.transparent} height="92.5%" marginTop={SPACING.spacing48} /> @@ -148,7 +148,7 @@ export const Slideout = (props: SlideoutProps): JSX.Element => { position={POSITION_FIXED} right="0" top="0" - backgroundColor={COLORS.white} + backgroundColor={LEGACY_COLORS.white} boxShadow="0px 3px 6px rgba(0, 0, 0, 0.23)" height="92.5%" marginTop={SPACING.spacing48} @@ -192,7 +192,7 @@ export const Slideout = (props: SlideoutProps): JSX.Element => { <>{title} )} setShowColorPicker(false)} /> { props.onChange(color.hex) diff --git a/protocol-designer/src/components/DeckSetup/FlexModuleTag.tsx b/protocol-designer/src/components/DeckSetup/FlexModuleTag.tsx index 9a8ce2920b5..65adaa7cc92 100644 --- a/protocol-designer/src/components/DeckSetup/FlexModuleTag.tsx +++ b/protocol-designer/src/components/DeckSetup/FlexModuleTag.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { RobotCoordsForeignDiv, Text, - COLORS, + LEGACY_COLORS, SPACING, } from '@opentrons/components' import type { ModuleDefinition } from '@opentrons/shared-data' @@ -21,11 +21,11 @@ export function FlexModuleTag(props: FlexModuleTagProps): JSX.Element { height={20} y={-22} innerDivProps={{ - backgroundColor: COLORS.darkGreyEnabled, + backgroundColor: LEGACY_COLORS.darkGreyEnabled, padding: SPACING.spacing4, height: '100%', - color: COLORS.white, - border: `1px solid ${COLORS.darkGrey}`, + color: LEGACY_COLORS.white, + border: `1px solid ${LEGACY_COLORS.darkGrey}`, }} > diff --git a/protocol-designer/src/components/DeckSetup/LabwareOverlays/EditLabwareOffDeck.tsx b/protocol-designer/src/components/DeckSetup/LabwareOverlays/EditLabwareOffDeck.tsx index 3828b542161..cea71d9432d 100644 --- a/protocol-designer/src/components/DeckSetup/LabwareOverlays/EditLabwareOffDeck.tsx +++ b/protocol-designer/src/components/DeckSetup/LabwareOverlays/EditLabwareOffDeck.tsx @@ -4,7 +4,7 @@ import { css } from 'styled-components' import { ALIGN_FLEX_START, BORDERS, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, Icon, JUSTIFY_SPACE_AROUND, @@ -40,9 +40,9 @@ const NAME_LABWARE_OVERLAY_STYLE = css` const REGULAR_OVERLAY_STYLE = css` z-index: 1; padding: ${SPACING.spacing8}; - background-color: ${COLORS.darkBlack90}; + background-color: ${LEGACY_COLORS.darkBlack90}; flex-direction: ${DIRECTION_COLUMN}; - color: ${COLORS.white}; + color: ${LEGACY_COLORS.white}; display: flex; align-items: ${ALIGN_FLEX_START}; justify-content: ${JUSTIFY_SPACE_AROUND}; diff --git a/protocol-designer/src/components/DeckSetup/Ot2ModuleTag.tsx b/protocol-designer/src/components/DeckSetup/Ot2ModuleTag.tsx index 231e6876414..cac3aa6a88d 100644 --- a/protocol-designer/src/components/DeckSetup/Ot2ModuleTag.tsx +++ b/protocol-designer/src/components/DeckSetup/Ot2ModuleTag.tsx @@ -3,7 +3,7 @@ import * as React from 'react' import { RobotCoordsForeignDiv, Text, - COLORS, + LEGACY_COLORS, SPACING, } from '@opentrons/components' import { @@ -43,10 +43,10 @@ export function Ot2ModuleTag(props: Ot2ModuleTagProps): JSX.Element { y={isThermocyclerModel ? -22 : 0} x={isThermocyclerModel ? 0 : xCoordinateForOtherMods} innerDivProps={{ - backgroundColor: COLORS.darkGreyEnabled, + backgroundColor: LEGACY_COLORS.darkGreyEnabled, padding: SPACING.spacing4, height: '100%', - color: COLORS.white, + color: LEGACY_COLORS.white, }} > diff --git a/protocol-designer/src/components/DeckSetup/index.tsx b/protocol-designer/src/components/DeckSetup/index.tsx index 520c9941a9f..826fe1f052a 100644 --- a/protocol-designer/src/components/DeckSetup/index.tsx +++ b/protocol-designer/src/components/DeckSetup/index.tsx @@ -3,7 +3,7 @@ import { useDispatch, useSelector } from 'react-redux' import compact from 'lodash/compact' import values from 'lodash/values' import { - COLORS, + LEGACY_COLORS, DeckFromLayers, FlexTrash, Module, @@ -112,8 +112,8 @@ interface ContentsProps { trashSlot: string | null } -const lightFill = COLORS.light1 -const darkFill = COLORS.darkBlack70 +const lightFill = LEGACY_COLORS.light1 +const darkFill = LEGACY_COLORS.darkBlack70 export const DeckSetupContents = (props: ContentsProps): JSX.Element => { const { @@ -611,14 +611,14 @@ export const DeckSetup = (): JSX.Element => { ) : null diff --git a/protocol-designer/src/components/LiquidsPage/LiquidEditForm.tsx b/protocol-designer/src/components/LiquidsPage/LiquidEditForm.tsx index 44418c4482e..886407939d0 100644 --- a/protocol-designer/src/components/LiquidsPage/LiquidEditForm.tsx +++ b/protocol-designer/src/components/LiquidsPage/LiquidEditForm.tsx @@ -14,7 +14,7 @@ import { Flex, JUSTIFY_END, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, } from '@opentrons/components' import { selectors } from '../../labware-ingred/selectors' import styles from './LiquidEditForm.css' @@ -48,7 +48,7 @@ function checkColor(hex: string): boolean { return luminance < 0.1 || luminance > 0.9 } -const INVALID_DISPLAY_COLORS = ['#000000', '#ffffff', COLORS.whaleGrey] +const INVALID_DISPLAY_LEGACY_COLORS = ['#000000', '#ffffff', LEGACY_COLORS.whaleGrey] export const liquidEditFormSchema: Yup.Schema< { name: string; description: string; serialize: boolean } | undefined, @@ -66,9 +66,9 @@ export const liquidEditFormSchema: Yup.Schema< if (value == null) { return true } - return !INVALID_DISPLAY_COLORS.includes(value) + return !INVALID_DISPLAY_LEGACY_COLORS.includes(value) ? !checkColor(value) - : !INVALID_DISPLAY_COLORS.includes(value) + : !INVALID_DISPLAY_LEGACY_COLORS.includes(value) } ), description: Yup.string(), diff --git a/protocol-designer/src/components/OffDeckLabwareSlideout.tsx b/protocol-designer/src/components/OffDeckLabwareSlideout.tsx index 48983d4e417..d8a38448edd 100644 --- a/protocol-designer/src/components/OffDeckLabwareSlideout.tsx +++ b/protocol-designer/src/components/OffDeckLabwareSlideout.tsx @@ -6,7 +6,7 @@ import { DeprecatedPrimaryButton, useHoverTooltip, Flex, - COLORS, + LEGACY_COLORS, Icon, SPACING, Text, @@ -93,7 +93,7 @@ export const OffDeckLabwareSlideout = ( {i18n.t('deck.off_deck.slideout_empty_state')} diff --git a/protocol-designer/src/components/modals/CreateFileWizard/EquipmentOption.tsx b/protocol-designer/src/components/modals/CreateFileWizard/EquipmentOption.tsx index 0acd1df9c28..e9c507a1b17 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/EquipmentOption.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/EquipmentOption.tsx @@ -7,7 +7,7 @@ import { ALIGN_CENTER, BORDERS, JUSTIFY_CENTER, - COLORS, + LEGACY_COLORS, StyleProps, TYPOGRAPHY, useHoverTooltip, @@ -51,7 +51,7 @@ export function EquipmentOption(props: EquipmentOptionProps): JSX.Element { borderRadius={BORDERS.borderRadiusSize2} cursor={disabled ? 'auto' : 'pointer'} backgroundColor={ - disabled ? COLORS.darkGreyDisabled : COLORS.transparent + disabled ? LEGACY_COLORS.darkGreyDisabled : LEGACY_COLORS.transparent } onClick={disabled ? undefined : onClick} {...styleProps} @@ -62,7 +62,7 @@ export function EquipmentOption(props: EquipmentOptionProps): JSX.Element { aria-label={`EquipmentOption_${ isSelected ? 'checkbox-marked' : 'checkbox-blank-outline' }`} - color={isSelected ? COLORS.blueEnabled : COLORS.darkGreyEnabled} + color={isSelected ? LEGACY_COLORS.blueEnabled : LEGACY_COLORS.darkGreyEnabled} size="1.5rem" name={isSelected ? 'checkbox-marked' : 'checkbox-blank-outline'} /> @@ -77,7 +77,7 @@ export function EquipmentOption(props: EquipmentOptionProps): JSX.Element { {text} diff --git a/protocol-designer/src/components/modals/CreateFileWizard/InputField.tsx b/protocol-designer/src/components/modals/CreateFileWizard/InputField.tsx index c1aeaf9bfd5..ad19fa53b48 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/InputField.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/InputField.tsx @@ -5,7 +5,7 @@ import { ALIGN_CENTER, BORDERS, COLOR_WARNING_DARK, - COLORS, + LEGACY_COLORS, DIRECTION_COLUMN, DISPLAY_INLINE_BLOCK, Flex, @@ -71,7 +71,7 @@ export function InputField(props: InputFieldProps): JSX.Element { lineHeight={1} fontSize={TYPOGRAPHY.fontSizeP} fontWeight={TYPOGRAPHY.fontWeightRegular} - color={props.error != null ? COLOR_WARNING_DARK : COLORS.darkBlackEnabled} + color={props.error != null ? COLOR_WARNING_DARK : LEGACY_COLORS.darkBlackEnabled} opacity={props.disabled ?? false ? 0.5 : ''} > @@ -87,11 +87,11 @@ function Input(props: InputFieldProps): JSX.Element { const INPUT_FIELD = css` display: flex; - background-color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.white}; border-radius: ${SPACING.spacing4}; padding: ${SPACING.spacing8}; border: 1px ${BORDERS.styleSolid} - ${error ? COLORS.errorEnabled : COLORS.medGreyEnabled}; + ${error ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.medGreyEnabled}; font-size: ${TYPOGRAPHY.fontSizeP}; @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { @@ -99,12 +99,12 @@ function Input(props: InputFieldProps): JSX.Element { } &:active { - border: 1px ${BORDERS.styleSolid} ${COLORS.darkGreyEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.darkGreyEnabled}; } & input { border-radius: inherit; - color: ${COLORS.darkBlackEnabled}; + color: ${LEGACY_COLORS.darkBlackEnabled}; border: none; flex: 1 1 auto; width: 100%; @@ -116,13 +116,13 @@ function Input(props: InputFieldProps): JSX.Element { &:hover { border: 1px ${BORDERS.styleSolid} - ${error ? COLORS.errorEnabled : COLORS.medGreyHover}; + ${error ? LEGACY_COLORS.errorEnabled : LEGACY_COLORS.medGreyHover}; } &:focus { - border: 1px ${BORDERS.styleSolid} ${COLORS.blueEnabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.blueEnabled}; } &:disabled { - border: 1px ${BORDERS.styleSolid} ${COLORS.darkGreyDisabled}; + border: 1px ${BORDERS.styleSolid} ${LEGACY_COLORS.darkGreyDisabled}; } input[type='number']::-webkit-inner-spin-button, input[type='number']::-webkit-outer-spin-button { @@ -145,7 +145,7 @@ function Input(props: InputFieldProps): JSX.Element { display={DISPLAY_INLINE_BLOCK} textAlign={TEXT_ALIGN_RIGHT} alignSelf={ALIGN_CENTER} - color={COLORS.darkGreyEnabled} + color={LEGACY_COLORS.darkGreyEnabled} fontSize={TYPOGRAPHY.fontSizeLabel} > {props.units} @@ -153,7 +153,7 @@ function Input(props: InputFieldProps): JSX.Element { )} {props.secondaryCaption} ) : null} - {props.error} + {props.error}
) diff --git a/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx b/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx index ee89fcc370a..fa4dd0452ab 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/PipetteTipsTile.tsx @@ -15,7 +15,7 @@ import { ALIGN_START, BORDERS, DIRECTION_ROW, - COLORS, + LEGACY_COLORS, OutlineButton, Icon, JUSTIFY_CENTER, @@ -104,10 +104,10 @@ export function PipetteTipsTile(props: PipetteTipsTileProps): JSX.Element { } const INPUT_STYLE = css` - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; border-radius: ${BORDERS.radiusRoundEdge}; box-shadow: none; - color: ${COLORS.fundamentalsBackground}; + color: ${LEGACY_COLORS.fundamentalsBackground}; overflow: no-wrap; padding-left: ${SPACING.spacing16}; padding-right: ${SPACING.spacing16}; @@ -124,22 +124,22 @@ const INPUT_STYLE = css` } &:hover { - background-color: ${COLORS.blueHover}; + background-color: ${LEGACY_COLORS.blueHover}; box-shadow: none; } &:active { - background-color: ${COLORS.bluePressed}; + background-color: ${LEGACY_COLORS.bluePressed}; } ` const ACCORDION_STYLE = css` border-radius: 50%; &:hover { - background: ${COLORS.lightGreyHover}; + background: ${LEGACY_COLORS.lightGreyHover}; } &:active { - background: ${COLORS.lightGreyPressed}; + background: ${LEGACY_COLORS.lightGreyPressed}; } ` interface PipetteTipsFieldProps extends FormikProps { @@ -275,7 +275,7 @@ function PipetteTipsField(props: PipetteTipsFieldProps): JSX.Element | null { alignItems={ALIGN_CENTER} width="100%" height="8.5rem" - backgroundColor={COLORS.darkBlack20} + backgroundColor={LEGACY_COLORS.darkBlack20} padding={SPACING.spacing8} border={BORDERS.lineBorder} borderRadius={BORDERS.borderRadiusSize2} @@ -283,7 +283,7 @@ function PipetteTipsField(props: PipetteTipsFieldProps): JSX.Element | null { {i18n.t('modal.create_file_wizard.upload_tiprack')} diff --git a/protocol-designer/src/components/modals/CreateFileWizard/RobotTypeTile.tsx b/protocol-designer/src/components/modals/CreateFileWizard/RobotTypeTile.tsx index f1717984520..1228130ad01 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/RobotTypeTile.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/RobotTypeTile.tsx @@ -5,7 +5,7 @@ import { SPACING, TYPOGRAPHY, Text, - COLORS, + LEGACY_COLORS, BORDERS, JUSTIFY_CENTER, ALIGN_CENTER, @@ -119,8 +119,8 @@ function RobotTypeOption(props: RobotTypeOptionProps): JSX.Element { } const UNSELECTED_OPTIONS_STYLE = css` - background-color: ${COLORS.white}; - border: 1px solid ${COLORS.medGreyEnabled}; + background-color: ${LEGACY_COLORS.white}; + border: 1px solid ${LEGACY_COLORS.medGreyEnabled}; border-radius: ${BORDERS.radiusSoftCorners}; height: 14.5625rem; width: 14.5625rem; @@ -131,13 +131,13 @@ const UNSELECTED_OPTIONS_STYLE = css` grid-gap: ${SPACING.spacing8} &:hover { - border: 1px solid ${COLORS.medGreyHover}; + border: 1px solid ${LEGACY_COLORS.medGreyHover}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { flex-direction: ${DIRECTION_ROW}; justify-content: ${JUSTIFY_FLEX_START}; - background-color: ${COLORS.mediumBlueEnabled}; + background-color: ${LEGACY_COLORS.mediumBlueEnabled}; border-width: 0; border-radius: ${BORDERS.borderRadiusSize4}; padding: ${SPACING.spacing24}; @@ -151,22 +151,22 @@ const UNSELECTED_OPTIONS_STYLE = css` ` const SELECTED_OPTIONS_STYLE = css` ${UNSELECTED_OPTIONS_STYLE} - border: 1px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.lightBlue}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; &:hover { - border: 1px solid ${COLORS.blueEnabled}; - background-color: ${COLORS.lightBlue}; + border: 1px solid ${LEGACY_COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.lightBlue}; } @media ${RESPONSIVENESS.touchscreenMediaQuerySpecs} { border-width: 0px; - background-color: ${COLORS.blueEnabled}; - color: ${COLORS.white}; + background-color: ${LEGACY_COLORS.blueEnabled}; + color: ${LEGACY_COLORS.white}; &:hover { border-width: 0px; - background-color: ${COLORS.blueEnabled}; + background-color: ${LEGACY_COLORS.blueEnabled}; } } ` diff --git a/protocol-designer/src/components/modals/CreateFileWizard/WizardHeader.tsx b/protocol-designer/src/components/modals/CreateFileWizard/WizardHeader.tsx index 307f3961d09..16b0e6fb7a8 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/WizardHeader.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/WizardHeader.tsx @@ -7,7 +7,7 @@ import { Flex, JUSTIFY_SPACE_BETWEEN, TYPOGRAPHY, - COLORS, + LEGACY_COLORS, SPACING, RESPONSIVENESS, Text, @@ -26,7 +26,7 @@ interface WizardHeaderProps { const EXIT_BUTTON_STYLE = css` ${TYPOGRAPHY.pSemiBold}; text-transform: ${TYPOGRAPHY.textTransformCapitalize}; - color: ${COLORS.darkGreyEnabled}; + color: ${LEGACY_COLORS.darkGreyEnabled}; &:hover { opacity: 70%; @@ -66,7 +66,7 @@ export const WizardHeader = (props: WizardHeaderProps): JSX.Element => { const { totalSteps, currentStep, title, onExit, exitDisabled } = props return ( - + @@ -74,7 +74,7 @@ export const WizardHeader = (props: WizardHeaderProps): JSX.Element => { {currentStep != null && totalSteps != null && currentStep > 0 ? ( - + {i18n.t('shared.step', { current: currentStep, max: totalSteps })} ) : null} diff --git a/protocol-designer/src/components/modals/CreateFileWizard/__tests__/EquipmentOption.test.tsx b/protocol-designer/src/components/modals/CreateFileWizard/__tests__/EquipmentOption.test.tsx index 93c3bed9563..3120090dcb4 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/__tests__/EquipmentOption.test.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/__tests__/EquipmentOption.test.tsx @@ -1,5 +1,5 @@ import * as React from 'react' -import { BORDERS, COLORS, renderWithProviders } from '@opentrons/components' +import { BORDERS, LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { EquipmentOption } from '../EquipmentOption' const render = (props: React.ComponentProps) => { @@ -27,7 +27,7 @@ describe('EquipmentOption', () => { } const { getByLabelText } = render(props) expect(getByLabelText('EquipmentOption_flex_mockText')).toHaveStyle( - `background-color: ${COLORS.darkGreyDisabled}` + `background-color: ${LEGACY_COLORS.darkGreyDisabled}` ) }) it('renders the equipment option without check not selected and image', () => { @@ -41,7 +41,7 @@ describe('EquipmentOption', () => { getByRole('img') expect( getByLabelText('EquipmentOption_checkbox-blank-outline') - ).toHaveStyle(`color: ${COLORS.darkGreyEnabled}`) + ).toHaveStyle(`color: ${LEGACY_COLORS.darkGreyEnabled}`) expect(getByLabelText('EquipmentOption_flex_mockText')).toHaveStyle( `border: ${BORDERS.lineBorder}` ) @@ -55,7 +55,7 @@ describe('EquipmentOption', () => { const { getByText, getByLabelText } = render(props) getByText('mockText') expect(getByLabelText('EquipmentOption_checkbox-marked')).toHaveStyle( - `color: ${COLORS.blueEnabled}` + `color: ${LEGACY_COLORS.blueEnabled}` ) expect(getByLabelText('EquipmentOption_flex_mockText')).toHaveStyle( `border: ${BORDERS.activeLineBorder}` diff --git a/protocol-designer/src/components/modals/CreateFileWizard/__tests__/RobotTypeTile.test.tsx b/protocol-designer/src/components/modals/CreateFileWizard/__tests__/RobotTypeTile.test.tsx index 42fb3f01b3c..a88f14be5fe 100644 --- a/protocol-designer/src/components/modals/CreateFileWizard/__tests__/RobotTypeTile.test.tsx +++ b/protocol-designer/src/components/modals/CreateFileWizard/__tests__/RobotTypeTile.test.tsx @@ -1,7 +1,7 @@ import * as React from 'react' import i18n from 'i18next' import { fireEvent, screen } from '@testing-library/react' -import { COLORS, renderWithProviders } from '@opentrons/components' +import { LEGACY_COLORS, renderWithProviders } from '@opentrons/components' import { FLEX_ROBOT_TYPE } from '@opentrons/shared-data' import { RobotTypeTile } from '../RobotTypeTile' import type { FormState, WizardTileProps } from '../types' @@ -45,11 +45,11 @@ describe('RobotTypeTile', () => { const flex = screen.getByLabelText('RobotTypeTile_OT-3 Standard') fireEvent.click(flex) expect(props.setFieldValue).toHaveBeenCalled() - expect(flex).toHaveStyle(`background-color: ${COLORS.lightBlue}`) + expect(flex).toHaveStyle(`background-color: ${LEGACY_COLORS.lightBlue}`) const ot2 = screen.getByLabelText('RobotTypeTile_OT-2 Standard') fireEvent.click(ot2) expect(props.setFieldValue).toHaveBeenCalled() - expect(ot2).toHaveStyle(`background-color: ${COLORS.white}`) + expect(ot2).toHaveStyle(`background-color: ${LEGACY_COLORS.white}`) fireEvent.click(screen.getByRole('button', { name: 'Next' })) expect(props.proceed).toHaveBeenCalled() }) diff --git a/protocol-designer/src/components/modules/FlexSlotMap.tsx b/protocol-designer/src/components/modules/FlexSlotMap.tsx index dcabe5df72d..e9c494f4e1b 100644 --- a/protocol-designer/src/components/modules/FlexSlotMap.tsx +++ b/protocol-designer/src/components/modules/FlexSlotMap.tsx @@ -7,7 +7,7 @@ import { import { ALIGN_CENTER, BORDERS, - COLORS, + LEGACY_COLORS, Flex, JUSTIFY_CENTER, RobotCoordinateSpace, @@ -31,9 +31,9 @@ export function FlexSlotMap(props: FlexSlotMapProps): JSX.Element { const slotFill = ( ))} {selectedSlots.map((selectedSlot, index) => { diff --git a/protocol-designer/src/components/swatchColors.ts b/protocol-designer/src/components/swatchColors.ts index eb1945cf129..d4410afc240 100644 --- a/protocol-designer/src/components/swatchColors.ts +++ b/protocol-designer/src/components/swatchColors.ts @@ -1,6 +1,6 @@ import { AIR } from '@opentrons/step-generation' -import { COLORS } from '@opentrons/components' -export const MIXED_WELL_COLOR = '#9b9b9b' // NOTE: matches `--c-med-gray` in COLORS.liquidColors.css +import { LEGACY_COLORS } from '@opentrons/components' +export const MIXED_WELL_COLOR = '#9b9b9b' // NOTE: matches `--c-med-gray` in LEGACY_COLORS.liquidColors.css export const swatchColors = (ingredGroupId: string): string => { const num = Number(ingredGroupId) @@ -15,5 +15,5 @@ export const swatchColors = (ingredGroupId: string): string => { return 'transparent' } - return COLORS.liquidColors[num % COLORS.liquidColors.length] + return LEGACY_COLORS.liquidColors[num % LEGACY_COLORS.liquidColors.length] }