{"version":3,"file":"edit.cjs","names":["unlock","blockEditorPrivateApis","useViewportMatch","useState","useRef","useDispatch","blockEditorStore","useToolsPanelDropdownMenuProps","useBlockEditingMode","useSelect","coreStore","isBlobURL","WCSpinner","MIN_SIZE","isRTL","createInterpolateElement","__","InspectorControls","ToolsPanel","ToolsPanelItem","RangeControl","ToggleControl","BlockControls","ToolbarButton","crop","ResizableBox","noticesStore","MediaReplaceFlow","DropZone","Placeholder","useBlockProps","MediaControlPreview","MediaControl","MediaPlaceholder","Button","upload"],"sources":["../../src/site-logo/edit.jsx"],"sourcesContent":["import clsx from 'clsx';\nimport { isBlobURL } from '@wordpress/blob';\nimport {\n\tcreateInterpolateElement,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from '@wordpress/element';\nimport { __, isRTL } from '@wordpress/i18n';\nimport {\n\tRangeControl,\n\tResizableBox,\n\tSpinner as WCSpinner,\n\tToggleControl,\n\tToolbarButton,\n\tPlaceholder,\n\tButton,\n\tDropZone,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useViewportMatch } from '@wordpress/compose';\nimport {\n\tBlockControls,\n\tInspectorControls,\n\tMediaPlaceholder,\n\tMediaReplaceFlow,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tuseBlockEditingMode,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { crop, upload } from '@wordpress/icons';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { MIN_SIZE } from '../image/constants';\nimport { MediaControl, MediaControlPreview } from '../utils/media-control';\nimport { unlock } from '../lock-unlock';\nimport { useToolsPanelDropdownMenuProps } from '../utils/hooks';\n\nconst ALLOWED_MEDIA_TYPES = [ 'image' ];\nconst { mediaEditKey, openMediaEditorModalKey } = unlock(\n\tblockEditorPrivateApis\n);\n\nconst SiteLogo = ( {\n\talt,\n\tattributes: { align, width, height, isLink, linkTarget, shouldSyncIcon },\n\tisSelected,\n\tsetAttributes,\n\tsetLogo,\n\tlogoUrl,\n\tsiteUrl,\n\tlogoId,\n\ticonId,\n\tsetIcon,\n\tcanUserEdit,\n} ) => {\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideAligned = [ 'wide', 'full' ].includes( align );\n\tconst isResizable = ! isWideAligned && isLargeViewport;\n\tconst [ { naturalWidth, naturalHeight }, setNaturalSize ] = useState( {} );\n\tconst cropButtonRef = useRef();\n\tconst { toggleSelection, __unstableMarkNextChangeAsNotPersistent } =\n\t\tuseDispatch( blockEditorStore );\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\t// Check if we're in contentOnly mode\n\tconst blockEditingMode = useBlockEditingMode();\n\tconst isContentOnlyMode = blockEditingMode === 'contentOnly';\n\n\tconst {\n\t\timageEditing,\n\t\tmaxWidth,\n\t\ttitle,\n\t\teditMediaEntity,\n\t\topenMediaEditorModal,\n\t} = useSelect( ( select ) => {\n\t\tconst settings = select( blockEditorStore ).getSettings();\n\t\tconst siteEntities = select( coreStore ).getEntityRecord(\n\t\t\t'root',\n\t\t\t'__unstableBase'\n\t\t);\n\t\treturn {\n\t\t\ttitle: siteEntities?.name,\n\t\t\timageEditing: settings.imageEditing,\n\t\t\tmaxWidth: settings.maxWidth,\n\t\t\teditMediaEntity: settings?.[ mediaEditKey ],\n\t\t\topenMediaEditorModal: settings?.[ openMediaEditorModalKey ],\n\t\t};\n\t}, [] );\n\n\tuseEffect( () => {\n\t\t// Turn the `Use as site icon` toggle off if it is on but the logo and icon have\n\t\t// fallen out of sync. This can happen if the toggle is saved in the `on` position,\n\t\t// but changes are later made to the site icon in the Customizer.\n\t\tif ( shouldSyncIcon && logoId !== iconId ) {\n\t\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\t\tsetAttributes( { shouldSyncIcon: false } );\n\t\t}\n\t}, [] );\n\n\t// Always apply modal updates as snackbar Undo may restore the original id.\n\tconst handleMediaUpdate = ( { id: newId } ) => {\n\t\tif ( typeof newId === 'number' ) {\n\t\t\tsetLogo( newId );\n\t\t}\n\t};\n\n\tfunction onResizeStart() {\n\t\ttoggleSelection( false );\n\t}\n\n\tfunction onResizeStop() {\n\t\ttoggleSelection( true );\n\t}\n\n\tconst img = (\n\t\t<>\n\t\t\t<img\n\t\t\t\tclassName=\"custom-logo\"\n\t\t\t\tsrc={ logoUrl }\n\t\t\t\talt={ alt }\n\t\t\t\tonLoad={ ( event ) => {\n\t\t\t\t\tsetNaturalSize( {\n\t\t\t\t\t\tnaturalWidth: event.target.naturalWidth,\n\t\t\t\t\t\tnaturalHeight: event.target.naturalHeight,\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isBlobURL( logoUrl ) && <WCSpinner /> }\n\t\t</>\n\t);\n\n\tlet imgWrapper = img;\n\tif ( isLink ) {\n\t\timgWrapper = (\n\t\t\t<a\n\t\t\t\thref={ siteUrl }\n\t\t\t\tclassName=\"custom-logo-link\"\n\t\t\t\trel=\"home\"\n\t\t\t\ttitle={ title }\n\t\t\t\tonClick={ ( event ) => event.preventDefault() }\n\t\t\t>\n\t\t\t\t{ img }\n\t\t\t</a>\n\t\t);\n\t}\n\n\tif ( ! isResizable || ! naturalWidth || ! naturalHeight ) {\n\t\treturn <div style={ { width, height } }>{ imgWrapper }</div>;\n\t}\n\n\t// Set the default width to a responsible size.\n\t// Note that this width is also set in the attached frontend CSS file.\n\tconst defaultWidth = 120;\n\n\tconst currentWidth = width || defaultWidth;\n\tconst ratio = naturalWidth / naturalHeight;\n\tconst currentHeight = currentWidth / ratio;\n\tconst minWidth =\n\t\tnaturalWidth < naturalHeight ? MIN_SIZE : Math.ceil( MIN_SIZE * ratio );\n\tconst minHeight =\n\t\tnaturalHeight < naturalWidth ? MIN_SIZE : Math.ceil( MIN_SIZE / ratio );\n\n\t// With the current implementation of ResizableBox, an image needs an\n\t// explicit pixel value for the max-width. In absence of being able to\n\t// set the content-width, this max-width is currently dictated by the\n\t// vanilla editor style. The following variable adds a buffer to this\n\t// vanilla style, so 3rd party themes have some wiggleroom. This does,\n\t// in most cases, allow you to scale the image beyond the width of the\n\t// main column, though not infinitely.\n\t// @todo It would be good to revisit this once a content-width variable\n\t// becomes available.\n\tconst maxWidthBuffer = maxWidth * 2.5;\n\n\tlet showRightHandle = false;\n\tlet showLeftHandle = false;\n\n\t/* eslint-disable no-lonely-if */\n\t// See https://github.com/WordPress/gutenberg/issues/7584.\n\tif ( align === 'center' ) {\n\t\t// When the image is centered, show both handles.\n\t\tshowRightHandle = true;\n\t\tshowLeftHandle = true;\n\t} else if ( isRTL() ) {\n\t\t// In RTL mode the image is on the right by default.\n\t\t// Show the right handle and hide the left handle only when it is\n\t\t// aligned left. Otherwise always show the left handle.\n\t\tif ( align === 'left' ) {\n\t\t\tshowRightHandle = true;\n\t\t} else {\n\t\t\tshowLeftHandle = true;\n\t\t}\n\t} else {\n\t\t// Show the left handle and hide the right handle only when the\n\t\t// image is aligned right. Otherwise always show the right handle.\n\t\tif ( align === 'right' ) {\n\t\t\tshowLeftHandle = true;\n\t\t} else {\n\t\t\tshowRightHandle = true;\n\t\t}\n\t}\n\t/* eslint-enable no-lonely-if */\n\n\tconst canEditImage =\n\t\tlogoId &&\n\t\tnaturalWidth &&\n\t\tnaturalHeight &&\n\t\timageEditing &&\n\t\t!! editMediaEntity;\n\n\t// Hide crop and dimensions editing in write mode\n\tconst shouldShowCropAndDimensions = ! isContentOnlyMode;\n\n\t// Support the previous location for the Site Icon settings. To be removed\n\t// when the required WP core version for Gutenberg is >= 6.5.0.\n\tconst shouldUseNewUrl = ! window?.__experimentalUseCustomizerSiteLogoUrl;\n\n\tconst siteIconSettingsUrl = shouldUseNewUrl\n\t\t? siteUrl + '/wp-admin/options-general.php'\n\t\t: siteUrl + '/wp-admin/customize.php?autofocus[section]=title_tagline';\n\n\tconst syncSiteIconHelpText = createInterpolateElement(\n\t\t__(\n\t\t\t'Site Icons are what you see in browser tabs, bookmark bars, and within the WordPress mobile apps. To use a custom icon that is different from your site logo, use the <a>Site Icon settings</a>.'\n\t\t),\n\t\t{\n\t\t\ta: (\n\t\t\t\t// eslint-disable-next-line jsx-a11y/anchor-has-content, react/jsx-no-target-blank\n\t\t\t\t<a href={ siteIconSettingsUrl } target=\"_blank\" />\n\t\t\t),\n\t\t}\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<ToolsPanel\n\t\t\t\t\tlabel={ __( 'Settings' ) }\n\t\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t\t>\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => !! width }\n\t\t\t\t\t\tlabel={ __( 'Image width' ) }\n\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\tsetAttributes( { width: undefined } )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Image width' ) }\n\t\t\t\t\t\t\tonChange={ ( newWidth ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { width: newWidth } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tmin={ minWidth }\n\t\t\t\t\t\t\tmax={ maxWidthBuffer }\n\t\t\t\t\t\t\tinitialPosition={ Math.min(\n\t\t\t\t\t\t\t\tdefaultWidth,\n\t\t\t\t\t\t\t\tmaxWidthBuffer\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tvalue={ width || '' }\n\t\t\t\t\t\t\tdisabled={ ! isResizable }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\thasValue={ () => ! isLink }\n\t\t\t\t\t\tlabel={ __( 'Link image to home' ) }\n\t\t\t\t\t\tonDeselect={ () => setAttributes( { isLink: true } ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Link image to home' ) }\n\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { isLink: ! isLink } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tchecked={ isLink }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\n\t\t\t\t\t{ isLink && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => linkTarget === '_blank' }\n\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\tonDeselect={ () =>\n\t\t\t\t\t\t\t\tsetAttributes( { linkTarget: '_self' } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Open in new tab' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlinkTarget: value ? '_blank' : '_self',\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tchecked={ linkTarget === '_blank' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ canUserEdit && (\n\t\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t\t\thasValue={ () => !! shouldSyncIcon }\n\t\t\t\t\t\t\tlabel={ __( 'Use as Site Icon' ) }\n\t\t\t\t\t\t\tonDeselect={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { shouldSyncIcon: false } );\n\t\t\t\t\t\t\t\tsetIcon( undefined );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\tlabel={ __( 'Use as Site Icon' ) }\n\t\t\t\t\t\t\t\tonChange={ ( value ) => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { shouldSyncIcon: value } );\n\t\t\t\t\t\t\t\t\tsetIcon( value ? logoId : undefined );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tchecked={ !! shouldSyncIcon }\n\t\t\t\t\t\t\t\thelp={ syncSiteIconHelpText }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanel>\n\t\t\t</InspectorControls>\n\t\t\t{ canEditImage &&\n\t\t\t\topenMediaEditorModal &&\n\t\t\t\tshouldShowCropAndDimensions && (\n\t\t\t\t\t<BlockControls group=\"block\">\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tref={ cropButtonRef }\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\topenMediaEditorModal( {\n\t\t\t\t\t\t\t\t\tid: logoId,\n\t\t\t\t\t\t\t\t\tonUpdate: handleMediaUpdate,\n\t\t\t\t\t\t\t\t\tonClose: () =>\n\t\t\t\t\t\t\t\t\t\tcropButtonRef.current?.focus(),\n\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taria-haspopup=\"dialog\"\n\t\t\t\t\t\t\ticon={ crop }\n\t\t\t\t\t\t\tlabel={ __( 'Edit image' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BlockControls>\n\t\t\t\t) }\n\t\t\t{ /* Always render ResizableBox but disable resize functionality in contentOnly mode */ }\n\t\t\t<ResizableBox\n\t\t\t\tsize={ {\n\t\t\t\t\twidth: currentWidth,\n\t\t\t\t\theight: currentHeight,\n\t\t\t\t} }\n\t\t\t\tshowHandle={ isSelected && shouldShowCropAndDimensions }\n\t\t\t\tminWidth={ minWidth }\n\t\t\t\tmaxWidth={ maxWidthBuffer }\n\t\t\t\tminHeight={ minHeight }\n\t\t\t\tmaxHeight={ maxWidthBuffer / ratio }\n\t\t\t\tlockAspectRatio\n\t\t\t\tenable={ {\n\t\t\t\t\ttop: false,\n\t\t\t\t\tright: showRightHandle,\n\t\t\t\t\tbottom: true,\n\t\t\t\t\tleft: showLeftHandle,\n\t\t\t\t} }\n\t\t\t\tonResizeStart={ onResizeStart }\n\t\t\t\tonResizeStop={ ( event, direction, elt, delta ) => {\n\t\t\t\t\tonResizeStop();\n\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\twidth: parseInt( currentWidth + delta.width, 10 ),\n\t\t\t\t\t\theight: parseInt( currentHeight + delta.height, 10 ),\n\t\t\t\t\t} );\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ imgWrapper }\n\t\t\t</ResizableBox>\n\t\t</>\n\t);\n};\n\nexport default function LogoEdit( {\n\tattributes,\n\tclassName,\n\tsetAttributes,\n\tisSelected,\n} ) {\n\tconst { width, shouldSyncIcon } = attributes;\n\tconst {\n\t\tsiteLogoId,\n\t\tcanUserEdit,\n\t\turl,\n\t\tsiteIconId,\n\t\tmediaItemData,\n\t\tisRequestingMediaItem,\n\t} = useSelect( ( select ) => {\n\t\tconst { canUser, getEntityRecord, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst _canUserEdit = canUser( 'update', {\n\t\t\tkind: 'root',\n\t\t\tname: 'site',\n\t\t} );\n\t\tconst siteSettings = _canUserEdit\n\t\t\t? getEditedEntityRecord( 'root', 'site' )\n\t\t\t: undefined;\n\t\tconst siteData = getEntityRecord( 'root', '__unstableBase' );\n\t\tconst _siteLogoId = _canUserEdit\n\t\t\t? siteSettings?.site_logo\n\t\t\t: siteData?.site_logo;\n\t\tconst _siteIconId = siteSettings?.site_icon;\n\t\tconst mediaItem =\n\t\t\t_siteLogoId &&\n\t\t\tselect( coreStore ).getEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\t_siteLogoId,\n\t\t\t\t{\n\t\t\t\t\tcontext: 'view',\n\t\t\t\t}\n\t\t\t);\n\t\tconst _isRequestingMediaItem =\n\t\t\t!! _siteLogoId &&\n\t\t\t! select( coreStore ).hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t'postType',\n\t\t\t\t'attachment',\n\t\t\t\t_siteLogoId,\n\t\t\t\t{ context: 'view' },\n\t\t\t] );\n\n\t\treturn {\n\t\t\tsiteLogoId: _siteLogoId,\n\t\t\tcanUserEdit: _canUserEdit,\n\t\t\turl: siteData?.home,\n\t\t\tmediaItemData: mediaItem,\n\t\t\tisRequestingMediaItem: _isRequestingMediaItem,\n\t\t\tsiteIconId: _siteIconId,\n\t\t};\n\t}, [] );\n\tconst { getSettings } = useSelect( blockEditorStore );\n\tconst [ temporaryURL, setTemporaryURL ] = useState();\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\n\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\n\tconst setLogo = ( newValue, shouldForceSync = false ) => {\n\t\t// `shouldForceSync` is used to force syncing when the attribute\n\t\t// may not have updated yet.\n\t\tif ( shouldSyncIcon || shouldForceSync ) {\n\t\t\tsetIcon( newValue );\n\t\t}\n\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_logo: newValue,\n\t\t} );\n\t};\n\n\tconst setIcon = ( newValue ) =>\n\t\t// The new value needs to be `null` to reset the Site Icon.\n\t\teditEntityRecord( 'root', 'site', undefined, {\n\t\t\tsite_icon: newValue ?? null,\n\t\t} );\n\n\tconst { alt_text: alt, source_url: logoUrl } = mediaItemData ?? {};\n\n\tconst onInitialSelectLogo = ( media ) => {\n\t\t// Initialize the syncSiteIcon toggle. If we currently have no Site logo and no\n\t\t// site icon, automatically sync the logo to the icon.\n\t\tif ( shouldSyncIcon === undefined ) {\n\t\t\tconst shouldForceSync = ! siteIconId;\n\t\t\tsetAttributes( { shouldSyncIcon: shouldForceSync } );\n\n\t\t\t// Because we cannot rely on the `shouldSyncIcon` attribute to have updated by\n\t\t\t// the time `setLogo` is called, pass an argument to force the syncing.\n\t\t\tonSelectLogo( media, shouldForceSync );\n\t\t\treturn;\n\t\t}\n\n\t\tonSelectLogo( media );\n\t};\n\n\tconst onSelectLogo = ( media, shouldForceSync = false ) => {\n\t\tif ( ! media ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ! media.id && media.url ) {\n\t\t\t// This is a temporary blob image.\n\t\t\tsetTemporaryURL( media.url );\n\t\t\tsetLogo( undefined );\n\t\t\treturn;\n\t\t}\n\n\t\tsetLogo( media.id, shouldForceSync );\n\t};\n\n\tconst onRemoveLogo = () => {\n\t\tsetLogo( null );\n\t\tsetAttributes( { width: undefined } );\n\t};\n\n\tconst { createErrorNotice } = useDispatch( noticesStore );\n\tconst onUploadError = ( message ) => {\n\t\tcreateErrorNotice( message, { type: 'snackbar' } );\n\t\tsetTemporaryURL();\n\t};\n\n\tconst onFilesDrop = ( filesList ) => {\n\t\tgetSettings().mediaUpload( {\n\t\t\tallowedTypes: ALLOWED_MEDIA_TYPES,\n\t\t\tfilesList,\n\t\t\tonFileChange( [ image ] ) {\n\t\t\t\tif ( isBlobURL( image?.url ) ) {\n\t\t\t\t\tsetTemporaryURL( image.url );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tonInitialSelectLogo( image );\n\t\t\t},\n\t\t\tonError: onUploadError,\n\t\t\tmultiple: false,\n\t\t} );\n\t};\n\n\tconst mediaReplaceFlowProps = {\n\t\tmediaURL: logoUrl,\n\t\tname: ! logoUrl ? __( 'Choose logo' ) : __( 'Replace' ),\n\t\tonSelect: onSelectLogo,\n\t\tonError: onUploadError,\n\t\tonReset: onRemoveLogo,\n\t};\n\tconst controls = canUserEdit && (\n\t\t<BlockControls group=\"other\">\n\t\t\t<MediaReplaceFlow\n\t\t\t\t{ ...mediaReplaceFlowProps }\n\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\tvariant=\"toolbar\"\n\t\t\t/>\n\t\t</BlockControls>\n\t);\n\n\tlet logoImage;\n\tconst isLoading = siteLogoId === undefined || isRequestingMediaItem;\n\tif ( isLoading ) {\n\t\tlogoImage = <WCSpinner />;\n\t}\n\n\t// Reset temporary url when logoUrl is available.\n\tif ( logoUrl && temporaryURL ) {\n\t\tsetTemporaryURL();\n\t}\n\n\tif ( !! logoUrl || !! temporaryURL ) {\n\t\tlogoImage = (\n\t\t\t<>\n\t\t\t\t<SiteLogo\n\t\t\t\t\talt={ alt }\n\t\t\t\t\tattributes={ attributes }\n\t\t\t\t\tclassName={ className }\n\t\t\t\t\tisSelected={ isSelected }\n\t\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\t\tlogoUrl={ temporaryURL || logoUrl }\n\t\t\t\t\tsetLogo={ setLogo }\n\t\t\t\t\tlogoId={ mediaItemData?.id || siteLogoId }\n\t\t\t\t\tsiteUrl={ url }\n\t\t\t\t\tsetIcon={ setIcon }\n\t\t\t\t\ticonId={ siteIconId }\n\t\t\t\t\tcanUserEdit={ canUserEdit }\n\t\t\t\t/>\n\t\t\t\t{ canUserEdit && <DropZone onFilesDrop={ onFilesDrop } /> }\n\t\t\t</>\n\t\t);\n\t}\n\tconst placeholder = ( content ) => {\n\t\tconst placeholderClassName = clsx(\n\t\t\t'block-editor-media-placeholder',\n\t\t\tclassName\n\t\t);\n\n\t\treturn (\n\t\t\t<Placeholder\n\t\t\t\tclassName={ placeholderClassName }\n\t\t\t\tpreview={ logoImage }\n\t\t\t\twithIllustration\n\t\t\t\tstyle={ {\n\t\t\t\t\twidth,\n\t\t\t\t} }\n\t\t\t>\n\t\t\t\t{ content }\n\t\t\t</Placeholder>\n\t\t);\n\t};\n\n\tconst classes = clsx( className, {\n\t\t'is-default-size': ! width,\n\t\t'is-transient': temporaryURL,\n\t} );\n\n\tconst blockProps = useBlockProps( { className: classes } );\n\n\tconst mediaInspectorPanel = ( canUserEdit || logoUrl ) && (\n\t\t<InspectorControls>\n\t\t\t<ToolsPanel\n\t\t\t\tlabel={ __( 'Media' ) }\n\t\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t\t>\n\t\t\t\t{ ! canUserEdit ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tclassName=\"block-library-site-logo__inspector-media-replace-container\"\n\t\t\t\t\t\tstyle={ { gridColumn: '1 / -1' } }\n\t\t\t\t\t>\n\t\t\t\t\t\t<MediaControlPreview\n\t\t\t\t\t\t\turl={ mediaItemData?.source_url }\n\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\tmediaItemData?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t?.file || mediaItemData?.slug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\titemGroupProps={ {\n\t\t\t\t\t\t\t\tisBordered: true,\n\t\t\t\t\t\t\t\tclassName:\n\t\t\t\t\t\t\t\t\t'block-library-site-logo__inspector-readonly-logo-preview',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tclassName=\"block-library-site-logo__inspector-media-replace-title\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t) : (\n\t\t\t\t\t<ToolsPanelItem\n\t\t\t\t\t\thasValue={ () => !! logoUrl }\n\t\t\t\t\t\tlabel={ __( 'Logo' ) }\n\t\t\t\t\t\tisShownByDefault\n\t\t\t\t\t>\n\t\t\t\t\t\t<MediaControl\n\t\t\t\t\t\t\tmediaId={ siteLogoId }\n\t\t\t\t\t\t\tmediaUrl={ logoUrl }\n\t\t\t\t\t\t\tfilename={\n\t\t\t\t\t\t\t\tmediaItemData?.media_details?.sizes?.full\n\t\t\t\t\t\t\t\t\t?.file || mediaItemData?.slug\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\t\t\tonSelect={ onSelectLogo }\n\t\t\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\t\t\tonReset={ onRemoveLogo }\n\t\t\t\t\t\t\tisUploading={ !! temporaryURL }\n\t\t\t\t\t\t\temptyLabel={ __( 'Logo' ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</ToolsPanelItem>\n\t\t\t\t) }\n\t\t\t</ToolsPanel>\n\t\t</InspectorControls>\n\t);\n\n\treturn (\n\t\t<div { ...blockProps }>\n\t\t\t{ controls }\n\t\t\t{ mediaInspectorPanel }\n\t\t\t{ ( !! logoUrl || !! temporaryURL ) && logoImage }\n\t\t\t{ ( isLoading ||\n\t\t\t\t( ! temporaryURL && ! logoUrl && ! canUserEdit ) ) && (\n\t\t\t\t<Placeholder className=\"site-logo_placeholder\" withIllustration>\n\t\t\t\t\t{ isLoading && (\n\t\t\t\t\t\t<span className=\"components-placeholder__preview\">\n\t\t\t\t\t\t\t<WCSpinner />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t</Placeholder>\n\t\t\t) }\n\t\t\t{ ! isLoading && ! temporaryURL && ! logoUrl && canUserEdit && (\n\t\t\t\t<MediaPlaceholder\n\t\t\t\t\tonSelect={ onInitialSelectLogo }\n\t\t\t\t\tallowedTypes={ ALLOWED_MEDIA_TYPES }\n\t\t\t\t\tonError={ onUploadError }\n\t\t\t\t\tplaceholder={ placeholder }\n\t\t\t\t\tmediaLibraryButton={ ( { open } ) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\ticon={ upload }\n\t\t\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Choose logo' ) }\n\t\t\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\t\t\ttooltipPosition=\"middle right\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\topen();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t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