{
  "version": 3,
  "sources": ["../src/color-palette-panel.tsx"],
  "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport type { Color } from '@wordpress/global-styles-engine';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\t__experimentalPaletteEdit as PaletteEdit,\n\t__experimentalVStack as VStack,\n\tButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { shuffle } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport { useSetting, useColorRandomizer } from './hooks';\nimport ColorVariations from './variations/variations-color';\n\nconst mobilePopoverProps = { placement: 'bottom-start' as const, offset: 8 };\n\ninterface ColorPalettePanelProps {\n\tname?: string;\n}\n\nexport default function ColorPalettePanel( { name }: ColorPalettePanelProps ) {\n\tconst [ themeColors, setThemeColors ] = useSetting< Color[] >(\n\t\t'color.palette.theme',\n\t\tname\n\t);\n\tconst [ baseThemeColors ] = useSetting< Color[] >(\n\t\t'color.palette.theme',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ defaultColors, setDefaultColors ] = useSetting< Color[] >(\n\t\t'color.palette.default',\n\t\tname\n\t);\n\tconst [ baseDefaultColors ] = useSetting< Color[] >(\n\t\t'color.palette.default',\n\t\tname,\n\t\t'base'\n\t);\n\tconst [ customColors, setCustomColors ] = useSetting< Color[] >(\n\t\t'color.palette.custom',\n\t\tname\n\t);\n\n\tconst [ defaultPaletteEnabled ] = useSetting< boolean >(\n\t\t'color.defaultPalette',\n\t\tname\n\t);\n\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst popoverProps = isMobileViewport ? mobilePopoverProps : undefined;\n\n\tconst [ randomizeThemeColors ] = useColorRandomizer( name );\n\n\treturn (\n\t\t<VStack className=\"global-styles-ui-color-palette-panel\" spacing={ 8 }>\n\t\t\t<VStack spacing={ 4 }>\n\t\t\t\t{ !! themeColors && !! themeColors.length && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ themeColors !== baseThemeColors }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tcolors={ themeColors }\n\t\t\t\t\t\tonChange={ setThemeColors }\n\t\t\t\t\t\tpaletteLabel={ __( 'Theme' ) }\n\t\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( window as any ).__experimentalEnableColorRandomizer &&\n\t\t\t\t\tthemeColors?.length > 0 &&\n\t\t\t\t\trandomizeThemeColors && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\ticon={ shuffle }\n\t\t\t\t\t\t\tonClick={ randomizeThemeColors }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Randomize colors' ) }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t) }\n\t\t\t</VStack>\n\t\t\t{ !! defaultColors &&\n\t\t\t\t!! defaultColors.length &&\n\t\t\t\t!! defaultPaletteEnabled && (\n\t\t\t\t\t<PaletteEdit\n\t\t\t\t\t\tcanReset={ defaultColors !== baseDefaultColors }\n\t\t\t\t\t\tcanOnlyChangeValues\n\t\t\t\t\t\tcolors={ defaultColors }\n\t\t\t\t\t\tonChange={ setDefaultColors }\n\t\t\t\t\t\tpaletteLabel={ __( 'Default' ) }\n\t\t\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t<PaletteEdit\n\t\t\t\tcolors={ customColors }\n\t\t\t\tonChange={ setCustomColors }\n\t\t\t\tpaletteLabel={ __( 'Custom' ) }\n\t\t\t\tpaletteLabelHeadingLevel={ 3 }\n\t\t\t\tslugPrefix=\"custom-\"\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t/>\n\t\t\t<ColorVariations title={ __( 'Palettes' ) } />\n\t\t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