{
  "version": 3,
  "sources": ["../../../src/components/dataviews-footer/index.tsx"],
  "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useContext } from '@wordpress/element';\nimport { Stack } from '@wordpress/ui';\n\n/**\n * Internal dependencies\n */\nimport DataViewsContext from '../dataviews-context';\nimport DataViewsPagination from '../dataviews-pagination';\nimport {\n\tBulkActionsFooter,\n\tuseSomeItemHasAPossibleBulkAction,\n} from '../dataviews-bulk-actions';\nimport { LAYOUT_GRID, LAYOUT_TABLE } from '../../constants';\nimport { useDelayedLoading } from '../../hooks/use-delayed-loading';\n\nconst EMPTY_ARRAY: [] = [];\n\nexport default function DataViewsFooter() {\n\tconst {\n\t\tview,\n\t\tpaginationInfo: { totalItems = 0, totalPages },\n\t\tdata,\n\t\tactions = EMPTY_ARRAY,\n\t\tisLoading,\n\t\thasInitiallyLoaded,\n\t} = useContext( DataViewsContext );\n\n\tconst isRefreshing = !! isLoading && hasInitiallyLoaded && !! data?.length;\n\n\tconst isDelayedRefreshing = useDelayedLoading( !! isRefreshing );\n\n\tconst hasBulkActions =\n\t\tuseSomeItemHasAPossibleBulkAction( actions, data ) &&\n\t\t[ LAYOUT_TABLE, LAYOUT_GRID ].includes( view.type );\n\n\tif (\n\t\t! isRefreshing &&\n\t\t( ! totalItems ||\n\t\t\t! totalPages ||\n\t\t\t( totalPages <= 1 && ! hasBulkActions ) )\n\t) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t( !! totalItems || isRefreshing ) && (\n\t\t\t<div\n\t\t\t\tclassName=\"dataviews-footer\"\n\t\t\t\t// @ts-ignore\n\t\t\t\tinert={ isRefreshing ? 'true' : undefined }\n\t\t\t>\n\t\t\t\t<Stack\n\t\t\t\t\tdirection=\"row\"\n\t\t\t\t\tjustify=\"end\"\n\t\t\t\t\talign=\"center\"\n\t\t\t\t\tclassName={ clsx( 'dataviews-footer__content', {\n\t\t\t\t\t\t'is-refreshing': isDelayedRefresh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